|
|
|
@ -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);
|
|
|
|
|