Procházet zdrojové kódy

驾驶舱 项目画像接口

master
PoffyZhang před 1 rokem
rodič
revize
abcf3f41d4
2 změnil soubory, kde provedl 8 přidání a 4 odebrání
  1. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/constant/DashboardConstant.java
  2. +5
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/DashboardProjectManage.java

+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/constant/DashboardConstant.java Zobrazit soubor

@@ -20,6 +20,9 @@ public class DashboardConstant {
public static final String LOG_OFF = "注销";

public static final String PROJECT_SIGNS = "项目体征";
public static final String FEILD_SAFETYMONEY = "safetyInputAmount";

public static final String ZREO_PERCEN = "0%";
}

}

+ 5
- 4
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/DashboardProjectManage.java Zobrazit soubor

@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import com.ningdatech.basic.util.StrPool;
import com.ningdatech.pmapi.dashboard.constant.ChartTypeEnum;
import com.ningdatech.pmapi.dashboard.constant.DashboardConstant;
import com.ningdatech.pmapi.dashboard.handle.ApplicationHandler;
@@ -379,21 +380,21 @@ public class DashboardProjectManage {
final Integer[] total = {0};
array.forEach(j -> {
JSONObject json = JSON.parseObject(JSON.toJSONString(j));
Integer safetyInputAmount = json.getInteger("safetyInputAmount");
Integer safetyInputAmount = json.getInteger(DashboardConstant.Protrait.FEILD_SAFETYMONEY);
total[0] += safetyInputAmount;
});
Integer totalAmount = total[0];
//申报金额
BigDecimal declareAmount = project.getDeclareAmount();
if(Objects.isNull(declareAmount) || declareAmount.compareTo(BigDecimal.ZERO) == 0){
return "0%";
return DashboardConstant.Protrait.ZREO_PERCEN;
}
BigDecimal rate = BigDecimal.valueOf(totalAmount).multiply(BigDecimal.valueOf(100))
.divide(declareAmount,BigDecimal.ROUND_CEILING, RoundingMode.HALF_UP)
.stripTrailingZeros();
return rate.toPlainString() + "%";
return rate.toPlainString() + StrPool.PERCENT;
}
return "0%";
return DashboardConstant.Protrait.ZREO_PERCEN;
}

/**


Načítá se…
Zrušit
Uložit