Merge pull request '岗位刷新功能' (#100) from feature/cl into develop
Reviewed-on: http://221.226.25.34:3000/liang.cheng/weaver-hrm-organization/pulls/100
This commit is contained in:
commit
afa66c74c1
|
|
@ -0,0 +1,29 @@
|
|||
package com.engine.organization.entity.hrmresource.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/12/15
|
||||
* @Version V1.0
|
||||
**/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ResourcePO {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Integer subcompanyid1;
|
||||
|
||||
private Integer departmentid;
|
||||
|
||||
private Integer jobtitle;
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.organization.mapper.job;
|
||||
|
||||
import com.engine.organization.entity.hrmresource.po.ResourcePO;
|
||||
import com.engine.organization.entity.job.dto.JobListDTO;
|
||||
import com.engine.organization.entity.job.po.JobPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -141,5 +142,5 @@ public interface JobMapper {
|
|||
|
||||
int updateJobCompany(@Param("ids") Collection<Long> ids, @Param("parentCompany") Integer parentCompany, @Param("ecCompany") Integer ecCompany);
|
||||
|
||||
|
||||
int selectByConditions(@Param("resourcePO") ResourcePO resourcePO);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
<result column="ec_jobTitle" property="ecJobTitle"/>
|
||||
<result column="ec_company" property="ecCompany"/>
|
||||
<result column="ec_department" property="ecDepartment"/>
|
||||
<result column="ec_jobTitle" property="ecJobTitle"/>
|
||||
<result column="sequence_id" property="sequenceId"/>
|
||||
<result column="scheme_id" property="schemeId"/>
|
||||
<result column="parent_job" property="parentJob"/>
|
||||
|
|
@ -104,6 +105,9 @@
|
|||
<if test="ecDepartment != null ">
|
||||
ec_department,
|
||||
</if>
|
||||
<if test="ecJobTitle != null ">
|
||||
ec_jobTitle,
|
||||
</if>
|
||||
forbidden_tag,
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
|
|
@ -155,6 +159,9 @@
|
|||
<if test="ecDepartment != null ">
|
||||
#{ecDepartment},
|
||||
</if>
|
||||
<if test="ecJobTitle != null ">
|
||||
#{ecJobTitle},
|
||||
</if>
|
||||
0,
|
||||
</trim>
|
||||
</insert>
|
||||
|
|
@ -214,6 +221,9 @@
|
|||
<if test="ecDepartment != null ">
|
||||
ec_department,
|
||||
</if>
|
||||
<if test="ecJobTitle != null ">
|
||||
ec_jobTitle,
|
||||
</if>
|
||||
forbidden_tag,
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
|
|
@ -265,6 +275,9 @@
|
|||
<if test="ecDepartment != null ">
|
||||
#{ecDepartment},
|
||||
</if>
|
||||
<if test="ecJobTitle != null ">
|
||||
#{ecJobTitle},
|
||||
</if>
|
||||
0,
|
||||
</trim>
|
||||
</insert>
|
||||
|
|
@ -450,6 +463,14 @@
|
|||
select max(show_order)
|
||||
from jcl_org_job
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectByConditions" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from jcl_org_job where ec_company = #{resourcePO.subcompanyid1} and ec_department = #{resourcePO.departmentid}
|
||||
and ec_jobtitle = #{resourcePO.jobtitle}
|
||||
</select>
|
||||
|
||||
<select id="getIdByNameAndPid" resultType="java.lang.Long">
|
||||
select
|
||||
t.id
|
||||
|
|
@ -474,6 +495,8 @@
|
|||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<update id="updateJobCompany">
|
||||
update jcl_org_job
|
||||
<set>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
package com.engine.organization.mapper.resource;
|
||||
|
||||
import com.engine.organization.entity.hrmresource.po.ResourcePO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/12/15
|
||||
* @Version V1.0
|
||||
**/
|
||||
public interface HrmResourceMapper {
|
||||
|
||||
List<ResourcePO> selectFilterDatas();
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<?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.resource.HrmResourceMapper">
|
||||
<resultMap id="HrmResourceMap" type="com.engine.organization.entity.hrmresource.po.ResourcePO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="subcompanyid1" property="subcompanyid1"/>
|
||||
<result column="departmentid" property="departmentid"/>
|
||||
<result column="jobtitle" property="jobtitle"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectFilterDatas" resultType="com.engine.organization.entity.hrmresource.po.ResourcePO">
|
||||
SELECT DISTINCT subcompanyid1,departmentid,jobtitle from hrmresource
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -37,4 +37,6 @@ public interface ResourceMapper {
|
|||
* @return
|
||||
*/
|
||||
List<Long> getIdByKeyField(@Param("keyField") String keyField, @Param("keyFieldValue") String keyFieldValue);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ 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.ResourcePO;
|
||||
import com.engine.organization.entity.job.bo.JobBO;
|
||||
import com.engine.organization.entity.job.dto.JobListDTO;
|
||||
import com.engine.organization.entity.job.param.JobMergeParam;
|
||||
|
|
@ -28,6 +29,7 @@ import com.engine.organization.entity.job.po.JobPO;
|
|||
import com.engine.organization.entity.scheme.po.GradePO;
|
||||
import com.engine.organization.entity.searchtree.SearchTree;
|
||||
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
||||
import com.engine.organization.enums.DeleteTypeEnum;
|
||||
import com.engine.organization.exception.OrganizationRunTimeException;
|
||||
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
|
||||
import com.engine.organization.mapper.comp.CompMapper;
|
||||
|
|
@ -36,6 +38,8 @@ import com.engine.organization.mapper.extend.ExtDTMapper;
|
|||
import com.engine.organization.mapper.extend.ExtMapper;
|
||||
import com.engine.organization.mapper.extend.ExtendTitleMapper;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.mapper.resource.HrmResourceMapper;
|
||||
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;
|
||||
|
|
@ -121,6 +125,10 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
return ServiceUtil.getService(ExtServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private HrmResourceMapper getHrmResourceMapper() {
|
||||
return MapperProxyFactory.getProxy(HrmResourceMapper.class);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -190,7 +198,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
ArrayList<MenuBtn> rightMenuList = new ArrayList<>();
|
||||
// 批量删除
|
||||
topMenuList.add(MenuBtn.topMenu_batchDelete());
|
||||
topMenuList.add(MenuBtn.builder().isBatch("0").isTop("1").menuFun("refresh").menuIcon("icon-coms-Refresh").menuName("新增").type("BTN_REFRESH").build());
|
||||
topMenuList.add(MenuBtn.builder().isBatch("0").isTop("1").menuFun("refresh").menuIcon("icon-coms-Refresh").menuName("刷新").type("BTN_REFRESH").build());
|
||||
btnDatas.put("topMenu", topMenuList);
|
||||
// 日志
|
||||
rightMenuList.add(MenuBtn.rightMenu_btnLog());
|
||||
|
|
@ -567,6 +575,26 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
|
||||
@Override
|
||||
public void refresh() {
|
||||
//1.人员表查询
|
||||
List<ResourcePO> resourcePOS = getHrmResourceMapper().selectFilterDatas();
|
||||
//2.数据过滤
|
||||
//3.数据插入
|
||||
resourcePOS.forEach(resourcePO -> {
|
||||
if (Objects.nonNull(resourcePO)) {
|
||||
int count = getJobMapper().selectByConditions(resourcePO);
|
||||
if (count == 0) {
|
||||
JobPO jobPO = JobPO.builder()
|
||||
.ecCompany(resourcePO.getSubcompanyid1())
|
||||
.ecDepartment(resourcePO.getDepartmentid())
|
||||
.ecJobTitle(resourcePO.getJobtitle())
|
||||
.deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
|
||||
.createTime(new Date())
|
||||
.updateTime(new Date())
|
||||
.build();
|
||||
getJobMapper().insertIgnoreNull(jobPO);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue