保存绩效详情增加对指标权重之和不能超过维度权重之和
This commit is contained in:
parent
b6d5f33cc4
commit
118517d527
@ -480,6 +480,7 @@ public class ResultRecordController extends AbstractController {
|
||||
for (ResultRecortModelDto model:dto.getRecortModelDtos()
|
||||
) {
|
||||
int index = 0;
|
||||
BigDecimal weight = BigDecimal.ZERO;
|
||||
for (ResultDetailDto detailDto:model.getDetailDtos()
|
||||
) {//排序
|
||||
ResultDetail resultDetail = new ResultDetail();
|
||||
@ -495,6 +496,12 @@ public class ResultRecordController extends AbstractController {
|
||||
resultDetail.setType(model.getType());
|
||||
inserts.add(resultDetail);
|
||||
}
|
||||
if(resultDetail.getIsDelete() == null || resultDetail.getIsDelete().intValue() == 0){
|
||||
weight = weight.add(resultDetail.getCheckWeight());
|
||||
}
|
||||
}
|
||||
if(weight.compareTo(model.getWeight()) == 1){
|
||||
return R.error(model.getName() + "的指标之和不能超过" + model.getWeight().multiply(BigDecimal.valueOf(100)) + "%");
|
||||
}
|
||||
}
|
||||
if(inserts.size() > 0){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user