jinlin
2024-12-10 1069d8bf6622690e6be091753def954ccf4495ae
修改
7个文件已修改
127 ■■■■ 已修改文件
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/sys/controller/SysMysqlController.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/SimulatAssessService.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/resources/mapper/basicInfo/StatisticsDao.xml 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/taskReliability/ReliabilityWeakness.vue 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/taskReliability/SimulatAssess.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/taskReliability/SimulatHistory.vue 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/taskReliability/TimeDiagram.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/sys/controller/SysMysqlController.java
@@ -1,27 +1,16 @@
package com.zt.life.modules.mainPart.sys.controller;
import com.zt.common.annotation.LogOperation;
import com.zt.common.annotation.QueryParam;
import com.zt.common.constant.Constant;
import com.zt.common.db.query.QueryFilter;
import com.zt.common.servlet.Result;
import com.zt.life.modules.mainPart.sys.model.SysMysql;
import com.zt.life.modules.mainPart.sys.service.SysMysqlService;
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 javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.LinkedList;
import java.util.List;
/**
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/SimulatAssessService.java
@@ -257,7 +257,7 @@
            JsonUtils2.setJsonValueByPath(textJson, "id".split("/"), UUIDUtil.generateId().toString());
            JsonUtils2.setJsonValueByPath(textJson, "attrs/label/textWrap/text".split("/"), dto.getName());
            JsonUtils2.setJsonValueByPath(textJson, "position/x".split("/"), 20);
            JsonUtils2.setJsonValueByPath(textJson, "position/y".split("/"), y - 15);
            JsonUtils2.setJsonValueByPath(textJson, "position/y".split("/"), y + 10);
            jsonArray3.add(textJson);
        }
@@ -607,7 +607,7 @@
            if (jsonArray3.size() == 0) {
                StatusDto statusDto = new StatusDto();
                statusDto.setTimes(phaseModelList.get(j).getGkDuration());
                statusDto.setStatus("");
                statusDto.setStatus("M");
                productStatusDto.getStatusList().add(statusDto);
            } else {
                for (int a = 0; a < jsonArray3.size(); a++) {
@@ -621,6 +621,9 @@
                        }
                    }
                    if (status != null || times != null) {
                        if (StringUtils.isBlank(status)) {
                            status = "M";
                        }
                        StatusDto statusDto = new StatusDto();
                        statusDto.setTimes(times);
                        statusDto.setStatus(status);
@@ -1297,7 +1300,6 @@
        JSONObject xmlJSONObj = XML.toJSONObject(xml);
        JSONArray jsonArray = xmlJSONObj.getJSONObject("ResultNodes").getJSONArray("ResultNode");
        for (int i = 0; i < jsonArray.size(); i++) {
            WeakDto data = new WeakDto();
            Long productId1;
            String nameValue = jsonArray.getJSONObject(i).get("name").toString();
            if (StringUtils.isNotBlank(nameValue)) {
@@ -1322,12 +1324,14 @@
        }
        List<WeakDto> productList = baseDao.getProductList(taskId, productId);
        for (WeakDto item : productList) {
            if (map.get(item.getId()) != null) {
            WeakDto dto = map.get(item.getId());
            item.setMtbf(dto.getMtbf());
            item.setMttr(dto.getMttr());
            item.setMsr(dto.getMsr());
            item.setMtbfTime(dto.getMtbf() / item.getTimeRate());
            item.setIsWeak(0);
            }
        }
        List<WeakDto> treeList = new ArrayList<>();
@@ -1342,6 +1346,7 @@
    private void getIsweak(List<WeakDto> treeList) {
        WeakDto minDto = null;
        for (WeakDto dto : treeList) {
            if (dto.getMtbfTime() != null) {
            if (dto.getProductType() == 10)
                continue;
            if (minDto == null) {
@@ -1349,6 +1354,7 @@
            }
            if (dto.getMtbfTime() < minDto.getMtbfTime()) {
                minDto = dto;
                }
            }
        }
        minDto.setIsWeak(1);
@@ -1468,13 +1474,11 @@
                String[] arr = availability.split(" ");
                // 遍历子字符串数组,将每个元素转换为double并存储到double数组中
                Double j = 0.0;
                Double b = 100.0;
                for (int a = 0; a < arr.length - 1; a++) {
                    if (Convert.toDouble(arr[a]) < Convert.toDouble(arr[a+1])) {
                        System.out.println(arr[a]);
                    }
                    j = samplPeriod + j;
                    if (!StringUtils.isEmpty(arr[a])) {
                    doubleArray.add(Double.parseDouble(arr[a]));
                    }
                    xList.add(j);
                }
modules/mainPart/src/main/resources/mapper/basicInfo/StatisticsDao.xml
@@ -4,7 +4,7 @@
<mapper namespace="com.zt.life.modules.mainPart.basicInfo.dao.StatisticsDao">
    <select id="getTaskReliabList" resultType="com.zt.life.modules.mainPart.basicInfo.model.TaskReliabData">
        SELECT
        /*SELECT
            a.name,
            count(distinct b.id) AS taskNum,
            count(distinct c.id) AS operatConNum,
@@ -21,7 +21,23 @@
                 left join  assess_result g on g.product_id = a.id and g.IS_DELETE=0
        where a.product_type = 2 and a.IS_DELETE =0
        group by a.id,a.name
        order by a.name
        order by a.name*/
        SELECT
            a.name,
            (SELECT COUNT(DISTINCT b.id) FROM task b WHERE b.product_id = a.id AND b.IS_DELETE = 0) AS taskNum,
            (SELECT COUNT(DISTINCT c.id) FROM operat_condit c WHERE c.product_id = a.id AND c.IS_DELETE = 0) AS operatConNum,
            (SELECT COUNT(DISTINCT d.id) FROM model_rbd d WHERE d.ship_id = a.id AND d.IS_DELETE = 0) AS modelNum,
            (SELECT COUNT(DISTINCT e.id) FROM simulat_assess e WHERE e.product_id = a.id AND e.IS_DELETE = 0) AS simulatNum,
            (SELECT COUNT(DISTINCT f.id) FROM assess_item f WHERE f.product_id = a.id AND f.IS_DELETE = 0) AS testData,
            (SELECT COUNT(DISTINCT g.id) FROM assess_result g WHERE g.product_id = a.id AND g.IS_DELETE = 0) AS assessNum
        FROM
            product_model a
        WHERE
            a.product_type = 2 AND a.IS_DELETE = 0
        GROUP BY
            a.id, a.name
        ORDER BY
            a.name
    </select>
    <select id="getBaseReliabList" resultType="com.zt.life.modules.mainPart.basicInfo.model.BaseReliabData">
        SELECT
web/src/views/modules/taskReliability/ReliabilityWeakness.vue
@@ -48,6 +48,8 @@
</template>
<script>
  import Cookies from "js-cookie";
  export default {
    data() {
      return {
@@ -76,13 +78,31 @@
      },
    },
    mounted() {
      this.getProductList()
      this.getProductList(Cookies.get('productId'))
    },
    methods: {
      async getProductList() {
      getPath(){
        if (Cookies.get('productId') != null){
          this.dataForm.fzId = Cookies.get('fzId')
          this.dataForm.productId = Cookies.get('productId')
          this.dataForm.taskModelId = Cookies.get('taskModelId')
          console.log(this.dataForm.productId)
          this.getTaskList()
          this.$nextTick(() => {
            this.onProductSelected({id:this.dataForm.productId})
            this.onTaskSelected({id:Cookies.get('taskModelId')})
            this.onSimulatSelected({id:Cookies.get('fzId')})
          })
        }
      },
      async getProductList(productId) {
        let res = await this.$http.get('/basicInfo/XhProductModel/getTaskProductList')
        this.productList = res.data
        if(productId!=null){
          this.getPath()
        }else{
        this.onProductSelected(this.productList[0])
        }
      },
      async getTaskList() {
        let params = {
web/src/views/modules/taskReliability/SimulatAssess.vue
@@ -70,7 +70,6 @@
  import SimulatCurve from "./SimulatCurve";
  import ProductModelTree from "../basicInfo/ProductModelTree";
  import Process from "./Process";
  import qs from "qs";
  import Cookies from "js-cookie";
@@ -158,6 +157,9 @@
            if (this.percentage >= 100) {
              clearInterval(this.timers)
              this.percentage = 0
              Cookies.set('productId', this.dataForm.productId)
              Cookies.set('taskModelId', this.dataForm.taskModelId)
              Cookies.set('fzId', this.dataForm.id)
              this.$refs.SimulatCurve.initEcharts(this.dataForm);
            }
          }
web/src/views/modules/taskReliability/SimulatHistory.vue
@@ -76,7 +76,7 @@
      }
    },
    mounted() {
      this.getProductList()
        this.getProductList(Cookies.get('productId'))
    },
    components: {
      ProductModelTree,
@@ -84,10 +84,28 @@
    },
    methods: {
      async getProductList() {
      getPath(){
        if (Cookies.get('productId') != null){
          this.dataForm.id = Cookies.get('fzId')
          this.dataForm.productId = Cookies.get('productId')
          this.dataForm.taskModelId = Cookies.get('taskModelId')
          console.log(this.dataForm.id)
          this.getTaskList()
          this.$nextTick(() => {
            this.onProductSelected({id:this.dataForm.productId})
            this.onTaskSelected({id:Cookies.get('taskModelId')})
            this.onSimulatSelected({id:Cookies.get('fzId')})
          })
        }
      },
      async getProductList(productId) {
        let res = await this.$http.get('/basicInfo/XhProductModel/getTaskProductList')
        this.productList = res.data
        if(productId!=null){
          this.getPath()
        }else{
        this.onProductSelected(this.productList[0])
        }
      },
      async getTaskList() {
        let params = {
@@ -128,16 +146,16 @@
        this.dataForm.taskModelId = data.id
        this.getSimulatList()
        this.dataForm.id = ''
        console.log(this.dataForm.taskModelId)
      },
      async onSimulatSelected(data) {
        this.dataForm.id = data.id
        this.dataForm.samplPeriod = data.samplPeriod
        console.log(data)
        let params = {
          id: this.dataForm.id,
          taskModelId: this.dataForm.taskModelId
        }
        let res = await this.$http.get('/taskReliability/SimulatAssess/getSimulatParams', {params: params})
        console.log(res.data.samplPeriod)
        this.dataForm.samplPeriod = res.data.samplPeriod
        this.dataForm.simulatFrequency = res.data.simulatFrequency
        this.$nextTick(() => {
web/src/views/modules/taskReliability/TimeDiagram.vue
@@ -150,7 +150,7 @@
      window.removeEventListener('scroll', this.handleScroll);
    },
    mounted() {
      this.getProductList()
      this.getProductList(Cookies.get('productId'))
      this.init()
      this.$refs.textDiagram.init()
      this.$refs.timeDiagramThumbnail.init()
@@ -169,6 +169,20 @@
        let top = this.graph.getScrollbarPosition().top
        this.$refs.textDiagram.setScroll(top)
        this.$refs.timeDiagramThumbnail.getNodePointX(left,this.bigWidth)
      },
      getPath(){
        if (Cookies.get('productId') != null){
          this.dataForm.id = Cookies.get('fzId')
          this.dataForm.productId = Cookies.get('productId')
          this.dataForm.taskModelId = Cookies.get('taskModelId')
          console.log(this.dataForm.id)
          this.getTaskList()
          this.$nextTick(() => {
            this.onProductSelected({id:this.dataForm.productId})
            this.onTaskSelected({id:Cookies.get('taskModelId')})
            this.onSimulatSelected({id:Cookies.get('fzId')})
          })
        }
      },
      init() {
        this.graph = new Graph({
@@ -363,10 +377,14 @@
          style.display = 'none'
        })
      },
      async getProductList() {
      async getProductList(productId) {
        let res = await this.$http.get('/basicInfo/XhProductModel/getTaskProductList')
        this.productList = res.data
        if(productId!=null){
          this.getPath()
        }else{
        this.onProductSelected(this.productList[0])
        }
      },
      async getTaskList() {
        let params = {