人员Mapper整合

pull/73/head
dxfeng 3 years ago
parent 7d1fc84fad
commit ae2e5bb5a4

@ -1,51 +0,0 @@
package com.engine.organization.mapper.hrmresource;
import org.apache.ibatis.annotations.Param;
/**
* @description:
* @author:dxfeng
* @createTime: 2022/05/20
* @version: 1.0
*/
public interface HrmResourceMapper {
/**
* ID
*
* @return
*/
Long getMaxId();
Long getMaxShowOrder();
/**
* ID
*
* @param id
* @return
*/
String getLastNameById(@Param("id") Long id);
/**
* ID
*
* @param keyField
* @param keyFieldValue
* @return
*/
Long getIdByKeyField(@Param("keyField") String keyField, @Param("keyFieldValue") String keyFieldValue);
///**
// * 根据所选关键字段,查询关键列
// *
// * @param keyField
// * @return
// */
//List<JSONObject> getKeyMapByKetField(@Param("keyField") String keyField);
String getEcResourceId(@Param("jclResourceId") String jclResourceId);
Long getJclResourceId(@Param("ecResourceId") String ecResourceId);
}

@ -1,61 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.engine.organization.mapper.hrmresource.HrmResourceMapper">
<resultMap id="BaseResultMap" type="com.engine.organization.entity.hrmresource.po.HrmResourcePO">
<result column="id" property="id"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<!-- 表字段 -->
<sql id="baseColumns">
t
.
id
, t.creator
, t.delete_type
, t.create_time
, t.update_time
</sql>
<select id="getMaxId" resultType="java.lang.Long">
select max(id)
from jcl_org_hrmresource
</select>
<select id="getLastNameById" resultType="java.lang.String">
select last_name
from jcl_org_hrmresource
where delete_type = 0
and id = #{id}
</select>
<select id="getIdByKeyField" resultType="java.lang.Long">
select id
from jcl_org_hrmresource
where delete_type = 0
and ${keyField} = #{keyFieldValue}
</select>
<select id="getEcResourceId" resultType="java.lang.String">
select a.id
from hrmresource a
inner join jcl_org_hrmresource b on a.uuid = b.uuid
where b.id = #{jclResourceId}
</select>
<select id="getJclResourceId" resultType="java.lang.Long">
select a.id
from jcl_org_hrmresource a
inner join hrmresource b on a.uuid = b.uuid
where b.id = #{ecResourceId}
</select>
<select id="getMaxShowOrder" resultType="java.lang.Long">
select max(show_order)
from jcl_org_hrmresource
</select>
<!-- <select id="getKeyMapByKetField" resultType="com.alibaba.fastjson.JSONObject">-->
<!-- select id, account_type, certificate_num, login_id, work_code, ${keyField}-->
<!-- from jcl_org_hrmresource-->
<!-- </select>-->
</mapper>

@ -15,7 +15,7 @@ import java.util.List;
**/
public interface ResourceMapper {
List<HrmResourceVO> listAll(@Param("ids")List<Long> ids);
List<HrmResourceVO> listAll(@Param("ids") List<Long> ids);
List<HrmResourceVO> listDetachAll(@Param("ids") List<Long> ids, @Param("companyIds") List<Long> companyIds);
@ -26,4 +26,20 @@ public interface ResourceMapper {
HrmResourcePO getResourceById(@Param("id") String id);
List<HrmResourcePO> listByNo(@Param("workCode") String workCode);
Long getMaxShowOrder();
/**
* ID
*
* @param keyField
* @param keyFieldValue
* @return
*/
Long getIdByKeyField(@Param("keyField") String keyField, @Param("keyFieldValue") String keyFieldValue);
String getEcResourceId(@Param("jclResourceId") String jclResourceId);
Long getJclResourceId(@Param("ecResourceId") String ecResourceId);
}

@ -128,6 +128,32 @@
order by t.show_order asc;
</select>
<select id="getMaxShowOrder" resultType="java.lang.Long">
select max(show_order)
from jcl_org_hrmresource
</select>
<select id="getIdByKeyField" resultType="java.lang.Long">
select id
from jcl_org_hrmresource
where delete_type = 0
and ${keyField} = #{keyFieldValue}
</select>
<select id="getEcResourceId" resultType="java.lang.String">
select a.id
from hrmresource a
inner join jcl_org_hrmresource b on a.uuid = b.uuid
where b.id = #{jclResourceId}
</select>
<select id="getJclResourceId" resultType="java.lang.Long">
select a.id
from jcl_org_hrmresource a
inner join hrmresource b on a.uuid = b.uuid
where b.id = #{ecResourceId}
</select>
<sql id="likeSql">
<if test="param.lastName != null and param.lastName != ''">
AND t.last_name like CONCAT('%',#{param.lastName},'%')

@ -16,8 +16,8 @@ import com.engine.organization.entity.personnelcard.po.CardButtonPO;
import com.engine.organization.enums.ModuleTypeEnum;
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
import com.engine.organization.mapper.extend.*;
import com.engine.organization.mapper.hrmresource.HrmResourceMapper;
import com.engine.organization.mapper.personnelcard.CardButtonMapper;
import com.engine.organization.mapper.resource.ResourceMapper;
import com.engine.organization.service.ExtService;
import com.engine.organization.util.OrganizationAssert;
import com.engine.organization.util.db.DBType;
@ -74,7 +74,7 @@ public class ExtServiceImpl extends Service implements ExtService {
}
List<String> readOnlyFieldList = new ArrayList<>(Arrays.asList(readOnlyFields));
if ("4".equals(extendType) && noEditRight(user)) {
String ecResourceId = MapperProxyFactory.getProxy(HrmResourceMapper.class).getEcResourceId(String.valueOf(id));
String ecResourceId = MapperProxyFactory.getProxy(ResourceMapper.class).getEcResourceId(String.valueOf(id));
if (Util.null2String(user.getUID()).equals(ecResourceId)) {
List<String> readOnlyList = infoPOList.stream().filter(item -> !"1".equals(Util.null2String(item.getIsModify()))).map(ExtendInfoPO::getFieldName).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(readOnlyList)) {
@ -162,7 +162,7 @@ public class ExtServiceImpl extends Service implements ExtService {
boolean checkRight = true;
if (2 == viewAttr && "4".equals(extendType) && noEditRight(user)) {
checkRight = false;
String ecResourceId = MapperProxyFactory.getProxy(HrmResourceMapper.class).getEcResourceId(String.valueOf(id));
String ecResourceId = MapperProxyFactory.getProxy(ResourceMapper.class).getEcResourceId(String.valueOf(id));
if (Util.null2String(user.getUID()).equals(ecResourceId)) {
infoPOList.removeIf(item -> !"1".equals(Util.null2String(item.getIsModify())));
} else {

@ -18,10 +18,10 @@ import com.engine.organization.mapper.extend.ExtMapper;
import com.engine.organization.mapper.extend.ExtendGroupMapper;
import com.engine.organization.mapper.extend.ExtendInfoMapper;
import com.engine.organization.mapper.extend.ExtendTitleMapper;
import com.engine.organization.mapper.hrmresource.HrmResourceMapper;
import com.engine.organization.mapper.personnelcard.CardAccessMapper;
import com.engine.organization.mapper.personnelcard.CardButtonMapper;
import com.engine.organization.mapper.personnelcard.PersonnelCardMapper;
import com.engine.organization.mapper.resource.ResourceMapper;
import com.engine.organization.service.HrmPersonnelCardService;
import com.engine.organization.util.OrganizationAssert;
import com.engine.organization.util.db.DBType;
@ -71,8 +71,8 @@ public class HrmPersonnelCardServiceImpl extends Service implements HrmPersonnel
return MapperProxyFactory.getProxy(ExtMapper.class);
}
private HrmResourceMapper getHrmResourceMapper() {
return MapperProxyFactory.getProxy(HrmResourceMapper.class);
private ResourceMapper getResourceMapper() {
return MapperProxyFactory.getProxy(ResourceMapper.class);
}
private CardButtonMapper getCardButtonMapper() {
@ -85,9 +85,9 @@ public class HrmPersonnelCardServiceImpl extends Service implements HrmPersonnel
Map<String, Object> resultMap = new HashMap<>();
UserCard userInfo;
if (null == uId) {
uId = getHrmResourceMapper().getJclResourceId(Util.null2String(user.getUID()));
uId = getResourceMapper().getJclResourceId(Util.null2String(user.getUID()));
}
String ecResourceId = getHrmResourceMapper().getEcResourceId(uId.toString());
String ecResourceId = getResourceMapper().getEcResourceId(uId.toString());
userInfo = getPersonnelCardMapper().getUserById(uId);
userInfo.setEcId(ecResourceId);

@ -36,7 +36,6 @@ import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.extend.ExtendTitleMapper;
import com.engine.organization.mapper.hrmresource.HrmRelationMapper;
import com.engine.organization.mapper.hrmresource.HrmResourceMapper;
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
import com.engine.organization.mapper.job.JobMapper;
import com.engine.organization.mapper.post.PostInfoMapper;
@ -158,10 +157,6 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
return MapperProxyFactory.getProxy(JobMapper.class);
}
private HrmResourceMapper getHrmResourceMapper() {
return MapperProxyFactory.getProxy(HrmResourceMapper.class);
}
private static ResourceMapper getResourceMapper() {
return MapperProxyFactory.getProxy(ResourceMapper.class);
}
@ -733,7 +728,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
String showOrder = Util.null2String(params.get("show_order"));
// 初始化排序字段
if (StringUtils.isBlank(showOrder)) {
Long orderNum = getHrmResourceMapper().getMaxShowOrder();
Long orderNum = getResourceMapper().getMaxShowOrder();
params.put("show_order", null == orderNum ? 1 : orderNum + 1);
}

@ -32,11 +32,11 @@ import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.employee.EmployeeMapper;
import com.engine.organization.mapper.extend.ExtMapper;
import com.engine.organization.mapper.extend.ExtendInfoMapper;
import com.engine.organization.mapper.hrmresource.HrmResourceMapper;
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
import com.engine.organization.mapper.jclimport.JclImportHistoryDetailMapper;
import com.engine.organization.mapper.jclimport.JclImportHistoryMapper;
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;
import com.engine.organization.mapper.scheme.SchemeMapper;
@ -1547,7 +1547,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
historyDetailPO.setRelatedName(keyFieldValue);
// 判断当前人员是否存在
Long resourceId = MapperProxyFactory.getProxy(HrmResourceMapper.class).getIdByKeyField(keyField, keyFieldValue);
Long resourceId = MapperProxyFactory.getProxy(ResourceMapper.class).getIdByKeyField(keyField, keyFieldValue);
if ("add".equals(operateType)) {
if (resourceId != null) {
historyDetailPO.setOperateDetail(keyFieldValue + "已存在");
@ -1580,7 +1580,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
String showOrder = Util.null2String(map.get("show_order"));
if (StringUtils.isBlank(showOrder)) {
Long maxShowOrder = MapperProxyFactory.getProxy(HrmResourceMapper.class).getMaxShowOrder();
Long maxShowOrder = MapperProxyFactory.getProxy(ResourceMapper.class).getMaxShowOrder();
if (null == maxShowOrder) {
maxShowOrder = 0L;
}

@ -13,8 +13,8 @@ import com.engine.organization.entity.detach.po.ManagerDetachPO;
import com.engine.organization.entity.detach.vo.ManagerDetachVO;
import com.engine.organization.mapper.detach.ManagerDetachMapper;
import com.engine.organization.mapper.employee.EmployeeMapper;
import com.engine.organization.mapper.hrmresource.HrmResourceMapper;
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
import com.engine.organization.mapper.resource.ResourceMapper;
import com.engine.organization.service.ManagerDetachService;
import com.engine.organization.util.HasRightUtil;
import com.engine.organization.util.OrganizationFormItemUtil;
@ -46,8 +46,8 @@ public class ManagerDetachServiceImpl extends Service implements ManagerDetachSe
return MapperProxyFactory.getProxy(ManagerDetachMapper.class);
}
public HrmResourceMapper getHrmResourceMapper() {
return MapperProxyFactory.getProxy(HrmResourceMapper.class);
public ResourceMapper getResourceMapper() {
return MapperProxyFactory.getProxy(ResourceMapper.class);
}
public EmployeeMapper getEmployeeMapper() {
@ -123,7 +123,7 @@ public class ManagerDetachServiceImpl extends Service implements ManagerDetachSe
ManagerDetachPO managerDetachPO = ManagerDetachPO.builder()
.managerType(0)
.ecManager(param.getEcManager())
.jclManager(getHrmResourceMapper().getJclResourceId(String.valueOf(param.getEcManager())).intValue())
.jclManager(getResourceMapper().getJclResourceId(String.valueOf(param.getEcManager())).intValue())
.ecRolelevel(param.getEcRolelevel())
.jclRolelevel(EcHrmRelationUtil.getBatchJclCompanyId(param.getEcRolelevel()) != null ? String.valueOf(EcHrmRelationUtil.getBatchJclCompanyId(param.getEcRolelevel())) : null)
.manageModule("组织管理")
@ -141,7 +141,7 @@ public class ManagerDetachServiceImpl extends Service implements ManagerDetachSe
ManagerDetachPO managerDetachPO = ManagerDetachPO.builder()
.id(param.getId())
.ecManager(param.getEcManager())
.jclManager(getHrmResourceMapper().getJclResourceId(String.valueOf(param.getEcManager())).intValue())
.jclManager(getResourceMapper().getJclResourceId(String.valueOf(param.getEcManager())).intValue())
.ecRolelevel(param.getEcRolelevel())
.jclRolelevel(EcHrmRelationUtil.getBatchJclCompanyId(param.getEcRolelevel()) != null ? String.valueOf(EcHrmRelationUtil.getBatchJclCompanyId(param.getEcRolelevel())) : null)
.build();

@ -4,9 +4,9 @@ import com.engine.organization.entity.hrmresource.po.HrmResourcePO;
import com.engine.organization.entity.job.po.JobPO;
import com.engine.organization.entity.map.JclOrgMap;
import com.engine.organization.entity.personnelcard.UserCard;
import com.engine.organization.mapper.hrmresource.HrmResourceMapper;
import com.engine.organization.mapper.jclorgmap.JclOrgMapper;
import com.engine.organization.mapper.job.JobMapper;
import com.engine.organization.mapper.resource.ResourceMapper;
import com.engine.organization.mapper.trigger.CompTriggerMapper;
import com.engine.organization.mapper.trigger.HrmResourceTriggerMapper;
import com.engine.organization.util.OrganizationDateUtil;
@ -32,8 +32,8 @@ public class HrmResourceTriggerRunnable implements Runnable {
private HrmResourceTriggerMapper getHrmResourceTriggerMapper() {
return MapperProxyFactory.getProxy(HrmResourceTriggerMapper.class);
}
private HrmResourceMapper getHrmResourceMapper() {
return MapperProxyFactory.getProxy(HrmResourceMapper.class);
private ResourceMapper getResourceMapper() {
return MapperProxyFactory.getProxy(ResourceMapper.class);
}
private JclOrgMapper getJclOrgMapper() {
return MapperProxyFactory.getProxy(JclOrgMapper.class);
@ -52,7 +52,7 @@ public class HrmResourceTriggerRunnable implements Runnable {
JclOrgMap jclMap = new JclOrgMap();
jclMap.setFType(4);
// 查询当前人员信息数据
String ecResourceId = getHrmResourceMapper().getEcResourceId(userId.toString());
String ecResourceId = getResourceMapper().getEcResourceId(userId.toString());
// EC人员
HrmResource ecHrmResource = getHrmResourceTriggerMapper().getHrmResource(Long.parseLong(ecResourceId));
// 聚才林人员

@ -17,7 +17,7 @@ import com.engine.hrm.util.HrmWeakPasswordUtil;
import com.engine.hrm.util.face.HrmFaceCheckManager;
import com.engine.hrm.util.face.ValidateFieldManager;
import com.engine.hrm.util.face.bean.CheckItemBean;
import com.engine.organization.mapper.hrmresource.HrmResourceMapper;
import com.engine.organization.mapper.resource.ResourceMapper;
import com.engine.organization.util.db.MapperProxyFactory;
import com.weaver.general.BaseBean;
import ln.LN;
@ -986,7 +986,7 @@ public class ResourceSyncUtil {
String jclResourceId = Util.null2String(params.get("id"));
String ecResourceId = "";
if(StringUtils.isNotBlank(jclResourceId)){
ecResourceId = MapperProxyFactory.getProxy(HrmResourceMapper.class).getEcResourceId(jclResourceId);
ecResourceId = MapperProxyFactory.getProxy(ResourceMapper.class).getEcResourceId(jclResourceId);
}
// 更新人员时,初始化人员参数
if(StringUtils.isNotBlank(ecResourceId)){

Loading…
Cancel
Save