commit
e9e585990a
|
|
@ -516,6 +516,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
int updateCount = 0;
|
||||
OrganizationAssert.notNull(mergeParam.getTargetJob(), "请选择需要合并的岗位");
|
||||
OrganizationAssert.notBlank(mergeParam.getMergeName(), "请输入合并后的名称");
|
||||
|
||||
// 不可选择岗位本身、以及子岗位
|
||||
Set<Long> disableIds = new HashSet<>();
|
||||
|
|
@ -529,8 +530,6 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
|
||||
// 合并到的岗位
|
||||
JobPO targetJob = getJobMapper().getJobById(mergeParam.getTargetJob());
|
||||
// 合并后名称
|
||||
targetJob.setJobName(mergeParam.getMergeName());
|
||||
|
||||
// 待合并的部门
|
||||
JobPO jobById = getJobMapper().getJobById(mergeParam.getId());
|
||||
|
|
@ -555,9 +554,8 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
getJobMapper().updateBaseJob(targetJob);
|
||||
new Thread(new JobTriggerRunnable(targetJob.getId())).start();
|
||||
// 原岗位删除
|
||||
jobById.setForbiddenTag(1);
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, jobById).sync();
|
||||
|
||||
getJobMapper().deleteByIds(Collections.singletonList(jobById.getId()));
|
||||
// 更新组织架构图
|
||||
new Thread(new JobTriggerRunnable(jobById)).start();
|
||||
return updateCount;
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ public class OrganizationSyncEc {
|
|||
map.put("jobresponsibility", Util.null2String(params.get("work_duty")));
|
||||
map.put("jobcompetency", Util.null2String(params.get("work_authority")));
|
||||
map.put("jobtitleremark", Util.null2String(params.get("description")));
|
||||
map.put("jobtitlecode", Util.null2String(params.get("job_no")));
|
||||
map.put("jobtitlecode", Util.null2String(params.get("job_no")) + "_" + System.currentTimeMillis());
|
||||
// 修改岗位表数据
|
||||
this.resultMap = ServiceUtil.getService(HrmJobServiceImpl.class, user).editJobTitle(map, user);
|
||||
} else {
|
||||
|
|
@ -242,7 +242,7 @@ public class OrganizationSyncEc {
|
|||
map.put("jobresponsibility", Util.null2String(params.get("work_duty")));
|
||||
map.put("jobcompetency", Util.null2String(params.get("work_authority")));
|
||||
map.put("jobtitleremark", Util.null2String(params.get("description")));
|
||||
map.put("jobtitlecode", Util.null2String(params.get("job_no")));
|
||||
map.put("jobtitlecode", Util.null2String(params.get("job_no")) + "_" + System.currentTimeMillis());
|
||||
this.resultMap = ServiceUtil.getService(HrmJobServiceImpl.class, user).addJobTitle(map, user);
|
||||
} else {
|
||||
this.resultMap = new HashMap<>();
|
||||
|
|
|
|||
|
|
@ -133,12 +133,6 @@ public class StaffInfoImportUtil {
|
|||
continue nextRow;
|
||||
}
|
||||
}
|
||||
if (null == staffPlanPO) {
|
||||
historyDetailPO.setOperateDetail("未找到对应数据");
|
||||
historyDetailPO.setStatus("0");
|
||||
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
||||
continue nextRow;
|
||||
}
|
||||
|
||||
// 分部
|
||||
if ("comp_id".equals(infoPO.getFieldName())) {
|
||||
|
|
@ -225,26 +219,53 @@ public class StaffInfoImportUtil {
|
|||
if (i == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (null == staffPlanPO) {
|
||||
historyDetailPO.setOperateDetail("未找到对应数据");
|
||||
historyDetailPO.setStatus("0");
|
||||
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
||||
continue;
|
||||
}
|
||||
String controlDimension = staffPlanPO.getControlDimension();
|
||||
String checkMsg = "";
|
||||
switch (controlDimension) {
|
||||
case "1":// 分部
|
||||
OrganizationAssert.notNull(parentCompanyId, "编制维度选择分部时,分部必填!");
|
||||
if (null == parentCompanyId) {
|
||||
checkMsg = "编制维度选择分部时,分部必填!";
|
||||
}
|
||||
break;
|
||||
case "2":// 部门
|
||||
OrganizationAssert.notNull(parentCompanyId, "编制维度选择部门时,分部必填!");
|
||||
OrganizationAssert.notNull(parentDepartmentId, "编制维度选择部门时,部门必填!");
|
||||
if (null == parentCompanyId) {
|
||||
checkMsg = "编制维度选择分部时,分部必填!";
|
||||
} else if (null == parentDepartmentId) {
|
||||
checkMsg = "编制维度选择部门时,部门必填!";
|
||||
}
|
||||
break;
|
||||
case "3": // 岗位
|
||||
OrganizationAssert.notNull(parentCompanyId, "编制维度选择岗位时,分部必填!");
|
||||
OrganizationAssert.notNull(parentDepartmentId, "编制维度选择岗位时,部门必填!");
|
||||
OrganizationAssert.notNull(parentJobId, "编制维度选择岗位时,岗位必填!");
|
||||
if (null == parentCompanyId) {
|
||||
checkMsg = "编制维度选择分部时,分部必填!";
|
||||
} else if (null == parentDepartmentId) {
|
||||
checkMsg = "编制维度选择部门时,部门必填!";
|
||||
} else if (null == parentJobId) {
|
||||
checkMsg = "编制维度选择岗位时,岗位必填!";
|
||||
}
|
||||
break;
|
||||
default:
|
||||
checkMsg = "编制方案数据有误,请确认";
|
||||
break;
|
||||
}
|
||||
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()){
|
||||
staffPO.setControlPolicy(1);
|
||||
}
|
||||
MapperProxyFactory.getProxy(StaffMapper.class).insertIgnoreNull(staffPO);
|
||||
|
||||
historyDetailPO.setOperateDetail("添加成功");
|
||||
|
|
|
|||
Loading…
Reference in New Issue