Parcourir la source

feat(customer): 添加客户信息导入功能和扩展字段

- 添加客户信息导入导出功能,支持Excel批量导入
- 在ComBank相关类中添加省份、城市、区县编码字段
- 在CustomerInfo中添加统一社会信用代码、客户来源、发票地址等扩展字段
- 在CustomerSalesInfo中添加信用等级字段
- 添加多个按名称查询的方法,包括公司、货币、客户级别、客户类型等
- 重构供应商信息导入相关的接口和服务实现
- 优化银行信息中的字段注释,将传真号码改为行号
hurx il y a 1 semaine
Parent
commit
973685f064
60 fichiers modifiés avec 1576 ajouts et 61 suppressions
  1. 4 0
      ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/RemoteComCompanyService.java
  2. 9 0
      ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/RemoteComCurrencyService.java
  3. 8 0
      ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/RemoteComCustomerLevelService.java
  4. 8 0
      ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/RemoteComCustomerTypeService.java
  5. 4 1
      ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/RemoteComStaffService.java
  6. 4 0
      ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/RemoteCreditLevelService.java
  7. 9 0
      ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/RemoteProductTaxrateService.java
  8. 55 0
      ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/domain/vo/RemoteComCompanyVo.java
  9. 34 0
      ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/domain/vo/RemoteComCurrencyVo.java
  10. 31 0
      ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/domain/vo/RemoteComCustomerLevelVo.java
  11. 26 0
      ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/domain/vo/RemoteComCustomerTypeVo.java
  12. 31 0
      ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/domain/vo/RemoteCreditLevelVo.java
  13. 28 0
      ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/domain/vo/RemoteProductTaxrateVo.java
  14. 43 4
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/controller/CustomerInfoController.java
  15. 47 24
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/controller/SupplierInfoController.java
  16. 69 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/CustomerInfo.java
  17. 5 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/CustomerSalesInfo.java
  18. 70 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/bo/CustomerInfoBo.java
  19. 5 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/bo/CustomerSalesInfoBo.java
  20. 211 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/vo/CustomerInfoImportVo.java
  21. 70 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/vo/CustomerInfoVo.java
  22. 5 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/vo/CustomerSalesInfoVo.java
  23. 24 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/vo/SupplierInfoImportVo.java
  24. 238 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/listener/CustomerImportListener.java
  25. 126 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/listener/SupplierImportListener.java
  26. 24 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/ICustomerInfoService.java
  27. 3 1
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/IEnterpriseScaleService.java
  28. 7 4
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/IIndustryCategoryService.java
  29. 25 4
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/ISupplierInfoService.java
  30. 46 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/CustomerInfoServiceImpl.java
  31. 5 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/EnterpriseScaleServiceImpl.java
  32. 5 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/IndustryCategoryServiceImpl.java
  33. 33 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/SupplierInfoServiceImpl.java
  34. 1 1
      ruoyi-modules/ruoyi-product/src/main/java/org/dromara/product/service/IProductTaxrateService.java
  35. 4 4
      ruoyi-modules/ruoyi-product/src/main/java/org/dromara/product/service/impl/ProductTaxrateServiceImpl.java
  36. 21 1
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/ComBank.java
  37. 21 1
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/ComBankBo.java
  38. 2 5
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/CreditLevelBo.java
  39. 22 2
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/ComBankVo.java
  40. 11 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteComCompanyServiceImpl.java
  41. 25 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteComCurrencyServiceImpl.java
  42. 25 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteComCustomerLevelServiceImpl.java
  43. 25 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteComCustomerTypeServiceImpl.java
  44. 6 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteComStaffServiceImpl.java
  45. 8 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteCreditLevelServiceImpl.java
  46. 25 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteProductTaxrateServiceImpl.java
  47. 2 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/IComCompanyService.java
  48. 3 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/IComCurrencyService.java
  49. 2 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/IComCustomerLevelService.java
  50. 3 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/IComCustomerTypeService.java
  51. 3 1
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/IComStaffService.java
  52. 2 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ICreditLevelService.java
  53. 3 1
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/IProductTaxrateService.java
  54. 5 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/ComCompanyServiceImpl.java
  55. 6 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/ComCurrencyServiceImpl.java
  56. 6 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/ComCustomerLevelServiceImpl.java
  57. 6 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/ComCustomerTypeServiceImpl.java
  58. 13 3
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/ComStaffServiceImpl.java
  59. 5 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/CreditLevelServiceImpl.java
  60. 9 4
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/ProductTaxrateServiceImpl.java

+ 4 - 0
ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/RemoteComCompanyService.java

@@ -1,9 +1,13 @@
 package org.dromara.system.api;
 
+import org.dromara.system.api.domain.vo.RemoteComCompanyVo;
+
 import java.util.Map;
 import java.util.Set;
 
 public interface RemoteComCompanyService {
 
     Map<Long, String> selectCompanyNameByIds(Set<Long> ids);
+
+    RemoteComCompanyVo selectByCompanyName(String companyName);
 }

+ 9 - 0
ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/RemoteComCurrencyService.java

@@ -0,0 +1,9 @@
+package org.dromara.system.api;
+
+import org.dromara.system.api.domain.vo.RemoteComCompanyVo;
+import org.dromara.system.api.domain.vo.RemoteComCurrencyVo;
+
+public interface RemoteComCurrencyService {
+
+    RemoteComCurrencyVo selectByCurrencyName(String currencyName);
+}

+ 8 - 0
ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/RemoteComCustomerLevelService.java

@@ -0,0 +1,8 @@
+package org.dromara.system.api;
+
+import org.dromara.system.api.domain.vo.RemoteComCustomerLevelVo;
+
+public interface RemoteComCustomerLevelService {
+
+    RemoteComCustomerLevelVo selectCustomerLeveByLevelName(String levelName);
+}

+ 8 - 0
ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/RemoteComCustomerTypeService.java

@@ -0,0 +1,8 @@
+package org.dromara.system.api;
+
+import org.dromara.system.api.domain.vo.RemoteComCustomerLevelVo;
+import org.dromara.system.api.domain.vo.RemoteComCustomerTypeVo;
+
+public interface RemoteComCustomerTypeService {
+    RemoteComCustomerTypeVo selectCustomerTypeByTypeName(String typeName);
+}

+ 4 - 1
ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/RemoteComStaffService.java

@@ -10,13 +10,16 @@ public interface RemoteComStaffService {
 
     Map<Long, String> selectStaffNameByIds(Set<Long> ids);
 
-    Map<String,String> selectStaffNameAndCode();
+    Map<String, String> selectStaffNameAndCode();
 
     /**
      * 根据人员ID批量查询人员完整信息
+     *
      * @param ids 人员ID集合
      * @return 人员信息列表
      */
     List<RemoteComStaffVo> selectStaffByIds(Set<Long> ids);
 
+    RemoteComStaffVo selectStaffByStaffName(String staffName);
+
 }

+ 4 - 0
ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/RemoteCreditLevelService.java

@@ -1,5 +1,7 @@
 package org.dromara.system.api;
 
+import org.dromara.system.api.domain.vo.RemoteCreditLevelVo;
+
 import java.util.Map;
 import java.util.Set;
 
@@ -15,4 +17,6 @@ public interface RemoteCreditLevelService {
      * @return Map<ID, 名称>
      */
     Map<Long, String> selectCreditLevelNameByIds(Set<Long> ids);
+
+    RemoteCreditLevelVo selectByCreditLevelName(String creditLevelName);
 }

+ 9 - 0
ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/RemoteProductTaxrateService.java

@@ -0,0 +1,9 @@
+package org.dromara.system.api;
+
+
+import org.dromara.system.api.domain.vo.RemoteProductTaxrateVo;
+
+public interface RemoteProductTaxrateService {
+
+    RemoteProductTaxrateVo selectByTaxrateNo(String taxrateNo);
+}

+ 55 - 0
ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/domain/vo/RemoteComCompanyVo.java

@@ -0,0 +1,55 @@
+package org.dromara.system.api.domain.vo;
+
+import cn.idev.excel.annotation.ExcelProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.dromara.common.excel.annotation.ExcelDictFormat;
+import org.dromara.common.excel.convert.ExcelDictConvert;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+@Data
+@NoArgsConstructor
+public class RemoteComCompanyVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    private Long id;
+
+    /**
+     * 公司全名
+     */
+    @ExcelProperty(value = "公司全名")
+    private String companyFullName;
+
+
+    /**
+     * 公司编号
+     */
+    @ExcelProperty(value = "公司编号")
+    private String companyCode;
+
+    /**
+     * 公司名称
+     */
+    @ExcelProperty(value = "公司名称")
+    private String companyName;
+
+    /**
+     * 数据来源
+     */
+    @ExcelProperty(value = "数据来源")
+    private String dataSource;
+
+    /**
+     * 状态(0正常 1停用)
+     */
+    @ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "0=正常,1=停用")
+    private String status;
+}

+ 34 - 0
ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/domain/vo/RemoteComCurrencyVo.java

@@ -0,0 +1,34 @@
+package org.dromara.system.api.domain.vo;
+
+import cn.idev.excel.annotation.ExcelProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+@Data
+@NoArgsConstructor
+public class RemoteComCurrencyVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    @ExcelProperty(value = "主键ID")
+    private Long id;
+
+    /**
+     * 货币编码
+     */
+    @ExcelProperty(value = "货币编码")
+    private String currencyCode;
+
+    /**
+     * 货币名称
+     */
+    @ExcelProperty(value = "货币名称")
+    private String currencyName;
+}

+ 31 - 0
ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/domain/vo/RemoteComCustomerLevelVo.java

@@ -0,0 +1,31 @@
+package org.dromara.system.api.domain.vo;
+
+import cn.idev.excel.annotation.ExcelProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+@Data
+@NoArgsConstructor
+public class RemoteComCustomerLevelVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    private Long id;
+
+    /**
+     * 客户等级编码
+     */
+    private String levelCode;
+
+    /**
+     * 客户等级名称
+     */
+    private String levelName;
+}

+ 26 - 0
ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/domain/vo/RemoteComCustomerTypeVo.java

@@ -0,0 +1,26 @@
+package org.dromara.system.api.domain.vo;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+@Data
+@NoArgsConstructor
+public class RemoteComCustomerTypeVo implements Serializable {
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+
+    /**
+     * 客户类型编码
+     */
+    private String typeCode;
+
+    /**
+     * 客户类型名称
+     */
+    private String typeName;
+}

+ 31 - 0
ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/domain/vo/RemoteCreditLevelVo.java

@@ -0,0 +1,31 @@
+package org.dromara.system.api.domain.vo;
+
+import cn.idev.excel.annotation.ExcelProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+@Data
+@NoArgsConstructor
+public class RemoteCreditLevelVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    private Long id;
+
+    /**
+     * 信用等级编码
+     */
+    private String creditLevelNo;
+
+    /**
+     * 信用等级名称
+     */
+    private String creditLevelName;
+}

+ 28 - 0
ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/domain/vo/RemoteProductTaxrateVo.java

@@ -0,0 +1,28 @@
+package org.dromara.system.api.domain.vo;
+
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+@Data
+public class RemoteProductTaxrateVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键,自增ID
+     */
+    private Long id;
+
+    /**
+     * 税率编号
+     */
+    private String taxrateNo;
+
+    /**
+     * 税率名称
+     */
+    private String taxrateName;
+}

+ 43 - 4
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/controller/CustomerInfoController.java

@@ -4,9 +4,11 @@ import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.constraints.NotEmpty;
 import jakarta.validation.constraints.NotNull;
 import lombok.RequiredArgsConstructor;
+import org.apache.dubbo.config.annotation.DubboReference;
 import org.dromara.common.core.domain.R;
 import org.dromara.common.core.utils.StringUtils;
 import org.dromara.common.core.validate.AddGroup;
+import org.dromara.common.excel.core.ExcelResult;
 import org.dromara.common.excel.utils.ExcelUtil;
 import org.dromara.common.idempotent.annotation.RepeatSubmit;
 import org.dromara.common.log.annotation.Log;
@@ -19,14 +21,17 @@ import org.dromara.customer.domain.bo.CustomerListBo;
 import org.dromara.customer.domain.bo.CustomerSalesInfoBo;
 import org.dromara.customer.domain.bo.MessagePublishCustomerBo;
 import org.dromara.customer.domain.dto.SetCustomerInfoTagDto;
-import org.dromara.customer.domain.vo.ContractVo;
-import org.dromara.customer.domain.vo.CustomerInfoVo;
-import org.dromara.customer.domain.vo.CustomerListVo;
-import org.dromara.customer.domain.vo.MessagePublishCustomerVo;
+import org.dromara.customer.domain.vo.*;
+import org.dromara.customer.listener.CustomerImportListener;
 import org.dromara.customer.service.ICustomerInfoService;
+import org.dromara.system.api.RemoteProductTaxrateService;
+import org.dromara.system.api.*;
+import org.springframework.http.MediaType;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -41,6 +46,22 @@ import java.util.List;
 @RestController
 @RequestMapping("/customerInfo")
 public class CustomerInfoController extends BaseController {
+    @DubboReference
+    private RemoteComCompanyService remoteComCompanyService;
+
+    @DubboReference
+    private RemoteCreditLevelService remoteCreditLevelService;
+    @DubboReference
+    private RemoteComCurrencyService remoteComCurrencyService;
+
+    @DubboReference
+    private RemoteComCustomerTypeService remoteComCustomerTypeService;
+    @DubboReference
+    private RemoteProductTaxrateService remoteProductTaxrateService;
+    @DubboReference
+    private RemoteComCustomerLevelService remoteComCustomerLevelService;
+    @DubboReference
+    private RemoteComStaffService remoteComStaffService;
 
     private final ICustomerInfoService customerInfoService;
 
@@ -202,4 +223,22 @@ public class CustomerInfoController extends BaseController {
     public R<Integer> transferServiceStaff(@RequestBody SetCustomerInfoTagDto bo) {
         return R.ok(customerInfoService.transferServiceStaff(bo.getCustomerIds(), bo.getServiceStaffId()));
     }
+
+    /**
+     * 导入数据
+     *
+     * @param file          导入文件
+     * @param updateSupport 是否更新已存在数据
+     */
+    @Log(title = "客户信息", businessType = BusinessType.IMPORT)
+    @PostMapping(value = "/importData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+    public R<Void> importData(@RequestPart("file") MultipartFile file, boolean updateSupport) throws Exception {
+        ExcelResult<CustomerInfoImportVo> result = ExcelUtil.importExcel(file.getInputStream(), CustomerInfoImportVo.class, new CustomerImportListener(updateSupport, remoteComCompanyService, remoteComCustomerLevelService, remoteCreditLevelService, remoteComCurrencyService, remoteComCustomerTypeService, remoteProductTaxrateService, remoteComStaffService));
+        return R.ok(result.getAnalysis());
+    }
+
+    @PostMapping("/importTemplate")
+    public void importTemplate(HttpServletResponse response) {
+        ExcelUtil.exportExcel(new ArrayList<>(), "客户数据", CustomerInfoImportVo.class, response);
+    }
 }

+ 47 - 24
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/controller/SupplierInfoController.java

@@ -1,34 +1,40 @@
 package org.dromara.customer.controller;
 
-import java.util.Arrays;
-import java.util.List;
-import java.util.stream.Collectors;
-
 import cn.hutool.core.util.ObjectUtil;
 import com.fasterxml.jackson.core.JsonProcessingException;
-import lombok.RequiredArgsConstructor;
 import jakarta.servlet.http.HttpServletResponse;
-import jakarta.validation.constraints.*;
-import cn.dev33.satoken.annotation.SaCheckPermission;
-import org.dromara.customer.domain.SupplierInfo;
-import org.dromara.customer.domain.vo.SupplierInformationVo;
-import org.dromara.customer.service.ISupplierProcurementService;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.validation.annotation.Validated;
-import org.dromara.common.idempotent.annotation.RepeatSubmit;
-import org.dromara.common.log.annotation.Log;
-import org.dromara.common.web.core.BaseController;
-import org.dromara.common.mybatis.core.page.PageQuery;
+import jakarta.validation.constraints.NotEmpty;
+import jakarta.validation.constraints.NotNull;
+import lombok.RequiredArgsConstructor;
 import org.dromara.common.core.domain.R;
 import org.dromara.common.core.validate.AddGroup;
 import org.dromara.common.core.validate.EditGroup;
-import org.dromara.common.log.enums.BusinessType;
+import org.dromara.common.excel.core.ExcelResult;
 import org.dromara.common.excel.utils.ExcelUtil;
-import org.dromara.customer.domain.vo.SupplierInfoVo;
+import org.dromara.common.idempotent.annotation.RepeatSubmit;
+import org.dromara.common.log.annotation.Log;
+import org.dromara.common.log.enums.BusinessType;
+import org.dromara.common.mybatis.core.page.PageQuery;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+import org.dromara.common.web.core.BaseController;
 import org.dromara.customer.domain.bo.SupplierInfoBo;
+import org.dromara.customer.domain.vo.CustomerInfoImportVo;
+import org.dromara.customer.domain.vo.SupplierInfoImportVo;
+import org.dromara.customer.domain.vo.SupplierInfoVo;
+import org.dromara.customer.listener.CustomerImportListener;
+import org.dromara.customer.listener.SupplierImportListener;
 import org.dromara.customer.service.ISupplierInfoService;
-import org.dromara.common.mybatis.core.page.TableDataInfo;
+import org.dromara.customer.service.ISupplierProcurementService;
+import org.springframework.http.MediaType;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * 供应商信息
@@ -63,6 +69,7 @@ public class SupplierInfoController extends BaseController {
 
     /**
      * 供应商信息 获取供应商信息列表
+     *
      * @param bo
      * @param pageQuery
      * @return
@@ -75,6 +82,7 @@ public class SupplierInfoController extends BaseController {
 
     /**
      * 供应商审核 获取供应商信息列表
+     *
      * @param bo
      * @param pageQuery
      * @return
@@ -88,6 +96,7 @@ public class SupplierInfoController extends BaseController {
 
     /**
      * 根据id获取品目列表
+     *
      * @param supplierId
      * @return
      */
@@ -105,6 +114,7 @@ public class SupplierInfoController extends BaseController {
 
     /**
      * 根据id获取品目列表 srm用
+     *
      * @param supplierId
      * @return
      */
@@ -150,7 +160,7 @@ public class SupplierInfoController extends BaseController {
      */
     @GetMapping("/srm/{id}")
     public R<SupplierInfoVo> getSrmInfo(@NotNull(message = "主键不能为空")
-                                     @PathVariable("id") Long id) throws JsonProcessingException {
+                                        @PathVariable("id") Long id) throws JsonProcessingException {
         return R.ok(supplierInfoService.querySrmById(id));
     }
 
@@ -187,7 +197,6 @@ public class SupplierInfoController extends BaseController {
     }
 
 
-
     /**
      * 删除供应商信息
      *
@@ -201,8 +210,6 @@ public class SupplierInfoController extends BaseController {
         return toAjax(supplierInfoService.deleteWithValidByIds(List.of(ids), true));
     }
 
-
-
     @RepeatSubmit()
     @PutMapping("/edit")
     @Transactional(rollbackFor = Exception.class)
@@ -210,6 +217,22 @@ public class SupplierInfoController extends BaseController {
         return toAjax(supplierInfoService.srmUpdateByBo(bo));
     }
 
+    /**
+     * 导入数据
+     *
+     * @param file          导入文件
+     * @param updateSupport 是否更新已存在数据
+     */
+    @Log(title = "供应商信息", businessType = BusinessType.IMPORT)
+    @PostMapping(value = "/importData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+    public R<Void> importData(@RequestPart("file") MultipartFile file, boolean updateSupport) throws Exception {
+        ExcelResult<SupplierInfoImportVo> result = ExcelUtil.importExcel(file.getInputStream(), SupplierInfoImportVo.class, new SupplierImportListener(updateSupport));
+        return R.ok(result.getAnalysis());
+    }
 
+    @PostMapping("/importTemplate")
+    public void importTemplate(HttpServletResponse response) {
+        ExcelUtil.exportExcel(new ArrayList<>(), "供应商数据", SupplierInfoImportVo.class, response);
+    }
 
 }

+ 69 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/CustomerInfo.java

@@ -1,5 +1,6 @@
 package org.dromara.customer.domain;
 
+import cn.idev.excel.annotation.ExcelProperty;
 import org.dromara.common.tenant.core.TenantEntity;
 import com.baomidou.mybatisplus.annotation.*;
 import lombok.Data;
@@ -56,6 +57,21 @@ public class CustomerInfo extends TenantEntity {
      */
     private String businessCustomerName;
 
+    /**
+     * 统一社会信用代码
+     */
+    private String socialCreditCode;
+    /**
+     * 客户来源编码
+     */
+    private String sourceNo;
+
+    /**
+     * 客户来源
+     */
+    private String sourceName;
+
+
     private Long belongDeptId;
 
     /**
@@ -141,6 +157,11 @@ public class CustomerInfo extends TenantEntity {
      */
     private String address;
 
+    /**
+     * 发票地址
+     */
+    private String invoiceAddress;
+
     /**
      * 省份编码
      */
@@ -177,5 +198,53 @@ public class CustomerInfo extends TenantEntity {
      */
     private String remark;
 
+    /**
+     * 单价含税
+     */
+    private String unitPrice;
+
+    /**
+     * 账款额度超限 0不启用 1启用
+     */
+    private String creditLimit;
+
+    /**
+     * 额度超期 0不启用 1启用
+     */
+    private String creditTimeLimit;
+
+    /**
+     * 销售通路编号
+     */
+    private String sellChannelNo;
+
+    /**
+     * 销售通路
+     */
+    private String sellChannel;
+
+    /**
+     * 销售开票类型
+     */
+    private String sellInvoiceTypeNo;
+
+    /**
+     * 销售开票类型
+     */
+    private String sellInvoiceType;
+
+    /**
+     * 交易币别
+     */
+    private Long dealCurrencyId;
 
+    /**
+     * 账款归属
+     */
+    private String accountBelong;
+
+    /**
+     * 税码
+     */
+    private Long rateId;
 }

+ 5 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/CustomerSalesInfo.java

@@ -34,6 +34,11 @@ public class CustomerSalesInfo extends TenantEntity {
      */
     private Long customerId;
 
+    /**
+     * 信用等级
+     */
+    private Long creditLevelId;
+
     /**
      * 信用额度
      */

+ 70 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/bo/CustomerInfoBo.java

@@ -62,6 +62,21 @@ public class CustomerInfoBo extends BaseEntity {
 //    @NotBlank(message = "工商名称不能为空", groups = {AddGroup.class, EditGroup.class})
     private String businessCustomerName;
 
+    /**
+     * 统一社会信用代码
+     */
+    private String socialCreditCode;
+
+    /**
+     * 客户来源编码
+     */
+    private String sourceNo;
+
+    /**
+     * 客户来源
+     */
+    private String sourceName;
+
     /**
      * 企业简称
      */
@@ -149,6 +164,11 @@ public class CustomerInfoBo extends BaseEntity {
      */
     private String address;
 
+    /**
+     * 发票地址
+     */
+    private String invoiceAddress;
+
     /**
      * 省份编码
      */
@@ -174,6 +194,56 @@ public class CustomerInfoBo extends BaseEntity {
      */
     private String status;
 
+    /**
+     * 单价含税
+     */
+    private String unitPrice;
+
+    /**
+     * 账款额度超限 0不启用 1启用
+     */
+    private String creditLimit;
+
+    /**
+     * 额度超期 0不启用 1启用
+     */
+    private String creditTimeLimit;
+
+    /**
+     * 销售通路编号
+     */
+    private String sellChannelNo;
+
+    /**
+     * 销售通路
+     */
+    private String sellChannel;
+
+    /**
+     * 销售开票类型
+     */
+    private String sellInvoiceTypeNo;
+
+    /**
+     * 销售开票类型
+     */
+    private String sellInvoiceType;
+
+    /**
+     * 交易币别
+     */
+    private Long dealCurrencyId;
+
+    /**
+     * 账款归属
+     */
+    private String accountBelong;
+
+    /**
+     * 税码
+     */
+    private Long rateId;
+
     /**
      * 备注
      */

+ 5 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/bo/CustomerSalesInfoBo.java

@@ -96,6 +96,11 @@ public class CustomerSalesInfoBo extends BaseEntity {
     @NotNull(message = "服务人员不能为空", groups = {AddGroup.class, EditGroup.class})
     private Long serviceStaffId;
 
+    /**
+     * 信用等级
+     */
+    private Long creditLevelId;
+
     /**
      * 所属部门
      */

+ 211 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/vo/CustomerInfoImportVo.java

@@ -0,0 +1,211 @@
+package org.dromara.customer.domain.vo;
+
+import cn.idev.excel.annotation.ExcelProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+@Data
+@NoArgsConstructor
+public class CustomerInfoImportVo implements Serializable {
+
+    @ExcelProperty(value = "公司")
+    private String companyCode;
+
+    @ExcelProperty(value = "名称")
+    private String companyName;
+
+    /**
+     * 客户编号
+     */
+    @ExcelProperty(value = "编号")
+    private String customerNo;
+
+    /**
+     * 客户名称
+     */
+    @ExcelProperty(value = "客户名称")
+    private String customerName;
+
+    /**
+     * 工商名称
+     */
+    @ExcelProperty(value = "工商名称")
+    private String businessCustomerName;
+
+    /**
+     * 简称
+     */
+    @ExcelProperty(value = "简称")
+    private String shortName;
+
+    /**
+     * 统一社会信用代码
+     */
+    @ExcelProperty(value = "统一社会信用代码")
+    private String socialCreditCode;
+
+    /**
+     * 客户来源编码
+     */
+    @ExcelProperty(value = "客户来源")
+    private String sourceNo;
+
+    /**
+     * 客户来源
+     */
+    @ExcelProperty(value = "客户来源名称")
+    private String sourceName;
+
+    /**
+     * 客户等级
+     */
+    @ExcelProperty(value = "客户等级")
+    private String customerLevelNo;
+
+    /**
+     * 客户等级
+     */
+    @ExcelProperty(value = "客户等级名称")
+    private String customerLevelName;
+
+    /**
+     * 类别
+     */
+    @ExcelProperty(value = "类别")
+    private String customerTypeNo;
+
+    /**
+     * 客户类别
+     */
+    @ExcelProperty(value = "客户类别名称")
+    private String customerTypeName;
+
+    /**
+     * 行业类别
+     */
+    @ExcelProperty(value = "行业类别")
+    private String industryCategoryNo;
+
+    /**
+     * 行业类别
+     */
+    @ExcelProperty(value = "行业类别名称")
+    private String industryCategory;
+
+    /**
+     * 企业规模
+     */
+    @ExcelProperty(value = "企业规模")
+    private String enterpriseScaleNo;
+
+    /**
+     * 企业规模
+     */
+    @ExcelProperty(value = "企业规模名称")
+    private String enterpriseScale;
+
+    /**
+     * 详细地址
+     */
+    @ExcelProperty(value = "联系地址")
+    private String address;
+
+    /**
+     * 发票地址
+     */
+    @ExcelProperty(value = "发票地址")
+    private String invoiceAddress;
+
+    /**
+     * 销售人员--业务人员
+     */
+    @ExcelProperty(value = "业务人员")
+    private String salesPersonNo;
+
+    /**
+     * 销售人员--业务人员
+     */
+    @ExcelProperty(value = "姓名")
+    private String salesPersonName;
+
+    /**
+     * 业务助理
+     */
+    @ExcelProperty(value = "业务助理")
+    private String serviceStaffNo;
+
+    /**
+     * 业务助理名称
+     */
+    @ExcelProperty(value = "业务助理名称")
+    private String serviceStaffName;
+
+    /**
+     * 单价含税
+     */
+    @ExcelProperty(value = "单价含税")
+    private String unitPrice;
+
+    /**
+     * 账款额度超限
+     */
+    @ExcelProperty(value = "账款额度超限")
+    private String creditLimit;
+
+    /**
+     * 额度超期
+     */
+    @ExcelProperty(value = "额度超期")
+    private String creditTimeLimit;
+
+    /**
+     * 信用等级
+     */
+    @ExcelProperty(value = "信用等级")
+    private String creditLevel;
+
+    /**
+     * 销售通路编号
+     */
+    @ExcelProperty(value = "销售通路")
+    private String sellChannelNo;
+
+    /**
+     * 销售通路
+     */
+    @ExcelProperty(value = "销售通路名称")
+    private String sellChannel;
+
+    /**
+     * 销售开票类型
+     */
+    @ExcelProperty(value = "销售开票类型")
+    private String sellInvoiceTypeNo;
+
+    /**
+     * 销售开票类型
+     */
+    @ExcelProperty(value = "销售开票类型名称")
+    private String sellInvoiceType;
+
+    /**
+     * 交易币别
+     */
+    @ExcelProperty(value = "交易币别")
+    private String dealCurrency;
+
+    /**
+     * 账款归属
+     */
+    @ExcelProperty(value = "账款归属")
+    private String accountBelong;
+
+    /**
+     * 税码
+     */
+    @ExcelProperty(value = "税码")
+    private String rateName;
+
+}

+ 70 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/vo/CustomerInfoVo.java

@@ -71,6 +71,21 @@ public class CustomerInfoVo implements Serializable {
     @ExcelProperty(value = "工商名称")
     private String businessCustomerName;
 
+    /**
+     * 统一社会信用代码
+     */
+    private String socialCreditCode;
+
+    /**
+     * 客户来源编码
+     */
+    private String sourceNo;
+
+    /**
+     * 客户来源
+     */
+    private String sourceName;
+
     private Long belongDeptId;
 
     /**
@@ -171,6 +186,11 @@ public class CustomerInfoVo implements Serializable {
     @ExcelDictFormat(readConverterExp = "注=册地址")
     private String address;
 
+    /**
+     * 发票地址
+     */
+    private String invoiceAddress;
+
     /**
      * 省份编码
      */
@@ -206,6 +226,56 @@ public class CustomerInfoVo implements Serializable {
 
     private String enterpriseScale;//企业规模
 
+    /**
+     * 单价含税
+     */
+    private String unitPrice;
+
+    /**
+     * 账款额度超限 0不启用 1启用
+     */
+    private String creditLimit;
+
+    /**
+     * 额度超期 0不启用 1启用
+     */
+    private String creditTimeLimit;
+
+    /**
+     * 销售通路编号
+     */
+    private String sellChannelNo;
+
+    /**
+     * 销售通路
+     */
+    private String sellChannel;
+
+    /**
+     * 销售开票类型
+     */
+    private String sellInvoiceTypeNo;
+
+    /**
+     * 销售开票类型
+     */
+    private String sellInvoiceType;
+
+    /**
+     * 交易币别
+     */
+    private Long dealCurrencyId;
+
+    /**
+     * 账款归属
+     */
+    private String accountBelong;
+
+    /**
+     * 税码
+     */
+    private Long rateId;
+
     /**
      * 备注
      */

+ 5 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/vo/CustomerSalesInfoVo.java

@@ -41,6 +41,11 @@ public class CustomerSalesInfoVo implements Serializable {
     @ExcelProperty(value = "关联客户ID")
     private Long customerId;
 
+    /**
+     * 信用等级
+     */
+    private Long creditLevelId;
+
     /**
      * 信用额度
      */

+ 24 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/vo/SupplierInfoImportVo.java

@@ -0,0 +1,24 @@
+package org.dromara.customer.domain.vo;
+
+import cn.idev.excel.annotation.ExcelProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+@Data
+@NoArgsConstructor
+public class SupplierInfoImportVo implements Serializable {
+
+    /**
+     * 供应商编号
+     */
+    @ExcelProperty(value = "供应商编号")
+    private String supplierNo;
+
+    /**
+     * 供应商名称
+     */
+    @ExcelProperty(value = "供应商名称")
+    private String enterpriseName;
+}

+ 238 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/listener/CustomerImportListener.java

@@ -0,0 +1,238 @@
+package org.dromara.customer.listener;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.http.HtmlUtil;
+import cn.idev.excel.context.AnalysisContext;
+import cn.idev.excel.event.AnalysisEventListener;
+import jakarta.validation.ConstraintViolation;
+import jakarta.validation.ConstraintViolationException;
+import org.dromara.common.core.exception.ServiceException;
+import org.dromara.common.core.utils.SpringUtils;
+import org.dromara.common.core.utils.StreamUtils;
+import org.dromara.common.core.utils.ValidatorUtils;
+import org.dromara.common.excel.core.ExcelListener;
+import org.dromara.common.excel.core.ExcelResult;
+import org.dromara.common.satoken.utils.LoginHelper;
+import org.dromara.customer.domain.bo.CustomerInfoBo;
+import org.dromara.customer.domain.bo.CustomerSalesInfoBo;
+import org.dromara.customer.domain.vo.CustomerInfoImportVo;
+import org.dromara.customer.domain.vo.CustomerInfoVo;
+import org.dromara.customer.domain.vo.EnterpriseScaleVo;
+import org.dromara.customer.domain.vo.IndustryCategoryVo;
+import org.dromara.customer.service.ICustomerInfoService;
+import org.dromara.customer.service.IEnterpriseScaleService;
+import org.dromara.customer.service.IIndustryCategoryService;
+import org.dromara.system.api.RemoteProductTaxrateService;
+import org.dromara.system.api.domain.vo.RemoteProductTaxrateVo;
+import org.dromara.system.api.*;
+import org.dromara.system.api.domain.vo.*;
+
+import java.util.List;
+
+import static org.dromara.common.mybatis.core.mapper.BaseMapperPlus.log;
+
+public class CustomerImportListener extends AnalysisEventListener<CustomerInfoImportVo> implements ExcelListener<CustomerInfoImportVo> {
+
+
+    private final ICustomerInfoService customerInfoService;
+    private RemoteComCompanyService remoteComCompanyService;
+
+    private RemoteCreditLevelService remoteCreditLevelService;
+
+    private RemoteComCurrencyService remoteComCurrencyService;
+
+    private RemoteComCustomerTypeService remoteComCustomerTypeService;
+
+    private RemoteProductTaxrateService remoteProductTaxrateService;
+
+    private RemoteComCustomerLevelService remoteComCustomerLevelService;
+
+    private RemoteComStaffService remoteComStaffService;
+
+    private IEnterpriseScaleService scaleService;
+
+    private IIndustryCategoryService industryCategoryService;
+
+    private final Boolean isUpdateSupport;
+
+    private final Long operUserId;
+
+    private int successNum = 0;
+    private int failureNum = 0;
+    private final StringBuilder successMsg = new StringBuilder();
+    private final StringBuilder failureMsg = new StringBuilder();
+
+    public CustomerImportListener(Boolean isUpdateSupport, RemoteComCompanyService remoteComCompanyService,
+                                  RemoteComCustomerLevelService remoteComCustomerLevelService,
+                                  RemoteCreditLevelService remoteCreditLevelService,
+                                  RemoteComCurrencyService remoteComCurrencyService,
+                                  RemoteComCustomerTypeService remoteComCustomerTypeService,
+                                  RemoteProductTaxrateService remoteProductTaxrateService,
+                                  RemoteComStaffService remoteComStaffService) {
+        this.customerInfoService = SpringUtils.getBean(ICustomerInfoService.class);
+        this.remoteComCompanyService = remoteComCompanyService;
+        this.remoteComCustomerLevelService = remoteComCustomerLevelService;
+        this.remoteCreditLevelService = remoteCreditLevelService;
+        this.remoteComCurrencyService = remoteComCurrencyService;
+        this.remoteComCustomerTypeService = remoteComCustomerTypeService;
+        this.remoteProductTaxrateService = remoteProductTaxrateService;
+        this.remoteComStaffService = remoteComStaffService;
+        this.scaleService = SpringUtils.getBean(IEnterpriseScaleService.class);
+        this.industryCategoryService = SpringUtils.getBean(IIndustryCategoryService.class);
+        this.isUpdateSupport = isUpdateSupport;
+        this.operUserId = LoginHelper.getLoginUser().getUserId();
+    }
+
+    @Override
+    public void invoke(CustomerInfoImportVo customerInfoImportVo, AnalysisContext analysisContext) {
+        CustomerInfoVo customerInfo = this.customerInfoService.selectCustomerByName(customerInfoImportVo.getCustomerName());
+        try {
+            // 校验必填字段
+            if (ObjectUtil.isEmpty(customerInfoImportVo.getCustomerNo())) {
+                failureNum++;
+                failureMsg.append("<br/>").append(failureNum).append("、第 ").append(analysisContext.readRowHolder().getRowIndex() + 1).append(" 行,客户编号不能为空");
+                return;
+            }
+            if (ObjectUtil.isEmpty(customerInfoImportVo.getCustomerName())) {
+                failureNum++;
+                failureMsg.append("<br/>").append(failureNum).append("、第 ").append(analysisContext.readRowHolder().getRowIndex() + 1).append(" 行,客户名称不能为空");
+                return;
+            }
+            RemoteComCompanyVo remoteComCompanyVo = remoteComCompanyService.selectByCompanyName(customerInfoImportVo.getCompanyName());
+            RemoteComCustomerLevelVo remoteComCustomerLevelVo = remoteComCustomerLevelService.selectCustomerLeveByLevelName(customerInfoImportVo.getCustomerLevelName());
+            RemoteComCurrencyVo remoteComCurrencyVo = remoteComCurrencyService.selectByCurrencyName(customerInfoImportVo.getDealCurrency());
+            RemoteComCustomerTypeVo remoteComCustomerTypeVo = remoteComCustomerTypeService.selectCustomerTypeByTypeName(customerInfoImportVo.getCustomerTypeName());
+            RemoteProductTaxrateVo remoteProductTaxrateVo = remoteProductTaxrateService.selectByTaxrateNo(customerInfoImportVo.getRateName());
+            EnterpriseScaleVo enterpriseScaleVo = scaleService.selectEnterpriseScaleByScaleName(customerInfoImportVo.getEnterpriseScale());
+            IndustryCategoryVo industryCategoryVo = industryCategoryService.selectIndustryCategoryByCategoryName(customerInfoImportVo.getIndustryCategory());
+            RemoteCreditLevelVo remoteCreditLevelVo = remoteCreditLevelService.selectByCreditLevelName(customerInfoImportVo.getCreditLevel().equals("0") ? "A"
+                : customerInfoImportVo.getCreditLevel().equals("1") ? "B" : customerInfoImportVo.getCreditLevel().equals("2") ? "C"
+                : customerInfoImportVo.getCreditLevel().equals("3") ? "D" : customerInfoImportVo.getCreditLevel().equals("4") ? "E"
+                : customerInfoImportVo.getCreditLevel().equals("5") ? "F" : "G");
+            RemoteComStaffVo SalesPerson = remoteComStaffService.selectStaffByStaffName(customerInfoImportVo.getSalesPersonName());
+            RemoteComStaffVo ServiceStaff = remoteComStaffService.selectStaffByStaffName(customerInfoImportVo.getServiceStaffName());
+            CustomerSalesInfoBo customerSalesInfo = new CustomerSalesInfoBo();
+            if (ObjectUtil.isNotEmpty(SalesPerson)) {
+                customerSalesInfo.setSalesPersonId(SalesPerson.getStaffId());
+            }
+            if (ObjectUtil.isNotEmpty(ServiceStaff)) {
+                customerSalesInfo.setServiceStaffId(ServiceStaff.getStaffId());
+            }
+            if (ObjectUtil.isNotEmpty(remoteCreditLevelVo)) {
+                customerSalesInfo.setCreditLevelId(remoteCreditLevelVo.getId());
+            }
+
+            // 验证是否存在这个客户
+            if (ObjectUtil.isNull(customerInfo)) {
+
+                CustomerInfoBo customerInfoBo = BeanUtil.toBean(customerInfoImportVo, CustomerInfoBo.class);
+                if (ObjectUtil.isNotEmpty(remoteComCompanyVo)) {
+                    customerInfoBo.setBelongCompanyId(remoteComCompanyVo.getId());
+                }
+                if (ObjectUtil.isNotEmpty(remoteComCustomerLevelVo)) {
+                    customerInfoBo.setCustomerLevelId(remoteComCustomerLevelVo.getId());
+                }
+                if (ObjectUtil.isNotEmpty(remoteComCurrencyVo)) {
+                    customerInfoBo.setDealCurrencyId(remoteComCurrencyVo.getId());
+                }
+                if (ObjectUtil.isNotEmpty(remoteComCustomerTypeVo)) {
+                    customerInfoBo.setCustomerTypeId(remoteComCustomerTypeVo.getId());
+                }
+                if (ObjectUtil.isNotEmpty(enterpriseScaleVo)) {
+                    customerInfoBo.setEnterpriseScaleId(enterpriseScaleVo.getId());
+                }
+                if (ObjectUtil.isNotEmpty(industryCategoryVo)) {
+                    customerInfoBo.setIndustryCategoryId(industryCategoryVo.getId());
+                }
+                if (ObjectUtil.isNotEmpty(remoteProductTaxrateVo)) {
+                    customerInfoBo.setRateId(remoteProductTaxrateVo.getId());
+                }
+
+                ValidatorUtils.validate(customerInfoBo);
+                customerInfoBo.setCreateBy(operUserId);
+                customerInfoBo.setCustomerSalesInfoBo(customerSalesInfo);
+                customerInfoService.addCustomerInfo(customerInfoBo);
+                successNum++;
+                successMsg.append("<br/>").append(successNum).append("、客户名称 ").append(customerInfoBo.getCustomerName()).append(" 导入成功");
+            } else if (isUpdateSupport) {
+                Long customerId = customerInfo.getId();
+                CustomerInfoBo customerInfoBo = BeanUtil.toBean(customerInfoImportVo, CustomerInfoBo.class);
+                customerInfoBo.setId(customerId);
+                if (ObjectUtil.isNotEmpty(remoteComCompanyVo)) {
+                    customerInfoBo.setBelongCompanyId(remoteComCompanyVo.getId());
+                }
+                if (ObjectUtil.isNotEmpty(remoteComCustomerLevelVo)) {
+                    customerInfoBo.setCustomerLevelId(remoteComCustomerLevelVo.getId());
+                }
+                if (ObjectUtil.isNotEmpty(remoteComCurrencyVo)) {
+                    customerInfoBo.setDealCurrencyId(remoteComCurrencyVo.getId());
+                }
+                if (ObjectUtil.isNotEmpty(remoteComCustomerTypeVo)) {
+                    customerInfoBo.setCustomerTypeId(remoteComCustomerTypeVo.getId());
+                }
+                if (ObjectUtil.isNotEmpty(enterpriseScaleVo)) {
+                    customerInfoBo.setEnterpriseScaleId(enterpriseScaleVo.getId());
+                }
+                if (ObjectUtil.isNotEmpty(industryCategoryVo)) {
+                    customerInfoBo.setIndustryCategoryId(industryCategoryVo.getId());
+                }
+                if (ObjectUtil.isNotEmpty(remoteProductTaxrateVo)) {
+                    customerInfoBo.setRateId(remoteProductTaxrateVo.getId());
+                }
+                ValidatorUtils.validate(customerInfoBo);
+
+                customerInfoBo.setUpdateBy(operUserId);
+                customerInfoBo.setCustomerSalesInfoBo(customerSalesInfo);
+                customerInfoService.updateCustomerInfo(customerInfoBo);
+                successNum++;
+                successMsg.append("<br/>").append(successNum).append("、客户名称 ").append(customerInfoBo.getCustomerName()).append(" 更新成功");
+            } else {
+                failureNum++;
+                failureMsg.append("<br/>").append(failureNum).append("、客户名称 ").append(customerInfo.getCustomerName()).append(" 已存在");
+            }
+        } catch (Exception e) {
+            failureNum++;
+            String msg = "<br/>" + failureNum + "、客户名称 " + HtmlUtil.cleanHtmlTag(customerInfoImportVo.getCustomerName()) + " 导入失败:";
+            String message = e.getMessage();
+            if (e instanceof ConstraintViolationException cvException) {
+                message = StreamUtils.join(cvException.getConstraintViolations(), ConstraintViolation::getMessage, ", ");
+            }
+            failureMsg.append(msg).append(message);
+            log.error(msg, e);
+        }
+    }
+
+    @Override
+    public ExcelResult<CustomerInfoImportVo> getExcelResult() {
+        return new ExcelResult<CustomerInfoImportVo>() {
+
+            @Override
+            public String getAnalysis() {
+                if (failureNum > 0) {
+                    failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
+                    throw new ServiceException(failureMsg.toString());
+                } else {
+                    successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
+                }
+                return successMsg.toString();
+            }
+
+            @Override
+            public List<CustomerInfoImportVo> getList() {
+                return null;
+            }
+
+            @Override
+            public List<String> getErrorList() {
+                return null;
+            }
+        };
+    }
+
+
+    @Override
+    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
+
+    }
+}

+ 126 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/listener/SupplierImportListener.java

@@ -0,0 +1,126 @@
+package org.dromara.customer.listener;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.http.HtmlUtil;
+import cn.idev.excel.context.AnalysisContext;
+import cn.idev.excel.event.AnalysisEventListener;
+import jakarta.validation.ConstraintViolation;
+import jakarta.validation.ConstraintViolationException;
+import org.dromara.common.core.exception.ServiceException;
+import org.dromara.common.core.utils.SpringUtils;
+import org.dromara.common.core.utils.StreamUtils;
+import org.dromara.common.core.utils.ValidatorUtils;
+import org.dromara.common.excel.core.ExcelListener;
+import org.dromara.common.excel.core.ExcelResult;
+import org.dromara.common.satoken.utils.LoginHelper;
+import org.dromara.customer.domain.bo.SupplierInfoBo;
+import org.dromara.customer.domain.vo.SupplierInfoImportVo;
+import org.dromara.customer.domain.vo.SupplierInfoVo;
+import org.dromara.customer.service.ISupplierInfoService;
+
+import java.util.List;
+
+import static org.dromara.common.mybatis.core.mapper.BaseMapperPlus.log;
+
+public class SupplierImportListener extends AnalysisEventListener<SupplierInfoImportVo> implements ExcelListener<SupplierInfoImportVo> {
+
+    private final ISupplierInfoService supplierInfoService;
+
+    private final Boolean isUpdateSupport;
+
+    private final Long operUserId;
+
+    private int successNum = 0;
+    private int failureNum = 0;
+    private final StringBuilder successMsg = new StringBuilder();
+    private final StringBuilder failureMsg = new StringBuilder();
+
+    public SupplierImportListener(Boolean isUpdateSupport) {
+        this.supplierInfoService = SpringUtils.getBean(ISupplierInfoService.class);
+        this.isUpdateSupport = isUpdateSupport;
+        this.operUserId = LoginHelper.getLoginUser().getUserId();
+    }
+
+    @Override
+    public void invoke(SupplierInfoImportVo supplierInfoImportVo, AnalysisContext analysisContext) {
+        SupplierInfoVo supplierInfoVo = this.supplierInfoService.selectSupplierByEnterpriseName(supplierInfoImportVo.getEnterpriseName());
+        try {
+            // 校验必填字段
+            if (ObjectUtil.isEmpty(supplierInfoImportVo.getSupplierNo())) {
+                failureNum++;
+                failureMsg.append("<br/>").append(failureNum).append("、第 ").append(analysisContext.readRowHolder().getRowIndex() + 1).append(" 行,供应商编号不能为空");
+                return;
+            }
+            if (ObjectUtil.isEmpty(supplierInfoImportVo.getEnterpriseName())) {
+                failureNum++;
+                failureMsg.append("<br/>").append(failureNum).append("、第 ").append(analysisContext.readRowHolder().getRowIndex() + 1).append(" 行,供应商称不能为空");
+                return;
+            }
+            // 验证是否存在这个供应商
+            if (ObjectUtil.isNull(supplierInfoVo)) {
+                SupplierInfoBo supplierInfoBo = BeanUtil.toBean(supplierInfoImportVo, SupplierInfoBo.class);
+                ValidatorUtils.validate(supplierInfoBo);
+                supplierInfoBo.setCreateBy(operUserId);
+                supplierInfoService.addSupplierInfo(supplierInfoBo);
+                successNum++;
+                successMsg.append("<br/>").append(successNum).append("、供应商名称 ").append(supplierInfoBo.getEnterpriseName()).append(" 导入成功");
+            } else if (isUpdateSupport) {
+                Long supplierId = supplierInfoVo.getId();
+                SupplierInfoBo supplierInfoBo = BeanUtil.toBean(supplierInfoImportVo, SupplierInfoBo.class);
+                supplierInfoBo.setId(supplierId);
+                ValidatorUtils.validate(supplierInfoBo);
+
+                supplierInfoBo.setUpdateBy(operUserId);
+                supplierInfoService.updateSupplierInfo(supplierInfoBo);
+                successNum++;
+                successMsg.append("<br/>").append(successNum).append("、供应商名称 ").append(supplierInfoBo.getEnterpriseName()).append(" 更新成功");
+            } else {
+                failureNum++;
+                failureMsg.append("<br/>").append(failureNum).append("、供应商名称 ").append(supplierInfoVo.getEnterpriseName()).append(" 已存在");
+            }
+        } catch (Exception e) {
+            failureNum++;
+            String msg = "<br/>" + failureNum + "、供应商名称 " + HtmlUtil.cleanHtmlTag(supplierInfoImportVo.getEnterpriseName()) + " 导入失败:";
+            String message = e.getMessage();
+            if (e instanceof ConstraintViolationException cvException) {
+                message = StreamUtils.join(cvException.getConstraintViolations(), ConstraintViolation::getMessage, ", ");
+            }
+            failureMsg.append(msg).append(message);
+            log.error(msg, e);
+        }
+    }
+
+    @Override
+    public ExcelResult<SupplierInfoImportVo> getExcelResult() {
+        return new ExcelResult<SupplierInfoImportVo>() {
+
+            @Override
+            public String getAnalysis() {
+                if (failureNum > 0) {
+                    failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
+                    throw new ServiceException(failureMsg.toString());
+                } else {
+                    successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
+                }
+                return successMsg.toString();
+            }
+
+            @Override
+            public List<SupplierInfoImportVo> getList() {
+                return null;
+            }
+
+            @Override
+            public List<String> getErrorList() {
+                return null;
+            }
+        };
+    }
+
+
+    @Override
+    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
+
+    }
+}

+ 24 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/ICustomerInfoService.java

@@ -149,5 +149,29 @@ public interface ICustomerInfoService extends IService<CustomerInfo> {
      */
     Boolean register(CustomerRegisterBo bo);
 
+    /**
+     * 新增客户信息 客户导入时只需要导入主数据
+     *
+     * @param bo 客户信息
+     * @return 是否新增成功
+     */
+    Boolean addCustomerInfo(CustomerInfoBo bo);
+
+    /**
+     * 修改客户信息 客户导入时只需要导入主数据
+     *
+     * @param bo 客户信息
+     * @return 是否修改成功
+     */
+    Boolean updateCustomerInfo(CustomerInfoBo bo);
+
+    /**
+     * 查询客户名称查询客户信息
+     *
+     * @param customerName 主键
+     * @return 客户信息
+     */
+    CustomerInfoVo selectCustomerByName(String customerName);
+
 
 }

+ 3 - 1
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/IEnterpriseScaleService.java

@@ -16,7 +16,7 @@ import java.util.List;
  * @author LionLi
  * @date 2025-12-10
  */
-public interface IEnterpriseScaleService extends IService<EnterpriseScale>{
+public interface IEnterpriseScaleService extends IService<EnterpriseScale> {
 
     /**
      * 查询企业规模
@@ -59,6 +59,8 @@ public interface IEnterpriseScaleService extends IService<EnterpriseScale>{
      */
     Boolean updateByBo(EnterpriseScaleBo bo);
 
+    EnterpriseScaleVo selectEnterpriseScaleByScaleName(String scaleName);
+
     /**
      * 校验并批量删除企业规模信息
      *

+ 7 - 4
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/IIndustryCategoryService.java

@@ -1,11 +1,11 @@
 package org.dromara.customer.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.dromara.common.mybatis.core.page.PageQuery;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
 import org.dromara.customer.domain.IndustryCategory;
-import org.dromara.customer.domain.vo.IndustryCategoryVo;
 import org.dromara.customer.domain.bo.IndustryCategoryBo;
-import org.dromara.common.mybatis.core.page.TableDataInfo;
-import org.dromara.common.mybatis.core.page.PageQuery;
+import org.dromara.customer.domain.vo.IndustryCategoryVo;
 
 import java.util.Collection;
 import java.util.List;
@@ -16,7 +16,7 @@ import java.util.List;
  * @author LionLi
  * @date 2025-12-10
  */
-public interface IIndustryCategoryService extends IService<IndustryCategory>{
+public interface IIndustryCategoryService extends IService<IndustryCategory> {
 
     /**
      * 查询所属行业
@@ -59,6 +59,9 @@ public interface IIndustryCategoryService extends IService<IndustryCategory>{
      */
     Boolean updateByBo(IndustryCategoryBo bo);
 
+    IndustryCategoryVo selectIndustryCategoryByCategoryName(String categoryName);
+
+
     /**
      * 校验并批量删除所属行业信息
      *

+ 25 - 4
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/ISupplierInfoService.java

@@ -5,11 +5,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import jakarta.validation.constraints.NotNull;
 import org.dromara.customer.domain.SupplierInfo;
-import org.dromara.customer.domain.bo.CustomerRegisterBo;
-import org.dromara.customer.domain.bo.SupplierAuthorizeBo;
-import org.dromara.customer.domain.bo.SupplierRegisterBo;
+import org.dromara.customer.domain.bo.*;
 import org.dromara.customer.domain.vo.SupplierInfoVo;
-import org.dromara.customer.domain.bo.SupplierInfoBo;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
 import org.dromara.common.mybatis.core.page.PageQuery;
 import org.dromara.customer.domain.vo.SupplierInformationVo;
@@ -124,4 +121,28 @@ public interface ISupplierInfoService extends IService<SupplierInfo> {
     List<Long> getSupplierIds(String enterpriseName);
 
     Map<Long, String> selectEnterpriseNameByIds(Set<Long> ids);
+
+    /**
+     * 新增供应商信息 供应商导入时只需要导入主数据
+     *
+     * @param bo 供应商信息
+     * @return 是否新增成功
+     */
+    Boolean addSupplierInfo(SupplierInfoBo bo);
+
+    /**
+     * 修改供应商信息 供应商导入时只需要导入主数据
+     *
+     * @param bo 供应商信息
+     * @return 是否修改成功
+     */
+    Boolean updateSupplierInfo(SupplierInfoBo bo);
+
+    /**
+     * 通过供应商名称查询
+     *
+     * @param enterpriseName 供应商
+     * @return 供应商对象信息
+     */
+    SupplierInfoVo selectSupplierByEnterpriseName(String enterpriseName);
 }

+ 46 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/CustomerInfoServiceImpl.java

@@ -1,5 +1,6 @@
 package org.dromara.customer.service.impl;
 
+import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.crypto.digest.BCrypt;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -1210,4 +1211,49 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
             throw new ServiceException("转移客服人员失败:" + e.getMessage());
         }
     }
+
+    /**
+     * 新增客户信息 客户导入时只需要导入主数据
+     *
+     * @param bo 客户信息
+     * @return 是否新增成功
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean addCustomerInfo(CustomerInfoBo bo) {
+        CustomerInfo add = MapstructUtils.convert(bo, CustomerInfo.class);
+        validEntityBeforeSave(add);
+        boolean flag = baseMapper.insert(add) > 0;
+        if (flag) {
+            bo.setId(add.getId());
+            CustomerSalesInfoBo customerSalesInfoBo = bo.getCustomerSalesInfoBo();
+            customerSalesInfoBo.setCustomerId(add.getId());
+            CustomerSalesInfo bean = BeanUtil.toBean(customerSalesInfoBo, CustomerSalesInfo.class);
+            customerSalesInfoMapper.insert(bean);
+        }
+        return flag;
+    }
+
+    /**
+     * 修改客户信息 客户导入时只需要导入主数据
+     *
+     * @param bo 客户信息
+     * @return 是否修改成功
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean updateCustomerInfo(CustomerInfoBo bo) {
+        CustomerInfo update = MapstructUtils.convert(bo, CustomerInfo.class);
+        validEntityBeforeSave(update);
+        CustomerSalesInfoBo customerSalesInfoBo = bo.getCustomerSalesInfoBo();
+        customerSalesInfoBo.setCustomerId(update.getId());
+        CustomerSalesInfo bean = BeanUtil.toBean(customerSalesInfoBo, CustomerSalesInfo.class);
+        customerSalesInfoMapper.insert(bean);
+        return baseMapper.updateById(update) > 0;
+    }
+
+    @Override
+    public CustomerInfoVo selectCustomerByName(String customerName) {
+        return baseMapper.selectVoOne(new LambdaQueryWrapper<CustomerInfo>().eq(CustomerInfo::getCustomerName, customerName));
+    }
 }

+ 5 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/EnterpriseScaleServiceImpl.java

@@ -119,6 +119,11 @@ public class EnterpriseScaleServiceImpl extends ServiceImpl<EnterpriseScaleMappe
         return baseMapper.updateById(update) > 0;
     }
 
+    @Override
+    public EnterpriseScaleVo selectEnterpriseScaleByScaleName(String scaleName) {
+        return baseMapper.selectVoOne(new LambdaQueryWrapper<EnterpriseScale>().eq(EnterpriseScale::getEnterpriseScaleName, scaleName));
+    }
+
     /**
      * 保存前的数据校验
      */

+ 5 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/IndustryCategoryServiceImpl.java

@@ -117,6 +117,11 @@ public class IndustryCategoryServiceImpl extends ServiceImpl<IndustryCategoryMap
         return baseMapper.updateById(update) > 0;
     }
 
+    @Override
+    public IndustryCategoryVo selectIndustryCategoryByCategoryName(String categoryName) {
+        return baseMapper.selectVoOne(new LambdaQueryWrapper<IndustryCategory>().eq(IndustryCategory::getIndustryCategoryName, categoryName));
+    }
+
     /**
      * 保存前的数据校验
      */

+ 33 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/SupplierInfoServiceImpl.java

@@ -2321,4 +2321,37 @@ public class SupplierInfoServiceImpl extends ServiceImpl<SupplierInfoMapper, Sup
         }
         return resultMap;
     }
+
+    /**
+     * 新增供应商信息 供应商导入时只需要导入主数据
+     *
+     * @param bo 供应商信息
+     * @return 是否新增成功
+     */
+    @Override
+    public Boolean addSupplierInfo(SupplierInfoBo bo) {
+        SupplierInfo add = MapstructUtils.convert(bo, SupplierInfo.class);
+        boolean flag = baseMapper.insert(add) > 0;
+        if (flag) {
+            bo.setId(add.getId());
+        }
+        return flag;
+    }
+
+    /**
+     * 修改供应商信息 供应商导入时只需要导入主数据
+     *
+     * @param bo 供应商信息
+     * @return 是否修改成功
+     */
+    @Override
+    public Boolean updateSupplierInfo(SupplierInfoBo bo) {
+        SupplierInfo update = MapstructUtils.convert(bo, SupplierInfo.class);
+        return baseMapper.updateById(update) > 0;
+    }
+
+    @Override
+    public SupplierInfoVo selectSupplierByEnterpriseName(String enterpriseName) {
+        return baseMapper.selectVoOne(new LambdaQueryWrapper<SupplierInfo>().eq(SupplierInfo::getEnterpriseName, enterpriseName));
+    }
 }

+ 1 - 1
ruoyi-modules/ruoyi-product/src/main/java/org/dromara/product/service/IProductTaxrateService.java

@@ -16,7 +16,7 @@ import java.util.List;
  * @author LionLi
  * @date 2025-12-11
  */
-public interface IProductTaxrateService extends IService<ProductTaxrate>{
+public interface IProductTaxrateService extends IService<ProductTaxrate> {
 
     /**
      * 查询产品税率配置

+ 4 - 4
ruoyi-modules/ruoyi-product/src/main/java/org/dromara/product/service/impl/ProductTaxrateServiceImpl.java

@@ -30,7 +30,7 @@ import java.util.Collection;
 @Slf4j
 @RequiredArgsConstructor
 @Service
-public class ProductTaxrateServiceImpl  extends ServiceImpl<ProductTaxrateMapper, ProductTaxrate> implements IProductTaxrateService {
+public class ProductTaxrateServiceImpl extends ServiceImpl<ProductTaxrateMapper, ProductTaxrate> implements IProductTaxrateService {
 
     private final ProductTaxrateMapper baseMapper;
 
@@ -41,7 +41,7 @@ public class ProductTaxrateServiceImpl  extends ServiceImpl<ProductTaxrateMapper
      * @return 产品税率配置
      */
     @Override
-    public ProductTaxrateVo queryById(Long id){
+    public ProductTaxrateVo queryById(Long id) {
         return baseMapper.selectVoById(id);
     }
 
@@ -117,7 +117,7 @@ public class ProductTaxrateServiceImpl  extends ServiceImpl<ProductTaxrateMapper
     /**
      * 保存前的数据校验
      */
-    private void validEntityBeforeSave(ProductTaxrate entity){
+    private void validEntityBeforeSave(ProductTaxrate entity) {
         //TODO 做一些数据校验,如唯一约束
     }
 
@@ -130,7 +130,7 @@ public class ProductTaxrateServiceImpl  extends ServiceImpl<ProductTaxrateMapper
      */
     @Override
     public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
-        if(isValid){
+        if (isValid) {
             //TODO 做一些业务上的校验,判断是否需要校验
         }
         return baseMapper.deleteByIds(ids) > 0;

+ 21 - 1
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/ComBank.java

@@ -53,7 +53,7 @@ public class ComBank extends TenantEntity {
     private String bnCatgId;
 
     /**
-     * 传真号码
+     * 行号
      */
     private String faxNo;
 
@@ -62,6 +62,26 @@ public class ComBank extends TenantEntity {
      */
     private String telNo;
 
+    /**
+     * 省份编码
+     */
+    private String provincialNo;
+
+    /**
+     * 城市编码
+     */
+    private String cityNo;
+
+    /**
+     * 区县编码
+     */
+    private String countryNo;
+
+    /**
+     * 区县编码
+     */
+    private String provincialCityCountry;
+
     /**
      * 是否显示(0-是,1-否)
      */

+ 21 - 1
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/ComBankBo.java

@@ -52,7 +52,7 @@ public class ComBankBo extends BaseEntity {
     private String bnCatgId;
 
     /**
-     * 传真号码
+     * 行号
      */
     private String faxNo;
 
@@ -61,6 +61,26 @@ public class ComBankBo extends BaseEntity {
      */
     private String telNo;
 
+    /**
+     * 省份编码
+     */
+    private String provincialNo;
+
+    /**
+     * 城市编码
+     */
+    private String cityNo;
+
+    /**
+     * 区县编码
+     */
+    private String countryNo;
+
+    /**
+     * 区县编码
+     */
+    private String provincialCityCountry;
+
     /**
      * 是否显示(0-是,1-否)
      */

+ 2 - 5
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/CreditLevelBo.java

@@ -1,13 +1,10 @@
 package org.dromara.system.domain.bo;
 
-import org.dromara.system.domain.CreditLevel;
-import org.dromara.common.mybatis.core.domain.BaseEntity;
-import org.dromara.common.core.validate.AddGroup;
-import org.dromara.common.core.validate.EditGroup;
 import io.github.linpeilie.annotations.AutoMapper;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
-import jakarta.validation.constraints.*;
+import org.dromara.common.mybatis.core.domain.BaseEntity;
+import org.dromara.system.domain.CreditLevel;
 
 /**
  * 信用等级配置业务对象 credit_level

+ 22 - 2
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/ComBankVo.java

@@ -64,9 +64,9 @@ public class ComBankVo implements Serializable {
     private String bnCatgId;
 
     /**
-     * 传真号码
+     * 行号
      */
-    @ExcelProperty(value = "传真号码")
+    @ExcelProperty(value = "行号")
     private String faxNo;
 
     /**
@@ -75,6 +75,26 @@ public class ComBankVo implements Serializable {
     @ExcelProperty(value = "联系电话")
     private String telNo;
 
+    /**
+     * 省份编码
+     */
+    private String provincialNo;
+
+    /**
+     * 城市编码
+     */
+    private String cityNo;
+
+    /**
+     * 区县编码
+     */
+    private String countryNo;
+
+    /**
+     * 区县编码
+     */
+    private String provincialCityCountry;
+
     /**
      * 是否显示(0-是,1-否)
      */

+ 11 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteComCompanyServiceImpl.java

@@ -1,8 +1,13 @@
 package org.dromara.system.dubbo;
 
+import cn.hutool.core.bean.BeanUtil;
 import lombok.RequiredArgsConstructor;
 import org.apache.dubbo.config.annotation.DubboService;
+import org.dromara.common.core.utils.MapstructUtils;
 import org.dromara.system.api.RemoteComCompanyService;
+import org.dromara.system.api.domain.vo.RemoteComCompanyVo;
+import org.dromara.system.api.domain.vo.RemoteComStaffVo;
+import org.dromara.system.domain.vo.ComCompanyVo;
 import org.dromara.system.service.IComCompanyService;
 import org.springframework.stereotype.Service;
 
@@ -21,4 +26,10 @@ public class RemoteComCompanyServiceImpl implements RemoteComCompanyService {
     public Map<Long, String> selectCompanyNameByIds(Set<Long> ids) {
         return comCompanyService.selectCompanyNameByIds(ids);
     }
+
+    @Override
+    public RemoteComCompanyVo selectByCompanyName(String companyName) {
+        ComCompanyVo comCompanyVo = comCompanyService.selectByCompanyName(companyName);
+        return BeanUtil.toBean(comCompanyVo, RemoteComCompanyVo.class);
+    }
 }

+ 25 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteComCurrencyServiceImpl.java

@@ -0,0 +1,25 @@
+package org.dromara.system.dubbo;
+
+import cn.hutool.core.bean.BeanUtil;
+import lombok.RequiredArgsConstructor;
+import org.apache.dubbo.config.annotation.DubboService;
+import org.dromara.common.core.utils.MapstructUtils;
+import org.dromara.system.api.RemoteComCurrencyService;
+import org.dromara.system.api.domain.vo.RemoteComCurrencyVo;
+import org.dromara.system.domain.vo.ComCurrencyVo;
+import org.dromara.system.service.IComCurrencyService;
+import org.springframework.stereotype.Service;
+
+@RequiredArgsConstructor
+@Service
+@DubboService
+public class RemoteComCurrencyServiceImpl implements RemoteComCurrencyService {
+
+    private final IComCurrencyService comCurrencyService;
+
+    @Override
+    public RemoteComCurrencyVo selectByCurrencyName(String currencyName) {
+        ComCurrencyVo comCurrencyVo = comCurrencyService.selectCurrencyByName(currencyName);
+        return BeanUtil.toBean(comCurrencyVo, RemoteComCurrencyVo.class);
+    }
+}

+ 25 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteComCustomerLevelServiceImpl.java

@@ -0,0 +1,25 @@
+package org.dromara.system.dubbo;
+
+import cn.hutool.core.bean.BeanUtil;
+import lombok.RequiredArgsConstructor;
+import org.apache.dubbo.config.annotation.DubboService;
+import org.dromara.common.core.utils.MapstructUtils;
+import org.dromara.system.api.RemoteComCustomerLevelService;
+import org.dromara.system.api.domain.vo.RemoteComCustomerLevelVo;
+import org.dromara.system.domain.vo.ComCustomerLevelVo;
+import org.dromara.system.service.IComCustomerLevelService;
+import org.springframework.stereotype.Service;
+
+@RequiredArgsConstructor
+@Service
+@DubboService
+public class RemoteComCustomerLevelServiceImpl implements RemoteComCustomerLevelService {
+
+    private final IComCustomerLevelService comCustomerLevelService;
+
+    @Override
+    public RemoteComCustomerLevelVo selectCustomerLeveByLevelName(String levelName) {
+        ComCustomerLevelVo comCustomerLevelVo = comCustomerLevelService.selectCustomerLevelByName(levelName);
+        return BeanUtil.toBean(comCustomerLevelVo, RemoteComCustomerLevelVo.class);
+    }
+}

+ 25 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteComCustomerTypeServiceImpl.java

@@ -0,0 +1,25 @@
+package org.dromara.system.dubbo;
+
+import cn.hutool.core.bean.BeanUtil;
+import lombok.RequiredArgsConstructor;
+import org.apache.dubbo.config.annotation.DubboService;
+import org.dromara.common.core.utils.MapstructUtils;
+import org.dromara.system.api.RemoteComCustomerTypeService;
+import org.dromara.system.api.domain.vo.RemoteComCustomerTypeVo;
+import org.dromara.system.domain.vo.ComCustomerTypeVo;
+import org.dromara.system.service.IComCustomerTypeService;
+import org.springframework.stereotype.Service;
+
+@RequiredArgsConstructor
+@Service
+@DubboService
+public class RemoteComCustomerTypeServiceImpl implements RemoteComCustomerTypeService {
+
+    private final IComCustomerTypeService comCustomerTypeService;
+
+    @Override
+    public RemoteComCustomerTypeVo selectCustomerTypeByTypeName(String typeName) {
+        ComCustomerTypeVo comCustomerTypeVo = comCustomerTypeService.selectCustomerTypeByName(typeName);
+        return BeanUtil.toBean(comCustomerTypeVo, RemoteComCustomerTypeVo.class);
+    }
+}

+ 6 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteComStaffServiceImpl.java

@@ -1,5 +1,6 @@
 package org.dromara.system.dubbo;
 
+import cn.hutool.core.bean.BeanUtil;
 import lombok.RequiredArgsConstructor;
 import org.apache.dubbo.config.annotation.DubboService;
 import org.dromara.common.core.utils.MapstructUtils;
@@ -35,4 +36,9 @@ public class RemoteComStaffServiceImpl implements RemoteComStaffService {
         List<ComStaffVo> staffList = comStaffService.queryByIds(ids);
         return MapstructUtils.convert(staffList, RemoteComStaffVo.class);
     }
+
+    @Override
+    public RemoteComStaffVo selectStaffByStaffName(String staffName) {
+        return BeanUtil.toBean(comStaffService.selectStaffByStaffName(staffName), RemoteComStaffVo.class);
+    }
 }

+ 8 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteCreditLevelServiceImpl.java

@@ -1,8 +1,11 @@
 package org.dromara.system.dubbo;
 
+import cn.hutool.core.bean.BeanUtil;
 import lombok.RequiredArgsConstructor;
 import org.apache.dubbo.config.annotation.DubboService;
+import org.dromara.common.core.utils.MapstructUtils;
 import org.dromara.system.api.RemoteCreditLevelService;
+import org.dromara.system.api.domain.vo.RemoteCreditLevelVo;
 import org.dromara.system.service.ICreditLevelService;
 import org.springframework.stereotype.Service;
 
@@ -23,4 +26,9 @@ public class RemoteCreditLevelServiceImpl implements RemoteCreditLevelService {
     public Map<Long, String> selectCreditLevelNameByIds(Set<Long> ids) {
         return creditLevelService.selectCreditLevelNameByIds(ids);
     }
+
+    @Override
+    public RemoteCreditLevelVo selectByCreditLevelName(String creditLevelName) {
+        return BeanUtil.toBean(creditLevelService.selectByCreditLevelName(creditLevelName), RemoteCreditLevelVo.class);
+    }
 }

+ 25 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteProductTaxrateServiceImpl.java

@@ -0,0 +1,25 @@
+package org.dromara.system.dubbo;
+
+import cn.hutool.core.bean.BeanUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.dubbo.config.annotation.DubboService;
+
+import org.dromara.system.api.RemoteProductTaxrateService;
+import org.dromara.system.api.domain.vo.RemoteProductTaxrateVo;
+import org.dromara.system.service.IProductTaxrateService;
+import org.springframework.stereotype.Service;
+
+@Slf4j
+@Service
+@RequiredArgsConstructor
+@DubboService
+public class RemoteProductTaxrateServiceImpl implements RemoteProductTaxrateService {
+
+    private final IProductTaxrateService productTaxrateService;
+
+    @Override
+    public RemoteProductTaxrateVo selectByTaxrateNo(String taxrateNo) {
+        return BeanUtil.toBean(productTaxrateService.selectByTaxrateNo(taxrateNo), RemoteProductTaxrateVo.class);
+    }
+}

+ 2 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/IComCompanyService.java

@@ -77,4 +77,6 @@ public interface IComCompanyService extends IService<ComCompany> {
      * @return 是否删除成功
      */
     Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+    ComCompanyVo selectByCompanyName(String companyName);
 }

+ 3 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/IComCurrencyService.java

@@ -7,6 +7,7 @@ import org.dromara.system.domain.vo.ComCurrencyVo;
 import org.dromara.system.domain.bo.ComCurrencyBo;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
 import org.dromara.common.mybatis.core.page.PageQuery;
+import org.dromara.system.domain.vo.ComCustomerLevelVo;
 
 import java.util.Collection;
 import java.util.List;
@@ -65,6 +66,8 @@ public interface IComCurrencyService extends IService<ComCurrency> {
      */
     int updateStatus(ComCurrencyBo bo);
 
+    ComCurrencyVo selectCurrencyByName(String currencyName);
+
     /**
      * 校验并批量删除交易币别配置信息
      *

+ 2 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/IComCustomerLevelService.java

@@ -73,4 +73,6 @@ public interface IComCustomerLevelService extends IService<ComCustomerLevel> {
      * @return 是否删除成功
      */
     Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+    ComCustomerLevelVo selectCustomerLevelByName(String customerLevelName);
 }

+ 3 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/IComCustomerTypeService.java

@@ -3,6 +3,7 @@ package org.dromara.system.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.dromara.system.domain.ComCustomerType;
 import org.dromara.system.domain.bo.ComCustomerLevelBo;
+import org.dromara.system.domain.vo.ComCustomerLevelVo;
 import org.dromara.system.domain.vo.ComCustomerTypeVo;
 import org.dromara.system.domain.bo.ComCustomerTypeBo;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
@@ -65,6 +66,8 @@ public interface IComCustomerTypeService extends IService<ComCustomerType> {
      */
     int updateShowStatus(ComCustomerTypeBo bo);
 
+    ComCustomerTypeVo selectCustomerTypeByName(String customerTypeName);
+
     /**
      * 校验并批量删除客户类型配置信息
      *

+ 3 - 1
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/IComStaffService.java

@@ -86,6 +86,8 @@ public interface IComStaffService extends IService<ComStaff> {
      */
     Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
 
-    Map<String,String> selectStaffNameAndCode();
+    Map<String, String> selectStaffNameAndCode();
+
+    ComStaffVo selectStaffByStaffName(String staffName);
 
 }

+ 2 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ICreditLevelService.java

@@ -72,6 +72,8 @@ public interface ICreditLevelService extends IService<CreditLevel> {
 
     int updateShowStatus(CreditLevelBo bo);
 
+    CreditLevelVo selectByCreditLevelName(String creditLevelName);
+
     /**
      * 校验并批量删除信用等级配置信息
      *

+ 3 - 1
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/IProductTaxrateService.java

@@ -16,7 +16,7 @@ import java.util.List;
  * @author LionLi
  * @date 2026-01-19
  */
-public interface IProductTaxrateService extends IService<ProductTaxrate>{
+public interface IProductTaxrateService extends IService<ProductTaxrate> {
 
     /**
      * 查询产品税率配置
@@ -59,6 +59,8 @@ public interface IProductTaxrateService extends IService<ProductTaxrate>{
      */
     Boolean updateByBo(ProductTaxrateBo bo);
 
+    ProductTaxrateVo selectByTaxrateNo(String taxrateNo);
+
     /**
      * 校验并批量删除产品税率配置信息
      *

+ 5 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/ComCompanyServiceImpl.java

@@ -212,6 +212,11 @@ public class ComCompanyServiceImpl extends ServiceImpl<ComCompanyMapper, ComComp
         return resultMap;
     }
 
+    @Override
+    public ComCompanyVo selectByCompanyName(String companyName) {
+        return baseMapper.selectVoOne(new LambdaQueryWrapper<ComCompany>().eq(ComCompany::getCompanyName, companyName));
+    }
+
     /**
      * 保存前的数据校验
      */

+ 6 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/ComCurrencyServiceImpl.java

@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.dromara.common.redis.utils.SequenceUtils;
+import org.dromara.system.domain.ComCustomerLevel;
 import org.dromara.system.domain.OrderPaySet;
 import org.dromara.system.domain.bo.OrderPaySetBo;
 import org.springframework.stereotype.Service;
@@ -134,6 +135,11 @@ public class ComCurrencyServiceImpl extends ServiceImpl<ComCurrencyMapper, ComCu
         return baseMapper.updateById(update) > 0;
     }
 
+    @Override
+    public ComCurrencyVo selectCurrencyByName(String currencyName) {
+        return baseMapper.selectVoOne(new LambdaQueryWrapper<ComCurrency>().eq(ComCurrency::getCurrencyName, currencyName));
+    }
+
     /**
      * 保存前的数据校验
      */

+ 6 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/ComCustomerLevelServiceImpl.java

@@ -11,6 +11,7 @@ import org.dromara.common.core.utils.StringUtils;
 import org.dromara.common.mybatis.core.page.PageQuery;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
 import org.dromara.common.redis.utils.SequenceUtils;
+import org.dromara.system.domain.ComCompany;
 import org.dromara.system.domain.ComCustomerLevel;
 import org.dromara.system.domain.bo.ComCustomerLevelBo;
 import org.dromara.system.domain.vo.ComCustomerLevelVo;
@@ -133,6 +134,11 @@ public class ComCustomerLevelServiceImpl extends ServiceImpl<ComCustomerLevelMap
         return baseMapper.updateById(level);
     }
 
+    @Override
+    public ComCustomerLevelVo selectCustomerLevelByName(String customerLevelName) {
+        return baseMapper.selectVoOne(new LambdaQueryWrapper<ComCustomerLevel>().eq(ComCustomerLevel::getLevelName, customerLevelName));
+    }
+
     /**
      * 保存前的数据校验
      */

+ 6 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/ComCustomerTypeServiceImpl.java

@@ -11,6 +11,7 @@ import org.dromara.common.core.utils.StringUtils;
 import org.dromara.common.mybatis.core.page.PageQuery;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
 import org.dromara.common.redis.utils.SequenceUtils;
+import org.dromara.system.domain.ComCustomerLevel;
 import org.dromara.system.domain.ComCustomerType;
 import org.dromara.system.domain.bo.ComCustomerTypeBo;
 import org.dromara.system.domain.vo.ComCustomerTypeVo;
@@ -133,6 +134,11 @@ public class ComCustomerTypeServiceImpl extends ServiceImpl<ComCustomerTypeMappe
         return baseMapper.updateById(type);
     }
 
+    @Override
+    public ComCustomerTypeVo selectCustomerTypeByName(String customerTypeName) {
+        return baseMapper.selectVoOne(new LambdaQueryWrapper<ComCustomerType>().eq(ComCustomerType::getTypeName, customerTypeName));
+    }
+
     /**
      * 保存前的数据校验
      */

+ 13 - 3
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/ComStaffServiceImpl.java

@@ -8,14 +8,19 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.dromara.common.core.utils.MapstructUtils;
-import org.dromara.common.core.utils.ObjectUtils;
 import org.dromara.common.core.utils.StringUtils;
 import org.dromara.common.mybatis.core.page.PageQuery;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
-import org.dromara.system.domain.*;
+import org.dromara.system.domain.ComStaff;
+import org.dromara.system.domain.SysDept;
+import org.dromara.system.domain.SysPost;
+import org.dromara.system.domain.SysRole;
 import org.dromara.system.domain.bo.ComStaffBo;
 import org.dromara.system.domain.vo.ComStaffVo;
-import org.dromara.system.mapper.*;
+import org.dromara.system.mapper.ComStaffMapper;
+import org.dromara.system.mapper.SysDeptMapper;
+import org.dromara.system.mapper.SysPostMapper;
+import org.dromara.system.mapper.SysRoleMapper;
 import org.dromara.system.service.IComStaffService;
 import org.springframework.stereotype.Service;
 
@@ -305,4 +310,9 @@ public class ComStaffServiceImpl extends ServiceImpl<ComStaffMapper, ComStaff> i
         return resultMap;
 
     }
+
+    @Override
+    public ComStaffVo selectStaffByStaffName(String staffName) {
+        return baseMapper.selectVoOne(new LambdaQueryWrapper<ComStaff>().eq(ComStaff::getStaffName, staffName));
+    }
 }

+ 5 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/CreditLevelServiceImpl.java

@@ -155,6 +155,11 @@ public class CreditLevelServiceImpl extends ServiceImpl<CreditLevelMapper, Credi
         return baseMapper.updateById(level);
     }
 
+    @Override
+    public CreditLevelVo selectByCreditLevelName(String creditLevelName) {
+        return baseMapper.selectVoOne(new LambdaQueryWrapper<CreditLevel>().eq(CreditLevel::getCreditLevelName, creditLevelName));
+    }
+
     /**
      * 保存前的数据校验
      */

+ 9 - 4
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/ProductTaxrateServiceImpl.java

@@ -30,7 +30,7 @@ import java.util.Collection;
 @Slf4j
 @RequiredArgsConstructor
 @Service
-public class ProductTaxrateServiceImpl  extends ServiceImpl<ProductTaxrateMapper, ProductTaxrate> implements IProductTaxrateService {
+public class ProductTaxrateServiceImpl extends ServiceImpl<ProductTaxrateMapper, ProductTaxrate> implements IProductTaxrateService {
 
     private final ProductTaxrateMapper baseMapper;
 
@@ -41,7 +41,7 @@ public class ProductTaxrateServiceImpl  extends ServiceImpl<ProductTaxrateMapper
      * @return 产品税率配置
      */
     @Override
-    public ProductTaxrateVo queryById(Long id){
+    public ProductTaxrateVo queryById(Long id) {
         return baseMapper.selectVoById(id);
     }
 
@@ -109,10 +109,15 @@ public class ProductTaxrateServiceImpl  extends ServiceImpl<ProductTaxrateMapper
         return baseMapper.updateById(update) > 0;
     }
 
+    @Override
+    public ProductTaxrateVo selectByTaxrateNo(String taxrateNo) {
+        return baseMapper.selectVoOne(Wrappers.lambdaQuery(ProductTaxrate.class).eq(ProductTaxrate::getTaxrateNo, taxrateNo));
+    }
+
     /**
      * 保存前的数据校验
      */
-    private void validEntityBeforeSave(ProductTaxrate entity){
+    private void validEntityBeforeSave(ProductTaxrate entity) {
         //TODO 做一些数据校验,如唯一约束
     }
 
@@ -125,7 +130,7 @@ public class ProductTaxrateServiceImpl  extends ServiceImpl<ProductTaxrateMapper
      */
     @Override
     public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
-        if(isValid){
+        if (isValid) {
             //TODO 做一些业务上的校验,判断是否需要校验
         }
         return baseMapper.deleteByIds(ids) > 0;