@@ -97,8 +97,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.Inspection; | |||
import com.tuoheng.admin.entity.LiveChannel; | |||
import com.tuoheng.admin.entity.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.request.inspection.UpdateTaskByCodeRequest; | |||
import com.tuoheng.common.core.exception.ServiceException; | |||
@@ -44,6 +46,12 @@ public class UpdateFlyerService { | |||
@Autowired | |||
private OffLineCompleteService offLineCompleteService; | |||
@Autowired | |||
private LiveChannelMapper liveChannelMapper; | |||
@Autowired | |||
private DeliverStreamingService deliverStreamingService; | |||
/** | |||
* 修改任务(修改任务状态和飞手信息) | |||
* | |||
@@ -93,6 +101,18 @@ 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(); | |||
} | |||
@@ -13,6 +13,7 @@ import com.tuoheng.admin.mapper.*; | |||
import com.tuoheng.admin.request.third.DspCallbackRequest; | |||
import com.tuoheng.admin.request.third.QuestionFile; | |||
import com.tuoheng.admin.service.accident.IAccidentService; | |||
import com.tuoheng.admin.service.inspection.update.flyer.DeliverStreamingService; | |||
import com.tuoheng.admin.utils.GaodeUtil; | |||
import com.tuoheng.admin.websocket.WebSocketService; | |||
import com.tuoheng.common.core.config.common.CommonConfig; | |||
@@ -72,6 +73,12 @@ public class DspCallbackServiceImpl implements IDspCallbackService { | |||
@Autowired | |||
private DeptMapper deptMapper; | |||
@Autowired | |||
private LiveChannelMapper liveChannelMapper; | |||
@Autowired | |||
private DeliverStreamingService deliverStreamingService; | |||
/** | |||
* 保存DSP回调数据 | |||
* | |||
@@ -109,6 +116,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)) { | |||
@@ -196,9 +205,6 @@ public class DspCallbackServiceImpl implements IDspCallbackService { | |||
inspectionFile.setQuestionName(questionFile.getQuestionName()); | |||
inspectionFile.setTenantId(inspection.getTenantId()); | |||
inspectionFile.setInspectionId(inspection.getId()); | |||
// inspectionFile.setDeptId(inspection.getDeptId()); | |||
// inspectionFile.setInspectionCode(inspection.getCode()); | |||
// inspectionFile.setInspectionName(inspection.getName()); | |||
// 文件类型 | |||
inspectionFile.setFileType(FileTypeEnum.IMAGE.getCode()); | |||
// 文件编码 | |||
@@ -293,6 +299,17 @@ public class DspCallbackServiceImpl implements IDspCallbackService { | |||
Boolean result = this.saveAccidentData(thirstyQuestionFiles); | |||
log.info("预警数据入库完成,result={}",result); | |||
} | |||
//释放通道 | |||
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(); | |||
} | |||
@@ -10,7 +10,7 @@ import javax.annotation.processing.Generated; | |||
@Generated( | |||
value = "org.mapstruct.ap.MappingProcessor", | |||
date = "2023-06-15T09:46:26+0800", | |||
date = "2023-06-16T10:24:39+0800", | |||
comments = "version: 1.5.3.Final, compiler: javac, environment: Java 11.0.6 (Oracle Corporation)" | |||
) | |||
public class AccidentConverMapperImpl implements AccidentConverMapper { |
@@ -9,7 +9,7 @@ import javax.annotation.processing.Generated; | |||
@Generated( | |||
value = "org.mapstruct.ap.MappingProcessor", | |||
date = "2023-06-15T09:46:26+0800", | |||
date = "2023-06-16T10:24:39+0800", | |||
comments = "version: 1.5.3.Final, compiler: javac, environment: Java 11.0.6 (Oracle Corporation)" | |||
) | |||
public class DeptConverMapperImpl implements DeptConverMapper { |
@@ -12,7 +12,7 @@ import javax.annotation.processing.Generated; | |||
@Generated( | |||
value = "org.mapstruct.ap.MappingProcessor", | |||
date = "2023-06-15T09:46:26+0800", | |||
date = "2023-06-16T10:24:39+0800", | |||
comments = "version: 1.5.3.Final, compiler: javac, environment: Java 11.0.6 (Oracle Corporation)" | |||
) | |||
public class InspectionConverMapperImpl implements InspectionConverMapper { |
@@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; | |||
@Generated( | |||
value = "org.mapstruct.ap.MappingProcessor", | |||
date = "2023-06-15T09:46:26+0800", | |||
date = "2023-06-16T10:24:39+0800", | |||
comments = "version: 1.5.3.Final, compiler: javac, environment: Java 11.0.6 (Oracle Corporation)" | |||
) | |||
public class InspectionFileConverMapperImpl implements InspectionFileConverMapper { |
@@ -6,7 +6,7 @@ import javax.annotation.processing.Generated; | |||
@Generated( | |||
value = "org.mapstruct.ap.MappingProcessor", | |||
date = "2023-06-15T09:46:26+0800", | |||
date = "2023-06-16T10:24:39+0800", | |||
comments = "version: 1.5.3.Final, compiler: javac, environment: Java 11.0.6 (Oracle Corporation)" | |||
) | |||
public class InspectionFileHandleConverMapperImpl implements InspectionFileHandleConverMapper { |
@@ -11,7 +11,7 @@ import javax.annotation.processing.Generated; | |||
@Generated( | |||
value = "org.mapstruct.ap.MappingProcessor", | |||
date = "2023-06-15T09:46:26+0800", | |||
date = "2023-06-16T10:24:40+0800", | |||
comments = "version: 1.5.3.Final, compiler: javac, environment: Java 11.0.6 (Oracle Corporation)" | |||
) | |||
public class ReportConverMapperImpl implements ReportConverMapper { |
@@ -9,7 +9,7 @@ import javax.annotation.processing.Generated; | |||
@Generated( | |||
value = "org.mapstruct.ap.MappingProcessor", | |||
date = "2023-06-15T09:46:26+0800", | |||
date = "2023-06-16T10:24:39+0800", | |||
comments = "version: 1.5.3.Final, compiler: javac, environment: Java 11.0.6 (Oracle Corporation)" | |||
) | |||
public class UserConverMapperImpl implements UserConverMapper { |
@@ -8,7 +8,7 @@ import javax.annotation.processing.Generated; | |||
@Generated( | |||
value = "org.mapstruct.ap.MappingProcessor", | |||
date = "2023-06-15T09:46:25+0800", | |||
date = "2023-06-16T10:24:39+0800", | |||
comments = "version: 1.5.3.Final, compiler: javac, environment: Java 11.0.6 (Oracle Corporation)" | |||
) | |||
public class WorkOrderConverMapperImpl implements WorkOrderConverMapper { |