diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java index 4117b32b7b..291cafb7eb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java @@ -232,9 +232,12 @@ public class StatsUserServiceImpl implements StatsUserService { //3.分批处理上传数据 List> partition = ListUtils.partition(formDTO.getDataList(), NumConstant.ONE_HUNDRED); - partition.forEach(p -> { + for (int i = 0; i < partition.size(); i++) { + List p = partition.get(i); //4.封装数据并执行 - p.forEach(m -> { + Iterator iterator = p.iterator(); + while (iterator.hasNext()) { + GmUploadDataFormDTO.DataList m = iterator.next(); AtomicReference bl = new AtomicReference<>(false); StringBuffer pid = new StringBuffer(""); StringBuffer pids = new StringBuffer(""); @@ -252,13 +255,10 @@ public class StatsUserServiceImpl implements StatsUserService { m.setPids(pids.toString()); } else { log.warn(String.format("网格员数据分析上报,数据错误,根据agencyId未查询到组织信息,客户Id->%s,组织Id->%s", m.getCustomerId(), m.getAgencyId())); + iterator.remove(); } - }); - //批量新增或修改数据 - if (!CollectionUtils.isEmpty(p)) { - dataStatsDao.saveOrUpGmUploadData(p); } - }); + } }