|
@@ -26,9 +26,7 @@ import com.taais.common.json.utils.JsonUtils;
|
|
import com.taais.common.orm.core.page.PageQuery;
|
|
import com.taais.common.orm.core.page.PageQuery;
|
|
import com.taais.common.orm.core.service.impl.BaseServiceImpl;
|
|
import com.taais.common.orm.core.service.impl.BaseServiceImpl;
|
|
import com.taais.common.websocket.utils.WebSocketUtils;
|
|
import com.taais.common.websocket.utils.WebSocketUtils;
|
|
-import com.taais.system.domain.vo.SysDictDataVo;
|
|
|
|
import com.taais.system.domain.vo.SysOssVo;
|
|
import com.taais.system.domain.vo.SysOssVo;
|
|
-import com.taais.system.service.ISysDictDataService;
|
|
|
|
import com.taais.system.service.ISysOssService;
|
|
import com.taais.system.service.ISysOssService;
|
|
import jakarta.annotation.Resource;
|
|
import jakarta.annotation.Resource;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -39,6 +37,7 @@ import org.apache.http.impl.client.CloseableHttpClient;
|
|
import org.apache.http.impl.client.HttpClients;
|
|
import org.apache.http.impl.client.HttpClients;
|
|
import org.apache.http.util.EntityUtils;
|
|
import org.apache.http.util.EntityUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
@@ -60,8 +59,11 @@ import static com.taais.biz.service.impl.ToInfraredServiceImpl.readLogContent;
|
|
@Service
|
|
@Service
|
|
@Slf4j
|
|
@Slf4j
|
|
public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, VideoStable> implements IVideoStableService {
|
|
public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, VideoStable> implements IVideoStableService {
|
|
- @Autowired
|
|
|
|
- private ISysDictDataService sysDictDataService;
|
|
|
|
|
|
+ @Value("${server.video_stable_start_url}")
|
|
|
|
+ private String video_stable_start_url;
|
|
|
|
+
|
|
|
|
+ @Value("${server.video_stable_stop_url}")
|
|
|
|
+ private String video_stable_stop_url;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private ISysOssService ossService;
|
|
private ISysOssService ossService;
|
|
@@ -69,23 +71,6 @@ public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, V
|
|
@Resource
|
|
@Resource
|
|
private VideoStableMapper videoStableMapper;
|
|
private VideoStableMapper videoStableMapper;
|
|
|
|
|
|
- public String getKeyValueFromSysDictData(String key) {
|
|
|
|
- SysDictDataVo res = sysDictDataService.selectDictDataByTypeAndLabel("biz_data_augmentation", key);
|
|
|
|
- if (ObjectUtil.isNull(res)) {
|
|
|
|
- throw new RuntimeException(key + "不存在于数据字典<biz_data_augmentation>中,请检查!");
|
|
|
|
- } else {
|
|
|
|
- return res.getDictValue();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public String get_start_api() {
|
|
|
|
- return getKeyValueFromSysDictData("电子稳相开始url1");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public String get_stop_api() {
|
|
|
|
- return getKeyValueFromSysDictData("电子稳相结束url");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public QueryWrapper query() {
|
|
public QueryWrapper query() {
|
|
return super.query().from(VIDEO_STABLE);
|
|
return super.query().from(VIDEO_STABLE);
|
|
@@ -126,7 +111,7 @@ public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, V
|
|
@Override
|
|
@Override
|
|
public List<VideoStableVo> selectList(VideoStableBo videoStableBo) {
|
|
public List<VideoStableVo> selectList(VideoStableBo videoStableBo) {
|
|
QueryWrapper queryWrapper = buildQueryWrapper(videoStableBo);
|
|
QueryWrapper queryWrapper = buildQueryWrapper(videoStableBo);
|
|
- queryWrapper.orderBy(VIDEO_STABLE.CREATE_TIME, Boolean.FALSE);
|
|
|
|
|
|
+ queryWrapper.orderBy(VIDEO_STABLE.CREATE_TIME,Boolean.FALSE);
|
|
return this.listAs(queryWrapper, VideoStableVo.class);
|
|
return this.listAs(queryWrapper, VideoStableVo.class);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -139,7 +124,7 @@ public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, V
|
|
@Override
|
|
@Override
|
|
public PageResult<VideoStableVo> selectPage(VideoStableBo videoStableBo) {
|
|
public PageResult<VideoStableVo> selectPage(VideoStableBo videoStableBo) {
|
|
QueryWrapper queryWrapper = buildQueryWrapper(videoStableBo);
|
|
QueryWrapper queryWrapper = buildQueryWrapper(videoStableBo);
|
|
- queryWrapper.orderBy(VIDEO_STABLE.CREATE_TIME, Boolean.FALSE);
|
|
|
|
|
|
+ queryWrapper.orderBy(VIDEO_STABLE.CREATE_TIME,Boolean.FALSE);
|
|
Page<VideoStableVo> page = this.pageAs(PageQuery.build(), queryWrapper, VideoStableVo.class);
|
|
Page<VideoStableVo> page = this.pageAs(PageQuery.build(), queryWrapper, VideoStableVo.class);
|
|
return PageResult.build(page);
|
|
return PageResult.build(page);
|
|
}
|
|
}
|
|
@@ -250,7 +235,7 @@ public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, V
|
|
|
|
|
|
videoStable.setLogPath(videoStable.getOutputPath() + File.separator + getLogFileName(videoStable));
|
|
videoStable.setLogPath(videoStable.getOutputPath() + File.separator + getLogFileName(videoStable));
|
|
|
|
|
|
- HttpResponseEntity responseEntity = sendPostMsg(get_start_api(), videoStable);
|
|
|
|
|
|
+ HttpResponseEntity responseEntity = sendPostMsg(video_stable_start_url, videoStable);
|
|
if (ObjectUtil.isNotNull(responseEntity) && responseEntity.getStatus() == 200) {
|
|
if (ObjectUtil.isNotNull(responseEntity) && responseEntity.getStatus() == 200) {
|
|
return CommonResult.success("任务开始成功,请等待完成");
|
|
return CommonResult.success("任务开始成功,请等待完成");
|
|
} else {
|
|
} else {
|
|
@@ -344,7 +329,7 @@ public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, V
|
|
VideoStable videoStable = getById(id);
|
|
VideoStable videoStable = getById(id);
|
|
|
|
|
|
videoStable.setLogPath(videoStable.getOutputPath() + File.separator + getLogFileName(videoStable));
|
|
videoStable.setLogPath(videoStable.getOutputPath() + File.separator + getLogFileName(videoStable));
|
|
- HttpResponseEntity responseEntity = sendPostMsg(get_stop_api(), videoStable);
|
|
|
|
|
|
+ HttpResponseEntity responseEntity = sendPostMsg(video_stable_stop_url, videoStable);
|
|
if (ObjectUtil.isNotNull(responseEntity) && responseEntity.getStatus() == 200) {
|
|
if (ObjectUtil.isNotNull(responseEntity) && responseEntity.getStatus() == 200) {
|
|
videoStable.setStatus(BizConstant.VideoStatus.INTERRUPTED);
|
|
videoStable.setStatus(BizConstant.VideoStatus.INTERRUPTED);
|
|
updateById(videoStable);
|
|
updateById(videoStable);
|