|
@ -56,22 +56,22 @@ public class EasOutInBillDetailServiceImpl extends ServiceImpl<EasOutInBillDetai |
|
|
.eq(ObjectUtil.isNotEmpty(params), EasOutInBillDetail::getDjid, params.getDjid()) |
|
|
.eq(ObjectUtil.isNotEmpty(params), EasOutInBillDetail::getDjid, params.getDjid()) |
|
|
); |
|
|
); |
|
|
List<EasOutInBillDetail> easOutInBillDetailList = result.getRecords(); |
|
|
List<EasOutInBillDetail> easOutInBillDetailList = result.getRecords(); |
|
|
List<InventoryInfo> inventoryInfoList = queryInventoryInfoList(easOutInBillDetailList); |
|
|
//List<InventoryInfo> inventoryInfoList = queryInventoryInfoList(easOutInBillDetailList);
|
|
|
easOutInBillDetailList.forEach(bill -> { |
|
|
// easOutInBillDetailList.forEach(bill -> {
|
|
|
//查询库存信息
|
|
|
// //查询库存信息
|
|
|
List<InventoryInfo> matchedInventory = inventoryInfoList.stream() |
|
|
// List<InventoryInfo> matchedInventory = inventoryInfoList.stream()
|
|
|
.filter(inventory -> Objects.equals(inventory.getZzbm(), bill.getZzbm()) |
|
|
// .filter(inventory -> Objects.equals(inventory.getZzbm(), bill.getZzbm())
|
|
|
&& Objects.equals(inventory.getCkbm(), bill.getCkbm()) |
|
|
// && Objects.equals(inventory.getCkbm(), bill.getCkbm())
|
|
|
&& Objects.equals(inventory.getWlbm(), bill.getWlbm()) |
|
|
// && Objects.equals(inventory.getWlbm(), bill.getWlbm())
|
|
|
&& Objects.equals(inventory.getPc(), bill.getPc()) |
|
|
// && Objects.equals(inventory.getPc(), bill.getPc())
|
|
|
&& Objects.equals(inventory.getTrackno(), bill.getTrackno()) |
|
|
// && Objects.equals(inventory.getTrackno(), bill.getTrackno())
|
|
|
&& Objects.equals(inventory.getKwbm(), bill.getKwbm())) |
|
|
// && Objects.equals(inventory.getKwbm(), bill.getKwbm()))
|
|
|
.collect(Collectors.toList()); |
|
|
// .collect(Collectors.toList());
|
|
|
//将库存数量赋值给单据
|
|
|
// //将库存数量赋值给单据
|
|
|
if (CollectionUtils.isNotEmpty(matchedInventory)) { |
|
|
// if (CollectionUtils.isNotEmpty(matchedInventory)) {
|
|
|
bill.setKcsl(matchedInventory.get(0).getKcsl()); |
|
|
// bill.setKcsl(matchedInventory.get(0).getKcsl());
|
|
|
} |
|
|
// }
|
|
|
}); |
|
|
// });
|
|
|
result.setRecords(easOutInBillDetailList); |
|
|
result.setRecords(easOutInBillDetailList); |
|
|
return CommonPage.getPage(result); |
|
|
return CommonPage.getPage(result); |
|
|
} |
|
|
} |
|
@ -149,11 +149,10 @@ public class EasOutInBillDetailServiceImpl extends ServiceImpl<EasOutInBillDetai |
|
|
@Override |
|
|
@Override |
|
|
public void update(List<EasOutInBillDetailVO> entityList) { |
|
|
public void update(List<EasOutInBillDetailVO> entityList) { |
|
|
if (CollectionUtils.isNotEmpty(entityList)) { |
|
|
if (CollectionUtils.isNotEmpty(entityList)) { |
|
|
List<EasOutInBillDetailVO> entityLists= entityList.stream().filter(r->StringUtils.isNotEmpty(r.getKwbm())).collect(Collectors.toList()); |
|
|
List<EasOutInBillDetailVO> entityLists = entityList.stream().filter(r -> StringUtils.isNotEmpty(r.getKwbm())).collect(Collectors.toList()); |
|
|
List<String> ids =entityLists.stream().map(EasOutInBillDetailVO::getCode).collect(Collectors.toList()); |
|
|
List<String> ids = entityLists.stream().map(EasOutInBillDetailVO::getCode).collect(Collectors.toList()); |
|
|
if(ids.size()==entityList.size()&&ids.size()>1) |
|
|
if (ids.size() == entityList.size() && ids.size() > 1) { |
|
|
{ |
|
|
entityList.forEach(r -> { |
|
|
entityList.forEach(r->{ |
|
|
|
|
|
UpdateWrapper<EasOutInBillDetail> updateWrapper = new UpdateWrapper<>(); |
|
|
UpdateWrapper<EasOutInBillDetail> updateWrapper = new UpdateWrapper<>(); |
|
|
updateWrapper.eq("flid", r.getFlid()); |
|
|
updateWrapper.eq("flid", r.getFlid()); |
|
|
updateWrapper.set("czsl", r.getSl()); |
|
|
updateWrapper.set("czsl", r.getSl()); |
|
@ -165,16 +164,14 @@ public class EasOutInBillDetailServiceImpl extends ServiceImpl<EasOutInBillDetai |
|
|
easOutInBillDetailMapper.update(null, updateWrapper); |
|
|
easOutInBillDetailMapper.update(null, updateWrapper); |
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
}else |
|
|
} else { |
|
|
{ |
|
|
|
|
|
boolean isValid = entityList.stream() |
|
|
boolean isValid = entityList.stream() |
|
|
.filter(r -> StringUtils.isNotEmpty(r.getKwbm())) |
|
|
.filter(r -> StringUtils.isNotEmpty(r.getKwbm())) |
|
|
.map(EasOutInBillDetailVO::getSysl) |
|
|
.map(EasOutInBillDetailVO::getSysl) |
|
|
.reduce(BigDecimal.ZERO, BigDecimal::add) |
|
|
.reduce(BigDecimal.ZERO, BigDecimal::add) |
|
|
.compareTo(BigDecimal.ZERO) == 0; |
|
|
.compareTo(BigDecimal.ZERO) == 0; |
|
|
|
|
|
|
|
|
if(isValid) |
|
|
if (isValid) { |
|
|
{ |
|
|
|
|
|
throw new BadRequestException("请检查库位和数量信息"); |
|
|
throw new BadRequestException("请检查库位和数量信息"); |
|
|
} |
|
|
} |
|
|
BigDecimal amount = entityList.stream() |
|
|
BigDecimal amount = entityList.stream() |
|
@ -198,8 +195,6 @@ public class EasOutInBillDetailServiceImpl extends ServiceImpl<EasOutInBillDetai |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|