fix: critical bugs + admin account (V16)
Bugs:
- MyBatisConfig: @MapperScan basePackages corrected to scan all com.ga.* by @Mapper annotation (was missing common.code/menu/system/file/notification)
- CalcRecruitStep: endDate was first day of month (only contracts on day 1 were picked); now full month range via DateUtil.getMonthRange
- EncryptTypeHandler: removed @MappedTypes(String.class) to prevent encrypting all String columns; now requires explicit per-column typeHandler
- mybatis-config.xml: removed redundant javaType for JsonTypeHandler (uses @MappedTypes)
V16 admin initial data:
- Child menus (24): ORG_TREE, ORG_AGENT, CONTRACT_LIST, COMPANY, PRODUCT,
RULE_*, RECEIVE_*, LEDGER_*, SETTLE_LIST, BATCH_RUN, PAYMENT, SYSTEM_*
- Permissions for each PAGE menu × {READ,CREATE,UPDATE,DELETE,APPROVE,EXPORT}
- SUPER_ADMIN: full grants
- ADMIN: all except SYSTEM
- MANAGER: READ/CREATE/UPDATE/EXPORT except SYSTEM
- AGENT: READ on LEDGER_*, SETTLE_LIST
- admin user (login_id=admin, pw=admin1234!) mapped to SUPER_ADMIN
This commit is contained in:
@@ -2,6 +2,7 @@ package com.ga.batch.settlement.step;
|
||||
|
||||
import com.ga.batch.settlement.SettlementContext;
|
||||
import com.ga.batch.settlement.calc.CommissionCalculator;
|
||||
import com.ga.common.util.DateUtil;
|
||||
import com.ga.common.util.MoneyUtil;
|
||||
import com.ga.core.mapper.ledger.RecruitLedgerMapper;
|
||||
import com.ga.core.mapper.product.ContractMapper;
|
||||
@@ -17,7 +18,6 @@ import org.springframework.batch.core.step.tasklet.Tasklet;
|
||||
import org.springframework.batch.repeat.RepeatStatus;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -44,9 +44,10 @@ public class CalcRecruitStep implements Tasklet {
|
||||
log.info("[Step4 calcRecruit] settleMonth={}", ctx.getSettleMonth());
|
||||
|
||||
// 모집수수료 대상: 계약일이 정산월에 해당하는 계약
|
||||
String[] range = DateUtil.getMonthRange(ctx.getSettleMonth());
|
||||
ContractSearchParam param = new ContractSearchParam();
|
||||
param.setStartDate(ctx.getSettleMonth().substring(0, 4) + "-" + ctx.getSettleMonth().substring(4) + "-01");
|
||||
param.setEndDate(param.getStartDate());
|
||||
param.setStartDate(range[0]);
|
||||
param.setEndDate(range[1]);
|
||||
param.setPageSize(Integer.MAX_VALUE);
|
||||
List<ContractResp> contracts = contractMapper.selectList(param);
|
||||
|
||||
@@ -74,16 +75,4 @@ public class CalcRecruitStep implements Tasklet {
|
||||
log.info("[Step4] recruit ledger inserted: {}", total);
|
||||
return RepeatStatus.FINISHED;
|
||||
}
|
||||
|
||||
/** 정산월의 첫날 / 마지막날 — calcRecruit 대상 기간 */
|
||||
private static String[] monthRange(String yyyymm) {
|
||||
int year = Integer.parseInt(yyyymm.substring(0, 4));
|
||||
int month = Integer.parseInt(yyyymm.substring(4));
|
||||
java.time.YearMonth ym = java.time.YearMonth.of(year, month);
|
||||
return new String[]{ym.atDay(1).toString(), ym.atEndOfMonth().toString()};
|
||||
}
|
||||
|
||||
/** 외부에서 사용할 수도 있는 헬퍼 */
|
||||
@SuppressWarnings("unused")
|
||||
private BigDecimal premiumOrZero(ContractResp c) { return MoneyUtil.zero(c.getPremium()); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user