From 025ef4209361b0a106ae19f6e512e6ab5963866e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 22 Sep 2020 17:01:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=88=E8=BF=9B=E6=A8=A1=E8=8C=83=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=8A=BD=E5=8F=96=E5=88=B0=E5=A4=A7=E5=B1=8F=E8=A1=A8?= =?UTF-8?q?screen=5Fpioneer=5FdataV0.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/ScreenPioneerDataDao.java | 14 +++- .../impl/CalCpcIndexServiceImpl.java | 15 +---- .../impl/CalGridIndexServiceImpl.java | 27 +------- .../impl/PioneerDataExtractServiceImpl.java | 4 +- ...FactIndexPartyAblityCpcMonthlyService.java | 16 ++--- ...tIndexServiceAblityGridMonthlyService.java | 19 ++---- ...IndexPartyAblityCpcMonthlyServiceImpl.java | 34 +++++----- ...exServiceAblityGridMonthlyServiceImpl.java | 40 ++++------- .../screen/ScreenPioneerDataService.java | 13 ++++ .../impl/ScreenPioneerDataServiceImpl.java | 42 ++++++++++-- .../impl/ShiBeiScreenCollServiceImpl.java | 3 +- .../screen/ScreenPioneerDataDao.xml | 66 ++++++++++++++++++- 12 files changed, 176 insertions(+), 117 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java index c9307411d5..becb9d1034 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java @@ -43,7 +43,10 @@ public interface ScreenPioneerDataDao extends BaseDao { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - Integer deletePioneerData(@Param("customerId") String customerId); + Integer deletePioneerData(@Param("customerId") String customerId, + @Param("orgType") String orgType, + @Param("dataEndTime")String dataEndTime, + @Param("deleteSize") Integer deleteSize); /** * 10、党建引领-先锋模范数据 @@ -74,4 +77,13 @@ public interface ScreenPioneerDataDao extends BaseDao { * @Date 2020/9/22 15:03 **/ List initAgencyPioneerDataList(@Param("customerId")String customerId, @Param("agencyLevel")String agencyLevel); + + /** + * @return void + * @param list + * @author yinzuomei + * @description 插入 entity + * @Date 2020/9/22 15:55 + **/ + void insertBatchEntity(@Param("list") List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java index 6eef7b395c..a837550337 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java @@ -2,7 +2,6 @@ package com.epmet.service.evaluationindex.extract.dataToIndex.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.constant.IndexCalConstant; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; import com.epmet.service.evaluationindex.extract.dataToIndex.CalCpcIndexService; import com.epmet.service.evaluationindex.extract.todata.*; @@ -10,7 +9,6 @@ import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthl import com.epmet.service.stats.DimCustomerPartymemberService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.collections4.ListUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -63,9 +61,6 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { } String quarterId= DateUtils.getQuarterId(monthId); String yearId=DateUtils.getYearId(monthId); - //2、删除之前统计过的 - factIndexPartyAblityCpcMonthlyService.deleteFactIndexPartyAblityCpcMonthly(customerId, monthId); - //1、党员提出话题数 Map createTopicCountMap = calCreateTopicCount(customerId, monthId); @@ -88,7 +83,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { //9、自建群活跃度——议题转项目率 Map topicToIssueRatioMap = caltopicToIssueRatio(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups); - //3、计算实际值,更新 + //2、计算实际值,更新 for (FactIndexPartyAblityCpcMonthlyEntity indexPartyAblityCpcEntity : indexPartyAblityCpcList) { indexPartyAblityCpcEntity.setMonthId(monthId); indexPartyAblityCpcEntity.setQuarterId(quarterId); @@ -127,12 +122,8 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { indexPartyAblityCpcEntity.setTopicToIssueRatio(topicToIssueRatioMap.get(indexPartyAblityCpcEntity.getUserId())); } } - //4、分批插入批量插入 - List> partition = ListUtils.partition(indexPartyAblityCpcList, IndexCalConstant.INSERT_SIZE); - partition.forEach(list -> { - factIndexPartyAblityCpcMonthlyService.saveFactIndexPartyAblityCpcMonthlyEntity(list); - }); - + //3、删除之前统计过的、批插入批量插入 + factIndexPartyAblityCpcMonthlyService.delAndSavePartyAblityCpcMonthly(customerId,monthId,indexPartyAblityCpcList); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java index 1afad5f062..5e69ff1c2d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java @@ -1,11 +1,8 @@ package com.epmet.service.evaluationindex.extract.dataToIndex.impl; -import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.constant.DataSourceConstant; import com.epmet.constant.ExtractConstant; -import com.epmet.constant.IndexCalConstant; import com.epmet.constant.ProjectEvaluateConstant; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao; import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; @@ -72,8 +69,6 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { @Autowired private FactIndexServiceAblityGridMonthlyService factIndexServiceAbilityGridMonthlyService; @Autowired - private FactIndexServiceAblityGridMonthlyService factIndexServiceAblityGridMonthlyService; - @Autowired private ActInfoService actInfoService; @Autowired private UserService userService; @@ -459,13 +454,8 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { } } - //3、批量删 - factIndexServiceAblityGridMonthlyService.deleteBatchIndexServiceAblityGridMonthly(customerId,monthId); - //4、批量增 - List> partition = ListUtils.partition(entityList, IndexCalConstant.INSERT_SIZE); - partition.forEach(list -> { - this.saveFactIndexServiceAblityGridMonthlyEntity(list); - }); + //3、批量删、批量增 + factIndexServiceAbilityGridMonthlyService.delAndSaveServiceAbilityGridMonthly(customerId,monthId,entityList); return true; } @@ -479,19 +469,6 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { System.out.println(partyVolunteerRatio); }*/ - - /** - * @param list - * @return void - * @author yinzuomei - * @description 批量插入网格相关-服务能力指标表 - * @Date 2020/9/21 10:04 - **/ - @DataSource(DataSourceConstant.EVALUATION_INDEX) - private void saveFactIndexServiceAblityGridMonthlyEntity(List list) { - factIndexServiceAbilityGridMonthlyService.insertBatchEntity(list); - } - /** * @Description 小数四舍五入【保留六位小数】 * @param d diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java index b658ec71aa..f8230b191c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.constant.IndexCalConstant; import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity; import com.epmet.service.evaluationindex.extract.toscreen.PioneerDataExtractService; import com.epmet.service.evaluationindex.screen.ScreenPioneerDataService; @@ -48,6 +49,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService **/ @Override public void extractGridPioneerData(String customerId, String dateId) { + //查询客户下所有的网格,初始数据值为0 List gridList=screenPioneerDataService.initPioneerDataList(customerId,"grid", StrConstant.EPMETY_STR); if(CollectionUtils.isEmpty(gridList)){ return; @@ -56,7 +58,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService entity.setDataEndTime(dateId); }); - + screenPioneerDataService.delAndSavePioneerData(customerId,"grid",dateId, IndexCalConstant.DELETE_SIZE,gridList); } @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyService.java index 149ff64cab..5614ff29a3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyService.java @@ -34,18 +34,10 @@ public interface FactIndexPartyAblityCpcMonthlyService extends BaseService list); + void delAndSavePartyAblityCpcMonthly(String customerId, String monthId, List indexPartyAblityCpcList); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyService.java index 84b9862e9e..3249c1a7eb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyService.java @@ -31,15 +31,6 @@ import java.util.List; * @since v1.0.0 2020-09-21 */ public interface FactIndexServiceAblityGridMonthlyService extends BaseService { - /** - * @return void - * @param customerId - * @param monthId - * @author yinzuomei - * @description 批量删除网格相关-服务能力指标表 - * @Date 2020/9/21 16:38 - **/ - void deleteBatchIndexServiceAblityGridMonthly(String customerId, String monthId); /** * @return java.util.List @@ -52,10 +43,12 @@ public interface FactIndexServiceAblityGridMonthlyService extends BaseService list); + void delAndSaveServiceAbilityGridMonthly(String customerId, String monthId, List entityList); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityCpcMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityCpcMonthlyServiceImpl.java index 78072b7bed..33316c2eba 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityCpcMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityCpcMonthlyServiceImpl.java @@ -21,50 +21,46 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.IndexCalConstant; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyDao; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyService; +import org.apache.commons.collections4.ListUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.List; /** - * 党建能力-党员相关的事实表 + * 党建能力-党员相关的事实表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-09-21 */ @Service public class FactIndexPartyAblityCpcMonthlyServiceImpl extends BaseServiceImpl implements FactIndexPartyAblityCpcMonthlyService { + /** * @param customerId * @param monthId + * @param indexPartyAblityCpcList * @return void * @author yinzuomei - * @description 删除这个客户这个月 党员相关-党建能力的数据 - * @Date 2020/9/18 10:20 + * @description 先删后增 + * @Date 2020/9/22 16:30 **/ - @Override + @Transactional(rollbackFor = Exception.class) @DataSource(value = DataSourceConstant.EVALUATION_INDEX) - public void deleteFactIndexPartyAblityCpcMonthly(String customerId, String monthId) { + @Override + public void delAndSavePartyAblityCpcMonthly(String customerId, String monthId, List indexPartyAblityCpcList) { int deleteNum; do { deleteNum = baseDao.deleteFactIndexPartyAblityCpcMonthly(customerId, monthId); } while (deleteNum > NumConstant.ZERO); - } - - - /** - * @param list - * @return void - * @author yinzuomei - * @description 批量插入党员相关党建能力表 - * @Date 2020/9/18 10:27 - **/ - @Override - @DataSource(value = DataSourceConstant.EVALUATION_INDEX) - public void saveFactIndexPartyAblityCpcMonthlyEntity(List list) { - baseDao.insertBatchEntity(list); + List> partition = ListUtils.partition(indexPartyAblityCpcList, IndexCalConstant.INSERT_SIZE); + partition.forEach(list -> { + baseDao.insertBatchEntity(list); + }); } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexServiceAblityGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexServiceAblityGridMonthlyServiceImpl.java index a6683c5fd5..3d575b8958 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexServiceAblityGridMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexServiceAblityGridMonthlyServiceImpl.java @@ -21,10 +21,13 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.IndexCalConstant; import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyDao; import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity; import com.epmet.service.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyService; +import org.apache.commons.collections4.ListUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.List; @@ -37,23 +40,6 @@ import java.util.List; @Service public class FactIndexServiceAblityGridMonthlyServiceImpl extends BaseServiceImpl implements FactIndexServiceAblityGridMonthlyService { - /** - * @return void - * @param customerId - * @param monthId - * @author yinzuomei - * @description 批量删除网格相关-服务能力指标表 - * @Date 2020/9/21 10:16 - **/ - @Override - @DataSource(DataSourceConstant.EVALUATION_INDEX) - public void deleteBatchIndexServiceAblityGridMonthly(String customerId, String monthId) { - int deleteNum; - do { - deleteNum = baseDao.deleteFactIndexServiceAblityGridMonthly(customerId, monthId); - } while (deleteNum > NumConstant.ZERO); - } - /** * @param customerId * @return java.util.List @@ -67,16 +53,18 @@ public class FactIndexServiceAblityGridMonthlyServiceImpl extends BaseServiceImp return baseDao.initAllGridList(customerId); } - /** - * @param list - * @return void - * @author yinzuomei - * @description 批量插入网格相关-服务能力指标表 - * @Date 2020/9/21 10:05 - **/ + @Transactional(rollbackFor = Exception.class) @Override @DataSource(DataSourceConstant.EVALUATION_INDEX) - public void insertBatchEntity(List list) { - baseDao.insertBatchEntity(list); + public void delAndSaveServiceAbilityGridMonthly(String customerId, String monthId, List entityList) { + int deleteNum; + do { + deleteNum = baseDao.deleteFactIndexServiceAblityGridMonthly(customerId, monthId); + } while (deleteNum > NumConstant.ZERO); + + List> partition = ListUtils.partition(entityList, IndexCalConstant.INSERT_SIZE); + partition.forEach(list -> { + baseDao.insertBatchEntity(list); + }); } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPioneerDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPioneerDataService.java index 1add697600..1e42747a4a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPioneerDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPioneerDataService.java @@ -40,4 +40,17 @@ public interface ScreenPioneerDataService extends BaseService initPioneerDataList(String customerId, String orgType,String agencyLevel); + + /** + * @return void + * @param customerId + * @param orgType grid, agency + * @param dataEndTime + * @param deleteSize + * @param entityList 待插入的数据 + * @author yinzuomei + * @description 保存抽取结果 + * @Date 2020/9/22 15:54 + **/ + void delAndSavePioneerData(String customerId, String orgType, String dataEndTime, Integer deleteSize, List entityList); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java index f7299247ac..da031da750 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java @@ -20,12 +20,16 @@ package com.epmet.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.IndexCalConstant; import com.epmet.dao.evaluationindex.screen.ScreenPioneerDataDao; import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity; import com.epmet.service.evaluationindex.screen.ScreenPioneerDataService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; @@ -53,12 +57,40 @@ public class ScreenPioneerDataServiceImpl extends BaseServiceImpl initPioneerDataList(String customerId, String orgType, String agencyLevel) { - List list=new ArrayList<>(); - if("grid".equals(orgType)){ - list=baseDao.initGridPioneerDataList(customerId); - }else if("agency".equals(orgType)){ - list=baseDao.initAgencyPioneerDataList(customerId,agencyLevel); + List list = new ArrayList<>(); + if ("grid".equals(orgType)) { + list = baseDao.initGridPioneerDataList(customerId); + } else if ("agency".equals(orgType)) { + list = baseDao.initAgencyPioneerDataList(customerId, agencyLevel); } return list; } + + + /** + * @param customerId + * @param orgType grid, agency + * @param dataEndTime + * @param deleteSize + * @param entityList 待插入的数据 + * @return void + * @author yinzuomei + * @description 保存抽取结果 + * @Date 2020/9/22 15:54 + **/ + @Transactional(rollbackFor = Exception.class) + @DataSource(DataSourceConstant.EVALUATION_INDEX) + @Override + public void delAndSavePioneerData(String customerId, String orgType, String dataEndTime, Integer deleteSize, List entityList) { + int deleteNum; + do { + deleteNum = baseDao.deletePioneerData(customerId, orgType, dataEndTime, deleteSize); + } while (deleteNum != NumConstant.ZERO); + + List> partition = ListUtils.partition(entityList, IndexCalConstant.INSERT_SIZE); + partition.forEach(list -> { + baseDao.insertBatchEntity(list); + }); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java index bbb0585d44..3608048a66 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java @@ -22,6 +22,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.CompareConstant; import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.IndexCalConstant; import com.epmet.dao.evaluationindex.screen.*; import com.epmet.dto.screencoll.form.*; import com.epmet.entity.evaluationindex.screen.ScreenEventImgDataEntity; @@ -447,7 +448,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenPioneerDataDao.deletePioneerData(customerId); + deleteNum = screenPioneerDataDao.deletePioneerData(customerId,null,null, IndexCalConstant.DELETE_SIZE); } while (deleteNum != NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml index 70e8170efb..64f19416a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml @@ -3,10 +3,16 @@ - + delete from screen_pioneer_data where CUSTOMER_ID = #{customerId} - limit 1000; + + and ORG_TYPE=#{orgType} + + + and DATA_END_TIME=#{dataEndTime} + + limit #{deleteSize} @@ -117,4 +123,60 @@ and sca.`LEVEL`=#{agencyLevel} AND sca.CUSTOMER_ID = #{customerId} + + + insert into screen_pioneer_data + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + PUBLISH_ISSUE_TOTAL, + ISSUE_TOTAL, + TOPIC_TOTAL, + SHIFT_PROJECT_TOTAL, + RESOLVED_PROJECT_TOTAL, + PUBLISH_ISSUE_RATIO, + ISSUE_RATIO, + TOPIC_RATIO, + SHIFT_PROJECT_RATIO, + RESOLVED_PROJECT_RATIO, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + DATA_END_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.publishIssueTotal}, + #{item.issueTotal}, + #{item.topicTotal}, + #{item.shiftProjectTotal}, + #{item.resolvedProjectTotal}, + #{item.publishIssueRatio}, + #{item.issueRatio}, + #{item.topicRatio}, + #{item.shiftProjectRatio}, + #{item.resolvedProjectRatio}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now(), + #{item.dataEndTime} + ) + +