feat(inspection): 添加巡检模块功能并更新项目配置
- 添加巡检告警、地图、机器人、任务、点位等实体类和服务接口 - 创建巡检模块数据库表结构,包含机器人、地图、任务等核心表 - 实现巡检告警控制器,提供增删改查和导出功能 - 配置巡检告警数据映射和查询视图 - 更新全局应用配置中的MinIO服务地址 - 在启动类中添加MyBatis扫描配置 - 重构设备配置实体类,移除冗余字段并优化注解配置
This commit is contained in:
parent
065c21b038
commit
8e4c122f9a
@ -77,6 +77,12 @@
|
|||||||
<groupId>com.cmvr</groupId>
|
<groupId>com.cmvr</groupId>
|
||||||
<artifactId>cmvr-iot-evaluation</artifactId>
|
<artifactId>cmvr-iot-evaluation</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 智能巡检-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.cmvr</groupId>
|
||||||
|
<artifactId>cmvr-iot-inspection</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<properties>
|
<properties>
|
||||||
<env>dev</env>
|
<env>dev</env>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.cmvr;
|
package com.cmvr;
|
||||||
|
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
@ -11,6 +12,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
|||||||
* @author cmvr-iot
|
* @author cmvr-iot
|
||||||
*/
|
*/
|
||||||
@EnableScheduling
|
@EnableScheduling
|
||||||
|
@MapperScan("com.cmvr.**.mapper")
|
||||||
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
||||||
public class CmvrIotApplication
|
public class CmvrIotApplication
|
||||||
{
|
{
|
||||||
|
|||||||
@ -0,0 +1,114 @@
|
|||||||
|
package com.cmvr.web.controller.inspection;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.inspection.domain.InspectionAlarm;
|
||||||
|
import com.cmvr.inspection.domain.vo.InspectionAlarmVo;
|
||||||
|
import com.cmvr.inspection.service.IInspectionAlarmService;
|
||||||
|
import com.cmvr.common.utils.poi.ExcelUtil;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检告警Controller
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/inspection/alarm")
|
||||||
|
@Api(tags = "智能巡检--告警管理")
|
||||||
|
public class InspectionAlarmController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IInspectionAlarmService inspectionAlarmService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检告警列表
|
||||||
|
*/
|
||||||
|
@ApiOperation("查询巡检告警列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:alarm:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(InspectionAlarm inspectionAlarm)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<InspectionAlarmVo> list = inspectionAlarmService.selectInspectionAlarmList(inspectionAlarm);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出巡检告警列表
|
||||||
|
*/
|
||||||
|
@ApiOperation("导出巡检告警列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:alarm:export')")
|
||||||
|
@Log(title = "巡检告警", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, InspectionAlarm inspectionAlarm)
|
||||||
|
{
|
||||||
|
List<InspectionAlarmVo> list = inspectionAlarmService.selectInspectionAlarmList(inspectionAlarm);
|
||||||
|
ExcelUtil<InspectionAlarmVo> util = new ExcelUtil<>(InspectionAlarmVo.class);
|
||||||
|
util.exportExcel(response, list, "巡检告警数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取巡检告警详细信息
|
||||||
|
*/
|
||||||
|
@ApiOperation("获取巡检告警详细信息")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:alarm:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||||
|
{
|
||||||
|
return success(inspectionAlarmService.selectInspectionAlarmById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增巡检告警
|
||||||
|
*/
|
||||||
|
@ApiOperation("新增巡检告警")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:alarm:add')")
|
||||||
|
@Log(title = "巡检告警", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody InspectionAlarm inspectionAlarm)
|
||||||
|
{
|
||||||
|
return toAjax(inspectionAlarmService.insertInspectionAlarm(inspectionAlarm));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改巡检告警
|
||||||
|
*/
|
||||||
|
@ApiOperation("修改巡检告警")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:alarm:edit')")
|
||||||
|
@Log(title = "巡检告警", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody InspectionAlarm inspectionAlarm)
|
||||||
|
{
|
||||||
|
return toAjax(inspectionAlarmService.updateInspectionAlarm(inspectionAlarm));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除巡检告警
|
||||||
|
*/
|
||||||
|
@ApiOperation("删除巡检告警")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:alarm:remove')")
|
||||||
|
@Log(title = "巡检告警", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable String[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(inspectionAlarmService.deleteInspectionAlarmByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,114 @@
|
|||||||
|
package com.cmvr.web.controller.inspection;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.inspection.domain.InspectionMap;
|
||||||
|
import com.cmvr.inspection.domain.vo.InspectionMapVo;
|
||||||
|
import com.cmvr.inspection.service.IInspectionMapService;
|
||||||
|
import com.cmvr.common.utils.poi.ExcelUtil;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检地图Controller
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/inspection/map")
|
||||||
|
@Api(tags = "智能巡检--地图管理")
|
||||||
|
public class InspectionMapController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IInspectionMapService inspectionMapService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检地图列表
|
||||||
|
*/
|
||||||
|
@ApiOperation("查询巡检地图列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:map:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(InspectionMap inspectionMap)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<InspectionMapVo> list = inspectionMapService.selectInspectionMapList(inspectionMap);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出巡检地图列表
|
||||||
|
*/
|
||||||
|
@ApiOperation("导出巡检地图列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:map:export')")
|
||||||
|
@Log(title = "巡检地图", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, InspectionMap inspectionMap)
|
||||||
|
{
|
||||||
|
List<InspectionMapVo> list = inspectionMapService.selectInspectionMapList(inspectionMap);
|
||||||
|
ExcelUtil<InspectionMapVo> util = new ExcelUtil<>(InspectionMapVo.class);
|
||||||
|
util.exportExcel(response, list, "巡检地图数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取巡检地图详细信息
|
||||||
|
*/
|
||||||
|
@ApiOperation("获取巡检地图详细信息")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:map:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||||
|
{
|
||||||
|
return success(inspectionMapService.selectInspectionMapById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增巡检地图
|
||||||
|
*/
|
||||||
|
@ApiOperation("新增巡检地图")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:map:add')")
|
||||||
|
@Log(title = "巡检地图", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody InspectionMap inspectionMap)
|
||||||
|
{
|
||||||
|
return toAjax(inspectionMapService.insertInspectionMap(inspectionMap));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改巡检地图
|
||||||
|
*/
|
||||||
|
@ApiOperation("修改巡检地图")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:map:edit')")
|
||||||
|
@Log(title = "巡检地图", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody InspectionMap inspectionMap)
|
||||||
|
{
|
||||||
|
return toAjax(inspectionMapService.updateInspectionMap(inspectionMap));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除巡检地图
|
||||||
|
*/
|
||||||
|
@ApiOperation("删除巡检地图")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:map:remove')")
|
||||||
|
@Log(title = "巡检地图", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable String[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(inspectionMapService.deleteInspectionMapByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,115 @@
|
|||||||
|
package com.cmvr.web.controller.inspection;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.cmvr.inspection.domain.vo.InspectionRobotVo;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.inspection.domain.InspectionRobot;
|
||||||
|
import com.cmvr.inspection.service.IInspectionRobotService;
|
||||||
|
import com.cmvr.common.utils.poi.ExcelUtil;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检机器人Controller
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/inspection/robot")
|
||||||
|
@Api(tags = "智能巡检--机器人管理")
|
||||||
|
public class InspectionRobotController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IInspectionRobotService inspectionRobotService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检机器人列表
|
||||||
|
*/
|
||||||
|
@ApiOperation("查询巡检机器人列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:robot:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(InspectionRobot inspectionRobot)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<InspectionRobotVo> list = inspectionRobotService.selectInspectionRobotList(inspectionRobot);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出巡检机器人列表
|
||||||
|
*/
|
||||||
|
@ApiOperation("导出巡检机器人列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:robot:export')")
|
||||||
|
@Log(title = "巡检机器人", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, InspectionRobot inspectionRobot)
|
||||||
|
{
|
||||||
|
List<InspectionRobotVo> list = inspectionRobotService.selectInspectionRobotList(inspectionRobot);
|
||||||
|
ExcelUtil<InspectionRobotVo> util = new ExcelUtil<>(InspectionRobotVo.class);
|
||||||
|
util.exportExcel(response, list, "巡检机器人数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取巡检机器人详细信息
|
||||||
|
*/
|
||||||
|
@ApiOperation("获取巡检机器人详细信息")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:robot:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||||
|
{
|
||||||
|
return success(inspectionRobotService.selectInspectionRobotById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增巡检机器人
|
||||||
|
*/
|
||||||
|
@ApiOperation("新增巡检机器人")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:robot:add')")
|
||||||
|
@Log(title = "巡检机器人", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody InspectionRobot inspectionRobot)
|
||||||
|
{
|
||||||
|
return toAjax(inspectionRobotService.insertInspectionRobot(inspectionRobot));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改巡检机器人
|
||||||
|
*/
|
||||||
|
@ApiOperation("修改巡检机器人")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:robot:edit')")
|
||||||
|
@Log(title = "巡检机器人", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody InspectionRobot inspectionRobot)
|
||||||
|
{
|
||||||
|
return toAjax(inspectionRobotService.updateInspectionRobot(inspectionRobot));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除巡检机器人
|
||||||
|
*/
|
||||||
|
@ApiOperation("删除巡检机器人")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:robot:remove')")
|
||||||
|
@Log(title = "巡检机器人", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable String[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(inspectionRobotService.deleteInspectionRobotByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,151 @@
|
|||||||
|
package com.cmvr.web.controller.inspection;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.inspection.domain.InspectionTask;
|
||||||
|
import com.cmvr.inspection.domain.InspectionWaypoint;
|
||||||
|
import com.cmvr.inspection.domain.vo.InspectionTaskVo;
|
||||||
|
import com.cmvr.inspection.service.IInspectionTaskService;
|
||||||
|
import com.cmvr.common.utils.poi.ExcelUtil;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检任务Controller
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/inspection/task")
|
||||||
|
@Api(tags = "智能巡检--任务管理")
|
||||||
|
public class InspectionTaskController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IInspectionTaskService inspectionTaskService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检任务列表
|
||||||
|
*/
|
||||||
|
@ApiOperation("查询巡检任务列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:task:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(InspectionTask inspectionTask)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<InspectionTaskVo> list = inspectionTaskService.selectInspectionTaskList(inspectionTask);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出巡检任务列表
|
||||||
|
*/
|
||||||
|
@ApiOperation("导出巡检任务列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:task:export')")
|
||||||
|
@Log(title = "巡检任务", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, InspectionTask inspectionTask)
|
||||||
|
{
|
||||||
|
List<InspectionTaskVo> list = inspectionTaskService.selectInspectionTaskList(inspectionTask);
|
||||||
|
ExcelUtil<InspectionTaskVo> util = new ExcelUtil<>(InspectionTaskVo.class);
|
||||||
|
util.exportExcel(response, list, "巡检任务数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取巡检任务详细信息
|
||||||
|
*/
|
||||||
|
@ApiOperation("获取巡检任务详细信息")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:task:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||||
|
{
|
||||||
|
return success(inspectionTaskService.selectInspectionTaskById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增巡检任务
|
||||||
|
*/
|
||||||
|
@ApiOperation("新增巡检任务")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:task:add')")
|
||||||
|
@Log(title = "巡检任务", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody InspectionTask inspectionTask)
|
||||||
|
{
|
||||||
|
return toAjax(inspectionTaskService.insertInspectionTask(inspectionTask));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改巡检任务
|
||||||
|
*/
|
||||||
|
@ApiOperation("修改巡检任务")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:task:edit')")
|
||||||
|
@Log(title = "巡检任务", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody InspectionTask inspectionTask)
|
||||||
|
{
|
||||||
|
return toAjax(inspectionTaskService.updateInspectionTask(inspectionTask));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除巡检任务
|
||||||
|
*/
|
||||||
|
@ApiOperation("删除巡检任务")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:task:remove')")
|
||||||
|
@Log(title = "巡检任务", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable String[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(inspectionTaskService.deleteInspectionTaskByIds(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询任务关联的点位列表
|
||||||
|
*/
|
||||||
|
@ApiOperation("查询任务关联的点位列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:task:query')")
|
||||||
|
@GetMapping("/{taskId}/waypoints")
|
||||||
|
public AjaxResult getWaypoints(@PathVariable("taskId") String taskId)
|
||||||
|
{
|
||||||
|
List<InspectionWaypoint> list = inspectionTaskService.selectWaypointsByTaskId(taskId);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定点位到任务
|
||||||
|
*/
|
||||||
|
@ApiOperation("绑定点位到任务")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:task:edit')")
|
||||||
|
@Log(title = "巡检任务", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/{taskId}/waypoints")
|
||||||
|
public AjaxResult bindWaypoints(@PathVariable("taskId") String taskId, @RequestBody String[] waypointIds)
|
||||||
|
{
|
||||||
|
return toAjax(inspectionTaskService.bindWaypoints(taskId, waypointIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解绑任务的点位
|
||||||
|
*/
|
||||||
|
@ApiOperation("解绑任务的点位")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:task:edit')")
|
||||||
|
@Log(title = "巡检任务", businessType = BusinessType.UPDATE)
|
||||||
|
@DeleteMapping("/{taskId}/waypoints")
|
||||||
|
public AjaxResult unbindWaypoints(@PathVariable("taskId") String taskId)
|
||||||
|
{
|
||||||
|
return toAjax(inspectionTaskService.unbindWaypoints(taskId));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,162 @@
|
|||||||
|
package com.cmvr.web.controller.inspection;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.inspection.domain.InspectionTaskInstance;
|
||||||
|
import com.cmvr.inspection.domain.vo.InspectionTaskInstanceVo;
|
||||||
|
import com.cmvr.inspection.service.IInspectionTaskInstanceService;
|
||||||
|
import com.cmvr.common.utils.poi.ExcelUtil;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检任务执行实例Controller
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-06-01
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/inspection/taskInstance")
|
||||||
|
@Api(tags = "智能巡检--任务执行实例管理")
|
||||||
|
public class InspectionTaskInstanceController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IInspectionTaskInstanceService inspectionTaskInstanceService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检任务执行实例列表
|
||||||
|
*/
|
||||||
|
@ApiOperation("查询巡检任务执行实例列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:taskInstance:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(InspectionTaskInstance inspectionTaskInstance)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<InspectionTaskInstanceVo> list = inspectionTaskInstanceService.selectInspectionTaskInstanceList(inspectionTaskInstance);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出巡检任务执行实例列表
|
||||||
|
*/
|
||||||
|
@ApiOperation("导出巡检任务执行实例列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:taskInstance:export')")
|
||||||
|
@Log(title = "巡检任务执行实例", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, InspectionTaskInstance inspectionTaskInstance)
|
||||||
|
{
|
||||||
|
List<InspectionTaskInstanceVo> list = inspectionTaskInstanceService.selectInspectionTaskInstanceList(inspectionTaskInstance);
|
||||||
|
ExcelUtil<InspectionTaskInstanceVo> util = new ExcelUtil<>(InspectionTaskInstanceVo.class);
|
||||||
|
util.exportExcel(response, list, "巡检任务执行实例数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取巡检任务执行实例详细信息
|
||||||
|
*/
|
||||||
|
@ApiOperation("获取巡检任务执行实例详细信息")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:taskInstance:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||||
|
{
|
||||||
|
return success(inspectionTaskInstanceService.selectInspectionTaskInstanceVoById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增巡检任务执行实例
|
||||||
|
*/
|
||||||
|
@ApiOperation("新增巡检任务执行实例")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:taskInstance:add')")
|
||||||
|
@Log(title = "巡检任务执行实例", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody InspectionTaskInstance inspectionTaskInstance)
|
||||||
|
{
|
||||||
|
return toAjax(inspectionTaskInstanceService.insertInspectionTaskInstance(inspectionTaskInstance));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改巡检任务执行实例
|
||||||
|
*/
|
||||||
|
@ApiOperation("修改巡检任务执行实例")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:taskInstance:edit')")
|
||||||
|
@Log(title = "巡检任务执行实例", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody InspectionTaskInstance inspectionTaskInstance)
|
||||||
|
{
|
||||||
|
return toAjax(inspectionTaskInstanceService.updateInspectionTaskInstance(inspectionTaskInstance));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除巡检任务执行实例
|
||||||
|
*/
|
||||||
|
@ApiOperation("删除巡检任务执行实例")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:taskInstance:remove')")
|
||||||
|
@Log(title = "巡检任务执行实例", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable String[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(inspectionTaskInstanceService.deleteInspectionTaskInstanceByIds(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始执行任务实例
|
||||||
|
*/
|
||||||
|
@ApiOperation("开始执行任务实例")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:taskInstance:edit')")
|
||||||
|
@Log(title = "巡检任务执行实例", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping("/start/{id}")
|
||||||
|
public AjaxResult start(@PathVariable("id") String id)
|
||||||
|
{
|
||||||
|
return toAjax(inspectionTaskInstanceService.startInstance(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂停任务实例
|
||||||
|
*/
|
||||||
|
@ApiOperation("暂停任务实例")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:taskInstance:edit')")
|
||||||
|
@Log(title = "巡检任务执行实例", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping("/pause/{id}")
|
||||||
|
public AjaxResult pause(@PathVariable("id") String id)
|
||||||
|
{
|
||||||
|
return toAjax(inspectionTaskInstanceService.pauseInstance(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终止任务实例
|
||||||
|
*/
|
||||||
|
@ApiOperation("终止任务实例")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:taskInstance:edit')")
|
||||||
|
@Log(title = "巡检任务执行实例", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping("/stop/{id}")
|
||||||
|
public AjaxResult stop(@PathVariable("id") String id)
|
||||||
|
{
|
||||||
|
return toAjax(inspectionTaskInstanceService.stopInstance(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 恢复任务实例
|
||||||
|
*/
|
||||||
|
@ApiOperation("恢复任务实例")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:taskInstance:edit')")
|
||||||
|
@Log(title = "巡检任务执行实例", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping("/resume/{id}")
|
||||||
|
public AjaxResult resume(@PathVariable("id") String id)
|
||||||
|
{
|
||||||
|
return toAjax(inspectionTaskInstanceService.resumeInstance(id));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,114 @@
|
|||||||
|
package com.cmvr.web.controller.inspection;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.cmvr.common.annotation.Log;
|
||||||
|
import com.cmvr.common.core.controller.BaseController;
|
||||||
|
import com.cmvr.common.core.domain.AjaxResult;
|
||||||
|
import com.cmvr.common.enums.BusinessType;
|
||||||
|
import com.cmvr.inspection.domain.InspectionWaypoint;
|
||||||
|
import com.cmvr.inspection.domain.vo.InspectionWaypointVo;
|
||||||
|
import com.cmvr.inspection.service.IInspectionWaypointService;
|
||||||
|
import com.cmvr.common.utils.poi.ExcelUtil;
|
||||||
|
import com.cmvr.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检点位Controller
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/inspection/waypoint")
|
||||||
|
@Api(tags = "智能巡检--点位管理")
|
||||||
|
public class InspectionWaypointController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IInspectionWaypointService inspectionWaypointService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检点位列表
|
||||||
|
*/
|
||||||
|
@ApiOperation("查询巡检点位列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:waypoint:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(InspectionWaypoint inspectionWaypoint)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<InspectionWaypointVo> list = inspectionWaypointService.selectInspectionWaypointList(inspectionWaypoint);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出巡检点位列表
|
||||||
|
*/
|
||||||
|
@ApiOperation("导出巡检点位列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:waypoint:export')")
|
||||||
|
@Log(title = "巡检点位", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, InspectionWaypoint inspectionWaypoint)
|
||||||
|
{
|
||||||
|
List<InspectionWaypointVo> list = inspectionWaypointService.selectInspectionWaypointList(inspectionWaypoint);
|
||||||
|
ExcelUtil<InspectionWaypointVo> util = new ExcelUtil<>(InspectionWaypointVo.class);
|
||||||
|
util.exportExcel(response, list, "巡检点位数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取巡检点位详细信息
|
||||||
|
*/
|
||||||
|
@ApiOperation("获取巡检点位详细信息")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:waypoint:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||||
|
{
|
||||||
|
return success(inspectionWaypointService.selectInspectionWaypointById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增巡检点位
|
||||||
|
*/
|
||||||
|
@ApiOperation("新增巡检点位")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:waypoint:add')")
|
||||||
|
@Log(title = "巡检点位", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody InspectionWaypoint inspectionWaypoint)
|
||||||
|
{
|
||||||
|
return toAjax(inspectionWaypointService.insertInspectionWaypoint(inspectionWaypoint));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改巡检点位
|
||||||
|
*/
|
||||||
|
@ApiOperation("修改巡检点位")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:waypoint:edit')")
|
||||||
|
@Log(title = "巡检点位", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody InspectionWaypoint inspectionWaypoint)
|
||||||
|
{
|
||||||
|
return toAjax(inspectionWaypointService.updateInspectionWaypoint(inspectionWaypoint));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除巡检点位
|
||||||
|
*/
|
||||||
|
@ApiOperation("删除巡检点位")
|
||||||
|
@PreAuthorize("@ss.hasPermi('inspection:waypoint:remove')")
|
||||||
|
@Log(title = "巡检点位", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable String[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(inspectionWaypointService.deleteInspectionWaypointByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -51,11 +51,11 @@ public class TeFlowController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation("任务执行入口")
|
@ApiOperation("演示任务执行入口")
|
||||||
@PostMapping("/demo")
|
@PostMapping("/demo")
|
||||||
@Anonymous
|
@Anonymous
|
||||||
public AjaxResult demo(@Valid @RequestBody TeTaskExecuteNormalVO taskExecuteNormalVO) {
|
public AjaxResult demo(@Valid @RequestBody TeTaskExecuteNormalVO taskExecuteNormalVO) {
|
||||||
if (taskInstIdList.size() > 0) {
|
if (!taskInstIdList.isEmpty()) {
|
||||||
try {
|
try {
|
||||||
taskInstIdList.forEach(flowControlService::stop);
|
taskInstIdList.forEach(flowControlService::stop);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@ -92,7 +92,7 @@ spring:
|
|||||||
|
|
||||||
# Minio配置
|
# Minio配置
|
||||||
minio:
|
minio:
|
||||||
url: http://192.168.10:9000
|
url: http://192.168.28.10:9000
|
||||||
accessKey: AKICMVR
|
accessKey: AKICMVR
|
||||||
secretKey: wJalrXUtnFEMI
|
secretKey: wJalrXUtnFEMI
|
||||||
bucketName: cmvr-iot
|
bucketName: cmvr-iot
|
||||||
|
|||||||
@ -6,9 +6,8 @@ import io.swagger.annotations.ApiModel;
|
|||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
|
||||||
import com.cmvr.common.annotation.Excel;
|
import com.cmvr.common.annotation.Excel;
|
||||||
import com.cmvr.common.core.domain.BaseEntity;
|
import com.cmvr.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
@ -16,12 +15,13 @@ import com.cmvr.common.core.domain.BaseEntity;
|
|||||||
* 设备配置信息对象 de_device_profile
|
* 设备配置信息对象 de_device_profile
|
||||||
*
|
*
|
||||||
* @author cmvr-iot
|
* @author cmvr-iot
|
||||||
* @date 2025-05-09
|
* @since 2025-05-09
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@ApiModel("设备配置类")
|
@ApiModel("设备配置类")
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class DeDeviceProfile extends BaseEntity
|
public class DeDeviceProfile extends BaseEntity
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@ -31,11 +31,6 @@ public class DeDeviceProfile extends BaseEntity
|
|||||||
@TableId(value = "id",type = IdType.ASSIGN_UUID)
|
@TableId(value = "id",type = IdType.ASSIGN_UUID)
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
/** 备注 */
|
|
||||||
@Excel(name = "备注")
|
|
||||||
@ApiModelProperty("备注")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
/** 设备id */
|
/** 设备id */
|
||||||
@Excel(name = "设备id")
|
@Excel(name = "设备id")
|
||||||
@ApiModelProperty("设备id")
|
@ApiModelProperty("设备id")
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel;
|
|||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -15,6 +16,7 @@ import java.util.List;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@ApiModel("参数视图类")
|
@ApiModel("参数视图类")
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class ProfileVo extends BaseEntity {
|
public class ProfileVo extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
@ -23,11 +25,6 @@ public class ProfileVo extends BaseEntity {
|
|||||||
@ApiModelProperty("设备类型")
|
@ApiModelProperty("设备类型")
|
||||||
private String deviceModel;
|
private String deviceModel;
|
||||||
|
|
||||||
/** 备注 */
|
|
||||||
@Excel(name = "备注")
|
|
||||||
@ApiModelProperty("备注")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
/** 设备id */
|
/** 设备id */
|
||||||
@Excel(name = "设备id")
|
@Excel(name = "设备id")
|
||||||
@ApiModelProperty("设备id")
|
@ApiModelProperty("设备id")
|
||||||
|
|||||||
33
cmvr-iot-inspection/pom.xml
Normal file
33
cmvr-iot-inspection/pom.xml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.cmvr</groupId>
|
||||||
|
<artifactId>cmvr-iot</artifactId>
|
||||||
|
<version>3.8.9</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>cmvr-iot-inspection</artifactId>
|
||||||
|
|
||||||
|
<description>
|
||||||
|
智能巡检模块
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
<!-- 通用工具-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.cmvr</groupId>
|
||||||
|
<artifactId>cmvr-iot-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 测试模块-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.cmvr</groupId>
|
||||||
|
<artifactId>cmvr-iot-test</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
@ -0,0 +1,102 @@
|
|||||||
|
package com.cmvr.inspection.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import com.cmvr.common.annotation.Excel;
|
||||||
|
import com.cmvr.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检告警对象 inspection_alarm
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ApiModel("巡检告警")
|
||||||
|
public class InspectionAlarm extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Excel(name = "告警编码")
|
||||||
|
@ApiModelProperty("告警编码")
|
||||||
|
private String alarmCode;
|
||||||
|
|
||||||
|
@Excel(name = "任务执行实例ID")
|
||||||
|
@ApiModelProperty("任务执行实例ID")
|
||||||
|
private String taskInstanceId;
|
||||||
|
|
||||||
|
@Excel(name = "任务ID")
|
||||||
|
@ApiModelProperty("任务ID")
|
||||||
|
private String taskId;
|
||||||
|
|
||||||
|
@Excel(name = "任务名称")
|
||||||
|
@ApiModelProperty("任务名称")
|
||||||
|
private String taskName;
|
||||||
|
|
||||||
|
@Excel(name = "机器人ID")
|
||||||
|
@ApiModelProperty("机器人ID")
|
||||||
|
private String robotId;
|
||||||
|
|
||||||
|
@Excel(name = "机器人名称")
|
||||||
|
@ApiModelProperty("机器人名称")
|
||||||
|
private String robotName;
|
||||||
|
|
||||||
|
@Excel(name = "告警级别")
|
||||||
|
@ApiModelProperty("告警级别(1提示 2警告 3严重)")
|
||||||
|
private String alarmLevel;
|
||||||
|
|
||||||
|
@Excel(name = "告警类型")
|
||||||
|
@ApiModelProperty("告警类型(1设备异常 2环境异常 3任务异常 4通信异常)")
|
||||||
|
private String alarmType;
|
||||||
|
|
||||||
|
@Excel(name = "告警标题")
|
||||||
|
@ApiModelProperty("告警标题")
|
||||||
|
private String alarmTitle;
|
||||||
|
|
||||||
|
@Excel(name = "告警内容")
|
||||||
|
@ApiModelProperty("告警内容")
|
||||||
|
private String alarmContent;
|
||||||
|
|
||||||
|
@Excel(name = "告警位置")
|
||||||
|
@ApiModelProperty("告警位置")
|
||||||
|
private String alarmLocation;
|
||||||
|
|
||||||
|
@Excel(name = "告警时间")
|
||||||
|
@ApiModelProperty("告警时间")
|
||||||
|
private Date alarmTime;
|
||||||
|
|
||||||
|
@Excel(name = "处理状态")
|
||||||
|
@ApiModelProperty("处理状态(0未处理 1处理中 2已处理 3已忽略)")
|
||||||
|
private String handleStatus;
|
||||||
|
|
||||||
|
@Excel(name = "处理人")
|
||||||
|
@ApiModelProperty("处理人")
|
||||||
|
private String handler;
|
||||||
|
|
||||||
|
@Excel(name = "处理时间")
|
||||||
|
@ApiModelProperty("处理时间")
|
||||||
|
private Date handleTime;
|
||||||
|
|
||||||
|
@Excel(name = "处理说明")
|
||||||
|
@ApiModelProperty("处理说明")
|
||||||
|
private String handleRemark;
|
||||||
|
|
||||||
|
@ApiModelProperty("图片证据")
|
||||||
|
private String evidenceImage;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,64 @@
|
|||||||
|
package com.cmvr.inspection.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import com.cmvr.common.annotation.Excel;
|
||||||
|
import com.cmvr.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检地图对象 inspection_map
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ApiModel("巡检地图")
|
||||||
|
public class InspectionMap extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** id */
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/** 地图名称 */
|
||||||
|
@Excel(name = "地图名称")
|
||||||
|
@ApiModelProperty("地图名称")
|
||||||
|
private String mapName;
|
||||||
|
|
||||||
|
/** 地图来源的机器人id */
|
||||||
|
@Excel(name = "地图来源的机器人id")
|
||||||
|
@ApiModelProperty("地图来源的机器人id")
|
||||||
|
private String mapSourceRobotId;
|
||||||
|
|
||||||
|
/** 地图来源的地图名称 */
|
||||||
|
@Excel(name = "地图来源的地图名称")
|
||||||
|
@ApiModelProperty("地图来源的地图名称")
|
||||||
|
private String mapSourceName;
|
||||||
|
|
||||||
|
/** 地图文件路径 */
|
||||||
|
@Excel(name = "地图文件路径")
|
||||||
|
@ApiModelProperty("地图文件路径")
|
||||||
|
private String mapFilePath;
|
||||||
|
|
||||||
|
/** 状态 */
|
||||||
|
@Excel(name = "状态")
|
||||||
|
@ApiModelProperty("状态(0正常 1停用)")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/** 地图描述 */
|
||||||
|
@Excel(name = "地图描述")
|
||||||
|
@ApiModelProperty("地图描述")
|
||||||
|
private String mapDesc;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,84 @@
|
|||||||
|
package com.cmvr.inspection.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import com.cmvr.common.annotation.Excel;
|
||||||
|
import com.cmvr.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检机器人对象 inspection_robot
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ApiModel("巡检机器人")
|
||||||
|
public class InspectionRobot extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** id */
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/** 机器人编码 */
|
||||||
|
@Excel(name = "机器人编码")
|
||||||
|
@ApiModelProperty("机器人编码")
|
||||||
|
private String robotCode;
|
||||||
|
|
||||||
|
/** 机器人名称 */
|
||||||
|
@Excel(name = "机器人名称")
|
||||||
|
@ApiModelProperty("机器人名称")
|
||||||
|
private String robotName;
|
||||||
|
|
||||||
|
/** 机器人型号 */
|
||||||
|
@Excel(name = "机器人型号")
|
||||||
|
@ApiModelProperty("机器人型号")
|
||||||
|
private String robotModel;
|
||||||
|
|
||||||
|
/** 机器人类型 */
|
||||||
|
@Excel(name = "机器人类型")
|
||||||
|
@ApiModelProperty("机器人类型")
|
||||||
|
private String robotType;
|
||||||
|
|
||||||
|
/** IP地址 */
|
||||||
|
@Excel(name = "IP地址")
|
||||||
|
@ApiModelProperty("IP地址")
|
||||||
|
private String ipAddress;
|
||||||
|
|
||||||
|
/** 端口号 */
|
||||||
|
@Excel(name = "端口号")
|
||||||
|
@ApiModelProperty("端口号")
|
||||||
|
private Integer port;
|
||||||
|
|
||||||
|
/** 当前地图 */
|
||||||
|
@Excel(name = "当前地图")
|
||||||
|
@ApiModelProperty("当前地图")
|
||||||
|
private String currentMapId;
|
||||||
|
|
||||||
|
/** 当前状态 */
|
||||||
|
@Excel(name = "当前状态")
|
||||||
|
@ApiModelProperty("当前状态(0在线 1离线 2充电中 3巡检中)")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/** 电量百分比 */
|
||||||
|
@Excel(name = "电量百分比")
|
||||||
|
@ApiModelProperty("电量百分比")
|
||||||
|
private Integer batteryLevel;
|
||||||
|
|
||||||
|
/** 当前位置 */
|
||||||
|
@Excel(name = "当前位置")
|
||||||
|
@ApiModelProperty("当前位置")
|
||||||
|
private String currentPosition;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
package com.cmvr.inspection.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import com.cmvr.common.annotation.Excel;
|
||||||
|
import com.cmvr.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检任务对象 inspection_task
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ApiModel("巡检任务")
|
||||||
|
public class InspectionTask extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Excel(name = "任务编码")
|
||||||
|
@ApiModelProperty("任务编码")
|
||||||
|
private String taskCode;
|
||||||
|
|
||||||
|
@Excel(name = "任务名称")
|
||||||
|
@ApiModelProperty("任务名称")
|
||||||
|
private String taskName;
|
||||||
|
|
||||||
|
@Excel(name = "任务类型")
|
||||||
|
@ApiModelProperty("任务类型(1巡检任务 2讲解任务)")
|
||||||
|
private String taskType;
|
||||||
|
|
||||||
|
/** 任务id */
|
||||||
|
@Excel(name = "任务id")
|
||||||
|
@ApiModelProperty("任务id")
|
||||||
|
private String teTaskConfigId;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,55 @@
|
|||||||
|
package com.cmvr.inspection.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import com.cmvr.common.annotation.Excel;
|
||||||
|
import com.cmvr.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检任务执行实例对象 inspection_task_instance
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-06-01
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ApiModel("巡检任务执行实例")
|
||||||
|
public class InspectionTaskInstance extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Excel(name = "任务ID")
|
||||||
|
@ApiModelProperty("任务ID")
|
||||||
|
private String taskId;
|
||||||
|
|
||||||
|
@Excel(name = "机器人ID")
|
||||||
|
@ApiModelProperty("机器人ID")
|
||||||
|
private String robotId;
|
||||||
|
|
||||||
|
@Excel(name = "执行状态")
|
||||||
|
@ApiModelProperty("执行状态(0待执行 1执行中 2已完成 3已取消 4执行失败 5已暂停)")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Excel(name = "开始时间")
|
||||||
|
@ApiModelProperty("开始时间")
|
||||||
|
private Date startTime;
|
||||||
|
|
||||||
|
@Excel(name = "结束时间")
|
||||||
|
@ApiModelProperty("结束时间")
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
package com.cmvr.inspection.domain;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检任务与点位关联对象 inspection_task_waypoint
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-06-01
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class InspectionTaskWaypoint
|
||||||
|
{
|
||||||
|
/** 任务ID */
|
||||||
|
private String taskId;
|
||||||
|
|
||||||
|
/** 点位ID */
|
||||||
|
private String waypointId;
|
||||||
|
|
||||||
|
/** 排序号 */
|
||||||
|
private Integer sortOrder;
|
||||||
|
}
|
||||||
@ -0,0 +1,54 @@
|
|||||||
|
package com.cmvr.inspection.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import com.cmvr.common.annotation.Excel;
|
||||||
|
import com.cmvr.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检点位对象 inspection_waypoint
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ApiModel("巡检点位")
|
||||||
|
public class InspectionWaypoint extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Excel(name = "点位名称")
|
||||||
|
@ApiModelProperty("点位名称")
|
||||||
|
private String waypointName;
|
||||||
|
|
||||||
|
@Excel(name = "是否启用")
|
||||||
|
@ApiModelProperty("是否启用(0启用 1禁用)")
|
||||||
|
private String enabled;
|
||||||
|
|
||||||
|
@Excel(name = "排序号")
|
||||||
|
@ApiModelProperty("排序号")
|
||||||
|
private Integer sortOrder;
|
||||||
|
|
||||||
|
/** 检测项配置id */
|
||||||
|
@Excel(name = "检测项配置id")
|
||||||
|
@ApiModelProperty("检测项配置id")
|
||||||
|
private String detectItemId;
|
||||||
|
|
||||||
|
@Excel(name = "地图id")
|
||||||
|
@ApiModelProperty("地图id")
|
||||||
|
private String mapId;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,127 @@
|
|||||||
|
package com.cmvr.inspection.domain.vo;
|
||||||
|
|
||||||
|
import com.cmvr.common.annotation.Excel;
|
||||||
|
import com.cmvr.common.core.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检告警视图对象(包含关联信息)
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ApiModel("巡检告警视图对象")
|
||||||
|
public class InspectionAlarmVo extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** id */
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/** 告警编码 */
|
||||||
|
@Excel(name = "告警编码")
|
||||||
|
@ApiModelProperty("告警编码")
|
||||||
|
private String alarmCode;
|
||||||
|
|
||||||
|
/** 任务执行实例ID */
|
||||||
|
@Excel(name = "任务执行实例ID")
|
||||||
|
@ApiModelProperty("任务执行实例ID")
|
||||||
|
private String taskInstanceId;
|
||||||
|
|
||||||
|
/** 任务ID */
|
||||||
|
@Excel(name = "任务ID")
|
||||||
|
@ApiModelProperty("任务ID")
|
||||||
|
private String taskId;
|
||||||
|
|
||||||
|
/** 任务名称(关联字段) */
|
||||||
|
@Excel(name = "任务名称")
|
||||||
|
@ApiModelProperty("任务名称")
|
||||||
|
private String taskName;
|
||||||
|
|
||||||
|
/** 机器人ID */
|
||||||
|
@Excel(name = "机器人ID")
|
||||||
|
@ApiModelProperty("机器人ID")
|
||||||
|
private String robotId;
|
||||||
|
|
||||||
|
/** 机器人名称(关联字段) */
|
||||||
|
@Excel(name = "机器人名称")
|
||||||
|
@ApiModelProperty("机器人名称")
|
||||||
|
private String robotName;
|
||||||
|
|
||||||
|
/** 告警级别 */
|
||||||
|
@Excel(name = "告警级别")
|
||||||
|
@ApiModelProperty("告警级别(1提示 2警告 3严重)")
|
||||||
|
private String alarmLevel;
|
||||||
|
|
||||||
|
/** 告警类型 */
|
||||||
|
@Excel(name = "告警类型")
|
||||||
|
@ApiModelProperty("告警类型(1设备异常 2环境异常 3任务异常 4通信异常)")
|
||||||
|
private String alarmType;
|
||||||
|
|
||||||
|
/** 告警标题 */
|
||||||
|
@Excel(name = "告警标题")
|
||||||
|
@ApiModelProperty("告警标题")
|
||||||
|
private String alarmTitle;
|
||||||
|
|
||||||
|
/** 告警内容 */
|
||||||
|
@Excel(name = "告警内容")
|
||||||
|
@ApiModelProperty("告警内容")
|
||||||
|
private String alarmContent;
|
||||||
|
|
||||||
|
/** 告警位置 */
|
||||||
|
@Excel(name = "告警位置")
|
||||||
|
@ApiModelProperty("告警位置")
|
||||||
|
private String alarmLocation;
|
||||||
|
|
||||||
|
/** 告警时间 */
|
||||||
|
@Excel(name = "告警时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty("告警时间")
|
||||||
|
private Date alarmTime;
|
||||||
|
|
||||||
|
/** 处理状态 */
|
||||||
|
@Excel(name = "处理状态")
|
||||||
|
@ApiModelProperty("处理状态(0未处理 1处理中 2已处理 3已忽略)")
|
||||||
|
private String handleStatus;
|
||||||
|
|
||||||
|
/** 处理人 */
|
||||||
|
@Excel(name = "处理人")
|
||||||
|
@ApiModelProperty("处理人")
|
||||||
|
private String handler;
|
||||||
|
|
||||||
|
/** 处理时间 */
|
||||||
|
@Excel(name = "处理时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty("处理时间")
|
||||||
|
private Date handleTime;
|
||||||
|
|
||||||
|
/** 处理说明 */
|
||||||
|
@Excel(name = "处理说明")
|
||||||
|
@ApiModelProperty("处理说明")
|
||||||
|
private String handleRemark;
|
||||||
|
|
||||||
|
/** 图片证据 */
|
||||||
|
@Excel(name = "图片证据")
|
||||||
|
@ApiModelProperty("图片证据")
|
||||||
|
private String evidenceImage;
|
||||||
|
|
||||||
|
/** 创建人昵称 */
|
||||||
|
@Excel(name = "创建人昵称")
|
||||||
|
@ApiModelProperty("创建人昵称")
|
||||||
|
private String createByName;
|
||||||
|
|
||||||
|
/** 修改人昵称 */
|
||||||
|
@Excel(name = "修改人昵称")
|
||||||
|
@ApiModelProperty("修改人昵称")
|
||||||
|
private String updateByName;
|
||||||
|
}
|
||||||
@ -0,0 +1,76 @@
|
|||||||
|
package com.cmvr.inspection.domain.vo;
|
||||||
|
|
||||||
|
import com.cmvr.common.annotation.Excel;
|
||||||
|
import com.cmvr.common.core.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检地图视图对象(包含关联信息)
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ApiModel("巡检地图视图对象")
|
||||||
|
public class InspectionMapVo extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** id */
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/** 地图名称 */
|
||||||
|
@Excel(name = "地图名称")
|
||||||
|
@ApiModelProperty("地图名称")
|
||||||
|
private String mapName;
|
||||||
|
|
||||||
|
/** 地图来源的机器人id */
|
||||||
|
@Excel(name = "地图来源的机器人id")
|
||||||
|
@ApiModelProperty("地图来源的机器人id")
|
||||||
|
private String mapSourceRobotId;
|
||||||
|
|
||||||
|
/** 地图来源的机器人名称(关联字段) */
|
||||||
|
@Excel(name = "地图来源的机器人名称")
|
||||||
|
@ApiModelProperty("地图来源的机器人名称")
|
||||||
|
private String mapSourceRobotName;
|
||||||
|
|
||||||
|
/** 地图来源的地图名称 */
|
||||||
|
@Excel(name = "地图来源的地图名称")
|
||||||
|
@ApiModelProperty("地图来源的地图名称")
|
||||||
|
private String mapSourceName;
|
||||||
|
|
||||||
|
/** 地图文件路径 */
|
||||||
|
@Excel(name = "地图文件路径")
|
||||||
|
@ApiModelProperty("地图文件路径")
|
||||||
|
private String mapFilePath;
|
||||||
|
|
||||||
|
/** 状态 */
|
||||||
|
@Excel(name = "状态")
|
||||||
|
@ApiModelProperty("状态(0正常 1停用)")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/** 地图描述 */
|
||||||
|
@Excel(name = "地图描述")
|
||||||
|
@ApiModelProperty("地图描述")
|
||||||
|
private String mapDesc;
|
||||||
|
|
||||||
|
/** 创建人昵称 */
|
||||||
|
@Excel(name = "创建人昵称")
|
||||||
|
@ApiModelProperty("创建人昵称")
|
||||||
|
private String createByName;
|
||||||
|
|
||||||
|
/** 修改人昵称 */
|
||||||
|
@Excel(name = "修改人昵称")
|
||||||
|
@ApiModelProperty("修改人昵称")
|
||||||
|
private String updateByName;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,96 @@
|
|||||||
|
package com.cmvr.inspection.domain.vo;
|
||||||
|
|
||||||
|
import com.cmvr.common.annotation.Excel;
|
||||||
|
import com.cmvr.common.core.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检机器人视图对象(包含关联信息)
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ApiModel("巡检机器人视图对象")
|
||||||
|
public class InspectionRobotVo extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** id */
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/** 机器人编码 */
|
||||||
|
@Excel(name = "机器人编码")
|
||||||
|
@ApiModelProperty("机器人编码")
|
||||||
|
private String robotCode;
|
||||||
|
|
||||||
|
/** 机器人名称 */
|
||||||
|
@Excel(name = "机器人名称")
|
||||||
|
@ApiModelProperty("机器人名称")
|
||||||
|
private String robotName;
|
||||||
|
|
||||||
|
/** 机器人型号 */
|
||||||
|
@Excel(name = "机器人型号")
|
||||||
|
@ApiModelProperty("机器人型号")
|
||||||
|
private String robotModel;
|
||||||
|
|
||||||
|
/** 机器人类型 */
|
||||||
|
@Excel(name = "机器人类型")
|
||||||
|
@ApiModelProperty("机器人类型")
|
||||||
|
private String robotType;
|
||||||
|
|
||||||
|
/** IP地址 */
|
||||||
|
@Excel(name = "IP地址")
|
||||||
|
@ApiModelProperty("IP地址")
|
||||||
|
private String ipAddress;
|
||||||
|
|
||||||
|
/** 端口号 */
|
||||||
|
@Excel(name = "端口号")
|
||||||
|
@ApiModelProperty("端口号")
|
||||||
|
private Integer port;
|
||||||
|
|
||||||
|
/** 当前地图ID */
|
||||||
|
@Excel(name = "当前地图ID")
|
||||||
|
@ApiModelProperty("当前地图ID")
|
||||||
|
private String currentMapId;
|
||||||
|
|
||||||
|
/** 当前地图名称(关联字段) */
|
||||||
|
@Excel(name = "当前地图名称")
|
||||||
|
@ApiModelProperty("当前地图名称")
|
||||||
|
private String currentMapName;
|
||||||
|
|
||||||
|
/** 当前状态 */
|
||||||
|
@Excel(name = "当前状态")
|
||||||
|
@ApiModelProperty("当前状态(0在线 1离线 2充电中 3巡检中)")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/** 电量百分比 */
|
||||||
|
@Excel(name = "电量百分比")
|
||||||
|
@ApiModelProperty("电量百分比")
|
||||||
|
private Integer batteryLevel;
|
||||||
|
|
||||||
|
/** 当前位置 */
|
||||||
|
@Excel(name = "当前位置")
|
||||||
|
@ApiModelProperty("当前位置")
|
||||||
|
private String currentPosition;
|
||||||
|
|
||||||
|
/** 创建人昵称 */
|
||||||
|
@Excel(name = "创建人昵称")
|
||||||
|
@ApiModelProperty("创建人昵称")
|
||||||
|
private String createByName;
|
||||||
|
|
||||||
|
/** 修改人昵称 */
|
||||||
|
@Excel(name = "修改人昵称")
|
||||||
|
@ApiModelProperty("修改人昵称")
|
||||||
|
private String updateByName;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,93 @@
|
|||||||
|
package com.cmvr.inspection.domain.vo;
|
||||||
|
|
||||||
|
import com.cmvr.common.annotation.Excel;
|
||||||
|
import com.cmvr.common.core.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检任务执行实例视图对象(包含关联信息)
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-06-01
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ApiModel("巡检任务执行实例视图对象")
|
||||||
|
public class InspectionTaskInstanceVo extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** id */
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/** 任务ID */
|
||||||
|
@Excel(name = "任务ID")
|
||||||
|
@ApiModelProperty("任务ID")
|
||||||
|
private String taskId;
|
||||||
|
|
||||||
|
/** 任务名称(关联字段) */
|
||||||
|
@Excel(name = "任务名称")
|
||||||
|
@ApiModelProperty("任务名称")
|
||||||
|
private String taskName;
|
||||||
|
|
||||||
|
/** 任务编码(关联字段) */
|
||||||
|
@Excel(name = "任务编码")
|
||||||
|
@ApiModelProperty("任务编码")
|
||||||
|
private String taskCode;
|
||||||
|
|
||||||
|
/** 机器人ID */
|
||||||
|
@Excel(name = "机器人ID")
|
||||||
|
@ApiModelProperty("机器人ID")
|
||||||
|
private String robotId;
|
||||||
|
|
||||||
|
/** 机器人名称(关联字段) */
|
||||||
|
@Excel(name = "机器人名称")
|
||||||
|
@ApiModelProperty("机器人名称")
|
||||||
|
private String robotName;
|
||||||
|
|
||||||
|
/** 地图ID */
|
||||||
|
@Excel(name = "地图ID")
|
||||||
|
@ApiModelProperty("地图ID")
|
||||||
|
private String mapId;
|
||||||
|
|
||||||
|
/** 地图名称(关联字段) */
|
||||||
|
@Excel(name = "地图名称")
|
||||||
|
@ApiModelProperty("地图名称")
|
||||||
|
private String mapName;
|
||||||
|
|
||||||
|
/** 执行状态 */
|
||||||
|
@Excel(name = "执行状态")
|
||||||
|
@ApiModelProperty("执行状态(0待执行 1执行中 2已完成 3已取消 4执行失败 5已暂停)")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/** 开始时间 */
|
||||||
|
@Excel(name = "开始时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty("开始时间")
|
||||||
|
private Date startTime;
|
||||||
|
|
||||||
|
/** 结束时间 */
|
||||||
|
@Excel(name = "结束时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty("结束时间")
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
/** 创建人昵称 */
|
||||||
|
@Excel(name = "创建人昵称")
|
||||||
|
@ApiModelProperty("创建人昵称")
|
||||||
|
private String createByName;
|
||||||
|
|
||||||
|
/** 修改人昵称 */
|
||||||
|
@Excel(name = "修改人昵称")
|
||||||
|
@ApiModelProperty("修改人昵称")
|
||||||
|
private String updateByName;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
package com.cmvr.inspection.domain.vo;
|
||||||
|
|
||||||
|
import com.cmvr.common.annotation.Excel;
|
||||||
|
import com.cmvr.common.core.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检任务视图对象(包含关联信息)
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ApiModel("巡检任务视图对象")
|
||||||
|
public class InspectionTaskVo extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** id */
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/** 任务编码 */
|
||||||
|
@Excel(name = "任务编码")
|
||||||
|
@ApiModelProperty("任务编码")
|
||||||
|
private String taskCode;
|
||||||
|
|
||||||
|
/** 任务名称 */
|
||||||
|
@Excel(name = "任务名称")
|
||||||
|
@ApiModelProperty("任务名称")
|
||||||
|
private String taskName;
|
||||||
|
|
||||||
|
/** 任务类型 */
|
||||||
|
@Excel(name = "任务类型")
|
||||||
|
@ApiModelProperty("任务类型(1巡检任务 2讲解任务)")
|
||||||
|
private String taskType;
|
||||||
|
|
||||||
|
/** 创建人昵称 */
|
||||||
|
@Excel(name = "创建人昵称")
|
||||||
|
@ApiModelProperty("创建人昵称")
|
||||||
|
private String createByName;
|
||||||
|
|
||||||
|
/** 修改人昵称 */
|
||||||
|
@Excel(name = "修改人昵称")
|
||||||
|
@ApiModelProperty("修改人昵称")
|
||||||
|
private String updateByName;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,75 @@
|
|||||||
|
package com.cmvr.inspection.domain.vo;
|
||||||
|
|
||||||
|
import com.cmvr.common.annotation.Excel;
|
||||||
|
import com.cmvr.common.core.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检点位视图对象(包含关联信息)
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ApiModel("巡检点位视图对象")
|
||||||
|
public class InspectionWaypointVo extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** id */
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/** 点位名称 */
|
||||||
|
@Excel(name = "点位名称")
|
||||||
|
@ApiModelProperty("点位名称")
|
||||||
|
private String waypointName;
|
||||||
|
|
||||||
|
/** 是否启用 */
|
||||||
|
@Excel(name = "是否启用")
|
||||||
|
@ApiModelProperty("是否启用(0启用 1禁用)")
|
||||||
|
private String enabled;
|
||||||
|
|
||||||
|
/** 排序号 */
|
||||||
|
@Excel(name = "排序号")
|
||||||
|
@ApiModelProperty("排序号")
|
||||||
|
private Integer sortOrder;
|
||||||
|
|
||||||
|
/** 检测项配置id */
|
||||||
|
@Excel(name = "检测项配置id")
|
||||||
|
@ApiModelProperty("检测项配置id")
|
||||||
|
private String detectItemId;
|
||||||
|
|
||||||
|
/** 配置状态 */
|
||||||
|
@Excel(name = "配置状态")
|
||||||
|
@ApiModelProperty("配置状态")
|
||||||
|
private String configStatus;
|
||||||
|
|
||||||
|
/** 地图id */
|
||||||
|
@Excel(name = "地图id")
|
||||||
|
@ApiModelProperty("地图id")
|
||||||
|
private String mapId;
|
||||||
|
|
||||||
|
/** 地图名称 */
|
||||||
|
@Excel(name = "地图名称")
|
||||||
|
@ApiModelProperty("地图名称")
|
||||||
|
private String mapName;
|
||||||
|
|
||||||
|
/** 创建人昵称 */
|
||||||
|
@Excel(name = "创建人昵称")
|
||||||
|
@ApiModelProperty("创建人昵称")
|
||||||
|
private String createByName;
|
||||||
|
|
||||||
|
/** 修改人昵称 */
|
||||||
|
@Excel(name = "修改人昵称")
|
||||||
|
@ApiModelProperty("修改人昵称")
|
||||||
|
private String updateByName;
|
||||||
|
}
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
package com.cmvr.inspection.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum TaskStatusEnum {
|
||||||
|
// 未执行
|
||||||
|
NOT_STARTED(5, "未执行"),
|
||||||
|
SUCCESS(0, "已完成"),
|
||||||
|
RUNNING(1, "执行中"),
|
||||||
|
FAILED(2, "失败"),
|
||||||
|
PAUSED(3, "已暂停"),
|
||||||
|
STOPPED(4, "已终止");
|
||||||
|
|
||||||
|
private final int code;
|
||||||
|
private final String desc;
|
||||||
|
|
||||||
|
public static TaskStatusEnum fromCode(int code) {
|
||||||
|
for (TaskStatusEnum status : values()) {
|
||||||
|
if (status.code == code) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,55 @@
|
|||||||
|
package com.cmvr.inspection.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.cmvr.inspection.domain.InspectionAlarm;
|
||||||
|
import com.cmvr.inspection.domain.vo.InspectionAlarmVo;
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检告警Mapper接口
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
public interface InspectionAlarmMapper extends MPJBaseMapper<InspectionAlarm>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询巡检告警
|
||||||
|
*
|
||||||
|
* @param id 巡检告警主键
|
||||||
|
* @return 巡检告警
|
||||||
|
*/
|
||||||
|
InspectionAlarm selectInspectionAlarmById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增巡检告警
|
||||||
|
*
|
||||||
|
* @param inspectionAlarm 巡检告警
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertInspectionAlarm(InspectionAlarm inspectionAlarm);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改巡检告警
|
||||||
|
*
|
||||||
|
* @param inspectionAlarm 巡检告警
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateInspectionAlarm(InspectionAlarm inspectionAlarm);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除巡检告警
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteInspectionAlarmByIds(String[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检告警视图列表(包含关联信息)
|
||||||
|
*
|
||||||
|
* @param inspectionAlarm 巡检告警
|
||||||
|
* @return 巡检告警视图集合
|
||||||
|
*/
|
||||||
|
List<InspectionAlarmVo> selectInspectionAlarmVoList(InspectionAlarm inspectionAlarm);
|
||||||
|
}
|
||||||
@ -0,0 +1,54 @@
|
|||||||
|
package com.cmvr.inspection.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.cmvr.inspection.domain.InspectionMap;
|
||||||
|
import com.cmvr.inspection.domain.vo.InspectionMapVo;
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检地图Mapper接口
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
*/
|
||||||
|
public interface InspectionMapMapper extends MPJBaseMapper<InspectionMap>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询巡检地图
|
||||||
|
*
|
||||||
|
* @param id 巡检地图主键
|
||||||
|
* @return 巡检地图
|
||||||
|
*/
|
||||||
|
InspectionMap selectInspectionMapById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增巡检地图
|
||||||
|
*
|
||||||
|
* @param inspectionMap 巡检地图
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertInspectionMap(InspectionMap inspectionMap);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改巡检地图
|
||||||
|
*
|
||||||
|
* @param inspectionMap 巡检地图
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateInspectionMap(InspectionMap inspectionMap);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除巡检地图
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteInspectionMapByIds(String[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检地图视图列表(包含关联信息)
|
||||||
|
*
|
||||||
|
* @param inspectionMap 巡检地图
|
||||||
|
* @return 巡检地图视图集合
|
||||||
|
*/
|
||||||
|
List<InspectionMapVo> selectInspectionMapVoList(InspectionMap inspectionMap);
|
||||||
|
}
|
||||||
@ -0,0 +1,55 @@
|
|||||||
|
package com.cmvr.inspection.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.cmvr.inspection.domain.InspectionRobot;
|
||||||
|
import com.cmvr.inspection.domain.vo.InspectionRobotVo;
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检机器人Mapper接口
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
public interface InspectionRobotMapper extends MPJBaseMapper<InspectionRobot>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询巡检机器人
|
||||||
|
*
|
||||||
|
* @param id 巡检机器人主键
|
||||||
|
* @return 巡检机器人
|
||||||
|
*/
|
||||||
|
InspectionRobot selectInspectionRobotById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增巡检机器人
|
||||||
|
*
|
||||||
|
* @param inspectionRobot 巡检机器人
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertInspectionRobot(InspectionRobot inspectionRobot);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改巡检机器人
|
||||||
|
*
|
||||||
|
* @param inspectionRobot 巡检机器人
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateInspectionRobot(InspectionRobot inspectionRobot);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除巡检机器人
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteInspectionRobotByIds(String[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检机器人视图列表(包含关联信息)
|
||||||
|
*
|
||||||
|
* @param inspectionRobot 巡检机器人
|
||||||
|
* @return 巡检机器人视图集合
|
||||||
|
*/
|
||||||
|
List<InspectionRobotVo> selectInspectionRobotVoList(InspectionRobot inspectionRobot);
|
||||||
|
}
|
||||||
@ -0,0 +1,63 @@
|
|||||||
|
package com.cmvr.inspection.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.cmvr.inspection.domain.InspectionTaskInstance;
|
||||||
|
import com.cmvr.inspection.domain.vo.InspectionTaskInstanceVo;
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检任务执行实例Mapper接口
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-06-01
|
||||||
|
*/
|
||||||
|
public interface InspectionTaskInstanceMapper extends MPJBaseMapper<InspectionTaskInstance>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询巡检任务执行实例
|
||||||
|
*
|
||||||
|
* @param id 巡检任务执行实例主键
|
||||||
|
* @return 巡检任务执行实例
|
||||||
|
*/
|
||||||
|
InspectionTaskInstance selectInspectionTaskInstanceById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检任务执行实例视图详情(包含关联信息)
|
||||||
|
*
|
||||||
|
* @param id 巡检任务执行实例主键
|
||||||
|
* @return 巡检任务执行实例视图
|
||||||
|
*/
|
||||||
|
InspectionTaskInstanceVo selectInspectionTaskInstanceVoById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增巡检任务执行实例
|
||||||
|
*
|
||||||
|
* @param inspectionTaskInstance 巡检任务执行实例
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertInspectionTaskInstance(InspectionTaskInstance inspectionTaskInstance);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改巡检任务执行实例
|
||||||
|
*
|
||||||
|
* @param inspectionTaskInstance 巡检任务执行实例
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateInspectionTaskInstance(InspectionTaskInstance inspectionTaskInstance);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除巡检任务执行实例
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteInspectionTaskInstanceByIds(String[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检任务执行实例视图列表(包含关联信息)
|
||||||
|
*
|
||||||
|
* @param inspectionTaskInstance 巡检任务执行实例
|
||||||
|
* @return 巡检任务执行实例视图集合
|
||||||
|
*/
|
||||||
|
List<InspectionTaskInstanceVo> selectInspectionTaskInstanceVoList(InspectionTaskInstance inspectionTaskInstance);
|
||||||
|
}
|
||||||
@ -0,0 +1,55 @@
|
|||||||
|
package com.cmvr.inspection.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.cmvr.inspection.domain.InspectionTask;
|
||||||
|
import com.cmvr.inspection.domain.vo.InspectionTaskVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检任务Mapper接口
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
public interface InspectionTaskMapper extends BaseMapper<InspectionTask> {
|
||||||
|
/**
|
||||||
|
* 查询巡检任务
|
||||||
|
*
|
||||||
|
* @param id 巡检任务主键
|
||||||
|
* @return 巡检任务
|
||||||
|
*/
|
||||||
|
InspectionTask selectInspectionTaskById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增巡检任务
|
||||||
|
*
|
||||||
|
* @param inspectionTask 巡检任务
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertInspectionTask(InspectionTask inspectionTask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改巡检任务
|
||||||
|
*
|
||||||
|
* @param inspectionTask 巡检任务
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateInspectionTask(InspectionTask inspectionTask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除巡检任务
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteInspectionTaskByIds(String[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检任务视图列表(包含关联信息)
|
||||||
|
*
|
||||||
|
* @param inspectionTask 巡检任务
|
||||||
|
* @return 巡检任务视图集合
|
||||||
|
*/
|
||||||
|
List<InspectionTaskVo> selectInspectionTaskVoList(InspectionTask inspectionTask);
|
||||||
|
}
|
||||||
@ -0,0 +1,53 @@
|
|||||||
|
package com.cmvr.inspection.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.cmvr.inspection.domain.InspectionTaskWaypoint;
|
||||||
|
import com.cmvr.inspection.domain.InspectionWaypoint;
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检任务与点位关联Mapper接口
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-06-01
|
||||||
|
*/
|
||||||
|
public interface InspectionTaskWaypointMapper extends MPJBaseMapper<InspectionTaskWaypoint>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询任务关联的点位列表
|
||||||
|
*
|
||||||
|
* @param taskId 任务ID
|
||||||
|
* @return 点位集合
|
||||||
|
*/
|
||||||
|
List<InspectionWaypoint> selectWaypointsByTaskId(String taskId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量新增任务与点位的关联关系
|
||||||
|
*
|
||||||
|
* @param list 关联关系列表
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int batchInsertTaskWaypoint(List<InspectionTaskWaypoint> list);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据任务ID删除关联关系
|
||||||
|
*
|
||||||
|
* @param taskId 任务ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteTaskWaypointByTaskId(String taskId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据任务ID批量删除关联关系
|
||||||
|
*
|
||||||
|
* @param taskIds 任务ID数组
|
||||||
|
*/
|
||||||
|
void deleteTaskWaypointByTaskIds(String[] taskIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据点位ID批量删除关联关系
|
||||||
|
*
|
||||||
|
* @param waypointIds 点位ID数组
|
||||||
|
*/
|
||||||
|
void deleteTaskWaypointByWaypointIds(String[] waypointIds);
|
||||||
|
}
|
||||||
@ -0,0 +1,55 @@
|
|||||||
|
package com.cmvr.inspection.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.cmvr.inspection.domain.InspectionWaypoint;
|
||||||
|
import com.cmvr.inspection.domain.vo.InspectionWaypointVo;
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检点位Mapper接口
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
public interface InspectionWaypointMapper extends MPJBaseMapper<InspectionWaypoint>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询巡检点位
|
||||||
|
*
|
||||||
|
* @param id 巡检点位主键
|
||||||
|
* @return 巡检点位
|
||||||
|
*/
|
||||||
|
InspectionWaypoint selectInspectionWaypointById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增巡检点位
|
||||||
|
*
|
||||||
|
* @param inspectionWaypoint 巡检点位
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertInspectionWaypoint(InspectionWaypoint inspectionWaypoint);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改巡检点位
|
||||||
|
*
|
||||||
|
* @param inspectionWaypoint 巡检点位
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateInspectionWaypoint(InspectionWaypoint inspectionWaypoint);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除巡检点位
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteInspectionWaypointByIds(String[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检点位视图列表(包含关联信息)
|
||||||
|
*
|
||||||
|
* @param inspectionWaypoint 巡检点位
|
||||||
|
* @return 巡检点位视图集合
|
||||||
|
*/
|
||||||
|
List<InspectionWaypointVo> selectInspectionWaypointVoList(InspectionWaypoint inspectionWaypoint);
|
||||||
|
}
|
||||||
@ -0,0 +1,57 @@
|
|||||||
|
package com.cmvr.inspection.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.cmvr.inspection.domain.InspectionAlarm;
|
||||||
|
import com.cmvr.inspection.domain.vo.InspectionAlarmVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检告警Service接口
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
public interface IInspectionAlarmService extends IService<InspectionAlarm>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询巡检告警
|
||||||
|
*
|
||||||
|
* @param id 巡检告警主键
|
||||||
|
* @return 巡检告警
|
||||||
|
*/
|
||||||
|
InspectionAlarm selectInspectionAlarmById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检告警列表
|
||||||
|
*
|
||||||
|
* @param inspectionAlarm 巡检告警
|
||||||
|
* @return 巡检告警集合
|
||||||
|
*/
|
||||||
|
List<InspectionAlarmVo> selectInspectionAlarmList(InspectionAlarm inspectionAlarm);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增巡检告警
|
||||||
|
*
|
||||||
|
* @param inspectionAlarm 巡检告警
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertInspectionAlarm(InspectionAlarm inspectionAlarm);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改巡检告警
|
||||||
|
*
|
||||||
|
* @param inspectionAlarm 巡检告警
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateInspectionAlarm(InspectionAlarm inspectionAlarm);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除巡检告警
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的巡检告警主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteInspectionAlarmByIds(String[] ids);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,57 @@
|
|||||||
|
package com.cmvr.inspection.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.cmvr.inspection.domain.InspectionMap;
|
||||||
|
import com.cmvr.inspection.domain.vo.InspectionMapVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检地图Service接口
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
public interface IInspectionMapService extends IService<InspectionMap>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询巡检地图
|
||||||
|
*
|
||||||
|
* @param id 巡检地图主键
|
||||||
|
* @return 巡检地图
|
||||||
|
*/
|
||||||
|
InspectionMap selectInspectionMapById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检地图列表
|
||||||
|
*
|
||||||
|
* @param inspectionMap 巡检地图
|
||||||
|
* @return 巡检地图集合
|
||||||
|
*/
|
||||||
|
List<InspectionMapVo> selectInspectionMapList(InspectionMap inspectionMap);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增巡检地图
|
||||||
|
*
|
||||||
|
* @param inspectionMap 巡检地图
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertInspectionMap(InspectionMap inspectionMap);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改巡检地图
|
||||||
|
*
|
||||||
|
* @param inspectionMap 巡检地图
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateInspectionMap(InspectionMap inspectionMap);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除巡检地图
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的巡检地图主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteInspectionMapByIds(String[] ids);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,57 @@
|
|||||||
|
package com.cmvr.inspection.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.cmvr.inspection.domain.InspectionRobot;
|
||||||
|
import com.cmvr.inspection.domain.vo.InspectionRobotVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检机器人Service接口
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
public interface IInspectionRobotService extends IService<InspectionRobot>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询巡检机器人
|
||||||
|
*
|
||||||
|
* @param id 巡检机器人主键
|
||||||
|
* @return 巡检机器人
|
||||||
|
*/
|
||||||
|
InspectionRobot selectInspectionRobotById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检机器人列表
|
||||||
|
*
|
||||||
|
* @param inspectionRobot 巡检机器人
|
||||||
|
* @return 巡检机器人集合
|
||||||
|
*/
|
||||||
|
List<InspectionRobotVo> selectInspectionRobotList(InspectionRobot inspectionRobot);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增巡检机器人
|
||||||
|
*
|
||||||
|
* @param inspectionRobot 巡检机器人
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertInspectionRobot(InspectionRobot inspectionRobot);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改巡检机器人
|
||||||
|
*
|
||||||
|
* @param inspectionRobot 巡检机器人
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateInspectionRobot(InspectionRobot inspectionRobot);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除巡检机器人
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的巡检机器人主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteInspectionRobotByIds(String[] ids);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,88 @@
|
|||||||
|
package com.cmvr.inspection.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.cmvr.inspection.domain.InspectionTaskInstance;
|
||||||
|
import com.cmvr.inspection.domain.vo.InspectionTaskInstanceVo;
|
||||||
|
/**
|
||||||
|
* 巡检任务执行实例Service接口
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-06-01
|
||||||
|
*/
|
||||||
|
public interface IInspectionTaskInstanceService extends IService<InspectionTaskInstance>
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检任务执行实例视图详情(包含关联信息)
|
||||||
|
*
|
||||||
|
* @param id 巡检任务执行实例主键
|
||||||
|
* @return 巡检任务执行实例视图
|
||||||
|
*/
|
||||||
|
InspectionTaskInstanceVo selectInspectionTaskInstanceVoById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检任务执行实例列表
|
||||||
|
*
|
||||||
|
* @param inspectionTaskInstance 巡检任务执行实例
|
||||||
|
* @return 巡检任务执行实例集合
|
||||||
|
*/
|
||||||
|
List<InspectionTaskInstanceVo> selectInspectionTaskInstanceList(InspectionTaskInstance inspectionTaskInstance);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增巡检任务执行实例
|
||||||
|
*
|
||||||
|
* @param inspectionTaskInstance 巡检任务执行实例
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertInspectionTaskInstance(InspectionTaskInstance inspectionTaskInstance);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改巡检任务执行实例
|
||||||
|
*
|
||||||
|
* @param inspectionTaskInstance 巡检任务执行实例
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateInspectionTaskInstance(InspectionTaskInstance inspectionTaskInstance);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除巡检任务执行实例
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的巡检任务执行实例主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteInspectionTaskInstanceByIds(String[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始执行任务实例
|
||||||
|
*
|
||||||
|
* @param id 任务实例主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int startInstance(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂停任务实例
|
||||||
|
*
|
||||||
|
* @param id 任务实例主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int pauseInstance(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终止任务实例
|
||||||
|
*
|
||||||
|
* @param id 任务实例主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int stopInstance(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 恢复任务实例(从暂停恢复为执行中)
|
||||||
|
*
|
||||||
|
* @param id 任务实例主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int resumeInstance(String id);
|
||||||
|
}
|
||||||
@ -0,0 +1,81 @@
|
|||||||
|
package com.cmvr.inspection.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.cmvr.inspection.domain.InspectionTask;
|
||||||
|
import com.cmvr.inspection.domain.InspectionWaypoint;
|
||||||
|
import com.cmvr.inspection.domain.vo.InspectionTaskVo;
|
||||||
|
/**
|
||||||
|
* 巡检任务Service接口
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
public interface IInspectionTaskService extends IService<InspectionTask>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询巡检任务
|
||||||
|
*
|
||||||
|
* @param id 巡检任务主键
|
||||||
|
* @return 巡检任务
|
||||||
|
*/
|
||||||
|
InspectionTask selectInspectionTaskById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检任务列表
|
||||||
|
*
|
||||||
|
* @param inspectionTask 巡检任务
|
||||||
|
* @return 巡检任务集合
|
||||||
|
*/
|
||||||
|
List<InspectionTaskVo> selectInspectionTaskList(InspectionTask inspectionTask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增巡检任务
|
||||||
|
*
|
||||||
|
* @param inspectionTask 巡检任务
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertInspectionTask(InspectionTask inspectionTask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改巡检任务
|
||||||
|
*
|
||||||
|
* @param inspectionTask 巡检任务
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateInspectionTask(InspectionTask inspectionTask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除巡检任务
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的巡检任务主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteInspectionTaskByIds(String[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询任务关联的点位列表
|
||||||
|
*
|
||||||
|
* @param taskId 任务ID
|
||||||
|
* @return 点位集合
|
||||||
|
*/
|
||||||
|
List<InspectionWaypoint> selectWaypointsByTaskId(String taskId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定点位到任务
|
||||||
|
*
|
||||||
|
* @param taskId 任务ID
|
||||||
|
* @param waypointIds 点位ID数组
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int bindWaypoints(String taskId, String[] waypointIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解绑任务的点位
|
||||||
|
*
|
||||||
|
* @param taskId 任务ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int unbindWaypoints(String taskId);
|
||||||
|
}
|
||||||
@ -0,0 +1,57 @@
|
|||||||
|
package com.cmvr.inspection.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.cmvr.inspection.domain.InspectionWaypoint;
|
||||||
|
import com.cmvr.inspection.domain.vo.InspectionWaypointVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检点位Service接口
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
public interface IInspectionWaypointService extends IService<InspectionWaypoint>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询巡检点位
|
||||||
|
*
|
||||||
|
* @param id 巡检点位主键
|
||||||
|
* @return 巡检点位
|
||||||
|
*/
|
||||||
|
InspectionWaypoint selectInspectionWaypointById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检点位列表
|
||||||
|
*
|
||||||
|
* @param inspectionWaypoint 巡检点位
|
||||||
|
* @return 巡检点位集合
|
||||||
|
*/
|
||||||
|
List<InspectionWaypointVo> selectInspectionWaypointList(InspectionWaypoint inspectionWaypoint);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增巡检点位
|
||||||
|
*
|
||||||
|
* @param inspectionWaypoint 巡检点位
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertInspectionWaypoint(InspectionWaypoint inspectionWaypoint);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改巡检点位
|
||||||
|
*
|
||||||
|
* @param inspectionWaypoint 巡检点位
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateInspectionWaypoint(InspectionWaypoint inspectionWaypoint);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除巡检点位
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的巡检点位主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteInspectionWaypointByIds(String[] ids);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,96 @@
|
|||||||
|
package com.cmvr.inspection.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.cmvr.common.utils.SecurityUtils;
|
||||||
|
import com.cmvr.inspection.domain.vo.InspectionAlarmVo;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.cmvr.common.utils.DateUtils;
|
||||||
|
import com.cmvr.inspection.mapper.InspectionAlarmMapper;
|
||||||
|
import com.cmvr.inspection.domain.InspectionAlarm;
|
||||||
|
import com.cmvr.inspection.service.IInspectionAlarmService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检告警Service业务层处理
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class InspectionAlarmServiceImpl extends ServiceImpl<InspectionAlarmMapper, InspectionAlarm> implements IInspectionAlarmService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private InspectionAlarmMapper inspectionAlarmMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检告警
|
||||||
|
*
|
||||||
|
* @param id 巡检告警主键
|
||||||
|
* @return 巡检告警
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public InspectionAlarm selectInspectionAlarmById(String id)
|
||||||
|
{
|
||||||
|
return inspectionAlarmMapper.selectInspectionAlarmById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检告警列表
|
||||||
|
*
|
||||||
|
* @param inspectionAlarm 巡检告警
|
||||||
|
* @return 巡检告警
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<InspectionAlarmVo> selectInspectionAlarmList(InspectionAlarm inspectionAlarm)
|
||||||
|
{
|
||||||
|
return inspectionAlarmMapper.selectInspectionAlarmVoList(inspectionAlarm);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增巡检告警
|
||||||
|
*
|
||||||
|
* @param inspectionAlarm 巡检告警
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertInspectionAlarm(InspectionAlarm inspectionAlarm)
|
||||||
|
{
|
||||||
|
// 生成UUID作为主键
|
||||||
|
if (inspectionAlarm.getId() == null || inspectionAlarm.getId().isEmpty()) {
|
||||||
|
inspectionAlarm.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||||
|
}
|
||||||
|
inspectionAlarm.setCreateTime(DateUtils.getNowDate());
|
||||||
|
inspectionAlarm.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
return inspectionAlarmMapper.insertInspectionAlarm(inspectionAlarm);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改巡检告警
|
||||||
|
*
|
||||||
|
* @param inspectionAlarm 巡检告警
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateInspectionAlarm(InspectionAlarm inspectionAlarm)
|
||||||
|
{
|
||||||
|
inspectionAlarm.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
inspectionAlarm.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
return inspectionAlarmMapper.updateInspectionAlarm(inspectionAlarm);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除巡检告警
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的巡检告警主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteInspectionAlarmByIds(String[] ids)
|
||||||
|
{
|
||||||
|
return inspectionAlarmMapper.deleteInspectionAlarmByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,95 @@
|
|||||||
|
package com.cmvr.inspection.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.cmvr.common.utils.SecurityUtils;
|
||||||
|
import com.cmvr.inspection.domain.vo.InspectionMapVo;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.cmvr.common.utils.DateUtils;
|
||||||
|
import com.cmvr.inspection.mapper.InspectionMapMapper;
|
||||||
|
import com.cmvr.inspection.domain.InspectionMap;
|
||||||
|
import com.cmvr.inspection.service.IInspectionMapService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检地图Service业务层处理
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class InspectionMapServiceImpl extends ServiceImpl<InspectionMapMapper, InspectionMap> implements IInspectionMapService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private InspectionMapMapper inspectionMapMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检地图
|
||||||
|
*
|
||||||
|
* @param id 巡检地图主键
|
||||||
|
* @return 巡检地图
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public InspectionMap selectInspectionMapById(String id)
|
||||||
|
{
|
||||||
|
return inspectionMapMapper.selectInspectionMapById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检地图列表
|
||||||
|
*
|
||||||
|
* @param inspectionMap 巡检地图
|
||||||
|
* @return 巡检地图
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<InspectionMapVo> selectInspectionMapList(InspectionMap inspectionMap)
|
||||||
|
{
|
||||||
|
return inspectionMapMapper.selectInspectionMapVoList(inspectionMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增巡检地图
|
||||||
|
*
|
||||||
|
* @param inspectionMap 巡检地图
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertInspectionMap(InspectionMap inspectionMap)
|
||||||
|
{
|
||||||
|
// 生成UUID作为主键
|
||||||
|
if (inspectionMap.getId() == null || inspectionMap.getId().isEmpty()) {
|
||||||
|
inspectionMap.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||||
|
}
|
||||||
|
inspectionMap.setCreateTime(DateUtils.getNowDate());
|
||||||
|
inspectionMap.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
return inspectionMapMapper.insertInspectionMap(inspectionMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改巡检地图
|
||||||
|
*
|
||||||
|
* @param inspectionMap 巡检地图
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateInspectionMap(InspectionMap inspectionMap)
|
||||||
|
{
|
||||||
|
inspectionMap.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
inspectionMap.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
return inspectionMapMapper.updateInspectionMap(inspectionMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除巡检地图
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的巡检地图主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteInspectionMapByIds(String[] ids)
|
||||||
|
{
|
||||||
|
return inspectionMapMapper.deleteInspectionMapByIds(ids);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,96 @@
|
|||||||
|
package com.cmvr.inspection.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.cmvr.common.utils.SecurityUtils;
|
||||||
|
import com.cmvr.inspection.domain.vo.InspectionRobotVo;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.cmvr.common.utils.DateUtils;
|
||||||
|
import com.cmvr.inspection.mapper.InspectionRobotMapper;
|
||||||
|
import com.cmvr.inspection.domain.InspectionRobot;
|
||||||
|
import com.cmvr.inspection.service.IInspectionRobotService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检机器人Service业务层处理
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class InspectionRobotServiceImpl extends ServiceImpl<InspectionRobotMapper, InspectionRobot> implements IInspectionRobotService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private InspectionRobotMapper inspectionRobotMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检机器人
|
||||||
|
*
|
||||||
|
* @param id 巡检机器人主键
|
||||||
|
* @return 巡检机器人
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public InspectionRobot selectInspectionRobotById(String id)
|
||||||
|
{
|
||||||
|
return inspectionRobotMapper.selectInspectionRobotById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检机器人列表
|
||||||
|
*
|
||||||
|
* @param inspectionRobot 巡检机器人
|
||||||
|
* @return 巡检机器人
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<InspectionRobotVo> selectInspectionRobotList(InspectionRobot inspectionRobot)
|
||||||
|
{
|
||||||
|
return inspectionRobotMapper.selectInspectionRobotVoList(inspectionRobot);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增巡检机器人
|
||||||
|
*
|
||||||
|
* @param inspectionRobot 巡检机器人
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertInspectionRobot(InspectionRobot inspectionRobot)
|
||||||
|
{
|
||||||
|
// 生成UUID作为主键
|
||||||
|
if (inspectionRobot.getId() == null || inspectionRobot.getId().isEmpty()) {
|
||||||
|
inspectionRobot.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||||
|
}
|
||||||
|
inspectionRobot.setCreateTime(DateUtils.getNowDate());
|
||||||
|
inspectionRobot.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
return inspectionRobotMapper.insertInspectionRobot(inspectionRobot);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改巡检机器人
|
||||||
|
*
|
||||||
|
* @param inspectionRobot 巡检机器人
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateInspectionRobot(InspectionRobot inspectionRobot)
|
||||||
|
{
|
||||||
|
inspectionRobot.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
inspectionRobot.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
return inspectionRobotMapper.updateInspectionRobot(inspectionRobot);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除巡检机器人
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的巡检机器人主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteInspectionRobotByIds(String[] ids)
|
||||||
|
{
|
||||||
|
return inspectionRobotMapper.deleteInspectionRobotByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,194 @@
|
|||||||
|
package com.cmvr.inspection.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.cmvr.common.exception.ServiceException;
|
||||||
|
import com.cmvr.common.utils.SecurityUtils;
|
||||||
|
import com.cmvr.inspection.domain.vo.InspectionTaskInstanceVo;
|
||||||
|
import com.cmvr.inspection.enums.TaskStatusEnum;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.cmvr.common.utils.DateUtils;
|
||||||
|
import com.cmvr.inspection.mapper.InspectionTaskInstanceMapper;
|
||||||
|
import com.cmvr.inspection.domain.InspectionTaskInstance;
|
||||||
|
import com.cmvr.inspection.service.IInspectionTaskInstanceService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检任务执行实例Service业务层处理
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-06-01
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class InspectionTaskInstanceServiceImpl extends ServiceImpl<InspectionTaskInstanceMapper, InspectionTaskInstance> implements IInspectionTaskInstanceService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private InspectionTaskInstanceMapper inspectionTaskInstanceMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检任务执行实例视图详情(包含关联信息)
|
||||||
|
*
|
||||||
|
* @param id 巡检任务执行实例主键
|
||||||
|
* @return 巡检任务执行实例视图
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public InspectionTaskInstanceVo selectInspectionTaskInstanceVoById(String id)
|
||||||
|
{
|
||||||
|
return inspectionTaskInstanceMapper.selectInspectionTaskInstanceVoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检任务执行实例列表
|
||||||
|
*
|
||||||
|
* @param inspectionTaskInstance 巡检任务执行实例
|
||||||
|
* @return 巡检任务执行实例
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<InspectionTaskInstanceVo> selectInspectionTaskInstanceList(InspectionTaskInstance inspectionTaskInstance)
|
||||||
|
{
|
||||||
|
return inspectionTaskInstanceMapper.selectInspectionTaskInstanceVoList(inspectionTaskInstance);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增巡检任务执行实例
|
||||||
|
*
|
||||||
|
* @param inspectionTaskInstance 巡检任务执行实例
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertInspectionTaskInstance(InspectionTaskInstance inspectionTaskInstance)
|
||||||
|
{
|
||||||
|
// 生成UUID作为主键
|
||||||
|
if (inspectionTaskInstance.getId() == null || inspectionTaskInstance.getId().isEmpty()) {
|
||||||
|
inspectionTaskInstance.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||||
|
}
|
||||||
|
inspectionTaskInstance.setCreateTime(DateUtils.getNowDate());
|
||||||
|
inspectionTaskInstance.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
return inspectionTaskInstanceMapper.insertInspectionTaskInstance(inspectionTaskInstance);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改巡检任务执行实例
|
||||||
|
*
|
||||||
|
* @param inspectionTaskInstance 巡检任务执行实例
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateInspectionTaskInstance(InspectionTaskInstance inspectionTaskInstance)
|
||||||
|
{
|
||||||
|
// 校验状态,只有未执行可以修改
|
||||||
|
if (TaskStatusEnum.NOT_STARTED.getCode() != inspectionTaskInstance.getStatus()) {
|
||||||
|
throw new ServiceException("只有未执行状态的任务实例才能修改");
|
||||||
|
}
|
||||||
|
inspectionTaskInstance.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
inspectionTaskInstance.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
return inspectionTaskInstanceMapper.updateInspectionTaskInstance(inspectionTaskInstance);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除巡检任务执行实例
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的巡检任务执行实例主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteInspectionTaskInstanceByIds(String[] ids)
|
||||||
|
{
|
||||||
|
// 校验状态,只有未执行可以删除
|
||||||
|
for (String id : ids) {
|
||||||
|
InspectionTaskInstance instance = inspectionTaskInstanceMapper.selectInspectionTaskInstanceById(id);
|
||||||
|
if (TaskStatusEnum.NOT_STARTED.getCode() != instance.getStatus()) {
|
||||||
|
throw new ServiceException("只有未执行状态的任务实例才能删除");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return inspectionTaskInstanceMapper.deleteInspectionTaskInstanceByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始执行任务实例
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int startInstance(String id)
|
||||||
|
{
|
||||||
|
InspectionTaskInstance instance = inspectionTaskInstanceMapper.selectInspectionTaskInstanceById(id);
|
||||||
|
if (instance == null) {
|
||||||
|
throw new ServiceException("任务实例不存在");
|
||||||
|
}
|
||||||
|
if (TaskStatusEnum.NOT_STARTED.getCode() != instance.getStatus()) {
|
||||||
|
throw new ServiceException("只有待执行状态的任务实例才能开始执行");
|
||||||
|
}
|
||||||
|
InspectionTaskInstance update = new InspectionTaskInstance();
|
||||||
|
update.setId(id);
|
||||||
|
update.setStatus(TaskStatusEnum.RUNNING.getCode());
|
||||||
|
update.setStartTime(DateUtils.getNowDate());
|
||||||
|
update.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
update.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
return inspectionTaskInstanceMapper.updateInspectionTaskInstance(update);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂停任务实例
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int pauseInstance(String id)
|
||||||
|
{
|
||||||
|
InspectionTaskInstance instance = inspectionTaskInstanceMapper.selectInspectionTaskInstanceById(id);
|
||||||
|
if (instance == null) {
|
||||||
|
throw new ServiceException("任务实例不存在");
|
||||||
|
}
|
||||||
|
if (TaskStatusEnum.RUNNING.getCode() != instance.getStatus()) {
|
||||||
|
throw new ServiceException("只有执行中状态的任务实例才能暂停");
|
||||||
|
}
|
||||||
|
InspectionTaskInstance update = new InspectionTaskInstance();
|
||||||
|
update.setId(id);
|
||||||
|
update.setStatus(TaskStatusEnum.PAUSED.getCode());
|
||||||
|
update.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
update.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
return inspectionTaskInstanceMapper.updateInspectionTaskInstance(update);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终止任务实例
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int stopInstance(String id)
|
||||||
|
{
|
||||||
|
InspectionTaskInstance instance = inspectionTaskInstanceMapper.selectInspectionTaskInstanceById(id);
|
||||||
|
if (instance == null) {
|
||||||
|
throw new ServiceException("任务实例不存在");
|
||||||
|
}
|
||||||
|
if (TaskStatusEnum.NOT_STARTED.getCode() != instance.getStatus() && TaskStatusEnum.RUNNING.getCode() != instance.getStatus()) {
|
||||||
|
throw new ServiceException("已完成或已取消的任务实例不能终止");
|
||||||
|
}
|
||||||
|
InspectionTaskInstance update = new InspectionTaskInstance();
|
||||||
|
update.setId(id);
|
||||||
|
update.setStatus(TaskStatusEnum.STOPPED.getCode());
|
||||||
|
update.setEndTime(DateUtils.getNowDate());
|
||||||
|
update.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
update.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
return inspectionTaskInstanceMapper.updateInspectionTaskInstance(update);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 恢复任务实例(从暂停恢复为执行中)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int resumeInstance(String id)
|
||||||
|
{
|
||||||
|
InspectionTaskInstance instance = inspectionTaskInstanceMapper.selectInspectionTaskInstanceById(id);
|
||||||
|
if (instance == null) {
|
||||||
|
throw new ServiceException("任务实例不存在");
|
||||||
|
}
|
||||||
|
if (TaskStatusEnum.PAUSED.getCode() != instance.getStatus()) {
|
||||||
|
throw new ServiceException("只有已暂停状态的任务实例才能恢复");
|
||||||
|
}
|
||||||
|
InspectionTaskInstance update = new InspectionTaskInstance();
|
||||||
|
update.setId(id);
|
||||||
|
update.setStatus(TaskStatusEnum.RUNNING.getCode());
|
||||||
|
update.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
update.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
return inspectionTaskInstanceMapper.updateInspectionTaskInstance(update);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,185 @@
|
|||||||
|
package com.cmvr.inspection.service.impl;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.cmvr.inspection.domain.InspectionTaskWaypoint;
|
||||||
|
import com.cmvr.inspection.domain.InspectionWaypoint;
|
||||||
|
import com.cmvr.inspection.domain.vo.InspectionTaskVo;
|
||||||
|
import com.cmvr.inspection.mapper.InspectionTaskWaypointMapper;
|
||||||
|
import com.cmvr.test.model.domain.TeTaskConfigInfo;
|
||||||
|
import com.cmvr.test.model.vo.TeTaskOrchestraVO;
|
||||||
|
import com.cmvr.test.service.ITeTaskConfigInfoService;
|
||||||
|
import com.cmvr.test.service.ITeTaskOrchestrationService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.cmvr.common.utils.DateUtils;
|
||||||
|
import com.cmvr.common.utils.SecurityUtils;
|
||||||
|
import com.cmvr.inspection.mapper.InspectionTaskMapper;
|
||||||
|
import com.cmvr.inspection.domain.InspectionTask;
|
||||||
|
import com.cmvr.inspection.service.IInspectionTaskService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检任务Service业务层处理
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class InspectionTaskServiceImpl extends ServiceImpl<InspectionTaskMapper, InspectionTask> implements IInspectionTaskService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private InspectionTaskMapper inspectionTaskMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private InspectionTaskWaypointMapper inspectionTaskWaypointMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ITeTaskOrchestrationService teTaskOrchestrationService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ITeTaskConfigInfoService teTaskConfigInfoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检任务
|
||||||
|
*
|
||||||
|
* @param id 巡检任务主键
|
||||||
|
* @return 巡检任务
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public InspectionTask selectInspectionTaskById(String id)
|
||||||
|
{
|
||||||
|
return inspectionTaskMapper.selectInspectionTaskById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检任务列表
|
||||||
|
*
|
||||||
|
* @param inspectionTask 巡检任务
|
||||||
|
* @return 巡检任务
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<InspectionTaskVo> selectInspectionTaskList(InspectionTask inspectionTask)
|
||||||
|
{
|
||||||
|
return inspectionTaskMapper.selectInspectionTaskVoList(inspectionTask);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增巡检任务
|
||||||
|
*
|
||||||
|
* @param inspectionTask 巡检任务
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertInspectionTask(InspectionTask inspectionTask)
|
||||||
|
{
|
||||||
|
// 生成UUID作为主键
|
||||||
|
if (inspectionTask.getId() == null || inspectionTask.getId().isEmpty()) {
|
||||||
|
inspectionTask.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||||
|
}
|
||||||
|
inspectionTask.setCreateTime(DateUtils.getNowDate());
|
||||||
|
inspectionTask.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
// 同步新增任务
|
||||||
|
TeTaskConfigInfo teTaskConfigInfo = TeTaskConfigInfo.builder().taskName(inspectionTask.getTaskName()).build();
|
||||||
|
teTaskConfigInfoService.insertTeTaskConfigInfo(teTaskConfigInfo);
|
||||||
|
inspectionTask.setTeTaskConfigId(teTaskConfigInfo.getId());
|
||||||
|
return inspectionTaskMapper.insertInspectionTask(inspectionTask);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改巡检任务
|
||||||
|
*
|
||||||
|
* @param inspectionTask 巡检任务
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateInspectionTask(InspectionTask inspectionTask)
|
||||||
|
{
|
||||||
|
inspectionTask.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
inspectionTask.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
TeTaskConfigInfo teTaskConfigInfo = teTaskConfigInfoService.selectTeTaskConfigInfoById(inspectionTask.getTeTaskConfigId());
|
||||||
|
teTaskConfigInfo.setTaskName(inspectionTask.getTaskName());
|
||||||
|
teTaskConfigInfoService.updateTeTaskConfigInfo(teTaskConfigInfo);
|
||||||
|
return inspectionTaskMapper.updateInspectionTask(inspectionTask);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除巡检任务
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的巡检任务主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteInspectionTaskByIds(String[] ids)
|
||||||
|
{
|
||||||
|
// 先删除关联表数据
|
||||||
|
inspectionTaskWaypointMapper.deleteTaskWaypointByTaskIds(ids);
|
||||||
|
// 批量查询巡检任务
|
||||||
|
List<InspectionTask> inspectionTasks = this.baseMapper.selectBatchIds(Arrays.asList(ids));
|
||||||
|
// 批量删除任务
|
||||||
|
teTaskConfigInfoService.deleteTeTaskConfigInfoByIds(inspectionTasks.stream().map(InspectionTask::getTeTaskConfigId).toArray(String[]::new));
|
||||||
|
return inspectionTaskMapper.deleteInspectionTaskByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询任务关联的点位列表
|
||||||
|
*
|
||||||
|
* @param taskId 任务ID
|
||||||
|
* @return 点位集合
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<InspectionWaypoint> selectWaypointsByTaskId(String taskId)
|
||||||
|
{
|
||||||
|
return inspectionTaskWaypointMapper.selectWaypointsByTaskId(taskId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定点位到任务
|
||||||
|
*
|
||||||
|
* @param taskId 任务ID
|
||||||
|
* @param waypointIds 点位ID数组
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int bindWaypoints(String taskId, String[] waypointIds)
|
||||||
|
{
|
||||||
|
// 先删除旧的关联关系
|
||||||
|
inspectionTaskWaypointMapper.deleteTaskWaypointByTaskId(taskId);
|
||||||
|
if (waypointIds == null || waypointIds.length == 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
// 批量插入新的关联关系
|
||||||
|
List<InspectionTaskWaypoint> list = new ArrayList<>();
|
||||||
|
for (int i = 0; i < waypointIds.length; i++) {
|
||||||
|
InspectionTaskWaypoint tw = new InspectionTaskWaypoint();
|
||||||
|
tw.setTaskId(taskId);
|
||||||
|
tw.setWaypointId(waypointIds[i]);
|
||||||
|
tw.setSortOrder(i + 1);
|
||||||
|
list.add(tw);
|
||||||
|
}
|
||||||
|
// 查询巡检任务
|
||||||
|
InspectionTask inspectionTask = inspectionTaskMapper.selectInspectionTaskById(taskId);
|
||||||
|
// 查询点位
|
||||||
|
List<InspectionWaypoint> waypoints = inspectionTaskWaypointMapper.selectWaypointsByTaskId(taskId);
|
||||||
|
// 同步任务编排
|
||||||
|
TeTaskOrchestraVO teTaskOrchestraVO = TeTaskOrchestraVO.builder().taskId(inspectionTask.getTeTaskConfigId()).itemIds(waypoints.stream().map(InspectionWaypoint::getDetectItemId).collect(Collectors.toList())).build();
|
||||||
|
teTaskOrchestrationService.insertTeTaskOrchestration(teTaskOrchestraVO);
|
||||||
|
return inspectionTaskWaypointMapper.batchInsertTaskWaypoint(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解绑任务的点位
|
||||||
|
*
|
||||||
|
* @param taskId 任务ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int unbindWaypoints(String taskId)
|
||||||
|
{
|
||||||
|
return inspectionTaskWaypointMapper.deleteTaskWaypointByTaskId(taskId);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,119 @@
|
|||||||
|
package com.cmvr.inspection.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.cmvr.inspection.domain.vo.InspectionWaypointVo;
|
||||||
|
import com.cmvr.inspection.mapper.InspectionTaskWaypointMapper;
|
||||||
|
import com.cmvr.test.model.domain.TeDetectionItem;
|
||||||
|
import com.cmvr.test.service.ITeDetectionItemService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.cmvr.common.utils.DateUtils;
|
||||||
|
import com.cmvr.common.utils.SecurityUtils;
|
||||||
|
import com.cmvr.inspection.mapper.InspectionWaypointMapper;
|
||||||
|
import com.cmvr.inspection.domain.InspectionWaypoint;
|
||||||
|
import com.cmvr.inspection.service.IInspectionWaypointService;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检点位Service业务层处理
|
||||||
|
*
|
||||||
|
* @author cmvr-iot
|
||||||
|
* @since 2026-05-29
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional
|
||||||
|
public class InspectionWaypointServiceImpl extends ServiceImpl<InspectionWaypointMapper, InspectionWaypoint> implements IInspectionWaypointService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private InspectionWaypointMapper inspectionWaypointMapper;
|
||||||
|
|
||||||
|
/** 任务点位关联 mapper */
|
||||||
|
@Autowired
|
||||||
|
private InspectionTaskWaypointMapper inspectionTaskWaypointMapper;
|
||||||
|
|
||||||
|
/** 检测项配置service */
|
||||||
|
@Autowired
|
||||||
|
private ITeDetectionItemService teDetectionItemService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检点位
|
||||||
|
*
|
||||||
|
* @param id 巡检点位主键
|
||||||
|
* @return 巡检点位
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public InspectionWaypoint selectInspectionWaypointById(String id)
|
||||||
|
{
|
||||||
|
return inspectionWaypointMapper.selectInspectionWaypointById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询巡检点位列表
|
||||||
|
*
|
||||||
|
* @param inspectionWaypoint 巡检点位
|
||||||
|
* @return 巡检点位
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<InspectionWaypointVo> selectInspectionWaypointList(InspectionWaypoint inspectionWaypoint)
|
||||||
|
{
|
||||||
|
return inspectionWaypointMapper.selectInspectionWaypointVoList(inspectionWaypoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增巡检点位
|
||||||
|
*
|
||||||
|
* @param inspectionWaypoint 巡检点位
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertInspectionWaypoint(InspectionWaypoint inspectionWaypoint)
|
||||||
|
{
|
||||||
|
// 生成UUID作为主键
|
||||||
|
if (inspectionWaypoint.getId() == null || inspectionWaypoint.getId().isEmpty()) {
|
||||||
|
inspectionWaypoint.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||||
|
}
|
||||||
|
inspectionWaypoint.setCreateTime(DateUtils.getNowDate());
|
||||||
|
inspectionWaypoint.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
TeDetectionItem teDetectionItem = TeDetectionItem.builder().detectName(inspectionWaypoint.getWaypointName()).groupId(7L).build();
|
||||||
|
teDetectionItemService.insertTeDetectionItem(teDetectionItem);
|
||||||
|
inspectionWaypoint.setDetectItemId(teDetectionItem.getId());
|
||||||
|
return inspectionWaypointMapper.insertInspectionWaypoint(inspectionWaypoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改巡检点位
|
||||||
|
*
|
||||||
|
* @param inspectionWaypoint 巡检点位
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateInspectionWaypoint(InspectionWaypoint inspectionWaypoint)
|
||||||
|
{
|
||||||
|
inspectionWaypoint.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
inspectionWaypoint.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
return inspectionWaypointMapper.updateInspectionWaypoint(inspectionWaypoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除巡检点位
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的巡检点位主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteInspectionWaypointByIds(String[] ids)
|
||||||
|
{
|
||||||
|
// 先删除关联表数据
|
||||||
|
inspectionTaskWaypointMapper.deleteTaskWaypointByWaypointIds(ids);
|
||||||
|
for(String id : ids) {
|
||||||
|
// 查询数据后删除绑定的检测项
|
||||||
|
InspectionWaypoint inspectionWaypoint = inspectionWaypointMapper.selectInspectionWaypointById(id);
|
||||||
|
teDetectionItemService.deleteTeDetectionItemById(inspectionWaypoint.getDetectItemId());
|
||||||
|
}
|
||||||
|
return inspectionWaypointMapper.deleteInspectionWaypointByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,197 @@
|
|||||||
|
<?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.cmvr.inspection.mapper.InspectionAlarmMapper">
|
||||||
|
|
||||||
|
<resultMap type="InspectionAlarm" id="InspectionAlarmResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="alarmCode" column="alarm_code" />
|
||||||
|
<result property="taskInstanceId" column="task_instance_id" />
|
||||||
|
<result property="taskId" column="task_id" />
|
||||||
|
<result property="taskName" column="task_name" />
|
||||||
|
<result property="robotId" column="robot_id" />
|
||||||
|
<result property="robotName" column="robot_name" />
|
||||||
|
<result property="alarmLevel" column="alarm_level" />
|
||||||
|
<result property="alarmType" column="alarm_type" />
|
||||||
|
<result property="alarmTitle" column="alarm_title" />
|
||||||
|
<result property="alarmContent" column="alarm_content" />
|
||||||
|
<result property="alarmLocation" column="alarm_location" />
|
||||||
|
<result property="alarmTime" column="alarm_time" />
|
||||||
|
<result property="handleStatus" column="handle_status" />
|
||||||
|
<result property="handler" column="handler" />
|
||||||
|
<result property="handleTime" column="handle_time" />
|
||||||
|
<result property="handleRemark" column="handle_remark" />
|
||||||
|
<result property="evidenceImage" column="evidence_image" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap type="com.cmvr.inspection.domain.vo.InspectionAlarmVo" id="InspectionAlarmVoResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="alarmCode" column="alarm_code" />
|
||||||
|
<result property="taskInstanceId" column="task_instance_id" />
|
||||||
|
<result property="taskId" column="task_id" />
|
||||||
|
<result property="taskName" column="task_name" />
|
||||||
|
<result property="robotId" column="robot_id" />
|
||||||
|
<result property="robotName" column="robot_name" />
|
||||||
|
<result property="alarmLevel" column="alarm_level" />
|
||||||
|
<result property="alarmType" column="alarm_type" />
|
||||||
|
<result property="alarmTitle" column="alarm_title" />
|
||||||
|
<result property="alarmContent" column="alarm_content" />
|
||||||
|
<result property="alarmLocation" column="alarm_location" />
|
||||||
|
<result property="alarmTime" column="alarm_time" />
|
||||||
|
<result property="handleStatus" column="handle_status" />
|
||||||
|
<result property="handler" column="handler" />
|
||||||
|
<result property="handleTime" column="handle_time" />
|
||||||
|
<result property="handleRemark" column="handle_remark" />
|
||||||
|
<result property="evidenceImage" column="evidence_image" />
|
||||||
|
<result property="createByName" column="create_by_name" />
|
||||||
|
<result property="updateByName" column="update_by_name" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectInspectionAlarmVo">
|
||||||
|
select id, create_by, create_time, update_by, update_time, remark, alarm_code, task_instance_id, task_id, task_name, robot_id, robot_name, alarm_level, alarm_type, alarm_title, alarm_content, alarm_location, alarm_time, handle_status, handler, handle_time, handle_remark, evidence_image from inspection_alarm
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectInspectionAlarmList" parameterType="InspectionAlarm" resultMap="InspectionAlarmResult">
|
||||||
|
<include refid="selectInspectionAlarmVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="alarmCode != null and alarmCode != ''"> and alarm_code = #{alarmCode}</if>
|
||||||
|
<if test="taskId != null and taskId != ''"> and task_id = #{taskId}</if>
|
||||||
|
<if test="robotId != null and robotId != ''"> and robot_id = #{robotId}</if>
|
||||||
|
<if test="alarmLevel != null and alarmLevel != ''"> and alarm_level = #{alarmLevel}</if>
|
||||||
|
<if test="alarmType != null and alarmType != ''"> and alarm_type = #{alarmType}</if>
|
||||||
|
<if test="handleStatus != null and handleStatus != ''"> and handle_status = #{handleStatus}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectInspectionAlarmById" parameterType="String" resultMap="InspectionAlarmResult">
|
||||||
|
<include refid="selectInspectionAlarmVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertInspectionAlarm" parameterType="InspectionAlarm">
|
||||||
|
insert into inspection_alarm
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">id,</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>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="alarmCode != null">alarm_code,</if>
|
||||||
|
<if test="taskInstanceId != null">task_instance_id,</if>
|
||||||
|
<if test="taskId != null">task_id,</if>
|
||||||
|
<if test="taskName != null">task_name,</if>
|
||||||
|
<if test="robotId != null">robot_id,</if>
|
||||||
|
<if test="robotName != null">robot_name,</if>
|
||||||
|
<if test="alarmLevel != null">alarm_level,</if>
|
||||||
|
<if test="alarmType != null">alarm_type,</if>
|
||||||
|
<if test="alarmTitle != null">alarm_title,</if>
|
||||||
|
<if test="alarmContent != null">alarm_content,</if>
|
||||||
|
<if test="alarmLocation != null">alarm_location,</if>
|
||||||
|
<if test="alarmTime != null">alarm_time,</if>
|
||||||
|
<if test="handleStatus != null">handle_status,</if>
|
||||||
|
<if test="handler != null">handler,</if>
|
||||||
|
<if test="handleTime != null">handle_time,</if>
|
||||||
|
<if test="handleRemark != null">handle_remark,</if>
|
||||||
|
<if test="evidenceImage != null">evidence_image,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">#{id},</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>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="alarmCode != null">#{alarmCode},</if>
|
||||||
|
<if test="taskInstanceId != null">#{taskInstanceId},</if>
|
||||||
|
<if test="taskId != null">#{taskId},</if>
|
||||||
|
<if test="taskName != null">#{taskName},</if>
|
||||||
|
<if test="robotId != null">#{robotId},</if>
|
||||||
|
<if test="robotName != null">#{robotName},</if>
|
||||||
|
<if test="alarmLevel != null">#{alarmLevel},</if>
|
||||||
|
<if test="alarmType != null">#{alarmType},</if>
|
||||||
|
<if test="alarmTitle != null">#{alarmTitle},</if>
|
||||||
|
<if test="alarmContent != null">#{alarmContent},</if>
|
||||||
|
<if test="alarmLocation != null">#{alarmLocation},</if>
|
||||||
|
<if test="alarmTime != null">#{alarmTime},</if>
|
||||||
|
<if test="handleStatus != null">#{handleStatus},</if>
|
||||||
|
<if test="handler != null">#{handler},</if>
|
||||||
|
<if test="handleTime != null">#{handleTime},</if>
|
||||||
|
<if test="handleRemark != null">#{handleRemark},</if>
|
||||||
|
<if test="evidenceImage != null">#{evidenceImage},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateInspectionAlarm" parameterType="InspectionAlarm">
|
||||||
|
update inspection_alarm
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<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>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
<if test="alarmCode != null">alarm_code = #{alarmCode},</if>
|
||||||
|
<if test="taskInstanceId != null">task_instance_id = #{taskInstanceId},</if>
|
||||||
|
<if test="taskId != null">task_id = #{taskId},</if>
|
||||||
|
<if test="taskName != null">task_name = #{taskName},</if>
|
||||||
|
<if test="robotId != null">robot_id = #{robotId},</if>
|
||||||
|
<if test="robotName != null">robot_name = #{robotName},</if>
|
||||||
|
<if test="alarmLevel != null">alarm_level = #{alarmLevel},</if>
|
||||||
|
<if test="alarmType != null">alarm_type = #{alarmType},</if>
|
||||||
|
<if test="alarmTitle != null">alarm_title = #{alarmTitle},</if>
|
||||||
|
<if test="alarmContent != null">alarm_content = #{alarmContent},</if>
|
||||||
|
<if test="alarmLocation != null">alarm_location = #{alarmLocation},</if>
|
||||||
|
<if test="alarmTime != null">alarm_time = #{alarmTime},</if>
|
||||||
|
<if test="handleStatus != null">handle_status = #{handleStatus},</if>
|
||||||
|
<if test="handler != null">handler = #{handler},</if>
|
||||||
|
<if test="handleTime != null">handle_time = #{handleTime},</if>
|
||||||
|
<if test="handleRemark != null">handle_remark = #{handleRemark},</if>
|
||||||
|
<if test="evidenceImage != null">evidence_image = #{evidenceImage},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteInspectionAlarmById" parameterType="String">
|
||||||
|
delete from inspection_alarm where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteInspectionAlarmByIds" parameterType="String">
|
||||||
|
delete from inspection_alarm where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectInspectionAlarmVoList" parameterType="InspectionAlarm" resultMap="InspectionAlarmVoResult">
|
||||||
|
select a.id, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
|
||||||
|
a.alarm_code, a.task_instance_id, a.task_id, t.task_name, a.robot_id, r.robot_name,
|
||||||
|
a.alarm_level, a.alarm_type, a.alarm_title, a.alarm_content, a.alarm_location,
|
||||||
|
a.alarm_time, a.handle_status, a.handler, a.handle_time, a.handle_remark, a.evidence_image,
|
||||||
|
u1.nick_name as create_by_name, u2.nick_name as update_by_name
|
||||||
|
from inspection_alarm a
|
||||||
|
left join inspection_task t on a.task_id = t.id
|
||||||
|
left join inspection_robot r on a.robot_id = r.id
|
||||||
|
left join sys_user u1 on a.create_by = u1.user_name <!-- 创建人关联用户 -->
|
||||||
|
left join sys_user u2 on a.update_by = u2.user_name <!-- 更新人关联用户 -->
|
||||||
|
<where>
|
||||||
|
<if test="alarmCode != null and alarmCode != ''"> and a.alarm_code = #{alarmCode}</if>
|
||||||
|
<if test="taskId != null and taskId != ''"> and a.task_id = #{taskId}</if>
|
||||||
|
<if test="robotId != null and robotId != ''"> and a.robot_id = #{robotId}</if>
|
||||||
|
<if test="alarmLevel != null and alarmLevel != ''"> and a.alarm_level = #{alarmLevel}</if>
|
||||||
|
<if test="alarmType != null and alarmType != ''"> and a.alarm_type = #{alarmType}</if>
|
||||||
|
<if test="handleStatus != null and handleStatus != ''"> and a.handle_status = #{handleStatus}</if>
|
||||||
|
</where>
|
||||||
|
order by a.alarm_time desc
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,133 @@
|
|||||||
|
<?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.cmvr.inspection.mapper.InspectionMapMapper">
|
||||||
|
|
||||||
|
<resultMap type="InspectionMap" id="InspectionMapResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="mapName" column="map_name" />
|
||||||
|
<result property="mapSourceRobotId" column="map_source_robot_id" />
|
||||||
|
<result property="mapSourceName" column="map_source_name" />
|
||||||
|
<result property="mapFilePath" column="map_file_path" />
|
||||||
|
<result property="status" column="status" />
|
||||||
|
<result property="mapDesc" column="map_desc" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap type="com.cmvr.inspection.domain.vo.InspectionMapVo" id="InspectionMapVoResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="mapName" column="map_name" />
|
||||||
|
<result property="mapSourceRobotId" column="map_source_robot_id" />
|
||||||
|
<result property="mapSourceRobotName" column="map_source_robot_name" />
|
||||||
|
<result property="mapSourceName" column="map_source_name" />
|
||||||
|
<result property="mapFilePath" column="map_file_path" />
|
||||||
|
<result property="status" column="status" />
|
||||||
|
<result property="mapDesc" column="map_desc" />
|
||||||
|
<result property="createByName" column="create_by_name" />
|
||||||
|
<result property="updateByName" column="update_by_name" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectInspectionMapVo">
|
||||||
|
select id, create_by, create_time, update_by, update_time, remark, map_name, map_source_robot_id, map_source_name, map_file_path, status, map_desc from inspection_map
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectInspectionMapList" parameterType="InspectionMap" resultMap="InspectionMapResult">
|
||||||
|
<include refid="selectInspectionMapVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="mapName != null and mapName != ''"> and map_name like concat('%', #{mapName}, '%')</if>
|
||||||
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectInspectionMapById" parameterType="String" resultMap="InspectionMapResult">
|
||||||
|
<include refid="selectInspectionMapVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertInspectionMap" parameterType="InspectionMap">
|
||||||
|
insert into inspection_map
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">id,</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>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="mapName != null">map_name,</if>
|
||||||
|
<if test="mapSourceRobotId != null">map_source_robot_id,</if>
|
||||||
|
<if test="mapSourceName != null">map_source_name,</if>
|
||||||
|
<if test="mapFilePath != null">map_file_path,</if>
|
||||||
|
<if test="status != null">status,</if>
|
||||||
|
<if test="mapDesc != null">map_desc,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">#{id},</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>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="mapName != null">#{mapName},</if>
|
||||||
|
<if test="mapSourceRobotId != null">#{mapSourceRobotId},</if>
|
||||||
|
<if test="mapSourceName != null">#{mapSourceName},</if>
|
||||||
|
<if test="mapFilePath != null">#{mapFilePath},</if>
|
||||||
|
<if test="status != null">#{status},</if>
|
||||||
|
<if test="mapDesc != null">#{mapDesc},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateInspectionMap" parameterType="InspectionMap">
|
||||||
|
update inspection_map
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<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>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
<if test="mapName != null">map_name = #{mapName},</if>
|
||||||
|
<if test="mapSourceRobotId != null">map_source_robot_id = #{mapSourceRobotId},</if>
|
||||||
|
<if test="mapSourceName != null">map_source_name = #{mapSourceName},</if>
|
||||||
|
<if test="mapFilePath != null">map_file_path = #{mapFilePath},</if>
|
||||||
|
<if test="status != null">status = #{status},</if>
|
||||||
|
<if test="mapDesc != null">map_desc = #{mapDesc},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteInspectionMapById" parameterType="String">
|
||||||
|
delete from inspection_map where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteInspectionMapByIds" parameterType="String">
|
||||||
|
delete from inspection_map where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectInspectionMapVoList" parameterType="InspectionMap" resultMap="InspectionMapVoResult">
|
||||||
|
select m.id, m.create_by, m.create_time, m.update_by, m.update_time, m.remark,
|
||||||
|
m.map_name, m.map_source_robot_id, r.robot_name as map_source_robot_name,
|
||||||
|
m.map_source_name, m.map_file_path, m.status, m.map_desc,
|
||||||
|
u1.nick_name as create_by_name, u2.nick_name as update_by_name
|
||||||
|
from inspection_map m
|
||||||
|
left join inspection_robot r on m.map_source_robot_id = r.id
|
||||||
|
left join sys_user u1 on m.create_by = u1.user_name <!-- 创建人关联用户 -->
|
||||||
|
left join sys_user u2 on m.update_by = u2.user_name <!-- 更新人关联用户 -->
|
||||||
|
<where>
|
||||||
|
<if test="mapName != null and mapName != ''"> and m.map_name like concat('%', #{mapName}, '%')</if>
|
||||||
|
<if test="mapDesc != null and mapDesc != ''"> and m.map_desc like concat('%', #{mapDesc}, '%')</if>
|
||||||
|
<if test="status != null and status != ''"> and m.status = #{status}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,163 @@
|
|||||||
|
<?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.cmvr.inspection.mapper.InspectionRobotMapper">
|
||||||
|
|
||||||
|
<resultMap type="InspectionRobot" id="InspectionRobotResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="robotCode" column="robot_code" />
|
||||||
|
<result property="robotName" column="robot_name" />
|
||||||
|
<result property="robotModel" column="robot_model" />
|
||||||
|
<result property="robotType" column="robot_type" />
|
||||||
|
<result property="ipAddress" column="ip_address" />
|
||||||
|
<result property="port" column="port" />
|
||||||
|
<result property="currentMapId" column="current_map_id" />
|
||||||
|
<result property="status" column="status" />
|
||||||
|
<result property="batteryLevel" column="battery_level" />
|
||||||
|
<result property="currentPosition" column="current_position" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap type="com.cmvr.inspection.domain.vo.InspectionRobotVo" id="InspectionRobotVoResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="robotCode" column="robot_code" />
|
||||||
|
<result property="robotName" column="robot_name" />
|
||||||
|
<result property="robotModel" column="robot_model" />
|
||||||
|
<result property="robotType" column="robot_type" />
|
||||||
|
<result property="ipAddress" column="ip_address" />
|
||||||
|
<result property="port" column="port" />
|
||||||
|
<result property="currentMapId" column="current_map_id" />
|
||||||
|
<result property="currentMapName" column="current_map_name" />
|
||||||
|
<result property="status" column="status" />
|
||||||
|
<result property="batteryLevel" column="battery_level" />
|
||||||
|
<result property="currentPosition" column="current_position" />
|
||||||
|
<result property="createByName" column="create_by_name" />
|
||||||
|
<result property="updateByName" column="update_by_name" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectInspectionRobotVo">
|
||||||
|
select id, create_by, create_time, update_by, update_time, remark, robot_code, robot_name, robot_model, robot_type, ip_address, port, current_map_id, status, battery_level, current_position from inspection_robot
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectInspectionRobotList" parameterType="InspectionRobot" resultMap="InspectionRobotResult">
|
||||||
|
<include refid="selectInspectionRobotVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="robotCode != null and robotCode != ''"> and robot_code = #{robotCode}</if>
|
||||||
|
<if test="robotName != null and robotName != ''"> and robot_name like concat('%', #{robotName}, '%')</if>
|
||||||
|
<if test="robotModel != null and robotModel != ''"> and robot_model = #{robotModel}</if>
|
||||||
|
<if test="robotType != null and robotType != ''"> and robot_type = #{robotType}</if>
|
||||||
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||||
|
<if test="currentMapId != null and currentMapId != ''"> and current_map_id = #{currentMapId}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectInspectionRobotById" parameterType="String" resultMap="InspectionRobotResult">
|
||||||
|
<include refid="selectInspectionRobotVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertInspectionRobot" parameterType="InspectionRobot">
|
||||||
|
insert into inspection_robot
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">id,</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>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="robotCode != null">robot_code,</if>
|
||||||
|
<if test="robotName != null">robot_name,</if>
|
||||||
|
<if test="robotModel != null">robot_model,</if>
|
||||||
|
<if test="robotType != null">robot_type,</if>
|
||||||
|
<if test="ipAddress != null">ip_address,</if>
|
||||||
|
<if test="port != null">port,</if>
|
||||||
|
<if test="currentMapId != null">current_map_id,</if>
|
||||||
|
<if test="status != null">status,</if>
|
||||||
|
<if test="batteryLevel != null">battery_level,</if>
|
||||||
|
<if test="currentPosition != null">current_position,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">#{id},</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>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="robotCode != null">#{robotCode},</if>
|
||||||
|
<if test="robotName != null">#{robotName},</if>
|
||||||
|
<if test="robotModel != null">#{robotModel},</if>
|
||||||
|
<if test="robotType != null">#{robotType},</if>
|
||||||
|
<if test="ipAddress != null">#{ipAddress},</if>
|
||||||
|
<if test="port != null">#{port},</if>
|
||||||
|
<if test="currentMapId != null">#{currentMapId},</if>
|
||||||
|
<if test="status != null">#{status},</if>
|
||||||
|
<if test="batteryLevel != null">#{batteryLevel},</if>
|
||||||
|
<if test="currentPosition != null">#{currentPosition},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateInspectionRobot" parameterType="InspectionRobot">
|
||||||
|
update inspection_robot
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<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>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
<if test="robotCode != null">robot_code = #{robotCode},</if>
|
||||||
|
<if test="robotName != null">robot_name = #{robotName},</if>
|
||||||
|
<if test="robotModel != null">robot_model = #{robotModel},</if>
|
||||||
|
<if test="robotType != null">robot_type = #{robotType},</if>
|
||||||
|
<if test="ipAddress != null">ip_address = #{ipAddress},</if>
|
||||||
|
<if test="port != null">port = #{port},</if>
|
||||||
|
<if test="currentMapId != null">current_map_id = #{currentMapId},</if>
|
||||||
|
<if test="status != null">status = #{status},</if>
|
||||||
|
<if test="batteryLevel != null">battery_level = #{batteryLevel},</if>
|
||||||
|
<if test="currentPosition != null">current_position = #{currentPosition},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteInspectionRobotById" parameterType="String">
|
||||||
|
delete from inspection_robot where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteInspectionRobotByIds" parameterType="String">
|
||||||
|
delete from inspection_robot where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectInspectionRobotVoList" parameterType="InspectionRobot" resultMap="InspectionRobotVoResult">
|
||||||
|
select r.id, r.create_by, r.create_time, r.update_by, r.update_time, r.remark,
|
||||||
|
r.robot_code, r.robot_name, r.robot_model, r.robot_type,
|
||||||
|
r.ip_address, r.port, r.current_map_id,
|
||||||
|
m.map_name as current_map_name,
|
||||||
|
r.status, r.battery_level, r.current_position,
|
||||||
|
u1.nick_name as create_by_name, u2.nick_name as update_by_name
|
||||||
|
from inspection_robot r
|
||||||
|
left join inspection_map m on r.current_map_id = m.id
|
||||||
|
left join sys_user u1 on r.create_by = u1.user_name <!-- 创建人关联用户 -->
|
||||||
|
left join sys_user u2 on r.update_by = u2.user_name <!-- 更新人关联用户 -->
|
||||||
|
<where>
|
||||||
|
<if test="robotCode != null and robotCode != ''"> and r.robot_code = #{robotCode}</if>
|
||||||
|
<if test="robotName != null and robotName != ''"> and r.robot_name like concat('%', #{robotName}, '%')</if>
|
||||||
|
<if test="robotModel != null and robotModel != ''"> and r.robot_model = #{robotModel}</if>
|
||||||
|
<if test="robotType != null and robotType != ''"> and r.robot_type = #{robotType}</if>
|
||||||
|
<if test="status != null and status != ''"> and r.status = #{status}</if>
|
||||||
|
<if test="currentMapId != null and currentMapId != ''"> and r.current_map_id = #{currentMapId}</if>
|
||||||
|
<if test="ipAddress != null and ipAddress != ''"> and r.ip_address = #{ipAddress}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,151 @@
|
|||||||
|
<?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.cmvr.inspection.mapper.InspectionTaskInstanceMapper">
|
||||||
|
|
||||||
|
<resultMap type="InspectionTaskInstance" id="InspectionTaskInstanceResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="taskId" column="task_id" />
|
||||||
|
<result property="robotId" column="robot_id" />
|
||||||
|
<result property="status" column="status" />
|
||||||
|
<result property="startTime" column="start_time" />
|
||||||
|
<result property="endTime" column="end_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap type="com.cmvr.inspection.domain.vo.InspectionTaskInstanceVo" id="InspectionTaskInstanceVoResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="taskId" column="task_id" />
|
||||||
|
<result property="taskName" column="task_name" />
|
||||||
|
<result property="taskCode" column="task_code" />
|
||||||
|
<result property="robotId" column="robot_id" />
|
||||||
|
<result property="robotName" column="robot_name" />
|
||||||
|
<result property="mapId" column="robot_current_map_id" />
|
||||||
|
<result property="mapName" column="map_name" />
|
||||||
|
<result property="status" column="status" />
|
||||||
|
<result property="startTime" column="start_time" />
|
||||||
|
<result property="endTime" column="end_time" />
|
||||||
|
<result property="createByName" column="create_by_name" />
|
||||||
|
<result property="updateByName" column="update_by_name" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectInspectionTaskInstanceVo">
|
||||||
|
select id, create_by, create_time, update_by, update_time, remark, task_id, robot_id, status, start_time, end_time from inspection_task_instance
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectInspectionTaskInstanceList" parameterType="InspectionTaskInstance" resultMap="InspectionTaskInstanceResult">
|
||||||
|
<include refid="selectInspectionTaskInstanceVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="taskId != null and taskId != ''"> and task_id = #{taskId}</if>
|
||||||
|
<if test="robotId != null and robotId != ''"> and robot_id = #{robotId}</if>
|
||||||
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectInspectionTaskInstanceById" parameterType="String" resultMap="InspectionTaskInstanceResult">
|
||||||
|
<include refid="selectInspectionTaskInstanceVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertInspectionTaskInstance" parameterType="InspectionTaskInstance">
|
||||||
|
insert into inspection_task_instance
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">id,</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>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="taskId != null">task_id,</if>
|
||||||
|
<if test="robotId != null">robot_id,</if>
|
||||||
|
<if test="status != null">status,</if>
|
||||||
|
<if test="startTime != null">start_time,</if>
|
||||||
|
<if test="endTime != null">end_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">#{id},</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>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="taskId != null">#{taskId},</if>
|
||||||
|
<if test="robotId != null">#{robotId},</if>
|
||||||
|
<if test="status != null">#{status},</if>
|
||||||
|
<if test="startTime != null">#{startTime},</if>
|
||||||
|
<if test="endTime != null">#{endTime},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateInspectionTaskInstance" parameterType="InspectionTaskInstance">
|
||||||
|
update inspection_task_instance
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<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>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
<if test="taskId != null">task_id = #{taskId},</if>
|
||||||
|
<if test="robotId != null">robot_id = #{robotId},</if>
|
||||||
|
<if test="status != null">status = #{status},</if>
|
||||||
|
<if test="startTime != null">start_time = #{startTime},</if>
|
||||||
|
<if test="endTime != null">end_time = #{endTime},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteInspectionTaskInstanceById" parameterType="String">
|
||||||
|
delete from inspection_task_instance where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteInspectionTaskInstanceByIds" parameterType="String">
|
||||||
|
delete from inspection_task_instance where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectInspectionTaskInstanceVoList" parameterType="InspectionTaskInstance" resultMap="InspectionTaskInstanceVoResult">
|
||||||
|
select ti.id, ti.create_by, ti.create_time, ti.update_by, ti.update_time, ti.remark,
|
||||||
|
ti.task_id, t.task_name, t.task_code,
|
||||||
|
ti.robot_id, r.robot_name,
|
||||||
|
r.current_map_id as robot_current_map_id, m.map_name,
|
||||||
|
ti.status, ti.start_time, ti.end_time,
|
||||||
|
u1.nick_name as create_by_name, u2.nick_name as update_by_name
|
||||||
|
from inspection_task_instance ti
|
||||||
|
left join inspection_task t on ti.task_id = t.id
|
||||||
|
left join inspection_robot r on ti.robot_id = r.id
|
||||||
|
left join inspection_map m on r.current_map_id = m.id
|
||||||
|
left join sys_user u1 on ti.create_by = u1.user_name <!-- 创建人关联用户 -->
|
||||||
|
left join sys_user u2 on ti.update_by = u2.user_name <!-- 更新人关联用户 -->
|
||||||
|
<where>
|
||||||
|
<if test="taskId != null and taskId != ''"> and ti.task_id = #{taskId}</if>
|
||||||
|
<if test="robotId != null and robotId != ''"> and ti.robot_id = #{robotId}</if>
|
||||||
|
<if test="status != null and status != ''"> and ti.status = #{status}</if>
|
||||||
|
</where>
|
||||||
|
order by ti.create_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectInspectionTaskInstanceVoById" parameterType="String" resultMap="InspectionTaskInstanceVoResult">
|
||||||
|
select ti.id, ti.create_by, ti.create_time, ti.update_by, ti.update_time, ti.remark,
|
||||||
|
ti.task_id, t.task_name, t.task_code,
|
||||||
|
ti.robot_id, r.robot_name,
|
||||||
|
r.current_map_id as robot_current_map_id, m.map_name,
|
||||||
|
ti.status, ti.start_time, ti.end_time
|
||||||
|
from inspection_task_instance ti
|
||||||
|
left join inspection_task t on ti.task_id = t.id
|
||||||
|
left join inspection_robot r on ti.robot_id = r.id
|
||||||
|
left join inspection_map m on r.current_map_id = m.id
|
||||||
|
where ti.id = #{id}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,116 @@
|
|||||||
|
<?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.cmvr.inspection.mapper.InspectionTaskMapper">
|
||||||
|
|
||||||
|
<resultMap type="InspectionTask" id="InspectionTaskResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="taskCode" column="task_code" />
|
||||||
|
<result property="taskName" column="task_name" />
|
||||||
|
<result property="taskType" column="task_type" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap type="com.cmvr.inspection.domain.vo.InspectionTaskVo" id="InspectionTaskVoResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="taskCode" column="task_code" />
|
||||||
|
<result property="taskName" column="task_name" />
|
||||||
|
<result property="taskType" column="task_type" />
|
||||||
|
<result property="createByName" column="create_by_name" />
|
||||||
|
<result property="updateByName" column="update_by_name" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectInspectionTaskVo">
|
||||||
|
select id, create_by, create_time, update_by, update_time, remark, task_code, task_name, task_type from inspection_task
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectInspectionTaskList" parameterType="InspectionTask" resultMap="InspectionTaskResult">
|
||||||
|
<include refid="selectInspectionTaskVo"/>
|
||||||
|
<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 taskType != ''"> and task_type = #{taskType}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectInspectionTaskById" parameterType="String" resultMap="InspectionTaskResult">
|
||||||
|
<include refid="selectInspectionTaskVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertInspectionTask" parameterType="InspectionTask">
|
||||||
|
insert into inspection_task
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">id,</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>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="taskCode != null">task_code,</if>
|
||||||
|
<if test="taskName != null">task_name,</if>
|
||||||
|
<if test="taskType != null">task_type,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">#{id},</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>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="taskCode != null">#{taskCode},</if>
|
||||||
|
<if test="taskName != null">#{taskName},</if>
|
||||||
|
<if test="taskType != null">#{taskType},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateInspectionTask" parameterType="InspectionTask">
|
||||||
|
update inspection_task
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<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>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
<if test="taskCode != null">task_code = #{taskCode},</if>
|
||||||
|
<if test="taskName != null">task_name = #{taskName},</if>
|
||||||
|
<if test="taskType != null">task_type = #{taskType},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteInspectionTaskById" parameterType="String">
|
||||||
|
delete from inspection_task where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteInspectionTaskByIds" parameterType="String">
|
||||||
|
delete from inspection_task where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectInspectionTaskVoList" parameterType="InspectionTask" resultMap="InspectionTaskVoResult">
|
||||||
|
select t.id, t.create_by, t.create_time, t.update_by, t.update_time, t.remark,
|
||||||
|
t.task_code, t.task_name, t.task_type,
|
||||||
|
u1.user_name as create_by_name, u2.user_name as update_by_name
|
||||||
|
from inspection_task t
|
||||||
|
left join sys_user u1 on t.create_by = u1.user_name <!-- 创建人关联用户 -->
|
||||||
|
left join sys_user u2 on t.update_by = u2.user_name <!-- 更新人关联用户 -->
|
||||||
|
<where>
|
||||||
|
<if test="taskCode != null and taskCode != ''"> and t.task_code = #{taskCode}</if>
|
||||||
|
<if test="taskName != null and taskName != ''"> and t.task_name like concat('%', #{taskName}, '%')</if>
|
||||||
|
<if test="taskType != null and taskType != ''"> and t.task_type = #{taskType}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,54 @@
|
|||||||
|
<?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.cmvr.inspection.mapper.InspectionTaskWaypointMapper">
|
||||||
|
|
||||||
|
<resultMap type="InspectionTaskWaypoint" id="InspectionTaskWaypointResult">
|
||||||
|
<result property="taskId" column="task_id" />
|
||||||
|
<result property="waypointId" column="waypoint_id" />
|
||||||
|
<result property="sortOrder" column="sort_order" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="selectWaypointsByTaskId" parameterType="String" resultType="InspectionWaypoint">
|
||||||
|
select w.id, w.create_by, w.create_time, w.update_by, w.update_time, w.remark,
|
||||||
|
w.waypoint_name, w.enabled, w.sort_order, w.detect_item_id
|
||||||
|
from inspection_task_waypoint tw
|
||||||
|
inner join inspection_waypoint w on tw.waypoint_id = w.id
|
||||||
|
where tw.task_id = #{taskId}
|
||||||
|
order by tw.sort_order
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectTaskIdsByWaypointId" parameterType="String" resultType="String">
|
||||||
|
select task_id from inspection_task_waypoint where waypoint_id = #{waypointId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="batchInsertTaskWaypoint" parameterType="java.util.List">
|
||||||
|
insert into inspection_task_waypoint (task_id, waypoint_id, sort_order) values
|
||||||
|
<foreach item="item" collection="list" separator=",">
|
||||||
|
(#{item.taskId}, #{item.waypointId}, #{item.sortOrder})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<delete id="deleteTaskWaypointByTaskId" parameterType="String">
|
||||||
|
delete from inspection_task_waypoint where task_id = #{taskId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteTaskWaypointByWaypointId" parameterType="String">
|
||||||
|
delete from inspection_task_waypoint where waypoint_id = #{waypointId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteTaskWaypointByTaskIds" parameterType="String">
|
||||||
|
delete from inspection_task_waypoint where task_id in
|
||||||
|
<foreach item="taskId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{taskId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteTaskWaypointByWaypointIds" parameterType="String">
|
||||||
|
delete from inspection_task_waypoint where waypoint_id in
|
||||||
|
<foreach item="waypointId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{waypointId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,131 @@
|
|||||||
|
<?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.cmvr.inspection.mapper.InspectionWaypointMapper">
|
||||||
|
|
||||||
|
<resultMap type="InspectionWaypoint" id="InspectionWaypointResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="waypointName" column="waypoint_name" />
|
||||||
|
<result property="enabled" column="enabled" />
|
||||||
|
<result property="sortOrder" column="sort_order" />
|
||||||
|
<result property="detectItemId" column="detect_item_id" />
|
||||||
|
<result property="mapId" column="map_id" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap type="com.cmvr.inspection.domain.vo.InspectionWaypointVo" id="InspectionWaypointVoResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="waypointName" column="waypoint_name" />
|
||||||
|
<result property="enabled" column="enabled" />
|
||||||
|
<result property="sortOrder" column="sort_order" />
|
||||||
|
<result property="detectItemId" column="detect_item_id" />
|
||||||
|
<result property="configStatus" column="config_status" />
|
||||||
|
<result property="mapId" column="map_id" />
|
||||||
|
<result property="mapName" column="map_name" />
|
||||||
|
<result property="createByName" column="create_by_name" />
|
||||||
|
<result property="updateByName" column="update_by_name" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectInspectionWaypointVo">
|
||||||
|
select id, create_by, create_time, update_by, update_time, remark, waypoint_name, enabled, sort_order, detect_item_id, map_id from inspection_waypoint
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectInspectionWaypointList" parameterType="InspectionWaypoint" resultMap="InspectionWaypointResult">
|
||||||
|
<include refid="selectInspectionWaypointVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="waypointName != null and waypointName != ''"> and waypoint_name like concat('%', #{waypointName}, '%')</if>
|
||||||
|
<if test="enabled != null and enabled != ''"> and enabled = #{enabled}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectInspectionWaypointById" parameterType="String" resultMap="InspectionWaypointResult">
|
||||||
|
<include refid="selectInspectionWaypointVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertInspectionWaypoint" parameterType="InspectionWaypoint">
|
||||||
|
insert into inspection_waypoint
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">id,</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>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="waypointName != null">waypoint_name,</if>
|
||||||
|
<if test="enabled != null">enabled,</if>
|
||||||
|
<if test="sortOrder != null">sort_order,</if>
|
||||||
|
<if test="detectItemId != null">detect_item_id,</if>
|
||||||
|
<if test="mapId != null">map_id,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">#{id},</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>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="waypointName != null">#{waypointName},</if>
|
||||||
|
<if test="enabled != null">#{enabled},</if>
|
||||||
|
<if test="sortOrder != null">#{sortOrder},</if>
|
||||||
|
<if test="detectItemId != null">#{detectItemId},</if>
|
||||||
|
<if test="mapId != null">#{mapId},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateInspectionWaypoint" parameterType="InspectionWaypoint">
|
||||||
|
update inspection_waypoint
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<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>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
<if test="waypointName != null">waypoint_name = #{waypointName},</if>
|
||||||
|
<if test="enabled != null">enabled = #{enabled},</if>
|
||||||
|
<if test="sortOrder != null">sort_order = #{sortOrder},</if>
|
||||||
|
<if test="detectItemId != null">detect_item_id = #{detectItemId},</if>
|
||||||
|
<if test="mapId != null">map_id = #{mapId},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteInspectionWaypointById" parameterType="String">
|
||||||
|
delete from inspection_waypoint where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteInspectionWaypointByIds" parameterType="String">
|
||||||
|
delete from inspection_waypoint where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectInspectionWaypointVoList" parameterType="InspectionWaypoint" resultMap="InspectionWaypointVoResult">
|
||||||
|
select w.id, w.create_by, w.create_time, w.update_by, w.update_time, w.remark,
|
||||||
|
w.waypoint_name, w.enabled, w.sort_order, w.detect_item_id, w.map_id, m.map_name as map_name,
|
||||||
|
d.is_deploy as config_status,
|
||||||
|
u1.nick_name as create_by_name, u2.nick_name as update_by_name
|
||||||
|
from inspection_waypoint w
|
||||||
|
left join te_detection_item d on w.detect_item_id = d.id
|
||||||
|
left join inspection_map m on w.map_id = m.id
|
||||||
|
left join sys_user u1 on w.create_by = u1.user_name <!-- 创建人关联用户 -->
|
||||||
|
left join sys_user u2 on w.update_by = u2.user_name <!-- 更新人关联用户 -->
|
||||||
|
<where>
|
||||||
|
<if test="waypointName != null and waypointName != ''"> and w.waypoint_name like concat('%', #{waypointName}, '%')</if>
|
||||||
|
<if test="enabled != null and enabled != ''"> and w.enabled = #{enabled}</if>
|
||||||
|
<if test="mapId != null and mapId != ''"> and w.map_id = #{mapId}</if>
|
||||||
|
</where>
|
||||||
|
order by w.sort_order
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@ -9,10 +9,14 @@ import com.cmvr.common.core.domain.BaseEntity;
|
|||||||
import com.cmvr.test.enums.LoopNodeTypeEnum;
|
import com.cmvr.test.enums.LoopNodeTypeEnum;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.*;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ApiModel("检测项配置")
|
@ApiModel("检测项配置")
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class TeDetectionItem extends BaseEntity {
|
public class TeDetectionItem extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|||||||
@ -7,12 +7,14 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||||||
import com.cmvr.common.core.domain.BaseEntity;
|
import com.cmvr.common.core.domain.BaseEntity;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.*;
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Data
|
@Data
|
||||||
@ApiModel("任务配置信息")
|
@ApiModel("任务配置信息")
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public class TeTaskConfigInfo extends BaseEntity {
|
public class TeTaskConfigInfo extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|||||||
@ -2,13 +2,17 @@ package com.cmvr.test.model.vo;
|
|||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.*;
|
||||||
|
|
||||||
import javax.validation.constraints.NotEmpty;
|
import javax.validation.constraints.NotEmpty;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ApiModel("任务编排VO")
|
@ApiModel("任务编排VO")
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode
|
||||||
public class TeTaskOrchestraVO {
|
public class TeTaskOrchestraVO {
|
||||||
@ApiModelProperty("id")
|
@ApiModelProperty("id")
|
||||||
@NotEmpty(message = "任务ID不能为空")
|
@NotEmpty(message = "任务ID不能为空")
|
||||||
|
|||||||
@ -21,7 +21,7 @@ public interface ITeTaskOrchestrationService extends IService<TeTaskOrchestratio
|
|||||||
* @param taskId 任务ID
|
* @param taskId 任务ID
|
||||||
* @return 任务编排
|
* @return 任务编排
|
||||||
*/
|
*/
|
||||||
public List<TeQueryTaskOrchestraItemVO> queryByTaskId(String taskId);
|
List<TeQueryTaskOrchestraItemVO> queryByTaskId(String taskId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增任务编排
|
* 新增任务编排
|
||||||
@ -29,22 +29,29 @@ public interface ITeTaskOrchestrationService extends IService<TeTaskOrchestratio
|
|||||||
* @param taskOrchestraVO 任务编排
|
* @param taskOrchestraVO 任务编排
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public boolean insertTeTaskOrchestration(TeTaskOrchestraVO taskOrchestraVO);
|
boolean insertTeTaskOrchestration(TeTaskOrchestraVO taskOrchestraVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据任务ID 删除编排信息
|
* 根据任务ID 删除编排信息
|
||||||
*
|
*
|
||||||
* @param id 任务id
|
* @param id 任务id
|
||||||
*/
|
*/
|
||||||
public int deleteByTaskId(String id);
|
void deleteByTaskId(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据任务ID数组 删除编排信息
|
||||||
|
*
|
||||||
|
* @param idArr 任务id数组
|
||||||
|
*/
|
||||||
|
void deleteByTaskIds(String[] idArr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询任务详情
|
* 查询任务详情
|
||||||
*/
|
*/
|
||||||
public List<TeQueryTaskDetailDTO> queryTaskDetail(String taskId);
|
List<TeQueryTaskDetailDTO> queryTaskDetail(String taskId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建试运行任务
|
* 构建试运行任务
|
||||||
*/
|
*/
|
||||||
public String buildTrialTask(String itemId);
|
String buildTrialTask(String itemId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,9 @@ import com.cmvr.test.mapper.TeTaskConfigInfoMapper;
|
|||||||
import com.cmvr.test.model.domain.TeTaskConfigInfo;
|
import com.cmvr.test.model.domain.TeTaskConfigInfo;
|
||||||
import com.cmvr.test.model.vo.TeTaskConfigInfoVO;
|
import com.cmvr.test.model.vo.TeTaskConfigInfoVO;
|
||||||
import com.cmvr.test.service.ITeTaskConfigInfoService;
|
import com.cmvr.test.service.ITeTaskConfigInfoService;
|
||||||
|
import com.cmvr.test.service.ITeTaskOrchestrationService;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -22,8 +24,10 @@ import java.util.List;
|
|||||||
* @author cmvr-iot
|
* @author cmvr-iot
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class TeTaskConfigInfoServiceImpl extends ServiceImpl<TeTaskConfigInfoMapper, TeTaskConfigInfo> implements ITeTaskConfigInfoService {
|
public class TeTaskConfigInfoServiceImpl extends ServiceImpl<TeTaskConfigInfoMapper, TeTaskConfigInfo> implements ITeTaskConfigInfoService {
|
||||||
|
|
||||||
|
private final ITeTaskOrchestrationService taskOrchestrationService;
|
||||||
/**
|
/**
|
||||||
* 查询任务流程编排
|
* 查询任务流程编排
|
||||||
*
|
*
|
||||||
@ -91,6 +95,8 @@ public class TeTaskConfigInfoServiceImpl extends ServiceImpl<TeTaskConfigInfoMap
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteTeTaskConfigInfoByIds(String[] ids) {
|
public int deleteTeTaskConfigInfoByIds(String[] ids) {
|
||||||
|
// 删除对应的检测项关系
|
||||||
|
taskOrchestrationService.deleteByTaskIds(ids);
|
||||||
return this.baseMapper.deleteBatchIds(Arrays.asList(ids));
|
return this.baseMapper.deleteBatchIds(Arrays.asList(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,6 +108,8 @@ public class TeTaskConfigInfoServiceImpl extends ServiceImpl<TeTaskConfigInfoMap
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteTeTaskConfigInfoById(String id) {
|
public int deleteTeTaskConfigInfoById(String id) {
|
||||||
|
// 删除对应的检测项关系
|
||||||
|
taskOrchestrationService.deleteByTaskId(id);
|
||||||
return this.baseMapper.deleteById(id);
|
return this.baseMapper.deleteById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -16,11 +16,13 @@ import com.cmvr.test.model.vo.TeTaskOrchestraVO;
|
|||||||
import com.cmvr.test.service.ITeTaskConfigInfoService;
|
import com.cmvr.test.service.ITeTaskConfigInfoService;
|
||||||
import com.cmvr.test.service.ITeTaskOrchestrationService;
|
import com.cmvr.test.service.ITeTaskOrchestrationService;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import org.hibernate.validator.internal.util.stereotypes.Lazy;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -29,10 +31,10 @@ import java.util.List;
|
|||||||
* @author cmvr-iot
|
* @author cmvr-iot
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class TeTaskOrchestrationServiceImpl extends ServiceImpl<TeTaskOrchestrationMapper, TeTaskOrchestration> implements ITeTaskOrchestrationService {
|
public class TeTaskOrchestrationServiceImpl extends ServiceImpl<TeTaskOrchestrationMapper, TeTaskOrchestration> implements ITeTaskOrchestrationService {
|
||||||
|
@Autowired
|
||||||
private final ITeTaskConfigInfoService taskConfigInfoService;
|
@Lazy
|
||||||
|
private ITeTaskConfigInfoService taskConfigInfoService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<TeQueryTaskOrchestraItemVO> queryByTaskId(String taskId) {
|
public List<TeQueryTaskOrchestraItemVO> queryByTaskId(String taskId) {
|
||||||
@ -80,10 +82,21 @@ public class TeTaskOrchestrationServiceImpl extends ServiceImpl<TeTaskOrchestrat
|
|||||||
* 根据任务ID删除编排信息
|
* 根据任务ID删除编排信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteByTaskId(String id) {
|
public void deleteByTaskId(String id) {
|
||||||
LambdaQueryWrapper<TeTaskOrchestration> wrapper = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<TeTaskOrchestration> wrapper = Wrappers.lambdaQuery();
|
||||||
wrapper.eq(TeTaskOrchestration::getTaskId, id);
|
wrapper.eq(TeTaskOrchestration::getTaskId, id);
|
||||||
return this.baseMapper.delete(wrapper);
|
this.baseMapper.delete(wrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据任务IDs删除编排信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void deleteByTaskIds(String[] idArr) {
|
||||||
|
LambdaQueryWrapper<TeTaskOrchestration> wrapper = Wrappers.lambdaQuery();
|
||||||
|
//数组转List,精准匹配Collection入参的in方法
|
||||||
|
wrapper.in(TeTaskOrchestration::getTaskId, Arrays.asList(idArr));
|
||||||
|
this.baseMapper.delete(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -6,7 +6,9 @@ import com.cmvr.common.core.domain.BaseEntity;
|
|||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Data
|
@Data
|
||||||
@ApiModel("触控交互--车机功能")
|
@ApiModel("触控交互--车机功能")
|
||||||
public class TiVehicleFunction extends BaseEntity {
|
public class TiVehicleFunction extends BaseEntity {
|
||||||
@ -25,7 +27,4 @@ public class TiVehicleFunction extends BaseEntity {
|
|||||||
|
|
||||||
@ApiModelProperty("图标URL")
|
@ApiModelProperty("图标URL")
|
||||||
private String iconUrl;
|
private String iconUrl;
|
||||||
|
|
||||||
@ApiModelProperty("备注")
|
|
||||||
private String remark;
|
|
||||||
}
|
}
|
||||||
|
|||||||
8
pom.xml
8
pom.xml
@ -302,6 +302,13 @@
|
|||||||
<version>${cmvr-iot.version}</version>
|
<version>${cmvr-iot.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 智能巡检-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.cmvr</groupId>
|
||||||
|
<artifactId>cmvr-iot-inspection</artifactId>
|
||||||
|
<version>${cmvr-iot.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- huTool-->
|
<!-- huTool-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.hutool</groupId>
|
<groupId>cn.hutool</groupId>
|
||||||
@ -338,6 +345,7 @@
|
|||||||
<module>cmvr-iot-vi</module>
|
<module>cmvr-iot-vi</module>
|
||||||
<module>cmvr-iot-ti</module>
|
<module>cmvr-iot-ti</module>
|
||||||
<module>cmvr-iot-evaluation</module>
|
<module>cmvr-iot-evaluation</module>
|
||||||
|
<module>cmvr-iot-inspection</module>
|
||||||
</modules>
|
</modules>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
|
|||||||
143
sql/inspection_module.sql
Normal file
143
sql/inspection_module.sql
Normal file
@ -0,0 +1,143 @@
|
|||||||
|
-- ----------------------------
|
||||||
|
-- 智能巡检模块数据库表结构
|
||||||
|
-- ----------------------------
|
||||||
|
|
||||||
|
-- 1. 巡检机器人表
|
||||||
|
DROP TABLE IF EXISTS `inspection_robot`;
|
||||||
|
CREATE TABLE `inspection_robot` (
|
||||||
|
`id` varchar(64) NOT NULL COMMENT '主键ID',
|
||||||
|
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||||
|
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||||
|
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||||
|
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||||
|
`robot_code` varchar(64) DEFAULT NULL COMMENT '机器人编码',
|
||||||
|
`robot_name` varchar(100) NOT NULL COMMENT '机器人名称',
|
||||||
|
`robot_model` varchar(100) DEFAULT NULL COMMENT '机器人型号',
|
||||||
|
`robot_type` varchar(50) DEFAULT NULL COMMENT '机器人类型',
|
||||||
|
`ip_address` varchar(50) DEFAULT NULL COMMENT 'IP地址',
|
||||||
|
`port` int(11) DEFAULT NULL COMMENT '端口号',
|
||||||
|
`current_map_id` varchar(64) DEFAULT NULL COMMENT '当前地图ID',
|
||||||
|
`status` char(1) DEFAULT '0' COMMENT '状态(0在线 1离线 2充电中 3巡检中)',
|
||||||
|
`battery_level` int(3) DEFAULT NULL COMMENT '电量百分比',
|
||||||
|
`current_position` varchar(200) DEFAULT NULL COMMENT '当前位置',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_robot_code` (`robot_code`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='巡检机器人表';
|
||||||
|
|
||||||
|
-- 2. 巡检地图表
|
||||||
|
DROP TABLE IF EXISTS `inspection_map`;
|
||||||
|
CREATE TABLE `inspection_map` (
|
||||||
|
`id` varchar(64) NOT NULL COMMENT '主键ID',
|
||||||
|
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||||
|
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||||
|
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||||
|
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||||
|
`map_name` varchar(100) NOT NULL COMMENT '地图名称',
|
||||||
|
`map_source_robot_id` varchar(64) DEFAULT NULL COMMENT '地图来源的机器人id',
|
||||||
|
`map_source_name` varchar(100) DEFAULT NULL COMMENT '地图来源的地图名称',
|
||||||
|
`map_file_path` varchar(500) DEFAULT NULL COMMENT '地图文件路径',
|
||||||
|
`status` char(1) DEFAULT '0' COMMENT '状态(0正常 1停用)',
|
||||||
|
`map_desc` varchar(500) DEFAULT NULL COMMENT '地图描述',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='巡检地图表';
|
||||||
|
|
||||||
|
-- 3. 巡检任务表(不再包含机器人信息)
|
||||||
|
DROP TABLE IF EXISTS `inspection_task`;
|
||||||
|
CREATE TABLE `inspection_task` (
|
||||||
|
`id` varchar(64) NOT NULL COMMENT '主键ID',
|
||||||
|
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||||
|
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||||
|
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||||
|
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||||
|
`task_code` varchar(64) DEFAULT NULL COMMENT '任务编码',
|
||||||
|
`task_name` varchar(100) NOT NULL COMMENT '任务名称',
|
||||||
|
`task_type` char(1) DEFAULT '1' COMMENT '任务类型(1巡检任务 2讲解任务)',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_task_code` (`task_code`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='巡检任务表';
|
||||||
|
|
||||||
|
-- 4. 巡检点位表(不再包含任务ID,通过关联表关联)
|
||||||
|
DROP TABLE IF EXISTS `inspection_waypoint`;
|
||||||
|
CREATE TABLE `inspection_waypoint` (
|
||||||
|
`id` varchar(64) NOT NULL COMMENT '主键ID',
|
||||||
|
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||||
|
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||||
|
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||||
|
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||||
|
`waypoint_name` varchar(100) NOT NULL COMMENT '点位名称',
|
||||||
|
`enabled` char(1) DEFAULT '0' COMMENT '是否启用(0启用 1禁用)',
|
||||||
|
`sort_order` int(11) DEFAULT '0' COMMENT '排序号',
|
||||||
|
`detect_item_id` varchar(64) DEFAULT NULL COMMENT '检测项ID',
|
||||||
|
`map_id` varchar(64) DEFAULT NULL COMMENT '地图ID',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='巡检点位表';
|
||||||
|
|
||||||
|
-- 4.1 任务与点位关联表(多对多)
|
||||||
|
DROP TABLE IF EXISTS `inspection_task_waypoint`;
|
||||||
|
CREATE TABLE `inspection_task_waypoint` (
|
||||||
|
`task_id` varchar(64) NOT NULL COMMENT '任务ID',
|
||||||
|
`waypoint_id` varchar(64) NOT NULL COMMENT '点位ID',
|
||||||
|
`sort_order` int(11) DEFAULT '0' COMMENT '排序号',
|
||||||
|
PRIMARY KEY (`task_id`, `waypoint_id`),
|
||||||
|
KEY `idx_task_id` (`task_id`),
|
||||||
|
KEY `idx_waypoint_id` (`waypoint_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='任务与点位关联表';
|
||||||
|
|
||||||
|
-- 4.2 巡检任务执行实例表
|
||||||
|
DROP TABLE IF EXISTS `inspection_task_instance`;
|
||||||
|
CREATE TABLE `inspection_task_instance` (
|
||||||
|
`id` varchar(64) NOT NULL COMMENT '主键ID',
|
||||||
|
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||||
|
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||||
|
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||||
|
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||||
|
`task_id` varchar(64) NOT NULL COMMENT '任务ID',
|
||||||
|
`robot_id` varchar(64) DEFAULT NULL COMMENT '机器人ID',
|
||||||
|
`status` char(1) DEFAULT '0' COMMENT '执行状态(0待执行 1执行中 2已完成 3已取消 4执行失败 5已暂停)',
|
||||||
|
`start_time` datetime DEFAULT NULL COMMENT '开始时间',
|
||||||
|
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `idx_task_id` (`task_id`),
|
||||||
|
KEY `idx_robot_id` (`robot_id`),
|
||||||
|
KEY `idx_status` (`status`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='巡检任务执行实例表';
|
||||||
|
|
||||||
|
-- 5. 巡检告警表(增加任务执行实例ID)
|
||||||
|
DROP TABLE IF EXISTS `inspection_alarm`;
|
||||||
|
CREATE TABLE `inspection_alarm` (
|
||||||
|
`id` varchar(64) NOT NULL COMMENT '主键ID',
|
||||||
|
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||||
|
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||||
|
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||||
|
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||||
|
`alarm_code` varchar(64) DEFAULT NULL COMMENT '告警编码',
|
||||||
|
`task_instance_id` varchar(64) DEFAULT NULL COMMENT '任务执行实例ID',
|
||||||
|
`task_id` varchar(64) DEFAULT NULL COMMENT '任务ID',
|
||||||
|
`task_name` varchar(100) DEFAULT NULL COMMENT '任务名称',
|
||||||
|
`robot_id` varchar(64) DEFAULT NULL COMMENT '机器人ID',
|
||||||
|
`robot_name` varchar(100) DEFAULT NULL COMMENT '机器人名称',
|
||||||
|
`alarm_level` char(1) DEFAULT '2' COMMENT '告警级别(1提示 2警告 3严重)',
|
||||||
|
`alarm_type` char(1) DEFAULT NULL COMMENT '告警类型(1设备异常 2环境异常 3任务异常 4通信异常)',
|
||||||
|
`alarm_title` varchar(200) DEFAULT NULL COMMENT '告警标题',
|
||||||
|
`alarm_content` text COMMENT '告警内容',
|
||||||
|
`alarm_location` varchar(200) DEFAULT NULL COMMENT '告警位置',
|
||||||
|
`alarm_time` datetime DEFAULT NULL COMMENT '告警时间',
|
||||||
|
`handle_status` char(1) DEFAULT '0' COMMENT '处理状态(0未处理 1处理中 2已处理 3已忽略)',
|
||||||
|
`handler` varchar(64) DEFAULT NULL COMMENT '处理人',
|
||||||
|
`handle_time` datetime DEFAULT NULL COMMENT '处理时间',
|
||||||
|
`handle_remark` varchar(500) DEFAULT NULL COMMENT '处理说明',
|
||||||
|
`evidence_image` varchar(500) DEFAULT NULL COMMENT '图片证据',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_alarm_code` (`alarm_code`),
|
||||||
|
KEY `idx_task_instance_id` (`task_instance_id`),
|
||||||
|
KEY `idx_task_id` (`task_id`),
|
||||||
|
KEY `idx_robot_id` (`robot_id`),
|
||||||
|
KEY `idx_alarm_time` (`alarm_time`),
|
||||||
|
KEY `idx_handle_status` (`handle_status`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='巡检告警表';
|
||||||
276
智能巡检模块-创建说明.md
Normal file
276
智能巡检模块-创建说明.md
Normal file
@ -0,0 +1,276 @@
|
|||||||
|
# 智能巡检模块 - 已创建文件清单
|
||||||
|
|
||||||
|
## ✅ 已完成创建的文件
|
||||||
|
|
||||||
|
### 1. 模块配置
|
||||||
|
- ✅ `cmvr-iot-inspection/pom.xml` - 模块Maven配置
|
||||||
|
- ✅ `pom.xml` - 父POM已添加模块依赖
|
||||||
|
- ✅ `cmvr-iot-admin/pom.xml` - Admin模块已添加inspection依赖
|
||||||
|
|
||||||
|
### 2. 实体类(Domain)- 5个
|
||||||
|
- ✅ `InspectionRobot.java` - 巡检机器人实体
|
||||||
|
- ✅ `InspectionMap.java` - 巡检地图实体
|
||||||
|
- ✅ `InspectionTask.java` - 巡检任务实体
|
||||||
|
- ✅ `InspectionWaypoint.java` - 巡检点位实体
|
||||||
|
- ✅ `InspectionAlarm.java` - 巡检告警实体
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📋 还需要创建的文件(参照 cmvr-iot-device 模块模式)
|
||||||
|
|
||||||
|
### 3. Mapper 接口(5个)
|
||||||
|
位置:`cmvr-iot-inspection/src/main/java/com/cmvr/inspection/mapper/`
|
||||||
|
|
||||||
|
需要创建:
|
||||||
|
- `InspectionRobotMapper.java`
|
||||||
|
- `InspectionMapMapper.java`
|
||||||
|
- `InspectionTaskMapper.java`
|
||||||
|
- `InspectionWaypointMapper.java`
|
||||||
|
- `InspectionAlarmMapper.java`
|
||||||
|
|
||||||
|
参考模板:`DeDeviceRegistrationMapper.java`
|
||||||
|
|
||||||
|
### 4. Mapper XML(5个)
|
||||||
|
位置:`cmvr-iot-inspection/src/main/resources/mapper/inspection/`
|
||||||
|
|
||||||
|
需要创建:
|
||||||
|
- `InspectionRobotMapper.xml`
|
||||||
|
- `InspectionMapMapper.xml`
|
||||||
|
- `InspectionTaskMapper.xml`
|
||||||
|
- `InspectionWaypointMapper.xml`
|
||||||
|
- `InspectionAlarmMapper.xml`
|
||||||
|
|
||||||
|
参考模板:`DeDeviceRegistrationMapper.xml`
|
||||||
|
|
||||||
|
### 5. Service 接口(5个)
|
||||||
|
位置:`cmvr-iot-inspection/src/main/java/com/cmvr/inspection/service/`
|
||||||
|
|
||||||
|
需要创建:
|
||||||
|
- `IInspectionRobotService.java`
|
||||||
|
- `IInspectionMapService.java`
|
||||||
|
- `IInspectionTaskService.java`
|
||||||
|
- `IInspectionWaypointService.java`
|
||||||
|
- `IInspectionAlarmService.java`
|
||||||
|
|
||||||
|
参考模板:`IDeDeviceRegistrationService.java`
|
||||||
|
|
||||||
|
### 6. Service 实现类(5个)
|
||||||
|
位置:`cmvr-iot-inspection/src/main/java/com/cmvr/inspection/service/impl/`
|
||||||
|
|
||||||
|
需要创建:
|
||||||
|
- `InspectionRobotServiceImpl.java`
|
||||||
|
- `InspectionMapServiceImpl.java`
|
||||||
|
- `InspectionTaskServiceImpl.java`
|
||||||
|
- `InspectionWaypointServiceImpl.java`
|
||||||
|
- `InspectionAlarmServiceImpl.java`
|
||||||
|
|
||||||
|
参考模板:`DeDeviceRegistrationServiceImpl.java`
|
||||||
|
|
||||||
|
### 7. Controller(5个)
|
||||||
|
位置:`cmvr-iot-admin/src/main/java/com/cmvr/web/controller/inspection/`
|
||||||
|
|
||||||
|
需要创建:
|
||||||
|
- `InspectionRobotController.java`
|
||||||
|
- `InspectionMapController.java`
|
||||||
|
- `InspectionTaskController.java`
|
||||||
|
- `InspectionWaypointController.java`
|
||||||
|
- `InspectionAlarmController.java`
|
||||||
|
|
||||||
|
参考模板:`DeDeviceRegistrationController.java`
|
||||||
|
|
||||||
|
### 8. 数据库脚本
|
||||||
|
位置:项目根目录或 `sql/` 目录
|
||||||
|
|
||||||
|
需要创建:
|
||||||
|
- `inspection_module.sql` - 包含5张表的建表语句
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🗄️ 数据库表结构
|
||||||
|
|
||||||
|
### 1. inspection_robot (巡检机器人表)
|
||||||
|
```sql
|
||||||
|
CREATE TABLE `inspection_robot` (
|
||||||
|
`id` varchar(64) NOT NULL,
|
||||||
|
`robot_code` varchar(64) NOT NULL COMMENT '机器人编码',
|
||||||
|
`robot_name` varchar(100) NOT NULL COMMENT '机器人名称',
|
||||||
|
`robot_model` varchar(100) DEFAULT NULL COMMENT '机器人型号',
|
||||||
|
`robot_type` varchar(50) DEFAULT NULL COMMENT '机器人类型',
|
||||||
|
`ip_address` varchar(50) DEFAULT NULL COMMENT 'IP地址',
|
||||||
|
`port` int(11) DEFAULT NULL COMMENT '端口号',
|
||||||
|
`map_id` varchar(64) DEFAULT NULL COMMENT '关联地图ID',
|
||||||
|
`status` char(1) DEFAULT '0' COMMENT '状态(0在线 1离线 2充电中 3巡检中)',
|
||||||
|
`battery_level` int(3) DEFAULT NULL COMMENT '电量百分比',
|
||||||
|
`current_position` varchar(200) DEFAULT NULL COMMENT '当前位置',
|
||||||
|
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||||
|
`create_by` varchar(64) DEFAULT '',
|
||||||
|
`create_time` datetime DEFAULT NULL,
|
||||||
|
`update_by` varchar(64) DEFAULT '',
|
||||||
|
`update_time` datetime DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_robot_code` (`robot_code`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. inspection_map (巡检地图表)
|
||||||
|
```sql
|
||||||
|
CREATE TABLE `inspection_map` (
|
||||||
|
`id` varchar(64) NOT NULL,
|
||||||
|
`map_code` varchar(64) NOT NULL COMMENT '地图编码',
|
||||||
|
`map_name` varchar(100) NOT NULL COMMENT '地图名称',
|
||||||
|
`map_type` char(1) DEFAULT '1' COMMENT '地图类型(1室内 2室外)',
|
||||||
|
`map_file_path` varchar(500) DEFAULT NULL COMMENT '地图文件路径',
|
||||||
|
`map_image_path` varchar(500) DEFAULT NULL COMMENT '地图图片路径',
|
||||||
|
`resolution` decimal(10,4) DEFAULT NULL COMMENT '分辨率(米/像素)',
|
||||||
|
`width` int(11) DEFAULT NULL COMMENT '地图宽度(像素)',
|
||||||
|
`height` int(11) DEFAULT NULL COMMENT '地图高度(像素)',
|
||||||
|
`origin_x` decimal(10,2) DEFAULT NULL COMMENT '原点X坐标',
|
||||||
|
`origin_y` decimal(10,2) DEFAULT NULL COMMENT '原点Y坐标',
|
||||||
|
`status` char(1) DEFAULT '0' COMMENT '状态(0正常 1停用)',
|
||||||
|
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||||
|
`create_by` varchar(64) DEFAULT '',
|
||||||
|
`create_time` datetime DEFAULT NULL,
|
||||||
|
`update_by` varchar(64) DEFAULT '',
|
||||||
|
`update_time` datetime DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_map_code` (`map_code`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. inspection_task (巡检任务表)
|
||||||
|
```sql
|
||||||
|
CREATE TABLE `inspection_task` (
|
||||||
|
`id` varchar(64) NOT NULL,
|
||||||
|
`task_code` varchar(64) NOT NULL COMMENT '任务编码',
|
||||||
|
`task_name` varchar(100) NOT NULL COMMENT '任务名称',
|
||||||
|
`robot_id` varchar(64) DEFAULT NULL COMMENT '机器人ID',
|
||||||
|
`robot_name` varchar(100) DEFAULT NULL COMMENT '机器人名称',
|
||||||
|
`map_id` varchar(64) DEFAULT NULL COMMENT '地图ID',
|
||||||
|
`map_name` varchar(100) DEFAULT NULL COMMENT '地图名称',
|
||||||
|
`task_type` char(1) DEFAULT '1' COMMENT '任务类型(1立即执行 2定时执行 3周期执行)',
|
||||||
|
`priority` char(1) DEFAULT '2' COMMENT '优先级(1低 2中 3高)',
|
||||||
|
`waypoints` text COMMENT '巡检点位列表(JSON格式)',
|
||||||
|
`scheduled_start_time` datetime DEFAULT NULL COMMENT '计划开始时间',
|
||||||
|
`scheduled_end_time` datetime DEFAULT NULL COMMENT '计划结束时间',
|
||||||
|
`actual_start_time` datetime DEFAULT NULL COMMENT '实际开始时间',
|
||||||
|
`actual_end_time` datetime DEFAULT NULL COMMENT '实际结束时间',
|
||||||
|
`status` char(1) DEFAULT '0' COMMENT '任务状态(0待执行 1执行中 2已完成 3已取消 4失败)',
|
||||||
|
`progress` int(3) DEFAULT '0' COMMENT '进度百分比',
|
||||||
|
`cron_expression` varchar(100) DEFAULT NULL COMMENT 'Cron表达式',
|
||||||
|
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||||
|
`create_by` varchar(64) DEFAULT '',
|
||||||
|
`create_time` datetime DEFAULT NULL,
|
||||||
|
`update_by` varchar(64) DEFAULT '',
|
||||||
|
`update_time` datetime DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_task_code` (`task_code`),
|
||||||
|
KEY `idx_robot_id` (`robot_id`),
|
||||||
|
KEY `idx_status` (`status`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4. inspection_waypoint (巡检点位表)
|
||||||
|
```sql
|
||||||
|
CREATE TABLE `inspection_waypoint` (
|
||||||
|
`id` varchar(64) NOT NULL,
|
||||||
|
`waypoint_code` varchar(64) NOT NULL COMMENT '点位编码',
|
||||||
|
`waypoint_name` varchar(100) NOT NULL COMMENT '点位名称',
|
||||||
|
`map_id` varchar(64) NOT NULL COMMENT '所属地图ID',
|
||||||
|
`map_name` varchar(100) DEFAULT NULL COMMENT '所属地图名称',
|
||||||
|
`x_coordinate` decimal(10,2) DEFAULT NULL COMMENT 'X坐标',
|
||||||
|
`y_coordinate` decimal(10,2) DEFAULT NULL COMMENT 'Y坐标',
|
||||||
|
`z_coordinate` decimal(10,2) DEFAULT NULL COMMENT 'Z坐标',
|
||||||
|
`orientation` decimal(5,2) DEFAULT NULL COMMENT '朝向角度',
|
||||||
|
`waypoint_type` char(1) DEFAULT '1' COMMENT '点位类型(1普通点位 2充电点 3必经点)',
|
||||||
|
`dwell_time` int(11) DEFAULT '0' COMMENT '停留时长(秒)',
|
||||||
|
`enabled` char(1) DEFAULT '0' COMMENT '是否启用(0启用 1禁用)',
|
||||||
|
`sort_order` int(11) DEFAULT '0' COMMENT '排序号',
|
||||||
|
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||||
|
`create_by` varchar(64) DEFAULT '',
|
||||||
|
`create_time` datetime DEFAULT NULL,
|
||||||
|
`update_by` varchar(64) DEFAULT '',
|
||||||
|
`update_time` datetime DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_waypoint_code` (`waypoint_code`),
|
||||||
|
KEY `idx_map_id` (`map_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||||
|
```
|
||||||
|
|
||||||
|
### 5. inspection_alarm (巡检告警表)
|
||||||
|
```sql
|
||||||
|
CREATE TABLE `inspection_alarm` (
|
||||||
|
`id` varchar(64) NOT NULL,
|
||||||
|
`alarm_code` varchar(64) NOT NULL COMMENT '告警编码',
|
||||||
|
`task_id` varchar(64) DEFAULT NULL COMMENT '任务ID',
|
||||||
|
`task_name` varchar(100) DEFAULT NULL COMMENT '任务名称',
|
||||||
|
`robot_id` varchar(64) DEFAULT NULL COMMENT '机器人ID',
|
||||||
|
`robot_name` varchar(100) DEFAULT NULL COMMENT '机器人名称',
|
||||||
|
`alarm_level` char(1) DEFAULT '2' COMMENT '告警级别(1提示 2警告 3严重)',
|
||||||
|
`alarm_type` char(1) DEFAULT NULL COMMENT '告警类型(1设备异常 2环境异常 3任务异常 4通信异常)',
|
||||||
|
`alarm_title` varchar(200) DEFAULT NULL COMMENT '告警标题',
|
||||||
|
`alarm_content` text COMMENT '告警内容',
|
||||||
|
`alarm_location` varchar(200) DEFAULT NULL COMMENT '告警位置',
|
||||||
|
`alarm_time` datetime DEFAULT NULL COMMENT '告警时间',
|
||||||
|
`handle_status` char(1) DEFAULT '0' COMMENT '处理状态(0未处理 1处理中 2已处理 3已忽略)',
|
||||||
|
`handler` varchar(64) DEFAULT NULL COMMENT '处理人',
|
||||||
|
`handle_time` datetime DEFAULT NULL COMMENT '处理时间',
|
||||||
|
`handle_remark` varchar(500) DEFAULT NULL COMMENT '处理说明',
|
||||||
|
`evidence_image` varchar(500) DEFAULT NULL COMMENT '图片证据',
|
||||||
|
`create_by` varchar(64) DEFAULT '',
|
||||||
|
`create_time` datetime DEFAULT NULL,
|
||||||
|
`update_by` varchar(64) DEFAULT '',
|
||||||
|
`update_time` datetime DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_alarm_code` (`alarm_code`),
|
||||||
|
KEY `idx_task_id` (`task_id`),
|
||||||
|
KEY `idx_robot_id` (`robot_id`),
|
||||||
|
KEY `idx_alarm_time` (`alarm_time`),
|
||||||
|
KEY `idx_handle_status` (`handle_status`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🚀 后续步骤
|
||||||
|
|
||||||
|
1. **创建 Mapper 层**:参照 `DeDeviceRegistrationMapper` 创建5个Mapper接口和XML
|
||||||
|
2. **创建 Service 层**:参照 `IDeDeviceRegistrationService` 和实现类创建5个Service
|
||||||
|
3. **创建 Controller 层**:参照 `DeDeviceRegistrationController` 创建5个Controller
|
||||||
|
4. **执行数据库脚本**:在MySQL中执行上述5张表的建表SQL
|
||||||
|
5. **配置菜单权限**:在系统管理中添加智能巡检相关菜单
|
||||||
|
6. **开发前端页面**:创建对应的Vue页面
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📁 完整目录结构
|
||||||
|
|
||||||
|
```
|
||||||
|
cmvr-iot-inspection/
|
||||||
|
├── pom.xml
|
||||||
|
└── src/main/
|
||||||
|
├── java/com/cmvr/inspection/
|
||||||
|
│ ├── domain/
|
||||||
|
│ │ ├── InspectionRobot.java ✅
|
||||||
|
│ │ ├── InspectionMap.java ✅
|
||||||
|
│ │ ├── InspectionTask.java ✅
|
||||||
|
│ │ ├── InspectionWaypoint.java ✅
|
||||||
|
│ │ └── InspectionAlarm.java ✅
|
||||||
|
│ ├── mapper/ (待创建)
|
||||||
|
│ ├── service/ (待创建)
|
||||||
|
│ │ └── impl/ (待创建)
|
||||||
|
└── resources/
|
||||||
|
└── mapper/inspection/ (待创建)
|
||||||
|
|
||||||
|
cmvr-iot-admin/src/main/java/com/cmvr/web/controller/
|
||||||
|
└── inspection/ (待创建)
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 💡 关键注意事项
|
||||||
|
|
||||||
|
1. **不使用 @TableName 注解**:项目通过 MyBatis XML 映射表名
|
||||||
|
2. **继承 BaseEntity**:包含 create_by, create_time, update_by, update_time 等公共字段
|
||||||
|
3. **使用 UUID 主键**:`@TableId(value = "id", type = IdType.ASSIGN_UUID)`
|
||||||
|
4. **遵循命名规范**:表名使用下划线,类名使用驼峰
|
||||||
|
5. **权限标识**:如 `inspection:robot:list`、`inspection:robot:add` 等
|
||||||
Loading…
Reference in New Issue
Block a user