| | |
| | | @RequestParam(name = "pageSize", defaultValue = "1000") Integer pageSize, |
| | | @RequestParam Map<String, Object> params) { |
| | | |
| | | // HashMap<String, Object> mapEquipment = new HashMap<>(); |
| | | // HashMap<String, Object> mapStandard = new HashMap<>(); |
| | | HashMap<String, Object> mapResult = new HashMap<>(); |
| | | |
| | | String equipmentNum = (String)params.get("num"); |
| | | String dataTime = (String)params.get("dataTime"); |
| | | Equipment equipment = equipmentService.getOne(new LambdaQueryWrapper<Equipment>().eq(Equipment::getNum, equipmentNum).eq(Equipment::getDelFlag, 0)); |
| | | |
| | | |
| | | String num = (String)params.get("num"); |
| | | Equipment equipment = equipmentService.getOne(new LambdaQueryWrapper<Equipment>().eq(Equipment::getNum, num).eq(Equipment::getDelFlag, 0)); |
| | | |
| | | // mapEquipment.put("num",equipment.getNum()); |
| | | |
| | | |
| | | List<Map<String, Object>> list1 = this.getInspectionStandars(num); |
| | | List<Map<String, Object>> list2 = this.getUserQianzi(num); |
| | | 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>> list4 = this.getInspectionStandars(equipmentNum, "week",dataTime); |
| | | List<Map<String, Object>> list5 = this.getUserQianzi(equipmentNum,"week"); |
| | | List<Map<String, Object>> list6 = this.getCheckUserQianzi(equipmentNum,"week"); |
| | | |
| | | mapResult.put("equipentNum",equipment.getNum()); |
| | | mapResult.put("equipentName",equipment.getName()); |
| | | mapResult.put("list1",list1); |
| | | mapResult.put("list2",list2); |
| | | mapResult.put("list3",list3); |
| | | mapResult.put("list4",list4); |
| | | mapResult.put("list5",list5); |
| | | mapResult.put("list6",list6); |
| | | |
| | | return Result.ok(mapResult); |
| | | } |
| | | |
| | | List<Map<String, Object>> getInspectionStandars(String num){ |
| | | List<Map<String, Object>> getInspectionStandars(String equipmentNum,String cycleUnit,String dataTime){ |
| | | List<Map<String, Object>> maps = new ArrayList<>(); |
| | | List<Map<String, Object>> dayInspectionStandard = inspectionOrderService.findDayInspectionStandard(num); |
| | | List<Map<String, Object>> dayInspectionStandard = inspectionOrderService.findDayInspectionStandard(equipmentNum,cycleUnit); |
| | | for (Map<String, Object> map : dayInspectionStandard) { |
| | | String name = (String)map.get("name"); |
| | | String detectionStandard = (String)map.get("detectionStandard"); |
| | | List<Map<String, Object>> record = inspectionOrderService.findDayInspectionStandardProject(name, detectionStandard); |
| | | List<Map<String, Object>> record = inspectionOrderService.findDayInspectionStandardProject(equipmentNum,name, detectionStandard,dataTime); |
| | | |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | |
| | | for (Map<String, Object> r : record) { |
| | | if(maps.size()>0){ |
| | | Boolean flag = false; |
| | | 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")); |
| | | // map1.put(r.get("dayTime").toString(),r.get("insResult")); |
| | | HashMap<String, Object> hashMap1 = new HashMap<>(); |
| | | hashMap1.put(r.get("dayTime").toString(),r.get("insResult")); |
| | | list.add(hashMap1); |
| | | flag = true; |
| | | } |
| | | } |
| | |
| | | HashMap<String, Object> hashMap = new HashMap<>(); |
| | | hashMap.put("name",r.get("name")); |
| | | hashMap.put("detectionStandard",r.get("detectionStandard")); |
| | | hashMap.put(r.get("dayTime").toString(),r.get("insResult")); |
| | | |
| | | // hashMap.put(r.get("dayTime").toString(),r.get("insResult")); |
| | | HashMap<String, Object> hashMap1 = new HashMap<>(); |
| | | hashMap1.put(r.get("dayTime").toString(),r.get("insResult")); |
| | | list.add(hashMap1); |
| | | maps.add(hashMap); |
| | | } |
| | | }else{ |
| | | HashMap<String, Object> hashMap = new HashMap<>(); |
| | | hashMap.put("name",r.get("name")); |
| | | hashMap.put("detectionStandard",r.get("detectionStandard")); |
| | | hashMap.put(r.get("dayTime").toString(),r.get("insResult")); |
| | | maps.add(hashMap); |
| | | // hashMap.put(r.get("dayTime").toString(),r.get("insResult")); |
| | | |
| | | HashMap<String, Object> hashMap1 = new HashMap<>(); |
| | | hashMap1.put(r.get("dayTime").toString(),r.get("insResult")); |
| | | list.add(hashMap1); |
| | | hashMap.put("dataList",list); |
| | | |
| | | maps.add(hashMap); |
| | | } |
| | | } |
| | | } |
| | | return maps; |
| | | } |
| | | List<Map<String, Object>> getUserQianzi(String num){ |
| | | |
| | | List<Map<String, Object>> getUserQianzi(String num,String cycleUnit){ |
| | | List<Map<String, Object>> maps2 = new ArrayList<>(); |
| | | List<Map<String, Object>> userQianZi = inspectionOrderService.getUserQianZi(num); |
| | | 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("维护责任人")){ |
| | | if(map1.containsValue("维护责任人签字")){ |
| | | map1.put(map.get("dayTime").toString(),map.get("inspectionUserName")); |
| | | flag = true; |
| | | } |
| | | } |
| | | if(flag == false){ |
| | | HashMap<String, Object> hashMap = new HashMap<>(); |
| | | hashMap.put("inspectionUserName","维护责任人"); |
| | | hashMap.put("inspectionUserName","维护责任人签字"); |
| | | hashMap.put(map.get("dayTime").toString(),map.get("inspectionUserName")); |
| | | maps2.add(hashMap); |
| | | } |
| | | }else{ |
| | | HashMap<String, Object> hashMap = new HashMap<>(); |
| | | hashMap.put("inspectionUserName","维护责任人"); |
| | | hashMap.put("inspectionUserName","维护责任人签字"); |
| | | hashMap.put(map.get("dayTime").toString(),map.get("inspectionUserName")); |
| | | maps2.add(hashMap); |
| | | } |
| | |
| | | return maps2; |
| | | } |
| | | |
| | | List<Map<String, Object>> getCheckUserQianzi(String num,String cycleUnit){ |
| | | List<Map<String, Object>> maps3 = 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")); |
| | | 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); |
| | | } |
| | | }else{ |
| | | HashMap<String, Object> hashMap = new HashMap<>(); |
| | | hashMap.put("repairConfirmPerson","检查责任人签字"); |
| | | hashMap.put(map.get("dayTime").toString(),map.get("repairConfirmPerson")); |
| | | maps3.add(hashMap); |
| | | } |
| | | } |
| | | return maps3; |
| | | } |
| | | } |