크리에이터 관리자, 관리자 - 일자별 콘텐츠 후원 정산 API

- 유료콘텐츠 후원 정산 90%
- 무료콘텐츠 후원 정산 70%
This commit is contained in:
2023-11-14 22:01:05 +09:00
parent dcd6933824
commit 5a75972f26
6 changed files with 33 additions and 6 deletions

View File

@@ -224,6 +224,7 @@ class CreatorAdminCalculateQueryRepository(private val queryFactory: JPAQueryFac
QGetCalculateContentDonationQueryData(
member.nickname,
audioContent.title,
audioContent.price,
getFormattedDate(audioContent.createdAt),
donationFormattedDate,
useCan.id.count(),

View File

@@ -210,7 +210,7 @@ class CreatorAdminCalculateService(private val repository: CreatorAdminCalculate
@Transactional(readOnly = true)
@Cacheable(
cacheNames = ["cache_ttl_3_hours"],
key = "'creatorCalculateContentDonationList:' + " +
key = "'creatorCalculateContentDonationList2:' + " +
"#startDateStr + ':' + #endDateStr + ':' + #memberId + ':' + #offset + ':' + #limit"
)
fun getCalculateContentDonationList(
@@ -242,8 +242,14 @@ class CreatorAdminCalculateService(private val repository: CreatorAdminCalculate
// 결제수수료 : 6.6%
val paymentFee = totalKrw * 0.066f
// 정산금액 = (원화 - 결제수수료) 의 70%
val settlementAmount = (totalKrw.toFloat() - paymentFee) * 0.7
// 정산금액
// 유료콘텐츠 (원화 - 결제수수료) 의 90%
// 무료콘텐츠 (원화 - 결제수수료) 의 70%
val settlementAmount = if (it.price > 0) {
(totalKrw.toFloat() - paymentFee) * 0.9
} else {
(totalKrw.toFloat() - paymentFee) * 0.7
}
// 원천세 = 정산금액의 3.3%
val tax = settlementAmount * 0.033
@@ -254,6 +260,11 @@ class CreatorAdminCalculateService(private val repository: CreatorAdminCalculate
GetCalculateContentDonationResponse(
nickname = it.nickname,
title = it.title,
paidOrFree = if (it.price > 0) {
"유료"
} else {
"무료"
},
registrationDate = it.registrationDate,
donationDate = it.donationDate,
numberOfDonation = it.numberOfDonation.toInt(),