xiewj 1 年之前
父節點
當前提交
7f766f82bc

+ 2 - 2
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/listener/DoSliceListener.java

@@ -51,8 +51,8 @@ public class DoSliceListener {
             String msg = new String(message.getBody(), StandardCharsets.UTF_8);
             String messageId = message.getMessageProperties().getMessageId();
             log.info("场景doSliceQueue开始,id:{},deliveryTag:{},消息体:{}", messageId,deliveryTag,msg);
-            Map<String,Long> map = JSONObject.parseObject(msg, Map.class);
-            fodderService.doSlice(map.get("id"), traceId);
+            Map<String,Object> map = JSONObject.parseObject(msg, Map.class);
+            fodderService.doSlice((Long) map.get("id"), traceId);
             channel.basicAck(deliveryTag, false);
         }catch (Exception e){
             e.printStackTrace();

+ 10 - 12
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/listener/SceneListener.java

@@ -113,27 +113,25 @@ public class SceneListener {
 
                 String visionUrl = "http://4dkk.4dage.com/scene_view_data/"+param.getSceneCode()+"/images/vision.txt";
                 HttpResponse execute = HttpRequest.get(visionUrl+"?m="+System.currentTimeMillis()).execute();
-                List<String> uuidList=new LinkedList<>();
+                JSONArray sweepLocations = new JSONArray();
                 if (execute.getStatus()==200){
                     log.info("vision.txt存在: {}");
                     JSONObject visJson = JSONObject.parseObject(execute.body());
                     if(visJson.containsKey("sweepLocations")){
-                        JSONArray sweepLocations = visJson.getJSONArray("sweepLocations");
-                        for (Object sweepLocation : sweepLocations) {
-                            JSONObject sweepLocationJson = (JSONObject) sweepLocation;
-                            String uuid = sweepLocationJson.getString("uuid");
-                            uuidList.add(uuid);
-                        }
+                          sweepLocations = visJson.getJSONArray("sweepLocations");
+
                     }
                 }
 
                 //2,使用krpano工具生成全景图数据
                 List<Map<String,Object>> scenes=new ArrayList<>();
-                for (int i = 0; i < uuidList.size(); i++) {
-                    String item = uuidList.get(i);
-                    String ossKey="scene_view_data/"+param.getSceneCode()+"/images/panoramas/"+item+".jpg";
+                for (int i = 0; i < sweepLocations.size(); i++) {
+                    JSONObject jsonObject = sweepLocations.getJSONObject(i);
+                    String uuid = jsonObject.getString("uuid");
+                    String id = jsonObject.getString("id");
+                    String ossKey="scene_view_data/"+param.getSceneCode()+"/images/panoramas/"+uuid+".jpg";
                     Map<String,Object> scene=new HashMap<>();
-                    ScenePanoEntity scenePanoEntity = this.doSlice(traceId ,ossKey, param.getSceneCode(), workEntity.getId(),item+".jpg");
+                    ScenePanoEntity scenePanoEntity = this.doSlice(traceId ,ossKey, param.getSceneCode(), workEntity.getId(),uuid+".jpg");
                     //  "icon": "https://ossxiaoan.4dage.com/720yun_fd_manage/fd720_8nRkFlzpp/vtour/panos/fd720_8nRkFlzpp.tiles/thumb.jpg",
                     //   "sceneCode": "fd720_8nRkFlzpp",
                     // "sceneTitle": "0",
@@ -142,7 +140,7 @@ public class SceneListener {
                     //  "id": "s_xId8vevp",
                     scene.put("icon", scenePanoEntity.getIcon());
                     scene.put("sceneCode", scenePanoEntity.getSceneCode());
-                    scene.put("sceneTitle", param.getSceneName());
+                    scene.put("sceneTitle", id);
                     scene.put("category", 1);
                     scene.put("type", "pano");
                     //id生成规则是 s_ 拼接,随机8位字符串,字母加数字组合,有大小写