|
@@ -2,6 +2,7 @@ package com.gis.service.impl;
|
|
|
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
import cn.hutool.core.io.FileUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
+import cn.hutool.core.util.XmlUtil;
|
|
import com.gis.constant.CmdConstant;
|
|
import com.gis.constant.CmdConstant;
|
|
import com.gis.constant.ConfigConstant;
|
|
import com.gis.constant.ConfigConstant;
|
|
import com.gis.entity.FodderEntity;
|
|
import com.gis.entity.FodderEntity;
|
|
@@ -20,6 +21,8 @@ import java.io.PrintWriter;
|
|
import java.io.StringWriter;
|
|
import java.io.StringWriter;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.concurrent.*;
|
|
import java.util.concurrent.*;
|
|
|
|
+import java.util.regex.Matcher;
|
|
|
|
+import java.util.regex.Pattern;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Created by owen on 2022/7/27 0027 16:55
|
|
* Created by owen on 2022/7/27 0027 16:55
|
|
@@ -44,8 +47,7 @@ public class FodderServiceImpl implements FodderService {
|
|
log.info("tourPath: {}", tourPath);
|
|
log.info("tourPath: {}", tourPath);
|
|
BaseRuntimeException.isTrue(!FileUtils.checkFileExtend(tourPath, 10), null, code + "_tour.xml文件不存在");
|
|
BaseRuntimeException.isTrue(!FileUtils.checkFileExtend(tourPath, 10), null, code + "_tour.xml文件不存在");
|
|
String tour = FileUtil.readUtf8String(tourPath);
|
|
String tour = FileUtil.readUtf8String(tourPath);
|
|
- tour = StrUtil.subAfter(tour, "</action>", true);
|
|
|
|
- tour = StrUtil.subBefore(tour, "</krpano>", true);
|
|
|
|
|
|
+ tour = this.extractSceneTag(tour);
|
|
String trim = StrUtil.trim(tour);
|
|
String trim = StrUtil.trim(tour);
|
|
// log.info("trim: {}", trim);
|
|
// log.info("trim: {}", trim);
|
|
BaseRuntimeException.isTrue(StrUtil.isAllBlank(trim), null, code + "_tour.xml文件不存在");
|
|
BaseRuntimeException.isTrue(StrUtil.isAllBlank(trim), null, code + "_tour.xml文件不存在");
|
|
@@ -56,7 +58,16 @@ public class FodderServiceImpl implements FodderService {
|
|
|
|
|
|
return trim;
|
|
return trim;
|
|
}
|
|
}
|
|
|
|
+ public static String extractSceneTag(String xmlString) {
|
|
|
|
+ Pattern pattern = Pattern.compile("<scene.*?</scene>", Pattern.DOTALL);
|
|
|
|
+ Matcher matcher = pattern.matcher(xmlString);
|
|
|
|
|
|
|
|
+ if (matcher.find()) {
|
|
|
|
+ return matcher.group();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return "";
|
|
|
|
+ }
|
|
// 上传切图到oss
|
|
// 上传切图到oss
|
|
// private void uploadOss(String sceneCode) {
|
|
// private void uploadOss(String sceneCode) {
|
|
// String cmd = CmdConstant.OSSUTIL_UPLOAD_DIR;
|
|
// String cmd = CmdConstant.OSSUTIL_UPLOAD_DIR;
|