|
|
@@ -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; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|