Merge branch 'version_performance_2.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_performance_2.0
This commit is contained in:
commit
8dd1c6591a
@ -480,17 +480,28 @@ public class ResultRecordController extends AbstractController {
|
|||||||
for (ResultRecortModelDto model:dto.getRecortModelDtos()
|
for (ResultRecortModelDto model:dto.getRecortModelDtos()
|
||||||
) {
|
) {
|
||||||
int index = 0;
|
int index = 0;
|
||||||
|
BigDecimal weight = BigDecimal.ZERO;
|
||||||
for (ResultDetailDto detailDto:model.getDetailDtos()
|
for (ResultDetailDto detailDto:model.getDetailDtos()
|
||||||
) {//排序
|
) {//排序
|
||||||
ResultDetail resultDetail = new ResultDetail();
|
ResultDetail resultDetail = new ResultDetail();
|
||||||
BeanUtils.copyProperties(detailDto, resultDetail);
|
BeanUtils.copyProperties(detailDto, resultDetail);
|
||||||
resultDetail.setPriority(index);
|
resultDetail.setPriority(index);
|
||||||
|
|
||||||
index++;
|
index++;
|
||||||
if(resultDetail.getId() != null){
|
if(resultDetail.getId() != null){
|
||||||
updates.add(resultDetail);
|
updates.add(resultDetail);
|
||||||
}else{
|
}else{
|
||||||
|
resultDetail.setStaffId(resultRecord.getStaffId());
|
||||||
|
resultDetail.setRecordId(resultRecord.getId());
|
||||||
|
resultDetail.setType(model.getType());
|
||||||
inserts.add(resultDetail);
|
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){
|
if(inserts.size() > 0){
|
||||||
@ -545,7 +556,7 @@ public class ResultRecordController extends AbstractController {
|
|||||||
return R.ok("删除成功");
|
return R.ok("删除成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**lzresultrecord/saveDetail
|
||||||
* 信息
|
* 信息
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/recordIdsSubmit")
|
@RequestMapping("/recordIdsSubmit")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user