|
@@ -1,5 +1,6 @@
|
|
package com.fdkankan.modeling.receiver;
|
|
package com.fdkankan.modeling.receiver;
|
|
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
@@ -24,6 +25,7 @@ import com.fdkankan.push.PushMsgUtil;
|
|
import com.fdkankan.redis.constant.RedisKey;
|
|
import com.fdkankan.redis.constant.RedisKey;
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
import com.taobao.api.ApiException;
|
|
import com.taobao.api.ApiException;
|
|
|
|
+import java.util.List;
|
|
import java.util.Map.Entry;
|
|
import java.util.Map.Entry;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -351,6 +353,9 @@ public class BuildSceneMQListener implements RocketMQListener<String> {
|
|
map.put(path + File.separator + "capture/Up2.txt",dataPath + "Up2.txt");
|
|
map.put(path + File.separator + "capture/Up2.txt",dataPath + "Up2.txt");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //上传计算结果中的caches/images和caches/videos
|
|
|
|
+ this.uploadCaches(projectNum, map, path);
|
|
|
|
+
|
|
log.info("计算完成,批量上传文件集合:{}", map.toString());
|
|
log.info("计算完成,批量上传文件集合:{}", map.toString());
|
|
//上传计算后生成的文件
|
|
//上传计算后生成的文件
|
|
uploadToOssUtil.uploadMulFiles(map);
|
|
uploadToOssUtil.uploadMulFiles(map);
|
|
@@ -398,6 +403,22 @@ public class BuildSceneMQListener implements RocketMQListener<String> {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void uploadCaches(String num, Map<String,String> map, String path){
|
|
|
|
+
|
|
|
|
+ String sceneNumPAth = String.format("scene/%s", num);
|
|
|
|
+
|
|
|
|
+ List<String> iamgesList = FileUtil.getFileList(path + "caches/images");
|
|
|
|
+ if(CollUtil.isNotEmpty(iamgesList)){
|
|
|
|
+ iamgesList.stream().forEach(str -> map.put(str, str.replace(path, sceneNumPAth)));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<String> videosList = FileUtil.getFileList(path + "caches/videos");
|
|
|
|
+ if(CollUtil.isNotEmpty(videosList)){
|
|
|
|
+ videosList.stream().forEach(str -> map.put(str, str.replace(path, sceneNumPAth)));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
private void copyToEditDir(String num) throws IOException {
|
|
private void copyToEditDir(String num) throws IOException {
|
|
|
|
|
|
String editImagesPath = String.format(UploadFilePath.IMG_EDIT_PATH, num);
|
|
String editImagesPath = String.format(UploadFilePath.IMG_EDIT_PATH, num);
|