无关风月
2026-01-14 4b3d78ea91a12c3d4dcaab7b897125182bbc6342
Merge remote-tracking branch 'origin/master'
2个文件已修改
23 ■■■■■ 已修改文件
ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/TSysAppUserController.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpGoodsServiceImpl.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/TSysAppUserController.java
@@ -217,7 +217,7 @@
            // 发送请求
            try {
                HashMap<String, Object> map = new HashMap<>();
                map.put("page", "pages/invite/invite");
                map.put("page", "pages/home/home");
                map.put("scene", "clinicId=" + crmClinic.getId());
                map.put("check_path", false);
                HttpHeaders headers = new HttpHeaders();
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpGoodsServiceImpl.java
@@ -23,6 +23,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.math.BigDecimal;
@@ -191,9 +192,13 @@
        List<TErpGoodsType> typeList = erpGoodsTypeMapper.selectBatchIds(typeIds);
        for (TErpGoodsVO tErpGoodsVO : list) {
            List<TErpProcurementGoods> tErpProcurementGoods = goodsSalesMap.get(tErpGoodsVO.getId());
            // 计算采购数量
            tErpGoodsVO.setSalesCount(tErpProcurementGoods.stream().filter(e->e.getPurchaseCount()!=null).mapToInt(TErpProcurementGoods::getPurchaseCount).sum());
            typeList.stream().filter(t -> t.getId().equals(tErpGoodsVO.getTypeId())).findFirst().ifPresent(t -> tErpGoodsVO.setTypeName(t.getTypeName()));
            if(!CollectionUtils.isEmpty(tErpProcurementGoods)){
                // 计算采购数量
                tErpGoodsVO.setSalesCount(tErpProcurementGoods.stream().filter(e->e.getPurchaseCount()!=null).mapToInt(TErpProcurementGoods::getPurchaseCount).sum());
                typeList.stream().filter(t -> t.getId().equals(tErpGoodsVO.getTypeId())).findFirst().ifPresent(t -> tErpGoodsVO.setTypeName(t.getTypeName()));
            }else {
                tErpGoodsVO.setSalesCount(0);
            }
        }
        pageInfo.setRecords(list);
        return pageInfo;
@@ -213,9 +218,13 @@
        List<TErpGoodsType> typeList = erpGoodsTypeMapper.selectBatchIds(typeIds);
        for (TErpGoodsVO tErpGoodsVO : list) {
            List<TErpProcurementGoods> tErpProcurementGoods = goodsSalesMap.get(tErpGoodsVO.getId());
            // 计算采购数量
            tErpGoodsVO.setSalesCount(tErpProcurementGoods.stream().filter(e->e.getPurchaseCount()!=null).mapToInt(TErpProcurementGoods::getPurchaseCount).sum());
            typeList.stream().filter(t -> t.getId().equals(tErpGoodsVO.getTypeId())).findFirst().ifPresent(t -> tErpGoodsVO.setTypeName(t.getTypeName()));
            if(!CollectionUtils.isEmpty(tErpProcurementGoods)){
                // 计算采购数量
                tErpGoodsVO.setSalesCount(tErpProcurementGoods.stream().filter(e->e.getPurchaseCount()!=null).mapToInt(TErpProcurementGoods::getPurchaseCount).sum());
                typeList.stream().filter(t -> t.getId().equals(tErpGoodsVO.getTypeId())).findFirst().ifPresent(t -> tErpGoodsVO.setTypeName(t.getTypeName()));
            }else {
                tErpGoodsVO.setSalesCount(0);
            }
        }
        return list;
    }