diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index e0623c7648..a059504d2e 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -252,6 +252,7 @@ public enum EpmetErrorCode { ORG_DEL_FAILED(8921,"删除失败"), NEIGHBORHOOD_DEL_FAILED(8922,""), IC_NAT_IDCARD_NATTIME(8923,"已存在相同记录"), + IC_NAT(8924,"平台已存在记录,请去修改原有记录"), //通用错误码 start 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 51e22193de..cbb234aa0d 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 @@ -92,9 +92,12 @@ public class IcNatServiceImpl extends BaseServiceImpl imp @Transactional(rollbackFor = Exception.class) public void add(AddIcNatFormDTO formDTO) { //0.先根据身份证号和检查时间以及检测结果校验数据是否存在 - IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), null, formDTO.getIdCard(), DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE), formDTO.getNatResult()); - if (null != icNatDTO) { + IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), null, formDTO.getIdCard(), DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE), null); + //按身份证号核酸时间存在记录的 核酸结果相同的提示已存在相同记录核酸结果不同的提示已存在去修改【业务要求的】 + 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())) { + throw new RenException(EpmetErrorCode.IC_NAT.getCode(), EpmetErrorCode.IC_NAT.getMsg()); } //1.获取所填居民所属组织缓存信息 AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getAgencyId()); @@ -209,7 +212,7 @@ public class IcNatServiceImpl extends BaseServiceImpl imp //0.先根据身份证号和检测时间以及检测结果校验除当前数据是否还存在相同数据 IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), formDTO.getIcNatId(), formDTO.getIdCard(), DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE), formDTO.getNatResult()); if (null != icNatDTO) { - throw new RenException(EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getCode(), EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getMsg()); + throw new RenException(EpmetErrorCode.IC_NAT.getCode(), EpmetErrorCode.IC_NAT.getMsg()); } //1.更新核酸记录基础信息表数据 IcNatEntity entity = ConvertUtils.sourceToTarget(formDTO, IcNatEntity.class);