dengsixing недель назад: 3
Родитель
Сommit
480df54ec2

+ 0 - 57
httpclient/FdkankanMiniClient.java

@@ -1,57 +0,0 @@
-//package com.fdkankan.scene.httpclient;
-//
-//import com.dtflys.forest.annotation.Get;
-//import com.dtflys.forest.annotation.Header;
-//import com.dtflys.forest.annotation.Post;
-//import com.dtflys.forest.annotation.Retry;
-//import com.dtflys.forest.annotation.Success;
-//import com.dtflys.forest.annotation.Var;
-//import com.dtflys.forest.callback.OnError;
-//import com.dtflys.forest.callback.OnSuccess;
-//import com.fdkankan.common.response.Result;
-//import java.util.Map;
-//import com.fdkankan.scene.bean.CameraBean;
-//import com.fdkankan.scene.bean.UserIncrementBean;
-//import com.fdkankan.scene.callback.FdkkMiniReqSuccessCondition;
-//
-///**
-// * <p>
-// * TODO
-// * </p>
-// *
-// * @author dengsixing
-// * @since 2022/4/24
-// **/
-//@Success(condition = FdkkMiniReqSuccessCondition.class)
-//public interface FdkankanMiniClient {
-//
-//    @Get(url="{url}"
-////        ,interceptor = TLogForestInterceptor.class    加这个拦截器,打印的tlog日志会详细一些,包括头信息等等
-//    )
-//    @Retry(maxRetryCount = "3", maxRetryInterval = "100")
-//    Result<String> getDataSyncType(@Var("url") String url, OnSuccess<Result> onSuccess, OnError onError);
-//
-//    @Get("{url}")
-//    @Retry(maxRetryCount = "3", maxRetryInterval = "100")
-//    Result<UserIncrementBean> getUserIncrementByCameraId(@Var("url") String url, OnSuccess<Result> onSuccess, OnError onError);
-//
-//    @Get("{url}")
-//    @Retry(maxRetryCount = "3", maxRetryInterval = "100")
-//    Result<CameraBean> getCameraByCameraId(@Var("url") String url, OnSuccess<Result> onSuccess, OnError onError);
-//
-////    @Get(url="{url}")
-////    @Retry(maxRetryCount = "3", maxRetryInterval = "100")
-////    Result<SceneProV3> getSceneProByNum(@Var("url") String url, OnSuccess<Result> onSuccess, OnError onError);
-//
-//    @Post(url="{url}")
-//    @Retry(maxRetryCount = "3", maxRetryInterval = "100")
-//    Result<Map<String, Object>> getIsLogin(@Var("url") String url, @Header("token") String token, OnSuccess<Result> onSuccess, OnError onError);
-//
-////    @Post(
-////        url = "${url}",
-////        contentType = "application/json"
-////    )
-////    @Retry(maxRetryCount = "3", maxRetryInterval = "100")
-////    Result upgradeToV4ResultSync(@Var("url") String url, @Body RequestSceneProV4 param, OnSuccess<Result> onSuccess, OnError onError);
-//
-//}

+ 0 - 33
httpclient/MyClient.java

@@ -1,33 +0,0 @@
-package com.fdkankan.scene.httpclient;
-
-
-import com.dtflys.forest.annotation.Get;
-import com.dtflys.forest.annotation.Var;
-import com.dtflys.forest.callback.OnProgress;
-import com.dtflys.forest.extensions.DownloadFile;
-import com.fdkankan.web.response.ResultData;
-
-import java.io.File;
-
-public interface MyClient {
-
-    /**
-     * 在方法上加上@DownloadFile注解
-     * dir属性表示文件下载到哪个目录
-     * filename属性表示文件下载成功后以什么名字保存,如果不填,这默认从URL中取得文件名
-     * OnProgress参数为监听上传进度的回调函数
-     */
-    @Get(url = "{url}")
-    @DownloadFile(dir = "{dir}", filename = "{filename}")
-    File downloadFile(@Var("url") String url, @Var("dir") String dir, @Var("filename")String filename);
-
-    /**
-     * 在方法上加上@DownloadFile注解
-     * dir属性表示文件下载到哪个目录
-     * filename属性表示文件下载成功后以什么名字保存,如果不填,这默认从URL中取得文件名
-     * OnProgress参数为监听上传进度的回调函数
-     */
-    @Get(url = "${url}?${params}")
-    ResultData get(@Var("url") String url, @Var("params") String params);
-
-}

+ 95 - 95
src/main/java/com/fdkankan/contro/Interceptor/SignVerificationAspect.java

@@ -1,95 +1,95 @@
-package com.fdkankan.contro.Interceptor;
-
-import cn.hutool.core.util.StrUtil;
-import com.alibaba.fastjson.JSONObject;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.constant.ServerCode;
-import com.fdkankan.common.exception.BusinessException;
-import com.fdkankan.contro.common.Result;
-import com.fdkankan.contro.httpclient.MyClient;
-import com.fdkankan.sign.RsaUtils;
-import com.fdkankan.sign.SignUtils;
-import lombok.extern.log4j.Log4j2;
-import org.aspectj.lang.JoinPoint;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Before;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.core.annotation.Order;
-import org.springframework.stereotype.Component;
-import org.springframework.web.context.request.RequestContextHolder;
-import org.springframework.web.context.request.ServletRequestAttributes;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
-
-@Log4j2
-@Aspect
-@Component
-@Order(101)
-public class SignVerificationAspect {
-
-	private static final String GET_PRIVATEKEY_API = "/ucenter/_inner/pdsfsdfsrvateddsfeky/";
-
-	@Value("${ucenter.publicKey}")
-	private String publicKey;
-	@Value("${ucenter.appId}")
-	private String ucenterAppId;
-
-	@Value("${4dkk.fdService.basePath}")
-	private String fdServiceBasePath;
-
-	@Resource
-	private MyClient myClient;
-
-	/**
-	 * 前置通知 用于判断用户协作场景是否有协作权限
-	 *
-	 * @param joinPoint
-	 *            切点
-	 * @throws IOException
-	 */
-	@Before("@annotation(com.fdkankan.contro.annotation.SignVerification)")
-	public void doBefore(JoinPoint joinPoint) throws Exception {
-		HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
-
-		String XUA = request.getHeader("X-UA");
-		if(StrUtil.isNotEmpty(XUA)){
-			return;
-		}
-
-		String sign = request.getHeader("sign");
-		String appId = request.getHeader("appId");
-		if(StrUtil.isEmpty(sign) || StrUtil.isEmpty(appId)){
-			throw new BusinessException(ErrorCode.AUTH_FAIL);
-		}
-
-		//通过appid查询私钥
-		JSONObject playload = new JSONObject();
-		playload.put("appId", ucenterAppId);
-		playload.put("timestamp", System.currentTimeMillis());
-		String ucenterSign = RsaUtils.encipher(playload.toJSONString(), publicKey);
-		Map<String, String> headerMap = new HashMap<>();
-		headerMap.put("sign", ucenterSign);
-		headerMap.put("appId", ucenterAppId);
-		String url = fdServiceBasePath + GET_PRIVATEKEY_API + appId;
-		Result result = myClient.get(url, headerMap);
-		if(result.getCode() != ServerCode.SUCCESS.code()){
-			throw new RuntimeException("系统异常");
-		}
-		JSONObject data = (JSONObject) result.getData();
-		if(Objects.isNull(data)){
-			throw new BusinessException(ErrorCode.AUTH_FAIL);
-		}
-		String privateKey = data.getString("privateKey");
-
-		//签名解密
-		if(!SignUtils.checkSign(sign, appId, privateKey)){
-			throw new BusinessException(ErrorCode.AUTH_FAIL);
-		}
-	}
-
-}
+//package com.fdkankan.contro.Interceptor;
+//
+//import cn.hutool.core.util.StrUtil;
+//import com.alibaba.fastjson.JSONObject;
+//import com.fdkankan.common.constant.ErrorCode;
+//import com.fdkankan.common.constant.ServerCode;
+//import com.fdkankan.common.exception.BusinessException;
+//import com.fdkankan.contro.common.Result;
+//import com.fdkankan.contro.httpclient.MyClient;
+//import com.fdkankan.sign.RsaUtils;
+//import com.fdkankan.sign.SignUtils;
+//import lombok.extern.log4j.Log4j2;
+//import org.aspectj.lang.JoinPoint;
+//import org.aspectj.lang.annotation.Aspect;
+//import org.aspectj.lang.annotation.Before;
+//import org.springframework.beans.factory.annotation.Value;
+//import org.springframework.core.annotation.Order;
+//import org.springframework.stereotype.Component;
+//import org.springframework.web.context.request.RequestContextHolder;
+//import org.springframework.web.context.request.ServletRequestAttributes;
+//
+//import javax.annotation.Resource;
+//import javax.servlet.http.HttpServletRequest;
+//import java.io.IOException;
+//import java.util.HashMap;
+//import java.util.Map;
+//import java.util.Objects;
+//
+//@Log4j2
+//@Aspect
+//@Component
+//@Order(101)
+//public class SignVerificationAspect {
+//
+//	private static final String GET_PRIVATEKEY_API = "/ucenter/_inner/pdsfsdfsrvateddsfeky/";
+//
+//	@Value("${ucenter.publicKey}")
+//	private String publicKey;
+//	@Value("${ucenter.appId}")
+//	private String ucenterAppId;
+//
+//	@Value("${4dkk.fdService.basePath}")
+//	private String fdServiceBasePath;
+//
+//	@Resource
+//	private MyClient myClient;
+//
+//	/**
+//	 * 前置通知 用于判断用户协作场景是否有协作权限
+//	 *
+//	 * @param joinPoint
+//	 *            切点
+//	 * @throws IOException
+//	 */
+//	@Before("@annotation(com.fdkankan.contro.annotation.SignVerification)")
+//	public void doBefore(JoinPoint joinPoint) throws Exception {
+//		HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
+//
+//		String XUA = request.getHeader("X-UA");
+//		if(StrUtil.isNotEmpty(XUA)){
+//			return;
+//		}
+//
+//		String sign = request.getHeader("sign");
+//		String appId = request.getHeader("appId");
+//		if(StrUtil.isEmpty(sign) || StrUtil.isEmpty(appId)){
+//			throw new BusinessException(ErrorCode.AUTH_FAIL);
+//		}
+//
+//		//通过appid查询私钥
+//		JSONObject playload = new JSONObject();
+//		playload.put("appId", ucenterAppId);
+//		playload.put("timestamp", System.currentTimeMillis());
+//		String ucenterSign = RsaUtils.encipher(playload.toJSONString(), publicKey);
+//		Map<String, String> headerMap = new HashMap<>();
+//		headerMap.put("sign", ucenterSign);
+//		headerMap.put("appId", ucenterAppId);
+//		String url = fdServiceBasePath + GET_PRIVATEKEY_API + appId;
+//		Result result = myClient.get(url, headerMap);
+//		if(result.getCode() != ServerCode.SUCCESS.code()){
+//			throw new RuntimeException("系统异常");
+//		}
+//		JSONObject data = (JSONObject) result.getData();
+//		if(Objects.isNull(data)){
+//			throw new BusinessException(ErrorCode.AUTH_FAIL);
+//		}
+//		String privateKey = data.getString("privateKey");
+//
+//		//签名解密
+//		if(!SignUtils.checkSign(sign, appId, privateKey)){
+//			throw new BusinessException(ErrorCode.AUTH_FAIL);
+//		}
+//	}
+//
+//}

+ 3 - 0
src/main/java/com/fdkankan/contro/bean/SceneJsonBean.java

@@ -224,5 +224,8 @@ public class SceneJsonBean {
 
 
     private Integer hasFloorplanAi;
     private Integer hasFloorplanAi;
 
 
+    //offline-离线包上传
+    private String uploadType;
+
 
 
 }
 }

+ 27 - 0
src/main/java/com/fdkankan/contro/controller/JmgaController.java

@@ -0,0 +1,27 @@
+package com.fdkankan.contro.controller;
+
+import com.fdkankan.contro.service.IJmgaService;
+import com.fdkankan.contro.vo.UploadSceneOrigParamVo;
+import com.fdkankan.web.response.ResultData;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+
+@RestController
+@RequestMapping("/api/scene/file/jmga")
+public class JmgaController {
+
+    @Autowired
+    private IJmgaService jmgaService;
+
+    @PostMapping("/uploadScene")
+    public ResultData uploadScene(@RequestBody @Valid UploadSceneOrigParamVo param) throws Exception {
+        jmgaService.uploadScene(param);
+        return ResultData.ok();
+    }
+
+}

+ 10 - 9
src/main/java/com/fdkankan/contro/mq/listener/UploadSceneListener.java

@@ -101,9 +101,9 @@ public class UploadSceneListener {
                 this.uploadSceneOirg(num, zipDir + uuid);
                 this.uploadSceneOirg(num, zipDir + uuid);
             }
             }
 
 
-            if(UploadSceneSourceType.OFFLINE.getCode().equalsIgnoreCase(sourceType)){
-                this.uploadSceneOffline(num, zipDir + uuid);
-            }
+//            if(UploadSceneSourceType.OFFLINE.getCode().equalsIgnoreCase(sourceType)){
+//                this.uploadSceneOffline(num, zipDir + uuid);
+//            }
 
 
         }catch (Exception e){
         }catch (Exception e){
             log.error("处理管理后台上传场景报错, content:{}", msg, e);
             log.error("处理管理后台上传场景报错, content:{}", msg, e);
@@ -122,7 +122,7 @@ public class UploadSceneListener {
     private void uploadSceneOirg(String num, String sourcePath) throws Exception {
     private void uploadSceneOirg(String num, String sourcePath) throws Exception {
         ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
         ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
         NameFileFilter fileFilter = new NameFileFilter("data.fdage");
         NameFileFilter fileFilter = new NameFileFilter("data.fdage");
-        File dataFdageFile = FileUtil.loopFiles(sourcePath, fileFilter).stream().findFirst().filter(v -> !v.getAbsolutePath().contains("/backup/")).get();
+        File dataFdageFile = FileUtil.loopFiles(sourcePath, fileFilter).stream().filter(v -> !v.getAbsolutePath().contains("/backup/")).findFirst().get();
 
 
         //去读data.fdage
         //去读data.fdage
         if(dataFdageFile != null && !dataFdageFile.exists()){
         if(dataFdageFile != null && !dataFdageFile.exists()){
@@ -134,11 +134,11 @@ public class UploadSceneListener {
         String uuidTime = dataFdageObj.getString("uuidtime");
         String uuidTime = dataFdageObj.getString("uuidtime");
         String uniCode = snCode + "_" + uuidTime;
         String uniCode = snCode + "_" + uuidTime;
         String fileId = sceneFileBuildService.getFileId(snCode, uniCode);
         String fileId = sceneFileBuildService.getFileId(snCode, uniCode);
-        String homePath = "/oss/4dkankan/" + ConstantFilePath.OSS_PREFIX + snCode + "/" + fileId + "/" + uniCode;
-        FileUtil.mkdir(homePath);
+        String homePath = ConstantFilePath.OSS_PREFIX + snCode + "/" + fileId + "/";// + uniCode;
         String fileDir = sourcePath + "/" + uniCode;//本地版压缩包包含了一层unicode目录
         String fileDir = sourcePath + "/" + uniCode;//本地版压缩包包含了一层unicode目录
-        String cpCmd = "cp -p -r " + fileDir + "/* " + homePath;
-        CmdUtils.callLineSh(cpCmd);
+        fYunFileService.uploadFileByCommand(fileDir, homePath);
+//        String cpCmd = "cp -p -r " + fileDir + "/* " + homePath;
+//        CmdUtils.callLineSh(cpCmd);
 
 
         Long userId = scenePlus.getUserId();
         Long userId = scenePlus.getUserId();
         User user = userService.getById(userId);
         User user = userService.getById(userId);
@@ -165,9 +165,10 @@ public class UploadSceneListener {
         SceneJsonBean sceneJsonBean = JSONObject.parseObject(FileUtil.readUtf8String(sceneJsonFile), SceneJsonBean.class);
         SceneJsonBean sceneJsonBean = JSONObject.parseObject(FileUtil.readUtf8String(sceneJsonFile), SceneJsonBean.class);
         String sceneViewDataPath = "/oss/4dkankan/" + String.format(UploadFilePath.VIEW_PATH, num);
         String sceneViewDataPath = "/oss/4dkankan/" + String.format(UploadFilePath.VIEW_PATH, num);
         FileUtil.mkdir(sceneViewDataPath);
         FileUtil.mkdir(sceneViewDataPath);
-        String cpCmd = "cp -p -r " + sourcePath + "/* " + sceneViewDataPath;
+        String cpCmd = "cp -p -r " + sourcePath  + "/env/wwwroot/scene_view_data/" + num +"/* " + sceneViewDataPath;
         CmdUtils.callLineSh(cpCmd);
         CmdUtils.callLineSh(cpCmd);
 
 
+        sceneJsonBean.setUploadType("offline");
         String sceneJsonKey = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "scene.json";
         String sceneJsonKey = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "scene.json";
         fYunFileService.uploadFile(JSON.toJSONString(sceneJsonBean).getBytes(StandardCharsets.UTF_8), sceneJsonKey);
         fYunFileService.uploadFile(JSON.toJSONString(sceneJsonBean).getBytes(StandardCharsets.UTF_8), sceneJsonKey);
 
 

+ 3 - 3
src/main/java/com/fdkankan/contro/mq/service/impl/BuildSceneServiceImpl.java

@@ -62,9 +62,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
     @Value("${queue.modeling.modeling-call}")
     @Value("${queue.modeling.modeling-call}")
     private String queueModelingCall;
     private String queueModelingCall;
 
 
-    @Value("${queue.modeling.single.modeling-call}")
-    private String singleModelingCall;
-
     @Value("${model.type:#{null}}")
     @Value("${model.type:#{null}}")
     private String modelType;
     private String modelType;
 
 
@@ -205,6 +202,9 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
             //写入算法参数文件
             //写入算法参数文件
             buildService.writeDataJson(message, fdageJson, null, null);
             buildService.writeDataJson(message, fdageJson, null, null);
 
 
+            //发送mq,就进行计算
+            mqProducer.sendByWorkQueue(queueModelingCall, message);
+
             log.info("场景计算资源准备结束,场景码:{}", message.getSceneNum());
             log.info("场景计算资源准备结束,场景码:{}", message.getSceneNum());
 
 
         }catch (Exception e){
         }catch (Exception e){

+ 14 - 0
src/main/java/com/fdkankan/contro/service/IJmgaService.java

@@ -0,0 +1,14 @@
+package com.fdkankan.contro.service;
+
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.contro.vo.UploadSceneOrigParamVo;
+
+import java.io.IOException;
+
+public interface IJmgaService {
+
+
+    void uploadScene(UploadSceneOrigParamVo param) throws Exception;
+
+
+}

+ 206 - 0
src/main/java/com/fdkankan/contro/service/impl/JmgaServiceImpl.java

@@ -0,0 +1,206 @@
+package com.fdkankan.contro.service.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.lang.UUID;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.common.constant.ModelKind;
+import com.fdkankan.common.constant.SceneStatus;
+import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.contro.entity.*;
+import com.fdkankan.contro.service.*;
+import com.fdkankan.contro.util.SceneSourceUtil;
+import com.fdkankan.contro.vo.UploadSceneOrigParamVo;
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
+import com.fdkankan.model.constants.ConstantFilePath;
+import com.fdkankan.rabbitmq.util.RabbitMqProducer;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.io.File;
+import java.util.List;
+import java.util.Objects;
+
+@Slf4j
+@Service
+public class JmgaServiceImpl implements IJmgaService {
+
+    @Value("${scene.pro.new.url}")
+    private String sceneProNewUrl;
+    @Value("${model.modelKind:3dtiles}")
+    private String modelKind;
+    @Value("#{'${model.3dtiles.sceneSource:}'.split(',')}")
+    private List<Integer> sdTilesSceneSourceList;
+
+    @Resource
+    private RabbitMqProducer mqProducer;
+    @Resource
+    private FYunFileServiceInterface fYunFileService;
+    @Autowired
+    private ISceneFileBuildService sceneFileBuildService;
+    @Autowired
+    private IUserService userService;
+    @Autowired
+    private IScenePlusService scenePlusService;
+    @Autowired
+    private IScenePlusExtService scenePlusExtService;
+    @Autowired
+    private IScene3dNumService scene3dNumService;
+    @Autowired
+    private ICameraService cameraService;
+    @Autowired
+    private ISceneEditInfoService sceneEditInfoService;
+    @Autowired
+    private ISceneEditInfoExtService sceneEditInfoExtService;
+    @Autowired
+    private ISceneEditControlsService sceneEditControlsService;
+    @Autowired
+    private ICameraDetailService cameraDetailService;
+
+    @Override
+    public void uploadScene(UploadSceneOrigParamVo param) throws Exception {
+
+        User user = userService.getById(param.getUserId());
+        if(Objects.isNull(user)){
+            throw new BusinessException(ErrorCode.USER_NOT_EXIST);
+        }
+
+        String uuid = UUID.randomUUID().toString();
+        String zipName = uuid + ".zip";
+        String zipDir = "/mnt/data/temp/";
+        fYunFileService.downloadFileByCommand(zipDir + zipName, param.getFilePath());
+
+        Camera camera = null;
+        CameraDetail cameraDetail = null;
+        String sceneNum = null;
+        if(param.getSourceType().equals("orig")){//原始资源
+            String dataFdageStr = com.fdkankan.contro.util.ZipUtil.readUtf8(zipDir + zipName, "data.fdage");
+            if(StrUtil.isEmpty(dataFdageStr) || !JSONUtil.isJson(dataFdageStr)){
+                throw new BusinessException(60027, "data.fdage文件数据异常");
+            }
+            JSONObject dataFdage = JSON.parseObject(dataFdageStr);
+            String snCode = dataFdage.getJSONObject("cam").getString("uuid");
+            String uuidTime = dataFdage.getString("uuidtime");
+            String uniCode = snCode + "_" + uuidTime;
+            camera = cameraService.getBySnCode(snCode);
+            if(camera == null){
+                throw new BusinessException(ErrorCode.FAILURE_CODE_7010);
+            }
+            cameraDetail = cameraDetailService.getByCameraId(camera.getId());
+            if(cameraDetail == null){
+                throw new BusinessException(ErrorCode.FAILURE_CODE_7010);
+            }
+
+            ScenePlus scenePlus = scenePlusService.getByFileId(uniCode);
+            if(scenePlus == null){
+                scenePlus = new ScenePlus();
+                sceneNum = scene3dNumService.generateSceneNum(cameraDetail.getType());
+                scenePlus.setNum(sceneNum);
+                scenePlus.setCameraId(cameraDetail.getCameraId());
+                scenePlus.setSceneSource(SceneSourceUtil.getSceneSourceByCamType(cameraDetail.getType()));
+            }else{
+                if(scenePlus.getSceneStatus() == SceneStatus.wait.code()){
+                    throw new BusinessException(ErrorCode.FAILURE_CODE_5033);
+                }
+                sceneNum = scenePlus.getNum();
+            }
+            scenePlus.setTitle(dataFdage.getString("name"));
+            scenePlus.setUserId(user.getId());
+            scenePlus.setUpdateTime(null);
+            scenePlus.setSceneStatus(SceneStatus.wait.code());
+            scenePlusService.saveOrUpdate(scenePlus);
+
+            ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
+            if(scenePlusExt == null){
+                scenePlusExt = new ScenePlusExt();
+                scenePlusExt.setPlusId(scenePlus.getId());
+                scenePlusExt.setWebSite("/" + sceneProNewUrl + scenePlus.getNum());
+                String fileId = sceneFileBuildService.getFileId(snCode, uniCode);
+                scenePlusExt.setDataSource(ConstantFilePath.BUILD_MODEL_PATH + snCode + File.separator + fileId + File.separator + uniCode);
+                if(ModelKind.THREE_D_TILE.code().equals(modelKind)
+                        && CollUtil.isNotEmpty(sdTilesSceneSourceList)
+                        && sdTilesSceneSourceList.contains(scenePlus.getSceneSource())){
+                    scenePlusExt.setModelKind(modelKind);
+                }
+            }
+            JSONArray points = dataFdage.getJSONArray("points");
+            scenePlusExt.setShootCount(points.size());
+            scenePlusExtService.saveOrUpdate(scenePlusExt);
+
+            SceneEditInfo sceneEditInfo = sceneEditInfoService.getByScenePlusId(scenePlus.getId());
+            if(sceneEditInfo == null){
+                sceneEditInfo = new SceneEditInfo();
+                sceneEditInfo.setScenePlusId(scenePlus.getId());
+                sceneEditInfoService.save(sceneEditInfo);
+            }
+            SceneEditInfoExt sceneEditInfoExt = sceneEditInfoExtService.getByEditInfoId(sceneEditInfo.getId());
+            if(sceneEditInfoExt == null){
+                sceneEditInfoExt = new SceneEditInfoExt();
+                sceneEditInfoExt.setScenePlusId(scenePlus.getId());
+                sceneEditInfoExt.setEditInfoId(sceneEditInfo.getId());
+                sceneEditInfoExtService.save(sceneEditInfoExt);
+            }
+            SceneEditControls sceneEditControls = sceneEditControlsService.getBySceneEditId(sceneEditInfo.getId());
+            if(sceneEditControls == null){
+                sceneEditControls = new SceneEditControls();
+                sceneEditControls.setEditInfoId(sceneEditInfo.getId());
+                sceneEditControlsService.save(sceneEditControls);
+            }
+
+        }else{//离线包
+//            String sceneJsonStr = com.fdkankan.contro.util.ZipUtil.readUtf8(zipDir + zipName, "scene.json");
+//            if(StrUtil.isEmpty(sceneJsonStr) || !JSONUtil.isJson(sceneJsonStr)){
+//                throw new BusinessException(60027, "scene.json文件数据异常");
+//            }
+//            JSONObject sceneJson = JSON.parseObject(sceneJsonStr);
+//            sceneNum = sceneJson.getString("num");
+//
+//            ScenePlus scenePlusDb = scenePlusService.getDeletedByNum(sceneNum);
+//            if(scenePlusDb != null && scenePlusDb.getRecStatus().equalsIgnoreCase(RecStatus.VALID.code())){
+//                throw new BusinessException(ModelingControlRespCode.NUM_EXISTS.code(), ModelingControlRespCode.NUM_EXISTS.message());
+//            }
+//            if(scenePlusDb != null && scenePlusDb.getRecStatus().equalsIgnoreCase(RecStatus.DISABLE.code())){
+//                scenePlusService.updateNumById(scenePlusDb.getId(), scenePlusDb.getNum() + "-" + scenePlusDb.getId());
+//            }
+//
+//            int camType = sceneJson.getInteger("camType");
+//            String snCode = sceneJson.getString("snCode");
+//            Map<String, Object> instorage = cameraService.instorage(camType, snCode);
+//            cameraDetail = (CameraDetail) instorage.get("cameraDetail");
+//            ScenePlus scenePlus = new ScenePlus();
+//            scenePlus.setNum(sceneNum);
+//            scenePlus.setCameraId(cameraDetail.getCameraId());
+//            scenePlus.setSceneSource(SceneSourceUtil.getSceneSourceByCamType(cameraDetail.getType()));
+//            scenePlus.setTitle(sceneJson.getString("title"));
+//            scenePlus.setUserId(user.getId());
+//            scenePlus.setUpdateTime(null);
+//            scenePlus.setSceneStatus(SceneStatus.wait.code());
+//            scenePlus.setUploadType("offline");
+//            scenePlus.setPayStatus(PayStatus.PAY.code());
+//            scenePlus.setStartBuildTime(new Date());
+//            scenePlusService.save(scenePlus);
+//            ScenePlusExt scenePlusExt = new ScenePlusExt();
+//            scenePlusExt.setPlusId(scenePlus.getId());
+//            String uniCode = snCode + DateExtUtil.format(new Date(), DateExtUtil.dateStyle11);
+//            String fileId = sceneFileBuildService.getFileId(snCode, uniCode);
+//            scenePlusExt.setDataSource(ConstantFilePath.BUILD_MODEL_PATH + snCode + File.separator + fileId + File.separator + uniCode);
+//            scenePlusExtService.save(scenePlusExt);
+        }
+
+        //发mq做异步处理
+        JSONObject content = new JSONObject();
+        content.put("zipPath", zipDir + zipName);
+        content.put("num", sceneNum);
+        content.put("sourceType", param.getSourceType());
+        mqProducer.sendByWorkQueue("manage-upload-scene", content);
+    }
+
+
+}

+ 23 - 0
src/main/java/com/fdkankan/contro/util/SceneSourceUtil.java

@@ -0,0 +1,23 @@
+package com.fdkankan.contro.util;
+
+import com.fdkankan.common.constant.CommonStatus;
+import com.fdkankan.common.constant.SceneSource;
+import com.fdkankan.contro.enums.CameraTypeEnum;
+
+public class SceneSourceUtil {
+
+    public static Integer getSceneSourceByCamType(Integer camType){
+        SceneSource sceneSource = SceneSource.BM;
+        if (camType == CameraTypeEnum.DOUBLE_EYE_TURN.getType()) {
+            sceneSource = SceneSource.ZT;
+        }
+        if (camType == CameraTypeEnum.LASER_TURN.getType()) {
+            sceneSource = SceneSource.JG;
+        }
+        if (camType == CameraTypeEnum.LASER_SG.getType()) {
+            sceneSource = SceneSource.SG;
+        }
+        return sceneSource.code();
+    }
+
+}

+ 20 - 0
src/main/java/com/fdkankan/contro/vo/UploadSceneOrigParamVo.java

@@ -0,0 +1,20 @@
+package com.fdkankan.contro.vo;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+@Data
+public class UploadSceneOrigParamVo {
+
+    @NotBlank(message = "filePath不能为空")
+    private String filePath;
+
+    @NotNull(message = "userId不能为空")
+    private Long userId;
+
+    //资源包类型 orig-原始数据  offline 离线包
+    @NotBlank(message = "sourceType不能为空")
+    private String sourceType;
+}