260723_03_ENH: unitPrice의 Price BigDecimal로 변경
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user