| | |
| | | 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; |
| | |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import java.time.LocalDate; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @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("顺捷道闸品牌仅支持直营停车场"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | |
| | | @PostMapping(value = "/getRecordAmount") |
| | | public R<BigDecimal> getRecordAmount(){ |
| | | BigDecimal sum = parkingRecordService.getSum(); |
| | | public R<BigDecimal> getRecordAmount(@RequestParam(value = "siteIds", required = false) List<Integer> siteIds, |
| | | @RequestParam(value = "sixBefore", required = false) String sixBefore){ |
| | | LocalDate sixBeforeDate = sixBefore == null || sixBefore.isEmpty() ? null : LocalDate.parse(sixBefore); |
| | | BigDecimal sum = parkingRecordService.getSum(siteIds, sixBeforeDate); |
| | | return R.ok(sum); |
| | | } |
| | | |