|
@@ -14,6 +14,7 @@ import com.mybatisflex.core.paginate.Page;
|
|
|
import com.mybatisflex.core.query.QueryWrapper;
|
|
|
import com.taais.biz.constant.BizConstant;
|
|
|
import com.taais.biz.domain.HttpResponseEntity;
|
|
|
+import com.taais.biz.domain.ToInfrared;
|
|
|
import com.taais.biz.domain.bo.VideoStableStartResultBo;
|
|
|
import com.taais.biz.utils.ZipUtils;
|
|
|
import com.taais.common.core.config.TaaisConfig;
|
|
@@ -25,6 +26,7 @@ import com.taais.common.json.utils.JsonUtils;
|
|
|
import com.taais.common.orm.core.page.PageQuery;
|
|
|
import com.taais.common.core.core.page.PageResult;
|
|
|
import com.taais.common.orm.core.service.impl.BaseServiceImpl;
|
|
|
+import com.taais.common.websocket.utils.WebSocketUtils;
|
|
|
import com.taais.system.domain.vo.SysOssVo;
|
|
|
import com.taais.system.service.ISysOssService;
|
|
|
import jakarta.annotation.Resource;
|
|
@@ -47,6 +49,7 @@ import com.taais.biz.service.IVideoStableService;
|
|
|
|
|
|
import static com.taais.biz.domain.table.VideoStableTableDef.VIDEO_STABLE;
|
|
|
import static com.taais.biz.service.impl.DataSeqServiceImpl.isImageFile;
|
|
|
+import static com.taais.biz.service.impl.ToInfraredServiceImpl.readLogContent;
|
|
|
|
|
|
/**
|
|
|
* 视频去抖动Service业务层处理
|
|
@@ -229,6 +232,8 @@ public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, V
|
|
|
videoStable.setStatus(BizConstant.VideoStatus.RUNNING);
|
|
|
updateById(videoStable);
|
|
|
|
|
|
+ videoStable.setLogPath(videoStable.getOutputPath() + File.separator + getLogFileName(videoStable));
|
|
|
+
|
|
|
HttpResponseEntity responseEntity = sendPostMsg(video_stable_start_url, videoStable);
|
|
|
if (ObjectUtil.isNotNull(responseEntity) && responseEntity.getStatus() == 200) {
|
|
|
return CommonResult.success("任务开始成功,请等待完成");
|
|
@@ -280,6 +285,7 @@ public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, V
|
|
|
videoStable.setCostSecond(null);
|
|
|
}
|
|
|
updateById(videoStable);
|
|
|
+ WebSocketUtils.publishAll("refresh");
|
|
|
return CommonResult.success();
|
|
|
}
|
|
|
|
|
@@ -381,6 +387,23 @@ public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, V
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private String getLogFileName(VideoStable entity) {
|
|
|
+ return entity.getId() + BizConstant.VIDEO_STABLE_SUFFIX + ".log";
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public CommonResult getLog(Long id) {
|
|
|
+ VideoStable entity = getById(id);
|
|
|
+ String outPutPath = entity.getOutputPath();
|
|
|
+ String logPath = outPutPath + File.separator + getLogFileName(entity);
|
|
|
+ System.out.println(logPath);
|
|
|
+ File file = new File(logPath);
|
|
|
+ if (!file.exists()) {
|
|
|
+ return CommonResult.fail("日志文件不存在!");
|
|
|
+ }
|
|
|
+ return CommonResult.success(readLogContent(logPath), "success");
|
|
|
+ }
|
|
|
+
|
|
|
public List<String> getImageUrls(SysOssVo ossEntity, String path, String suffix) {
|
|
|
String urlPrefix = ossEntity.getUrl().substring(0, ossEntity.getUrl().lastIndexOf(".")) + suffix;
|
|
|
// 列出unzipPath下所有图片文件
|