| | |
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.msg.UserSystemMsg;
|
| | | import com.yeshi.fanli.entity.bus.msg.UserSystemMsgTypeEnum;
|
| | | import com.yeshi.fanli.exception.PushException;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserSystemMsgService;
|
| | | import com.yeshi.fanli.service.inter.push.PushRecordService;
|
| | | import com.yeshi.fanli.service.inter.push.PushService;
|
| | | import com.yeshi.fanli.service.inter.user.AccountMessageService;
|
| | |
| | |
|
| | | @Resource
|
| | | private PushService pushService;
|
| | | |
| | | @Resource
|
| | | private UserSystemMsgService userSystemMsgService;
|
| | |
|
| | | /**
|
| | | * 商品推送
|
| | |
| | | * @throws Exception
|
| | | */
|
| | | @RequestMapping(value = "newPushFanZNX")
|
| | | public void newPushFanZNX(String callback, Long uid, String title, String content, PrintWriter out) {
|
| | | public void newPushFanZNX(String callback, String uids, String title, String content, PrintWriter out) {
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(title) || StringUtil.isNullOrEmpty(content)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请填写标题与内容"));
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | | pushService.pushZNX(uid, title, content);
|
| | | |
| | | String[] uidArray = null;
|
| | | if (uids != null) {
|
| | | uidArray = uids.split(",");
|
| | | }
|
| | | |
| | | if (uidArray == null) {
|
| | | pushService.pushZNX(null, title, content);
|
| | | } else {
|
| | | for (int i = 0; i < uidArray.length; i++) {
|
| | | String str_uid = uidArray[i];
|
| | | if (str_uid != null && str_uid.trim().length() > 0) {
|
| | | pushService.pushZNX(Long.parseLong(str_uid), title, content);
|
| | | |
| | | userSystemMsgService.addUserSystemMsg(Long.parseLong(str_uid), |
| | | UserSystemMsgTypeEnum.question, title, content, |
| | | UserSystemMsg.TIME_TAG_EMERGENT, null);
|
| | | }
|
| | | }
|
| | | }
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("推送成功"));
|
| | | } catch (PushException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("推送失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | * @throws Exception
|
| | | */
|
| | | @RequestMapping(value = "pushBaiChuan")
|
| | | public void pushBaiChuan(String callback, Long uid, String title, String content, String url, |
| | | public void pushBaiChuan(String callback, String uids, String title, String content, String url, |
| | | PrintWriter out) {
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(title) || StringUtil.isNullOrEmpty(content)) {
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | | pushService.pushBaiChuanUrl(uid, title, content, url);
|
| | | |
| | | String[] uidArray = null;
|
| | | if (uids != null) {
|
| | | uidArray = uids.split(",");
|
| | | }
|
| | | |
| | | if (uidArray == null) {
|
| | | pushService.pushBaiChuanUrl(null, title, content, url);
|
| | | } else {
|
| | | for (int i = 0; i < uidArray.length; i++) {
|
| | | String str_uid = uidArray[i];
|
| | | if (str_uid != null && str_uid.trim().length() > 0) {
|
| | | pushService.pushBaiChuanUrl(Long.parseLong(str_uid), title, content, url);
|
| | | }
|
| | | }
|
| | | }
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("推送成功"));
|
| | |
|
| | | } catch (PushException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("推送失败"));
|
| | | e.printStackTrace();
|
| | | }
|