| | |
| | | import com.ruoyi.chargingPile.service.TParkingRecordService; |
| | | import com.ruoyi.chargingPile.service.TVehicleRampService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.domain.BaseDelete; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | |
| | | @ApiOperation(tags = {"后台-停车场"},value = "添加停车场") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@RequestBody TParkingLotDTO dto) { |
| | | validateBarrierBrand(dto); |
| | | return AjaxResult.ok(parkingLotService.save(dto)); |
| | | } |
| | | |
| | |
| | | @ApiOperation(tags = {"后台-停车场"},value = "修改停车场") |
| | | @PostMapping(value = "/update") |
| | | public AjaxResult<Boolean> update(@RequestBody TParkingLotDTO dto) { |
| | | validateBarrierBrand(dto); |
| | | return AjaxResult.ok(parkingLotService.updateById(dto)); |
| | | } |
| | | |
| | | private void validateBarrierBrand(TParkingLotDTO dto) { |
| | | if (Integer.valueOf(1).equals(dto.getBarrierBrand()) && !Integer.valueOf(1).equals(dto.getType())) { |
| | | throw new ServiceException("顺捷道闸品牌仅支持直营停车场"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查看停车场详情 |
| | | */ |