|
@@ -128,7 +128,7 @@ public class DistributeRankController {
|
|
|
* 上期获奖名单
|
|
* 上期获奖名单
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/get/previous/winners")
|
|
@GetMapping("/get/previous/winners")
|
|
|
- public Result<List<DistributeUserRankView>> getPreviousWinners(@RequestParam(defaultValue = "0") Integer type, @RequestParam(defaultValue = "week") String statisticsType) {
|
|
|
|
|
|
|
+ public Result<List<DistributeUserRankPreView>> getPreviousWinners(@RequestParam(defaultValue = "0") Integer type, @RequestParam(defaultValue = "week") String statisticsType) throws Exception {
|
|
|
long userId = StpUserUtil.getLoginIdAsLong();
|
|
long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
String lastTime;
|
|
String lastTime;
|
|
|
if (Constant.week.equals(statisticsType)) {
|
|
if (Constant.week.equals(statisticsType)) {
|
|
@@ -139,11 +139,8 @@ public class DistributeRankController {
|
|
|
DateTime lastBeginOfMonth = DateUtil.offsetMonth(DateUtil.beginOfMonth(DateTime.now()), -1);
|
|
DateTime lastBeginOfMonth = DateUtil.offsetMonth(DateUtil.beginOfMonth(DateTime.now()), -1);
|
|
|
lastTime = lastBeginOfMonth.toDateStr();
|
|
lastTime = lastBeginOfMonth.toDateStr();
|
|
|
}
|
|
}
|
|
|
- String orderByField = "money";
|
|
|
|
|
- if (type == 1) {
|
|
|
|
|
- orderByField = "orders";
|
|
|
|
|
- }
|
|
|
|
|
- List<DistributeUserRankView> ranks = userDistributeRankStatisticsRecordMapper.getPreviousWinners(orderByField, lastTime);
|
|
|
|
|
|
|
+ List<DistributeUserRankPreView> ranks = beanSearcher.searchAll(DistributeUserRankPreView.class, MapUtils.builder().field(DistributeUserRankPreView::getType, type)
|
|
|
|
|
+ .field(DistributeUserRankPreView::getStatisticsStartTime, lastTime).build());
|
|
|
|
|
|
|
|
ranks.forEach(rank -> {
|
|
ranks.forEach(rank -> {
|
|
|
if (ObjectUtil.equal(userId, rank.getUserId())) {
|
|
if (ObjectUtil.equal(userId, rank.getUserId())) {
|
|
@@ -152,6 +149,7 @@ public class DistributeRankController {
|
|
|
rank.setUserId(null);
|
|
rank.setUserId(null);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(ranks);
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(ranks);
|
|
|
}
|
|
}
|
|
|
|
|
|