|
@@ -29,6 +29,7 @@ import java.io.InputStream;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.net.HttpURLConnection;
|
|
|
import java.net.URL;
|
|
|
+import java.net.URLEncoder;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Calendar;
|
|
@@ -42,6 +43,7 @@ import java.util.regex.Pattern;
|
|
|
import java.util.stream.Collectors;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import lombok.var;
|
|
|
+import org.apache.commons.lang.StringEscapeUtils;
|
|
|
import org.apache.tools.zip.ZipFile;
|
|
|
import org.apache.tools.zip.ZipOutputStream;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -158,11 +160,11 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
imagesVersion = getInfoJson.getInt("imagesVersion");
|
|
|
}
|
|
|
|
|
|
-// //固定文件写入
|
|
|
-// count = this.zipLocalFiles(out, v3localFilePaths, v3localPath, num, count, total);
|
|
|
-//
|
|
|
-// //oss文件写入
|
|
|
-// count = this.zipOssFiles(out, ossFilePaths, num, count, total, resolution, imagesVersion, cacheKeys);
|
|
|
+ //固定文件写入
|
|
|
+ count = this.zipLocalFiles(out, v3localFilePaths, v3localPath, num, count, total);
|
|
|
+
|
|
|
+ //oss文件写入
|
|
|
+ count = this.zipOssFiles(out, ossFilePaths, num, count, total, resolution, imagesVersion, cacheKeys);
|
|
|
|
|
|
//写入启动命令
|
|
|
this.zipBat(out, num);
|
|
@@ -185,7 +187,7 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
//删除正在下载任务
|
|
|
redisUtil.lRemove(RedisKey.SCENE_DOWNLOAD_ING, 1, num);
|
|
|
//删除本地zip包
|
|
|
- FileUtils.deleteFile(zipPath);
|
|
|
+// FileUtils.deleteFile(zipPath);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -266,7 +268,7 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
}
|
|
|
|
|
|
private JSONObject zipGetInfoJson(ZipOutputStream out, String num) throws Exception{
|
|
|
- String url = serverUrl + " api/scene/getInfo?num=t-YhBCzQr";
|
|
|
+ String url = serverUrl + "api/scene/getInfo?num=" + num;
|
|
|
String getInfoStr = restTemplate.getForObject(url, String.class);
|
|
|
ResultData resultData = JSONUtil.toBean(getInfoStr, ResultData.class);
|
|
|
if(resultData == null || ServerCode.SUCCESS.code() != resultData.getCode()){
|
|
@@ -339,14 +341,15 @@ public class SceneDownloadHandlerServiceImpl {
|
|
|
par += "&imagesVersion="+ imagesVersion;
|
|
|
}
|
|
|
|
|
|
- var url = this.resourceUrl + key;
|
|
|
+ var url = this.
|
|
|
+ resourceUrl + key;
|
|
|
StorageType storageType = StorageType.get(uploadType);
|
|
|
switch (storageType){
|
|
|
case OSS:
|
|
|
url += par;
|
|
|
break;
|
|
|
case AWS:
|
|
|
- url += par;
|
|
|
+ url += URLEncoder.encode(par.replace("/", "@"), "UTF-8");
|
|
|
break;
|
|
|
}
|
|
|
var fky = key.split("/" + resolution + "/")[0] + "/" + dir + "/" + imageType.getName() + num + "_" + item.getI() + "_" + item.getJ() + ext;
|