다양화 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

@ -12,7 +12,8 @@
*
* . (KEY) DBIO cl_rec_select
* , // (status='S')
* . (read-only )
* . · /
* cl_ledger (SELECT) .
*
* (Contract)
* :
@ -27,6 +28,8 @@
* STATUS (R/M/U/S)
* STATUSLABEL (///)
* CLOSED (Y= S / N= )
* SIBLINGCNT ·
* SIBLINGSUM ·
*
*
* R() M() S(/)
@ -37,12 +40,14 @@
* 1) TXBUF KEY
* 2) cl_rec_select ( RESP_INVALID)
* 3) status CL_ST_* /
* 4) TXBUF tx_return
* 4) · SELECT
* 5) TXBUF tx_return
*/
#include <stdio.h>
#include <string.h>
#include "txcore.h"
#include "txcore_dbio.h"
#include "acq_util.h"
#include "cl_core.h"
@ -115,11 +120,32 @@ struct sqlca_t *ECPGget_sqlca(void);
#endif
#line 41 "app/online/cl_ol_0015.pgc"
#line 46 "app/online/cl_ol_0015.pgc"
TX_SERVICE(CL_OL_0015, ctx)
{
/* exec sql begin declare section */
#line 51 "app/online/cl_ol_0015.pgc"
char h_merch_id [ 16 ] ;
#line 52 "app/online/cl_ol_0015.pgc"
char h_biz_date [ 9 ] ;
#line 53 "app/online/cl_ol_0015.pgc"
long h_sib_cnt ;
#line 54 "app/online/cl_ol_0015.pgc"
long h_sib_sum ;
/* exec sql end declare section */
#line 55 "app/online/cl_ol_0015.pgc"
cl_rec_t rec;
char key[16];
char won[40];
@ -171,7 +197,33 @@ TX_SERVICE(CL_OL_0015, ctx)
/* 4. 스냅샷 요약행 여부 판정 (merch_id='*SNAP' 규약) */
is_snap = (strcmp(rec.merch_id, "*SNAP") == 0);
/* 5. 응답 구성 */
/* 5. 동일 가맹점·동일 영업일 형제 거래 집계 (read-only 맥락) */
strncpy(h_merch_id, rec.merch_id, sizeof(h_merch_id) - 1);
h_merch_id[sizeof(h_merch_id) - 1] = '\0';
strncpy(h_biz_date, rec.biz_date, sizeof(h_biz_date) - 1);
h_biz_date[sizeof(h_biz_date) - 1] = '\0';
h_sib_cnt = 0;
h_sib_sum = 0;
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select count ( * ) , coalesce ( sum ( amount ) , 0 ) from cl_ledger where merch_id = $1 and biz_date = $2 ",
ECPGt_char,(h_merch_id),(long)16,(long)1,(16)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_char,(h_biz_date),(long)9,(long)1,(9)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
ECPGt_long,&(h_sib_cnt),(long)1,(long)1,sizeof(long),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_long,&(h_sib_sum),(long)1,(long)1,sizeof(long),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
#line 120 "app/online/cl_ol_0015.pgc"
if (sqlca.sqlcode != TX_SQL_OK && sqlca.sqlcode != TX_SQL_NOTFOUND) {
TX_DBIO_LOG_ERR("CL_OL_0015 sibling aggregate");
h_sib_cnt = 0;
h_sib_sum = 0;
}
/* 6. 응답 구성 */
amount_format_won(rec.amount, won, sizeof(won));
tx_buf_reset(ctx->out);
tx_buf_sets(ctx->out, "RESPCODE", RESP_OK);
@ -185,15 +237,17 @@ TX_SERVICE(CL_OL_0015, ctx)
tx_buf_sets(ctx->out, "STATUSLABEL", st_label);
tx_buf_sets(ctx->out, "CLOSED", is_settled ? "Y" : "N");
tx_buf_sets(ctx->out, "SNAPSHOT", is_snap ? "Y" : "N");
tx_buf_setlong(ctx->out, "SIBLINGCNT", h_sib_cnt);
tx_buf_setlong(ctx->out, "SIBLINGSUM", h_sib_sum);
/* 6. 스냅샷 요약행은 집계행이므로 별도 안내 로깅 */
/* 7. 스냅샷 요약행은 집계행이므로 별도 안내 로깅 */
if (is_snap)
tx_log(TX_LOG_INFO,
"[CL_OL_0015] 스냅샷 요약행 조회 key=%s biz=%s Σ=%ld",
rec.key, rec.biz_date, rec.amount);
tx_log(TX_LOG_INFO,
"[CL_OL_0015] 상태조회 key=%s status=%s(%s) 마감여부=%s",
rec.key, rec.status, st_label, is_settled ? "Y" : "N");
"[CL_OL_0015] 상태조회 key=%s status=%s(%s) 마감여부=%s 형제=%ld건",
rec.key, rec.status, st_label, is_settled ? "Y" : "N", h_sib_cnt);
tx_return(ctx, TX_OK, ctx->out);
}