From b8c9a883c0bbc8cefcf6cba70cb77626f60bc9b5 Mon Sep 17 00:00:00 2001 From: "15989082884@163.com" <15989082884@163.com> Date: Thu, 10 Aug 2023 18:10:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E8=A1=8C=E6=94=BF=E5=8C=BA?= =?UTF-8?q?=E5=9F=9F=E6=8B=A6=E6=88=AA=E5=8E=BB=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BmsChannelPointController.java | 44 ++++++++++--------- 1 file changed, 24 insertions(+), 20 deletions(-) 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());