From 14927c56ea7a12face7855d32792f9c344908c6b Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 25 Apr 2021 09:22:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E9=97=AD=E4=B9=8B=E5=90=8E=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E6=B4=BB=E5=8A=A8=EF=BC=8C=E4=B8=8D=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E5=B7=B2=E8=AF=BB=E7=8A=B6=E6=80=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/GroupActInfoServiceImpl.java | 52 +++++++++---------- 1 file changed, 25 insertions(+), 27 deletions(-) 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;