From 7550a61793a9a0d789197ccef89fa042975cdac8 Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期三, 17 七月 2024 09:21:01 +0800
Subject: [PATCH] 修改模型解析功能

---
 modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/ModelLineService.java |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/ModelLineService.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/ModelLineService.java
index 01bd97e..8c2af11 100644
--- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/ModelLineService.java
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/ModelLineService.java
@@ -138,7 +138,7 @@
 
         // 6. 杞崲涓虹畻娉曞簱鎺ュ彛XML
         if (result) {
-            result = createIfXmlFromRbd(modelRbd, algorithmList, modelNodeAndVnodeList);
+//            result = createIfXmlFromRbd(modelRbd, algorithmList, modelNodeAndVnodeList);
         }
 
         // 7. 淇濆瓨妯″瀷
@@ -1266,21 +1266,25 @@
                         if (jsonValue != null && StringUtils.isNotBlank(jsonValue.toString())) {
                             productImg.setReliabDistribType(Integer.valueOf(jsonValue.toString()));
                         }
-                        productImg.setTaskMtbcf(JsonUtils2.getJsonValueByPath(jsonObject, "data/taskMtbcf".split("/")).toString());
+                        jsonValue = JsonUtils2.getJsonValueByPath(jsonObject, "data/taskMtbcf".split("/"));
+                        if (null != jsonValue) productImg.setTaskMtbcf(jsonValue.toString());
                         jsonValue = JsonUtils2.getJsonValueByPath(jsonObject, "data/taskMtbcfOtherParams2".split("/"));
                         if (null != jsonValue) productImg.setTaskMtbcfOtherParams2(jsonValue.toString());
                         jsonValue = JsonUtils2.getJsonValueByPath(jsonObject, "data/taskMtbcfOtherParams3".split("/"));
                         if (null != jsonValue) productImg.setTaskMtbcfOtherParams3(jsonValue.toString());
                         jsonValue = JsonUtils2.getJsonValueByPath(jsonObject, "data/isRepair".split("/"));
-                        if (jsonValue != null && StringUtils.isNotBlank(jsonValue.toString())) {
+                        if (jsonValue != null && StringUtils.isNotBlank(jsonValue.toString()) && !"null".equals(jsonValue.toString())) {
                             productImg.setIsRepair(Integer.valueOf(jsonValue.toString()));
+                        } else {
+                            productImg.setIsRepair(0);
                         }
                         if (1 == productImg.getIsRepair()) {
                             jsonValue = JsonUtils2.getJsonValueByPath(jsonObject, "data/repairDistribType".split("/"));
                             if (jsonValue != null && StringUtils.isNotBlank(jsonValue.toString())) {
                                 productImg.setRepairDistribType(Integer.valueOf(jsonValue.toString()));
                             }
-                            productImg.setRepairMttcr(JsonUtils2.getJsonValueByPath(jsonObject, "data/repairMttcr".split("/")).toString());
+                            jsonValue = JsonUtils2.getJsonValueByPath(jsonObject, "data/repairMttcr".split("/"));
+                            if (null != jsonValue) productImg.setRepairMttcr(jsonValue.toString());
                             jsonValue = JsonUtils2.getJsonValueByPath(jsonObject, "data/repairMttcrOtherParams2".split("/"));
                             if (null != jsonValue) productImg.setRepairMttcrOtherParams2(jsonValue.toString());
                             jsonValue = JsonUtils2.getJsonValueByPath(jsonObject, "data/repairMttcrOtherParams3".split("/"));

--
Gitblit v1.9.1