dev-tmp1
luotaiqian 2026-08-18 14:13:57 +08:00
parent 6b124d29cb
commit f20cac68a8
4 changed files with 30 additions and 27 deletions

View File

@ -278,13 +278,7 @@ public class OrgPersonnelExcelImporter {
return false; return false;
} }
// 3. 日期格式校验DB: birth_date / join_work_date date // 3. 日期格式校验DB: join_work_date date出生日期由身份证号解析不做校验
String birthDate = trim(row.getBirthDate());
if (StringUtils.hasText(birthDate) && parseDate(birthDate) == null) {
errors.add(new OrgPersonnelImportErrorCO(rowIndex, account, userName,
"出生日期格式不正确应为yyyy-MM-dd或yyyy/M/d"));
return false;
}
String joinWorkDate = trim(row.getJoinWorkDate()); String joinWorkDate = trim(row.getJoinWorkDate());
if (StringUtils.hasText(joinWorkDate) && parseDate(joinWorkDate) == null) { if (StringUtils.hasText(joinWorkDate) && parseDate(joinWorkDate) == null) {
errors.add(new OrgPersonnelImportErrorCO(rowIndex, account, userName, errors.add(new OrgPersonnelImportErrorCO(rowIndex, account, userName,
@ -590,8 +584,15 @@ public class OrgPersonnelExcelImporter {
entity.setBasicDisciplineMajorId(row.getBasicDisciplineMajorId()); entity.setBasicDisciplineMajorId(row.getBasicDisciplineMajorId());
entity.setUserName(trim(row.getUserName())); entity.setUserName(trim(row.getUserName()));
entity.setAccount(trim(row.getAccount())); entity.setAccount(trim(row.getAccount()));
entity.setIdCardNo(trim(row.getIdCardNo())); String idCardNo = trim(row.getIdCardNo());
entity.setBirthDate(parseDate(trim(row.getBirthDate()))); entity.setIdCardNo(idCardNo);
// 出生日期不再从Excel导入直接通过身份证号Hutool解析
if (StringUtils.hasText(idCardNo)) {
String birth = IdcardUtil.getBirthByIdCard(idCardNo);
if (StringUtils.hasText(birth)) {
entity.setBirthDate(LocalDate.parse(birth, DateTimeFormatter.BASIC_ISO_DATE));
}
}
entity.setJoinWorkDate(parseDate(trim(row.getJoinWorkDate()))); entity.setJoinWorkDate(parseDate(trim(row.getJoinWorkDate())));
entity.setGraduateSchool(trim(row.getGraduateSchool())); entity.setGraduateSchool(trim(row.getGraduateSchool()));
entity.setMajor(trim(row.getMajor())); entity.setMajor(trim(row.getMajor()));

View File

@ -13,9 +13,10 @@ import javax.validation.constraints.Size;
* Excel * Excel
* <p> * <p>
* / / / / () / / / * / / / / () / / /
* / / / / / / / * / / / / / /
* / / / / * / / / /
* / * /
* <p>Excel</p>
* </p> * </p>
* <p> * <p>
* parentId * parentId
@ -54,50 +55,47 @@ public class OrgPersonnelImportRow {
@Size(max = 10, message = "性别长度不能超过10个字符") @Size(max = 10, message = "性别长度不能超过10个字符")
private String gender; private String gender;
@ExcelProperty(value = "出生日期", index = 7) @ExcelProperty(value = "身份证号", index = 7)
private String birthDate;
@ExcelProperty(value = "身份证号", index = 8)
@Size(max = 18, message = "身份证号长度不能超过18个字符") @Size(max = 18, message = "身份证号长度不能超过18个字符")
private String idCardNo; private String idCardNo;
@ExcelProperty(value = "学历", index = 9) @ExcelProperty(value = "学历", index = 8)
@Size(max = 50, message = "学历长度不能超过50个字符") @Size(max = 50, message = "学历长度不能超过50个字符")
private String education; private String education;
@ExcelProperty(value = "毕业院校", index = 10) @ExcelProperty(value = "毕业院校", index = 9)
@Size(max = 200, message = "毕业院校长度不能超过200个字符") @Size(max = 200, message = "毕业院校长度不能超过200个字符")
private String graduateSchool; private String graduateSchool;
@ExcelProperty(value = "所学专业", index = 11) @ExcelProperty(value = "所学专业", index = 10)
@Size(max = 100, message = "所学专业长度不能超过100个字符") @Size(max = 100, message = "所学专业长度不能超过100个字符")
private String major; private String major;
@ExcelProperty(value = "职称", index = 12) @ExcelProperty(value = "职称", index = 11)
private String title; private String title;
@ExcelProperty(value = "参加工作时间", index = 13) @ExcelProperty(value = "参加工作时间", index = 12)
private String joinWorkDate; private String joinWorkDate;
@ExcelProperty(value = "是否注册安全工程师", index = 14) @ExcelProperty(value = "是否注册安全工程师", index = 13)
private String registerEngineer; private String registerEngineer;
@ExcelProperty(value = "现住地址", index = 15) @ExcelProperty(value = "现住地址", index = 14)
@Size(max = 500, message = "现住地址长度不能超过500个字符") @Size(max = 500, message = "现住地址长度不能超过500个字符")
private String currentAddress; private String currentAddress;
@ExcelProperty(value = "办公地址", index = 16) @ExcelProperty(value = "办公地址", index = 15)
@Size(max = 500, message = "办公地址长度不能超过500个字符") @Size(max = 500, message = "办公地址长度不能超过500个字符")
private String officeAddress; private String officeAddress;
@ExcelProperty(value = "主要学习工作经历", index = 17) @ExcelProperty(value = "主要学习工作经历", index = 16)
private String workExperience; private String workExperience;
@ExcelProperty(value = "出版学术专著、专利、获奖、发表学术论文等", index = 18) @ExcelProperty(value = "出版学术专著、专利、获奖、发表学术论文等", index = 17)
@Size(max = 1000, message = "出版学术专著等信息长度不能超过1000个字符") @Size(max = 1000, message = "出版学术专著等信息长度不能超过1000个字符")
private String publications; private String publications;
@ExcelProperty(value = "自我申报的专业能力及认定方式", index = 19) @ExcelProperty(value = "自我申报的专业能力及认定方式", index = 18)
@Size(max = 1000, message = "自我申报的专业能力信息长度不能超过1000个字符") @Size(max = 1000, message = "自我申报的专业能力信息长度不能超过1000个字符")
private String abilityDeclaration; private String abilityDeclaration;

View File

@ -83,4 +83,6 @@ auth:
template: template:
personnel: personnel:
import: import:
url: https://test-dragon-yf-pub.oss-cn-hangzhou.aliyuncs.com/jjb/6a744e66e4b050366fecad3c.xlsx url: https://test-dragon-yf-pub.oss-cn-hangzhou.aliyuncs.com/jjb/2026/8/18/8daaa28b973a4eea8e01173d04dbd877.xlsx
paper:
importUrl: https://test-dragon-yf-pub.oss-cn-hangzhou.aliyuncs.com/jjb/2026/8/18/d187b58e19ac480cb38187f7d7557ddb.xlsx

View File

@ -84,4 +84,6 @@ auth:
template: template:
personnel: personnel:
import: import:
url: https://test-dragon-yf-pub.oss-cn-hangzhou.aliyuncs.com/jjb/6a744e66e4b050366fecad3c.xlsx url: https://test-dragon-yf-pub.oss-cn-hangzhou.aliyuncs.com/jjb/2026/8/18/8daaa28b973a4eea8e01173d04dbd877.xlsx
paper:
importUrl: https://test-dragon-yf-pub.oss-cn-hangzhou.aliyuncs.com/jjb/2026/8/18/d187b58e19ac480cb38187f7d7557ddb.xlsx