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