diff --git a/safety-eval-app/src/main/java/org/qinan/safetyeval/app/support/OrgPersonnelExcelImporter.java b/safety-eval-app/src/main/java/org/qinan/safetyeval/app/support/OrgPersonnelExcelImporter.java index a29f5f00..8c7faad2 100644 --- a/safety-eval-app/src/main/java/org/qinan/safetyeval/app/support/OrgPersonnelExcelImporter.java +++ b/safety-eval-app/src/main/java/org/qinan/safetyeval/app/support/OrgPersonnelExcelImporter.java @@ -278,13 +278,7 @@ public class OrgPersonnelExcelImporter { return false; } - // 3. 日期格式校验(DB: birth_date / 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; - } + // 3. 日期格式校验(DB: join_work_date date;出生日期由身份证号解析,不做校验) String joinWorkDate = trim(row.getJoinWorkDate()); if (StringUtils.hasText(joinWorkDate) && parseDate(joinWorkDate) == null) { errors.add(new OrgPersonnelImportErrorCO(rowIndex, account, userName, @@ -590,8 +584,15 @@ public class OrgPersonnelExcelImporter { entity.setBasicDisciplineMajorId(row.getBasicDisciplineMajorId()); entity.setUserName(trim(row.getUserName())); entity.setAccount(trim(row.getAccount())); - entity.setIdCardNo(trim(row.getIdCardNo())); - entity.setBirthDate(parseDate(trim(row.getBirthDate()))); + String idCardNo = trim(row.getIdCardNo()); + 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.setGraduateSchool(trim(row.getGraduateSchool())); entity.setMajor(trim(row.getMajor())); diff --git a/safety-eval-app/src/main/java/org/qinan/safetyeval/app/support/OrgPersonnelImportRow.java b/safety-eval-app/src/main/java/org/qinan/safetyeval/app/support/OrgPersonnelImportRow.java index d79be9a4..f19481a7 100644 --- a/safety-eval-app/src/main/java/org/qinan/safetyeval/app/support/OrgPersonnelImportRow.java +++ b/safety-eval-app/src/main/java/org/qinan/safetyeval/app/support/OrgPersonnelImportRow.java @@ -13,9 +13,10 @@ import javax.validation.constraints.Size; * 人员导入 Excel 行模型(按列下标映射,避免表头存在重名列)。 *

* 列顺序:一级部门 / 二级部门 / 三级部门 / 岗位 / 账号(手机号) / 姓名 / 性别 / - * 出生日期 / 身份证号 / 学历 / 毕业院校 / 所学专业 / 职称 / 参加工作时间 / + * 身份证号 / 学历 / 毕业院校 / 所学专业 / 职称 / 参加工作时间 / * 是否注册安全工程师 / 现住地址 / 办公地址 / 主要学习工作经历 / * 出版学术专著、专利、获奖、发表学术论文等 / 自我申报的专业能力及认定方式。 + *

出生日期不再通过Excel导入,统一由身份证号解析。

*

*

* 部门按三级层级填写:一级部门为根,二级部门 parentId 指向一级部门, @@ -54,50 +55,47 @@ public class OrgPersonnelImportRow { @Size(max = 10, message = "性别长度不能超过10个字符") private String gender; - @ExcelProperty(value = "出生日期", index = 7) - private String birthDate; - - @ExcelProperty(value = "身份证号", index = 8) + @ExcelProperty(value = "身份证号", index = 7) @Size(max = 18, message = "身份证号长度不能超过18个字符") private String idCardNo; - @ExcelProperty(value = "学历", index = 9) + @ExcelProperty(value = "学历", index = 8) @Size(max = 50, message = "学历长度不能超过50个字符") private String education; - @ExcelProperty(value = "毕业院校", index = 10) + @ExcelProperty(value = "毕业院校", index = 9) @Size(max = 200, message = "毕业院校长度不能超过200个字符") private String graduateSchool; - @ExcelProperty(value = "所学专业", index = 11) + @ExcelProperty(value = "所学专业", index = 10) @Size(max = 100, message = "所学专业长度不能超过100个字符") private String major; - @ExcelProperty(value = "职称", index = 12) + @ExcelProperty(value = "职称", index = 11) private String title; - @ExcelProperty(value = "参加工作时间", index = 13) + @ExcelProperty(value = "参加工作时间", index = 12) private String joinWorkDate; - @ExcelProperty(value = "是否注册安全工程师", index = 14) + @ExcelProperty(value = "是否注册安全工程师", index = 13) private String registerEngineer; - @ExcelProperty(value = "现住地址", index = 15) + @ExcelProperty(value = "现住地址", index = 14) @Size(max = 500, message = "现住地址长度不能超过500个字符") private String currentAddress; - @ExcelProperty(value = "办公地址", index = 16) + @ExcelProperty(value = "办公地址", index = 15) @Size(max = 500, message = "办公地址长度不能超过500个字符") private String officeAddress; - @ExcelProperty(value = "主要学习工作经历", index = 17) + @ExcelProperty(value = "主要学习工作经历", index = 16) private String workExperience; - @ExcelProperty(value = "出版学术专著、专利、获奖、发表学术论文等", index = 18) + @ExcelProperty(value = "出版学术专著、专利、获奖、发表学术论文等", index = 17) @Size(max = 1000, message = "出版学术专著等信息长度不能超过1000个字符") private String publications; - @ExcelProperty(value = "自我申报的专业能力及认定方式", index = 19) + @ExcelProperty(value = "自我申报的专业能力及认定方式", index = 18) @Size(max = 1000, message = "自我申报的专业能力信息长度不能超过1000个字符") private String abilityDeclaration; diff --git a/safety-eval-start/src/main/resources/sdk-prod.yml b/safety-eval-start/src/main/resources/sdk-prod.yml index e9083e71..e3009af6 100644 --- a/safety-eval-start/src/main/resources/sdk-prod.yml +++ b/safety-eval-start/src/main/resources/sdk-prod.yml @@ -83,4 +83,6 @@ auth: template: personnel: import: - url: https://test-dragon-yf-pub.oss-cn-hangzhou.aliyuncs.com/jjb/6a744e66e4b050366fecad3c.xlsx \ No newline at end of file + 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 \ No newline at end of file diff --git a/safety-eval-start/src/main/resources/sdk.yml b/safety-eval-start/src/main/resources/sdk.yml index 4bdc5616..20c60781 100644 --- a/safety-eval-start/src/main/resources/sdk.yml +++ b/safety-eval-start/src/main/resources/sdk.yml @@ -84,4 +84,6 @@ auth: template: personnel: import: - url: https://test-dragon-yf-pub.oss-cn-hangzhou.aliyuncs.com/jjb/6a744e66e4b050366fecad3c.xlsx \ No newline at end of file + 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 \ No newline at end of file