Commit 361d47b2 by zhangkb

修改报表3算法逻辑

parent 85259b03
......@@ -170,7 +170,8 @@ public class IndicatorsReportService {
if(indReportData.getEffectiveIndCount()==null) {
indReportData.setEffectiveIndCount(1);
}else {
indReportData.setEffectiveIndCount(indReportData.getEffectiveIndCount()+1);
indReportData.setEffectiveIndCount(
indReportData.getEffectiveIndCount()+1);
}
//算增幅
......@@ -183,13 +184,37 @@ public class IndicatorsReportService {
String calGowthValue = CalculateUtils.calGowth(calResult.getValue(),
sameCalResult.getValue(),growCalType);
if(StringUtils.isNotBlank(calGowthValue)) {
if(Double.parseDouble(calGowthValue)>0) {//同比提升
//填充指标提升个数
if(indReportData.getIndImproveCount()==null) {
indReportData.setIndImproveCount(1);
if("1".equals(growCalType)) {//差比
if(Double.parseDouble(calGowthValue)>0) {//同比提升
//填充指标提升个数
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 {
indReportData.setIndImproveCount(
indReportData.getIndImproveCount()+1);
if("1".equals(indRule)) {//反向
//填充指标提升个数
if(indReportData.getIndImproveCount()==null) {
indReportData.setIndImproveCount(1);
}else {
indReportData.setIndImproveCount(
indReportData.getIndImproveCount()+1);
}
}
}
}
improveValue.put(calResult.getCompareObj(),calGowthValue);
......@@ -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中
dataList.add(indReportData);
}
......@@ -240,6 +257,14 @@ public class IndicatorsReportService {
if(DBIndReportData!=null) {
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()) {
if(map.getValue()==1 || map.getValue()==2 || map.getValue()==3) {
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