| | |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.order.api.feignClient.ChargingOrderClient; |
| | | import io.swagger.annotations.Api; |
| | |
| | | |
| | | @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()); |
| | | } |
| | | |
| | | /** |
| | | * 查询充电枪列表 |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @Resource |
| | | private TokenService tokenService; |
| | | /** |
| | | * 设备状态统计 |
| | | */ |
| | |
| | | @PutMapping(value = "/gunStatusStatistics") |
| | | public R<GunStatusStatisticsVO> gunStatusStatistics() { |
| | | List<Integer> siteIds = new ArrayList<>(); |
| | | Long userId = SecurityUtils.getUserId(); |
| | | Long userId = tokenService.getLoginUser().getUserid(); |
| | | //获取当前登录的siteIds |
| | | PageInfo<GetSiteListDTO> siteList1 = siteService.getSiteList1(userId); |
| | | for (GetSiteListDTO datum : siteList1.getRecords()) { |
| | |
| | | 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); |
| | | } |
| | | } |
| | | |