|
@@ -138,7 +138,33 @@ public class TestServiceImpl implements TestService {
|
|
|
return Result.success("更新完成");
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Result updateDbFodderTourXml(String isAll) {
|
|
|
+
|
|
|
+ // 1.获取素材表,type=pano
|
|
|
+ List<FodderEntity> list = fodderService.findByType("pano");
|
|
|
+ log.info("场景数量:{}", list.size());
|
|
|
+
|
|
|
+ int i = 0;
|
|
|
+ for (FodderEntity entity : list) {
|
|
|
+ String tour = entity.getTour();
|
|
|
+ if (StrUtil.isBlank(tour)){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ String sceneCode = entity.getSceneCode();
|
|
|
+ if (tour.contains("%CURRENTXML%")){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ i ++ ;
|
|
|
+ String basePath = "%CURRENTXML%../" + sceneCode + "/vtour/panos/";
|
|
|
+ tour = tour.replaceAll("panos/", basePath);
|
|
|
+ entity.setTour(tour);
|
|
|
+ fodderService.update(entity);
|
|
|
+ log.info("更新第 {} 个场景: {}", i, sceneCode);
|
|
|
+ }
|
|
|
|
|
|
+ return Result.success("共更新了:" + i);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -156,7 +182,6 @@ public class TestServiceImpl implements TestService {
|
|
|
int n = 0;
|
|
|
for (WorkEntity workEntity : list) {
|
|
|
String id = workEntity.getId();
|
|
|
-// String sceneCodes = workEntity.getSceneCodes();
|
|
|
List<String> sceneCodes = downLoadSomeData(id);
|
|
|
createTour(sceneCodes, id);
|
|
|
n ++;
|
|
@@ -209,8 +234,12 @@ public class TestServiceImpl implements TestService {
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 创建tour.xml并上传oss
|
|
|
+ * @param scenes
|
|
|
+ * @param id
|
|
|
+ */
|
|
|
private void createTour(List<String> scenes, String id) {
|
|
|
-// List<String> scenes = filterSceneCodesByPano(sceneCodes);
|
|
|
List<FodderEntity> list = fodderService.batchBySceneCodes(scenes);
|
|
|
|
|
|
// 读取tour.xml模板
|