| | |
| | | List<TSysGoodsExchange> list = sysGoodsExchangeService.list(new LambdaQueryWrapper<TSysGoodsExchange>().in(TSysGoodsExchange::getGoodsId, records.stream().map(TSysGoods::getId).collect(Collectors.toList()))); |
| | | records.forEach(item -> { |
| | | item.setExchangeQuantity(list.stream().filter(item1 -> item1.getGoodsId().equals(item.getId())).mapToInt(TSysGoodsExchange::getGoodsCount).sum()); |
| | | item.setSurplusQuantity(item.getGoodsTotal() - item.getExchangeQuantity()); |
| | | if(item.getGoodsTotal()!=null){ |
| | | item.setSurplusQuantity(item.getGoodsTotal() - item.getExchangeQuantity()); |
| | | } |
| | | }); |
| | | } |
| | | pageInfo.setRecords(records); |