From a69761f594eac9df8429ef8065203d4481b1b612 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 4 Jan 2022 09:50:14 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=91=98=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E7=BB=9F=E8=AE=A1=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/extract/FactOriginProjectMainDailyDao.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index 60b6f10958..d35a30cb00 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -1176,7 +1176,7 @@ FROM fact_origin_project_main_daily WHERE - (ORIGIN = 'agency' OR ORIGIN = 'resi_event') + ORIGIN = 'agency' AND CUSTOMER_ID = #{customerId} AND DATE_ID = #{dateId} @@ -1194,7 +1194,7 @@ FROM fact_origin_project_main_daily WHERE - (ORIGIN = 'agency' OR ORIGIN = 'resi_event') + ORIGIN = 'agency' AND CUSTOMER_ID = #{customerId} AND DATE_ID <= #{dateId} From 91bd27cf39d8a41db80e44e6511c6c09a70ecdf6 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 4 Jan 2022 17:00:19 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=BF=99=E4=BA=9B=E4=BA=8B=E4=B8=8D?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/DemoController.java | 24 +++++++++++++++---- .../FactOriginExtractController.java | 15 +++++++++++- .../biz/impl/BizDataStatsServiceImpl.java | 11 +++++++-- .../impl/IndexOriginExtractServiceImpl.java | 9 ++++++- .../impl/FactOriginExtractServiceImpl.java | 9 ++++++- .../impl/ScreenExtractServiceImpl.java | 11 +++++++-- .../service/impl/StatsGroupServiceImpl.java | 10 +++++++- 7 files changed, 76 insertions(+), 13 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 5b6b444919..2ba667217c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -1,5 +1,6 @@ package com.epmet.controller; +import cn.hutool.core.collection.CollectionUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; @@ -63,9 +64,6 @@ import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.*; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; @@ -896,7 +894,15 @@ public class DemoController { if (StringUtils.isNotBlank(param.getCustomerId())) { customerIds.add(param.getCustomerId()); } else { - customerIds = dimCustomerService.selectCustomerIdPage(1, 100); + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)){ + customerIds.addAll(customerIdList); + } + } while (!CollectionUtil.isEmpty(customerIdList) && customerIdList.size() == pageSize); } for (String customerId : customerIds) { dateIds.forEach(dateId -> { @@ -943,7 +949,15 @@ public class DemoController { if (StringUtils.isNotBlank(formDTO.getCustomerId())) { customerIds.add(formDTO.getCustomerId()); } else { - customerIds = dimCustomerService.selectCustomerIdPage(1, 100); + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)){ + customerIds.addAll(customerIdList); + } + } while (!CollectionUtil.isEmpty(customerIdList) && customerIdList.size() == pageSize); } for (String customerId : customerIds) { ExtractOriginFormDTO paramDTO = new ExtractOriginFormDTO(); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java index cf3ce5abf5..53bed86c3c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java @@ -1,5 +1,7 @@ package com.epmet.controller; +import cn.hutool.core.collection.CollectionUtil; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; @@ -8,6 +10,7 @@ import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.service.evaluationindex.extract.todata.*; import com.epmet.service.stats.DimCustomerService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -15,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.ArrayList; import java.util.List; @@ -111,7 +115,16 @@ public class FactOriginExtractController { } } else { - List customerIds = dimCustomerService.selectCustomerIdPage(1, 100); + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; + List customerIds = new ArrayList(); + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)){ + customerIds.addAll(customerIdList); + } + } while (!CollectionUtil.isEmpty(customerIdList) && customerIdList.size() == pageSize); customerIds.forEach(customerId -> { ExtractOriginFormDTO dto = new ExtractOriginFormDTO(); dto.setCustomerId(customerId); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/biz/impl/BizDataStatsServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/biz/impl/BizDataStatsServiceImpl.java index fbeb7a391f..c892717067 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/biz/impl/BizDataStatsServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/biz/impl/BizDataStatsServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.service.evaluationindex.extract.biz.impl; +import cn.hutool.core.collection.CollectionUtil; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; @@ -72,8 +73,14 @@ public class BizDataStatsServiceImpl implements BizDataStatsService { } else { //查询全部客户 int pageNo = NumConstant.ONE; - int pageSize = NumConstant.ONE_HUNDRED; - customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize); + int pageSize = NumConstant.ONE_THOUSAND; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)){ + customerIds.addAll(customerIdList); + } + } while (!CollectionUtil.isEmpty(customerIdList) && customerIdList.size() == pageSize); if (org.springframework.util.CollectionUtils.isEmpty(customerIds)) { log.error("exeDailyAll 获取客户Id为空"); return; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java index a30c0e3169..783b11feeb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.service.evaluationindex.extract.dataToIndex.impl; +import cn.hutool.core.collection.CollectionUtil; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.CustomerIdConstant; import com.epmet.commons.tools.constant.NumConstant; @@ -63,7 +64,13 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService } else { int pageNo = NumConstant.ONE; int pageSize = NumConstant.ONE_HUNDRED; - customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize); + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)){ + customerIds.addAll(customerIdList); + } + } while (!CollectionUtil.isEmpty(customerIdList) && customerIdList.size() == pageSize); if (CollectionUtils.isEmpty(customerIds)) { log.error("indexOriginExtractAll 获取客户Id为空"); return; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java index 3dee411e2a..b650e906d3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.service.evaluationindex.extract.todata.impl; +import cn.hutool.core.collection.CollectionUtil; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; @@ -73,7 +74,13 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { //查询全部客户 int pageNo = NumConstant.ONE; int pageSize = NumConstant.ONE_HUNDRED; - customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize); + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)){ + customerIds.addAll(customerIdList); + } + } while (!CollectionUtil.isEmpty(customerIdList) && customerIdList.size() == pageSize); if (CollectionUtils.isEmpty(customerIds)) { log.error("extractAll 获取客户Id为空"); return; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java index 0d3d541634..6d4e5c029f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl; +import cn.hutool.core.collection.CollectionUtil; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.CustomerIdConstant; import com.epmet.commons.tools.constant.NumConstant; @@ -107,7 +108,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { customerIds.add(extractOriginFormDTO.getCustomerId()); } else { int pageNo = NumConstant.ONE; - int pageSize = NumConstant.ONE_HUNDRED; + int pageSize = NumConstant.ONE_THOUSAND; customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize); } if (!CollectionUtils.isEmpty(customerIds)) { @@ -141,7 +142,13 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { } else { int pageNo = NumConstant.ONE; int pageSize = NumConstant.ONE_HUNDRED; - customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize); + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)){ + customerIds.addAll(customerIdList); + } + } while (!CollectionUtil.isEmpty(customerIdList) && customerIdList.size() == pageSize); } if (!CollectionUtils.isEmpty(customerIds)) { customerIds.forEach(customerId -> { 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 a6cc1d5c1d..2520d4bd89 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 @@ -1,5 +1,6 @@ package com.epmet.service.impl; +import cn.hutool.core.collection.CollectionUtil; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.GroupConstant; @@ -115,7 +116,14 @@ public class StatsGroupServiceImpl implements StatsGroupService { if (StringUtils.isNotBlank(formDTO.getCustomerId())) { customerIds.add(formDTO.getCustomerId()); } else { - customerIds = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)){ + customerIds.addAll(customerIdList); + } + } while (!CollectionUtil.isEmpty(customerIdList) && customerIdList.size() == pageSize); + } do { if (customerIds.size() != NumConstant.ZERO) { From e89f6f343de0ff4cef615125cfbe3b219bdec2ce Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 5 Jan 2022 11:07:24 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=B8=AD=E9=97=B4=E5=BA=93=E4=BC=9A?= =?UTF-8?q?=E6=B6=88=E8=B4=B9=20=E5=B9=B3=E9=98=B4=E5=92=8C=E4=B8=8B?= =?UTF-8?q?=E9=9D=A23=E4=B8=AA=E8=A1=97=E9=81=93=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=20=E6=89=80=E4=BB=A5=E5=8E=BB=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mq/listener/OpenDataProjectChangeEventListener.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataProjectChangeEventListener.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataProjectChangeEventListener.java index d3b65b6942..6c5f127cb9 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataProjectChangeEventListener.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataProjectChangeEventListener.java @@ -3,7 +3,6 @@ package com.epmet.opendata.mq.listener; import com.alibaba.fastjson.JSON; import com.epmet.commons.rocketmq.constants.MQUserPropertys; import com.epmet.commons.rocketmq.messages.DisputeProcessMQMsg; -import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.distributedlock.DistributedLock; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; @@ -73,10 +72,6 @@ public class OpenDataProjectChangeEventListener implements MessageListenerConcur logger.info("【开放数据事件监听器】-项目信息变更-收到消息内容:{}, 操作:{}, pendingMsgLabel:{}", msg, tags, pendingMsgLabel); DisputeProcessMQMsg obj = JSON.parseObject(msg, DisputeProcessMQMsg.class); - //只推送平阴数据 - if (!StrConstant.PY_CUSTOMER.equals(obj.getCustomerId())) { - return; - } EventInfoFormDTO formDTO = ConvertUtils.sourceToTarget(obj, EventInfoFormDTO.class); RLock lock = null;