From 8e265fc62db10524dea86fff5a13a3897aba6f7a Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期四, 10 四月 2025 10:35:36 +0800
Subject: [PATCH] update

---
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamWeekMaintenanceOrderController.java |   62 +++++++++++++++++++++++++++++++
 1 files changed, 62 insertions(+), 0 deletions(-)

diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamWeekMaintenanceOrderController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamWeekMaintenanceOrderController.java
index 51ee76c..3678b95 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamWeekMaintenanceOrderController.java
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamWeekMaintenanceOrderController.java
@@ -10,6 +10,7 @@
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.base.controller.JeecgController;
 import org.jeecg.modules.eam.constant.BusinessCodeConst;
+import org.jeecg.modules.eam.constant.WeekMaintenanceStatusEnum;
 import org.jeecg.modules.eam.entity.EamWeekMaintenanceOrder;
 import org.jeecg.modules.eam.request.EamWeekMaintenanceQuery;
 import org.jeecg.modules.eam.request.EamWeekMaintenanceRequest;
@@ -20,6 +21,7 @@
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.Arrays;
+import java.util.List;
 
 /**
  * @Description: 鍛ㄤ繚宸ュ崟
@@ -121,6 +123,45 @@
     }
 
     /**
+     * 閫氳繃id浣滃簾
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "鍛ㄤ繚宸ュ崟-浣滃簾")
+    @ApiOperation(value = "鍛ㄤ繚宸ュ崟-浣滃簾", notes = "鍛ㄤ繚宸ュ崟-浣滃簾")
+    @DeleteMapping(value = "/abolish")
+    public Result<?> abolish(@RequestParam(name = "id", required = true) String id) {
+        EamWeekMaintenanceOrder entity = eamWeekMaintenanceOrderService.getById(id);
+        if(entity == null) {
+            return Result.error("瑕佷綔搴熺殑鏁版嵁涓嶅瓨鍦紝璇峰埛鏂伴噸璇曪紒");
+        }
+        if(!WeekMaintenanceStatusEnum.WAIT_MAINTENANCE.name().equals(entity.getMaintenanceStatus())) {
+            return Result.error("璇ョ姸鎬佺殑鏁版嵁涓嶅厑璁歌繘琛屼綔搴燂紒");
+        }
+        entity.setMaintenanceStatus(WeekMaintenanceStatusEnum.ABOLISH.name());
+        eamWeekMaintenanceOrderService.updateById(entity);
+        return Result.OK("浣滃簾鎴愬姛!");
+    }
+
+    /**
+     * 閫氳繃id棰嗗彇
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "鍛ㄤ繚宸ュ崟-棰嗗彇")
+    @ApiOperation(value = "鍛ㄤ繚宸ュ崟-棰嗗彇", notes = "鍛ㄤ繚宸ュ崟-棰嗗彇")
+    @GetMapping(value = "/collect")
+    public Result<?> collect(@RequestParam(name = "id", required = true) String id) {
+        boolean b = eamWeekMaintenanceOrderService.collect(id);
+        if(!b) {
+            Result.OK("棰嗗彇澶辫触!");
+        }
+        return Result.OK("棰嗗彇鎴愬姛!");
+    }
+
+    /**
      * 鎵归噺鍒犻櫎
      *
      * @param ids
@@ -135,6 +176,27 @@
     }
 
     /**
+     * 閫氳繃id鎵归噺浣滃簾
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "鍛ㄤ繚宸ュ崟-鎵归噺浣滃簾")
+    @ApiOperation(value = "鍛ㄤ繚宸ュ崟-鎵归噺浣滃簾", notes = "鍛ㄤ繚宸ュ崟-鎵归噺浣滃簾")
+    @DeleteMapping(value = "/abolishBatch")
+    public Result<?> abolishBatch(@RequestParam(name = "ids", required = true) String ids) {
+        List<String> list = Arrays.asList(ids.split(","));
+        list.forEach(id -> {
+            EamWeekMaintenanceOrder entity = eamWeekMaintenanceOrderService.getById(id);
+            if (entity != null && WeekMaintenanceStatusEnum.WAIT_MAINTENANCE.name().equals(entity.getMaintenanceStatus())) {
+                entity.setMaintenanceStatus(WeekMaintenanceStatusEnum.ABOLISH.name());
+                eamWeekMaintenanceOrderService.updateById(entity);
+            }
+        });
+        return Result.OK("鎵归噺浣滃簾鎴愬姛锛�");
+    }
+
+    /**
      * 閫氳繃id鏌ヨ
      *
      * @param id

--
Gitblit v1.9.3