New file |
| | |
| | | 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.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.sys.model.SysChangeLog; |
| | | import com.zt.life.modules.mainPart.sys.model.SysMysql; |
| | | import com.zt.life.modules.mainPart.sys.service.SysChangeLogService; |
| | | 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; |
| | | |
| | | |
| | | /** |
| | | * sys_change_log |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-10-09 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sys/mysql/") |
| | | public class SysMysqlController { |
| | | @Autowired |
| | | private SysMysqlService sysMysqlService; |
| | | |
| | | @GetMapping("check") |
| | | @ApiOperation("查询") |
| | | public Result<SysMysql> check(String sql){ |
| | | SysMysql data = sysMysqlService.check(sql); |
| | | |
| | | return Result.ok(data); |
| | | } |
| | | |
| | | @GetMapping("execute") |
| | | @ApiOperation("修改") |
| | | public Result execute(String sql){ |
| | | sysMysqlService.execute(sql); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @GetMapping("logDownload") |
| | | @ApiOperation("日志下载") |
| | | public Result logDownload(HttpServletRequest request, HttpServletResponse response){ |
| | | sysMysqlService.logDownload(request,response); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.sys.dao; |
| | | |
| | | |
| | | import com.zt.common.dao.BaseDao; |
| | | import com.zt.life.modules.mainPart.sys.model.SysChangeLog; |
| | | import com.zt.life.modules.mainPart.sys.model.SysMysql; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | @Mapper |
| | | public interface SysMysqlDao extends BaseDao<SysMysql> { |
| | | List<Map<String,Object>> check(String sql); |
| | | |
| | | void execute(String sql); |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.sys.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | @Data |
| | | public class ColumnsTemp { |
| | | private String prop; |
| | | private String label; |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.sys.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | @Data |
| | | public class DataTemp extends Object { |
| | | private Map<String, Object> attributes = new HashMap<>(); |
| | | |
| | | public DataTemp() { |
| | | } |
| | | |
| | | public void setAttribute(String key, Object value) { |
| | | attributes.put(key, value); |
| | | } |
| | | |
| | | public Object getAttribute(String key) { |
| | | return attributes.get(key); |
| | | } |
| | | |
| | | // 为了能够打印出对象的属性,可以重写toString方法 |
| | | @Override |
| | | public String toString() { |
| | | return attributes.toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.sys.model; |
| | | |
| | | import com.zt.common.entity.BaseEntity; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * sys_liveness |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-10-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper=false) |
| | | public class SysMysql extends BaseEntity { |
| | | List<Map<String, Object>> tableData; |
| | | List<ColumnsTemp> tableColumns; |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.sys.service; |
| | | |
| | | import com.zt.common.exception.RenException; |
| | | import com.zt.common.service.BaseService; |
| | | import com.zt.life.modules.mainPart.sys.dao.SysMysqlDao; |
| | | import com.zt.life.modules.mainPart.sys.model.ColumnsTemp; |
| | | import com.zt.life.modules.mainPart.sys.model.SysMysql; |
| | | import com.zt.life.modules.mainPart.taskReliability.service.SimulatAssessService; |
| | | import org.apache.commons.io.input.ReversedLinesFileReader; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Paths; |
| | | import java.nio.file.StandardOpenOption; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | @Service |
| | | public class SysMysqlService extends BaseService<SysMysqlDao, SysMysql> { |
| | | @Value("${zt.oss.log-path}") |
| | | private String logPath; |
| | | |
| | | @Autowired |
| | | private SimulatAssessService simulatAssessService; |
| | | |
| | | public SysMysql check(String sql) { |
| | | try { |
| | | SysMysql sysMysql = new SysMysql(); |
| | | List<Map<String, Object>> data = baseDao.check(sql); |
| | | List<ColumnsTemp> tableColumns = new ArrayList<>(); |
| | | |
| | | for (Map<String, Object> map : data) { |
| | | ColumnsTemp obj = null; |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | obj = new ColumnsTemp(); |
| | | obj.setProp(entry.getKey()); |
| | | obj.setLabel(entry.getKey()); |
| | | tableColumns.add(obj); |
| | | } |
| | | break; |
| | | } |
| | | sysMysql.setTableColumns(tableColumns); |
| | | sysMysql.setTableData(data); |
| | | return sysMysql; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new RenException(String.valueOf(e)); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | public void execute(String sql) { |
| | | try { |
| | | baseDao.execute(sql); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new RenException(String.valueOf(e)); |
| | | } |
| | | } |
| | | |
| | | public void logDownload(HttpServletRequest request, HttpServletResponse response) { |
| | | int n = 300; // 要读取的行数 |
| | | try { |
| | | File file = new File(logPath); |
| | | ReversedLinesFileReader reader = new ReversedLinesFileReader(file); |
| | | |
| | | List<String> lines = new ArrayList<>(); |
| | | String line; |
| | | |
| | | while ((line = reader.readLine()) != null) { |
| | | lines.add(line); |
| | | if (lines.size() == n) { |
| | | break; |
| | | } |
| | | } |
| | | reader.close(); |
| | | Collections.reverse(lines); |
| | | String result = lines.stream().collect(Collectors.joining(", ")); |
| | | String formattedResult = result.replace(", ", "\n"); |
| | | simulatAssessService.writeToTxt(request, response, formattedResult, "日志文件"); |
| | | |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | return Result.ok(); |
| | | } |
| | | @PostMapping("update") |
| | | @ApiOperation("修改") |
| | | @LogOperation("修改") |
| | | public Result update(@RequestBody AssessItem assessItem){ |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(assessItem, AddGroup.class, DefaultGroup.class); |
| | | assessItemDao.updateById(assessItem); |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @PostMapping("assessCheck") |
| | | @ApiOperation("评定模型检查") |
| | |
| | | return Result.ok(dataList); |
| | | } |
| | | |
| | | @GetMapping("delete") |
| | | @ApiOperation("删除") |
| | | @LogOperation("删除") |
| | | public Result delete(Long id){ |
| | | //效验数据 |
| | | assessItemDao.deleteById(id); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | Long getAssessId(Long itemId, Long productId, Long taskId); |
| | | |
| | | String getxml(Long assessId); |
| | | |
| | | void deleteByItemId(Long itemId); |
| | | } |
| | |
| | | public class SchemeComparCurve { |
| | | private String name; |
| | | private String type; |
| | | private String symbol; |
| | | private Boolean smooth; |
| | | private List<Double> data; |
| | | } |
| | |
| | | @ApiModelProperty(value = "产品节点ID") |
| | | private Long productId; |
| | | |
| | | @ApiModelProperty(value = "名称") |
| | | @ApiModelProperty(value = "仿真名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "总体任务模型ID") |
| | |
| | | |
| | | // 建立产品结构树时,相同的设备多个使用时,多个设备使用相同的名称。这样,在此处通过名称来判断是否是相同的设备,相同的设备,需要拿出来作为子标签嵌套进xml。 |
| | | private void assembleModelXml(AssessResult assessResult) { |
| | | /* |
| | | // 测试算法库用 |
| | | String xml = "<des name=\"General system\" gama=\"0.7\">\n" + |
| | | " <tasks>\n" + |
| | | " <task duration=\"1\" model=\"1819282257303678978\"/>\n" + |
| | | " </tasks>\n" + |
| | | " <models>\n" + |
| | | " <model name=\"1819282257303678978\">\n" + |
| | | " <logic name=\"系统\" type=\"series\" >\n" + |
| | | " <logic name=\"分系统1\" type=\"series\" >\n" + |
| | | " <logic name=\"v1\" type=\"parallel\" nums=\"2\">\n" + |
| | | " <node name=\"设备1\" distType=\"exp\" ToE=\"20\" F=\"1\"/>\n" + |
| | | " </logic>\n" + |
| | | " <node name=\"设备2\" distType=\"exp\" ToE=\"0.3\" F=\"1\"/>\n" + |
| | | " </logic>\n" + |
| | | " <logic name=\"分系统2\" type=\"series\" >\n" + |
| | | " <node name=\"设备3\" distType=\"exp\" ToE=\"0.2\" F=\"0\"/>\n" + |
| | | " <node name=\"设备4\" distType=\"ber\" NoE=\"18\" F=\"0\"/>\n" + |
| | | " <logic name=\"v2\" type=\"series\" nums=\"2\">\n" + |
| | | " <node name=\"设备5\" distType=\"exp\" ToE=\"0.5,0,6\" F=\"1,2\"/>\n" + |
| | | " </logic> \n" + |
| | | " <node name=\"设备6\" distType=\"exp\" ToE=\"0.3\" F=\"1\"/>\n" + |
| | | " </logic>\n" + |
| | | " <logic name=\"分系统3\" type=\"vote\" nums=\"3\" k=\"2\" >\n" + |
| | | " <node name=\"设备7\" distType=\"exp\" ToE=\"87\" F=\"1\"/>\n" + |
| | | " </logic>\n" + |
| | | " </logic>\n" + |
| | | " </model>\n" + |
| | | " </models>\n" + |
| | | "</des>"; |
| | | String xml1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + |
| | | "\n" + |
| | | "<des name=\"General system\" gama=\"0.6\">\n" + |
| | | " <tasks>\n" + |
| | | " <task duration=\"1.0\" model=\"1839217232446533633\"/>\n" + |
| | | " </tasks>\n" + |
| | | " <models>\n" + |
| | | " <model name=\"1839217232446533633\">\n" + |
| | | " <logic name=\"1727338143768926498\" real_name=\"评审用船A\" type=\"series\">\n" + |
| | | " <logic name=\"1727338125295232953\" real_name=\"通信系统\" name_path=\"通信系统\" type=\"series\">\n" + |
| | | " <logic name=\"v1\" type=\"parallel\" nums=\"2\">\n" + |
| | | " <node name=\"1727338347041863487,1727338104458428136\" real_name=\"对讲机\" name_path=\"通信系统,对讲机b\" distType=\"ber\" NoE=\"0,10\" F=\"0,1\"/>\n" + |
| | | " </logic>\n" + |
| | | " <node name=\"1727338109884317860\" real_name=\"交换机\" name_path=\"通信系统,交换机\" distType=\"exp\" ToE=\"10\" F=\"1\"/>\n" + |
| | | " </logic>\n" + |
| | | " <logic name=\"1727338132480394459\" real_name=\"空调系统\" name_path=\"空调系统\" type=\"vote\" k=\"2\" nums=\"3\">\n" + |
| | | " <node name=\"1727338148414415252,1727338894880570868,1727338666019181419\" real_name=\"空调\" name_path=\"空调系统,空调c\" distType=\"exp\" ToE=\"88,87,86\" F=\"8,7,6\"/>\n" + |
| | | " </logic>\n" + |
| | | " <logic name=\"1727338199831104683\" real_name=\"电力系统\" name_path=\"电力系统\" type=\"series\">\n" + |
| | | " <node name=\"1727338129701280729\" real_name=\"发电机2\" name_path=\"电力系统,发电机2\" distType=\"ber\" NoE=\"20\" F=\"2\"/>\n" + |
| | | " <node name=\"1727338865212183133\" real_name=\"发电机1\" name_path=\"电力系统,发电机1\" distType=\"exp\" ToE=\"20\" F=\"2\"/>\n" + |
| | | " <node name=\"1727338589328410328\" real_name=\"配电板\" name_path=\"电力系统,配电板\" distType=\"exp\" ToE=\"50\" F=\"5\"/>\n" + |
| | | " <logic name=\"v3\" type=\"series\" nums=\"2\">\n" + |
| | | " <node name=\"1727338101737644187,1727338554151292452\" real_name=\"蓄电池\" name_path=\"电力系统,蓄电池a\" distType=\"exp\" ToE=\"30,40\" F=\"3,4\"/>\n" + |
| | | " </logic>\n" + |
| | | " </logic>\n" + |
| | | " </logic>\n" + |
| | | " </model>\n" + |
| | | " </models>\n" + |
| | | "</des>"; |
| | | assessResult.setXml(xml1); |
| | | */ |
| | | Long productId = assessResult.getProductId(); |
| | | Long taskId = assessResult.getTaskId(); |
| | | Long itemId = assessResult.getItemId(); |
| | |
| | | path = shipPath = name; |
| | | xtPath = ""; |
| | | fxtPath = ""; |
| | | sbPath = ""; |
| | | productId = shipId; |
| | | } else { |
| | | if (type.equals("系统")) { |
| | | if (StringUtils.isNotBlank(shipPath)) { |
| | | path = xtPath = name; |
| | | fxtPath = ""; |
| | | sbPath = ""; |
| | | } else { |
| | | continue; |
| | | } |
| | |
| | | if (type.equals("分系统")) { |
| | | if (StringUtils.isNotBlank(xtPath)) { |
| | | path = fxtPath = xtPath + "," + name; |
| | | sbPath = ""; |
| | | } else { |
| | | continue; |
| | | } |
| | | } |
| | | if (type.equals("设备")) { |
| | | if ((StringUtils.isNotBlank(xtPath) || StringUtils.isNotBlank(fxtPath))) { |
| | | path = sbPath = StringUtils.isNotBlank(fxtPath) ? fxtPath + "," + name : xtPath + "," + name; |
| | | path = StringUtils.isNotBlank(fxtPath) ? fxtPath + "," + name : xtPath + "," + name; |
| | | } else { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | baseDao.deleteByItemId(itemId); |
| | | ReliabilityAssess assess = new ReliabilityAssess(); |
| | | assess.setFailNum(failNum); |
| | | assess.setRunNum(runNum); |
| | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | ImportUtil.updateErrMap(errMap, "导入异常" + e.getMessage(), "", row1); |
| | | //err++; |
| | | } |
| | | |
| | | Date nowDate = new Date(); |
| | |
| | | ProductStatusDto newRow = null; |
| | | if (sameNum > 1) { |
| | | newRow = item.clone(); |
| | | } |
| | | else |
| | | } else |
| | | newRow = item; |
| | | if ("5".equals(newRow.getProductType())){ |
| | | if ("5".equals(newRow.getProductType())) { |
| | | newRow.setDeviceNo(i); |
| | | newRow.setDataId(item.getId().toString() + "-" + i); |
| | | if (i>1){ |
| | | if (i > 1) { |
| | | newRow.setName(item.getName() + "-" + i); |
| | | } |
| | | } |
| | | else{ |
| | | } else { |
| | | newRow.setDeviceNo(0); |
| | | newRow.setDataId(item.getId().toString()); |
| | | } |
| | |
| | | |
| | | public SimulaDataDto getResultXML(SimulatAssess simulatAssess) { |
| | | if (simulatAssess.getDataType() != null && simulatAssess.getDataType().equals("fz")) { |
| | | Integer num = this.getNumById(simulatAssess.getProductId(), simulatAssess.getTaskModelId()); |
| | | simulatAssess.setName("仿真记录" + (num + 1)); |
| | | simulatAssess.setName(simulatAssess.getName()); |
| | | this.update(simulatAssess); |
| | | } |
| | | String filePath = path + "/" + simulatAssess.getId() + "/" + "result.xml"; |
| | |
| | | String[] arr = availability.split(" "); |
| | | // 遍历子字符串数组,将每个元素转换为double并存储到double数组中 |
| | | Double j = 0.0; |
| | | for (int a = 0; a < arr.length; a++) { |
| | | 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])); |
| | | xList.add(j); |
| | |
| | | |
| | | SchemeComparCurve curve = new SchemeComparCurve(); |
| | | curve.setName(task.getTaskName()); |
| | | curve.setSymbol("none"); |
| | | curve.setSmooth(true); |
| | | curve.setType("line"); |
| | | curve.setData(resultData.getCurveParam().getYData()); |
New file |
| | |
| | | <?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.sys.dao.SysMysqlDao"> |
| | | <update id="execute"> |
| | | ${sql} |
| | | </update> |
| | | |
| | | <select id="check" resultType="java.util.Map" parameterType="java.lang.String"> |
| | | ${sql} |
| | | </select> |
| | | </mapper> |
| | |
| | | <!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.taskReliability.dao.ReliabilityAssessDao"> |
| | | <delete id="deleteByItemId"> |
| | | delete |
| | | from assess_data |
| | | where item_id = ${itemId} |
| | | </delete> |
| | | <select id="getProductPath" resultType="com.zt.life.modules.mainPart.basicInfo.model.XhProductModel"> |
| | | select a.* |
| | | from product_model a |
| | |
| | | and a.ship_id = ${shipId} |
| | | </select> |
| | | <select id="getAssessDataList" resultType="com.zt.life.modules.mainPart.taskReliability.model.AssessItem"> |
| | | select a.name,a.id |
| | | select a.name, a.id |
| | | from assess_item a |
| | | where a.IS_DELETE = 0 |
| | | and a.product_id = ${productId} |
| | |
| | | </select> |
| | | <select id="getProductList" |
| | | resultType="com.zt.life.modules.mainPart.taskReliability.model.ReliabilityAssess"> |
| | | SELECT |
| | | a.NAME, |
| | | a.id, |
| | | a.pid, |
| | | a.product_type as type, |
| | | b.run_num, |
| | | b.fail_num, |
| | | b.run_times |
| | | FROM |
| | | product_model a |
| | | LEFT JOIN assess_data b ON b.product_id = a.id |
| | | AND b.is_delete = 0 AND b.item_id = ${itemId} |
| | | WHERE |
| | | a.is_delete = 0 |
| | | AND a.product_type <> 10 |
| | | AND a.ship_id = ${productId} |
| | | SELECT a.NAME, |
| | | a.id, |
| | | a.pid, |
| | | a.product_type as type, |
| | | b.run_num, |
| | | b.fail_num, |
| | | b.run_times |
| | | FROM product_model a |
| | | LEFT JOIN assess_data b ON b.product_id = a.id |
| | | AND b.is_delete = 0 AND b.item_id = ${itemId} |
| | | WHERE a.is_delete = 0 |
| | | AND a.product_type <> 10 |
| | | AND a.ship_id = ${productId} |
| | | OR a.id = ${productId} |
| | | ORDER BY |
| | | a.product_type, |
| | | a.sort |
| | | ORDER BY a.product_type, |
| | | a.sort |
| | | </select> |
| | | <select id="getAssessId" resultType="java.lang.Long"> |
| | | SELECT |
| | | id |
| | | FROM |
| | | assess_result |
| | | WHERE |
| | | is_delete = 0 |
| | | SELECT id |
| | | FROM assess_result |
| | | WHERE is_delete = 0 |
| | | AND item_id = ${itemId} |
| | | AND product_id = ${productId} |
| | | AND task_id = ${taskId} |
| | | ORDER BY |
| | | UPDATE_DATE DESC |
| | | ORDER BY UPDATE_DATE DESC |
| | | LIMIT 1 |
| | | </select> |
| | | <select id="getxml" resultType="java.lang.String"> |
| | | SELECT |
| | | xml |
| | | FROM |
| | | assess_result |
| | | WHERE |
| | | is_delete = 0 |
| | | SELECT xml |
| | | FROM assess_result |
| | | WHERE is_delete = 0 |
| | | AND id = ${assessId} |
| | | </select> |
| | | </mapper> |
| | |
| | | datasource: |
| | | druid: |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://192.168.31.26:3366/reliability_simulat?allowMultiQueries=true&hive.exec.orc.split.strategy=ETL&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8 |
| | | #url: jdbc:mysql://127.0.0.1:3306/reliability_simulat?allowMultiQueries=true&hive.exec.orc.split.strategy=ETL&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8 |
| | | #url: jdbc:mysql://192.168.31.26:3366/reliability_simulat?allowMultiQueries=true&hive.exec.orc.split.strategy=ETL&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8 |
| | | url: jdbc:mysql://127.0.0.1:3306/reliability_simulat?allowMultiQueries=true&hive.exec.orc.split.strategy=ETL&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8 |
| | | username: root |
| | | password: root |
| | | #password: 123456 |
| | | #password: root |
| | | password: 123456 |
| | | # driver-class-name: com.kingbase8.Driver |
| | | # url: jdbc:kingbase8://192.168.0.25:54321/ZHPT?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai |
| | | # username: SYSTEM |
| | |
| | | type: local |
| | | local-domain: http://127.0.0.1:8066/reliability_simulat/ |
| | | local-path: D:/ReliabilitySimulation/ #附件存储目录 |
| | | log-path: C:/Users/admin/Desktop/fileManage(Service)/logs/spring.log #日志目录 |
| | | local-qd-path: D:/TestProjectFiles/ #附件存储目录 |
| | | local-prefix: accessories #附件存储子目录 |
| | | local-area: sy |
New file |
| | |
| | | <template> |
| | | <div> |
| | | <el-form :inline="true" label-width="150px"> |
| | | <el-form-item label="Sql" prop="sql" label-width="150px"> |
| | | <textarea v-model="sql" style="width: 660px;height:200px"></textarea> |
| | | </el-form-item> |
| | | <el-button type="primary" @click="check()">查询</el-button> |
| | | <el-button type="primary" @click="logDownload()">日志下载</el-button> |
| | | </el-form> |
| | | <el-table :data="tableData" height="100px" v-adaptive="{bottomOffset:30}" |
| | | :header-cell-style="{'text-align':'center'}"> |
| | | <el-table-column v-for="column in tableColumns" :key="column.prop" :prop="column.prop" :label="column.label"> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import qs from "qs"; |
| | | import Cookies from "js-cookie"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | sql: '' |
| | | } |
| | | }, |
| | | props: { |
| | | tableData: { |
| | | type: Array, |
| | | }, |
| | | tableColumns: { |
| | | type: Array, |
| | | } |
| | | }, |
| | | methods: { |
| | | async check() { |
| | | let params = { |
| | | sql: this.sql |
| | | } |
| | | let res = await this.$http.get('/sys/mysql/check', {params: params}) |
| | | if (res.success) { |
| | | console.log(res) |
| | | this.tableData = res.data.tableData |
| | | this.tableColumns = res.data.tableColumns |
| | | } |
| | | }, |
| | | async logDownload() { |
| | | let param = qs.stringify({ |
| | | 'token': Cookies.get('token') |
| | | }) |
| | | let apiURL = `/sys/mysql/logDownload` |
| | | window.location.href = `${window.SITE_CONFIG['apiURL']}${apiURL}?${param}` |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
New file |
| | |
| | | <template> |
| | | <div> |
| | | <el-row :gutter="5"> |
| | | <el-col :span="6"> |
| | | <div class="fa-card-a"> |
| | | <el-table :data="tableList" @row-click="selectTable" border highlight-current-row |
| | | :header-cell-style="{'text-align':'center'}" v-adaptive="{bottomOffset:30}" height="100px"> |
| | | <el-table-column prop="tableName" label="数据库表名" align="left"/> |
| | | </el-table> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="18"> |
| | | <el-table v-loading="loading" :data="fieldData" border |
| | | height="100px" v-adaptive="{bottomOffset:30}" |
| | | :header-cell-style="{'text-align':'center'}"> |
| | | <el-table-column prop="columnName" label="字段名" align="center"/> |
| | | <el-table-column prop="remarks" label="备注" align="center"/> |
| | | <el-table-column prop="typeName" label="数据类型" align="center"/> |
| | | </el-table> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | data() { |
| | | return { |
| | | tableList: [], |
| | | fieldData: [], |
| | | loading: false, |
| | | } |
| | | }, |
| | | created() { |
| | | this.getInfo2() |
| | | }, |
| | | components: {}, |
| | | methods: { |
| | | async getInfo2() { |
| | | let res = await this.$http.get(`/sys/generator/properties`) |
| | | if (res.success) { |
| | | this.tableList = res.data.tableList |
| | | } |
| | | }, |
| | | async selectTable(row) { |
| | | let res = await this.$http.get('/sys/generator/getTable?tableName=' + row.tableName) |
| | | if (res.success) { |
| | | this.fieldData = res.data |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | </script> |
New file |
| | |
| | | <template> |
| | | <div> |
| | | <el-form :inline="true" label-width="150px"> |
| | | <el-form-item label="Sql" prop="sql" label-width="150px"> |
| | | <textarea v-model="sql" style="width: 660px;height:200px"></textarea> |
| | | </el-form-item> |
| | | <el-button type="primary" @click="execute()">执行</el-button> |
| | | </el-form> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | sql: '' |
| | | } |
| | | }, |
| | | methods: { |
| | | async execute() { |
| | | let params = { |
| | | sql: this.sql |
| | | } |
| | | let res = await this.$http.get('/sys/mysql/execute', {params: params}) |
| | | if (res.success){ |
| | | this.$alert('执行成功') |
| | | } |
| | | } |
| | | }, |
| | | |
| | | }; |
| | | </script> |
| | | |
| | |
| | | <el-input v-model="dataForm.confidence" placeholder="置信度" clearable></el-input> |
| | | </zt-form-item> |
| | | <el-button type="primary" @click="assess()">评定</el-button> |
| | | <el-button type="primary" @click="add()">新增评定数据</el-button> |
| | | <el-button type="primary" @click="assessData()">评定数据管理</el-button> |
| | | <el-button type="primary" @click="handleExpand()">{{expandText}}</el-button> |
| | | <el-dropdown style="margin-left: 10px" @command="download"> |
| | | <el-button type="primary"> |
| | |
| | | <el-table-column prop="assessResult" label="评定结果" align="right"> |
| | | </el-table-column> |
| | | </el-table> |
| | | <add-or-update @refreshDataList="refreshData" ref="AddOrUpdate"/> |
| | | <assess-manage @refreshDataList="refreshData" ref="AssessManage"/> |
| | | </zt-table-wraper> |
| | | <el-dialog v-dialogDrag :close-on-click-modal="false" top="8vh" :visible.sync="dialogVisible" title="模型检查" |
| | | width="60%" @close="dialogVisible = false"> |
| | |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import AddOrUpdate from './RelisbilityAssess-AddOrUpdate' |
| | | import qs from "qs"; |
| | | import Cookies from "js-cookie"; |
| | | import AssessManage from "./RelisbilityAssess-Manage"; |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | } |
| | | }, |
| | | components: { |
| | | AddOrUpdate |
| | | AssessManage, |
| | | }, |
| | | mounted() { |
| | | this.getProductList() |
| | |
| | | } |
| | | }) |
| | | }, |
| | | refreshData(){ |
| | | this.getAssessDataList() |
| | | }, |
| | | async zhixin() { |
| | | await this.getTaskList() |
| | | await this.getAssessDataList() |
| | |
| | | this.page() |
| | | } |
| | | }, |
| | | refreshData() { |
| | | this.getAssessDataList(); |
| | | }, |
| | | async getAssessDataList() { |
| | | let params = { |
| | | productId: this.dataForm.productId |
| | |
| | | } |
| | | this.flag2 = true |
| | | }, |
| | | add() { |
| | | this.$refs.AddOrUpdate.$refs.dialog.init(null, { |
| | | assessData(){ |
| | | this.$refs.AssessManage.$refs.dialog.init(null, { |
| | | productId: this.dataForm.productId, |
| | | shipName: this.dataForm.shipName |
| | | }) |
| | | }) |
| | | }, |
| | | async assess() { |
| | | this.dialogVisible = false |
| | |
| | | <template> |
| | | <zt-dialog ref="dialog" @confirm="formSubmit" :hasConfirm="true"> |
| | | <zt-dialog ref="dialog" append-to-body @confirm="formSubmit" :hasConfirm="true"> |
| | | <el-form :model="dataForm" ref="dataForm" :disabled="dataForm.disabled" label-width="120px"> |
| | | <zt-form-item label="总体节点" prop="shipName"> |
| | | <el-input v-model="dataForm.shipName" :readonly="true"></el-input> |
| | |
| | | <div style="display:inline-block;font-size: 14px;" class="el-upload__tip"> 只能上传.xlsx或.xls的文件,且不超过2G</div> |
| | | <el-button slot="trigger" size="small" type="primary" style="font-size: 15px">选取文件</el-button> |
| | | <el-button type="primary" size="small" style="margin-left:20px;font-size: 15px" @click="submitUpload()">提 交</el-button> |
| | | <el-button type="primary" size="small" style="margin-left:20px;font-size: 15px" @click="exportData()">下载数据模板</el-button> |
| | | </el-upload> |
| | | </zt-form-item> |
| | | <el-progress :text-inside="true" :stroke-width="30" :percentage="progress.speed"></el-progress> |
| | |
| | | import Cookies from "js-cookie"; |
| | | |
| | | export default { |
| | | name:'assess-AddOrUpdate', |
| | | data() { |
| | | return { |
| | | dataForm: { |
| | | id:'', |
| | | name:'', |
| | | productId:'' |
| | | }, |
| | |
| | | }, |
| | | methods: { |
| | | async init(id, param) { |
| | | let result = await this.$http.get(`/basicInfo/TyProductModel/getUuid`) |
| | | this.dataForm.itemId = result.data |
| | | if(id){ |
| | | this.dataForm.itemId=id |
| | | this.dataForm.id=id |
| | | this.dataForm.name=param.name |
| | | }else{ |
| | | let result = await this.$http.get(`/basicInfo/TyProductModel/getUuid`) |
| | | this.dataForm.itemId = result.data |
| | | } |
| | | this.dataForm.productId = param.productId |
| | | this.dataForm.shipName = param.shipName |
| | | this.fileList = [] |
| | | this.resultData = [] |
| | | this.progress.id = guid() |
| | | let params = qs.stringify({ |
| | |
| | | name:this.dataForm.name, |
| | | productId:this.dataForm.productId |
| | | } |
| | | let res = await this.$http.post('/taskReliability/ReliabilityAssess/add', param) |
| | | let res |
| | | if (this.dataForm.id){ |
| | | res = await this.$http.post('/taskReliability/ReliabilityAssess/update', param) |
| | | }else{ |
| | | res = await this.$http.post('/taskReliability/ReliabilityAssess/add', param) |
| | | } |
| | | if (res.success) { |
| | | await this.$tip.success() |
| | | this.$refs.dialog.close() |
| | | this.$emit('refreshDataList') |
| | | } |
| | | }, |
| | | exportData() { |
| | | window.location.href = './评定数据导入模板.xlsx' |
| | | }, |
| | | |
| | | } |
| | | } |
| | | </script> |
New file |
| | |
| | | <template> |
| | | <zt-dialog ref="dialog" column="2" append-to-body title="评定数据管理" :editAble="false" :hasConfirm="false"> |
| | | <el-form :inline="true" label-width="100px" :model="dataForm"> |
| | | <el-form-item label="总体节点" prop="shipName" style="width: 26%"> |
| | | <el-input v-model="dataForm.shipName" :readonly="true"></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" size="small" style="margin-left:20px;font-size: 15px" @click="exportData()">下载数据模板 |
| | | </el-button> |
| | | <el-button type="primary" @click="add()">新增</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-table :data="assessData" border highlight-current-row |
| | | :header-cell-style="{'text-align':'center'}"> |
| | | <el-table-column prop="name" label="评定数据名称" align="center"/> |
| | | <el-table-column width="100"> |
| | | <template v-slot="{row}"> |
| | | <zt-table-button type="primary" @click="updateAssess(row)">修改</zt-table-button> |
| | | <zt-table-button type="primary" @click="deleteAssess(row)">删除</zt-table-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <add-or-update @refreshDataList="refreshData" ref="addOrUpdate"/> |
| | | </zt-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import addOrUpdate from "./RelisbilityAssess-AddOrUpdate"; |
| | | |
| | | export default { |
| | | name: 'assess-Manage', |
| | | data() { |
| | | return { |
| | | dataForm: { |
| | | shipName: '', |
| | | name: '', |
| | | productId: '' |
| | | }, |
| | | assessData: [], |
| | | productList: [], |
| | | } |
| | | }, |
| | | components: { |
| | | addOrUpdate |
| | | }, |
| | | methods: { |
| | | async init(id, param) { |
| | | this.dataForm.productId = param.productId |
| | | this.dataForm.shipName = param.shipName |
| | | this.getAssessDataList() |
| | | }, |
| | | refreshData(){ |
| | | this.getAssessDataList() |
| | | }, |
| | | async getAssessDataList() { |
| | | let params = { |
| | | productId: this.dataForm.productId |
| | | } |
| | | let res = await this.$http.get(`/taskReliability/ReliabilityAssess/getAssessDataList`, {params: params}) |
| | | if (res.success) { |
| | | this.assessData = res.data |
| | | } |
| | | }, |
| | | add() { |
| | | this.$refs.addOrUpdate.$refs.dialog.init(null, { |
| | | productId: this.dataForm.productId, |
| | | shipName: this.dataForm.shipName |
| | | }) |
| | | }, |
| | | updateAssess(row) { |
| | | this.$refs.addOrUpdate.$refs.dialog.init(row.id, { |
| | | productId: row.productId, |
| | | shipName: this.dataForm.shipName, |
| | | name: row.name |
| | | }) |
| | | }, |
| | | async deleteAssess(row) { |
| | | let params = { |
| | | id: row.id |
| | | } |
| | | let res = await this.$http.get(`/taskReliability/ReliabilityAssess/delete`, {params: params}) |
| | | if (res.success) { |
| | | this.getAssessDataList() |
| | | } |
| | | }, |
| | | exportData() { |
| | | window.location.href = './评定数据导入模板.xlsx' |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <zt-form-item label="总体任务" prop="taskModelId"> |
| | | <zt-select v-model="dataForm.taskModelId" :datas="taskList" @change="onTaskSelected"/> |
| | | </zt-form-item> |
| | | <zt-form-item label="仿真名称" prop="name"> |
| | | <el-input v-model="dataForm.name" placeholder="请输入名称" clearable></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item label="时间分片" prop="samplPeriod"> |
| | | <el-input type="number" :min="1" v-model="dataForm.samplPeriod" |
| | | style="width: 150px;vertical-align: baseline;"> |
| | |
| | | <zt-form-item style="margin-left: 10px"> |
| | | <zt-button @click="analyze()">仿真分析</zt-button> |
| | | <zt-button @click="displayProcess()">算法库进程</zt-button> |
| | | <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> |
| | | </zt-form-item> |
| | | </el-form> |
| | | <el-progress v-if="isShow" :percentage="percentage"></el-progress> |
| | |
| | | dataForm: { |
| | | id: '', |
| | | pid: '', |
| | | name:'', |
| | | productId: '', |
| | | showProductId: '', |
| | | taskModelId: '', |
| | |
| | | }, |
| | | mounted() { |
| | | this.getProductList() |
| | | }, |
| | | watch: { |
| | | // percentage() { |
| | | // if (this.percentage === 100) { |
| | | // this.$refs.SimulatCurve.initEcharts(this.dataForm); |
| | | // } |
| | | // } |
| | | }, |
| | | components: { |
| | | ProductModelTree, |
| | |
| | | this.timers = window.setInterval(this.getStroke, 1000) |
| | | } |
| | | } |
| | | }, |
| | | async download(selsect) { |
| | | if(this.dataForm.id){ |
| | | let param = qs.stringify({ |
| | | 'token': Cookies.get('token'), |
| | | type: 'fz', |
| | | xml:selsect, |
| | | id: this.dataForm.id |
| | | }) |
| | | let apiURL = `/taskReliability/SimulatAssess/downloadXml` |
| | | window.location.href = `${window.SITE_CONFIG['apiURL']}${apiURL}?${param}` |
| | | }else{ |
| | | this.$alert('还未进行仿真操作') |
| | | } |
| | | |
| | | }, |
| | | displayProcess() { |
| | | this.$refs.process.$refs.dialog.init() |
| | |
| | | }, |
| | | series: [ |
| | | { |
| | | symbol: "none", |
| | | data: this.yDataList, |
| | | type: 'line', |
| | | smooth: true |
| | |
| | | <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"> |
| | |
| | | <script> |
| | | import SimulatCurve from "./SimulatCurve"; |
| | | import ProductModelTree from "../basicInfo/ProductModelTree"; |
| | | import qs from "qs"; |
| | | import Cookies from "js-cookie"; |
| | | |
| | | |
| | | export default { |
| | |
| | | this.$refs.SimulatCurve.initEcharts(this.dataForm) |
| | | }) |
| | | }, |
| | | async download(selsect) { |
| | | if(this.dataForm.id){ |
| | | let param = qs.stringify({ |
| | | 'token': Cookies.get('token'), |
| | | type: 'fz', |
| | | xml:selsect, |
| | | id: this.dataForm.id |
| | | }) |
| | | let apiURL = `/taskReliability/SimulatAssess/downloadXml` |
| | | window.location.href = `${window.SITE_CONFIG['apiURL']}${apiURL}?${param}` |
| | | }else{ |
| | | this.$alert('还未选择仿真记录') |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <task-phase-model @getList="refreshData" ref="model"/> |
| | | <task-phase-model ref="model"/> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | |
| | | methods: { |
| | | refreshData() { |
| | | this.$refs.tableObj.query() |
| | | this.$refs.task.$refs.tableObj.query() |
| | | }, |
| | | dataLoaded(data) { |
| | | this.time = null |