Commit 1132b511 authored by renchao's avatar renchao

生产工序业务修改

parent 6ea72c1e
......@@ -84,20 +84,19 @@ public class TProcessesAuxiliaryServiceImpl extends ServiceImpl<TProcessesAuxili
return R.failed("辅助工序中->当要同时修改当月累计油量和当月累计油量时, 当月累计油量Ljyl 不为0时,当月累计产量Dyljcl不能为0,因为dh 由当月累计油量/当月累计产量 计算而来,分母不能为0");
}
//条件封装
TProcessesAuxiliary tSampleList = new TProcessesAuxiliary();
BeanUtilsNewCopy.copyPropertiesIgnoreNull(query, tSampleList);
BeanUtilsNewCopy.copyPropertiesIgnoreNull(query, temp);
QueryWrapper<TProcessesAuxiliary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(ProjectEnum.TProcessesAuxiliary.UID.getLabel(), query.getUid());
//计算单耗 防止失去精度,先转成字符串
float dh = tSampleList.getLjyl() / tSampleList.getDyljcl();
tSampleList.setDh(Double.valueOf(String.valueOf(dh)));
float dh = temp.getLjyl() / temp.getDyljcl();
temp.setDh(Double.valueOf(String.valueOf(dh)));
//修改
int update = baseMapper.update(tSampleList, queryWrapper);
int update = baseMapper.update(temp, queryWrapper);
if (update > 0) {
return R.ok("辅助工序中->修改成功");
} else {
log.error("辅助工序中->修改失败:{}", JSON.toJSONString(tSampleList));
log.error("辅助工序中->修改失败:{}", JSON.toJSONString(temp));
return R.failed("辅助工序中->修改失败");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment