Переглянути джерело

添加释放通道操作

tags/v1.0.0^2
chengwang 1 рік тому
джерело
коміт
36dd6953e2
13 змінених файлів з 48 додано та 13 видалено
  1. +0
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/flyer/OnlineCompleteService.java
  2. +20
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/flyer/UpdateFlyerService.java
  3. +20
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/DspCallbackServiceImpl.java
  4. BIN
      tuoheng-service/tuoheng-admin/target/classes/com/tuoheng/admin/service/third/dsp/DspCallbackServiceImpl.class
  5. +1
    -1
      tuoheng-service/tuoheng-admin/target/generated-sources/annotations/com/tuoheng/admin/conver/AccidentConverMapperImpl.java
  6. +1
    -1
      tuoheng-service/tuoheng-admin/target/generated-sources/annotations/com/tuoheng/admin/conver/DeptConverMapperImpl.java
  7. +1
    -1
      tuoheng-service/tuoheng-admin/target/generated-sources/annotations/com/tuoheng/admin/conver/InspectionConverMapperImpl.java
  8. +1
    -1
      tuoheng-service/tuoheng-admin/target/generated-sources/annotations/com/tuoheng/admin/conver/InspectionFileConverMapperImpl.java
  9. +1
    -1
      tuoheng-service/tuoheng-admin/target/generated-sources/annotations/com/tuoheng/admin/conver/InspectionFileHandleConverMapperImpl.java
  10. +1
    -1
      tuoheng-service/tuoheng-admin/target/generated-sources/annotations/com/tuoheng/admin/conver/ReportConverMapperImpl.java
  11. +1
    -1
      tuoheng-service/tuoheng-admin/target/generated-sources/annotations/com/tuoheng/admin/conver/UserConverMapperImpl.java
  12. +1
    -1
      tuoheng-service/tuoheng-admin/target/generated-sources/annotations/com/tuoheng/admin/conver/WorkOrderConverMapperImpl.java
  13. BIN
      tuoheng-service/tuoheng-admin/target/test-classes/com/tuoheng/admin/Test.class

+ 0
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/flyer/OnlineCompleteService.java Переглянути файл

@@ -97,8 +97,6 @@ public class OnlineCompleteService {
}
}
} finally {
// 释放小程序选择的通道
deliverStreamingService.deliver(channel.getChannelCode());
}
}
}

+ 20
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/flyer/UpdateFlyerService.java Переглянути файл

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


+ 20
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/DspCallbackServiceImpl.java Переглянути файл

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


BIN
tuoheng-service/tuoheng-admin/target/classes/com/tuoheng/admin/service/third/dsp/DspCallbackServiceImpl.class Переглянути файл


+ 1
- 1
tuoheng-service/tuoheng-admin/target/generated-sources/annotations/com/tuoheng/admin/conver/AccidentConverMapperImpl.java Переглянути файл

@@ -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 {

+ 1
- 1
tuoheng-service/tuoheng-admin/target/generated-sources/annotations/com/tuoheng/admin/conver/DeptConverMapperImpl.java Переглянути файл

@@ -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 {

+ 1
- 1
tuoheng-service/tuoheng-admin/target/generated-sources/annotations/com/tuoheng/admin/conver/InspectionConverMapperImpl.java Переглянути файл

@@ -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 {

+ 1
- 1
tuoheng-service/tuoheng-admin/target/generated-sources/annotations/com/tuoheng/admin/conver/InspectionFileConverMapperImpl.java Переглянути файл

@@ -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 {

+ 1
- 1
tuoheng-service/tuoheng-admin/target/generated-sources/annotations/com/tuoheng/admin/conver/InspectionFileHandleConverMapperImpl.java Переглянути файл

@@ -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 {

+ 1
- 1
tuoheng-service/tuoheng-admin/target/generated-sources/annotations/com/tuoheng/admin/conver/ReportConverMapperImpl.java Переглянути файл

@@ -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 {

+ 1
- 1
tuoheng-service/tuoheng-admin/target/generated-sources/annotations/com/tuoheng/admin/conver/UserConverMapperImpl.java Переглянути файл

@@ -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 {

+ 1
- 1
tuoheng-service/tuoheng-admin/target/generated-sources/annotations/com/tuoheng/admin/conver/WorkOrderConverMapperImpl.java Переглянути файл

@@ -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 {

BIN
tuoheng-service/tuoheng-admin/target/test-classes/com/tuoheng/admin/Test.class Переглянути файл


Завантаження…
Відмінити
Зберегти