zhangnaisong
2024-07-02 77776780812cadbd661f3b929c13195e18ec18fe
ard-work/src/main/java/com/ruoyi/sy/controller/ArdTankLockController.java
@@ -131,13 +131,52 @@
        return toAjax(ardTankLockService.deleteArdTankLockById(id));
    }
    @ApiOperation("查询全部电磁锁")
    /*@ApiOperation("查询全部电磁锁")
    @PreAuthorize("@ss.hasPermi('sy:lock:getAll')")
    @GetMapping("/getAll")
    public Results getAll() {
        String userId = SecurityUtils.getUserId();
        Results result = ardTankLockService.getAll(userId);
        return result;
    }*/
    @ApiOperation("查询全部电磁锁")
    @PreAuthorize("@ss.hasPermi('sy:lock:getAll')")
    @GetMapping("/getAll")
    public TableDataInfo getAll() {
        startPage();
        String userId = SecurityUtils.getUserId();
        List<Map<String,Object>> result = ardTankLockService.getAll(userId);
        return getDataTable(result);
    }
    /**
     * 根据car_id获取电磁锁详细信息
     */
    @ApiOperation("根据car_id获取电磁锁详细信息")
    @PreAuthorize("@ss.hasPermi('sy:lock:getLockByCarId')")
    @PostMapping("/getLockByCarId")
    public AjaxResult getLockByCarId(@RequestBody ArdTankLock ardTankLock) {
        String userId = SecurityUtils.getUserId();
        return success(ardTankLockService.getLockByCarId(ardTankLock.getCarId(),userId));
    }
    /**
     * 根据car_id删除电磁锁
     */
    @ApiOperation("根据car_id删除电磁锁")
    @PreAuthorize("@ss.hasPermi('sy:lock:deleteLockByCarId')")
    @PostMapping("/deleteLockByCarId")
    public AjaxResult deleteLockByCarId(@RequestBody ArdTankLock ardTankLock) {
        return toAjax(ardTankLockService.deleteLockByCarId(ardTankLock.getCarId()));
    }
    @ApiOperation("修改电磁锁")
    @PreAuthorize("@ss.hasPermi('sy:lock:updateLockByCarId')")
    @Log(title = "电磁锁" , businessType = BusinessType.UPDATE)
    @PutMapping("/updateLockByCarId")
    public AjaxResult updateLockByCarId(@RequestBody Map<String,Object> para) {
        return toAjax(ardTankLockService.updateLockByCarId(para));
    }
    /**