parent
6588677d80
commit
71686720c1
@ -0,0 +1,69 @@
|
||||
package go.kr.project.crdn.crndRegistAndView.main.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import go.kr.project.common.model.PagingVO;
|
||||
import lombok.*;
|
||||
import org.apache.poi.hpsf.Decimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* packageName : go.kr.project.crdn.crndRegistAndView.main.model
|
||||
* fileName : CrdnCmpttnRt2VO
|
||||
* author : 박성영
|
||||
* date : 25. 9. 18.
|
||||
* description :
|
||||
* ===========================================================
|
||||
* DATE AUTHOR NOTE
|
||||
* -----------------------------------------------------------
|
||||
* 25. 9. 18. 박성영 최초 생성
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
public class CrdnCmpttnRt2VO {
|
||||
|
||||
private String cmpttnRt2Cd;
|
||||
private String vltnMttr;
|
||||
private BigDecimal cmpttnRt2;
|
||||
private BigDecimal cmpttnRt2Rate;
|
||||
private String useYn;
|
||||
|
||||
/** 등록 일시 */
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Seoul")
|
||||
private LocalDateTime regDt;
|
||||
|
||||
/** 등록자 */
|
||||
private String rgtr;
|
||||
|
||||
/** 수정 일시 */
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Seoul")
|
||||
private LocalDateTime mdfcnDt;
|
||||
|
||||
/** 수정자 */
|
||||
private String mdfr;
|
||||
|
||||
/**
|
||||
* cmpttnRt2 값을 설정할 때, 100으로 나눈 비율 값을 cmpttnRt2Rate에 자동으로 설정합니다.
|
||||
* @param cmpttnRt2 원본 비율 값 (예: 90, 70)
|
||||
*/
|
||||
public void setCmpttnRt2(BigDecimal cmpttnRt2) {
|
||||
// 중요로직: cmpttnRt2(산정률)이 설정될 때, cmpttnRt2Rate(계산용 비율)을 자동으로 계산하여 설정합니다.
|
||||
// 예를 들어 cmpttnRt2가 90이면, cmpttnRt2Rate는 0.90이 됩니다.
|
||||
this.cmpttnRt2 = cmpttnRt2;
|
||||
|
||||
if (cmpttnRt2 != null) {
|
||||
// 100으로 나누고, 소수점 2자리까지 반올림하여 설정
|
||||
this.cmpttnRt2Rate = cmpttnRt2.divide(new BigDecimal("100"), 2, java.math.RoundingMode.HALF_UP);
|
||||
} else {
|
||||
this.cmpttnRt2Rate = null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue