feat: ga-core + ga-api + ga-batch + V13-V15 + Docker + frontend skeleton
ga-core (22 tables): - user/role: VO + Mapper + XML (login + RBAC) - org: Grade, Organization (CTE recursive tree), Agent + history - product: InsuranceCompany, Product, Contract - rule: CommissionRate, PayoutRule, OverrideRule, ChargebackRule, ExceptionTypeCode - receive: CompanyProfile, FieldMapping, CodeMapping, RawCommissionData, ParseError - ledger: Recruit, Maintain, Exception (batch insert + cursor) - settle: SettleMaster (UPSERT), Override, Chargeback, Payment, Reconciliation, BatchJobLog - All XMLs use EncryptTypeHandler for PII fields ga-api: - AuthController: login (lock on N fails), refresh, me, password, logout - Domain controllers: Agent, Organization, Contract, Company, Product, Rule, Receive, Ledger (recruit/maintain/exception + approve), Settle (confirm/hold/release), Payment, User, Role (matrix), BatchTrigger - All use @RequirePermission + @DataChangeLog ga-batch: - MonthlySettlementJob: 8 Steps (receiveData, transformData, reconcile, calcRecruit, calcMaintain, chargebackException, calcOverride, aggregate) - DataReceiver strategy + ManualReceiver, MappingEngine stub - CommissionCalculator (pct/tax via MoneyUtil), JobLauncherController DB V13~V15: - V13: 14 indexes (settle_master, ledgers, contract, chargeback, payment, raw, logs) - V14: create_monthly_partition() helper function - V15: v_agent_monthly_summary, v_org_settle_summary, v_chargeback_risk views Infra: - docker-compose: postgres + redis + api + batch + frontend - Multi-stage Dockerfile (gradle build → JRE) ga-frontend (skeleton): - Vite + React 18 + TypeScript + AntD 5 + AG Grid + React Query + Zustand - API request layer (axios + JWT), LoginPage, MainLayout (dynamic menu), Dashboard - nginx.conf for /api proxying
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
package com.ga.batch.config;
|
||||
|
||||
import com.ga.batch.settlement.SettlementContext;
|
||||
import org.springframework.batch.core.Job;
|
||||
import org.springframework.batch.core.Step;
|
||||
import org.springframework.batch.core.configuration.annotation.JobScope;
|
||||
import org.springframework.batch.core.job.builder.JobBuilder;
|
||||
import org.springframework.batch.core.repository.JobRepository;
|
||||
import org.springframework.batch.core.step.builder.StepBuilder;
|
||||
import org.springframework.batch.core.step.tasklet.Tasklet;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
|
||||
import com.ga.batch.settlement.step.*;
|
||||
|
||||
@Configuration
|
||||
public class BatchConfig {
|
||||
|
||||
@Bean
|
||||
@JobScope
|
||||
public SettlementContext settlementContext(@Value("#{jobParameters['settleMonth']}") String settleMonth,
|
||||
@Value("#{jobParameters['jobLogId'] ?: -1L}") Long jobLogId) {
|
||||
SettlementContext ctx = new SettlementContext();
|
||||
ctx.setSettleMonth(settleMonth);
|
||||
ctx.setJobLogId(jobLogId);
|
||||
return ctx;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Job monthlySettlementJob(JobRepository jobRepository,
|
||||
PlatformTransactionManager tx,
|
||||
ReceiveDataStep step1,
|
||||
TransformDataStep step2,
|
||||
ReconcileStep step3,
|
||||
CalcRecruitStep step4,
|
||||
CalcMaintainStep step5,
|
||||
ChargebackExceptionStep step6,
|
||||
CalcOverrideStep step7,
|
||||
AggregateStep step8) {
|
||||
return new JobBuilder("MONTHLY_SETTLEMENT", jobRepository)
|
||||
.start(taskletStep("receiveData", step1, jobRepository, tx))
|
||||
.next(taskletStep("transformData", step2, jobRepository, tx))
|
||||
.next(taskletStep("reconcile", step3, jobRepository, tx))
|
||||
.next(taskletStep("calcRecruit", step4, jobRepository, tx))
|
||||
.next(taskletStep("calcMaintain", step5, jobRepository, tx))
|
||||
.next(taskletStep("chargebackException", step6, jobRepository, tx))
|
||||
.next(taskletStep("calcOverride", step7, jobRepository, tx))
|
||||
.next(taskletStep("aggregate", step8, jobRepository, tx))
|
||||
.build();
|
||||
}
|
||||
|
||||
private Step taskletStep(String name, Tasklet tasklet,
|
||||
JobRepository jobRepository, PlatformTransactionManager tx) {
|
||||
return new StepBuilder(name, jobRepository)
|
||||
.tasklet(tasklet, tx)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user