Pu Zhibing
2024-10-12 1e7bea1cfadbbbc95b0c0697b13aa9050cf02dc7
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TParkingLotController.java
@@ -1,6 +1,7 @@
package com.ruoyi.chargingPile.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.chargingPile.api.dto.TParkingLotDTO;
import com.ruoyi.chargingPile.api.model.TCarport;
@@ -79,7 +80,7 @@
    /**
     * 添加停车场管理
     */
    @Log(title = "添加停车场", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE)
    @Log(title = "【停车场】添加停车场", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE)
    @ApiOperation(tags = {"后台-停车场"},value = "添加停车场")
    @PostMapping(value = "/add")
    public AjaxResult<Boolean> add(@RequestBody TParkingLotDTO dto) {
@@ -89,7 +90,7 @@
    /**
     * 修改停车场
     */
    @Log(title = "修改停车场", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE)
    @Log(title = "【停车场】修改停车场", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE)
    @ApiOperation(tags = {"后台-停车场"},value = "修改停车场")
    @PostMapping(value = "/update")
    public AjaxResult<Boolean> update(@RequestBody TParkingLotDTO dto) {
@@ -108,7 +109,7 @@
    /**
     * 删除停车场
     */
    @Log(title = "删除停车场", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE)
    @Log(title = "【停车场】删除停车场", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE)
    @ApiOperation(tags = {"后台-停车场"},value = "删除停车场")
    @DeleteMapping(value = "/deleteById")
    public AjaxResult<Boolean> deleteById(@RequestParam("id") Integer id) {
@@ -124,7 +125,7 @@
    /**
     * 批量删除停车场
     */
    @Log(title = "批量删除停车场", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE)
    @Log(title = "【停车场】批量删除停车场", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE)
    @ApiOperation(tags = {"后台-停车场"},value = "批量删除停车场")
    @DeleteMapping(value = "/deleteByIds")
    public AjaxResult<Boolean> deleteByIds(@RequestParam String ids) {
@@ -156,5 +157,18 @@
        BigDecimal sum =  parkingRecordService.getSum(sixBefore);
        return R.ok();
    }
    /**
     * 根据停车场标识查询停车场
     * @param appKey
     * @return
     */
    @PostMapping(value = "/getParkingLotByAppKey")
    public R<TParkingLot> getParkingLotByAppKey(@RequestParam("appKey") String appKey){
        TParkingLot parkingLot = parkingLotService.getOne(new LambdaQueryWrapper<TParkingLot>()
                .eq(TParkingLot::getAppKey, appKey).eq(TParkingLot::getDelFlag, 0));
        return R.ok(parkingLot);
    }
}