增加 巡检任务
parent
d423b752f7
commit
014b0200fd
@ -0,0 +1,126 @@
|
||||
package com.ruoyi.manage.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.manage.domain.RecordInspectionTask;
|
||||
import com.ruoyi.manage.service.IRecordInspectionTaskService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 巡检机位信息Controller
|
||||
*
|
||||
* @author wangh
|
||||
* @date 2024-09-25
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/manage/record_inspection_task")
|
||||
public class RecordInspectionTaskController extends BaseController {
|
||||
private String prefix = "manage/record_inspection_task";
|
||||
|
||||
@Autowired
|
||||
private IRecordInspectionTaskService recordInspectionTaskService;
|
||||
|
||||
@RequiresPermissions("manage:record_inspection_task:view")
|
||||
@GetMapping("/{id}")
|
||||
public String record_inspection_task(@PathVariable("id") String id,ModelMap mmap) {
|
||||
mmap.put("inspetionId",id);
|
||||
System.out.println(id);
|
||||
return prefix + "/record_inspection_task";
|
||||
}
|
||||
@RequiresPermissions("manage:record_inspection_task:view")
|
||||
@GetMapping()
|
||||
public String record_inspection_task() {
|
||||
return prefix + "/record_inspection_task";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询巡检机位信息列表
|
||||
*/
|
||||
@RequiresPermissions("manage:record_inspection_task:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(RecordInspectionTask recordInspectionTask) {
|
||||
startPage();
|
||||
List<RecordInspectionTask> list = recordInspectionTaskService.selectRecordInspectionTaskList(recordInspectionTask);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出巡检机位信息列表
|
||||
*/
|
||||
@RequiresPermissions("manage:record_inspection_task:export")
|
||||
@Log(title = "巡检机位信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(RecordInspectionTask recordInspectionTask) {
|
||||
List<RecordInspectionTask> list = recordInspectionTaskService.selectRecordInspectionTaskList(recordInspectionTask);
|
||||
ExcelUtil<RecordInspectionTask> util = new ExcelUtil<RecordInspectionTask>(RecordInspectionTask.class);
|
||||
return util.exportExcel(list, "巡检机位信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增巡检机位信息
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add() {
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存巡检机位信息
|
||||
*/
|
||||
@RequiresPermissions("manage:record_inspection_task:add")
|
||||
@Log(title = "巡检机位信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(RecordInspectionTask recordInspectionTask) {
|
||||
return toAjax(recordInspectionTaskService.insertRecordInspectionTask(recordInspectionTask));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改巡检机位信息
|
||||
*/
|
||||
@RequiresPermissions("manage:record_inspection_task:edit")
|
||||
@GetMapping("/edit/{objid}")
|
||||
public String edit(@PathVariable("objid") Long objid, ModelMap mmap) {
|
||||
RecordInspectionTask recordInspectionTask = recordInspectionTaskService.selectRecordInspectionTaskByObjid(objid);
|
||||
mmap.put("recordInspectionTask", recordInspectionTask);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存巡检机位信息
|
||||
*/
|
||||
@RequiresPermissions("manage:record_inspection_task:edit")
|
||||
@Log(title = "巡检机位信息", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(RecordInspectionTask recordInspectionTask) {
|
||||
return toAjax(recordInspectionTaskService.updateRecordInspectionTask(recordInspectionTask));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除巡检机位信息
|
||||
*/
|
||||
@RequiresPermissions("manage:record_inspection_task:remove")
|
||||
@Log(title = "巡检机位信息", businessType = BusinessType.DELETE)
|
||||
@PostMapping("/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids) {
|
||||
return toAjax(recordInspectionTaskService.deleteRecordInspectionTaskByObjids(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package com.ruoyi.manage.domain;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 巡检机位信息对象 record_inspection_task
|
||||
*
|
||||
* @author wangh
|
||||
* @date 2024-09-25
|
||||
*/
|
||||
public class RecordInspectionTask extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long objid;
|
||||
|
||||
/** 巡检id */
|
||||
private Long inspectionId;
|
||||
|
||||
/** 区域id */
|
||||
private Long areaId;
|
||||
|
||||
/** 机坪名称 */
|
||||
@Excel(name = "机坪名称")
|
||||
private String areaName;
|
||||
|
||||
/** 机位码 */
|
||||
@Excel(name = "机位码")
|
||||
private String planePosition;
|
||||
|
||||
/** 完成状态 */
|
||||
@Excel(name = "完成状态")
|
||||
private String taskState;
|
||||
|
||||
public void setObjid(Long objid)
|
||||
{
|
||||
this.objid = objid;
|
||||
}
|
||||
|
||||
public Long getObjid()
|
||||
{
|
||||
return objid;
|
||||
}
|
||||
public void setInspectionId(Long inspectionId)
|
||||
{
|
||||
this.inspectionId = inspectionId;
|
||||
}
|
||||
|
||||
public Long getInspectionId()
|
||||
{
|
||||
return inspectionId;
|
||||
}
|
||||
public void setAreaId(Long areaId)
|
||||
{
|
||||
this.areaId = areaId;
|
||||
}
|
||||
|
||||
public Long getAreaId()
|
||||
{
|
||||
return areaId;
|
||||
}
|
||||
public void setAreaName(String areaName)
|
||||
{
|
||||
this.areaName = areaName;
|
||||
}
|
||||
|
||||
public String getAreaName()
|
||||
{
|
||||
return areaName;
|
||||
}
|
||||
public void setPlanePosition(String planePosition)
|
||||
{
|
||||
this.planePosition = planePosition;
|
||||
}
|
||||
|
||||
public String getPlanePosition()
|
||||
{
|
||||
return planePosition;
|
||||
}
|
||||
public void setTaskState(String taskState)
|
||||
{
|
||||
this.taskState = taskState;
|
||||
}
|
||||
|
||||
public String getTaskState()
|
||||
{
|
||||
return taskState;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("objid", getObjid())
|
||||
.append("inspectionId", getInspectionId())
|
||||
.append("areaId", getAreaId())
|
||||
.append("areaName", getAreaName())
|
||||
.append("planePosition", getPlanePosition())
|
||||
.append("taskState", getTaskState())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.ruoyi.manage.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.manage.domain.RecordInspectionTask;
|
||||
import org.springframework.stereotype.Repository;
|
||||
/**
|
||||
* 巡检机位信息Mapper接口
|
||||
*
|
||||
* @author wangh
|
||||
* @date 2024-09-25
|
||||
*/
|
||||
@Repository
|
||||
public interface RecordInspectionTaskMapper
|
||||
{
|
||||
/**
|
||||
* 查询巡检机位信息
|
||||
*
|
||||
* @param objid 巡检机位信息主键
|
||||
* @return 巡检机位信息
|
||||
*/
|
||||
public RecordInspectionTask selectRecordInspectionTaskByObjid(Long objid);
|
||||
|
||||
/**
|
||||
* 查询巡检机位信息列表
|
||||
*
|
||||
* @param recordInspectionTask 巡检机位信息
|
||||
* @return 巡检机位信息集合
|
||||
*/
|
||||
public List<RecordInspectionTask> selectRecordInspectionTaskList(RecordInspectionTask recordInspectionTask);
|
||||
|
||||
/**
|
||||
* 新增巡检机位信息
|
||||
*
|
||||
* @param recordInspectionTask 巡检机位信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRecordInspectionTask(RecordInspectionTask recordInspectionTask);
|
||||
|
||||
/**
|
||||
* 修改巡检机位信息
|
||||
*
|
||||
* @param recordInspectionTask 巡检机位信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRecordInspectionTask(RecordInspectionTask recordInspectionTask);
|
||||
|
||||
/**
|
||||
* 删除巡检机位信息
|
||||
*
|
||||
* @param objid 巡检机位信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRecordInspectionTaskByObjid(Long objid);
|
||||
|
||||
/**
|
||||
* 批量删除巡检机位信息
|
||||
*
|
||||
* @param objids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRecordInspectionTaskByObjids(String[] objids);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.manage.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.manage.domain.RecordInspectionTask;
|
||||
|
||||
/**
|
||||
* 巡检机位信息Service接口
|
||||
*
|
||||
* @author wangh
|
||||
* @date 2024-09-25
|
||||
*/
|
||||
public interface IRecordInspectionTaskService
|
||||
{
|
||||
/**
|
||||
* 查询巡检机位信息
|
||||
*
|
||||
* @param objid 巡检机位信息主键
|
||||
* @return 巡检机位信息
|
||||
*/
|
||||
public RecordInspectionTask selectRecordInspectionTaskByObjid(Long objid);
|
||||
|
||||
/**
|
||||
* 查询巡检机位信息列表
|
||||
*
|
||||
* @param recordInspectionTask 巡检机位信息
|
||||
* @return 巡检机位信息集合
|
||||
*/
|
||||
public List<RecordInspectionTask> selectRecordInspectionTaskList(RecordInspectionTask recordInspectionTask);
|
||||
|
||||
/**
|
||||
* 新增巡检机位信息
|
||||
*
|
||||
* @param recordInspectionTask 巡检机位信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRecordInspectionTask(RecordInspectionTask recordInspectionTask);
|
||||
|
||||
/**
|
||||
* 修改巡检机位信息
|
||||
*
|
||||
* @param recordInspectionTask 巡检机位信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRecordInspectionTask(RecordInspectionTask recordInspectionTask);
|
||||
|
||||
/**
|
||||
* 批量删除巡检机位信息
|
||||
*
|
||||
* @param objids 需要删除的巡检机位信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRecordInspectionTaskByObjids(String objids);
|
||||
|
||||
/**
|
||||
* 删除巡检机位信息信息
|
||||
*
|
||||
* @param objid 巡检机位信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRecordInspectionTaskByObjid(Long objid);
|
||||
}
|
@ -0,0 +1,117 @@
|
||||
package com.ruoyi.manage.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.manage.mapper.RecordInspectionTaskMapper;
|
||||
import com.ruoyi.manage.domain.RecordInspectionTask;
|
||||
import com.ruoyi.manage.service.IRecordInspectionTaskService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
/**
|
||||
* 巡检机位信息Service业务层处理
|
||||
*
|
||||
* @author wangh
|
||||
* @date 2024-09-25
|
||||
*/
|
||||
@Service
|
||||
public class RecordInspectionTaskServiceImpl implements IRecordInspectionTaskService {
|
||||
@Autowired
|
||||
private RecordInspectionTaskMapper recordInspectionTaskMapper;
|
||||
|
||||
/**
|
||||
* 查询巡检机位信息
|
||||
*
|
||||
* @param objid 巡检机位信息主键
|
||||
* @return 巡检机位信息
|
||||
*/
|
||||
@Override
|
||||
public RecordInspectionTask selectRecordInspectionTaskByObjid(Long objid) {
|
||||
return recordInspectionTaskMapper.selectRecordInspectionTaskByObjid(objid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询巡检机位信息列表
|
||||
*
|
||||
* @param recordInspectionTask 巡检机位信息
|
||||
* @return 巡检机位信息
|
||||
*/
|
||||
@Override
|
||||
public List<RecordInspectionTask> selectRecordInspectionTaskList(RecordInspectionTask recordInspectionTask) {
|
||||
return recordInspectionTaskMapper.selectRecordInspectionTaskList(recordInspectionTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增巡检机位信息
|
||||
*
|
||||
* @param recordInspectionTask 巡检机位信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRecordInspectionTask(RecordInspectionTask recordInspectionTask) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return recordInspectionTaskMapper.insertRecordInspectionTask(recordInspectionTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改巡检机位信息
|
||||
*
|
||||
* @param recordInspectionTask 巡检机位信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRecordInspectionTask(RecordInspectionTask recordInspectionTask) {
|
||||
return recordInspectionTaskMapper.updateRecordInspectionTask(recordInspectionTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除巡检机位信息
|
||||
*
|
||||
* @param objids 需要删除的巡检机位信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRecordInspectionTaskByObjids(String objids) {
|
||||
return recordInspectionTaskMapper.deleteRecordInspectionTaskByObjids(Convert.toStrArray(objids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除巡检机位信息信息
|
||||
*
|
||||
* @param objid 巡检机位信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRecordInspectionTaskByObjid(Long objid) {
|
||||
return recordInspectionTaskMapper.deleteRecordInspectionTaskByObjid(objid);
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('巡检机位信息', '2026', '1', '/manage/record_inspection_task', 'C', '0', 'manage:record_inspection_task:view', '#', 'admin', sysdate(), '', null, '巡检机位信息菜单');
|
||||
|
||||
-- 按钮父菜单ID
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
|
||||
-- 按钮 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('巡检机位信息查询', @parentId, '1', '#', 'F', '0', 'manage:record_inspection_task:list', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('巡检机位信息新增', @parentId, '2', '#', 'F', '0', 'manage:record_inspection_task:add', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('巡检机位信息修改', @parentId, '3', '#', 'F', '0', 'manage:record_inspection_task:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('巡检机位信息删除', @parentId, '4', '#', 'F', '0', 'manage:record_inspection_task:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('巡检机位信息导出', @parentId, '5', '#', 'F', '0', 'manage:record_inspection_task:export', '#', 'admin', sysdate(), '', null, '');
|
@ -0,0 +1,76 @@
|
||||
<?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.manage.mapper.RecordInspectionTaskMapper">
|
||||
|
||||
<resultMap type="RecordInspectionTask" id="RecordInspectionTaskResult">
|
||||
<result property="objid" column="objid" />
|
||||
<result property="inspectionId" column="inspection_id" />
|
||||
<result property="areaId" column="area_id" />
|
||||
<result property="areaName" column="area_name" />
|
||||
<result property="planePosition" column="plane_position" />
|
||||
<result property="taskState" column="task_state" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRecordInspectionTaskVo">
|
||||
select objid, inspection_id, area_id, area_name, plane_position, task_state from record_inspection_task
|
||||
</sql>
|
||||
|
||||
<select id="selectRecordInspectionTaskList" parameterType="RecordInspectionTask" resultMap="RecordInspectionTaskResult">
|
||||
<include refid="selectRecordInspectionTaskVo"/>
|
||||
<where>
|
||||
<if test="inspectionId != null "> and inspection_id = #{inspectionId}</if>
|
||||
<if test="areaName != null and areaName != ''"> and area_name like concat('%', #{areaName}, '%')</if>
|
||||
<if test="planePosition != null and planePosition != ''"> and plane_position = #{planePosition}</if>
|
||||
<if test="taskState != null and taskState != ''"> and task_state = #{taskState}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRecordInspectionTaskByObjid" parameterType="Long" resultMap="RecordInspectionTaskResult">
|
||||
<include refid="selectRecordInspectionTaskVo"/>
|
||||
where objid = #{objid}
|
||||
</select>
|
||||
|
||||
<insert id="insertRecordInspectionTask" parameterType="RecordInspectionTask" useGeneratedKeys="true" keyProperty="objid">
|
||||
insert into record_inspection_task
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="inspectionId != null">inspection_id,</if>
|
||||
<if test="areaId != null">area_id,</if>
|
||||
<if test="areaName != null">area_name,</if>
|
||||
<if test="planePosition != null">plane_position,</if>
|
||||
<if test="taskState != null">task_state,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="inspectionId != null">#{inspectionId},</if>
|
||||
<if test="areaId != null">#{areaId},</if>
|
||||
<if test="areaName != null">#{areaName},</if>
|
||||
<if test="planePosition != null">#{planePosition},</if>
|
||||
<if test="taskState != null">#{taskState},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateRecordInspectionTask" parameterType="RecordInspectionTask">
|
||||
update record_inspection_task
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="inspectionId != null">inspection_id = #{inspectionId},</if>
|
||||
<if test="areaId != null">area_id = #{areaId},</if>
|
||||
<if test="areaName != null">area_name = #{areaName},</if>
|
||||
<if test="planePosition != null">plane_position = #{planePosition},</if>
|
||||
<if test="taskState != null">task_state = #{taskState},</if>
|
||||
</trim>
|
||||
where objid = #{objid}
|
||||
</update>
|
||||
|
||||
<delete id="deleteRecordInspectionTaskByObjid" parameterType="Long">
|
||||
delete from record_inspection_task where objid = #{objid}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRecordInspectionTaskByObjids" parameterType="String">
|
||||
delete from record_inspection_task where objid in
|
||||
<foreach item="objid" collection="array" open="(" separator="," close=")">
|
||||
#{objid}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue