Browse Source

新增是磐石7天旅居史赋默认值

master
sunyuchao 3 years ago
parent
commit
35a3c587e6
  1. 46
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java

46
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java

@ -215,6 +215,29 @@ public class IcTripReportRecordServiceImpl extends BaseServiceImpl<IcTripReportR
if(StringUtils.isEmpty(formDTO.getNatOutcome())){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "48小时核算记录为必填", "48小时核算记录为必填");
}
//判断是磐石客户的7天内旅居史情况没值的按逻辑赋值
if (StringUtils.isEmpty(formDTO.getSojournHistory())) {
//风险地区数据
LambdaQueryWrapper<IcDangerAreaEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcDangerAreaEntity::getCustomerId, formDTO.getCustomerId());
wrapper.eq(IcDangerAreaEntity::getDelFlag, DelFlagEnum.NORMAL.value());
List<IcDangerAreaEntity> areaList = icDangerAreaDao.selectList(wrapper);
Map<String, String> areaMap = new HashMap<>();
areaList.forEach(a -> {
if (StringUtils.isNotBlank(a.getDistrict())) {
areaMap.put(a.getDistrict(), a.getDangerLevel());
}
});
String[] str = formDTO.getSourceAddress().split("-");
if (str.length < 3) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "‘来源地’信息填写格式错误", "‘来源地’信息填写格式错误");
}
if (areaMap.containsKey(str[2])) {
formDTO.setSojournHistory(areaMap.get(str[2]));
} else {
formDTO.setSojournHistory("3");//无风险
}
}
}else {//其他客户
if(StringUtils.isEmpty(formDTO.getVaccineNum())||StringUtils.isEmpty(formDTO.getIsNatRecord())){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "疫苗接种针次和48小时核算记录为必填", "疫苗接种针次和48小时核算记录为必填");
@ -350,6 +373,29 @@ public class IcTripReportRecordServiceImpl extends BaseServiceImpl<IcTripReportR
if(StringUtils.isEmpty(formDTO.getNatOutcome())){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "48小时核算记录为必填", "48小时核算记录为必填");
}
//判断是磐石客户的7天内旅居史情况没值的按逻辑赋值
if (StringUtils.isEmpty(formDTO.getSojournHistory())) {
//风险地区数据
LambdaQueryWrapper<IcDangerAreaEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcDangerAreaEntity::getCustomerId, formDTO.getCustomerId());
wrapper.eq(IcDangerAreaEntity::getDelFlag, DelFlagEnum.NORMAL.value());
List<IcDangerAreaEntity> areaList = icDangerAreaDao.selectList(wrapper);
Map<String, String> areaMap = new HashMap<>();
areaList.forEach(a -> {
if (StringUtils.isNotBlank(a.getDistrict())) {
areaMap.put(a.getDistrict(), a.getDangerLevel());
}
});
String[] str = formDTO.getSourceAddress().split("-");
if (str.length < 3) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "‘来源地’信息填写格式错误", "‘来源地’信息填写格式错误");
}
if (areaMap.containsKey(str[2])) {
formDTO.setSojournHistory(areaMap.get(str[2]));
} else {
formDTO.setSojournHistory("3");//无风险
}
}
}else {//其他客户
if(StringUtils.isEmpty(formDTO.getVaccineNum())||StringUtils.isEmpty(formDTO.getIsNatRecord())){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "疫苗接种针次和48小时核算记录为必填", "疫苗接种针次和48小时核算记录为必填");

Loading…
Cancel
Save