Browse Source

edit

dev_shibei_match
zxc 4 years ago
parent
commit
eb6de5b2d8
  1. 2
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/GetLatestV2FormDTO.java
  2. 8
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/LatestTenResultDTO.java
  3. 1
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java
  4. 13
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
  5. 14
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml

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;
}

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

@ -453,6 +453,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

@ -2378,6 +2378,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()));
@ -2408,6 +2413,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;

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

@ -778,7 +778,7 @@
<!-- 根据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,
@ -788,8 +788,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 (
@ -811,8 +813,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 ">
@ -830,8 +834,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