diff --git a/src/main/java/com/qs/serve/modules/bms/controller/BmsChannelPointController.java b/src/main/java/com/qs/serve/modules/bms/controller/BmsChannelPointController.java index a86578d3..deaa7ec0 100644 --- a/src/main/java/com/qs/serve/modules/bms/controller/BmsChannelPointController.java +++ b/src/main/java/com/qs/serve/modules/bms/controller/BmsChannelPointController.java @@ -307,9 +307,9 @@ public class BmsChannelPointController { if(!StringUtils.hasText(a.getPointType())){ a.setErrorInfo(a.getErrorInfo()+"网点类型不能为空;"); } - if(!StringUtils.hasText(a.getBizRegionCode())){ - a.setErrorInfo(a.getErrorInfo()+"行政区域编码不能为空;"); - } +// if(!StringUtils.hasText(a.getBizRegionCode())){ +// a.setErrorInfo(a.getErrorInfo()+"行政区域编码不能为空;"); +// } if(!StringUtils.hasText(a.getShopArea())){ a.setErrorInfo(a.getErrorInfo()+"店铺面积不能为空;"); } @@ -359,17 +359,17 @@ public class BmsChannelPointController { LambdaQueryWrapper region2LambdaQueryWrapper = new LambdaQueryWrapper<>(); region2LambdaQueryWrapper.in(BmsRegion2::getCode,bizRegionCodes); region2List = bmsRegion2Service.list(region2LambdaQueryWrapper); - List existRegion2Code = region2List.stream().map(a -> a.getCode()).collect(Collectors.toList()); - if(region2List.size() { - if(a.getType().equals("4")){ - return; - } - if(!existRegion2Code.contains(a.getBizRegionCode())){ - a.setErrorInfo(a.getErrorInfo()+"不存在该行政区域编码;"); - } - }); - } +// List existRegion2Code = region2List.stream().map(a -> a.getCode()).collect(Collectors.toList()); +// if(region2List.size() { +// if(a.getType().equals("4")){ +// return; +// } +// if(!existRegion2Code.contains(a.getBizRegionCode())){ +// a.setErrorInfo(a.getErrorInfo()+"不存在该行政区域编码;"); +// } +// }); +// } } Map codeToBizRegion = region2List.stream().collect(Collectors.toMap(BmsRegion2::getCode, a->a)); @@ -465,9 +465,11 @@ public class BmsChannelPointController { bmsChannelPoint.setChannelId(channel.getId()); bmsChannelPoint.setChannelName(channel.getChannelName()); bmsChannelPoint.setChannelType(channel.getChannelType()); - bmsChannelPoint.setBizRegionId(region2.getId()); - bmsChannelPoint.setBizRegionPath(region2.getPathNames()); - bmsChannelPoint.setBizRegionPathIds(region2.getPathIds()); + if(region2!=null) { + bmsChannelPoint.setBizRegionId(region2.getId()); + bmsChannelPoint.setBizRegionPath(region2.getPathNames()); + bmsChannelPoint.setBizRegionPathIds(region2.getPathIds()); + } return bmsChannelPoint; }).collect(Collectors.toList()); bmsChannelPointService.saveBatch(saveBmsChannels); @@ -483,9 +485,11 @@ public class BmsChannelPointController { bmsChannelPoint.setChannelId(channel.getId()); bmsChannelPoint.setChannelName(channel.getChannelName()); bmsChannelPoint.setChannelType(channel.getChannelType()); - bmsChannelPoint.setBizRegionId(region2.getId()); - bmsChannelPoint.setBizRegionPath(region2.getPathNames()); - bmsChannelPoint.setBizRegionPathIds(region2.getPathIds()); + if(region2!=null) { + bmsChannelPoint.setBizRegionId(region2.getId()); + bmsChannelPoint.setBizRegionPath(region2.getPathNames()); + bmsChannelPoint.setBizRegionPathIds(region2.getPathIds()); + } return bmsChannelPoint; }).collect(Collectors.toList()); List updateCodes = updateBmsChannelPoints.stream().map(a -> a.getPointCode()).collect(Collectors.toList());