| | |
| | | package com.yeshi.fanli.controller.admin;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Arrays;
|
| | | import java.util.List;
|
| | |
|
| | |
| | |
|
| | | try {
|
| | |
|
| | | String[] uidArray = null;
|
| | | if (uids != null) {
|
| | | uidArray = uids.split(",");
|
| | | List<String> listuid = null;
|
| | | if (uids != null && uids.trim().length() > 0) {
|
| | | listuid = Arrays.asList(uids.split(","));
|
| | | if (listuid == null || listuid.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户id格式不正确"));
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | List<String> listVersion = null;
|
| | | if (versions != null && versions.trim().length() > 0) {
|
| | | listVersion = Arrays.asList(versions.split(","));
|
| | | List<String> list = Arrays.asList(versions.split(","));
|
| | | |
| | | if (list != null && list.size() > 0) {
|
| | | listVersion = new ArrayList<String>();
|
| | | for (String version: list) {
|
| | | if (version != null && version.trim().length() > 0) {
|
| | | listVersion.add(version.trim());
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (uidArray == null) {
|
| | | if (listVersion == null || listVersion.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("版本号格式不正确"));
|
| | | return;
|
| | | }
|
| | | }
|
| | | |
| | | if (listuid == null) {
|
| | | // 全推
|
| | | pushService.pushGoods(null, title, content, url, listVersion);
|
| | | } else {
|
| | | // 部分用户推送
|
| | | for (int i = 0; i < uidArray.length; i++) {
|
| | | String str_uid = uidArray[i];
|
| | | for (String str_uid: listuid) {
|
| | | if (str_uid != null && str_uid.trim().length() > 0) {
|
| | | pushService.pushGoods(Long.parseLong(str_uid), url, title, content, listVersion);
|
| | | }
|
| | |
| | |
|
| | | try {
|
| | |
|
| | | String[] uidArray = null;
|
| | | if (uids != null) {
|
| | | uidArray = uids.split(",");
|
| | | List<String> listuid = null;
|
| | | if (uids != null && uids.trim().length() > 0) {
|
| | | listuid = Arrays.asList(uids.split(","));
|
| | | if (listuid == null || listuid.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户id格式不正确"));
|
| | | return;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | List<String> listVersion = null;
|
| | | if (versions != null && versions.trim().length() > 0) {
|
| | | listVersion = Arrays.asList(versions.split(","));
|
| | | List<String> list = Arrays.asList(versions.split(","));
|
| | | |
| | | if (list != null && list.size() > 0) {
|
| | | listVersion = new ArrayList<String>();
|
| | | for (String version: list) {
|
| | | if (version != null && version.trim().length() > 0) {
|
| | | listVersion.add(version.trim());
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (uidArray == null) {
|
| | | if (listVersion == null || listVersion.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("版本号格式不正确"));
|
| | | return;
|
| | | }
|
| | | }
|
| | | |
| | | if (listuid == null) {
|
| | | // 全推
|
| | | pushService.pushUrl(null, title, content, url, listVersion);
|
| | | } else {
|
| | | // 部分推送
|
| | | for (int i = 0; i < uidArray.length; i++) {
|
| | | String str_uid = uidArray[i];
|
| | | for (String str_uid: listuid) {
|
| | | if (str_uid != null && str_uid.trim().length() > 0) {
|
| | | pushService.pushUrl(Long.parseLong(str_uid), url, title, content, listVersion);
|
| | | }
|
| | |
| | |
|
| | | try {
|
| | |
|
| | | String[] uidArray = null;
|
| | | if (uids != null) {
|
| | | uidArray = uids.split(",");
|
| | | List<String> listuid = null;
|
| | | if (uids != null && uids.trim().length() > 0) {
|
| | | listuid = Arrays.asList(uids.split(","));
|
| | | if (listuid == null || listuid.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户id格式不正确"));
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | List<String> listVersion = null;
|
| | | if (versions != null && versions.trim().length() > 0) {
|
| | | listVersion = Arrays.asList(versions.split(","));
|
| | | List<String> list = Arrays.asList(versions.split(","));
|
| | | |
| | | if (list != null && list.size() > 0) {
|
| | | listVersion = new ArrayList<String>();
|
| | | for (String version: list) {
|
| | | if (version != null && version.trim().length() > 0) {
|
| | | listVersion.add(version.trim());
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (uidArray == null) {
|
| | | if (listVersion == null || listVersion.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("版本号格式不正确"));
|
| | | return;
|
| | | }
|
| | | }
|
| | | |
| | | if (listuid == null) {
|
| | | // 全推
|
| | | pushService.pushZNX(null, title, content, listVersion);
|
| | | } else {
|
| | | // 部分推送
|
| | | for (int i = 0; i < uidArray.length; i++) {
|
| | | String str_uid = uidArray[i];
|
| | | for (String str_uid: listuid) {
|
| | | if (str_uid != null && str_uid.trim().length() > 0) {
|
| | | pushService.pushZNX(Long.parseLong(str_uid), title, content, listVersion);
|
| | |
|
| | |
| | |
|
| | | try {
|
| | |
|
| | | String[] uidArray = null;
|
| | | if (uids != null) {
|
| | | uidArray = uids.split(",");
|
| | | List<String> listuid = null;
|
| | | if (uids != null && uids.trim().length() > 0) {
|
| | | listuid = Arrays.asList(uids.split(","));
|
| | | if (listuid == null || listuid.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户id格式不正确"));
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | List<String> listVersion = null;
|
| | | if (versions != null && versions.trim().length() > 0) {
|
| | | listVersion = Arrays.asList(versions.split(","));
|
| | | List<String> list = Arrays.asList(versions.split(","));
|
| | | |
| | | if (list != null && list.size() > 0) {
|
| | | listVersion = new ArrayList<String>();
|
| | | for (String version: list) {
|
| | | if (version != null && version.trim().length() > 0) {
|
| | | listVersion.add(version.trim());
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (uidArray == null) {
|
| | | if (listVersion == null || listVersion.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("版本号格式不正确"));
|
| | | return;
|
| | | }
|
| | | }
|
| | | |
| | | if (listuid == null) {
|
| | | // 全推
|
| | | pushService.pushBaiChuanUrl(null, title, content, url, listVersion);
|
| | | } else {
|
| | | // 部分推送
|
| | | for (int i = 0; i < uidArray.length; i++) {
|
| | | String str_uid = uidArray[i];
|
| | | for (String str_uid: listuid) {
|
| | | if (str_uid != null && str_uid.trim().length() > 0) {
|
| | | pushService.pushBaiChuanUrl(Long.parseLong(str_uid), title, content, url, listVersion);
|
| | | }
|