|
@@ -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位字符串,字母加数字组合,有大小写
|