From 63a5530a85e6eaf7f8be733e87d32af2d16477a8 Mon Sep 17 00:00:00 2001
From: qushaowei <qushaowei@163.com>
Date: 星期日, 07 四月 2024 13:39:02 +0800
Subject: [PATCH] 设备管理 报表打印修改

---
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/InspectionOrderController.java |  126 +++++++++++++++++++++++++++++++++++------
 1 files changed, 106 insertions(+), 20 deletions(-)

diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/InspectionOrderController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/InspectionOrderController.java
index 15fe908..51bfc63 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/InspectionOrderController.java
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/InspectionOrderController.java
@@ -132,32 +132,32 @@
 		 List<Map<String, Object>> records = inspectionOrderList.getRecords();
 		 for (Map<String, Object> record : records) {
 			 String id = (String)record.get("id");
-			 String equipmentId = (String)record.get("equipmentId");
-			 String status = (String)record.get("status");
-			 String inspectionStandardId = (String)record.get("inspectionStandardId");
-			 List<InspectionCycleVo> inspectionCycles = inspectionOrderService.getInspectionCycleByEqId(inspectionStandardId);
-			 record.put("inspectionCycles",inspectionCycles);
+//			 String equipmentId = (String)record.get("equipmentId");
+//			 String status = (String)record.get("status");
+//			 String inspectionStandardId = (String)record.get("inspectionStandardId");
+//			 List<InspectionCycleVo> inspectionCycles = inspectionOrderService.getInspectionCycleByEqId(inspectionStandardId);
+//			 record.put("inspectionCycles",inspectionCycles);
 
 			 List<Map<String, Object>> inspectionOrderDetails = inspectionOrderService.getInspectionOrderDetailByOrderId(id);
 			 record.put("inspectionOrderDetails",inspectionOrderDetails);
 
 
-			 List<InspectionOrderDetail> failCount = inspectionOrderDetailService.lambdaQuery()
-					 .eq(InspectionOrderDetail::getInspectionOrderId, id)
-					 .eq(InspectionOrderDetail::getJudgmentResult, "fail")
-					 .eq(InspectionOrderDetail::getDelFlag, 0).list();
+//			 List<InspectionOrderDetail> failCount = inspectionOrderDetailService.lambdaQuery()
+//					 .eq(InspectionOrderDetail::getInspectionOrderId, id)
+//					 .eq(InspectionOrderDetail::getJudgmentResult, "fail")
+//					 .eq(InspectionOrderDetail::getDelFlag, 0).list();
+//
+//			 List<InspectionOrderDetail> passCount = inspectionOrderDetailService.lambdaQuery()
+//					 .eq(InspectionOrderDetail::getInspectionOrderId, id)
+//					 .eq(InspectionOrderDetail::getJudgmentResult,"pass")
+//					 .eq(InspectionOrderDetail::getDelFlag, 0).list();
+//			 record.put("result","姝e父:"+passCount.size()+"锛�"+"寮傚父:"+failCount.size());
 
-			 List<InspectionOrderDetail> passCount = inspectionOrderDetailService.lambdaQuery()
-					 .eq(InspectionOrderDetail::getInspectionOrderId, id)
-					 .eq(InspectionOrderDetail::getJudgmentResult,"pass")
-					 .eq(InspectionOrderDetail::getDelFlag, 0).list();
-			 record.put("result","姝e父:"+passCount.size()+"锛�"+"寮傚父:"+failCount.size());
-
-			 if("5".equals(status) ){
-				 record.put("distable",true);
-			 }else{
-				 record.put("distable",false);
-			 }
+//			 if("5".equals(status) ){
+//				 record.put("distable",true);
+//			 }else{
+//				 record.put("distable",false);
+//			 }
 		 }
 		 return Result.ok(inspectionOrderList);
 	 }
@@ -570,6 +570,7 @@
 			 }
 		 }
 		 inspectionOrder.setActualEndTime(new Date());
+		 inspectionOrder.setInspectionOrderUda2(sysUser.getRealname());
 		 boolean b = inspectionOrderService.updateById(inspectionOrder);
 		 if (!b) {
 			 return Result.error("鎶ュ伐澶辫触!");
@@ -598,4 +599,89 @@
 		 }
 	 }
 
+
+	 /**
+	  *鐢熶骇璁惧鑷富缁存姢鐐规琛� 鎶ヨ〃
+	  * 2024-3-27 qsw
+	  */
+	 @GetMapping("findInspectionProjectList")
+	 public Result<?> findInspectionProjectList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+												@RequestParam(name = "pageSize", defaultValue = "1000") Integer pageSize,
+								   @RequestParam Map<String, Object> params) {
+		 IPage<Map<String, Object>> dayInspectionProjectList = inspectionOrderService.findDayInspectionProjectList(pageNo, 1000, params);
+		 List<Map<String, Object>> records = dayInspectionProjectList.getRecords();
+		 List<Map<String, Object>> maps = new ArrayList<>();
+		 for (Map<String, Object> record : records) {
+			 if(maps.size()>0){
+				 Boolean flag = false;
+				 for (Map<String, Object> map : maps) {
+					 if(map.containsValue(record.get("name")) && map.containsValue(record.get("detectionStandard"))){
+						 map.put(record.get("createTime").toString(),record.get("insResult"));
+						 flag = true;
+					 }
+				 }
+				 if(flag == false){
+					 HashMap<String, Object> hashMap = new HashMap<>();
+					 hashMap.put("name",record.get("name"));
+					 hashMap.put("equipmentNum",record.get("equipmentNum"));
+					 hashMap.put("equipmentName",record.get("equipmentName"));
+					 hashMap.put("detectionStandard",record.get("detectionStandard"));
+					 hashMap.put(record.get("createTime").toString(),record.get("insResult"));
+					 maps.add(hashMap);
+				 }
+			 }else{
+				 HashMap<String, Object> hashMap = new HashMap<>();
+				 hashMap.put("name",record.get("name"));
+				 hashMap.put("equipmentNum",record.get("equipmentNum"));
+				 hashMap.put("equipmentName",record.get("equipmentName"));
+				 hashMap.put("detectionStandard",record.get("detectionStandard"));
+				 hashMap.put(record.get("createTime").toString(),record.get("insResult"));
+				 maps.add(hashMap);
+			 }
+		 }
+		 return Result.ok(maps);
+	 }
+
+	 /**
+	  *鐢熶骇璁惧鑷富缁存姢鍛ㄧ偣妫�琛� 鎶ヨ〃
+	  * 2024-3-27 qsw
+	  */
+	 @GetMapping("findWeekInspectionProjectList")
+	 public Result<?> findWeekInspectionProjectList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+												@RequestParam(name = "pageSize", defaultValue = "1000") Integer pageSize,
+												@RequestParam Map<String, Object> params) {
+		 IPage<Map<String, Object>> dayInspectionProjectList = inspectionOrderService.findWeekInspectionProjectList(pageNo, 1000, params);
+		 List<Map<String, Object>> records = dayInspectionProjectList.getRecords();
+		 List<Map<String, Object>> maps = new ArrayList<>();
+		 for (Map<String, Object> record : records) {
+			 if(maps.size()>0){
+				 Boolean flag = false;
+				 for (Map<String, Object> map : maps) {
+					 if(map.containsValue(record.get("name")) && map.containsValue(record.get("detectionStandard"))){
+						 map.put(record.get("createTime").toString(),record.get("insResult"));
+						 flag = true;
+					 }
+				 }
+				 if(flag == false){
+					 HashMap<String, Object> hashMap = new HashMap<>();
+					 hashMap.put("name",record.get("name"));
+					 hashMap.put("equipmentNum",record.get("equipmentNum"));
+					 hashMap.put("equipmentName",record.get("equipmentName"));
+					 hashMap.put("detectionStandard",record.get("detectionStandard"));
+					 hashMap.put(record.get("createTime").toString(),record.get("insResult"));
+					 maps.add(hashMap);
+				 }
+			 }else{
+				 HashMap<String, Object> hashMap = new HashMap<>();
+				 hashMap.put("name",record.get("name"));
+				 hashMap.put("equipmentNum",record.get("equipmentNum"));
+				 hashMap.put("equipmentName",record.get("equipmentName"));
+				 hashMap.put("detectionStandard",record.get("detectionStandard"));
+				 hashMap.put(record.get("createTime").toString(),record.get("insResult"));
+				 maps.add(hashMap);
+			 }
+		 }
+		 return Result.ok(maps);
+	 }
+
 }

--
Gitblit v1.9.3