다양화 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:
parent
c3a0259e95
commit
93c3cb74af
1111 changed files with 31539 additions and 17258 deletions
|
|
@ -12,13 +12,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"
|
||||
|
||||
|
|
@ -91,7 +92,7 @@ struct sqlca_t *ECPGget_sqlca(void);
|
|||
|
||||
#endif
|
||||
|
||||
#line 17 "app/online/cm_ol_0020.pgc"
|
||||
#line 18 "app/online/cm_ol_0020.pgc"
|
||||
|
||||
|
||||
/* 0~9999 한 절(節)을 천/백/십 단위 한글로 변환하여 out 에 누적 */
|
||||
|
|
@ -122,12 +123,26 @@ 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 */
|
||||
|
||||
|
||||
|
||||
#line 50 "app/online/cm_ol_0020.pgc"
|
||||
long h_amount ;
|
||||
|
||||
#line 51 "app/online/cm_ol_0020.pgc"
|
||||
char h_hangeul [ 128 ] ;
|
||||
/* exec sql end declare section */
|
||||
#line 52 "app/online/cm_ol_0020.pgc"
|
||||
|
||||
|
||||
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;
|
||||
|
||||
|
|
@ -170,10 +185,36 @@ 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 {
|
||||
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into cm_amt_hangeul_log ( amount , hangeul_txt , conv_ts ) values ( $1 , $2 , now ( ) )",
|
||||
ECPGt_long,&(h_amount),(long)1,(long)1,sizeof(long),
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
|
||||
ECPGt_char,(h_hangeul),(long)128,(long)1,(128)*sizeof(char),
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);}
|
||||
#line 112 "app/online/cm_ol_0020.pgc"
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue