From 4f5a5b0a00c01491f009074351089f086f950d3e Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 01 六月 2021 19:09:48 +0800 Subject: [PATCH] 系统配置改为数据库 --- fanli/src/main/java/com/yeshi/fanli/service/impl/push/VIVOPushServiceImpl.java | 35 ++++++++++++++++++++++++----------- 1 files changed, 24 insertions(+), 11 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..662a8c7 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); @@ -143,6 +148,8 @@ */ private void push(PushTypeEnum type, Long uid, String url, String webUrl, Long 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