fix(wms): 修复分卷取消操作中的逻辑错误
- 移除过早删除待操作记录的代码 - 保留母卷独占锁释放功能但暂时注释 - 重新调整代码执行顺序确保业务逻辑正确性 - 修复可能导致数据不一致的操作步骤
This commit is contained in:
@@ -5371,8 +5371,6 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
if (StringUtils.isNotBlank(pendingAction.getRemark())) {
|
||||
throw new RuntimeException("该分卷操作已开始,请勿取消");
|
||||
}
|
||||
// 删除待操作记录
|
||||
coilPendingActionService.deleteWithValidByIds(Arrays.asList(pendingActionId), false);
|
||||
// 3. 查询母卷
|
||||
WmsMaterialCoil parentCoil = baseMapper.selectById(pendingAction.getCoilId());
|
||||
if (parentCoil == null) {
|
||||
@@ -5387,14 +5385,15 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
if (Objects.equals(parentCoil.getExclusiveStatus(), 0)) {
|
||||
throw new RuntimeException("钢卷未处于分卷状态,无法取消");
|
||||
}
|
||||
|
||||
// 释放母卷独占锁
|
||||
if (Objects.equals(parentCoil.getExclusiveStatus(), 1)) {
|
||||
LambdaUpdateWrapper<WmsMaterialCoil> parentUpdate = new LambdaUpdateWrapper<>();
|
||||
parentUpdate.eq(WmsMaterialCoil::getCoilId, parentCoil.getCoilId())
|
||||
.set(WmsMaterialCoil::getExclusiveStatus, 0);
|
||||
baseMapper.update(null, parentUpdate);
|
||||
}
|
||||
// 删除待操作记录
|
||||
coilPendingActionService.deleteWithValidByIds(Arrays.asList(pendingActionId), false);
|
||||
// // 释放母卷独占锁
|
||||
// if (Objects.equals(parentCoil.getExclusiveStatus(), 1)) {
|
||||
// LambdaUpdateWrapper<WmsMaterialCoil> parentUpdate = new LambdaUpdateWrapper<>();
|
||||
// parentUpdate.eq(WmsMaterialCoil::getCoilId, parentCoil.getCoilId())
|
||||
// .set(WmsMaterialCoil::getExclusiveStatus, 0);
|
||||
// baseMapper.update(null, parentUpdate);
|
||||
// }
|
||||
|
||||
result.put("success", true);
|
||||
result.put("message", "取消分卷成功");
|
||||
|
||||
Reference in New Issue
Block a user