From ddc0f14384619b9618f26a3f363f679833a68b3d Mon Sep 17 00:00:00 2001
From: yangbin <yangbin@qq.com>
Date: 星期三, 16 四月 2025 09:51:32 +0800
Subject: [PATCH] 自动化产线集成模块添加数据查询

---
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamWeekMaintenanceOrderController.java |   40 +++++++++++++++++++++++++++-------------
 1 files changed, 27 insertions(+), 13 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 e465d8b..13b404e 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
@@ -8,12 +8,9 @@
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
-import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.system.base.controller.JeecgController;
 import org.jeecg.modules.eam.constant.BusinessCodeConst;
-import org.jeecg.modules.eam.constant.MaintenanceStandardStatusEnum;
-import org.jeecg.modules.eam.constant.MaintenanceStatusEnum;
-import org.jeecg.modules.eam.entity.EamMaintenanceStandard;
+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;
@@ -58,7 +55,7 @@
                                    @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                    HttpServletRequest req) {
 //        QueryWrapper<EamWeekMaintenanceOrder> queryWrapper = QueryGenerator.initQueryWrapper(eamWeekMaintenanceOrder, req.getParameterMap());
-        Page<EamWeekMaintenanceOrder> page = new Page<EamWeekMaintenanceOrder>(pageNo, pageSize);
+        Page<EamWeekMaintenanceOrder> page = new Page<>(pageNo, pageSize);
         IPage<EamWeekMaintenanceOrder> pageList = eamWeekMaintenanceOrderService.queryPageList(page, query);
         return Result.OK(pageList);
     }
@@ -131,20 +128,37 @@
      * @param id
      * @return
      */
-    @AutoLog(value = "淇濆吇鏍囧噯-浣滃簾")
-    @ApiOperation(value = "淇濆吇鏍囧噯-浣滃簾", notes = "淇濆吇鏍囧噯-浣滃簾")
+    @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(!MaintenanceStatusEnum.WAIT_MAINTENANCE.name().equals(entity.getMaintenanceStatus())) {
+        if(!WeekMaintenanceStatusEnum.WAIT_MAINTENANCE.name().equals(entity.getMaintenanceStatus())) {
             return Result.error("璇ョ姸鎬佺殑鏁版嵁涓嶅厑璁歌繘琛屼綔搴燂紒");
         }
-        entity.setMaintenanceStatus(MaintenanceStatusEnum.ABOLISH.name());
+        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("棰嗗彇鎴愬姛!");
     }
 
     /**
@@ -167,15 +181,15 @@
      * @param ids
      * @return
      */
-    @AutoLog(value = "淇濆吇鏍囧噯-鎵归噺浣滃簾")
-    @ApiOperation(value = "淇濆吇鏍囧噯-鎵归噺浣滃簾", notes = "淇濆吇鏍囧噯-鎵归噺浣滃簾")
+    @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 && MaintenanceStatusEnum.WAIT_MAINTENANCE.name().equals(entity.getMaintenanceStatus())) {
-                entity.setMaintenanceStatus(MaintenanceStatusEnum.ABOLISH.name());
+            if (entity != null && WeekMaintenanceStatusEnum.WAIT_MAINTENANCE.name().equals(entity.getMaintenanceStatus())) {
+                entity.setMaintenanceStatus(WeekMaintenanceStatusEnum.ABOLISH.name());
                 eamWeekMaintenanceOrderService.updateById(entity);
             }
         });

--
Gitblit v1.9.3