|
@@ -17,7 +17,7 @@ import com.taais.biz.domain.ToInfrared;
|
|
|
import com.taais.biz.domain.bo.ToInfraredBo;
|
|
|
import com.taais.biz.domain.vo.AlgorithmConfigTrackVo;
|
|
|
import com.taais.biz.domain.vo.AlgorithmModelTrackVo;
|
|
|
-import com.taais.biz.domain.vo.StartToInfraredTask;
|
|
|
+import com.taais.biz.domain.vo.StartTaskConfig;
|
|
|
import com.taais.biz.domain.vo.ToInfraredVo;
|
|
|
import com.taais.biz.mapper.ToInfraredMapper;
|
|
|
import com.taais.biz.service.IToInfraredService;
|
|
@@ -226,9 +226,9 @@ public class ToInfraredServiceImpl extends BaseServiceImpl<ToInfraredMapper, ToI
|
|
|
|
|
|
@Override
|
|
|
public CommonResult start(Long id) {
|
|
|
- ToInfrared toInfrared = getById(id);
|
|
|
+ ToInfrared entity = getById(id);
|
|
|
|
|
|
- SysOssVo inputOssEntity = ossService.getById(toInfrared.getInputOssId());
|
|
|
+ SysOssVo inputOssEntity = ossService.getById(entity.getInputOssId());
|
|
|
|
|
|
String filePath = inputOssEntity.getFileName();
|
|
|
String localPath = TaaisConfig.getProfile();
|
|
@@ -249,45 +249,37 @@ public class ToInfraredServiceImpl extends BaseServiceImpl<ToInfraredMapper, ToI
|
|
|
ZipUtils.unzip(resourcePath, inputPath.toString());
|
|
|
}
|
|
|
|
|
|
- toInfrared.setInputPath(inputPath.toString());
|
|
|
- toInfrared.setOutputPath(outputPath.toString());
|
|
|
+ entity.setInputPath(inputPath.toString());
|
|
|
+ entity.setOutputPath(outputPath.toString());
|
|
|
|
|
|
- toInfrared.setStartTime(new Date());
|
|
|
+ entity.setStartTime(new Date());
|
|
|
|
|
|
- AlgorithmModelTrack algorithmModelTrack = algorithmModelTrackService.getById(toInfrared.getAlgorithmModelId());
|
|
|
+ AlgorithmModelTrack algorithmModelTrack = algorithmModelTrackService.getById(entity.getAlgorithmModelId());
|
|
|
AlgorithmConfigTrack algorithmConfigTrack = algorithmConfigTrackService.getById(algorithmModelTrack.getAlgorithmId());
|
|
|
|
|
|
- StartToInfraredTask startToInfraredTask = new StartToInfraredTask();
|
|
|
- startToInfraredTask.setBizType(BizConstant.BizType.TO_INFRARED);
|
|
|
- startToInfraredTask.setBizId(toInfrared.getId());
|
|
|
+ StartTaskConfig startTaskConfig = new StartTaskConfig();
|
|
|
+ startTaskConfig.setBizType(BizConstant.BizType.TO_INFRARED);
|
|
|
+ startTaskConfig.setBizId(entity.getId());
|
|
|
|
|
|
- startToInfraredTask.setOtherParams(algorithmConfigTrack.getParameterConfig());
|
|
|
-
|
|
|
-// String osName = System.getProperty("os.name");
|
|
|
-// if (osName.toLowerCase().contains("windows")) {
|
|
|
-// startToInfraredTask.setSource_dir("C:" + toInfrared.getInputPath());
|
|
|
-// startToInfraredTask.setResult_dir("C:" + toInfrared.getOutputPath());
|
|
|
-// } else {
|
|
|
- startToInfraredTask.setSource_dir(toInfrared.getInputPath());
|
|
|
- startToInfraredTask.setResult_dir(toInfrared.getOutputPath());
|
|
|
-// }
|
|
|
+ startTaskConfig.setOtherParams(algorithmConfigTrack.getParameterConfig());
|
|
|
|
|
|
- // startToInfraredTask.setSource_dir(toInfrared.getInputPath());
|
|
|
- // startToInfraredTask.setResult_dir(toInfrared.getOutputPath());
|
|
|
+ startTaskConfig.setSource_dir(entity.getInputPath());
|
|
|
+ startTaskConfig.setResult_dir(entity.getOutputPath());
|
|
|
+ startTaskConfig.setLog_path(entity.getOutputPath() + File.separator + "log.log");
|
|
|
|
|
|
if (BizConstant.AlgorithmType.REASONING.equals(algorithmConfigTrack.getType())) {
|
|
|
- startToInfraredTask.setModel_path(algorithmModelTrack.getModelAddress());
|
|
|
+ startTaskConfig.setModel_path(algorithmModelTrack.getModelAddress());
|
|
|
}
|
|
|
|
|
|
|
|
|
- HttpResponseEntity responseEntity = sendPostMsg(algorithmConfigTrack.getAlgorithmAddress(), startToInfraredTask);
|
|
|
+ HttpResponseEntity responseEntity = sendPostMsg(algorithmConfigTrack.getAlgorithmAddress(), startTaskConfig);
|
|
|
if (ObjectUtil.isNotNull(responseEntity) && responseEntity.getStatus() == 200) {
|
|
|
- toInfrared.setStatus(BizConstant.VideoStatus.RUNNING);
|
|
|
- updateById(toInfrared);
|
|
|
+ entity.setStatus(BizConstant.VideoStatus.RUNNING);
|
|
|
+ updateById(entity);
|
|
|
return CommonResult.success("任务开始成功,请等待完成");
|
|
|
} else {
|
|
|
- toInfrared.setStatus(BizConstant.VideoStatus.FAILED);
|
|
|
- updateById(toInfrared);
|
|
|
+ entity.setStatus(BizConstant.VideoStatus.FAILED);
|
|
|
+ updateById(entity);
|
|
|
return CommonResult.fail("任务开始失败,请检查!");
|
|
|
}
|
|
|
}
|
|
@@ -296,11 +288,11 @@ public class ToInfraredServiceImpl extends BaseServiceImpl<ToInfraredMapper, ToI
|
|
|
public CommonResult stop(Long id) {
|
|
|
ToInfrared toInfrared = getById(id);
|
|
|
|
|
|
- StartToInfraredTask startToInfraredTask = new StartToInfraredTask();
|
|
|
- startToInfraredTask.setBizType(BizConstant.BizType.TO_INFRARED);
|
|
|
- startToInfraredTask.setBizId(toInfrared.getId());
|
|
|
+ StartTaskConfig startTaskConfig = new StartTaskConfig();
|
|
|
+ startTaskConfig.setBizType(BizConstant.BizType.TO_INFRARED);
|
|
|
+ startTaskConfig.setBizId(toInfrared.getId());
|
|
|
|
|
|
- HttpResponseEntity responseEntity = sendPostMsg(task_stop_url, startToInfraredTask);
|
|
|
+ HttpResponseEntity responseEntity = sendPostMsg(task_stop_url, startTaskConfig);
|
|
|
if (ObjectUtil.isNotNull(responseEntity) && responseEntity.getStatus() == 200) {
|
|
|
toInfrared.setStatus(BizConstant.VideoStatus.INTERRUPTED);
|
|
|
updateById(toInfrared);
|