岗位关联关系调整
This commit is contained in:
parent
b368c3ea27
commit
3470ba04cd
|
|
@ -21,11 +21,11 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@OrganizationTable(pageId = "80e7830c-18e8-4e14-8241-18821195ef31",
|
||||
fields = "t.id," +
|
||||
"t.last_name," +
|
||||
"t.lastname," +
|
||||
"t.mobile," +
|
||||
"t.company_start_date," +
|
||||
"t.companystartdate," +
|
||||
"t.sex",
|
||||
fromSql = "FROM jcl_org_hrmresource t ",
|
||||
fromSql = "FROM hrmresource t ",
|
||||
orderby = "id",
|
||||
primarykey = "id",
|
||||
tableType = WeaTableType.NONE
|
||||
|
|
@ -35,7 +35,7 @@ public class EmployeeTableVO {
|
|||
@OrganizationTableColumn(column = "id", display = false)
|
||||
private Long id;
|
||||
|
||||
@OrganizationTableColumn(text = "姓名", width = "25%", column = "last_name")
|
||||
@OrganizationTableColumn(text = "姓名", width = "25%", column = "lastname")
|
||||
private String lastname;
|
||||
|
||||
@OrganizationTableColumn(text = "性别", width = "25%", column = "sex",transmethod = "com.engine.organization.transmethod.JobTransMethod.getSexName")
|
||||
|
|
@ -44,7 +44,7 @@ public class EmployeeTableVO {
|
|||
@OrganizationTableColumn(text = "手机", width = "25%", column = "mobile")
|
||||
private String mobile;
|
||||
|
||||
@OrganizationTableColumn(text = "入职日期", width = "25%", column = "company_start_date")
|
||||
@OrganizationTableColumn(text = "入职日期", width = "25%", column = "companystartdate")
|
||||
private String companystartdate;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,11 +5,9 @@ import com.engine.organization.entity.job.param.JobSearchParam;
|
|||
import com.engine.organization.entity.job.po.JobPO;
|
||||
import com.engine.organization.entity.job.vo.SingleJobTreeVO;
|
||||
import com.engine.organization.entity.searchtree.SearchTree;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.transmethod.JobTransMethod;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.job.JobTitlesComInfo;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
@ -30,11 +28,10 @@ public class JobBO {
|
|||
.builder()
|
||||
.id(param.getId() == null ? 0 : param.getId())
|
||||
.jobNo(param.getJobNo())
|
||||
.jobName(param.getJobName())
|
||||
.jobTitleName(param.getJobTitleName())
|
||||
.ecJobTitle(param.getEcJobTitle())
|
||||
.ecCompany(param.getEcCompany())
|
||||
.ecDepartment(param.getEcDepartment())
|
||||
.parentComp(param.getSubcompanyid1())
|
||||
.parentDept(param.getDepartmentid())
|
||||
.sequenceId(param.getSequenceId())
|
||||
.schemeId(param.getSchemeId())
|
||||
.parentJob(param.getParentJob())
|
||||
|
|
@ -64,10 +61,10 @@ public class JobBO {
|
|||
.builder()
|
||||
.id(e.getId())
|
||||
.jobNo(e.getJobNo())
|
||||
.jobName(e.getJobName())
|
||||
.parentJobName(null == poMaps.get(e.getParentJob()) ? "" : poMaps.get(e.getParentJob()).getJobName())
|
||||
.jobName(e.getJobTitleName())
|
||||
.parentJobName(null == poMaps.get(e.getParentJob()) ? "" : poMaps.get(e.getParentJob()).getJobTitleName())
|
||||
.parentJob(e.getParentJob())
|
||||
.parentDept(e.getParentDept())
|
||||
.parentDept(e.getEcDepartment())
|
||||
.build()).collect(Collectors.toList());
|
||||
//获取非一级部门
|
||||
Map<Long, List<SingleJobTreeVO>> collects = singleJobTreeVOS.stream().filter(item -> null != item.getParentJob()).collect(Collectors.groupingBy(SingleJobTreeVO::getParentJob));
|
||||
|
|
@ -82,31 +79,23 @@ public class JobBO {
|
|||
JobListDTO.builder()
|
||||
.id(e.getId())
|
||||
.jobNo(e.getJobNo())
|
||||
.jobName(e.getJobName())
|
||||
.jobTitleName(e.getJobTitleName())
|
||||
.subCompanyName(e.getSubCompanyName())
|
||||
.departmentName(e.getDepartmentName())
|
||||
.sequenceName(e.getSequenceName())
|
||||
.schemeName(e.getSchemeName())
|
||||
//.sequenceName(e.getSequenceName())
|
||||
//.schemeName(e.getSchemeName())
|
||||
//.parentJob(e.getParentJob())
|
||||
//.parentJobName(null == poMaps.get(e.getParentJob()) ? "" : poMaps.get(e.getParentJob()).getJobName())
|
||||
.isKey(JobTransMethod.getIsKeySpan(e.getIsKey()))
|
||||
.showOrder(e.getShowOrder())
|
||||
.forbiddenTag(e.getForbiddenTag())
|
||||
//.forbiddenTag(e.getForbiddenTag())
|
||||
.isUsed(0)
|
||||
.build()).collect(Collectors.toList());
|
||||
Map<Long, List<JobListDTO>> collects = dtoList.stream().filter(item -> null != item.getParentJob() && 0 != item.getParentJob()).collect(Collectors.groupingBy(JobListDTO::getParentJob));
|
||||
// 处理被引用数据
|
||||
List<String> usedIds = MapperProxyFactory.getProxy(JobMapper.class).listUsedId();
|
||||
return dtoList.stream().peek(e -> {
|
||||
List<JobListDTO> childList = collects.get(e.getId());
|
||||
if (CollectionUtils.isNotEmpty(childList)) {
|
||||
e.setChildren(childList);
|
||||
e.setIsUsed(1);
|
||||
} else {
|
||||
if (usedIds.contains(Util.null2String(e.getId()))) {
|
||||
e.setIsUsed(1);
|
||||
} else {
|
||||
e.setIsUsed(0);
|
||||
}
|
||||
}
|
||||
}).filter(item -> null == item.getParentJob() || 0 == item.getParentJob()).collect(Collectors.toList());
|
||||
}
|
||||
|
|
@ -154,14 +143,18 @@ public class JobBO {
|
|||
tree.setId(item.getId().toString());
|
||||
tree.setIsParent(false);
|
||||
tree.setIsVirtual("0");
|
||||
tree.setName(item.getJobName());
|
||||
tree.setName(item.getJobTitleName());
|
||||
tree.setPid(null == item.getParentJob() ? "0" : item.getParentJob().toString());
|
||||
tree.setSelected(false);
|
||||
tree.setType("3");
|
||||
tree.setParentComp(null == item.getParentDept() ? "0" : item.getParentDept().toString());
|
||||
tree.setParentComp(null == item.getEcDepartment() ? "0" : item.getEcDepartment().toString());
|
||||
tree.setOrderNum(null == item.getShowOrder() ? 0 : item.getShowOrder());
|
||||
return tree;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
}
|
||||
|
||||
public static String getJobTitleNameByEcJobTitle(String ecJobTitle) {
|
||||
return new JobTitlesComInfo().getJobTitlesname(ecJobTitle);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ public class JobListDTO {
|
|||
/**
|
||||
* 名称
|
||||
*/
|
||||
@TableTitle(title = "名称", dataIndex = "jobName", key = "jobName", width = "150")
|
||||
private String jobName;
|
||||
@TableTitle(title = "名称", dataIndex = "jobTitleName", key = "jobTitleName", width = "150")
|
||||
private String jobTitleName;
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
|
|
@ -54,13 +54,13 @@ public class JobListDTO {
|
|||
/**
|
||||
* 岗位序列
|
||||
*/
|
||||
@TableTitle(title = "岗位序列", dataIndex = "sequenceName", key = "sequenceName")
|
||||
private String sequenceName;
|
||||
//@TableTitle(title = "岗位序列", dataIndex = "sequenceName", key = "sequenceName")
|
||||
//private String sequenceName;
|
||||
/**
|
||||
* 等级方案
|
||||
*/
|
||||
@TableTitle(title = "等级方案", dataIndex = "schemeName", key = "schemeName")
|
||||
private String schemeName;
|
||||
//@TableTitle(title = "等级方案", dataIndex = "schemeName", key = "schemeName")
|
||||
//private String schemeName;
|
||||
/**
|
||||
* 上级岗位
|
||||
*/
|
||||
|
|
@ -84,8 +84,8 @@ public class JobListDTO {
|
|||
/**
|
||||
* 禁用标记
|
||||
*/
|
||||
@TableTitle(title = "是否启用", dataIndex = "forbiddenTag", key = "forbiddenTag")
|
||||
private Integer forbiddenTag;
|
||||
//@TableTitle(title = "是否启用", dataIndex = "forbiddenTag", key = "forbiddenTag")
|
||||
//private Integer forbiddenTag;
|
||||
|
||||
/**
|
||||
* 操作列
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class JobSearchParam extends BaseQueryParam {
|
|||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String jobName;
|
||||
private String jobTitleName;
|
||||
/**
|
||||
* ec分部
|
||||
*/
|
||||
|
|
@ -82,4 +82,6 @@ public class JobSearchParam extends BaseQueryParam {
|
|||
private Integer subcompanyid1;
|
||||
|
||||
private Integer departmentid;
|
||||
|
||||
private Integer ecJobTitle;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,20 +29,20 @@ public class JobPO {
|
|||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String jobName;
|
||||
/**
|
||||
* 所属分部
|
||||
*/
|
||||
private Integer parentComp;
|
||||
private String jobTitleName;
|
||||
///**
|
||||
// * 所属分部
|
||||
// */
|
||||
//private Integer parentComp;
|
||||
|
||||
/**
|
||||
* ec分部
|
||||
*/
|
||||
private Integer ecCompany;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
private Integer parentDept;
|
||||
///**
|
||||
// * 所属部门
|
||||
// */
|
||||
//private Integer parentDept;
|
||||
/**
|
||||
* ec部门
|
||||
*/
|
||||
|
|
@ -93,6 +93,8 @@ public class JobPO {
|
|||
|
||||
private String levelId;
|
||||
|
||||
private Integer ecJobTitle;
|
||||
|
||||
|
||||
private Long creator;
|
||||
private int deleteType;
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@
|
|||
<if test=" CompanyPO.supSubComId != null ">
|
||||
and t.supSubComId = #{CompanyPO.supSubComId}
|
||||
</if>
|
||||
<include refid="isCanceled"/>
|
||||
order by ${orderSql}
|
||||
</select>
|
||||
|
||||
|
|
@ -213,4 +214,17 @@
|
|||
and isnull(canceled,0)=0
|
||||
</sql>
|
||||
|
||||
<sql id="isCanceled">
|
||||
and ifnull(canceled,0)=
|
||||
#{CompanyPO.canceled}
|
||||
</sql>
|
||||
<sql id="isCanceled" databaseId="oracle">
|
||||
and nvl(canceled,0)=
|
||||
#{CompanyPO.canceled}
|
||||
</sql>
|
||||
<sql id="isCanceled" databaseId="sqlserver">
|
||||
and isnull(canceled,0)=
|
||||
#{CompanyPO.canceled}
|
||||
</sql>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -62,6 +62,7 @@
|
|||
<if test=" departmentPO.departmentId != null ">
|
||||
and t.id = #{departmentPO.departmentId}
|
||||
</if>
|
||||
<include refid="isCanceled"/>
|
||||
order by ${orderSql}
|
||||
</select>
|
||||
|
||||
|
|
@ -180,4 +181,17 @@
|
|||
</if>
|
||||
</sql>
|
||||
|
||||
<sql id="isCanceled">
|
||||
and ifnull(canceled,0)=
|
||||
#{departmentPO.canceled}
|
||||
</sql>
|
||||
<sql id="isCanceled" databaseId="oracle">
|
||||
and nvl(canceled,0)=
|
||||
#{departmentPO.canceled}
|
||||
</sql>
|
||||
<sql id="isCanceled" databaseId="sqlserver">
|
||||
and isnull(canceled,0)=
|
||||
#{departmentPO.canceled}
|
||||
</sql>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -79,24 +79,6 @@ 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);
|
||||
|
||||
/**
|
||||
* 统计同一层级下是否有重名岗位
|
||||
* @param jobName
|
||||
* @param id
|
||||
* @param parentJob
|
||||
* @param ecDepartment
|
||||
* @return
|
||||
*/
|
||||
Integer countRepeatNameByPid(@Param("jobName") String jobName, @Param("id") Long id, @Param("parentJob") Long parentJob, @Param("ecDepartment") Integer ecDepartment);
|
||||
|
||||
/**
|
||||
* 根据所属部门查询数据
|
||||
|
|
@ -139,14 +121,6 @@ public interface JobMapper {
|
|||
*/
|
||||
int deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 查询所有被引用的ID
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<String> listUsedId();
|
||||
|
||||
|
||||
/**
|
||||
* 获取最大排序
|
||||
*
|
||||
|
|
@ -165,18 +139,4 @@ public interface JobMapper {
|
|||
*/
|
||||
Long getIdByNameAndPid(@Param("jobName") String jobName, @Param("parentCompany") Integer parentCompany, @Param("parentDepartment") Integer parentDepartment, @Param("parentJob") Long parentJob);
|
||||
|
||||
Long getIdByNameAndEcId(@Param("jobName") String jobName, @Param("ecCompany") String ecCompany, @Param("ecDepartment") String ecDepartment);
|
||||
|
||||
int checkRepeatNo(@Param("jobNo") String jobNo, @Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 批量更新岗位的所属分部
|
||||
*
|
||||
* @param ids
|
||||
* @param parentCompany
|
||||
* @return
|
||||
*/
|
||||
int updateJobCompany(@Param("ids") Collection<Long> ids, @Param("parentCompany") Integer parentCompany, @Param("ecCompany") Integer ecCompany);
|
||||
|
||||
int isHasResource(@Param("jobId") Long jobId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,8 @@
|
|||
<resultMap id="BaseResultMap" type="com.engine.organization.entity.job.po.JobPO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="job_no" property="jobNo"/>
|
||||
<result column="job_name" property="jobName"/>
|
||||
<result column="parent_comp" property="parentComp"/>
|
||||
<result column="parent_dept" property="parentDept"/>
|
||||
<result column="jobtitlename" property="jobTitleName"/>
|
||||
<result column="ecJobTitle" property="ecJobTitle"/>
|
||||
<result column="ec_company" property="ecCompany"/>
|
||||
<result column="ec_department" property="ecDepartment"/>
|
||||
<result column="sequence_id" property="sequenceId"/>
|
||||
|
|
@ -34,9 +33,8 @@
|
|||
id
|
||||
,
|
||||
t.job_no,
|
||||
t.job_name,
|
||||
t.parent_comp,
|
||||
t.parent_dept,
|
||||
h.jobtitlename,
|
||||
t.ec_jobTitle,
|
||||
t.ec_company,
|
||||
t.ec_department,
|
||||
t.sequence_id,
|
||||
|
|
@ -73,15 +71,6 @@
|
|||
<if test="jobNo != null ">
|
||||
job_no,
|
||||
</if>
|
||||
<if test="jobName != null ">
|
||||
job_name,
|
||||
</if>
|
||||
<if test="parentComp != null ">
|
||||
parent_comp,
|
||||
</if>
|
||||
<if test="parentDept != null ">
|
||||
parent_dept,
|
||||
</if>
|
||||
<if test="sequenceId != null ">
|
||||
sequence_id,
|
||||
</if>
|
||||
|
|
@ -133,16 +122,6 @@
|
|||
<if test="jobNo != null ">
|
||||
#{jobNo},
|
||||
</if>
|
||||
<if test="jobName != null ">
|
||||
#{jobName},
|
||||
</if>
|
||||
|
||||
<if test="parentComp != null ">
|
||||
#{parentComp},
|
||||
</if>
|
||||
<if test="parentDept != null ">
|
||||
#{parentDept},
|
||||
</if>
|
||||
<if test="sequenceId != null ">
|
||||
#{sequenceId},
|
||||
</if>
|
||||
|
|
@ -202,15 +181,6 @@
|
|||
<if test="jobNo != null ">
|
||||
job_no,
|
||||
</if>
|
||||
<if test="jobName != null ">
|
||||
job_name,
|
||||
</if>
|
||||
<if test="parentComp != null ">
|
||||
parent_comp,
|
||||
</if>
|
||||
<if test="parentDept != null ">
|
||||
parent_dept,
|
||||
</if>
|
||||
<if test="sequenceId != null ">
|
||||
sequence_id,
|
||||
</if>
|
||||
|
|
@ -262,16 +232,6 @@
|
|||
<if test="jobNo != null ">
|
||||
#{jobNo},
|
||||
</if>
|
||||
<if test="jobName != null ">
|
||||
#{jobName},
|
||||
</if>
|
||||
|
||||
<if test="parentComp != null ">
|
||||
#{parentComp},
|
||||
</if>
|
||||
<if test="parentDept != null ">
|
||||
#{parentDept},
|
||||
</if>
|
||||
<if test="sequenceId != null ">
|
||||
#{sequenceId},
|
||||
</if>
|
||||
|
|
@ -314,9 +274,6 @@
|
|||
<set>
|
||||
creator=#{creator},
|
||||
update_time=#{updateTime},
|
||||
job_name=#{jobName},
|
||||
parent_comp=#{parentComp},
|
||||
parent_dept=#{parentDept},
|
||||
ec_company=#{ecCompany},
|
||||
ec_department=#{ecDepartment},
|
||||
sequence_id=#{sequenceId},
|
||||
|
|
@ -351,18 +308,7 @@
|
|||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
<update id="updateJobCompany">
|
||||
update jcl_org_job
|
||||
<set>
|
||||
parent_comp = #{parentCompany},
|
||||
ec_company =#{ecCompany},
|
||||
</set>
|
||||
where delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
<select id="listByFilter" resultType="com.engine.organization.entity.job.dto.JobListDTO"
|
||||
parameterType="com.engine.organization.entity.job.po.JobPO">
|
||||
|
|
@ -373,6 +319,8 @@
|
|||
d.scheme_name,
|
||||
<include refid="baseColumns"/>
|
||||
FROM jcl_org_job t
|
||||
left join hrmjobtitles h on
|
||||
t.ec_jobTitle = h.id
|
||||
left join hrmsubcompany a on
|
||||
t.ec_company = a.id
|
||||
left join hrmdepartment b on
|
||||
|
|
@ -383,12 +331,6 @@
|
|||
t.scheme_id = d.id
|
||||
WHERE t.delete_type = 0
|
||||
<include refid="likeSQL"/>
|
||||
<if test=" jobPO.parentComp != null ">
|
||||
and t.parent_comp = #{jobPO.parentComp}
|
||||
</if>
|
||||
<if test=" jobPO.parentDept != null ">
|
||||
and t.parent_dept = #{jobPO.parentDept}
|
||||
</if>
|
||||
<if test=" jobPO.parentJob != null ">
|
||||
and t.parent_job = #{jobPO.parentJob}
|
||||
</if>
|
||||
|
|
@ -429,6 +371,7 @@
|
|||
t.sequence_id = c.id
|
||||
left join jcl_org_scheme d on
|
||||
t.scheme_id = d.id
|
||||
left join hrmjobtitles h on t.ec_jobTitle = h.id
|
||||
WHERE t.delete_type = 0 order by ${orderSql}
|
||||
</select>
|
||||
|
||||
|
|
@ -436,16 +379,18 @@
|
|||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_job t
|
||||
where delete_type = 0
|
||||
and id = #{id}
|
||||
left join hrmjobtitles h on t.ec_jobTitle = h.id
|
||||
where t.delete_type = 0
|
||||
and t.id = #{id}
|
||||
</select>
|
||||
<select id="listJobsByIds" resultType="java.util.Map">
|
||||
select
|
||||
id as "id",
|
||||
job_name as "name"
|
||||
t.id as "id",
|
||||
h.jobtitlename as "name"
|
||||
from jcl_org_job t
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
left join hrmjobtitles h on t.ec_jobTitle = h.id
|
||||
WHERE t.delete_type = 0
|
||||
AND t.id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
|
@ -453,50 +398,41 @@
|
|||
<select id="listByNo" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_job t where job_no = #{jobNo} AND delete_type = 0
|
||||
from jcl_org_job t
|
||||
left join hrmjobtitles h on t.ec_jobTitle = h.id
|
||||
where job_no = #{jobNo} AND delete_type = 0
|
||||
</select>
|
||||
<select id="getJobsByPid" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_job t
|
||||
left join hrmjobtitles h on t.ec_jobTitle = h.id
|
||||
where delete_type = 0
|
||||
and parent_job = #{pid}
|
||||
</select>
|
||||
|
||||
<select id="listUsedId" resultType="java.lang.String">
|
||||
select job_id
|
||||
from JCL_ORG_STAFF
|
||||
where delete_type = 0
|
||||
union
|
||||
select job_title
|
||||
from jcl_org_hrmresource
|
||||
where STATUS < 4
|
||||
</select>
|
||||
<select id="listJobsByDepartmentId" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_job t
|
||||
left join hrmjobtitles h on t.ec_jobTitle = h.id
|
||||
where delete_type = 0
|
||||
and parent_dept = #{departmentId}
|
||||
and ec_department = #{departmentId}
|
||||
</select>
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_job t
|
||||
left join hrmjobtitles h on t.ec_jobTitle = h.id
|
||||
where delete_type = 0
|
||||
</select>
|
||||
<select id="listPOsByFilter" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
FROM jcl_org_job t
|
||||
left join hrmjobtitles h on t.ec_jobTitle = h.id
|
||||
WHERE t.delete_type = 0
|
||||
<include refid="likeSQL"/>
|
||||
<if test=" jobPO.parentComp != null ">
|
||||
and t.parent_comp = #{jobPO.parentComp}
|
||||
</if>
|
||||
<if test=" jobPO.parentDept != null ">
|
||||
and t.parent_dept = #{jobPO.parentDept}
|
||||
</if>
|
||||
<if test=" jobPO.sequenceId != null ">
|
||||
and t.sequence_id = #{jobPO.sequenceId}
|
||||
</if>
|
||||
|
|
@ -515,94 +451,42 @@
|
|||
from jcl_org_job
|
||||
</select>
|
||||
<select id="getIdByNameAndPid" resultType="java.lang.Long">
|
||||
select id
|
||||
from jcl_org_job
|
||||
where delete_type = 0 and job_name = #{jobName}
|
||||
and parent_comp = #{parentCompany}
|
||||
select
|
||||
t.id
|
||||
from
|
||||
jcl_org_job t
|
||||
left join hrmjobtitles h on t.ec_jobTitle = h.id
|
||||
where
|
||||
delete_type = 0
|
||||
and h.JOBTITLENAME = #{jobName}
|
||||
and ec_company = #{parentCompany}
|
||||
<include refid="nullparentDept"/>
|
||||
<include refid="nullparentJob"/>
|
||||
</select>
|
||||
<select id="getJobsByIds" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_job t
|
||||
left join hrmjobtitles h on t.ec_jobTitle = h.id
|
||||
where delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{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>
|
||||
<select id="checkRepeatNo" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from jcl_org_job t
|
||||
where t.delete_type = 0
|
||||
AND job_no = #{jobNo}
|
||||
<if test=" id != null ">
|
||||
and t.id != #{id}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getIdByNameAndEcId" resultType="java.lang.Long">
|
||||
select id
|
||||
from jcl_org_job
|
||||
where delete_type = 0
|
||||
and job_name = #{jobName}
|
||||
and ec_company = #{ecCompany}
|
||||
and ec_department = #{ecDepartment}
|
||||
</select>
|
||||
<select id="countRepeatNameByPid" resultType="java.lang.Integer">
|
||||
select count(1) from jcl_org_job
|
||||
where delete_type = 0
|
||||
AND job_name = #{jobName}
|
||||
<if test="id != null">
|
||||
AND id != #{id}
|
||||
</if>
|
||||
AND ec_department =#{ecDepartment}
|
||||
<if test="parentJob != null">
|
||||
AND parent_job = #{parentJob}
|
||||
</if>
|
||||
</select>
|
||||
<select id="isHasResource" resultType="java.lang.Integer">
|
||||
select count(a.id)
|
||||
from jcl_org_hrmresource a
|
||||
inner join jcl_org_job b on a.job_title = b.id
|
||||
where a.status < 4
|
||||
and b.id = #{jobId}
|
||||
</select>
|
||||
|
||||
<sql id="nullparentJob">
|
||||
and ifnull(parent_job,0) =
|
||||
#{parentJob}
|
||||
</sql>
|
||||
|
||||
<sql id="nullparentJob" databaseId="sqlserver">
|
||||
and isnull(parent_job,0) =
|
||||
#{parentJob}
|
||||
</sql>
|
||||
|
||||
<sql id="nullparentJob" databaseId="oracle">
|
||||
and NVL(parent_job,0) =
|
||||
#{parentJob}
|
||||
</sql>
|
||||
<sql id="nullparentDept">
|
||||
and ifnull(parent_dept,0) =
|
||||
and ifnull(ec_department,0) =
|
||||
#{parentDepartment}
|
||||
</sql>
|
||||
|
||||
<sql id="nullparentDept" databaseId="sqlserver">
|
||||
and isnull(parent_dept,0) =
|
||||
and isnull(ec_department,0) =
|
||||
#{parentDepartment}
|
||||
</sql>
|
||||
|
||||
<sql id="nullparentDept" databaseId="oracle">
|
||||
and NVL(parent_dept,0) =
|
||||
and NVL(ec_department,0) =
|
||||
#{parentDepartment}
|
||||
</sql>
|
||||
|
||||
|
|
@ -611,8 +495,8 @@
|
|||
<if test=" jobPO.jobNo != null and jobPO.jobNo != '' ">
|
||||
and t.job_no like CONCAT('%',#{jobPO.jobNo},'%')
|
||||
</if>
|
||||
<if test=" jobPO.jobName != null and jobPO.jobName != '' ">
|
||||
and t.job_name like CONCAT('%',#{jobPO.jobName},'%')
|
||||
<if test=" jobPO.jobTitleName != null and jobPO.jobTitleName != '' ">
|
||||
and h.jobtitlename like CONCAT('%',#{jobPO.jobTitleName},'%')
|
||||
</if>
|
||||
<if test=" jobPO.workplace != null and jobPO.workplace != '' ">
|
||||
and t.workplace like CONCAT('%',#{jobPO.workplace},'%')
|
||||
|
|
@ -632,8 +516,8 @@
|
|||
<if test=" jobPO.jobNo != null and jobPO.jobNo != '' ">
|
||||
and t.job_no like '%'||#{jobPO.jobNo}||'%'
|
||||
</if>
|
||||
<if test=" jobPO.jobName != null and jobPO.jobName != '' ">
|
||||
and t.job_name like '%'||#{jobPO.jobName}||'%'
|
||||
<if test=" jobPO.jobTitleName != null and jobPO.jobTitleName != '' ">
|
||||
and h.jobtitlename like '%'||#{jobPO.jobTitleName}||'%'
|
||||
</if>
|
||||
<if test=" jobPO.workplace != null and jobPO.workplace != '' ">
|
||||
and t.workplace like '%'||#{jobPO.workplace}||'%'
|
||||
|
|
@ -653,8 +537,8 @@
|
|||
<if test=" jobPO.jobNo != null and jobPO.jobNo != '' ">
|
||||
and t.job_no like '%'+#{jobPO.jobNo}+'%'
|
||||
</if>
|
||||
<if test=" jobPO.jobName != null and jobPO.jobName != '' ">
|
||||
and t.job_name like '%'+#{jobPO.jobName}+'%'
|
||||
<if test=" jobPO.jobTitleName != null and jobPO.jobTitleName != '' ">
|
||||
and h.jobTitleName like '%'+#{jobPO.jobTitleName}+'%'
|
||||
</if>
|
||||
<if test=" jobPO.workplace != null and jobPO.workplace != '' ">
|
||||
and t.workplace like '%'+#{jobPO.workplace}+'%'
|
||||
|
|
|
|||
|
|
@ -38,16 +38,9 @@ import com.engine.organization.mapper.extend.ExtendTitleMapper;
|
|||
import com.engine.organization.mapper.hrmresource.HrmRelationMapper;
|
||||
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.mapper.post.PostInfoMapper;
|
||||
import com.engine.organization.mapper.post.PostMapper;
|
||||
import com.engine.organization.mapper.resource.ResourceMapper;
|
||||
import com.engine.organization.mapper.scheme.GradeMapper;
|
||||
import com.engine.organization.mapper.scheme.LevelMapper;
|
||||
import com.engine.organization.mapper.scheme.SchemeMapper;
|
||||
import com.engine.organization.mapper.sequence.SequenceMapper;
|
||||
import com.engine.organization.service.ExtService;
|
||||
import com.engine.organization.service.HrmResourceService;
|
||||
import com.engine.organization.thread.HrmResourceTriggerRunnable;
|
||||
import com.engine.organization.thread.OrganizationSyncEc;
|
||||
import com.engine.organization.util.HasRightUtil;
|
||||
import com.engine.organization.util.MenuBtn;
|
||||
|
|
@ -68,7 +61,6 @@ import weaver.hrm.User;
|
|||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
|
|
@ -117,30 +109,6 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
|
||||
private static final String RIGHT_NAME = "Roster:All";
|
||||
|
||||
private SchemeMapper getSchemeMapper() {
|
||||
return MapperProxyFactory.getProxy(SchemeMapper.class);
|
||||
}
|
||||
|
||||
private LevelMapper getLevelMapper() {
|
||||
return MapperProxyFactory.getProxy(LevelMapper.class);
|
||||
}
|
||||
|
||||
private GradeMapper getGradeMapper() {
|
||||
return MapperProxyFactory.getProxy(GradeMapper.class);
|
||||
}
|
||||
|
||||
private SequenceMapper getSequenceMapper() {
|
||||
return MapperProxyFactory.getProxy(SequenceMapper.class);
|
||||
}
|
||||
|
||||
private PostMapper getPostMapper() {
|
||||
return MapperProxyFactory.getProxy(PostMapper.class);
|
||||
}
|
||||
|
||||
private PostInfoMapper getPostInfoMapper() {
|
||||
return MapperProxyFactory.getProxy(PostInfoMapper.class);
|
||||
}
|
||||
|
||||
private HrmRelationMapper getHrmRelationMapper() {
|
||||
return MapperProxyFactory.getProxy(HrmRelationMapper.class);
|
||||
}
|
||||
|
|
@ -229,7 +197,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
RecordInfo recordInfo = getSystemDataMapper().getHrmObjectByID(HRM_RESOURCE, ecResourceId);
|
||||
params.put("uuid", recordInfo.getUuid());
|
||||
Long resourceId = getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_HRM, params, "", null);
|
||||
new HrmResourceTriggerRunnable(resourceId).run();
|
||||
// TODO new HrmResourceTriggerRunnable(resourceId).run();
|
||||
return resourceId;
|
||||
}
|
||||
|
||||
|
|
@ -300,7 +268,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
// 更新主表数据
|
||||
updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_HRM, params, "", id);
|
||||
|
||||
new HrmResourceTriggerRunnable(id).run();
|
||||
// TODO new HrmResourceTriggerRunnable(id).run();
|
||||
} else {
|
||||
// 更新主表拓展表
|
||||
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_HRMEXT, params, "", id);
|
||||
|
|
@ -367,61 +335,61 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
int viewAttr = Integer.parseInt(viewAttrStr);
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
SearchConditionItem schemeId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "等级方案", "161", "schemeId", "schemeBrowser");
|
||||
schemeId.setRules("required");
|
||||
SearchConditionItem gradeId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "职级", "161", "gradeId", "gradeBrowser");
|
||||
gradeId.setRules("required");
|
||||
SearchConditionItem levelId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "职等", "162", "levelId", "levelBrowser");
|
||||
levelId.setRules("required");
|
||||
SearchConditionItem sequenceId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "岗位序列", "161", "sequenceId", "sequenceBrowser");
|
||||
sequenceId.setRules("required");
|
||||
SearchConditionItem postId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "职务分类", "161", "postId", "postBrowser");
|
||||
postId.setRules("required");
|
||||
SearchConditionItem postInfoId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "职务信息", "161", "postInfoId", "postInfoBrowser");
|
||||
postInfoId.setRules("required");
|
||||
SearchConditionItem companyId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "分部", "164", "companyId", "");
|
||||
companyId.setRules("required");
|
||||
SearchConditionItem departmentId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "部门", "4", "departmentId", "");
|
||||
departmentId.setRules("required");
|
||||
SearchConditionItem jobId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "岗位", "161", "jobId", "jobBrowser");
|
||||
jobId.setRules("required");
|
||||
|
||||
|
||||
// 编辑状态下赋值操作
|
||||
HrmRelationPO relationPO = getHrmRelationMapper().getRelationById(Long.parseLong(id));
|
||||
if (null != relationPO) {
|
||||
setBrowserValue(schemeId, relationPO.getSchemeId(), getSchemeMapper().listSchemesByIds(Stream.of(relationPO.getSchemeId()).collect(Collectors.toList())), null, null);
|
||||
setBrowserValue(gradeId, relationPO.getGradeId(), getGradeMapper().listGradessByIds(Stream.of(relationPO.getGradeId()).collect(Collectors.toList())), "scheme_id", relationPO.getSchemeId());
|
||||
setBrowserValue(levelId, relationPO.getLevelId(), getLevelMapper().listLevelsByIds(DeleteParam.builder().ids(relationPO.getLevelId()).build().getIds()), "grade_id", relationPO.getGradeId());
|
||||
setBrowserValue(sequenceId, relationPO.getSequenceId(), getSequenceMapper().listSequencesByIds(Stream.of(relationPO.getSequenceId()).collect(Collectors.toList())), "scheme_id", relationPO.getSchemeId());
|
||||
setBrowserValue(postId, relationPO.getPostId(), getPostMapper().listPostsByIds(Stream.of(relationPO.getPostId()).collect(Collectors.toList())), null, null);
|
||||
setBrowserValue(postInfoId, relationPO.getPostInfoId(), getPostInfoMapper().listPostInfosByIds(Stream.of(relationPO.getPostInfoId()).collect(Collectors.toList())), "post_id", relationPO.getPostId());
|
||||
|
||||
List<Map<String, Object>> companyMaps = new ArrayList<>();
|
||||
String scCompanyNameById = MapperProxyFactory.getProxy(SystemDataMapper.class).getScCompanyNameById(relationPO.getCompanyId().toString());
|
||||
Map<String, Object> companyMap = new HashMap<>();
|
||||
companyMap.put(relationPO.getCompanyId().toString(), scCompanyNameById);
|
||||
companyMaps.add(companyMap);
|
||||
setBrowserValue(companyId, relationPO.getCompanyId(), companyMaps, null, null);
|
||||
|
||||
List<Map<String, Object>> departmentMaps = new ArrayList<>();
|
||||
String departmentNameById = MapperProxyFactory.getProxy(SystemDataMapper.class).getScDepartmentNameById(relationPO.getDepartmentId().toString());
|
||||
Map<String, Object> departmentMap = new HashMap<>();
|
||||
departmentMap.put(relationPO.getDepartmentId().toString(), departmentNameById);
|
||||
departmentMaps.add(departmentMap);
|
||||
setBrowserValue(departmentId, relationPO.getDepartmentId(), departmentMaps, "subcompany1", relationPO.getCompanyId());
|
||||
|
||||
setBrowserValue(jobId, relationPO.getJobId(), getJobMapper().listJobsByIds(Stream.of(relationPO.getJobId()).collect(Collectors.toList())), "departmentid", relationPO.getDepartmentId());
|
||||
}
|
||||
|
||||
addGroups.add(new SearchConditionGroup("岗职位体系", true, Stream.of(schemeId, gradeId, levelId, sequenceId, postId, postInfoId).collect(Collectors.toList())));
|
||||
addGroups.add(new SearchConditionGroup("组织机构", true, Stream.of(companyId, departmentId, jobId).collect(Collectors.toList())));
|
||||
HashMap<String, Object> buttonsMap = new HashMap<>();
|
||||
buttonsMap.put("hasEdit", true);
|
||||
buttonsMap.put("hasSave", true);
|
||||
apiDatas.put("buttons", buttonsMap);
|
||||
apiDatas.put("conditions", addGroups);
|
||||
//List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
//SearchConditionItem schemeId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "等级方案", "161", "schemeId", "schemeBrowser");
|
||||
//schemeId.setRules("required");
|
||||
//SearchConditionItem gradeId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "职级", "161", "gradeId", "gradeBrowser");
|
||||
//gradeId.setRules("required");
|
||||
//SearchConditionItem levelId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "职等", "162", "levelId", "levelBrowser");
|
||||
//levelId.setRules("required");
|
||||
//SearchConditionItem sequenceId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "岗位序列", "161", "sequenceId", "sequenceBrowser");
|
||||
//sequenceId.setRules("required");
|
||||
//SearchConditionItem postId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "职务分类", "161", "postId", "postBrowser");
|
||||
//postId.setRules("required");
|
||||
//SearchConditionItem postInfoId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "职务信息", "161", "postInfoId", "postInfoBrowser");
|
||||
//postInfoId.setRules("required");
|
||||
//SearchConditionItem companyId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "分部", "164", "companyId", "");
|
||||
//companyId.setRules("required");
|
||||
//SearchConditionItem departmentId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "部门", "4", "departmentId", "");
|
||||
//departmentId.setRules("required");
|
||||
//SearchConditionItem jobId = OrganizationFormItemUtil.browserItem(user, 2, 17, viewAttr, false, "岗位", "161", "jobId", "jobBrowser");
|
||||
//jobId.setRules("required");
|
||||
//
|
||||
//
|
||||
//// 编辑状态下赋值操作
|
||||
//HrmRelationPO relationPO = getHrmRelationMapper().getRelationById(Long.parseLong(id));
|
||||
//if (null != relationPO) {
|
||||
// setBrowserValue(schemeId, relationPO.getSchemeId(), getSchemeMapper().listSchemesByIds(Stream.of(relationPO.getSchemeId()).collect(Collectors.toList())), null, null);
|
||||
// setBrowserValue(gradeId, relationPO.getGradeId(), getGradeMapper().listGradessByIds(Stream.of(relationPO.getGradeId()).collect(Collectors.toList())), "scheme_id", relationPO.getSchemeId());
|
||||
// setBrowserValue(levelId, relationPO.getLevelId(), getLevelMapper().listLevelsByIds(DeleteParam.builder().ids(relationPO.getLevelId()).build().getIds()), "grade_id", relationPO.getGradeId());
|
||||
// setBrowserValue(sequenceId, relationPO.getSequenceId(), getSequenceMapper().listSequencesByIds(Stream.of(relationPO.getSequenceId()).collect(Collectors.toList())), "scheme_id", relationPO.getSchemeId());
|
||||
// setBrowserValue(postId, relationPO.getPostId(), getPostMapper().listPostsByIds(Stream.of(relationPO.getPostId()).collect(Collectors.toList())), null, null);
|
||||
// setBrowserValue(postInfoId, relationPO.getPostInfoId(), getPostInfoMapper().listPostInfosByIds(Stream.of(relationPO.getPostInfoId()).collect(Collectors.toList())), "post_id", relationPO.getPostId());
|
||||
//
|
||||
// List<Map<String, Object>> companyMaps = new ArrayList<>();
|
||||
// String scCompanyNameById = MapperProxyFactory.getProxy(SystemDataMapper.class).getScCompanyNameById(relationPO.getCompanyId().toString());
|
||||
// Map<String, Object> companyMap = new HashMap<>();
|
||||
// companyMap.put(relationPO.getCompanyId().toString(), scCompanyNameById);
|
||||
// companyMaps.add(companyMap);
|
||||
// setBrowserValue(companyId, relationPO.getCompanyId(), companyMaps, null, null);
|
||||
//
|
||||
// List<Map<String, Object>> departmentMaps = new ArrayList<>();
|
||||
// String departmentNameById = MapperProxyFactory.getProxy(SystemDataMapper.class).getScDepartmentNameById(relationPO.getDepartmentId().toString());
|
||||
// Map<String, Object> departmentMap = new HashMap<>();
|
||||
// departmentMap.put(relationPO.getDepartmentId().toString(), departmentNameById);
|
||||
// departmentMaps.add(departmentMap);
|
||||
// setBrowserValue(departmentId, relationPO.getDepartmentId(), departmentMaps, "subcompany1", relationPO.getCompanyId());
|
||||
//
|
||||
// setBrowserValue(jobId, relationPO.getJobId(), getJobMapper().listJobsByIds(Stream.of(relationPO.getJobId()).collect(Collectors.toList())), "departmentid", relationPO.getDepartmentId());
|
||||
//}
|
||||
//
|
||||
//addGroups.add(new SearchConditionGroup("岗职位体系", true, Stream.of(schemeId, gradeId, levelId, sequenceId, postId, postInfoId).collect(Collectors.toList())));
|
||||
//addGroups.add(new SearchConditionGroup("组织机构", true, Stream.of(companyId, departmentId, jobId).collect(Collectors.toList())));
|
||||
//HashMap<String, Object> buttonsMap = new HashMap<>();
|
||||
//buttonsMap.put("hasEdit", true);
|
||||
//buttonsMap.put("hasSave", true);
|
||||
//apiDatas.put("buttons", buttonsMap);
|
||||
//apiDatas.put("conditions", addGroups);
|
||||
return apiDatas;
|
||||
}
|
||||
|
||||
|
|
@ -455,36 +423,6 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
return hrmRelationPO.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 浏览按钮赋值
|
||||
*
|
||||
* @param browserItem
|
||||
* @param browserValue
|
||||
* @param maps
|
||||
*/
|
||||
private void setBrowserValue(SearchConditionItem browserItem, Object browserValue, List<Map<String, Object>> maps, String relateField, Object relatedValue) {
|
||||
browserItem.setValue(browserValue);
|
||||
BrowserBean browserBean = browserItem.getBrowserConditionParam();
|
||||
browserBean.setReplaceDatas(maps);
|
||||
browserItem.setBrowserConditionParam(browserBean);
|
||||
|
||||
if (StringUtils.isNotBlank(relateField) && 1 != browserItem.getViewAttr()) {
|
||||
long l = System.currentTimeMillis();
|
||||
Map<String, Object> completeParams = browserBean.getCompleteParams();
|
||||
completeParams.put("currenttime", l);
|
||||
completeParams.put(relateField + "_" + l, relatedValue);
|
||||
Map<String, Object> conditionDataParams = browserBean.getConditionDataParams();
|
||||
conditionDataParams.put("currenttime", l);
|
||||
conditionDataParams.put(relateField + "_" + l, relatedValue);
|
||||
Map<String, Object> dataParams = browserBean.getDataParams();
|
||||
dataParams.put("currenttime", l);
|
||||
dataParams.put(relateField + "_" + l, relatedValue);
|
||||
Map<String, Object> destDataParams = browserBean.getDestDataParams();
|
||||
destDataParams.put("currenttime", l);
|
||||
destDataParams.put(relateField + "_" + l, relatedValue);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询条件
|
||||
*
|
||||
|
|
@ -496,23 +434,23 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
String sqlWhere = " where 1=1 ";
|
||||
String lastName = params.getLastName();
|
||||
if (StringUtils.isNotBlank(lastName)) {
|
||||
sqlWhere += " AND t.last_name " + dbType.like(lastName);
|
||||
sqlWhere += " AND t.lastname " + dbType.like(lastName);
|
||||
}
|
||||
Long companyId = params.getCompanyId();
|
||||
if (null != companyId) {
|
||||
sqlWhere += " AND t.company_id = '" + companyId + "'";
|
||||
sqlWhere += " AND t.subcompanyid1 = '" + companyId + "'";
|
||||
}
|
||||
Long departmentId = params.getDepartmentId();
|
||||
if (null != departmentId) {
|
||||
sqlWhere += " AND t.department_id = '" + departmentId + "'";
|
||||
sqlWhere += " AND t.departmentid = '" + departmentId + "'";
|
||||
}
|
||||
Long ecCompany = params.getEcCompany();
|
||||
if (null != ecCompany) {
|
||||
sqlWhere += " AND t.ec_company = '" + ecCompany + "'";
|
||||
sqlWhere += " AND t.subcompanyid1 = '" + ecCompany + "'";
|
||||
}
|
||||
Long ecDepartment = params.getEcDepartment();
|
||||
if (null != ecDepartment) {
|
||||
sqlWhere += " AND t.ec_department = '" + ecDepartment + "'";
|
||||
sqlWhere += " AND t.departmentid = '" + ecDepartment + "'";
|
||||
}
|
||||
String telephone = params.getTelephone();
|
||||
if (StringUtils.isNotBlank(telephone)) {
|
||||
|
|
@ -524,14 +462,15 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
}
|
||||
Long jobTitle = params.getJobTitle();
|
||||
if (null != jobTitle) {
|
||||
sqlWhere += " AND t.job_title = '" + jobTitle + "'";
|
||||
// TODO BUG修复
|
||||
sqlWhere += " AND t.jobtitle = '" + jobTitle + "'";
|
||||
}
|
||||
|
||||
// 分权查询
|
||||
DetachUtil detachUtil = new DetachUtil(user.getUID());
|
||||
String parentCompanyIds = detachUtil.getJclRoleLevels();
|
||||
if (detachUtil.isDETACH()) {
|
||||
sqlWhere += " And t.company_id in(" + parentCompanyIds + ")";
|
||||
sqlWhere += " And t.subcompanyid1 in(" + parentCompanyIds + ")";
|
||||
}
|
||||
|
||||
return sqlWhere;
|
||||
|
|
@ -542,21 +481,21 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
// 通过分部、公司 组装数据
|
||||
if (StringUtil.isEmpty(id) || TYPE_COMP.equals(type)) {
|
||||
Integer parentCompId = StringUtil.isEmpty(id) ? null : Integer.parseInt(id);
|
||||
DepartmentPO departmentBuild = DepartmentPO.builder().departmentName(keyword).subCompanyId1(parentCompId).build();
|
||||
CompPO compBuild = CompPO.builder().subCompanyName(keyword).supSubComId(parentCompId).build();
|
||||
DepartmentPO departmentBuild = DepartmentPO.builder().departmentName(keyword).subCompanyId1(parentCompId).canceled(0).build();
|
||||
CompPO compBuild = CompPO.builder().subCompanyName(keyword).supSubComId(parentCompId).canceled(0).build();
|
||||
// 所属分部下的岗位
|
||||
JobPO jobBuild = JobPO.builder().jobName(keyword).parentComp(parentCompId).build();
|
||||
JobPO jobBuild = JobPO.builder().jobTitleName(keyword).ecCompany(parentCompId).forbiddenTag(0).build();
|
||||
searchTree = buildTreeByCompAndDept(departmentBuild, compBuild, jobBuild);
|
||||
} else if (TYPE_DEPT.equals(type)) {
|
||||
Integer parentDeptId = Integer.parseInt(id);
|
||||
DepartmentPO departmentBuild = DepartmentPO.builder().departmentName(keyword).supDepId(parentDeptId).build();
|
||||
DepartmentPO departmentBuild = DepartmentPO.builder().departmentName(keyword).supDepId(parentDeptId).canceled(0).build();
|
||||
// 所属分部下的岗位
|
||||
JobPO jobBuild = JobPO.builder().jobName(keyword).parentDept(parentDeptId).build();
|
||||
JobPO jobBuild = JobPO.builder().jobTitleName(keyword).ecDepartment(parentDeptId).forbiddenTag(0).build();
|
||||
searchTree = buildTreeByDeptAndJob(departmentBuild, jobBuild);
|
||||
|
||||
} else if (TYPE_JOB.equals(type)) {
|
||||
// 查询部门信息
|
||||
List<JobPO> filterDeparts = getJobMapper().listPOsByFilter(JobPO.builder().jobName(keyword).parentJob(Long.parseLong(id)).build());
|
||||
List<JobPO> filterDeparts = getJobMapper().listPOsByFilter(JobPO.builder().jobTitleName(keyword).parentJob(Long.parseLong(id)).forbiddenTag(0).build());
|
||||
Set<JobPO> builderJobs = new HashSet<>();
|
||||
for (JobPO departmentPO : filterDeparts) {
|
||||
buildParentJobs(departmentPO, builderJobs);
|
||||
|
|
@ -589,7 +528,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
String parentDeptS = jobTrees.stream().map(SearchTree::getParentComp).collect(Collectors.joining(","));
|
||||
if (!StringUtil.isEmpty(parentDeptS)) {
|
||||
// 兼容SQLServer每次最多in,2100条数据
|
||||
List<Long> ids = (List<Long>) DeleteParam.builder().ids(parentDeptS).build().getIds();
|
||||
List<Long> ids = DeleteParam.builder().ids(parentDeptS).build().getIds();
|
||||
int ceilCount = (int) Math.ceil((double) ids.size() / 1000);
|
||||
List<DepartmentPO> departmentsByIds = new ArrayList<>();
|
||||
for (int i = 1; i < ceilCount + 1; i++) {
|
||||
|
|
@ -716,8 +655,8 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
String jobId = Util.null2String(params.get("job_title"));
|
||||
if (StringUtils.isNotBlank(jobId)) {
|
||||
JobPO jobById = getJobMapper().getJobById(Long.parseLong(jobId));
|
||||
params.put("department_id", jobById.getParentDept());
|
||||
params.put("company_id", jobById.getParentComp());
|
||||
params.put("department_id", jobById.getEcDepartment());
|
||||
params.put("company_id", jobById.getEcCompany());
|
||||
params.put("ec_department", jobById.getEcDepartment());
|
||||
params.put("ec_company", jobById.getEcCompany());
|
||||
// 等级方案、岗位序列、职等、职级
|
||||
|
|
|
|||
|
|
@ -16,12 +16,10 @@ import com.engine.organization.entity.scheme.po.GradePO;
|
|||
import com.engine.organization.entity.scheme.po.LevelPO;
|
||||
import com.engine.organization.entity.scheme.po.SchemePO;
|
||||
import com.engine.organization.enums.OrgImportEnum;
|
||||
import com.engine.organization.mapper.department.DepartmentMapper;
|
||||
import com.engine.organization.mapper.employee.EmployeeMapper;
|
||||
import com.engine.organization.mapper.extend.ExtendInfoMapper;
|
||||
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
||||
import com.engine.organization.mapper.jclimport.JclImportHistoryDetailMapper;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.mapper.resource.ResourceMapper;
|
||||
import com.engine.organization.mapper.scheme.GradeMapper;
|
||||
import com.engine.organization.mapper.scheme.LevelMapper;
|
||||
|
|
@ -753,27 +751,6 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 校验重复编号
|
||||
*/
|
||||
private boolean checkRepeatNo(String no, Long extendType, Long id) {
|
||||
if (StringUtils.isBlank(no)) {
|
||||
return true;
|
||||
}
|
||||
if (null != extendType) {
|
||||
switch (extendType.toString()) {
|
||||
case "1":
|
||||
// return 0 == MapperProxyFactory.getProxy(CompMapper.class).checkRepeatNo(no, id);
|
||||
case "2":
|
||||
return 0 == MapperProxyFactory.getProxy(DepartmentMapper.class).checkRepeatNo(no, id);
|
||||
case "3":
|
||||
return 0 == MapperProxyFactory.getProxy(JobMapper.class).checkRepeatNo(no, id);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成导入模板文件
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import com.engine.organization.entity.department.bo.DepartmentBO;
|
|||
import com.engine.organization.entity.department.po.DepartmentPO;
|
||||
import com.engine.organization.entity.employee.vo.EmployeeTableVO;
|
||||
import com.engine.organization.entity.extend.po.ExtendTitlePO;
|
||||
import com.engine.organization.entity.hrmresource.po.HrmResourcePO;
|
||||
import com.engine.organization.entity.job.bo.JobBO;
|
||||
import com.engine.organization.entity.job.dto.JobListDTO;
|
||||
import com.engine.organization.entity.job.param.JobMergeParam;
|
||||
|
|
@ -32,6 +31,7 @@ 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.exception.OrganizationRunTimeException;
|
||||
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
|
||||
import com.engine.organization.mapper.comp.CompMapper;
|
||||
import com.engine.organization.mapper.department.DepartmentMapper;
|
||||
|
|
@ -44,8 +44,6 @@ import com.engine.organization.mapper.resource.ResourceMapper;
|
|||
import com.engine.organization.mapper.scheme.GradeMapper;
|
||||
import com.engine.organization.service.ExtService;
|
||||
import com.engine.organization.service.JobService;
|
||||
import com.engine.organization.thread.HrmResourceTriggerRunnable;
|
||||
import com.engine.organization.thread.JobTriggerRunnable;
|
||||
import com.engine.organization.thread.OrganizationSyncEc;
|
||||
import com.engine.organization.util.*;
|
||||
import com.engine.organization.util.coderule.CodeRuleUtil;
|
||||
|
|
@ -57,7 +55,6 @@ import com.engine.organization.util.page.PageUtil;
|
|||
import com.engine.organization.util.tree.SearchTreeUtil;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.StringUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
|
@ -203,7 +200,16 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
|
||||
@Override
|
||||
public Map<String, List<MenuBtn>> getHasRight() {
|
||||
return MenuBtn.getDatasNoBtnColum();
|
||||
Map<String, List<MenuBtn>> btnDatas = new HashMap<>();
|
||||
ArrayList<MenuBtn> topMenuList = new ArrayList<>();
|
||||
ArrayList<MenuBtn> rightMenuList = new ArrayList<>();
|
||||
// 批量删除
|
||||
topMenuList.add(MenuBtn.topMenu_batchDelete());
|
||||
btnDatas.put("topMenu", topMenuList);
|
||||
// 日志
|
||||
rightMenuList.add(MenuBtn.rightMenu_btnLog());
|
||||
btnDatas.put("rightMenu", rightMenuList);
|
||||
return btnDatas;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -214,23 +220,11 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
// 编号
|
||||
SearchConditionItem jobNoItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "编号", "jobNo");
|
||||
// 名称
|
||||
SearchConditionItem jobNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "名称", "jobName");
|
||||
SearchConditionItem jobTitleNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "名称", "jobTitleName");
|
||||
// 所属分部
|
||||
SearchConditionItem parentCompBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "所属分部", "164", "ecCompany", "");
|
||||
// 所属部门
|
||||
SearchConditionItem parentDeptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "所属部门", "4", "ecDepartment", "");
|
||||
// 岗位序列
|
||||
SearchConditionItem sequenceBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "岗位序列", "161", "sequenceId", "sequenceBrowser");
|
||||
// 等级方案
|
||||
SearchConditionItem schemeBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "等级方案", "161", "schemeId", "schemeBrowser");
|
||||
// 上级岗位
|
||||
SearchConditionItem parentJobBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "上级岗位", "666", "parentJob", "");
|
||||
BrowserBean browserBean = parentJobBrowserItem.getBrowserConditionParam();
|
||||
String s = JSONObject.toJSONString(browserBean);
|
||||
CustomBrowserBean customBrowserBean = JSONObject.parseObject(s, CustomBrowserBean.class);
|
||||
customBrowserBean.setHasLeftTree(true);
|
||||
customBrowserBean.setLeftToSearchKey("treeKey");
|
||||
parentJobBrowserItem.setBrowserConditionParam(customBrowserBean);
|
||||
// 是否关键岗
|
||||
List<SearchConditionOption> isKeyOptions = new ArrayList<>();
|
||||
SearchConditionOption yesOption = new SearchConditionOption("0", "否");
|
||||
|
|
@ -249,12 +243,9 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
SearchConditionItem forbiddenTagItem = OrganizationFormItemUtil.selectItem(user, selectOptions, 2, 16, 6, false, "禁用标记", "forbiddenTag");
|
||||
|
||||
conditionItems.add(jobNoItem);
|
||||
conditionItems.add(jobNameItem);
|
||||
conditionItems.add(jobTitleNameItem);
|
||||
conditionItems.add(parentCompBrowserItem);
|
||||
conditionItems.add(parentDeptBrowserItem);
|
||||
conditionItems.add(sequenceBrowserItem);
|
||||
conditionItems.add(schemeBrowserItem);
|
||||
conditionItems.add(parentJobBrowserItem);
|
||||
conditionItems.add(isKeyItem);
|
||||
conditionItems.add(workplaceItem);
|
||||
conditionItems.add(forbiddenTagItem);
|
||||
|
|
@ -321,7 +312,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(Long.parseLong(groupId), "1");
|
||||
if (CollectionUtils.isNotEmpty(extendTitles)) {
|
||||
for (ExtendTitlePO extendTitle : extendTitles) {
|
||||
List<SearchConditionItem> items = getExtService(user).getExtForm(user, EXTEND_TYPE + "", GROUP_ID.equals(Long.parseLong(groupId)) ? JCL_ORG_JOB : JCL_ORG_JOBEXT, viewAttr, id, extendTitle.getId().toString(), "scheme_id", "parent_comp");
|
||||
List<SearchConditionItem> items = getExtService(user).getExtForm(user, EXTEND_TYPE + "", GROUP_ID.equals(Long.parseLong(groupId)) ? JCL_ORG_JOB : JCL_ORG_JOBEXT, viewAttr, id, extendTitle.getId().toString(), "ec_jobTitle", "ec_department", "ec_company");
|
||||
if (CollectionUtils.isNotEmpty(items)) {
|
||||
addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, items));
|
||||
}
|
||||
|
|
@ -357,7 +348,6 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
public Long saveBaseForm(Map<String, Object> params) {
|
||||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
JobSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), JobSearchParam.class);
|
||||
assertNameRepeat(null, searchParam.getEcDepartment(), searchParam.getParentJob(), searchParam.getJobName());
|
||||
String jobNo = (String) params.get("job_no");
|
||||
// 判断是否开启自动编号
|
||||
jobNo = repeatDetermine(jobNo);
|
||||
|
|
@ -365,18 +355,13 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
params.put("is_key", null == searchParam.getIsKey() ? 0 : searchParam.getIsKey());
|
||||
if (null != searchParam.getParentJob()) {
|
||||
JobPO parentJob = getJobMapper().getJobById(searchParam.getParentJob());
|
||||
params.put("parent_dept", parentJob.getParentDept());
|
||||
params.put("parent_comp", parentJob.getParentComp());
|
||||
params.put("ec_company", parentJob.getEcCompany());
|
||||
params.put("ec_department", parentJob.getEcDepartment());
|
||||
} else {
|
||||
Integer ecDepartment = searchParam.getEcDepartment();
|
||||
DepartmentPO jclDepartment = getDepartmentMapper().getDeptById(ecDepartment);
|
||||
params.put("parent_dept", jclDepartment.getId());
|
||||
params.put("parent_comp", jclDepartment.getSubCompanyId1());
|
||||
if (null != jclDepartment.getSubCompanyId1()) {
|
||||
params.put("ec_company", jclDepartment.getSubCompanyId1());
|
||||
}
|
||||
params.put("ec_company", jclDepartment.getId());
|
||||
params.put("ec_department", jclDepartment.getSubCompanyId1());
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(params.get("show_order").toString())) {
|
||||
|
|
@ -395,7 +380,6 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
public Long updateForm(Map<String, Object> params) {
|
||||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
JobSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), JobSearchParam.class);
|
||||
assertNameRepeat(searchParam.getId(), searchParam.getEcDepartment(), searchParam.getParentJob(), searchParam.getJobName());
|
||||
String groupId = (String) params.get("viewCondition");
|
||||
searchParam.setIsKey(null == searchParam.getIsKey() ? 0 : searchParam.getIsKey());
|
||||
// 上级岗位不能选择本身
|
||||
|
|
@ -416,27 +400,22 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
params.put("is_key", searchParam.getIsKey());
|
||||
if (null != searchParam.getParentJob()) {
|
||||
JobPO parentJob = getJobMapper().getJobById(searchParam.getParentJob());
|
||||
params.put("parent_dept", parentJob.getParentDept());
|
||||
params.put("parent_comp", parentJob.getParentComp());
|
||||
params.put("ec_company", parentJob.getEcCompany());
|
||||
params.put("ec_department", parentJob.getEcDepartment());
|
||||
} else {
|
||||
Integer ecDepartment = searchParam.getEcDepartment();
|
||||
DepartmentPO jclDepartment = getDepartmentMapper().getDeptById(ecDepartment);
|
||||
params.put("parent_dept", jclDepartment.getId());
|
||||
params.put("parent_comp", jclDepartment.getSubCompanyId1());
|
||||
if (null != jclDepartment.getSubCompanyId1()) {
|
||||
params.put("ec_company", jclDepartment.getSubCompanyId1());
|
||||
}
|
||||
params.put("ec_department", jclDepartment.getId());
|
||||
params.put("ec_company", jclDepartment.getSubCompanyId1());
|
||||
}
|
||||
params.put("jobactivityid", JOB_ACTIVITY_ID);
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.UPDATE, params, oldJobPO).sync();
|
||||
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOB, params, "", searchParam.getId());
|
||||
|
||||
JobPO jobById = getJobMapper().getJobById(searchParam.getId());
|
||||
new JobTriggerRunnable(oldJobPO, jobById).run();
|
||||
//TODO new JobTriggerRunnable(oldJobPO, jobById).run();
|
||||
// 更新人员关联字段
|
||||
updateResourceJob(jobById);
|
||||
// updateResourceJob(jobById);
|
||||
}
|
||||
// 更新主表拓展表
|
||||
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOBEXT, params, "", searchParam.getId());
|
||||
|
|
@ -463,18 +442,15 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
jobById.setEcDepartment(Integer.parseInt(department));
|
||||
DepartmentPO jclDepartmentId = getDepartmentMapper().getDeptById(jobById.getEcDepartment());
|
||||
if (null != jclDepartmentId) {
|
||||
jobById.setParentDept(jclDepartmentId.getId());
|
||||
//分部赋值
|
||||
jobById.setEcCompany(jclDepartmentId.getSubCompanyId1());
|
||||
jobById.setParentComp(jclDepartmentId.getSubCompanyId1());
|
||||
}
|
||||
// 清空上级岗位
|
||||
jobById.setParentJob(null);
|
||||
jobById.setShowOrder(orderNum);
|
||||
assertNameRepeat(null, jobById.getEcDepartment(), jobById.getParentJob(), jobById.getJobName());
|
||||
insertCount += getJobMapper().insertIgnoreNull(jobById);
|
||||
// 更新组织架构图
|
||||
new JobTriggerRunnable(jobById.getId()).run();
|
||||
//TODO new JobTriggerRunnable(jobById.getId()).run();
|
||||
}
|
||||
|
||||
return insertCount;
|
||||
|
|
@ -484,10 +460,10 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
public int updateForbiddenTagById(JobSearchParam params) {
|
||||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
JobPO jobById = getJobMapper().getJobById(params.getId());
|
||||
JobPO jobPO = JobPO.builder().id(params.getId()).forbiddenTag(params.getForbiddenTag() ? 0 : 1).jobName(jobById.getJobName()).build();
|
||||
JobPO jobPO = JobPO.builder().id(params.getId()).forbiddenTag(params.getForbiddenTag() ? 0 : 1).build();
|
||||
if (params.getForbiddenTag()) {
|
||||
// 启用:判断上级部门是否启用,上级部门启用,岗位才可启用
|
||||
DepartmentPO parentDepartment = getDepartmentMapper().getDeptById(jobById.getParentDept());
|
||||
DepartmentPO parentDepartment = getDepartmentMapper().getDeptById(jobById.getEcDepartment());
|
||||
OrganizationAssert.isTrue(0 == parentDepartment.getCanceled(), "该岗位不能解封,请先解封上级部门");
|
||||
|
||||
// 启用:判断上级岗位是否启用,上级岗位启用,岗位才可启用
|
||||
|
|
@ -497,8 +473,9 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
}
|
||||
} else {
|
||||
//禁用:判断当前岗位下是否有人员,如有人员则不能禁用
|
||||
int hasResource = getJobMapper().isHasResource(params.getId());
|
||||
OrganizationAssert.isTrue(hasResource == 0, "该岗位存在人员,不能封存");
|
||||
// int hasResource = getJobMapper().isHasResource(params.getId());
|
||||
// OrganizationAssert.isTrue(hasResource == 0, "该岗位存在人员,不能封存");
|
||||
throw new OrganizationRunTimeException("该岗位不能封存");
|
||||
}
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, jobPO).sync();
|
||||
return getJobMapper().updateForbiddenTagById(jobPO.getId(), jobPO.getForbiddenTag());
|
||||
|
|
@ -522,7 +499,8 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
@Override
|
||||
public Map<String, Object> getHrmListByJobId(Long jobId) {
|
||||
OrganizationWeaTable<EmployeeTableVO> table = new OrganizationWeaTable<>(user, EmployeeTableVO.class);
|
||||
table.setSqlwhere(" where job_title = '" + jobId + "' and status<4");
|
||||
// TODO BUG修复
|
||||
table.setSqlwhere(" where jobtitle = '" + jobId + "' and status<4");
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
|
|
@ -543,11 +521,6 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
deptBrowserItem.setBrowserConditionParam(customBrowserBean);
|
||||
SearchConditionItem mergeNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "合并后名称", "mergeName");
|
||||
mergeNameItem.setRules("required|string");
|
||||
JobPO jobById = getJobMapper().getJobById(id);
|
||||
if (null != jobById) {
|
||||
String jobName = jobById.getJobName();
|
||||
mergeNameItem.setValue(jobName);
|
||||
}
|
||||
condition.add(deptBrowserItem);
|
||||
condition.add(mergeNameItem);
|
||||
addGroups.add(new SearchConditionGroup("", true, condition));
|
||||
|
|
@ -576,45 +549,42 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
|
||||
// 待合并的部门
|
||||
JobPO jobById = getJobMapper().getJobById(mergeParam.getId());
|
||||
assertNameRepeat(targetJob.getId(), targetJob.getEcDepartment(), targetJob.getParentJob(), mergeParam.getMergeName());
|
||||
|
||||
// 递归处理子岗位所属分部、所部部门、上级岗位
|
||||
recursionMergeJob(jobs, targetJob.getParentComp(), targetJob.getEcCompany(), targetJob.getParentDept(), targetJob.getEcDepartment(), targetJob.getId());
|
||||
recursionMergeJob(jobs, targetJob.getEcCompany(), targetJob.getEcDepartment(), targetJob.getId());
|
||||
|
||||
// 人员信息变动,更新分部、部门、岗位
|
||||
updateResourceJob(jobById, targetJob);
|
||||
// updateResourceJob(jobById, targetJob);
|
||||
|
||||
// 更新合并后的岗位,更新组织架构图
|
||||
updateEcJob(targetJob, mergeParam.getMergeName());
|
||||
// updateEcJob(targetJob, mergeParam.getMergeName());
|
||||
|
||||
targetJob.setJobName(mergeParam.getMergeName());
|
||||
// TODO targetJob.setJobName(mergeParam.getMergeName());
|
||||
getJobMapper().updateBaseJob(targetJob);
|
||||
new JobTriggerRunnable(jobById.getId(), targetJob.getId()).run();
|
||||
//TODO new JobTriggerRunnable(jobById.getId(), targetJob.getId()).run();
|
||||
// 原岗位删除
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, jobById).sync();
|
||||
getJobMapper().deleteByIds(Collections.singletonList(jobById.getId()));
|
||||
// 更新组织架构图
|
||||
new JobTriggerRunnable(jobById).run();
|
||||
//TODO new JobTriggerRunnable(jobById).run();
|
||||
return updateCount;
|
||||
}
|
||||
|
||||
|
||||
void recursionMergeJob(List<JobPO> jobs, Integer parentCompany, Integer ecCompany, Integer parentDepartment, Integer ecDepartment, Long parentJob) {
|
||||
void recursionMergeJob(List<JobPO> jobs, Integer ecCompany, Integer ecDepartment, Long parentJob) {
|
||||
for (JobPO job : jobs) {
|
||||
job.setParentComp(parentCompany);
|
||||
job.setEcCompany(ecCompany);
|
||||
job.setParentDept(parentDepartment);
|
||||
job.setEcDepartment(ecDepartment);
|
||||
job.setParentJob(parentJob);
|
||||
getJobMapper().updateBaseJob(job);
|
||||
// 更新人员信息
|
||||
updateResourceJob(job);
|
||||
// updateResourceJob(job);
|
||||
// 更新组织架构图
|
||||
new JobTriggerRunnable(job.getId()).run();
|
||||
//TODO new JobTriggerRunnable(job.getId()).run();
|
||||
|
||||
// 递归处理子级元素
|
||||
List<JobPO> jobsByPid = getJobMapper().getJobsByPid(job.getId());
|
||||
recursionMergeJob(jobsByPid, parentCompany, ecCompany, parentDepartment, ecDepartment, parentJob);
|
||||
recursionMergeJob(jobsByPid, ecCompany, ecDepartment, parentJob);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -724,13 +694,11 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
*/
|
||||
private boolean isFilter(JobPO jobPO) {
|
||||
return !(StringUtil.isEmpty(jobPO.getJobNo())
|
||||
&& StringUtil.isEmpty(jobPO.getJobName())
|
||||
&& StringUtil.isEmpty(jobPO.getJobTitleName())
|
||||
&& StringUtil.isEmpty(jobPO.getWorkplace())
|
||||
&& StringUtil.isEmpty(jobPO.getDescription())
|
||||
&& StringUtil.isEmpty(jobPO.getWorkDuty())
|
||||
&& StringUtil.isEmpty(jobPO.getWorkAuthority())
|
||||
&& null == jobPO.getParentComp()
|
||||
&& null == jobPO.getParentDept()
|
||||
&& null == jobPO.getParentJob()
|
||||
&& null == jobPO.getSequenceId()
|
||||
&& null == jobPO.getSchemeId()
|
||||
|
|
@ -738,6 +706,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
&& null == jobPO.getForbiddenTag()
|
||||
&& null == jobPO.getEcCompany()
|
||||
&& null == jobPO.getEcDepartment()
|
||||
&& null == jobPO.getEcJobTitle()
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -787,95 +756,19 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新EC岗位
|
||||
*
|
||||
* @param jobPO
|
||||
*/
|
||||
private void updateEcJob(JobPO jobPO, String newName) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("job_name", newName);
|
||||
params.put("jobactivityid", JOB_ACTIVITY_ID);
|
||||
params.put("work_duty", jobPO.getWorkDuty());
|
||||
params.put("work_authority", jobPO.getWorkAuthority());
|
||||
params.put("description", jobPO.getDescription());
|
||||
params.put("job_no", jobPO.getJobNo());
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.UPDATE, params, jobPO).sync();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断相同层级下有无同名岗位
|
||||
*/
|
||||
public static void assertNameRepeat(Long jobId, Integer departmentId, Long parentJobId, String jobName) {
|
||||
assertNameRepeat(jobId, departmentId, parentJobId, jobName, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断相同层级下有无同名岗位
|
||||
*/
|
||||
public static boolean assertNameRepeat(String jobId, String departmentId, String parentJobId, String jobName) {
|
||||
return assertNameRepeat(StringUtils.isBlank(jobId) ? null : Long.parseLong(jobId), StringUtils.isBlank(departmentId) ? null : Integer.parseInt(departmentId), StringUtils.isBlank(parentJobId) ? null : Long.parseLong(parentJobId), jobName, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断相同层级下有无同名岗位
|
||||
*
|
||||
* @param jobId
|
||||
* @param departmentId
|
||||
* @param parentJobId
|
||||
* @param jobName
|
||||
* @param throwException
|
||||
* @return
|
||||
*/
|
||||
public static boolean assertNameRepeat(Long jobId, Integer departmentId, Long parentJobId, String jobName, boolean throwException) {
|
||||
int count;
|
||||
// 有上级岗位、判断相同层级下有无相同名称岗位
|
||||
if (null != jobId) {
|
||||
count = getJobMapper().countRepeatNameByPid(jobName, jobId, parentJobId, departmentId);
|
||||
} else {
|
||||
// 无上级岗位,判断当前部门下,有无同名岗位
|
||||
count = getJobMapper().countRepeatNameByPid(jobName, jobId, null, departmentId);
|
||||
}
|
||||
if (throwException) {
|
||||
OrganizationAssert.isTrue(count == 0, "岗位名称已存在");
|
||||
}
|
||||
return count == 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更新人员岗位信息
|
||||
*
|
||||
* @param originalJob
|
||||
* @param targetJob
|
||||
*/
|
||||
private void updateResourceJob(JobPO originalJob, JobPO targetJob) {
|
||||
// 更新岗位下的人员
|
||||
Long originalJobId = originalJob.getId();
|
||||
Long targetJobId = targetJob.getId();
|
||||
Integer parentComp = targetJob.getParentComp();
|
||||
Integer parentDept = targetJob.getParentDept();
|
||||
Integer ecCompany = targetJob.getEcCompany();
|
||||
Integer ecDepartment = targetJob.getEcDepartment();
|
||||
List<HrmResourcePO> resourceList = getResourceMapper().getResourceListByJobId(originalJobId);
|
||||
getResourceMapper().updateResourceJob(originalJobId, targetJobId, parentComp, parentDept, ecCompany, ecDepartment);
|
||||
|
||||
// 更新Ec人员分部、部门、岗位
|
||||
for (HrmResourcePO hrmResourcePO : resourceList) {
|
||||
new RecordSet().executeUpdate("UPDATE HRMRESOURCE SET SUBCOMPANYID1 = ? , DEPARTMENTID = ? WHERE UUID =? ", ecCompany, ecDepartment, hrmResourcePO.getUuid());
|
||||
// 更新人员Map表信息
|
||||
new HrmResourceTriggerRunnable(hrmResourcePO.getId()).run();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更新人员岗位信息
|
||||
*
|
||||
* @param job
|
||||
*/
|
||||
private void updateResourceJob(JobPO job) {
|
||||
updateResourceJob(job, job);
|
||||
}
|
||||
///**
|
||||
// * 更新EC岗位
|
||||
// *
|
||||
// * @param jobPO
|
||||
// */
|
||||
//private void updateEcJob(JobPO jobPO, String newName) {
|
||||
// Map<String, Object> params = new HashMap<>();
|
||||
// params.put("job_name", newName);
|
||||
// params.put("jobactivityid", JOB_ACTIVITY_ID);
|
||||
// params.put("work_duty", jobPO.getWorkDuty());
|
||||
// params.put("work_authority", jobPO.getWorkAuthority());
|
||||
// params.put("description", jobPO.getDescription());
|
||||
// params.put("job_no", jobPO.getJobNo());
|
||||
// new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.UPDATE, params, jobPO).sync();
|
||||
//}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -448,9 +448,9 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
OrganizationAssert.notNull(staffPO.getJobId(), "编制维度选择岗位时,岗位必填!");
|
||||
JobPO jobById = getJobMapper().getJobById(staffPO.getJobId());
|
||||
if (null != jobById) {
|
||||
staffPO.setDeptId(jobById.getParentDept());
|
||||
staffPO.setDeptId(jobById.getEcDepartment());
|
||||
staffPO.setEcDepartment(jobById.getEcDepartment());
|
||||
staffPO.setCompId(jobById.getParentComp());
|
||||
staffPO.setCompId(jobById.getEcCompany());
|
||||
staffPO.setEcCompany(jobById.getEcCompany());
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1,27 +1,20 @@
|
|||
package com.engine.organization.thread;
|
||||
|
||||
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.commom.RecordInfo;
|
||||
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.hrmresource.SystemDataMapper;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.util.OrganizationAssert;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import com.engine.organization.util.relation.EcHrmRelationUtil;
|
||||
import com.engine.organization.util.relation.ResourceSyncUtil;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
|
|
@ -81,9 +74,6 @@ public class OrganizationSyncEc {
|
|||
case DEPARTMENT:
|
||||
refreshDepartment();
|
||||
break;
|
||||
case JOB:
|
||||
refreshJob();
|
||||
break;
|
||||
case RESOURCE:
|
||||
refreshResource();
|
||||
default:
|
||||
|
|
@ -134,21 +124,6 @@ public class OrganizationSyncEc {
|
|||
}
|
||||
}
|
||||
|
||||
private void refreshJob() {
|
||||
switch (operateType) {
|
||||
case ADD:
|
||||
addJob();
|
||||
break;
|
||||
case UPDATE:
|
||||
updateJob();
|
||||
break;
|
||||
case CANCELED:
|
||||
cancelJob();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshResource() {
|
||||
switch (operateType) {
|
||||
|
|
@ -175,173 +150,6 @@ public class OrganizationSyncEc {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增岗位
|
||||
*
|
||||
* <p>
|
||||
* 1、EC表HrmJobTitles
|
||||
* <p>
|
||||
* 2、系统中新建“聚才林”、“默认职务”(sql写入)
|
||||
* <p>
|
||||
* 3、检索岗位名称jobtitlename,如果已存在,判断是否封存,对已封存数据解封操作
|
||||
* <p>
|
||||
* 4、如果不存在,在“聚才林--默认职务”下新建岗位
|
||||
*/
|
||||
private void addJob() {
|
||||
// 判断是否存在同名岗位、存在不做处理,不存在,在“默认职务分类--默认职务”下新建岗位
|
||||
String jobName = Util.null2String(params.get("job_name"));
|
||||
RecordInfo hrmJobActivity = getSystemDataMapper().getHrmJobTitleByName(jobName);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
//存在且已封存,对岗位解封
|
||||
if (null != hrmJobActivity) {
|
||||
map.put("ids", hrmJobActivity.getId());
|
||||
map.put("canceled", "docanceled");
|
||||
this.resultMap = 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")));
|
||||
|
||||
this.resultMap = 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"));
|
||||
if (newName.equals(oldName)) {
|
||||
this.resultMap = new HashMap<>();
|
||||
this.resultMap.put("sign", "1");
|
||||
return;
|
||||
}
|
||||
RecordInfo oldHrmJobTitle = getSystemDataMapper().getHrmJobTitleByName(oldName);
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
// 修改前不存在共用
|
||||
if (EcHrmRelationUtil.isNotExistJob(oldName, jclJobId)) {
|
||||
// 修改后不存在共用、直接修改EC岗位表数据
|
||||
if (EcHrmRelationUtil.isNotExistJob(newName, jclJobId)) {
|
||||
// 查询ec表ID
|
||||
RecordInfo hrmJobTitle = getSystemDataMapper().getHrmJobTitleByName(newName);
|
||||
if (null != hrmJobTitle) {
|
||||
map.put("id", Util.null2String(hrmJobTitle.getId()));
|
||||
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")) + "_" + System.currentTimeMillis());
|
||||
// 修改岗位表数据
|
||||
this.resultMap = ServiceUtil.getService(HrmJobServiceImpl.class, user).editJobTitle(map, user);
|
||||
} else {
|
||||
// 不存在则新建职务
|
||||
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")) + "_" + System.currentTimeMillis());
|
||||
this.resultMap = ServiceUtil.getService(HrmJobServiceImpl.class, user).addJobTitle(map, user);
|
||||
}
|
||||
} else {
|
||||
// 修改后存在共用、不修改岗位表数据,更新对应人员的岗位信息为当前岗位的ID
|
||||
RecordInfo hrmJobTitle = getSystemDataMapper().getHrmJobTitleByName(newName);
|
||||
// 查询原分部、原岗位下的人员,并更新岗位ID
|
||||
List<Long> hrmResourceIds = getSystemDataMapper().getHrmResourceIds(oldJobPO.getParentDept(), oldHrmJobTitle.getId());
|
||||
if (CollectionUtils.isNotEmpty(hrmResourceIds)) {
|
||||
getSystemDataMapper().updateResourceJobTitleByIds(Util.null2String(hrmJobTitle.getId()), hrmResourceIds);
|
||||
}
|
||||
// 封存原名称岗位
|
||||
map.put("ids", oldHrmJobTitle.getId());
|
||||
map.put("canceled", "canceled");
|
||||
this.resultMap = ServiceUtil.getService(HrmJobServiceImpl.class, user).doCanceled(map, user);
|
||||
}
|
||||
} else {
|
||||
// 修改前存在共用,不对原有数据进行操作。
|
||||
|
||||
// 修改后不存在共用、新建岗位,更新原有岗位下人员的岗位ID
|
||||
if (EcHrmRelationUtil.isNotExistJob(newName, jclJobId)) {
|
||||
RecordInfo hrmJobActivity = getSystemDataMapper().getHrmJobTitleByName(newName);
|
||||
//存在且已封存,对岗位解封
|
||||
if (null != hrmJobActivity) {
|
||||
map.put("ids", hrmJobActivity.getId());
|
||||
map.put("canceled", "docanceled");
|
||||
this.resultMap = ServiceUtil.getService(HrmJobServiceImpl.class, user).doCanceled(map, user);
|
||||
} else {
|
||||
// 不存在则新建职务
|
||||
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")));
|
||||
|
||||
this.resultMap = ServiceUtil.getService(HrmJobServiceImpl.class, user).addJobTitle(map, user);
|
||||
}
|
||||
} else {
|
||||
this.resultMap = new HashMap<>();
|
||||
this.resultMap.put("sign", "1");
|
||||
}
|
||||
// 查询原分部、原岗位下的人员,并更新岗位ID
|
||||
RecordInfo hrmJobTitle = getSystemDataMapper().getHrmJobTitleByName(newName);
|
||||
List<Long> hrmResourceIds = getSystemDataMapper().getHrmResourceIds(oldJobPO.getParentDept(), oldHrmJobTitle.getId());
|
||||
if (CollectionUtils.isNotEmpty(hrmResourceIds)) {
|
||||
getSystemDataMapper().updateResourceJobTitleByIds(Util.null2String(hrmJobTitle.getId()), hrmResourceIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 封存、解封岗位
|
||||
*/
|
||||
private void cancelJob() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
RecordInfo hrmJobTitleByName = getSystemDataMapper().getHrmJobTitleByName(oldJobPO.getJobName());
|
||||
if (null == hrmJobTitleByName) {
|
||||
return;
|
||||
}
|
||||
if (0 == oldJobPO.getForbiddenTag()) {
|
||||
// 启用
|
||||
map.put("ids", hrmJobTitleByName.getId());
|
||||
map.put("canceled", "docanceled");
|
||||
this.resultMap = 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.getId());
|
||||
map.put("canceled", "canceled");
|
||||
this.resultMap = 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.getId());
|
||||
map.put("canceled", "canceled");
|
||||
this.resultMap = ServiceUtil.getService(HrmJobServiceImpl.class, user).doCanceled(map, user);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增部门
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public class StaffTriggerRunnable implements Runnable {
|
|||
if (null != jclJobId) {
|
||||
JobPO jobById = getJobMapper().getJobById((long) jclJobId);
|
||||
if (null != jobById) {
|
||||
this.staffPO = StaffPO.builder().compId(jobById.getParentComp()).deptId(jobById.getParentDept()).jobId(jobById.getId()).build();
|
||||
this.staffPO = StaffPO.builder().compId(jobById.getEcCompany()).deptId(jobById.getEcDepartment()).jobId(jobById.getId()).build();
|
||||
this.staffPlanByID = StaffPlanPO.builder().controlDimension("3").build();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
package com.engine.organization.transmethod;
|
||||
|
||||
import com.engine.organization.entity.job.bo.JobBO;
|
||||
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 weaver.hrm.User;
|
||||
|
||||
|
|
@ -21,8 +21,9 @@ public class HrmResourceTransMethod {
|
|||
public static String getCompanyName(String companyId) {
|
||||
return MapperProxyFactory.getProxy(CompMapper.class).listById(Integer.parseInt(companyId)).getSubCompanyName();
|
||||
}
|
||||
|
||||
public static String getJobName(String jobTitle) {
|
||||
return MapperProxyFactory.getProxy(JobMapper.class).getJobById(Long.parseLong(jobTitle)).getJobName();
|
||||
return JobBO.getJobTitleNameByEcJobTitle(jobTitle);
|
||||
}
|
||||
|
||||
public static String getManagerName(String managerId) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.organization.transmethod;
|
||||
|
||||
import com.engine.organization.entity.DeleteParam;
|
||||
import com.engine.organization.entity.job.po.JobPO;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.mapper.scheme.GradeMapper;
|
||||
import com.engine.organization.mapper.scheme.LevelMapper;
|
||||
|
|
@ -20,18 +21,16 @@ import java.util.stream.Collectors;
|
|||
*/
|
||||
public class JobTransMethod {
|
||||
|
||||
public static String getSpanById(String planId) {
|
||||
public static String getSpanById(String jobId) {
|
||||
JobMapper jobMapper = MapperProxyFactory.getProxy(JobMapper.class);
|
||||
List<Map<String, Object>> maps = jobMapper.listJobsByIds(DeleteParam.builder().ids(planId).build().getIds());
|
||||
String names = maps.stream().map(item -> (String) item.get("name")).collect(Collectors.joining(","));
|
||||
return names;
|
||||
List<JobPO> jobsByIds = jobMapper.getJobsByIds(DeleteParam.builder().ids(jobId).build().getIds());
|
||||
return jobsByIds.stream().map(JobPO::getJobTitleName).collect(Collectors.joining(","));
|
||||
}
|
||||
|
||||
public static String getLevelName(String levelId) {
|
||||
LevelMapper levelMapper = MapperProxyFactory.getProxy(LevelMapper.class);
|
||||
List<Map<String, Object>> maps = levelMapper.listLevelsByIds(DeleteParam.builder().ids(levelId).build().getIds());
|
||||
String levelName = maps.stream().map(item -> (String) item.get("name")).collect(Collectors.joining(","));
|
||||
return levelName;
|
||||
return maps.stream().map(item -> (String) item.get("name")).collect(Collectors.joining(","));
|
||||
}
|
||||
|
||||
public static String getGradeName(String gradeId) {
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public class DetachUtil {
|
|||
*/
|
||||
public void filterJobList(List<JobPO> jobList) {
|
||||
if (DETACH && CollectionUtils.isNotEmpty(jobList)) {
|
||||
jobList.removeIf(item -> !jclRoleLevels.contains(item.getParentComp()));
|
||||
jobList.removeIf(item -> !jclRoleLevels.contains(item.getEcCompany()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,9 @@
|
|||
package com.engine.organization.util.relation;
|
||||
|
||||
import com.engine.organization.entity.commom.RecordInfo;
|
||||
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 java.util.List;
|
||||
import weaver.general.Util;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
|
|
@ -18,22 +12,6 @@ import java.util.List;
|
|||
*/
|
||||
public class EcHrmRelationUtil {
|
||||
|
||||
private static final String HRM_COMPANY = "hrmsubcompany";
|
||||
private static final String HRM_DEPARTMENT = "hrmdepartment";
|
||||
|
||||
|
||||
private static SystemDataMapper getSystemDataMapper() {
|
||||
return MapperProxyFactory.getProxy(SystemDataMapper.class);
|
||||
}
|
||||
|
||||
private static CompMapper getCompMapper() {
|
||||
return MapperProxyFactory.getProxy(CompMapper.class);
|
||||
}
|
||||
|
||||
private static DepartmentMapper getDepartmentMapper() {
|
||||
return MapperProxyFactory.getProxy(DepartmentMapper.class);
|
||||
}
|
||||
|
||||
private static JobMapper getJobMapper() {
|
||||
return MapperProxyFactory.getProxy(JobMapper.class);
|
||||
}
|
||||
|
|
@ -43,37 +21,9 @@ public class EcHrmRelationUtil {
|
|||
if (null == jobById) {
|
||||
return "";
|
||||
}
|
||||
RecordInfo hrmJobTitleByName = MapperProxyFactory.getProxy(SystemDataMapper.class).getHrmJobTitleByName(jobById.getJobName());
|
||||
if (null == hrmJobTitleByName) {
|
||||
return "";
|
||||
}
|
||||
return hrmJobTitleByName.getId();
|
||||
|
||||
return Util.null2String(jobById.getEcJobTitle());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断岗位名称是否共用
|
||||
* <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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -273,9 +273,9 @@ public class StaffInfoImportUtil {
|
|||
if (null == jobPO) {
|
||||
checkMsg = "未找到对应岗位!";
|
||||
} else {
|
||||
param.setCompId(jobPO.getParentComp());
|
||||
param.setCompId(jobPO.getEcCompany());
|
||||
param.setEcCompany(jobPO.getEcCompany());
|
||||
param.setDeptId(jobPO.getParentDept());
|
||||
param.setDeptId(jobPO.getEcDepartment());
|
||||
param.setEcDepartment(jobPO.getEcDepartment());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,14 +11,11 @@ import com.engine.organization.entity.job.param.JobMergeParam;
|
|||
import com.engine.organization.entity.job.param.JobSearchParam;
|
||||
import com.engine.organization.entity.job.po.JobPO;
|
||||
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
||||
import com.engine.organization.entity.staff.po.StaffPO;
|
||||
import com.engine.organization.enums.LogModuleNameEnum;
|
||||
import com.engine.organization.enums.OperateTypeEnum;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.mapper.staff.StaffMapper;
|
||||
import com.engine.organization.service.JobService;
|
||||
import com.engine.organization.service.impl.JobServiceImpl;
|
||||
import com.engine.organization.thread.JobTriggerRunnable;
|
||||
import com.engine.organization.util.MenuBtn;
|
||||
import com.engine.organization.util.OrganizationFormItemUtil;
|
||||
import com.engine.organization.util.OrganizationWrapper;
|
||||
|
|
@ -116,7 +113,7 @@ public class JobWrapper extends OrganizationWrapper {
|
|||
writeOperateLog(new Object() {
|
||||
}.getClass(), params.get("job_name").toString(), JSON.toJSONString(params), "新增岗位");
|
||||
// 更新组织架构图
|
||||
new Thread(new JobTriggerRunnable(jobId)).start();
|
||||
//TODO new Thread(new JobTriggerRunnable(jobId)).start();
|
||||
return jobId;
|
||||
}
|
||||
|
||||
|
|
@ -133,7 +130,7 @@ public class JobWrapper extends OrganizationWrapper {
|
|||
Long jobId = getJobService(user).updateForm(params);
|
||||
JobPO newJobById = getJobMapper().getJobById(id);
|
||||
writeOperateLog(new Object() {
|
||||
}.getClass(), jobById.getJobName(), JSON.toJSONString(params), jobById, newJobById);
|
||||
}.getClass(), jobById.getJobTitleName(), JSON.toJSONString(params), jobById, newJobById);
|
||||
// 更新组织架构图
|
||||
|
||||
return jobId;
|
||||
|
|
@ -151,7 +148,7 @@ public class JobWrapper extends OrganizationWrapper {
|
|||
int copyJobItem = getJobService(user).copyJobItem(param.getIds(), param.getDepartment());
|
||||
for (JobPO jobPO : jobPOS) {
|
||||
writeOperateLog(new Object() {
|
||||
}.getClass(), jobPO.getJobName(), JSON.toJSONString(param), "复制岗位[" + jobPO.getJobName() + "]");
|
||||
}.getClass(), jobPO.getJobTitleName(), JSON.toJSONString(param), "复制岗位[" + jobPO.getJobTitleName() + "]");
|
||||
}
|
||||
return copyJobItem;
|
||||
}
|
||||
|
|
@ -171,7 +168,7 @@ public class JobWrapper extends OrganizationWrapper {
|
|||
}.getClass(), jobById.getJobNo(), JSON.toJSONString(params), jobById, newJobById);
|
||||
|
||||
// 更新组织架构图
|
||||
new Thread(new JobTriggerRunnable(jobById, newJobById)).start();
|
||||
//TODO new Thread(new JobTriggerRunnable(jobById, newJobById)).start();
|
||||
return updateForbiddenTagById;
|
||||
}
|
||||
|
||||
|
|
@ -187,9 +184,9 @@ public class JobWrapper extends OrganizationWrapper {
|
|||
int deleteByIds = getJobService(user).deleteByIds(ids);
|
||||
for (JobPO jobPO : jobPOS) {
|
||||
writeOperateLog(new Object() {
|
||||
}.getClass(), jobPO.getJobName(), JSON.toJSONString(ids), "删除岗位");
|
||||
}.getClass(), jobPO.getJobTitleName(), JSON.toJSONString(ids), "删除岗位");
|
||||
// 更新组织架构图
|
||||
new JobTriggerRunnable(jobPO).run();
|
||||
// TODO new JobTriggerRunnable(jobPO).run();
|
||||
}
|
||||
return deleteByIds;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue