dengsixing il y a 2 mois
Parent
commit
f74a82429b

+ 133 - 133
src/main/java/com/fdkankan/contro/service/impl/SceneFileBuildServiceImpl.java

@@ -494,76 +494,76 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
         return buildScenePost(dataSource, jsonObject, buildType, cameraType, sceneNum, camera, cameraDetail, rebuild,icon, user);
     }
 
-    private ScenePlusVO buildScenePost(String dataSource, JSONObject jsonObject, String buildType, long cameraType,
-                                       String sceneNum, Camera camera, CameraDetail cameraDetail, int rebuild,String icon, User user) throws Exception {
-        String imgViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, sceneNum);
-
-        String userName = null;
-        if (!ObjectUtils.isEmpty(cameraDetail.getUserId())) {
-//            SSOUser user = userService.getSSOUserByUserId(cameraDetail.getUserId());
-            userName = ObjectUtils.isEmpty(user) ? null : user.getUserName();
-        }
-
-        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 = "/" + sceneProNewUrl;
-
-        //重算的场景,先移除该场景对应的容量
-        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");
-        }
-        String algorithm = jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location")) ? "sfm" : "slam";
-        String unicode = jsonObject.getString("creator") + "_" + jsonObject.getString("uuidtime");
-
-        ScenePlusVO scenePlusVO = this.createScenePlus(sceneNum, camera.getId(), camera.getChildName(), jsonObject.getString("creator"),
-                jsonObject.getString("pwd"), unicode,cameraType,jsonObject.getJSONObject("cam").getIntValue("type"), dataSource, icon,  user.getId(), userName,algorithm,jsonObject.getInteger("location"),
-                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());
-
-        ScenePlus scenePlus = scenePlusService.getScenePlusByNum(sceneNum);
-        ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
-        boolean isObj = jsonObject.containsKey("exportMeshObj") && jsonObject.getIntValue("exportMeshObj") == 1;
-        scenePlusExt.setIsObj(isObj ? CommonStatus.YES.code() : CommonStatus.NO.code());
-        scenePlusExtService.updateById(scenePlusExt);
-
-        //上传app状态文件
-        commonService.uploadStatusJson(sceneNum, scenePlusVO.getSceneStatus(),
-                scenePlusVO.getWebSite(),scenePlusVO.getThumb(),PayStatus.NOT_PAY.code(),
-                String.format(UploadFilePath.DATA_VIEW_PATH, sceneNum));
-
-        BuildSceneCallMessage mqMessage = getBuildSceneMqMessage(sceneNum, cameraType, algorithm, jsonObject, buildType,
-                scenePlusVO.getDataSource());
-        mqMessage.getExt().put("uuid", unicode);
-
-        if (cameraDetail.getCompanyId() != null) {
-            Company company = companyService.getById(cameraDetail.getCompanyId());
-            if (company != null && !ObjectUtils.isEmpty(company.getCalculateFlexibility()) && !company.getCalculateFlexibility()) {
-                mqMessage.setFlexibility(-1);
-            }
-        }
-        mqMessage.getExt().put("deleteExtras", true);
-        if(jsonObject.getIntValue("location") == 7){
-            //发送到全景看看进行初始化
-            intermitSceneService.sendMq(scenePlusVO.getNum(), jsonObject, CommonSuccessStatus.WAITING.code());
-            rabbitMqProducer.sendByWorkQueue(queueIntermitModelingPre, mqMessage);
-        }else{
-            rabbitMqProducer.sendByWorkQueue(queueModelingPre, mqMessage);
-        }
-
-        return scenePlusVO;
-    }
+//    private ScenePlusVO buildScenePost(String dataSource, JSONObject jsonObject, String buildType, long cameraType,
+//                                       String sceneNum, Camera camera, CameraDetail cameraDetail, int rebuild,String icon, User user) throws Exception {
+//        String imgViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, sceneNum);
+//
+//        String userName = null;
+//        if (!ObjectUtils.isEmpty(cameraDetail.getUserId())) {
+////            SSOUser user = userService.getSSOUserByUserId(cameraDetail.getUserId());
+//            userName = ObjectUtils.isEmpty(user) ? null : user.getUserName();
+//        }
+//
+//        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 = "/" + sceneProNewUrl;
+//
+//        //重算的场景,先移除该场景对应的容量
+//        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");
+//        }
+//        String algorithm = jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location")) ? "sfm" : "slam";
+//        String unicode = jsonObject.getString("creator") + "_" + jsonObject.getString("uuidtime");
+//
+//        ScenePlusVO scenePlusVO = this.createScenePlus(sceneNum, camera.getId(), camera.getChildName(), jsonObject.getString("creator"),
+//                jsonObject.getString("pwd"), unicode,cameraType,jsonObject.getJSONObject("cam").getIntValue("type"), dataSource, icon,  user.getId(), userName,algorithm,jsonObject.getInteger("location"),
+//                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());
+//
+//        ScenePlus scenePlus = scenePlusService.getScenePlusByNum(sceneNum);
+//        ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
+//        boolean isObj = jsonObject.containsKey("exportMeshObj") && jsonObject.getIntValue("exportMeshObj") == 1;
+//        scenePlusExt.setIsObj(isObj ? CommonStatus.YES.code() : CommonStatus.NO.code());
+//        scenePlusExtService.updateById(scenePlusExt);
+//
+//        //上传app状态文件
+//        commonService.uploadStatusJson(sceneNum, scenePlusVO.getSceneStatus(),
+//                scenePlusVO.getWebSite(),scenePlusVO.getThumb(),PayStatus.NOT_PAY.code(),
+//                String.format(UploadFilePath.DATA_VIEW_PATH, sceneNum));
+//
+//        BuildSceneCallMessage mqMessage = getBuildSceneMqMessage(sceneNum, cameraType, algorithm, jsonObject, buildType,
+//                scenePlusVO.getDataSource());
+//        mqMessage.getExt().put("uuid", unicode);
+//
+//        if (cameraDetail.getCompanyId() != null) {
+//            Company company = companyService.getById(cameraDetail.getCompanyId());
+//            if (company != null && !ObjectUtils.isEmpty(company.getCalculateFlexibility()) && !company.getCalculateFlexibility()) {
+//                mqMessage.setFlexibility(-1);
+//            }
+//        }
+//        mqMessage.getExt().put("deleteExtras", true);
+//        if(jsonObject.getIntValue("location") == 7){
+//            //发送到全景看看进行初始化
+//            intermitSceneService.sendMq(scenePlusVO.getNum(), jsonObject, CommonSuccessStatus.WAITING.code());
+//            rabbitMqProducer.sendByWorkQueue(queueIntermitModelingPre, mqMessage);
+//        }else{
+//            rabbitMqProducer.sendByWorkQueue(queueModelingPre, mqMessage);
+//        }
+//
+//        return scenePlusVO;
+//    }
 
     public ScenePlusVO buildV3Scene(ScenePro scenePro,String fileId, String prefix,JSONObject jsonObject,String buildType,long cameraType) throws Exception{
 
@@ -1661,70 +1661,70 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
         return ResultData.ok(result);
     }
 
-//    private ScenePlusVO buildScenePost(String dataSource, JSONObject jsonObject, String buildType, long cameraType,
-//                                       String sceneNum, Camera camera, CameraDetail cameraDetail, int rebuild,String icon,User user) throws Exception {
-//        String imgViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, sceneNum);
-//
-//        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 = "/" + sceneProNewUrl;
-//
-//        //重算的场景,先移除该场景对应的容量
-//        if (rebuild == 1) {
-////            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");
-//            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";
-//        String unicode = jsonObject.getString("creator") + "_" + jsonObject.getString("uuidtime");
-//
-//        ScenePlusVO scenePlusVO = this.createScenePlus(sceneNum, camera.getId(), camera.getChildName(), jsonObject.getString("creator"),
-//                jsonObject.getString("pwd"), unicode, cameraType,jsonObject.getJSONObject("cam").getIntValue("type"), dataSource, icon, user.getId() , null, algorithm, jsonObject.getInteger("location"),
-//                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());
-//
-//        ScenePlus scenePlus = scenePlusService.getScenePlusByNum(sceneNum);
-//        scenePlus.setTaskId(jsonObject.getString("taskId"));
-//        scenePlus.setKNo(jsonObject.getString("kNo"));
-//        scenePlusService.updateById(scenePlus);
-//        ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
-//        boolean isObj = jsonObject.containsKey("exportMeshObj") && jsonObject.getIntValue("exportMeshObj") == 1;
-//        scenePlusExt.setIsObj(isObj ? CommonStatus.YES.code() : CommonStatus.NO.code());
-//        scenePlusExtService.updateById(scenePlusExt);
-//
-//        BuildSceneCallMessage mqMessage = getBuildSceneMqMessage(sceneNum, cameraType, algorithm, jsonObject, buildType, scenePlusVO.getDataSource());
-//
-//        if (cameraDetail.getCompanyId() != null) {
-//            Company company = companyService.getById(cameraDetail.getCompanyId());
-//            if (company != null && !ObjectUtils.isEmpty(company.getCalculateFlexibility()) && !company.getCalculateFlexibility()) {
-//                mqMessage.setFlexibility(-1);
+    private ScenePlusVO buildScenePost(String dataSource, JSONObject jsonObject, String buildType, long cameraType,
+                                       String sceneNum, Camera camera, CameraDetail cameraDetail, int rebuild,String icon,User user) throws Exception {
+        String imgViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, sceneNum);
+
+        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 = "/" + sceneProNewUrl;
+
+        //重算的场景,先移除该场景对应的容量
+        if (rebuild == 1) {
+//            try {
+//                scenePlusService.resetSpace(sceneNum);
+//            }catch (Exception e){
+//                log.error("重置容量失败", e);
 //            }
-//        }
-//
-//        mqMessage.getExt().put("deleteExtras", true);
-//        mqMessage.getExt().put("gps", jsonObject.getString("gps"));
-//        mqMessage.getExt().put("threeCamType", scenePlusVO.getThreeCamType());
-//
-//        rabbitMqProducer.sendByWorkQueue(queueModelingPre, mqMessage);
-//
-//        return scenePlusVO;
-//    }
+//            //删除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");
+            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";
+        String unicode = jsonObject.getString("creator") + "_" + jsonObject.getString("uuidtime");
+
+        ScenePlusVO scenePlusVO = this.createScenePlus(sceneNum, camera.getId(), camera.getChildName(), jsonObject.getString("creator"),
+                jsonObject.getString("pwd"), unicode, cameraType,jsonObject.getJSONObject("cam").getIntValue("type"), dataSource, icon, user.getId() , null, algorithm, jsonObject.getInteger("location"),
+                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());
+
+        ScenePlus scenePlus = scenePlusService.getScenePlusByNum(sceneNum);
+        scenePlus.setTaskId(jsonObject.getString("taskId"));
+        scenePlus.setKNo(jsonObject.getString("kNo"));
+        scenePlusService.updateById(scenePlus);
+        ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
+        boolean isObj = jsonObject.containsKey("exportMeshObj") && jsonObject.getIntValue("exportMeshObj") == 1;
+        scenePlusExt.setIsObj(isObj ? CommonStatus.YES.code() : CommonStatus.NO.code());
+        scenePlusExtService.updateById(scenePlusExt);
+
+        BuildSceneCallMessage mqMessage = getBuildSceneMqMessage(sceneNum, cameraType, algorithm, jsonObject, buildType, scenePlusVO.getDataSource());
+
+        if (cameraDetail.getCompanyId() != null) {
+            Company company = companyService.getById(cameraDetail.getCompanyId());
+            if (company != null && !ObjectUtils.isEmpty(company.getCalculateFlexibility()) && !company.getCalculateFlexibility()) {
+                mqMessage.setFlexibility(-1);
+            }
+        }
+
+        mqMessage.getExt().put("deleteExtras", true);
+        mqMessage.getExt().put("gps", jsonObject.getString("gps"));
+        mqMessage.getExt().put("threeCamType", scenePlusVO.getThreeCamType());
+
+        rabbitMqProducer.sendByWorkQueue(queueModelingPre, mqMessage);
+
+        return scenePlusVO;
+    }
 
 
     private void buildV3Scene2(String dataSource,JSONObject jsonObject,long cameraType,String sceneNum,Camera cameraEntity,CameraDetail detailEntity,String icon) throws Exception {