Sfoglia il codice sorgente

重构获取轨迹代码

tags/v1.2.0^2
wanjing 1 anno fa
parent
commit
472e961fa5
4 ha cambiato i file con 15 aggiunte e 8 eliminazioni
  1. +2
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/mapper/ThInspectionMapper.java
  2. +7
    -2
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/airport/drone/QueryDroneDataService.java
  3. +5
    -4
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java
  4. +1
    -1
      tuoheng-admin/src/main/resources/mapper/ThInspectionMapper.xml

+ 2
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/mapper/ThInspectionMapper.java Vedi File

@@ -5,9 +5,10 @@ import com.tuoheng.admin.entity.domain.ThInspection;
import com.tuoheng.admin.entity.domain.ThMission;

import java.util.List;
import java.util.Map;

public interface ThInspectionMapper extends BaseMapper<ThInspection> {

List<ThInspection> selectListByMissionId(Integer missionId, Integer tenantId);
List<ThInspection> selectListByMissionId(Map<String, Object> map);

}

+ 7
- 2
tuoheng-admin/src/main/java/com/tuoheng/admin/service/airport/drone/QueryDroneDataService.java Vedi File

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.conver.InspectionConverMapper;
import com.tuoheng.admin.entity.domain.ThInspection;
import com.tuoheng.admin.entity.domain.ThMission;
import com.tuoheng.admin.entity.domain.WarningRecord;
import com.tuoheng.admin.entity.vo.index.DroneDataVo;
import com.tuoheng.admin.enums.MarkTypeEnum;
import com.tuoheng.admin.enums.TaskStatusEnum;
@@ -21,7 +22,9 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Slf4j
@Service
@@ -44,7 +47,6 @@ public class QueryDroneDataService {
// 读取不同租户的机场平台url
User user = ShiroUtils.getUserInfo();
Integer tenantId = user.getTenantId();

ThMission mission = missionMapper.selectOne(new LambdaQueryWrapper<ThMission>()
.eq(ThMission::getTenantId, tenantId)
.eq(ThMission::getAirportId, airportId)
@@ -55,7 +57,10 @@ public class QueryDroneDataService {
throw new ServiceException("没有正在飞行的任务");
}

List<ThInspection> inspectionList = inspectionMapper.selectListByMissionId(mission.getId(), ShiroUtils.getTenantId());
Map<String, Object> map = new HashMap<>();
map.put("id", mission.getId());
map.put("tenantId", tenantId);
List<ThInspection> inspectionList = inspectionMapper.selectListByMissionId(map);
if (CollectionUtil.isEmpty(inspectionList)) {
log.info("获取无人机数据信息, 数据为空");
JsonResult.success("数据为空");

+ 5
- 4
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java Vedi File

@@ -41,9 +41,7 @@ import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;

import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.*;

/**
* @User qiujinyang
@@ -257,7 +255,10 @@ public class ThInspectionServiceImpl extends BaseServiceImpl<ThInspectionMapper,
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
//根据任务id查询对应的遥测数据
List<ThInspection> listData = inspectionMapper.selectListByMissionId(id, ShiroUtils.getTenantId());//xz
Map<String, Object> map = new HashMap<>();
map.put("id", id);
map.put("tenantId", ShiroUtils.getTenantId());
List<ThInspection> listData = inspectionMapper.selectListByMissionId(map);
return JsonResult.success(listData);
}


+ 1
- 1
tuoheng-admin/src/main/resources/mapper/ThInspectionMapper.xml Vedi File

@@ -27,7 +27,7 @@
create_user, create_time, update_user, update_time, mark
</sql>

<select id="selectListByMissionId" resultType="com.tuoheng.admin.entity.domain.ThInspection">
<select id="selectListByMissionId" parameterType="java.util.Map" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from th_inspection

Loading…
Annulla
Salva