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

@ -2,13 +2,15 @@
/*
* lg_ol_0002.pgc - 원장 온라인 서비스 (LG_OL_0002) [tier=hard]
*
* TxCore TX_SERVICE 엔트리. 요청 TXBUF 를 검증하고 lg 표준 DBIO 를
* 통해 처리한 뒤 응답 TXBUF 를 구성한다. (ATMI void SVC(TPSVCINFO*) 대응)
* TxCore TX_SERVICE 엔트리. 요청 TXBUF 를 검증하고 lg 표준 DBIO 로
* 원장 반영 → 후속 서비스 연계 → 커밋의 오케스트레이션을 수행한다.
* 당일 합계/건수는 원장(lg_ledger) 임베디드 집계로 교차검증한다.
*/
#include <stdio.h>
#include <string.h>
#include "txcore.h"
#include "txcore_dbio.h"
#include "acq_util.h"
#include "lg_core.h"
@ -16,9 +18,16 @@ EXEC SQL INCLUDE sqlca;
TX_SERVICE(LG_OL_0002, ctx)
{
EXEC SQL BEGIN DECLARE SECTION;
char h_merch[16];
char h_bizdate[9];
long h_daysum;
long h_daycnt;
EXEC SQL END DECLARE SECTION;
lg_rec_t rec;
char key[16], merch[16], bizdate[16], nextbiz[9];
long amount = 0, daysum = 0;
long amount = 0, daysum = 0, daycnt = 0;
int rc;
TXBUF *sub_in;
TXBUF *sub_out;
@ -83,9 +92,22 @@ TX_SERVICE(LG_OL_0002, ctx)
tx_buf_free(sub_in);
tx_buf_free(sub_out);
/* 교차 검증: 당일 합계 재계산 */
if (lg_rec_sum(bizdate, &daysum) != TX_OK)
daysum = 0;
/* 교차 검증: 당일 합계/건수 임베디드 재집계 */
strncpy(h_merch, merch, sizeof(h_merch) - 1); h_merch[sizeof(h_merch) - 1] = '\0';
strncpy(h_bizdate, bizdate, sizeof(h_bizdate) - 1); h_bizdate[sizeof(h_bizdate) - 1] = '\0';
h_daysum = 0;
h_daycnt = 0;
EXEC SQL SELECT coalesce(sum(amount), 0), count(*)
INTO :h_daysum, :h_daycnt
FROM lg_ledger
WHERE merch_id = :h_merch
AND biz_date = :h_bizdate;
if (sqlca.sqlcode == TX_SQL_OK) {
daysum = h_daysum;
daycnt = h_daycnt;
} else if (sqlca.sqlcode != TX_SQL_NOTFOUND) {
TX_DBIO_LOG_ERR("SELECT lg_ledger 당일집계");
}
tx_commit();
@ -93,6 +115,8 @@ TX_SERVICE(LG_OL_0002, ctx)
tx_buf_sets(ctx->out, "RESPCODE", RESP_OK);
tx_buf_sets(ctx->out, "KEY", key);
tx_buf_setlong(ctx->out, "DAYSUM", daysum);
tx_log(TX_LOG_INFO, "[LG_OL_0002] 완료 key=%s 당일합계=%ld", key, daysum);
tx_buf_setlong(ctx->out, "DAYCNT", daycnt);
tx_log(TX_LOG_INFO, "[LG_OL_0002] 완료 key=%s 당일합계=%ld 당일건수=%ld",
key, daysum, daycnt);
tx_return(ctx, TX_OK, ctx->out);
}