From a8ce806c8a81f685fa9fafaa453820197ced9961 Mon Sep 17 00:00:00 2001 From: jinlin <jinlin> Date: 星期二, 10 十二月 2024 10:39:39 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/SimulatAssessService.java | 46 +++++++++++++++++++++++++--------------------- 1 files changed, 25 insertions(+), 21 deletions(-) diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/SimulatAssessService.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/SimulatAssessService.java index 7ab70ec..a38a8d1 100644 --- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/SimulatAssessService.java +++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/SimulatAssessService.java @@ -257,7 +257,7 @@ JsonUtils2.setJsonValueByPath(textJson, "id".split("/"), UUIDUtil.generateId().toString()); JsonUtils2.setJsonValueByPath(textJson, "attrs/label/textWrap/text".split("/"), dto.getName()); JsonUtils2.setJsonValueByPath(textJson, "position/x".split("/"), 20); - JsonUtils2.setJsonValueByPath(textJson, "position/y".split("/"), y - 15); + JsonUtils2.setJsonValueByPath(textJson, "position/y".split("/"), y + 10); jsonArray3.add(textJson); } @@ -607,7 +607,7 @@ if (jsonArray3.size() == 0) { StatusDto statusDto = new StatusDto(); statusDto.setTimes(phaseModelList.get(j).getGkDuration()); - statusDto.setStatus(""); + statusDto.setStatus("M"); productStatusDto.getStatusList().add(statusDto); } else { for (int a = 0; a < jsonArray3.size(); a++) { @@ -621,6 +621,9 @@ } } if (status != null || times != null) { + if (StringUtils.isBlank(status)) { + status = "M"; + } StatusDto statusDto = new StatusDto(); statusDto.setTimes(times); statusDto.setStatus(status); @@ -1298,7 +1301,6 @@ JSONObject xmlJSONObj = XML.toJSONObject(xml); JSONArray jsonArray = xmlJSONObj.getJSONObject("ResultNodes").getJSONArray("ResultNode"); for (int i = 0; i < jsonArray.size(); i++) { - WeakDto data = new WeakDto(); Long productId1; String nameValue = jsonArray.getJSONObject(i).get("name").toString(); if (StringUtils.isNotBlank(nameValue)) { @@ -1323,12 +1325,14 @@ } List<WeakDto> productList = baseDao.getProductList(taskId, productId); for (WeakDto item : productList) { - WeakDto dto = map.get(item.getId()); - item.setMtbf(dto.getMtbf()); - item.setMttr(dto.getMttr()); - item.setMsr(dto.getMsr()); - item.setMtbfTime(dto.getMtbf() / item.getTimeRate()); - item.setIsWeak(0); + if (map.get(item.getId()) != null) { + WeakDto dto = map.get(item.getId()); + item.setMtbf(dto.getMtbf()); + item.setMttr(dto.getMttr()); + item.setMsr(dto.getMsr()); + item.setMtbfTime(dto.getMtbf() / item.getTimeRate()); + item.setIsWeak(0); + } } List<WeakDto> treeList = new ArrayList<>(); @@ -1343,13 +1347,15 @@ private void getIsweak(List<WeakDto> treeList) { WeakDto minDto = null; for (WeakDto dto : treeList) { - if (dto.getProductType() == 10) - continue; - if (minDto == null) { - minDto = dto; - } - if (dto.getMtbfTime() < minDto.getMtbfTime()) { - minDto = dto; + if (dto.getMtbfTime() != null) { + if (dto.getProductType() == 10) + continue; + if (minDto == null) { + minDto = dto; + } + if (dto.getMtbfTime() < minDto.getMtbfTime()) { + minDto = dto; + } } } minDto.setIsWeak(1); @@ -1469,13 +1475,11 @@ String[] arr = availability.split(" "); // 閬嶅巻瀛愬瓧绗︿覆鏁扮粍锛屽皢姣忎釜鍏冪礌杞崲涓篸ouble骞跺瓨鍌ㄥ埌double鏁扮粍涓� Double j = 0.0; - Double b = 100.0; for (int a = 0; a < arr.length - 1; a++) { - if (Convert.toDouble(arr[a]) < Convert.toDouble(arr[a+1])) { - System.out.println(arr[a]); - } j = samplPeriod + j; - doubleArray.add(Double.parseDouble(arr[a])); + if (!StringUtils.isEmpty(arr[a])) { + doubleArray.add(Double.parseDouble(arr[a])); + } xList.add(j); } -- Gitblit v1.9.1