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

@ -12,13 +12,15 @@
*
* (AMOUNT) amount_format_won /
* , amount_is_valid
* . DB .
* . (cm_amt_policy)
* (max_amt) (OVERPOLICY=Y/N) .
* (ATMI void SVC(TPSVCINFO*) )
*/
#include <stdio.h>
#include <string.h>
#include "txcore.h"
#include "txcore_dbio.h"
#include "acq_util.h"
#include "cm_core.h"
@ -91,16 +93,30 @@ struct sqlca_t *ECPGget_sqlca(void);
#endif
#line 17 "app/online/cm_ol_0003.pgc"
#line 19 "app/online/cm_ol_0003.pgc"
TX_SERVICE(CM_OL_0003, ctx)
{
/* exec sql begin declare section */
#line 24 "app/online/cm_ol_0003.pgc"
char h_policy [ 16 ] ;
#line 25 "app/online/cm_ol_0003.pgc"
long h_max_amt ;
/* exec sql end declare section */
#line 26 "app/online/cm_ol_0003.pgc"
char amt_field[32];
char won_disp[48];
char plain_disp[32];
long amount = 0;
int valid;
int over_policy = 0;
tx_log(TX_LOG_INFO, "[CM_OL_0003] 금액 포맷 유틸 서비스 진입");
@ -123,6 +139,28 @@ TX_SERVICE(CM_OL_0003, ctx)
/* 유효범위를 벗어나도 표기 자체는 제공하되 VALID=N 으로 통지 */
}
/* 정책 상한 조회 (정책구분 PARAM 우선, 없으면 DEFAULT) */
if (tx_buf_get(ctx->in, "POLICY", h_policy, sizeof(h_policy)) != TX_OK)
strncpy(h_policy, "DEFAULT", sizeof(h_policy) - 1);
h_policy[sizeof(h_policy) - 1] = '\0';
h_max_amt = 0;
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select max_amt from cm_amt_policy where policy_cd = $1 and use_yn = 'Y'",
ECPGt_char,(h_policy),(long)16,(long)1,(16)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
ECPGt_long,&(h_max_amt),(long)1,(long)1,sizeof(long),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
#line 66 "app/online/cm_ol_0003.pgc"
if (sqlca.sqlcode == TX_SQL_NOTFOUND) {
tx_log(TX_LOG_INFO, "[CM_OL_0003] 정책 미등록 policy=%s (상한검증 생략)", h_policy);
} else if (sqlca.sqlcode != TX_SQL_OK) {
TX_DBIO_LOG_ERR("CM_OL_0003 SELECT cm_amt_policy");
} else if (h_max_amt > 0 && amount > h_max_amt) {
over_policy = 1;
}
amount_format_won(amount, won_disp, sizeof(won_disp));
if (amount_format(amount, plain_disp, sizeof(plain_disp)) != 0) {
strncpy(plain_disp, "0", sizeof(plain_disp) - 1);
@ -133,8 +171,10 @@ TX_SERVICE(CM_OL_0003, ctx)
tx_buf_sets(ctx->out, "WONDISP", won_disp);
tx_buf_sets(ctx->out, "PLAINDISP", plain_disp);
tx_buf_sets(ctx->out, "VALID", valid ? "Y" : "N");
tx_buf_setlong(ctx->out, "POLICYMAX", h_max_amt);
tx_buf_sets(ctx->out, "OVERPOLICY", over_policy ? "Y" : "N");
tx_log(TX_LOG_INFO, "[CM_OL_0003] 포맷완료 amount=%ld disp=%s valid=%s",
amount, won_disp, valid ? "Y" : "N");
tx_log(TX_LOG_INFO, "[CM_OL_0003] 포맷완료 amount=%ld disp=%s valid=%s over=%s",
amount, won_disp, valid ? "Y" : "N", over_policy ? "Y" : "N");
tx_return(ctx, valid ? TX_OK : TX_EINVAL, ctx->out);
}