Browse Source

Merge branch 'dev_group_act_notice' into dev_temp

# Conflicts:
#	epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
master
sunyuchao 5 years ago
parent
commit
12cc05a3dd
  1. 7
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GetPastTopicListV2ResultDTO.java
  2. 6
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/LatestTenResultDTO.java
  3. 46
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
  4. 14
      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/topic/result/GetPastTopicListV2ResultDTO.java

@ -85,7 +85,12 @@ public class GetPastTopicListV2ResultDTO implements Serializable {
/** /**
* 是否变更yesno * 是否变更yesno
*/ */
private String isChange = "no"; private Boolean isChanged = false;
/**
* 通知或活动未读人员数
*/
private Integer unReadCount;
@JsonIgnore @JsonIgnore
private String userId; private String userId;

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

@ -91,9 +91,9 @@ public class LatestTenResultDTO implements Serializable {
private Boolean isExpirat; private Boolean isExpirat;
/** /**
* 是否变更yesno * 是否变更(true: false:)
*/ */
private String isChange; private Boolean isChanged;
public LatestTenResultDTO() { public LatestTenResultDTO() {
this.id = ""; this.id = "";
@ -111,6 +111,6 @@ public class LatestTenResultDTO implements Serializable {
this.readOrUnRead = ""; this.readOrUnRead = "";
this.unReadCount = NumConstant.ZERO; this.unReadCount = NumConstant.ZERO;
this.isExpirat = false; this.isExpirat = false;
this.isChange = "no"; this.isChanged = false;
} }
} }

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

@ -505,10 +505,14 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
Collections.EMPTY_LIST : Collections.EMPTY_LIST :
badgeM.get(top.getUserId()).stream().map(UserBadgeUnitFormDTO::getBadgeIcon).collect(Collectors.toList()) badgeM.get(top.getUserId()).stream().map(UserBadgeUnitFormDTO::getBadgeIcon).collect(Collectors.toList())
); );
} else top.setBadgeList(Collections.EMPTY_LIST); } else {
top.setBadgeList(Collections.EMPTY_LIST);
}
}); });
} else latestTenTopics.forEach(top -> top.setBadgeList(Collections.EMPTY_LIST)); } else {
latestTenTopics.forEach(top -> top.setBadgeList(Collections.EMPTY_LIST));
}
} }
} }
@ -578,10 +582,14 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
Collections.EMPTY_LIST : Collections.EMPTY_LIST :
badgeM.get(top.getUserId()).stream().map(UserBadgeUnitFormDTO :: getBadgeIcon).collect(Collectors.toList()) badgeM.get(top.getUserId()).stream().map(UserBadgeUnitFormDTO :: getBadgeIcon).collect(Collectors.toList())
); );
}else top.setBadgeList(Collections.EMPTY_LIST); }else {
top.setBadgeList(Collections.EMPTY_LIST);
}
}); });
}else pastTopics.forEach(top -> top.setBadgeList(Collections.EMPTY_LIST)); }else {
pastTopics.forEach(top -> top.setBadgeList(Collections.EMPTY_LIST));
}
} }
@ -1046,10 +1054,14 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
Collections.EMPTY_LIST : Collections.EMPTY_LIST :
badgeM.get(top.getUserId()).stream().map(UserBadgeUnitFormDTO::getBadgeIcon).collect(Collectors.toList()) badgeM.get(top.getUserId()).stream().map(UserBadgeUnitFormDTO::getBadgeIcon).collect(Collectors.toList())
); );
} else top.setBadgeList(Collections.EMPTY_LIST); } else {
top.setBadgeList(Collections.EMPTY_LIST);
}
}); });
} else hiddenTopics.forEach(top -> top.setBadgeList(Collections.EMPTY_LIST)); } else {
hiddenTopics.forEach(top -> top.setBadgeList(Collections.EMPTY_LIST));
}
} }
} }
@ -1904,6 +1916,10 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
ValidatorUtils.validateEntity(result, FirstTopicShiftedToIssueApplicationResultDTO.AllowAuditionGroup.class); ValidatorUtils.validateEntity(result, FirstTopicShiftedToIssueApplicationResultDTO.AllowAuditionGroup.class);
} }
}else {
throw new RenException(dataFilterResult.getMsg());
}
}else { }else {
throw new RenException(dataFilterResult.getMsg()); throw new RenException(dataFilterResult.getMsg());
} }
@ -2193,7 +2209,9 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
Optional.ofNullable(param.getPageSize()).orElse(NumConstant.ONE)).doSelectPageInfo(() -> Optional.ofNullable(param.getPageSize()).orElse(NumConstant.ONE)).doSelectPageInfo(() ->
baseDao.selectParticipatedTopics(param.getCustomerId(),param.getUserId())); baseDao.selectParticipatedTopics(param.getCustomerId(),param.getUserId()));
List<ParticipatedTopicUnitResultDTO> result = page.getList(); List<ParticipatedTopicUnitResultDTO> result = page.getList();
if(CollectionUtils.isEmpty(result)) return Collections.EMPTY_LIST; if(CollectionUtils.isEmpty(result)) {
return Collections.EMPTY_LIST;
}
Result<List<OrgInfoResultDTO>> gridR = govOrgOpenFeignClient.selectOrgInfo( Result<List<OrgInfoResultDTO>> gridR = govOrgOpenFeignClient.selectOrgInfo(
new OrgInfoFormDTO(OrgInfoConstant.GRID,result.stream().map(ParticipatedTopicUnitResultDTO :: getTopicReleaseGridName).distinct().collect(Collectors.toList()))); new OrgInfoFormDTO(OrgInfoConstant.GRID,result.stream().map(ParticipatedTopicUnitResultDTO :: getTopicReleaseGridName).distinct().collect(Collectors.toList())));
if(gridR.success() && !CollectionUtils.isEmpty(gridR.getData())){ if(gridR.success() && !CollectionUtils.isEmpty(gridR.getData())){
@ -2260,7 +2278,9 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
List<IssueApplicationDTO> applications = reply.getData(); List<IssueApplicationDTO> applications = reply.getData();
return StringUtils.equals(ModuleConstant.TOPIC_SHIFTED_TO_ISSUE_STATUS_UNDER_AUDITING,applications.get(NumConstant.ZERO).getApplyStatus()) ? true : false; return StringUtils.equals(ModuleConstant.TOPIC_SHIFTED_TO_ISSUE_STATUS_UNDER_AUDITING,applications.get(NumConstant.ZERO).getApplyStatus()) ? true : false;
}else return false; }else {
return false;
}
} }
log.error("Method [checkTopicIfUnderAuditing] of service gov-issue called failed,topicId is [%s]",topicId); log.error("Method [checkTopicIfUnderAuditing] of service gov-issue called failed,topicId is [%s]",topicId);
throw new RenException(reply.getInternalMsg()); throw new RenException(reply.getInternalMsg());
@ -2563,6 +2583,8 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
List<UserInfoResultDTO> userInfos = this.disPoseUserInfo(resiGroup.getGroupType(), userIds); List<UserInfoResultDTO> userInfos = this.disPoseUserInfo(resiGroup.getGroupType(), userIds);
// 根据用户ID和【活动、通知ID】查询阅读状态 // 根据用户ID和【活动、通知ID】查询阅读状态
List<ReadStatusResultDTO> readStatus = resiGroupDao.selectReadFlagByUserAndId(ids, userIds); List<ReadStatusResultDTO> readStatus = resiGroupDao.selectReadFlagByUserAndId(ids, userIds);
// 查询小组下的 通知或活动 未读人数
List<UserUnReadResultDTO> userUnReadCount = resiGroupDao.selectUserUnReadById(formDTO.getGroupId(), ids);
// 查询用户徽章信息 // 查询用户徽章信息
Result<List<UserBadgesResultDTO>> badgeResult = epmetUserOpenFeignClient.userBadges(new UserBadgesFormDTO(formDTO.getCustomerId(),userIds)); Result<List<UserBadgesResultDTO>> badgeResult = epmetUserOpenFeignClient.userBadges(new UserBadgesFormDTO(formDTO.getCustomerId(),userIds));
if (!badgeResult.success()){ if (!badgeResult.success()){
@ -2604,6 +2626,14 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
} }
}); });
} }
//
if (!CollectionUtils.isEmpty(userUnReadCount)){
userUnReadCount.forEach(u -> {
if (i.getId().equals(u.getId())){
i.setUnReadCount(u.getUnRead());
}
});
}
}); });
return infos; return infos;
} }

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

@ -567,7 +567,7 @@
'topic' AS contentType, 'topic' AS contentType,
IFNULL(ta.ATTACHMENT_URL,'') AS firstPhoto, IFNULL(ta.ATTACHMENT_URL,'') AS firstPhoto,
false AS isExpirat, false AS isExpirat,
'no' AS isChange false AS isChanged
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 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'
@ -586,7 +586,7 @@
'act' AS contentType, 'act' AS contentType,
IFNULL(ac2.CONTENT,'') AS firstPhoto, IFNULL(ac2.CONTENT,'') AS firstPhoto,
false AS isExpirat, false AS isExpirat,
'no' AS isChange false AS isChanged
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'
@ -604,7 +604,7 @@
'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,
n.IS_CHANGE (case when n.is_change = 'yes' then true else false end) AS isChanged
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'
@ -786,7 +786,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,isChange FROM SELECT id,userId,releaseTime,content,status,issueId,contentType,isExpirat,isChanged FROM
((SELECT ((SELECT
t.ID, t.ID,
t.CREATED_BY AS userId, t.CREATED_BY AS userId,
@ -796,7 +796,7 @@
IFNULL(t.ISSUE_ID,'') AS issueId, IFNULL(t.ISSUE_ID,'') AS issueId,
'topic' AS contentType, 'topic' AS contentType,
false AS isExpirat, false AS isExpirat,
'no' AS isChange false AS isChanged
FROM resi_topic t FROM resi_topic t
WHERE t.DEL_FLAG = '0' WHERE t.DEL_FLAG = '0'
AND t.`STATUS` != 'hidden' AND t.`STATUS` != 'hidden'
@ -816,7 +816,7 @@
'' AS issueId, '' AS issueId,
'act' AS contentType, 'act' AS contentType,
false AS isExpirat, false AS isExpirat,
'no' AS isChange false AS isChanged
FROM group_act_info ai FROM group_act_info ai
WHERE ai.DEL_FLAG = '0' WHERE ai.DEL_FLAG = '0'
AND ( AND (
@ -835,7 +835,7 @@
'' 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,
n.IS_CHANGE (case when n.is_change = 'yes' then true else false end) AS isChanged
FROM notice n FROM notice n
WHERE n.DEL_FLAG = '0' WHERE n.DEL_FLAG = '0'
AND ( AND (

Loading…
Cancel
Save