Explorar o código

-添加法规管理

jiangbiao %!s(int64=2) %!d(string=hai) anos
pai
achega
c82f23ab76

+ 104 - 0
master/src/main/java/com/ruoyi/project/check/controller/TCheckLawitemsController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.project.check.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.check.domain.TCheckLawitems;
+import com.ruoyi.project.check.service.ITCheckLawitemsService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 法规项Controller
+ * 
+ * @author ruoyi
+ * @date 2022-11-28
+ */
+@RestController
+@RequestMapping("/check/lawitems")
+public class TCheckLawitemsController extends BaseController
+{
+    @Autowired
+    private ITCheckLawitemsService tCheckLawitemsService;
+
+    /**
+     * 查询法规项列表
+     */
+    @PreAuthorize("@ss.hasPermi('check:lawitems:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TCheckLawitems tCheckLawitems)
+    {
+        startPage();
+        List<TCheckLawitems> list = tCheckLawitemsService.selectTCheckLawitemsList(tCheckLawitems);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出法规项列表
+     */
+    @PreAuthorize("@ss.hasPermi('check:lawitems:export')")
+    @Log(title = "法规项", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TCheckLawitems tCheckLawitems)
+    {
+        List<TCheckLawitems> list = tCheckLawitemsService.selectTCheckLawitemsList(tCheckLawitems);
+        ExcelUtil<TCheckLawitems> util = new ExcelUtil<TCheckLawitems>(TCheckLawitems.class);
+        util.exportExcel(response, list, "法规项数据");
+    }
+
+    /**
+     * 获取法规项详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('check:lawitems:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(tCheckLawitemsService.selectTCheckLawitemsById(id));
+    }
+
+    /**
+     * 新增法规项
+     */
+    @PreAuthorize("@ss.hasPermi('check:lawitems:add')")
+    @Log(title = "法规项", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TCheckLawitems tCheckLawitems)
+    {
+        return toAjax(tCheckLawitemsService.insertTCheckLawitems(tCheckLawitems));
+    }
+
+    /**
+     * 修改法规项
+     */
+    @PreAuthorize("@ss.hasPermi('check:lawitems:edit')")
+    @Log(title = "法规项", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TCheckLawitems tCheckLawitems)
+    {
+        return toAjax(tCheckLawitemsService.updateTCheckLawitems(tCheckLawitems));
+    }
+
+    /**
+     * 删除法规项
+     */
+    @PreAuthorize("@ss.hasPermi('check:lawitems:remove')")
+    @Log(title = "法规项", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tCheckLawitemsService.deleteTCheckLawitemsByIds(ids));
+    }
+}

+ 158 - 0
master/src/main/java/com/ruoyi/project/check/controller/TCheckLawsController.java

@@ -0,0 +1,158 @@
+package com.ruoyi.project.check.controller;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.common.core.domain.entity.SysDictData;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.project.check.domain.TCheckLawitems;
+import com.ruoyi.project.check.service.ITCheckLawitemsService;
+import com.ruoyi.system.service.ISysDictTypeService;
+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.check.domain.TCheckLaws;
+import com.ruoyi.project.check.service.ITCheckLawsService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 法规Controller
+ *
+ * @author ruoyi
+ * @date 2022-11-28
+ */
+@RestController
+@RequestMapping("/check/laws")
+public class TCheckLawsController extends BaseController {
+    @Autowired
+    private ITCheckLawsService tCheckLawsService;
+
+    @Autowired
+    private ISysDictTypeService isysDictTypeService;
+
+    @Autowired
+    private ITCheckLawitemsService tCheckLawitemsService;
+
+    /**
+     * 查询法规列表
+     */
+    @PreAuthorize("@ss.hasPermi('check:laws:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TCheckLaws tCheckLaws) {
+        startPage();
+        List<TCheckLaws> list = tCheckLawsService.selectTCheckLawsList(tCheckLaws);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出法规列表
+     */
+    @PreAuthorize("@ss.hasPermi('check:laws:export')")
+    @Log(title = "法规", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TCheckLaws tCheckLaws) {
+        List<TCheckLaws> list = tCheckLawsService.selectTCheckLawsList(tCheckLaws);
+        ExcelUtil<TCheckLaws> util = new ExcelUtil<TCheckLaws>(TCheckLaws.class);
+        util.exportExcel(response, list, "法规数据");
+    }
+
+    /**
+     * 获取法规详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('check:laws:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return AjaxResult.success(tCheckLawsService.selectTCheckLawsById(id));
+    }
+
+    /**
+     * 新增法规
+     */
+    @PreAuthorize("@ss.hasPermi('check:laws:add')")
+    @Log(title = "法规", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TCheckLaws tCheckLaws) {
+        tCheckLaws.setCreaterCode(getUserId());
+        tCheckLaws.setUpdatedate(new Date());
+        tCheckLaws.setUpdaterCode(getUserId());
+        tCheckLawsService.insertTCheckLaws(tCheckLaws); // 新增法规表
+        // 开始创建法规项内容
+        List<SysDictData> pointTypes = isysDictTypeService.selectDictDataByType("point_type"); // 密封点类型
+        List<SysDictData> plantTypes = isysDictTypeService.selectDictDataByType("plant_type"); // 装置类型
+        List<SysDictData> mediumTypes = isysDictTypeService.selectDictDataByType("medium_type"); // 介质状态
+        List<TCheckLawitems> tCheckLawitems = new ArrayList<>();
+        for (SysDictData plantType : plantTypes) { // 遍历装置
+            for (SysDictData pointType : pointTypes) { // 遍历密封点
+                for (SysDictData mediumType : mediumTypes) { // 遍历介质状态
+                    // 根据装置类型、密封点类型、介质状态生成法规项
+                    TCheckLawitems tCheckLawitem = new TCheckLawitems();
+                    tCheckLawitem.setLawId(tCheckLaws.getId());
+                    tCheckLawitem.setPlantType(plantType.getDictValue());
+                    tCheckLawitem.setPointType(pointType.getDictValue());
+                    tCheckLawitem.setMediumType(mediumType.getDictValue());
+                    // TODO 频率、泄露标准、维修天数需确认
+                    tCheckLawitem.setDetectionFrequency("3");
+                    tCheckLawitem.setGeneral("50");
+                    tCheckLawitem.setSerious("200");
+                    tCheckLawitem.setStratFix("15");
+                    tCheckLawitem.setEndFix("15");
+                    tCheckLawitem.setCreaterCode(getUserId());
+                    tCheckLawitem.setCreatedate(new Date());
+                    tCheckLawitem.setUpdatedate(new Date());
+                    tCheckLawitem.setUpdaterCode(getUserId());
+                    tCheckLawitems.add(tCheckLawitem);
+                }
+            }
+        }
+        // 新增法规项表
+        return toAjax(tCheckLawitemsService.insertTCheckLawitemsByList(tCheckLawitems));
+
+    }
+
+    /**
+     * 修改法规
+     */
+    @PreAuthorize("@ss.hasPermi('check:laws:edit')")
+    @Log(title = "法规", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TCheckLaws tCheckLaws) {
+        tCheckLaws.setUpdatedate(new Date());
+        tCheckLaws.setUpdaterCode(getUserId());
+        if (StringUtils.isNotEmpty(tCheckLaws.getStatus())) {
+            tCheckLaws.setStarttime(new Date());
+        }
+        return toAjax(tCheckLawsService.updateTCheckLaws(tCheckLaws));
+    }
+
+    @PreAuthorize("@ss.hasPermi('check:laws:edit')")
+    @Log(title = "法规匹配", businessType = BusinessType.UPDATE)
+    @PutMapping("/matchLaws")
+    public AjaxResult matchLaws(@RequestBody TCheckLaws tCheckLaws) {
+        tCheckLaws.setStarttime(new Date());
+        return toAjax(tCheckLawsService.updateTCheckLawsStatus(tCheckLaws));
+    }
+
+    /**
+     * 删除法规
+     */
+    @PreAuthorize("@ss.hasPermi('check:laws:remove')")
+    @Log(title = "法规", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(tCheckLawsService.deleteTCheckLawsByIds(ids));
+    }
+}

+ 279 - 0
master/src/main/java/com/ruoyi/project/check/domain/TCheckLawitems.java

@@ -0,0 +1,279 @@
+package com.ruoyi.project.check.domain;
+
+import java.util.Date;
+
+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_check_lawitems
+ *
+ * @author ruoyi
+ * @date 2022-11-28
+ */
+public class TCheckLawitems extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 唯一标识id
+     */
+    private Long id;
+
+    /**
+     * 法规id
+     */
+    private Long lawId;
+
+    /**
+     * 装置类型
+     */
+    @Excel(name = "装置类型")
+    private String plantType;
+
+    /**
+     * 密封点类型
+     */
+    @Excel(name = "密封点类型")
+    private String pointType;
+
+    /**
+     * 介质状态
+     */
+    @Excel(name = "介质状态")
+    private String mediumType;
+
+    /**
+     * 一般泄露标准
+     */
+    @Excel(name = "一般泄露标准")
+    private String general;
+
+    /**
+     * 严重泄漏标准
+     */
+    @Excel(name = "严重泄漏标准")
+    private String serious;
+
+    /**
+     * 监测频次
+     */
+    @Excel(name = "监测频次")
+    private String detectionFrequency;
+
+    /**
+     * 首次维修时限
+     */
+    @Excel(name = "首次维修时限")
+    private String stratFix;
+
+    /**
+     * 最终维修时限
+     */
+    @Excel(name = "最终维修时限")
+    private String endFix;
+
+    /**
+     * 备注
+     */
+    @Excel(name = "备注")
+    private String remarks;
+
+    /**
+     * 部门编号
+     */
+    @Excel(name = "部门编号")
+    private Long deptId;
+
+    /**
+     * 状态 1 :正常 ;0:删除
+     */
+    private Integer delFlag;
+
+    /**
+     * 创建人
+     */
+    @Excel(name = "创建人")
+    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 Long getLawId() {
+        return lawId;
+    }
+
+    public void setLawId(Long lawId) {
+        this.lawId = lawId;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setPlantType(String plantType) {
+        this.plantType = plantType;
+    }
+
+    public String getPlantType() {
+        return plantType;
+    }
+
+    public void setPointType(String pointType) {
+        this.pointType = pointType;
+    }
+
+    public String getPointType() {
+        return pointType;
+    }
+
+    public void setMediumType(String mediumType) {
+        this.mediumType = mediumType;
+    }
+
+    public String getMediumType() {
+        return mediumType;
+    }
+
+    public void setGeneral(String general) {
+        this.general = general;
+    }
+
+    public String getGeneral() {
+        return general;
+    }
+
+    public void setSerious(String serious) {
+        this.serious = serious;
+    }
+
+    public String getSerious() {
+        return serious;
+    }
+
+    public void setDetectionFrequency(String detectionFrequency) {
+        this.detectionFrequency = detectionFrequency;
+    }
+
+    public String getDetectionFrequency() {
+        return detectionFrequency;
+    }
+
+    public void setStratFix(String stratFix) {
+        this.stratFix = stratFix;
+    }
+
+    public String getStratFix() {
+        return stratFix;
+    }
+
+    public void setEndFix(String endFix) {
+        this.endFix = endFix;
+    }
+
+    public String getEndFix() {
+        return endFix;
+    }
+
+    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("lawId", getLawId())
+                .append("plantType", getPlantType())
+                .append("pointType", getPointType())
+                .append("mediumType", getMediumType())
+                .append("general", getGeneral())
+                .append("serious", getSerious())
+                .append("detectionFrequency", getDetectionFrequency())
+                .append("stratFix", getStratFix())
+                .append("endFix", getEndFix())
+                .append("remarks", getRemarks())
+                .append("deptId", getDeptId())
+                .append("delFlag", getDelFlag())
+                .append("createrCode", getCreaterCode())
+                .append("createdate", getCreatedate())
+                .append("updaterCode", getUpdaterCode())
+                .append("updatedate", getUpdatedate())
+                .toString();
+    }
+}

+ 216 - 0
master/src/main/java/com/ruoyi/project/check/domain/TCheckLaws.java

@@ -0,0 +1,216 @@
+package com.ruoyi.project.check.domain;
+
+import java.util.Date;
+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_check_laws
+ *
+ * @author ruoyi
+ * @date 2022-11-28
+ */
+public class TCheckLaws extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 唯一标识id */
+    private Long id;
+
+    /** 法规编号 */
+    @Excel(name = "法规编号")
+    private String code;
+
+    /** 法规名称 */
+    @Excel(name = "法规名称")
+    private String name;
+
+    /** 法规类型 */
+    @Excel(name = "法规类型")
+    private String type;
+
+    /** 匹配状态 */
+    @Excel(name = "匹配状态")
+    private String status;
+
+    /** 匹配开始时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "匹配开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date starttime;
+
+    /** 备注 */
+    @Excel(name = "备注")
+    private String remarks;
+
+    /** 部门编号 */
+    private Long deptId;
+
+    /** 状态 1 :正常 ;0:删除 */
+    private Integer delFlag;
+
+    /** 创建人 */
+    private Long createrCode;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date createdate;
+
+    /** 维护人 */
+
+    private Long updaterCode;
+    @Excel(name = "维护人")
+    private String updater;
+
+    /** 维护时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "维护时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date updatedate;
+
+    public String getUpdater() {
+        return updater;
+    }
+
+    public void setUpdater(String updater) {
+        this.updater = updater;
+    }
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setCode(String code)
+    {
+        this.code = code;
+    }
+
+    public String getCode()
+    {
+        return code;
+    }
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+    public void setType(String type)
+    {
+        this.type = type;
+    }
+
+    public String getType()
+    {
+        return type;
+    }
+    public void setStatus(String status)
+    {
+        this.status = status;
+    }
+
+    public String getStatus()
+    {
+        return status;
+    }
+    public void setStarttime(Date starttime)
+    {
+        this.starttime = starttime;
+    }
+
+    public Date getStarttime()
+    {
+        return starttime;
+    }
+    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("code", getCode())
+            .append("name", getName())
+            .append("type", getType())
+            .append("status", getStatus())
+            .append("starttime", getStarttime())
+            .append("remarks", getRemarks())
+            .append("deptId", getDeptId())
+            .append("delFlag", getDelFlag())
+            .append("createrCode", getCreaterCode())
+            .append("createdate", getCreatedate())
+            .append("updaterCode", getUpdaterCode())
+            .append("updatedate", getUpdatedate())
+            .toString();
+    }
+}

+ 62 - 0
master/src/main/java/com/ruoyi/project/check/mapper/TCheckLawitemsMapper.java

@@ -0,0 +1,62 @@
+package com.ruoyi.project.check.mapper;
+
+import java.util.List;
+import com.ruoyi.project.check.domain.TCheckLawitems;
+
+/**
+ * 法规项Mapper接口
+ *
+ * @author ruoyi
+ * @date 2022-11-28
+ */
+public interface TCheckLawitemsMapper
+{
+    /**
+     * 查询法规项
+     *
+     * @param id 法规项主键
+     * @return 法规项
+     */
+    public TCheckLawitems selectTCheckLawitemsById(Long id);
+
+    /**
+     * 查询法规项列表
+     *
+     * @param tCheckLawitems 法规项
+     * @return 法规项集合
+     */
+    public List<TCheckLawitems> selectTCheckLawitemsList(TCheckLawitems tCheckLawitems);
+
+    /**
+     * 新增法规项
+     *
+     * @param tCheckLawitems 法规项
+     * @return 结果
+     */
+    public int insertTCheckLawitems(TCheckLawitems tCheckLawitems);
+    public int insertTCheckLawitemsByList(List<TCheckLawitems> tCheckLawitems);
+
+    /**
+     * 修改法规项
+     *
+     * @param tCheckLawitems 法规项
+     * @return 结果
+     */
+    public int updateTCheckLawitems(TCheckLawitems tCheckLawitems);
+
+    /**
+     * 删除法规项
+     *
+     * @param id 法规项主键
+     * @return 结果
+     */
+    public int deleteTCheckLawitemsById(Long id);
+
+    /**
+     * 批量删除法规项
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTCheckLawitemsByIds(Long[] ids);
+}

+ 62 - 0
master/src/main/java/com/ruoyi/project/check/mapper/TCheckLawsMapper.java

@@ -0,0 +1,62 @@
+package com.ruoyi.project.check.mapper;
+
+import java.util.List;
+import com.ruoyi.project.check.domain.TCheckLaws;
+
+/**
+ * 法规Mapper接口
+ *
+ * @author ruoyi
+ * @date 2022-11-28
+ */
+public interface TCheckLawsMapper
+{
+    /**
+     * 查询法规
+     *
+     * @param id 法规主键
+     * @return 法规
+     */
+    public TCheckLaws selectTCheckLawsById(Long id);
+
+    /**
+     * 查询法规列表
+     *
+     * @param tCheckLaws 法规
+     * @return 法规集合
+     */
+    public List<TCheckLaws> selectTCheckLawsList(TCheckLaws tCheckLaws);
+
+    /**
+     * 新增法规
+     *
+     * @param tCheckLaws 法规
+     * @return 结果
+     */
+    public int insertTCheckLaws(TCheckLaws tCheckLaws);
+
+    /**
+     * 修改法规
+     *
+     * @param tCheckLaws 法规
+     * @return 结果
+     */
+    public int updateTCheckLaws(TCheckLaws tCheckLaws);
+    public int updateTCheckLawsStatus(TCheckLaws tCheckLaws);
+
+    /**
+     * 删除法规
+     *
+     * @param id 法规主键
+     * @return 结果
+     */
+    public int deleteTCheckLawsById(Long id);
+
+    /**
+     * 批量删除法规
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTCheckLawsByIds(Long[] ids);
+}

+ 62 - 0
master/src/main/java/com/ruoyi/project/check/service/ITCheckLawitemsService.java

@@ -0,0 +1,62 @@
+package com.ruoyi.project.check.service;
+
+import java.util.List;
+import com.ruoyi.project.check.domain.TCheckLawitems;
+
+/**
+ * 法规项Service接口
+ *
+ * @author ruoyi
+ * @date 2022-11-28
+ */
+public interface ITCheckLawitemsService
+{
+    /**
+     * 查询法规项
+     *
+     * @param id 法规项主键
+     * @return 法规项
+     */
+    public TCheckLawitems selectTCheckLawitemsById(Long id);
+
+    /**
+     * 查询法规项列表
+     *
+     * @param tCheckLawitems 法规项
+     * @return 法规项集合
+     */
+    public List<TCheckLawitems> selectTCheckLawitemsList(TCheckLawitems tCheckLawitems);
+
+    /**
+     * 新增法规项
+     *
+     * @param tCheckLawitems 法规项
+     * @return 结果
+     */
+    public int insertTCheckLawitems(TCheckLawitems tCheckLawitems);
+    public int insertTCheckLawitemsByList(List<TCheckLawitems> tCheckLawitems);
+
+    /**
+     * 修改法规项
+     *
+     * @param tCheckLawitems 法规项
+     * @return 结果
+     */
+    public int updateTCheckLawitems(TCheckLawitems tCheckLawitems);
+
+    /**
+     * 批量删除法规项
+     *
+     * @param ids 需要删除的法规项主键集合
+     * @return 结果
+     */
+    public int deleteTCheckLawitemsByIds(Long[] ids);
+
+    /**
+     * 删除法规项信息
+     *
+     * @param id 法规项主键
+     * @return 结果
+     */
+    public int deleteTCheckLawitemsById(Long id);
+}

+ 62 - 0
master/src/main/java/com/ruoyi/project/check/service/ITCheckLawsService.java

@@ -0,0 +1,62 @@
+package com.ruoyi.project.check.service;
+
+import java.util.List;
+import com.ruoyi.project.check.domain.TCheckLaws;
+
+/**
+ * 法规Service接口
+ *
+ * @author ruoyi
+ * @date 2022-11-28
+ */
+public interface ITCheckLawsService
+{
+    /**
+     * 查询法规
+     *
+     * @param id 法规主键
+     * @return 法规
+     */
+    public TCheckLaws selectTCheckLawsById(Long id);
+
+    /**
+     * 查询法规列表
+     *
+     * @param tCheckLaws 法规
+     * @return 法规集合
+     */
+    public List<TCheckLaws> selectTCheckLawsList(TCheckLaws tCheckLaws);
+
+    /**
+     * 新增法规
+     *
+     * @param tCheckLaws 法规
+     * @return 结果
+     */
+    public int insertTCheckLaws(TCheckLaws tCheckLaws);
+
+    /**
+     * 修改法规
+     *
+     * @param tCheckLaws 法规
+     * @return 结果
+     */
+    public int updateTCheckLaws(TCheckLaws tCheckLaws);
+    public int updateTCheckLawsStatus(TCheckLaws tCheckLaws);
+
+    /**
+     * 批量删除法规
+     *
+     * @param ids 需要删除的法规主键集合
+     * @return 结果
+     */
+    public int deleteTCheckLawsByIds(Long[] ids);
+
+    /**
+     * 删除法规信息
+     *
+     * @param id 法规主键
+     * @return 结果
+     */
+    public int deleteTCheckLawsById(Long id);
+}

+ 105 - 0
master/src/main/java/com/ruoyi/project/check/service/impl/TCheckLawitemsServiceImpl.java

@@ -0,0 +1,105 @@
+package com.ruoyi.project.check.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.project.check.mapper.TCheckLawitemsMapper;
+import com.ruoyi.project.check.domain.TCheckLawitems;
+import com.ruoyi.project.check.service.ITCheckLawitemsService;
+
+/**
+ * 法规项Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2022-11-28
+ */
+@Service
+public class TCheckLawitemsServiceImpl implements ITCheckLawitemsService
+{
+    @Autowired
+    private TCheckLawitemsMapper tCheckLawitemsMapper;
+
+    /**
+     * 查询法规项
+     *
+     * @param id 法规项主键
+     * @return 法规项
+     */
+    @Override
+    public TCheckLawitems selectTCheckLawitemsById(Long id)
+    {
+        return tCheckLawitemsMapper.selectTCheckLawitemsById(id);
+    }
+
+    /**
+     * 查询法规项列表
+     *
+     * @param tCheckLawitems 法规项
+     * @return 法规项
+     */
+    @Override
+    public List<TCheckLawitems> selectTCheckLawitemsList(TCheckLawitems tCheckLawitems)
+    {
+        return tCheckLawitemsMapper.selectTCheckLawitemsList(tCheckLawitems);
+    }
+
+    /**
+     * 新增法规项
+     *
+     * @param tCheckLawitems 法规项
+     * @return 结果
+     */
+    @Override
+    public int insertTCheckLawitems(TCheckLawitems tCheckLawitems)
+    {
+        return tCheckLawitemsMapper.insertTCheckLawitems(tCheckLawitems);
+    }
+
+    /**
+     * 新增法规项
+     *
+     * @param tCheckLawitems 法规项列表
+     * @return 结果
+     */
+    @Override
+    public int insertTCheckLawitemsByList(List<TCheckLawitems> tCheckLawitems)
+    {
+        return tCheckLawitemsMapper.insertTCheckLawitemsByList(tCheckLawitems);
+    }
+
+    /**
+     * 修改法规项
+     *
+     * @param tCheckLawitems 法规项
+     * @return 结果
+     */
+    @Override
+    public int updateTCheckLawitems(TCheckLawitems tCheckLawitems)
+    {
+        return tCheckLawitemsMapper.updateTCheckLawitems(tCheckLawitems);
+    }
+
+    /**
+     * 批量删除法规项
+     *
+     * @param ids 需要删除的法规项主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTCheckLawitemsByIds(Long[] ids)
+    {
+        return tCheckLawitemsMapper.deleteTCheckLawitemsByIds(ids);
+    }
+
+    /**
+     * 删除法规项信息
+     *
+     * @param id 法规项主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTCheckLawitemsById(Long id)
+    {
+        return tCheckLawitemsMapper.deleteTCheckLawitemsById(id);
+    }
+}

+ 98 - 0
master/src/main/java/com/ruoyi/project/check/service/impl/TCheckLawsServiceImpl.java

@@ -0,0 +1,98 @@
+package com.ruoyi.project.check.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.project.check.mapper.TCheckLawsMapper;
+import com.ruoyi.project.check.domain.TCheckLaws;
+import com.ruoyi.project.check.service.ITCheckLawsService;
+
+/**
+ * 法规Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2022-11-28
+ */
+@Service
+public class TCheckLawsServiceImpl implements ITCheckLawsService
+{
+    @Autowired
+    private TCheckLawsMapper tCheckLawsMapper;
+
+    /**
+     * 查询法规
+     *
+     * @param id 法规主键
+     * @return 法规
+     */
+    @Override
+    public TCheckLaws selectTCheckLawsById(Long id)
+    {
+        return tCheckLawsMapper.selectTCheckLawsById(id);
+    }
+
+    /**
+     * 查询法规列表
+     *
+     * @param tCheckLaws 法规
+     * @return 法规
+     */
+    @Override
+    public List<TCheckLaws> selectTCheckLawsList(TCheckLaws tCheckLaws)
+    {
+        return tCheckLawsMapper.selectTCheckLawsList(tCheckLaws);
+    }
+
+    /**
+     * 新增法规
+     *
+     * @param tCheckLaws 法规
+     * @return 结果
+     */
+    @Override
+    public int insertTCheckLaws(TCheckLaws tCheckLaws)
+    {
+        return tCheckLawsMapper.insertTCheckLaws(tCheckLaws);
+    }
+
+    /**
+     * 修改法规
+     *
+     * @param tCheckLaws 法规
+     * @return 结果
+     */
+    @Override
+    public int updateTCheckLaws(TCheckLaws tCheckLaws)
+    {
+        return tCheckLawsMapper.updateTCheckLaws(tCheckLaws);
+    }
+    @Override
+    public int updateTCheckLawsStatus(TCheckLaws tCheckLaws)
+    {
+        return tCheckLawsMapper.updateTCheckLawsStatus(tCheckLaws);
+    }
+
+    /**
+     * 批量删除法规
+     *
+     * @param ids 需要删除的法规主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTCheckLawsByIds(Long[] ids)
+    {
+        return tCheckLawsMapper.deleteTCheckLawsByIds(ids);
+    }
+
+    /**
+     * 删除法规信息
+     *
+     * @param id 法规主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTCheckLawsById(Long id)
+    {
+        return tCheckLawsMapper.deleteTCheckLawsById(id);
+    }
+}

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

@@ -6,7 +6,7 @@ spring:
         druid:
             # 主库数据源
             master:
-                url: jdbc:mysql://43.143.92.79:3306/ldar?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                url: jdbc:mysql://43.143.92.79:3306/ldar?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true
                 username: root
                 password: Ssy666666!
             # 从库数据源

+ 189 - 0
master/src/main/resources/mybatis/check/TCheckLawitemsMapper.xml

@@ -0,0 +1,189 @@
+<?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.check.mapper.TCheckLawitemsMapper">
+
+    <resultMap type="TCheckLawitems" id="TCheckLawitemsResult">
+        <result property="id" column="id"/>
+        <result property="lawId" column="law_id"/>
+        <result property="plantType" column="plant_type"/>
+        <result property="pointType" column="point_type"/>
+        <result property="mediumType" column="medium_type"/>
+        <result property="general" column="general"/>
+        <result property="serious" column="serious"/>
+        <result property="detectionFrequency" column="detection_frequency"/>
+        <result property="stratFix" column="strat_fix"/>
+        <result property="endFix" column="end_fix"/>
+        <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"/>
+    </resultMap>
+
+    <sql id="selectTCheckLawitemsVo">
+        select id,
+               law_id,
+               plant_type,
+               point_type,
+               medium_type,
+               `general`,
+               serious,
+               detection_frequency,
+               strat_fix,
+               end_fix,
+               remarks,
+               dept_id,
+               del_flag,
+               creater_code,
+               createdate,
+               updater_code,
+               updatedate
+        from t_check_lawitems
+    </sql>
+
+    <select id="selectTCheckLawitemsList" parameterType="TCheckLawitems" resultMap="TCheckLawitemsResult">
+        <include refid="selectTCheckLawitemsVo"/>
+        <where>
+            <if test="lawId != null  and lawId != ''">and law_id = #{lawId}</if>
+            <if test="plantType != null  and plantType != ''">and plant_type = #{plantType}</if>
+            <if test="pointType != null  and pointType != ''">and point_type = #{pointType}</if>
+            <if test="mediumType != null  and mediumType != ''">and medium_type = #{mediumType}</if>
+            <if test="general != null  and general != ''">and general = #{general}</if>
+            <if test="serious != null  and serious != ''">and serious = #{serious}</if>
+            <if test="detectionFrequency != null  and detectionFrequency != ''">and detection_frequency =
+                #{detectionFrequency}
+            </if>
+            <if test="stratFix != null  and stratFix != ''">and strat_fix = #{stratFix}</if>
+            <if test="endFix != null  and endFix != ''">and end_fix = #{endFix}</if>
+            <if test="remarks != null  and remarks != ''">and remarks = #{remarks}</if>
+            <if test="deptId != null ">and dept_id = #{deptId}</if>
+            <if test="createrCode != null ">and creater_code = #{createrCode}</if>
+            <if test="createdate != null ">and createdate = #{createdate}</if>
+            <if test="updaterCode != null ">and updater_code = #{updaterCode}</if>
+            <if test="updatedate != null ">and updatedate = #{updatedate}</if>
+            and del_flag = 0
+        </where>
+    </select>
+
+    <select id="selectTCheckLawitemsById" parameterType="Long" resultMap="TCheckLawitemsResult">
+        <include refid="selectTCheckLawitemsVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertTCheckLawitems" parameterType="TCheckLawitems" useGeneratedKeys="true" keyProperty="id">
+        insert into t_check_lawitems
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="lawId != null">law_id,</if>
+            <if test="plantType != null">plant_type,</if>
+            <if test="pointType != null">point_type,</if>
+            <if test="mediumType != null">medium_type,</if>
+            <if test="general != null">`general`,</if>
+            <if test="serious != null">serious,</if>
+            <if test="detectionFrequency != null">detection_frequency,</if>
+            <if test="stratFix != null">strat_fix,</if>
+            <if test="endFix != null">end_fix,</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="lawId != null">#{lawId},</if>
+            <if test="plantType != null">#{plantType},</if>
+            <if test="pointType != null">#{pointType},</if>
+            <if test="mediumType != null">#{mediumType},</if>
+            <if test="general != null">#{general},</if>
+            <if test="serious != null">#{serious},</if>
+            <if test="detectionFrequency != null">#{detectionFrequency},</if>
+            <if test="stratFix != null">#{stratFix},</if>
+            <if test="endFix != null">#{endFix},</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>
+
+    <insert id="insertTCheckLawitemsByList" parameterType="java.util.List" useGeneratedKeys="true">
+        insert into t_check_lawitems
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            law_id,
+            plant_type,
+            point_type,
+            medium_type,
+            `general`,
+            serious,
+            detection_frequency,
+            strat_fix,
+            end_fix,
+            creater_code,
+            createdate,
+            updater_code,
+            updatedate,
+        </trim>
+        values
+        <foreach collection="list" index="index" separator="," item="item">
+            <trim prefix="(" suffix=")" suffixOverrides=",">
+                #{item.lawId},
+                #{item.plantType},
+                #{item.pointType},
+                #{item.mediumType},
+                #{item.general},
+                #{item.serious},
+                #{item.detectionFrequency},
+                #{item.stratFix},
+                #{item.endFix},
+                #{item.createrCode},
+                #{item.createdate},
+                #{item.updaterCode},
+                #{item.updatedate},
+            </trim>
+        </foreach>
+    </insert>
+
+    <update id="updateTCheckLawitems" parameterType="TCheckLawitems">
+        update t_check_lawitems
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="lawId != null">law_id = #{lawId},</if>
+            <if test="plantType != null">plant_type = #{plantType},</if>
+            <if test="pointType != null">point_type = #{pointType},</if>
+            <if test="mediumType != null">medium_type = #{mediumType},</if>
+            <if test="general != null">`general` = #{general},</if>
+            <if test="serious != null">serious = #{serious},</if>
+            <if test="detectionFrequency != null">detection_frequency = #{detectionFrequency},</if>
+            <if test="stratFix != null">strat_fix = #{stratFix},</if>
+            <if test="endFix != null">end_fix = #{endFix},</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="deleteTCheckLawitemsById" parameterType="Long">
+        update t_check_lawitems
+        set del_flag=1
+        where id = #{id}
+    </delete>
+
+    <delete id="deleteTCheckLawitemsByIds" parameterType="String">
+        update t_check_lawitems set del_flag=1 where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 122 - 0
master/src/main/resources/mybatis/check/TCheckLawsMapper.xml

@@ -0,0 +1,122 @@
+<?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.check.mapper.TCheckLawsMapper">
+
+    <resultMap type="TCheckLaws" id="TCheckLawsResult">
+        <result property="id"    column="id"    />
+        <result property="code"    column="code"    />
+        <result property="name"    column="name"    />
+        <result property="type"    column="type"    />
+        <result property="status"    column="status"    />
+        <result property="starttime"    column="starttime"    />
+        <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"    />
+    </resultMap>
+
+    <sql id="selectTCheckLawsVo">
+        select id, code, name, type, status, starttime, remarks, dept_id, del_flag, creater_code, createdate, updater_code, updatedate from t_check_laws
+    </sql>
+
+    <select id="selectTCheckLawsList" parameterType="TCheckLaws" resultMap="TCheckLawsResult">
+        select id, code, name, type, d.status, starttime, remarks, d.dept_id, d.del_flag, creater_code, createdate, updater_code , updatedate,su.user_name updater from t_check_laws d
+        left join sys_user su on su.user_id=d.updater_code
+        <where>
+            <if test="code != null  and code != ''"> and code = #{code}</if>
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="type != null  and type != ''"> and type = #{type}</if>
+            <if test="status != null  and status != ''"> and d.status = #{status}</if>
+            <if test="starttime != null "> and starttime = #{starttime}</if>
+            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
+            <if test="deptId != null "> and d.dept_id = #{deptId}</if>
+            <if test="createrCode != null "> and creater_code = #{createrCode}</if>
+            <if test="createdate != null "> and createdate = #{createdate}</if>
+            <if test="updaterCode != null "> and updater_code = #{updaterCode}</if>
+            <if test="updatedate != null "> and updatedate = #{updatedate}</if>
+        and d.del_flag = 0
+        </where>
+    </select>
+
+    <select id="selectTCheckLawsById" parameterType="Long" resultMap="TCheckLawsResult">
+        <include refid="selectTCheckLawsVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertTCheckLaws" parameterType="TCheckLaws" useGeneratedKeys="true" keyProperty="id">
+        insert into t_check_laws
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="code != null">code,</if>
+            <if test="name != null">name,</if>
+            <if test="type != null">type,</if>
+            <if test="status != null">status,</if>
+            <if test="starttime != null">starttime,</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="code != null">#{code},</if>
+            <if test="name != null">#{name},</if>
+            <if test="type != null">#{type},</if>
+            <if test="status != null">#{status},</if>
+            <if test="starttime != null">#{starttime},</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="updateTCheckLaws" parameterType="TCheckLaws">
+        update t_check_laws
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="code != null">code = #{code},</if>
+            <if test="name != null">name = #{name},</if>
+            <if test="type != null">type = #{type},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="starttime != null">starttime = #{starttime},</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>
+
+    <update id="updateTCheckLawsStatus" parameterType="TCheckLaws">
+        update t_check_laws
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="status != null">status = #{status},</if>
+            <if test="starttime != null">starttime = #{starttime},</if>
+        </trim>
+        where id = #{id};
+        update t_check_laws set `starttime` = null ,`status`=0   where id!=#{id};
+    </update>
+
+    <delete id="deleteTCheckLawsById" parameterType="Long">
+        update t_check_laws set del_flag=1 where id = #{id}
+    </delete>
+
+    <delete id="deleteTCheckLawsByIds" parameterType="String">
+        update t_check_laws set del_flag=1 where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 44 - 0
ui/src/api/check/lawitems.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询法规项列表
+export function listLawitems(query) {
+  return request({
+    url: '/check/lawitems/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询法规项详细
+export function getLawitems(id) {
+  return request({
+    url: '/check/lawitems/' + id,
+    method: 'get'
+  })
+}
+
+// 新增法规项
+export function addLawitems(data) {
+  return request({
+    url: '/check/lawitems',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改法规项
+export function updateLawitems(data) {
+  return request({
+    url: '/check/lawitems',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除法规项
+export function delLawitems(id) {
+  return request({
+    url: '/check/lawitems/' + id,
+    method: 'delete'
+  })
+}

+ 51 - 0
ui/src/api/check/laws.js

@@ -0,0 +1,51 @@
+import request from '@/utils/request'
+
+// 查询法规列表
+export function listLaws(query) {
+  return request({
+    url: '/check/laws/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询法规详细
+export function getLaws(id) {
+  return request({
+    url: '/check/laws/' + id,
+    method: 'get'
+  })
+}
+
+// 新增法规
+export function addLaws(data) {
+  return request({
+    url: '/check/laws',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改法规
+export function updateLaws(data) {
+  return request({
+    url: '/check/laws',
+    method: 'put',
+    data: data
+  })
+}
+export function matchLaws(data) {
+  return request({
+    url: '/check/laws/matchLaws',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除法规
+export function delLaws(id) {
+  return request({
+    url: '/check/laws/' + id,
+    method: 'delete'
+  })
+}

+ 1 - 1
ui/src/components/Pagination/index.vue

@@ -36,7 +36,7 @@ export default {
     pageSizes: {
       type: Array,
       default() {
-        return [10, 20, 30, 50]
+        return [10, 50, 100, 500]
       }
     },
     // 移动端页码按钮的数量端默认值5

+ 1 - 1
ui/src/views/base/region/index.vue

@@ -325,7 +325,7 @@ export default {
       this.reset();
       const id = row.id || this.ids
       if (row.approveStatus != 0) {
-        MessageBox.alert('已送审/已审核的数据不可删除!', '注意!', {
+        MessageBox.alert('已送审/已审核的数据不可修改!', '注意!', {
           confirmButtonText: '确定',
         })
         return;

+ 430 - 0
ui/src/views/check/lawitems/index.vue

@@ -0,0 +1,430 @@
+<template>
+  <el-dialog title="法规项" append-to-body :visible.sync="visible" width="1600px">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="装置类别" prop="plantType">
+        <el-select v-model="queryParams.plantType" @change="handleQuery" placeholder="请选择装置类别" clearable
+                   size="small">
+          <el-option
+            v-for="dict in plantTypeOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="密封点类型" prop="pointType" label-width="80">
+        <el-select v-model="queryParams.pointType" @change="handleQuery" placeholder="请选择密封点类型" clearable
+                   size="small">
+          <el-option
+            v-for="dict in pointOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="介质状态" prop="mediumType">
+        <el-select v-model="queryParams.mediumType" @change="handleQuery" placeholder="请选择介质状态" clearable size="small"
+                   style="width: 100%">
+          <el-option
+            v-for="dict in mediumTypeOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['check:lawitems: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="['check:lawitems: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="['check:lawitems:remove']"
+        >删除
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['check:lawitems:export']"
+        >导出
+        </el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="lawitemsList" @selection-change="handleSelectionChange" :height="clientHeight"
+              border>
+      <el-table-column type="selection" width="55" align="center" fixed="left"/>
+      <el-table-column label="装置类型" align="center" prop="plantType" :show-overflow-tooltip="true" width="130"
+                       :formatter="plantTypeFormat"/>
+      <el-table-column label="密封点类型" align="center" prop="pointType" :show-overflow-tooltip="true" width="130"
+                       :formatter="pointFormat"/>
+      <el-table-column label="介质状态" align="center" prop="mediumType" :show-overflow-tooltip="true" width="130"
+                       :formatter="mediumTypeFormat"/>
+      <el-table-column label="一般泄露标准(ppm)" align="center" prop="general" :show-overflow-tooltip="true" width="140"/>
+      <el-table-column label="严重泄漏标准(ppm)" align="center" prop="serious" :show-overflow-tooltip="true" width="140"/>
+      <el-table-column label="监测频次" align="center" prop="detectionFrequency" :show-overflow-tooltip="true"
+                       width="130" :formatter="detectionFormat"/>
+      <el-table-column label="首次维修时限(天)" align="center" prop="stratFix" :show-overflow-tooltip="true" width="130"/>
+      <el-table-column label="最终维修时限(天)" align="center" prop="endFix" :show-overflow-tooltip="true" width="130"/>
+      <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true" width="130"/>
+      <el-table-column label="维护人" align="center" prop="updaterCode" :show-overflow-tooltip="true" width="130"/>
+      <el-table-column label="维护时间" align="center" prop="updatedate" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="130" fixed="right">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['check:lawitems:edit']"
+          >修改
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['check:lawitems: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="800px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="140px">
+        <el-form-item label="装置类别" prop="plantType">
+          <el-select v-model="form.plantType" placeholder="请选择装置类别" clearable size="small" style="width: 100%">
+            <el-option
+              v-for="dict in plantTypeOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="密封点类型" prop="pointType">
+          <el-select v-model="form.pointType" placeholder="请选择密封点类型" clearable size="small" style="width: 100%">
+            <el-option
+              v-for="dict in pointOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="介质状态" prop="mediumType">
+          <el-select v-model="form.mediumType" placeholder="请选择介质状态" clearable size="small" style="width: 100%">
+            <el-option
+              v-for="dict in mediumTypeOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="一般泄露标准(ppm)" prop="general">
+          <el-input v-model="form.general" placeholder="请输入一般泄露标准"/>
+        </el-form-item>
+        <el-form-item label="严重泄漏标准(ppm)" prop="serious">
+          <el-input v-model="form.serious" placeholder="请输入严重泄漏标准"/>
+        </el-form-item>
+        <el-form-item label="监测频次" prop="detectionFrequency">
+          <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 detectionFrequencyOptions"
+                :key="dict.dictValue"
+                :label="dict.dictLabel"
+                :value="dict.dictValue"
+              />
+            </el-select>
+          </el-form-item>
+        </el-form-item>
+        <el-form-item label="首次维修时限(天)" prop="stratFix">
+          <el-input v-model="form.stratFix" placeholder="请输入首次维修时限"/>
+        </el-form-item>
+        <el-form-item label="最终维修时限(天)" prop="endFix">
+          <el-input v-model="form.endFix" 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" :disabled="disabledBotton">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </el-dialog>
+</template>
+
+<script>
+import {listLawitems, getLawitems, delLawitems, addLawitems, updateLawitems} from "@/api/check/lawitems";
+
+export default {
+  name: "Lawitems",
+  data() {
+    return {
+      disabledBotton:false,
+      plantTypeOptions: [],
+      pointOptions: [],
+      mediumTypeOptions: [],
+      detectionFrequencyOptions: [],
+      visible: false,
+      // 页面高度
+      clientHeight: 600,
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      row: {},
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: false,
+      // 总条数
+      total: 0,
+      // 法规项表格数据
+      lawitemsList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        lawId: null,
+        pageNum: 1,
+        pageSize: 10,
+        plantType: null,
+        pointType: null,
+        mediumType: null,
+        general: null,
+        serious: null,
+        detectionFrequency: null,
+        stratFix: null,
+        endFix: null,
+        remarks: null,
+        deptId: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        plantType: [
+          {required: true, message: '请选择装置类型', trigger: "blur"}
+        ],
+        pointType: [
+          {required: true, message: '请选择密封点类型', trigger: "blur"}
+        ],
+        mediumType: [
+          {required: true, message: '请选择介质状态', trigger: "blur"}
+        ],
+      }
+    };
+  },
+  created() {
+  },
+  methods: {
+    init(row) {
+      this.lawitemsList = [];
+      this.row = row
+      this.visible = true
+      this.queryParams.lawId = row.id
+      this.getList();
+      this.getDicts("plant_type").then(response => {
+        this.plantTypeOptions = response.data;
+      });
+      this.getDicts("point_type").then(response => {
+        this.pointOptions = response.data;
+      });
+      this.getDicts("medium_type").then(response => {
+        this.mediumTypeOptions = response.data;
+      });
+      this.getDicts("detection_frequency").then(response => {
+        this.detectionFrequencyOptions = response.data;
+      });
+    },
+    plantTypeFormat(row, column) {
+      return this.selectDictLabel(this.plantTypeOptions, row.plantType);
+    },
+    detectionFormat(row, column) {
+      return this.selectDictLabel(this.detectionFrequencyOptions, row.detectionFrequency);
+    },
+    pointFormat(row, column) {
+      return this.selectDictLabel(this.pointOptions, row.pointType);
+    },
+    mediumTypeFormat(row, column) {
+      return this.selectDictLabel(this.mediumTypeOptions, row.mediumType);
+    },
+    /** 查询法规项列表 */
+    getList() {
+      this.loading = true;
+      listLawitems(this.queryParams).then(response => {
+        this.lawitemsList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        plantType: null,
+        pointType: null,
+        mediumType: null,
+        general: null,
+        serious: null,
+        detectionFrequency: null,
+        stratFix: null,
+        endFix: null,
+        remarks: null,
+        deptId: null,
+        delFlag: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        lawId: 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.disabledBotton=false
+      this.reset();
+      this.open = true;
+      this.title = "添加法规项";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.disabledBotton=false
+      this.reset();
+      const id = row.id || this.ids
+      getLawitems(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改法规项";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.disabledBotton=true
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          this.form.lawId = this.row.id
+          if (this.form.id != null) {
+            updateLawitems(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addLawitems(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 delLawitems(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('check/lawitems/export', {
+        ...this.queryParams
+      }, `lawitems_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>

+ 388 - 0
ui/src/views/check/laws/index.vue

@@ -0,0 +1,388 @@
+<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="name">
+        <el-input
+          v-model="queryParams.name"
+          placeholder="请输入法规名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['check:laws: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="['check:laws: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="['check:laws:remove']"
+        >删除
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['check:laws:export']"
+        >导出
+        </el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="lawsList" @selection-change="handleSelectionChange" :height="clientHeight"
+              border>
+      <el-table-column type="selection" width="55" align="center"/>
+      <el-table-column label="法规编号" align="center" prop="code" :show-overflow-tooltip="true"/>
+      <el-table-column label="法规名称" align="center" prop="name" :show-overflow-tooltip="true"/>
+      <el-table-column label="法规类型" align="center" prop="type" :show-overflow-tooltip="true"/>
+      <el-table-column label="匹配状态" align="center" prop="status" :formatter="matchStatusFormat"/>
+      <el-table-column label="匹配开始时间" align="center" prop="starttime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.starttime) }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="备注" align="center" prop="remarks"/>
+      <el-table-column label="维护人" align="center" prop="updater"/>
+      <el-table-column label="维护时间" align="center" prop="updatedate" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-connection"
+            @click="handleMatch(scope.row)"
+            v-hasPermi="['check:laws:edit']"
+          >匹配
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['check:laws:edit']"
+          >修改
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['check:laws:remove']"
+          >删除
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-connection"
+            @click="getLawItems(scope.row)"
+            v-hasPermi="['check:laws:edit']"
+          >法规项
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改法规对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="法规编号" prop="code">
+          <el-input v-model="form.code" placeholder="请输入法规编号"/>
+        </el-form-item>
+        <el-form-item label="法规名称" prop="name">
+          <el-input v-model="form.name" placeholder="请输入法规名称"/>
+        </el-form-item>
+        <el-form-item label="法规类型" prop="type">
+          <el-input v-model="form.type" 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>
+    <lawitems v-if="itemsVisible" ref="itemsList"></lawitems>
+  </div>
+</template>
+
+<script>
+import {addLaws, delLaws, getLaws, listLaws, matchLaws, updateLaws} from "@/api/check/laws";
+import {MessageBox} from "element-ui";
+import Lawitems from "@/views/check/lawitems";
+
+export default {
+  name: "Laws",
+  components: {Lawitems},
+  data() {
+    return {
+      itemsVisible: false,
+      matchOperation: [],
+      // 页面高度
+      clientHeight: 300,
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      status: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: false,
+      // 总条数
+      total: 0,
+      // 法规表格数据
+      lawsList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        code: null,
+        name: null,
+        type: null,
+        status: null,
+        starttime: null,
+        remarks: null,
+        deptId: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        code: [
+          {required: true, message: '法规编码不能为空', trigger: "blur"}
+        ],
+        name: [
+          {required: true, message: '法规名称不能为空', trigger: "blur"}
+        ],
+        type: [
+          {required: true, message: '法规类型不能为空', trigger: "blur"}
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+    //设置表格高度对应屏幕高度
+    this.$nextTick(() => {
+      this.clientHeight = (document.body.clientHeight - 80) * 0.8
+    });
+    this.getDicts("match_status").then(response => {
+      this.matchOperation = response.data;
+    })
+  },
+  methods: {
+    getLawItems(row){
+      this.itemsVisible = true;
+      this.$nextTick(() => {
+        this.$refs.itemsList.init(row)
+
+      })
+    },
+    matchStatusFormat(row, column) {
+      return this.selectDictLabel(this.matchOperation, row.status);
+    },
+    /** 查询法规列表 */
+    getList() {
+      this.loading = true;
+      listLaws(this.queryParams).then(response => {
+        this.lawsList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        code: null,
+        name: null,
+        type: null,
+        status: "0",
+        starttime: 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.status = selection.map(item => item.status)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加法规";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      if (row.status==1){
+        MessageBox.alert('匹配中的法规不可修改!', '注意!', {
+          confirmButtonText: '确定',
+        })
+        return;
+      }
+      this.reset();
+      const id = row.id || this.ids
+      getLaws(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改法规";
+      });
+    },
+    handleMatch(row) {
+      if (row.status==1){
+        MessageBox.alert('当前已匹配此法规!', '注意!', {
+          confirmButtonText: '确定',
+        })
+        return;
+      }
+      this.reset();
+      this.$modal.confirm('确认匹配此法规?').then(function () {
+        return matchLaws({status:"1",id:row.id});
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("匹配成功");
+      }).catch(() => {
+        this.$modal.msg("取消匹配");
+      });
+
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateLaws(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addLaws(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      if(row.status===undefined){
+        for (let i = 0; i < this.status.length; i++) {
+          if (this.status[i] ==1) {
+            MessageBox.alert('匹配中的法规不可删除!', '注意!', {
+              confirmButtonText: '确定',
+            })
+            return
+          }
+        }
+      }else if (row.status==1){
+        MessageBox.alert('匹配中的数据不可删除!', '注意!', {
+          confirmButtonText: '确定',
+        })
+        return
+      }
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除数据项?').then(function () {
+        return delLaws(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('check/laws/export', {
+        ...this.queryParams
+      }, `laws_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>

+ 2 - 2
ui/src/views/check/record/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-dialog title="仪器维护记录" append-to-body :visible.sync="visible">
+  <el-dialog title="仪器维护记录" append-to-body :visible.sync="visible" width="1600px">
 
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
@@ -129,7 +129,7 @@ export default {
       instrumentList:[],
       visible: false,
       // 页面高度
-      clientHeight:300,
+      clientHeight:600,
       // 遮罩层
       loading: true,
       // 选中数组