liujie
2 天以前 d63003837abc4483600294f1fb6a7534f1933b94
修改bug
1个文件已修改
8 ■■■■■ 已修改文件
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TSysGoodsController.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TSysGoodsController.java
@@ -97,7 +97,7 @@
                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());
                    if(item.getGoodsTotal()!=null){
                    if (item.getGoodsTotal() != null) {
                        item.setSurplusQuantity(item.getGoodsTotal() - item.getExchangeQuantity());
                    }
                });
@@ -199,7 +199,7 @@
    public R<PageInfo<TSysGoodsExchange>> getExchangeRecord(@RequestBody @Valid TSysGoodsExchangeQuery query) {
        PageInfo<TSysGoodsExchange> page = new PageInfo<>(query.getPageNum(), query.getPageSize());
        LambdaQueryWrapper<TSysGoodsExchange> wrapper = new LambdaQueryWrapper<TSysGoodsExchange>();
        if(query.getId()!=null && !query.getId().isEmpty()){
        if (query.getId() != null && !query.getId().isEmpty()) {
            wrapper.eq(TSysGoodsExchange::getGoodsId, query.getId());
        }
        if (query.getClinicName() != null && !query.getClinicName().isEmpty()) {
@@ -251,7 +251,9 @@
            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);