feat: 분급 비율 회차(월) 단위 등록 지원 (V81)
- installment_ratio.plan_month INT NULL 컬럼 추가 - NULL = 연 단위(연차 합계, 기존 동작) - 1~12 = 해당 회차(월) 단위 비율 - UNIQUE 재정의: NULLS NOT DISTINCT (product_category, plan_year, plan_month, effective_from) - InstallmentPlanGenerator: planMonth=NULL이면 1, NOT NULL이면 그대로 사용해 settle_month 계산 - 분급비율 화면: 회차(월) 컬럼·입력 추가, "(연차-1)*12+월" 통합 회차 표기
This commit is contained in:
@@ -34,11 +34,16 @@ public class InstallmentPlanGenerator {
|
||||
|
||||
List<InstallmentPlanVO> plans = new ArrayList<>();
|
||||
for (InstallmentRatioVO ratio : ratios) {
|
||||
// 마스터의 plan_month 가 NULL 이면 연 단위(첫 달 지급), NOT NULL 이면 그 회차(월) 그대로 사용.
|
||||
int planMonth = ratio.getPlanMonth() != null ? ratio.getPlanMonth() : 1;
|
||||
|
||||
InstallmentPlanVO plan = new InstallmentPlanVO();
|
||||
plan.setContractId(contractId);
|
||||
plan.setPlanYear(ratio.getPlanYear());
|
||||
plan.setPlanMonth(1); // 단순화: 연 1회 지급 (plan_month=1)
|
||||
plan.setSettleMonth(contractDate.plusYears(ratio.getPlanYear()).format(MONTH_FMT));
|
||||
plan.setPlanMonth(planMonth);
|
||||
plan.setSettleMonth(
|
||||
contractDate.plusYears(ratio.getPlanYear()).plusMonths(planMonth - 1L).format(MONTH_FMT)
|
||||
);
|
||||
plan.setExpectedAmount(
|
||||
totalCommission.multiply(ratio.getRatioPercent())
|
||||
.divide(BigDecimal.valueOf(100), 0, RoundingMode.HALF_UP)
|
||||
|
||||
@@ -121,6 +121,7 @@ public class InstallmentService {
|
||||
InstallmentRatioVO vo = new InstallmentRatioVO();
|
||||
vo.setProductCategory(req.getProductCategory());
|
||||
vo.setPlanYear(req.getPlanYear());
|
||||
vo.setPlanMonth(req.getPlanMonth()); // null=연 단위, 1~12=회차(월) 단위
|
||||
vo.setRatioPercent(req.getRatioPercent());
|
||||
vo.setEffectiveFrom(req.getEffectiveFrom());
|
||||
vo.setEffectiveTo(req.getEffectiveTo());
|
||||
|
||||
Reference in New Issue
Block a user