📄 cmsregtx.sqc
字号:
/******************************************************* ** 源码文件名称 : cmsregtx.SQC ** 所属子系统 : 卡管理 ** 功能描述 : 记卡交易登记簿 ** 当前文件版本 : 4.0.0.0 ** 作 者 : guoyun ** 版本创建日期 : 2004/09/15 ** 修改记录 : ** 修改人 修改日期 修改位置*******************************************************/#include "sysdefine.h"#include "code.h"#include "attrdef.h"#include "pubcom.h"#include "cmscode.h"#include "cmstxconf.h"EXEC SQL INCLUDE SQLCA;/******************************************************* ** 函数名称:cmsApiRegCmsTxDet ** 功能描述:登记卡交易登记簿 ** 输入参数: ** pcTxId ---- 标识号 ** pstPubCom ---- 公共PUBCOM ** 输出参数: ** 无 ** 返回结果:int ** 0 ---- 成功 ** -1 ---- 失败*******************************************************/int cmsApiRegCmsTxDet( pcTxId, pstPubCom )char * pcTxId; /* 标识号 */struct pubcom * pstPubCom; /* 公共PUBCOM */{ /* 定义 局部变量 */ int iRtn; /* 函数返回值 */ char acBuf[CONDITION_LEN]; /* 临时存储区 */ char acBuf1[CONDITION_LEN]; /* 临时存储区 */ char acInsertBuf[RECBUF_LEN];/* 临时存储区 */ char acValueBuf[RECBUF_LEN]; /* 临时存储区 */ char acFieldType[CONDITION_LEN]; /* 临时存储区 */ struct cmstxconf stCmsTxConf; /* 卡交易登记簿配置表 */ int iBuf=0; long lBuf=0; double dBuf=0.00; EXEC SQL BEGIN DECLARE SECTION; char s_acPrepValue[RECBUF_LEN]; EXEC SQL END DECLARE SECTION; strcpy( g_acTrcMsg, "函数: 登记卡交易登记簿开始.." ); TRCLOG2 sprintf( g_acTrcMsg, "入口参数:标识号[%s],pstPubCom[%.*s]",pcTxId, (char *)pstPubCom ); TRCLOG2 memset(acInsertBuf, 0, sizeof(acInsertBuf)); sprintf(acInsertBuf, "insert into cmstxdet (trandate,serseqno,teller,brc,devdate,devtime,devstan,devno,trancode,ccy,trandevtype,devid"); memset(acValueBuf, 0, sizeof(acValueBuf)); sprintf(acValueBuf, " values('%s',%ld,'%s','%s','%s','%s',%06ld,'%s','%s','%s','%s','%s'", pstPubCom->acTranDate, pstPubCom->lSerSeqNo, pstPubCom->acTeller,pstPubCom->acBrc, pstPubCom->acTermDate, pstPubCom->acTermTime, pstPubCom->lTermSeq, pstPubCom->acFrntNo, pstPubCom->acTranCode, pstPubCom->acPosCcy, pstPubCom->acChannelId, pstPubCom->acTermCode); memset((char *)&stCmsTxConf, 0, sizeof(stCmsTxConf)); strcpy(stCmsTxConf.txid, pcTxId); pubStoVCmstxconf( &stCmsTxConf ); EXEC SQL DECLARE TxConf_l_cur CURSOR FOR SELECT * FROM CMSTXCONF WHERE txid = :cmstxconf_txid ORDER BY seqno; /* 定义游标错误 if ( SQLCODE ) { strcpy( g_acRspCode, "CMS110" ); pubCrtRspInfo( "cmstxconf", SQLCODE ); ERRLOG return FAILED; } */ SQLOPENCUR(TxConf_l_cur,"TxConf_l_cur") /* 打开游标错误 */ if ( SQLCODE ) { strcpy( g_acRspCode, "CMS111" ); pubCrtRspInfo( "cmstxconf", SQLCODE ); ERRLOG return FAILED; } while( 1 ) { pubInitCmstxconf(); EXEC SQL FETCH TxConf_l_cur INTO R_CMSTXCONF ; /* 取游标错误 */ if ( SQLCODE && SQLCODE != SQLNOTFOUND ) { strcpy( g_acRspCode, "CMS112" ); pubCrtRspInfo( "cmstxconf", SQLCODE ); ERRLOG SQLCLOSECUR(TxConf_l_cur,"TxConf_l_cur") return FAILED; } /* 记录不存在 */ else if ( SQLCODE == SQLNOTFOUND ) { SQLCLOSECUR(TxConf_l_cur,"TxConf_l_cur") break; } pubVtoSCmsseqm( &stCmsTxConf ); memset(acFieldType, 0, sizeof(acFieldType)); if (stCmsTxConf.fieldtype[0] == '0') { sprintf(acFieldType, "%s,'%s'"); } else if (stCmsTxConf.dicttype[0] == '1') { sprintf(acFieldType, "%s,%d"); } else if (stCmsTxConf.dicttype[0] == '2') { sprintf(acFieldType, "%s,%ld"); } else if (stCmsTxConf.dicttype[0] == '3') { sprintf(acFieldType, "%s,%lf"); } else if (stCmsTxConf.dicttype[0] == '4') { sprintf(acFieldType, "%s,'%s'"); } memset(acBuf, 0, sizeof(acBuf)); if (stCmsTxConf.dicttype[0] == '0') { getstring(stCmsTxConf.dictcode, acBuf); sprintf(acValueBuf, acFieldType, acValueBuf, acBuf); } else if (stCmsTxConf.dicttype[0] == '1') { getint(stCmsTxConf.dictcode, &iBuf); sprintf(acValueBuf, acFieldType, acValueBuf, iBuf); } else if (stCmsTxConf.dicttype[0] == '2') { getlong(stCmsTxConf.dictcode, &lBuf); sprintf(acValueBuf, acFieldType, acValueBuf, lBuf); } else if (stCmsTxConf.dicttype[0] == '3') { getdouble(stCmsTxConf.dictcode, &dBuf); sprintf(acValueBuf, acFieldType, acValueBuf, dBuf); } else if (stCmsTxConf.dicttype[0] == '4') { getbinary(stCmsTxConf.dictcode, acBuf); sprintf(acValueBuf, acFieldType, acValueBuf, acBuf); } sprintf(acInsertBuf, "%s,%s", acInsertBuf, stCmsTxConf.fieldname); } sprintf(acValueBuf, "%s)", acValueBuf); sprintf(acInsertBuf, "%s)", acInsertBuf); memset(s_acPrepValue, 0, sizeof(s_acPrepValue)); sprintf(s_acPrepValue, "%s", acInsertBuf); sprintf(s_acPrepValue, "%s%s", s_acPrepValue, acValueBuf); EXEC SQL EXECUTE IMMEDIATE :s_acPrepValue; if (SQLCODE) { strcpy( g_acRspCode, "999998" ); pubCrtRspInfo( "cmstxdet", SQLCODE ); ERRLOG return FAILED; } strcpy( g_acTrcMsg, "函数: 登记卡交易登记簿正常结束.." ); TRCLOG2 return SUCCESS;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -