|  |  | 
 |  |  |                     String nameValue = jsonArray.getJSONObject(i).get("name").toString(); | 
 |  |  |                     if (nameValue.contains(assess.getId().toString())) { | 
 |  |  |                         // 获取对应的值 | 
 |  |  |                         result1 = (Double)  jsonArray.getJSONObject(i).get("value"); | 
 |  |  |                         if (jsonArray.getJSONObject(i).get("value") instanceof Double){ | 
 |  |  |                             result1 = (Double)  jsonArray.getJSONObject(i).get("value"); | 
 |  |  |                         }else{ | 
 |  |  |                             String[] values = jsonArray.getJSONObject(i).get("value").toString().split(","); | 
 |  |  |                             result1 = Double.valueOf(values[1]); | 
 |  |  |                         } | 
 |  |  |                         break; // 如果找到就退出循环 | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  | 
 |  |  |             String NoEStr = ""; | 
 |  |  |             String ToEStr = ""; | 
 |  |  |             String FStr = ""; | 
 |  |  |             for (ModelNode node : nodeList) { | 
 |  |  | //            for (ModelNode node : nodeList) { | 
 |  |  |                 List<ReliabilityAssess> assessDatas = assessDataList.stream().filter(item -> | 
 |  |  |                         node.getDataId().equals(item.getId())).collect(Collectors.toList()); | 
 |  |  |                         dataId.equals(item.getId())).collect(Collectors.toList()); | 
 |  |  |                 NoEStr += ","; | 
 |  |  |                 ToEStr += ","; | 
 |  |  |                 FStr += ","; | 
 |  |  | 
 |  |  |                     ToEStr += assessDatas.get(0).getRunTimes() != null ? assessDatas.get(0).getRunTimes().toString() : "0"; | 
 |  |  |                     FStr += assessDatas.get(0).getFailNum() != null ? assessDatas.get(0).getFailNum().toString() : "0"; | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  | //            } | 
 |  |  |             NoEStr = NoEStr.substring(1); | 
 |  |  |             ToEStr = ToEStr.substring(1); | 
 |  |  |             FStr = FStr.substring(1); | 
 |  |  | 
 |  |  |             sameNameGroupTag.addAttribute("nums", String.valueOf(nodeList.size())); | 
 |  |  |             Element nodeTag = sameNameGroupTag.addElement("node"); | 
 |  |  |             nodeTag.addAttribute("name", | 
 |  |  |                     nodeList.stream().map(item -> item.getDataId().toString()).collect(Collectors.joining(","))); | 
 |  |  |                     nodeList.stream().map(item -> item.getDataId().toString()+"-"+item.getDeviceNo().toString()). | 
 |  |  |                             collect(Collectors.joining(","))); | 
 |  |  |             nodeTag.addAttribute("real_name", product.getSameSbName()); | 
 |  |  |             nodeTag.addAttribute("name_path", product.getNamePath()); | 
 |  |  |             if (paramData.getReliabDistribType() == 3) { | 
 |  |  | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 // 根据同类设备名称进行分组处理 | 
 |  |  |                 // 根据同类设备名称进行分组处理(改为根据dataId进行分组) | 
 |  |  |                 Map<String, List<ModelNode>> groupByNameMap = new HashMap<>(); | 
 |  |  |                 for (String nodeStr : computerNodeListStr) { | 
 |  |  |                     ModelNode mn = modelNodeAndVnodeList.stream().filter(item -> | 
 |  |  |                             nodeStr.equals(item.getId().toString())).collect(Collectors.toList()).get(0); | 
 |  |  |                     String sameSbName = null; | 
 |  |  |                     if (mn.getDataId() != null) { | 
 |  |  |                         XhProductModel product = productList.stream().filter(item -> | 
 |  |  |                                 mn.getDataId().equals(item.getId())).collect(Collectors.toList()).get(0); | 
 |  |  |                         if ("5".equals(product.getProductType())) sameSbName = product.getSameSbName(); | 
 |  |  | //                        XhProductModel product = productList.stream().filter(item -> | 
 |  |  | //                                mn.getDataId().equals(item.getId())).collect(Collectors.toList()).get(0); | 
 |  |  | //                        if ("5".equals(product.getProductType())) sameSbName = product.getSameSbName(); | 
 |  |  |                         sameSbName = mn.getDataId().toString(); | 
 |  |  |                     } | 
 |  |  |                     if (sameSbName == null) { | 
 |  |  |                         List<ModelNode> list = new ArrayList<>(); | 
 |  |  | 
 |  |  |                 NoEStr += "," + (assessData.getRunNum() != null ? assessData.getRunNum().toString() : "0"); | 
 |  |  |                 ToEStr += "," + (assessData.getRunTimes() != null ? assessData.getRunTimes().toString() : "0"); | 
 |  |  |                 FStr += "," + (assessData.getFailNum() != null ? assessData.getFailNum().toString() : "0"); | 
 |  |  |                 break; | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         NoEStr = NoEStr.substring(1); | 
 |  |  | 
 |  |  |         FStr = FStr.substring(1); | 
 |  |  |  | 
 |  |  |         nodeTag.addAttribute("name", | 
 |  |  |                 nodes.stream().map(item -> item.getDataId().toString()).collect(Collectors.joining(","))); | 
 |  |  |                 nodes.stream().map(item -> item.getDataId().toString()+"-"+item.getDeviceNo().toString()). | 
 |  |  |                         collect(Collectors.joining(","))); | 
 |  |  |         if (distTypes.get(0) == 3) { | 
 |  |  |             // 二项分布 | 
 |  |  |             nodeTag.addAttribute("distType", "ber"); | 
 |  |  | 
 |  |  |             try { | 
 |  |  |                 setParamToRedis(assessResult); | 
 |  |  |             } catch (Exception e) { | 
 |  |  |                 throw new RuntimeException("访问Redis失败。请检查Redis是否已启动。"); | 
 |  |  |                 throw new RenException("访问Redis失败。请检查Redis是否已启动。"); | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |             Process process = null; | 
 |  |  | 
 |  |  |             } else if (System.getProperty("os.name").toLowerCase().indexOf("linux") > -1) { | 
 |  |  |                 process = Runtime.getRuntime().exec(new String[]{"/bin/sh", "-c", command}); | 
 |  |  |             } else { | 
 |  |  |                 throw new Exception("暂不支持该操作系统,进行启动算法库计算!"); | 
 |  |  |                 throw new RenException("暂不支持该操作系统,进行启动算法库计算!"); | 
 |  |  |             } | 
 |  |  |             is = process.getInputStream(); | 
 |  |  |             // 以命令行方式调用算法库时,接口约定返回的结果是utf-8编码 | 
 |  |  | 
 |  |  |             if (line != null) { | 
 |  |  |                 ReliaSimLibResult rtn = com.alibaba.fastjson.JSONObject.parseObject(line, ReliaSimLibResult.class); | 
 |  |  |                 if ("0".equals(rtn.getCode())) { | 
 |  |  |                     logger.info("启动算法库成功。"); | 
 |  |  |                     result = Result.ok(); | 
 |  |  |                     logger.info("启动可靠性评定算法库成功。"); | 
 |  |  |                     if (exitCode ==0) { | 
 |  |  |                         deleteAssessInfoInRedis(assessResult.getId()); | 
 |  |  |                         result = Result.ok(); | 
 |  |  |                     } else { | 
 |  |  |                         result = Result.error("可靠性评定算法库计算失败: exitCode=" + exitCode); | 
 |  |  |                     } | 
 |  |  |                 } else { | 
 |  |  |                     String errorMsg = rtn.getErrorMsg(); | 
 |  |  |                     throw new RuntimeException("启动算法库失败: errorMsg=" + errorMsg); | 
 |  |  |                     throw new RenException("启动可靠性评定算法库失败: errorMsg=" + errorMsg); | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |             deleteAssessInfoInRedis(assessResult.getId()); | 
 |  |  |         } catch (Exception e) { | 
 |  |  |             logger.error("启动可靠性评定算法库时发生Exception:", e); | 
 |  |  |             e.printStackTrace(); | 
 |  |  |             result = Result.error(e.getMessage()); | 
 |  |  |             throw new RenException("启动可靠性评定算法库失败: errorMsg=" + e.getMessage()); | 
 |  |  |         } finally { | 
 |  |  |             if (is != null) { | 
 |  |  |                 try { |