다양화: 530개 online/batch 프로그램을 모듈별 고유 실업무 로직으로 재작성

- 템플릿 클론(정규화 후 0줄 상이) → 전 코퍼스 530/530 고유 바디
- 11개 모듈(mg/au/ac/rc/vl/st/py/lg/mm/cm/cl) 각 파일이 distinct한
  매입·대사·정산·수수료·지급·원장·마감·마스터·정합성·전문게이트웨이·공통 업무
- TxCore(ATMI 유사) + ECPG(EXEC SQL) 관용구, 프레임워크/헤더/DBIO API/파일ID·경로 유지
- 전체 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 01:37:54 +00:00
parent b96cf702ee
commit c3a0259e95
1027 changed files with 68915 additions and 40962 deletions

View file

@ -6,12 +6,12 @@
/* End of automatic include section */
#line 1 "app/online/mg_ol_0011.pgc"
/* @tier easy @module mg @transform msg-gateway-online */
/* @tier medium @module mg @transform msg-gateway-online */
/*
* mg_ol_0011.pgc - (MG_OL_0011) [tier=easy]
* mg_ol_0011.pgc - ISO8583식 (MG_OL_0011) [tier=medium]
*
* TxCore TX_SERVICE . TXBUF mg DBIO
* TXBUF . (ATMI void SVC(TPSVCINFO*) )
* primary bitmap(16 hex = 64bit) present
* , / .
*/
#include <stdio.h>
#include <string.h>
@ -94,32 +94,57 @@ struct sqlca_t *ECPGget_sqlca(void);
TX_SERVICE(MG_OL_0011, ctx)
{
mg_rec_t rec;
char key[16];
int rc;
char bitmap[24];
char present[160];
char hexbuf[8];
int i, nib, bit, fieldno, cnt = 0;
int secondary = 0;
tx_log(TX_LOG_INFO, "[MG_OL_0011] 전문게이트웨이 단건조회 서비스 진입");
tx_log(TX_LOG_INFO, "[MG_OL_0011] ISO8583 비트맵 파싱 진입");
if (tx_buf_get(ctx->in, "KEY", key, sizeof(key)) != TX_OK) {
tx_log(TX_LOG_ERROR, "[MG_OL_0011] KEY 누락");
if (tx_buf_get(ctx->in, "BITMAP", bitmap, sizeof(bitmap)) != TX_OK) {
tx_log(TX_LOG_ERROR, "[MG_OL_0011] BITMAP 누락");
tx_return(ctx, TX_EINVAL, ctx->out);
return;
}
memset(&rec, 0, sizeof(rec));
rc = mg_rec_select(key, &rec);
if (rc != TX_OK) {
tx_log(TX_LOG_WARN, "[MG_OL_0011] 조회 실패 key=%s rc=%d(%s)",
key, rc, tx_strerror(rc));
tx_return(ctx, rc, ctx->out);
if (strlen(bitmap) < 16) {
tx_log(TX_LOG_WARN, "[MG_OL_0011] 비트맵 길이부족 len=%d", (int)strlen(bitmap));
tx_return(ctx, TX_EINVAL, ctx->out);
return;
}
present[0] = '\0';
/* 16 hex 문자 -> 64 bit, MSB = 필드1 */
for (i = 0; i < 16; i++) {
char c = bitmap[i];
if (c >= '0' && c <= '9') nib = c - '0';
else if (c >= 'A' && c <= 'F') nib = c - 'A' + 10;
else if (c >= 'a' && c <= 'f') nib = c - 'a' + 10;
else {
tx_log(TX_LOG_WARN, "[MG_OL_0011] 비16진 문자 pos=%d", i);
tx_return(ctx, TX_EINVAL, ctx->out);
return;
}
for (bit = 0; bit < 4; bit++) {
if (nib & (1 << (3 - bit))) {
fieldno = i * 4 + bit + 1;
if (fieldno == 1)
secondary = 1; /* 필드1 온 = secondary bitmap 존재 */
snprintf(hexbuf, sizeof(hexbuf), "%d ", fieldno);
if (strlen(present) + strlen(hexbuf) < sizeof(present))
strcat(present, hexbuf);
cnt++;
}
}
}
tx_buf_reset(ctx->out);
tx_buf_sets(ctx->out, "KEY", rec.key);
tx_buf_sets(ctx->out, "MERCHID", rec.merch_id);
tx_buf_setlong(ctx->out, "AMOUNT", rec.amount);
tx_buf_sets(ctx->out, "STATUS", rec.status);
tx_log(TX_LOG_INFO, "[MG_OL_0011] 조회완료 key=%s amount=%ld", key, rec.amount);
tx_buf_sets(ctx->out, "FIELDS", present);
tx_buf_setlong(ctx->out, "COUNT", (long)cnt);
tx_buf_setlong(ctx->out, "SECONDARY", (long)secondary);
tx_log(TX_LOG_INFO, "[MG_OL_0011] 파싱완료 present=%d secondary=%d", cnt, secondary);
tx_return(ctx, TX_OK, ctx->out);
}