Browse Source

更新:
vr模型修改缩略图

wuweihao 4 years ago
parent
commit
44abc624e8

+ 3 - 0
cms_pano_fcb/gis_mapper/src/main/java/com/gis/mapper/SceneMapper.java

@@ -86,4 +86,7 @@ public interface SceneMapper extends IBaseMapper<SceneEntity, String> {
 
     @Select("select * from tb_scene where is_delete = 0 and house_id = #{houseId} and use_hots like #{sceneCode}")
     List<SceneEntity> searchUseHots(String houseId, String sceneCode);
+
+    @Update("UPDATE tb_scene SET icon = #{icon} where is_delete = 0 AND scene_code = #{sceneCode}")
+    void updateIcon(String sceneCode, String icon);
 }

+ 5 - 5
cms_pano_fcb/gis_service/src/main/java/com/gis/feign/HouseFeign.java

@@ -20,17 +20,17 @@ import org.springframework.web.bind.annotation.RequestParam;
 public interface HouseFeign {
 
     @PostMapping(value = "/fcb/project/house/addHouse", consumes = MediaType.APPLICATION_JSON_VALUE, produces = {MediaType.APPLICATION_JSON_UTF8_VALUE})
-    Result addHouse(@RequestBody HouseDto param);
+    Result addHouse(@RequestBody HouseDto param) throws Exception;
 
     @PostMapping(value = "/fcb/project/house/updateHouse", consumes = MediaType.APPLICATION_JSON_VALUE, produces = {MediaType.APPLICATION_JSON_UTF8_VALUE})
-    Result updateHouse(@RequestBody HouseDto param);
+    Result updateHouse(@RequestBody HouseDto param) throws Exception;
 
     @PostMapping(value = "/fcb/project/house/updateHouse", consumes = MediaType.APPLICATION_JSON_VALUE, produces = {MediaType.APPLICATION_JSON_UTF8_VALUE})
-    Result updateHouseSceneIndex(@RequestBody HouseSceneIndexDto param);
+    Result updateHouseSceneIndex(@RequestBody HouseSceneIndexDto param) throws Exception;
 
 
     @GetMapping(value = "/fcb/project/house/getHouseDetail")
-    Result findByHouseId(@RequestParam String houseId);
+    Result findByHouseId(@RequestParam String houseId) throws Exception;
 
     @PostMapping(value = "/fcb/project/operation/addNew", consumes = MediaType.APPLICATION_JSON_VALUE, produces = {MediaType.APPLICATION_JSON_UTF8_VALUE})
     Result addLog(@RequestBody LogInfoDto param);
@@ -42,6 +42,6 @@ public interface HouseFeign {
      * @return
      */
     @PostMapping(value = "/fcb/project/house/updateHouse", consumes = MediaType.APPLICATION_JSON_VALUE, produces = {MediaType.APPLICATION_JSON_UTF8_VALUE})
-    Result updateHouseJson(@RequestBody JSONObject param);
+    Result updateHouseJson(@RequestBody JSONObject param) throws Exception;
 
 }

+ 2 - 0
cms_pano_fcb/gis_service/src/main/java/com/gis/service/SceneService.java

@@ -70,4 +70,6 @@ public interface SceneService extends IBaseService<SceneEntity, String> {
     JSONObject searchUnion(ScenePageDto param);
 
     Result saveGardenVrModel(GardenVrModelDto param);
+
+    Result updateIcon(String sceneCode, String icon);
 }

+ 58 - 29
cms_pano_fcb/gis_service/src/main/java/com/gis/service/impl/SceneServiceImpl.java

@@ -209,6 +209,8 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
 
         } catch (IOException e) {
             e.printStackTrace();
+        } catch (Exception e) {
+            e.printStackTrace();
         }
 
         return Result.success(entity);
@@ -222,14 +224,19 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
      * @return
      */
     private Result getHouseStatus(String houseId){
-        Result result = houseFeign.findByHouseId(houseId);
+        Result result = null;
+        try {
+            result = houseFeign.findByHouseId(houseId);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
         String status = null;
         if (result.getCode() == 0) {
             Object data = result.getData();
             JSONObject jsonObject = JSON.parseObject(data.toString());
             status = jsonObject.getString("status");
             log.info("house status: " + status);
-
+            log.warn("可以正常编辑");
             if (status.equals("1")) {
                 log.warn("审核中不能编辑");
                 return Result.failure(7005, "审核中不能编辑");
@@ -399,6 +406,15 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
     }
 
     @Override
+    public Result updateIcon(String sceneCode, String icon) {
+        log.info("sceneCode: {}", sceneCode);
+        log.info("icon: {}", icon);
+        entityMapper.updateIcon(sceneCode, icon);
+        log.info("更新VR模型缩略图完成");
+        return Result.success();
+    }
+
+    @Override
     public Result saveUseHots(UseHotsDto param) {
         String id = param.getId();
         SceneEntity entity = this.findById(id);
@@ -466,12 +482,16 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
 
         log.info("update houseDto: " + houseDto.toString());
 
-        Result result  = houseFeign.updateHouse(houseDto);
-        if (result.getCode() == 0) {
-            log.info("更新房源信息完成");
-        } else {
-            log.error("更新房源信息异常");
-            return Result.failure(result.getMsg());
+        try {
+            Result result = houseFeign.updateHouse(houseDto);
+            if (result.getCode() == 0) {
+                log.info("更新房源信息完成");
+            } else {
+                log.error("更新房源信息异常");
+                return Result.failure(result.getMsg());
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
         }
 
         log.info("更新房源vr项目完成");
@@ -498,6 +518,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
         if (resStatus != null) {
             return resStatus;
         }
+        log.info("检查状态完成,可以编辑");
 
 
         // 设置初始场景
@@ -508,21 +529,21 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
 
 
 
-        // TODO: 2021/1/8 0008 更新伟玉房源表单接口
-        HouseSceneIndexDto houseSceneIndexDto = new HouseSceneIndexDto();
-        houseSceneIndexDto.setId(houseId);
-
-        // 初始场景
-        houseSceneIndexDto.setSceneNum(entity.getSceneCode());
-        houseSceneIndexDto.setUpdateTime(LocalDateTime.now());
-        houseSceneIndexDto.setFcbHouseId(entity.getHouseId());
-        Result result = houseFeign.updateHouseSceneIndex(houseSceneIndexDto);
-        if (result.getCode() == 0) {
-            log.info("更新房源updateHouse完成");
-        } else {
-            log.error("更新房源updateHouse异常");
-            return Result.failure(result.getMsg());
-        }
+        // TODO: 2021/1/9 0008 更新伟玉房源表单接口
+//        HouseSceneIndexDto houseSceneIndexDto = new HouseSceneIndexDto();
+//        houseSceneIndexDto.setId(houseId);
+//
+//        // 初始场景
+//        houseSceneIndexDto.setSceneNum(entity.getSceneCode());
+//        houseSceneIndexDto.setUpdateTime(LocalDateTime.now());
+//        houseSceneIndexDto.setFcbHouseId(entity.getHouseId());
+//        Result result = houseFeign.updateHouseSceneIndex(houseSceneIndexDto);
+//        if (result.getCode() == 0) {
+//            log.info("更新房源updateHouse完成");
+//        } else {
+//            log.error("更新房源updateHouse异常");
+//            return Result.failure(result.getMsg());
+//        }
 
         return Result.success();
     }
@@ -770,15 +791,23 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
                 indexDto.setId(entity.getHouseId());
                 indexDto.setSceneNum(entity.getSceneCode());
                 indexDto.setUpdateTime(LocalDateTime.now());
+                // 恒大id必须更新到管理后台 2021-03-08
                 indexDto.setFcbHouseId(entity.getHengdaId());
-                Result result = houseFeign.updateHouseSceneIndex(indexDto);
+                Result result = null;
+                try {
+                    result = houseFeign.updateHouseSceneIndex(indexDto);
 
-                if (result.getCode() == 0) {
-                    log.info("更新了初始场景到VR项目完成");
-                } else {
-                    log.error("更新了初始场景到VR项目异常");
-                    return Result.failure(result.getMsg());
+                    if (result.getCode() == 0) {
+                        log.info("更新了初始场景到VR项目完成");
+                    } else {
+                        log.error("更新了初始场景到VR项目异常");
+                        return Result.failure(result.getMsg());
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
                 }
+
+
             }
             entity.setId(RandomUtils.getUuid());
             entity.setType("house");

+ 52 - 0
cms_pano_fcb/gis_web/src/main/java/com/gis/web/controller/AgeController.java

@@ -0,0 +1,52 @@
+package com.gis.web.controller;
+
+
+import com.gis.common.util.Result;
+import com.gis.domain.entity.SceneEntity;
+import com.gis.service.HouseService;
+import com.gis.service.SceneService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.log4j.Log4j2;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+
+/**
+ * Created by owen on 2020/2/18 0018 12:17
+ * 提供给四维看看使用
+ */
+@Log4j2
+@Api(tags = "四维看看")
+@RestController
+@RequestMapping("fcb/pano/age")
+public class AgeController extends BaseController {
+
+    @Autowired
+    SceneService sceneService;
+
+    @ApiOperation(value = "更新VR模型缩略图", notes = "更新VR模型缩略图")
+    @GetMapping(value = "updateIcon")
+    public Result updateIcon(String sceneCode, String icon) {
+
+        return sceneService.updateIcon(sceneCode, icon);
+    }
+
+
+
+
+
+
+
+
+
+
+
+}

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

@@ -20,7 +20,6 @@ import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.validation.Valid;
-import java.time.LocalDateTime;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
@@ -192,7 +191,12 @@ public class SceneController extends BaseController {
     @GetMapping("house/detail/{houseId}")
     public Result houseDetail(@PathVariable String houseId) {
         log.info("房源详情");
-        Result result = houseFeign.findByHouseId(houseId);
+        Result result = null;
+        try {
+            result = houseFeign.findByHouseId(houseId);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
         int code = result.getCode();
         if (code == -1) {
             log.info("房源不存在: " + houseId);
@@ -351,26 +355,26 @@ public class SceneController extends BaseController {
         }
 
 
-        // todo 测试一下是否要更新初始场景到伟玉那边
+        // todo 2021-3-8 测试一下是否要更新初始场景到伟玉那边
         // 更新首页场景到VR项目
-        if (flag) {
-            HouseSceneIndexDto indexDto = new HouseSceneIndexDto();
-            indexDto.setId(IndexEntity.getHouseId());
-            indexDto.setSceneNum(IndexEntity.getSceneCode());
-            indexDto.setUpdateTime(LocalDateTime.now());
-            indexDto.setFcbHouseId(IndexEntity.getHengdaId());
-            Result result = houseFeign.updateHouseSceneIndex(indexDto);
-
-
-            if (result.getCode() == 0) {
-                log.info("更新了初始场景到VR项目完成");
-            } else {
-                log.error("更新了初始场景到VR项目异常");
-                return Result.failure(result.getMsg());
-            }
-            log.info("result: " + result);
-            log.info("更新了初始场景到VR项目");
-        }
+//        if (flag) {
+//            HouseSceneIndexDto indexDto = new HouseSceneIndexDto();
+//            indexDto.setId(IndexEntity.getHouseId());
+//            indexDto.setSceneNum(IndexEntity.getSceneCode());
+//            indexDto.setUpdateTime(LocalDateTime.now());
+//            indexDto.setFcbHouseId(IndexEntity.getHengdaId());
+//            Result result = houseFeign.updateHouseSceneIndex(indexDto);
+//
+//
+//            if (result.getCode() == 0) {
+//                log.info("更新了初始场景到VR项目完成");
+//            } else {
+//                log.error("更新了初始场景到VR项目异常");
+//                return Result.failure(result.getMsg());
+//            }
+//            log.info("result: " + result);
+//            log.info("更新了初始场景到VR项目");
+//        }
 
         return Result.success();
     }

+ 48 - 45
cms_pano_fcb/gis_web/src/main/java/com/gis/web/controller/TestController.java

@@ -141,7 +141,12 @@ public class TestController extends BaseController {
      * @return
      */
     private Result getHouseStatus(String houseId){
-        Result result = houseFeign.findByHouseId(houseId);
+        Result result = null;
+        try {
+            result = houseFeign.findByHouseId(houseId);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
 //        log.info("result: " + result);
         String status = null;
         if (result.getCode() == 0) {
@@ -277,12 +282,12 @@ public class TestController extends BaseController {
     }
 
 
-
-    @ApiOperation("房源更新场景码")
-    @PostMapping("updateHouseSceneIndex")
-    public Result updateHouseSceneIndex(@RequestBody HouseSceneIndexDto param) {
-        return houseFeign.updateHouseSceneIndex(param);
-    }
+//
+//    @ApiOperation("房源更新场景码")
+//    @PostMapping("updateHouseSceneIndex")
+//    public Result updateHouseSceneIndex(@RequestBody HouseSceneIndexDto param) {
+//        return houseFeign.updateHouseSceneIndex(param);
+//    }
 
 
     @ApiOperation("获取Result")
@@ -309,23 +314,23 @@ public class TestController extends BaseController {
      * @param houseId
      * @return
      */
-    @ApiOperation(value = "房源详情" , position = 3)
-    @GetMapping("house/detail/{houseId}")
-    public Result houseDetail(@PathVariable String houseId) {
-        Result re = houseFeign.findByHouseId(houseId);
-        if (re.getCode() == 0) {
-            log.info("正常");
-            Object data = re.getData();
-            log.info("data: " + data.toString());
-            JSONObject jsonObject = JSON.parseObject(data.toString());
-            String sceneNum = jsonObject.getString("sceneNum");
-            log.info("sceneNum: " + sceneNum);
-        } else {
-            log.info("异常");
-            Result.failure(re.getMsg());
-        }
-        return houseFeign.findByHouseId(houseId);
-    }
+//    @ApiOperation(value = "房源详情" , position = 3)
+//    @GetMapping("house/detail/{houseId}")
+//    public Result houseDetail(@PathVariable String houseId) {
+//        Result re = houseFeign.findByHouseId(houseId);
+//        if (re.getCode() == 0) {
+//            log.info("正常");
+//            Object data = re.getData();
+//            log.info("data: " + data.toString());
+//            JSONObject jsonObject = JSON.parseObject(data.toString());
+//            String sceneNum = jsonObject.getString("sceneNum");
+//            log.info("sceneNum: " + sceneNum);
+//        } else {
+//            log.info("异常");
+//            Result.failure(re.getMsg());
+//        }
+//        return houseFeign.findByHouseId(houseId);
+//    }
 
 
 
@@ -333,29 +338,27 @@ public class TestController extends BaseController {
     /**
      * 测试,传json是可以的
      * @param houseId
-     * @param sceneNum
-     * @param fcbHouseId
      * @return
      */
-    @ApiOperation(value = "Feign Json参数" , position = 3)
-    @GetMapping("houseUpdate/{houseId}/{sceneNum}/{fcbHouseId}")
-    public Result houseUpdate(@PathVariable String houseId, @PathVariable String sceneNum, @PathVariable String fcbHouseId) {
-        JSONObject jsonObject = new JSONObject();
-
-
-        jsonObject.put("id", houseId);
-        jsonObject.put("sceneNum", sceneNum);
-        jsonObject.put("fcbHouseId", fcbHouseId);
-
-        Result result = houseFeign.updateHouseJson(jsonObject);
-        if (result.getCode() == 0) {
-            return Result.success();
-        } else {
-            log.error("异常");
-            return Result.failure(result.getMsg());
-        }
-
-    }
+//    @ApiOperation(value = "Feign Json参数" , position = 3)
+//    @GetMapping("houseUpdate/{houseId}/{sceneNum}/{fcbHouseId}")
+//    public Result houseUpdate(@PathVariable String houseId, @PathVariable String sceneNum, @PathVariable String fcbHouseId) {
+//        JSONObject jsonObject = new JSONObject();
+//
+//
+//        jsonObject.put("id", houseId);
+//        jsonObject.put("sceneNum", sceneNum);
+//        jsonObject.put("fcbHouseId", fcbHouseId);
+//
+//        Result result = houseFeign.updateHouseJson(jsonObject);
+//        if (result.getCode() == 0) {
+//            return Result.success();
+//        } else {
+//            log.error("异常");
+//            return Result.failure(result.getMsg());
+//        }
+//
+//    }
 
 
     @ApiOperation(value = "解析page" , position = 3)

+ 13 - 1
cms_pano_fcb/remark.md

@@ -120,6 +120,10 @@ sit:
    潘莉蓝
    ex_123039440   4Dade_pll01
    
+   马瑞
+   ex_090239580
+   4Dade_mr01
+   
    
    /tmp/a/
    
@@ -176,4 +180,12 @@ sit:
 
 # pro 更新日志
     20210228-1722
-        正式上线
+        正式上线
+        
+    pro-20210305-1800 
+        更新热点场景引用删除问题, 需要更新数据库;
+        场景搜索添加room_name;   
+        全景图匹配素材标题,三维场景匹配户型名称
+        全景园林添加VR模型, 需要更新数据库
+        保存VR项目日志
+        更新VR模型修改缩略图,全景图拿到的是新的VR缩略图