From 2b67ed2da39eba5824cfee7950e03be2c1a256ec Mon Sep 17 00:00:00 2001
From: heheng <475597332@qq.com>
Date: 星期一, 20 十月 2025 13:17:04 +0800
Subject: [PATCH] 新增数据上传准东
---
src/main/java/com/ruoyi/project/tr/OverhaulLog/controller/OverhaulLogController.java | 264 ++++++++++++++++++++++++++++------------------------
1 files changed, 144 insertions(+), 120 deletions(-)
diff --git a/src/main/java/com/ruoyi/project/tr/OverhaulLog/controller/OverhaulLogController.java b/src/main/java/com/ruoyi/project/tr/OverhaulLog/controller/OverhaulLogController.java
index 4880cf3..0a8c878 100644
--- a/src/main/java/com/ruoyi/project/tr/OverhaulLog/controller/OverhaulLogController.java
+++ b/src/main/java/com/ruoyi/project/tr/OverhaulLog/controller/OverhaulLogController.java
@@ -1,120 +1,144 @@
-package com.ruoyi.project.tr.OverhaulLog.controller;
-
-import com.ruoyi.doublePrevention.entity.PreventOverhaulLog;
-import com.ruoyi.doublePrevention.entity.PreventRiskControlMeasure;
-import com.ruoyi.doublePrevention.entity.dto.req.*;
-import com.ruoyi.doublePrevention.entity.dto.resp.PreventOverhaulLogRespDTO;
-import com.ruoyi.doublePrevention.entity.dto.resp.PreventRiskControlMeasureRespDTO;
-import com.ruoyi.doublePrevention.entity.dto.resp.PreventRiskEventListQueryRespDTO;
-import com.ruoyi.doublePrevention.service.baseService.PreventOverhaulLogService;
-import com.ruoyi.doublePrevention.vo.ResultVO;
-import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.framework.web.controller.BaseController;
-import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.framework.web.page.TableDataInfo;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.ModelMap;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-
-
-
-@Controller
-@RequestMapping("/tr/overhaulLog")
-public class OverhaulLogController extends BaseController {
-
- private String prefix = "tr/overhaulLog";
-
-
- @Autowired
- private PreventOverhaulLogService overhaulLogService;
-
- @GetMapping()
- public String overhaulLog()
- {
- return prefix + "/overhaulLog";
- }
-
- /**
- * 查询
- * */
- public TableDataInfo selectOverhaulLogPage(PreventOverhaulLogReqBO overhaulLogReqBO, ModelMap mmap){
-
- ResultVO<PreventOverhaulLogRespDTO> result = overhaulLogService.selectOverhaulLogPage(overhaulLogReqBO);
- List<PreventOverhaulLogRespDTO> data = (List<PreventOverhaulLogRespDTO>) result.getData();
-
- TableDataInfo dataTable = getDataTable(data);
- dataTable.setTotal(result.getCount());
- return dataTable;
- }
-
- /**
- * 新增检修记录
- */
- @GetMapping("/add")
- public String add()
- {
- return prefix + "/add";
- }
-
-
- /**
- * 新增保存检修记录
- */
- @PostMapping("/add")
- @ResponseBody
- public AjaxResult addSave(PreventOverhaulLogInsertReqBO insertReqBO)
- {
-
- ResultVO<PreventOverhaulLog> resultVO = overhaulLogService.savePreventOverhaulLog(insertReqBO);
- String code = resultVO.getCode();
- if ("200".equals(code)){
- return toAjax(1);
- }else {
- return AjaxResult.error(resultVO.getMsg());
- }
- }
-
- /**
- * 修改检修记录
- */
- @GetMapping("/edit/{id}")
- public String edit(@PathVariable("id") Long id, ModelMap mmap)
- {
- PreventOverhaulLog overhaulLogById = overhaulLogService.getOverhaulLogById(id);
- mmap.put("overhaulLogById",overhaulLogById);
- return prefix + "/edit";
- }
-
- /**
- * 修改保存
- */
- @PostMapping("/edit")
- @ResponseBody
- public AjaxResult editSave(PreventOverhaulLogUpdateReqBO updateReqBO)
- {
- ResultVO<PreventOverhaulLog> resultVO = overhaulLogService.updateOverhaulLog(updateReqBO);
- String code = resultVO.getCode();
- if ("200".equals(code)){
- return toAjax(1);
- }else {
- return AjaxResult.error(resultVO.getMsg());
- }
- }
-
- /**
- * 删除检修记录
- */
- @Log(title = "风险单元类型", businessType = BusinessType.DELETE)
- @PostMapping( "/remove")
- @ResponseBody
- public AjaxResult remove(String ids)
- {
- return toAjax(overhaulLogService.deleteOverhaulLogByIds(ids));
- }
-
-
-}
+package com.ruoyi.project.tr.OverhaulLog.controller;
+
+import com.ruoyi.doublePrevention.entity.PreventOverhaulLog;
+import com.ruoyi.doublePrevention.entity.PreventRiskControlMeasure;
+import com.ruoyi.doublePrevention.entity.dto.req.*;
+import com.ruoyi.doublePrevention.entity.dto.resp.PreventOverhaulLogRespDTO;
+import com.ruoyi.doublePrevention.entity.dto.resp.PreventRiskControlMeasureRespDTO;
+import com.ruoyi.doublePrevention.entity.dto.resp.PreventRiskEventListQueryRespDTO;
+import com.ruoyi.doublePrevention.entity.dto.resp.PreventRiskUnitCodeAndNameListQueryRespDTO;
+import com.ruoyi.doublePrevention.service.RiskService;
+import com.ruoyi.doublePrevention.service.baseService.PreventOverhaulLogService;
+import com.ruoyi.doublePrevention.vo.ResultVO;
+import com.ruoyi.framework.aspectj.lang.annotation.Log;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
+import com.ruoyi.framework.web.controller.BaseController;
+import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.framework.web.page.TableDataInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+
+
+@Controller
+@RequestMapping("/tr/overhaulLog")
+public class OverhaulLogController extends BaseController {
+
+ private String prefix = "tr/overhaulLog";
+
+
+ @Autowired
+ private PreventOverhaulLogService overhaulLogService;
+
+ @Autowired
+ private RiskService riskService;
+
+
+// @GetMapping()
+// public String overhaulLog()
+// {
+// return prefix + "/overhaulLog";
+// }
+ @GetMapping()
+ public String overhaulLog(ModelMap mmap)
+ {
+ List<PreventRiskUnitCodeAndNameListQueryRespDTO> respDTOS = riskService.listRiskUnitCodeAndName();
+ mmap.put("riskUnits", respDTOS);
+ return prefix + "/overhaulLog";
+ }
+
+ /**
+ * 查询
+ * */
+ @PostMapping("/list")
+ @ResponseBody
+ public TableDataInfo selectOverhaulLogPage(PreventOverhaulLogReqBO overhaulLogReqBO, ModelMap mmap){
+
+ ResultVO<PreventOverhaulLogRespDTO> result = overhaulLogService.selectOverhaulLogPage(overhaulLogReqBO);
+ List<PreventOverhaulLogRespDTO> data = (List<PreventOverhaulLogRespDTO>) result.getData();
+
+ TableDataInfo dataTable = getDataTable(data);
+ dataTable.setTotal(result.getCount());
+ return dataTable;
+ }
+
+ /**
+ * 新增检修记录
+ */
+// @GetMapping("/add")
+// public String add()
+// {
+// return prefix + "/add";
+// }
+
+ @GetMapping("/add")
+ public String add(ModelMap mmap)
+ {
+ List<PreventRiskUnitCodeAndNameListQueryRespDTO> respDTOS = riskService.listRiskUnitCodeAndName();
+ mmap.put("riskUnits", respDTOS);
+ return prefix + "/add";
+ }
+
+ /**
+ * 新增保存检修记录
+ */
+ @PostMapping("/add")
+ @ResponseBody
+ public AjaxResult addSave(PreventOverhaulLogInsertReqBO insertReqBO)
+ {
+
+ ResultVO<PreventOverhaulLog> resultVO = overhaulLogService.savePreventOverhaulLog(insertReqBO);
+ String code = resultVO.getCode();
+ if ("200".equals(code)){
+ return toAjax(1);
+ }else {
+ return AjaxResult.error(resultVO.getMsg());
+ }
+ }
+
+ /**
+ * 修改检修记录
+ */
+ @GetMapping("/edit/{id}")
+ public String edit(@PathVariable("id") Long id, ModelMap mmap)
+ {
+ PreventOverhaulLog overhaulLogById = overhaulLogService.getOverhaulLogById(id);
+ mmap.put("overhaulLog",overhaulLogById);
+ List<PreventRiskUnitCodeAndNameListQueryRespDTO> respDTOS = riskService.listRiskUnitCodeAndName();
+ mmap.put("riskUnits", respDTOS);
+ return prefix + "/edit";
+ }
+
+ /**
+ * 修改保存
+ */
+ @PostMapping("/edit")
+ @ResponseBody
+ public AjaxResult editSave(PreventOverhaulLogUpdateReqBO updateReqBO)
+ {
+ ResultVO<PreventOverhaulLog> resultVO = overhaulLogService.updateOverhaulLog(updateReqBO);
+ String code = resultVO.getCode();
+ if ("200".equals(code)){
+ return toAjax(1);
+ }else {
+ return AjaxResult.error(resultVO.getMsg());
+ }
+ }
+
+ /**
+ * 删除检修记录
+ */
+ @Log(title = "风险单元类型", businessType = BusinessType.DELETE)
+ @PostMapping( "/remove")
+ @ResponseBody
+ public AjaxResult remove(String ids)
+ {
+ return toAjax(overhaulLogService.deleteOverhaulLogByIds(ids));
+ }
+
+
+}
--
Gitblit v1.9.2