| | |
| | | //import org.jeecg.modules.system.entity.SysUploadRela; |
| | | //import org.jeecg.modules.system.service.IUploadRelaService; |
| | | //import org.jeecg.modules.system.service.IUploadService; |
| | | import org.jeecg.modules.eam.vo.InspectionResultVo; |
| | | import org.jeecg.modules.eam.vo.SysFileNameVo; |
| | | import org.jeecgframework.poi.excel.ExcelImportUtil; |
| | | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
| | |
| | | @Lazy |
| | | private IDailyInspectionStandardService dailyInspectionStandardService; |
| | | |
| | | @Autowired |
| | | @Lazy |
| | | private IAreaService areaService; |
| | | |
| | | // @Autowired |
| | | // private IUploadRelaService uploadRelaService; |
| | | // |
| | |
| | | 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 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); |
| | |
| | | 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)); |
| | | if(equipment == null){ |
| | | return Result.error("设备统一编号不存在!"); |
| | | } |
| | | String workCenterId = equipment.getWorkCenterId(); |
| | | Area area = areaService.getById(workCenterId); |
| | | |
| | | // DailyInspectionStandard standard = dailyInspectionStandardService.getOne(new LambdaQueryWrapper<DailyInspectionStandard>() |
| | | // .eq(DailyInspectionStandard::getEquipmentId, equipment.getId()) |
| | | // .eq(DailyInspectionStandard::getDelFlag, 0) |
| | | // .eq(DailyInspectionStandard::getVersionStatus, "2")); |
| | | List<DailyInspectionStandard> list = dailyInspectionStandardService.lambdaQuery().eq(DailyInspectionStandard::getEquipmentId, equipment.getId()) |
| | | .eq(DailyInspectionStandard::getDelFlag, 0) |
| | | .eq(DailyInspectionStandard::getVersionStatus, "2").list(); |
| | | |
| | | |
| | | 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()); |
| | | mapResult.put("equipmentModel",equipment.getModel()); |
| | | mapResult.put("equipmentModel",equipment.getModel()); |
| | | if(area != null){ |
| | | mapResult.put("workCenterName",area.getName()); |
| | | } |
| | | if(list.size() > 0){ |
| | | mapResult.put("regulations",list.get(0).getDisUda1()); |
| | | }else{ |
| | | mapResult.put("regulations","-"); |
| | | } |
| | | mapResult.put("list1",list1); |
| | | mapResult.put("list2",list2); |
| | | mapResult.put("list3",list3); |
| | |
| | | String name = (String)map.get("name"); |
| | | String detectionStandard = (String)map.get("detectionStandard"); |
| | | List<Map<String, Object>> record = inspectionOrderService.findDayInspectionStandardProject(equipmentNum,name, detectionStandard,dataTime); |
| | | |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | |
| | | List<InspectionResultVo> listS = 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")); |
| | | HashMap<String, Object> hashMap1 = new HashMap<>(); |
| | | hashMap1.put(r.get("dayTime").toString(),r.get("insResult")); |
| | | list.add(hashMap1); |
| | | map1.put(r.get("dayTime").toString(),r.get("insResult")); |
| | | flag = true; |
| | | InspectionResultVo inspectionResultVo = new InspectionResultVo(); |
| | | inspectionResultVo.setDayTime((String)r.get("dayTime")); |
| | | inspectionResultVo.setWeekOfMonth((Integer)r.get("weekOfMonth")); |
| | | inspectionResultVo.setInsResult((String)r.get("insResult")); |
| | | listS.add(inspectionResultVo); |
| | | |
| | | map1.put("dataList",listS); |
| | | |
| | | } |
| | | } |
| | | if(flag == false){ |
| | |
| | | hashMap.put("detectionStandard",r.get("detectionStandard")); |
| | | |
| | | // 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); |
| | | InspectionResultVo inspectionResultVo = new InspectionResultVo(); |
| | | inspectionResultVo.setDayTime((String)r.get("dayTime")); |
| | | inspectionResultVo.setWeekOfMonth((Integer)r.get("weekOfMonth")); |
| | | inspectionResultVo.setInsResult((String)r.get("insResult")); |
| | | listS.add(inspectionResultVo); |
| | | |
| | | hashMap.put("dataList",listS);//---- |
| | | maps.add(hashMap); |
| | | } |
| | | }else{ |
| | |
| | | hashMap.put("detectionStandard",r.get("detectionStandard")); |
| | | // 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); |
| | | InspectionResultVo inspectionResultVo = new InspectionResultVo(); |
| | | inspectionResultVo.setDayTime((String)r.get("dayTime")); |
| | | inspectionResultVo.setInsResult((String)r.get("insResult")); |
| | | inspectionResultVo.setWeekOfMonth((Integer)r.get("weekOfMonth")); |
| | | listS.add(inspectionResultVo); |
| | | hashMap.put("dataList",listS); |
| | | |
| | | maps.add(hashMap); |
| | | } |
| | |
| | | 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("维护责任人签字")){ |
| | | 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")); |
| | | inspectionResultVo.setWeekOfMonth((Integer)map.get("weekOfMonth")); |
| | | listIn.add(inspectionResultVo); |
| | | |
| | | map1.put("dataList",listIn); |
| | | } |
| | | } |
| | | if(flag == false){ |
| | | HashMap<String, Object> hashMap = new HashMap<>(); |
| | | hashMap.put("inspectionUserName","维护责任人签字"); |
| | | 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")); |
| | | inspectionResultVo.setWeekOfMonth((Integer)map.get("weekOfMonth")); |
| | | listIn.add(inspectionResultVo); |
| | | hashMap.put("dataList",listIn);//--- |
| | | hashMap.put("dataList",listIn); |
| | | } |
| | | }else{ |
| | | HashMap<String, Object> hashMap = new HashMap<>(); |
| | | hashMap.put("inspectionUserName","维护责任人签字"); |
| | | 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")); |
| | | inspectionResultVo.setWeekOfMonth((Integer)map.get("weekOfMonth")); |
| | | 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")); |
| | | inspectionResultVo.setWeekOfMonth((Integer)map.get("weekOfMonth")); |
| | | 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")); |
| | | inspectionResultVo.setWeekOfMonth((Integer)map.get("weekOfMonth")); |
| | | listRe.add(inspectionResultVo); |
| | | hashMap.put("dataList",listRe); |
| | | |
| | | maps3.add(hashMap);//--- |
| | | } |
| | | }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")); |
| | | inspectionResultVo.setWeekOfMonth((Integer)map.get("weekOfMonth")); |
| | | listRe.add(inspectionResultVo); |
| | | hashMap.put("dataList",listRe); |
| | | |
| | | maps3.add(hashMap); |
| | | } |
| | | } |