Browse Source

指标自身和下级代码暂存

dev_shibei_match
jianjun 5 years ago
parent
commit
edd0de7fab
  1. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridSubScoreDao.java
  2. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java
  3. 32
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java
  4. 19
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml
  5. 9
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml

12
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<GridSubScoreEntity> {
@Param("allParentIndexCode") String allParentIndexCode,
@Param("deleteSize") Integer deleteSize);
/**
* desc:获取网格5级指标分数 明细
*
* @param customerId
* @param monthId
* @param offset
* @param pageSize
* @return
*/
List<GridSubScoreDTO> selectSubListGroup(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("offset") int offset, @Param("pageSize") int pageSize);
List<GridSubScoreEntity> selectSubListByPath(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("allIndexCodePath") String allIndexCodePath);
}

9
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<IndexGroupDetailEntity> {
List<IndexGroupDetailEntity> getAllIndexWeightList(String customerId);
int deleteByCustomerId(@Param("customerId") String customerId);
/**
* desc:根据获取指标明细
*
* @param allIndexCodePath
* @param customerId
* @return
*/
List<IndexGroupDetailEntity> selectSelfSubIndex(@Param("customerId") String customerId, @Param("allIndexCodePath") String allIndexCodePath);
}

32
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<String> gridIdList = gridScoreDao.selectListGridId(formDTO.getCustomerId(), formDTO.getMonthId());
if (CollectionUtils.isEmpty(gridIdList)){
log.warn("calculateSelfSubScore have not any record");
return;
}
List<List<String>> partGridIds = ListUtils.partition(gridIdList, NumConstant.ONE_HUNDRED);
partGridIds.forEach(gridIds->{
int pageNo = NumConstant.ONE;
int pageSize = 2;//NumConstant.ONE_HUNDRED;
List<GridSubScoreDTO> list = gridSubScoreDao.selectSubListGroup(formDTO.getCustomerId(),formDTO.getMonthId(),(pageNo-NumConstant.ONE)*pageSize,pageSize);
});*/
//todo 指标添加缓存
List<IndexGroupDetailEntity> 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<IndexGroupDetailEntity> slefsubIndexList = indexGroupDetailDao.selectSelfSubIndex(formDTO.getCustomerId(), levelIndexPath);
if (CollectionUtils.isEmpty(slefsubIndexList)) {
log.error("calculateSelfSubScore customerId:{} have not any indexGroupDetail", formDTO.getCustomerId());
return;
}
//获取该能力下的分数
List<GridSubScoreEntity> subScore = gridSubScoreDao.selectSubListByPath(formDTO.getCustomerId(), formDTO.getMonthId(), levelIndexPath);
});
}
/**

19
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml

@ -65,21 +65,8 @@
limit #{deleteSize}
</if>
</delete>
<resultMap id="GridScoreDTOMap" type="com.epmet.dto.indexcal.GridSubScoreDTO">
<result property="gridId" column="GRID_ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="allParentIds" column="ALL_PARENT_IDS"/>
<result property="quarterId" column="QUARTER_ID"/>
<result property="yearId" column="YEAR_ID"/>
<result property="monthId" column="MONTH_ID"/>
<collection property="detailList" ofType="com.epmet.dto.indexcal.GridScoreDetailDTO" >
<result property="isTotal" column="IS_TOTAL"/>
<result property="score" column="SCORE"/>
<result property="indexCode" column="INDEX_CODE"/>
</collection>
</resultMap>
<select id="selectSubListGroup" resultMap="GridScoreDTOMap">
<select id="selectSubListByPath" resultType="com.epmet.entity.evaluationindex.indexcal.GridSubScoreEntity">
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}
</select>
</mapper>

9
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml

@ -22,4 +22,13 @@
<delete id="deleteByCustomerId">
delete from index_group_detail where CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
</delete>
<select id="selectSelfSubIndex" resultType="com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity">
select
ID,CUSTOMER_ID, INDEX_GROUP_ID, INDEX_ID, INDEX_CODE, WEIGHT, THRESHOLD, ALL_PARENT_INDEX_CODE, ALL_INDEX_CODE_PATH, CORRELATION
FROM index_group_detail
WHERE
CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} and STATUS = 'enable' and DEL_FLAG = '0'
and ALL_PARENT_INDEX_CODE like concat(#{allIndexCodePath,jdbcType=VARCHAR},'%')
</select>
</mapper>
Loading…
Cancel
Save