根据身份证号获取人员主数据
This commit is contained in:
@@ -41,6 +41,7 @@ public enum ErrorCodeEnum {
|
||||
USER_FREEZE(1021019,"账号被冻结,请联系管理员",null),
|
||||
ENTERPRISE_NOT_EXIST(1021020,"企业不存在",null),
|
||||
USER_NOT_EXIST(1021021,"用户不存在",null),
|
||||
JOBNUMBER_NOT_EXIST(1021017,"用户工号不存在",null),
|
||||
USER_WAIT_AUDIT(1021018,"账号审核中,请联系企业管理员",null),
|
||||
OPERATION_OVER_TIME(1021019, "您的操作过于频繁,休息一下~", null),
|
||||
GET_APP_SECRET_ERROR(1021020, "获取secret异常", null),
|
||||
|
||||
@@ -27,19 +27,26 @@ public class EnterpriseUserDAO {
|
||||
|
||||
|
||||
public EnterpriseUserDO getUserInfoById(String userId){
|
||||
if(StringUtils.isAnyBlank(userId)){
|
||||
if(StringUtils.isBlank(userId)){
|
||||
return null;
|
||||
}
|
||||
return enterpriseUserMapper.getUserInfoById( userId);
|
||||
}
|
||||
|
||||
public EnterpriseUserDO getUserInfoByJobnumber(String jobnumber){
|
||||
if(StringUtils.isAnyBlank(jobnumber)){
|
||||
if(StringUtils.isBlank(jobnumber)){
|
||||
return null;
|
||||
}
|
||||
return enterpriseUserMapper.getUserInfoByJobnumber(jobnumber);
|
||||
}
|
||||
|
||||
public EnterpriseUserDO getUserInfoByThirdOaUniqueFlag(String thirdOaUniqueFlag){
|
||||
if(StringUtils.isBlank(thirdOaUniqueFlag)){
|
||||
return null;
|
||||
}
|
||||
return enterpriseUserMapper.getUserInfoByThirdOaUniqueFlag(thirdOaUniqueFlag);
|
||||
}
|
||||
|
||||
public List<EnterpriseUserDO> getUserInfoByUserIds(List<String> userIdList){
|
||||
if(CollectionUtils.isEmpty(userIdList)){
|
||||
return Lists.newArrayList();
|
||||
|
||||
@@ -22,6 +22,7 @@ public interface EnterpriseUserMapper {
|
||||
|
||||
EnterpriseUserDO getUserInfoByJobnumber(@Param("jobnumber") String jobnumber);
|
||||
|
||||
EnterpriseUserDO getUserInfoByThirdOaUniqueFlag(@Param("thirdOaUniqueFlag") String thirdOaUniqueFlag);
|
||||
|
||||
/**
|
||||
* 批量获取用户信息
|
||||
|
||||
@@ -19,13 +19,15 @@
|
||||
<result column="face_url" jdbcType="VARCHAR" property="faceUrl"/>
|
||||
<result column="user_status" jdbcType="TINYINT" property="userStatus"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="third_oa_unique_flag" jdbcType="VARCHAR" property="thirdOaUniqueFlag"/>
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.cool.store.entity.EnterpriseUserDO">
|
||||
<result column="user_region_ids" jdbcType="LONGVARCHAR" property="userRegionIds"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, user_id, name, remark, mobile, email, org_email, main_admin, is_admin, unionid,
|
||||
avatar, jobnumber, is_leader, is_leader_in_depts, face_url, user_status, create_time
|
||||
avatar, jobnumber, is_leader, is_leader_in_depts, face_url, user_status, create_time,
|
||||
third_oa_unique_flag
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
user_region_ids
|
||||
@@ -51,6 +53,15 @@
|
||||
jobnumber = #{jobnumber}
|
||||
</select>
|
||||
|
||||
<select id="getUserInfoByThirdOaUniqueFlag" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>,
|
||||
<include refid="Blob_Column_List"/>
|
||||
from
|
||||
enterprise_user_${enterpriseId}
|
||||
where
|
||||
third_oa_unique_flag = #{thirdOaUniqueFlag}
|
||||
</select>
|
||||
|
||||
<select id="getUserInfoByUserIds" resultMap="BaseResultMap">
|
||||
select
|
||||
|
||||
@@ -70,4 +70,9 @@ public class EnterpriseUserDO implements Serializable {
|
||||
|
||||
@ApiModelProperty("部门集合(region_ids)")
|
||||
private String userRegionIds;
|
||||
|
||||
/**
|
||||
* 第三方OA系统唯一标识
|
||||
*/
|
||||
private String thirdOaUniqueFlag;
|
||||
}
|
||||
@@ -14,7 +14,6 @@ public interface XfsgEhrService {
|
||||
* @return
|
||||
*/
|
||||
StaffBaseInfoDTO getUserInfoByCode(String staffNumber);
|
||||
|
||||
/**
|
||||
* 根据加盟商编码查询加盟商
|
||||
* @param frId
|
||||
@@ -22,5 +21,8 @@ public interface XfsgEhrService {
|
||||
*/
|
||||
FranchiseeInfoDTO getFranchiseeInfoByFrId(String frId);
|
||||
|
||||
StaffBaseInfoDTO getUserInfoByIdCard(String idCard);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,11 +2,16 @@ package com.cool.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.dao.EnterpriseUserDAO;
|
||||
import com.cool.store.dto.ehr.FranchiseeInfoDTO;
|
||||
import com.cool.store.dto.ehr.StaffBaseInfoDTO;
|
||||
import com.cool.store.entity.EnterpriseUserDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mq.util.HttpRestTemplateService;
|
||||
import com.cool.store.service.XfsgEhrService;
|
||||
import com.cool.store.utils.SecureUtil;
|
||||
import com.cool.store.utils.StringUtil;
|
||||
import com.cool.store.utils.poi.constant.Constants;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@@ -15,6 +20,7 @@ import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* describe: 鲜丰水果api
|
||||
@@ -31,6 +37,10 @@ public class XfsgEhrServiceImpl implements XfsgEhrService {
|
||||
@Resource
|
||||
private HttpRestTemplateService httpRestTemplateService;
|
||||
|
||||
@Resource
|
||||
private EnterpriseUserDAO enterpriseUserDAO;
|
||||
|
||||
|
||||
@Override
|
||||
public StaffBaseInfoDTO getUserInfoByCode(String staffNumber) {
|
||||
Map<String, Object> requestMap = new HashMap<>();
|
||||
@@ -73,6 +83,21 @@ public class XfsgEhrServiceImpl implements XfsgEhrService {
|
||||
return franchiseeInfoDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StaffBaseInfoDTO getUserInfoByIdCard(String idCard) {
|
||||
if (StringUtil.isBlank(idCard)) {
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
EnterpriseUserDO enterpriseUserDO = enterpriseUserDAO.getUserInfoByThirdOaUniqueFlag(idCard);
|
||||
if(Objects.isNull(enterpriseUserDO)){
|
||||
throw new ServiceException(ErrorCodeEnum.USER_NOT_EXIST);
|
||||
}
|
||||
if (StringUtil.isBlank(enterpriseUserDO.getJobnumber())) {
|
||||
throw new ServiceException(ErrorCodeEnum.JOBNUMBER_NOT_EXIST);
|
||||
}
|
||||
return this.getUserInfoByCode(enterpriseUserDO.getJobnumber());
|
||||
}
|
||||
|
||||
private void fillSignatureInfo(Map<String, Object> requestMap) {
|
||||
long timestamp = System.currentTimeMillis();
|
||||
String signature = SecureUtil.getSignature(timestamp);
|
||||
|
||||
@@ -26,12 +26,18 @@ public class TrainingRegistController {
|
||||
@Resource
|
||||
XfsgEhrService xfsgEhrService;
|
||||
|
||||
@ApiOperation("根据工号获取员工详细信息")
|
||||
@ApiOperation("根据工号获取人员主数据")
|
||||
@GetMapping("/getUserInfoByCode")
|
||||
public ResponseResult<StaffBaseInfoDTO> getUserInfoByCode(@RequestParam("staffNumber") String staffNumber) {
|
||||
return ResponseResult.success(xfsgEhrService.getUserInfoByCode(staffNumber));
|
||||
}
|
||||
|
||||
@ApiOperation("根据身份证号获取人员主数据")
|
||||
@GetMapping("/getUserInfoByIdCard")
|
||||
public ResponseResult<StaffBaseInfoDTO> getUserInfoByIdCard(@RequestParam("idCard") String idCard) {
|
||||
return ResponseResult.success(xfsgEhrService.getUserInfoByIdCard(idCard));
|
||||
}
|
||||
|
||||
@ApiOperation("根据加盟商编码查询加盟商信息")
|
||||
@GetMapping("/getFranchiseeInfoByFrId")
|
||||
public ResponseResult<FranchiseeInfoDTO> getFranchiseeInfoByFrId(@RequestParam("frId") String frId) {
|
||||
|
||||
Reference in New Issue
Block a user