From 81da61b828e29b7745e1382dfbbaeb685dc083ef Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 23 一月 2024 17:17:55 +0800
Subject: [PATCH] 抖音转链修改

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/push/VIVOPushServiceImpl.java |   39 ++++++++++++++++++++++++++-------------
 1 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/push/VIVOPushServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/push/VIVOPushServiceImpl.java
index a9e2e26..88da675 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/push/VIVOPushServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/push/VIVOPushServiceImpl.java
@@ -6,6 +6,8 @@
 
 import com.yeshi.fanli.dto.push.PushBaseContent;
 import com.yeshi.fanli.entity.SystemEnum;
+import com.yeshi.fanli.entity.config.SystemConfigKeyEnum;
+import com.yeshi.fanli.service.inter.config.SystemConfigService;
 import com.yeshi.fanli.util.Constant;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
@@ -36,7 +38,10 @@
 	@Resource
 	private UserCustomSettingsService userCustomSettingsService;
 
-	private List<Integer> getVersionCodeList(List<Integer> versionCodeList, SystemEnum system) {
+	@Resource
+	private SystemConfigService systemConfigService;
+
+	private List<Integer> getVersionCodeList(List<Integer> versionCodeList,SystemEnum system) {
 		List<Integer> versionList = new ArrayList<>();
 		if (versionCodeList == null) {// 鍏ㄦ帹
 			List<AppVersionInfo> appInfoList = appVersionService.listByPlatformAndMinVersionCode("android", 51,system);
@@ -57,7 +62,7 @@
 
 	@Async("pushExecutor")
 	@Override
-	public void pushGoods(Long uid, Long auctionId, PushBaseContent content)
+	public void pushGoods(Long uid, String auctionId, PushBaseContent content)
 			throws PushException {
 		push(PushTypeEnum.goodsdetail, uid,  null, null, auctionId, content);
 	}
@@ -142,7 +147,9 @@
 	 * @param webUrl
 	 */
 	private void push(PushTypeEnum type, Long uid, String url, String webUrl,
-			Long goodsId, PushBaseContent content) throws PushException {
+			String goodsId, PushBaseContent content) throws PushException {
+
+		String androidBaseActivity=getAndroidBaseActivity(content.getSystem());
 		int hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
 		List<Integer> newVersionList = getVersionCodeList(content.getVersionCodeList(),content.getSystem());
 		// 2.0.1鍚庡紑濮嬫帹閫�
@@ -167,25 +174,25 @@
 					if (type == PushTypeEnum.goodsdetail) {// 鍟嗗搧璇︽儏
 						if (goodsId == null)
 							throw new PushException(2, "鍙傛暟涓嶅畬鏁�");
-						VIVOPushUtil.pushGoods(tokenList, content.getTitle(),content.getContent(), 1, goodsId);
+						VIVOPushUtil.pushGoods(tokenList, content.getTitle(),content.getContent(), 1, goodsId,androidBaseActivity);
 					} else if (type == PushTypeEnum.url) {// 閾炬帴
 						if (StringUtil.isNullOrEmpty(webUrl))
 							throw new PushException(2, "鍙傛暟涓嶅畬鏁�");
-						VIVOPushUtil.pushUrl(tokenList,  content.getTitle(),content.getContent(),  webUrl);
+						VIVOPushUtil.pushUrl(tokenList,  content.getTitle(),content.getContent(),  webUrl,androidBaseActivity);
 					} else if (type == PushTypeEnum.ZNX) {// 绔欏唴淇�
 						VIVOPushUtil.pushZNX(tokenList,  content.getTitle(),content.getContent());
 					} else if (type == PushTypeEnum.weex) {// weex
 						if (StringUtil.isNullOrEmpty(url))
 							throw new PushException(2, "鍙傛暟涓嶅畬鏁�");
-						VIVOPushUtil.pushWEEX(tokenList,  content.getTitle(),content.getContent(),  url);
+						VIVOPushUtil.pushWEEX(tokenList,  content.getTitle(),content.getContent(),  url,androidBaseActivity);
 					} else if (type == PushTypeEnum.baichuan) {// 鐧惧窛閾炬帴
 						if (StringUtil.isNullOrEmpty(webUrl))
 							throw new PushException(2, "鍙傛暟涓嶅畬鏁�");
 						VIVOPushUtil.pushBaiChuanUrl(tokenList,  content.getTitle(),content.getContent(),  webUrl);
 					} else if (type == PushTypeEnum.welfare) {// 绂忓埄涓績
-						VIVOPushUtil.pushWelfareCenter(tokenList,  content.getTitle(),content.getContent());
+						VIVOPushUtil.pushWelfareCenter(tokenList,  content.getTitle(),content.getContent(),androidBaseActivity);
 					} else if (type == PushTypeEnum.signin) {// 绛惧埌
-						VIVOPushUtil.pushUserSignInNotification(tokenList,  content.getTitle(),content.getContent());
+						VIVOPushUtil.pushUserSignInNotification(tokenList,  content.getTitle(),content.getContent(),androidBaseActivity);
 					}
 				} catch (Exception e) {
 					PushLogHelper.hwError(e);
@@ -208,25 +215,25 @@
 				if (type == PushTypeEnum.goodsdetail) {// 鍟嗗搧璇︽儏
 					if (goodsId == null)
 						throw new PushException(2, "鍙傛暟涓嶅畬鏁�");
-					VIVOPushUtil.pushGoods(tokenList, content.getTitle(), content.getContent(), 1, goodsId);
+					VIVOPushUtil.pushGoods(tokenList, content.getTitle(), content.getContent(), 1, goodsId,androidBaseActivity);
 				} else if (type == PushTypeEnum.url) {// 閾炬帴
 					if (StringUtil.isNullOrEmpty(webUrl))
 						throw new PushException(2, "鍙傛暟涓嶅畬鏁�");
-					VIVOPushUtil.pushUrl(tokenList, content.getTitle(), content.getContent(), webUrl);
+					VIVOPushUtil.pushUrl(tokenList, content.getTitle(), content.getContent(), webUrl,androidBaseActivity);
 				} else if (type == PushTypeEnum.ZNX) {// 绔欏唴淇�
 					VIVOPushUtil.pushZNX(tokenList, content.getTitle(), content.getContent());
 				} else if (type == PushTypeEnum.weex) {// weex
 					if (StringUtil.isNullOrEmpty(url))
 						throw new PushException(2, "鍙傛暟涓嶅畬鏁�");
-					VIVOPushUtil.pushWEEX(tokenList, content.getTitle(), content.getContent(), url);
+					VIVOPushUtil.pushWEEX(tokenList, content.getTitle(), content.getContent(), url,androidBaseActivity);
 				} else if (type == PushTypeEnum.baichuan) {// 鐧惧窛閾炬帴
 					if (StringUtil.isNullOrEmpty(webUrl))
 						throw new PushException(2, "鍙傛暟涓嶅畬鏁�");
 					VIVOPushUtil.pushBaiChuanUrl(tokenList, content.getTitle(), content.getContent(), webUrl);
 				} else if (type == PushTypeEnum.welfare) {// 绂忓埄涓績
-					VIVOPushUtil.pushWelfareCenter(tokenList, content.getTitle(), content.getContent());
+					VIVOPushUtil.pushWelfareCenter(tokenList, content.getTitle(), content.getContent(),androidBaseActivity);
 				} else if (type == PushTypeEnum.signin) {// 绛惧埌
-					VIVOPushUtil.pushUserSignInNotification(tokenList,content.getTitle(), content.getContent());
+					VIVOPushUtil.pushUserSignInNotification(tokenList,content.getTitle(), content.getContent(),androidBaseActivity);
 				}
 			} catch (Exception e) {
 				PushLogHelper.vivoError(e);
@@ -234,4 +241,10 @@
 
 		}
 	}
+
+	private String getAndroidBaseActivity(SystemEnum system) {
+
+		return systemConfigService.getValueCache(SystemConfigKeyEnum.androidBaseActivityName, system);
+
+	}
 }

--
Gitblit v1.8.0