|
@@ -1144,116 +1144,68 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
String sceneUrl = mainUrl +"/"+sceneProNewUrl;
|
|
|
|
|
|
//有points字段的是八目
|
|
|
- if (!jsonObject.containsKey("points")) {
|
|
|
-// String cameraName = jsonObject.getString("camid");
|
|
|
-// Camera camera = cameraService.getByChildName(cameraName);
|
|
|
-// if (camera == null) {
|
|
|
-// log.error("该相机不存在:" + cameraName);
|
|
|
-// throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
-// }
|
|
|
-//
|
|
|
-// CameraDetail detail = cameraDetailService.getByCameraId(camera.getId());
|
|
|
-// if (detail == null) {
|
|
|
-// log.error("该相机详情不存在:" + cameraName);
|
|
|
-// throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
-// }
|
|
|
-//
|
|
|
-// Long userId = null;
|
|
|
-// String userName = null;
|
|
|
-//
|
|
|
-// if (detail.getUserId() != null) {
|
|
|
-// SSOUser user = userService.getSSOUserByUserId(detail.getUserId());
|
|
|
-// if (user == null) {
|
|
|
-// log.error("用户id不存在:" + detail.getUserId());
|
|
|
-// } else {
|
|
|
-// userId = user.getId();
|
|
|
-// userName = user.getUserName();
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// //13表示转台
|
|
|
-// Long cameraType = 13L;
|
|
|
-// //激光转台 八目相机占用 10 和 11
|
|
|
-// if(jsonObject.getJSONObject("cam").getIntValue("type") == 10){
|
|
|
-// //激光转台
|
|
|
-// cameraType = 14L;
|
|
|
-// }
|
|
|
-//
|
|
|
-// String unicode = jsonObject.getString("creator") + "_" + jsonObject.getString("uuidtime");
|
|
|
-// Object[] objects = this.createScenePlus(num, camera.getId(), camera.getChildName(), jsonObject.getString("creator"),
|
|
|
-// jsonObject.getString("pwd"), unicode,
|
|
|
-// detail.getType(), fileId, "http://creator.4dkankan.com/" + unicode + File.separator, "zip.Zip",
|
|
|
-// jsonObject.getString("scenePic"), "0", userId, userName,
|
|
|
-// jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location")) ? "sfm" : "slam",
|
|
|
-// jsonObject.getJSONArray("imgs").size(), jsonObject.getString("name"), jsonObject.getString("info"),
|
|
|
-// jsonObject.getInteger("scenetype"), jsonObject.getString("gps"), 1,
|
|
|
-// jsonObject.getInteger("resolution"), sceneUrl, buildType, null);
|
|
|
-// BuildSceneCallMessage mqMessage = (BuildSceneCallMessage)objects[1];
|
|
|
-// scenePlusVO = (ScenePlusVO) objects[0];
|
|
|
- } else {
|
|
|
- String cameraName = jsonObject.getJSONObject("cam").getString("uuid");
|
|
|
- String userName = null;
|
|
|
- if (!ObjectUtils.isEmpty(sceneUserId)) {
|
|
|
- SSOUser user = userService.getSSOUserByUserId(sceneUserId);
|
|
|
- userName = user.getUserName();
|
|
|
- }
|
|
|
- //重算的场景,先移除该场景对应的容量
|
|
|
- scenePlusService.resetSpace(num);
|
|
|
-
|
|
|
- JSONObject statusJson = new JSONObject();
|
|
|
- //临时将-2改成1,app还没完全更新
|
|
|
- statusJson.put("status", sceneStatus == -2 ? 1 : sceneStatus);
|
|
|
- statusJson.put("webSite", webSite);
|
|
|
- statusJson.put("sceneNum", num);
|
|
|
- statusJson.put("thumb", thumb);
|
|
|
- statusJson.put("payStatus", payStatus);
|
|
|
- String statusJsonLocalPath = ConstantFilePath.SCENE_PATH + "data/data" + num + File.separator + "status.json";
|
|
|
- String statusJsonOssPath = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "status.json";
|
|
|
- FileUtils.writeFile(statusJsonLocalPath, statusJson.toString());
|
|
|
- fYunFileService.uploadFile(bucket, statusJsonLocalPath, statusJsonOssPath);
|
|
|
- String unicode = jsonObject.getString("creator") + "_" + jsonObject.getString("uuidtime");
|
|
|
-
|
|
|
- Long cameraType = (long)sceneScheme == 3 ? 12 : (long)sceneScheme;
|
|
|
- //判断是否转台相机
|
|
|
- if(sceneSource == 3){
|
|
|
- cameraType = 13L;
|
|
|
- }
|
|
|
- if(sceneSource == 4){
|
|
|
- cameraType = 14L;
|
|
|
- }
|
|
|
+ String cameraName = jsonObject.getJSONObject("cam").getString("uuid");
|
|
|
+ String userName = null;
|
|
|
+ if (!ObjectUtils.isEmpty(sceneUserId)) {
|
|
|
+ SSOUser user = userService.getSSOUserByUserId(sceneUserId);
|
|
|
+ userName = user.getUserName();
|
|
|
+ }
|
|
|
+ //重算的场景,先移除该场景对应的容量
|
|
|
+ scenePlusService.resetSpace(num);
|
|
|
+
|
|
|
+ JSONObject statusJson = new JSONObject();
|
|
|
+ //临时将-2改成1,app还没完全更新
|
|
|
+ statusJson.put("status", sceneStatus == -2 ? 1 : sceneStatus);
|
|
|
+ statusJson.put("webSite", webSite);
|
|
|
+ statusJson.put("sceneNum", num);
|
|
|
+ statusJson.put("thumb", thumb);
|
|
|
+ statusJson.put("payStatus", payStatus);
|
|
|
+ String statusJsonLocalPath = ConstantFilePath.SCENE_PATH + "data/data" + num + File.separator + "status.json";
|
|
|
+ String statusJsonOssPath = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "status.json";
|
|
|
+ FileUtils.writeFile(statusJsonLocalPath, statusJson.toString());
|
|
|
+ fYunFileService.uploadFile(bucket, statusJsonLocalPath, statusJsonOssPath);
|
|
|
+ String unicode = jsonObject.getString("creator") + "_" + jsonObject.getString("uuidtime");
|
|
|
+
|
|
|
+ Long cameraType = (long)sceneScheme == 3 ? 12 : (long)sceneScheme;
|
|
|
+ //判断是否转台相机
|
|
|
+ if(sceneSource == 3){
|
|
|
+ cameraType = 13L;
|
|
|
+ }
|
|
|
+ if(sceneSource == 4){
|
|
|
+ cameraType = 14L;
|
|
|
+ }
|
|
|
|
|
|
- if(sceneSource == 4){
|
|
|
- fdkkLaserService.updateSceneStatus(num,0);
|
|
|
- BuildSceneCallMessage buildSceneMqMessage =this.getBuildSceneMqMessage(
|
|
|
- num, cameraName, unicode, cameraType, fileId,
|
|
|
- dataSource.replace(ConstantFilePath.BUILD_MODEL_PATH, "")
|
|
|
- .replace(ConstantFilePath.BUILD_MODEL_LASER_PATH,"")+ File.separator,
|
|
|
- "zip.Zip", "0",
|
|
|
- userName, jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location")) ? "sfm" : "slam",
|
|
|
- jsonObject.getInteger("resolution"), buildType,
|
|
|
- ConstantFilePath.BUILD_MODEL_LASER_PATH + unicode, sceneId, sceneName,
|
|
|
- webSite, createTime, sceneUserId, dataSource, sceneStatus, payStatus, thumb);
|
|
|
- rabbitMqProducer.sendByWorkQueue(queueModelingPre, buildSceneMqMessage);
|
|
|
- }else{
|
|
|
- BuildSceneCallMessage buildSceneMqMessage =this.getBuildSceneMqMessage(
|
|
|
- num, cameraName, unicode, cameraType, fileId,
|
|
|
- dataSource.replace(ConstantFilePath.BUILD_MODEL_PATH, "")
|
|
|
- .replace(ConstantFilePath.BUILD_MODEL_LASER_PATH,"")+ File.separator,
|
|
|
- "zip.Zip", "0",
|
|
|
- userName, jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location")) ? "sfm" : "slam",
|
|
|
- jsonObject.getInteger("resolution"), buildType,
|
|
|
- ConstantFilePath.BUILD_MODEL_PATH + unicode, sceneId, sceneName,
|
|
|
- webSite, createTime, sceneUserId, dataSource, sceneStatus, payStatus, thumb);
|
|
|
-
|
|
|
- rabbitMqProducer.sendByWorkQueue(queueModelingPre, buildSceneMqMessage);
|
|
|
- }
|
|
|
+ if(sceneSource == 4){
|
|
|
+ fdkkLaserService.updateSceneStatus(num,0);
|
|
|
+ BuildSceneCallMessage buildSceneMqMessage =this.getBuildSceneMqMessage(
|
|
|
+ num, cameraName, unicode, cameraType, fileId,
|
|
|
+ dataSource.replace(ConstantFilePath.BUILD_MODEL_PATH, "")
|
|
|
+ .replace(ConstantFilePath.BUILD_MODEL_LASER_PATH,"")+ File.separator,
|
|
|
+ "zip.Zip", "0",
|
|
|
+ userName, jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location")) ? "sfm" : "slam",
|
|
|
+ jsonObject.getInteger("resolution"), buildType,
|
|
|
+ ConstantFilePath.BUILD_MODEL_LASER_PATH + unicode, sceneId, sceneName,
|
|
|
+ webSite, createTime, sceneUserId, dataSource, sceneStatus, payStatus, thumb);
|
|
|
+ rabbitMqProducer.sendByWorkQueue(queueModelingPre, buildSceneMqMessage);
|
|
|
+ }else{
|
|
|
+ BuildSceneCallMessage buildSceneMqMessage =this.getBuildSceneMqMessage(
|
|
|
+ num, cameraName, unicode, cameraType, fileId,
|
|
|
+ dataSource.replace(ConstantFilePath.BUILD_MODEL_PATH, "")
|
|
|
+ .replace(ConstantFilePath.BUILD_MODEL_LASER_PATH,"")+ File.separator,
|
|
|
+ "zip.Zip", "0",
|
|
|
+ userName, jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location")) ? "sfm" : "slam",
|
|
|
+ jsonObject.getInteger("resolution"), buildType,
|
|
|
+ ConstantFilePath.BUILD_MODEL_PATH + unicode, sceneId, sceneName,
|
|
|
+ webSite, createTime, sceneUserId, dataSource, sceneStatus, payStatus, thumb);
|
|
|
+
|
|
|
+ rabbitMqProducer.sendByWorkQueue(queueModelingPre, buildSceneMqMessage);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
|
|
|
- .set(ScenePlus::getSceneStatus, SceneStatus.wait.code())
|
|
|
- .eq(ScenePlus::getNum, num));
|
|
|
+ scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
|
|
|
+ .set(ScenePlus::getSceneStatus, SceneStatus.wait.code())
|
|
|
+ .eq(ScenePlus::getNum, num));
|
|
|
|
|
|
- }
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
}
|