다양화 Wave2: dbio 289 + common 120 고유화 + 프로그램 206개 EXEC SQL 심화

- dbio io(289): fetch/touch/total 시그니처 유지, SQL 바디를 JOIN/집계/커서/
  upsert/DELETE 등 구조로 고유화 → 289/289 고유
- common cu(120): 유틸 시그니처 유지, Luhn/CRC/Zeller/BIN레인지/amortization/
  netting 등 실 알고리즘으로 고유화 → 120/120 고유
- 심화: 실제 EXEC SQL 없던 프로그램에 SELECT/INSERT/UPDATE/커서+tx 추가
  → online+batch 530/530 전부 실제 SQL 보유
- 전 코퍼스 프로그램 939/939 고유, 전체 docker make -j4 = EXIT 0, 958 오브젝트
- 임시 생성기 제거, inventory.json loc 실측 갱신

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
forge-bot 2026-07-19 04:54:59 +00:00
parent c3a0259e95
commit 93c3cb74af
1111 changed files with 31539 additions and 17258 deletions

View file

@ -101,11 +101,35 @@ struct sqlca_t *ECPGget_sqlca(void);
static int run_rc_bt_0006(const char *biz_date)
{
/* exec sql begin declare section */
#line 27 "app/batch/rc_bt_0006.pgc"
char h_bd [ 9 ] ;
#line 28 "app/batch/rc_bt_0006.pgc"
long h_db_total ;
#line 29 "app/batch/rc_bt_0006.pgc"
long h_db_unmatch ;
#line 30 "app/batch/rc_bt_0006.pgc"
long h_db_sum ;
/* exec sql end declare section */
#line 31 "app/batch/rc_bt_0006.pgc"
long cntR, cntM, cntU, cntS;
long total, processed;
long proc_rate, settle_rate, fail_rate;
int mismatch;
strncpy(h_bd, biz_date, sizeof(h_bd) - 1);
h_bd[sizeof(h_bd) - 1] = '\0';
/* 상태별 건수 조회 (읽기전용) */
cntR = rc_rec_count(biz_date, RC_ST_RECV);
cntM = rc_rec_count(biz_date, RC_ST_DONE);
@ -166,6 +190,47 @@ static int run_rc_bt_0006(const char *biz_date)
printf(" 미처리 여부 : %s\n", mismatch ? "미처리(접수 잔량)" : "완료");
printf("===============================================\n");
/* 원장에서 직접 총건수/불일치건수/총금액을 임베디드 SQL 로 교차집계 */
h_db_total = 0;
h_db_unmatch = 0;
h_db_sum = 0;
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select count ( * ) , coalesce ( SUM ( amount ) , 0 ) from rc_ledger where biz_date = $1 ",
ECPGt_char,(h_bd),(long)9,(long)1,(9)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
ECPGt_long,&(h_db_total),(long)1,(long)1,sizeof(long),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_long,&(h_db_sum),(long)1,(long)1,sizeof(long),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
#line 109 "app/batch/rc_bt_0006.pgc"
if (sqlca.sqlcode != TX_SQL_OK && sqlca.sqlcode != TX_SQL_NOTFOUND) {
TX_DBIO_LOG_ERR("SELECT rc_ledger dbtotal (rc_bt_0006)");
return TX_EDB;
}
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select count ( * ) from rc_ledger where biz_date = $1 and status = 'U'",
ECPGt_char,(h_bd),(long)9,(long)1,(9)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
ECPGt_long,&(h_db_unmatch),(long)1,(long)1,sizeof(long),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
#line 119 "app/batch/rc_bt_0006.pgc"
if (sqlca.sqlcode != TX_SQL_OK && sqlca.sqlcode != TX_SQL_NOTFOUND) {
TX_DBIO_LOG_ERR("SELECT rc_ledger unmatch (rc_bt_0006)");
return TX_EDB;
}
printf("------- 원장 직접 교차집계 (rc_bt_0006) -------\n");
printf(" DB 총건수 : %ld\n", h_db_total);
printf(" DB 불일치건수 : %ld\n", h_db_unmatch);
printf(" DB 총금액 : %ld\n", h_db_sum);
if (h_db_total != total)
tx_log(TX_LOG_WARN,
"[rc_bt_0006] 집계 교차검증 상이 count=%ld db=%ld",
total, h_db_total);
printf("===============================================\n");
return TX_OK;
}