rev: 反馈重量校验为空才可更新

fix: 批量更新改为for更新
This commit is contained in:
2025-04-04 19:58:42 +08:00
parent fd578a1b94
commit 2ef860727f
2 changed files with 15 additions and 9 deletions

View File

@@ -127,7 +127,10 @@ public class SlitterDownTrussTask extends AbstractAcsTask {
TaskUtils.updateOptMessageBySlitterPlan(downPlan);
});
log.info("即将下卷的上下轴的子卷号数据4{}", downPlans);
slittingproductionplanService.updateBatchById(downPlans);
// slittingproductionplanService.updateBatchById(downPlans);
for (int i = 0; i < downPlans.size(); i++) {
slittingproductionplanService.updateById(downPlans.get(i));
}
// 获取气胀轴编码
// 筛选上下轴各一条
PdmBiSlittingproductionplan upPlan = downPlans.stream().filter(p -> "1".equals(p.getUp_or_down())).findFirst().orElse(null);
@@ -159,7 +162,10 @@ public class SlitterDownTrussTask extends AbstractAcsTask {
p1.setUpdate_optname(SecurityUtils.getCurrentNickName());
p1.setUpdate_optid(SecurityUtils.getCurrentUserId());
});
slittingproductionplanService.updateBatchById(plans);
// slittingproductionplanService.updateBatchById(plans);
for (int i = 0; i < plans.size(); i++) {
slittingproductionplanService.updateById(plans.get(i));
}
// 设备禁用
point1.setUp_qzzno("");
point1.setDown_qzzno("");

View File

@@ -2476,13 +2476,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
JSONObject res = new JSONObject();
String subVolume = param.getString("sub_volume");
String weight = param.getString("weight1");
PdmBiSlittingproductionplan containerName = slittingproductionplanService.getByContainerName(subVolume);
if (ObjectUtil.isEmpty(containerName)) {
throw new BadRequestException("子卷号[" + subVolume + "]对应的分切计划不存在!");
}
if (ObjectUtil.isNotEmpty(containerName.getWeight())) {
throw new BadRequestException("子卷号[" + subVolume + "]不允许重复更新重量!");
}
// PdmBiSlittingproductionplan containerName = slittingproductionplanService.getByContainerName(subVolume);
// if (ObjectUtil.isEmpty(containerName)) {
// throw new BadRequestException("子卷号[" + subVolume + "]对应的分切计划不存在!");
// }
// if (ObjectUtil.isNotEmpty(containerName.getWeight())) {
// throw new BadRequestException("子卷号[" + subVolume + "]不允许重复更新重量!");
// }
LambdaUpdateWrapper<PdmBiSlittingproductionplan> updateWrapper = new UpdateWrapper<PdmBiSlittingproductionplan>().lambda();
updateWrapper.set(PdmBiSlittingproductionplan::getWeight, NumberUtil.round(weight, 2).toString())
.eq(PdmBiSlittingproductionplan::getContainer_name, subVolume);