Merge pull request '用户需求、需求规格统计完成率修正' (#801) from wanjia9506/microservices:kanban_refact into product_refact

This commit is contained in:
wanjia9506 2025-01-16 10:49:35 +08:00
commit 9a43dd80fe
1 changed files with 5 additions and 3 deletions

View File

@ -312,9 +312,11 @@ public class PmsDashboardController extends BaseController {
resVo.setRatio(0);
//计算 各自的比率
int sum = statusStatVos.stream().mapToInt(ReqStatusStatVo::getNum).sum();
if (sum > 0){
Integer reviewedUserReqCount = status2NumMap.getOrDefault(productReqStatus.getName(), 0);
resVo.setRatio(reviewedUserReqCount/sum * 100);
if (sum > 0) {
Integer completedReqSpecsCount = status2NumMap.getOrDefault(productReqStatus.getKey(), 0);
double ratioDouble = (double) completedReqSpecsCount / sum * 100;
int ratio = (int) Math.round(ratioDouble);
resVo.setRatio(ratio);
}
return resVo;
}