|
|
@ -88,6 +88,23 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp |
|
|
|
//@Autowired
|
|
|
|
//private UserService userService;
|
|
|
|
|
|
|
|
public void disposeIsNull(AddIcNatFormDTO formDTO){ |
|
|
|
/** |
|
|
|
* 根据产品要求 不同情况提示不同错误 |
|
|
|
* 1.采样时间为空,检测时间和结果有一个为空就报错 |
|
|
|
* 2.采样时间不为空,检测时间和结果可以为空【如果不为空 检测时间和结果都不为空】 |
|
|
|
*/ |
|
|
|
if ((null == formDTO.getSampleTime() && null == formDTO.getNatTime() || org.apache.commons.lang3.StringUtils.isBlank(formDTO.getNatResult()))){ |
|
|
|
throw new EpmetException(EpmetErrorCode.SAMPLE_TIME_AND_RESULT_IS_NULL_ERROR.getCode()); |
|
|
|
} |
|
|
|
if(null != formDTO.getSampleTime() && org.apache.commons.lang3.StringUtils.isNotBlank(formDTO.getNatResult()) && null == formDTO.getNatTime()){ |
|
|
|
throw new EpmetException(EpmetErrorCode.NAT_TIME_IS_NULL_ERROR.getCode()); |
|
|
|
} |
|
|
|
if (null != formDTO.getSampleTime() && org.apache.commons.lang3.StringUtils.isBlank(formDTO.getNatResult()) && null != formDTO.getNatTime()){ |
|
|
|
throw new EpmetException(EpmetErrorCode.NAT_RESULT_IS_NULL_ERROR.getCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Author sun |
|
|
|
* @Description 核酸检测-上报核酸记录 |
|
|
@ -95,8 +112,9 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void add(AddIcNatFormDTO formDTO) { |
|
|
|
disposeIsNull(formDTO); |
|
|
|
//0.先根据身份证号和检查时间以及检测结果校验数据是否存在
|
|
|
|
IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), null, formDTO.getIdCard(), DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE), null); |
|
|
|
IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), null, formDTO.getIdCard(), null != formDTO.getNatTime() ? DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE) : null, null, null != formDTO.getSampleTime() ? DateUtils.format(formDTO.getSampleTime(), 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()); |
|
|
@ -216,8 +234,9 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void edit(AddIcNatFormDTO formDTO) { |
|
|
|
disposeIsNull(formDTO); |
|
|
|
//0.先根据身份证号和检测时间以及检测结果校验除当前数据是否还存在相同数据
|
|
|
|
IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), formDTO.getIcNatId(), formDTO.getIdCard(), DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE), formDTO.getNatResult()); |
|
|
|
IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), formDTO.getIcNatId(), formDTO.getIdCard(), null != formDTO.getNatTime() ? DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE) : null, formDTO.getNatResult(), null != formDTO.getSampleTime() ? DateUtils.format(formDTO.getSampleTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE) : null); |
|
|
|
if (null != icNatDTO) { |
|
|
|
throw new RenException(EpmetErrorCode.IC_NAT.getCode(), EpmetErrorCode.IC_NAT.getMsg()); |
|
|
|
} |
|
|
@ -464,7 +483,7 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp |
|
|
|
errorRow.setName(e.getName()); |
|
|
|
errorRow.setMobile(e.getMobile()); |
|
|
|
errorRow.setIdCard(e.getIdCard()); |
|
|
|
errorRow.setErrorInfo("未知系统错误"); |
|
|
|
errorRow.setErrorInfo(exception.getMessage()); |
|
|
|
listener.getErrorRows().add(errorRow); |
|
|
|
} |
|
|
|
}); |
|
|
|