commit
e59317a823
|
|
@ -4,6 +4,7 @@ package com.engine.organization.mapper.hrmresource;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -35,5 +36,17 @@ public interface SystemDataMapper {
|
|||
|
||||
JSONObject getHrmObjectByUUID(@Param("tableName") String tableName, @Param("uuid") String uuid);
|
||||
|
||||
JSONObject getHrmJobTitleByName(@Param("name") String name);
|
||||
|
||||
List<Long> getHrmResourceIds(@Param("departmentId") Long departmentId, @Param("jobTitle") String jobTitle);
|
||||
|
||||
/**
|
||||
* 更新人员岗位
|
||||
*
|
||||
* @param jobTitle
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
int updateResourceJobTitleByIds(@Param("jobTitle") String jobTitle, @Param("ids") Collection<Long> ids);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.organization.mapper.hrmresource.SystemDataMapper">
|
||||
<update id="updateResourceJobTitleByIds">
|
||||
update hrmresource set JOBTITLE = #{jobTitle} where id in
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="getSysLanguageByLicense" resultType="com.alibaba.fastjson.JSONObject">
|
||||
select multilanguage, (select id from syslanguage where language='简体中文' or language='中文') as cnLanguageId
|
||||
|
|
@ -58,5 +64,17 @@
|
|||
from ${tableName}
|
||||
where uuid = #{uuid}
|
||||
</select>
|
||||
<select id="getHrmJobTitleByName" resultType="com.alibaba.fastjson.JSONObject">
|
||||
select *
|
||||
from hrmjobtitles
|
||||
where jobtitlename = #{name}
|
||||
</select>
|
||||
<select id="getHrmResourceIds" resultType="java.lang.Long">
|
||||
select id
|
||||
from hrmresource
|
||||
where departmentid = #{departmentId}
|
||||
And jobTitle = #{jobTitle}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -79,6 +79,15 @@ public interface JobMapper {
|
|||
*/
|
||||
List<JobPO> listByNo(@Param("jobNo") String jobNo);
|
||||
|
||||
/**
|
||||
* 查询是否存在同名岗位
|
||||
*
|
||||
* @param jobName
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<JobPO> listByNameExceptId(@Param("jobName") String jobName, @Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 根据所属部门查询数据
|
||||
*
|
||||
|
|
|
|||
|
|
@ -355,6 +355,14 @@
|
|||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="listByNameExceptId" resultType="com.engine.organization.entity.job.po.JobPO">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_job t
|
||||
where delete_type = 0
|
||||
AND job_name = #{jobName}
|
||||
AND id != #{id}
|
||||
</select>
|
||||
|
||||
<sql id="nullparentJob">
|
||||
and ifnull(parent_job,0) =
|
||||
|
|
|
|||
|
|
@ -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.searchtree.SearchTree;
|
||||
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.comp.CompMapper;
|
||||
import com.engine.organization.mapper.department.DepartmentMapper;
|
||||
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.service.ExtService;
|
||||
import com.engine.organization.service.JobService;
|
||||
import com.engine.organization.thread.OrganizationRunable;
|
||||
import com.engine.organization.util.*;
|
||||
import com.engine.organization.util.coderule.CodeRuleUtil;
|
||||
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 JOB_ACTIVITY_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
|
||||
public Map<String, Object> getSearchTree(SearchTreeParams params) {
|
||||
String keyword = params.getKeyword();
|
||||
|
|
@ -301,7 +312,6 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
JobSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), JobSearchParam.class);
|
||||
|
||||
params.put("is_key", null == searchParam.getIsKey() ? 0 : searchParam.getIsKey());
|
||||
// TODO 处理ec表关联关系
|
||||
Long ecDepartment = searchParam.getEcDepartment();
|
||||
DepartmentPO jclDepartment = EcHrmRelationUtil.getJclDepartmentId(ecDepartment + "");
|
||||
params.put("parent_dept", jclDepartment.getId());
|
||||
|
|
@ -314,7 +324,11 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
int maxShowOrder = getJobMapper().getMaxShowOrder();
|
||||
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
|
||||
|
|
@ -326,7 +340,8 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
if ("0".equals(groupId)) {
|
||||
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();
|
||||
if (!oldJobNo.equals(jobNo)) {
|
||||
jobNo = repeatDetermine(jobNo);
|
||||
|
|
@ -335,7 +350,6 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
|
||||
// 更新主表数据
|
||||
params.put("is_key", searchParam.getIsKey());
|
||||
// TODO 处理ec表关联关系
|
||||
Long ecDepartment = searchParam.getEcDepartment();
|
||||
DepartmentPO jclDepartment = EcHrmRelationUtil.getJclDepartmentId(ecDepartment + "");
|
||||
params.put("parent_dept", jclDepartment.getId());
|
||||
|
|
@ -343,6 +357,8 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
if (null != 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_JOBEXT, params, groupId, searchParam.getId());
|
||||
|
|
@ -374,7 +390,8 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
@Override
|
||||
public int updateForbiddenTagById(JobSearchParam params) {
|
||||
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());
|
||||
}
|
||||
|
||||
|
|
@ -382,7 +399,12 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
public int deleteByIds(Collection<Long> ids) {
|
||||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
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
|
||||
|
|
@ -427,7 +449,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
JobPO mergeJob = getJobMapper().getJobById(mergeParam.getId());
|
||||
mergeJob.setForbiddenTag(1);
|
||||
updateCount += getJobMapper().updateBaseJob(mergeJob);
|
||||
|
||||
new Thread(new OrganizationRunable(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, mergeJob)).start();
|
||||
//TODO 合并该刚岗位下的人员
|
||||
|
||||
// 合并后岗位及子岗位禁用
|
||||
|
|
@ -601,6 +623,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
job.setParentJob(parentJob);
|
||||
job.setForbiddenTag(1);
|
||||
getJobMapper().updateBaseJob(job);
|
||||
new Thread(new OrganizationRunable(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, job)).start();
|
||||
List<JobPO> childJobs = getJobMapper().getJobsByPid(job.getId());
|
||||
forbiddenChildTag(parentComp, parentDept, job.getId(), childJobs);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,14 +2,18 @@ package com.engine.organization.thread;
|
|||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.hrm.service.impl.HrmJobServiceImpl;
|
||||
import com.engine.hrm.service.impl.OrganizationServiceImpl;
|
||||
import com.engine.organization.entity.extend.param.ExtendInfoParams;
|
||||
import com.engine.organization.entity.job.po.JobPO;
|
||||
import com.engine.organization.enums.LogModuleNameEnum;
|
||||
import com.engine.organization.enums.OperateTypeEnum;
|
||||
import com.engine.organization.mapper.extend.ExtMapper;
|
||||
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import com.engine.organization.util.relation.EcHrmRelationUtil;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
|
@ -18,6 +22,7 @@ import java.util.ArrayList;
|
|||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
|
|
@ -29,6 +34,7 @@ public class OrganizationRunable implements Runnable {
|
|||
private OperateTypeEnum operateType;
|
||||
private Map<String, Object> params;
|
||||
private User user;
|
||||
private JobPO oldJobPO;
|
||||
|
||||
private static final String HRM_COMPANY = "hrmsubcompany";
|
||||
private static final String HRM_DEPARTMENT = "hrmdepartment";
|
||||
|
|
@ -51,6 +57,15 @@ public class OrganizationRunable implements Runnable {
|
|||
this.user = user;
|
||||
}
|
||||
|
||||
public OrganizationRunable(User user, LogModuleNameEnum moduleName, OperateTypeEnum operateType, Map<String, Object> params, JobPO oldJobPO) {
|
||||
this.moduleName = moduleName;
|
||||
this.operateType = operateType;
|
||||
this.params = params;
|
||||
this.user = user;
|
||||
this.oldJobPO = oldJobPO;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
switch (moduleName) {
|
||||
|
|
@ -109,16 +124,157 @@ public class OrganizationRunable implements Runnable {
|
|||
private void refreshJob() {
|
||||
switch (operateType) {
|
||||
case ADD:
|
||||
addJob();
|
||||
break;
|
||||
case UPDATE:
|
||||
updateJob();
|
||||
break;
|
||||
case DELETE:
|
||||
case CANCELED:
|
||||
cancelJob();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增岗位
|
||||
*
|
||||
* <p>
|
||||
* 1、EC表HrmJobTitles
|
||||
* <p>
|
||||
* 2、系统中新建“聚才林”、“默认职务”(sql写入)
|
||||
* <p>
|
||||
* 3、检索岗位名称jobtitlename,如果已存在,判断是否封存,对已封存数据解封操作
|
||||
* <p>
|
||||
* 4、如果不存在,在“聚才林--默认职务”下新建岗位
|
||||
*/
|
||||
private void addJob() {
|
||||
// 判断是否存在同名岗位、存在不做处理,不存在,在“默认职务分类--默认职务”下新建岗位
|
||||
String jobName = Util.null2String(params.get("job_name"));
|
||||
JSONObject hrmJobActivity = getSystemDataMapper().getHrmJobTitleByName(jobName);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
//存在且已封存,对岗位解封
|
||||
if (null != hrmJobActivity && "1".equals(hrmJobActivity.getString("canceled"))) {
|
||||
map.put("ids", hrmJobActivity.getString("id"));
|
||||
map.put("canceled", "docanceled");
|
||||
ServiceUtil.getService(HrmJobServiceImpl.class, user).doCanceled(map, user);
|
||||
} else {
|
||||
// 不存在则新建职务
|
||||
map.put("operateIp", Util.null2String(user.getLoginip()));
|
||||
map.put("jobtitlemark", jobName);
|
||||
map.put("jobtitlename", jobName);
|
||||
map.put("jobactivityid", Util.null2String(params.get("jobactivityid")));
|
||||
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")));
|
||||
|
||||
ServiceUtil.getService(HrmJobServiceImpl.class, user).addJobTitle(map, user);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新岗位
|
||||
*/
|
||||
private void updateJob() {
|
||||
Long jclJobId = oldJobPO.getId();
|
||||
String oldName = oldJobPO.getJobName();
|
||||
|
||||
String newName = Util.null2String(params.get("job_name"));
|
||||
JSONObject oldHrmJobTitle = getSystemDataMapper().getHrmJobTitleByName(oldName);
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
// 修改前不存在共用
|
||||
if (EcHrmRelationUtil.isNotExistJob(oldName, jclJobId)) {
|
||||
// 修改后不存在共用、直接修改EC岗位表数据
|
||||
if (EcHrmRelationUtil.isNotExistJob(newName, jclJobId)) {
|
||||
// 查询ec表ID
|
||||
JSONObject hrmJobTitle = getSystemDataMapper().getHrmJobTitleByName(oldName);
|
||||
map.put("id", Util.null2String(hrmJobTitle.get("id")));
|
||||
map.put("operateIp", Util.null2String(user.getLoginip()));
|
||||
map.put("jobtitlemark", newName);
|
||||
map.put("jobtitlename", newName);
|
||||
map.put("jobactivityid", Util.null2String(params.get("jobactivityid")));
|
||||
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")));
|
||||
// 修改岗位表数据
|
||||
ServiceUtil.getService(HrmJobServiceImpl.class, user).editJobTitle(map, user);
|
||||
} else {
|
||||
// 修改后存在共用、不修改岗位表数据,更新对应人员的岗位信息为当前岗位的ID
|
||||
JSONObject hrmJobTitle = getSystemDataMapper().getHrmJobTitleByName(newName);
|
||||
// 查询原分部、原岗位下的人员,并更新岗位ID
|
||||
List<Long> hrmResourceIds = getSystemDataMapper().getHrmResourceIds(oldJobPO.getParentDept(), oldHrmJobTitle.getString("id"));
|
||||
getSystemDataMapper().updateResourceJobTitleByIds(Util.null2String(hrmJobTitle.get("id")), hrmResourceIds);
|
||||
// 封存原名称岗位
|
||||
map.clear();
|
||||
map.put("ids", oldHrmJobTitle.getString("id"));
|
||||
map.put("canceled", "canceled");
|
||||
ServiceUtil.getService(HrmJobServiceImpl.class, user).doCanceled(map, user);
|
||||
}
|
||||
} else {
|
||||
// 修改前存在共用,不对原有数据进行操作。
|
||||
|
||||
// 修改后不存在共用、新建岗位,更新原有岗位下人员的岗位ID
|
||||
if (EcHrmRelationUtil.isNotExistJob(newName, jclJobId)) {
|
||||
// 不存在则新建职务
|
||||
map.put("operateIp", Util.null2String(user.getLoginip()));
|
||||
map.put("jobtitlemark", newName);
|
||||
map.put("jobtitlename", newName);
|
||||
map.put("jobactivityid", Util.null2String(params.get("jobactivityid")));
|
||||
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")));
|
||||
ServiceUtil.getService(HrmJobServiceImpl.class, user).addJobTitle(map, user);
|
||||
// 新建岗位
|
||||
JSONObject hrmJobTitle = getSystemDataMapper().getHrmJobTitleByName(newName);
|
||||
// 查询原分部、原岗位下的人员,并更新岗位ID
|
||||
List<Long> hrmResourceIds = getSystemDataMapper().getHrmResourceIds(oldJobPO.getParentDept(), oldHrmJobTitle.getString("id"));
|
||||
getSystemDataMapper().updateResourceJobTitleByIds(Util.null2String(hrmJobTitle.get("id")), hrmResourceIds);
|
||||
} else {
|
||||
// 修改后存在共用,更新原有岗位下人员的岗位ID
|
||||
JSONObject hrmJobTitle = getSystemDataMapper().getHrmJobTitleByName(newName);
|
||||
// 查询原分部、原岗位下的人员,并更新岗位ID
|
||||
List<Long> hrmResourceIds = getSystemDataMapper().getHrmResourceIds(oldJobPO.getParentDept(), oldHrmJobTitle.getString("id"));
|
||||
getSystemDataMapper().updateResourceJobTitleByIds(Util.null2String(hrmJobTitle.get("id")), hrmResourceIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 封存、解封岗位
|
||||
*/
|
||||
private void cancelJob() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
JSONObject hrmJobTitleByName = getSystemDataMapper().getHrmJobTitleByName(oldJobPO.getJobName());
|
||||
if (0 == oldJobPO.getForbiddenTag()) {
|
||||
// 启用
|
||||
map.put("ids", hrmJobTitleByName.getString("id"));
|
||||
map.put("canceled", "docanceled");
|
||||
ServiceUtil.getService(HrmJobServiceImpl.class, user).doCanceled(map, user);
|
||||
} else {
|
||||
// 禁用
|
||||
List<JobPO> jobPOS = MapperProxyFactory.getProxy(JobMapper.class).listByNameExceptId(oldJobPO.getJobName(), oldJobPO.getId());
|
||||
// 不存在共用
|
||||
if (CollectionUtils.isEmpty(jobPOS)) {
|
||||
map.put("ids", hrmJobTitleByName.getString("id"));
|
||||
map.put("canceled", "canceled");
|
||||
ServiceUtil.getService(HrmJobServiceImpl.class, user).doCanceled(map, user);
|
||||
} else {
|
||||
List<JobPO> collect = jobPOS.stream().filter(item -> 0 == item.getForbiddenTag()).collect(Collectors.toList());
|
||||
// 不存在非禁用
|
||||
if (CollectionUtils.isEmpty(collect)) {
|
||||
map.put("ids", hrmJobTitleByName.getString("id"));
|
||||
map.put("canceled", "canceled");
|
||||
ServiceUtil.getService(HrmJobServiceImpl.class, user).doCanceled(map, user);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增部门
|
||||
*/
|
||||
|
|
@ -278,8 +434,8 @@ public class OrganizationRunable implements Runnable {
|
|||
String uuid = hrmDepartment.getString("uuid");
|
||||
Map<String, Object> departmentMap = new HashMap<>();
|
||||
departmentMap.put("uuid", uuid);
|
||||
long departmentId = Long.parseLong(Util.null2String(params.get("id")));
|
||||
ExtendInfoParams infoParams = ExtendInfoParams.builder().tableName(jclTableName).params(departmentMap).id(departmentId).build();
|
||||
long jclTableId = Long.parseLong(Util.null2String(params.get("id")));
|
||||
ExtendInfoParams infoParams = ExtendInfoParams.builder().tableName(jclTableName).params(departmentMap).id(jclTableId).build();
|
||||
getExtMapper().updateExt(infoParams);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,12 +3,17 @@ package com.engine.organization.util.relation;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.organization.entity.company.po.CompPO;
|
||||
import com.engine.organization.entity.department.po.DepartmentPO;
|
||||
import com.engine.organization.entity.job.po.JobPO;
|
||||
import com.engine.organization.mapper.comp.CompMapper;
|
||||
import com.engine.organization.mapper.department.DepartmentMapper;
|
||||
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/07/13
|
||||
|
|
@ -32,6 +37,10 @@ public class EcHrmRelationUtil {
|
|||
return MapperProxyFactory.getProxy(DepartmentMapper.class);
|
||||
}
|
||||
|
||||
private static JobMapper getJobMapper() {
|
||||
return MapperProxyFactory.getProxy(JobMapper.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据jcl_org_comp.id获取HrmSubCompany.id
|
||||
*
|
||||
|
|
@ -81,4 +90,30 @@ public class EcHrmRelationUtil {
|
|||
return getDepartmentMapper().getDepartmentByUUID(uuid);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断岗位名称是否共用
|
||||
* <p>存在返回true</p>
|
||||
*
|
||||
* @param jobName
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public static boolean isExistJob(String jobName, Long id) {
|
||||
List<JobPO> jobPOS = getJobMapper().listByNameExceptId(jobName, id);
|
||||
return CollectionUtils.isNotEmpty(jobPOS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断岗位名称是否共用
|
||||
* <p>不存在返回true</p>
|
||||
*
|
||||
* @param jobName
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public static boolean isNotExistJob(String jobName, Long id) {
|
||||
return !isExistJob(jobName, id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue