Browse Source

Merge branch 'develop' of gitadmin/tuoheng_freeway into release

pull/352/head
wanjing 11 months ago
parent
commit
adc67de16c
3 changed files with 36 additions and 4 deletions
  1. +3
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/upload/UploadFlightUrlService.java
  2. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/DspServiceImpl.java
  3. +32
    -0
      tuoheng-service/tuoheng-admin/src/test/java/com/tuoheng/admin/service/UploadFlightUrlServiceTest.java

+ 3
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/upload/UploadFlightUrlService.java View File

@@ -111,6 +111,9 @@ public class UploadFlightUrlService {
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "视频分析已完成");
}

// 如果任务处于分析完成,响应前端,任务已完成,不能上传视频
this.updateSrtUrl(request.getSrtUrl(), inspection.getId(), request.getType(), inspection.getTenantId());

this.updatInspection(request, inspection);

// 每次上传或重试,清除上次的数据
@@ -162,9 +165,6 @@ public class UploadFlightUrlService {
inspectionUpdate.setHeartbeatTime(System.currentTimeMillis());
inspectionUpdate.setTenantId(inspection.getTenantId());

// 如果任务处于分析完成,响应前端,任务已完成,不能上传视频
this.updateSrtUrl(request.getSrtUrl(), inspection.getId(), request.getType(), inspection.getTenantId());

// 上传离线视频,更新任务状态为分析中
inspectionUpdate.setSrtName(request.getSrtUrl().substring(request.getSrtUrl().lastIndexOf("/") + 1));
inspectionUpdate.setVideoUrl(StringUtils.removeHost(request.getVideoUrl(), CommonConfig.videoURL));

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/DspServiceImpl.java View File

@@ -59,7 +59,7 @@ public class DspServiceImpl implements IDspService {
throw new ServiceException("调用DSP服务:DSP返回失败");
}
log.info("调用DSP服务, result:{}", jsonResult);
return JSONObject.parseObject(String.valueOf(jsonResult));
return JSONObject.parseObject(JSONObject.toJSONString(jsonResult));
}

@Override

+ 32
- 0
tuoheng-service/tuoheng-admin/src/test/java/com/tuoheng/admin/service/UploadFlightUrlServiceTest.java View File

@@ -0,0 +1,32 @@
package com.tuoheng.admin.service;

import com.tuoheng.admin.request.inspection.UploadFlightUrlRequest;
import com.tuoheng.admin.request.third.DspCallbackRequest;
import com.tuoheng.admin.service.inspection.upload.UploadFlightUrlService;
import com.tuoheng.admin.service.third.dsp.IDspCallbackService;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest
public class UploadFlightUrlServiceTest {

@Autowired
private UploadFlightUrlService uploadFlightUrlService;

@Test
public void testUploadFlightUrl() {
UploadFlightUrlRequest request = new UploadFlightUrlRequest();
request.setTaskCode("XJRW20231207173128");
request.setVideoUrl("https://vod.play.t-aaron.com/customerTrans/edc96ea2115a0723a003730956208134/c3cb5f8-18c46dc567f-0004-f90c-f2c-7ec68.mp4");
request.setSrtUrl("https://ta-tech-image.oss-cn-shanghai.aliyuncs.com/imagedir/6pjsutni0ut_1701995902767.SRT");
request.setType(1);
uploadFlightUrlService.uploadFlightUrl(request);
}

}

Loading…
Cancel
Save