保存指标时对评分的空
This commit is contained in:
parent
3e12e8f8a3
commit
88e5708a8d
@ -590,24 +590,27 @@ public class ResultRecordController extends AbstractController {
|
|||||||
}
|
}
|
||||||
if(resultDetail.getIsDelete() == null || resultDetail.getIsDelete().intValue() == 0){
|
if(resultDetail.getIsDelete() == null || resultDetail.getIsDelete().intValue() == 0){
|
||||||
BigDecimal score = BigDecimal.ZERO;
|
BigDecimal score = BigDecimal.ZERO;
|
||||||
for (ResultScoreDto scoreDto:detailDto.getScoreDtos()
|
if(detailDto.getScoreDtos() != null){
|
||||||
) {
|
for (ResultScoreDto scoreDto:detailDto.getScoreDtos()
|
||||||
//计算得分
|
) {
|
||||||
ResultScore resultScore = new ResultScore();
|
//计算得分
|
||||||
BeanUtils.copyProperties(scoreDto, resultScore);
|
ResultScore resultScore = new ResultScore();
|
||||||
if(scoreDto.getAcquireScore() != null){
|
BeanUtils.copyProperties(scoreDto, resultScore);
|
||||||
score = score.add(scoreDto.getAcquireScore().multiply(scoreDto.getWeight()));
|
if(scoreDto.getAcquireScore() != null){
|
||||||
|
score = score.add(scoreDto.getAcquireScore().multiply(scoreDto.getWeight()));
|
||||||
|
}
|
||||||
|
if(resultScore.getId() == null){
|
||||||
|
insertScores.add(resultScore);
|
||||||
|
}else{
|
||||||
|
updateScores.add(resultScore);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(resultScore.getId() == null){
|
resultDetail.setAcquireScore(score);
|
||||||
insertScores.add(resultScore);
|
weight = weight.add(resultDetail.getCheckWeight());
|
||||||
}else{
|
|
||||||
updateScores.add(resultScore);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
resultDetail.setAcquireScore(score);
|
|
||||||
weight = weight.add(resultDetail.getCheckWeight());
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if(weight.compareTo(model.getWeight()) == 1){
|
if(weight.compareTo(model.getWeight()) == 1){
|
||||||
return R.error(model.getName() + "的指标之和不能超过" + model.getWeight().multiply(BigDecimal.valueOf(100)) + "%");
|
return R.error(model.getName() + "的指标之和不能超过" + model.getWeight().multiply(BigDecimal.valueOf(100)) + "%");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user