dengsixing 2 viikkoa sitten
vanhempi
commit
ff8f5598e4

+ 4 - 0
src/main/java/com/fdkankan/download/bean/SceneEditControlsBean.java

@@ -120,5 +120,9 @@ public class SceneEditControlsBean implements Serializable {
 
     private Integer showPanos;
 
+    private Integer showAi;
+
+    private Integer showSurveilScope;
+
 
 }

+ 2 - 0
src/main/java/com/fdkankan/download/bean/SceneViewInfoBean.java

@@ -266,5 +266,7 @@ public class SceneViewInfoBean implements Serializable {
     //动态面板
     private int dynamicPanel;
 
+    private Integer hasRecognition;
+
 
 }

+ 86 - 0
src/main/java/com/fdkankan/download/listener/RabbitMqListener.java

@@ -0,0 +1,86 @@
+package com.fdkankan.download.listener;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.common.constant.CommonStatus;
+import com.fdkankan.common.constant.CommonSuccessStatus;
+import com.fdkankan.common.constant.SceneSource;
+import com.fdkankan.download.entity.DownloadLog;
+import com.fdkankan.download.entity.ScenePlus;
+import com.fdkankan.download.entity.ScenePlusExt;
+import com.fdkankan.download.service.*;
+import com.fdkankan.scene.entity.DownloadTourVideo;
+import com.fdkankan.scene.service.IDownloadTourVideoService;
+import com.fdkankan.scene.service.IRemovePortraitService;
+import com.fdkankan.scene.service.ISceneService;
+import com.rabbitmq.client.Channel;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.amqp.core.Message;
+import org.springframework.amqp.rabbit.annotation.Queue;
+import org.springframework.amqp.rabbit.annotation.RabbitListener;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.nio.charset.StandardCharsets;
+import java.util.Map;
+
+/**
+ * <p>
+ * TODO
+ * </p>
+ *
+ * @author dengsixing
+ * @since 2022/4/19
+ **/
+@Slf4j
+@Component
+public class RabbitMqListener {
+
+    @Autowired
+    private IDownloadService downloadService;
+    @Autowired
+    private IScenePlusService scenePlusService;
+    @Autowired
+    private IScenePlusExtService scenePlusExtService;
+    @Autowired
+    private IDownloadLogService downloadLogService;
+
+
+    @RabbitListener(
+            queuesToDeclare = @Queue("batch-download-scene"),
+            concurrency = "5"
+    )
+    public void downloadScene(Channel channel, Message message) throws Exception {
+        String messageId = message.getMessageProperties().getMessageId();
+        String msg = new String(message.getBody(), StandardCharsets.UTF_8);
+        log.info("开始消费消息,id:{},queue:{},content:{}", messageId, "batch-download-scene", msg);
+        JSONObject jsonObject = JSON.parseObject(msg);
+        String num = jsonObject.getString("num");
+
+        DownloadLog downloadLog = new DownloadLog();
+        downloadLog.setNum(num);
+        ScenePlusExt scenePlusExt = null;
+        ScenePlus scenePlus = scenePlusService.getByNum(num);
+        if(scenePlus == null){
+            downloadLog.setStatus(CommonSuccessStatus.FAIL.code());
+            downloadLog.setReason("场景不存在或已被删除");
+            downloadLogService.save(downloadLog);
+        }
+        scenePlusExt = scenePlusExtService.getByPlusId(scenePlus.getId());
+        if(scenePlus.getSceneSource() == SceneSource.JG.code()
+                || scenePlus.getSceneSource() == SceneSource.SG.code()
+                || scenePlus.getSceneSource() == SceneSource.SX.code()){
+            downloadService.downloadLaserScene(num);
+        }
+        if(scenePlus.getSceneSource() == SceneSource.BM.code()
+                || scenePlus.getSceneSource() == SceneSource.ZT.code()
+                || scenePlusExt.getIsObj() == 1){
+            downloadService.downloadMeshScene(num);
+        }
+
+        channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
+        log.info("结束消费消息,id:{}", messageId);
+    }
+
+}

+ 5 - 5
src/main/resources/application-prod.yml

@@ -17,10 +17,10 @@ spring:
     lettuce:
       shutdown-timeout: 0ms
   rabbitmq:
-    host: 120.24.144.164
+    host: 172.18.157.42
     port: 5672
-    username: admin
-    password: adminv41234
+    username: guest
+    password: guest
     virtual-host: 4dkankan
     connection-timeout: 0
     listener:
@@ -34,9 +34,9 @@ spring:
 mybatis-flex:
   datasource:
     primary:
-      url: jdbc:mysql://120.24.144.164:3306/4dkankan_scene_download_tool
+      url: jdbc:mysql://rm-wz90w10465iiwwv09.mysql.rds.aliyuncs.com:3306/4dkankan_scene_download_tool
       username: root
-      password: 4Dage@4Dage#@168
+      password: D2719bd0cae1a005
     www:
       url: jdbc:mysql://rm-wz90w10465iiwwv09.mysql.rds.aliyuncs.com:3306/4dkankan_v4_prod
       username: root