Browse Source

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

master
zxc 4 years ago
parent
commit
57591fa2c5
  1. 5
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/UnReadListResultDTO.java
  2. 2
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/GetLatestV2FormDTO.java
  3. 5
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GetPastTopicListV2ResultDTO.java
  4. 8
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/LatestTenResultDTO.java
  5. 1
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java
  6. 13
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
  7. 22
      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

@ -50,6 +50,11 @@ public class UnReadListResultDTO implements Serializable {
*/ */
private String contentType; private String contentType;
/**
* 活动状态已发布published;已取消canceled已变更changed已关闭closed
*/
private String status;
/** /**
* 通知是否过期(truefalse) * 通知是否过期(truefalse)
*/ */

2
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/GetLatestV2FormDTO.java

@ -21,4 +21,6 @@ public class GetLatestV2FormDTO implements Serializable {
private String groupId; private String groupId;
private String userId; private String userId;
private String customerId;
} }

5
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GetPastTopicListV2ResultDTO.java

@ -93,6 +93,11 @@ public class GetPastTopicListV2ResultDTO implements Serializable {
*/ */
private Integer unReadCount = NumConstant.ZERO; private Integer unReadCount = NumConstant.ZERO;
/**
* 如果有图片后台只返回第一张没有图片此列为空
*/
private String firstPhoto;
@JsonIgnore @JsonIgnore
private String userId; private String userId;
} }

8
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/LatestTenResultDTO.java

@ -4,6 +4,8 @@ import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/** /**
* @Author zxc * @Author zxc
@ -95,6 +97,11 @@ public class LatestTenResultDTO implements Serializable {
*/ */
private Boolean isChanged; private Boolean isChanged;
/**
* 徽章Url集合
*/
private List<String> badgeList;
public LatestTenResultDTO() { public LatestTenResultDTO() {
this.id = ""; this.id = "";
this.userId = ""; this.userId = "";
@ -112,5 +119,6 @@ public class LatestTenResultDTO implements Serializable {
this.unReadCount = NumConstant.ZERO; this.unReadCount = NumConstant.ZERO;
this.isExpirat = false; this.isExpirat = false;
this.isChanged = false; this.isChanged = false;
this.badgeList = new ArrayList<>();
} }
} }

1
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java

@ -454,6 +454,7 @@ public class ResiTopicController {
public Result<GetLatestV2ResultDTO> getLatestV2(@LoginUser TokenDto tokenDto,@RequestBody GetLatestV2FormDTO formDTO){ public Result<GetLatestV2ResultDTO> getLatestV2(@LoginUser TokenDto tokenDto,@RequestBody GetLatestV2FormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, GetLatestV2FormDTO.GetLatestV2Form.class); ValidatorUtils.validateEntity(formDTO, GetLatestV2FormDTO.GetLatestV2Form.class);
formDTO.setUserId(tokenDto.getUserId()); formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<GetLatestV2ResultDTO>().ok(topicService.getLatestV2(formDTO)); return new Result<GetLatestV2ResultDTO>().ok(topicService.getLatestV2(formDTO));
} }

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

@ -2519,6 +2519,11 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
List<UserReadFlagResultDTO> userReadFlag = resiGroupDao.selectUserReadFlag( userId, ids); List<UserReadFlagResultDTO> userReadFlag = resiGroupDao.selectUserReadFlag( userId, ids);
// 查询小组下的 通知或活动 未读人数 // 查询小组下的 通知或活动 未读人数
List<UserUnReadResultDTO> userUnReadCount = resiGroupDao.selectUserUnReadById(groupId, ids); List<UserUnReadResultDTO> userUnReadCount = resiGroupDao.selectUserUnReadById(groupId, ids);
// 查询用户徽章信息
Result<List<UserBadgesResultDTO>> badgeResult = epmetUserOpenFeignClient.userBadges(new UserBadgesFormDTO(formDTO.getCustomerId(),userIds));
if (!badgeResult.success()){
throw new RenException(ModuleConstant.GET_BADGE_INFO_ERR);
}
latestTenData.forEach(l -> { latestTenData.forEach(l -> {
// 是否转议题,true:是,false:不是 // 是否转议题,true:是,false:不是
l.setShiftIssueFlag(StringUtils.isNotEmpty(l.getIssueId())); l.setShiftIssueFlag(StringUtils.isNotEmpty(l.getIssueId()));
@ -2549,6 +2554,14 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
} }
}); });
} }
// 徽章
if (!CollectionUtils.isEmpty(badgeResult.getData())){
badgeResult.getData().forEach(b -> {
if (l.getUserId().equals(b.getUserId())){
l.setBadgeList(b.getBadgeIcons());
}
});
}
}); });
result.setList(latestTenData); result.setList(latestTenData);
return result; return result;

22
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml

@ -730,7 +730,7 @@
<!-- 查询未读的通知和活动信息 --> <!-- 查询未读的通知和活动信息 -->
<select id="selectUnReadInfos" resultType="com.epmet.resi.group.dto.notice.result.UnReadListResultDTO"> <select id="selectUnReadInfos" resultType="com.epmet.resi.group.dto.notice.result.UnReadListResultDTO">
SELECT id,userId,releaseTime,content,contentType,firstPhoto,isExpirat,isChanged FROM SELECT id,userId,releaseTime,content,contentType,firstPhoto,isExpirat,isChanged,status FROM
( (
(SELECT (SELECT
ai.ID, ai.ID,
@ -743,7 +743,8 @@
(case (case
when ai.`STATUS`='published' and ai.IS_CHANGE='yes' then true when ai.`STATUS`='published' and ai.IS_CHANGE='yes' then true
else false else false
end )as isChanged end )as isChanged,
ai.`STATUS` AS status
FROM group_act_info ai 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.DEL_FLAG = 0 AND ac2.SORT = 1 LEFT JOIN group_act_content ac2 ON ac2.GROUP_ACT_ID = ai.ID AND ac2.CONTENT_TYPE = 'img' AND ac2.DEL_FLAG = 0 AND ac2.SORT = 1
WHERE ai.DEL_FLAG = '0' WHERE ai.DEL_FLAG = '0'
@ -762,7 +763,8 @@
'notice' AS contentType, 'notice' AS contentType,
IFNULL(na.ATTACHMENT_URL,'') AS firstPhoto, 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 (case when n.is_change = 'yes' then true else false end) AS isChanged,
'' AS status
FROM notice n 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 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' WHERE n.DEL_FLAG = '0'
@ -794,7 +796,7 @@
</select> </select>
<!-- 根据IDs查询 topic,act,notice信息 --> <!-- 根据IDs查询 topic,act,notice信息 -->
<select id="getPastTopicListV2ByIds" resultType="com.epmet.resi.group.dto.topic.result.GetPastTopicListV2ResultDTO"> <select id="getPastTopicListV2ByIds" resultType="com.epmet.resi.group.dto.topic.result.GetPastTopicListV2ResultDTO">
SELECT id,userId,releaseTime,content,status,issueId,contentType,isExpirat,isChanged FROM SELECT id,userId,releaseTime,content,status,issueId,contentType,isExpirat,isChanged,firstPhoto FROM
((SELECT ((SELECT
t.ID, t.ID,
t.CREATED_BY AS userId, t.CREATED_BY AS userId,
@ -804,8 +806,10 @@
IFNULL(t.ISSUE_ID,'') AS issueId, IFNULL(t.ISSUE_ID,'') AS issueId,
'topic' AS contentType, 'topic' AS contentType,
false AS isExpirat, false AS isExpirat,
false AS isChanged false AS isChanged,
IFNULL(ta.ATTACHMENT_URL,'') AS firstPhoto
FROM resi_topic t FROM resi_topic t
LEFT JOIN resi_topic_attachment ta ON ta.TOPIC_ID = t.ID AND ta.ATTACHMENT_TYPE = 'image' AND ta.DEL_FLAG = '0' AND ta.SORT = 0
WHERE t.DEL_FLAG = '0' WHERE t.DEL_FLAG = '0'
AND t.`STATUS` != 'hidden' AND t.`STATUS` != 'hidden'
AND ( AND (
@ -827,8 +831,10 @@
(case (case
when ai.`STATUS`='published' and ai.IS_CHANGE='yes' then true when ai.`STATUS`='published' and ai.IS_CHANGE='yes' then true
else false else false
end )as isChanged end )as isChanged,
IFNULL(ac2.CONTENT,'') AS firstPhoto
FROM group_act_info ai 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.DEL_FLAG = 0 AND ac2.SORT = 1
WHERE ai.DEL_FLAG = '0' WHERE ai.DEL_FLAG = '0'
AND ( AND (
<foreach collection="ids" item="id" separator=" OR "> <foreach collection="ids" item="id" separator=" OR ">
@ -846,8 +852,10 @@
'' AS issueId, '' AS issueId,
'notice' AS contentType, 'notice' AS contentType,
(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 (case when n.is_change = 'yes' then true else false end) AS isChanged,
IFNULL(na.ATTACHMENT_URL,'') AS firstPhoto
FROM notice n 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' WHERE n.DEL_FLAG = '0'
AND ( AND (
<foreach collection="ids" item="id" separator=" OR "> <foreach collection="ids" item="id" separator=" OR ">

Loading…
Cancel
Save