From a72062286b8212d490804826b71c18f67e8f0fd2 Mon Sep 17 00:00:00 2001 From: qushaowei <qushaowei@163.com> Date: 星期一, 26 五月 2025 15:31:29 +0800 Subject: [PATCH] 数据结构修改 --- lxzn-module-eam/src/main/java/org/jeecg/modules/eam/vo/InspectionResultVo.java | 2 + lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/InspectionOrderMapper.xml | 6 +- lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/InspectionOrderController.java | 75 +++++++++++++++++++++++++++++-------- 3 files changed, 63 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 f66c7e9..b343e06 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 @@ -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); } @@ -786,26 +789,45 @@ List<Map<String, Object>> getUserQianzi(String num,String cycleUnit){ List<Map<String, Object>> maps2 = new ArrayList<>(); + List<InspectionResultVo> listIn = new ArrayList<>(); List<Map<String, Object>> userQianZi = inspectionOrderService.getUserQianZi(num,cycleUnit); 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); } } @@ -814,26 +836,45 @@ List<Map<String, Object>> getCheckUserQianzi(String num,String cycleUnit){ List<Map<String, Object>> maps3 = new ArrayList<>(); + List<InspectionResultVo> listRe = new ArrayList<>(); List<Map<String, Object>> checkUserQianZi = inspectionOrderService.getUserQianZi(num,cycleUnit); 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); } } diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/InspectionOrderMapper.xml b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/InspectionOrderMapper.xml index 66b0ba0..9022659 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/InspectionOrderMapper.xml +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/InspectionOrderMapper.xml @@ -310,10 +310,10 @@ LEFT JOIN mom_eam_inspection_order t2 ON t1.inspection_order_id= t2.id left join mom_eam_inspection_project t3 on t1.inspection_project_id = t3.id LEFT JOIN mom_eam_equipment t4 ON t2.equipment_id = t4.id - WHERE + WHERE 1=1 <if test="equipmentNum != null and equipmentNum != ''"> - t4.num = #{equipmentNum} + and t4.num = #{equipmentNum} </if> <if test="equipmentNum == null and equipmentNum == ''"> and t4.num = '-1' </if> <if test="dataTime != null and dataTime != ''"> @@ -334,7 +334,7 @@ mom_eam_inspection_order t1 LEFT JOIN mom_eam_equipment t2 ON t1.equipment_id = t2.id LEFT JOIN mom_eam_inspection_cycle t3 ON t1.inspection_cycle_id = t3.id - WHERE + WHERE 1=1 and t2.num = '0526' and t3.cycle_unit = #{cycleUnit} </select> </mapper> \ No newline at end of file diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/vo/InspectionResultVo.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/vo/InspectionResultVo.java index 1588eb4..c31150a 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/vo/InspectionResultVo.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/vo/InspectionResultVo.java @@ -7,4 +7,6 @@ private String dayTime; private String insResult; + private String inspectionUserName; + private String repairConfirmPerson; } -- Gitblit v1.9.3