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

@ -8,10 +8,11 @@
#line 1 "app/online/cm_ol_0028.pgc"
/* @tier easy @module cm @transform common-online */
/*
* cm_ol_0028.pgc - (CM_OL_0028) [tier=easy]
* cm_ol_0028.pgc - (CM_OL_0028) [tier=easy]
*
* TxCore TX_SERVICE . TXBUF cm DBIO
* TXBUF . (ATMI void SVC(TPSVCINFO*) )
* (HHMMSS 6) HH:MM:SS
* ( 0~23, / 0~59) .
* DB . (ATMI void SVC(TPSVCINFO*) )
*/
#include <stdio.h>
#include <string.h>
@ -89,37 +90,58 @@ struct sqlca_t *ECPGget_sqlca(void);
#endif
#line 15 "app/online/cm_ol_0028.pgc"
#line 16 "app/online/cm_ol_0028.pgc"
TX_SERVICE(CM_OL_0028, ctx)
{
cm_rec_t rec;
char key[16];
int rc;
char hms[16];
char formatted[16];
int hh;
int mm;
int ss;
int i;
long secs;
tx_log(TX_LOG_INFO, "[CM_OL_0028] 공통 단건조회 서비스 진입");
tx_log(TX_LOG_INFO, "[CM_OL_0028] 시간 포맷 변환 서비스 진입");
if (tx_buf_get(ctx->in, "KEY", key, sizeof(key)) != TX_OK) {
tx_log(TX_LOG_ERROR, "[CM_OL_0028] KEY 누락");
if (tx_buf_get(ctx->in, "HMS", hms, sizeof(hms)) != TX_OK) {
tx_log(TX_LOG_ERROR, "[CM_OL_0028] HMS 누락");
tx_return(ctx, TX_EINVAL, ctx->out);
return;
}
memset(&rec, 0, sizeof(rec));
rc = cm_rec_select(key, &rec);
if (rc != TX_OK) {
tx_log(TX_LOG_WARN, "[CM_OL_0028] 조회 실패 key=%s rc=%d(%s)",
key, rc, tx_strerror(rc));
tx_return(ctx, rc, ctx->out);
/* 정확히 6자리 숫자여야 한다 */
if (strlen(hms) != 6) {
tx_log(TX_LOG_WARN, "[CM_OL_0028] 길이 오류 hms=%s", hms);
tx_return(ctx, TX_EINVAL, ctx->out);
return;
}
for (i = 0; i < 6; i++) {
if (hms[i] < '0' || hms[i] > '9') {
tx_log(TX_LOG_WARN, "[CM_OL_0028] 숫자 아님 hms=%s", hms);
tx_return(ctx, TX_EINVAL, ctx->out);
return;
}
}
hh = (hms[0] - '0') * 10 + (hms[1] - '0');
mm = (hms[2] - '0') * 10 + (hms[3] - '0');
ss = (hms[4] - '0') * 10 + (hms[5] - '0');
if (hh > 23 || mm > 59 || ss > 59) {
tx_log(TX_LOG_WARN, "[CM_OL_0028] 시간 범위 오류 %02d:%02d:%02d", hh, mm, ss);
tx_return(ctx, TX_EINVAL, ctx->out);
return;
}
sprintf(formatted, "%02d:%02d:%02d", hh, mm, ss);
secs = (long)hh * 3600 + (long)mm * 60 + ss;
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, "[CM_OL_0028] 조회완료 key=%s amount=%ld", key, rec.amount);
tx_buf_sets(ctx->out, "HMS", hms);
tx_buf_sets(ctx->out, "FORMATTED", formatted);
tx_buf_setlong(ctx->out, "SECONDS", secs);
tx_log(TX_LOG_INFO, "[CM_OL_0028] 변환완료 %s -> %s (%ld초)", hms, formatted, secs);
tx_return(ctx, TX_OK, ctx->out);
}