BUG修复
This commit is contained in:
parent
1b4d7203b8
commit
c8eb2f3451
|
|
@ -1072,7 +1072,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
}
|
||||
for (String s : split) {
|
||||
parentDepartmentId = MapperProxyFactory.getProxy(DepartmentMapper.class).getIdByNameAndPid(s, parentCompanyId, parentDepartmentId == null ? 0 : parentDepartmentId);
|
||||
if (null == parentCompanyId) {
|
||||
if (null == parentDepartmentId) {
|
||||
historyDetailPO.setOperateDetail(cellValue + "部门未找到对应数据");
|
||||
historyDetailPO.setStatus("0");
|
||||
saveImportDetailLog(historyDetailPO);
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import com.engine.organization.mapper.scheme.SchemeMapper;
|
|||
import com.engine.organization.mapper.sequence.SequenceMapper;
|
||||
import com.engine.organization.thread.HrmResourceTriggerRunnable;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import com.wbi.util.Util;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
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());
|
||||
updateFlag = true;
|
||||
|
||||
if(StringUtils.isBlank(sourceField100001)){
|
||||
// 拼接Field100001字段,岗位序列A职级A职等
|
||||
sourceField100001 += "_" + jobById.getSequenceId() + "A" + jobById.getGradeId() + "A" + jobById.getLevelId().split(",")[0];
|
||||
// 职等职级为空,从岗位取值、更新
|
||||
if (StringUtils.isBlank(sourceField100001)) {
|
||||
if (StringUtils.isNotBlank(jobById.getLevelId())) {
|
||||
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) {
|
||||
String detailMsg = "导入第" + historyDetailPO.getRowNums() + "行数据,[" + historyDetailPO.getRelatedName() + "]" + historyDetailPO.getOperateDetail();
|
||||
String detailMsg = "导入第" + historyDetailPO.getRowNums() + "行数据," + historyDetailPO.getRelatedName() + historyDetailPO.getOperateDetail();
|
||||
historyDetailPO.setOperateDetail(detailMsg);
|
||||
MapperProxyFactory.getProxy(JclImportHistoryDetailMapper.class).insertHistoryDetail(historyDetailPO);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,9 +124,10 @@ public class StaffInfoImportUtil {
|
|||
List<StaffPlanPO> staffPlanPOS = MapperProxyFactory.getProxy(StaffPlanMapper.class).listByNo(Util.null2String(reallyValue));
|
||||
if (CollectionUtils.isNotEmpty(staffPlanPOS)) {
|
||||
staffPlanPO = staffPlanPOS.get(0);
|
||||
map.put("plan_id",staffPlanPO.getId());
|
||||
map.put("plan_id", staffPlanPO.getId());
|
||||
historyDetailPO.setRelatedName(staffPlanPO.getPlanNo());
|
||||
} else {
|
||||
historyDetailPO.setRelatedName("");
|
||||
historyDetailPO.setOperateDetail("编号:" + reallyValue + ",未找到对应数据");
|
||||
historyDetailPO.setStatus("0");
|
||||
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
||||
|
|
@ -169,7 +170,7 @@ public class StaffInfoImportUtil {
|
|||
}
|
||||
for (String s : split) {
|
||||
parentDepartmentId = MapperProxyFactory.getProxy(DepartmentMapper.class).getIdByNameAndPid(s, parentCompanyId, parentDepartmentId == null ? 0 : parentDepartmentId);
|
||||
if (null == parentCompanyId) {
|
||||
if (null == parentDepartmentId) {
|
||||
historyDetailPO.setOperateDetail(cellValue + "部门未找到对应数据");
|
||||
historyDetailPO.setStatus("0");
|
||||
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
||||
|
|
@ -213,6 +214,15 @@ public class StaffInfoImportUtil {
|
|||
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);
|
||||
continue;
|
||||
}
|
||||
StaffSearchParam param = JSONObject.toJavaObject((JSON) JSONObject.toJSON(map), StaffSearchParam.class);
|
||||
String controlDimension = staffPlanPO.getControlDimension();
|
||||
String checkMsg = "";
|
||||
switch (controlDimension) {
|
||||
|
|
@ -233,6 +244,9 @@ public class StaffInfoImportUtil {
|
|||
if (null == parentCompanyId) {
|
||||
checkMsg = "编制维度选择分部时,分部必填!";
|
||||
}
|
||||
// 取消部门、岗位赋值
|
||||
param.setDeptId(null);
|
||||
param.setJobId(null);
|
||||
break;
|
||||
case "2":// 部门
|
||||
if (null == parentCompanyId) {
|
||||
|
|
@ -240,6 +254,8 @@ public class StaffInfoImportUtil {
|
|||
} else if (null == parentDepartmentId) {
|
||||
checkMsg = "编制维度选择部门时,部门必填!";
|
||||
}
|
||||
// 取消岗位赋值
|
||||
param.setJobId(null);
|
||||
break;
|
||||
case "3": // 岗位
|
||||
if (null == parentCompanyId) {
|
||||
|
|
@ -254,16 +270,15 @@ public class StaffInfoImportUtil {
|
|||
checkMsg = "编制方案数据有误,请确认";
|
||||
break;
|
||||
}
|
||||
if(StringUtils.isNotBlank(checkMsg)){
|
||||
if (StringUtils.isNotBlank(checkMsg)) {
|
||||
historyDetailPO.setOperateDetail(checkMsg);
|
||||
historyDetailPO.setStatus("0");
|
||||
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
||||
continue;
|
||||
}
|
||||
|
||||
StaffSearchParam param = JSONObject.toJavaObject((JSON) JSONObject.toJSON(map), StaffSearchParam.class);
|
||||
StaffPO staffPO = StaffBO.convertParamToPO(param, (long) user.getUID());
|
||||
if(null==staffPO.getControlPolicy()){
|
||||
if (null == staffPO.getControlPolicy()) {
|
||||
staffPO.setControlPolicy(1);
|
||||
}
|
||||
MapperProxyFactory.getProxy(StaffMapper.class).insertIgnoreNull(staffPO);
|
||||
|
|
|
|||
Loading…
Reference in New Issue