fix(wms): 修复钢卷父子关系处理中的库位状态更新问题

- 设置子钢卷的父钢卷ID以维护正确的父子关系
- 修正母卷库位ID传递逻辑避免错误的状态更新
- 添加母卷转历史卷时的库位释放处理确保库位状态正确
- 防止已加工完成的母卷占用库位资源
This commit is contained in:
2026-02-05 11:44:38 +08:00
parent 44ca5c2e18
commit f3496bcb95

View File

@@ -3447,9 +3447,10 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
// 7. 校验并插入子钢卷
validEntityBeforeSave(childCoil);
childCoil.setParentCoilId(String.valueOf(parentCoilId));
baseMapper.insert(childCoil);
updateActualWarehouseEnableStatus(parentCoil.getActualWarehouseId(), childCoilBo.getActualWarehouseId());
updateActualWarehouseEnableStatus(null, childCoilBo.getActualWarehouseId());
// 8. 更新二维码中的coilId
updateQrcodeCoilId(childQrcodeId, childCoil.getCoilId());
@@ -3520,6 +3521,10 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
.map(WmsMaterialCoil::getCurrentCoilNo)
.collect(Collectors.toList());
// 如果母卷即将成为历史卷 证明已经加工完成则释放库位
if (parentCoil.getActualWarehouseId() != null){
updateActualWarehouseEnableStatus(parentCoil.getActualWarehouseId(), null);
}
// 4. 将母卷标记为历史数据
LambdaUpdateWrapper<WmsMaterialCoil> parentUpdateWrapper = new LambdaUpdateWrapper<>();
parentUpdateWrapper.eq(WmsMaterialCoil::getCoilId, parentCoilId)