Parcourir la source

cpms优化
classd清单

jiangbiao il y a 1 an
Parent
commit
c5246b7969

+ 208 - 0
cpms-admin/src/main/java/com/cpms/project/process/controller/TClassdOverviewController.java

@@ -0,0 +1,208 @@
+package com.cpms.project.process.controller;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.ArrayList;
+import com.alibaba.fastjson2.JSON;
+import com.cpms.common.utils.file.ExcelUtils;
+import com.cpms.common.utils.DateUtils;
+import javax.servlet.http.HttpServletResponse;
+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.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.cpms.common.annotation.Log;
+import com.cpms.common.core.controller.BaseController;
+import com.cpms.common.core.domain.AjaxResult;
+import com.cpms.common.enums.BusinessType;
+import com.cpms.project.process.domain.TClassdOverview;
+import com.cpms.project.process.service.ITClassdOverviewService;
+import com.cpms.common.utils.poi.ExcelUtil;
+import com.cpms.common.core.page.TableDataInfo;
+
+/**
+ * Class D overview listController
+ * 
+ * @author admin
+ * @date 2024-04-16
+ */
+@RestController
+@RequestMapping("/process/classd")
+public class TClassdOverviewController extends BaseController
+{
+    @Autowired
+    private ITClassdOverviewService tClassdOverviewService;
+
+    /**
+     * 查询Class D overview list列表
+     */
+    @PreAuthorize("@ss.hasPermi('process:classd:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TClassdOverview tClassdOverview)
+    {
+        startPage();
+        List<TClassdOverview> list = tClassdOverviewService.selectTClassdOverviewList(tClassdOverview);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出Class D overview list列表
+     */
+    @PreAuthorize("@ss.hasPermi('process:classd:export')")
+    @Log(title = "Class D overview list", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TClassdOverview tClassdOverview)
+    {
+        List<TClassdOverview> list = tClassdOverviewService.selectTClassdOverviewList(tClassdOverview);
+        ExcelUtil<TClassdOverview> util = new ExcelUtil<TClassdOverview>(TClassdOverview.class);
+        util.exportExcel(response, list, "Class D overview list数据");
+    }
+
+    /**
+     * 获取Class D overview list详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('process:classd:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(tClassdOverviewService.selectTClassdOverviewById(id));
+    }
+
+    /**
+     * 新增Class D overview list
+     */
+    @PreAuthorize("@ss.hasPermi('process:classd:add')")
+    @Log(title = "Class D overview list", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TClassdOverview tClassdOverview)
+    {
+        return toAjax(tClassdOverviewService.insertTClassdOverview(tClassdOverview));
+    }
+
+    /**
+     * 修改Class D overview list
+     */
+    @PreAuthorize("@ss.hasPermi('process:classd:edit')")
+    @Log(title = "Class D overview list", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TClassdOverview tClassdOverview)
+    {
+        return toAjax(tClassdOverviewService.updateTClassdOverview(tClassdOverview));
+    }
+
+    /**
+     * 删除Class D overview list
+     */
+    @PreAuthorize("@ss.hasPermi('process:classd:remove')")
+    @Log(title = "Class D overview list", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tClassdOverviewService.deleteTClassdOverviewByIds(ids));
+    }
+
+
+    @Log(title = "Class D overview list批量导入", businessType = BusinessType.INSERT)
+    @PostMapping("/importData")
+    public AjaxResult importData(@RequestParam("file") MultipartFile file) throws IOException {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TClassdOverview> list = new ArrayList<>();
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        for (int i = 2; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                int cellNum = row.getLastCellNum();
+                TClassdOverview entity = new TClassdOverview();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    switch (j) {
+                        case 0:
+                            entity.setDiscussionItem ( cellValue);
+                            break;
+                        case 1:
+                            entity.setHazard ( cellValue);
+                            break;
+                        case 2:
+                            entity.setCause ( cellValue);
+                            break;
+                        case 3:
+                            entity.setConsequence ( cellValue);
+                            break;
+                        case 4:
+                            entity.setP ( cellValue);
+                            break;
+                        case 5:
+                            entity.setJustificationP ( cellValue);
+                            break;
+                        case 6:
+                            entity.setS ( cellValue);
+                            break;
+                        case 7:
+                            entity.setJustificationS ( cellValue);
+                            break;
+                        case 8:
+                            entity.setRc ( cellValue);
+                            break;
+                        case 9:
+                            entity.setCountermeasure ( cellValue);
+                            break;
+                        case 10:
+                            entity.setRemarks ( cellValue);
+                            break;
+                    }
+                }
+                entity.setCreaterCode(String.valueOf(userId));
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + JSON.toJSONString(e));
+                failRow.add(i + 1);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TClassdOverview t : list
+        ) {
+            failNum++;
+            try {
+                //根据使用证、注册编号、位号,进行数据更新
+                add(t);
+                successNumber++;
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + e);
+                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);
+    }
+}

+ 279 - 0
cpms-admin/src/main/java/com/cpms/project/process/domain/TClassdOverview.java

@@ -0,0 +1,279 @@
+package com.cpms.project.process.domain;
+
+import java.util.Date;
+
+import com.cpms.common.core.domain.BaseEntity;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.cpms.common.annotation.Excel;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * Class D overview list对象 t_classd_overview
+ * 
+ * @author admin
+ * @date 2024-04-16
+ */
+public class TClassdOverview extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long id;
+
+    /** Discussion item */
+    @Excel(name = "Discussion item")
+    private String discussionItem;
+
+    /** Hazard */
+    @Excel(name = "Hazard")
+    private String hazard;
+
+    /** Cause */
+    @Excel(name = "Cause")
+    private String cause;
+
+    /** Consequence */
+    @Excel(name = "Consequence")
+    private String consequence;
+
+    /** P */
+    @Excel(name = "P")
+    private String p;
+
+    /** Justification P */
+    @Excel(name = "Justification P")
+    private String justificationP;
+
+    /** S */
+    @Excel(name = "S")
+    private String s;
+
+    /** Justification S */
+    @Excel(name = "Justification S")
+    private String justificationS;
+
+    /** RC */
+    @Excel(name = "RC")
+    private String rc;
+
+    /** Countermeasure */
+    @Excel(name = "Countermeasure")
+    private String countermeasure;
+
+    /** 备注 */
+    @Excel(name = "备注")
+    private String remarks;
+
+    /** 删除标识 */
+    private Integer 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;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setDiscussionItem(String discussionItem) 
+    {
+        this.discussionItem = discussionItem;
+    }
+
+    public String getDiscussionItem() 
+    {
+        return discussionItem;
+    }
+    public void setHazard(String hazard) 
+    {
+        this.hazard = hazard;
+    }
+
+    public String getHazard() 
+    {
+        return hazard;
+    }
+    public void setCause(String cause) 
+    {
+        this.cause = cause;
+    }
+
+    public String getCause() 
+    {
+        return cause;
+    }
+    public void setConsequence(String consequence) 
+    {
+        this.consequence = consequence;
+    }
+
+    public String getConsequence() 
+    {
+        return consequence;
+    }
+    public void setP(String p) 
+    {
+        this.p = p;
+    }
+
+    public String getP() 
+    {
+        return p;
+    }
+    public void setJustificationP(String justificationP) 
+    {
+        this.justificationP = justificationP;
+    }
+
+    public String getJustificationP() 
+    {
+        return justificationP;
+    }
+    public void setS(String s) 
+    {
+        this.s = s;
+    }
+
+    public String getS() 
+    {
+        return s;
+    }
+    public void setJustificationS(String justificationS) 
+    {
+        this.justificationS = justificationS;
+    }
+
+    public String getJustificationS() 
+    {
+        return justificationS;
+    }
+    public void setRc(String rc) 
+    {
+        this.rc = rc;
+    }
+
+    public String getRc() 
+    {
+        return rc;
+    }
+    public void setCountermeasure(String countermeasure) 
+    {
+        this.countermeasure = countermeasure;
+    }
+
+    public String getCountermeasure() 
+    {
+        return countermeasure;
+    }
+    public void setRemarks(String remarks) 
+    {
+        this.remarks = remarks;
+    }
+
+    public String getRemarks() 
+    {
+        return remarks;
+    }
+    public void setDelFlag(Integer delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public Integer 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("discussionItem", getDiscussionItem())
+            .append("hazard", getHazard())
+            .append("cause", getCause())
+            .append("consequence", getConsequence())
+            .append("p", getP())
+            .append("justificationP", getJustificationP())
+            .append("s", getS())
+            .append("justificationS", getJustificationS())
+            .append("rc", getRc())
+            .append("countermeasure", getCountermeasure())
+            .append("remarks", getRemarks())
+            .append("delFlag", getDelFlag())
+            .append("createrCode", getCreaterCode())
+            .append("createdate", getCreatedate())
+            .append("updaterCode", getUpdaterCode())
+            .append("updatedate", getUpdatedate())
+            .append("deptId", getDeptId())
+            .toString();
+    }
+}

+ 61 - 0
cpms-admin/src/main/java/com/cpms/project/process/mapper/TClassdOverviewMapper.java

@@ -0,0 +1,61 @@
+package com.cpms.project.process.mapper;
+
+import java.util.List;
+import com.cpms.project.process.domain.TClassdOverview;
+
+/**
+ * Class D overview listMapper接口
+ * 
+ * @author admin
+ * @date 2024-04-16
+ */
+public interface TClassdOverviewMapper 
+{
+    /**
+     * 查询Class D overview list
+     * 
+     * @param id Class D overview list主键
+     * @return Class D overview list
+     */
+    public TClassdOverview selectTClassdOverviewById(Long id);
+
+    /**
+     * 查询Class D overview list列表
+     * 
+     * @param tClassdOverview Class D overview list
+     * @return Class D overview list集合
+     */
+    public List<TClassdOverview> selectTClassdOverviewList(TClassdOverview tClassdOverview);
+
+    /**
+     * 新增Class D overview list
+     * 
+     * @param tClassdOverview Class D overview list
+     * @return 结果
+     */
+    public int insertTClassdOverview(TClassdOverview tClassdOverview);
+
+    /**
+     * 修改Class D overview list
+     * 
+     * @param tClassdOverview Class D overview list
+     * @return 结果
+     */
+    public int updateTClassdOverview(TClassdOverview tClassdOverview);
+
+    /**
+     * 删除Class D overview list
+     * 
+     * @param id Class D overview list主键
+     * @return 结果
+     */
+    public int deleteTClassdOverviewById(Long id);
+
+    /**
+     * 批量删除Class D overview list
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTClassdOverviewByIds(Long[] ids);
+}

+ 61 - 0
cpms-admin/src/main/java/com/cpms/project/process/service/ITClassdOverviewService.java

@@ -0,0 +1,61 @@
+package com.cpms.project.process.service;
+
+import java.util.List;
+import com.cpms.project.process.domain.TClassdOverview;
+
+/**
+ * Class D overview listService接口
+ * 
+ * @author admin
+ * @date 2024-04-16
+ */
+public interface ITClassdOverviewService 
+{
+    /**
+     * 查询Class D overview list
+     * 
+     * @param id Class D overview list主键
+     * @return Class D overview list
+     */
+    public TClassdOverview selectTClassdOverviewById(Long id);
+
+    /**
+     * 查询Class D overview list列表
+     * 
+     * @param tClassdOverview Class D overview list
+     * @return Class D overview list集合
+     */
+    public List<TClassdOverview> selectTClassdOverviewList(TClassdOverview tClassdOverview);
+
+    /**
+     * 新增Class D overview list
+     * 
+     * @param tClassdOverview Class D overview list
+     * @return 结果
+     */
+    public int insertTClassdOverview(TClassdOverview tClassdOverview);
+
+    /**
+     * 修改Class D overview list
+     * 
+     * @param tClassdOverview Class D overview list
+     * @return 结果
+     */
+    public int updateTClassdOverview(TClassdOverview tClassdOverview);
+
+    /**
+     * 批量删除Class D overview list
+     * 
+     * @param ids 需要删除的Class D overview list主键集合
+     * @return 结果
+     */
+    public int deleteTClassdOverviewByIds(Long[] ids);
+
+    /**
+     * 删除Class D overview list信息
+     * 
+     * @param id Class D overview list主键
+     * @return 结果
+     */
+    public int deleteTClassdOverviewById(Long id);
+}

+ 93 - 0
cpms-admin/src/main/java/com/cpms/project/process/service/impl/TClassdOverviewServiceImpl.java

@@ -0,0 +1,93 @@
+package com.cpms.project.process.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.cpms.project.process.mapper.TClassdOverviewMapper;
+import com.cpms.project.process.domain.TClassdOverview;
+import com.cpms.project.process.service.ITClassdOverviewService;
+
+/**
+ * Class D overview listService业务层处理
+ * 
+ * @author admin
+ * @date 2024-04-16
+ */
+@Service
+public class TClassdOverviewServiceImpl implements ITClassdOverviewService 
+{
+    @Autowired
+    private TClassdOverviewMapper tClassdOverviewMapper;
+
+    /**
+     * 查询Class D overview list
+     * 
+     * @param id Class D overview list主键
+     * @return Class D overview list
+     */
+    @Override
+    public TClassdOverview selectTClassdOverviewById(Long id)
+    {
+        return tClassdOverviewMapper.selectTClassdOverviewById(id);
+    }
+
+    /**
+     * 查询Class D overview list列表
+     * 
+     * @param tClassdOverview Class D overview list
+     * @return Class D overview list
+     */
+    @Override
+    public List<TClassdOverview> selectTClassdOverviewList(TClassdOverview tClassdOverview)
+    {
+        return tClassdOverviewMapper.selectTClassdOverviewList(tClassdOverview);
+    }
+
+    /**
+     * 新增Class D overview list
+     * 
+     * @param tClassdOverview Class D overview list
+     * @return 结果
+     */
+    @Override
+    public int insertTClassdOverview(TClassdOverview tClassdOverview)
+    {
+        return tClassdOverviewMapper.insertTClassdOverview(tClassdOverview);
+    }
+
+    /**
+     * 修改Class D overview list
+     * 
+     * @param tClassdOverview Class D overview list
+     * @return 结果
+     */
+    @Override
+    public int updateTClassdOverview(TClassdOverview tClassdOverview)
+    {
+        return tClassdOverviewMapper.updateTClassdOverview(tClassdOverview);
+    }
+
+    /**
+     * 批量删除Class D overview list
+     * 
+     * @param ids 需要删除的Class D overview list主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTClassdOverviewByIds(Long[] ids)
+    {
+        return tClassdOverviewMapper.deleteTClassdOverviewByIds(ids);
+    }
+
+    /**
+     * 删除Class D overview list信息
+     * 
+     * @param id Class D overview list主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTClassdOverviewById(Long id)
+    {
+        return tClassdOverviewMapper.deleteTClassdOverviewById(id);
+    }
+}

+ 137 - 0
cpms-admin/src/main/resources/mapper/process/TClassdOverviewMapper.xml

@@ -0,0 +1,137 @@
+<?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.cpms.project.process.mapper.TClassdOverviewMapper">
+    
+    <resultMap type="TClassdOverview" id="TClassdOverviewResult">
+        <result property="id"    column="id"    />
+        <result property="discussionItem"    column="discussion_item"    />
+        <result property="hazard"    column="hazard"    />
+        <result property="cause"    column="cause"    />
+        <result property="consequence"    column="consequence"    />
+        <result property="p"    column="p"    />
+        <result property="justificationP"    column="justification_p"    />
+        <result property="s"    column="s"    />
+        <result property="justificationS"    column="justification_s"    />
+        <result property="rc"    column="rc"    />
+        <result property="countermeasure"    column="countermeasure"    />
+        <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"    />
+    </resultMap>
+
+    <sql id="selectTClassdOverviewVo">
+        select id, discussion_item, hazard, cause, consequence, p, justification_p, s, justification_s, rc, countermeasure, remarks, del_flag, creater_code, createdate, updater_code, updatedate, dept_id from t_classd_overview
+    </sql>
+
+    <select id="selectTClassdOverviewList" parameterType="TClassdOverview" resultMap="TClassdOverviewResult">
+        <include refid="selectTClassdOverviewVo"/>
+        <where>  
+            <if test="discussionItem != null  and discussionItem != ''"> and discussion_item = #{discussionItem}</if>
+            <if test="hazard != null  and hazard != ''"> and hazard = #{hazard}</if>
+            <if test="cause != null  and cause != ''"> and cause = #{cause}</if>
+            <if test="consequence != null  and consequence != ''"> and consequence = #{consequence}</if>
+            <if test="p != null  and p != ''"> and p = #{p}</if>
+            <if test="justificationP != null  and justificationP != ''"> and justification_p = #{justificationP}</if>
+            <if test="s != null  and s != ''"> and s = #{s}</if>
+            <if test="justificationS != null  and justificationS != ''"> and justification_s = #{justificationS}</if>
+            <if test="rc != null  and rc != ''"> and rc = #{rc}</if>
+            <if test="countermeasure != null  and countermeasure != ''"> and countermeasure = #{countermeasure}</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>
+        </where>
+    </select>
+    
+    <select id="selectTClassdOverviewById" parameterType="Long" resultMap="TClassdOverviewResult">
+        <include refid="selectTClassdOverviewVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertTClassdOverview" parameterType="TClassdOverview">
+        insert into t_classd_overview
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="discussionItem != null">discussion_item,</if>
+            <if test="hazard != null">hazard,</if>
+            <if test="cause != null">cause,</if>
+            <if test="consequence != null">consequence,</if>
+            <if test="p != null">p,</if>
+            <if test="justificationP != null">justification_p,</if>
+            <if test="s != null">s,</if>
+            <if test="justificationS != null">justification_s,</if>
+            <if test="rc != null">rc,</if>
+            <if test="countermeasure != null">countermeasure,</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>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="discussionItem != null">#{discussionItem},</if>
+            <if test="hazard != null">#{hazard},</if>
+            <if test="cause != null">#{cause},</if>
+            <if test="consequence != null">#{consequence},</if>
+            <if test="p != null">#{p},</if>
+            <if test="justificationP != null">#{justificationP},</if>
+            <if test="s != null">#{s},</if>
+            <if test="justificationS != null">#{justificationS},</if>
+            <if test="rc != null">#{rc},</if>
+            <if test="countermeasure != null">#{countermeasure},</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>
+         </trim>
+    </insert>
+
+    <update id="updateTClassdOverview" parameterType="TClassdOverview">
+        update t_classd_overview
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="discussionItem != null">discussion_item = #{discussionItem},</if>
+            <if test="hazard != null">hazard = #{hazard},</if>
+            <if test="cause != null">cause = #{cause},</if>
+            <if test="consequence != null">consequence = #{consequence},</if>
+            <if test="p != null">p = #{p},</if>
+            <if test="justificationP != null">justification_p = #{justificationP},</if>
+            <if test="s != null">s = #{s},</if>
+            <if test="justificationS != null">justification_s = #{justificationS},</if>
+            <if test="rc != null">rc = #{rc},</if>
+            <if test="countermeasure != null">countermeasure = #{countermeasure},</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>
+
+    <delete id="deleteTClassdOverviewById" parameterType="Long">
+        delete from t_classd_overview where id = #{id}
+    </delete>
+
+    <delete id="deleteTClassdOverviewByIds" parameterType="String">
+        delete from t_classd_overview where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 44 - 0
cpms-ui/src/api/process/classd.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询Class D overview list列表
+export function listClassd(query) {
+  return request({
+    url: '/process/classd/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询Class D overview list详细
+export function getClassd(id) {
+  return request({
+    url: '/process/classd/' + id,
+    method: 'get'
+  })
+}
+
+// 新增Class D overview list
+export function addClassd(data) {
+  return request({
+    url: '/process/classd',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改Class D overview list
+export function updateClassd(data) {
+  return request({
+    url: '/process/classd',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除Class D overview list
+export function delClassd(id) {
+  return request({
+    url: '/process/classd/' + id,
+    method: 'delete'
+  })
+}

+ 434 - 0
cpms-ui/src/views/process/classd/index.vue

@@ -0,0 +1,434 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="Discussion item" prop="discussionItem">
+        <el-input
+          v-model="queryParams.discussionItem"
+          placeholder="请输入Discussion item"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" 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"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['process:classd:add']"
+        >新增
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['process:classd:edit']"
+        >修改
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['process:classd:remove']"
+        >删除
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-upload2"
+          size="mini"
+          @click="handleImport"
+          v-hasPermi="['process:classd:add']"
+        >导入
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['process:classd:export']"
+        >导出
+        </el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="classdList" @selection-change="handleSelectionChange" :height="clientHeight"
+              border>
+      <el-table-column type="selection" width="55" align="center" fixed="left"/>
+      <el-table-column label="Discussion item" align="center" prop="discussionItem" width="150"/>
+      <el-table-column label="Hazard" align="center" prop="hazard" width="200"/>
+      <el-table-column label="Cause" align="center" prop="cause" width="250"/>
+      <el-table-column label="Consequence" align="center" prop="consequence" width="200"/>
+      <el-table-column label="Raw RiskP&ID" align="center">
+        <el-table-column label="P" align="center" prop="p" width="80"/>
+        <el-table-column label="Justification P" align="center" prop="justificationP" width="180"/>
+        <el-table-column label="S" align="center" prop="s" width="80"/>
+        <el-table-column label="Justification S" align="center" prop="justificationS" width="180"/>
+        <el-table-column label="RC" align="center" prop="rc" width="80"/>
+      </el-table-column>
+      <el-table-column label="Countermeasure" align="center" prop="countermeasure" width="200"/>
+      <el-table-column label="Remark" align="center" prop="remarks" width="200"/>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="180">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['process:classd:edit']"
+          >修改
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['process:classd:remove']"
+          >删除
+          </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"
+    />
+
+    <!-- 添加或修改Class D overview list对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body :close-on-click-modal="false">
+      <el-form ref="form" :model="form" :rules="rules" label-width="130px">
+        <el-form-item label="Discussion item" prop="discussionItem">
+          <el-input v-model="form.discussionItem" placeholder="请输入Discussion item"/>
+        </el-form-item>
+        <el-form-item label="Hazard" prop="hazard">
+          <el-input v-model="form.hazard" placeholder="请输入Hazard"/>
+        </el-form-item>
+        <el-form-item label="Cause" prop="cause">
+          <el-input v-model="form.cause" placeholder="请输入Cause"/>
+        </el-form-item>
+        <el-form-item label="Consequence" prop="consequence">
+          <el-input v-model="form.consequence" placeholder="请输入Consequence"/>
+        </el-form-item>
+        <el-form-item label="P" prop="p">
+          <el-input v-model="form.p" placeholder="请输入P"/>
+        </el-form-item>
+        <el-form-item label="Justification P" prop="justificationP">
+          <el-input v-model="form.justificationP" placeholder="请输入Justification P"/>
+        </el-form-item>
+        <el-form-item label="S" prop="s">
+          <el-input v-model="form.s" placeholder="请输入S"/>
+        </el-form-item>
+        <el-form-item label="Justification S" prop="justificationS">
+          <el-input v-model="form.justificationS" placeholder="请输入Justification S"/>
+        </el-form-item>
+        <el-form-item label="RC" prop="rc">
+          <el-input v-model="form.rc" placeholder="请输入RC"/>
+        </el-form-item>
+        <el-form-item label="Countermeasure" prop="countermeasure">
+          <el-input v-model="form.countermeasure" placeholder="请输入Countermeasure"/>
+        </el-form-item>
+        <el-form-item label="Remark" 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" :title="upload.title" :visible.sync="upload.open" append-to-body
+               width="400px">
+      <el-upload
+        ref="upload"
+        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :auto-upload="false"
+        :disabled="upload.isUploading"
+        :headers="upload.headers"
+        :limit="1"
+        :on-progress="handleFileUploadProgress"
+        :on-success="handleFileSuccess"
+        accept=".xlsx, .xls"
+        drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">
+          将文件拖到此处,或
+          <em>点击上传</em>
+        </div>
+        <div slot="tip" class="el-upload__tip">
+          <!--          <el-checkbox v-model="upload.updateSupport"/>-->
+          <!--          是否更新已经存在的用户数据-->
+          <el-link style="font-size:12px" type="info" @click="importTemplate">下载模板</el-link>
+        </div>
+        <div slot="tip" class="el-upload__tip" style="color:red">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
+      </el-upload>
+      <div slot="footer" class="dialog-footer">
+        <el-button v-loading.fullscreen.lock="fullscreenLoading" type="primary" @click="submitFileForm">确 定
+        </el-button>
+        <el-button @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+    <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+      <input :value="upload.type" hidden name="type"/>
+    </form>
+  </div>
+</template>
+
+<script>
+import {addClassd, delClassd, getClassd, listClassd, updateClassd} from "@/api/process/classd";
+import {getToken} from "@/utils/auth";
+
+export default {
+  name: "Classd",
+  data() {
+    return {
+      // 批量导入全屏遮罩
+      fullscreenLoading: false,
+      // 用户导入参数
+      upload: {
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        type: "processclassd",
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: {Authorization: "Bearer " + getToken()},
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/process/classd/importData"
+      },
+      // 页面高度
+      clientHeight: 300,
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: false,
+      // 总条数
+      total: 0,
+      // Class D overview list表格数据
+      classdList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 20,
+        discussionItem: null,
+        hazard: null,
+        cause: null,
+        consequence: null,
+        p: null,
+        justificationP: null,
+        s: null,
+        justificationS: null,
+        rc: null,
+        countermeasure: null,
+        remarks: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        deptId: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {}
+    };
+  },
+  created() {
+    this.getList();
+    //设置表格高度对应屏幕高度
+    this.$nextTick(() => {
+      this.clientHeight = (document.body.clientHeight - 80) * 0.8
+    });
+  },
+  methods: {
+    /** 查询Class D overview list列表 */
+    getList() {
+      this.loading = true;
+      listClassd(this.queryParams).then(response => {
+        this.classdList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        discussionItem: null,
+        hazard: null,
+        cause: null,
+        consequence: null,
+        p: null,
+        justificationP: null,
+        s: null,
+        justificationS: null,
+        rc: null,
+        countermeasure: 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 = "添加Class D overview list";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getClassd(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改Class D overview list";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateClassd(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addClassd(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除Class D overview list编号为"' + ids + '"的数据项?').then(function () {
+        return delClassd(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('process/classd/export', {
+        ...this.queryParams
+      }, `classd_${new Date().getTime()}.xlsx`)
+    },
+    /** 导入按钮操作 */
+    handleImport() {
+      this.upload.title = "用户导入";
+      this.upload.open = true;
+    },
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
+      this.fullscreenLoading = true;
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.fullscreenLoading = false;
+      if (response.data.length > 0) {
+        let failrow = ''
+        for (let i = 0; i < response.data.length; i++) {
+          failrow += response.data[i] + ','
+        }
+        this.$alert('导入成功条数:' + response.msg + '<br>' + '失败行数:' + failrow, '导入结果', {dangerouslyUseHTMLString: true});
+      } else {
+        this.$alert('导入成功条数:' + response.msg, '导入结果', {dangerouslyUseHTMLString: true});
+      }
+      this.getList();
+    },
+    /** 下载模板操作 */
+    importTemplate() {
+      this.$refs['downloadFileForm'].submit()
+    }
+  }
+};
+</script>