|
|
@ -484,12 +484,15 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr |
|
|
|
if(null==groupActInfoEntity){ |
|
|
|
throw new RenException(String.format("根据groupActId:%s,查询活动信息为null",formDTO.getGroupActId())); |
|
|
|
} |
|
|
|
ActDetailResultDTO resultDTO=ConvertUtils.sourceToTarget(groupActInfoEntity,ActDetailResultDTO.class); |
|
|
|
if(AppClientConstant.APP_RESI.equals(formDTO.getClient())){ |
|
|
|
//当前内容仅允许组内成员查看
|
|
|
|
ResiGroupMemberDTO resiGroupMemberDTO=resiGroupMemberService.getResiGroupMember(groupActInfoEntity.getGroupId(),formDTO.getUserId()); |
|
|
|
if(null==resiGroupMemberDTO){ |
|
|
|
throw new RenException(EpmetErrorCode.NOT_IN_GROUP_CAN_NOT_VIEW.getCode(), EpmetErrorCode.NOT_IN_GROUP_CAN_NOT_VIEW.getMsg()); |
|
|
|
} |
|
|
|
ActDetailResultDTO resultDTO=ConvertUtils.sourceToTarget(groupActInfoEntity,ActDetailResultDTO.class); |
|
|
|
resultDTO.setUserRole(resiGroupMemberDTO.getGroupLeaderFlag()); |
|
|
|
} |
|
|
|
resultDTO.setMenuCode(resultDTO.getCategoryCode().substring(NumConstant.ZERO,NumConstant.THREE)); |
|
|
|
resultDTO.setGroupActId(formDTO.getGroupActId()); |
|
|
|
resultDTO.setTextList(groupActContentDao.selectContentList(formDTO.getGroupActId(),GroupActConstant.TEXT)); |
|
|
@ -503,31 +506,16 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr |
|
|
|
}); |
|
|
|
resultDTO.setImgList(imgList); |
|
|
|
resultDTO.setCanceledReason(GroupActConstant.CANCELED.equals(resultDTO.getStatus()) ? actOperationRecordDao.selectCanceledReason(formDTO.getGroupActId()) : StrConstant.EPMETY_STR); |
|
|
|
|
|
|
|
handleSignInDesc(resultDTO,formDTO.getUserId()); |
|
|
|
|
|
|
|
resultDTO.setUserRole(resiGroupMemberDTO.getGroupLeaderFlag()); |
|
|
|
// 有签到后不可以修改活动时间:true可以修改,false不可以,
|
|
|
|
resultDTO.setStartTimeEditFlag(groupActInfoEntity.getSignedInNum() > NumConstant.ZERO ? false : true); |
|
|
|
//如果活动关闭,则不更新已读记录
|
|
|
|
//非关闭状态下,返回详情,并且已读状态
|
|
|
|
|
|
|
|
//居民端记录已读标志
|
|
|
|
if(AppClientConstant.APP_RESI.equals(formDTO.getClient())){ |
|
|
|
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); |
|
|
@ -536,11 +524,13 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr |
|
|
|
actReadRecordDao.updateById(actReadRecordEntity); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
//如果活动关闭,则不更新已读、未读。只记录是否查看过详情。
|
|
|
|
actReadRecordEntity.setUpdatedTime(new Date()); |
|
|
|
actReadRecordEntity.setViewDetail(GroupActConstant.READ); |
|
|
|
actReadRecordDao.updateById(actReadRecordEntity); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
|
|
|
|