1
0

2 کامیت‌ها 17db314263 ... 61db8f83ab

نویسنده SHA1 پیام تاریخ
  WANGKANG 17db314263 Merge branch 'develop' of http://101.126.133.7:9001/www/taais into develop 5 ماه پیش
  Eagle d721421cb1 [FEATURE] 多源信息融合、异源图像匹配、电子稳相的暂停、继续、停止功能 5 ماه پیش

+ 0 - 58
taais-modules/taais-biz/src/main/java/com/taais/biz/controller/ObjectMatchController.java

@@ -173,64 +173,6 @@ public class ObjectMatchController extends BaseController {
         return CommonResult.success();
     }
 
-    @GetMapping("/hangup")
-    public CommonResult<Void> hangup(String taskId) {
-        ObjectMatchBo bo = objectMatchService.getById(Long.parseLong(taskId));
-        Map<String, String> params = new HashMap<>();
-
-        params.put("bizId", String.valueOf(bo.getId()));
-        params.put("bizType", TYPE_OBJ_MATCH);
-        params.put("logPath", DOCKER_BASE_PATH + bo.getResultPath() + "/log.log");
-        params.put("sourcePath", DOCKER_BASE_PATH +  bo.getPreprocessPath());
-        params.put("resultPath", DOCKER_BASE_PATH + bo.getResultPath());
-        params.put("otherParams", bo.getParameters());
-
-        log.info("obj_match params: {}", params);
-
-        try {
-            String url = algorithmConfigService.getByAlgorithmName("异源图像匹配定位").getPauseApi();
-            String res = HttpUtil.post(url, JSONUtil.toJsonStr(params));
-            bo.setStatus(TASK_STATUS_PENDING);
-            bo.setEndTime(new Date());
-            bo.setCostSecond((bo.getEndTime().getTime() - bo.getStartTime().getTime()) / 1000);
-        } catch (Exception e) {
-            log.error("HTTP请求失败",e);
-            return CommonResult.fail("HTTP请求失败" + e.getMessage());
-        } finally {
-            objectMatchService.update(bo);
-        }
-        return CommonResult.success();
-    }
-
-    @GetMapping("/stop")
-    public CommonResult<Void> stop(String taskId) {
-        ObjectMatchBo bo = objectMatchService.getById(Long.parseLong(taskId));
-        Map<String, String> params = new HashMap<>();
-
-        params.put("bizId", String.valueOf(bo.getId()));
-        params.put("bizType", TYPE_OBJ_MATCH);
-        params.put("logPath", DOCKER_BASE_PATH + bo.getResultPath() + "/log.log");
-        params.put("sourcePath", DOCKER_BASE_PATH +  bo.getPreprocessPath());
-        params.put("resultPath", DOCKER_BASE_PATH + bo.getResultPath());
-        params.put("otherParams", bo.getParameters());
-
-        log.info("obj_match params: {}", params);
-
-        try {
-            String url = algorithmConfigService.getByAlgorithmName("异源图像匹配定位").getTerminateApi();
-            String res = HttpUtil.post(url, JSONUtil.toJsonStr(params));
-            bo.setStatus(TASK_STATUS_PENDING);
-            bo.setEndTime(new Date());
-            bo.setCostSecond((bo.getEndTime().getTime() - bo.getStartTime().getTime()) / 1000);
-        } catch (Exception e) {
-            log.error("HTTP请求失败",e);
-            return CommonResult.fail("HTTP请求失败" + e.getMessage());
-        } finally {
-            objectMatchService.update(bo);
-        }
-        return CommonResult.success();
-    }
-
     @GetMapping("/result")
     public CommonResult<List<String>> getResult(String taskId) {
         ObjectMatchBo bo = objectMatchService.getById(Long.parseLong(taskId));

+ 0 - 84
taais-modules/taais-biz/src/main/java/com/taais/biz/controller/ObjectTraceMergeController.java

@@ -163,90 +163,6 @@ public class ObjectTraceMergeController extends BaseController {
         return CommonResult.success();
     }
 
-    @PostMapping("/hangup")
-    public CommonResult<Void> hangup(@RequestBody Map<String, String> _params) {
-        if (!_params.containsKey("taskId")) {
-            return CommonResult.fail("请提供任务ID!");
-        }
-        String taskId = _params.get("taskId");
-        ObjectTraceMergeBo vo = objectTraceMergeService.getById(Long.valueOf(taskId));
-        if (vo == null) {
-            return CommonResult.fail("未找到任务内容!");
-        }
-        if (TASK_STATUS_SUCCEED.equals(vo.getStatus())) {
-            return CommonResult.fail("任务已经执行完毕!");
-        }
-//        if (!(TASK_STATUS_PENDING.equals(vo.getStatus()) || TASK_STATUS_FAILED.equals(vo.getStatus()))) {
-//            return CommonResult.fail("任务正在执行中!");
-//        }
-        vo.setEndTime(new Date());
-
-        Map<String, String> params = new HashMap<>();
-        params.put("bizType", TYPE_OBJ_TRACE);
-        params.put("bizId", String.valueOf(vo.getId()));
-        params.put("logPath", DOCKER_BASE_PATH + vo.getResultPath());
-        params.put("sourcePath", vo.getPreprocessPath());
-        params.put("resultPath", DOCKER_BASE_PATH +  vo.getResultPath());
-        params.put("otherParams", vo.getParameters());
-
-        log.info("obj_trace params: {}", params);
-
-        try {
-            String url = algorithmConfigService.getByAlgorithmName("多源信息融合").getPauseApi();
-            String res = HttpUtil.post(url, JSONUtil.toJsonStr(params));
-            vo.setStatus(TASK_STATUS_PENDING);
-        } catch (Exception e) {
-            log.error("HTTP请求失败",e);
-            vo.setStatus(TASK_STATUS_FAILED);
-            return CommonResult.fail("HTTP请求失败" + e.getMessage());
-        } finally {
-            objectTraceMergeService.update(vo);
-        }
-        return CommonResult.success();
-    }
-
-    @PostMapping("/stop")
-    public CommonResult<Void> stop(@RequestBody Map<String, String> _params) {
-        if (!_params.containsKey("taskId")) {
-            return CommonResult.fail("请提供任务ID!");
-        }
-        String taskId = _params.get("taskId");
-        ObjectTraceMergeBo vo = objectTraceMergeService.getById(Long.valueOf(taskId));
-        if (vo == null) {
-            return CommonResult.fail("未找到任务内容!");
-        }
-        if (TASK_STATUS_SUCCEED.equals(vo.getStatus())) {
-            return CommonResult.fail("任务已经执行完毕!");
-        }
-//        if (!(TASK_STATUS_PENDING.equals(vo.getStatus()) || TASK_STATUS_FAILED.equals(vo.getStatus()))) {
-//            return CommonResult.fail("任务正在执行中!");
-//        }
-        vo.setEndTime(new Date());
-
-        Map<String, String> params = new HashMap<>();
-        params.put("bizType", TYPE_OBJ_TRACE);
-        params.put("bizId", String.valueOf(vo.getId()));
-        params.put("logPath", DOCKER_BASE_PATH + vo.getResultPath());
-        params.put("sourcePath", vo.getPreprocessPath());
-        params.put("resultPath", DOCKER_BASE_PATH +  vo.getResultPath());
-        params.put("otherParams", vo.getParameters());
-
-        log.info("obj_trace params: {}", params);
-
-        try {
-            String url = algorithmConfigService.getByAlgorithmName("多源信息融合").getTerminateApi();
-            String res = HttpUtil.post(url, JSONUtil.toJsonStr(params));
-            vo.setStatus(TASK_STATUS_PENDING);
-        } catch (Exception e) {
-            log.error("HTTP请求失败",e);
-            vo.setStatus(TASK_STATUS_FAILED);
-            return CommonResult.fail("HTTP请求失败" + e.getMessage());
-        } finally {
-            objectTraceMergeService.update(vo);
-        }
-        return CommonResult.success();
-    }
-
     @GetMapping("/result")
     public CommonResult<List<String>> execute(String taskId) {
         if (taskId == null) {

+ 0 - 5
taais-modules/taais-biz/src/main/java/com/taais/biz/controller/VideoStableController.java

@@ -113,11 +113,6 @@ public class VideoStableController extends BaseController {
         return videoStableService.stop(id);
     }
 
-    @GetMapping("/hangup/{id}")
-    public CommonResult hangup(@PathVariable("id") Long id) {
-        return videoStableService.hangup(id);
-    }
-
     /**
      * 查询视频去抖动列表
      */

+ 0 - 2
taais-modules/taais-biz/src/main/java/com/taais/biz/service/IVideoStableService.java

@@ -78,8 +78,6 @@ public interface IVideoStableService extends IBaseService<VideoStable> {
 
     CommonResult stop(Long id);
 
-    CommonResult hangup(Long id);
-
     List<Map<String, String>> getImages(Long ossId);
 
     CommonResult getLog(Long id);

+ 1 - 19
taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/VideoStableServiceImpl.java

@@ -339,7 +339,7 @@ public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, V
 
         HttpResponseEntity responseEntity = sendPostMsg(url, videoStable);
         if (ObjectUtil.isNotNull(responseEntity) && responseEntity.getStatus() == 200) {
-            videoStable.setStatus(BizConstant.VideoStatus.NOT_START);
+            videoStable.setStatus(BizConstant.VideoStatus.INTERRUPTED);
             updateById(videoStable);
             return CommonResult.fail("终止任务成功");
         } else {
@@ -347,24 +347,6 @@ public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, V
         }
     }
 
-    @Override
-    public CommonResult hangup(Long id) {
-        VideoStable videoStable = getById(id);
-
-        videoStable.setLogPath(videoStable.getOutputPath() + File.separator + getLogFileName(videoStable));
-
-        String url = algorithmConfigService.getByAlgorithmName("电子稳相").getPauseApi();
-
-        HttpResponseEntity responseEntity = sendPostMsg(url, videoStable);
-        if (ObjectUtil.isNotNull(responseEntity) && responseEntity.getStatus() == 200) {
-            videoStable.setStatus(BizConstant.VideoStatus.INTERRUPTED);
-            updateById(videoStable);
-            return CommonResult.fail("暂停任务成功");
-        } else {
-            return CommonResult.fail("暂停任务失败");
-        }
-    }
-
     @Override
     public List<Map<String, String>> getImages(Long inputOdssId) {
         // 检查input_oss_id是否存在