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;
/**
* 活动状态已发布published;已取消canceled已变更changed已关闭closed
*/
private String status;
/**
* 通知是否过期(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 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 String firstPhoto;
@JsonIgnore
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 java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @Author zxc
@ -95,6 +97,11 @@ public class LatestTenResultDTO implements Serializable {
*/
private Boolean isChanged;
/**
* 徽章Url集合
*/
private List<String> badgeList;
public LatestTenResultDTO() {
this.id = "";
this.userId = "";
@ -112,5 +119,6 @@ public class LatestTenResultDTO implements Serializable {
this.unReadCount = NumConstant.ZERO;
this.isExpirat = 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){
ValidatorUtils.validateEntity(formDTO, GetLatestV2FormDTO.GetLatestV2Form.class);
formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
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<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 -> {
// 是否转议题,true:是,false:不是
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);
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,userId,releaseTime,content,contentType,firstPhoto,isExpirat,isChanged FROM
SELECT id,userId,releaseTime,content,contentType,firstPhoto,isExpirat,isChanged,status FROM
(
(SELECT
ai.ID,
@ -743,7 +743,8 @@
(case
when ai.`STATUS`='published' and ai.IS_CHANGE='yes' then true
else false
end )as isChanged
end )as isChanged,
ai.`STATUS` AS status
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'
@ -762,7 +763,8 @@
'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 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
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'
@ -794,7 +796,7 @@
</select>
<!-- 根据IDs查询 topic,act,notice信息 -->
<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
t.ID,
t.CREATED_BY AS userId,
@ -804,8 +806,10 @@
IFNULL(t.ISSUE_ID,'') AS issueId,
'topic' AS contentType,
false AS isExpirat,
false AS isChanged
false AS isChanged,
IFNULL(ta.ATTACHMENT_URL,'') AS firstPhoto
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'
AND t.`STATUS` != 'hidden'
AND (
@ -827,8 +831,10 @@
(case
when ai.`STATUS`='published' and ai.IS_CHANGE='yes' then true
else false
end )as isChanged
end )as isChanged,
IFNULL(ac2.CONTENT,'') AS firstPhoto
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'
AND (
<foreach collection="ids" item="id" separator=" OR ">
@ -846,8 +852,10 @@
'' AS issueId,
'notice' AS contentType,
(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
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'
AND (
<foreach collection="ids" item="id" separator=" OR ">

Loading…
Cancel
Save