qushaowei
2025-05-26 ea42a1e743bf24bbc1648f7ea82ad1812e156eb4
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/MaintenanceStandardController.java
@@ -201,6 +201,9 @@
        Equipment equipment = equipmentService.getById(maintenanceStandard.getEquipmentId());
        List<MaintenanceCycleVo> maintenanceCycle = maintenanceStandardService.getPeriodicMaintenanceCycle(equipment.getEquipmentImportanceId(), maintenanceStandard.getMaintenanceType());
        if(maintenanceCycle.size()==0){
            return Result.OK("没有找到的保养周期,请先维护保养周期!");
        }
        List<MaintenanceStandardDetail> maintenanceStandardDetaillist = maintenanceStandard.getMaintenanceStandardDetaillist();
        for (MaintenanceStandardDetail maintenanceStandardDetail : maintenanceStandardDetaillist) {
            if(maintenanceCycle.size() > 0){
@@ -240,6 +243,9 @@
        //2.重新持久保养项目
        Equipment equipment = equipmentService.getById(maintenanceStandard.getEquipmentId());
        List<MaintenanceCycleVo> maintenanceCycle = maintenanceStandardService.getPeriodicMaintenanceCycle(equipment.getEquipmentImportanceId(), maintenanceStandard.getMaintenanceType());
        if(maintenanceCycle.size()==0){
            return Result.OK("没有找到的保养周期,请先维护保养周期!");
        }
        List<MaintenanceStandardDetail> maintenanceStandardDetails = maintenanceStandard.getMaintenanceStandardDetaillist();
        for (MaintenanceStandardDetail maintenanceStandardDetail : maintenanceStandardDetails) {
            if(maintenanceCycle.size() > 0){
@@ -336,6 +342,7 @@
        LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal();
        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
        String exceptionInfo = "";
        String msgInfo = "";
        int exceptionNum = 0;
        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
            MultipartFile file = entity.getValue();
@@ -375,10 +382,12 @@
                                            maintenanceStandardService.save(maintenanceStandard);
                                        }
                                        else {
                                            msgInfo += equipment.getNum()+ ",";
                                            continue;
                                        }
                                    }
                                    else {
                                        continue;
                                    }
                                }
@@ -475,6 +484,7 @@
                                            maintenanceStandardService.save(maintenanceStandard);
                                        }
                                        else {
                                            msgInfo += equipment.getNum()+ ",";
                                            continue;
                                        }
                                    }
@@ -527,7 +537,11 @@
                            }
                        }
                    }
                    return Result.OK("导入成功");
                    if(msgInfo == ""){
                        return Result.OK("导入成功");
                    }else{
                        return Result.OK("统一编码是:"+msgInfo+"的保养标准已存在,请先手动失效再重新导入!");
                    }
                } else {
                    System.out.println("无法解析该文件");
                }