Browse Source

add: 去除跟踪号筛选库存

master1
gongbaoxiong 4 months ago
parent
commit
e74f4218b8
  1. 2
      nlsso-server/src/main/java/org/nl/wms/database/eas/dao/EasOutInBillDetail.java
  2. 14
      nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillDetailServiceImpl.java
  3. 4
      nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillServiceImpl.java

2
nlsso-server/src/main/java/org/nl/wms/database/eas/dao/EasOutInBillDetail.java

@ -235,7 +235,7 @@ public class EasOutInBillDetail extends Model<EasOutInBillDetail> {
/**
* 分录备注
* 跟踪号编码
*/
private String gzhbm;

14
nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillDetailServiceImpl.java

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

4
nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillServiceImpl.java

@ -433,8 +433,8 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
updateEntity.setFzjldw(entity.getFzjldw());
updateEntity.setSl(entity.getSl());
updateEntity.setJbsl(entity.getJbsl());
updateEntity.setTjkwbm(entity.getTjkwbm());
updateEntity.setTjkwmc(entity.getTjkwmc());
updateEntity.setTjkwbm(entity.getKwbm());
updateEntity.setTjkwmc(entity.getKwmc());
updateEntity.setFzsl(entity.getFzsl());
updateEntity.setCkbm(entity.getCkbm());
updateEntity.setCkmc(entity.getCkmc());

Loading…
Cancel
Save