diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/ActReadRecordDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/ActReadRecordDTO.java index c9350d4716..5af02bbd7e 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/ActReadRecordDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/ActReadRecordDTO.java @@ -60,10 +60,15 @@ public class ActReadRecordDTO implements Serializable { private String groupActId; /** - * 已读: read未读:un_read;查看活动详情后修改此表,或者插入一条新的已读记录 + * 活动关闭前已读:read;未读:un_read */ private String readFlag; + /** + * 已读:read未读:un_read + */ + private String viewDetail; + /** * 用户id */ diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/UnReadListResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/UnReadListResultDTO.java index 714a59537c..b92a1879d1 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/UnReadListResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/UnReadListResultDTO.java @@ -55,6 +55,11 @@ public class UnReadListResultDTO implements Serializable { */ private Boolean isExpirat; + /** + * 是否编辑过(true:是,false:否) + */ + private Boolean isChanged; + @JsonIgnore private String userId; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/AllMessagesResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/AllMessagesResultDTO.java index 378b3ad861..fbb744420c 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/AllMessagesResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/AllMessagesResultDTO.java @@ -24,12 +24,12 @@ public class AllMessagesResultDTO implements Serializable { /** * 发布者的全称(街道-姓氏先生/女士)【专项组显示真实名】 */ - private String userNickName; + private String releaseUserName; /** * 发布者的头像Url */ - private String userHeadPhoto; + private String releaseUserHeadPhoto; /** * 发布时间yyyy-MM-dd diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/entity/ActReadRecordEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/entity/ActReadRecordEntity.java index 4ffe1d4c5f..81cc38589c 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/entity/ActReadRecordEntity.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/entity/ActReadRecordEntity.java @@ -56,10 +56,15 @@ public class ActReadRecordEntity extends BaseEpmetEntity { private String groupActId; /** - * 已读: read未读:un_read;查看活动详情后修改此表,或者插入一条新的已读记录 + * 活动关闭前已读:read;未读:un_read */ private String readFlag; + /** + * 已读:read未读:un_read + */ + private String viewDetail; + /** * 用户id */ 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 899f73b5ad..2369c5de2c 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 @@ -202,8 +202,10 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl NumConstant.ZERO ? false : true); - if (!GroupActConstant.CLOSED.equals(groupActInfoEntity.getStatus())) { - //如果活动关闭,则不更新已读记录 - //非关闭状态下,返回详情,并且已读状态 - ActReadRecordEntity actReadRecordEntity = actReadRecordDao.selectUserRec(formDTO.getGroupActId(), formDTO.getUserId()); - if (null == actReadRecordEntity) { - if (!GroupActConstant.CLOSED.equals(groupActInfoEntity.getStatus())) { - //插入已读记录,默认不属于应读人。 - ActReadRecordEntity insertEntity = new ActReadRecordEntity(); - insertEntity.setCustomerId(groupActInfoEntity.getCustomerId()); - insertEntity.setGroupActId(formDTO.getGroupActId()); - insertEntity.setReadFlag(GroupActConstant.READ); - insertEntity.setShouldBeRead(Constant.NO); - insertEntity.setUserId(formDTO.getUserId()); - insertEntity.setGridId(groupActInfoEntity.getGridId()); - insertEntity.setGroupId(groupActInfoEntity.getGroupId()); - actReadRecordDao.insert(insertEntity); - } - } else { + //如果活动关闭,则不更新已读记录 + //非关闭状态下,返回详情,并且已读状态 + ActReadRecordEntity actReadRecordEntity = actReadRecordDao.selectUserRec(formDTO.getGroupActId(), formDTO.getUserId()); + if (null != actReadRecordEntity) { + /*if (!GroupActConstant.CLOSED.equals(groupActInfoEntity.getStatus())) { + //插入已读记录,默认不属于应读人。 + ActReadRecordEntity insertEntity = new ActReadRecordEntity(); + insertEntity.setCustomerId(groupActInfoEntity.getCustomerId()); + insertEntity.setGroupActId(formDTO.getGroupActId()); + insertEntity.setReadFlag(GroupActConstant.READ); + insertEntity.setShouldBeRead(Constant.NO); + insertEntity.setUserId(formDTO.getUserId()); + insertEntity.setGridId(groupActInfoEntity.getGridId()); + insertEntity.setGroupId(groupActInfoEntity.getGroupId()); + insertEntity.setViewDetail(GroupActConstant.READ); + actReadRecordDao.insert(insertEntity); + }*/ + // } else { + if(!GroupActConstant.CLOSED.equals(groupActInfoEntity.getStatus())){ if (GroupActConstant.UN_READ.equals(actReadRecordEntity.getReadFlag())) { //未读->已读 actReadRecordEntity.setReadFlag(GroupActConstant.READ); actReadRecordEntity.setUpdatedTime(new Date()); + actReadRecordEntity.setViewDetail(GroupActConstant.READ); actReadRecordDao.updateById(actReadRecordEntity); } + }else{ + actReadRecordEntity.setUpdatedTime(new Date()); + actReadRecordEntity.setViewDetail(GroupActConstant.READ); + actReadRecordDao.updateById(actReadRecordEntity); } } return resultDTO; 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 9bbd85cdff..a5b8442ec6 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 @@ -272,7 +272,7 @@ public interface ResiGroupDao extends BaseDao { * @author zxc * @date 2021/4/21 上午9:45 */ - List selectUserReadFlag(@Param("groupId")String groupId,@Param("userIds")List userIds,@Param("ids")List ids); + List selectUserReadFlag(@Param("groupId")String groupId,@Param("userId")String userId,@Param("ids")List ids); /** * @Description 根据 活动或通知查询 未读人数 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 3f767abd43..134d998162 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 @@ -65,6 +65,7 @@ import com.epmet.modules.member.redis.ResiGroupMemberRedis; import com.epmet.modules.member.service.GroupMemeberOperationService; import com.epmet.modules.member.service.ResiGroupMemberService; import com.epmet.modules.support.GroupLevelUtils; +import com.epmet.modules.topic.service.ResiTopicService; import com.epmet.modules.utils.ModuleConstant; import com.epmet.resi.group.constant.*; import com.epmet.resi.group.dto.UserRoleDTO; @@ -170,6 +171,8 @@ public class ResiGroupServiceImpl extends BaseServiceImpl userIds = new ArrayList<>(); + userIds.add(edit.getCreatedBy()); + List userInfos = resiTopicService.disPoseUserInfo(entity.getGroupType(), userIds); + userInfos.forEach(u->{ + if(edit.getCreatedBy().equals(u.getUserId())){ + result.setGroupLeaderName(u.getReleaseUserName()); + } + }); + } else { + result.setGroupLeaderName(resiGroupRedis.getFullName(edit.getCreatedBy())); + } return result; } 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 8b9a4329cf..ebda80b647 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 @@ -2500,7 +2500,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl ids = latestTenData.stream().map(m -> m.getId()).collect(Collectors.toList()); List userInfos = disPoseUserInfo(result.getGroupType(), userIds); // 查询用户的 活动或通知的 阅读状态 - List userReadFlag = resiGroupDao.selectUserReadFlag(groupId, userIds, ids); + List userReadFlag = resiGroupDao.selectUserReadFlag(groupId, userId, ids); // 查询小组下的 通知或活动 未读人数 List userUnReadCount = resiGroupDao.selectUserUnReadById(groupId, ids); latestTenData.forEach(l -> { @@ -2681,8 +2681,8 @@ public class ResiTopicServiceImpl extends BaseServiceImpl { if (a.getUserId().equals(u.getUserId())){ - a.setUserNickName(u.getReleaseUserName()); - a.setUserHeadPhoto(u.getReleaseUserHeadPhoto()); + a.setReleaseUserName(u.getReleaseUserName()); + a.setReleaseUserHeadPhoto(u.getReleaseUserHeadPhoto()); } }); // 徽章 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 6055f8c243..b04acf9956 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 @@ -644,11 +644,7 @@ FROM act_read_record WHERE DEL_FLAG = 0 - AND ( - - USER_ID = #{userId} - - ) + AND USER_ID = #{userId} AND ( GROUP_ACT_ID = #{id} @@ -664,11 +660,7 @@ FROM notice_read_record WHERE DEL_FLAG = 0 - AND ( - - USER_ID = #{userId} - - ) + AND USER_ID = #{userId} AND ( NOTICE_ID = #{id} @@ -736,7 +728,7 @@