Object obj = redisUtils.get(inspectionId); | Object obj = redisUtils.get(inspectionId); | ||||
FlightData flightData = null; | FlightData flightData = null; | ||||
if (ObjectUtil.isNull(obj)) { | if (ObjectUtil.isNull(obj)) { | ||||
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL); | |||||
return JsonResult.success("当前任务状态不是飞行中,无数据信息"); | |||||
} else { | } else { | ||||
flightData = (FlightData) obj; | flightData = (FlightData) obj; | ||||
} | } |
@Autowired | @Autowired | ||||
private BusinessMapper businessMapper; | private BusinessMapper businessMapper; | ||||
@Autowired | |||||
private DeliverStreamingService deliverStreamingService; | |||||
@Autowired | @Autowired | ||||
@Qualifier("restTemplate") | @Qualifier("restTemplate") | ||||
} | } | ||||
} | } | ||||
} finally { | } finally { | ||||
// 释放小程序选择的通道 | |||||
deliverStreamingService.deliver(channel.getChannelCode()); | |||||
} | } | ||||
} | } | ||||
} | } |
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.tuoheng.admin.entity.domain.Inspection; | 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.entity.domain.Report; | ||||
import com.tuoheng.admin.enums.TaskStatusEnum; | import com.tuoheng.admin.enums.TaskStatusEnum; | ||||
import com.tuoheng.admin.mapper.InspectionMapper; | import com.tuoheng.admin.mapper.InspectionMapper; | ||||
import com.tuoheng.admin.mapper.LiveChannelMapper; | |||||
import com.tuoheng.admin.mapper.ReportMapper; | import com.tuoheng.admin.mapper.ReportMapper; | ||||
import com.tuoheng.admin.entity.request.inspection.UpdateTaskByCodeRequest; | import com.tuoheng.admin.entity.request.inspection.UpdateTaskByCodeRequest; | ||||
import com.tuoheng.common.core.exception.ServiceException; | import com.tuoheng.common.core.exception.ServiceException; | ||||
@Autowired | @Autowired | ||||
private ReportMapper reportMapper; | private ReportMapper reportMapper; | ||||
@Autowired | |||||
private LiveChannelMapper liveChannelMapper; | |||||
@Autowired | @Autowired | ||||
private OnlineIdentifService onlineIdentifService; | private OnlineIdentifService onlineIdentifService; | ||||
@Autowired | @Autowired | ||||
private OffLineCompleteService offLineCompleteService; | private OffLineCompleteService offLineCompleteService; | ||||
@Autowired | |||||
private DeliverStreamingService deliverStreamingService; | |||||
/** | /** | ||||
* 修改任务(修改任务状态和飞手信息) | * 修改任务(修改任务状态和飞手信息) | ||||
* | * | ||||
log.info("修改任务状态和飞手信息业务接口:直播状态,飞行完成修改状态为待关闭"); | log.info("修改任务状态和飞手信息业务接口:直播状态,飞行完成修改状态为待关闭"); | ||||
onlineCompleteService.handle(inspection); | 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(); | return JsonResult.success(); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
//对list排序 | |||||
userPageListVoList = userPageListVoList.stream().sorted(Comparator.comparing(UserPageListVo::getCreateTime).reversed()).collect(Collectors.toList()); | |||||
return userPageListVoList; | return userPageListVoList; | ||||
} | } | ||||
import com.alibaba.fastjson.JSON; | import com.alibaba.fastjson.JSON; | ||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 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.enums.*; | ||||
import com.tuoheng.admin.mapper.*; | import com.tuoheng.admin.mapper.*; | ||||
import com.tuoheng.admin.entity.request.third.DspCallbackRequest; | import com.tuoheng.admin.entity.request.third.DspCallbackRequest; | ||||
import com.tuoheng.admin.entity.request.third.QuestionFile; | 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.config.common.CommonConfig; | ||||
import com.tuoheng.common.core.exception.ServiceException; | import com.tuoheng.common.core.exception.ServiceException; | ||||
import com.tuoheng.common.core.utils.*; | import com.tuoheng.common.core.utils.*; | ||||
@Autowired | @Autowired | ||||
private QuestionTypeMapper questionTypeMapper; | private QuestionTypeMapper questionTypeMapper; | ||||
@Autowired | |||||
private LiveChannelMapper liveChannelMapper; | |||||
@Autowired | |||||
private DeliverStreamingService deliverStreamingService; | |||||
/** | /** | ||||
* 保存DSP回调数据 | * 保存DSP回调数据 | ||||
* | * | ||||
log.info("任务不存在"); | log.info("任务不存在"); | ||||
throw new ServiceException(0, "巡检任务不存在"); | throw new ServiceException(0, "巡检任务不存在"); | ||||
} | } | ||||
// 巡检任务ID | |||||
String inspectionId = inspection.getId(); | |||||
log.info("巡检任务查询成功,分析状态为:{}", dspCallbackRequest.getAnalyseStatus()); | log.info("巡检任务查询成功,分析状态为:{}", dspCallbackRequest.getAnalyseStatus()); | ||||
// 分析状态处理: 5:waiting(等待)、10:running(分析中)、15:success(分析完成)、20:timeout(成功超时)、25:failed(分析失败) | // 分析状态处理: 5:waiting(等待)、10:running(分析中)、15:success(分析完成)、20:timeout(成功超时)、25:failed(分析失败) | ||||
if (dspCallbackRequest.getAnalyseStatus().equals(5)) { | if (dspCallbackRequest.getAnalyseStatus().equals(5)) { | ||||
log.info("飞行坐标大小:{}", flightDataList.size()); | 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(); | return JsonResult.success(); | ||||
} | } | ||||