Browse Source

Merge branch 'develop' of http://192.168.11.14:51037/gitadmin/tuoheng_air_monitor into develop

tags/V1.0.1^2
wanjing 1 year ago
parent
commit
3481d96551
5 changed files with 40 additions and 11 deletions
  1. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryAirportMsgByIdService.java
  2. +1
    -4
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/flyer/OnlineCompleteService.java
  3. +17
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/flyer/UpdateFlyerService.java
  4. +0
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/system/user/query/QueryUserPageListService.java
  5. +21
    -4
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/DspCallbackServiceImpl.java

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryAirportMsgByIdService.java View File

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

+ 1
- 4
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/flyer/OnlineCompleteService.java View File

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

+ 17
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/flyer/UpdateFlyerService.java View File

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


+ 0
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/system/user/query/QueryUserPageListService.java View File

@@ -116,8 +116,6 @@ public class QueryUserPageListService {
}
}
}
//对list排序
userPageListVoList = userPageListVoList.stream().sorted(Comparator.comparing(UserPageListVo::getCreateTime).reversed()).collect(Collectors.toList());
return userPageListVoList;
}


+ 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