|
@@ -1,237 +1,237 @@
|
|
|
-//package com.fdkankan.scene.controller;
|
|
|
-//
|
|
|
-//import cn.hutool.core.util.StrUtil;
|
|
|
-//import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
-//import com.fdkankan.common.constant.RedisUtil;
|
|
|
-//import com.fdkankan.common.controller.BaseController;
|
|
|
-//import com.fdkankan.common.response.ResultData;
|
|
|
-//import com.fdkankan.common.util.RSAEncrypt;
|
|
|
-//import com.fdkankan.scene.service.*;
|
|
|
-//import com.fdkankan.scene.vo.ResponseSceneFile;
|
|
|
-//import lombok.extern.log4j.Log4j2;
|
|
|
-//import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-//import org.springframework.beans.factory.annotation.Value;
|
|
|
-//import org.springframework.data.redis.core.RedisTemplate;
|
|
|
-//import org.springframework.transaction.annotation.Transactional;
|
|
|
-//import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-//import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-//import org.springframework.web.bind.annotation.RequestParam;
|
|
|
-//import org.springframework.web.bind.annotation.RestController;
|
|
|
-//import org.springframework.web.multipart.MultipartFile;
|
|
|
-//
|
|
|
-//import java.util.Base64;
|
|
|
-//
|
|
|
-///**
|
|
|
-// * 场景文件上传模块
|
|
|
-// */
|
|
|
-//@Log4j2
|
|
|
-//@RestController
|
|
|
-//@RequestMapping("/api/scene/file")
|
|
|
-//@Transactional(rollbackFor = Exception.class)
|
|
|
-//public class SceneFileController extends BaseController {
|
|
|
-//
|
|
|
-//// @Autowired
|
|
|
-//// private FileService fileService;
|
|
|
+package com.fdkankan.scene.controller;
|
|
|
+
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
+import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
+import com.fdkankan.common.constant.RedisUtil;
|
|
|
+import com.fdkankan.common.controller.BaseController;
|
|
|
+import com.fdkankan.common.response.ResultData;
|
|
|
+import com.fdkankan.common.util.RSAEncrypt;
|
|
|
+import com.fdkankan.scene.service.*;
|
|
|
+import com.fdkankan.scene.vo.ResponseSceneFile;
|
|
|
+import lombok.extern.log4j.Log4j2;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.data.redis.core.RedisTemplate;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
+
|
|
|
+import java.util.Base64;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 场景文件上传模块
|
|
|
+ */
|
|
|
+@Log4j2
|
|
|
+@RestController
|
|
|
+@RequestMapping("/api/scene/file")
|
|
|
+@Transactional(rollbackFor = Exception.class)
|
|
|
+public class SceneFileController extends BaseController {
|
|
|
+
|
|
|
// @Autowired
|
|
|
-// private ISceneFileUploadService sceneFileUploadService;
|
|
|
+// private FileService fileService;
|
|
|
+ @Autowired
|
|
|
+ private ISceneFileUploadService sceneFileUploadService;
|
|
|
+ @Autowired
|
|
|
+ private ISceneFileBuildService sceneFileBuildService;
|
|
|
// @Autowired
|
|
|
-// private ISceneFileBuildService sceneFileBuildService;
|
|
|
-//// @Autowired
|
|
|
-//// private FileRouteConfig routeConfig;
|
|
|
-//// @Autowired
|
|
|
-//// private ModelingMsgProducer producer;
|
|
|
-// private String splice = "#";
|
|
|
-//
|
|
|
-//// @Autowired
|
|
|
-//// private GoodsFeignClient goodsService;
|
|
|
+// private FileRouteConfig routeConfig;
|
|
|
// @Autowired
|
|
|
-// private ObjectMapper mapper;
|
|
|
-//
|
|
|
+// private ModelingMsgProducer producer;
|
|
|
+ private String splice = "#";
|
|
|
+
|
|
|
// @Autowired
|
|
|
-// private ISceneProService sceneProService;
|
|
|
-//
|
|
|
+// private GoodsFeignClient goodsService;
|
|
|
+ @Autowired
|
|
|
+ private ObjectMapper mapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ISceneProService sceneProService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ISceneProEditService sceneProEditService;
|
|
|
+
|
|
|
// @Autowired
|
|
|
-// private ISceneProEditService sceneProEditService;
|
|
|
-//
|
|
|
-//// @Autowired
|
|
|
-//// private UserFeignClient userService;
|
|
|
-////
|
|
|
-//// @Autowired
|
|
|
-//// private IScene3dNumNewService numService;
|
|
|
-////
|
|
|
-//// @Autowired
|
|
|
-//// private UploadToOssUtil uploadToOssUtil;
|
|
|
-////
|
|
|
-//// @Autowired
|
|
|
-//// private ICompanyService companyService;
|
|
|
+// private UserFeignClient userService;
|
|
|
//
|
|
|
// @Autowired
|
|
|
-// private ISceneCooperationService sceneCooperationService;
|
|
|
+// private IScene3dNumNewService numService;
|
|
|
//
|
|
|
// @Autowired
|
|
|
-// private ISceneResourceCooperationService sceneResourceCooperationService;
|
|
|
+// private UploadToOssUtil uploadToOssUtil;
|
|
|
//
|
|
|
// @Autowired
|
|
|
-// private ISceneResourceCameraService sceneResourceCameraService;
|
|
|
-//
|
|
|
+// private ICompanyService companyService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ISceneCooperationService sceneCooperationService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ISceneResourceCooperationService sceneResourceCooperationService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ISceneResourceCameraService sceneResourceCameraService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ RedisUtil redisUtil;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ RedisTemplate redisTemplate;
|
|
|
+
|
|
|
+ @Value("${main.url}")
|
|
|
+ private String mainUrl;
|
|
|
+
|
|
|
+ @Value("${scene.url}")
|
|
|
+ private String sceneUrl;
|
|
|
+
|
|
|
+ @Value("${scene.pro.url}")
|
|
|
+ private String sceneProUrl;
|
|
|
+
|
|
|
+ @Value("${scene.pro.new.url}")
|
|
|
+ private String sceneProNewUrl;
|
|
|
+
|
|
|
+ @Value("${oss.type}")
|
|
|
+ private String type;
|
|
|
+
|
|
|
+ @Value("${prefix.ali}")
|
|
|
+ private String prefixAli;
|
|
|
+
|
|
|
+ @Value("${ecs.type}")
|
|
|
+ private String ecsType;
|
|
|
+
|
|
|
// @Autowired
|
|
|
-// RedisUtil redisUtil;
|
|
|
+// private RubberSheetingUtil rubberSheetingUtil;
|
|
|
//
|
|
|
// @Autowired
|
|
|
-// RedisTemplate redisTemplate;
|
|
|
-//
|
|
|
-// @Value("${main.url}")
|
|
|
-// private String mainUrl;
|
|
|
-//
|
|
|
-// @Value("${scene.url}")
|
|
|
-// private String sceneUrl;
|
|
|
-//
|
|
|
-// @Value("${scene.pro.url}")
|
|
|
-// private String sceneProUrl;
|
|
|
-//
|
|
|
-// @Value("${scene.pro.new.url}")
|
|
|
-// private String sceneProNewUrl;
|
|
|
-//
|
|
|
-// @Value("${oss.type}")
|
|
|
-// private String type;
|
|
|
-//
|
|
|
-// @Value("${prefix.ali}")
|
|
|
-// private String prefixAli;
|
|
|
-//
|
|
|
-// @Value("${ecs.type}")
|
|
|
-// private String ecsType;
|
|
|
-//
|
|
|
-//// @Autowired
|
|
|
-//// private RubberSheetingUtil rubberSheetingUtil;
|
|
|
-////
|
|
|
-//// @Autowired
|
|
|
-//// private SceneNumService sceneNumService;
|
|
|
-//
|
|
|
-// @Value("${unCalculated.company.ids:#{null}}")
|
|
|
-// private String[] unCalculatedCompanyIds;
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 场景文件上传之前先获取fileId
|
|
|
-// * @param params
|
|
|
-// * @return
|
|
|
-// * @throws Exception
|
|
|
-// */
|
|
|
-// @PostMapping("preUpload")
|
|
|
-// public ResponseSceneFile preUpload(String params) throws Exception {
|
|
|
-// return sceneFileBuildService.preUpload(params);
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 获取文件上传的状态
|
|
|
-// * @param params
|
|
|
-// * @return
|
|
|
-// * @throws Exception
|
|
|
-// */
|
|
|
-// @PostMapping("getProgress")
|
|
|
-// public ResponseSceneFile getProgress(String params) throws Exception {
|
|
|
-// return sceneFileBuildService.getProgress(params);
|
|
|
-// }
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 单个文件上传
|
|
|
-// * @param file
|
|
|
-// * @param params
|
|
|
-// * @return
|
|
|
-// */
|
|
|
-// @PostMapping("upload")
|
|
|
-// public ResultData upload(@RequestParam(value = "file",required = false) MultipartFile file,
|
|
|
-// String params) throws Exception {
|
|
|
-// return sceneFileBuildService.uploadFile(file, params);
|
|
|
-// }
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 上传大文件
|
|
|
-// * @param file
|
|
|
-// * @return
|
|
|
-// * @throws
|
|
|
-// */
|
|
|
-// @PostMapping("uploadBigFile")
|
|
|
-// public ResultData uploadBigFile(@RequestParam(value = "file",required = false) MultipartFile file,
|
|
|
-// String params) throws Exception {
|
|
|
-// return sceneFileBuildService.uploadFile(file, params);
|
|
|
-// }
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 更新fileid文件的上传状态 -- 作废
|
|
|
-// *
|
|
|
-// * @param params
|
|
|
-// * @return
|
|
|
-// */
|
|
|
-// @PostMapping("uploadSuccess")
|
|
|
-// public ResultData uploadSuccess(String params) throws Exception {
|
|
|
-// return sceneFileBuildService.uploadSuccess(params);
|
|
|
-// }
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 更新fileid文件的上传状态 - 后端八目上传逻辑
|
|
|
-// *
|
|
|
-// * @param params
|
|
|
-// * @return
|
|
|
-// */
|
|
|
-// @PostMapping("uploadSuccessBuild")
|
|
|
-// public ResultData uploadSuccessBuild(String params) throws Exception {
|
|
|
-// return sceneFileBuildService.uploadSuccessBuild(params);
|
|
|
-// }
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 更新fileid文件的上传状态 转台相机,激光相机
|
|
|
-// *
|
|
|
-// * @param params
|
|
|
-// * @return
|
|
|
-// */
|
|
|
-// @PostMapping("turntableUploadSuccess")
|
|
|
-// public ResultData turntableUploadSuccess(String params) throws Exception {
|
|
|
-// return sceneFileBuildService.turntableUploadSuccess(params);
|
|
|
-// }
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 获取亚马逊S3文件上传url
|
|
|
-// *
|
|
|
-// * @return
|
|
|
-// */
|
|
|
-// @PostMapping("getS3UploadUrl")
|
|
|
-// public ResultData getS3UploadUrl(String params) throws Exception {
|
|
|
-// return sceneFileBuildService.getS3UploadUrl(params);
|
|
|
-// }
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 计算双目场景 - 新双目相机上传 小红屋
|
|
|
-// *
|
|
|
-// * @return
|
|
|
-// */
|
|
|
-//// @ApiOperation("计算双目场景 - 新双目相机上传 小红屋")
|
|
|
-// @PostMapping("buildLiteScene")
|
|
|
-//// @ApiImplicitParams({
|
|
|
-//// @ApiImplicitParam(name = "prefix", value = "文件下载前缀,结尾不加/", dataType = "String"),
|
|
|
-//// @ApiImplicitParam(name = "dataFdage", value = "dataFdage", dataType = "String"),
|
|
|
-//// @ApiImplicitParam(name = "zipName", value = "zip文件包名称", dataType = "String"),
|
|
|
-//// @ApiImplicitParam(name = "password", value = "密码", dataType = "String"),
|
|
|
-//// @ApiImplicitParam(name = "userName", value = "用户名", dataType = "String")})
|
|
|
-// public ResultData buildLiteScene(String prefix, String dataFdage, String zipName, String userName, String password, String oldNum) throws Exception{
|
|
|
-// return sceneFileBuildService.buildLiteScene(prefix, dataFdage, zipName, userName, password, oldNum);
|
|
|
-//
|
|
|
-//
|
|
|
-// }
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 获取亚马逊S3文件上传url
|
|
|
-// * @return
|
|
|
-// */
|
|
|
-// @PostMapping("buildScene")
|
|
|
-//// @ApiOperation("获取亚马逊S3文件上传url")
|
|
|
-//// @ApiImplicitParams({
|
|
|
-//// @ApiImplicitParam(name = "unicode", value = "unicode文件夹", dataType = "String"),
|
|
|
-//// @ApiImplicitParam(name = "zip", value = "zip包的名称", dataType = "String"),
|
|
|
-//// @ApiImplicitParam(name = "dataFdage", value = "dataFdage名称", dataType = "String")})
|
|
|
-// public ResultData buildScene(String prefix, String unicode, String zip, String dataFdage) throws Exception{
|
|
|
-// return sceneFileBuildService.buildScene(prefix, unicode, zip, dataFdage);
|
|
|
-// }
|
|
|
-//
|
|
|
-//}
|
|
|
+// private SceneNumService sceneNumService;
|
|
|
+
|
|
|
+ @Value("${unCalculated.company.ids:#{null}}")
|
|
|
+ private String[] unCalculatedCompanyIds;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 场景文件上传之前先获取fileId
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ @PostMapping("preUpload")
|
|
|
+ public ResponseSceneFile preUpload(String params) throws Exception {
|
|
|
+ return sceneFileBuildService.preUpload(params);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取文件上传的状态
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ @PostMapping("getProgress")
|
|
|
+ public ResponseSceneFile getProgress(String params) throws Exception {
|
|
|
+ return sceneFileBuildService.getProgress(params);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 单个文件上传
|
|
|
+ * @param file
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("upload")
|
|
|
+ public ResultData upload(@RequestParam(value = "file",required = false) MultipartFile file,
|
|
|
+ String params) throws Exception {
|
|
|
+ return sceneFileBuildService.uploadFile(file, params);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 上传大文件
|
|
|
+ * @param file
|
|
|
+ * @return
|
|
|
+ * @throws
|
|
|
+ */
|
|
|
+ @PostMapping("uploadBigFile")
|
|
|
+ public ResultData uploadBigFile(@RequestParam(value = "file",required = false) MultipartFile file,
|
|
|
+ String params) throws Exception {
|
|
|
+ return sceneFileBuildService.uploadFile(file, params);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 更新fileid文件的上传状态 -- 作废
|
|
|
+ *
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("uploadSuccess")
|
|
|
+ public ResultData uploadSuccess(String params) throws Exception {
|
|
|
+ return sceneFileBuildService.uploadSuccess(params);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 更新fileid文件的上传状态 - 后端八目上传逻辑
|
|
|
+ *
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("uploadSuccessBuild")
|
|
|
+ public ResultData uploadSuccessBuild(String params) throws Exception {
|
|
|
+ return sceneFileBuildService.uploadSuccessBuild(params);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 更新fileid文件的上传状态 转台相机,激光相机
|
|
|
+ *
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("turntableUploadSuccess")
|
|
|
+ public ResultData turntableUploadSuccess(String params) throws Exception {
|
|
|
+ return sceneFileBuildService.turntableUploadSuccess(params);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取亚马逊S3文件上传url
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("getS3UploadUrl")
|
|
|
+ public ResultData getS3UploadUrl(String params) throws Exception {
|
|
|
+ return sceneFileBuildService.getS3UploadUrl(params);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 计算双目场景 - 新双目相机上传 小红屋
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+// @ApiOperation("计算双目场景 - 新双目相机上传 小红屋")
|
|
|
+ @PostMapping("buildLiteScene")
|
|
|
+// @ApiImplicitParams({
|
|
|
+// @ApiImplicitParam(name = "prefix", value = "文件下载前缀,结尾不加/", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "dataFdage", value = "dataFdage", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "zipName", value = "zip文件包名称", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "password", value = "密码", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "userName", value = "用户名", dataType = "String")})
|
|
|
+ public ResultData buildLiteScene(String prefix, String dataFdage, String zipName, String userName, String password, String oldNum) throws Exception{
|
|
|
+ return sceneFileBuildService.buildLiteScene(prefix, dataFdage, zipName, userName, password, oldNum);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取亚马逊S3文件上传url
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("buildScene")
|
|
|
+// @ApiOperation("获取亚马逊S3文件上传url")
|
|
|
+// @ApiImplicitParams({
|
|
|
+// @ApiImplicitParam(name = "unicode", value = "unicode文件夹", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "zip", value = "zip包的名称", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "dataFdage", value = "dataFdage名称", dataType = "String")})
|
|
|
+ public ResultData buildScene(String prefix, String unicode, String zip, String dataFdage) throws Exception{
|
|
|
+ return sceneFileBuildService.buildScene(prefix, unicode, zip, dataFdage);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|