From 2d538eff0cfe0eadff3cb9d9c1db9e45f6109ab1 Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期五, 03 一月 2020 17:25:56 +0800
Subject: [PATCH] 帮助中心版本区分

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserAccountController.java |   43 +++++++++++++++++++++++++++++--------------
 1 files changed, 29 insertions(+), 14 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserAccountController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserAccountController.java
index 4d571c5..863e8aa 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserAccountController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserAccountController.java
@@ -47,6 +47,8 @@
 import com.yeshi.fanli.service.inter.push.DeviceActiveService;
 import com.yeshi.fanli.service.inter.push.DeviceTokenHWService;
 import com.yeshi.fanli.service.inter.push.DeviceTokenOPPOService;
+import com.yeshi.fanli.service.inter.push.DeviceTokenVIVOService;
+import com.yeshi.fanli.service.inter.push.DeviceTokenXMService;
 import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
 import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
 import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
@@ -63,10 +65,10 @@
 import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
 import com.yeshi.fanli.util.Constant;
 import com.yeshi.fanli.util.GsonUtil;
+import com.yeshi.fanli.util.RedisKeyEnum;
 import com.yeshi.fanli.util.RedisManager;
 import com.yeshi.fanli.util.StringUtil;
 import com.yeshi.fanli.util.ThreadUtil;
-import com.yeshi.fanli.util.VersionUtil;
 import com.yeshi.fanli.util.account.UserUtil;
 import com.yeshi.fanli.util.wx.WXLoginUtil;
 
@@ -129,6 +131,12 @@
 
 	@Resource
 	private DeviceTokenOPPOService deviceTokenOPPOService;
+
+	@Resource
+	private DeviceTokenXMService deviceTokenXMService;
+
+	@Resource
+	private DeviceTokenVIVOService deviceTokenVIVOService;
 
 	@Resource
 	private TaoBaoUnionConfigService taoBaoUnionConfigService;
@@ -262,6 +270,13 @@
 							platformType = 2;
 						}
 						userSystemCouponService.copyLotteryPrize(uuser.getId(), platformType, acceptData.getDevice());
+						// 缁戝畾oppo,vivo鎺ㄩ��
+						DeviceActive active = deviceActiveService.getFirstActiveInfo(acceptData.getDevice());
+						if (active != null) {
+							deviceTokenOPPOService.bindUid(uuser.getId(), active.getId());
+							deviceTokenVIVOService.bindUid(uuser.getId(), active.getId());
+							deviceTokenXMService.bindUid(active.getId(), uuser.getId());
+						}
 					} catch (Exception e) {
 						e.printStackTrace();
 					}
@@ -782,8 +797,7 @@
 			return;
 		}
 
-		String key = "bindalipay-" + uid;
-
+		String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.bindAlipay, uid + "");
 		if (!StringUtil.isNullOrEmpty(redisManager.getCommonString(key))) {
 			out.print(JsonUtil.loadFalseResult(2, "鏈嶅姟鍣ㄧ箒蹇欙紝璇风◢鍚庨噸璇�"));
 			return;
@@ -838,8 +852,7 @@
 			return;
 		}
 
-		String key = "bindalipay-" + uid;
-
+		String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.bindAlipay, uid + "");
 		if (!StringUtil.isNullOrEmpty(redisManager.getCommonString(key))) {
 			out.print(JsonUtil.loadFalseResult(1001, "鏈嶅姟鍣ㄧ箒蹇欙紝璇风◢鍚庨噸璇�"));
 			return;
@@ -929,8 +942,7 @@
 			return;
 		}
 
-		String key = "bindalipay-" + uid;
-
+		String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.bindAlipay, uid + "");
 		if (!StringUtil.isNullOrEmpty(redisManager.getCommonString(key))) {
 			out.print(JsonUtil.loadFalseResult(1001, "鏈嶅姟鍣ㄧ箒蹇欙紝璇风◢鍚庨噸璇�"));
 			return;
@@ -1144,6 +1156,10 @@
 			if (deviceActive != null) {
 				// 瑙g粦OPPO鎺ㄩ�佺殑鐢ㄦ埛缁戝畾
 				deviceTokenOPPOService.unBindUid(uid, deviceActive.getId());
+				// 瑙g粦VIVO鎺ㄩ�佺殑鐢ㄦ埛缁戝畾
+				deviceTokenVIVOService.unBindUid(uid, deviceActive.getId());
+				// 瑙g粦XM鎺ㄩ�佺殑鐢ㄦ埛缁戝畾
+				deviceTokenXMService.unBindUid(deviceActive.getId());
 			}
 		}
 		out.print(JsonUtil.loadTrueResult(""));
@@ -1216,13 +1232,12 @@
 							e.printStackTrace();
 						}
 
-						if (VersionUtil.greaterThan_1_5_60(acceptData.getPlatform(), acceptData.getVersion())) {
-							/* 鏂颁汉绾㈠寘 */
-							try {
-								userTaoLiJinOriginService.synchDeviceHongbao(uuser.getId(), device);
-							} catch (Exception e) {
-								e.printStackTrace();
-							}
+						// 缁戝畾oppo鎺ㄩ��
+						DeviceActive active = deviceActiveService.getFirstActiveInfo(acceptData.getDevice());
+						if (active != null) {
+							deviceTokenOPPOService.bindUid(uuser.getId(), active.getId());
+							deviceTokenVIVOService.bindUid(uuser.getId(), active.getId());
+							deviceTokenXMService.bindUid(active.getId(), uuser.getId());
 						}
 					}
 				});

--
Gitblit v1.8.0