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 sendTy,
Short sendCorp, Short sendCorp,
Long sendCnt, Long sendCnt,
Integer unitPrice BigDecimal unitPrice
) { ) {
this.reqstSvc = reqstSvc; this.reqstSvc = reqstSvc;
this.itrntPrjctCd = itrntPrjctCd; this.itrntPrjctCd = itrntPrjctCd;
this.sendTy = sendTy; this.sendTy = sendTy;
this.sendCorp = sendCorp; this.sendCorp = sendCorp;
this.sendCnt = sendCnt; 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)); 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.persistence.Table;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size; import jakarta.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.Instant; import java.time.Instant;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@@ -34,7 +35,7 @@ public class TUnitPriceEntity {
@NotNull @NotNull
@Column(name = "price", nullable = false) @Column(name = "price", nullable = false)
private Integer price; private BigDecimal price;
@NotNull @NotNull
@Column(name = "is_use", nullable = false) @Column(name = "is_use", nullable = false)

View File

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

View File

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