Commit deee667d by zhangkb

修改子首页获取特定指标接口

parent 3543c5b1
......@@ -49,7 +49,7 @@ public class IndexReportService {
date = calResults.get(0).getDate();
//获取同期值
DriveIndCalResultDef sameResult = driveIndCalResultDefMapper.
findByIndIdAndDateAndCompareObj(entry.getKey(), date, compareObj);
findByIndIdAndDateAndCompareObj(entry.getKey(), (date-100), compareObj);
if(sameResult!=null) {
//获取指标的同比类型以及指标的正反向类型
String growCalType = driveIndDef.getGrowCalType();
......@@ -59,14 +59,16 @@ public class IndexReportService {
indMap.put("rate", rate);
if(StringUtils.isNotBlank(indRule) && StringUtils.isNotBlank(rate)) {
if("0".equals(indRule)) {//正向
indMap.put("trend", "0");//趋差
if(Double.parseDouble(rate)>0) {
indMap.put("trend", "1");//趋好
}else {
indMap.put("trend", "0");//趋差
}
}else {//反向
indMap.put("trend", "0");//趋差
if(Double.parseDouble(rate)<0) {
indMap.put("trend", "1");//趋好
}else {
indMap.put("trend", "0");//趋差
}
}
}else {
......
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