package com.hsbc.risk.frtbsa.entity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import javax.persistence.*; import java.util.Date; @Table(name = "cde_completeness_config") @Entity @Data @AllArgsConstructor @NoArgsConstructor @Builder public class CdeCompletenessConfig { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @Column(name = "create_date") private Date createDate; @Column(name = "create_by") private String createBy; @Column(name = "cde_name") private String cdeName; @Column(name = "file_type") private String fileType; @Column(name = "version") private String version; @Column(name = "local_mode") private String localMode; @Column(name = "status") private String status; @Column(name = "error_message") private String errorMessage; @Column(name = "dq_id") private String dqId; @Transient private String outputDir; }
package com.hsbc.risk.frtbsa.entity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import javax.persistence.*; import java.util.Date; @Table(name = "cde_completeness_rule") @Entity @Data @AllArgsConstructor @NoArgsConstructor @Builder public class CdeCompletenessRule { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @Column(name = "create_date") private Date createDate; @Column(name = "create_by") private String createBy; @Column(name = "cde_name") private String cdeName; @Column(name = "cde_config_id") private Long cdeConfigId; @Column(name = "field") private String field; @Column(name = "operate") private String operate; @Column(name = "expected_value") private String expectedValue; @Column(name = "expected_from") private String expectedFrom; @Column(name = "expected_value_type") private String expectedValueType; @Column(name = "parse_order") private int parseOrder; @Column(name = "status") private String status; @Column(name = "combine_file_type") private String combineFileType; }
package com.hsbc.risk.frtbsa.entity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import javax.persistence.*; import java.util.Date; @Table(name = "cde_consistency_config") @Entity @Data @AllArgsConstructor @NoArgsConstructor @Builder public class CdeConsistencyConfig { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @Column(name = "create_date") private Date createDate; @Column(name = "create_by") private String createBy; @Column(name = "cde_name") private String cdeName; @Column(name = "file_type") private String fileType; @Column(name = "version") private String version; @Column(name = "local_mode") private String localMode; @Column(name = "status") private String status; @Column(name = "error_message") private String errorMessage; //fields to be compared @Column(name = "compare_field") private String compareField; @Column(name = "dq_id") private String dqId; @Transient private String outputDir; }
package com.hsbc.risk.frtbsa.entity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import javax.persistence.*; import java.util.Date; @Table(name = "cde_consistency_rule") @Entity @Data @AllArgsConstructor @NoArgsConstructor @Builder public class CdeConsistencyRule { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @Column(name = "create_date") private Date createDate; @Column(name = "create_by") private String createBy; @Column(name = "cde_name") private String cdeName; @Column(name = "cde_config_id") private Long cdeConfigId; @Column(name = "field") private String field; @Column(name = "operate") private String operate; @Column(name = "expected_value") private String expectedValue; @Column(name = "expected_from") private String expectedFrom; @Column(name = "expected_value_type") private String expectedValueType; @Column(name = "parse_order") private int parseOrder; @Column(name = "status") private String status; }
package com.hsbc.risk.frtbsa.entity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import javax.persistence.*; import java.util.Date; @Table(name = "cde_exception") @Entity @Data @AllArgsConstructor @NoArgsConstructor @Builder public class CdeException { @Id //@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequence") @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @Column(name = "dq_id") private String dqId; @Column(name = "site_code") private String siteCode; @Column(name = "legal_entity") private String legalEntity; @Column(name = "logical_or_business_name_cde") private String logicalOrBusinessNameCde; @Column(name = "table_name") private String tableName; @Column(name = "source_system_name") private String sourceSystemName; private String producer; @Column(name = "error_message") private String errorMessage; @Column(name = "dimension") private String dimension; @Column(name = "control_run_timestamp") private String controlRunTimestamp; @Column(name = "cde_exception_record_type") private String cdeExceptionRecordType; @Column(name = "record_id") private String recordId; @Column(name = "data_field_value") private String dataFieldValue; @Column(name = "book_identifier") private String bookIdentifier; @Column(name = "fx_delta") private Double fxDelta; @Column(name = "cm_delta") private Double cmDelta; @Column(name = "ir_delta") private Double irDelta; @Column(name = "eq_delta") private Double eqDelta; @Column(name = "create_date") private Date createDate; @Column(name = "create_by") private String createBy; @Column(name = "batch_num") private String batchNum; @Column(name = "generated_date") private String generatedDate; @Column(name = "cde_name") private String cdeName; @Column(name = "file_type") private String fileType; @Column(name = "trade_id") private String tradeId; @Column(name = "leg_id") private String legId; @Column(name = "risk_factor") private String riskFactor; @Column(name = "as_of_date") private String asOfDate; @Column(name = "risk_class") private String riskClass; //delta @Column(name = "sequence") private String sequence; //delta vega curvature @Column(name = "adjustment_flag") private String adjustmentFlag; //drc @Column(name = "obligor_id") private String obligorId; //drc @Column(name = "drc_underlyingref") private String drcUnderlyingref; @Column(name = "cde_config_id") private Long cdeConfigId; @Column(name = "pre_agg_group") private String preAggGroup; }
package com.hsbc.risk.frtbsa.entity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import javax.persistence.*; import java.util.Date; @Table(name = "cde_exception_summary") @Entity @Data @AllArgsConstructor @NoArgsConstructor @Builder public class CdeExceptionSummary { @Id //@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequence") @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @Column(name = "cde_name") private String cdeName; @Column(name = "site_code") private String siteCode; @Column(name = "dq_id") private String dqId; @Column(name = "records_failed") private Long recordsFailed; @Column(name = "records_passed") private Long recordsPassed; @Column(name = "records_tested") private Long recordsTested; @Column(name = "create_date") private Date createDate; @Column(name = "create_by") private String createBy; @Column(name = "batch_num") private String batchNum; @Column(name = "generated_date") private String generatedDate; @Column(name = "file_type") private String fileType; @Column(name = "cde_config_id") private Long cdeConfigId; @Column(name = "run_cost_time_count") private String runCostTimeCount; @Column(name = "dimension") private String dimension; @Column(name = "legal_entity") private String legalEntity; @Column(name = "table_name") private String tableName; }
exception
package com.hsbc.risk.frtbsa.exception; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RestControllerAdvice; @RestControllerAdvice @Slf4j public class GlobalExceptionHandler { @ExceptionHandler(IllegalArgumentException.class) public String handlerException(IllegalArgumentException ex) { ex.printStackTrace(); return "need args must not null"; } }
feed
package com.hsbc.risk.frtbsa.feed; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @Data @AllArgsConstructor @NoArgsConstructor public class FeedParam { private boolean isOrder; private String loadingLog; private String cobDate; private String url; //load unload private String type; private int retryCount; private String userName; private String password; }
option
package com.hsbc.risk.frtbsa.option; import com.hsbc.risk.frtbsa.constant.CdeConstants; import com.hsbc.risk.frtbsa.domain.enumType.FileTypeEnum; import org.apache.beam.runners.spark.SparkContextOptions; public interface CommonOption extends SparkContextOptions { String getVersion(); void setVersion(String version); String getFileType(); void setFileType(String fileType); String getLocalMode(); void setLocalMode(String localMode); void setCdeConstants(CdeConstants cdeConstants); CdeConstants getCdeConstants(); FileTypeEnum getCdeFileType(); void setCdeFileType(FileTypeEnum fileType); void setCdeName(String cdeName); String getCdeName(); }