浏览代码

添加rpc调用

houweiyu 4 年之前
父节点
当前提交
669ebecebd

+ 23 - 0
src/main/java/fcb/project/manager/core/controller/AuditController.java

@@ -8,6 +8,7 @@ import fcb.project.manager.base.enums.HouseStatus;
 import fcb.project.manager.base.service.impl.TmAuditServiceImpl;
 import fcb.project.manager.base.service.impl.TmHouseServiceImpl;
 import fcb.project.manager.base.utils.DataUtils;
+import fcb.project.manager.core.feignInterfaces.SceneFeign;
 import fdage.back.sdk.base.entity.Result;
 import fdage.back.sdk.base.enums.ResultCodeEnum;
 import fdage.back.sdk.base.exception.CommonBaseException;
@@ -48,6 +49,9 @@ public class AuditController {
     @Autowired
     private RedisTemplate redisTemplate;
 
+    @Autowired
+    private SceneFeign sceneFeign;
+
     @GetMapping("/queryOrSearchList")
     @ApiOperation(value = "根据条件拉取所有审批记录")
     @ApiImplicitParams({
@@ -158,10 +162,29 @@ public class AuditController {
         if(null != tmAudit.getVrOnline() && tmAudit.getVrOnline().equals(online)){
             return Result.failure("已经处理过了,无需重复处理");
         }
+        if(StringUtils.isBlank(tmAudit.getVrId())){
+          return Result.failure("审核记录中的房源已经不存在在");
+        }
+        TmHouse tmHouse = tmHouseService.getById(tmAudit.getId());
+        if(null == tmHouse){
+            return Result.failure("房源不存在在");
+        }
         tmAudit.setVrOnline(online);
         int update = tmAuditService.updateAudit(tmAudit);
         if(update == 1){
             //TODO:去调四维看看/720,告知四维看看更新场景
+            if(StringUtils.isNotBlank(tmHouse.getSceneNum())){
+                Map<String , Object> map = new HashMap<>();
+                map.put("sceneNum" , tmHouse.getSceneNum());
+                if(online.compareTo(1) == 0){
+                    //上线
+                    map.put("status" , 1);
+                }else{
+                    //下线
+                    map.put("status" , 2);
+                }
+//                sceneFeign.updateSceneStatus(map);
+            }
 
             return Result.success();
         }else{

+ 3 - 0
src/main/java/fcb/project/manager/core/controller/HouseManagerController.java

@@ -10,6 +10,7 @@ import fcb.project.manager.base.service.impl.TmAuditServiceImpl;
 import fcb.project.manager.base.service.impl.TmEstateServiceImpl;
 import fcb.project.manager.base.service.impl.TmHouseServiceImpl;
 import fcb.project.manager.base.utils.DataUtils;
+import fcb.project.manager.core.feignInterfaces.SceneFeign;
 import fdage.back.sdk.base.entity.Result;
 import fdage.back.sdk.base.enums.ResultCodeEnum;
 import fdage.back.sdk.base.exception.CommonBaseException;
@@ -75,6 +76,8 @@ public class HouseManagerController {
     @Autowired
     private RedisTemplate redisTemplate;
 
+
+
     @GetMapping("/queryOrSearchList")
     @ApiOperation(value = "根据条件拉取所有楼盘")
     @ApiImplicitParams({

+ 19 - 0
src/main/java/fcb/project/manager/core/feignInterfaces/SceneFeign.java

@@ -0,0 +1,19 @@
+package fcb.project.manager.core.feignInterfaces;
+
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import java.util.Map;
+
+/**
+ * 2 * @Author: Abner
+ * 3 * @Date: 2021/1/20 21:21
+ * 4
+ */
+@FeignClient("4dkankan-scene")
+public interface SceneFeign {
+
+    @PostMapping("/api/scene/updateStatus")
+    public Object updateSceneStatus(@RequestBody Map<String , Object> param);
+}

+ 3 - 0
src/main/resources/application-dev.properties

@@ -25,6 +25,9 @@ spring.redis.jedis.pool.max-active=8
 spring.redis.jedis.pool.max-idle=8
 spring.redis.jedis.pool.max-wait=-1
 spring.redis.jedis.pool.min-idle=0
+spring.redis.database=0
+spring.redis.password=
+
 
 4dkankan.host.url=https://test.4dkankan.com/vrHouse.html?m=
 

+ 3 - 1
src/main/resources/application-prod.properties

@@ -2,7 +2,7 @@
 server.port=8285
 
 #注册中心
-spring.cloud.nacos.discovery.server-addr=10.71.5.163:8848
+spring.cloud.nacos.discovery.server-addr=10.71.5.163:80
 
 spring.datasource.url=jdbc:mysql://10.71.184.146:3306/vr4_nacos?serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
 spring.datasource.username=vr4_nacos_rw
@@ -22,6 +22,8 @@ spring.redis.jedis.pool.max-active=8
 spring.redis.jedis.pool.max-idle=8
 spring.redis.jedis.pool.max-wait=-1
 spring.redis.jedis.pool.min-idle=0
+spring.redis.database=0
+spring.redis.password=QBzhHTxfcYLTs0n5J5VQ
 
 
 4dkankan.host.url=https://4dkankan.com/vrHouse.html?m=

+ 2 - 0
src/main/resources/application-test.properties

@@ -13,6 +13,8 @@ spring.datasource.url=jdbc:mysql://127.0.0.1:3306/fcb-project-manager?serverTime
 spring.datasource.username=root
 spring.datasource.password=4DAGE168!a
 spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
+spring.redis.database=0
+spring.redis.password=
 
 
 swagger.page.title=房车宝管理后台楼盘管理相关接口

+ 2 - 2
src/main/resources/application.properties

@@ -1,8 +1,8 @@
 
 
 #spring.profiles.active=prod
-#spring.profiles.active=dev
-spring.profiles.active=test
+spring.profiles.active=dev
+#spring.profiles.active=test
 
 #应用名
 spring.application.name=fbc-project-manager