|
@ -66,6 +66,10 @@ public class EasOutInBillDetailServiceImpl extends ServiceImpl<EasOutInBillDetai |
|
|
Map<String, Double> totalQty = easOutInBillDetailList.stream() |
|
|
Map<String, Double> totalQty = easOutInBillDetailList.stream() |
|
|
.collect(Collectors.groupingBy(EasOutInBillDetail::getWlbm, Collectors.summingDouble(bill -> bill.getSl().doubleValue()))); |
|
|
.collect(Collectors.groupingBy(EasOutInBillDetail::getWlbm, Collectors.summingDouble(bill -> bill.getSl().doubleValue()))); |
|
|
easOutInBillDetailList.forEach(bill -> { |
|
|
easOutInBillDetailList.forEach(bill -> { |
|
|
|
|
|
if(bill.getWlbm().equals("509937010017")) |
|
|
|
|
|
{ |
|
|
|
|
|
Integer s =1; |
|
|
|
|
|
} |
|
|
//设置物料总数
|
|
|
//设置物料总数
|
|
|
bill.setWlzs(totalQty.get(bill.getWlbm())); |
|
|
bill.setWlzs(totalQty.get(bill.getWlbm())); |
|
|
//查询库存信息
|
|
|
//查询库存信息
|
|
@ -94,18 +98,16 @@ public class EasOutInBillDetailServiceImpl extends ServiceImpl<EasOutInBillDetai |
|
|
isMatched = Objects.equals(r.getPc(), bill.getPc()); |
|
|
isMatched = Objects.equals(r.getPc(), bill.getPc()); |
|
|
} |
|
|
} |
|
|
// 跟踪号
|
|
|
// 跟踪号
|
|
|
if (bill.getTrackno() != null && !bill.getTrackno().isEmpty()) { |
|
|
// if (bill.getGzhbm() != null && !bill.getGzhbm().isEmpty()) {
|
|
|
isMatched = Objects.equals(r.getTrackno(), bill.getTrackno()); |
|
|
// isMatched = Objects.equals(r.getTrackno(), bill.getGzhbm());
|
|
|
} |
|
|
// }
|
|
|
return isMatched; |
|
|
return isMatched; |
|
|
}) |
|
|
}) |
|
|
.collect(Collectors.toList()); |
|
|
.collect(Collectors.toList()); |
|
|
Optional<InventoryInfo> minKcsl = matchedInventory.stream() |
|
|
Optional<InventoryInfo> minKcsl = matchedInventory.stream() |
|
|
.filter(r -> r.getUnitno().equals(bill.getJldw())) |
|
|
.filter(r -> r.getUnitno().equals(bill.getJldw())&&r.getKcsl().compareTo(BigDecimal.ZERO)>0) |
|
|
.min(Comparator.comparing(InventoryInfo::getKcsl)); |
|
|
.min(Comparator.comparing(InventoryInfo::getKcsl)); |
|
|
minKcsl.ifPresent(m -> bill.setKcsl(m.getKcsl())); |
|
|
minKcsl.ifPresent(m -> bill.setKcsl(m.getKcsl())); |
|
|
//增加一个逻辑,当单据明细行物料编码相同时,对物料数量进行相加,赋值到物料总数字段wlzs进行显示
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
result.setRecords(easOutInBillDetailList); |
|
|
result.setRecords(easOutInBillDetailList); |
|
|
return CommonPage.getPage(result); |
|
|
return CommonPage.getPage(result); |
|
|