다양화 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
|
|
@ -10,13 +10,15 @@
|
|||
/*
|
||||
* lg_ol_0002.pgc - 원장 온라인 서비스 (LG_OL_0002) [tier=hard]
|
||||
*
|
||||
* TxCore TX_SERVICE 엔트리. 요청 TXBUF 를 검증하고 lg 표준 DBIO 를
|
||||
* 통해 처리한 뒤 응답 TXBUF 를 구성한다. (ATMI void SVC(TPSVCINFO*) 대응)
|
||||
* TxCore TX_SERVICE 엔트리. 요청 TXBUF 를 검증하고 lg 표준 DBIO 로
|
||||
* 원장 반영 → 후속 서비스 연계 → 커밋의 오케스트레이션을 수행한다.
|
||||
* 당일 합계/건수는 원장(lg_ledger) 임베디드 집계로 교차검증한다.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "txcore.h"
|
||||
#include "txcore_dbio.h"
|
||||
#include "acq_util.h"
|
||||
#include "lg_core.h"
|
||||
|
||||
|
|
@ -89,14 +91,35 @@ struct sqlca_t *ECPGget_sqlca(void);
|
|||
|
||||
#endif
|
||||
|
||||
#line 15 "app/online/lg_ol_0002.pgc"
|
||||
#line 17 "app/online/lg_ol_0002.pgc"
|
||||
|
||||
|
||||
TX_SERVICE(LG_OL_0002, ctx)
|
||||
{
|
||||
/* exec sql begin declare section */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#line 22 "app/online/lg_ol_0002.pgc"
|
||||
char h_merch [ 16 ] ;
|
||||
|
||||
#line 23 "app/online/lg_ol_0002.pgc"
|
||||
char h_bizdate [ 9 ] ;
|
||||
|
||||
#line 24 "app/online/lg_ol_0002.pgc"
|
||||
long h_daysum ;
|
||||
|
||||
#line 25 "app/online/lg_ol_0002.pgc"
|
||||
long h_daycnt ;
|
||||
/* exec sql end declare section */
|
||||
#line 26 "app/online/lg_ol_0002.pgc"
|
||||
|
||||
|
||||
lg_rec_t rec;
|
||||
char key[16], merch[16], bizdate[16], nextbiz[9];
|
||||
long amount = 0, daysum = 0;
|
||||
long amount = 0, daysum = 0, daycnt = 0;
|
||||
int rc;
|
||||
TXBUF *sub_in;
|
||||
TXBUF *sub_out;
|
||||
|
|
@ -161,9 +184,28 @@ TX_SERVICE(LG_OL_0002, ctx)
|
|||
tx_buf_free(sub_in);
|
||||
tx_buf_free(sub_out);
|
||||
|
||||
/* 교차 검증: 당일 합계 재계산 */
|
||||
if (lg_rec_sum(bizdate, &daysum) != TX_OK)
|
||||
daysum = 0;
|
||||
/* 교차 검증: 당일 합계/건수 임베디드 재집계 */
|
||||
strncpy(h_merch, merch, sizeof(h_merch) - 1); h_merch[sizeof(h_merch) - 1] = '\0';
|
||||
strncpy(h_bizdate, bizdate, sizeof(h_bizdate) - 1); h_bizdate[sizeof(h_bizdate) - 1] = '\0';
|
||||
h_daysum = 0;
|
||||
h_daycnt = 0;
|
||||
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select coalesce ( sum ( amount ) , 0 ) , count ( * ) from lg_ledger where merch_id = $1 and biz_date = $2 ",
|
||||
ECPGt_char,(h_merch),(long)16,(long)1,(16)*sizeof(char),
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
|
||||
ECPGt_char,(h_bizdate),(long)9,(long)1,(9)*sizeof(char),
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
|
||||
ECPGt_long,&(h_daysum),(long)1,(long)1,sizeof(long),
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
|
||||
ECPGt_long,&(h_daycnt),(long)1,(long)1,sizeof(long),
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
|
||||
#line 104 "app/online/lg_ol_0002.pgc"
|
||||
|
||||
if (sqlca.sqlcode == TX_SQL_OK) {
|
||||
daysum = h_daysum;
|
||||
daycnt = h_daycnt;
|
||||
} else if (sqlca.sqlcode != TX_SQL_NOTFOUND) {
|
||||
TX_DBIO_LOG_ERR("SELECT lg_ledger 당일집계");
|
||||
}
|
||||
|
||||
tx_commit();
|
||||
|
||||
|
|
@ -171,6 +213,8 @@ TX_SERVICE(LG_OL_0002, ctx)
|
|||
tx_buf_sets(ctx->out, "RESPCODE", RESP_OK);
|
||||
tx_buf_sets(ctx->out, "KEY", key);
|
||||
tx_buf_setlong(ctx->out, "DAYSUM", daysum);
|
||||
tx_log(TX_LOG_INFO, "[LG_OL_0002] 완료 key=%s 당일합계=%ld", key, daysum);
|
||||
tx_buf_setlong(ctx->out, "DAYCNT", daycnt);
|
||||
tx_log(TX_LOG_INFO, "[LG_OL_0002] 완료 key=%s 당일합계=%ld 당일건수=%ld",
|
||||
key, daysum, daycnt);
|
||||
tx_return(ctx, TX_OK, ctx->out);
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue