瀏覽代碼

Merge branch 'develop' of gitadmin/tuoheng_telecomumale into release

tags/v1.3.1
wanjing 1 年之前
父節點
當前提交
37738ab99e
共有 2 個文件被更改,包括 6 次插入10 次删除
  1. +3
    -7
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/tzhl/service/fly/data/FlyDataService.java
  2. +3
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/tzhl/service/fly/log/FlyLogBySuccessService.java

+ 3
- 7
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/tzhl/service/fly/data/FlyDataService.java 查看文件

@@ -52,10 +52,10 @@ public class FlyDataService {
String apiPath = TZHLConstant.TIAN_YI_API_FLIGHT_DATA;
JSONObject jsonObject = this.jsonObjectRequest(inspection);
String dataJson = callTianYiPlatformService.callPost(apiPath, jsonObject);
log.info("获取飞行数据, dataJson:{}", dataJson);

List<TZHLAirportFlightDataResponse> flightDataHlList = JSON.parseArray(dataJson, TZHLAirportFlightDataResponse.class);

log.info("获取飞行数据, flightDataHlList size:{}", flightDataHlList.size());

// 查询到的数据入库
this.addFlightDataHl(inspection, flightDataHlList);
}
@@ -68,7 +68,7 @@ public class FlyDataService {
* @return
*/
private void addFlightDataHl(Inspection inspection, List<TZHLAirportFlightDataResponse> flightDataHlList) {
log.info("开始飞行数据保存入库");
log.info("飞行数据保存入库, inspectionId:{}", inspection.getId());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if (CollectionUtil.isNotEmpty(flightDataHlList) && flightDataHlList.size() != 0) {
List<FlightDataHl> flightDataHls = new ArrayList<>(flightDataHlList.size());
@@ -83,10 +83,7 @@ public class FlyDataService {
e.printStackTrace();
}
flightDataHl.setCreateUser(inspection.getCreateUser());

flightDataHls.add(flightDataHl);
log.info("结束飞行数据保存入库, flightDataHls:{}", flightDataHls);

}
CommonUtils.batchOperate((x) -> flightDataHlMapper.addBatch(x),flightDataHls,1000);

@@ -96,7 +93,6 @@ public class FlyDataService {
flightDataHls = flightDataHls.stream().sorted(Comparator.comparing(FlightDataHl::getCreateTime).reversed()).collect(Collectors.toList());
//倒序排列的第一个最新数据保存到缓存
redisUtils.set(inspection.getId(), flightDataHls.get(0), 10);

}
}
return;

+ 3
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/tzhl/service/fly/log/FlyLogBySuccessService.java 查看文件

@@ -37,7 +37,7 @@ public class FlyLogBySuccessService {
log.info("获取飞行日志,status=success,inspectionId={}, title={}", inspection.getId(), flyLogResponse.getTitle());
if (InspectionStatusEnum.IN_FLIGHT.getCode() == inspection.getStatus()) {
log.info("获取飞行日志,该任务状态已经改是飞行中,inspectionid={}", inspection.getId());
return;
// return;
}
inspection.setStatus(InspectionStatusEnum.IN_FLIGHT.getCode());
inspection.setUpdateUser("");
@@ -46,8 +46,6 @@ public class FlyLogBySuccessService {

log.info("获取飞行日志,status=success,修改任务状态,inspectionId={}, status={}", inspection.getId(), inspection.getStatus());

this.exec(inspection.getId());

AirportDto airportDto = tzhlGetAirportListService.getAirport(inspection.getAirportId());
if (ObjectUtil.isEmpty(airportDto)) {
log.info("获取飞行日志,获取推流地址失败,inspectionId={}", inspection.getId());
@@ -66,6 +64,8 @@ public class FlyLogBySuccessService {
log.info("获取飞行日志,获取推流地址,通知DSP失败");
inspection.setStatus(InspectionStatusEnum.FLIGHT_FAILED.getCode());
}

this.exec(inspection.getId());
}

@Async

Loading…
取消
儲存