|
|
@ -835,7 +835,7 @@ public class JobUtils { |
|
|
|
throw exception(BALANCE_QTY_NOT_EXISTS); |
|
|
|
} |
|
|
|
// 根据库存类型 过滤 查询的库位
|
|
|
|
if (locationList != null && !locationList.isEmpty()) { |
|
|
|
if (locationList != null && locationList.size() > 0) { |
|
|
|
queryWrapper.in("location_code", locationList); |
|
|
|
} |
|
|
|
// 根据下架策略 作为查询库存余额条件
|
|
|
@ -975,7 +975,18 @@ public class JobUtils { |
|
|
|
if (balanceDOListJob == null || balanceDOListJob.size() == 0) { |
|
|
|
throw new UtilException("物品代码:" + itemCode + " 没有找到推荐的库存"); |
|
|
|
} |
|
|
|
return balanceDOListJob; |
|
|
|
// 合并 相同【物品】和【批次】和【库位】的 数量求和
|
|
|
|
List<BalanceDO> balanceDOListRs = new ArrayList<>(); |
|
|
|
Map<String,BalanceDO> map = new HashMap<>(); |
|
|
|
for(BalanceDO balanceDOItem:balanceDOListJob ) { |
|
|
|
BalanceDO ba = map.get(balanceDOItem.getItemCode()+"|"+balanceDOItem.getBatch()+"|"+balanceDOItem.getLocationCode()); |
|
|
|
if (ba != null) balanceDOItem.setQty(balanceDOItem.getQty().add(ba.getQty())); |
|
|
|
map.put(balanceDOItem.getItemCode()+"|"+balanceDOItem.getBatch()+"|"+balanceDOItem.getLocationCode(),balanceDOItem); |
|
|
|
} |
|
|
|
for (Map.Entry entry : map.entrySet()) { |
|
|
|
balanceDOListRs.add((BalanceDO) entry.getValue()); |
|
|
|
} |
|
|
|
return balanceDOListRs; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|