|
|
@@ -23,6 +23,9 @@ import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.time.DayOfWeek;
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.temporal.ChronoField;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
@@ -110,11 +113,19 @@ public class UserActivityController {
|
|
|
* 分销排行列表
|
|
|
*/
|
|
|
@GetMapping("/get/rank/list")
|
|
|
- public Result<Page<UserDistributeRankActivityView>> rankList(String nickname, Long userId, String date, @RequestParam(defaultValue = "1") Integer start, @RequestParam(defaultValue = "10") Integer limit, @RequestParam(defaultValue = "0") Integer type, String orderBy, String sort) {
|
|
|
+ public Result<Page<UserDistributeRankActivityView>> rankList(Long acId, String nickname, Long userId, String date, @RequestParam(defaultValue = "1") Integer start, @RequestParam(defaultValue = "10") Integer limit, @RequestParam(defaultValue = "0") Integer type, String orderBy, String sort) {
|
|
|
String field = Constant.money;
|
|
|
if (type == 1) {
|
|
|
field = Constant.orders;
|
|
|
}
|
|
|
+ UserActivity activity = userActivityService.getById(acId);
|
|
|
+ if (date == null) {
|
|
|
+ if (activity.getStatisticsType().equals(Constant.week)) {
|
|
|
+ date = LocalDate.now().with(ChronoField.DAY_OF_WEEK, DayOfWeek.MONDAY.getValue()).toString();
|
|
|
+ } else {
|
|
|
+ date = LocalDate.now().with(ChronoField.DAY_OF_MONTH, DayOfWeek.MONDAY.getValue()).toString();
|
|
|
+ }
|
|
|
+ }
|
|
|
Page<UserDistributeRankActivityView> page = userDistributeRankStatisticsRecordMapper.rankPage(nickname, userId, date, new Page<>(start, limit), field, orderBy, sort);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(page);
|
|
|
}
|