Ver código fonte

Merge remote-tracking branch 'origin/master'

by su 3 anos atrás
pai
commit
2460f38648
67 arquivos alterados com 366 adições e 60838 exclusões
  1. 1 1
      4dkankan-center-api/pom.xml
  2. 1 1
      4dkankan-center-modeling/src/main/java/com/fdkankan/modeling/constants/SysConstants.java
  3. 50 220
      4dkankan-center-modeling/src/main/java/com/fdkankan/modeling/receiver/BuildSceneReceiver.java
  4. 4 4
      4dkankan-center-modeling/src/main/java/com/fdkankan/modeling/utils/ComputerUtil.java
  5. 1 1
      4dkankan-center-modeling/src/main/java/com/fdkankan/modeling/utils/DingDingUtils.java
  6. 1 1
      4dkankan-center-modeling/src/main/java/com/fdkankan/modeling/utils/PushMsgUtil.java
  7. 6 0
      4dkankan-center-scene/pom.xml
  8. 32 0
      4dkankan-center-scene/src/test/java/com/fdkankan/SceneApplicationTests.java
  9. 0 49
      4dkankan-common-db/src/main/java/com/fdkankan/common/constant/ConstantFilePath.java
  10. 0 7340
      4dkankan-common-db/src/main/java/com/fdkankan/common/proto/BigSceneProto.java
  11. 0 4654
      4dkankan-common-db/src/main/java/com/fdkankan/common/proto/Common.java
  12. 0 1333
      4dkankan-common-db/src/main/java/com/fdkankan/common/proto/format/XmlFormat.java
  13. 0 65
      4dkankan-common-db/src/main/java/com/fdkankan/common/utils/Base64Converter.java
  14. 0 55
      4dkankan-common-db/src/main/java/com/fdkankan/common/utils/ConstantCmd.java
  15. 0 602
      4dkankan-common-db/src/main/java/com/fdkankan/common/utils/CreateObjUtil.java
  16. 0 39
      4dkankan-common-mq/src/main/java/com/fdkankan/common/constant/ConstantFileName.java
  17. 0 7340
      4dkankan-common-mq/src/main/java/com/fdkankan/common/proto/BigSceneProto.java
  18. 0 4654
      4dkankan-common-mq/src/main/java/com/fdkankan/common/proto/Common.java
  19. 0 4345
      4dkankan-common-mq/src/main/java/com/fdkankan/common/proto/Visionmodeldata.java
  20. 0 156
      4dkankan-common-mq/src/main/java/com/fdkankan/common/proto/format/CouchDBFormat.java
  21. 0 703
      4dkankan-common-mq/src/main/java/com/fdkankan/common/proto/format/HtmlFormat.java
  22. 0 1603
      4dkankan-common-mq/src/main/java/com/fdkankan/common/proto/format/JsonFormat.java
  23. 0 1333
      4dkankan-common-mq/src/main/java/com/fdkankan/common/proto/format/XmlFormat.java
  24. 0 602
      4dkankan-common-mq/src/main/java/com/fdkankan/common/utils/CreateObjUtil.java
  25. 0 61
      4dkankan-common-mq/src/main/java/com/fdkankan/common/utils/StreamGobbler.java
  26. 1 1
      4dkankan-common-mq/src/main/java/com/fdkankan/common/message/BaseMQMessage.java
  27. 1 1
      4dkankan-common-mq/src/main/java/com/fdkankan/common/message/BuildSceneMqMessage.java
  28. 0 39
      4dkankan-common-redis/src/main/java/com/fdkankan/common/constant/ConstantFileName.java
  29. 0 49
      4dkankan-common-redis/src/main/java/com/fdkankan/common/constant/ConstantFilePath.java
  30. 0 156
      4dkankan-common-redis/src/main/java/com/fdkankan/common/proto/format/CouchDBFormat.java
  31. 0 1338
      4dkankan-common-redis/src/main/java/com/fdkankan/common/proto/format/JavaPropsFormat.java
  32. 0 1603
      4dkankan-common-redis/src/main/java/com/fdkankan/common/proto/format/JsonFormat.java
  33. 0 65
      4dkankan-common-redis/src/main/java/com/fdkankan/common/utils/Base64Converter.java
  34. 0 55
      4dkankan-common-redis/src/main/java/com/fdkankan/common/utils/ConstantCmd.java
  35. 0 39
      4dkankan-common-utils/src/main/java/com/fdkankan/common/constant/ConstantFileName.java
  36. 0 49
      4dkankan-common-utils/src/main/java/com/fdkankan/common/constant/ConstantFilePath.java
  37. 0 7340
      4dkankan-common-utils/src/main/java/com/fdkankan/common/proto/BigSceneProto.java
  38. 0 4654
      4dkankan-common-utils/src/main/java/com/fdkankan/common/proto/Common.java
  39. 0 4345
      4dkankan-common-utils/src/main/java/com/fdkankan/common/proto/Visionmodeldata.java
  40. 0 156
      4dkankan-common-utils/src/main/java/com/fdkankan/common/proto/format/CouchDBFormat.java
  41. 0 703
      4dkankan-common-utils/src/main/java/com/fdkankan/common/proto/format/HtmlFormat.java
  42. 0 1338
      4dkankan-common-utils/src/main/java/com/fdkankan/common/proto/format/JavaPropsFormat.java
  43. 0 1603
      4dkankan-common-utils/src/main/java/com/fdkankan/common/proto/format/JsonFormat.java
  44. 0 1333
      4dkankan-common-utils/src/main/java/com/fdkankan/common/proto/format/XmlFormat.java
  45. 0 65
      4dkankan-common-utils/src/main/java/com/fdkankan/common/utils/Base64Converter.java
  46. 0 55
      4dkankan-common-utils/src/main/java/com/fdkankan/common/utils/ConstantCmd.java
  47. 0 602
      4dkankan-common-utils/src/main/java/com/fdkankan/common/utils/CreateObjUtil.java
  48. 0 61
      4dkankan-common-utils/src/main/java/com/fdkankan/common/utils/StreamGobbler.java
  49. 1 1
      4dkankan-common-db/src/main/java/com/fdkankan/common/constant/ConstantFileName.java
  50. 1 1
      4dkankan-common-mq/src/main/java/com/fdkankan/common/constant/ConstantFilePath.java
  51. 1 1
      4dkankan-common-utils/src/main/java/com/fdkankan/common/constant/ConstantUrl.java
  52. 1 1
      4dkankan-common-redis/src/main/java/com/fdkankan/common/proto/BigSceneProto.java
  53. 1 1
      4dkankan-common-redis/src/main/java/com/fdkankan/common/proto/Common.java
  54. 1 1
      4dkankan-common-db/src/main/java/com/fdkankan/common/proto/Visionmodeldata.java
  55. 3 3
      4dkankan-common-db/src/main/java/com/fdkankan/common/proto/format/CouchDBFormat.java
  56. 1 1
      4dkankan-common-db/src/main/java/com/fdkankan/common/proto/format/HtmlFormat.java
  57. 1 1
      4dkankan-common-mq/src/main/java/com/fdkankan/common/proto/format/JavaPropsFormat.java
  58. 1 1
      4dkankan-common-db/src/main/java/com/fdkankan/common/proto/format/JsonFormat.java
  59. 1 1
      4dkankan-common-redis/src/main/java/com/fdkankan/common/proto/format/XmlFormat.java
  60. 1 1
      4dkankan-common-mq/src/main/java/com/fdkankan/common/utils/Base64Converter.java
  61. 1 1
      4dkankan-common-mq/src/main/java/com/fdkankan/common/utils/ConstantCmd.java
  62. 8 8
      4dkankan-common-redis/src/main/java/com/fdkankan/common/utils/CreateObjUtil.java
  63. 240 0
      4dkankan-common-utils/src/main/java/com/fdkankan/utils/utils/FileUtil.java
  64. 1 1
      4dkankan-common-utils/src/main/java/com/fdkankan/common/utils/FileUtils.java
  65. 1 1
      4dkankan-common-redis/src/main/java/com/fdkankan/common/utils/StreamGobbler.java
  66. 1 1
      4dkankan-sdk-oss/src/main/java/com/fdkankan/utils/UploadUtils.java
  67. 2 0
      4dkankan-sdk-oss/target/classes/bootstrap.yml

+ 1 - 1
4dkankan-center-api/pom.xml

@@ -2,7 +2,7 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <packaging>jar</packaging>
+    <packaging>pom</packaging>
     <parent>
         <artifactId>4dkankan-parent</artifactId>
         <groupId>com.fdkankan</groupId>

+ 1 - 1
4dkankan-center-modeling/src/main/java/com/fdkankan/modeling/constants/SysConstants.java

@@ -1,6 +1,6 @@
 package com.fdkankan.modeling.constants;
 
-import com.fdkankan.common.utils.FileUtils;
+import com.fdkankan.utils.utils.FileUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Value;

+ 50 - 220
4dkankan-center-modeling/src/main/java/com/fdkankan/modeling/receiver/BuildSceneReceiver.java

@@ -1,30 +1,32 @@
 package com.fdkankan.modeling.receiver;
 
 import cn.hutool.core.date.DateUtil;
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.fdkankan.common.constant.ConstantFilePath;
-import com.fdkankan.common.constant.ConstantUrl;
-import com.fdkankan.common.utils.CreateObjUtil;
-import com.fdkankan.common.utils.FileUtil;
-import com.fdkankan.common.utils.FileUtils;
+import com.fdkankan.utils.constant.ConstantFilePath;
+import com.fdkankan.utils.constant.ConstantUrl;
+import com.fdkankan.mq.message.BuildSceneMqMessage;
+import com.fdkankan.utils.utils.CreateObjUtil;
+import com.fdkankan.utils.utils.FileUtil;
+import com.fdkankan.utils.utils.FileUtils;
 import com.fdkankan.modeling.constants.RedisKey;
 import com.fdkankan.modeling.constants.SysConstants;
-import com.fdkankan.modeling.entity.*;
+import com.fdkankan.modeling.entity.SceneFileBuild;
+import com.fdkankan.modeling.entity.ScenePro;
+import com.fdkankan.modeling.entity.SceneProExt;
+import com.fdkankan.modeling.entity.User;
 import com.fdkankan.modeling.push.PushMessageConfig;
 import com.fdkankan.modeling.service.*;
 import com.fdkankan.modeling.utils.ComputerUtil;
 import com.fdkankan.modeling.utils.DingDingUtils;
 import com.fdkankan.modeling.utils.PushMsgUtil;
+import com.fdkankan.oss.UploadUtils;
 import com.taobao.api.ApiException;
 import lombok.extern.log4j.Log4j2;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
 import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
 import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
-import org.apache.rocketmq.client.producer.DefaultMQProducer;
-import org.apache.rocketmq.common.message.Message;
 import org.apache.rocketmq.common.message.MessageExt;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -32,8 +34,8 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Component;
 import org.springframework.util.CollectionUtils;
+import org.springframework.util.ObjectUtils;
 import org.springframework.web.client.RestTemplate;
-import com.fdkankan.utils.UploadUtils;
 
 import java.io.*;
 import java.security.InvalidKeyException;
@@ -64,13 +66,6 @@ public class BuildSceneReceiver implements MessageListenerConcurrently {
     private ISceneFileBuildService sceneFileBuildService;
 
     @Autowired
-    private ISceneProEditService sceneProEditService;
-
-
-    @Autowired
-    private ISceneProEditExtService sceneProEditExtService;
-
-    @Autowired
     private ISceneProExtService sceneProExtService;
 
     @Autowired
@@ -78,9 +73,6 @@ public class BuildSceneReceiver implements MessageListenerConcurrently {
 
     private RestTemplate restTemplate = new RestTemplate();
 
-    @Value("${main.url}")
-    private String mainUrl;
-
     @Value("${4dkk.laserService.host}")
     private String laserHost;
 
@@ -90,11 +82,6 @@ public class BuildSceneReceiver implements MessageListenerConcurrently {
     @Value("${oss.url.prefix}")
     private String prefixAli;
 
-    @Value("${scene.pro.mobile.show.url}")
-    private String sceneProNewUrl;
-
-    @Autowired
-    private DefaultMQProducer mqProducer;
 
     @Autowired
     private UploadUtils uploadUtils;
@@ -107,24 +94,23 @@ public class BuildSceneReceiver implements MessageListenerConcurrently {
             return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
         }
         MessageExt messageExt = msgExt.get(0);
-        Object object = JSON.parse(messageExt.getBody());
-        String msg = JSON.toJSONString(object);
-        log.info("开始处理消息,消息队列:{},消息内容:{}", consumeConcurrentlyContext.getMessageQueue().getTopic(), msg);
-        process(msg);
+        BuildSceneMqMessage message = JSONObject.parseObject(messageExt.getBody(), BuildSceneMqMessage.class);
+        log.info("开始处理消息,消息队列:{},消息内容:{}", consumeConcurrentlyContext.getMessageQueue().getTopic(),
+                JSONObject.toJSONString(message));
+        process(message);
         return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
     }
 
-    public void process(String content) {
+    public void process(BuildSceneMqMessage message) {
         final ExecutorService exec = Executors.newFixedThreadPool(1);
         Callable<String> call = (Callable<String>) () -> {
             //开始执行耗时操作
-            String[] strs = content.split(":;");
             try {
-                String key = RedisKey.SCENE_BUILDING + strs[4];
+                String key = RedisKey.SCENE_BUILDING + message.getSceneNum();
                 // 获取缓存锁,防止重复消费
                 Long building = redisTemplate.opsForValue().increment(key, 1);
                 if (building.compareTo(1L) != 0) {
-                    log.error("场景正在构建中,退出构建,当前服务器id:{},参数:{}", SysConstants.hostName, content);
+                    log.error("场景正在构建中,退出构建,当前服务器id:{},参数:{}", SysConstants.hostName, JSONObject.toJSONString(message));
                 } else {
                     redisTemplate.expire(key, Duration.of(SysConstants.modelTimeOut, ChronoUnit.HOURS));
                 }
@@ -132,24 +118,24 @@ public class BuildSceneReceiver implements MessageListenerConcurrently {
                 Thread.sleep(2000L);
                 try {
                     FileUtils.writeFile("/opt/hosts/running.txt", DateUtil.formatDateTime(new Date()));
-                    String tomcatLog = "scenenum:" + content + "\ntime:" + DateUtil.formatDateTime(new Date()) +
+                    String tomcatLog = "scenenum:" + message.getSceneNum() + "\ntime:" + DateUtil.formatDateTime(new Date()) +
                             " action:create hostname:" + SysConstants.hostName;
                     //打开一个写文件器,构造函数中的第二个参数true表示以追加形式写文件
-                    FileWriter writer = new FileWriter("/mnt/elastic_log/tomcat" + "_" + strs[4] + ".log", true);
+                    FileWriter writer = new FileWriter("/mnt/elastic_log/tomcat" + "_" + message.getSceneNum() + ".log", true);
                     writer.write(tomcatLog);
                     writer.close();
                 } catch (Exception e) {
                     e.printStackTrace();
                 }
 
-                BuildSceneReceiver.this.buildScene(content);
+                buildScene(message);
                 redisTemplate.delete(key);
                 try {
                     FileUtils.deleteFile("/opt/hosts/running.txt");
-                    String tomcatLog = "scenenum:" + content + "\ntime:" + DateUtil.formatDateTime(new Date()) +
+                    String tomcatLog = "scenenum:" + message.getSceneNum() + "\ntime:" + DateUtil.formatDateTime(new Date()) +
                             " action:delete hostname:" + SysConstants.hostName;
                     //打开一个写文件器,构造函数中的第二个参数true表示以追加形式写文件
-                    FileWriter writer = new FileWriter("/mnt/elastic_log/tomcat" + "_" + strs[4] + "log", true);
+                    FileWriter writer = new FileWriter("/mnt/elastic_log/tomcat" + "_" + message.getSceneNum() + "log", true);
                     writer.write(tomcatLog);
                     writer.close();
                 } catch (Exception e) {
@@ -157,8 +143,8 @@ public class BuildSceneReceiver implements MessageListenerConcurrently {
                 }
             } catch (Exception e) {
                 e.printStackTrace();
-                sceneProService.updateStatus(strs[4], -1);
-                BuildSceneReceiver.this.handFail("计算失败", content);
+                sceneProService.updateStatus(message.getSceneNum(), -1);
+                BuildSceneReceiver.this.handFail("计算失败", message);
             }
             log.info("场景生成好了***");
             return "success";
@@ -174,7 +160,7 @@ public class BuildSceneReceiver implements MessageListenerConcurrently {
             log.error(trace.toString());
             FileUtils.deleteFile("/opt/hosts/running.txt");
             future.cancel(true);
-            handFail("计算超时",content);
+            handFail("计算超时",message);
         } catch (Exception e) {
             e.printStackTrace();
             StringWriter trace=new StringWriter();
@@ -182,49 +168,41 @@ public class BuildSceneReceiver implements MessageListenerConcurrently {
             log.error(trace.toString());
             FileUtils.deleteFile("/opt/hosts/running.txt");
             future.cancel(true);
-            handFail("计算失败",content);
+            handFail("计算失败",message);
         }
 
     }
 
-    private void buildScene(String content){
+    private void buildScene(BuildSceneMqMessage message){
         String projectNum = null;
         SceneFileBuild sceneFileBuildEntity = null;
         ScenePro scene = null;
         SceneProExt sceneProExt = null;
         try{
-            String[] strs  = content.split(":;");
-
-            if(strs.length == 1){
+            if(StringUtils.equals(message.getIsStandardization(),"1")){
                 //表示标定算法
-                Map<String,String> map = ComputerUtil.computerCalibration(strs[0]);
+                ComputerUtil.computerCalibration(message.getPath());
                 return;
             }
 
-            String unicode = strs[0];
-            String path = strs[1];
-            String prefix = strs[2];
-            String imgsName = strs[3];
-            projectNum = strs[4];
-            String userName = strs[6];
+            String unicode = message.getUnicode();
+            String path = message.getPath();
+            String prefix = message.getPrefix();
+            String imgsName = message.getImgsName();
+            projectNum = message.getSceneNum();
+            String userName = message.getUserName();
             //不同的相机不同的方法
-            String cameraType = strs[7];
-            String algorithm = strs[8];
-            String fileId = strs[9];
-            String cameraName = strs[10];
+            String cameraType = message.getCameraType();
+            String algorithm = message.getAlgorithm();
+            String fileId = message.getFileId();
+            String cameraName = message.getCameraName();
             //0表示有4k图,1表示没有
-            String resolution = strs[11];
+            String resolution = message.getResolution();
 
             //判断调用V2还是V3版本的算法
-            String buildType = "V2";
-            if(strs.length >= 13){
-                buildType = strs[12];
-            }
+            String buildType = ObjectUtils.isEmpty(message.getBuildType()) ? "V2" : message.getBuildType();
+
 
-            String rebuild = "0";
-            if(strs.length >= 14){
-                rebuild = strs[13];
-            }
             log.info("执行数据库操作--前");
             sceneFileBuildEntity = sceneFileBuildService.findByFileId(fileId);
             log.info("执行数据库操作--后");
@@ -237,7 +215,6 @@ public class BuildSceneReceiver implements MessageListenerConcurrently {
 
             log.info("用的算法是:"+algorithm);
             log.info("用的相机是:"+ (Integer.parseInt(cameraType) < 4 ? "单球目" : "双球目(八目)"));
-            String isModel = strs[5];
             Map<String,String> map = new HashMap<>();
 
             //该场景使用的容量
@@ -295,7 +272,7 @@ public class BuildSceneReceiver implements MessageListenerConcurrently {
                 sceneProExt = sceneProExtService.lambdaQuery().eq(SceneProExt::getSceneProId, scene.getId()).getEntity();
                 if(scene == null){
                     log.info(projectNum + ":场景不存在");
-                    handFail("场景不存在",content);
+                    handFail("场景不存在",message);
                     return;
                 }
 
@@ -623,7 +600,7 @@ public class BuildSceneReceiver implements MessageListenerConcurrently {
                         log.info("激光转台相机 同步结束 :" + hotListJson);
                     }catch (Exception e){
                         e.printStackTrace();
-                        handFail("激光转台相机同步失败",content);
+                        handFail("激光转台相机同步失败",message);
                     }
                 }
             }
@@ -641,7 +618,7 @@ public class BuildSceneReceiver implements MessageListenerConcurrently {
             StringWriter trace=new StringWriter();
             e.printStackTrace(new PrintWriter(trace));
             log.error(trace.toString());
-            handFail("计算失败",content);
+            handFail("计算失败",message);
         }finally {
             try{
                 scene = sceneProService.findBySceneNum(projectNum);
@@ -676,156 +653,9 @@ public class BuildSceneReceiver implements MessageListenerConcurrently {
         }
     }
 
-    private void kanfangBuild(String content){
-
-        JSONObject json = JSONObject.parseObject(content);
-        String sceneName = json.getString("sceneName");
-        String sceneNum = json.getString("sceneNum");
-
-        // 获取缓存锁,防止重复消费
-        Long building = redisTemplate.opsForValue().increment(RedisKey.SCENE_BUILDING + sceneNum, 1);
-        if (building.compareTo(1L) != 0) {
-            log.error("场景正在构建中,退出构建,当前服务器id:{},参数:{}", SysConstants.hostName,content);
-            return;
-        }
-
-        int sceneScheme = json.getIntValue("sceneScheme");
-        long userId = json.getLong("userId");
-        String dataSource = json.getString("dataSource");
-        String queue = json.getString("callbackQueue");
-        log.info("sceneName: {}, sceneNum: {}, sceneScheme: {}, userId: {}, dataSource:{}, queue:{}",
-                sceneName, sceneNum, sceneScheme, userId, dataSource, queue);
-
-        JSONObject result = new JSONObject();
-        result.put("sceneNum", sceneNum);
-
-        try{
-            ScenePro scenePro = sceneProService.findBySceneNum(sceneNum);
-
-            if(scenePro == null){
-                scenePro = new ScenePro();
-                SceneProExt sceneProExt = new SceneProExt();
-
-                sceneProExt.setDataSource(dataSource);
-                scenePro.setSceneName(sceneName);
-                scenePro.setSceneCode(sceneNum);
-                scenePro.setUserId(userId);
-                scenePro.setSceneScheme(sceneScheme);
-                sceneProExt.setSceneStatus(0);
-                scenePro.setWebSite(mainUrl + sceneProNewUrl + sceneNum);
-                sceneProExt.setPayStatus(1);
-                scenePro.setBuildType("V3");
-                sceneProExt.setSceneSource(12);
-                scenePro.setSceneDec("<p>快速打造3D空间模型,让三维数字技术服务于生活。</p>");
-                sceneProService.save(scenePro);
-                sceneProExtService.save(sceneProExt);
-
-                SceneProEdit sceneEdit = new SceneProEdit();
-                SceneProEditExt sceneEditExt = new SceneProEditExt();
-                sceneEdit.setNeedKey(0);
-
-                sceneEdit.setProId(scenePro.getId());
-                sceneEditExt.setMapVisi(1);
-                sceneEditExt.setTourVisi(1);
-                sceneEditExt.setVrVisi(1);
-                sceneEditExt.setRulerVisi(1);
-                sceneEditExt.setCadImgVisi(1);
-                sceneEditExt.setPanoVisi(1);
-                sceneEditExt.setM2dVisi(1);
-                sceneEditExt.setM3dVisi(1);
-                sceneEditExt.setMeasureVisi(0);
-                sceneEdit.setFloorLogoSize(100);
-                sceneEdit.setCreateTime(new Date());
-                sceneProEditService.save(sceneEdit);
-                sceneProEditExtService.save(sceneEditExt);
-
-                //生成二维码logo
-                restTemplate.getForObject(mainUrl + "api/scene/createSketchQrLogo?sceneNum=" + sceneNum,String.class);
-            }else {
-
-                SceneProExt sceneProExt = sceneProExtService.lambdaQuery()
-                        .eq(SceneProExt::getSceneProId,scenePro.getId()).getEntity();
-
-                sceneProExt.setDataSource(dataSource);
-                scenePro.setSceneName(sceneName);
-                scenePro.setSceneCode(sceneNum);
-                scenePro.setUserId(userId);
-                scenePro.setSceneScheme(sceneScheme);
-                sceneProExt.setSceneStatus(0);
-                scenePro.setWebSite(mainUrl + sceneProNewUrl + sceneNum);
-                sceneProExt.setPayStatus(1);
-                scenePro.setBuildType("V3");
-                sceneProExt.setSceneSource(12);
-                sceneProService.updateById(scenePro);
-                sceneProExtService.updateById(sceneProExt);
-
-                SceneProEdit sceneEdit = sceneProEditService.lambdaQuery()
-                        .eq(SceneProEdit::getProId,scenePro.getId()).getEntity();
-
-                SceneProEditExt sceneProEditExt = sceneProEditExtService.lambdaQuery()
-                        .eq(SceneProEditExt::getProEditId,sceneEdit.getId()).getEntity();
-
-                sceneEdit.setNeedKey(0);
-
-                sceneEdit.setProId(scenePro.getId());
-                sceneEdit.setVersion(sceneEdit.getVersion() + 1);
-                sceneProEditExt.setImagesVersion(sceneProEditExt.getImagesVersion() + 1);
-                sceneEdit.setFloorEditVer(sceneEdit.getFloorEditVer() + 1);
-                sceneEdit.setFloorPublishVer(sceneEdit.getFloorPublishVer() + 1);
-                sceneEdit.setUpdateTime(new Date());
-                sceneProEditService.updateById(sceneEdit);
-                sceneProEditExtService.updateById(sceneProEditExt);
-            }
-
-
-            com.alibaba.fastjson.JSONObject scenejson = com.alibaba.fastjson.JSONObject.parseObject(com.alibaba.fastjson.JSONObject.toJSONString(scenePro));
-            FileUtils.writeFile(ConstantFilePath.SCENE_PATH+"data/data"+sceneNum+File.separator+"scene.json", scenejson.toString());
-
-            //计算模型并返回需要上传oss的文件集合
-            Map map = ComputerUtil.computer(sceneNum, dataSource, "V3");
-            uploadUtils.uploadMulFiles(map);
-
-            sceneProService.updateStatus(sceneNum, -2);
-
-            log.info("计算完成,发送mq通知123看房");
-
-            result.put("result", 1);
-            result.put("code", 0);
-            result.put("msg", "计算完成");
-            Message msg = new Message(queue,JSONObject.toJSONString(result).getBytes());
-            mqProducer.send(msg);
-        }catch (Exception e){
-            sceneProService.updateStatus(sceneNum, -1);
-
-            log.info("计算失败,发送mq通知123看房");
-
-            result.put("result", 0);
-            result.put("code", 500);
-            result.put("msg", "计算失败");
-
-            Message msg = new Message(queue,JSONObject.toJSONString(result).getBytes());
-            try {
-                mqProducer.send(msg);
-            } catch (Exception ee) {
-                ee.printStackTrace();
-            }
-            handFail("看房场景计算失败",dataSource,sceneNum);
-        }
-    }
-
-    private void handFail(String reason,String content){
-        String serverPath = "";
-        String num = "";
-        if(content.contains(":;")){
-            String[] strs  = content.split(":;");
-            serverPath = strs[1].substring(0,strs[1].lastIndexOf("/")+1).concat(strs[2]);
-            num = strs[4];
-        }else{
-            JSONObject json = JSONObject.parseObject(content);
-            num = json.getString("sceneNum");
-            serverPath = json.getString("dataSource");
-        }
-        handFail(reason,serverPath,num);
+    private void handFail(String reason,BuildSceneMqMessage message){
+        String serverPath = message.getPath().substring(0,message.getPath().lastIndexOf("/")+1).concat(message.getPrefix());
+        handFail(reason,serverPath,message.getSceneNum());
     }
 
     private void handFail(String reason,String serverPath,String num){

+ 4 - 4
4dkankan-center-modeling/src/main/java/com/fdkankan/modeling/utils/ComputerUtil.java

@@ -2,10 +2,10 @@ package com.fdkankan.modeling.utils;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.fdkankan.common.constant.ConstantFileName;
-import com.fdkankan.common.constant.ConstantFilePath;
-import com.fdkankan.common.utils.CreateObjUtil;
-import com.fdkankan.common.utils.FileUtils;
+import com.fdkankan.utils.constant.ConstantFileName;
+import com.fdkankan.utils.constant.ConstantFilePath;
+import com.fdkankan.utils.utils.CreateObjUtil;
+import com.fdkankan.utils.utils.FileUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
 

+ 1 - 1
4dkankan-center-modeling/src/main/java/com/fdkankan/modeling/utils/DingDingUtils.java

@@ -4,7 +4,7 @@ import com.dingtalk.api.DefaultDingTalkClient;
 import com.dingtalk.api.DingTalkClient;
 import com.dingtalk.api.request.OapiRobotSendRequest;
 import com.dingtalk.api.response.OapiRobotSendResponse;
-import com.fdkankan.common.utils.Base64Converter;
+import com.fdkankan.utils.utils.Base64Converter;
 import com.fdkankan.modeling.constants.SysConstants;
 import com.taobao.api.ApiException;
 import org.slf4j.Logger;

+ 1 - 1
4dkankan-center-modeling/src/main/java/com/fdkankan/modeling/utils/PushMsgUtil.java

@@ -1,6 +1,6 @@
 package com.fdkankan.modeling.utils;
 
-import com.fdkankan.common.constant.ConstantFilePath;
+import com.fdkankan.utils.constant.ConstantFilePath;
 import com.google.auth.oauth2.GoogleCredentials;
 import com.google.firebase.FirebaseApp;
 import com.google.firebase.FirebaseOptions;

+ 6 - 0
4dkankan-center-scene/pom.xml

@@ -40,6 +40,12 @@
             <scope>test</scope>
         </dependency>
 
+        <dependency>
+            <groupId>com.fdkankan</groupId>
+            <artifactId>4dkankan-common-mq</artifactId>
+            <version>2.0.0</version>
+        </dependency>
+
     </dependencies>
 
 <!--    <build>-->

+ 32 - 0
4dkankan-center-scene/src/test/java/com/fdkankan/SceneApplicationTests.java

@@ -0,0 +1,32 @@
+package com.fdkankan;
+
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.common.rocketmq.producer.MqSendMessage;
+import com.fdkankan.mq.message.BuildSceneMqMessage;
+import com.fdkankan.scene.service.IFolderService;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.context.annotation.ComponentScan;
+
+@SpringBootTest
+@ComponentScan("*")
+class SceneApplicationTests {
+
+    @Test
+    void contextLoads() {
+    }
+
+    @Autowired
+    private MqSendMessage mqSendMessage;
+
+    @Autowired
+    private IFolderService folderService;
+
+    @Test
+    public void test(){
+        BuildSceneMqMessage message = new BuildSceneMqMessage();
+        mqSendMessage.sendMessage(JSONObject.toJSONString(message));
+    }
+
+}

+ 0 - 49
4dkankan-common-db/src/main/java/com/fdkankan/common/constant/ConstantFilePath.java

@@ -1,49 +0,0 @@
-package com.fdkankan.common.constant;
-
-public class ConstantFilePath {
-    public static final String BASE_PATH = "/mnt/4Dkankan";
-    //论坛上传图片后,服务器存放的地址
-    public static final String BBS_IMAGES_PATH = "/mnt/4Dkankan/bbs/upload/image/";
-    // 用户上传图片
-    public static final String USER_IMAGES_PATH = "/mnt/4Dkankan/user/";
-    // 图片暂存地址(创建二维码等)
-    public static final String TEMP_IMAGES_PATH = "/mnt/4Dkankan/temp/upload/image/";
-    // 场景
-    public static final String SCENE_PATH = "/mnt/4Dkankan/scene/";
-    // 代理商
-    public static final String AGENT_PATH = "/mnt/4Dkankan/agent/";
-    //电子发票
-    public static final String INVOICE_PATH = "/mnt/4Dkankan/invoice/";
-    // 场景二维码
-    public static final String SCENE_QR_CODE_PATH = "/mnt/4Dkankan/sceneQRcode/";
-    // excel
-    public static final String EXCEL_PATH = "/mnt/4Dkankan/excel/";
-    //    public static final String EXCEL_PATH = "F:\\excel\\";
-    // medias
-    public static final String MEDIAS_PATH = "/mnt/4Dkankan/medias/";
-    // logo
-    public static final String LOGO_PATH = "/mnt/4Dkankan/logo/";
-    // login qr code
-    public static final String LOGIN_QR_CODE_PATH = "/mnt/4Dkankan/login/qrcode/";
-
-    public static final String WEIXIN_CERT = "/mnt/home/ubuntu/user/apiclient_cert.p12";
-
-    public static final String PREFIX = "/home/user";
-    public static final String CREATE_MODEL_PATH = PREFIX + "/photo_data/model/";
-    //大场景
-    public static final String CREATE_BIG_SCENE_PATH = PREFIX + "/photo_data/bigscene/";
-    //生成模型的路径
-    public static final String BUILD_MODEL_PATH = "/mnt/data/";
-    //生成模型的路径
-    public static String BUILD_MODEL_LASER_PATH ="/mnt-laser/data/";
-
-    //支付二维码图片存放路径
-    public static final String ALI_QRCODE_FOLDER = "/mnt/4Dkankan/alicode/";
-    public static final String WEIXIN_QRCODE_FOLDER = "/mnt/4Dkankan/weixincode/";
-
-    public static final String OSS_PREFIX = "home/";
-
-    public void setHardDiskLaser(String value){
-        ConstantFilePath.BUILD_MODEL_LASER_PATH = value;
-    }
-}

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 7340
4dkankan-common-db/src/main/java/com/fdkankan/common/proto/BigSceneProto.java


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 4654
4dkankan-common-db/src/main/java/com/fdkankan/common/proto/Common.java


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 1333
4dkankan-common-db/src/main/java/com/fdkankan/common/proto/format/XmlFormat.java


+ 0 - 65
4dkankan-common-db/src/main/java/com/fdkankan/common/utils/Base64Converter.java

@@ -1,65 +0,0 @@
-package com.fdkankan.common.utils;
-
-import java.io.UnsupportedEncodingException;
-import java.util.Base64;
-
-public class Base64Converter {
-
-    public final static Base64.Encoder encoder = Base64.getEncoder();
-    final static Base64.Decoder decoder = Base64.getDecoder();
-
-    /**
-     * 给字符串加密
-     * @param text
-     * @return
-     */
-    public static String encode(String text) {
-        byte[] textByte = new byte[0];
-        try {
-            textByte = text.getBytes("UTF-8");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-        String encodedText = encoder.encodeToString(textByte);
-        return encodedText;
-    }
-
-    /**
-     * 给字符串加密
-     * @param textByte
-     * @return
-     */
-    public static String encode(byte[] textByte) {
-        return encoder.encodeToString(textByte);
-    }
-
-    /**
-     * 将加密后的字符串进行解密
-     * @param encodedText
-     * @return
-     */
-    public static String decode(String encodedText) {
-        String text = null;
-        try {
-            text = new String(decoder.decode(encodedText), "UTF-8");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-        return text;
-    }
-
-    /**
-     * 根据逻辑截取加密后的密码
-     * @param text
-     * @return
-     */
-    public static String subText(String text){
-        //去掉前8位字符串
-        text = text.substring(8);
-        //去掉后8位字符串
-        text = text.substring(0, text.length() - 8);
-        //最后两个字符串换到前面,并且去掉剩下的后8位字符串
-        String result = text.substring(text.length() - 2) + text.substring(0, text.length() - 10);
-        return result;
-    }
-}

+ 0 - 55
4dkankan-common-db/src/main/java/com/fdkankan/common/utils/ConstantCmd.java

@@ -1,55 +0,0 @@
-package com.fdkankan.common.utils;
-
-public class ConstantCmd {
-
-	//生成模型的命令
-	public static final String BUILD_MODEL_COMMAND = "bash /home/ubuntu/bin/Launcher.sh ";
-
-	//生成模型的命令
-	public static final String BUILD_MODEL_COMMAND2 = "bash /opt/ossutil/sshoss.sh ";
-
-	public static final String BUILD_MODEL_OLD_COMMAND = "bash /home/ubuntu/bin_old/Launcher.sh ";
-	public static final String BUILD_MODEL_SFM_COMMAND = "bash /home/ubuntu/run_sfm.sh ";
-
-	public static final String OBJ_TO_TXT = "bash /home/ubuntu/bin_old/obj2txt.sh ";
-
-	public static final String REBUILD_MODEL_FLLOR = "bash /home/ubuntu/bin/Panoramix_Floorplan.sh ";
-	//切图命令
-	public static final String CUT_IMG_COMMAND = "bash /home/ubuntu/OpenSfM/bin/run_cube.sh ";
-	//调整图片的命令
-	public static final String ADJUST_IMG_COMMAND = "/home/ubuntu/OpenSfM/bin/run_skybox ";
-	  
-	  
-	  
-	//转台拼图命令
-	public static final String BUILD_PANORAMA = "AutopanoGiga /home/ubuntu/data/";
-	//六目,拼图,计算,切图(二代)
-	public static final String BUILD_FOR_SIX = "bash /home/ubuntu/run_all_m6.sh ";
-
-	//合并音频
-	public static final String MERGE_VIDEO = "bash /monchickey/ffmpeg/bin/ff_synthesis.sh ";
-
-	//生成一段静音音频
-	public static final String CREATE_MUTE_VIDEO = "bash /monchickey/ffmpeg/bin/ff_mtue.sh ";
-
-	//将mp4文件转换成flv
-	public static final String MP4_TO_FLV = "bash /monchickey/ffmpeg/bin/ff_mp4TOflv.sh ";
-
-	//删除/mnt/data/下的数据脚本
-	public static final String DELETE_FILE = "bash /monchickey/ffmpeg/bin/delete.sh ";
-
-	public static final String OSS_UTIL_CP ="bash /opt/ossutil/oss.sh ";
-
-	public static final String OSS_FILE_CP = "bash /opt/ossutil/file.sh ";
-
-	public static final String MATTERPRO_CUT_IMG = "node /opt/4dkankan_scene/index.js ";
-
-	//激光相机 extra迁移
-	public static final String CP_JG_EXTRA = "bash /opt/ossutil/laser-copy.sh ";
-
-	public static final String CP_JG_ALL = "bash /opt/ossutil/laser-cp-r.sh ";
-
-	// 修改户型图json文件
-	public static final String TRANSLATE_HOUST_FLOOR = "/opt/Robin/JsonRead.out ";
-
-}

+ 0 - 602
4dkankan-common-db/src/main/java/com/fdkankan/common/utils/CreateObjUtil.java

@@ -1,602 +0,0 @@
-package com.fdkankan.common.utils;
-
-import com.fdkankan.common.constant.ConstantFileName;
-import com.fdkankan.common.constant.ConstantFilePath;
-import com.fdkankan.common.proto.BigSceneProto;
-import com.fdkankan.common.proto.Common;
-import com.fdkankan.common.proto.Visionmodeldata;
-import com.fdkankan.common.proto.format.JsonFormat;
-import com.google.protobuf.TextFormat;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.util.StopWatch;
-
-import java.io.*;
-import java.util.HashMap;
-import java.util.Map;
-
-public class CreateObjUtil {
-
-	private static Logger log = LoggerFactory.getLogger(CreateObjUtil.class);
-
-	public void saveuploadImgs(String folderName) throws IOException, Exception
-	{
-		log.info("开始计算");
-		String command = "bash /home/ubuntu/photoscan-pro/build_model.sh "+folderName;
-		callshell(command);
-		boolean flag = false;
-		String sPath =  ConstantFilePath.CREATE_MODEL_PATH+folderName+File.separator+"mesh"+File.separator+"mesh.obj";
-		while(!flag)
-		{
-			flag = isModel(sPath,folderName);
-		}
-		log.info("计算完毕");
-	}
-	
-	public void saveuploadImgs2(String folderName) throws IOException, Exception
-	{
-		log.info("开始计算");
-		String command = "bash /home/ubuntu/photoscan-pro/build_bigscene.sh "+folderName;
-		callshell(command);
-		boolean flag = false;
-		String sPath = ConstantFilePath.CREATE_BIG_SCENE_PATH+folderName+File.separator+"mesh"+File.separator+"mesh.obj";
-		while(!flag)
-		{
-			flag = isModel(sPath,folderName);
-		}
-		log.info("计算完毕");
-		log.info("obj和camera转换成大场景要的格式");
-		convertobjTotxt( folderName);
-		
-	}
-
-	//开始建模
-	public static void unRar(String rarPath,String dataPath) throws Exception{
-		log.info("解压rar开始");
-		String command = "unrar e " + rarPath + " " + dataPath;
-		callshell(command);
-		log.info("解压rar完毕:" + command);
-	}
-
-	public static void unZip(String zipPath,String dataPath) throws Exception{
-		log.info("解压zip开始");
-		String command = "unzip -O GBK/GB18030CP936 " + zipPath + " -d " + dataPath;
-		callshell(command);
-		log.info("解压zip完毕:" + command);
-	}
-
-	//开始建模
-	public static void build3dModel(String folderName,String isModel) throws Exception{
-		log.info("开始建模");
-		String command = ConstantCmd.BUILD_MODEL_COMMAND+folderName;
-		callshell(command);
-		log.info("计算完毕:" + command);
-	}
-
-	//开始建模
-	public static void build3dModel2(String folderName,String isModel) throws Exception{
-		log.info("开始建模");
-		String command = ConstantCmd.BUILD_MODEL_COMMAND2+folderName;
-		callshell(command);
-		log.info("计算完毕:" + command);
-	}
-
-	//开始建模
-	public static void build3dModelOld(String folderName,String isModel) throws Exception{
-		log.info("开始v2建模");
-		String command = ConstantCmd.BUILD_MODEL_OLD_COMMAND+folderName;
-		callshell(command);
-		log.info("计算v2完毕:" + command);
-	}
-
-	//开始建模
-	public static void translateHoustfloorJSONFile(String filePath,String outputPath) throws Exception{
-		log.info("开始转换houst_floor.json");
-		String command = ConstantCmd.TRANSLATE_HOUST_FLOOR + filePath + " " + outputPath;
-		callshell(command);
-		log.info("转换houst_floor.json 结束");
-	}
-
-	//激光相机复制资源
-	public static void cpfile(String filepathOld,String filepathNew) throws Exception{
-		log.info("开始复制");
-		String command = ConstantCmd.CP_JG_EXTRA+ " " + filepathOld + " " + filepathNew;
-		callshell(command);
-		log.info("复制完毕:" + command);
-	}
-
-
-	//激光相机复制资源laser下的全部资源
-	public static void cplaserfile(String filepathOld,String filepathNew) throws Exception{
-		log.info("开始复制");
-		String command = ConstantCmd.CP_JG_ALL+ " " + filepathOld + " " + filepathNew;
-		callshell(command);
-		log.info("复制完毕:" + command);
-	}
-	
-	//开始建模
-	public void build3dModelSFM(String folderName,String isModel) throws Exception{
-		log.info("开始建模");
-		String command = ConstantCmd.BUILD_MODEL_SFM_COMMAND+folderName+" "+isModel;
-		callshell(command);
-		log.info("计算完毕");
-	}
-
-	//obj文件转换问txt
-	public static void objToTxt(String folderName,String isModel) throws Exception{
-		log.info("obj2txt开始转换");
-		String command = ConstantCmd.OBJ_TO_TXT+folderName;
-		callshell(command);
-		log.info("转换完毕:" + command);
-	}
-
-	public void rebuildModelFllor(String folderName, String isModel) {
-		try{
-			log.info("开始建模");
-			String command = ConstantCmd.REBUILD_MODEL_FLLOR+folderName+" "+isModel;
-			callshell(command);
-			log.info("计算完毕");
-		}
-		catch(Exception e)
-		{
-			e.printStackTrace();
-		}
-	}
-
-	//切图
-	public void cutImgs(String[] imgNames ,String folderName)
-	{
-		try{
-			log.info("开始切图");
-			for(int i=0;i<imgNames.length;++i)
-			{
-				String imgName=imgNames[i].replace(".jpg", "");
-				String command = ConstantCmd.CUT_IMG_COMMAND+folderName+" "+imgName;
-				callshell(command);
-			}
-			log.info("切图完毕");
-		}
-		catch(Exception e)
-		{
-			e.printStackTrace();
-		}
-	}
-	
-	//调整切图
-	public void adjustImgs(String folderName)
-	{
-		try{
-			String command = ConstantCmd.ADJUST_IMG_COMMAND + folderName;
-			log.info("开始调整图片");
-			callshell(command);
-			log.info("调整图片完毕");
-		}
-		catch(Exception e)
-		{
-			e.printStackTrace();
-		}
-	}
-	
-	//obj和camera转换成大场景要的格式
-	public void convertobjTotxt(String folderName) throws Exception
-	{
-		//obj
-		String command = "/home/ubuntu/photoscan-pro/main/mesh/mesh "+folderName;
-		callshell(command);
-		//camera
-		command = "/home/ubuntu/photoscan-pro/main/read_camera/read_camera "+folderName;
-		callshell(command);
-		
-		String prefix = ConstantFilePath.CREATE_BIG_SCENE_PATH+folderName+File.separator+"data"+File.separator;
-		String srcpath = prefix +"mesh.txt";
-		String despath = prefix +"dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam";
-				
-		convertTxtToDam( srcpath, despath);
-		//dam转换成lzma
-		command = "lzma /home/ubuntu/photo_data/bigscene/"+folderName+"/data/dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam";
-		callshell(command);
-		
-		srcpath = prefix +"vision.txt";
-		despath = prefix +"vision.modeldata";
-		convertTxtToVisionmodeldata( srcpath, despath);
-	}
-
-	public static void convertDamToLzma(String folderName)throws Exception
-	{
-		try
-		{
-			String command = "lzma "+ folderName+File.separator+ ConstantFileName.modelUUID+"_50k.dam";
-			log.info("开始转换lzma");
-			callshell(command);
-			log.info("转换lzma完毕");
-		}
-		catch(Exception e)
-		{
-			StringWriter trace=new StringWriter();
-			e.printStackTrace(new PrintWriter(trace));
-			log.error(trace.toString());
-		}
-
-	}
-
-	public static void convertDamToLzma2(String folderName)throws Exception
-	{
-		try
-		{
-			String command = "lzma "+ folderName+File.separator+ ConstantFileName.modelUUID+"_50k2.dam";
-			log.info("开始转换lzma");
-			callshell(command);
-			log.info("转换lzma完毕");
-		}
-		catch(Exception e)
-		{
-			StringWriter trace=new StringWriter();
-			e.printStackTrace(new PrintWriter(trace));
-			log.error(trace.toString());
-		}
-
-	}
-	
-	public static void convertTxtToDam(String srcpath,String despath)throws Exception
-	{
-			BigSceneProto.binary_mesh.Builder builder= BigSceneProto.binary_mesh.newBuilder();
-			InputStream inputStream = new FileInputStream(srcpath);
-			InputStreamReader reader = new InputStreamReader(inputStream, "ASCII");
-			TextFormat.merge(reader, builder);
-			byte[] buf= builder.build().toByteArray();
-			
-			 //把序列化后的数据写入本地磁盘  
-	        ByteArrayInputStream stream = new ByteArrayInputStream(buf);  
-	        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(despath));//设置输出路径  
-	        BufferedInputStream bis = new BufferedInputStream(stream);  
-	        int b = -1;  
-	        while ((b = bis.read()) != -1) {  
-	            bos.write(b);  
-	        }  
-	        bis.close();  
-	        bos.close();
-	}
-	
-	public static void convertVisionmodeldataToTxt(String srcpath,String despath)throws Exception
-	{
-		try
-		{
-			File file = new File(srcpath); 
-			FileInputStream fis=new FileInputStream(file);
-
-			Visionmodeldata.NavigationInfo data_NavigationInfo = Visionmodeldata.NavigationInfo.parseFrom(fis);
-	
-			//PrintStream out = new PrintStream(despath); 
-			String jsonFormat1 = JsonFormat.printToString(data_NavigationInfo);
-			ByteArrayInputStream stream = new ByteArrayInputStream(jsonFormat1.getBytes());  
-	        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(despath));//设置输出路径  
-	        BufferedInputStream bis = new BufferedInputStream(stream);  
-	        int b = -1;  
-	        while ((b = bis.read()) != -1) {  
-	           bos.write(b);  
-	        }  
-			//out.close();
-	        bis.close();  
-	        bos.close(); 
-		}
-		catch(Exception e)
-		{
-			StringWriter trace=new StringWriter();
-	        e.printStackTrace(new PrintWriter(trace));
-	        log.error(trace.toString());
-		}
-	}
-	
-	public static void convertTxtToVisionmodeldata(String srcpath,String despath)throws Exception
-	{
-		try
-		{
-			Visionmodeldata.NavigationInfo.Builder builder = Visionmodeldata.NavigationInfo.newBuilder();
-			String jsonFormat = readTxtFileToJson(srcpath);
-			JsonFormat.merge(jsonFormat, builder);
-			byte[] buf= builder.build().toByteArray();
-			
-			 //把序列化后的数据写入本地磁盘  
-	        ByteArrayInputStream stream = new ByteArrayInputStream(buf);  
-	        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(despath));//设置输出路径  
-	        BufferedInputStream bis = new BufferedInputStream(stream);  
-	        int b = -1;  
-	        while ((b = bis.read()) != -1) {  
-	           bos.write(b);  
-	        }  
-	        bis.close();  
-	        bos.close(); 
-		}
-		catch(Exception e)
-		{
-			StringWriter trace=new StringWriter();
-	        e.printStackTrace(new PrintWriter(trace));
-	        log.error(trace.toString());
-		}
-	}
-
-	public static void convertVisionmodeldataToTxtCommon(String srcpath,String despath)throws Exception
-	{
-		try
-		{
-			File file = new File(srcpath);
-			FileInputStream fis=new FileInputStream(file);
-
-			Common.NavigationInfo data_NavigationInfo = Common.NavigationInfo.parseFrom(fis);
-
-			//PrintStream out = new PrintStream(despath);
-			String jsonFormat1 = JsonFormat.printToString(data_NavigationInfo);
-			ByteArrayInputStream stream = new ByteArrayInputStream(jsonFormat1.getBytes());
-			BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(despath));//设置输出路径
-			BufferedInputStream bis = new BufferedInputStream(stream);
-			int b = -1;
-			while ((b = bis.read()) != -1) {
-				bos.write(b);
-			}
-			//out.close();
-			bis.close();
-			bos.close();
-		}
-		catch(Exception e)
-		{
-			StringWriter trace=new StringWriter();
-			e.printStackTrace(new PrintWriter(trace));
-			log.error(trace.toString());
-		}
-	}
-
-	public static void convertTxtToVisionmodeldataCommon(String srcpath,String despath)throws Exception
-	{
-		try
-		{
-			Common.NavigationInfo.Builder builder = Common.NavigationInfo.newBuilder();
-			String jsonFormat = readTxtFileToJson(srcpath);
-			JsonFormat.merge(jsonFormat, builder);
-			byte[] buf= builder.build().toByteArray();
-
-			//把序列化后的数据写入本地磁盘
-			ByteArrayInputStream stream = new ByteArrayInputStream(buf);
-			BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(despath));//设置输出路径
-			BufferedInputStream bis = new BufferedInputStream(stream);
-			int b = -1;
-			while ((b = bis.read()) != -1) {
-				bos.write(b);
-			}
-			bis.close();
-			bos.close();
-		}
-		catch(Exception e)
-		{
-			StringWriter trace=new StringWriter();
-			e.printStackTrace(new PrintWriter(trace));
-			log.error(trace.toString());
-		}
-	}
-	
-	public static void callshell(String command)
-	{ 
-        try {
-			 StopWatch stopWatch = new StopWatch();
-			 stopWatch.start();
-			 Process process = Runtime.getRuntime().exec(command);
-        	 StreamGobbler errorGobbler = new StreamGobbler(process.getErrorStream(), "ERROR");
-             errorGobbler.start();  
-             StreamGobbler outGobbler = new StreamGobbler(process.getInputStream(), "STDOUT");  
-             outGobbler.start();  
-             process.waitFor();
-			log.info("脚本{}执行完毕,用时:{}",command,stopWatch.toString());
-        } catch (Exception e) {  
-            e.printStackTrace();  
-        }  
-	}
-	
-	public static int doWaitFor(Process process) {
-		  InputStream in = null;
-		  InputStream err = null;
-		  int exitValue = -1; // returned to caller when p is finished
-		  try {
-		    in = process.getInputStream();
-		    err = process.getErrorStream();
-		    boolean finished = false; // Set to true when p is finished
-		    while (!finished) {
-		      try {
-		        while (in.available() > 0) {
-		          // Print the output of our system call
-		          Character c = new Character((char) in.read());
-		          System.out.print(c);
-		        }
-		        while (err.available() > 0) {
-		          // Print the output of our system call
-		          Character c = new Character((char) err.read());
-		          System.out.print(c);
-		        }
-		        // Ask the process for its exitValue. If the process
-		        // is not finished, an IllegalThreadStateException
-		        // is thrown. If it is finished, we fall through and
-		        // the variable finished is set to true.
-		        exitValue = process.exitValue();
-		        finished = true;
-		      } catch (IllegalThreadStateException e) {
-		        // Process is not finished yet;
-		        // Sleep a little to save on CPU cycles
-		        Thread.currentThread().sleep(500);
-		      }
-		    }
-		  } catch (Exception e) {
-		    e.printStackTrace();
-		  } finally {
-		    try {
-		      if (in != null) {
-		        in.close();
-		      }
-		    } catch (IOException e) {
-		      e.printStackTrace();
-		    }
-		    if (err != null) {
-		      try {
-		        err.close();
-		      } catch (IOException e) {
-		        e.printStackTrace();
-		      }
-		    }
-		  }
-		  return exitValue;
-		}
-
-	
-	private boolean isModel(String sPath,String folderName)
-	{
-		boolean flag = false;  
-		File file = new File(sPath);  
-	    if (file.isFile() && file.exists()) {  
-	        flag = true;  
-	    }  
-	    log.info("等待...");
-	    return flag;  
-	}
-	
-	public static String readTxtFileToJson(String filePath){
-        try { 
-                String encoding="UTF-8"; 
-                File file=new File(filePath); 
-                if(file.isFile() && file.exists()){ 
-                    InputStreamReader read = new InputStreamReader( 
-                    new FileInputStream(file),encoding);
-                    BufferedReader bufferedReader = new BufferedReader(read); 
-                    String lineTxt = null; 
-                    String result="";
-                    while((lineTxt = bufferedReader.readLine()) != null){ 
-                    	result+=lineTxt;
-                        //log.info(lineTxt); 
-                    } 
-                    read.close(); 
-                    return result;
-        }else{ 
-            return null;
-        } 
-        } catch (Exception e) { 
-            e.printStackTrace(); 
-            return null;
-        } 
-      
-    }
-	
-	public Map<String,String> getAllFile(String dPath,String prefix)
-	{
-		File dirFile = new File(dPath);
-	    if (!dirFile.isDirectory()) {
-        }
-	    Map<String,String> map = new HashMap<String,String>();
-	    File[] files = dirFile.listFiles();
-	    for (int i = 0; i < files.length; i++) {
-            if (files[i].isFile()) {
-            	String path = files[i].getPath();
-            	map.put(path, prefix+path.substring(path.lastIndexOf("/")+1));
-            }
-        }
-	    return map;
-	}
-	
-	public Map<String,String> getchildFile(String dPath,String prefix,String childname)
-	{
-		File dirFile = new File(dPath+File.separator+childname);
-	    if (!dirFile.isDirectory()) {
-	    	return null;
-        }
-	    Map<String,String> map = new HashMap<String,String>();
-	    File[] files = dirFile.listFiles();
-	    for (int i = 0; i < files.length; i++) {
-            if (files[i].isFile()) {
-            	String path = files[i].getPath();
-            	map.put(path, prefix+childname+path.substring(path.lastIndexOf("/")));
-            }
-        }
-	    return map;
-	}
-	
-	//转台拼图
-	public void buildPanoramicImgs(String folderName)throws Exception
-	{
-		String command = ConstantCmd.BUILD_PANORAMA + folderName;
-		log.info("开始拼全景图");
-		callshell(command);
-		log.info("全景图拼接完毕");
-	}
-	
-	//六目拼图、切图,计算
-	public void buildForSix(String folderName)throws Exception
-	{
-		String command = ConstantCmd.BUILD_FOR_SIX + folderName;
-		log.info("开始处理数据(六目)");
-		callshell(command);
-		log.info("数据处理完毕(六目)");
-	}
-
-	public static void createSoftConnection(String source, String target) {
-		String command = "ln -s " + source + " " + target;
-		log.info("开始创建文件夹软连接");
-		callshell(command);
-		log.info("数据处理完毕(六目):" + command);
-	}
-
-	//合并音频
-	public static void mergeVideo(String oldVideo , String newVideo, String targetVideo) throws Exception{
-		String command = ConstantCmd.MERGE_VIDEO + " " + oldVideo + " " + newVideo + " " + targetVideo + " -y";
-		log.info("开始合并视频");
-		callshell(command);
-		log.info("合并视频完毕:" + command);
-	}
-
-	//生成一段静音音频
-	public static void createMuteViode(double time , String targetVideo) throws Exception{
-		String command = ConstantCmd.CREATE_MUTE_VIDEO + " " + time + " " + targetVideo + " -y";
-		log.info("开始生成一段静音音频");
-		callshell(command);
-		log.info("生成一段静音音频完毕:" + command);
-	}
-
-	//mp4文件转换成flv文件
-	public static void mp4ToFlv(String oldVideo, String newVideo) throws Exception{
-		String command = ConstantCmd.MP4_TO_FLV + " " + oldVideo + " " + newVideo;
-		log.info("mp4文件转换成flv文件");
-		callshell(command);
-		log.info("mp4文件转换成flv文件完毕:" + command);
-	}
-
-	//删除/mnt/data/下的数据
-	public static void deleteFile(String filePath) throws Exception{
-		String command = ConstantCmd.DELETE_FILE + " " + filePath;
-		log.info("删除/mnt/data/下的数据");
-		callshell(command);
-		log.info("删除/mnt/data/下的数据完毕:" + command);
-	}
-
-	public static void ossUtilCp(String fileUrl , String path) throws Exception{
-		String command = ConstantCmd.OSS_UTIL_CP + " " + fileUrl + " " + path;
-		Long start = System.currentTimeMillis();
-		log.info("开始oss下载文件:" + command);
-		callshell(command);
-		log.info("oss下载文件完成,时间为:" + (System.currentTimeMillis() - start));
-	}
-
-	public static void ossFileCp(String fileUrl , String path) throws Exception{
-		String command = ConstantCmd.OSS_FILE_CP + " " + fileUrl + " " + path;
-		Long start = System.currentTimeMillis();
-		log.info("开始s3文件下载文件:" + command);
-		callshell(command);
-		log.info("s3文件下载文件完成,时间为:" + (System.currentTimeMillis() - start));
-	}
-
-	/**
-	 * matterpro场景获取阿里云的切图数据
-	 * @param path
-	 * @throws Exception
-     */
-	public static void matterproCutImg(String num , String path) throws Exception{
-		String command = ConstantCmd.MATTERPRO_CUT_IMG + " -s " + num + " -d " + path;
-		Long start = System.currentTimeMillis();
-		log.info("开始matterpro获取阿里云图片方法:" + command);
-		callshell(command);
-		log.info("matterpro获取阿里云图片方法完成,时间为:" + (System.currentTimeMillis() - start));
-	}
-}

+ 0 - 39
4dkankan-common-mq/src/main/java/com/fdkankan/common/constant/ConstantFileName.java

@@ -1,39 +0,0 @@
-package com.fdkankan.common.constant;
-
-public class ConstantFileName {
-    //背景音乐
-    public static final String BACKGROUND_MUSIC = "bg.mp3";
-    //编辑页面,第二代
-    public static final String MODEL_DATAFILE = "modeldata.json";
-    public static final String HOT_DATAFILE = "hot.json";
-    public static final String MEDIA_DATAFILE = "mediaInfo.json";
-    public static final String SCREEN_CRP_DATAFILE = "screenCap";
-    //导览(一代)
-    public static final String GUIDE_DATAFILE = "tour.json";
-
-    //文件夹名称
-    public static final String GUIDE_MEDIA_FOLDER = "guide";
-    public static final String HOT_MEDIA_FOLDER = "hot";
-    public static final String OTHER_MEDIA_FOLDER = "other";
-
-    //论坛过滤文档
-    public static final String BBS_SENSITIVE = "SensitiveWord.txt";
-    public static final String LOGO_NAME = "logo.jpg";
-
-    //app部分
-    public static final String APP_FOLDER = "appupload";
-
-    public static final String FLOOR_LOGO_PIC_NAME = "floorLogoImg.png";
-
-    public static final String TOUR_LIST = "tourList.json";
-    public static final String VOICE_NAME = "201810";
-    public static final String WECHAT_VOICE_NAME = "wechat";
-    public static final String APP_VOICE_NAME = "app";
-
-    public static final String TOURLIST_FOLDER = "tour";
-    //public static final String TEMPFILES = "tempFiles";
-
-    public static final String modelUUID = "dacf7dfa24ae47fab8fcebfe4dc41ab9";
-
-    public static final String BUCKET_NAME = "4dkankan";
-}

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 7340
4dkankan-common-mq/src/main/java/com/fdkankan/common/proto/BigSceneProto.java


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 4654
4dkankan-common-mq/src/main/java/com/fdkankan/common/proto/Common.java


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 4345
4dkankan-common-mq/src/main/java/com/fdkankan/common/proto/Visionmodeldata.java


+ 0 - 156
4dkankan-common-mq/src/main/java/com/fdkankan/common/proto/format/CouchDBFormat.java

@@ -1,156 +0,0 @@
-package com.fdkankan.common.proto.format;
-
-
-import com.google.protobuf.ExtensionRegistry;
-import com.google.protobuf.Message;
-import com.google.protobuf.UnknownFieldSet;
-
-import java.io.IOException;
-
-/**
- * Created by IntelliJ IDEA.
- * User: aantonov
- * Date: Mar 16, 2010
- * Time: 4:06:05 PM
- * To change this template use File | Settings | File Templates.
- */
-public class CouchDBFormat extends JsonFormat {
-
-    /**
-     * Outputs a textual representation of the Protocol Message supplied into the parameter output.
-     * (This representation is the new version of the classic "ProtocolPrinter" output from the
-     * original Protocol Buffer system)
-     */
-    public static void print(Message message, Appendable output) throws IOException {
-        CouchDBGenerator generator = new CouchDBGenerator(output);
-        generator.print("{");
-        print(message, generator);
-        generator.print("}");
-    }
-
-    /**
-     * Outputs a textual representation of {@code fields} to {@code output}.
-     */
-    public static void print(UnknownFieldSet fields, Appendable output) throws IOException {
-        CouchDBGenerator generator = new CouchDBGenerator(output);
-        generator.print("{");
-        printUnknownFields(fields, generator);
-        generator.print("}");
-    }
-
-    /**
-     * Like {@code print()}, but writes directly to a {@code String} and returns it.
-     */
-    public static String printToString(Message message) {
-        try {
-            StringBuilder text = new StringBuilder();
-            print(message, text);
-            return text.toString();
-        } catch (IOException e) {
-            throw new RuntimeException("Writing to a StringBuilder threw an IOException (should never happen).",
-                                       e);
-        }
-    }
-
-    /**
-     * Like {@code print()}, but writes directly to a {@code String} and returns it.
-     */
-    public static String printToString(UnknownFieldSet fields) {
-        try {
-            StringBuilder text = new StringBuilder();
-            print(fields, text);
-            return text.toString();
-        } catch (IOException e) {
-            throw new RuntimeException("Writing to a StringBuilder threw an IOException (should never happen).",
-                                       e);
-        }
-    }
-
-    /**
-     * Parse a text-format message from {@code input} and merge the contents into {@code builder}.
-     */
-    public static void merge(Readable input, Message.Builder builder) throws IOException {
-        merge(input, ExtensionRegistry.getEmptyRegistry(), builder);
-    }
-
-    /**
-     * Parse a text-format message from {@code input} and merge the contents into {@code builder}.
-     */
-    public static void merge(CharSequence input, Message.Builder builder) throws ParseException {
-        merge(input, ExtensionRegistry.getEmptyRegistry(), builder);
-    }
-
-    /**
-     * Parse a text-format message from {@code input} and merge the contents into {@code builder}.
-     * Extensions will be recognized if they are registered in {@code extensionRegistry}.
-     */
-    public static void merge(Readable input,
-                             ExtensionRegistry extensionRegistry,
-                             Message.Builder builder) throws IOException {
-        // Read the entire input to a String then parse that.
-
-        // If StreamTokenizer were not quite so crippled, or if there were a kind
-        // of Reader that could read in chunks that match some particular regex,
-        // or if we wanted to write a custom Reader to tokenize our stream, then
-        // we would not have to read to one big String. Alas, none of these is
-        // the case. Oh well.
-
-        merge(JsonFormat.toStringBuilder(input), extensionRegistry, builder);
-    }
-
-    /**
-     * Parse a text-format message from {@code input} and merge the contents into {@code builder}.
-     * Extensions will be recognized if they are registered in {@code extensionRegistry}.
-     */
-    public static void merge(CharSequence input,
-                             ExtensionRegistry extensionRegistry,
-                             Message.Builder builder) throws ParseException {
-        Tokenizer tokenizer = new Tokenizer(input);
-
-        // Based on the state machine @ http://json.org/
-
-        tokenizer.consume("{"); // Needs to happen when the object starts.
-        while (!tokenizer.tryConsume("}")) { // Continue till the object is done
-            JsonFormat.mergeField(tokenizer, extensionRegistry, builder);
-        }
-    }
-
-    protected static class Tokenizer extends JsonFormat.Tokenizer {
-
-        /**
-         * Construct a tokenizer that parses tokens from the given text.
-         */
-        public Tokenizer(CharSequence text) {
-            super(text);
-        }
-
-        @Override
-        public String consumeIdentifier() throws ParseException {
-            String id = super.consumeIdentifier();
-            if ("_id".equals(id)) {
-                return "id";
-            } else if ("_rev".equals(id)) {
-                return "rev";
-            }
-            return id;
-        }
-    }
-
-    protected static class CouchDBGenerator extends JsonGenerator {
-
-        public CouchDBGenerator(Appendable output) {
-            super(output);
-        }
-
-        @Override
-        public void print(CharSequence text) throws IOException {
-            if ("id".equals(text)) {
-                super.print("_id");
-            } else if ("rev".equals(text)) {
-                super.print("_rev");
-            } else {
-                super.print(text);
-            }
-        }
-    }
-}

+ 0 - 703
4dkankan-common-mq/src/main/java/com/fdkankan/common/proto/format/HtmlFormat.java

@@ -1,703 +0,0 @@
-package com.fdkankan.common.proto.format;
-/* 
-    Copyright (c) 2009, Orbitz World Wide
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without modification, 
-    are permitted provided that the following conditions are met:
-
-        * Redistributions of source code must retain the above copyright notice, 
-          this list of conditions and the following disclaimer.
-        * Redistributions in binary form must reproduce the above copyright notice, 
-          this list of conditions and the following disclaimer in the documentation 
-          and/or other materials provided with the distribution.
-        * Neither the name of the Orbitz World Wide nor the names of its contributors 
-          may be used to endorse or promote products derived from this software 
-          without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-    OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-
-import com.google.protobuf.ByteString;
-import com.google.protobuf.Descriptors.EnumValueDescriptor;
-import com.google.protobuf.Descriptors.FieldDescriptor;
-import com.google.protobuf.Message;
-import com.google.protobuf.UnknownFieldSet;
-
-import java.io.IOException;
-import java.math.BigInteger;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-/**
- * Provide ascii html formatting support for proto2 instances.
- * <p>
- * (c) 2009-10 Orbitz World Wide. All Rights Reserved.
- * 
- * @author eliran.bivas@gmail.com Eliran Bivas
- * @version $HtmlFormat.java Mar 12, 2009 4:00:33 PM$
- */
-public final class HtmlFormat {
-
-    private static final String META_CONTENT = "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />";
-    private static final String MAIN_DIV_STYLE = "color: black; font-size: 14px; font-family: sans-serif; font-weight: bolder; margin-bottom: 10px;";
-    private static final String FIELD_NAME_STYLE = "font-weight: bold; color: #669966;font-size: 14px; font-family: sans-serif;";
-    private static final String FIELD_VALUE_STYLE = "color: #3300FF;font-size: 13px; font-family: sans-serif;";
-
-    /**
-     * Outputs a textual representation of the Protocol Message supplied into the parameter output.
-     * (This representation is the new version of the classic "ProtocolPrinter" output from the
-     * original Protocol Buffer system)
-     */
-    public static void print(Message message, Appendable output) throws IOException {
-        HtmlGenerator generator = new HtmlGenerator(output);
-        printTitle(message, generator);
-        print(message, generator);
-        generator.print("</body></html>");
-    }
-
-    private static void printTitle(final Message message, final HtmlGenerator generator) throws IOException {
-        generator.print("<html><head>");
-        generator.print(META_CONTENT);
-        generator.print("<title>");
-        generator.print(message.getDescriptorForType().getFullName());
-        generator.print("</title></head><body>");
-        generator.print("<div style=\"");
-        generator.print(MAIN_DIV_STYLE);
-        generator.print("\">message : ");
-        generator.print(message.getDescriptorForType().getFullName());
-        generator.print("</div>");
-    }
-
-    /**
-     * Outputs a textual representation of {@code fields} to {@code output}.
-     */
-    public static void print(UnknownFieldSet fields, Appendable output) throws IOException {
-        HtmlGenerator generator = new HtmlGenerator(output);
-        generator.print("<html>");
-        generator.print(META_CONTENT);
-        generator.print("</head><body>");
-        printUnknownFields(fields, generator);
-        generator.print("</body></html>");
-    }
-
-    /**
-     * Like {@code print()}, but writes directly to a {@code String} and returns it.
-     */
-    public static String printToString(Message message) {
-        try {
-            StringBuilder text = new StringBuilder();
-            print(message, text);
-            return text.toString();
-        } catch (IOException e) {
-            throw new RuntimeException("Writing to a StringBuilder threw an IOException (should never happen).",
-                                       e);
-        }
-    }
-
-    /**
-     * Like {@code print()}, but writes directly to a {@code String} and returns it.
-     */
-    public static String printToString(UnknownFieldSet fields) {
-        try {
-            StringBuilder text = new StringBuilder();
-            print(fields, text);
-            return text.toString();
-        } catch (IOException e) {
-            throw new RuntimeException("Writing to a StringBuilder threw an IOException (should never happen).",
-                                       e);
-        }
-    }
-
-    private static void print(Message message, HtmlGenerator generator) throws IOException {
-
-        for (Map.Entry<FieldDescriptor, Object> field : message.getAllFields().entrySet()) {
-            printField(field.getKey(), field.getValue(), generator);
-        }
-        printUnknownFields(message.getUnknownFields(), generator);
-    }
-
-    public static void printField(FieldDescriptor field, Object value, HtmlGenerator generator) throws IOException {
-
-        if (field.isRepeated()) {
-            // Repeated field. Print each element.
-            for (Object element : (List<?>) value) {
-                printSingleField(field, element, generator);
-            }
-        } else {
-            printSingleField(field, value, generator);
-        }
-    }
-
-    private static void printSingleField(FieldDescriptor field,
-                                         Object value,
-                                         HtmlGenerator generator) throws IOException {
-        if (field.isExtension()) {
-            generator.print("[<span style=\"");
-            generator.print(FIELD_NAME_STYLE);
-            generator.print("\">");
-            // We special-case MessageSet elements for compatibility with proto1.
-            if (field.getContainingType().getOptions().getMessageSetWireFormat()
-                            && (field.getType() == FieldDescriptor.Type.MESSAGE) && (field.isOptional())
-                            // object equality
-                            && (field.getExtensionScope() == field.getMessageType())) {
-                generator.print(field.getMessageType().getFullName());
-            } else {
-                generator.print(field.getFullName());
-            }
-            generator.print("</span>]");
-        } else {
-            generator.print("<span style=\"");
-            generator.print(FIELD_NAME_STYLE);
-            generator.print("\">");
-            if (field.getType() == FieldDescriptor.Type.GROUP) {
-                // Groups must be serialized with their original capitalization.
-                generator.print(field.getMessageType().getName());
-            } else {
-                generator.print(field.getName());
-            }
-            generator.print("</span>");
-        }
-
-        if (field.getJavaType() == FieldDescriptor.JavaType.MESSAGE) {
-            generator.print(" <span style=\"color: red;\">{</span><br/>");
-            generator.indent();
-        } else {
-            generator.print(": ");
-        }
-
-        printFieldValue(field, value, generator);
-
-        if (field.getJavaType() == FieldDescriptor.JavaType.MESSAGE) {
-            generator.outdent();
-            generator.print("<span style=\"color: red;\">}</span>");
-        }
-        generator.print("<br/>");
-    }
-
-    private static void printFieldValue(FieldDescriptor field, Object value, HtmlGenerator generator) throws IOException {
-        generator.print("<span style=\"");
-        generator.print(FIELD_VALUE_STYLE);
-        generator.print("\">");
-        switch (field.getType()) {
-            case INT32:
-            case INT64:
-            case SINT32:
-            case SINT64:
-            case SFIXED32:
-            case SFIXED64:
-            case FLOAT:
-            case DOUBLE:
-            case BOOL:
-                // Good old toString() does what we want for these types.
-                generator.print(value.toString());
-                break;
-
-            case UINT32:
-            case FIXED32:
-                generator.print(unsignedToString((Integer) value));
-                break;
-
-            case UINT64:
-            case FIXED64:
-                generator.print(unsignedToString((Long) value));
-                break;
-
-            case STRING:
-                generator.print("\"");
-                generator.print(value.toString());
-                generator.print("\"");
-                break;
-
-            case BYTES: {
-                generator.print("\"");
-                generator.print(escapeBytes((ByteString) value));
-                generator.print("\"");
-                break;
-            }
-
-            case ENUM: {
-                generator.print(((EnumValueDescriptor) value).getName());
-                break;
-            }
-
-            case MESSAGE:
-            case GROUP:
-                print((Message) value, generator);
-                break;
-        }
-        generator.print("</span>");
-    }
-
-    private static void printUnknownFields(UnknownFieldSet unknownFields, HtmlGenerator generator) throws IOException {
-        for (Map.Entry<Integer, UnknownFieldSet.Field> entry : unknownFields.asMap().entrySet()) {
-            UnknownFieldSet.Field field = entry.getValue();
-
-            for (long value : field.getVarintList()) {
-                generator.print(entry.getKey().toString());
-                generator.print(": ");
-                generator.print(unsignedToString(value));
-                generator.print("<br/>");
-            }
-            for (int value : field.getFixed32List()) {
-                generator.print(entry.getKey().toString());
-                generator.print(": ");
-                generator.print(String.format((Locale) null, "0x%08x", value));
-                generator.print("<br/>");
-            }
-            for (long value : field.getFixed64List()) {
-                generator.print(entry.getKey().toString());
-                generator.print(": ");
-                generator.print(String.format((Locale) null, "0x%016x", value));
-                generator.print("<br/>");
-            }
-            for (ByteString value : field.getLengthDelimitedList()) {
-                generator.print(entry.getKey().toString());
-                generator.print(": \"");
-                generator.print(escapeBytes(value));
-                generator.print("\"<br/>");
-            }
-            for (UnknownFieldSet value : field.getGroupList()) {
-                generator.print(entry.getKey().toString());
-                generator.print(" <span style=\"color: red;\">{</span><br/>");
-                generator.indent();
-                printUnknownFields(value, generator);
-                generator.outdent();
-                generator.print("<span style=\"color: red;\">}</span><br/>");
-            }
-        }
-    }
-
-    /**
-     * Convert an unsigned 32-bit integer to a string.
-     */
-    private static String unsignedToString(int value) {
-        if (value >= 0) {
-            return Integer.toString(value);
-        } else {
-            return Long.toString((value) & 0x00000000FFFFFFFFL);
-        }
-    }
-
-    /**
-     * Convert an unsigned 64-bit integer to a string.
-     */
-    private static String unsignedToString(long value) {
-        if (value >= 0) {
-            return Long.toString(value);
-        } else {
-            // Pull off the most-significant bit so that BigInteger doesn't think
-            // the number is negative, then set it again using setBit().
-            return BigInteger.valueOf(value & 0x7FFFFFFFFFFFFFFFL).setBit(63).toString();
-        }
-    }
-
-    /**
-     * An inner class for writing text to the output stream.
-     */
-    static private final class HtmlGenerator {
-
-        Appendable output;
-        boolean atStartOfLine = true;
-
-        public HtmlGenerator(Appendable output) {
-            this.output = output;
-        }
-
-        /**
-         * Indent text by two spaces. After calling Indent(), two spaces will be inserted at the
-         * beginning of each line of text. Indent() may be called multiple times to produce deeper
-         * indents.
-         * 
-         * @throws IOException
-         */
-        public void indent() throws IOException {
-            print("<div style=\"margin-left: 25px\">");
-        }
-
-        /**
-         * Reduces the current indent level by two spaces, or crashes if the indent level is zero.
-         * 
-         * @throws IOException
-         */
-        public void outdent() throws IOException {
-            print("</div>");
-        }
-
-        /**
-         * Print text to the output stream.
-         */
-        public void print(CharSequence text) throws IOException {
-            int size = text.length();
-            int pos = 0;
-
-            for (int i = 0; i < size; i++) {
-                if (text.charAt(i) == '\n') {
-                    write("<br/>", i - pos + 1);
-                    pos = i + 1;
-                    atStartOfLine = true;
-                }
-            }
-            write(text.subSequence(pos, size), size - pos);
-        }
-
-        private void write(CharSequence data, int size) throws IOException {
-            if (size == 0) {
-                return;
-            }
-            if (atStartOfLine) {
-                atStartOfLine = false;
-            }
-            output.append(data);
-        }
-    }
-
-    // =================================================================
-    // Utility functions
-    //
-    // Some of these methods are package-private because Descriptors.java uses
-    // them.
-
-    /**
-     * Escapes bytes in the format used in protocol buffer text format, which is the same as the
-     * format used for C string literals. All bytes that are not printable 7-bit ASCII characters
-     * are escaped, as well as backslash, single-quote, and double-quote characters. Characters for
-     * which no defined short-hand escape sequence is defined will be escaped using 3-digit octal
-     * sequences.
-     */
-    static String escapeBytes(ByteString input) {
-        StringBuilder builder = new StringBuilder(input.size());
-        for (int i = 0; i < input.size(); i++) {
-            byte b = input.byteAt(i);
-            switch (b) {
-                // Java does not recognize \a or \v, apparently.
-                case 0x07:
-                    builder.append("\\a");
-                    break;
-                case '\b':
-                    builder.append("\\b");
-                    break;
-                case '\f':
-                    builder.append("\\f");
-                    break;
-                case '\n':
-                    builder.append("\\n");
-                    break;
-                case '\r':
-                    builder.append("\\r");
-                    break;
-                case '\t':
-                    builder.append("\\t");
-                    break;
-                case 0x0b:
-                    builder.append("\\v");
-                    break;
-                case '\\':
-                    builder.append("\\\\");
-                    break;
-                case '\'':
-                    builder.append("\\\'");
-                    break;
-                case '"':
-                    builder.append("\\\"");
-                    break;
-                default:
-                    if (b >= 0x20) {
-                        builder.append((char) b);
-                    } else {
-                        builder.append('\\');
-                        builder.append((char) ('0' + ((b >>> 6) & 3)));
-                        builder.append((char) ('0' + ((b >>> 3) & 7)));
-                        builder.append((char) ('0' + (b & 7)));
-                    }
-                    break;
-            }
-        }
-        return builder.toString();
-    }
-
-    /**
-     * Un-escape a byte sequence as escaped using
-     * {@link #escapeBytes(com.googlecode.protobuf.format.ByteString)}. Two-digit hex escapes (starting with
-     * "\x") are also recognized.
-     */
-    static ByteString unescapeBytes(CharSequence input) throws InvalidEscapeSequence {
-        byte[] result = new byte[input.length()];
-        int pos = 0;
-        for (int i = 0; i < input.length(); i++) {
-            char c = input.charAt(i);
-            if (c == '\\') {
-                if (i + 1 < input.length()) {
-                    ++i;
-                    c = input.charAt(i);
-                    if (isOctal(c)) {
-                        // Octal escape.
-                        int code = digitValue(c);
-                        if ((i + 1 < input.length()) && isOctal(input.charAt(i + 1))) {
-                            ++i;
-                            code = code * 8 + digitValue(input.charAt(i));
-                        }
-                        if ((i + 1 < input.length()) && isOctal(input.charAt(i + 1))) {
-                            ++i;
-                            code = code * 8 + digitValue(input.charAt(i));
-                        }
-                        result[pos++] = (byte) code;
-                    } else {
-                        switch (c) {
-                            case 'a':
-                                result[pos++] = 0x07;
-                                break;
-                            case 'b':
-                                result[pos++] = '\b';
-                                break;
-                            case 'f':
-                                result[pos++] = '\f';
-                                break;
-                            case 'n':
-                                result[pos++] = '\n';
-                                break;
-                            case 'r':
-                                result[pos++] = '\r';
-                                break;
-                            case 't':
-                                result[pos++] = '\t';
-                                break;
-                            case 'v':
-                                result[pos++] = 0x0b;
-                                break;
-                            case '\\':
-                                result[pos++] = '\\';
-                                break;
-                            case '\'':
-                                result[pos++] = '\'';
-                                break;
-                            case '"':
-                                result[pos++] = '\"';
-                                break;
-
-                            case 'x':
-                                // hex escape
-                                int code = 0;
-                                if ((i + 1 < input.length()) && isHex(input.charAt(i + 1))) {
-                                    ++i;
-                                    code = digitValue(input.charAt(i));
-                                } else {
-                                    throw new InvalidEscapeSequence("Invalid escape sequence: '\\x' with no digits");
-                                }
-                                if ((i + 1 < input.length()) && isHex(input.charAt(i + 1))) {
-                                    ++i;
-                                    code = code * 16 + digitValue(input.charAt(i));
-                                }
-                                result[pos++] = (byte) code;
-                                break;
-
-                            default:
-                                throw new InvalidEscapeSequence("Invalid escape sequence: '\\" + c
-                                                                + "'");
-                        }
-                    }
-                } else {
-                    throw new InvalidEscapeSequence("Invalid escape sequence: '\\' at end of string.");
-                }
-            } else {
-                result[pos++] = (byte) c;
-            }
-        }
-
-        return ByteString.copyFrom(result, 0, pos);
-    }
-
-    /**
-     * Thrown by {@link JsonFormat#unescapeBytes} and {@link JsonFormat#unescapeText} when an
-     * invalid escape sequence is seen.
-     */
-    static class InvalidEscapeSequence extends IOException {
-
-        private static final long serialVersionUID = 1L;
-
-        public InvalidEscapeSequence(String description) {
-            super(description);
-        }
-    }
-
-    /**
-     * Like {@link #escapeBytes(com.googlecode.protobuf.format.ByteString)}, but escapes a text string.
-     * Non-ASCII characters are first encoded as UTF-8, then each byte is escaped individually as a
-     * 3-digit octal escape. Yes, it's weird.
-     */
-    static String escapeText(String input) {
-        return escapeBytes(ByteString.copyFromUtf8(input));
-    }
-
-    /**
-     * Un-escape a text string as escaped using {@link #escapeText(String)}. Two-digit hex escapes
-     * (starting with "\x") are also recognized.
-     */
-    static String unescapeText(String input) throws InvalidEscapeSequence {
-        return unescapeBytes(input).toStringUtf8();
-    }
-
-    /**
-     * Is this an octal digit?
-     */
-    private static boolean isOctal(char c) {
-        return ('0' <= c) && (c <= '7');
-    }
-
-    /**
-     * Is this a hex digit?
-     */
-    private static boolean isHex(char c) {
-        return (('0' <= c) && (c <= '9')) || (('a' <= c) && (c <= 'f'))
-        || (('A' <= c) && (c <= 'F'));
-    }
-
-    /**
-     * Interpret a character as a digit (in any base up to 36) and return the numeric value. This is
-     * like {@code Character.digit()} but we don't accept non-ASCII digits.
-     */
-    private static int digitValue(char c) {
-        if (('0' <= c) && (c <= '9')) {
-            return c - '0';
-        } else if (('a' <= c) && (c <= 'z')) {
-            return c - 'a' + 10;
-        } else {
-            return c - 'A' + 10;
-        }
-    }
-
-    /**
-     * Parse a 32-bit signed integer from the text. Unlike the Java standard {@code
-     * Integer.parseInt()}, this function recognizes the prefixes "0x" and "0" to signify
-     * hexidecimal and octal numbers, respectively.
-     */
-    static int parseInt32(String text) throws NumberFormatException {
-        return (int) parseInteger(text, true, false);
-    }
-
-    /**
-     * Parse a 32-bit unsigned integer from the text. Unlike the Java standard {@code
-     * Integer.parseInt()}, this function recognizes the prefixes "0x" and "0" to signify
-     * hexidecimal and octal numbers, respectively. The result is coerced to a (signed) {@code int}
-     * when returned since Java has no unsigned integer type.
-     */
-    static int parseUInt32(String text) throws NumberFormatException {
-        return (int) parseInteger(text, false, false);
-    }
-
-    /**
-     * Parse a 64-bit signed integer from the text. Unlike the Java standard {@code
-     * Integer.parseInt()}, this function recognizes the prefixes "0x" and "0" to signify
-     * hexidecimal and octal numbers, respectively.
-     */
-    static long parseInt64(String text) throws NumberFormatException {
-        return parseInteger(text, true, true);
-    }
-
-    /**
-     * Parse a 64-bit unsigned integer from the text. Unlike the Java standard {@code
-     * Integer.parseInt()}, this function recognizes the prefixes "0x" and "0" to signify
-     * hexidecimal and octal numbers, respectively. The result is coerced to a (signed) {@code long}
-     * when returned since Java has no unsigned long type.
-     */
-    static long parseUInt64(String text) throws NumberFormatException {
-        return parseInteger(text, false, true);
-    }
-
-    private static long parseInteger(String text, boolean isSigned, boolean isLong) throws NumberFormatException {
-        int pos = 0;
-
-        boolean negative = false;
-        if (text.startsWith("-", pos)) {
-            if (!isSigned) {
-                throw new NumberFormatException("Number must be positive: " + text);
-            }
-            ++pos;
-            negative = true;
-        }
-
-        int radix = 10;
-        if (text.startsWith("0x", pos)) {
-            pos += 2;
-            radix = 16;
-        } else if (text.startsWith("0", pos)) {
-            radix = 8;
-        }
-
-        String numberText = text.substring(pos);
-
-        long result = 0;
-        if (numberText.length() < 16) {
-            // Can safely assume no overflow.
-            result = Long.parseLong(numberText, radix);
-            if (negative) {
-                result = -result;
-            }
-
-            // Check bounds.
-            // No need to check for 64-bit numbers since they'd have to be 16 chars
-            // or longer to overflow.
-            if (!isLong) {
-                if (isSigned) {
-                    if ((result > Integer.MAX_VALUE) || (result < Integer.MIN_VALUE)) {
-                        throw new NumberFormatException("Number out of range for 32-bit signed integer: "
-                                                        + text);
-                    }
-                } else {
-                    if ((result >= (1L << 32)) || (result < 0)) {
-                        throw new NumberFormatException("Number out of range for 32-bit unsigned integer: "
-                                                        + text);
-                    }
-                }
-            }
-        } else {
-            BigInteger bigValue = new BigInteger(numberText, radix);
-            if (negative) {
-                bigValue = bigValue.negate();
-            }
-
-            // Check bounds.
-            if (!isLong) {
-                if (isSigned) {
-                    if (bigValue.bitLength() > 31) {
-                        throw new NumberFormatException("Number out of range for 32-bit signed integer: "
-                                                        + text);
-                    }
-                } else {
-                    if (bigValue.bitLength() > 32) {
-                        throw new NumberFormatException("Number out of range for 32-bit unsigned integer: "
-                                                        + text);
-                    }
-                }
-            } else {
-                if (isSigned) {
-                    if (bigValue.bitLength() > 63) {
-                        throw new NumberFormatException("Number out of range for 64-bit signed integer: "
-                                                        + text);
-                    }
-                } else {
-                    if (bigValue.bitLength() > 64) {
-                        throw new NumberFormatException("Number out of range for 64-bit unsigned integer: "
-                                                        + text);
-                    }
-                }
-            }
-
-            result = bigValue.longValue();
-        }
-
-        return result;
-    }
-}

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 1603
4dkankan-common-mq/src/main/java/com/fdkankan/common/proto/format/JsonFormat.java


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 1333
4dkankan-common-mq/src/main/java/com/fdkankan/common/proto/format/XmlFormat.java


+ 0 - 602
4dkankan-common-mq/src/main/java/com/fdkankan/common/utils/CreateObjUtil.java

@@ -1,602 +0,0 @@
-package com.fdkankan.common.utils;
-
-import com.fdkankan.common.constant.ConstantFileName;
-import com.fdkankan.common.constant.ConstantFilePath;
-import com.fdkankan.common.proto.BigSceneProto;
-import com.fdkankan.common.proto.Common;
-import com.fdkankan.common.proto.Visionmodeldata;
-import com.fdkankan.common.proto.format.JsonFormat;
-import com.google.protobuf.TextFormat;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.util.StopWatch;
-
-import java.io.*;
-import java.util.HashMap;
-import java.util.Map;
-
-public class CreateObjUtil {
-
-	private static Logger log = LoggerFactory.getLogger(CreateObjUtil.class);
-
-	public void saveuploadImgs(String folderName) throws IOException, Exception
-	{
-		log.info("开始计算");
-		String command = "bash /home/ubuntu/photoscan-pro/build_model.sh "+folderName;
-		callshell(command);
-		boolean flag = false;
-		String sPath =  ConstantFilePath.CREATE_MODEL_PATH+folderName+File.separator+"mesh"+File.separator+"mesh.obj";
-		while(!flag)
-		{
-			flag = isModel(sPath,folderName);
-		}
-		log.info("计算完毕");
-	}
-	
-	public void saveuploadImgs2(String folderName) throws IOException, Exception
-	{
-		log.info("开始计算");
-		String command = "bash /home/ubuntu/photoscan-pro/build_bigscene.sh "+folderName;
-		callshell(command);
-		boolean flag = false;
-		String sPath = ConstantFilePath.CREATE_BIG_SCENE_PATH+folderName+File.separator+"mesh"+File.separator+"mesh.obj";
-		while(!flag)
-		{
-			flag = isModel(sPath,folderName);
-		}
-		log.info("计算完毕");
-		log.info("obj和camera转换成大场景要的格式");
-		convertobjTotxt( folderName);
-		
-	}
-
-	//开始建模
-	public static void unRar(String rarPath,String dataPath) throws Exception{
-		log.info("解压rar开始");
-		String command = "unrar e " + rarPath + " " + dataPath;
-		callshell(command);
-		log.info("解压rar完毕:" + command);
-	}
-
-	public static void unZip(String zipPath,String dataPath) throws Exception{
-		log.info("解压zip开始");
-		String command = "unzip -O GBK/GB18030CP936 " + zipPath + " -d " + dataPath;
-		callshell(command);
-		log.info("解压zip完毕:" + command);
-	}
-
-	//开始建模
-	public static void build3dModel(String folderName,String isModel) throws Exception{
-		log.info("开始建模");
-		String command = ConstantCmd.BUILD_MODEL_COMMAND+folderName;
-		callshell(command);
-		log.info("计算完毕:" + command);
-	}
-
-	//开始建模
-	public static void build3dModel2(String folderName,String isModel) throws Exception{
-		log.info("开始建模");
-		String command = ConstantCmd.BUILD_MODEL_COMMAND2+folderName;
-		callshell(command);
-		log.info("计算完毕:" + command);
-	}
-
-	//开始建模
-	public static void build3dModelOld(String folderName,String isModel) throws Exception{
-		log.info("开始v2建模");
-		String command = ConstantCmd.BUILD_MODEL_OLD_COMMAND+folderName;
-		callshell(command);
-		log.info("计算v2完毕:" + command);
-	}
-
-	//开始建模
-	public static void translateHoustfloorJSONFile(String filePath,String outputPath) throws Exception{
-		log.info("开始转换houst_floor.json");
-		String command = ConstantCmd.TRANSLATE_HOUST_FLOOR + filePath + " " + outputPath;
-		callshell(command);
-		log.info("转换houst_floor.json 结束");
-	}
-
-	//激光相机复制资源
-	public static void cpfile(String filepathOld,String filepathNew) throws Exception{
-		log.info("开始复制");
-		String command = ConstantCmd.CP_JG_EXTRA+ " " + filepathOld + " " + filepathNew;
-		callshell(command);
-		log.info("复制完毕:" + command);
-	}
-
-
-	//激光相机复制资源laser下的全部资源
-	public static void cplaserfile(String filepathOld,String filepathNew) throws Exception{
-		log.info("开始复制");
-		String command = ConstantCmd.CP_JG_ALL+ " " + filepathOld + " " + filepathNew;
-		callshell(command);
-		log.info("复制完毕:" + command);
-	}
-	
-	//开始建模
-	public void build3dModelSFM(String folderName,String isModel) throws Exception{
-		log.info("开始建模");
-		String command = ConstantCmd.BUILD_MODEL_SFM_COMMAND+folderName+" "+isModel;
-		callshell(command);
-		log.info("计算完毕");
-	}
-
-	//obj文件转换问txt
-	public static void objToTxt(String folderName,String isModel) throws Exception{
-		log.info("obj2txt开始转换");
-		String command = ConstantCmd.OBJ_TO_TXT+folderName;
-		callshell(command);
-		log.info("转换完毕:" + command);
-	}
-
-	public void rebuildModelFllor(String folderName, String isModel) {
-		try{
-			log.info("开始建模");
-			String command = ConstantCmd.REBUILD_MODEL_FLLOR+folderName+" "+isModel;
-			callshell(command);
-			log.info("计算完毕");
-		}
-		catch(Exception e)
-		{
-			e.printStackTrace();
-		}
-	}
-
-	//切图
-	public void cutImgs(String[] imgNames ,String folderName)
-	{
-		try{
-			log.info("开始切图");
-			for(int i=0;i<imgNames.length;++i)
-			{
-				String imgName=imgNames[i].replace(".jpg", "");
-				String command = ConstantCmd.CUT_IMG_COMMAND+folderName+" "+imgName;
-				callshell(command);
-			}
-			log.info("切图完毕");
-		}
-		catch(Exception e)
-		{
-			e.printStackTrace();
-		}
-	}
-	
-	//调整切图
-	public void adjustImgs(String folderName)
-	{
-		try{
-			String command = ConstantCmd.ADJUST_IMG_COMMAND + folderName;
-			log.info("开始调整图片");
-			callshell(command);
-			log.info("调整图片完毕");
-		}
-		catch(Exception e)
-		{
-			e.printStackTrace();
-		}
-	}
-	
-	//obj和camera转换成大场景要的格式
-	public void convertobjTotxt(String folderName) throws Exception
-	{
-		//obj
-		String command = "/home/ubuntu/photoscan-pro/main/mesh/mesh "+folderName;
-		callshell(command);
-		//camera
-		command = "/home/ubuntu/photoscan-pro/main/read_camera/read_camera "+folderName;
-		callshell(command);
-		
-		String prefix = ConstantFilePath.CREATE_BIG_SCENE_PATH+folderName+File.separator+"data"+File.separator;
-		String srcpath = prefix +"mesh.txt";
-		String despath = prefix +"dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam";
-				
-		convertTxtToDam( srcpath, despath);
-		//dam转换成lzma
-		command = "lzma /home/ubuntu/photo_data/bigscene/"+folderName+"/data/dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam";
-		callshell(command);
-		
-		srcpath = prefix +"vision.txt";
-		despath = prefix +"vision.modeldata";
-		convertTxtToVisionmodeldata( srcpath, despath);
-	}
-
-	public static void convertDamToLzma(String folderName)throws Exception
-	{
-		try
-		{
-			String command = "lzma "+ folderName+File.separator+ ConstantFileName.modelUUID+"_50k.dam";
-			log.info("开始转换lzma");
-			callshell(command);
-			log.info("转换lzma完毕");
-		}
-		catch(Exception e)
-		{
-			StringWriter trace=new StringWriter();
-			e.printStackTrace(new PrintWriter(trace));
-			log.error(trace.toString());
-		}
-
-	}
-
-	public static void convertDamToLzma2(String folderName)throws Exception
-	{
-		try
-		{
-			String command = "lzma "+ folderName+File.separator+ ConstantFileName.modelUUID+"_50k2.dam";
-			log.info("开始转换lzma");
-			callshell(command);
-			log.info("转换lzma完毕");
-		}
-		catch(Exception e)
-		{
-			StringWriter trace=new StringWriter();
-			e.printStackTrace(new PrintWriter(trace));
-			log.error(trace.toString());
-		}
-
-	}
-	
-	public static void convertTxtToDam(String srcpath,String despath)throws Exception
-	{
-			BigSceneProto.binary_mesh.Builder builder= BigSceneProto.binary_mesh.newBuilder();
-			InputStream inputStream = new FileInputStream(srcpath);
-			InputStreamReader reader = new InputStreamReader(inputStream, "ASCII");
-			TextFormat.merge(reader, builder);
-			byte[] buf= builder.build().toByteArray();
-			
-			 //把序列化后的数据写入本地磁盘  
-	        ByteArrayInputStream stream = new ByteArrayInputStream(buf);  
-	        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(despath));//设置输出路径  
-	        BufferedInputStream bis = new BufferedInputStream(stream);  
-	        int b = -1;  
-	        while ((b = bis.read()) != -1) {  
-	            bos.write(b);  
-	        }  
-	        bis.close();  
-	        bos.close();
-	}
-	
-	public static void convertVisionmodeldataToTxt(String srcpath,String despath)throws Exception
-	{
-		try
-		{
-			File file = new File(srcpath); 
-			FileInputStream fis=new FileInputStream(file);
-
-			Visionmodeldata.NavigationInfo data_NavigationInfo = Visionmodeldata.NavigationInfo.parseFrom(fis);
-	
-			//PrintStream out = new PrintStream(despath); 
-			String jsonFormat1 = JsonFormat.printToString(data_NavigationInfo);
-			ByteArrayInputStream stream = new ByteArrayInputStream(jsonFormat1.getBytes());  
-	        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(despath));//设置输出路径  
-	        BufferedInputStream bis = new BufferedInputStream(stream);  
-	        int b = -1;  
-	        while ((b = bis.read()) != -1) {  
-	           bos.write(b);  
-	        }  
-			//out.close();
-	        bis.close();  
-	        bos.close(); 
-		}
-		catch(Exception e)
-		{
-			StringWriter trace=new StringWriter();
-	        e.printStackTrace(new PrintWriter(trace));
-	        log.error(trace.toString());
-		}
-	}
-	
-	public static void convertTxtToVisionmodeldata(String srcpath,String despath)throws Exception
-	{
-		try
-		{
-			Visionmodeldata.NavigationInfo.Builder builder = Visionmodeldata.NavigationInfo.newBuilder();
-			String jsonFormat = readTxtFileToJson(srcpath);
-			JsonFormat.merge(jsonFormat, builder);
-			byte[] buf= builder.build().toByteArray();
-			
-			 //把序列化后的数据写入本地磁盘  
-	        ByteArrayInputStream stream = new ByteArrayInputStream(buf);  
-	        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(despath));//设置输出路径  
-	        BufferedInputStream bis = new BufferedInputStream(stream);  
-	        int b = -1;  
-	        while ((b = bis.read()) != -1) {  
-	           bos.write(b);  
-	        }  
-	        bis.close();  
-	        bos.close(); 
-		}
-		catch(Exception e)
-		{
-			StringWriter trace=new StringWriter();
-	        e.printStackTrace(new PrintWriter(trace));
-	        log.error(trace.toString());
-		}
-	}
-
-	public static void convertVisionmodeldataToTxtCommon(String srcpath,String despath)throws Exception
-	{
-		try
-		{
-			File file = new File(srcpath);
-			FileInputStream fis=new FileInputStream(file);
-
-			Common.NavigationInfo data_NavigationInfo = Common.NavigationInfo.parseFrom(fis);
-
-			//PrintStream out = new PrintStream(despath);
-			String jsonFormat1 = JsonFormat.printToString(data_NavigationInfo);
-			ByteArrayInputStream stream = new ByteArrayInputStream(jsonFormat1.getBytes());
-			BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(despath));//设置输出路径
-			BufferedInputStream bis = new BufferedInputStream(stream);
-			int b = -1;
-			while ((b = bis.read()) != -1) {
-				bos.write(b);
-			}
-			//out.close();
-			bis.close();
-			bos.close();
-		}
-		catch(Exception e)
-		{
-			StringWriter trace=new StringWriter();
-			e.printStackTrace(new PrintWriter(trace));
-			log.error(trace.toString());
-		}
-	}
-
-	public static void convertTxtToVisionmodeldataCommon(String srcpath,String despath)throws Exception
-	{
-		try
-		{
-			Common.NavigationInfo.Builder builder = Common.NavigationInfo.newBuilder();
-			String jsonFormat = readTxtFileToJson(srcpath);
-			JsonFormat.merge(jsonFormat, builder);
-			byte[] buf= builder.build().toByteArray();
-
-			//把序列化后的数据写入本地磁盘
-			ByteArrayInputStream stream = new ByteArrayInputStream(buf);
-			BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(despath));//设置输出路径
-			BufferedInputStream bis = new BufferedInputStream(stream);
-			int b = -1;
-			while ((b = bis.read()) != -1) {
-				bos.write(b);
-			}
-			bis.close();
-			bos.close();
-		}
-		catch(Exception e)
-		{
-			StringWriter trace=new StringWriter();
-			e.printStackTrace(new PrintWriter(trace));
-			log.error(trace.toString());
-		}
-	}
-	
-	public static void callshell(String command)
-	{ 
-        try {
-			 StopWatch stopWatch = new StopWatch();
-			 stopWatch.start();
-			 Process process = Runtime.getRuntime().exec(command);
-        	 StreamGobbler errorGobbler = new StreamGobbler(process.getErrorStream(), "ERROR");
-             errorGobbler.start();  
-             StreamGobbler outGobbler = new StreamGobbler(process.getInputStream(), "STDOUT");  
-             outGobbler.start();  
-             process.waitFor();
-			log.info("脚本{}执行完毕,用时:{}",command,stopWatch.toString());
-        } catch (Exception e) {  
-            e.printStackTrace();  
-        }  
-	}
-	
-	public static int doWaitFor(Process process) {
-		  InputStream in = null;
-		  InputStream err = null;
-		  int exitValue = -1; // returned to caller when p is finished
-		  try {
-		    in = process.getInputStream();
-		    err = process.getErrorStream();
-		    boolean finished = false; // Set to true when p is finished
-		    while (!finished) {
-		      try {
-		        while (in.available() > 0) {
-		          // Print the output of our system call
-		          Character c = new Character((char) in.read());
-		          System.out.print(c);
-		        }
-		        while (err.available() > 0) {
-		          // Print the output of our system call
-		          Character c = new Character((char) err.read());
-		          System.out.print(c);
-		        }
-		        // Ask the process for its exitValue. If the process
-		        // is not finished, an IllegalThreadStateException
-		        // is thrown. If it is finished, we fall through and
-		        // the variable finished is set to true.
-		        exitValue = process.exitValue();
-		        finished = true;
-		      } catch (IllegalThreadStateException e) {
-		        // Process is not finished yet;
-		        // Sleep a little to save on CPU cycles
-		        Thread.currentThread().sleep(500);
-		      }
-		    }
-		  } catch (Exception e) {
-		    e.printStackTrace();
-		  } finally {
-		    try {
-		      if (in != null) {
-		        in.close();
-		      }
-		    } catch (IOException e) {
-		      e.printStackTrace();
-		    }
-		    if (err != null) {
-		      try {
-		        err.close();
-		      } catch (IOException e) {
-		        e.printStackTrace();
-		      }
-		    }
-		  }
-		  return exitValue;
-		}
-
-	
-	private boolean isModel(String sPath,String folderName)
-	{
-		boolean flag = false;  
-		File file = new File(sPath);  
-	    if (file.isFile() && file.exists()) {  
-	        flag = true;  
-	    }  
-	    log.info("等待...");
-	    return flag;  
-	}
-	
-	public static String readTxtFileToJson(String filePath){
-        try { 
-                String encoding="UTF-8"; 
-                File file=new File(filePath); 
-                if(file.isFile() && file.exists()){ 
-                    InputStreamReader read = new InputStreamReader( 
-                    new FileInputStream(file),encoding);
-                    BufferedReader bufferedReader = new BufferedReader(read); 
-                    String lineTxt = null; 
-                    String result="";
-                    while((lineTxt = bufferedReader.readLine()) != null){ 
-                    	result+=lineTxt;
-                        //log.info(lineTxt); 
-                    } 
-                    read.close(); 
-                    return result;
-        }else{ 
-            return null;
-        } 
-        } catch (Exception e) { 
-            e.printStackTrace(); 
-            return null;
-        } 
-      
-    }
-	
-	public Map<String,String> getAllFile(String dPath,String prefix)
-	{
-		File dirFile = new File(dPath);
-	    if (!dirFile.isDirectory()) {
-        }
-	    Map<String,String> map = new HashMap<String,String>();
-	    File[] files = dirFile.listFiles();
-	    for (int i = 0; i < files.length; i++) {
-            if (files[i].isFile()) {
-            	String path = files[i].getPath();
-            	map.put(path, prefix+path.substring(path.lastIndexOf("/")+1));
-            }
-        }
-	    return map;
-	}
-	
-	public Map<String,String> getchildFile(String dPath,String prefix,String childname)
-	{
-		File dirFile = new File(dPath+File.separator+childname);
-	    if (!dirFile.isDirectory()) {
-	    	return null;
-        }
-	    Map<String,String> map = new HashMap<String,String>();
-	    File[] files = dirFile.listFiles();
-	    for (int i = 0; i < files.length; i++) {
-            if (files[i].isFile()) {
-            	String path = files[i].getPath();
-            	map.put(path, prefix+childname+path.substring(path.lastIndexOf("/")));
-            }
-        }
-	    return map;
-	}
-	
-	//转台拼图
-	public void buildPanoramicImgs(String folderName)throws Exception
-	{
-		String command = ConstantCmd.BUILD_PANORAMA + folderName;
-		log.info("开始拼全景图");
-		callshell(command);
-		log.info("全景图拼接完毕");
-	}
-	
-	//六目拼图、切图,计算
-	public void buildForSix(String folderName)throws Exception
-	{
-		String command = ConstantCmd.BUILD_FOR_SIX + folderName;
-		log.info("开始处理数据(六目)");
-		callshell(command);
-		log.info("数据处理完毕(六目)");
-	}
-
-	public static void createSoftConnection(String source, String target) {
-		String command = "ln -s " + source + " " + target;
-		log.info("开始创建文件夹软连接");
-		callshell(command);
-		log.info("数据处理完毕(六目):" + command);
-	}
-
-	//合并音频
-	public static void mergeVideo(String oldVideo , String newVideo, String targetVideo) throws Exception{
-		String command = ConstantCmd.MERGE_VIDEO + " " + oldVideo + " " + newVideo + " " + targetVideo + " -y";
-		log.info("开始合并视频");
-		callshell(command);
-		log.info("合并视频完毕:" + command);
-	}
-
-	//生成一段静音音频
-	public static void createMuteViode(double time , String targetVideo) throws Exception{
-		String command = ConstantCmd.CREATE_MUTE_VIDEO + " " + time + " " + targetVideo + " -y";
-		log.info("开始生成一段静音音频");
-		callshell(command);
-		log.info("生成一段静音音频完毕:" + command);
-	}
-
-	//mp4文件转换成flv文件
-	public static void mp4ToFlv(String oldVideo, String newVideo) throws Exception{
-		String command = ConstantCmd.MP4_TO_FLV + " " + oldVideo + " " + newVideo;
-		log.info("mp4文件转换成flv文件");
-		callshell(command);
-		log.info("mp4文件转换成flv文件完毕:" + command);
-	}
-
-	//删除/mnt/data/下的数据
-	public static void deleteFile(String filePath) throws Exception{
-		String command = ConstantCmd.DELETE_FILE + " " + filePath;
-		log.info("删除/mnt/data/下的数据");
-		callshell(command);
-		log.info("删除/mnt/data/下的数据完毕:" + command);
-	}
-
-	public static void ossUtilCp(String fileUrl , String path) throws Exception{
-		String command = ConstantCmd.OSS_UTIL_CP + " " + fileUrl + " " + path;
-		Long start = System.currentTimeMillis();
-		log.info("开始oss下载文件:" + command);
-		callshell(command);
-		log.info("oss下载文件完成,时间为:" + (System.currentTimeMillis() - start));
-	}
-
-	public static void ossFileCp(String fileUrl , String path) throws Exception{
-		String command = ConstantCmd.OSS_FILE_CP + " " + fileUrl + " " + path;
-		Long start = System.currentTimeMillis();
-		log.info("开始s3文件下载文件:" + command);
-		callshell(command);
-		log.info("s3文件下载文件完成,时间为:" + (System.currentTimeMillis() - start));
-	}
-
-	/**
-	 * matterpro场景获取阿里云的切图数据
-	 * @param path
-	 * @throws Exception
-     */
-	public static void matterproCutImg(String num , String path) throws Exception{
-		String command = ConstantCmd.MATTERPRO_CUT_IMG + " -s " + num + " -d " + path;
-		Long start = System.currentTimeMillis();
-		log.info("开始matterpro获取阿里云图片方法:" + command);
-		callshell(command);
-		log.info("matterpro获取阿里云图片方法完成,时间为:" + (System.currentTimeMillis() - start));
-	}
-}

+ 0 - 61
4dkankan-common-mq/src/main/java/com/fdkankan/common/utils/StreamGobbler.java

@@ -1,61 +0,0 @@
-package com.fdkankan.common.utils;
-
-import java.io.*;
-
-public class StreamGobbler extends Thread {
-
-	InputStream is;  
-    String type;  
-    OutputStream os;  
-
-    public StreamGobbler(InputStream is, String type) {  
-        this(is, type, null);  
-    }  
-
-    StreamGobbler(InputStream is, String type, OutputStream redirect) {  
-        this.is = is;  
-        this.type = type;  
-        this.os = redirect;  
-    }  
-
-    public void run() {  
-        InputStreamReader isr = null;  
-        BufferedReader br = null;  
-        PrintWriter pw = null;  
-        try {  
-            if (os != null)  
-                pw = new PrintWriter(os);  
-
-            isr = new InputStreamReader(is);  
-            br = new BufferedReader(isr);  
-            String line=null;  
-            while ( (line = br.readLine()) != null) {  
-                if (pw != null)  
-                    pw.println(line);  
-                System.out.println(type + ">" + line);      
-            }  
-
-            if (pw != null)  
-                pw.flush();  
-        } catch (IOException ioe) {  
-            ioe.printStackTrace();    
-        } finally{  
-            try {  
-            	if(pw!=null)
-            	{
-            		 pw.close();  
-            	}
-            	if(br!=null)
-            	{
-            		br.close();  
-            	}
-            	if(isr!=null)
-            	{
-            		isr.close();  
-            	}
-            } catch (IOException e) {  
-                e.printStackTrace();  
-            }  
-        }  
-    }  
-}

+ 1 - 1
4dkankan-common-mq/src/main/java/com/fdkankan/common/message/BaseMQMessage.java

@@ -1,4 +1,4 @@
-package com.fdkankan.common.message;
+package com.fdkankan.mq.message;
 
 public class BaseMQMessage {
     /**

+ 1 - 1
4dkankan-common-mq/src/main/java/com/fdkankan/common/message/BuildSceneMqMessage.java

@@ -1,4 +1,4 @@
-package com.fdkankan.common.message;
+package com.fdkankan.mq.message;
 
 public class BuildSceneMqMessage extends BaseMQMessage {
 

+ 0 - 39
4dkankan-common-redis/src/main/java/com/fdkankan/common/constant/ConstantFileName.java

@@ -1,39 +0,0 @@
-package com.fdkankan.common.constant;
-
-public class ConstantFileName {
-    //背景音乐
-    public static final String BACKGROUND_MUSIC = "bg.mp3";
-    //编辑页面,第二代
-    public static final String MODEL_DATAFILE = "modeldata.json";
-    public static final String HOT_DATAFILE = "hot.json";
-    public static final String MEDIA_DATAFILE = "mediaInfo.json";
-    public static final String SCREEN_CRP_DATAFILE = "screenCap";
-    //导览(一代)
-    public static final String GUIDE_DATAFILE = "tour.json";
-
-    //文件夹名称
-    public static final String GUIDE_MEDIA_FOLDER = "guide";
-    public static final String HOT_MEDIA_FOLDER = "hot";
-    public static final String OTHER_MEDIA_FOLDER = "other";
-
-    //论坛过滤文档
-    public static final String BBS_SENSITIVE = "SensitiveWord.txt";
-    public static final String LOGO_NAME = "logo.jpg";
-
-    //app部分
-    public static final String APP_FOLDER = "appupload";
-
-    public static final String FLOOR_LOGO_PIC_NAME = "floorLogoImg.png";
-
-    public static final String TOUR_LIST = "tourList.json";
-    public static final String VOICE_NAME = "201810";
-    public static final String WECHAT_VOICE_NAME = "wechat";
-    public static final String APP_VOICE_NAME = "app";
-
-    public static final String TOURLIST_FOLDER = "tour";
-    //public static final String TEMPFILES = "tempFiles";
-
-    public static final String modelUUID = "dacf7dfa24ae47fab8fcebfe4dc41ab9";
-
-    public static final String BUCKET_NAME = "4dkankan";
-}

+ 0 - 49
4dkankan-common-redis/src/main/java/com/fdkankan/common/constant/ConstantFilePath.java

@@ -1,49 +0,0 @@
-package com.fdkankan.common.constant;
-
-public class ConstantFilePath {
-    public static final String BASE_PATH = "/mnt/4Dkankan";
-    //论坛上传图片后,服务器存放的地址
-    public static final String BBS_IMAGES_PATH = "/mnt/4Dkankan/bbs/upload/image/";
-    // 用户上传图片
-    public static final String USER_IMAGES_PATH = "/mnt/4Dkankan/user/";
-    // 图片暂存地址(创建二维码等)
-    public static final String TEMP_IMAGES_PATH = "/mnt/4Dkankan/temp/upload/image/";
-    // 场景
-    public static final String SCENE_PATH = "/mnt/4Dkankan/scene/";
-    // 代理商
-    public static final String AGENT_PATH = "/mnt/4Dkankan/agent/";
-    //电子发票
-    public static final String INVOICE_PATH = "/mnt/4Dkankan/invoice/";
-    // 场景二维码
-    public static final String SCENE_QR_CODE_PATH = "/mnt/4Dkankan/sceneQRcode/";
-    // excel
-    public static final String EXCEL_PATH = "/mnt/4Dkankan/excel/";
-    //    public static final String EXCEL_PATH = "F:\\excel\\";
-    // medias
-    public static final String MEDIAS_PATH = "/mnt/4Dkankan/medias/";
-    // logo
-    public static final String LOGO_PATH = "/mnt/4Dkankan/logo/";
-    // login qr code
-    public static final String LOGIN_QR_CODE_PATH = "/mnt/4Dkankan/login/qrcode/";
-
-    public static final String WEIXIN_CERT = "/mnt/home/ubuntu/user/apiclient_cert.p12";
-
-    public static final String PREFIX = "/home/user";
-    public static final String CREATE_MODEL_PATH = PREFIX + "/photo_data/model/";
-    //大场景
-    public static final String CREATE_BIG_SCENE_PATH = PREFIX + "/photo_data/bigscene/";
-    //生成模型的路径
-    public static final String BUILD_MODEL_PATH = "/mnt/data/";
-    //生成模型的路径
-    public static String BUILD_MODEL_LASER_PATH ="/mnt-laser/data/";
-
-    //支付二维码图片存放路径
-    public static final String ALI_QRCODE_FOLDER = "/mnt/4Dkankan/alicode/";
-    public static final String WEIXIN_QRCODE_FOLDER = "/mnt/4Dkankan/weixincode/";
-
-    public static final String OSS_PREFIX = "home/";
-
-    public void setHardDiskLaser(String value){
-        ConstantFilePath.BUILD_MODEL_LASER_PATH = value;
-    }
-}

+ 0 - 156
4dkankan-common-redis/src/main/java/com/fdkankan/common/proto/format/CouchDBFormat.java

@@ -1,156 +0,0 @@
-package com.fdkankan.common.proto.format;
-
-
-import com.google.protobuf.ExtensionRegistry;
-import com.google.protobuf.Message;
-import com.google.protobuf.UnknownFieldSet;
-
-import java.io.IOException;
-
-/**
- * Created by IntelliJ IDEA.
- * User: aantonov
- * Date: Mar 16, 2010
- * Time: 4:06:05 PM
- * To change this template use File | Settings | File Templates.
- */
-public class CouchDBFormat extends JsonFormat {
-
-    /**
-     * Outputs a textual representation of the Protocol Message supplied into the parameter output.
-     * (This representation is the new version of the classic "ProtocolPrinter" output from the
-     * original Protocol Buffer system)
-     */
-    public static void print(Message message, Appendable output) throws IOException {
-        CouchDBGenerator generator = new CouchDBGenerator(output);
-        generator.print("{");
-        print(message, generator);
-        generator.print("}");
-    }
-
-    /**
-     * Outputs a textual representation of {@code fields} to {@code output}.
-     */
-    public static void print(UnknownFieldSet fields, Appendable output) throws IOException {
-        CouchDBGenerator generator = new CouchDBGenerator(output);
-        generator.print("{");
-        printUnknownFields(fields, generator);
-        generator.print("}");
-    }
-
-    /**
-     * Like {@code print()}, but writes directly to a {@code String} and returns it.
-     */
-    public static String printToString(Message message) {
-        try {
-            StringBuilder text = new StringBuilder();
-            print(message, text);
-            return text.toString();
-        } catch (IOException e) {
-            throw new RuntimeException("Writing to a StringBuilder threw an IOException (should never happen).",
-                                       e);
-        }
-    }
-
-    /**
-     * Like {@code print()}, but writes directly to a {@code String} and returns it.
-     */
-    public static String printToString(UnknownFieldSet fields) {
-        try {
-            StringBuilder text = new StringBuilder();
-            print(fields, text);
-            return text.toString();
-        } catch (IOException e) {
-            throw new RuntimeException("Writing to a StringBuilder threw an IOException (should never happen).",
-                                       e);
-        }
-    }
-
-    /**
-     * Parse a text-format message from {@code input} and merge the contents into {@code builder}.
-     */
-    public static void merge(Readable input, Message.Builder builder) throws IOException {
-        merge(input, ExtensionRegistry.getEmptyRegistry(), builder);
-    }
-
-    /**
-     * Parse a text-format message from {@code input} and merge the contents into {@code builder}.
-     */
-    public static void merge(CharSequence input, Message.Builder builder) throws ParseException {
-        merge(input, ExtensionRegistry.getEmptyRegistry(), builder);
-    }
-
-    /**
-     * Parse a text-format message from {@code input} and merge the contents into {@code builder}.
-     * Extensions will be recognized if they are registered in {@code extensionRegistry}.
-     */
-    public static void merge(Readable input,
-                             ExtensionRegistry extensionRegistry,
-                             Message.Builder builder) throws IOException {
-        // Read the entire input to a String then parse that.
-
-        // If StreamTokenizer were not quite so crippled, or if there were a kind
-        // of Reader that could read in chunks that match some particular regex,
-        // or if we wanted to write a custom Reader to tokenize our stream, then
-        // we would not have to read to one big String. Alas, none of these is
-        // the case. Oh well.
-
-        merge(JsonFormat.toStringBuilder(input), extensionRegistry, builder);
-    }
-
-    /**
-     * Parse a text-format message from {@code input} and merge the contents into {@code builder}.
-     * Extensions will be recognized if they are registered in {@code extensionRegistry}.
-     */
-    public static void merge(CharSequence input,
-                             ExtensionRegistry extensionRegistry,
-                             Message.Builder builder) throws ParseException {
-        Tokenizer tokenizer = new Tokenizer(input);
-
-        // Based on the state machine @ http://json.org/
-
-        tokenizer.consume("{"); // Needs to happen when the object starts.
-        while (!tokenizer.tryConsume("}")) { // Continue till the object is done
-            JsonFormat.mergeField(tokenizer, extensionRegistry, builder);
-        }
-    }
-
-    protected static class Tokenizer extends JsonFormat.Tokenizer {
-
-        /**
-         * Construct a tokenizer that parses tokens from the given text.
-         */
-        public Tokenizer(CharSequence text) {
-            super(text);
-        }
-
-        @Override
-        public String consumeIdentifier() throws ParseException {
-            String id = super.consumeIdentifier();
-            if ("_id".equals(id)) {
-                return "id";
-            } else if ("_rev".equals(id)) {
-                return "rev";
-            }
-            return id;
-        }
-    }
-
-    protected static class CouchDBGenerator extends JsonGenerator {
-
-        public CouchDBGenerator(Appendable output) {
-            super(output);
-        }
-
-        @Override
-        public void print(CharSequence text) throws IOException {
-            if ("id".equals(text)) {
-                super.print("_id");
-            } else if ("rev".equals(text)) {
-                super.print("_rev");
-            } else {
-                super.print(text);
-            }
-        }
-    }
-}

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 1338
4dkankan-common-redis/src/main/java/com/fdkankan/common/proto/format/JavaPropsFormat.java


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 1603
4dkankan-common-redis/src/main/java/com/fdkankan/common/proto/format/JsonFormat.java


+ 0 - 65
4dkankan-common-redis/src/main/java/com/fdkankan/common/utils/Base64Converter.java

@@ -1,65 +0,0 @@
-package com.fdkankan.common.utils;
-
-import java.io.UnsupportedEncodingException;
-import java.util.Base64;
-
-public class Base64Converter {
-
-    public final static Base64.Encoder encoder = Base64.getEncoder();
-    final static Base64.Decoder decoder = Base64.getDecoder();
-
-    /**
-     * 给字符串加密
-     * @param text
-     * @return
-     */
-    public static String encode(String text) {
-        byte[] textByte = new byte[0];
-        try {
-            textByte = text.getBytes("UTF-8");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-        String encodedText = encoder.encodeToString(textByte);
-        return encodedText;
-    }
-
-    /**
-     * 给字符串加密
-     * @param textByte
-     * @return
-     */
-    public static String encode(byte[] textByte) {
-        return encoder.encodeToString(textByte);
-    }
-
-    /**
-     * 将加密后的字符串进行解密
-     * @param encodedText
-     * @return
-     */
-    public static String decode(String encodedText) {
-        String text = null;
-        try {
-            text = new String(decoder.decode(encodedText), "UTF-8");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-        return text;
-    }
-
-    /**
-     * 根据逻辑截取加密后的密码
-     * @param text
-     * @return
-     */
-    public static String subText(String text){
-        //去掉前8位字符串
-        text = text.substring(8);
-        //去掉后8位字符串
-        text = text.substring(0, text.length() - 8);
-        //最后两个字符串换到前面,并且去掉剩下的后8位字符串
-        String result = text.substring(text.length() - 2) + text.substring(0, text.length() - 10);
-        return result;
-    }
-}

+ 0 - 55
4dkankan-common-redis/src/main/java/com/fdkankan/common/utils/ConstantCmd.java

@@ -1,55 +0,0 @@
-package com.fdkankan.common.utils;
-
-public class ConstantCmd {
-
-	//生成模型的命令
-	public static final String BUILD_MODEL_COMMAND = "bash /home/ubuntu/bin/Launcher.sh ";
-
-	//生成模型的命令
-	public static final String BUILD_MODEL_COMMAND2 = "bash /opt/ossutil/sshoss.sh ";
-
-	public static final String BUILD_MODEL_OLD_COMMAND = "bash /home/ubuntu/bin_old/Launcher.sh ";
-	public static final String BUILD_MODEL_SFM_COMMAND = "bash /home/ubuntu/run_sfm.sh ";
-
-	public static final String OBJ_TO_TXT = "bash /home/ubuntu/bin_old/obj2txt.sh ";
-
-	public static final String REBUILD_MODEL_FLLOR = "bash /home/ubuntu/bin/Panoramix_Floorplan.sh ";
-	//切图命令
-	public static final String CUT_IMG_COMMAND = "bash /home/ubuntu/OpenSfM/bin/run_cube.sh ";
-	//调整图片的命令
-	public static final String ADJUST_IMG_COMMAND = "/home/ubuntu/OpenSfM/bin/run_skybox ";
-	  
-	  
-	  
-	//转台拼图命令
-	public static final String BUILD_PANORAMA = "AutopanoGiga /home/ubuntu/data/";
-	//六目,拼图,计算,切图(二代)
-	public static final String BUILD_FOR_SIX = "bash /home/ubuntu/run_all_m6.sh ";
-
-	//合并音频
-	public static final String MERGE_VIDEO = "bash /monchickey/ffmpeg/bin/ff_synthesis.sh ";
-
-	//生成一段静音音频
-	public static final String CREATE_MUTE_VIDEO = "bash /monchickey/ffmpeg/bin/ff_mtue.sh ";
-
-	//将mp4文件转换成flv
-	public static final String MP4_TO_FLV = "bash /monchickey/ffmpeg/bin/ff_mp4TOflv.sh ";
-
-	//删除/mnt/data/下的数据脚本
-	public static final String DELETE_FILE = "bash /monchickey/ffmpeg/bin/delete.sh ";
-
-	public static final String OSS_UTIL_CP ="bash /opt/ossutil/oss.sh ";
-
-	public static final String OSS_FILE_CP = "bash /opt/ossutil/file.sh ";
-
-	public static final String MATTERPRO_CUT_IMG = "node /opt/4dkankan_scene/index.js ";
-
-	//激光相机 extra迁移
-	public static final String CP_JG_EXTRA = "bash /opt/ossutil/laser-copy.sh ";
-
-	public static final String CP_JG_ALL = "bash /opt/ossutil/laser-cp-r.sh ";
-
-	// 修改户型图json文件
-	public static final String TRANSLATE_HOUST_FLOOR = "/opt/Robin/JsonRead.out ";
-
-}

+ 0 - 39
4dkankan-common-utils/src/main/java/com/fdkankan/common/constant/ConstantFileName.java

@@ -1,39 +0,0 @@
-package com.fdkankan.common.constant;
-
-public class ConstantFileName {
-    //背景音乐
-    public static final String BACKGROUND_MUSIC = "bg.mp3";
-    //编辑页面,第二代
-    public static final String MODEL_DATAFILE = "modeldata.json";
-    public static final String HOT_DATAFILE = "hot.json";
-    public static final String MEDIA_DATAFILE = "mediaInfo.json";
-    public static final String SCREEN_CRP_DATAFILE = "screenCap";
-    //导览(一代)
-    public static final String GUIDE_DATAFILE = "tour.json";
-
-    //文件夹名称
-    public static final String GUIDE_MEDIA_FOLDER = "guide";
-    public static final String HOT_MEDIA_FOLDER = "hot";
-    public static final String OTHER_MEDIA_FOLDER = "other";
-
-    //论坛过滤文档
-    public static final String BBS_SENSITIVE = "SensitiveWord.txt";
-    public static final String LOGO_NAME = "logo.jpg";
-
-    //app部分
-    public static final String APP_FOLDER = "appupload";
-
-    public static final String FLOOR_LOGO_PIC_NAME = "floorLogoImg.png";
-
-    public static final String TOUR_LIST = "tourList.json";
-    public static final String VOICE_NAME = "201810";
-    public static final String WECHAT_VOICE_NAME = "wechat";
-    public static final String APP_VOICE_NAME = "app";
-
-    public static final String TOURLIST_FOLDER = "tour";
-    //public static final String TEMPFILES = "tempFiles";
-
-    public static final String modelUUID = "dacf7dfa24ae47fab8fcebfe4dc41ab9";
-
-    public static final String BUCKET_NAME = "4dkankan";
-}

+ 0 - 49
4dkankan-common-utils/src/main/java/com/fdkankan/common/constant/ConstantFilePath.java

@@ -1,49 +0,0 @@
-package com.fdkankan.common.constant;
-
-public class ConstantFilePath {
-    public static final String BASE_PATH = "/mnt/4Dkankan";
-    //论坛上传图片后,服务器存放的地址
-    public static final String BBS_IMAGES_PATH = "/mnt/4Dkankan/bbs/upload/image/";
-    // 用户上传图片
-    public static final String USER_IMAGES_PATH = "/mnt/4Dkankan/user/";
-    // 图片暂存地址(创建二维码等)
-    public static final String TEMP_IMAGES_PATH = "/mnt/4Dkankan/temp/upload/image/";
-    // 场景
-    public static final String SCENE_PATH = "/mnt/4Dkankan/scene/";
-    // 代理商
-    public static final String AGENT_PATH = "/mnt/4Dkankan/agent/";
-    //电子发票
-    public static final String INVOICE_PATH = "/mnt/4Dkankan/invoice/";
-    // 场景二维码
-    public static final String SCENE_QR_CODE_PATH = "/mnt/4Dkankan/sceneQRcode/";
-    // excel
-    public static final String EXCEL_PATH = "/mnt/4Dkankan/excel/";
-    //    public static final String EXCEL_PATH = "F:\\excel\\";
-    // medias
-    public static final String MEDIAS_PATH = "/mnt/4Dkankan/medias/";
-    // logo
-    public static final String LOGO_PATH = "/mnt/4Dkankan/logo/";
-    // login qr code
-    public static final String LOGIN_QR_CODE_PATH = "/mnt/4Dkankan/login/qrcode/";
-
-    public static final String WEIXIN_CERT = "/mnt/home/ubuntu/user/apiclient_cert.p12";
-
-    public static final String PREFIX = "/home/user";
-    public static final String CREATE_MODEL_PATH = PREFIX + "/photo_data/model/";
-    //大场景
-    public static final String CREATE_BIG_SCENE_PATH = PREFIX + "/photo_data/bigscene/";
-    //生成模型的路径
-    public static final String BUILD_MODEL_PATH = "/mnt/data/";
-    //生成模型的路径
-    public static String BUILD_MODEL_LASER_PATH ="/mnt-laser/data/";
-
-    //支付二维码图片存放路径
-    public static final String ALI_QRCODE_FOLDER = "/mnt/4Dkankan/alicode/";
-    public static final String WEIXIN_QRCODE_FOLDER = "/mnt/4Dkankan/weixincode/";
-
-    public static final String OSS_PREFIX = "home/";
-
-    public void setHardDiskLaser(String value){
-        ConstantFilePath.BUILD_MODEL_LASER_PATH = value;
-    }
-}

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 7340
4dkankan-common-utils/src/main/java/com/fdkankan/common/proto/BigSceneProto.java


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 4654
4dkankan-common-utils/src/main/java/com/fdkankan/common/proto/Common.java


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 4345
4dkankan-common-utils/src/main/java/com/fdkankan/common/proto/Visionmodeldata.java


+ 0 - 156
4dkankan-common-utils/src/main/java/com/fdkankan/common/proto/format/CouchDBFormat.java

@@ -1,156 +0,0 @@
-package com.fdkankan.common.proto.format;
-
-
-import com.google.protobuf.ExtensionRegistry;
-import com.google.protobuf.Message;
-import com.google.protobuf.UnknownFieldSet;
-
-import java.io.IOException;
-
-/**
- * Created by IntelliJ IDEA.
- * User: aantonov
- * Date: Mar 16, 2010
- * Time: 4:06:05 PM
- * To change this template use File | Settings | File Templates.
- */
-public class CouchDBFormat extends JsonFormat {
-
-    /**
-     * Outputs a textual representation of the Protocol Message supplied into the parameter output.
-     * (This representation is the new version of the classic "ProtocolPrinter" output from the
-     * original Protocol Buffer system)
-     */
-    public static void print(Message message, Appendable output) throws IOException {
-        CouchDBGenerator generator = new CouchDBGenerator(output);
-        generator.print("{");
-        print(message, generator);
-        generator.print("}");
-    }
-
-    /**
-     * Outputs a textual representation of {@code fields} to {@code output}.
-     */
-    public static void print(UnknownFieldSet fields, Appendable output) throws IOException {
-        CouchDBGenerator generator = new CouchDBGenerator(output);
-        generator.print("{");
-        printUnknownFields(fields, generator);
-        generator.print("}");
-    }
-
-    /**
-     * Like {@code print()}, but writes directly to a {@code String} and returns it.
-     */
-    public static String printToString(Message message) {
-        try {
-            StringBuilder text = new StringBuilder();
-            print(message, text);
-            return text.toString();
-        } catch (IOException e) {
-            throw new RuntimeException("Writing to a StringBuilder threw an IOException (should never happen).",
-                                       e);
-        }
-    }
-
-    /**
-     * Like {@code print()}, but writes directly to a {@code String} and returns it.
-     */
-    public static String printToString(UnknownFieldSet fields) {
-        try {
-            StringBuilder text = new StringBuilder();
-            print(fields, text);
-            return text.toString();
-        } catch (IOException e) {
-            throw new RuntimeException("Writing to a StringBuilder threw an IOException (should never happen).",
-                                       e);
-        }
-    }
-
-    /**
-     * Parse a text-format message from {@code input} and merge the contents into {@code builder}.
-     */
-    public static void merge(Readable input, Message.Builder builder) throws IOException {
-        merge(input, ExtensionRegistry.getEmptyRegistry(), builder);
-    }
-
-    /**
-     * Parse a text-format message from {@code input} and merge the contents into {@code builder}.
-     */
-    public static void merge(CharSequence input, Message.Builder builder) throws ParseException {
-        merge(input, ExtensionRegistry.getEmptyRegistry(), builder);
-    }
-
-    /**
-     * Parse a text-format message from {@code input} and merge the contents into {@code builder}.
-     * Extensions will be recognized if they are registered in {@code extensionRegistry}.
-     */
-    public static void merge(Readable input,
-                             ExtensionRegistry extensionRegistry,
-                             Message.Builder builder) throws IOException {
-        // Read the entire input to a String then parse that.
-
-        // If StreamTokenizer were not quite so crippled, or if there were a kind
-        // of Reader that could read in chunks that match some particular regex,
-        // or if we wanted to write a custom Reader to tokenize our stream, then
-        // we would not have to read to one big String. Alas, none of these is
-        // the case. Oh well.
-
-        merge(JsonFormat.toStringBuilder(input), extensionRegistry, builder);
-    }
-
-    /**
-     * Parse a text-format message from {@code input} and merge the contents into {@code builder}.
-     * Extensions will be recognized if they are registered in {@code extensionRegistry}.
-     */
-    public static void merge(CharSequence input,
-                             ExtensionRegistry extensionRegistry,
-                             Message.Builder builder) throws ParseException {
-        Tokenizer tokenizer = new Tokenizer(input);
-
-        // Based on the state machine @ http://json.org/
-
-        tokenizer.consume("{"); // Needs to happen when the object starts.
-        while (!tokenizer.tryConsume("}")) { // Continue till the object is done
-            JsonFormat.mergeField(tokenizer, extensionRegistry, builder);
-        }
-    }
-
-    protected static class Tokenizer extends JsonFormat.Tokenizer {
-
-        /**
-         * Construct a tokenizer that parses tokens from the given text.
-         */
-        public Tokenizer(CharSequence text) {
-            super(text);
-        }
-
-        @Override
-        public String consumeIdentifier() throws ParseException {
-            String id = super.consumeIdentifier();
-            if ("_id".equals(id)) {
-                return "id";
-            } else if ("_rev".equals(id)) {
-                return "rev";
-            }
-            return id;
-        }
-    }
-
-    protected static class CouchDBGenerator extends JsonGenerator {
-
-        public CouchDBGenerator(Appendable output) {
-            super(output);
-        }
-
-        @Override
-        public void print(CharSequence text) throws IOException {
-            if ("id".equals(text)) {
-                super.print("_id");
-            } else if ("rev".equals(text)) {
-                super.print("_rev");
-            } else {
-                super.print(text);
-            }
-        }
-    }
-}

+ 0 - 703
4dkankan-common-utils/src/main/java/com/fdkankan/common/proto/format/HtmlFormat.java

@@ -1,703 +0,0 @@
-package com.fdkankan.common.proto.format;
-/* 
-    Copyright (c) 2009, Orbitz World Wide
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without modification, 
-    are permitted provided that the following conditions are met:
-
-        * Redistributions of source code must retain the above copyright notice, 
-          this list of conditions and the following disclaimer.
-        * Redistributions in binary form must reproduce the above copyright notice, 
-          this list of conditions and the following disclaimer in the documentation 
-          and/or other materials provided with the distribution.
-        * Neither the name of the Orbitz World Wide nor the names of its contributors 
-          may be used to endorse or promote products derived from this software 
-          without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-    OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-
-import com.google.protobuf.ByteString;
-import com.google.protobuf.Descriptors.EnumValueDescriptor;
-import com.google.protobuf.Descriptors.FieldDescriptor;
-import com.google.protobuf.Message;
-import com.google.protobuf.UnknownFieldSet;
-
-import java.io.IOException;
-import java.math.BigInteger;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-/**
- * Provide ascii html formatting support for proto2 instances.
- * <p>
- * (c) 2009-10 Orbitz World Wide. All Rights Reserved.
- * 
- * @author eliran.bivas@gmail.com Eliran Bivas
- * @version $HtmlFormat.java Mar 12, 2009 4:00:33 PM$
- */
-public final class HtmlFormat {
-
-    private static final String META_CONTENT = "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />";
-    private static final String MAIN_DIV_STYLE = "color: black; font-size: 14px; font-family: sans-serif; font-weight: bolder; margin-bottom: 10px;";
-    private static final String FIELD_NAME_STYLE = "font-weight: bold; color: #669966;font-size: 14px; font-family: sans-serif;";
-    private static final String FIELD_VALUE_STYLE = "color: #3300FF;font-size: 13px; font-family: sans-serif;";
-
-    /**
-     * Outputs a textual representation of the Protocol Message supplied into the parameter output.
-     * (This representation is the new version of the classic "ProtocolPrinter" output from the
-     * original Protocol Buffer system)
-     */
-    public static void print(Message message, Appendable output) throws IOException {
-        HtmlGenerator generator = new HtmlGenerator(output);
-        printTitle(message, generator);
-        print(message, generator);
-        generator.print("</body></html>");
-    }
-
-    private static void printTitle(final Message message, final HtmlGenerator generator) throws IOException {
-        generator.print("<html><head>");
-        generator.print(META_CONTENT);
-        generator.print("<title>");
-        generator.print(message.getDescriptorForType().getFullName());
-        generator.print("</title></head><body>");
-        generator.print("<div style=\"");
-        generator.print(MAIN_DIV_STYLE);
-        generator.print("\">message : ");
-        generator.print(message.getDescriptorForType().getFullName());
-        generator.print("</div>");
-    }
-
-    /**
-     * Outputs a textual representation of {@code fields} to {@code output}.
-     */
-    public static void print(UnknownFieldSet fields, Appendable output) throws IOException {
-        HtmlGenerator generator = new HtmlGenerator(output);
-        generator.print("<html>");
-        generator.print(META_CONTENT);
-        generator.print("</head><body>");
-        printUnknownFields(fields, generator);
-        generator.print("</body></html>");
-    }
-
-    /**
-     * Like {@code print()}, but writes directly to a {@code String} and returns it.
-     */
-    public static String printToString(Message message) {
-        try {
-            StringBuilder text = new StringBuilder();
-            print(message, text);
-            return text.toString();
-        } catch (IOException e) {
-            throw new RuntimeException("Writing to a StringBuilder threw an IOException (should never happen).",
-                                       e);
-        }
-    }
-
-    /**
-     * Like {@code print()}, but writes directly to a {@code String} and returns it.
-     */
-    public static String printToString(UnknownFieldSet fields) {
-        try {
-            StringBuilder text = new StringBuilder();
-            print(fields, text);
-            return text.toString();
-        } catch (IOException e) {
-            throw new RuntimeException("Writing to a StringBuilder threw an IOException (should never happen).",
-                                       e);
-        }
-    }
-
-    private static void print(Message message, HtmlGenerator generator) throws IOException {
-
-        for (Map.Entry<FieldDescriptor, Object> field : message.getAllFields().entrySet()) {
-            printField(field.getKey(), field.getValue(), generator);
-        }
-        printUnknownFields(message.getUnknownFields(), generator);
-    }
-
-    public static void printField(FieldDescriptor field, Object value, HtmlGenerator generator) throws IOException {
-
-        if (field.isRepeated()) {
-            // Repeated field. Print each element.
-            for (Object element : (List<?>) value) {
-                printSingleField(field, element, generator);
-            }
-        } else {
-            printSingleField(field, value, generator);
-        }
-    }
-
-    private static void printSingleField(FieldDescriptor field,
-                                         Object value,
-                                         HtmlGenerator generator) throws IOException {
-        if (field.isExtension()) {
-            generator.print("[<span style=\"");
-            generator.print(FIELD_NAME_STYLE);
-            generator.print("\">");
-            // We special-case MessageSet elements for compatibility with proto1.
-            if (field.getContainingType().getOptions().getMessageSetWireFormat()
-                            && (field.getType() == FieldDescriptor.Type.MESSAGE) && (field.isOptional())
-                            // object equality
-                            && (field.getExtensionScope() == field.getMessageType())) {
-                generator.print(field.getMessageType().getFullName());
-            } else {
-                generator.print(field.getFullName());
-            }
-            generator.print("</span>]");
-        } else {
-            generator.print("<span style=\"");
-            generator.print(FIELD_NAME_STYLE);
-            generator.print("\">");
-            if (field.getType() == FieldDescriptor.Type.GROUP) {
-                // Groups must be serialized with their original capitalization.
-                generator.print(field.getMessageType().getName());
-            } else {
-                generator.print(field.getName());
-            }
-            generator.print("</span>");
-        }
-
-        if (field.getJavaType() == FieldDescriptor.JavaType.MESSAGE) {
-            generator.print(" <span style=\"color: red;\">{</span><br/>");
-            generator.indent();
-        } else {
-            generator.print(": ");
-        }
-
-        printFieldValue(field, value, generator);
-
-        if (field.getJavaType() == FieldDescriptor.JavaType.MESSAGE) {
-            generator.outdent();
-            generator.print("<span style=\"color: red;\">}</span>");
-        }
-        generator.print("<br/>");
-    }
-
-    private static void printFieldValue(FieldDescriptor field, Object value, HtmlGenerator generator) throws IOException {
-        generator.print("<span style=\"");
-        generator.print(FIELD_VALUE_STYLE);
-        generator.print("\">");
-        switch (field.getType()) {
-            case INT32:
-            case INT64:
-            case SINT32:
-            case SINT64:
-            case SFIXED32:
-            case SFIXED64:
-            case FLOAT:
-            case DOUBLE:
-            case BOOL:
-                // Good old toString() does what we want for these types.
-                generator.print(value.toString());
-                break;
-
-            case UINT32:
-            case FIXED32:
-                generator.print(unsignedToString((Integer) value));
-                break;
-
-            case UINT64:
-            case FIXED64:
-                generator.print(unsignedToString((Long) value));
-                break;
-
-            case STRING:
-                generator.print("\"");
-                generator.print(value.toString());
-                generator.print("\"");
-                break;
-
-            case BYTES: {
-                generator.print("\"");
-                generator.print(escapeBytes((ByteString) value));
-                generator.print("\"");
-                break;
-            }
-
-            case ENUM: {
-                generator.print(((EnumValueDescriptor) value).getName());
-                break;
-            }
-
-            case MESSAGE:
-            case GROUP:
-                print((Message) value, generator);
-                break;
-        }
-        generator.print("</span>");
-    }
-
-    private static void printUnknownFields(UnknownFieldSet unknownFields, HtmlGenerator generator) throws IOException {
-        for (Map.Entry<Integer, UnknownFieldSet.Field> entry : unknownFields.asMap().entrySet()) {
-            UnknownFieldSet.Field field = entry.getValue();
-
-            for (long value : field.getVarintList()) {
-                generator.print(entry.getKey().toString());
-                generator.print(": ");
-                generator.print(unsignedToString(value));
-                generator.print("<br/>");
-            }
-            for (int value : field.getFixed32List()) {
-                generator.print(entry.getKey().toString());
-                generator.print(": ");
-                generator.print(String.format((Locale) null, "0x%08x", value));
-                generator.print("<br/>");
-            }
-            for (long value : field.getFixed64List()) {
-                generator.print(entry.getKey().toString());
-                generator.print(": ");
-                generator.print(String.format((Locale) null, "0x%016x", value));
-                generator.print("<br/>");
-            }
-            for (ByteString value : field.getLengthDelimitedList()) {
-                generator.print(entry.getKey().toString());
-                generator.print(": \"");
-                generator.print(escapeBytes(value));
-                generator.print("\"<br/>");
-            }
-            for (UnknownFieldSet value : field.getGroupList()) {
-                generator.print(entry.getKey().toString());
-                generator.print(" <span style=\"color: red;\">{</span><br/>");
-                generator.indent();
-                printUnknownFields(value, generator);
-                generator.outdent();
-                generator.print("<span style=\"color: red;\">}</span><br/>");
-            }
-        }
-    }
-
-    /**
-     * Convert an unsigned 32-bit integer to a string.
-     */
-    private static String unsignedToString(int value) {
-        if (value >= 0) {
-            return Integer.toString(value);
-        } else {
-            return Long.toString((value) & 0x00000000FFFFFFFFL);
-        }
-    }
-
-    /**
-     * Convert an unsigned 64-bit integer to a string.
-     */
-    private static String unsignedToString(long value) {
-        if (value >= 0) {
-            return Long.toString(value);
-        } else {
-            // Pull off the most-significant bit so that BigInteger doesn't think
-            // the number is negative, then set it again using setBit().
-            return BigInteger.valueOf(value & 0x7FFFFFFFFFFFFFFFL).setBit(63).toString();
-        }
-    }
-
-    /**
-     * An inner class for writing text to the output stream.
-     */
-    static private final class HtmlGenerator {
-
-        Appendable output;
-        boolean atStartOfLine = true;
-
-        public HtmlGenerator(Appendable output) {
-            this.output = output;
-        }
-
-        /**
-         * Indent text by two spaces. After calling Indent(), two spaces will be inserted at the
-         * beginning of each line of text. Indent() may be called multiple times to produce deeper
-         * indents.
-         * 
-         * @throws IOException
-         */
-        public void indent() throws IOException {
-            print("<div style=\"margin-left: 25px\">");
-        }
-
-        /**
-         * Reduces the current indent level by two spaces, or crashes if the indent level is zero.
-         * 
-         * @throws IOException
-         */
-        public void outdent() throws IOException {
-            print("</div>");
-        }
-
-        /**
-         * Print text to the output stream.
-         */
-        public void print(CharSequence text) throws IOException {
-            int size = text.length();
-            int pos = 0;
-
-            for (int i = 0; i < size; i++) {
-                if (text.charAt(i) == '\n') {
-                    write("<br/>", i - pos + 1);
-                    pos = i + 1;
-                    atStartOfLine = true;
-                }
-            }
-            write(text.subSequence(pos, size), size - pos);
-        }
-
-        private void write(CharSequence data, int size) throws IOException {
-            if (size == 0) {
-                return;
-            }
-            if (atStartOfLine) {
-                atStartOfLine = false;
-            }
-            output.append(data);
-        }
-    }
-
-    // =================================================================
-    // Utility functions
-    //
-    // Some of these methods are package-private because Descriptors.java uses
-    // them.
-
-    /**
-     * Escapes bytes in the format used in protocol buffer text format, which is the same as the
-     * format used for C string literals. All bytes that are not printable 7-bit ASCII characters
-     * are escaped, as well as backslash, single-quote, and double-quote characters. Characters for
-     * which no defined short-hand escape sequence is defined will be escaped using 3-digit octal
-     * sequences.
-     */
-    static String escapeBytes(ByteString input) {
-        StringBuilder builder = new StringBuilder(input.size());
-        for (int i = 0; i < input.size(); i++) {
-            byte b = input.byteAt(i);
-            switch (b) {
-                // Java does not recognize \a or \v, apparently.
-                case 0x07:
-                    builder.append("\\a");
-                    break;
-                case '\b':
-                    builder.append("\\b");
-                    break;
-                case '\f':
-                    builder.append("\\f");
-                    break;
-                case '\n':
-                    builder.append("\\n");
-                    break;
-                case '\r':
-                    builder.append("\\r");
-                    break;
-                case '\t':
-                    builder.append("\\t");
-                    break;
-                case 0x0b:
-                    builder.append("\\v");
-                    break;
-                case '\\':
-                    builder.append("\\\\");
-                    break;
-                case '\'':
-                    builder.append("\\\'");
-                    break;
-                case '"':
-                    builder.append("\\\"");
-                    break;
-                default:
-                    if (b >= 0x20) {
-                        builder.append((char) b);
-                    } else {
-                        builder.append('\\');
-                        builder.append((char) ('0' + ((b >>> 6) & 3)));
-                        builder.append((char) ('0' + ((b >>> 3) & 7)));
-                        builder.append((char) ('0' + (b & 7)));
-                    }
-                    break;
-            }
-        }
-        return builder.toString();
-    }
-
-    /**
-     * Un-escape a byte sequence as escaped using
-     * {@link #escapeBytes(com.googlecode.protobuf.format.ByteString)}. Two-digit hex escapes (starting with
-     * "\x") are also recognized.
-     */
-    static ByteString unescapeBytes(CharSequence input) throws InvalidEscapeSequence {
-        byte[] result = new byte[input.length()];
-        int pos = 0;
-        for (int i = 0; i < input.length(); i++) {
-            char c = input.charAt(i);
-            if (c == '\\') {
-                if (i + 1 < input.length()) {
-                    ++i;
-                    c = input.charAt(i);
-                    if (isOctal(c)) {
-                        // Octal escape.
-                        int code = digitValue(c);
-                        if ((i + 1 < input.length()) && isOctal(input.charAt(i + 1))) {
-                            ++i;
-                            code = code * 8 + digitValue(input.charAt(i));
-                        }
-                        if ((i + 1 < input.length()) && isOctal(input.charAt(i + 1))) {
-                            ++i;
-                            code = code * 8 + digitValue(input.charAt(i));
-                        }
-                        result[pos++] = (byte) code;
-                    } else {
-                        switch (c) {
-                            case 'a':
-                                result[pos++] = 0x07;
-                                break;
-                            case 'b':
-                                result[pos++] = '\b';
-                                break;
-                            case 'f':
-                                result[pos++] = '\f';
-                                break;
-                            case 'n':
-                                result[pos++] = '\n';
-                                break;
-                            case 'r':
-                                result[pos++] = '\r';
-                                break;
-                            case 't':
-                                result[pos++] = '\t';
-                                break;
-                            case 'v':
-                                result[pos++] = 0x0b;
-                                break;
-                            case '\\':
-                                result[pos++] = '\\';
-                                break;
-                            case '\'':
-                                result[pos++] = '\'';
-                                break;
-                            case '"':
-                                result[pos++] = '\"';
-                                break;
-
-                            case 'x':
-                                // hex escape
-                                int code = 0;
-                                if ((i + 1 < input.length()) && isHex(input.charAt(i + 1))) {
-                                    ++i;
-                                    code = digitValue(input.charAt(i));
-                                } else {
-                                    throw new InvalidEscapeSequence("Invalid escape sequence: '\\x' with no digits");
-                                }
-                                if ((i + 1 < input.length()) && isHex(input.charAt(i + 1))) {
-                                    ++i;
-                                    code = code * 16 + digitValue(input.charAt(i));
-                                }
-                                result[pos++] = (byte) code;
-                                break;
-
-                            default:
-                                throw new InvalidEscapeSequence("Invalid escape sequence: '\\" + c
-                                                                + "'");
-                        }
-                    }
-                } else {
-                    throw new InvalidEscapeSequence("Invalid escape sequence: '\\' at end of string.");
-                }
-            } else {
-                result[pos++] = (byte) c;
-            }
-        }
-
-        return ByteString.copyFrom(result, 0, pos);
-    }
-
-    /**
-     * Thrown by {@link JsonFormat#unescapeBytes} and {@link JsonFormat#unescapeText} when an
-     * invalid escape sequence is seen.
-     */
-    static class InvalidEscapeSequence extends IOException {
-
-        private static final long serialVersionUID = 1L;
-
-        public InvalidEscapeSequence(String description) {
-            super(description);
-        }
-    }
-
-    /**
-     * Like {@link #escapeBytes(com.googlecode.protobuf.format.ByteString)}, but escapes a text string.
-     * Non-ASCII characters are first encoded as UTF-8, then each byte is escaped individually as a
-     * 3-digit octal escape. Yes, it's weird.
-     */
-    static String escapeText(String input) {
-        return escapeBytes(ByteString.copyFromUtf8(input));
-    }
-
-    /**
-     * Un-escape a text string as escaped using {@link #escapeText(String)}. Two-digit hex escapes
-     * (starting with "\x") are also recognized.
-     */
-    static String unescapeText(String input) throws InvalidEscapeSequence {
-        return unescapeBytes(input).toStringUtf8();
-    }
-
-    /**
-     * Is this an octal digit?
-     */
-    private static boolean isOctal(char c) {
-        return ('0' <= c) && (c <= '7');
-    }
-
-    /**
-     * Is this a hex digit?
-     */
-    private static boolean isHex(char c) {
-        return (('0' <= c) && (c <= '9')) || (('a' <= c) && (c <= 'f'))
-        || (('A' <= c) && (c <= 'F'));
-    }
-
-    /**
-     * Interpret a character as a digit (in any base up to 36) and return the numeric value. This is
-     * like {@code Character.digit()} but we don't accept non-ASCII digits.
-     */
-    private static int digitValue(char c) {
-        if (('0' <= c) && (c <= '9')) {
-            return c - '0';
-        } else if (('a' <= c) && (c <= 'z')) {
-            return c - 'a' + 10;
-        } else {
-            return c - 'A' + 10;
-        }
-    }
-
-    /**
-     * Parse a 32-bit signed integer from the text. Unlike the Java standard {@code
-     * Integer.parseInt()}, this function recognizes the prefixes "0x" and "0" to signify
-     * hexidecimal and octal numbers, respectively.
-     */
-    static int parseInt32(String text) throws NumberFormatException {
-        return (int) parseInteger(text, true, false);
-    }
-
-    /**
-     * Parse a 32-bit unsigned integer from the text. Unlike the Java standard {@code
-     * Integer.parseInt()}, this function recognizes the prefixes "0x" and "0" to signify
-     * hexidecimal and octal numbers, respectively. The result is coerced to a (signed) {@code int}
-     * when returned since Java has no unsigned integer type.
-     */
-    static int parseUInt32(String text) throws NumberFormatException {
-        return (int) parseInteger(text, false, false);
-    }
-
-    /**
-     * Parse a 64-bit signed integer from the text. Unlike the Java standard {@code
-     * Integer.parseInt()}, this function recognizes the prefixes "0x" and "0" to signify
-     * hexidecimal and octal numbers, respectively.
-     */
-    static long parseInt64(String text) throws NumberFormatException {
-        return parseInteger(text, true, true);
-    }
-
-    /**
-     * Parse a 64-bit unsigned integer from the text. Unlike the Java standard {@code
-     * Integer.parseInt()}, this function recognizes the prefixes "0x" and "0" to signify
-     * hexidecimal and octal numbers, respectively. The result is coerced to a (signed) {@code long}
-     * when returned since Java has no unsigned long type.
-     */
-    static long parseUInt64(String text) throws NumberFormatException {
-        return parseInteger(text, false, true);
-    }
-
-    private static long parseInteger(String text, boolean isSigned, boolean isLong) throws NumberFormatException {
-        int pos = 0;
-
-        boolean negative = false;
-        if (text.startsWith("-", pos)) {
-            if (!isSigned) {
-                throw new NumberFormatException("Number must be positive: " + text);
-            }
-            ++pos;
-            negative = true;
-        }
-
-        int radix = 10;
-        if (text.startsWith("0x", pos)) {
-            pos += 2;
-            radix = 16;
-        } else if (text.startsWith("0", pos)) {
-            radix = 8;
-        }
-
-        String numberText = text.substring(pos);
-
-        long result = 0;
-        if (numberText.length() < 16) {
-            // Can safely assume no overflow.
-            result = Long.parseLong(numberText, radix);
-            if (negative) {
-                result = -result;
-            }
-
-            // Check bounds.
-            // No need to check for 64-bit numbers since they'd have to be 16 chars
-            // or longer to overflow.
-            if (!isLong) {
-                if (isSigned) {
-                    if ((result > Integer.MAX_VALUE) || (result < Integer.MIN_VALUE)) {
-                        throw new NumberFormatException("Number out of range for 32-bit signed integer: "
-                                                        + text);
-                    }
-                } else {
-                    if ((result >= (1L << 32)) || (result < 0)) {
-                        throw new NumberFormatException("Number out of range for 32-bit unsigned integer: "
-                                                        + text);
-                    }
-                }
-            }
-        } else {
-            BigInteger bigValue = new BigInteger(numberText, radix);
-            if (negative) {
-                bigValue = bigValue.negate();
-            }
-
-            // Check bounds.
-            if (!isLong) {
-                if (isSigned) {
-                    if (bigValue.bitLength() > 31) {
-                        throw new NumberFormatException("Number out of range for 32-bit signed integer: "
-                                                        + text);
-                    }
-                } else {
-                    if (bigValue.bitLength() > 32) {
-                        throw new NumberFormatException("Number out of range for 32-bit unsigned integer: "
-                                                        + text);
-                    }
-                }
-            } else {
-                if (isSigned) {
-                    if (bigValue.bitLength() > 63) {
-                        throw new NumberFormatException("Number out of range for 64-bit signed integer: "
-                                                        + text);
-                    }
-                } else {
-                    if (bigValue.bitLength() > 64) {
-                        throw new NumberFormatException("Number out of range for 64-bit unsigned integer: "
-                                                        + text);
-                    }
-                }
-            }
-
-            result = bigValue.longValue();
-        }
-
-        return result;
-    }
-}

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 1338
4dkankan-common-utils/src/main/java/com/fdkankan/common/proto/format/JavaPropsFormat.java


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 1603
4dkankan-common-utils/src/main/java/com/fdkankan/common/proto/format/JsonFormat.java


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 1333
4dkankan-common-utils/src/main/java/com/fdkankan/common/proto/format/XmlFormat.java


+ 0 - 65
4dkankan-common-utils/src/main/java/com/fdkankan/common/utils/Base64Converter.java

@@ -1,65 +0,0 @@
-package com.fdkankan.common.utils;
-
-import java.io.UnsupportedEncodingException;
-import java.util.Base64;
-
-public class Base64Converter {
-
-    public final static Base64.Encoder encoder = Base64.getEncoder();
-    final static Base64.Decoder decoder = Base64.getDecoder();
-
-    /**
-     * 给字符串加密
-     * @param text
-     * @return
-     */
-    public static String encode(String text) {
-        byte[] textByte = new byte[0];
-        try {
-            textByte = text.getBytes("UTF-8");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-        String encodedText = encoder.encodeToString(textByte);
-        return encodedText;
-    }
-
-    /**
-     * 给字符串加密
-     * @param textByte
-     * @return
-     */
-    public static String encode(byte[] textByte) {
-        return encoder.encodeToString(textByte);
-    }
-
-    /**
-     * 将加密后的字符串进行解密
-     * @param encodedText
-     * @return
-     */
-    public static String decode(String encodedText) {
-        String text = null;
-        try {
-            text = new String(decoder.decode(encodedText), "UTF-8");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-        return text;
-    }
-
-    /**
-     * 根据逻辑截取加密后的密码
-     * @param text
-     * @return
-     */
-    public static String subText(String text){
-        //去掉前8位字符串
-        text = text.substring(8);
-        //去掉后8位字符串
-        text = text.substring(0, text.length() - 8);
-        //最后两个字符串换到前面,并且去掉剩下的后8位字符串
-        String result = text.substring(text.length() - 2) + text.substring(0, text.length() - 10);
-        return result;
-    }
-}

+ 0 - 55
4dkankan-common-utils/src/main/java/com/fdkankan/common/utils/ConstantCmd.java

@@ -1,55 +0,0 @@
-package com.fdkankan.common.utils;
-
-public class ConstantCmd {
-
-	//生成模型的命令
-	public static final String BUILD_MODEL_COMMAND = "bash /home/ubuntu/bin/Launcher.sh ";
-
-	//生成模型的命令
-	public static final String BUILD_MODEL_COMMAND2 = "bash /opt/ossutil/sshoss.sh ";
-
-	public static final String BUILD_MODEL_OLD_COMMAND = "bash /home/ubuntu/bin_old/Launcher.sh ";
-	public static final String BUILD_MODEL_SFM_COMMAND = "bash /home/ubuntu/run_sfm.sh ";
-
-	public static final String OBJ_TO_TXT = "bash /home/ubuntu/bin_old/obj2txt.sh ";
-
-	public static final String REBUILD_MODEL_FLLOR = "bash /home/ubuntu/bin/Panoramix_Floorplan.sh ";
-	//切图命令
-	public static final String CUT_IMG_COMMAND = "bash /home/ubuntu/OpenSfM/bin/run_cube.sh ";
-	//调整图片的命令
-	public static final String ADJUST_IMG_COMMAND = "/home/ubuntu/OpenSfM/bin/run_skybox ";
-	  
-	  
-	  
-	//转台拼图命令
-	public static final String BUILD_PANORAMA = "AutopanoGiga /home/ubuntu/data/";
-	//六目,拼图,计算,切图(二代)
-	public static final String BUILD_FOR_SIX = "bash /home/ubuntu/run_all_m6.sh ";
-
-	//合并音频
-	public static final String MERGE_VIDEO = "bash /monchickey/ffmpeg/bin/ff_synthesis.sh ";
-
-	//生成一段静音音频
-	public static final String CREATE_MUTE_VIDEO = "bash /monchickey/ffmpeg/bin/ff_mtue.sh ";
-
-	//将mp4文件转换成flv
-	public static final String MP4_TO_FLV = "bash /monchickey/ffmpeg/bin/ff_mp4TOflv.sh ";
-
-	//删除/mnt/data/下的数据脚本
-	public static final String DELETE_FILE = "bash /monchickey/ffmpeg/bin/delete.sh ";
-
-	public static final String OSS_UTIL_CP ="bash /opt/ossutil/oss.sh ";
-
-	public static final String OSS_FILE_CP = "bash /opt/ossutil/file.sh ";
-
-	public static final String MATTERPRO_CUT_IMG = "node /opt/4dkankan_scene/index.js ";
-
-	//激光相机 extra迁移
-	public static final String CP_JG_EXTRA = "bash /opt/ossutil/laser-copy.sh ";
-
-	public static final String CP_JG_ALL = "bash /opt/ossutil/laser-cp-r.sh ";
-
-	// 修改户型图json文件
-	public static final String TRANSLATE_HOUST_FLOOR = "/opt/Robin/JsonRead.out ";
-
-}

+ 0 - 602
4dkankan-common-utils/src/main/java/com/fdkankan/common/utils/CreateObjUtil.java

@@ -1,602 +0,0 @@
-package com.fdkankan.common.utils;
-
-import com.fdkankan.common.constant.ConstantFileName;
-import com.fdkankan.common.constant.ConstantFilePath;
-import com.fdkankan.common.proto.BigSceneProto;
-import com.fdkankan.common.proto.Common;
-import com.fdkankan.common.proto.Visionmodeldata;
-import com.fdkankan.common.proto.format.JsonFormat;
-import com.google.protobuf.TextFormat;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.util.StopWatch;
-
-import java.io.*;
-import java.util.HashMap;
-import java.util.Map;
-
-public class CreateObjUtil {
-
-	private static Logger log = LoggerFactory.getLogger(CreateObjUtil.class);
-
-	public void saveuploadImgs(String folderName) throws IOException, Exception
-	{
-		log.info("开始计算");
-		String command = "bash /home/ubuntu/photoscan-pro/build_model.sh "+folderName;
-		callshell(command);
-		boolean flag = false;
-		String sPath =  ConstantFilePath.CREATE_MODEL_PATH+folderName+File.separator+"mesh"+File.separator+"mesh.obj";
-		while(!flag)
-		{
-			flag = isModel(sPath,folderName);
-		}
-		log.info("计算完毕");
-	}
-	
-	public void saveuploadImgs2(String folderName) throws IOException, Exception
-	{
-		log.info("开始计算");
-		String command = "bash /home/ubuntu/photoscan-pro/build_bigscene.sh "+folderName;
-		callshell(command);
-		boolean flag = false;
-		String sPath = ConstantFilePath.CREATE_BIG_SCENE_PATH+folderName+File.separator+"mesh"+File.separator+"mesh.obj";
-		while(!flag)
-		{
-			flag = isModel(sPath,folderName);
-		}
-		log.info("计算完毕");
-		log.info("obj和camera转换成大场景要的格式");
-		convertobjTotxt( folderName);
-		
-	}
-
-	//开始建模
-	public static void unRar(String rarPath,String dataPath) throws Exception{
-		log.info("解压rar开始");
-		String command = "unrar e " + rarPath + " " + dataPath;
-		callshell(command);
-		log.info("解压rar完毕:" + command);
-	}
-
-	public static void unZip(String zipPath,String dataPath) throws Exception{
-		log.info("解压zip开始");
-		String command = "unzip -O GBK/GB18030CP936 " + zipPath + " -d " + dataPath;
-		callshell(command);
-		log.info("解压zip完毕:" + command);
-	}
-
-	//开始建模
-	public static void build3dModel(String folderName,String isModel) throws Exception{
-		log.info("开始建模");
-		String command = ConstantCmd.BUILD_MODEL_COMMAND+folderName;
-		callshell(command);
-		log.info("计算完毕:" + command);
-	}
-
-	//开始建模
-	public static void build3dModel2(String folderName,String isModel) throws Exception{
-		log.info("开始建模");
-		String command = ConstantCmd.BUILD_MODEL_COMMAND2+folderName;
-		callshell(command);
-		log.info("计算完毕:" + command);
-	}
-
-	//开始建模
-	public static void build3dModelOld(String folderName,String isModel) throws Exception{
-		log.info("开始v2建模");
-		String command = ConstantCmd.BUILD_MODEL_OLD_COMMAND+folderName;
-		callshell(command);
-		log.info("计算v2完毕:" + command);
-	}
-
-	//开始建模
-	public static void translateHoustfloorJSONFile(String filePath,String outputPath) throws Exception{
-		log.info("开始转换houst_floor.json");
-		String command = ConstantCmd.TRANSLATE_HOUST_FLOOR + filePath + " " + outputPath;
-		callshell(command);
-		log.info("转换houst_floor.json 结束");
-	}
-
-	//激光相机复制资源
-	public static void cpfile(String filepathOld,String filepathNew) throws Exception{
-		log.info("开始复制");
-		String command = ConstantCmd.CP_JG_EXTRA+ " " + filepathOld + " " + filepathNew;
-		callshell(command);
-		log.info("复制完毕:" + command);
-	}
-
-
-	//激光相机复制资源laser下的全部资源
-	public static void cplaserfile(String filepathOld,String filepathNew) throws Exception{
-		log.info("开始复制");
-		String command = ConstantCmd.CP_JG_ALL+ " " + filepathOld + " " + filepathNew;
-		callshell(command);
-		log.info("复制完毕:" + command);
-	}
-	
-	//开始建模
-	public void build3dModelSFM(String folderName,String isModel) throws Exception{
-		log.info("开始建模");
-		String command = ConstantCmd.BUILD_MODEL_SFM_COMMAND+folderName+" "+isModel;
-		callshell(command);
-		log.info("计算完毕");
-	}
-
-	//obj文件转换问txt
-	public static void objToTxt(String folderName,String isModel) throws Exception{
-		log.info("obj2txt开始转换");
-		String command = ConstantCmd.OBJ_TO_TXT+folderName;
-		callshell(command);
-		log.info("转换完毕:" + command);
-	}
-
-	public void rebuildModelFllor(String folderName, String isModel) {
-		try{
-			log.info("开始建模");
-			String command = ConstantCmd.REBUILD_MODEL_FLLOR+folderName+" "+isModel;
-			callshell(command);
-			log.info("计算完毕");
-		}
-		catch(Exception e)
-		{
-			e.printStackTrace();
-		}
-	}
-
-	//切图
-	public void cutImgs(String[] imgNames ,String folderName)
-	{
-		try{
-			log.info("开始切图");
-			for(int i=0;i<imgNames.length;++i)
-			{
-				String imgName=imgNames[i].replace(".jpg", "");
-				String command = ConstantCmd.CUT_IMG_COMMAND+folderName+" "+imgName;
-				callshell(command);
-			}
-			log.info("切图完毕");
-		}
-		catch(Exception e)
-		{
-			e.printStackTrace();
-		}
-	}
-	
-	//调整切图
-	public void adjustImgs(String folderName)
-	{
-		try{
-			String command = ConstantCmd.ADJUST_IMG_COMMAND + folderName;
-			log.info("开始调整图片");
-			callshell(command);
-			log.info("调整图片完毕");
-		}
-		catch(Exception e)
-		{
-			e.printStackTrace();
-		}
-	}
-	
-	//obj和camera转换成大场景要的格式
-	public void convertobjTotxt(String folderName) throws Exception
-	{
-		//obj
-		String command = "/home/ubuntu/photoscan-pro/main/mesh/mesh "+folderName;
-		callshell(command);
-		//camera
-		command = "/home/ubuntu/photoscan-pro/main/read_camera/read_camera "+folderName;
-		callshell(command);
-		
-		String prefix = ConstantFilePath.CREATE_BIG_SCENE_PATH+folderName+File.separator+"data"+File.separator;
-		String srcpath = prefix +"mesh.txt";
-		String despath = prefix +"dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam";
-				
-		convertTxtToDam( srcpath, despath);
-		//dam转换成lzma
-		command = "lzma /home/ubuntu/photo_data/bigscene/"+folderName+"/data/dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam";
-		callshell(command);
-		
-		srcpath = prefix +"vision.txt";
-		despath = prefix +"vision.modeldata";
-		convertTxtToVisionmodeldata( srcpath, despath);
-	}
-
-	public static void convertDamToLzma(String folderName)throws Exception
-	{
-		try
-		{
-			String command = "lzma "+ folderName+File.separator+ ConstantFileName.modelUUID+"_50k.dam";
-			log.info("开始转换lzma");
-			callshell(command);
-			log.info("转换lzma完毕");
-		}
-		catch(Exception e)
-		{
-			StringWriter trace=new StringWriter();
-			e.printStackTrace(new PrintWriter(trace));
-			log.error(trace.toString());
-		}
-
-	}
-
-	public static void convertDamToLzma2(String folderName)throws Exception
-	{
-		try
-		{
-			String command = "lzma "+ folderName+File.separator+ ConstantFileName.modelUUID+"_50k2.dam";
-			log.info("开始转换lzma");
-			callshell(command);
-			log.info("转换lzma完毕");
-		}
-		catch(Exception e)
-		{
-			StringWriter trace=new StringWriter();
-			e.printStackTrace(new PrintWriter(trace));
-			log.error(trace.toString());
-		}
-
-	}
-	
-	public static void convertTxtToDam(String srcpath,String despath)throws Exception
-	{
-			BigSceneProto.binary_mesh.Builder builder= BigSceneProto.binary_mesh.newBuilder();
-			InputStream inputStream = new FileInputStream(srcpath);
-			InputStreamReader reader = new InputStreamReader(inputStream, "ASCII");
-			TextFormat.merge(reader, builder);
-			byte[] buf= builder.build().toByteArray();
-			
-			 //把序列化后的数据写入本地磁盘  
-	        ByteArrayInputStream stream = new ByteArrayInputStream(buf);  
-	        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(despath));//设置输出路径  
-	        BufferedInputStream bis = new BufferedInputStream(stream);  
-	        int b = -1;  
-	        while ((b = bis.read()) != -1) {  
-	            bos.write(b);  
-	        }  
-	        bis.close();  
-	        bos.close();
-	}
-	
-	public static void convertVisionmodeldataToTxt(String srcpath,String despath)throws Exception
-	{
-		try
-		{
-			File file = new File(srcpath); 
-			FileInputStream fis=new FileInputStream(file);
-
-			Visionmodeldata.NavigationInfo data_NavigationInfo = Visionmodeldata.NavigationInfo.parseFrom(fis);
-	
-			//PrintStream out = new PrintStream(despath); 
-			String jsonFormat1 = JsonFormat.printToString(data_NavigationInfo);
-			ByteArrayInputStream stream = new ByteArrayInputStream(jsonFormat1.getBytes());  
-	        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(despath));//设置输出路径  
-	        BufferedInputStream bis = new BufferedInputStream(stream);  
-	        int b = -1;  
-	        while ((b = bis.read()) != -1) {  
-	           bos.write(b);  
-	        }  
-			//out.close();
-	        bis.close();  
-	        bos.close(); 
-		}
-		catch(Exception e)
-		{
-			StringWriter trace=new StringWriter();
-	        e.printStackTrace(new PrintWriter(trace));
-	        log.error(trace.toString());
-		}
-	}
-	
-	public static void convertTxtToVisionmodeldata(String srcpath,String despath)throws Exception
-	{
-		try
-		{
-			Visionmodeldata.NavigationInfo.Builder builder = Visionmodeldata.NavigationInfo.newBuilder();
-			String jsonFormat = readTxtFileToJson(srcpath);
-			JsonFormat.merge(jsonFormat, builder);
-			byte[] buf= builder.build().toByteArray();
-			
-			 //把序列化后的数据写入本地磁盘  
-	        ByteArrayInputStream stream = new ByteArrayInputStream(buf);  
-	        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(despath));//设置输出路径  
-	        BufferedInputStream bis = new BufferedInputStream(stream);  
-	        int b = -1;  
-	        while ((b = bis.read()) != -1) {  
-	           bos.write(b);  
-	        }  
-	        bis.close();  
-	        bos.close(); 
-		}
-		catch(Exception e)
-		{
-			StringWriter trace=new StringWriter();
-	        e.printStackTrace(new PrintWriter(trace));
-	        log.error(trace.toString());
-		}
-	}
-
-	public static void convertVisionmodeldataToTxtCommon(String srcpath,String despath)throws Exception
-	{
-		try
-		{
-			File file = new File(srcpath);
-			FileInputStream fis=new FileInputStream(file);
-
-			Common.NavigationInfo data_NavigationInfo = Common.NavigationInfo.parseFrom(fis);
-
-			//PrintStream out = new PrintStream(despath);
-			String jsonFormat1 = JsonFormat.printToString(data_NavigationInfo);
-			ByteArrayInputStream stream = new ByteArrayInputStream(jsonFormat1.getBytes());
-			BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(despath));//设置输出路径
-			BufferedInputStream bis = new BufferedInputStream(stream);
-			int b = -1;
-			while ((b = bis.read()) != -1) {
-				bos.write(b);
-			}
-			//out.close();
-			bis.close();
-			bos.close();
-		}
-		catch(Exception e)
-		{
-			StringWriter trace=new StringWriter();
-			e.printStackTrace(new PrintWriter(trace));
-			log.error(trace.toString());
-		}
-	}
-
-	public static void convertTxtToVisionmodeldataCommon(String srcpath,String despath)throws Exception
-	{
-		try
-		{
-			Common.NavigationInfo.Builder builder = Common.NavigationInfo.newBuilder();
-			String jsonFormat = readTxtFileToJson(srcpath);
-			JsonFormat.merge(jsonFormat, builder);
-			byte[] buf= builder.build().toByteArray();
-
-			//把序列化后的数据写入本地磁盘
-			ByteArrayInputStream stream = new ByteArrayInputStream(buf);
-			BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(despath));//设置输出路径
-			BufferedInputStream bis = new BufferedInputStream(stream);
-			int b = -1;
-			while ((b = bis.read()) != -1) {
-				bos.write(b);
-			}
-			bis.close();
-			bos.close();
-		}
-		catch(Exception e)
-		{
-			StringWriter trace=new StringWriter();
-			e.printStackTrace(new PrintWriter(trace));
-			log.error(trace.toString());
-		}
-	}
-	
-	public static void callshell(String command)
-	{ 
-        try {
-			 StopWatch stopWatch = new StopWatch();
-			 stopWatch.start();
-			 Process process = Runtime.getRuntime().exec(command);
-        	 StreamGobbler errorGobbler = new StreamGobbler(process.getErrorStream(), "ERROR");
-             errorGobbler.start();  
-             StreamGobbler outGobbler = new StreamGobbler(process.getInputStream(), "STDOUT");  
-             outGobbler.start();  
-             process.waitFor();
-			log.info("脚本{}执行完毕,用时:{}",command,stopWatch.toString());
-        } catch (Exception e) {  
-            e.printStackTrace();  
-        }  
-	}
-	
-	public static int doWaitFor(Process process) {
-		  InputStream in = null;
-		  InputStream err = null;
-		  int exitValue = -1; // returned to caller when p is finished
-		  try {
-		    in = process.getInputStream();
-		    err = process.getErrorStream();
-		    boolean finished = false; // Set to true when p is finished
-		    while (!finished) {
-		      try {
-		        while (in.available() > 0) {
-		          // Print the output of our system call
-		          Character c = new Character((char) in.read());
-		          System.out.print(c);
-		        }
-		        while (err.available() > 0) {
-		          // Print the output of our system call
-		          Character c = new Character((char) err.read());
-		          System.out.print(c);
-		        }
-		        // Ask the process for its exitValue. If the process
-		        // is not finished, an IllegalThreadStateException
-		        // is thrown. If it is finished, we fall through and
-		        // the variable finished is set to true.
-		        exitValue = process.exitValue();
-		        finished = true;
-		      } catch (IllegalThreadStateException e) {
-		        // Process is not finished yet;
-		        // Sleep a little to save on CPU cycles
-		        Thread.currentThread().sleep(500);
-		      }
-		    }
-		  } catch (Exception e) {
-		    e.printStackTrace();
-		  } finally {
-		    try {
-		      if (in != null) {
-		        in.close();
-		      }
-		    } catch (IOException e) {
-		      e.printStackTrace();
-		    }
-		    if (err != null) {
-		      try {
-		        err.close();
-		      } catch (IOException e) {
-		        e.printStackTrace();
-		      }
-		    }
-		  }
-		  return exitValue;
-		}
-
-	
-	private boolean isModel(String sPath,String folderName)
-	{
-		boolean flag = false;  
-		File file = new File(sPath);  
-	    if (file.isFile() && file.exists()) {  
-	        flag = true;  
-	    }  
-	    log.info("等待...");
-	    return flag;  
-	}
-	
-	public static String readTxtFileToJson(String filePath){
-        try { 
-                String encoding="UTF-8"; 
-                File file=new File(filePath); 
-                if(file.isFile() && file.exists()){ 
-                    InputStreamReader read = new InputStreamReader( 
-                    new FileInputStream(file),encoding);
-                    BufferedReader bufferedReader = new BufferedReader(read); 
-                    String lineTxt = null; 
-                    String result="";
-                    while((lineTxt = bufferedReader.readLine()) != null){ 
-                    	result+=lineTxt;
-                        //log.info(lineTxt); 
-                    } 
-                    read.close(); 
-                    return result;
-        }else{ 
-            return null;
-        } 
-        } catch (Exception e) { 
-            e.printStackTrace(); 
-            return null;
-        } 
-      
-    }
-	
-	public Map<String,String> getAllFile(String dPath,String prefix)
-	{
-		File dirFile = new File(dPath);
-	    if (!dirFile.isDirectory()) {
-        }
-	    Map<String,String> map = new HashMap<String,String>();
-	    File[] files = dirFile.listFiles();
-	    for (int i = 0; i < files.length; i++) {
-            if (files[i].isFile()) {
-            	String path = files[i].getPath();
-            	map.put(path, prefix+path.substring(path.lastIndexOf("/")+1));
-            }
-        }
-	    return map;
-	}
-	
-	public Map<String,String> getchildFile(String dPath,String prefix,String childname)
-	{
-		File dirFile = new File(dPath+File.separator+childname);
-	    if (!dirFile.isDirectory()) {
-	    	return null;
-        }
-	    Map<String,String> map = new HashMap<String,String>();
-	    File[] files = dirFile.listFiles();
-	    for (int i = 0; i < files.length; i++) {
-            if (files[i].isFile()) {
-            	String path = files[i].getPath();
-            	map.put(path, prefix+childname+path.substring(path.lastIndexOf("/")));
-            }
-        }
-	    return map;
-	}
-	
-	//转台拼图
-	public void buildPanoramicImgs(String folderName)throws Exception
-	{
-		String command = ConstantCmd.BUILD_PANORAMA + folderName;
-		log.info("开始拼全景图");
-		callshell(command);
-		log.info("全景图拼接完毕");
-	}
-	
-	//六目拼图、切图,计算
-	public void buildForSix(String folderName)throws Exception
-	{
-		String command = ConstantCmd.BUILD_FOR_SIX + folderName;
-		log.info("开始处理数据(六目)");
-		callshell(command);
-		log.info("数据处理完毕(六目)");
-	}
-
-	public static void createSoftConnection(String source, String target) {
-		String command = "ln -s " + source + " " + target;
-		log.info("开始创建文件夹软连接");
-		callshell(command);
-		log.info("数据处理完毕(六目):" + command);
-	}
-
-	//合并音频
-	public static void mergeVideo(String oldVideo , String newVideo, String targetVideo) throws Exception{
-		String command = ConstantCmd.MERGE_VIDEO + " " + oldVideo + " " + newVideo + " " + targetVideo + " -y";
-		log.info("开始合并视频");
-		callshell(command);
-		log.info("合并视频完毕:" + command);
-	}
-
-	//生成一段静音音频
-	public static void createMuteViode(double time , String targetVideo) throws Exception{
-		String command = ConstantCmd.CREATE_MUTE_VIDEO + " " + time + " " + targetVideo + " -y";
-		log.info("开始生成一段静音音频");
-		callshell(command);
-		log.info("生成一段静音音频完毕:" + command);
-	}
-
-	//mp4文件转换成flv文件
-	public static void mp4ToFlv(String oldVideo, String newVideo) throws Exception{
-		String command = ConstantCmd.MP4_TO_FLV + " " + oldVideo + " " + newVideo;
-		log.info("mp4文件转换成flv文件");
-		callshell(command);
-		log.info("mp4文件转换成flv文件完毕:" + command);
-	}
-
-	//删除/mnt/data/下的数据
-	public static void deleteFile(String filePath) throws Exception{
-		String command = ConstantCmd.DELETE_FILE + " " + filePath;
-		log.info("删除/mnt/data/下的数据");
-		callshell(command);
-		log.info("删除/mnt/data/下的数据完毕:" + command);
-	}
-
-	public static void ossUtilCp(String fileUrl , String path) throws Exception{
-		String command = ConstantCmd.OSS_UTIL_CP + " " + fileUrl + " " + path;
-		Long start = System.currentTimeMillis();
-		log.info("开始oss下载文件:" + command);
-		callshell(command);
-		log.info("oss下载文件完成,时间为:" + (System.currentTimeMillis() - start));
-	}
-
-	public static void ossFileCp(String fileUrl , String path) throws Exception{
-		String command = ConstantCmd.OSS_FILE_CP + " " + fileUrl + " " + path;
-		Long start = System.currentTimeMillis();
-		log.info("开始s3文件下载文件:" + command);
-		callshell(command);
-		log.info("s3文件下载文件完成,时间为:" + (System.currentTimeMillis() - start));
-	}
-
-	/**
-	 * matterpro场景获取阿里云的切图数据
-	 * @param path
-	 * @throws Exception
-     */
-	public static void matterproCutImg(String num , String path) throws Exception{
-		String command = ConstantCmd.MATTERPRO_CUT_IMG + " -s " + num + " -d " + path;
-		Long start = System.currentTimeMillis();
-		log.info("开始matterpro获取阿里云图片方法:" + command);
-		callshell(command);
-		log.info("matterpro获取阿里云图片方法完成,时间为:" + (System.currentTimeMillis() - start));
-	}
-}

+ 0 - 61
4dkankan-common-utils/src/main/java/com/fdkankan/common/utils/StreamGobbler.java

@@ -1,61 +0,0 @@
-package com.fdkankan.common.utils;
-
-import java.io.*;
-
-public class StreamGobbler extends Thread {
-
-	InputStream is;  
-    String type;  
-    OutputStream os;  
-
-    public StreamGobbler(InputStream is, String type) {  
-        this(is, type, null);  
-    }  
-
-    StreamGobbler(InputStream is, String type, OutputStream redirect) {  
-        this.is = is;  
-        this.type = type;  
-        this.os = redirect;  
-    }  
-
-    public void run() {  
-        InputStreamReader isr = null;  
-        BufferedReader br = null;  
-        PrintWriter pw = null;  
-        try {  
-            if (os != null)  
-                pw = new PrintWriter(os);  
-
-            isr = new InputStreamReader(is);  
-            br = new BufferedReader(isr);  
-            String line=null;  
-            while ( (line = br.readLine()) != null) {  
-                if (pw != null)  
-                    pw.println(line);  
-                System.out.println(type + ">" + line);      
-            }  
-
-            if (pw != null)  
-                pw.flush();  
-        } catch (IOException ioe) {  
-            ioe.printStackTrace();    
-        } finally{  
-            try {  
-            	if(pw!=null)
-            	{
-            		 pw.close();  
-            	}
-            	if(br!=null)
-            	{
-            		br.close();  
-            	}
-            	if(isr!=null)
-            	{
-            		isr.close();  
-            	}
-            } catch (IOException e) {  
-                e.printStackTrace();  
-            }  
-        }  
-    }  
-}

+ 1 - 1
4dkankan-common-db/src/main/java/com/fdkankan/common/constant/ConstantFileName.java

@@ -1,4 +1,4 @@
-package com.fdkankan.common.constant;
+package com.fdkankan.utils.constant;
 
 public class ConstantFileName {
     //背景音乐

+ 1 - 1
4dkankan-common-mq/src/main/java/com/fdkankan/common/constant/ConstantFilePath.java

@@ -1,4 +1,4 @@
-package com.fdkankan.common.constant;
+package com.fdkankan.utils.constant;
 
 public class ConstantFilePath {
     public static final String BASE_PATH = "/mnt/4Dkankan";

+ 1 - 1
4dkankan-common-utils/src/main/java/com/fdkankan/common/constant/ConstantUrl.java

@@ -1,4 +1,4 @@
-package com.fdkankan.common.constant;
+package com.fdkankan.utils.constant;
 
 public class ConstantUrl {
 

+ 1 - 1
4dkankan-common-redis/src/main/java/com/fdkankan/common/proto/BigSceneProto.java

@@ -1,4 +1,4 @@
-package com.fdkankan.common.proto;
+package com.fdkankan.utils.proto;
 
 public final class BigSceneProto {
   private BigSceneProto() {}

+ 1 - 1
4dkankan-common-redis/src/main/java/com/fdkankan/common/proto/Common.java

@@ -1,7 +1,7 @@
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: Common.proto
 
-package com.fdkankan.common.proto;
+package com.fdkankan.utils.proto;
 
 public final class Common {
   private Common() {}

+ 1 - 1
4dkankan-common-db/src/main/java/com/fdkankan/common/proto/Visionmodeldata.java

@@ -1,7 +1,7 @@
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: visionmodeldata.proto
 
-package com.fdkankan.common.proto;
+package com.fdkankan.utils.proto;
 
 public final class Visionmodeldata {
   private Visionmodeldata() {}

+ 3 - 3
4dkankan-common-db/src/main/java/com/fdkankan/common/proto/format/CouchDBFormat.java

@@ -1,4 +1,4 @@
-package com.fdkankan.common.proto.format;
+package com.fdkankan.utils.proto.format;
 
 
 import com.google.protobuf.ExtensionRegistry;
@@ -95,7 +95,7 @@ public class CouchDBFormat extends JsonFormat {
         // we would not have to read to one big String. Alas, none of these is
         // the case. Oh well.
 
-        merge(JsonFormat.toStringBuilder(input), extensionRegistry, builder);
+        merge(toStringBuilder(input), extensionRegistry, builder);
     }
 
     /**
@@ -111,7 +111,7 @@ public class CouchDBFormat extends JsonFormat {
 
         tokenizer.consume("{"); // Needs to happen when the object starts.
         while (!tokenizer.tryConsume("}")) { // Continue till the object is done
-            JsonFormat.mergeField(tokenizer, extensionRegistry, builder);
+            mergeField(tokenizer, extensionRegistry, builder);
         }
     }
 

+ 1 - 1
4dkankan-common-db/src/main/java/com/fdkankan/common/proto/format/HtmlFormat.java

@@ -1,4 +1,4 @@
-package com.fdkankan.common.proto.format;
+package com.fdkankan.utils.proto.format;
 /* 
     Copyright (c) 2009, Orbitz World Wide
     All rights reserved.

+ 1 - 1
4dkankan-common-mq/src/main/java/com/fdkankan/common/proto/format/JavaPropsFormat.java

@@ -1,4 +1,4 @@
-package com.fdkankan.common.proto.format;
+package com.fdkankan.utils.proto.format;
 
 import com.google.protobuf.*;
 

+ 1 - 1
4dkankan-common-db/src/main/java/com/fdkankan/common/proto/format/JsonFormat.java

@@ -1,4 +1,4 @@
-package com.fdkankan.common.proto.format;
+package com.fdkankan.utils.proto.format;
 /* 
 	Copyright (c) 2009, Orbitz World Wide
 	All rights reserved.

+ 1 - 1
4dkankan-common-redis/src/main/java/com/fdkankan/common/proto/format/XmlFormat.java

@@ -1,4 +1,4 @@
-package com.fdkankan.common.proto.format;
+package com.fdkankan.utils.proto.format;
 /* 
     Copyright (c) 2009, Orbitz World Wide
     All rights reserved.

+ 1 - 1
4dkankan-common-mq/src/main/java/com/fdkankan/common/utils/Base64Converter.java

@@ -1,4 +1,4 @@
-package com.fdkankan.common.utils;
+package com.fdkankan.utils.utils;
 
 import java.io.UnsupportedEncodingException;
 import java.util.Base64;

+ 1 - 1
4dkankan-common-mq/src/main/java/com/fdkankan/common/utils/ConstantCmd.java

@@ -1,4 +1,4 @@
-package com.fdkankan.common.utils;
+package com.fdkankan.utils.utils;
 
 public class ConstantCmd {
 

+ 8 - 8
4dkankan-common-redis/src/main/java/com/fdkankan/common/utils/CreateObjUtil.java

@@ -1,11 +1,11 @@
-package com.fdkankan.common.utils;
-
-import com.fdkankan.common.constant.ConstantFileName;
-import com.fdkankan.common.constant.ConstantFilePath;
-import com.fdkankan.common.proto.BigSceneProto;
-import com.fdkankan.common.proto.Common;
-import com.fdkankan.common.proto.Visionmodeldata;
-import com.fdkankan.common.proto.format.JsonFormat;
+package com.fdkankan.utils.utils;
+
+import com.fdkankan.utils.constant.ConstantFileName;
+import com.fdkankan.utils.constant.ConstantFilePath;
+import com.fdkankan.utils.proto.BigSceneProto;
+import com.fdkankan.utils.proto.Common;
+import com.fdkankan.utils.proto.Visionmodeldata;
+import com.fdkankan.utils.proto.format.JsonFormat;
 import com.google.protobuf.TextFormat;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

+ 240 - 0
4dkankan-common-utils/src/main/java/com/fdkankan/utils/utils/FileUtil.java

@@ -0,0 +1,240 @@
+package com.fdkankan.utils.utils;
+
+import java.io.*;
+import java.nio.ByteBuffer;
+import java.nio.MappedByteBuffer;
+import java.nio.channels.FileChannel;
+import java.nio.channels.FileChannel.MapMode;
+
+/**
+ * @author MeepoGuan
+ *
+ * <p>Description: file_util</p>
+ *
+ * 2017年4月30日
+ *
+ */
+public class FileUtil {
+
+/*	public static void main(String[] args) {
+		String dirName = "d:/FH/topic/";// 创建目录
+		FileUtil.createDir(dirName);
+	}*/
+
+	/**
+	 * 创建目录
+	 * 
+	 * @param destDirName
+	 *            目标目录名
+	 * @return 目录创建成功返回true,否则返回false
+	 */
+	public static boolean createDir(String destDirName) {
+		File dir = new File(destDirName);
+		if (dir.exists()) {
+			return false;
+		}
+		if (!destDirName.endsWith(File.separator)) {
+			destDirName = destDirName + File.separator;
+		}
+		// 创建单个目录
+		if (dir.mkdirs()) {
+			return true;
+		} else {
+			return false;
+		}
+	}
+
+	/**
+	 * 删除文件
+	 * 
+	 * @param filePathAndName
+	 *            String 文件路径及名称 如c:/fqf.txt
+	 * @return boolean
+	 */
+	public static void delFile(String filePathAndName) {
+		try {
+			String filePath = filePathAndName;
+			filePath = filePath.toString();
+			File myDelFile = new File(filePath);
+			myDelFile.delete();
+
+		} catch (Exception e) {
+			System.out.println("删除文件操作出错");
+			e.printStackTrace();
+
+		}
+
+	}
+
+	/**
+	 * 读取到字节数组0
+	 * 
+	 * @param filePath //路径
+	 * @throws IOException
+	 */
+	public static byte[] getContent(String filePath) throws IOException {
+		File file = new File(filePath);
+		long fileSize = file.length();
+		if (fileSize > Integer.MAX_VALUE) {
+			System.out.println("file too big...");
+			return null;
+		}
+		FileInputStream fi = new FileInputStream(file);
+		byte[] buffer = new byte[(int) fileSize];
+		int offset = 0;
+		int numRead = 0;
+		while (offset < buffer.length
+				&& (numRead = fi.read(buffer, offset, buffer.length - offset)) >= 0) {
+			offset += numRead;
+		}
+		// 确保所有数据均被读取
+		if (offset != buffer.length) {
+			throw new IOException("Could not completely read file "
+					+ file.getName());
+		}
+		fi.close();
+		return buffer;
+	}
+
+	/**
+	 * 读取到字节数组1
+	 * 
+	 * @param filePath
+	 * @return
+	 * @throws IOException
+	 */
+	public static byte[] toByteArray(String filePath) throws IOException {
+
+		File f = new File(filePath);
+		if (!f.exists()) {
+			throw new FileNotFoundException(filePath);
+		}
+		ByteArrayOutputStream bos = new ByteArrayOutputStream((int) f.length());
+		BufferedInputStream in = null;
+		try {
+			in = new BufferedInputStream(new FileInputStream(f));
+			int buf_size = 1024;
+			byte[] buffer = new byte[buf_size];
+			int len = 0;
+			while (-1 != (len = in.read(buffer, 0, buf_size))) {
+				bos.write(buffer, 0, len);
+			}
+			return bos.toByteArray();
+		} catch (IOException e) {
+			e.printStackTrace();
+			throw e;
+		} finally {
+			try {
+				in.close();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+			bos.close();
+		}
+	}
+
+	/**
+	 * 读取到字节数组2
+	 * 
+	 * @param filePath
+	 * @return
+	 * @throws IOException
+	 */
+	public static byte[] toByteArray2(String filePath) throws IOException {
+
+		File f = new File(filePath);
+		if (!f.exists()) {
+			throw new FileNotFoundException(filePath);
+		}
+
+		FileChannel channel = null;
+		FileInputStream fs = null;
+		try {
+			fs = new FileInputStream(f);
+			channel = fs.getChannel();
+			ByteBuffer byteBuffer = ByteBuffer.allocate((int) channel.size());
+			while ((channel.read(byteBuffer)) > 0) {
+				// do nothing
+				// System.out.println("reading");
+			}
+			return byteBuffer.array();
+		} catch (IOException e) {
+			e.printStackTrace();
+			throw e;
+		} finally {
+			try {
+				channel.close();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+			try {
+				fs.close();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+		}
+	}
+
+	/**
+	 * Mapped File way MappedByteBuffer 可以在处理大文件时,提升性能
+	 * 
+	 * @param filePath
+	 * @return
+	 * @throws IOException
+	 */
+	public static byte[] toByteArray3(String filePath) throws IOException {
+
+		FileChannel fc = null;
+		RandomAccessFile rf = null;
+		try {
+			rf = new RandomAccessFile(filePath, "r");
+			fc = rf.getChannel();
+			MappedByteBuffer byteBuffer = fc.map(MapMode.READ_ONLY, 0,
+					fc.size()).load();
+			//System.out.println(byteBuffer.isLoaded());
+			byte[] result = new byte[(int) fc.size()];
+			if (byteBuffer.remaining() > 0) {
+				// System.out.println("remain");
+				byteBuffer.get(result, 0, byteBuffer.remaining());
+			}
+			return result;
+		} catch (IOException e) {
+			e.printStackTrace();
+			throw e;
+		} finally {
+			try {
+				rf.close();
+				fc.close();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+		}
+	}
+
+    public static File[] sort(File[] s) {
+        //中间值
+        File temp = null;
+        //外循环:我认为最小的数,从0~长度-1
+        for (int j = 0; j < s.length - 1; j++) {
+            //最小值:假设第一个数就是最小的
+            String min = s[j].getName();
+            //记录最小数的下标的
+            int minIndex = j;
+            //内循环:拿我认为的最小的数和后面的数一个个进行比较
+            for (int k = j + 1; k < s.length; k++) {
+                //找到最小值
+                if (Integer.parseInt(min.substring(0, min.indexOf("."))) > Integer.parseInt(s[k].getName().substring(0, s[k].getName().indexOf(".")))) {
+                    //修改最小
+                    min = s[k].getName();
+                    minIndex = k;
+                }
+            }
+            //当退出内层循环就找到这次的最小值
+            //交换位置
+            temp = s[j];
+            s[j] = s[minIndex];
+            s[minIndex] = temp;
+        }
+        return s;
+    }
+}

+ 1 - 1
4dkankan-common-utils/src/main/java/com/fdkankan/common/utils/FileUtils.java

@@ -1,4 +1,4 @@
-package com.fdkankan.common.utils;
+package com.fdkankan.utils.utils;
 
 import com.alibaba.fastjson.JSONObject;
 import it.sauronsoftware.jave.*;

+ 1 - 1
4dkankan-common-redis/src/main/java/com/fdkankan/common/utils/StreamGobbler.java

@@ -1,4 +1,4 @@
-package com.fdkankan.common.utils;
+package com.fdkankan.utils.utils;
 
 import java.io.*;
 

+ 1 - 1
4dkankan-sdk-oss/src/main/java/com/fdkankan/utils/UploadUtils.java

@@ -1,4 +1,4 @@
-package com.fdkankan.utils;
+package com.fdkankan.oss;
 
 import com.aliyun.oss.OSSClient;
 import com.aliyun.oss.model.ObjectMetadata;

+ 2 - 0
4dkankan-sdk-oss/target/classes/bootstrap.yml

@@ -0,0 +1,2 @@
+oss:
+  type: oss