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

@ -4,13 +4,14 @@
*
* 요청의 금액(AMOUNT)을 만/억/조 단위 절(節)로 분해하여 한글 금액표기
* (예: 123000000 -> "일억이천삼백만")로 변환하여 응답한다. 증서/전표
* 출력용 순수 로직 변환 서비스. DB 접근 없음.
* (ATMI void SVC(TPSVCINFO*) 대응)
* 출력용 변환 서비스. 변환 결과는 증서 발급 감사이력(cm_amt_hangeul_log)
* 에 적재하여 발급 근거로 남긴다. (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"
@ -44,12 +45,18 @@ static void hangeul_group(int val, char *out, int outlen)
TX_SERVICE(CM_OL_0020, ctx)
{
static const char *GUNIT[4] = { "", "만", "억", "조" };
EXEC SQL BEGIN DECLARE SECTION;
long h_amount;
char h_hangeul[128];
EXEC SQL END DECLARE SECTION;
char hangeul[128];
char won_fmt[48];
long amount = 0;
long n;
long logged = 0;
int neg = 0;
int g;
int groups[4];
int i;
@ -92,10 +99,32 @@ TX_SERVICE(CM_OL_0020, ctx)
/* 교차표시용: 콤마 구분 숫자표기 */
amount_format_won(amount, won_fmt, sizeof(won_fmt));
/* 변환 결과 증서 감사이력 적재 */
h_amount = amount;
strncpy(h_hangeul, hangeul, sizeof(h_hangeul) - 1);
h_hangeul[sizeof(h_hangeul) - 1] = '\0';
if (tx_begin() != TX_OK) {
tx_log(TX_LOG_WARN, "[CM_OL_0020] tx_begin 경고");
} else {
EXEC SQL INSERT INTO cm_amt_hangeul_log
(amount, hangeul_txt, conv_ts)
VALUES (:h_amount, :h_hangeul, now());
if (sqlca.sqlcode != TX_SQL_OK) {
TX_DBIO_LOG_ERR("CM_OL_0020 INSERT cm_amt_hangeul_log");
tx_abort();
} else {
logged = (long)sqlca.sqlerrd[2];
tx_commit();
}
}
tx_buf_reset(ctx->out);
tx_buf_setlong(ctx->out, "AMOUNT", amount);
tx_buf_sets(ctx->out, "HANGEUL", hangeul);
tx_buf_sets(ctx->out, "WON", won_fmt);
tx_buf_setlong(ctx->out, "LOGGED", logged);
tx_log(TX_LOG_INFO, "[CM_OL_0020] 변환완료 amount=%ld -> %s", amount, hangeul);
tx_return(ctx, TX_OK, ctx->out);
}