From 38d87eb232eadb24fdcc7602609a6ec3592df7bd Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期三, 07 八月 2024 15:52:37 +0800
Subject: [PATCH] 修改

---
 modules/mainPart/src/main/java/com/zt/life/modules/mainPart/TestScheme/dao/TestSchemeDao.java                       |   23 +
 web/src/views/modules/taskReliability/TimeDiagramTemp.vue                                                           |  128 ---------
 modules/mainPart/src/main/java/com/zt/life/modules/mainPart/TestScheme/service/TestSchemeService.java               |  188 ++++++++++++++
 web/src/views/modules/taskReliability/PlanMake.vue                                                                  |  174 +++++++++++++
 modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/ModelLineController.java     |   22 -
 modules/mainPart/src/main/java/com/zt/life/modules/mainPart/TestScheme/model/TestScheme.java                        |   33 ++
 modules/mainPart/src/main/java/com/zt/life/modules/mainPart/TestScheme/controller/TestSchemeController.java         |  104 ++++++++
 modules/mainPart/src/main/java/com/zt/life/modules/mainPart/TestScheme/dto/ResultDto.java                           |   28 ++
 modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/ModelLineService.java           |    2 
 web/src/views/modules/taskReliability/ConfigEdge/configEdge.vue                                                     |    1 
 modules/mainPart/src/main/resources/mapper/TestScheme/TestSchemeDao.xml                                             |   12 
 modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/SimulatAssessController.java |    9 
 modules/mainPart/src/main/java/com/zt/life/modules/mainPart/TestScheme/dto/ConditionDto.java                        |   15 +
 13 files changed, 584 insertions(+), 155 deletions(-)

diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/TestScheme/controller/TestSchemeController.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/TestScheme/controller/TestSchemeController.java
new file mode 100644
index 0000000..549e0cd
--- /dev/null
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/TestScheme/controller/TestSchemeController.java
@@ -0,0 +1,104 @@
+package com.zt.life.modules.mainPart.TestScheme.controller;
+
+
+import com.zt.common.annotation.LogOperation;
+import com.zt.common.constant.Constant;
+import com.zt.common.annotation.QueryParam;
+import com.zt.common.db.query.QueryFilter;
+import com.zt.common.servlet.Result;
+import com.zt.common.servlet.PageResult;
+import com.zt.common.validator.AssertUtils;
+import com.zt.common.validator.ValidatorUtils;
+import com.zt.common.validator.group.AddGroup;
+import com.zt.common.validator.group.DefaultGroup;
+import com.zt.common.validator.group.UpdateGroup;
+import com.zt.life.modules.mainPart.TestScheme.dto.ConditionDto;
+import com.zt.life.modules.mainPart.TestScheme.dto.ResultDto;
+import com.zt.life.modules.mainPart.TestScheme.model.TestScheme;
+import com.zt.life.modules.mainPart.TestScheme.service.TestSchemeService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import java.util.List;
+
+
+/**
+ * test_scheme
+ *
+ * @author zt generator 
+ * @since 1.0.0 2024-08-07
+ */
+@RestController
+@RequestMapping("/TestScheme/TestScheme/")
+@Api(tags="test_scheme")
+public class TestSchemeController {
+    @Autowired
+    private TestSchemeService testSchemeService;
+
+    @GetMapping("page")
+    @ApiOperation("鍒嗛〉")
+    @ApiImplicitParams({
+        @ApiImplicitParam(name = Constant.Q.PAGE, value = Constant.QV.PAGE, required = true, dataType = Constant.QT.INT),
+        @ApiImplicitParam(name = Constant.Q.LIMIT, value = Constant.QV.LIMIT, required = true, dataType = Constant.QT.INT),
+        @ApiImplicitParam(name = Constant.Q.ORDER_FIELD, value = Constant.QV.ORDER_FIELD, dataType = Constant.QT.STRING),
+        @ApiImplicitParam(name = Constant.Q.ORDER, value = Constant.QV.ORDER, dataType = Constant.QT.STRING),
+    })
+    public PageResult<TestScheme> page(@ApiIgnore @QueryParam QueryFilter queryFilter){
+
+        return PageResult.ok(null);
+    }
+
+    @GetMapping("{id}")
+    @ApiOperation("淇℃伅")
+    public Result<TestScheme> get(@PathVariable("id") Long id){
+        TestScheme data = testSchemeService.get(id);
+
+        return Result.ok(data);
+    }
+
+    @GetMapping("condition")
+    public Result<List<ResultDto>> getResult1(ConditionDto dto){
+        List<ResultDto> data = testSchemeService.getResult(dto);
+
+        return Result.ok(data);
+    }
+
+    @PostMapping
+    @ApiOperation("鏂板")
+    @LogOperation("鏂板")
+    public Result insert(@RequestBody TestScheme testScheme){
+        //鏁堥獙鏁版嵁
+        ValidatorUtils.validateEntity(testScheme, AddGroup.class, DefaultGroup.class);
+        testSchemeService.insert(testScheme);
+
+        return Result.ok();
+    }
+
+    @PutMapping
+    @ApiOperation("淇敼")
+    @LogOperation("淇敼")
+    public Result update(@RequestBody TestScheme testScheme){
+        //鏁堥獙鏁版嵁
+        ValidatorUtils.validateEntity(testScheme, UpdateGroup.class, DefaultGroup.class);
+        testSchemeService.update(testScheme);
+
+        return Result.ok();
+    }
+
+    @DeleteMapping
+    @ApiOperation("鍒犻櫎")
+    @LogOperation("鍒犻櫎")
+    public Result delete(@RequestBody Long[] ids){
+        //鏁堥獙鏁版嵁
+        AssertUtils.isArrayEmpty(ids, "id");
+        testSchemeService.delete(ids);
+
+        return Result.ok();
+    }
+
+}
diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/TestScheme/dao/TestSchemeDao.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/TestScheme/dao/TestSchemeDao.java
new file mode 100644
index 0000000..5a2b9e1
--- /dev/null
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/TestScheme/dao/TestSchemeDao.java
@@ -0,0 +1,23 @@
+package com.zt.life.modules.mainPart.TestScheme.dao;
+
+import com.zt.common.dao.BaseDao;
+import com.zt.life.modules.mainPart.TestScheme.model.TestScheme;
+import org.apache.ibatis.annotations.Mapper;
+
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * test_scheme
+ *
+ * @author zt generator 
+ * @since 1.0.0 2024-08-07
+ */
+@Mapper
+public interface TestSchemeDao extends BaseDao<TestScheme> {
+
+    List<TestScheme> getList();
+
+}
diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/TestScheme/dto/ConditionDto.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/TestScheme/dto/ConditionDto.java
new file mode 100644
index 0000000..909a23a
--- /dev/null
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/TestScheme/dto/ConditionDto.java
@@ -0,0 +1,15 @@
+package com.zt.life.modules.mainPart.TestScheme.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class ConditionDto {
+
+    private String tjlx;
+    private Double specifiedValue;
+    private Double minAccepValue;
+    private Double productionRisk;
+    private Double userRisk;
+    private Integer showFailureTime;
+}
diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/TestScheme/dto/ResultDto.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/TestScheme/dto/ResultDto.java
new file mode 100644
index 0000000..34643e9
--- /dev/null
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/TestScheme/dto/ResultDto.java
@@ -0,0 +1,28 @@
+package com.zt.life.modules.mainPart.TestScheme.dto;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.zt.common.entity.BusiEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+
+@Data
+public class ResultDto {
+
+	@ApiModelProperty(value = "")
+	private int acceptNumber;
+
+	@ApiModelProperty(value = "")
+	private String totalTestTime;
+
+	@ApiModelProperty(value = "")
+	private String number;
+
+	@ApiModelProperty(value = "")
+	private String productionRiskReal;
+
+	@ApiModelProperty(value = "")
+	private String userRiskReal;
+
+}
diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/TestScheme/model/TestScheme.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/TestScheme/model/TestScheme.java
new file mode 100644
index 0000000..aa0ab64
--- /dev/null
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/TestScheme/model/TestScheme.java
@@ -0,0 +1,33 @@
+package com.zt.life.modules.mainPart.TestScheme.model;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.zt.common.entity.BusiEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * test_scheme
+ *
+ * @author zt generator 
+ * @since 1.0.0 2024-08-07
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("test_scheme")
+public class TestScheme extends BusiEntity {
+	private static final long serialVersionUID = 1L;
+
+	@ApiModelProperty(value = "")
+	private Integer pc;
+
+	@ApiModelProperty(value = "")
+	private Double pa;
+
+	@ApiModelProperty(value = "")
+	private Double value;
+
+}
diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/TestScheme/service/TestSchemeService.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/TestScheme/service/TestSchemeService.java
new file mode 100644
index 0000000..e39eb41
--- /dev/null
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/TestScheme/service/TestSchemeService.java
@@ -0,0 +1,188 @@
+package com.zt.life.modules.mainPart.TestScheme.service;
+
+import com.zt.common.service.BaseService;
+import com.zt.life.modules.mainPart.TestScheme.dao.TestSchemeDao;
+import com.zt.life.modules.mainPart.TestScheme.dto.ConditionDto;
+import com.zt.life.modules.mainPart.TestScheme.dto.ResultDto;
+import com.zt.life.modules.mainPart.TestScheme.model.TestScheme;
+import org.springframework.stereotype.Service;
+import com.zt.common.db.query.QueryFilter;
+
+import java.util.ArrayList;
+import java.util.Formatter;
+import java.util.List;
+import java.util.stream.Collectors;
+
+
+/**
+ * test_scheme
+ *
+ * @author zt generator
+ * @since 1.0.0 2024-08-07
+ */
+@Service
+public class TestSchemeService extends BaseService<TestSchemeDao, TestScheme> {
+
+    /**
+     * 鍒嗛〉鏌ヨ
+     *
+     * @param queryFilter
+     * @return
+     */
+   /* public List<TestScheme> page(QueryFilter queryFilter) {
+        return baseDao.getList(queryFilter.getQueryParams());
+    }
+*/
+
+    /**
+     * 鍒犻櫎
+     *
+     * @param ids
+     */
+    public void delete(Long[] ids) {
+        super.deleteLogic(ids);
+    }
+
+    public List<ResultDto> getResult(ConditionDto dto) {
+        List<ResultDto> result = new ArrayList<>();
+        List<TestScheme> list = baseDao.getList();
+        if (dto.getTjlx().equals("鏉′欢1")) {
+            result = this.getCondition1(dto, list);
+        } else if (dto.getTjlx().equals("鏉′欢2")) {
+            result = this.getCondition2(dto, list);
+        } else if (dto.getTjlx().equals("鏉′欢3")) {
+            result = this.getCondition3(dto, list);
+        }
+        return result;
+    }
+
+    private List<ResultDto> getCondition1(ConditionDto dto, List<TestScheme> list) {
+        List<ResultDto> result = new ArrayList<>();
+        int C = 0;
+        double oldvalue = 0;
+        for (int i = 1; i <= 10; i++) {
+            Integer finalI = i;
+            TestScheme data1 = list.stream().filter(k -> k.getPa().equals(dto.getUserRisk()) && k.getPc() == (2 * finalI + 2)).findFirst().get();//
+            TestScheme data2 = list.stream().filter(k -> k.getPa().equals(1 - dto.getUserRisk()) && k.getPc() == (2 * finalI + 2)).findFirst().get();//
+            if (data1 != null && data2 != null) {
+                Double value = data2.getValue() / data1.getValue();
+                double strate = dto.getMinAccepValue() / dto.getSpecifiedValue();
+
+                if (value >= strate) {
+                    C = i;
+                    if (strate - oldvalue < value - strate)
+                        C = i - 1;
+                    break;
+                }
+                oldvalue = value;
+            }
+        }
+
+        double T = 0;     //鎬昏瘯楠屾椂闂�
+        double TST1 = 0;  //T/胃1
+        double TST0 = 0;  //T/胃0
+        Integer finalC = C;
+        TestScheme data3 = list.stream().filter(k -> k.getPa().equals(1 - dto.getUserRisk()) && k.getPc() == (2 * finalC + 2)).findFirst().get();//
+        if (data3 != null) {
+            TST1 = data3.getValue() / 2; //T/胃1
+            //TST1 = Convert.ToDouble(TST1.ToString("G2")); //鍙栦袱浣嶆湁鏁堟暟瀛�
+            if (TST1 < 10) TST1 = TST1 + 0.1;
+            T = TST1 * dto.getMinAccepValue();  //鎬昏瘯楠屾椂闂�
+            TST0 = T / dto.getSpecifiedValue(); //T/胃0    TST1 * minAccepValue / specifiedValue
+        }
+
+        double productionRisk = 0;  //鐢熶骇鏂归闄╁疄闄呭��
+        double userRisk = 0;        //浣跨敤鏂归闄╁疄闄呭��
+        double e = 2.71828182845904523536;  //鑷劧鏁癳
+
+        for (int r = 0; r <= C; r++) {
+            productionRisk = productionRisk + Math.pow(TST0, r) * Math.pow(e, -TST0) / getjc(r);
+            userRisk = userRisk + Math.pow(TST1, r) * Math.pow(e, -TST1) / getjc(r);
+        }
+        ResultDto resultDto = new ResultDto();
+        productionRisk = 1 - productionRisk;
+        resultDto.setAcceptNumber(C);
+        resultDto.setTotalTestTime(String.valueOf(Math.round(T)));
+        resultDto.setProductionRiskReal(new Formatter().format("%.2f", productionRisk * 100).toString());
+        resultDto.setUserRiskReal(new Formatter().format("%.2f", userRisk * 100).toString());
+        result.add(resultDto);
+        return result;
+    }
+
+    public List<ResultDto> getCondition2(ConditionDto dto, List<TestScheme> list) {
+        List<ResultDto> result = new ArrayList<>();
+        for (Integer i = 0; i < dto.getShowFailureTime(); i++) {
+            Integer finalI = i;
+            List<TestScheme> data = list.stream().filter(k -> k.getPa().equals(dto.getUserRisk()) && k.getPc() == (2 * finalI + 2)).collect(Collectors.toList());//
+            ResultDto resultDto = new ResultDto();
+            double T = 0;
+            double TST1 = 0; //  T/胃1
+            double TST0 = 0;//  T/胃0
+            for (TestScheme item : data) {
+                TST1 = item.getValue() / 2;
+                T = TST1 * dto.getMinAccepValue();
+                TST0 = T / dto.getSpecifiedValue(); //  T/胃0
+            }
+            double productionRisk = 0;
+            double userRisk = 0;
+            double e = 2.71828182845904523536;
+            for (int r = 0; r <= i; r++) {
+                productionRisk = productionRisk + Math.pow(TST0, r) * Math.pow(e, -TST0) / getjc(r);
+                userRisk = userRisk + Math.pow(TST1, r) * Math.pow(e, -TST1) / getjc(r);
+            }
+            productionRisk = 1 - productionRisk;
+
+            resultDto.setAcceptNumber(i + 1);
+            resultDto.setTotalTestTime(String.valueOf(Math.round(T)));
+            resultDto.setProductionRiskReal(new Formatter().format("%.2f", productionRisk * 100).toString());
+            resultDto.setUserRiskReal(new Formatter().format("%.2f", userRisk * 100).toString());
+            result.add(resultDto);
+        }
+        return result;
+    }
+
+    private List<ResultDto> getCondition3(ConditionDto dto, List<TestScheme> list) {
+        List<ResultDto> result = new ArrayList<>();
+        for (int i = 0; i <= dto.getShowFailureTime(); i++) {
+            Integer finalI = i;
+            List<TestScheme> data = list.stream().filter(k -> k.getPa().equals(dto.getUserRisk()) && k.getPc() == (2 * finalI + 2)).collect(Collectors.toList());//
+            List<TestScheme> data2 = list.stream().filter(k -> k.getPa().equals(1 - dto.getProductionRisk()) && k.getPc() == (2 * finalI + 2)).collect(Collectors.toList());//
+            double T = 0;
+            double TST1 = 0; //  T/胃1
+            double TST0 = 0;//  T/胃0
+            double ST0 = 0; // 胃0
+            for (TestScheme item : data) {
+                TST1 = item.getValue() / 2;
+                T = TST1 * dto.getMinAccepValue();
+                for (TestScheme item2 : data2) {
+                    ST0 = item.getValue() * dto.getMinAccepValue() / item2.getValue();
+                }
+                TST0 = T / ST0;
+            }
+
+            double productionRisk = 0;
+            double userRisk = 0;
+            double e = 2.71828182845904523536;
+            for (int r = 0; r <= i; r++) {
+                productionRisk = productionRisk + Math.pow(TST0, r) * Math.pow(e, -TST0) / getjc(r);
+                userRisk = userRisk + Math.pow(TST1, r) * Math.pow(e, -TST1) / getjc(r);
+            }
+            ResultDto resultDto = new ResultDto();
+            resultDto.setAcceptNumber(i);
+            resultDto.setTotalTestTime(String.valueOf(Math.round(T)));
+            resultDto.setNumber(String.valueOf(Math.round(ST0)));
+            resultDto.setProductionRiskReal(new Formatter().format("%.2f", productionRisk * 100).toString());
+            resultDto.setUserRiskReal(new Formatter().format("%.2f", userRisk * 100).toString());
+            result.add(resultDto);
+        }
+        return result;
+    }
+
+    //璁$畻闃朵箻
+    int getjc(int a) {
+        int result = 1;
+        for (int i = a; i > 0; i--)
+            result = result * i;
+        return result;
+    }
+}
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 34ec34f..bcc6439 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
@@ -47,28 +47,6 @@
     @Autowired
     private ModelRbdNodeService modelRbdNodeService;
 
-    @Autowired
-    private PythonLib pythonLib;
-
-/*
-    @GetMapping("callPythonCalc")
-    @ApiOperation("淇℃伅")
-    public Result callPythonCalc() {
-        Result result = pythonLib.callPython();
-
-        return result;
-    }
-*/
-
-/*
-    @GetMapping("getPythonCalcResult")
-    @ApiOperation("淇℃伅")
-    public Result<String> getPythonCalcResult() {
-        String result = pythonLib.getPythonCalcResult();
-
-        return Result.ok(result);
-    }
-*/
 
     @GetMapping("page")
     @ApiOperation("鍒嗛〉")
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 475202b..a022a2b 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
@@ -36,10 +36,7 @@
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 
 /**
@@ -120,7 +117,6 @@
 
     @PostMapping("getResultXML")
     public Result<SimulaDataDto> getResultXML(@RequestBody SimulatAssess simulatAssess) {
-        simulatAssessService.deleteSimInfoInRedis(simulatAssess.getId());
         if (simulatAssess.getDataType().equals("fz")) {
             Integer num = simulatAssessService.getNumById(simulatAssess.getProductId(), simulatAssess.getTaskModelId());
             simulatAssess.setName("浠跨湡璁板綍" + (num + 1));
@@ -243,6 +239,9 @@
         String key = taskId.toString() + simulatAssessService.RELIA_SIM_TASK_TYPE_PROGRESS;
         String progress = (String) redisTemplate.opsForValue().get(key);
         if (progress == null) progress = "0";
+        if(Objects.equals(progress, "100")){
+            simulatAssessService.deleteSimInfoInRedis(taskId);
+        }
         return Result.ok(progress);
     }
 
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 9836118..398b57f 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. 淇濆瓨妯″瀷
diff --git a/modules/mainPart/src/main/resources/mapper/TestScheme/TestSchemeDao.xml b/modules/mainPart/src/main/resources/mapper/TestScheme/TestSchemeDao.xml
new file mode 100644
index 0000000..cdf4c6e
--- /dev/null
+++ b/modules/mainPart/src/main/resources/mapper/TestScheme/TestSchemeDao.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.zt.life.modules.mainPart.TestScheme.dao.TestSchemeDao">
+
+    <select id="getList" resultType="com.zt.life.modules.mainPart.TestScheme.model.TestScheme">
+        select a.*
+        from test_scheme a
+        where a.is_delete = 0
+    </select>
+
+</mapper>
diff --git a/web/src/views/modules/taskReliability/ConfigEdge/configEdge.vue b/web/src/views/modules/taskReliability/ConfigEdge/configEdge.vue
index 12d7c46..680a165 100644
--- a/web/src/views/modules/taskReliability/ConfigEdge/configEdge.vue
+++ b/web/src/views/modules/taskReliability/ConfigEdge/configEdge.vue
@@ -116,6 +116,7 @@
     },
 
     onStrokeChange(e) {
+      console.log(e,'eee')
       const val = e
       this.globalGridAttr.stroke = val
       this.curCell.attr('line/stroke', val)
diff --git a/web/src/views/modules/taskReliability/PlanMake.vue b/web/src/views/modules/taskReliability/PlanMake.vue
new file mode 100644
index 0000000..b1f6dba
--- /dev/null
+++ b/web/src/views/modules/taskReliability/PlanMake.vue
@@ -0,0 +1,174 @@
+<template>
+  <div>
+    <el-table ref="table" :data="tjDataList" height="230px">
+      <el-table-column align="center" prop="tjlx" width="100" label="鏉′欢绫诲瀷">
+      </el-table-column>
+      <el-table-column align="center" prop="specifiedValue" label="宸茬煡瑙勫畾鍊�">
+        <template v-slot="{ row }">
+          <el-input v-model="row.specifiedValue" style="width:100%" :disabled="row.tjlx==='鏉′欢3'"></el-input>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" prop="minAccepValue" label="鏈�浣庡彲鎺ュ彈鍊�">
+        <template v-slot="{ row }">
+          <el-input v-model="row.minAccepValue" style="width:100%"></el-input>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" prop="productionRisk" label="鐢熶骇鏂归闄�">
+        <template v-slot="{ row }">
+          <el-select style="width: 100%" :value-key="key" v-model="row.productionRisk"
+                     @change="onChange()" :disabled="row.tjlx==='鏉′欢2'">
+            <el-option v-for="item in riskList" :key="item.value" :label="item.label"
+                       :value="item.value"></el-option>
+          </el-select>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" prop="userRisk" label="浣跨敤鏂归闄�">
+        <template v-slot="{ row }">
+          <el-select style="width: 100%" :value-key="key" v-model="row.userRisk"
+                     @change="onChange()">
+            <el-option v-for="item in riskList" :key="item.value" :label="item.label"
+                       :value="item.value"></el-option>
+          </el-select>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" prop="showFailureTime" label="鏁呴殰鎺ュ彈鍊兼渶澶ф樉绀�">
+        <template v-slot="{ row }">
+          <el-input v-model="row.showFailureTime" style="width:100%" :disabled="row.tjlx==='鏉′欢1'"></el-input>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" width="100" label="鎿嶄綔">
+        <template v-slot="{ row }">
+          <el-button type="primary" @click="check(row)">鏌ヨ</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <el-table ref="tableObj" height="570px" :data="dataList">
+      <el-table-column align="center" prop="acceptNumber" label="鏁呴殰鎺ュ彈鍊�">
+      </el-table-column>
+      <el-table-column align="center" prop="totalTestTime" label="鎬昏瘯楠屾椂闂�(h)">
+      </el-table-column>
+      <el-table-column v-if="isShow" align="center" prop="number" label="瑙勫畾鍊�">
+      </el-table-column>
+      <el-table-column align="center" prop="productionRiskReal" label="鐢熶骇鏂归闄╁疄闄呭��(%)">
+      </el-table-column>
+      <el-table-column align="center" prop="userRiskReal" label="浣跨敤鏂归闄╁疄闄呭��(%)">
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+  import AddOrUpdate from './Task-AddOrUpdate'
+  import TaskBinoParam from "./TaskBinoParam";
+  import TaskRepairParam from "./TaskRepairParam";
+
+  export default {
+    data() {
+      return {
+        dataList: [],
+        isShow: false,
+        tjDataList: [{
+          tjlx: '鏉′欢1',
+          specifiedValue: null,
+          minAccepValue: null,
+          productionRisk: null,
+          userRisk: null,
+          showFailureTime: null
+        },
+          {
+            tjlx: '鏉′欢2',
+            specifiedValue: null,
+            minAccepValue: null,
+            productionRisk: null,
+            userRisk: null,
+            showFailureTime: null
+          },
+          {
+            tjlx: '鏉′欢3',
+            specifiedValue: null,
+            minAccepValue: null,
+            productionRisk: null,
+            userRisk: null,
+            showFailureTime: null
+          }
+        ],
+        riskList: [
+          {
+            value: 0.1,
+            label: '10%'
+          }, {
+            value: 0.2,
+            label: '20%'
+          }, {
+            value: 0.3,
+            label: '30%'
+          }, {
+            value: 0.4,
+            label: '40%'
+          }, {
+            value: 0.5,
+            label: '50%'
+          }, {
+            value: 0.6,
+            label: '60%'
+          }, {
+            value: 0.7,
+            label: '70%'
+          }, {
+            value: 0.8,
+            label: '80%'
+          }, {
+            value: 0.9,
+            label: '90%'
+          }
+        ],
+
+      }
+    },
+    components: {},
+    mounted() {
+
+    },
+    methods: {
+      async check(row) {
+        let flag = true;
+        if (row.specifiedValue < row.minAccepValue && row.specifiedValue) {
+          this.$tip.alert("鏈�浣庡彲鎺ュ彈鍊间笉鑳藉ぇ浜庤瀹氬��")
+          flag =false
+        }
+        if (row.tjlx === "鏉′欢1"){
+          if (!row.specifiedValue ||!row.minAccepValue || !row.productionRisk||!userRisk) {
+            this.$tip.alert("鏈夋湭濉啓鐨勫��")
+            flag =false
+          }
+        }
+        if (row.tjlx === "鏉′欢2"){
+          if (!row.specifiedValue ||!row.minAccepValue || !row.showFailureTime||!row.userRisk) {
+            this.$tip.alert("鏈夋湭濉啓鐨勫��")
+            flag =false
+          }
+        }
+        if (row.tjlx === "鏉′欢3"){
+          if (!row.showFailureTime ||!row.minAccepValue || !row.productionRisk||!userRisk) {
+            this.$tip.alert("鏈夋湭濉啓鐨勫��")
+            flag =false
+          }
+        }
+        if (!flag){
+          return
+        }
+        let res = await this.$http.get(`/TestScheme/TestScheme/condition`, {params: row})
+        this.dataList = res.data
+        if (row.tjlx === "鏉′欢3") {
+          this.isShow = true
+        }
+      }
+    }
+  }
+</script>
+<style>
+  .el-table .select-row {
+    background: rgba(23, 179, 163, 0.2) !important;
+  }
+</style>
diff --git a/web/src/views/modules/taskReliability/TimeDiagramTemp.vue b/web/src/views/modules/taskReliability/TimeDiagramTemp.vue
index 8deee7a..cd5301c 100644
--- a/web/src/views/modules/taskReliability/TimeDiagramTemp.vue
+++ b/web/src/views/modules/taskReliability/TimeDiagramTemp.vue
@@ -5,53 +5,6 @@
         <div style="height: 80vh">
           <div class="fa-card-a">
             <div id="stencil"></div>
-
-            <div style="height: 42vh;margin-top: 30px;background: #f5f5f5;padding-bottom:20px ">
-              <h3 style="background: #ededed;font-size: 12px;height: 32px;line-height: 32px;padding: 0 5px 0 8px">
-                瀵归綈鏂瑰紡</h3>
-              <div style="text-align: center">
-                <el-tooltip class="item" effect="dark" content="宸﹀榻�" placement="left">
-                  <el-button class="" style="margin-left: 0;padding: 2px;border: 1px solid #5F95FF;"
-                             @click="leftAlign()"><i style="font-size: 2rem;color: #5F95FF"
-                                                     class="wt-iconfont icon-zuoduiqi"></i></el-button>
-                </el-tooltip>
-              </div>
-              <div style="text-align: center">
-                <el-tooltip class="item" effect="dark" content="灞呬腑瀵归綈" placement="left">
-                  <el-button style="margin-left: 0;margin-top: 10px;padding: 2px;border: 1px solid #5F95FF"
-                             @click="centerAlign()"><i style="font-size: 2rem;color: #5F95FF"
-                                                       class="wt-iconfont icon-chuizhiduiqi"></i></el-button>
-                </el-tooltip>
-              </div>
-              <div style="text-align: center">
-                <el-tooltip class="item" effect="dark" content="鍙冲榻�" placement="left">
-                  <el-button style="margin-left: 0;margin-top: 10px;padding: 2px;border: 1px solid #5F95FF"
-                             @click="rightAlign()"><i style="font-size: 2rem;color: #5F95FF"
-                                                      class="wt-iconfont icon-youduiqi"></i></el-button>
-                </el-tooltip>
-              </div>
-              <div style="text-align: center">
-                <el-tooltip class="item" effect="dark" content="椤堕儴瀵归綈" placement="left">
-                  <el-button style="margin-left: 0;margin-top: 10px;padding: 2px;border: 1px solid #5F95FF"
-                             @click="topAlign()"><i style="font-size: 2rem;color:#5F95FF"
-                                                    class="wt-iconfont icon-dingduiqi"></i></el-button>
-                </el-tooltip>
-              </div>
-              <div style="text-align: center">
-                <el-tooltip class="item" effect="dark" content="姘村钩瀵归綈" placement="left">
-                  <el-button style="margin-left: 0;margin-top: 10px;padding: 2px;border: 1px solid #5F95FF"
-                             @click="shuipingAlign()"><i style="font-size: 2rem;color:#5F95FF"
-                                                         class="wt-iconfont icon-shuipingduiqi"></i></el-button>
-                </el-tooltip>
-              </div>
-              <div style="text-align: center">
-                <el-tooltip class="item" effect="dark" content="搴曢儴瀵归綈" placement="left">
-                  <el-button style="margin-left: 0;margin-top: 10px;padding: 2px;border: 1px solid #5F95FF"
-                             @click="bottomAlign()"><i style="font-size: 2rem;color:#5F95FF"
-                                                       class="wt-iconfont icon-diduiqi"></i></el-button>
-                </el-tooltip>
-              </div>
-            </div>
           </div>
         </div>
       </el-col>
@@ -294,9 +247,7 @@
     },
     watch: {
       '$route.params.configId'() {
-        // alert('$route.params.projectId change')
         this.projectId = this.$route.params.projectId
-        //this.diagramId = this.$route.params.diagramId
         console.log(this.$route.params.projectId, 'this.$route.params.projectId')
         console.log(this.$route.params.diagramId, 'this.$route.params.diagramId')
         this.projectChange2(this.$route.params.diagramId)
@@ -722,80 +673,13 @@
           },
           true,
         )
-        // 涓�绾х綉缁滃浘鐨勬棩鏈熸枃瀛楄妭鐐�
-        const r5 = this.graph.createNode({
-          shape: 'custom-circle',
-          data: {
-            dataId: '',
-            finishDate: '',
-            inspectName: ''
-          },
-          label: '闃舵',
-        })
-        // 浜岀骇缃戠粶鍥炬棩鏈熻妭鐐�
-        const r6 = this.graph.createNode({
-          shape: 'custom-circle1',
-          data: {
-            dataId: '',
-            finishDate: '',
-            inspectName: ''
-          },
-        })
         // 浜岀骇缃戠粶鍥炬枃瀛楄妭鐐�
         const r9 = this.graph.createNode({
           shape: 'custom-rect'
         })
 
-        const scaleImgCenter = this.graph.createNode({
-          shape: 'image',
-          imageUrl: require('@/assets/img/scale/center.jpg'),
-          width: 36,
-          height: 20,
-          data: {
-            imagePost: 'center'
-          }
-        })
-
-        const scaleImgTop = this.graph.createNode({
-          shape: 'image',
-          imageUrl: require('@/assets/img/scale/top.jpg'),
-          width: 36,
-          height: 20,
-          data: {
-            imagePost: 'top'
-          }
-        })
-
-        const scaleImgRight = this.graph.createNode({
-          shape: 'image',
-          imageUrl: require('@/assets/img/scale/right.jpg'),
-          width: 36,
-          height: 20,
-          data: {
-            imagePost: 'right'
-          }
-        })
-        const scaleImgBottom = this.graph.createNode({
-          shape: 'image',
-          imageUrl: require('@/assets/img/scale/bottom.jpg'),
-          width: 36,
-          height: 20,
-          data: {
-            imagePost: 'bottom'
-          }
-        })
-        const scaleImgLeft = this.graph.createNode({
-          shape: 'image',
-          imageUrl: require('@/assets/img/scale/left.jpg'),
-          width: 36,
-          height: 20,
-          data: {
-            imagePost: 'left'
-          }
-        })
-
         // scaleImgTop.setAttribute('crossOrigin', 'Anonymous')
-        stencil.load([r5, r6, r9, scaleImgTop, scaleImgCenter, scaleImgRight, scaleImgBottom, scaleImgLeft], 'group1')
+        stencil.load([r9], 'group1')
         this.graph.bindKey(['meta+c', 'ctrl+c'], () => {
           const cells = this.graph.getSelectedCells()
           if (cells.length) {
@@ -910,16 +794,6 @@
         })
         //鍗曞嚮杈硅妭鐐�
         this.graph.on('edge:click', ({edge}) => {
-          // this.reset()
-          edge.attr('line/stroke', '#5F95FF')
-          edge.prop('labels/0', {
-            attrs: {
-              body: {
-                stroke: '#5F95FF',
-              },
-            },
-
-          })
         })
         // 鍗曞嚮node鑺傜偣
         this.graph.on('node:click', ({node}) => {

--
Gitblit v1.9.1