fix(inventory): 更新库存检查逻辑以确保数量大于零

- 修改导入服务中的库存验证条件
- 确保只有当现有库存数量大于零时才报错
- 防止因空值或零库存导致的误判问题
This commit is contained in:
tangyu 2025-11-17 15:14:34 +08:00
parent 8cb079b221
commit a2fda83014

View File

@ -247,7 +247,7 @@ public class DataImportServiceImpl implements DataImportService {
}
Inventory inventory = null;
inventory = inventoryService.getByCode(site, data.getInventoryId());
if (inventory != null){
if (inventory != null && inventory.getQtyOnHand() != null && inventory.getQtyOnHand().compareTo(BigDecimal.ZERO) > 0) {
errorMessage.append(MessageFormat.format("第{0}行;条码{1}已存在 \n", row, data.getInventoryId()));
}
if (StrUtil.isBlank(data.getInventoryId())) {