Pārlūkot izejas kodu

获取飞行轨迹

tags/v1.2.0^2
chengwang pirms 1 gada
vecāks
revīzija
907cb7713c
6 mainītis faili ar 62 papildinājumiem un 1 dzēšanām
  1. +11
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/controller/InspectionController.java
  2. +3
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/mapper/ThInspectionMapper.java
  3. +3
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/IThInspectionService.java
  4. +13
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java
  5. +1
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/details/WarningDetailsService.java
  6. +31
    -0
      tuoheng-admin/src/main/resources/mapper/ThInspectionMapper.xml

+ 11
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/controller/InspectionController.java Parādīt failu

@@ -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);
}



}

+ 3
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/mapper/ThInspectionMapper.java Parādīt failu

@@ -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);

}

+ 3
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/IThInspectionService.java Parādīt failu

@@ -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);

}

+ 13
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java Parādīt failu

@@ -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);
}


}

+ 1
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/details/WarningDetailsService.java Parādīt failu

@@ -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;
//校验

+ 31
- 0
tuoheng-admin/src/main/resources/mapper/ThInspectionMapper.xml Parādīt failu

@@ -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>

Notiek ielāde…
Atcelt
Saglabāt