다양화: 530개 online/batch 프로그램을 모듈별 고유 실업무 로직으로 재작성
- 템플릿 클론(정규화 후 0줄 상이) → 전 코퍼스 530/530 고유 바디 - 11개 모듈(mg/au/ac/rc/vl/st/py/lg/mm/cm/cl) 각 파일이 distinct한 매입·대사·정산·수수료·지급·원장·마감·마스터·정합성·전문게이트웨이·공통 업무 - TxCore(ATMI 유사) + ECPG(EXEC SQL) 관용구, 프레임워크/헤더/DBIO API/파일ID·경로 유지 - 전체 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
b96cf702ee
commit
c3a0259e95
1027 changed files with 68915 additions and 40962 deletions
|
|
@ -8,15 +8,18 @@
|
|||
#line 1 "app/online/mm_ol_0024.pgc"
|
||||
/* @tier easy @module mm @transform master-online */
|
||||
/*
|
||||
* mm_ol_0024.pgc - 마스터 온라인 서비스 (MM_OL_0024) [tier=easy]
|
||||
* mm_ol_0024.pgc - BIN 유효성조회 서비스 (MM_OL_0024) [tier=easy]
|
||||
*
|
||||
* TxCore TX_SERVICE 엔트리. 요청 TXBUF 를 검증하고 mm 표준 DBIO 를
|
||||
* 통해 처리한 뒤 응답 TXBUF 를 구성한다. (ATMI void SVC(TPSVCINFO*) 대응)
|
||||
* 카드 앞 6자리 BIN 이 마스터(mm_card_bin)에 존재하고, 매핑된 카드사
|
||||
* (mm_issuer)가 사용중(use_yn='Y')인지 조인 조회로 검증한다. 카드사코드/
|
||||
* 카드사명/카드종류를 응답한다. 조회 전용(읽기) 서비스. (마스터 참조)
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "txcore.h"
|
||||
#include "txcore_dbio.h"
|
||||
#include "acq_util.h"
|
||||
#include "mm_core.h"
|
||||
|
||||
|
|
@ -89,37 +92,125 @@ struct sqlca_t *ECPGget_sqlca(void);
|
|||
|
||||
#endif
|
||||
|
||||
#line 15 "app/online/mm_ol_0024.pgc"
|
||||
#line 18 "app/online/mm_ol_0024.pgc"
|
||||
|
||||
|
||||
TX_SERVICE(MM_OL_0024, ctx)
|
||||
{
|
||||
mm_rec_t rec;
|
||||
char key[16];
|
||||
int rc;
|
||||
/* exec sql begin declare section */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#line 23 "app/online/mm_ol_0024.pgc"
|
||||
char h_bin [ 8 ] ;
|
||||
|
||||
#line 24 "app/online/mm_ol_0024.pgc"
|
||||
char h_issuer_cd [ 4 ] ;
|
||||
|
||||
#line 25 "app/online/mm_ol_0024.pgc"
|
||||
char h_issuer_nm [ 32 ] ;
|
||||
|
||||
#line 26 "app/online/mm_ol_0024.pgc"
|
||||
char h_card_type [ 2 ] ;
|
||||
|
||||
#line 27 "app/online/mm_ol_0024.pgc"
|
||||
char h_use_yn [ 2 ] ;
|
||||
/* exec sql end declare section */
|
||||
#line 28 "app/online/mm_ol_0024.pgc"
|
||||
|
||||
tx_log(TX_LOG_INFO, "[MM_OL_0024] 마스터 단건조회 서비스 진입");
|
||||
|
||||
if (tx_buf_get(ctx->in, "KEY", key, sizeof(key)) != TX_OK) {
|
||||
tx_log(TX_LOG_ERROR, "[MM_OL_0024] KEY 누락");
|
||||
char bin[8];
|
||||
char card_type_nm[16];
|
||||
int i;
|
||||
|
||||
tx_log(TX_LOG_INFO, "[MM_OL_0024] BIN 유효성조회 서비스 진입");
|
||||
|
||||
if (tx_buf_get(ctx->in, "BIN", bin, sizeof(bin)) != TX_OK) {
|
||||
tx_log(TX_LOG_ERROR, "[MM_OL_0024] BIN 누락");
|
||||
tx_buf_sets(ctx->out, "ERRCODE", "MM2400");
|
||||
tx_return(ctx, TX_EINVAL, ctx->out);
|
||||
return;
|
||||
}
|
||||
|
||||
memset(&rec, 0, sizeof(rec));
|
||||
rc = mm_rec_select(key, &rec);
|
||||
if (rc != TX_OK) {
|
||||
tx_log(TX_LOG_WARN, "[MM_OL_0024] 조회 실패 key=%s rc=%d(%s)",
|
||||
key, rc, tx_strerror(rc));
|
||||
tx_return(ctx, rc, ctx->out);
|
||||
/* BIN 은 정확히 6자리 숫자여야 한다 */
|
||||
if (strlen(bin) != 6) {
|
||||
tx_log(TX_LOG_WARN, "[MM_OL_0024] BIN 길이 오류 bin=%s", bin);
|
||||
tx_buf_sets(ctx->out, "ERRCODE", "MM2401");
|
||||
tx_return(ctx, TX_EINVAL, ctx->out);
|
||||
return;
|
||||
}
|
||||
for (i = 0; i < 6; i++) {
|
||||
if (bin[i] < '0' || bin[i] > '9') {
|
||||
tx_log(TX_LOG_WARN, "[MM_OL_0024] BIN 숫자 아님 bin=%s", bin);
|
||||
tx_buf_sets(ctx->out, "ERRCODE", "MM2401");
|
||||
tx_return(ctx, TX_EINVAL, ctx->out);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
strncpy(h_bin, bin, sizeof(h_bin) - 1);
|
||||
h_bin[sizeof(h_bin) - 1] = '\0';
|
||||
|
||||
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select i . issuer_cd , i . issuer_nm , b . card_type , i . use_yn from mm_card_bin b join mm_issuer i on i . issuer_cd = b . issuer_cd where b . bin = $1 ",
|
||||
ECPGt_char,(h_bin),(long)8,(long)1,(8)*sizeof(char),
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
|
||||
ECPGt_char,(h_issuer_cd),(long)4,(long)1,(4)*sizeof(char),
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
|
||||
ECPGt_char,(h_issuer_nm),(long)32,(long)1,(32)*sizeof(char),
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
|
||||
ECPGt_char,(h_card_type),(long)2,(long)1,(2)*sizeof(char),
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
|
||||
ECPGt_char,(h_use_yn),(long)2,(long)1,(2)*sizeof(char),
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
|
||||
#line 67 "app/online/mm_ol_0024.pgc"
|
||||
|
||||
|
||||
if (sqlca.sqlcode == TX_SQL_NOTFOUND) {
|
||||
tx_log(TX_LOG_WARN, "[MM_OL_0024] 미등록 BIN bin=%s", bin);
|
||||
tx_buf_reset(ctx->out);
|
||||
tx_buf_sets(ctx->out, "VALIDYN", "N");
|
||||
tx_buf_sets(ctx->out, "ERRCODE", "MM2402");
|
||||
tx_return(ctx, TX_ENOENT, ctx->out);
|
||||
return;
|
||||
}
|
||||
if (sqlca.sqlcode != TX_SQL_OK) {
|
||||
TX_DBIO_LOG_ERR("SELECT mm_card_bin JOIN mm_issuer");
|
||||
tx_buf_sets(ctx->out, "ERRCODE", "MM2409");
|
||||
tx_return(ctx, TX_EDB, ctx->out);
|
||||
return;
|
||||
}
|
||||
|
||||
/* 카드사가 사용중지면 무효 처리 */
|
||||
if (strcmp(h_use_yn, "Y") != 0) {
|
||||
tx_log(TX_LOG_WARN, "[MM_OL_0024] 사용중지 카드사 bin=%s issuer=%s",
|
||||
bin, h_issuer_cd);
|
||||
tx_buf_reset(ctx->out);
|
||||
tx_buf_sets(ctx->out, "VALIDYN", "N");
|
||||
tx_buf_sets(ctx->out, "ISSUERCD", h_issuer_cd);
|
||||
tx_buf_sets(ctx->out, "ERRCODE", "MM2403");
|
||||
tx_return(ctx, TX_FAIL, ctx->out);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcmp(h_card_type, "C") == 0)
|
||||
strncpy(card_type_nm, "신용", sizeof(card_type_nm) - 1);
|
||||
else if (strcmp(h_card_type, "D") == 0)
|
||||
strncpy(card_type_nm, "체크", sizeof(card_type_nm) - 1);
|
||||
else
|
||||
strncpy(card_type_nm, "기타", sizeof(card_type_nm) - 1);
|
||||
|
||||
tx_buf_reset(ctx->out);
|
||||
tx_buf_sets(ctx->out, "KEY", rec.key);
|
||||
tx_buf_sets(ctx->out, "MERCHID", rec.merch_id);
|
||||
tx_buf_setlong(ctx->out, "AMOUNT", rec.amount);
|
||||
tx_buf_sets(ctx->out, "STATUS", rec.status);
|
||||
tx_log(TX_LOG_INFO, "[MM_OL_0024] 조회완료 key=%s amount=%ld", key, rec.amount);
|
||||
tx_buf_sets(ctx->out, "BIN", bin);
|
||||
tx_buf_sets(ctx->out, "VALIDYN", "Y");
|
||||
tx_buf_sets(ctx->out, "ISSUERCD", h_issuer_cd);
|
||||
tx_buf_sets(ctx->out, "ISSUERNM", h_issuer_nm);
|
||||
tx_buf_sets(ctx->out, "CARDTYPE", h_card_type);
|
||||
tx_buf_sets(ctx->out, "CARDTYPENM", card_type_nm);
|
||||
tx_buf_sets(ctx->out, "ERRCODE", RESP_OK);
|
||||
tx_log(TX_LOG_INFO, "[MM_OL_0024] BIN 유효 bin=%s issuer=%s(%s)",
|
||||
bin, h_issuer_cd, h_issuer_nm);
|
||||
tx_return(ctx, TX_OK, ctx->out);
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue