BUG修复

pull/244/MERGE^2
dxfeng 3 years ago
parent 1b4d7203b8
commit c8eb2f3451

@ -1072,7 +1072,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
} }
for (String s : split) { for (String s : split) {
parentDepartmentId = MapperProxyFactory.getProxy(DepartmentMapper.class).getIdByNameAndPid(s, parentCompanyId, parentDepartmentId == null ? 0 : parentDepartmentId); parentDepartmentId = MapperProxyFactory.getProxy(DepartmentMapper.class).getIdByNameAndPid(s, parentCompanyId, parentDepartmentId == null ? 0 : parentDepartmentId);
if (null == parentCompanyId) { if (null == parentDepartmentId) {
historyDetailPO.setOperateDetail(cellValue + "部门未找到对应数据"); historyDetailPO.setOperateDetail(cellValue + "部门未找到对应数据");
historyDetailPO.setStatus("0"); historyDetailPO.setStatus("0");
saveImportDetailLog(historyDetailPO); saveImportDetailLog(historyDetailPO);

@ -21,6 +21,7 @@ import com.engine.organization.mapper.scheme.SchemeMapper;
import com.engine.organization.mapper.sequence.SequenceMapper; import com.engine.organization.mapper.sequence.SequenceMapper;
import com.engine.organization.thread.HrmResourceTriggerRunnable; import com.engine.organization.thread.HrmResourceTriggerRunnable;
import com.engine.organization.util.db.MapperProxyFactory; import com.engine.organization.util.db.MapperProxyFactory;
import com.wbi.util.Util;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import java.util.HashMap; import java.util.HashMap;
@ -78,9 +79,35 @@ public class CusFieldDataTrigger {
MapperProxyFactory.getProxy(ExtMapper.class).updateTable(ExtendInfoParams.builder().id(id).tableName("hrmresource").params(hrmResourceMap).build()); MapperProxyFactory.getProxy(ExtMapper.class).updateTable(ExtendInfoParams.builder().id(id).tableName("hrmresource").params(hrmResourceMap).build());
updateFlag = true; updateFlag = true;
// 职等职级为空,从岗位取值、更新
if (StringUtils.isBlank(sourceField100001)) { if (StringUtils.isBlank(sourceField100001)) {
// 拼接Field100001字段,岗位序列A职级A职等 if (StringUtils.isNotBlank(jobById.getLevelId())) {
sourceField100001 += "_" + jobById.getSequenceId() + "A" + jobById.getGradeId() + "A" + jobById.getLevelId().split(",")[0]; LevelPO levelByID = MapperProxyFactory.getProxy(LevelMapper.class).getLevelByID(Long.parseLong(jobById.getLevelId().split(",")[0]));
directionData.setField100008(levelByID.getLevelName());
}else{
directionData.setField100008(null);
}
// 职等职级方案
if (StringUtils.isNotBlank(Util.null2String(jobById.getSchemeId()))) {
SchemePO schemeByID = MapperProxyFactory.getProxy(SchemeMapper.class).getSchemeByID(jobById.getSchemeId());
directionData.setField100006(schemeByID.getSchemeName());
}else{
directionData.setField100006(null);
}
// 职级
if (StringUtils.isNotBlank(jobById.getGradeId())) {
GradePO gradeByLevelId = MapperProxyFactory.getProxy(GradeMapper.class).getGradeByID(Long.parseLong(jobById.getGradeId()));
directionData.setField100007(gradeByLevelId.getGradeName());
}else{
directionData.setField100007(null);
}
// 岗位序列
if (StringUtils.isNotBlank(Util.null2String(jobById.getSequenceId()))) {
SequencePO sequenceBySchemeId = MapperProxyFactory.getProxy(SequenceMapper.class).getSequenceByID(jobById.getSequenceId());
directionData.setField100005(sequenceBySchemeId.getSequenceName());
}else{
directionData.setField100005(null);
}
} }
} }

@ -37,7 +37,7 @@ public class OrgImportUtil {
} }
public static void saveImportDetailLog(JclImportHistoryDetailPO historyDetailPO) { public static void saveImportDetailLog(JclImportHistoryDetailPO historyDetailPO) {
String detailMsg = "导入第" + historyDetailPO.getRowNums() + "行数据,[" + historyDetailPO.getRelatedName() + "]" + historyDetailPO.getOperateDetail(); String detailMsg = "导入第" + historyDetailPO.getRowNums() + "行数据," + historyDetailPO.getRelatedName() + historyDetailPO.getOperateDetail();
historyDetailPO.setOperateDetail(detailMsg); historyDetailPO.setOperateDetail(detailMsg);
MapperProxyFactory.getProxy(JclImportHistoryDetailMapper.class).insertHistoryDetail(historyDetailPO); MapperProxyFactory.getProxy(JclImportHistoryDetailMapper.class).insertHistoryDetail(historyDetailPO);
} }

@ -127,6 +127,7 @@ public class StaffInfoImportUtil {
map.put("plan_id", staffPlanPO.getId()); map.put("plan_id", staffPlanPO.getId());
historyDetailPO.setRelatedName(staffPlanPO.getPlanNo()); historyDetailPO.setRelatedName(staffPlanPO.getPlanNo());
} else { } else {
historyDetailPO.setRelatedName("");
historyDetailPO.setOperateDetail("编号:" + reallyValue + ",未找到对应数据"); historyDetailPO.setOperateDetail("编号:" + reallyValue + ",未找到对应数据");
historyDetailPO.setStatus("0"); historyDetailPO.setStatus("0");
OrgImportUtil.saveImportDetailLog(historyDetailPO); OrgImportUtil.saveImportDetailLog(historyDetailPO);
@ -169,7 +170,7 @@ public class StaffInfoImportUtil {
} }
for (String s : split) { for (String s : split) {
parentDepartmentId = MapperProxyFactory.getProxy(DepartmentMapper.class).getIdByNameAndPid(s, parentCompanyId, parentDepartmentId == null ? 0 : parentDepartmentId); parentDepartmentId = MapperProxyFactory.getProxy(DepartmentMapper.class).getIdByNameAndPid(s, parentCompanyId, parentDepartmentId == null ? 0 : parentDepartmentId);
if (null == parentCompanyId) { if (null == parentDepartmentId) {
historyDetailPO.setOperateDetail(cellValue + "部门未找到对应数据"); historyDetailPO.setOperateDetail(cellValue + "部门未找到对应数据");
historyDetailPO.setStatus("0"); historyDetailPO.setStatus("0");
OrgImportUtil.saveImportDetailLog(historyDetailPO); OrgImportUtil.saveImportDetailLog(historyDetailPO);
@ -213,6 +214,15 @@ public class StaffInfoImportUtil {
map.put("job_id", parentJobId); map.put("job_id", parentJobId);
} }
// 编制数大于0
if ("staff_num".equals(infoPO.getFieldName()) && Integer.parseInt(Util.null2String(reallyValue)) < 0) {
historyDetailPO.setOperateDetail("编制数不可小于0");
historyDetailPO.setStatus("0");
OrgImportUtil.saveImportDetailLog(historyDetailPO);
continue nextRow;
}
} }
} }
// 校验、数据交互 // 校验、数据交互
@ -226,6 +236,7 @@ public class StaffInfoImportUtil {
OrgImportUtil.saveImportDetailLog(historyDetailPO); OrgImportUtil.saveImportDetailLog(historyDetailPO);
continue; continue;
} }
StaffSearchParam param = JSONObject.toJavaObject((JSON) JSONObject.toJSON(map), StaffSearchParam.class);
String controlDimension = staffPlanPO.getControlDimension(); String controlDimension = staffPlanPO.getControlDimension();
String checkMsg = ""; String checkMsg = "";
switch (controlDimension) { switch (controlDimension) {
@ -233,6 +244,9 @@ public class StaffInfoImportUtil {
if (null == parentCompanyId) { if (null == parentCompanyId) {
checkMsg = "编制维度选择分部时,分部必填!"; checkMsg = "编制维度选择分部时,分部必填!";
} }
// 取消部门、岗位赋值
param.setDeptId(null);
param.setJobId(null);
break; break;
case "2":// 部门 case "2":// 部门
if (null == parentCompanyId) { if (null == parentCompanyId) {
@ -240,6 +254,8 @@ public class StaffInfoImportUtil {
} else if (null == parentDepartmentId) { } else if (null == parentDepartmentId) {
checkMsg = "编制维度选择部门时,部门必填!"; checkMsg = "编制维度选择部门时,部门必填!";
} }
// 取消岗位赋值
param.setJobId(null);
break; break;
case "3": // 岗位 case "3": // 岗位
if (null == parentCompanyId) { if (null == parentCompanyId) {
@ -261,7 +277,6 @@ public class StaffInfoImportUtil {
continue; continue;
} }
StaffSearchParam param = JSONObject.toJavaObject((JSON) JSONObject.toJSON(map), StaffSearchParam.class);
StaffPO staffPO = StaffBO.convertParamToPO(param, (long) user.getUID()); StaffPO staffPO = StaffBO.convertParamToPO(param, (long) user.getUID());
if (null == staffPO.getControlPolicy()) { if (null == staffPO.getControlPolicy()) {
staffPO.setControlPolicy(1); staffPO.setControlPolicy(1);

Loading…
Cancel
Save