|
|
@ -32,6 +32,8 @@ import org.springframework.util.StringUtils; |
|
|
|
import java.sql.Timestamp; |
|
|
|
import java.text.ParseException; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.YearMonth; |
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.ThreadLocalRandom; |
|
|
|
import java.util.stream.Collectors; |
|
|
@ -259,7 +261,22 @@ public class AdminService { |
|
|
|
int yesterday = DateUtil.datePlus(today, -1); |
|
|
|
int rangeStart = DateUtil.datePlus(today, -7); |
|
|
|
bo.yesterdayIncome = aggregationService.getIncome(appIds, yesterday, yesterday); |
|
|
|
// bo.recent7DaysIncome = aggregationService.getIncome(appIds, rangeStart, yesterday);
|
|
|
|
|
|
|
|
LocalDate now = LocalDate.now(); |
|
|
|
|
|
|
|
// 获取上个月的年份和月份
|
|
|
|
YearMonth lastMonth = YearMonth.from(now).minusMonths(1); |
|
|
|
|
|
|
|
// 获取上个月的第一天和最后一天
|
|
|
|
LocalDate firstDayOfLastMonth = lastMonth.atDay(1); |
|
|
|
LocalDate lastDayOfLastMonth = lastMonth.atEndOfMonth(); |
|
|
|
bo.lastMonthIncome = aggregationService.getIncome(appIds, DateUtil.date2Number(firstDayOfLastMonth), DateUtil.date2Number(lastDayOfLastMonth)); |
|
|
|
|
|
|
|
YearMonth thisMonth = YearMonth.from(now); |
|
|
|
|
|
|
|
// 获取本月的第一天
|
|
|
|
LocalDate firstDayOfThisMonth = thisMonth.atDay(1); |
|
|
|
bo.thisMonthIncome = bo.todayIncome + aggregationService.getIncome(appIds, DateUtil.date2Number(firstDayOfThisMonth), today); |
|
|
|
return bo; |
|
|
|
} |
|
|
|
|
|
|
|