|
|
|
@ -1,6 +1,7 @@ |
|
|
|
|
package org.jeecg.modules.demo.annualScore.service.impl; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
import org.jeecg.modules.demo.annualScore.entity.DepartCompTotalScore; |
|
|
|
|
import org.jeecg.modules.demo.annualScore.entity.PersonalCompScore; |
|
|
|
@ -9,10 +10,10 @@ import org.jeecg.modules.demo.annualScore.service.IDepartCompTotalScoreService; |
|
|
|
|
import org.jeecg.modules.demo.annualScore.service.IPersonalCompScoreService; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
import org.springframework.util.ObjectUtils; |
|
|
|
|
|
|
|
|
|
import java.math.RoundingMode; |
|
|
|
|
import java.text.DecimalFormat; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
@ -44,10 +45,14 @@ public class DepartCompTotalScoreServiceImpl extends ServiceImpl<DepartCompTotal |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
double totalScore = 0; |
|
|
|
|
DecimalFormat decimalFormat = new DecimalFormat(totalScore + ""); |
|
|
|
|
decimalFormat.setMaximumFractionDigits(2); // 保留两位小数
|
|
|
|
|
decimalFormat.setRoundingMode(RoundingMode.HALF_UP); // 设置具体的进位机制
|
|
|
|
|
if (!ObjectUtils.isEmpty(personalCompScoreList)) { |
|
|
|
|
totalScore = personalCompScoreList.stream().mapToDouble(PersonalCompScore::getScore).sum(); |
|
|
|
|
} |
|
|
|
|
departCompTotalScore.setScore(totalScore); |
|
|
|
|
departCompTotalScore.setScore(new Double(decimalFormat.format(totalScore))); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//id不为空,院系的某一年度已汇总过,重新汇算
|
|
|
|
|
if (StringUtils.isNotEmpty(departCompTotalScore.getId())) { |
|
|
|
|