Browse Source

Merge branch 'dev_point_rank_bugfix' into dev_temp

dev_shibei_match
zhaoqifeng 4 years ago
parent
commit
c1141ee0ee
  1. 14
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java
  2. 19
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java

14
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java

@ -37,6 +37,7 @@ import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import com.epmet.service.BizPointTotalDetailService;
import com.epmet.service.BizPointUserTotalDetailService;
import com.epmet.service.UserPointActionLogService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -182,6 +183,9 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota
.orderByDesc("TOTAL_POINT");
List<BizPointTotalDetailEntity> totalDetailList = baseDao.selectList(wrapper);
Result<List<ResiGroupDTO>> groupList = resiGroupOpenFeignClient.getGroupListByGrid(formDTO.getGridId());
if (!groupList.success() || CollectionUtils.isEmpty(groupList.getData())) {
return Collections.emptyList();
}
list = groupList.getData().stream().map(item -> {
GroupPointRankingResultDTO dto = new GroupPointRankingResultDTO();
dto.setGroupId(item.getId());
@ -194,14 +198,16 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota
}
return dto;
}).collect(Collectors.toList());
list.forEach(item -> totalDetailList.stream().filter(detail -> item.getGroupId().equals(detail.getObjectId())).forEach(total -> {
item.setPoint(total.getTotalPoint().toString());
if (CollectionUtils.isNotEmpty(totalDetailList)) {
list.forEach(item -> totalDetailList.stream().filter(detail -> item.getGroupId().equals(detail.getObjectId())).forEach(total -> {
item.setPoint(total.getTotalPoint().toString());
}));
}));
}
list =
list.stream().sorted(Comparator.comparing(GroupPointRankingResultDTO :: getPoint, Comparator.comparingInt(Integer::parseInt)).reversed()
.thenComparing(GroupPointRankingResultDTO::getGroupName, Collator.getInstance(Locale.CHINA)))
.collect(Collectors.toList());
.collect(Collectors.toList());
AtomicInteger i = new AtomicInteger(1);
list.forEach(dto -> {
dto.setRanking(String.valueOf(i.getAndIncrement()));

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

@ -2513,13 +2513,18 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
result.setUserRole(leaderFlag);
ResiGroupEntity resiGroup = resiGroupDao.selectById(groupId);
result.setGroupType(resiGroup.getGroupType());
if (leaderFlag.equals(ModuleConstant.GROUP_MEMBER_FLAG)){
// 当前人员是组长,显示通知按钮
result.setNoticeBut(true);
}
if (result.getGroupType().equals(ModuleConstant.GROUP_TYPE_BRANCH) && leaderFlag.equals(ModuleConstant.GROUP_MEMBER_FLAG)){
// 当前组为支部组且当前人是组长,显示活动按钮
result.setActBut(true);
if (StringUtils.isEmpty(leaderFlag)){
result.setNoticeBut(false);
result.setActBut(false);
}else {
if (leaderFlag.equals(ModuleConstant.GROUP_MEMBER_FLAG)) {
// 当前人员是组长,显示通知按钮
result.setNoticeBut(true);
}
if (result.getGroupType().equals(ModuleConstant.GROUP_TYPE_BRANCH) && leaderFlag.equals(ModuleConstant.GROUP_MEMBER_FLAG)) {
// 当前组为支部组且当前人是组长,显示活动按钮
result.setActBut(true);
}
}
Integer unRead = resiGroupDao.selectUserUnRead(groupId, userId);
if (unRead > NumConstant.ZERO){

Loading…
Cancel
Save