From edd0de7fabb1c2dd43a2f34e8ff8d430f7a35e58 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 22 Sep 2020 18:12:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=87=E6=A0=87=E8=87=AA=E8=BA=AB=E5=92=8C?= =?UTF-8?q?=E4=B8=8B=E7=BA=A7=E4=BB=A3=E7=A0=81=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcal/GridSubScoreDao.java | 12 +------ .../screen/IndexGroupDetailDao.java | 9 ++++++ .../impl/GridCorreLationServiceImpl.java | 32 ++++++++++++------- .../indexcal/GridSubScoreDao.xml | 19 ++--------- .../screen/IndexGroupDetailDao.xml | 9 ++++++ 5 files changed, 43 insertions(+), 38 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridSubScoreDao.java index cae75ea905..5c8de8e83f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridSubScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridSubScoreDao.java @@ -18,7 +18,6 @@ package com.epmet.dao.evaluationindex.indexcal; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.indexcal.GridSubScoreDTO; import com.epmet.entity.evaluationindex.indexcal.GridSubScoreEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -57,14 +56,5 @@ public interface GridSubScoreDao extends BaseDao { @Param("allParentIndexCode") String allParentIndexCode, @Param("deleteSize") Integer deleteSize); - /** - * desc:获取网格5级指标分数 明细 - * - * @param customerId - * @param monthId - * @param offset - * @param pageSize - * @return - */ - List selectSubListGroup(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("offset") int offset, @Param("pageSize") int pageSize); + List selectSubListByPath(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("allIndexCodePath") String allIndexCodePath); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java index 85d05705ad..b173b94bd6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java @@ -38,4 +38,13 @@ public interface IndexGroupDetailDao extends BaseDao { List getAllIndexWeightList(String customerId); int deleteByCustomerId(@Param("customerId") String customerId); + + /** + * desc:根据获取指标明细 + * + * @param allIndexCodePath + * @param customerId + * @return + */ + List selectSelfSubIndex(@Param("customerId") String customerId, @Param("allIndexCodePath") String allIndexCodePath); } \ 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/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java index 21e398445c..bf04a2b990 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 @@ -15,6 +15,7 @@ import com.epmet.dao.evaluationindex.indexcal.GridSubScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyDao; +import com.epmet.dao.evaluationindex.screen.IndexGroupDetailDao; import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.indexcal.*; @@ -71,6 +72,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { private GridScoreDao gridScoreDao; @Autowired private GridSubScoreDao gridSubScoreDao; + @Autowired + private IndexGroupDetailDao indexGroupDetailDao; /** @@ -96,18 +99,25 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { } private void calculateSelfSubScore(CalculateCommonFormDTO formDTO) { - /* List gridIdList = gridScoreDao.selectListGridId(formDTO.getCustomerId(), formDTO.getMonthId()); - if (CollectionUtils.isEmpty(gridIdList)){ - log.warn("calculateSelfSubScore have not any record"); - return; - } - List> partGridIds = ListUtils.partition(gridIdList, NumConstant.ONE_HUNDRED); - partGridIds.forEach(gridIds->{ - int pageNo = NumConstant.ONE; - int pageSize = 2;//NumConstant.ONE_HUNDRED; - List list = gridSubScoreDao.selectSubListGroup(formDTO.getCustomerId(),formDTO.getMonthId(),(pageNo-NumConstant.ONE)*pageSize,pageSize); - });*/ + //todo 指标添加缓存 + List indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); + if (CollectionUtils.isEmpty(indexList)) { + log.error("calculateSelfSubScore customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【网格相关】指标权重信息不存在"); + } + indexList.forEach(index -> { + String levelIndexPath = index.getAllParentIndexCode().concat(StrConstant.COLON).concat(index.getIndexCode()); + //获取出指标之间的关系 + List slefsubIndexList = indexGroupDetailDao.selectSelfSubIndex(formDTO.getCustomerId(), levelIndexPath); + if (CollectionUtils.isEmpty(slefsubIndexList)) { + log.error("calculateSelfSubScore customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + return; + } + //获取该能力下的分数 + List subScore = gridSubScoreDao.selectSubListByPath(formDTO.getCustomerId(), formDTO.getMonthId(), levelIndexPath); + }); } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml index 36305146f3..563457b520 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml @@ -65,21 +65,8 @@ limit #{deleteSize} - - - - - - - - - - - - - - - SELECT CUSTOMER_ID customerId, GRID_ID gridId, @@ -95,6 +82,6 @@ WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} - AND MONTH_ID = #{monthId} + AND MONTH_ID = #{monthId} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml index 0fe297d9b0..52ef05f966 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml @@ -22,4 +22,13 @@ delete from index_group_detail where CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + + \ No newline at end of file