| | |
| | | import com.yeshi.fanli.entity.xinge.PushRecord; |
| | | import com.yeshi.fanli.exception.push.PushException; |
| | | import com.yeshi.fanli.service.inter.config.AppVersionService; |
| | | import com.yeshi.fanli.service.inter.config.SystemConfigService; |
| | | import com.yeshi.fanli.service.inter.push.*; |
| | | import com.yeshi.fanli.service.inter.user.SystemZnxService; |
| | | import com.yeshi.fanli.util.Constant; |
| | |
| | | @Service |
| | | public class PushServiceImpl implements PushService { |
| | | |
| | | static String IOSBundleId = ""; |
| | | static String PROJECT_NAME = ""; |
| | | |
| | | static { |
| | | IOSBundleId = Constant.systemCommonConfig.getIosBundleId(); |
| | | PROJECT_NAME = Constant.systemCommonConfig.getProjectChineseName(); |
| | | } |
| | | |
| | | @Resource |
| | | private PushRecordService pushRecordService; |
| | | |
| | | @Resource |
| | | private SystemZnxService systemZnxService; |
| | | |
| | | @Resource |
| | | private DeviceTokenHWService deviceTokenHWService; |
| | | |
| | | @Resource |
| | | private IOSPushService iosPushService; |
| | |
| | | @Resource |
| | | private AppVersionService appVersionService; |
| | | |
| | | |
| | | @Resource |
| | | private SystemConfigService systemConfigService; |
| | | |
| | | @Override |
| | | public void pushGoods(Long uid, String title, String content, String url, List<String> listIOS, |
| | | List<String> listAndroid, SystemEnum system) throws PushException { |
| | |
| | | // 限制推送版本号:0 |
| | | String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS, system); |
| | | if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { |
| | | iosPushService.pushGoods(uid, Long.parseLong(gid), title, content, codes); |
| | | iosPushService.pushGoods(uid, Long.parseLong(gid), title, content, codes, system); |
| | | } |
| | | } |
| | | |
| | |
| | | // 限制推送版本号:0 |
| | | String versions = getEffectiveVersions(0, AppVersionInfo.PLATFORM_ANDROID, listAndroid, system); |
| | | if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { |
| | | xmPushService.pushGoods(uid, Long.parseLong(gid), title, content, versions); |
| | | xmPushService.pushGoods(uid, Long.parseLong(gid), title, content, versions, system); |
| | | } |
| | | // 华为推送 |
| | | if (listAndroid == null || listAndroid.size() > 0) { |
| | |
| | | // 限制推送版本号:0 |
| | | String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS, system); |
| | | if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { |
| | | iosPushService.pushUrl(uid, url, title, content, codes); |
| | | iosPushService.pushUrl(uid, url, title, content, codes,system); |
| | | } |
| | | } |
| | | |
| | |
| | | // 限制推送版本号:0 |
| | | String versions = getEffectiveVersions(0, AppVersionInfo.PLATFORM_ANDROID, listAndroid, system); |
| | | if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { |
| | | xmPushService.pushUrl(uid, url, title, content, versions); |
| | | xmPushService.pushUrl(uid, url, title, content, versions,system); |
| | | } |
| | | |
| | | // 华为推送 |
| | |
| | | // 限制推送版本号:0 |
| | | String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS, system); |
| | | if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { |
| | | iosPushService.pushZNX(uId, accountMessage, systemZnx, codes); |
| | | iosPushService.pushZNX(uId, accountMessage, systemZnx, codes,system); |
| | | } |
| | | } |
| | | |
| | |
| | | // 限制推送版本号:0 |
| | | String versions = getEffectiveVersions(0, AppVersionInfo.PLATFORM_ANDROID, listAndroid, system); |
| | | if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { |
| | | xmPushService.pushZNX(uId, accountMessage, systemZnx, versions); |
| | | xmPushService.pushZNX(uId, accountMessage, systemZnx, versions,system); |
| | | } |
| | | |
| | | // 华为推送 |
| | |
| | | // 限制推送版本号:0 |
| | | String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS, system); |
| | | if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { |
| | | iosPushService.pushWEEX(uid, title, content, weexUrl, codes); |
| | | iosPushService.pushWEEX(uid, title, content, weexUrl, codes,system); |
| | | } |
| | | } |
| | | |
| | |
| | | // 限制推送版本号:31 |
| | | String versions = getEffectiveVersions(0, AppVersionInfo.PLATFORM_ANDROID, listAndroid, system); |
| | | if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { |
| | | xmPushService.pushWEEX(uid, title, content, weexUrl, versions); |
| | | xmPushService.pushWEEX(uid, title, content, weexUrl, versions,system); |
| | | } |
| | | } |
| | | |
| | |
| | | // 限制推送版本号:0 |
| | | String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS, system); |
| | | if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { |
| | | iosPushService.pushBaiChuanUrl(uid, title, content, url, codes); |
| | | iosPushService.pushBaiChuanUrl(uid, title, content, url, codes,system); |
| | | } |
| | | } |
| | | |
| | |
| | | // 限制推送版本号:31 |
| | | String versions = getEffectiveVersions(31, AppVersionInfo.PLATFORM_ANDROID, listAndroid, system); |
| | | if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { |
| | | xmPushService.pushBaiChuanUrl(uid, title, content, url, versions); |
| | | xmPushService.pushBaiChuanUrl(uid, title, content, url, versions,system); |
| | | } |
| | | } |
| | | |
| | |
| | | // 限制推送版本号:0 |
| | | String codes = getEffectiveVersionCodes(0, AppVersionInfo.PLATFORM_IOS, listIOS, system); |
| | | if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { |
| | | iosPushService.pushWelfareCenter(uid, title, content, codes); |
| | | iosPushService.pushWelfareCenter(uid, title, content, codes,system); |
| | | } |
| | | } |
| | | |
| | |
| | | // 限制推送版本号:36 |
| | | String versions = getEffectiveVersions(36, AppVersionInfo.PLATFORM_ANDROID, listAndroid, system); |
| | | if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { |
| | | xmPushService.pushWelfareCenter(uid, title, content, versions); |
| | | xmPushService.pushWelfareCenter(uid, title, content, versions,system); |
| | | } |
| | | } |
| | | |
| | |
| | | // 限制推送版本号:1.6.5以后 |
| | | String codes = getEffectiveVersionCodes(60, AppVersionInfo.PLATFORM_IOS, listIOS, system); |
| | | if (listIOS == null || (listIOS.size() > 0 && codes != null && codes.trim().length() > 0)) { |
| | | iosPushService.pushUserSignInNotification(uid, title, content, codes); |
| | | iosPushService.pushUserSignInNotification(uid, title, content, codes,system); |
| | | } |
| | | } |
| | | |
| | |
| | | // 限制推送版本号:1.6.5以后 |
| | | String versions = getEffectiveVersions(47, AppVersionInfo.PLATFORM_ANDROID, listAndroid, system); |
| | | if (listAndroid == null || (listAndroid.size() > 0 && versions != null && versions.trim().length() > 0)) { |
| | | xmPushService.pushUserSignInNotification(uid, title, content, versions); |
| | | xmPushService.pushUserSignInNotification(uid, title, content, versions,system); |
| | | } |
| | | } |
| | | |