Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@ -29,5 +29,6 @@ mybatis-plus:
|
|||||||
# 逻辑未删除值
|
# 逻辑未删除值
|
||||||
logicNotDeleteValue: 0
|
logicNotDeleteValue: 0
|
||||||
insertStrategy: NOT_NULL
|
insertStrategy: NOT_NULL
|
||||||
updateStrategy: NOT_NULL
|
# updateStrategy: NOT_NULL
|
||||||
|
updateStrategy: ALWAYS
|
||||||
whereStrategy: NOT_NULL
|
whereStrategy: NOT_NULL
|
||||||
|
|||||||
@ -0,0 +1,108 @@
|
|||||||
|
package org.dromara.inspection.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
|
import org.dromara.common.log.annotation.Log;
|
||||||
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
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.log.enums.BusinessType;
|
||||||
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
|
import org.dromara.inspection.domain.vo.OpsInspectionNodeVo;
|
||||||
|
import org.dromara.inspection.domain.bo.OpsInspectionNodeBo;
|
||||||
|
import org.dromara.inspection.service.IOpsInspectionNodeService;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-巡检-通用节点
|
||||||
|
* 前端访问路由地址为:/inspection/node
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-23
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/node")
|
||||||
|
public class OpsInspectionNodeController extends BaseController {
|
||||||
|
|
||||||
|
private final IOpsInspectionNodeService opsInspectionNodeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询运维-巡检-通用节点列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("inspection:node:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<OpsInspectionNodeVo> list(OpsInspectionNodeBo bo, PageQuery pageQuery) {
|
||||||
|
return opsInspectionNodeService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出运维-巡检-通用节点列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("inspection:node:export")
|
||||||
|
@Log(title = "运维-巡检-通用节点", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(OpsInspectionNodeBo bo, HttpServletResponse response) {
|
||||||
|
List<OpsInspectionNodeVo> list = opsInspectionNodeService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "运维-巡检-通用节点", OpsInspectionNodeVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取运维-巡检-通用节点详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("inspection:node:query")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<OpsInspectionNodeVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable("id") Long id) {
|
||||||
|
return R.ok(opsInspectionNodeService.queryById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增运维-巡检-通用节点
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("inspection:node:add")
|
||||||
|
@Log(title = "运维-巡检-通用节点", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
@Transactional
|
||||||
|
public R<String> add(@Validated(AddGroup.class) @RequestBody List<OpsInspectionNodeBo> bo) {
|
||||||
|
return opsInspectionNodeService.insertByBo(bo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改运维-巡检-通用节点
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("inspection:node:edit")
|
||||||
|
@Log(title = "运维-巡检-通用节点", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody List<OpsInspectionNodeBo> bo) {
|
||||||
|
return toAjax(opsInspectionNodeService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除运维-巡检-通用节点
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("inspection:node:remove")
|
||||||
|
@Log(title = "运维-巡检-通用节点", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable("ids") Long[] ids) {
|
||||||
|
return toAjax(opsInspectionNodeService.deleteWithValidByIds(List.of(ids), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,117 @@
|
|||||||
|
package org.dromara.inspection.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.dromara.inspection.domain.vo.OrderRecordVo;
|
||||||
|
import org.dromara.inspection.service.impl.OpsInspectionOrderServiceImpl;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
|
import org.dromara.common.log.annotation.Log;
|
||||||
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
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.log.enums.BusinessType;
|
||||||
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
|
import org.dromara.inspection.domain.vo.OpsInspectionOrderVo;
|
||||||
|
import org.dromara.inspection.domain.bo.OpsInspectionOrderBo;
|
||||||
|
import org.dromara.inspection.service.IOpsInspectionOrderService;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-巡检-工单
|
||||||
|
* 前端访问路由地址为:/inspection/order
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-23
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/order")
|
||||||
|
public class OpsInspectionOrderController extends BaseController {
|
||||||
|
|
||||||
|
private final OpsInspectionOrderServiceImpl opsInspectionOrderService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询运维-巡检-工单列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("inspection:order:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<OpsInspectionOrderVo> list(OpsInspectionOrderBo bo, PageQuery pageQuery) {
|
||||||
|
return opsInspectionOrderService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出运维-巡检-工单列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("inspection:order:export")
|
||||||
|
@Log(title = "运维-巡检-工单", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(OpsInspectionOrderBo bo, HttpServletResponse response) {
|
||||||
|
List<OpsInspectionOrderVo> list = opsInspectionOrderService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "运维-巡检-工单", OpsInspectionOrderVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取运维-巡检-工单详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("inspection:order:query")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<OpsInspectionOrderVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable("id") Long id) {
|
||||||
|
return R.ok(opsInspectionOrderService.queryById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增运维-巡检-工单
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("inspection:order:add")
|
||||||
|
@Log(title = "运维-巡检-工单", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody OpsInspectionOrderBo bo) {
|
||||||
|
return toAjax(opsInspectionOrderService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改运维-巡检-工单
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("inspection:order:edit")
|
||||||
|
@Log(title = "运维-巡检-工单", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody OpsInspectionOrderBo bo) {
|
||||||
|
return toAjax(opsInspectionOrderService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除运维-巡检-工单
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("inspection:order:remove")
|
||||||
|
@Log(title = "运维-巡检-工单", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable("ids") Long[] ids) {
|
||||||
|
return toAjax(opsInspectionOrderService.deleteWithValidByIds(List.of(ids), true));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取纪录
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("inspection:order:record")
|
||||||
|
@GetMapping("/record")
|
||||||
|
public R<OrderRecordVo> record(Long projectId) {
|
||||||
|
return opsInspectionOrderService.record(projectId);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -89,7 +89,7 @@ public class OpsInspectionTaskController extends BaseController {
|
|||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PutMapping()
|
@PutMapping()
|
||||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody OpsInspectionTaskBo bo) {
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody OpsInspectionTaskBo bo) {
|
||||||
return toAjax(opsInspectionTaskService.updateByBo(bo));
|
return opsInspectionTaskService.updateByBo(bo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -0,0 +1,106 @@
|
|||||||
|
package org.dromara.inspection.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
|
import org.dromara.common.log.annotation.Log;
|
||||||
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
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.log.enums.BusinessType;
|
||||||
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
|
import org.dromara.inspection.domain.vo.OpsInspectionTaskProblemVo;
|
||||||
|
import org.dromara.inspection.domain.bo.OpsInspectionTaskProblemBo;
|
||||||
|
import org.dromara.inspection.service.IOpsInspectionTaskProblemService;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-巡检-任务-问题
|
||||||
|
* 前端访问路由地址为:/inspection/problem
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-26
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/problem")
|
||||||
|
public class OpsInspectionTaskProblemController extends BaseController {
|
||||||
|
|
||||||
|
private final IOpsInspectionTaskProblemService opsInspectionTaskProblemService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询运维-巡检-任务-问题列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("inspection:problem:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<OpsInspectionTaskProblemVo> list(OpsInspectionTaskProblemBo bo, PageQuery pageQuery) {
|
||||||
|
return opsInspectionTaskProblemService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出运维-巡检-任务-问题列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("inspection:problem:export")
|
||||||
|
@Log(title = "运维-巡检-任务-问题", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(OpsInspectionTaskProblemBo bo, HttpServletResponse response) {
|
||||||
|
List<OpsInspectionTaskProblemVo> list = opsInspectionTaskProblemService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "运维-巡检-任务-问题", OpsInspectionTaskProblemVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取运维-巡检-任务-问题详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("inspection:problem:query")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<OpsInspectionTaskProblemVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable("id") Long id) {
|
||||||
|
return R.ok(opsInspectionTaskProblemService.queryById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增运维-巡检-任务-问题
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("inspection:problem:add")
|
||||||
|
@Log(title = "运维-巡检-任务-问题", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody OpsInspectionTaskProblemBo bo) {
|
||||||
|
return toAjax(opsInspectionTaskProblemService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改运维-巡检-任务-问题
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("inspection:problem:edit")
|
||||||
|
@Log(title = "运维-巡检-任务-问题", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody OpsInspectionTaskProblemBo bo) {
|
||||||
|
return toAjax(opsInspectionTaskProblemService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除运维-巡检-任务-问题
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("inspection:problem:remove")
|
||||||
|
@Log(title = "运维-巡检-任务-问题", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable("ids") Long[] ids) {
|
||||||
|
return toAjax(opsInspectionTaskProblemService.deleteWithValidByIds(List.of(ids), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -89,7 +89,7 @@ public class OpsInspectionTestTaskController extends BaseController {
|
|||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PutMapping()
|
@PutMapping()
|
||||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody OpsInspectionTestTaskBo bo) {
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody OpsInspectionTestTaskBo bo) {
|
||||||
return toAjax(opsInspectionTestTaskService.updateByBo(bo));
|
return opsInspectionTestTaskService.updateByBo(bo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -110,11 +110,11 @@ public class OpsInspectionTestTaskController extends BaseController {
|
|||||||
*
|
*
|
||||||
* @param projectId 项目ID
|
* @param projectId 项目ID
|
||||||
*/
|
*/
|
||||||
// @SaCheckPermission("inspection:testTask:record")
|
@SaCheckPermission("inspection:testTask:record")
|
||||||
// @GetMapping("/record")
|
@GetMapping("/record")
|
||||||
// public R<Object> record(@RequestParam Long projectId){
|
public R<Object> record(@RequestParam Long projectId){
|
||||||
// return opsInspectionTestTaskService.record(projectId);
|
return opsInspectionTestTaskService.record(projectId);
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,77 @@
|
|||||||
|
package org.dromara.inspection.domain;
|
||||||
|
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-巡检-通用节点对象 ops_inspection_node
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("ops_inspection_node")
|
||||||
|
public class OpsInspectionNode extends BaseEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点ID
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所用模块1工单2巡检任务3试验任务
|
||||||
|
*/
|
||||||
|
private String module;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单ID
|
||||||
|
*/
|
||||||
|
private Long orderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 顺序编号
|
||||||
|
*/
|
||||||
|
private Long code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预期目的
|
||||||
|
*/
|
||||||
|
private String intendedPurpose;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预期完成时间
|
||||||
|
*/
|
||||||
|
private Date intendedTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际完成时间
|
||||||
|
*/
|
||||||
|
private Date finishTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态1完成2未完成3失败
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,137 @@
|
|||||||
|
package org.dromara.inspection.domain;
|
||||||
|
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-巡检-工单对象 ops_inspection_order
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("ops_inspection_order")
|
||||||
|
public class OpsInspectionOrder extends BaseEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主要id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目(电站)id
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单标题
|
||||||
|
*/
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单类型1维护保养2检查检测3安装调试4升级改造
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单优先级1低2中3高
|
||||||
|
*/
|
||||||
|
private String level;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 截止时间
|
||||||
|
*/
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单描述
|
||||||
|
*/
|
||||||
|
private String info;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行地点
|
||||||
|
*/
|
||||||
|
private String position;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相关设备/系统
|
||||||
|
*/
|
||||||
|
private String device;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件ID
|
||||||
|
*/
|
||||||
|
private String fileId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件路径
|
||||||
|
*/
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点ids
|
||||||
|
*/
|
||||||
|
private String nodeIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预期成果
|
||||||
|
*/
|
||||||
|
private String results;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否需要执行人,1是2否(取消使用)
|
||||||
|
*/
|
||||||
|
private String executor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行人ids(取消使用)
|
||||||
|
*/
|
||||||
|
private String executorIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单状态1待派单2已派单3执行中4已完成
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 派单时间
|
||||||
|
*/
|
||||||
|
private Date sendOrderTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接单时间
|
||||||
|
*/
|
||||||
|
private Date getOrderTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接单人
|
||||||
|
*/
|
||||||
|
private Long getOrderPerson;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成时间
|
||||||
|
*/
|
||||||
|
private Date finishiOrderTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验收结果1通过2需整改
|
||||||
|
*/
|
||||||
|
private String orderResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否重点跟踪1是2否
|
||||||
|
*/
|
||||||
|
private String point;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -38,7 +38,7 @@ public class OpsInspectionPlan extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 计划名称
|
* 计划名称
|
||||||
*/
|
*/
|
||||||
private Long planName;
|
private String planName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计划类型,1每日巡检2每周巡检3每月巡检4每季度巡检
|
* 计划类型,1每日巡检2每周巡检3每月巡检4每季度巡检
|
||||||
|
|||||||
@ -69,10 +69,9 @@ public class OpsInspectionTask extends BaseEntity {
|
|||||||
private Long personId;
|
private Long personId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 进度
|
* 节点ids
|
||||||
*/
|
*/
|
||||||
@TableField(exist = false)
|
private String nodeIds;
|
||||||
private BigDecimal taskProgress;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态 1待执行2已延期3执行中4已完成
|
* 状态 1待执行2已延期3执行中4已完成
|
||||||
@ -84,6 +83,11 @@ public class OpsInspectionTask extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String problemType;
|
private String problemType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
private Date startTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 完成时间
|
* 完成时间
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -0,0 +1,68 @@
|
|||||||
|
package org.dromara.inspection.domain;
|
||||||
|
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-巡检-任务-问题对象 ops_inspection_task_problem
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-26
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("ops_inspection_task_problem")
|
||||||
|
public class OpsInspectionTaskProblem extends BaseEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电站id
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检任务ID
|
||||||
|
*/
|
||||||
|
private Long taskId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发现问题类型1磁盘使用率2内存使用率3服务状态4响应时间5设备运行状态
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问题详细信息
|
||||||
|
*/
|
||||||
|
private String info;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发现日期
|
||||||
|
*/
|
||||||
|
private Date findTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否解决1解决2未解决
|
||||||
|
*/
|
||||||
|
private String finish;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解决日期
|
||||||
|
*/
|
||||||
|
private Date finishTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -64,11 +64,21 @@ public class OpsInspectionTestTask extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private Long person;
|
private Long person;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点IDS
|
||||||
|
*/
|
||||||
|
private String nodeIds;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态,1待执行2暂停3失败4执行中5已完成
|
* 状态,1待执行2暂停3失败4执行中5已完成
|
||||||
*/
|
*/
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已分析1未分析2已分析
|
||||||
|
*/
|
||||||
|
private String unPack;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关联测试计划ID
|
* 关联测试计划ID
|
||||||
*/
|
*/
|
||||||
@ -87,7 +97,7 @@ public class OpsInspectionTestTask extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 进度
|
* 进度
|
||||||
*/
|
*/
|
||||||
private Long progress;
|
// private Long progress;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 失败原因
|
* 失败原因
|
||||||
|
|||||||
@ -0,0 +1,83 @@
|
|||||||
|
package org.dromara.inspection.domain.bo;
|
||||||
|
|
||||||
|
import org.dromara.inspection.domain.OpsInspectionNode;
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-巡检-通用节点业务对象 ops_inspection_node
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@AutoMapper(target = OpsInspectionNode.class, reverseConvertGenerate = false)
|
||||||
|
public class OpsInspectionNodeBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点ID
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所用模块1工单2巡检任务3试验任务
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "所用模块1工单2巡检任务3试验任务不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String module;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单ID
|
||||||
|
*/
|
||||||
|
@NotNull(message = "工单ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long orderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 顺序编号
|
||||||
|
*/
|
||||||
|
@NotNull(message = "顺序编号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "节点名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预期目的
|
||||||
|
*/
|
||||||
|
// @NotBlank(message = "预期目的不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String intendedPurpose;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预期完成时间
|
||||||
|
*/
|
||||||
|
// @NotNull(message = "预期完成时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Date intendedTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际完成时间
|
||||||
|
*/
|
||||||
|
// @NotNull(message = "实际完成时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Date finishTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态1完成2未完成3失败
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "状态1完成2未完成不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,153 @@
|
|||||||
|
package org.dromara.inspection.domain.bo;
|
||||||
|
|
||||||
|
import org.dromara.inspection.domain.OpsInspectionOrder;
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import org.dromara.system.api.domain.vo.RemoteUserVo;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-巡检-工单业务对象 ops_inspection_order
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@AutoMapper(target = OpsInspectionOrder.class, reverseConvertGenerate = false)
|
||||||
|
public class OpsInspectionOrderBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主要id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目(电站)id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "项目(电站)id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单标题
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "工单标题不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单类型1维护保养2检查检测3安装调试4升级改造
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "工单类型1维护保养2检查检测3安装调试4升级改造不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单优先级1低2中3高
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "工单优先级1低2中3高不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String level;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 截止时间
|
||||||
|
*/
|
||||||
|
@NotNull(message = "截止时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单描述
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "工单描述不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String info;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行地点
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "执行地点不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String position;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相关设备/系统
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "相关设备/系统不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String device;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件ID
|
||||||
|
*/
|
||||||
|
private String fileId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件路径
|
||||||
|
*/
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点ids
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "节点ids不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String nodeIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预期成果
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "预期成果不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String results;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否需要执行人,1是2否(取消使用)
|
||||||
|
*/
|
||||||
|
private String executor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行人ids(取消使用)
|
||||||
|
*/
|
||||||
|
private String executorIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单状态1待派单2已派单3执行中4已完成
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "工单状态1待派单2已派单3执行中4已完成不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 派单时间
|
||||||
|
*/
|
||||||
|
private Date sendOrderTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接单时间
|
||||||
|
*/
|
||||||
|
private Date getOrderTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接单人
|
||||||
|
*/
|
||||||
|
private Long getOrderPerson;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接单人信息
|
||||||
|
*/
|
||||||
|
private RemoteUserVo getOrderPersonVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成时间
|
||||||
|
*/
|
||||||
|
private Date finishiOrderTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验收结果1通过2需整改
|
||||||
|
*/
|
||||||
|
private String orderResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否重点跟踪1是2否
|
||||||
|
*/
|
||||||
|
private String point;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -38,7 +38,7 @@ public class OpsInspectionPlanBo extends BaseEntity {
|
|||||||
* 计划名称
|
* 计划名称
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "计划名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotNull(message = "计划名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Long planName;
|
private String planName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计划类型,1每日巡检2每周巡检3每月巡检4每季度巡检
|
* 计划类型,1每日巡检2每周巡检3每月巡检4每季度巡检
|
||||||
|
|||||||
@ -87,13 +87,13 @@ public class OpsInspectionRepairBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 报修人姓名
|
* 报修人姓名
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "报修人姓名不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "报修人姓名不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String reportName;
|
private String reportName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 报修人联系电话
|
* 报修人联系电话
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "报修人联系电话不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "报修人联系电话不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String reportPhone;
|
private String reportPhone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -88,13 +88,13 @@ public class OpsInspectionReportBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 报修人姓名
|
* 报修人姓名
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "姓名不能为空", groups = {AddGroup.class, EditGroup.class})
|
// @NotBlank(message = "姓名不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private String reportName;
|
private String reportName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 报修人联系电话
|
* 报修人联系电话
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "电话不能为空", groups = {AddGroup.class, EditGroup.class})
|
// @NotBlank(message = "电话不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private String reportPhone;
|
private String reportPhone;
|
||||||
|
|
||||||
private String reportFinal;
|
private String reportFinal;
|
||||||
|
|||||||
@ -74,12 +74,10 @@ public class OpsInspectionTaskBo extends BaseEntity {
|
|||||||
@NotNull(message = "执行人ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotNull(message = "执行人ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Long personId;
|
private Long personId;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 进度
|
* 节点ids
|
||||||
*/
|
*/
|
||||||
@TableField(exist = false)
|
private String nodeIds;
|
||||||
private BigDecimal taskProgress;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态 1待执行2已延期3执行中4已完成
|
* 状态 1待执行2已延期3执行中4已完成
|
||||||
@ -92,6 +90,11 @@ public class OpsInspectionTaskBo extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String problemType;
|
private String problemType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
private Date startTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 完成时间
|
* 完成时间
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -0,0 +1,72 @@
|
|||||||
|
package org.dromara.inspection.domain.bo;
|
||||||
|
|
||||||
|
import org.dromara.inspection.domain.OpsInspectionTaskProblem;
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-巡检-任务-问题业务对象 ops_inspection_task_problem
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-26
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@AutoMapper(target = OpsInspectionTaskProblem.class, reverseConvertGenerate = false)
|
||||||
|
public class OpsInspectionTaskProblemBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检任务ID
|
||||||
|
*/
|
||||||
|
@NotNull(message = "巡检任务ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long taskId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电站id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "电站ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发现问题类型1磁盘使用率2内存使用率3服务状态4响应时间5设备运行状态
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "发现问题类型1磁盘使用率2内存使用率3服务状态4响应时间5设备运行状态不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问题详细信息
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "问题详细信息不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String info;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发现日期
|
||||||
|
*/
|
||||||
|
@NotNull(message = "发现日期不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Date findTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否解决1解决2未解决
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "是否解决1解决2未解决不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String finish;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解决日期
|
||||||
|
*/
|
||||||
|
private Date finishTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -69,12 +69,23 @@ public class OpsInspectionTestTaskBo extends BaseEntity {
|
|||||||
@NotNull(message = "执行人员不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotNull(message = "执行人员不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Long person;
|
private Long person;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点IDS
|
||||||
|
*/
|
||||||
|
@NotNull(message = "节点不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String nodeIds;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态,1待执行2暂停3失败4执行中5已完成
|
* 状态,1待执行2暂停3失败4执行中5已完成
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "状态,1待执行2暂停3失败4执行中5已完成不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotBlank(message = "状态,1待执行2暂停3失败4执行中5已完成不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已分析1未分析2已分析
|
||||||
|
*/
|
||||||
|
private String unPack;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关联测试计划ID
|
* 关联测试计划ID
|
||||||
*/
|
*/
|
||||||
@ -94,7 +105,7 @@ public class OpsInspectionTestTaskBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 进度
|
* 进度
|
||||||
*/
|
*/
|
||||||
private Long progress;
|
// private Long progress;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 失败原因
|
* 失败原因
|
||||||
|
|||||||
@ -0,0 +1,90 @@
|
|||||||
|
package org.dromara.inspection.domain.vo;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import org.dromara.inspection.domain.OpsInspectionNode;
|
||||||
|
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import cn.idev.excel.annotation.ExcelProperty;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-巡检-通用节点视图对象 ops_inspection_node
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
@AutoMapper(target = OpsInspectionNode.class)
|
||||||
|
public class OpsInspectionNodeVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "节点ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所用模块1工单2巡检任务3试验任务
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "所用模块1工单2巡检任务3试验任务")
|
||||||
|
private String module;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "工单ID")
|
||||||
|
private Long orderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 顺序编号
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "顺序编号")
|
||||||
|
private Long code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "节点名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预期目的
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "预期目的")
|
||||||
|
private String intendedPurpose;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预期完成时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "预期完成时间")
|
||||||
|
private Date intendedTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际完成时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "实际完成时间")
|
||||||
|
private Date finishTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态1完成2未完成3失败
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "状态1完成2未完成")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,179 @@
|
|||||||
|
package org.dromara.inspection.domain.vo;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import org.dromara.inspection.domain.OpsInspectionOrder;
|
||||||
|
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import cn.idev.excel.annotation.ExcelProperty;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.dromara.personnel.domain.vo.OpsUserVo;
|
||||||
|
import org.dromara.system.api.domain.vo.RemoteUserVo;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-巡检-工单视图对象 ops_inspection_order
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
@AutoMapper(target = OpsInspectionOrder.class)
|
||||||
|
public class OpsInspectionOrderVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主要id
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "主要id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目(电站)id
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "项目(电站)id")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单标题
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "工单标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单类型1维护保养2检查检测3安装调试4升级改造
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "工单类型1维护保养2检查检测3安装调试4升级改造")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单优先级1低2中3高
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "工单优先级1低2中3高")
|
||||||
|
private String level;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 截止时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "截止时间")
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单描述
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "工单描述")
|
||||||
|
private String info;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行地点
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "执行地点")
|
||||||
|
private String position;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相关设备/系统
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "相关设备/系统")
|
||||||
|
private String device;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "文件ID")
|
||||||
|
private String fileId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件路径
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "文件路径")
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点ids
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "节点ids")
|
||||||
|
private String nodeIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单进度
|
||||||
|
*/
|
||||||
|
private BigDecimal progress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单节点
|
||||||
|
*/
|
||||||
|
private List<OpsInspectionNodeVo> nodes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预期成果
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "预期成果")
|
||||||
|
private String results;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否需要执行人,1是2否(取消使用)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "是否需要执行人,1是2否(取消使用)")
|
||||||
|
private String executor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行人ids(取消使用)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "执行人ids(取消使用)")
|
||||||
|
private String executorIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单状态1待派单2已派单3执行中4已完成
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "工单状态1待派单2已派单3执行中4已完成")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 派单时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "派单时间")
|
||||||
|
private Date sendOrderTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接单时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "接单时间")
|
||||||
|
private Date getOrderTime;
|
||||||
|
|
||||||
|
private Long getOrderPerson;
|
||||||
|
|
||||||
|
private RemoteUserVo getOrderPersonVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "完成时间")
|
||||||
|
private Date finishiOrderTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验收结果1通过2需整改
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "验收结果1通过2需整改")
|
||||||
|
private String orderResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否重点跟踪1是2否
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "是否重点跟踪1是2否")
|
||||||
|
private String point;
|
||||||
|
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
private Long createBy;
|
||||||
|
|
||||||
|
private RemoteUserVo sendOrderPersonVo;
|
||||||
|
|
||||||
|
}
|
||||||
@ -45,7 +45,7 @@ public class OpsInspectionPlanVo implements Serializable {
|
|||||||
* 计划名称
|
* 计划名称
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "计划名称")
|
@ExcelProperty(value = "计划名称")
|
||||||
private Long planName;
|
private String planName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计划类型,1每日巡检2每周巡检3每月巡检4每季度巡检
|
* 计划类型,1每日巡检2每周巡检3每月巡检4每季度巡检
|
||||||
@ -111,6 +111,8 @@ public class OpsInspectionPlanVo implements Serializable {
|
|||||||
@ExcelProperty(value = "巡检项ID")
|
@ExcelProperty(value = "巡检项ID")
|
||||||
private String inspectionItemId;
|
private String inspectionItemId;
|
||||||
|
|
||||||
|
private List<OpsInspectionItemVo> itemVoList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 1启用2停用
|
* 1启用2停用
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -22,7 +22,7 @@ public class OpsInspectionRecordVo {
|
|||||||
private Long finishInspectionCount;
|
private Long finishInspectionCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 问题梳数量
|
* 问题数量
|
||||||
*/
|
*/
|
||||||
private Long problemCount;
|
private Long problemCount;
|
||||||
|
|
||||||
@ -36,10 +36,20 @@ public class OpsInspectionRecordVo {
|
|||||||
*/
|
*/
|
||||||
private Long averageCompletionTime;
|
private Long averageCompletionTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检完成率
|
||||||
|
*/
|
||||||
|
private String xjwcl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已解决率
|
||||||
|
*/
|
||||||
|
// private String yjjl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 解决效率
|
* 解决效率
|
||||||
*/
|
*/
|
||||||
private BigDecimal solveEfficiency;
|
private BigDecimal jjxl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 磁盘使用率类型问题数量
|
* 磁盘使用率类型问题数量
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import cn.idev.excel.annotation.ExcelProperty;
|
|||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.dromara.personnel.domain.vo.OpsUserVo;
|
import org.dromara.personnel.domain.vo.OpsUserVo;
|
||||||
|
import org.dromara.system.api.domain.vo.RemoteUserVo;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@ -69,7 +70,7 @@ public class OpsInspectionRepairVo implements Serializable {
|
|||||||
@ExcelProperty(value = "指派维修人")
|
@ExcelProperty(value = "指派维修人")
|
||||||
private Long sendPerson;
|
private Long sendPerson;
|
||||||
|
|
||||||
private OpsUserVo sendPersonVo;
|
private RemoteUserVo sendPersonVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 详细信息
|
* 详细信息
|
||||||
@ -138,4 +139,5 @@ public class OpsInspectionRepairVo implements Serializable {
|
|||||||
|
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
|
private Long createBy;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import cn.idev.excel.annotation.ExcelProperty;
|
|||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.dromara.personnel.domain.vo.OpsUserVo;
|
import org.dromara.personnel.domain.vo.OpsUserVo;
|
||||||
|
import org.dromara.system.api.domain.vo.RemoteUserVo;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@ -70,7 +71,7 @@ public class OpsInspectionReportVo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 指派维修人
|
* 指派维修人
|
||||||
*/
|
*/
|
||||||
private OpsUserVo sendPersonVo;
|
private RemoteUserVo sendPersonVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 详细信息
|
* 详细信息
|
||||||
@ -116,4 +117,6 @@ public class OpsInspectionReportVo implements Serializable {
|
|||||||
|
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
|
private Long createBy;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,88 @@
|
|||||||
|
package org.dromara.inspection.domain.vo;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import org.dromara.inspection.domain.OpsInspectionTaskProblem;
|
||||||
|
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import cn.idev.excel.annotation.ExcelProperty;
|
||||||
|
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||||
|
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-巡检-任务-问题视图对象 ops_inspection_task_problem
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-26
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
@AutoMapper(target = OpsInspectionTaskProblem.class)
|
||||||
|
public class OpsInspectionTaskProblemVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电站id
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡检任务ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "巡检任务ID")
|
||||||
|
private Long taskId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发现问题类型1磁盘使用率2内存使用率3服务状态4响应时间5设备运行状态
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "发现问题类型1磁盘使用率2内存使用率3服务状态4响应时间5设备运行状态")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问题详细信息
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "问题详细信息")
|
||||||
|
private String info;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发现日期
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "发现日期")
|
||||||
|
private Date findTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否解决1解决2未解决
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "是否解决1解决2未解决")
|
||||||
|
private String finish;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解决日期
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "解决日期")
|
||||||
|
private Date finishTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@ -13,11 +13,12 @@ import org.dromara.common.excel.convert.ExcelDictConvert;
|
|||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.dromara.personnel.domain.vo.OpsUserVo;
|
import org.dromara.personnel.domain.vo.OpsUserVo;
|
||||||
|
import org.dromara.system.api.domain.vo.RemoteUserVo;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -86,13 +87,25 @@ public class OpsInspectionTaskVo implements Serializable {
|
|||||||
@ExcelProperty(value = "执行人ID")
|
@ExcelProperty(value = "执行人ID")
|
||||||
private Long personId;
|
private Long personId;
|
||||||
|
|
||||||
private OpsUserVo person;
|
private RemoteUserVo person;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 进度
|
* 进度
|
||||||
*/
|
*/
|
||||||
private BigDecimal taskProgress;
|
private BigDecimal taskProgress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点ids
|
||||||
|
*/
|
||||||
|
private String nodeIds;
|
||||||
|
|
||||||
|
private List<OpsInspectionNodeVo> nodes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问题列表
|
||||||
|
*/
|
||||||
|
private List<OpsInspectionTaskProblemVo> problems;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态 1待执行2已延期3执行中4已完成
|
* 状态 1待执行2已延期3执行中4已完成
|
||||||
*/
|
*/
|
||||||
@ -103,6 +116,11 @@ public class OpsInspectionTaskVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String problemType;
|
private String problemType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
private Date startTime;
|
||||||
|
|
||||||
private Date finishTime;
|
private Date finishTime;
|
||||||
|
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import io.github.linpeilie.annotations.AutoMapper;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.dromara.personnel.domain.OpsUser;
|
import org.dromara.personnel.domain.OpsUser;
|
||||||
import org.dromara.personnel.domain.vo.OpsUserVo;
|
import org.dromara.personnel.domain.vo.OpsUserVo;
|
||||||
|
import org.dromara.system.api.domain.vo.RemoteUserVo;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@ -93,7 +94,7 @@ public class OpsInspectionTestPlanVo implements Serializable {
|
|||||||
@ExcelProperty(value = "负责人ID")
|
@ExcelProperty(value = "负责人ID")
|
||||||
private Long personCharge;
|
private Long personCharge;
|
||||||
|
|
||||||
private OpsUserVo person;
|
private RemoteUserVo person;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 参与人员IDS
|
* 参与人员IDS
|
||||||
@ -101,7 +102,7 @@ public class OpsInspectionTestPlanVo implements Serializable {
|
|||||||
@ExcelProperty(value = "参与人员IDS")
|
@ExcelProperty(value = "参与人员IDS")
|
||||||
private String personIds;
|
private String personIds;
|
||||||
|
|
||||||
private List<OpsUserVo> persons;
|
private List<RemoteUserVo> persons;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义检查项
|
* 自定义检查项
|
||||||
|
|||||||
@ -10,36 +10,36 @@ public class OpsInspectionTestTaskRecord {
|
|||||||
/**
|
/**
|
||||||
* 本月完成数
|
* 本月完成数
|
||||||
*/
|
*/
|
||||||
private Long finishCount;
|
private String finishCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上月增加数
|
* 上月增加数
|
||||||
*/
|
*/
|
||||||
private BigDecimal finishCountAdd;
|
private String finishCountAdd;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 本月通过率
|
* 本月通过率
|
||||||
*/
|
*/
|
||||||
private BigDecimal passValue;
|
private String passValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过增长率
|
* 通过增长率
|
||||||
*/
|
*/
|
||||||
private BigDecimal passValueAdd;
|
private String passValueAdd;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 待分析数
|
* 待分析数
|
||||||
*/
|
*/
|
||||||
private Long failCount;
|
private String failCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 平均测试时间
|
* 平均测试时间
|
||||||
*/
|
*/
|
||||||
private Long averageTestTime;
|
private String averageTestTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 平均测试时间数增长率
|
* 平均测试时间数增长率
|
||||||
*/
|
*/
|
||||||
private BigDecimal averageTestTimeAdd;
|
private String averageTestTimeAdd;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package org.dromara.inspection.domain.vo;
|
package org.dromara.inspection.domain.vo;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import org.dromara.inspection.domain.OpsInspectionTestTask;
|
import org.dromara.inspection.domain.OpsInspectionTestTask;
|
||||||
@ -10,11 +11,12 @@ import org.dromara.common.excel.convert.ExcelDictConvert;
|
|||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.dromara.personnel.domain.vo.OpsUserVo;
|
import org.dromara.personnel.domain.vo.OpsUserVo;
|
||||||
|
import org.dromara.system.api.domain.vo.RemoteUserVo;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -79,7 +81,17 @@ public class OpsInspectionTestTaskVo implements Serializable {
|
|||||||
@ExcelProperty(value = "执行人员")
|
@ExcelProperty(value = "执行人员")
|
||||||
private Long person;
|
private Long person;
|
||||||
|
|
||||||
private OpsUserVo personInfo;
|
private RemoteUserVo personInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点IDS
|
||||||
|
*/
|
||||||
|
private String nodeIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点列表
|
||||||
|
*/
|
||||||
|
private List<OpsInspectionNodeVo> nodes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态,1待执行2暂停3失败4执行中5已完成
|
* 状态,1待执行2暂停3失败4执行中5已完成
|
||||||
@ -87,6 +99,11 @@ public class OpsInspectionTestTaskVo implements Serializable {
|
|||||||
@ExcelProperty(value = "状态,1待执行2暂停3失败4执行中5已完成")
|
@ExcelProperty(value = "状态,1待执行2暂停3失败4执行中5已完成")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已分析1未分析2已分析
|
||||||
|
*/
|
||||||
|
private String unPack;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关联测试计划ID
|
* 关联测试计划ID
|
||||||
*/
|
*/
|
||||||
@ -111,7 +128,7 @@ public class OpsInspectionTestTaskVo implements Serializable {
|
|||||||
* 进度
|
* 进度
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "进度")
|
@ExcelProperty(value = "进度")
|
||||||
private Long progress;
|
private BigDecimal progress;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 失败原因
|
* 失败原因
|
||||||
@ -178,4 +195,9 @@ public class OpsInspectionTestTaskVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Date planFinishTime;
|
private Date planFinishTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建 时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,43 @@
|
|||||||
|
package org.dromara.inspection.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class OrderRecordVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本月派单数
|
||||||
|
*/
|
||||||
|
private String bypds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拍单数增长率
|
||||||
|
*/
|
||||||
|
private String pdzzl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平均响应时间
|
||||||
|
*/
|
||||||
|
private String pjxysj;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 响应时间增长率
|
||||||
|
*/
|
||||||
|
private String xysjzzl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 待接收工单
|
||||||
|
*/
|
||||||
|
private String djsgd;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按时完成率
|
||||||
|
*/
|
||||||
|
private String aswcl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成增长率
|
||||||
|
*/
|
||||||
|
private String wczzl;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
package org.dromara.inspection.mapper;
|
||||||
|
|
||||||
|
import org.dromara.inspection.domain.OpsInspectionNode;
|
||||||
|
import org.dromara.inspection.domain.vo.OpsInspectionNodeVo;
|
||||||
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-巡检-通用节点Mapper接口
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-23
|
||||||
|
*/
|
||||||
|
public interface OpsInspectionNodeMapper extends BaseMapperPlus<OpsInspectionNode, OpsInspectionNodeVo> {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
package org.dromara.inspection.mapper;
|
||||||
|
|
||||||
|
import org.dromara.inspection.domain.OpsInspectionOrder;
|
||||||
|
import org.dromara.inspection.domain.vo.OpsInspectionOrderVo;
|
||||||
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-巡检-工单Mapper接口
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-23
|
||||||
|
*/
|
||||||
|
public interface OpsInspectionOrderMapper extends BaseMapperPlus<OpsInspectionOrder, OpsInspectionOrderVo> {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
package org.dromara.inspection.mapper;
|
||||||
|
|
||||||
|
import org.dromara.inspection.domain.OpsInspectionTaskProblem;
|
||||||
|
import org.dromara.inspection.domain.vo.OpsInspectionTaskProblemVo;
|
||||||
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-巡检-任务-问题Mapper接口
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-26
|
||||||
|
*/
|
||||||
|
public interface OpsInspectionTaskProblemMapper extends BaseMapperPlus<OpsInspectionTaskProblem, OpsInspectionTaskProblemVo> {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,69 @@
|
|||||||
|
package org.dromara.inspection.service;
|
||||||
|
|
||||||
|
import org.dromara.common.core.domain.R;
|
||||||
|
import org.dromara.inspection.domain.vo.OpsInspectionNodeVo;
|
||||||
|
import org.dromara.inspection.domain.bo.OpsInspectionNodeBo;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-巡检-通用节点Service接口
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-23
|
||||||
|
*/
|
||||||
|
public interface IOpsInspectionNodeService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询运维-巡检-通用节点
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 运维-巡检-通用节点
|
||||||
|
*/
|
||||||
|
OpsInspectionNodeVo queryById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询运维-巡检-通用节点列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 运维-巡检-通用节点分页列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<OpsInspectionNodeVo> queryPageList(OpsInspectionNodeBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的运维-巡检-通用节点列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 运维-巡检-通用节点列表
|
||||||
|
*/
|
||||||
|
List<OpsInspectionNodeVo> queryList(OpsInspectionNodeBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增运维-巡检-通用节点
|
||||||
|
*
|
||||||
|
* @param bo 运维-巡检-通用节点
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
R<String> insertByBo(List<OpsInspectionNodeBo> bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改运维-巡检-通用节点
|
||||||
|
*
|
||||||
|
* @param bo 运维-巡检-通用节点
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(List<OpsInspectionNodeBo> bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除运维-巡检-通用节点信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
||||||
@ -0,0 +1,68 @@
|
|||||||
|
package org.dromara.inspection.service;
|
||||||
|
|
||||||
|
import org.dromara.inspection.domain.vo.OpsInspectionOrderVo;
|
||||||
|
import org.dromara.inspection.domain.bo.OpsInspectionOrderBo;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-巡检-工单Service接口
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-23
|
||||||
|
*/
|
||||||
|
public interface IOpsInspectionOrderService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询运维-巡检-工单
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 运维-巡检-工单
|
||||||
|
*/
|
||||||
|
OpsInspectionOrderVo queryById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询运维-巡检-工单列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 运维-巡检-工单分页列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<OpsInspectionOrderVo> queryPageList(OpsInspectionOrderBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的运维-巡检-工单列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 运维-巡检-工单列表
|
||||||
|
*/
|
||||||
|
List<OpsInspectionOrderVo> queryList(OpsInspectionOrderBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增运维-巡检-工单
|
||||||
|
*
|
||||||
|
* @param bo 运维-巡检-工单
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(OpsInspectionOrderBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改运维-巡检-工单
|
||||||
|
*
|
||||||
|
* @param bo 运维-巡检-工单
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(OpsInspectionOrderBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除运维-巡检-工单信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
||||||
@ -0,0 +1,69 @@
|
|||||||
|
package org.dromara.inspection.service;
|
||||||
|
|
||||||
|
import org.dromara.inspection.domain.OpsInspectionTaskProblem;
|
||||||
|
import org.dromara.inspection.domain.vo.OpsInspectionTaskProblemVo;
|
||||||
|
import org.dromara.inspection.domain.bo.OpsInspectionTaskProblemBo;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-巡检-任务-问题Service接口
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-26
|
||||||
|
*/
|
||||||
|
public interface IOpsInspectionTaskProblemService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询运维-巡检-任务-问题
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 运维-巡检-任务-问题
|
||||||
|
*/
|
||||||
|
OpsInspectionTaskProblemVo queryById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询运维-巡检-任务-问题列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 运维-巡检-任务-问题分页列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<OpsInspectionTaskProblemVo> queryPageList(OpsInspectionTaskProblemBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的运维-巡检-任务-问题列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 运维-巡检-任务-问题列表
|
||||||
|
*/
|
||||||
|
List<OpsInspectionTaskProblemVo> queryList(OpsInspectionTaskProblemBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增运维-巡检-任务-问题
|
||||||
|
*
|
||||||
|
* @param bo 运维-巡检-任务-问题
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(OpsInspectionTaskProblemBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改运维-巡检-任务-问题
|
||||||
|
*
|
||||||
|
* @param bo 运维-巡检-任务-问题
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(OpsInspectionTaskProblemBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除运维-巡检-任务-问题信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
package org.dromara.inspection.service;
|
package org.dromara.inspection.service;
|
||||||
|
|
||||||
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.inspection.domain.OpsInspectionTask;
|
import org.dromara.inspection.domain.OpsInspectionTask;
|
||||||
import org.dromara.inspection.domain.vo.OpsInspectionTaskVo;
|
import org.dromara.inspection.domain.vo.OpsInspectionTaskVo;
|
||||||
import org.dromara.inspection.domain.bo.OpsInspectionTaskBo;
|
import org.dromara.inspection.domain.bo.OpsInspectionTaskBo;
|
||||||
@ -56,7 +57,7 @@ public interface IOpsInspectionTaskService {
|
|||||||
* @param bo 运维-巡检计划-任务
|
* @param bo 运维-巡检计划-任务
|
||||||
* @return 是否修改成功
|
* @return 是否修改成功
|
||||||
*/
|
*/
|
||||||
Boolean updateByBo(OpsInspectionTaskBo bo);
|
R<Void> updateByBo(OpsInspectionTaskBo bo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验并批量删除运维-巡检计划-任务信息
|
* 校验并批量删除运维-巡检计划-任务信息
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package org.dromara.inspection.service;
|
package org.dromara.inspection.service;
|
||||||
|
|
||||||
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.inspection.domain.OpsInspectionTestTask;
|
import org.dromara.inspection.domain.OpsInspectionTestTask;
|
||||||
import org.dromara.inspection.domain.vo.OpsInspectionTestTaskVo;
|
import org.dromara.inspection.domain.vo.OpsInspectionTestTaskVo;
|
||||||
import org.dromara.inspection.domain.bo.OpsInspectionTestTaskBo;
|
import org.dromara.inspection.domain.bo.OpsInspectionTestTaskBo;
|
||||||
@ -56,7 +57,7 @@ public interface IOpsInspectionTestTaskService {
|
|||||||
* @param bo 运维-巡检-试验任务
|
* @param bo 运维-巡检-试验任务
|
||||||
* @return 是否修改成功
|
* @return 是否修改成功
|
||||||
*/
|
*/
|
||||||
Boolean updateByBo(OpsInspectionTestTaskBo bo);
|
R<Void> updateByBo(OpsInspectionTestTaskBo bo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验并批量删除运维-巡检-试验任务信息
|
* 校验并批量删除运维-巡检-试验任务信息
|
||||||
|
|||||||
@ -0,0 +1,153 @@
|
|||||||
|
package org.dromara.inspection.service.impl;
|
||||||
|
|
||||||
|
import org.dromara.common.core.domain.R;
|
||||||
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.dromara.inspection.domain.bo.OpsInspectionNodeBo;
|
||||||
|
import org.dromara.inspection.domain.vo.OpsInspectionNodeVo;
|
||||||
|
import org.dromara.inspection.domain.OpsInspectionNode;
|
||||||
|
import org.dromara.inspection.mapper.OpsInspectionNodeMapper;
|
||||||
|
import org.dromara.inspection.service.IOpsInspectionNodeService;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-巡检-通用节点Service业务层处理
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-23
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class OpsInspectionNodeServiceImpl implements IOpsInspectionNodeService {
|
||||||
|
|
||||||
|
private final OpsInspectionNodeMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询运维-巡检-通用节点
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 运维-巡检-通用节点
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public OpsInspectionNodeVo queryById(Long id){
|
||||||
|
return baseMapper.selectVoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询运维-巡检-通用节点列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 运维-巡检-通用节点分页列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<OpsInspectionNodeVo> queryPageList(OpsInspectionNodeBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<OpsInspectionNode> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<OpsInspectionNodeVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的运维-巡检-通用节点列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 运维-巡检-通用节点列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<OpsInspectionNodeVo> queryList(OpsInspectionNodeBo bo) {
|
||||||
|
LambdaQueryWrapper<OpsInspectionNode> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<OpsInspectionNode> buildQueryWrapper(OpsInspectionNodeBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<OpsInspectionNode> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.orderByAsc(OpsInspectionNode::getId);
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getModule()), OpsInspectionNode::getModule, bo.getModule());
|
||||||
|
lqw.eq(bo.getOrderId() != null, OpsInspectionNode::getOrderId, bo.getOrderId());
|
||||||
|
lqw.eq(bo.getCode() != null, OpsInspectionNode::getCode, bo.getCode());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), OpsInspectionNode::getStatus, bo.getStatus());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增运维-巡检-通用节点
|
||||||
|
*
|
||||||
|
* @param bo 运维-巡检-通用节点
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<String> insertByBo(List<OpsInspectionNodeBo> bo) {
|
||||||
|
List<String> ids = new ArrayList<>();
|
||||||
|
if (bo != null) {
|
||||||
|
for (OpsInspectionNodeBo nodeBo : bo) {
|
||||||
|
OpsInspectionNode add = MapstructUtils.convert(nodeBo, OpsInspectionNode.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
int insert = baseMapper.insert(add);
|
||||||
|
if (insert > 0){
|
||||||
|
if (add != null) {
|
||||||
|
ids.add(add.getId().toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// log.info("{}", StringUtils.join(ids, ","));
|
||||||
|
return R.ok(StringUtils.join(ids, ","));
|
||||||
|
}else{
|
||||||
|
return R.fail();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改运维-巡检-通用节点
|
||||||
|
*
|
||||||
|
* @param bo 运维-巡检-通用节点
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(List<OpsInspectionNodeBo> bo) {
|
||||||
|
for (OpsInspectionNodeBo nodeBo : bo) {
|
||||||
|
OpsInspectionNode update = MapstructUtils.convert(nodeBo, OpsInspectionNode.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
baseMapper.updateById(update);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(OpsInspectionNode entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除运维-巡检-通用节点信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,395 @@
|
|||||||
|
package org.dromara.inspection.service.impl;
|
||||||
|
|
||||||
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
|
import org.dromara.common.core.domain.R;
|
||||||
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.dromara.common.satoken.utils.LoginHelper;
|
||||||
|
import org.dromara.inspection.domain.OpsInspectionNode;
|
||||||
|
import org.dromara.inspection.domain.bo.OpsInspectionRepairBo;
|
||||||
|
import org.dromara.inspection.domain.vo.*;
|
||||||
|
import org.dromara.inspection.mapper.OpsInspectionNodeMapper;
|
||||||
|
import org.dromara.personnel.domain.vo.OpsUserVo;
|
||||||
|
import org.dromara.personnel.mapper.OpsUserMapper;
|
||||||
|
import org.dromara.resource.api.RemoteFileService;
|
||||||
|
import org.dromara.system.api.RemoteUserService;
|
||||||
|
import org.dromara.system.api.domain.vo.RemoteUserVo;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.dromara.inspection.domain.bo.OpsInspectionOrderBo;
|
||||||
|
import org.dromara.inspection.domain.OpsInspectionOrder;
|
||||||
|
import org.dromara.inspection.mapper.OpsInspectionOrderMapper;
|
||||||
|
import org.dromara.inspection.service.IOpsInspectionOrderService;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-巡检-工单Service业务层处理
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-23
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class OpsInspectionOrderServiceImpl implements IOpsInspectionOrderService {
|
||||||
|
|
||||||
|
|
||||||
|
private final OpsInspectionOrderMapper baseMapper;
|
||||||
|
|
||||||
|
private final OpsInspectionNodeMapper nodeMapper;
|
||||||
|
|
||||||
|
@DubboReference
|
||||||
|
private RemoteFileService remoteFileService;
|
||||||
|
@DubboReference
|
||||||
|
private RemoteUserService remoteUserService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询运维-巡检-工单
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 运维-巡检-工单
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public OpsInspectionOrderVo queryById(Long id){
|
||||||
|
OpsInspectionOrderVo opsInspectionOrderVo = baseMapper.selectVoById(id);
|
||||||
|
List<OpsInspectionOrderVo> opsInspectionOrderVo1 = List.of(opsInspectionOrderVo);
|
||||||
|
setValue(opsInspectionOrderVo1);
|
||||||
|
return opsInspectionOrderVo1.getFirst();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询运维-巡检-工单列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 运维-巡检-工单分页列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<OpsInspectionOrderVo> queryPageList(OpsInspectionOrderBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<OpsInspectionOrder> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<OpsInspectionOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
setValue(result.getRecords());
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的运维-巡检-工单列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 运维-巡检-工单列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<OpsInspectionOrderVo> queryList(OpsInspectionOrderBo bo) {
|
||||||
|
LambdaQueryWrapper<OpsInspectionOrder> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<OpsInspectionOrder> buildQueryWrapper(OpsInspectionOrderBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<OpsInspectionOrder> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.orderByAsc(OpsInspectionOrder::getId);
|
||||||
|
lqw.eq(bo.getProjectId() != null, OpsInspectionOrder::getProjectId, bo.getProjectId());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getType()), OpsInspectionOrder::getType, bo.getType());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getLevel()), OpsInspectionOrder::getLevel, bo.getLevel());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getPoint()), OpsInspectionOrder::getPoint, bo.getPoint());
|
||||||
|
lqw.eq(bo.getCreateTime() != null, OpsInspectionOrder::getCreateTime, bo.getCreateTime());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增运维-巡检-工单
|
||||||
|
*
|
||||||
|
* @param bo 运维-巡检-工单
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(OpsInspectionOrderBo bo) {
|
||||||
|
OpsInspectionOrder add = MapstructUtils.convert(bo, OpsInspectionOrder.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
|
||||||
|
if (add.getFileId() != null){
|
||||||
|
String[] split = add.getFileId().split(",");
|
||||||
|
List<String> urls = new ArrayList<>();
|
||||||
|
for (String s : split) {
|
||||||
|
String ossUrl = remoteFileService.selectUrlByIds(s);
|
||||||
|
if (ossUrl != null){
|
||||||
|
urls.add(ossUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String join = String.join(",", urls);
|
||||||
|
add.setFileUrl(join);
|
||||||
|
bo.setFileUrl(join);
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setId(add.getId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改运维-巡检-工单
|
||||||
|
*
|
||||||
|
* @param bo 运维-巡检-工单
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(OpsInspectionOrderBo bo) {
|
||||||
|
OpsInspectionOrder update = MapstructUtils.convert(bo, OpsInspectionOrder.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(OpsInspectionOrder entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除运维-巡检-工单信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
|
||||||
|
List<String> urls = new ArrayList<>();
|
||||||
|
List<Long> nodeIds = new ArrayList<>();
|
||||||
|
|
||||||
|
for (Long id : ids) {
|
||||||
|
OpsInspectionOrderVo vo = queryById(id);
|
||||||
|
if (vo != null){
|
||||||
|
if (vo.getFileUrl()!=null) {
|
||||||
|
urls.add(vo.getFileUrl());
|
||||||
|
}
|
||||||
|
for (String nodeId : List.of(vo.getNodeIds().split(","))) {
|
||||||
|
nodeIds.add(Long.valueOf(nodeId));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!urls.isEmpty()) {
|
||||||
|
for (String url : urls) {
|
||||||
|
List<String> list = Arrays.asList(url.split(","));
|
||||||
|
remoteFileService.deleteFile(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//同时删除节点
|
||||||
|
if (!nodeIds.isEmpty()) {
|
||||||
|
nodeMapper.deleteByIds(nodeIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理回显数据
|
||||||
|
*/
|
||||||
|
private void setValue(List<OpsInspectionOrderVo> list){
|
||||||
|
|
||||||
|
LambdaQueryWrapper<OpsInspectionNode> nodeWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
for (OpsInspectionOrderVo vo : list) {
|
||||||
|
|
||||||
|
List<String> split = Arrays.stream(vo.getNodeIds().split(",")).toList();
|
||||||
|
|
||||||
|
nodeWrapper.clear();
|
||||||
|
nodeWrapper.in(OpsInspectionNode::getId, split);
|
||||||
|
|
||||||
|
List<OpsInspectionNodeVo> nodeVoList = nodeMapper.selectVoList(nodeWrapper);
|
||||||
|
|
||||||
|
//处理进度百分比 完成节点 / 总节点 * 100
|
||||||
|
if (nodeVoList != null && !nodeVoList.isEmpty()){
|
||||||
|
//统计完成节点
|
||||||
|
int finishCount = nodeVoList.stream().filter(nodeVo -> nodeVo.getStatus().equals("1")).toList().size();
|
||||||
|
if (finishCount == nodeVoList.size()){
|
||||||
|
vo.setProgress(new BigDecimal("100"));
|
||||||
|
}else {
|
||||||
|
vo.setProgress(BigDecimal.valueOf(finishCount).divide(BigDecimal.valueOf(nodeVoList.size()), 2, RoundingMode.DOWN).multiply(BigDecimal.valueOf(100.00)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//处理派单人
|
||||||
|
List<RemoteUserVo> remoteUserVos = remoteUserService.selectListByIds(List.of(vo.getCreateBy()));
|
||||||
|
if (remoteUserVos != null && !remoteUserVos.isEmpty()){
|
||||||
|
vo.setSendOrderPersonVo(remoteUserVos.getFirst());
|
||||||
|
}
|
||||||
|
|
||||||
|
//处理接单人
|
||||||
|
if (vo.getGetOrderPerson() != null){
|
||||||
|
remoteUserVos = remoteUserService.selectListByIds(Collections.singletonList(vo.getGetOrderPerson()));
|
||||||
|
if (remoteUserVos != null && !remoteUserVos.isEmpty()){
|
||||||
|
vo.setGetOrderPersonVo(remoteUserVos.getFirst());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//处理节点列表
|
||||||
|
if (vo.getNodeIds() != null && !vo.getNodeIds().isEmpty()){
|
||||||
|
String[] ids = vo.getNodeIds().split(",");
|
||||||
|
List<OpsInspectionNodeVo> nodeVos = new ArrayList<>();
|
||||||
|
for (String id : ids) {
|
||||||
|
OpsInspectionNodeVo nodeVo = nodeMapper.selectVoById(id);
|
||||||
|
if (nodeVo != null) {
|
||||||
|
nodeVos.add(nodeVo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
vo.setNodes(nodeVos);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取纪录
|
||||||
|
*/
|
||||||
|
public R<OrderRecordVo> record(Long projectId){
|
||||||
|
//变量初始化
|
||||||
|
OrderRecordVo recordVo = new OrderRecordVo();
|
||||||
|
|
||||||
|
OpsInspectionOrderBo bo = new OpsInspectionOrderBo();
|
||||||
|
bo.setProjectId(projectId);
|
||||||
|
//日期初始化
|
||||||
|
Date startDate = Date.from(LocalDate.now().withDayOfMonth(1).atStartOfDay(ZoneId.systemDefault()).toInstant());
|
||||||
|
Date endDate = Date.from(LocalDate.now().withDayOfMonth(1).plusMonths(1).minusDays(1).atTime(23, 59, 59).atZone(ZoneId.systemDefault()).toInstant());
|
||||||
|
//查询当前项目的数据
|
||||||
|
List<OpsInspectionOrderVo> vos = queryList(bo);
|
||||||
|
//过滤本月数据
|
||||||
|
List<OpsInspectionOrderVo> thisMonth = vos.stream()
|
||||||
|
.filter(vo -> vo.getCreateTime().after(startDate))
|
||||||
|
.filter(vo -> vo.getCreateTime().before(endDate))
|
||||||
|
.toList();
|
||||||
|
//本月派单总数
|
||||||
|
BigDecimal bypdzs = BigDecimal.valueOf(thisMonth.size());
|
||||||
|
//统计平均响应时间
|
||||||
|
Long zgxysj = 0L;//总共响应时间
|
||||||
|
for (OpsInspectionOrderVo orderVo : thisMonth) {
|
||||||
|
if (orderVo.getGetOrderTime() != null) {
|
||||||
|
zgxysj += orderVo.getGetOrderTime().getTime() - orderVo.getCreateTime().getTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//平均响应时间
|
||||||
|
BigDecimal avg = BigDecimal.valueOf(TimeUnit.MILLISECONDS.toMinutes(zgxysj));
|
||||||
|
//统计待接收工单
|
||||||
|
int waiting = thisMonth.stream().filter(vo -> vo.getStatus().equals("2")).toList().size();
|
||||||
|
//待接单数
|
||||||
|
BigDecimal djds = BigDecimal.valueOf(waiting);
|
||||||
|
//按时完成率 找到完成的工单 获取工单完成时间
|
||||||
|
|
||||||
|
//获取所有完成数
|
||||||
|
int sywcs = thisMonth.stream()
|
||||||
|
.filter(vo -> vo.getStatus().equals("4"))
|
||||||
|
.toList().size();
|
||||||
|
|
||||||
|
//获取按时完成数
|
||||||
|
int aswcs = thisMonth.stream()
|
||||||
|
.filter(vo -> vo.getStatus().equals("4"))
|
||||||
|
.filter(vo -> vo.getFinishiOrderTime().before(endDate))
|
||||||
|
.toList().size();
|
||||||
|
//按时完成率
|
||||||
|
BigDecimal aswcl;
|
||||||
|
if (sywcs > 0) {
|
||||||
|
aswcl = BigDecimal.valueOf(aswcs).divide(BigDecimal.valueOf(sywcs), 2, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100.00));
|
||||||
|
}else {
|
||||||
|
aswcl = BigDecimal.valueOf(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
recordVo.setBypds(String.valueOf(bypdzs));
|
||||||
|
recordVo.setPjxysj(String.valueOf(avg));
|
||||||
|
recordVo.setDjsgd(String.valueOf(djds));
|
||||||
|
recordVo.setAswcl(String.valueOf(aswcl));
|
||||||
|
|
||||||
|
//获取上月数据列表
|
||||||
|
Date finalStartDate = Date.from(LocalDate.now().minusMonths(1).withDayOfMonth(1).atStartOfDay(ZoneId.systemDefault()).toInstant());
|
||||||
|
Date finalEndDate = Date.from(LocalDate.now().minusMonths(1).withDayOfMonth(1).plusMonths(1).minusDays(1).atTime(23, 59, 59).atZone(ZoneId.systemDefault()).toInstant());
|
||||||
|
|
||||||
|
thisMonth = vos.stream()
|
||||||
|
.filter(vo -> vo.getCreateTime().after(finalStartDate))
|
||||||
|
.filter(vo -> vo.getCreateTime().before(finalEndDate))
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
//上月派单总数
|
||||||
|
BigDecimal sypdzs = BigDecimal.valueOf(thisMonth.size());
|
||||||
|
|
||||||
|
//统计上月平均响应时间
|
||||||
|
zgxysj = 0L;//总共响应时间
|
||||||
|
for (OpsInspectionOrderVo orderVo : thisMonth) {
|
||||||
|
if (orderVo.getGetOrderTime() != null) {
|
||||||
|
zgxysj += orderVo.getGetOrderTime().getTime() - orderVo.getCreateTime().getTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//上月平均响应时间
|
||||||
|
BigDecimal syavg = BigDecimal.valueOf(TimeUnit.MILLISECONDS.toMinutes(zgxysj));
|
||||||
|
|
||||||
|
//获取上月所有完成数
|
||||||
|
int sysywcs = thisMonth.stream()
|
||||||
|
.filter(vo -> vo.getStatus().equals("4"))
|
||||||
|
.toList().size();
|
||||||
|
|
||||||
|
//获取上月按时完成数
|
||||||
|
int syaswcs = thisMonth.stream()
|
||||||
|
.filter(vo -> vo.getStatus().equals("4"))
|
||||||
|
.filter(vo -> vo.getFinishiOrderTime().before(finalEndDate))
|
||||||
|
.toList().size();
|
||||||
|
//上月按时完成率
|
||||||
|
BigDecimal syaswcl;
|
||||||
|
if (sywcs > 0) {
|
||||||
|
syaswcl = BigDecimal.valueOf(syaswcs).divide(BigDecimal.valueOf(sysywcs), 2, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100.00));
|
||||||
|
}else {
|
||||||
|
syaswcl = BigDecimal.valueOf(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
//本月完成 / 上月完成 * 100 = 增长率
|
||||||
|
BigDecimal wczzl;
|
||||||
|
if (syaswcl.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
wczzl = BigDecimal.valueOf(Double.parseDouble(recordVo.getAswcl())).divide(syaswcl, 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
|
||||||
|
}else {
|
||||||
|
wczzl = BigDecimal.valueOf(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
//上月完成率增长率
|
||||||
|
recordVo.setWczzl(wczzl.toString());
|
||||||
|
|
||||||
|
//派单增长率
|
||||||
|
BigDecimal pdzzl;
|
||||||
|
if (sypdzs.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
pdzzl = BigDecimal.valueOf(Double.parseDouble(recordVo.getBypds())).divide(sypdzs, 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
|
||||||
|
}else {
|
||||||
|
pdzzl = BigDecimal.valueOf(0);
|
||||||
|
}
|
||||||
|
recordVo.setPdzzl(pdzzl.toString());
|
||||||
|
|
||||||
|
//响应时间增长率
|
||||||
|
BigDecimal xysjzzl;
|
||||||
|
if (BigDecimal.valueOf(Double.parseDouble(recordVo.getPjxysj())).compareTo(BigDecimal.ZERO) > 0){
|
||||||
|
xysjzzl = syavg.divide(BigDecimal.valueOf(Double.parseDouble(recordVo.getPjxysj())), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
|
||||||
|
}else {
|
||||||
|
xysjzzl = BigDecimal.ZERO;
|
||||||
|
}
|
||||||
|
recordVo.setXysjzzl(xysjzzl.toString());
|
||||||
|
|
||||||
|
return R.ok(recordVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -10,10 +10,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.dromara.inspection.domain.vo.OpsInspectionItemVo;
|
||||||
|
import org.dromara.inspection.mapper.OpsInspectionItemMapper;
|
||||||
import org.dromara.personnel.domain.OpsUser;
|
import org.dromara.personnel.domain.OpsUser;
|
||||||
import org.dromara.personnel.service.impl.OpsUserServiceImpl;
|
import org.dromara.personnel.service.impl.OpsUserServiceImpl;
|
||||||
import org.dromara.system.api.RemoteUserService;
|
import org.dromara.system.api.RemoteUserService;
|
||||||
|
import org.dromara.system.api.domain.vo.RemoteUserVo;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.autoconfigure.web.embedded.UndertowWebServerFactoryCustomizer;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.dromara.inspection.domain.bo.OpsInspectionPlanBo;
|
import org.dromara.inspection.domain.bo.OpsInspectionPlanBo;
|
||||||
import org.dromara.inspection.domain.vo.OpsInspectionPlanVo;
|
import org.dromara.inspection.domain.vo.OpsInspectionPlanVo;
|
||||||
@ -21,6 +25,7 @@ import org.dromara.inspection.domain.OpsInspectionPlan;
|
|||||||
import org.dromara.inspection.mapper.OpsInspectionPlanMapper;
|
import org.dromara.inspection.mapper.OpsInspectionPlanMapper;
|
||||||
import org.dromara.inspection.service.IOpsInspectionPlanService;
|
import org.dromara.inspection.service.IOpsInspectionPlanService;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@ -38,10 +43,9 @@ public class OpsInspectionPlanServiceImpl implements IOpsInspectionPlanService {
|
|||||||
|
|
||||||
@DubboReference
|
@DubboReference
|
||||||
private RemoteUserService remoteUserService;
|
private RemoteUserService remoteUserService;
|
||||||
@Autowired
|
|
||||||
private OpsUserServiceImpl opsUserService;
|
|
||||||
|
|
||||||
private final OpsInspectionPlanMapper baseMapper;
|
private final OpsInspectionPlanMapper baseMapper;
|
||||||
|
private final OpsInspectionItemMapper itemMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询运维-巡检-计划
|
* 查询运维-巡检-计划
|
||||||
@ -155,12 +159,26 @@ public class OpsInspectionPlanServiceImpl implements IOpsInspectionPlanService {
|
|||||||
*/
|
*/
|
||||||
private void setValue(List<OpsInspectionPlanVo> list){
|
private void setValue(List<OpsInspectionPlanVo> list){
|
||||||
list.forEach(record -> {
|
list.forEach(record -> {
|
||||||
OpsUser byId = opsUserService.getById(record.getPerson());
|
List<RemoteUserVo> remoteUserVos = remoteUserService.selectListByIds(List.of(record.getPerson()));
|
||||||
if (byId != null){
|
|
||||||
record.setNickName(byId.getUserName());
|
if (remoteUserVos != null && !remoteUserVos.isEmpty()){
|
||||||
|
record.setNickName(remoteUserVos.getFirst().getUserName());
|
||||||
}else{
|
}else{
|
||||||
record.setNickName("未知用户");
|
record.setNickName("未知用户");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (record.getInspectionItemId()!=null){
|
||||||
|
String[] itemIds = record.getInspectionItemId().split(",");
|
||||||
|
List<OpsInspectionItemVo> itemVos = new ArrayList<>();
|
||||||
|
for (String itemId : itemIds) {
|
||||||
|
OpsInspectionItemVo itemVo = itemMapper.selectVoById(itemId);
|
||||||
|
if (itemVo != null){
|
||||||
|
itemVos.add(itemVo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
record.setItemVoList(itemVos);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -19,6 +19,8 @@ import org.dromara.inspection.service.IOpsInspectionRepairService;
|
|||||||
import org.dromara.personnel.domain.vo.OpsUserVo;
|
import org.dromara.personnel.domain.vo.OpsUserVo;
|
||||||
import org.dromara.personnel.service.impl.OpsUserServiceImpl;
|
import org.dromara.personnel.service.impl.OpsUserServiceImpl;
|
||||||
import org.dromara.resource.api.RemoteFileService;
|
import org.dromara.resource.api.RemoteFileService;
|
||||||
|
import org.dromara.system.api.RemoteUserService;
|
||||||
|
import org.dromara.system.api.domain.vo.RemoteUserVo;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.dromara.inspection.domain.bo.OpsInspectionRepairBo;
|
import org.dromara.inspection.domain.bo.OpsInspectionRepairBo;
|
||||||
@ -48,8 +50,8 @@ public class OpsInspectionRepairServiceImpl implements IOpsInspectionRepairServi
|
|||||||
|
|
||||||
@DubboReference
|
@DubboReference
|
||||||
private RemoteFileService remoteFileService;
|
private RemoteFileService remoteFileService;
|
||||||
@Autowired
|
@DubboReference
|
||||||
private OpsUserServiceImpl opsUserService;
|
private RemoteUserService userService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询运维-巡检-抢修
|
* 查询运维-巡检-抢修
|
||||||
@ -203,13 +205,13 @@ public class OpsInspectionRepairServiceImpl implements IOpsInspectionRepairServi
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
OpsUserVo opsUserVo = opsUserService.queryById(vo.getSendPerson());
|
List<RemoteUserVo> remoteUserVos = userService.selectListByIds(Collections.singletonList(vo.getSendPerson()));
|
||||||
if (opsUserVo == null){
|
|
||||||
|
if (remoteUserVos == null || remoteUserVos.isEmpty()){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
vo.setSendPersonVo(opsUserVo);
|
vo.setSendPersonVo(remoteUserVos.getFirst());
|
||||||
|
|
||||||
|
|
||||||
//处理分钟数
|
//处理分钟数
|
||||||
if (vo.getStatus().equals("3")){
|
if (vo.getStatus().equals("3")){
|
||||||
@ -217,6 +219,16 @@ public class OpsInspectionRepairServiceImpl implements IOpsInspectionRepairServi
|
|||||||
vo.setMinute(String.valueOf(TimeUnit.MILLISECONDS.toMinutes( time)));
|
vo.setMinute(String.valueOf(TimeUnit.MILLISECONDS.toMinutes( time)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
remoteUserVos = userService.selectListByIds(Collections.singletonList(vo.getCreateBy()));
|
||||||
|
if (remoteUserVos != null&&!remoteUserVos.isEmpty()){
|
||||||
|
if (remoteUserVos.getFirst().getUserName()!=null) {
|
||||||
|
vo.setName(remoteUserVos.getFirst().getUserName());
|
||||||
|
}
|
||||||
|
if (remoteUserVos.getFirst().getPhonenumber()!=null){
|
||||||
|
vo.setReportPhone(remoteUserVos.getFirst().getPhonenumber());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,6 +17,8 @@ import org.dromara.inspection.domain.vo.OpsInspectionReportRecordVo;
|
|||||||
import org.dromara.personnel.domain.vo.OpsUserVo;
|
import org.dromara.personnel.domain.vo.OpsUserVo;
|
||||||
import org.dromara.personnel.service.impl.OpsUserServiceImpl;
|
import org.dromara.personnel.service.impl.OpsUserServiceImpl;
|
||||||
import org.dromara.resource.api.RemoteFileService;
|
import org.dromara.resource.api.RemoteFileService;
|
||||||
|
import org.dromara.system.api.RemoteUserService;
|
||||||
|
import org.dromara.system.api.domain.vo.RemoteUserVo;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.dromara.inspection.domain.bo.OpsInspectionReportBo;
|
import org.dromara.inspection.domain.bo.OpsInspectionReportBo;
|
||||||
@ -48,8 +50,8 @@ public class OpsInspectionReportServiceImpl implements IOpsInspectionReportServi
|
|||||||
|
|
||||||
@DubboReference
|
@DubboReference
|
||||||
private RemoteFileService remoteFileService;
|
private RemoteFileService remoteFileService;
|
||||||
@Autowired
|
@DubboReference
|
||||||
private OpsUserServiceImpl opsUserService;
|
private RemoteUserService userService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询运维-巡检-报修
|
* 查询运维-巡检-报修
|
||||||
@ -216,13 +218,22 @@ public class OpsInspectionReportServiceImpl implements IOpsInspectionReportServi
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
OpsUserVo opsUserVo = opsUserService.queryById(vo.getSendPerson());
|
List<RemoteUserVo> remoteUserVos = userService.selectListByIds(Collections.singletonList(vo.getSendPerson()));
|
||||||
if (opsUserVo == null){
|
if (remoteUserVos == null || remoteUserVos.isEmpty()){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
vo.setSendPersonVo(opsUserVo);
|
vo.setSendPersonVo(remoteUserVos.getFirst());
|
||||||
|
|
||||||
|
remoteUserVos = userService.selectListByIds(Collections.singletonList(vo.getCreateBy()));
|
||||||
|
if (remoteUserVos != null && !remoteUserVos.isEmpty()){
|
||||||
|
if (remoteUserVos.getFirst().getUserName()!=null) {
|
||||||
|
vo.setName(remoteUserVos.getFirst().getUserName());
|
||||||
|
}
|
||||||
|
if (remoteUserVos.getFirst().getPhonenumber()!=null){
|
||||||
|
vo.setReportPhone(remoteUserVos.getFirst().getPhonenumber());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,137 @@
|
|||||||
|
package org.dromara.inspection.service.impl;
|
||||||
|
|
||||||
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.dromara.inspection.domain.bo.OpsInspectionTaskProblemBo;
|
||||||
|
import org.dromara.inspection.domain.vo.OpsInspectionTaskProblemVo;
|
||||||
|
import org.dromara.inspection.domain.OpsInspectionTaskProblem;
|
||||||
|
import org.dromara.inspection.mapper.OpsInspectionTaskProblemMapper;
|
||||||
|
import org.dromara.inspection.service.IOpsInspectionTaskProblemService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运维-巡检-任务-问题Service业务层处理
|
||||||
|
*
|
||||||
|
* @author LionLi
|
||||||
|
* @date 2025-09-26
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class OpsInspectionTaskProblemServiceImpl implements IOpsInspectionTaskProblemService {
|
||||||
|
|
||||||
|
private final OpsInspectionTaskProblemMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询运维-巡检-任务-问题
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 运维-巡检-任务-问题
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public OpsInspectionTaskProblemVo queryById(Long id){
|
||||||
|
return baseMapper.selectVoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询运维-巡检-任务-问题列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 运维-巡检-任务-问题分页列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<OpsInspectionTaskProblemVo> queryPageList(OpsInspectionTaskProblemBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<OpsInspectionTaskProblem> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<OpsInspectionTaskProblemVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的运维-巡检-任务-问题列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 运维-巡检-任务-问题列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<OpsInspectionTaskProblemVo> queryList(OpsInspectionTaskProblemBo bo) {
|
||||||
|
LambdaQueryWrapper<OpsInspectionTaskProblem> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<OpsInspectionTaskProblem> buildQueryWrapper(OpsInspectionTaskProblemBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<OpsInspectionTaskProblem> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.orderByAsc(OpsInspectionTaskProblem::getId);
|
||||||
|
lqw.eq(bo.getTaskId() != null, OpsInspectionTaskProblem::getTaskId, bo.getTaskId());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getType()), OpsInspectionTaskProblem::getType, bo.getType());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getInfo()), OpsInspectionTaskProblem::getInfo, bo.getInfo());
|
||||||
|
lqw.eq(bo.getFindTime() != null, OpsInspectionTaskProblem::getFindTime, bo.getFindTime());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getFinish()), OpsInspectionTaskProblem::getFinish, bo.getFinish());
|
||||||
|
lqw.eq(bo.getFinishTime() != null, OpsInspectionTaskProblem::getFinishTime, bo.getFinishTime());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增运维-巡检-任务-问题
|
||||||
|
*
|
||||||
|
* @param bo 运维-巡检-任务-问题
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(OpsInspectionTaskProblemBo bo) {
|
||||||
|
OpsInspectionTaskProblem add = MapstructUtils.convert(bo, OpsInspectionTaskProblem.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setId(add.getId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改运维-巡检-任务-问题
|
||||||
|
*
|
||||||
|
* @param bo 运维-巡检-任务-问题
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(OpsInspectionTaskProblemBo bo) {
|
||||||
|
OpsInspectionTaskProblem update = MapstructUtils.convert(bo, OpsInspectionTaskProblem.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(OpsInspectionTaskProblem entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除运维-巡检-任务-问题信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
package org.dromara.inspection.service.impl;
|
package org.dromara.inspection.service.impl;
|
||||||
|
|
||||||
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
@ -10,14 +11,16 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.inspection.domain.vo.OpsInspectionPlanVo;
|
import org.dromara.inspection.domain.OpsInspectionNode;
|
||||||
import org.dromara.inspection.domain.vo.OpsInspectionRecordVo;
|
import org.dromara.inspection.domain.OpsInspectionTaskProblem;
|
||||||
import org.dromara.personnel.domain.vo.OpsUserVo;
|
import org.dromara.inspection.domain.vo.*;
|
||||||
import org.dromara.personnel.service.impl.OpsUserServiceImpl;
|
import org.dromara.inspection.mapper.OpsInspectionNodeMapper;
|
||||||
|
import org.dromara.inspection.mapper.OpsInspectionTaskProblemMapper;
|
||||||
|
import org.dromara.system.api.RemoteUserService;
|
||||||
|
import org.dromara.system.api.domain.vo.RemoteUserVo;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.dromara.inspection.domain.bo.OpsInspectionTaskBo;
|
import org.dromara.inspection.domain.bo.OpsInspectionTaskBo;
|
||||||
import org.dromara.inspection.domain.vo.OpsInspectionTaskVo;
|
|
||||||
import org.dromara.inspection.domain.OpsInspectionTask;
|
import org.dromara.inspection.domain.OpsInspectionTask;
|
||||||
import org.dromara.inspection.mapper.OpsInspectionTaskMapper;
|
import org.dromara.inspection.mapper.OpsInspectionTaskMapper;
|
||||||
import org.dromara.inspection.service.IOpsInspectionTaskService;
|
import org.dromara.inspection.service.IOpsInspectionTaskService;
|
||||||
@ -28,12 +31,8 @@ import java.time.LocalDate;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.util.Date;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 运维-巡检计划-任务Service业务层处理
|
* 运维-巡检计划-任务Service业务层处理
|
||||||
@ -47,10 +46,13 @@ import java.util.stream.Collectors;
|
|||||||
public class OpsInspectionTaskServiceImpl implements IOpsInspectionTaskService {
|
public class OpsInspectionTaskServiceImpl implements IOpsInspectionTaskService {
|
||||||
|
|
||||||
private final OpsInspectionTaskMapper baseMapper;
|
private final OpsInspectionTaskMapper baseMapper;
|
||||||
|
private final OpsInspectionNodeMapper nodeMapper;
|
||||||
|
private final OpsInspectionTaskProblemMapper problemMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private OpsInspectionPlanServiceImpl opsInspectionPlanService;
|
private OpsInspectionPlanServiceImpl opsInspectionPlanService;
|
||||||
@Autowired
|
@DubboReference
|
||||||
private OpsUserServiceImpl opsUserService;
|
private RemoteUserService userService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询运维-巡检计划-任务
|
* 查询运维-巡检计划-任务
|
||||||
@ -134,10 +136,55 @@ public class OpsInspectionTaskServiceImpl implements IOpsInspectionTaskService {
|
|||||||
* @return 是否修改成功
|
* @return 是否修改成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean updateByBo(OpsInspectionTaskBo bo) {
|
public R<Void> updateByBo(OpsInspectionTaskBo bo) {
|
||||||
OpsInspectionTask update = MapstructUtils.convert(bo, OpsInspectionTask.class);
|
OpsInspectionTask update = MapstructUtils.convert(bo, OpsInspectionTask.class);
|
||||||
validEntityBeforeSave(update);
|
validEntityBeforeSave(update);
|
||||||
return baseMapper.updateById(update) > 0;
|
|
||||||
|
//过滤出更新为完成任务的情况
|
||||||
|
OpsInspectionTaskVo oldVo = baseMapper.selectVoById(bo.getId());
|
||||||
|
//如果原来不为完成状态而更新为完成状态
|
||||||
|
if (!oldVo.getTaskType().equals("4") && bo.getTaskType().equals("4")){
|
||||||
|
|
||||||
|
//判断节点是否全部完成
|
||||||
|
List<String> split = Arrays.stream(bo.getNodeIds().split(",")).toList();
|
||||||
|
LambdaQueryWrapper<OpsInspectionNode> nodeLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
nodeLambdaQueryWrapper.in(OpsInspectionNode::getId, split);
|
||||||
|
//全部节点
|
||||||
|
List<OpsInspectionNodeVo> nodeVos = nodeMapper.selectVoList(nodeLambdaQueryWrapper);
|
||||||
|
boolean isAllFinish = true;
|
||||||
|
for (OpsInspectionNodeVo nodeVo : nodeVos) {
|
||||||
|
if (nodeVo.getStatus().equals("2")){
|
||||||
|
isAllFinish = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (!isAllFinish){
|
||||||
|
return R.fail("节点尚未全部完成");
|
||||||
|
}
|
||||||
|
|
||||||
|
//判断问题是否全部解决
|
||||||
|
LambdaQueryWrapper<OpsInspectionTaskProblem> problemLqw = new LambdaQueryWrapper<>();
|
||||||
|
problemLqw.eq(OpsInspectionTaskProblem::getTaskId, bo.getId());
|
||||||
|
List<OpsInspectionTaskProblemVo> problems = problemMapper.selectVoList(problemLqw);
|
||||||
|
for (OpsInspectionTaskProblemVo problem : problems) {
|
||||||
|
if (problem.getFinish().equals("2")){
|
||||||
|
isAllFinish = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!isAllFinish){
|
||||||
|
return R.fail("纪录的问题尚未完全解决");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean b = baseMapper.updateById(update) > 0;
|
||||||
|
|
||||||
|
if (b){
|
||||||
|
return R.ok();
|
||||||
|
}else {
|
||||||
|
|
||||||
|
return R.fail("更新失败");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -187,7 +234,6 @@ public class OpsInspectionTaskServiceImpl implements IOpsInspectionTaskService {
|
|||||||
// 设置时间范围:今天的00:00:00到23:59:59
|
// 设置时间范围:今天的00:00:00到23:59:59
|
||||||
startDate = Date.from(LocalDateTime.of(LocalDate.now(), LocalTime.MIN).atZone(ZoneId.systemDefault()).toInstant());
|
startDate = Date.from(LocalDateTime.of(LocalDate.now(), LocalTime.MIN).atZone(ZoneId.systemDefault()).toInstant());
|
||||||
endDate = Date.from(LocalDateTime.of(LocalDate.now(), LocalTime.MAX).atZone(ZoneId.systemDefault()).toInstant());
|
endDate = Date.from(LocalDateTime.of(LocalDate.now(), LocalTime.MAX).atZone(ZoneId.systemDefault()).toInstant());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//统计本周
|
//统计本周
|
||||||
@ -216,48 +262,67 @@ public class OpsInspectionTaskServiceImpl implements IOpsInspectionTaskService {
|
|||||||
Date finalStartDate = startDate;
|
Date finalStartDate = startDate;
|
||||||
Date finalEndDate = endDate;
|
Date finalEndDate = endDate;
|
||||||
|
|
||||||
Long finishInspectionCount = (long) opsInspectionTaskVos.stream()
|
//仅统计在本月完成的巡检
|
||||||
.filter(taskVo -> taskVo.getFinishTime().after(finalStartDate) && taskVo.getFinishTime().before(finalEndDate))
|
List<OpsInspectionTaskVo> finishList = opsInspectionTaskVos.stream()
|
||||||
.toList().size();
|
.filter(taskVo -> taskVo.getFinishTime() != null && taskVo.getStartTime() != null && taskVo.getFinishTime().before(finalEndDate) && taskVo.getStartTime().after(finalStartDate))
|
||||||
recordVo.setFinishInspectionCount(finishInspectionCount);
|
.filter(vo -> vo.getCreateTime().after(finalStartDate) && vo.getCreateTime().before(finalEndDate))
|
||||||
|
.toList();
|
||||||
|
recordVo.setFinishInspectionCount((long) finishList.size());
|
||||||
|
|
||||||
//发现问题数 通过createTime统计
|
//发现问题数 通过createTime统计
|
||||||
int problemCount = opsInspectionTaskVos.stream()
|
int problemCount = 0;
|
||||||
.filter(taskVo -> taskVo.getCreateTime().after(finalStartDate) && taskVo.getCreateTime().before(finalEndDate))
|
// List<OpsInspectionTaskVo> problemList = opsInspectionTaskVos.stream()
|
||||||
.toList().size();
|
// .filter(taskVo -> taskVo.getCreateTime().after(finalStartDate) && taskVo.getCreateTime().before(finalEndDate))
|
||||||
|
// .toList();
|
||||||
|
// if (!problemList.isEmpty()){
|
||||||
|
// problemCount = problemList.size();
|
||||||
|
// }
|
||||||
|
LambdaQueryWrapper<OpsInspectionTaskProblem> problemLqw = new LambdaQueryWrapper<>();
|
||||||
|
problemLqw.eq(OpsInspectionTaskProblem::getProjectId, projectId);
|
||||||
|
problemLqw.between(OpsInspectionTaskProblem::getCreateTime, finalStartDate, finalEndDate);
|
||||||
|
|
||||||
|
List<OpsInspectionTaskProblemVo> problemVos = problemMapper.selectVoList(problemLqw);
|
||||||
|
if (problemVos != null && !problemVos.isEmpty()){
|
||||||
|
problemCount = problemVos.size();
|
||||||
|
}
|
||||||
recordVo.setProblemCount((long) problemCount);
|
recordVo.setProblemCount((long) problemCount);
|
||||||
|
|
||||||
//已解决数 获取列表以供通用
|
//已解决数 获取列表以供通用 从本月发现列表里筛选出已解决
|
||||||
List<OpsInspectionTaskVo> list = opsInspectionTaskVos.stream()
|
List<OpsInspectionTaskProblemVo> finishProblems = new ArrayList<>();
|
||||||
.filter(taskVo -> taskVo.getCreateTime().after(finalStartDate) && taskVo.getCreateTime().before(finalEndDate))
|
if (problemVos == null || problemVos.isEmpty()){
|
||||||
.filter(taskVo -> taskVo.getTaskType().equals("4"))
|
recordVo.setSolvedProblemCount(0L);
|
||||||
.toList();
|
}else {
|
||||||
recordVo.setSolvedProblemCount((long) list.size());
|
//过滤出完成的
|
||||||
|
finishProblems.addAll(problemVos.stream().filter(vo -> vo.getFinish().equals("1")).toList());
|
||||||
|
recordVo.setSolvedProblemCount((long) finishProblems.size());
|
||||||
|
}
|
||||||
|
|
||||||
// 计算总共耗时(毫秒)
|
// 计算总共耗时(毫秒)
|
||||||
long durationMillis = 0L;
|
long durationMillis = 0L;
|
||||||
for (OpsInspectionTaskVo opsInspectionTaskVo : list) {
|
for (OpsInspectionTaskProblemVo vo : finishProblems) {
|
||||||
durationMillis += opsInspectionTaskVo.getFinishTime().getTime() - opsInspectionTaskVo.getCreateTime().getTime();
|
durationMillis += vo.getFinishTime().getTime() - vo.getFindTime().getTime();
|
||||||
}
|
}
|
||||||
//赋值分钟
|
//平均处理分钟
|
||||||
if (list.isEmpty()){
|
if (finishProblems.isEmpty()){
|
||||||
recordVo.setAverageCompletionTime(0L);
|
recordVo.setAverageCompletionTime(0L);
|
||||||
}else {
|
}else {
|
||||||
recordVo.setAverageCompletionTime(TimeUnit.MILLISECONDS.toMinutes(durationMillis) / list.size());
|
recordVo.setAverageCompletionTime(TimeUnit.MILLISECONDS.toMinutes(durationMillis) / finishProblems.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
//解决效率 已解决数 / 总共数量 * 100
|
//解决效率 = 已解决数 / 已发现数总共数量 * 100
|
||||||
BigDecimal problemCountBigDecimal = BigDecimal.valueOf(recordVo.getProblemCount());
|
BigDecimal problemCountBigDecimal = BigDecimal.valueOf(recordVo.getProblemCount());
|
||||||
BigDecimal solvedProblemCountBigDecimal = BigDecimal.valueOf(recordVo.getSolvedProblemCount());
|
BigDecimal solvedProblemCountBigDecimal = BigDecimal.valueOf(recordVo.getSolvedProblemCount());
|
||||||
if (solvedProblemCountBigDecimal.compareTo(BigDecimal.ZERO) == 0 || problemCountBigDecimal.compareTo(BigDecimal.ZERO) == 0){
|
|
||||||
recordVo.setSolveEfficiency(BigDecimal.valueOf(0));
|
if (solvedProblemCountBigDecimal.compareTo(BigDecimal.ZERO) < 1 || problemCountBigDecimal.compareTo(BigDecimal.ZERO) < 1){
|
||||||
|
recordVo.setJjxl(BigDecimal.valueOf(0));
|
||||||
}else {
|
}else {
|
||||||
BigDecimal bigDecimal = solvedProblemCountBigDecimal.divide(problemCountBigDecimal, 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(0, RoundingMode.HALF_UP);
|
BigDecimal bigDecimal = solvedProblemCountBigDecimal.divide(problemCountBigDecimal, 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(0, RoundingMode.HALF_UP);
|
||||||
recordVo.setSolveEfficiency(bigDecimal);
|
recordVo.setJjxl(bigDecimal);
|
||||||
}
|
}
|
||||||
for (OpsInspectionTaskVo opsInspectionTaskVo : opsInspectionTaskVos) {
|
|
||||||
if (opsInspectionTaskVo.getCreateTime().after(startDate) && opsInspectionTaskVo.getCreateTime().before(endDate)){
|
if (problemVos != null) {
|
||||||
switch (opsInspectionTaskVo.getProblemType()){
|
for (OpsInspectionTaskProblemVo vo : problemVos) {
|
||||||
|
switch (vo.getType()){
|
||||||
case "1" -> cpsyl++;
|
case "1" -> cpsyl++;
|
||||||
case "2" -> ncsyl++;
|
case "2" -> ncsyl++;
|
||||||
case "3" -> fwzt++;
|
case "3" -> fwzt++;
|
||||||
@ -272,6 +337,30 @@ public class OpsInspectionTaskServiceImpl implements IOpsInspectionTaskService {
|
|||||||
recordVo.setXysj(xysj);
|
recordVo.setXysj(xysj);
|
||||||
recordVo.setSbyxzt(sbyxzt);
|
recordVo.setSbyxzt(sbyxzt);
|
||||||
|
|
||||||
|
//巡检完成率
|
||||||
|
BigDecimal xjwcl;
|
||||||
|
//本月巡检数
|
||||||
|
int byxjs = opsInspectionTaskVos.stream().filter(vo -> vo.getCreateTime().after(finalStartDate) && vo.getCreateTime().before(finalEndDate))
|
||||||
|
.toList()
|
||||||
|
.size();
|
||||||
|
//完成 / 巡检数 * 100
|
||||||
|
if (byxjs > 0) {
|
||||||
|
xjwcl = BigDecimal.valueOf(recordVo.getFinishInspectionCount()).divide(BigDecimal.valueOf(byxjs), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
|
||||||
|
}else {
|
||||||
|
xjwcl = BigDecimal.valueOf(0);
|
||||||
|
}
|
||||||
|
recordVo.setXjwcl(xjwcl.toString());
|
||||||
|
|
||||||
|
//问题解决率
|
||||||
|
BigDecimal wtjjl;
|
||||||
|
//解决数 / 问题数 * 100
|
||||||
|
if (problemVos == null || problemVos.isEmpty()){
|
||||||
|
wtjjl = BigDecimal.valueOf(0);
|
||||||
|
}else {
|
||||||
|
wtjjl = BigDecimal.valueOf(recordVo.getSolvedProblemCount()).divide(BigDecimal.valueOf(problemVos.size()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
|
||||||
|
}
|
||||||
|
recordVo.setJjxl(wtjjl);
|
||||||
|
|
||||||
return R.ok(recordVo);
|
return R.ok(recordVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -282,18 +371,63 @@ public class OpsInspectionTaskServiceImpl implements IOpsInspectionTaskService {
|
|||||||
private void buildEcho(List<OpsInspectionTaskVo> taskVos) {
|
private void buildEcho(List<OpsInspectionTaskVo> taskVos) {
|
||||||
//TODO 回显信息
|
//TODO 回显信息
|
||||||
taskVos.forEach(taskVo -> {
|
taskVos.forEach(taskVo -> {
|
||||||
|
LambdaQueryWrapper<OpsInspectionNode> nodeWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
if (taskVo.getPlanId()!=null) {
|
if (taskVo.getPlanId()!=null) {
|
||||||
OpsInspectionPlanVo opsInspectionPlanVo = opsInspectionPlanService.queryById(taskVo.getPlanId());
|
OpsInspectionPlanVo opsInspectionPlanVo = opsInspectionPlanService.queryById(taskVo.getPlanId());
|
||||||
if (opsInspectionPlanVo != null) {
|
if (opsInspectionPlanVo != null) {
|
||||||
taskVo.setPlan(opsInspectionPlanVo);
|
taskVo.setPlan(opsInspectionPlanVo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (taskVo.getPersonId()!=null) {
|
if (taskVo.getPersonId()!=null) {
|
||||||
OpsUserVo opsUserVo = opsUserService.queryById(taskVo.getPersonId());
|
List<RemoteUserVo> remoteUserVos = userService.selectListByIds(List.of(taskVo.getPersonId()));
|
||||||
if (opsUserVo != null) {
|
if (remoteUserVos != null && !remoteUserVos.isEmpty()) {
|
||||||
taskVo.setPerson(opsUserVo);
|
taskVo.setPerson(remoteUserVos.getFirst());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//处理进度和节点信息
|
||||||
|
if (taskVo.getNodeIds() != null && !taskVo.getNodeIds().isEmpty()){
|
||||||
|
|
||||||
|
List<String> stringList = Arrays.stream(taskVo.getNodeIds().split(",")).toList();
|
||||||
|
|
||||||
|
nodeWrapper.clear();
|
||||||
|
nodeWrapper.in(OpsInspectionNode::getId, stringList);
|
||||||
|
List<OpsInspectionNodeVo> nodeVoList = nodeMapper.selectVoList(nodeWrapper);
|
||||||
|
|
||||||
|
//处理进度百分比 完成节点 / 总节点 * 100
|
||||||
|
if (nodeVoList != null && !nodeVoList.isEmpty()){
|
||||||
|
//统计完成节点
|
||||||
|
int finishCount = nodeVoList.stream().filter(nodeVo -> nodeVo.getStatus().equals("1")).toList().size();
|
||||||
|
if (finishCount == nodeVoList.size()){
|
||||||
|
taskVo.setTaskProgress(new BigDecimal("100"));
|
||||||
|
}else {
|
||||||
|
taskVo.setTaskProgress(BigDecimal.valueOf(finishCount).divide(BigDecimal.valueOf(nodeVoList.size()), 2, RoundingMode.DOWN).multiply(BigDecimal.valueOf(100.00)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//处理节点列表
|
||||||
|
if (taskVo.getNodeIds() != null && !taskVo.getNodeIds().isEmpty()){
|
||||||
|
|
||||||
|
List<OpsInspectionNodeVo> nodeVos = new ArrayList<>();
|
||||||
|
for (String id : stringList) {
|
||||||
|
OpsInspectionNodeVo nodeVo = nodeMapper.selectVoById(id);
|
||||||
|
if (nodeVo != null) {
|
||||||
|
nodeVos.add(nodeVo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
taskVo.setNodes(nodeVos);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//处理问题列表
|
||||||
|
LambdaQueryWrapper<OpsInspectionTaskProblem> problemWrapper = new LambdaQueryWrapper<>();
|
||||||
|
problemWrapper.eq(OpsInspectionTaskProblem::getTaskId, taskVo.getId());
|
||||||
|
List<OpsInspectionTaskProblemVo> problemVos = problemMapper.selectVoList(problemWrapper);
|
||||||
|
taskVo.setProblems(problemVos);
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package org.dromara.inspection.service.impl;
|
package org.dromara.inspection.service.impl;
|
||||||
|
|
||||||
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
@ -14,6 +15,8 @@ import org.dromara.personnel.domain.OpsUser;
|
|||||||
import org.dromara.personnel.domain.bo.OpsUserBo;
|
import org.dromara.personnel.domain.bo.OpsUserBo;
|
||||||
import org.dromara.personnel.domain.vo.OpsUserVo;
|
import org.dromara.personnel.domain.vo.OpsUserVo;
|
||||||
import org.dromara.personnel.service.impl.OpsUserServiceImpl;
|
import org.dromara.personnel.service.impl.OpsUserServiceImpl;
|
||||||
|
import org.dromara.system.api.RemoteUserService;
|
||||||
|
import org.dromara.system.api.domain.vo.RemoteUserVo;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.dromara.inspection.domain.bo.OpsInspectionTestPlanBo;
|
import org.dromara.inspection.domain.bo.OpsInspectionTestPlanBo;
|
||||||
@ -38,10 +41,8 @@ import java.util.Collection;
|
|||||||
@Service
|
@Service
|
||||||
public class OpsInspectionTestPlanServiceImpl implements IOpsInspectionTestPlanService {
|
public class OpsInspectionTestPlanServiceImpl implements IOpsInspectionTestPlanService {
|
||||||
|
|
||||||
@Autowired
|
@DubboReference
|
||||||
private OpsUserServiceImpl opsUserService;
|
private RemoteUserService userService;
|
||||||
@Autowired
|
|
||||||
private OpsInspectionItemServiceImpl inspectionItemService;
|
|
||||||
|
|
||||||
private final OpsInspectionTestPlanMapper baseMapper;
|
private final OpsInspectionTestPlanMapper baseMapper;
|
||||||
|
|
||||||
@ -166,19 +167,19 @@ public class OpsInspectionTestPlanServiceImpl implements IOpsInspectionTestPlanS
|
|||||||
for (OpsInspectionTestPlanVo opsInspectionTestPlanVo : list) {
|
for (OpsInspectionTestPlanVo opsInspectionTestPlanVo : list) {
|
||||||
|
|
||||||
if(opsInspectionTestPlanVo.getPersonCharge()!=null) {
|
if(opsInspectionTestPlanVo.getPersonCharge()!=null) {
|
||||||
OpsUserVo byId = opsUserService.queryById(opsInspectionTestPlanVo.getPersonCharge());
|
List<RemoteUserVo> byId = userService.selectListByIds(List.of(opsInspectionTestPlanVo.getPersonCharge()));
|
||||||
if (byId != null) {
|
if (byId != null && !byId.isEmpty()) {
|
||||||
opsInspectionTestPlanVo.setPerson(byId);
|
opsInspectionTestPlanVo.setPerson(byId.getFirst());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opsInspectionTestPlanVo.getPersonIds() != null){
|
if (opsInspectionTestPlanVo.getPersonIds() != null){
|
||||||
String[] split = opsInspectionTestPlanVo.getPersonIds().split(",");
|
String[] split = opsInspectionTestPlanVo.getPersonIds().split(",");
|
||||||
List<OpsUserVo> opsUserVos = new ArrayList<>();
|
List<RemoteUserVo> opsUserVos = new ArrayList<>();
|
||||||
for (String s : split) {
|
for (String s : split) {
|
||||||
OpsUserVo opsUserVo = opsUserService.queryById(Long.parseLong(s));
|
List<RemoteUserVo> opsUserVo = userService.selectListByIds(List.of(Long.parseLong(s)));
|
||||||
if (opsUserVo != null){
|
if (opsUserVo != null && !opsUserVo.isEmpty()){
|
||||||
opsUserVos.add(opsUserVo);
|
opsUserVos.add(opsUserVo.getFirst());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
opsInspectionTestPlanVo.setPersons(opsUserVos);
|
opsInspectionTestPlanVo.setPersons(opsUserVos);
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package org.dromara.inspection.service.impl;
|
package org.dromara.inspection.service.impl;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
@ -11,14 +12,16 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.inspection.domain.vo.OpsInspectionTestPlanVo;
|
import org.dromara.inspection.domain.OpsInspectionNode;
|
||||||
import org.dromara.inspection.domain.vo.OpsInspectionTestTaskRecord;
|
import org.dromara.inspection.domain.vo.*;
|
||||||
|
import org.dromara.inspection.mapper.OpsInspectionNodeMapper;
|
||||||
import org.dromara.personnel.domain.vo.OpsUserVo;
|
import org.dromara.personnel.domain.vo.OpsUserVo;
|
||||||
import org.dromara.personnel.service.impl.OpsUserServiceImpl;
|
import org.dromara.personnel.service.impl.OpsUserServiceImpl;
|
||||||
|
import org.dromara.system.api.RemoteUserService;
|
||||||
|
import org.dromara.system.api.domain.vo.RemoteUserVo;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.dromara.inspection.domain.bo.OpsInspectionTestTaskBo;
|
import org.dromara.inspection.domain.bo.OpsInspectionTestTaskBo;
|
||||||
import org.dromara.inspection.domain.vo.OpsInspectionTestTaskVo;
|
|
||||||
import org.dromara.inspection.domain.OpsInspectionTestTask;
|
import org.dromara.inspection.domain.OpsInspectionTestTask;
|
||||||
import org.dromara.inspection.mapper.OpsInspectionTestTaskMapper;
|
import org.dromara.inspection.mapper.OpsInspectionTestTaskMapper;
|
||||||
import org.dromara.inspection.service.IOpsInspectionTestTaskService;
|
import org.dromara.inspection.service.IOpsInspectionTestTaskService;
|
||||||
@ -27,10 +30,8 @@ import java.math.BigDecimal;
|
|||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.util.Date;
|
import java.util.*;
|
||||||
import java.util.List;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 运维-巡检-试验任务Service业务层处理
|
* 运维-巡检-试验任务Service业务层处理
|
||||||
@ -44,10 +45,12 @@ import java.util.Collection;
|
|||||||
public class OpsInspectionTestTaskServiceImpl implements IOpsInspectionTestTaskService {
|
public class OpsInspectionTestTaskServiceImpl implements IOpsInspectionTestTaskService {
|
||||||
|
|
||||||
private final OpsInspectionTestTaskMapper baseMapper;
|
private final OpsInspectionTestTaskMapper baseMapper;
|
||||||
@Autowired
|
private final OpsInspectionNodeMapper nodeMapper;
|
||||||
private OpsUserServiceImpl opsUserService;
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private OpsInspectionTestPlanServiceImpl opsInspectionTestPlanService;
|
private OpsInspectionTestPlanServiceImpl opsInspectionTestPlanService;
|
||||||
|
@DubboReference
|
||||||
|
private RemoteUserService userService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询运维-巡检-试验任务
|
* 查询运维-巡检-试验任务
|
||||||
@ -105,7 +108,7 @@ public class OpsInspectionTestTaskServiceImpl implements IOpsInspectionTestTaskS
|
|||||||
lqw.eq(bo.getTestPlanId() != null, OpsInspectionTestTask::getTestPlanId, bo.getTestPlanId());
|
lqw.eq(bo.getTestPlanId() != null, OpsInspectionTestTask::getTestPlanId, bo.getTestPlanId());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getTestSetting()), OpsInspectionTestTask::getTestSetting, bo.getTestSetting());
|
lqw.eq(StringUtils.isNotBlank(bo.getTestSetting()), OpsInspectionTestTask::getTestSetting, bo.getTestSetting());
|
||||||
lqw.eq(bo.getPlanBeginTime() != null, OpsInspectionTestTask::getPlanBeginTime, bo.getPlanBeginTime());
|
lqw.eq(bo.getPlanBeginTime() != null, OpsInspectionTestTask::getPlanBeginTime, bo.getPlanBeginTime());
|
||||||
lqw.eq(bo.getProgress() != null, OpsInspectionTestTask::getProgress, bo.getProgress());
|
// lqw.eq(bo.getProgress() != null, OpsInspectionTestTask::getProgress, bo.getProgress());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getFailReason()), OpsInspectionTestTask::getFailReason, bo.getFailReason());
|
lqw.eq(StringUtils.isNotBlank(bo.getFailReason()), OpsInspectionTestTask::getFailReason, bo.getFailReason());
|
||||||
lqw.eq(bo.getFailTime() != null, OpsInspectionTestTask::getFailTime, bo.getFailTime());
|
lqw.eq(bo.getFailTime() != null, OpsInspectionTestTask::getFailTime, bo.getFailTime());
|
||||||
lqw.eq(bo.getFailPhase() != null, OpsInspectionTestTask::getFailPhase, bo.getFailPhase());
|
lqw.eq(bo.getFailPhase() != null, OpsInspectionTestTask::getFailPhase, bo.getFailPhase());
|
||||||
@ -143,10 +146,36 @@ public class OpsInspectionTestTaskServiceImpl implements IOpsInspectionTestTaskS
|
|||||||
* @return 是否修改成功
|
* @return 是否修改成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean updateByBo(OpsInspectionTestTaskBo bo) {
|
public R<Void> updateByBo(OpsInspectionTestTaskBo bo) {
|
||||||
OpsInspectionTestTask update = MapstructUtils.convert(bo, OpsInspectionTestTask.class);
|
OpsInspectionTestTask update = MapstructUtils.convert(bo, OpsInspectionTestTask.class);
|
||||||
validEntityBeforeSave(update);
|
validEntityBeforeSave(update);
|
||||||
return baseMapper.updateById(update) > 0;
|
|
||||||
|
OpsInspectionTestTaskVo oldVo = baseMapper.selectVoById(bo.getId());
|
||||||
|
|
||||||
|
if (!oldVo.getStatus().equals("5") && bo.getStatus().equals("5")){
|
||||||
|
//判断节点是否全部完成
|
||||||
|
List<String> split = Arrays.stream(bo.getNodeIds().split(",")).toList();
|
||||||
|
LambdaQueryWrapper<OpsInspectionNode> nodeLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
nodeLambdaQueryWrapper.in(OpsInspectionNode::getId, split);
|
||||||
|
//全部节点
|
||||||
|
List<OpsInspectionNodeVo> nodeVos = nodeMapper.selectVoList(nodeLambdaQueryWrapper);
|
||||||
|
boolean isAllFinish = true;
|
||||||
|
for (OpsInspectionNodeVo nodeVo : nodeVos) {
|
||||||
|
if (nodeVo.getStatus().equals("2")) {
|
||||||
|
isAllFinish = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!isAllFinish){
|
||||||
|
return R.fail("节点尚未全部完成");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
boolean b = baseMapper.updateById(update) > 0;
|
||||||
|
if (b){
|
||||||
|
return R.ok();
|
||||||
|
}else {
|
||||||
|
return R.fail();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -175,22 +204,62 @@ public class OpsInspectionTestTaskServiceImpl implements IOpsInspectionTestTaskS
|
|||||||
* 处理回显信息
|
* 处理回显信息
|
||||||
*/
|
*/
|
||||||
private void setValue(List<OpsInspectionTestTaskVo> list){
|
private void setValue(List<OpsInspectionTestTaskVo> list){
|
||||||
for (OpsInspectionTestTaskVo opsInspectionTestTaskVo : list) {
|
|
||||||
if(opsInspectionTestTaskVo.getPerson()!= null){
|
LambdaQueryWrapper<OpsInspectionNode> nodeWrapper = new LambdaQueryWrapper<>();
|
||||||
OpsUserVo opsUserVo = opsUserService.queryById(opsInspectionTestTaskVo.getPerson());
|
|
||||||
if (opsUserVo != null){
|
for (OpsInspectionTestTaskVo vo : list) {
|
||||||
opsInspectionTestTaskVo.setPersonInfo(opsUserVo);
|
|
||||||
|
if(vo.getPerson()!= null){
|
||||||
|
List<RemoteUserVo> remoteUserVos = userService.selectListByIds(List.of(vo.getPerson()));
|
||||||
|
if (remoteUserVos != null && !remoteUserVos.isEmpty()){
|
||||||
|
vo.setPersonInfo(remoteUserVos.getFirst());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (vo.getTestPlanId() != null){
|
||||||
if (opsInspectionTestTaskVo.getTestPlanId() != null){
|
OpsInspectionTestPlanVo opsInspectionTestPlanVo = opsInspectionTestPlanService.queryById(vo.getTestPlanId());
|
||||||
OpsInspectionTestPlanVo opsInspectionTestPlanVo = opsInspectionTestPlanService.queryById(opsInspectionTestTaskVo.getTestPlanId());
|
|
||||||
if (opsInspectionTestPlanVo != null){
|
if (opsInspectionTestPlanVo != null){
|
||||||
opsInspectionTestTaskVo.setTestPlan(opsInspectionTestPlanVo);
|
vo.setTestPlan(opsInspectionTestPlanVo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//处理节点回显列表
|
||||||
|
if (vo.getNodeIds() != null && !vo.getNodeIds().isEmpty()){
|
||||||
|
|
||||||
|
List<String> stringList = Arrays.stream(vo.getNodeIds().split(",")).toList();
|
||||||
|
|
||||||
|
nodeWrapper.clear();
|
||||||
|
nodeWrapper.in(OpsInspectionNode::getId, stringList);
|
||||||
|
List<OpsInspectionNodeVo> nodeVoList = nodeMapper.selectVoList(nodeWrapper);
|
||||||
|
|
||||||
|
//处理进度百分比 完成节点 / 总节点 * 100
|
||||||
|
if (nodeVoList != null && !nodeVoList.isEmpty()){
|
||||||
|
//统计完成节点
|
||||||
|
int finishCount = nodeVoList.stream().filter(nodeVo -> nodeVo.getStatus().equals("1")).toList().size();
|
||||||
|
if (finishCount == nodeVoList.size()){
|
||||||
|
vo.setProgress(new BigDecimal("100"));
|
||||||
|
}else {
|
||||||
|
vo.setProgress(BigDecimal.valueOf(finishCount).divide(BigDecimal.valueOf(nodeVoList.size()), 2, RoundingMode.DOWN).multiply(BigDecimal.valueOf(100.00)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//处理节点列表
|
||||||
|
if (vo.getNodeIds() != null && !vo.getNodeIds().isEmpty()){
|
||||||
|
|
||||||
|
List<OpsInspectionNodeVo> nodeVos = new ArrayList<>();
|
||||||
|
for (String id : stringList) {
|
||||||
|
OpsInspectionNodeVo nodeVo = nodeMapper.selectVoById(id);
|
||||||
|
if (nodeVo != null) {
|
||||||
|
nodeVos.add(nodeVo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
vo.setNodes(nodeVos);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -214,6 +283,9 @@ public class OpsInspectionTestTaskServiceImpl implements IOpsInspectionTestTaskS
|
|||||||
if (list==null || list.isEmpty()){
|
if (list==null || list.isEmpty()){
|
||||||
return R.fail("没有数据");
|
return R.fail("没有数据");
|
||||||
}
|
}
|
||||||
|
//筛选出本月数据
|
||||||
|
List<OpsInspectionTestTaskVo> benyueList = list.stream().filter(vo -> vo.getPlanBeginTime() != null && vo.getPlanFinishTime() != null && vo.getPlanBeginTime().after(startDate) && vo.getPlanFinishTime().before(endDate)).toList();
|
||||||
|
|
||||||
OpsInspectionTestTaskRecord record = new OpsInspectionTestTaskRecord();
|
OpsInspectionTestTaskRecord record = new OpsInspectionTestTaskRecord();
|
||||||
|
|
||||||
//完成实验数
|
//完成实验数
|
||||||
@ -221,33 +293,98 @@ public class OpsInspectionTestTaskServiceImpl implements IOpsInspectionTestTaskS
|
|||||||
//待分析记录
|
//待分析记录
|
||||||
Long failCount = 0L;
|
Long failCount = 0L;
|
||||||
//总共完成时间
|
//总共完成时间
|
||||||
Long totalTestTime = 0L;
|
long totalTestTime = 0L;
|
||||||
|
|
||||||
for (OpsInspectionTestTaskVo opsInspectionTestTaskVo : list) {
|
for (OpsInspectionTestTaskVo vo : benyueList) {
|
||||||
if (opsInspectionTestTaskVo.getPlanFinishTime().after(startDate) && opsInspectionTestTaskVo.getPlanFinishTime().before(endDate) && opsInspectionTestTaskVo.getStatus().equals("5")){
|
//只统计开始和结束都在本月内的
|
||||||
|
if (vo.getStatus().equals("5")){
|
||||||
finishCount++;
|
finishCount++;
|
||||||
totalTestTime += opsInspectionTestTaskVo.getPlanFinishTime().getTime() - opsInspectionTestTaskVo.getPlanBeginTime().getTime();
|
totalTestTime += vo.getPlanFinishTime().getTime() - vo.getPlanBeginTime().getTime();
|
||||||
}
|
}
|
||||||
if (opsInspectionTestTaskVo.getPlanFinishTime().after(startDate) && opsInspectionTestTaskVo.getPlanFinishTime().before(endDate) && opsInspectionTestTaskVo.getStatus().equals("3")){
|
|
||||||
|
if (vo.getStatus().equals("3") && vo.getUnPack().equals("1")){
|
||||||
failCount++;
|
failCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
record.setFinishCount(finishCount);
|
|
||||||
record.setFailCount(failCount);
|
|
||||||
record.setPassValue(BigDecimal.valueOf(finishCount).divide(BigDecimal.valueOf(list.size()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100")));
|
|
||||||
record.setAverageTestTime(totalTestTime/finishCount);
|
|
||||||
|
|
||||||
//统计上一月的数据
|
record.setFinishCount(String.valueOf(finishCount));
|
||||||
firstDay = LocalDate.now().minusMonths(1).withDayOfMonth(1);
|
record.setFailCount(String.valueOf(failCount));
|
||||||
lastDay = firstDay.plusMonths(1).minusDays(1);
|
if (!list.isEmpty() && !benyueList.isEmpty()) {
|
||||||
Date finalEndDate = Date.from(firstDay.atStartOfDay(ZoneId.systemDefault()).toInstant());
|
record.setPassValue(String.valueOf(BigDecimal.valueOf(finishCount).divide(BigDecimal.valueOf(benyueList.size()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))));
|
||||||
Date finalStartDate = Date.from(lastDay.atTime(23, 59, 59).atZone(ZoneId.systemDefault()).toInstant());
|
}else {
|
||||||
|
record.setPassValue("0");
|
||||||
|
}
|
||||||
|
if(finishCount >0 ) {
|
||||||
|
record.setAverageTestTime(BigDecimal.valueOf((double) TimeUnit.MILLISECONDS.toMinutes(totalTestTime) / finishCount).toString());
|
||||||
|
}else {
|
||||||
|
record.setAverageTestTime("0");
|
||||||
|
}
|
||||||
|
//统计上一月的数据finalStartDate finalEndDate
|
||||||
|
Date finalStartDate = Date.from(LocalDate.now().minusMonths(1).withDayOfMonth(1).atStartOfDay(ZoneId.systemDefault()).toInstant());
|
||||||
|
Date finalEndDate = Date.from(LocalDate.now().minusMonths(1).withDayOfMonth(1).plusMonths(1).minusDays(1).atTime(23, 59, 59).atZone(ZoneId.systemDefault()).toInstant());
|
||||||
|
|
||||||
//上月数据列表
|
//上月数据列表
|
||||||
List<OpsInspectionTestTaskVo> lastMonth = list.stream().filter(testTaskVo -> testTaskVo.getPlanBeginTime().before(finalEndDate) && testTaskVo.getPlanFinishTime().after(finalStartDate))
|
List<OpsInspectionTestTaskVo> lastMonth = list.stream().filter(testTaskVo -> testTaskVo.getCreateTime().before(finalEndDate) && testTaskVo.getCreateTime().after(finalStartDate))
|
||||||
.toList();
|
.toList();
|
||||||
|
log.info("上月数据列表:{}",lastMonth);
|
||||||
|
|
||||||
|
//上月完成数
|
||||||
|
finishCount = 0L;
|
||||||
|
//上月实验通过率
|
||||||
|
BigDecimal passValue = BigDecimal.ZERO;
|
||||||
|
//上月平均实验时长
|
||||||
|
totalTestTime = 0L;
|
||||||
|
|
||||||
|
for (OpsInspectionTestTaskVo vo : lastMonth) {
|
||||||
|
if (vo.getStatus().equals("5")){
|
||||||
|
finishCount++;
|
||||||
|
totalTestTime += vo.getPlanFinishTime().getTime() - vo.getPlanBeginTime().getTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
log.info("上月完成数:{}",finishCount);
|
||||||
|
log.info("上月总共时长:{}",totalTestTime);
|
||||||
|
|
||||||
|
//完成数增长率
|
||||||
|
BigDecimal wcszzl;
|
||||||
|
if (BigDecimal.valueOf(finishCount).compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
wcszzl = BigDecimal.valueOf(Double.parseDouble(record.getFinishCount())).divide(BigDecimal.valueOf(finishCount), 2, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100.00));
|
||||||
|
}else {
|
||||||
|
wcszzl = BigDecimal.ZERO;
|
||||||
|
}
|
||||||
|
record.setFinishCountAdd(wcszzl.toString());
|
||||||
|
|
||||||
|
//上月通过率
|
||||||
|
if(BigDecimal.valueOf(lastMonth.size()).compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
passValue = BigDecimal.valueOf(Double.valueOf(finishCount)).divide(BigDecimal.valueOf(lastMonth.size()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
|
||||||
|
}
|
||||||
|
log.info("上月通过率:{}",passValue);
|
||||||
|
//进行比较 得出通过增长率
|
||||||
|
BigDecimal tgzzl;
|
||||||
|
if(passValue.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
tgzzl = BigDecimal.valueOf(Double.parseDouble(record.getPassValue())).divide(passValue, 2, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100.00));
|
||||||
|
}else {
|
||||||
|
tgzzl = BigDecimal.ZERO;
|
||||||
|
}
|
||||||
|
record.setPassValueAdd(tgzzl.toString());
|
||||||
|
|
||||||
|
//上月平均实验时间
|
||||||
|
BigDecimal sypjsj;
|
||||||
|
if (finishCount > 0) {
|
||||||
|
sypjsj = BigDecimal.valueOf((double) TimeUnit.MILLISECONDS.toMinutes(totalTestTime) / finishCount);
|
||||||
|
}else {
|
||||||
|
sypjsj = BigDecimal.ZERO;
|
||||||
|
}
|
||||||
|
log.info("上月平均实验分钟数:{}",sypjsj);
|
||||||
|
log.info("本月平均实验分钟数:{}",record.getAverageTestTime());
|
||||||
|
//平均时间增长率
|
||||||
|
BigDecimal sysjzzl;
|
||||||
|
if (BigDecimal.valueOf(Double.parseDouble(record.getAverageTestTime())).compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
sysjzzl=sypjsj.divide(BigDecimal.valueOf(Double.parseDouble(record.getAverageTestTime())), 2, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100.00));
|
||||||
|
}else {
|
||||||
|
sysjzzl = BigDecimal.ZERO;
|
||||||
|
}
|
||||||
|
log.info("实验分钟数增长率:{}",sysjzzl);
|
||||||
|
record.setAverageTestTimeAdd(sysjzzl.toString());
|
||||||
|
|
||||||
return R.ok(record);
|
return R.ok(record);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user