From ed48aa9f30a87c528f071d06bf6b59d7d15428e9 Mon Sep 17 00:00:00 2001
From: qushaowei <qushaowei@163.com>
Date: 星期一, 26 五月 2025 16:12:55 +0800
Subject: [PATCH] 点检报表后端

---
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/InspectionOrderController.java |   91 +++++++++++++++++++++++++++++++++------------
 1 files changed, 66 insertions(+), 25 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 f66c7e9..02cbbb6 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
@@ -712,11 +712,11 @@
 		 Equipment equipment = equipmentService.getOne(new LambdaQueryWrapper<Equipment>().eq(Equipment::getNum, equipmentNum).eq(Equipment::getDelFlag, 0));
 
 		 List<Map<String, Object>> list1 = this.getInspectionStandars(equipmentNum,"day",dataTime);
-		 List<Map<String, Object>> list2 = this.getUserQianzi(equipmentNum,"day");
-		 List<Map<String, Object>> list3 = this.getCheckUserQianzi(equipmentNum,"day");
+		 List<Map<String, Object>> list2 = this.getUserQianzi(equipmentNum,"day",dataTime);
+		 List<Map<String, Object>> list3 = this.getCheckUserQianzi(equipmentNum,"day",dataTime);
 		 List<Map<String, Object>> list4 = this.getInspectionStandars(equipmentNum, "week",dataTime);
-		 List<Map<String, Object>> list5 = this.getUserQianzi(equipmentNum,"week");
-		 List<Map<String, Object>> list6 = this.getCheckUserQianzi(equipmentNum,"week");
+		 List<Map<String, Object>> list5 = this.getUserQianzi(equipmentNum,"week",dataTime);
+		 List<Map<String, Object>> list6 = this.getCheckUserQianzi(equipmentNum,"week",dataTime);
 
 		 mapResult.put("equipentNum",equipment.getNum());
 		 mapResult.put("equipentName",equipment.getName());
@@ -738,7 +738,7 @@
 			 String detectionStandard = (String)map.get("detectionStandard");
 			 List<Map<String, Object>> record = inspectionOrderService.findDayInspectionStandardProject(equipmentNum,name, detectionStandard,dataTime);
 
-			 List<InspectionResultVo> list = new ArrayList<>();
+			 List<InspectionResultVo> listS = new ArrayList<>();
 
 			 for (Map<String, Object> r : record) {
 				 if(maps.size()>0){
@@ -746,11 +746,14 @@
 					 for (Map<String, Object> map1 : maps) {
 						 if(map1.containsValue(r.get("name")) && map1.containsValue(r.get("detectionStandard"))){
 //							 map1.put(r.get("dayTime").toString(),r.get("insResult"));
+							 flag = true;
 							 InspectionResultVo inspectionResultVo = new InspectionResultVo();
 							 inspectionResultVo.setDayTime((String)r.get("dayTime"));
-							 inspectionResultVo.setInsResult((String)r.get("detectionStandard"));
-							 list.add(inspectionResultVo);
-							 flag = true;
+							 inspectionResultVo.setInsResult((String)r.get("insResult"));
+							 listS.add(inspectionResultVo);
+
+							 map1.put("dataList",listS);
+
 						 }
 					 }
 					 if(flag == false){
@@ -761,8 +764,8 @@
 //						 hashMap.put(r.get("dayTime").toString(),r.get("insResult"));
 						 InspectionResultVo inspectionResultVo = new InspectionResultVo();
 						 inspectionResultVo.setDayTime((String)r.get("dayTime"));
-						 inspectionResultVo.setInsResult((String)r.get("detectionStandard"));
-						 list.add(inspectionResultVo);
+						 inspectionResultVo.setInsResult((String)r.get("insResult"));
+						 listS.add(inspectionResultVo);
 						 maps.add(hashMap);
 					 }
 				 }else{
@@ -773,9 +776,9 @@
 
 					 InspectionResultVo inspectionResultVo = new InspectionResultVo();
 					 inspectionResultVo.setDayTime((String)r.get("dayTime"));
-					 inspectionResultVo.setInsResult((String)r.get("detectionStandard"));
-					 list.add(inspectionResultVo);
-					 hashMap.put("dataList",list);
+					 inspectionResultVo.setInsResult((String)r.get("insResult"));
+					 listS.add(inspectionResultVo);
+					 hashMap.put("dataList",listS);
 
 					 maps.add(hashMap);
 				 }
@@ -784,56 +787,94 @@
 		 return maps;
 	 }
 
-	List<Map<String, Object>> getUserQianzi(String num,String cycleUnit){
+	List<Map<String, Object>> getUserQianzi(String equipmentNum,String cycleUnit,String dataTime){
 		List<Map<String, Object>> maps2 = new ArrayList<>();
-		List<Map<String, Object>> userQianZi = inspectionOrderService.getUserQianZi(num,cycleUnit);
+		List<InspectionResultVo> listIn = new ArrayList<>();
+		List<Map<String, Object>> userQianZi = inspectionOrderService.getUserQianZi(equipmentNum,cycleUnit,dataTime);
 		for (Map<String, Object> map : userQianZi) {
 			if(maps2.size()>0){
 				Boolean flag = false;
 				for (Map<String, Object> map1 : maps2) {
 					if(map1.containsValue("缁存姢璐d换浜虹瀛�")){
-						map1.put(map.get("dayTime").toString(),map.get("inspectionUserName"));
+//						map1.put(map.get("dayTime").toString(),map.get("inspectionUserName"));
 						flag = true;
+						InspectionResultVo inspectionResultVo = new InspectionResultVo();
+						inspectionResultVo.setDayTime((String)map.get("dayTime"));
+						inspectionResultVo.setInspectionUserName((String)map.get("inspectionUserName"));
+						listIn.add(inspectionResultVo);
+
+						map1.put("dataList",listIn);
 					}
 				}
 				if(flag == false){
 					HashMap<String, Object> hashMap = new HashMap<>();
 					hashMap.put("inspectionUserName","缁存姢璐d换浜虹瀛�");
-					hashMap.put(map.get("dayTime").toString(),map.get("inspectionUserName"));
-					maps2.add(hashMap);
+//					hashMap.put(map.get("dayTime").toString(),map.get("inspectionUserName"));
+//					maps2.add(hashMap);
+					InspectionResultVo inspectionResultVo = new InspectionResultVo();
+					inspectionResultVo.setDayTime((String)map.get("dayTime"));
+					inspectionResultVo.setInspectionUserName((String)map.get("inspectionUserName"));
+					listIn.add(inspectionResultVo);
+					hashMap.put("dataList",listIn);
 				}
 			}else{
 				HashMap<String, Object> hashMap = new HashMap<>();
 				hashMap.put("inspectionUserName","缁存姢璐d换浜虹瀛�");
-				hashMap.put(map.get("dayTime").toString(),map.get("inspectionUserName"));
+//				hashMap.put(map.get("dayTime").toString(),map.get("inspectionUserName"));
+//				maps2.add(hashMap);
+				InspectionResultVo inspectionResultVo = new InspectionResultVo();
+				inspectionResultVo.setDayTime((String)map.get("dayTime"));
+				inspectionResultVo.setInspectionUserName((String)map.get("inspectionUserName"));
+				listIn.add(inspectionResultVo);
+				hashMap.put("dataList",listIn);
+
 				maps2.add(hashMap);
 			}
 		}
 		return maps2;
 	}
 
-	 List<Map<String, Object>> getCheckUserQianzi(String num,String cycleUnit){
+	 List<Map<String, Object>> getCheckUserQianzi(String num,String cycleUnit,String dataTime){
 		 List<Map<String, Object>> maps3 = new ArrayList<>();
-		 List<Map<String, Object>> checkUserQianZi = inspectionOrderService.getUserQianZi(num,cycleUnit);
+		 List<InspectionResultVo> listRe = new ArrayList<>();
+		 List<Map<String, Object>> checkUserQianZi = inspectionOrderService.getUserQianZi(num,cycleUnit,dataTime);
 		 for (Map<String, Object> map : checkUserQianZi) {
 			 if(maps3.size()>0){
 				 Boolean flag = false;
 				 for (Map<String, Object> map1 : maps3) {
 					 if(map1.containsValue("妫�鏌ヨ矗浠讳汉绛惧瓧")){
-						 map1.put(map.get("dayTime").toString(),map.get("repairConfirmPerson"));
+//						 map1.put(map.get("dayTime").toString(),map.get("repairConfirmPerson"));
+						 InspectionResultVo inspectionResultVo = new InspectionResultVo();
+						 inspectionResultVo.setDayTime((String)map.get("dayTime"));
+						 inspectionResultVo.setRepairConfirmPerson((String)map.get("repairConfirmPerson"));
+						 listRe.add(inspectionResultVo);
+
+						 map1.put("dataList",listRe);
 						 flag = true;
 					 }
 				 }
 				 if(flag == false){
 					 HashMap<String, Object> hashMap = new HashMap<>();
 					 hashMap.put("repairConfirmPerson","妫�鏌ヨ矗浠讳汉绛惧瓧");
-					 hashMap.put(map.get("dayTime").toString(),map.get("repairConfirmPerson"));
-					 maps3.add(hashMap);
+//					 hashMap.put(map.get("dayTime").toString(),map.get("repairConfirmPerson"));
+//					 maps3.add(hashMap);
+					 InspectionResultVo inspectionResultVo = new InspectionResultVo();
+					 inspectionResultVo.setDayTime((String)map.get("dayTime"));
+					 inspectionResultVo.setRepairConfirmPerson((String)map.get("repairConfirmPerson"));
+					 listRe.add(inspectionResultVo);
+					 hashMap.put("dataList",listRe);
 				 }
 			 }else{
 				 HashMap<String, Object> hashMap = new HashMap<>();
 				 hashMap.put("repairConfirmPerson","妫�鏌ヨ矗浠讳汉绛惧瓧");
-				 hashMap.put(map.get("dayTime").toString(),map.get("repairConfirmPerson"));
+//				 hashMap.put(map.get("dayTime").toString(),map.get("repairConfirmPerson"));
+//				 maps3.add(hashMap);
+				 InspectionResultVo inspectionResultVo = new InspectionResultVo();
+				 inspectionResultVo.setDayTime((String)map.get("dayTime"));
+				 inspectionResultVo.setRepairConfirmPerson((String)map.get("repairConfirmPerson"));
+				 listRe.add(inspectionResultVo);
+				 hashMap.put("dataList",listRe);
+
 				 maps3.add(hashMap);
 			 }
 		 }

--
Gitblit v1.9.3