微信小程序消息中心接口优化

This commit is contained in:
xiezhijun 2021-08-06 17:14:07 +08:00
parent 53eba87b36
commit 35420de8fe
3 changed files with 10 additions and 9 deletions

View File

@ -114,7 +114,7 @@ public interface ISysMessageNoticeService
* @param type 类型 1评论 2回复
* @param originalContent 话题内容或被回复的内容
*/
public void sendTopicMessage(SysServicesTopic topic, int type, Long statusId, String originalContent);
public void sendTopicMessage(SysServicesTopic topic, int type, String topicId, Long statusId, String originalContent);
/**
* 根据客户ID查询打卡点评消息以及未读消息数量包含点评营养师信息客户信息点评内容

View File

@ -206,7 +206,7 @@ public class SysMessageNoticeServiceImpl implements ISysMessageNoticeService {
*/
@Override
@Async
public void sendTopicMessage(SysServicesTopic topic, int type, Long statusId, String originalContent) {
public void sendTopicMessage(SysServicesTopic topic, int type, String topicId, Long statusId, String originalContent) {
if (topic == null) {
return;
}
@ -231,7 +231,7 @@ public class SysMessageNoticeServiceImpl implements ISysMessageNoticeService {
sysMessageNotice.setMessageCustomer(Long.parseLong(topic.getToUid()));
sysMessageNotice.setMessageTitle("");
sysMessageNotice.setMessageContent(JSONArray.toJSONString(content));
sysMessageNotice.setMessageKey(topic.getTopicId());
sysMessageNotice.setMessageKey(topicId);
sendMessageNoticeToCustomer(MessageNoticeEnum.topicMessage, sysMessageNotice);
}

View File

@ -149,23 +149,24 @@ public class SysServicesTopicServiceImp implements ISysServicesTopicService {
status.setRole(topic.getRole());
servicesTopicMapper.updateSysServicesTopicStatus(status);
SysServicesTopic tp2 = servicesTopicMapper.getTopicContentByCommentId(topic.getCommentId());
System.out.println(tp2.getContent() + "---------" + tp2.getTopicId());
/*SysServicesTopic tp2 = servicesTopicMapper.getTopicContentByCommentId(topic.getCommentId());
System.out.println(tp2.getContent() + "---------" + tp2.getTopicId());*/
//发送消息
if("customer".equals(topic.getToRole()) && StringUtils.isNotEmpty(topic.getToUid())){
String content = "";
Long statusId = 0L;
SysServicesTopic tp = null;
if(StringUtils.isNotEmpty(topic.getCommentId())){
SysServicesTopic tp = servicesTopicMapper.getTopicContentByCommentId(topic.getCommentId());
tp = servicesTopicMapper.getTopicContentByCommentId(topic.getCommentId());
if(tp != null){
content = tp.getContent();
//查询客户对象status表的id
statusId = servicesTopicMapper.getStatusIdByRoleAndTopicId(tp.getTopicId(), topic.getToRole());
}
}
if(StringUtils.isNotEmpty(content)){
sysMessageNoticeService.sendTopicMessage(topic, 2, statusId, content);
if(tp != null && StringUtils.isNotEmpty(content)){
sysMessageNoticeService.sendTopicMessage(topic, 2, tp.getTopicId(), statusId, content);
}
}
@ -195,7 +196,7 @@ public class SysServicesTopicServiceImp implements ISysServicesTopicService {
//查询客户对象status表的id
Long statusId = servicesTopicMapper.getStatusIdByRoleAndTopicId(topic.getTopicId(), topic.getToRole());
if(StringUtils.isNotEmpty(content)){
sysMessageNoticeService.sendTopicMessage(topic, 1, statusId, content);
sysMessageNoticeService.sendTopicMessage(topic, 1, topic.getTopicId(), statusId, content);
}
}