Parcourir la source

LY 特种设备 报告

ly il y a 11 mois
Parent
commit
7bac39a7e4

+ 105 - 0
master/src/main/java/com/ruoyi/project/sems/controller/TSpecReportController.java

@@ -0,0 +1,105 @@
+package com.ruoyi.project.sems.controller;
+
+import java.util.List;
+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.ruoyi.framework.aspectj.lang.annotation.Log;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
+import com.ruoyi.project.sems.domain.TSpecReport;
+import com.ruoyi.project.sems.service.ITSpecReportService;
+import com.ruoyi.framework.web.controller.BaseController;
+import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.framework.web.page.TableDataInfo;
+
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * 特种设备报告Controller
+ *
+ * @author Ly
+ * @date 2024-07-17
+ */
+@RestController
+@RequestMapping("/sems/specReport")
+public class TSpecReportController extends BaseController
+{
+    @Autowired
+    private ITSpecReportService tSpecReportService;
+
+    /**
+     * 查询特种设备报告列表
+     */
+    @PreAuthorize("@ss.hasPermi('sems:specReport:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TSpecReport tSpecReport , HttpServletResponse response)
+    {
+        startPage();
+        List<TSpecReport> list = tSpecReportService.selectTSpecReportList(tSpecReport);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出特种设备报告列表
+     */
+    @PreAuthorize("@ss.hasPermi('sems:specReport:export')")
+    @Log(title = "特种设备报告", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TSpecReport tSpecReport)
+    {
+        List<TSpecReport> list = tSpecReportService.selectTSpecReportList(tSpecReport);
+        ExcelUtil<TSpecReport> util = new ExcelUtil<TSpecReport>(TSpecReport.class);
+        return util.exportExcel(list, "specReport");
+    }
+
+    /**
+     * 获取特种设备报告详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('sems:specReport:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(tSpecReportService.selectTSpecReportById(id));
+    }
+
+    /**
+     * 新增特种设备报告
+     */
+    @PreAuthorize("@ss.hasPermi('sems:specReport:add')")
+    @Log(title = "特种设备报告", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TSpecReport tSpecReport, HttpServletResponse response)
+    {
+        return toAjax(tSpecReportService.insertTSpecReport(tSpecReport,response));
+    }
+
+    /**
+     * 修改特种设备报告
+     */
+    @PreAuthorize("@ss.hasPermi('sems:specReport:edit')")
+    @Log(title = "特种设备报告", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TSpecReport tSpecReport)
+    {
+        return toAjax(tSpecReportService.updateTSpecReport(tSpecReport));
+    }
+
+    /**
+     * 删除特种设备报告
+     */
+    @PreAuthorize("@ss.hasPermi('sems:specReport:remove')")
+    @Log(title = "特种设备报告", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tSpecReportService.deleteTSpecReportByIds(ids));
+    }
+}

+ 194 - 0
master/src/main/java/com/ruoyi/project/sems/domain/TSpecReport.java

@@ -0,0 +1,194 @@
+package com.ruoyi.project.sems.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.framework.aspectj.lang.annotation.Excel;
+import com.ruoyi.framework.web.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 特种设备报告对象 t_spec_report
+ *
+ * @author Ly
+ * @date 2024-07-17
+ */
+public class TSpecReport extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long id;
+
+    /** 报告名 */
+    @Excel(name = "报告名")
+    private String reportName;
+
+    /** 报告url */
+    @Excel(name = "报告url")
+    private String reportUrl;
+
+    /** 明细URL */
+    @Excel(name = "明细URL")
+    private String detailUrl;
+
+    /** 类型 */
+    @Excel(name = "类型")
+    private Long reportType;
+
+    /** 删除 */
+    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;
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setReportName(String reportName)
+    {
+        this.reportName = reportName;
+    }
+
+    public String getReportName()
+    {
+        return reportName;
+    }
+    public void setReportUrl(String reportUrl)
+    {
+        this.reportUrl = reportUrl;
+    }
+
+    public String getReportUrl()
+    {
+        return reportUrl;
+    }
+    public void setDetailUrl(String detailUrl)
+    {
+        this.detailUrl = detailUrl;
+    }
+
+    public String getDetailUrl()
+    {
+        return detailUrl;
+    }
+    public void setReportType(Long reportType)
+    {
+        this.reportType = reportType;
+    }
+
+    public Long getReportType()
+    {
+        return reportType;
+    }
+    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("reportName", getReportName())
+            .append("reportUrl", getReportUrl())
+            .append("detailUrl", getDetailUrl())
+            .append("reportType", getReportType())
+            .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/sems/mapper/TSpecReportMapper.java

@@ -0,0 +1,63 @@
+package com.ruoyi.project.sems.mapper;
+
+import java.util.List;
+import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
+import com.ruoyi.project.sems.domain.TSpecReport;
+
+/**
+ * 特种设备报告Mapper接口
+ *
+ * @author Ly
+ * @date 2024-07-17
+ */
+public interface TSpecReportMapper
+{
+    /**
+     * 查询特种设备报告
+     *
+     * @param id 特种设备报告ID
+     * @return 特种设备报告
+     */
+    public TSpecReport selectTSpecReportById(Long id);
+
+    /**
+     * 查询特种设备报告列表
+     *
+     * @param tSpecReport 特种设备报告
+     * @return 特种设备报告集合
+     */
+    @DataScope(deptAlias = "d")
+    public List<TSpecReport> selectTSpecReportList(TSpecReport tSpecReport);
+
+    /**
+     * 新增特种设备报告
+     *
+     * @param tSpecReport 特种设备报告
+     * @return 结果
+     */
+    public int insertTSpecReport(TSpecReport tSpecReport);
+
+    /**
+     * 修改特种设备报告
+     *
+     * @param tSpecReport 特种设备报告
+     * @return 结果
+     */
+    public int updateTSpecReport(TSpecReport tSpecReport);
+
+    /**
+     * 删除特种设备报告
+     *
+     * @param id 特种设备报告ID
+     * @return 结果
+     */
+    public int deleteTSpecReportById(Long id);
+
+    /**
+     * 批量删除特种设备报告
+     *
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteTSpecReportByIds(Long[] ids);
+}

+ 0 - 2
master/src/main/java/com/ruoyi/project/sems/safecheck/controller/TSpecDailycheckController.java

@@ -20,9 +20,7 @@ import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.document.ZipUtil;
 import com.ruoyi.common.utils.file.FileUploadUtils;
 import com.ruoyi.framework.config.RuoYiConfig;
-import com.ruoyi.project.apply.domain.TApplyOfflinevalve;
 import com.ruoyi.project.officeConvert.OfficeConvertController;
-import com.ruoyi.project.sems.safecheck.domain.TSpecPersonweekcheck;
 import com.ruoyi.project.sems.safecheck.mapper.TSpecDailycheckMapper;
 import com.ruoyi.project.system.domain.SysUser;
 import com.ruoyi.project.system.service.ISysUserService;

+ 0 - 6
master/src/main/java/com/ruoyi/project/sems/safecheck/controller/TSpecWeekcheckController.java

@@ -17,16 +17,10 @@ import com.ruoyi.common.utils.document.ZipUtil;
 import com.ruoyi.common.utils.file.FileUploadUtils;
 import com.ruoyi.framework.config.RuoYiConfig;
 import com.ruoyi.project.approve.damain.DevTask;
-import com.ruoyi.project.listener.apply.valve.EndFailListener;
-import com.ruoyi.project.listener.apply.valve.EndSuccessListener;
-import com.ruoyi.project.listener.apply.valve.FlowListener;
-import com.ruoyi.project.listener.apply.valve.NextTaskListener;
-import com.ruoyi.project.listener.semsWeekCheck.SafeAdminTaskCreateListener;
 import com.ruoyi.project.listener.semsWeekCheck.SafeDirTaskCreateListener;
 import com.ruoyi.project.listener.semsWeekCheck.WeekcheckEndFailListener;
 import com.ruoyi.project.listener.semsWeekCheck.WeekcheckEndSuccessListener;
 import com.ruoyi.project.officeConvert.OfficeConvertController;
-import com.ruoyi.project.sems.safecheck.domain.TSpecDailycheck;
 import com.ruoyi.project.sems.safecheck.mapper.TSpecWeekcheckMapper;
 import com.ruoyi.project.system.domain.SysConfig;
 import com.ruoyi.project.system.domain.SysUser;

+ 63 - 0
master/src/main/java/com/ruoyi/project/sems/service/ITSpecReportService.java

@@ -0,0 +1,63 @@
+package com.ruoyi.project.sems.service;
+
+import java.util.List;
+import com.ruoyi.project.sems.domain.TSpecReport;
+
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * 特种设备报告Service接口
+ *
+ * @author Ly
+ * @date 2024-07-17
+ */
+public interface ITSpecReportService
+{
+    /**
+     * 查询特种设备报告
+     *
+     * @param id 特种设备报告ID
+     * @return 特种设备报告
+     */
+    public TSpecReport selectTSpecReportById(Long id);
+
+    /**
+     * 查询特种设备报告列表
+     *
+     * @param tSpecReport 特种设备报告
+     * @return 特种设备报告集合
+     */
+    public List<TSpecReport> selectTSpecReportList(TSpecReport tSpecReport );
+
+    /**
+     * 新增特种设备报告
+     *
+     * @param tSpecReport 特种设备报告
+     * @return 结果
+     */
+    public int insertTSpecReport(TSpecReport tSpecReport , HttpServletResponse response);
+
+    /**
+     * 修改特种设备报告
+     *
+     * @param tSpecReport 特种设备报告
+     * @return 结果
+     */
+    public int updateTSpecReport(TSpecReport tSpecReport);
+
+    /**
+     * 批量删除特种设备报告
+     *
+     * @param ids 需要删除的特种设备报告ID
+     * @return 结果
+     */
+    public int deleteTSpecReportByIds(Long[] ids);
+
+    /**
+     * 删除特种设备报告信息
+     *
+     * @param id 特种设备报告ID
+     * @return 结果
+     */
+    public int deleteTSpecReportById(Long id);
+}

+ 125 - 0
master/src/main/java/com/ruoyi/project/sems/service/impl/TSpecReportServiceImpl.java

@@ -0,0 +1,125 @@
+package com.ruoyi.project.sems.service.impl;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URLEncoder;
+import java.util.List;
+
+import org.apache.poi.xssf.streaming.SXSSFWorkbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.project.sems.mapper.TSpecReportMapper;
+import com.ruoyi.project.sems.domain.TSpecReport;
+import com.ruoyi.project.sems.service.ITSpecReportService;
+
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * 特种设备报告Service业务层处理
+ *
+ * @author Ly
+ * @date 2024-07-17
+ */
+@Service
+public class TSpecReportServiceImpl implements ITSpecReportService
+{
+    @Autowired
+    private TSpecReportMapper tSpecReportMapper;
+
+    /**
+     * 查询特种设备报告
+     *
+     * @param id 特种设备报告ID
+     * @return 特种设备报告
+     */
+    @Override
+    public TSpecReport selectTSpecReportById(Long id)
+    {
+        return tSpecReportMapper.selectTSpecReportById(id);
+    }
+
+    /**
+     * 查询特种设备报告列表
+     *
+     * @param tSpecReport 特种设备报告
+     * @return 特种设备报告
+     */
+    @Override
+    public List<TSpecReport> selectTSpecReportList(TSpecReport tSpecReport)
+    {
+        return tSpecReportMapper.selectTSpecReportList(tSpecReport);
+    }
+
+    /**
+     * 新增特种设备报告
+     *
+     * @param tSpecReport 特种设备报告
+     * @return 结果
+     */
+    @Override
+    public int insertTSpecReport(TSpecReport tSpecReport, HttpServletResponse response)
+    {
+        try {
+            String tempUrl = "static/word/sems/report/sems-report.xlsx"; // 模板文件
+            InputStream is = null;
+            is = Thread.currentThread().getContextClassLoader().getResourceAsStream(tempUrl);
+            XSSFWorkbook wb1 = new XSSFWorkbook(is);
+
+            SXSSFWorkbook wb = new SXSSFWorkbook(wb1, 1000);
+            // 替换excel模板数据
+//            replaceExcelCbps(wb, trainingId);
+            response.setContentType("application/octet-stream");// 下载,默认就是下载
+            response.setCharacterEncoding("UTF-8");
+            response.setHeader("Content-Disposition",
+                    "attachment;fileName=" + URLEncoder.encode(tSpecReport.getReportName() + ".xlsx", "UTF-8"));
+            // 刷新缓冲
+            response.flushBuffer();
+            OutputStream ouputStream = response.getOutputStream();
+            wb.write(ouputStream);
+            ouputStream.flush();
+            ouputStream.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+
+        return tSpecReportMapper.insertTSpecReport(tSpecReport);
+    }
+
+    /**
+     * 修改特种设备报告
+     *
+     * @param tSpecReport 特种设备报告
+     * @return 结果
+     */
+    @Override
+    public int updateTSpecReport(TSpecReport tSpecReport)
+    {
+        return tSpecReportMapper.updateTSpecReport(tSpecReport);
+    }
+
+    /**
+     * 批量删除特种设备报告
+     *
+     * @param ids 需要删除的特种设备报告ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTSpecReportByIds(Long[] ids)
+    {
+        return tSpecReportMapper.deleteTSpecReportByIds(ids);
+    }
+
+    /**
+     * 删除特种设备报告信息
+     *
+     * @param id 特种设备报告ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTSpecReportById(Long id)
+    {
+        return tSpecReportMapper.deleteTSpecReportById(id);
+    }
+}

+ 1 - 1
master/src/main/resources/application.yml

@@ -195,7 +195,7 @@ gen:
   # 作者
   author: ssy
   # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
-  packageName: com.ruoyi.project.training.elearn # 自动去除表前缀,默认是true
+  packageName: com.ruoyi.project.sems # 自动去除表前缀,默认是true
   autoRemovePre: false
   # 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
   tablePrefix: sys_

+ 116 - 0
master/src/main/resources/mybatis/sems/TSpecReportMapper.xml

@@ -0,0 +1,116 @@
+<?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.sems.mapper.TSpecReportMapper">
+
+    <resultMap type="TSpecReport" id="TSpecReportResult">
+        <result property="id"    column="id"    />
+        <result property="reportName"    column="report_name"    />
+        <result property="reportUrl"    column="report_url"    />
+        <result property="detailUrl"    column="detail_url"    />
+        <result property="reportType"    column="report_type"    />
+        <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="selectTSpecReportVo">
+        select d.id, d.report_name, d.report_url, d.detail_url, d.report_type, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_spec_report d
+      left join sys_dept s on s.dept_id = d.dept_id
+    </sql>
+
+    <select id="selectTSpecReportList" parameterType="TSpecReport" resultMap="TSpecReportResult">
+        <include refid="selectTSpecReportVo"/>
+        <where>
+            <if test="reportName != null  and reportName != ''"> and report_name like concat(concat('%', #{reportName}), '%')</if>
+            <if test="reportUrl != null  and reportUrl != ''"> and report_url = #{reportUrl}</if>
+            <if test="detailUrl != null  and detailUrl != ''"> and detail_url = #{detailUrl}</if>
+            <if test="reportType != null "> and report_type = #{reportType}</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="selectTSpecReportById" parameterType="Long" resultMap="TSpecReportResult">
+        <include refid="selectTSpecReportVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertTSpecReport" parameterType="TSpecReport">
+        <selectKey keyProperty="id" resultType="long" order="BEFORE">
+            SELECT seq_t_spec_report.NEXTVAL as id FROM DUAL
+        </selectKey>
+        insert into t_spec_report
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="reportName != null">report_name,</if>
+            <if test="reportUrl != null">report_url,</if>
+            <if test="detailUrl != null">detail_url,</if>
+            <if test="reportType != null">report_type,</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="reportName != null">#{reportName},</if>
+            <if test="reportUrl != null">#{reportUrl},</if>
+            <if test="detailUrl != null">#{detailUrl},</if>
+            <if test="reportType != null">#{reportType},</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="updateTSpecReport" parameterType="TSpecReport">
+        update t_spec_report
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="reportName != null">report_name = #{reportName},</if>
+            <if test="reportUrl != null">report_url = #{reportUrl},</if>
+            <if test="detailUrl != null">detail_url = #{detailUrl},</if>
+            <if test="reportType != null">report_type = #{reportType},</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="deleteTSpecReportById" parameterType="Long">
+        update t_spec_report set del_flag = 2 where id = #{id}
+    </update>
+
+    <update id="deleteTSpecReportByIds" parameterType="String">
+        update t_spec_report 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/word/sems/report/sems-report.xlsx


+ 53 - 0
ui/src/api/sems/specReport.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询特种设备报告列表
+export function listSpecReport(query) {
+  return request({
+    url: '/sems/specReport/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询特种设备报告详细
+export function getSpecReport(id) {
+  return request({
+    url: '/sems/specReport/' + id,
+    method: 'get'
+  })
+}
+
+// 新增特种设备报告
+export function addSpecReport(data) {
+  return request({
+    url: '/sems/specReport',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改特种设备报告
+export function updateSpecReport(data) {
+  return request({
+    url: '/sems/specReport',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除特种设备报告
+export function delSpecReport(id) {
+  return request({
+    url: '/sems/specReport/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出特种设备报告
+export function exportSpecReport(query) {
+  return request({
+    url: '/sems/specReport/export',
+    method: 'get',
+    params: query
+  })
+}

+ 30 - 15
ui/src/views/front/materialBalanceHome.vue

@@ -194,19 +194,21 @@
                         </div>
 
                         <div class="wordBox">
-                            <span class="location loc1">Compressor</span>
-                            <span class="location loc2">Cold Section</span>
-                            <span class="location loc3">Quech Section</span>
-                            <span class="location loc4">Depropanize</span>
-                            <span class="location loc5">Hot Section</span>
-                            <span class="location loc6">PGU</span>
-                            <span class="location loc7">C4 System</span>
-                            <span class="location loc8">AEU</span>
-                            <span class="section2" @click="newTabClick1"></span>
-                            <span class="section3" @click="newTabClick1"></span>
-                            <span class="section4" @click="newTabClick1"></span>
-                            <span class="section5" @click="newTabClick2"></span>
-                            <span class="section7" @click="newTabClick1"></span>
+                            <span class="location loc1" >Compressor</span>
+                            <span class="location loc2" >Cold Section</span>
+                            <span class="location loc3" >Quech Section</span>
+                            <span class="location loc4" >Depropanize</span>
+                            <span class="location loc5" >Hot Section</span>
+                            <span class="location loc6" >PGU</span>
+                            <span class="location loc7" >C4 System</span>
+                            <span class="location loc8" >AEU</span>
+                            <span class="section2" @click="newTabClick('JLQ')"></span>
+                            <span class="section3" @click="newTabClick('LQ')"></span>
+                            <span class="section4" @click="newTabClick('TBP')"></span>
+                            <span class="section5" @click="newTabClick('RQ')"></span>
+                            <span class="section7" @click="newTabClick('RQ')"></span>
+
+                            <span class="section8" @click="newTabClick('YS')"></span>
 
                             <span class="location loc9">{{ dashboarddata.energyRpg }}</span>
                         </div>
@@ -407,9 +409,9 @@ export default {
         handleLuzi() {
           this.$router.push({ path: '/monitor/pfd', query: { pageId: 'LJL' }});
         },
-        newTabClick() {
+        newTabClick(pageId) {
             // window.open(this.url, '_blank')
-          this.$router.push({ path: '/monitor/pfd', query: { pageId: 'LJL' }});
+          this.$router.push({ path: '/monitor/pfd', query: { pageId: pageId }});
 
         },
         newTabClick1() {
@@ -1063,6 +1065,16 @@ export default {
     width: 100px;
     height: 180px;
 }
+
+.section8 {
+  cursor: pointer;
+  position: absolute;
+  top: 20px;
+  left: 400px;
+  width: 170px;
+  height: 140px;
+}
+
 .section4 {
     cursor: pointer;
     position: absolute;
@@ -1087,6 +1099,9 @@ export default {
     width: 100px;
     height: 180px;
 }
+
+
+
 .wordBox .location.loc1 {
     top: 135px;
     left: 440px;

+ 2 - 2
ui/src/views/login.vue

@@ -260,8 +260,8 @@ export default {
   justify-content: center;
   align-items: center;
   height: 100%;
-  background-image: url("../assets/image/CPMS20210107.jpg");
-  //background-image: url("../assets/image/cpms-test.jpg");
+  //background-image: url("../assets/image/CPMS20210107.jpg");
+  background-image: url("../assets/image/cpms-test.jpg");
   background-size: cover;
 }
 

+ 479 - 0
ui/src/views/sems/specReport/index.vue

@@ -0,0 +1,479 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="报告名" prop="reportName">
+        <el-input
+          v-model="queryParams.reportName"
+          placeholder="请输入报告名"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="报告url" prop="reportUrl">
+        <el-input
+          v-model="queryParams.reportUrl"
+          placeholder="请输入报告url"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="明细URL" prop="detailUrl">
+        <el-input
+          v-model="queryParams.detailUrl"
+          placeholder="请输入明细URL"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="类型" prop="reportType">
+        <el-select v-model="queryParams.reportType" placeholder="请选择类型" clearable size="small">
+          <el-option label="请选择字典生成" value="" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="创建人" prop="createrCode">
+        <el-input
+          v-model="queryParams.createrCode"
+          placeholder="请输入创建人"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="创建时间" prop="createdate">
+        <el-date-picker clearable size="small" style="width: 200px"
+          v-model="queryParams.createdate"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择创建时间">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="更新人" prop="updaterCode">
+        <el-input
+          v-model="queryParams.updaterCode"
+          placeholder="请输入更新人"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="更新日期" prop="updatedate">
+        <el-date-picker clearable size="small" style="width: 200px"
+          v-model="queryParams.updatedate"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择更新日期">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="所属部门" prop="deptId">
+        <el-input
+          v-model="queryParams.deptId"
+          placeholder="请输入所属部门"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="备注" prop="remarks">
+        <el-input
+          v-model="queryParams.remarks"
+          placeholder="请输入备注"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <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="['sems:specReport:add']"
+        >生成报告</el-button>
+      </el-col>
+	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="specReportList" @selection-change="handleSelectionChange" :height="clientHeight" border>
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="id" align="center" prop="id" :show-overflow-tooltip="true"/>
+      <el-table-column label="报告名" align="center" prop="reportName" :show-overflow-tooltip="true"/>
+      <el-table-column label="报告url" align="center" prop="reportUrl" :show-overflow-tooltip="true"/>
+      <el-table-column label="明细URL" align="center" prop="detailUrl" :show-overflow-tooltip="true"/>
+      <el-table-column label="类型" align="center" prop="reportType" :show-overflow-tooltip="true"/>
+      <el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>
+      <el-table-column label="创建时间" align="center" prop="createdate" width="100">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="更新人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>
+      <el-table-column label="更新日期" align="center" prop="updatedate" width="100">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="所属部门" align="center" prop="deptId" :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="['sems:specReport:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['sems:specReport: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"
+    />
+
+    <!-- 添加或修改特种设备报告对话框 -->
+    <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="reportName">
+          <el-input v-model="form.reportName" placeholder="请输入报告名" />
+        </el-form-item>
+        <el-form-item label="报告url" prop="reportUrl">
+          <el-input v-model="form.reportUrl" placeholder="请输入报告url" />
+        </el-form-item>
+        <el-form-item label="明细URL" prop="detailUrl">
+          <el-input v-model="form.detailUrl" placeholder="请输入明细URL" />
+        </el-form-item>
+        <el-form-item label="类型" prop="reportType">
+          <el-select v-model="form.reportType" placeholder="请选择类型">
+            <el-option label="请选择字典生成" value="" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="删除" prop="delFlag">
+          <el-input v-model="form.delFlag" placeholder="请输入删除" />
+        </el-form-item>
+        <el-form-item label="创建人" prop="createrCode">
+          <el-input v-model="form.createrCode" placeholder="请输入创建人" />
+        </el-form-item>
+        <el-form-item label="创建时间" prop="createdate">
+          <el-date-picker clearable size="small" style="width: 200px"
+            v-model="form.createdate"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择创建时间">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="更新人" prop="updaterCode">
+          <el-input v-model="form.updaterCode" placeholder="请输入更新人" />
+        </el-form-item>
+        <el-form-item label="更新日期" prop="updatedate">
+          <el-date-picker clearable size="small" style="width: 200px"
+            v-model="form.updatedate"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择更新日期">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="所属部门" prop="deptId">
+          <el-input v-model="form.deptId" placeholder="请输入所属部门" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注" />
+        </el-form-item>
+          <el-form-item label="归属部门" prop="deptId">
+              <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" 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 :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 + '?updateSupport=' + upload.updateSupport"
+                  :disabled="upload.isUploading"
+                  :on-progress="handleFileUploadProgress"
+                  :on-success="handleFileSuccess"
+                  :auto-upload="false"
+                  drag
+          >
+              <i class="el-icon-upload"></i>
+              <div class="el-upload__text">
+                  将文件拖到此处,或
+                  <em>点击上传</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">下载模板</el-link>
+              </div>
+              <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
+          </el-upload>
+          <div slot="footer" class="dialog-footer">
+              <el-button type="primary" @click="submitFileForm">确 定</el-button>
+              <el-button @click="upload.open = false">取 消</el-button>
+          </div>
+      </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listSpecReport, getSpecReport, delSpecReport, addSpecReport, updateSpecReport, exportSpecReport, importTemplate} from "@/api/sems/specReport";
+import { treeselect } from "@/api/system/dept";
+import { getToken } from "@/utils/auth";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+
+export default {
+  name: "SpecReport",
+  components: { Treeselect },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: false,
+      // 总条数
+      total: 0,
+      // 特种设备报告表格数据
+      specReportList: [],
+      // 弹出层标题
+      title: "",
+      // 部门树选项
+      deptOptions: undefined,
+      clientHeight:300,
+      // 是否显示弹出层
+      open: false,
+        // 用户导入参数
+        upload: {
+            // 是否显示弹出层(用户导入)
+            open: false,
+            // 弹出层标题(用户导入)
+            title: "",
+            // 是否禁用上传
+            isUploading: false,
+            // 是否更新已经存在的用户数据
+            updateSupport: 0,
+            // 设置上传的请求头部
+            headers: { Authorization: "Bearer " + getToken() },
+            // 上传的地址
+            url: process.env.VUE_APP_BASE_API + "/sems/specReport/importData"
+        },
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 20,
+        reportName: null,
+        reportUrl: null,
+        detailUrl: null,
+        reportType: 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;
+      listSpecReport(this.queryParams).then(response => {
+        this.specReportList = 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,
+        reportName: null,
+        reportUrl: null,
+        detailUrl: null,
+        reportType: 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() {
+      addSpecReport(this.form).then(response => {
+        this.msgSuccess("新增成功");
+        this.open = false;
+        this.getList();
+      });
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getSpecReport(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) {
+            updateSpecReport(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addSpecReport(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 delSpecReport(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有特种设备报告数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportSpecReport(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        })
+    },
+      /** 导入按钮操作 */
+      handleImport() {
+          this.upload.title = "用户导入";
+          this.upload.open = true;
+      },
+      /** 下载模板操作 */
+      importTemplate() {
+          importTemplate().then(response => {
+              this.download(response.msg);
+          });
+      },
+      // 文件上传中处理
+      handleFileUploadProgress(event, file, fileList) {
+          this.upload.isUploading = true;
+      },
+      // 文件上传成功处理
+      handleFileSuccess(response, file, fileList) {
+          this.upload.open = false;
+          this.upload.isUploading = false;
+          this.$refs.upload.clearFiles();
+          this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
+          this.getList();
+      },
+      // 提交上传文件
+      submitFileForm() {
+          this.$refs.upload.submit();
+      }
+  }
+};
+</script>