From a432ff3c95923f9929236de9f7a9224e8517bb70 Mon Sep 17 00:00:00 2001 From: huliguo <2023611923@qq.com> Date: 星期五, 23 五月 2025 20:55:43 +0800 Subject: [PATCH] 大屏 --- ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingGunController.java | 67 +++++++++++++++++++++++++++++++++ 1 files changed, 67 insertions(+), 0 deletions(-) diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingGunController.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingGunController.java index f618ef1..fb71dd3 100644 --- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingGunController.java +++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingGunController.java @@ -42,6 +42,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.stream.Collectors; /** * <p> @@ -68,6 +69,22 @@ @Autowired private FileUploadConfig fileUploadConfig; + + + /** + * 查询所有枪 + */ + @PostMapping(value = "/getAllGun") + public R<List<TChargingGun>> getAllGun() { + return R.ok(chargingGunService.list()); + } + /** + * 查询所有桩 + */ + @PostMapping(value = "/getAllPile") + public R<List<TChargingPile>> getAllPile() { + return R.ok(chargingPileService.list()); + } /** * 查询充电枪列表 @@ -294,5 +311,55 @@ chargingGunService.updateById(chargingGun); return R.ok(); } + + + + /** + * 根据充电桩id获取枪 + * @param chargingPileId + * @return + */ + @PostMapping("/getChargingGunByChargingPileId") + public R<List<TChargingGun>> getChargingGunByChargingPileId(@RequestParam("chargingPileId") Integer chargingPileId){ + List<TChargingGun> list = chargingGunService.list(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getChargingPileId, chargingPileId) + .eq(TChargingGun::getDelFlag, 0)); + return R.ok(list); + } + + + /** + * 根据充电桩ids获取枪 + * @param chargingPileIds + * @return + */ + @PostMapping("/getChargingGunByChargingPileIds") + public R<List<TChargingGun>> getChargingGunByChargingPileIds(@RequestParam("chargingPileIds") List<Integer> chargingPileIds){ + List<TChargingGun> list = chargingGunService.list(new LambdaQueryWrapper<TChargingGun>().in(TChargingGun::getChargingPileId, chargingPileIds) + .eq(TChargingGun::getDelFlag, 0)); + return R.ok(list); + } + + + /** + * 根据枪唯一码查询信息 + * @return + */ + @PostMapping("/getChargingGunByFullNumber") + public R<TChargingGun> getChargingGunByFullNumber(@RequestParam("fullNumber") String fullNumber){ + TChargingGun chargingGun = chargingGunService.getOne(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getDelFlag, 0).eq(TChargingGun::getFullNumber, fullNumber)); + return R.ok(chargingGun); + } + + /** + * 大屏 根据站点ids和充电模式集合查询充电枪集合 没有过滤del_flag + */ + @GetMapping("/getGunIdsBySiteIdsAndChargeModels") + public R<List<Integer>> getGunIdsBySiteIdsAndChargeModels(@RequestParam("siteIds") List<Integer> siteIds ,@RequestParam("chargeModels") List<Integer> chargeModels){ + List<TChargingGun> list = chargingGunService.list(new LambdaQueryWrapper<TChargingGun>() + .select(TChargingGun::getId).in(TChargingGun::getSiteId, siteIds) + .in(TChargingGun::getChargeMode, chargeModels)); + return R.ok(list.stream().map(TChargingGun::getId).collect(Collectors.toList())); + } + } -- Gitblit v1.7.1