fix(inventory): 修复库存入库DTO中批次号解析的空指针异常
- 添加了对order为空时的默认返回值处理 - 避免在batchNo不为空但order为空时出现异常情况 - 确保方法在各种边界条件下都能正常返回数值
This commit is contained in:
parent
80c6818d20
commit
f9c0efdc1d
|
|
@ -67,6 +67,9 @@ public class InventoryInDTO {
|
||||||
if (Objects.isNull(order) && StrUtil.isNotBlank(getBatchNo())) {
|
if (Objects.isNull(order) && StrUtil.isNotBlank(getBatchNo())) {
|
||||||
return Integer.parseInt(getBatchNo().substring(4));
|
return Integer.parseInt(getBatchNo().substring(4));
|
||||||
}
|
}
|
||||||
|
if (Objects.isNull(order)){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
return order;
|
return order;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue