From 04cfb172669d2244034421bcced7a6b715fd00f1 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 21 Apr 2021 12:57:21 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=E6=80=BB=E7=BB=93=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/modules/act/controller/ActSummaryController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/ActSummaryController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/ActSummaryController.java index 0504bac3d6..01bcde1ed5 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/ActSummaryController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/ActSummaryController.java @@ -51,7 +51,7 @@ public class ActSummaryController { **/ @PostMapping("inittem") public Result initTemplate(@RequestBody InitTemplateFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO, InitTemplateFormDTO.class); + ValidatorUtils.validateEntity(formDTO, InitTemplateFormDTO.AddUserInternalGroup.class); return new Result().ok(actSummaryService.initTemplate(formDTO)); } } \ No newline at end of file From 8bee2f9c9cf7b016cebb2a99867fd9d9ed9d1af1 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 21 Apr 2021 14:20:11 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E8=BF=9110=E6=9D=A1=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../group/result/UserReadFlagResultDTO.java | 28 ++++ .../dto/group/result/UserUnReadResultDTO.java | 26 +++ .../topic/result/GetLatestV2ResultDTO.java | 10 +- .../dto/topic/result/LatestTenResultDTO.java | 4 +- .../epmet/modules/group/dao/ResiGroupDao.java | 36 +++++ .../member/dao/ResiGroupMemberDao.java | 9 ++ .../service/impl/ResiTopicServiceImpl.java | 106 +++++++++++- .../epmet/modules/utils/ModuleConstant.java | 5 + .../resources/mapper/group/ResiGroupDao.xml | 153 ++++++++++++++++++ .../mapper/member/ResiGroupMemberDao.xml | 11 ++ .../epmet/dto/result/UserInfoResultDTO.java | 28 ++++ 11 files changed, 408 insertions(+), 8 deletions(-) create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/UserReadFlagResultDTO.java create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/UserUnReadResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoResultDTO.java diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/UserReadFlagResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/UserReadFlagResultDTO.java new file mode 100644 index 0000000000..aec2c9f63f --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/UserReadFlagResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.resi.group.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/4/21 上午9:43 + * @DESC + */ +@Data +public class UserReadFlagResultDTO implements Serializable { + + private static final long serialVersionUID = -5727870985731706332L; + + /** + * 活动,通知 ID + */ + private String id; + + private String userId; + + /** + * 阅读状态,read:已读,un_read:未读 + */ + private String readFlag; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/UserUnReadResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/UserUnReadResultDTO.java new file mode 100644 index 0000000000..cf602385ea --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/UserUnReadResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.resi.group.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/4/21 上午9:43 + * @DESC + */ +@Data +public class UserUnReadResultDTO implements Serializable { + + private static final long serialVersionUID = -5727870085731706332L; + + /** + * 活动,通知 ID + */ + private String id; + + /** + * 未读数量 + */ + private Integer unRead; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GetLatestV2ResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GetLatestV2ResultDTO.java index ee37afd1bf..5a5e707f73 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GetLatestV2ResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GetLatestV2ResultDTO.java @@ -26,19 +26,19 @@ public class GetLatestV2ResultDTO implements Serializable { private String groupType; /** - * 是否显示通知按钮 + * 是否显示通知按钮(当前人员是否为组长) */ - private String noticeBut; + private Boolean noticeBut = false; /** - * 是否显示活动按钮 + * 是否显示活动按钮(当前组为支部组且当前人是组长) */ - private String actBut; + private Boolean actBut = false; /** * 是否存在未读消息 */ - private Boolean unReadNews; + private Boolean unReadNews = false; /** * 近十条数据 diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/LatestTenResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/LatestTenResultDTO.java index 0f8d7c3222..8efe0feebe 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/LatestTenResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/LatestTenResultDTO.java @@ -53,7 +53,7 @@ public class LatestTenResultDTO implements Serializable { /** * 是否本人 */ - private String releaseUserFlag; + private Boolean releaseUserFlag; /** * 如果有图片,后台只返回第一张,没有图片此列为空 @@ -93,7 +93,7 @@ public class LatestTenResultDTO implements Serializable { this.releaseTimed = ""; this.content = ""; this.status = ""; - this.releaseUserFlag = ""; + this.releaseUserFlag = false; this.firstPhoto = ""; this.issueId = ""; this.shiftIssueFlag = false; diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java index b15f08293f..59e959b97f 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java @@ -24,6 +24,7 @@ import com.epmet.resi.group.dto.group.ResiGroupDTO; import com.epmet.resi.group.dto.group.form.*; import com.epmet.resi.group.dto.group.result.*; import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; +import com.epmet.resi.group.dto.topic.result.LatestTenResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -241,4 +242,39 @@ public interface ResiGroupDao extends BaseDao { * @Description 分页查询网格下所有小组列表 **/ List selectAllGroupList(AllGroupListFormDTO formDTO); + + /** + * @Description 查询 话题、通知、活动最近10条数据 + * @Param groupId + * @author zxc + * @date 2021/4/20 下午4:14 + */ + List selectLatestTen(@Param("groupId")String groupId); + + /** + * @Description 查询此人在小组内未读数量 + * @Param groupId + * @Param userId + * @author zxc + * @date 2021/4/20 下午5:23 + */ + Integer selectUserUnRead(@Param("groupId")String groupId,@Param("userId")String userId); + + /** + * @Description 查询阅读状态 + * @Param groupId + * @Param userId + * @author zxc + * @date 2021/4/21 上午9:45 + */ + List selectUserReadFlag(@Param("groupId")String groupId,@Param("userIds")List userIds,@Param("ids")List ids); + + /** + * @Description 根据 活动或通知查询 未读人数 + * @Param groupId + * @Param ids + * @author zxc + * @date 2021/4/21 上午10:22 + */ + List selectUserUnReadById(@Param("groupId")String groupId,@Param("ids")List ids); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/ResiGroupMemberDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/ResiGroupMemberDao.java index 6c6618cc9a..4205eb483d 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/ResiGroupMemberDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/ResiGroupMemberDao.java @@ -159,4 +159,13 @@ public interface ResiGroupMemberDao extends BaseDao { * @Date 2021/4/19 13:54 **/ Integer selectCountMember(String groupId); + + /** + * @Description 查询此人组内身份 + * @Param groupId + * @Param userId + * @author zxc + * @date 2021/4/20 下午4:03 + */ + String selectUserRole(@Param("groupId")String groupId, @Param("userId")String userId); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index f3a4bb6f71..ed1a9c2aaa 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -82,6 +82,8 @@ import com.epmet.resi.group.dto.comment.form.ResiQueryCommentFormDTO; import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO; import com.epmet.resi.group.dto.group.ResiGroupInfoRedisDTO; import com.epmet.resi.group.dto.group.ResiGroupStatisticalInfoRedisDTO; +import com.epmet.resi.group.dto.group.result.UserReadFlagResultDTO; +import com.epmet.resi.group.dto.group.result.UserUnReadResultDTO; import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; import com.epmet.resi.group.dto.member.ResiGroupMemberInfoRedisDTO; import com.epmet.resi.group.dto.member.form.RemoveMemberFormDTO; @@ -109,6 +111,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import javax.validation.constraints.NotBlank; import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -2190,7 +2193,108 @@ public class ResiTopicServiceImpl extends BaseServiceImpl NumConstant.ZERO){ + // 存在未读消息 + result.setUnReadNews(true); + } + // 查询 话题、通知、活动最近10条记录 + List latestTenData = resiGroupDao.selectLatestTen(groupId); + if (CollectionUtils.isEmpty(latestTenData)){ + result.setList(new ArrayList<>()); + return result; + } + // 活动、通知、话题 创建者ID集合 + List userIds = latestTenData.stream().map(m -> m.getUserId()).collect(Collectors.toList()); + // 活动、通知、话题 ID集合 + List ids = latestTenData.stream().map(m -> m.getId()).collect(Collectors.toList()); + List userInfos = disPoseUserInfo(result.getGroupType(), userIds); + // 查询用户的 活动或通知的 阅读状态 + List userReadFlag = resiGroupDao.selectUserReadFlag(groupId, userIds, ids); + // 查询小组下的 通知或活动 未读人数 + List userUnReadCount = resiGroupDao.selectUserUnReadById(groupId, ids); + latestTenData.forEach(l -> { + // 是否转议题,true:是,false:不是 + l.setShiftIssueFlag(StringUtils.isNotEmpty(l.getIssueId())); + // 是不是本人,true:是,false:不是 + l.setReleaseUserFlag(userId.equals(l.getUserId())); + // 用户的名字,头像赋值 + if (!CollectionUtils.isEmpty(userIds)){ + userInfos.forEach(u -> { + if (l.getUserId().equals(u.getUserId())){ + l.setReleaseUserName(u.getReleaseUserName()); + l.setReleaseUserHeadPhoto(u.getReleaseUserHeadPhoto()); + } + }); + } + // 用户已读,未读 + if (!CollectionUtils.isEmpty(userReadFlag)){ + userReadFlag.forEach(u -> { + if (l.getUserId().equals(u.getUserId()) && l.getId().equals(u.getId())){ + l.setReadOrUnRead(u.getReadFlag()); + } + }); + } + // 活动,通知未读人数 + if (!CollectionUtils.isEmpty(userUnReadCount)){ + userUnReadCount.forEach(u -> { + if (l.getId().equals(u.getId())){ + l.setUnReadCount(u.getUnRead()); + } + }); + } + }); + return result; + } + + /** + * @Description 查询用户信息【头像,名字】 + * @Param groupType + * @Param userIds + * @author zxc + * @date 2021/4/20 下午5:54 + */ + public List disPoseUserInfo(String groupType,List userIds){ + List result = new ArrayList<>(); + Result> userInfo = userOpenFeignClient.queryUserBaseInfo(userIds); + if (!userInfo.success()){ + throw new RenException(ModuleConstant.GET_USER_INFO_ERR); + } + List userInfos = userInfo.getData(); + if (CollectionUtils.isEmpty(userInfos)){ + return new ArrayList<>(); + } + userInfos.forEach(u -> { + UserInfoResultDTO ui = new UserInfoResultDTO(); + ui.setUserId(u.getUserId()); + ui.setReleaseUserHeadPhoto(u.getHeadImgUrl()); + if (groupType.equals(ModuleConstant.GROUP_TYPE_BRANCH)){ + ui.setReleaseUserName(u.getRealName()); + }else { + ui.setReleaseUserName(u.getShowName()); + } + result.add(ui); + }); + if (CollectionUtils.isEmpty(result)){ + return new ArrayList<>(); + } + return result; } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java index 1d77920606..15334f14e9 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java @@ -387,4 +387,9 @@ public interface ModuleConstant extends Constant { String GROUP_TYPE_BRANCH = "branch"; String IS_PARTY_MEMBER_ERR = "查询此人是不是党员失败了"; + + String GROUP_MEMBER_FLAG = "leader"; + + String GET_USER_INFO_ERR = "查询用户信息失败了"; + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml index fc8a6280f1..c077e284ac 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml @@ -550,4 +550,157 @@ #{pageNo}, #{pageSize} + + + + + + + + + + + + diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/member/ResiGroupMemberDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/member/ResiGroupMemberDao.xml index ac0217c6fe..7cf0ffb00a 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/member/ResiGroupMemberDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/member/ResiGroupMemberDao.xml @@ -215,4 +215,15 @@ rgm.RESI_GROUP_ID = #{groupId} AND rgm.DEL_FLAG = '0' + + + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoResultDTO.java new file mode 100644 index 0000000000..cccc7c04ce --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/4/20 下午5:51 + * @DESC + */ +@Data +public class UserInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 6003815400792121273L; + + private String userId; + + /** + * 发布者的全称(街道-姓氏先生/女士)【专项组显示真实名】 + */ + private String releaseUserName; + + /** + * 话题发布者的头像Url + */ + private String releaseUserHeadPhoto; +} From b665709ee0f6de90f2b61007bc18fb391afad859 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 21 Apr 2021 14:52:53 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/group/form/AllGroupListFormDTO.java | 7 ++- .../dto/notice/form/AddNoticeFormDTO.java | 12 +++- .../dto/notice/form/EditNoticeFormDTO.java | 13 ++++- .../dto/notice/form/NoticeCommentFormDTO.java | 5 ++ .../notice/form/NoticeCommentListFormDTO.java | 2 +- .../group/dto/notice/form/NoticeFileDTO.java | 23 ++++++++ .../dto/notice/form/ReadTypeFormDTO.java | 5 ++ .../group/controller/ResiGroupController.java | 9 +-- .../group/service/ResiGroupService.java | 3 +- .../service/impl/ResiGroupServiceImpl.java | 7 +-- .../controller/NoticeCommentController.java | 22 +++---- .../notice/controller/NoticeController.java | 21 ++----- .../NoticeReadRecordController.java | 24 +++----- .../notice/dao/NoticeReadRecordDao.java | 4 +- .../notice/service/NoticeCommentService.java | 8 +-- .../service/NoticeReadRecordService.java | 10 +--- .../modules/notice/service/NoticeService.java | 11 +--- .../impl/NoticeCommentServiceImpl.java | 22 +++---- .../impl/NoticeReadRecordServiceImpl.java | 19 ++---- .../service/impl/NoticeServiceImpl.java | 58 +++++++++---------- .../mapper/notice/NoticeReadRecordDao.xml | 7 ++- 21 files changed, 140 insertions(+), 152 deletions(-) create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeFileDTO.java diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/AllGroupListFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/AllGroupListFormDTO.java index 32d4164244..232d6b647e 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/AllGroupListFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/AllGroupListFormDTO.java @@ -23,12 +23,17 @@ public class AllGroupListFormDTO implements Serializable { * 请求页码 */ @Min(1) - private int pageNo; + private int pageNo = 1; /** * 每页多少条数据 */ private int pageSize = 20; + /** + * token中用户Id + */ + private String userId; + public interface GroupList { } } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/AddNoticeFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/AddNoticeFormDTO.java index d9345790fe..2344e94898 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/AddNoticeFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/AddNoticeFormDTO.java @@ -1,7 +1,6 @@ package com.epmet.resi.group.dto.notice.form; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; -import com.epmet.resi.group.dto.topic.form.FileDTO; import lombok.Data; import org.hibernate.validator.constraints.Length; @@ -35,12 +34,19 @@ public class AddNoticeFormDTO { /** * 图片附件集合 */ - private List imageList; + private List imageList; /** * 文件附件url集合 */ - private List docList; + private List docList; + + /** + * token中用户Id + */ + private String userId; public interface Add{} public interface AddUserShow extends CustomerClientShowGroup {} + + } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/EditNoticeFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/EditNoticeFormDTO.java index 08573cae19..940077459f 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/EditNoticeFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/EditNoticeFormDTO.java @@ -1,7 +1,6 @@ package com.epmet.resi.group.dto.notice.form; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; -import com.epmet.resi.group.dto.topic.form.FileDTO; import lombok.Data; import org.hibernate.validator.constraints.Length; @@ -23,22 +22,30 @@ public class EditNoticeFormDTO { /** * 通知标题 */ + @NotBlank(message = "通知标题不能为空",groups = {EditNoticeFormDTO.EditUserShow.class}) @Length(max = 20, message = "通知标题不能超过20个字符",groups = {EditNoticeFormDTO.EditUserShow.class}) private String title; /** * 通知内容 */ + @NotBlank(message = "通知内容不能为空",groups = {EditNoticeFormDTO.EditUserShow.class}) @Length(max = 1000, message = "通知内容不能超过1000个字符",groups = {EditNoticeFormDTO.EditUserShow.class}) private String content; /** * 图片附件集合 */ - private List imageList; + private List imageList; /** * 文件附件url集合 */ - private List docList; + private List docList; + + /** + * token中用户Id + */ + private String userId; public interface Edit{} public interface EditUserShow extends CustomerClientShowGroup {} + } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java index 5fc28f52ef..c543bf7222 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java @@ -25,6 +25,11 @@ public class NoticeCommentFormDTO { @Length(max = 20, message = "评论内容不能超过300个字符",groups = {NoticeCommentFormDTO.UserShow.class}) private String commentContent; + /** + * token中用户Id + */ + private String userId; + public interface Comment{} public interface UserShow extends CustomerClientShowGroup {} } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentListFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentListFormDTO.java index 960ba374e5..8d9ad97476 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentListFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentListFormDTO.java @@ -23,7 +23,7 @@ public class NoticeCommentListFormDTO implements Serializable { * 请求页码 * */ @Min(1) - private int pageNo; + private int pageNo = 1; /** * 每页多少条数据 * */ diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeFileDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeFileDTO.java new file mode 100644 index 0000000000..a71ac3d509 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeFileDTO.java @@ -0,0 +1,23 @@ +package com.epmet.resi.group.dto.notice.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 小组通知保存、变更-接口入参 + */ +@NoArgsConstructor +@Data +public class NoticeFileDTO implements Serializable { + + private static final long serialVersionUID = -3930520724652521552L; + private String name; + private String url; + private String type; + private String format; + private Integer size; + private Integer duration; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/ReadTypeFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/ReadTypeFormDTO.java index f3170ebc9b..6477c87fb8 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/ReadTypeFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/ReadTypeFormDTO.java @@ -17,5 +17,10 @@ public class ReadTypeFormDTO { @NotBlank(message = "通知Id不能为空",groups = {ReadTypeFormDTO.Read.class}) private String noticeId; + /** + * token中用户Id + */ + private String userId; + public interface Read{} } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java index 1d77fc28b9..f9f38417d8 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java @@ -31,18 +31,12 @@ import com.epmet.resi.group.dto.group.form.*; import com.epmet.resi.group.dto.group.result.*; import com.epmet.resi.group.dto.member.form.EditAuditSwitchFormDTO; import com.epmet.resi.group.dto.member.form.ResiIdentityFormDTO; -import com.epmet.resi.group.dto.notice.form.NoticeCommentListFormDTO; -import com.epmet.resi.group.dto.notice.result.NoticeCommentListResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import java.util.HashMap; import java.util.List; @@ -513,7 +507,8 @@ public class ResiGroupController { @PostMapping(value = "allgrouplist") public Result> allGroupList(@LoginUser TokenDto tokenDto, @RequestBody AllGroupListFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, AllGroupListFormDTO.GroupList.class); - return new Result>().ok(resiGroupService.allGroupList(tokenDto, formDTO)); + formDTO.setUserId(tokenDto.getUserId()); + return new Result>().ok(resiGroupService.allGroupList(formDTO)); } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java index a27d726fc8..c2073a7952 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java @@ -20,7 +20,6 @@ package com.epmet.modules.group.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.modules.group.entity.ResiGroupEntity; import com.epmet.resi.group.dto.UserRoleDTO; @@ -378,5 +377,5 @@ public interface ResiGroupService extends BaseService { * @Author sun * @Description 所有小组查询 **/ - List allGroupList(TokenDto tokenDto, AllGroupListFormDTO formDTO); + List allGroupList(AllGroupListFormDTO formDTO); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java index 6cc56ca171..5a54c45f06 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java @@ -30,7 +30,6 @@ import com.epmet.commons.tools.scan.param.ImgTaskDTO; import com.epmet.commons.tools.scan.param.TextScanParamDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO; import com.epmet.commons.tools.scan.result.SyncScanResult; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; @@ -1500,7 +1499,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl allGroupList(TokenDto tokenDto, AllGroupListFormDTO formDTO) { + public List allGroupList(AllGroupListFormDTO formDTO) { //1.分页查询网格下所有小组列表且是审核通过状态的,以组内人员数从多到少排序 int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); formDTO.setPageNo(pageIndex); @@ -1511,7 +1510,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl> resultDTOList = epmetUserOpenFeignClient.getUserRoleInfoByUserId(tokenDto.getUserId()); + Result> resultDTOList = epmetUserOpenFeignClient.getUserRoleInfoByUserId(formDTO.getUserId()); if (!resultDTOList.success()) { throw new RenException("调用user服务,获取用户基础数据失败"); } @@ -1529,7 +1528,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl> noticeCommentList(@LoginUser TokenDto tokenDto, @RequestBody NoticeCommentListFormDTO formDTO){ + public Result> noticeCommentList(@RequestBody NoticeCommentListFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, NoticeCommentListFormDTO.CommentList.class); - return new Result>().ok(noticeCommentService.noticeCommentList(tokenDto, formDTO)); + return new Result>().ok(noticeCommentService.noticeCommentList(formDTO)); } } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeController.java index 02d6bf79ec..ad2a0dd9dc 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeController.java @@ -18,16 +18,9 @@ package com.epmet.modules.notice.controller; import com.epmet.commons.tools.annotation.LoginUser; -import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.commons.tools.validator.group.AddGroup; -import com.epmet.commons.tools.validator.group.DefaultGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; -import com.epmet.modules.notice.excel.NoticeExcel; import com.epmet.modules.notice.service.NoticeService; import com.epmet.resi.group.dto.notice.NoticeDTO; import com.epmet.resi.group.dto.notice.form.AddNoticeFormDTO; @@ -37,10 +30,6 @@ import com.epmet.resi.group.dto.notice.result.NoticeDetailResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletResponse; -import java.util.List; -import java.util.Map; - /** * 小组通知表 @@ -70,7 +59,8 @@ public class NoticeController { @PostMapping(value = "add") public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddNoticeFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, AddNoticeFormDTO.Add.class, AddNoticeFormDTO.AddUserShow.class); - noticeService.add(tokenDto, formDTO); + formDTO.setUserId(tokenDto.getUserId()); + noticeService.add(formDTO); return new Result(); } @@ -83,7 +73,8 @@ public class NoticeController { @PostMapping(value = "edit") public Result edit(@LoginUser TokenDto tokenDto, @RequestBody EditNoticeFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, EditNoticeFormDTO.Edit.class, EditNoticeFormDTO.EditUserShow.class); - noticeService.edit(tokenDto, formDTO); + formDTO.setUserId(tokenDto.getUserId()); + noticeService.edit(formDTO); return new Result(); } @@ -94,9 +85,9 @@ public class NoticeController { * @Description 小组通知详情 **/ @PostMapping(value = "noticedetail") - public Result noticeDetail(@LoginUser TokenDto tokenDto, @RequestBody NoticeDetailFormDTO formDTO){ + public Result noticeDetail(@RequestBody NoticeDetailFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, NoticeDetailFormDTO.Detail.class); - return new Result().ok(noticeService.noticeDetail(tokenDto, formDTO)); + return new Result().ok(noticeService.noticeDetail(formDTO)); } } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeReadRecordController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeReadRecordController.java index ca1dcf86b2..a4b992fd0f 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeReadRecordController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeReadRecordController.java @@ -18,27 +18,18 @@ package com.epmet.modules.notice.controller; import com.epmet.commons.tools.annotation.LoginUser; -import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.commons.tools.validator.group.AddGroup; -import com.epmet.commons.tools.validator.group.DefaultGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; -import com.epmet.modules.notice.excel.NoticeReadRecordExcel; import com.epmet.modules.notice.service.NoticeReadRecordService; -import com.epmet.resi.group.dto.notice.NoticeReadRecordDTO; import com.epmet.resi.group.dto.notice.form.NoticeReadListFormDTO; import com.epmet.resi.group.dto.notice.form.ReadTypeFormDTO; import com.epmet.resi.group.dto.notice.result.NoticeReadListResultDTO; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletResponse; -import java.util.List; -import java.util.Map; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; /** @@ -61,9 +52,9 @@ public class NoticeReadRecordController { * @Description 通知已读未读列表查询 **/ @PostMapping(value = "noticereadlist") - public Result noticeReadList(@LoginUser TokenDto tokenDto, @RequestBody NoticeReadListFormDTO formDTO){ + public Result noticeReadList(@RequestBody NoticeReadListFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, NoticeReadListFormDTO.List.class); - return new Result().ok(noticeReafdRecordService.noticeReadList(tokenDto, formDTO)); + return new Result().ok(noticeReafdRecordService.noticeReadList(formDTO)); } /** @@ -75,7 +66,8 @@ public class NoticeReadRecordController { @PostMapping(value = "readtype") public Result readType(@LoginUser TokenDto tokenDto, @RequestBody ReadTypeFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, ReadTypeFormDTO.Read.class); - noticeReafdRecordService.readType(tokenDto, formDTO); + formDTO.setUserId(tokenDto.getUserId()); + noticeReafdRecordService.readType(formDTO); return new Result(); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeReadRecordDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeReadRecordDao.java index 2375b63db6..3842c4fd98 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeReadRecordDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeReadRecordDao.java @@ -42,9 +42,9 @@ public interface NoticeReadRecordDao extends BaseDao { /** * @Author sun - * @Description 根据通知Id查询组成员已读未读数据 + * @Description 根据通知Id查询组成员已读未读数据,抛去组长数据 **/ - List getByNoticeId(@Param("noticeId") String noticeId); + List getByNoticeId(@Param("noticeId") String noticeId, @Param("leaderId") String leaderId); /** * @Author sun diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentService.java index 6e3a82690d..0ac50c21e7 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentService.java @@ -18,16 +18,12 @@ package com.epmet.modules.notice.service; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.modules.notice.entity.NoticeCommentEntity; -import com.epmet.resi.group.dto.notice.NoticeCommentDTO; import com.epmet.resi.group.dto.notice.form.NoticeCommentFormDTO; import com.epmet.resi.group.dto.notice.form.NoticeCommentListFormDTO; import com.epmet.resi.group.dto.notice.result.NoticeCommentListResultDTO; import java.util.List; -import java.util.Map; /** * 小组通知评论表 @@ -43,7 +39,7 @@ public interface NoticeCommentService extends BaseService { * @Author sun * @Description 发布通知评论 **/ - void noticeComment(TokenDto tokenDto, NoticeCommentFormDTO formDTO); + void noticeComment(NoticeCommentFormDTO formDTO); /** * @param formDTO @@ -51,5 +47,5 @@ public interface NoticeCommentService extends BaseService { * @Author sun * @Description 通知评论列表查询 **/ - List noticeCommentList(TokenDto tokenDto, NoticeCommentListFormDTO formDTO); + List noticeCommentList(NoticeCommentListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeReadRecordService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeReadRecordService.java index 17d41252c0..fd4a4d6d4b 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeReadRecordService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeReadRecordService.java @@ -18,17 +18,11 @@ package com.epmet.modules.notice.service; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.modules.notice.entity.NoticeReadRecordEntity; -import com.epmet.resi.group.dto.notice.NoticeReadRecordDTO; import com.epmet.resi.group.dto.notice.form.NoticeReadListFormDTO; import com.epmet.resi.group.dto.notice.form.ReadTypeFormDTO; import com.epmet.resi.group.dto.notice.result.NoticeReadListResultDTO; -import java.util.List; -import java.util.Map; - /** * 小组通知组成员阅读记录表 * @@ -43,7 +37,7 @@ public interface NoticeReadRecordService extends BaseService { * @Author sun * @Description 小组通知保存 **/ - void add(TokenDto tokenDto, AddNoticeFormDTO formDTO); + void add(AddNoticeFormDTO formDTO); /** * @param formDTO @@ -62,7 +57,7 @@ public interface NoticeService extends BaseService { * @Author sun * @Description 小组通知变更 **/ - void edit(TokenDto tokenDto, EditNoticeFormDTO formDTO); + void edit(EditNoticeFormDTO formDTO); /** * @param formDTO @@ -70,5 +65,5 @@ public interface NoticeService extends BaseService { * @Author sun * @Description 小组通知详情 **/ - NoticeDetailResultDTO noticeDetail(TokenDto tokenDto, NoticeDetailFormDTO formDTO); + NoticeDetailResultDTO noticeDetail(NoticeDetailFormDTO formDTO); } \ 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/NoticeCommentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java index 4bd79318c2..b4ee53de76 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java @@ -17,19 +17,13 @@ package com.epmet.modules.notice.service.impl; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; -import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.scan.param.TextScanParamDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO; import com.epmet.commons.tools.scan.result.SyncScanResult; -import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.dto.result.UserBaseInfoResultDTO; @@ -43,9 +37,7 @@ import com.epmet.modules.notice.service.NoticeService; import com.epmet.modules.utils.ModuleConstant; import com.epmet.resi.group.constant.MemberStateConstant; import com.epmet.resi.group.constant.TopicConstant; -import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO; import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; -import com.epmet.resi.group.dto.notice.NoticeCommentDTO; import com.epmet.resi.group.dto.notice.NoticeDTO; import com.epmet.resi.group.dto.notice.form.NoticeCommentFormDTO; import com.epmet.resi.group.dto.notice.form.NoticeCommentListFormDTO; @@ -58,7 +50,9 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.*; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; import java.util.stream.Collectors; /** @@ -92,7 +86,7 @@ public class NoticeCommentServiceImpl extends BaseServiceImpl", formDTO.getNoticeId())); } ResiGroupMemberDTO resiGroupMemberDTO = - resiGroupMemberService.getResiGroupMember(notice.getGroupId(), tokenDto.getUserId()); + resiGroupMemberService.getResiGroupMember(notice.getGroupId(), formDTO.getUserId()); //查看当前用户是否被禁言或者被移除 if (null != resiGroupMemberDTO) { if (MemberStateConstant.SILENT.equals(resiGroupMemberDTO.getStatus())) { @@ -154,7 +148,7 @@ public class NoticeCommentServiceImpl extends BaseServiceImpl noticeCommentList(TokenDto tokenDto, NoticeCommentListFormDTO formDTO) { + public List noticeCommentList(NoticeCommentListFormDTO formDTO) { //1.分页查询通知评论列表 formDTO.setPageNo((formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize()); List resultList = baseDao.getNoticeCommentList(formDTO); diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeReadRecordServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeReadRecordServiceImpl.java index ad26bc805e..eac1b1b18d 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeReadRecordServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeReadRecordServiceImpl.java @@ -17,14 +17,8 @@ package com.epmet.modules.notice.service.impl; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.exception.RenException; -import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.ReadFlagConstant; import com.epmet.dto.result.UserBaseInfoResultDTO; @@ -45,9 +39,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; -import java.util.Map; import java.util.stream.Collectors; /** @@ -66,7 +58,6 @@ public class NoticeReadRecordServiceImpl extends BaseServiceImpl readList = new ArrayList<>(); List unReadList = new ArrayList<>(); @@ -82,7 +73,7 @@ public class NoticeReadRecordServiceImpl extends BaseServiceImpl list = baseDao.getByNoticeId(formDTO.getNoticeId()); + List list = baseDao.getByNoticeId(formDTO.getNoticeId(), leaderId); //2.调用user服务,查询人员基础数据 List userIdList = list.stream().map(NoticeReadRecordDTO::getUserId).collect(Collectors.toList()); @@ -132,9 +123,9 @@ public class NoticeReadRecordServiceImpl extends BaseServiceImpl @Autowired private EpmetUserOpenFeignClient epmetUserOpenFeignClient; @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; @Autowired private NoticeAttachmentService noticeAttachmentService; @@ -111,7 +110,7 @@ public class NoticeServiceImpl extends BaseServiceImpl @Autowired private NoticeReadRecordService noticeReafdRecordService; @Autowired - private NoticeReadRecordDao noticeReafdRecordDao; + private NoticeReadRecordDao noticeReadRecordDao; @Override @@ -128,7 +127,7 @@ public class NoticeServiceImpl extends BaseServiceImpl **/ @Override @Transactional(rollbackFor = Exception.class) - public void add(TokenDto tokenDto, AddNoticeFormDTO formDTO) { + public void add(AddNoticeFormDTO formDTO) { //1.查询组内成员数据 List memberList = resiGroupMemberDao.getMemberList(formDTO.getGroupId()); if (CollUtil.isEmpty(memberList)) { @@ -138,7 +137,7 @@ public class NoticeServiceImpl extends BaseServiceImpl //2.校验当前操作人员是否为组长 AtomicReference bl = new AtomicReference<>(true); memberList.forEach(m -> { - if (m.getCustomerUserId().equals(tokenDto.getUserId()) && "leader".equals(m.getGroupLeaderFlag())) { + if (m.getCustomerUserId().equals(formDTO.getUserId()) && "leader".equals(m.getGroupLeaderFlag())) { bl.set(false); } }); @@ -150,30 +149,27 @@ public class NoticeServiceImpl extends BaseServiceImpl List wordList = new ArrayList<>(); wordList.add(formDTO.getTitle()); wordList.add(formDTO.getContent()); - List imageList = formDTO.getImageList().stream().map(FileDTO::getUrl).collect(Collectors.toList()); + List imageList = formDTO.getImageList().stream().map(NoticeFileDTO::getUrl).collect(Collectors.toList()); safetyCheck(wordList, imageList); //4.保存小组通知基础数据 //4-1.获取小组信息 ResiGroupEntity groupEntity = resiGroupDao.selectById(formDTO.getGroupId()); if (null == groupEntity) { - throw new RenException(String.format("保存小组通知,获取小组数据失败,小组Id->", tokenDto.getUserId())); + throw new RenException(String.format("保存小组通知,获取小组数据失败,小组Id->", formDTO.getUserId())); } //4-2.获取token用户所属组织信息 - LoginUserDetailsFormDTO dto = new LoginUserDetailsFormDTO(); - dto.setApp(tokenDto.getApp()); - dto.setClient(tokenDto.getClient()); - dto.setUserId(tokenDto.getUserId()); - Result result = epmetUserOpenFeignClient.getLoginUserDetails(dto); - if (!result.success() || org.springframework.util.StringUtils.isEmpty(result.getData().getAgencyId())) { - throw new RenException(String.format("调用user服务查询用户数据失败,userId->", tokenDto.getUserId())); + Result result = govOrgOpenFeignClient.queryGridInfo(groupEntity.getGridId()); + if (!result.success() || org.springframework.util.StringUtils.isEmpty(result.getData().getParentAgencyId())) { + throw new RenException(String.format("调用user服务查询用户数据失败,userId->", formDTO.getUserId())); } - LoginUserDetailsResultDTO resultDTO = result.getData(); + GridInfoResultDTO resultDTO = result.getData(); + //4-3.保存通知数据 NoticeEntity entity = new NoticeEntity(); entity.setCustomerId(resultDTO.getCustomerId()); - entity.setAgencyId(resultDTO.getAgencyId()); + entity.setAgencyId(resultDTO.getParentAgencyId()); entity.setGridId(groupEntity.getGridId()); entity.setGroupId(formDTO.getGroupId()); entity.setTitle(formDTO.getTitle()); @@ -237,7 +233,7 @@ public class NoticeServiceImpl extends BaseServiceImpl if ("leader".equals(m.getGroupLeaderFlag())) { reafdRecord.setReadFlag(ReadFlagConstant.READ); }else { - reafdRecord.setReadFlag(ReadFlagConstant.UN_READ); + reafdRecord.setReadFlag("un_read"); } reafdRecordList.add(reafdRecord); }); @@ -274,7 +270,7 @@ public class NoticeServiceImpl extends BaseServiceImpl * @Description 小组通知变更 **/ @Override - public void edit(TokenDto tokenDto, EditNoticeFormDTO formDTO) { + public void edit(EditNoticeFormDTO formDTO) { //1.查询通知是否存在 NoticeEntity entity = baseDao.selectById(formDTO.getNoticeId()); if (null == entity) { @@ -284,7 +280,7 @@ public class NoticeServiceImpl extends BaseServiceImpl List wordList = new ArrayList<>(); wordList.add(formDTO.getTitle()); wordList.add(formDTO.getContent()); - List imageList = formDTO.getImageList().stream().map(FileDTO::getUrl).collect(Collectors.toList()); + List imageList = formDTO.getImageList().stream().map(NoticeFileDTO::getUrl).collect(Collectors.toList()); safetyCheck(wordList, imageList); //3.查询组成员列表数据 @@ -346,7 +342,7 @@ public class NoticeServiceImpl extends BaseServiceImpl } //6.通知已读未读消息表数据先删后增 - noticeReafdRecordDao.delByNoticeId(formDTO.getNoticeId()); + noticeReadRecordDao.delByNoticeId(formDTO.getNoticeId()); List reafdRecordList = new ArrayList<>(); memberList.forEach(m -> { NoticeReadRecordEntity reafdRecord = new NoticeReadRecordEntity(); @@ -358,7 +354,7 @@ public class NoticeServiceImpl extends BaseServiceImpl if ("leader".equals(m.getGroupLeaderFlag())) { reafdRecord.setReadFlag(ReadFlagConstant.READ); }else { - reafdRecord.setReadFlag(ReadFlagConstant.UN_READ); + reafdRecord.setReadFlag("un_read"); } reafdRecordList.add(reafdRecord); }); @@ -370,7 +366,7 @@ public class NoticeServiceImpl extends BaseServiceImpl //7-1.获取小组信息 ResiGroupEntity groupEntity = resiGroupDao.selectById(entity.getGroupId()); if (null == groupEntity) { - throw new RenException(String.format("保存小组通知,获取小组数据失败,小组Id->", tokenDto.getUserId())); + throw new RenException(String.format("保存小组通知,获取小组数据失败,小组Id->", formDTO.getUserId())); } //7-2.推送站内信信息 List userMessageFormDTOS = new ArrayList<>(); @@ -400,7 +396,7 @@ public class NoticeServiceImpl extends BaseServiceImpl * @Description 小组通知详情 **/ @Override - public NoticeDetailResultDTO noticeDetail(TokenDto tokenDto, NoticeDetailFormDTO formDTO) { + public NoticeDetailResultDTO noticeDetail(NoticeDetailFormDTO formDTO) { NoticeDetailResultDTO resultDTO = new NoticeDetailResultDTO(); List imageList = new ArrayList<>(); List docList = new ArrayList<>(); diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeReadRecordDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeReadRecordDao.xml index 74b99c2e1b..3848b66959 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeReadRecordDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeReadRecordDao.xml @@ -7,17 +7,18 @@ SELECT * FROM - notice_reafd_record + notice_read_record WHERE del_flag = '0' AND notice_id = #{noticeId} + AND user_id != #{leaderId} + SELECT + M.CONTENT + FROM + act_summary_content m + WHERE + m.DEL_FLAG = '0' + AND m.GROUP_ACT_ID = #{groupActId} + AND m.act_summary_id = #{actSummaryId} + AND m.CONTENT_TYPE = #{contentType} + ORDER BY + m.SORT ASC + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActSummaryDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActSummaryDao.xml index 936bc6df1b..3782a2104c 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActSummaryDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActSummaryDao.xml @@ -3,6 +3,14 @@ - + \ No newline at end of file