Browse Source

-修改监测计划

jiangbiao 2 years ago
parent
commit
b40f13df2e

+ 6 - 6
master/pom.xml

@@ -61,12 +61,6 @@
                 <version>${bitwalker.version}</version>
             </dependency>
 
-            <!-- SpringBoot集成mybatis框架 -->
-            <dependency>
-                <groupId>org.mybatis.spring.boot</groupId>
-                <artifactId>mybatis-spring-boot-starter</artifactId>
-                <version>${mybatis-spring-boot.version}</version>
-            </dependency>
 
             <!-- pagehelper 分页插件 -->
             <dependency>
@@ -157,6 +151,12 @@
 
 
     <dependencies>
+        <!-- SpringBoot集成mybatis框架 -->
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+            <version>${mybatis-spring-boot.version}</version>
+        </dependency>
         <!-- SpringBoot Web容器 -->
         <dependency>
             <groupId>org.springframework.boot</groupId>

+ 8 - 0
master/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java

@@ -1,5 +1,6 @@
 package com.ruoyi.common.core.domain;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
 
 import java.io.Serializable;
@@ -17,26 +18,33 @@ public class BaseEntity implements Serializable
     private static final long serialVersionUID = 1L;
 
     /** 搜索值 */
+    @TableField(exist = false)
     private String searchValue;
 
     /** 创建者 */
+    @TableField(exist = false)
     private String createBy;
 
     /** 创建时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @TableField(exist = false)
     private Date createTime;
 
     /** 更新者 */
+    @TableField(exist = false)
     private String updateBy;
 
     /** 更新时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @TableField(exist = false)
     private Date updateTime;
 
     /** 备注 */
+    @TableField(exist = false)
     private String remark;
 
     /** 请求参数 */
+    @TableField(exist = false)
     private Map<String, Object> params;
 
     public String getSearchValue()

+ 53 - 46
master/src/main/java/com/ruoyi/common/utils/DateUtils.java

@@ -6,6 +6,7 @@ import java.lang.management.ManagementFactory;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.time.*;
+import java.util.Calendar;
 import java.util.Date;
 
 /**
@@ -13,8 +14,7 @@ import java.util.Date;
  *
  * @author ruoyi
  */
-public class DateUtils extends org.apache.commons.lang3.time.DateUtils
-{
+public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
     public static String YYYY = "yyyy";
 
     public static String YYYY_MM = "yyyy-MM";
@@ -35,8 +35,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
      *
      * @return Date() 当前日期
      */
-    public static Date getNowDate()
-    {
+    public static Date getNowDate() {
         return new Date();
     }
 
@@ -45,44 +44,34 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
      *
      * @return String
      */
-    public static String getDate()
-    {
+    public static String getDate() {
         return dateTimeNow(YYYY_MM_DD);
     }
 
-    public static final String getTime()
-    {
+    public static final String getTime() {
         return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
     }
 
-    public static final String dateTimeNow()
-    {
+    public static final String dateTimeNow() {
         return dateTimeNow(YYYYMMDDHHMMSS);
     }
 
-    public static final String dateTimeNow(final String format)
-    {
+    public static final String dateTimeNow(final String format) {
         return parseDateToStr(format, new Date());
     }
 
-    public static final String dateTime(final Date date)
-    {
+    public static final String dateTime(final Date date) {
         return parseDateToStr(YYYY_MM_DD, date);
     }
 
-    public static final String parseDateToStr(final String format, final Date date)
-    {
+    public static final String parseDateToStr(final String format, final Date date) {
         return new SimpleDateFormat(format).format(date);
     }
 
-    public static final Date dateTime(final String format, final String ts)
-    {
-        try
-        {
+    public static final Date dateTime(final String format, final String ts) {
+        try {
             return new SimpleDateFormat(format).parse(ts);
-        }
-        catch (ParseException e)
-        {
+        } catch (ParseException e) {
             throw new RuntimeException(e);
         }
     }
@@ -90,8 +79,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
     /**
      * 日期路径 即年/月/日 如2018/08/08
      */
-    public static final String datePath()
-    {
+    public static final String datePath() {
         Date now = new Date();
         return DateFormatUtils.format(now, "yyyy/MM/dd");
     }
@@ -99,8 +87,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
     /**
      * 日期路径 即年/月/日 如20180808
      */
-    public static final String dateTime()
-    {
+    public static final String dateTime() {
         Date now = new Date();
         return DateFormatUtils.format(now, "yyyyMMdd");
     }
@@ -108,18 +95,13 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
     /**
      * 日期型字符串转化为日期 格式
      */
-    public static Date parseDate(Object str)
-    {
-        if (str == null)
-        {
+    public static Date parseDate(Object str) {
+        if (str == null) {
             return null;
         }
-        try
-        {
+        try {
             return parseDate(str.toString(), parsePatterns);
-        }
-        catch (ParseException e)
-        {
+        } catch (ParseException e) {
             return null;
         }
     }
@@ -127,8 +109,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
     /**
      * 获取服务器启动时间
      */
-    public static Date getServerStartDate()
-    {
+    public static Date getServerStartDate() {
         long time = ManagementFactory.getRuntimeMXBean().getStartTime();
         return new Date(time);
     }
@@ -136,16 +117,14 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
     /**
      * 计算相差天数
      */
-    public static int differentDaysByMillisecond(Date date1, Date date2)
-    {
+    public static int differentDaysByMillisecond(Date date1, Date date2) {
         return Math.abs((int) ((date2.getTime() - date1.getTime()) / (1000 * 3600 * 24)));
     }
 
     /**
      * 计算两个时间差
      */
-    public static String getDatePoor(Date endDate, Date nowDate)
-    {
+    public static String getDatePoor(Date endDate, Date nowDate) {
         long nd = 1000 * 24 * 60 * 60;
         long nh = 1000 * 60 * 60;
         long nm = 1000 * 60;
@@ -166,8 +145,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
     /**
      * 增加 LocalDateTime ==> Date
      */
-    public static Date toDate(LocalDateTime temporalAccessor)
-    {
+    public static Date toDate(LocalDateTime temporalAccessor) {
         ZonedDateTime zdt = temporalAccessor.atZone(ZoneId.systemDefault());
         return Date.from(zdt.toInstant());
     }
@@ -175,10 +153,39 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
     /**
      * 增加 LocalDate ==> Date
      */
-    public static Date toDate(LocalDate temporalAccessor)
-    {
+    public static Date toDate(LocalDate temporalAccessor) {
         LocalDateTime localDateTime = LocalDateTime.of(temporalAccessor, LocalTime.of(0, 0, 0));
         ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault());
         return Date.from(zdt.toInstant());
     }
+
+    /**
+     * 获取当前季度
+     */
+    public static int getNowQuarter() {
+        Calendar now = Calendar.getInstance();
+        int i = now.get(Calendar.MONTH);
+        if (i < 3)
+            return 1;
+        else if (i < 6)
+            return 2;
+        else if (i < 9)
+            return 3;
+        else
+            return 4;
+    }
+
+    /**
+     * 以当前时间为基准增加时间
+     * @param date 起始日期
+     * @param field 时间范围Calendar.DATE、Calendar.MONTH、Calendar.YEAR等
+     * @param amount 时间跨度
+     */
+    public static  Date addTime(Date date,int field,int amount) {
+        Calendar now = Calendar.getInstance();
+        now.setTime(date);
+        now.add(field,amount);
+        now.add(Calendar.DATE,-1);
+       return now.getTime();
+    }
 }

+ 5 - 3
master/src/main/java/com/ruoyi/framework/config/MyBatisConfig.java

@@ -6,6 +6,8 @@ import java.util.Arrays;
 import java.util.HashSet;
 import java.util.List;
 import javax.sql.DataSource;
+
+import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
 import org.apache.ibatis.io.VFS;
 import org.apache.ibatis.session.SqlSessionFactory;
 import org.mybatis.spring.SqlSessionFactoryBean;
@@ -26,7 +28,7 @@ import com.ruoyi.common.utils.StringUtils;
 
 /**
  * Mybatis支持*匹配扫描包
- * 
+ *
  * @author ruoyi
  */
 @Configuration
@@ -122,11 +124,11 @@ public class MyBatisConfig
         typeAliasesPackage = setTypeAliasesPackage(typeAliasesPackage);
         VFS.addImplClass(SpringBootVFS.class);
 
-        final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
+        final MybatisSqlSessionFactoryBean sessionFactory = new MybatisSqlSessionFactoryBean();
         sessionFactory.setDataSource(dataSource);
         sessionFactory.setTypeAliasesPackage(typeAliasesPackage);
         sessionFactory.setMapperLocations(resolveMapperLocations(StringUtils.split(mapperLocations, ",")));
         sessionFactory.setConfigLocation(new DefaultResourceLoader().getResource(configLocation));
         return sessionFactory.getObject();
     }
-}
+}

+ 6 - 6
master/src/main/java/com/ruoyi/project/base/domain/TBasePoint.java

@@ -27,7 +27,7 @@ public class TBasePoint extends BaseEntity {
      * 检测净值
      */
     @Excel(name = "检测净值")
-    private Integer ppm;
+    private Integer netTestValue;
 
     /**
      * 泄漏程度
@@ -348,12 +348,12 @@ public class TBasePoint extends BaseEntity {
         return id;
     }
 
-    public void setPpm(Integer ppm) {
-        this.ppm = ppm;
+    public void setNetTestValue(Integer netTestValue) {
+        this.netTestValue = netTestValue;
     }
 
-    public Integer getPpm() {
-        return ppm;
+    public Integer getNetTestValue() {
+        return netTestValue;
     }
 
     public void setLeakageDegree(String leakageDegree) {
@@ -648,7 +648,7 @@ public class TBasePoint extends BaseEntity {
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                 .append("id", getId())
-                .append("ppm", getPpm())
+                .append("netTestValue", getNetTestValue())
                 .append("leakageDegree", getLeakageDegree())
                 .append("plantId", getPlantId())
                 .append("regionId", getRegionId())

+ 3 - 1
master/src/main/java/com/ruoyi/project/base/mapper/TBasePointMapper.java

@@ -1,6 +1,8 @@
 package com.ruoyi.project.base.mapper;
 
 import java.util.List;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ruoyi.project.base.domain.TBasePoint;
 import org.apache.ibatis.annotations.Param;
 
@@ -10,7 +12,7 @@ import org.apache.ibatis.annotations.Param;
  * @author ruoyi
  * @date 2022-11-11
  */
-public interface TBasePointMapper
+public interface TBasePointMapper extends BaseMapper<TBasePoint>
 {
     /**
      * 查询密封点

+ 103 - 17
master/src/main/java/com/ruoyi/project/task/controller/TTaskInspectionPlanController.java

@@ -1,7 +1,22 @@
 package com.ruoyi.project.task.controller;
 
+import java.sql.Time;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.project.base.domain.TBasePlant;
+import com.ruoyi.project.base.domain.TBasePoint;
+import com.ruoyi.project.base.mapper.TBasePointMapper;
+import com.ruoyi.project.base.service.ITBasePlantService;
+import com.ruoyi.project.base.service.ITBasePointService;
+import com.ruoyi.project.task.mapper.TTaskInspectionPlanMapper;
+import com.ruoyi.system.service.ISysDictTypeService;
+import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -29,26 +44,35 @@ import com.ruoyi.common.core.page.TableDataInfo;
  */
 @RestController
 @RequestMapping("/task/plan")
-public class TTaskInspectionPlanController extends BaseController
-{
+public class TTaskInspectionPlanController extends BaseController {
     @Autowired
     private ITTaskInspectionPlanService tTaskInspectionPlanService;
 
+    @Autowired
+    private TTaskInspectionPlanMapper tTaskInspectionPlanMapper;
+
+    @Autowired
+    private ITBasePlantService tBasePlantService;
+
+    @Autowired
+    private ISysDictTypeService isysDictTypeService;
+
+    @Autowired
+    private TBasePointMapper tBasePointMapper;
+
     /**
      * 查询检测计划列表
      */
     @PreAuthorize("@ss.hasPermi('task:plan:list')")
     @GetMapping("/list")
-    public TableDataInfo list(TTaskInspectionPlan tTaskInspectionPlan)
-    {
+    public TableDataInfo list(TTaskInspectionPlan tTaskInspectionPlan) {
         startPage();
         List<TTaskInspectionPlan> list = tTaskInspectionPlanService.selectTTaskInspectionPlanList(tTaskInspectionPlan);
         return getDataTable(list);
     }
 
     @GetMapping("/allPlan")
-    public AjaxResult selectAllPlan()
-    {
+    public AjaxResult selectAllPlan() {
         return AjaxResult.success(tTaskInspectionPlanService.selectAllPlan());
     }
 
@@ -58,8 +82,7 @@ public class TTaskInspectionPlanController extends BaseController
     @PreAuthorize("@ss.hasPermi('task:plan:export')")
     @Log(title = "检测计划", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, TTaskInspectionPlan tTaskInspectionPlan)
-    {
+    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, "检测计划数据");
@@ -70,8 +93,7 @@ public class TTaskInspectionPlanController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('task:plan:query')")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tTaskInspectionPlanService.selectTTaskInspectionPlanById(id));
     }
 
@@ -81,20 +103,85 @@ public class TTaskInspectionPlanController extends BaseController
     @PreAuthorize("@ss.hasPermi('task:plan:add')")
     @Log(title = "检测计划", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody TTaskInspectionPlan tTaskInspectionPlan)
-    {
+    public AjaxResult add(@RequestBody TTaskInspectionPlan tTaskInspectionPlan) {
         tTaskInspectionPlan.setCreaterCode(getUserId());
         return toAjax(tTaskInspectionPlanService.insertTTaskInspectionPlan(tTaskInspectionPlan));
     }
 
+    @PreAuthorize("@ss.hasPermi('task:plan:add')")
+    @Log(title = "校验检测计划", businessType = BusinessType.INSERT)
+    @PostMapping("/checkPlan")
+    public AjaxResult checkPlan() {
+        List<TTaskInspectionPlan> tTaskInspectionPlans = new ArrayList<>();
+        int nowQuarter = DateUtils.getNowQuarter(); // 获取当前季度
+        Calendar calendar = Calendar.getInstance(); // 获取当前时间
+        String year = String.valueOf(calendar.get(Calendar.YEAR)); // 获取当前年份
+        for (TBasePlant tBasePlant : tBasePlantService.selectAllPlantName()) {// 查询已审核所有装置
+            // 查询今年当前季度是否有监测计划
+            QueryWrapper<TTaskInspectionPlan> plansWrapper = new QueryWrapper<TTaskInspectionPlan>().eq("year", year).eq("quarter", nowQuarter).eq("plant_id", tBasePlant.getId()).eq("del_flag", 0);
+            List<TTaskInspectionPlan> plans = tTaskInspectionPlanService.list(plansWrapper);
+            if (CollectionUtils.isNotEmpty(plans)) {// 有则跳过
+                continue;
+            }
+            TTaskInspectionPlan tTaskInspectionPlan = new TTaskInspectionPlan();
+            tTaskInspectionPlan.setPlantId(tBasePlant.getId());
+            // 查询最后一个计划编号
+            plansWrapper.clear();
+            plansWrapper.eq("del_flag", 0).orderByDesc("code");
+            plans = tTaskInspectionPlanMapper.selectList(plansWrapper);
+            int code = 0;
+            if (CollectionUtils.isNotEmpty(plans)) {
+                code = plans.get(0).getCode() + 1;// 当前计划编号为前一个计划编号+1
+            }
+            // 检测计划编号
+            tTaskInspectionPlan.setInspectionPlanNo("LTP_" + year + "_" + "0" + nowQuarter + "_" + code);
+            // 检测计划名称
+            tTaskInspectionPlan.setInspectionPlanName(tBasePlant.getPlantName() + "_" + year + "第" + nowQuarter + "季度检测计划");
+            if (nowQuarter == 1 && nowQuarter == 3) {
+                // 当前季度为1、3季度时,检测频次为一季一次
+                // TODO 当装置中没有动密封点时,跳过此计划
+                tTaskInspectionPlan.setDetectionFrequency("2");
+                // 检测结束时间为开始时间+3个月
+                tTaskInspectionPlan.setEndTime(DateUtils.addTime(new Date(), Calendar.MONTH, 3));
+            } else {
+                // 当前季度为2、4季度时,检测频次为半年一次
+                tTaskInspectionPlan.setDetectionFrequency("3");
+                // 检测结束时间为开始时间+6个月
+                tTaskInspectionPlan.setEndTime(DateUtils.addTime(new Date(), Calendar.MONTH, 6));
+            }
+            // 检测开始时间 TODO:改成传过来的
+            tTaskInspectionPlan.setStartTime(new Date());
+            // 统计当前装置下的所有(动)密封点
+            QueryWrapper<TBasePoint> points = new QueryWrapper<TBasePoint>().eq("plant_id", tBasePlant.getId()).eq("del_flag", 0).eq("approve_status", 2);
+            // TODO: 当1、3季度时需要加上动密封点的判断
+//            if (nowQuarter == 1 && nowQuarter == 3) {
+//                points.eq("","");
+//            }
+            Integer count = tBasePointMapper.selectCount(points);
+            tTaskInspectionPlan.setPointNum(count.toString());
+            tTaskInspectionPlan.setCreaterCode(getUserId());
+            tTaskInspectionPlan.setCreatedate(new Date());
+            tTaskInspectionPlan.setUpdaterCode(getUserId());
+            tTaskInspectionPlan.setUpdatedate(new Date());
+            tTaskInspectionPlan.setCode(code);
+            tTaskInspectionPlan.setYear(year);
+            tTaskInspectionPlan.setQuarter(String.valueOf(nowQuarter));
+            tTaskInspectionPlans.add(tTaskInspectionPlan);
+        }
+        if (!tTaskInspectionPlans.isEmpty()) {
+            return toAjax(tTaskInspectionPlanService.insertTTaskInspectionPlanByList(tTaskInspectionPlans));
+        }
+        return AjaxResult.success();
+    }
+
+
     /**
      * 修改检测计划
      */
     @PreAuthorize("@ss.hasPermi('task:plan:edit')")
     @Log(title = "检测计划", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody TTaskInspectionPlan tTaskInspectionPlan)
-    {
+    public AjaxResult edit(@RequestBody TTaskInspectionPlan tTaskInspectionPlan) {
         tTaskInspectionPlan.setUpdaterCode(getUserId());
         return toAjax(tTaskInspectionPlanService.updateTTaskInspectionPlan(tTaskInspectionPlan));
     }
@@ -104,9 +191,8 @@ public class TTaskInspectionPlanController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('task:plan:remove')")
     @Log(title = "检测计划", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tTaskInspectionPlanService.deleteTTaskInspectionPlanByIds(ids));
     }
 }

+ 148 - 94
master/src/main/java/com/ruoyi/project/task/domain/TTaskInspectionPlan.java

@@ -3,6 +3,7 @@ package com.ruoyi.project.task.domain;
 import java.util.Date;
 
 import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
@@ -15,78 +16,147 @@ import com.ruoyi.common.core.domain.BaseEntity;
  * @author ruoyi
  * @date 2022-11-17
  */
-public class TTaskInspectionPlan extends BaseEntity
-{
+@TableName("t_task_inspection_plan")
+public class TTaskInspectionPlan extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** 唯一标识id */
+    /**
+     * 唯一标识id
+     */
     private Long id;
 
-    /** 装置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:删除 */
+    /**
+     * 状态 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;
 
+    /**
+     * 季度
+     */
+    private String quarter;
+
+    /**
+     * 年份
+     */
+    private String year;
+
+    /**
+     * 编码
+     */
+    private Integer code;
+
+    public String getYear() {
+        return year;
+    }
+
+    public void setYear(String year) {
+        this.year = year;
+    }
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public void setCode(Integer code) {
+        this.code = code;
+    }
+
+    public String getQuarter() {
+        return quarter;
+    }
+
+    public void setQuarter(String quarter) {
+        this.quarter = quarter;
+    }
+
     public String getCreater() {
         return creater;
     }
@@ -103,160 +173,144 @@ public class TTaskInspectionPlan extends BaseEntity
         this.plantName = plantName;
     }
 
-    public void setId(Long id)
-    {
+    public void setId(Long id) {
         this.id = id;
     }
 
-    public Long getId()
-    {
+    public Long getId() {
         return id;
     }
-    public void setPlantId(Long plantId)
-    {
+
+    public void setPlantId(Long plantId) {
         this.plantId = plantId;
     }
 
-    public Long getPlantId()
-    {
+    public Long getPlantId() {
         return plantId;
     }
-    public void setInspectionPlanNo(String inspectionPlanNo)
-    {
+
+    public void setInspectionPlanNo(String inspectionPlanNo) {
         this.inspectionPlanNo = inspectionPlanNo;
     }
 
-    public String getInspectionPlanNo()
-    {
+    public String getInspectionPlanNo() {
         return inspectionPlanNo;
     }
-    public void setInspectionPlanName(String inspectionPlanName)
-    {
+
+    public void setInspectionPlanName(String inspectionPlanName) {
         this.inspectionPlanName = inspectionPlanName;
     }
 
-    public String getInspectionPlanName()
-    {
+    public String getInspectionPlanName() {
         return inspectionPlanName;
     }
-    public void setDetectionFrequency(String detectionFrequency)
-    {
+
+    public void setDetectionFrequency(String detectionFrequency) {
         this.detectionFrequency = detectionFrequency;
     }
 
-    public String getDetectionFrequency()
-    {
+    public String getDetectionFrequency() {
         return detectionFrequency;
     }
-    public void setStartTime(Date startTime)
-    {
+
+    public void setStartTime(Date startTime) {
         this.startTime = startTime;
     }
 
-    public Date getStartTime()
-    {
+    public Date getStartTime() {
         return startTime;
     }
-    public void setEndTime(Date endTime)
-    {
+
+    public void setEndTime(Date endTime) {
         this.endTime = endTime;
     }
 
-    public Date getEndTime()
-    {
+    public Date getEndTime() {
         return endTime;
     }
-    public void setPointNum(String pointNum)
-    {
+
+    public void setPointNum(String pointNum) {
         this.pointNum = pointNum;
     }
 
-    public String getPointNum()
-    {
+    public String getPointNum() {
         return pointNum;
     }
-    public void setRemarks(String remarks)
-    {
+
+    public void setRemarks(String remarks) {
         this.remarks = remarks;
     }
 
-    public String getRemarks()
-    {
+    public String getRemarks() {
         return remarks;
     }
-    public void setDeptId(Long deptId)
-    {
+
+    public void setDeptId(Long deptId) {
         this.deptId = deptId;
     }
 
-    public Long getDeptId()
-    {
+    public Long getDeptId() {
         return deptId;
     }
-    public void setDelFlag(Integer delFlag)
-    {
+
+    public void setDelFlag(Integer delFlag) {
         this.delFlag = delFlag;
     }
 
-    public Integer getDelFlag()
-    {
+    public Integer getDelFlag() {
         return delFlag;
     }
-    public void setCreaterCode(Long createrCode)
-    {
+
+    public void setCreaterCode(Long createrCode) {
         this.createrCode = createrCode;
     }
 
-    public Long getCreaterCode()
-    {
+    public Long getCreaterCode() {
         return createrCode;
     }
-    public void setCreatedate(Date createdate)
-    {
+
+    public void setCreatedate(Date createdate) {
         this.createdate = createdate;
     }
 
-    public Date getCreatedate()
-    {
+    public Date getCreatedate() {
         return createdate;
     }
-    public void setUpdaterCode(Long updaterCode)
-    {
+
+    public void setUpdaterCode(Long updaterCode) {
         this.updaterCode = updaterCode;
     }
 
-    public Long getUpdaterCode()
-    {
+    public Long getUpdaterCode() {
         return updaterCode;
     }
-    public void setUpdatedate(Date updatedate)
-    {
+
+    public void setUpdatedate(Date updatedate) {
         this.updatedate = updatedate;
     }
 
-    public Date getUpdatedate()
-    {
+    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();
+        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();
     }
 }

+ 6 - 1
master/src/main/java/com/ruoyi/project/task/mapper/TTaskInspectionPlanMapper.java

@@ -1,7 +1,10 @@
 package com.ruoyi.project.task.mapper;
 
 import java.util.List;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ruoyi.project.task.domain.TTaskInspectionPlan;
+import org.apache.ibatis.annotations.Mapper;
 
 /**
  * 检测计划Mapper接口
@@ -9,7 +12,8 @@ import com.ruoyi.project.task.domain.TTaskInspectionPlan;
  * @author ruoyi
  * @date 2022-11-17
  */
-public interface TTaskInspectionPlanMapper
+@Mapper
+public interface TTaskInspectionPlanMapper extends BaseMapper<TTaskInspectionPlan>
 {
     /**
      * 查询检测计划
@@ -35,6 +39,7 @@ public interface TTaskInspectionPlanMapper
      * @return 结果
      */
     public int insertTTaskInspectionPlan(TTaskInspectionPlan tTaskInspectionPlan);
+    public int insertTTaskInspectionPlanByList(List<TTaskInspectionPlan> tTaskInspectionPlans);
 
     /**
      * 修改检测计划

+ 4 - 1
master/src/main/java/com/ruoyi/project/task/service/ITTaskInspectionPlanService.java

@@ -1,6 +1,8 @@
 package com.ruoyi.project.task.service;
 
 import java.util.List;
+
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.ruoyi.project.task.domain.TTaskInspectionPlan;
 
 /**
@@ -9,7 +11,7 @@ import com.ruoyi.project.task.domain.TTaskInspectionPlan;
  * @author ruoyi
  * @date 2022-11-17
  */
-public interface ITTaskInspectionPlanService
+public interface ITTaskInspectionPlanService extends IService<TTaskInspectionPlan>
 {
     /**
      * 查询检测计划
@@ -36,6 +38,7 @@ public interface ITTaskInspectionPlanService
      * @return 结果
      */
     public int insertTTaskInspectionPlan(TTaskInspectionPlan tTaskInspectionPlan);
+    public int insertTTaskInspectionPlanByList(List<TTaskInspectionPlan> tTaskInspectionPlans);
 
     /**
      * 修改检测计划

+ 8 - 1
master/src/main/java/com/ruoyi/project/task/service/impl/TTaskInspectionPlanServiceImpl.java

@@ -1,6 +1,8 @@
 package com.ruoyi.project.task.service.impl;
 
 import java.util.List;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.project.task.mapper.TTaskInspectionPlanMapper;
@@ -14,7 +16,7 @@ import com.ruoyi.project.task.service.ITTaskInspectionPlanService;
  * @date 2022-11-17
  */
 @Service
-public class TTaskInspectionPlanServiceImpl implements ITTaskInspectionPlanService
+public class TTaskInspectionPlanServiceImpl extends ServiceImpl<TTaskInspectionPlanMapper,TTaskInspectionPlan> implements ITTaskInspectionPlanService
 {
     @Autowired
     private TTaskInspectionPlanMapper tTaskInspectionPlanMapper;
@@ -60,6 +62,11 @@ public class TTaskInspectionPlanServiceImpl implements ITTaskInspectionPlanServi
     {
         return tTaskInspectionPlanMapper.insertTTaskInspectionPlan(tTaskInspectionPlan);
     }
+    @Override
+    public int insertTTaskInspectionPlanByList(List<TTaskInspectionPlan> tTaskInspectionPlans)
+    {
+        return tTaskInspectionPlanMapper.insertTTaskInspectionPlanByList(tTaskInspectionPlans);
+    }
 
     /**
      * 修改检测计划

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

@@ -107,7 +107,25 @@ mybatis:
     mapperLocations: classpath*:mybatis/**/*Mapper.xml
     # 加载全局的配置文件
     configLocation: classpath:mybatis/mybatis-config.xml
-
+mybatis-plus:
+  mapper-locations: classpath*:mybatis/**/*Mapper.xml
+  #实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.ruoyi.**.domain
+  global-config:
+    #数据库相关配置
+    db-config:
+      #主键类型  AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID";
+      id-type: AUTO
+      logic-delete-field: DEL_FLAG  #全局逻辑删除字段值 3.3.0开始支持,详情看下面。
+      logic-delete-value: 1 # 逻辑已删除值
+      logic-not-delete-value: 0 # 逻辑未删除值
+    banner: false
+  #原生配置
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: false
+    call-setters-on-nulls: true
+    jdbc-type-for-null: 'null'
 # PageHelper分页插件
 pagehelper:
   helperDialect: mysql

+ 1 - 1
master/src/main/resources/mybatis/base/TBasePlantMapper.xml

@@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </sql>
 
     <select id="selectAllPlantName" resultMap="TBasePlantResult">
-        select d.id,d.plant_name from t_base_plant d where del_flag=0
+        select d.id,d.plant_name from t_base_plant d where del_flag=0 and approve_status=1
     </select>
 
     <select id="selectTBasePlantList" parameterType="TBasePlant" resultMap="TBasePlantResult">

+ 7 - 7
master/src/main/resources/mybatis/base/TBasePointMapper.xml

@@ -6,7 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <resultMap type="TBasePoint" id="TBasePointResult">
         <result property="id"    column="id"    />
-        <result property="ppm"    column="ppm"    />
+        <result property="netTestValue"    column="net_test_value"    />
         <result property="leakageDegree"    column="leakage_degree"    />
         <result property="plantId"    column="plant_id"    />
         <result property="plantType"    column="plant_type"    />
@@ -54,17 +54,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectTBasePointVo">
-        select id, ppm, leakage_degree, plant_id, region_id, dev_id, medium, medium_type, point_type, layer, group_position, point_position, group_code, extend_code, sub_point_type, dia, unarrive, unarrive_reason, keep_warm, temperature, pressure, run_time, pid_no, pid_url, pic_no, pic_url, toc_mark, methane_mark, vocs_mark, remarks, approve_status, approve_time, dept_id, del_flag, creater_code, createdate, updater_code, updatedate from t_base_point
+        select id, net_test_value, leakage_degree, plant_id, region_id, dev_id, medium, medium_type, point_type, layer, group_position, point_position, group_code, extend_code, sub_point_type, dia, unarrive, unarrive_reason, keep_warm, temperature, pressure, run_time, pid_no, pid_url, pic_no, pic_url, toc_mark, methane_mark, vocs_mark, remarks, approve_status, approve_time, dept_id, del_flag, creater_code, createdate, updater_code, updatedate from t_base_point
     </sql>
 
     <select id="selectTBasePointList" parameterType="TBasePoint" resultMap="TBasePointResult">
-        select d.id, d.ppm, d.leakage_degree, d.plant_id,bp.plant_name,bp.plant_type,bp.plant_code, d.region_id,br.region_code,br.region_name, d.dev_id,bd.code dev_code,bd.`describe` dev_name,d.medium, d.medium_type, d.point_type, d.layer, d.group_position, d.point_position, d.group_code, d.extend_code, d.sub_point_type, d.dia, d.unarrive, d.unarrive_reason, d.keep_warm, d.temperature, d.pressure, d.run_time, d.pid_no, d.pid_url, d.pic_no, d.pic_url, d.toc_mark, d.methane_mark, d.vocs_mark, d.remarks, d.approve_status, d.approve_time, d.dept_id, d.del_flag, d.creater_code, d.createdate, su.user_name updater, d.updatedate from t_base_point d
+        select d.id, d.net_test_value, d.leakage_degree, d.plant_id,bp.plant_name,bp.plant_type,bp.plant_code, d.region_id,br.region_code,br.region_name, d.dev_id,bd.code dev_code,bd.`describe` dev_name,d.medium, d.medium_type, d.point_type, d.layer, d.group_position, d.point_position, d.group_code, d.extend_code, d.sub_point_type, d.dia, d.unarrive, d.unarrive_reason, d.keep_warm, d.temperature, d.pressure, d.run_time, d.pid_no, d.pid_url, d.pic_no, d.pic_url, d.toc_mark, d.methane_mark, d.vocs_mark, d.remarks, d.approve_status, d.approve_time, d.dept_id, d.del_flag, d.creater_code, d.createdate, su.user_name updater, d.updatedate from t_base_point d
         left join sys_user su on su.user_id = d.updater_code
         left join t_base_plant bp on bp.id = d.plant_id
         left join t_base_region br on br.id = d.region_id
         left join t_base_device bd on bd.id = d.dev_id
         <where>
-            <if test="ppm != null "> and d.ppm = #{ppm}</if>
+            <if test="netTestValue != null "> and d.net_test_value = #{netTestValue}</if>
             <if test="leakageDegree != null  and leakageDegree != ''"> and d.leakage_degree = #{leakageDegree}</if>
             <if test="plantId != null "> and d.plant_id = #{plantId}</if>
             <if test="regionId != null "> and d.region_id = #{regionId}</if>
@@ -125,7 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <insert id="insertTBasePoint" parameterType="TBasePoint" useGeneratedKeys="true" keyProperty="id">
         insert into t_base_point
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="ppm != null">ppm,</if>
+            <if test="netTestValue != null">net_test_value,</if>
             <if test="leakageDegree != null">leakage_degree,</if>
             <if test="plantId != null">plant_id,</if>
             <if test="regionId != null">region_id,</if>
@@ -164,7 +164,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null">updatedate,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="ppm != null">#{ppm},</if>
+            <if test="netTestValue != null">#{netTestValue},</if>
             <if test="leakageDegree != null">#{leakageDegree},</if>
             <if test="plantId != null">#{plantId},</if>
             <if test="regionId != null">#{regionId},</if>
@@ -207,7 +207,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <update id="updateTBasePoint" parameterType="TBasePoint">
         update t_base_point
         <trim prefix="SET" suffixOverrides=",">
-            <if test="ppm != null">ppm = #{ppm},</if>
+            <if test="netTestValue != null">net_test_value = #{netTestValue},</if>
             <if test="leakageDegree != null">leakage_degree = #{leakageDegree},</if>
             <if test="plantId != null">plant_id = #{plantId},</if>
             <if test="regionId != null">region_id = #{regionId},</if>

+ 56 - 2
master/src/main/resources/mybatis/task/TTaskInspectionPlanMapper.xml

@@ -22,10 +22,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updaterCode"    column="updater_code"    />
         <result property="updatedate"    column="updatedate"    />
         <result property="creater"    column="creater"    />
+        <result property="quarter"    column="quarter"    />
+        <result property="year"    column="year"    />
+        <result property="code"    column="code"    />
     </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
+        select `quarter`, `year`, `code`,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">
@@ -46,12 +49,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <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>
+            <if test="quarter != null "> and d.quarter = #{quarter}</if>
+            <if test="year != null "> and d.year = #{year}</if>
+            <if test="code != null "> and d.code = #{code}</if>
             and d.del_flag = 0
         </where>
     </select>
 
     <select id="selectAllPlan" resultMap="TTaskInspectionPlanResult">
-        <include refid="selectTTaskInspectionPlanVo"/>
+        <include refid="selectTTaskInspectionPlanVo"/> where del_flag = 0
     </select>
 
     <select id="selectTTaskInspectionPlanById" parameterType="Long" resultMap="TTaskInspectionPlanResult">
@@ -76,6 +82,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createdate != null">createdate,</if>
             <if test="updaterCode != null">updater_code,</if>
             <if test="updatedate != null">updatedate,</if>
+            <if test="quarter != null ">`quarter`,</if>
+            <if test="year != null ">`year`,</if>
+            <if test="code != null ">`code`,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="plantId != null">#{plantId},</if>
@@ -92,9 +101,51 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createdate != null">#{createdate},</if>
             <if test="updaterCode != null">#{updaterCode},</if>
             <if test="updatedate != null">#{updatedate},</if>
+            <if test="quarter != null ">#{quarter},</if>
+            <if test="year != null ">#{year},</if>
+            <if test="code != null ">#{code},</if>
          </trim>
     </insert>
 
+    <insert id="insertTTaskInspectionPlanByList" parameterType="java.util.List" useGeneratedKeys="true">
+        insert into t_task_inspection_plan
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            plant_id,
+            inspection_plan_no,
+            inspection_plan_name,
+            detection_frequency,
+            start_time,
+            end_time,
+            point_num,
+            creater_code,
+            createdate,
+            updater_code,
+            updatedate,
+            `quarter`,
+            `year`,
+            `code`,
+        </trim>
+        values
+        <foreach collection="list" index="index" separator="," item="item">
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            #{item.plantId},
+            #{item.inspectionPlanNo},
+            #{item.inspectionPlanName},
+            #{item.detectionFrequency},
+            #{item.startTime},
+            #{item.endTime},
+            #{item.pointNum},
+            #{item.createrCode},
+            #{item.createdate},
+            #{item.updaterCode},
+            #{item.updatedate},
+            #{item.quarter},
+            #{item.year},
+            #{item.code},
+        </trim>
+        </foreach>
+    </insert>
+
     <update id="updateTTaskInspectionPlan" parameterType="TTaskInspectionPlan">
         update t_task_inspection_plan
         <trim prefix="SET" suffixOverrides=",">
@@ -112,6 +163,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createdate != null">createdate = #{createdate},</if>
             <if test="updaterCode != null">updater_code = #{updaterCode},</if>
             <if test="updatedate != null">updatedate = #{updatedate},</if>
+            <if test="quarter != null "> `quarter` = #{quarter}</if>
+            <if test="year != null "> `year` = #{year}</if>
+            <if test="code != null "> `code` = #{code}</if>
         </trim>
         where id = #{id}
     </update>

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

@@ -33,6 +33,15 @@ export function addPlan(data) {
   })
 }
 
+
+// 校验检测计划
+export function checkPlan() {
+  return request({
+    url: '/task/plan/checkPlan',
+    method: 'post'
+  })
+}
+
 // 修改检测计划
 export function updatePlan(data) {
   return request({

+ 17 - 6
ui/src/views/task/plan/index.vue

@@ -16,7 +16,7 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
+<!--      <el-col :span="1.5">
         <el-button
           type="primary"
           plain
@@ -50,7 +50,7 @@
           v-hasPermi="['task:plan:remove']"
         >删除
         </el-button>
-      </el-col>
+      </el-col>-->
       <el-col :span="1.5">
         <el-button
           type="info"
@@ -61,6 +61,9 @@
         >{{ $t('校验检测计划') }}
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <span style="color: #ff0000" v-if="checking"><i class="el-icon-loading" ></i>正在校验检测计划,请稍候...</span>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -82,13 +85,13 @@
         </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="备注" align="center" prop="remarks" width="100" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width" width="130">
         <template slot-scope="scope">
           <el-button
@@ -180,7 +183,7 @@
 </template>
 
 <script>
-import {listPlan, getPlan, delPlan, addPlan, updatePlan} from "@/api/task/plan";
+import {listPlan, getPlan, delPlan, addPlan, updatePlan, checkPlan} from "@/api/task/plan";
 import {MessageBox} from "element-ui";
 import {getAllPlantName} from "@/api/base/plant";
 
@@ -188,6 +191,7 @@ export default {
   name: "Plan",
   data() {
     return {
+      checking:false,
       plantOperation:[],
       detectionOperation:[],
       // 页面高度
@@ -357,8 +361,15 @@ export default {
     },
     /** 导出按钮操作 */
     handleDoPlan() {
-      MessageBox.alert('功能持续开发中...', '出错了~', {
-        confirmButtonText: '确定',
+      this.$modal.confirm('是否确认校验检测计划?注意!在此之后新增的检测点将记入下次监测计划!').then(() => {
+        this.checking = true;
+        checkPlan().then(response => {
+          this.checking = false;
+          this.getList();
+          this.$modal.msgSuccess("校验成功");
+        })
+      }).catch(() => {
+        this.$modal.msg("校验取消");
       })
     }
   }