|
|
@ -89,6 +89,11 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp |
|
|
|
@Override |
|
|
|
@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)); |
|
|
|
if (null != icNatDTO) { |
|
|
|
throw new RenException(EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getCode(), EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getMsg()); |
|
|
|
} |
|
|
|
//1.获取所填居民所属组织缓存信息
|
|
|
|
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getAgencyId()); |
|
|
|
if (null == agencyInfo) { |
|
|
@ -183,6 +188,11 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void edit(AddIcNatFormDTO formDTO) { |
|
|
|
//0.先根据身份证号和检测时间校验除当前数据是否还存在相同数据
|
|
|
|
IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), formDTO.getIcNatId(), formDTO.getIdCard(), DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)); |
|
|
|
if (null != icNatDTO) { |
|
|
|
throw new RenException(EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getCode(), EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getMsg()); |
|
|
|
} |
|
|
|
//1.更新核酸记录表数据
|
|
|
|
IcNatEntity entity = ConvertUtils.sourceToTarget(formDTO, IcNatEntity.class); |
|
|
|
entity.setId(formDTO.getIcNatId()); |
|
|
|