|
|
@ -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,10 +198,12 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota |
|
|
|
} |
|
|
|
return dto; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
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))) |
|
|
|