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) { 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); 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,13 +1346,15 @@ private void getIsweak(List<WeakDto> treeList) { WeakDto minDto = null; for (WeakDto dto : treeList) { if (dto.getProductType() == 10) continue; if (minDto == null) { minDto = dto; } if (dto.getMtbfTime() < minDto.getMtbfTime()) { minDto = dto; if (dto.getMtbfTime() != null) { if (dto.getProductType() == 10) continue; if (minDto == null) { minDto = dto; } 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; doubleArray.add(Double.parseDouble(arr[a])); 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 this.onProductSelected(this.productList[0]) 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
@@ -1,46 +1,46 @@ <template> <div class="fa-card-a"> <el-row :gutter="5"> <el-form :inline="true" :model="dataForm" ref="dataForm" :disabled="dataForm.disabled" label-width="80px"> <zt-form-item label="产品节点" prop="productId"> <zt-select v-model="dataForm.productId" :datas="productList" @change="onProductSelected"/> </zt-form-item> <zt-form-item label="总体任务" prop="taskModelId"> <zt-select v-model="dataForm.taskModelId" :datas="taskList" @change="onTaskSelected"/> </zt-form-item> <zt-form-item label="仿真记录" prop="simulatHis"> <zt-select v-model="dataForm.id" :datas="simulatList" @change="onSimulatSelected"/> </zt-form-item> <zt-form-item label="时间分片" prop="samplPeriod"> <el-input v-model="dataForm.samplPeriod" readonly="false" style="width: 150px;vertical-align: baseline;"> <template slot="append">分钟</template> </el-input> </zt-form-item> <zt-form-item label="仿真次数" prop="simulatFrequency"> <el-input v-model="dataForm.simulatFrequency" readonly="false" style="width: 150px;vertical-align: baseline;"> </el-input> </zt-form-item> <el-dropdown style="margin-left: 10px" @command="download"> <el-button type="primary"> 下载xml<i class="el-icon-arrow-down el-icon--right"></i> </el-button> <el-dropdown-menu slot="dropdown"> <el-dropdown-item command="1">输入xml</el-dropdown-item> <el-dropdown-item command="2">输出xml</el-dropdown-item> </el-dropdown-menu> </el-dropdown> </el-form> <el-col :span="4"> <div style="margin-right: 5px;height: calc(100vh - 230px)" v-if="isSelect"> <product-model-tree @on-selected="onTreeSelected" showXdy="false" ref="ProductModelTree" :isShow="false" basic="5" :productId="dataForm.productId"/> </div> </el-col> <el-col :span="20"> <div class="fa-card-a" style="height: calc(100vh - 230px)"> <SimulatCurve ref="SimulatCurve"></SimulatCurve> </div> </el-col> <el-form :inline="true" :model="dataForm" ref="dataForm" :disabled="dataForm.disabled" label-width="80px"> <zt-form-item label="产品节点" prop="productId"> <zt-select v-model="dataForm.productId" :datas="productList" @change="onProductSelected"/> </zt-form-item> <zt-form-item label="总体任务" prop="taskModelId"> <zt-select v-model="dataForm.taskModelId" :datas="taskList" @change="onTaskSelected"/> </zt-form-item> <zt-form-item label="仿真记录" prop="simulatHis"> <zt-select v-model="dataForm.id" :datas="simulatList" @change="onSimulatSelected"/> </zt-form-item> <zt-form-item label="时间分片" prop="samplPeriod"> <el-input v-model="dataForm.samplPeriod" readonly="false" style="width: 150px;vertical-align: baseline;"> <template slot="append">分钟</template> </el-input> </zt-form-item> <zt-form-item label="仿真次数" prop="simulatFrequency"> <el-input v-model="dataForm.simulatFrequency" readonly="false" style="width: 150px;vertical-align: baseline;"> </el-input> </zt-form-item> <el-dropdown style="margin-left: 10px" @command="download"> <el-button type="primary"> 下载xml<i class="el-icon-arrow-down el-icon--right"></i> </el-button> <el-dropdown-menu slot="dropdown"> <el-dropdown-item command="1">输入xml</el-dropdown-item> <el-dropdown-item command="2">输出xml</el-dropdown-item> </el-dropdown-menu> </el-dropdown> </el-form> <el-col :span="4"> <div style="margin-right: 5px;height: calc(100vh - 230px)" v-if="isSelect"> <product-model-tree @on-selected="onTreeSelected" showXdy="false" ref="ProductModelTree" :isShow="false" basic="5" :productId="dataForm.productId"/> </div> </el-col> <el-col :span="20"> <div class="fa-card-a" style="height: calc(100vh - 230px)"> <SimulatCurve ref="SimulatCurve"></SimulatCurve> </div> </el-col> </el-row> </div> </template> @@ -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 this.onProductSelected(this.productList[0]) 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(() => { @@ -145,16 +163,16 @@ }) }, async download(selsect) { if(this.dataForm.id){ if (this.dataForm.id) { let param = qs.stringify({ 'token': Cookies.get('token'), type: 'fz', xml:selsect, xml: selsect, id: this.dataForm.id }) let apiURL = `/taskReliability/SimulatAssess/downloadXml` window.location.href = `${window.SITE_CONFIG['apiURL']}${apiURL}?${param}` }else{ } else { this.$alert('还未选择仿真记录') } }, 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 this.onProductSelected(this.productList[0]) if(productId!=null){ this.getPath() }else{ this.onProductSelected(this.productList[0]) } }, async getTaskList() { let params = {