admin
2021-06-30 0912f56a392bdf48315747c64ec0c18bf0aa29a6
fanli/src/main/java/com/yeshi/fanli/service/impl/push/PushServiceImpl.java
@@ -12,6 +12,7 @@
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;
@@ -24,22 +25,13 @@
@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;
@@ -65,6 +57,10 @@
    @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 {
@@ -82,7 +78,7 @@
            // 限制推送版本号: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);
            }
        }
@@ -91,7 +87,7 @@
            // 限制推送版本号: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) {
@@ -146,7 +142,7 @@
            // 限制推送版本号: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);
            }
        }
@@ -155,7 +151,7 @@
            // 限制推送版本号: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);
            }
            // 华为推送
@@ -229,7 +225,7 @@
            // 限制推送版本号: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);
            }
        }
@@ -238,7 +234,7 @@
            // 限制推送版本号: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);
            }
            // 华为推送
@@ -292,7 +288,7 @@
            // 限制推送版本号: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);
            }
        }
@@ -301,7 +297,7 @@
            // 限制推送版本号: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);
            }
        }
@@ -356,7 +352,7 @@
            // 限制推送版本号: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);
            }
        }
@@ -365,7 +361,7 @@
            // 限制推送版本号: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);
            }
        }
@@ -419,7 +415,7 @@
            // 限制推送版本号: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);
            }
        }
@@ -428,7 +424,7 @@
            // 限制推送版本号: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);
            }
        }
@@ -558,7 +554,7 @@
            // 限制推送版本号: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);
            }
        }
@@ -567,7 +563,7 @@
            // 限制推送版本号: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);
            }
        }