|
@@ -39,6 +39,7 @@ import com.fdkankan.rabbitmq.bean.BuildSceneResultMqMessage;
|
|
|
import com.fdkankan.rabbitmq.util.RabbitMqProducer;
|
|
|
import com.fdkankan.redis.constant.RedisKey;
|
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
|
+import com.fdkankan.rubbersheeting.ScalingService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -47,6 +48,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
import java.util.*;
|
|
@@ -97,7 +99,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
@Autowired
|
|
|
private RabbitMqProducer mqProducer;
|
|
|
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private FYunFileServiceInterface fYunFileService;
|
|
|
@Autowired
|
|
|
private ICameraDetailService cameraDetailService;
|
|
@@ -142,10 +144,11 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
private ISceneBuildProcessLogService sceneBuildProcessLogService;
|
|
|
@Autowired
|
|
|
private ISceneColdStorageService sceneColdStorageService;
|
|
|
+ @Autowired
|
|
|
+ private ScalingService scalingService;
|
|
|
|
|
|
@Override
|
|
|
- public void buildScenePre(BuildSceneCallMessage message) throws Exception{
|
|
|
- boolean success = false;
|
|
|
+ public void buildScenePre(BuildSceneCallMessage message){
|
|
|
String num = message.getSceneNum();
|
|
|
try {
|
|
|
//重新计算时需要删除文件夹,否知使用缓存
|
|
@@ -199,17 +202,19 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
message.getBuildContext().put("cameraType",message.getCameraType());
|
|
|
|
|
|
- // 判断企业是否配置了弹性伸缩
|
|
|
- if (message.getFlexibility() == 0) {
|
|
|
+ // TODO: 2024/1/26
|
|
|
+ // 查询数据表,判断是否需要发送到特定的队列,并启动弹性伸缩
|
|
|
+ if("特殊队列"){
|
|
|
+
|
|
|
+ if("是否马上启动弹性伸缩"){
|
|
|
+ String result = scalingService.createEcs("查库中查出来的id");
|
|
|
+ log.info("createEcs-result:{}", result);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
//发送mq,就进行计算
|
|
|
mqProducer.sendByWorkQueue(queueModelingCall, message);
|
|
|
- } else {
|
|
|
- //发送mq,就进行计算
|
|
|
- mqProducer.sendByWorkQueue(singleModelingCall, message);
|
|
|
}
|
|
|
|
|
|
- success = true;
|
|
|
-
|
|
|
log.info("场景计算资源准备结束,场景码:{}", message.getSceneNum());
|
|
|
|
|
|
}catch (Exception e){
|