Commit f9fa00de authored by maoying's avatar maoying

修改消息参数传递

parent 4b258a54
...@@ -231,8 +231,8 @@ public class MessageServiceImpl implements IMessageService { ...@@ -231,8 +231,8 @@ public class MessageServiceImpl implements IMessageService {
} }
List<String> pushApps = jpushUser.stream() List<String> pushApps = jpushUser.stream()
.filter(bo->StringUtil.isNotEmpty(bo.getUsername())) .filter(bo->StringUtil.isNotEmpty(bo.getUserId()))
.map(PushTargetBo::getUsername).collect(Collectors.toList()); .map(PushTargetBo::getUserId).collect(Collectors.toList());
pushApps = pushApps.stream().distinct().collect(Collectors.toList()); pushApps = pushApps.stream().distinct().collect(Collectors.toList());
if(!pushApps.isEmpty()){ if(!pushApps.isEmpty()){
List<PushMsgParam> pmps = new ArrayList<PushMsgParam>(); List<PushMsgParam> pmps = new ArrayList<PushMsgParam>();
...@@ -314,7 +314,7 @@ public class MessageServiceImpl implements IMessageService { ...@@ -314,7 +314,7 @@ public class MessageServiceImpl implements IMessageService {
public Msg pushMsgAndSave(String toke,String product,String appKey,Msg msg) { public Msg pushMsgAndSave(String toke,String product,String appKey,Msg msg) {
List<PushMsgParam> pmps = new ArrayList<PushMsgParam>(); List<PushMsgParam> pmps = new ArrayList<PushMsgParam>();
PushMsgParam pushMsg = new PushMsgParam(); PushMsgParam pushMsg = new PushMsgParam();
pushMsg.setRecivers(Arrays.asList(msg.getTargetTel())); pushMsg.setRecivers(Arrays.asList(msg.getUserId()));
pushMsg.setContent(ObjectUtils.isEmpty(msg.getPushBody()) ? msg.getBody() : msg.getPushBody()); pushMsg.setContent(ObjectUtils.isEmpty(msg.getPushBody()) ? msg.getBody() : msg.getPushBody());
pushMsg.setSubject(msg.getTitle()); pushMsg.setSubject(msg.getTitle());
pushMsg.setType(JPushTypeEnum.ALIAS.getCode()); pushMsg.setType(JPushTypeEnum.ALIAS.getCode());
......
...@@ -66,36 +66,6 @@ public class AsyncTask { ...@@ -66,36 +66,6 @@ public class AsyncTask {
private static final String TAB = "\r\n"; private static final String TAB = "\r\n";
/**
* 邮件发送
* @param msgResponse
* @return
* @throws InterruptedException
*/
// @Async("asyncTaskExecutor")
// public Future<Boolean> sendEmail(PushMsgParam pmp) throws InterruptedException {
// long start = System.currentTimeMillis();
// iEmailService.sendSimpleEmail(pmp.getEmails(), pmp.getSubject(), pmp.getContent());
// long end = System.currentTimeMillis();
// log.info("=====邮件发送耗时:"+(end-start)+"======");
// return new AsyncResult<Boolean>(true);
// }
//
// /**
// * jpush 推送
// * @param pmps
// * @return
// * @throws InterruptedException
// */
// @Async("asyncTaskExecutor")
// public Future<Boolean> sendJpush(List<PushMsgParam> pmps) throws InterruptedException {
// long start = System.currentTimeMillis();
// appMessagePushService.sendMessage(pmps);
// long end = System.currentTimeMillis();
// //返回true,告诉此任务已完成
// log.info("=====Jpush发送耗时:"+(end-start)+"======");
// return new AsyncResult<Boolean>(true);
// }
/** /**
* 检查消息推送 * 检查消息推送
...@@ -231,6 +201,7 @@ public class AsyncTask { ...@@ -231,6 +201,7 @@ public class AsyncTask {
msg.setIsImmediately(true); msg.setIsImmediately(true);
msg.setSendTime(date); msg.setSendTime(date);
msg.setCreateDate(date); msg.setCreateDate(date);
msg.setTargetTel(user.getString("username"));
msg.setReciverName(user.getString("realName")); msg.setReciverName(user.getString("realName"));
sendUserIds.add(user.getString("userId")); sendUserIds.add(user.getString("userId"));
msgs.add(msg); msgs.add(msg);
......
...@@ -110,17 +110,17 @@ public class AppMessagePushService { ...@@ -110,17 +110,17 @@ public class AppMessagePushService {
} }
public void sendMessage(PushMsgParam response){ // public void sendMessage(PushMsgParam response){
//
try { // try {
if(null!=response && "true".equals(isPush)){ // if(null!=response && "true".equals(isPush)){
CommonResponse commonResponse = PushFeign.sendMessageone(response); // CommonResponse commonResponse = PushFeign.sendMessageone(response);
} // }
} catch (Exception e) { // } catch (Exception e) {
log.error(e.getMessage(),e); // log.error(e.getMessage(),e);
e.printStackTrace(); // e.printStackTrace();
//
} // }
} // }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment