From bd6868f8a3073467734dc4fefa9ecd70bfd6f16d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Mon, 15 Dec 2025 17:38:06 +0800 Subject: [PATCH] =?UTF-8?q?refactor(credit):=20=E4=BC=98=E5=8C=96=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E5=AF=BC=E5=85=A5=E5=8F=82=E6=95=B0=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 调整示例数据字段赋值顺序,提升代码可读性 - 注释掉不再使用的地址相关字段(国家、省份、城市、辖区) - 修改地址字段为省份地区,简化地址信息输入 - 更新Excel表头名称,将"唯一标识"改为"序号" - 移除冗余的业务字段(备注、推荐、排序、状态、用户ID、租户ID) - 简化实体转换逻辑,移除已注释的字段映射 --- .../controller/CreditUserController.java | 28 ++--------- .../credit/param/CreditUserImportParam.java | 50 +++++++++---------- 2 files changed, 28 insertions(+), 50 deletions(-) diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditUserController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditUserController.java index bd87981..934d804 100644 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditUserController.java +++ b/src/main/java/com/gxwebsoft/credit/controller/CreditUserController.java @@ -229,26 +229,15 @@ public class CreditUserController extends BaseController { List templateList = new ArrayList<>(); CreditUserImportParam example = new CreditUserImportParam(); - example.setName("示例客户"); example.setCode("CUS001"); + example.setName("示例客户"); example.setType(0); example.setRole("采购方"); - example.setParentId(0); example.setInfoType("企业"); - example.setCountry("中国"); - example.setProvince("广西"); - example.setCity("南宁"); - example.setRegion("青秀区"); - example.setAddress("民族大道1号"); + example.setAddress("广东省-广州市-南沙区"); example.setProcurementName("示例招采单位"); example.setWinningName("示例中标单位"); example.setWinningPrice("100000"); - example.setComments("这是示例数据,请删除后填入真实数据"); - example.setRecommend(0); - example.setSortNumber(1); - example.setStatus(0); - example.setUserId(1); - example.setTenantId(1); templateList.add(example); ExportParams exportParams = new ExportParams("赊账客户导入模板", "赊账客户"); @@ -277,26 +266,15 @@ public class CreditUserController extends BaseController { private CreditUser convertImportParamToEntity(CreditUserImportParam param) { CreditUser entity = new CreditUser(); - entity.setName(param.getName()); entity.setCode(param.getCode()); + entity.setName(param.getName()); entity.setType(param.getType()); entity.setRole(param.getRole()); - entity.setParentId(param.getParentId()); entity.setInfoType(param.getInfoType()); - entity.setCountry(param.getCountry()); - entity.setProvince(param.getProvince()); - entity.setCity(param.getCity()); - entity.setRegion(param.getRegion()); entity.setAddress(param.getAddress()); entity.setProcurementName(param.getProcurementName()); entity.setWinningName(param.getWinningName()); entity.setWinningPrice(param.getWinningPrice()); - entity.setComments(param.getComments()); - entity.setRecommend(param.getRecommend()); - entity.setSortNumber(param.getSortNumber()); - entity.setStatus(param.getStatus()); - entity.setUserId(param.getUserId()); - entity.setTenantId(param.getTenantId()); return entity; } diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditUserImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditUserImportParam.java index 2a8fc1b..a466d0c 100644 --- a/src/main/java/com/gxwebsoft/credit/param/CreditUserImportParam.java +++ b/src/main/java/com/gxwebsoft/credit/param/CreditUserImportParam.java @@ -18,7 +18,7 @@ public class CreditUserImportParam implements Serializable { @Excel(name = "项目名称") private String name; - @Excel(name = "唯一标识") + @Excel(name = "序号") private String code; @Excel(name = "类型", replace = {"普通用户_0", "招投标_1"}) @@ -33,19 +33,19 @@ public class CreditUserImportParam implements Serializable { @Excel(name = "信息类型") private String infoType; - @Excel(name = "所在国家") - private String country; +// @Excel(name = "所在国家") +// private String country; - @Excel(name = "所在省份") - private String province; +// @Excel(name = "所在省份") +// private String province; - @Excel(name = "所在城市") - private String city; +// @Excel(name = "所在城市") +// private String city; - @Excel(name = "所在辖区") - private String region; +// @Excel(name = "所在辖区") +// private String region; - @Excel(name = "街道地址") + @Excel(name = "省份地区") private String address; @Excel(name = "招采单位") @@ -57,24 +57,24 @@ public class CreditUserImportParam implements Serializable { @Excel(name = "中标金额") private String winningPrice; - @Excel(name = "备注") - private String comments; - - @Excel(name = "是否推荐", replace = {"否_0", "是_1"}) - private Integer recommend; +// @Excel(name = "备注") +// private String comments; +// +// @Excel(name = "是否推荐", replace = {"否_0", "是_1"}) +// private Integer recommend; // @Excel(name = "到期时间", format = "yyyy-MM-dd HH:mm:ss") // private String expirationTime; - @Excel(name = "排序") - private Integer sortNumber; +// @Excel(name = "排序") +// private Integer sortNumber; +// +// @Excel(name = "状态", replace = {"正常_0", "冻结_1"}) +// private Integer status; - @Excel(name = "状态", replace = {"正常_0", "冻结_1"}) - private Integer status; - - @Excel(name = "用户ID") - private Integer userId; - - @Excel(name = "租户ID") - private Integer tenantId; +// @Excel(name = "用户ID") +// private Integer userId; +// +// @Excel(name = "租户ID") +// private Integer tenantId; }