| | |
| | | package org.jeecg.modules.system.service.impl; |
| | | |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.modules.system.entity.SysAnnouncementSend; |
| | | import org.jeecg.modules.system.mapper.SysAnnouncementSendMapper; |
| | | import org.jeecg.modules.system.model.AnnouncementSendModel; |
| | | import org.jeecg.modules.system.service.ISysAnnouncementSendService; |
| | | import org.jeecg.modules.system.vo.OptionsVo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | @Override |
| | | public Page<AnnouncementSendModel> getMyAnnouncementSendPage(Page<AnnouncementSendModel> page, |
| | | AnnouncementSendModel announcementSendModel) { |
| | | |
| | | List<String> msgCategory = Lists.newArrayList(); |
| | | if ("系统消息".equals(announcementSendModel.getMsgCategory())) { |
| | | msgCategory.addAll(Arrays.asList("系统消息", "2")); |
| | | }else if ("通知公告".equals(announcementSendModel.getMsgCategory())) { |
| | | msgCategory.addAll(Arrays.asList("通知公告", "1")); |
| | | }else if (StringUtils.isNotBlank(announcementSendModel.getMsgCategory())){ |
| | | msgCategory.addAll(Arrays.asList(announcementSendModel.getMsgCategory())); |
| | | } |
| | | announcementSendModel.setMsgCategoryList(msgCategory); |
| | | return page.setRecords(sysAnnouncementSendMapper.getMyAnnouncementSendList(page, announcementSendModel)); |
| | | } |
| | | |
| | |
| | | return baseMapper.getPrimaryInfo(userId,msgCategoryList); |
| | | } |
| | | |
| | | @Override |
| | | public List<OptionsVo> getMessageType() { |
| | | Set<OptionsVo> result = new HashSet<>(); |
| | | List<String> messageTypeList = this.baseMapper.getMessageType(); |
| | | if (messageTypeList != null && !messageTypeList.isEmpty()) { |
| | | for (String messageType : messageTypeList) { |
| | | OptionsVo optionsVo = new OptionsVo(); |
| | | String label = messageType; |
| | | String value = messageType; |
| | | if (CommonConstant.MSG_CATEGORY_2.equals(messageType)) { |
| | | label = "系统消息"; |
| | | value = "系统消息"; |
| | | } else if (CommonConstant.MSG_CATEGORY_1.equals(messageType)) { |
| | | label = "通知公告"; |
| | | value = "通知公告"; |
| | | } |
| | | optionsVo.setLabel(label); |
| | | optionsVo.setValue(value); |
| | | result.add(optionsVo); |
| | | } |
| | | } |
| | | return new ArrayList<>(result); |
| | | } |
| | | |
| | | } |