yumeng пре 1 година
родитељ
комит
3fcd4a9e1f

+ 6 - 1
ruixuan-admin/pom.xml

@@ -170,6 +170,11 @@
                 <activatedProperties>rocket</activatedProperties>
             </properties>
         </profile>
-
+        <profile>
+            <id>yufu</id>
+            <properties>
+                <activatedProperties>yufu</activatedProperties>
+            </properties>
+        </profile>
     </profiles>
 </project>

+ 1 - 1
ruixuan-admin/src/main/resources/application-dev.yml

@@ -229,7 +229,7 @@ accept:
   rocketPrivateKey: xKFElGEYMjCwEl49uS7+cQ==
   dfcPrivateKey: 3LZwHFNXlMJ1mtaeQbTajQ==
   mgsPrivateKey2: XFbcIZTeGgDZ/A8kuLhWTw==
-  yufuPrivateKey2: sFZaU+J4d/jzC3p0zVCRuA==
+  yufuPrivateKey: sFZaU+J4d/jzC3p0zVCRuA==
 
 ownership:
   id: ruixuan

+ 1 - 1
ruixuan-admin/src/main/resources/application-mgs.yml

@@ -215,7 +215,7 @@ accept:
   rocketPrivateKey: xKFElGEYMjCwEl49uS7+cQ==
   dfcPrivateKey: 3LZwHFNXlMJ1mtaeQbTajQ==
   mgsPrivateKey2: XFbcIZTeGgDZ/A8kuLhWTw==
-  yufuPrivateKey2: sFZaU+J4d/jzC3p0zVCRuA==
+  yufuPrivateKey: sFZaU+J4d/jzC3p0zVCRuA==
 
 ownership:
   id: miaogousi

+ 1 - 1
ruixuan-admin/src/main/resources/application-prod.yml

@@ -215,7 +215,7 @@ accept:
   rocketPrivateKey: xKFElGEYMjCwEl49uS7+cQ==
   dfcPrivateKey: 3LZwHFNXlMJ1mtaeQbTajQ==
   mgsPrivateKey2: XFbcIZTeGgDZ/A8kuLhWTw==
-  yufuPrivateKey2: sFZaU+J4d/jzC3p0zVCRuA==
+  yufuPrivateKey: sFZaU+J4d/jzC3p0zVCRuA==
 
 ownership:
   id: ruixuan

+ 1 - 1
ruixuan-admin/src/main/resources/application-rocket.yml

@@ -215,7 +215,7 @@ accept:
   rocketPrivateKey: xKFElGEYMjCwEl49uS7+cQ==
   dfcPrivateKey: 3LZwHFNXlMJ1mtaeQbTajQ==
   mgsPrivateKey2: XFbcIZTeGgDZ/A8kuLhWTw==
-  yufuPrivateKey2: sFZaU+J4d/jzC3p0zVCRuA==
+  yufuPrivateKey: sFZaU+J4d/jzC3p0zVCRuA==
 
 ownership:
   id: rocket

+ 1 - 1
ruixuan-admin/src/main/resources/application-yufu.yml

@@ -215,7 +215,7 @@ accept:
   rocketPrivateKey: xKFElGEYMjCwEl49uS7+cQ==
   dfcPrivateKey: 3LZwHFNXlMJ1mtaeQbTajQ==
   mgsPrivateKey2: XFbcIZTeGgDZ/A8kuLhWTw==
-  yufuPrivateKey2: sFZaU+J4d/jzC3p0zVCRuA==
+  yufuPrivateKey: sFZaU+J4d/jzC3p0zVCRuA==
 
 ownership:
   id: yufu

+ 37 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/controller/SupplyChainController.java

@@ -61,6 +61,8 @@ public class SupplyChainController extends BaseController {
     private String dfcPrivateKey;
     @Value("${accept.mgsPrivateKey2}")
     private String mgsPrivateKey2;
+    @Value("${accept.yufuPrivateKey}")
+    private String yufuPrivateKey;
 
 
     @Value("${ownership.id}")
@@ -2269,6 +2271,41 @@ public class SupplyChainController extends BaseController {
     }
 
 
+    @PostMapping(value = "/yufuAccept")
+    public Map<String, Object> yufuAccept(@RequestBody String eventsEncoded) {
+        try {
+            logger.info("RX食品-二团严选消息订阅");
+            String events = PlatformEventSecurityUtil.decode(eventsEncoded, yufuPrivateKey);
+            JSONObject eventJSon = JSONObject.parseObject(events);
+            logger.info("二团回掉返回信息:{}", eventJSon);
+            fxNowService.submit(new Runnable() {
+                @Override
+                public void run() {
+                    try {
+                        if (!Check.isNull(eventJSon)) {
+                            String event = eventJSon.getString("event");
+                            if ("kwaishop_distribute_order_change_notify".equals(event)) {
+                                supplyChainService.updateOrder(eventJSon);
+                            } else if ("kwaishop_distribute_activity_item_change".equals(event)) {
+                                supplyChainService.updateItem(eventJSon);
+                            }
+                        }
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+            });
+        } catch (KsMerchantApiException e) {
+            e.printStackTrace();
+        }
+        //返回成功
+        Map<String, Object> result = new HashMap<>();
+        result.put("result", 1);
+        return result;
+
+    }
+
+
     @GetMapping("/addListKuaishouActivityInfo")
     @ApiOperation(value = "团长查询招商活动列表")
     public void addListKuaishouActivityInfo() {

+ 2 - 2
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/SupplyChainServiceImpl.java

@@ -630,8 +630,8 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
         }
 
         Thread.sleep(600000);
-        List<KuaishouAccessToken> youziTokens = accessTokenService.getYufuTokenInfos();
-        for (KuaishouAccessToken accessToken : rocketTokens) {
+        List<KuaishouAccessToken> yufuTokens = accessTokenService.getYufuTokenInfos();
+        for (KuaishouAccessToken accessToken : yufuTokens) {
             getYufuInfo(accessToken, beginTime, endTime, url, pcursor, 1);
         }