Commit 361d47b2 by zhangkb

修改报表3算法逻辑

parent 85259b03
...@@ -170,7 +170,8 @@ public class IndicatorsReportService { ...@@ -170,7 +170,8 @@ public class IndicatorsReportService {
if(indReportData.getEffectiveIndCount()==null) { if(indReportData.getEffectiveIndCount()==null) {
indReportData.setEffectiveIndCount(1); indReportData.setEffectiveIndCount(1);
}else { }else {
indReportData.setEffectiveIndCount(indReportData.getEffectiveIndCount()+1); indReportData.setEffectiveIndCount(
indReportData.getEffectiveIndCount()+1);
} }
//算增幅 //算增幅
...@@ -183,13 +184,37 @@ public class IndicatorsReportService { ...@@ -183,13 +184,37 @@ public class IndicatorsReportService {
String calGowthValue = CalculateUtils.calGowth(calResult.getValue(), String calGowthValue = CalculateUtils.calGowth(calResult.getValue(),
sameCalResult.getValue(),growCalType); sameCalResult.getValue(),growCalType);
if(StringUtils.isNotBlank(calGowthValue)) { if(StringUtils.isNotBlank(calGowthValue)) {
if(Double.parseDouble(calGowthValue)>0) {//同比提升 if("1".equals(growCalType)) {//差比
//填充指标提升个数 if(Double.parseDouble(calGowthValue)>0) {//同比提升
if(indReportData.getIndImproveCount()==null) { //填充指标提升个数
indReportData.setIndImproveCount(1); if(indReportData.getIndImproveCount()==null) {
indReportData.setIndImproveCount(1);
}else {
indReportData.setIndImproveCount(
indReportData.getIndImproveCount()+1);
}
}
}else {
if(Double.parseDouble(calGowthValue)>0) {
if("0".equals(indRule)) {//正向
//填充指标提升个数
if(indReportData.getIndImproveCount()==null) {
indReportData.setIndImproveCount(1);
}else {
indReportData.setIndImproveCount(
indReportData.getIndImproveCount()+1);
}
}
}else { }else {
indReportData.setIndImproveCount( if("1".equals(indRule)) {//反向
indReportData.getIndImproveCount()+1); //填充指标提升个数
if(indReportData.getIndImproveCount()==null) {
indReportData.setIndImproveCount(1);
}else {
indReportData.setIndImproveCount(
indReportData.getIndImproveCount()+1);
}
}
} }
} }
improveValue.put(calResult.getCompareObj(),calGowthValue); improveValue.put(calResult.getCompareObj(),calGowthValue);
...@@ -197,14 +222,6 @@ public class IndicatorsReportService { ...@@ -197,14 +222,6 @@ public class IndicatorsReportService {
} }
} }
} }
//算指标提升率
if(indReportData.getEffectiveIndCount()!=null &&
indReportData.getIndImproveCount()!=null) {
String improveRate = String.format("%.4f",
new BigDecimal(indReportData.getIndImproveCount()/
indReportData.getEffectiveIndCount()*100.0));
indReportData.setIndImproveRate(improveRate);
}
//加入list中 //加入list中
dataList.add(indReportData); dataList.add(indReportData);
} }
...@@ -240,6 +257,14 @@ public class IndicatorsReportService { ...@@ -240,6 +257,14 @@ public class IndicatorsReportService {
if(DBIndReportData!=null) { if(DBIndReportData!=null) {
indReportData.setId(DBIndReportData.getId()); indReportData.setId(DBIndReportData.getId());
} }
//算指标提升率
if(indReportData.getEffectiveIndCount()!=null &&
indReportData.getIndImproveCount()!=null) {
String improveRate = String.format("%.4f",
new BigDecimal(indReportData.getIndImproveCount()/
indReportData.getEffectiveIndCount()*100.0));
indReportData.setIndImproveRate(improveRate);
}
for(Map.Entry<String, Integer> map : resultRank.entrySet()) { for(Map.Entry<String, Integer> map : resultRank.entrySet()) {
if(map.getValue()==1 || map.getValue()==2 || map.getValue()==3) { if(map.getValue()==1 || map.getValue()==2 || map.getValue()==3) {
if(indReportData.getCompareObj().equals(map.getKey())) { if(indReportData.getCompareObj().equals(map.getKey())) {
......
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