|
|
@ -53,35 +53,35 @@ public class EasOutInBillDetailServiceImpl extends ServiceImpl<EasOutInBillDetai |
|
|
|
.eq(ObjectUtil.isNotEmpty(params), EasOutInBillDetail::getDjid, params.getDjid()) |
|
|
|
); |
|
|
|
List<EasOutInBillDetail> easOutInBillDetailList = result.getRecords(); |
|
|
|
// List<InventoryInfo> inventoryInfoList = queryInventoryInfoList(easOutInBillDetailList);
|
|
|
|
// easOutInBillDetailList.forEach(bill -> {
|
|
|
|
// //查询库存信息
|
|
|
|
// List<InventoryInfo> matchedInventory = inventoryInfoList.stream()
|
|
|
|
// .filter(inventory -> {
|
|
|
|
// boolean isMatched = true;
|
|
|
|
// if (bill.getZzbm() != null && !bill.getZzbm().isEmpty()) {
|
|
|
|
// isMatched &= Objects.equals(inventory.getZzbm(), bill.getZzbm());
|
|
|
|
// }
|
|
|
|
// if (bill.getCkbm() != null && !bill.getCkbm().isEmpty()) {
|
|
|
|
// isMatched &= Objects.equals(inventory.getCkbm(), bill.getCkbm());
|
|
|
|
// }
|
|
|
|
// if (bill.getWlbm() != null && !bill.getWlbm().isEmpty()) {
|
|
|
|
// isMatched &= Objects.equals(inventory.getWlbm(), bill.getWlbm());
|
|
|
|
// }
|
|
|
|
// // 批次
|
|
|
|
// if (bill.getPc() != null && !bill.getPc().isEmpty()) {
|
|
|
|
// isMatched &= Objects.equals(inventory.getPc(), bill.getPc());
|
|
|
|
// }
|
|
|
|
// // 跟踪号
|
|
|
|
// if (bill.getTrackno() != null && !bill.getTrackno().isEmpty()) {
|
|
|
|
// isMatched &= Objects.equals(inventory.getTrackno(), bill.getTrackno());
|
|
|
|
// }
|
|
|
|
// if (bill.getKwbm() != null && !bill.getKwbm().isEmpty()) {
|
|
|
|
// isMatched &= Objects.equals(inventory.getKwbm(), bill.getKwbm());
|
|
|
|
// }
|
|
|
|
// return isMatched;
|
|
|
|
// })
|
|
|
|
// .collect(Collectors.toList());
|
|
|
|
List<InventoryInfo> inventoryInfoList = queryInventoryInfoList(easOutInBillDetailList); |
|
|
|
easOutInBillDetailList.forEach(bill -> { |
|
|
|
//查询库存信息
|
|
|
|
List<InventoryInfo> matchedInventory = inventoryInfoList.stream() |
|
|
|
.filter(inventory -> { |
|
|
|
boolean isMatched = true; |
|
|
|
if (bill.getZzbm() != null && !bill.getZzbm().isEmpty()) { |
|
|
|
isMatched &= Objects.equals(inventory.getZzbm(), bill.getZzbm()); |
|
|
|
} |
|
|
|
if (bill.getCkbm() != null && !bill.getCkbm().isEmpty()) { |
|
|
|
isMatched &= Objects.equals(inventory.getCkbm(), bill.getCkbm()); |
|
|
|
} |
|
|
|
if (bill.getWlbm() != null && !bill.getWlbm().isEmpty()) { |
|
|
|
isMatched &= Objects.equals(inventory.getWlbm(), bill.getWlbm()); |
|
|
|
} |
|
|
|
// 批次
|
|
|
|
if (bill.getPc() != null && !bill.getPc().isEmpty()) { |
|
|
|
isMatched &= Objects.equals(inventory.getPc(), bill.getPc()); |
|
|
|
} |
|
|
|
// 跟踪号
|
|
|
|
if (bill.getTrackno() != null && !bill.getTrackno().isEmpty()) { |
|
|
|
isMatched &= Objects.equals(inventory.getTrackno(), bill.getTrackno()); |
|
|
|
} |
|
|
|
if (bill.getKwbm() != null && !bill.getKwbm().isEmpty()) { |
|
|
|
isMatched &= Objects.equals(inventory.getKwbm(), bill.getKwbm()); |
|
|
|
} |
|
|
|
return isMatched; |
|
|
|
}) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
// List<InventoryInfo> matchedInventory = inventoryInfoList.stream()
|
|
|
|
// .filter(inventory -> Objects.equals(inventory.getZzbm(), bill.getZzbm())
|
|
|
|
// && Objects.equals(inventory.getCkbm(), bill.getCkbm())
|
|
|
@ -91,12 +91,12 @@ public class EasOutInBillDetailServiceImpl extends ServiceImpl<EasOutInBillDetai |
|
|
|
// && Objects.equals(inventory.getKwbm(), bill.getKwbm()))
|
|
|
|
// .collect(Collectors.toList());
|
|
|
|
//将库存数量赋值给单据
|
|
|
|
// Optional<InventoryInfo> minKcsl = matchedInventory.stream()
|
|
|
|
// .min(Comparator.comparing(InventoryInfo::getKcsl));
|
|
|
|
// minKcsl.ifPresent(m -> {
|
|
|
|
// bill.setKcsl(m.getKcsl());
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
Optional<InventoryInfo> minKcsl = matchedInventory.stream() |
|
|
|
.min(Comparator.comparing(InventoryInfo::getKcsl)); |
|
|
|
minKcsl.ifPresent(m -> { |
|
|
|
bill.setKcsl(m.getKcsl()); |
|
|
|
}); |
|
|
|
}); |
|
|
|
result.setRecords(easOutInBillDetailList); |
|
|
|
return CommonPage.getPage(result); |
|
|
|
} |
|
|
|