refactor(credit): 优化客户导入参数结构

- 调整示例数据字段赋值顺序,提升代码可读性
- 注释掉不再使用的地址相关字段(国家、省份、城市、辖区)
- 修改地址字段为省份地区,简化地址信息输入
- 更新Excel表头名称,将"唯一标识"改为"序号"
- 移除冗余的业务字段(备注、推荐、排序、状态、用户ID、租户ID)
- 简化实体转换逻辑,移除已注释的字段映射
This commit is contained in:
2025-12-15 17:38:06 +08:00
parent 7853e435d4
commit bd6868f8a3
2 changed files with 28 additions and 50 deletions

View File

@@ -229,26 +229,15 @@ public class CreditUserController extends BaseController {
List<CreditUserImportParam> templateList = new ArrayList<>(); List<CreditUserImportParam> templateList = new ArrayList<>();
CreditUserImportParam example = new CreditUserImportParam(); CreditUserImportParam example = new CreditUserImportParam();
example.setName("示例客户");
example.setCode("CUS001"); example.setCode("CUS001");
example.setName("示例客户");
example.setType(0); example.setType(0);
example.setRole("采购方"); example.setRole("采购方");
example.setParentId(0);
example.setInfoType("企业"); example.setInfoType("企业");
example.setCountry("中国"); example.setAddress("广东省-广州市-南沙区");
example.setProvince("广西");
example.setCity("南宁");
example.setRegion("青秀区");
example.setAddress("民族大道1号");
example.setProcurementName("示例招采单位"); example.setProcurementName("示例招采单位");
example.setWinningName("示例中标单位"); example.setWinningName("示例中标单位");
example.setWinningPrice("100000"); example.setWinningPrice("100000");
example.setComments("这是示例数据,请删除后填入真实数据");
example.setRecommend(0);
example.setSortNumber(1);
example.setStatus(0);
example.setUserId(1);
example.setTenantId(1);
templateList.add(example); templateList.add(example);
ExportParams exportParams = new ExportParams("赊账客户导入模板", "赊账客户"); ExportParams exportParams = new ExportParams("赊账客户导入模板", "赊账客户");
@@ -277,26 +266,15 @@ public class CreditUserController extends BaseController {
private CreditUser convertImportParamToEntity(CreditUserImportParam param) { private CreditUser convertImportParamToEntity(CreditUserImportParam param) {
CreditUser entity = new CreditUser(); CreditUser entity = new CreditUser();
entity.setName(param.getName());
entity.setCode(param.getCode()); entity.setCode(param.getCode());
entity.setName(param.getName());
entity.setType(param.getType()); entity.setType(param.getType());
entity.setRole(param.getRole()); entity.setRole(param.getRole());
entity.setParentId(param.getParentId());
entity.setInfoType(param.getInfoType()); 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.setAddress(param.getAddress());
entity.setProcurementName(param.getProcurementName()); entity.setProcurementName(param.getProcurementName());
entity.setWinningName(param.getWinningName()); entity.setWinningName(param.getWinningName());
entity.setWinningPrice(param.getWinningPrice()); 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; return entity;
} }

View File

@@ -18,7 +18,7 @@ public class CreditUserImportParam implements Serializable {
@Excel(name = "项目名称") @Excel(name = "项目名称")
private String name; private String name;
@Excel(name = "唯一标识") @Excel(name = "序号")
private String code; private String code;
@Excel(name = "类型", replace = {"普通用户_0", "招投标_1"}) @Excel(name = "类型", replace = {"普通用户_0", "招投标_1"})
@@ -33,19 +33,19 @@ public class CreditUserImportParam implements Serializable {
@Excel(name = "信息类型") @Excel(name = "信息类型")
private String infoType; private String infoType;
@Excel(name = "所在国家") // @Excel(name = "所在国家")
private String country; // private String country;
@Excel(name = "所在省份") // @Excel(name = "所在省份")
private String province; // private String province;
@Excel(name = "所在城市") // @Excel(name = "所在城市")
private String city; // private String city;
@Excel(name = "所在辖区") // @Excel(name = "所在辖区")
private String region; // private String region;
@Excel(name = "街道地址") @Excel(name = "省份地区")
private String address; private String address;
@Excel(name = "招采单位") @Excel(name = "招采单位")
@@ -57,24 +57,24 @@ public class CreditUserImportParam implements Serializable {
@Excel(name = "中标金额") @Excel(name = "中标金额")
private String winningPrice; private String winningPrice;
@Excel(name = "备注") // @Excel(name = "备注")
private String comments; // private String comments;
//
@Excel(name = "是否推荐", replace = {"否_0", "是_1"}) // @Excel(name = "是否推荐", replace = {"否_0", "是_1"})
private Integer recommend; // private Integer recommend;
// @Excel(name = "到期时间", format = "yyyy-MM-dd HH:mm:ss") // @Excel(name = "到期时间", format = "yyyy-MM-dd HH:mm:ss")
// private String expirationTime; // private String expirationTime;
@Excel(name = "排序") // @Excel(name = "排序")
private Integer sortNumber; // private Integer sortNumber;
//
// @Excel(name = "状态", replace = {"正常_0", "冻结_1"})
// private Integer status;
@Excel(name = "状态", replace = {"正常_0", "冻结_1"}) // @Excel(name = "用户ID")
private Integer status; // private Integer userId;
//
@Excel(name = "用户ID") // @Excel(name = "租户ID")
private Integer userId; // private Integer tenantId;
@Excel(name = "租户ID")
private Integer tenantId;
} }