Explorar el Código

更新:
新增户型,默认设置为初始场景

wuweihao hace 4 años
padre
commit
a6002c05a2

+ 1 - 1
cms_pano_consumer/src/main/resources/application-dev.properties

@@ -71,7 +71,7 @@ logging.level.com.gis=debug
 # 上传文件保存路径
 # 本地保存路径
 file.path=F:\\test\\ngin\\${project.name}_data\\
-server.domain=192
+#server.domain=192
 
 # 单位是分钟
 queue.timeout=3

+ 3 - 3
cms_pano_consumer/src/main/resources/application-fcbsit.properties

@@ -52,7 +52,7 @@ spring.rabbitmq.template.mandatory=true
 
 
 # oss info
-oss.point=http://fcb-vrkanfang-uat.oss-cn-shenzhen-internal.aliyuncs.com
+oss.point=http://oss-cn-shenzhen-internal.aliyuncs.com
 oss.key=LTAI4FyDDFpGGjTJZEQH4yaK
 oss.secrey=mqVRTWbWcn4sNMoWmnRq6eToWr9BIy
 oss.bucket=fcb-vrkanfang-uat
@@ -63,7 +63,7 @@ oss.domain=https://vr-oss-sit.fcb.com.cn/
 
 #log
 #logging.path=/home/data/${project.name}_log
-logging.file.path=/home/data/${project.name}_log
+logging.file.path=/home/tomcat/${project.name}_log
 logging.config=classpath:logback-spring.xml
 logging.level.com.gis=debug
 
@@ -71,7 +71,7 @@ logging.level.com.gis=debug
 # 上传文件保存路径
 # 本地保存路径
 file.path=/mnt/cms_pano_fcb_data/
-server.domain=192
+#server.domain=192
 
 # 单位是分钟
 queue.timeout=3

+ 1 - 1
cms_pano_consumer/src/main/resources/application-sit.properties

@@ -75,7 +75,7 @@ logging.level.com.gis=debug
 # 上传文件保存路径
 # 本地保存路径
 file.path=/mnt/cms_pano_fcb_data/
-server.domain=192
+server.doma/in=192
 
 # 单位是分钟
 queue.timeout=3

+ 1 - 3
cms_pano_consumer/src/main/resources/application-uat.properties

@@ -33,8 +33,6 @@ spring.datasource.druid.stat-view-servlet.enabled=true
 
 
 #rabbit MQ
-#spring.rabbitmq.address=10.71.5.163:5672,10.71.5.164:5672
-#spring.rabbitmq.address=10.71.5.163:5379,10.71.5.164:5379
 spring.rabbitmq.address=10.71.5.163:5379,10.71.5.164:5379
 spring.rabbitmq.username=admin
 spring.rabbitmq.password=fcb@admin_4dage
@@ -71,7 +69,7 @@ logging.level.com.gis=debug
 # 上传文件保存路径
 # 本地保存路径
 file.path=/mnt/cms_pano_fcb_data/
-server.domain=192
+#server.domain=192
 
 # 单位是分钟
 queue.timeout=3

+ 1 - 1
cms_pano_fcb/gis_application/src/main/resources/application-fcbsit.properties

@@ -62,7 +62,7 @@ spring.rabbitmq.template.mandatory=true
 spring.servlet.multipart.location=/mnt
 
 # oss info
-oss.point=http://fcb-vrkanfang-uat.oss-cn-shenzhen-internal.aliyuncs.com
+oss.point=http://oss-cn-shenzhen-internal.aliyuncs.com
 oss.key=LTAI4FyDDFpGGjTJZEQH4yaK
 oss.secrey=mqVRTWbWcn4sNMoWmnRq6eToWr9BIy
 oss.bucket=fcb-vrkanfang-uat

+ 52 - 18
cms_pano_fcb/gis_service/src/main/java/com/gis/service/impl/HouseServiceImpl.java

@@ -57,9 +57,13 @@ public class HouseServiceImpl implements HouseService {
 
         // 检查VR项目状态
         String houseId = param.getHouseId();
-        Result resStatus =  canEdit(houseId);
-        if (resStatus != null) {
-            return resStatus;
+//        Result resStatus =  canEdit(houseId);
+//        if (resStatus != null) {
+//            return resStatus;
+//        }
+        if (!canEdit(houseId)) {
+            log.error("VR项目不可编辑");
+            return Result.failure(7005, "VR项目不可编辑");
         }
 
         // TODO: 2021/1/8 0008 更新伟玉房源表单接口
@@ -163,30 +167,60 @@ public class HouseServiceImpl implements HouseService {
      * @param houseId
      * @return
      */
-    private Result canEdit(String houseId){
+//    private Result canEdit(String houseId){
+////        Result result = null;
+////        try {
+////            result = houseFeign.canEdit(houseId);
+////            log.info("房车宝返回数据:{}", result);
+////        } catch (Exception e) {
+////            e.printStackTrace();
+////            log.error("调用房车宝接口失败");
+////            throw new BaseRuntimeException("调用房车宝接口失败");
+////        }
+////        if (result.getCode() == 0) {
+////            boolean data = (boolean) result.getData();
+////            if (data) {
+////                log.info("vr项目可编辑");
+////                return Result.success();
+////            } else {
+////                log.info("vr项目不可编辑");
+////                return Result.failure(7005, "VR项目不可编辑");
+////            }
+////
+////        } else {
+////            log.error("VR项目接口查询失败:" + result.getMsg() );
+////            return Result.failure(7007, "VR项目接口查询失败");
+////        }
+////
+////    }
+
+    private boolean canEdit(String houseId){
         Result result = null;
         try {
-            result = houseFeign.findByHouseId(houseId);
+            result = houseFeign.canEdit(houseId);
             log.info("房车宝返回数据:{}", result);
+            if (result.getCode() == 0) {
+                boolean data = (boolean) result.getData();
+                if (data) {
+                    log.info("vr项目可编辑");
+                    return true;
+                } else {
+                    log.info("vr项目不可编辑");
+//                    throw new BaseRuntimeException(7005, "VR项目不可编辑");
+                    return false;
+                }
+
+            } else {
+                log.error("VR项目接口查询失败:" + result.getMsg() );
+                throw new BaseRuntimeException(7007, "VR项目接口查询失败");
+//                return Result.failure(7007, "VR项目接口查询失败");
+            }
         } catch (Exception e) {
             e.printStackTrace();
             log.error("调用房车宝接口失败");
             throw new BaseRuntimeException("调用房车宝接口失败");
         }
-        if (result.getCode() == 0) {
-            boolean data = (boolean) result.getData();
-            if (data) {
-                log.info("vr项目可编辑");
-                return Result.success();
-            } else {
-                log.info("vr项目不可编辑");
-                return Result.failure(7005, "VR项目不可编辑");
-            }
 
-        } else {
-            log.error("VR项目接口查询失败:" + result.getMsg() );
-            return Result.failure(7007, "VR项目接口查询失败");
-        }
 
     }
 

+ 32 - 71
cms_pano_fcb/gis_service/src/main/java/com/gis/service/impl/SceneServiceImpl.java

@@ -106,9 +106,10 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
             return Result.failure("houseId不能为空");
         }
 
-        Result resStatus =  canEdit(houseId);
-        if (resStatus != null) {
-            return resStatus;
+//        Result resStatus =  canEdit(houseId);
+        if (!canEdit(houseId)) {
+            log.error("VR项目不可编辑");
+            return Result.failure(7005, "VR项目不可编辑");
         }
 
         // 判断图片类型
@@ -163,7 +164,6 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
 
             // 压缩图片并上传oss
             // 全景图缩略图统一命名规则: http:// oss/cms_pano_fcb/image/thumb_sceneCode.jpg
-
             String iconPath = convertAndUploadOss(
                     panoPath, configConstant.filePath, configConstant.ossBasePath, configConstant.ossDomain, 600, 300, "image/thumb_"+sceneCode+".jpg");
             log.info("iconPath:" + iconPath);
@@ -248,24 +248,26 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
      * @param houseId
      * @return
      */
-    private Result canEdit(String houseId){
+    private boolean canEdit(String houseId){
         Result result = null;
         try {
-            result = houseFeign.findByHouseId(houseId);
+            result = houseFeign.canEdit(houseId);
             log.info("房车宝返回数据:{}", result);
             if (result.getCode() == 0) {
                 boolean data = (boolean) result.getData();
                 if (data) {
                     log.info("vr项目可编辑");
-                    return Result.success();
+                    return true;
                 } else {
                     log.info("vr项目不可编辑");
-                    return Result.failure(7005, "VR项目不可编辑");
+//                    throw new BaseRuntimeException(7005, "VR项目不可编辑");
+                    return false;
                 }
 
             } else {
                 log.error("VR项目接口查询失败:" + result.getMsg() );
-                return Result.failure(7007, "VR项目接口查询失败");
+                throw new BaseRuntimeException(7007, "VR项目接口查询失败");
+//                return Result.failure(7007, "VR项目接口查询失败");
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -401,11 +403,14 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
 
         // 检查VR项目状态
         String houseId = param.getHouseId();
-        Result resStatus =  canEdit(houseId);
-        if (resStatus != null) {
-            return resStatus;
+//        Result resStatus =  canEdit(houseId);
+//        if (resStatus != null) {
+//            return resStatus;
+//        }
+        if (!canEdit(houseId)) {
+            log.error("VR项目不可编辑");
+            return Result.failure(7005, "VR项目不可编辑");
         }
-
         SceneEntity entity = null;
 
         if ( id == null) {
@@ -525,9 +530,9 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
             if (n == 1) {
                 SceneEntity entity = this.findById(id);
                 String houseId = entity.getHouseId();
-                Result resStatus =  canEdit(houseId);
-                if (resStatus != null) {
-                    return resStatus;
+                if (!canEdit(houseId)) {
+                    log.error("VR项目不可编辑");
+                    return Result.failure(7005, "VR项目不可编辑");
                 }
             }
 
@@ -673,11 +678,11 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
         // 检查VR项目状态
         String houseId = param.getHouseId();
         String roomId = param.getRoomId();
-        Result resStatus =  canEdit(houseId);
-        if (resStatus != null) {
-            return resStatus;
-        }
 
+        if (!canEdit(houseId)) {
+            log.error("VR项目不可编辑");
+            return Result.failure(7005, "VR项目不可编辑");
+        }
 
         SceneEntity entity = null;
         @NotBlank(message = "场景码不能为空") String sceneCode = param.getSceneCode();
@@ -709,8 +714,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
             this.save(entity);
 
             // 该VR项目下如果没有设置任何初始场景,把户型设置为默认初始场景
-//            checkSceneInit(houseId, sceneCode);
-            checkSceneInit(houseId, id);
+            checkSceneInit(houseId, entity.getId());
 
             log.info("保存VR模型完成");
         } else {
@@ -733,26 +737,11 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
             SceneInitEntity entity = new SceneInitEntity();
             entity.setId(RandomUtils.getUuid("init"));
             entity.setHouseId(houseId);
-//            entity.setSceneCode(sceneCode);
             entity.setSceneId(id);
             sceneInitService.save(entity);
         }
     }
 
-    // 该VR项目下如果没有设置任何初始场景,把户型设置为默认初始场景
-//    private void checkSceneInit(String houseId, String sceneCode){
-//        List<SceneInitEntity> list = sceneInitService.findByHouseId(houseId);
-//        if (list.size() == 0){
-//            SceneInitEntity entity = new SceneInitEntity();
-//            entity.setId(RandomUtils.getUuid("init"));
-//            entity.setHouseId(houseId);
-//            entity.setSceneCode(sceneCode);
-//            sceneInitService.save(entity);
-//        }
-//    }
-
-
-
 
 
     @Override
@@ -769,9 +758,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
 
     @Override
     public Result editXml(XmlDataDto param) {
-//        long start = System.currentTimeMillis();
         String id = param.getId();
-//        SceneEntity entity = findById(id);
         SceneEntity entity = entityMapper.findByIdForUpdate(id);
         if (entity == null) {
             log.error("对象不存在,id : " + id);
@@ -781,37 +768,12 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
 
         // 检查VR项目状态
         String houseId = entity.getHouseId();
-        Result resStatus =  canEdit(houseId);
-        if (resStatus != null) {
-            return resStatus;
+        if (!canEdit(houseId)) {
+            log.error("VR项目不可编辑");
+            return Result.failure(7005, "VR项目不可编辑");
         }
 
 
-        // 注意网络下载会有缓存,必须加时间戳
-        // http://ossxiaoan.4dage.com/cms_pano_fcb/p19/fcb_px2rJW96F/vtour/tour.xml
-//        String tourOssUrl = entity.getOssPath() + "/vtour/tour.xml?m=" + System.currentTimeMillis();
-//        log.info("网络下载文件地址: {}", tourOssUrl);
-//        String fileName = "tour2.xml";
-//        String filePath = entity.getPath();
-//        String localBasePath = StringUtils.substringBeforeLast(filePath, "/");
-//        FileUtils.downLoadFromUrl(tourOssUrl, fileName, localBasePath);
-//        log.info("网络下载成功: {}", localBasePath+ "/tour2.xml");
-
-        // 编辑xml, 修改初始角度
-//        String inPath = localBasePath + "/tour2.xml";
-//        String outPath = localBasePath + "/tour.xml";
-//        String hlookat = param.getHlookat();
-//        String vlookat = param.getVlookat();
-//        streamEditFile(inPath, outPath, hlookat, vlookat);
-//        log.info("编辑xml, 修改初始角度完毕");
-//
-//        String tourOssSavePath = configConstant.ossBasePath + entity.getHouseId() + "/" + entity.getSceneCode() + "/vtour/tour.xml";
-//        log.info("osspath: " + tourOssSavePath);
-//        aliyunOssUtil.upload(outPath, tourOssSavePath);
-////        asyncTask.uploadOss(outPath, tourOssSavePath);
-//        long end = System.currentTimeMillis();
-//        log.info("tour.xml 上传oss完成, 共耗时: " + (end-start)/1000 + " s");
-
         // 保存初始视觉
         JSONObject jsonObject = new JSONObject();
         jsonObject.put("hlookat", param.getHlookat());
@@ -847,11 +809,10 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
 
         // 检查VR项目状态
         String houseId = entity.getHouseId();
-        Result resStatus =  canEdit(houseId);
-        if (resStatus != null) {
-            return resStatus;
+        if (!canEdit(houseId)) {
+            log.error("VR项目不可编辑");
+            return Result.failure(7005, "VR项目不可编辑");
         }
-
         if (entity == null) {
             log.error("场景不存在, id: " + id);
             return Result.failure("场景不存在");

+ 1 - 1
cms_pano_fcb/gis_web/src/main/java/com/gis/web/controller/SceneController.java

@@ -258,7 +258,7 @@ public class SceneController extends BaseController {
      * @param param
      * @return
      */
-    @WebControllerLog(description = "VR模模型-VR模型保存")
+    @WebControllerLog(description = "VR模模型-VR模型户型保存")
     @ApiOperation("VR模型保存")
     @PostMapping("saveVrModel")
     public Result saveVrModel(@Valid @RequestBody VrModelDto param) {

+ 1 - 1
cms_pano_fcb/remark.md

@@ -178,7 +178,7 @@ sit:
    
    select id, house_id, scene_code, is_delete,status,create_time,update_time from tb_scene where  scene_code in ('HD0IlKnd7m','HD571wG73e') ;
    
-   select id, house_id, scene_code, is_delete,status,create_time,update_time from tb_scene where house_id in ('HUS000011386576648927113216') ;
+   select id, house_id, scene_code, is_delete,status,create_time,update_time from tb_scene where house_id in ('HUS000011397406059872989184') ;
    
    select id, house_id, scene_code, is_delete,status,create_time,update_time,web_site from tb_scene where house_id in ('HUS000011386576648927113216');