Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e2e5c4e61d |
@@ -0,0 +1,13 @@
|
|||||||
|
package com.ga.core.enums;
|
||||||
|
|
||||||
|
/** 설계사 상태 (V1.agent.status, 코드그룹 AGENT_STATUS) */
|
||||||
|
public enum AgentStatus {
|
||||||
|
ACTIVE, // 재직
|
||||||
|
LEAVE, // 휴직
|
||||||
|
SUSPEND; // 정지
|
||||||
|
|
||||||
|
public static AgentStatus parse(String s) {
|
||||||
|
if (s == null) return null;
|
||||||
|
try { return AgentStatus.valueOf(s); } catch (Exception e) { return null; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.ga.core.enums;
|
||||||
|
|
||||||
|
/** 배치 잡 상태 (V7.batch_job_log.status) */
|
||||||
|
public enum BatchJobStatus {
|
||||||
|
STARTED,
|
||||||
|
RUNNING,
|
||||||
|
COMPLETED,
|
||||||
|
FAILED,
|
||||||
|
STOPPED;
|
||||||
|
|
||||||
|
public static BatchJobStatus parse(String s) {
|
||||||
|
if (s == null) return null;
|
||||||
|
try { return BatchJobStatus.valueOf(s); } catch (Exception e) { return null; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.ga.core.enums;
|
||||||
|
|
||||||
|
/** 계약 상태 (V2.contract.status, 코드그룹 CONTRACT_STATUS) */
|
||||||
|
public enum ContractStatus {
|
||||||
|
NEW, // 신규
|
||||||
|
ACTIVE, // 정상
|
||||||
|
LAPSED, // 실효
|
||||||
|
REVIVED, // 부활
|
||||||
|
CANCELLED, // 해지
|
||||||
|
EXPIRED; // 만기
|
||||||
|
|
||||||
|
public static ContractStatus parse(String s) {
|
||||||
|
if (s == null) return null;
|
||||||
|
try { return ContractStatus.valueOf(s); } catch (Exception e) { return null; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.ga.core.enums;
|
||||||
|
|
||||||
|
/** 수신 데이터 파싱 상태 (V4.raw_commission_data.parse_status) */
|
||||||
|
public enum ParseStatus {
|
||||||
|
PENDING, // 대기
|
||||||
|
OK, // 성공
|
||||||
|
ERROR; // 실패
|
||||||
|
|
||||||
|
public static ParseStatus parse(String s) {
|
||||||
|
if (s == null) return null;
|
||||||
|
try { return ParseStatus.valueOf(s); } catch (Exception e) { return null; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.ga.core.enums;
|
||||||
|
|
||||||
|
/** 지급 상태 (V6.payment.pay_status, 코드그룹 PAY_STATUS) */
|
||||||
|
public enum PaymentStatus {
|
||||||
|
PENDING, // 대기
|
||||||
|
SENT, // 송신
|
||||||
|
DONE, // 완료
|
||||||
|
FAIL; // 실패
|
||||||
|
|
||||||
|
public static PaymentStatus parse(String s) {
|
||||||
|
if (s == null) return null;
|
||||||
|
try { return PaymentStatus.valueOf(s); } catch (Exception e) { return null; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.ga.core.enums;
|
||||||
|
|
||||||
|
/** 정산 상태 (V6.settle_master.status, 코드그룹 SETTLE_STATUS) */
|
||||||
|
public enum SettleStatus {
|
||||||
|
DRAFT, // 산출중
|
||||||
|
CALCULATED, // 계산완료
|
||||||
|
REVIEW, // 검토
|
||||||
|
CONFIRMED, // 확정
|
||||||
|
HOLD, // 보류
|
||||||
|
PAID; // 지급완료
|
||||||
|
|
||||||
|
public static SettleStatus parse(String s) {
|
||||||
|
if (s == null) return null;
|
||||||
|
try { return SettleStatus.valueOf(s); } catch (Exception e) { return null; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.ga.core.mapper.org;
|
package com.ga.core.mapper.org;
|
||||||
|
|
||||||
|
import com.ga.core.vo.org.GradeResp;
|
||||||
|
import com.ga.core.vo.org.GradeSearchParam;
|
||||||
import com.ga.core.vo.org.GradeVO;
|
import com.ga.core.vo.org.GradeVO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@@ -14,4 +16,9 @@ public interface GradeMapper {
|
|||||||
int insert(GradeVO vo);
|
int insert(GradeVO vo);
|
||||||
int update(GradeVO vo);
|
int update(GradeVO vo);
|
||||||
int deleteById(@Param("gradeId") Long gradeId);
|
int deleteById(@Param("gradeId") Long gradeId);
|
||||||
|
|
||||||
|
/** 신규: 화면용 Resp + SearchParam */
|
||||||
|
List<GradeResp> selectRespList(GradeSearchParam param);
|
||||||
|
GradeResp selectRespById(@Param("gradeId") Long gradeId);
|
||||||
|
int countAgents(@Param("gradeId") Long gradeId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.ga.core.mapper.org;
|
package com.ga.core.mapper.org;
|
||||||
|
|
||||||
import com.ga.core.vo.org.OrganizationResp;
|
import com.ga.core.vo.org.OrganizationResp;
|
||||||
|
import com.ga.core.vo.org.OrganizationSearchParam;
|
||||||
import com.ga.core.vo.org.OrganizationVO;
|
import com.ga.core.vo.org.OrganizationVO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@@ -13,6 +14,8 @@ public interface OrganizationMapper {
|
|||||||
List<OrganizationResp> selectList(@Param("keyword") String keyword,
|
List<OrganizationResp> selectList(@Param("keyword") String keyword,
|
||||||
@Param("orgType") String orgType,
|
@Param("orgType") String orgType,
|
||||||
@Param("isActive") String isActive);
|
@Param("isActive") String isActive);
|
||||||
|
/** 신규: SearchParam 기반 페이징 검색 */
|
||||||
|
List<OrganizationResp> selectByParam(OrganizationSearchParam param);
|
||||||
OrganizationVO selectById(@Param("orgId") Long orgId);
|
OrganizationVO selectById(@Param("orgId") Long orgId);
|
||||||
/** 자기 자신 + 모든 하위 조직 ID (CTE 재귀) */
|
/** 자기 자신 + 모든 하위 조직 ID (CTE 재귀) */
|
||||||
List<Long> selectDescendantIds(@Param("orgId") Long orgId);
|
List<Long> selectDescendantIds(@Param("orgId") Long orgId);
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.ga.core.mapper.product;
|
package com.ga.core.mapper.product;
|
||||||
|
|
||||||
|
import com.ga.core.vo.product.InsuranceCompanyResp;
|
||||||
|
import com.ga.core.vo.product.InsuranceCompanySearchParam;
|
||||||
import com.ga.core.vo.product.InsuranceCompanyVO;
|
import com.ga.core.vo.product.InsuranceCompanyVO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@@ -15,4 +17,9 @@ public interface InsuranceCompanyMapper {
|
|||||||
int insert(InsuranceCompanyVO vo);
|
int insert(InsuranceCompanyVO vo);
|
||||||
int update(InsuranceCompanyVO vo);
|
int update(InsuranceCompanyVO vo);
|
||||||
int deleteById(@Param("companyId") Long companyId);
|
int deleteById(@Param("companyId") Long companyId);
|
||||||
|
|
||||||
|
/** 신규 */
|
||||||
|
List<InsuranceCompanyResp> selectRespList(InsuranceCompanySearchParam param);
|
||||||
|
InsuranceCompanyResp selectRespById(@Param("companyId") Long companyId);
|
||||||
|
int existsByCode(@Param("companyCode") String companyCode);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,4 +19,7 @@ public interface ProductMapper {
|
|||||||
int insert(ProductVO vo);
|
int insert(ProductVO vo);
|
||||||
int update(ProductVO vo);
|
int update(ProductVO vo);
|
||||||
int deleteById(@Param("productId") Long productId);
|
int deleteById(@Param("productId") Long productId);
|
||||||
|
|
||||||
|
/** 신규: SearchParam 기반 페이징 검색 */
|
||||||
|
List<ProductResp> selectByParam(com.ga.core.vo.product.ProductSearchParam param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,4 +51,17 @@ public interface ReceiveMapper {
|
|||||||
@Param("status") String status,
|
@Param("status") String status,
|
||||||
@Param("note") String note,
|
@Param("note") String note,
|
||||||
@Param("userId") Long userId);
|
@Param("userId") Long userId);
|
||||||
|
|
||||||
|
// ===================== 신규: Resp + SearchParam =====================
|
||||||
|
List<CompanyProfileResp> selectProfileResp(CompanyProfileSearchParam param);
|
||||||
|
CompanyProfileResp selectProfileRespByCode(@Param("companyCode") String companyCode);
|
||||||
|
|
||||||
|
List<CompanyFieldMappingResp> selectFieldMappingResp(@Param("companyCode") String companyCode,
|
||||||
|
@Param("targetTable") String targetTable);
|
||||||
|
|
||||||
|
List<CodeMappingResp> selectCodeMappingResp(CodeMappingSearchParam param);
|
||||||
|
|
||||||
|
List<RawCommissionDataResp> selectRawResp(RawCommissionDataSearchParam param);
|
||||||
|
|
||||||
|
List<ParseErrorLogResp> selectErrorResp(ParseErrorLogSearchParam param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,4 +57,11 @@ public interface RuleMapper {
|
|||||||
ExceptionTypeCodeVO selectExceptionCode(@Param("exceptionCode") String exceptionCode);
|
ExceptionTypeCodeVO selectExceptionCode(@Param("exceptionCode") String exceptionCode);
|
||||||
int insertExceptionCode(ExceptionTypeCodeVO vo);
|
int insertExceptionCode(ExceptionTypeCodeVO vo);
|
||||||
int updateExceptionCode(ExceptionTypeCodeVO vo);
|
int updateExceptionCode(ExceptionTypeCodeVO vo);
|
||||||
|
|
||||||
|
// ===================== 신규: Resp + SearchParam =====================
|
||||||
|
List<CommissionRateResp> selectCommissionRateResp(CommissionRateSearchParam param);
|
||||||
|
List<PayoutRuleResp> selectPayoutRuleResp(PayoutRuleSearchParam param);
|
||||||
|
List<OverrideRuleResp> selectOverrideRuleResp(OverrideRuleSearchParam param);
|
||||||
|
List<ChargebackRuleResp> selectChargebackRuleResp(ChargebackRuleSearchParam param);
|
||||||
|
List<ExceptionTypeCodeResp> selectExceptionTypeCodeResp(ExceptionTypeCodeSearchParam param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,4 +15,7 @@ public interface BatchJobLogMapper {
|
|||||||
List<BatchJobLogVO> selectList(@Param("jobName") String jobName,
|
List<BatchJobLogVO> selectList(@Param("jobName") String jobName,
|
||||||
@Param("settleMonth") String settleMonth);
|
@Param("settleMonth") String settleMonth);
|
||||||
int isRunning(@Param("jobName") String jobName);
|
int isRunning(@Param("jobName") String jobName);
|
||||||
|
|
||||||
|
/** 신규 */
|
||||||
|
List<com.ga.core.vo.settle.BatchJobLogResp> selectRespList(com.ga.core.vo.settle.BatchJobLogSearchParam param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,4 +20,7 @@ public interface ChargebackMapper {
|
|||||||
|
|
||||||
List<Map<String, Object>> aggregateByAgent(@Param("settleMonth") String settleMonth);
|
List<Map<String, Object>> aggregateByAgent(@Param("settleMonth") String settleMonth);
|
||||||
BigDecimal sumByMonth(@Param("settleMonth") String settleMonth);
|
BigDecimal sumByMonth(@Param("settleMonth") String settleMonth);
|
||||||
|
|
||||||
|
/** 신규 */
|
||||||
|
List<com.ga.core.vo.settle.ChargebackResp> selectRespList(com.ga.core.vo.settle.ChargebackSearchParam param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,4 +18,7 @@ public interface OverrideSettleMapper {
|
|||||||
/** 정산월 + 상위설계사별 override 합계 */
|
/** 정산월 + 상위설계사별 override 합계 */
|
||||||
List<Map<String, Object>> aggregateByUpper(@Param("settleMonth") String settleMonth);
|
List<Map<String, Object>> aggregateByUpper(@Param("settleMonth") String settleMonth);
|
||||||
BigDecimal sumByMonth(@Param("settleMonth") String settleMonth);
|
BigDecimal sumByMonth(@Param("settleMonth") String settleMonth);
|
||||||
|
|
||||||
|
/** 신규 */
|
||||||
|
List<com.ga.core.vo.settle.OverrideSettleResp> selectRespList(com.ga.core.vo.settle.OverrideSettleSearchParam param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,4 +19,8 @@ public interface PaymentMapper {
|
|||||||
@Param("failReason") String failReason);
|
@Param("failReason") String failReason);
|
||||||
int updateTransferFile(@Param("paymentIds") List<Long> paymentIds,
|
int updateTransferFile(@Param("paymentIds") List<Long> paymentIds,
|
||||||
@Param("transferFileId") Long transferFileId);
|
@Param("transferFileId") Long transferFileId);
|
||||||
|
|
||||||
|
/** 신규: PaymentSearchParam 기반 */
|
||||||
|
List<PaymentResp> selectByParam(com.ga.core.vo.settle.PaymentSearchParam param);
|
||||||
|
PaymentResp selectRespById(@Param("paymentId") Long paymentId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,4 +13,7 @@ public interface ReconciliationMapper {
|
|||||||
int resolve(@Param("reconId") Long reconId,
|
int resolve(@Param("reconId") Long reconId,
|
||||||
@Param("note") String note,
|
@Param("note") String note,
|
||||||
@Param("userId") Long userId);
|
@Param("userId") Long userId);
|
||||||
|
|
||||||
|
/** 신규 */
|
||||||
|
List<com.ga.core.vo.settle.ReconciliationResp> selectRespList(com.ga.core.vo.settle.ReconciliationSearchParam param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,4 +21,9 @@ public interface RoleMapper {
|
|||||||
@Param("menuId") Long menuId,
|
@Param("menuId") Long menuId,
|
||||||
@Param("permCode") String permCode,
|
@Param("permCode") String permCode,
|
||||||
@Param("isGranted") String isGranted);
|
@Param("isGranted") String isGranted);
|
||||||
|
|
||||||
|
/** 신규 */
|
||||||
|
List<com.ga.core.vo.user.RoleResp> selectRespList(com.ga.core.vo.user.RoleSearchParam param);
|
||||||
|
com.ga.core.vo.user.RoleResp selectRespById(@Param("roleId") Long roleId);
|
||||||
|
int existsByCode(@Param("roleCode") String roleCode);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.ga.core.mapstruct;
|
||||||
|
|
||||||
|
import com.ga.core.vo.ledger.ExceptionLedgerSaveReq;
|
||||||
|
import com.ga.core.vo.ledger.ExceptionLedgerVO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.MappingTarget;
|
||||||
|
import org.mapstruct.ReportingPolicy;
|
||||||
|
|
||||||
|
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||||
|
public interface LedgerMapStruct {
|
||||||
|
ExceptionLedgerVO toVO(ExceptionLedgerSaveReq req);
|
||||||
|
void copyToVO(ExceptionLedgerSaveReq req, @MappingTarget ExceptionLedgerVO vo);
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.ga.core.mapstruct;
|
||||||
|
|
||||||
|
import com.ga.core.vo.org.AgentSaveReq;
|
||||||
|
import com.ga.core.vo.org.AgentVO;
|
||||||
|
import com.ga.core.vo.org.GradeSaveReq;
|
||||||
|
import com.ga.core.vo.org.GradeVO;
|
||||||
|
import com.ga.core.vo.org.OrganizationSaveReq;
|
||||||
|
import com.ga.core.vo.org.OrganizationVO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.MappingTarget;
|
||||||
|
import org.mapstruct.ReportingPolicy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* org 도메인 SaveReq ↔ VO 변환.
|
||||||
|
* <p>
|
||||||
|
* INSERT 시: toVO() 로 새 VO 생성
|
||||||
|
* UPDATE 시: copyToVO(req, vo) 로 기존 VO에 머지 (PK/감사필드 보존)
|
||||||
|
*/
|
||||||
|
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||||
|
public interface OrgMapStruct {
|
||||||
|
|
||||||
|
AgentVO toVO(AgentSaveReq req);
|
||||||
|
void copyToVO(AgentSaveReq req, @MappingTarget AgentVO vo);
|
||||||
|
|
||||||
|
GradeVO toVO(GradeSaveReq req);
|
||||||
|
void copyToVO(GradeSaveReq req, @MappingTarget GradeVO vo);
|
||||||
|
|
||||||
|
OrganizationVO toVO(OrganizationSaveReq req);
|
||||||
|
void copyToVO(OrganizationSaveReq req, @MappingTarget OrganizationVO vo);
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.ga.core.mapstruct;
|
||||||
|
|
||||||
|
import com.ga.core.vo.product.ContractSaveReq;
|
||||||
|
import com.ga.core.vo.product.ContractVO;
|
||||||
|
import com.ga.core.vo.product.InsuranceCompanySaveReq;
|
||||||
|
import com.ga.core.vo.product.InsuranceCompanyVO;
|
||||||
|
import com.ga.core.vo.product.ProductSaveReq;
|
||||||
|
import com.ga.core.vo.product.ProductVO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.MappingTarget;
|
||||||
|
import org.mapstruct.ReportingPolicy;
|
||||||
|
|
||||||
|
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||||
|
public interface ProductMapStruct {
|
||||||
|
|
||||||
|
ContractVO toVO(ContractSaveReq req);
|
||||||
|
void copyToVO(ContractSaveReq req, @MappingTarget ContractVO vo);
|
||||||
|
|
||||||
|
InsuranceCompanyVO toVO(InsuranceCompanySaveReq req);
|
||||||
|
void copyToVO(InsuranceCompanySaveReq req, @MappingTarget InsuranceCompanyVO vo);
|
||||||
|
|
||||||
|
ProductVO toVO(ProductSaveReq req);
|
||||||
|
void copyToVO(ProductSaveReq req, @MappingTarget ProductVO vo);
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.ga.core.mapstruct;
|
||||||
|
|
||||||
|
import com.ga.core.vo.rule.*;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.MappingTarget;
|
||||||
|
import org.mapstruct.ReportingPolicy;
|
||||||
|
|
||||||
|
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||||
|
public interface RuleMapStruct {
|
||||||
|
|
||||||
|
CommissionRateVO toVO(CommissionRateSaveReq req);
|
||||||
|
void copyToVO(CommissionRateSaveReq req, @MappingTarget CommissionRateVO vo);
|
||||||
|
|
||||||
|
PayoutRuleVO toVO(PayoutRuleSaveReq req);
|
||||||
|
void copyToVO(PayoutRuleSaveReq req, @MappingTarget PayoutRuleVO vo);
|
||||||
|
|
||||||
|
OverrideRuleVO toVO(OverrideRuleSaveReq req);
|
||||||
|
void copyToVO(OverrideRuleSaveReq req, @MappingTarget OverrideRuleVO vo);
|
||||||
|
|
||||||
|
ChargebackRuleVO toVO(ChargebackRuleSaveReq req);
|
||||||
|
void copyToVO(ChargebackRuleSaveReq req, @MappingTarget ChargebackRuleVO vo);
|
||||||
|
|
||||||
|
ExceptionTypeCodeVO toVO(ExceptionTypeCodeSaveReq req);
|
||||||
|
void copyToVO(ExceptionTypeCodeSaveReq req, @MappingTarget ExceptionTypeCodeVO vo);
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.ga.core.mapstruct;
|
||||||
|
|
||||||
|
import com.ga.core.vo.settle.PaymentSaveReq;
|
||||||
|
import com.ga.core.vo.settle.PaymentVO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.MappingTarget;
|
||||||
|
import org.mapstruct.ReportingPolicy;
|
||||||
|
|
||||||
|
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||||
|
public interface SettleMapStruct {
|
||||||
|
PaymentVO toVO(PaymentSaveReq req);
|
||||||
|
void copyToVO(PaymentSaveReq req, @MappingTarget PaymentVO vo);
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.ga.core.mapstruct;
|
||||||
|
|
||||||
|
import com.ga.core.vo.user.RoleSaveReq;
|
||||||
|
import com.ga.core.vo.user.RoleVO;
|
||||||
|
import com.ga.core.vo.user.UserSaveReq;
|
||||||
|
import com.ga.core.vo.user.UserVO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.Mapping;
|
||||||
|
import org.mapstruct.MappingTarget;
|
||||||
|
import org.mapstruct.ReportingPolicy;
|
||||||
|
|
||||||
|
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||||
|
public interface UserMapStruct {
|
||||||
|
|
||||||
|
/** UserSaveReq → UserVO. password는 Service에서 BCrypt 인코딩 후 별도 set. */
|
||||||
|
@Mapping(target = "password", ignore = true)
|
||||||
|
UserVO toVO(UserSaveReq req);
|
||||||
|
|
||||||
|
@Mapping(target = "password", ignore = true)
|
||||||
|
void copyToVO(UserSaveReq req, @MappingTarget UserVO vo);
|
||||||
|
|
||||||
|
RoleVO toVO(RoleSaveReq req);
|
||||||
|
void copyToVO(RoleSaveReq req, @MappingTarget RoleVO vo);
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.ga.core.vo.ledger;
|
||||||
|
|
||||||
|
import com.ga.common.model.SearchParam;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class ExceptionLedgerSearchParam extends SearchParam {
|
||||||
|
private Long agentId;
|
||||||
|
private Long orgId;
|
||||||
|
private String settleMonth;
|
||||||
|
private String exceptionCode;
|
||||||
|
private String approveStatus; // PENDING / APPROVED / REJECTED
|
||||||
|
private String direction; // PLUS / MINUS
|
||||||
|
private Boolean recurringOnly;
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.ga.core.vo.org;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AgentOrgHistoryResp {
|
||||||
|
private Long historyId;
|
||||||
|
private Long agentId;
|
||||||
|
private String agentName;
|
||||||
|
private Long fromOrgId;
|
||||||
|
private String fromOrgName;
|
||||||
|
private Long toOrgId;
|
||||||
|
private String toOrgName;
|
||||||
|
private Long fromGradeId;
|
||||||
|
private String fromGradeName;
|
||||||
|
private Long toGradeId;
|
||||||
|
private String toGradeName;
|
||||||
|
private String changeType;
|
||||||
|
private String changeTypeName;
|
||||||
|
private LocalDate changeDate;
|
||||||
|
private String changeReason;
|
||||||
|
private LocalDateTime createdAt;
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.ga.core.vo.org;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class GradeResp {
|
||||||
|
private Long gradeId;
|
||||||
|
private String gradeName;
|
||||||
|
private Integer gradeLevel;
|
||||||
|
private String gradeGroup;
|
||||||
|
private String description;
|
||||||
|
private String isActive;
|
||||||
|
private Integer sortOrder;
|
||||||
|
private Integer agentCount; // 직급 보유 설계사 수
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.ga.core.vo.org;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class GradeSaveReq {
|
||||||
|
@NotBlank(message = "직급명은 필수입니다")
|
||||||
|
@Size(max = 30)
|
||||||
|
private String gradeName;
|
||||||
|
|
||||||
|
@NotNull(message = "직급 레벨은 필수입니다")
|
||||||
|
private Integer gradeLevel;
|
||||||
|
|
||||||
|
private String gradeGroup;
|
||||||
|
private String description;
|
||||||
|
private String isActive;
|
||||||
|
private Integer sortOrder;
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.ga.core.vo.org;
|
||||||
|
|
||||||
|
import com.ga.common.model.SearchParam;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class GradeSearchParam extends SearchParam {
|
||||||
|
private String gradeGroup;
|
||||||
|
private String isActive;
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.ga.core.vo.org;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class OrganizationSaveReq {
|
||||||
|
private Long parentOrgId;
|
||||||
|
|
||||||
|
@NotBlank(message = "조직명은 필수입니다")
|
||||||
|
@Size(max = 100)
|
||||||
|
private String orgName;
|
||||||
|
|
||||||
|
@NotBlank(message = "조직 유형은 필수입니다")
|
||||||
|
private String orgType; // HQ / BR / TM
|
||||||
|
|
||||||
|
private String region;
|
||||||
|
private LocalDate effectiveFrom;
|
||||||
|
private LocalDate effectiveTo;
|
||||||
|
private String isActive;
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.ga.core.vo.org;
|
||||||
|
|
||||||
|
import com.ga.common.model.SearchParam;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class OrganizationSearchParam extends SearchParam {
|
||||||
|
private Long parentOrgId;
|
||||||
|
private String orgType;
|
||||||
|
private String region;
|
||||||
|
private String isActive;
|
||||||
|
private Boolean includeSubOrgs;
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package com.ga.core.vo.product;
|
||||||
|
|
||||||
|
import com.ga.common.annotation.ExcelColumn;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 계약 엑셀 다운로드/업로드용. 어노테이션 기반 자동 매핑.
|
||||||
|
* 마스킹/코드그룹 변환은 ExcelService가 처리.
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ContractExcelVO {
|
||||||
|
|
||||||
|
@ExcelColumn(header = "증권번호", order = 1, width = 22, required = true)
|
||||||
|
private String policyNo;
|
||||||
|
|
||||||
|
@ExcelColumn(header = "설계사명", order = 2, width = 14)
|
||||||
|
private String agentName;
|
||||||
|
|
||||||
|
@ExcelColumn(header = "보험사", order = 3, width = 14)
|
||||||
|
private String companyName;
|
||||||
|
|
||||||
|
@ExcelColumn(header = "상품명", order = 4, width = 24)
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
@ExcelColumn(header = "보종", order = 5, width = 12, codeGroup = "INSURANCE_TYPE")
|
||||||
|
private String insuranceType;
|
||||||
|
|
||||||
|
@ExcelColumn(header = "계약자", order = 6, width = 14)
|
||||||
|
private String contractorName;
|
||||||
|
|
||||||
|
@ExcelColumn(header = "피보험자", order = 7, width = 14)
|
||||||
|
private String insuredName;
|
||||||
|
|
||||||
|
@ExcelColumn(header = "보험료", order = 8, width = 14)
|
||||||
|
private BigDecimal premium;
|
||||||
|
|
||||||
|
@ExcelColumn(header = "납주기", order = 9, width = 8, codeGroup = "PAY_CYCLE")
|
||||||
|
private String payCycle;
|
||||||
|
|
||||||
|
@ExcelColumn(header = "상태", order = 10, width = 10, codeGroup = "CONTRACT_STATUS")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@ExcelColumn(header = "체결일", order = 11, width = 12, format = "yyyy-MM-dd")
|
||||||
|
private LocalDate contractDate;
|
||||||
|
|
||||||
|
@ExcelColumn(header = "효력일", order = 12, width = 12, format = "yyyy-MM-dd")
|
||||||
|
private LocalDate effectiveDate;
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.ga.core.vo.product;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class InsuranceCompanyResp {
|
||||||
|
private Long companyId;
|
||||||
|
private String companyCode;
|
||||||
|
private String companyName;
|
||||||
|
private String companyType;
|
||||||
|
private String companyTypeName;
|
||||||
|
private String bizNo;
|
||||||
|
private String contactName;
|
||||||
|
private String contactPhone;
|
||||||
|
private String contactEmail;
|
||||||
|
private String isActive;
|
||||||
|
private Integer productCount; // 상품 수
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.ga.core.vo.product;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class InsuranceCompanySaveReq {
|
||||||
|
@NotBlank(message = "보험사 코드는 필수입니다")
|
||||||
|
@Size(max = 20)
|
||||||
|
private String companyCode;
|
||||||
|
|
||||||
|
@NotBlank(message = "보험사명은 필수입니다")
|
||||||
|
@Size(max = 100)
|
||||||
|
private String companyName;
|
||||||
|
|
||||||
|
private String companyType;
|
||||||
|
private String bizNo;
|
||||||
|
private String contactName;
|
||||||
|
private String contactPhone;
|
||||||
|
private String contactEmail;
|
||||||
|
private String isActive;
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.ga.core.vo.product;
|
||||||
|
|
||||||
|
import com.ga.common.model.SearchParam;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class InsuranceCompanySearchParam extends SearchParam {
|
||||||
|
private String companyType;
|
||||||
|
private String isActive;
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.ga.core.vo.product;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ProductSaveReq {
|
||||||
|
@NotNull(message = "보험사를 선택해주세요")
|
||||||
|
private Long companyId;
|
||||||
|
|
||||||
|
@NotBlank(message = "상품 코드는 필수입니다")
|
||||||
|
@Size(max = 30)
|
||||||
|
private String productCode;
|
||||||
|
|
||||||
|
@NotBlank(message = "상품명은 필수입니다")
|
||||||
|
@Size(max = 100)
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
@NotBlank(message = "보험 종목은 필수입니다")
|
||||||
|
private String insuranceType;
|
||||||
|
|
||||||
|
private String productGroup;
|
||||||
|
private String payPeriodType;
|
||||||
|
private String isActive;
|
||||||
|
private LocalDate launchDate;
|
||||||
|
private LocalDate endDate;
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.ga.core.vo.product;
|
||||||
|
|
||||||
|
import com.ga.common.model.SearchParam;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class ProductSearchParam extends SearchParam {
|
||||||
|
private Long companyId;
|
||||||
|
private String insuranceType;
|
||||||
|
private String productGroup;
|
||||||
|
private String isActive;
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.ga.core.vo.receive;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CodeMappingResp {
|
||||||
|
private Long codeId;
|
||||||
|
private String companyCode;
|
||||||
|
private String companyName;
|
||||||
|
private String codeType;
|
||||||
|
private String codeTypeName;
|
||||||
|
private String sourceCode;
|
||||||
|
private String sourceName;
|
||||||
|
private String targetCode;
|
||||||
|
private String targetName;
|
||||||
|
private String isActive;
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.ga.core.vo.receive;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CodeMappingSaveReq {
|
||||||
|
@NotBlank private String companyCode;
|
||||||
|
@NotBlank private String codeType;
|
||||||
|
@NotBlank private String sourceCode;
|
||||||
|
private String sourceName;
|
||||||
|
@NotBlank private String targetCode;
|
||||||
|
private String targetName;
|
||||||
|
private String isActive;
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.ga.core.vo.receive;
|
||||||
|
|
||||||
|
import com.ga.common.model.SearchParam;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class CodeMappingSearchParam extends SearchParam {
|
||||||
|
private String companyCode;
|
||||||
|
private String codeType;
|
||||||
|
private String isActive;
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.ga.core.vo.receive;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CompanyFieldMappingResp {
|
||||||
|
private Long mappingId;
|
||||||
|
private String companyCode;
|
||||||
|
private String companyName;
|
||||||
|
private String sourceField;
|
||||||
|
private Integer sourceColIndex;
|
||||||
|
private String targetTable;
|
||||||
|
private String targetField;
|
||||||
|
private String dataType;
|
||||||
|
private String transformRule;
|
||||||
|
private String defaultValue;
|
||||||
|
private String isRequired;
|
||||||
|
private Integer sortOrder;
|
||||||
|
private Integer version;
|
||||||
|
private LocalDate effectiveFrom;
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.ga.core.vo.receive;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CompanyFieldMappingSaveReq {
|
||||||
|
@NotBlank
|
||||||
|
private String companyCode;
|
||||||
|
|
||||||
|
@NotBlank
|
||||||
|
private String sourceField;
|
||||||
|
|
||||||
|
private Integer sourceColIndex;
|
||||||
|
|
||||||
|
@NotBlank
|
||||||
|
private String targetTable;
|
||||||
|
|
||||||
|
@NotBlank
|
||||||
|
private String targetField;
|
||||||
|
|
||||||
|
private String dataType;
|
||||||
|
private String transformRule;
|
||||||
|
private String defaultValue;
|
||||||
|
private String isRequired;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private Integer sortOrder;
|
||||||
|
private Integer version;
|
||||||
|
private LocalDate effectiveFrom;
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.ga.core.vo.receive;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CompanyProfileResp {
|
||||||
|
private String companyCode;
|
||||||
|
private String companyName;
|
||||||
|
private String dataFormat;
|
||||||
|
private String dataFormatName;
|
||||||
|
private String receiveMethod;
|
||||||
|
private String receiveMethodName;
|
||||||
|
private String fileEncoding;
|
||||||
|
private String delimiter;
|
||||||
|
private Integer headerRow;
|
||||||
|
private Integer dataStartRow;
|
||||||
|
private String sheetName;
|
||||||
|
private String dateFormat;
|
||||||
|
private String amountFormat;
|
||||||
|
private String apiUrl;
|
||||||
|
private String ftpHost;
|
||||||
|
private String ftpPath;
|
||||||
|
private String receiveSchedule;
|
||||||
|
private String isActive;
|
||||||
|
private Integer fieldMappingCount;
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.ga.core.vo.receive;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CompanyProfileSaveReq {
|
||||||
|
@NotBlank
|
||||||
|
private String companyCode;
|
||||||
|
|
||||||
|
@NotBlank
|
||||||
|
private String dataFormat; // EXCEL / CSV / EDI / API
|
||||||
|
|
||||||
|
@NotBlank
|
||||||
|
private String receiveMethod; // MANUAL / FTP / API / SFTP
|
||||||
|
|
||||||
|
private String fileEncoding;
|
||||||
|
private String delimiter;
|
||||||
|
private Integer headerRow;
|
||||||
|
private Integer dataStartRow;
|
||||||
|
private String sheetName;
|
||||||
|
private String dateFormat;
|
||||||
|
private String amountFormat;
|
||||||
|
private String apiUrl;
|
||||||
|
private String ftpHost;
|
||||||
|
private String ftpPath;
|
||||||
|
private String receiveSchedule;
|
||||||
|
private String isActive;
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.ga.core.vo.receive;
|
||||||
|
|
||||||
|
import com.ga.common.model.SearchParam;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class CompanyProfileSearchParam extends SearchParam {
|
||||||
|
private String dataFormat;
|
||||||
|
private String receiveMethod;
|
||||||
|
private String isActive;
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.ga.core.vo.receive;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ParseErrorLogResp {
|
||||||
|
private Long errorId;
|
||||||
|
private Long rawId;
|
||||||
|
private String companyCode;
|
||||||
|
private String companyName;
|
||||||
|
private String errorType;
|
||||||
|
private String errorTypeName;
|
||||||
|
private String errorField;
|
||||||
|
private String errorValue;
|
||||||
|
private String errorMessage;
|
||||||
|
private String resolveStatus;
|
||||||
|
private String resolveStatusName;
|
||||||
|
private Long resolvedBy;
|
||||||
|
private String resolvedByName;
|
||||||
|
private String resolveNote;
|
||||||
|
private LocalDateTime resolvedAt;
|
||||||
|
private LocalDateTime createdAt;
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.ga.core.vo.receive;
|
||||||
|
|
||||||
|
import com.ga.common.model.SearchParam;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class ParseErrorLogSearchParam extends SearchParam {
|
||||||
|
private String companyCode;
|
||||||
|
private String errorType;
|
||||||
|
private String resolveStatus;
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.ga.core.vo.receive;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class RawCommissionDataResp {
|
||||||
|
private Long rawId;
|
||||||
|
private String companyCode;
|
||||||
|
private String companyName;
|
||||||
|
private String batchId;
|
||||||
|
private String settleMonth;
|
||||||
|
private String dataType;
|
||||||
|
private String parseStatus;
|
||||||
|
private String parseStatusName;
|
||||||
|
private Long mappedLedgerId;
|
||||||
|
private String mappedTable;
|
||||||
|
private String fileName;
|
||||||
|
private Integer rowNumber;
|
||||||
|
private LocalDateTime receivedAt;
|
||||||
|
private LocalDateTime parsedAt;
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.ga.core.vo.receive;
|
||||||
|
|
||||||
|
import com.ga.common.model.SearchParam;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class RawCommissionDataSearchParam extends SearchParam {
|
||||||
|
private String companyCode;
|
||||||
|
private String settleMonth;
|
||||||
|
private String parseStatus;
|
||||||
|
private String batchId;
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.ga.core.vo.rule;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ChargebackRuleResp {
|
||||||
|
private Long cbRuleId;
|
||||||
|
private String companyCode;
|
||||||
|
private String companyName;
|
||||||
|
private String insuranceType;
|
||||||
|
private String insuranceTypeName;
|
||||||
|
private Integer lapseMonthFrom;
|
||||||
|
private Integer lapseMonthTo;
|
||||||
|
private BigDecimal cbRate;
|
||||||
|
private String includeOverride;
|
||||||
|
private String installmentAllowed;
|
||||||
|
private Integer maxInstallments;
|
||||||
|
private LocalDate effectiveFrom;
|
||||||
|
private LocalDate effectiveTo;
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.ga.core.vo.rule;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import jakarta.validation.constraints.PositiveOrZero;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ChargebackRuleSaveReq {
|
||||||
|
@NotBlank private String companyCode;
|
||||||
|
@NotBlank private String insuranceType;
|
||||||
|
|
||||||
|
@NotNull private Integer lapseMonthFrom;
|
||||||
|
@NotNull private Integer lapseMonthTo;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@PositiveOrZero
|
||||||
|
private BigDecimal cbRate;
|
||||||
|
|
||||||
|
private String includeOverride;
|
||||||
|
private String installmentAllowed;
|
||||||
|
private Integer maxInstallments;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private LocalDate effectiveFrom;
|
||||||
|
private LocalDate effectiveTo;
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.ga.core.vo.rule;
|
||||||
|
|
||||||
|
import com.ga.common.model.SearchParam;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class ChargebackRuleSearchParam extends SearchParam {
|
||||||
|
private String companyCode;
|
||||||
|
private String insuranceType;
|
||||||
|
private LocalDate effectiveDate;
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.ga.core.vo.rule;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CommissionRateResp {
|
||||||
|
private Long rateId;
|
||||||
|
private Long productId;
|
||||||
|
private String productCode;
|
||||||
|
private String productName;
|
||||||
|
private String companyName;
|
||||||
|
private Integer commissionYear;
|
||||||
|
private BigDecimal ratePct;
|
||||||
|
private String payMethodCond;
|
||||||
|
private BigDecimal minPremium;
|
||||||
|
private LocalDate effectiveFrom;
|
||||||
|
private LocalDate effectiveTo;
|
||||||
|
private Integer version;
|
||||||
|
private LocalDateTime createdAt;
|
||||||
|
private String createdByName;
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.ga.core.vo.rule;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import jakarta.validation.constraints.PositiveOrZero;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CommissionRateSaveReq {
|
||||||
|
@NotNull private Long productId;
|
||||||
|
|
||||||
|
@NotNull(message = "수수료 연차는 필수입니다")
|
||||||
|
private Integer commissionYear;
|
||||||
|
|
||||||
|
@NotNull(message = "수수료율은 필수입니다")
|
||||||
|
@PositiveOrZero
|
||||||
|
private BigDecimal ratePct;
|
||||||
|
|
||||||
|
private String payMethodCond;
|
||||||
|
private BigDecimal minPremium;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private LocalDate effectiveFrom;
|
||||||
|
private LocalDate effectiveTo;
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.ga.core.vo.rule;
|
||||||
|
|
||||||
|
import com.ga.common.model.SearchParam;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class CommissionRateSearchParam extends SearchParam {
|
||||||
|
private Long productId;
|
||||||
|
private Long companyId;
|
||||||
|
private Integer commissionYear;
|
||||||
|
private LocalDate effectiveDate; // 해당일에 유효한 규정만
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.ga.core.vo.rule;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ExceptionTypeCodeResp {
|
||||||
|
private String exceptionCode;
|
||||||
|
private String exceptionName;
|
||||||
|
private String category;
|
||||||
|
private String categoryName;
|
||||||
|
private String direction;
|
||||||
|
private String directionName;
|
||||||
|
private String autoCalcYn;
|
||||||
|
private String approvalRequired;
|
||||||
|
private String taxIncluded;
|
||||||
|
private String description;
|
||||||
|
private String isActive;
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.ga.core.vo.rule;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ExceptionTypeCodeSaveReq {
|
||||||
|
@NotBlank
|
||||||
|
@Size(max = 30)
|
||||||
|
private String exceptionCode;
|
||||||
|
|
||||||
|
@NotBlank
|
||||||
|
@Size(max = 100)
|
||||||
|
private String exceptionName;
|
||||||
|
|
||||||
|
@NotBlank
|
||||||
|
private String category;
|
||||||
|
|
||||||
|
@NotBlank
|
||||||
|
private String direction; // PLUS / MINUS
|
||||||
|
|
||||||
|
private String autoCalcYn;
|
||||||
|
private String approvalRequired;
|
||||||
|
private String taxIncluded;
|
||||||
|
private String description;
|
||||||
|
private String isActive;
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.ga.core.vo.rule;
|
||||||
|
|
||||||
|
import com.ga.common.model.SearchParam;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class ExceptionTypeCodeSearchParam extends SearchParam {
|
||||||
|
private String category;
|
||||||
|
private String direction;
|
||||||
|
private String isActive;
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.ga.core.vo.rule;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class OverrideRuleResp {
|
||||||
|
private Long overrideId;
|
||||||
|
private Long fromGrade;
|
||||||
|
private String fromGradeName;
|
||||||
|
private Long toGrade;
|
||||||
|
private String toGradeName;
|
||||||
|
private BigDecimal overridePct;
|
||||||
|
private String calcType;
|
||||||
|
private String calcTypeName;
|
||||||
|
private String insuranceTypeCond;
|
||||||
|
private BigDecimal capAmount;
|
||||||
|
private LocalDate effectiveFrom;
|
||||||
|
private LocalDate effectiveTo;
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.ga.core.vo.rule;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import jakarta.validation.constraints.PositiveOrZero;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class OverrideRuleSaveReq {
|
||||||
|
@NotNull private Long fromGrade;
|
||||||
|
@NotNull private Long toGrade;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@PositiveOrZero
|
||||||
|
private BigDecimal overridePct;
|
||||||
|
|
||||||
|
private String calcType;
|
||||||
|
private String insuranceTypeCond;
|
||||||
|
private BigDecimal capAmount;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private LocalDate effectiveFrom;
|
||||||
|
private LocalDate effectiveTo;
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.ga.core.vo.rule;
|
||||||
|
|
||||||
|
import com.ga.common.model.SearchParam;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class OverrideRuleSearchParam extends SearchParam {
|
||||||
|
private Long fromGrade;
|
||||||
|
private Long toGrade;
|
||||||
|
private LocalDate effectiveDate;
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.ga.core.vo.rule;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PayoutRuleResp {
|
||||||
|
private Long ruleId;
|
||||||
|
private Long gradeId;
|
||||||
|
private String gradeName;
|
||||||
|
private String insuranceType;
|
||||||
|
private String insuranceTypeName;
|
||||||
|
private Integer commissionYear;
|
||||||
|
private BigDecimal payoutPct;
|
||||||
|
private String payMethodCond;
|
||||||
|
private String performanceGrade;
|
||||||
|
private LocalDate effectiveFrom;
|
||||||
|
private LocalDate effectiveTo;
|
||||||
|
private Integer version;
|
||||||
|
private LocalDateTime createdAt;
|
||||||
|
private String createdByName;
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.ga.core.vo.rule;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import jakarta.validation.constraints.PositiveOrZero;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PayoutRuleSaveReq {
|
||||||
|
@NotNull private Long gradeId;
|
||||||
|
|
||||||
|
@NotBlank(message = "보종은 필수입니다")
|
||||||
|
private String insuranceType;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private Integer commissionYear;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@PositiveOrZero
|
||||||
|
private BigDecimal payoutPct;
|
||||||
|
|
||||||
|
private String payMethodCond;
|
||||||
|
private String performanceGrade;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private LocalDate effectiveFrom;
|
||||||
|
private LocalDate effectiveTo;
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.ga.core.vo.rule;
|
||||||
|
|
||||||
|
import com.ga.common.model.SearchParam;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class PayoutRuleSearchParam extends SearchParam {
|
||||||
|
private Long gradeId;
|
||||||
|
private String insuranceType;
|
||||||
|
private Integer commissionYear;
|
||||||
|
private LocalDate effectiveDate;
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.ga.core.vo.settle;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BatchJobLogResp {
|
||||||
|
private Long jobId;
|
||||||
|
private String jobName;
|
||||||
|
private String jobNameDisplay;
|
||||||
|
private String jobParams;
|
||||||
|
private String settleMonth;
|
||||||
|
private String status;
|
||||||
|
private String statusName;
|
||||||
|
private String currentStep;
|
||||||
|
private Integer progressPct;
|
||||||
|
private Integer totalCount;
|
||||||
|
private Integer processedCount;
|
||||||
|
private Integer errorCount;
|
||||||
|
private String errorMessage;
|
||||||
|
private LocalDateTime startedAt;
|
||||||
|
private LocalDateTime finishedAt;
|
||||||
|
private Integer durationSec;
|
||||||
|
private Long triggeredBy;
|
||||||
|
private String triggeredByName;
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.ga.core.vo.settle;
|
||||||
|
|
||||||
|
import com.ga.common.model.SearchParam;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class BatchJobLogSearchParam extends SearchParam {
|
||||||
|
private String jobName;
|
||||||
|
private String settleMonth;
|
||||||
|
private String batchJobStatus;
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.ga.core.vo.settle;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ChargebackResp {
|
||||||
|
private Long cbId;
|
||||||
|
private Long contractId;
|
||||||
|
private Long agentId;
|
||||||
|
private String agentName;
|
||||||
|
private String policyNo;
|
||||||
|
private String productName;
|
||||||
|
private Integer lapseMonth;
|
||||||
|
private BigDecimal cbRate;
|
||||||
|
private BigDecimal cbAmount;
|
||||||
|
private BigDecimal paidAmount;
|
||||||
|
private BigDecimal remainAmount;
|
||||||
|
private String settleMonth;
|
||||||
|
private Integer installmentNo;
|
||||||
|
private Integer maxInstallments;
|
||||||
|
private String status;
|
||||||
|
private String statusName;
|
||||||
|
private LocalDateTime createdAt;
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.ga.core.vo.settle;
|
||||||
|
|
||||||
|
import com.ga.common.model.SearchParam;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class ChargebackSearchParam extends SearchParam {
|
||||||
|
private Long agentId;
|
||||||
|
private Long contractId;
|
||||||
|
private String policyNo;
|
||||||
|
private String settleMonth;
|
||||||
|
private String chargebackStatus;
|
||||||
|
private Boolean remainOnly; // 잔액 있는 것만
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.ga.core.vo.settle;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class OverrideSettleResp {
|
||||||
|
private Long osId;
|
||||||
|
private Long settleId;
|
||||||
|
private Long upperAgentId;
|
||||||
|
private String upperAgentName;
|
||||||
|
private String upperOrgName;
|
||||||
|
private String upperGradeName;
|
||||||
|
private Long lowerAgentId;
|
||||||
|
private String lowerAgentName;
|
||||||
|
private String settleMonth;
|
||||||
|
private BigDecimal baseAmount;
|
||||||
|
private BigDecimal overridePct;
|
||||||
|
private BigDecimal overrideAmount;
|
||||||
|
private LocalDateTime calcDate;
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.ga.core.vo.settle;
|
||||||
|
|
||||||
|
import com.ga.common.model.SearchParam;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class OverrideSettleSearchParam extends SearchParam {
|
||||||
|
private Long upperAgentId;
|
||||||
|
private Long lowerAgentId;
|
||||||
|
private Long settleId;
|
||||||
|
private String settleMonth;
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.ga.core.vo.settle;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import jakarta.validation.constraints.Positive;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PaymentSaveReq {
|
||||||
|
@NotNull
|
||||||
|
private Long settleId;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private Long agentId;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Positive
|
||||||
|
private BigDecimal payAmount;
|
||||||
|
|
||||||
|
private String bankCode;
|
||||||
|
private String accountNo; // 입력 시 평문 → EncryptTypeHandler 가 저장 시 암호화
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private LocalDate payDate;
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.ga.core.vo.settle;
|
||||||
|
|
||||||
|
import com.ga.common.model.SearchParam;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class PaymentSearchParam extends SearchParam {
|
||||||
|
private Long agentId;
|
||||||
|
private Long settleId;
|
||||||
|
private String payStatus;
|
||||||
|
private LocalDate payDateFrom;
|
||||||
|
private LocalDate payDateTo;
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.ga.core.vo.settle;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ReconciliationResp {
|
||||||
|
private Long reconId;
|
||||||
|
private String companyCode;
|
||||||
|
private String companyName;
|
||||||
|
private String settleMonth;
|
||||||
|
private BigDecimal companyTotal;
|
||||||
|
private BigDecimal systemTotal;
|
||||||
|
private BigDecimal diffAmount;
|
||||||
|
private Integer diffCount;
|
||||||
|
private String status;
|
||||||
|
private String statusName;
|
||||||
|
private String resolveNote;
|
||||||
|
private Long resolvedBy;
|
||||||
|
private String resolvedByName;
|
||||||
|
private LocalDateTime resolvedAt;
|
||||||
|
private LocalDateTime createdAt;
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.ga.core.vo.settle;
|
||||||
|
|
||||||
|
import com.ga.common.model.SearchParam;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class ReconciliationSearchParam extends SearchParam {
|
||||||
|
private String companyCode;
|
||||||
|
private String settleMonth;
|
||||||
|
private String reconcileStatus;
|
||||||
|
private Boolean diffOnly; // 차이 있는 것만
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.ga.core.vo.user;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class RoleResp {
|
||||||
|
private Long roleId;
|
||||||
|
private String roleCode;
|
||||||
|
private String roleName;
|
||||||
|
private String roleDesc;
|
||||||
|
private Integer roleLevel;
|
||||||
|
private String isSystem;
|
||||||
|
private String isActive;
|
||||||
|
private Integer userCount; // 해당 역할 보유 사용자 수
|
||||||
|
private Integer permissionCount; // 부여된 메뉴-권한 수
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.ga.core.vo.user;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class RoleSaveReq {
|
||||||
|
@NotBlank
|
||||||
|
@Size(max = 30)
|
||||||
|
private String roleCode;
|
||||||
|
|
||||||
|
@NotBlank
|
||||||
|
@Size(max = 50)
|
||||||
|
private String roleName;
|
||||||
|
|
||||||
|
private String roleDesc;
|
||||||
|
private Integer roleLevel;
|
||||||
|
private String isActive;
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.ga.core.vo.user;
|
||||||
|
|
||||||
|
import com.ga.common.model.SearchParam;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class RoleSearchParam extends SearchParam {
|
||||||
|
private String isSystem;
|
||||||
|
private String isActive;
|
||||||
|
}
|
||||||
@@ -35,4 +35,33 @@
|
|||||||
|
|
||||||
<delete id="deleteById">DELETE FROM grade WHERE grade_id = #{gradeId}</delete>
|
<delete id="deleteById">DELETE FROM grade WHERE grade_id = #{gradeId}</delete>
|
||||||
|
|
||||||
|
<!-- 신규: GradeResp + SearchParam -->
|
||||||
|
<resultMap id="GradeRespMap" type="com.ga.core.vo.org.GradeResp"/>
|
||||||
|
|
||||||
|
<select id="selectRespList" resultMap="GradeRespMap">
|
||||||
|
SELECT g.grade_id, g.grade_name, g.grade_level, g.grade_group, g.description,
|
||||||
|
g.is_active, g.sort_order,
|
||||||
|
(SELECT COUNT(*) FROM agent a WHERE a.grade_id = g.grade_id AND a.status = 'ACTIVE') AS agent_count
|
||||||
|
FROM grade g
|
||||||
|
<where>
|
||||||
|
<if test="searchKeyword != null and searchKeyword != ''">
|
||||||
|
AND g.grade_name LIKE CONCAT('%', #{searchKeyword}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="gradeGroup != null and gradeGroup != ''">AND g.grade_group = #{gradeGroup}</if>
|
||||||
|
<if test="isActive != null and isActive != ''">AND g.is_active = #{isActive}</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY g.grade_level, g.sort_order
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectRespById" resultMap="GradeRespMap">
|
||||||
|
SELECT g.grade_id, g.grade_name, g.grade_level, g.grade_group, g.description,
|
||||||
|
g.is_active, g.sort_order,
|
||||||
|
(SELECT COUNT(*) FROM agent a WHERE a.grade_id = g.grade_id AND a.status = 'ACTIVE') AS agent_count
|
||||||
|
FROM grade g WHERE g.grade_id = #{gradeId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="countAgents" resultType="int">
|
||||||
|
SELECT COUNT(*) FROM agent WHERE grade_id = #{gradeId} AND status = 'ACTIVE'
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -34,6 +34,41 @@
|
|||||||
ORDER BY o.org_level, o.sort_order, o.org_id
|
ORDER BY o.org_level, o.sort_order, o.org_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 신규: SearchParam 기반 페이징 검색 -->
|
||||||
|
<select id="selectByParam" resultMap="OrgRespMap">
|
||||||
|
SELECT o.org_id, o.parent_org_id, p.org_name AS parent_org_name,
|
||||||
|
o.org_name, o.org_type, o.org_level, o.region,
|
||||||
|
o.effective_from, o.effective_to, o.is_active
|
||||||
|
FROM organization o
|
||||||
|
LEFT JOIN organization p ON p.org_id = o.parent_org_id
|
||||||
|
<where>
|
||||||
|
<if test="searchKeyword != null and searchKeyword != ''">
|
||||||
|
AND o.org_name LIKE CONCAT('%', #{searchKeyword}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="parentOrgId != null">
|
||||||
|
<choose>
|
||||||
|
<when test="includeSubOrgs == true">
|
||||||
|
AND o.org_id IN (
|
||||||
|
WITH RECURSIVE d AS (
|
||||||
|
SELECT org_id FROM organization WHERE org_id = #{parentOrgId}
|
||||||
|
UNION ALL
|
||||||
|
SELECT c.org_id FROM organization c JOIN d ON c.parent_org_id = d.org_id
|
||||||
|
)
|
||||||
|
SELECT org_id FROM d
|
||||||
|
)
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
AND o.parent_org_id = #{parentOrgId}
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</if>
|
||||||
|
<if test="orgType != null and orgType != ''">AND o.org_type = #{orgType}</if>
|
||||||
|
<if test="region != null and region != ''">AND o.region = #{region}</if>
|
||||||
|
<if test="isActive != null and isActive != ''">AND o.is_active = #{isActive}</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY o.org_level, o.org_id
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="selectById" resultMap="OrgVOMap">
|
<select id="selectById" resultMap="OrgVOMap">
|
||||||
SELECT * FROM organization WHERE org_id = #{orgId}
|
SELECT * FROM organization WHERE org_id = #{orgId}
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -48,4 +48,36 @@
|
|||||||
|
|
||||||
<delete id="deleteById">DELETE FROM insurance_company WHERE company_id = #{companyId}</delete>
|
<delete id="deleteById">DELETE FROM insurance_company WHERE company_id = #{companyId}</delete>
|
||||||
|
|
||||||
|
<!-- 신규 -->
|
||||||
|
<resultMap id="CompanyRespMap" type="com.ga.core.vo.product.InsuranceCompanyResp"/>
|
||||||
|
|
||||||
|
<sql id="respCols">
|
||||||
|
c.company_id, c.company_code, c.company_name, c.company_type,
|
||||||
|
(SELECT cc.code_name FROM common_code cc WHERE cc.group_code='COMPANY_TYPE' AND cc.code=c.company_type) AS company_type_name,
|
||||||
|
c.biz_no, c.contact_name, c.contact_phone, c.contact_email, c.is_active,
|
||||||
|
(SELECT COUNT(*) FROM product p WHERE p.company_id = c.company_id) AS product_count
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectRespList" resultMap="CompanyRespMap">
|
||||||
|
SELECT <include refid="respCols"/>
|
||||||
|
FROM insurance_company c
|
||||||
|
<where>
|
||||||
|
<if test="searchKeyword != null and searchKeyword != ''">
|
||||||
|
AND (c.company_name LIKE CONCAT('%', #{searchKeyword}, '%')
|
||||||
|
OR c.company_code LIKE CONCAT('%', #{searchKeyword}, '%'))
|
||||||
|
</if>
|
||||||
|
<if test="companyType != null and companyType != ''">AND c.company_type = #{companyType}</if>
|
||||||
|
<if test="isActive != null and isActive != ''">AND c.is_active = #{isActive}</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY c.company_id
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectRespById" resultMap="CompanyRespMap">
|
||||||
|
SELECT <include refid="respCols"/> FROM insurance_company c WHERE c.company_id = #{companyId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="existsByCode" resultType="int">
|
||||||
|
SELECT COUNT(*) FROM insurance_company WHERE company_code = #{companyCode}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -65,4 +65,26 @@
|
|||||||
|
|
||||||
<delete id="deleteById">DELETE FROM product WHERE product_id = #{productId}</delete>
|
<delete id="deleteById">DELETE FROM product WHERE product_id = #{productId}</delete>
|
||||||
|
|
||||||
|
<!-- 신규: SearchParam 기반 -->
|
||||||
|
<select id="selectByParam" resultMap="ProductRespMap">
|
||||||
|
SELECT p.product_id, p.company_id, c.company_code, c.company_name,
|
||||||
|
p.product_code, p.product_name, p.insurance_type,
|
||||||
|
(SELECT cc.code_name FROM common_code cc
|
||||||
|
WHERE cc.group_code='INSURANCE_TYPE' AND cc.code=p.insurance_type) AS insurance_type_name,
|
||||||
|
p.product_group, p.pay_period_type, p.is_active, p.launch_date, p.end_date
|
||||||
|
FROM product p
|
||||||
|
JOIN insurance_company c ON c.company_id = p.company_id
|
||||||
|
<where>
|
||||||
|
<if test="companyId != null">AND p.company_id = #{companyId}</if>
|
||||||
|
<if test="insuranceType != null and insuranceType != ''">AND p.insurance_type = #{insuranceType}</if>
|
||||||
|
<if test="productGroup != null and productGroup != ''">AND p.product_group = #{productGroup}</if>
|
||||||
|
<if test="searchKeyword != null and searchKeyword != ''">
|
||||||
|
AND (p.product_name LIKE CONCAT('%', #{searchKeyword}, '%')
|
||||||
|
OR p.product_code = #{searchKeyword})
|
||||||
|
</if>
|
||||||
|
<if test="isActive != null and isActive != ''">AND p.is_active = #{isActive}</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY p.product_id DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -168,4 +168,112 @@
|
|||||||
WHERE error_id = #{errorId}
|
WHERE error_id = #{errorId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<!-- ===================== 신규: Resp + SearchParam ===================== -->
|
||||||
|
<resultMap id="ProfileRespMap" type="com.ga.core.vo.receive.CompanyProfileResp"/>
|
||||||
|
<resultMap id="FieldRespMap" type="com.ga.core.vo.receive.CompanyFieldMappingResp"/>
|
||||||
|
<resultMap id="CodeRespMap" type="com.ga.core.vo.receive.CodeMappingResp"/>
|
||||||
|
<resultMap id="RawRespMap" type="com.ga.core.vo.receive.RawCommissionDataResp"/>
|
||||||
|
<resultMap id="ErrorRespMap" type="com.ga.core.vo.receive.ParseErrorLogResp"/>
|
||||||
|
|
||||||
|
<select id="selectProfileResp" resultMap="ProfileRespMap">
|
||||||
|
SELECT cp.company_code, c.company_name,
|
||||||
|
cp.data_format,
|
||||||
|
(SELECT cc.code_name FROM common_code cc WHERE cc.group_code='DATA_FORMAT' AND cc.code=cp.data_format) AS data_format_name,
|
||||||
|
cp.receive_method,
|
||||||
|
(SELECT cc.code_name FROM common_code cc WHERE cc.group_code='RECEIVE_METHOD' AND cc.code=cp.receive_method) AS receive_method_name,
|
||||||
|
cp.file_encoding, cp.delimiter, cp.header_row, cp.data_start_row, cp.sheet_name,
|
||||||
|
cp.date_format, cp.amount_format, cp.api_url, cp.ftp_host, cp.ftp_path,
|
||||||
|
cp.receive_schedule, cp.is_active,
|
||||||
|
(SELECT COUNT(*) FROM company_field_mapping fm WHERE fm.company_code = cp.company_code) AS field_mapping_count
|
||||||
|
FROM company_profile cp
|
||||||
|
LEFT JOIN insurance_company c ON c.company_code = cp.company_code
|
||||||
|
<where>
|
||||||
|
<if test="searchKeyword != null and searchKeyword != ''">
|
||||||
|
AND (cp.company_code LIKE CONCAT('%', #{searchKeyword}, '%')
|
||||||
|
OR c.company_name LIKE CONCAT('%', #{searchKeyword}, '%'))
|
||||||
|
</if>
|
||||||
|
<if test="dataFormat != null and dataFormat != ''">AND cp.data_format = #{dataFormat}</if>
|
||||||
|
<if test="receiveMethod != null and receiveMethod != ''">AND cp.receive_method = #{receiveMethod}</if>
|
||||||
|
<if test="isActive != null and isActive != ''">AND cp.is_active = #{isActive}</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY cp.company_code
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectProfileRespByCode" resultMap="ProfileRespMap">
|
||||||
|
SELECT cp.company_code, c.company_name, cp.data_format, cp.receive_method,
|
||||||
|
cp.file_encoding, cp.delimiter, cp.header_row, cp.data_start_row, cp.sheet_name,
|
||||||
|
cp.date_format, cp.amount_format, cp.api_url, cp.ftp_host, cp.ftp_path,
|
||||||
|
cp.receive_schedule, cp.is_active
|
||||||
|
FROM company_profile cp
|
||||||
|
LEFT JOIN insurance_company c ON c.company_code = cp.company_code
|
||||||
|
WHERE cp.company_code = #{companyCode}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectFieldMappingResp" resultMap="FieldRespMap">
|
||||||
|
SELECT fm.mapping_id, fm.company_code, c.company_name,
|
||||||
|
fm.source_field, fm.source_col_index,
|
||||||
|
fm.target_table, fm.target_field, fm.data_type,
|
||||||
|
fm.transform_rule, fm.default_value, fm.is_required, fm.sort_order,
|
||||||
|
fm.version, fm.effective_from
|
||||||
|
FROM company_field_mapping fm
|
||||||
|
LEFT JOIN insurance_company c ON c.company_code = fm.company_code
|
||||||
|
WHERE fm.company_code = #{companyCode}
|
||||||
|
<if test="targetTable != null and targetTable != ''">
|
||||||
|
AND fm.target_table = #{targetTable}
|
||||||
|
</if>
|
||||||
|
ORDER BY fm.sort_order
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectCodeMappingResp" resultMap="CodeRespMap">
|
||||||
|
SELECT cm.code_id, cm.company_code, c.company_name,
|
||||||
|
cm.code_type,
|
||||||
|
(SELECT cc.code_name FROM common_code cc WHERE cc.group_code='CODE_TYPE' AND cc.code=cm.code_type) AS code_type_name,
|
||||||
|
cm.source_code, cm.source_name, cm.target_code, cm.target_name, cm.is_active
|
||||||
|
FROM code_mapping cm
|
||||||
|
LEFT JOIN insurance_company c ON c.company_code = cm.company_code
|
||||||
|
<where>
|
||||||
|
<if test="companyCode != null and companyCode != ''">AND cm.company_code = #{companyCode}</if>
|
||||||
|
<if test="codeType != null and codeType != ''">AND cm.code_type = #{codeType}</if>
|
||||||
|
<if test="isActive != null and isActive != ''">AND cm.is_active = #{isActive}</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY cm.company_code, cm.code_type, cm.source_code
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectRawResp" resultMap="RawRespMap">
|
||||||
|
SELECT r.raw_id, r.company_code, c.company_name, r.batch_id, r.settle_month,
|
||||||
|
r.data_type, r.parse_status,
|
||||||
|
(SELECT cc.code_name FROM common_code cc WHERE cc.group_code='PARSE_STATUS' AND cc.code=r.parse_status) AS parse_status_name,
|
||||||
|
r.mapped_ledger_id, r.mapped_table, r.file_name, r.row_number,
|
||||||
|
r.received_at, r.parsed_at
|
||||||
|
FROM raw_commission_data r
|
||||||
|
LEFT JOIN insurance_company c ON c.company_code = r.company_code
|
||||||
|
<where>
|
||||||
|
<if test="companyCode != null and companyCode != ''">AND r.company_code = #{companyCode}</if>
|
||||||
|
<if test="settleMonth != null and settleMonth != ''">AND r.settle_month = #{settleMonth}</if>
|
||||||
|
<if test="parseStatus != null and parseStatus != ''">AND r.parse_status = #{parseStatus}</if>
|
||||||
|
<if test="batchId != null and batchId != ''">AND r.batch_id = #{batchId}</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY r.received_at DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectErrorResp" resultMap="ErrorRespMap">
|
||||||
|
SELECT e.error_id, e.raw_id, e.company_code, c.company_name,
|
||||||
|
e.error_type,
|
||||||
|
(SELECT cc.code_name FROM common_code cc WHERE cc.group_code='ERROR_TYPE' AND cc.code=e.error_type) AS error_type_name,
|
||||||
|
e.error_field, e.error_value, e.error_message,
|
||||||
|
e.resolve_status,
|
||||||
|
(SELECT cc.code_name FROM common_code cc WHERE cc.group_code='RESOLVE_STATUS' AND cc.code=e.resolve_status) AS resolve_status_name,
|
||||||
|
e.resolved_by, u.user_name AS resolved_by_name,
|
||||||
|
e.resolve_note, e.resolved_at, e.created_at
|
||||||
|
FROM parse_error_log e
|
||||||
|
LEFT JOIN insurance_company c ON c.company_code = e.company_code
|
||||||
|
LEFT JOIN users u ON u.user_id = e.resolved_by
|
||||||
|
<where>
|
||||||
|
<if test="companyCode != null and companyCode != ''">AND e.company_code = #{companyCode}</if>
|
||||||
|
<if test="errorType != null and errorType != ''">AND e.error_type = #{errorType}</if>
|
||||||
|
<if test="resolveStatus != null and resolveStatus != ''">AND e.resolve_status = #{resolveStatus}</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY e.created_at DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -193,4 +193,116 @@
|
|||||||
WHERE exception_code = #{exceptionCode}
|
WHERE exception_code = #{exceptionCode}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<!-- ===================== 신규: Resp + SearchParam ===================== -->
|
||||||
|
<resultMap id="CommRateRespMap" type="com.ga.core.vo.rule.CommissionRateResp"/>
|
||||||
|
<resultMap id="PayoutRespMap" type="com.ga.core.vo.rule.PayoutRuleResp"/>
|
||||||
|
<resultMap id="OverrideRespMap" type="com.ga.core.vo.rule.OverrideRuleResp"/>
|
||||||
|
<resultMap id="ChargebackRespMap" type="com.ga.core.vo.rule.ChargebackRuleResp"/>
|
||||||
|
<resultMap id="ExceptionRespMap" type="com.ga.core.vo.rule.ExceptionTypeCodeResp"/>
|
||||||
|
|
||||||
|
<select id="selectCommissionRateResp" resultMap="CommRateRespMap">
|
||||||
|
SELECT cr.rate_id, cr.product_id, p.product_code, p.product_name, c.company_name,
|
||||||
|
cr.commission_year, cr.rate_pct, cr.pay_method_cond, cr.min_premium,
|
||||||
|
cr.effective_from, cr.effective_to, cr.version, cr.created_at,
|
||||||
|
u.user_name AS created_by_name
|
||||||
|
FROM commission_rate cr
|
||||||
|
JOIN product p ON p.product_id = cr.product_id
|
||||||
|
JOIN insurance_company c ON c.company_id = p.company_id
|
||||||
|
LEFT JOIN users u ON u.user_id = cr.created_by
|
||||||
|
<where>
|
||||||
|
<if test="productId != null">AND cr.product_id = #{productId}</if>
|
||||||
|
<if test="companyId != null">AND p.company_id = #{companyId}</if>
|
||||||
|
<if test="commissionYear != null">AND cr.commission_year = #{commissionYear}</if>
|
||||||
|
<if test="effectiveDate != null">
|
||||||
|
AND cr.effective_from <= #{effectiveDate}
|
||||||
|
AND (cr.effective_to IS NULL OR cr.effective_to >= #{effectiveDate})
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY cr.product_id, cr.commission_year, cr.effective_from DESC, cr.version DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectPayoutRuleResp" resultMap="PayoutRespMap">
|
||||||
|
SELECT pr.rule_id, pr.grade_id, g.grade_name,
|
||||||
|
pr.insurance_type,
|
||||||
|
(SELECT cc.code_name FROM common_code cc WHERE cc.group_code='INSURANCE_TYPE' AND cc.code=pr.insurance_type) AS insurance_type_name,
|
||||||
|
pr.commission_year, pr.payout_pct, pr.pay_method_cond, pr.performance_grade,
|
||||||
|
pr.effective_from, pr.effective_to, pr.version, pr.created_at,
|
||||||
|
u.user_name AS created_by_name
|
||||||
|
FROM payout_rule pr
|
||||||
|
JOIN grade g ON g.grade_id = pr.grade_id
|
||||||
|
LEFT JOIN users u ON u.user_id = pr.created_by
|
||||||
|
<where>
|
||||||
|
<if test="gradeId != null">AND pr.grade_id = #{gradeId}</if>
|
||||||
|
<if test="insuranceType != null and insuranceType != ''">AND pr.insurance_type = #{insuranceType}</if>
|
||||||
|
<if test="commissionYear != null">AND pr.commission_year = #{commissionYear}</if>
|
||||||
|
<if test="effectiveDate != null">
|
||||||
|
AND pr.effective_from <= #{effectiveDate}
|
||||||
|
AND (pr.effective_to IS NULL OR pr.effective_to >= #{effectiveDate})
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY pr.grade_id, pr.insurance_type, pr.effective_from DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectOverrideRuleResp" resultMap="OverrideRespMap">
|
||||||
|
SELECT o.override_id,
|
||||||
|
o.from_grade, gf.grade_name AS from_grade_name,
|
||||||
|
o.to_grade, gt.grade_name AS to_grade_name,
|
||||||
|
o.override_pct, o.calc_type,
|
||||||
|
(SELECT cc.code_name FROM common_code cc WHERE cc.group_code='OVERRIDE_CALC_TYPE' AND cc.code=o.calc_type) AS calc_type_name,
|
||||||
|
o.insurance_type_cond, o.cap_amount,
|
||||||
|
o.effective_from, o.effective_to
|
||||||
|
FROM override_rule o
|
||||||
|
JOIN grade gf ON gf.grade_id = o.from_grade
|
||||||
|
JOIN grade gt ON gt.grade_id = o.to_grade
|
||||||
|
<where>
|
||||||
|
<if test="fromGrade != null">AND o.from_grade = #{fromGrade}</if>
|
||||||
|
<if test="toGrade != null">AND o.to_grade = #{toGrade}</if>
|
||||||
|
<if test="effectiveDate != null">
|
||||||
|
AND o.effective_from <= #{effectiveDate}
|
||||||
|
AND (o.effective_to IS NULL OR o.effective_to >= #{effectiveDate})
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY o.from_grade, o.to_grade, o.effective_from DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectChargebackRuleResp" resultMap="ChargebackRespMap">
|
||||||
|
SELECT cb.cb_rule_id, cb.company_code, c.company_name,
|
||||||
|
cb.insurance_type,
|
||||||
|
(SELECT cc.code_name FROM common_code cc WHERE cc.group_code='INSURANCE_TYPE' AND cc.code=cb.insurance_type) AS insurance_type_name,
|
||||||
|
cb.lapse_month_from, cb.lapse_month_to, cb.cb_rate,
|
||||||
|
cb.include_override, cb.installment_allowed, cb.max_installments,
|
||||||
|
cb.effective_from, cb.effective_to
|
||||||
|
FROM chargeback_rule cb
|
||||||
|
LEFT JOIN insurance_company c ON c.company_code = cb.company_code
|
||||||
|
<where>
|
||||||
|
<if test="companyCode != null and companyCode != ''">AND cb.company_code = #{companyCode}</if>
|
||||||
|
<if test="insuranceType != null and insuranceType != ''">AND cb.insurance_type = #{insuranceType}</if>
|
||||||
|
<if test="effectiveDate != null">
|
||||||
|
AND cb.effective_from <= #{effectiveDate}
|
||||||
|
AND (cb.effective_to IS NULL OR cb.effective_to >= #{effectiveDate})
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY cb.company_code NULLS FIRST, cb.insurance_type, cb.lapse_month_from
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectExceptionTypeCodeResp" resultMap="ExceptionRespMap">
|
||||||
|
SELECT ec.exception_code, ec.exception_name, ec.category,
|
||||||
|
(SELECT cc.code_name FROM common_code cc WHERE cc.group_code='EXCEPTION_CATEGORY' AND cc.code=ec.category) AS category_name,
|
||||||
|
ec.direction,
|
||||||
|
(SELECT cc.code_name FROM common_code cc WHERE cc.group_code='EXCEPTION_DIRECTION' AND cc.code=ec.direction) AS direction_name,
|
||||||
|
ec.auto_calc_yn, ec.approval_required, ec.tax_included,
|
||||||
|
ec.description, ec.is_active
|
||||||
|
FROM exception_type_code ec
|
||||||
|
<where>
|
||||||
|
<if test="searchKeyword != null and searchKeyword != ''">
|
||||||
|
AND (ec.exception_code LIKE CONCAT('%', #{searchKeyword}, '%')
|
||||||
|
OR ec.exception_name LIKE CONCAT('%', #{searchKeyword}, '%'))
|
||||||
|
</if>
|
||||||
|
<if test="category != null and category != ''">AND ec.category = #{category}</if>
|
||||||
|
<if test="direction != null and direction != ''">AND ec.direction = #{direction}</if>
|
||||||
|
<if test="isActive != null and isActive != ''">AND ec.is_active = #{isActive}</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY ec.direction, ec.exception_code
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -52,4 +52,27 @@
|
|||||||
WHERE job_name = #{jobName} AND status IN ('STARTED','RUNNING')
|
WHERE job_name = #{jobName} AND status IN ('STARTED','RUNNING')
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 신규 -->
|
||||||
|
<resultMap id="LogRespMap" type="com.ga.core.vo.settle.BatchJobLogResp"/>
|
||||||
|
|
||||||
|
<select id="selectRespList" resultMap="LogRespMap">
|
||||||
|
SELECT bj.job_id, bj.job_name,
|
||||||
|
(SELECT cc.code_name FROM common_code cc WHERE cc.group_code='BATCH_JOB' AND cc.code=bj.job_name) AS job_name_display,
|
||||||
|
bj.job_params, bj.settle_month,
|
||||||
|
bj.status,
|
||||||
|
(SELECT cc.code_name FROM common_code cc WHERE cc.group_code='BATCH_JOB_STATUS' AND cc.code=bj.status) AS status_name,
|
||||||
|
bj.current_step, bj.progress_pct, bj.total_count, bj.processed_count,
|
||||||
|
bj.error_count, bj.error_message,
|
||||||
|
bj.started_at, bj.finished_at, bj.duration_sec,
|
||||||
|
bj.triggered_by, u.user_name AS triggered_by_name
|
||||||
|
FROM batch_job_log bj
|
||||||
|
LEFT JOIN users u ON u.user_id = bj.triggered_by
|
||||||
|
<where>
|
||||||
|
<if test="jobName != null and jobName != ''">AND bj.job_name = #{jobName}</if>
|
||||||
|
<if test="settleMonth != null and settleMonth != ''">AND bj.settle_month = #{settleMonth}</if>
|
||||||
|
<if test="batchJobStatus != null and batchJobStatus != ''">AND bj.status = #{batchJobStatus}</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY bj.started_at DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -48,4 +48,31 @@
|
|||||||
SELECT COALESCE(SUM(cb_amount), 0) FROM chargeback WHERE settle_month = #{settleMonth}
|
SELECT COALESCE(SUM(cb_amount), 0) FROM chargeback WHERE settle_month = #{settleMonth}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 신규 -->
|
||||||
|
<resultMap id="CBRespMap" type="com.ga.core.vo.settle.ChargebackResp"/>
|
||||||
|
|
||||||
|
<select id="selectRespList" resultMap="CBRespMap">
|
||||||
|
SELECT cb.cb_id, cb.contract_id, cb.agent_id, a.agent_name,
|
||||||
|
cb.policy_no, p.product_name,
|
||||||
|
cb.lapse_month, cb.cb_rate, cb.cb_amount,
|
||||||
|
cb.paid_amount, cb.remain_amount, cb.settle_month,
|
||||||
|
cb.installment_no, cb.max_installments,
|
||||||
|
cb.status,
|
||||||
|
(SELECT cc.code_name FROM common_code cc WHERE cc.group_code='CHARGEBACK_STATUS' AND cc.code=cb.status) AS status_name,
|
||||||
|
cb.created_at
|
||||||
|
FROM chargeback cb
|
||||||
|
LEFT JOIN agent a ON a.agent_id = cb.agent_id
|
||||||
|
LEFT JOIN contract ct ON ct.contract_id = cb.contract_id
|
||||||
|
LEFT JOIN product p ON p.product_id = ct.product_id
|
||||||
|
<where>
|
||||||
|
<if test="agentId != null">AND cb.agent_id = #{agentId}</if>
|
||||||
|
<if test="contractId != null">AND cb.contract_id = #{contractId}</if>
|
||||||
|
<if test="policyNo != null and policyNo != ''">AND cb.policy_no = #{policyNo}</if>
|
||||||
|
<if test="settleMonth != null and settleMonth != ''">AND cb.settle_month = #{settleMonth}</if>
|
||||||
|
<if test="chargebackStatus != null and chargebackStatus != ''">AND cb.status = #{chargebackStatus}</if>
|
||||||
|
<if test="remainOnly == true">AND cb.remain_amount > 0</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY cb.created_at DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -42,4 +42,27 @@
|
|||||||
SELECT COALESCE(SUM(override_amount), 0) FROM override_settle WHERE settle_month = #{settleMonth}
|
SELECT COALESCE(SUM(override_amount), 0) FROM override_settle WHERE settle_month = #{settleMonth}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 신규 -->
|
||||||
|
<resultMap id="RespMap" type="com.ga.core.vo.settle.OverrideSettleResp"/>
|
||||||
|
|
||||||
|
<select id="selectRespList" resultMap="RespMap">
|
||||||
|
SELECT os.os_id, os.settle_id,
|
||||||
|
os.upper_agent_id, ua.agent_name AS upper_agent_name,
|
||||||
|
uo.org_name AS upper_org_name, ug.grade_name AS upper_grade_name,
|
||||||
|
os.lower_agent_id, la.agent_name AS lower_agent_name,
|
||||||
|
os.settle_month, os.base_amount, os.override_pct, os.override_amount, os.calc_date
|
||||||
|
FROM override_settle os
|
||||||
|
JOIN agent ua ON ua.agent_id = os.upper_agent_id
|
||||||
|
LEFT JOIN organization uo ON uo.org_id = ua.org_id
|
||||||
|
LEFT JOIN grade ug ON ug.grade_id = ua.grade_id
|
||||||
|
JOIN agent la ON la.agent_id = os.lower_agent_id
|
||||||
|
<where>
|
||||||
|
<if test="upperAgentId != null">AND os.upper_agent_id = #{upperAgentId}</if>
|
||||||
|
<if test="lowerAgentId != null">AND os.lower_agent_id = #{lowerAgentId}</if>
|
||||||
|
<if test="settleId != null">AND os.settle_id = #{settleId}</if>
|
||||||
|
<if test="settleMonth != null and settleMonth != ''">AND os.settle_month = #{settleMonth}</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY os.settle_month DESC, os.upper_agent_id
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -75,4 +75,36 @@
|
|||||||
<foreach collection="paymentIds" item="id" open="(" separator="," close=")">#{id}</foreach>
|
<foreach collection="paymentIds" item="id" open="(" separator="," close=")">#{id}</foreach>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<!-- 신규: PaymentSearchParam 기반 -->
|
||||||
|
<select id="selectByParam" resultMap="RespMap">
|
||||||
|
SELECT p.payment_id, p.settle_id, p.agent_id, a.agent_name,
|
||||||
|
p.bank_code,
|
||||||
|
(SELECT cc.code_name FROM common_code cc WHERE cc.group_code='BANK_CODE' AND cc.code=p.bank_code) AS bank_name,
|
||||||
|
p.pay_amount, p.pay_date,
|
||||||
|
p.pay_status,
|
||||||
|
(SELECT cc.code_name FROM common_code cc WHERE cc.group_code='PAYMENT_STATUS' AND cc.code=p.pay_status) AS pay_status_name,
|
||||||
|
p.fail_reason, s.settle_month
|
||||||
|
FROM payment p
|
||||||
|
JOIN settle_master s ON s.settle_id = p.settle_id
|
||||||
|
JOIN agent a ON a.agent_id = p.agent_id
|
||||||
|
<where>
|
||||||
|
<if test="agentId != null">AND p.agent_id = #{agentId}</if>
|
||||||
|
<if test="settleId != null">AND p.settle_id = #{settleId}</if>
|
||||||
|
<if test="payStatus != null and payStatus != ''">AND p.pay_status = #{payStatus}</if>
|
||||||
|
<if test="payDateFrom != null">AND p.pay_date >= #{payDateFrom}</if>
|
||||||
|
<if test="payDateTo != null">AND p.pay_date <= #{payDateTo}</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY p.payment_id DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectRespById" resultMap="RespMap">
|
||||||
|
SELECT p.payment_id, p.settle_id, p.agent_id, a.agent_name,
|
||||||
|
p.bank_code, p.pay_amount, p.pay_date, p.pay_status,
|
||||||
|
p.fail_reason, s.settle_month
|
||||||
|
FROM payment p
|
||||||
|
JOIN settle_master s ON s.settle_id = p.settle_id
|
||||||
|
JOIN agent a ON a.agent_id = p.agent_id
|
||||||
|
WHERE p.payment_id = #{paymentId}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -23,4 +23,26 @@
|
|||||||
WHERE recon_id = #{reconId}
|
WHERE recon_id = #{reconId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<!-- 신규 -->
|
||||||
|
<resultMap id="ReconRespMap" type="com.ga.core.vo.settle.ReconciliationResp"/>
|
||||||
|
|
||||||
|
<select id="selectRespList" resultMap="ReconRespMap">
|
||||||
|
SELECT r.recon_id, r.company_code, c.company_name, r.settle_month,
|
||||||
|
r.company_total, r.system_total, r.diff_amount, r.diff_count,
|
||||||
|
r.status,
|
||||||
|
(SELECT cc.code_name FROM common_code cc WHERE cc.group_code='RECON_STATUS' AND cc.code=r.status) AS status_name,
|
||||||
|
r.resolve_note, r.resolved_by, u.user_name AS resolved_by_name,
|
||||||
|
r.resolved_at, r.created_at
|
||||||
|
FROM reconciliation r
|
||||||
|
LEFT JOIN insurance_company c ON c.company_code = r.company_code
|
||||||
|
LEFT JOIN users u ON u.user_id = r.resolved_by
|
||||||
|
<where>
|
||||||
|
<if test="companyCode != null and companyCode != ''">AND r.company_code = #{companyCode}</if>
|
||||||
|
<if test="settleMonth != null and settleMonth != ''">AND r.settle_month = #{settleMonth}</if>
|
||||||
|
<if test="reconcileStatus != null and reconcileStatus != ''">AND r.status = #{reconcileStatus}</if>
|
||||||
|
<if test="diffOnly == true">AND r.diff_amount <> 0</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY r.settle_month DESC, r.company_code
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -48,4 +48,35 @@
|
|||||||
VALUES (#{roleId}, #{menuId}, #{permCode}, COALESCE(#{isGranted},'Y'))
|
VALUES (#{roleId}, #{menuId}, #{permCode}, COALESCE(#{isGranted},'Y'))
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<!-- 신규 -->
|
||||||
|
<resultMap id="RoleRespMap" type="com.ga.core.vo.user.RoleResp"/>
|
||||||
|
|
||||||
|
<sql id="roleRespCols">
|
||||||
|
r.role_id, r.role_code, r.role_name, r.role_desc, r.role_level, r.is_system, r.is_active,
|
||||||
|
(SELECT COUNT(*) FROM user_role ur WHERE ur.role_id = r.role_id) AS user_count,
|
||||||
|
(SELECT COUNT(*) FROM role_menu_permission rmp WHERE rmp.role_id = r.role_id AND rmp.is_granted = 'Y') AS permission_count
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectRespList" resultMap="RoleRespMap">
|
||||||
|
SELECT <include refid="roleRespCols"/>
|
||||||
|
FROM role r
|
||||||
|
<where>
|
||||||
|
<if test="searchKeyword != null and searchKeyword != ''">
|
||||||
|
AND (r.role_code LIKE CONCAT('%', #{searchKeyword}, '%')
|
||||||
|
OR r.role_name LIKE CONCAT('%', #{searchKeyword}, '%'))
|
||||||
|
</if>
|
||||||
|
<if test="isSystem != null and isSystem != ''">AND r.is_system = #{isSystem}</if>
|
||||||
|
<if test="isActive != null and isActive != ''">AND r.is_active = #{isActive}</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY r.role_level DESC, r.role_id
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectRespById" resultMap="RoleRespMap">
|
||||||
|
SELECT <include refid="roleRespCols"/> FROM role r WHERE r.role_id = #{roleId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="existsByCode" resultType="int">
|
||||||
|
SELECT COUNT(*) FROM role WHERE role_code = #{roleCode}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -16,13 +16,6 @@ import UserList from '@/pages/system/UserList';
|
|||||||
import RoleList from '@/pages/system/RoleList';
|
import RoleList from '@/pages/system/RoleList';
|
||||||
import CodeList from '@/pages/system/CodeList';
|
import CodeList from '@/pages/system/CodeList';
|
||||||
|
|
||||||
// 신규: 수수료규정/데이터수신
|
|
||||||
import CommissionRateList from '@/pages/rule/CommissionRateList';
|
|
||||||
import PayoutRuleList from '@/pages/rule/PayoutRuleList';
|
|
||||||
import ProfileList from '@/pages/receive/ProfileList';
|
|
||||||
import ErrorList from '@/pages/receive/ErrorList';
|
|
||||||
import FieldMappingEditor from '@/pages/receive/FieldMappingEditor';
|
|
||||||
|
|
||||||
function RequireAuth({ children }: { children: React.ReactNode }) {
|
function RequireAuth({ children }: { children: React.ReactNode }) {
|
||||||
const token = localStorage.getItem('accessToken');
|
const token = localStorage.getItem('accessToken');
|
||||||
return token ? <>{children}</> : <Navigate to="/login" replace />;
|
return token ? <>{children}</> : <Navigate to="/login" replace />;
|
||||||
@@ -53,16 +46,6 @@ export default function App() {
|
|||||||
<Route path="settle/batch" element={<BatchRun />} />
|
<Route path="settle/batch" element={<BatchRun />} />
|
||||||
<Route path="payments" element={<PaymentList />} />
|
<Route path="payments" element={<PaymentList />} />
|
||||||
|
|
||||||
{/* 수수료 규정 */}
|
|
||||||
<Route path="rules/commission-rates" element={<CommissionRateList />} />
|
|
||||||
<Route path="rules/payout" element={<PayoutRuleList />} />
|
|
||||||
|
|
||||||
{/* 데이터수신 */}
|
|
||||||
<Route path="receive/profiles" element={<ProfileList />} />
|
|
||||||
<Route path="receive/errors" element={<ErrorList />} />
|
|
||||||
<Route path="receive/mapping/:companyCode/:targetTable" element={<FieldMappingEditor />} />
|
|
||||||
<Route path="receive/mapping/:companyCode" element={<FieldMappingEditor />} />
|
|
||||||
|
|
||||||
{/* 시스템관리 */}
|
{/* 시스템관리 */}
|
||||||
<Route path="system/users" element={<UserList />} />
|
<Route path="system/users" element={<UserList />} />
|
||||||
<Route path="system/roles" element={<RoleList />} />
|
<Route path="system/roles" element={<RoleList />} />
|
||||||
|
|||||||
@@ -1,46 +0,0 @@
|
|||||||
import { request } from './request';
|
|
||||||
|
|
||||||
export const receiveApi = {
|
|
||||||
// company_profile
|
|
||||||
listProfiles: (params: any) => request.get('/api/receive/profiles', { params }),
|
|
||||||
profileDetail: (companyCode: string) => request.get(`/api/receive/profiles/${companyCode}`),
|
|
||||||
saveProfile: (data: any) => request.post('/api/receive/profiles', data),
|
|
||||||
|
|
||||||
// field_mapping
|
|
||||||
listFieldMappings: (companyCode: string, targetTable?: string) =>
|
|
||||||
request.get(`/api/mapping/${companyCode}/fields`, { params: { targetTable } }),
|
|
||||||
createFieldMapping: (data: any) => request.post('/api/mapping/fields', data),
|
|
||||||
updateFieldMapping: (id: number, data: any) => request.put(`/api/mapping/fields/${id}`, data),
|
|
||||||
deleteFieldMapping: (id: number) => request.delete(`/api/mapping/fields/${id}`),
|
|
||||||
bulkSaveFieldMappings: (companyCode: string, rows: any[]) =>
|
|
||||||
request.post(`/api/mapping/${companyCode}/fields/bulk`, { rows }),
|
|
||||||
|
|
||||||
// code_mapping
|
|
||||||
listCodeMappings: (params: any) => request.get('/api/mapping/codes', { params }),
|
|
||||||
createCodeMapping: (data: any) => request.post('/api/mapping/codes', data),
|
|
||||||
updateCodeMapping: (id: number, data: any) => request.put(`/api/mapping/codes/${id}`, data),
|
|
||||||
deleteCodeMapping: (id: number) => request.delete(`/api/mapping/codes/${id}`),
|
|
||||||
|
|
||||||
// raw / errors
|
|
||||||
listRaw: (params: any) => request.get('/api/receive/raw', { params }),
|
|
||||||
listErrors: (params: any) => request.get('/api/receive/errors', { params }),
|
|
||||||
resolveError: (id: number, data: { status: string; note: string }) =>
|
|
||||||
request.put(`/api/receive/errors/${id}/resolve`, data),
|
|
||||||
|
|
||||||
// upload
|
|
||||||
uploadFile: (templateCode: string, file: File) => {
|
|
||||||
const fd = new FormData();
|
|
||||||
fd.append('file', file);
|
|
||||||
return request.post(`/api/upload-templates/${templateCode}/upload`, fd, {
|
|
||||||
headers: { 'Content-Type': 'multipart/form-data' },
|
|
||||||
});
|
|
||||||
},
|
|
||||||
previewFile: (templateCode: string, file: File, rows = 5) => {
|
|
||||||
const fd = new FormData();
|
|
||||||
fd.append('file', file);
|
|
||||||
fd.append('rows', String(rows));
|
|
||||||
return request.post(`/api/upload-templates/${templateCode}/preview`, fd, {
|
|
||||||
headers: { 'Content-Type': 'multipart/form-data' },
|
|
||||||
});
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
import { request } from './request';
|
|
||||||
|
|
||||||
export const ruleApi = {
|
|
||||||
// commission_rate
|
|
||||||
listCommission: (params: any) => request.get('/api/rules/commission-rates', { params }),
|
|
||||||
createCommission: (data: any) => request.post('/api/rules/commission-rates', data),
|
|
||||||
updateCommission: (id: number, data: any) => request.put(`/api/rules/commission-rates/${id}`, data),
|
|
||||||
deleteCommission: (id: number) => request.delete(`/api/rules/commission-rates/${id}`),
|
|
||||||
|
|
||||||
// payout_rule
|
|
||||||
listPayout: (params: any) => request.get('/api/rules/payout', { params }),
|
|
||||||
createPayout: (data: any) => request.post('/api/rules/payout', data),
|
|
||||||
updatePayout: (id: number, data: any) => request.put(`/api/rules/payout/${id}`, data),
|
|
||||||
deletePayout: (id: number) => request.delete(`/api/rules/payout/${id}`),
|
|
||||||
|
|
||||||
// override_rule
|
|
||||||
listOverride: (params: any) => request.get('/api/rules/override', { params }),
|
|
||||||
createOverride: (data: any) => request.post('/api/rules/override', data),
|
|
||||||
updateOverride: (id: number, data: any) => request.put(`/api/rules/override/${id}`, data),
|
|
||||||
deleteOverride: (id: number) => request.delete(`/api/rules/override/${id}`),
|
|
||||||
|
|
||||||
// chargeback_rule
|
|
||||||
listChargeback: (params: any) => request.get('/api/rules/chargeback', { params }),
|
|
||||||
createChargeback: (data: any) => request.post('/api/rules/chargeback', data),
|
|
||||||
updateChargeback: (id: number, data: any) => request.put(`/api/rules/chargeback/${id}`, data),
|
|
||||||
deleteChargeback: (id: number) => request.delete(`/api/rules/chargeback/${id}`),
|
|
||||||
|
|
||||||
// exception_type_code
|
|
||||||
listExceptionCodes: (params: any) => request.get('/api/rules/exception-codes', { params }),
|
|
||||||
createExceptionCode: (data: any) => request.post('/api/rules/exception-codes', data),
|
|
||||||
updateExceptionCode: (code: string, data: any) =>
|
|
||||||
request.put(`/api/rules/exception-codes/${code}`, data),
|
|
||||||
};
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
import { Table } from 'antd';
|
|
||||||
import type { TableProps } from 'antd';
|
|
||||||
|
|
||||||
export interface PageState {
|
|
||||||
pageNum: number;
|
|
||||||
pageSize: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Props<T> extends Omit<TableProps<T>, 'pagination' | 'dataSource'> {
|
|
||||||
data?: { list: T[]; total: number } | null;
|
|
||||||
page: PageState;
|
|
||||||
onPageChange: (p: PageState) => void;
|
|
||||||
loading?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Ant Design Table 래퍼.
|
|
||||||
* 서버사이드 페이징 + total 표시 + 100건 미만 데이터에 사용.
|
|
||||||
* (대량 데이터/셀편집은 DataGrid 사용)
|
|
||||||
*/
|
|
||||||
export default function DataTable<T extends object>({ data, page, onPageChange, ...rest }: Props<T>) {
|
|
||||||
return (
|
|
||||||
<Table<T>
|
|
||||||
rowKey={(row: any) => row.id ?? row.agentId ?? row.userId ?? row.companyId ?? row.productId ?? row.ledgerId ?? row.settleId ?? row.paymentId ?? JSON.stringify(row).slice(0, 30)}
|
|
||||||
dataSource={data?.list ?? []}
|
|
||||||
pagination={{
|
|
||||||
current: page.pageNum,
|
|
||||||
pageSize: page.pageSize,
|
|
||||||
total: data?.total ?? 0,
|
|
||||||
showSizeChanger: true,
|
|
||||||
showTotal: (t) => `총 ${t.toLocaleString()}건`,
|
|
||||||
onChange: (pageNum, pageSize) => onPageChange({ pageNum, pageSize }),
|
|
||||||
}}
|
|
||||||
{...rest}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
import { Button, Modal, Upload, message } from 'antd';
|
|
||||||
import { UploadOutlined } from '@ant-design/icons';
|
|
||||||
import { useState } from 'react';
|
|
||||||
import { request } from '@/api/request';
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
templateCode: string;
|
|
||||||
label?: string;
|
|
||||||
onComplete?: (result: any) => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 엑셀 업로드 버튼.
|
|
||||||
* 1. 템플릿 코드로 미리보기 (첫 5행) → 사용자가 매핑 확인
|
|
||||||
* 2. 확인 후 본 업로드 실행
|
|
||||||
* 3. 결과 표시 (성공/실패/스킵)
|
|
||||||
*/
|
|
||||||
export default function ExcelImportButton({ templateCode, label = '엑셀 업로드', onComplete }: Props) {
|
|
||||||
const [previewOpen, setPreviewOpen] = useState(false);
|
|
||||||
const [previewRows, setPreviewRows] = useState<any[]>([]);
|
|
||||||
const [pendingFile, setPendingFile] = useState<File | null>(null);
|
|
||||||
const [busy, setBusy] = useState(false);
|
|
||||||
|
|
||||||
const beforeUpload = async (file: File) => {
|
|
||||||
try {
|
|
||||||
const fd = new FormData();
|
|
||||||
fd.append('file', file);
|
|
||||||
fd.append('rows', '5');
|
|
||||||
const r = await request.post(`/api/upload-templates/${templateCode}/preview`, fd, {
|
|
||||||
headers: { 'Content-Type': 'multipart/form-data' },
|
|
||||||
});
|
|
||||||
setPreviewRows(r as any);
|
|
||||||
setPendingFile(file);
|
|
||||||
setPreviewOpen(true);
|
|
||||||
} catch (e: any) {
|
|
||||||
message.error('미리보기 실패: ' + (e.message ?? ''));
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
|
|
||||||
const confirmUpload = async () => {
|
|
||||||
if (!pendingFile) return;
|
|
||||||
setBusy(true);
|
|
||||||
try {
|
|
||||||
const fd = new FormData();
|
|
||||||
fd.append('file', pendingFile);
|
|
||||||
const r: any = await request.post(`/api/upload-templates/${templateCode}/upload`, fd, {
|
|
||||||
headers: { 'Content-Type': 'multipart/form-data' },
|
|
||||||
});
|
|
||||||
message.success(`${r.successCount}건 업로드 완료 (실패 ${r.errorCount}건)`);
|
|
||||||
setPreviewOpen(false);
|
|
||||||
onComplete?.(r);
|
|
||||||
} catch (e: any) {
|
|
||||||
message.error('업로드 실패: ' + (e.message ?? ''));
|
|
||||||
} finally {
|
|
||||||
setBusy(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Upload beforeUpload={beforeUpload} showUploadList={false} accept=".xlsx,.xls,.csv">
|
|
||||||
<Button icon={<UploadOutlined />}>{label}</Button>
|
|
||||||
</Upload>
|
|
||||||
<Modal
|
|
||||||
open={previewOpen}
|
|
||||||
title="업로드 미리보기 (첫 5행)"
|
|
||||||
onCancel={() => setPreviewOpen(false)}
|
|
||||||
onOk={confirmUpload}
|
|
||||||
okText="업로드 실행"
|
|
||||||
confirmLoading={busy}
|
|
||||||
width={900}
|
|
||||||
>
|
|
||||||
{previewRows.length === 0 ? (
|
|
||||||
<div>표시할 데이터가 없습니다.</div>
|
|
||||||
) : (
|
|
||||||
<table style={{ width: '100%', borderCollapse: 'collapse' }}>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
{Object.keys(previewRows[0] ?? {}).map((k) => (
|
|
||||||
<th key={k} style={{ border: '1px solid #ddd', padding: 4, background: '#fafafa' }}>{k}</th>
|
|
||||||
))}
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{previewRows.map((row, i) => (
|
|
||||||
<tr key={i}>
|
|
||||||
{Object.keys(previewRows[0] ?? {}).map((k) => (
|
|
||||||
<td key={k} style={{ border: '1px solid #ddd', padding: 4 }}>{String(row[k] ?? '')}</td>
|
|
||||||
))}
|
|
||||||
</tr>
|
|
||||||
))}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
)}
|
|
||||||
</Modal>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
import { useEffect } from 'react';
|
|
||||||
import { Col, Form, Input, Modal, Row, Select, message } from 'antd';
|
|
||||||
import { receiveApi } from '@/api/receive';
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
open: boolean;
|
|
||||||
initial?: any;
|
|
||||||
onClose: () => void;
|
|
||||||
onSaved: () => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** code_mapping 등록/수정. */
|
|
||||||
export default function CodeMappingModal({ open, initial, onClose, onSaved }: Props) {
|
|
||||||
const [form] = Form.useForm();
|
|
||||||
const isEdit = !!initial?.codeId;
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (!open) return;
|
|
||||||
if (initial) form.setFieldsValue(initial);
|
|
||||||
else {
|
|
||||||
form.resetFields();
|
|
||||||
form.setFieldsValue({ isActive: 'Y' });
|
|
||||||
}
|
|
||||||
}, [open, initial, form]);
|
|
||||||
|
|
||||||
const submit = async () => {
|
|
||||||
const v = await form.validateFields();
|
|
||||||
try {
|
|
||||||
if (isEdit) await receiveApi.updateCodeMapping(initial.codeId, v);
|
|
||||||
else await receiveApi.createCodeMapping(v);
|
|
||||||
message.success(isEdit ? '수정 완료' : '등록 완료');
|
|
||||||
onSaved();
|
|
||||||
onClose();
|
|
||||||
} catch {}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Modal
|
|
||||||
open={open}
|
|
||||||
title={isEdit ? '코드 매핑 수정' : '코드 매핑 등록'}
|
|
||||||
onOk={submit}
|
|
||||||
onCancel={onClose}
|
|
||||||
okText={isEdit ? '수정' : '등록'}
|
|
||||||
width={680}
|
|
||||||
destroyOnClose
|
|
||||||
>
|
|
||||||
<Form form={form} layout="vertical">
|
|
||||||
<Row gutter={16}>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item label="보험사 코드" name="companyCode" rules={[{ required: true }]}>
|
|
||||||
<Input disabled={isEdit} />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item label="코드 유형" name="codeType" rules={[{ required: true }]}
|
|
||||||
extra="예: INSURANCE_TYPE / PAY_CYCLE / CONTRACT_STATUS">
|
|
||||||
<Input disabled={isEdit} />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item label="원본 코드" name="sourceCode" rules={[{ required: true }]}>
|
|
||||||
<Input disabled={isEdit} />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item label="원본 명" name="sourceName">
|
|
||||||
<Input />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item label="표준 코드 (ga 시스템)" name="targetCode" rules={[{ required: true }]}>
|
|
||||||
<Input />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item label="표준 명" name="targetName">
|
|
||||||
<Input />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item label="활성" name="isActive">
|
|
||||||
<Select options={[{ value: 'Y', label: '사용' }, { value: 'N', label: '미사용' }]} />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
</Row>
|
|
||||||
</Form>
|
|
||||||
</Modal>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
import { useState } from 'react';
|
|
||||||
import { useQuery } from '@tanstack/react-query';
|
|
||||||
import { Tag } from 'antd';
|
|
||||||
import dayjs from 'dayjs';
|
|
||||||
import { receiveApi } from '@/api/receive';
|
|
||||||
import SearchForm from '@/components/common/SearchForm';
|
|
||||||
import DataTable from '@/components/common/DataTable';
|
|
||||||
|
|
||||||
export default function ErrorList() {
|
|
||||||
const [param, setParam] = useState<any>({ pageNum: 1, pageSize: 20 });
|
|
||||||
const { data, isLoading } = useQuery({
|
|
||||||
queryKey: ['receive-errors', param],
|
|
||||||
queryFn: () => receiveApi.listErrors(param),
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<SearchForm
|
|
||||||
conditions={[
|
|
||||||
{ type: 'text', name: 'companyCode', label: '보험사 코드' },
|
|
||||||
{ type: 'code', name: 'errorType', label: '에러 유형', groupCode: 'ERROR_TYPE' },
|
|
||||||
{ type: 'code', name: 'resolveStatus', label: '처리 상태', groupCode: 'RESOLVE_STATUS' },
|
|
||||||
]}
|
|
||||||
onSearch={(v) => setParam({ ...param, ...v, pageNum: 1 })}
|
|
||||||
/>
|
|
||||||
<DataTable
|
|
||||||
data={data as any}
|
|
||||||
page={{ pageNum: param.pageNum, pageSize: param.pageSize }}
|
|
||||||
onPageChange={(p) => setParam({ ...param, ...p })}
|
|
||||||
loading={isLoading}
|
|
||||||
columns={[
|
|
||||||
{ title: '보험사', dataIndex: 'companyName' },
|
|
||||||
{ title: '에러 유형', dataIndex: 'errorTypeName',
|
|
||||||
render: (v: string) => <Tag color="red">{v}</Tag> },
|
|
||||||
{ title: '필드', dataIndex: 'errorField' },
|
|
||||||
{ title: '값', dataIndex: 'errorValue', ellipsis: true },
|
|
||||||
{ title: '메시지', dataIndex: 'errorMessage', ellipsis: true },
|
|
||||||
{ title: '처리상태', dataIndex: 'resolveStatusName',
|
|
||||||
render: (v: string, r: any) => v === '처리완료'
|
|
||||||
? <Tag color="green">{v}</Tag>
|
|
||||||
: <Tag color="orange">{v}</Tag> },
|
|
||||||
{ title: '발생시각', dataIndex: 'createdAt',
|
|
||||||
render: (v: string) => v && dayjs(v).format('YYYY-MM-DD HH:mm') },
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,183 +0,0 @@
|
|||||||
import { useState } from 'react';
|
|
||||||
import { Button, Card, Input, Select, Space, Table, message } from 'antd';
|
|
||||||
import { ArrowDownOutlined, ArrowUpOutlined, DeleteOutlined, PlusOutlined, SaveOutlined } from '@ant-design/icons';
|
|
||||||
import { useNavigate, useParams } from 'react-router-dom';
|
|
||||||
import { useQuery } from '@tanstack/react-query';
|
|
||||||
import PageContainer from '@/components/common/PageContainer';
|
|
||||||
import PermissionButton from '@/components/common/PermissionButton';
|
|
||||||
import { receiveApi } from '@/api/receive';
|
|
||||||
|
|
||||||
interface MappingRow {
|
|
||||||
mappingId?: number;
|
|
||||||
sourceField: string;
|
|
||||||
sourceColIndex?: number;
|
|
||||||
targetTable: string;
|
|
||||||
targetField: string;
|
|
||||||
dataType?: string; // STRING / NUMBER / DECIMAL / DATE / INTEGER
|
|
||||||
transformRule?: string; // TRIM / UPPER / LOWER / DATE / DIVIDE / MULTIPLY / CODE_MAP / DEFAULT
|
|
||||||
defaultValue?: string;
|
|
||||||
isRequired?: string;
|
|
||||||
sortOrder: number;
|
|
||||||
__dirty?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
const TARGET_TABLES = [
|
|
||||||
{ value: 'recruit_ledger', label: '모집수수료원장' },
|
|
||||||
{ value: 'maintain_ledger', label: '유지수수료원장' },
|
|
||||||
];
|
|
||||||
|
|
||||||
const DATA_TYPES = ['STRING', 'NUMBER', 'DECIMAL', 'DATE', 'INTEGER'].map((v) => ({ value: v, label: v }));
|
|
||||||
|
|
||||||
const TRANSFORM_RULES = [
|
|
||||||
{ value: '', label: '(없음)' },
|
|
||||||
{ value: 'TRIM', label: '공백제거' },
|
|
||||||
{ value: 'UPPER', label: '대문자' },
|
|
||||||
{ value: 'LOWER', label: '소문자' },
|
|
||||||
{ value: 'DATE', label: '날짜변환' },
|
|
||||||
{ value: 'DIVIDE', label: '나누기' },
|
|
||||||
{ value: 'MULTIPLY', label: '곱하기' },
|
|
||||||
{ value: 'CODE_MAP', label: '코드매핑' },
|
|
||||||
{ value: 'DEFAULT', label: '기본값' },
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 보험사별 필드 매핑 편집기.
|
|
||||||
* URL: /receive/mapping/:companyCode/:targetTable
|
|
||||||
*/
|
|
||||||
export default function FieldMappingEditor() {
|
|
||||||
const { companyCode = '', targetTable: tt } = useParams<{ companyCode: string; targetTable?: string }>();
|
|
||||||
const [targetTable, setTargetTable] = useState<string>(tt ?? 'recruit_ledger');
|
|
||||||
const [rows, setRows] = useState<MappingRow[]>([]);
|
|
||||||
const navigate = useNavigate();
|
|
||||||
|
|
||||||
const { refetch, isLoading } = useQuery({
|
|
||||||
queryKey: ['fieldMappings', companyCode, targetTable],
|
|
||||||
queryFn: async () => {
|
|
||||||
const r: any = await receiveApi.listFieldMappings(companyCode, targetTable);
|
|
||||||
const list: MappingRow[] = (Array.isArray(r) ? r : (r?.list ?? [])).map((x: any, i: number) => ({
|
|
||||||
...x,
|
|
||||||
sortOrder: x.sortOrder ?? i + 1,
|
|
||||||
}));
|
|
||||||
setRows(list);
|
|
||||||
return list;
|
|
||||||
},
|
|
||||||
enabled: !!companyCode && !!targetTable,
|
|
||||||
});
|
|
||||||
|
|
||||||
const addRow = () => {
|
|
||||||
setRows([
|
|
||||||
...rows,
|
|
||||||
{
|
|
||||||
sourceField: '',
|
|
||||||
targetTable,
|
|
||||||
targetField: '',
|
|
||||||
dataType: 'STRING',
|
|
||||||
sortOrder: rows.length + 1,
|
|
||||||
isRequired: 'N',
|
|
||||||
__dirty: true,
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
};
|
|
||||||
|
|
||||||
const removeRow = (idx: number) => {
|
|
||||||
const next = rows.filter((_, i) => i !== idx).map((r, i) => ({ ...r, sortOrder: i + 1, __dirty: true }));
|
|
||||||
setRows(next);
|
|
||||||
};
|
|
||||||
|
|
||||||
const move = (idx: number, dir: -1 | 1) => {
|
|
||||||
const target = idx + dir;
|
|
||||||
if (target < 0 || target >= rows.length) return;
|
|
||||||
const next = [...rows];
|
|
||||||
[next[idx], next[target]] = [next[target], next[idx]];
|
|
||||||
setRows(next.map((r, i) => ({ ...r, sortOrder: i + 1, __dirty: true })));
|
|
||||||
};
|
|
||||||
|
|
||||||
const setCell = (idx: number, field: keyof MappingRow, value: any) => {
|
|
||||||
const next = [...rows];
|
|
||||||
next[idx] = { ...next[idx], [field]: value, __dirty: true };
|
|
||||||
setRows(next);
|
|
||||||
};
|
|
||||||
|
|
||||||
const save = async () => {
|
|
||||||
// 검증
|
|
||||||
for (const r of rows) {
|
|
||||||
if (!r.sourceField || !r.targetField) {
|
|
||||||
message.error('원본/타겟 필드는 모두 채워야 합니다');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
await receiveApi.bulkSaveFieldMappings(companyCode, rows);
|
|
||||||
message.success('저장 완료');
|
|
||||||
refetch();
|
|
||||||
} catch {}
|
|
||||||
};
|
|
||||||
|
|
||||||
const columns = [
|
|
||||||
{ title: '순서', width: 80, render: (_: any, _r: MappingRow, idx: number) => (
|
|
||||||
<Space>
|
|
||||||
<Button size="small" icon={<ArrowUpOutlined />} disabled={idx === 0} onClick={() => move(idx, -1)} />
|
|
||||||
<Button size="small" icon={<ArrowDownOutlined />} disabled={idx === rows.length - 1} onClick={() => move(idx, 1)} />
|
|
||||||
<span>{idx + 1}</span>
|
|
||||||
</Space>
|
|
||||||
)},
|
|
||||||
{ title: '원본 필드명', width: 180, render: (_: any, r: MappingRow, idx: number) => (
|
|
||||||
<Input value={r.sourceField} onChange={(e) => setCell(idx, 'sourceField', e.target.value)} />
|
|
||||||
)},
|
|
||||||
{ title: '컬럼 인덱스', width: 110, render: (_: any, r: MappingRow, idx: number) => (
|
|
||||||
<Input type="number" value={r.sourceColIndex} onChange={(e) =>
|
|
||||||
setCell(idx, 'sourceColIndex', e.target.value === '' ? undefined : Number(e.target.value))} />
|
|
||||||
)},
|
|
||||||
{ title: '타겟 필드명', width: 180, render: (_: any, r: MappingRow, idx: number) => (
|
|
||||||
<Input value={r.targetField} onChange={(e) => setCell(idx, 'targetField', e.target.value)} />
|
|
||||||
)},
|
|
||||||
{ title: '데이터 타입', width: 120, render: (_: any, r: MappingRow, idx: number) => (
|
|
||||||
<Select size="small" style={{ width: '100%' }} value={r.dataType}
|
|
||||||
onChange={(v) => setCell(idx, 'dataType', v)} options={DATA_TYPES} />
|
|
||||||
)},
|
|
||||||
{ title: '변환 규칙', width: 120, render: (_: any, r: MappingRow, idx: number) => (
|
|
||||||
<Select size="small" style={{ width: '100%' }} value={r.transformRule ?? ''}
|
|
||||||
onChange={(v) => setCell(idx, 'transformRule', v || undefined)} options={TRANSFORM_RULES} />
|
|
||||||
)},
|
|
||||||
{ title: '기본값', width: 140, render: (_: any, r: MappingRow, idx: number) => (
|
|
||||||
<Input size="small" value={r.defaultValue ?? ''} onChange={(e) => setCell(idx, 'defaultValue', e.target.value || undefined)} />
|
|
||||||
)},
|
|
||||||
{ title: '필수', width: 70, render: (_: any, r: MappingRow, idx: number) => (
|
|
||||||
<Select size="small" style={{ width: '100%' }} value={r.isRequired ?? 'N'}
|
|
||||||
onChange={(v) => setCell(idx, 'isRequired', v)}
|
|
||||||
options={[{ value: 'Y', label: 'Y' }, { value: 'N', label: 'N' }]} />
|
|
||||||
)},
|
|
||||||
{ title: '', width: 60, render: (_: any, _r: MappingRow, idx: number) => (
|
|
||||||
<Button danger size="small" icon={<DeleteOutlined />} onClick={() => removeRow(idx)} />
|
|
||||||
)},
|
|
||||||
];
|
|
||||||
|
|
||||||
return (
|
|
||||||
<PageContainer title={`필드 매핑 — ${companyCode}`}>
|
|
||||||
<Space style={{ marginBottom: 12 }}>
|
|
||||||
<span>대상 테이블:</span>
|
|
||||||
<Select value={targetTable} onChange={setTargetTable} options={TARGET_TABLES} style={{ width: 220 }} />
|
|
||||||
<Button onClick={() => refetch()}>새로고침</Button>
|
|
||||||
<Button onClick={() => navigate(-1)}>뒤로</Button>
|
|
||||||
</Space>
|
|
||||||
|
|
||||||
<Card>
|
|
||||||
<Space style={{ marginBottom: 12 }}>
|
|
||||||
<Button type="dashed" icon={<PlusOutlined />} onClick={addRow}>행 추가</Button>
|
|
||||||
<PermissionButton menu="MAPPING" perm="UPDATE" type="primary"
|
|
||||||
icon={<SaveOutlined />} onClick={save}>저장</PermissionButton>
|
|
||||||
{rows.some((r) => r.__dirty) && <span style={{ color: '#fa8c16' }}>● 변경됨</span>}
|
|
||||||
</Space>
|
|
||||||
<Table
|
|
||||||
rowKey={(r, i) => `${r.mappingId ?? 'new'}_${i}`}
|
|
||||||
dataSource={rows}
|
|
||||||
columns={columns as any}
|
|
||||||
pagination={false}
|
|
||||||
loading={isLoading}
|
|
||||||
size="small"
|
|
||||||
bordered
|
|
||||||
/>
|
|
||||||
</Card>
|
|
||||||
</PageContainer>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
import { useState } from 'react';
|
|
||||||
import { useQuery } from '@tanstack/react-query';
|
|
||||||
import { Button, Space, Tag } from 'antd';
|
|
||||||
import { useNavigate } from 'react-router-dom';
|
|
||||||
import { receiveApi } from '@/api/receive';
|
|
||||||
import SearchForm from '@/components/common/SearchForm';
|
|
||||||
import DataTable from '@/components/common/DataTable';
|
|
||||||
import PermissionButton from '@/components/common/PermissionButton';
|
|
||||||
import ProfileModal from './ProfileModal';
|
|
||||||
|
|
||||||
export default function ProfileList() {
|
|
||||||
const [param, setParam] = useState<any>({ pageNum: 1, pageSize: 20 });
|
|
||||||
const [modalOpen, setModalOpen] = useState(false);
|
|
||||||
const [editing, setEditing] = useState<any>(null);
|
|
||||||
const navigate = useNavigate();
|
|
||||||
const { data, isLoading, refetch } = useQuery({
|
|
||||||
queryKey: ['receive-profiles', param],
|
|
||||||
queryFn: () => receiveApi.listProfiles(param),
|
|
||||||
});
|
|
||||||
|
|
||||||
const openCreate = () => { setEditing(null); setModalOpen(true); };
|
|
||||||
const openEdit = (row: any) => { setEditing(row); setModalOpen(true); };
|
|
||||||
const goMapping = (companyCode: string) => navigate(`/receive/mapping/${companyCode}/recruit_ledger`);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<SearchForm
|
|
||||||
conditions={[
|
|
||||||
{ type: 'text', name: 'searchKeyword', label: '보험사 코드/명' },
|
|
||||||
{ type: 'code', name: 'dataFormat', label: '데이터 형식', groupCode: 'DATA_FORMAT' },
|
|
||||||
{ type: 'code', name: 'receiveMethod', label: '수신 방식', groupCode: 'RECEIVE_METHOD' },
|
|
||||||
]}
|
|
||||||
onSearch={(v) => setParam({ ...param, ...v, pageNum: 1 })}
|
|
||||||
/>
|
|
||||||
<Space style={{ marginBottom: 12 }}>
|
|
||||||
<PermissionButton menu="RECEIVE_PROFILE" perm="CREATE" type="primary" onClick={openCreate}>신규</PermissionButton>
|
|
||||||
</Space>
|
|
||||||
<DataTable
|
|
||||||
data={data as any}
|
|
||||||
page={{ pageNum: param.pageNum, pageSize: param.pageSize }}
|
|
||||||
onPageChange={(p) => setParam({ ...param, ...p })}
|
|
||||||
loading={isLoading}
|
|
||||||
columns={[
|
|
||||||
{ title: '보험사 코드', dataIndex: 'companyCode' },
|
|
||||||
{ title: '보험사명', dataIndex: 'companyName' },
|
|
||||||
{ title: '형식', dataIndex: 'dataFormatName' },
|
|
||||||
{ title: '수신방식', dataIndex: 'receiveMethodName' },
|
|
||||||
{ title: '인코딩', dataIndex: 'fileEncoding' },
|
|
||||||
{ title: '필드매핑', dataIndex: 'fieldMappingCount', align: 'right' as const,
|
|
||||||
render: (v: number) => <Tag color={v > 0 ? 'blue' : 'default'}>{v}</Tag> },
|
|
||||||
{ title: '활성', dataIndex: 'isActive',
|
|
||||||
render: (v: string) => v === 'Y' ? <Tag color="green">사용</Tag> : <Tag>미사용</Tag> },
|
|
||||||
{ title: '', width: 220, render: (_: any, r: any) => (
|
|
||||||
<Space>
|
|
||||||
<PermissionButton menu="RECEIVE_PROFILE" perm="UPDATE" size="small" onClick={() => openEdit(r)}>수정</PermissionButton>
|
|
||||||
<Button size="small" onClick={() => goMapping(r.companyCode)}>필드매핑</Button>
|
|
||||||
</Space>
|
|
||||||
)},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
<ProfileModal
|
|
||||||
open={modalOpen}
|
|
||||||
initial={editing}
|
|
||||||
onClose={() => setModalOpen(false)}
|
|
||||||
onSaved={refetch}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,148 +0,0 @@
|
|||||||
import { useEffect } from 'react';
|
|
||||||
import { Col, Form, Input, InputNumber, Modal, Row, Select, message } from 'antd';
|
|
||||||
import CodeSelect from '@/components/common/CodeSelect';
|
|
||||||
import { receiveApi } from '@/api/receive';
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
open: boolean;
|
|
||||||
initial?: any;
|
|
||||||
onClose: () => void;
|
|
||||||
onSaved: () => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** company_profile 등록/수정 (UPSERT). companyCode를 PK로 사용. */
|
|
||||||
export default function ProfileModal({ open, initial, onClose, onSaved }: Props) {
|
|
||||||
const [form] = Form.useForm();
|
|
||||||
const isEdit = !!initial?.companyCode;
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (!open) return;
|
|
||||||
if (initial) form.setFieldsValue(initial);
|
|
||||||
else {
|
|
||||||
form.resetFields();
|
|
||||||
form.setFieldsValue({
|
|
||||||
dataFormat: 'EXCEL', receiveMethod: 'MANUAL',
|
|
||||||
fileEncoding: 'UTF-8', headerRow: 1, dataStartRow: 2, isActive: 'Y',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, [open, initial, form]);
|
|
||||||
|
|
||||||
const submit = async () => {
|
|
||||||
const v = await form.validateFields();
|
|
||||||
try {
|
|
||||||
await receiveApi.saveProfile(v);
|
|
||||||
message.success(isEdit ? '수정 완료' : '등록 완료');
|
|
||||||
onSaved();
|
|
||||||
onClose();
|
|
||||||
} catch {}
|
|
||||||
};
|
|
||||||
|
|
||||||
const dataFormat = Form.useWatch('dataFormat', form);
|
|
||||||
const receiveMethod = Form.useWatch('receiveMethod', form);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Modal
|
|
||||||
open={open}
|
|
||||||
title={isEdit ? '보험사 프로파일 수정' : '보험사 프로파일 등록'}
|
|
||||||
onOk={submit}
|
|
||||||
onCancel={onClose}
|
|
||||||
okText={isEdit ? '저장' : '등록'}
|
|
||||||
width={760}
|
|
||||||
destroyOnClose
|
|
||||||
>
|
|
||||||
<Form form={form} layout="vertical">
|
|
||||||
<Row gutter={16}>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item label="보험사 코드" name="companyCode" rules={[{ required: true, max: 20 }]}>
|
|
||||||
<Input disabled={isEdit} />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item label="활성" name="isActive">
|
|
||||||
<Select options={[{ value: 'Y', label: '사용' }, { value: 'N', label: '미사용' }]} />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item label="데이터 형식" name="dataFormat" rules={[{ required: true }]}>
|
|
||||||
<CodeSelect groupCode="DATA_FORMAT" />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item label="수신 방식" name="receiveMethod" rules={[{ required: true }]}>
|
|
||||||
<CodeSelect groupCode="RECEIVE_METHOD" />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
|
|
||||||
{(dataFormat === 'EXCEL' || dataFormat === 'CSV') && (
|
|
||||||
<>
|
|
||||||
<Col span={8}>
|
|
||||||
<Form.Item label="인코딩" name="fileEncoding">
|
|
||||||
<Input />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={8}>
|
|
||||||
<Form.Item label="구분자(CSV)" name="delimiter" extra="예: , 또는 \\t">
|
|
||||||
<Input />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={8}>
|
|
||||||
<Form.Item label="시트명(EXCEL)" name="sheetName">
|
|
||||||
<Input placeholder="비우면 첫 시트" />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={8}>
|
|
||||||
<Form.Item label="헤더 행" name="headerRow">
|
|
||||||
<InputNumber min={1} max={50} style={{ width: '100%' }} />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={8}>
|
|
||||||
<Form.Item label="데이터 시작 행" name="dataStartRow">
|
|
||||||
<InputNumber min={1} max={50} style={{ width: '100%' }} />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={8}>
|
|
||||||
<Form.Item label="날짜 포맷" name="dateFormat" extra="예: yyyyMMdd / yyyy-MM-dd">
|
|
||||||
<Input />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item label="금액 포맷" name="amountFormat" extra="예: WON(원), JEON(전)">
|
|
||||||
<Input />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{receiveMethod === 'API' && (
|
|
||||||
<Col span={24}>
|
|
||||||
<Form.Item label="API URL" name="apiUrl" extra="{settleMonth} placeholder 사용 가능">
|
|
||||||
<Input placeholder="https://api.company.com/commission?month={settleMonth}" />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{(receiveMethod === 'FTP' || receiveMethod === 'SFTP') && (
|
|
||||||
<>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item label="FTP 호스트" name="ftpHost">
|
|
||||||
<Input />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item label="FTP 경로" name="ftpPath">
|
|
||||||
<Input />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<Col span={24}>
|
|
||||||
<Form.Item label="수신 스케줄(cron)" name="receiveSchedule" extra="예: 0 0 2 * * ? = 매일 2시">
|
|
||||||
<Input />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
</Row>
|
|
||||||
</Form>
|
|
||||||
</Modal>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,117 +0,0 @@
|
|||||||
import { useEffect } from 'react';
|
|
||||||
import { Col, DatePicker, Form, Input, InputNumber, Modal, Row, Select, message } from 'antd';
|
|
||||||
import dayjs from 'dayjs';
|
|
||||||
import CodeSelect from '@/components/common/CodeSelect';
|
|
||||||
import { ruleApi } from '@/api/rule';
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
open: boolean;
|
|
||||||
initial?: any;
|
|
||||||
onClose: () => void;
|
|
||||||
onSaved: () => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function ChargebackRuleModal({ open, initial, onClose, onSaved }: Props) {
|
|
||||||
const [form] = Form.useForm();
|
|
||||||
const isEdit = !!initial?.cbRuleId;
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (!open) return;
|
|
||||||
if (initial) {
|
|
||||||
form.setFieldsValue({
|
|
||||||
...initial,
|
|
||||||
cbRate: initial.cbRate != null ? initial.cbRate * 100 : undefined,
|
|
||||||
effectiveFrom: initial.effectiveFrom ? dayjs(initial.effectiveFrom) : null,
|
|
||||||
effectiveTo: initial.effectiveTo ? dayjs(initial.effectiveTo) : null,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
form.resetFields();
|
|
||||||
form.setFieldsValue({ includeOverride: 'N', installmentAllowed: 'N' });
|
|
||||||
}
|
|
||||||
}, [open, initial, form]);
|
|
||||||
|
|
||||||
const submit = async () => {
|
|
||||||
const v = await form.validateFields();
|
|
||||||
const body = {
|
|
||||||
...v,
|
|
||||||
cbRate: v.cbRate != null ? v.cbRate / 100 : undefined,
|
|
||||||
effectiveFrom: v.effectiveFrom ? v.effectiveFrom.format('YYYY-MM-DD') : undefined,
|
|
||||||
effectiveTo: v.effectiveTo ? v.effectiveTo.format('YYYY-MM-DD') : undefined,
|
|
||||||
};
|
|
||||||
try {
|
|
||||||
if (isEdit) await ruleApi.updateChargeback(initial.cbRuleId, body);
|
|
||||||
else await ruleApi.createChargeback(body);
|
|
||||||
message.success(isEdit ? '수정 완료' : '등록 완료');
|
|
||||||
onSaved();
|
|
||||||
onClose();
|
|
||||||
} catch {}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Modal
|
|
||||||
open={open}
|
|
||||||
title={isEdit ? '환수 규정 수정' : '환수 규정 등록'}
|
|
||||||
onOk={submit}
|
|
||||||
onCancel={onClose}
|
|
||||||
okText={isEdit ? '수정' : '등록'}
|
|
||||||
width={720}
|
|
||||||
destroyOnClose
|
|
||||||
>
|
|
||||||
<Form form={form} layout="vertical">
|
|
||||||
<Row gutter={16}>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item label="보험사 코드" name="companyCode" rules={[{ required: true }]}
|
|
||||||
extra="빈값 허용 X — 공통 적용은 'ALL' 추후 예약">
|
|
||||||
<Input />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item label="보종" name="insuranceType" rules={[{ required: true }]}>
|
|
||||||
<CodeSelect groupCode="INSURANCE_TYPE" />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item label="실효 시작 개월" name="lapseMonthFrom" rules={[{ required: true }]}>
|
|
||||||
<InputNumber min={0} max={120} style={{ width: '100%' }} />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item label="실효 종료 개월" name="lapseMonthTo" rules={[{ required: true }]}>
|
|
||||||
<InputNumber min={0} max={120} style={{ width: '100%' }} />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item label="환수율 (%)" name="cbRate" rules={[{ required: true }]}>
|
|
||||||
<InputNumber min={0} max={100} step={0.01} precision={2} style={{ width: '100%' }} />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item label="오버라이드 포함" name="includeOverride">
|
|
||||||
<Select options={[{ value: 'Y', label: '포함' }, { value: 'N', label: '미포함' }]} />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item label="분납 허용" name="installmentAllowed">
|
|
||||||
<Select options={[{ value: 'Y', label: '허용' }, { value: 'N', label: '불허' }]} />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item label="최대 분납 회수" name="maxInstallments">
|
|
||||||
<InputNumber min={1} max={36} style={{ width: '100%' }} />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item label="효력 시작" name="effectiveFrom" rules={[{ required: true }]}>
|
|
||||||
<DatePicker style={{ width: '100%' }} />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item label="효력 종료" name="effectiveTo">
|
|
||||||
<DatePicker style={{ width: '100%' }} />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
</Row>
|
|
||||||
</Form>
|
|
||||||
</Modal>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user