PoffyZhang 11 месяцев назад
Родитель
Сommit
4bca884c84
1 измененных файлов: 9 добавлений и 2 удалений
  1. +9
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/ProjectCostStatisticsManage.java

+ 9
- 2
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/ProjectCostStatisticsManage.java Просмотреть файл

@@ -1,5 +1,6 @@
package com.ningdatech.pmapi.dashboard.manage;

import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import com.ningdatech.pmapi.common.model.entity.DataDTO;
@@ -15,6 +16,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;
@@ -80,7 +82,11 @@ public class ProjectCostStatisticsManage {
List<Long> yearMeetingIds = yearMeetings.stream().map(Meeting::getId)
.collect(Collectors.toList());
//算出所有的 同意的专家
List<MeetingExpert> yearMeetingExperts = meetingExpertService.listAgreedExperts(yearMeetingIds);
List<MeetingExpert> yearMeetingExperts = Lists.newArrayList();
if(CollUtil.isNotEmpty(yearMeetingIds)){
yearMeetingExperts = meetingExpertService.listAgreedExperts(yearMeetingIds);
}

reviewData.setName(thisYear.toString());
reviewData.setAmount(reviewAoumtExpert.multiply(BigDecimal
.valueOf(yearMeetingExperts.size())));
@@ -91,7 +97,8 @@ public class ProjectCostStatisticsManage {
reviewTwoYearTotal = reviewTwoYearTotal.add(reviewAoumtExpert.multiply(BigDecimal
.valueOf(yearMeetingExperts.size())));
}
reviewAvg.setAmount(reviewTwoYearTotal.divide(BigDecimal.valueOf(2)));
reviewAvg.setAmount(reviewTwoYearTotal.divide(BigDecimal.valueOf(2),BigDecimal.ROUND_CEILING,
RoundingMode.HALF_UP));
twoYearsAvg.add(reviewAvg);
twoYearsAvg.add(pricingAvg);
res.setTwoYearsReviews(twoYearsReviews);


Загрузка…
Отмена
Сохранить