Commit f0071b48438dd49134de11e2b14c9e0b145cd297
1 parent
bc3a7711
修复同一个物料 多条详情 多条库存时, 不能匹配出库
Showing
1 changed file
with
4 additions
and
1 deletions
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java
... | ... | @@ -357,6 +357,10 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
357 | 357 | } |
358 | 358 | |
359 | 359 | for (InventoryDetail inventoryDetail : inventoryList) { |
360 | + BigDecimal inventoryQty = inventoryDetail.getQty().subtract(inventoryDetail.getTaskQty()); | |
361 | + if (inventoryQty.compareTo(BigDecimal.ZERO) == 0) { | |
362 | + continue; | |
363 | + } | |
360 | 364 | // 判断需要配盘数量是否等于0,等于0代表配盘完毕,完毕就退出内循环 |
361 | 365 | if (shipmentQty.compareTo(BigDecimal.ZERO) == 0) { |
362 | 366 | break; |
... | ... | @@ -367,7 +371,6 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
367 | 371 | CombinationModel combinationModel = new CombinationModel(); |
368 | 372 | combinationModel.setShipmentDetail(shipmentDetail); |
369 | 373 | combinationModel.setInventoryDetail(inventoryDetail); |
370 | - BigDecimal inventoryQty = inventoryDetail.getQty().subtract(inventoryDetail.getTaskQty()); | |
371 | 374 | if (inventoryQty.compareTo(shipmentQty) >= 0) { |
372 | 375 | combinationModel.setShipQty(shipmentQty); |
373 | 376 | shipmentQty = BigDecimal.ZERO; |
... | ... |