xuhy
2024-08-26 7c095baf7833f42982aa84338f428ec2901dad31
获取站点下充电桩及充电枪列表
1个文件已修改
9 ■■■■■ 已修改文件
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileServiceImpl.java
@@ -244,9 +244,12 @@
    @Override
    public List<TChargingPileVO> getChargingGunList(Integer siteId,Integer type) {
        List<TChargingPileVO> chargingPileVOS = this.baseMapper.getChargingGunList(siteId);
        List<TChargingGun> chargingGuns = chargingGunService.list(Wrappers.lambdaQuery(TChargingGun.class)
                .eq(TChargingGun::getSiteId, siteId)
                .eq(TChargingGun::getChargeMode, type));
        LambdaQueryWrapper<TChargingGun> wrapper = new LambdaQueryWrapper<>();
        if(Objects.nonNull(type)){
            wrapper.eq(TChargingGun::getChargeMode, type);
        }
        wrapper.eq(TChargingGun::getSiteId, siteId);
        List<TChargingGun> chargingGuns = chargingGunService.list(wrapper);
        // 查询充电枪信息
        chargingPileVOS.forEach(item -> {
            item.setChargingGunList(chargingGuns.stream().filter(gun -> gun.getChargingPileId().equals(item.getId())).collect(Collectors.toList()));