Parcourir la source

2.1.project-jmga-2.1.0

dengsixing il y a 1 mois
Parent
commit
ca71081eed

+ 6 - 0
pom.xml

@@ -105,6 +105,12 @@
             <artifactId>ant</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>com.dtflys.forest</groupId>
+            <artifactId>forest-spring-boot-starter</artifactId>
+            <version>1.5.19</version>
+        </dependency>
+
     </dependencies>
 
     <dependencyManagement>

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

@@ -1,5 +1,6 @@
 package com.fdkankan.download;
 
+import com.dtflys.forest.springboot.annotation.ForestScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.context.config.annotation.RefreshScope;
@@ -20,6 +21,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
 @ComponentScan(basePackages = {"com.fdkankan.*"})
 @RefreshScope
 @EnableAsync
+@ForestScan(basePackages = "com.fdkankan.download.httpclient")
 public class SceneDownloadApplication {
     public static void main(String[] args) {
         SpringApplication.run(SceneDownloadApplication.class, args);

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

@@ -274,6 +274,10 @@ public class SceneViewInfo implements Serializable {
 
     private String threeCamType;
 
+    private List<JSONObject> tiledMap;
+
+    private int gdMapStatus;
+
 
 
 

+ 18 - 0
src/main/java/com/fdkankan/download/httpclient/LaserHttpClient.java

@@ -0,0 +1,18 @@
+package com.fdkankan.download.httpclient;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.dtflys.forest.annotation.*;
+import com.fdkankan.web.response.Result;
+
+import java.util.List;
+
+//@Address(source = FdkkAddressSource.class)
+public interface LaserHttpClient {
+
+    @Post("${host}/laser/jm/getTiledMap/${num}")
+    Result<List<JSONObject>> getTiledMap(@Var("host") String host, @Var("num") String num);
+
+    @Post("${host}/laser/jm/${num}/getDataSetAndControlPoint")
+    Result<JSONObject> getDataSetAndControlPoint(@Var("host") String host, @Var("num") String num);
+}

+ 21 - 0
src/main/java/com/fdkankan/download/service/impl/SceneDownloadHandlerServiceImpl.java

@@ -22,6 +22,7 @@ import com.fdkankan.download.bean.*;
 import com.fdkankan.download.entity.ScenePlus;
 import com.fdkankan.download.entity.ScenePlusExt;
 import com.fdkankan.download.entity.ScenePro;
+import com.fdkankan.download.httpclient.LaserHttpClient;
 import com.fdkankan.download.service.IScenePlusExtService;
 import com.fdkankan.download.service.IScenePlusService;
 import com.fdkankan.download.service.ISceneProService;
@@ -30,6 +31,7 @@ import com.fdkankan.fyun.face.FYunFileServiceInterface;
 import com.fdkankan.model.constants.UploadFilePath;
 import com.fdkankan.redis.constant.RedisKey;
 import com.fdkankan.redis.util.RedisUtil;
+import com.fdkankan.web.response.Result;
 import com.google.common.collect.Lists;
 import java.io.File;
 import java.io.FileInputStream;
@@ -131,6 +133,10 @@ public class SceneDownloadHandlerServiceImpl {
     private IScenePlusExtService scenePlusExtService;
     @Autowired
     private ISceneProService sceneProService;
+    @Value("${4dkk.laserService.basePath}")
+    private String laserHost;
+    @Resource
+    private LaserHttpClient laserHttpClient;
 
     @Async("sceneDownLoadExecutror")
     public void download(DownLoadTaskBean downLoadTaskBean){
@@ -651,6 +657,21 @@ public class SceneDownloadHandlerServiceImpl {
         return map;
     }
 
+    private void setRtkInfo(SceneViewInfo sceneViewInfo){
+        //如果是激光场景,请求激光系统获取激光场景特有属性,提供给许钟文使用
+        try {
+            if("laser".equals(sceneViewInfo.getSceneFrom())){
+                Result<List<com.alibaba.fastjson.JSONObject>> tiledMap = laserHttpClient.getTiledMap(laserHost, sceneViewInfo.getNum());
+                sceneViewInfo.setTiledMap(tiledMap.getData());
+
+                Result<com.alibaba.fastjson.JSONObject> dataSetAndControlPoint = laserHttpClient.getDataSetAndControlPoint(laserHost, sceneViewInfo.getNum());
+                sceneViewInfo.setGdMapStatus(dataSetAndControlPoint.getData().getJSONObject("controlPoint").getIntValue("status"));
+            }
+        }catch (Exception e){
+            log.warn("获取激光场景信息出错,num:{}", param.getNum(), e);
+        }
+    }
+
     private void zipSceneJson(String num, SceneViewInfo sceneViewInfo) throws Exception{
         //访问密码置0
         SceneEditControlsVO controls = sceneViewInfo.getControls();

+ 4 - 0
src/main/resources/bootstrap-prod.yml

@@ -24,6 +24,10 @@ spring:
           - data-id: common-db-config.yaml
             group: DEFAULT_GROUP
             refresh: true
+
+          - data-id: forest-config.yaml
+            group: DEFAULT_GROUP
+            refresh: true
       discovery:
         namespace: ${spring.cloud.nacos.namespace}
 

+ 4 - 0
src/main/resources/bootstrap-test.yml

@@ -24,6 +24,10 @@ spring:
           - data-id: common-db-config.yaml
             group: DEFAULT_GROUP
             refresh: true
+
+          - data-id: forest-config.yaml
+            group: DEFAULT_GROUP
+            refresh: true
       discovery:
         namespace: ${spring.cloud.nacos.namespace}