|
|
|
@ -23,9 +23,12 @@ import org.springframework.validation.annotation.Validated;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.time.DayOfWeek;
|
|
|
|
|
import java.time.LocalDate;
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.time.LocalTime;
|
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
|
import java.time.temporal.TemporalAdjusters;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 排行榜
|
|
|
|
@ -69,21 +72,21 @@ public class RankUController {
|
|
|
|
|
Page pg = MybatisPlusUtil.SetNumPage(param.getPageNum(), param.getPageSize());
|
|
|
|
|
QueryWrapper<UserEffectRecords> qw = new QueryWrapper<>();
|
|
|
|
|
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
|
|
LocalDateTime now = LocalDateTime.of(LocalDateTime.now().toLocalDate(), LocalTime.MIN);
|
|
|
|
|
LocalDateTime before = now.minusMonths(1);
|
|
|
|
|
LocalDate now = LocalDateTime.now().toLocalDate();
|
|
|
|
|
LocalDate before =now.with(TemporalAdjusters.firstDayOfMonth());
|
|
|
|
|
if (param.getDateCondition() != null) {
|
|
|
|
|
switch (param.getDateCondition()) {
|
|
|
|
|
case 1:
|
|
|
|
|
before = now;
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
before = now.minusWeeks(1);
|
|
|
|
|
before = now.with(DayOfWeek.MONDAY);
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
before = now.minusMonths(1);
|
|
|
|
|
before = now.with(TemporalAdjusters.firstDayOfMonth());
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
before = now.minusYears(1);
|
|
|
|
|
before = now.with(TemporalAdjusters.firstDayOfYear());
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
}
|
|
|
|
|