parent
562550880c
commit
cae3a92a66
|
@ -8,6 +8,7 @@ import kr.co.vividnext.sodalive.can.charge.ChargeStatus
|
||||||
import kr.co.vividnext.sodalive.can.charge.QCharge.charge
|
import kr.co.vividnext.sodalive.can.charge.QCharge.charge
|
||||||
import kr.co.vividnext.sodalive.can.payment.PaymentStatus
|
import kr.co.vividnext.sodalive.can.payment.PaymentStatus
|
||||||
import kr.co.vividnext.sodalive.can.payment.QPayment.payment
|
import kr.co.vividnext.sodalive.can.payment.QPayment.payment
|
||||||
|
import kr.co.vividnext.sodalive.member.MemberProvider
|
||||||
import kr.co.vividnext.sodalive.member.QMember.member
|
import kr.co.vividnext.sodalive.member.QMember.member
|
||||||
import kr.co.vividnext.sodalive.member.QSignOut.signOut
|
import kr.co.vividnext.sodalive.member.QSignOut.signOut
|
||||||
import kr.co.vividnext.sodalive.member.auth.QAuth.auth
|
import kr.co.vividnext.sodalive.member.auth.QAuth.auth
|
||||||
|
@ -28,6 +29,45 @@ class AdminMemberStatisticsRepository(private val queryFactory: JPAQueryFactory)
|
||||||
.size
|
.size
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getTotalSignUpEmailCount(startDate: LocalDateTime, endDate: LocalDateTime): Int {
|
||||||
|
return queryFactory
|
||||||
|
.select(member.id)
|
||||||
|
.from(member)
|
||||||
|
.where(
|
||||||
|
member.createdAt.goe(startDate),
|
||||||
|
member.createdAt.loe(endDate),
|
||||||
|
member.provider.eq(MemberProvider.EMAIL)
|
||||||
|
)
|
||||||
|
.fetch()
|
||||||
|
.size
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getTotalSignUpKakaoCount(startDate: LocalDateTime, endDate: LocalDateTime): Int {
|
||||||
|
return queryFactory
|
||||||
|
.select(member.id)
|
||||||
|
.from(member)
|
||||||
|
.where(
|
||||||
|
member.createdAt.goe(startDate),
|
||||||
|
member.createdAt.loe(endDate),
|
||||||
|
member.provider.eq(MemberProvider.KAKAO)
|
||||||
|
)
|
||||||
|
.fetch()
|
||||||
|
.size
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getTotalSignUpGoogleCount(startDate: LocalDateTime, endDate: LocalDateTime): Int {
|
||||||
|
return queryFactory
|
||||||
|
.select(member.id)
|
||||||
|
.from(member)
|
||||||
|
.where(
|
||||||
|
member.createdAt.goe(startDate),
|
||||||
|
member.createdAt.loe(endDate),
|
||||||
|
member.provider.eq(MemberProvider.GOOGLE)
|
||||||
|
)
|
||||||
|
.fetch()
|
||||||
|
.size
|
||||||
|
}
|
||||||
|
|
||||||
fun getTotalAuthCount(startDate: LocalDateTime, endDate: LocalDateTime): Int {
|
fun getTotalAuthCount(startDate: LocalDateTime, endDate: LocalDateTime): Int {
|
||||||
return queryFactory
|
return queryFactory
|
||||||
.select(auth.id)
|
.select(auth.id)
|
||||||
|
@ -92,6 +132,63 @@ class AdminMemberStatisticsRepository(private val queryFactory: JPAQueryFactory)
|
||||||
.fetch()
|
.fetch()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getSignUpEmailCountInRange(startDate: LocalDateTime, endDate: LocalDateTime): List<DateAndMemberCount> {
|
||||||
|
return queryFactory
|
||||||
|
.select(
|
||||||
|
QDateAndMemberCount(
|
||||||
|
getFormattedDate(member.createdAt),
|
||||||
|
member.id.countDistinct().castToNum(Int::class.java)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.from(member)
|
||||||
|
.where(
|
||||||
|
member.createdAt.goe(startDate),
|
||||||
|
member.createdAt.loe(endDate),
|
||||||
|
member.provider.eq(MemberProvider.EMAIL)
|
||||||
|
)
|
||||||
|
.groupBy(getFormattedDate(member.createdAt))
|
||||||
|
.orderBy(getFormattedDate(member.createdAt).desc())
|
||||||
|
.fetch()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getSignUpKakaoCountInRange(startDate: LocalDateTime, endDate: LocalDateTime): List<DateAndMemberCount> {
|
||||||
|
return queryFactory
|
||||||
|
.select(
|
||||||
|
QDateAndMemberCount(
|
||||||
|
getFormattedDate(member.createdAt),
|
||||||
|
member.id.countDistinct().castToNum(Int::class.java)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.from(member)
|
||||||
|
.where(
|
||||||
|
member.createdAt.goe(startDate),
|
||||||
|
member.createdAt.loe(endDate),
|
||||||
|
member.provider.eq(MemberProvider.KAKAO)
|
||||||
|
)
|
||||||
|
.groupBy(getFormattedDate(member.createdAt))
|
||||||
|
.orderBy(getFormattedDate(member.createdAt).desc())
|
||||||
|
.fetch()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getSignUpGoogleCountInRange(startDate: LocalDateTime, endDate: LocalDateTime): List<DateAndMemberCount> {
|
||||||
|
return queryFactory
|
||||||
|
.select(
|
||||||
|
QDateAndMemberCount(
|
||||||
|
getFormattedDate(member.createdAt),
|
||||||
|
member.id.countDistinct().castToNum(Int::class.java)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.from(member)
|
||||||
|
.where(
|
||||||
|
member.createdAt.goe(startDate),
|
||||||
|
member.createdAt.loe(endDate),
|
||||||
|
member.provider.eq(MemberProvider.GOOGLE)
|
||||||
|
)
|
||||||
|
.groupBy(getFormattedDate(member.createdAt))
|
||||||
|
.orderBy(getFormattedDate(member.createdAt).desc())
|
||||||
|
.fetch()
|
||||||
|
}
|
||||||
|
|
||||||
fun getAuthCountInRange(startDate: LocalDateTime, endDate: LocalDateTime): List<DateAndMemberCount> {
|
fun getAuthCountInRange(startDate: LocalDateTime, endDate: LocalDateTime): List<DateAndMemberCount> {
|
||||||
return queryFactory
|
return queryFactory
|
||||||
.select(
|
.select(
|
||||||
|
|
|
@ -46,6 +46,18 @@ class AdminMemberStatisticsService(private val repository: AdminMemberStatistics
|
||||||
.toLocalDateTime()
|
.toLocalDateTime()
|
||||||
|
|
||||||
val totalSignUpCount = repository.getTotalSignUpCount(startDate = startDateTime, endDate = endDateTime)
|
val totalSignUpCount = repository.getTotalSignUpCount(startDate = startDateTime, endDate = endDateTime)
|
||||||
|
val totalSignUpEmailCount = repository.getTotalSignUpEmailCount(
|
||||||
|
startDate = startDateTime,
|
||||||
|
endDate = endDateTime
|
||||||
|
)
|
||||||
|
val totalSignUpKakaoCount = repository.getTotalSignUpKakaoCount(
|
||||||
|
startDate = startDateTime,
|
||||||
|
endDate = endDateTime
|
||||||
|
)
|
||||||
|
val totalSignUpGoogleCount = repository.getTotalSignUpGoogleCount(
|
||||||
|
startDate = startDateTime,
|
||||||
|
endDate = endDateTime
|
||||||
|
)
|
||||||
val totalAuthCount = repository.getTotalAuthCount(startDate = startDateTime, endDate = endDateTime)
|
val totalAuthCount = repository.getTotalAuthCount(startDate = startDateTime, endDate = endDateTime)
|
||||||
val totalSignOutCount = repository.getTotalSignOutCount(startDate = startDateTime, endDate = endDateTime)
|
val totalSignOutCount = repository.getTotalSignOutCount(startDate = startDateTime, endDate = endDateTime)
|
||||||
val totalPaymentMemberCount = repository.getPaymentMemberCount(startDate = startDateTime, endDate = endDateTime)
|
val totalPaymentMemberCount = repository.getPaymentMemberCount(startDate = startDateTime, endDate = endDateTime)
|
||||||
|
@ -65,6 +77,21 @@ class AdminMemberStatisticsService(private val repository: AdminMemberStatistics
|
||||||
endDate = endDateTime
|
endDate = endDateTime
|
||||||
).associateBy({ it.date }, { it.memberCount })
|
).associateBy({ it.date }, { it.memberCount })
|
||||||
|
|
||||||
|
val signUpEmailCountInRange = repository.getSignUpEmailCountInRange(
|
||||||
|
startDate = startDateTime,
|
||||||
|
endDate = endDateTime
|
||||||
|
).associateBy({ it.date }, { it.memberCount })
|
||||||
|
|
||||||
|
val signUpKakaoCountInRange = repository.getSignUpKakaoCountInRange(
|
||||||
|
startDate = startDateTime,
|
||||||
|
endDate = endDateTime
|
||||||
|
).associateBy({ it.date }, { it.memberCount })
|
||||||
|
|
||||||
|
val signUpGoogleCountInRange = repository.getSignUpGoogleCountInRange(
|
||||||
|
startDate = startDateTime,
|
||||||
|
endDate = endDateTime
|
||||||
|
).associateBy({ it.date }, { it.memberCount })
|
||||||
|
|
||||||
val authCountInRange = repository.getAuthCountInRange(
|
val authCountInRange = repository.getAuthCountInRange(
|
||||||
startDate = startDateTime,
|
startDate = startDateTime,
|
||||||
endDate = endDateTime
|
endDate = endDateTime
|
||||||
|
@ -91,6 +118,9 @@ class AdminMemberStatisticsService(private val repository: AdminMemberStatistics
|
||||||
date = date,
|
date = date,
|
||||||
authCount = authCountInRange[date] ?: 0,
|
authCount = authCountInRange[date] ?: 0,
|
||||||
signUpCount = signUpCountInRange[date] ?: 0,
|
signUpCount = signUpCountInRange[date] ?: 0,
|
||||||
|
signUpEmailCount = signUpEmailCountInRange[date] ?: 0,
|
||||||
|
signUpKakaoCount = signUpKakaoCountInRange[date] ?: 0,
|
||||||
|
signUpGoogleCount = signUpGoogleCountInRange[date] ?: 0,
|
||||||
signOutCount = signOutCountInRange[date] ?: 0,
|
signOutCount = signOutCountInRange[date] ?: 0,
|
||||||
paymentMemberCount = paymentMemberCountInRangeMap[date] ?: 0
|
paymentMemberCount = paymentMemberCountInRangeMap[date] ?: 0
|
||||||
)
|
)
|
||||||
|
@ -101,6 +131,9 @@ class AdminMemberStatisticsService(private val repository: AdminMemberStatistics
|
||||||
totalCount = dateRange.totalDays,
|
totalCount = dateRange.totalDays,
|
||||||
totalAuthCount = totalAuthCount,
|
totalAuthCount = totalAuthCount,
|
||||||
totalSignUpCount = totalSignUpCount,
|
totalSignUpCount = totalSignUpCount,
|
||||||
|
totalSignUpEmailCount = totalSignUpEmailCount,
|
||||||
|
totalSignUpKakaoCount = totalSignUpKakaoCount,
|
||||||
|
totalSignUpGoogleCount = totalSignUpGoogleCount,
|
||||||
totalSignOutCount = totalSignOutCount,
|
totalSignOutCount = totalSignOutCount,
|
||||||
totalPaymentMemberCount = totalPaymentMemberCount,
|
totalPaymentMemberCount = totalPaymentMemberCount,
|
||||||
items = items
|
items = items
|
||||||
|
|
|
@ -4,6 +4,9 @@ data class GetMemberStatisticsResponse(
|
||||||
val totalCount: Int,
|
val totalCount: Int,
|
||||||
val totalAuthCount: Int,
|
val totalAuthCount: Int,
|
||||||
val totalSignUpCount: Int,
|
val totalSignUpCount: Int,
|
||||||
|
val totalSignUpEmailCount: Int,
|
||||||
|
val totalSignUpKakaoCount: Int,
|
||||||
|
val totalSignUpGoogleCount: Int,
|
||||||
val totalSignOutCount: Int,
|
val totalSignOutCount: Int,
|
||||||
val totalPaymentMemberCount: Int,
|
val totalPaymentMemberCount: Int,
|
||||||
val items: List<GetMemberStatisticsItem>
|
val items: List<GetMemberStatisticsItem>
|
||||||
|
@ -13,6 +16,9 @@ data class GetMemberStatisticsItem(
|
||||||
val date: String,
|
val date: String,
|
||||||
val authCount: Int,
|
val authCount: Int,
|
||||||
val signUpCount: Int,
|
val signUpCount: Int,
|
||||||
|
val signUpEmailCount: Int,
|
||||||
|
val signUpKakaoCount: Int,
|
||||||
|
val signUpGoogleCount: Int,
|
||||||
val signOutCount: Int,
|
val signOutCount: Int,
|
||||||
val paymentMemberCount: Int
|
val paymentMemberCount: Int
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue