Ver código fonte

feat(document): 新增预防性维护策略模块

- 添加了TLdpeMaintenance实体类及相关Mapper、Service、Controller
- 实现了预防性维护策略的增删改查功能
- 支持Excel导入预防性维护策略数据
- 增加了CTM文档管理导入模板- 在首页添加了LDPE数据统计接口getLdpeLine
- 前端新增预防性维护策略页面及维护组件- 实现了策略子类的分类展示与管理
jiangbiao 2 meses atrás
pai
commit
eb02988197

+ 3 - 0
master/src/main/java/com/ruoyi/project/common/CommonController.java

@@ -472,6 +472,9 @@ public class CommonController extends BaseController
         } else if( type.equals("eoegLock") ) {
             downloadname = "Eoeg锁开锁关导入模板.xlsx";
             url = "static/template/eoeg/eoegLock.xlsx";
+        } else if( type.equals("maintenance") ) {
+            downloadname = "CTM文档管理导入模板.xlsx";
+            url = "static/template/ldpe/ldpe-maintenance.xlsx";
         }
 
         InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(url);

+ 25 - 2
master/src/main/java/com/ruoyi/project/common/controller/CBPSHomeDataController.java

@@ -4,14 +4,16 @@ import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.project.document.domain.TPlantproglist;
 import com.ruoyi.project.document.service.ITPlantproglistService;
-import com.ruoyi.project.ehs.domain.*;
+import com.ruoyi.project.ehs.domain.TEnvironapproval;
+import com.ruoyi.project.ehs.domain.TFireapproval;
+import com.ruoyi.project.ehs.domain.THealthapproval;
+import com.ruoyi.project.ehs.domain.TSafetyapproval;
 import com.ruoyi.project.ehs.service.ITEnvironapprovalService;
 import com.ruoyi.project.ehs.service.ITFireapprovalService;
 import com.ruoyi.project.ehs.service.ITHealthapprovalService;
 import com.ruoyi.project.ehs.service.ITSafetyapprovalService;
 import com.ruoyi.project.training.domain.TTraining;
 import com.ruoyi.project.training.mapper.TWorkcertificateCbpsMapper;
-import com.ruoyi.project.training.newstaff.domain.TTnNew;
 import com.ruoyi.project.training.service.ITTrainingService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -206,6 +208,27 @@ public class CBPSHomeDataController extends BaseController {
         return AjaxResult.success(result);
     }
 
+    @GetMapping("/getLdpeLine")
+    public AjaxResult getLdpeLine() {
+
+        TPlantproglist tPlantproglist = new TPlantproglist();
+        tPlantproglist.setDeptId(10025l);
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM");
+        Calendar cal = Calendar.getInstance();
+        Map<String, List<TPlantproglist>> result = new HashMap<>();
+        List<TPlantproglist> nextEdits = new ArrayList<>();
+        List<TPlantproglist> nextReviews = new ArrayList<>();
+        for (int i = 1; i < 8; i++) {
+            tPlantproglist.setStartDate(sdf.format(cal.getTime()));
+            cal.add(Calendar.MONTH, 1);
+            nextEdits.addAll(tPlantproglistService.countNextEditDate(tPlantproglist));
+            nextReviews.addAll(tPlantproglistService.countNextReviewDate(tPlantproglist));
+        }
+        result.put("nextEdit", nextEdits);
+        result.put("nextReview",nextReviews);
+        return AjaxResult.success(result);
+    }
+
     @GetMapping("/getWorkcetificate")
     public AjaxResult getWorkcetificate() {
         Map<String, Object> result = new HashMap<>();

+ 205 - 0
master/src/main/java/com/ruoyi/project/document/controller/TLdpeMaintenanceController.java

@@ -0,0 +1,205 @@
+package com.ruoyi.project.document.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.document.domain.TLdpeMaintenance;
+import com.ruoyi.project.document.service.ITLdpeMaintenanceService;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+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 2025-10-15
+ */
+@RestController
+@RequestMapping("/document/maintenance")
+public class TLdpeMaintenanceController extends BaseController {
+    @Autowired
+    private ITLdpeMaintenanceService tLdpeMaintenanceService;
+
+    /**
+     * 查询预防性维护策略列表
+     */
+    @PreAuthorize("@ss.hasPermi('document:maintenance:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TLdpeMaintenance tLdpeMaintenance) {
+        startPage();
+        List<TLdpeMaintenance> list = tLdpeMaintenanceService.selectTLdpeMaintenanceList(tLdpeMaintenance);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出预防性维护策略列表
+     */
+    @PreAuthorize("@ss.hasPermi('document:maintenance:list')")
+    @Log(title = "预防性维护策略", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TLdpeMaintenance tLdpeMaintenance) {
+        List<TLdpeMaintenance> list = tLdpeMaintenanceService.selectTLdpeMaintenanceList(tLdpeMaintenance);
+        ExcelUtil<TLdpeMaintenance> util = new ExcelUtil<TLdpeMaintenance>(TLdpeMaintenance.class);
+        return util.exportExcel(list, "maintenance");
+    }
+
+    /**
+     * 获取预防性维护策略详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('document:maintenance:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return AjaxResult.success(tLdpeMaintenanceService.selectTLdpeMaintenanceById(id));
+    }
+
+    /**
+     * 新增预防性维护策略
+     */
+    @PreAuthorize("@ss.hasPermi('document:maintenance:add')")
+    @Log(title = "预防性维护策略", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TLdpeMaintenance tLdpeMaintenance) {
+        tLdpeMaintenance.setCreaterCode(getUserId().toString());
+        tLdpeMaintenance.setCreatedate(new Date());
+        return toAjax(tLdpeMaintenanceService.insertTLdpeMaintenance(tLdpeMaintenance));
+    }
+
+    /**
+     * 修改预防性维护策略
+     */
+    @PreAuthorize("@ss.hasPermi('document:maintenance:edit')")
+    @Log(title = "预防性维护策略", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TLdpeMaintenance tLdpeMaintenance) {
+        tLdpeMaintenance.setUpdaterCode(getUserId().toString());
+        tLdpeMaintenance.setUpdatedate(new Date());
+        return toAjax(tLdpeMaintenanceService.updateTLdpeMaintenance(tLdpeMaintenance));
+    }
+
+    /**
+     * 删除预防性维护策略
+     */
+    @PreAuthorize("@ss.hasPermi('document:maintenance:remove')")
+    @Log(title = "预防性维护策略", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(tLdpeMaintenanceService.deleteTLdpeMaintenanceByIds(ids));
+    }
+
+
+    /**
+     * 批量导入装置程序清单
+     */
+    @PreAuthorize("@ss.hasPermi('document:plantproglist:add')")
+    @Log(title = "装置程序清单", businessType = BusinessType.INSERT)
+    @PostMapping("/importData")
+    public AjaxResult importData(@RequestParam("file") MultipartFile file) throws IOException {
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TLdpeMaintenance> 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.getLastCellNum();
+                TLdpeMaintenance entity = new TLdpeMaintenance();
+                //附件清单
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        String value="1.1";
+                        switch (cellValue){
+                            case "基于国家法规的强制性定期检验":
+                                value="1.1";
+                                break;
+                            case "基于byc规程的周期性检查和维护":
+                                value="1.2";
+                                break;
+                            case "基于CTM规定及OEM建议的定期检查和维护":
+                                value="1.3";
+                                break;
+                            case "基于状态监测的预测性维修":
+                                value="2";
+                                break;
+                            case "日常维护及故障检修":
+                                value="3";
+                                break;
+                            case "基于风险的维修":
+                                value="4.1";
+                                break;
+                            case "不良因素管理":
+                                value="4.2";
+                                break;
+                            case "技术改进":
+                                value="4.3";
+                                break;
+                        }
+                        entity.setStrategySubcategory(value);
+                    } else if (j == 1) {
+                        entity.setMaintenanceObject(cellValue);
+                    } else if (j == 2) {
+                        entity.setContent(cellValue);
+                    } else if (j == 3) {
+                        entity.setInterval(cellValue);
+                    } else if (j == 4) {
+                        entity.setRegulation(cellValue);
+                    } else if (j == 5) {
+                        entity.setDocumentation(cellValue);
+                    } else if (j == 6) {
+                        entity.setResponsibleDep(cellValue);
+                    } else if (j == 7) {
+                        entity.setPlanned(cellValue);
+                    } else if (j == 8) {
+                        entity.setRemarks(cellValue);
+                    }
+                }
+                logger.info("entity:{}", entity);
+                list.add(entity);
+            } catch (Exception e) {
+                logger.error(JSON.toJSONString(e));
+                failNumber++;
+                failRow.add(i + 1);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TLdpeMaintenance t : list) {
+            failNum++;
+            try {
+                add(t);
+                successNumber++;
+            } catch (Exception e) {
+                logger.error(JSON.toJSONString(e));
+                failNumber++;
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:{}", JSON.toJSONString(list));
+        logger.info("successNumber:{}", successNumber);
+        logger.info("failNumber:{}", failNumber);
+        logger.info("failRow:{}", failRow);
+        return AjaxResult.success(String.valueOf(successNumber), failRow);
+    }
+}

+ 261 - 0
master/src/main/java/com/ruoyi/project/document/domain/TLdpeMaintenance.java

@@ -0,0 +1,261 @@
+package com.ruoyi.project.document.domain;
+
+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;
+
+import java.util.Date;
+
+/**
+ * 预防性维护策略对象 t_ldpe_maintenance
+ *
+ * @author ssy
+ * @date 2025-10-15
+ */
+public class TLdpeMaintenance extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** ID */
+    private Long id;
+
+    /** 策略子类 */
+    @Excel(name = "策略子类")
+    private String strategySubcategory;
+
+    /** 维护对象 */
+    @Excel(name = "维护对象")
+    private String maintenanceObject;
+
+    /** 维护策略内容 */
+    @Excel(name = "维护策略内容")
+    private String content;
+
+    /** 维护周期 */
+    @Excel(name = "维护周期")
+    private String interval;
+
+    /** 遵循的法规或程序 */
+    @Excel(name = "遵循的法规或程序")
+    private String regulation;
+
+    /** 文档 */
+    @Excel(name = "文档")
+    private String documentation;
+
+    /** 负责部门 */
+    @Excel(name = "负责部门")
+    private String responsibleDep;
+
+    /** Planned or not
+ */
+    @Excel(name = "Planned or not")
+    private String planned;
+
+    /** 删除状态 */
+    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;
+
+    /** 部门编号 */
+//    @Excel(name = "部门编号")
+    private Long deptId;
+
+    /** 备注 */
+    @Excel(name = "备注")
+    private String remarks;
+    private String deptName;
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setStrategySubcategory(String strategySubcategory)
+    {
+        this.strategySubcategory = strategySubcategory;
+    }
+
+    public String getStrategySubcategory()
+    {
+        return strategySubcategory;
+    }
+    public void setMaintenanceObject(String maintenanceObject)
+    {
+        this.maintenanceObject = maintenanceObject;
+    }
+
+    public String getMaintenanceObject()
+    {
+        return maintenanceObject;
+    }
+    public void setContent(String content)
+    {
+        this.content = content;
+    }
+
+    public String getContent()
+    {
+        return content;
+    }
+    public void setInterval(String interval)
+    {
+        this.interval = interval;
+    }
+
+    public String getInterval()
+    {
+        return interval;
+    }
+    public void setRegulation(String regulation)
+    {
+        this.regulation = regulation;
+    }
+
+    public String getRegulation()
+    {
+        return regulation;
+    }
+    public void setDocumentation(String documentation)
+    {
+        this.documentation = documentation;
+    }
+
+    public String getDocumentation()
+    {
+        return documentation;
+    }
+    public void setResponsibleDep(String responsibleDep)
+    {
+        this.responsibleDep = responsibleDep;
+    }
+
+    public String getResponsibleDep()
+    {
+        return responsibleDep;
+    }
+    public void setPlanned(String planned)
+    {
+        this.planned = planned;
+    }
+
+    public String getPlanned()
+    {
+        return planned;
+    }
+    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;
+    }
+    public void setRemarks(String remarks)
+    {
+        this.remarks = remarks;
+    }
+
+    public String getRemarks()
+    {
+        return remarks;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("strategySubcategory", getStrategySubcategory())
+            .append("maintenanceObject", getMaintenanceObject())
+            .append("content", getContent())
+            .append("interval", getInterval())
+            .append("regulation", getRegulation())
+            .append("documentation", getDocumentation())
+            .append("responsibleDep", getResponsibleDep())
+            .append("planned", getPlanned())
+            .append("delFlag", getDelFlag())
+            .append("createrCode", getCreaterCode())
+            .append("createdate", getCreatedate())
+            .append("updaterCode", getUpdaterCode())
+            .append("updatedate", getUpdatedate())
+            .append("deptId", getDeptId())
+            .append("remarks", getRemarks())
+            .toString();
+    }
+}

+ 63 - 0
master/src/main/java/com/ruoyi/project/document/mapper/TLdpeMaintenanceMapper.java

@@ -0,0 +1,63 @@
+package com.ruoyi.project.document.mapper;
+
+import java.util.List;
+import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
+import com.ruoyi.project.document.domain.TLdpeMaintenance;
+
+/**
+ * 预防性维护策略Mapper接口
+ * 
+ * @author ssy
+ * @date 2025-10-15
+ */
+public interface TLdpeMaintenanceMapper 
+{
+    /**
+     * 查询预防性维护策略
+     * 
+     * @param id 预防性维护策略ID
+     * @return 预防性维护策略
+     */
+    public TLdpeMaintenance selectTLdpeMaintenanceById(Long id);
+
+    /**
+     * 查询预防性维护策略列表
+     * 
+     * @param tLdpeMaintenance 预防性维护策略
+     * @return 预防性维护策略集合
+     */
+    @DataScope(deptAlias = "d")
+    public List<TLdpeMaintenance> selectTLdpeMaintenanceList(TLdpeMaintenance tLdpeMaintenance);
+
+    /**
+     * 新增预防性维护策略
+     * 
+     * @param tLdpeMaintenance 预防性维护策略
+     * @return 结果
+     */
+    public int insertTLdpeMaintenance(TLdpeMaintenance tLdpeMaintenance);
+
+    /**
+     * 修改预防性维护策略
+     * 
+     * @param tLdpeMaintenance 预防性维护策略
+     * @return 结果
+     */
+    public int updateTLdpeMaintenance(TLdpeMaintenance tLdpeMaintenance);
+
+    /**
+     * 删除预防性维护策略
+     * 
+     * @param id 预防性维护策略ID
+     * @return 结果
+     */
+    public int deleteTLdpeMaintenanceById(Long id);
+
+    /**
+     * 批量删除预防性维护策略
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteTLdpeMaintenanceByIds(Long[] ids);
+}

+ 61 - 0
master/src/main/java/com/ruoyi/project/document/service/ITLdpeMaintenanceService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.project.document.service;
+
+import java.util.List;
+import com.ruoyi.project.document.domain.TLdpeMaintenance;
+
+/**
+ * 预防性维护策略Service接口
+ * 
+ * @author ssy
+ * @date 2025-10-15
+ */
+public interface ITLdpeMaintenanceService 
+{
+    /**
+     * 查询预防性维护策略
+     * 
+     * @param id 预防性维护策略ID
+     * @return 预防性维护策略
+     */
+    public TLdpeMaintenance selectTLdpeMaintenanceById(Long id);
+
+    /**
+     * 查询预防性维护策略列表
+     * 
+     * @param tLdpeMaintenance 预防性维护策略
+     * @return 预防性维护策略集合
+     */
+    public List<TLdpeMaintenance> selectTLdpeMaintenanceList(TLdpeMaintenance tLdpeMaintenance);
+
+    /**
+     * 新增预防性维护策略
+     * 
+     * @param tLdpeMaintenance 预防性维护策略
+     * @return 结果
+     */
+    public int insertTLdpeMaintenance(TLdpeMaintenance tLdpeMaintenance);
+
+    /**
+     * 修改预防性维护策略
+     * 
+     * @param tLdpeMaintenance 预防性维护策略
+     * @return 结果
+     */
+    public int updateTLdpeMaintenance(TLdpeMaintenance tLdpeMaintenance);
+
+    /**
+     * 批量删除预防性维护策略
+     * 
+     * @param ids 需要删除的预防性维护策略ID
+     * @return 结果
+     */
+    public int deleteTLdpeMaintenanceByIds(Long[] ids);
+
+    /**
+     * 删除预防性维护策略信息
+     * 
+     * @param id 预防性维护策略ID
+     * @return 结果
+     */
+    public int deleteTLdpeMaintenanceById(Long id);
+}

+ 93 - 0
master/src/main/java/com/ruoyi/project/document/service/impl/TLdpeMaintenanceServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.project.document.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.project.document.mapper.TLdpeMaintenanceMapper;
+import com.ruoyi.project.document.domain.TLdpeMaintenance;
+import com.ruoyi.project.document.service.ITLdpeMaintenanceService;
+
+/**
+ * 预防性维护策略Service业务层处理
+ *
+ * @author ssy
+ * @date 2025-10-15
+ */
+@Service
+public class TLdpeMaintenanceServiceImpl implements ITLdpeMaintenanceService
+{
+    @Autowired
+    private TLdpeMaintenanceMapper tLdpeMaintenanceMapper;
+
+    /**
+     * 查询预防性维护策略
+     *
+     * @param id 预防性维护策略ID
+     * @return 预防性维护策略
+     */
+    @Override
+    public TLdpeMaintenance selectTLdpeMaintenanceById(Long id)
+    {
+        return tLdpeMaintenanceMapper.selectTLdpeMaintenanceById(id);
+    }
+
+    /**
+     * 查询预防性维护策略列表
+     *
+     * @param tLdpeMaintenance 预防性维护策略
+     * @return 预防性维护策略
+     */
+    @Override
+    public List<TLdpeMaintenance> selectTLdpeMaintenanceList(TLdpeMaintenance tLdpeMaintenance)
+    {
+        return tLdpeMaintenanceMapper.selectTLdpeMaintenanceList(tLdpeMaintenance);
+    }
+
+    /**
+     * 新增预防性维护策略
+     *
+     * @param tLdpeMaintenance 预防性维护策略
+     * @return 结果
+     */
+    @Override
+    public int insertTLdpeMaintenance(TLdpeMaintenance tLdpeMaintenance)
+    {
+        return tLdpeMaintenanceMapper.insertTLdpeMaintenance(tLdpeMaintenance);
+    }
+
+    /**
+     * 修改预防性维护策略
+     *
+     * @param tLdpeMaintenance 预防性维护策略
+     * @return 结果
+     */
+    @Override
+    public int updateTLdpeMaintenance(TLdpeMaintenance tLdpeMaintenance)
+    {
+        return tLdpeMaintenanceMapper.updateTLdpeMaintenance(tLdpeMaintenance);
+    }
+
+    /**
+     * 批量删除预防性维护策略
+     *
+     * @param ids 需要删除的预防性维护策略ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTLdpeMaintenanceByIds(Long[] ids)
+    {
+        return tLdpeMaintenanceMapper.deleteTLdpeMaintenanceByIds(ids);
+    }
+
+    /**
+     * 删除预防性维护策略信息
+     *
+     * @param id 预防性维护策略ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTLdpeMaintenanceById(Long id)
+    {
+        return tLdpeMaintenanceMapper.deleteTLdpeMaintenanceById(id);
+    }
+}

+ 136 - 0
master/src/main/resources/mybatis/document/TLdpeMaintenanceMapper.xml

@@ -0,0 +1,136 @@
+<?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.document.mapper.TLdpeMaintenanceMapper">
+    
+    <resultMap type="TLdpeMaintenance" id="TLdpeMaintenanceResult">
+        <result property="id"    column="id"    />
+        <result property="strategySubcategory"    column="strategy_subcategory"    />
+        <result property="maintenanceObject"    column="maintenance_object"    />
+        <result property="content"    column="content"    />
+        <result property="interval"    column="interval"    />
+        <result property="regulation"    column="regulation"    />
+        <result property="documentation"    column="documentation"    />
+        <result property="responsibleDep"    column="responsible_dep"    />
+        <result property="planned"    column="planned"    />
+        <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="remarks"    column="remarks"    />
+        <result property="deptName" column="dept_name" />
+    </resultMap>
+
+    <sql id="selectTLdpeMaintenanceVo">
+        select d.id, d.strategy_subcategory, d.maintenance_object, d.content, d.interval, d.regulation, d.documentation, d.responsible_dep, d.planned, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_ldpe_maintenance d
+      left join sys_dept s on s.dept_id = d.dept_id
+    </sql>
+
+    <select id="selectTLdpeMaintenanceList" parameterType="TLdpeMaintenance" resultMap="TLdpeMaintenanceResult">
+        <include refid="selectTLdpeMaintenanceVo"/>
+        <where>  
+            <if test="strategySubcategory != null  and strategySubcategory != ''"> and strategy_subcategory = #{strategySubcategory}</if>
+            <if test="maintenanceObject != null  and maintenanceObject != ''"> and maintenance_object = #{maintenanceObject}</if>
+            <if test="content != null  and content != ''"> and content = #{content}</if>
+            <if test="interval != null  and interval != ''"> and interval = #{interval}</if>
+            <if test="regulation != null  and regulation != ''"> and regulation = #{regulation}</if>
+            <if test="documentation != null  and documentation != ''"> and documentation = #{documentation}</if>
+            <if test="responsibleDep != null  and responsibleDep != ''"> and responsible_dep = #{responsibleDep}</if>
+            <if test="planned != null  and planned != ''"> and planned = #{planned}</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="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
+            and d.del_flag = 0
+        </where>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+    </select>
+    
+    <select id="selectTLdpeMaintenanceById" parameterType="Long" resultMap="TLdpeMaintenanceResult">
+        <include refid="selectTLdpeMaintenanceVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertTLdpeMaintenance" parameterType="TLdpeMaintenance">
+        <selectKey keyProperty="id" resultType="long" order="BEFORE">
+            SELECT seq_t_ldpe_maintenance.NEXTVAL as id FROM DUAL
+        </selectKey>
+        insert into t_ldpe_maintenance
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="strategySubcategory != null">strategy_subcategory,</if>
+            <if test="maintenanceObject != null">maintenance_object,</if>
+            <if test="content != null">content,</if>
+            <if test="interval != null">interval,</if>
+            <if test="regulation != null">regulation,</if>
+            <if test="documentation != null">documentation,</if>
+            <if test="responsibleDep != null">responsible_dep,</if>
+            <if test="planned != null">planned,</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="remarks != null">remarks,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="strategySubcategory != null">#{strategySubcategory},</if>
+            <if test="maintenanceObject != null">#{maintenanceObject},</if>
+            <if test="content != null">#{content},</if>
+            <if test="interval != null">#{interval},</if>
+            <if test="regulation != null">#{regulation},</if>
+            <if test="documentation != null">#{documentation},</if>
+            <if test="responsibleDep != null">#{responsibleDep},</if>
+            <if test="planned != null">#{planned},</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="remarks != null">#{remarks},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTLdpeMaintenance" parameterType="TLdpeMaintenance">
+        update t_ldpe_maintenance
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="strategySubcategory != null">strategy_subcategory = #{strategySubcategory},</if>
+            <if test="maintenanceObject != null">maintenance_object = #{maintenanceObject},</if>
+            <if test="content != null">content = #{content},</if>
+            <if test="interval != null">interval = #{interval},</if>
+            <if test="regulation != null">regulation = #{regulation},</if>
+            <if test="documentation != null">documentation = #{documentation},</if>
+            <if test="responsibleDep != null">responsible_dep = #{responsibleDep},</if>
+            <if test="planned != null">planned = #{planned},</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>
+            <if test="remarks != null">remarks = #{remarks},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <update id="deleteTLdpeMaintenanceById" parameterType="Long">
+        update t_ldpe_maintenance set del_flag = 2 where id = #{id}
+    </update>
+
+    <update id="deleteTLdpeMaintenanceByIds" parameterType="String">
+        update t_ldpe_maintenance set del_flag = 2 where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+    
+</mapper>

BIN
master/src/main/resources/static/template/ldpe/ldpe-maintenance.xlsx


+ 7 - 0
ui/src/api/common/homedataCbpb.js

@@ -29,6 +29,13 @@ export function getLine() {
     method: 'get',
   })
 }
+// 根据时间统计
+export function getLdpeLine() {
+  return request({
+    url: '/cbps/home/getLdpeLine',
+    method: 'get',
+  })
+}
 
 // 根据时间统计
 export function getWorkcetificate() {

+ 53 - 0
ui/src/api/document/maintenance.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询预防性维护策略列表
+export function listMaintenance(query) {
+  return request({
+    url: '/document/maintenance/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询预防性维护策略详细
+export function getMaintenance(id) {
+  return request({
+    url: '/document/maintenance/' + id,
+    method: 'get'
+  })
+}
+
+// 新增预防性维护策略
+export function addMaintenance(data) {
+  return request({
+    url: '/document/maintenance',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改预防性维护策略
+export function updateMaintenance(data) {
+  return request({
+    url: '/document/maintenance',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除预防性维护策略
+export function delMaintenance(id) {
+  return request({
+    url: '/document/maintenance/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出预防性维护策略
+export function exportMaintenance(query) {
+  return request({
+    url: '/document/maintenance/export',
+    method: 'get',
+    params: query
+  })
+}

+ 2 - 2
ui/src/views/dashboard/ldpe/LineChart.vue

@@ -7,7 +7,7 @@ import * as echarts from 'echarts'
 
 require('echarts/theme/macarons') // echarts theme
 import resize from '../mixins/resize'
-import {getLine} from "@/api/common/homedataCbpb";
+import {getLdpeLine} from "@/api/common/homedataCbpb";
 
 export default {
   mixins: [resize],
@@ -43,7 +43,7 @@ export default {
   },
   mounted() {
     this.$nextTick(() => {
-      getLine().then(res => {
+      getLdpeLine().then(res => {
         for (const item of res.data.nextEdit) {
           this.monthList.push(item.dataMonth);
           this.nextEdit.push(item.dataCount);

+ 128 - 0
ui/src/views/document/maintenance/index.vue

@@ -0,0 +1,128 @@
+<template>
+  <div class="app-container">
+    <el-tabs v-model="activeName" @tab-click="handleClick">
+      <el-tab-pane label="基于国家法规的强制性定期检验" name="first">
+        <maintenance strategy-subcategory="1.1" v-if="isFirst"/>
+      </el-tab-pane>
+      <el-tab-pane label="基于byc规程的周期性检查和维护" name="second">
+        <maintenance strategy-subcategory="1.2" v-if="isSecond"/>
+      </el-tab-pane>
+      <el-tab-pane label="基于CTM规定及OEM建议的定期检查和维护" name="third">
+        <maintenance strategy-subcategory="1.3" v-if="isThird"/>
+      </el-tab-pane>
+      <el-tab-pane label="基于状态监测的预测性维修" name="fourth">
+        <maintenance strategy-subcategory="2" v-if="isFourth"/>
+      </el-tab-pane>
+      <el-tab-pane label="日常维护及故障检修" name="fifth">
+        <maintenance strategy-subcategory="3" v-if="isFifth"/>
+      </el-tab-pane>
+      <el-tab-pane label="基于风险的维修" name="sixth">
+        <maintenance strategy-subcategory="4.1" v-if="isSixth"/>
+      </el-tab-pane>
+      <el-tab-pane label="不良因素管理" name="seventh">
+        <maintenance strategy-subcategory="4.2" v-if="isSeventh"/>
+      </el-tab-pane>
+      <el-tab-pane label="技术改进" name="eighth">
+        <maintenance strategy-subcategory="4.3" v-if="isEighth"/>
+      </el-tab-pane>
+    </el-tabs>
+  </div>
+</template>
+<script>
+
+import Maintenance from "@/views/document/maintenance/maintenance.vue";
+
+export default {
+  components: {Maintenance},
+  data() {
+    return {
+      activeName: 'first',
+      isFirst: true,
+      isSecond: false,
+      isThird: false,
+      isFourth: false,
+      isFifth: false,
+      isSixth: false,
+      isSeventh: false,
+      isEighth: false,
+    }
+  },
+  methods: {
+    handleClick(tab) {
+      if (tab.name === 'first') {
+        this.isFirst = true
+        this.isSecond = false
+        this.isThird = false
+        this.isFourth = false
+        this.isFifth = false
+        this.isSixth = false
+        this.isSeventh = false
+        this.isEighth = false
+      } else if (tab.name === 'second') {
+        this.isFirst = false
+        this.isSecond = true
+        this.isThird = false
+        this.isFourth = false
+        this.isFifth = false
+        this.isSixth = false
+        this.isSeventh = false
+        this.isEighth = false
+      } else if (tab.name === 'third') {
+        this.isFirst = false
+        this.isSecond = false
+        this.isThird = true
+        this.isFourth = false
+        this.isFifth = false
+        this.isSixth = false
+        this.isSeventh = false
+        this.isEighth = false
+      } else if (tab.name === 'fourth') {
+        this.isFirst = false
+        this.isSecond = false
+        this.isThird = false
+        this.isFourth = true
+        this.isFifth = false
+        this.isSixth = false
+        this.isSeventh = false
+        this.isEighth = false
+      } else if (tab.name === 'fifth') {
+        this.isFirst = false
+        this.isSecond = false
+        this.isThird = false
+        this.isFourth = false
+        this.isFifth = true
+        this.isSixth = false
+        this.isSeventh = false
+        this.isEighth = false
+      } else if (tab.name === 'sixth') {
+        this.isFirst = false
+        this.isSecond = false
+        this.isThird = false
+        this.isFourth = false
+        this.isFifth = false
+        this.isSixth = true
+        this.isSeventh = false
+        this.isEighth = false
+      } else if (tab.name === 'seventh') {
+        this.isFirst = false
+        this.isSecond = false
+        this.isThird = false
+        this.isFourth = false
+        this.isFifth = false
+        this.isSixth = false
+        this.isSeventh = true
+        this.isEighth = false
+      } else if (tab.name === 'eighth') {
+        this.isFirst = false
+        this.isSecond = false
+        this.isThird = false
+        this.isFourth = false
+        this.isFifth = false
+        this.isSixth = false
+        this.isSeventh = false
+        this.isEighth = true
+      }
+    }
+  }
+}
+</script>

+ 743 - 0
ui/src/views/document/maintenance/maintenance.vue

@@ -0,0 +1,743 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @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
+          type="primary"
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['document:maintenance:add']"
+        >新增
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['document:maintenance:edit']"
+        >修改
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['document:maintenance:remove']"
+        >删除
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="info"
+          icon="el-icon-upload2"
+          size="mini"
+          @click="handleImport"
+          v-hasPermi="['document:maintenance:edit']"
+        >导入
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['document:maintenance:list']"
+        >导出
+        </el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="maintenanceList" @selection-change="handleSelectionChange"
+              :height="clientHeight" border>
+      <el-table-column type="selection" width="55" align="center"/>
+      <el-table-column label="维护对象" align="center" prop="maintenanceObject" :show-overflow-tooltip="true"/>
+      <el-table-column label="维护策略内容" align="center" prop="content" :show-overflow-tooltip="true"/>
+      <el-table-column label="维护周期" align="center" prop="interval" :show-overflow-tooltip="true"/>
+      <el-table-column label="遵循的法规或程序" align="center" prop="regulation" :show-overflow-tooltip="true"/>
+      <el-table-column label="文档" align="center" prop="documentation" :show-overflow-tooltip="true"/>
+      <el-table-column label="负责部门" align="center" prop="responsibleDep" :show-overflow-tooltip="true"/>
+      <el-table-column label="Planned or not" align="center" prop="planned" :show-overflow-tooltip="true"/>
+      <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
+      <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['document:maintenance:edit']"
+          >修改
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['document:maintenance:remove']"
+          >删除
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-document"
+            @click="handleDoc(scope.row)"
+            v-hasPermi="['document:maintenance:edit']"
+          >报告附件
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改预防性维护策略对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="维护对象" prop="maintenanceObject">
+          <el-input v-model="form.maintenanceObject" placeholder="请输入维护对象"/>
+        </el-form-item>
+        <el-form-item label="维护策略内容">
+          <el-input type="textarea" v-model="form.content" placeholder="请输入维护策略内容"/>
+        </el-form-item>
+        <el-form-item label="维护周期" prop="interval">
+          <el-input v-model="form.interval" placeholder="请输入维护周期"/>
+        </el-form-item>
+        <el-form-item label="遵循的法规或程序" prop="regulation">
+          <el-input v-model="form.regulation" placeholder="请输入遵循的法规或程序"/>
+        </el-form-item>
+        <el-form-item label="文档" prop="documentation">
+          <el-input v-model="form.documentation" placeholder="请输入文档"/>
+        </el-form-item>
+        <el-form-item label="负责部门" prop="responsibleDep">
+          <el-input v-model="form.responsibleDep" placeholder="请输入负责部门"/>
+        </el-form-item>
+        <el-form-item label="Planned or not" prop="planned">
+          <el-input v-model="form.planned" placeholder="请输入Planned or not"/>
+        </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:#ff0000" 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>
+    <!-- 报告附件对话框 -->
+    <el-dialog :close-on-click-modal="false" v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="700px"
+               append-to-body>
+      <el-upload
+        ref="doc"
+        :limit="500"
+        :headers="doc.headers"
+        :action="doc.url + '?pType=' + doc.pType + '&pId=' + doc.pId"
+        :disabled="doc.isUploading"
+        :on-progress="handleFileDocProgress"
+        :on-success="handleFileDocSuccess"
+        :auto-upload="true"
+        drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">
+          {{ $t('将文件拖到此处,或') }}
+          <em>{{ $t('点击上传') }}</em>
+        </div>
+      </el-upload>
+      <el-table :data="doc.commonfileList" border>
+        <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
+          <template slot-scope="scope">
+            <a class="link-type" @click="handleDownload(scope.row)">
+              <span>{{ scope.row.fileName }}</span>
+            </a>
+          </template>
+        </el-table-column>
+        <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true"
+                         width="80"/>
+        <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
+        <el-table-column :label="$t('操作')" align="center" width="150" class-name="small-padding fixed-width">
+          <template slot-scope="scope">
+            <el-button
+              v-if="scope.row.fileName.endsWith('pdf')||scope.row.fileName.endsWith('xlsx')||scope.row.fileName.endsWith('md')
+                 ||scope.row.fileName.endsWith('docx')||scope.row.fileName.endsWith('doc')||scope.row.fileName.endsWith('txt')
+                 ||scope.row.fileName.endsWith('jpg')||scope.row.fileName.endsWith('png')||scope.row.fileName.endsWith('csv')
+                 ||scope.row.fileName.endsWith('mp4')||scope.row.fileName.endsWith('svg')||scope.row.fileName.endsWith('dwg')
+                 ||scope.row.fileName.endsWith('flv')||scope.row.fileName.endsWith('swf')||scope.row.fileName.endsWith('gif')
+                 ||scope.row.fileName.endsWith('3gp')||scope.row.fileName.endsWith('mkv')||scope.row.fileName.endsWith('tif')"
+              size="mini"
+              type="text"
+              icon="el-icon-view"
+              @click="handleSee(scope.row)"
+            > {{ $t('预览') }}
+            </el-button>
+            <el-button
+              v-if="scope.row.fileName.endsWith('ppt')||scope.row.fileName.endsWith('pptx') "
+              size="mini"
+              type="text"
+              icon="el-icon-view"
+              @click="handleSeePPT(scope.row)"
+            > {{ $t('ppt预览') }}
+            </el-button>
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-download"
+              @click="handleDownload(scope.row)"
+            >{{ $t('下载') }}
+            </el-button>
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-delete"
+              @click="handleDeleteDoc(scope.row)"
+            >{{ $t('删除') }}
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div slot="footer" class="dialog-footer">
+        <!--        <el-button type="primary" @click="submitFileForm">{{ $t('确 定') }}</el-button>-->
+        <el-button @click="doc.open = false">{{ $t('返 回') }}</el-button>
+      </div>
+    </el-dialog>
+    <el-dialog :close-on-click-modal="false" v-loading="loadingFlash" element-loading-background="rgba(0,0,0,0.2)"
+               v-dialogDrag :title="pdf.title"
+               :visible.sync="pdf.open" width="1300px" :center="true" append-to-body>
+      <div style="margin-top: -60px;float: right;margin-right: 40px;">
+        <el-button size="mini" type="text" @click="openPdf">{{ $t('新页面打开PDF') }}</el-button>
+      </div>
+      <div style="margin-top: -30px">
+        <iframe id="iFrame" class="iframe-html" :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"
+                v-if="ppt"></iframe>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  addMaintenance,
+  delMaintenance,
+  exportMaintenance,
+  getMaintenance,
+  listMaintenance,
+  updateMaintenance
+} from "@/api/document/maintenance";
+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";
+import {allFileList, delCommonfile} from "@/api/common/commonfile";
+
+export default {
+  name: "Maintenance",
+  components: {Treeselect},
+  // components: { Editor },
+  props: {
+    strategySubcategory: {
+      type: String,
+      default: "1.1"
+    }
+  },
+  data() {
+    return {
+      ppt: false,
+      pptView: false,
+      drawer: false,
+      direction: 'rtl',
+      sonRefresh: true,
+      // 遮罩层
+      loading: true,
+      loadingFlash: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: false,
+      // 总条数
+      total: 0,
+      // 预防性维护策略表格数据
+      maintenanceList: [],
+      // 弹出层标题
+      title: "",
+      // 部门树选项
+      deptOptions: undefined,
+      clientHeight: 300,
+      // 是否显示弹出层
+      open: false,
+      // 用户导入参数
+      upload: {
+        //下载模板请求地址
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: 'maintenance',
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: {Authorization: "Bearer " + getToken()},
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/document/maintenance/importData"
+      },
+      doc: {
+        file: "123",
+        // 是否显示弹出层(报告附件)
+        open: false,
+        // 弹出层标题(报告附件)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 报告附件上传位置编号
+        ids: 0,
+        // 设置上传的请求头部
+        headers: {Authorization: "Bearer " + getToken()},
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
+        commonfileList: null,
+        queryParams: {
+          pId: null,
+          pType: 'maintenance'
+        },
+        pType: 'maintenance',
+        pId: null
+      },
+      pdf: {
+        title: '',
+        pdfUrl: '',
+        numPages: null,
+        open: false,
+        pageNum: 1,
+        pageTotalNum: 1,
+        loadedRatio: 0,
+      },
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 20,
+        strategySubcategory: this.strategySubcategory,
+        maintenanceObject: null,
+        content: null,
+        interval: null,
+        regulation: null,
+        documentation: null,
+        responsibleDep: null,
+        planned: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        deptId: null,
+        remarks: 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: {
+    /** 查询预防性维护策略列表 */
+    getList() {
+      this.loading = true;
+      listMaintenance(this.queryParams).then(response => {
+        this.maintenanceList = 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,
+        strategySubcategory: this.strategySubcategory,
+        maintenanceObject: null,
+        content: null,
+        interval: null,
+        regulation: null,
+        documentation: null,
+        responsibleDep: null,
+        planned: null,
+        delFlag: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        deptId: null,
+        remarks: 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
+      getMaintenance(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) {
+            updateMaintenance(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addMaintenance(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 delMaintenance(ids);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("删除成功");
+      })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有预防性维护策略数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return exportMaintenance(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+      })
+    },
+    /** 导入按钮操作 */
+    handleImport() {
+      this.upload.title = "用户导入";
+      this.upload.open = true;
+    },
+    /** 下载模板操作 */
+    importTemplate() {
+      this.$refs['downloadFileForm'].submit()
+    },
+    // 文件上传中处理
+    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();
+    },
+    /** 报告附件按钮操作 */
+    handleDoc(row) {
+      this.doc.id = row.id;
+      this.doc.title = row.filename;
+      this.doc.open = true;
+      this.doc.queryParams.pId = row.id
+      this.doc.pId = row.id
+      this.getFileList()
+      this.$nextTick(() => {
+        this.$refs.doc.clearFiles()
+      })
+    },
+    getFileList() {
+      allFileList(this.doc.queryParams).then(response => {
+        this.doc.commonfileList = response;
+      });
+    },
+    //附件上传中处理
+    handleFileDocProgress(event, file, fileList) {
+      this.doc.file = file;
+      this.doc.isUploading = true;
+    },
+    //附件上传成功处理
+    handleFileDocSuccess(response, file, fileList) {
+      this.doc.isUploading = false;
+      this.$alert(response.msg, this.$t('导入结果'), {dangerouslyUseHTMLString: true});
+      this.getFileList()
+    },
+    /** 删除按钮操作 */
+    handleDeleteDoc(row) {
+      const ids = row.id || this.ids;
+      this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
+        confirmButtonText: this.$t('确定'),
+        cancelButtonText: this.$t('取消'),
+        type: "warning"
+      }).then(function () {
+        return delCommonfile(ids);
+      }).then(() => {
+        this.getFileList()
+        this.msgSuccess(this.$t('删除成功'));
+      })
+    },
+    // 文件下载处理
+    handleDownload(row) {
+      var name = row.fileName;
+      var url = row.fileUrl;
+      var suffix = url.substring(url.lastIndexOf("."), url.length);
+      console.log(url)
+      const a = document.createElement('a')
+      a.setAttribute('download', name)
+      a.setAttribute('target', '_blank')
+      a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
+      a.click()
+    },
+    //文件预览
+    openPdf() {
+      //ppt就跳路由预览,office就直接打开文件新页面
+      const didi = {imgs: this.imgs}
+      if (this.pptView == true && this.ppt == false) {
+        let routeUrl = this.$router.resolve({
+          path: "/cpms/index.html#/pptyulan",
+          query: didi
+        });
+        window.open("/cpms/index.html#/pptyulan?id=" + this.pdf.pdfUrl, '_blank')
+        console.log(this.imgs)
+      } else {
+        window.open(this.pdf.pdfUrl)
+      }
+    },
+    handleSeePPT(row) {
+      //ppt预览
+      this.loadingFlash = true
+      this.pdf.open = true
+      this.pdf.title = row.fileName
+      this.pdf.pdfUrl = row.fileUrl
+      this.pptView = true
+      this.ppt = false
+      const formatDate = new FormData();
+      formatDate.append("filepath", row.fileUrl)
+      //调用文件预览api
+      let res = this.officeConvert.pptConvertCommon(formatDate)
+
+      //查看接受的全局方法的返回结果 console.log(res)
+      //利用.then方法接受Promise对象
+
+      res.then((result) => {
+        //关闭加载中
+        this.loadingFlash = false
+
+        //成功时直接给地址
+        this.videoList = result.data.imagePathList
+        //将返回的地址集合遍历添加到绑定的数组中
+        this.imgs = []
+        for (var key = 0; key < this.videoList.length; key++) {
+          this.imgs.push(process.env.VUE_APP_BASE_API + this.videoList[key]);
+        }
+      }).catch(result => {
+
+        //请求失败,关闭loading,pdf地址直接为为空,不显示
+        this.pdf.pdfUrl = ""
+        this.loadingFlash = false;
+      })
+    },
+    handleSee(row) {
+      //office预览
+      this.loadingFlash = true
+      this.pdf.open = true
+      this.pdf.title = row.fileName
+      this.pdf.pdfUrl = ""
+
+      this.pptView = false
+      this.ppt = true
+      //如果是PDF等直接可以打开的就不调接口,否则调用接口
+      if (row.fileName.endsWith('pdf')) {
+        this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + '/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
+        this.loadingFlash = false
+      } else {
+        const formatDate = new FormData();
+        formatDate.append("filepath", row.fileUrl)
+
+        //调用文件预览api
+        let res = this.officeConvert.officeConvertCommon(formatDate)
+
+
+        //查看接受的全局方法的返回结果 console.log(res)
+        //利用.then方法接受Promise对象
+        res.then((result) => {
+          //关闭加载中
+          this.loadingFlash = false
+
+          if (result.msg.includes("csv")) {
+            this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + result.data
+            this.$alert(result.msg, this.$t('检查乱码'), {dangerouslyUseHTMLString: true});
+            //    this.$message({message: result.msg, center: true,type:'warning',  offset:400, });
+
+          } else if (result.msg.includes("不存在")) {
+            //文件不存在时提示
+            this.pdf.pdfUrl = ""
+            this.$alert(result.msg, this.$t('预览失败'), {dangerouslyUseHTMLString: true});
+            //    this.$message({message: result.msg, center: true,type:'warning',  offset:400, });
+            this.pdf.open = false
+          } else if (result.msg.includes("不支持此格式")) {
+
+            this.pdf.pdfUrl = ""
+            this.$alert(result.msg, this.$t('预览失败'), {dangerouslyUseHTMLString: true});
+            //    this.$message({message: result.msg, center: true,type:'warning',  offset:400, });
+            this.pdf.open = false
+          } else {
+            //成功时直接给地址
+            this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + result.data
+          }
+          // this.$nextTick(() => {
+          //   const iframe = window.frames['iFrame']
+          //   const handleLoad = () => {
+          //     setTimeout(() => {
+          //       const Do = (iframe.contentWindow || iframe.contentDocument)
+          //       console.log(Do.document.getElementsByTagName('table')[0])
+          //       Do.document.getElementsByTagName('table')[0].style.width = "100%"
+          //       Do.document.getElementsByTagName('table')[0].setAttribute("class","table")
+          //     }, 500)
+          //   }
+          //   iframe.addEventListener('load', handleLoad, true)
+          // })
+        }).catch(result => {
+          //请求失败,关闭loading,pdf地址直接为为空,不显示
+          this.pdf.pdfUrl = ""
+          this.loadingFlash = false;
+        })
+      }
+    },
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
+    }
+  }
+};
+</script>

+ 7 - 7
ui/src/views/ldpehome.vue

@@ -4,7 +4,7 @@
     <panel-group @handleSetLineChartData="handleSetLineChartData" />
 
     <el-row :gutter="32">
-      <el-col :xs="24" :sm="24" :lg="8">
+      <el-col :xs="24" :sm="24" :lg="12">
         <div>
           <div class="card-head">
             <span class="card-name">{{ $t('程序数量') }}</span>
@@ -14,7 +14,7 @@
           <raddar-chart />
         </div>
       </el-col>
-      <el-col :xs="24" :sm="24" :lg="8">
+      <el-col :xs="24" :sm="24" :lg="12">
         <div>
           <div class="card-head">
             <span class="card-name">装置年度培训完成情况</span>
@@ -40,7 +40,7 @@
       <!--          <bar-chart />-->
       <!--        </div>-->
       <!--      </el-col>-->
-      <el-col :xs="24" :sm="24" :lg="8">
+<!--      <el-col :xs="24" :sm="24" :lg="8">
         <div>
           <div class="card-head">
             <span class="card-name">{{ $t('新员工培训完成率') }}</span>
@@ -59,11 +59,11 @@
         <div class="chart-wrapper">
           <birth-chart ref="newchart"/>
         </div>
-      </el-col>
+      </el-col>-->
     </el-row>
 
     <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
-      <el-col :xs="24" :sm="24" :lg="10">
+      <el-col :xs="24" :sm="24" :lg="24">
         <div>
           <div class="card-head">
             <span class="card-name">程序清单到期提醒</span>
@@ -73,7 +73,7 @@
           <line-chart :chart-data="lineChartData" />
         </div>
       </el-col>
-      <el-col :xs="24" :sm="24" :lg="14">
+<!--      <el-col :xs="24" :sm="24" :lg="14">
         <div>
           <div class="card-head">
             <span class="card-name">员工证书统计</span>
@@ -82,7 +82,7 @@
         <div class="chart-wrapper">
           <workcertificate-chart :chart-data="lineChartData" />
         </div>
-      </el-col>
+      </el-col>-->
 
     </el-row>
 

+ 9 - 8
ui/src/views/pssr/material/index.vue

@@ -211,12 +211,12 @@
           <el-input v-model="form.utilityQuantity" placeholder="请输入公用工程物料"/>
         </el-form-item>
         <el-form-item label="条件/存量">
-          <el-radio-group v-model="form.statusType" @input="changeQuantity">
+          <el-radio-group v-model="statusType" @input="changeQuantity">
             <el-radio :label="1">具备投用状态</el-radio>
             <el-radio :label="0">具体投用数量</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="具体投用数量" v-if="qFlag">
+        <el-form-item label="具体投用数量" v-if="statusType==0">
           <el-input v-model="form.quantity" placeholder="请输入具体投用数量"/>
         </el-form-item>
         <el-form-item label="单位" prop="unit">
@@ -361,6 +361,7 @@ export default {
   data() {
     return {
       qFlag: false,
+      statusType:1,
       reason: {
         open: false
       },
@@ -496,6 +497,7 @@ export default {
     },
     // 表单重置
     reset() {
+      this.statusType=1;
       this.form = {
         id: null,
         subId: this.subId,
@@ -547,17 +549,16 @@ export default {
         this.form = response.data;
         this.open = true;
         this.title = "修改原料";
-
-        if (this.form.quantity == '具备投用状态') {
-          this.form.statusType = 1;
-        } else {
-          this.form.statusType = 0;
+        if (response.data.quantity === '具备投用状态') {
+          this.statusType = 1;
+        } else if (response.data.quantity != null) {
+          this.statusType = 0;
         }
       });
     },
     /** 提交按钮 */
     submitForm() {
-      if (this.form.statusType == 1) {
+      if (this.statusType == 1) {
         this.form.quantity = '具备投用状态'
       }
       this.$refs["form"].validate(valid => {

+ 15 - 8
ui/src/views/pssr/materialRaw/index.vue

@@ -206,16 +206,16 @@
     <!-- 添加或修改原料对话框 -->
     <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="公用工程物料" prop="utilityQuantity">
-          <el-input v-model="form.utilityQuantity" placeholder="请输入公用工程物料"/>
+        <el-form-item label="原料" prop="rawMaterial">
+          <el-input v-model="form.rawMaterial" placeholder="请输入原料"/>
         </el-form-item>
         <el-form-item label="条件/存量">
-          <el-radio-group v-model="form.statusType" @input="changeQuantity">
+          <el-radio-group v-model="statusType"  @input="changeQuantity">
             <el-radio :label="1">具备投用状态</el-radio>
             <el-radio :label="0">具体投用数量</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="具体投用数量" v-if="qFlag">
+        <el-form-item label="具体投用数量" v-if="statusType==0">
           <el-input v-model="form.quantity" placeholder="请输入具体投用数量"/>
         </el-form-item>
         <el-form-item label="单位" prop="unit">
@@ -358,6 +358,7 @@ export default {
   },
   data() {
     return {
+      statusType:1,
       qFlag: false,
       reason: {
         open: false
@@ -465,11 +466,8 @@ export default {
   methods: {
     changeQuantity(label){
       console.log(label)
-      if (label==1) {
-        this.qFlag=false;
-      }else{
+      if (label==0) {
         this.form.quantity='';
-        this.qFlag=true;
       }
     },
     /** 查询原料列表 */
@@ -494,6 +492,7 @@ export default {
     },
     // 表单重置
     reset() {
+      this.statusType=1;
       this.form = {
         id: null,
         subId: this.subId,
@@ -567,10 +566,18 @@ export default {
         this.form = response.data;
         this.open = true;
         this.title = "修改原料";
+        if (response.data.quantity === '具备投用状态') {
+          this.statusType = 1;
+        } else if (response.data.quantity != null) {
+          this.statusType = 0;
+        }
       });
     },
     /** 提交按钮 */
     submitForm() {
+      if (this.statusType == 1) {
+        this.form.quantity = '具备投用状态'
+      }
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.id != null) {