增加 巡检

master
wanghao 4 months ago
parent 633c20cb18
commit 7a5712bcd9

@ -0,0 +1,123 @@
package com.ruoyi.device.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.device.domain.DeviceInspectProject;
import com.ruoyi.device.service.IDeviceInspectProjectService;
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.*;
import java.util.List;
/**
* Controller
*
* @author wangh
* @date 2025-09-30
*/
@Controller
@RequestMapping("/device/inspect_project")
public class DeviceInspectProjectController extends BaseController {
private String prefix = "device/inspect_project";
@Autowired
private IDeviceInspectProjectService deviceInspectProjectService;
@RequiresPermissions("device:inspect_project:view")
@GetMapping()
public String inspect_project() {
return prefix + "/inspect_project";
}
@GetMapping("/open/{objId}")
public String open(@PathVariable("objId") Long objId, ModelMap mmap) {
mmap.put("objId", objId);
return prefix + "/inspect_project";
}
/**
*
*/
@RequiresPermissions("device:inspect_project:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(DeviceInspectProject deviceInspectProject) {
startPage();
List<DeviceInspectProject> list = deviceInspectProjectService.selectDeviceInspectProjectList(deviceInspectProject);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("device:inspect_project:export")
@Log(title = "巡检项目管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(DeviceInspectProject deviceInspectProject) {
List<DeviceInspectProject> list = deviceInspectProjectService.selectDeviceInspectProjectList(deviceInspectProject);
ExcelUtil<DeviceInspectProject> util = new ExcelUtil<DeviceInspectProject>(DeviceInspectProject.class);
return util.exportExcel(list, "巡检项目管理数据");
}
/**
*
*/
@GetMapping("/add/{manualId}")
public String add(@PathVariable("manualId") Long manualId, ModelMap mmap) {
mmap.put("manualId", manualId);
return prefix + "/add";
}
/**
*
*/
@RequiresPermissions("device:inspect_project:add")
@Log(title = "巡检项目管理", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(DeviceInspectProject deviceInspectProject) {
return toAjax(deviceInspectProjectService.insertDeviceInspectProject(deviceInspectProject));
}
/**
*
*/
@RequiresPermissions("device:inspect_project:edit")
@GetMapping("/edit/{objId}")
public String edit(@PathVariable("objId") Long objId, ModelMap mmap) {
DeviceInspectProject deviceInspectProject = deviceInspectProjectService.selectDeviceInspectProjectByObjId(objId);
mmap.put("deviceInspectProject", deviceInspectProject);
return prefix + "/edit";
}
/**
*
*/
@RequiresPermissions("device:inspect_project:edit")
@Log(title = "巡检项目管理", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(DeviceInspectProject deviceInspectProject) {
return toAjax(deviceInspectProjectService.updateDeviceInspectProject(deviceInspectProject));
}
/**
*
*/
@RequiresPermissions("device:inspect_project:remove")
@Log(title = "巡检项目管理", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids) {
return toAjax(deviceInspectProjectService.deleteDeviceInspectProjectByObjIds(ids));
}
}

@ -0,0 +1,127 @@
package com.ruoyi.device.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.device.domain.DeviceInspectionManual;
import com.ruoyi.device.service.IDeviceInspectionManualService;
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 2025-09-30
*/
@Controller
@RequestMapping("/device/inspection_manual")
public class DeviceInspectionManualController extends BaseController
{
private String prefix = "device/inspection_manual";
@Autowired
private IDeviceInspectionManualService deviceInspectionManualService;
@RequiresPermissions("device:inspection_manual:view")
@GetMapping()
public String inspection_manual()
{
return prefix + "/inspection_manual";
}
/**
*
*/
@RequiresPermissions("device:inspection_manual:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(DeviceInspectionManual deviceInspectionManual)
{
startPage();
List<DeviceInspectionManual> list = deviceInspectionManualService.selectDeviceInspectionManualList(deviceInspectionManual);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("device:inspection_manual:export")
@Log(title = "巡检手册管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(DeviceInspectionManual deviceInspectionManual)
{
List<DeviceInspectionManual> list = deviceInspectionManualService.selectDeviceInspectionManualList(deviceInspectionManual);
ExcelUtil<DeviceInspectionManual> util = new ExcelUtil<DeviceInspectionManual>(DeviceInspectionManual.class);
return util.exportExcel(list, "巡检手册管理数据");
}
/**
*
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
*
*/
@RequiresPermissions("device:inspection_manual:add")
@Log(title = "巡检手册管理", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(DeviceInspectionManual deviceInspectionManual)
{
return toAjax(deviceInspectionManualService.insertDeviceInspectionManual(deviceInspectionManual));
}
/**
*
*/
@RequiresPermissions("device:inspection_manual:edit")
@GetMapping("/edit/{objId}")
public String edit(@PathVariable("objId") Long objId, ModelMap mmap)
{
DeviceInspectionManual deviceInspectionManual = deviceInspectionManualService.selectDeviceInspectionManualByObjId(objId);
mmap.put("deviceInspectionManual", deviceInspectionManual);
return prefix + "/edit";
}
/**
*
*/
@RequiresPermissions("device:inspection_manual:edit")
@Log(title = "巡检手册管理", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(DeviceInspectionManual deviceInspectionManual)
{
return toAjax(deviceInspectionManualService.updateDeviceInspectionManual(deviceInspectionManual));
}
/**
*
*/
@RequiresPermissions("device:inspection_manual:remove")
@Log(title = "巡检手册管理", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(deviceInspectionManualService.deleteDeviceInspectionManualByObjIds(ids));
}
}

@ -0,0 +1,125 @@
package com.ruoyi.device.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;
/**
* device_inspect_project
*
* @author wangh
* @date 2025-09-30
*/
public class DeviceInspectProject extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long objId;
/** 关联手册 */
@Excel(name = "关联手册")
private Long manualId;
/** 项目编号 */
@Excel(name = "项目编号")
private String inspectProjectCode;
/** 巡检项目 */
@Excel(name = "巡检项目")
private String inspectProject;
/** 巡检项目属性 */
@Excel(name = "巡检项目属性")
private String inspectProjectProperty;
/** 上限 */
@Excel(name = "上限")
private String upLimit;
/** 下限 */
@Excel(name = "下限")
private String lowLimit;
public void setObjId(Long objId)
{
this.objId = objId;
}
public Long getObjId()
{
return objId;
}
public void setManualId(Long manualId)
{
this.manualId = manualId;
}
public Long getManualId()
{
return manualId;
}
public void setInspectProjectCode(String inspectProjectCode)
{
this.inspectProjectCode = inspectProjectCode;
}
public String getInspectProjectCode()
{
return inspectProjectCode;
}
public void setInspectProject(String inspectProject)
{
this.inspectProject = inspectProject;
}
public String getInspectProject()
{
return inspectProject;
}
public void setInspectProjectProperty(String inspectProjectProperty)
{
this.inspectProjectProperty = inspectProjectProperty;
}
public String getInspectProjectProperty()
{
return inspectProjectProperty;
}
public void setUpLimit(String upLimit)
{
this.upLimit = upLimit;
}
public String getUpLimit()
{
return upLimit;
}
public void setLowLimit(String lowLimit)
{
this.lowLimit = lowLimit;
}
public String getLowLimit()
{
return lowLimit;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("objId", getObjId())
.append("manualId", getManualId())
.append("inspectProjectCode", getInspectProjectCode())
.append("inspectProject", getInspectProject())
.append("inspectProjectProperty", getInspectProjectProperty())
.append("upLimit", getUpLimit())
.append("lowLimit", getLowLimit())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -0,0 +1,69 @@
package com.ruoyi.device.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;
/**
* device_inspection_manual
*
* @author wangh
* @date 2025-09-30
*/
public class DeviceInspectionManual extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long objId;
/** 手册编码 */
@Excel(name = "手册编码")
private String manualCode;
/** 手册名称 */
@Excel(name = "手册名称")
private String manualName;
public void setObjId(Long objId)
{
this.objId = objId;
}
public Long getObjId()
{
return objId;
}
public void setManualCode(String manualCode)
{
this.manualCode = manualCode;
}
public String getManualCode()
{
return manualCode;
}
public void setManualName(String manualName)
{
this.manualName = manualName;
}
public String getManualName()
{
return manualName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("objId", getObjId())
.append("manualCode", getManualCode())
.append("manualName", getManualName())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -0,0 +1,62 @@
package com.ruoyi.device.mapper;
import java.util.List;
import com.ruoyi.device.domain.DeviceInspectProject;
import org.springframework.stereotype.Repository;
/**
* Mapper
*
* @author wangh
* @date 2025-09-30
*/
@Repository
public interface DeviceInspectProjectMapper
{
/**
*
*
* @param objId
* @return
*/
public DeviceInspectProject selectDeviceInspectProjectByObjId(Long objId);
/**
*
*
* @param deviceInspectProject
* @return
*/
public List<DeviceInspectProject> selectDeviceInspectProjectList(DeviceInspectProject deviceInspectProject);
/**
*
*
* @param deviceInspectProject
* @return
*/
public int insertDeviceInspectProject(DeviceInspectProject deviceInspectProject);
/**
*
*
* @param deviceInspectProject
* @return
*/
public int updateDeviceInspectProject(DeviceInspectProject deviceInspectProject);
/**
*
*
* @param objId
* @return
*/
public int deleteDeviceInspectProjectByObjId(Long objId);
/**
*
*
* @param objIds
* @return
*/
public int deleteDeviceInspectProjectByObjIds(String[] objIds);
}

@ -0,0 +1,62 @@
package com.ruoyi.device.mapper;
import java.util.List;
import com.ruoyi.device.domain.DeviceInspectionManual;
import org.springframework.stereotype.Repository;
/**
* Mapper
*
* @author wangh
* @date 2025-09-30
*/
@Repository
public interface DeviceInspectionManualMapper
{
/**
*
*
* @param objId
* @return
*/
public DeviceInspectionManual selectDeviceInspectionManualByObjId(Long objId);
/**
*
*
* @param deviceInspectionManual
* @return
*/
public List<DeviceInspectionManual> selectDeviceInspectionManualList(DeviceInspectionManual deviceInspectionManual);
/**
*
*
* @param deviceInspectionManual
* @return
*/
public int insertDeviceInspectionManual(DeviceInspectionManual deviceInspectionManual);
/**
*
*
* @param deviceInspectionManual
* @return
*/
public int updateDeviceInspectionManual(DeviceInspectionManual deviceInspectionManual);
/**
*
*
* @param objId
* @return
*/
public int deleteDeviceInspectionManualByObjId(Long objId);
/**
*
*
* @param objIds
* @return
*/
public int deleteDeviceInspectionManualByObjIds(String[] objIds);
}

@ -0,0 +1,61 @@
package com.ruoyi.device.service;
import java.util.List;
import com.ruoyi.device.domain.DeviceInspectProject;
/**
* Service
*
* @author wangh
* @date 2025-09-30
*/
public interface IDeviceInspectProjectService
{
/**
*
*
* @param objId
* @return
*/
public DeviceInspectProject selectDeviceInspectProjectByObjId(Long objId);
/**
*
*
* @param deviceInspectProject
* @return
*/
public List<DeviceInspectProject> selectDeviceInspectProjectList(DeviceInspectProject deviceInspectProject);
/**
*
*
* @param deviceInspectProject
* @return
*/
public int insertDeviceInspectProject(DeviceInspectProject deviceInspectProject);
/**
*
*
* @param deviceInspectProject
* @return
*/
public int updateDeviceInspectProject(DeviceInspectProject deviceInspectProject);
/**
*
*
* @param objIds
* @return
*/
public int deleteDeviceInspectProjectByObjIds(String objIds);
/**
*
*
* @param objId
* @return
*/
public int deleteDeviceInspectProjectByObjId(Long objId);
}

@ -0,0 +1,61 @@
package com.ruoyi.device.service;
import java.util.List;
import com.ruoyi.device.domain.DeviceInspectionManual;
/**
* Service
*
* @author wangh
* @date 2025-09-30
*/
public interface IDeviceInspectionManualService
{
/**
*
*
* @param objId
* @return
*/
public DeviceInspectionManual selectDeviceInspectionManualByObjId(Long objId);
/**
*
*
* @param deviceInspectionManual
* @return
*/
public List<DeviceInspectionManual> selectDeviceInspectionManualList(DeviceInspectionManual deviceInspectionManual);
/**
*
*
* @param deviceInspectionManual
* @return
*/
public int insertDeviceInspectionManual(DeviceInspectionManual deviceInspectionManual);
/**
*
*
* @param deviceInspectionManual
* @return
*/
public int updateDeviceInspectionManual(DeviceInspectionManual deviceInspectionManual);
/**
*
*
* @param objIds
* @return
*/
public int deleteDeviceInspectionManualByObjIds(String objIds);
/**
*
*
* @param objId
* @return
*/
public int deleteDeviceInspectionManualByObjId(Long objId);
}

@ -0,0 +1,105 @@
package com.ruoyi.device.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.device.mapper.DeviceInspectProjectMapper;
import com.ruoyi.device.domain.DeviceInspectProject;
import com.ruoyi.device.service.IDeviceInspectProjectService;
import com.ruoyi.common.core.text.Convert;
/**
* Service
*
* @author wangh
* @date 2025-09-30
*/
@Service
public class DeviceInspectProjectServiceImpl implements IDeviceInspectProjectService {
@Autowired
private DeviceInspectProjectMapper deviceInspectProjectMapper;
/**
*
*
* @param objId
* @return
*/
@Override
public DeviceInspectProject selectDeviceInspectProjectByObjId(Long objId) {
return deviceInspectProjectMapper.selectDeviceInspectProjectByObjId(objId);
}
/**
*
*
* @param deviceInspectProject
* @return
*/
@Override
public List<DeviceInspectProject> selectDeviceInspectProjectList(DeviceInspectProject deviceInspectProject) {
return deviceInspectProjectMapper.selectDeviceInspectProjectList(deviceInspectProject);
}
/**
*
*
* @param deviceInspectProject
* @return
*/
@Override
public int insertDeviceInspectProject(DeviceInspectProject deviceInspectProject) {
deviceInspectProject.setCreateBy(ShiroUtils.getLoginName());
deviceInspectProject.setCreateTime(DateUtils.getNowDate());
return deviceInspectProjectMapper.insertDeviceInspectProject(deviceInspectProject);
}
/**
*
*
* @param deviceInspectProject
* @return
*/
@Override
public int updateDeviceInspectProject(DeviceInspectProject deviceInspectProject) {
deviceInspectProject.setUpdateBy(ShiroUtils.getLoginName());
deviceInspectProject.setUpdateTime(DateUtils.getNowDate());
return deviceInspectProjectMapper.updateDeviceInspectProject(deviceInspectProject);
}
/**
*
*
* @param objIds
* @return
*/
@Override
public int deleteDeviceInspectProjectByObjIds(String objIds) {
return deviceInspectProjectMapper.deleteDeviceInspectProjectByObjIds(Convert.toStrArray(objIds));
}
/**
*
*
* @param objId
* @return
*/
@Override
public int deleteDeviceInspectProjectByObjId(Long objId) {
return deviceInspectProjectMapper.deleteDeviceInspectProjectByObjId(objId);
}
}

@ -0,0 +1,101 @@
package com.ruoyi.device.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.device.mapper.DeviceInspectionManualMapper;
import com.ruoyi.device.domain.DeviceInspectionManual;
import com.ruoyi.device.service.IDeviceInspectionManualService;
import com.ruoyi.common.core.text.Convert;
/**
* Service
*
* @author wangh
* @date 2025-09-30
*/
@Service
public class DeviceInspectionManualServiceImpl implements IDeviceInspectionManualService {
@Autowired
private DeviceInspectionManualMapper deviceInspectionManualMapper;
/**
*
*
* @param objId
* @return
*/
@Override
public DeviceInspectionManual selectDeviceInspectionManualByObjId(Long objId) {
return deviceInspectionManualMapper.selectDeviceInspectionManualByObjId(objId);
}
/**
*
*
* @param deviceInspectionManual
* @return
*/
@Override
public List<DeviceInspectionManual> selectDeviceInspectionManualList(DeviceInspectionManual deviceInspectionManual) {
return deviceInspectionManualMapper.selectDeviceInspectionManualList(deviceInspectionManual);
}
/**
*
*
* @param deviceInspectionManual
* @return
*/
@Override
public int insertDeviceInspectionManual(DeviceInspectionManual deviceInspectionManual) {
deviceInspectionManual.setCreateBy(ShiroUtils.getLoginName());
deviceInspectionManual.setCreateTime(DateUtils.getNowDate());
return deviceInspectionManualMapper.insertDeviceInspectionManual(deviceInspectionManual);
}
/**
*
*
* @param deviceInspectionManual
* @return
*/
@Override
public int updateDeviceInspectionManual(DeviceInspectionManual deviceInspectionManual) {
deviceInspectionManual.setUpdateBy(ShiroUtils.getLoginName());
deviceInspectionManual.setUpdateTime(DateUtils.getNowDate());
return deviceInspectionManualMapper.updateDeviceInspectionManual(deviceInspectionManual);
}
/**
*
*
* @param objIds
* @return
*/
@Override
public int deleteDeviceInspectionManualByObjIds(String objIds) {
return deviceInspectionManualMapper.deleteDeviceInspectionManualByObjIds(Convert.toStrArray(objIds));
}
/**
*
*
* @param objId
* @return
*/
@Override
public int deleteDeviceInspectionManualByObjId(Long objId) {
return deviceInspectionManualMapper.deleteDeviceInspectionManualByObjId(objId);
}
}

@ -0,0 +1,96 @@
<?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.device.mapper.DeviceInspectProjectMapper">
<resultMap type="DeviceInspectProject" id="DeviceInspectProjectResult">
<result property="objId" column="obj_id" />
<result property="manualId" column="manual_id" />
<result property="inspectProjectCode" column="inspect_project_code" />
<result property="inspectProject" column="inspect_project" />
<result property="inspectProjectProperty" column="inspect_project_property" />
<result property="upLimit" column="up_limit" />
<result property="lowLimit" column="low_limit" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectDeviceInspectProjectVo">
select obj_id, manual_id, inspect_project_code, inspect_project, inspect_project_property, up_limit, low_limit, create_by, create_time, update_by, update_time from device_inspect_project
</sql>
<select id="selectDeviceInspectProjectList" parameterType="DeviceInspectProject" resultMap="DeviceInspectProjectResult">
<include refid="selectDeviceInspectProjectVo"/>
<where>
<if test="manualId != null "> and manual_id = #{manualId}</if>
<if test="inspectProjectCode != null and inspectProjectCode != ''"> and inspect_project_code = #{inspectProjectCode}</if>
<if test="inspectProject != null and inspectProject != ''"> and inspect_project = #{inspectProject}</if>
<if test="inspectProjectProperty != null and inspectProjectProperty != ''"> and inspect_project_property = #{inspectProjectProperty}</if>
</where>
</select>
<select id="selectDeviceInspectProjectByObjId" parameterType="Long" resultMap="DeviceInspectProjectResult">
<include refid="selectDeviceInspectProjectVo"/>
where obj_id = #{objId}
</select>
<insert id="insertDeviceInspectProject" parameterType="DeviceInspectProject" useGeneratedKeys="true" keyProperty="objId">
insert into device_inspect_project
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="manualId != null">manual_id,</if>
<if test="inspectProjectCode != null and inspectProjectCode != ''">inspect_project_code,</if>
<if test="inspectProject != null and inspectProject != ''">inspect_project,</if>
<if test="inspectProjectProperty != null and inspectProjectProperty != ''">inspect_project_property,</if>
<if test="upLimit != null">up_limit,</if>
<if test="lowLimit != null">low_limit,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="manualId != null">#{manualId},</if>
<if test="inspectProjectCode != null and inspectProjectCode != ''">#{inspectProjectCode},</if>
<if test="inspectProject != null and inspectProject != ''">#{inspectProject},</if>
<if test="inspectProjectProperty != null and inspectProjectProperty != ''">#{inspectProjectProperty},</if>
<if test="upLimit != null">#{upLimit},</if>
<if test="lowLimit != null">#{lowLimit},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateDeviceInspectProject" parameterType="DeviceInspectProject">
update device_inspect_project
<trim prefix="SET" suffixOverrides=",">
<if test="manualId != null">manual_id = #{manualId},</if>
<if test="inspectProjectCode != null and inspectProjectCode != ''">inspect_project_code = #{inspectProjectCode},</if>
<if test="inspectProject != null and inspectProject != ''">inspect_project = #{inspectProject},</if>
<if test="inspectProjectProperty != null and inspectProjectProperty != ''">inspect_project_property = #{inspectProjectProperty},</if>
<if test="upLimit != null">up_limit = #{upLimit},</if>
<if test="lowLimit != null">low_limit = #{lowLimit},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where obj_id = #{objId}
</update>
<delete id="deleteDeviceInspectProjectByObjId" parameterType="Long">
delete from device_inspect_project where obj_id = #{objId}
</delete>
<delete id="deleteDeviceInspectProjectByObjIds" parameterType="String">
delete from device_inspect_project where obj_id in
<foreach item="objId" collection="array" open="(" separator="," close=")">
#{objId}
</foreach>
</delete>
</mapper>

@ -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.device.mapper.DeviceInspectionManualMapper">
<resultMap type="DeviceInspectionManual" id="DeviceInspectionManualResult">
<result property="objId" column="obj_id" />
<result property="manualCode" column="manual_code" />
<result property="manualName" column="manual_name" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectDeviceInspectionManualVo">
select obj_id, manual_code, manual_name, create_by, create_time, update_by, update_time from device_inspection_manual
</sql>
<select id="selectDeviceInspectionManualList" parameterType="DeviceInspectionManual" resultMap="DeviceInspectionManualResult">
<include refid="selectDeviceInspectionManualVo"/>
<where>
<if test="manualCode != null and manualCode != ''"> and manual_code = #{manualCode}</if>
<if test="manualName != null and manualName != ''"> and manual_name like concat('%', #{manualName}, '%')</if>
</where>
</select>
<select id="selectDeviceInspectionManualByObjId" parameterType="Long" resultMap="DeviceInspectionManualResult">
<include refid="selectDeviceInspectionManualVo"/>
where obj_id = #{objId}
</select>
<insert id="insertDeviceInspectionManual" parameterType="DeviceInspectionManual" useGeneratedKeys="true" keyProperty="objId">
insert into device_inspection_manual
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="manualCode != null">manual_code,</if>
<if test="manualName != null">manual_name,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="manualCode != null">#{manualCode},</if>
<if test="manualName != null">#{manualName},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateDeviceInspectionManual" parameterType="DeviceInspectionManual">
update device_inspection_manual
<trim prefix="SET" suffixOverrides=",">
<if test="manualCode != null">manual_code = #{manualCode},</if>
<if test="manualName != null">manual_name = #{manualName},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where obj_id = #{objId}
</update>
<delete id="deleteDeviceInspectionManualByObjId" parameterType="Long">
delete from device_inspection_manual where obj_id = #{objId}
</delete>
<delete id="deleteDeviceInspectionManualByObjIds" parameterType="String">
delete from device_inspection_manual where obj_id in
<foreach item="objId" collection="array" open="(" separator="," close=")">
#{objId}
</foreach>
</delete>
</mapper>

@ -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('巡检项目管理', '2168', '1', '/device/inspect_project', 'C', '0', 'device:inspect_project: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', 'device:inspect_project: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', 'device:inspect_project: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', 'device:inspect_project: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', 'device:inspect_project: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', 'device:inspect_project:export', '#', 'admin', sysdate(), '', null, '');

@ -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('巡检手册管理', '2168', '1', '/device/inspection_manual', 'C', '0', 'device:inspection_manual: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', 'device:inspection_manual: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', 'device:inspection_manual: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', 'device:inspection_manual: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', 'device:inspection_manual: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', 'device:inspection_manual:export', '#', 'admin', sysdate(), '', null, '');

@ -0,0 +1,137 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增巡检项目管理')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-inspect_project-add">
<div class="form-group" hidden>
<label class="col-sm-3 control-label is-required">手册编号:</label>
<div class="col-sm-8">
<input name="manualId" id="manualId" class="form-control" type="text" th:value="${manualId}" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">项目编号:</label>
<div class="col-sm-8">
<input name="inspectProjectCode" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">巡检项目:</label>
<div class="col-sm-8">
<input name="inspectProject" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">巡检项目属性:</label>
<div class="col-sm-8">
<select name="inspectProjectProperty" id="inspectProjectProperty" class="form-control m-b" th:with="type=${@dict.getType('inspect_project')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">上限:</label>
<div class="col-sm-8">
<input id="upLimit" name="upLimit" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">下限:</label>
<div class="col-sm-8">
<input id="lowLimit" name="lowLimit" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "device/inspect_project"
$("#form-inspect_project-add").validate({
focusCleanup: true
});
function submitHandler() {
// 提交前再次验证定量项目的上下限
var propertyValue = $('#inspectProjectProperty').val();
if (propertyValue === QUANTITATIVE_VALUE) {
var upLimit = $('#upLimit').val();
var lowLimit = $('#lowLimit').val();
if (!upLimit || !lowLimit) {
$.modal.alertError("定量项目必须输入上限和下限");
return false;
}
if (!/^-?\d+(\.\d+)?$/.test(upLimit) || !/^-?\d+(\.\d+)?$/.test(lowLimit)) {
$.modal.alertError("上限和下限必须为有效的小数");
return false;
}
// 验证上限大于下限
if (parseFloat(upLimit) <= parseFloat(lowLimit)) {
$.modal.alertError("上限必须大于下限");
return false;
}
}
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-inspect_project-add').serialize());
}
}
// 定义定性定量的字典值(根据实际情况调整)
var QUALITATIVE_VALUE = "1"; // 定性对应的值
var QUANTITATIVE_VALUE = "2"; // 定量对应的值
$(document).ready(function() {
// 初始化页面状态
toggleLimitFields();
// 监听巡检项目属性变化
$('#inspectProjectProperty').change(function() {
toggleLimitFields();
});
// 添加上下限的小数验证
$('#upLimit, #lowLimit').on('input', function() {
validateDecimalInput(this);
});
});
// 切换上限下限字段状态
function toggleLimitFields() {
var propertyValue = $('#inspectProjectProperty').val();
if (propertyValue === QUANTITATIVE_VALUE) {
// 定量:必须输入,显示必填标记
$('#upLimitLabel, #lowLimitLabel').addClass('is-required');
$('#upLimit, #lowLimit').prop('required', true);
$('#upLimit, #lowLimit').prop('disabled', false);
$('#upLimit, #lowLimit').css('background-color', '');
} else {
// 定性:不需要输入,清空并禁用
$('#upLimitLabel, #lowLimitLabel').removeClass('is-required');
$('#upLimit, #lowLimit').prop('required', false);
$('#upLimit, #lowLimit').prop('disabled', true);
$('#upLimit, #lowLimit').val('');
$('#upLimit, #lowLimit').css('background-color', '#f5f5f5');
}
}
// 验证小数输入
function validateDecimalInput(input) {
var value = $(input).val();
if (value && !/^-?\d+(\.\d+)?$/.test(value)) {
$(input).addClass('error');
$(input).next('.error-message').remove();
$(input).after('<span class="error-message" style="color:red;">请输入有效的小数</span>');
} else {
$(input).removeClass('error');
$(input).next('.error-message').remove();
}
}
</script>
</body>
</html>

@ -0,0 +1,58 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改巡检项目管理')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-inspect_project-edit" th:object="${deviceInspectProject}">
<input name="objId" th:field="*{objId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label is-required">项目编号:</label>
<div class="col-sm-8">
<input name="inspectProjectCode" th:field="*{inspectProjectCode}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">巡检项目:</label>
<div class="col-sm-8">
<input name="inspectProject" th:field="*{inspectProject}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">巡检项目属性:</label>
<div class="col-sm-8">
<select name="inspectProjectProperty" class="form-control m-b" th:with="type=${@dict.getType('inspect_project')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{inspectProjectProperty}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">上限:</label>
<div class="col-sm-8">
<input name="upLimit" th:field="*{upLimit}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">下限:</label>
<div class="col-sm-8">
<input name="lowLimit" th:field="*{lowLimit}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "device/inspect_project";
$("#form-inspect_project-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-inspect_project-edit').serialize());
}
}
</script>
</body>
</html>

@ -0,0 +1,153 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('巡检项目管理列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li >
<label>id</label>
<input type="text" name="manualId" th:value="${objId}"/>
</li>
<li>
<label>项目编号:</label>
<input type="text" name="inspectProjectCode"/>
</li>
<li>
<label>巡检项目:</label>
<input type="text" name="inspectProject"/>
</li>
<li>
<label>巡检项目属性:</label>
<select name="inspectProjectProperty" th:with="type=${@dict.getType('inspect_project')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="projectAdd()" shiro:hasPermission="device:inspect_project:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="device:inspect_project:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="device:inspect_project:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="device:inspect_project:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('device:inspect_project:edit')}]];
var removeFlag = [[${@permission.hasPermi('device:inspect_project:remove')}]];
var inspectProjectPropertyDatas = [[${@dict.getType('inspect_project')}]];
var prefix = ctx + "device/inspect_project";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add/"+'${manualId}',
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "巡检项目管理",
columns: [{
checkbox: true
},
{
field: 'objId',
title: '主键',
visible: false
},
{
field: 'manualId',
title: '关联手册'
},
{
field: 'inspectProjectCode',
title: '项目编号'
},
{
field: 'inspectProject',
title: '巡检项目'
},
{
field: 'inspectProjectProperty',
title: '巡检项目属性',
formatter: function(value, row, index) {
return $.table.selectDictLabel(inspectProjectPropertyDatas, value);
}
},
{
field: 'upLimit',
title: '上限'
},
{
field: 'lowLimit',
title: '下限'
},
{
field: 'createBy',
title: '创建人'
},
{
field: 'createTime',
title: '创建时间'
},
{
field: 'updateBy',
title: '更新人'
},
{
field: 'updateTime',
title: '更新时间'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.objId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.objId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
function projectAdd() {
//获取当前页面的manualId
let data = $('input[name="manualId"]').val();
console.log(data);
$.modal.open('添加巡检项目', prefix + "/add/"+data);
}
</script>
</body>
</html>

@ -0,0 +1,37 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增巡检手册管理')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-inspection_manual-add">
<div class="form-group">
<label class="col-sm-3 control-label">手册编码:</label>
<div class="col-sm-8">
<input name="manualCode" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">手册名称:</label>
<div class="col-sm-8">
<input name="manualName" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "device/inspection_manual"
$("#form-inspection_manual-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-inspection_manual-add').serialize());
}
}
</script>
</body>
</html>

@ -0,0 +1,38 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改巡检手册管理')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-inspection_manual-edit" th:object="${deviceInspectionManual}">
<input name="objId" th:field="*{objId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">手册编码:</label>
<div class="col-sm-8">
<input name="manualCode" th:field="*{manualCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">手册名称:</label>
<div class="col-sm-8">
<input name="manualName" th:field="*{manualName}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "device/inspection_manual";
$("#form-inspection_manual-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-inspection_manual-edit').serialize());
}
}
</script>
</body>
</html>

@ -0,0 +1,114 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('巡检手册管理列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>手册编码:</label>
<input type="text" name="manualCode"/>
</li>
<li>
<label>手册名称:</label>
<input type="text" name="manualName"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="device:inspection_manual:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="device:inspection_manual:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="device:inspection_manual:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="device:inspection_manual:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('device:inspection_manual:edit')}]];
var removeFlag = [[${@permission.hasPermi('device:inspection_manual:remove')}]];
var prefix = ctx + "device/inspection_manual";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "巡检手册管理",
columns: [{
checkbox: true
},
{
field: 'objId',
title: '主键',
visible: false
},
{
field: 'manualCode',
title: '手册编码'
},
{
field: 'manualName',
title: '手册名称'
},
{
field: 'createBy',
title: '创建人'
},
{
field: 'createTime',
title: '创建时间'
},
{
field: 'updateBy',
title: '更新人'
},
{
field: 'updateTime',
title: '更新时间'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-primary btn-xs " href="javascript:void(0)" onclick="openProjectTable(\'' + row.objId + '\')"><i class="fa fa-sign-in"></i>巡检项目管理</a> ');
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.objId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.objId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
function openProjectTable(objId) {
$.modal.openTab('巡检项目管理', ctx + "device/inspect_project/open/" + objId);
}
</script>
</body>
</html>

@ -5,20 +5,9 @@ import java.util.List;
import java.util.ArrayList;
import com.ruoyi.common.core.domain.Ztree;
#end
#foreach ($column in $columns)
#if($column.javaField == 'createTime' || $column.javaField == 'updateTime')
import com.ruoyi.common.utils.DateUtils;
#break
#end
#if($column.javaField == 'createBy' || $column.javaField == 'updateBy')
import com.ruoyi.common.utils.ShiroUtils;
#break
#end
#end
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
#if($table.sub)

@ -142,7 +142,6 @@
initinspectionTable = function (index, row, $detail) {
// 为每个展开行生成唯一的标识符
var uniqueId = 'tab-' + row.objid + '-';
var [childTable, childTable1] = $detail.html('<div class="col-sm-12">\n' +
' <div class="tabs-container">\n' +
' <ul class="nav nav-tabs">\n' +

Loading…
Cancel
Save