|
|
@@ -20,7 +20,9 @@ import org.springframework.http.MediaType; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.web.client.RestTemplate; |
|
|
|
|
|
|
|
import java.util.Comparator; |
|
|
|
import java.util.List; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
@Slf4j |
|
|
|
@Service |
|
|
@@ -54,13 +56,17 @@ public class FlyLogService { |
|
|
|
List<TZHLFlyLogResponse> flyLogResponseList = JSON.parseArray(dataJson, TZHLFlyLogResponse.class); |
|
|
|
|
|
|
|
if (ObjectUtil.isEmpty(flyLogResponseList)) { |
|
|
|
log.info("获取飞行日志,flyLogResponseList为空"); |
|
|
|
log.info("获取飞行日志,flyLogResponseList为空, inspectionId={}", inspection.getId()); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
//根据日期进行降序排序 |
|
|
|
List<TZHLFlyLogResponse> flyLogResponseListSortDesc = flyLogResponseList.stream().sorted(Comparator.comparing(TZHLFlyLogResponse::getCreateTime).reversed()).collect(Collectors.toList()); |
|
|
|
TZHLFlyLogResponse flyLogResponseLast = flyLogResponseListSortDesc.get(0); |
|
|
|
redisUtils.set(TZHLConstant.HL_FLY_LOG + inspection.getId(), flyLogResponseLast); |
|
|
|
|
|
|
|
for (TZHLFlyLogResponse flyLogResponse : flyLogResponseList) { |
|
|
|
log.info("获取飞行日志,flyLogResponse={}", flyLogResponse); |
|
|
|
// redisUtils.set(TZHLConstant.HL_FLY_LOG + inspection.getId(), flyLogResponse); |
|
|
|
if ("success".equals(flyLogResponse.getStatus())) { |
|
|
|
flyLogBySuccessService.getFlyLog(inspection, flyLogResponse); |
|
|
|
} else if ("normal".equals(flyLogResponse.getStatus())) { |