Browse Source

/icNat/add获取工作人员信息失败烟台问题

dev
yinzuomei 3 years ago
parent
commit
7d31349b59
  1. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java
  2. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  3. 6
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java
  4. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java
  5. 21
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java

@ -88,11 +88,12 @@ public class CustomerStaffRedis {
private static CustomerStaffInfoCache reloadStaffCache(String staffId, String key) { private static CustomerStaffInfoCache reloadStaffCache(String staffId, String key) {
Result<CustomerStaffInfoCache> staffResult = customerStaffRedis.commonAggFeignClient.getStaffInfo(staffId); Result<CustomerStaffInfoCache> staffResult = customerStaffRedis.commonAggFeignClient.getStaffInfo(staffId);
if (staffResult == null || !staffResult.success()) { if (staffResult == null || !staffResult.success()) {
log.error("/data/aggregator/epmetuser/getStaffInfo/{staffId} 异常 staffId: ",staffId);
throw new RenException("获取工作人员信息失败"); throw new RenException("获取工作人员信息失败");
} }
CustomerStaffInfoCache resultData = staffResult.getData(); CustomerStaffInfoCache resultData = staffResult.getData();
if (resultData == null) { if (resultData == null) {
log.warn("getStaffInfo staff is null,staffId:{}", staffId); log.error("getStaffInfo staff is null,staffId:{}", staffId);
return null; return null;
} }

4
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java

@ -9,7 +9,6 @@ import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.form.IdAndNameDTO; import com.epmet.commons.tools.dto.form.IdAndNameDTO;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.OrgTypeEnum; import com.epmet.commons.tools.enums.OrgTypeEnum;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
@ -56,9 +55,9 @@ import com.epmet.dataaggre.service.opercustomize.CustomerFootBarService;
import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.UserBaseInfoDTO; import com.epmet.dto.UserBaseInfoDTO;
import com.epmet.dto.form.DetailByTypeFormDTO; import com.epmet.dto.form.DetailByTypeFormDTO;
import com.epmet.dto.form.GetStaffExistRoleFormDTO;
import com.epmet.dto.form.SystemMsgFormDTO; import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.result.DetailByTypeResultDTO; import com.epmet.dto.result.DetailByTypeResultDTO;
import com.epmet.dto.form.GetStaffExistRoleFormDTO;
import com.epmet.dto.result.NewUserRoleResultDTO; import com.epmet.dto.result.NewUserRoleResultDTO;
import com.epmet.dto.result.StaffRoleResultDTO; import com.epmet.dto.result.StaffRoleResultDTO;
import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetMessageOpenFeignClient;
@ -638,6 +637,7 @@ public class EpmetUserServiceImpl implements EpmetUserService {
.eq(CustomerStaffEntity::getDelFlag,NumConstant.ZERO_STR); .eq(CustomerStaffEntity::getDelFlag,NumConstant.ZERO_STR);
CustomerStaffEntity staffEntity = customerStaffDao.selectOne(queryWrapper); CustomerStaffEntity staffEntity = customerStaffDao.selectOne(queryWrapper);
if (null == staffEntity) { if (null == staffEntity) {
log.error(String.format("customer_staff is null staffId:%s",staffId));
return null; return null;
} }
CustomerStaffResultDTO result = ConvertUtils.sourceToTarget(staffEntity, CustomerStaffResultDTO.class); CustomerStaffResultDTO result = ConvertUtils.sourceToTarget(staffEntity, CustomerStaffResultDTO.class);

6
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java

@ -5,7 +5,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
@ -110,6 +109,9 @@ public class AddIcNatFormDTO implements Serializable {
private String customerId; private String customerId;
private String staffId; private String staffId;
private String client; private String client;
/**
* 政府端:gov居民端:resi运营端:oper
*/
private String app;
} }

3
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java

@ -92,7 +92,8 @@ public class IcNatController implements ResultDataResolver {
ValidatorUtils.validateEntity(formDTO, AddIcNatFormDTO.Nat.class); ValidatorUtils.validateEntity(formDTO, AddIcNatFormDTO.Nat.class);
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId()); formDTO.setStaffId(tokenDto.getUserId());
formDTO.setClient(tokenDto.getClient()); // formDTO.setClient(tokenDto.getClient());
formDTO.setApp(tokenDto.getApp());
icNucleinService.add(formDTO); icNucleinService.add(formDTO);
return new Result(); return new Result();
} }

21
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java

@ -119,7 +119,7 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
if (null != icNatDTO && icNatDTO.getNatResult().equals(formDTO.getNatResult())) { if (null != icNatDTO && icNatDTO.getNatResult().equals(formDTO.getNatResult())) {
throw new RenException(EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getCode(), EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getMsg()); throw new RenException(EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getCode(), EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getMsg());
} else if (null != icNatDTO && !icNatDTO.getNatResult().equals(formDTO.getNatResult())) { } else if (null != icNatDTO && !icNatDTO.getNatResult().equals(formDTO.getNatResult())) {
if ("wxmp".equals(formDTO.getClient())) { if (AppClientConstant.APP_RESI.equals(formDTO.getApp())) {
throw new RenException(EpmetErrorCode.RESI_IC_NAT.getCode(), EpmetErrorCode.RESI_IC_NAT.getMsg()); throw new RenException(EpmetErrorCode.RESI_IC_NAT.getCode(), EpmetErrorCode.RESI_IC_NAT.getMsg());
} }
throw new RenException(EpmetErrorCode.IC_NAT.getCode(), EpmetErrorCode.IC_NAT.getMsg()); throw new RenException(EpmetErrorCode.IC_NAT.getCode(), EpmetErrorCode.IC_NAT.getMsg());
@ -129,10 +129,6 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
if (null == agencyInfo) { if (null == agencyInfo) {
throw new RenException(String.format("获取组织缓存信息失败%s", formDTO.getAgencyId())); throw new RenException(String.format("获取组织缓存信息失败%s", formDTO.getAgencyId()));
} }
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if (null == staffInfo){
throw new EpmetException(String.format("获取工作人员信息失败%s", formDTO.getStaffId()));
}
ResiAndLocalResiResultDTO resiCount = icResiUserDao.getResiCount(formDTO.getAgencyId(), formDTO.getIdCard(), formDTO.getCustomerId()); ResiAndLocalResiResultDTO resiCount = icResiUserDao.getResiCount(formDTO.getAgencyId(), formDTO.getIdCard(), formDTO.getCustomerId());
//2.新增核酸基础信息数据 //2.新增核酸基础信息数据
IcNatEntity entity = ConvertUtils.sourceToTarget(formDTO, IcNatEntity.class); IcNatEntity entity = ConvertUtils.sourceToTarget(formDTO, IcNatEntity.class);
@ -146,8 +142,19 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
IcNatRelationEntity relationEntity = ConvertUtils.sourceToTarget(formDTO, IcNatRelationEntity.class); IcNatRelationEntity relationEntity = ConvertUtils.sourceToTarget(formDTO, IcNatRelationEntity.class);
relationEntity.setIcNatId(entity.getId()); relationEntity.setIcNatId(entity.getId());
relationEntity.setIsLocalResiUser(resiCount.getIsLocal() == NumConstant.ZERO ? NumConstant.ZERO_STR : NumConstant.ONE_STR); relationEntity.setIsLocalResiUser(resiCount.getIsLocal() == NumConstant.ZERO ? NumConstant.ZERO_STR : NumConstant.ONE_STR);
relationEntity.setAgencyId(staffInfo.getAgencyId()); if(AppClientConstant.APP_GOV.equals(formDTO.getApp())){
relationEntity.setPids(StringUtils.isNotBlank(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyPIds() + ":" + staffInfo.getAgencyId() : staffInfo.getAgencyId()); CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if (null == staffInfo){
log.error(String.format("获取工作人员信息失败%s", formDTO.getStaffId()));
throw new EpmetException(String.format("获取工作人员信息失败%s", formDTO.getStaffId()));
}
relationEntity.setAgencyId(staffInfo.getAgencyId());
relationEntity.setPids(StringUtils.isNotBlank(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyPIds() + ":" + staffInfo.getAgencyId() : staffInfo.getAgencyId());
}else{
relationEntity.setAgencyId(formDTO.getAgencyId());
AgencyInfoCache agencyInfoCache=CustomerOrgRedis.getAgencyInfo(formDTO.getAgencyId());
relationEntity.setPids(StringUtils.isNotBlank(agencyInfoCache.getPids()) ? agencyInfoCache.getPids() + ":" + formDTO.getAgencyId() : formDTO.getAgencyId());
}
icNatRelationDao.insert(relationEntity); icNatRelationDao.insert(relationEntity);
//3.新增通知表信息 //3.新增通知表信息

Loading…
Cancel
Save