Browse Source

修复移动端消息中心图标不显示问题。

master
dimengzhe 3 years ago
parent
commit
1d0c7ca501
  1. 25
      message-center-biz/src/main/java/com/yxt/messagecenter/biz/messagelist/MessageListService.java

25
message-center-biz/src/main/java/com/yxt/messagecenter/biz/messagelist/MessageListService.java

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yxt.anrui.portal.api.appsubsetversion.AppSubsetVersionFeign; import com.yxt.anrui.portal.api.appsubsetversion.AppSubsetVersionFeign;
import com.yxt.anrui.portal.api.appsubsetversion.AppSubsetVersionVo; import com.yxt.anrui.portal.api.appsubsetversion.AppSubsetVersionVo;
import com.yxt.common.base.config.component.FileUploadComponent;
import com.yxt.common.base.service.MybatisBaseService; import com.yxt.common.base.service.MybatisBaseService;
import com.yxt.common.base.utils.PagerUtil; import com.yxt.common.base.utils.PagerUtil;
import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.query.PagerQuery;
@ -45,6 +46,8 @@ public class MessageListService extends MybatisBaseService<MessageListMapper, Me
private MessageService messageService; private MessageService messageService;
@Autowired @Autowired
private AppSubsetVersionFeign appSubsetVersionFeign; private AppSubsetVersionFeign appSubsetVersionFeign;
@Autowired
private FileUploadComponent fileUploadComponent;
public List<MessageList> listAll(MessageListQuery query) { public List<MessageList> listAll(MessageListQuery query) {
QueryWrapper<MessageList> qw = createQueryWrapper(query); QueryWrapper<MessageList> qw = createQueryWrapper(query);
@ -141,7 +144,7 @@ public class MessageListService extends MybatisBaseService<MessageListMapper, Me
return vo; return vo;
} }
public PagerVo<MessageListJoinMsgVo> noreadListPage(PagerQuery<MessageListQuery> pq,String userSid) { public PagerVo<MessageListJoinMsgVo> noreadListPage(PagerQuery<MessageListQuery> pq, String userSid) {
MessageListQuery query = pq.getParams(); MessageListQuery query = pq.getParams();
query.setReceiverSid(userSid); query.setReceiverSid(userSid);
QueryWrapper<MessageList> qw = createQueryWrapper(query); QueryWrapper<MessageList> qw = createQueryWrapper(query);
@ -151,7 +154,7 @@ public class MessageListService extends MybatisBaseService<MessageListMapper, Me
return p; return p;
} }
public PagerVo<MessageListJoinMsgVo> readListPage(PagerQuery<MessageListQuery> pq,String userSid) { public PagerVo<MessageListJoinMsgVo> readListPage(PagerQuery<MessageListQuery> pq, String userSid) {
MessageListQuery query = pq.getParams(); MessageListQuery query = pq.getParams();
query.setReceiverSid(userSid); query.setReceiverSid(userSid);
QueryWrapper<MessageList> qw = createQueryWrapper(query); QueryWrapper<MessageList> qw = createQueryWrapper(query);
@ -238,6 +241,7 @@ public class MessageListService extends MybatisBaseService<MessageListMapper, Me
/** /**
* 查询未读数量 * 查询未读数量
*
* @param msgTypeSid * @param msgTypeSid
* @param userSid * @param userSid
* @return * @return
@ -248,6 +252,7 @@ public class MessageListService extends MybatisBaseService<MessageListMapper, Me
/** /**
* 手机端查询消息主页面 * 手机端查询消息主页面
*
* @param userSid * @param userSid
* @return * @return
*/ */
@ -267,13 +272,15 @@ public class MessageListService extends MybatisBaseService<MessageListMapper, Me
AppCrossIcon crossIcon = new AppCrossIcon(); AppCrossIcon crossIcon = new AppCrossIcon();
crossIcon.setMsgTypeSid(messageTypeVo.getMsgTypeSid()); crossIcon.setMsgTypeSid(messageTypeVo.getMsgTypeSid());
crossIcon.setMsgType(messageTypeVo.getMsgType()); crossIcon.setMsgType(messageTypeVo.getMsgType());
crossIcon.setIconUrl(messageTypeVo.getCrossIconUrl()); crossIcon.setIconUrl(fileUploadComponent.getUrlPrefix() + messageTypeVo.getCrossIconUrl());
crossIcon.setNum(num); crossIcon.setNum(num);
crossIconList.add(crossIcon); crossIconList.add(crossIcon);
} else { // 纵排消息 } else { // 纵排消息
AppLongsIcon longsIcon = new AppLongsIcon(); AppLongsIcon longsIcon = new AppLongsIcon();
longsIcon.setMsgType(messageTypeVo.getMsgType()); longsIcon.setMsgType(messageTypeVo.getMsgType());
longsIcon.setIconUrl(messageTypeVo.getLongIconUrl()); if (StringUtils.isNotBlank(messageTypeVo.getLongIconUrl())) {
longsIcon.setIconUrl(fileUploadComponent.getUrlPrefix() + messageTypeVo.getLongIconUrl());
}
AppLastMsgVo lastMsg = baseMapper.selectLastMsg(userSid, messageTypeVo.getMsgTypeSid()); AppLastMsgVo lastMsg = baseMapper.selectLastMsg(userSid, messageTypeVo.getMsgTypeSid());
longsIcon.setMsgTypeSid(messageTypeVo.getMsgTypeSid()); longsIcon.setMsgTypeSid(messageTypeVo.getMsgTypeSid());
longsIcon.setTitle(lastMsg == null ? "" : lastMsg.getMsgTitle()); longsIcon.setTitle(lastMsg == null ? "" : lastMsg.getMsgTitle());
@ -287,19 +294,20 @@ public class MessageListService extends MybatisBaseService<MessageListMapper, Me
vo.setLongIconList(longIconList); vo.setLongIconList(longIconList);
int unReadCount = baseMapper.selectUnReadCount("", userSid); int unReadCount = baseMapper.selectUnReadCount("", userSid);
if (unReadCount != 0) { if (unReadCount != 0) {
vo.setMsgTotal("未读消息"+unReadCount+"条"); vo.setMsgTotal("未读消息" + unReadCount + "条");
} }
return vo; return vo;
} }
/** /**
* 手机端查询消息列表 * 手机端查询消息列表
*
* @param pq * @param pq
* @return * @return
*/ */
public PagerVo<AppMessageListVo> getAppMsgListByUserSid(PagerQuery<AppMessageListQuery> pq) { public PagerVo<AppMessageListVo> getAppMsgListByUserSid(PagerQuery<AppMessageListQuery> pq) {
QueryWrapper<MessageList> qw = new QueryWrapper<>(); QueryWrapper<MessageList> qw = new QueryWrapper<>();
qw.eq("ml.receiverSid", pq.getParams().getUserSid()); qw.eq("ml.receiverSid", pq.getParams().getUserSid());
qw.eq("m.msgTypeSid", pq.getParams().getMsgTypeSid()); qw.eq("m.msgTypeSid", pq.getParams().getMsgTypeSid());
IPage<AppMessageListQuery> iPage = PagerUtil.queryToPage(pq); IPage<AppMessageListQuery> iPage = PagerUtil.queryToPage(pq);
IPage<AppMessageListVo> page = baseMapper.getAppMsgListByUserSid(iPage, qw); IPage<AppMessageListVo> page = baseMapper.getAppMsgListByUserSid(iPage, qw);
@ -317,12 +325,13 @@ public class MessageListService extends MybatisBaseService<MessageListMapper, Me
vo.setJson("{}"); vo.setJson("{}");
} }
}); });
pagerVo.setMsg("共查询出"+pagerVo.getTotal()+"条消息"); pagerVo.setMsg("共查询出" + pagerVo.getTotal() + "条消息");
return pagerVo; return pagerVo;
} }
/** /**
* 手机端用户根据消息类型批量设为已读 * 手机端用户根据消息类型批量设为已读
*
* @param msgTypeSid * @param msgTypeSid
* @return * @return
*/ */

Loading…
Cancel
Save