fix(wms): 修复分卷取消操作中的逻辑错误

- 移除过早删除待操作记录的代码
- 保留母卷独占锁释放功能但暂时注释
- 重新调整代码执行顺序确保业务逻辑正确性
- 修复可能导致数据不一致的操作步骤
This commit is contained in:
2026-06-15 17:49:28 +08:00
parent 7bb68483e6
commit cb8fce435c

View File

@@ -5371,8 +5371,6 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
if (StringUtils.isNotBlank(pendingAction.getRemark())) { if (StringUtils.isNotBlank(pendingAction.getRemark())) {
throw new RuntimeException("该分卷操作已开始,请勿取消"); throw new RuntimeException("该分卷操作已开始,请勿取消");
} }
// 删除待操作记录
coilPendingActionService.deleteWithValidByIds(Arrays.asList(pendingActionId), false);
// 3. 查询母卷 // 3. 查询母卷
WmsMaterialCoil parentCoil = baseMapper.selectById(pendingAction.getCoilId()); WmsMaterialCoil parentCoil = baseMapper.selectById(pendingAction.getCoilId());
if (parentCoil == null) { if (parentCoil == null) {
@@ -5387,14 +5385,15 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
if (Objects.equals(parentCoil.getExclusiveStatus(), 0)) { if (Objects.equals(parentCoil.getExclusiveStatus(), 0)) {
throw new RuntimeException("钢卷未处于分卷状态,无法取消"); throw new RuntimeException("钢卷未处于分卷状态,无法取消");
} }
// 删除待操作记录
// 释放母卷独占锁 coilPendingActionService.deleteWithValidByIds(Arrays.asList(pendingActionId), false);
if (Objects.equals(parentCoil.getExclusiveStatus(), 1)) { // // 释放母卷独占锁
LambdaUpdateWrapper<WmsMaterialCoil> parentUpdate = new LambdaUpdateWrapper<>(); // if (Objects.equals(parentCoil.getExclusiveStatus(), 1)) {
parentUpdate.eq(WmsMaterialCoil::getCoilId, parentCoil.getCoilId()) // LambdaUpdateWrapper<WmsMaterialCoil> parentUpdate = new LambdaUpdateWrapper<>();
.set(WmsMaterialCoil::getExclusiveStatus, 0); // parentUpdate.eq(WmsMaterialCoil::getCoilId, parentCoil.getCoilId())
baseMapper.update(null, parentUpdate); // .set(WmsMaterialCoil::getExclusiveStatus, 0);
} // baseMapper.update(null, parentUpdate);
// }
result.put("success", true); result.put("success", true);
result.put("message", "取消分卷成功"); result.put("message", "取消分卷成功");