| | |
| | | package com.yeshi.fanli.service.impl.push;
|
| | |
|
| | | import java.util.Arrays;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | |
| | | if (pushCoupon == null) {
|
| | | throw new PushCouponException(1, "推送信息已不存在");
|
| | | }
|
| | | |
| | | if(pushCoupon.isPushed()) {
|
| | | throw new PushCouponException(1, "该信息不能重复推送");
|
| | | }
|
| | | |
| | |
|
| | | String title = pushCoupon.getTitle();
|
| | | String content = pushCoupon.getContent();
|
| | |
| | | throw new PushCouponException(1, "标题或内容不能为空");
|
| | | }
|
| | |
|
| | | |
| | | List<String> listVersion = null;
|
| | | String versions = pushCoupon.getVersions();
|
| | | if (versions != null && versions.trim().length() > 0) {
|
| | | listVersion = Arrays.asList(versions.split(","));
|
| | | }
|
| | | String uids = pushCoupon.getUids();
|
| | | if (uids == null || uids.trim().length() == 0) {
|
| | | // 全推
|
| | | pushService.pushWelfareCenter(null, title, content);
|
| | | pushService.pushWelfareCenter(null, title, content, listVersion);
|
| | |
|
| | | } else {
|
| | | // 指定用户推送
|
| | |
| | | for (int i = 0; i < uidArray.length; i++) {
|
| | | String str_uid = uidArray[i];
|
| | | if (str_uid != null && str_uid.trim().length() > 0) {
|
| | | pushService.pushWelfareCenter(Long.parseLong(str_uid), title, content);
|
| | | pushService.pushWelfareCenter(Long.parseLong(str_uid), title, content, listVersion);
|
| | | }
|
| | | }
|
| | | }
|