|
@@ -19,6 +19,7 @@ import com.gis.common.httpclient.FdkkClient;
|
|
|
import com.gis.common.util.*;
|
|
|
import com.gis.domain.dto.*;
|
|
|
import com.gis.domain.entity.FodderEntity;
|
|
|
+import com.gis.domain.entity.ScenePanoEntity;
|
|
|
import com.gis.domain.entity.WorkEntity;
|
|
|
import com.gis.domain.entity.WorkHotsFodderEntity;
|
|
|
import com.gis.domain.vo.ReportWorkVo;
|
|
@@ -27,6 +28,7 @@ import com.gis.oss.util.FileAndOssUtil;
|
|
|
import com.gis.oss.util.FileUtils;
|
|
|
import com.gis.oss.util.QrCodeUtils;
|
|
|
import com.gis.service.FodderService;
|
|
|
+import com.gis.service.ScenePanoService;
|
|
|
import com.gis.service.WorkHotsFodderService;
|
|
|
import com.gis.service.WorkService;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
@@ -86,6 +88,9 @@ public class WorkServiceImpl extends IBaseStrServiceImpl<WorkEntity, String> imp
|
|
|
@Resource
|
|
|
FdkkClient fdkkClient;
|
|
|
|
|
|
+ @Resource
|
|
|
+ ScenePanoService scenePanoService;
|
|
|
+
|
|
|
@Override
|
|
|
public IBaseStrMapper<WorkEntity, String> getBaseMapper() {
|
|
|
return this.entityMapper;
|
|
@@ -440,7 +445,13 @@ public class WorkServiceImpl extends IBaseStrServiceImpl<WorkEntity, String> imp
|
|
|
DateUtils.spendTime(startTime, "someData更新oss完成");
|
|
|
|
|
|
// 更新跟目录tour.xml 2022-09-15
|
|
|
- updateTour(someDataToJson, id);
|
|
|
+ if (entity.getType().equalsIgnoreCase("pro") ) {
|
|
|
+ updateProTour(someDataToJson, id);
|
|
|
+ }else {
|
|
|
+ updateTour(someDataToJson, id);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
DateUtils.spendTime(startTime, "tour更新oss完成");
|
|
|
|
|
|
return Result.success();
|
|
@@ -484,6 +495,37 @@ public class WorkServiceImpl extends IBaseStrServiceImpl<WorkEntity, String> imp
|
|
|
DateUtils.spendTime(startTime, "tour上传oss");
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 更新 tour.xml
|
|
|
+ * @param someDataToJson
|
|
|
+ * @param id
|
|
|
+ */
|
|
|
+ private void updateProTour(JSONObject someDataToJson, String id) {
|
|
|
+ long startTime = System.currentTimeMillis();
|
|
|
+ String scenes = someDataToJson.getString("scenes");
|
|
|
+ BaseRuntimeException.isBlank(scenes, null, "someData的场景码参数未空");
|
|
|
+ List<ScenePanoEntity> list = scenePanoService.findByWorkId(id);
|
|
|
+
|
|
|
+ // 读取tour.xml模板
|
|
|
+ String baseTour = getBaseTour();
|
|
|
+ StringBuilder builder = new StringBuilder();
|
|
|
+ builder.append(baseTour).append("\r\n");
|
|
|
+ for (ScenePanoEntity entity : list) {
|
|
|
+ String tour = entity.getTour();
|
|
|
+ builder.append(tour).append("\r\n");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 添加结束标签
|
|
|
+ builder.append("</krpano>");
|
|
|
+
|
|
|
+ String tourPath = configConstant.serverBasePath + id + "/tour.xml";
|
|
|
+ FileUtil.writeUtf8String(builder.toString(), tourPath);
|
|
|
+ log.info("作品tour.xml写入完成");
|
|
|
+
|
|
|
+ String ossKeyPath = configConstant.ossBasePath + id + "/tour.xml";
|
|
|
+ fileAndOssUtil.upload(tourPath, ossKeyPath);
|
|
|
+ log.info("tour.xml上传完成 : {}", ossKeyPath);
|
|
|
+ }
|
|
|
|
|
|
private String getBaseTour(){
|
|
|
String baseTourPath = configConstant.serverBasePath + "baseData/tour.xml";
|