@@ -99,6 +99,17 @@ public class InspectionController { | |||
return iInspectionService.getVideoById(id); | |||
} | |||
/** | |||
* 获取飞行轨迹 | |||
* @param id | |||
* @return | |||
*/ | |||
@GetMapping("/findFlightData/{id}") | |||
public JsonResult finFlightData(@PathVariable("id") String id){ | |||
return iInspectionService.findFlightData(id); | |||
} | |||
/** | |||
* 删除巡检任务 | |||
*/ |
@@ -17,10 +17,15 @@ import lombok.experimental.Accessors; | |||
public class FlightData extends BaseEntity { | |||
private static final long serialVersionUID = 1L; | |||
/** | |||
* 租户id | |||
*/ | |||
private String tenantId; | |||
/** | |||
* 巡检任务ID | |||
*/ | |||
private Integer inspectionId; | |||
private String inspectionId; | |||
/** | |||
* 云盒SN号 |
@@ -3,9 +3,13 @@ package com.tuoheng.admin.mapper; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
import com.tuoheng.admin.entity.FlightData; | |||
import java.util.List; | |||
/** | |||
* @Author ChengWang | |||
* @Date 2022/12/1 | |||
*/ | |||
public interface FlightDataMapper extends BaseMapper<FlightData> { | |||
List<FlightData> selectListByInspectionId(String id); | |||
} |
@@ -84,4 +84,10 @@ public interface IInspectionService { | |||
*/ | |||
JsonResult resubmit(EditInspectionRequest editInspectionRequest); | |||
/** | |||
* 获取飞行轨迹 | |||
* @param id | |||
* @return | |||
*/ | |||
JsonResult findFlightData(String id); | |||
} |
@@ -56,6 +56,10 @@ public class InspectionServiceImpl implements IInspectionService { | |||
@Autowired | |||
private ResubmitInspectionService resubmitInspectionService; | |||
@Autowired | |||
private QueryFindFlightDataService queryFindFlightDataService; | |||
/** | |||
* 查询巡检任务分页分页列表 | |||
* | |||
@@ -161,4 +165,14 @@ public class InspectionServiceImpl implements IInspectionService { | |||
public JsonResult resubmit(EditInspectionRequest editInspectionRequest) { | |||
return resubmitInspectionService.resubmit(editInspectionRequest); | |||
} | |||
/** | |||
* 获取飞行轨迹 | |||
* @param id | |||
* @return | |||
*/ | |||
@Override | |||
public JsonResult findFlightData(String id) { | |||
return queryFindFlightDataService.findFlightData(id); | |||
} | |||
} |
@@ -0,0 +1,44 @@ | |||
package com.tuoheng.admin.service.inspection.query; | |||
import com.tuoheng.admin.entity.FlightData; | |||
import com.tuoheng.admin.enums.code.inspection.QueryInspectionInfoByIdCodeEnum; | |||
import com.tuoheng.admin.mapper.FlightDataMapper; | |||
import com.tuoheng.admin.mapper.InspectionMapper; | |||
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; | |||
/** | |||
* 获取飞行轨迹 业务处理层 | |||
* | |||
* @Author ChengWang | |||
* @Date 2022/12/1 | |||
*/ | |||
@Service | |||
@Slf4j | |||
public class QueryFindFlightDataService { | |||
@Autowired | |||
private InspectionMapper inspectionMapper; | |||
@Autowired | |||
private FlightDataMapper flightDataMapper; | |||
public JsonResult findFlightData(String id) { | |||
if(StringUtils.isEmpty(id)){ | |||
return JsonResult.error(QueryInspectionInfoByIdCodeEnum.INSPECTION_ID_IS_NULL.getCode(),QueryInspectionInfoByIdCodeEnum.INSPECTION_ID_IS_NULL.getMsg()); | |||
} | |||
//根据任务id查询对应的云盒遥测数据 | |||
List<FlightData> listData = flightDataMapper.selectListByInspectionId(id); | |||
return JsonResult.success(listData); | |||
} | |||
} |
@@ -4,4 +4,40 @@ | |||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
<mapper namespace="com.tuoheng.admin.mapper.FlightDataMapper"> | |||
<resultMap id="BaseResultMap" type="com.tuoheng.admin.entity.FlightData"> | |||
<id column="id" jdbcType="INTEGER" property="id" /> | |||
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||
<result column="inspection_id" jdbcType="VARCHAR" property="inspectionId" /> | |||
<result column="box_sn" jdbcType="VARCHAR" property="boxSn" /> | |||
<result column="lng" jdbcType="VARCHAR" property="lng" /> | |||
<result column="lat" jdbcType="VARCHAR" property="lat" /> | |||
<result column="altitude" jdbcType="VARCHAR" property="altitude" /> | |||
<result column="ultrasonic" jdbcType="VARCHAR" property="ultrasonic" /> | |||
<result column="pitch" jdbcType="VARCHAR" property="pitch" /> | |||
<result column="roll" jdbcType="VARCHAR" property="roll" /> | |||
<result column="yaw" jdbcType="VARCHAR" property="yaw" /> | |||
<result column="airspeed" jdbcType="VARCHAR" property="airspeed" /> | |||
<result column="velocity" jdbcType="VARCHAR" property="velocity" /> | |||
<result column="timestamp" jdbcType="VARCHAR" property="timestamp" /> | |||
<result column="is_srt" jdbcType="INTEGER" property="isSrt" /> | |||
<result column="create_user" jdbcType="VARCHAR" property="createUser" /> | |||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> | |||
<result column="update_user" jdbcType="VARCHAR" property="updateUser" /> | |||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> | |||
<result column="mark" jdbcType="INTEGER" property="mark" /> | |||
</resultMap> | |||
<sql id="Base_Column_List"> | |||
id, tenant_id, inspection_id, box_sn, lng, lat, altitude, ultrasonic, pitch, roll, yaw, airspeed, | |||
velocity, `timestamp`, is_srt, create_user, create_time, update_user, update_time, mark | |||
</sql> | |||
<select id="selectListByInspectionId" resultMap="BaseResultMap"> | |||
select | |||
<include refid="Base_Column_List"/> | |||
from th_flight_data | |||
where inspection_id = #{id} | |||
and mark = 1 | |||
order by timestamp asc | |||
</select> | |||
</mapper> |