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 864b805eb12269dcd282f11ea707ca15df09c984..dce5c49ed07dec70db01488f43595843fc12d0fc 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 -> {