Browse Source

总分计算

dev_shibei_match
jianjun 5 years ago
parent
commit
ecc1ee9738
  1. 4
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java
  2. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/CpcIndexCalculateServiceImpl.java

4
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java

@ -23,6 +23,10 @@ public class CalculateCommonFormDTO implements Serializable {
*/
private String customerId;
public CalculateCommonFormDTO() {
super();
}
public CalculateCommonFormDTO(String customerId, String monthId) {
this.monthId=monthId;
this.customerId=customerId;

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

@ -84,7 +84,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
if (totalEntity == null) {
totalEntity = ConvertUtils.sourceToTarget(part, CpcScoreEntity.class);
totalEntity.setIsTotal(NumConstant.ONE_STR);
totalEntity.setIndexCode(indexGroupDetailEntity.getIndexCode());
totalEntity.setIndexCode(IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode());
totalEntity.setScore(new BigDecimal(0));
cpcScoreTotalMap.put(userId, totalEntity);
}
@ -102,11 +102,6 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
}
private void calculatePartScore(CalculateCommonFormDTO formDTO) {
Map<String, String> indexCodeFieldReList = indexCodeFieldReService.getIndexCodeFieldReMap();
if (CollectionUtils.isEmpty(indexCodeFieldReList)) {
log.error("cpcIndexCalculate have any indexcodefieldre");
throw new RenException("指标code与字段关系记录不存在");
}
//计算最大最小值
Map<String, Object> minAndMaxMap = factIndexPartyAblityCpcMonthlyDao.getExtremeValue(formDTO.getCustomerId());
if (CollectionUtils.isEmpty(minAndMaxMap)) {
@ -186,6 +181,10 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
log.info("计算的结果:{}", result);
//处理结果
if (CollectionUtils.isEmpty(result)){
log.error("calculateScore calculateScore return empty");
return;
}
saveCpcScore(formDTO, scoreEntityMap, parentIndexCode, result);
}

Loading…
Cancel
Save