From 82c8338b57f7a0d4e5e2403b1c600e20fd0f1595 Mon Sep 17 00:00:00 2001 From: cs <673849330@qq,com> Date: Wed, 26 Jan 2022 17:55:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E6=95=B0=E7=BB=84=E5=85=83=E7=B4=A0=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E6=95=B0=E7=BB=84=E7=A9=BA=E6=8C=87=E9=92=88=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ComponentDetailServiceImpl.java | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/service-biz/service-wechat-applet/service-wechat-applet-biz/src/main/java/com/hncy/service/wechat/applet/biz/service/impl/ComponentDetailServiceImpl.java b/service-biz/service-wechat-applet/service-wechat-applet-biz/src/main/java/com/hncy/service/wechat/applet/biz/service/impl/ComponentDetailServiceImpl.java index 864b805..dce5c49 100644 --- a/service-biz/service-wechat-applet/service-wechat-applet-biz/src/main/java/com/hncy/service/wechat/applet/biz/service/impl/ComponentDetailServiceImpl.java +++ b/service-biz/service-wechat-applet/service-wechat-applet-biz/src/main/java/com/hncy/service/wechat/applet/biz/service/impl/ComponentDetailServiceImpl.java @@ -176,21 +176,29 @@ public class ComponentDetailServiceImpl extends ServiceImpl componentDetails = componentDetailMapper.judgeAIComponentIsExist(componentTypeName,WGS84Lng,WGS84Lat); - if(CollectionUtil.isEmpty(componentDetails)) { - throw new LocalBusinessException(430,componentTypeName); - } - log.info("从数据库查询到的部件"+componentDetails.toString()); +/* Iterator componentDetailIterator = componentDetails.iterator(); + while (componentDetailIterator.hasNext()) { + PlatformAudit platformAudit = platformAuditMapper.selectByComponentId(componentDetailIterator.next().getId()); + if (ObjectUtil.isNotNull(platformAudit) && platformAudit.getAuditStatus().equalsIgnoreCase(ARInspectionConstants.TWO)) { + componentDetailIterator.remove(); + } + }*/ //剔除审核不通过的部件 - for (ComponentDetailVo componentDetailVo : componentDetails) { - PlatformAudit platformAudit = platformAuditMapper.selectByComponentId(componentDetailVo.getId()); + for(int i=0; i< componentDetails.size();i++) { + PlatformAudit platformAudit = platformAuditMapper.selectByComponentId(componentDetails.get(i).getId()); if (ObjectUtil.isNotNull(platformAudit) && platformAudit.getAuditStatus().equalsIgnoreCase(ARInspectionConstants.TWO)) { - componentDetails.remove(componentDetailVo); + componentDetails.remove(i); + i--; } } log.info("剔除审核不通过的部件"+componentDetails.toString()); + if(CollectionUtil.isEmpty(componentDetails)) { + throw new LocalBusinessException(430,componentTypeName); + } + componentDetails .stream() .forEach(componentDetail -> { -- GitLab