jiangbiao 1 سال پیش
والد
کامیت
6a709d1c16

+ 232 - 0
master/src/main/java/com/ruoyi/project/reliability/controller/TQualitativeAnalysisController.java

@@ -0,0 +1,232 @@
+package com.ruoyi.project.reliability.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.ruoyi.common.utils.file.ExcelUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.framework.aspectj.lang.annotation.Log;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
+import com.ruoyi.framework.web.controller.BaseController;
+import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.framework.web.page.TableDataInfo;
+import com.ruoyi.project.reliability.domain.TQualitativeAnalysis;
+import com.ruoyi.project.reliability.domain.TRiskMatrixVo;
+import com.ruoyi.project.reliability.service.ITQualitativeAnalysisService;
+import org.apache.poi.ss.usermodel.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 定性分析Controller
+ *
+ * @author ssy
+ * @date 2024-03-04
+ */
+@RestController
+@RequestMapping("/reliability/analysis")
+public class TQualitativeAnalysisController extends BaseController {
+    @Autowired
+    private ITQualitativeAnalysisService tQualitativeAnalysisService;
+
+    /**
+     * 查询定性分析列表
+     */
+    @PreAuthorize("@ss.hasPermi('reliability:analysis:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TQualitativeAnalysis tQualitativeAnalysis) {
+        startPage();
+        List<TQualitativeAnalysis> list = tQualitativeAnalysisService.selectTQualitativeAnalysisList(tQualitativeAnalysis);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出定性分析列表
+     */
+    @PreAuthorize("@ss.hasPermi('reliability:analysis:export')")
+    @Log(title = "定性分析", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TQualitativeAnalysis tQualitativeAnalysis) {
+        List<TQualitativeAnalysis> list = tQualitativeAnalysisService.selectTQualitativeAnalysisList(tQualitativeAnalysis);
+        ExcelUtil<TQualitativeAnalysis> util = new ExcelUtil<TQualitativeAnalysis>(TQualitativeAnalysis.class);
+        return util.exportExcel(list, "analysis");
+    }
+
+    /**
+     * 获取定性分析详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('reliability:analysis:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return AjaxResult.success(tQualitativeAnalysisService.selectTQualitativeAnalysisById(id));
+    }
+
+    /**
+     * 新增定性分析
+     */
+    @PreAuthorize("@ss.hasPermi('reliability:analysis:add')")
+    @Log(title = "定性分析", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TQualitativeAnalysis tQualitativeAnalysis) {
+        return toAjax(tQualitativeAnalysisService.insertTQualitativeAnalysis(tQualitativeAnalysis));
+    }
+
+    /**
+     * 修改定性分析
+     */
+    @PreAuthorize("@ss.hasPermi('reliability:analysis:edit')")
+    @Log(title = "定性分析", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TQualitativeAnalysis tQualitativeAnalysis) {
+        return toAjax(tQualitativeAnalysisService.updateTQualitativeAnalysis(tQualitativeAnalysis));
+    }
+
+    /**
+     * 删除定性分析
+     */
+    @PreAuthorize("@ss.hasPermi('reliability:analysis:remove')")
+    @Log(title = "定性分析", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(tQualitativeAnalysisService.deleteTQualitativeAnalysisByIds(ids));
+    }
+
+    @GetMapping("/riskMatrixData")
+    public AjaxResult riskMatrixData() {
+
+        TRiskMatrixVo vo = tQualitativeAnalysisService.selectTRiskMatrixVoData();
+        double ecSum = vo.getEcha() +
+                vo.getEchb() +
+                vo.getEcha() +
+                vo.getEcmc() +
+                vo.getEcmmb() +
+                vo.getEcmhb() +
+                vo.getEcld() +
+                vo.getEclc() +
+                vo.getEclb();
+        vo.setOmr(vo.getOmr() - vo.getNr());
+        vo.setOpr(vo.getOpr() - vo.getNr());
+        if (ecSum == 0) {
+            vo.setTotalA("0%");
+            vo.setTotalB("0%");
+            vo.setTotalC("0%");
+            vo.setTotalD("0%");
+        } else {
+            vo.setTotalA(String.format("%.0f",(vo.getCountA() / ecSum) * 100) + "%");
+            vo.setTotalB(String.format("%.0f",(vo.getCountB() / ecSum) * 100) + "%");
+            vo.setTotalC(String.format("%.0f",(vo.getCountC() / ecSum) * 100) + "%");
+            vo.setTotalD(String.format("%.0f",(vo.getCountD() / ecSum) * 100) + "%");
+        }
+        return AjaxResult.success(vo);
+    }
+
+    @PreAuthorize("@ss.hasPermi('reliability:analysis:add')")
+    @Log(title = "定性分析", businessType = BusinessType.INSERT)
+    @PostMapping("/importData")
+    public AjaxResult importData(@RequestParam("file") MultipartFile file) throws IOException {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<Integer>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TQualitativeAnalysis> list = new ArrayList<>();
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 1; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                int cellNum = row.getPhysicalNumberOfCells();
+                TQualitativeAnalysis entity = new TQualitativeAnalysis();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    //  cell.setCellType(CellType.STRING);
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    if (cell.getCellType()== CellType.FORMULA){
+                        FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();
+                        CellValue evaluate = evaluator.evaluate(cell);
+                        cellValue=evaluate.formatAsString();
+                        cellValue=cellValue.replace("\"","");
+                    }
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setLocation(cellValue);
+                    } else if (j == 1) {
+                        entity.setTagNo(cellValue);
+                    } else if (j == 2) {
+                        entity.setDescription(cellValue);
+                    } else if (j == 3) {
+                        entity.setObjectType(cellValue);
+                    } else if (j == 4) {
+                        entity.setCatalogProfile(cellValue);
+                    } else if (j == 5) {
+                        entity.setSpecificationMode(cellValue);
+                    } else if (j == 6) {
+                        entity.setMaterialSpecification(cellValue);
+                    } else if (j == 7) {
+                        entity.setRelevant(cellValue);
+                    } else if (j == 8) {
+                        entity.setFrequencyFailure(cellValue);
+                    } else if (j == 9) {
+                        entity.setMaintenanceCost(cellValue);
+                    } else if (j == 10) {
+                        entity.setProductionLoss(cellValue);
+                    } else if (j == 11) {
+                        entity.setMaintenanceRisk(cellValue);
+                    } else if (j == 12) {
+                        entity.setProductionRisk(cellValue);
+                    } else if (j == 13) {
+                        entity.setEquipmentCategory(cellValue);
+                    } else if (j == 14) {
+                        entity.setRiskCriticality(cellValue);
+                    } else if (j == 15) {
+                        entity.setQuantitativeAnalysis(cellValue);
+                    } else if (j == 16) {
+                        entity.setMaintenanceStrategy(cellValue);
+                    } else if (j == 17) {
+                        entity.setMsDescription(cellValue);
+                    } else if (j == 18) {
+                        entity.setSparepartStrategy(cellValue);
+                    } else if (j == 19) {
+                        entity.setSsDescription(cellValue);
+                    } else if (j == 20) {
+                        entity.setNeedClarification(cellValue);
+                    } else if (j == 21) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                entity.setCreaterCode(getUserId().toString());
+                entity.setCreatedate(new Date());
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                failRow.add(i + 1);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TQualitativeAnalysis t : list
+        ) {
+            failNum++;
+            try {
+                tQualitativeAnalysisService.insertTQualitativeAnalysis(t);
+                successNumber++;
+            } catch (Exception e) {
+                failNumber++;
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:" + JSON.toJSONString(list));
+        logger.info("successNumber:" + String.valueOf(successNumber));
+        logger.info("failNumber:" + String.valueOf(failNumber));
+        logger.info("failRow:" + String.valueOf(failRow));
+        return AjaxResult.success(String.valueOf(successNumber), failRow);
+    }
+}

+ 437 - 0
master/src/main/java/com/ruoyi/project/reliability/domain/TQualitativeAnalysis.java

@@ -0,0 +1,437 @@
+package com.ruoyi.project.reliability.domain;
+
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.framework.aspectj.lang.annotation.Excel;
+import com.ruoyi.framework.web.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 定性分析对象 t_qualitative_analysis
+ *
+ * @author ssy
+ * @date 2024-03-04
+ */
+public class TQualitativeAnalysis extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** ID */
+    private Long id;
+
+    /** 位置 */
+    @Excel(name = "位置")
+    private String location;
+
+    /** 位号 */
+    @Excel(name = "位号")
+    private String tagNo;
+
+    /** 描述 */
+    @Excel(name = "描述")
+    private String description;
+
+    /** Object Type */
+    @Excel(name = "Object Type")
+    private String objectType;
+
+    /** Catalog Profile */
+    @Excel(name = "Catalog Profile")
+    private String catalogProfile;
+
+    /** Relevant (r)/not relevant (n) */
+    @Excel(name = "Relevant (r)/not relevant (n)")
+    private String relevant;
+
+    /** 故障频率 */
+    @Excel(name = "故障频率")
+    private String frequencyFailure;
+
+    /** 维护成本 */
+    @Excel(name = "维护成本")
+    private String maintenanceCost;
+
+    /** 生成损失 */
+    @Excel(name = "生成损失")
+    private String productionLoss;
+
+    /** 维护风险 */
+    @Excel(name = "维护风险")
+    private String maintenanceRisk;
+
+    /** 生成风险 */
+    @Excel(name = "生成风险")
+    private String productionRisk;
+
+    /** 设备类别 */
+    @Excel(name = "设备类别")
+    private String equipmentCategory;
+
+    /** 风险程度 */
+    @Excel(name = "风险程度")
+    private String riskCriticality;
+
+    /** 定量分析 */
+    @Excel(name = "定量分析")
+    private String quantitativeAnalysis;
+
+    /** 维修策略(目前) */
+    @Excel(name = "维修策略", readConverterExp = "目=前")
+    private String maintenanceStrategy;
+
+    /** 维修策略描述 */
+    @Excel(name = "维修策略描述")
+    private String msDescription;
+
+    /** 备件策略(当前) */
+    @Excel(name = "备件策略", readConverterExp = "当=前")
+    private String sparepartStrategy;
+
+    /** 备件策略描述 */
+    @Excel(name = "备件策略描述")
+    private String ssDescription;
+
+    /** 需要澄清 */
+    @Excel(name = "需要澄清")
+    private String needClarification;
+
+    /** 备注 */
+    @Excel(name = "备注")
+    private String remarks;
+
+    /** 删除 */
+    private Long delFlag;
+
+    /** 创建人 */
+    @Excel(name = "创建人")
+    private String createrCode;
+
+    /** 创建日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date createdate;
+
+    /** 更新人 */
+    @Excel(name = "更新人")
+    private String updaterCode;
+
+    /** 更新日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "更新日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date updatedate;
+
+    /** 部门编号 */
+    private Long deptId;
+
+    /** 部门名称 */
+    @Excel(name = "部门名称")
+    @TableField(exist = false)
+    private String deptName;
+
+    private String materialSpecification;
+    private String specificationMode;
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public String getMaterialSpecification() {
+        return materialSpecification;
+    }
+
+    public void setMaterialSpecification(String materialSpecification) {
+        this.materialSpecification = materialSpecification;
+    }
+
+    public String getSpecificationMode() {
+        return specificationMode;
+    }
+
+    public void setSpecificationMode(String specificationMode) {
+        this.specificationMode = specificationMode;
+    }
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setLocation(String location)
+    {
+        this.location = location;
+    }
+
+    public String getLocation()
+    {
+        return location;
+    }
+    public void setTagNo(String tagNo)
+    {
+        this.tagNo = tagNo;
+    }
+
+    public String getTagNo()
+    {
+        return tagNo;
+    }
+    public void setDescription(String description)
+    {
+        this.description = description;
+    }
+
+    public String getDescription()
+    {
+        return description;
+    }
+    public void setObjectType(String objectType)
+    {
+        this.objectType = objectType;
+    }
+
+    public String getObjectType()
+    {
+        return objectType;
+    }
+    public void setCatalogProfile(String catalogProfile)
+    {
+        this.catalogProfile = catalogProfile;
+    }
+
+    public String getCatalogProfile()
+    {
+        return catalogProfile;
+    }
+    public void setRelevant(String relevant)
+    {
+        this.relevant = relevant;
+    }
+
+    public String getRelevant()
+    {
+        return relevant;
+    }
+    public void setFrequencyFailure(String frequencyFailure)
+    {
+        this.frequencyFailure = frequencyFailure;
+    }
+
+    public String getFrequencyFailure()
+    {
+        return frequencyFailure;
+    }
+    public void setMaintenanceCost(String maintenanceCost)
+    {
+        this.maintenanceCost = maintenanceCost;
+    }
+
+    public String getMaintenanceCost()
+    {
+        return maintenanceCost;
+    }
+    public void setProductionLoss(String productionLoss)
+    {
+        this.productionLoss = productionLoss;
+    }
+
+    public String getProductionLoss()
+    {
+        return productionLoss;
+    }
+    public void setMaintenanceRisk(String maintenanceRisk)
+    {
+        this.maintenanceRisk = maintenanceRisk;
+    }
+
+    public String getMaintenanceRisk()
+    {
+        return maintenanceRisk;
+    }
+    public void setProductionRisk(String productionRisk)
+    {
+        this.productionRisk = productionRisk;
+    }
+
+    public String getProductionRisk()
+    {
+        return productionRisk;
+    }
+    public void setEquipmentCategory(String equipmentCategory)
+    {
+        this.equipmentCategory = equipmentCategory;
+    }
+
+    public String getEquipmentCategory()
+    {
+        return equipmentCategory;
+    }
+    public void setRiskCriticality(String riskCriticality)
+    {
+        this.riskCriticality = riskCriticality;
+    }
+
+    public String getRiskCriticality()
+    {
+        return riskCriticality;
+    }
+    public void setQuantitativeAnalysis(String quantitativeAnalysis)
+    {
+        this.quantitativeAnalysis = quantitativeAnalysis;
+    }
+
+    public String getQuantitativeAnalysis()
+    {
+        return quantitativeAnalysis;
+    }
+    public void setMaintenanceStrategy(String maintenanceStrategy)
+    {
+        this.maintenanceStrategy = maintenanceStrategy;
+    }
+
+    public String getMaintenanceStrategy()
+    {
+        return maintenanceStrategy;
+    }
+    public void setMsDescription(String msDescription)
+    {
+        this.msDescription = msDescription;
+    }
+
+    public String getMsDescription()
+    {
+        return msDescription;
+    }
+    public void setSparepartStrategy(String sparepartStrategy)
+    {
+        this.sparepartStrategy = sparepartStrategy;
+    }
+
+    public String getSparepartStrategy()
+    {
+        return sparepartStrategy;
+    }
+    public void setSsDescription(String ssDescription)
+    {
+        this.ssDescription = ssDescription;
+    }
+
+    public String getSsDescription()
+    {
+        return ssDescription;
+    }
+    public void setNeedClarification(String needClarification)
+    {
+        this.needClarification = needClarification;
+    }
+
+    public String getNeedClarification()
+    {
+        return needClarification;
+    }
+    public void setRemarks(String remarks)
+    {
+        this.remarks = remarks;
+    }
+
+    public String getRemarks()
+    {
+        return remarks;
+    }
+    public void setDelFlag(Long delFlag)
+    {
+        this.delFlag = delFlag;
+    }
+
+    public Long getDelFlag()
+    {
+        return delFlag;
+    }
+    public void setCreaterCode(String createrCode)
+    {
+        this.createrCode = createrCode;
+    }
+
+    public String getCreaterCode()
+    {
+        return createrCode;
+    }
+    public void setCreatedate(Date createdate)
+    {
+        this.createdate = createdate;
+    }
+
+    public Date getCreatedate()
+    {
+        return createdate;
+    }
+    public void setUpdaterCode(String updaterCode)
+    {
+        this.updaterCode = updaterCode;
+    }
+
+    public String getUpdaterCode()
+    {
+        return updaterCode;
+    }
+    public void setUpdatedate(Date updatedate)
+    {
+        this.updatedate = updatedate;
+    }
+
+    public Date getUpdatedate()
+    {
+        return updatedate;
+    }
+    public void setDeptId(Long deptId)
+    {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId()
+    {
+        return deptId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("location", getLocation())
+            .append("tagNo", getTagNo())
+            .append("description", getDescription())
+            .append("objectType", getObjectType())
+            .append("catalogProfile", getCatalogProfile())
+            .append("relevant", getRelevant())
+            .append("frequencyFailure", getFrequencyFailure())
+            .append("maintenanceCost", getMaintenanceCost())
+            .append("productionLoss", getProductionLoss())
+            .append("maintenanceRisk", getMaintenanceRisk())
+            .append("productionRisk", getProductionRisk())
+            .append("equipmentCategory", getEquipmentCategory())
+            .append("riskCriticality", getRiskCriticality())
+            .append("quantitativeAnalysis", getQuantitativeAnalysis())
+            .append("maintenanceStrategy", getMaintenanceStrategy())
+            .append("msDescription", getMsDescription())
+            .append("sparepartStrategy", getSparepartStrategy())
+            .append("ssDescription", getSsDescription())
+            .append("needClarification", getNeedClarification())
+            .append("remarks", getRemarks())
+            .append("delFlag", getDelFlag())
+            .append("createrCode", getCreaterCode())
+            .append("createdate", getCreatedate())
+            .append("updaterCode", getUpdaterCode())
+            .append("updatedate", getUpdatedate())
+            .append("deptId", getDeptId())
+            .toString();
+    }
+}

+ 347 - 0
master/src/main/java/com/ruoyi/project/reliability/domain/TRiskMatrixVo.java

@@ -0,0 +1,347 @@
+package com.ruoyi.project.reliability.domain;
+
+public class TRiskMatrixVo {
+    private int mrhb2;
+    private int mrha1;
+    private int mrha0;
+    private int mrmc2;
+    private int mrmb1;
+    private int mrma0;
+    private int mrlc2;
+    private int mrlc1;
+    private int mrlb0;
+    private int prhb2;
+    private int prha1;
+    private int prha0;
+    private int prmc2;
+    private int prmb1;
+    private int prma0;
+    private int prlc2;
+    private int prlc1;
+    private int prlb0;
+    private int echc;
+    private int echb;
+    private int echa;
+    private int ecmc;
+    private int ecmmb;
+    private int ecmhb;
+    private int ecld;
+    private int eclc;
+    private int eclb;
+    private int nr;
+    private int omr;
+    private int opr;
+    private int countA;
+    private int countB;
+    private int countC;
+    private int countD;
+    private String totalA;
+    private String totalB;
+    private String totalC;
+    private String totalD;
+
+
+    public int getMrhb2() {
+        return mrhb2;
+    }
+
+    public void setMrhb2(int mrhb2) {
+        this.mrhb2 = mrhb2;
+    }
+
+    public int getMrha1() {
+        return mrha1;
+    }
+
+    public void setMrha1(int mrha1) {
+        this.mrha1 = mrha1;
+    }
+
+    public int getMrha0() {
+        return mrha0;
+    }
+
+    public void setMrha0(int mrha0) {
+        this.mrha0 = mrha0;
+    }
+
+    public int getMrmc2() {
+        return mrmc2;
+    }
+
+    public void setMrmc2(int mrmc2) {
+        this.mrmc2 = mrmc2;
+    }
+
+    public int getMrmb1() {
+        return mrmb1;
+    }
+
+    public void setMrmb1(int mrmb1) {
+        this.mrmb1 = mrmb1;
+    }
+
+    public int getMrma0() {
+        return mrma0;
+    }
+
+    public void setMrma0(int mrma0) {
+        this.mrma0 = mrma0;
+    }
+
+    public int getMrlc2() {
+        return mrlc2;
+    }
+
+    public void setMrlc2(int mrlc2) {
+        this.mrlc2 = mrlc2;
+    }
+
+    public int getMrlc1() {
+        return mrlc1;
+    }
+
+    public void setMrlc1(int mrlc1) {
+        this.mrlc1 = mrlc1;
+    }
+
+    public int getMrlb0() {
+        return mrlb0;
+    }
+
+    public void setMrlb0(int mrlb0) {
+        this.mrlb0 = mrlb0;
+    }
+
+    public int getPrhb2() {
+        return prhb2;
+    }
+
+    public void setPrhb2(int prhb2) {
+        this.prhb2 = prhb2;
+    }
+
+    public int getPrha1() {
+        return prha1;
+    }
+
+    public void setPrha1(int prha1) {
+        this.prha1 = prha1;
+    }
+
+    public int getPrha0() {
+        return prha0;
+    }
+
+    public void setPrha0(int prha0) {
+        this.prha0 = prha0;
+    }
+
+    public int getPrmc2() {
+        return prmc2;
+    }
+
+    public void setPrmc2(int prmc2) {
+        this.prmc2 = prmc2;
+    }
+
+    public int getPrmb1() {
+        return prmb1;
+    }
+
+    public void setPrmb1(int prmb1) {
+        this.prmb1 = prmb1;
+    }
+
+    public int getPrma0() {
+        return prma0;
+    }
+
+    public void setPrma0(int prma0) {
+        this.prma0 = prma0;
+    }
+
+    public int getPrlc2() {
+        return prlc2;
+    }
+
+    public void setPrlc2(int prlc2) {
+        this.prlc2 = prlc2;
+    }
+
+    public int getPrlc1() {
+        return prlc1;
+    }
+
+    public void setPrlc1(int prlc1) {
+        this.prlc1 = prlc1;
+    }
+
+    public int getPrlb0() {
+        return prlb0;
+    }
+
+    public void setPrlb0(int prlb0) {
+        this.prlb0 = prlb0;
+    }
+
+    public int getEchc() {
+        return echc;
+    }
+
+    public void setEchc(int echc) {
+        this.echc = echc;
+    }
+
+    public int getEchb() {
+        return echb;
+    }
+
+    public void setEchb(int echb) {
+        this.echb = echb;
+    }
+
+    public int getEcha() {
+        return echa;
+    }
+
+    public void setEcha(int echa) {
+        this.echa = echa;
+    }
+
+    public int getEcmc() {
+        return ecmc;
+    }
+
+    public void setEcmc(int ecmc) {
+        this.ecmc = ecmc;
+    }
+
+    public int getEcmmb() {
+        return ecmmb;
+    }
+
+    public void setEcmmb(int ecmmb) {
+        this.ecmmb = ecmmb;
+    }
+
+    public int getEcmhb() {
+        return ecmhb;
+    }
+
+    public void setEcmhb(int ecmhb) {
+        this.ecmhb = ecmhb;
+    }
+
+    public int getEcld() {
+        return ecld;
+    }
+
+    public void setEcld(int ecld) {
+        this.ecld = ecld;
+    }
+
+    public int getEclc() {
+        return eclc;
+    }
+
+    public void setEclc(int eclc) {
+        this.eclc = eclc;
+    }
+
+    public int getEclb() {
+        return eclb;
+    }
+
+    public void setEclb(int eclb) {
+        this.eclb = eclb;
+    }
+
+    public int getNr() {
+        return nr;
+    }
+
+    public void setNr(int nr) {
+        this.nr = nr;
+    }
+
+    public int getOmr() {
+        return omr;
+    }
+
+    public void setOmr(int omr) {
+        this.omr = omr;
+    }
+
+    public int getOpr() {
+        return opr;
+    }
+
+    public void setOpr(int opr) {
+        this.opr = opr;
+    }
+
+    public int getCountA() {
+        return countA;
+    }
+
+    public void setCountA(int countA) {
+        this.countA = countA;
+    }
+
+    public int getCountB() {
+        return countB;
+    }
+
+    public void setCountB(int countB) {
+        this.countB = countB;
+    }
+
+    public int getCountC() {
+        return countC;
+    }
+
+    public void setCountC(int countC) {
+        this.countC = countC;
+    }
+
+    public int getCountD() {
+        return countD;
+    }
+
+    public void setCountD(int countD) {
+        this.countD = countD;
+    }
+
+    public String getTotalA() {
+        return totalA;
+    }
+
+    public void setTotalA(String totalA) {
+        this.totalA = totalA;
+    }
+
+    public String getTotalB() {
+        return totalB;
+    }
+
+    public void setTotalB(String totalB) {
+        this.totalB = totalB;
+    }
+
+    public String getTotalC() {
+        return totalC;
+    }
+
+    public void setTotalC(String totalC) {
+        this.totalC = totalC;
+    }
+
+    public String getTotalD() {
+        return totalD;
+    }
+
+    public void setTotalD(String totalD) {
+        this.totalD = totalD;
+    }
+}

+ 66 - 0
master/src/main/java/com/ruoyi/project/reliability/mapper/TQualitativeAnalysisMapper.java

@@ -0,0 +1,66 @@
+package com.ruoyi.project.reliability.mapper;
+
+import java.util.List;
+import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
+import com.ruoyi.project.reliability.domain.TQualitativeAnalysis;
+import com.ruoyi.project.reliability.domain.TRiskMatrixVo;
+
+/**
+ * 定性分析Mapper接口
+ *
+ * @author ssy
+ * @date 2024-03-04
+ */
+public interface TQualitativeAnalysisMapper
+{
+    /**
+     * 查询定性分析
+     *
+     * @param id 定性分析ID
+     * @return 定性分析
+     */
+    public TQualitativeAnalysis selectTQualitativeAnalysisById(Long id);
+
+    /**
+     * 查询定性分析列表
+     *
+     * @param tQualitativeAnalysis 定性分析
+     * @return 定性分析集合
+     */
+    @DataScope(deptAlias = "d")
+    public List<TQualitativeAnalysis> selectTQualitativeAnalysisList(TQualitativeAnalysis tQualitativeAnalysis);
+
+    public TRiskMatrixVo selectTRiskMatrixVoData();
+
+    /**
+     * 新增定性分析
+     *
+     * @param tQualitativeAnalysis 定性分析
+     * @return 结果
+     */
+    public int insertTQualitativeAnalysis(TQualitativeAnalysis tQualitativeAnalysis);
+
+    /**
+     * 修改定性分析
+     *
+     * @param tQualitativeAnalysis 定性分析
+     * @return 结果
+     */
+    public int updateTQualitativeAnalysis(TQualitativeAnalysis tQualitativeAnalysis);
+
+    /**
+     * 删除定性分析
+     *
+     * @param id 定性分析ID
+     * @return 结果
+     */
+    public int deleteTQualitativeAnalysisById(Long id);
+
+    /**
+     * 批量删除定性分析
+     *
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteTQualitativeAnalysisByIds(Long[] ids);
+}

+ 64 - 0
master/src/main/java/com/ruoyi/project/reliability/service/ITQualitativeAnalysisService.java

@@ -0,0 +1,64 @@
+package com.ruoyi.project.reliability.service;
+
+import com.ruoyi.project.reliability.domain.TQualitativeAnalysis;
+import com.ruoyi.project.reliability.domain.TRiskMatrixVo;
+
+import java.util.List;
+
+/**
+ * 定性分析Service接口
+ *
+ * @author ssy
+ * @date 2024-03-04
+ */
+public interface ITQualitativeAnalysisService {
+    /**
+     * 查询定性分析
+     *
+     * @param id 定性分析ID
+     * @return 定性分析
+     */
+    public TQualitativeAnalysis selectTQualitativeAnalysisById(Long id);
+
+    /**
+     * 查询定性分析列表
+     *
+     * @param tQualitativeAnalysis 定性分析
+     * @return 定性分析集合
+     */
+    public List<TQualitativeAnalysis> selectTQualitativeAnalysisList(TQualitativeAnalysis tQualitativeAnalysis);
+
+    /**
+     * 新增定性分析
+     *
+     * @param tQualitativeAnalysis 定性分析
+     * @return 结果
+     */
+    public int insertTQualitativeAnalysis(TQualitativeAnalysis tQualitativeAnalysis);
+
+    /**
+     * 修改定性分析
+     *
+     * @param tQualitativeAnalysis 定性分析
+     * @return 结果
+     */
+    public int updateTQualitativeAnalysis(TQualitativeAnalysis tQualitativeAnalysis);
+
+    /**
+     * 批量删除定性分析
+     *
+     * @param ids 需要删除的定性分析ID
+     * @return 结果
+     */
+    public int deleteTQualitativeAnalysisByIds(Long[] ids);
+
+    /**
+     * 删除定性分析信息
+     *
+     * @param id 定性分析ID
+     * @return 结果
+     */
+    public int deleteTQualitativeAnalysisById(Long id);
+
+    public TRiskMatrixVo selectTRiskMatrixVoData();
+}

+ 101 - 0
master/src/main/java/com/ruoyi/project/reliability/service/impl/TQualitativeAnalysisServiceImpl.java

@@ -0,0 +1,101 @@
+package com.ruoyi.project.reliability.service.impl;
+
+import java.util.List;
+
+import com.ruoyi.project.reliability.domain.TRiskMatrixVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.project.reliability.mapper.TQualitativeAnalysisMapper;
+import com.ruoyi.project.reliability.domain.TQualitativeAnalysis;
+import com.ruoyi.project.reliability.service.ITQualitativeAnalysisService;
+
+/**
+ * 定性分析Service业务层处理
+ *
+ * @author ssy
+ * @date 2024-03-04
+ */
+@Service
+public class TQualitativeAnalysisServiceImpl implements ITQualitativeAnalysisService
+{
+    @Autowired
+    private TQualitativeAnalysisMapper tQualitativeAnalysisMapper;
+
+    /**
+     * 查询定性分析
+     *
+     * @param id 定性分析ID
+     * @return 定性分析
+     */
+    @Override
+    public TQualitativeAnalysis selectTQualitativeAnalysisById(Long id)
+    {
+        return tQualitativeAnalysisMapper.selectTQualitativeAnalysisById(id);
+    }
+
+    /**
+     * 查询定性分析列表
+     *
+     * @param tQualitativeAnalysis 定性分析
+     * @return 定性分析
+     */
+    @Override
+    public List<TQualitativeAnalysis> selectTQualitativeAnalysisList(TQualitativeAnalysis tQualitativeAnalysis)
+    {
+        return tQualitativeAnalysisMapper.selectTQualitativeAnalysisList(tQualitativeAnalysis);
+    }
+
+    /**
+     * 新增定性分析
+     *
+     * @param tQualitativeAnalysis 定性分析
+     * @return 结果
+     */
+    @Override
+    public int insertTQualitativeAnalysis(TQualitativeAnalysis tQualitativeAnalysis)
+    {
+        return tQualitativeAnalysisMapper.insertTQualitativeAnalysis(tQualitativeAnalysis);
+    }
+
+    /**
+     * 修改定性分析
+     *
+     * @param tQualitativeAnalysis 定性分析
+     * @return 结果
+     */
+    @Override
+    public int updateTQualitativeAnalysis(TQualitativeAnalysis tQualitativeAnalysis)
+    {
+        return tQualitativeAnalysisMapper.updateTQualitativeAnalysis(tQualitativeAnalysis);
+    }
+
+    /**
+     * 批量删除定性分析
+     *
+     * @param ids 需要删除的定性分析ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTQualitativeAnalysisByIds(Long[] ids)
+    {
+        return tQualitativeAnalysisMapper.deleteTQualitativeAnalysisByIds(ids);
+    }
+
+    /**
+     * 删除定性分析信息
+     *
+     * @param id 定性分析ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTQualitativeAnalysisById(Long id)
+    {
+        return tQualitativeAnalysisMapper.deleteTQualitativeAnalysisById(id);
+    }
+
+    @Override
+    public TRiskMatrixVo selectTRiskMatrixVoData()
+    {
+        return tQualitativeAnalysisMapper.selectTRiskMatrixVoData();
+    }
+}

+ 325 - 0
master/src/main/resources/mybatis/reliability/TQualitativeAnalysisMapper.xml

@@ -0,0 +1,325 @@
+<?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.ruoyi.project.reliability.mapper.TQualitativeAnalysisMapper">
+
+    <resultMap type="TQualitativeAnalysis" id="TQualitativeAnalysisResult">
+        <result property="id" column="id"/>
+        <result property="location" column="location"/>
+        <result property="tagNo" column="tag_no"/>
+        <result property="description" column="description"/>
+        <result property="objectType" column="object_type"/>
+        <result property="catalogProfile" column="catalog_profile"/>
+        <result property="relevant" column="relevant"/>
+        <result property="frequencyFailure" column="frequency_failure"/>
+        <result property="maintenanceCost" column="maintenance_cost"/>
+        <result property="productionLoss" column="production_loss"/>
+        <result property="maintenanceRisk" column="maintenance_risk"/>
+        <result property="productionRisk" column="production_risk"/>
+        <result property="equipmentCategory" column="equipment_category"/>
+        <result property="riskCriticality" column="risk_criticality"/>
+        <result property="quantitativeAnalysis" column="quantitative_analysis"/>
+        <result property="maintenanceStrategy" column="maintenance_strategy"/>
+        <result property="msDescription" column="ms_description"/>
+        <result property="sparepartStrategy" column="sparepart_strategy"/>
+        <result property="ssDescription" column="ss_description"/>
+        <result property="needClarification" column="need_clarification"/>
+        <result property="remarks" column="remarks"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="createrCode" column="creater_code"/>
+        <result property="createdate" column="createdate"/>
+        <result property="updaterCode" column="updater_code"/>
+        <result property="updatedate" column="updatedate"/>
+        <result property="deptId" column="dept_id"/>
+        <result property="deptName" column="dept_name"/>
+        <result property="materialSpecification" column="material_specification"/>
+        <result property="specificationMode" column="specification_mode"/>
+    </resultMap>
+
+    <resultMap type="TRiskMatrixVo" id="TRiskMatrixVoResult">
+        <result property="mrhb2" column="mrhb2"/>
+        <result property="mrha1" column="mrha1"/>
+        <result property="mrha0" column="mrha0"/>
+        <result property="mrmc2" column="mrmc2"/>
+        <result property="mrmb1" column="mrmb1"/>
+        <result property="mrma0" column="mrma0"/>
+        <result property="mrlc2" column="mrlc2"/>
+        <result property="mrlc1" column="mrlc1"/>
+        <result property="mrlb0" column="mrlb0"/>
+        <result property="prhb2" column="prhb2"/>
+        <result property="prha1" column="prha1"/>
+        <result property="prha0" column="prha0"/>
+        <result property="prmc2" column="prmc2"/>
+        <result property="prmb1" column="prmb1"/>
+        <result property="prma0" column="prma0"/>
+        <result property="prlc2" column="prlc2"/>
+        <result property="prlc1" column="prlc1"/>
+        <result property="prlb0" column="prlb0"/>
+        <result property="echc" column="echc"/>
+        <result property="echb" column="echb"/>
+        <result property="echa" column="echa"/>
+        <result property="ecmc" column="ecmc"/>
+        <result property="ecmmb" column="ecmmb"/>
+        <result property="ecmhb" column="ecmhb"/>
+        <result property="ecld" column="ecld"/>
+        <result property="eclc" column="eclc"/>
+        <result property="eclb" column="eclb"/>
+        <result property="nr" column="nr"/>
+        <result property="omr" column="omr"/>
+        <result property="opr" column="opr"/>
+        <result property="countA" column="countA"/>
+        <result property="countB" column="countB"/>
+        <result property="countC" column="countC"/>
+        <result property="countD" column="countD"/>
+        <result property="totalA" column="totalA"/>
+        <result property="totalB" column="totalB"/>
+        <result property="totalC" column="totalC"/>
+        <result property="totalD" column="totalD"/>
+    </resultMap>
+
+    <select id="selectTRiskMatrixVoData" resultMap="TRiskMatrixVoResult">
+        select
+            ( select count( 1 ) from t_qualitative_analysis where maintenance_risk = 'B2' and maintenance_cost = 'low' and frequency_failure = 'high' ) mrhb2,
+            ( select count( 1 ) from t_qualitative_analysis where maintenance_risk = 'A1' and maintenance_cost = 'medium' and frequency_failure = 'high' ) mrha1,
+            ( select count( 1 ) from t_qualitative_analysis where maintenance_risk = 'A0' and maintenance_cost = 'high' and frequency_failure = 'high' ) mrha0,
+            ( select count( 1 ) from t_qualitative_analysis where maintenance_risk = 'C2' and maintenance_cost = 'low' and frequency_failure = 'medium' ) mrmc2,
+            ( select count( 1 ) from t_qualitative_analysis where maintenance_risk = 'B1' and maintenance_cost = 'medium' and frequency_failure = 'medium' ) mrmb1,
+            ( select count( 1 ) from t_qualitative_analysis where maintenance_risk = 'A0' and maintenance_cost = 'high' and frequency_failure = 'medium' ) mrma0,
+            ( select count( 1 ) from t_qualitative_analysis where maintenance_risk = 'C2' and maintenance_cost = 'low' and frequency_failure = 'low' ) mrlc2,
+            ( select count( 1 ) from t_qualitative_analysis where maintenance_risk = 'C1' and maintenance_cost = 'medium' and frequency_failure = 'low' ) mrlc1,
+            ( select count( 1 ) from t_qualitative_analysis where maintenance_risk = 'B0' and maintenance_cost = 'high' and frequency_failure = 'low' ) mrlb0,
+            ( select count( 1 ) from t_qualitative_analysis where production_risk = 'B2' and production_loss = 'low' and frequency_failure = 'high' ) prhb2,
+            ( select count( 1 ) from t_qualitative_analysis where production_risk = 'A1' and production_loss = 'medium' and frequency_failure = 'high' ) prha1,
+            ( select count( 1 ) from t_qualitative_analysis where production_risk = 'A0' and production_loss = 'high' and frequency_failure = 'high' ) prha0,
+            ( select count( 1 ) from t_qualitative_analysis where production_risk = 'C2' and production_loss = 'low' and frequency_failure = 'medium' ) prmc2,
+            ( select count( 1 ) from t_qualitative_analysis where production_risk = 'B1' and production_loss = 'medium' and frequency_failure = 'medium' ) prmb1,
+            ( select count( 1 ) from t_qualitative_analysis where production_risk = 'A0' and production_loss = 'high' and frequency_failure = 'medium' ) prma0,
+            ( select count( 1 ) from t_qualitative_analysis where production_risk = 'C2' and production_loss = 'low' and frequency_failure = 'low' ) prlc2,
+            ( select count( 1 ) from t_qualitative_analysis where production_risk = 'C1' and production_loss = 'medium' and frequency_failure = 'low' ) prlc1,
+            ( select count( 1 ) from t_qualitative_analysis where production_risk = 'B0' and production_loss = 'high' and frequency_failure = 'low' ) prlb0,
+            ( select count( 1 ) from t_qualitative_analysis where equipment_category = 'C' and production_loss = 'low' and maintenance_cost = 'high' ) echc,
+            ( select count( 1 ) from t_qualitative_analysis where equipment_category = 'B' and production_loss = 'medium' and maintenance_cost = 'high' ) echb,
+            ( select count( 1 ) from t_qualitative_analysis where equipment_category = 'A' and production_loss = 'high' and maintenance_cost = 'high' ) echa,
+            ( select count( 1 ) from t_qualitative_analysis where equipment_category = 'C' and production_loss = 'low' and maintenance_cost = 'medium' ) ecmc,
+            ( select count( 1 ) from t_qualitative_analysis where equipment_category = 'B' and production_loss = 'medium' and maintenance_cost = 'medium' ) ecmmb,
+            ( select count( 1 ) from t_qualitative_analysis where equipment_category = 'B' and production_loss = 'high' and maintenance_cost = 'medium' ) ecmhb,
+            ( select count( 1 ) from t_qualitative_analysis where equipment_category = 'D' and production_loss = 'low' and maintenance_cost = 'low' ) ecld,
+            ( select count( 1 ) from t_qualitative_analysis where equipment_category = 'C' and production_loss = 'medium' and maintenance_cost = 'low' ) eclc,
+            ( select count( 1 ) from t_qualitative_analysis where equipment_category = 'B' and production_loss = 'high' and maintenance_cost = 'low' ) eclb,
+            ( select count( 1 ) from t_qualitative_analysis where RELEVANT = 'n') nr,
+            ( select count( 1 ) from t_qualitative_analysis where MAINTENANCE_RISK is null) omr,
+            ( select count( 1 ) from t_qualitative_analysis where PRODUCTION_RISK is null) opr,
+            ( select count( 1 ) from t_qualitative_analysis where equipment_category = 'A') countA,
+            ( select count( 1 ) from t_qualitative_analysis where equipment_category = 'B') countB,
+            ( select count( 1 ) from t_qualitative_analysis where equipment_category = 'C') countC,
+            ( select count( 1 ) from t_qualitative_analysis where equipment_category = 'D') countD
+        from
+            dual
+    </select>
+
+    <sql id="selectTQualitativeAnalysisVo">
+        select d.id,
+               d.location,
+               d.tag_no,
+               d.description,
+               d.object_type,
+               d.catalog_profile,
+               d.relevant,
+               d.frequency_failure,
+               d.maintenance_cost,
+               d.production_loss,
+               d.maintenance_risk,
+               d.production_risk,
+               d.equipment_category,
+               d.risk_criticality,
+               d.quantitative_analysis,
+               d.maintenance_strategy,
+               d.ms_description,
+               d.sparepart_strategy,
+               d.ss_description,
+               d.need_clarification,
+               d.remarks,
+               d.del_flag,
+               d.creater_code,
+               d.createdate,
+               d.updater_code,
+               d.updatedate,
+               d.dept_id,
+               d.material_specification,
+               d.specification_mode,
+               s.dept_name
+        from t_qualitative_analysis d
+                 left join sys_dept s on s.dept_id = d.dept_id
+    </sql>
+
+    <select id="selectTQualitativeAnalysisList" parameterType="TQualitativeAnalysis"
+            resultMap="TQualitativeAnalysisResult">
+        <include refid="selectTQualitativeAnalysisVo"/>
+        <where>
+            <if test="location != null  and location != ''">and location = #{location}</if>
+            <if test="tagNo != null  and tagNo != ''">and tag_no = #{tagNo}</if>
+            <if test="description != null  and description != ''">and description = #{description}</if>
+            <if test="objectType != null  and objectType != ''">and object_type = #{objectType}</if>
+            <if test="catalogProfile != null  and catalogProfile != ''">and catalog_profile = #{catalogProfile}</if>
+            <if test="relevant != null  and relevant != ''">and relevant = #{relevant}</if>
+            <if test="frequencyFailure != null  and frequencyFailure != ''">and frequency_failure =
+                #{frequencyFailure}
+            </if>
+            <if test="maintenanceCost != null  and maintenanceCost != ''">and maintenance_cost = #{maintenanceCost}</if>
+            <if test="productionLoss != null  and productionLoss != ''">and production_loss = #{productionLoss}</if>
+            <if test="maintenanceRisk != null  and maintenanceRisk != ''">and maintenance_risk = #{maintenanceRisk}</if>
+            <if test="productionRisk != null  and productionRisk != ''">and production_risk = #{productionRisk}</if>
+            <if test="equipmentCategory != null  and equipmentCategory != ''">and equipment_category =
+                #{equipmentCategory}
+            </if>
+            <if test="riskCriticality != null  and riskCriticality != ''">and risk_criticality = #{riskCriticality}</if>
+            <if test="quantitativeAnalysis != null  and quantitativeAnalysis != ''">and quantitative_analysis =
+                #{quantitativeAnalysis}
+            </if>
+            <if test="maintenanceStrategy != null  and maintenanceStrategy != ''">and maintenance_strategy =
+                #{maintenanceStrategy}
+            </if>
+            <if test="msDescription != null  and msDescription != ''">and ms_description = #{msDescription}</if>
+            <if test="sparepartStrategy != null  and sparepartStrategy != ''">and sparepart_strategy =
+                #{sparepartStrategy}
+            </if>
+            <if test="ssDescription != null  and ssDescription != ''">and ss_description = #{ssDescription}</if>
+            <if test="needClarification != null  and needClarification != ''">and need_clarification =
+                #{needClarification}
+            </if>
+            <if test="remarks != null  and remarks != ''">and remarks = #{remarks}</if>
+            <if test="createrCode != null  and createrCode != ''">and creater_code = #{createrCode}</if>
+            <if test="createdate != null ">and createdate = #{createdate}</if>
+            <if test="updaterCode != null  and updaterCode != ''">and updater_code = #{updaterCode}</if>
+            <if test="updatedate != null ">and updatedate = #{updatedate}</if>
+            <if test="deptId != null ">and dept_id = #{deptId}</if>
+            <if test="materialSpecification != null ">and material_specification = #{materialSpecification}</if>
+            <if test="specificationMode != null ">and specification_mode = #{specificationMode}</if>
+            and d.del_flag = 0
+        </where>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+    </select>
+
+    <select id="selectTQualitativeAnalysisById" parameterType="Long" resultMap="TQualitativeAnalysisResult">
+        <include refid="selectTQualitativeAnalysisVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertTQualitativeAnalysis" parameterType="TQualitativeAnalysis">
+        <selectKey keyProperty="id" resultType="long" order="BEFORE">
+            SELECT seq_t_qualitative_analysis.NEXTVAL as id FROM DUAL
+        </selectKey>
+        insert into t_qualitative_analysis
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="location != null">location,</if>
+            <if test="tagNo != null">tag_no,</if>
+            <if test="description != null">description,</if>
+            <if test="objectType != null">object_type,</if>
+            <if test="catalogProfile != null">catalog_profile,</if>
+            <if test="relevant != null">relevant,</if>
+            <if test="frequencyFailure != null">frequency_failure,</if>
+            <if test="maintenanceCost != null">maintenance_cost,</if>
+            <if test="productionLoss != null">production_loss,</if>
+            <if test="maintenanceRisk != null">maintenance_risk,</if>
+            <if test="productionRisk != null">production_risk,</if>
+            <if test="equipmentCategory != null">equipment_category,</if>
+            <if test="riskCriticality != null">risk_criticality,</if>
+            <if test="quantitativeAnalysis != null">quantitative_analysis,</if>
+            <if test="maintenanceStrategy != null">maintenance_strategy,</if>
+            <if test="msDescription != null">ms_description,</if>
+            <if test="sparepartStrategy != null">sparepart_strategy,</if>
+            <if test="ssDescription != null">ss_description,</if>
+            <if test="needClarification != null">need_clarification,</if>
+            <if test="remarks != null">remarks,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createrCode != null">creater_code,</if>
+            <if test="createdate != null">createdate,</if>
+            <if test="updaterCode != null">updater_code,</if>
+            <if test="updatedate != null">updatedate,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="materialSpecification != null">material_specification,</if>
+            <if test="specificationMode != null">specification_mode,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="location != null">#{location},</if>
+            <if test="tagNo != null">#{tagNo},</if>
+            <if test="description != null">#{description},</if>
+            <if test="objectType != null">#{objectType},</if>
+            <if test="catalogProfile != null">#{catalogProfile},</if>
+            <if test="relevant != null">#{relevant},</if>
+            <if test="frequencyFailure != null">#{frequencyFailure},</if>
+            <if test="maintenanceCost != null">#{maintenanceCost},</if>
+            <if test="productionLoss != null">#{productionLoss},</if>
+            <if test="maintenanceRisk != null">#{maintenanceRisk},</if>
+            <if test="productionRisk != null">#{productionRisk},</if>
+            <if test="equipmentCategory != null">#{equipmentCategory},</if>
+            <if test="riskCriticality != null">#{riskCriticality},</if>
+            <if test="quantitativeAnalysis != null">#{quantitativeAnalysis},</if>
+            <if test="maintenanceStrategy != null">#{maintenanceStrategy},</if>
+            <if test="msDescription != null">#{msDescription},</if>
+            <if test="sparepartStrategy != null">#{sparepartStrategy},</if>
+            <if test="ssDescription != null">#{ssDescription},</if>
+            <if test="needClarification != null">#{needClarification},</if>
+            <if test="remarks != null">#{remarks},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createrCode != null">#{createrCode},</if>
+            <if test="createdate != null">#{createdate},</if>
+            <if test="updaterCode != null">#{updaterCode},</if>
+            <if test="updatedate != null">#{updatedate},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="materialSpecification != null">#{materialSpecification},</if>
+            <if test="specificationMode != null">#{specificationMode},</if>
+        </trim>
+    </insert>
+
+    <update id="updateTQualitativeAnalysis" parameterType="TQualitativeAnalysis">
+        update t_qualitative_analysis
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="location != null">location = #{location},</if>
+            <if test="tagNo != null">tag_no = #{tagNo},</if>
+            <if test="description != null">description = #{description},</if>
+            <if test="objectType != null">object_type = #{objectType},</if>
+            <if test="catalogProfile != null">catalog_profile = #{catalogProfile},</if>
+            <if test="relevant != null">relevant = #{relevant},</if>
+            <if test="frequencyFailure != null">frequency_failure = #{frequencyFailure},</if>
+            <if test="maintenanceCost != null">maintenance_cost = #{maintenanceCost},</if>
+            <if test="productionLoss != null">production_loss = #{productionLoss},</if>
+            <if test="maintenanceRisk != null">maintenance_risk = #{maintenanceRisk},</if>
+            <if test="productionRisk != null">production_risk = #{productionRisk},</if>
+            <if test="equipmentCategory != null">equipment_category = #{equipmentCategory},</if>
+            <if test="riskCriticality != null">risk_criticality = #{riskCriticality},</if>
+            <if test="quantitativeAnalysis != null">quantitative_analysis = #{quantitativeAnalysis},</if>
+            <if test="maintenanceStrategy != null">maintenance_strategy = #{maintenanceStrategy},</if>
+            <if test="msDescription != null">ms_description = #{msDescription},</if>
+            <if test="sparepartStrategy != null">sparepart_strategy = #{sparepartStrategy},</if>
+            <if test="ssDescription != null">ss_description = #{ssDescription},</if>
+            <if test="needClarification != null">need_clarification = #{needClarification},</if>
+            <if test="remarks != null">remarks = #{remarks},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createrCode != null">creater_code = #{createrCode},</if>
+            <if test="createdate != null">createdate = #{createdate},</if>
+            <if test="updaterCode != null">updater_code = #{updaterCode},</if>
+            <if test="updatedate != null">updatedate = #{updatedate},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <update id="deleteTQualitativeAnalysisById" parameterType="Long">
+        update t_qualitative_analysis
+        set del_flag = 2
+        where id = #{id}
+    </update>
+
+    <update id="deleteTQualitativeAnalysisByIds" parameterType="String">
+        update t_qualitative_analysis set del_flag = 2 where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+
+</mapper>

+ 61 - 0
ui/src/api/reliability/analysis.js

@@ -0,0 +1,61 @@
+import request from '@/utils/request'
+
+// 查询风险矩阵数据
+export function riskMatrixData() {
+  return request({
+    url: '/reliability/analysis/riskMatrixData',
+    method: 'get'
+  })
+}
+
+// 查询定性分析列表
+export function listAnalysis(query) {
+  return request({
+    url: '/reliability/analysis/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询定性分析详细
+export function getAnalysis(id) {
+  return request({
+    url: '/reliability/analysis/' + id,
+    method: 'get'
+  })
+}
+
+// 新增定性分析
+export function addAnalysis(data) {
+  return request({
+    url: '/reliability/analysis',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改定性分析
+export function updateAnalysis(data) {
+  return request({
+    url: '/reliability/analysis',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除定性分析
+export function delAnalysis(id) {
+  return request({
+    url: '/reliability/analysis/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出定性分析
+export function exportAnalysis(query) {
+  return request({
+    url: '/reliability/analysis/export',
+    method: 'get',
+    params: query
+  })
+}

+ 886 - 0
ui/src/views/reliability/analysis/index.vue

@@ -0,0 +1,886 @@
+<template>
+  <div class="app-container">
+    <el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="68px">
+      <el-form-item label="位置" prop="location">
+        <el-input
+            v-model="queryParams.location"
+            clearable
+            placeholder="请输入位置"
+            size="small"
+            @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="位号" prop="tagNo">
+        <el-input
+            v-model="queryParams.tagNo"
+            clearable
+            placeholder="请输入位号"
+            size="small"
+            @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button icon="el-icon-search" size="mini" type="cyan" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+            v-hasPermi="['reliability:analysis:add']"
+            icon="el-icon-plus"
+            size="mini"
+            type="primary"
+            @click="handleAdd"
+        >新增
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+            v-hasPermi="['reliability:analysis:edit']"
+            :disabled="single"
+            icon="el-icon-edit"
+            size="mini"
+            type="success"
+            @click="handleUpdate"
+        >修改
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+            v-hasPermi="['reliability:analysis:remove']"
+            :disabled="multiple"
+            icon="el-icon-delete"
+            size="mini"
+            type="danger"
+            @click="handleDelete"
+        >删除
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+            v-hasPermi="['reliability:analysis:edit']"
+            icon="el-icon-upload2"
+            size="mini"
+            type="info"
+            @click="handleImport"
+        >导入
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+            v-hasPermi="['reliability:analysis:export']"
+            icon="el-icon-download"
+            size="mini"
+            type="warning"
+            @click="handleExport"
+        >导出
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+            icon="el-icon-pie-chart"
+            size="mini"
+            type="primary"
+            @click="openDrawer"
+        >风险矩阵
+        </el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="analysisList" :height="clientHeight" border
+              @selection-change="handleSelectionChange">
+      <el-table-column align="center" type="selection" width="55"/>
+      <el-table-column :show-overflow-tooltip="true" align="center" label="位置" prop="location"
+                       width="300"/>
+      <el-table-column :show-overflow-tooltip="true" align="center" label="位号" prop="tagNo" width="200"/>
+      <el-table-column :show-overflow-tooltip="true" align="center" label="描述" prop="description"
+                       width="200"/>
+      <el-table-column :show-overflow-tooltip="true" align="center" label="Object Type" prop="objectType" width="200"/>
+      <el-table-column :show-overflow-tooltip="true" align="center" label="Catalog Profile" prop="catalogProfile"
+                       width="200"/>
+      <el-table-column :show-overflow-tooltip="true" align="center" label="Relevant (r)/not relevant (n)"
+                       prop="relevant" width="200"/>
+      <el-table-column :show-overflow-tooltip="true" align="center" label="故障频率" prop="frequencyFailure"
+                       width="100"/>
+      <el-table-column :show-overflow-tooltip="true" align="center" label="维护成本" prop="maintenanceCost"
+                       width="100"/>
+      <el-table-column :show-overflow-tooltip="true" align="center" label="生成损失" prop="productionLoss" width="100"/>
+      <el-table-column :show-overflow-tooltip="true" align="center" label="维护风险" prop="maintenanceRisk"
+                       width="100"/>
+      <el-table-column :show-overflow-tooltip="true" align="center" label="生成风险" prop="productionRisk" width="100"/>
+      <el-table-column :show-overflow-tooltip="true" align="center" label="设备类别" prop="equipmentCategory"
+                       width="100"/>
+      <el-table-column :show-overflow-tooltip="true" align="center" label="风险程度" prop="riskCriticality"
+                       width="100"/>
+      <el-table-column :show-overflow-tooltip="true" align="center" label="定量分析" prop="quantitativeAnalysis"
+                       width="200"/>
+      <el-table-column :show-overflow-tooltip="true" align="center" label="维修策略" prop="maintenanceStrategy"
+                       width="200"/>
+      <el-table-column :show-overflow-tooltip="true" align="center" label="维修策略描述" prop="msDescription"
+                       width="200"/>
+      <el-table-column :show-overflow-tooltip="true" align="center" label="备件策略" prop="sparepartStrategy"
+                       width="200"/>
+      <el-table-column :show-overflow-tooltip="true" align="center" label="备件策略描述" prop="ssDescription"
+                       width="200"/>
+      <el-table-column :show-overflow-tooltip="true" align="center" label="需要澄清" prop="needClarification"
+                       width="200"/>
+      <el-table-column :show-overflow-tooltip="true" align="center" label="备注" prop="remarks" width="200"/>
+      <el-table-column align="center" class-name="small-padding fixed-width" fixed="right" label="操作" width="120">
+        <template slot-scope="scope">
+          <el-button
+              v-hasPermi="['reliability:analysis:edit']"
+              icon="el-icon-edit"
+              size="mini"
+              type="text"
+              @click="handleUpdate(scope.row)"
+          >修改
+          </el-button>
+          <el-button
+              v-hasPermi="['reliability:analysis:remove']"
+              icon="el-icon-delete"
+              size="mini"
+              type="text"
+              @click="handleDelete(scope.row)"
+          >删除
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+        v-show="total>0"
+        :limit.sync="queryParams.pageSize"
+        :page.sync="queryParams.pageNum"
+        :total="total"
+        @pagination="getList"
+    />
+
+    <el-drawer
+        :visible.sync="drawer"
+        size="60%"
+        title="风险矩阵">
+
+      <table class="top_table">
+        <tr>
+          <td></td>
+          <td colspan="5" style="font-weight: bold;">Maintenance risk</td>
+          <td></td>
+          <td colspan="5" style="font-weight: bold;">Production risk</td>
+          <td></td>
+          <td colspan="5" style="font-weight: bold;">Equipment Category</td>
+        </tr>
+        <tr>
+          <td rowspan="6" style="font-weight: bold;writing-mode: vertical-rl">Frequency</td>
+          <td>high</td>
+          <td class="border-lr-td border-top-td yellow">B2</td>
+          <td class="border-lr-td border-top-td red">A1</td>
+          <td class="border-lr-td border-top-td red">A0</td>
+          <td></td>
+          <td rowspan="6" style="font-weight: bold;writing-mode: vertical-lr">Frequency</td>
+          <td>high</td>
+          <td class="border-lr-td border-top-td yellow">B2</td>
+          <td class="border-lr-td border-top-td red">A1</td>
+          <td class="border-lr-td border-top-td red">A0</td>
+          <td></td>
+          <td rowspan="6" style="font-weight: bold;writing-mode: vertical-lr">Maintenance Cost</td>
+          <td>high</td>
+          <td class="border-lr-td border-top-td green">C</td>
+          <td class="border-lr-td border-top-td yellow">B</td>
+          <td class="border-lr-td border-top-td red">A</td>
+          <td></td>
+        </tr>
+        <tr>
+          <td>&gt;1 /a</td>
+          <td class="border-lr-td  border-btm-td yellow">{{ chartData.mr.hB2 }}</td>
+          <td class="border-lr-td  border-btm-td red">{{ chartData.mr.hA1 }}</td>
+          <td class="border-lr-td  border-btm-td red">{{ chartData.mr.hA0 }}</td>
+          <td></td>
+          <td>&gt;1 /a<</td>
+          <td class="border-lr-td border-btm-td yellow">{{ chartData.pr.hB2 }}</td>
+          <td class="border-lr-td border-btm-td red">{{ chartData.pr.hA1 }}</td>
+          <td class="border-lr-td border-btm-td red">{{ chartData.pr.hA0 }}</td>
+          <td></td>
+          <td>/a</td>
+          <td class="border-lr-td border-btm-td green">{{ chartData.ec.hC }}</td>
+          <td class="border-lr-td border-btm-td yellow">{{ chartData.ec.hB }}</td>
+          <td class="border-lr-td border-btm-td red">{{ chartData.ec.hA }}</td>
+          <td></td>
+        </tr>
+        <tr>
+          <td>medium</td>
+          <td class="border-lr-td border-top-td green">C2</td>
+          <td class="border-lr-td border-top-td yellow">B1</td>
+          <td class="border-lr-td border-top-td red">A0</td>
+          <td></td>
+          <td>medium</td>
+          <td class="border-lr-td border-top-td green">C2</td>
+          <td class="border-lr-td border-top-td yellow">B1</td>
+          <td class="border-lr-td border-top-td red">A0</td>
+          <td></td>
+          <td>medium</td>
+          <td class="border-lr-td border-top-td green">C</td>
+          <td class="border-lr-td border-top-td yellow">B</td>
+          <td class="border-lr-td border-top-td yellow">B</td>
+          <td></td>
+        </tr>
+        <tr>
+          <td>0.5~1 /a</td>
+          <td class="border-lr-td border-btm-td green">{{ chartData.mr.mC2 }}</td>
+          <td class="border-lr-td border-btm-td yellow">{{ chartData.mr.mB1 }}</td>
+          <td class="border-lr-td border-btm-td red">{{ chartData.mr.mA0 }}</td>
+          <td></td>
+          <td>0.5~1 /a</td>
+          <td class="border-lr-td border-btm-td green">{{ chartData.pr.mC2 }}</td>
+          <td class="border-lr-td border-btm-td yellow">{{ chartData.pr.mB1 }}</td>
+          <td class="border-lr-td border-btm-td red">{{ chartData.pr.mA0 }}</td>
+          <td></td>
+          <td>/a</td>
+          <td class="border-lr-td border-btm-td green">{{ chartData.ec.mC }}</td>
+          <td class="border-lr-td border-btm-td yellow">{{ chartData.ec.mmB }}</td>
+          <td class="border-lr-td border-btm-td yellow">{{ chartData.ec.mhB }}</td>
+          <td></td>
+        </tr>
+        <tr>
+          <td>low</td>
+          <td class="border-lr-td border-top-td green">C2</td>
+          <td class="border-lr-td border-top-td green">C1</td>
+          <td class="border-lr-td border-top-td yellow">B0</td>
+          <td></td>
+          <td>low</td>
+          <td class="border-lr-td border-top-td green">C2</td>
+          <td class="border-lr-td border-top-td green">C1</td>
+          <td class="border-lr-td border-top-td yellow">B0</td>
+          <td></td>
+          <td>low</td>
+          <td class="border-lr-td border-top-td ">D</td>
+          <td class="border-lr-td border-top-td green">C</td>
+          <td class="border-lr-td border-top-td yellow">B</td>
+          <td></td>
+        </tr>
+        <tr>
+          <td>&lt;0.5 /a</td>
+          <td class="border-lr-td border-btm-td green">{{ chartData.mr.lC2 }}</td>
+          <td class="border-lr-td border-btm-td green">{{ chartData.mr.lC1 }}</td>
+          <td class="border-lr-td border-btm-td yellow">{{ chartData.mr.lB0 }}</td>
+          <td></td>
+          <td>&lt;0.5 /a</td>
+          <td class="border-lr-td border-btm-td green">{{ chartData.pr.lC2 }}</td>
+          <td class="border-lr-td border-btm-td green">{{ chartData.pr.lC1 }}</td>
+          <td class="border-lr-td border-btm-td yellow">{{ chartData.pr.lB0 }}</td>
+          <td></td>
+          <td>/a</td>
+          <td class="border-lr-td border-btm-td ">{{ chartData.ec.lD }}</td>
+          <td class="border-lr-td border-btm-td green">{{ chartData.ec.lC }}</td>
+          <td class="border-lr-td border-btm-td yellow">{{ chartData.ec.lB }}</td>
+          <td></td>
+        </tr>
+        <tr>
+          <td></td>
+          <td></td>
+          <td>low</td>
+          <td>medium</td>
+          <td>high</td>
+          <td></td>
+          <td></td>
+          <td></td>
+          <td>low</td>
+          <td>medium</td>
+          <td>high</td>
+          <td></td>
+          <td></td>
+          <td></td>
+          <td>low</td>
+          <td>medium</td>
+          <td>high</td>
+          <td></td>
+        </tr>
+        <tr>
+          <td></td>
+          <td></td>
+          <td>&lt;50k</td>
+          <td>50~300k</td>
+          <td>&gt;300k</td>
+          <td></td>
+          <td></td>
+          <td></td>
+          <td>&lt;0</td>
+          <td>0~24</td>
+          <td>&gt;24</td>
+          <td></td>
+          <td></td>
+          <td></td>
+          <td></td>
+          <td></td>
+          <td></td>
+          <td></td>
+        </tr>
+        <tr>
+          <td></td>
+          <td colspan="5" style="font-weight: bold;">Damage</td>
+          <td></td>
+          <td colspan="5" style="font-weight: bold;">Damage</td>
+          <td></td>
+          <td colspan="5" style="font-weight: bold;">Production Lose</td>
+        </tr>
+      </table>
+      <table class="btm_table">
+        <tr>
+          <td>Not relevant</td>
+          <td>{{ chartData.nr }}</td>
+          <td></td>
+          <td></td>
+          <td></td>
+          <td></td>
+          <td></td>
+          <td>Criticality</td>
+          <td>Count</td>
+          <td>% of Total</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td></td>
+          <td></td>
+          <td></td>
+          <td></td>
+          <td></td>
+          <td></td>
+          <td class="red">A</td>
+          <td class="red">{{ chartData.countA }}</td>
+          <td class="red">{{ chartData.totalA }}</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td colspan="2">Maintenance risk</td>
+          <td></td>
+          <td colspan="2">Production risk</td>
+          <td></td>
+          <td class="yellow">B</td>
+          <td class="yellow">{{ chartData.countB }}</td>
+          <td class="yellow">{{ chartData.totalB }}</td>
+        </tr>
+        <tr>
+          <td>Open</td>
+          <td colspan="2">{{ chartData.omr }}</td>
+          <td></td>
+          <td colspan="2">{{ chartData.opr }}</td>
+          <td></td>
+          <td class="green">C</td>
+          <td class="green">{{ chartData.countC }}</td>
+          <td class="green">{{ chartData.totalC }}</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td></td>
+          <td></td>
+          <td></td>
+          <td></td>
+          <td></td>
+          <td></td>
+          <td>D</td>
+          <td>{{ chartData.countD }}</td>
+          <td>{{ chartData.totalD }}</td>
+        </tr>
+      </table>
+    </el-drawer>
+
+    <!-- 添加或修改定性分析对话框 -->
+    <el-dialog :title="title" :visible.sync="open" append-to-body width="500px">
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="位置" prop="location">
+          <el-input v-model="form.location" placeholder="请输入位置"/>
+        </el-form-item>
+        <el-form-item label="位号" prop="tagNo">
+          <el-input v-model="form.tagNo" placeholder="请输入位号"/>
+        </el-form-item>
+        <el-form-item label="描述" prop="description">
+          <el-input v-model="form.description" placeholder="请输入描述"/>
+        </el-form-item>
+        <el-form-item label="Object Type" prop="objectType">
+          <el-select v-model="form.objectType" placeholder="请选择Object Type">
+            <el-option label="请选择字典生成" value=""/>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="Catalog Profile" prop="catalogProfile">
+          <el-input v-model="form.catalogProfile" placeholder="请输入Catalog Profile"/>
+        </el-form-item>
+        <el-form-item label="Relevant (r)/not relevant (n)" prop="relevant">
+          <el-input v-model="form.relevant" placeholder="请输入Relevant (r)/not relevant (n)"/>
+        </el-form-item>
+        <el-form-item label="故障频率" prop="frequencyFailure">
+          <el-input v-model="form.frequencyFailure" placeholder="请输入故障频率"/>
+        </el-form-item>
+        <el-form-item label="维护成本" prop="maintenanceCost">
+          <el-input v-model="form.maintenanceCost" placeholder="请输入维护成本"/>
+        </el-form-item>
+        <el-form-item label="生成损失" prop="productionLoss">
+          <el-input v-model="form.productionLoss" placeholder="请输入生成损失"/>
+        </el-form-item>
+        <el-form-item label="维护风险" prop="maintenanceRisk">
+          <el-input v-model="form.maintenanceRisk" placeholder="请输入维护风险"/>
+        </el-form-item>
+        <el-form-item label="生成风险" prop="productionRisk">
+          <el-input v-model="form.productionRisk" placeholder="请输入生成风险"/>
+        </el-form-item>
+        <el-form-item label="设备类别" prop="equipmentCategory">
+          <el-input v-model="form.equipmentCategory" placeholder="请输入设备类别"/>
+        </el-form-item>
+        <el-form-item label="风险程度" prop="riskCriticality">
+          <el-input v-model="form.riskCriticality" placeholder="请输入风险程度"/>
+        </el-form-item>
+        <el-form-item label="定量分析" prop="quantitativeAnalysis">
+          <el-input v-model="form.quantitativeAnalysis" placeholder="请输入定量分析"/>
+        </el-form-item>
+        <el-form-item label="维修策略" prop="maintenanceStrategy">
+          <el-input v-model="form.maintenanceStrategy" placeholder="请输入维修策略"/>
+        </el-form-item>
+        <el-form-item label="维修策略描述" prop="msDescription">
+          <el-input v-model="form.msDescription" placeholder="请输入维修策略描述"/>
+        </el-form-item>
+        <el-form-item label="备件策略" prop="sparepartStrategy">
+          <el-input v-model="form.sparepartStrategy" placeholder="请输入备件策略"/>
+        </el-form-item>
+        <el-form-item label="备件策略描述" prop="ssDescription">
+          <el-input v-model="form.ssDescription" placeholder="请输入备件策略描述"/>
+        </el-form-item>
+        <el-form-item label="需要澄清" prop="needClarification">
+          <el-input v-model="form.needClarification" placeholder="请输入需要澄清"/>
+        </el-form-item>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注"/>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+    <!-- 用户导入对话框 -->
+    <el-dialog  :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+      <el-upload
+          ref="upload"
+          :limit="1"
+          accept=".xlsx, .xls"
+          :headers="upload.headers"
+          :action="upload.url"
+          :disabled="upload.isUploading"
+          :on-progress="handleFileUploadProgress"
+          :on-success="handleFileSuccess"
+          :auto-upload="false"
+          drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">
+          {{ $t('将文件拖到此处,或') }}
+          <em>{{ $t('点击上传') }}</em>
+        </div>
+        <div class="el-upload__tip" slot="tip">
+          <!--<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
+          <el-link type="info" style="font-size:12px" @click="importTemplate">{{ $t('下载模板') }}</el-link>
+        </div>
+        <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+          <input name="type" :value="upload.type" hidden />
+        </form>
+        <div class="el-upload__tip" style="color:red" slot="tip">{{ $t('提示:仅允许导入“xls”或“xlsx”格式文件!') }}</div>
+      </el-upload>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFileForm">{{ $t('确 定') }}</el-button>
+        <el-button @click="upload.open = false">{{ $t('取 消') }}</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  addAnalysis,
+  delAnalysis,
+  exportAnalysis,
+  getAnalysis,
+  importTemplate,
+  listAnalysis,
+  riskMatrixData,
+  updateAnalysis
+} from "@/api/reliability/analysis";
+import {treeselect} from "@/api/system/dept";
+import {getToken} from "@/utils/auth";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+
+export default {
+  name: "Analysis",
+  components: {Treeselect},
+  data() {
+    return {
+      chartData: {
+        mr: {
+          hB2: 0, hA1: 0, hA0: 0,
+          mC2: 0, mB1: 0, mA0: 0,
+          lC2: 0, lC1: 0, lB0: 0
+        },
+        pr: {
+          hB2: 0, hA1: 0, hA0: 0,
+          mC2: 0, mB1: 0, mA0: 0,
+          lC2: 0, lC1: 0, lB0: 0
+        },
+        ec: {
+          hC: 0, hB: 0, hA: 0,
+          mC: 0, mmB: 0, mhB: 0,
+          lD: 0, lC: 0, lB: 0
+        },
+        nr: 0, omr: 0, opr: 0,
+        countA: 0, countB: 0, countC: 0, countD: 0,
+        totalA: '0%', totalB: '0%', totalC: '0%', totalD: '0%'
+      },
+      drawer: false,
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: false,
+      // 总条数
+      total: 0,
+      // 定性分析表格数据
+      analysisList: [],
+      // 弹出层标题
+      title: "",
+      // 部门树选项
+      deptOptions: undefined,
+      clientHeight: 300,
+      // 是否显示弹出层
+      open: false,
+      // 用户导入参数
+      upload: {
+        //下载模板请求地址
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: "analysis",
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/reliability/analysis/importData"
+      },
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 20,
+        location: null,
+        tagNo: null,
+        description: null,
+        objectType: null,
+        catalogProfile: null,
+        relevant: null,
+        frequencyFailure: null,
+        maintenanceCost: null,
+        productionLoss: null,
+        maintenanceRisk: null,
+        productionRisk: null,
+        equipmentCategory: null,
+        riskCriticality: null,
+        quantitativeAnalysis: null,
+        maintenanceStrategy: null,
+        msDescription: null,
+        sparepartStrategy: null,
+        ssDescription: null,
+        needClarification: null,
+        remarks: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        deptId: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {}
+    };
+  },
+  watch: {
+    // 根据名称筛选部门树
+    deptName(val) {
+      this.$refs.tree.filter(val);
+    }
+  },
+  created() {
+    //设置表格高度对应屏幕高度
+    this.$nextTick(() => {
+      this.clientHeight = document.body.clientHeight - 250
+    })
+    this.getList();
+    this.getTreeselect();
+  },
+  methods: {
+    openDrawer() {
+      this.drawer = true;
+      riskMatrixData().then(response => {
+        let data = response.data;
+        this.chartData.mr.hB2 = data.mrhb2;
+        this.chartData.mr.hA1 = data.mrha1;
+        this.chartData.mr.hA0 = data.mrha0;
+        this.chartData.mr.mC2 = data.mrmc2;
+        this.chartData.mr.mB1 = data.mrmb1;
+        this.chartData.mr.mA0 = data.mrma0;
+        this.chartData.mr.lC2 = data.mrlc2;
+        this.chartData.mr.lC1 = data.mrlc1;
+        this.chartData.mr.lB0 = data.mrlb0;
+        this.chartData.pr.hB2 = data.prhb2;
+        this.chartData.pr.hA1 = data.prha1;
+        this.chartData.pr.hA0 = data.prha0;
+        this.chartData.pr.mC2 = data.prmc2;
+        this.chartData.pr.mB1 = data.prmb1;
+        this.chartData.pr.mA0 = data.prma0;
+        this.chartData.pr.lC2 = data.prlc2;
+        this.chartData.pr.lC1 = data.prlc1;
+        this.chartData.pr.lB0 = data.prlb0;
+        this.chartData.ec.hC = data.echc;
+        this.chartData.ec.hB = data.echb;
+        this.chartData.ec.hA = data.echa;
+        this.chartData.ec.mC = data.ecmc;
+        this.chartData.ec.mmB = data.ecmmb;
+        this.chartData.ec.mhB = data.ecmhb;
+        this.chartData.ec.lD = data.ecld;
+        this.chartData.ec.lC = data.eclc;
+        this.chartData.ec.lB = data.eclb;
+        this.chartData.nr = data.nr;
+        this.chartData.omr = data.omr;
+        this.chartData.opr = data.opr;
+        this.chartData.countA = data.countA;
+        this.chartData.countB = data.countB;
+        this.chartData.countC = data.countC;
+        this.chartData.countD = data.countD;
+        this.chartData.totalA = data.totalA;
+        this.chartData.totalB = data.totalB;
+        this.chartData.totalC = data.totalC;
+        this.chartData.totalD = data.totalD;
+      })
+    },
+    /** 查询定性分析列表 */
+    getList() {
+      this.loading = true;
+      listAnalysis(this.queryParams).then(response => {
+        this.analysisList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      treeselect().then(response => {
+        this.deptOptions = response.data;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        location: null,
+        tagNo: null,
+        description: null,
+        objectType: null,
+        catalogProfile: null,
+        relevant: null,
+        frequencyFailure: null,
+        maintenanceCost: null,
+        productionLoss: null,
+        maintenanceRisk: null,
+        productionRisk: null,
+        equipmentCategory: null,
+        riskCriticality: null,
+        quantitativeAnalysis: null,
+        maintenanceStrategy: null,
+        msDescription: null,
+        sparepartStrategy: null,
+        ssDescription: null,
+        needClarification: null,
+        remarks: null,
+        delFlag: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        deptId: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加定性分析";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getAnalysis(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改定性分析";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateAnalysis(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addAnalysis(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return delAnalysis(ids);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("删除成功");
+      })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有定性分析数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return exportAnalysis(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+      })
+    },
+    /** 导入按钮操作 */
+    handleImport() {
+      this.upload.title = "用户导入";
+      this.upload.open = true;
+    },
+    /** 下载模板操作 */
+    importTemplate() {
+      importTemplate().then(response => {
+        this.download(response.msg);
+      });
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      if (response.data[0] != null) {
+        this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据') + "," + this.$t('第') + response.data + this.$t('行数据出现错误导入失败')+"。", this.$t('导入结果'), { dangerouslyUseHTMLString: true });
+      }else {
+        this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据'), this.$t('导入结果'), { dangerouslyUseHTMLString: true });
+      }
+      this.getList();
+    },
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
+    }
+  }
+};
+</script>
+<style scoped>
+table {
+  border-collapse: collapse;
+  width: 90%;
+  margin: 5%;
+}
+
+.top_table td {
+  height: 30px;
+  width: 5%;
+  text-align: center;
+}
+
+.btm_table {
+  margin-top: 10%;
+}
+
+.btm_table td {
+  height: 30px;
+  width: 5%;
+  text-align: center;
+}
+
+.border-lr-td {
+  border-left: 1px solid black;
+  border-right: 1px solid black;
+}
+
+.border-top-td {
+  border-top: 1px solid black;
+}
+
+.border-btm-td {
+  border-bottom: 1px solid black;
+}
+
+.yellow {
+  background-color: yellow;
+}
+
+.green {
+  background-color: #02ff02;
+}
+
+.red {
+  background-color: red;
+}
+</style>