|
@@ -4,9 +4,11 @@ import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.fdkankan.common.constant.ConstantFilePath;
|
|
|
import com.fdkankan.common.constant.UploadFilePath;
|
|
|
import com.fdkankan.common.response.ResultData;
|
|
|
import com.fdkankan.common.util.FileUtil;
|
|
|
+import com.fdkankan.common.util.FileUtils;
|
|
|
import com.fdkankan.fyun.oss.UploadToOssUtil;
|
|
|
import com.fdkankan.rabbitmq.util.RabbitMqProducer;
|
|
|
import com.fdkankan.redis.constant.RedisKey;
|
|
@@ -54,6 +56,8 @@ public class SceneRepairController {
|
|
|
|
|
|
@Value("${queue.scene.upgrade-to-v4}")
|
|
|
private String upgradeToV4;
|
|
|
+ @Value("${oss.prefix.url}")
|
|
|
+ private String ossUrlPrefix;
|
|
|
|
|
|
@Autowired
|
|
|
ISceneProService sceneProService;
|
|
@@ -79,20 +83,27 @@ public class SceneRepairController {
|
|
|
private int maxThread;
|
|
|
|
|
|
@GetMapping("/test")
|
|
|
- public ResultData test(String num) throws Exception{
|
|
|
+ public ResultData test() throws Exception{
|
|
|
//户型图上传
|
|
|
- String userEditPath = UploadFilePath.USER_EDIT_PATH + "floor-cad-%s.%s";
|
|
|
- String userViewPath = UploadFilePath.USER_VIEW_PATH + "floor-cad-%s.%s";
|
|
|
- String floorCadPath = "/mnt/data/06f6aa555/851814909602693120/4898cab06133_202106081015476130" + "/results/floorplan_cad";
|
|
|
- List<String> floorCadList = FileUtil.getFileList(floorCadPath);
|
|
|
- if(CollUtil.isNotEmpty(floorCadList)){
|
|
|
- floorCadList.stream().forEach(str->{
|
|
|
- String substring = str.substring(str.lastIndexOf(File.separator) + 1);
|
|
|
- String[] arr = substring.split("floor");
|
|
|
- String[] arr2 = arr[1].split("\\.");
|
|
|
- uploadToOssUtil.upload(str, String.format(userEditPath, num, arr2[0], arr2[1]));
|
|
|
- uploadToOssUtil.upload(str, String.format(userViewPath, num, arr2[0], arr2[1]));
|
|
|
- });
|
|
|
+ String[] arr = new String[]{
|
|
|
+ "KJ-t-VJNe28ZImv",
|
|
|
+ "KJ-t-0qmAovuPVD",
|
|
|
+ "t-CgTJHQHxpp ",
|
|
|
+ "t-2KZ4MQv",
|
|
|
+ "t-l1UFUWU9Bw",
|
|
|
+ "t-qFJGbpu",
|
|
|
+ "t-Pfz5oq8",
|
|
|
+ "t-FI8VKsJ",
|
|
|
+ "t-yAWONOn",
|
|
|
+ "t-OZsRlRq",
|
|
|
+ "t-iltt6PQ",
|
|
|
+ "KK-t-KTUZz7QdX6 "
|
|
|
+ };
|
|
|
+ for (String num : arr) {
|
|
|
+ String ossPath = String.format(ConstantFilePath.DATA_PATH_FORMAT, num);
|
|
|
+ String localPath = String.format(ConstantFilePath.DATABUFFER_FORMAT, num);
|
|
|
+ String url = ossUrlPrefix + ossPath + "hot.json" + "?t=" + System.currentTimeMillis();
|
|
|
+ FileUtils.downLoadFromUrl(url, "hot.json", localPath);
|
|
|
}
|
|
|
//17264
|
|
|
return ResultData.ok();
|