diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java index 66abe790f3..61b5b6f250 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java +++ b/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) { Result staffResult = customerStaffRedis.commonAggFeignClient.getStaffInfo(staffId); if (staffResult == null || !staffResult.success()) { + log.error("/data/aggregator/epmetuser/getStaffInfo/{staffId} 异常 staffId: ",staffId); throw new RenException("获取工作人员信息失败"); } CustomerStaffInfoCache resultData = staffResult.getData(); if (resultData == null) { - log.warn("getStaffInfo staff is null,staffId:{}", staffId); + log.error("getStaffInfo staff is null,staffId:{}", staffId); return null; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index f6de7bd634..d81bb9b1e7 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/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.result.CustomerStaffInfoCacheResult; 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.EpmetException; 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.UserBaseInfoDTO; import com.epmet.dto.form.DetailByTypeFormDTO; +import com.epmet.dto.form.GetStaffExistRoleFormDTO; import com.epmet.dto.form.SystemMsgFormDTO; import com.epmet.dto.result.DetailByTypeResultDTO; -import com.epmet.dto.form.GetStaffExistRoleFormDTO; import com.epmet.dto.result.NewUserRoleResultDTO; import com.epmet.dto.result.StaffRoleResultDTO; import com.epmet.feign.EpmetMessageOpenFeignClient; @@ -638,6 +637,7 @@ public class EpmetUserServiceImpl implements EpmetUserService { .eq(CustomerStaffEntity::getDelFlag,NumConstant.ZERO_STR); CustomerStaffEntity staffEntity = customerStaffDao.selectOne(queryWrapper); if (null == staffEntity) { + log.error(String.format("customer_staff is null staffId:%s",staffId)); return null; } CustomerStaffResultDTO result = ConvertUtils.sourceToTarget(staffEntity, CustomerStaffResultDTO.class); diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java index b87f03d8d7..5fe8f73f31 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java +++ b/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 javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; import java.io.Serializable; import java.util.ArrayList; import java.util.Date; @@ -110,6 +109,9 @@ public class AddIcNatFormDTO implements Serializable { private String customerId; private String staffId; private String client; - + /** + * 政府端:gov、居民端:resi、运营端:oper + */ + private String app; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java index 512a43f7e9..b85f409d2b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java +++ b/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); formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setStaffId(tokenDto.getUserId()); - formDTO.setClient(tokenDto.getClient()); + // formDTO.setClient(tokenDto.getClient()); + formDTO.setApp(tokenDto.getApp()); icNucleinService.add(formDTO); return new Result(); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java index b9cb1331f1..08fde1f5f9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java @@ -119,7 +119,7 @@ public class IcNatServiceImpl extends BaseServiceImpl imp if (null != icNatDTO && icNatDTO.getNatResult().equals(formDTO.getNatResult())) { throw new RenException(EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getCode(), EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getMsg()); } 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.IC_NAT.getCode(), EpmetErrorCode.IC_NAT.getMsg()); @@ -129,10 +129,6 @@ public class IcNatServiceImpl extends BaseServiceImpl imp if (null == agencyInfo) { 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()); //2.新增核酸基础信息数据 IcNatEntity entity = ConvertUtils.sourceToTarget(formDTO, IcNatEntity.class); @@ -146,8 +142,19 @@ public class IcNatServiceImpl extends BaseServiceImpl imp IcNatRelationEntity relationEntity = ConvertUtils.sourceToTarget(formDTO, IcNatRelationEntity.class); relationEntity.setIcNatId(entity.getId()); relationEntity.setIsLocalResiUser(resiCount.getIsLocal() == NumConstant.ZERO ? NumConstant.ZERO_STR : NumConstant.ONE_STR); - relationEntity.setAgencyId(staffInfo.getAgencyId()); - relationEntity.setPids(StringUtils.isNotBlank(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyPIds() + ":" + staffInfo.getAgencyId() : staffInfo.getAgencyId()); + if(AppClientConstant.APP_GOV.equals(formDTO.getApp())){ + 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); //3.新增通知表信息