diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java index 9ba8e7a96a..2fe5b49d9a 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java @@ -47,6 +47,7 @@ public interface NumConstant { BigDecimal ONE_HUNDRED_DECIMAL = new BigDecimal(100); BigDecimal ZERO_DECIMAL = new BigDecimal(0); int ONE_THOUSAND = 1000; + int TEN_THOUSAND = 10000; int MAX = 99999999; int EIGHTY_EIGHT = 88; int EIGHTY = 80; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiICJobController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiICJobController.java index 5e29d9a6b2..d4f114c9ac 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiICJobController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiICJobController.java @@ -76,7 +76,7 @@ public class ShiBeiICJobController { * @Author sun * @Description 数据-项目-机关日(月)统计 **/ - private Result agencyProjectStats(String customerId, String dateId) { + private void agencyProjectStats(String customerId, String dateId) { try { if (StringUtils.isNotBlank(dateId)) { dateId = DateUtils.format(DateUtils.parseDate(dateId, DateUtils.DATE_PATTERN_YYYYMMDD)); @@ -89,7 +89,7 @@ public class ShiBeiICJobController { } catch (Exception e) { log.error("市北-项目状态数据写入失败,参数为:{}" + customerId + StrConstant.HYPHEN + dateId, e); } - return new Result(); + new Result(); } private void extractUserPointData(String customerId, String dateId) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyUserRankDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyUserRankDataServiceImpl.java index a419a53ee5..ed32077153 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyUserRankDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyUserRankDataServiceImpl.java @@ -25,6 +25,7 @@ import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.screen.ScreenPartyUserRankDataDao; import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; import com.epmet.service.evaluationindex.screen.ScreenPartyUserRankDataService; +import org.apache.commons.collections4.ListUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -61,7 +62,7 @@ public class ScreenPartyUserRankDataServiceImpl extends BaseServiceImpl NumConstant.ZERO); - baseDao.insertBatch(dataList); + ListUtils.partition(dataList,NumConstant.ONE_THOUSAND).forEach(part->baseDao.insertBatch(part)); } } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java index bacc003c5c..eb849391a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java @@ -1,6 +1,5 @@ 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.ProjectConstant; @@ -80,8 +79,8 @@ public class StatsProjectServiceImpl implements StatsProjectService { if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { customerAgencyStats(formDTO.getCustomerId(), date); } else { - int pageNo = 1; - int pageSize = 100; + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; List customerIdList = null; do { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); @@ -185,10 +184,10 @@ public class StatsProjectServiceImpl implements StatsProjectService { projectEntity.setCustomerId(customerId); projectEntity.setCreatedTime(date); projectEntity.setStatus(ProjectConstant.CLOSED); - projectEntity.setPageSize(NumConstant.ONE_THOUSAND); + projectEntity.setPageSize(NumConstant.TEN_THOUSAND); int pageNo = NumConstant.ONE; - int size = NumConstant.ZERO; - List processList = new ArrayList<>(); + int size; + List processList = null; do { //1.一千条一循环查询节点数据,封装每个组织对应数据 projectEntity.setPageNo(pageNo); @@ -278,7 +277,7 @@ public class StatsProjectServiceImpl implements StatsProjectService { } mapList.put(agency.getId(), entity); } - } while (size == NumConstant.ONE_THOUSAND); + } while (size == projectEntity.getPageSize()); //二、再分页查询项目表数据,封装每个组织的已结案已解决总数、已结案未解决总数;日增量中已结案已解决总数、已结案未解决总数 int num = NumConstant.ONE; @@ -374,7 +373,7 @@ public class StatsProjectServiceImpl implements StatsProjectService { } mapList.put(agency.getId(), entity); } - } while (size == NumConstant.ONE_THOUSAND); + } while (size == projectEntity.getPageSize()); List projectDateEntityList = new ArrayList<>(mapList.values()); //三、批量保存数据,先删后增 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java index 493004ce71..2780e27b38 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java @@ -81,6 +81,7 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl NumConstant.ZERO) { // 名称唯一 throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("【%s】已存在", formDTO.getCategoryName()), "分类名称已存在"); @@ -105,6 +106,7 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl NumConstant.ZERO) { + if (checkCategoryName(formDTO.getCustomerId(), formDTO.getCategoryName(), formDTO.getLevel(), origin.getParentCode(), formDTO.getCategoryId()) > NumConstant.ZERO) { // 名称唯一 throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("【%s】已存在", formDTO.getCategoryName()), "分类名称已存在"); }