|
|
|
@ -24,7 +24,7 @@ public class GuildMemberDailyProfitApplicationService { |
|
|
|
public void statAll(LocalDate statDate) { |
|
|
|
LocalDateTime startTime = statDate.atStartOfDay(); |
|
|
|
LocalDateTime endTime = statDate.atTime(23, 59, 59); |
|
|
|
List<GuildMemberDailyProfit> list = guildMemberDailyProfitQueryService.stat(startTime, endTime); |
|
|
|
List<GuildMemberDailyProfit> list = guildMemberDailyProfitQueryService.statAll(startTime, endTime); |
|
|
|
if (CollUtil.isNotEmpty(list)) { |
|
|
|
for (GuildMemberDailyProfit dailyProfit : list) { |
|
|
|
GuildMemberDailyProfit existDailyProfit = guildMemberDailyProfitQueryService.queryBy(dailyProfit.getGuildId(), dailyProfit.getUserId(), statDate); |
|
|
|
@ -36,4 +36,19 @@ public class GuildMemberDailyProfitApplicationService { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void stat(Long guildId, |
|
|
|
Long userId, |
|
|
|
LocalDate statDate) { |
|
|
|
GuildMemberDailyProfit dailyProfit = guildMemberDailyProfitQueryService.stat(guildId, userId, statDate.atStartOfDay(), statDate.atTime(23, 59, 59)); |
|
|
|
if (Objects.nonNull(dailyProfit)) { |
|
|
|
GuildMemberDailyProfit existDailyProfit = guildMemberDailyProfitQueryService.queryBy(dailyProfit.getGuildId(), dailyProfit.getUserId(), |
|
|
|
statDate); |
|
|
|
if (Objects.nonNull(existDailyProfit)) { |
|
|
|
dailyProfit.setId(existDailyProfit.getId()); |
|
|
|
} |
|
|
|
dailyProfit.setStatDate(statDate); |
|
|
|
guildMemberDailyProfitAggregate.edit(dailyProfit); |
|
|
|
} |
|
|
|
} |
|
|
|
} |