From 4cab8b09cdf6429f85163965c02c3deb3c4917fc Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期五, 20 九月 2019 19:18:19 +0800
Subject: [PATCH] 华为设备绑定bug修改
---
fanli/src/main/java/com/yeshi/fanli/service/impl/push/HWPushServiceImpl.java | 40 +++++++++++++++++++++++-----------------
1 files changed, 23 insertions(+), 17 deletions(-)
diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/push/HWPushServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/push/HWPushServiceImpl.java
index 596840d..cd5d6ae 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/push/HWPushServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/push/HWPushServiceImpl.java
@@ -16,7 +16,7 @@
import com.yeshi.fanli.entity.bus.user.UserCustomSettings;
import com.yeshi.fanli.entity.bus.user.UserCustomSettings.UserSettingTypeEnum;
import com.yeshi.fanli.entity.push.DeviceTokenHW;
-import com.yeshi.fanli.exception.PushException;
+import com.yeshi.fanli.exception.push.PushException;
import com.yeshi.fanli.log.PushLogHelper;
import com.yeshi.fanli.service.inter.config.AppVersionService;
import com.yeshi.fanli.service.inter.push.DeviceTokenHWService;
@@ -142,10 +142,16 @@
* @param webUrl
* @param versionCodeList
*/
- private void push(PushTypeEnum type, Long uid, String title, String content, String url, String webUrl, Long goodsId,
- List<Integer> versionCodeList) throws PushException {
+ private void push(PushTypeEnum type, Long uid, String title, String content, String url, String webUrl,
+ Long goodsId, List<Integer> versionCodeList) throws PushException {
int hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
List<Integer> newVersionList = getVersionCodeList(versionCodeList);
+ // 1.6.5鍚庡紑濮嬫帹閫�
+ for (int i = 0; i < newVersionList.size(); i++) {
+ if (newVersionList.get(i) < 47)
+ newVersionList.remove(i--);
+ }
+
if (uid == null || uid == 0) {
long deviceCount = deviceTokenHWService.countDeviceToken(newVersionList);
int page = (int) (deviceCount % 100 == 0 ? deviceCount / 100 : deviceCount / 100 + 1);
@@ -157,27 +163,27 @@
for (DeviceTokenHW token : hwDeviceList)
tokenList.add(token.getDeviceToken());
try {
- if (type==PushTypeEnum.goodsdetail) {// 鍟嗗搧璇︽儏
+ if (type == PushTypeEnum.goodsdetail) {// 鍟嗗搧璇︽儏
if (goodsId == null)
throw new PushException(2, "鍙傛暟涓嶅畬鏁�");
HWPushUtil.pushGoods(tokenList, title, content, 1, goodsId);
- } else if (type==PushTypeEnum.url) {// 閾炬帴
+ } else if (type == PushTypeEnum.url) {// 閾炬帴
if (StringUtil.isNullOrEmpty(webUrl))
throw new PushException(2, "鍙傛暟涓嶅畬鏁�");
HWPushUtil.pushUrl(tokenList, title, content, webUrl);
- } else if (type==PushTypeEnum.ZNX) {// 绔欏唴淇�
+ } else if (type == PushTypeEnum.ZNX) {// 绔欏唴淇�
HWPushUtil.pushZNX(tokenList, title, content);
- } else if (type==PushTypeEnum.weex) {// weex
+ } else if (type == PushTypeEnum.weex) {// weex
if (StringUtil.isNullOrEmpty(url))
throw new PushException(2, "鍙傛暟涓嶅畬鏁�");
HWPushUtil.pushWEEX(tokenList, title, content, url);
- } else if (type==PushTypeEnum.baichuan) {// 鐧惧窛閾炬帴
+ } else if (type == PushTypeEnum.baichuan) {// 鐧惧窛閾炬帴
if (StringUtil.isNullOrEmpty(webUrl))
throw new PushException(2, "鍙傛暟涓嶅畬鏁�");
HWPushUtil.pushBaiChuanUrl(tokenList, title, content, webUrl);
- } else if (type==PushTypeEnum.welfare) {// 绂忓埄涓績
+ } else if (type == PushTypeEnum.welfare) {// 绂忓埄涓績
HWPushUtil.pushWelfareCenter(tokenList, title, content);
- }else if (type==PushTypeEnum.signin) {// 绛惧埌
+ } else if (type == PushTypeEnum.signin) {// 绛惧埌
HWPushUtil.pushUserSignInNotification(tokenList, title, content);
}
} catch (Exception e) {
@@ -198,27 +204,27 @@
return;
try {
- if (type==PushTypeEnum.goodsdetail) {// 鍟嗗搧璇︽儏
+ if (type == PushTypeEnum.goodsdetail) {// 鍟嗗搧璇︽儏
if (goodsId == null)
throw new PushException(2, "鍙傛暟涓嶅畬鏁�");
HWPushUtil.pushGoods(tokenList, title, content, 1, goodsId);
- } else if (type==PushTypeEnum.url) {// 閾炬帴
+ } else if (type == PushTypeEnum.url) {// 閾炬帴
if (StringUtil.isNullOrEmpty(webUrl))
throw new PushException(2, "鍙傛暟涓嶅畬鏁�");
HWPushUtil.pushUrl(tokenList, title, content, webUrl);
- } else if (type==PushTypeEnum.ZNX) {// 绔欏唴淇�
+ } else if (type == PushTypeEnum.ZNX) {// 绔欏唴淇�
HWPushUtil.pushZNX(tokenList, title, content);
- } else if (type==PushTypeEnum.weex) {// weex
+ } else if (type == PushTypeEnum.weex) {// weex
if (StringUtil.isNullOrEmpty(url))
throw new PushException(2, "鍙傛暟涓嶅畬鏁�");
HWPushUtil.pushWEEX(tokenList, title, content, url);
- } else if (type==PushTypeEnum.baichuan) {// 鐧惧窛閾炬帴
+ } else if (type == PushTypeEnum.baichuan) {// 鐧惧窛閾炬帴
if (StringUtil.isNullOrEmpty(webUrl))
throw new PushException(2, "鍙傛暟涓嶅畬鏁�");
HWPushUtil.pushBaiChuanUrl(tokenList, title, content, webUrl);
- } else if (type==PushTypeEnum.welfare) {// 绂忓埄涓績
+ } else if (type == PushTypeEnum.welfare) {// 绂忓埄涓績
HWPushUtil.pushWelfareCenter(tokenList, title, content);
- } else if (type==PushTypeEnum.signin) {// 绛惧埌
+ } else if (type == PushTypeEnum.signin) {// 绛惧埌
HWPushUtil.pushUserSignInNotification(tokenList, title, content);
}
} catch (Exception e) {
--
Gitblit v1.8.0