|
@@ -39,6 +39,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
import java.io.File;
|
|
|
+import java.io.IOException;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
@@ -225,16 +226,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
return list.get(0);
|
|
|
}
|
|
|
|
|
|
- public void buildScene(String filePath, String fileId, String prefix) throws Exception{
|
|
|
- //获取解压后的资源的data.fdage中的数据
|
|
|
- String data = FileUtils.readFile(filePath + "data.fdage");
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(data);
|
|
|
-
|
|
|
- if(ObjectUtils.isEmpty(jsonObject)){
|
|
|
- log.info("data.fdage文件不存在");
|
|
|
- throw new BusinessException(CameraConstant.FAILURE_6009);
|
|
|
- }
|
|
|
-
|
|
|
+ public void buildScene(String fileId, String prefix,JSONObject jsonObject,String buildType,long cameraType) throws Exception{
|
|
|
//调用createScene方法生成scene数据和加入算法队列
|
|
|
String sceneNum = "";
|
|
|
|
|
@@ -270,7 +262,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
|
|
|
String localDataPath = String.format(ConstantFilePath.DATABUFFER_FORMAT, sceneNum);
|
|
|
- String localImagesPath = String.format(ConstantFilePath.IMAGESBUFFER_FORMAT, sceneNum);
|
|
|
String imgViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, sceneNum);
|
|
|
String dataViewPath = String.format(UploadFilePath.DATA_VIEW_PATH, sceneNum);
|
|
|
|
|
@@ -284,6 +275,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
if (!ObjectUtils.isEmpty(jsonObject.getString("icon"))) {
|
|
|
fYunFileService.copyFileInBucket(ConstantFilePath.OSS_PREFIX + prefix + jsonObject.getString("icon"),imgViewPath + jsonObject.getString("icon"));
|
|
|
icon = fYunFileConfig.getHost() + imgViewPath + jsonObject.getString("icon");
|
|
|
+ log.info("上传icon成功....");
|
|
|
}
|
|
|
|
|
|
JSONObject firmwareVersion = new JSONObject();
|
|
@@ -296,15 +288,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
|
|
|
String sceneUrl = mainUrl + "/" + sceneProNewUrl;
|
|
|
- String buildType = "V2";
|
|
|
- Long cameraType = 10L;
|
|
|
- //根据videoVersion判断是V2还是V3版本的算法和页面
|
|
|
- if (jsonObject.containsKey("videoVersion") && StrUtil.isNotEmpty(jsonObject.getString("videoVersion"))) {
|
|
|
- if (jsonObject.getIntValue("videoVersion") >= 4) {
|
|
|
- buildType = "V3";
|
|
|
- cameraType = 11L;
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
//重算的场景,先移除该场景对应的容量
|
|
|
if (rebuild == 1) {
|
|
|
scenePlusService.resetSpace(sceneNum);
|
|
@@ -316,19 +300,14 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
fYunFileService.uploadFile(ConstantFilePath.LOGO_PATH + "logo-main.png", imgViewPath + "logo-main.png");
|
|
|
fYunFileService.uploadFile(ConstantFilePath.LOGO_PATH + "logo-main-en.png", imgViewPath + "logo-main-en.png");
|
|
|
}
|
|
|
+ String algorithm = jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location")) ? "sfm" : "slam";
|
|
|
|
|
|
- Object[] objects = this.createScenePlus(sceneNum, camera.getId(), camera.getChildName(), jsonObject.getString("creator"),
|
|
|
- jsonObject.getString("pwd"), unicode,
|
|
|
- cameraType, fileId, prefix, "", icon, "0", cameraDetail.getUserId(), userName,
|
|
|
- jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location")) ? "sfm" : "slam",
|
|
|
+ ScenePlusVO scenePlusVO = this.createScenePlus(sceneNum, camera.getId(), camera.getChildName(), jsonObject.getString("creator"),
|
|
|
+ jsonObject.getString("pwd"), unicode,cameraType, fileId, icon, cameraDetail.getUserId(), userName,algorithm,
|
|
|
jsonObject.getJSONArray("points").size(), jsonObject.getString("name"), jsonObject.getString("info"),
|
|
|
jsonObject.getInteger("scenetype"), jsonObject.getString("gps"), rebuild,
|
|
|
jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, cameraDetail.getCooperationUser());
|
|
|
|
|
|
- ScenePlusVO scenePlusVO = (ScenePlusVO) objects[0];
|
|
|
- BuildSceneCallMessage mqMessage = (BuildSceneCallMessage) objects[1];
|
|
|
-
|
|
|
-
|
|
|
if (Objects.nonNull(scenePlusVO)) {
|
|
|
JSONObject statusJson = new JSONObject();
|
|
|
//临时将-2改成1,app还没完全更新
|
|
@@ -347,30 +326,10 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
log.info("复制企业logo");
|
|
|
SceneEditInfo sceneEditInfo = sceneEditInfoService.getByScenePlusId(scenePlusVO.getId());
|
|
|
if (StrUtil.isNotEmpty(company.getTopLogo())) {
|
|
|
- if (!new File(ConstantFilePath.BASE_PATH + File.separator + company.getTopLogo()).exists()) {
|
|
|
- log.info("下载topLogo");
|
|
|
- FileUtils.downLoadFromUrl(mainUrl + company.getTopLogo() + "?t=" + System.currentTimeMillis(),
|
|
|
- company.getTopLogo().substring(company.getTopLogo().lastIndexOf("/") + 1),
|
|
|
- ConstantFilePath.BASE_PATH + company.getTopLogo().substring(0, company.getTopLogo().lastIndexOf("/")));
|
|
|
- }
|
|
|
-
|
|
|
- FileUtils.copyFile(ConstantFilePath.BASE_PATH + File.separator + company.getTopLogo(),
|
|
|
- localImagesPath + "logo-main.png", true);
|
|
|
- fYunFileService.uploadFile(localImagesPath + "logo-main.png", imgViewPath + "logo-main.png");
|
|
|
+ fYunFileService.copyFileInBucket(company.getTopLogo(),imgViewPath + "logo-main.png");
|
|
|
}
|
|
|
-
|
|
|
if (StrUtil.isNotEmpty(company.getFloorLogo())) {
|
|
|
- if (!new File(ConstantFilePath.BASE_PATH + File.separator + company.getFloorLogo()).exists()) {
|
|
|
- log.info("下载floorLogo");
|
|
|
- FileUtils.downLoadFromUrl(mainUrl + company.getFloorLogo() + "?t=" + System.currentTimeMillis(),
|
|
|
- company.getFloorLogo().substring(company.getFloorLogo().lastIndexOf("/") + 1),
|
|
|
- ConstantFilePath.BASE_PATH + company.getFloorLogo().substring(0, company.getFloorLogo().lastIndexOf("/")));
|
|
|
- }
|
|
|
-
|
|
|
- FileUtils.copyFile(ConstantFilePath.BASE_PATH + File.separator + company.getFloorLogo(),
|
|
|
- localImagesPath + "floorLogoImg.png", true);
|
|
|
- fYunFileService.uploadFile(localImagesPath + "floorLogoImg.png", imgViewPath + "floorLogoImg.png");
|
|
|
-
|
|
|
+ fYunFileService.copyFileInBucket(company.getFloorLogo(),imgViewPath + "floorLogoImg.png");
|
|
|
sceneEditInfo.setFloorLogo("user");
|
|
|
}
|
|
|
|
|
@@ -385,6 +344,9 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ BuildSceneCallMessage mqMessage = getBuildSceneMqMessage(sceneNum, cameraType, algorithm, jsonObject.getInteger("resolution"), buildType,
|
|
|
+ scenePlusVO.getDataSource());
|
|
|
rabbitMqProducer.sendByWorkQueue(queueModelingPre, mqMessage);
|
|
|
}
|
|
|
|
|
@@ -401,7 +363,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
// 私钥解密过程
|
|
|
byte[] res = RSAEncrypt.decrypt(RSAEncrypt.loadPrivateKeyByStr(RSAEncrypt.loadPrivateKeyByFile()), base64.decode(cipher));
|
|
|
String restr = new String(res, "UTF-8");
|
|
|
- log.debug("uploadSuccessBuild-params解密结果:" + restr);
|
|
|
+ log.info("uploadSuccessBuild-params解密结果:" + restr);
|
|
|
String[] strArr = restr.split(SPLICE);
|
|
|
if (strArr.length != 3) {
|
|
|
throw new BusinessException(ErrorCode.PARAM_REQUIRED);
|
|
@@ -434,7 +396,23 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
filePath.mkdirs();
|
|
|
}
|
|
|
fYunFileService.downloadFile(ConstantFilePath.OSS_PREFIX + prefixBuffer.toString() + "data.fdage",filePathBuffer.toString() + "data.fdage");
|
|
|
- buildScene(filePathBuffer.toString(), fileId, prefixBuffer.toString());
|
|
|
+
|
|
|
+ String buildType = "V2";
|
|
|
+ Long cameraType = 10L;
|
|
|
+ JSONObject fdageJson = FileUtils.readJson(filePath + "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;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ buildScene(fileId, prefixBuffer.toString(),fdageJson,buildType,cameraType);
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
|
|
@@ -498,188 +476,26 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
filePath.mkdirs();
|
|
|
}
|
|
|
fYunFileService.downloadFile(ConstantFilePath.OSS_PREFIX + prefixBuffer.toString() + "data.fdage", filePathBuffer.toString() + "data.fdage");
|
|
|
- turntableBuildScene(filePathBuffer.toString(), fileId, true, prefixBuffer.toString());
|
|
|
- return ResultData.ok();
|
|
|
- }
|
|
|
-
|
|
|
- public void turntableBuildScene(String filePath, String fileId, boolean fromOss, String prefix) throws Exception{
|
|
|
-
|
|
|
- String data = FileUtils.readFile(filePath + "data.fdage");
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(data);
|
|
|
-
|
|
|
- //调用createScene方法生成scene数据和加入算法队列
|
|
|
- if(jsonObject == null) {
|
|
|
+ JSONObject fdageJson = FileUtils.readJson(filePath + "data.fdage");
|
|
|
+ if(ObjectUtils.isEmpty(fdageJson)){
|
|
|
log.info("data.fdage文件不存在");
|
|
|
throw new BusinessException(CameraConstant.FAILURE_6009);
|
|
|
}
|
|
|
-
|
|
|
- String sceneNum = "";
|
|
|
- String snCode = jsonObject.getJSONObject("cam").getString("uuid");
|
|
|
- String unicode = jsonObject.getString("creator") + "_" + jsonObject.getString("uuidtime"); //从data.fage 取出
|
|
|
- //查看场景中的文件目录是否有改文件id,有则重新计算改场景,无则新建场景
|
|
|
- ScenePlus scene = scenePlusService.getByFileId("/" + fileId + "/");
|
|
|
-
|
|
|
- int rebuild = 1;
|
|
|
- log.info("查询相机:" + snCode);
|
|
|
- Camera camera = cameraService.getByChildName(snCode);
|
|
|
-
|
|
|
- if(camera == null){
|
|
|
- log.error("该相机不存在:" + snCode);
|
|
|
- camera = cameraService.getBySnCode(snCode);
|
|
|
- if(camera == null){
|
|
|
- throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- CameraDetail cameraDetail = cameraDetailService.getByCameraId(camera.getId());
|
|
|
- if(cameraDetail == null){
|
|
|
- log.error("该相机详情不存在:" + snCode);
|
|
|
- throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
- }
|
|
|
- if(Objects.nonNull(scene)){
|
|
|
- sceneNum = scene.getNum();
|
|
|
- if(scene.getSceneStatus() == SceneStatus.wait.code()){
|
|
|
- log.info(sceneNum + ":场景处于计算中,不能再计算");
|
|
|
- return;
|
|
|
- }
|
|
|
- }else {
|
|
|
- sceneNum = scene3dNumService.generateSceneNum(cameraDetail.getType());
|
|
|
- rebuild = 0;
|
|
|
- }
|
|
|
- if(sceneNum == null){
|
|
|
- log.error("大场景序号为空:" + sceneNum);
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
- }
|
|
|
- log.info("是否是重算,rebuild:{}",rebuild);
|
|
|
-
|
|
|
- String localDataPath = String.format(ConstantFilePath.DATABUFFER_FORMAT, sceneNum);
|
|
|
- String localImagesPath = String.format(ConstantFilePath.IMAGESBUFFER_FORMAT, sceneNum);
|
|
|
- String imageViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, sceneNum);
|
|
|
- String dataViewPath = String.format(UploadFilePath.DATA_VIEW_PATH, sceneNum);
|
|
|
-
|
|
|
- String userName = null;
|
|
|
- if(cameraDetail.getUserId() != null){
|
|
|
- SSOUser user = userService.getSSOUserByUserId(cameraDetail.getUserId());
|
|
|
- if(user != null){
|
|
|
- userName = user.getUserName();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- String icon = null;
|
|
|
- if(jsonObject.containsKey("icon") && StrUtil.isNotEmpty(jsonObject.getString("icon"))){
|
|
|
- fYunFileService.copyFileInBucket(ConstantFilePath.OSS_PREFIX + prefix + jsonObject.getString("icon"),imageViewPath + jsonObject.getString("icon"));
|
|
|
- icon = fYunFileConfig.getHost() + imageViewPath + jsonObject.getString("icon");
|
|
|
- log.info("上传icon成功....");
|
|
|
- }
|
|
|
-
|
|
|
- JSONObject firmwareVersion = new JSONObject();
|
|
|
- if(jsonObject.containsKey("camSoftwareVersion") && StrUtil.isNotEmpty(jsonObject.getString("camSoftwareVersion"))){
|
|
|
- firmwareVersion.put("camSoftwareVersion", jsonObject.getString("camSoftwareVersion"));
|
|
|
- }
|
|
|
-
|
|
|
- if(jsonObject.containsKey("version") && StrUtil.isNotEmpty(jsonObject.getString("version"))){
|
|
|
- firmwareVersion.put("version", jsonObject.getString("version"));
|
|
|
- }
|
|
|
-
|
|
|
- String sceneUrl = mainUrl + "/" + sceneProNewUrl;
|
|
|
String buildType = "V3";
|
|
|
//13表示转台
|
|
|
Long cameraType = 13L;
|
|
|
|
|
|
//激光转台 八目相机占用 10 和 11
|
|
|
- if(jsonObject.getJSONObject("cam").getIntValue("type") == 10){
|
|
|
+ if(fdageJson.getJSONObject("cam").getIntValue("type") == 10){
|
|
|
//激光转台
|
|
|
cameraType = 14L;
|
|
|
}
|
|
|
-
|
|
|
- //重算的场景,先移除该场景对应的容量
|
|
|
- if(rebuild == 1){
|
|
|
- scenePlusService.resetSpace(sceneNum);
|
|
|
- }else {
|
|
|
- //上传log-main.png
|
|
|
- fYunFileService.uploadFile(ConstantFilePath.LOGO_PATH + "logo-main.png", imageViewPath + "logo-main.png");
|
|
|
- fYunFileService.uploadFile(ConstantFilePath.LOGO_PATH + "logo-main-en.png", imageViewPath + "logo-main-en.png");
|
|
|
- log.info("第一次计算场景,上传logo-main.png");
|
|
|
-
|
|
|
- }
|
|
|
- Object[] objects = this.createScenePlus(sceneNum, camera.getId(), camera.getChildName(), jsonObject.getString("creator"),
|
|
|
- jsonObject.getString("pwd"), unicode,
|
|
|
- cameraType, String.valueOf(fileId), prefix, "", icon, "0", cameraDetail.getUserId(), userName,
|
|
|
- jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location")) ? "sfm" : "slam",
|
|
|
- jsonObject.getJSONArray("points").size(), jsonObject.getString("name"), jsonObject.getString("info"),
|
|
|
- jsonObject.getInteger("scenetype"), jsonObject.getString("gps"), rebuild,
|
|
|
- jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, cameraDetail.getCooperationUser());
|
|
|
- BuildSceneCallMessage mqMessage = (BuildSceneCallMessage)objects[1];
|
|
|
- ScenePlusVO scenePlusVO = (ScenePlusVO) objects[0];
|
|
|
-
|
|
|
- if(scenePlusVO != null){
|
|
|
- JSONObject statusJson = new JSONObject();
|
|
|
- //临时将-2改成1,app还没完全更新
|
|
|
- statusJson.put("status", scenePlusVO.getSceneStatus() == -2 ? 1 : scenePlusVO.getSceneStatus());
|
|
|
- statusJson.put("webSite", scenePlusVO.getWebSite());
|
|
|
- statusJson.put("sceneNum", scenePlusVO.getNum());
|
|
|
- statusJson.put("thumb", scenePlusVO.getThumb());
|
|
|
- statusJson.put("payStatus", 0);
|
|
|
- statusJson.put("recStatus", "A");
|
|
|
- FileUtils.writeFile(localDataPath + "status.json", statusJson.toString());
|
|
|
-
|
|
|
- fYunFileService.uploadFile(localDataPath + "status.json", dataViewPath + "status.json");
|
|
|
-
|
|
|
- log.info("上传status.json,上传内容:{}" + statusJson.toString());
|
|
|
- }
|
|
|
-
|
|
|
- if(cameraDetail.getCompanyId() != null){
|
|
|
-
|
|
|
- Company company = companyService.getById(cameraDetail.getCompanyId());
|
|
|
- if(company != null){
|
|
|
-
|
|
|
- Map<String, Object> jsonMap = new HashMap<>();
|
|
|
-
|
|
|
- log.info("复制企业logo");
|
|
|
- SceneEditInfo sceneEditInfo = sceneEditInfoService.getByScenePlusId(scenePlusVO.getId());
|
|
|
-
|
|
|
- if(StrUtil.isNotEmpty(company.getTopLogo())){
|
|
|
- FileUtils.copyFile(ConstantFilePath.BASE_PATH + File.separator + company.getTopLogo(),localImagesPath + "logo-main.png", true);
|
|
|
- fYunFileService.uploadFile(localImagesPath + "logo-main.png", imageViewPath + "logo-main.png");
|
|
|
- }
|
|
|
-
|
|
|
- if(StrUtil.isNotEmpty(company.getFloorLogo())){
|
|
|
-
|
|
|
- FileUtils.copyFile(ConstantFilePath.BASE_PATH + File.separator + company.getFloorLogo(),
|
|
|
- localImagesPath + "floorLogoImg.png", true);
|
|
|
-
|
|
|
- fYunFileService.uploadFile(localImagesPath + "floorLogoImg.png",
|
|
|
- imageViewPath + "floorLogoImg.png");
|
|
|
-
|
|
|
- sceneEditInfo.setFloorLogo("user");
|
|
|
- }
|
|
|
-
|
|
|
- if(StrUtil.isNotEmpty(company.getQrLogo())){
|
|
|
- //生成新的分享的二维码-中文版本
|
|
|
- MatrixToImageWriterUtil.createQRCode(sceneUrl + sceneNum, ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+sceneNum+".png",
|
|
|
- false, ConstantFilePath.SCENE_PATH + "images/images" + sceneNum + "/QRShareLogo.png");
|
|
|
- //生成新的分享的二维码-英文版本
|
|
|
- MatrixToImageWriterUtil.createQRCode(sceneUrl + sceneNum + "&lang=en", ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+sceneNum+"_en.png",
|
|
|
- false, ConstantFilePath.SCENE_PATH + "images/images" + sceneNum + "/QRShareLogo.png");
|
|
|
- }
|
|
|
-
|
|
|
- sceneEditInfoService.updateById(sceneEditInfo);
|
|
|
- }
|
|
|
-
|
|
|
- //删除oss的houst_floor.json
|
|
|
- fYunFileService.deleteFile(dataViewPath + "houst_floor.json");
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- //激光转台 八目相机占用 10 和 11
|
|
|
- log.info("发送mq,camType:{}", jsonObject.getJSONObject("cam").getIntValue("type"));
|
|
|
- rabbitMqProducer.sendByWorkQueue(queueModelingPre, mqMessage);
|
|
|
+ buildScene(fileId, prefixBuffer.toString(),fdageJson,buildType,cameraType);
|
|
|
+ return ResultData.ok();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- public Object[] createScenePlus(String projectNum, Long cameraId, String cameraName, String phoneId, String sceneKey,
|
|
|
- String unicode, Long cameraType, String fileId, String prefix,
|
|
|
- String imgsName, String pic, String isModel, Long userId, String userName,
|
|
|
+ public ScenePlusVO createScenePlus(String projectNum, Long cameraId, String cameraName, String phoneId, String sceneKey,
|
|
|
+ String unicode, Long cameraType, String fileId, String pic, Long userId, String userName,
|
|
|
String algorithm, Integer sceneShootCount, String sceneName,
|
|
|
String sceneDec, Integer sceneType, String gps,Integer type,
|
|
|
Integer resolution, String firmwareVersion, String url, String buildType,
|
|
@@ -852,14 +668,10 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
}
|
|
|
|
|
|
- BuildSceneCallMessage buildSceneMqMessage =this.getBuildSceneMqMessage(
|
|
|
- projectNum, cameraType, algorithm, resolution, buildType,
|
|
|
- scenePlusExt.getDataSource());
|
|
|
-
|
|
|
BeanUtil.copyProperties(scenePlusExt, scenePlusVO);
|
|
|
BeanUtil.copyProperties(scenePlus, scenePlusVO);
|
|
|
|
|
|
- return new Object[]{scenePlusVO, buildSceneMqMessage};
|
|
|
+ return scenePlusVO;
|
|
|
}
|
|
|
|
|
|
public BuildSceneCallMessage getBuildSceneMqMessage(String projectNum,
|
|
@@ -877,7 +689,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ResultData rebuildScene(String num,Boolean force) {
|
|
|
+ public ResultData rebuildScene(String num,Boolean force) throws IOException {
|
|
|
|
|
|
ScenePro scenePro = sceneProService.getByNum(num);
|
|
|
//如果是v3场景,不允许重算,需要升级v4后再调此接口进行重算
|
|
@@ -921,8 +733,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
.replace(ConstantFilePath.BUILD_MODEL_LASER_PATH, "") + "/data.fdage";
|
|
|
fYunFileService.downloadFileByCommand(bucket, path + "/capture", dataFdageOssPath);
|
|
|
|
|
|
- String data = FileUtils.readFile(folderPath.getAbsolutePath() + File.separator + "capture" + File.separator + "data.fdage");
|
|
|
- com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(data);
|
|
|
+ JSONObject jsonObject = FileUtils.readJson(folderPath.getAbsolutePath() + File.separator + "capture" + File.separator + "data.fdage");
|
|
|
if(ObjectUtils.isEmpty(jsonObject)){
|
|
|
log.error("data.fdage文件不存在");
|
|
|
return ResultData.error(CameraConstant.FAILURE_6009.code(), CameraConstant.FAILURE_6009.message());
|