fix(inventory): 修复库存入库DTO中批次号解析的空指针异常

- 添加了对order为空时的默认返回值处理
- 避免在batchNo不为空但order为空时出现异常情况
- 确保方法在各种边界条件下都能正常返回数值
This commit is contained in:
曹鹏飞 2026-06-04 16:44:16 +08:00
parent 80c6818d20
commit f9c0efdc1d
1 changed files with 3 additions and 0 deletions

View File

@ -67,6 +67,9 @@ public class InventoryInDTO {
if (Objects.isNull(order) && StrUtil.isNotBlank(getBatchNo())) {
return Integer.parseInt(getBatchNo().substring(4));
}
if (Objects.isNull(order)){
return 0;
}
return order;
}