다양화 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,15 @@
|
|||
*
|
||||
* 요청의 일자(DATE, YYYYMMDD)에 대해 date_weekday 로 요일 인덱스
|
||||
* (0=일 ~ 6=토)를 구하고 한글 요일명(일~토)으로 매핑하여 요일 인덱스/
|
||||
* 요일명/주말여부를 응답한다. 순수 로직 요일 산출 공통 서비스. DB 접근 없음.
|
||||
* 요일명/주말여부를 응답한다. 추가로 영업일 달력(cm_biz_calendar)을
|
||||
* 조회하여 해당일이 영업일(BIZDAY=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,7 +93,7 @@ struct sqlca_t *ECPGget_sqlca(void);
|
|||
|
||||
#endif
|
||||
|
||||
#line 17 "app/online/cm_ol_0019.pgc"
|
||||
#line 19 "app/online/cm_ol_0019.pgc"
|
||||
|
||||
|
||||
TX_SERVICE(CM_OL_0019, ctx)
|
||||
|
|
@ -99,10 +101,29 @@ TX_SERVICE(CM_OL_0019, ctx)
|
|||
static const char *WDAY_SHORT[7] = {
|
||||
"일", "월", "화", "수", "목", "금", "토"
|
||||
};
|
||||
|
||||
/* exec sql begin declare section */
|
||||
|
||||
|
||||
|
||||
|
||||
#line 28 "app/online/cm_ol_0019.pgc"
|
||||
char h_date [ 9 ] ;
|
||||
|
||||
#line 29 "app/online/cm_ol_0019.pgc"
|
||||
char h_biz_yn [ 2 ] ;
|
||||
|
||||
#line 30 "app/online/cm_ol_0019.pgc"
|
||||
char h_remark [ 64 ] ;
|
||||
/* exec sql end declare section */
|
||||
#line 31 "app/online/cm_ol_0019.pgc"
|
||||
|
||||
|
||||
char date[16];
|
||||
char label[8];
|
||||
int wd;
|
||||
int weekend;
|
||||
int biz_day;
|
||||
|
||||
tx_log(TX_LOG_INFO, "[CM_OL_0019] 요일 계산 서비스 진입");
|
||||
|
||||
|
|
@ -129,13 +150,38 @@ TX_SERVICE(CM_OL_0019, ctx)
|
|||
weekend = (wd == 0 || wd == 6) ? 1 : 0;
|
||||
snprintf(label, sizeof(label), "%s요일", WDAY_SHORT[wd]);
|
||||
|
||||
/* 영업일 달력 조회 : 등록이 있으면 그 값을 우선, 없으면 주말 반대로 */
|
||||
strncpy(h_date, date, sizeof(h_date) - 1);
|
||||
h_date[sizeof(h_date) - 1] = '\0';
|
||||
strncpy(h_biz_yn, weekend ? "N" : "Y", sizeof(h_biz_yn));
|
||||
h_remark[0] = '\0';
|
||||
|
||||
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select biz_yn , coalesce ( remark , '' ) from cm_biz_calendar where cal_date = $1 ",
|
||||
ECPGt_char,(h_date),(long)9,(long)1,(9)*sizeof(char),
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
|
||||
ECPGt_char,(h_biz_yn),(long)2,(long)1,(2)*sizeof(char),
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
|
||||
ECPGt_char,(h_remark),(long)64,(long)1,(64)*sizeof(char),
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
|
||||
#line 73 "app/online/cm_ol_0019.pgc"
|
||||
|
||||
|
||||
if (sqlca.sqlcode == TX_SQL_NOTFOUND) {
|
||||
tx_log(TX_LOG_DEBUG, "[CM_OL_0019] 달력 미등록 date=%s (요일기준 판정)", date);
|
||||
} else if (sqlca.sqlcode != TX_SQL_OK) {
|
||||
TX_DBIO_LOG_ERR("CM_OL_0019 SELECT cm_biz_calendar");
|
||||
}
|
||||
biz_day = (strcmp(h_biz_yn, "Y") == 0) ? 1 : 0;
|
||||
|
||||
tx_buf_reset(ctx->out);
|
||||
tx_buf_sets(ctx->out, "DATE", date);
|
||||
tx_buf_setlong(ctx->out, "WDAY", (long)wd);
|
||||
tx_buf_sets(ctx->out, "WDAYNM", WDAY_SHORT[wd]);
|
||||
tx_buf_sets(ctx->out, "WDAYLABEL", label);
|
||||
tx_buf_sets(ctx->out, "WEEKEND", weekend ? "Y" : "N");
|
||||
tx_log(TX_LOG_INFO, "[CM_OL_0019] 계산완료 date=%s 요일=%s 주말=%s",
|
||||
date, label, weekend ? "Y" : "N");
|
||||
tx_buf_sets(ctx->out, "BIZDAY", biz_day ? "Y" : "N");
|
||||
tx_buf_sets(ctx->out, "REMARK", h_remark);
|
||||
tx_log(TX_LOG_INFO, "[CM_OL_0019] 계산완료 date=%s 요일=%s 주말=%s 영업일=%s",
|
||||
date, label, weekend ? "Y" : "N", biz_day ? "Y" : "N");
|
||||
tx_return(ctx, TX_OK, ctx->out);
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue