From 48dcf2c7f01de5078f6a7f94dbc59400100e9ab6 Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期三, 23 十月 2024 11:05:07 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
web/src/views/modules/taskReliability/SimulatHistory.vue | 2
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dto/ProductDto.java | 1
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/dto/ProductStatusDto.java | 15 ++
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/SimulatAssessService.java | 182 ++++++++++++++++-------------
web/src/views/modules/taskReliability/RBD-edit-img.vue | 2
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java | 40 +++++-
modules/mainPart/src/main/resources/mapper/baseReliability/ParamDataBasicDao.xml | 25 ++-
modules/mainPart/src/main/resources/mapper/taskReliability/SimulatAssessDao.xml | 9 +
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/dto/WeakDto.java | 2
modules/mainPart/src/main/resources/mapper/basicInfo/XhProductModelDao.xml | 2
web/src/views/modules/taskReliability/SimulatAssess.vue | 14 +
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/XhProductModel.java | 25 ++++
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/model/SimulatAssess.java | 6
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/ModelRbdNodeService.java | 10
modules/mainPart/src/main/resources/产品结构树导出模板.xlsx | 0
15 files changed, 213 insertions(+), 122 deletions(-)
diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dto/ProductDto.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dto/ProductDto.java
index 0a3f721..db3ee37 100644
--- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dto/ProductDto.java
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dto/ProductDto.java
@@ -19,6 +19,7 @@
private Long id;
private Long pid;
private String sameSbName;
+ private Integer sameSbNum;
private String equipType; //璁惧绫诲瀷
private Integer reliabDistribType; //鍙潬鎬у垎甯冪被鍨�
private Integer basicJoinCompute; //鍙傚姞璁$畻
diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/XhProductModel.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/XhProductModel.java
index 9c37bbf..c97b23e 100644
--- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/XhProductModel.java
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/XhProductModel.java
@@ -4,6 +4,8 @@
import com.baomidou.mybatisplus.annotation.TableName;
import com.zt.common.entity.BusiEntity;
import com.zt.common.entity.TreeNode;
+import com.zt.common.utils.UUIDUtil;
+import com.zt.life.core.model.ZtProduct;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -22,7 +24,7 @@
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("product_model")
-public class XhProductModel extends BusiEntity implements TreeNode<XhProductModel> {
+public class XhProductModel extends BusiEntity implements TreeNode<XhProductModel>,Cloneable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "涓婄骇ID")
@@ -57,10 +59,31 @@
@ApiModelProperty(value = "鎺掑簭")
private Integer sort;
+ @ApiModelProperty(value = "鍚岀被璁惧鏁伴噺")
+ @TableField(exist = false)
+ private Integer sameSbNum;
+
+
+ @ApiModelProperty(value = "鍚岀被璁惧搴忓彿")
+ @TableField(exist = false)
+ private Integer deviceNo;
+
+ @ApiModelProperty(value = "鍚岀被璁惧搴忓彿")
+ @TableField(exist = false)
+ private String dataId;
+
@ApiModelProperty(value = "瀛愯妭鐐�")
@TableField(exist = false)
private List<XhProductModel> children = new ArrayList<>();
@TableField(exist = false)
private Long paramId;
+
+ @Override
+ public XhProductModel clone() throws CloneNotSupportedException {
+ XhProductModel product = (XhProductModel) super.clone();
+ product.children = new ArrayList<>();
+ product.setId(UUIDUtil.generateId());
+ return product;
+ }
}
diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java
index f9a0192..d0f96b8 100644
--- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java
@@ -70,7 +70,7 @@
}
public List<XhProductModel> getAllTree(Boolean showXdy, Integer ztShow, Long productId) {
- List<XhProductModel> productList = null;
+ List<XhProductModel> productList = new ArrayList<>();
if (showXdy) {
if (productId != null) {
productList = baseDao.selectList(new QueryWrapper<XhProductModel>().eq(Constant.TableColumn.IS_DELETE,
@@ -102,8 +102,29 @@
productList = baseDao.selectList(new QueryWrapper<XhProductModel>().eq(Constant.TableColumn.IS_DELETE,
Constant.Bool.NO).lt("product_type", 5).ne("product_type", 1).and(wrapper -> wrapper.eq("ship_id", productId).or().eq("id", productId)).orderByAsc(Constant.TableColumn.SORT));
} else if (ztShow == 5) {
- productList = baseDao.selectList(new QueryWrapper<XhProductModel>().eq(Constant.TableColumn.IS_DELETE,
- Constant.Bool.NO).gt("product_type", 1).and(wrapper -> wrapper.eq("ship_id", productId).or().eq("id", productId)).orderByAsc(Constant.TableColumn.SORT));
+ List<XhProductModel> dbList = baseDao.selectList(new QueryWrapper<XhProductModel>().eq(Constant.TableColumn.IS_DELETE,
+ Constant.Bool.NO).gt("product_type", 1).and(wrapper -> wrapper.eq("ship_id", productId).or().eq("id", productId)));
+ for (XhProductModel row : dbList) {
+ if (row.getSameSbNum() > 1) {
+ for (int i = 1; i <= row.getSameSbNum(); i++) {
+ try {
+ XhProductModel newRow = row.clone();
+ newRow.setDeviceNo(i);
+ newRow.setName(row.getName() + "-" + i);
+ newRow.setDataId(row.getId().toString() + "-" + i);
+ productList.add(newRow);
+ } catch (CloneNotSupportedException e) {
+ e.printStackTrace();
+ }
+ }
+ } else {
+ row.setDeviceNo(0);
+ row.setDataId(row.getId().toString());
+ productList.add(row);
+ }
+ }
+ productList.sort(Comparator.comparing(XhProductModel::getSort, Comparator.naturalOrder())
+ .thenComparing(XhProductModel::getDeviceNo, Comparator.naturalOrder()));
}
}
}
@@ -329,7 +350,7 @@
xhProductModel.setPid(curFxtId == null ? curXtId : curFxtId);
xhProductModel.setId(curSbId);
xhProductModel.setName(sb);
- //xhProductModel.setSameSbName(sameSbName);
+ xhProductModel.setSameSbNum(sameSbNum);
xhProductModel.setEquipType(equipType);
xhProductModel.setProductType("5");
xhProductModel.setSort(Integer.valueOf(sort));
@@ -423,7 +444,7 @@
List<ProductDto> data = baseDao.getProductByShip(shipId);
data = TreeUtils.build(data);
List<ProductDto> List = new ArrayList<>();
- this.writeExcel(data, List);
+ this.writeList(data, List);
// 璇诲彇妯℃澘鏂囦欢
try (InputStream inputStream = getClass().getResourceAsStream("/浜у搧缁撴瀯鏍戝鍑烘ā鏉�.xlsx")) {
Workbook workbook = new XSSFWorkbook(inputStream);
@@ -470,9 +491,8 @@
}
}
cell = row.createCell(4);
- if (StringUtils.isNotBlank(List.get(i).getSameSbName())) {
- cell.setCellValue(List.get(i).getSameSbName());
- }
+ cell.setCellValue(List.get(i).getSameSbNum());
+
cell = row.createCell(5);
if (StringUtils.isNotBlank(List.get(i).getEquipType())) {
cell.setCellValue(List.get(i).getEquipType());
@@ -555,10 +575,10 @@
}
- private void writeExcel(List<ProductDto> data, List<ProductDto> List) {
+ private void writeList(List<ProductDto> data, List<ProductDto> List) {
for (ProductDto dto : data) {
List.add(dto);
- writeExcel(dto.getChildren(), List);
+ writeList(dto.getChildren(), List);
}
}
}
diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/dto/ProductStatusDto.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/dto/ProductStatusDto.java
index 5794f5b..51a856b 100644
--- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/dto/ProductStatusDto.java
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/dto/ProductStatusDto.java
@@ -1,6 +1,8 @@
package com.zt.life.modules.mainPart.taskReliability.dto;
import com.baomidou.mybatisplus.annotation.TableField;
+import com.zt.common.utils.UUIDUtil;
+import com.zt.life.modules.mainPart.basicInfo.model.XhProductModel;
import com.zt.life.modules.mainPart.taskReliability.model.CurveParam;
import com.zt.life.modules.mainPart.taskReliability.model.OperatConditModel;
import io.swagger.annotations.ApiModelProperty;
@@ -11,9 +13,20 @@
import java.util.Map;
@Data
-public class ProductStatusDto {
+public class ProductStatusDto implements Cloneable{
private Long id ;
private String name ;
private Integer sort ;
+ private Integer sameSbNum ;
+ private Integer deviceNo ;
+ private String dataId ;
private List<StatusDto> statusList = new ArrayList<>();
+
+ @Override
+ public ProductStatusDto clone() throws CloneNotSupportedException {
+ ProductStatusDto product = (ProductStatusDto) super.clone();
+ product.statusList = new ArrayList<>();
+ product.setId(UUIDUtil.generateId());
+ return product;
+ }
}
diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/dto/WeakDto.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/dto/WeakDto.java
index ead4971..43cf13f 100644
--- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/dto/WeakDto.java
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/dto/WeakDto.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.annotation.TableField;
import com.zt.common.entity.BusiEntity;
import com.zt.common.entity.TreeNode;
+import com.zt.common.utils.UUIDUtil;
import com.zt.life.modules.mainPart.basicInfo.model.ParamData;
import com.zt.life.modules.mainPart.taskReliability.model.CurveParam;
import io.swagger.annotations.ApiModelProperty;
@@ -24,7 +25,6 @@
private Long id;
private Long pid;
private Integer sort;
-
@ApiModelProperty(value = "瀛愯妭鐐�")
@TableField(exist = false)
diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/model/SimulatAssess.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/model/SimulatAssess.java
index e005bea..061828e 100644
--- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/model/SimulatAssess.java
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/model/SimulatAssess.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
+import com.zt.common.constant.Bool;
import com.zt.common.entity.BusiEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -36,7 +37,7 @@
private Integer simulatFrequency;
@TableField(exist = false)
- private Long showProductId;
+ private String showProductId;
@TableField(exist = false)
private String dataType;
@@ -44,6 +45,9 @@
@TableField(exist = false)
private Double taskDuration;
+ @TableField(exist = false)
+ private Boolean repairDiracFlag;
+
@ApiModelProperty(value = "浼犵粰绠楁硶搴撶殑xml")
private String xml;
diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/ModelRbdNodeService.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/ModelRbdNodeService.java
index 27bfa88..b57857b 100644
--- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/ModelRbdNodeService.java
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/ModelRbdNodeService.java
@@ -13,7 +13,7 @@
/**
* model_line
*
- * @author zt generator
+ * @author zt generator
* @since 1.0.0 2024-02-28
*/
@Service
@@ -25,13 +25,13 @@
node.setProductId(modelRbd.getProductId());
node.setModelId(modelRbd.getId());
Long[] nodeArr = modelRbd.getNodeArr();
- Map<Long,Integer> nodeMap = new HashMap<>();
- for(Long nodeId :nodeArr){
- if (nodeMap.get(nodeId)!=null) {
+ Map<Long, Integer> nodeMap = new HashMap<>();
+ for (Long nodeId : nodeArr) {
+ if (nodeMap.get(nodeId) == null) {
node.setId(UUIDUtil.generateId());
node.setNodeId(nodeId);
baseDao.insert(node);
- nodeMap.put(nodeId,1);
+ nodeMap.put(nodeId, 1);
}
}
}
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 b32a5ea..b574501 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
@@ -26,6 +26,7 @@
import com.zt.life.modules.mainPart.utils.GetStringSpace;
import io.swagger.models.auth.In;
import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
@@ -332,7 +333,8 @@
List<TimeDiagramStatusDto> statusDtoListNew = new ArrayList<>();
while (statusDtoListOld.size() > 0) {
- statusDtoListOld.stream().sorted(Comparator.comparing(TimeDiagramStatusDto::getX1)).collect(Collectors.toList());
+ //statusDtoListOld.stream().sorted(Comparator.comparing(TimeDiagramStatusDto::getX1)).collect(Collectors.toList());
+ statusDtoListOld.sort(Comparator.comparing(TimeDiagramStatusDto::getX1, Comparator.naturalOrder()));
TimeDiagramStatusDto nextStatusDto = statusDtoListOld.get(0);
if (statusDtoListNew.size() == 0) {
statusDtoListNew.add(nextStatusDto);
@@ -357,7 +359,9 @@
statusDtoListOld.add(new TimeDiagramStatusDto(nextStatusDto.getX2(), currentStatusDto.getX2(), currentStatusDto.getStatus()));
}
} else {
- if (nextStatusDto.getX2() > currentStatusDto.getX2()) {
+ if (nextStatusDto.getX1() >= currentStatusDto.getX2()) {
+ statusDtoListNew.add(new TimeDiagramStatusDto(nextStatusDto.getX1(), nextStatusDto.getX2(), nextStatusDto.getStatus()));
+ } else if (nextStatusDto.getX2() > currentStatusDto.getX2()) {
statusDtoListOld.add(new TimeDiagramStatusDto(currentStatusDto.getX2(), nextStatusDto.getX2(), nextStatusDto.getStatus()));
}
}
@@ -548,9 +552,31 @@
}
public List<ProductStatusDto> getStatusData(Long productId, Long taskId) {
- List<ProductStatusDto> childList = this.getProduct(productId, taskId);
+
+ List<ProductStatusDto> dbList = this.getProduct(productId, taskId);
+ List<ProductStatusDto> childList = new ArrayList<>();
+ for (ProductStatusDto item : dbList) {
+ if (item.getSameSbNum() > 1) {
+ for (int i = 1; i <= item.getSameSbNum(); i++) {
+ try {
+ ProductStatusDto newRow = item.clone();
+ newRow.setDeviceNo(i);
+ newRow.setName(item.getName() + "-" + i);
+ newRow.setDataId(item.getId().toString() + "-" + i);
+ childList.add(newRow);
+ } catch (CloneNotSupportedException e) {
+ e.printStackTrace();
+ }
+ }
+ } else {
+ item.setDeviceNo(0);
+ item.setDataId(item.getId().toString());
+ childList.add(item);
+ }
+ }
+ childList.sort(Comparator.comparing(ProductStatusDto::getDeviceNo, Comparator.naturalOrder()));
for (ProductStatusDto item : childList) {
- JSONArray jsonArray = dialgramJson.getJSONArray(String.valueOf(item.getId()));
+ JSONArray jsonArray = dialgramJson.getJSONArray(item.getDataId());
if (jsonArray != null) {
this.processJSONArray(jsonArray, item, taskId);
}
@@ -1038,8 +1064,8 @@
// 璁惧
Integer deviceNo = node.getDeviceNo();
Element nodeTag = parent.addElement("node");
- nodeTag.addAttribute("name", deviceNo == 0 ? dataId.toString() : dataId.toString()+"-"+deviceNo);
- nodeTag.addAttribute("real_name", deviceNo == 0 ? product.getName() : product.getName()+"-"+deviceNo);
+ nodeTag.addAttribute("name", deviceNo == 0 ? dataId.toString() : dataId.toString() + "-" + deviceNo);
+ nodeTag.addAttribute("real_name", deviceNo == 0 ? product.getName() : product.getName() + "-" + deviceNo);
nodeTag.addAttribute("name_path", product.getNamePath());
nodeTag.addAttribute("type", "node");
@@ -1214,8 +1240,7 @@
public List<WeakDto> getReliabilityWeakness(Long fzId, Long taskId, Long productId) {
String filePath = path + "/" + fzId + "/" + "result.xml";
- List<WeakDto> list = new ArrayList<>();
- Map<Long, WeakDto> map = new HashMap<>();
+
String xml;
InputStream in = null;
try {
@@ -1235,50 +1260,46 @@
}
- List<WeakDto> productList = baseDao.getProductList(taskId, productId);
- for (WeakDto dto : productList) {
- map.put(dto.getId(), dto);
- }
+ Map<Long, WeakDto> map = new HashMap<>();
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;
- Object nameValue = jsonArray.getJSONObject(i).get("name");
- if (nameValue instanceof Long) {
- productId1 = (Long) nameValue;
- if (map.get(productId1) != null) {
- WeakDto weakDto = map.get(productId1);
- Double mtbfTime = null;
+ String nameValue = jsonArray.getJSONObject(i).get("name").toString();
+ if (StringUtils.isNotBlank(nameValue)) {
+ productId1 = Convert.toLong(nameValue.split("-")[0]);
- Double mtbf = (Double) jsonArray.getJSONObject(i).get("mttf");
- Double mttr = (Double) jsonArray.getJSONObject(i).get("mttr");
- Double msr = (Double) jsonArray.getJSONObject(i).get("msr");
-
- data.setMtbf(mtbf);
- data.setMttr(mttr);
- data.setMsr(msr);
-
- if (weakDto != null) {
- data.setId(weakDto.getId());
- data.setSort(weakDto.getSort());
- data.setPid(weakDto.getPid());
- data.setName(weakDto.getName());
- data.setProductType(weakDto.getProductType());
- data.setTimeRate(weakDto.getTimeRate());
- mtbfTime = mtbf / weakDto.getTimeRate();
+ Double mtbf = (Double) jsonArray.getJSONObject(i).get("mttf");
+ Double mttr = (Double) jsonArray.getJSONObject(i).get("mttr");
+ Double msr = (Double) jsonArray.getJSONObject(i).get("msr");
+ WeakDto weakDto = new WeakDto();
+ weakDto.setId(productId1);
+ weakDto.setMtbf(mtbf);
+ weakDto.setMttr(mttr);
+ weakDto.setMsr(msr);
+ if (map.get(productId1) == null) {
+ map.put(productId1, weakDto);
+ } else {
+ if (weakDto.getMsr() < map.get(productId1).getMsr()) {
+ map.put(productId1, weakDto);
}
-
- data.setMtbfTime(mtbfTime);
- data.setIsWeak(0);
-
- list.add(data);
}
}
}
+ 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);
+ }
+
List<WeakDto> treeList = new ArrayList<>();
- if (list.size() > 0) {
- treeList = TreeUtils.build(list);
+ if (productList.size() > 0) {
+ treeList = TreeUtils.build(productList);
this.getIsweak(treeList.get(0).getChildren());
}
@@ -1336,7 +1357,7 @@
simulatAssessList.add(simulatAssess);
result = simulateChecK(simulatAssess);
- if (result!=null){
+ if (result != null) {
simulatResult.setType("errorList");
simulatResult.setErrList(result);
return simulatResult;
@@ -1380,7 +1401,7 @@
}
}
xmlJSONObj = XML.toJSONObject(xml);
- simulatAssess.setShowProductId(simulatAssess.getProductId());
+ simulatAssess.setShowProductId(simulatAssess.getProductId().toString());
SimulaDataDto data = this.getResultData(simulatAssess);
return data;
}
@@ -1392,50 +1413,47 @@
samplPeriod = samplPeriod / 60;
JSONArray jsonArray = xmlJSONObj.getJSONObject("ResultNodes").getJSONArray("ResultNode");
for (int i = 0; i < jsonArray.size(); i++) {
- Long productId = null;
- Object nameValue = jsonArray.getJSONObject(i).get("name");
- if (nameValue instanceof Long) {
- productId = (Long) nameValue;
- if (productId.equals(simulatAssess.getShowProductId())) {
- Object object = jsonArray.getJSONObject(i).get("phase");
- List<Double> doubleArray = new ArrayList<>();
- List<Double> xList = new ArrayList<>();
- String availability = null;
- if (object instanceof JSONArray) {
- JSONArray jsonArray2 = jsonArray.getJSONObject(i).getJSONArray("phase");
- for (int j = 0; j < jsonArray2.size(); j++) {
- if (availability != null) {
- availability = availability + " " + jsonArray2.getJSONObject(j).get("availability");
- } else {
- availability = (String) jsonArray2.getJSONObject(j).get("availability");
- }
+ String nameValue = jsonArray.getJSONObject(i).get("name").toString();
+ if (nameValue.equals(simulatAssess.getShowProductId())) {
+ Object object = jsonArray.getJSONObject(i).get("phase");
+ List<Double> doubleArray = new ArrayList<>();
+ List<Double> xList = new ArrayList<>();
+ String availability = null;
+ if (object instanceof JSONArray) {
+ JSONArray jsonArray2 = jsonArray.getJSONObject(i).getJSONArray("phase");
+ for (int j = 0; j < jsonArray2.size(); j++) {
+ if (availability != null) {
+ availability = availability + " " + jsonArray2.getJSONObject(j).get("availability");
+ } else {
+ availability = (String) jsonArray2.getJSONObject(j).get("availability");
}
- } else {
- JSONObject jsonObject2 = jsonArray.getJSONObject(i).getJSONObject("phase");
- availability = (String) jsonObject2.get("availability");
}
-
- String[] arr = availability.split(" ");
- // 閬嶅巻瀛愬瓧绗︿覆鏁扮粍锛屽皢姣忎釜鍏冪礌杞崲涓篸ouble骞跺瓨鍌ㄥ埌double鏁扮粍涓�
- Double j = 0.0;
- for (int a = 0; a < arr.length; a++) {
- j = samplPeriod + j;
- doubleArray.add(Double.parseDouble(arr[a]));
- xList.add(j);
- }
-
- param.setXData(xList);
- param.setYData(doubleArray);
- Double mtbf = (Double) jsonArray.getJSONObject(i).get("mttf");
- Double mttr = (Double) jsonArray.getJSONObject(i).get("mttr");
- Double msr = (Double) jsonArray.getJSONObject(i).get("msr");
- data.setMtbf(mtbf);
- data.setMttr(mttr);
- data.setMsr(msr);
+ } else {
+ JSONObject jsonObject2 = jsonArray.getJSONObject(i).getJSONObject("phase");
+ availability = (String) jsonObject2.get("availability");
}
- data.setCurveParam(param);
+
+ String[] arr = availability.split(" ");
+ // 閬嶅巻瀛愬瓧绗︿覆鏁扮粍锛屽皢姣忎釜鍏冪礌杞崲涓篸ouble骞跺瓨鍌ㄥ埌double鏁扮粍涓�
+ Double j = 0.0;
+ for (int a = 0; a < arr.length; a++) {
+ j = samplPeriod + j;
+ doubleArray.add(Double.parseDouble(arr[a]));
+ xList.add(j);
+ }
+
+ param.setXData(xList);
+ param.setYData(doubleArray);
+ Double mtbf = (Double) jsonArray.getJSONObject(i).get("mttf");
+ Double mttr = (Double) jsonArray.getJSONObject(i).get("mttr");
+ Double msr = (Double) jsonArray.getJSONObject(i).get("msr");
+ data.setMtbf(mtbf);
+ data.setMttr(mttr);
+ data.setMsr(msr);
}
+ data.setCurveParam(param);
}
+
return data;
}
diff --git a/modules/mainPart/src/main/resources/mapper/baseReliability/ParamDataBasicDao.xml b/modules/mainPart/src/main/resources/mapper/baseReliability/ParamDataBasicDao.xml
index 9f9eb6e..572c271 100644
--- a/modules/mainPart/src/main/resources/mapper/baseReliability/ParamDataBasicDao.xml
+++ b/modules/mainPart/src/main/resources/mapper/baseReliability/ParamDataBasicDao.xml
@@ -26,9 +26,11 @@
WHEN b.product_type < 5 THEN
1 * 1 / basic_mtbf_regulate_tmp
WHEN a.reliab_distrib_type = 1 THEN
- 1 * a.basic_mtbf_operating_ratio / a.basic_mtbf_regulate_tmp
+ a.basic_unit_num * a.basic_mtbf_operating_ratio /
+ a.basic_mtbf_regulate_tmp
WHEN a.reliab_distrib_type = 3 THEN
- 1 * a.basic_mtbf_operating_ratio / a.basic_mtbf_regul_succ_rate
+ a.basic_unit_num * a.basic_mtbf_operating_ratio /
+ a.basic_mtbf_regul_succ_rate
ELSE 0 END
) AS WeightedFailure,
sum(
@@ -36,10 +38,10 @@
WHEN b.product_type < 5 THEN
1 * 1 * a.repair_mttcr / a.basic_mtbf_regulate_tmp
WHEN a.repairable = 1 and a.reliab_distrib_type = 1 THEN
- 1 * a.basic_mtbf_operating_ratio * a.repair_mttcr /
+ a.basic_unit_num * a.basic_mtbf_operating_ratio * a.repair_mttcr /
a.basic_mtbf_regulate_tmp
WHEN a.repairable = 1 and a.reliab_distrib_type = 3 THEN
- 1 * a.basic_mtbf_operating_ratio * a.repair_mttcr /
+ a.basic_unit_num * a.basic_mtbf_operating_ratio * a.repair_mttcr /
a.basic_mtbf_regul_succ_rate
ELSE 0
END
@@ -68,26 +70,29 @@
) c
) d
set f.basic_mtbf_regulate_tmp = d.basic_mtbf_regulate_tmp,
- f.repair_mttcr = d.repair_mttcr
+ f.repair_mttcr = d.repair_mttcr
where f.product_id = d.id;
</update>
<update id="compute1">
UPDATE param_data a, product_model b
SET repair_mttcr = 0
- where b.ship_id = ${shipId} and repair_mttcr is null;
+ where b.ship_id = ${shipId}
+ and repair_mttcr is null;
UPDATE param_data a, product_model b
SET basic_mtbf_regulate_tmp = basic_mtbf_regulate
where b.ship_id = ${shipId};
UPDATE param_data a, product_model b
- SET basic_mtbf_regulate_tmp = basic_runs_num /basic_mtbf_regul_succ_rate
- where b.ship_id = ${shipId} and reliab_distrib_type = 3
+ SET basic_mtbf_regulate_tmp = basic_runs_num / basic_mtbf_regul_succ_rate
+ where b.ship_id = ${shipId}
+ and reliab_distrib_type = 3
</update>
<update id="compute2">
UPDATE param_data a, product_model b
- SET basic_mtbf_regulate = basic_mtbf_regulate_tmp
- where b.ship_id = ${shipId} and (reliab_distrib_type = 1 or reliab_distrib_type is null);
+ SET basic_mtbf_regulate = basic_mtbf_regulate_tmp
+ where b.ship_id = ${shipId}
+ and (reliab_distrib_type = 1 or reliab_distrib_type is null);
UPDATE param_data a, product_model b
SET ai = basic_mtbf_regulate_tmp / (basic_mtbf_regulate_tmp + repair_mttcr)
diff --git a/modules/mainPart/src/main/resources/mapper/basicInfo/XhProductModelDao.xml b/modules/mainPart/src/main/resources/mapper/basicInfo/XhProductModelDao.xml
index 85de5ba..6355eb0 100644
--- a/modules/mainPart/src/main/resources/mapper/basicInfo/XhProductModelDao.xml
+++ b/modules/mainPart/src/main/resources/mapper/basicInfo/XhProductModelDao.xml
@@ -161,7 +161,7 @@
a.name,
a.product_type,
a.name_path,
- a.same_sb_name,
+ b.basic_unit_num as sameSbNum,
a.equip_type,
b.reliab_distrib_type,
b.basic_join_compute,
diff --git a/modules/mainPart/src/main/resources/mapper/taskReliability/SimulatAssessDao.xml b/modules/mainPart/src/main/resources/mapper/taskReliability/SimulatAssessDao.xml
index 2aa391c..870c6b1 100644
--- a/modules/mainPart/src/main/resources/mapper/taskReliability/SimulatAssessDao.xml
+++ b/modules/mainPart/src/main/resources/mapper/taskReliability/SimulatAssessDao.xml
@@ -27,18 +27,19 @@
<select id="getChildren" resultType="com.zt.life.modules.mainPart.taskReliability.dto.ProductStatusDto">
select *
from (
- SELECT f.id, f.name, 0 as sort
+ SELECT f.id, f.name, 0 as sort, 1 as sameSbNum
FROM product_model f
WHERE f.id = ${productId}
AND f.is_delete = 0
union
- SELECT f.id, f.name, f.sort
+ SELECT f.id, f.name, f.sort, g.basic_unit_num as sameSbNum
FROM `task_phase` a,
task_phase_model b,
operat_condit c,
operat_condit_model d,
model_rbd_node e,
- product_model f
+ product_model f,
+ param_data g
WHERE a.task_id = ${taskId}
and d.product_id = ${productId}
AND a.is_delete = 0
@@ -51,6 +52,8 @@
AND e.is_delete = 0
AND f.id = e.node_id
AND f.is_delete = 0
+ AND g.product_id = f.id
+ AND g.is_delete = 0
GROUP BY f.id, f.name, f.sort
) as f
ORDER BY f.sort
diff --git "a/modules/mainPart/src/main/resources/\344\272\247\345\223\201\347\273\223\346\236\204\346\240\221\345\257\274\345\207\272\346\250\241\346\235\277.xlsx" "b/modules/mainPart/src/main/resources/\344\272\247\345\223\201\347\273\223\346\236\204\346\240\221\345\257\274\345\207\272\346\250\241\346\235\277.xlsx"
index cfdd333..205a4a3 100644
--- "a/modules/mainPart/src/main/resources/\344\272\247\345\223\201\347\273\223\346\236\204\346\240\221\345\257\274\345\207\272\346\250\241\346\235\277.xlsx"
+++ "b/modules/mainPart/src/main/resources/\344\272\247\345\223\201\347\273\223\346\236\204\346\240\221\345\257\274\345\207\272\346\250\241\346\235\277.xlsx"
Binary files differ
diff --git a/web/src/views/modules/taskReliability/RBD-edit-img.vue b/web/src/views/modules/taskReliability/RBD-edit-img.vue
index accfeeb..9326360 100644
--- a/web/src/views/modules/taskReliability/RBD-edit-img.vue
+++ b/web/src/views/modules/taskReliability/RBD-edit-img.vue
@@ -928,8 +928,8 @@
for (let i = 1; i <= node.getData().basicUnitNum; i++) {
if (deviceNoArr.findIndex(item => item === i) === -1) {
no = i
- node.getData().deviceNo = i
if (node.getData().basicUnitNum>1){
+ node.getData().deviceNo = i
node.attr('text/text', node.attr('text/text') + '-' + i)
}
break
diff --git a/web/src/views/modules/taskReliability/SimulatAssess.vue b/web/src/views/modules/taskReliability/SimulatAssess.vue
index a864ee6..915cb2e 100644
--- a/web/src/views/modules/taskReliability/SimulatAssess.vue
+++ b/web/src/views/modules/taskReliability/SimulatAssess.vue
@@ -8,17 +8,20 @@
<zt-form-item label="鎬讳綋浠诲姟" prop="taskModelId">
<zt-select v-model="dataForm.taskModelId" :datas="taskList" @change="onTaskSelected"/>
</zt-form-item>
- <zt-form-item label="鏃堕棿鍒嗙墖" prop="samplPeriod">
- <el-input type="number" :min="1" v-model="dataForm.samplPeriod">
+ <zt-form-item label="鏃堕棿鍒嗙墖" prop="samplPeriod" >
+ <el-input type="number" :min="1" v-model="dataForm.samplPeriod" style="width: 150px;vertical-align: baseline;">
<template slot="append">鍒嗛挓</template>
</el-input>
</zt-form-item>
- <zt-form-item label="浠跨湡娆℃暟" prop="simulatFrequency">
- <el-input type="number" :min="1" v-model="dataForm.simulatFrequency">
+ <zt-form-item label="浠跨湡娆℃暟" prop="simulatFrequency" >
+ <el-input type="number" :min="1" v-model="dataForm.simulatFrequency" style="width: 150px;vertical-align: baseline;">
<template slot="append">娆℃暟</template>
</el-input>
</zt-form-item>
- <zt-form-item>
+ <el-form-item prop="repairDiracFlag" label-width="150px" style="margin-left: 20px">
+ <el-checkbox v-model="dataForm.repairDiracFlag">鍙慨璁惧鍙潬搴︿负1</el-checkbox>
+ </el-form-item>
+ <zt-form-item style="margin-left: 20px">
<zt-button @click="analyze()">浠跨湡鍒嗘瀽</zt-button>
</zt-form-item>
</el-form>
@@ -81,6 +84,7 @@
samplPeriod: '10',
simulatFrequency: 500,
simulatTime: '',
+ repairDiracFlag: false
},
dialogVisible: false,
modelCheckResult: [],
diff --git a/web/src/views/modules/taskReliability/SimulatHistory.vue b/web/src/views/modules/taskReliability/SimulatHistory.vue
index 842b32a..8a3bd42 100644
--- a/web/src/views/modules/taskReliability/SimulatHistory.vue
+++ b/web/src/views/modules/taskReliability/SimulatHistory.vue
@@ -97,7 +97,7 @@
onTreeSelected(data) {
if (this.dataForm.id) {
console.log(data, 'onProductSelected')
- this.dataForm.showProductId = data.id
+ this.dataForm.showProductId = data.dataId
this.$refs.SimulatCurve.getProductEcharts(this.dataForm);
}
},
--
Gitblit v1.9.1