政治面貌导入

This commit is contained in:
2024-08-18 16:13:52 +08:00
parent ffc74e9984
commit 2462798066

View File

@@ -50,7 +50,7 @@ import java.util.stream.Collectors;
public class EmployeeService extends BaseService<EmployeeEntity, EmployeeRepository> {
public static final List<String> HEADERS =
List.of(
"姓名", "性别", "民族", "婚姻状况", "入职时间", "身份证号", "学历", "毕业学校", "籍贯", "住址", "手机号", "部门",
"姓名", "性别", "民族","政治面貌", "婚姻状况", "入职时间", "身份证号", "学历", "毕业学校", "籍贯", "住址", "手机号", "部门",
"岗位", "银行卡号", "收款人姓名");
@Autowired private EmployeeRepository repository;
@@ -156,6 +156,10 @@ public class EmployeeService extends BaseService<EmployeeEntity, EmployeeReposit
new ExcelUtils.ValidationInfo.ListValidationInfo(
dictionaryService.getExcelValidation(
"sex"));
case "政治面貌" ->
new ExcelUtils.ValidationInfo.ListValidationInfo(
dictionaryService.getExcelValidation(
"emp.politicalStatus"));
case "民族" ->
new ExcelUtils.ValidationInfo.ListValidationInfo(
dictionaryService.getExcelValidation(
@@ -217,6 +221,7 @@ public class EmployeeService extends BaseService<EmployeeEntity, EmployeeReposit
var nationTranslator = translator.apply("nation");
var marriageTranslator = translator.apply("marriage");
var educationTranslator = translator.apply("education");
var politicalStatusTranslator = translator.apply("emp.politicalStatus");
List<EmployeeEntity> list =
ExcelUtils.readFirstSheetToObjectList(
@@ -228,6 +233,8 @@ public class EmployeeService extends BaseService<EmployeeEntity, EmployeeReposit
case "性别" -> emp.setSex(ExcelUtils.getCode(value, sexTranslator));
case "民族" ->
emp.setNation(ExcelUtils.getCode(value, nationTranslator));
case "政治面貌" ->
emp.setNation(ExcelUtils.getCode(value, politicalStatusTranslator));
case "婚姻状况" ->
emp.setMarriage(
ExcelUtils.getCode(value, marriageTranslator));