From ac4d1a5962441156ff22a0c87f4eacc083daa9a6 Mon Sep 17 00:00:00 2001
From: cuilei <ray_tsu1@163.com>
Date: 星期五, 20 六月 2025 11:32:43 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamThirdMaintenanceOrderDetailController.java |  246 +++++++++++++++++++-----------------------------
 1 files changed, 97 insertions(+), 149 deletions(-)

diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamThirdMaintenanceOrderDetailController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamThirdMaintenanceOrderDetailController.java
index e757b8c..f436b92 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamThirdMaintenanceOrderDetailController.java
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamThirdMaintenanceOrderDetailController.java
@@ -1,167 +1,115 @@
 package org.jeecg.modules.eam.controller;
 
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.aspect.annotation.AutoLog;
-import org.jeecg.common.util.oConvertUtils;
-import org.jeecg.modules.eam.entity.EamThirdMaintenanceOrderDetail;
-import org.jeecg.modules.eam.service.IEamThirdMaintenanceOrderDetailService;
-import java.util.Date;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.system.base.controller.JeecgController;
-import org.jeecgframework.poi.excel.ExcelImportUtil;
-import org.jeecgframework.poi.excel.def.NormalExcelConstants;
-import org.jeecgframework.poi.excel.entity.ExportParams;
-import org.jeecgframework.poi.excel.entity.ImportParams;
-import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-import org.springframework.web.multipart.MultipartHttpServletRequest;
-import org.springframework.web.servlet.ModelAndView;
-import com.alibaba.fastjson.JSON;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.jeecg.modules.eam.entity.EamSecondMaintenanceOrderDetail;
+import org.jeecg.modules.eam.entity.EamThirdMaintenanceOrderDetail;
+import org.jeecg.modules.eam.service.IEamThirdMaintenanceOrderDetailService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 
- /**
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
  * @Description: 璁惧涓夌骇淇濆吇鏄庣粏
  * @Author: jeecg-boot
- * @Date:   2025-04-29
+ * @Date: 2025-04-29
  * @Version: V1.0
  */
 @Slf4j
-@Api(tags="璁惧涓夌骇淇濆吇鏄庣粏")
+@Api(tags = "璁惧涓夌骇淇濆吇鏄庣粏")
 @RestController
-@RequestMapping("/eam/eamThirdMaintenanceOrderDetail")
+@RequestMapping("/eam/thirdMaintenanceOrderDetail")
 public class EamThirdMaintenanceOrderDetailController extends JeecgController<EamThirdMaintenanceOrderDetail, IEamThirdMaintenanceOrderDetailService> {
-	@Autowired
-	private IEamThirdMaintenanceOrderDetailService eamThirdMaintenanceOrderDetailService;
-	
-	/**
-	 * 鍒嗛〉鍒楄〃鏌ヨ
-	 *
-	 * @param eamThirdMaintenanceOrderDetail
-	 * @param pageNo
-	 * @param pageSize
-	 * @param req
-	 * @return
-	 */
-	@AutoLog(value = "璁惧涓夌骇淇濆吇鏄庣粏-鍒嗛〉鍒楄〃鏌ヨ")
-	@ApiOperation(value="璁惧涓夌骇淇濆吇鏄庣粏-鍒嗛〉鍒楄〃鏌ヨ", notes="璁惧涓夌骇淇濆吇鏄庣粏-鍒嗛〉鍒楄〃鏌ヨ")
-	@GetMapping(value = "/list")
-	public Result<?> queryPageList(EamThirdMaintenanceOrderDetail eamThirdMaintenanceOrderDetail,
-								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
-								   HttpServletRequest req) {
-		QueryWrapper<EamThirdMaintenanceOrderDetail> queryWrapper = QueryGenerator.initQueryWrapper(eamThirdMaintenanceOrderDetail, req.getParameterMap());
-		Page<EamThirdMaintenanceOrderDetail> page = new Page<EamThirdMaintenanceOrderDetail>(pageNo, pageSize);
-		IPage<EamThirdMaintenanceOrderDetail> pageList = eamThirdMaintenanceOrderDetailService.page(page, queryWrapper);
-		return Result.OK(pageList);
-	}
-	
-	/**
-	 * 娣诲姞
-	 *
-	 * @param eamThirdMaintenanceOrderDetail
-	 * @return
-	 */
-	@AutoLog(value = "璁惧涓夌骇淇濆吇鏄庣粏-娣诲姞")
-	@ApiOperation(value="璁惧涓夌骇淇濆吇鏄庣粏-娣诲姞", notes="璁惧涓夌骇淇濆吇鏄庣粏-娣诲姞")
-	@PostMapping(value = "/add")
-	public Result<?> add(@RequestBody EamThirdMaintenanceOrderDetail eamThirdMaintenanceOrderDetail) {
-		eamThirdMaintenanceOrderDetailService.save(eamThirdMaintenanceOrderDetail);
-		return Result.OK("娣诲姞鎴愬姛锛�");
-	}
-	
-	/**
-	 * 缂栬緫
-	 *
-	 * @param eamThirdMaintenanceOrderDetail
-	 * @return
-	 */
-	@AutoLog(value = "璁惧涓夌骇淇濆吇鏄庣粏-缂栬緫")
-	@ApiOperation(value="璁惧涓夌骇淇濆吇鏄庣粏-缂栬緫", notes="璁惧涓夌骇淇濆吇鏄庣粏-缂栬緫")
-	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
-	public Result<?> edit(@RequestBody EamThirdMaintenanceOrderDetail eamThirdMaintenanceOrderDetail) {
-		eamThirdMaintenanceOrderDetailService.updateById(eamThirdMaintenanceOrderDetail);
-		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) {
-		eamThirdMaintenanceOrderDetailService.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.eamThirdMaintenanceOrderDetailService.removeByIds(Arrays.asList(ids.split(",")));
-		return Result.OK("鎵归噺鍒犻櫎鎴愬姛锛�");
-	}
-	
-	/**
-	 * 閫氳繃id鏌ヨ
-	 *
-	 * @param id
-	 * @return
-	 */
-	@AutoLog(value = "璁惧涓夌骇淇濆吇鏄庣粏-閫氳繃id鏌ヨ")
-	@ApiOperation(value="璁惧涓夌骇淇濆吇鏄庣粏-閫氳繃id鏌ヨ", notes="璁惧涓夌骇淇濆吇鏄庣粏-閫氳繃id鏌ヨ")
-	@GetMapping(value = "/queryById")
-	public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
-		EamThirdMaintenanceOrderDetail eamThirdMaintenanceOrderDetail = eamThirdMaintenanceOrderDetailService.getById(id);
-		return Result.OK(eamThirdMaintenanceOrderDetail);
-	}
+    @Autowired
+    private IEamThirdMaintenanceOrderDetailService eamThirdMaintenanceOrderDetailService;
 
-  /**
-   * 瀵煎嚭excel
-   *
-   * @param request
-   * @param eamThirdMaintenanceOrderDetail
-   */
-  @RequestMapping(value = "/exportXls")
-  public ModelAndView exportXls(HttpServletRequest request, EamThirdMaintenanceOrderDetail eamThirdMaintenanceOrderDetail) {
-      return super.exportXls(request, eamThirdMaintenanceOrderDetail, EamThirdMaintenanceOrderDetail.class, "璁惧涓夌骇淇濆吇鏄庣粏");
-  }
+    /**
+     * 鍒嗛〉鍒楄〃鏌ヨ
+     *
+     * @param orderId
+     * @param pageNo
+     * @param pageSize
+     * @return
+     */
+    @ApiOperation(value = "鍛ㄤ繚宸ュ崟鏄庣粏-鍒嗛〉鍒楄〃鏌ヨ", notes = "鍛ㄤ繚宸ュ崟鏄庣粏-鍒嗛〉鍒楄〃鏌ヨ")
+    @GetMapping(value = "/list")
+    public Result<?> queryPageList(@RequestParam("orderId") String orderId,
+                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
+        LambdaQueryWrapper<EamThirdMaintenanceOrderDetail> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(EamThirdMaintenanceOrderDetail::getOrderId, orderId);
+        queryWrapper.orderByAsc(EamThirdMaintenanceOrderDetail::getItemCode);
+        Page<EamThirdMaintenanceOrderDetail> page = new Page<>(pageNo, pageSize);
+        IPage<EamThirdMaintenanceOrderDetail> pageList = eamThirdMaintenanceOrderDetailService.page(page, queryWrapper);
+        return Result.OK(pageList);
+    }
 
-  /**
-   * 閫氳繃excel瀵煎叆鏁版嵁
-   *
-   * @param request
-   * @param response
-   * @return
-   */
-  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
-  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
-      return super.importExcel(request, response, EamThirdMaintenanceOrderDetail.class);
-  }
+    /**
+     * 涓�娆″姞杞�
+     *
+     * @param orderId
+     * @return
+     */
+    @ApiOperation(value = "鍛ㄤ繚宸ュ崟鏄庣粏-涓嶅垎椤靛垪琛ㄦ煡璇�", notes = "鍛ㄤ繚宸ュ崟鏄庣粏-涓嶅垎椤靛垪琛ㄦ煡璇�")
+    @GetMapping(value = "/queryList")
+    public Result<?> queryList(@RequestParam("orderId") String orderId) {
+        LambdaQueryWrapper<EamThirdMaintenanceOrderDetail> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(EamThirdMaintenanceOrderDetail::getOrderId, orderId);
+        queryWrapper.orderByAsc(EamThirdMaintenanceOrderDetail::getItemCode);
+        List<EamThirdMaintenanceOrderDetail> list = eamThirdMaintenanceOrderDetailService.list(queryWrapper);
+        return Result.OK(list);
+    }
 
+    /**
+     * 鎶ヨ〃浣跨敤 qsw
+     * 2025-6-19
+     */
+    @GetMapping("/findExceptionDescriptionAll")
+    public JSONObject findInspectionUser(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                         @RequestParam(name = "pageSize", defaultValue = "1000") Integer pageSize,
+                                         @RequestParam Map<String, Object> params) {
+
+        String orderId = (String)params.get("id");
+
+        List<EamThirdMaintenanceOrderDetail> details = new ArrayList<>();
+        List<EamThirdMaintenanceOrderDetail> list = eamThirdMaintenanceOrderDetailService.lambdaQuery()
+                .eq(EamThirdMaintenanceOrderDetail::getOrderId, orderId)
+                .eq(EamThirdMaintenanceOrderDetail::getMaintenanceResult, "2")
+                .list();
+        EamThirdMaintenanceOrderDetail detail = new EamThirdMaintenanceOrderDetail();
+
+        StringBuilder sb = new StringBuilder();
+        int index = 1;
+        for (EamThirdMaintenanceOrderDetail item : list) {
+            String value = item.getExceptionDescription();
+            if (value != null && !value.isEmpty()) { // 璺宠繃null鍜岀┖瀛楃涓�
+                sb.append(index).append(". ").append(value).append(System.lineSeparator());
+                index++;
+            }
+        }
+        // 绉婚櫎鏈�鍚庝竴涓浣欑殑鎹㈣绗︼紙鍙�夛級
+        if (sb.length() > 0) {
+            sb.setLength(sb.length() - System.lineSeparator().length());
+        }
+
+        String s = sb.toString();
+        detail.setExceptionDescription(s);
+        details.add(detail);
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("data",details);
+        return jsonObject;
+    }
 }

--
Gitblit v1.9.3