Commit 778d9da8 by zhangkb

修改报表1字段类型和填值逻辑

parent 0c1d868f
package com.keymobile.indicators.model.entity.report; package com.keymobile.indicators.model.entity.report;
import java.math.BigDecimal;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType; import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
...@@ -27,15 +29,15 @@ public class IndicatorsReportOne { ...@@ -27,15 +29,15 @@ public class IndicatorsReportOne {
private String unit;//指标单位 private String unit;//指标单位
private String depart;//指标归属部门 private String depart;//指标归属部门
private Integer catalogType;//指标归属类别 private Integer catalogType;//指标归属类别
private String currentValue;//本期值 private BigDecimal currentValue;//本期值
private String lastSameValue;// 同期值 private BigDecimal lastSameValue;// 同期值
private String valueRate;//同比 private BigDecimal valueRate;//同比
private String valueRateRank;//同比增幅排名 private String valueRateRank;//同比增幅排名
private String currentRank;//本期排名 private String currentRank;//本期排名
private String lastSameRank;//同期排名 private String lastSameRank;//同期排名
private String currentScore;//本期综合评分 private BigDecimal currentScore;//本期综合评分
private String currentImprove;//本期改善提升评分 private BigDecimal currentImprove;//本期改善提升评分
private String lastSameScore;//同期综合评分 private BigDecimal lastSameScore;//同期综合评分
private String lastSameImprove;//同期改善提升评分 private BigDecimal lastSameImprove;//同期改善提升评分
private String code;//编码标识 private String code;//编码标识
} }
...@@ -504,10 +504,10 @@ public class IndicatorsReportService { ...@@ -504,10 +504,10 @@ public class IndicatorsReportService {
String indRule = driveIndDef.getIndRule(); String indRule = driveIndDef.getIndRule();
Map<String,String> valueRate = new HashMap<>(); Map<String,String> valueRate = new HashMap<>();
for(IndicatorsReportOne indReportData : datas) { for(IndicatorsReportOne indReportData : datas) {
if(StringUtils.isBlank(indReportData.getValueRate())) { if(indReportData.getValueRate()==null) {
continue; continue;
} }
valueRate.put(indReportData.getCompareObj(), indReportData.getValueRate()); valueRate.put(indReportData.getCompareObj(), String.valueOf(indReportData.getValueRate()));
} }
if(!valueRate.isEmpty()) { if(!valueRate.isEmpty()) {
//增幅排名 //增幅排名
...@@ -845,12 +845,16 @@ public class IndicatorsReportService { ...@@ -845,12 +845,16 @@ public class IndicatorsReportService {
indReportData.setCompareObj(indiData.getDim1());//对标对象 indReportData.setCompareObj(indiData.getDim1());//对标对象
indReportData.setCompareObjDesc(indiData.getDim1Desc());//对标对象描述 indReportData.setCompareObjDesc(indiData.getDim1Desc());//对标对象描述
indReportData.setCompareDate(indiData.getDim2()); indReportData.setCompareDate(indiData.getDim2());
indReportData.setCurrentValue(indiData.getValue()); if(StringUtils.isNotBlank(indiData.getValue())) {
indReportData.setCurrentValue(new BigDecimal(indiData.getValue()));
}
//查找同期基础项 //查找同期基础项
IndicatorsData sameIndData = baseIndDataService.getSingleIndData(indiData.getIndId(), IndicatorsData sameIndData = baseIndDataService.getSingleIndData(indiData.getIndId(),
(indiData.getDim2()-100), indiData.getDim1()); (indiData.getDim2()-100), indiData.getDim1());
if(sameIndData!=null) { if(sameIndData!=null) {
indReportData.setLastSameValue(sameIndData.getValue()); if(StringUtils.isNotBlank(sameIndData.getValue())) {
indReportData.setLastSameValue(new BigDecimal(sameIndData.getValue()));
}
} }
return indReportData; return indReportData;
} }
...@@ -868,18 +872,30 @@ public class IndicatorsReportService { ...@@ -868,18 +872,30 @@ public class IndicatorsReportService {
indReportData.setCompareObj(calData.getCompareObj());//对标对象 indReportData.setCompareObj(calData.getCompareObj());//对标对象
indReportData.setCompareObjDesc(calData.getCompareObjDesc());//对标对象描述 indReportData.setCompareObjDesc(calData.getCompareObjDesc());//对标对象描述
indReportData.setCompareDate(calData.getDate()); indReportData.setCompareDate(calData.getDate());
indReportData.setCurrentValue(calData.getValue()); if(StringUtils.isNotBlank(calData.getValue())) {
indReportData.setCurrentValue(new BigDecimal(calData.getValue()));
}
indReportData.setCurrentRank(calData.getRank()==null ? null : calData.getRank().toString()); indReportData.setCurrentRank(calData.getRank()==null ? null : calData.getRank().toString());
indReportData.setCurrentScore(calData.getScore()); if(StringUtils.isNotBlank(calData.getScore())) {
indReportData.setCurrentImprove(calData.getImproveScore()); indReportData.setCurrentScore(new BigDecimal(calData.getScore()));
}
if(StringUtils.isNotBlank(calData.getImproveScore())) {
indReportData.setCurrentImprove(new BigDecimal(calData.getImproveScore()));
}
//查找同期结果 //查找同期结果
DriveIndCalResultDef sameCalData = driveIndCalResultDefMapper.findByIndIdAndDateAndCompareObj( DriveIndCalResultDef sameCalData = driveIndCalResultDefMapper.findByIndIdAndDateAndCompareObj(
calData.getIndId(), (calData.getDate()-100), calData.getCompareObj()); calData.getIndId(), (calData.getDate()-100), calData.getCompareObj());
if(sameCalData!=null) { if(sameCalData!=null) {
indReportData.setLastSameValue(sameCalData.getValue()); if(StringUtils.isNotBlank(sameCalData.getValue())) {
indReportData.setLastSameValue(new BigDecimal(sameCalData.getValue()));
}
indReportData.setLastSameRank(sameCalData.getRank()==null ? null : sameCalData.getRank().toString()); indReportData.setLastSameRank(sameCalData.getRank()==null ? null : sameCalData.getRank().toString());
indReportData.setLastSameScore(sameCalData.getScore()); if(StringUtils.isNotBlank(sameCalData.getScore())) {
indReportData.setLastSameImprove(sameCalData.getImproveScore()); indReportData.setLastSameScore(new BigDecimal(sameCalData.getScore()));
}
if(StringUtils.isNotBlank(sameCalData.getImproveScore())) {
indReportData.setLastSameImprove(new BigDecimal(sameCalData.getImproveScore()));
}
//算同比 //算同比
String growCalType = "1"; String growCalType = "1";
if(driveIndDef!=null && StringUtils.isNotBlank(driveIndDef.getGrowCalType())) { if(driveIndDef!=null && StringUtils.isNotBlank(driveIndDef.getGrowCalType())) {
...@@ -887,7 +903,9 @@ public class IndicatorsReportService { ...@@ -887,7 +903,9 @@ public class IndicatorsReportService {
} }
String calGowth = CalculateUtils.calGowth(calData.getValue(), sameCalData.getValue(), String calGowth = CalculateUtils.calGowth(calData.getValue(), sameCalData.getValue(),
growCalType); growCalType);
indReportData.setValueRate(calGowth); if(StringUtils.isNotBlank(calGowth)) {
indReportData.setValueRate(new BigDecimal(calGowth));
}
} }
return indReportData; return indReportData;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment