260723_03_ENH: unitPrice의 Price BigDecimal로 변경

This commit is contained in:
2026-07-23 16:45:48 +09:00
parent 209b34720e
commit 1428f7e133
4 changed files with 6 additions and 5 deletions

View File

@@ -47,14 +47,14 @@ public class SendCostSummaryWithItrntPrjctDto {
Short sendTy,
Short sendCorp,
Long sendCnt,
Integer unitPrice
BigDecimal unitPrice
) {
this.reqstSvc = reqstSvc;
this.itrntPrjctCd = itrntPrjctCd;
this.sendTy = sendTy;
this.sendCorp = sendCorp;
this.sendCnt = sendCnt;
this.unitPrice = unitPrice != null ? BigDecimal.valueOf(unitPrice) : BigDecimal.ZERO;
this.unitPrice = unitPrice != null ? unitPrice : BigDecimal.ZERO;
this.totalPrice = this.unitPrice.multiply(BigDecimal.valueOf(sendCnt != null ? sendCnt : 0L));
}
}

View File

@@ -8,6 +8,7 @@ import jakarta.persistence.Id;
import jakarta.persistence.Table;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.Instant;
import lombok.Getter;
import lombok.Setter;
@@ -34,7 +35,7 @@ public class TUnitPriceEntity {
@NotNull
@Column(name = "price", nullable = false)
private Integer price;
private BigDecimal price;
@NotNull
@Column(name = "is_use", nullable = false)

View File

@@ -221,7 +221,7 @@ public interface SendRepository extends JpaRepository<TSendEntity, Long> {
s.sendTy,
s.sendCorp,
count(s),
coalesce(up.price, 0)
up.price
)
from TSendEntity s
left join TUnitPriceEntity up

View File

@@ -294,7 +294,7 @@ public class ReportService {
TUnitPriceEntity unitPrice
) {
BigDecimal price = unitPrice != null
? BigDecimal.valueOf(unitPrice.getPrice())
? unitPrice.getPrice()
: BigDecimal.ZERO;
Long successCount = summary != null ? summary.getSuccessCount() : 0L;
Long failCount = summary != null ? summary.getFailCount() : 0L;