Browse Source

Merge branch 'develop' of gitadmin/tuoheng_air_monitor into release

tags/V1.0.1
chengwang 1 year ago
parent
commit
ec305885f8
1 changed files with 21 additions and 4 deletions
  1. +21
    -4
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/DspCallbackServiceImpl.java

+ 21
- 4
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/DspCallbackServiceImpl.java View File

@@ -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();
}


Loading…
Cancel
Save