|
|
@ -25,13 +25,17 @@ import com.engine.organization.entity.job.param.JobSearchParam;
|
|
|
|
import com.engine.organization.entity.job.po.JobPO;
|
|
|
|
import com.engine.organization.entity.job.po.JobPO;
|
|
|
|
import com.engine.organization.entity.searchtree.SearchTree;
|
|
|
|
import com.engine.organization.entity.searchtree.SearchTree;
|
|
|
|
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
|
|
|
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
|
|
|
|
|
|
|
import com.engine.organization.enums.LogModuleNameEnum;
|
|
|
|
|
|
|
|
import com.engine.organization.enums.OperateTypeEnum;
|
|
|
|
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
|
|
|
|
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
|
|
|
|
import com.engine.organization.mapper.comp.CompMapper;
|
|
|
|
import com.engine.organization.mapper.comp.CompMapper;
|
|
|
|
import com.engine.organization.mapper.department.DepartmentMapper;
|
|
|
|
import com.engine.organization.mapper.department.DepartmentMapper;
|
|
|
|
import com.engine.organization.mapper.extend.ExtendTitleMapper;
|
|
|
|
import com.engine.organization.mapper.extend.ExtendTitleMapper;
|
|
|
|
|
|
|
|
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
|
|
|
import com.engine.organization.mapper.job.JobMapper;
|
|
|
|
import com.engine.organization.mapper.job.JobMapper;
|
|
|
|
import com.engine.organization.service.ExtService;
|
|
|
|
import com.engine.organization.service.ExtService;
|
|
|
|
import com.engine.organization.service.JobService;
|
|
|
|
import com.engine.organization.service.JobService;
|
|
|
|
|
|
|
|
import com.engine.organization.thread.OrganizationRunable;
|
|
|
|
import com.engine.organization.util.*;
|
|
|
|
import com.engine.organization.util.*;
|
|
|
|
import com.engine.organization.util.coderule.CodeRuleUtil;
|
|
|
|
import com.engine.organization.util.coderule.CodeRuleUtil;
|
|
|
|
import com.engine.organization.util.db.MapperProxyFactory;
|
|
|
|
import com.engine.organization.util.db.MapperProxyFactory;
|
|
|
@ -89,6 +93,8 @@ public class JobServiceImpl extends Service implements JobService {
|
|
|
|
|
|
|
|
|
|
|
|
private static final String RIGHT_NAME = "Job:All";
|
|
|
|
private static final String RIGHT_NAME = "Job:All";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final String JOB_ACTIVITY_ID;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 岗位主表title指定ID
|
|
|
|
* 岗位主表title指定ID
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -115,6 +121,11 @@ public class JobServiceImpl extends Service implements JobService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static {
|
|
|
|
|
|
|
|
JSONObject hrmJobActivity = MapperProxyFactory.getProxy(SystemDataMapper.class).getHrmObjectByUUID("hrmjobactivities", "3a2efce3-95de-4ec2-afe1-347783817bdb");
|
|
|
|
|
|
|
|
JOB_ACTIVITY_ID = hrmJobActivity.getString("ID");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Map<String, Object> getSearchTree(SearchTreeParams params) {
|
|
|
|
public Map<String, Object> getSearchTree(SearchTreeParams params) {
|
|
|
|
String keyword = params.getKeyword();
|
|
|
|
String keyword = params.getKeyword();
|
|
|
@ -301,7 +312,6 @@ public class JobServiceImpl extends Service implements JobService {
|
|
|
|
JobSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), JobSearchParam.class);
|
|
|
|
JobSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), JobSearchParam.class);
|
|
|
|
|
|
|
|
|
|
|
|
params.put("is_key", null == searchParam.getIsKey() ? 0 : searchParam.getIsKey());
|
|
|
|
params.put("is_key", null == searchParam.getIsKey() ? 0 : searchParam.getIsKey());
|
|
|
|
// TODO 处理ec表关联关系
|
|
|
|
|
|
|
|
Long ecDepartment = searchParam.getEcDepartment();
|
|
|
|
Long ecDepartment = searchParam.getEcDepartment();
|
|
|
|
DepartmentPO jclDepartment = EcHrmRelationUtil.getJclDepartmentId(ecDepartment + "");
|
|
|
|
DepartmentPO jclDepartment = EcHrmRelationUtil.getJclDepartmentId(ecDepartment + "");
|
|
|
|
params.put("parent_dept", jclDepartment.getId());
|
|
|
|
params.put("parent_dept", jclDepartment.getId());
|
|
|
@ -314,7 +324,11 @@ public class JobServiceImpl extends Service implements JobService {
|
|
|
|
int maxShowOrder = getJobMapper().getMaxShowOrder();
|
|
|
|
int maxShowOrder = getJobMapper().getMaxShowOrder();
|
|
|
|
params.put("show_order", maxShowOrder + 1);
|
|
|
|
params.put("show_order", maxShowOrder + 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOB, params, "", null);
|
|
|
|
Long jobId = getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOB, params, "", null);
|
|
|
|
|
|
|
|
params.put("jobactivityid", JOB_ACTIVITY_ID);
|
|
|
|
|
|
|
|
params.put("id", jobId);
|
|
|
|
|
|
|
|
new Thread(new OrganizationRunable(user, LogModuleNameEnum.JOB, OperateTypeEnum.ADD, params)).start();
|
|
|
|
|
|
|
|
return jobId;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -326,7 +340,8 @@ public class JobServiceImpl extends Service implements JobService {
|
|
|
|
if ("0".equals(groupId)) {
|
|
|
|
if ("0".equals(groupId)) {
|
|
|
|
groupId = GROUP_ID.toString();
|
|
|
|
groupId = GROUP_ID.toString();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String oldJobNo = getJobMapper().getJobById(searchParam.getId()).getJobNo();
|
|
|
|
JobPO oldJobPO = getJobMapper().getJobById(searchParam.getId());
|
|
|
|
|
|
|
|
String oldJobNo = oldJobPO.getJobNo();
|
|
|
|
String jobNo = searchParam.getJobNo();
|
|
|
|
String jobNo = searchParam.getJobNo();
|
|
|
|
if (!oldJobNo.equals(jobNo)) {
|
|
|
|
if (!oldJobNo.equals(jobNo)) {
|
|
|
|
jobNo = repeatDetermine(jobNo);
|
|
|
|
jobNo = repeatDetermine(jobNo);
|
|
|
@ -335,7 +350,6 @@ public class JobServiceImpl extends Service implements JobService {
|
|
|
|
|
|
|
|
|
|
|
|
// 更新主表数据
|
|
|
|
// 更新主表数据
|
|
|
|
params.put("is_key", searchParam.getIsKey());
|
|
|
|
params.put("is_key", searchParam.getIsKey());
|
|
|
|
// TODO 处理ec表关联关系
|
|
|
|
|
|
|
|
Long ecDepartment = searchParam.getEcDepartment();
|
|
|
|
Long ecDepartment = searchParam.getEcDepartment();
|
|
|
|
DepartmentPO jclDepartment = EcHrmRelationUtil.getJclDepartmentId(ecDepartment + "");
|
|
|
|
DepartmentPO jclDepartment = EcHrmRelationUtil.getJclDepartmentId(ecDepartment + "");
|
|
|
|
params.put("parent_dept", jclDepartment.getId());
|
|
|
|
params.put("parent_dept", jclDepartment.getId());
|
|
|
@ -343,6 +357,8 @@ public class JobServiceImpl extends Service implements JobService {
|
|
|
|
if (null != jclDepartment.getParentComp()) {
|
|
|
|
if (null != jclDepartment.getParentComp()) {
|
|
|
|
params.put("ec_company", EcHrmRelationUtil.getEcCompanyId(jclDepartment.getParentComp() + ""));
|
|
|
|
params.put("ec_company", EcHrmRelationUtil.getEcCompanyId(jclDepartment.getParentComp() + ""));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
params.put("jobactivityid", JOB_ACTIVITY_ID);
|
|
|
|
|
|
|
|
new Thread(new OrganizationRunable(user, LogModuleNameEnum.JOB, OperateTypeEnum.UPDATE, params, oldJobPO)).start();
|
|
|
|
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOB, params, "", searchParam.getId());
|
|
|
|
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOB, params, "", searchParam.getId());
|
|
|
|
// 更新主表拓展表
|
|
|
|
// 更新主表拓展表
|
|
|
|
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOBEXT, params, groupId, searchParam.getId());
|
|
|
|
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOBEXT, params, groupId, searchParam.getId());
|
|
|
@ -374,7 +390,8 @@ public class JobServiceImpl extends Service implements JobService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public int updateForbiddenTagById(JobSearchParam params) {
|
|
|
|
public int updateForbiddenTagById(JobSearchParam params) {
|
|
|
|
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
|
|
|
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
|
|
|
JobPO jobPO = JobPO.builder().id(params.getId()).forbiddenTag(params.getForbiddenTag() ? 0 : 1).build();
|
|
|
|
JobPO jobPO = JobPO.builder().id(params.getId()).forbiddenTag(params.getForbiddenTag() ? 0 : 1).jobName(getJobMapper().getJobById(params.getId()).getJobName()).build();
|
|
|
|
|
|
|
|
new Thread(new OrganizationRunable(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, jobPO)).start();
|
|
|
|
return getJobMapper().updateForbiddenTagById(jobPO.getId(), jobPO.getForbiddenTag());
|
|
|
|
return getJobMapper().updateForbiddenTagById(jobPO.getId(), jobPO.getForbiddenTag());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -382,7 +399,12 @@ public class JobServiceImpl extends Service implements JobService {
|
|
|
|
public int deleteByIds(Collection<Long> ids) {
|
|
|
|
public int deleteByIds(Collection<Long> ids) {
|
|
|
|
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
|
|
|
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
|
|
|
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
|
|
|
|
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
|
|
|
|
return getJobMapper().deleteByIds(ids);
|
|
|
|
List<JobPO> jobsByIds = getJobMapper().getJobsByIds(ids);
|
|
|
|
|
|
|
|
int delete = getJobMapper().deleteByIds(ids);
|
|
|
|
|
|
|
|
for (JobPO jobsById : jobsByIds) {
|
|
|
|
|
|
|
|
new Thread(new OrganizationRunable(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, jobsById)).start();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return delete;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -427,7 +449,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|
|
|
JobPO mergeJob = getJobMapper().getJobById(mergeParam.getId());
|
|
|
|
JobPO mergeJob = getJobMapper().getJobById(mergeParam.getId());
|
|
|
|
mergeJob.setForbiddenTag(1);
|
|
|
|
mergeJob.setForbiddenTag(1);
|
|
|
|
updateCount += getJobMapper().updateBaseJob(mergeJob);
|
|
|
|
updateCount += getJobMapper().updateBaseJob(mergeJob);
|
|
|
|
|
|
|
|
new Thread(new OrganizationRunable(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, mergeJob)).start();
|
|
|
|
//TODO 合并该刚岗位下的人员
|
|
|
|
//TODO 合并该刚岗位下的人员
|
|
|
|
|
|
|
|
|
|
|
|
// 合并后岗位及子岗位禁用
|
|
|
|
// 合并后岗位及子岗位禁用
|
|
|
@ -601,6 +623,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|
|
|
job.setParentJob(parentJob);
|
|
|
|
job.setParentJob(parentJob);
|
|
|
|
job.setForbiddenTag(1);
|
|
|
|
job.setForbiddenTag(1);
|
|
|
|
getJobMapper().updateBaseJob(job);
|
|
|
|
getJobMapper().updateBaseJob(job);
|
|
|
|
|
|
|
|
new Thread(new OrganizationRunable(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, job)).start();
|
|
|
|
List<JobPO> childJobs = getJobMapper().getJobsByPid(job.getId());
|
|
|
|
List<JobPO> childJobs = getJobMapper().getJobsByPid(job.getId());
|
|
|
|
forbiddenChildTag(parentComp, parentDept, job.getId(), childJobs);
|
|
|
|
forbiddenChildTag(parentComp, parentDept, job.getId(), childJobs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|