@@ -38,7 +38,7 @@ public class InspectionController { | |||
* 获取巡检任务详细信息 | |||
*/ | |||
@GetMapping(value = "/{id}") | |||
public JsonResult getInfo(String id) { | |||
public JsonResult getInfo(@PathVariable("id") String id) { | |||
log.info("进入查询任务详情接口, id={}", id); | |||
return iInspectionService.selectOneById(id); | |||
} |
@@ -3,6 +3,7 @@ package com.tuoheng.admin.conver; | |||
import com.tuoheng.admin.entity.Inspection; | |||
import com.tuoheng.admin.request.inspection.AddInspectionRequest; | |||
import com.tuoheng.admin.request.inspection.EditInspectionRequest; | |||
import com.tuoheng.admin.vo.InspectionDetailsVo; | |||
import com.tuoheng.admin.vo.InspectionVo; | |||
import org.mapstruct.Mapper; | |||
import org.mapstruct.factory.Mappers; | |||
@@ -20,4 +21,6 @@ public interface InspectionConverMapper { | |||
List<InspectionVo> fromInspectionListToInspectionVoList(List<Inspection> inspectionList); | |||
InspectionDetailsVo fromInspectionToInspectionDetailsVo(Inspection inspection); | |||
} |
@@ -28,154 +28,245 @@ public class Inspection extends BaseEntity { | |||
private static final long serialVersionUID = 1L; | |||
/** 租户ID */ | |||
/** | |||
* 租户ID | |||
*/ | |||
private String tenantId; | |||
/** 部门ID */ | |||
/** | |||
* 部门ID | |||
*/ | |||
private String deptId; | |||
/** 巡检任务编号 */ | |||
/** | |||
* 巡检任务编号 | |||
*/ | |||
private String code; | |||
/** 巡检任务名称 */ | |||
/** | |||
* 巡检任务名称 | |||
*/ | |||
private String name; | |||
/** 巡检任务类型 1 临时巡检 */ | |||
/** | |||
* 巡检任务类型 1 临时巡检 | |||
*/ | |||
private Integer type; | |||
/** 公路ID */ | |||
/** | |||
* 公路ID | |||
*/ | |||
private String roadId; | |||
/** 公路名称 */ | |||
/** | |||
* 公路名称 | |||
*/ | |||
private String roadName; | |||
/** 路段ID */ | |||
/** | |||
* 路段ID | |||
*/ | |||
private String sectionId; | |||
/** 路段名称 */ | |||
/** | |||
* 路段名称 | |||
*/ | |||
private String sectionName; | |||
/** 巡检方式类型 1 无人机 2机场 */ | |||
/** | |||
* 巡检方式类型 1 无人机 2机场巡逻 3飞手值飞 | |||
*/ | |||
private Integer inspectionType; | |||
/** 巡检机场id */ | |||
/** | |||
* 巡检机场id | |||
*/ | |||
private Integer airportId; | |||
/** 巡检机场名称 */ | |||
/** | |||
* 巡检机场名称 */ | |||
private String airportName; | |||
/** 巡检线路id */ | |||
/** | |||
* 巡检线路id */ | |||
private Integer inspectionLine; | |||
/** 巡检线路名称 */ | |||
/** | |||
* 巡检线路名称 | |||
*/ | |||
private String inspectionLineName; | |||
/** 飞行设备 */ | |||
/** | |||
* 飞行设备 | |||
*/ | |||
private String equipmentId; | |||
/** 飞行设备名称 */ | |||
/** | |||
* 飞行设备名称 | |||
*/ | |||
private String equipmentName; | |||
/** 挂载设备(多选逗号","分隔) */ | |||
/** | |||
* 挂载设备(多选逗号","分隔) | |||
*/ | |||
private String equipmentMountId; | |||
/** 挂载设备名称(多选逗号","分隔) */ | |||
/** | |||
* 挂载设备名称(多选逗号","分隔) | |||
*/ | |||
private String equipmentMountName; | |||
/** 5G云盒ID */ | |||
/** | |||
* 5G云盒ID */ | |||
private String cloudBoxId; | |||
/** 云盒名称 */ | |||
/** | |||
* 云盒名称 */ | |||
private String cloudBoxName; | |||
/** 云盒SN号 */ | |||
/** | |||
* 云盒SN号 */ | |||
private String boxSn; | |||
/** 飞手(多选逗号","分隔) */ | |||
/** | |||
* 飞手(多选逗号","分隔) */ | |||
private String flightHand; | |||
/** 飞手姓名(多选逗号","分隔) */ | |||
/** | |||
* 飞手姓名(多选逗号","分隔) | |||
*/ | |||
private String flightHandName; | |||
/** 计划巡检日期 */ | |||
/** | |||
* 计划巡检日期 | |||
*/ | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | |||
private Date inspectionTime; | |||
/** 执行开始时间 */ | |||
/** | |||
* 执行开始时间 | |||
*/ | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | |||
private Date executionStartTime; | |||
/** 执行结束时间 */ | |||
/** | |||
* 执行结束时间 | |||
*/ | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | |||
private Date executionEndTime; | |||
/** 是否实时,1:实时 2:离线 默认:null */ | |||
/** | |||
* 是否实时,1:实时 2:离线 默认:null | |||
*/ | |||
private Integer isLive; | |||
/** 是否正摄:1是 2否 */ | |||
/** | |||
* 是否正摄:1是 2否 | |||
*/ | |||
private Integer isTaken; | |||
/** 是否倾斜摄影:1是 2否 */ | |||
/** | |||
* 是否倾斜摄影:1是 2否 | |||
*/ | |||
private Integer isTilt; | |||
/** 原视频地址 */ | |||
/** | |||
* 原视频地址 | |||
*/ | |||
private String videoUrl; | |||
/** AI识别后视频地址 */ | |||
/** | |||
* AI识别后视频地址 | |||
*/ | |||
private String aiVideoUrl; | |||
/** 报告地址 */ | |||
/** | |||
* 报告地址 | |||
*/ | |||
private String reportUrl; | |||
/** SRT文件地址 */ | |||
/** | |||
* SRT文件地址 | |||
*/ | |||
private String srtUrl; | |||
/** 任务状态 5任务待飞行 7飞行失败 10任务飞行中 15任务飞行完成 */ | |||
/** | |||
* 任务状态 5任务待飞行 7飞行失败 10任务飞行中 15任务飞行完成 | |||
*/ | |||
private Integer status; | |||
/** 算法处理状态:0默认 1待上传 2待分析 3分析中 4成功 5超时 6失败 */ | |||
/** | |||
* 算法处理状态:0默认 1待上传 2待分析 3分析中 4成功 5超时 6失败 | |||
*/ | |||
private Integer analyseStatus; | |||
/** ai任务分析进度 */ | |||
/** | |||
* | |||
* ai任务分析进度 | |||
*/ | |||
private BigDecimal progressbar; | |||
/** 备注 */ | |||
/** | |||
* 备注 | |||
*/ | |||
private String note; | |||
/** 巡检时天气情况 */ | |||
/** | |||
* 巡检时天气情况 | |||
*/ | |||
private String weather; | |||
/** 飞行高度 */ | |||
/** | |||
* 飞行高度 | |||
*/ | |||
private String flyHeight; | |||
/** srt文件名称 */ | |||
/** | |||
* srt文件名称 | |||
*/ | |||
private String srtName; | |||
/** ai心跳更新时间 */ | |||
/** | |||
* ai心跳更新时间 | |||
*/ | |||
private Long heartbeatTime; | |||
/** 定时任务的执行状态。1:未执行,2:已执行 */ | |||
/** | |||
* 定时任务的执行状态。1:未执行,2:已执行 | |||
*/ | |||
private Long executionStatus; | |||
/** 起点经度 */ | |||
/** | |||
* 起点经度 | |||
*/ | |||
private String startLongitude; | |||
/** 起点纬度 */ | |||
/** | |||
* 起点纬度 | |||
*/ | |||
private String startLatitude; | |||
/** 终点经度 */ | |||
/** | |||
* 终点经度 | |||
*/ | |||
private String endLongitude; | |||
/** 终点纬度 */ | |||
/** | |||
* 终点纬度 | |||
*/ | |||
private String endLatitude; | |||
/** 联系方式 */ | |||
/** | |||
* 联系方式 | |||
*/ | |||
private String mobile; | |||
/** 巡逻地点 */ | |||
/** | |||
* 巡逻地点 | |||
*/ | |||
private String patrolLocation; | |||
} |
@@ -1,17 +1,25 @@ | |||
package com.tuoheng.admin.service.inspection.query; | |||
import cn.hutool.core.collection.CollectionUtil; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.tuoheng.admin.conver.InspectionConverMapper; | |||
import com.tuoheng.admin.entity.Inspection; | |||
import com.tuoheng.admin.entity.InspectionHistory; | |||
import com.tuoheng.admin.enums.InspectionStatusEnum; | |||
import com.tuoheng.admin.enums.code.inspection.QueryInspectionByIdCodeEnum; | |||
import com.tuoheng.admin.mapper.DeptMapper; | |||
import com.tuoheng.admin.mapper.InspectionFileMapper; | |||
import com.tuoheng.admin.mapper.InspectionHistoryMapper; | |||
import com.tuoheng.admin.mapper.InspectionMapper; | |||
import com.tuoheng.admin.vo.InspectionDetailsVo; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
import com.tuoheng.common.core.utils.StringUtils; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
import java.util.List; | |||
/** | |||
* 根据Id查询巡检任务详情业务层处理 | |||
* | |||
@@ -23,12 +31,11 @@ import org.springframework.stereotype.Service; | |||
@Service | |||
public class QueryInspectionByIdService { | |||
@Autowired | |||
private DeptMapper deptMapper; | |||
@Autowired | |||
private InspectionMapper inspectionMapper; | |||
private InspectionFileMapper inspectionFileMapper; | |||
@Autowired | |||
private InspectionHistoryMapper inspectionHistoryMapper; | |||
public JsonResult getInfo(String id) { | |||
log.info("进入查询巡检任务详情业务"); | |||
@@ -40,7 +47,18 @@ public class QueryInspectionByIdService { | |||
Inspection inspection = (Inspection) result.getData(); | |||
return JsonResult.success(); | |||
InspectionDetailsVo inspectionDetailsVo = InspectionConverMapper.INSTANCE.fromInspectionToInspectionDetailsVo(inspection); | |||
// 任务失败,查询任务失败记录 | |||
if (InspectionStatusEnum.FLIGHT_FAILED.getCode() == inspection.getStatus()) { | |||
List<InspectionHistory> inspectionHistoryList = this.getInspectionHistoryList(id); | |||
if (CollectionUtil.isEmpty(inspectionHistoryList)) { | |||
log.info("该任务没有失败记录"); | |||
} else { | |||
inspectionDetailsVo.setInspectionHistoryList(inspectionHistoryList); | |||
} | |||
} | |||
return JsonResult.success(inspectionDetailsVo); | |||
} | |||
/** | |||
@@ -65,4 +83,16 @@ public class QueryInspectionByIdService { | |||
return JsonResult.success(inspection); | |||
} | |||
/** | |||
* 检查参数 | |||
* @param id | |||
* @return | |||
*/ | |||
private List<InspectionHistory> getInspectionHistoryList(String id) { | |||
List<InspectionHistory> inspectionHistoryList = inspectionHistoryMapper.selectList(new LambdaQueryWrapper<InspectionHistory>() | |||
.eq(InspectionHistory::getInspectionId, id) | |||
.eq(InspectionHistory::getMark, 1)); | |||
return inspectionHistoryList; | |||
} | |||
} |
@@ -0,0 +1,100 @@ | |||
package com.tuoheng.admin.vo; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import com.tuoheng.admin.entity.InspectionHistory; | |||
import lombok.Data; | |||
import org.springframework.format.annotation.DateTimeFormat; | |||
import java.util.Date; | |||
import java.util.List; | |||
/** | |||
* 返回任务详情视图Vo | |||
* | |||
* @author wanjing | |||
* @team tuoheng | |||
* @date 2022-11-30 | |||
*/ | |||
@Data | |||
public class InspectionDetailsVo { | |||
private static final long serialVersionUID = 1L; | |||
/** | |||
* 主键ID | |||
*/ | |||
private String id; | |||
/** | |||
* 巡检任务名称 | |||
*/ | |||
private String name; | |||
/** | |||
* 巡检任务类型 1 临时巡检 | |||
*/ | |||
private Integer type; | |||
/** | |||
* 巡检方式类型 1 无人机 2机场巡逻 3飞手值飞 | |||
*/ | |||
private Integer inspectionType; | |||
/** | |||
* 公路名称 | |||
*/ | |||
private String roadName; | |||
/** | |||
* 路段名称 | |||
*/ | |||
private String sectionName; | |||
/** | |||
* 巡检机场名称 | |||
*/ | |||
private String airportName; | |||
/** | |||
* 巡检线路名称 | |||
*/ | |||
private String inspectionLineName; | |||
/** | |||
* 是否实时,1:实时 2:离线 默认:null | |||
*/ | |||
private Integer isLive; | |||
/** | |||
* 任务状态 5任务待飞行 7飞行失败 10任务飞行中 15任务飞行完成 | |||
*/ | |||
private Integer status; | |||
/** | |||
* 计划巡检日期 | |||
*/ | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | |||
private Date inspectionTime; | |||
/** | |||
* 飞行设备名称 | |||
*/ | |||
private String equipmentName; | |||
/** | |||
* 挂载设备名称(多选逗号","分隔) | |||
*/ | |||
private String equipmentMountName; | |||
/** | |||
* 巡检时天气情况 | |||
*/ | |||
private String weather; | |||
/** | |||
* 飞行失败数据 | |||
*/ | |||
private List<InspectionHistory> inspectionHistoryList; | |||
} |
@@ -71,7 +71,7 @@ public class InspectionVo extends BaseEntity { | |||
private String sectionName; | |||
/** | |||
* 巡检方式类型 1 无人机 2机场 | |||
* 巡检方式类型 1 无人机 2机场 3飞手值飞 | |||
*/ | |||
private Integer inspectionType; | |||
@@ -162,11 +162,13 @@ public class InspectionVo extends BaseEntity { | |||
private Date executionEndTime; | |||
/** | |||
* 是否实时,1:实时 2:离线 默认:null */ | |||
* 是否实时,1:实时 2:离线 默认:null | |||
*/ | |||
private Integer isLive; | |||
/** | |||
* 是否正摄:1是 2否 */ | |||
* 是否正摄:1是 2否 | |||
*/ | |||
private Integer isTaken; | |||
/** |