| | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import com.zt.life.modules.mainPart.taskReliability.dto.StatusDto; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.ModelRbd; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.SimulatAssess; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.SimulatAssessTaskPhaseModel; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.TimeDiagram; |
| | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.Hashtable; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | @Value("${data.reliaSimLib.resultHome}") |
| | | private String path; |
| | | |
| | | |
| | | private JSONObject dialgramJson; |
| | | |
| | |
| | | } else { |
| | | setlineXy(modelJson2, x2, y1, x2, y2, null); |
| | | } |
| | | |
| | | jsonArray.add(modelJson2); |
| | | |
| | | //判断是否有模型 |
| | | ModelRbd modelRbd = baseDao.getModelByProductGk(modelDto.getGkId(), productId); |
| | | String modelName = "未用"; |
| | | String modelId = ""; |
| | | if (modelRbd != null) { |
| | | modelName = modelRbd.getModelName(); |
| | | modelId = modelRbd.getId().toString(); |
| | | } |
| | | |
| | | JSONObject textJson = new JSONObject(templetsStrMap.get("text")); |
| | | JsonUtils2.setJsonValueByPath(textJson, "data/dataId".split("/"), modelDto.getGkId()); |
| | | JsonUtils2.setJsonValueByPath(textJson, "data/dataId".split("/"), modelId); |
| | | JsonUtils2.setJsonValueByPath(textJson, "id".split("/"), UUIDUtil.generateId().toString()); |
| | | JsonUtils2.setJsonValueByPath(textJson, "attrs/label/textWrap/text".split("/"), modelDto.getGkName()); |
| | | JsonUtils2.setJsonValueByPath(textJson, "attrs/label/textWrap/text".split("/"), modelName); |
| | | JsonUtils2.setJsonValueByPath(textJson, "position/x".split("/"), x1 + 30); |
| | | JsonUtils2.setJsonValueByPath(textJson, "position/y".split("/"), y1); |
| | | jsonArray.add(textJson); |
| | |
| | | setlineXy(modelJson3, 0, y, x2, y, null); |
| | | jsonArray.add(modelJson3); |
| | | |
| | | double curPointHour = 50, periodHour = 50; |
| | | double curPointHour = 10, periodHour = 50; |
| | | while (curPointHour < totalHours) { |
| | | JSONObject modelJson4 = new JSONObject(templetsStrMap.get("model")); |
| | | double x = curPointHour * pointNumPerHour; |
| | | setlineXy(modelJson4, x, y, x, y, null); |
| | | jsonArray.add(modelJson4); |
| | | curPointHour += 10.0; |
| | | } |
| | | |
| | | return jsonObject.toString(); |
| | |
| | | "end".equals(item.getAlgorithmType())).collect(Collectors.toList()).get(0); |
| | | ModelNode computerNode = modelNodeAndVnodeList.stream().filter(item -> |
| | | endAlgo.getComputerList().equals(item.getId().toString())).collect(Collectors.toList()).get(0); |
| | | node2DOM(productList, |
| | | node2DOM(productId, |
| | | productList, |
| | | paramDataList, |
| | | gkModelsAssembled, |
| | | algorithmList, |
| | |
| | | } |
| | | |
| | | // 递归函数 |
| | | private void node2DOM(List<XhProductModel> productList, |
| | | private void node2DOM(Long productId, |
| | | List<XhProductModel> productList, |
| | | List<ParamData> paramDataList, |
| | | List<OperatConditModel> gkModelsAssembled, |
| | | List<Algorithm> algorithmList, |
| | |
| | | "end".equals(item.getAlgorithmType())).collect(Collectors.toList()).get(0); |
| | | ModelNode computerNode = modelNodeAndVnodeListSub.stream().filter(item -> |
| | | endAlgo.getComputerList().equals(item.getId().toString())).collect(Collectors.toList()).get(0); |
| | | node2DOM(productList, |
| | | node2DOM(product.getId(), |
| | | productList, |
| | | paramDataList, |
| | | gkModelsAssembled, |
| | | algorithmListSub, |
| | |
| | | Algorithm algo = algorithmList.stream().filter(item -> |
| | | node.getId().equals(item.getId())).collect(Collectors.toList()).get(0); |
| | | Element element = parent.addElement("logic"); |
| | | element.addAttribute("name", algo.getId().toString()); |
| | | if (null == productId) { |
| | | element.addAttribute("name", algo.getId().toString()); |
| | | } else { |
| | | element.addAttribute("name", productId.toString()); |
| | | } |
| | | if ("series".equals(algo.getAlgorithmType())) { |
| | | element.addAttribute("type", "series"); |
| | | } else if ("parallel".equals(algo.getAlgorithmType())) { |
| | |
| | | for (String nodeStr : computerNodeListStr) { |
| | | ModelNode mn = modelNodeAndVnodeList.stream().filter(item -> |
| | | nodeStr.equals(item.getId().toString())).collect(Collectors.toList()).get(0); |
| | | node2DOM(productList, |
| | | node2DOM(null, |
| | | productList, |
| | | paramDataList, |
| | | gkModelsAssembled, |
| | | algorithmList, |