diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/GroupMessageDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/GroupMessageDTO.java new file mode 100644 index 0000000000..7678968c5f --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/GroupMessageDTO.java @@ -0,0 +1,107 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.resi.group.dto.group; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 组内消息(话题、通知、活动)记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-04-22 + */ +@Data +public class GroupMessageDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 网格id + */ + private String gridId; + + private String groupId; + + /** + * 话题:topic; 通知:notice; 活动:act + */ + private String type; + + /** + * 话题id , 通知id,活动id + */ + private String messageId; + + /** + * 发布人用户id + */ + private String publishUserId; + + /** + * 话题状态(讨论中 - discussing、 已屏蔽 - hidden、 已关闭 - closed) + * 活动状态:已发布:published;已取消:canceled;已变更:changed;已关闭:closed + * 通知:已发布:published + */ + private String status; + + /** + * 逻辑删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + private Date operateTime; +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/GetPastTopicListV2FormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/GetPastTopicListV2FormDTO.java index ad41e9bf81..4c66b02c47 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/GetPastTopicListV2FormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/GetPastTopicListV2FormDTO.java @@ -18,11 +18,6 @@ public class GetPastTopicListV2FormDTO implements Serializable { public interface GetPastTopicListV2Form{} - /** - * null默认查询讨论中、已关闭,dicussing讨论中,closed关闭 - */ - private String status; - @NotBlank(message = "小组ID不能为空",groups = GetPastTopicListV2Form.class) private String groupId; diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GetPastTopicListV2ResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GetPastTopicListV2ResultDTO.java index fcc28ddec8..d0dbe33963 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GetPastTopicListV2ResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GetPastTopicListV2ResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.resi.group.dto.topic.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -74,4 +75,7 @@ public class GetPastTopicListV2ResultDTO implements Serializable { * 徽章Url集合 */ private List badgeList; + + @JsonIgnore + private String userId; } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java index 54a184983c..771435fad6 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java @@ -41,7 +41,10 @@ import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; -import com.epmet.modules.act.dao.*; +import com.epmet.modules.act.dao.ActOperationRecordDao; +import com.epmet.modules.act.dao.ActReadRecordDao; +import com.epmet.modules.act.dao.GroupActContentDao; +import com.epmet.modules.act.dao.GroupActInfoDao; import com.epmet.modules.act.entity.*; import com.epmet.modules.act.service.ActCategoryDictService; import com.epmet.modules.act.service.ActSignInRecordService; @@ -49,6 +52,7 @@ import com.epmet.modules.act.service.ActSummaryService; import com.epmet.modules.act.service.GroupActInfoService; import com.epmet.modules.constant.GroupActConstant; import com.epmet.modules.constant.UserMessageConstant; +import com.epmet.modules.group.service.GroupMessageService; import com.epmet.modules.group.service.ResiGroupService; import com.epmet.modules.invitation.service.InvitationRecordService; import com.epmet.modules.member.service.ResiGroupMemberService; @@ -57,6 +61,7 @@ import com.epmet.resi.group.dto.act.GroupActInfoDTO; import com.epmet.resi.group.dto.act.form.*; import com.epmet.resi.group.dto.act.result.ActDetailByLinkResultDTO; import com.epmet.resi.group.dto.act.result.ActDetailResultDTO; +import com.epmet.resi.group.dto.group.GroupMessageDTO; import com.epmet.resi.group.dto.group.ResiGroupDTO; import com.epmet.resi.group.dto.invitation.InvitationRecordDTO; import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; @@ -115,6 +120,9 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl memberDTOList, PublishGroupActFormDTO formDTO, GroupActInfoEntity groupActInfoEntity,ResiGroupDTO resiGroupDTO) { List list = new ArrayList<>(); @@ -637,6 +680,8 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.group.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.group.entity.GroupMessageEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 组内消息(话题、通知、活动)记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-04-22 + */ +@Mapper +public interface GroupMessageDao extends BaseDao { + + GroupMessageEntity selectByMessageId(String messageId); + + /** + * @Description 按条件获取分页后的ID + * @Param groupId + * @author zxc + * @date 2021/4/22 下午2:37 + */ + List selectNeedIds(@Param("groupId") String groupId); +} \ No newline at end of file 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 c34119bbc8..e60bc38c45 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 @@ -25,6 +25,7 @@ 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.notice.result.UnReadListResultDTO; +import com.epmet.resi.group.dto.topic.result.GetPastTopicListV2ResultDTO; import com.epmet.resi.group.dto.topic.result.LatestTenResultDTO; import com.epmet.resi.group.dto.member.result.GroupAchievementDTO; import org.apache.ibatis.annotations.Mapper; @@ -305,4 +306,12 @@ public interface ResiGroupDao extends BaseDao { * @return java.util.List */ List selectRecentGroupAchievements(@Param("userId") String userId); + + /** + * @Description 根据IDs查询 topic,act,notice信息 + * @Param ids + * @author zxc + * @date 2021/4/22 下午2:59 + */ + List getPastTopicListV2ByIds(@Param("ids")List ids); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/GroupMessageEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/GroupMessageEntity.java new file mode 100644 index 0000000000..48ba6f3dbb --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/GroupMessageEntity.java @@ -0,0 +1,75 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.group.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 组内消息(话题、通知、活动)记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-04-22 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("group_message") +public class GroupMessageEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 网格id + */ + private String gridId; + + private String groupId; + + /** + * 话题:topic; 通知:notice; 活动:act + */ + private String type; + + /** + * 话题id , 通知id,活动id + */ + private String messageId; + + /** + * 发布人用户id + */ + private String publishUserId; + + /** + * 话题状态(讨论中 - discussing、 已屏蔽 - hidden、 已关闭 - closed) + * 活动状态:已发布:published;已取消:canceled;已变更:changed;已关闭:closed + * 通知:已发布:published + */ + private String status; + private Date operateTime; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/GroupMessageService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/GroupMessageService.java new file mode 100644 index 0000000000..6e2b57893a --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/GroupMessageService.java @@ -0,0 +1,97 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.group.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.modules.group.entity.GroupMessageEntity; +import com.epmet.resi.group.dto.group.GroupMessageDTO; + +import java.util.List; +import java.util.Map; + +/** + * 组内消息(话题、通知、活动)记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-04-22 + */ +public interface GroupMessageService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-04-22 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-04-22 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GroupMessageDTO + * @author generator + * @date 2021-04-22 + */ + GroupMessageDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-04-22 + */ + void save(GroupMessageDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-04-22 + */ + void update(GroupMessageDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-04-22 + */ + void delete(String[] ids); + + GroupMessageDTO getByMessageId(String messageId); +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ExitGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ExitGroupServiceImpl.java index 186531756b..0f627b2a11 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ExitGroupServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ExitGroupServiceImpl.java @@ -11,8 +11,10 @@ import com.epmet.dto.result.UserRoleResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovIssueOpenFeignClient; import com.epmet.modules.constant.GroupMemberConstant; +import com.epmet.modules.group.dao.GroupMessageDao; import com.epmet.modules.group.dao.ResiGroupDao; import com.epmet.modules.group.dao.ResiGroupStatisticalDao; +import com.epmet.modules.group.entity.GroupMessageEntity; import com.epmet.modules.group.entity.ResiGroupEntity; import com.epmet.modules.group.entity.ResiGroupStatisticalEntity; import com.epmet.modules.group.redis.ResiGroupRedis; @@ -68,6 +70,8 @@ public class ExitGroupServiceImpl implements ExitGroupService { private ResiGroupRedis resiGroupRedis; @Autowired private ResiGroupDao resiGroupDao; + @Autowired + private GroupMessageDao groupMessageDao; /** * @param formDTO @@ -113,6 +117,13 @@ public class ExitGroupServiceImpl implements ExitGroupService { entity.setOperationReason(GroupMemberConstant.DELETE_MEMBER_REASON); entity.setTopicId(d); list.add(entity); + //2021.4.22 start sun 因业务调整,新增组内消息记录表,话题状态变化时相应的修改数据状态 + GroupMessageEntity groupMessage = groupMessageDao.selectByMessageId(d); + if(null != groupMessage){ + groupMessage.setStatus(TopicConstant.HIDDEN); + groupMessageDao.updateById(groupMessage); + } + //2021.4.22 end sun }); resiTopicOperationService.insertBatch(list); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/GroupMessageServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/GroupMessageServiceImpl.java new file mode 100644 index 0000000000..d74e669533 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/GroupMessageServiceImpl.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.group.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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.modules.group.dao.GroupMessageDao; +import com.epmet.modules.group.entity.GroupMessageEntity; +import com.epmet.modules.group.service.GroupMessageService; +import com.epmet.resi.group.dto.group.GroupMessageDTO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 组内消息(话题、通知、活动)记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-04-22 + */ +@Service +public class GroupMessageServiceImpl extends BaseServiceImpl implements GroupMessageService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GroupMessageDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GroupMessageDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public GroupMessageDTO get(String id) { + GroupMessageEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GroupMessageDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GroupMessageDTO dto) { + GroupMessageEntity entity = ConvertUtils.sourceToTarget(dto, GroupMessageEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GroupMessageDTO dto) { + GroupMessageEntity entity = ConvertUtils.sourceToTarget(dto, GroupMessageEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public GroupMessageDTO getByMessageId(String messageId) { + GroupMessageEntity entity = baseDao.selectByMessageId(messageId); + return ConvertUtils.sourceToTarget(entity, GroupMessageDTO.class); + } + +} \ 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/NoticeServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java index bc2636cd51..65a2ecf861 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 @@ -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 private NoticeReadRecordService noticeReafdRecordService; @Autowired private NoticeReadRecordDao noticeReadRecordDao; + @Autowired + private GroupMessageDao groupMessageDao; @Override @@ -241,7 +245,19 @@ public class NoticeServiceImpl extends BaseServiceImpl noticeReafdRecordService.insertBatch(reafdRecordList); } - //7.组内成员推送站内信 + //7.组内消息记录表新增数据 + GroupMessageEntity messageEntity = new GroupMessageEntity(); + messageEntity.setCustomerId(resultDTO.getCustomerId()); + messageEntity.setGridId(groupEntity.getGridId()); + messageEntity.setGroupId(entity.getGroupId()); + messageEntity.setType("notice"); + messageEntity.setMessageId(entity.getId()); + messageEntity.setPublishUserId(entity.getCreatedBy()); + messageEntity.setStatus("published"); + messageEntity.setOperateTime(entity.getChangeTime()); + groupMessageDao.insert(messageEntity); + + //8.组内成员推送站内信 List userMessageFormDTOS = new ArrayList<>(); memberList.forEach(m -> { if (!"".equals(m.getGroupLeaderFlag())) { @@ -362,13 +378,31 @@ public class NoticeServiceImpl extends BaseServiceImpl 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.setGroupId(entity.getGroupId()); + 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 userMessageFormDTOS = new ArrayList<>(); memberList.forEach(m -> { if (!"".equals(m.getGroupLeaderFlag())) { 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 29e536aeb8..137721d429 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 @@ -57,8 +57,10 @@ import com.epmet.modules.constant.WxmpSubscribeConstant; import com.epmet.modules.feign.EpmetUserFeignClient; import com.epmet.modules.feign.GovIssueFeignClient; import com.epmet.modules.feign.GovOrgFeignClient; +import com.epmet.modules.group.dao.GroupMessageDao; import com.epmet.modules.group.dao.ResiGroupDao; import com.epmet.modules.group.dao.ResiGroupStatisticalDao; +import com.epmet.modules.group.entity.GroupMessageEntity; import com.epmet.modules.group.entity.ResiGroupEntity; import com.epmet.modules.group.entity.ResiGroupStatisticalEntity; import com.epmet.modules.group.redis.ResiGroupRedis; @@ -183,6 +185,9 @@ public class ResiTopicServiceImpl extends BaseServiceImpl statisticalWrapper = new QueryWrapper<>(); statisticalWrapper.eq(TopicConstant.RESI_GROUP_ID,topic.getGroupId()); @@ -772,6 +793,14 @@ public class ResiTopicServiceImpl extends BaseServiceImpl getPastTopicListV2(GetPastTopicListV2FormDTO formDTO) { - return null; + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> groupMessageDao.selectNeedIds(formDTO.getGroupId())); + List ids = pageInfo.getList(); + if (CollectionUtils.isEmpty(ids)){ + return new ArrayList<>(); + } + // 根据IDs查询 topic,act,notice信息 + List infos = resiGroupDao.getPastTopicListV2ByIds(ids); + if (CollectionUtils.isEmpty(infos)){ + return new ArrayList<>(); + } + ResiGroupEntity resiGroup = resiGroupDao.selectById(formDTO.getGroupId()); + List userIds = infos.stream().map(m -> m.getUserId()).collect(Collectors.toList()); + // 用户信息 + List userInfos = this.disPoseUserInfo(resiGroup.getGroupType(), userIds); + // 各字段赋值 + infos.forEach(i -> { + // 用户头像,姓名赋值 + if (!CollectionUtils.isEmpty(userInfos)){ + userInfos.forEach(u -> { + if (i.getUserId().equals(u.getUserId())){ + i.setReleaseUserName(u.getReleaseUserName()); + i.setReleaseUserHeadPhoto(u.getReleaseUserHeadPhoto()); + } + }); + } + // 是否是本人赋值 + i.setReleaseUserFlag(formDTO.getUserId().equals(i.getUserId())); + // 是否转议题赋值 + i.setShiftIssueFlag(StringUtils.isNotEmpty(i.getIssueId())); + if (i.getReleaseUserFlag()==true){ + // 如果此贴是自己发布的,肯定是已读 + i.setReadOrUnRead(ModuleConstant.READ_FLAG_YES); + }else { + // TODO 不是自己发布的 + + } + }); + return infos; } /** diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java index a0d7d26ca7..1f2ff99fac 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java @@ -43,8 +43,10 @@ import com.epmet.dto.result.CommonDataFilterResultDTO; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.modules.feign.EpmetUserFeignClient; import com.epmet.modules.feign.GovOrgFeignClient; +import com.epmet.modules.group.dao.GroupMessageDao; import com.epmet.modules.group.dao.ResiGroupDao; import com.epmet.modules.group.dao.ResiGroupStatisticalDao; +import com.epmet.modules.group.entity.GroupMessageEntity; import com.epmet.modules.group.entity.ResiGroupEntity; import com.epmet.modules.group.entity.ResiGroupStatisticalEntity; import com.epmet.modules.group.redis.ResiGroupRedis; @@ -108,37 +110,26 @@ public class TopicDraftServiceImpl extends BaseServiceImpl(500), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy()); - @Autowired private GovOrgOpenFeignClient govOrgOpenFeignClient; - @Autowired private ResiGroupMemberService resiGroupMemberService; - @Autowired private ResiTopicAttachmentDao resiTopicAttachmentDao; - @Autowired private ResiTopicOperationDao resiTopicOperationDao; - @Autowired private EpmetUserFeignClient epmetUserFeignClient; - @Autowired private ResiGroupDao resiGroupDao; - @Autowired private ResiGroupMemberDao resiGroupMemberDao; - @Autowired private ResiGroupStatisticalDao resiGroupStatisticalDao; - @Autowired private ResiTopicDao resiTopicDao; - @Autowired private ResiGroupRedis resiGroupRedis; - @Autowired private TopicDraftAttachmentService topicDraftAttachmentService; @Autowired @@ -160,6 +151,8 @@ public class TopicDraftServiceImpl extends BaseServiceImpl page(Map params) { @@ -792,6 +785,20 @@ public class TopicDraftServiceImpl extends BaseServiceImpl NumConstant.TEN ? (content.substring(NumConstant.ZERO,NumConstant.TEN) + "…") : content); + breviary.append(content.length() > NumConstant.TEN ? (content.substring(NumConstant.ZERO, NumConstant.TEN) + "…") : content); breviary.append("\""); + } else { + breviary.append("语音话题"); + } + sendMqMsg(tokenDto.getUserId(), formDTO.getCustomerId(),draft.getCreatedTime(),resiGroupRedis.get(draft.getGroupId()).getGroupName(),breviary.toString()); }else { breviary.append("语音话题"); } @@ -930,6 +941,19 @@ public class TopicDraftServiceImpl extends BaseServiceImpl + + + + + + + + + + \ No newline at end of file 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 af5c2b70bd..ce0c085794 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 @@ -782,4 +782,63 @@ rgas.ARRIVE_TIME DESC LIMIT 10 + + +