refactor(credit): 优化客户导入参数结构
- 调整示例数据字段赋值顺序,提升代码可读性 - 注释掉不再使用的地址相关字段(国家、省份、城市、辖区) - 修改地址字段为省份地区,简化地址信息输入 - 更新Excel表头名称,将"唯一标识"改为"序号" - 移除冗余的业务字段(备注、推荐、排序、状态、用户ID、租户ID) - 简化实体转换逻辑,移除已注释的字段映射
This commit is contained in:
@@ -229,26 +229,15 @@ public class CreditUserController extends BaseController {
|
||||
List<CreditUserImportParam> 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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user