feat(wms): 添加钢卷操作记录完成回调功能
- 在批量或单个更新后统一处理返回结果 - 添加 actionId 验证逻辑以确保操作记录存在 - 集成 coilPendingActionService.completeAction 接口调用 - 实现更新成功后的操作记录状态同步 - 优化方法结构以支持操作完成后的后续处理
This commit is contained in:
@@ -1344,17 +1344,25 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public String updateByBo(WmsMaterialCoilBo bo, String qrcodeStepType) {
|
public String updateByBo(WmsMaterialCoilBo bo, String qrcodeStepType) {
|
||||||
|
String result;
|
||||||
// 判断是否批量更新
|
// 判断是否批量更新
|
||||||
if (bo.getNewCoils() != null && !bo.getNewCoils().isEmpty()) {
|
if (bo.getNewCoils() != null && !bo.getNewCoils().isEmpty()) {
|
||||||
// 批量更新逻辑(分卷/合卷)
|
// 批量更新逻辑(分卷/合卷)
|
||||||
return updateByBatch(bo); // 分卷返回逗号分隔的ID,合卷返回单个ID
|
result = updateByBatch(bo); // 分卷返回逗号分隔的ID,合卷返回单个ID
|
||||||
} else {
|
} else {
|
||||||
// 单个更新逻辑,需要coilId
|
// 单个更新逻辑,需要coilId
|
||||||
if (bo.getCoilId() == null) {
|
if (bo.getCoilId() == null) {
|
||||||
throw new RuntimeException("钢卷ID不能为空");
|
throw new RuntimeException("钢卷ID不能为空");
|
||||||
}
|
}
|
||||||
return updateBySingle(bo, qrcodeStepType); // 返回新钢卷ID字符串
|
result = updateBySingle(bo, qrcodeStepType); // 返回新钢卷ID字符串
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 如果有关联的操作记录ID,调用完成接口
|
||||||
|
if (bo.getActionId() != null && bo.getActionId() > 0) {
|
||||||
|
coilPendingActionService.completeAction(bo.getActionId(), result);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user