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/SafetyTrainingRecordController.java | 93 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 93 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/ruoyi/safety/controller/SafetyTrainingRecordController.java b/src/main/java/com/ruoyi/safety/controller/SafetyTrainingRecordController.java
new file mode 100644
index 0000000..9a4a16a
--- /dev/null
+++ b/src/main/java/com/ruoyi/safety/controller/SafetyTrainingRecordController.java
@@ -0,0 +1,93 @@
+package com.ruoyi.safety.controller;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+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.SafetyTrainingRecord;
+import com.ruoyi.safety.service.SafetyTrainingRecordService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 瀹夌幆绠$悊-鍩硅瀹屾垚璁板綍鎺ュ彛銆�
+ */
+@RestController
+@Api(tags = "瀹夌幆绠$悊-鍩硅瀹屾垚璁板綍")
+@RequestMapping("/safety/training/record")
+public class SafetyTrainingRecordController extends SafetyControllerSupport {
+
+ @Autowired
+ private SafetyTrainingRecordService recordService;
+
+ /**
+ * 鍒嗛〉鏌ヨ鍩硅瀹屾垚璁板綍銆�
+ */
+ @Log(title = "瀹夌幆绠$悊-鍩硅瀹屾垚璁板綍-鍒嗛〉鏌ヨ", businessType = BusinessType.OTHER)
+ @ApiOperation("鍒嗛〉鏌ヨ鍩硅瀹屾垚璁板綍")
+ @GetMapping("/list")
+ public AjaxResult list(Page<SafetyTrainingRecord> page, SafetyTrainingRecord query,
+ @RequestParam(value = "pageNum", required = false) Long pageNum,
+ @RequestParam(value = "pageSize", required = false) Long pageSize) {
+ return AjaxResult.success(recordService.queryPage(buildPage(page, pageNum, pageSize), query));
+ }
+
+ /**
+ * add training completion record.
+ */
+ @Log(title = "safety-training-record-add", businessType = BusinessType.INSERT)
+ @ApiOperation("add safety training completion record")
+ @PostMapping("/add")
+ public AjaxResult add(@RequestBody SafetyTrainingRecord record) {
+ return toAjax(recordService.saveSafety(record));
+ }
+
+ /**
+ * update training completion record.
+ */
+ @Log(title = "safety-training-record-update", businessType = BusinessType.UPDATE)
+ @ApiOperation("update safety training completion record")
+ @PutMapping("/update")
+ public AjaxResult update(@RequestBody SafetyTrainingRecord record) {
+ return toAjax(recordService.updateSafety(record));
+ }
+
+ /**
+ * delete training completion record.
+ */
+ @Log(title = "safety-training-record-delete", businessType = BusinessType.DELETE)
+ @ApiOperation("delete safety training completion record")
+ @DeleteMapping("/delete/{id}")
+ public AjaxResult delete(@PathVariable Long id) {
+ return toAjax(recordService.deleteSafetyById(id));
+ }
+
+ /**
+ * training completion record detail.
+ */
+ @Log(title = "safety-training-record-detail", businessType = BusinessType.OTHER)
+ @ApiOperation("query safety training completion record detail")
+ @GetMapping("/detail/{id}")
+ public AjaxResult detail(@PathVariable Long id) {
+ return AjaxResult.success(recordService.getById(id));
+ }
+
+ /**
+ * 瀵煎嚭鍩硅瀹屾垚璁板綍銆�
+ */
+ @Log(title = "瀹夌幆绠$悊-鍩硅瀹屾垚璁板綍-瀵煎嚭", businessType = BusinessType.EXPORT)
+ @ApiOperation("瀵煎嚭鍩硅瀹屾垚璁板綍")
+ @GetMapping("/export")
+ public void export(HttpServletResponse response, SafetyTrainingRecord query) {
+ List<SafetyTrainingRecord> records = recordService.queryPage(new Page<SafetyTrainingRecord>(1, -1), query)
+ .getRecords();
+ ExcelUtil<SafetyTrainingRecord> util = new ExcelUtil<SafetyTrainingRecord>(SafetyTrainingRecord.class);
+ util.exportExcel(response, records, "safety_training_record");
+ }
+}
--
Gitblit v1.9.3