|
@@ -8,6 +8,7 @@ import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.fdkankan.common.constant.CommonStatus;
|
|
|
import com.fdkankan.contro.bean.TagBean;
|
|
|
import com.fdkankan.contro.entity.ScenePlus;
|
|
|
import com.fdkankan.contro.entity.ScenePlusExt;
|
|
@@ -44,7 +45,7 @@ public class LinkPanServiceImpl implements ILinkPanService {
|
|
|
private FYunFileServiceInterface fYunFileService;
|
|
|
|
|
|
@Override
|
|
|
- public void genLinkPanPost(String num) throws Exception {
|
|
|
+ public Integer genLinkPanPost(String num) throws Exception {
|
|
|
log.info("开始计算场景关联,num:{}", num);
|
|
|
ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
@@ -53,6 +54,7 @@ public class LinkPanServiceImpl implements ILinkPanService {
|
|
|
String dataFdagePath = baseCapturePath + "data.fdage";
|
|
|
String dataFdageStr = FileUtil.readUtf8String(dataFdagePath);
|
|
|
JSONObject dataFdageObj = JSON.parseObject(dataFdageStr);
|
|
|
+ Integer links = 0;
|
|
|
if ( dataFdageObj.containsKey("points")){
|
|
|
JSONArray points = dataFdageObj.getJSONArray("points");
|
|
|
log.info("points:{}", JSON.toJSONString(points));
|
|
@@ -110,12 +112,13 @@ public class LinkPanServiceImpl implements ILinkPanService {
|
|
|
fYunFileService.uploadMulFiles(map);
|
|
|
|
|
|
log.info("开始links.json文件");
|
|
|
- this.publicLinkSceneData(num);
|
|
|
+ links = this.publicLinkSceneData(num);
|
|
|
log.info("结束生成links.json文件");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
log.info("结束计算场景关联,num:{}", num);
|
|
|
+
|
|
|
+ return links;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -186,7 +189,7 @@ public class LinkPanServiceImpl implements ILinkPanService {
|
|
|
return panoTargetList;
|
|
|
}
|
|
|
|
|
|
- public void publicLinkSceneData(String num){
|
|
|
+ public Integer publicLinkSceneData(String num){
|
|
|
|
|
|
String userEditPath = String.format(UploadFilePath.USER_EDIT_PATH, num);
|
|
|
String userViewPath = String.format(UploadFilePath.USER_VIEW_PATH, num);
|
|
@@ -195,7 +198,7 @@ public class LinkPanServiceImpl implements ILinkPanService {
|
|
|
String linkPanKey = String.format(RedisKey.SCENE_LINKPAN_DATA, num);
|
|
|
Map<String, String> linkPanMap = redisUtil.hmget(linkPanKey);
|
|
|
if(CollUtil.isEmpty(linkPanMap)){
|
|
|
- return;
|
|
|
+ return CommonStatus.NO.code().intValue();
|
|
|
}
|
|
|
List<JSONObject> tags = Lists.newArrayList();
|
|
|
List<TagBean> tagBeanList = new ArrayList<>();
|
|
@@ -221,6 +224,8 @@ public class LinkPanServiceImpl implements ILinkPanService {
|
|
|
String linkSceneViewPath = userViewPath + "links.json";
|
|
|
fYunFileService.uploadFile(tags.toString().getBytes(StandardCharsets.UTF_8), linkScenePath);
|
|
|
fYunFileService.uploadFile(tags.toString().getBytes(StandardCharsets.UTF_8), linkSceneViewPath);
|
|
|
+
|
|
|
+ return CommonStatus.YES.code().intValue();
|
|
|
}
|
|
|
|
|
|
private void addOrUpdateLinPan(String num, String pano, Integer panoId, String sid) throws Exception{
|