|
@@ -3,22 +3,25 @@ package com.fdkankan.fusion.mq.consumer;
|
|
import cn.hutool.core.io.FileUtil;
|
|
import cn.hutool.core.io.FileUtil;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.fdkankan.fusion.common.FilePath;
|
|
import com.fdkankan.fusion.common.FilePath;
|
|
-import com.fdkankan.fusion.common.util.FileWriterUtil;
|
|
|
|
-import com.fdkankan.fusion.common.util.OBJToGLBUtil;
|
|
|
|
-import com.fdkankan.fusion.common.util.ShellUtil;
|
|
|
|
-import com.fdkankan.fusion.common.util.UploadToOssUtil;
|
|
|
|
|
|
+import com.fdkankan.fusion.common.util.*;
|
|
import com.fdkankan.fusion.exception.BusinessException;
|
|
import com.fdkankan.fusion.exception.BusinessException;
|
|
import com.fdkankan.fusion.service.ICommonUploadService;
|
|
import com.fdkankan.fusion.service.ICommonUploadService;
|
|
|
|
+import com.fdkankan.geo.GeoTransformUtil;
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
import com.rabbitmq.client.Channel;
|
|
import com.rabbitmq.client.Channel;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.locationtech.proj4j.ProjCoordinate;
|
|
import org.springframework.amqp.core.Message;
|
|
import org.springframework.amqp.core.Message;
|
|
import org.springframework.amqp.rabbit.annotation.Queue;
|
|
import org.springframework.amqp.rabbit.annotation.Queue;
|
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
+import org.w3c.dom.Document;
|
|
|
|
+import org.w3c.dom.Element;
|
|
|
|
|
|
|
|
+import javax.xml.parsers.DocumentBuilder;
|
|
|
|
+import javax.xml.parsers.DocumentBuilderFactory;
|
|
import java.io.File;
|
|
import java.io.File;
|
|
import java.nio.charset.StandardCharsets;
|
|
import java.nio.charset.StandardCharsets;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
@@ -56,6 +59,7 @@ public class OsgbToB3dmConsumer {
|
|
}
|
|
}
|
|
///mnt/manage/media-library/result/ea041f3237df46568f4e83e723e743d4
|
|
///mnt/manage/media-library/result/ea041f3237df46568f4e83e723e743d4
|
|
String sourcePath = file.getParentFile().getPath() +"/"+UUID.randomUUID().toString().replace("-","");
|
|
String sourcePath = file.getParentFile().getPath() +"/"+UUID.randomUUID().toString().replace("-","");
|
|
|
|
+
|
|
OBJToGLBUtil.OsgbToB3dm(localPath,sourcePath);
|
|
OBJToGLBUtil.OsgbToB3dm(localPath,sourcePath);
|
|
String b3dmJsonPath = FileWriterUtil.checkB3dmTileset(new File(sourcePath));
|
|
String b3dmJsonPath = FileWriterUtil.checkB3dmTileset(new File(sourcePath));
|
|
if(b3dmJsonPath == null){
|
|
if(b3dmJsonPath == null){
|
|
@@ -65,7 +69,12 @@ public class OsgbToB3dmConsumer {
|
|
String ossPath = sourcePath.replace("/mnt/","");
|
|
String ossPath = sourcePath.replace("/mnt/","");
|
|
ShellUtil.yunUpload(sourcePath,ossPath);
|
|
ShellUtil.yunUpload(sourcePath,ossPath);
|
|
String url = ossUrlPrefix + b3dmJsonPath.replace("/mnt/","");
|
|
String url = ossUrlPrefix + b3dmJsonPath.replace("/mnt/","");
|
|
- commonUploadService.updateByPath(localPath,url);
|
|
|
|
|
|
+ HashMap<String,String> resultMap = ReadXmlUtil.getLatMap(file);
|
|
|
|
+ if(resultMap != null && !resultMap.isEmpty()){
|
|
|
|
+ commonUploadService.updateByPath(localPath,url,resultMap.get("wgs84"),resultMap.get("gcj02"));
|
|
|
|
+ }else {
|
|
|
|
+ commonUploadService.updateByPath(localPath,url);
|
|
|
|
+ }
|
|
FileUtil.del(localPath);
|
|
FileUtil.del(localPath);
|
|
FileUtil.del(sourcePath);
|
|
FileUtil.del(sourcePath);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|