Browse Source

-新增检测计划页面台账

jiangbiao 2 years ago
parent
commit
48e2260ceb

+ 106 - 0
master/src/main/java/com/ruoyi/project/task/controller/TTaskInspectionPlanController.java

@@ -0,0 +1,106 @@
+package com.ruoyi.project.task.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+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.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.project.task.domain.TTaskInspectionPlan;
+import com.ruoyi.project.task.service.ITTaskInspectionPlanService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 检测计划Controller
+ *
+ * @author ruoyi
+ * @date 2022-11-17
+ */
+@RestController
+@RequestMapping("/task/plan")
+public class TTaskInspectionPlanController extends BaseController
+{
+    @Autowired
+    private ITTaskInspectionPlanService tTaskInspectionPlanService;
+
+    /**
+     * 查询检测计划列表
+     */
+    @PreAuthorize("@ss.hasPermi('task:plan:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TTaskInspectionPlan tTaskInspectionPlan)
+    {
+        startPage();
+        List<TTaskInspectionPlan> list = tTaskInspectionPlanService.selectTTaskInspectionPlanList(tTaskInspectionPlan);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出检测计划列表
+     */
+    @PreAuthorize("@ss.hasPermi('task:plan:export')")
+    @Log(title = "检测计划", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TTaskInspectionPlan tTaskInspectionPlan)
+    {
+        List<TTaskInspectionPlan> list = tTaskInspectionPlanService.selectTTaskInspectionPlanList(tTaskInspectionPlan);
+        ExcelUtil<TTaskInspectionPlan> util = new ExcelUtil<TTaskInspectionPlan>(TTaskInspectionPlan.class);
+        util.exportExcel(response, list, "检测计划数据");
+    }
+
+    /**
+     * 获取检测计划详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('task:plan:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(tTaskInspectionPlanService.selectTTaskInspectionPlanById(id));
+    }
+
+    /**
+     * 新增检测计划
+     */
+    @PreAuthorize("@ss.hasPermi('task:plan:add')")
+    @Log(title = "检测计划", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TTaskInspectionPlan tTaskInspectionPlan)
+    {
+        tTaskInspectionPlan.setCreaterCode(getUserId());
+        return toAjax(tTaskInspectionPlanService.insertTTaskInspectionPlan(tTaskInspectionPlan));
+    }
+
+    /**
+     * 修改检测计划
+     */
+    @PreAuthorize("@ss.hasPermi('task:plan:edit')")
+    @Log(title = "检测计划", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TTaskInspectionPlan tTaskInspectionPlan)
+    {
+        tTaskInspectionPlan.setUpdaterCode(getUserId());
+        return toAjax(tTaskInspectionPlanService.updateTTaskInspectionPlan(tTaskInspectionPlan));
+    }
+
+    /**
+     * 删除检测计划
+     */
+    @PreAuthorize("@ss.hasPermi('task:plan:remove')")
+    @Log(title = "检测计划", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tTaskInspectionPlanService.deleteTTaskInspectionPlanByIds(ids));
+    }
+}

+ 262 - 0
master/src/main/java/com/ruoyi/project/task/domain/TTaskInspectionPlan.java

@@ -0,0 +1,262 @@
+package com.ruoyi.project.task.domain;
+
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 检测计划对象 t_task_inspection_plan
+ *
+ * @author ruoyi
+ * @date 2022-11-17
+ */
+public class TTaskInspectionPlan extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 唯一标识id */
+    private Long id;
+
+    /** 装置id */
+    private Long plantId;
+
+    @Excel(name = "装置id")
+    @TableField(exist = false)
+    private String plantName;
+
+    /** 检测计划编号 */
+    @Excel(name = "检测计划编号")
+    private String inspectionPlanNo;
+
+    /** 检测计划名称 */
+    @Excel(name = "检测计划名称")
+    private String inspectionPlanName;
+
+    /** 检测频次 */
+    @Excel(name = "检测频次")
+    private String detectionFrequency;
+
+    /** 检测起始时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "检测起始时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date startTime;
+
+    /** 检测截止时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "检测截止时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date endTime;
+
+    /** 检测点数 */
+    @Excel(name = "检测点数")
+    private String pointNum;
+
+    /** 备注 */
+    @Excel(name = "备注")
+    private String remarks;
+
+    /** 部门编号 */
+    @Excel(name = "部门编号")
+    private Long deptId;
+
+    /** 状态 1 :正常 ;0:删除 */
+    private Integer delFlag;
+
+    /** 创建人 */
+    @Excel(name = "创建人")
+    @TableField(exist = false)
+    private String creater;
+
+    private Long createrCode;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date createdate;
+
+    /** 修改人 */
+    @Excel(name = "修改人")
+    private Long updaterCode;
+
+    /** 修改时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date updatedate;
+
+    public String getCreater() {
+        return creater;
+    }
+
+    public void setCreater(String creater) {
+        this.creater = creater;
+    }
+
+    public String getPlantName() {
+        return plantName;
+    }
+
+    public void setPlantName(String plantName) {
+        this.plantName = plantName;
+    }
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setPlantId(Long plantId)
+    {
+        this.plantId = plantId;
+    }
+
+    public Long getPlantId()
+    {
+        return plantId;
+    }
+    public void setInspectionPlanNo(String inspectionPlanNo)
+    {
+        this.inspectionPlanNo = inspectionPlanNo;
+    }
+
+    public String getInspectionPlanNo()
+    {
+        return inspectionPlanNo;
+    }
+    public void setInspectionPlanName(String inspectionPlanName)
+    {
+        this.inspectionPlanName = inspectionPlanName;
+    }
+
+    public String getInspectionPlanName()
+    {
+        return inspectionPlanName;
+    }
+    public void setDetectionFrequency(String detectionFrequency)
+    {
+        this.detectionFrequency = detectionFrequency;
+    }
+
+    public String getDetectionFrequency()
+    {
+        return detectionFrequency;
+    }
+    public void setStartTime(Date startTime)
+    {
+        this.startTime = startTime;
+    }
+
+    public Date getStartTime()
+    {
+        return startTime;
+    }
+    public void setEndTime(Date endTime)
+    {
+        this.endTime = endTime;
+    }
+
+    public Date getEndTime()
+    {
+        return endTime;
+    }
+    public void setPointNum(String pointNum)
+    {
+        this.pointNum = pointNum;
+    }
+
+    public String getPointNum()
+    {
+        return pointNum;
+    }
+    public void setRemarks(String remarks)
+    {
+        this.remarks = remarks;
+    }
+
+    public String getRemarks()
+    {
+        return remarks;
+    }
+    public void setDeptId(Long deptId)
+    {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId()
+    {
+        return deptId;
+    }
+    public void setDelFlag(Integer delFlag)
+    {
+        this.delFlag = delFlag;
+    }
+
+    public Integer getDelFlag()
+    {
+        return delFlag;
+    }
+    public void setCreaterCode(Long createrCode)
+    {
+        this.createrCode = createrCode;
+    }
+
+    public Long getCreaterCode()
+    {
+        return createrCode;
+    }
+    public void setCreatedate(Date createdate)
+    {
+        this.createdate = createdate;
+    }
+
+    public Date getCreatedate()
+    {
+        return createdate;
+    }
+    public void setUpdaterCode(Long updaterCode)
+    {
+        this.updaterCode = updaterCode;
+    }
+
+    public Long getUpdaterCode()
+    {
+        return updaterCode;
+    }
+    public void setUpdatedate(Date updatedate)
+    {
+        this.updatedate = updatedate;
+    }
+
+    public Date getUpdatedate()
+    {
+        return updatedate;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("plantId", getPlantId())
+            .append("inspectionPlanNo", getInspectionPlanNo())
+            .append("inspectionPlanName", getInspectionPlanName())
+            .append("detectionFrequency", getDetectionFrequency())
+            .append("startTime", getStartTime())
+            .append("endTime", getEndTime())
+            .append("pointNum", getPointNum())
+            .append("remarks", getRemarks())
+            .append("deptId", getDeptId())
+            .append("delFlag", getDelFlag())
+            .append("createrCode", getCreaterCode())
+            .append("createdate", getCreatedate())
+            .append("updaterCode", getUpdaterCode())
+            .append("updatedate", getUpdatedate())
+            .toString();
+    }
+}

+ 61 - 0
master/src/main/java/com/ruoyi/project/task/mapper/TTaskInspectionPlanMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.project.task.mapper;
+
+import java.util.List;
+import com.ruoyi.project.task.domain.TTaskInspectionPlan;
+
+/**
+ * 检测计划Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2022-11-17
+ */
+public interface TTaskInspectionPlanMapper 
+{
+    /**
+     * 查询检测计划
+     * 
+     * @param id 检测计划主键
+     * @return 检测计划
+     */
+    public TTaskInspectionPlan selectTTaskInspectionPlanById(Long id);
+
+    /**
+     * 查询检测计划列表
+     * 
+     * @param tTaskInspectionPlan 检测计划
+     * @return 检测计划集合
+     */
+    public List<TTaskInspectionPlan> selectTTaskInspectionPlanList(TTaskInspectionPlan tTaskInspectionPlan);
+
+    /**
+     * 新增检测计划
+     * 
+     * @param tTaskInspectionPlan 检测计划
+     * @return 结果
+     */
+    public int insertTTaskInspectionPlan(TTaskInspectionPlan tTaskInspectionPlan);
+
+    /**
+     * 修改检测计划
+     * 
+     * @param tTaskInspectionPlan 检测计划
+     * @return 结果
+     */
+    public int updateTTaskInspectionPlan(TTaskInspectionPlan tTaskInspectionPlan);
+
+    /**
+     * 删除检测计划
+     * 
+     * @param id 检测计划主键
+     * @return 结果
+     */
+    public int deleteTTaskInspectionPlanById(Long id);
+
+    /**
+     * 批量删除检测计划
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTTaskInspectionPlanByIds(Long[] ids);
+}

+ 61 - 0
master/src/main/java/com/ruoyi/project/task/service/ITTaskInspectionPlanService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.project.task.service;
+
+import java.util.List;
+import com.ruoyi.project.task.domain.TTaskInspectionPlan;
+
+/**
+ * 检测计划Service接口
+ * 
+ * @author ruoyi
+ * @date 2022-11-17
+ */
+public interface ITTaskInspectionPlanService 
+{
+    /**
+     * 查询检测计划
+     * 
+     * @param id 检测计划主键
+     * @return 检测计划
+     */
+    public TTaskInspectionPlan selectTTaskInspectionPlanById(Long id);
+
+    /**
+     * 查询检测计划列表
+     * 
+     * @param tTaskInspectionPlan 检测计划
+     * @return 检测计划集合
+     */
+    public List<TTaskInspectionPlan> selectTTaskInspectionPlanList(TTaskInspectionPlan tTaskInspectionPlan);
+
+    /**
+     * 新增检测计划
+     * 
+     * @param tTaskInspectionPlan 检测计划
+     * @return 结果
+     */
+    public int insertTTaskInspectionPlan(TTaskInspectionPlan tTaskInspectionPlan);
+
+    /**
+     * 修改检测计划
+     * 
+     * @param tTaskInspectionPlan 检测计划
+     * @return 结果
+     */
+    public int updateTTaskInspectionPlan(TTaskInspectionPlan tTaskInspectionPlan);
+
+    /**
+     * 批量删除检测计划
+     * 
+     * @param ids 需要删除的检测计划主键集合
+     * @return 结果
+     */
+    public int deleteTTaskInspectionPlanByIds(Long[] ids);
+
+    /**
+     * 删除检测计划信息
+     * 
+     * @param id 检测计划主键
+     * @return 结果
+     */
+    public int deleteTTaskInspectionPlanById(Long id);
+}

+ 93 - 0
master/src/main/java/com/ruoyi/project/task/service/impl/TTaskInspectionPlanServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.project.task.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.project.task.mapper.TTaskInspectionPlanMapper;
+import com.ruoyi.project.task.domain.TTaskInspectionPlan;
+import com.ruoyi.project.task.service.ITTaskInspectionPlanService;
+
+/**
+ * 检测计划Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2022-11-17
+ */
+@Service
+public class TTaskInspectionPlanServiceImpl implements ITTaskInspectionPlanService 
+{
+    @Autowired
+    private TTaskInspectionPlanMapper tTaskInspectionPlanMapper;
+
+    /**
+     * 查询检测计划
+     * 
+     * @param id 检测计划主键
+     * @return 检测计划
+     */
+    @Override
+    public TTaskInspectionPlan selectTTaskInspectionPlanById(Long id)
+    {
+        return tTaskInspectionPlanMapper.selectTTaskInspectionPlanById(id);
+    }
+
+    /**
+     * 查询检测计划列表
+     * 
+     * @param tTaskInspectionPlan 检测计划
+     * @return 检测计划
+     */
+    @Override
+    public List<TTaskInspectionPlan> selectTTaskInspectionPlanList(TTaskInspectionPlan tTaskInspectionPlan)
+    {
+        return tTaskInspectionPlanMapper.selectTTaskInspectionPlanList(tTaskInspectionPlan);
+    }
+
+    /**
+     * 新增检测计划
+     * 
+     * @param tTaskInspectionPlan 检测计划
+     * @return 结果
+     */
+    @Override
+    public int insertTTaskInspectionPlan(TTaskInspectionPlan tTaskInspectionPlan)
+    {
+        return tTaskInspectionPlanMapper.insertTTaskInspectionPlan(tTaskInspectionPlan);
+    }
+
+    /**
+     * 修改检测计划
+     * 
+     * @param tTaskInspectionPlan 检测计划
+     * @return 结果
+     */
+    @Override
+    public int updateTTaskInspectionPlan(TTaskInspectionPlan tTaskInspectionPlan)
+    {
+        return tTaskInspectionPlanMapper.updateTTaskInspectionPlan(tTaskInspectionPlan);
+    }
+
+    /**
+     * 批量删除检测计划
+     * 
+     * @param ids 需要删除的检测计划主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTTaskInspectionPlanByIds(Long[] ids)
+    {
+        return tTaskInspectionPlanMapper.deleteTTaskInspectionPlanByIds(ids);
+    }
+
+    /**
+     * 删除检测计划信息
+     * 
+     * @param id 检测计划主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTTaskInspectionPlanById(Long id)
+    {
+        return tTaskInspectionPlanMapper.deleteTTaskInspectionPlanById(id);
+    }
+}

+ 125 - 0
master/src/main/resources/mybatis/task/TTaskInspectionPlanMapper.xml

@@ -0,0 +1,125 @@
+<?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.task.mapper.TTaskInspectionPlanMapper">
+
+    <resultMap type="TTaskInspectionPlan" id="TTaskInspectionPlanResult">
+        <result property="id"    column="id"    />
+        <result property="plantId"    column="plant_id"    />
+        <result property="plantName"    column="plant_name"    />
+        <result property="inspectionPlanNo"    column="inspection_plan_no"    />
+        <result property="inspectionPlanName"    column="inspection_plan_name"    />
+        <result property="detectionFrequency"    column="detection_frequency"    />
+        <result property="startTime"    column="start_time"    />
+        <result property="endTime"    column="end_time"    />
+        <result property="pointNum"    column="point_num"    />
+        <result property="remarks"    column="remarks"    />
+        <result property="deptId"    column="dept_id"    />
+        <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="creater"    column="creater"    />
+    </resultMap>
+
+    <sql id="selectTTaskInspectionPlanVo">
+        select id, plant_id, inspection_plan_no, inspection_plan_name, detection_frequency, start_time, end_time, point_num, remarks, dept_id, del_flag, creater_code, createdate, updater_code, updatedate from t_task_inspection_plan
+    </sql>
+
+    <select id="selectTTaskInspectionPlanList" parameterType="TTaskInspectionPlan" resultMap="TTaskInspectionPlanResult">
+        select d.*,bp.plant_name,su.user_name creater from t_task_inspection_plan d
+        left join t_base_plant bp on bp.id=d.plant_id
+        left join sys_user su on su.user_id=d.creater_code
+        <where>
+            <if test="plantId != null "> and d.plant_id = #{plantId}</if>
+            <if test="inspectionPlanNo != null  and inspectionPlanNo != ''"> and d.inspection_plan_no = #{inspectionPlanNo}</if>
+            <if test="inspectionPlanName != null  and inspectionPlanName != ''"> and d.inspection_plan_name like concat('%', #{inspectionPlanName}, '%')</if>
+            <if test="detectionFrequency != null  and detectionFrequency != ''"> and d.detection_frequency = #{detectionFrequency}</if>
+            <if test="startTime != null "> and d.start_time = #{startTime}</if>
+            <if test="endTime != null "> and d.end_time = #{endTime}</if>
+            <if test="pointNum != null  and pointNum != ''"> and d.point_num = #{pointNum}</if>
+            <if test="remarks != null  and remarks != ''"> and d.remarks = #{remarks}</if>
+            <if test="deptId != null "> and d.dept_id = #{deptId}</if>
+            <if test="createrCode != null "> and d.creater_code = #{createrCode}</if>
+            <if test="createdate != null "> and d.createdate = #{createdate}</if>
+            <if test="updaterCode != null "> and d.updater_code = #{updaterCode}</if>
+            <if test="updatedate != null "> and d.updatedate = #{updatedate}</if>
+            and d.del_flag = 0
+        </where>
+    </select>
+
+    <select id="selectTTaskInspectionPlanById" parameterType="Long" resultMap="TTaskInspectionPlanResult">
+        <include refid="selectTTaskInspectionPlanVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertTTaskInspectionPlan" parameterType="TTaskInspectionPlan" useGeneratedKeys="true" keyProperty="id">
+        insert into t_task_inspection_plan
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="plantId != null">plant_id,</if>
+            <if test="inspectionPlanNo != null">inspection_plan_no,</if>
+            <if test="inspectionPlanName != null">inspection_plan_name,</if>
+            <if test="detectionFrequency != null">detection_frequency,</if>
+            <if test="startTime != null">start_time,</if>
+            <if test="endTime != null">end_time,</if>
+            <if test="pointNum != null">point_num,</if>
+            <if test="remarks != null">remarks,</if>
+            <if test="deptId != null">dept_id,</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>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="plantId != null">#{plantId},</if>
+            <if test="inspectionPlanNo != null">#{inspectionPlanNo},</if>
+            <if test="inspectionPlanName != null">#{inspectionPlanName},</if>
+            <if test="detectionFrequency != null">#{detectionFrequency},</if>
+            <if test="startTime != null">#{startTime},</if>
+            <if test="endTime != null">#{endTime},</if>
+            <if test="pointNum != null">#{pointNum},</if>
+            <if test="remarks != null">#{remarks},</if>
+            <if test="deptId != null">#{deptId},</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>
+         </trim>
+    </insert>
+
+    <update id="updateTTaskInspectionPlan" parameterType="TTaskInspectionPlan">
+        update t_task_inspection_plan
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="plantId != null">plant_id = #{plantId},</if>
+            <if test="inspectionPlanNo != null">inspection_plan_no = #{inspectionPlanNo},</if>
+            <if test="inspectionPlanName != null">inspection_plan_name = #{inspectionPlanName},</if>
+            <if test="detectionFrequency != null">detection_frequency = #{detectionFrequency},</if>
+            <if test="startTime != null">start_time = #{startTime},</if>
+            <if test="endTime != null">end_time = #{endTime},</if>
+            <if test="pointNum != null">point_num = #{pointNum},</if>
+            <if test="remarks != null">remarks = #{remarks},</if>
+            <if test="deptId != null">dept_id = #{deptId},</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>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteTTaskInspectionPlanById" parameterType="Long">
+        update t_task_inspection_plan set del_flag=1 where id = #{id}
+    </delete>
+
+    <delete id="deleteTTaskInspectionPlanByIds" parameterType="String">
+        update t_task_inspection_plan set del_flag=1 where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 44 - 0
ui/src/api/task/plan.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询检测计划列表
+export function listPlan(query) {
+  return request({
+    url: '/task/plan/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询检测计划详细
+export function getPlan(id) {
+  return request({
+    url: '/task/plan/' + id,
+    method: 'get'
+  })
+}
+
+// 新增检测计划
+export function addPlan(data) {
+  return request({
+    url: '/task/plan',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改检测计划
+export function updatePlan(data) {
+  return request({
+    url: '/task/plan',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除检测计划
+export function delPlan(id) {
+  return request({
+    url: '/task/plan/' + id,
+    method: 'delete'
+  })
+}

+ 366 - 0
ui/src/views/task/plan/index.vue

@@ -0,0 +1,366 @@
+<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="年份" prop="year">
+        <el-date-picker
+          v-model="queryParams.year"
+          type="year"
+          clearable
+          @change="handleQuery"
+          placeholder="选择年份">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <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="['task:plan: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="['task:plan: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="['task:plan:remove']"
+        >删除
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="info"
+          plain
+          icon="el-icon-refresh"
+          size="mini"
+          @click="handleDoPlan"
+        >{{ $t('校验检测计划') }}
+        </el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="planList" @selection-change="handleSelectionChange" :height="clientHeight"
+              border>
+      <el-table-column type="selection" width="55" align="center" fixed="left"/>
+      <el-table-column label="装置名称" align="center" prop="plantName" width="130" :show-overflow-tooltip="true"/>
+      <el-table-column label="检测计划编号" align="center" prop="inspectionPlanNo" width="200" :show-overflow-tooltip="true"/>
+      <el-table-column label="检测计划名称" align="center" prop="inspectionPlanName" width="300" :show-overflow-tooltip="true"/>
+      <el-table-column label="检测频次" align="center" prop="detectionFrequency" width="130" :show-overflow-tooltip="true" :formatter="detectionFormat"/>
+      <el-table-column label="检测起始时间" align="center" prop="startTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="检测截止时间" align="center" prop="endTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="检测点数" align="center" prop="pointNum" width="100" :show-overflow-tooltip="true"/>
+      <el-table-column label="备注" align="center" prop="remarks" width="100" :show-overflow-tooltip="true"/>
+      <el-table-column label="创建人" align="center" prop="creater" width="100" :show-overflow-tooltip="true"/>
+      <el-table-column label="创建时间" align="center" prop="createdate" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width" width="130">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['task:plan:edit']"
+          >修改
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['task:plan: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="600px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+        <el-form-item label="装置id" prop="plantId">
+          <el-select v-model="form.plantId" placeholder="请选择装置" clearable size="small" style="width: 100%">
+            <el-option
+              v-for="dict in plantOperation"
+              :key="dict.id"
+              :label="dict.plantName"
+              :value="dict.id"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="检测计划编号" prop="inspectionPlanNo">
+          <el-input v-model="form.inspectionPlanNo" placeholder="请输入检测计划编号"/>
+        </el-form-item>
+        <el-form-item label="检测计划名称" prop="inspectionPlanName">
+          <el-input v-model="form.inspectionPlanName" placeholder="请输入检测计划名称"/>
+        </el-form-item>
+        <el-form-item label="检测频次" prop="detectionFrequency">
+          <el-select v-model="form.detectionFrequency" placeholder="请选择检测频次" clearable size="small" style="width: 100%">
+            <el-option
+              v-for="dict in detectionOperation"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="检测起始时间" prop="startTime">
+          <el-date-picker clearable style="width: 100%"
+                          v-model="form.startTime"
+                          type="date"
+                          value-format="yyyy-MM-dd"
+                          placeholder="请选择检测起始时间">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="检测截止时间" prop="endTime">
+          <el-date-picker clearable style="width: 100%"
+                          v-model="form.endTime"
+                          type="date"
+                          value-format="yyyy-MM-dd"
+                          placeholder="请选择检测截止时间">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="检测点数" prop="pointNum">
+          <el-input v-model="form.pointNum" placeholder="请输入检测点数"/>
+        </el-form-item>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注"/>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {listPlan, getPlan, delPlan, addPlan, updatePlan} from "@/api/task/plan";
+import {MessageBox} from "element-ui";
+import {getAllPlantName} from "@/api/base/plant";
+
+export default {
+  name: "Plan",
+  data() {
+    return {
+      plantOperation:[],
+      detectionOperation:[],
+      // 页面高度
+      clientHeight: 300,
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: false,
+      // 总条数
+      total: 0,
+      // 检测计划表格数据
+      planList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        plantId: null,
+        inspectionPlanNo: null,
+        inspectionPlanName: null,
+        detectionFrequency: null,
+        startTime: null,
+        endTime: null,
+        pointNum: null,
+        remarks: null,
+        deptId: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {}
+    };
+  },
+  created() {
+    this.getList();
+    //设置表格高度对应屏幕高度
+    this.$nextTick(() => {
+      this.clientHeight = (document.body.clientHeight - 80) * 0.8
+    });
+    getAllPlantName().then(response => {
+      this.plantOperation = response.data;
+    });
+    this.getDicts("detection_frequency").then(response => {
+      this.detectionOperation = response.data;
+    });
+  },
+  methods: {
+    detectionFormat(row, column) {
+      return this.selectDictLabel(this.detectionOperation, row.detectionFrequency);
+    },
+    /** 查询检测计划列表 */
+    getList() {
+      this.loading = true;
+      listPlan(this.queryParams).then(response => {
+        this.planList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        plantId: null,
+        inspectionPlanNo: null,
+        inspectionPlanName: null,
+        detectionFrequency: null,
+        startTime: null,
+        endTime: null,
+        pointNum: null,
+        remarks: null,
+        deptId: null,
+        delFlag: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: 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
+      getPlan(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) {
+            updatePlan(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addPlan(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除检测计划编号为"' + ids + '"的数据项?').then(function () {
+        return delPlan(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('task/plan/export', {
+        ...this.queryParams
+      }, `plan_${new Date().getTime()}.xlsx`)
+    },
+    /** 导出按钮操作 */
+    handleDoPlan() {
+      MessageBox.alert('功能持续开发中...', '出错了~', {
+        confirmButtonText: '确定',
+      })
+    }
+  }
+};
+</script>