Browse Source

小组通知添加关于组内消息记录表的维护

master
sunyuchao 4 years ago
parent
commit
812cdc3571
  1. 40
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java

40
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java

@ -39,7 +39,9 @@ import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.modules.constant.UserMessageConstant;
import com.epmet.modules.group.dao.GroupMessageDao;
import com.epmet.modules.group.dao.ResiGroupDao;
import com.epmet.modules.group.entity.GroupMessageEntity;
import com.epmet.modules.group.entity.ResiGroupEntity;
import com.epmet.modules.member.dao.ResiGroupMemberDao;
import com.epmet.modules.notice.dao.NoticeAttachmentDao;
@ -111,6 +113,8 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
private NoticeReadRecordService noticeReafdRecordService;
@Autowired
private NoticeReadRecordDao noticeReadRecordDao;
@Autowired
private GroupMessageDao groupMessageDao;
@Override
@ -241,7 +245,18 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
noticeReafdRecordService.insertBatch(reafdRecordList);
}
//7.组内成员推送站内信
//7.组内消息记录表新增数据
GroupMessageEntity messageEntity = new GroupMessageEntity();
messageEntity.setCustomerId(resultDTO.getCustomerId());
messageEntity.setGridId(groupEntity.getGridId());
messageEntity.setType("notice");
messageEntity.setMessageId(entity.getId());
messageEntity.setPublishUserId(entity.getCreatedBy());
messageEntity.setStatus("published");
messageEntity.setOperateTime(entity.getChangeTime());
groupMessageDao.insert(messageEntity);
//8.组内成员推送站内信
List<UserMessageFormDTO> userMessageFormDTOS = new ArrayList<>();
memberList.forEach(m -> {
if (!"".equals(m.getGroupLeaderFlag())) {
@ -362,13 +377,30 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
noticeReafdRecordService.insertBatch(reafdRecordList);
}
//7.推送站内信
//7-1.获取小组信息
//7.组内消息记录表更新数据
GroupMessageEntity groupMessage = groupMessageDao.selectByMessageId(formDTO.getNoticeId());
if(null == groupMessage){
GroupMessageEntity messageEntity = new GroupMessageEntity();
messageEntity.setCustomerId(entity.getCustomerId());
messageEntity.setGridId(entity.getGridId());
messageEntity.setType("notice");
messageEntity.setMessageId(entity.getId());
messageEntity.setPublishUserId(entity.getCreatedBy());
messageEntity.setStatus("published");
messageEntity.setOperateTime(entity.getChangeTime());
groupMessageDao.insert(messageEntity);
}else {
groupMessage.setOperateTime(entity.getChangeTime());
groupMessageDao.updateById(groupMessage);
}
//8.推送站内信
//8-1.获取小组信息
ResiGroupEntity groupEntity = resiGroupDao.selectById(entity.getGroupId());
if (null == groupEntity) {
throw new RenException(String.format("保存小组通知,获取小组数据失败,小组Id->", formDTO.getUserId()));
}
//7-2.推送站内信信息
//8-2.推送站内信信息
List<UserMessageFormDTO> userMessageFormDTOS = new ArrayList<>();
memberList.forEach(m -> {
if (!"".equals(m.getGroupLeaderFlag())) {

Loading…
Cancel
Save