根据身份证号获取人员主数据

This commit is contained in:
wangxiaopeng
2024-04-29 14:48:00 +08:00
parent 7196296689
commit cee949537b
8 changed files with 63 additions and 5 deletions

View File

@@ -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);
}

View File

@@ -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);