fix(service): 修复钢卷操作中的空指针异常和逻辑错误
- 在 WmsCoilPendingActionServiceImpl 中添加钢卷存在性检查,避免空指针异常 - 当关联钢卷不存在时抛出运行时异常提示"关联的钢卷不存在" - 修复 WmsMaterialCoilServiceImpl 中的合卷操作逻辑 - 修改条件判断避免整数缓存导致的比较错误 - 合卷操作已在 mergeCoils 方法中单独处理,此处跳过重复操作
This commit is contained in:
@@ -274,6 +274,9 @@ public class WmsCoilPendingActionServiceImpl implements IWmsCoilPendingActionSer
|
|||||||
validEntityBeforeSave(add);
|
validEntityBeforeSave(add);
|
||||||
if (add.getCoilId() != null){
|
if (add.getCoilId() != null){
|
||||||
WmsMaterialCoil materialCoil = materialCoilMapper.selectById(add.getCoilId());
|
WmsMaterialCoil materialCoil = materialCoilMapper.selectById(add.getCoilId());
|
||||||
|
if (materialCoil == null) {
|
||||||
|
throw new RuntimeException("关联的钢卷不存在");
|
||||||
|
}
|
||||||
if (materialCoil.getDataType() == 0) {
|
if (materialCoil.getDataType() == 0) {
|
||||||
throw new RuntimeException("该钢卷为历史钢卷不能被操作");
|
throw new RuntimeException("该钢卷为历史钢卷不能被操作");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1658,8 +1658,8 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
|||||||
result = updateBySingle(bo, qrcodeStepType); // 返回新钢卷ID字符串
|
result = updateBySingle(bo, qrcodeStepType); // 返回新钢卷ID字符串
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果有关联的操作记录ID,调用完成接口
|
// 如果有关联的操作记录ID,调用完成接口(合卷已在mergeCoils中单独完成,此处跳过)
|
||||||
if (bo.getActionId() != null && bo.getActionId() > 0 && bo.getHasMergeSplit() != 2) {
|
if (bo.getActionId() != null && bo.getActionId() > 0 && !Integer.valueOf(2).equals(bo.getHasMergeSplit())) {
|
||||||
coilPendingActionService.completeAction(bo.getActionId(), result);
|
coilPendingActionService.completeAction(bo.getActionId(), result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user