|
@@ -394,12 +394,28 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
if(CollUtil.isEmpty(linkPanMap)){
|
|
|
return;
|
|
|
}
|
|
|
- JSONArray linkPanArr = new JSONArray();
|
|
|
- linkPanMap.values().stream().forEach(linkPan->{
|
|
|
- linkPanArr.add(JSON.parseObject(linkPan));
|
|
|
- });
|
|
|
+ List<JSONObject> tags = Lists.newArrayList();
|
|
|
+ List<TagBean> tagBeanList = new ArrayList<>();
|
|
|
+ if(CollUtil.isNotEmpty(linkPanMap)){
|
|
|
+ linkPanMap.entrySet().stream().forEach(entry -> {
|
|
|
+ JSONObject jsonObject = JSON.parseObject(entry.getValue());
|
|
|
+ tagBeanList.add(
|
|
|
+ TagBean.builder()
|
|
|
+ .createTime(jsonObject.getLong("createTime"))
|
|
|
+ .tag(jsonObject).build());
|
|
|
+ });
|
|
|
+ //按创建时间倒叙排序
|
|
|
+ tagBeanList.sort(Comparator.comparingLong(TagBean::getCreateTime).reversed());
|
|
|
+
|
|
|
+ //移除createTime字段
|
|
|
+ tags = tagBeanList.stream().map(tagBean -> {
|
|
|
+ JSONObject tag = tagBean.getTag();
|
|
|
+ tag.remove("createTime");
|
|
|
+ return tag;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ }
|
|
|
String linkScenePath = userEditPath + "links.json";
|
|
|
- fYunFileService.uploadFile(bucket, linkPanArr.toString().getBytes(), linkScenePath);
|
|
|
+ fYunFileService.uploadFile(bucket, JSON.toJSONString(tags).getBytes(StandardCharsets.UTF_8), linkScenePath);
|
|
|
|
|
|
//拷贝编辑目录到发布目录
|
|
|
fYunFileService.copyFileBetweenBucket(bucket, imgEditPath + "panorama", bucket, imgViewPath + "panorama");
|