@@ -131,5 +131,16 @@ public class InspectionController { | |||
return JsonResult.success(inspectionService.track(inspectionRequest)); | |||
} | |||
/** | |||
* 获取飞行轨迹 | |||
* @param id | |||
* @return | |||
*/ | |||
@GetMapping("/fightData/{id}") | |||
public JsonResult fightData(@PathVariable("id") Integer id){ | |||
return inspectionService.fightData(id); | |||
} | |||
} |
@@ -2,8 +2,11 @@ package com.tuoheng.admin.mapper; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
import com.tuoheng.admin.entity.domain.ThInspection; | |||
import com.tuoheng.admin.entity.domain.ThMission; | |||
import java.util.List; | |||
public interface ThInspectionMapper extends BaseMapper<ThInspection> { | |||
List<ThInspection> selectListByInspectionId(Integer id); | |||
} |
@@ -33,4 +33,7 @@ public interface IThInspectionService extends IBaseService<ThInspection> { | |||
JsonResult executeTask(String missionId,PushAndPullURLRequest pushAndPull) throws ServiceException; | |||
JsonResult lineTrack(Integer missionId); | |||
JsonResult fightData(Integer id); | |||
} |
@@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil; | |||
import com.alibaba.fastjson.JSONArray; | |||
import com.alibaba.fastjson.JSONObject; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.tuoheng.admin.common.ServiceExceptionEnum; | |||
import com.tuoheng.admin.entity.domain.Tenant; | |||
import com.tuoheng.admin.entity.domain.ThInspection; | |||
import com.tuoheng.admin.entity.domain.ThMission; | |||
@@ -223,5 +224,17 @@ public class ThInspectionServiceImpl extends BaseServiceImpl<ThInspectionMapper, | |||
return jsonResult; | |||
} | |||
@Override | |||
public JsonResult fightData(Integer id) { | |||
//校验 | |||
if(null == id){ | |||
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL); | |||
} | |||
//根据任务id查询对应的遥测数据 | |||
List<ThInspection> listData = inspectionMapper.selectListByInspectionId(id); | |||
return JsonResult.success(listData); | |||
} | |||
} |
@@ -51,7 +51,7 @@ public class WarningDetailsService { | |||
private ThMissionMapper missionMapper; | |||
public JsonResult details(Integer id) { | |||
// User user = ShiroUtils.getUserInfo(); | |||
//User user = ShiroUtils.getUserInfo(); | |||
// Integer tenantId = user.getTenantId(); | |||
Integer tenantId = 1; | |||
//校验 |
@@ -1,4 +1,35 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
<mapper namespace="com.tuoheng.admin.mapper.ThInspectionMapper"> | |||
<resultMap id="BaseResultMap" type="com.tuoheng.admin.entity.domain.ThInspection"> | |||
<id column="id" jdbcType="INTEGER" property="id" /> | |||
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||
<result column="inspection_id" jdbcType="INTEGER" property="inspectionId" /> | |||
<result column="mission_id" jdbcType="INTEGER" property="missionId" /> | |||
<result column="lng" jdbcType="VARCHAR" property="lng" /> | |||
<result column="lat" jdbcType="VARCHAR" property="lat" /> | |||
<result column="host_ip" jdbcType="VARCHAR" property="hostIp" /> | |||
<result column="altitude" jdbcType="VARCHAR" property="altitude" /> | |||
<result column="fly_time" jdbcType="INTEGER" property="flyTime" /> | |||
<result column="create_user" jdbcType="INTEGER" property="createUser" /> | |||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> | |||
<result column="update_user" jdbcType="INTEGER" 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, mission_id, lng, lat, host_ip, altitude, fly_time, create_user, create_time, update_user, | |||
update_time, mark | |||
</sql> | |||
<select id="selectListByInspectionId" resultType="com.tuoheng.admin.entity.domain.ThInspection"> | |||
select | |||
<include refid="Base_Column_List"/> | |||
from th_inspection | |||
where mission_id = #{id} | |||
and mark = 1 | |||
order by create_time asc | |||
</select> | |||
</mapper> |