From 13f9eb7c282affe7800d68445ee545f43c39dd01 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 9 Sep 2020 16:32:17 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84FeignClient=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java index 7be7cea353..27d5c239d4 100644 --- a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java @@ -21,8 +21,8 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:25 */ -//@FeignClient(name = ServiceConstant.OPER_CRM_SERVER, fallback = OperCrmOpenFeignClientFallback.class) -@FeignClient(name = ServiceConstant.OPER_CRM_SERVER, fallback = OperCrmOpenFeignClientFallback.class, url = "118.190.150.119:48080/api") +@FeignClient(name = ServiceConstant.OPER_CRM_SERVER, fallback = OperCrmOpenFeignClientFallback.class) +//@FeignClient(name = ServiceConstant.OPER_CRM_SERVER, fallback = OperCrmOpenFeignClientFallback.class, url = "118.190.150.119:48080/api") public interface OperCrmOpenFeignClient { /** * 获取客户信息 From c45d4d26608e308de26fb0e6b3a31775fbe06769 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 9 Sep 2020 17:12:04 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E6=8F=92=E5=85=A5=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcal/CpcSubScoreDao.java | 5 +-- .../impl/CpcIndexCalculateServiceImpl.java | 34 ++++++++++++++++--- .../indexcal/CpcSubScoreDao.xml | 19 +++++------ 3 files changed, 41 insertions(+), 17 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcSubScoreDao.java index 8865f93609..54226d0cc7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcSubScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcSubScoreDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.evaluationindex.indexcal; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity; +import com.epmet.entity.evaluationindex.indexcal.CpcSubScoreEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -78,9 +79,9 @@ public interface CpcSubScoreDao extends BaseDao { **/ BigDecimal selectGridJoinIssueAvgValue(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("gridId") String gridId); - int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode); + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("allParentCode") String allParentCode); List getPartScore(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("allParentCode") String allParentCode); - int insertBatch(@Param("list") Collection values); + int insertBatch(@Param("list") Collection values); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java index 0bc398ce91..139353e83c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -9,9 +9,11 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; import com.epmet.dao.evaluationindex.indexcal.CpcScoreDao; +import com.epmet.dao.evaluationindex.indexcal.CpcSubScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity; +import com.epmet.entity.evaluationindex.indexcal.CpcSubScoreEntity; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; import com.epmet.eum.IndexCodeEnum; @@ -49,6 +51,8 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { private IndexCodeFieldReService indexCodeFieldReService; @Autowired private CpcScoreDao cpcScoreDao; + @Autowired + private CpcSubScoreDao cpcSubScoreDao; @Override public Boolean cpcIndexCalculate(CalculateCommonFormDTO formDTO) { @@ -136,6 +140,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { * @param indexCode 指标code 非必填 * @param values */ + @Transactional(rollbackFor = Exception.class) private void deleteAndInsertBatch(CalculateCommonFormDTO formDTO, Collection values, String indexCode) { cpcScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode); cpcScoreDao.insertBatch(values); @@ -242,23 +247,42 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { public void saveCpcScore(CalculateCommonFormDTO formDTO, Map indexDetails, String parentIndexCode, HashMap result) { List list = new ArrayList<>(); - result.forEach((userId, score) -> { + List subList = new ArrayList<>(); + String allParentIndexCode = null; + for (Map.Entry entry : result.entrySet()) { + String userId = entry.getKey(); + CalculateResult score = entry.getValue(); CpcScoreEntity cpcScoreEntity = indexDetails.get(userId); cpcScoreEntity.setScore(score.getTotalScore()); - String allParentIndexCode = score.getDetails().get(0).getAllParentIndexCode(); + allParentIndexCode = score.getDetails().get(0).getAllParentIndexCode(); cpcScoreEntity.setAllParentIndexCode(allParentIndexCode.substring(0, allParentIndexCode.lastIndexOf(StrConstant.COLON))); list.add(cpcScoreEntity); CpcScoreEntity parent = ConvertUtils.sourceToTarget(cpcScoreEntity, CpcScoreEntity.class); score.getDetails().forEach(o -> { - CpcScoreEntity child = ConvertUtils.sourceToTarget(parent, CpcScoreEntity.class); + CpcSubScoreEntity child = ConvertUtils.sourceToTarget(parent, CpcSubScoreEntity.class); child.setIndexCode(o.getIndexCode()); child.setAllParentIndexCode(o.getAllParentIndexCode()); child.setScore(o.getScore()); - list.add(child); + subList.add(child); }); - }); + } + System.out.println("value:" + JSON.toJSONString(list)); this.deleteAndInsertBatch(formDTO, list, parentIndexCode); + this.deleteAndInsertSubBatch(formDTO, subList, allParentIndexCode); + } + + /** + * desc:根据客户id和月份Id 指标code 非必填 删除数据 + * + * @param formDTO + * @param subList + * @param parentIndexCode 指标code 非必填 + */ + @Transactional(rollbackFor = Exception.class) + public void deleteAndInsertSubBatch(CalculateCommonFormDTO formDTO, List subList, String parentIndexCode) { + cpcSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), parentIndexCode); + cpcSubScoreDao.insertBatch(subList); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcSubScoreDao.xml index 8372a60608..b1e069bab2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcSubScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcSubScoreDao.xml @@ -4,13 +4,12 @@ - delete from fact_index_cpc_score + delete from fact_index_cpc_sub_score where CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} and MONTH_ID = #{monthId,jdbcType=VARCHAR} - - and INDEX_CODE = #{indexCode,jdbcType=VARCHAR} - + and ALL_PARENT_INDEX_CODE = #{allParentCode,jdbcType=VARCHAR} + @@ -30,7 +29,7 @@ - INSERT INTO `fact_index_cpc_score` ( + INSERT INTO `fact_index_cpc_sub_score` ( `ID`, `CUSTOMER_ID`, `GRID_ID`, From c93af332c6a11e434f7b231b9a52e69e8cc479ef Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 9 Sep 2020 17:47:00 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E6=8C=87=E6=A0=87=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/evaluationindex/indexcal/AgencyScoreDao.xml | 4 ++-- .../mapper/evaluationindex/indexcal/CommunityScoreDao.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml index b6dab6b1a5..45768cdde6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml @@ -81,9 +81,9 @@ AND MONTH_ID = #{monthId} AND data_type = #{dataType} AND IS_TOTAL = "0" - AND INDEX_CODE = "zhilinengli" + AND (INDEX_CODE = "zhilinengli" OR INDEX_CODE = "dangjiannengli" - OR INDEX_CODE = "fuwunengli" + OR INDEX_CODE = "fuwunengli") From 92c18e04a36ae8259913159a9864c4efc062d4f3 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 9 Sep 2020 17:56:19 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E6=8C=87=E6=A0=87=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86=E5=8F=AA=E5=86=99=E5=85=A5?= =?UTF-8?q?=E5=88=B0index=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcoll/impl/FactIndexCollectServiceImpl.java | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java index 66201d3efb..ce32b2ff4d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java @@ -3,7 +3,6 @@ package com.epmet.service.evaluationindex.indexcoll.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.OrgTypeConstant; import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; @@ -20,9 +19,6 @@ import com.epmet.dto.screen.FactIndexCommunityScoreDTO; import com.epmet.dto.screen.FactIndexGridScoreDTO; import com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO; import com.epmet.dto.screencoll.form.IndexDataYearlyFormDTO; -import com.epmet.entity.evaluationindex.indexcal.AgencyScoreEntity; -import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity; -import com.epmet.entity.evaluationindex.screen.FactIndexCommunityScoreEntity; import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity; import com.epmet.eum.IndexCodeEnum; @@ -83,7 +79,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { @Autowired private ScreenCustomerAgencyDao screenCustomerAgencyDao; - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertGridPartyMemberData(GridPartyMemberDataFormDTO formDTO, String customerId) { @@ -99,7 +94,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertGridPartyAbility(GridPartyAbilityDataFormDTO formDTO, String customerId) { @@ -114,7 +108,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertOrgPartyAbility(OrgPartyAbilityDataFormDTO formDTO, String customerId) { @@ -129,7 +122,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertGridServiceAbility(GridServiceAbilityDataFormDTO formDTO, String customerId) { @@ -144,7 +136,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertOrgServiceAbility(OrgServiceAbilityDataFormDTO formDTO, String customerId) { @@ -159,7 +150,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertGridGovrnAbility(GridGovrnAbilityDataFormDTO formDTO, String customerId) { @@ -174,7 +164,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertOrgGovrnAbility(OrgGovrnAbilityDataFormDTO formDTO, String customerId) { @@ -189,7 +178,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertDeptGovrnAbility(DeptGovrnAbilityDataFormDTO formDTO, String customerId) { @@ -204,7 +192,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertScreenIndexDataMonthlyAndYearly(String monthId, String customerId) { From 9624b05e7bfe49e0a2ebd25a0556314dac3df882 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 9 Sep 2020 18:09:10 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{V0.0.4__add_anningejia.sql => V0.0.5__add_anningejia.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/{V0.0.4__add_anningejia.sql => V0.0.5__add_anningejia.sql} (100%) diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.4__add_anningejia.sql b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.5__add_anningejia.sql similarity index 100% rename from epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.4__add_anningejia.sql rename to epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.5__add_anningejia.sql From 85fbcbd8d4f675cd13c22d67e240da535f9c70f1 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 10 Sep 2020 09:30:31 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E5=8F=AA=E6=9C=89=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E9=83=A8=E9=97=A8=E7=9A=84=E4=BA=8B=E5=AE=9E=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E6=97=B6=E6=97=A0=E9=9C=80=E8=B5=8B=E5=80=BC50?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcal/impl/DeptScoreServiceImpl.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java index dba7178f96..6dc176a887 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java @@ -106,12 +106,14 @@ public class DeptScoreServiceImpl extends BaseServiceImpl minAndMaxMap = factIndexGovrnAblityDeptMonthlyDao.selectExtremeValue(formDTO); @@ -203,15 +205,15 @@ public class DeptScoreServiceImpl extends BaseServiceImpl resultMap = new HashMap<>(); resultMap.put(entity.getDeptId(), new BigDecimal(NumConstant.FIFTY_STR)); this.saveDeptScoreEntity(formDTO, resultMap); - } + }*/ /** * @param indexList From 58834d9246b7a9dca25c9c12d6f3eca98b268ac8 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 10 Sep 2020 09:47:35 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E5=8F=AA=E6=9C=89=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=9A=84=E4=BA=8B=E5=AE=9E=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E6=97=B6=E6=97=A0=E9=9C=80=E8=B5=8B=E5=80=BC50?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/GridCorreLationServiceImpl.java | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java index 1db443914c..e9d7dbd51a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java @@ -136,11 +136,13 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { if (NumConstant.ZERO == total) { log.warn(String.format("customerId=%s,monthId=%s,没有上传网格相关-党建能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); return; - } else if (NumConstant.ONE == total) { + } + //只有一个网格的事实记录时无需处理以下代码注释 + /*else if (NumConstant.ONE == total) { //只有一个网格时 log.warn(String.format("indexCode:%s,customerId:%s,monthId:%s,only one fact_index_party_ablity_grid_monthly record",IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),formDTO.getCustomerId(),formDTO.getMonthId())); this.handleOneGridScene(formDTO,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); - } + }*/ //总页数,进行批量查询,批量计算 int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE); log.info(String.format("共%s条数据,分%s次计算", total, totalPage)); @@ -199,7 +201,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @description 只有一条事实记录时,分值默认赋50 * @Date 2020/9/2 14:35 **/ - private void handleOneGridScene(CalculateCommonFormDTO formDTO, String indexCode) { + /*private void handleOneGridScene(CalculateCommonFormDTO formDTO, String indexCode) { List> resultMapList = new ArrayList<>(); HashMap resultMap = new HashMap<>(); String gridId =null; @@ -215,7 +217,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { // 保存中间表 saveGridCorreLationResult(formDTO, resultMapList, indexCode, NumConstant.ZERO_STR); } - +*/ /** * @param calculateCommonFormDTO * @return java.util.Map @@ -479,11 +481,13 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { if (NumConstant.ZERO == total) { log.warn(String.format("customerId%s,monthId%s,没有上传网格相关-治理能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); return; - }else if (NumConstant.ONE == total) { + } + //只有一个网格的事实记录时无需处理以下代码注释 + /*else if (NumConstant.ONE == total) { //只有一个网格时 log.warn(String.format("indexCode:%s,customerId:%s,monthId:%s,only one fact_index_govrn_ablity_grid_monthly record",IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),formDTO.getCustomerId(),formDTO.getMonthId())); this.handleOneGridScene(formDTO,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - } + }*/ //总页数,进行批量查询,批量计算 int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE); log.info(String.format("共%s条数据,分%s次计算", total, totalPage)); @@ -546,11 +550,13 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { if (NumConstant.ZERO == total) { log.warn(String.format("customerId:%s,monthId:%s,没有上传网格相关-服务能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); return; - }else if (NumConstant.ONE == total) { + } + //只有一个网格的事实记录时无需处理以下代码注释 + /*else if (NumConstant.ONE == total) { //只有一个网格时 log.warn(String.format("indexCode:%s,customerId:%s,monthId:%s,only one fact_index_service_ablity_grid_monthly record",IndexCodeEnum.FU_WU_NENG_LI.getCode(),formDTO.getCustomerId(),formDTO.getMonthId())); this.handleOneGridScene(formDTO,IndexCodeEnum.FU_WU_NENG_LI.getCode()); - } + }*/ //总页数,进行批量查询,批量计算 int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE); log.info(String.format("共%s条数据,分%s次计算", total, totalPage)); From 89ea820ecd90be3c4c7e5d9daa20066fa319963f Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 10 Sep 2020 09:51:02 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E6=9A=82=E6=97=B6=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E6=8F=92=E5=85=A5=20=E8=BF=98=E9=9C=80=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcal/impl/GridCorreLationServiceImpl.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java index e9d7dbd51a..707a462ba0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java @@ -361,7 +361,11 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { } if (!CollectionUtils.isEmpty(gridScoreEntityList)) { gridScoreDao.deleteByCusAndMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode, isTotal); - gridScoreDao.insertBatches(gridScoreEntityList); + //批量插入 + List> partition = ListUtils.partition(gridScoreEntityList, 100); + partition.forEach(list -> { + gridScoreDao.insertBatches(list); + }); } } @@ -634,7 +638,11 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { } if (!CollectionUtils.isEmpty(gridScoreEntityList)) { gridScoreDao.deleteByCusAndMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode, NumConstant.ONE_STR); - gridScoreDao.insertBatches(gridScoreEntityList); + //批量插入 + List> partition = ListUtils.partition(gridScoreEntityList, 100); + partition.forEach(list -> { + gridScoreDao.insertBatches(list); + }); } }