From 9329921568abccb3ed0540421c9c25cba632b0c1 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 20 Apr 2021 15:25:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=B2=E8=AF=BB=E6=9C=AA=E8=AF=BB=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E6=96=B0=E5=A2=9E=E6=B7=BB=E5=8A=A0=E7=BB=84=E9=95=BF?= =?UTF-8?q?=E5=B7=B2=E8=AF=BB=E8=AE=B0=E5=BD=95=EF=BC=8C=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=B8=8D=E6=9F=A5=E8=AF=A2=E7=BB=84=E9=95=BF?= =?UTF-8?q?=E5=B7=B2=E8=AF=BB=E6=9C=AA=E8=AF=BB=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/modules/notice/dao/NoticeDao.java | 8 ++++- .../impl/NoticeReafdRecordServiceImpl.java | 6 ++++ .../service/impl/NoticeServiceImpl.java | 36 ++++++++++--------- .../resources/mapper/notice/NoticeDao.xml | 14 ++++++++ 4 files changed, 47 insertions(+), 17 deletions(-) diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeDao.java index 2cab9440db..4ee6056a2b 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeDao.java @@ -20,6 +20,7 @@ package com.epmet.modules.notice.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.modules.notice.entity.NoticeEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 小组通知表 @@ -29,5 +30,10 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface NoticeDao extends BaseDao { - + + /** + * @Author sun + * @Description 查询通知对应的小组的组长Id + **/ + String selectNoticeGroupLeader(@Param("noticeId") String noticeId); } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeReafdRecordServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeReafdRecordServiceImpl.java index 11507e85ba..e45a250a0d 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeReafdRecordServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeReafdRecordServiceImpl.java @@ -28,6 +28,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.modules.notice.dao.NoticeDao; import com.epmet.modules.notice.dao.NoticeReafdRecordDao; import com.epmet.modules.notice.entity.NoticeReafdRecordEntity; import com.epmet.modules.notice.redis.NoticeReafdRecordRedis; @@ -60,6 +61,8 @@ public class NoticeReafdRecordServiceImpl extends BaseServiceImpl page(Map params) { @@ -124,6 +127,9 @@ public class NoticeReafdRecordServiceImpl extends BaseServiceImpl readList = new ArrayList<>(); List unReadList = new ArrayList<>(); + //0.查询通知对应的小组的组长Id + String leaderId = noticeDao.selectNoticeGroupLeader(formDTO.getNoticeId()); + //1.根据通知Id查询组成员已读未读数据 List list = baseDao.getByNoticeId(formDTO.getNoticeId()); diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java index 8ef6c3dcc4..5b7cd69be3 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java @@ -275,16 +275,18 @@ public class NoticeServiceImpl extends BaseServiceImpl //6.通知已读未读表初始数据 List reafdRecordList = new ArrayList<>(); memberList.forEach(m -> { - if (!"".equals(m.getGroupLeaderFlag())) { - NoticeReafdRecordEntity reafdRecord = new NoticeReafdRecordEntity(); - reafdRecord.setCustomerId(resultDTO.getCustomerId()); - reafdRecord.setGridId(groupEntity.getGridId()); - reafdRecord.setGroupId(formDTO.getGroupId()); - reafdRecord.setNoticeId(entity.getId()); - reafdRecord.setUserId(m.getCustomerUserId()); + NoticeReafdRecordEntity reafdRecord = new NoticeReafdRecordEntity(); + reafdRecord.setCustomerId(resultDTO.getCustomerId()); + reafdRecord.setGridId(groupEntity.getGridId()); + reafdRecord.setGroupId(formDTO.getGroupId()); + reafdRecord.setNoticeId(entity.getId()); + reafdRecord.setUserId(m.getCustomerUserId()); + if ("leader".equals(m.getGroupLeaderFlag())) { + reafdRecord.setReadFlag(ReadFlagConstant.READ); + }else { reafdRecord.setReadFlag(ReadFlagConstant.UN_READ); - reafdRecordList.add(reafdRecord); } + reafdRecordList.add(reafdRecord); }); if (reafdRecordList.size() > NumConstant.ZERO) { noticeReafdRecordService.insertBatch(reafdRecordList); @@ -394,16 +396,18 @@ public class NoticeServiceImpl extends BaseServiceImpl noticeReafdRecordDao.delByNoticeId(formDTO.getNoticeId()); List reafdRecordList = new ArrayList<>(); memberList.forEach(m -> { - if (!"".equals(m.getGroupLeaderFlag())) { - NoticeReafdRecordEntity reafdRecord = new NoticeReafdRecordEntity(); - reafdRecord.setCustomerId(entity.getCustomerId()); - reafdRecord.setGridId(entity.getGridId()); - reafdRecord.setGroupId(entity.getGroupId()); - reafdRecord.setNoticeId(entity.getId()); - reafdRecord.setUserId(m.getCustomerUserId()); + NoticeReafdRecordEntity reafdRecord = new NoticeReafdRecordEntity(); + reafdRecord.setCustomerId(entity.getCustomerId()); + reafdRecord.setGridId(entity.getGridId()); + reafdRecord.setGroupId(entity.getGroupId()); + reafdRecord.setNoticeId(entity.getId()); + reafdRecord.setUserId(m.getCustomerUserId()); + if ("leader".equals(m.getGroupLeaderFlag())) { + reafdRecord.setReadFlag(ReadFlagConstant.READ); + }else { reafdRecord.setReadFlag(ReadFlagConstant.UN_READ); - reafdRecordList.add(reafdRecord); } + reafdRecordList.add(reafdRecord); }); if (reafdRecordList.size() > NumConstant.ZERO) { noticeReafdRecordService.insertBatch(reafdRecordList); diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeDao.xml index 7f7dc8e127..332dfa0b5c 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeDao.xml @@ -3,5 +3,19 @@ + \ No newline at end of file