소스 검색

驾驶舱 项目画像接口

tags/24080901
PoffyZhang 1 년 전
부모
커밋
abcf3f41d4
2개의 변경된 파일8개의 추가작업 그리고 4개의 파일을 삭제
  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 파일 보기

@@ -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 파일 보기

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

/**


불러오는 중...
취소
저장