fix(admin-charge-status): pgChargeAmount와 can의 가격을 가져와서 사용하는 로직을 제거하고 payment에 기록된 가격으로 계산하도록 수정 #346
@@ -32,7 +32,6 @@ class AdminChargeStatusQueryRepository(private val queryFactory: JPAQueryFactory
|
|||||||
QGetChargeStatusQueryDto(
|
QGetChargeStatusQueryDto(
|
||||||
formattedDate,
|
formattedDate,
|
||||||
payment.price.sum(),
|
payment.price.sum(),
|
||||||
can1.price.sum(),
|
|
||||||
payment.id.count(),
|
payment.id.count(),
|
||||||
payment.paymentGateway
|
payment.paymentGateway
|
||||||
)
|
)
|
||||||
|
@@ -25,12 +25,7 @@ class AdminChargeStatusService(val repository: AdminChargeStatusQueryRepository)
|
|||||||
|
|
||||||
val chargeStatusList = repository.getChargeStatus(startDate, endDate)
|
val chargeStatusList = repository.getChargeStatus(startDate, endDate)
|
||||||
.map {
|
.map {
|
||||||
val chargeAmount = if (it.paymentGateWay == PaymentGateway.PG) {
|
val chargeAmount = it.amount
|
||||||
it.pgChargeAmount
|
|
||||||
} else {
|
|
||||||
it.appleChargeAmount
|
|
||||||
}
|
|
||||||
|
|
||||||
val chargeCount = it.chargeCount
|
val chargeCount = it.chargeCount
|
||||||
|
|
||||||
totalChargeAmount += chargeAmount
|
totalChargeAmount += chargeAmount
|
||||||
|
@@ -6,8 +6,7 @@ import java.math.BigDecimal
|
|||||||
|
|
||||||
data class GetChargeStatusQueryDto @QueryProjection constructor(
|
data class GetChargeStatusQueryDto @QueryProjection constructor(
|
||||||
val date: String,
|
val date: String,
|
||||||
val appleChargeAmount: BigDecimal,
|
val amount: BigDecimal,
|
||||||
val pgChargeAmount: BigDecimal,
|
|
||||||
val chargeCount: Long,
|
val chargeCount: Long,
|
||||||
val paymentGateWay: PaymentGateway
|
val paymentGateWay: PaymentGateway
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user