| | |
| | | |
| | | // 建立产品结构树时,相同的设备多个使用时,多个设备使用相同的名称。这样,在此处通过名称来判断是否是相同的设备,相同的设备,需要拿出来作为子标签嵌套进xml。 |
| | | private void assembleModelXml(AssessResult assessResult) { |
| | | /* |
| | | // 测试算法库用 |
| | | String xml = "<des name=\"General system\" gama=\"0.7\">\n" + |
| | | " <tasks>\n" + |
| | | " <task duration=\"1\" model=\"1819282257303678978\"/>\n" + |
| | | " </tasks>\n" + |
| | | " <models>\n" + |
| | | " <model name=\"1819282257303678978\">\n" + |
| | | " <logic name=\"系统\" type=\"series\" >\n" + |
| | | " <logic name=\"分系统1\" type=\"series\" >\n" + |
| | | " <logic name=\"v1\" type=\"parallel\" nums=\"2\">\n" + |
| | | " <node name=\"设备1\" distType=\"exp\" ToE=\"20\" F=\"1\"/>\n" + |
| | | " </logic>\n" + |
| | | " <node name=\"设备2\" distType=\"exp\" ToE=\"0.3\" F=\"1\"/>\n" + |
| | | " </logic>\n" + |
| | | " <logic name=\"分系统2\" type=\"series\" >\n" + |
| | | " <node name=\"设备3\" distType=\"exp\" ToE=\"0.2\" F=\"0\"/>\n" + |
| | | " <node name=\"设备4\" distType=\"ber\" NoE=\"18\" F=\"0\"/>\n" + |
| | | " <logic name=\"v2\" type=\"series\" nums=\"2\">\n" + |
| | | " <node name=\"设备5\" distType=\"exp\" ToE=\"0.5,0,6\" F=\"1,2\"/>\n" + |
| | | " </logic> \n" + |
| | | " <node name=\"设备6\" distType=\"exp\" ToE=\"0.3\" F=\"1\"/>\n" + |
| | | " </logic>\n" + |
| | | " <logic name=\"分系统3\" type=\"vote\" nums=\"3\" k=\"2\" >\n" + |
| | | " <node name=\"设备7\" distType=\"exp\" ToE=\"87\" F=\"1\"/>\n" + |
| | | " </logic>\n" + |
| | | " </logic>\n" + |
| | | " </model>\n" + |
| | | " </models>\n" + |
| | | "</des>"; |
| | | String xml1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + |
| | | "\n" + |
| | | "<des name=\"General system\" gama=\"0.6\">\n" + |
| | | " <tasks>\n" + |
| | | " <task duration=\"1.0\" model=\"1839217232446533633\"/>\n" + |
| | | " </tasks>\n" + |
| | | " <models>\n" + |
| | | " <model name=\"1839217232446533633\">\n" + |
| | | " <logic name=\"1727338143768926498\" real_name=\"评审用船A\" type=\"series\">\n" + |
| | | " <logic name=\"1727338125295232953\" real_name=\"通信系统\" name_path=\"通信系统\" type=\"series\">\n" + |
| | | " <logic name=\"v1\" type=\"parallel\" nums=\"2\">\n" + |
| | | " <node name=\"1727338347041863487,1727338104458428136\" real_name=\"对讲机\" name_path=\"通信系统,对讲机b\" distType=\"ber\" NoE=\"0,10\" F=\"0,1\"/>\n" + |
| | | " </logic>\n" + |
| | | " <node name=\"1727338109884317860\" real_name=\"交换机\" name_path=\"通信系统,交换机\" distType=\"exp\" ToE=\"10\" F=\"1\"/>\n" + |
| | | " </logic>\n" + |
| | | " <logic name=\"1727338132480394459\" real_name=\"空调系统\" name_path=\"空调系统\" type=\"vote\" k=\"2\" nums=\"3\">\n" + |
| | | " <node name=\"1727338148414415252,1727338894880570868,1727338666019181419\" real_name=\"空调\" name_path=\"空调系统,空调c\" distType=\"exp\" ToE=\"88,87,86\" F=\"8,7,6\"/>\n" + |
| | | " </logic>\n" + |
| | | " <logic name=\"1727338199831104683\" real_name=\"电力系统\" name_path=\"电力系统\" type=\"series\">\n" + |
| | | " <node name=\"1727338129701280729\" real_name=\"发电机2\" name_path=\"电力系统,发电机2\" distType=\"ber\" NoE=\"20\" F=\"2\"/>\n" + |
| | | " <node name=\"1727338865212183133\" real_name=\"发电机1\" name_path=\"电力系统,发电机1\" distType=\"exp\" ToE=\"20\" F=\"2\"/>\n" + |
| | | " <node name=\"1727338589328410328\" real_name=\"配电板\" name_path=\"电力系统,配电板\" distType=\"exp\" ToE=\"50\" F=\"5\"/>\n" + |
| | | " <logic name=\"v3\" type=\"series\" nums=\"2\">\n" + |
| | | " <node name=\"1727338101737644187,1727338554151292452\" real_name=\"蓄电池\" name_path=\"电力系统,蓄电池a\" distType=\"exp\" ToE=\"30,40\" F=\"3,4\"/>\n" + |
| | | " </logic>\n" + |
| | | " </logic>\n" + |
| | | " </logic>\n" + |
| | | " </model>\n" + |
| | | " </models>\n" + |
| | | "</des>"; |
| | | assessResult.setXml(xml1); |
| | | */ |
| | | Long productId = assessResult.getProductId(); |
| | | Long taskId = assessResult.getTaskId(); |
| | | Long itemId = assessResult.getItemId(); |
| | |
| | | path = shipPath = name; |
| | | xtPath = ""; |
| | | fxtPath = ""; |
| | | sbPath = ""; |
| | | productId = shipId; |
| | | } else { |
| | | if (type.equals("系统")) { |
| | | if (StringUtils.isNotBlank(shipPath)) { |
| | | path = xtPath = name; |
| | | fxtPath = ""; |
| | | sbPath = ""; |
| | | } else { |
| | | continue; |
| | | } |
| | |
| | | if (type.equals("分系统")) { |
| | | if (StringUtils.isNotBlank(xtPath)) { |
| | | path = fxtPath = xtPath + "," + name; |
| | | sbPath = ""; |
| | | } else { |
| | | continue; |
| | | } |
| | | } |
| | | if (type.equals("设备")) { |
| | | if ((StringUtils.isNotBlank(xtPath) || StringUtils.isNotBlank(fxtPath))) { |
| | | path = sbPath = StringUtils.isNotBlank(fxtPath) ? fxtPath + "," + name : xtPath + "," + name; |
| | | path = StringUtils.isNotBlank(fxtPath) ? fxtPath + "," + name : xtPath + "," + name; |
| | | } else { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | baseDao.deleteByItemId(itemId); |
| | | ReliabilityAssess assess = new ReliabilityAssess(); |
| | | assess.setFailNum(failNum); |
| | | assess.setRunNum(runNum); |
| | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | ImportUtil.updateErrMap(errMap, "导入异常" + e.getMessage(), "", row1); |
| | | //err++; |
| | | } |
| | | |
| | | Date nowDate = new Date(); |