diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java index bd627a273c..b663a0ea1f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java @@ -215,6 +215,29 @@ public class IcTripReportRecordServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcDangerAreaEntity::getCustomerId, formDTO.getCustomerId()); + wrapper.eq(IcDangerAreaEntity::getDelFlag, DelFlagEnum.NORMAL.value()); + List areaList = icDangerAreaDao.selectList(wrapper); + Map 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 wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcDangerAreaEntity::getCustomerId, formDTO.getCustomerId()); + wrapper.eq(IcDangerAreaEntity::getDelFlag, DelFlagEnum.NORMAL.value()); + List areaList = icDangerAreaDao.selectList(wrapper); + Map 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小时核算记录为必填");