Parcourir la source

fix: 回退电子稳相代码

WANGKANG il y a 5 mois
Parent
commit
529fcc7b47

+ 2 - 0
taais-admin/src/main/resources/application-dev.yml

@@ -1,4 +1,6 @@
 server:
+  video_stable_start_url: http://localhost:11006/video_stable
+  video_stable_stop_url: http://localhost:11006/video_stable_stop
   task_stop_url: http://localhost:11003/stop
   task_stop_url_cat: http://localhost:11004/stop
 

+ 10 - 25
taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/VideoStableServiceImpl.java

@@ -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.service.impl.BaseServiceImpl;
 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.service.ISysDictDataService;
 import com.taais.system.service.ISysOssService;
 import jakarta.annotation.Resource;
 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.util.EntityUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -60,8 +59,11 @@ import static com.taais.biz.service.impl.ToInfraredServiceImpl.readLogContent;
 @Service
 @Slf4j
 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
     private ISysOssService ossService;
@@ -69,23 +71,6 @@ public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, V
     @Resource
     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
     public QueryWrapper query() {
         return super.query().from(VIDEO_STABLE);
@@ -126,7 +111,7 @@ public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, V
     @Override
     public List<VideoStableVo> selectList(VideoStableBo 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);
     }
 
@@ -139,7 +124,7 @@ public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, V
     @Override
     public PageResult<VideoStableVo> selectPage(VideoStableBo 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);
         return PageResult.build(page);
     }
@@ -250,7 +235,7 @@ public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, V
 
         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) {
             return CommonResult.success("任务开始成功,请等待完成");
         } else {
@@ -344,7 +329,7 @@ public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, V
         VideoStable videoStable = getById(id);
 
         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) {
             videoStable.setStatus(BizConstant.VideoStatus.INTERRUPTED);
             updateById(videoStable);