|
@@ -269,219 +269,175 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
return list.get(0);
|
|
return list.get(0);
|
|
}
|
|
}
|
|
|
|
|
|
- public void buildScene(String filePath, String fileId, boolean fromOss, String prefix) throws Exception{
|
|
|
|
|
|
+ public void buildScene(String filePath, String fileId, String prefix) throws Exception{
|
|
//获取解压后的资源的data.fdage中的数据
|
|
//获取解压后的资源的data.fdage中的数据
|
|
String data = FileUtils.readFile(filePath + "data.fdage");
|
|
String data = FileUtils.readFile(filePath + "data.fdage");
|
|
JSONObject jsonObject = JSONObject.parseObject(data);
|
|
JSONObject jsonObject = JSONObject.parseObject(data);
|
|
|
|
|
|
|
|
+ if(ObjectUtils.isEmpty(jsonObject)){
|
|
|
|
+ log.info("data.fdage文件不存在");
|
|
|
|
+ throw new BusinessException(CameraConstant.FAILURE_6009);
|
|
|
|
+ }
|
|
|
|
+
|
|
//调用createScene方法生成scene数据和加入算法队列
|
|
//调用createScene方法生成scene数据和加入算法队列
|
|
- if(jsonObject != null){
|
|
|
|
- //有calibration值为标定,1: camera_calibration 2: color_anlysis,0正常计算
|
|
|
|
- if(jsonObject.get("calibration") != null && jsonObject.getString("calibration").equals("1")){
|
|
|
|
- String mac = filePath.replace(ConstantFilePath.BUILD_MODEL_PATH, "").split("/")[0];
|
|
|
|
- String calPath = ConstantFilePath.BUILD_MODEL_PATH + mac + "/camera_calibration";
|
|
|
|
- //生成标定数据
|
|
|
|
- ComputerUtil.createCalibrationData(calPath, filePath);
|
|
|
|
- //开始标定计算
|
|
|
|
- rabbitMqProducer.sendByWorkQueue(queueModelingCall, calPath);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- }else if(jsonObject.get("calibration") != null && jsonObject.getString("calibration").equals("2")){
|
|
|
|
- String mac = filePath.replace(ConstantFilePath.BUILD_MODEL_PATH, "").split("/")[0];
|
|
|
|
- String calPath = ConstantFilePath.BUILD_MODEL_PATH + mac + "/color_anlysis";
|
|
|
|
- //生成标定数据
|
|
|
|
- ComputerUtil.createCalibrationData(calPath, filePath);
|
|
|
|
- //开始标定计算
|
|
|
|
- Map<String,String> map = ComputerUtil.computerCalibration(calPath);
|
|
|
|
- }else if(jsonObject.get("calibration") != null && jsonObject.getString("calibration").equals("3")){
|
|
|
|
- String mac = filePath.replace(ConstantFilePath.BUILD_MODEL_PATH, "").split("/")[0];
|
|
|
|
- String calPath = ConstantFilePath.BUILD_MODEL_PATH + mac + "/shading";
|
|
|
|
- //生成标定数据
|
|
|
|
- ComputerUtil.createCalibrationData(calPath, filePath);
|
|
|
|
- //开始标定计算
|
|
|
|
- rabbitMqProducer.sendByWorkQueue(queueModelingCall, calPath);
|
|
|
|
- }else {
|
|
|
|
-
|
|
|
|
- String sceneNum = "";
|
|
|
|
-
|
|
|
|
- String cameraName = jsonObject.getJSONObject("cam").getString("uuid");
|
|
|
|
- String unicode = jsonObject.getString("creator") + "_" + jsonObject.getString("uuidtime");
|
|
|
|
-
|
|
|
|
- log.info("查询相机:" + cameraName);
|
|
|
|
- Camera camera = cameraService.getByChildName(cameraName);
|
|
|
|
-
|
|
|
|
- if(camera == null){
|
|
|
|
- log.error("该相机不存在:" + cameraName);
|
|
|
|
- //偶现data.fdage给的相机码多了或少了4DKKPRO_
|
|
|
|
- if(cameraName.contains("4DKKPRO_")){
|
|
|
|
- camera = cameraService.getByChildName(cameraName.replace("4DKKPRO_", ""));
|
|
|
|
- }else {
|
|
|
|
- camera = cameraService.getByChildName("4DKKPRO_" + cameraName);
|
|
|
|
- }
|
|
|
|
- if(camera == null){
|
|
|
|
- throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ String sceneNum = "";
|
|
|
|
|
|
- CameraDetail cameraDetail = cameraDetailService.getByCameraId(camera.getId());
|
|
|
|
- if(cameraDetail == null){
|
|
|
|
- log.error("该相机详情不存在:" + cameraName);
|
|
|
|
- throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
|
- }
|
|
|
|
|
|
+ String cameraName = jsonObject.getJSONObject("cam").getString("uuid");
|
|
|
|
+ String unicode = jsonObject.getString("creator") + "_" + jsonObject.getString("uuidtime");
|
|
|
|
|
|
- //查看场景中的文件目录是否有改文件id,有则重新计算改场景,无则新建场景
|
|
|
|
- ScenePlus scenePlus = scenePlusService.getByFileId("/" + fileId + "/");
|
|
|
|
- int rebuild = 1;
|
|
|
|
- if(Objects.nonNull(scenePlus)){
|
|
|
|
- sceneNum = scenePlus.getNum();
|
|
|
|
- if(scenePlus.getSceneStatus() == SceneStatus.wait.code()){
|
|
|
|
- log.info(sceneNum + ":场景处于计算中,不能再计算");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- }else {
|
|
|
|
- sceneNum = scene3dNumService.generateSceneNum(cameraDetail.getType());
|
|
|
|
- rebuild = 0;
|
|
|
|
- }
|
|
|
|
|
|
+ Camera camera = cameraService.getByChildName(cameraName);
|
|
|
|
|
|
- if(sceneNum == null){
|
|
|
|
- log.error("大场景序号为空:" + sceneNum);
|
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
|
- }
|
|
|
|
|
|
+ if (camera == null) {
|
|
|
|
+ throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
|
+ }
|
|
|
|
|
|
- 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);
|
|
|
|
|
|
+ CameraDetail cameraDetail = cameraDetailService.getByCameraId(camera.getId());
|
|
|
|
+ if (cameraDetail == null) {
|
|
|
|
+ log.error("该相机详情不存在:" + cameraName);
|
|
|
|
+ throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
|
+ }
|
|
|
|
|
|
- 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.downloadFile(ConstantFilePath.OSS_PREFIX + prefix + jsonObject.getString("icon"), filePath);
|
|
|
|
- icon = fYunFileConfig.getHost() + imgViewPath + jsonObject.getString("icon");
|
|
|
|
- fYunFileService.uploadFile(filePath + jsonObject.getString("icon"), imgViewPath + jsonObject.getString("icon"));
|
|
|
|
- }
|
|
|
|
|
|
+ //查看场景中的文件目录是否有改文件id,有则重新计算改场景,无则新建场景
|
|
|
|
+ ScenePlus scenePlus = scenePlusService.getByFileId("/" + fileId + "/");
|
|
|
|
+ int rebuild = 1;
|
|
|
|
+ if (ObjectUtils.isEmpty(scenePlus)) {
|
|
|
|
+ sceneNum = scene3dNumService.generateSceneNum(cameraDetail.getType());
|
|
|
|
+ rebuild = 0;
|
|
|
|
+ } else if (scenePlus.getSceneStatus().equals(SceneStatus.wait.code())) {
|
|
|
|
+ log.info(scenePlus.getNum() + ":场景处于计算中,不能再计算");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
|
|
- JSONObject firmwareVersion = new JSONObject();
|
|
|
|
- if(jsonObject.containsKey("camSoftwareVersion") && StrUtil.isNotEmpty(jsonObject.getString("camSoftwareVersion"))){
|
|
|
|
- firmwareVersion.put("camSoftwareVersion", jsonObject.getString("camSoftwareVersion"));
|
|
|
|
- }
|
|
|
|
|
|
+ if (sceneNum == null) {
|
|
|
|
+ log.error("大场景序号为空:" + sceneNum);
|
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
|
+ }
|
|
|
|
|
|
- if(jsonObject.containsKey("version") && StrUtil.isNotEmpty(jsonObject.getString("version"))){
|
|
|
|
- firmwareVersion.put("version", jsonObject.getString("version"));
|
|
|
|
- }
|
|
|
|
|
|
+ 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);
|
|
|
|
+
|
|
|
|
+ String userName = null;
|
|
|
|
+ if (!ObjectUtils.isEmpty(cameraDetail.getUserId())) {
|
|
|
|
+ SSOUser user = userService.getSSOUserByUserId(cameraDetail.getUserId());
|
|
|
|
+ userName = ObjectUtils.isEmpty(user) ? null : user.getUserName();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ String icon = null;
|
|
|
|
+ if (!ObjectUtils.isEmpty(jsonObject.getString("icon"))) {
|
|
|
|
+ fYunFileService.copyFileInBucket(ConstantFilePath.OSS_PREFIX + prefix + jsonObject.getString("icon"),imgViewPath + jsonObject.getString("icon"));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ JSONObject firmwareVersion = new JSONObject();
|
|
|
|
+ if (!ObjectUtils.isEmpty(jsonObject.getString("camSoftwareVersion"))) {
|
|
|
|
+ firmwareVersion.put("camSoftwareVersion", jsonObject.getString("camSoftwareVersion"));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!ObjectUtils.isEmpty(jsonObject.getString("version"))) {
|
|
|
|
+ firmwareVersion.put("version", jsonObject.getString("version"));
|
|
|
|
+ }
|
|
|
|
|
|
- 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;
|
|
|
|
|
|
+ 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);
|
|
|
|
+ } else {
|
|
|
|
+ //上传log-main.png
|
|
|
|
+ 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");
|
|
|
|
+ }
|
|
|
|
+ ScenePlusVO scenePlusVO = null;
|
|
|
|
+ Object[] objects = null;
|
|
|
|
+ BuildSceneCallMessage mqMessage = null;
|
|
|
|
+
|
|
|
|
+ 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",
|
|
|
|
+ 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) objects[0];
|
|
|
|
+ mqMessage = (BuildSceneCallMessage) objects[1];
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if (Objects.nonNull(scenePlusVO)) {
|
|
|
|
+ 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");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //删除oss的houst_floor.json(国际版可能会卡住)
|
|
|
|
+ fYunFileService.deleteFile(dataViewPath + "houst_floor.json");
|
|
|
|
+
|
|
|
|
+ if (cameraDetail.getCompanyId() != null) {
|
|
|
|
+ Company company = companyService.getById(cameraDetail.getCompanyId());
|
|
|
|
+ if (company != null) {
|
|
|
|
+
|
|
|
|
+ log.info("复制企业logo");
|
|
|
|
+ SceneEditInfo sceneEditInfo = sceneEditInfoService.getByScenePlusId(scenePlusVO.getId());
|
|
|
|
+ SceneEditInfoExt sceneEditInfoExt = sceneEditInfoExtService.getByEditInfoId(sceneEditInfo.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("/")));
|
|
}
|
|
}
|
|
- }
|
|
|
|
- //重算的场景,先移除该场景对应的容量
|
|
|
|
- if(rebuild == 1){
|
|
|
|
- scenePlusService.resetSpace(sceneNum);
|
|
|
|
- }else {
|
|
|
|
- //上传log-main.png
|
|
|
|
- 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");
|
|
|
|
- }
|
|
|
|
- ScenePlusVO scenePlusVO = null;
|
|
|
|
- Object[] objects = null;
|
|
|
|
- BuildSceneCallMessage mqMessage = null;
|
|
|
|
-
|
|
|
|
- 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",
|
|
|
|
- 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)objects[0];
|
|
|
|
- mqMessage = (BuildSceneCallMessage)objects[1];
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- if(Objects.nonNull(scenePlusVO)){
|
|
|
|
- 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");
|
|
|
|
|
|
+
|
|
|
|
+ FileUtils.copyFile(ConstantFilePath.BASE_PATH + File.separator + company.getTopLogo(),
|
|
|
|
+ localImagesPath + "logo-main.png", true);
|
|
|
|
+ fYunFileService.uploadFile(localImagesPath + "logo-main.png", imgViewPath + "logo-main.png");
|
|
}
|
|
}
|
|
|
|
|
|
- //删除oss的houst_floor.json(国际版可能会卡住)
|
|
|
|
- fYunFileService.deleteFile(dataViewPath + "houst_floor.json");
|
|
|
|
-
|
|
|
|
- if(cameraDetail.getCompanyId() != null){
|
|
|
|
- Company company = companyService.getById(cameraDetail.getCompanyId());
|
|
|
|
- if(company != null){
|
|
|
|
-
|
|
|
|
- log.info("复制企业logo");
|
|
|
|
- SceneEditInfo sceneEditInfo = sceneEditInfoService.getByScenePlusId(scenePlusVO.getId());
|
|
|
|
- SceneEditInfoExt sceneEditInfoExt = sceneEditInfoExtService.getByEditInfoId(sceneEditInfo.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");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- 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");
|
|
|
|
-
|
|
|
|
- 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);
|
|
|
|
|
|
+ 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");
|
|
|
|
+
|
|
|
|
+ sceneEditInfo.setFloorLogo("user");
|
|
}
|
|
}
|
|
- rabbitMqProducer.sendByWorkQueue(queueModelingPre, mqMessage);
|
|
|
|
|
|
|
|
|
|
+ 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);
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
- log.info("data.fdage文件不存在");
|
|
|
|
- throw new BusinessException(CameraConstant.FAILURE_6009);
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
+ rabbitMqProducer.sendByWorkQueue(queueModelingPre, mqMessage);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -530,7 +486,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
filePath.mkdirs();
|
|
filePath.mkdirs();
|
|
}
|
|
}
|
|
fYunFileService.downloadFile(ConstantFilePath.OSS_PREFIX + prefixBuffer.toString() + "data.fdage",filePathBuffer.toString() + "data.fdage");
|
|
fYunFileService.downloadFile(ConstantFilePath.OSS_PREFIX + prefixBuffer.toString() + "data.fdage",filePathBuffer.toString() + "data.fdage");
|
|
- buildScene(filePathBuffer.toString(), fileId, true, prefixBuffer.toString());
|
|
|
|
|
|
+ buildScene(filePathBuffer.toString(), fileId, prefixBuffer.toString());
|
|
return ResultData.ok();
|
|
return ResultData.ok();
|
|
}
|
|
}
|
|
|
|
|