다양화: 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,23 @@
#line 1 "app/online/rc_ol_0021.pgc"
/* @tier easy @module rc @transform reconciliation-online */
/*
* rc_ol_0021.pgc - (RC_OL_0021) [tier=easy]
* rc_ol_0021.pgc - diff (RC_OL_0021)
*
* TxCore TX_SERVICE . TXBUF rc DBIO
* TXBUF . (ATMI void SVC(TPSVCINFO*) )
* 1 .
*
* []
* KEY - (/ )
* APPRAMT - ()
* EXPFEE - ()
*
* []
* AMTDIFF = amount - APPRAMT ( )
* FEEDIFF = fee - EXPFEE ( )
* RESULT = "OK" ( 0)
* = "DIFF" ( 0 )
*
* ,
* (read-only) . .
*/
#include <stdio.h>
#include <string.h>
@ -89,37 +102,97 @@ struct sqlca_t *ECPGget_sqlca(void);
#endif
#line 15 "app/online/rc_ol_0021.pgc"
#line 28 "app/online/rc_ol_0021.pgc"
TX_SERVICE(RC_OL_0021, ctx)
{
rc_rec_t rec;
char key[16];
long appr_amt = 0;
long exp_fee = 0;
long amt_diff, fee_diff;
int rc;
const char *result;
tx_log(TX_LOG_INFO, "[RC_OL_0021] 대사 단건조회 서비스 진입");
tx_log(TX_LOG_INFO, "[RC_OL_0021] 대사 diff 리포트 조회 서비스 진입");
if (tx_buf_get(ctx->in, "KEY", key, sizeof(key)) != TX_OK) {
tx_log(TX_LOG_ERROR, "[RC_OL_0021] KEY 누락");
tx_return(ctx, TX_EINVAL, ctx->out);
return;
}
if (tx_buf_getlong(ctx->in, "APPRAMT", &appr_amt) != TX_OK) {
tx_log(TX_LOG_ERROR, "[RC_OL_0021] APPRAMT(승인금액) 누락");
tx_return(ctx, TX_EINVAL, ctx->out);
return;
}
if (tx_buf_getlong(ctx->in, "EXPFEE", &exp_fee) != TX_OK) {
tx_log(TX_LOG_ERROR, "[RC_OL_0021] EXPFEE(예상 수수료) 누락");
tx_return(ctx, TX_EINVAL, ctx->out);
return;
}
/* 승인금액/예상수수료는 음수가 될 수 없다 */
if (appr_amt < 0 || exp_fee < 0) {
tx_log(TX_LOG_WARN,
"[RC_OL_0021] 입력값 음수 오류 key=%s appramt=%ld expfee=%ld",
key, appr_amt, exp_fee);
tx_return(ctx, TX_EINVAL, ctx->out);
return;
}
tx_log(TX_LOG_INFO,
"[RC_OL_0021] 대사 diff 입력 key=%s 승인금액=%ld 예상수수료=%ld",
key, appr_amt, exp_fee);
memset(&rec, 0, sizeof(rec));
rc = rc_rec_select(key, &rec);
if (rc != TX_OK) {
tx_log(TX_LOG_WARN, "[RC_OL_0021] 조회 실패 key=%s rc=%d(%s)",
tx_log(TX_LOG_WARN, "[RC_OL_0021] 원장 조회 실패 key=%s rc=%d(%s)",
key, rc, tx_strerror(rc));
tx_return(ctx, rc, ctx->out);
return;
}
tx_log(TX_LOG_INFO,
"[RC_OL_0021] 대상 조회 key=%s 매입액=%ld 수수료=%ld 상태=%s",
key, rec.amount, rec.fee, rec.status);
/* 차이 산출 (원장 무변경) */
amt_diff = rec.amount - appr_amt;
fee_diff = rec.fee - exp_fee;
if (amt_diff == 0 && fee_diff == 0) {
result = "OK";
tx_log(TX_LOG_INFO, "[RC_OL_0021] 차이없음 key=%s", key);
} else {
result = "DIFF";
/* 차이 유형 세분화 로그: 금액/수수료 어느 항목이 어긋났는지 기록 */
if (amt_diff != 0 && fee_diff != 0)
tx_log(TX_LOG_WARN,
"[RC_OL_0021] 금액+수수료 동시 불일치 key=%s 금액차=%ld 수수료차=%ld",
key, amt_diff, fee_diff);
else if (amt_diff != 0)
tx_log(TX_LOG_WARN,
"[RC_OL_0021] 금액 불일치 key=%s 금액차=%ld", key, amt_diff);
else
tx_log(TX_LOG_WARN,
"[RC_OL_0021] 수수료 불일치 key=%s 수수료차=%ld", key, fee_diff);
}
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, "[RC_OL_0021] 조회완료 key=%s amount=%ld", key, rec.amount);
tx_buf_setlong(ctx->out, "APPRAMT", appr_amt);
tx_buf_setlong(ctx->out, "AMTDIFF", amt_diff);
tx_buf_setlong(ctx->out, "FEE", rec.fee);
tx_buf_setlong(ctx->out, "EXPFEE", exp_fee);
tx_buf_setlong(ctx->out, "FEEDIFF", fee_diff);
tx_buf_sets(ctx->out, "RESULT", result);
tx_log(TX_LOG_INFO,
"[RC_OL_0021] 리포트완료 key=%s 결과=%s 금액차=%ld 수수료차=%ld",
key, result, amt_diff, fee_diff);
tx_return(ctx, TX_OK, ctx->out);
}