|
|
@@ -7,7 +7,10 @@ import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.tuoheng.admin.entity.*; |
|
|
|
import com.tuoheng.admin.enums.*; |
|
|
|
import com.tuoheng.admin.enums.AiAnalyseTypeEnum; |
|
|
|
import com.tuoheng.admin.enums.FileTypeEnum; |
|
|
|
import com.tuoheng.admin.enums.InspectionFileStatusEnum; |
|
|
|
import com.tuoheng.admin.enums.SourceEnum; |
|
|
|
import com.tuoheng.admin.mapper.*; |
|
|
|
import com.tuoheng.admin.request.third.DspCallbackRequest; |
|
|
|
import com.tuoheng.admin.request.third.QuestionFile; |
|
|
@@ -163,7 +166,7 @@ public class DspCallbackServiceImpl implements IDspCallbackService { |
|
|
|
inspectionFile.setQuestionCode(questionFile.getQuestionCode()); |
|
|
|
//问题id |
|
|
|
//根据questionCode查询问题类型表出对应的id值 |
|
|
|
if(StringUtils.isNotEmpty(questionFile.getQuestionCode())){ |
|
|
|
if (StringUtils.isNotEmpty(questionFile.getQuestionCode())) { |
|
|
|
QuestionType questionType = questionTypeMapper.selectOne(Wrappers.<QuestionType>lambdaQuery() |
|
|
|
.eq(QuestionType::getCode, questionFile.getQuestionCode()) |
|
|
|
.eq(QuestionType::getMark, 1)); |
|
|
@@ -211,15 +214,20 @@ public class DspCallbackServiceImpl implements IDspCallbackService { |
|
|
|
int second = Integer.parseInt(startFrame) / 25; |
|
|
|
long shootTime = inspection.getExecutionStartTime().getTime() + second; |
|
|
|
FlightData flightData_off = getFlightDataByTime(flightDataList, shootTime); |
|
|
|
if (ObjectUtil.isNotNull(flightData_off)) { |
|
|
|
inspectionFile.setLongitude(flightData_off.getLng()); |
|
|
|
inspectionFile.setLatitude(flightData_off.getLat()); |
|
|
|
} |
|
|
|
JSONObject gaodeCoordinateOff = GaodeUtil.getGaodeCoordinate(flightData_off.getLng(), flightData_off.getLat()); |
|
|
|
inspectionFile.setLongitude(flightData_off.getLng()); |
|
|
|
inspectionFile.setLatitude(flightData_off.getLat()); |
|
|
|
inspectionFile.setGaodeLongitude(gaodeCoordinateOff.getString("longitude")); |
|
|
|
inspectionFile.setGaodeLatitude(gaodeCoordinateOff.getString("latitude")); |
|
|
|
if (ObjectUtil.isNotNull(gaodeCoordinateOff)) { |
|
|
|
inspectionFile.setGaodeLongitude(gaodeCoordinateOff.getString("longitude")); |
|
|
|
inspectionFile.setGaodeLatitude(gaodeCoordinateOff.getString("latitude")); |
|
|
|
} |
|
|
|
String gaodeAddressOff = GaodeUtil.getGaodeAddress(gaodeCoordinateOff.getString("longitude"), gaodeCoordinateOff.getString("latitude")); |
|
|
|
inspectionFile.setLocation(gaodeAddressOff); |
|
|
|
inspectionFile.setGaodeAddress(gaodeAddressOff); |
|
|
|
|
|
|
|
if (ObjectUtil.isNotNull(gaodeAddressOff)) { |
|
|
|
inspectionFile.setLocation(gaodeAddressOff); |
|
|
|
inspectionFile.setGaodeAddress(gaodeAddressOff); |
|
|
|
} |
|
|
|
} |
|
|
|
if (online_condition) { |
|
|
|
// 实时直播处理 |
|
|
@@ -227,13 +235,17 @@ public class DspCallbackServiceImpl implements IDspCallbackService { |
|
|
|
// long time = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, questionFile.getAnalyseTime()).getTime(); |
|
|
|
FlightData flightData_live = getFlightDataByTime(flightDataList, questionFile.getAnalyseTime().getTime()); |
|
|
|
log.info("实时坐标:{}", JacksonUtil.obj2StringPretty(flightData_live)); |
|
|
|
inspectionFile.setLatitude(flightData_live.getLat()); |
|
|
|
inspectionFile.setLongitude(flightData_live.getLng()); |
|
|
|
inspectionFile.setGaodeLatitude(flightData_live.getLat()); |
|
|
|
inspectionFile.setGaodeLongitude(flightData_live.getLng()); |
|
|
|
if (ObjectUtil.isNotNull(flightData_live)) { |
|
|
|
inspectionFile.setLatitude(flightData_live.getLat()); |
|
|
|
inspectionFile.setLongitude(flightData_live.getLng()); |
|
|
|
inspectionFile.setGaodeLatitude(flightData_live.getLat()); |
|
|
|
inspectionFile.setGaodeLongitude(flightData_live.getLng()); |
|
|
|
} |
|
|
|
String gaodeAddress_live = GaodeUtil.getGaodeAddress(flightData_live.getLng(), flightData_live.getLat()); |
|
|
|
inspectionFile.setLocation(gaodeAddress_live); |
|
|
|
inspectionFile.setGaodeAddress(gaodeAddress_live); |
|
|
|
if (ObjectUtil.isNotNull(gaodeAddress_live)) { |
|
|
|
inspectionFile.setLocation(gaodeAddress_live); |
|
|
|
inspectionFile.setGaodeAddress(gaodeAddress_live); |
|
|
|
} |
|
|
|
} |
|
|
|
return inspectionFile; |
|
|
|
}).collect(Collectors.toList()); |
|
|
@@ -255,7 +267,6 @@ public class DspCallbackServiceImpl implements IDspCallbackService { |
|
|
|
if (CollectionUtils.isEmpty(flightDataList)) { |
|
|
|
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "获取无人机飞行坐标失败!"); |
|
|
|
} |
|
|
|
|
|
|
|
List<FlightData> flightData = flightDataList.stream().filter(data -> { |
|
|
|
try { |
|
|
|
return Long.valueOf(data.getTimestamp()) <= time; |
|
|
@@ -270,4 +281,5 @@ public class DspCallbackServiceImpl implements IDspCallbackService { |
|
|
|
} |
|
|
|
return flightData.get(0); |
|
|
|
} |
|
|
|
|
|
|
|
} |