크리에이터 관리자, 관리자 - 일자별 콘텐츠 후원 정산 API #90
| @@ -129,6 +129,7 @@ class AdminCalculateQueryRepository(private val queryFactory: JPAQueryFactory) { | ||||
|                 QGetCalculateContentDonationQueryData( | ||||
|                     member.nickname, | ||||
|                     audioContent.title, | ||||
|                     audioContent.price, | ||||
|                     getFormattedDate(audioContent.createdAt), | ||||
|                     donationFormattedDate, | ||||
|                     useCan.id.count(), | ||||
|   | ||||
| @@ -195,7 +195,7 @@ class AdminCalculateService(private val repository: AdminCalculateQueryRepositor | ||||
|     @Transactional(readOnly = true) | ||||
|     @Cacheable( | ||||
|         cacheNames = ["cache_ttl_3_hours"], | ||||
|         key = "'calculateContentDonationList:' + " + "#startDateStr + ':' + #endDateStr" | ||||
|         key = "'calculateContentDonationList2:' + " + "#startDateStr + ':' + #endDateStr" | ||||
|     ) | ||||
|     fun getCalculateContentDonationList( | ||||
|         startDateStr: String, | ||||
| @@ -222,8 +222,14 @@ class AdminCalculateService(private val repository: AdminCalculateQueryRepositor | ||||
|                 // 결제수수료 : 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 | ||||
| @@ -234,6 +240,11 @@ class AdminCalculateService(private val repository: AdminCalculateQueryRepositor | ||||
|                 GetCalculateContentDonationResponse( | ||||
|                     nickname = it.nickname, | ||||
|                     title = it.title, | ||||
|                     paidOrFree = if (it.price > 0) { | ||||
|                         "유료" | ||||
|                     } else { | ||||
|                         "무료" | ||||
|                     }, | ||||
|                     registrationDate = it.registrationDate, | ||||
|                     donationDate = it.donationDate, | ||||
|                     numberOfDonation = it.numberOfDonation.toInt(), | ||||
|   | ||||
| @@ -7,6 +7,8 @@ data class GetCalculateContentDonationQueryData @QueryProjection constructor( | ||||
|     val nickname: String, | ||||
|     // 콘텐츠 제목 | ||||
|     val title: String, | ||||
|     // 콘텐츠 가격 | ||||
|     val price: Int, | ||||
|     // 콘텐츠 등록 날짜 | ||||
|     val registrationDate: String, | ||||
|     // 후원 날짜 | ||||
|   | ||||
| @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty | ||||
| data class GetCalculateContentDonationResponse( | ||||
|     @JsonProperty("nickname") val nickname: String, | ||||
|     @JsonProperty("title") val title: String, | ||||
|     @JsonProperty("paidOrFree") val paidOrFree: String, | ||||
|     @JsonProperty("registrationDate") val registrationDate: String, | ||||
|     @JsonProperty("donationDate") val donationDate: String, | ||||
|     @JsonProperty("numberOfDonation") val numberOfDonation: Int, | ||||
|   | ||||
| @@ -224,6 +224,7 @@ class CreatorAdminCalculateQueryRepository(private val queryFactory: JPAQueryFac | ||||
|                 QGetCalculateContentDonationQueryData( | ||||
|                     member.nickname, | ||||
|                     audioContent.title, | ||||
|                     audioContent.price, | ||||
|                     getFormattedDate(audioContent.createdAt), | ||||
|                     donationFormattedDate, | ||||
|                     useCan.id.count(), | ||||
|   | ||||
| @@ -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(), | ||||
|   | ||||
		Reference in New Issue
	
	Block a user