feat(aima): 添加爱玛电动车测试模块功能
- 在pom.xml中添加爱玛电动车测试模块依赖 - 创建爱玛电动车测试模块数据库表结构 - 实现爱玛告警管理相关实体类、控制器、服务类和映射器 - 集成爱玛测试工作流执行监听器 - 完成爱玛告警管理的CRUD操作接口 - 重构TeTaskConfigInfoServiceImpl解决循环依赖问题
This commit is contained in:
parent
4d3375fc5b
commit
08099e2eda
@ -83,6 +83,12 @@
|
||||
<groupId>com.cmvr</groupId>
|
||||
<artifactId>cmvr-iot-inspection</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 爱玛电动车测试-->
|
||||
<dependency>
|
||||
<groupId>com.cmvr</groupId>
|
||||
<artifactId>cmvr-iot-aima</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
<env>dev</env>
|
||||
|
||||
@ -0,0 +1,75 @@
|
||||
package com.cmvr.web.controller.aima;
|
||||
|
||||
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.*;
|
||||
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.aima.domain.AimaAlarm;
|
||||
import com.cmvr.aima.service.IAimaAlarmService;
|
||||
import com.cmvr.common.utils.poi.ExcelUtil;
|
||||
import com.cmvr.common.core.page.TableDataInfo;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/aima/alarm")
|
||||
@Api(tags = "爱玛电动车--告警管理")
|
||||
public class AimaAlarmController extends BaseController {
|
||||
@Autowired
|
||||
private IAimaAlarmService aimaAlarmService;
|
||||
|
||||
@ApiOperation("查询告警列表")
|
||||
@PreAuthorize("@ss.hasPermi('aima:alarm:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(AimaAlarm aimaAlarm) {
|
||||
startPage();
|
||||
List<AimaAlarm> list = aimaAlarmService.selectAimaAlarmList(aimaAlarm);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation("导出告警列表")
|
||||
@PreAuthorize("@ss.hasPermi('aima:alarm:export')")
|
||||
@Log(title = "告警管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, AimaAlarm aimaAlarm) {
|
||||
List<AimaAlarm> list = aimaAlarmService.selectAimaAlarmList(aimaAlarm);
|
||||
ExcelUtil<AimaAlarm> util = new ExcelUtil<>(AimaAlarm.class);
|
||||
util.exportExcel(response, list, "告警数据");
|
||||
}
|
||||
|
||||
@ApiOperation("获取告警详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('aima:alarm:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id) {
|
||||
return success(aimaAlarmService.selectAimaAlarmById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("新增告警")
|
||||
@PreAuthorize("@ss.hasPermi('aima:alarm:add')")
|
||||
@Log(title = "告警管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody AimaAlarm aimaAlarm) {
|
||||
return toAjax(aimaAlarmService.insertAimaAlarm(aimaAlarm));
|
||||
}
|
||||
|
||||
@ApiOperation("修改告警")
|
||||
@PreAuthorize("@ss.hasPermi('aima:alarm:edit')")
|
||||
@Log(title = "告警管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody AimaAlarm aimaAlarm) {
|
||||
return toAjax(aimaAlarmService.updateAimaAlarm(aimaAlarm));
|
||||
}
|
||||
|
||||
@ApiOperation("删除告警")
|
||||
@PreAuthorize("@ss.hasPermi('aima:alarm:remove')")
|
||||
@Log(title = "告警管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids) {
|
||||
return toAjax(aimaAlarmService.deleteAimaAlarmByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,113 @@
|
||||
package com.cmvr.web.controller.aima;
|
||||
|
||||
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.aima.domain.AimaPhone;
|
||||
import com.cmvr.aima.service.IAimaPhoneService;
|
||||
import com.cmvr.common.utils.poi.ExcelUtil;
|
||||
import com.cmvr.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 爱玛手机管理Controller
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/aima/phone")
|
||||
@Api(tags = "爱玛电动车--手机管理")
|
||||
public class AimaPhoneController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IAimaPhoneService aimaPhoneService;
|
||||
|
||||
/**
|
||||
* 查询爱玛手机管理列表
|
||||
*/
|
||||
@ApiOperation("查询爱玛手机管理列表")
|
||||
@PreAuthorize("@ss.hasPermi('aima:phone:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(AimaPhone aimaPhone)
|
||||
{
|
||||
startPage();
|
||||
List<AimaPhone> list = aimaPhoneService.selectAimaPhoneList(aimaPhone);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出爱玛手机管理列表
|
||||
*/
|
||||
@ApiOperation("导出爱玛手机管理列表")
|
||||
@PreAuthorize("@ss.hasPermi('aima:phone:export')")
|
||||
@Log(title = "爱玛手机管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, AimaPhone aimaPhone)
|
||||
{
|
||||
List<AimaPhone> list = aimaPhoneService.selectAimaPhoneList(aimaPhone);
|
||||
ExcelUtil<AimaPhone> util = new ExcelUtil<>(AimaPhone.class);
|
||||
util.exportExcel(response, list, "爱玛手机管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取爱玛手机管理详细信息
|
||||
*/
|
||||
@ApiOperation("获取爱玛手机管理详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('aima:phone:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(aimaPhoneService.selectAimaPhoneById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增爱玛手机管理
|
||||
*/
|
||||
@ApiOperation("新增爱玛手机管理")
|
||||
@PreAuthorize("@ss.hasPermi('aima:phone:add')")
|
||||
@Log(title = "爱玛手机管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody AimaPhone aimaPhone)
|
||||
{
|
||||
return toAjax(aimaPhoneService.insertAimaPhone(aimaPhone));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改爱玛手机管理
|
||||
*/
|
||||
@ApiOperation("修改爱玛手机管理")
|
||||
@PreAuthorize("@ss.hasPermi('aima:phone:edit')")
|
||||
@Log(title = "爱玛手机管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody AimaPhone aimaPhone)
|
||||
{
|
||||
return toAjax(aimaPhoneService.updateAimaPhone(aimaPhone));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除爱玛手机管理
|
||||
*/
|
||||
@ApiOperation("删除爱玛手机管理")
|
||||
@PreAuthorize("@ss.hasPermi('aima:phone:remove')")
|
||||
@Log(title = "爱玛手机管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(aimaPhoneService.deleteAimaPhoneByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,98 @@
|
||||
package com.cmvr.web.controller.aima;
|
||||
|
||||
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.*;
|
||||
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.aima.domain.AimaTask;
|
||||
import com.cmvr.aima.domain.vo.AimaTaskVo;
|
||||
import com.cmvr.aima.service.IAimaTaskService;
|
||||
import com.cmvr.common.utils.poi.ExcelUtil;
|
||||
import com.cmvr.common.core.page.TableDataInfo;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/aima/task")
|
||||
@Api(tags = "爱玛电动车--任务管理")
|
||||
public class AimaTaskController extends BaseController {
|
||||
@Autowired
|
||||
private IAimaTaskService aimaTaskService;
|
||||
|
||||
@ApiOperation("查询任务列表")
|
||||
@PreAuthorize("@ss.hasPermi('aima:task:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(AimaTask aimaTask) {
|
||||
startPage();
|
||||
List<AimaTaskVo> list = aimaTaskService.selectAimaTaskVoList(aimaTask);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation("导出任务列表")
|
||||
@PreAuthorize("@ss.hasPermi('aima:task:export')")
|
||||
@Log(title = "任务管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, AimaTask aimaTask) {
|
||||
List<AimaTaskVo> list = aimaTaskService.selectAimaTaskVoList(aimaTask);
|
||||
ExcelUtil<AimaTaskVo> util = new ExcelUtil<>(AimaTaskVo.class);
|
||||
util.exportExcel(response, list, "任务数据");
|
||||
}
|
||||
|
||||
@ApiOperation("获取任务详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('aima:task:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id) {
|
||||
return success(aimaTaskService.selectAimaTaskById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("新增任务")
|
||||
@PreAuthorize("@ss.hasPermi('aima:task:add')")
|
||||
@Log(title = "任务管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody AimaTask aimaTask) {
|
||||
return toAjax(aimaTaskService.insertAimaTask(aimaTask));
|
||||
}
|
||||
|
||||
@ApiOperation("修改任务")
|
||||
@PreAuthorize("@ss.hasPermi('aima:task:edit')")
|
||||
@Log(title = "任务管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody AimaTask aimaTask) {
|
||||
return toAjax(aimaTaskService.updateAimaTask(aimaTask));
|
||||
}
|
||||
|
||||
@ApiOperation("删除任务")
|
||||
@PreAuthorize("@ss.hasPermi('aima:task:remove')")
|
||||
@Log(title = "任务管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids) {
|
||||
return toAjax(aimaTaskService.deleteAimaTaskByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定测试用例到任务
|
||||
*/
|
||||
@ApiOperation("绑定测试用例")
|
||||
@PreAuthorize("@ss.hasPermi('aima:task:edit')")
|
||||
@Log(title = "任务管理", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/bindTestCases/{taskId}")
|
||||
public AjaxResult bindTestCases(@PathVariable("taskId") String taskId, @RequestBody List<String> testCaseIds) {
|
||||
aimaTaskService.bindTestCases(taskId, testCaseIds);
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务的测试用例列表
|
||||
*/
|
||||
@ApiOperation("获取任务测试用例")
|
||||
@PreAuthorize("@ss.hasPermi('aima:task:query')")
|
||||
@GetMapping("/testCases/{taskId}")
|
||||
public AjaxResult getTestCases(@PathVariable String taskId) {
|
||||
return success(aimaTaskService.getTestCaseIds(taskId));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,120 @@
|
||||
package com.cmvr.web.controller.aima;
|
||||
|
||||
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.*;
|
||||
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.aima.domain.AimaTaskInstance;
|
||||
import com.cmvr.aima.domain.vo.AimaTaskInstanceVo;
|
||||
import com.cmvr.aima.service.IAimaTaskInstanceService;
|
||||
import com.cmvr.common.utils.poi.ExcelUtil;
|
||||
import com.cmvr.common.core.page.TableDataInfo;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/aima/taskinstance")
|
||||
@Api(tags = "爱玛电动车--任务执行实例")
|
||||
public class AimaTaskInstanceController extends BaseController {
|
||||
@Autowired
|
||||
private IAimaTaskInstanceService aimaTaskInstanceService;
|
||||
|
||||
@ApiOperation("查询任务实例列表")
|
||||
@PreAuthorize("@ss.hasPermi('aima:taskinstance:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(AimaTaskInstance aimaTaskInstance) {
|
||||
startPage();
|
||||
List<AimaTaskInstanceVo> list = aimaTaskInstanceService.selectAimaTaskInstanceVoList(aimaTaskInstance);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation("导出任务实例列表")
|
||||
@PreAuthorize("@ss.hasPermi('aima:taskinstance:export')")
|
||||
@Log(title = "任务执行实例", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, AimaTaskInstance aimaTaskInstance) {
|
||||
List<AimaTaskInstanceVo> list = aimaTaskInstanceService.selectAimaTaskInstanceVoList(aimaTaskInstance);
|
||||
ExcelUtil<AimaTaskInstanceVo> util = new ExcelUtil<>(AimaTaskInstanceVo.class);
|
||||
util.exportExcel(response, list, "任务实例数据");
|
||||
}
|
||||
|
||||
@ApiOperation("获取任务实例详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('aima:taskinstance:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id) {
|
||||
return success(aimaTaskInstanceService.selectAimaTaskInstanceById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("新增任务实例")
|
||||
@PreAuthorize("@ss.hasPermi('aima:taskinstance:add')")
|
||||
@Log(title = "任务执行实例", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody AimaTaskInstance aimaTaskInstance) {
|
||||
return toAjax(aimaTaskInstanceService.insertAimaTaskInstance(aimaTaskInstance));
|
||||
}
|
||||
|
||||
@ApiOperation("修改任务实例")
|
||||
@PreAuthorize("@ss.hasPermi('aima:taskinstance:edit')")
|
||||
@Log(title = "任务执行实例", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody AimaTaskInstance aimaTaskInstance) {
|
||||
return toAjax(aimaTaskInstanceService.updateAimaTaskInstance(aimaTaskInstance));
|
||||
}
|
||||
|
||||
@ApiOperation("删除任务实例")
|
||||
@PreAuthorize("@ss.hasPermi('aima:taskinstance:remove')")
|
||||
@Log(title = "任务执行实例", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids) {
|
||||
return toAjax(aimaTaskInstanceService.deleteAimaTaskInstanceByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始执行任务实例
|
||||
*/
|
||||
@ApiOperation("开始执行任务实例")
|
||||
@PreAuthorize("@ss.hasPermi('aima:taskinstance:edit')")
|
||||
@Log(title = "任务执行实例", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/start/{id}")
|
||||
public AjaxResult start(@PathVariable("id") String id) {
|
||||
return toAjax(aimaTaskInstanceService.startInstance(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 暂停任务实例
|
||||
*/
|
||||
@ApiOperation("暂停任务实例")
|
||||
@PreAuthorize("@ss.hasPermi('aima:taskinstance:edit')")
|
||||
@Log(title = "任务执行实例", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/pause/{id}")
|
||||
public AjaxResult pause(@PathVariable("id") String id) {
|
||||
return toAjax(aimaTaskInstanceService.pauseInstance(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 终止任务实例
|
||||
*/
|
||||
@ApiOperation("终止任务实例")
|
||||
@PreAuthorize("@ss.hasPermi('aima:taskinstance:edit')")
|
||||
@Log(title = "任务执行实例", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/stop/{id}")
|
||||
public AjaxResult stop(@PathVariable("id") String id) {
|
||||
return toAjax(aimaTaskInstanceService.stopInstance(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 恢复任务实例
|
||||
*/
|
||||
@ApiOperation("恢复任务实例")
|
||||
@PreAuthorize("@ss.hasPermi('aima:taskinstance:edit')")
|
||||
@Log(title = "任务执行实例", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/resume/{id}")
|
||||
public AjaxResult resume(@PathVariable("id") String id) {
|
||||
return toAjax(aimaTaskInstanceService.resumeInstance(id));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
package com.cmvr.web.controller.aima;
|
||||
|
||||
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.*;
|
||||
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.aima.domain.AimaTestCase;
|
||||
import com.cmvr.aima.domain.vo.AimaTestCaseVo;
|
||||
import com.cmvr.aima.service.IAimaTestCaseService;
|
||||
import com.cmvr.common.utils.poi.ExcelUtil;
|
||||
import com.cmvr.common.core.page.TableDataInfo;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/aima/testcase")
|
||||
@Api(tags = "爱玛电动车--测试用例管理")
|
||||
public class AimaTestCaseController extends BaseController {
|
||||
@Autowired
|
||||
private IAimaTestCaseService aimaTestCaseService;
|
||||
|
||||
@ApiOperation("查询测试用例列表")
|
||||
@PreAuthorize("@ss.hasPermi('aima:testcase:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(AimaTestCase aimaTestCase) {
|
||||
startPage();
|
||||
List<AimaTestCaseVo> list = aimaTestCaseService.selectAimaTestCaseVoList(aimaTestCase);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation("导出测试用例列表")
|
||||
@PreAuthorize("@ss.hasPermi('aima:testcase:export')")
|
||||
@Log(title = "测试用例管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, AimaTestCase aimaTestCase) {
|
||||
List<AimaTestCaseVo> list = aimaTestCaseService.selectAimaTestCaseVoList(aimaTestCase);
|
||||
ExcelUtil<AimaTestCaseVo> util = new ExcelUtil<>(AimaTestCaseVo.class);
|
||||
util.exportExcel(response, list, "测试用例数据");
|
||||
}
|
||||
|
||||
@ApiOperation("获取测试用例详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('aima:testcase:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id) {
|
||||
return success(aimaTestCaseService.selectAimaTestCaseById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("新增测试用例")
|
||||
@PreAuthorize("@ss.hasPermi('aima:testcase:add')")
|
||||
@Log(title = "测试用例管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody AimaTestCase aimaTestCase) {
|
||||
return toAjax(aimaTestCaseService.insertAimaTestCase(aimaTestCase));
|
||||
}
|
||||
|
||||
@ApiOperation("修改测试用例")
|
||||
@PreAuthorize("@ss.hasPermi('aima:testcase:edit')")
|
||||
@Log(title = "测试用例管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody AimaTestCase aimaTestCase) {
|
||||
return toAjax(aimaTestCaseService.updateAimaTestCase(aimaTestCase));
|
||||
}
|
||||
|
||||
@ApiOperation("删除测试用例")
|
||||
@PreAuthorize("@ss.hasPermi('aima:testcase:remove')")
|
||||
@Log(title = "测试用例管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids) {
|
||||
return toAjax(aimaTestCaseService.deleteAimaTestCaseByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
package com.cmvr.web.controller.aima;
|
||||
|
||||
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.*;
|
||||
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.aima.domain.AimaTestLog;
|
||||
import com.cmvr.aima.service.IAimaTestLogService;
|
||||
import com.cmvr.common.utils.poi.ExcelUtil;
|
||||
import com.cmvr.common.core.page.TableDataInfo;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/aima/testlog")
|
||||
@Api(tags = "爱玛电动车--测试日志管理")
|
||||
public class AimaTestLogController extends BaseController {
|
||||
@Autowired
|
||||
private IAimaTestLogService aimaTestLogService;
|
||||
|
||||
@ApiOperation("查询测试日志列表")
|
||||
@PreAuthorize("@ss.hasPermi('aima:testlog:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(AimaTestLog aimaTestLog) {
|
||||
startPage();
|
||||
List<AimaTestLog> list = aimaTestLogService.selectAimaTestLogList(aimaTestLog);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation("导出测试日志列表")
|
||||
@PreAuthorize("@ss.hasPermi('aima:testlog:export')")
|
||||
@Log(title = "测试日志管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, AimaTestLog aimaTestLog) {
|
||||
List<AimaTestLog> list = aimaTestLogService.selectAimaTestLogList(aimaTestLog);
|
||||
ExcelUtil<AimaTestLog> util = new ExcelUtil<>(AimaTestLog.class);
|
||||
util.exportExcel(response, list, "测试日志数据");
|
||||
}
|
||||
|
||||
@ApiOperation("获取测试日志详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('aima:testlog:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id) {
|
||||
return success(aimaTestLogService.selectAimaTestLogById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("新增测试日志")
|
||||
@PreAuthorize("@ss.hasPermi('aima:testlog:add')")
|
||||
@Log(title = "测试日志管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody AimaTestLog aimaTestLog) {
|
||||
return toAjax(aimaTestLogService.insertAimaTestLog(aimaTestLog));
|
||||
}
|
||||
|
||||
@ApiOperation("修改测试日志")
|
||||
@PreAuthorize("@ss.hasPermi('aima:testlog:edit')")
|
||||
@Log(title = "测试日志管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody AimaTestLog aimaTestLog) {
|
||||
return toAjax(aimaTestLogService.updateAimaTestLog(aimaTestLog));
|
||||
}
|
||||
|
||||
@ApiOperation("删除测试日志")
|
||||
@PreAuthorize("@ss.hasPermi('aima:testlog:remove')")
|
||||
@Log(title = "测试日志管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids) {
|
||||
return toAjax(aimaTestLogService.deleteAimaTestLogByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
package com.cmvr.web.controller.aima;
|
||||
|
||||
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.*;
|
||||
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.aima.domain.AimaVehicle;
|
||||
import com.cmvr.aima.service.IAimaVehicleService;
|
||||
import com.cmvr.common.utils.poi.ExcelUtil;
|
||||
import com.cmvr.common.core.page.TableDataInfo;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/aima/vehicle")
|
||||
@Api(tags = "爱玛电动车--车辆管理")
|
||||
public class AimaVehicleController extends BaseController {
|
||||
@Autowired
|
||||
private IAimaVehicleService aimaVehicleService;
|
||||
|
||||
@ApiOperation("查询车辆列表")
|
||||
@PreAuthorize("@ss.hasPermi('aima:vehicle:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(AimaVehicle aimaVehicle) {
|
||||
startPage();
|
||||
List<AimaVehicle> list = aimaVehicleService.selectAimaVehicleList(aimaVehicle);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation("导出车辆列表")
|
||||
@PreAuthorize("@ss.hasPermi('aima:vehicle:export')")
|
||||
@Log(title = "车辆管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, AimaVehicle aimaVehicle) {
|
||||
List<AimaVehicle> list = aimaVehicleService.selectAimaVehicleList(aimaVehicle);
|
||||
ExcelUtil<AimaVehicle> util = new ExcelUtil<>(AimaVehicle.class);
|
||||
util.exportExcel(response, list, "车辆数据");
|
||||
}
|
||||
|
||||
@ApiOperation("获取车辆详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('aima:vehicle:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id) {
|
||||
return success(aimaVehicleService.selectAimaVehicleById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("新增车辆")
|
||||
@PreAuthorize("@ss.hasPermi('aima:vehicle:add')")
|
||||
@Log(title = "车辆管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody AimaVehicle aimaVehicle) {
|
||||
return toAjax(aimaVehicleService.insertAimaVehicle(aimaVehicle));
|
||||
}
|
||||
|
||||
@ApiOperation("修改车辆")
|
||||
@PreAuthorize("@ss.hasPermi('aima:vehicle:edit')")
|
||||
@Log(title = "车辆管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody AimaVehicle aimaVehicle) {
|
||||
return toAjax(aimaVehicleService.updateAimaVehicle(aimaVehicle));
|
||||
}
|
||||
|
||||
@ApiOperation("删除车辆")
|
||||
@PreAuthorize("@ss.hasPermi('aima:vehicle:remove')")
|
||||
@Log(title = "车辆管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids) {
|
||||
return toAjax(aimaVehicleService.deleteAimaVehicleByIds(ids));
|
||||
}
|
||||
}
|
||||
33
cmvr-iot-aima/pom.xml
Normal file
33
cmvr-iot-aima/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-aima</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>
|
||||
118
cmvr-iot-aima/src/main/java/com/cmvr/aima/domain/AimaAlarm.java
Normal file
118
cmvr-iot-aima/src/main/java/com/cmvr/aima/domain/AimaAlarm.java
Normal file
@ -0,0 +1,118 @@
|
||||
package com.cmvr.aima.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;
|
||||
|
||||
/**
|
||||
* 爱玛告警管理对象 aima_alarm
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("爱玛告警管理")
|
||||
public class AimaAlarm 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 phoneId;
|
||||
|
||||
@Excel(name = "手机名称")
|
||||
@ApiModelProperty("手机名称")
|
||||
private String phoneName;
|
||||
|
||||
@Excel(name = "车辆ID")
|
||||
@ApiModelProperty("车辆ID")
|
||||
private String vehicleId;
|
||||
|
||||
@Excel(name = "车架号")
|
||||
@ApiModelProperty("车架号")
|
||||
private String vin;
|
||||
|
||||
@Excel(name = "测试用例ID")
|
||||
@ApiModelProperty("测试用例ID")
|
||||
private String testCaseId;
|
||||
|
||||
@Excel(name = "用例名称")
|
||||
@ApiModelProperty("用例名称")
|
||||
private String caseName;
|
||||
|
||||
@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,61 @@
|
||||
package com.cmvr.aima.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;
|
||||
|
||||
/**
|
||||
* 爱玛手机管理对象 aima_phone
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("爱玛手机管理")
|
||||
public class AimaPhone 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 phoneName;
|
||||
|
||||
@Excel(name = "手机型号")
|
||||
@ApiModelProperty("手机型号")
|
||||
private String phoneModel;
|
||||
|
||||
@Excel(name = "操作系统")
|
||||
@ApiModelProperty("操作系统(Android/iOS)")
|
||||
private String osSystem;
|
||||
|
||||
@Excel(name = "系统版本")
|
||||
@ApiModelProperty("系统版本")
|
||||
private String osVersion;
|
||||
|
||||
@Excel(name = "规格参数")
|
||||
@ApiModelProperty("规格参数")
|
||||
private String specifications;
|
||||
|
||||
@Excel(name = "厂商")
|
||||
@ApiModelProperty("厂商")
|
||||
private String manufacturer;
|
||||
|
||||
@Excel(name = "状态")
|
||||
@ApiModelProperty("状态(0正常 1停用)")
|
||||
private String status;
|
||||
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
package com.cmvr.aima.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;
|
||||
|
||||
/**
|
||||
* 爱玛任务管理对象 aima_task
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("爱玛任务管理")
|
||||
public class AimaTask 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回归测试 3专项测试)")
|
||||
private String taskType;
|
||||
|
||||
@ApiModelProperty("手机ID")
|
||||
private String phoneId;
|
||||
|
||||
@ApiModelProperty("车辆ID")
|
||||
private String vehicleId;
|
||||
|
||||
@Excel(name = "测试用例数量")
|
||||
@ApiModelProperty("测试用例数量")
|
||||
private Integer testCaseCount;
|
||||
|
||||
/** 任务配置id(关联test模块) */
|
||||
@ApiModelProperty("任务配置id")
|
||||
private String taskConfigId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,87 @@
|
||||
package com.cmvr.aima.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;
|
||||
|
||||
/**
|
||||
* 爱玛任务执行实例对象 aima_task_instance
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("爱玛任务执行实例")
|
||||
public class AimaTaskInstance 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 phoneId;
|
||||
|
||||
@Excel(name = "车辆ID")
|
||||
@ApiModelProperty("车辆ID")
|
||||
private String vehicleId;
|
||||
|
||||
@Excel(name = "第几次执行")
|
||||
@ApiModelProperty("第几次执行")
|
||||
private Integer executionNumber;
|
||||
|
||||
@Excel(name = "执行状态")
|
||||
@ApiModelProperty("执行状态(0待执行 1执行中 2已完成 3已取消 4执行失败 5已暂停)")
|
||||
private Integer status;
|
||||
|
||||
/** 流程实例id(关联test模块) */
|
||||
@ApiModelProperty("流程实例id")
|
||||
private String taskInsId;
|
||||
|
||||
@Excel(name = "总用例数")
|
||||
@ApiModelProperty("总用例数")
|
||||
private Integer totalCases;
|
||||
|
||||
@Excel(name = "已完成用例数")
|
||||
@ApiModelProperty("已完成用例数")
|
||||
private Integer completedCases;
|
||||
|
||||
@Excel(name = "通过用例数")
|
||||
@ApiModelProperty("通过用例数")
|
||||
private Integer passedCases;
|
||||
|
||||
@Excel(name = "失败用例数")
|
||||
@ApiModelProperty("失败用例数")
|
||||
private Integer failedCases;
|
||||
|
||||
@Excel(name = "执行进度")
|
||||
@ApiModelProperty("执行进度(百分比,保留2位小数)")
|
||||
private Double progress;
|
||||
|
||||
@Excel(name = "开始时间")
|
||||
@ApiModelProperty("开始时间")
|
||||
private Date startTime;
|
||||
|
||||
@Excel(name = "结束时间")
|
||||
@ApiModelProperty("结束时间")
|
||||
private Date endTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package com.cmvr.aima.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 爱玛任务与测试用例关联对象 aima_task_test_case
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class AimaTaskTestCase
|
||||
{
|
||||
/** 任务ID */
|
||||
private String taskId;
|
||||
|
||||
/** 测试用例ID */
|
||||
private String testCaseId;
|
||||
|
||||
/** 排序号 */
|
||||
private Integer sortOrder;
|
||||
}
|
||||
@ -0,0 +1,79 @@
|
||||
package com.cmvr.aima.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.*;
|
||||
import com.cmvr.common.annotation.Excel;
|
||||
import com.cmvr.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 爱玛测试用例对象 aima_test_case
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Builder
|
||||
@ApiModel("爱玛测试用例")
|
||||
public class AimaTestCase 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 caseCode;
|
||||
|
||||
@Excel(name = "用例名称")
|
||||
@ApiModelProperty("用例名称")
|
||||
private String caseName;
|
||||
|
||||
@Excel(name = "用例分类")
|
||||
@ApiModelProperty("用例分类(功能测试/性能测试/安全测试等)")
|
||||
private String caseCategory;
|
||||
|
||||
@Excel(name = "测试描述")
|
||||
@ApiModelProperty("测试描述")
|
||||
private String testDescription;
|
||||
|
||||
@Excel(name = "前置条件")
|
||||
@ApiModelProperty("前置条件")
|
||||
private String precondition;
|
||||
|
||||
@Excel(name = "测试步骤")
|
||||
@ApiModelProperty("测试步骤")
|
||||
private String testSteps;
|
||||
|
||||
@Excel(name = "预期结果")
|
||||
@ApiModelProperty("预期结果")
|
||||
private String expectedResult;
|
||||
|
||||
@Excel(name = "优先级")
|
||||
@ApiModelProperty("优先级(1高 2中 3低)")
|
||||
private String priority;
|
||||
|
||||
@Excel(name = "是否启用")
|
||||
@ApiModelProperty("是否启用(0启用 1禁用)")
|
||||
private String enabled;
|
||||
|
||||
@Excel(name = "排序号")
|
||||
@ApiModelProperty("排序号")
|
||||
private Integer sortOrder;
|
||||
|
||||
@Excel(name = "预计执行时长")
|
||||
@ApiModelProperty("预计执行时长(秒)")
|
||||
private Integer estimatedDuration;
|
||||
|
||||
/** 检测项配置id(关联test模块) */
|
||||
@ApiModelProperty("检测项配置id")
|
||||
private String detectItemId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,102 @@
|
||||
package com.cmvr.aima.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.*;
|
||||
import com.cmvr.common.annotation.Excel;
|
||||
import com.cmvr.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 爱玛测试日志对象 aima_test_log
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("爱玛测试日志")
|
||||
@Builder
|
||||
public class AimaTestLog 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 taskInstanceId;
|
||||
|
||||
@Excel(name = "任务ID")
|
||||
@ApiModelProperty("任务ID")
|
||||
private String taskId;
|
||||
|
||||
@Excel(name = "任务名称")
|
||||
@ApiModelProperty("任务名称")
|
||||
private String taskName;
|
||||
|
||||
@Excel(name = "测试用例ID")
|
||||
@ApiModelProperty("测试用例ID")
|
||||
private String testCaseId;
|
||||
|
||||
@Excel(name = "用例名称")
|
||||
@ApiModelProperty("用例名称")
|
||||
private String caseName;
|
||||
|
||||
@Excel(name = "日志级别")
|
||||
@ApiModelProperty("日志级别(DEBUG/INFO/WARN/ERROR)")
|
||||
private String logLevel;
|
||||
|
||||
@Excel(name = "日志类型")
|
||||
@ApiModelProperty("日志类型(执行日志/系统日志/异常日志)")
|
||||
private String logType;
|
||||
|
||||
@Excel(name = "日志内容")
|
||||
@ApiModelProperty("日志内容")
|
||||
private String logMessage;
|
||||
|
||||
@Excel(name = "日志时间")
|
||||
@ApiModelProperty("日志时间")
|
||||
private Date logTime;
|
||||
|
||||
@Excel(name = "执行步骤")
|
||||
@ApiModelProperty("执行步骤")
|
||||
private String executionStep;
|
||||
|
||||
@Excel(name = "实际结果")
|
||||
@ApiModelProperty("实际结果")
|
||||
private String actualResult;
|
||||
|
||||
@Excel(name = "测试结果")
|
||||
@ApiModelProperty("测试结果(0未执行 1通过 2失败 3跳过)")
|
||||
private String testStatus;
|
||||
|
||||
@ApiModelProperty("截图URL")
|
||||
private String screenshotUrl;
|
||||
|
||||
@ApiModelProperty("视频URL")
|
||||
private String videoUrl;
|
||||
|
||||
@ApiModelProperty("错误堆栈")
|
||||
private String errorStack;
|
||||
|
||||
@Excel(name = "执行耗时")
|
||||
@ApiModelProperty("执行耗时(毫秒)")
|
||||
private Long durationMs;
|
||||
|
||||
@Excel(name = "进度")
|
||||
@ApiModelProperty("执行进度(百分比)")
|
||||
private Double progress;
|
||||
|
||||
@Excel(name = "状态")
|
||||
@ApiModelProperty("执行状态(0待执行 1执行中 2已完成 3已取消 4执行失败 5已暂停)")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
package com.cmvr.aima.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;
|
||||
|
||||
/**
|
||||
* 爱玛车辆管理对象 aima_vehicle
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("爱玛车辆管理")
|
||||
public class AimaVehicle extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("主键ID")
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
@Excel(name = "车架号")
|
||||
@ApiModelProperty("车架号(VIN)")
|
||||
private String vin;
|
||||
|
||||
@Excel(name = "车型")
|
||||
@ApiModelProperty("车型")
|
||||
private String vehicleModel;
|
||||
|
||||
@Excel(name = "车辆名称")
|
||||
@ApiModelProperty("车辆名称")
|
||||
private String vehicleName;
|
||||
|
||||
@Excel(name = "颜色")
|
||||
@ApiModelProperty("颜色")
|
||||
private String color;
|
||||
|
||||
@Excel(name = "生产日期")
|
||||
@ApiModelProperty("生产日期")
|
||||
private Date productionDate;
|
||||
|
||||
@Excel(name = "状态")
|
||||
@ApiModelProperty("状态(0正常 1停用)")
|
||||
private String status;
|
||||
|
||||
}
|
||||
@ -0,0 +1,136 @@
|
||||
package com.cmvr.aima.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-22
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("爱玛任务执行实例视图对象")
|
||||
public class
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
AimaTaskInstanceVo 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 */
|
||||
@ApiModelProperty("手机ID")
|
||||
private String phoneId;
|
||||
|
||||
/** 手机名称 */
|
||||
@Excel(name = "手机名称")
|
||||
@ApiModelProperty("手机名称")
|
||||
private String phoneName;
|
||||
|
||||
/** 车辆ID */
|
||||
@ApiModelProperty("车辆ID")
|
||||
private String vehicleId;
|
||||
|
||||
/** 车辆名称 */
|
||||
@Excel(name = "车辆名称")
|
||||
@ApiModelProperty("车辆名称")
|
||||
private String vehicleName;
|
||||
|
||||
/** 车架号 */
|
||||
@Excel(name = "车架号")
|
||||
@ApiModelProperty("车架号")
|
||||
private String vin;
|
||||
|
||||
/** 第几次执行 */
|
||||
@Excel(name = "执行次数")
|
||||
@ApiModelProperty("第几次执行")
|
||||
private Integer executionNumber;
|
||||
|
||||
/** 执行状态 */
|
||||
@Excel(name = "执行状态")
|
||||
@ApiModelProperty("执行状态(0待执行 1执行中 2已完成 3已取消 4执行失败 5已暂停)")
|
||||
private Integer status;
|
||||
|
||||
/** 流程实例id */
|
||||
@ApiModelProperty("流程实例id")
|
||||
private String taskInsId;
|
||||
|
||||
/** 总用例数 */
|
||||
@Excel(name = "总用例数")
|
||||
@ApiModelProperty("总用例数")
|
||||
private Integer totalCases;
|
||||
|
||||
/** 已完成用例数 */
|
||||
@Excel(name = "已完成")
|
||||
@ApiModelProperty("已完成用例数")
|
||||
private Integer completedCases;
|
||||
|
||||
/** 通过用例数 */
|
||||
@Excel(name = "通过数")
|
||||
@ApiModelProperty("通过用例数")
|
||||
private Integer passedCases;
|
||||
|
||||
/** 失败用例数 */
|
||||
@Excel(name = "失败数")
|
||||
@ApiModelProperty("失败用例数")
|
||||
private Integer failedCases;
|
||||
|
||||
/** 执行进度 */
|
||||
@Excel(name = "执行进度")
|
||||
@ApiModelProperty("执行进度(百分比,保留2位小数)")
|
||||
private Double progress;
|
||||
|
||||
/** 开始时间 */
|
||||
@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,77 @@
|
||||
package com.cmvr.aima.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-06-22
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("爱玛任务视图对象")
|
||||
public class AimaTaskVo 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回归测试 3专项测试)")
|
||||
private String taskType;
|
||||
|
||||
/** 手机ID */
|
||||
@ApiModelProperty("手机ID")
|
||||
private String phoneId;
|
||||
|
||||
/** 手机名称 */
|
||||
@Excel(name = "手机名称")
|
||||
@ApiModelProperty("手机名称")
|
||||
private String phoneName;
|
||||
|
||||
/** 车辆ID */
|
||||
@ApiModelProperty("车辆ID")
|
||||
private String vehicleId;
|
||||
|
||||
/** 测试用例数量 */
|
||||
@Excel(name = "测试用例数量")
|
||||
@ApiModelProperty("测试用例数量")
|
||||
private Integer testCaseCount;
|
||||
|
||||
/** 任务配置id */
|
||||
@ApiModelProperty("任务配置id")
|
||||
private String taskConfigId;
|
||||
|
||||
/** 创建人昵称 */
|
||||
@Excel(name = "创建人昵称")
|
||||
@ApiModelProperty("创建人昵称")
|
||||
private String createByName;
|
||||
|
||||
/** 修改人昵称 */
|
||||
@Excel(name = "修改人昵称")
|
||||
@ApiModelProperty("修改人昵称")
|
||||
private String updateByName;
|
||||
}
|
||||
@ -0,0 +1,100 @@
|
||||
package com.cmvr.aima.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-06-22
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("爱玛测试用例视图对象")
|
||||
public class AimaTestCaseVo extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
@ApiModelProperty("id")
|
||||
private String id;
|
||||
|
||||
/** 用例编码 */
|
||||
@Excel(name = "用例编码")
|
||||
@ApiModelProperty("用例编码")
|
||||
private String caseCode;
|
||||
|
||||
/** 用例名称 */
|
||||
@Excel(name = "用例名称")
|
||||
@ApiModelProperty("用例名称")
|
||||
private String caseName;
|
||||
|
||||
/** 用例分类 */
|
||||
@Excel(name = "用例分类")
|
||||
@ApiModelProperty("用例分类(功能测试/性能测试/安全测试等)")
|
||||
private String caseCategory;
|
||||
|
||||
/** 测试描述 */
|
||||
@ApiModelProperty("测试描述")
|
||||
private String testDescription;
|
||||
|
||||
/** 前置条件 */
|
||||
@ApiModelProperty("前置条件")
|
||||
private String precondition;
|
||||
|
||||
/** 测试步骤 */
|
||||
@ApiModelProperty("测试步骤")
|
||||
private String testSteps;
|
||||
|
||||
/** 预期结果 */
|
||||
@ApiModelProperty("预期结果")
|
||||
private String expectedResult;
|
||||
|
||||
/** 优先级 */
|
||||
@Excel(name = "优先级")
|
||||
@ApiModelProperty("优先级(1高 2中 3低)")
|
||||
private String priority;
|
||||
|
||||
/** 是否启用 */
|
||||
@Excel(name = "是否启用")
|
||||
@ApiModelProperty("是否启用(0启用 1禁用)")
|
||||
private String enabled;
|
||||
|
||||
/** 排序号 */
|
||||
@Excel(name = "排序号")
|
||||
@ApiModelProperty("排序号")
|
||||
private Integer sortOrder;
|
||||
|
||||
/** 预计执行时长 */
|
||||
@Excel(name = "预计执行时长")
|
||||
@ApiModelProperty("预计执行时长(秒)")
|
||||
private Integer estimatedDuration;
|
||||
|
||||
/** 检测项配置id */
|
||||
@ApiModelProperty("检测项配置id")
|
||||
private String detectItemId;
|
||||
|
||||
/** 配置状态 */
|
||||
@Excel(name = "配置状态")
|
||||
@ApiModelProperty("配置状态(0未部署 1已部署)")
|
||||
private String configStatus;
|
||||
|
||||
/** 创建人昵称 */
|
||||
@Excel(name = "创建人昵称")
|
||||
@ApiModelProperty("创建人昵称")
|
||||
private String createByName;
|
||||
|
||||
/** 修改人昵称 */
|
||||
@Excel(name = "修改人昵称")
|
||||
@ApiModelProperty("修改人昵称")
|
||||
private String updateByName;
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package com.cmvr.aima.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 爱玛测试日志类型枚举
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum AimaLogTypeEnum {
|
||||
TEXT(1, "文字"),
|
||||
IMAGE(2, "图片"),
|
||||
VIDEO(3, "视频"),
|
||||
AUDIO(4, "音频");
|
||||
|
||||
private final int code;
|
||||
private final String desc;
|
||||
|
||||
public static AimaLogTypeEnum fromCode(int code) {
|
||||
for (AimaLogTypeEnum type : values()) {
|
||||
if (type.code == code) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.cmvr.aima.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 爱玛任务状态枚举
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum AimaTaskStatusEnum {
|
||||
// 未执行
|
||||
NOT_STARTED(5, "未执行"),
|
||||
SUCCESS(0, "已完成"),
|
||||
RUNNING(1, "执行中"),
|
||||
FAILED(2, "失败"),
|
||||
PAUSED(3, "已暂停"),
|
||||
STOPPED(4, "已终止");
|
||||
|
||||
private final int code;
|
||||
private final String desc;
|
||||
|
||||
public static AimaTaskStatusEnum fromCode(int code) {
|
||||
for (AimaTaskStatusEnum status : values()) {
|
||||
if (status.code == code) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,199 @@
|
||||
package com.cmvr.aima.listener;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.cmvr.common.utils.DateUtils;
|
||||
import com.cmvr.framework.websocket.service.MessagePushService;
|
||||
import com.cmvr.aima.domain.AimaTaskInstance;
|
||||
import com.cmvr.aima.domain.AimaTestLog;
|
||||
import com.cmvr.aima.enums.AimaTaskStatusEnum;
|
||||
import com.cmvr.aima.service.IAimaTaskInstanceService;
|
||||
import com.cmvr.aima.service.IAimaTestLogService;
|
||||
import com.cmvr.test.flow.runtime.event.FlowExecutionEvent;
|
||||
import com.cmvr.test.flow.runtime.event.FlowExecutionListener;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 爱玛测试工作流执行监听器
|
||||
* 监听流程引擎事件,自动记录测试日志和更新任务状态
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class AimaFlowExecutionListener implements FlowExecutionListener {
|
||||
private final IAimaTaskInstanceService aimaTaskInstanceService;
|
||||
private final IAimaTestLogService aimaTestLogService;
|
||||
private final MessagePushService messagePushService;
|
||||
|
||||
/** key:itemId, value:已完成节点集合 */
|
||||
private final Map<String, Set<String>> itemNodeExecutMap = new HashMap<>();
|
||||
/** key:taskInsId(流程实例id), value:已执行item集合 */
|
||||
private final Map<String, Set<String>> taskItemExecutMap = new HashMap<>();
|
||||
|
||||
public AimaFlowExecutionListener(IAimaTaskInstanceService aimaTaskInstanceService,
|
||||
IAimaTestLogService aimaTestLogService,
|
||||
MessagePushService messagePushService) {
|
||||
this.aimaTaskInstanceService = aimaTaskInstanceService;
|
||||
this.aimaTestLogService = aimaTestLogService;
|
||||
this.messagePushService = messagePushService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEvent(FlowExecutionEvent event) {
|
||||
String instId = event.getInstId();
|
||||
String itemId = event.getItemId();
|
||||
String nodeId = event.getNodeId();
|
||||
if (StrUtil.isBlank(instId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 1.节点完成才记录当前item下node
|
||||
if (StrUtil.isNotBlank(itemId) && StrUtil.isNotBlank(nodeId)
|
||||
&& FlowExecutionEvent.EventType.NODE_COMPLETED == event.getEventType()) {
|
||||
itemNodeExecutMap.computeIfAbsent(itemId, k -> new HashSet<>()).add(nodeId);
|
||||
}
|
||||
// 任意事件:当前任务绑定item(item一启动就入Map)
|
||||
if (StrUtil.isNotBlank(instId) && StrUtil.isNotBlank(itemId)) {
|
||||
taskItemExecutMap.computeIfAbsent(instId, k -> new HashSet<>()).add(itemId);
|
||||
}
|
||||
|
||||
// 查询任务实例
|
||||
AimaTaskInstance taskInstance = aimaTaskInstanceService.lambdaQuery()
|
||||
.eq(AimaTaskInstance::getTaskInsId, instId)
|
||||
.one();
|
||||
if (taskInstance == null) {
|
||||
log.warn("未查询到爱玛测试实例,taskInsId:{}", instId);
|
||||
return;
|
||||
}
|
||||
|
||||
int targetStatus = AimaTaskStatusEnum.RUNNING.getCode();
|
||||
boolean needUpdateDb = false;
|
||||
Date now = DateUtils.getNowDate();
|
||||
|
||||
switch (event.getEventType()) {
|
||||
case TASK_COMPLETED:
|
||||
targetStatus = AimaTaskStatusEnum.SUCCESS.getCode();
|
||||
needUpdateDb = true;
|
||||
clearCache(instId);
|
||||
pushCompleteMsg(taskInstance.getId(), now, targetStatus);
|
||||
break;
|
||||
case TASK_FAILED:
|
||||
targetStatus = AimaTaskStatusEnum.FAILED.getCode();
|
||||
needUpdateDb = true;
|
||||
clearCache(instId);
|
||||
break;
|
||||
case NODE_COMPLETED:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (needUpdateDb) {
|
||||
taskInstance.setStatus(targetStatus);
|
||||
taskInstance.setEndTime(now);
|
||||
aimaTaskInstanceService.updateById(taskInstance);
|
||||
}
|
||||
|
||||
// 节点推送 - 记录日志
|
||||
if (StrUtil.isNotBlank(nodeId)) {
|
||||
int totalCases = taskInstance.getTotalCases() == null ? 0 : taskInstance.getTotalCases();
|
||||
double progress = 0D;
|
||||
if (totalCases > 0) {
|
||||
// 当前任务已执行item数量
|
||||
Set<String> itemSet = taskItemExecutMap.getOrDefault(instId, new HashSet<>());
|
||||
int itemTotal = itemSet.size();
|
||||
int finishedItemNum = itemTotal - 1;
|
||||
|
||||
// 当前item已完成节点数
|
||||
Set<String> finishedNodeSet = itemNodeExecutMap.getOrDefault(itemId, new HashSet<>());
|
||||
int finishedNode = finishedNodeSet.size();
|
||||
int totalNode = event.getNodeCount() == 0 ? 1 : event.getNodeCount();
|
||||
|
||||
// 已完整跑完用例占比
|
||||
double itemTotalRatio = finishedItemNum / (double) totalCases;
|
||||
// 当前运行item内部节点占比
|
||||
double innerRatio = finishedNode / (double) totalNode / totalCases;
|
||||
|
||||
// 防止循环节点进度超限
|
||||
double singleItemBase = 1d / totalCases;
|
||||
innerRatio = Math.max(singleItemBase - 0.01, innerRatio);
|
||||
|
||||
progress = (itemTotalRatio + innerRatio) * 100;
|
||||
}
|
||||
|
||||
String info = event.getEventType() == FlowExecutionEvent.EventType.NODE_STARTED ? "开始执行" : "执行完成";
|
||||
String logId = UUID.randomUUID().toString().replace("-", "");
|
||||
// 四舍五入保留2位小数
|
||||
progress = Math.round(progress * 100) / 100.0;
|
||||
|
||||
// 保存日志到数据库
|
||||
AimaTestLog testLog = AimaTestLog.builder()
|
||||
.id(logId)
|
||||
.taskInstanceId(taskInstance.getId())
|
||||
.taskId(taskInstance.getTaskId())
|
||||
.testCaseId(itemId)
|
||||
.logLevel("INFO")
|
||||
.logType("执行日志")
|
||||
.logMessage("节点【" + event.getNodeName() + "】" + info)
|
||||
.logTime(now)
|
||||
.executionStep(event.getNodeName())
|
||||
.testStatus("0") // 0未执行
|
||||
.durationMs(0L)
|
||||
.progress( progress)
|
||||
.build();
|
||||
|
||||
try {
|
||||
aimaTestLogService.insertAimaTestLog(testLog);
|
||||
log.info("爱玛测试日志保存成功,logId:{},taskInstanceId:{},nodeId:{}", logId, taskInstance.getId(), nodeId);
|
||||
} catch (Exception e) {
|
||||
log.error("爱玛测试日志保存失败,taskInstanceId:{},nodeId:{}", taskInstance.getId(), nodeId, e);
|
||||
}
|
||||
|
||||
try {
|
||||
messagePushService.pushToChannel("AimaTaskInstance", testLog);
|
||||
} catch (Exception e) {
|
||||
log.info("消息推送异常,无订阅忽略,itemId:{}", itemId, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 任务结束统一清理缓存 */
|
||||
private void clearCache(String taskInsId) {
|
||||
Set<String> itemList = taskItemExecutMap.getOrDefault(taskInsId, new HashSet<>());
|
||||
itemList.forEach(itemNodeExecutMap::remove);
|
||||
taskItemExecutMap.remove(taskInsId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送完成任务信息
|
||||
*/
|
||||
public void pushCompleteMsg(String dbInsId, Date now, int targetStatus) {
|
||||
String logId = UUID.randomUUID().toString().replace("-", "");
|
||||
|
||||
// 保存完成日志
|
||||
AimaTestLog testLog = AimaTestLog.builder()
|
||||
.id(logId)
|
||||
.taskInstanceId(dbInsId)
|
||||
.logLevel("INFO")
|
||||
.logType("系统日志")
|
||||
.logMessage("任务执行完成")
|
||||
.logTime(now)
|
||||
.status(targetStatus)
|
||||
.build();
|
||||
|
||||
try {
|
||||
aimaTestLogService.insertAimaTestLog(testLog);
|
||||
log.info("任务完成日志保存成功,logId:{},taskInstanceId:{}", logId, dbInsId);
|
||||
} catch (Exception e) {
|
||||
log.error("任务完成日志保存失败,taskInstanceId:{}", dbInsId, e);
|
||||
}
|
||||
try {
|
||||
messagePushService.pushToChannel("AimaTaskInstance", testLog);
|
||||
} catch (Exception e) {
|
||||
log.info("消息推送异常,无订阅忽略,insId:{}", dbInsId, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.cmvr.aima.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.cmvr.aima.domain.AimaAlarm;
|
||||
|
||||
/**
|
||||
* 爱玛告警管理Mapper接口
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
public interface AimaAlarmMapper extends BaseMapper<AimaAlarm> {
|
||||
/**
|
||||
* 查询爱玛告警管理
|
||||
*
|
||||
* @param id 爱玛告警管理主键
|
||||
* @return 爱玛告警管理
|
||||
*/
|
||||
AimaAlarm selectAimaAlarmById(String id);
|
||||
|
||||
/**
|
||||
* 查询爱玛告警管理列表
|
||||
*
|
||||
* @param aimaAlarm 爱玛告警管理
|
||||
* @return 爱玛告警管理集合
|
||||
*/
|
||||
List<AimaAlarm> selectAimaAlarmList(AimaAlarm aimaAlarm);
|
||||
|
||||
/**
|
||||
* 新增爱玛告警管理
|
||||
*
|
||||
* @param aimaAlarm 爱玛告警管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertAimaAlarm(AimaAlarm aimaAlarm);
|
||||
|
||||
/**
|
||||
* 修改爱玛告警管理
|
||||
*
|
||||
* @param aimaAlarm 爱玛告警管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateAimaAlarm(AimaAlarm aimaAlarm);
|
||||
|
||||
/**
|
||||
* 删除爱玛告警管理
|
||||
*
|
||||
* @param id 爱玛告警管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteAimaAlarmById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除爱玛告警管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteAimaAlarmByIds(String[] ids);
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.cmvr.aima.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.cmvr.aima.domain.AimaPhone;
|
||||
|
||||
/**
|
||||
* 爱玛手机管理Mapper接口
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
public interface AimaPhoneMapper extends BaseMapper<AimaPhone> {
|
||||
/**
|
||||
* 查询爱玛手机管理
|
||||
*
|
||||
* @param id 爱玛手机管理主键
|
||||
* @return 爱玛手机管理
|
||||
*/
|
||||
AimaPhone selectAimaPhoneById(String id);
|
||||
|
||||
/**
|
||||
* 查询爱玛手机管理列表
|
||||
*
|
||||
* @param aimaPhone 爱玛手机管理
|
||||
* @return 爱玛手机管理集合
|
||||
*/
|
||||
List<AimaPhone> selectAimaPhoneList(AimaPhone aimaPhone);
|
||||
|
||||
/**
|
||||
* 新增爱玛手机管理
|
||||
*
|
||||
* @param aimaPhone 爱玛手机管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertAimaPhone(AimaPhone aimaPhone);
|
||||
|
||||
/**
|
||||
* 修改爱玛手机管理
|
||||
*
|
||||
* @param aimaPhone 爱玛手机管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateAimaPhone(AimaPhone aimaPhone);
|
||||
|
||||
/**
|
||||
* 删除爱玛手机管理
|
||||
*
|
||||
* @param id 爱玛手机管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteAimaPhoneById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除爱玛手机管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteAimaPhoneByIds(String[] ids);
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package com.cmvr.aima.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.cmvr.aima.domain.AimaTaskInstance;
|
||||
import com.cmvr.aima.domain.vo.AimaTaskInstanceVo;
|
||||
|
||||
/**
|
||||
* 爱玛任务执行实例Mapper接口
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
public interface AimaTaskInstanceMapper extends BaseMapper<AimaTaskInstance> {
|
||||
/**
|
||||
* 查询爱玛任务执行实例
|
||||
*
|
||||
* @param id 爱玛任务执行实例主键
|
||||
* @return 爱玛任务执行实例
|
||||
*/
|
||||
AimaTaskInstance selectAimaTaskInstanceById(String id);
|
||||
|
||||
/**
|
||||
* 查询爱玛任务执行实例列表
|
||||
*
|
||||
* @param aimaTaskInstance 爱玛任务执行实例
|
||||
* @return 爱玛任务执行实例集合
|
||||
*/
|
||||
List<AimaTaskInstance> selectAimaTaskInstanceList(AimaTaskInstance aimaTaskInstance);
|
||||
|
||||
/**
|
||||
* 查询爱玛任务执行实例视图列表(包含关联信息)
|
||||
*
|
||||
* @param aimaTaskInstance 爱玛任务执行实例
|
||||
* @return 爱玛任务执行实例视图集合
|
||||
*/
|
||||
List<AimaTaskInstanceVo> selectAimaTaskInstanceVoList(AimaTaskInstance aimaTaskInstance);
|
||||
|
||||
/**
|
||||
* 新增爱玛任务执行实例
|
||||
*
|
||||
* @param aimaTaskInstance 爱玛任务执行实例
|
||||
* @return 结果
|
||||
*/
|
||||
int insertAimaTaskInstance(AimaTaskInstance aimaTaskInstance);
|
||||
|
||||
/**
|
||||
* 修改爱玛任务执行实例
|
||||
*
|
||||
* @param aimaTaskInstance 爱玛任务执行实例
|
||||
* @return 结果
|
||||
*/
|
||||
int updateAimaTaskInstance(AimaTaskInstance aimaTaskInstance);
|
||||
|
||||
/**
|
||||
* 删除爱玛任务执行实例
|
||||
*
|
||||
* @param id 爱玛任务执行实例主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteAimaTaskInstanceById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除爱玛任务执行实例
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteAimaTaskInstanceByIds(String[] ids);
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package com.cmvr.aima.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.cmvr.aima.domain.AimaTask;
|
||||
import com.cmvr.aima.domain.vo.AimaTaskVo;
|
||||
|
||||
/**
|
||||
* 爱玛任务管理Mapper接口
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
public interface AimaTaskMapper extends BaseMapper<AimaTask> {
|
||||
/**
|
||||
* 查询爱玛任务管理
|
||||
*
|
||||
* @param id 爱玛任务管理主键
|
||||
* @return 爱玛任务管理
|
||||
*/
|
||||
AimaTask selectAimaTaskById(String id);
|
||||
|
||||
/**
|
||||
* 查询爱玛任务管理列表
|
||||
*
|
||||
* @param aimaTask 爱玛任务管理
|
||||
* @return 爱玛任务管理集合
|
||||
*/
|
||||
List<AimaTask> selectAimaTaskList(AimaTask aimaTask);
|
||||
|
||||
/**
|
||||
* 查询爱玛任务视图列表(包含关联信息)
|
||||
*
|
||||
* @param aimaTask 爱玛任务管理
|
||||
* @return 爱玛任务视图集合
|
||||
*/
|
||||
List<AimaTaskVo> selectAimaTaskVoList(AimaTask aimaTask);
|
||||
|
||||
/**
|
||||
* 新增爱玛任务管理
|
||||
*
|
||||
* @param aimaTask 爱玛任务管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertAimaTask(AimaTask aimaTask);
|
||||
|
||||
/**
|
||||
* 修改爱玛任务管理
|
||||
*
|
||||
* @param aimaTask 爱玛任务管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateAimaTask(AimaTask aimaTask);
|
||||
|
||||
/**
|
||||
* 删除爱玛任务管理
|
||||
*
|
||||
* @param id 爱玛任务管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteAimaTaskById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除爱玛任务管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteAimaTaskByIds(String[] ids);
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package com.cmvr.aima.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.cmvr.aima.domain.AimaTaskTestCase;
|
||||
|
||||
/**
|
||||
* 爱玛任务与测试用例关联Mapper接口
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
public interface AimaTaskTestCaseMapper extends MPJBaseMapper<AimaTaskTestCase>
|
||||
{
|
||||
/**
|
||||
* 批量插入任务-测试用例关联
|
||||
*
|
||||
* @param list 任务-测试用例关联列表
|
||||
* @return 结果
|
||||
*/
|
||||
void batchInsertTaskTestCase(@Param("list") List<AimaTaskTestCase> list);
|
||||
|
||||
/**
|
||||
* 根据任务ID删除关联
|
||||
*
|
||||
* @param taskId 任务ID
|
||||
* @return 结果
|
||||
*/
|
||||
void deleteTaskTestCaseByTaskId(String taskId);
|
||||
|
||||
/**
|
||||
* 根据任务ID查询测试用例ID列表
|
||||
*
|
||||
* @param taskId 任务ID
|
||||
* @return 测试用例ID列表
|
||||
*/
|
||||
List<String> selectTestCaseIdsByTaskId(String taskId);
|
||||
|
||||
/**
|
||||
* 批量删除任务-测试用例关联
|
||||
*
|
||||
* @param taskIds 需要删除的任务ID数组
|
||||
* @return 结果
|
||||
*/
|
||||
void deleteTaskTestCaseByTaskIds(String[] taskIds);
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package com.cmvr.aima.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.cmvr.aima.domain.AimaTestCase;
|
||||
import com.cmvr.aima.domain.vo.AimaTestCaseVo;
|
||||
|
||||
/**
|
||||
* 爱玛测试用例Mapper接口
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
public interface AimaTestCaseMapper extends BaseMapper<AimaTestCase> {
|
||||
/**
|
||||
* 查询爱玛测试用例
|
||||
*
|
||||
* @param id 爱玛测试用例主键
|
||||
* @return 爱玛测试用例
|
||||
*/
|
||||
AimaTestCase selectAimaTestCaseById(String id);
|
||||
|
||||
/**
|
||||
* 查询爱玛测试用例列表
|
||||
*
|
||||
* @param aimaTestCase 爱玛测试用例
|
||||
* @return 爱玛测试用例集合
|
||||
*/
|
||||
List<AimaTestCase> selectAimaTestCaseList(AimaTestCase aimaTestCase);
|
||||
|
||||
/**
|
||||
* 查询爱玛测试用例视图列表(包含关联信息)
|
||||
*
|
||||
* @param aimaTestCase 爱玛测试用例
|
||||
* @return 爱玛测试用例视图集合
|
||||
*/
|
||||
List<AimaTestCaseVo> selectAimaTestCaseVoList(AimaTestCase aimaTestCase);
|
||||
|
||||
/**
|
||||
* 新增爱玛测试用例
|
||||
*
|
||||
* @param aimaTestCase 爱玛测试用例
|
||||
* @return 结果
|
||||
*/
|
||||
int insertAimaTestCase(AimaTestCase aimaTestCase);
|
||||
|
||||
/**
|
||||
* 修改爱玛测试用例
|
||||
*
|
||||
* @param aimaTestCase 爱玛测试用例
|
||||
* @return 结果
|
||||
*/
|
||||
int updateAimaTestCase(AimaTestCase aimaTestCase);
|
||||
|
||||
/**
|
||||
* 删除爱玛测试用例
|
||||
*
|
||||
* @param id 爱玛测试用例主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteAimaTestCaseById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除爱玛测试用例
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteAimaTestCaseByIds(String[] ids);
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.cmvr.aima.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.cmvr.aima.domain.AimaTestLog;
|
||||
|
||||
/**
|
||||
* 爱玛测试日志Mapper接口
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
public interface AimaTestLogMapper extends BaseMapper<AimaTestLog> {
|
||||
/**
|
||||
* 查询爱玛测试日志
|
||||
*
|
||||
* @param id 爱玛测试日志主键
|
||||
* @return 爱玛测试日志
|
||||
*/
|
||||
AimaTestLog selectAimaTestLogById(String id);
|
||||
|
||||
/**
|
||||
* 查询爱玛测试日志列表
|
||||
*
|
||||
* @param aimaTestLog 爱玛测试日志
|
||||
* @return 爱玛测试日志集合
|
||||
*/
|
||||
List<AimaTestLog> selectAimaTestLogList(AimaTestLog aimaTestLog);
|
||||
|
||||
/**
|
||||
* 新增爱玛测试日志
|
||||
*
|
||||
* @param aimaTestLog 爱玛测试日志
|
||||
* @return 结果
|
||||
*/
|
||||
int insertAimaTestLog(AimaTestLog aimaTestLog);
|
||||
|
||||
/**
|
||||
* 修改爱玛测试日志
|
||||
*
|
||||
* @param aimaTestLog 爱玛测试日志
|
||||
* @return 结果
|
||||
*/
|
||||
int updateAimaTestLog(AimaTestLog aimaTestLog);
|
||||
|
||||
/**
|
||||
* 删除爱玛测试日志
|
||||
*
|
||||
* @param id 爱玛测试日志主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteAimaTestLogById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除爱玛测试日志
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteAimaTestLogByIds(String[] ids);
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.cmvr.aima.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.cmvr.aima.domain.AimaVehicle;
|
||||
|
||||
/**
|
||||
* 爱玛车辆管理Mapper接口
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
public interface AimaVehicleMapper extends BaseMapper<AimaVehicle> {
|
||||
/**
|
||||
* 查询爱玛车辆管理
|
||||
*
|
||||
* @param id 爱玛车辆管理主键
|
||||
* @return 爱玛车辆管理
|
||||
*/
|
||||
AimaVehicle selectAimaVehicleById(String id);
|
||||
|
||||
/**
|
||||
* 查询爱玛车辆管理列表
|
||||
*
|
||||
* @param aimaVehicle 爱玛车辆管理
|
||||
* @return 爱玛车辆管理集合
|
||||
*/
|
||||
List<AimaVehicle> selectAimaVehicleList(AimaVehicle aimaVehicle);
|
||||
|
||||
/**
|
||||
* 新增爱玛车辆管理
|
||||
*
|
||||
* @param aimaVehicle 爱玛车辆管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertAimaVehicle(AimaVehicle aimaVehicle);
|
||||
|
||||
/**
|
||||
* 修改爱玛车辆管理
|
||||
*
|
||||
* @param aimaVehicle 爱玛车辆管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateAimaVehicle(AimaVehicle aimaVehicle);
|
||||
|
||||
/**
|
||||
* 删除爱玛车辆管理
|
||||
*
|
||||
* @param id 爱玛车辆管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteAimaVehicleById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除爱玛车辆管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteAimaVehicleByIds(String[] ids);
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.cmvr.aima.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.cmvr.aima.domain.AimaAlarm;
|
||||
|
||||
/**
|
||||
* 爱玛告警管理Service接口
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
public interface IAimaAlarmService {
|
||||
AimaAlarm selectAimaAlarmById(String id);
|
||||
List<AimaAlarm> selectAimaAlarmList(AimaAlarm aimaAlarm);
|
||||
int insertAimaAlarm(AimaAlarm aimaAlarm);
|
||||
int updateAimaAlarm(AimaAlarm aimaAlarm);
|
||||
int deleteAimaAlarmByIds(String[] ids);
|
||||
int deleteAimaAlarmById(String id);
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package com.cmvr.aima.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.cmvr.aima.domain.AimaPhone;
|
||||
|
||||
/**
|
||||
* 爱玛手机管理Service接口
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
public interface IAimaPhoneService {
|
||||
/**
|
||||
* 查询爱玛手机管理
|
||||
*
|
||||
* @param id 爱玛手机管理主键
|
||||
* @return 爱玛手机管理
|
||||
*/
|
||||
AimaPhone selectAimaPhoneById(String id);
|
||||
|
||||
/**
|
||||
* 查询爱玛手机管理列表
|
||||
*
|
||||
* @param aimaPhone 爱玛手机管理
|
||||
* @return 爱玛手机管理集合
|
||||
*/
|
||||
List<AimaPhone> selectAimaPhoneList(AimaPhone aimaPhone);
|
||||
|
||||
/**
|
||||
* 新增爱玛手机管理
|
||||
*
|
||||
* @param aimaPhone 爱玛手机管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertAimaPhone(AimaPhone aimaPhone);
|
||||
|
||||
/**
|
||||
* 修改爱玛手机管理
|
||||
*
|
||||
* @param aimaPhone 爱玛手机管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateAimaPhone(AimaPhone aimaPhone);
|
||||
|
||||
/**
|
||||
* 批量删除爱玛手机管理
|
||||
*
|
||||
* @param ids 需要删除的爱玛手机管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteAimaPhoneByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除爱玛手机管理信息
|
||||
*
|
||||
* @param id 爱玛手机管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteAimaPhoneById(String id);
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.cmvr.aima.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.cmvr.aima.domain.AimaTaskInstance;
|
||||
import com.cmvr.aima.domain.vo.AimaTaskInstanceVo;
|
||||
|
||||
/**
|
||||
* 爱玛任务执行实例Service接口
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
public interface IAimaTaskInstanceService extends IService<AimaTaskInstance> {
|
||||
AimaTaskInstance selectAimaTaskInstanceById(String id);
|
||||
List<AimaTaskInstance> selectAimaTaskInstanceList(AimaTaskInstance aimaTaskInstance);
|
||||
List<AimaTaskInstanceVo> selectAimaTaskInstanceVoList(AimaTaskInstance aimaTaskInstance);
|
||||
int insertAimaTaskInstance(AimaTaskInstance aimaTaskInstance);
|
||||
int updateAimaTaskInstance(AimaTaskInstance aimaTaskInstance);
|
||||
int deleteAimaTaskInstanceByIds(String[] ids);
|
||||
int deleteAimaTaskInstanceById(String id);
|
||||
|
||||
/**
|
||||
* 开始执行任务实例
|
||||
*
|
||||
* @param id 任务实例ID
|
||||
* @return 结果
|
||||
*/
|
||||
int startInstance(String id);
|
||||
|
||||
/**
|
||||
* 暂停任务实例
|
||||
*
|
||||
* @param id 任务实例ID
|
||||
* @return 结果
|
||||
*/
|
||||
int pauseInstance(String id);
|
||||
|
||||
/**
|
||||
* 终止任务实例
|
||||
*
|
||||
* @param id 任务实例ID
|
||||
* @return 结果
|
||||
*/
|
||||
int stopInstance(String id);
|
||||
|
||||
/**
|
||||
* 恢复任务实例(从暂停恢复为执行中)
|
||||
*
|
||||
* @param id 任务实例ID
|
||||
* @return 结果
|
||||
*/
|
||||
int resumeInstance(String id);
|
||||
|
||||
/**
|
||||
* 更新任务实例进度
|
||||
*
|
||||
* @param instanceId 任务实例ID
|
||||
* @param progress 执行进度(百分比,保留2位小数)
|
||||
*/
|
||||
void updateProgress(String instanceId, Double progress);
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package com.cmvr.aima.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.cmvr.aima.domain.AimaTask;
|
||||
import com.cmvr.aima.domain.AimaTestCase;
|
||||
import com.cmvr.aima.domain.vo.AimaTaskVo;
|
||||
|
||||
/**
|
||||
* 爱玛任务管理Service接口
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
public interface IAimaTaskService {
|
||||
AimaTask selectAimaTaskById(String id);
|
||||
List<AimaTask> selectAimaTaskList(AimaTask aimaTask);
|
||||
List<AimaTaskVo> selectAimaTaskVoList(AimaTask aimaTask);
|
||||
int insertAimaTask(AimaTask aimaTask);
|
||||
int updateAimaTask(AimaTask aimaTask);
|
||||
int deleteAimaTaskByIds(String[] ids);
|
||||
int deleteAimaTaskById(String id);
|
||||
|
||||
/**
|
||||
* 为任务绑定测试用例
|
||||
*
|
||||
* @param taskId 任务ID
|
||||
* @param testCaseIds 测试用例ID列表
|
||||
*/
|
||||
void bindTestCases(String taskId, List<String> testCaseIds);
|
||||
|
||||
/**
|
||||
* 获取任务的测试用例列表
|
||||
*
|
||||
* @param taskId 任务ID
|
||||
* @return 测试用例ID列表
|
||||
*/
|
||||
List<AimaTestCase> getTestCaseIds(String taskId);
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package com.cmvr.aima.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.cmvr.aima.domain.AimaTestCase;
|
||||
import com.cmvr.aima.domain.vo.AimaTestCaseVo;
|
||||
|
||||
/**
|
||||
* 爱玛测试用例Service接口
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
public interface IAimaTestCaseService {
|
||||
/**
|
||||
* 查询爱玛测试用例
|
||||
*
|
||||
* @param id 爱玛测试用例主键
|
||||
* @return 爱玛测试用例
|
||||
*/
|
||||
AimaTestCase selectAimaTestCaseById(String id);
|
||||
|
||||
/**
|
||||
* 查询爱玛测试用例列表
|
||||
*
|
||||
* @param aimaTestCase 爱玛测试用例
|
||||
* @return 爱玛测试用例集合
|
||||
*/
|
||||
List<AimaTestCase> selectAimaTestCaseList(AimaTestCase aimaTestCase);
|
||||
|
||||
/**
|
||||
* 查询爱玛测试用例视图列表(包含关联信息)
|
||||
*
|
||||
* @param aimaTestCase 爱玛测试用例
|
||||
* @return 爱玛测试用例视图集合
|
||||
*/
|
||||
List<AimaTestCaseVo> selectAimaTestCaseVoList(AimaTestCase aimaTestCase);
|
||||
|
||||
/**
|
||||
* 新增爱玛测试用例
|
||||
*
|
||||
* @param aimaTestCase 爱玛测试用例
|
||||
* @return 结果
|
||||
*/
|
||||
int insertAimaTestCase(AimaTestCase aimaTestCase);
|
||||
|
||||
/**
|
||||
* 修改爱玛测试用例
|
||||
*
|
||||
* @param aimaTestCase 爱玛测试用例
|
||||
* @return 结果
|
||||
*/
|
||||
int updateAimaTestCase(AimaTestCase aimaTestCase);
|
||||
|
||||
/**
|
||||
* 批量删除爱玛测试用例
|
||||
*
|
||||
* @param ids 需要删除的爱玛测试用例主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteAimaTestCaseByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除爱玛测试用例信息
|
||||
*
|
||||
* @param id 爱玛测试用例主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteAimaTestCaseById(String id);
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.cmvr.aima.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.cmvr.aima.domain.AimaTestLog;
|
||||
|
||||
/**
|
||||
* 爱玛测试日志Service接口
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
public interface IAimaTestLogService {
|
||||
AimaTestLog selectAimaTestLogById(String id);
|
||||
List<AimaTestLog> selectAimaTestLogList(AimaTestLog aimaTestLog);
|
||||
int insertAimaTestLog(AimaTestLog aimaTestLog);
|
||||
int updateAimaTestLog(AimaTestLog aimaTestLog);
|
||||
int deleteAimaTestLogByIds(String[] ids);
|
||||
int deleteAimaTestLogById(String id);
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package com.cmvr.aima.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.cmvr.aima.domain.AimaVehicle;
|
||||
|
||||
/**
|
||||
* 爱玛车辆管理Service接口
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
public interface IAimaVehicleService {
|
||||
/**
|
||||
* 查询爱玛车辆管理
|
||||
*
|
||||
* @param id 爱玛车辆管理主键
|
||||
* @return 爱玛车辆管理
|
||||
*/
|
||||
AimaVehicle selectAimaVehicleById(String id);
|
||||
|
||||
/**
|
||||
* 查询爱玛车辆管理列表
|
||||
*
|
||||
* @param aimaVehicle 爱玛车辆管理
|
||||
* @return 爱玛车辆管理集合
|
||||
*/
|
||||
List<AimaVehicle> selectAimaVehicleList(AimaVehicle aimaVehicle);
|
||||
|
||||
/**
|
||||
* 新增爱玛车辆管理
|
||||
*
|
||||
* @param aimaVehicle 爱玛车辆管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertAimaVehicle(AimaVehicle aimaVehicle);
|
||||
|
||||
/**
|
||||
* 修改爱玛车辆管理
|
||||
*
|
||||
* @param aimaVehicle 爱玛车辆管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateAimaVehicle(AimaVehicle aimaVehicle);
|
||||
|
||||
/**
|
||||
* 批量删除爱玛车辆管理
|
||||
*
|
||||
* @param ids 需要删除的爱玛车辆管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteAimaVehicleByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除爱玛车辆管理信息
|
||||
*
|
||||
* @param id 爱玛车辆管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteAimaVehicleById(String id);
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.cmvr.aima.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
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.aima.mapper.AimaAlarmMapper;
|
||||
import com.cmvr.aima.domain.AimaAlarm;
|
||||
import com.cmvr.aima.service.IAimaAlarmService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 爱玛告警管理Service业务层处理
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
@Service
|
||||
@Transactional
|
||||
public class AimaAlarmServiceImpl extends ServiceImpl<AimaAlarmMapper, AimaAlarm> implements IAimaAlarmService {
|
||||
@Autowired
|
||||
private AimaAlarmMapper aimaAlarmMapper;
|
||||
|
||||
@Override
|
||||
public AimaAlarm selectAimaAlarmById(String id) {
|
||||
return aimaAlarmMapper.selectAimaAlarmById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AimaAlarm> selectAimaAlarmList(AimaAlarm aimaAlarm) {
|
||||
return aimaAlarmMapper.selectAimaAlarmList(aimaAlarm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertAimaAlarm(AimaAlarm aimaAlarm) {
|
||||
if (aimaAlarm.getId() == null || aimaAlarm.getId().isEmpty()) {
|
||||
aimaAlarm.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||
}
|
||||
aimaAlarm.setCreateTime(DateUtils.getNowDate());
|
||||
aimaAlarm.setCreateBy(SecurityUtils.getUsername());
|
||||
return aimaAlarmMapper.insertAimaAlarm(aimaAlarm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateAimaAlarm(AimaAlarm aimaAlarm) {
|
||||
aimaAlarm.setUpdateTime(DateUtils.getNowDate());
|
||||
aimaAlarm.setUpdateBy(SecurityUtils.getUsername());
|
||||
return aimaAlarmMapper.updateAimaAlarm(aimaAlarm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteAimaAlarmByIds(String[] ids) {
|
||||
return aimaAlarmMapper.deleteAimaAlarmByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteAimaAlarmById(String id) {
|
||||
return aimaAlarmMapper.deleteAimaAlarmById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,100 @@
|
||||
package com.cmvr.aima.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
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.aima.mapper.AimaPhoneMapper;
|
||||
import com.cmvr.aima.domain.AimaPhone;
|
||||
import com.cmvr.aima.service.IAimaPhoneService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 爱玛手机管理Service业务层处理
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
@Service
|
||||
@Transactional
|
||||
public class AimaPhoneServiceImpl extends ServiceImpl<AimaPhoneMapper, AimaPhone> implements IAimaPhoneService {
|
||||
@Autowired
|
||||
private AimaPhoneMapper aimaPhoneMapper;
|
||||
|
||||
/**
|
||||
* 查询爱玛手机管理
|
||||
*
|
||||
* @param id 爱玛手机管理主键
|
||||
* @return 爱玛手机管理
|
||||
*/
|
||||
@Override
|
||||
public AimaPhone selectAimaPhoneById(String id) {
|
||||
return aimaPhoneMapper.selectAimaPhoneById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询爱玛手机管理列表
|
||||
*
|
||||
* @param aimaPhone 爱玛手机管理
|
||||
* @return 爱玛手机管理
|
||||
*/
|
||||
@Override
|
||||
public List<AimaPhone> selectAimaPhoneList(AimaPhone aimaPhone) {
|
||||
return aimaPhoneMapper.selectAimaPhoneList(aimaPhone);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增爱玛手机管理
|
||||
*
|
||||
* @param aimaPhone 爱玛手机管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAimaPhone(AimaPhone aimaPhone) {
|
||||
// 生成UUID作为主键
|
||||
if (aimaPhone.getId() == null || aimaPhone.getId().isEmpty()) {
|
||||
aimaPhone.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||
}
|
||||
aimaPhone.setCreateTime(DateUtils.getNowDate());
|
||||
aimaPhone.setCreateBy(SecurityUtils.getUsername());
|
||||
return aimaPhoneMapper.insertAimaPhone(aimaPhone);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改爱玛手机管理
|
||||
*
|
||||
* @param aimaPhone 爱玛手机管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAimaPhone(AimaPhone aimaPhone) {
|
||||
aimaPhone.setUpdateTime(DateUtils.getNowDate());
|
||||
aimaPhone.setUpdateBy(SecurityUtils.getUsername());
|
||||
return aimaPhoneMapper.updateAimaPhone(aimaPhone);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除爱玛手机管理
|
||||
*
|
||||
* @param ids 需要删除的爱玛手机管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAimaPhoneByIds(String[] ids) {
|
||||
return aimaPhoneMapper.deleteAimaPhoneByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除爱玛手机管理信息
|
||||
*
|
||||
* @param id 爱玛手机管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAimaPhoneById(String id) {
|
||||
return aimaPhoneMapper.deleteAimaPhoneById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,231 @@
|
||||
package com.cmvr.aima.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.cmvr.aima.domain.vo.AimaTaskInstanceVo;
|
||||
import com.cmvr.common.exception.ServiceException;
|
||||
import com.cmvr.common.utils.SecurityUtils;
|
||||
import com.cmvr.test.flow.control.FlowControlService;
|
||||
import com.cmvr.test.flow.runtime.engine.FlowTaskRuntimeService;
|
||||
import com.cmvr.test.model.vo.TeTaskExecuteNormalVO;
|
||||
import com.cmvr.test.service.ITeTaskOrchestrationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.cmvr.common.utils.DateUtils;
|
||||
import com.cmvr.aima.mapper.AimaTaskInstanceMapper;
|
||||
import com.cmvr.aima.domain.AimaTaskInstance;
|
||||
import com.cmvr.aima.service.IAimaTaskInstanceService;
|
||||
import com.cmvr.aima.enums.AimaTaskStatusEnum;
|
||||
import com.cmvr.aima.service.IAimaTaskService;
|
||||
import com.cmvr.aima.domain.AimaTask;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 爱玛任务执行实例Service业务层处理
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
@Service
|
||||
@Transactional
|
||||
public class AimaTaskInstanceServiceImpl extends ServiceImpl<AimaTaskInstanceMapper, AimaTaskInstance> implements IAimaTaskInstanceService {
|
||||
@Autowired
|
||||
private AimaTaskInstanceMapper aimaTaskInstanceMapper;
|
||||
|
||||
@Autowired
|
||||
private IAimaTaskService aimaTaskService;
|
||||
|
||||
@Autowired
|
||||
private ITeTaskOrchestrationService teTaskOrchestrationService;
|
||||
|
||||
@Autowired
|
||||
@Lazy
|
||||
private FlowTaskRuntimeService flowTaskRuntimeService;
|
||||
|
||||
@Autowired
|
||||
@Lazy
|
||||
private FlowControlService flowControlService;
|
||||
|
||||
@Override
|
||||
public AimaTaskInstance selectAimaTaskInstanceById(String id) {
|
||||
return aimaTaskInstanceMapper.selectAimaTaskInstanceById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AimaTaskInstance> selectAimaTaskInstanceList(AimaTaskInstance aimaTaskInstance) {
|
||||
return aimaTaskInstanceMapper.selectAimaTaskInstanceList(aimaTaskInstance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AimaTaskInstanceVo> selectAimaTaskInstanceVoList(AimaTaskInstance aimaTaskInstance) {
|
||||
return aimaTaskInstanceMapper.selectAimaTaskInstanceVoList(aimaTaskInstance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertAimaTaskInstance(AimaTaskInstance aimaTaskInstance) {
|
||||
if (aimaTaskInstance.getId() == null || aimaTaskInstance.getId().isEmpty()) {
|
||||
aimaTaskInstance.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||
}
|
||||
aimaTaskInstance.setStatus(AimaTaskStatusEnum.NOT_STARTED.getCode());
|
||||
aimaTaskInstance.setCreateTime(DateUtils.getNowDate());
|
||||
aimaTaskInstance.setCreateBy(SecurityUtils.getUsername());
|
||||
// 获取测试用例数量
|
||||
AimaTask aimaTask = aimaTaskService.selectAimaTaskById(aimaTaskInstance.getTaskId());
|
||||
if (aimaTask != null && aimaTask.getTestCaseCount() != null) {
|
||||
aimaTaskInstance.setTotalCases(aimaTask.getTestCaseCount());
|
||||
}
|
||||
return aimaTaskInstanceMapper.insertAimaTaskInstance(aimaTaskInstance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateAimaTaskInstance(AimaTaskInstance aimaTaskInstance) {
|
||||
// 校验状态,只有未执行可以修改
|
||||
if (AimaTaskStatusEnum.NOT_STARTED.getCode() != aimaTaskInstance.getStatus()) {
|
||||
throw new ServiceException("只有未执行状态的任务实例才能修改");
|
||||
}
|
||||
aimaTaskInstance.setUpdateTime(DateUtils.getNowDate());
|
||||
aimaTaskInstance.setUpdateBy(SecurityUtils.getUsername());
|
||||
// 获取测试用例数量
|
||||
AimaTask aimaTask = aimaTaskService.selectAimaTaskById(aimaTaskInstance.getTaskId());
|
||||
if (aimaTask != null && aimaTask.getTestCaseCount() != null) {
|
||||
aimaTaskInstance.setTotalCases(aimaTask.getTestCaseCount());
|
||||
}
|
||||
return aimaTaskInstanceMapper.updateAimaTaskInstance(aimaTaskInstance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteAimaTaskInstanceByIds(String[] ids) {
|
||||
// 校验状态,只有未执行可以删除
|
||||
for (String id : ids) {
|
||||
AimaTaskInstance instance = aimaTaskInstanceMapper.selectAimaTaskInstanceById(id);
|
||||
if (instance != null && AimaTaskStatusEnum.NOT_STARTED.getCode() != instance.getStatus()) {
|
||||
throw new ServiceException("只有未执行状态的任务实例才能删除");
|
||||
}
|
||||
}
|
||||
return aimaTaskInstanceMapper.deleteAimaTaskInstanceByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteAimaTaskInstanceById(String id) {
|
||||
return aimaTaskInstanceMapper.deleteAimaTaskInstanceById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始执行任务实例
|
||||
*/
|
||||
@Override
|
||||
public int startInstance(String id) {
|
||||
AimaTaskInstance instance = aimaTaskInstanceMapper.selectAimaTaskInstanceById(id);
|
||||
if (instance == null) {
|
||||
throw new ServiceException("任务实例不存在");
|
||||
}
|
||||
if (AimaTaskStatusEnum.NOT_STARTED.getCode() != instance.getStatus()) {
|
||||
throw new ServiceException("只有待执行状态的任务实例才能开始执行");
|
||||
}
|
||||
AimaTaskInstance update = new AimaTaskInstance();
|
||||
update.setId(id);
|
||||
update.setStatus(AimaTaskStatusEnum.RUNNING.getCode());
|
||||
update.setStartTime(DateUtils.getNowDate());
|
||||
update.setUpdateTime(DateUtils.getNowDate());
|
||||
update.setUpdateBy(SecurityUtils.getUsername());
|
||||
|
||||
|
||||
|
||||
AimaTask aimaTask = aimaTaskService.selectAimaTaskById(instance.getTaskId());
|
||||
JSONObject runParams = new JSONObject();
|
||||
// 从test模块的任务编排中获取所有的检测项id
|
||||
if (aimaTask != null && aimaTask.getTaskConfigId() != null) {
|
||||
teTaskOrchestrationService.queryByTaskId(aimaTask.getTaskConfigId())
|
||||
.forEach(item -> runParams.put(item.getItemId(), new JSONObject()));
|
||||
}
|
||||
// 调用流程引擎执行
|
||||
String insId = flowTaskRuntimeService.executeTask(
|
||||
TeTaskExecuteNormalVO.builder()
|
||||
.taskId(aimaTask.getTaskConfigId())
|
||||
.runParams(runParams)
|
||||
.build()
|
||||
);
|
||||
update.setTaskInsId(insId);
|
||||
return aimaTaskInstanceMapper.updateAimaTaskInstance(update);
|
||||
}
|
||||
|
||||
/**
|
||||
* 暂停任务实例
|
||||
*/
|
||||
@Override
|
||||
public int pauseInstance(String id) {
|
||||
AimaTaskInstance instance = aimaTaskInstanceMapper.selectAimaTaskInstanceById(id);
|
||||
if (instance == null) {
|
||||
throw new ServiceException("任务实例不存在");
|
||||
}
|
||||
if (AimaTaskStatusEnum.RUNNING.getCode() != instance.getStatus()) {
|
||||
throw new ServiceException("只有执行中状态的任务实例才能暂停");
|
||||
}
|
||||
AimaTaskInstance update = new AimaTaskInstance();
|
||||
update.setId(id);
|
||||
update.setStatus(AimaTaskStatusEnum.PAUSED.getCode());
|
||||
update.setUpdateTime(DateUtils.getNowDate());
|
||||
update.setUpdateBy(SecurityUtils.getUsername());
|
||||
flowControlService.pause(instance.getTaskInsId());
|
||||
return aimaTaskInstanceMapper.updateAimaTaskInstance(update);
|
||||
}
|
||||
|
||||
/**
|
||||
* 终止任务实例
|
||||
*/
|
||||
@Override
|
||||
public int stopInstance(String id) {
|
||||
AimaTaskInstance instance = aimaTaskInstanceMapper.selectAimaTaskInstanceById(id);
|
||||
if (instance == null) {
|
||||
throw new ServiceException("任务实例不存在");
|
||||
}
|
||||
if (AimaTaskStatusEnum.NOT_STARTED.getCode() != instance.getStatus()
|
||||
&& AimaTaskStatusEnum.RUNNING.getCode() != instance.getStatus()) {
|
||||
throw new ServiceException("已完成或已取消的任务实例不能终止");
|
||||
}
|
||||
AimaTaskInstance update = new AimaTaskInstance();
|
||||
update.setId(id);
|
||||
update.setStatus(AimaTaskStatusEnum.STOPPED.getCode());
|
||||
update.setEndTime(DateUtils.getNowDate());
|
||||
update.setUpdateTime(DateUtils.getNowDate());
|
||||
update.setUpdateBy(SecurityUtils.getUsername());
|
||||
flowControlService.stop(instance.getTaskInsId());
|
||||
return aimaTaskInstanceMapper.updateAimaTaskInstance(update);
|
||||
}
|
||||
|
||||
/**
|
||||
* 恢复任务实例(从暂停恢复为执行中)
|
||||
*/
|
||||
@Override
|
||||
public int resumeInstance(String id) {
|
||||
AimaTaskInstance instance = aimaTaskInstanceMapper.selectAimaTaskInstanceById(id);
|
||||
if (instance == null) {
|
||||
throw new ServiceException("任务实例不存在");
|
||||
}
|
||||
if (AimaTaskStatusEnum.PAUSED.getCode() != instance.getStatus()) {
|
||||
throw new ServiceException("只有已暂停状态的任务实例才能恢复");
|
||||
}
|
||||
AimaTaskInstance update = new AimaTaskInstance();
|
||||
update.setId(id);
|
||||
update.setStatus(AimaTaskStatusEnum.RUNNING.getCode());
|
||||
update.setUpdateTime(DateUtils.getNowDate());
|
||||
update.setUpdateBy(SecurityUtils.getUsername());
|
||||
flowControlService.resume(instance.getTaskInsId());
|
||||
return aimaTaskInstanceMapper.updateAimaTaskInstance(update);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新任务实例进度
|
||||
*/
|
||||
@Override
|
||||
public void updateProgress(String instanceId, Double progress) {
|
||||
AimaTaskInstance update = new AimaTaskInstance();
|
||||
update.setId(instanceId);
|
||||
update.setProgress(progress);
|
||||
update.setUpdateTime(DateUtils.getNowDate());
|
||||
aimaTaskInstanceMapper.updateAimaTaskInstance(update);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,159 @@
|
||||
package com.cmvr.aima.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.cmvr.aima.domain.AimaTaskTestCase;
|
||||
import com.cmvr.aima.domain.AimaTestCase;
|
||||
import com.cmvr.aima.domain.vo.AimaTaskVo;
|
||||
import com.cmvr.aima.mapper.AimaTestCaseMapper;
|
||||
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.aima.mapper.AimaTaskMapper;
|
||||
import com.cmvr.aima.mapper.AimaTaskTestCaseMapper;
|
||||
import com.cmvr.aima.domain.AimaTask;
|
||||
import com.cmvr.aima.service.IAimaTaskService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Service
|
||||
@Transactional
|
||||
public class AimaTaskServiceImpl extends ServiceImpl<AimaTaskMapper, AimaTask> implements IAimaTaskService {
|
||||
@Autowired
|
||||
private AimaTaskMapper aimaTaskMapper;
|
||||
|
||||
@Autowired
|
||||
private AimaTaskTestCaseMapper aimaTaskTestCaseMapper;
|
||||
|
||||
@Autowired
|
||||
private AimaTestCaseMapper aimaTestCaseMapper;
|
||||
|
||||
@Autowired
|
||||
private ITeTaskOrchestrationService teTaskOrchestrationService;
|
||||
|
||||
@Autowired
|
||||
private ITeTaskConfigInfoService teTaskConfigInfoService;
|
||||
|
||||
@Override
|
||||
public AimaTask selectAimaTaskById(String id) {
|
||||
return aimaTaskMapper.selectAimaTaskById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AimaTask> selectAimaTaskList(AimaTask aimaTask) {
|
||||
return aimaTaskMapper.selectAimaTaskList(aimaTask);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AimaTaskVo> selectAimaTaskVoList(AimaTask aimaTask) {
|
||||
return aimaTaskMapper.selectAimaTaskVoList(aimaTask);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertAimaTask(AimaTask aimaTask) {
|
||||
// 生成UUID作为主键
|
||||
if (aimaTask.getId() == null || aimaTask.getId().isEmpty()) {
|
||||
aimaTask.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||
}
|
||||
aimaTask.setCreateTime(DateUtils.getNowDate());
|
||||
aimaTask.setCreateBy(SecurityUtils.getUsername());
|
||||
// 同步新增任务配置到test模块
|
||||
TeTaskConfigInfo teTaskConfigInfo = TeTaskConfigInfo.builder()
|
||||
.taskName(aimaTask.getTaskName())
|
||||
.build();
|
||||
teTaskConfigInfoService.insertTeTaskConfigInfo(teTaskConfigInfo);
|
||||
aimaTask.setTaskConfigId(teTaskConfigInfo.getId());
|
||||
return aimaTaskMapper.insertAimaTask(aimaTask);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateAimaTask(AimaTask aimaTask) {
|
||||
aimaTask.setUpdateTime(DateUtils.getNowDate());
|
||||
aimaTask.setUpdateBy(SecurityUtils.getUsername());
|
||||
// 同步更新任务配置名称
|
||||
if (aimaTask.getTaskConfigId() != null) {
|
||||
TeTaskConfigInfo teTaskConfigInfo = teTaskConfigInfoService.selectTeTaskConfigInfoById(aimaTask.getTaskConfigId());
|
||||
if (teTaskConfigInfo != null) {
|
||||
teTaskConfigInfo.setTaskName(aimaTask.getTaskName());
|
||||
teTaskConfigInfoService.updateTeTaskConfigInfo(teTaskConfigInfo);
|
||||
}
|
||||
}
|
||||
return aimaTaskMapper.updateAimaTask(aimaTask);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteAimaTaskByIds(String[] ids) {
|
||||
// 先删除关联表数据
|
||||
aimaTaskTestCaseMapper.deleteTaskTestCaseByTaskIds(ids);
|
||||
// 批量查询任务
|
||||
List<AimaTask> aimaTasks = this.baseMapper.selectBatchIds(Arrays.asList(ids));
|
||||
// 批量删除任务配置
|
||||
teTaskConfigInfoService.deleteTeTaskConfigInfoByIds(
|
||||
aimaTasks.stream().map(AimaTask::getTaskConfigId).toArray(String[]::new)
|
||||
);
|
||||
return aimaTaskMapper.deleteAimaTaskByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteAimaTaskById(String id) {
|
||||
return aimaTaskMapper.deleteAimaTaskById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindTestCases(String taskId, List<String> testCaseIds) {
|
||||
// 先删除旧的关联
|
||||
aimaTaskTestCaseMapper.deleteTaskTestCaseByTaskId(taskId);
|
||||
|
||||
// 批量插入新的关联
|
||||
if (testCaseIds != null && !testCaseIds.isEmpty()) {
|
||||
List<AimaTaskTestCase> list = new ArrayList<>();
|
||||
for (int i = 0; i < testCaseIds.size(); i++) {
|
||||
AimaTaskTestCase taskTestCase = new AimaTaskTestCase();
|
||||
taskTestCase.setTaskId(taskId);
|
||||
taskTestCase.setTestCaseId(testCaseIds.get(i));
|
||||
taskTestCase.setSortOrder(i);
|
||||
list.add(taskTestCase);
|
||||
}
|
||||
aimaTaskTestCaseMapper.batchInsertTaskTestCase(list);
|
||||
|
||||
// 更新任务的测试用例数量
|
||||
AimaTask task = new AimaTask();
|
||||
task.setId(taskId);
|
||||
task.setTestCaseCount(testCaseIds.size());
|
||||
aimaTaskMapper.updateAimaTask(task);
|
||||
|
||||
// 查询测试用例,获取detectItemId列表
|
||||
List<AimaTestCase> testCases = aimaTestCaseMapper.selectBatchIds(testCaseIds);
|
||||
List<String> detectItemIds = testCases.stream()
|
||||
.map(AimaTestCase::getDetectItemId)
|
||||
.filter(itemId -> itemId != null && !itemId.isEmpty())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 同步任务编排到test模块
|
||||
if (!detectItemIds.isEmpty()) {
|
||||
AimaTask aimaTask = aimaTaskMapper.selectAimaTaskById(taskId);
|
||||
TeTaskOrchestraVO teTaskOrchestraVO = TeTaskOrchestraVO.builder()
|
||||
.taskId(aimaTask.getTaskConfigId())
|
||||
.itemIds(detectItemIds)
|
||||
.build();
|
||||
teTaskOrchestrationService.insertTeTaskOrchestration(teTaskOrchestraVO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AimaTestCase> getTestCaseIds(String taskId) {
|
||||
List<String> ids = aimaTaskTestCaseMapper.selectTestCaseIdsByTaskId(taskId);
|
||||
return aimaTestCaseMapper.selectList(new QueryWrapper<AimaTestCase>().in("id", ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,139 @@
|
||||
package com.cmvr.aima.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.cmvr.aima.domain.vo.AimaTestCaseVo;
|
||||
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.aima.mapper.AimaTestCaseMapper;
|
||||
import com.cmvr.aima.domain.AimaTestCase;
|
||||
import com.cmvr.aima.service.IAimaTestCaseService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 爱玛测试用例Service业务层处理
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
@Service
|
||||
@Transactional
|
||||
public class AimaTestCaseServiceImpl extends ServiceImpl<AimaTestCaseMapper, AimaTestCase> implements IAimaTestCaseService {
|
||||
@Autowired
|
||||
private AimaTestCaseMapper aimaTestCaseMapper;
|
||||
|
||||
@Autowired
|
||||
private ITeDetectionItemService teDetectionItemService;
|
||||
|
||||
/**
|
||||
* 查询爱玛测试用例
|
||||
*
|
||||
* @param id 爱玛测试用例主键
|
||||
* @return 爱玛测试用例
|
||||
*/
|
||||
@Override
|
||||
public AimaTestCase selectAimaTestCaseById(String id) {
|
||||
return aimaTestCaseMapper.selectAimaTestCaseById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询爱玛测试用例列表
|
||||
*
|
||||
* @param aimaTestCase 爱玛测试用例
|
||||
* @return 爱玛测试用例
|
||||
*/
|
||||
@Override
|
||||
public List<AimaTestCase> selectAimaTestCaseList(AimaTestCase aimaTestCase) {
|
||||
return aimaTestCaseMapper.selectAimaTestCaseList(aimaTestCase);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询爱玛测试用例视图列表(包含关联信息)
|
||||
*
|
||||
* @param aimaTestCase 爱玛测试用例
|
||||
* @return 爱玛测试用例视图集合
|
||||
*/
|
||||
@Override
|
||||
public List<AimaTestCaseVo> selectAimaTestCaseVoList(AimaTestCase aimaTestCase) {
|
||||
return aimaTestCaseMapper.selectAimaTestCaseVoList(aimaTestCase);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增爱玛测试用例
|
||||
*
|
||||
* @param aimaTestCase 爱玛测试用例
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAimaTestCase(AimaTestCase aimaTestCase) {
|
||||
// 生成UUID作为主键
|
||||
if (aimaTestCase.getId() == null || aimaTestCase.getId().isEmpty()) {
|
||||
aimaTestCase.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||
}
|
||||
aimaTestCase.setCreateTime(DateUtils.getNowDate());
|
||||
aimaTestCase.setCreateBy(SecurityUtils.getUsername());
|
||||
// 同步新增检测项配置到test模块
|
||||
TeDetectionItem teDetectionItem = TeDetectionItem.builder()
|
||||
.detectName(aimaTestCase.getCaseName())
|
||||
.groupId(7L) // 可以根据实际情况调整分组ID
|
||||
.build();
|
||||
teDetectionItemService.insertTeDetectionItem(teDetectionItem);
|
||||
aimaTestCase.setDetectItemId(teDetectionItem.getId());
|
||||
return aimaTestCaseMapper.insertAimaTestCase(aimaTestCase);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改爱玛测试用例
|
||||
*
|
||||
* @param aimaTestCase 爱玛测试用例
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAimaTestCase(AimaTestCase aimaTestCase) {
|
||||
aimaTestCase.setUpdateTime(DateUtils.getNowDate());
|
||||
aimaTestCase.setUpdateBy(SecurityUtils.getUsername());
|
||||
// 同步更新检测项名称
|
||||
if (aimaTestCase.getDetectItemId() != null) {
|
||||
TeDetectionItem teDetectionItem = teDetectionItemService.selectTeDetectionItemById(aimaTestCase.getDetectItemId());
|
||||
if (teDetectionItem != null) {
|
||||
teDetectionItem.setDetectName(aimaTestCase.getCaseName());
|
||||
teDetectionItemService.updateTeDetectionItem(teDetectionItem);
|
||||
}
|
||||
}
|
||||
return aimaTestCaseMapper.updateAimaTestCase(aimaTestCase);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除爱玛测试用例
|
||||
*
|
||||
* @param ids 需要删除的爱玛测试用例主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAimaTestCaseByIds(String[] ids) {
|
||||
// 先查询数据,删除绑定的检测项
|
||||
for (String id : ids) {
|
||||
AimaTestCase aimaTestCase = aimaTestCaseMapper.selectAimaTestCaseById(id);
|
||||
if (aimaTestCase != null && aimaTestCase.getDetectItemId() != null) {
|
||||
teDetectionItemService.deleteTeDetectionItemById(aimaTestCase.getDetectItemId());
|
||||
}
|
||||
}
|
||||
return aimaTestCaseMapper.deleteAimaTestCaseByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除爱玛测试用例信息
|
||||
*
|
||||
* @param id 爱玛测试用例主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAimaTestCaseById(String id) {
|
||||
return aimaTestCaseMapper.deleteAimaTestCaseById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.cmvr.aima.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
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.aima.mapper.AimaTestLogMapper;
|
||||
import com.cmvr.aima.domain.AimaTestLog;
|
||||
import com.cmvr.aima.service.IAimaTestLogService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 爱玛测试日志Service业务层处理
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
@Service
|
||||
@Transactional
|
||||
public class AimaTestLogServiceImpl extends ServiceImpl<AimaTestLogMapper, AimaTestLog> implements IAimaTestLogService {
|
||||
@Autowired
|
||||
private AimaTestLogMapper aimaTestLogMapper;
|
||||
|
||||
@Override
|
||||
public AimaTestLog selectAimaTestLogById(String id) {
|
||||
return aimaTestLogMapper.selectAimaTestLogById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AimaTestLog> selectAimaTestLogList(AimaTestLog aimaTestLog) {
|
||||
return aimaTestLogMapper.selectAimaTestLogList(aimaTestLog);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertAimaTestLog(AimaTestLog aimaTestLog) {
|
||||
if (aimaTestLog.getId() == null || aimaTestLog.getId().isEmpty()) {
|
||||
aimaTestLog.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||
}
|
||||
aimaTestLog.setCreateTime(DateUtils.getNowDate());
|
||||
aimaTestLog.setCreateBy(SecurityUtils.getUsername());
|
||||
return aimaTestLogMapper.insertAimaTestLog(aimaTestLog);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateAimaTestLog(AimaTestLog aimaTestLog) {
|
||||
aimaTestLog.setUpdateTime(DateUtils.getNowDate());
|
||||
aimaTestLog.setUpdateBy(SecurityUtils.getUsername());
|
||||
return aimaTestLogMapper.updateAimaTestLog(aimaTestLog);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteAimaTestLogByIds(String[] ids) {
|
||||
return aimaTestLogMapper.deleteAimaTestLogByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteAimaTestLogById(String id) {
|
||||
return aimaTestLogMapper.deleteAimaTestLogById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.cmvr.aima.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
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.aima.mapper.AimaVehicleMapper;
|
||||
import com.cmvr.aima.domain.AimaVehicle;
|
||||
import com.cmvr.aima.service.IAimaVehicleService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 爱玛车辆管理Service业务层处理
|
||||
*
|
||||
* @author cmvr-iot
|
||||
* @since 2026-06-22
|
||||
*/
|
||||
@Service
|
||||
@Transactional
|
||||
public class AimaVehicleServiceImpl extends ServiceImpl<AimaVehicleMapper, AimaVehicle> implements IAimaVehicleService {
|
||||
@Autowired
|
||||
private AimaVehicleMapper aimaVehicleMapper;
|
||||
|
||||
@Override
|
||||
public AimaVehicle selectAimaVehicleById(String id) {
|
||||
return aimaVehicleMapper.selectAimaVehicleById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AimaVehicle> selectAimaVehicleList(AimaVehicle aimaVehicle) {
|
||||
return aimaVehicleMapper.selectAimaVehicleList(aimaVehicle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertAimaVehicle(AimaVehicle aimaVehicle) {
|
||||
if (aimaVehicle.getId() == null || aimaVehicle.getId().isEmpty()) {
|
||||
aimaVehicle.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||
}
|
||||
aimaVehicle.setCreateTime(DateUtils.getNowDate());
|
||||
aimaVehicle.setCreateBy(SecurityUtils.getUsername());
|
||||
return aimaVehicleMapper.insertAimaVehicle(aimaVehicle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateAimaVehicle(AimaVehicle aimaVehicle) {
|
||||
aimaVehicle.setUpdateTime(DateUtils.getNowDate());
|
||||
aimaVehicle.setUpdateBy(SecurityUtils.getUsername());
|
||||
return aimaVehicleMapper.updateAimaVehicle(aimaVehicle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteAimaVehicleByIds(String[] ids) {
|
||||
return aimaVehicleMapper.deleteAimaVehicleByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteAimaVehicleById(String id) {
|
||||
return aimaVehicleMapper.deleteAimaVehicleById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,84 @@
|
||||
<?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.aima.mapper.AimaAlarmMapper">
|
||||
<resultMap type="AimaAlarm" id="AimaAlarmResult">
|
||||
<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="phoneId" column="phone_id"/><result property="phoneName" column="phone_name"/>
|
||||
<result property="vehicleId" column="vehicle_id"/><result property="vin" column="vin"/><result property="testCaseId" column="test_case_id"/>
|
||||
<result property="caseName" column="case_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>
|
||||
|
||||
<sql id="selectAimaAlarmVo">
|
||||
select id, create_by, create_time, update_by, update_time, remark, alarm_code, task_instance_id, task_id, task_name, phone_id, phone_name, vehicle_id, vin, test_case_id, case_name, alarm_level, alarm_type, alarm_title, alarm_content, alarm_location, alarm_time, handle_status, handler, handle_time, handle_remark, evidence_image from aima_alarm
|
||||
</sql>
|
||||
|
||||
<select id="selectAimaAlarmList" parameterType="AimaAlarm" resultMap="AimaAlarmResult">
|
||||
<include refid="selectAimaAlarmVo"/>
|
||||
<where>
|
||||
<if test="alarmCode != null and alarmCode != ''"> and alarm_code = #{alarmCode}</if>
|
||||
<if test="taskInstanceId != null and taskInstanceId != ''"> and task_instance_id = #{taskInstanceId}</if>
|
||||
<if test="taskId != null and taskId != ''"> and task_id = #{taskId}</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>
|
||||
order by alarm_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectAimaAlarmById" parameterType="String" resultMap="AimaAlarmResult">
|
||||
<include refid="selectAimaAlarmVo"/> where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAimaAlarm" parameterType="AimaAlarm">
|
||||
insert into aima_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="phoneId != null">phone_id,</if><if test="phoneName != null">phone_name,</if>
|
||||
<if test="vehicleId != null">vehicle_id,</if><if test="vin != null">vin,</if><if test="testCaseId != null">test_case_id,</if>
|
||||
<if test="caseName != null">case_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="phoneId != null">#{phoneId},</if><if test="phoneName != null">#{phoneName},</if>
|
||||
<if test="vehicleId != null">#{vehicleId},</if><if test="vin != null">#{vin},</if><if test="testCaseId != null">#{testCaseId},</if>
|
||||
<if test="caseName != null">#{caseName},</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="updateAimaAlarm" parameterType="AimaAlarm">
|
||||
update aima_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="phoneId != null">phone_id = #{phoneId},</if>
|
||||
<if test="phoneName != null">phone_name = #{phoneName},</if><if test="vehicleId != null">vehicle_id = #{vehicleId},</if>
|
||||
<if test="vin != null">vin = #{vin},</if><if test="testCaseId != null">test_case_id = #{testCaseId},</if>
|
||||
<if test="caseName != null">case_name = #{caseName},</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="deleteAimaAlarmById" parameterType="String">delete from aima_alarm where id = #{id}</delete>
|
||||
<delete id="deleteAimaAlarmByIds" parameterType="String">
|
||||
delete from aima_alarm where id in <foreach item="id" collection="array" open="(" separator="," close=")">#{id}</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
106
cmvr-iot-aima/src/main/resources/mapper/aima/AimaPhoneMapper.xml
Normal file
106
cmvr-iot-aima/src/main/resources/mapper/aima/AimaPhoneMapper.xml
Normal file
@ -0,0 +1,106 @@
|
||||
<?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.aima.mapper.AimaPhoneMapper">
|
||||
|
||||
<resultMap type="AimaPhone" id="AimaPhoneResult">
|
||||
<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="phoneName" column="phone_name" />
|
||||
<result property="phoneModel" column="phone_model" />
|
||||
<result property="osSystem" column="os_system" />
|
||||
<result property="osVersion" column="os_version" />
|
||||
<result property="specifications" column="specifications" />
|
||||
<result property="manufacturer" column="manufacturer" />
|
||||
<result property="status" column="status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAimaPhoneVo">
|
||||
select id, create_by, create_time, update_by, update_time, remark, phone_name, phone_model, os_system, os_version, specifications, manufacturer, status from aima_phone
|
||||
</sql>
|
||||
|
||||
<select id="selectAimaPhoneList" parameterType="AimaPhone" resultMap="AimaPhoneResult">
|
||||
<include refid="selectAimaPhoneVo"/>
|
||||
<where>
|
||||
<if test="phoneName != null and phoneName != ''"> and phone_name like concat('%', #{phoneName}, '%')</if>
|
||||
<if test="phoneModel != null and phoneModel != ''"> and phone_model like concat('%', #{phoneModel}, '%')</if>
|
||||
<if test="osSystem != null and osSystem != ''"> and os_system = #{osSystem}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectAimaPhoneById" parameterType="String" resultMap="AimaPhoneResult">
|
||||
<include refid="selectAimaPhoneVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAimaPhone" parameterType="AimaPhone">
|
||||
insert into aima_phone
|
||||
<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="phoneName != null">phone_name,</if>
|
||||
<if test="phoneModel != null">phone_model,</if>
|
||||
<if test="osSystem != null">os_system,</if>
|
||||
<if test="osVersion != null">os_version,</if>
|
||||
<if test="specifications != null">specifications,</if>
|
||||
<if test="manufacturer != null">manufacturer,</if>
|
||||
<if test="status != null">status,</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="phoneName != null">#{phoneName},</if>
|
||||
<if test="phoneModel != null">#{phoneModel},</if>
|
||||
<if test="osSystem != null">#{osSystem},</if>
|
||||
<if test="osVersion != null">#{osVersion},</if>
|
||||
<if test="specifications != null">#{specifications},</if>
|
||||
<if test="manufacturer != null">#{manufacturer},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAimaPhone" parameterType="AimaPhone">
|
||||
update aima_phone
|
||||
<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="phoneName != null">phone_name = #{phoneName},</if>
|
||||
<if test="phoneModel != null">phone_model = #{phoneModel},</if>
|
||||
<if test="osSystem != null">os_system = #{osSystem},</if>
|
||||
<if test="osVersion != null">os_version = #{osVersion},</if>
|
||||
<if test="specifications != null">specifications = #{specifications},</if>
|
||||
<if test="manufacturer != null">manufacturer = #{manufacturer},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAimaPhoneById" parameterType="String">
|
||||
delete from aima_phone where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAimaPhoneByIds" parameterType="String">
|
||||
delete from aima_phone where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</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.aima.mapper.AimaTaskInstanceMapper">
|
||||
<resultMap type="AimaTaskInstance" id="AimaTaskInstanceResult">
|
||||
<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="phoneId" column="phone_id"/>
|
||||
<result property="vehicleId" column="vehicle_id"/>
|
||||
<result property="executionNumber" column="execution_number"/><result property="status" column="status"/><result property="taskInsId" column="task_ins_id"/>
|
||||
<result property="totalCases" column="total_cases"/>
|
||||
<result property="completedCases" column="completed_cases"/><result property="passedCases" column="passed_cases"/><result property="failedCases" column="failed_cases"/>
|
||||
<result property="progress" column="progress"/>
|
||||
<result property="startTime" column="start_time"/><result property="endTime" column="end_time"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="com.cmvr.aima.domain.vo.AimaTaskInstanceVo" id="AimaTaskInstanceVoResult">
|
||||
<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="taskCode" column="task_code"/><result property="taskName" column="task_name"/>
|
||||
<result property="phoneId" column="phone_id"/><result property="phoneName" column="phone_name"/>
|
||||
<result property="vehicleId" column="vehicle_id"/><result property="vehicleName" column="vehicle_name"/><result property="vin" column="vin"/>
|
||||
<result property="executionNumber" column="execution_number"/><result property="status" column="status"/><result property="taskInsId" column="task_ins_id"/>
|
||||
<result property="totalCases" column="total_cases"/>
|
||||
<result property="completedCases" column="completed_cases"/><result property="passedCases" column="passed_cases"/><result property="failedCases" column="failed_cases"/>
|
||||
<result property="progress" column="progress"/>
|
||||
<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="selectAimaTaskInstanceVo">
|
||||
select id, create_by, create_time, update_by, update_time, remark, task_id, phone_id, vehicle_id, execution_number, status, task_ins_id, total_cases, completed_cases, passed_cases, failed_cases, progress, start_time, end_time from aima_task_instance
|
||||
</sql>
|
||||
|
||||
<select id="selectAimaTaskInstanceList" parameterType="AimaTaskInstance" resultMap="AimaTaskInstanceResult">
|
||||
<include refid="selectAimaTaskInstanceVo"/>
|
||||
<where>
|
||||
<if test="taskId != null and taskId != ''"> and task_id = #{taskId}</if>
|
||||
<if test="phoneId != null and phoneId != ''"> and phone_id = #{phoneId}</if>
|
||||
<if test="vehicleId != null and vehicleId != ''"> and vehicle_id = #{vehicleId}</if>
|
||||
<if test="status != null"> and status = #{status}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectAimaTaskInstanceById" parameterType="String" resultMap="AimaTaskInstanceResult">
|
||||
<include refid="selectAimaTaskInstanceVo"/> where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectAimaTaskInstanceVoList" parameterType="AimaTaskInstance" resultMap="AimaTaskInstanceVoResult">
|
||||
select ti.id, ti.create_by, ti.create_time, ti.update_by, ti.update_time, ti.remark,
|
||||
ti.task_id, t.task_code, t.task_name,
|
||||
ti.phone_id, p.phone_name, ti.vehicle_id, v.vehicle_name, v.vin,
|
||||
ti.execution_number, ti.status, ti.task_ins_id,
|
||||
ti.total_cases, ti.completed_cases, ti.passed_cases, ti.failed_cases, ti.progress,
|
||||
ti.start_time, ti.end_time,
|
||||
u1.nick_name as create_by_name, u2.nick_name as update_by_name
|
||||
from aima_task_instance ti
|
||||
left join aima_task t on ti.task_id = t.id
|
||||
left join aima_phone p on ti.phone_id = p.id
|
||||
left join aima_vehicle v on ti.vehicle_id = v.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="phoneId != null and phoneId != ''"> and ti.phone_id = #{phoneId}</if>
|
||||
<if test="vehicleId != null and vehicleId != ''"> and ti.vehicle_id = #{vehicleId}</if>
|
||||
<if test="status != null"> and ti.status = #{status}</if>
|
||||
</where>
|
||||
order by ti.create_time desc
|
||||
</select>
|
||||
|
||||
<insert id="insertAimaTaskInstance" parameterType="AimaTaskInstance">
|
||||
insert into aima_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="phoneId != null">phone_id,</if>
|
||||
<if test="vehicleId != null">vehicle_id,</if>
|
||||
<if test="executionNumber != null">execution_number,</if><if test="status != null">status,</if><if test="totalCases != null">total_cases,</if>
|
||||
<if test="completedCases != null">completed_cases,</if><if test="passedCases != null">passed_cases,</if><if test="failedCases != null">failed_cases,</if>
|
||||
<if test="progress != null">progress,</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="phoneId != null">#{phoneId},</if>
|
||||
<if test="vehicleId != null">#{vehicleId},</if>
|
||||
<if test="executionNumber != null">#{executionNumber},</if><if test="status != null">#{status},</if><if test="totalCases != null">#{totalCases},</if>
|
||||
<if test="completedCases != null">#{completedCases},</if><if test="passedCases != null">#{passedCases},</if><if test="failedCases != null">#{failedCases},</if>
|
||||
<if test="progress != null">#{progress},</if>
|
||||
<if test="startTime != null">#{startTime},</if><if test="endTime != null">#{endTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAimaTaskInstance" parameterType="AimaTaskInstance">
|
||||
update aima_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="phoneId != null">phone_id = #{phoneId},</if>
|
||||
<if test="vehicleId != null">vehicle_id = #{vehicleId},</if>
|
||||
<if test="executionNumber != null">execution_number = #{executionNumber},</if>
|
||||
<if test="status != null">status = #{status},</if><if test="totalCases != null">total_cases = #{totalCases},</if>
|
||||
<if test="completedCases != null">completed_cases = #{completedCases},</if><if test="passedCases != null">passed_cases = #{passedCases},</if>
|
||||
<if test="failedCases != null">failed_cases = #{failedCases},</if><if test="progress != null">progress = #{progress},</if>
|
||||
<if test="startTime != null">start_time = #{startTime},</if><if test="endTime != null">end_time = #{endTime},</if>
|
||||
<if test="taskInsId != null">task_ins_id = #{taskInsId},</if>
|
||||
|
||||
</trim> where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAimaTaskInstanceById" parameterType="String">delete from aima_task_instance where id = #{id}</delete>
|
||||
<delete id="deleteAimaTaskInstanceByIds" parameterType="String">
|
||||
delete from aima_task_instance where id in <foreach item="id" collection="array" open="(" separator="," close=")">#{id}</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
114
cmvr-iot-aima/src/main/resources/mapper/aima/AimaTaskMapper.xml
Normal file
114
cmvr-iot-aima/src/main/resources/mapper/aima/AimaTaskMapper.xml
Normal file
@ -0,0 +1,114 @@
|
||||
<?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.aima.mapper.AimaTaskMapper">
|
||||
<resultMap type="AimaTask" id="AimaTaskResult">
|
||||
<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="phoneId" column="phone_id"/>
|
||||
<result property="vehicleId" column="vehicle_id"/>
|
||||
<result property="testCaseCount" column="test_case_count"/>
|
||||
<result property="taskConfigId" column="task_config_id"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="com.cmvr.aima.domain.vo.AimaTaskVo" id="AimaTaskVoResult">
|
||||
<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="phoneId" column="phone_id"/>
|
||||
<result property="vehicleId" column="vehicle_id"/>
|
||||
<result property="testCaseCount" column="test_case_count"/>
|
||||
<result property="taskConfigId" column="task_config_id"/>
|
||||
<result property="phoneName" column="phone_name"/>
|
||||
<result property="vin" column="vin"/>
|
||||
<result property="createByName" column="create_by_name"/>
|
||||
<result property="updateByName" column="update_by_name"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAimaTaskVo">
|
||||
select id, create_by, create_time, update_by, update_time, remark, task_code, task_name, task_type, phone_id, vehicle_id, test_case_count, task_config_id from aima_task
|
||||
</sql>
|
||||
|
||||
<select id="selectAimaTaskList" parameterType="AimaTask" resultMap="AimaTaskResult">
|
||||
<include refid="selectAimaTaskVo"/>
|
||||
<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>
|
||||
<if test="phoneId != null and phoneId != ''"> and phone_id = #{phoneId}</if>
|
||||
<if test="vehicleId != null and vehicleId != ''"> and vehicle_id = #{vehicleId}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectAimaTaskById" parameterType="String" resultMap="AimaTaskResult">
|
||||
<include refid="selectAimaTaskVo"/> where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectAimaTaskVoList" parameterType="AimaTask" resultMap="AimaTaskVoResult">
|
||||
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, t.phone_id, t.vehicle_id,
|
||||
t.test_case_count, t.task_config_id,
|
||||
p.phone_name, v.vin,
|
||||
u1.nick_name as create_by_name, u2.nick_name as update_by_name
|
||||
from aima_task t
|
||||
left join aima_phone p on t.phone_id = p.id
|
||||
left join aima_vehicle v on t.vehicle_id = v.id
|
||||
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>
|
||||
<if test="phoneId != null and phoneId != ''"> and t.phone_id = #{phoneId}</if>
|
||||
<if test="vehicleId != null and vehicleId != ''"> and t.vehicle_id = #{vehicleId}</if>
|
||||
</where>
|
||||
order by t.create_time desc
|
||||
</select>
|
||||
|
||||
<insert id="insertAimaTask" parameterType="AimaTask">
|
||||
insert into aima_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>
|
||||
<if test="phoneId != null">phone_id,</if><if test="vehicleId != null">vehicle_id,</if>
|
||||
<if test="testCaseCount != null">test_case_count,</if><if test="taskConfigId != null">task_config_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="taskCode != null">#{taskCode},</if><if test="taskName != null">#{taskName},</if><if test="taskType != null">#{taskType},</if>
|
||||
<if test="phoneId != null">#{phoneId},</if><if test="vehicleId != null">#{vehicleId},</if>
|
||||
<if test="testCaseCount != null">#{testCaseCount},</if><if test="taskConfigId != null">#{taskConfigId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAimaTask" parameterType="AimaTask">
|
||||
update aima_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>
|
||||
<if test="phoneId != null">phone_id = #{phoneId},</if>
|
||||
<if test="vehicleId != null">vehicle_id = #{vehicleId},</if>
|
||||
<if test="testCaseCount != null">test_case_count = #{testCaseCount},</if><if test="taskConfigId != null">task_config_id = #{taskConfigId},</if>
|
||||
</trim> where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAimaTaskById" parameterType="String">delete from aima_task where id = #{id}</delete>
|
||||
<delete id="deleteAimaTaskByIds" parameterType="String">
|
||||
delete from aima_task where id in <foreach item="id" collection="array" open="(" separator="," close=")">#{id}</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -0,0 +1,29 @@
|
||||
<?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.aima.mapper.AimaTaskTestCaseMapper">
|
||||
|
||||
<insert id="batchInsertTaskTestCase">
|
||||
INSERT INTO aima_task_test_case (task_id, test_case_id, sort_order) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.taskId}, #{item.testCaseId}, #{item.sortOrder})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteTaskTestCaseByTaskId" parameterType="String">
|
||||
DELETE FROM aima_task_test_case WHERE task_id = #{taskId}
|
||||
</delete>
|
||||
|
||||
<select id="selectTestCaseIdsByTaskId" parameterType="String" resultType="String">
|
||||
SELECT test_case_id FROM aima_task_test_case
|
||||
WHERE task_id = #{taskId}
|
||||
ORDER BY sort_order
|
||||
</select>
|
||||
|
||||
<delete id="deleteTaskTestCaseByTaskIds" parameterType="String">
|
||||
DELETE FROM aima_task_test_case WHERE task_id IN
|
||||
<foreach item="taskId" collection="array" open="(" separator="," close=")">
|
||||
#{taskId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,167 @@
|
||||
<?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.aima.mapper.AimaTestCaseMapper">
|
||||
<resultMap type="AimaTestCase" id="AimaTestCaseResult">
|
||||
<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="caseCode" column="case_code"/>
|
||||
<result property="caseName" column="case_name"/>
|
||||
<result property="caseCategory" column="case_category"/>
|
||||
<result property="testDescription" column="test_description"/>
|
||||
<result property="precondition" column="precondition"/>
|
||||
<result property="testSteps" column="test_steps"/>
|
||||
<result property="expectedResult" column="expected_result"/>
|
||||
<result property="priority" column="priority"/>
|
||||
<result property="enabled" column="enabled"/>
|
||||
<result property="sortOrder" column="sort_order"/>
|
||||
<result property="estimatedDuration" column="estimated_duration"/>
|
||||
<result property="detectItemId" column="detect_item_id"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="com.cmvr.aima.domain.vo.AimaTestCaseVo" id="AimaTestCaseVoResult">
|
||||
<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="caseCode" column="case_code"/>
|
||||
<result property="caseName" column="case_name"/>
|
||||
<result property="caseCategory" column="case_category"/>
|
||||
<result property="testDescription" column="test_description"/>
|
||||
<result property="precondition" column="precondition"/>
|
||||
<result property="testSteps" column="test_steps"/>
|
||||
<result property="expectedResult" column="expected_result"/>
|
||||
<result property="priority" column="priority"/>
|
||||
<result property="enabled" column="enabled"/>
|
||||
<result property="sortOrder" column="sort_order"/>
|
||||
<result property="estimatedDuration" column="estimated_duration"/>
|
||||
<result property="detectItemId" column="detect_item_id"/>
|
||||
<result property="configStatus" column="config_status"/>
|
||||
<result property="createByName" column="create_by_name"/>
|
||||
<result property="updateByName" column="update_by_name"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAimaTestCaseVo">
|
||||
select id, create_by, create_time, update_by, update_time, remark, case_code, case_name, case_category, test_description, precondition, test_steps, expected_result, priority, enabled, sort_order, estimated_duration, detect_item_id from aima_test_case
|
||||
</sql>
|
||||
|
||||
<select id="selectAimaTestCaseList" parameterType="AimaTestCase" resultMap="AimaTestCaseResult">
|
||||
<include refid="selectAimaTestCaseVo"/>
|
||||
<where>
|
||||
<if test="caseCode != null and caseCode != ''"> and case_code = #{caseCode}</if>
|
||||
<if test="caseName != null and caseName != ''"> and case_name like concat('%', #{caseName}, '%')</if>
|
||||
<if test="caseCategory != null and caseCategory != ''"> and case_category = #{caseCategory}</if>
|
||||
<if test="enabled != null and enabled != ''"> and enabled = #{enabled}</if>
|
||||
</where>
|
||||
order by sort_order asc, create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectAimaTestCaseById" parameterType="String" resultMap="AimaTestCaseResult">
|
||||
<include refid="selectAimaTestCaseVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectAimaTestCaseVoList" parameterType="AimaTestCase" resultMap="AimaTestCaseVoResult">
|
||||
select tc.id, tc.create_by, tc.create_time, tc.update_by, tc.update_time, tc.remark,
|
||||
tc.case_code, tc.case_name, tc.case_category, tc.test_description, tc.precondition,
|
||||
tc.test_steps, tc.expected_result, tc.priority, tc.enabled, tc.sort_order,
|
||||
tc.estimated_duration, tc.detect_item_id,
|
||||
d.is_deploy as config_status,
|
||||
u1.nick_name as create_by_name, u2.nick_name as update_by_name
|
||||
from aima_test_case tc
|
||||
left join te_detection_item d on tc.detect_item_id = d.id
|
||||
left join sys_user u1 on tc.create_by = u1.user_name
|
||||
left join sys_user u2 on tc.update_by = u2.user_name
|
||||
<where>
|
||||
<if test="caseCode != null and caseCode != ''"> and tc.case_code = #{caseCode}</if>
|
||||
<if test="caseName != null and caseName != ''"> and tc.case_name like concat('%', #{caseName}, '%')</if>
|
||||
<if test="caseCategory != null and caseCategory != ''"> and tc.case_category = #{caseCategory}</if>
|
||||
<if test="enabled != null and enabled != ''"> and tc.enabled = #{enabled}</if>
|
||||
</where>
|
||||
order by tc.sort_order, tc.create_time desc
|
||||
</select>
|
||||
|
||||
<insert id="insertAimaTestCase" parameterType="AimaTestCase">
|
||||
insert into aima_test_case
|
||||
<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="caseCode != null">case_code,</if>
|
||||
<if test="caseName != null">case_name,</if>
|
||||
<if test="caseCategory != null">case_category,</if>
|
||||
<if test="testDescription != null">test_description,</if>
|
||||
<if test="precondition != null">precondition,</if>
|
||||
<if test="testSteps != null">test_steps,</if>
|
||||
<if test="expectedResult != null">expected_result,</if>
|
||||
<if test="priority != null">priority,</if>
|
||||
<if test="enabled != null">enabled,</if>
|
||||
<if test="sortOrder != null">sort_order,</if>
|
||||
<if test="estimatedDuration != null">estimated_duration,</if>
|
||||
<if test="detectItemId != null">detect_item_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="caseCode != null">#{caseCode},</if>
|
||||
<if test="caseName != null">#{caseName},</if>
|
||||
<if test="caseCategory != null">#{caseCategory},</if>
|
||||
<if test="testDescription != null">#{testDescription},</if>
|
||||
<if test="precondition != null">#{precondition},</if>
|
||||
<if test="testSteps != null">#{testSteps},</if>
|
||||
<if test="expectedResult != null">#{expectedResult},</if>
|
||||
<if test="priority != null">#{priority},</if>
|
||||
<if test="enabled != null">#{enabled},</if>
|
||||
<if test="sortOrder != null">#{sortOrder},</if>
|
||||
<if test="estimatedDuration != null">#{estimatedDuration},</if>
|
||||
<if test="detectItemId != null">#{detectItemId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAimaTestCase" parameterType="AimaTestCase">
|
||||
update aima_test_case
|
||||
<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="caseCode != null">case_code = #{caseCode},</if>
|
||||
<if test="caseName != null">case_name = #{caseName},</if>
|
||||
<if test="caseCategory != null">case_category = #{caseCategory},</if>
|
||||
<if test="testDescription != null">test_description = #{testDescription},</if>
|
||||
<if test="precondition != null">precondition = #{precondition},</if>
|
||||
<if test="testSteps != null">test_steps = #{testSteps},</if>
|
||||
<if test="expectedResult != null">expected_result = #{expectedResult},</if>
|
||||
<if test="priority != null">priority = #{priority},</if>
|
||||
<if test="enabled != null">enabled = #{enabled},</if>
|
||||
<if test="sortOrder != null">sort_order = #{sortOrder},</if>
|
||||
<if test="estimatedDuration != null">estimated_duration = #{estimatedDuration},</if>
|
||||
<if test="detectItemId != null">detect_item_id = #{detectItemId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAimaTestCaseById" parameterType="String">
|
||||
delete from aima_test_case where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAimaTestCaseByIds" parameterType="String">
|
||||
delete from aima_test_case where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -0,0 +1,86 @@
|
||||
<?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.aima.mapper.AimaTestLogMapper">
|
||||
<resultMap type="AimaTestLog" id="AimaTestLogResult">
|
||||
<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="taskInstanceId" column="task_instance_id"/><result property="taskId" column="task_id"/><result property="taskName" column="task_name"/>
|
||||
<result property="testCaseId" column="test_case_id"/><result property="caseName" column="case_name"/><result property="logLevel" column="log_level"/>
|
||||
<result property="logType" column="log_type"/><result property="logMessage" column="log_message"/><result property="logTime" column="log_time"/>
|
||||
<result property="executionStep" column="execution_step"/><result property="actualResult" column="actual_result"/><result property="testStatus" column="test_status"/>
|
||||
<result property="screenshotUrl" column="screenshot_url"/><result property="videoUrl" column="video_url"/><result property="errorStack" column="error_stack"/>
|
||||
<result property="durationMs" column="duration_ms"/>
|
||||
<result property="progress" column="progress"/>
|
||||
<result property="status" column="status"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAimaTestLogVo">
|
||||
select id, create_by, create_time, update_by, update_time, remark, task_instance_id, task_id, task_name, test_case_id, case_name, log_level, log_type, log_message, log_time, execution_step, actual_result, test_status, screenshot_url, video_url, error_stack, duration_ms,progress,status from aima_test_log
|
||||
</sql>
|
||||
|
||||
<select id="selectAimaTestLogList" parameterType="AimaTestLog" resultMap="AimaTestLogResult">
|
||||
<include refid="selectAimaTestLogVo"/>
|
||||
<where>
|
||||
<if test="taskInstanceId != null and taskInstanceId != ''"> and task_instance_id = #{taskInstanceId}</if>
|
||||
<if test="taskId != null and taskId != ''"> and task_id = #{taskId}</if>
|
||||
<if test="testCaseId != null and testCaseId != ''"> and test_case_id = #{testCaseId}</if>
|
||||
<if test="logLevel != null and logLevel != ''"> and log_level = #{logLevel}</if>
|
||||
<if test="testStatus != null and testStatus != ''"> and test_status = #{testStatus}</if>
|
||||
</where>
|
||||
order by log_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectAimaTestLogById" parameterType="String" resultMap="AimaTestLogResult">
|
||||
<include refid="selectAimaTestLogVo"/> where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAimaTestLog" parameterType="AimaTestLog">
|
||||
insert into aima_test_log <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="taskInstanceId != null">task_instance_id,</if><if test="taskId != null">task_id,</if><if test="taskName != null">task_name,</if>
|
||||
<if test="testCaseId != null">test_case_id,</if><if test="caseName != null">case_name,</if><if test="logLevel != null">log_level,</if>
|
||||
<if test="logType != null">log_type,</if><if test="logMessage != null">log_message,</if><if test="logTime != null">log_time,</if>
|
||||
<if test="executionStep != null">execution_step,</if><if test="actualResult != null">actual_result,</if><if test="testStatus != null">test_status,</if>
|
||||
<if test="screenshotUrl != null">screenshot_url,</if><if test="videoUrl != null">video_url,</if><if test="errorStack != null">error_stack,</if>
|
||||
<if test="durationMs != null">duration_ms,</if>
|
||||
<if test="progress != null">progress,</if>
|
||||
<if test="status != null">status,</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="taskInstanceId != null">#{taskInstanceId},</if><if test="taskId != null">#{taskId},</if><if test="taskName != null">#{taskName},</if>
|
||||
<if test="testCaseId != null">#{testCaseId},</if><if test="caseName != null">#{caseName},</if><if test="logLevel != null">#{logLevel},</if>
|
||||
<if test="logType != null">#{logType},</if><if test="logMessage != null">#{logMessage},</if><if test="logTime != null">#{logTime},</if>
|
||||
<if test="executionStep != null">#{executionStep},</if><if test="actualResult != null">#{actualResult},</if><if test="testStatus != null">#{testStatus},</if>
|
||||
<if test="screenshotUrl != null">#{screenshotUrl},</if><if test="videoUrl != null">#{videoUrl},</if><if test="errorStack != null">#{errorStack},</if>
|
||||
<if test="durationMs != null">#{durationMs},</if>
|
||||
<if test="progress != null">#{progress},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAimaTestLog" parameterType="AimaTestLog">
|
||||
update aima_test_log <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="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="testCaseId != null">test_case_id = #{testCaseId},</if><if test="caseName != null">case_name = #{caseName},</if>
|
||||
<if test="logLevel != null">log_level = #{logLevel},</if><if test="logType != null">log_type = #{logType},</if>
|
||||
<if test="logMessage != null">log_message = #{logMessage},</if><if test="logTime != null">log_time = #{logTime},</if>
|
||||
<if test="executionStep != null">execution_step = #{executionStep},</if><if test="actualResult != null">actual_result = #{actualResult},</if>
|
||||
<if test="testStatus != null">test_status = #{testStatus},</if><if test="screenshotUrl != null">screenshot_url = #{screenshotUrl},</if>
|
||||
<if test="videoUrl != null">video_url = #{videoUrl},</if><if test="errorStack != null">error_stack = #{errorStack},</if>
|
||||
<if test="durationMs != null">duration_ms = #{durationMs},</if>
|
||||
<if test="progress != null">progress = #{progress},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
</trim> where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAimaTestLogById" parameterType="String">delete from aima_test_log where id = #{id}</delete>
|
||||
<delete id="deleteAimaTestLogByIds" parameterType="String">
|
||||
delete from aima_test_log where id in <foreach item="id" collection="array" open="(" separator="," close=")">#{id}</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -0,0 +1,102 @@
|
||||
<?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.aima.mapper.AimaVehicleMapper">
|
||||
|
||||
<resultMap type="AimaVehicle" id="AimaVehicleResult">
|
||||
<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="vin" column="vin" />
|
||||
<result property="vehicleModel" column="vehicle_model" />
|
||||
<result property="vehicleName" column="vehicle_name" />
|
||||
<result property="color" column="color" />
|
||||
<result property="productionDate" column="production_date" />
|
||||
<result property="status" column="status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAimaVehicleVo">
|
||||
select id, create_by, create_time, update_by, update_time, remark, vin, vehicle_model, vehicle_name, color, production_date, status from aima_vehicle
|
||||
</sql>
|
||||
|
||||
<select id="selectAimaVehicleList" parameterType="AimaVehicle" resultMap="AimaVehicleResult">
|
||||
<include refid="selectAimaVehicleVo"/>
|
||||
<where>
|
||||
<if test="vin != null and vin != ''"> and vin = #{vin}</if>
|
||||
<if test="vehicleModel != null and vehicleModel != ''"> and vehicle_model like concat('%', #{vehicleModel}, '%')</if>
|
||||
<if test="vehicleName != null and vehicleName != ''"> and vehicle_name like concat('%', #{vehicleName}, '%')</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectAimaVehicleById" parameterType="String" resultMap="AimaVehicleResult">
|
||||
<include refid="selectAimaVehicleVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAimaVehicle" parameterType="AimaVehicle">
|
||||
insert into aima_vehicle
|
||||
<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="vin != null">vin,</if>
|
||||
<if test="vehicleModel != null">vehicle_model,</if>
|
||||
<if test="vehicleName != null">vehicle_name,</if>
|
||||
<if test="color != null">color,</if>
|
||||
<if test="productionDate != null">production_date,</if>
|
||||
<if test="status != null">status,</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="vin != null">#{vin},</if>
|
||||
<if test="vehicleModel != null">#{vehicleModel},</if>
|
||||
<if test="vehicleName != null">#{vehicleName},</if>
|
||||
<if test="color != null">#{color},</if>
|
||||
<if test="productionDate != null">#{productionDate},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAimaVehicle" parameterType="AimaVehicle">
|
||||
update aima_vehicle
|
||||
<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="vin != null">vin = #{vin},</if>
|
||||
<if test="vehicleModel != null">vehicle_model = #{vehicleModel},</if>
|
||||
<if test="vehicleName != null">vehicle_name = #{vehicleName},</if>
|
||||
<if test="color != null">color = #{color},</if>
|
||||
<if test="productionDate != null">production_date = #{productionDate},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAimaVehicleById" parameterType="String">
|
||||
delete from aima_vehicle where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAimaVehicleByIds" parameterType="String">
|
||||
delete from aima_vehicle where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -12,7 +12,7 @@ import com.cmvr.test.model.vo.TeTaskConfigInfoVO;
|
||||
import com.cmvr.test.service.ITeTaskConfigInfoService;
|
||||
import com.cmvr.test.service.ITeTaskOrchestrationService;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
@ -24,10 +24,13 @@ import java.util.List;
|
||||
* @author cmvr-iot
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TeTaskConfigInfoServiceImpl extends ServiceImpl<TeTaskConfigInfoMapper, TeTaskConfigInfo> implements ITeTaskConfigInfoService {
|
||||
|
||||
private final ITeTaskOrchestrationService taskOrchestrationService;
|
||||
|
||||
public TeTaskConfigInfoServiceImpl(@Lazy ITeTaskOrchestrationService taskOrchestrationService) {
|
||||
this.taskOrchestrationService = taskOrchestrationService;
|
||||
}
|
||||
/**
|
||||
* 查询任务流程编排
|
||||
*
|
||||
|
||||
8
pom.xml
8
pom.xml
@ -309,6 +309,13 @@
|
||||
<version>${cmvr-iot.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 爱玛电动车测试-->
|
||||
<dependency>
|
||||
<groupId>com.cmvr</groupId>
|
||||
<artifactId>cmvr-iot-aima</artifactId>
|
||||
<version>${cmvr-iot.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- huTool-->
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
@ -346,6 +353,7 @@
|
||||
<module>cmvr-iot-ti</module>
|
||||
<module>cmvr-iot-evaluation</module>
|
||||
<module>cmvr-iot-inspection</module>
|
||||
<module>cmvr-iot-aima</module>
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
|
||||
210
sql/aima_module.sql
Normal file
210
sql/aima_module.sql
Normal file
@ -0,0 +1,210 @@
|
||||
-- ----------------------------
|
||||
-- 爱玛电动车测试模块数据库表设计
|
||||
-- ----------------------------
|
||||
|
||||
-- ----------------------------
|
||||
-- 1、手机管理表
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `aima_phone`;
|
||||
CREATE TABLE `aima_phone` (
|
||||
`id` varchar(64) NOT NULL COMMENT '主键ID',
|
||||
`phone_name` varchar(100) DEFAULT NULL COMMENT '手机名称',
|
||||
`phone_model` varchar(100) DEFAULT NULL COMMENT '手机型号',
|
||||
`os_system` varchar(50) DEFAULT NULL COMMENT '操作系统(Android/iOS)',
|
||||
`os_version` varchar(50) DEFAULT NULL COMMENT '系统版本',
|
||||
`specifications` varchar(500) DEFAULT NULL COMMENT '规格参数',
|
||||
`manufacturer` varchar(100) DEFAULT NULL COMMENT '厂商',
|
||||
`status` char(1) DEFAULT '0' COMMENT '状态(0正常 1停用)',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='爱玛手机管理表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 2、车辆管理表
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `aima_vehicle`;
|
||||
CREATE TABLE `aima_vehicle` (
|
||||
`id` varchar(64) NOT NULL COMMENT '主键ID',
|
||||
`vin` varchar(50) DEFAULT NULL COMMENT '车架号(VIN)',
|
||||
`vehicle_model` varchar(100) DEFAULT NULL COMMENT '车型',
|
||||
`vehicle_name` varchar(100) DEFAULT NULL COMMENT '车辆名称',
|
||||
`color` varchar(50) DEFAULT NULL COMMENT '颜色',
|
||||
`production_date` date DEFAULT NULL COMMENT '生产日期',
|
||||
`status` char(1) DEFAULT '0' COMMENT '状态(0正常 1停用)',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_vin` (`vin`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='爱玛车辆管理表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 3、测试用例管理表(对标巡检点位)
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `aima_test_case`;
|
||||
CREATE TABLE `aima_test_case` (
|
||||
`id` varchar(64) NOT NULL COMMENT '主键ID',
|
||||
`case_code` varchar(50) DEFAULT NULL COMMENT '用例编码',
|
||||
`case_name` varchar(100) DEFAULT NULL COMMENT '用例名称',
|
||||
`case_category` varchar(50) DEFAULT NULL COMMENT '用例分类(功能测试/性能测试/安全测试等)',
|
||||
`test_description` text COMMENT '测试描述',
|
||||
`precondition` text COMMENT '前置条件',
|
||||
`test_steps` text COMMENT '测试步骤',
|
||||
`expected_result` text COMMENT '预期结果',
|
||||
`priority` char(1) DEFAULT '2' COMMENT '优先级(1高 2中 3低)',
|
||||
`enabled` char(1) DEFAULT '0' COMMENT '是否启用(0启用 1禁用)',
|
||||
`sort_order` int DEFAULT '0' COMMENT '排序号',
|
||||
`estimated_duration` int DEFAULT NULL COMMENT '预计执行时长(秒)',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`detect_item_id` varchar(64) DEFAULT NULL COMMENT '检测项ID',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_case_code` (`case_code`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='爱玛测试用例表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 4、任务管理表
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `aima_task`;
|
||||
CREATE TABLE `aima_task` (
|
||||
`id` varchar(64) NOT NULL COMMENT '主键ID',
|
||||
`task_code` varchar(50) DEFAULT NULL COMMENT '任务编码',
|
||||
`task_name` varchar(100) DEFAULT NULL COMMENT '任务名称',
|
||||
`task_type` char(1) DEFAULT '1' COMMENT '任务类型(1常规测试 2回归测试 3专项测试)',
|
||||
`phone_id` varchar(64) DEFAULT NULL COMMENT '手机ID',
|
||||
`vehicle_id` varchar(64) DEFAULT NULL COMMENT '车辆ID',
|
||||
`test_case_count` int DEFAULT '0' COMMENT '测试用例数量',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`task_config_id` varchar(64) DEFAULT NULL COMMENT '任务配置ID',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_task_code` (`task_code`),
|
||||
KEY `idx_phone_id` (`phone_id`),
|
||||
KEY `idx_vehicle_id` (`vehicle_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='爱玛任务管理表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 5、任务与测试用例关联表
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `aima_task_test_case`;
|
||||
CREATE TABLE `aima_task_test_case` (
|
||||
`task_id` varchar(64) NOT NULL COMMENT '任务ID',
|
||||
`test_case_id` varchar(64) NOT NULL COMMENT '测试用例ID',
|
||||
`sort_order` int(11) DEFAULT '0' COMMENT '排序号',
|
||||
PRIMARY KEY (`task_id`, `test_case_id`),
|
||||
KEY `idx_task_id` (`task_id`),
|
||||
KEY `idx_test_case_id` (`test_case_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='爱玛任务与测试用例关联表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 6、任务执行实例表
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `aima_task_instance`;
|
||||
CREATE TABLE `aima_task_instance` (
|
||||
`id` varchar(64) NOT NULL COMMENT '主键ID',
|
||||
`task_id` varchar(64) DEFAULT NULL COMMENT '任务ID',
|
||||
`phone_id` varchar(64) DEFAULT NULL COMMENT '手机ID',
|
||||
`vehicle_id` varchar(64) DEFAULT NULL COMMENT '车辆ID',
|
||||
`execution_number` int DEFAULT '1' COMMENT '第几次执行',
|
||||
`status` int DEFAULT '0' COMMENT '执行状态(0待执行 1执行中 2已完成 3已取消 4执行失败 5已暂停)',
|
||||
`total_cases` int DEFAULT '0' COMMENT '总用例数',
|
||||
`completed_cases` int DEFAULT '0' COMMENT '已完成用例数',
|
||||
`passed_cases` int DEFAULT '0' COMMENT '通过用例数',
|
||||
`failed_cases` int DEFAULT '0' COMMENT '失败用例数',
|
||||
`progress` decimal(5,2) DEFAULT '0.00' COMMENT '执行进度(百分比,保留2位小数)',
|
||||
`start_time` datetime DEFAULT NULL COMMENT '开始时间',
|
||||
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`task_ins_id` varchar(64) DEFAULT NULL COMMENT '任务执行实例ID',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_task_id` (`task_id`),
|
||||
KEY `idx_phone_id` (`phone_id`),
|
||||
KEY `idx_vehicle_id` (`vehicle_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='爱玛任务执行实例表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 6、日志管理表(单独存表)
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `aima_test_log`;
|
||||
CREATE TABLE `aima_test_log` (
|
||||
`id` varchar(64) NOT NULL COMMENT '主键ID',
|
||||
`task_instance_id` varchar(64) DEFAULT NULL COMMENT '任务执行实例ID',
|
||||
`task_id` varchar(64) DEFAULT NULL COMMENT '任务ID',
|
||||
`task_name` varchar(100) DEFAULT NULL COMMENT '任务名称',
|
||||
`test_case_id` varchar(64) DEFAULT NULL COMMENT '测试用例ID',
|
||||
`case_name` varchar(100) DEFAULT NULL COMMENT '用例名称',
|
||||
`log_level` varchar(20) DEFAULT 'INFO' COMMENT '日志级别(DEBUG/INFO/WARN/ERROR)',
|
||||
`log_type` varchar(50) DEFAULT NULL COMMENT '日志类型(执行日志/系统日志/异常日志)',
|
||||
`log_message` text COMMENT '日志内容',
|
||||
`log_time` datetime DEFAULT NULL COMMENT '日志时间',
|
||||
`execution_step` varchar(100) DEFAULT NULL COMMENT '执行步骤',
|
||||
`actual_result` text COMMENT '实际结果',
|
||||
`test_status` char(1) DEFAULT NULL COMMENT '测试结果(0未执行 1通过 2失败 3跳过)',
|
||||
`screenshot_url` varchar(500) DEFAULT NULL COMMENT '截图URL',
|
||||
`video_url` varchar(500) DEFAULT NULL COMMENT '视频URL',
|
||||
`error_stack` text COMMENT '错误堆栈',
|
||||
`duration_ms` bigint DEFAULT NULL COMMENT '执行耗时(毫秒)',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`progress` decimal(5,2) DEFAULT '0.00' COMMENT '执行进度(百分比,保留2位小数)',
|
||||
`status` char(1) DEFAULT '0' COMMENT '执行状态(0进行中 1已完成 2已暂停 3已取消 4已失败)',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_task_instance_id` (`task_instance_id`),
|
||||
KEY `idx_task_id` (`task_id`),
|
||||
KEY `idx_test_case_id` (`test_case_id`),
|
||||
KEY `idx_log_time` (`log_time`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='爱玛测试日志表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 7、告警管理表
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `aima_alarm`;
|
||||
CREATE TABLE `aima_alarm` (
|
||||
`id` varchar(64) NOT NULL COMMENT '主键ID',
|
||||
`alarm_code` varchar(50) 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 '任务名称',
|
||||
`phone_id` varchar(64) DEFAULT NULL COMMENT '手机ID',
|
||||
`phone_name` varchar(100) DEFAULT NULL COMMENT '手机名称',
|
||||
`vehicle_id` varchar(64) DEFAULT NULL COMMENT '车辆ID',
|
||||
`vin` varchar(50) DEFAULT NULL COMMENT '车架号',
|
||||
`test_case_id` varchar(64) DEFAULT NULL COMMENT '测试用例ID',
|
||||
`case_name` varchar(100) DEFAULT NULL COMMENT '用例名称',
|
||||
`alarm_level` char(1) DEFAULT '2' COMMENT '告警级别(1提示 2警告 3严重)',
|
||||
`alarm_type` char(1) DEFAULT '1' 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 '' COMMENT '创建者',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime 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_alarm_time` (`alarm_time`),
|
||||
KEY `idx_handle_status` (`handle_status`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='爱玛告警管理表';
|
||||
276
智能巡检模块-创建说明.md
276
智能巡检模块-创建说明.md
@ -1,276 +0,0 @@
|
||||
# 智能巡检模块 - 已创建文件清单
|
||||
|
||||
## ✅ 已完成创建的文件
|
||||
|
||||
### 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