dengsixing 1 vuosi sitten
vanhempi
commit
46340583e4

+ 20 - 0
src/main/java/com/fdkankan/download/controller/BatchDownloadController.java

@@ -47,6 +47,26 @@ public class BatchDownloadController {
         return batchDonloadService.getDownloadDetail(uuid);
     }
 
+    @PostMapping("downloadByLocal")
+    public ResultData bacthDownloadByLocal(@RequestParam(value = "file") MultipartFile file) throws Exception {
+        return batchDonloadService.bacthDownloadByLocal(file);
+    }
+
+    @PostMapping("downloadImgViewWithoutTiles")
+    public ResultData downloadImgViewWithoutTiles(@RequestParam(value = "file") MultipartFile file) throws Exception {
+        return batchDonloadService.downloadImgViewWithoutTiles(file);
+    }
+
+    @PostMapping("downloadMeshScene")
+    public ResultData downloadMeshScene(@RequestParam(value = "file") MultipartFile file, String version) throws Exception {
+        return batchDonloadService.downloadMeshScene(file,version);
+    }
+
+    @PostMapping("downloadLaserScene")
+    public ResultData downloadMeshScene(@RequestParam(value = "file") MultipartFile file) throws Exception {
+        return batchDonloadService.downloadMeshScene(file,version);
+    }
+
     @GetMapping("test")
     public ResultData test() throws Exception {
         final OperatingSystem os = OshiUtil.getOs();

+ 75 - 0
src/main/java/com/fdkankan/download/controller/TestController.java

@@ -0,0 +1,75 @@
+//package com.fdkankan.download.controller;
+//
+//import cn.hutool.core.io.FileUtil;
+//import cn.hutool.core.util.StrUtil;
+//import cn.hutool.db.nosql.redis.RedisDS;
+//import cn.hutool.http.HttpUtil;
+//import com.alibaba.fastjson.JSON;
+//import com.alibaba.fastjson.serializer.SerializerFeature;
+//import com.aliyun.oss.OSS;
+//import com.aliyun.oss.model.DownloadFileRequest;
+//import com.aliyun.oss.model.ResponseHeaderOverrides;
+//import com.fdkankan.common.constant.CommonStatus;
+//import com.fdkankan.download.bean.ResultData;
+//import com.fdkankan.download.bean.SceneEditControlsBean;
+//import com.fdkankan.download.bean.SceneViewInfoBean;
+//import com.fdkankan.fyun.face.FYunFileServiceInterface;
+//import com.fdkankan.model.constants.UploadFilePath;
+//import com.fdkankan.redis.constant.RedisKey;
+//import com.fdkankan.redis.util.RedisUtil;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.web.bind.annotation.GetMapping;
+//import org.springframework.web.bind.annotation.RequestMapping;
+//import org.springframework.web.bind.annotation.RestController;
+//import redis.clients.jedis.Jedis;
+//
+//import javax.annotation.Resource;
+//import java.io.File;
+//import java.util.List;
+//import java.util.Objects;
+//
+//@RestController
+//@RequestMapping("/test")
+//public class TestController {
+//
+//    @Autowired
+//    private RedisUtil redisUtil;
+//
+//    @Autowired
+//    private OSS ossClient;
+//    @Resource
+//    private FYunFileServiceInterface fileServiceInterface;
+//
+//    @GetMapping
+//    public ResultData test() throws Throwable {
+//        this.downloadFile("4dkankan", "scene_view_data/KJ-2mebk8yZdmI/images/dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam", "D:\\test222\\dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam");
+////        HttpUtil.downloadFile("https://4dkankan.oss-cn-shenzhen.aliyuncs.com/scene_view_data/KJ-2mebk8yZdmI/images/dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam", "D:\\test222\\dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam");
+//
+//        return ResultData.ok("");
+//    }
+//
+////    private void downloadFile(String bucket, String remoteFilePath, String localPath) throws Throwable {
+////        File localFile = new File(localPath);
+////        if (!localFile.getParentFile().exists()) {
+////            localFile.getParentFile().mkdirs();
+////        }
+////        if(localFile.isDirectory()){
+////            String fileName = remoteFilePath.substring(remoteFilePath.lastIndexOf("/")+1);
+////            localPath = localPath.concat(File.separator).concat(fileName);
+////        }
+////        DownloadFileRequest request = new DownloadFileRequest(bucket, remoteFilePath);
+////        request.setDownloadFile(localPath);
+////        // 默认5个任务并发下载
+////        request.setTaskNum(5);
+////        // 启动断点续传
+////        request.setEnableCheckpoint(true);
+////
+////        request.setHeaders();
+////        ossClient.downloadFile(request);
+////        ResponseHeaderOverrides responseHeaders = request.getResponseHeaders();
+////        String contentEncoding = responseHeaders.getContentEncoding();
+////        System.out.println(contentEncoding);
+////    }
+//
+//
+//}

+ 9 - 0
src/main/java/com/fdkankan/download/httpclient/HttpClient.java

@@ -13,6 +13,7 @@ import com.fdkankan.download.callback.SuccessLaserCondition;
 import com.fdkankan.download.entity.DTO.OfflineDTO;
 import com.yomahub.tlog.forest.TLogForestInterceptor;
 
+import java.io.File;
 import java.util.List;
 import java.util.Map;
 
@@ -61,5 +62,13 @@ public interface HttpClient {
     @Success(condition = SuccessLaserCondition.class)
     LaserResultData<List<OfflineDTO>>  get(@Var("url") String url, OnSuccess<LaserResultData> onSuccess, OnError onError);
 
+    // 上传文件的同时,带上其他类型参数
+    @Post(url = "https://www.4dkankan.com/service/scene/edit/uploadPanorama", readTimeout = -1, timeout = -1, connectTimeout = -1)
+    String upload(@DataFile("file") File file, @Header("token") String token, @Body("num") String num);
+
+    @Post(url = "https://www.4dkankan.com/service/scene/edit/getAsynOperLog")
+    String getStatus(@Header("token")String token, @JSONBody Object param);
+
+
 
 }

+ 9 - 1
src/main/java/com/fdkankan/download/service/IBatchDonloadService.java

@@ -12,7 +12,7 @@ import java.util.Set;
  * 用户信息表 服务类
  * </p>
  *
- * @author 
+ * @author
  * @since 2022-07-05
  */
 public interface IBatchDonloadService {
@@ -23,5 +23,13 @@ public interface IBatchDonloadService {
 
     public void downloadHandler(String uuid, Set<String> numSet, Map<String, Object> headers, String dir, String downloadingLog, String downloadResultLog);
 
+    public ResultData bacthDownloadByLocal(@RequestParam(value = "file") MultipartFile file) throws Exception;
+
+    public ResultData downloadImgViewWithoutTiles(@RequestParam(value = "file") MultipartFile file) throws Exception;
+
+    public ResultData downloadMeshScene(@RequestParam(value = "file") MultipartFile file, String version) throws Exception;
+
+    public ResultData downloadLaserScene(@RequestParam(value = "file") MultipartFile file) throws Exception;
+
 
 }

+ 9 - 1
src/main/java/com/fdkankan/download/service/IDownloadService.java

@@ -3,6 +3,14 @@ package com.fdkankan.download.service;
 public interface IDownloadService {
     String downloadHandler(String num) throws Exception;
 
+    void downloadWithoutCutImg(String num) throws Exception;
+
+    void downloadMeshScene(String num) throws Exception;
+
+    void downloadMeshSceneV3(String num) throws Exception;
+
+    void downloadLaserScene(String num) throws Exception;
+
     /**
      *
      * @param num
@@ -11,7 +19,7 @@ public interface IDownloadService {
      * @param subPath 需要切图的子目录 tiles-场景本身全景图  panorama/d9rHSlO544803/tiles-场景关联全景图
      * @throws Exception
      */
-    void cutImg(String num, String path, String resolution, String subPath) throws Exception;
+    void cutImg(String num, String path, String resolution, String subPath, String version) throws Exception;
 
 }
 

+ 214 - 2
src/main/java/com/fdkankan/download/service/impl/BatchDonloadServiceImpl.java

@@ -1,33 +1,59 @@
 package com.fdkankan.download.service.impl;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.date.TimeInterval;
+import cn.hutool.core.exceptions.ExceptionUtil;
 import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.lang.UUID;
+import cn.hutool.core.thread.ExecutorBuilder;
 import cn.hutool.core.thread.ThreadUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.http.HttpUtil;
+import cn.hutool.system.HostInfo;
+import cn.hutool.system.SystemUtil;
 import com.alibaba.fastjson.JSON;
+import com.aliyun.oss.OSS;
+import com.aliyun.oss.OSSClientBuilder;
+import com.aliyun.oss.model.DownloadFileRequest;
+import com.aliyun.oss.model.ListObjectsRequest;
+import com.aliyun.oss.model.OSSObjectSummary;
+import com.aliyun.oss.model.ObjectListing;
+import com.fdkankan.common.constant.CommonStatus;
+import com.fdkankan.common.constant.CommonSuccessStatus;
+import com.fdkankan.common.constant.SceneSource;
+import com.fdkankan.common.constant.SceneVersionType;
 import com.fdkankan.download.bean.BusinessException;
 import com.fdkankan.download.bean.ResultData;
 import com.fdkankan.download.callback.ErrorCallback;
 import com.fdkankan.download.callback.SuccessCallback;
+import com.fdkankan.download.entity.DownloadLog;
+import com.fdkankan.download.entity.ScenePlus;
+import com.fdkankan.download.entity.ScenePlusExt;
 import com.fdkankan.download.httpclient.HttpClient;
-import com.fdkankan.download.service.IBatchDonloadService;
-import com.fdkankan.download.service.ISsoService;
+import com.fdkankan.download.service.*;
 import com.fdkankan.download.util.Base64Converter;
+import com.fdkankan.model.constants.UploadFilePath;
+import com.fdkankan.redis.util.RedisLockUtil;
+import com.google.common.collect.Lists;
+import com.google.j2objc.annotations.AutoreleasePool;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
 import java.io.File;
+import java.math.BigDecimal;
 import java.util.*;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutorService;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadPoolExecutor;
 import java.util.stream.Collectors;
 
 @Slf4j
@@ -57,6 +83,8 @@ public class BatchDonloadServiceImpl implements IBatchDonloadService {
     private HttpClient httpClient;
     @Autowired
     private ISsoService ssoService;
+    @Autowired
+    private IScenePlusService scenePlusService;
 
     public static Set<String> taskSet = new HashSet<>();
 
@@ -222,4 +250,188 @@ public class BatchDonloadServiceImpl implements IBatchDonloadService {
         }, executor);
     }
 
+    @Autowired
+    private IDownloadLogService downloadLogService;
+    @Autowired
+    private ILaserService laserService;
+    @Autowired
+    private IDownloadService downloadService;
+    public final static ThreadPoolExecutor threadPoolExecutor = ExecutorBuilder.create().setWorkQueue(new LinkedBlockingQueue<>(10000)).setCorePoolSize(5).setMaxPoolSize(5).build();
+
+    @Override
+    public ResultData bacthDownloadByLocal(MultipartFile file) throws Exception {
+
+        String uuid = UUID.randomUUID().toString();
+        String dir = parentPath.concat(uuid).concat(File.separator);
+        String origFilePath = dir.concat(uuid + ".txt");
+        if (!FileUtil.exist(dir)) {
+            FileUtil.mkParentDirs(origFilePath);
+        }
+        file.transferTo(new File(origFilePath));
+        List<ScenePlus> scenePluses = new ArrayList<>();
+        List<String> notExists = new ArrayList<>();
+        List<String> nums = FileUtil.readUtf8Lines(origFilePath);
+        for (String num : nums) {
+            ScenePlus scenePlus = scenePlusService.getByNum(num.trim());
+            if(scenePlus == null){
+                notExists.add(num);
+                continue;
+            }
+            scenePluses.add(scenePlus);
+        }
+
+        if (CollUtil.isEmpty(scenePluses)) {
+            return ResultData.ok("没有场景");
+        }
+        for (ScenePlus scenePlus : scenePluses) {
+            try {
+                //下载点云场景
+                if (scenePlus.getSceneSource() == SceneSource.JG.code() || scenePlus.getSceneSource() == SceneSource.SG.code()) {
+                    threadPoolExecutor.submit(() -> {
+                        try {
+                            TimeInterval timer = DateUtil.timer();
+                            laserService.downloadHandler(scenePlus.getNum());
+                            downloadLogService.saveLog(scenePlus.getNum(), "laser", CommonSuccessStatus.SUCCESS.code(), null, timer.intervalMinute());
+                        } catch (Exception e) {
+                            downloadLogService.saveLog(scenePlus.getNum(), "laser", CommonSuccessStatus.FAIL.code(), ExceptionUtil.stacktraceToString(e, 3000), null);
+                            log.error("点云场景打包失败,num:{}", scenePlus.getNum(), e);
+                        }
+                    });
+                }
+
+                //下载看看、看见、mesh
+                if (scenePlus.getSceneSource() == SceneSource.BM.code() || scenePlus.getSceneSource() == SceneSource.ZT.code()) {
+                    threadPoolExecutor.submit(() -> {
+                        try {
+                            TimeInterval timer = DateUtil.timer();
+                            downloadService.downloadHandler(scenePlus.getNum());
+                            downloadLogService.saveLog(scenePlus.getNum(), "kankan", CommonSuccessStatus.SUCCESS.code(), null, timer.intervalMinute());
+                        } catch (Exception e) {
+                            log.error("看看场景打包失败,num:{}", scenePlus.getNum(), e);
+                            downloadLogService.saveLog(scenePlus.getNum(), "kankan", CommonSuccessStatus.FAIL.code(), ExceptionUtil.stacktraceToString(e, 3000), null);
+                        }
+                    });
+                }
+            }catch (Exception e){
+                log.error("场景打包失败:{}", scenePlus.getNum(), e);
+            }
+        }
+
+        return  ResultData.ok(JSON.toJSONString(notExists));
+    }
+
+    @Override
+    public ResultData downloadImgViewWithoutTiles(MultipartFile file) throws Exception {
+
+        String bashPath = "/mnt/scenes/";
+        File tempFile = FileUtil.file(new File(bashPath + file.getOriginalFilename()));
+        file.transferTo(tempFile);
+        List<String> nums = FileUtil.readUtf8Lines(tempFile);
+
+        for (String num : nums) {
+            try {
+                downloadService.downloadWithoutCutImg(num);
+            }catch (Exception e){
+                FileUtil.appendUtf8Lines(Lists.newArrayList(num), bashPath + "fail.txt");
+            }
+        }
+
+        return ResultData.ok("");
+    }
+
+    @Override
+    public ResultData downloadMeshScene(MultipartFile file, String version) throws Exception {
+
+        String bashPath = "/mnt/scenes/";
+        FileUtil.mkdir(bashPath);
+        File tempFile = FileUtil.file(new File(bashPath + file.getOriginalFilename()));
+        file.transferTo(tempFile);
+        List<String> nums = FileUtil.readUtf8Lines(tempFile);
+
+        for (String num : nums) {
+            threadPoolExecutor.submit(() -> {
+                try {
+                    if(SceneVersionType.V4.code().equals(version)){
+                        downloadService.downloadMeshScene(num);
+                    }
+                    if(SceneVersionType.V3.code().equals(version)){
+                        downloadService.downloadMeshSceneV3(num);
+                    }
+                }catch (Exception e){
+                    FileUtil.appendUtf8Lines(Lists.newArrayList(num), bashPath + "fail.txt");
+                }
+            });
+        }
+
+        return ResultData.ok("");
+    }
+
+    @Override
+    public ResultData downloadLaserScene(MultipartFile file) throws Exception {
+        String bashPath = "/mnt/scenes/";
+        FileUtil.mkdir(bashPath);
+        File tempFile = FileUtil.file(new File(bashPath + file.getOriginalFilename()));
+        file.transferTo(tempFile);
+        List<String> nums = FileUtil.readUtf8Lines(tempFile);
+
+        for (String num : nums) {
+            threadPoolExecutor.submit(() -> {
+                try {
+                    downloadService.downloadMeshScene(num);
+                }catch (Exception e){
+                    FileUtil.appendUtf8Lines(Lists.newArrayList(num), bashPath + "fail-laser.txt");
+                }
+            });
+        }
+
+        return ResultData.ok("");
+    }
+
+    //        String filePath = "D:\\test\\kk.txt";
+////        OSS build = new OSSClientBuilder().build("http://oss-cn-shenzhen.aliyuncs.com","LTAI5tJwboCj3r4vUNkSmbyX", "meDy7VYAWbg8kZCKsoUZcIYQxigWOy");
+//        List<String> strings = FileUtil.readUtf8Lines(filePath);
+//
+//        for (String num : strings) {
+//            Jedis jedis = RedisDS.create().getJedis();
+//            String sceneJsonData = jedis.get(String.format(RedisKey.SCENE_JSON, num));
+////            if(StrUtil.isEmpty(sceneJsonData)){
+////                try (OSSObject ossObject = build.getObject("4dkankan", String.format(UploadFilePath.DATA_VIEW_PATH, num) + "scene.json");
+////                     InputStream objectContent = ossObject.getObjectContent();
+////                ){
+////                    StringBuilder contentJson = new StringBuilder();
+////                    BufferedReader reader = new BufferedReader(new InputStreamReader(objectContent));
+////                    while (true) {
+////                        String line = reader.readLine();
+////                        if (line == null) break;
+////                        contentJson.append(line);
+////                    }
+////                    sceneJsonData = sceneJsonData.toString();
+////                }
+////            }
+//            sceneJsonData = sceneJsonData.replace("https://4dkk.4dage.com/", "");
+//            SceneViewInfoBean sceneInfoVO = JSON.parseObject(sceneJsonData, SceneViewInfoBean.class);
+//            sceneInfoVO.setScenePassword(null);
+//            if(Objects.isNull(sceneInfoVO.getFloorPlanAngle())){
+//                sceneInfoVO.setFloorPlanAngle(0f);
+//            }
+//            if(Objects.isNull(sceneInfoVO.getFloorPlanCompass())){
+//                sceneInfoVO.setFloorPlanCompass(0f);
+//            }
+//            SceneEditControlsBean controls = sceneInfoVO.getControls();
+//            if(Objects.isNull(controls.getShowShare())){
+//                controls.setShowShare(CommonStatus.YES.code().intValue());
+//            }
+//            if(Objects.isNull(controls.getShowCapture())){
+//                controls.setShowCapture(CommonStatus.YES.code().intValue());
+//            }
+//            if(Objects.isNull(controls.getShowBillboardTitle())){
+//                controls.setShowBillboardTitle(CommonStatus.YES.code().intValue());
+//            }
+//
+//            FileUtil.writeUtf8String(JSON.toJSONString(sceneInfoVO, SerializerFeature.WriteNullStringAsEmpty, SerializerFeature.WriteNullNumberAsZero), "D:\\test5\\" + num + "\\wwwroot\\scene_view_data\\" + num + "\\data\\scene.json");
+//
+//            jedis.close();
+//            System.out.println("替换完成:" + num);
+
+//        }
 }

+ 344 - 40
src/main/java/com/fdkankan/download/service/impl/DownloadServiceImpl.java

@@ -7,23 +7,27 @@ import cn.hutool.core.date.TimeInterval;
 import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.core.util.ZipUtil;
+import cn.hutool.http.ContentType;
+import cn.hutool.http.HttpRequest;
+import cn.hutool.http.HttpResponse;
 import cn.hutool.http.HttpUtil;
+import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.serializer.SerializerFeature;
-import com.fdkankan.common.constant.CommonStatus;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.constant.SceneKind;
+import com.dtflys.forest.Forest;
+import com.dtflys.forest.config.ForestConfiguration;
+import com.fdkankan.common.constant.*;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.common.util.CmdUtils;
 import com.fdkankan.common.util.DateExtUtil;
 import com.fdkankan.common.util.FileUtils;
+import com.fdkankan.download.bean.*;
 import com.fdkankan.download.constant.CommonConstant;
-import com.fdkankan.download.bean.ImageType;
-import com.fdkankan.download.bean.ImageTypeDetail;
-import com.fdkankan.download.bean.SceneEditControlsBean;
-import com.fdkankan.download.bean.SceneViewInfoBean;
 import com.fdkankan.download.entity.ScenePlus;
 import com.fdkankan.download.entity.ScenePlusExt;
+import com.fdkankan.download.httpclient.HttpClient;
 import com.fdkankan.download.service.IDownloadService;
 import com.fdkankan.download.service.IScenePlusExtService;
 import com.fdkankan.download.service.IScenePlusService;
@@ -41,6 +45,7 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
+import java.math.BigDecimal;
 import java.net.URLEncoder;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -62,6 +67,10 @@ import javax.annotation.Resource;
 @Service
 public class DownloadServiceImpl implements IDownloadService {
 
+    private static final String[] prefixArr4v3 = new String[]{
+            "data/data%s/", "images/images%s/", "voice/voice%s/", "video/video%s/"
+    };
+
 //    private static final List<ImageType> imageTypes = Lists.newArrayList();
 //    static{
 //        imageTypes.add(ImageType.builder().name("4k_face").size("4096").ranges(new String[]{"0", "511", "1023", "1535", "2047","2559","3071","3583"}).build());
@@ -102,6 +111,8 @@ public class DownloadServiceImpl implements IDownloadService {
     private String zipOssFormat;
 //    @Value("${cutImgType}")
 //    private String cutImgType;
+    @Value("${url.v3.getInfo}")
+    private String v3GetInfoUrl;
 
     @Autowired
     private IScenePlusService scenePlusService;
@@ -166,7 +177,7 @@ public class DownloadServiceImpl implements IDownloadService {
             log.info("打包固定文件耗时, num:{}, time:{}", num, timer.intervalRestart());
 
             //oss文件写入
-            this.zipOssFiles(num, resolution, imagesVersion, cacheKeys, "v4");
+            this.zipOssFiles(num, resolution, true, SceneVersionType.V4.code());
             log.info("打包oss文件耗时, num:{}, time:{}", num, timer.intervalRestart());
 
             //重新写入scene.json(去掉密码访问设置)
@@ -193,6 +204,193 @@ public class DownloadServiceImpl implements IDownloadService {
         }
     }
 
+    @Override
+    public void downloadWithoutCutImg(String num) throws Exception {
+
+        //zip包路径
+        try {
+            TimeInterval timer = DateUtil.timer();
+
+            SceneViewInfoBean sceneViewInfo = this.getSceneJson(num);
+            String resolution = sceneViewInfo.getSceneResolution();
+            //国际版存在已经切好图的情况,下载时不需要再切图,只需要把文件直接下载下来打包就可以了
+            if(SceneKind.FACE.code().equals(sceneViewInfo.getSceneKind())){
+                resolution = "notNeadCut";
+            }
+
+            //固定文件写入
+            this.zipLocalFiles(num, "v4");
+            log.info("打包固定文件耗时, num:{}, time:{}", num, timer.intervalRestart());
+
+            //oss文件写入
+            this.zipOssFiles(num, resolution, false, SceneVersionType.V4.code());
+            log.info("打包oss文件耗时, num:{}, time:{}", num, timer.intervalRestart());
+
+            //重新写入scene.json(去掉密码访问设置)
+            this.zipSceneJson(num, sceneViewInfo);
+
+            //写入启动命令
+            this.zipBat(num, "v4");
+
+        }catch (Exception e){
+            //更新进度为下载失败
+            log.error("场景下载失败,num:{}", num, e);
+            throw e;
+        }
+    }
+
+    @Override
+    public void downloadMeshScene(String num) throws Exception {
+        //zip包路径
+        try {
+            TimeInterval timer = DateUtil.timer();
+
+            SceneViewInfoBean sceneViewInfo = this.getSceneJson(num);
+            String resolution = sceneViewInfo.getSceneResolution();
+            //国际版存在已经切好图的情况,下载时不需要再切图,只需要把文件直接下载下来打包就可以了
+            if(SceneKind.FACE.code().equals(sceneViewInfo.getSceneKind())){
+                resolution = "notNeadCut";
+            }
+
+            //固定文件写入
+            this.zipLocalFiles(num, "v4");
+            log.info("打包固定文件耗时, num:{}, time:{}", num, timer.intervalRestart());
+
+            //oss文件写入
+            this.zipOssFiles(num, resolution, true, SceneVersionType.V4.code());
+            log.info("打包oss文件耗时, num:{}, time:{}", num, timer.intervalRestart());
+
+            //重新写入scene.json(去掉密码访问设置)
+            this.zipSceneJson(num, sceneViewInfo);
+
+            //写入启动命令
+            this.zipBat(num, "v4");
+
+            this.zip(String.format(this.sourceLocal, num, ""), String.format(zipLocalFormat, num, num));
+
+//            String uploadPath = String.format(this.zipOssFormat, num);
+//            fYunFileService.uploadFile(String.format(zipLocalFormat, num, num), uploadPath);
+
+            log.info("总耗时, num:{}, time:{}", num, timer.intervalRestart());
+
+        }catch (Exception e){
+            //更新进度为下载失败
+            log.error("场景下载失败,num:{}", num, e);
+            throw e;
+        }
+    }
+
+    @Override
+    public void downloadMeshSceneV3(String num) throws Exception {
+
+        try {
+            TimeInterval timer = DateUtil.timer();
+
+            //删除资源目录
+            FileUtil.del(String.format(this.sourceLocal, num, ""));
+
+            //定义压缩包d
+            String resolution = "2k";
+            cn.hutool.json.JSONObject getInfoJson = this.getInfo(num);
+            // 转台、激光显示4k图片
+            if (getInfoJson.getInt("sceneSource") == 3 || getInfoJson.getInt("sceneSource") == 4) {
+                resolution = "4k";
+            }
+
+            //固定文件写入
+            timer.intervalRestart();
+            this.zipLocalFiles(num, "v3");
+            log.info("打包固定文件耗时, num:{}, time:{}", num, timer.intervalRestart());
+
+            //oss文件写入
+            this.zipOssFiles(num, resolution, true, SceneVersionType.V3.code());
+            log.info("打包oss文件耗时, num:{}, time:{}", num, timer.intervalRestart());
+
+            //重新写入scene.json(去掉密码访问设置)
+            this.zipGetInfoJson(num, getInfoJson);
+
+            //写入启动命令
+            this.zipBat(num, "v3");
+
+            //打压缩包
+
+            this.zip(String.format(this.sourceLocal, num, ""), String.format(zipLocalFormat, num, num));
+
+            log.info("总耗时, num:{}, time:{}", num, timer.intervalRestart());
+
+            //上传压缩包
+            String uploadPath = String.format(this.zipOssFormat, num);
+            fYunFileService.uploadFile(String.format(zipLocalFormat, num, num), uploadPath);
+
+        }catch (Exception e){
+            //更新进度为下载失败
+            log.error("场景下载失败,num:{}", num, e);
+            throw e;
+        }
+    }
+
+    @Override
+    public void downloadLaserScene(String num) throws Exception {
+
+    }
+
+    private void zipGetInfoJson(String num, cn.hutool.json.JSONObject getInfo) throws Exception{
+
+        //访问密码置0
+        String getInfoKey = String.format("data/data%s/", num) + "getInfo.json";
+        String getInfoStr = getInfo.toString().replace(this.publicUrl, "");
+        FileUtil.writeUtf8String(getInfoStr, String.format(this.sourceLocal, num, this.wwwroot + getInfoKey));
+    }
+    private cn.hutool.json.JSONObject getInfo(String num){
+        String url = String.format(v3GetInfoUrl, num);
+        String getInfoResult = HttpUtil.get(url);
+        cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(getInfoResult);
+        if(Objects.isNull(jsonObject)
+                || !ServerCode.SUCCESS.code().equals(jsonObject.getInt("code"))
+                || Objects.isNull(jsonObject.getJSONObject("data"))){
+            throw new RuntimeException("获取getInfo信息失败,url=" + url);
+        }
+        cn.hutool.json.JSONObject data = jsonObject.getJSONObject("data");
+        if (data.getInt("sceneSource") != 2)
+        {
+            data.set("sceneScheme", 3);
+        }
+        data.set("needKey", 0);
+        data.set("sceneKey", "");
+        return data;
+    }
+
+    private Map<String, List<String>> getAllFilesV3(String num, String v3localPath, String bucket) throws Exception{
+        //列出oss所有文件路径
+        List<String> ossFilePaths = new ArrayList<>();
+        for (String prefix : prefixArr4v3) {
+            prefix = String.format(prefix, num);
+            List<String> keys = fYunFileService.listRemoteFiles(bucket, prefix);
+            if(CollUtil.isEmpty(keys)){
+                continue;
+            }
+            if(FYunTypeEnum.AWS.code().equals(this.uploadType)){
+                keys = keys.stream().filter(key->{
+                    if(key.contains("x-oss-process")){
+                        return false;
+                    }
+                    return true;
+                }).collect(Collectors.toList());
+            }
+            ossFilePaths.addAll(keys);
+        }
+
+        //列出v3local所有文件路径
+        File file = new File(v3localPath);
+        List<String> localFilePaths = FileUtils.list(file);
+
+        HashMap<String, List<String>> map = new HashMap<>();
+        map.put("ossFilePaths", ossFilePaths);
+        map.put("localFilePaths", localFilePaths);
+
+        return map;
+    }
+
     private void zipBat(String num, String version) throws Exception{
         String batContent = String.format(this.exeContent, num);
         if("v3".equals(version)){
@@ -210,15 +408,41 @@ public class DownloadServiceImpl implements IDownloadService {
         FileUtil.writeUtf8String(JSON.toJSONString(sceneViewInfo, SerializerFeature.WriteNullStringAsEmpty, SerializerFeature.WriteNullNumberAsZero), String.format(this.sourceLocal, num, this.wwwroot + sceneJsonPath));
     }
 
-    private void zipOssFiles(String num, String resolution, int imagesVersion, Set<String> cacheKeys, String version) throws Exception{
+    private void zipOssFiles(String num, String resolution, boolean cutImg, String version) throws Exception{
 
 //        fYunFileService.downloadFileByCommand(String.format(sourceLocal, num, this.wwwroot).concat(String.format(UploadFilePath.VIEW_PATH, num)), String.format(UploadFilePath.VIEW_PATH, num));
 //        FileUtil.del(String.format(sourceLocal, num, this.wwwroot).concat(String.format(UploadFilePath.IMG_VIEW_PATH, num)).concat("tiles"));
-        List<String> strings = fYunFileService.listRemoteFiles(String.format(UploadFilePath.VIEW_PATH, num));
+        List<String> strings = new ArrayList<>();
+        if(version.equals(SceneVersionType.V4.code())){
+            strings = fYunFileService.listRemoteFiles(String.format(UploadFilePath.VIEW_PATH, num));
+        }
+        if(version.equals(SceneVersionType.V3.code())){
+            List<String> dataList = fYunFileService.listRemoteFiles(String.format(prefixArr4v3[0], num));
+            if(CollUtil.isNotEmpty(dataList)){
+                strings.addAll(dataList);
+            }
+            List<String> imgList =  fYunFileService.listRemoteFiles(String.format(prefixArr4v3[1], num));
+            if(CollUtil.isNotEmpty(imgList)){
+                strings.addAll(imgList);
+            }
+            List<String> voiceList =  fYunFileService.listRemoteFiles(String.format(prefixArr4v3[2], num));
+            if(CollUtil.isNotEmpty(voiceList)){
+                strings.addAll(voiceList);
+            }
+            List<String> videoList = fYunFileService.listRemoteFiles(String.format(prefixArr4v3[3], num));
+            if(CollUtil.isNotEmpty(videoList)){
+                strings.addAll(videoList);
+            }
+        }
         strings.stream().forEach(str->{
-            if(!str.contains("/tiles/4k/") && !str.contains("/tiles/2k/")){
+            if(!str.contains("/tiles/4k/") && !str.contains("/tiles/2k/")
+                    && !str.contains("dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam") && !str.endsWith("/")){
                 fYunFileService.downloadFile(str, String.format(sourceLocal, num, this.wwwroot).concat(str));
             }
+            if(str.contains("dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam")){
+                log.info("url:{}", "http://4dkankan.oss-cn-shenzhen-internal.aliyuncs.com/" + str);
+                HttpUtil.downloadFile("http://4dkankan.oss-cn-shenzhen-internal.aliyuncs.com/" + str, String.format(sourceLocal, num, this.wwwroot).concat(str));
+            }
         });
 //        fYunFileService.downloadFile(String.format(UploadFilePath.VIEW_PATH, num), String.format(sourceLocal, num, this.wwwroot));
 
@@ -226,43 +450,122 @@ public class DownloadServiceImpl implements IDownloadService {
         this.reWriteFile(num);
 
         //切图
-        String filePath = String.format(sourceLocal, num, this.wwwroot + String.format(UploadFilePath.IMG_VIEW_PATH, num) + "tiles/");
-        log.info("开始切图:{}", num);
-        this.cutImg(num, filePath, resolution, "tiles");
-        log.info("结束切图:{}", num);
-
-        //切图-场景关联
-        String panoramaPath = String.format(sourceLocal, num, this.wwwroot + String.format(UploadFilePath.IMG_VIEW_PATH, num) + "panorama/");
-        if(FileUtil.exist(panoramaPath)){
-            Path directoryPath = Paths.get(panoramaPath); // 替换为你要查询的目录路径
-            // 获取目录下的第一层子目录
-            List<String> panoramaIdList = Files.list(directoryPath).filter(Files::isDirectory).map(file -> file.getFileName().toString()).collect(Collectors.toList());
-            if(CollUtil.isNotEmpty(panoramaIdList)){
-                for (String panoramaId : panoramaIdList) {
-                    this.cutImg(num, panoramaPath.concat(panoramaId).concat("/tiles/"), resolution, "panorama/".concat(panoramaId).concat("/tiles"));
+        if(cutImg){
+            String filePath = String.format(sourceLocal, num, this.wwwroot + String.format(UploadFilePath.IMG_VIEW_PATH, num) + "tiles/");
+            if(version.equals(SceneVersionType.V3.code())){
+                filePath = String.format(sourceLocal, num, this.wwwroot + String.format(prefixArr4v3[1], num) + "tiles/");
+            }
+            log.info("开始切图:{}", num);
+            this.cutImg(num, filePath, resolution, "tiles", version);
+            log.info("结束切图:{}", num);
+
+            //切图-场景关联
+            String panoramaPath = String.format(sourceLocal, num, this.wwwroot + String.format(UploadFilePath.IMG_VIEW_PATH, num) + "panorama/");
+            if(version.equals(SceneVersionType.V3.code())){
+                panoramaPath = String.format(sourceLocal, num, this.wwwroot + String.format(prefixArr4v3[1], num) + "panorama/");
+            }
+            if(FileUtil.exist(panoramaPath)){
+                Path directoryPath = Paths.get(panoramaPath); // 替换为你要查询的目录路径
+                // 获取目录下的第一层子目录
+                List<String> panoramaIdList = Files.list(directoryPath).filter(Files::isDirectory).map(file -> file.getFileName().toString()).collect(Collectors.toList());
+                if(CollUtil.isNotEmpty(panoramaIdList)){
+                    for (String panoramaId : panoramaIdList) {
+                        this.cutImg(num, panoramaPath.concat(panoramaId).concat("/tiles/"), resolution, "panorama/".concat(panoramaId).concat("/tiles"), version);
+                    }
                 }
             }
         }
     }
 
-    public static void main(String[] args) {
-        Path directoryPath = Paths.get("D:\\test"); // 替换为你要查询的目录路径
+    public static void main(String[] args) throws Exception {
+//        String cmd = "cd " + "D:\\xuhua\\data\\downloads\\scenes\\SG-9D3ny9LYZgf" + " && zip -r " + "D:\\xuhua\\data\\downloads\\scenes\\SG-9D3ny9LYZgf.zip" + " *";
+//        CmdUtils.callLine(cmd, 200);
+
+        // 获取 Forest 全局配置对象
+        ForestConfiguration configuration = Forest.config();
+// 连接池最大连接数
+        configuration.setMaxConnections(1000);
+// 连接超时时间,单位为毫秒
+        configuration.setConnectTimeout(Integer.MAX_VALUE);
+// 数据读取超时时间,单位为毫秒
+        configuration.setReadTimeout(Integer.MAX_VALUE);
+        configuration.setTimeout(Integer.MAX_VALUE);
+
+
+        String errorPath = "D:\\lindongshneg2-2\\1-1\\error.txt";
+        String token = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI2NjY2NjY2NjY2NiIsImxvZ2luVHlwZSI6InVzZXIiLCJ1c2VyTmFtZSI6IjY2NjY2NjY2NjY2IiwiaWF0IjoxNzE1NTg1ODMyLCJqdGkiOiI4MTUxYTAxZi1hM2ZkLTQwOGYtYWE5Yy0yN2ExNzUzOTc0NzgifQ.lVyl1N6scL8NMgLZ_nIws2fWSbbdNobI73ESdVm789A";
+        List<File> files = FileUtil.loopFiles(new File("D:\\lindongshneg2-2\\1-1"));
+        for (File file : files) {
+            File parentFile = file.getParentFile();
+            String num = parentFile.getName();
+            System.out.println("开始上传,num:" + file.getName());
+//            Map<String, String> headers = new HashMap<>();
+//            headers.put("token", token);
+//            headers.put("Content-Type", ContentType.MULTIPART.getValue());
+                try {
+
+//                Map<String, Object> params = new HashMap<>();
+//                params.put("num",num);
+//                params.put("file", new File("D:\\lindongsheng\\img\\" + string));
+//                HttpResponse execute = HttpRequest.post("https://www.4dkankan.com/service/scene/edit/uploadPanorama")
+//                        .form(params)
+//                        .addHeaders(headers)
+//                        .execute();
+//                String body = execute.body();
+
+                    HttpClient client = Forest.client(HttpClient.class);
+                    String body = client.upload(file, token, num);
+
+                    ResultData<Map<String, String>> resultData = JSON.parseObject(body, ResultData.class);
+                    if(resultData.getCode() != ServerCode.SUCCESS.code()){
+                        throw new RuntimeException("上传全景图失败了, 场景码:" + file.getName());
+                    }
 
-        try {
-            // 获取目录下的第一层子目录
-            Files.list(directoryPath)
-                    .filter(Files::isDirectory)
-                    .forEach(file -> {
-                        System.out.println(file.getFileName().toString());
-                    });
-        } catch (IOException e) {
-            e.printStackTrace();
+                    boolean exit = false;
+                    while (!exit){
+                        Map<String, Object> map = new HashMap<>();
+                        map.put("func", "panorama");
+                        map.put("module", "repair");
+                        map.put("num", num);
+//                    HttpResponse execute = HttpRequest.post("https://www.4dkankan.com/service/scene/edit/getAsynOperLog")
+//                            .form(map)
+//                            .header("token", token)
+//                            .execute();
+//                    body = execute.body();
+                        body = client.getStatus(token, map);
+                        System.out.println("异步处理结果:" + body);
+                        ResultData<JSONArray> resultData1 = JSON.parseObject(body, ResultData.class);
+                        if(resultData1.getCode() != ServerCode.SUCCESS.code()){
+                            throw new RuntimeException("上传全景图失败了, 场景码:" + file.getName());
+                        }
+                        JSONObject resp = (JSONObject) resultData1.getData().get(0);
+                        Integer state = resp.getInteger("state");
+                        if(state == -1){
+                            throw new RuntimeException("上传全景图失败了, 场景码:" + file.getName());
+                        }
+                        if(state == 1){
+                            exit = true;
+                        }
+                        Thread.sleep(2000L);
+                    }
+
+                }catch (Exception e){
+                    e.printStackTrace();
+                    FileUtil.appendUtf8Lines(Lists.newArrayList(file.getName()), errorPath);
+                }
+
+                System.out.println("结束上传,num:" + file.getName());
         }
+
+
     }
     @Override
-    public void cutImg(String num, String path, String resolution, String subPath) throws Exception {
+    public void cutImg(String num, String path, String resolution, String subPath, String version) throws Exception {
 
         String imageNumPath = String.format(UploadFilePath.IMG_VIEW_PATH, num);
+        if(version.equals(SceneVersionType.V3.code())){
+            imageNumPath = String.format(prefixArr4v3[1], num);
+        }
         String tilesOssPath = imageNumPath.concat(subPath + "/" + resolution);
         List<String> cubeList = fYunFileService.listRemoteFiles(tilesOssPath);
         ExecutorService executorService = Executors.newFixedThreadPool(this.zipNthreads);
@@ -497,10 +800,11 @@ public class DownloadServiceImpl implements IDownloadService {
     }
 
     private void zip(String sourcePath, String zipPath) throws Exception {
-        zipPath = zipPath.replace("mnt", "data");
-        String target = String.format("/mnt/scenes/%s", DateExtUtil.format(new Date(), DateExtUtil.dateStyle6));
-        String cmd = "cd " + sourcePath + " && zip -r " + zipPath + " * && mv -f " + zipPath + " "  + target;
+        FileUtil.mkParentDirs(zipPath);
+        String cmd = "cd " + sourcePath + " && zip -r " + zipPath + " *";//&& mv -f " + zipPath + " "  + target
         CmdUtils.callLineSh(cmd, 200);
     }
 
+
+
 }

+ 293 - 147
src/main/java/com/fdkankan/download/service/impl/GenSceneRunnerImpl.java

@@ -1,147 +1,293 @@
-package com.fdkankan.download.service.impl;
-
-import cn.hutool.core.collection.CollUtil;
-import cn.hutool.core.date.DateUtil;
-import cn.hutool.core.date.TimeInterval;
-import cn.hutool.core.exceptions.ExceptionUtil;
-import cn.hutool.core.thread.ExecutorBuilder;
-import cn.hutool.core.util.ArrayUtil;
-import cn.hutool.core.util.StrUtil;
-import cn.hutool.system.HostInfo;
-import cn.hutool.system.SystemUtil;
-import com.alibaba.fastjson.JSONObject;
-import com.fdkankan.common.constant.CommonStatus;
-import com.fdkankan.common.constant.CommonSuccessStatus;
-import com.fdkankan.common.constant.SceneSource;
-import com.fdkankan.download.entity.*;
-import com.fdkankan.download.service.*;
-import com.fdkankan.redis.util.RedisLockUtil;
-import com.fdkankan.redis.util.RedisUtil;
-import com.fdkankan.rabbitmq.util.RabbitMqProducer;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.CommandLineRunner;
-import org.springframework.stereotype.Component;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.stream.Collectors;
-
-@Slf4j
-@Component
-public class GenSceneRunnerImpl implements CommandLineRunner {
-
-    @Autowired
-    private ISnService snService;
-    @Autowired
-    private IScenePlusService scenePlusService;
-    @Autowired
-    private ICameraService cameraService;
-    @Autowired
-    private IScenePlusExtService scenePlusExtService;
-    @Autowired
-    private IDownloadLogService downloadLogService;
-    @Autowired
-    private RedisUtil redisUtil;
-    @Autowired
-    private RedisLockUtil redisLockUtil;
-    @Autowired
-    private IDownloadService downloadService;
-    @Autowired
-    private RabbitMqProducer mqProducer;
-
-    private final static ThreadPoolExecutor threadPoolExecutor = ExecutorBuilder.create().setWorkQueue(new LinkedBlockingQueue<>(10000)).setCorePoolSize(30).setMaxPoolSize(30).build();
-
-    @Autowired
-    ILaserService laserService;
-
-    @Override
-    public void run(String... args) throws Exception {
-        List<Sn> snList = snService.list();
-        if (CollUtil.isEmpty(snList)) {
-            return;
-        }
-        for (Sn sn : snList) {
-            List<Camera> cameras = cameraService.listBySnCodeList(Arrays.asList(sn.getSn()));
-            if (CollUtil.isEmpty(cameras)) {
-                continue;
-            }
-            Camera camera = cameras.get(0);
-            List<ScenePlus> scenePluses = scenePlusService.listByCameraIdList(Arrays.asList(camera.getId()));
-            if (CollUtil.isEmpty(scenePluses)) {
-                continue;
-            }
-            for (ScenePlus scenePlus : scenePluses) {
-                //上锁
-                HostInfo hostInfo = SystemUtil.getHostInfo();
-                String key = "download:tool:" + scenePlus.getNum();
-                String lockVal = hostInfo.getAddress();
-                try {
-                    boolean lock = redisLockUtil.lock(key, lockVal, 24 * 60 * 60);
-                    if(!lock){
-                        continue;
-                    }
-
-                    Thread.sleep(5000L);
-
-                    List<DownloadLog> downloadLogList = downloadLogService.getByNum(scenePlus.getNum());
-                    Set<String> types = downloadLogList.stream().map(DownloadLog::getType).collect(Collectors.toSet());
-
-                    int isObj = CommonStatus.NO.code();
-                    //下载点云场景
-                    if (scenePlus.getSceneSource() == SceneSource.JG.code() || scenePlus.getSceneSource() == SceneSource.SG.code()) {
-                        if(!types.contains("laser")){
-                            threadPoolExecutor.submit(() -> {
-                                try {
-                                    // TODO: 2024/1/3 文杰实现
-                                    TimeInterval timer = DateUtil.timer();
-                                    String zipPath = laserService.downloadHandler(scenePlus.getNum());
-//                                    if (StrUtil.isNotEmpty(zipPath)){
-//                                        send(zipPath);
-//                                    }
-                                    downloadLogService.saveLog(scenePlus.getNum(), "laser", CommonSuccessStatus.SUCCESS.code(), null, timer.intervalMinute());
-                                } catch (Exception e) {
-                                    downloadLogService.saveLog(scenePlus.getNum(), "laser", CommonSuccessStatus.FAIL.code(), ExceptionUtil.stacktraceToString(e, 3000), null);
-                                    log.error("点云场景打包失败,num:{}", scenePlus.getNum(), e);
-                                }
-                            });
-                        }
-                        ScenePlusExt scenePlusExt = scenePlusExtService.getByPlusId(scenePlus.getId());
-                        isObj = scenePlusExt.getIsObj();
-                    }
-
-                    //下载看看、看见、mesh
-                    if (scenePlus.getSceneSource() == SceneSource.BM.code()
-                            || scenePlus.getSceneSource() == SceneSource.ZT.code()
-                            || isObj == CommonStatus.YES.code()) {
-                        if(!types.contains("kankan")) {
-                            threadPoolExecutor.submit(() -> {
-                                try {
-                                    TimeInterval timer = DateUtil.timer();
-                                    String zipPath = downloadService.downloadHandler(scenePlus.getNum());
-//                                    send(zipPath);
-                                    downloadLogService.saveLog(scenePlus.getNum(), "kankan", CommonSuccessStatus.SUCCESS.code(), null, timer.intervalMinute());
-                                } catch (Exception e) {
-                                    log.error("看看场景打包失败,num:{}", scenePlus.getNum(), e);
-                                    downloadLogService.saveLog(scenePlus.getNum(), "kankan", CommonSuccessStatus.FAIL.code(), ExceptionUtil.stacktraceToString(e, 3000), null);
-                                }
-                            });
-                        }
-                    }
-                }catch (Exception e){
-                    log.error("场景打包失败:{}", scenePlus.getNum(), e);
-                }
-            }
-        }
-    }
-
-    private void send(String zipPath){
-        JSONObject jsonObject = new JSONObject();
-        jsonObject.put("path", zipPath);
-        mqProducer.sendByWorkQueue("rsync-scene", jsonObject);
-    }
-
-}
+//package com.fdkankan.download.service.impl;
+//
+//import cn.hutool.core.collection.CollUtil;
+//import cn.hutool.core.date.DateUtil;
+//import cn.hutool.core.date.TimeInterval;
+//import cn.hutool.core.exceptions.ExceptionUtil;
+//import cn.hutool.core.io.FileUtil;
+//import cn.hutool.core.thread.ExecutorBuilder;
+//import cn.hutool.core.util.ArrayUtil;
+//import cn.hutool.core.util.StrUtil;
+//import cn.hutool.core.util.ZipUtil;
+//import cn.hutool.db.nosql.redis.RedisDS;
+//import cn.hutool.system.HostInfo;
+//import cn.hutool.system.SystemUtil;
+//import com.alibaba.fastjson.JSON;
+//import com.alibaba.fastjson.JSONObject;
+//import com.alibaba.fastjson.serializer.SerializerFeature;
+//import com.aliyun.oss.OSS;
+//import com.aliyun.oss.OSSClientBuilder;
+//import com.aliyun.oss.model.*;
+//import com.fdkankan.common.constant.CommonStatus;
+//import com.fdkankan.common.constant.CommonSuccessStatus;
+//import com.fdkankan.common.constant.SceneSource;
+//import com.fdkankan.download.bean.SceneEditControlsBean;
+//import com.fdkankan.download.bean.SceneViewInfoBean;
+//import com.fdkankan.download.entity.*;
+//import com.fdkankan.download.service.*;
+//import com.fdkankan.model.constants.UploadFilePath;
+//import com.fdkankan.redis.constant.RedisKey;
+//import com.fdkankan.redis.util.RedisLockUtil;
+//import com.fdkankan.redis.util.RedisUtil;
+//import com.fdkankan.rabbitmq.util.RabbitMqProducer;
+//import lombok.extern.slf4j.Slf4j;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.boot.CommandLineRunner;
+//import org.springframework.stereotype.Component;
+//import org.springframework.util.CollectionUtils;
+//import redis.clients.jedis.Jedis;
+//
+//import java.io.BufferedReader;
+//import java.io.IOException;
+//import java.io.InputStream;
+//import java.io.InputStreamReader;
+//import java.math.BigDecimal;
+//import java.util.*;
+//import java.util.concurrent.LinkedBlockingQueue;
+//import java.util.concurrent.ThreadPoolExecutor;
+//import java.util.stream.Collectors;
+//
+//@Slf4j
+//@Component
+//public class GenSceneRunnerImpl implements CommandLineRunner {
+//
+//    @Autowired
+//    private ISnService snService;
+//    @Autowired
+//    private IScenePlusService scenePlusService;
+//    @Autowired
+//    private ICameraService cameraService;
+//    @Autowired
+//    private IScenePlusExtService scenePlusExtService;
+//    @Autowired
+//    private IDownloadLogService downloadLogService;
+//    @Autowired
+//    private RedisUtil redisUtil;
+//    @Autowired
+//    private RedisLockUtil redisLockUtil;
+//    @Autowired
+//    private IDownloadService downloadService;
+//    @Autowired
+//    private RabbitMqProducer mqProducer;
+//
+//    private final static ThreadPoolExecutor threadPoolExecutor = ExecutorBuilder.create().setWorkQueue(new LinkedBlockingQueue<>(10000)).setCorePoolSize(30).setMaxPoolSize(30).build();
+//
+//    @Autowired
+//    ILaserService laserService;
+//
+//    @Override
+//    public void run(String... args) throws Exception {
+//        List<Sn> snList = snService.list();
+//        if (CollUtil.isEmpty(snList)) {
+//            return;
+//        }
+//        for (Sn sn : snList) {
+//            List<Camera> cameras = cameraService.listBySnCodeList(Arrays.asList(sn.getSn()));
+//            if (CollUtil.isEmpty(cameras)) {
+//                continue;
+//            }
+//            Camera camera = cameras.get(0);
+//            List<ScenePlus> scenePluses = scenePlusService.listByCameraIdList(Arrays.asList(camera.getId()));
+//            if (CollUtil.isEmpty(scenePluses)) {
+//                continue;
+//            }
+//            for (ScenePlus scenePlus : scenePluses) {
+//                //上锁
+//                HostInfo hostInfo = SystemUtil.getHostInfo();
+//                String key = "download:tool:" + scenePlus.getNum();
+//                String lockVal = hostInfo.getAddress();
+//                try {
+//                    boolean lock = redisLockUtil.lock(key, lockVal, 24 * 60 * 60);
+//                    if(!lock){
+//                        continue;
+//                    }
+//
+//                    Thread.sleep(5000L);
+//
+//                    List<DownloadLog> downloadLogList = downloadLogService.getByNum(scenePlus.getNum());
+//                    Set<String> types = downloadLogList.stream().map(DownloadLog::getType).collect(Collectors.toSet());
+//
+//                    int isObj = CommonStatus.NO.code();
+//                    //下载点云场景
+//                    if (scenePlus.getSceneSource() == SceneSource.JG.code() || scenePlus.getSceneSource() == SceneSource.SG.code()) {
+//                        if(!types.contains("laser")){
+//                            threadPoolExecutor.submit(() -> {
+//                                try {
+//                                    // TODO: 2024/1/3 文杰实现
+//                                    TimeInterval timer = DateUtil.timer();
+//                                    String zipPath = laserService.downloadHandler(scenePlus.getNum());
+////                                    if (StrUtil.isNotEmpty(zipPath)){
+////                                        send(zipPath);
+////                                    }
+//                                    downloadLogService.saveLog(scenePlus.getNum(), "laser", CommonSuccessStatus.SUCCESS.code(), null, timer.intervalMinute());
+//                                } catch (Exception e) {
+//                                    downloadLogService.saveLog(scenePlus.getNum(), "laser", CommonSuccessStatus.FAIL.code(), ExceptionUtil.stacktraceToString(e, 3000), null);
+//                                    log.error("点云场景打包失败,num:{}", scenePlus.getNum(), e);
+//                                }
+//                            });
+//                        }
+//                        ScenePlusExt scenePlusExt = scenePlusExtService.getByPlusId(scenePlus.getId());
+//                        isObj = scenePlusExt.getIsObj();
+//                    }
+//
+//                    //下载看看、看见、mesh
+//                    if (scenePlus.getSceneSource() == SceneSource.BM.code()
+//                            || scenePlus.getSceneSource() == SceneSource.ZT.code()
+//                            || isObj == CommonStatus.YES.code()) {
+//                        if(!types.contains("kankan")) {
+//                            threadPoolExecutor.submit(() -> {
+//                                try {
+//                                    TimeInterval timer = DateUtil.timer();
+//                                    String zipPath = downloadService.downloadHandler(scenePlus.getNum());
+////                                    send(zipPath);
+//                                    downloadLogService.saveLog(scenePlus.getNum(), "kankan", CommonSuccessStatus.SUCCESS.code(), null, timer.intervalMinute());
+//                                } catch (Exception e) {
+//                                    log.error("看看场景打包失败,num:{}", scenePlus.getNum(), e);
+//                                    downloadLogService.saveLog(scenePlus.getNum(), "kankan", CommonSuccessStatus.FAIL.code(), ExceptionUtil.stacktraceToString(e, 3000), null);
+//                                }
+//                            });
+//                        }
+//                    }
+//                }catch (Exception e){
+//                    log.error("场景打包失败:{}", scenePlus.getNum(), e);
+//                }
+//            }
+//        }
+//
+//
+//
+//    }
+//
+//    public static void main(String[] args) throws Throwable {
+//        String filePath = "D:\\test\\xuhua.txt";
+////        Set<String> collect = list.stream().filter(v -> !v.contains("_laser")).map(v -> v.substring(v.lastIndexOf("/") + 1, v.lastIndexOf("."))).collect(Collectors.toSet());
+////        FileUtil.writeUtf8Lines(collect, filePath);
+//
+//        OSS build = new OSSClientBuilder().build("http://oss-cn-shenzhen.aliyuncs.com","LTAI5tJwboCj3r4vUNkSmbyX", "meDy7VYAWbg8kZCKsoUZcIYQxigWOy");
+//
+//        Long all = new Long(0);
+//        List<String> strings = FileUtil.readUtf8Lines(filePath);
+//
+//        for (String num : strings) {
+//            List<String> keyList = new ArrayList<>();
+//            Long total = 0L;
+//            boolean flag = true;
+//            String nextMaker = null;
+//            ListObjectsRequest listObjectsRequest = new ListObjectsRequest("4dkankan");
+//            //指定下一级文件
+//            listObjectsRequest.setPrefix(String.format(UploadFilePath.IMG_VIEW_PATH, num));
+//            //设置分页的页容量
+//            listObjectsRequest.setMaxKeys(200);
+//            do {
+//                //获取下一页的起始点,它的下一项
+//                listObjectsRequest.setMarker(nextMaker);
+//                ObjectListing objectListing = build.listObjects(listObjectsRequest);
+//                Long space = objectListing.getObjectSummaries().stream().filter(v->!v.getKey().contains("/images/tiles"))
+//                        .mapToLong(OSSObjectSummary::getSize).sum();
+//                List<String> subKeyList = objectListing.getObjectSummaries().stream().filter(v->!v.getKey().contains("/images/tiles"))
+//                        .map(OSSObjectSummary::getKey).collect(Collectors.toList());
+//                if (!CollectionUtils.isEmpty(subKeyList)) {
+//                    keyList.addAll(subKeyList);
+//                }
+//                total += space;
+//                nextMaker = objectListing.getNextMarker();
+//                //全部执行完后,为false
+//                flag = objectListing.isTruncated();
+//            } while (flag);
+//            all += total;
+//
+////            //下载
+////            if(CollUtil.isNotEmpty(keyList)){
+////                keyList.stream().filter(v->!v.endsWith("/")).forEach(key->{
+////                    String localPath = "D:\\test222\\" + num + "\\wwwroot\\" + key;
+////                    FileUtil.mkParentDirs(localPath);
+////                    DownloadFileRequest request = new DownloadFileRequest("4dkankan", key);
+////                    request.setDownloadFile(localPath);
+////                    // 默认5个任务并发下载
+////                    request.setTaskNum(5);
+////                    // 启动断点续传
+////                    request.setEnableCheckpoint(true);
+////                    try {
+////                        build.downloadFile(request);
+////                    } catch (Throwable e) {
+////                        throw new RuntimeException(e);
+////                    }
+////                });
+////                for (String key : keyList) {
+////                    if(key.endsWith("/")) continue;
+////                    String localPath = "D:\\test222\\" + num + "\\wwwroot\\" + key;
+////                    FileUtil.mkParentDirs(localPath);
+////                    DownloadFileRequest request = new DownloadFileRequest("4dkankan", key);
+////                    request.setDownloadFile(localPath);
+////                    // 默认5个任务并发下载
+////                    request.setTaskNum(5);
+////                    // 启动断点续传
+////                    request.setEnableCheckpoint(true);
+////                    build.downloadFile(request);
+////                }
+////            }
+//
+////            ZipUtil.zip("D:\\test222\\" + num+ "\\wwwroot\\", "D:\\test222\\zip\\" + num+ ".zip");
+//
+//        }
+//        System.out.println("总容量:" + all/1024/1024/1024);
+//
+//
+////        String filePath = "D:\\test\\kk.txt";
+//////        OSS build = new OSSClientBuilder().build("http://oss-cn-shenzhen.aliyuncs.com","LTAI5tJwboCj3r4vUNkSmbyX", "meDy7VYAWbg8kZCKsoUZcIYQxigWOy");
+////        List<String> strings = FileUtil.readUtf8Lines(filePath);
+////
+////        for (String num : strings) {
+////            Jedis jedis = RedisDS.create().getJedis();
+////            String sceneJsonData = jedis.get(String.format(RedisKey.SCENE_JSON, num));
+//////            if(StrUtil.isEmpty(sceneJsonData)){
+//////                try (OSSObject ossObject = build.getObject("4dkankan", String.format(UploadFilePath.DATA_VIEW_PATH, num) + "scene.json");
+//////                     InputStream objectContent = ossObject.getObjectContent();
+//////                ){
+//////                    StringBuilder contentJson = new StringBuilder();
+//////                    BufferedReader reader = new BufferedReader(new InputStreamReader(objectContent));
+//////                    while (true) {
+//////                        String line = reader.readLine();
+//////                        if (line == null) break;
+//////                        contentJson.append(line);
+//////                    }
+//////                    sceneJsonData = sceneJsonData.toString();
+//////                }
+//////            }
+////            sceneJsonData = sceneJsonData.replace("https://4dkk.4dage.com/", "");
+////            SceneViewInfoBean sceneInfoVO = JSON.parseObject(sceneJsonData, SceneViewInfoBean.class);
+////            sceneInfoVO.setScenePassword(null);
+////            if(Objects.isNull(sceneInfoVO.getFloorPlanAngle())){
+////                sceneInfoVO.setFloorPlanAngle(0f);
+////            }
+////            if(Objects.isNull(sceneInfoVO.getFloorPlanCompass())){
+////                sceneInfoVO.setFloorPlanCompass(0f);
+////            }
+////            SceneEditControlsBean controls = sceneInfoVO.getControls();
+////            if(Objects.isNull(controls.getShowShare())){
+////                controls.setShowShare(CommonStatus.YES.code().intValue());
+////            }
+////            if(Objects.isNull(controls.getShowCapture())){
+////                controls.setShowCapture(CommonStatus.YES.code().intValue());
+////            }
+////            if(Objects.isNull(controls.getShowBillboardTitle())){
+////                controls.setShowBillboardTitle(CommonStatus.YES.code().intValue());
+////            }
+////
+////            FileUtil.writeUtf8String(JSON.toJSONString(sceneInfoVO, SerializerFeature.WriteNullStringAsEmpty, SerializerFeature.WriteNullNumberAsZero), "D:\\test5\\" + num + "\\wwwroot\\scene_view_data\\" + num + "\\data\\scene.json");
+////
+////            jedis.close();
+////            System.out.println("替换完成:" + num);
+//
+////        }
+//
+//
+//    }
+//
+//    private void send(String zipPath){
+//        JSONObject jsonObject = new JSONObject();
+//        jsonObject.put("path", zipPath);
+//        mqProducer.sendByWorkQueue("rsync-scene", jsonObject);
+//    }
+//
+//}

+ 2 - 1
src/main/java/com/fdkankan/download/service/impl/LaserService.java

@@ -9,6 +9,7 @@ import cn.hutool.http.HttpUtil;
 import cn.hutool.system.oshi.OshiUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.common.constant.SceneVersionType;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.common.util.CmdUtils;
 import com.fdkankan.common.util.DateExtUtil;
@@ -157,7 +158,7 @@ public class LaserService  implements ILaserService {
                                 break;
                             case 4:
                                 try {
-                                    downloadService.cutImg(datum.getSceneCode(), sourceLocal + datum.getPath(), "4k", "tiles");
+                                    downloadService.cutImg(datum.getSceneCode(), sourceLocal + datum.getPath(), "4k", "tiles", SceneVersionType.V4.code());
                                 } catch (Exception e) {
                                     throw new RuntimeException(e);
                                 }

+ 28 - 21
src/main/resources/application-dev.yml

@@ -1,13 +1,13 @@
 server:
-  port: 10002
+  port: 10022
 spring:
   application:
     name: 4dkankan-scene-download-tool
   redis:
-    host: 120.24.144.164
+    host: r-wz9owsphxqwi4ztqlf.redis.rds.aliyuncs.com
     port: 6379
     timeout: 6000ms
-    password: bgh0cae240
+    password: 3oo19bgh0cae2406&
     jedis:
       pool:
         max-active: 3  #连接池最大连接数(使用负值表示没有限制)
@@ -25,7 +25,7 @@ spring:
     connection-timeout: 0
     listener:
       simple:
-        prefetch: 2
+        prefetch: 5
         max-concurrency: 10
         acknowledge-mode: manual #开启消费者手动确认
     #开启消息投递确认机制
@@ -34,13 +34,13 @@ spring:
 mybatis-flex:
   datasource:
     primary:
-      url: jdbc:mysql://120.24.144.164:3306/4dkankan_scene_download_tool
+      url: jdbc:mysql:/localhost:3306/4dkankan_scene_download_tool
       username: root
       password: 4Dage@4Dage#@168
     www:
-      url: jdbc:mysql://120.24.144.164:3306/4dkankan_v4
+      url: jdbc:mysql://rm-wz90w10465iiwwv09.mysql.rds.aliyuncs.com:3306/4dkankan_v4_prod
       username: root
-      password: 4Dage@4Dage#@168
+      password: D2719bd0cae1a005
 #    laser:
 #      url: jdbc:mysql://120.25.146.52:13306/fdkk_laser
 #      username: root
@@ -50,7 +50,7 @@ account:
   username: xxx
   password: xxx
 host: https://v4-uat.4dkankan.com
-laserhost: https://uat-laser.4dkankan.com
+laserhost: https://laser.4dkankan.com/backend
 api:
   login: /service/manage/login
   checkDownLoad: /service/manage/scene/checkDownLoad?num=%s
@@ -77,37 +77,40 @@ logging:
 
 fyun:
   type: oss
-  key: LTAIUrvuHqj8pvry
-  secret: JLOVl0k8Ke0aaM8nLMMiUAZ3EiiqI4
+  key: LTAI5tJwboCj3r4vUNkSmbyX
+  secret: meDy7VYAWbg8kZCKsoUZcIYQxigWOy
   bucket: 4dkankan
-  #  endPoint: http://oss-cn-shenzhen-internal.aliyuncs.com
-  endPoint: http://oss-cn-shenzhen.aliyuncs.com
+  endPoint: http://oss-cn-shenzhen-internal.aliyuncs.com
   host: https://4dkk.4dage.com/
 
 zip:
   nThreads: 10
 path:
   v4school: /mnt/scene_download_statics/v4local/
-  source-local: /home/backend/downloads/scenes/%s/%s
-  zip-local: I:\offline\downloads\scenes\%s.zip
+  v3school: /mnt/scene_download_statics/v3local/
+  source-local: /mnt/scenes/%s/%s
+  zip-local: /mnt/scenes/%s/%s.zip
   zip-root: wwwroot/
   zip-oss: downloads/scenes/%s.zip
-  laserschool: I:\offline\school\
-  source-local-laser: I:\offline\downloads\scenesLaser
+  laserschool: /mnt/fdkk_laser/uploadPath/offlineGenerate/
+  source-local-laser: /data/laserOffline
 download:
-  dir: D:\test2\
+  dir: /mnt/batchDownload/
   task: ${download.dir}task.txt
   id: ${download.dir}id.txt
   config:
     public-url: https://4dkk.4dage.com/
-#    resource-url: https://4dkankan.oss-cn-shenzhen-internal.aliyuncs.com/
-    resource-url: https://4dkankan.oss-cn-shenzhen.aliyuncs.com/
-    laser-resource-url: https://laser-data.oss-cn-shenzhen.aliyuncs.com/
+    resource-url: https://4dkankan.oss-cn-shenzhen-internal.aliyuncs.com/
+    laser-resource-url: https://laser-data.oss-cn-shenzhen-internal.aliyuncs.com/
     exe-name: start-browser.bat
     exe-content: | # | 表示不转义特殊字符
       taskkill /f /t /im http.exe
       start http://127.0.0.1:9000/spg.html?m=%s
       http.exe -nc -p 9000 -r wwwroot
+    exe-content-v3: | # | 表示不转义特殊字符
+      taskkill /f /t /im http.exe
+      start http://127.0.0.1:9000/spc.html?m=%s
+      http.exe -nc -p 9000 -r wwwroot
 laser:
   bucket: laser-data
 
@@ -117,9 +120,13 @@ rsync:
   port: 22571
   dest: /shuju
 
+url:
+  v3:
+    getInfo: https://www.4dkankan.com/service/scenev3/getInfo?num=%s
+
 
 
-cutImgType: oss   #oss-阿里云接口切图  local-本地切图
+#cutImgType: oss   #oss-阿里云接口切图  local-本地切图
 
 
 

+ 12 - 4
src/main/resources/application-prod.yml

@@ -4,7 +4,7 @@ spring:
   application:
     name: 4dkankan-scene-download-tool
   redis:
-    host: r-wz9owsphxqwi4ztqlfpd.redis.rds.aliyuncs.com
+    host: r-wz9owsphxqwi4ztqlf.redis.rds.aliyuncs.com
     port: 6379
     timeout: 6000ms
     password: 3oo19bgh0cae2406&
@@ -38,7 +38,7 @@ mybatis-flex:
       username: root
       password: 4Dage@4Dage#@168
     www:
-      url: jdbc:mysql://rm-wz90w10465iiwwv098o.mysql.rds.aliyuncs.com:3306/4dkankan_v4_prod
+      url: jdbc:mysql://rm-wz90w10465iiwwv09.mysql.rds.aliyuncs.com:3306/4dkankan_v4_prod
       username: root
       password: D2719bd0cae1a005
 #    laser:
@@ -77,8 +77,8 @@ logging:
 
 fyun:
   type: oss
-  key: LTAIUrvuHqj8pvry
-  secret: JLOVl0k8Ke0aaM8nLMMiUAZ3EiiqI4
+  key: LTAI5tJwboCj3r4vUNkSmbyX
+  secret: meDy7VYAWbg8kZCKsoUZcIYQxigWOy
   bucket: 4dkankan
   endPoint: http://oss-cn-shenzhen-internal.aliyuncs.com
   host: https://4dkk.4dage.com/
@@ -87,6 +87,7 @@ zip:
   nThreads: 10
 path:
   v4school: /mnt/scene_download_statics/v4local/
+  v3school: /mnt/scene_download_statics/v3local/
   source-local: /data/downloads/scenes/%s/%s
   zip-local: /mnt/scenes/%s/%s.zip
   zip-root: wwwroot/
@@ -106,6 +107,10 @@ download:
       taskkill /f /t /im http.exe
       start http://127.0.0.1:9000/spg.html?m=%s
       http.exe -nc -p 9000 -r wwwroot
+    exe-content-v3: | # | 表示不转义特殊字符
+      taskkill /f /t /im http.exe
+      start http://127.0.0.1:9000/spc.html?m=%s
+      http.exe -nc -p 9000 -r wwwroot
 laser:
   bucket: laser-data
 
@@ -115,6 +120,9 @@ rsync:
   port: 22571
   dest: /shuju
 
+url:
+  v3:
+    getInfo: https://www.4dkankan.com/service/scenev3/getInfo?num=%s
 
 
 #cutImgType: oss   #oss-阿里云接口切图  local-本地切图

+ 23 - 18
src/main/resources/application-test.yml

@@ -4,10 +4,10 @@ spring:
   application:
     name: 4dkankan-scene-download-tool
   redis:
-    host: 127.0.0.1
+    host: r-wz9owsphxqwi4ztqlf.redis.rds.aliyuncs.com
     port: 6379
     timeout: 6000ms
-    password: bgh0cae240
+    password: 3oo19bgh0cae2406&
     jedis:
       pool:
         max-active: 3  #连接池最大连接数(使用负值表示没有限制)
@@ -17,7 +17,7 @@ spring:
     lettuce:
       shutdown-timeout: 0ms
   rabbitmq:
-    host: 127.0.0.1
+    host: 172.18.156.39
     port: 5672
     username: admin
     password: adminv41234
@@ -34,23 +34,23 @@ spring:
 mybatis-flex:
   datasource:
     primary:
-      url: jdbc:mysql://127.0.0.1:3306/4dkankan_scene_download_tool
+      url: jdbc:mysql://172.18.156.39:3306/4dkankan_scene_download_tool
       username: root
       password: 4Dage@4Dage#@168
     www:
-      url: jdbc:mysql://127.0.0.1:3306/4dkankan_v4
+      url: jdbc:mysql://rm-wz90w10465iiwwv09.mysql.rds.aliyuncs.com:3306/4dkankan_v4_prod
       username: root
-      password: 4Dage@4Dage#@168
+      password: D2719bd0cae1a005
 #    laser:
 #      url: jdbc:mysql://120.25.146.52:13306/fdkk_laser
 #      username: root
 #      password: JK123456%JIK
 
 account:
-  username: super-admin
-  password: Aa123456
+  username: xxx
+  password: xxx
 host: https://v4-uat.4dkankan.com
-laserhost: https://uat-laser.4dkankan.com
+laserhost: https://laser.4dkankan.com/backend
 api:
   login: /service/manage/login
   checkDownLoad: /service/manage/scene/checkDownLoad?num=%s
@@ -77,38 +77,40 @@ logging:
 
 fyun:
   type: oss
-  key: LTAIUrvuHqj8pvry
-  secret: JLOVl0k8Ke0aaM8nLMMiUAZ3EiiqI4
+  key: LTAI5tJwboCj3r4vUNkSmbyX
+  secret: meDy7VYAWbg8kZCKsoUZcIYQxigWOy
   bucket: 4dkankan
   endPoint: http://oss-cn-shenzhen-internal.aliyuncs.com
-#  endPoint: http://oss-cn-shenzhen.aliyuncs.com
   host: https://4dkk.4dage.com/
 
 zip:
   nThreads: 10
 path:
   v4school: /mnt/scene_download_statics/v4local/
-  source-local: /home/backend/downloads/scenes/%s/%s
-  zip-local: /home/backend/downloads/scenes/%s/%s.zip
+  v3school: /mnt/scene_download_statics/v3local/
+  source-local: /data/downloads/scenes/%s/%s
+  zip-local: /mnt/scenes/dierpi/%s/%s.zip
   zip-root: wwwroot/
   zip-oss: downloads/scenes/%s.zip
   laserschool: /mnt/fdkk_laser/uploadPath/offlineGenerate/
-  source-local-laser: /home/backend/downloads/scenes/laseroffline
+  source-local-laser: /data/laserOffline
 download:
-  dir: D:\test2\
+  dir: /mnt/batchDownload/
   task: ${download.dir}task.txt
   id: ${download.dir}id.txt
   config:
     public-url: https://4dkk.4dage.com/
     resource-url: https://4dkankan.oss-cn-shenzhen-internal.aliyuncs.com/
-    # resource-url: https://4dkankan.oss-cn-shenzhen.aliyuncs.com/
-    #laser-resource-url: https://laser-data.oss-cn-shenzhen.aliyuncs.com/
     laser-resource-url: https://laser-data.oss-cn-shenzhen-internal.aliyuncs.com/
     exe-name: start-browser.bat
     exe-content: | # | 表示不转义特殊字符
       taskkill /f /t /im http.exe
       start http://127.0.0.1:9000/spg.html?m=%s
       http.exe -nc -p 9000 -r wwwroot
+    exe-content-v3: | # | 表示不转义特殊字符
+      taskkill /f /t /im http.exe
+      start http://127.0.0.1:9000/spc.html?m=%s
+      http.exe -nc -p 9000 -r wwwroot
 laser:
   bucket: laser-data
 
@@ -118,6 +120,9 @@ rsync:
   port: 22571
   dest: /shuju
 
+url:
+  v3:
+    getInfo: https://www.4dkankan.com/service/scenev3/getInfo?num=%s
 
 
 #cutImgType: oss   #oss-阿里云接口切图  local-本地切图

+ 2 - 114
src/main/resources/application.yml

@@ -1,115 +1,3 @@
-server:
-  port: 10002
 spring:
-  application:
-    name: 4dkankan-scene-download-tool
-  redis:
-    host: 120.24.144.164
-    port: 6379
-    timeout: 6000ms
-    password: bgh0cae240
-    jedis:
-      pool:
-        max-active: 3  #连接池最大连接数(使用负值表示没有限制)
-        max-idle: 3 # 连接池中的最大空闲连接
-        min-idle: 1 # 连接池中的最小空闲连接
-        max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
-    lettuce:
-      shutdown-timeout: 0ms
-  rabbitmq:
-    host: 120.24.144.164
-    port: 5672
-    username: admin
-    password: adminv41234
-    virtual-host: 4dkankan
-    connection-timeout: 0
-    listener:
-      simple:
-        prefetch: 5
-        max-concurrency: 10
-        acknowledge-mode: manual #开启消费者手动确认
-    #开启消息投递确认机制
-    publisher-confirm-type: correlated
-
-mybatis-flex:
-  datasource:
-    primary:
-      url: jdbc:mysql://120.24.144.164:3306/4dkankan_scene_download_tool
-      username: root
-      password: 4Dage@4Dage#@168
-    www:
-      url: jdbc:mysql://120.24.144.164:3306/4dkankan_v4
-      username: root
-      password: 4Dage@4Dage#@168
-#    laser:
-#      url: jdbc:mysql://120.25.146.52:13306/fdkk_laser
-#      username: root
-#      password: JK123456%JIK
-
-account:
-  username: super-admin
-  password: Aa123456
-host: https://v4-uat.4dkankan.com
-api:
-  login: /service/manage/login
-  checkDownLoad: /service/manage/scene/checkDownLoad?num=%s
-  downScene: /service/manage/scene/downScene?num=%s
-  downloadProcess: /service/manage/scene/downloadProcess?num=%s
-
-forest:
-  ## 日志总开关,打开/关闭Forest请求/响应日志(默认为 true)
-  log-enabled: true
-  ## 打开/关闭Forest请求日志(默认为 true)
-  log-request: true
-  ## 打开/关闭Forest响应状态日志(默认为 true)
-  log-response-status: true
-  ## 打开/关闭Forest响应内容日志(默认为 false)
-  log-response-content: true
-  ## 请求超时时间,单位为毫秒, 默认值为3000
-  timeout: 10000
-  ## 连接超时时间,单位为毫秒, 默认值为2000
-  connect-timeout: 10000
-
-logging:
-  path: /home/backend/4dkankan_v4
-
-fyun:
-  type: oss
-  key: LTAIUrvuHqj8pvry
-  secret: JLOVl0k8Ke0aaM8nLMMiUAZ3EiiqI4
-  bucket: 4dkankan
-  #  endPoint: http://oss-cn-shenzhen-internal.aliyuncs.com
-  endPoint: http://oss-cn-shenzhen.aliyuncs.com
-  host: https://4dkk.4dage.com/
-
-zip:
-  nThreads: 10
-path:
-  v4school: /mnt/scene_download_statics/v4local/
-  source-local: /home/backend/downloads/scenes/%s/%s
-  zip-local: /home/backend/downloads/scenes/%s.zip
-  zip-root: wwwroot/
-  zip-oss: downloads/scenes/%s.zip
-download:
-  dir: D:\test2\
-  task: ${download.dir}task.txt
-  id: ${download.dir}id.txt
-  config:
-    public-url: https://4dkk.4dage.com/
-    resource-url: https://4dkankan.oss-cn-shenzhen-internal.aliyuncs.com/
-    # resource-url: https://4dkankan.oss-cn-shenzhen.aliyuncs.com/
-    exe-name: start-browser.bat
-    exe-content: | # | 表示不转义特殊字符
-      taskkill /f /t /im http.exe
-      start http://127.0.0.1:9000/spg.html?m=%s
-      http.exe -nc -p 9000 -r wwwroot
-
-#cutImgType: oss   #oss-阿里云接口切图  local-本地切图
-
-
-
-
-
-
-
-
+  profiles:
+    active: dev