Procházet zdrojové kódy

二手房信息更新到房车宝

wuweihao před 3 roky
rodič
revize
d3c2413a95

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

@@ -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/tomcat/${project.name}_log
+logging.file.path=/mnt/logs/${project.name}_log
 logging.config=classpath:logback-spring.xml
 logging.level.com.gis=debug
 

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

@@ -78,7 +78,7 @@ swagger.version=1.0
 
 
 #log
-logging.file.path=/home/tomcat/logs/${project.name}_log
+logging.file.path=/mnt/logs/${project.name}_log
 logging.config=classpath:logback-spring.xml
 logging.level.com.gis=debug
 

+ 2 - 1
cms_pano_fcb/gis_common/src/main/java/com/gis/common/util/FileUtils.java

@@ -287,11 +287,12 @@ public class FileUtils {
 
     /**
      * 场景码
+     * 房车宝那边是通过fcb前缀判断是全景还是四维看看场景。 所以我们这边必须是fcb开头
      * @return
      */
     public static String getCode(){
         String sceneCode = RandomUtils.randowString(9);
-        return  "SH_" +sceneCode;
+        return  "fcb_SH" +sceneCode;
     }
 
 

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

@@ -5,13 +5,11 @@ import com.gis.common.util.Result;
 import com.gis.domain.dto.HouseDto;
 import com.gis.domain.dto.HouseSceneIndexDto;
 import com.gis.domain.dto.LogInfoDto;
+import io.swagger.annotations.ApiOperation;
 import org.hibernate.annotations.Parameter;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.http.MediaType;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * Created by owen on 2021/1/13 0013 14:15
@@ -56,4 +54,17 @@ public interface HouseFeign {
      */
     @PostMapping(value = "fcb/project/api/query/authCode", consumes = MediaType.APPLICATION_JSON_VALUE, produces = {MediaType.APPLICATION_JSON_UTF8_VALUE})
     Result authCode(@RequestBody JSONObject param) throws Exception;
+
+
+    /**
+     * 2021-09-17 更新二手房信息到房车宝
+     * 通过管理后台转发
+     * @param name 101_saveGardenVr  接口编号
+     * @param param
+     * @return
+     * @throws Exception
+     */
+    @PostMapping(value = "/fcb/project/redirct/{name}", consumes = MediaType.APPLICATION_JSON_VALUE, produces = {MediaType.APPLICATION_JSON_UTF8_VALUE})
+    Object updateSecondHandInfo(@PathVariable String name, @RequestBody JSONObject param) throws Exception;
+
 }

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

@@ -55,4 +55,6 @@ public interface SecondHandService extends IBaseService<SecondHandEntity, String
     Result houseCanEdit(String houseId);
 
     Result findByHouseId(String houseId, Integer status);
+
+    Result testUpdateInfo(String sceneCode);
 }

+ 54 - 1
cms_pano_fcb/gis_service/src/main/java/com/gis/service/impl/SecondHandServiceImpl.java

@@ -89,7 +89,7 @@ public class SecondHandServiceImpl extends IBaseServiceImpl<SecondHandEntity, St
     /**
      *
      * @param file
-     * @param houseId 房源id
+     * @param houseId 房源id(小区id)
      * @return
      */
     @Override
@@ -194,6 +194,9 @@ public class SecondHandServiceImpl extends IBaseServiceImpl<SecondHandEntity, St
             rabbitTemplate.convertAndSend(RabbitConfig.SECOND_HAND_EXCHANGE, RabbitConfig.SECOND_HAND_QUEUE_ROUTING, entity.getId());
             log.info("二手房全景图入队成功: 场景码:{},场景id:{} ", sceneCode, entity.getId());
 
+            // 二手房信息更新到房车宝
+            updateSecondHandInfoToFcb(entity);
+
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -203,6 +206,51 @@ public class SecondHandServiceImpl extends IBaseServiceImpl<SecondHandEntity, St
 
 
     @Override
+    public Result testUpdateInfo(String sceneCode) {
+        SecondHandEntity entity = entityMapper.findBySceneCode(sceneCode);
+        JSONObject jsonObject = updateSecondHandInfoToFcb(entity);
+        return Result.success(jsonObject);
+    }
+
+
+
+
+    private JSONObject updateSecondHandInfoToFcb( SecondHandEntity param){
+        JSONObject info = new JSONObject();
+        info.put("vrGardenId", param.getHouseId());
+        info.put("vrUrl", param.getWebSite());
+        info.put("vrCover", param.getIcon());
+        // 管理后台需要
+        info.put("updatorId", "");
+        info.put("updatorName", "");
+        // 房车宝aipNum
+        String apiNum = "101_saveGardenVr";
+        try {
+            log.info("请求aipNum:{}", apiNum);
+            log.info("请求参数:{}", info);
+            Object result = houseFeign.updateSecondHandInfo(apiNum, info);
+            JSONObject res = JSONObject.parseObject(result.toString());
+            log.info("管理后台响应值: {}", res);
+            // resultType:1 ,代表调用成功
+            Integer resultType = res.getInteger("resultType");
+            if (resultType == 1) {
+                log.info("二手房信息转发成功:场景码:{}, 小区id: {}",param.getSceneCode(), param.getHouseId() );
+            } else {
+                log.error("二手房信息转发失败:场景码:{}, 小区id: {}",param.getSceneCode(), param.getHouseId());
+            }
+
+            return res;
+
+        } catch (Exception e) {
+            log.error("二手房信息转发失败:场景码:{}, 小区id: {}",param.getSceneCode(), param.getHouseId());
+            e.printStackTrace();
+        }
+
+        return null;
+    }
+
+
+    @Override
     public JSONObject jsonSearch(SecondHandPageDto param) {
         startPage(param);
         List<SecondHandEntity> search = entityMapper.search(param);
@@ -299,6 +347,9 @@ public class SecondHandServiceImpl extends IBaseServiceImpl<SecondHandEntity, St
         entity.setIcon(icon);
         entity.setUpdateTime(new Date());
         this.update(entity);
+
+        //
+
         log.info("更新初始画面成功");
         return Result.success();
     }
@@ -569,6 +620,8 @@ public class SecondHandServiceImpl extends IBaseServiceImpl<SecondHandEntity, St
     }
 
 
+
+
     /**
      * 检查是否有计算中的场景
      *

+ 13 - 0
cms_pano_fcb/gis_web/src/main/java/com/gis/web/controller/SecondHandController.java

@@ -205,4 +205,17 @@ public class SecondHandController {
         return secondHandService.houseCanEdit(houseId);
     }
 
+
+    /**
+     * 更新二手房信息到管理后台(后台转变房车宝)
+     * @param houseId
+     * @return
+     */
+    @WebControllerLog(description = "二手房管理-更新二手房信息到房车宝")
+    @ApiOperation(value = "house-更新二手房信息到房车宝")
+    @GetMapping(value = "house/testUpdateInfo/{sceneCode}")
+    public Result testUpdateInfo(@PathVariable String sceneCode) {
+
+        return secondHandService.testUpdateInfo(sceneCode);
+    }
 }