Merge remote-tracking branch 'origin/master'
| | |
| | | void compute(Long shipId,Integer productType); |
| | | |
| | | void compute2(Long shipId); |
| | | |
| | | void compute1(Long shipId); |
| | | } |
| | |
| | | } |
| | | |
| | | public void compute(Long shipId) { |
| | | baseDao.compute1(shipId); |
| | | baseDao.compute(shipId, 4); |
| | | baseDao.compute(shipId, 3); |
| | | baseDao.compute(shipId, 2); |
| | |
| | | } |
| | | |
| | | @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); |
| | | } |
| | |
| | | return result; |
| | | } |
| | | |
| | | @GetMapping("exportData") |
| | | @ApiOperation("导åºäº§å模å") |
| | | @LogOperation("导åºäº§å模å") |
| | | public Result exportDataExcel(Long shipId) { |
| | | xhProductModelService.exportDataExcel(shipId); |
| | | |
| | | return null; |
| | | } |
| | | |
| | | |
| | | @PostMapping |
| | | @ApiOperation("æ°å¢") |
| | |
| | | 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); |
| | | |
| | |
| | | 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); |
| | | } |
| | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | void deleteByPid(Long id); |
| | | |
| | | Long[] getByPid(Long id); |
| | | |
| | | void getProductByShip(Long shipId); |
| | | } |
| | |
| | | public Long[] getByPid(Long id) { |
| | | return baseDao.getByPid(id); |
| | | } |
| | | |
| | | public void exportDataExcel(Long shipId) { |
| | | baseDao.getProductByShip(shipId); |
| | | } |
| | | } |
| | |
| | | return result ? Result.ok() : Result.error("è§£æå¤±è´¥"); |
| | | } |
| | | |
| | | |
| | | @PostMapping("layout") |
| | | @ApiOperation("èªå¨æç") |
| | | @LogOperation("èªå¨æç") |
| | |
| | | } |
| | | |
| | | @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); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @PutMapping |
| | | @ApiOperation("ä¿®æ¹") |
| | | @LogOperation("ä¿®æ¹") |
New file |
| | |
| | | package com.zt.life.modules.mainPart.taskReliability.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class TimeDiagramDto { |
| | | private double smallWidth; |
| | | private double totalWidth; |
| | | private double minPointNum; |
| | | private String smallDiagramJson; |
| | | private String diagramJson; |
| | | private String textDiagramJson; |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.taskReliability.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class TimeDiagramStatusDto { |
| | | private double x1; |
| | | private double x2; |
| | | private int status; |
| | | |
| | | public TimeDiagramStatusDto(double x1, double x2, int status) { |
| | | this.x1 = x1; |
| | | this.x2 = x2; |
| | | this.status = status; |
| | | } |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "xmlææ¡£") |
| | | private String content; |
| | | @ApiModelProperty(value = "xmlææ¡£") |
| | | private String content2; |
| | | @ApiModelProperty(value = "åå¸ææ¡£") |
| | | private String publishContent; |
| | | @ApiModelProperty(value = "åå¸ç¶æ") |
| | |
| | | String templetStr = "{\"cells\":[]}"; |
| | | Map<String, JSONObject> templetsMap = new HashMap<>(); |
| | | Map<String, String> templetsStrMap = new HashMap<>(); |
| | | Map<Integer, String> templetsStrMap2 = new HashMap<>(); |
| | | |
| | | private JSONObject xmlJSONObj; |
| | | |
| | |
| | | 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; |
| | |
| | | JSONObject jsonObject = new JSONObject(templetStr); |
| | | JSONArray jsonArray = jsonObject.getJSONArray("cells"); |
| | | |
| | | this.getPetsInfo(); |
| | | JSONObject jsonObject3 = new JSONObject(templetStr); |
| | | JSONArray jsonArray3 = jsonObject3.getJSONArray("cells"); |
| | | |
| | | String modelStr2 = this.getPetsInfo(); |
| | | double x1 = 0; |
| | | double x2 = 0; |
| | | int y = -10; |
| | |
| | | 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()); |
| | |
| | | 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()); |
| | | JsonUtils2.setJsonValueByPath(textJson, "position/x".split("/"), 20); |
| | | JsonUtils2.setJsonValueByPath(textJson, "position/y".split("/"), y - 15); |
| | | 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); |
| | | jsonArray3.add(textJson); |
| | | } |
| | | |
| | | //é¶æ®µæ¨¡ååå»åº¦ |
| | | 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); |
| | |
| | | jsonArray.add(textJson); |
| | | x1 = x2; |
| | | } |
| | | |
| | | JSONObject modelJson3 = new JSONObject(templetsStrMap.get("model")); |
| | | setlineXy(modelJson3, 0, y, x2, y, null); |
| | | jsonArray.add(modelJson3); |
| | |
| | | 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(modelStr2); |
| | | 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() + 5, y, ""); |
| | | JsonUtils2.setJsonValueByPath(lineJson, "data/status".split("/"), status.getStatus()); |
| | | JsonUtils2.setJsonValueByPath(lineJson, "id".split("/"), UUIDUtil.generateId().toString()); |
| | | jsonArray2.add(lineJson); |
| | | } |
| | | y = y + 25; |
| | | } |
| | | |
| | | //å¾ä¾ |
| | | int spaceWitdth = 80; |
| | | x1 = 0; |
| | | x2 = spaceWitdth - 11; |
| | | y = 60; |
| | | 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()); |
| | | timeDiagramDto.setTextDiagramJson(jsonObject3.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); |
| | |
| | | } |
| | | } |
| | | |
| | | public void getPetsInfo() { |
| | | public String getPetsInfo() { |
| | | Map<String, Object> params = new HashMap<String, Object>(); |
| | | params.put("projectId", 10000); |
| | | params.put("diagramId", 10000); |
| | | String modelStr2 = ""; |
| | | List<TimeDiagram> list_style = baseDao.getTimeDiagram(params); |
| | | if (list_style.size() > 0) { |
| | | modelStr2 = list_style.get(0).getContent2(); |
| | | String modelStr = list_style.get(0).getContent(); |
| | | JSONObject modelJson = new JSONObject(modelStr); |
| | | JSONArray modelJsonArray = modelJson.getJSONArray("cells"); |
| | |
| | | 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("/"), ""); |
| | |
| | | } |
| | | } |
| | | } |
| | | return modelStr2; |
| | | } |
| | | |
| | | public List<ProductStatusDto> getStatusData(Long productId, Long taskId) { |
| | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | 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"> |
| | |
| | | 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 |
| | |
| | | <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> |
| | |
| | | basicMtbfRegulate: '', |
| | | repairMttcr: '', |
| | | basicMtbfOperatingRatio: '', |
| | | ai: '' |
| | | ai: '', |
| | | basicMtbfRegulSuccRate:'', |
| | | basicRunsNum:'' |
| | | }, |
| | | defultKey: [] |
| | | } |
| | |
| | | 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; |
| | | } |
| | | }, |
| | | }, |
| | |
| | | <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> |
| | |
| | | value: 1, |
| | | label: 'ææ°åå¸' |
| | | }, { |
| | | value: 2, |
| | | label: 'äºé¡¹åå¸' |
| | | }, |
| | | { |
| | | value: 3, |
| | | label: 'å¨å¸å°åå¸' |
| | | }, |
| | | label: 'äºé¡¹åå¸' |
| | | } |
| | | ], |
| | | // editingCell:null, |
| | | dataList: [], |
| | |
| | | <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> |
| | |
| | | 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' |
| | | }, |
| | |
| | | <el-form-item v-show="shape!=='custom-circle1'" label="èç¹åç§°" prop="nodeText" label-width="80px"> |
| | | <el-input v-model="globalGridAttr.nodeText" style="width:100%" @change="onTextChange"></el-input> |
| | | </el-form-item> |
| | | <el-form-item v-show="nodeType=='vote' || (nodeType=='node' && showNumberInput)" label="è¡¨å³æ°é" prop="voteNum" |
| | | <el-form-item v-show="showNumberInput" :label='nodeType=="vote"?"è¡¨å³æ°é":"å¤ä»½æ°é"' prop="voteNum" |
| | | label-width="80px"> |
| | | <el-input type="number" v-model="globalGridAttr.voteNum" @change="onNumberInputValue" |
| | | placeholder="请è¾å
¥æ°å"></el-input> |
| | | </el-form-item> |
| | | |
| | | <div v-show="globalGridAttr.productType!=='product_xdy'"> |
| | | <el-form-item v-show="nodeType=='node'" label="å¯é æ§åå¸ç±»å" prop="reliabDistribType" label-width="125px"> |
| | | <zt-dict style="width: 100%" v-model="globalGridAttr.reliabDistribType" @input="onReliabDistribType" |
| | |
| | | this.curCel.attr('text/text', this.text) |
| | | }, |
| | | onNodeTypeExtChange(e) { |
| | | if (this.globalGridAttr.nodeTypeExt === 'vote') { |
| | | alert(this.globalGridAttr.nodeTypeExt) |
| | | if (this.globalGridAttr.nodeTypeExt === 'vote' || this.globalGridAttr.nodeTypeExt === 'switch') { |
| | | this.showNumberInput = true; |
| | | } else { |
| | | this.showNumberInput = false; |
| | |
| | | this.globalGridAttr.successRate = cell.getData().successRate |
| | | this.globalGridAttr.simulatTimes = cell.getData().simulatTimes |
| | | this.globalGridAttr.successTimes = cell.getData().successTimes |
| | | if (this.nodeType === 'vote' || this.globalGridAttr.nodeTypeExt === 'vote' || (cell.getData().voteNum !== undefined && cell.getData().voteNum !== '')) { |
| | | if (this.nodeType === 'vote' || this.nodeType === 'switch') { |
| | | console.log(cell.getData().voteNum, 'cell.getData().voteNum') |
| | | this.showNumberInput = true |
| | | } |
| | |
| | | createParallelBrach(x, y, dragNode) { |
| | | dragNode.position(x + 320, y - dragNode.size().height / 2) |
| | | const connectNode = this.createConnectNode(x + 50, y) |
| | | this.createBrach(dragNode,connectNode,x,y-50) |
| | | this.createBrach(dragNode,connectNode,x,y+50) |
| | | |
| | | return {newStartNode: connectNode, newEndNode: dragNode} |
| | | }, |
| | | createBrach(dragNode,connectNode,x,y){ |
| | | const dashedBox = this.createDashedBox(x + 150, y) |
| | | dragNode.setData({startNodeId: connectNode.id}) |
| | | |
| | |
| | | router: { |
| | | name: 'manhattan', |
| | | args: { |
| | | startDirections: ['right'], // ä»ä¸æ¹å¼å§ |
| | | startDirections: ['top','bottom'], // ä»ä¸æ¹å¼å§ |
| | | endDirections: ['left'], // åå·¦æ¹ç»æ |
| | | }, |
| | | }, |
| | |
| | | name: 'manhattan', |
| | | args: { |
| | | startDirections: ['right'], // ä»ä¸æ¹å¼å§ |
| | | endDirections: ['left'], // åå·¦æ¹ç»æ |
| | | endDirections: ['top','bottom'], // åå·¦æ¹ç»æ |
| | | }, |
| | | }, |
| | | connector: {name: 'rounded'}, |
| | | zIndex: -1 |
| | | }) |
| | | return {newStartNode: connectNode, newEndNode: dragNode} |
| | | /* this.graph.addEdge({ |
| | | source: {cell: startNode, port: 'right1'}, |
| | | target: {cell: connectNode, port: 'left1'}, |
| | | router: {name: 'manhattan'}, |
| | | connector: {name: 'rounded'} |
| | | }) |
| | | this.graph.addEdge({ |
| | | source: {cell: dragNode, port: 'right1'}, |
| | | target: {cell: endNode, port: 'left1'}, |
| | | router: {name: 'manhattan'}, |
| | | connector: {name: 'rounded'} |
| | | })*/ |
| | | }, |
| | | createBridgeConnection(x, y, dragNode) { |
| | | console.log(x, y, 'leftX centerY') |
| | |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="mtbf" |
| | | label="MTBF" |
| | | label="MTTF" |
| | | width="100px" |
| | | align="right"> |
| | | <template slot-scope="scope"> |
| | |
| | | } |
| | | 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, |
| | |
| | | } |
| | | 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, |
| | |
| | | <div class="fa-card-a"> |
| | | <el-row :gutter="5"> |
| | | <div class="mod-taskReliability-simulatAssess"> |
| | | <el-form :inline="true" :model="dataForm" ref="dataForm" :disabled="dataForm.disabled" > |
| | | <el-form :inline="true" :model="dataForm" ref="dataForm" :disabled="dataForm.disabled"> |
| | | <zt-form-item label="产åèç¹" prop="productId"> |
| | | <zt-select v-model="dataForm.productId" :datas="productList" @change="onProductSelected"/> |
| | | </zt-form-item> |
| | |
| | | <el-input v-model="dataForm.simulatFrequency" readonly="false"> |
| | | </el-input> |
| | | </zt-form-item> |
| | | <zt-form-item > |
| | | <zt-button @click="getDiagram()">æ¥çæ¶åºå¾</zt-button> |
| | | <zt-form-item> |
| | | <zt-button @click="getDiagram(null)">æ¥çæ¶åºå¾</zt-button> |
| | | </zt-form-item> |
| | | </el-form> |
| | | <div> |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | title:'', |
| | | knob:HTMLDivElement, |
| | | title: '', |
| | | knob: HTMLDivElement, |
| | | dialogVisible2: false, |
| | | timers: '', |
| | | shape: '', |
| | |
| | | data: { |
| | | id: '', |
| | | status: '', |
| | | startTime:'', |
| | | startTime: '', |
| | | endTime: '', |
| | | }, |
| | | attrs: { |
| | |
| | | }, |
| | | keyboard: true, |
| | | }) |
| | | this.knob = document.createElement('div',false) |
| | | this.knob = document.createElement('div', false) |
| | | this.knob.style.position = 'absolute' |
| | | document.getElementById('timeDiagram').appendChild(this.knob) |
| | | this.graph.centerContent() |
| | |
| | | id: node.getData().dataId, |
| | | modelName: node.attr('label/textWrap/modelName'), |
| | | } |
| | | this.title=node.attr('label/textWrap/modelName') + "模å设计" |
| | | this.title = node.attr('label/textWrap/modelName') + "模å设计" |
| | | this.$nextTick(() => { |
| | | this.$refs.modelView.init(param) |
| | | }) |
| | |
| | | }) |
| | | |
| | | // é¼ æ ç§»å
¥edgeèç¹ |
| | | this.graph.on('edge:mouseenter', ({edge,e}) => { |
| | | this.graph.on('edge:mouseenter', ({edge, e}) => { |
| | | const style = this.knob.style |
| | | // e.stopPropagation() |
| | | console.log('edge:mouseenter') |
| | | if (e && edge.data) { |
| | | if (edge.getData().status==='F') { |
| | | if (edge.getData().status === 'F') { |
| | | //console.log(edge.getData(),"eee edge.getData()") |
| | | let startTimes = edge.getData().startTimes |
| | | let endTimes = edge.getData().endTimes |
| | | //console.log(e,'eee') |
| | | const p = this.graph.clientToGraph(e.clientX, e.clientY) |
| | | setTimeout(()=>{ |
| | | setTimeout(() => { |
| | | style.display = 'block' |
| | | style.left = `${p.x}px` |
| | | style.top = `${p.y}px` |
| | | style.width = 200+ 'px' |
| | | style.width = 200 + 'px' |
| | | style.height = 80 + 'px' |
| | | style.textAlign = 'center' |
| | | style.background = '#000' |
| | |
| | | style.lineHeight = (40 + 'px') |
| | | style.zIndex = 100 |
| | | this.knob.innerText = `å¼å§æ¶é´ï¼${startTimes}\nç»ææ¶é´ï¼${endTimes}` |
| | | },0) |
| | | console.log(p,'p p p') |
| | | console.log(style,this.knob,'style style') |
| | | }, 0) |
| | | console.log(p, 'p p p') |
| | | console.log(style, this.knob, 'style style') |
| | | } |
| | | } |
| | | }) |
| | |
| | | console.log(res.data) |
| | | this.simulatList = res.data |
| | | }, |
| | | async onTreeSelected(data) { |
| | | this.graph.unfreeze() |
| | | if (!this.dataForm.taskModelId) { |
| | | this.$alert("请å
éæ©å
·ä½ä»»å¡") |
| | | return |
| | | } |
| | | if (!this.dataForm.id) { |
| | | this.$alert("请å
éæ©å
·ä½ä»¿çè®°å½") |
| | | return |
| | | } |
| | | let params = { |
| | | productId: data.id, |
| | | taskId: this.dataForm.taskModelId, |
| | | fzId: this.dataForm.id |
| | | } |
| | | let res = await this.$http.get('/taskReliability/SimulatAssess/getStatus', {params: params}) |
| | | if (res.data !== null) { |
| | | this.diagramJson = JSON.parse(res.data) |
| | | console.log(this.diagramJson, 'this.Diagram json') |
| | | this.graph.fromJSON(this.diagramJson) |
| | | this.graph.positionContent('left') |
| | | //this.graph.zoomToFit() |
| | | this.graph.freeze() |
| | | } else { |
| | | this.graph.fromJSON(this.emptyJson) |
| | | //this.graph.centerContent() |
| | | //this.graph.zoomToFit() |
| | | this.graph.freeze() |
| | | } |
| | | console.log(res.data) |
| | | }, |
| | | |
| | | // è·åä¿¡æ¯ |
| | | onProductSelected(data) { |
| | | this.isSelect = true |
| | |
| | | this.dataForm.samplPeriod = result.data.samplPeriod |
| | | this.dataForm.simulatFrequency = result.data.simulatFrequency |
| | | }, |
| | | async getDiagram() { |
| | | async onTreeSelected(data) { |
| | | await this.getDiagram(data.id) |
| | | }, |
| | | async getDiagram(productId) { |
| | | this.graph.unfreeze() |
| | | let params = { |
| | | productId: this.dataForm.productId, |
| | | productId: productId ? productId : this.dataForm.productId, |
| | | taskId: this.dataForm.taskModelId, |
| | | fzId: this.dataForm.id |
| | | fzId: this.dataForm.id, |
| | | smallWidth: 1200, |
| | | 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() |
| | | this.graph.zoomToFit() |
| | | //this.graph.zoomToFit() |
| | | this.graph.freeze() |
| | | } else { |
| | | this.graph.fromJSON(this.emptyJson) |
| | | this.graph.centerContent() |
| | | this.graph.zoomToFit() |
| | | //this.graph.zoomToFit() |
| | | this.graph.freeze() |
| | | } |
| | | console.log(res.data) |
| | |
| | | border: 1px solid #dfe3e8; |
| | | width: 100% !important; |
| | | } |
| | | |
| | | #timeDiagram .x6-cell.x6-node { |
| | | cursor: inherit; |
| | | } |
| | | |
| | | .x6-graph-scroller.x6-graph-scroller-pannable { |
| | | width: 100% !important; |
| | | } |