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); diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteStatisticalDailyDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteStatisticalDailyDao.xml index bcbe6a5a4d..0340a7ea14 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteStatisticalDailyDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteStatisticalDailyDao.xml @@ -147,7 +147,7 @@ votable_count, - + customer_id, created_by, @@ -180,7 +180,7 @@ #{item.votableCount}, - + #{item.customerId}, #{item.createdBy},