Browse Source

代码微调

master
zxc 4 years ago
parent
commit
4de03750be
  1. 5
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/UnReadListResultDTO.java
  2. 4
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/AllMessagesResultDTO.java
  3. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java
  4. 6
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
  5. 20
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml

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

2
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java

@ -271,7 +271,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 根据 活动或通知查询 未读人数

6
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java

@ -2345,7 +2345,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 -> {
@ -2526,8 +2526,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

@ -643,11 +643,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}
@ -663,11 +659,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}
@ -735,7 +727,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,
@ -744,7 +736,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'
@ -762,7 +755,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