Parcourir la source

+ 巡检报告

chen.cheng il y a 11 mois
Parent
commit
515e8cdfb3

+ 105 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/AdmOpInspectionReportController.java

@@ -0,0 +1,105 @@
+package com.ruoyi.ems.controller;
+
+import java.util.List;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+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.log.annotation.Log;
+import com.ruoyi.common.log.enums.BusinessType;
+import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.ruoyi.ems.domain.AdmOpInspectionReport;
+import com.ruoyi.ems.service.IAdmOpInspectionReportService;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+
+/**
+ * 巡检报告Controller
+ *
+ * @author ruoyi
+ * @date 2024-08-29
+ */
+@RestController
+@RequestMapping("/inspectionReport")
+public class AdmOpInspectionReportController extends BaseController
+{
+    @Autowired
+    private IAdmOpInspectionReportService admOpInspectionReportService;
+
+    /**
+     * 查询巡检报告列表
+     */
+    @RequiresPermissions("ems:inspection-report:list")
+    @GetMapping("/list")
+    public TableDataInfo list(AdmOpInspectionReport admOpInspectionReport)
+    {
+        startPage();
+        List<AdmOpInspectionReport> list = admOpInspectionReportService.selectAdmOpInspectionReportList(admOpInspectionReport);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出巡检报告列表
+     */
+    @RequiresPermissions("ems:inspection-report:export")
+    @Log(title = "巡检报告", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, AdmOpInspectionReport admOpInspectionReport)
+    {
+        List<AdmOpInspectionReport> list = admOpInspectionReportService.selectAdmOpInspectionReportList(admOpInspectionReport);
+        ExcelUtil<AdmOpInspectionReport> util = new ExcelUtil<AdmOpInspectionReport>(AdmOpInspectionReport.class);
+        util.exportExcel(response, list, "巡检报告数据");
+    }
+
+    /**
+     * 获取巡检报告详细信息
+     */
+    @RequiresPermissions("ems:inspection-report:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(admOpInspectionReportService.selectAdmOpInspectionReportById(id));
+    }
+
+    /**
+     * 新增巡检报告
+     */
+    @RequiresPermissions("ems:inspection-report:add")
+    @Log(title = "巡检报告", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody AdmOpInspectionReport admOpInspectionReport)
+    {
+        return toAjax(admOpInspectionReportService.insertAdmOpInspectionReport(admOpInspectionReport));
+    }
+
+    /**
+     * 修改巡检报告
+     */
+    @RequiresPermissions("ems:inspection-report:edit")
+    @Log(title = "巡检报告", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody AdmOpInspectionReport admOpInspectionReport)
+    {
+        return toAjax(admOpInspectionReportService.updateAdmOpInspectionReport(admOpInspectionReport));
+    }
+
+    /**
+     * 删除巡检报告
+     */
+    @RequiresPermissions("ems:inspection-report:remove")
+    @Log(title = "巡检报告", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(admOpInspectionReportService.deleteAdmOpInspectionReportByIds(ids));
+    }
+}

+ 105 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/AdmOpInspectionTaskController.java

@@ -0,0 +1,105 @@
+package com.ruoyi.ems.controller;
+
+import java.util.List;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+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.log.annotation.Log;
+import com.ruoyi.common.log.enums.BusinessType;
+import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.ruoyi.ems.domain.AdmOpInspectionTask;
+import com.ruoyi.ems.service.IAdmOpInspectionTaskService;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+
+/**
+ * 巡检任务Controller
+ *
+ * @author ruoyi
+ * @date 2024-08-29
+ */
+@RestController
+@RequestMapping("/inspectionTask")
+public class AdmOpInspectionTaskController extends BaseController
+{
+    @Autowired
+    private IAdmOpInspectionTaskService admOpInspectionTaskService;
+
+    /**
+     * 查询巡检任务列表
+     */
+    @RequiresPermissions("ems:inspection-task:list")
+    @GetMapping("/list")
+    public TableDataInfo list(AdmOpInspectionTask admOpInspectionTask)
+    {
+        startPage();
+        List<AdmOpInspectionTask> list = admOpInspectionTaskService.selectAdmOpInspectionTaskList(admOpInspectionTask);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出巡检任务列表
+     */
+    @RequiresPermissions("ems:inspection-task:export")
+    @Log(title = "巡检任务", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, AdmOpInspectionTask admOpInspectionTask)
+    {
+        List<AdmOpInspectionTask> list = admOpInspectionTaskService.selectAdmOpInspectionTaskList(admOpInspectionTask);
+        ExcelUtil<AdmOpInspectionTask> util = new ExcelUtil<AdmOpInspectionTask>(AdmOpInspectionTask.class);
+        util.exportExcel(response, list, "巡检任务数据");
+    }
+
+    /**
+     * 获取巡检任务详细信息
+     */
+    @RequiresPermissions("ems:inspection-task:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(admOpInspectionTaskService.selectAdmOpInspectionTaskById(id));
+    }
+
+    /**
+     * 新增巡检任务
+     */
+    @RequiresPermissions("ems:inspection-task:add")
+    @Log(title = "巡检任务", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody AdmOpInspectionTask admOpInspectionTask)
+    {
+        return toAjax(admOpInspectionTaskService.insertAdmOpInspectionTask(admOpInspectionTask));
+    }
+
+    /**
+     * 修改巡检任务
+     */
+    @RequiresPermissions("ems:inspection-task:edit")
+    @Log(title = "巡检任务", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody AdmOpInspectionTask admOpInspectionTask)
+    {
+        return toAjax(admOpInspectionTaskService.updateAdmOpInspectionTask(admOpInspectionTask));
+    }
+
+    /**
+     * 删除巡检任务
+     */
+    @RequiresPermissions("ems:inspection-task:remove")
+    @Log(title = "巡检任务", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(admOpInspectionTaskService.deleteAdmOpInspectionTaskByIds(ids));
+    }
+}

+ 125 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/AdmOpInspectionReport.java

@@ -0,0 +1,125 @@
+package com.ruoyi.ems.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.core.annotation.Excel;
+import com.ruoyi.common.core.web.domain.BaseEntity;
+
+/**
+ * 巡检报告对象 adm_op_inspection_report
+ * 
+ * @author ruoyi
+ * @date 2024-08-29
+ */
+public class AdmOpInspectionReport extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 序号 */
+    private Long id;
+
+    /** 任务代码 */
+    @Excel(name = "任务代码")
+    private String taskCode;
+
+    /** 结果状态 */
+    @Excel(name = "结果状态")
+    private Integer resultStatus;
+
+    /** 结果描述 */
+    @Excel(name = "结果描述")
+    private String resultMsg;
+
+    /** 完成时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date finishTime;
+
+    /** 提交时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "提交时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date subTime;
+
+    /** 提交人 */
+    @Excel(name = "提交人")
+    private String submitter;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setTaskCode(String taskCode) 
+    {
+        this.taskCode = taskCode;
+    }
+
+    public String getTaskCode() 
+    {
+        return taskCode;
+    }
+    public void setResultStatus(Integer resultStatus) 
+    {
+        this.resultStatus = resultStatus;
+    }
+
+    public Integer getResultStatus() 
+    {
+        return resultStatus;
+    }
+    public void setResultMsg(String resultMsg) 
+    {
+        this.resultMsg = resultMsg;
+    }
+
+    public String getResultMsg() 
+    {
+        return resultMsg;
+    }
+    public void setFinishTime(Date finishTime) 
+    {
+        this.finishTime = finishTime;
+    }
+
+    public Date getFinishTime() 
+    {
+        return finishTime;
+    }
+    public void setSubTime(Date subTime) 
+    {
+        this.subTime = subTime;
+    }
+
+    public Date getSubTime() 
+    {
+        return subTime;
+    }
+    public void setSubmitter(String submitter) 
+    {
+        this.submitter = submitter;
+    }
+
+    public String getSubmitter() 
+    {
+        return submitter;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("taskCode", getTaskCode())
+            .append("resultStatus", getResultStatus())
+            .append("resultMsg", getResultMsg())
+            .append("finishTime", getFinishTime())
+            .append("subTime", getSubTime())
+            .append("submitter", getSubmitter())
+            .toString();
+    }
+}

+ 180 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/AdmOpInspectionTask.java

@@ -0,0 +1,180 @@
+package com.ruoyi.ems.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.core.annotation.Excel;
+import com.ruoyi.common.core.web.domain.BaseEntity;
+
+/**
+ * 巡检任务对象 adm_op_inspection_task
+ *
+ * @author ruoyi
+ * @date 2024-08-29
+ */
+public class AdmOpInspectionTask extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 序号 */
+    private Long id;
+
+    /** 任务代码 */
+    @Excel(name = "任务代码")
+    private String taskCode;
+
+    /** 任务名称 */
+    @Excel(name = "任务名称")
+    private String taskName;
+
+    /** 任务类型 */
+    @Excel(name = "任务类型")
+    private Integer taskType;
+
+    /** 任务状态 */
+    @Excel(name = "任务状态")
+    private Integer taskStatus;
+
+    /** 开始时间 */
+    @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 executor;
+
+    /** 巡检对象 */
+    @Excel(name = "巡检对象")
+    private Integer objType;
+
+    /** 选择巡检对象 */
+    private String objCode;
+
+    /** 对象名称 */
+    @Excel(name = "对象名称")
+    private String objName;
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setTaskCode(String taskCode)
+    {
+        this.taskCode = taskCode;
+    }
+
+    public String getTaskCode()
+    {
+        return taskCode;
+    }
+    public void setTaskName(String taskName)
+    {
+        this.taskName = taskName;
+    }
+
+    public String getTaskName()
+    {
+        return taskName;
+    }
+    public void setTaskType(Integer taskType)
+    {
+        this.taskType = taskType;
+    }
+
+    public Integer getTaskType()
+    {
+        return taskType;
+    }
+    public void setTaskStatus(Integer taskStatus)
+    {
+        this.taskStatus = taskStatus;
+    }
+
+    public Integer getTaskStatus()
+    {
+        return taskStatus;
+    }
+    public void setStartTime(Date startTime)
+    {
+        this.startTime = startTime;
+    }
+
+    public Date getStartTime()
+    {
+        return startTime;
+    }
+    public void setEndTime(Date endTime)
+    {
+        this.endTime = endTime;
+    }
+
+    public Date getEndTime()
+    {
+        return endTime;
+    }
+    public void setExecutor(String executor)
+    {
+        this.executor = executor;
+    }
+
+    public String getExecutor()
+    {
+        return executor;
+    }
+    public void setObjType(Integer objType)
+    {
+        this.objType = objType;
+    }
+
+    public Integer getObjType()
+    {
+        return objType;
+    }
+    public void setObjCode(String objCode)
+    {
+        this.objCode = objCode;
+    }
+
+    public String getObjCode()
+    {
+        return objCode;
+    }
+    public void setObjName(String objName)
+    {
+        this.objName = objName;
+    }
+
+    public String getObjName()
+    {
+        return objName;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("taskCode", getTaskCode())
+            .append("taskName", getTaskName())
+            .append("taskType", getTaskType())
+            .append("taskStatus", getTaskStatus())
+            .append("startTime", getStartTime())
+            .append("endTime", getEndTime())
+            .append("executor", getExecutor())
+            .append("objType", getObjType())
+            .append("objCode", getObjCode())
+            .append("objName", getObjName())
+            .toString();
+    }
+}

+ 61 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/AdmOpInspectionReportMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.ems.mapper;
+
+import java.util.List;
+import com.ruoyi.ems.domain.AdmOpInspectionReport;
+
+/**
+ * 巡检报告Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2024-08-29
+ */
+public interface AdmOpInspectionReportMapper 
+{
+    /**
+     * 查询巡检报告
+     * 
+     * @param id 巡检报告主键
+     * @return 巡检报告
+     */
+    public AdmOpInspectionReport selectAdmOpInspectionReportById(Long id);
+
+    /**
+     * 查询巡检报告列表
+     * 
+     * @param admOpInspectionReport 巡检报告
+     * @return 巡检报告集合
+     */
+    public List<AdmOpInspectionReport> selectAdmOpInspectionReportList(AdmOpInspectionReport admOpInspectionReport);
+
+    /**
+     * 新增巡检报告
+     * 
+     * @param admOpInspectionReport 巡检报告
+     * @return 结果
+     */
+    public int insertAdmOpInspectionReport(AdmOpInspectionReport admOpInspectionReport);
+
+    /**
+     * 修改巡检报告
+     * 
+     * @param admOpInspectionReport 巡检报告
+     * @return 结果
+     */
+    public int updateAdmOpInspectionReport(AdmOpInspectionReport admOpInspectionReport);
+
+    /**
+     * 删除巡检报告
+     * 
+     * @param id 巡检报告主键
+     * @return 结果
+     */
+    public int deleteAdmOpInspectionReportById(Long id);
+
+    /**
+     * 批量删除巡检报告
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteAdmOpInspectionReportByIds(Long[] ids);
+}

+ 61 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/AdmOpInspectionTaskMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.ems.mapper;
+
+import java.util.List;
+import com.ruoyi.ems.domain.AdmOpInspectionTask;
+
+/**
+ * 巡检任务Mapper接口
+ *
+ * @author ruoyi
+ * @date 2024-08-29
+ */
+public interface AdmOpInspectionTaskMapper
+{
+    /**
+     * 查询巡检任务
+     *
+     * @param id 巡检任务主键
+     * @return 巡检任务
+     */
+    public AdmOpInspectionTask selectAdmOpInspectionTaskById(Long id);
+
+    /**
+     * 查询巡检任务列表
+     *
+     * @param admOpInspectionTask 巡检任务
+     * @return 巡检任务集合
+     */
+    public List<AdmOpInspectionTask> selectAdmOpInspectionTaskList(AdmOpInspectionTask admOpInspectionTask);
+
+    /**
+     * 新增巡检任务
+     *
+     * @param admOpInspectionTask 巡检任务
+     * @return 结果
+     */
+    public int insertAdmOpInspectionTask(AdmOpInspectionTask admOpInspectionTask);
+
+    /**
+     * 修改巡检任务
+     *
+     * @param admOpInspectionTask 巡检任务
+     * @return 结果
+     */
+    public int updateAdmOpInspectionTask(AdmOpInspectionTask admOpInspectionTask);
+
+    /**
+     * 删除巡检任务
+     *
+     * @param id 巡检任务主键
+     * @return 结果
+     */
+    public int deleteAdmOpInspectionTaskById(Long id);
+
+    /**
+     * 批量删除巡检任务
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteAdmOpInspectionTaskByIds(Long[] ids);
+}

+ 61 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IAdmOpInspectionReportService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.ems.service;
+
+import java.util.List;
+import com.ruoyi.ems.domain.AdmOpInspectionReport;
+
+/**
+ * 巡检报告Service接口
+ * 
+ * @author ruoyi
+ * @date 2024-08-29
+ */
+public interface IAdmOpInspectionReportService 
+{
+    /**
+     * 查询巡检报告
+     * 
+     * @param id 巡检报告主键
+     * @return 巡检报告
+     */
+    public AdmOpInspectionReport selectAdmOpInspectionReportById(Long id);
+
+    /**
+     * 查询巡检报告列表
+     * 
+     * @param admOpInspectionReport 巡检报告
+     * @return 巡检报告集合
+     */
+    public List<AdmOpInspectionReport> selectAdmOpInspectionReportList(AdmOpInspectionReport admOpInspectionReport);
+
+    /**
+     * 新增巡检报告
+     * 
+     * @param admOpInspectionReport 巡检报告
+     * @return 结果
+     */
+    public int insertAdmOpInspectionReport(AdmOpInspectionReport admOpInspectionReport);
+
+    /**
+     * 修改巡检报告
+     * 
+     * @param admOpInspectionReport 巡检报告
+     * @return 结果
+     */
+    public int updateAdmOpInspectionReport(AdmOpInspectionReport admOpInspectionReport);
+
+    /**
+     * 批量删除巡检报告
+     * 
+     * @param ids 需要删除的巡检报告主键集合
+     * @return 结果
+     */
+    public int deleteAdmOpInspectionReportByIds(Long[] ids);
+
+    /**
+     * 删除巡检报告信息
+     * 
+     * @param id 巡检报告主键
+     * @return 结果
+     */
+    public int deleteAdmOpInspectionReportById(Long id);
+}

+ 61 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IAdmOpInspectionTaskService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.ems.service;
+
+import java.util.List;
+import com.ruoyi.ems.domain.AdmOpInspectionTask;
+
+/**
+ * 巡检任务Service接口
+ *
+ * @author ruoyi
+ * @date 2024-08-29
+ */
+public interface IAdmOpInspectionTaskService
+{
+    /**
+     * 查询巡检任务
+     *
+     * @param id 巡检任务主键
+     * @return 巡检任务
+     */
+    public AdmOpInspectionTask selectAdmOpInspectionTaskById(Long id);
+
+    /**
+     * 查询巡检任务列表
+     *
+     * @param admOpInspectionTask 巡检任务
+     * @return 巡检任务集合
+     */
+    public List<AdmOpInspectionTask> selectAdmOpInspectionTaskList(AdmOpInspectionTask admOpInspectionTask);
+
+    /**
+     * 新增巡检任务
+     *
+     * @param admOpInspectionTask 巡检任务
+     * @return 结果
+     */
+    public int insertAdmOpInspectionTask(AdmOpInspectionTask admOpInspectionTask);
+
+    /**
+     * 修改巡检任务
+     *
+     * @param admOpInspectionTask 巡检任务
+     * @return 结果
+     */
+    public int updateAdmOpInspectionTask(AdmOpInspectionTask admOpInspectionTask);
+
+    /**
+     * 批量删除巡检任务
+     *
+     * @param ids 需要删除的巡检任务主键集合
+     * @return 结果
+     */
+    public int deleteAdmOpInspectionTaskByIds(Long[] ids);
+
+    /**
+     * 删除巡检任务信息
+     *
+     * @param id 巡检任务主键
+     * @return 结果
+     */
+    public int deleteAdmOpInspectionTaskById(Long id);
+}

+ 93 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/AdmOpInspectionReportServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.ems.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.ems.mapper.AdmOpInspectionReportMapper;
+import com.ruoyi.ems.domain.AdmOpInspectionReport;
+import com.ruoyi.ems.service.IAdmOpInspectionReportService;
+
+/**
+ * 巡检报告Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2024-08-29
+ */
+@Service
+public class AdmOpInspectionReportServiceImpl implements IAdmOpInspectionReportService 
+{
+    @Autowired
+    private AdmOpInspectionReportMapper admOpInspectionReportMapper;
+
+    /**
+     * 查询巡检报告
+     * 
+     * @param id 巡检报告主键
+     * @return 巡检报告
+     */
+    @Override
+    public AdmOpInspectionReport selectAdmOpInspectionReportById(Long id)
+    {
+        return admOpInspectionReportMapper.selectAdmOpInspectionReportById(id);
+    }
+
+    /**
+     * 查询巡检报告列表
+     * 
+     * @param admOpInspectionReport 巡检报告
+     * @return 巡检报告
+     */
+    @Override
+    public List<AdmOpInspectionReport> selectAdmOpInspectionReportList(AdmOpInspectionReport admOpInspectionReport)
+    {
+        return admOpInspectionReportMapper.selectAdmOpInspectionReportList(admOpInspectionReport);
+    }
+
+    /**
+     * 新增巡检报告
+     * 
+     * @param admOpInspectionReport 巡检报告
+     * @return 结果
+     */
+    @Override
+    public int insertAdmOpInspectionReport(AdmOpInspectionReport admOpInspectionReport)
+    {
+        return admOpInspectionReportMapper.insertAdmOpInspectionReport(admOpInspectionReport);
+    }
+
+    /**
+     * 修改巡检报告
+     * 
+     * @param admOpInspectionReport 巡检报告
+     * @return 结果
+     */
+    @Override
+    public int updateAdmOpInspectionReport(AdmOpInspectionReport admOpInspectionReport)
+    {
+        return admOpInspectionReportMapper.updateAdmOpInspectionReport(admOpInspectionReport);
+    }
+
+    /**
+     * 批量删除巡检报告
+     * 
+     * @param ids 需要删除的巡检报告主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAdmOpInspectionReportByIds(Long[] ids)
+    {
+        return admOpInspectionReportMapper.deleteAdmOpInspectionReportByIds(ids);
+    }
+
+    /**
+     * 删除巡检报告信息
+     * 
+     * @param id 巡检报告主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAdmOpInspectionReportById(Long id)
+    {
+        return admOpInspectionReportMapper.deleteAdmOpInspectionReportById(id);
+    }
+}

+ 93 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/AdmOpInspectionTaskServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.ems.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.ems.mapper.AdmOpInspectionTaskMapper;
+import com.ruoyi.ems.domain.AdmOpInspectionTask;
+import com.ruoyi.ems.service.IAdmOpInspectionTaskService;
+
+/**
+ * 巡检任务Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2024-08-29
+ */
+@Service
+public class AdmOpInspectionTaskServiceImpl implements IAdmOpInspectionTaskService
+{
+    @Autowired
+    private AdmOpInspectionTaskMapper admOpInspectionTaskMapper;
+
+    /**
+     * 查询巡检任务
+     *
+     * @param id 巡检任务主键
+     * @return 巡检任务
+     */
+    @Override
+    public AdmOpInspectionTask selectAdmOpInspectionTaskById(Long id)
+    {
+        return admOpInspectionTaskMapper.selectAdmOpInspectionTaskById(id);
+    }
+
+    /**
+     * 查询巡检任务列表
+     *
+     * @param admOpInspectionTask 巡检任务
+     * @return 巡检任务
+     */
+    @Override
+    public List<AdmOpInspectionTask> selectAdmOpInspectionTaskList(AdmOpInspectionTask admOpInspectionTask)
+    {
+        return admOpInspectionTaskMapper.selectAdmOpInspectionTaskList(admOpInspectionTask);
+    }
+
+    /**
+     * 新增巡检任务
+     *
+     * @param admOpInspectionTask 巡检任务
+     * @return 结果
+     */
+    @Override
+    public int insertAdmOpInspectionTask(AdmOpInspectionTask admOpInspectionTask)
+    {
+        return admOpInspectionTaskMapper.insertAdmOpInspectionTask(admOpInspectionTask);
+    }
+
+    /**
+     * 修改巡检任务
+     *
+     * @param admOpInspectionTask 巡检任务
+     * @return 结果
+     */
+    @Override
+    public int updateAdmOpInspectionTask(AdmOpInspectionTask admOpInspectionTask)
+    {
+        return admOpInspectionTaskMapper.updateAdmOpInspectionTask(admOpInspectionTask);
+    }
+
+    /**
+     * 批量删除巡检任务
+     *
+     * @param ids 需要删除的巡检任务主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAdmOpInspectionTaskByIds(Long[] ids)
+    {
+        return admOpInspectionTaskMapper.deleteAdmOpInspectionTaskByIds(ids);
+    }
+
+    /**
+     * 删除巡检任务信息
+     *
+     * @param id 巡检任务主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAdmOpInspectionTaskById(Long id)
+    {
+        return admOpInspectionTaskMapper.deleteAdmOpInspectionTaskById(id);
+    }
+}

+ 78 - 0
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AdmOpInspectionReportMapper.xml

@@ -0,0 +1,78 @@
+<?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.ems.mapper.AdmOpInspectionReportMapper">
+
+    <resultMap type="com.ruoyi.ems.domain.AdmOpInspectionReport" id="AdmOpInspectionReportResult">
+        <result property="id"    column="id"    />
+        <result property="taskCode"    column="task_code"    />
+        <result property="resultStatus"    column="result_status"    />
+        <result property="resultMsg"    column="result_msg"    />
+        <result property="finishTime"    column="finish_time"    />
+        <result property="subTime"    column="sub_time"    />
+        <result property="submitter"    column="submitter"    />
+    </resultMap>
+
+    <sql id="selectAdmOpInspectionReportVo">
+        select id, task_code, result_status, result_msg, finish_time, sub_time, submitter from adm_op_inspection_report
+    </sql>
+
+    <select id="selectAdmOpInspectionReportList" parameterType="com.ruoyi.ems.domain.AdmOpInspectionReport" resultMap="AdmOpInspectionReportResult">
+        <include refid="selectAdmOpInspectionReportVo"/>
+        <where>
+            <if test="taskCode != null  and taskCode != ''"> and task_code = #{taskCode}</if>
+            <if test="resultStatus != null "> and result_status = #{resultStatus}</if>
+            <if test="submitter != null  and submitter != ''"> and submitter like concat('%', #{submitter}, '%')</if>
+        </where>
+    </select>
+
+    <select id="selectAdmOpInspectionReportById" parameterType="Long" resultMap="AdmOpInspectionReportResult">
+        <include refid="selectAdmOpInspectionReportVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertAdmOpInspectionReport" parameterType="com.ruoyi.ems.domain.AdmOpInspectionReport" useGeneratedKeys="true" keyProperty="id">
+        insert into adm_op_inspection_report
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="taskCode != null and taskCode != ''">task_code,</if>
+            <if test="resultStatus != null">result_status,</if>
+            <if test="resultMsg != null">result_msg,</if>
+            <if test="finishTime != null">finish_time,</if>
+            <if test="subTime != null">sub_time,</if>
+            <if test="submitter != null">submitter,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="taskCode != null and taskCode != ''">#{taskCode},</if>
+            <if test="resultStatus != null">#{resultStatus},</if>
+            <if test="resultMsg != null">#{resultMsg},</if>
+            <if test="finishTime != null">#{finishTime},</if>
+            <if test="subTime != null">#{subTime},</if>
+            <if test="submitter != null">#{submitter},</if>
+         </trim>
+    </insert>
+
+    <update id="updateAdmOpInspectionReport" parameterType="com.ruoyi.ems.domain.AdmOpInspectionReport">
+        update adm_op_inspection_report
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="taskCode != null and taskCode != ''">task_code = #{taskCode},</if>
+            <if test="resultStatus != null">result_status = #{resultStatus},</if>
+            <if test="resultMsg != null">result_msg = #{resultMsg},</if>
+            <if test="finishTime != null">finish_time = #{finishTime},</if>
+            <if test="subTime != null">sub_time = #{subTime},</if>
+            <if test="submitter != null">submitter = #{submitter},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteAdmOpInspectionReportById" parameterType="Long">
+        delete from adm_op_inspection_report where id = #{id}
+    </delete>
+
+    <delete id="deleteAdmOpInspectionReportByIds" parameterType="String">
+        delete from adm_op_inspection_report where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 113 - 0
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AdmOpInspectionTaskMapper.xml

@@ -0,0 +1,113 @@
+<?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.ems.mapper.AdmOpInspectionTaskMapper">
+
+    <resultMap type="com.ruoyi.ems.domain.AdmOpInspectionTask" id="AdmOpInspectionTaskResult">
+        <result property="id" column="id"/>
+        <result property="taskCode" column="task_code"/>
+        <result property="taskName" column="task_name"/>
+        <result property="taskType" column="task_type"/>
+        <result property="taskStatus" column="task_status"/>
+        <result property="startTime" column="start_time"/>
+        <result property="endTime" column="end_time"/>
+        <result property="executor" column="executor"/>
+        <result property="objType" column="obj_type"/>
+        <result property="objCode" column="obj_code"/>
+        <result property="objName" column="obj_name"/>
+    </resultMap>
+
+    <sql id="selectAdmOpInspectionTaskVo">
+        select id,
+               task_code,
+               task_name,
+               task_type,
+               task_status,
+               start_time,
+               end_time,
+               executor,
+               obj_type,
+               obj_code,
+               obj_name
+        from adm_op_inspection_task
+    </sql>
+
+    <select id="selectAdmOpInspectionTaskList" parameterType="com.ruoyi.ems.domain.AdmOpInspectionTask"
+            resultMap="AdmOpInspectionTaskResult">
+        <include refid="selectAdmOpInspectionTaskVo"/>
+        <where>
+            <if test="taskCode != null  and taskCode != ''">and task_code = #{taskCode}</if>
+            <if test="taskName != null  and taskName != ''">and task_name like concat('%', #{taskName}, '%')</if>
+            <if test="taskType != null ">and task_type = #{taskType}</if>
+            <if test="taskStatus != null ">and task_status = #{taskStatus}</if>
+            <if test="executor != null  and executor != ''">and executor = #{executor}</if>
+            <if test="objType != null ">and obj_type = #{objType}</if>
+            <if test="objName != null  and objName != ''">and obj_name like concat('%', #{objName}, '%')</if>
+        </where>
+    </select>
+
+    <select id="selectAdmOpInspectionTaskById" parameterType="Long" resultMap="AdmOpInspectionTaskResult">
+        <include refid="selectAdmOpInspectionTaskVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertAdmOpInspectionTask" parameterType="com.ruoyi.ems.domain.AdmOpInspectionTask"
+            useGeneratedKeys="true" keyProperty="id">
+        insert into adm_op_inspection_task
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="taskCode != null and taskCode != ''">task_code,</if>
+            <if test="taskName != null and taskName != ''">task_name,</if>
+            <if test="taskType != null">task_type,</if>
+            <if test="taskStatus != null">task_status,</if>
+            <if test="startTime != null">start_time,</if>
+            <if test="endTime != null">end_time,</if>
+            <if test="executor != null">executor,</if>
+            <if test="objType != null">obj_type,</if>
+            <if test="objCode != null and objCode != ''">obj_code,</if>
+            <if test="objName != null">obj_name,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="taskCode != null and taskCode != ''">#{taskCode},</if>
+            <if test="taskName != null and taskName != ''">#{taskName},</if>
+            <if test="taskType != null">#{taskType},</if>
+            <if test="taskStatus != null">#{taskStatus},</if>
+            <if test="startTime != null">#{startTime},</if>
+            <if test="endTime != null">#{endTime},</if>
+            <if test="executor != null">#{executor},</if>
+            <if test="objType != null">#{objType},</if>
+            <if test="objCode != null and objCode != ''">#{objCode},</if>
+            <if test="objName != null">#{objName},</if>
+        </trim>
+    </insert>
+
+    <update id="updateAdmOpInspectionTask" parameterType="com.ruoyi.ems.domain.AdmOpInspectionTask">
+        update adm_op_inspection_task
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="taskCode != null and taskCode != ''">task_code = #{taskCode},</if>
+            <if test="taskName != null and taskName != ''">task_name = #{taskName},</if>
+            <if test="taskType != null">task_type = #{taskType},</if>
+            <if test="taskStatus != null">task_status = #{taskStatus},</if>
+            <if test="startTime != null">start_time = #{startTime},</if>
+            <if test="endTime != null">end_time = #{endTime},</if>
+            <if test="executor != null">executor = #{executor},</if>
+            <if test="objType != null">obj_type = #{objType},</if>
+            <if test="objCode != null and objCode != ''">obj_code = #{objCode},</if>
+            <if test="objName != null">obj_name = #{objName},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteAdmOpInspectionTaskById" parameterType="Long">
+        delete
+        from adm_op_inspection_task
+        where id = #{id}
+    </delete>
+
+    <delete id="deleteAdmOpInspectionTaskByIds" parameterType="String">
+        delete from adm_op_inspection_task where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 10 - 0
ems-cloud/sql/ems_sys.sql

@@ -434,6 +434,16 @@ INSERT INTO sys_menu VALUES (1534, 'query', 153, 1, '', NULL, NULL, 1, 0, 'F', '
 INSERT INTO sys_menu VALUES (1535, 'add', 153, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-task:add', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
 INSERT INTO sys_menu VALUES (1536, 'edit', 153, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-task:edit', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
 INSERT INTO sys_menu VALUES (1537, 'remove', 153, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-task:remove', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
+INSERT INTO sys_menu VALUES (1538, '执行一次', 153, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:auto-task:exc', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
+INSERT INTO sys_menu VALUES (1539, '任务查询权限', 153, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:auto-task:query', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
+
+-- 巡检报告
+INSERT INTO sys_menu VALUES (1541, '查询', 154, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-report:list', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
+INSERT INTO sys_menu VALUES (1542, '导出', 154, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-report:export', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
+INSERT INTO sys_menu VALUES (1543, '查询权限', 154, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-report:query', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
+INSERT INTO sys_menu VALUES (1544, '新增', 154, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-report:add', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
+INSERT INTO sys_menu VALUES (1545, '修改', 154, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-report:edit', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
+INSERT INTO sys_menu VALUES (1546, '删除', 154, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-report:remove', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
 
 -- 任务调度
 INSERT INTO sys_menu VALUES (1800, '任务列表', 180, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'monitor:job:list', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');