From 4d64c41cbecb6412fcc231c9254f0d7f0ea281ad Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 28 Apr 2021 15:37:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E5=B7=B2=E8=AF=BB=E6=9C=AA?= =?UTF-8?q?=E8=AF=BB=EF=BC=8C=E5=A2=9E=E5=8A=A0VIEW=5FDETAIL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resi/group/dto/act/ActReadRecordDTO.java | 7 ++- .../act/entity/ActReadRecordEntity.java | 7 ++- .../service/impl/GroupActInfoServiceImpl.java | 44 +++++++++++-------- 3 files changed, 38 insertions(+), 20 deletions(-) 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-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;