|
@@ -1534,7 +1534,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
icon = fYunFileConfig.getHost() + imgViewPath + fdageData.getString("icon");
|
|
|
log.info("上传icon成功....");
|
|
|
}
|
|
|
- buildScenePost(dataSource, fdageData, "V3", cameraType, sceneNum, cameraEntity, detailEntity, rebuild, icon, user, customUserId);
|
|
|
+ buildScenePost(dataSource, fdageData, "V3", cameraType, sceneNum, cameraEntity, detailEntity, rebuild, icon, user, customUserId, "zip");
|
|
|
|
|
|
scenePlus = scenePlusService.getScenePlusByNum(sceneNum);
|
|
|
fdkkLaserService.saveScene(scenePlus,fdageData,cameraEntity,user.getUserName(),rebuild == 1 ? true : false);
|
|
@@ -1547,7 +1547,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
|
|
|
private ScenePlusVO buildScenePost(String dataSource, JSONObject jsonObject, String buildType, long cameraType,
|
|
|
- String sceneNum, Camera camera, CameraDetail cameraDetail, int rebuild,String icon,User user, String customUserId) throws Exception {
|
|
|
+ String sceneNum, Camera camera, CameraDetail cameraDetail, int rebuild,String icon,User user, String customUserId, String uploadType) throws Exception {
|
|
|
String localDataPath = String.format(ConstantFilePath.DATABUFFER_FORMAT, sceneNum);
|
|
|
String imgViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, sceneNum);
|
|
|
String dataViewPath = String.format(UploadFilePath.DATA_VIEW_PATH, sceneNum);
|
|
@@ -1565,13 +1565,13 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
//重算的场景,先移除该场景对应的容量
|
|
|
if (rebuild == 1) {
|
|
|
- try {
|
|
|
- scenePlusService.resetSpace(sceneNum);
|
|
|
- }catch (Exception e){
|
|
|
- log.error("重置容量失败", e);
|
|
|
- }
|
|
|
- //删除oss的houst_floor.json(国际版可能会卡住)
|
|
|
- fYunFileService.deleteFile(dataViewPath + "houst_floor.json");
|
|
|
+// try {
|
|
|
+// scenePlusService.resetSpace(sceneNum);
|
|
|
+// }catch (Exception e){
|
|
|
+// log.error("重置容量失败", e);
|
|
|
+// }
|
|
|
+// //删除oss的houst_floor.json(国际版可能会卡住)
|
|
|
+// fYunFileService.deleteFile(dataViewPath + "houst_floor.json");
|
|
|
} else {
|
|
|
//上传log-main.png
|
|
|
fYunFileService.uploadFile(ConstantFilePath.LOGO_PATH + "logo-main.png", imgViewPath + "logo-main.png");
|
|
@@ -1611,6 +1611,14 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
mqMessage.getExt().put("deleteExtras", true);
|
|
|
mqMessage.getExt().put("customUserId", customUserId);
|
|
|
mqMessage.getExt().put("gps", jsonObject.getString("gps"));
|
|
|
+
|
|
|
+ if(uploadType.equals("single")){//场景上传模式(single-细小文件上传, zip-压缩包上传)
|
|
|
+ //修改场景上传批次为进入计算
|
|
|
+ OrigFileUploadBatch origFileUploadBatch = origFileUploadBatchService.getWaitingBatchByUuid(unicode);
|
|
|
+ origFileUploadBatch.setStatus(1);
|
|
|
+ origFileUploadBatchService.updateById(origFileUploadBatch);
|
|
|
+ mqMessage.getExt().put("batchId", origFileUploadBatch.getBatchId());
|
|
|
+ }
|
|
|
rabbitMqProducer.sendByWorkQueue(queueModelingPre, mqMessage);
|
|
|
|
|
|
return scenePlusVO;
|
|
@@ -2272,7 +2280,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ResultData noticeBuild(String uuid) throws Exception {
|
|
|
+ public ResultData noticeBuild(String uuid, boolean init) throws Exception {
|
|
|
log.info("通知计算,uuid:{} " + uuid);
|
|
|
|
|
|
String[] uuidArr = uuid.split("_");
|
|
@@ -2287,11 +2295,11 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
Camera camera = cameraService.getBySnCode(snCode);
|
|
|
if(Objects.isNull(camera)){
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_7010);
|
|
|
+ throw new BusinessException(ErrorCode.CAMERA_BIND_NO_EXIST.code(), "相机未入库");
|
|
|
}
|
|
|
CameraDetail cameraDetail = cameraDetailService.getByCameraId(camera.getId());
|
|
|
if(Objects.isNull(cameraDetail)){
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_7010);
|
|
|
+ throw new BusinessException(ErrorCode.CAMERA_BIND_NO_EXIST.code(), "相机未入库");
|
|
|
}
|
|
|
Integer camType = cameraDetail.getType();
|
|
|
if(camType == 10 || camType == 11){//深时或者深光
|
|
@@ -2300,25 +2308,64 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
cameraType = 10L;
|
|
|
}
|
|
|
|
|
|
-// if(!fYunFileService.fileExist(ConstantFilePath.OSS_PREFIX + prefixBuffer + "data.fdage")){
|
|
|
-// log.error("data.fdage文件不存在");
|
|
|
-// throw new BusinessException(CameraConstant.FAILURE_6009);
|
|
|
-// }
|
|
|
-//
|
|
|
-// JSONObject fdageJson = JSONObject.parseObject(fYunFileService.getFileContent(ConstantFilePath.OSS_PREFIX + prefixBuffer + "data.fdage"));
|
|
|
-// if(ObjectUtils.isEmpty(fdageJson)){
|
|
|
-// log.info("data.fdage文件为空!");
|
|
|
-// throw new BusinessException(CameraConstant.FAILURE_6009);
|
|
|
-// }
|
|
|
-// //根据videoVersion判断是V2还是V3版本的算法和页面
|
|
|
-// if (fdageJson.containsKey("videoVersion") && StrUtil.isNotEmpty(fdageJson.getString("videoVersion"))) {
|
|
|
-// if (fdageJson.getIntValue("videoVersion") >= 4) {
|
|
|
-// buildType = "V3";
|
|
|
-// cameraType = 11L;
|
|
|
-// }
|
|
|
+ String fileId = getFileIdByFolderName(uuid);
|
|
|
+ String subFolder = snCode.concat(File.separator).concat(fileId).concat(File.separator).concat(uuid);
|
|
|
+ String dataSource = ConstantFilePath.BUILD_MODEL_PATH.concat(subFolder);
|
|
|
+ log.info("dataSource 为:{}", dataSource);
|
|
|
+
|
|
|
+
|
|
|
+ JSONObject configJson = JSONObject.parseObject(FileUtils.readFile(sendCallAlgorithmPath.concat(uuid).concat("/config.json")));
|
|
|
+ String folderName = configJson.getString("id");
|
|
|
+ String customUserId = configJson.getString("customUserId");
|
|
|
+ String customUserName = configJson.getString("customUserName");
|
|
|
+ String customUserPwd = configJson.getString("customUserPwd");
|
|
|
+ if(StrUtil.isBlank(folderName) || StrUtil.isBlank(snCode)){
|
|
|
+ throw new RuntimeException("config.json 文件有误!");
|
|
|
+ }
|
|
|
+
|
|
|
+ //调注册用户接口
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ params.put("ryId", customUserId);
|
|
|
+ params.put("ryNo", customUserName);
|
|
|
+ params.put("nickName", customUserName);
|
|
|
+ params.put("password", AesUtil.encryptCBC(customUserPwd, userPasswordKey, userPasswordIv, AesUtil.ALMODE_CBC_NOPADDING));
|
|
|
+ String url = fdServiceUrl.concat(URL_ADD_UCENTER_USER);
|
|
|
+ myClient.post(url, params);
|
|
|
+ JyUser jyUser = jyUserService.getByRyId(customUserId);
|
|
|
+ User user = userService.getById(jyUser.getUserId());
|
|
|
+ if(Objects.isNull(jyUser)){
|
|
|
+ throw new RuntimeException("注册用户失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ String sceneNum = null;
|
|
|
+
|
|
|
+ int rebuild = 0;
|
|
|
+ ScenePlus scenePlus = scenePlusService.getByFileId(dataSource);
|
|
|
+ if (!ObjectUtils.isEmpty(scenePlus)) {
|
|
|
+ log.info("该场景资源已存在,执行补拍逻辑!");
|
|
|
+ rebuild = 1;
|
|
|
+ sceneNum = scenePlus.getNum();
|
|
|
+ }else{
|
|
|
+ sceneNum = scene3dNumService.generateSceneNum(cameraDetail.getType());
|
|
|
+ init = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(init){
|
|
|
+
|
|
|
+ JSONObject fdageData = JSONObject.parseObject(FileUtils.readFile(sendCallAlgorithmPath.concat(uuid).concat("/data.fdage")));
|
|
|
+// String imgViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, sceneNum);
|
|
|
+// if(fdageData.containsKey("icon") && StringUtils.isNotEmpty(fdageData.getString("icon"))){
|
|
|
+// String ossPath = ConstantFilePath.OSS_PREFIX + dataSource.replace(ConstantFilePath.BUILD_MODEL_PATH, "")
|
|
|
+// .replace(ConstantFilePath.BUILD_MODEL_LASER_PATH, "");
|
|
|
+// fYunFileService.copyFileInBucket(ossPath + File.separator + fdageData.getString("icon"),imgViewPath + fdageData.getString("icon"));
|
|
|
+// icon = fYunFileConfig.getHost() + imgViewPath + fdageData.getString("icon");
|
|
|
+// log.info("上传icon成功....");
|
|
|
// }
|
|
|
+ buildScenePost(dataSource, fdageData, "V3", cameraType, sceneNum, camera, cameraDetail, rebuild, "", user, customUserId, "single");
|
|
|
|
|
|
-// buildScene(fileId, prefixBuffer.toString(),fdageJson,buildType,cameraType);
|
|
|
+ scenePlus = scenePlusService.getScenePlusByNum(sceneNum);
|
|
|
+ fdkkLaserService.saveScene(scenePlus,fdageData,camera,user.getUserName(),rebuild == 1 ? true : false);
|
|
|
+ }
|
|
|
|
|
|
return ResultData.ok();
|
|
|
}
|