From c0e3f24edd2ef47339c676ff3dc6fdc06b3c387e Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期五, 18 十月 2024 10:42:40 +0800
Subject: [PATCH] 1)修改bug:可靠性预计参数配置,可靠性分布类型下拉框缺少威布尔分布; 2)细化可靠性仿真评估报错信息。
---
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/SimulatAssessService.java | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 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 c95075e..f6132a6 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
@@ -612,8 +612,7 @@
List<TaskModelCheckResultDto> chkResult = taskService.checkTaskModel(simulatAssess.getProductId(),
simulatAssess.getTaskModelId());
if (chkResult.size() > 0) {
- result = Result.error("妯″瀷涓嶅畬鏁达紝璇锋鏌ユā鍨嬪畾涔夊強鍙傛暟閰嶇疆銆�");
-// result = Result.ok(chkResult);
+ result = Result.ok(chkResult);
return result;
}
@@ -634,7 +633,7 @@
try {
setParamToRedis(simulatAssess);
} catch (Exception e) {
- throw new RuntimeException("璁块棶Redis澶辫触銆傝妫�鏌edis鏄惁宸插惎鍔ㄣ��");
+ throw new RenException("璁块棶Redis澶辫触銆傝妫�鏌edis鏄惁宸插惎鍔ㄣ��");
}
Process process = null;
@@ -647,7 +646,7 @@
} else if (System.getProperty("os.name").toLowerCase().indexOf("linux") > -1) {
process = Runtime.getRuntime().exec(new String[]{"/bin/sh", "-c", command});
} else {
- throw new Exception("鏆備笉鏀寔璇ユ搷浣滅郴缁燂紝杩涜鍚姩绠楁硶搴撹绠楋紒");
+ throw new RenException("鏆備笉鏀寔璇ユ搷浣滅郴缁燂紝杩涜鍚姩绠楁硶搴撹绠楋紒");
}
is = process.getInputStream();
// 浠ュ懡浠よ鏂瑰紡璋冪敤绠楁硶搴撴椂锛屾帴鍙g害瀹氳繑鍥炵殑缁撴灉鏄痷tf-8缂栫爜
@@ -658,17 +657,17 @@
if (line != null) {
ReliaSimLibResult rtn = com.alibaba.fastjson.JSONObject.parseObject(line, ReliaSimLibResult.class);
if ("0".equals(rtn.getCode())) {
- logger.info("鍚姩绠楁硶搴撴垚鍔熴��");
+ logger.info("鍚姩鍙潬鎬т豢鐪熻瘎浼扮畻娉曞簱鎴愬姛銆�");
result = Result.ok();
} else {
String errorMsg = rtn.getErrorMsg();
- throw new RuntimeException("鍚姩绠楁硶搴撳け璐�: errorMsg=" + errorMsg);
+ throw new RenException("鍚姩鍙潬鎬т豢鐪熻瘎浼扮畻娉曞簱澶辫触: errorMsg=" + errorMsg);
}
}
- } catch (Exception e) {
- logger.error("鍚姩绠楁硶搴撲豢鐪熸椂鍙戠敓Exception锛�", e);
+ } catch (IOException e) {
+ logger.error("鍚姩鍙潬鎬т豢鐪熻瘎浼扮畻娉曞簱浠跨湡鏃跺彂鐢烢xception锛�", e);
e.printStackTrace();
- result = Result.error(e.getMessage());
+ throw new RenException("鍚姩鍙潬鎬т豢鐪熻瘎浼扮畻娉曞簱澶辫触: errorMsg=" + e.getMessage());
} finally {
if (is != null) {
try {
@@ -773,7 +772,7 @@
insert(simulatAssess);
} catch (Exception e) {
e.printStackTrace();
- throw new RuntimeException("缁勮绠楁硶搴撲豢鐪熻绠楃敤妯″瀷XML澶辫触: " + e.getMessage());
+ throw new RenException("缁勮绠楁硶搴撲豢鐪熻绠楃敤妯″瀷XML澶辫触: " + e.getMessage());
}
}
@@ -1113,7 +1112,8 @@
break;
case 3:
// 浜岄」鍒嗗竷
- if (taskBinoParam.getSimulatTimes().intValue() == taskBinoParam.getSuccessTimes().intValue()) {
+ if ((taskBinoParam.getSimulatTimes() == null && taskBinoParam.getSuccessTimes() == null) ||
+ (taskBinoParam.getSimulatTimes().intValue() == taskBinoParam.getSuccessTimes().intValue())) {
// 鐩哥瓑鍒欎负鎴愯触鍨�
failureModel.setType(FailureModel.TYPE_FIX);
failureModel.setParam1(taskBinoParam.getSuccessRate());
--
Gitblit v1.9.1