From 4b8bdee03a2469a0260611f4f06d26ef16c5383c Mon Sep 17 00:00:00 2001
From: zhangnaisong <2434969829@qq.com>
Date: 星期四, 04 七月 2024 13:20:31 +0800
Subject: [PATCH] 电磁锁电子围栏分页查询及根据主键查询提交
---
ard-work/src/main/java/com/ruoyi/sy/controller/ArdTankLockController.java | 151 ++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 140 insertions(+), 11 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/sy/controller/ArdTankLockController.java b/ard-work/src/main/java/com/ruoyi/sy/controller/ArdTankLockController.java
index 46f8860..eeff2ee 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/controller/ArdTankLockController.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/controller/ArdTankLockController.java
@@ -1,9 +1,14 @@
package com.ruoyi.sy.controller;
import java.util.List;
+import java.util.Map;
import javax.servlet.http.HttpServletResponse;
+import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
+import com.ruoyi.sy.domain.ArdTankWall;
+import com.ruoyi.sy.service.IArdTankWallService;
+import com.ruoyi.utils.result.Results;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -29,7 +34,7 @@
* 鐢电閿丆ontroller
*
* @author ard
- * @date 2024-06-29
+ * @date 2024-07-01
*/
@Api(tags = "鐢电閿�")
@RestController
@@ -38,12 +43,15 @@
@Autowired
private IArdTankLockService ardTankLockService;
-/**
- * 鏌ヨ鐢电閿佸垪琛�
- */
-@ApiOperation("鏌ヨ鐢电閿佸垪琛�")
-@PreAuthorize("@ss.hasPermi('sy:lock:list')")
-@GetMapping("/list")
+ @Autowired
+ private IArdTankWallService ardTankWallService;
+
+ /**
+ * 鏌ヨ鐢电閿佸垪琛�
+ */
+ @ApiOperation("鏌ヨ鐢电閿佸垪琛�")
+ @PreAuthorize("@ss.hasPermi('sy:lock:list')")
+ @GetMapping("/list")
public TableDataInfo list(ArdTankLock ardTankLock) {
startPage();
List<ArdTankLock> list = ardTankLockService.selectArdTankLockList(ardTankLock);
@@ -75,14 +83,19 @@
/**
* 鏂板鐢电閿�
*/
- @ApiOperation("鏂板鐢电閿�")
+ /*@ApiOperation("鏂板鐢电閿�")
@PreAuthorize("@ss.hasPermi('sy:lock:add')")
@Log(title = "鐢电閿�" , businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ArdTankLock ardTankLock) {
- String id = IdUtils.simpleUUID();
- ardTankLock.setId(id);
return toAjax(ardTankLockService.insertArdTankLock(ardTankLock));
+ }*/
+ @ApiOperation("鏂板鐢电閿�")
+ @PreAuthorize("@ss.hasPermi('sy:lock:add')")
+ @Log(title = "鐢电閿�" , businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody Map<String,Object> para) {
+ return toAjax(ardTankLockService.insertArdTankLock(para));
}
/**
@@ -99,11 +112,127 @@
/**
* 鍒犻櫎鐢电閿�
*/
- @ApiOperation("鍒犻櫎鐢电閿�")
+ /*@ApiOperation("鍒犻櫎鐢电閿�")
@PreAuthorize("@ss.hasPermi('sy:lock:remove')")
@Log(title = "鐢电閿�" , businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids) {
return toAjax(ardTankLockService.deleteArdTankLockByIds(ids));
+ }*/
+
+ /**
+ * 鍒犻櫎鐢电閿�
+ */
+ @ApiOperation("鍒犻櫎鍗曚竴鐢电閿�")
+ @PreAuthorize("@ss.hasPermi('sy:lock:remove')")
+ @Log(title = "鐢电閿�" , businessType = BusinessType.DELETE)
+ @DeleteMapping("/{id}")
+ public AjaxResult remove(@PathVariable String id) {
+ return toAjax(ardTankLockService.deleteArdTankLockById(id));
+ }
+
+ /*@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));
+ }
+
+ /**
+ * 鏂板鐢靛瓙鍥存爮
+ */
+ @ApiOperation("鏂板鐢靛瓙鍥存爮")
+ @PreAuthorize("@ss.hasPermi('sy:lock:addWall')")
+ @Log(title = "鐢电閿�" , businessType = BusinessType.INSERT)
+ @PostMapping("/addWall")
+ public AjaxResult addWall(@RequestBody ArdTankWall ardTankWall) {
+ return toAjax(ardTankWallService.insertArdTankWall(ardTankWall));
+ }
+
+ /**
+ * 淇敼鐢靛瓙鍥存爮
+ */
+ @ApiOperation("淇敼鐢靛瓙鍥存爮")
+ @PreAuthorize("@ss.hasPermi('sy:lock:updateWall')")
+ @Log(title = "鐢电閿�" , businessType = BusinessType.UPDATE)
+ @PutMapping("/updateWall")
+ public AjaxResult updateWall(@RequestBody ArdTankWall ardTankWall) {
+ return toAjax(ardTankWallService.updateArdTankWall(ardTankWall));
+ }
+
+ /**
+ * 鍒犻櫎鐢靛瓙鍥存爮
+ */
+ @ApiOperation("鍒犻櫎鍗曚竴鐢靛瓙鍥存爮")
+ @PreAuthorize("@ss.hasPermi('sy:lock:removeWall')")
+ @Log(title = "鐢电閿�" , businessType = BusinessType.DELETE)
+ @DeleteMapping("/removeWall/{id}")
+ public AjaxResult removeWall(@PathVariable String id) {
+ return toAjax(ardTankWallService.deleteArdTankWallById(id));
+ }
+
+ /*@ApiOperation("鏌ヨ鍏ㄩ儴鐢靛瓙鍥存爮")
+ @PreAuthorize("@ss.hasPermi('sy:lock:getAllArdTankWall')")
+ @GetMapping("/getAllArdTankWall")
+ public Results getAllArdTankWall() {
+ List<ArdTankWall> result = ardTankWallService.getAllArdTankWall();
+ return Results.succeed(result);
+ }*/
+
+ @ApiOperation("鏌ヨ鍏ㄩ儴鐢靛瓙鍥存爮")
+ @PreAuthorize("@ss.hasPermi('sy:lock:getAllArdTankWall')")
+ @PostMapping("/getAllArdTankWall")
+ public TableDataInfo getAllArdTankWall(@RequestBody ArdTankWall ardTankWall) {
+ startPage();
+ List<ArdTankWall> list = ardTankWallService.selectArdTankWallList(ardTankWall);
+ return getDataTable(list);
+ }
+
+ @ApiOperation("鏍规嵁涓婚敭鑾峰彇鐢电閿佺數瀛愬洿鏍�")
+ @PreAuthorize("@ss.hasPermi('sy:tankWall:getArdTankWallById')")
+ @GetMapping(value = "/getArdTankWallById/{id}")
+ public AjaxResult getArdTankWallById(@PathVariable String id) {
+ return success(ardTankWallService.selectArdTankWallById(id));
}
}
--
Gitblit v1.9.3