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

@ -10,8 +10,34 @@
/*
* cl_ol_0015.pgc - (CL_OL_0015) [tier=easy]
*
* TxCore TX_SERVICE . TXBUF cl DBIO
* TXBUF . (ATMI void SVC(TPSVCINFO*) )
* . (KEY) DBIO cl_rec_select
* , // (status='S')
* . (read-only )
*
* (Contract)
* :
* KEY () (/ ) - PK
* :
* RESPCODE 0000= / 9001=· / 9999=
* KEY
* MERCHID
* BIZDATE (YYYYMMDD)
* AMOUNT (, )
* AMOUNTWON (: 12,300)
* STATUS (R/M/U/S)
* STATUSLABEL (///)
* CLOSED (Y= S / N= )
*
*
* R() M() S(/)
* U() M
* , .
*
*
* 1) TXBUF KEY
* 2) cl_rec_select ( RESP_INVALID)
* 3) status CL_ST_* /
* 4) TXBUF tx_return
*/
#include <stdio.h>
#include <string.h>
@ -89,37 +115,85 @@ struct sqlca_t *ECPGget_sqlca(void);
#endif
#line 15 "app/online/cl_ol_0015.pgc"
#line 41 "app/online/cl_ol_0015.pgc"
TX_SERVICE(CL_OL_0015, ctx)
{
cl_rec_t rec;
char key[16];
char won[40];
const char *st_label;
int is_settled;
int is_snap;
int rc;
tx_log(TX_LOG_INFO, "[CL_OL_0015] 마감 단건조회 서비스 진입");
tx_log(TX_LOG_INFO, "[CL_OL_0015] 마감 상태조회 서비스 진입");
/* 1. 요청 검증 : 처리키 필수 */
if (tx_buf_get(ctx->in, "KEY", key, sizeof(key)) != TX_OK) {
tx_log(TX_LOG_ERROR, "[CL_OL_0015] KEY 누락");
tx_buf_reset(ctx->out);
tx_buf_sets(ctx->out, "RESPCODE", RESP_INVALID);
tx_return(ctx, TX_EINVAL, ctx->out);
return;
}
/* 2. 단건 조회 (표준 DBIO) */
memset(&rec, 0, sizeof(rec));
rc = cl_rec_select(key, &rec);
if (rc == TX_ENOENT) {
tx_log(TX_LOG_WARN, "[CL_OL_0015] 원장 없음 key=%s", key);
tx_buf_reset(ctx->out);
tx_buf_sets(ctx->out, "RESPCODE", RESP_INVALID);
tx_buf_sets(ctx->out, "KEY", key);
tx_buf_sets(ctx->out, "MESSAGE", "해당 처리키 원장 없음");
tx_return(ctx, rc, ctx->out);
return;
}
if (rc != TX_OK) {
tx_log(TX_LOG_WARN, "[CL_OL_0015] 조회 실패 key=%s rc=%d(%s)",
tx_log(TX_LOG_ERROR, "[CL_OL_0015] 조회 오류 key=%s rc=%d(%s)",
key, rc, tx_strerror(rc));
tx_buf_reset(ctx->out);
tx_buf_sets(ctx->out, "RESPCODE", RESP_SYSERR);
tx_return(ctx, rc, ctx->out);
return;
}
/* 3. 마감여부 판정 : status='S' 이면 마감완료 */
is_settled = (strcmp(rec.status, CL_ST_SETTLED) == 0);
if (strcmp(rec.status, CL_ST_RECV) == 0) st_label = "접수";
else if (strcmp(rec.status, CL_ST_DONE) == 0) st_label = "처리완료";
else if (strcmp(rec.status, CL_ST_FAIL) == 0) st_label = "불일치";
else if (strcmp(rec.status, CL_ST_SETTLED) == 0) st_label = "정산완료";
else st_label = "미정의";
/* 4. 스냅샷 요약행 여부 판정 (merch_id='*SNAP' 규약) */
is_snap = (strcmp(rec.merch_id, "*SNAP") == 0);
/* 5. 응답 구성 */
amount_format_won(rec.amount, won, sizeof(won));
tx_buf_reset(ctx->out);
tx_buf_sets(ctx->out, "RESPCODE", RESP_OK);
tx_buf_sets(ctx->out, "KEY", rec.key);
tx_buf_sets(ctx->out, "MERCHID", rec.merch_id);
tx_buf_sets(ctx->out, "BIZDATE", rec.biz_date);
tx_buf_setlong(ctx->out, "AMOUNT", rec.amount);
tx_buf_sets(ctx->out, "AMOUNTWON", won);
tx_buf_setlong(ctx->out, "FEE", rec.fee);
tx_buf_sets(ctx->out, "STATUS", rec.status);
tx_log(TX_LOG_INFO, "[CL_OL_0015] 조회완료 key=%s amount=%ld", key, rec.amount);
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");
/* 6. 스냅샷 요약행은 집계행이므로 별도 안내 로깅 */
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");
tx_return(ctx, TX_OK, ctx->out);
}