| | |
| | | package com.ruoyi.chargingPile.controller; |
| | | |
| | | |
| | | import com.ruoyi.chargingPile.api.model.TParkingLot; |
| | | import com.ruoyi.chargingPile.api.model.TVehicleRamp; |
| | | import com.ruoyi.chargingPile.service.TParkingLotService; |
| | | import com.ruoyi.chargingPile.service.TVehicleRampService; |
| | | import com.ruoyi.common.core.utils.CodeGenerateUtils; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | |
| | | |
| | | @Resource |
| | | private SwitchwayGateClient switchwayGateClient; |
| | | |
| | | @Resource |
| | | private TParkingLotService parkingLotService; |
| | | |
| | | |
| | | |
| | |
| | | @ApiOperation(tags = {"后台-车道"},value = "开关闸车道") |
| | | @PostMapping(value = "/openOrDown") |
| | | public AjaxResult<String> openOrDown(@RequestBody TVehicleRamp dto) { |
| | | TVehicleRamp vehicleRamp = vehicleRampService.getById(dto.getId()); |
| | | TParkingLot parkingLot = parkingLotService.getById(vehicleRamp.getParkingLotId()); |
| | | SwitchwayGateReq req = new SwitchwayGateReq(); |
| | | req.setAction(dto.getAction()); |
| | | req.setChannel(dto.getCarportNum()); |
| | | req.setAction(vehicleRamp.getAction()); |
| | | req.setChannel(vehicleRamp.getCarportNum()); |
| | | req.setAppkey(parkingLot.getAppKey()); |
| | | req.setSecretkey(parkingLot.getSecretKey()); |
| | | Boolean data = switchwayGateClient.gateService(req).getData(); |
| | | return data ? AjaxResult.success() : AjaxResult.error("操作失败"); |
| | | } |