dev
luotaiqian 2026-08-03 11:01:30 +08:00
parent d1db56705f
commit 519cddd842
1 changed files with 16 additions and 2 deletions

View File

@ -9,6 +9,7 @@ import org.qinan.safetyeval.domain.entity.OrgPositionEntity;
import org.qinan.safetyeval.domain.entity.TitleCodeCo; import org.qinan.safetyeval.domain.entity.TitleCodeCo;
import org.qinan.safetyeval.domain.exception.BizException; import org.qinan.safetyeval.domain.exception.BizException;
import org.qinan.safetyeval.domain.exception.ErrorCode; import org.qinan.safetyeval.domain.exception.ErrorCode;
import org.qinan.safetyeval.domain.constant.QualificationLevelEnum;
import org.qinan.safetyeval.domain.gateway.OrgDepartmentGateway; import org.qinan.safetyeval.domain.gateway.OrgDepartmentGateway;
import org.qinan.safetyeval.domain.gateway.OrgPersonnelGateway; import org.qinan.safetyeval.domain.gateway.OrgPersonnelGateway;
import org.qinan.safetyeval.domain.gateway.OrgPositionGateway; import org.qinan.safetyeval.domain.gateway.OrgPositionGateway;
@ -402,7 +403,7 @@ public class OrgPersonnelExcelImporter {
} }
// 职称:无字典,按分隔符拆分后原样存入(保留信息,待后续字典完善) // 职称:无字典,按分隔符拆分后原样存入(保留信息,待后续字典完善)
// entity.setTitleCodeArr(parseTitles(trim(row.getTitle()))); entity.setTitleCodeArr(parseTitles(trim(row.getTitle())));
return entity; return entity;
} }
@ -415,13 +416,26 @@ public class OrgPersonnelExcelImporter {
.filter(StringUtils::hasText) .filter(StringUtils::hasText)
.map(t -> { .map(t -> {
TitleCodeCo co = new TitleCodeCo(); TitleCodeCo co = new TitleCodeCo();
co.setTitleCode(t); co.setTitleCode(convertTitleToCode(t));
return co; return co;
}) })
.collect(Collectors.toList()); .collect(Collectors.toList());
return list.isEmpty() ? null : list; return list.isEmpty() ? null : list;
} }
/**
* code QualificationLevelEnum "高级工程师"SENIOR"中级工程师"MIDDLE"初级"JUNIOR
*
*/
private String convertTitleToCode(String titleText) {
for (QualificationLevelEnum level : QualificationLevelEnum.values()) {
if (titleText.contains(level.getName())) {
return level.getCode();
}
}
return titleText;
}
/** /**
* yyyy-MM-dd yyyy/M/d 1988-05-121988/5/12 Excel * yyyy-MM-dd yyyy/M/d 1988-05-121988/5/12 Excel
*/ */