@@ -57,7 +57,7 @@ public class QueryAirportMsgByIdService { | |||
Object obj = redisUtils.get(inspectionId); | |||
FlightData flightData = null; | |||
if (ObjectUtil.isNull(obj)) { | |||
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL); | |||
return JsonResult.success("当前任务状态不是飞行中,无数据信息"); | |||
} else { | |||
flightData = (FlightData) obj; | |||
} |
@@ -38,8 +38,7 @@ public class OnlineCompleteService { | |||
@Autowired | |||
private BusinessMapper businessMapper; | |||
@Autowired | |||
private DeliverStreamingService deliverStreamingService; | |||
@Autowired | |||
@Qualifier("restTemplate") | |||
@@ -84,8 +83,6 @@ public class OnlineCompleteService { | |||
} | |||
} | |||
} finally { | |||
// 释放小程序选择的通道 | |||
deliverStreamingService.deliver(channel.getChannelCode()); | |||
} | |||
} | |||
} |
@@ -4,9 +4,11 @@ import cn.hutool.core.util.ObjectUtil; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.tuoheng.admin.entity.domain.Inspection; | |||
import com.tuoheng.admin.entity.domain.LiveChannel; | |||
import com.tuoheng.admin.entity.domain.Report; | |||
import com.tuoheng.admin.enums.TaskStatusEnum; | |||
import com.tuoheng.admin.mapper.InspectionMapper; | |||
import com.tuoheng.admin.mapper.LiveChannelMapper; | |||
import com.tuoheng.admin.mapper.ReportMapper; | |||
import com.tuoheng.admin.entity.request.inspection.UpdateTaskByCodeRequest; | |||
import com.tuoheng.common.core.exception.ServiceException; | |||
@@ -35,6 +37,9 @@ public class UpdateFlyerService { | |||
@Autowired | |||
private ReportMapper reportMapper; | |||
@Autowired | |||
private LiveChannelMapper liveChannelMapper; | |||
@Autowired | |||
private OnlineIdentifService onlineIdentifService; | |||
@@ -44,6 +49,9 @@ public class UpdateFlyerService { | |||
@Autowired | |||
private OffLineCompleteService offLineCompleteService; | |||
@Autowired | |||
private DeliverStreamingService deliverStreamingService; | |||
/** | |||
* 修改任务(修改任务状态和飞手信息) | |||
* | |||
@@ -93,6 +101,15 @@ public class UpdateFlyerService { | |||
log.info("修改任务状态和飞手信息业务接口:直播状态,飞行完成修改状态为待关闭"); | |||
onlineCompleteService.handle(inspection); | |||
} | |||
//成功 超时 失败 | |||
if(4 == inspection.getAnalyseStatus() || 5 == inspection.getAnalyseStatus() || 6 == inspection.getAnalyseStatus()){ | |||
LiveChannel liveChannel = liveChannelMapper.selectOne(Wrappers.<LiveChannel>lambdaQuery() | |||
.eq(LiveChannel::getInspectionId, inspection.getId()) | |||
.eq(LiveChannel::getMark, 1)); | |||
//释放小程序选择的通道 | |||
if(null != liveChannel) | |||
deliverStreamingService.deliver(liveChannel.getChannelCode()); | |||
} | |||
return JsonResult.success(); | |||
} | |||
@@ -116,8 +116,6 @@ public class QueryUserPageListService { | |||
} | |||
} | |||
} | |||
//对list排序 | |||
userPageListVoList = userPageListVoList.stream().sorted(Comparator.comparing(UserPageListVo::getCreateTime).reversed()).collect(Collectors.toList()); | |||
return userPageListVoList; | |||
} | |||
@@ -4,14 +4,12 @@ import cn.hutool.core.util.ObjectUtil; | |||
import com.alibaba.fastjson.JSON; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.tuoheng.admin.entity.domain.Business; | |||
import com.tuoheng.admin.entity.domain.FlightData; | |||
import com.tuoheng.admin.entity.domain.Inspection; | |||
import com.tuoheng.admin.entity.domain.QuestionType; | |||
import com.tuoheng.admin.entity.domain.*; | |||
import com.tuoheng.admin.enums.*; | |||
import com.tuoheng.admin.mapper.*; | |||
import com.tuoheng.admin.entity.request.third.DspCallbackRequest; | |||
import com.tuoheng.admin.entity.request.third.QuestionFile; | |||
import com.tuoheng.admin.service.inspection.update.flyer.DeliverStreamingService; | |||
import com.tuoheng.common.core.config.common.CommonConfig; | |||
import com.tuoheng.common.core.exception.ServiceException; | |||
import com.tuoheng.common.core.utils.*; | |||
@@ -48,6 +46,12 @@ public class DspCallbackServiceImpl implements IDspCallbackService { | |||
@Autowired | |||
private QuestionTypeMapper questionTypeMapper; | |||
@Autowired | |||
private LiveChannelMapper liveChannelMapper; | |||
@Autowired | |||
private DeliverStreamingService deliverStreamingService; | |||
/** | |||
* 保存DSP回调数据 | |||
* | |||
@@ -85,6 +89,8 @@ public class DspCallbackServiceImpl implements IDspCallbackService { | |||
log.info("任务不存在"); | |||
throw new ServiceException(0, "巡检任务不存在"); | |||
} | |||
// 巡检任务ID | |||
String inspectionId = inspection.getId(); | |||
log.info("巡检任务查询成功,分析状态为:{}", dspCallbackRequest.getAnalyseStatus()); | |||
// 分析状态处理: 5:waiting(等待)、10:running(分析中)、15:success(分析完成)、20:timeout(成功超时)、25:failed(分析失败) | |||
if (dspCallbackRequest.getAnalyseStatus().equals(5)) { | |||
@@ -153,6 +159,17 @@ public class DspCallbackServiceImpl implements IDspCallbackService { | |||
log.info("飞行坐标大小:{}", flightDataList.size()); | |||
} | |||
} | |||
//释放通道 | |||
if (4 == inspection.getAnalyseStatus() || 5 == inspection.getAnalyseStatus() || 6 == inspection.getAnalyseStatus()) { | |||
LiveChannel liveChannel = liveChannelMapper.selectOne(Wrappers.<LiveChannel>lambdaQuery() | |||
.eq(LiveChannel::getInspectionId, inspectionId) | |||
.eq(LiveChannel::getMark, 1)); | |||
// 释放小程序选择的通道 | |||
if(null != liveChannel) | |||
deliverStreamingService.deliver(liveChannel.getChannelCode()); | |||
} | |||
return JsonResult.success(); | |||
} | |||