Browse Source

Merge branch 'develop' of gitadmin/tuoheng_freeway into release

tags/v1.0.0^2
wanjing 1 year ago
parent
commit
625f50be35
3 changed files with 15 additions and 6 deletions
  1. +4
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/add/AddInspectionService.java
  2. +4
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/DspCallbackServiceImpl.java
  3. +7
    -4
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/StopAIService.java

+ 4
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/add/AddInspectionService.java View File

@@ -196,6 +196,10 @@ public class AddInspectionService {
inspection.setCreateTime(DateUtils.now());
inspection.setMobile(user.getMobile());
inspection.setStatus(InspectionStatusEnum.WAIT_FLIGHT.getCode());
if (InspectionTypeEnum.AIRPORT.getCode() == addInspectionRequest.getInspectionType()) {
// 机场巡逻,只有直播,将isLive设置为1
inspection.setIsLive(1);
}
return inspection;
}


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

@@ -69,10 +69,9 @@ public class DspCallbackServiceImpl implements IDspCallbackService {
.eq(Business::getType, 1)
.last("limit 1"));
if (StringUtils.isNull(business)) {
log.info("业务关系数据不存在,requestId:{}", requestId);
throw new ServiceException(0, "业务数据不存在");
}
log.info("业务关系表查询成功");

// 巡检任务ID
String inspectionId = business.getTypeId();

@@ -109,6 +108,8 @@ public class DspCallbackServiceImpl implements IDspCallbackService {
if (dspCallbackRequest.getType().equals(1)) {
// 实时直播
log.info("实时直播视频处理");
log.info("实时直播视频,原视频地址:{}", dspCallbackRequest.getVideoUrl());
log.info("实时直播视频,分析后视频地址:{}", dspCallbackRequest.getAiVideoUrl());
if (StringUtils.isNotBlank(dspCallbackRequest.getVideoUrl())) {
inspection.setVideoUrl(StringUtils.removeHost(dspCallbackRequest.getVideoUrl(), CommonConfig.videoURL));
}
@@ -118,6 +119,7 @@ public class DspCallbackServiceImpl implements IDspCallbackService {
} else if (dspCallbackRequest.getType().equals(2)) {
// 离线识别
log.info("离线检测视频处理");
log.info("离线检测视频,分析后视频地址:{}", dspCallbackRequest.getAiVideoUrl());
if (StringUtils.isNotBlank(dspCallbackRequest.getAiVideoUrl())) {
inspection.setAiVideoUrl(StringUtils.removeHost(dspCallbackRequest.getAiVideoUrl(), CommonConfig.videoURL));
}

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

@@ -29,6 +29,7 @@ public class StopAIService {
private String dspServiceInstId;

public JsonResult stopAI(String msgId, String inspectionId) {
log.info("硬件停止后,停止AI分析");
//任务调用完成之后,调用发送通道,请求DSP关闭请求
//调用DSP接口
JSONObject jsonObject = new JSONObject();
@@ -41,18 +42,18 @@ public class StopAIService {
if (responseJson.getIntValue("code") == 0) {
if (responseJson.containsKey("data") && ObjectUtil.isNotEmpty(responseJson.get("data"))) {
String requestId = responseJson.getJSONObject("data").getString("requestId");
log.info("dsp实时调用响应requestId:{}", requestId);
log.info("硬件停止后,停止AI分析,dsp实时调用响应requestId:{}", requestId);
} else {
log.info("dsp实时调用响应:{}", responseJson);
log.info("硬件停止后,停止AI分析,dsp实时调用响应:{}", responseJson);
}
return JsonResult.success();
} else {
log.error("dsp实时调用失败:{}", responseJson);
log.error("硬件停止后,停止AI分析,dsp实时调用失败:{}", responseJson);
inspectionUpdate.setAnalyseStatus(AiAnalyseStatusEnum.FAILED.getCode());
}
inspectionMapper.updateById(inspectionUpdate);
} catch (Exception e) {
log.error("dsp实时调用失败:{}", responseJson);
log.error("硬件停止后,停止AI分析,dsp实时调用失败:{}", responseJson);
inspectionUpdate.setAnalyseStatus(AiAnalyseStatusEnum.FAILED.getCode());
inspectionMapper.updateById(inspectionUpdate);
}
@@ -61,7 +62,9 @@ public class StopAIService {

private JSONObject serviceStopApplication(JSONObject jsonObject) {
String url = dspDomainUrl + "api/web/serviceInst/" + jsonObject.getString("requestId") + "/stop";
log.info("硬件停止后,停止AI分析,调用dsp url:{}", url);
String result = HttpUtils.doSend(url, jsonObject, null, "PUT");
log.info("硬件停止后,停止AI分析,调用dsp result:{}", result);
return JSONObject.parseObject(result);
}
}

Loading…
Cancel
Save