| | |
| | | import com.yeshi.fanli.entity.AppVersionInfo;
|
| | | 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.entity.push.DeviceTokenOPPO;
|
| | | import com.yeshi.fanli.exception.push.PushException;
|
| | | import com.yeshi.fanli.log.PushLogHelper;
|
| | |
| | | import com.yeshi.fanli.service.inter.push.OPPOPushService;
|
| | | import com.yeshi.fanli.service.inter.user.UserCustomSettingsService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.push.HWPushUtil;
|
| | | import com.yeshi.fanli.util.push.OPPOPushUtil;
|
| | |
|
| | | @Service
|
| | |
| | | private List<Integer> getVersionCodeList(List<Integer> versionCodeList) {
|
| | | List<Integer> versionList = new ArrayList<>();
|
| | | if (versionCodeList == null) {// 全推
|
| | | List<AppVersionInfo> appInfoList = appVersionService.listByPlatformAndMinVersionCode("android", 49);
|
| | | List<AppVersionInfo> appInfoList = appVersionService.listByPlatformAndMinVersionCode("android", 51);
|
| | | if (appInfoList != null)
|
| | | for (AppVersionInfo version : appInfoList) {
|
| | | versionList.add(version.getVersionCode());
|
| | |
| | |
|
| | | } else {// 按版本推送
|
| | | for (Integer versionCode : versionCodeList) {
|
| | | if (versionCode.intValue() >= 49) {// 2.0.1开始支持
|
| | | if (versionCode.intValue() >= 51) {// 2.0.1开始支持
|
| | | versionList.add(versionCode);
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | private List<DeviceTokenOPPO> filterDeviceToken(List<DeviceTokenOPPO> deviceList, int hour) {
|
| | |
|
| | | // TODO 消息免打扰关闭
|
| | | if (1 > 0)
|
| | | return deviceList;
|
| | |
|
| | | // 处理消息免打扰
|
| | | if (hour >= 20 || hour < 8) {
|
| | | Set<Long> uidSets = new HashSet<>();
|