From 1b77c2724e38d087f3eab4a2f27b3b165f4265dc Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期一, 25 五月 2026 14:37:34 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_tide' into dev_tide
---
src/main/java/com/ruoyi/safety/controller/SafetyWorkAreaController.java | 87 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 87 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/ruoyi/safety/controller/SafetyWorkAreaController.java b/src/main/java/com/ruoyi/safety/controller/SafetyWorkAreaController.java
new file mode 100644
index 0000000..824b38f
--- /dev/null
+++ b/src/main/java/com/ruoyi/safety/controller/SafetyWorkAreaController.java
@@ -0,0 +1,87 @@
+package com.ruoyi.safety.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.framework.aspectj.lang.annotation.Log;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
+import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.safety.pojo.SafetyWorkArea;
+import com.ruoyi.safety.service.SafetyWorkAreaService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 瀹夌幆绠$悊-浣滀笟鍖哄煙鎺ュ彛銆�
+ */
+@RestController
+@Api(tags = "瀹夌幆绠$悊-浣滀笟鍖哄煙")
+@RequestMapping("/safety/workArea")
+public class SafetyWorkAreaController extends SafetyControllerSupport {
+
+ @Autowired
+ private SafetyWorkAreaService workAreaService;
+
+ /**
+ * 鍒嗛〉鏌ヨ浣滀笟鍖哄煙銆�
+ */
+ @Log(title = "瀹夌幆绠$悊-浣滀笟鍖哄煙-鍒嗛〉鏌ヨ", businessType = BusinessType.OTHER)
+ @ApiOperation("鍒嗛〉鏌ヨ浣滀笟鍖哄煙")
+ @GetMapping("/list")
+ public AjaxResult list(Page<SafetyWorkArea> page, SafetyWorkArea query,
+ @RequestParam(value = "pageNum", required = false) Long pageNum,
+ @RequestParam(value = "pageSize", required = false) Long pageSize) {
+ return AjaxResult.success(workAreaService.queryPage(buildPage(page, pageNum, pageSize), query));
+ }
+
+ /**
+ * 鏂板浣滀笟鍖哄煙銆�
+ */
+ @Log(title = "瀹夌幆绠$悊-浣滀笟鍖哄煙-鏂板", businessType = BusinessType.INSERT)
+ @ApiOperation("鏂板浣滀笟鍖哄煙")
+ @PostMapping("/add")
+ public AjaxResult add(@RequestBody SafetyWorkArea workArea) {
+ return toAjax(workAreaService.saveSafety(workArea));
+ }
+
+ /**
+ * 淇敼浣滀笟鍖哄煙銆�
+ */
+ @Log(title = "瀹夌幆绠$悊-浣滀笟鍖哄煙-淇敼", businessType = BusinessType.UPDATE)
+ @ApiOperation("淇敼浣滀笟鍖哄煙")
+ @PutMapping("/update")
+ public AjaxResult update(@RequestBody SafetyWorkArea workArea) {
+ return toAjax(workAreaService.updateSafety(workArea));
+ }
+
+ /**
+ * 鍒犻櫎浣滀笟鍖哄煙銆�
+ */
+ @Log(title = "瀹夌幆绠$悊-浣滀笟鍖哄煙-鍒犻櫎", businessType = BusinessType.DELETE)
+ @ApiOperation("鍒犻櫎浣滀笟鍖哄煙")
+ @DeleteMapping("/delete/{id}")
+ public AjaxResult delete(@PathVariable Long id) {
+ return toAjax(workAreaService.deleteSafetyById(id));
+ }
+
+ /**
+ * 鏌ヨ浣滀笟鍖哄煙璇︽儏銆�
+ */
+ @Log(title = "瀹夌幆绠$悊-浣滀笟鍖哄煙-璇︽儏", businessType = BusinessType.OTHER)
+ @ApiOperation("鏌ヨ浣滀笟鍖哄煙璇︽儏")
+ @GetMapping("/detail/{id}")
+ public AjaxResult detail(@PathVariable Long id) {
+ return AjaxResult.success(workAreaService.getById(id));
+ }
+
+ /**
+ * 鏌ヨ鍏ㄩ儴浣滀笟鍖哄煙锛岀敤浜庝笅鎷夐�夋嫨銆�
+ */
+ @Log(title = "瀹夌幆绠$悊-浣滀笟鍖哄煙-鍏ㄩ儴鏌ヨ", businessType = BusinessType.OTHER)
+ @ApiOperation("鏌ヨ鍏ㄩ儴浣滀笟鍖哄煙")
+ @GetMapping("/all")
+ public AjaxResult all() {
+ return AjaxResult.success(workAreaService.list(new QueryWrapper<SafetyWorkArea>().orderByDesc("create_time")));
+ }
+}
--
Gitblit v1.9.3