Browse Source

Merge remote-tracking branch 'origin/dev_group_act_notice' into dev_temp

# Conflicts:
#	epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
master
zxc 4 years ago
parent
commit
0188cab0e6
  1. 7
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/ActReadRecordDTO.java
  2. 5
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/UnReadListResultDTO.java
  3. 4
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/AllMessagesResultDTO.java
  4. 7
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/entity/ActReadRecordEntity.java
  5. 44
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java
  6. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java
  7. 17
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
  8. 6
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
  9. 20
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml

7
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
*/

5
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;
/**
* 是否编辑过(truefalse)
*/
private Boolean isChanged;
@JsonIgnore
private String userId;
}

4
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

7
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
*/

44
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<GroupActInfoDao, Gr
//组长默认已读,组员默认未读
if(!groupActInfoEntity.getPublishUserId().equals(memberDTO.getCustomerUserId())){
actReadRecordEntity.setReadFlag(GroupActConstant.UN_READ);
actReadRecordEntity.setViewDetail(GroupActConstant.UN_READ);
}else{
actReadRecordEntity.setReadFlag(GroupActConstant.READ);
actReadRecordEntity.setViewDetail(GroupActConstant.READ);
}
readRecordEntityList.add(actReadRecordEntity);
});
@ -507,30 +509,36 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr
resultDTO.setUserRole(resiGroupMemberDTO.getGroupLeaderFlag());
// 有签到后不可以修改活动时间:true可以修改,false不可以,
resultDTO.setStartTimeEditFlag(groupActInfoEntity.getSignedInNum() > 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;

2
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<ResiGroupEntity> {
* @author zxc
* @date 2021/4/21 上午9:45
*/
List<UserReadFlagResultDTO> selectUserReadFlag(@Param("groupId")String groupId,@Param("userIds")List<String> userIds,@Param("ids")List<String> ids);
List<UserReadFlagResultDTO> selectUserReadFlag(@Param("groupId")String groupId,@Param("userId")String userId,@Param("ids")List<String> ids);
/**
* @Description 根据 活动或通知查询 未读人数

17
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<ResiGroupDao, ResiGrou
@Autowired
private ResiGroupCodeService resiGroupCodeService;
@Autowired
private ResiTopicService resiTopicService;
@Autowired
private ResiGroupAchievementStatsService resiGroupAchievementStatsService;
@ -1626,7 +1629,19 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
_update.setId(edit.getId());_update.setReadFlag(ModuleConstant.READ);
groupEditSubmitRecordDao.updateById(_update);
GroupEditionDetailResultDTO result = ConvertUtils.sourceToTarget(edit, GroupEditionDetailResultDTO.class);
result.setGroupLeaderName(resiGroupRedis.getFullName(edit.getCreatedBy()));
ResiGroupEntity entity = resiGroupDao.selectById(param.getGroupId());
if("branch".equals(entity.getGroupType())){
List<String> userIds = new ArrayList<>();
userIds.add(edit.getCreatedBy());
List<UserInfoResultDTO> 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;
}

6
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<ResiTopicDao, ResiTopi
List<String> ids = latestTenData.stream().map(m -> m.getId()).collect(Collectors.toList());
List<UserInfoResultDTO> userInfos = disPoseUserInfo(result.getGroupType(), userIds);
// 查询用户的 活动或通知的 阅读状态
List<UserReadFlagResultDTO> userReadFlag = resiGroupDao.selectUserReadFlag(groupId, userIds, ids);
List<UserReadFlagResultDTO> userReadFlag = resiGroupDao.selectUserReadFlag(groupId, userId, ids);
// 查询小组下的 通知或活动 未读人数
List<UserUnReadResultDTO> userUnReadCount = resiGroupDao.selectUserUnReadById(groupId, ids);
latestTenData.forEach(l -> {
@ -2681,8 +2681,8 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
// 用户头像姓名赋值
userInfos.forEach(u -> {
if (a.getUserId().equals(u.getUserId())){
a.setUserNickName(u.getReleaseUserName());
a.setUserHeadPhoto(u.getReleaseUserHeadPhoto());
a.setReleaseUserName(u.getReleaseUserName());
a.setReleaseUserHeadPhoto(u.getReleaseUserHeadPhoto());
}
});
// 徽章

20
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 (
<foreach collection="userIds" item="userId" separator=" OR ">
USER_ID = #{userId}
</foreach>
)
AND USER_ID = #{userId}
AND (
<foreach collection="ids" item="id" separator=" OR ">
GROUP_ACT_ID = #{id}
@ -664,11 +660,7 @@
FROM notice_read_record
WHERE
DEL_FLAG = 0
AND (
<foreach collection="userIds" item="userId" separator=" OR ">
USER_ID = #{userId}
</foreach>
)
AND USER_ID = #{userId}
AND (
<foreach collection="ids" item="id" separator=" OR ">
NOTICE_ID = #{id}
@ -736,7 +728,7 @@
<!-- 查询未读的通知和活动信息 -->
<select id="selectUnReadInfos" resultType="com.epmet.resi.group.dto.notice.result.UnReadListResultDTO">
SELECT id,userId,releaseTime,content,contentType,firstPhoto,isExpirat FROM
SELECT id,userId,releaseTime,content,contentType,firstPhoto,isExpirat,isChanged FROM
(
(SELECT
ai.ID,
@ -745,7 +737,8 @@
IFNULL(ai.TITLE,'') AS content,
'act' AS contentType,
IFNULL(ac2.CONTENT,'') AS firstPhoto,
false AS isExpirat
false AS isExpirat,
false AS isChanged
FROM group_act_info ai
LEFT JOIN group_act_content ac2 ON ac2.GROUP_ACT_ID = ai.ID AND ac2.CONTENT_TYPE = 'img' AND ac2.SORT = 1
WHERE ai.DEL_FLAG = '0'
@ -763,7 +756,8 @@
n.TITLE AS content,
'notice' AS contentType,
IFNULL(na.ATTACHMENT_URL,'') AS firstPhoto,
(CASE WHEN UNIX_TIMESTAMP(n.EXPIRATION_TIME) <![CDATA[ < ]]> UNIX_TIMESTAMP(NOW()) THEN TRUE ELSE FALSE END) AS isExpirat
(CASE WHEN UNIX_TIMESTAMP(n.EXPIRATION_TIME) <![CDATA[ < ]]> UNIX_TIMESTAMP(NOW()) THEN TRUE ELSE FALSE END) AS isExpirat,
(case when n.is_change = 'yes' then true else false end) AS isChanged
FROM notice n
LEFT JOIN notice_attachment na ON na.NOTICE_ID = n.ID AND na.DEL_FLAG = '0' AND na.ATTACHMENT_TYPE = 'image' AND na.SORT = 0
WHERE n.DEL_FLAG = '0'

Loading…
Cancel
Save