From f6e9f9862f1821ef5d12326381dd736da94ed559 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 21 Sep 2020 14:07:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=9B=B8=E5=85=B3=20?= =?UTF-8?q?=E5=85=9A=E5=BB=BA=E8=83=BD=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactIndexGovrnAblityGridMonthlyDao.java | 2 +- .../FactIndexPartyAblityGridMonthlyDao.java | 2 +- .../extract/impl/CalGridIndexServiceImpl.java | 52 ++++++++++++++++--- ...FactIndexGovrnAblityOrgMonthlyService.java | 2 +- ...FactIndexPartyAblityOrgMonthlyService.java | 2 +- ...IndexGovrnAblityOrgMonthlyServiceImpl.java | 4 +- ...IndexPartyAblityOrgMonthlyServiceImpl.java | 4 +- .../FactIndexGovrnAblityGridMonthlyDao.xml | 1 + .../FactIndexPartyAblityGridMonthlyDao.xml | 1 + 9 files changed, 54 insertions(+), 16 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java index 1d8b7eb7ba..927e157db0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java @@ -134,5 +134,5 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao> partition = ListUtils.partition(result, NumConstant.ONE_HUNDRED); + partition.forEach(r -> { + insertPartyAbility(r); + }); return true; } @@ -364,7 +368,11 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { } }); }); - delAndInsertGovernAbility(result,customerId,monthId); + delGovernAbility(customerId, monthId); + List> resultList = ListUtils.partition(result, NumConstant.ONE_HUNDRED); + resultList.forEach(r -> { + insertGovernAbility(r); + }); return true; } @@ -490,30 +498,58 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { } /** - * @Description 删除并插入党建能力的记录 + * @Description 插入党建能力的记录 * @param result * @author zxc * @date 2020/9/19 4:06 下午 */ @Transactional(rollbackFor = Exception.class) - public void delAndInsertPartyAbility(List result,String customerId,String monthId){ + public void insertPartyAbility(List result){ if (!CollectionUtils.isEmpty(result)){ - partyAbilityOrgMonthlyService.deleteOldPartyAbility(customerId, monthId); partyAbilityOrgMonthlyService.insertPartyAbility(result); } } /** - * @Description 删除并插入治理能力的记录 + * @Description 删除党建能力的记录 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/19 4:06 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void delPartyAbility(String customerId,String monthId){ + Integer delNum; + do { + delNum = partyAbilityOrgMonthlyService.deleteOldPartyAbility(customerId, monthId); + }while (delNum > NumConstant.ZERO); + } + + /** + * @Description 插入治理能力的记录 * @param result * @author zxc * @date 2020/9/19 4:06 下午 */ @Transactional(rollbackFor = Exception.class) - public void delAndInsertGovernAbility(List result,String customerId,String monthId){ + public void insertGovernAbility(List result){ if (!CollectionUtils.isEmpty(result)){ - governAbilityOrgMonthlyService.deleteOldGovernAbilityRecord(customerId, monthId); governAbilityOrgMonthlyService.insertGovernAbilityRecord(result); } } + + /** + * @Description 删除治理能力的记录 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/19 4:06 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void delGovernAbility(String customerId,String monthId){ + Integer delNum; + do { + delNum = governAbilityOrgMonthlyService.deleteOldGovernAbilityRecord(customerId, monthId); + }while (delNum > NumConstant.ZERO); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java index ade3c57f5b..272da9faef 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java @@ -39,5 +39,5 @@ public interface FactIndexGovrnAblityOrgMonthlyService extends BaseService diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml index 500f67dcc8..9208f9a533 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml @@ -265,5 +265,6 @@ WHERE CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + LIMIT 1000