init: init proj
This commit is contained in:
@@ -0,0 +1,109 @@
|
||||
package org.dromara.inspection.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.core.validate.QueryGroup;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.inspection.domain.bo.ArDeviceBo;
|
||||
import org.dromara.inspection.domain.vo.ArDeviceVo;
|
||||
import org.dromara.inspection.service.IArDeviceService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AR设备Controller
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/inspection/device")
|
||||
public class ArDeviceController extends BaseController {
|
||||
|
||||
private final IArDeviceService arDeviceService;
|
||||
|
||||
/**
|
||||
* 查询AR设备列表
|
||||
*/
|
||||
@SaCheckPermission("inspection:device:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ArDeviceVo> list(@Validated(QueryGroup.class) ArDeviceBo bo, PageQuery pageQuery) {
|
||||
return arDeviceService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出AR设备列表
|
||||
*/
|
||||
@SaCheckPermission("inspection:device:export")
|
||||
@Log(title = "AR设备", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(@Validated ArDeviceBo bo, HttpServletResponse response) {
|
||||
List<ArDeviceVo> list = arDeviceService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "AR设备", ArDeviceVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取AR设备详细信息
|
||||
*
|
||||
* @param id 设备ID
|
||||
*/
|
||||
@SaCheckPermission("inspection:device:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<ArDeviceVo> getInfo(@NotNull(message = "设备ID不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
return R.ok(arDeviceService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增AR设备
|
||||
*/
|
||||
@SaCheckPermission("inspection:device:add")
|
||||
@Log(title = "AR设备", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ArDeviceBo bo) {
|
||||
return toAjax(arDeviceService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改AR设备
|
||||
*/
|
||||
@SaCheckPermission("inspection:device:edit")
|
||||
@Log(title = "AR设备", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ArDeviceBo bo) {
|
||||
return toAjax(arDeviceService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除AR设备
|
||||
*
|
||||
* @param ids 设备ID串
|
||||
*/
|
||||
@SaCheckPermission("inspection:device:remove")
|
||||
@Log(title = "AR设备", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "设备ID不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(arDeviceService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package org.dromara.inspection.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.core.validate.QueryGroup;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.inspection.domain.bo.ArExecutionBo;
|
||||
import org.dromara.inspection.domain.vo.ArExecutionVo;
|
||||
import org.dromara.inspection.service.IArExecutionService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 任务执行记录Controller
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/inspection/execution")
|
||||
public class ArExecutionController extends BaseController {
|
||||
|
||||
private final IArExecutionService arExecutionService;
|
||||
|
||||
/**
|
||||
* 查询任务执行记录列表
|
||||
*/
|
||||
@SaCheckPermission("inspection:execution:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ArExecutionVo> list(@Validated(QueryGroup.class) ArExecutionBo bo, PageQuery pageQuery) {
|
||||
return arExecutionService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出任务执行记录列表
|
||||
*/
|
||||
@SaCheckPermission("inspection:execution:export")
|
||||
@Log(title = "任务执行记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(@Validated ArExecutionBo bo, HttpServletResponse response) {
|
||||
List<ArExecutionVo> list = arExecutionService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "任务执行记录", ArExecutionVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务执行记录详细信息
|
||||
*
|
||||
* @param id 执行ID
|
||||
*/
|
||||
@SaCheckPermission("inspection:execution:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<ArExecutionVo> getInfo(@NotNull(message = "执行ID不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
return R.ok(arExecutionService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增任务执行记录
|
||||
*/
|
||||
@SaCheckPermission("inspection:execution:add")
|
||||
@Log(title = "任务执行记录", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ArExecutionBo bo) {
|
||||
return toAjax(arExecutionService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改任务执行记录
|
||||
*/
|
||||
@SaCheckPermission("inspection:execution:edit")
|
||||
@Log(title = "任务执行记录", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ArExecutionBo bo) {
|
||||
return toAjax(arExecutionService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除任务执行记录
|
||||
*
|
||||
* @param ids 执行ID串
|
||||
*/
|
||||
@SaCheckPermission("inspection:execution:remove")
|
||||
@Log(title = "任务执行记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "执行ID不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(arExecutionService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package org.dromara.inspection.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.core.validate.QueryGroup;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.inspection.domain.bo.ArPointBo;
|
||||
import org.dromara.inspection.domain.vo.ArPointVo;
|
||||
import org.dromara.inspection.service.IArPointService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 巡检点位Controller
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/inspection/point")
|
||||
public class ArPointController extends BaseController {
|
||||
|
||||
private final IArPointService arPointService;
|
||||
|
||||
/**
|
||||
* 查询巡检点位列表
|
||||
*/
|
||||
@SaCheckPermission("inspection:point:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ArPointVo> list(@Validated(QueryGroup.class) ArPointBo bo, PageQuery pageQuery) {
|
||||
return arPointService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出巡检点位列表
|
||||
*/
|
||||
@SaCheckPermission("inspection:point:export")
|
||||
@Log(title = "巡检点位", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(@Validated ArPointBo bo, HttpServletResponse response) {
|
||||
List<ArPointVo> list = arPointService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "巡检点位", ArPointVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取巡检点位详细信息
|
||||
*
|
||||
* @param id 点位ID
|
||||
*/
|
||||
@SaCheckPermission("inspection:point:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<ArPointVo> getInfo(@NotNull(message = "点位ID不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
return R.ok(arPointService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增巡检点位
|
||||
*/
|
||||
@SaCheckPermission("inspection:point:add")
|
||||
@Log(title = "巡检点位", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ArPointBo bo) {
|
||||
return toAjax(arPointService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改巡检点位
|
||||
*/
|
||||
@SaCheckPermission("inspection:point:edit")
|
||||
@Log(title = "巡检点位", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ArPointBo bo) {
|
||||
return toAjax(arPointService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除巡检点位
|
||||
*
|
||||
* @param ids 点位ID串
|
||||
*/
|
||||
@SaCheckPermission("inspection:point:remove")
|
||||
@Log(title = "巡检点位", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "点位ID不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(arPointService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package org.dromara.inspection.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.core.validate.QueryGroup;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.inspection.domain.bo.ArRegionBo;
|
||||
import org.dromara.inspection.domain.vo.ArRegionVo;
|
||||
import org.dromara.inspection.service.IArRegionService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 巡检区域Controller
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/inspection/region")
|
||||
public class ArRegionController extends BaseController {
|
||||
|
||||
private final IArRegionService arRegionService;
|
||||
|
||||
/**
|
||||
* 查询巡检区域列表
|
||||
*/
|
||||
@SaCheckPermission("inspection:region:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ArRegionVo> list(@Validated(QueryGroup.class) ArRegionBo bo, PageQuery pageQuery) {
|
||||
return arRegionService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出巡检区域列表
|
||||
*/
|
||||
@SaCheckPermission("inspection:region:export")
|
||||
@Log(title = "巡检区域", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(@Validated ArRegionBo bo, HttpServletResponse response) {
|
||||
List<ArRegionVo> list = arRegionService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "巡检区域", ArRegionVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取巡检区域详细信息
|
||||
*
|
||||
* @param id 区域ID
|
||||
*/
|
||||
@SaCheckPermission("inspection:region:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<ArRegionVo> getInfo(@NotNull(message = "区域ID不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
return R.ok(arRegionService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增巡检区域
|
||||
*/
|
||||
@SaCheckPermission("inspection:region:add")
|
||||
@Log(title = "巡检区域", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ArRegionBo bo) {
|
||||
return toAjax(arRegionService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改巡检区域
|
||||
*/
|
||||
@SaCheckPermission("inspection:region:edit")
|
||||
@Log(title = "巡检区域", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ArRegionBo bo) {
|
||||
return toAjax(arRegionService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除巡检区域
|
||||
*
|
||||
* @param ids 区域ID串
|
||||
*/
|
||||
@SaCheckPermission("inspection:region:remove")
|
||||
@Log(title = "巡检区域", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "区域ID不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(arRegionService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package org.dromara.inspection.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.core.validate.QueryGroup;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.inspection.domain.bo.ArStepBo;
|
||||
import org.dromara.inspection.domain.vo.ArStepTreeVo;
|
||||
import org.dromara.inspection.domain.vo.ArStepVo;
|
||||
import org.dromara.inspection.service.IArStepService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 巡检步骤Controller
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/inspection/step")
|
||||
public class ArStepController extends BaseController {
|
||||
|
||||
private final IArStepService arStepService;
|
||||
|
||||
/**
|
||||
* 查询巡检步骤列表
|
||||
*/
|
||||
@SaCheckPermission("inspection:step:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ArStepVo> list(@Validated(QueryGroup.class) ArStepBo bo, PageQuery pageQuery) {
|
||||
return arStepService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询任务的步骤树
|
||||
*
|
||||
* @param taskId 任务ID
|
||||
*/
|
||||
@SaCheckPermission("inspection:step:list")
|
||||
@GetMapping("/tree/{taskId}")
|
||||
public R<List<ArStepTreeVo>> tree(@NotNull(message = "任务ID不能为空")
|
||||
@PathVariable("taskId") Long taskId) {
|
||||
return R.ok(arStepService.queryStepTree(taskId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取巡检步骤详细信息
|
||||
*
|
||||
* @param id 步骤ID
|
||||
*/
|
||||
@SaCheckPermission("inspection:step:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<ArStepVo> getInfo(@NotNull(message = "步骤ID不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
return R.ok(arStepService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增巡检步骤
|
||||
*/
|
||||
@SaCheckPermission("inspection:step:add")
|
||||
@Log(title = "巡检步骤", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ArStepBo bo) {
|
||||
return toAjax(arStepService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改巡检步骤
|
||||
*/
|
||||
@SaCheckPermission("inspection:step:edit")
|
||||
@Log(title = "巡检步骤", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ArStepBo bo) {
|
||||
return toAjax(arStepService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除巡检步骤(级联删除子步骤)
|
||||
*
|
||||
* @param ids 步骤ID串
|
||||
*/
|
||||
@SaCheckPermission("inspection:step:remove")
|
||||
@Log(title = "巡检步骤", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "步骤ID不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(arStepService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
package org.dromara.inspection.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.core.validate.QueryGroup;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.inspection.domain.bo.ArStepMediaBo;
|
||||
import org.dromara.inspection.domain.vo.ArStepMediaVo;
|
||||
import org.dromara.inspection.service.IArStepMediaService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 步骤媒体文件Controller
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/inspection/stepMedia")
|
||||
public class ArStepMediaController extends BaseController {
|
||||
|
||||
private final IArStepMediaService arStepMediaService;
|
||||
|
||||
/**
|
||||
* 查询步骤媒体文件列表
|
||||
*/
|
||||
@SaCheckPermission("inspection:stepMedia:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ArStepMediaVo> list(@Validated(QueryGroup.class) ArStepMediaBo bo, PageQuery pageQuery) {
|
||||
return arStepMediaService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出步骤媒体文件列表
|
||||
*/
|
||||
@SaCheckPermission("inspection:stepMedia:export")
|
||||
@Log(title = "步骤媒体文件", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(@Validated ArStepMediaBo bo, HttpServletResponse response) {
|
||||
List<ArStepMediaVo> list = arStepMediaService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "步骤媒体文件", ArStepMediaVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取步骤媒体文件详细信息
|
||||
*
|
||||
* @param id 媒体ID
|
||||
*/
|
||||
@SaCheckPermission("inspection:stepMedia:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<ArStepMediaVo> getInfo(@NotNull(message = "媒体ID不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
return R.ok(arStepMediaService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增步骤媒体文件
|
||||
*/
|
||||
@SaCheckPermission("inspection:stepMedia:add")
|
||||
@Log(title = "步骤媒体文件", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ArStepMediaBo bo) {
|
||||
return toAjax(arStepMediaService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改步骤媒体文件
|
||||
*/
|
||||
@SaCheckPermission("inspection:stepMedia:edit")
|
||||
@Log(title = "步骤媒体文件", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ArStepMediaBo bo) {
|
||||
return toAjax(arStepMediaService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除步骤媒体文件
|
||||
*
|
||||
* @param ids 媒体ID串
|
||||
*/
|
||||
@SaCheckPermission("inspection:stepMedia:remove")
|
||||
@Log(title = "步骤媒体文件", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "媒体ID不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(arStepMediaService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package org.dromara.inspection.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.core.validate.QueryGroup;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.inspection.domain.bo.ArStepRecordBo;
|
||||
import org.dromara.inspection.domain.vo.ArStepRecordVo;
|
||||
import org.dromara.inspection.service.IArStepRecordService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 步骤执行记录Controller
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/inspection/stepRecord")
|
||||
public class ArStepRecordController extends BaseController {
|
||||
|
||||
private final IArStepRecordService arStepRecordService;
|
||||
|
||||
/**
|
||||
* 查询步骤执行记录列表
|
||||
*/
|
||||
@SaCheckPermission("inspection:stepRecord:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ArStepRecordVo> list(@Validated(QueryGroup.class) ArStepRecordBo bo, PageQuery pageQuery) {
|
||||
return arStepRecordService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出步骤执行记录列表
|
||||
*/
|
||||
@SaCheckPermission("inspection:stepRecord:export")
|
||||
@Log(title = "步骤执行记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(@Validated ArStepRecordBo bo, HttpServletResponse response) {
|
||||
List<ArStepRecordVo> list = arStepRecordService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "步骤执行记录", ArStepRecordVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取步骤执行记录详细信息
|
||||
*
|
||||
* @param id 记录ID
|
||||
*/
|
||||
@SaCheckPermission("inspection:stepRecord:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<ArStepRecordVo> getInfo(@NotNull(message = "记录ID不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
return R.ok(arStepRecordService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增步骤执行记录
|
||||
*/
|
||||
@SaCheckPermission("inspection:stepRecord:add")
|
||||
@Log(title = "步骤执行记录", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ArStepRecordBo bo) {
|
||||
return toAjax(arStepRecordService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改步骤执行记录
|
||||
*/
|
||||
@SaCheckPermission("inspection:stepRecord:edit")
|
||||
@Log(title = "步骤执行记录", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ArStepRecordBo bo) {
|
||||
return toAjax(arStepRecordService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除步骤执行记录
|
||||
*
|
||||
* @param ids 记录ID串
|
||||
*/
|
||||
@SaCheckPermission("inspection:stepRecord:remove")
|
||||
@Log(title = "步骤执行记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "记录ID不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(arStepRecordService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package org.dromara.inspection.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.core.validate.QueryGroup;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.inspection.domain.bo.ArTaskBo;
|
||||
import org.dromara.inspection.domain.vo.ArTaskVo;
|
||||
import org.dromara.inspection.service.IArTaskService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 巡检任务模板Controller
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/inspection/task")
|
||||
public class ArTaskController extends BaseController {
|
||||
|
||||
private final IArTaskService arTaskService;
|
||||
|
||||
/**
|
||||
* 查询巡检任务模板列表
|
||||
*/
|
||||
@SaCheckPermission("inspection:task:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ArTaskVo> list(@Validated(QueryGroup.class) ArTaskBo bo, PageQuery pageQuery) {
|
||||
return arTaskService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出巡检任务模板列表
|
||||
*/
|
||||
@SaCheckPermission("inspection:task:export")
|
||||
@Log(title = "巡检任务模板", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(@Validated ArTaskBo bo, HttpServletResponse response) {
|
||||
List<ArTaskVo> list = arTaskService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "巡检任务模板", ArTaskVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取巡检任务模板详细信息
|
||||
*
|
||||
* @param id 任务ID
|
||||
*/
|
||||
@SaCheckPermission("inspection:task:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<ArTaskVo> getInfo(@NotNull(message = "任务ID不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
return R.ok(arTaskService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增巡检任务模板
|
||||
*/
|
||||
@SaCheckPermission("inspection:task:add")
|
||||
@Log(title = "巡检任务模板", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ArTaskBo bo) {
|
||||
return toAjax(arTaskService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改巡检任务模板
|
||||
*/
|
||||
@SaCheckPermission("inspection:task:edit")
|
||||
@Log(title = "巡检任务模板", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ArTaskBo bo) {
|
||||
return toAjax(arTaskService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除巡检任务模板
|
||||
*
|
||||
* @param ids 任务ID串
|
||||
*/
|
||||
@SaCheckPermission("inspection:task:remove")
|
||||
@Log(title = "巡检任务模板", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "任务ID不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(arTaskService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package org.dromara.inspection.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* AR设备对象 ar_device
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("ar_device")
|
||||
public class ArDevice extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 设备编号
|
||||
*/
|
||||
private String deviceNo;
|
||||
|
||||
/**
|
||||
* 设备型号
|
||||
*/
|
||||
private String deviceModel;
|
||||
|
||||
/**
|
||||
* 状态(0启用 1停用)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 删除标志(0存在 1删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package org.dromara.inspection.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 任务执行记录对象 ar_execution
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("ar_execution")
|
||||
public class ArExecution extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 执行ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 任务模板ID
|
||||
*/
|
||||
private Long taskId;
|
||||
|
||||
/**
|
||||
* 执行编号
|
||||
*/
|
||||
private String executionCode;
|
||||
|
||||
/**
|
||||
* 区域ID
|
||||
*/
|
||||
private Long regionId;
|
||||
|
||||
/**
|
||||
* 使用设备ID
|
||||
*/
|
||||
private Long deviceId;
|
||||
|
||||
/**
|
||||
* 操作人ID
|
||||
*/
|
||||
private Long operatorId;
|
||||
|
||||
/**
|
||||
* 操作人姓名
|
||||
*/
|
||||
private String operatorName;
|
||||
|
||||
/**
|
||||
* 监护人ID
|
||||
*/
|
||||
private Long custodianId;
|
||||
|
||||
/**
|
||||
* 监护人姓名
|
||||
*/
|
||||
private String custodianName;
|
||||
|
||||
/**
|
||||
* 发令人ID
|
||||
*/
|
||||
private Long senderId;
|
||||
|
||||
/**
|
||||
* 发令人姓名
|
||||
*/
|
||||
private String senderName;
|
||||
|
||||
/**
|
||||
* 收令人ID
|
||||
*/
|
||||
private Long recipientId;
|
||||
|
||||
/**
|
||||
* 收令人姓名
|
||||
*/
|
||||
private String recipientName;
|
||||
|
||||
/**
|
||||
* 值长ID
|
||||
*/
|
||||
private Long commanderId;
|
||||
|
||||
/**
|
||||
* 值长姓名
|
||||
*/
|
||||
private String commanderName;
|
||||
|
||||
/**
|
||||
* 状态(pending待执行/in_progress执行中/completed已完成/cancelled已取消)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 总步骤数
|
||||
*/
|
||||
private Integer totalSteps;
|
||||
|
||||
/**
|
||||
* 已完成步骤数
|
||||
*/
|
||||
private Integer completedSteps;
|
||||
|
||||
/**
|
||||
* 删除标志(0存在 1删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package org.dromara.inspection.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 巡检点位对象 ar_point
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "ar_point", autoResultMap = true)
|
||||
public class ArPoint extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 点位ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 所属区域ID
|
||||
*/
|
||||
private Long regionId;
|
||||
|
||||
/**
|
||||
* 点位名称
|
||||
*/
|
||||
private String pointName;
|
||||
|
||||
/**
|
||||
* 点位编码
|
||||
*/
|
||||
private String pointCode;
|
||||
|
||||
/**
|
||||
* 点位业务数据(包含坐标、预设等)
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private Map<String, Object> positionData;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 删除标志(0存在 1删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package org.dromara.inspection.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 巡检区域对象 ar_region
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "ar_region", autoResultMap = true)
|
||||
public class ArRegion extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 区域ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 区域名称
|
||||
*/
|
||||
private String regionName;
|
||||
|
||||
/**
|
||||
* 区域编码
|
||||
*/
|
||||
private String regionCode;
|
||||
|
||||
/**
|
||||
* 区域业务数据(预留)
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private Map<String, Object> regionData;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 删除标志(0存在 1删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
package org.dromara.inspection.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 巡检步骤对象 ar_step
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "ar_step", autoResultMap = true)
|
||||
public class ArStep extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 步骤ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 所属任务ID
|
||||
*/
|
||||
private Long taskId;
|
||||
|
||||
/**
|
||||
* 父步骤ID(0为顶级)
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 祖级列表
|
||||
*/
|
||||
private String ancestors;
|
||||
|
||||
/**
|
||||
* 步骤名称
|
||||
*/
|
||||
private String stepName;
|
||||
|
||||
/**
|
||||
* 步骤内容描述
|
||||
*/
|
||||
private String stepContent;
|
||||
|
||||
/**
|
||||
* 步骤语音文本
|
||||
*/
|
||||
private String contentVoice;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
private Integer orderNum;
|
||||
|
||||
/**
|
||||
* 关联点位ID
|
||||
*/
|
||||
private Long pointId;
|
||||
|
||||
/**
|
||||
* 需要语音朗读(0否 1是)
|
||||
*/
|
||||
private String needVoiceRead;
|
||||
|
||||
/**
|
||||
* 需要用户复述(0否 1是)
|
||||
*/
|
||||
private String needVoiceRephrase;
|
||||
|
||||
/**
|
||||
* 复述提示文本
|
||||
*/
|
||||
private String rephraseContent;
|
||||
|
||||
/**
|
||||
* 复述语音文本
|
||||
*/
|
||||
private String rephraseVoice;
|
||||
|
||||
/**
|
||||
* 需要确认(0否 1是)
|
||||
*/
|
||||
private String needVoiceConfirm;
|
||||
|
||||
/**
|
||||
* 确认提示文本
|
||||
*/
|
||||
private String confirmContent;
|
||||
|
||||
/**
|
||||
* 确认语音文本
|
||||
*/
|
||||
private String confirmVoice;
|
||||
|
||||
/**
|
||||
* 确认词
|
||||
*/
|
||||
private String confirmWord;
|
||||
|
||||
/**
|
||||
* 需要AI识别(0否 1是)
|
||||
*/
|
||||
private String needAi;
|
||||
|
||||
/**
|
||||
* AI目标名称
|
||||
*/
|
||||
private String aiTargetName;
|
||||
|
||||
/**
|
||||
* AI配置数据(预留)
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private Map<String, Object> aiData;
|
||||
|
||||
/**
|
||||
* 是否操作步骤(0否 1是)
|
||||
*/
|
||||
private String isOperation;
|
||||
|
||||
/**
|
||||
* 是否叶子节点(0否 1是)
|
||||
*/
|
||||
private String isLeaf;
|
||||
|
||||
/**
|
||||
* 删除标志(0存在 1删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package org.dromara.inspection.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 步骤媒体文件对象 ar_step_media
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("ar_step_media")
|
||||
public class ArStepMedia extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 媒体ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 步骤记录ID
|
||||
*/
|
||||
private Long stepRecordId;
|
||||
|
||||
/**
|
||||
* 媒体类型
|
||||
*/
|
||||
private String mediaType;
|
||||
|
||||
/**
|
||||
* 文件URL
|
||||
*/
|
||||
private String fileUrl;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 文件大小(字节)
|
||||
*/
|
||||
private Long fileSize;
|
||||
|
||||
/**
|
||||
* 上传时间
|
||||
*/
|
||||
private Date uploadTime;
|
||||
|
||||
/**
|
||||
* 删除标志
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package org.dromara.inspection.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 步骤执行记录对象 ar_step_record
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("ar_step_record")
|
||||
public class ArStepRecord extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 记录ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 任务执行ID
|
||||
*/
|
||||
private Long executionId;
|
||||
|
||||
/**
|
||||
* 步骤ID
|
||||
*/
|
||||
private Long stepId;
|
||||
|
||||
/**
|
||||
* 状态(pending待执行/completed已完成/skipped已跳过)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 是否完成(0否 1是)
|
||||
*/
|
||||
private String isDone;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 完成时间
|
||||
*/
|
||||
private Date completionTime;
|
||||
|
||||
/**
|
||||
* 耗时(秒)
|
||||
*/
|
||||
private Integer duration;
|
||||
|
||||
/**
|
||||
* 文本反馈
|
||||
*/
|
||||
private String textFeedback;
|
||||
|
||||
/**
|
||||
* 语音识别文本
|
||||
*/
|
||||
private String voiceText;
|
||||
|
||||
/**
|
||||
* AI识别结果(JSON)
|
||||
*/
|
||||
private String aiResult;
|
||||
|
||||
/**
|
||||
* 执行人ID
|
||||
*/
|
||||
private Long executorId;
|
||||
|
||||
/**
|
||||
* 执行人姓名
|
||||
*/
|
||||
private String executorName;
|
||||
|
||||
/**
|
||||
* 删除标志(0存在 1删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package org.dromara.inspection.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 巡检任务模板对象 ar_task
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("ar_task")
|
||||
public class ArTask extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 任务ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
private String taskName;
|
||||
|
||||
/**
|
||||
* 任务编码
|
||||
*/
|
||||
private String taskCode;
|
||||
|
||||
/**
|
||||
* 关联区域ID
|
||||
*/
|
||||
private Long regionId;
|
||||
|
||||
/**
|
||||
* 任务类型
|
||||
*/
|
||||
private String taskType;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 删除标志(0存在 1删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package org.dromara.inspection.domain.bo;
|
||||
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.inspection.domain.ArDevice;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* AR设备业务对象 ar_device
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = ArDevice.class, reverseConvertGenerate = false)
|
||||
public class ArDeviceBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
@NotNull(message = "设备ID不能为空", groups = {EditGroup.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@NotBlank(message = "设备名称不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 设备编号
|
||||
*/
|
||||
@NotBlank(message = "设备编号不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String deviceNo;
|
||||
|
||||
/**
|
||||
* 设备型号
|
||||
*/
|
||||
private String deviceModel;
|
||||
|
||||
/**
|
||||
* 状态(0启用 1停用)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
package org.dromara.inspection.domain.bo;
|
||||
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.inspection.domain.ArExecution;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 任务执行记录业务对象 ar_execution
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = ArExecution.class, reverseConvertGenerate = false)
|
||||
public class ArExecutionBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 执行ID
|
||||
*/
|
||||
@NotNull(message = "执行ID不能为空", groups = {EditGroup.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 任务模板ID
|
||||
*/
|
||||
@NotNull(message = "任务模板ID不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Long taskId;
|
||||
|
||||
/**
|
||||
* 执行编号
|
||||
*/
|
||||
private String executionCode;
|
||||
|
||||
/**
|
||||
* 区域ID
|
||||
*/
|
||||
@NotNull(message = "区域ID不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Long regionId;
|
||||
|
||||
/**
|
||||
* 使用设备ID
|
||||
*/
|
||||
private Long deviceId;
|
||||
|
||||
/**
|
||||
* 操作人ID
|
||||
*/
|
||||
private Long operatorId;
|
||||
|
||||
/**
|
||||
* 操作人姓名
|
||||
*/
|
||||
private String operatorName;
|
||||
|
||||
/**
|
||||
* 监护人ID
|
||||
*/
|
||||
private Long custodianId;
|
||||
|
||||
/**
|
||||
* 监护人姓名
|
||||
*/
|
||||
private String custodianName;
|
||||
|
||||
/**
|
||||
* 发令人ID
|
||||
*/
|
||||
private Long senderId;
|
||||
|
||||
/**
|
||||
* 发令人姓名
|
||||
*/
|
||||
private String senderName;
|
||||
|
||||
/**
|
||||
* 收令人ID
|
||||
*/
|
||||
private Long recipientId;
|
||||
|
||||
/**
|
||||
* 收令人姓名
|
||||
*/
|
||||
private String recipientName;
|
||||
|
||||
/**
|
||||
* 值长ID
|
||||
*/
|
||||
private Long commanderId;
|
||||
|
||||
/**
|
||||
* 值长姓名
|
||||
*/
|
||||
private String commanderName;
|
||||
|
||||
/**
|
||||
* 状态(pending待执行/in_progress执行中/completed已完成/cancelled已取消)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 总步骤数
|
||||
*/
|
||||
private Integer totalSteps;
|
||||
|
||||
/**
|
||||
* 已完成步骤数
|
||||
*/
|
||||
private Integer completedSteps;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package org.dromara.inspection.domain.bo;
|
||||
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.inspection.domain.ArPoint;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 巡检点位业务对象 ar_point
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = ArPoint.class, reverseConvertGenerate = false)
|
||||
public class ArPointBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 点位ID
|
||||
*/
|
||||
@NotNull(message = "点位ID不能为空", groups = {EditGroup.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 所属区域ID
|
||||
*/
|
||||
@NotNull(message = "所属区域ID不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Long regionId;
|
||||
|
||||
/**
|
||||
* 点位名称
|
||||
*/
|
||||
@NotBlank(message = "点位名称不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String pointName;
|
||||
|
||||
/**
|
||||
* 点位编码
|
||||
*/
|
||||
private String pointCode;
|
||||
|
||||
/**
|
||||
* 点位业务数据(包含坐标、预设等)
|
||||
*/
|
||||
@NotNull(message = "点位业务数据不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Map<String, Object> positionData;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package org.dromara.inspection.domain.bo;
|
||||
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.inspection.domain.ArRegion;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 巡检区域业务对象 ar_region
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = ArRegion.class, reverseConvertGenerate = false)
|
||||
public class ArRegionBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 区域ID
|
||||
*/
|
||||
@NotNull(message = "区域ID不能为空", groups = {EditGroup.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 区域名称
|
||||
*/
|
||||
@NotBlank(message = "区域名称不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String regionName;
|
||||
|
||||
/**
|
||||
* 区域编码
|
||||
*/
|
||||
private String regionCode;
|
||||
|
||||
/**
|
||||
* 区域业务数据(预留)
|
||||
*/
|
||||
private Map<String, Object> regionData;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
package org.dromara.inspection.domain.bo;
|
||||
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.inspection.domain.ArStep;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 巡检步骤业务对象 ar_step
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = ArStep.class, reverseConvertGenerate = false)
|
||||
public class ArStepBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 步骤ID
|
||||
*/
|
||||
@NotNull(message = "步骤ID不能为空", groups = {EditGroup.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 所属任务ID
|
||||
*/
|
||||
@NotNull(message = "所属任务ID不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Long taskId;
|
||||
|
||||
/**
|
||||
* 父步骤ID(0为顶级)
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 祖级列表
|
||||
*/
|
||||
private String ancestors;
|
||||
|
||||
/**
|
||||
* 步骤名称
|
||||
*/
|
||||
@NotBlank(message = "步骤名称不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String stepName;
|
||||
|
||||
/**
|
||||
* 步骤内容描述
|
||||
*/
|
||||
private String stepContent;
|
||||
|
||||
/**
|
||||
* 步骤语音文本
|
||||
*/
|
||||
private String contentVoice;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
private Integer orderNum;
|
||||
|
||||
/**
|
||||
* 关联点位ID
|
||||
*/
|
||||
private Long pointId;
|
||||
|
||||
/**
|
||||
* 需要语音朗读(0否 1是)
|
||||
*/
|
||||
private String needVoiceRead;
|
||||
|
||||
/**
|
||||
* 需要用户复述(0否 1是)
|
||||
*/
|
||||
private String needVoiceRephrase;
|
||||
|
||||
/**
|
||||
* 复述提示文本
|
||||
*/
|
||||
private String rephraseContent;
|
||||
|
||||
/**
|
||||
* 复述语音文本
|
||||
*/
|
||||
private String rephraseVoice;
|
||||
|
||||
/**
|
||||
* 需要确认(0否 1是)
|
||||
*/
|
||||
private String needVoiceConfirm;
|
||||
|
||||
/**
|
||||
* 确认提示文本
|
||||
*/
|
||||
private String confirmContent;
|
||||
|
||||
/**
|
||||
* 确认语音文本
|
||||
*/
|
||||
private String confirmVoice;
|
||||
|
||||
/**
|
||||
* 确认词
|
||||
*/
|
||||
private String confirmWord;
|
||||
|
||||
/**
|
||||
* 需要AI识别(0否 1是)
|
||||
*/
|
||||
private String needAi;
|
||||
|
||||
/**
|
||||
* AI目标名称
|
||||
*/
|
||||
private String aiTargetName;
|
||||
|
||||
/**
|
||||
* AI配置数据(预留)
|
||||
*/
|
||||
private Map<String, Object> aiData;
|
||||
|
||||
/**
|
||||
* 是否操作步骤(0否 1是)
|
||||
*/
|
||||
private String isOperation;
|
||||
|
||||
/**
|
||||
* 是否叶子节点(0否 1是)
|
||||
*/
|
||||
private String isLeaf;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package org.dromara.inspection.domain.bo;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.inspection.domain.ArStepMedia;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 步骤媒体文件业务对象 ar_step_media
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = ArStepMedia.class, reverseConvertGenerate = false)
|
||||
public class ArStepMediaBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 媒体ID
|
||||
*/
|
||||
@NotNull(message = "媒体ID不能为空", groups = {EditGroup.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 步骤记录ID
|
||||
*/
|
||||
@NotNull(message = "步骤记录ID不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Long stepRecordId;
|
||||
|
||||
/**
|
||||
* 媒体类型
|
||||
*/
|
||||
@NotBlank(message = "媒体类型不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String mediaType;
|
||||
|
||||
/**
|
||||
* 文件URL
|
||||
*/
|
||||
@NotBlank(message = "文件URL不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String fileUrl;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
@NotBlank(message = "文件名称不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 文件大小(字节)
|
||||
*/
|
||||
private Long fileSize;
|
||||
|
||||
/**
|
||||
* 上传时间
|
||||
*/
|
||||
private Date uploadTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package org.dromara.inspection.domain.bo;
|
||||
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.inspection.domain.ArStepRecord;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 步骤执行记录业务对象 ar_step_record
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = ArStepRecord.class, reverseConvertGenerate = false)
|
||||
public class ArStepRecordBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 记录ID
|
||||
*/
|
||||
@NotNull(message = "记录ID不能为空", groups = {EditGroup.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 任务执行ID
|
||||
*/
|
||||
@NotNull(message = "任务执行ID不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Long executionId;
|
||||
|
||||
/**
|
||||
* 步骤ID
|
||||
*/
|
||||
@NotNull(message = "步骤ID不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Long stepId;
|
||||
|
||||
/**
|
||||
* 状态(pending待执行/completed已完成/skipped已跳过)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 是否完成(0否 1是)
|
||||
*/
|
||||
private String isDone;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 完成时间
|
||||
*/
|
||||
private Date completionTime;
|
||||
|
||||
/**
|
||||
* 耗时(秒)
|
||||
*/
|
||||
private Integer duration;
|
||||
|
||||
/**
|
||||
* 文本反馈
|
||||
*/
|
||||
private String textFeedback;
|
||||
|
||||
/**
|
||||
* 语音识别文本
|
||||
*/
|
||||
private String voiceText;
|
||||
|
||||
/**
|
||||
* AI识别结果(JSON)
|
||||
*/
|
||||
private String aiResult;
|
||||
|
||||
/**
|
||||
* 执行人ID
|
||||
*/
|
||||
private Long executorId;
|
||||
|
||||
/**
|
||||
* 执行人姓名
|
||||
*/
|
||||
private String executorName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package org.dromara.inspection.domain.bo;
|
||||
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.inspection.domain.ArTask;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 巡检任务模板业务对象 ar_task
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = ArTask.class, reverseConvertGenerate = false)
|
||||
public class ArTaskBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 任务ID
|
||||
*/
|
||||
@NotNull(message = "任务ID不能为空", groups = {EditGroup.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
@NotBlank(message = "任务名称不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String taskName;
|
||||
|
||||
/**
|
||||
* 任务编码
|
||||
*/
|
||||
private String taskCode;
|
||||
|
||||
/**
|
||||
* 关联区域ID
|
||||
*/
|
||||
@NotNull(message = "关联区域ID不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Long regionId;
|
||||
|
||||
/**
|
||||
* 任务类型
|
||||
*/
|
||||
private String taskType;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package org.dromara.inspection.domain.vo;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.format.DateTimeFormat;
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.inspection.domain.ArDevice;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* AR设备视图对象 ar_device
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = ArDevice.class)
|
||||
public class ArDeviceVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
@ExcelProperty(value = "设备ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@ExcelProperty(value = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 设备编号
|
||||
*/
|
||||
@ExcelProperty(value = "设备编号")
|
||||
private String deviceNo;
|
||||
|
||||
/**
|
||||
* 设备型号
|
||||
*/
|
||||
@ExcelProperty(value = "设备型号")
|
||||
private String deviceModel;
|
||||
|
||||
/**
|
||||
* 状态(0启用 1停用)
|
||||
*/
|
||||
@ExcelProperty(value = "状态", readConverterExp = "0=启用,1=停用")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 创建人账号
|
||||
*/
|
||||
@Translation(type = TransConstant.USER_ID_TO_NAME, mapper = "createBy")
|
||||
@ExcelProperty(value = "创建人")
|
||||
private String createByName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
package org.dromara.inspection.domain.vo;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.format.DateTimeFormat;
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.inspection.domain.ArExecution;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 任务执行记录视图对象 ar_execution
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = ArExecution.class)
|
||||
public class ArExecutionVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 执行ID
|
||||
*/
|
||||
@ExcelProperty(value = "执行ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 任务模板ID
|
||||
*/
|
||||
@ExcelProperty(value = "任务模板ID")
|
||||
private Long taskId;
|
||||
|
||||
/**
|
||||
* 执行编号
|
||||
*/
|
||||
@ExcelProperty(value = "执行编号")
|
||||
private String executionCode;
|
||||
|
||||
/**
|
||||
* 区域ID
|
||||
*/
|
||||
@ExcelProperty(value = "区域ID")
|
||||
private Long regionId;
|
||||
|
||||
/**
|
||||
* 使用设备ID
|
||||
*/
|
||||
@ExcelProperty(value = "使用设备ID")
|
||||
private Long deviceId;
|
||||
|
||||
/**
|
||||
* 操作人ID
|
||||
*/
|
||||
private Long operatorId;
|
||||
|
||||
/**
|
||||
* 操作人姓名
|
||||
*/
|
||||
@Translation(type = TransConstant.USER_ID_TO_NAME, mapper = "operatorId")
|
||||
@ExcelProperty(value = "操作人")
|
||||
private String operatorName;
|
||||
|
||||
/**
|
||||
* 监护人ID
|
||||
*/
|
||||
private Long custodianId;
|
||||
|
||||
/**
|
||||
* 监护人姓名
|
||||
*/
|
||||
@Translation(type = TransConstant.USER_ID_TO_NAME, mapper = "custodianId")
|
||||
@ExcelProperty(value = "监护人")
|
||||
private String custodianName;
|
||||
|
||||
/**
|
||||
* 发令人ID
|
||||
*/
|
||||
private Long senderId;
|
||||
|
||||
/**
|
||||
* 发令人姓名
|
||||
*/
|
||||
@Translation(type = TransConstant.USER_ID_TO_NAME, mapper = "senderId")
|
||||
@ExcelProperty(value = "发令人")
|
||||
private String senderName;
|
||||
|
||||
/**
|
||||
* 收令人ID
|
||||
*/
|
||||
private Long recipientId;
|
||||
|
||||
/**
|
||||
* 收令人姓名
|
||||
*/
|
||||
@Translation(type = TransConstant.USER_ID_TO_NAME, mapper = "recipientId")
|
||||
@ExcelProperty(value = "收令人")
|
||||
private String recipientName;
|
||||
|
||||
/**
|
||||
* 值长ID
|
||||
*/
|
||||
private Long commanderId;
|
||||
|
||||
/**
|
||||
* 值长姓名
|
||||
*/
|
||||
@Translation(type = TransConstant.USER_ID_TO_NAME, mapper = "commanderId")
|
||||
@ExcelProperty(value = "值长")
|
||||
private String commanderName;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@ExcelProperty(value = "状态", readConverterExp = "pending=待执行,in_progress=执行中,completed=已完成,cancelled=已取消")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
|
||||
@ExcelProperty(value = "开始时间")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
|
||||
@ExcelProperty(value = "结束时间")
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 总步骤数
|
||||
*/
|
||||
@ExcelProperty(value = "总步骤数")
|
||||
private Integer totalSteps;
|
||||
|
||||
/**
|
||||
* 已完成步骤数
|
||||
*/
|
||||
@ExcelProperty(value = "已完成步骤数")
|
||||
private Integer completedSteps;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package org.dromara.inspection.domain.vo;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.format.DateTimeFormat;
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.inspection.domain.ArPoint;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 巡检点位视图对象 ar_point
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = ArPoint.class)
|
||||
public class ArPointVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 点位ID
|
||||
*/
|
||||
@ExcelProperty(value = "点位ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 所属区域ID
|
||||
*/
|
||||
@ExcelProperty(value = "所属区域ID")
|
||||
private Long regionId;
|
||||
|
||||
/**
|
||||
* 点位名称
|
||||
*/
|
||||
@ExcelProperty(value = "点位名称")
|
||||
private String pointName;
|
||||
|
||||
/**
|
||||
* 点位编码
|
||||
*/
|
||||
@ExcelProperty(value = "点位编码")
|
||||
private String pointCode;
|
||||
|
||||
/**
|
||||
* 点位业务数据(包含坐标、预设等)
|
||||
*/
|
||||
private Map<String, Object> positionData;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 创建人账号
|
||||
*/
|
||||
@Translation(type = TransConstant.USER_ID_TO_NAME, mapper = "createBy")
|
||||
@ExcelProperty(value = "创建人")
|
||||
private String createByName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package org.dromara.inspection.domain.vo;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.format.DateTimeFormat;
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.inspection.domain.ArRegion;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 巡检区域视图对象 ar_region
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = ArRegion.class)
|
||||
public class ArRegionVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 区域ID
|
||||
*/
|
||||
@ExcelProperty(value = "区域ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 区域名称
|
||||
*/
|
||||
@ExcelProperty(value = "区域名称")
|
||||
private String regionName;
|
||||
|
||||
/**
|
||||
* 区域编码
|
||||
*/
|
||||
@ExcelProperty(value = "区域编码")
|
||||
private String regionCode;
|
||||
|
||||
/**
|
||||
* 区域业务数据(预留)
|
||||
*/
|
||||
private Map<String, Object> regionData;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
@ExcelProperty(value = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 创建人账号
|
||||
*/
|
||||
@Translation(type = TransConstant.USER_ID_TO_NAME, mapper = "createBy")
|
||||
@ExcelProperty(value = "创建人")
|
||||
private String createByName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package org.dromara.inspection.domain.vo;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.format.DateTimeFormat;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.inspection.domain.ArStepMedia;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 步骤媒体文件视图对象 ar_step_media
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = ArStepMedia.class)
|
||||
public class ArStepMediaVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 媒体ID
|
||||
*/
|
||||
@ExcelProperty(value = "媒体ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 步骤记录ID
|
||||
*/
|
||||
@ExcelProperty(value = "步骤记录ID")
|
||||
private Long stepRecordId;
|
||||
|
||||
/**
|
||||
* 媒体类型
|
||||
*/
|
||||
@ExcelProperty(value = "媒体类型", readConverterExp = "image=图片,video=视频,audio=音频")
|
||||
private String mediaType;
|
||||
|
||||
/**
|
||||
* 文件URL
|
||||
*/
|
||||
@ExcelProperty(value = "文件URL")
|
||||
private String fileUrl;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
@ExcelProperty(value = "文件名称")
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 文件大小(字节)
|
||||
*/
|
||||
@ExcelProperty(value = "文件大小(字节)")
|
||||
private Long fileSize;
|
||||
|
||||
/**
|
||||
* 上传时间
|
||||
*/
|
||||
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
|
||||
@ExcelProperty(value = "上传时间")
|
||||
private Date uploadTime;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package org.dromara.inspection.domain.vo;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.format.DateTimeFormat;
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.inspection.domain.ArStepRecord;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 步骤执行记录视图对象 ar_step_record
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = ArStepRecord.class)
|
||||
public class ArStepRecordVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 记录ID
|
||||
*/
|
||||
@ExcelProperty(value = "记录ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 任务执行ID
|
||||
*/
|
||||
@ExcelProperty(value = "任务执行ID")
|
||||
private Long executionId;
|
||||
|
||||
/**
|
||||
* 步骤ID
|
||||
*/
|
||||
@ExcelProperty(value = "步骤ID")
|
||||
private Long stepId;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@ExcelProperty(value = "状态", readConverterExp = "pending=待执行,completed=已完成,skipped=已跳过")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 是否完成
|
||||
*/
|
||||
@ExcelProperty(value = "是否完成", readConverterExp = "0=否,1=是")
|
||||
private String isDone;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
|
||||
@ExcelProperty(value = "开始时间")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 完成时间
|
||||
*/
|
||||
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
|
||||
@ExcelProperty(value = "完成时间")
|
||||
private Date completionTime;
|
||||
|
||||
/**
|
||||
* 耗时(秒)
|
||||
*/
|
||||
@ExcelProperty(value = "耗时(秒)")
|
||||
private Integer duration;
|
||||
|
||||
/**
|
||||
* 文本反馈
|
||||
*/
|
||||
@ExcelProperty(value = "文本反馈")
|
||||
private String textFeedback;
|
||||
|
||||
/**
|
||||
* 语音识别文本
|
||||
*/
|
||||
@ExcelProperty(value = "语音识别文本")
|
||||
private String voiceText;
|
||||
|
||||
/**
|
||||
* AI识别结果(JSON)
|
||||
*/
|
||||
private String aiResult;
|
||||
|
||||
/**
|
||||
* 执行人ID
|
||||
*/
|
||||
private Long executorId;
|
||||
|
||||
/**
|
||||
* 执行人姓名
|
||||
*/
|
||||
@Translation(type = TransConstant.USER_ID_TO_NAME, mapper = "executorId")
|
||||
@ExcelProperty(value = "执行人")
|
||||
private String executorName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
package org.dromara.inspection.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 巡检步骤树形视图对象 ar_step_tree
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@Data
|
||||
public class ArStepTreeVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 步骤ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 所属任务ID
|
||||
*/
|
||||
private Long taskId;
|
||||
|
||||
/**
|
||||
* 父步骤ID(0为顶级)
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 祖级列表
|
||||
*/
|
||||
private String ancestors;
|
||||
|
||||
/**
|
||||
* 步骤名称
|
||||
*/
|
||||
private String stepName;
|
||||
|
||||
/**
|
||||
* 步骤内容描述
|
||||
*/
|
||||
private String stepContent;
|
||||
|
||||
/**
|
||||
* 步骤语音文本
|
||||
*/
|
||||
private String contentVoice;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
private Integer orderNum;
|
||||
|
||||
/**
|
||||
* 关联点位ID
|
||||
*/
|
||||
private Long pointId;
|
||||
|
||||
/**
|
||||
* 需要语音朗读(0否 1是)
|
||||
*/
|
||||
private String needVoiceRead;
|
||||
|
||||
/**
|
||||
* 需要用户复述(0否 1是)
|
||||
*/
|
||||
private String needVoiceRephrase;
|
||||
|
||||
/**
|
||||
* 复述提示文本
|
||||
*/
|
||||
private String rephraseContent;
|
||||
|
||||
/**
|
||||
* 复述语音文本
|
||||
*/
|
||||
private String rephraseVoice;
|
||||
|
||||
/**
|
||||
* 需要确认(0否 1是)
|
||||
*/
|
||||
private String needVoiceConfirm;
|
||||
|
||||
/**
|
||||
* 确认提示文本
|
||||
*/
|
||||
private String confirmContent;
|
||||
|
||||
/**
|
||||
* 确认语音文本
|
||||
*/
|
||||
private String confirmVoice;
|
||||
|
||||
/**
|
||||
* 确认词
|
||||
*/
|
||||
private String confirmWord;
|
||||
|
||||
/**
|
||||
* 需要AI识别(0否 1是)
|
||||
*/
|
||||
private String needAi;
|
||||
|
||||
/**
|
||||
* AI目标名称
|
||||
*/
|
||||
private String aiTargetName;
|
||||
|
||||
/**
|
||||
* AI配置数据(预留)
|
||||
*/
|
||||
private Map<String, Object> aiData;
|
||||
|
||||
/**
|
||||
* 是否操作步骤(0否 1是)
|
||||
*/
|
||||
private String isOperation;
|
||||
|
||||
/**
|
||||
* 是否叶子节点(0否 1是)
|
||||
*/
|
||||
private String isLeaf;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 子步骤列表
|
||||
*/
|
||||
private List<ArStepTreeVo> children;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
package org.dromara.inspection.domain.vo;
|
||||
|
||||
import org.dromara.inspection.domain.ArStep;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 巡检步骤视图对象 ar_step
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@Data
|
||||
@AutoMapper(target = ArStep.class)
|
||||
public class ArStepVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 步骤ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 所属任务ID
|
||||
*/
|
||||
private Long taskId;
|
||||
|
||||
/**
|
||||
* 父步骤ID(0为顶级)
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 祖级列表
|
||||
*/
|
||||
private String ancestors;
|
||||
|
||||
/**
|
||||
* 步骤名称
|
||||
*/
|
||||
private String stepName;
|
||||
|
||||
/**
|
||||
* 步骤内容描述
|
||||
*/
|
||||
private String stepContent;
|
||||
|
||||
/**
|
||||
* 步骤语音文本
|
||||
*/
|
||||
private String contentVoice;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
private Integer orderNum;
|
||||
|
||||
/**
|
||||
* 关联点位ID
|
||||
*/
|
||||
private Long pointId;
|
||||
|
||||
/**
|
||||
* 需要语音朗读(0否 1是)
|
||||
*/
|
||||
private String needVoiceRead;
|
||||
|
||||
/**
|
||||
* 需要用户复述(0否 1是)
|
||||
*/
|
||||
private String needVoiceRephrase;
|
||||
|
||||
/**
|
||||
* 复述提示文本
|
||||
*/
|
||||
private String rephraseContent;
|
||||
|
||||
/**
|
||||
* 复述语音文本
|
||||
*/
|
||||
private String rephraseVoice;
|
||||
|
||||
/**
|
||||
* 需要确认(0否 1是)
|
||||
*/
|
||||
private String needVoiceConfirm;
|
||||
|
||||
/**
|
||||
* 确认提示文本
|
||||
*/
|
||||
private String confirmContent;
|
||||
|
||||
/**
|
||||
* 确认语音文本
|
||||
*/
|
||||
private String confirmVoice;
|
||||
|
||||
/**
|
||||
* 确认词
|
||||
*/
|
||||
private String confirmWord;
|
||||
|
||||
/**
|
||||
* 需要AI识别(0否 1是)
|
||||
*/
|
||||
private String needAi;
|
||||
|
||||
/**
|
||||
* AI目标名称
|
||||
*/
|
||||
private String aiTargetName;
|
||||
|
||||
/**
|
||||
* AI配置数据(预留)
|
||||
*/
|
||||
private Map<String, Object> aiData;
|
||||
|
||||
/**
|
||||
* 是否操作步骤(0否 1是)
|
||||
*/
|
||||
private String isOperation;
|
||||
|
||||
/**
|
||||
* 是否叶子节点(0否 1是)
|
||||
*/
|
||||
private String isLeaf;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package org.dromara.inspection.domain.vo;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.format.DateTimeFormat;
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.inspection.domain.ArTask;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 巡检任务模板视图对象 ar_task
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = ArTask.class)
|
||||
public class ArTaskVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 任务ID
|
||||
*/
|
||||
@ExcelProperty(value = "任务ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
@ExcelProperty(value = "任务名称")
|
||||
private String taskName;
|
||||
|
||||
/**
|
||||
* 任务编码
|
||||
*/
|
||||
@ExcelProperty(value = "任务编码")
|
||||
private String taskCode;
|
||||
|
||||
/**
|
||||
* 关联区域ID
|
||||
*/
|
||||
@ExcelProperty(value = "关联区域ID")
|
||||
private Long regionId;
|
||||
|
||||
/**
|
||||
* 任务类型
|
||||
*/
|
||||
@ExcelProperty(value = "任务类型")
|
||||
private String taskType;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
@ExcelProperty(value = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 创建人账号
|
||||
*/
|
||||
@Translation(type = TransConstant.USER_ID_TO_NAME, mapper = "createBy")
|
||||
@ExcelProperty(value = "创建人")
|
||||
private String createByName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.dromara.inspection.mapper;
|
||||
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.inspection.domain.ArDevice;
|
||||
import org.dromara.inspection.domain.vo.ArDeviceVo;
|
||||
|
||||
/**
|
||||
* AR设备Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
public interface ArDeviceMapper extends BaseMapperPlus<ArDevice, ArDeviceVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.dromara.inspection.mapper;
|
||||
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.inspection.domain.ArExecution;
|
||||
import org.dromara.inspection.domain.vo.ArExecutionVo;
|
||||
|
||||
/**
|
||||
* 任务执行记录Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
public interface ArExecutionMapper extends BaseMapperPlus<ArExecution, ArExecutionVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.dromara.inspection.mapper;
|
||||
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.inspection.domain.ArPoint;
|
||||
import org.dromara.inspection.domain.vo.ArPointVo;
|
||||
|
||||
/**
|
||||
* 巡检点位Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
public interface ArPointMapper extends BaseMapperPlus<ArPoint, ArPointVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.dromara.inspection.mapper;
|
||||
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.inspection.domain.ArRegion;
|
||||
import org.dromara.inspection.domain.vo.ArRegionVo;
|
||||
|
||||
/**
|
||||
* 巡检区域Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
public interface ArRegionMapper extends BaseMapperPlus<ArRegion, ArRegionVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.dromara.inspection.mapper;
|
||||
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.inspection.domain.ArStep;
|
||||
import org.dromara.inspection.domain.vo.ArStepVo;
|
||||
|
||||
/**
|
||||
* 巡检步骤Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
public interface ArStepMapper extends BaseMapperPlus<ArStep, ArStepVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.dromara.inspection.mapper;
|
||||
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.inspection.domain.ArStepMedia;
|
||||
import org.dromara.inspection.domain.vo.ArStepMediaVo;
|
||||
|
||||
/**
|
||||
* 步骤媒体文件Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
public interface ArStepMediaMapper extends BaseMapperPlus<ArStepMedia, ArStepMediaVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.dromara.inspection.mapper;
|
||||
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.inspection.domain.ArStepRecord;
|
||||
import org.dromara.inspection.domain.vo.ArStepRecordVo;
|
||||
|
||||
/**
|
||||
* 步骤执行记录Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
public interface ArStepRecordMapper extends BaseMapperPlus<ArStepRecord, ArStepRecordVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.dromara.inspection.mapper;
|
||||
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.inspection.domain.ArTask;
|
||||
import org.dromara.inspection.domain.vo.ArTaskVo;
|
||||
|
||||
/**
|
||||
* 巡检任务模板Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
public interface ArTaskMapper extends BaseMapperPlus<ArTask, ArTaskVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package org.dromara.inspection.service;
|
||||
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.inspection.domain.bo.ArDeviceBo;
|
||||
import org.dromara.inspection.domain.vo.ArDeviceVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AR设备Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
public interface IArDeviceService {
|
||||
|
||||
/**
|
||||
* 查询单个
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ArDeviceVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
TableDataInfo<ArDeviceVo> queryPageList(ArDeviceBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
List<ArDeviceVo> queryList(ArDeviceBo bo);
|
||||
|
||||
/**
|
||||
* 根据新增业务对象插入AR设备
|
||||
*
|
||||
* @param bo AR设备新增业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean insertByBo(ArDeviceBo bo);
|
||||
|
||||
/**
|
||||
* 根据编辑业务对象修改AR设备
|
||||
*
|
||||
* @param bo AR设备编辑业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean updateByBo(ArDeviceBo bo);
|
||||
|
||||
/**
|
||||
* 校验并删除数据
|
||||
*
|
||||
* @param ids 主键集合
|
||||
* @param isValid 是否校验,true-删除前校验,false-不校验
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package org.dromara.inspection.service;
|
||||
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.inspection.domain.bo.ArExecutionBo;
|
||||
import org.dromara.inspection.domain.vo.ArExecutionVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 任务执行记录Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
public interface IArExecutionService {
|
||||
|
||||
/**
|
||||
* 查询单个
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ArExecutionVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
TableDataInfo<ArExecutionVo> queryPageList(ArExecutionBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
List<ArExecutionVo> queryList(ArExecutionBo bo);
|
||||
|
||||
/**
|
||||
* 根据新增业务对象插入任务执行记录
|
||||
*
|
||||
* @param bo 任务执行记录新增业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean insertByBo(ArExecutionBo bo);
|
||||
|
||||
/**
|
||||
* 根据编辑业务对象修改任务执行记录
|
||||
*
|
||||
* @param bo 任务执行记录编辑业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean updateByBo(ArExecutionBo bo);
|
||||
|
||||
/**
|
||||
* 校验并删除数据
|
||||
*
|
||||
* @param ids 主键集合
|
||||
* @param isValid 是否校验,true-删除前校验,false-不校验
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package org.dromara.inspection.service;
|
||||
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.inspection.domain.bo.ArPointBo;
|
||||
import org.dromara.inspection.domain.vo.ArPointVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 巡检点位Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
public interface IArPointService {
|
||||
|
||||
/**
|
||||
* 查询单个
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ArPointVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
TableDataInfo<ArPointVo> queryPageList(ArPointBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
List<ArPointVo> queryList(ArPointBo bo);
|
||||
|
||||
/**
|
||||
* 根据新增业务对象插入巡检点位
|
||||
*
|
||||
* @param bo 巡检点位新增业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean insertByBo(ArPointBo bo);
|
||||
|
||||
/**
|
||||
* 根据编辑业务对象修改巡检点位
|
||||
*
|
||||
* @param bo 巡检点位编辑业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean updateByBo(ArPointBo bo);
|
||||
|
||||
/**
|
||||
* 校验并删除数据
|
||||
*
|
||||
* @param ids 主键集合
|
||||
* @param isValid 是否校验,true-删除前校验,false-不校验
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package org.dromara.inspection.service;
|
||||
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.inspection.domain.bo.ArRegionBo;
|
||||
import org.dromara.inspection.domain.vo.ArRegionVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 巡检区域Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
public interface IArRegionService {
|
||||
|
||||
/**
|
||||
* 查询单个
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ArRegionVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
TableDataInfo<ArRegionVo> queryPageList(ArRegionBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
List<ArRegionVo> queryList(ArRegionBo bo);
|
||||
|
||||
/**
|
||||
* 根据新增业务对象插入巡检区域
|
||||
*
|
||||
* @param bo 巡检区域新增业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean insertByBo(ArRegionBo bo);
|
||||
|
||||
/**
|
||||
* 根据编辑业务对象修改巡检区域
|
||||
*
|
||||
* @param bo 巡检区域编辑业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean updateByBo(ArRegionBo bo);
|
||||
|
||||
/**
|
||||
* 校验并删除数据
|
||||
*
|
||||
* @param ids 主键集合
|
||||
* @param isValid 是否校验,true-删除前校验,false-不校验
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package org.dromara.inspection.service;
|
||||
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.inspection.domain.bo.ArStepMediaBo;
|
||||
import org.dromara.inspection.domain.vo.ArStepMediaVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 步骤媒体文件Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
public interface IArStepMediaService {
|
||||
|
||||
/**
|
||||
* 查询单个
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ArStepMediaVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
TableDataInfo<ArStepMediaVo> queryPageList(ArStepMediaBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
List<ArStepMediaVo> queryList(ArStepMediaBo bo);
|
||||
|
||||
/**
|
||||
* 根据新增业务对象插入步骤媒体文件
|
||||
*
|
||||
* @param bo 步骤媒体文件新增业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean insertByBo(ArStepMediaBo bo);
|
||||
|
||||
/**
|
||||
* 根据编辑业务对象修改步骤媒体文件
|
||||
*
|
||||
* @param bo 步骤媒体文件编辑业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean updateByBo(ArStepMediaBo bo);
|
||||
|
||||
/**
|
||||
* 校验并删除数据
|
||||
*
|
||||
* @param ids 主键集合
|
||||
* @param isValid 是否校验,true-删除前校验,false-不校验
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package org.dromara.inspection.service;
|
||||
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.inspection.domain.bo.ArStepRecordBo;
|
||||
import org.dromara.inspection.domain.vo.ArStepRecordVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 步骤执行记录Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
public interface IArStepRecordService {
|
||||
|
||||
/**
|
||||
* 查询单个
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ArStepRecordVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
TableDataInfo<ArStepRecordVo> queryPageList(ArStepRecordBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
List<ArStepRecordVo> queryList(ArStepRecordBo bo);
|
||||
|
||||
/**
|
||||
* 根据新增业务对象插入步骤执行记录
|
||||
*
|
||||
* @param bo 步骤执行记录新增业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean insertByBo(ArStepRecordBo bo);
|
||||
|
||||
/**
|
||||
* 根据编辑业务对象修改步骤执行记录
|
||||
*
|
||||
* @param bo 步骤执行记录编辑业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean updateByBo(ArStepRecordBo bo);
|
||||
|
||||
/**
|
||||
* 校验并删除数据
|
||||
*
|
||||
* @param ids 主键集合
|
||||
* @param isValid 是否校验,true-删除前校验,false-不校验
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package org.dromara.inspection.service;
|
||||
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.inspection.domain.bo.ArStepBo;
|
||||
import org.dromara.inspection.domain.vo.ArStepTreeVo;
|
||||
import org.dromara.inspection.domain.vo.ArStepVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 巡检步骤Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
public interface IArStepService {
|
||||
|
||||
/**
|
||||
* 查询单个
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ArStepVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
TableDataInfo<ArStepVo> queryPageList(ArStepBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
List<ArStepVo> queryList(ArStepBo bo);
|
||||
|
||||
/**
|
||||
* 查询任务的步骤树
|
||||
*
|
||||
* @param taskId 任务ID
|
||||
* @return 步骤树列表
|
||||
*/
|
||||
List<ArStepTreeVo> queryStepTree(Long taskId);
|
||||
|
||||
/**
|
||||
* 根据新增业务对象插入巡检步骤
|
||||
*
|
||||
* @param bo 巡检步骤新增业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean insertByBo(ArStepBo bo);
|
||||
|
||||
/**
|
||||
* 根据编辑业务对象修改巡检步骤
|
||||
*
|
||||
* @param bo 巡检步骤编辑业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean updateByBo(ArStepBo bo);
|
||||
|
||||
/**
|
||||
* 校验并删除数据
|
||||
*
|
||||
* @param ids 主键集合
|
||||
* @param isValid 是否校验,true-删除前校验,false-不校验
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package org.dromara.inspection.service;
|
||||
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.inspection.domain.bo.ArTaskBo;
|
||||
import org.dromara.inspection.domain.vo.ArTaskVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 巡检任务模板Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
public interface IArTaskService {
|
||||
|
||||
/**
|
||||
* 查询单个
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ArTaskVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
TableDataInfo<ArTaskVo> queryPageList(ArTaskBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
List<ArTaskVo> queryList(ArTaskBo bo);
|
||||
|
||||
/**
|
||||
* 根据新增业务对象插入巡检任务模板
|
||||
*
|
||||
* @param bo 巡检任务模板新增业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean insertByBo(ArTaskBo bo);
|
||||
|
||||
/**
|
||||
* 根据编辑业务对象修改巡检任务模板
|
||||
*
|
||||
* @param bo 巡检任务模板编辑业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean updateByBo(ArTaskBo bo);
|
||||
|
||||
/**
|
||||
* 校验并删除数据
|
||||
*
|
||||
* @param ids 主键集合
|
||||
* @param isValid 是否校验,true-删除前校验,false-不校验
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package org.dromara.inspection.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.inspection.domain.ArDevice;
|
||||
import org.dromara.inspection.domain.bo.ArDeviceBo;
|
||||
import org.dromara.inspection.domain.vo.ArDeviceVo;
|
||||
import org.dromara.inspection.mapper.ArDeviceMapper;
|
||||
import org.dromara.inspection.service.IArDeviceService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* AR设备Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ArDeviceServiceImpl implements IArDeviceService {
|
||||
|
||||
private final ArDeviceMapper baseMapper;
|
||||
|
||||
@Override
|
||||
public ArDeviceVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<ArDeviceVo> queryPageList(ArDeviceBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<ArDevice> lqw = buildQueryWrapper(bo);
|
||||
Page<ArDeviceVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ArDeviceVo> queryList(ArDeviceBo bo) {
|
||||
return baseMapper.selectVoList(buildQueryWrapper(bo));
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<ArDevice> buildQueryWrapper(ArDeviceBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<ArDevice> lqw = Wrappers.lambdaQuery();
|
||||
lqw.like(StringUtils.isNotBlank(bo.getDeviceName()), ArDevice::getDeviceName, bo.getDeviceName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDeviceNo()), ArDevice::getDeviceNo, bo.getDeviceNo());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getDeviceModel()), ArDevice::getDeviceModel, bo.getDeviceModel());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), ArDevice::getStatus, bo.getStatus());
|
||||
lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null,
|
||||
ArDevice::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime"));
|
||||
lqw.orderByDesc(ArDevice::getCreateTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insertByBo(ArDeviceBo bo) {
|
||||
ArDevice add = MapstructUtils.convert(bo, ArDevice.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateByBo(ArDeviceBo bo) {
|
||||
ArDevice update = MapstructUtils.convert(bo, ArDevice.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*
|
||||
* @param entity 实体类数据
|
||||
*/
|
||||
private void validEntityBeforeSave(ArDevice entity) {
|
||||
// 校验设备编号唯一性
|
||||
if (StringUtils.isNotBlank(entity.getDeviceNo())) {
|
||||
LambdaQueryWrapper<ArDevice> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(ArDevice::getDeviceNo, entity.getDeviceNo());
|
||||
if (entity.getId() != null) {
|
||||
lqw.ne(ArDevice::getId, entity.getId());
|
||||
}
|
||||
long count = baseMapper.selectCount(lqw);
|
||||
if (count > 0) {
|
||||
throw new ServiceException("设备编号已存在!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// 校验是否有权限删除
|
||||
List<ArDevice> list = baseMapper.selectByIds(ids);
|
||||
if (list.size() != ids.size()) {
|
||||
throw new ServiceException("您没有删除权限!");
|
||||
}
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
package org.dromara.inspection.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.inspection.domain.ArExecution;
|
||||
import org.dromara.inspection.domain.bo.ArExecutionBo;
|
||||
import org.dromara.inspection.domain.vo.ArExecutionVo;
|
||||
import org.dromara.inspection.mapper.ArExecutionMapper;
|
||||
import org.dromara.inspection.service.IArExecutionService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 任务执行记录Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ArExecutionServiceImpl implements IArExecutionService {
|
||||
|
||||
private final ArExecutionMapper baseMapper;
|
||||
|
||||
@Override
|
||||
public ArExecutionVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<ArExecutionVo> queryPageList(ArExecutionBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<ArExecution> lqw = buildQueryWrapper(bo);
|
||||
Page<ArExecutionVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ArExecutionVo> queryList(ArExecutionBo bo) {
|
||||
return baseMapper.selectVoList(buildQueryWrapper(bo));
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<ArExecution> buildQueryWrapper(ArExecutionBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<ArExecution> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getTaskId() != null, ArExecution::getTaskId, bo.getTaskId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getExecutionCode()), ArExecution::getExecutionCode, bo.getExecutionCode());
|
||||
lqw.eq(bo.getRegionId() != null, ArExecution::getRegionId, bo.getRegionId());
|
||||
lqw.eq(bo.getDeviceId() != null, ArExecution::getDeviceId, bo.getDeviceId());
|
||||
lqw.eq(bo.getOperatorId() != null, ArExecution::getOperatorId, bo.getOperatorId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), ArExecution::getStatus, bo.getStatus());
|
||||
lqw.between(params.get("beginStartTime") != null && params.get("endStartTime") != null,
|
||||
ArExecution::getStartTime, params.get("beginStartTime"), params.get("endStartTime"));
|
||||
lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null,
|
||||
ArExecution::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime"));
|
||||
lqw.orderByDesc(ArExecution::getCreateTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insertByBo(ArExecutionBo bo) {
|
||||
ArExecution add = MapstructUtils.convert(bo, ArExecution.class);
|
||||
validEntityBeforeSave(add);
|
||||
// 自动设置执行编号
|
||||
if (StringUtils.isBlank(add.getExecutionCode())) {
|
||||
add.setExecutionCode("EXE-" + System.currentTimeMillis());
|
||||
}
|
||||
// 设置初始状态
|
||||
if (StringUtils.isBlank(add.getStatus())) {
|
||||
add.setStatus("pending");
|
||||
}
|
||||
// 设置初始步骤数
|
||||
if (add.getTotalSteps() == null) {
|
||||
add.setTotalSteps(0);
|
||||
}
|
||||
if (add.getCompletedSteps() == null) {
|
||||
add.setCompletedSteps(0);
|
||||
}
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateByBo(ArExecutionBo bo) {
|
||||
ArExecution update = MapstructUtils.convert(bo, ArExecution.class);
|
||||
validEntityBeforeSave(update);
|
||||
// 如果状态变为 in_progress 且没有开始时间,自动设置
|
||||
if ("in_progress".equals(update.getStatus()) && update.getStartTime() == null) {
|
||||
update.setStartTime(new Date());
|
||||
}
|
||||
// 如果状态变为 completed 或 cancelled 且没有结束时间,自动设置
|
||||
if (("completed".equals(update.getStatus()) || "cancelled".equals(update.getStatus()))
|
||||
&& update.getEndTime() == null) {
|
||||
update.setEndTime(new Date());
|
||||
}
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*
|
||||
* @param entity 实体类数据
|
||||
*/
|
||||
private void validEntityBeforeSave(ArExecution entity) {
|
||||
// 校验执行编号唯一性
|
||||
if (StringUtils.isNotBlank(entity.getExecutionCode())) {
|
||||
LambdaQueryWrapper<ArExecution> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(ArExecution::getExecutionCode, entity.getExecutionCode());
|
||||
if (entity.getId() != null) {
|
||||
lqw.ne(ArExecution::getId, entity.getId());
|
||||
}
|
||||
long count = baseMapper.selectCount(lqw);
|
||||
if (count > 0) {
|
||||
throw new ServiceException("执行编号已存在!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// 校验是否有权限删除
|
||||
List<ArExecution> list = baseMapper.selectByIds(ids);
|
||||
if (list.size() != ids.size()) {
|
||||
throw new ServiceException("您没有删除权限!");
|
||||
}
|
||||
// TODO: 检查是否有关联的步骤记录,有则提示
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package org.dromara.inspection.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.inspection.domain.ArPoint;
|
||||
import org.dromara.inspection.domain.bo.ArPointBo;
|
||||
import org.dromara.inspection.domain.vo.ArPointVo;
|
||||
import org.dromara.inspection.mapper.ArPointMapper;
|
||||
import org.dromara.inspection.service.IArPointService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 巡检点位Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ArPointServiceImpl implements IArPointService {
|
||||
|
||||
private final ArPointMapper baseMapper;
|
||||
|
||||
@Override
|
||||
public ArPointVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<ArPointVo> queryPageList(ArPointBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<ArPoint> lqw = buildQueryWrapper(bo);
|
||||
Page<ArPointVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ArPointVo> queryList(ArPointBo bo) {
|
||||
return baseMapper.selectVoList(buildQueryWrapper(bo));
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<ArPoint> buildQueryWrapper(ArPointBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<ArPoint> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getRegionId() != null, ArPoint::getRegionId, bo.getRegionId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getPointName()), ArPoint::getPointName, bo.getPointName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPointCode()), ArPoint::getPointCode, bo.getPointCode());
|
||||
lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null,
|
||||
ArPoint::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime"));
|
||||
lqw.orderByDesc(ArPoint::getCreateTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insertByBo(ArPointBo bo) {
|
||||
ArPoint add = MapstructUtils.convert(bo, ArPoint.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateByBo(ArPointBo bo) {
|
||||
ArPoint update = MapstructUtils.convert(bo, ArPoint.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*
|
||||
* @param entity 实体类数据
|
||||
*/
|
||||
private void validEntityBeforeSave(ArPoint entity) {
|
||||
// 校验点位编码唯一性(同一区域内)
|
||||
if (StringUtils.isNotBlank(entity.getPointCode())) {
|
||||
LambdaQueryWrapper<ArPoint> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(ArPoint::getRegionId, entity.getRegionId());
|
||||
lqw.eq(ArPoint::getPointCode, entity.getPointCode());
|
||||
if (entity.getId() != null) {
|
||||
lqw.ne(ArPoint::getId, entity.getId());
|
||||
}
|
||||
long count = baseMapper.selectCount(lqw);
|
||||
if (count > 0) {
|
||||
throw new ServiceException("该区域内点位编码已存在!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// 校验是否有权限删除
|
||||
List<ArPoint> list = baseMapper.selectByIds(ids);
|
||||
if (list.size() != ids.size()) {
|
||||
throw new ServiceException("您没有删除权限!");
|
||||
}
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package org.dromara.inspection.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.inspection.domain.ArRegion;
|
||||
import org.dromara.inspection.domain.bo.ArRegionBo;
|
||||
import org.dromara.inspection.domain.vo.ArRegionVo;
|
||||
import org.dromara.inspection.mapper.ArRegionMapper;
|
||||
import org.dromara.inspection.service.IArRegionService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 巡检区域Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ArRegionServiceImpl implements IArRegionService {
|
||||
|
||||
private final ArRegionMapper baseMapper;
|
||||
|
||||
@Override
|
||||
public ArRegionVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<ArRegionVo> queryPageList(ArRegionBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<ArRegion> lqw = buildQueryWrapper(bo);
|
||||
Page<ArRegionVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ArRegionVo> queryList(ArRegionBo bo) {
|
||||
return baseMapper.selectVoList(buildQueryWrapper(bo));
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<ArRegion> buildQueryWrapper(ArRegionBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<ArRegion> lqw = Wrappers.lambdaQuery();
|
||||
lqw.like(StringUtils.isNotBlank(bo.getRegionName()), ArRegion::getRegionName, bo.getRegionName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRegionCode()), ArRegion::getRegionCode, bo.getRegionCode());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), ArRegion::getStatus, bo.getStatus());
|
||||
lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null,
|
||||
ArRegion::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime"));
|
||||
lqw.orderByDesc(ArRegion::getCreateTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insertByBo(ArRegionBo bo) {
|
||||
ArRegion add = MapstructUtils.convert(bo, ArRegion.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateByBo(ArRegionBo bo) {
|
||||
ArRegion update = MapstructUtils.convert(bo, ArRegion.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*
|
||||
* @param entity 实体类数据
|
||||
*/
|
||||
private void validEntityBeforeSave(ArRegion entity) {
|
||||
// 校验区域编码唯一性
|
||||
if (StringUtils.isNotBlank(entity.getRegionCode())) {
|
||||
LambdaQueryWrapper<ArRegion> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(ArRegion::getRegionCode, entity.getRegionCode());
|
||||
if (entity.getId() != null) {
|
||||
lqw.ne(ArRegion::getId, entity.getId());
|
||||
}
|
||||
long count = baseMapper.selectCount(lqw);
|
||||
if (count > 0) {
|
||||
throw new ServiceException("区域编码已存在!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// 校验是否有权限删除
|
||||
List<ArRegion> list = baseMapper.selectByIds(ids);
|
||||
if (list.size() != ids.size()) {
|
||||
throw new ServiceException("您没有删除权限!");
|
||||
}
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package org.dromara.inspection.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.inspection.domain.ArStepMedia;
|
||||
import org.dromara.inspection.domain.bo.ArStepMediaBo;
|
||||
import org.dromara.inspection.domain.vo.ArStepMediaVo;
|
||||
import org.dromara.inspection.mapper.ArStepMediaMapper;
|
||||
import org.dromara.inspection.service.IArStepMediaService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 步骤媒体文件Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ArStepMediaServiceImpl implements IArStepMediaService {
|
||||
|
||||
private final ArStepMediaMapper baseMapper;
|
||||
|
||||
@Override
|
||||
public ArStepMediaVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<ArStepMediaVo> queryPageList(ArStepMediaBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<ArStepMedia> lqw = buildQueryWrapper(bo);
|
||||
Page<ArStepMediaVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ArStepMediaVo> queryList(ArStepMediaBo bo) {
|
||||
return baseMapper.selectVoList(buildQueryWrapper(bo));
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<ArStepMedia> buildQueryWrapper(ArStepMediaBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<ArStepMedia> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getStepRecordId() != null, ArStepMedia::getStepRecordId, bo.getStepRecordId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMediaType()), ArStepMedia::getMediaType, bo.getMediaType());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getFileName()), ArStepMedia::getFileName, bo.getFileName());
|
||||
lqw.between(params.get("beginUploadTime") != null && params.get("endUploadTime") != null,
|
||||
ArStepMedia::getUploadTime, params.get("beginUploadTime"), params.get("endUploadTime"));
|
||||
lqw.orderByDesc(ArStepMedia::getUploadTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insertByBo(ArStepMediaBo bo) {
|
||||
ArStepMedia add = MapstructUtils.convert(bo, ArStepMedia.class);
|
||||
validEntityBeforeSave(add);
|
||||
// 自动设置上传时间
|
||||
if (add.getUploadTime() == null) {
|
||||
add.setUploadTime(new Date());
|
||||
}
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateByBo(ArStepMediaBo bo) {
|
||||
ArStepMedia update = MapstructUtils.convert(bo, ArStepMedia.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*
|
||||
* @param entity 实体类数据
|
||||
*/
|
||||
private void validEntityBeforeSave(ArStepMedia entity) {
|
||||
// TODO: 业务校验
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// 校验是否有权限删除
|
||||
List<ArStepMedia> list = baseMapper.selectByIds(ids);
|
||||
if (list.size() != ids.size()) {
|
||||
throw new ServiceException("您没有删除权限!");
|
||||
}
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package org.dromara.inspection.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.inspection.domain.ArStepRecord;
|
||||
import org.dromara.inspection.domain.bo.ArStepRecordBo;
|
||||
import org.dromara.inspection.domain.vo.ArStepRecordVo;
|
||||
import org.dromara.inspection.mapper.ArStepRecordMapper;
|
||||
import org.dromara.inspection.service.IArStepRecordService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 步骤执行记录Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ArStepRecordServiceImpl implements IArStepRecordService {
|
||||
|
||||
private final ArStepRecordMapper baseMapper;
|
||||
|
||||
@Override
|
||||
public ArStepRecordVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<ArStepRecordVo> queryPageList(ArStepRecordBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<ArStepRecord> lqw = buildQueryWrapper(bo);
|
||||
Page<ArStepRecordVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ArStepRecordVo> queryList(ArStepRecordBo bo) {
|
||||
return baseMapper.selectVoList(buildQueryWrapper(bo));
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<ArStepRecord> buildQueryWrapper(ArStepRecordBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<ArStepRecord> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getExecutionId() != null, ArStepRecord::getExecutionId, bo.getExecutionId());
|
||||
lqw.eq(bo.getStepId() != null, ArStepRecord::getStepId, bo.getStepId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), ArStepRecord::getStatus, bo.getStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getIsDone()), ArStepRecord::getIsDone, bo.getIsDone());
|
||||
lqw.eq(bo.getExecutorId() != null, ArStepRecord::getExecutorId, bo.getExecutorId());
|
||||
lqw.between(params.get("beginStartTime") != null && params.get("endStartTime") != null,
|
||||
ArStepRecord::getStartTime, params.get("beginStartTime"), params.get("endStartTime"));
|
||||
lqw.between(params.get("beginCompletionTime") != null && params.get("endCompletionTime") != null,
|
||||
ArStepRecord::getCompletionTime, params.get("beginCompletionTime"), params.get("endCompletionTime"));
|
||||
lqw.orderByDesc(ArStepRecord::getCreateTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insertByBo(ArStepRecordBo bo) {
|
||||
ArStepRecord add = MapstructUtils.convert(bo, ArStepRecord.class);
|
||||
validEntityBeforeSave(add);
|
||||
// 设置初始状态
|
||||
if (StringUtils.isBlank(add.getStatus())) {
|
||||
add.setStatus("pending");
|
||||
}
|
||||
if (StringUtils.isBlank(add.getIsDone())) {
|
||||
add.setIsDone("0");
|
||||
}
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateByBo(ArStepRecordBo bo) {
|
||||
ArStepRecord update = MapstructUtils.convert(bo, ArStepRecord.class);
|
||||
validEntityBeforeSave(update);
|
||||
// 如果状态变为 completed 且没有完成时间,自动设置
|
||||
if ("completed".equals(update.getStatus()) && update.getCompletionTime() == null) {
|
||||
update.setCompletionTime(new Date());
|
||||
update.setIsDone("1");
|
||||
// 计算耗时
|
||||
if (update.getStartTime() != null) {
|
||||
long duration = (update.getCompletionTime().getTime() - update.getStartTime().getTime()) / 1000;
|
||||
update.setDuration((int) duration);
|
||||
}
|
||||
}
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*
|
||||
* @param entity 实体类数据
|
||||
*/
|
||||
private void validEntityBeforeSave(ArStepRecord entity) {
|
||||
// TODO: 业务校验
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// 校验是否有权限删除
|
||||
List<ArStepRecord> list = baseMapper.selectByIds(ids);
|
||||
if (list.size() != ids.size()) {
|
||||
throw new ServiceException("您没有删除权限!");
|
||||
}
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
package org.dromara.inspection.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.inspection.domain.ArStep;
|
||||
import org.dromara.inspection.domain.bo.ArStepBo;
|
||||
import org.dromara.inspection.domain.vo.ArStepTreeVo;
|
||||
import org.dromara.inspection.domain.vo.ArStepVo;
|
||||
import org.dromara.inspection.mapper.ArStepMapper;
|
||||
import org.dromara.inspection.service.IArStepService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 巡检步骤Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ArStepServiceImpl implements IArStepService {
|
||||
|
||||
private final ArStepMapper baseMapper;
|
||||
|
||||
@Override
|
||||
public ArStepVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<ArStepVo> queryPageList(ArStepBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<ArStep> lqw = buildQueryWrapper(bo);
|
||||
Page<ArStepVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ArStepVo> queryList(ArStepBo bo) {
|
||||
return baseMapper.selectVoList(buildQueryWrapper(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询任务的步骤树
|
||||
*
|
||||
* @param taskId 任务ID
|
||||
* @return 步骤树列表
|
||||
*/
|
||||
@Override
|
||||
public List<ArStepTreeVo> queryStepTree(Long taskId) {
|
||||
// 查询所有步骤
|
||||
LambdaQueryWrapper<ArStep> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(ArStep::getTaskId, taskId);
|
||||
lqw.orderByAsc(ArStep::getOrderNum);
|
||||
List<ArStepVo> allSteps = baseMapper.selectVoList(lqw);
|
||||
|
||||
// 构建树形结构
|
||||
return buildStepTree(allSteps, 0L);
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归构建步骤树
|
||||
*
|
||||
* @param allSteps 所有步骤列表
|
||||
* @param parentId 父步骤ID
|
||||
* @return 树形步骤列表
|
||||
*/
|
||||
private List<ArStepTreeVo> buildStepTree(List<ArStepVo> allSteps, Long parentId) {
|
||||
List<ArStepTreeVo> tree = new ArrayList<>();
|
||||
for (ArStepVo step : allSteps) {
|
||||
if (step.getParentId().equals(parentId)) {
|
||||
ArStepTreeVo treeNode = new ArStepTreeVo();
|
||||
BeanUtils.copyProperties(step, treeNode);
|
||||
// 递归查找子节点
|
||||
List<ArStepTreeVo> children = buildStepTree(allSteps, step.getId());
|
||||
treeNode.setChildren(children);
|
||||
tree.add(treeNode);
|
||||
}
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<ArStep> buildQueryWrapper(ArStepBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<ArStep> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getTaskId() != null, ArStep::getTaskId, bo.getTaskId());
|
||||
lqw.eq(bo.getParentId() != null, ArStep::getParentId, bo.getParentId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getStepName()), ArStep::getStepName, bo.getStepName());
|
||||
lqw.eq(bo.getPointId() != null, ArStep::getPointId, bo.getPointId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getIsOperation()), ArStep::getIsOperation, bo.getIsOperation());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getIsLeaf()), ArStep::getIsLeaf, bo.getIsLeaf());
|
||||
lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null,
|
||||
ArStep::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime"));
|
||||
lqw.orderByAsc(ArStep::getOrderNum);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insertByBo(ArStepBo bo) {
|
||||
ArStep add = MapstructUtils.convert(bo, ArStep.class);
|
||||
validEntityBeforeSave(add);
|
||||
// 自动设置 ancestors
|
||||
if (add.getParentId() != null && add.getParentId() != 0) {
|
||||
ArStep parent = baseMapper.selectById(add.getParentId());
|
||||
if (parent != null) {
|
||||
add.setAncestors(parent.getAncestors() + "," + add.getParentId());
|
||||
} else {
|
||||
add.setAncestors(String.valueOf(add.getParentId()));
|
||||
}
|
||||
} else {
|
||||
add.setAncestors("0");
|
||||
}
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateByBo(ArStepBo bo) {
|
||||
ArStep update = MapstructUtils.convert(bo, ArStep.class);
|
||||
validEntityBeforeSave(update);
|
||||
// 更新 ancestors(如果父节点变更)
|
||||
ArStep old = baseMapper.selectById(update.getId());
|
||||
if (old != null && !old.getParentId().equals(update.getParentId())) {
|
||||
if (update.getParentId() != null && update.getParentId() != 0) {
|
||||
ArStep parent = baseMapper.selectById(update.getParentId());
|
||||
if (parent != null) {
|
||||
update.setAncestors(parent.getAncestors() + "," + update.getParentId());
|
||||
} else {
|
||||
update.setAncestors(String.valueOf(update.getParentId()));
|
||||
}
|
||||
} else {
|
||||
update.setAncestors("0");
|
||||
}
|
||||
}
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*
|
||||
* @param entity 实体类数据
|
||||
*/
|
||||
private void validEntityBeforeSave(ArStep entity) {
|
||||
// 校验父节点是否存在
|
||||
if (entity.getParentId() != null && entity.getParentId() != 0) {
|
||||
ArStep parent = baseMapper.selectById(entity.getParentId());
|
||||
if (parent == null) {
|
||||
throw new ServiceException("父步骤不存在!");
|
||||
}
|
||||
// 校验父节点是否属于同一任务
|
||||
if (!parent.getTaskId().equals(entity.getTaskId())) {
|
||||
throw new ServiceException("父步骤必须属于同一任务!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// 校验是否有权限删除
|
||||
List<ArStep> list = baseMapper.selectByIds(ids);
|
||||
if (list.size() != ids.size()) {
|
||||
throw new ServiceException("您没有删除权限!");
|
||||
}
|
||||
// 校验是否有子步骤,有则级联删除
|
||||
for (Long id : ids) {
|
||||
LambdaQueryWrapper<ArStep> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(ArStep::getParentId, id);
|
||||
long count = baseMapper.selectCount(lqw);
|
||||
if (count > 0) {
|
||||
// 级联删除子步骤
|
||||
List<ArStep> children = baseMapper.selectList(lqw);
|
||||
List<Long> childrenIds = children.stream().map(ArStep::getId).toList();
|
||||
deleteWithValidByIds(childrenIds, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package org.dromara.inspection.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.inspection.domain.ArTask;
|
||||
import org.dromara.inspection.domain.bo.ArTaskBo;
|
||||
import org.dromara.inspection.domain.vo.ArTaskVo;
|
||||
import org.dromara.inspection.mapper.ArTaskMapper;
|
||||
import org.dromara.inspection.service.IArTaskService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 巡检任务模板Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-13
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ArTaskServiceImpl implements IArTaskService {
|
||||
|
||||
private final ArTaskMapper baseMapper;
|
||||
|
||||
@Override
|
||||
public ArTaskVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<ArTaskVo> queryPageList(ArTaskBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<ArTask> lqw = buildQueryWrapper(bo);
|
||||
Page<ArTaskVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ArTaskVo> queryList(ArTaskBo bo) {
|
||||
return baseMapper.selectVoList(buildQueryWrapper(bo));
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<ArTask> buildQueryWrapper(ArTaskBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<ArTask> lqw = Wrappers.lambdaQuery();
|
||||
lqw.like(StringUtils.isNotBlank(bo.getTaskName()), ArTask::getTaskName, bo.getTaskName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTaskCode()), ArTask::getTaskCode, bo.getTaskCode());
|
||||
lqw.eq(bo.getRegionId() != null, ArTask::getRegionId, bo.getRegionId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTaskType()), ArTask::getTaskType, bo.getTaskType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), ArTask::getStatus, bo.getStatus());
|
||||
lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null,
|
||||
ArTask::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime"));
|
||||
lqw.orderByDesc(ArTask::getCreateTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insertByBo(ArTaskBo bo) {
|
||||
ArTask add = MapstructUtils.convert(bo, ArTask.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateByBo(ArTaskBo bo) {
|
||||
ArTask update = MapstructUtils.convert(bo, ArTask.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*
|
||||
* @param entity 实体类数据
|
||||
*/
|
||||
private void validEntityBeforeSave(ArTask entity) {
|
||||
// 校验任务编码唯一性
|
||||
if (StringUtils.isNotBlank(entity.getTaskCode())) {
|
||||
LambdaQueryWrapper<ArTask> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(ArTask::getTaskCode, entity.getTaskCode());
|
||||
if (entity.getId() != null) {
|
||||
lqw.ne(ArTask::getId, entity.getId());
|
||||
}
|
||||
long count = baseMapper.selectCount(lqw);
|
||||
if (count > 0) {
|
||||
throw new ServiceException("任务编码已存在!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// 校验是否有权限删除
|
||||
List<ArTask> list = baseMapper.selectByIds(ids);
|
||||
if (list.size() != ids.size()) {
|
||||
throw new ServiceException("您没有删除权限!");
|
||||
}
|
||||
// TODO: 校验是否有关联的步骤,有则不允许删除
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user