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) {