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 3f2e21e297..60c079d945 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 @@ -193,8 +193,6 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl memberDTOList) { - /*String actReadKey= RedisKeys.getGroupMsgReadKey(GroupActConstant.ACT_STR,groupActInfoEntity.getGroupId(),groupActInfoEntity.getId()); - String actShoudReadUserKey=RedisKeys.getGroupMsgShouldReadUser(GroupActConstant.ACT_STR,groupActInfoEntity.getGroupId(),groupActInfoEntity.getId());*/ List readRecordEntityList=new ArrayList<>(); memberDTOList.forEach(memberDTO->{ ActReadRecordEntity actReadRecordEntity=new ActReadRecordEntity(); @@ -206,11 +204,8 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl{ @@ -505,27 +500,30 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl NumConstant.ZERO ? false : true); - //返回详情,并且已读状态 - 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{ - if(GroupActConstant.UN_READ.equals(actReadRecordEntity.getReadFlag())){ - //未读->已读 - actReadRecordEntity.setReadFlag(GroupActConstant.READ); - actReadRecordEntity.setUpdatedTime(new Date()); - actReadRecordDao.updateById(actReadRecordEntity); + 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 { + if (GroupActConstant.UN_READ.equals(actReadRecordEntity.getReadFlag())) { + //未读->已读 + actReadRecordEntity.setReadFlag(GroupActConstant.READ); + actReadRecordEntity.setUpdatedTime(new Date()); + actReadRecordDao.updateById(actReadRecordEntity); + } } } return resultDTO;