From 1f0943282abde9f1044ec2faee8510d0aea1d59e Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期一, 07 四月 2025 15:32:16 +0800
Subject: [PATCH] 设备报修记录批量作废

---
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamReportRepair.java               |   22 +++++-----
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamReportRepairController.java |   59 +++++++++++++++++++----------
 2 files changed, 49 insertions(+), 32 deletions(-)

diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamReportRepairController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamReportRepairController.java
index a52d1ca..7a5d8e4 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamReportRepairController.java
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamReportRepairController.java
@@ -1,6 +1,7 @@
 package org.jeecg.modules.eam.controller;
 
 import java.util.Arrays;
+import java.util.List;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -103,33 +104,49 @@
     }
 
     /**
-     * 閫氳繃id鍒犻櫎
-     *
-     * @param id
-     * @return
-     */
-    @AutoLog(value = "鏁呴殰鎶ヤ慨-閫氳繃id鍒犻櫎")
-    @ApiOperation(value = "鏁呴殰鎶ヤ慨-閫氳繃id鍒犻櫎", notes = "鏁呴殰鎶ヤ慨-閫氳繃id鍒犻櫎")
-    @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
-        eamReportRepairService.removeById(id);
-        return Result.OK("鍒犻櫎鎴愬姛!");
-    }
-
-    /**
-     * 鎵归噺鍒犻櫎
+     * 鎵归噺浣滃簾
      *
      * @param ids
      * @return
      */
-    @AutoLog(value = "鏁呴殰鎶ヤ慨-鎵归噺鍒犻櫎")
-    @ApiOperation(value = "鏁呴殰鎶ヤ慨-鎵归噺鍒犻櫎", notes = "鏁呴殰鎶ヤ慨-鎵归噺鍒犻櫎")
-    @DeleteMapping(value = "/deleteBatch")
-    public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        this.eamReportRepairService.removeByIds(Arrays.asList(ids.split(",")));
-        return Result.OK("鎵归噺鍒犻櫎鎴愬姛锛�");
+    @AutoLog(value = "鏁呴殰鎶ヤ慨-鎵归噺浣滃簾")
+    @ApiOperation(value = "鏁呴殰鎶ヤ慨-鎵归噺浣滃簾", notes = "鏁呴殰鎶ヤ慨-鎵归噺浣滃簾")
+    @DeleteMapping(value = "/abolishBatch")
+    public Result<?> abolishBatch(@RequestParam(name = "ids", required = true) String ids) {
+        List<EamReportRepair> eamReportRepairs = eamReportRepairService.listByIds(Arrays.asList(ids.split(",")));
+        eamReportRepairs.forEach(eamReportRepair -> eamReportRepair.setReportStatus(ReportRepairEnum.ABOLISH.name()));
+        this.eamReportRepairService.updateBatchById(eamReportRepairs);
+        return Result.OK("鎵归噺浣滃簾鎴愬姛锛�");
     }
 
+//    /**
+//     * 閫氳繃id鍒犻櫎
+//     *
+//     * @param id
+//     * @return
+//     */
+//    @AutoLog(value = "鏁呴殰鎶ヤ慨-閫氳繃id鍒犻櫎")
+//    @ApiOperation(value = "鏁呴殰鎶ヤ慨-閫氳繃id鍒犻櫎", notes = "鏁呴殰鎶ヤ慨-閫氳繃id鍒犻櫎")
+//    @DeleteMapping(value = "/delete")
+//    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+//        eamReportRepairService.removeById(id);
+//        return Result.OK("鍒犻櫎鎴愬姛!");
+//    }
+//
+//    /**
+//     * 鎵归噺鍒犻櫎
+//     *
+//     * @param ids
+//     * @return
+//     */
+//    @AutoLog(value = "鏁呴殰鎶ヤ慨-鎵归噺鍒犻櫎")
+//    @ApiOperation(value = "鏁呴殰鎶ヤ慨-鎵归噺鍒犻櫎", notes = "鏁呴殰鎶ヤ慨-鎵归噺鍒犻櫎")
+//    @DeleteMapping(value = "/deleteBatch")
+//    public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+//        this.eamReportRepairService.removeByIds(Arrays.asList(ids.split(",")));
+//        return Result.OK("鎵归噺鍒犻櫎鎴愬姛锛�");
+//    }
+
     /**
      * 閫氳繃id鏌ヨ
      *
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamReportRepair.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamReportRepair.java
index 23365dd..9da504d 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamReportRepair.java
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamReportRepair.java
@@ -31,9 +31,15 @@
 	private static final long serialVersionUID = 3966250456529614720L;
 
     /**
+     * 璁惧ID
+     */
+    @Excel(name = "璁惧ID", width = 15, dictTable = "eam_equipment", dicCode = "id", dicText = "equipment_code")
+    @ApiModelProperty(value = "璁惧ID")
+    @Dict(dictTable = "eam_equipment", dicCode = "id", dicText = "equipment_code")
+    private String equipmentId;
+    /**
      * 鍒犻櫎鏍囪
      */
-    @Excel(name = "鍒犻櫎鏍囪", width = 15)
     @ApiModelProperty(value = "鍒犻櫎鏍囪")
     @Dict(dicCode = "del_flag")
     private Integer delFlag;
@@ -43,21 +49,15 @@
     @ApiModelProperty(value = "鏁呴殰寮�濮嬫椂闂�")
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "鏁呴殰寮�濮嬫椂闂�", width = 15, format = "yyyy-MM-dd HH:mm:ss")
     private Date faultStartTime;
     /**
      * 鏄惁鍋滄満
      */
-    @Excel(name = "鏄惁鍋滄満", width = 15)
+    @Excel(name = "鏄惁鍋滄満", width = 15, dicCode = "breakdown_flag")
     @ApiModelProperty(value = "鏄惁鍋滄満")
     @Dict(dicCode = "breakdown_flag")
     private String breakdownFlag;
-    /**
-     * 璁惧ID
-     */
-    @Excel(name = "璁惧ID", width = 15)
-    @ApiModelProperty(value = "璁惧ID")
-    @Dict(dictTable = "eam_equipment", dicCode = "id", dicText = "equipment_code")
-    private String equipmentId;
     /**
      * 鏁呴殰绠�绉�
      */
@@ -67,7 +67,7 @@
     /**
      * 鏁呴殰鍒嗙被
      */
-    @Excel(name = "鏁呴殰鍒嗙被", width = 15)
+    @Excel(name = "鏁呴殰鍒嗙被", width = 15, dicCode = "fault_reason_category")
     @ApiModelProperty(value = "鏁呴殰鍒嗙被")
     @Dict(dicCode = "fault_reason_category")
     private String faultType;
@@ -80,7 +80,7 @@
     /**
      * 鎶ヤ慨鐘舵��
      */
-    @Excel(name = "鎶ヤ慨鐘舵��", width = 15)
+    @Excel(name = "鎶ヤ慨鐘舵��", width = 15, dicCode = "report_repair_status")
     @ApiModelProperty(value = "鎶ヤ慨鐘舵��")
     @Dict(dicCode = "report_repair_status")
     private String reportStatus;

--
Gitblit v1.9.3