From 3182879841e366ce6e13af2bd448d1844a6dba31 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 14 Jan 2022 10:27:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=BB=84=E7=BB=84=E7=BB=87=E6=97=A5?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/StatsGroupServiceImpl.java | 15 +++++---------- .../stats/FactGroupAgencyDailyService.java | 2 +- .../impl/FactGroupAgencyDailyServiceImpl.java | 13 +++++-------- 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java index fa7f1e3b42..e1ae6dc1e2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -135,15 +135,10 @@ public class StatsGroupServiceImpl implements StatsGroupService { if (customerIds.size() != NumConstant.ZERO) { DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(formDTO); customerIds.forEach(customerId -> { - Boolean status = true; try { List customerAgencyInfos = dimAgencyService.getAgencyInfoByCustomerId(customerId); - List> partition = ListUtils.partition(customerAgencyInfos, NumConstant.ONE_HUNDRED); - for (List p : partition) { - List agencyGroupDaily = this.getAgencyGroupDaily(p, dimIdBean, customerId); - factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily, customerId,status); - status = false; - } + List agencyGroupDaily = this.getAgencyGroupDaily(customerAgencyInfos, dimIdBean, customerId); + factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily, customerId); } catch (Exception e) { log.error(String.format(GroupConstant.STATS_FAILED_AGENCY_DAILY, customerId, LocalDate.now(), e)); } @@ -186,13 +181,13 @@ public class StatsGroupServiceImpl implements StatsGroupService { * @Description 网格小组 【机关-日】 数据统计处理 * @author zxc */ - public List getAgencyGroupDaily(List agencyList, DimIdGenerator.DimIdBean timeDim, String customerId) { - if (CollectionUtils.isEmpty(agencyList)) { + public List getAgencyGroupDaily(List customerAgencyInfos, DimIdGenerator.DimIdBean timeDim, String customerId) { + if (customerAgencyInfos.size() == NumConstant.ZERO) { return new ArrayList<>(); } List result = new ArrayList<>(); String dateId = timeDim.getDateId(); -// List agencyList = dimAgencyService.getAgencyListByCustomerId(customerId); + List agencyList = dimAgencyService.getAgencyListByCustomerId(customerId); agencyList.forEach(agency -> { AgencyGroupDailyResultDTO agencyResult = new AgencyGroupDailyResultDTO(); String agencyId = agency.getId(); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java index 23b34b22af..812c2c73da 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java @@ -101,7 +101,7 @@ public interface FactGroupAgencyDailyService extends BaseService agencyList,String customerId,Boolean status); + void insertGroupAgencyDaily(List agencyList,String customerId); /** * @param diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java index b822dcaaa0..306849f76e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java @@ -113,15 +113,12 @@ public class FactGroupAgencyDailyServiceImpl extends BaseServiceImpl agencyList,String customerId,Boolean status) { + public void insertGroupAgencyDaily(List agencyList,String customerId) { if (!CollectionUtils.isEmpty(agencyList)){ - // true 为当前客户第一回进入,需要删除历史数据 - if (status){ - Integer delNum; - do { - delNum = baseDao.deleteInsertAgencyDailyByDateId(agencyList.get(NumConstant.ZERO).getDateId(),customerId); - }while (delNum > NumConstant.ZERO && delNum == NumConstant.ONE_THOUSAND); - } + Integer delNum; + do { + delNum = baseDao.deleteInsertAgencyDailyByDateId(agencyList.get(NumConstant.ZERO).getDateId(),customerId); + }while (delNum > NumConstant.ZERO && delNum == NumConstant.ONE_THOUSAND); List> partition = ListUtils.partition(agencyList, NumConstant.ONE_HUNDRED); partition.forEach(p -> { baseDao.insertGroupAgencyDaily(p);