|
|
|
@ -24,6 +24,8 @@ import com.project.task.mapper.TaskUserMapper; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.math.RoundingMode; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Objects; |
|
|
|
@ -159,6 +161,11 @@ public class CandidateSearchTaskDomainServiceImpl implements CandidateSearchTask |
|
|
|
if (Objects.nonNull(taskUserEntity.getLastRecordId())) { |
|
|
|
ExamRecordEntity examRecordEntity = examRecordMapper.selectById(taskUserEntity.getLastRecordId()); |
|
|
|
dto.setLastRecordScore(examRecordEntity.getScore()); |
|
|
|
//转成string类型,如果是整数则不显示小数部分,如果是小数则保留两位小数
|
|
|
|
String lastRecordScoreStr = examRecordEntity.getScore() == null ? "0" : |
|
|
|
new BigDecimal(examRecordEntity.getScore().toString()).setScale(2, RoundingMode.HALF_UP) |
|
|
|
.stripTrailingZeros().toPlainString(); |
|
|
|
dto.setLastRecordScoreStr(lastRecordScoreStr); |
|
|
|
} |
|
|
|
dto.setTotalScore((int) Math.floor(entity.getTotalScore())); |
|
|
|
return dto; |
|
|
|
|