|
|
|
@ -26,6 +26,7 @@ import com.engine.organization.entity.scheme.po.SchemePO;
|
|
|
|
|
import com.engine.organization.enums.LogModuleNameEnum;
|
|
|
|
|
import com.engine.organization.enums.OperateTypeEnum;
|
|
|
|
|
import com.engine.organization.enums.OrgImportEnum;
|
|
|
|
|
import com.engine.organization.exception.OrganizationRunTimeException;
|
|
|
|
|
import com.engine.organization.mapper.comp.CompMapper;
|
|
|
|
|
import com.engine.organization.mapper.department.DepartmentMapper;
|
|
|
|
|
import com.engine.organization.mapper.extend.ExtMapper;
|
|
|
|
@ -88,6 +89,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
private static final String HRM_RESOURCE = "hrmresource";
|
|
|
|
|
|
|
|
|
|
static Map<String, ExtendInfoPO> importFieldsMap;
|
|
|
|
|
|
|
|
|
|
static {
|
|
|
|
|
importFieldsMap = new HashMap<>();
|
|
|
|
|
importFieldsMap.put("方案编号", ExtendInfoPO.builder().tableName("jcl_org_scheme").fieldName("scheme_no").fieldNameDesc("方案编号").isrequired(1).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
|
|
|
@ -101,6 +103,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
importFieldsMap.put("职级说明", ExtendInfoPO.builder().tableName("jcl_org_grade").fieldName("grade_description").fieldNameDesc("职级说明").isrequired(0).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ExtendInfoMapper getExtendInfoMapper() {
|
|
|
|
|
return MapperProxyFactory.getProxy(ExtendInfoMapper.class);
|
|
|
|
|
}
|
|
|
|
@ -512,6 +515,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
lsGroup.add(groupItem);
|
|
|
|
|
return lsGroup;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<Object> getJobLevelImportForm(String templatePath) throws IOException {
|
|
|
|
|
|
|
|
|
|
// 返回导入数据
|
|
|
|
@ -697,7 +701,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
} else {
|
|
|
|
|
ExtendInfoPO infoPO = extendInfoPOS.get(cellIndex);
|
|
|
|
|
// 数据校验
|
|
|
|
|
if (infoPO.getIsrequired() == 1 && StringUtils.isBlank(cellValue)) {
|
|
|
|
|
if (infoPO.getIsrequired() == 1 && StringUtils.isBlank(cellValue) && !"comp_no".equalsIgnoreCase(infoPO.getFieldName())) {
|
|
|
|
|
historyDetailPO.setOperateDetail(infoPO.getFieldNameDesc() + "为必填项");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
@ -763,7 +767,14 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
// 自动编号
|
|
|
|
|
try {
|
|
|
|
|
compNo = CompServiceImpl.repeatDetermine(compNo);
|
|
|
|
|
} catch (OrganizationRunTimeException e) {
|
|
|
|
|
historyDetailPO.setOperateDetail(e.getMessage());
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
map.put("comp_no", compNo);
|
|
|
|
|
map.put("creator", user.getUID());
|
|
|
|
|
map.put("delete_type", 0);
|
|
|
|
@ -884,7 +895,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
} else {
|
|
|
|
|
ExtendInfoPO infoPO = extendInfoPOS.get(cellIndex);
|
|
|
|
|
// 数据校验
|
|
|
|
|
if (infoPO.getIsrequired() == 1 && StringUtils.isBlank(cellValue)) {
|
|
|
|
|
if (infoPO.getIsrequired() == 1 && StringUtils.isBlank(cellValue) && !"dept_no".equalsIgnoreCase(infoPO.getFieldName())) {
|
|
|
|
|
historyDetailPO.setOperateDetail(infoPO.getFieldNameDesc() + "为必填项");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
@ -980,7 +991,14 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
// 自动编号
|
|
|
|
|
try {
|
|
|
|
|
deptNo = DepartmentServiceImpl.repeatDetermine(deptNo);
|
|
|
|
|
} catch (OrganizationRunTimeException e) {
|
|
|
|
|
historyDetailPO.setOperateDetail(e.getMessage());
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
map.put("dept_no", deptNo);
|
|
|
|
|
map.put("creator", user.getUID());
|
|
|
|
|
map.put("delete_type", 0);
|
|
|
|
@ -1101,7 +1119,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
} else {
|
|
|
|
|
ExtendInfoPO infoPO = extendInfoPOS.get(cellIndex);
|
|
|
|
|
// 数据校验
|
|
|
|
|
if (infoPO.getIsrequired() == 1 && StringUtils.isBlank(cellValue)) {
|
|
|
|
|
if (infoPO.getIsrequired() == 1 && StringUtils.isBlank(cellValue) && !"job_no".equalsIgnoreCase(infoPO.getFieldName())) {
|
|
|
|
|
historyDetailPO.setOperateDetail(infoPO.getFieldNameDesc() + "为必填项");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
@ -1221,7 +1239,14 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
// 自动编号
|
|
|
|
|
try {
|
|
|
|
|
jobNo = JobServiceImpl.repeatDetermine(jobNo);
|
|
|
|
|
} catch (OrganizationRunTimeException e) {
|
|
|
|
|
historyDetailPO.setOperateDetail(e.getMessage());
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
map.put("job_no", jobNo);
|
|
|
|
|
map.put("creator", user.getUID());
|
|
|
|
|
map.put("delete_type", 0);
|
|
|
|
@ -1350,7 +1375,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
} else {
|
|
|
|
|
ExtendInfoPO infoPO = extendInfoPOS.get(cellIndex);
|
|
|
|
|
// 数据校验
|
|
|
|
|
if (infoPO.getIsrequired() == 1 && StringUtils.isBlank(cellValue)) {
|
|
|
|
|
if (infoPO.getIsrequired() == 1 && StringUtils.isBlank(cellValue) && !"work_code".equalsIgnoreCase(infoPO.getFieldName())) {
|
|
|
|
|
historyDetailPO.setOperateDetail(infoPO.getFieldNameDesc() + "为必填项");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
@ -1488,7 +1513,14 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
String workCode = Util.null2String(map.get("work_code"));
|
|
|
|
|
try {
|
|
|
|
|
// 自动编号
|
|
|
|
|
try {
|
|
|
|
|
workCode = HrmResourceServiceImpl.repeatDetermine(workCode);
|
|
|
|
|
} catch (OrganizationRunTimeException e) {
|
|
|
|
|
historyDetailPO.setOperateDetail(e.getMessage());
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
map.put("work_code", workCode);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
historyDetailPO.setOperateDetail(Util.null2String(e.getMessage()));
|
|
|
|
@ -2056,7 +2088,11 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
* 日志导入详细信息日志
|
|
|
|
|
*/
|
|
|
|
|
private void saveImportDetailLog(JclImportHistoryDetailPO historyDetailPO) {
|
|
|
|
|
String detailMsg = "导入第" + historyDetailPO.getRowNums() + "行数据,[" + historyDetailPO.getRelatedName() + "]" + historyDetailPO.getOperateDetail();
|
|
|
|
|
String relatedName = historyDetailPO.getRelatedName();
|
|
|
|
|
if (StringUtils.isNotBlank(relatedName)) {
|
|
|
|
|
relatedName = "[" + relatedName + "]";
|
|
|
|
|
}
|
|
|
|
|
String detailMsg = "导入第" + historyDetailPO.getRowNums() + "行数据," + relatedName + historyDetailPO.getOperateDetail();
|
|
|
|
|
historyDetailPO.setOperateDetail(detailMsg);
|
|
|
|
|
MapperProxyFactory.getProxy(JclImportHistoryDetailMapper.class).insertHistoryDetail(historyDetailPO);
|
|
|
|
|
}
|
|
|
|
|