Browse Source

计算党员总分

master
jianjun 5 years ago
parent
commit
19634b110b
  1. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java
  2. 4
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java

@ -89,6 +89,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
cpcScoreTotalMap.put(userId, totalEntity); cpcScoreTotalMap.put(userId, totalEntity);
} }
BigDecimal total = part.getScore().multiply(indexGroupDetailEntity.getWeight()); BigDecimal total = part.getScore().multiply(indexGroupDetailEntity.getWeight());
log.warn("userId:{},分数:{},权重:{},total:{}", userId, part.getScore(), indexGroupDetailEntity.getWeight(), total);
totalEntity.setScore(totalEntity.getScore().add(total)); totalEntity.setScore(totalEntity.getScore().add(total));
} }
}); });
@ -147,7 +148,6 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
do { do {
list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize); list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize);
if (!CollectionUtils.isEmpty(list)) { if (!CollectionUtils.isEmpty(list)) {
//遍历指标分组 计算分数 //遍历指标分组 计算分数
List<Map<String, Object>> finalList = list; List<Map<String, Object>> finalList = list;
groupIndexDetailsMap.forEach((parentIndexCode, details) -> { groupIndexDetailsMap.forEach((parentIndexCode, details) -> {
@ -196,6 +196,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
} }
log.warn("计算的参数:{}", indexMap); log.warn("计算的参数:{}", indexMap);
HashMap<String, BigDecimal> result = calculate(indexMap); HashMap<String, BigDecimal> result = calculate(indexMap);
log.warn("计算的结果:{}", result);
//处理结果 //处理结果
saveCpcScore(formDTO, scoreEntityMap, parentIndexCode, result); saveCpcScore(formDTO, scoreEntityMap, parentIndexCode, result);

4
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml

@ -124,8 +124,8 @@
#{item.isTotal}, #{item.isTotal},
#{item.score}, #{item.score},
#{item.indexCode}, #{item.indexCode},
'0', 0,
0, 0,
'APP_USER', 'APP_USER',
now(), now(),
'APP_USER', 'APP_USER',

Loading…
Cancel
Save