zhangherong
2025-03-07 9de1d40d3a61ce166c63a2c07d02d89bf8bdabd0
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/InspectionOrderController.java
@@ -198,11 +198,13 @@
         for (InspectionOrderDetail inspectionOrderDetail : inspectionOrderDetailList) {
            String id = inspectionOrder.getId();
            String inspectionStandardDetailId = inspectionOrderDetail.getInspectionStandardDetailId();
            //点检项目id
            String inspectionProjectId = inspectionOrderDetail.getInspectionProjectId();
            //点检标准
            DailyInspectionStandardDetail dailyInspectionStandardDetail = dailyInspectionStandardDetailService.getById(inspectionStandardDetailId);
            //点检项目
            InspectionProject inspectionProject = inspectionProjectService.getById(inspectionProjectId);
            //点检明细添加
            inspectionOrderDetail.setId("");
            inspectionOrderDetail.setInspectionOrderId(id);
            inspectionOrderDetail.setLocation(dailyInspectionStandardDetail.getLocation());
@@ -217,11 +219,18 @@
            inspectionOrderDetailService.save(inspectionOrderDetail);
         }
      }else{
         //生产线设备,按照生产线来进行点检
         String lineId = equipment.getLineId();
         if(StringUtils.isBlank(lineId)){
            return Result.error("生产线设备没有关联到产线编号");
         }
         List<DailyInspectionStandard> dailyInspectionStandards = dailyInspectionStandardService.lambdaQuery()
               .eq(DailyInspectionStandard::getEquipmentId, lineId)
               .eq(DailyInspectionStandard::getVersionStatus, "2")
               .eq(DailyInspectionStandard::getDelFlag, "0").list();
         if(CollectionUtils.isEmpty(dailyInspectionStandards)){
            return Result.error("设备对应的产线没有配置点检标准");
         }
         if(dailyInspectionStandards.size()>0) {
            DailyInspectionStandard dailyInspectionStandard = dailyInspectionStandards.get(0);
            //保存点检工单子表数据
@@ -610,11 +619,8 @@
                           @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) {
@@ -641,13 +647,49 @@
             hashMap.put(record.get("createTime").toString(),record.get("insResult"));
             maps.add(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);
    }