feat: 수수료 갭 보완 4종 — 지급보류/환수원천세역분개/연체이자/간이지급명세서 (V124~V126)

감사(서브에이전트 3영역)로 발견한 실제 결함/규제 갭만 선별 보완.

- A 지급보류(HOLD) 지급배치 누락 버그: PaymentBatchItemMapper.insertFromSettleMaster
  status NOT IN('PAID','HOLD') — 보류건이 지급배치에 포함되어 실제 이체되던 결함 수정
- B 환수 원천세 역분개: withholding_tax_adjustment(V124) 멱등 적재 +
  분기 원천세신고 집계 netting(payment UNION ALL adjustment). settle_master 금액흐름 불변
- C 환수채권 연체이자: clawback_receivable.accrued_interest + clawback_interest(V125) +
  ClawbackInterestCalculator(연율/1200), config 기본 0 = 안전폴백, 기존 FIFO 상계가 이자 회수
- D 사업소득 간이지급명세서(월별): commission_statement(MONTHLY) 위 읽기전용 리포트 +
  메뉴 REPORT_SIMPLIFIED_PAYMENT(V126) + 프론트 SimplifiedPaymentReport

검증: ./gradlew build 전모듈 GREEN, 신규 단위테스트 6건, ga-frontend tsc -b PASS,
Flyway V124~V126 운영DB 적용(v126), 적대리뷰 APPROVED(LOW 1건 GREATEST 클램프 즉수정),
B/C/D 라이브DB 검증(롤백) + D admin e2e list/export 200.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
GA Pro
2026-06-08 21:22:13 +09:00
parent ff6d399dd3
commit fbbabf2d04
29 changed files with 832 additions and 19 deletions
@@ -7,6 +7,7 @@ import com.ga.common.model.ApiResponse;
import com.ga.core.vo.report.ChargebackRiskRow;
import com.ga.core.vo.report.OrgReportRow;
import com.ga.core.vo.report.PerfReportRow;
import com.ga.core.vo.report.SimplifiedPaymentRow;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
@@ -81,4 +82,19 @@ public class ReportController {
excelService.exportLargeExcel("환수위험리포트", ChargebackRiskRow.class,
() -> service.chargebackRiskCursor(), response);
}
// ── 사업소득 간이지급명세서 (월별) ──
@GetMapping("/simplified-payment")
@RequirePermission(menu = "REPORT_SIMPLIFIED_PAYMENT", perm = "READ")
public ApiResponse<List<SimplifiedPaymentRow>> simplifiedPayment(@RequestParam(required = false) String settleMonth) {
return ApiResponse.ok(service.simplifiedPayment(defaultMonth(settleMonth)));
}
@GetMapping("/simplified-payment/export")
@RequirePermission(menu = "REPORT_SIMPLIFIED_PAYMENT", perm = "READ")
public void simplifiedPaymentExport(@RequestParam(required = false) String settleMonth, HttpServletResponse response) {
String m = defaultMonth(settleMonth);
excelService.exportLargeExcel("간이지급명세서_" + m, SimplifiedPaymentRow.class,
() -> service.simplifiedPaymentCursor(m), response);
}
}
@@ -4,6 +4,7 @@ import com.ga.core.mapper.report.ReportMapper;
import com.ga.core.vo.report.ChargebackRiskRow;
import com.ga.core.vo.report.OrgReportRow;
import com.ga.core.vo.report.PerfReportRow;
import com.ga.core.vo.report.SimplifiedPaymentRow;
import lombok.RequiredArgsConstructor;
import org.apache.ibatis.cursor.Cursor;
import org.springframework.stereotype.Service;
@@ -47,4 +48,13 @@ public class ReportService {
public Cursor<ChargebackRiskRow> chargebackRiskCursor() {
return mapper.selectChargebackRiskCursor();
}
@Transactional(readOnly = true)
public List<SimplifiedPaymentRow> simplifiedPayment(String settleMonth) {
return mapper.selectSimplifiedPayment(settleMonth);
}
public Cursor<SimplifiedPaymentRow> simplifiedPaymentCursor(String settleMonth) {
return mapper.selectSimplifiedPaymentCursor(settleMonth);
}
}