feat(inventory): 添加库存出库储位筛选功能
- 在InventoryForOutItemQO中新增binNo字段用于储位编号 - 在库存控制器中实现储位匹配逻辑 - 当指定储位时不匹配的库存记录将被跳过 - 支持精确匹配物料号和储位的库存分配 - 保持原有的数量计算和批次序列号处理逻辑
This commit is contained in:
parent
714ff62b91
commit
30741347d7
|
|
@ -324,6 +324,13 @@ public class InventoryController extends BaseController {
|
|||
if (CollectionUtil.isNotEmpty(mis)) {
|
||||
BigDecimal num = item.getNum();
|
||||
for (WmsInventory inventory : mis) {
|
||||
InventoryForOutItemQO mqo=qo.getItems().stream()
|
||||
.filter(q -> StrUtil.equals(q.getMaterialNo(), inventory.getMaterialNo()))
|
||||
.findFirst()
|
||||
.get();
|
||||
if (StrUtil.isNotBlank(mqo.getBinNo()) && !StrUtil.equals(mqo.getBinNo(), inventory.getBinLocation())){
|
||||
continue;
|
||||
}
|
||||
BigDecimal outNum = NumberUtil.min(num, inventory.getNum());
|
||||
vo.getItems().add(new InventoryForOutItemVO(inventory.getBatchNo(), inventory.getSerialNo(), inventory.getBinLocation(), outNum));
|
||||
num = num.subtract(outNum);
|
||||
|
|
|
|||
|
|
@ -22,4 +22,9 @@ public class InventoryForOutItemQO {
|
|||
@NotNull
|
||||
@Positive
|
||||
public BigDecimal num;
|
||||
|
||||
/**
|
||||
* 储位编号
|
||||
*/
|
||||
private String binNo;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue