From 7351c1260470e9348ed6d33047ce18370d906d54 Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期二, 08 十月 2024 17:12:09 +0800
Subject: [PATCH] 修改
---
web/src/views/modules/basicInfo/XhProductModel.vue | 11 +
web/src/views/modules/taskReliability/TimeDiagram.vue | 6
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/ModelLineController.java | 1
web/src/views/modules/taskReliability/SchemeCompar.vue | 2
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/XhProductModelDao.java | 2
web/src/views/modules/baseReliability/ParamDataBasic.vue | 22 +++
web/src/views/modules/basicInfo/ParamData.vue | 12 -
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/baseReliability/dao/ParamDataBasicDao.java | 2
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/SimulatAssessService.java | 159 +++++++++++++++++++++++---
web/public/产品结构树导入模板.xlsx | 0
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java | 4
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/SimulatAssessController.java | 6
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/baseReliability/service/ParamDataBasicService.java | 1
modules/mainPart/src/main/resources/mapper/baseReliability/ParamDataBasicDao.xml | 45 +++++--
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java | 35 +++--
web/src/views/modules/taskReliability/SimulatCurve.vue | 4
16 files changed, 249 insertions(+), 63 deletions(-)
diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/baseReliability/dao/ParamDataBasicDao.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/baseReliability/dao/ParamDataBasicDao.java
index 668bcf3..5714ed4 100644
--- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/baseReliability/dao/ParamDataBasicDao.java
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/baseReliability/dao/ParamDataBasicDao.java
@@ -23,4 +23,6 @@
void compute(Long shipId,Integer productType);
void compute2(Long shipId);
+
+ void compute1(Long shipId);
}
diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/baseReliability/service/ParamDataBasicService.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/baseReliability/service/ParamDataBasicService.java
index 6868f9d..1dade4f 100644
--- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/baseReliability/service/ParamDataBasicService.java
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/baseReliability/service/ParamDataBasicService.java
@@ -46,6 +46,7 @@
}
public void compute(Long shipId) {
+ baseDao.compute1(shipId);
baseDao.compute(shipId, 4);
baseDao.compute(shipId, 3);
baseDao.compute(shipId, 2);
diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java
index e9b3576..9c43884 100644
--- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java
@@ -69,8 +69,8 @@
}
@GetMapping("tree")
- public Result<List<XhProductModel>> getTreeList(Boolean showXdy, Integer ztShow,Long productId) {
- List<XhProductModel> list = xhProductModelService.getAllTree(showXdy, ztShow,productId);
+ public Result<List<XhProductModel>> getTreeList(Boolean showXdy, Integer ztShow, Long productId) {
+ List<XhProductModel> list = xhProductModelService.getAllTree(showXdy, ztShow, productId);
return Result.ok(list);
}
@@ -120,6 +120,15 @@
return result;
}
+ @GetMapping("exportData")
+ @ApiOperation("瀵煎嚭浜у搧妯″瀷")
+ @LogOperation("瀵煎嚭浜у搧妯″瀷")
+ public Result exportDataExcel(Long shipId) {
+ xhProductModelService.exportDataExcel(shipId);
+
+ return null;
+ }
+
@PostMapping
@ApiOperation("鏂板")
@@ -132,12 +141,12 @@
if (xhProductModel.getSort() == null || xhProductModel.getSort() < no) {
xhProductModel.setSort(no + 1);
}
- if (xhProductModel.getProductType().equals("2")){
+ if (xhProductModel.getProductType().equals("2")) {
Long id = UUIDUtil.generateId();
xhProductModel.setId(id);
xhProductModel.setShipId(id);
- ParamData data =new ParamData();
+ ParamData data = new ParamData();
data.setShipId(id);
data.setProductId(id);
@@ -156,10 +165,10 @@
xhProductModel.setId(null);
xhProductModel.setSort(xhProductModel.getSort());
xhProductModel.setProductType(xhProductModel.getNodeType());
- if (xhProductModel.getNamePath()==null){
+ if (xhProductModel.getNamePath() == null) {
xhProductModel.setNamePath(xhProductModel.getName());
- }else{
- xhProductModel.setNamePath(xhProductModel.getNamePath()+","+xhProductModel.getName());
+ } else {
+ xhProductModel.setNamePath(xhProductModel.getNamePath() + "," + xhProductModel.getName());
}
this.insert(xhProductModel);
}
@@ -188,18 +197,18 @@
return Result.ok();
}
- private void deleteByProduct(Long[] ids){
- for(Long id : ids){
+ private void deleteByProduct(Long[] ids) {
+ for (Long id : ids) {
XhProductModel data = xhProductModelService.get(id);
- if (data.getProductType().equals("1")||data.getProductType().equals("3")||data.getProductType().equals("4")){
+ if (data.getProductType().equals("1") || data.getProductType().equals("3") || data.getProductType().equals("4")) {
xhProductModelService.deleteLogic(id);
/* List<Long> list =xhProductModelService.getByPid(id);
Long[] L = list.stream().toArray(Long[]::new);*/
- Long[] list =xhProductModelService.getByPid(id);
+ Long[] list = xhProductModelService.getByPid(id);
this.deleteByProduct(list);
- }else if(data.getProductType().equals("2")){
+ } else if (data.getProductType().equals("2")) {
xhProductModelService.deleteByShipId(data.getShipId());
- }else if(data.getProductType().equals("5")){
+ } else if (data.getProductType().equals("5")) {
xhProductModelService.deleteLogic(id);
}
}
diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/XhProductModelDao.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/XhProductModelDao.java
index 57671ea..932c99a 100644
--- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/XhProductModelDao.java
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/XhProductModelDao.java
@@ -42,4 +42,6 @@
void deleteByPid(Long id);
Long[] getByPid(Long id);
+
+ void getProductByShip(Long shipId);
}
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 f4ceb65..b62fc7b 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
@@ -413,4 +413,8 @@
public Long[] getByPid(Long id) {
return baseDao.getByPid(id);
}
+
+ public void exportDataExcel(Long shipId) {
+ baseDao.getProductByShip(shipId);
+ }
}
diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/ModelLineController.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/ModelLineController.java
index 4e53127..432d7b2 100644
--- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/ModelLineController.java
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/ModelLineController.java
@@ -127,6 +127,7 @@
return result ? Result.ok() : Result.error("瑙f瀽澶辫触");
}
+
@PostMapping("layout")
@ApiOperation("鑷姩鎺掔増")
@LogOperation("鑷姩鎺掔増")
diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/SimulatAssessController.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/SimulatAssessController.java
index 6b5e710..3b3c1ba 100644
--- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/SimulatAssessController.java
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/SimulatAssessController.java
@@ -107,8 +107,8 @@
}
@GetMapping("getStatus")
- public Result<String> getTimeDiagram(Long productId, Long taskId, Long fzId) {
- String data = simulatAssessService.getTimeDiagram(productId, taskId, fzId);
+ public Result<TimeDiagramDto> getTimeDiagram(Long productId, Long taskId, Long fzId, double smallWidth,double minPointNum) {
+ TimeDiagramDto data = simulatAssessService.getTimeDiagram(productId, taskId, fzId, smallWidth,minPointNum);
return Result.ok(data);
}
@@ -160,6 +160,8 @@
}
+
+
@PutMapping
@ApiOperation("淇敼")
@LogOperation("淇敼")
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 3f8a66d..909ede2 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
@@ -107,6 +107,7 @@
String templetStr = "{\"cells\":[]}";
Map<String, JSONObject> templetsMap = new HashMap<>();
Map<String, String> templetsStrMap = new HashMap<>();
+ Map<Integer, String> templetsStrMap2 = new HashMap<>();
private JSONObject xmlJSONObj;
@@ -150,7 +151,10 @@
return baseDao.getChildren(productId, taskId);
}
- public String getTimeDiagram(Long productId, Long taskId, Long fzId) {
+ public TimeDiagramDto getTimeDiagram(Long productId, Long taskId, Long fzId, double smallWidth, double minPointNum) {
+ TimeDiagramDto timeDiagramDto = new TimeDiagramDto();
+ timeDiagramDto.setSmallWidth(smallWidth);
+ timeDiagramDto.setMinPointNum(minPointNum);
String filePath = path + "/" + fzId + "/" + "status.json";
ObjectMapper mapper = new ObjectMapper();
String jsonStr = null;
@@ -189,26 +193,39 @@
double pointNumPerHour = 60.0 / simulatAssess.getSamplPeriod();
//鏃跺簭鍥剧嚎
+ List<List<TimeDiagramStatusDto>> lineArray = new ArrayList();
for (int i = 0; i < list.size(); i++) {
+ List<TimeDiagramStatusDto> statusDtoList = new ArrayList<>();
x1 = 0;
groupY = groupHeight * i;
ProductStatusDto dto = list.get(i);
double startTime = 0.0;
+ int status2 = 5;
for (StatusDto status : dto.getStatusList()) {
switch (status.getStatus()) {
case "O":
y = groupY;
+ status2 = 5;
break;
case "F":
y = groupY;// + spaceHeight;
+ status2 = 1;
break;
case "I":
+ y = groupY;// + spaceHeight;
+ status2 = 3;
+ break;
case "S":
+ y = groupY;// + spaceHeight;
+ status2 = 2;
+ break;
case "M":
y = groupY;// + 2 * spaceHeight;
+ status2 = 4;
break;
}
x2 = x1 + status.getTimes() * pointNumPerHour + 5;
+ statusDtoList.add(new TimeDiagramStatusDto(x1, x2, status2));
JSONObject lineJson = new JSONObject(templetsStrMap.get(status.getStatus()));
setlineXy(lineJson, x1, y, x2, y, "");
JsonUtils2.setJsonValueByPath(lineJson, "data/status".split("/"), status.getStatus());
@@ -219,6 +236,7 @@
x1 = x2 - 5;
jsonArray.add(lineJson);
}
+ lineArray.add(statusDtoList);
JSONObject textJson = new JSONObject(templetsStrMap.get("text"));
JsonUtils2.setJsonValueByPath(textJson, "id".split("/"), UUIDUtil.generateId().toString());
JsonUtils2.setJsonValueByPath(textJson, "attrs/label/textWrap/text".split("/"), dto.getName());
@@ -227,26 +245,12 @@
jsonArray.add(textJson);
}
- //鍥句緥
- int spaceWitdth = 80;
- x1 = -spaceWitdth;
- x2 = -11;
- y = -110;
- String[] tlArr = "O,F,I,S,M".split(",");
- for (String s : tlArr) {
- JSONObject f = templetsMap.get(s);
- x1 = x1 + spaceWitdth;
- x2 = x2 + spaceWitdth;
- setlineXy(f, x1, y, x2, y, null);
- jsonArray.add(f);
- }
-
//闃舵妯″瀷鍙婂埢搴�
x1 = 0;
x2 = 0;
- double y1 = -80;
- y = -60;
- double y2 = -50;
+ double y1 = -60;
+ y = -40;
+ double y2 = -30;
JSONObject modelJson = new JSONObject(templetsStrMap.get("model"));
setlineXy(modelJson, 1, y1, 1, y2, null);
@@ -288,6 +292,7 @@
jsonArray.add(textJson);
x1 = x2;
}
+
JSONObject modelJson3 = new JSONObject(templetsStrMap.get("model"));
setlineXy(modelJson3, 0, y, x2, y, null);
jsonArray.add(modelJson3);
@@ -315,9 +320,120 @@
curPointHour += periodHour;
}
+ timeDiagramDto.setTotalWidth(x2);
+ double pointRate = timeDiagramDto.getTotalWidth() / timeDiagramDto.getSmallWidth();
- return jsonObject.toString();
+ List<TimeDiagramStatusDto> subStatusDtoList = new ArrayList<>();
+ int lastStatus = 5;
+ boolean isFirst = true;
+ x1 = 0;
+ for (double i = 0; i < timeDiagramDto.getSmallWidth(); i = i + timeDiagramDto.getMinPointNum()) {
+ int netStatus = 5;
+ for (int j = 1; j < list.size(); j++) {
+ if (i >= 448) {
+ System.out.println(111);
+ }
+ int tmpStatus = getPointStatus(lineArray.get(j), i * pointRate, (i + timeDiagramDto.getMinPointNum()) * pointRate - 1);
+ if (tmpStatus < netStatus) {
+ netStatus = tmpStatus;
+ }
+ }
+ if (!isFirst) {
+ if (lastStatus != netStatus) {
+ subStatusDtoList.add(new TimeDiagramStatusDto(x1, x2, lastStatus));
+ lastStatus = netStatus;
+ x1 = i;
+ }
+ } else {
+ lastStatus = netStatus;
+ isFirst = false;
+ }
+ x2 = i + timeDiagramDto.getMinPointNum() - 1;
+ }
+ subStatusDtoList.add(new TimeDiagramStatusDto(x1, x2, lastStatus));
+
+ List<TimeDiagramStatusDto> parentStatusDtoList = new ArrayList<>();
+ lastStatus = 5;
+ isFirst = true;
+ x1 = 0;
+ for (double i = 0; i < timeDiagramDto.getSmallWidth(); i = i + timeDiagramDto.getMinPointNum()) {
+ if (i >= 448) {
+ System.out.println(111);
+ }
+ int netStatus = getPointStatus(lineArray.get(0), i * pointRate, (i + timeDiagramDto.getMinPointNum()) * pointRate - 1);
+ if (!isFirst) {
+ if (lastStatus != netStatus) {
+ parentStatusDtoList.add(new TimeDiagramStatusDto(x1, x2, lastStatus));
+ lastStatus = netStatus;
+ x1 = i;
+ }
+ } else {
+ lastStatus = netStatus;
+ isFirst = false;
+ }
+ x2 = i + timeDiagramDto.getMinPointNum() - 1;
+ }
+ parentStatusDtoList.add(new TimeDiagramStatusDto(x1, x2, lastStatus));
+
+ JSONObject jsonObject2 = new JSONObject(templetStr);
+ JSONArray jsonArray2 = jsonObject2.getJSONArray("cells");
+ List<List<TimeDiagramStatusDto>> smallStatusDtoList = new ArrayList<>();
+ smallStatusDtoList.add(parentStatusDtoList);
+ smallStatusDtoList.add(subStatusDtoList);
+
+ y = 10;
+ for (int i = 0; i < smallStatusDtoList.size(); i++) {
+ for (TimeDiagramStatusDto status : smallStatusDtoList.get(i)) {
+ JSONObject lineJson = new JSONObject(templetsStrMap2.get(status.getStatus()));
+ setlineXy(lineJson, status.getX1(), y, status.getX2(), y, "");
+ JsonUtils2.setJsonValueByPath(lineJson, "data/status".split("/"), status.getStatus());
+ JsonUtils2.setJsonValueByPath(lineJson, "id".split("/"), UUIDUtil.generateId().toString());
+ jsonArray2.add(lineJson);
+ }
+ y = y + 20;
+ }
+
+ //鍥句緥
+ int spaceWitdth = 80;
+ x1 = 0;
+ x2 = spaceWitdth - 11;
+ String[] tlArr = "O,F,I,S,M".split(",");
+ for (String s : tlArr) {
+ JSONObject f = templetsMap.get(s);
+ x1 = x1 + spaceWitdth;
+ x2 = x2 + spaceWitdth;
+ setlineXy(f, x1, y, x2, y, null);
+ jsonArray2.add(f);
+ }
+ timeDiagramDto.setDiagramJson(jsonObject.toString());
+ timeDiagramDto.setSmallDiagramJson(jsonObject2.toString());
+
+ return timeDiagramDto;
}
+
+ private int getPointStatus(List<TimeDiagramStatusDto> dtoList, double x1, double x2) {
+ int status = 5;
+ boolean findStart = false;
+ for (int i = 0; i < dtoList.size(); i++) {
+ if (x2 <= dtoList.get(i).getX1()) {
+ break;
+ }
+
+ if (!findStart) {
+ if (dtoList.get(i).getX1() >= x1 && x1 <= dtoList.get(i).getX2()) {
+ status = dtoList.get(i).getStatus();
+ findStart = true;
+ }
+ }
+
+ if (dtoList.get(i).getX2() >= x2) {
+ if (dtoList.get(i).getStatus() < status)
+ status = dtoList.get(i).getStatus();
+ }
+ }
+ return status;
+ }
+
public void setlineXy(JSONObject lineJson, double x1, double y1, double x2, double y2, String text) {
JsonUtils2.setJsonValueByPath(lineJson, "source/x".split("/"), x1);
@@ -349,22 +465,27 @@
if ("杩愯".equals(nodeMarker)) {
templetsMap.put("O", jsonObject);
templetsStrMap.put("O", jsonObject.toString());
+ templetsStrMap2.put(5, jsonObject.toString());
}
if ("鏁呴殰".equals(nodeMarker)) {
templetsMap.put("F", jsonObject);
templetsStrMap.put("F", jsonObject.toString());
+ templetsStrMap2.put(1, jsonObject.toString());
}
if ("绌洪棽".equals(nodeMarker)) {
templetsMap.put("I", jsonObject);
templetsStrMap.put("I", jsonObject.toString());
+ templetsStrMap2.put(3, jsonObject.toString());
}
if ("澶囦唤".equals(nodeMarker)) {
templetsMap.put("S", jsonObject);
templetsStrMap.put("S", jsonObject.toString());
+ templetsStrMap2.put(2, jsonObject.toString());
}
if ("鏈敤".equals(nodeMarker)) {
templetsMap.put("M", jsonObject);
templetsStrMap.put("M", jsonObject.toString());
+ templetsStrMap2.put(4, jsonObject.toString());
}
if ("妯″瀷".equals(nodeMarker)) {
JsonUtils2.setJsonValueByPath(tmpJSONObject, "attrs/text/text".split("/"), "");
diff --git a/modules/mainPart/src/main/resources/mapper/baseReliability/ParamDataBasicDao.xml b/modules/mainPart/src/main/resources/mapper/baseReliability/ParamDataBasicDao.xml
index d35bb9e..9f9eb6e 100644
--- a/modules/mainPart/src/main/resources/mapper/baseReliability/ParamDataBasicDao.xml
+++ b/modules/mainPart/src/main/resources/mapper/baseReliability/ParamDataBasicDao.xml
@@ -11,7 +11,7 @@
AND WeightedFailure > 0 THEN
1 / WeightedFailure
ELSE 0
- END AS basic_mtbf_regulate,
+ END AS basic_mtbf_regulate_tmp,
CASE
WHEN WeightedFailure IS NOT NULL
AND WeightedFailure > 0 THEN
@@ -24,21 +24,21 @@
sum(
CASE
WHEN b.product_type < 5 THEN
- 1 * 1 / basic_mtbf_regulate
+ 1 * 1 / basic_mtbf_regulate_tmp
WHEN a.reliab_distrib_type = 1 THEN
- 1 * a.basic_mtbf_operating_ratio / a.basic_mtbf_regulate
- WHEN a.reliab_distrib_type = 2 THEN
+ 1 * 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
ELSE 0 END
) AS WeightedFailure,
sum(
CASE
WHEN b.product_type < 5 THEN
- 1 * 1 * a.repair_mttcr / a.basic_mtbf_regulate
+ 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_mtbf_regulate
- WHEN a.repairable = 1 and a.reliab_distrib_type = 2 THEN
+ 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_mtbf_regul_succ_rate
ELSE 0
@@ -59,23 +59,40 @@
AND ((b.product_type = 5 AND a.basic_join_compute = 1
and ((
a.reliab_distrib_type = 1
- AND a.basic_mtbf_regulate > 0
+ AND a.basic_mtbf_regulate_tmp > 0
)
- OR (a.reliab_distrib_type = 2 AND a.basic_mtbf_regul_succ_rate > 0))
+ OR (a.reliab_distrib_type = 3 AND a.basic_mtbf_regul_succ_rate > 0))
)
- || (b.product_type < 5 AND a.basic_mtbf_regulate > 0))
+ || (b.product_type < 5 AND a.basic_mtbf_regulate_tmp > 0))
GROUP BY c.id, c.name
) c
) d
- set f.basic_mtbf_regulate = d.basic_mtbf_regulate,
+ set f.basic_mtbf_regulate_tmp = d.basic_mtbf_regulate_tmp,
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;
+ 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
+ </update>
+
<update id="compute2">
UPDATE param_data a, product_model b
- SET ai = basic_mtbf_regulate / (basic_mtbf_regulate + repair_mttcr)
+ 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)
where b.ship_id = ${shipId}
+
</update>
<select id="getAI" resultType="com.zt.life.modules.mainPart.basicInfo.model.ParamData">
@@ -85,7 +102,9 @@
b.ai,
b.basic_mtbf_regulate,
b.repair_mttcr,
- b.basic_mtbf_operating_ratio
+ b.basic_mtbf_operating_ratio,
+ b.basic_mtbf_regul_succ_rate,
+ b.basic_runs_num
FROM product_model a
LEFT JOIN param_data b ON b.product_id = a.id and b.is_delete = 0
where a.is_delete = 0
diff --git "a/web/public/\344\272\247\345\223\201\347\273\223\346\236\204\346\240\221\345\257\274\345\205\245\346\250\241\346\235\277.xlsx" "b/web/public/\344\272\247\345\223\201\347\273\223\346\236\204\346\240\221\345\257\274\345\205\245\346\250\241\346\235\277.xlsx"
index 5fcba44..16e9415 100644
--- "a/web/public/\344\272\247\345\223\201\347\273\223\346\236\204\346\240\221\345\257\274\345\205\245\346\250\241\346\235\277.xlsx"
+++ "b/web/public/\344\272\247\345\223\201\347\273\223\346\236\204\346\240\221\345\257\274\345\205\245\346\250\241\346\235\277.xlsx"
Binary files differ
diff --git a/web/src/views/modules/baseReliability/ParamDataBasic.vue b/web/src/views/modules/baseReliability/ParamDataBasic.vue
index 11869d5..81726fd 100644
--- a/web/src/views/modules/baseReliability/ParamDataBasic.vue
+++ b/web/src/views/modules/baseReliability/ParamDataBasic.vue
@@ -39,6 +39,16 @@
<span>{{ keepNumber(scope.row.repairMttcr) }}</span>
</template>
</el-table-column>
+ <el-table-column prop="basicMtbfRegulSuccRate" label="鎴愬姛鐜�" align="right">
+ <template slot-scope="scope">
+ <span>{{keepNumber(scope.row.basicMtbfRegulSuccRate) }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column prop="basicRunsNum" label="杩愯娆℃暟" align="right">
+ <template slot-scope="scope">
+ <span>{{scope.row.basicRunsNum}}</span>
+ </template>
+ </el-table-column>
<el-table-column prop="basicMtbfOperatingRatio" label="杩愯姣�" align="right">
<template slot-scope="scope">
<span>{{keepNumber(scope.row.basicMtbfOperatingRatio) }}</span>
@@ -68,7 +78,9 @@
basicMtbfRegulate: '',
repairMttcr: '',
basicMtbfOperatingRatio: '',
- ai: ''
+ ai: '',
+ basicMtbfRegulSuccRate:'',
+ basicRunsNum:''
},
defultKey: []
}
@@ -79,8 +91,12 @@
computed: {
keepNumber() { //杩囨护鍣ㄤ繚鐣�4涓哄皬鏁�
return function (val) { // 瀵硅绠楀睘鎬ц繘琛屼紶鍙�
- const numM = Number(val).toFixed(5);
- return numM.substring(0, numM.length - 1);
+ let numM = 0.0
+ if (val){
+ numM = Number(val).toFixed(4);
+ numM.substring(0, numM.length - 1)
+ }
+ return numM;
}
},
},
diff --git a/web/src/views/modules/basicInfo/ParamData.vue b/web/src/views/modules/basicInfo/ParamData.vue
index 3b04333..fe90112 100644
--- a/web/src/views/modules/basicInfo/ParamData.vue
+++ b/web/src/views/modules/basicInfo/ParamData.vue
@@ -120,12 +120,12 @@
<span v-else v-text="scope.row.basicMtbfAcceptSuccRate"></span>
</template>
</el-table-column>-->
- <el-table-column prop="basicUnitNum" label="鍗曞厓鏁伴噺" :key="11" width="100" align="center">
+ <!-- <el-table-column prop="basicUnitNum" label="鍗曞厓鏁伴噺" :key="11" width="100" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.isEdit" v-model="scope.row.basicUnitNum"></el-input>
<span v-else v-text="scope.row.basicUnitNum"></span>
</template>
- </el-table-column>
+ </el-table-column>-->
<el-table-column prop="basicRunsNum" label="杩愯娆℃暟" :key="12" width="100" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.isEdit" v-model="scope.row.basicRunsNum"></el-input>
@@ -336,13 +336,9 @@
value: 1,
label: '鎸囨暟鍒嗗竷'
}, {
- value: 2,
- label: '浜岄」鍒嗗竷'
- },
- {
value: 3,
- label: '濞佸竷灏斿垎甯�'
- },
+ label: '浜岄」鍒嗗竷'
+ }
],
// editingCell:null,
dataList: [],
diff --git a/web/src/views/modules/basicInfo/XhProductModel.vue b/web/src/views/modules/basicInfo/XhProductModel.vue
index 5fba66b..3673ff5 100644
--- a/web/src/views/modules/basicInfo/XhProductModel.vue
+++ b/web/src/views/modules/basicInfo/XhProductModel.vue
@@ -45,6 +45,9 @@
<zt-table-button v-if="productType==='1'" size="small" type="primary"
@click="importData(row)">瀵煎叆
</zt-table-button>
+ <zt-table-button v-if="productType==='1'" size="small" type="primary"
+ @click="exportData(row)">瀵煎嚭
+ </zt-table-button>
</template>
</zt-table-column-handle>
</el-table>
@@ -142,6 +145,14 @@
importData(row) {
this.$refs.ProductImport.$refs.dialog.init(row)
},
+ async exportData(row) {
+ let params = {
+ shipId:row.id
+ }
+ let res = await this.$http.get(`/basicInfo/XhProductModel/exportData`,{params:params})
+
+
+ },
exportProduct() {
window.location.href = './浜у搧缁撴瀯鏍戝鍏ユā鏉�.xlsx'
},
diff --git a/web/src/views/modules/taskReliability/SchemeCompar.vue b/web/src/views/modules/taskReliability/SchemeCompar.vue
index ca52f87..6504887 100644
--- a/web/src/views/modules/taskReliability/SchemeCompar.vue
+++ b/web/src/views/modules/taskReliability/SchemeCompar.vue
@@ -35,7 +35,7 @@
</el-table-column>
<el-table-column
prop="mtbf"
- label="MTBF"
+ label="MTTF"
width="100px"
align="right">
<template slot-scope="scope">
diff --git a/web/src/views/modules/taskReliability/SimulatCurve.vue b/web/src/views/modules/taskReliability/SimulatCurve.vue
index 063cc18..835cab1 100644
--- a/web/src/views/modules/taskReliability/SimulatCurve.vue
+++ b/web/src/views/modules/taskReliability/SimulatCurve.vue
@@ -36,7 +36,7 @@
}
this.option = {
title: {
- text: "mtbf:" + this.mtbf + " mttr:" + this.mttr + " msr:" + this.msr,
+ text: "mttf:" + this.mtbf + " mttr:" + this.mttr + " msr:" + this.msr,
textStyle: { // 涓绘爣棰樻枃鏈牱寮弡"fontSize": 18,"fontWeight": "bolder","color": "#333"}
fontFamily: 'Arial',
fontSize: 30,
@@ -94,7 +94,7 @@
}
this.option = {
title: {
- text: "mtbf:" + this.mtbf + " mttr:" + this.mttr + " msr:" + this.msr,
+ text: "mttf:" + this.mtbf + " mttr:" + this.mttr + " msr:" + this.msr,
textStyle: { // 涓绘爣棰樻枃鏈牱寮弡"fontSize": 18,"fontWeight": "bolder","color": "#333"}
fontFamily: 'Arial',
fontSize: 30,
diff --git a/web/src/views/modules/taskReliability/TimeDiagram.vue b/web/src/views/modules/taskReliability/TimeDiagram.vue
index ca52c0e..0a3dc6d 100644
--- a/web/src/views/modules/taskReliability/TimeDiagram.vue
+++ b/web/src/views/modules/taskReliability/TimeDiagram.vue
@@ -583,11 +583,13 @@
let params = {
productId: this.dataForm.productId,
taskId: this.dataForm.taskModelId,
- fzId: this.dataForm.id
+ fzId: this.dataForm.id,
+ smallWidth:1000,
+ minPointNum:5
}
let res = await this.$http.get('/taskReliability/SimulatAssess/getStatus', {params: params})
if (res.data !== null) {
- this.diagramJson = JSON.parse(res.data)
+ this.diagramJson = JSON.parse(res.data.smallDiagramJson)
console.log(this.diagramJson, 'this.Diagram json')
this.graph.fromJSON(this.diagramJson)
this.graph.centerContent()
--
Gitblit v1.9.1