|
@@ -146,14 +146,14 @@ public class OpsServiceImpl implements OpsService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Result pack(String workId) {
|
|
|
+ public Result pack(String workId, String isEdit) {
|
|
|
// 复制作品目录
|
|
|
WorkEntity entity = workService.getById(workId);
|
|
|
BaseRuntimeException.isNull(entity, ErrorEnum.FAILURE_SYS_2001);
|
|
|
copyWork(workId);
|
|
|
|
|
|
// 复制场景目录
|
|
|
- copyScene(workId, entity.getSceneCodes());
|
|
|
+ copyScene(workId, entity.getSceneCodes(), isEdit);
|
|
|
|
|
|
// 合并tour.xml
|
|
|
mergeTour(workId, entity.getSceneCodes());
|
|
@@ -165,6 +165,8 @@ public class OpsServiceImpl implements OpsService {
|
|
|
return Result.success(filePath);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
private void zipWork(String workId) {
|
|
|
String outPath = configConstant.serverBasePath + "/download/" + workId +".zip";
|
|
|
// String intPath = configConstant.serverBasePath + "/download/" + workId ;
|
|
@@ -179,7 +181,13 @@ public class OpsServiceImpl implements OpsService {
|
|
|
|
|
|
}
|
|
|
|
|
|
- private void copyScene(String workId, String sceneCodes) {
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param workId
|
|
|
+ * @param sceneCodes
|
|
|
+ * @param isEdit 是否复制edit目录
|
|
|
+ */
|
|
|
+ private void copyScene(String workId, String sceneCodes, String isEdit) {
|
|
|
log.info("场景码: {}", sceneCodes);
|
|
|
if (StringUtils.isBlank(sceneCodes)){
|
|
|
log.info("场景码为空, 不需要下载");
|
|
@@ -192,17 +200,24 @@ public class OpsServiceImpl implements OpsService {
|
|
|
String inTourPath;
|
|
|
String outPath;
|
|
|
for (String sceneCode : split) {
|
|
|
-// inPath = configConstant.serverBasePath + "/pano/" + sceneCode + "/vtour/panos/" + sceneCode + ".tiles";
|
|
|
- inPath = configConstant.serverBasePath + "/pano/" + sceneCode + "/vtour/panos";
|
|
|
- outPath = outBasePath + "/" + sceneCode;
|
|
|
|
|
|
// 创建目录
|
|
|
+ outPath = outBasePath + "/" + sceneCode;
|
|
|
FileUtil.mkdir(outPath);
|
|
|
|
|
|
// 复制全景图
|
|
|
+ inPath = configConstant.serverBasePath + "/pano/" + sceneCode + "/vtour/panos";
|
|
|
String cmd = StrUtil.format("cp -r {} {} ", inPath, outPath);
|
|
|
CmdUtils.callCmd(cmd);
|
|
|
|
|
|
+ // 复制编辑目录
|
|
|
+ if (StrUtil.isNotBlank(isEdit)){
|
|
|
+ log.info("下载edit目录");
|
|
|
+ inPath = configConstant.serverBasePath + "/pano/" + sceneCode + "/edit";
|
|
|
+ cmd = StrUtil.format("cp -r {} {} ", inPath, outPath);
|
|
|
+ CmdUtils.callCmd(cmd);
|
|
|
+ }
|
|
|
+
|
|
|
// 复制tour.xml
|
|
|
inTourPath = configConstant.serverBasePath + "/pano/" + sceneCode + "/vtour/tour.xml";
|
|
|
String cmdTour = StrUtil.format("cp -r {} {} ", inTourPath, outPath);
|