⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cms633.sqc

📁 一整套完整的银行卡系统源代码
💻 SQC
字号:
/**********************************************************************   源码文件名称 : cms633.SQC**   所属子系统   : CMS**   当前文件版本 : 4.0.0.0**   作者         : zhour**   版本创建日期 : 2004/09/xx**   功能描述     : 柜员对历史卡交易登记簿查询**   修改记录     :**   修改人       修改日期     修改日期*********************************************************************/#include "code.h"#include "attrdef.h"#include "sysdef.h"#include "pubcom.h"#include "cmscode.h"#include <stdio.h>#include "cmstxdethis.h"#include "pubcurrencyinfo.h"EXEC SQL INCLUDE SQLCA;/*********************************************************   函数名称: cms216033**   功能描述:柜员对卡交易登记簿查询**   输入参数:**             acCardNo  	 ----  卡号**             acBeginDate   ----  起始日期**             acEndDate     ----  终止日期**             iSerSeqNo 	 ----  交易流水号**             acTeller 	 ----  操作员**             acBrc		 ----  交易机构码**             acTranDevType ----  业务发生地类型**   输出参数:**             **             **   返回结果: 0: 签约  -1: 失败    1: 未签约**   作        者 : ZhouR**   版本创建日期 : 2004/09/20**   修改记录     :**   修改人       修改日期     修改位置*******************************************************/int cms216033( PUBCOM *pstPubcom ){	/* 定义宿主变量 */	EXEC SQL BEGIN DECLARE SECTION;		char	acSelStr[CONDITION_LEN + 1];		char	acChName[BIT17_LEN + 1];		char	acChName2[BIT17_LEN + 1];	EXEC SQL END DECLARE SECTION;	/*定义局部变量*/	struct  cmstxdethis        stCmsTxdetHis; 		/* 卡交易登记簿 */	struct  pubcurrencyinfo    stPubCurrencyInfo;	/* 卡交易登记簿 */	char	acCardNo[BIT23_LEN + 1];       			/* 卡号 */	char	acBeginDate[DATE_LEN + 1];   	    	/* 起始日期 */	char	acEndDate[DATE_LEN + 1];    	    	/* 终止日期 */	char	acTeller[TELLER_LEN + 1];  				/* 操作员 */	char	acBrc[BRC_LEN + 1];						/* 交易机构码 */	char	acTranDevType[LINKTYPE_LEN + 1];  		/* 业务发生地类型 */	int		iSerSeqNo;						   		/* 交易流水号 */	char    acFileName[FILENAME_LEN + 1];      		/* 文件名称 */	char    acTableName[PRDCODE_LEN + 1]; 	    	/* 表名称 */	char	acWhrStr[CONDITION_LEN + 1];	int 	iCount = 0;	FILE    *fp;									/* 文件指针     */	strcpy( g_acTrcMsg, "子交易: 柜员对卡交易历史登记簿查询子交易开始.." );	TRCLOG4;	/* 初始化 */	memset( &stCmsTxdetHis, 	0x00,   sizeof( struct cmstxdethis ) );	memset( acCardNo,    	    0x00,   sizeof( acCardNo ) );	memset( acBeginDate,        0x00,   sizeof( acBeginDate ) );	memset( acEndDate,          0x00,   sizeof( acEndDate ) );	memset( acTeller,           0x00,   sizeof( acTeller ) );	memset( acBrc,      		0x00,   sizeof( acBrc ) );	memset( acTranDevType,      0x00,   sizeof( acTranDevType ) );	memset( acFileName,        	0x00,   sizeof( acFileName ) );	memset( acTableName,        0x00,   sizeof( acTableName ) );	memset( acSelStr,           0x00,   sizeof( acSelStr ) );	memset( acWhrStr,           0x00,   sizeof( acWhrStr ) );    /* 取数据字典值 */	getstring( "AcctNo",        		acCardNo    );	getstring( "BeginDate1",    		acBeginDate );	getstring( "EndDate1",  	        acEndDate   );	getstring( "Teller1",  	  			acTeller   );	getint   ( "SerSeqNo1",  	  		&iSerSeqNo   );	getstring( "Brc1",  	  			acBrc   );	getstring( "TranDevType", 	 	    acTranDevType   );	sprintf( g_acTrcMsg,"CardNo[%s]BeginDate1[%s]EndDate1[%s]Teller1[%s]	\						 Brc1[%s]TranDevType[%s]SerSeqNo1[%ld]",		\						 acCardNo,acBeginDate,		\						 acEndDate,acTeller,acBrc,acTranDevType,iSerSeqNo );	TRCLOG3;    /*检查交易机构是否为中心机构,如果是,则申请机构可以为空,否则当申请机构为空时,将交易机构付给申请机构 */	if (!strcmp( pstPubcom->acBrcType, BRCTYPE_SITE)) /* 营业网点 */	{		if (strlen(acBrc) == 0)		{			strcpy( acBrc, pstPubcom->acBrc );			}		if (strcmp( pstPubcom->acBrc, acBrc))		{        	strcpy( g_acRspCode, "CMS214" );			pubCrtRspInfo( );			ERRLOG			goto Exit;		}	}	strcpy( acTableName, "cms608" );	sprintf(acFileName, "%s%s%s", acTableName, pstPubcom->acBrc,								  pstPubcom->acTeller);	fp = (FILE *)BeginFile( pstPubcom, acFileName );	if ( fp == NULL )	{		strcpy( g_acRspMsg, "DPS902" );		pubCrtRspInfo( );		ERRLOG		goto Exit;	}	/*组织查询字典*/	if( GetInqDict( fp , "216033" ) )	{		ERRLOG		goto Exit;	}	/* 组织查询条件 */	strcpy( acSelStr, "select * from cmstxdethis where 1=1 " );    if ( strcmp ( acBeginDate, "1899-12-31" ) )    { 		sprintf( acWhrStr, "and trandate >= '%s'", acBeginDate );		strcat( acSelStr, acWhrStr );    }    if ( strcmp ( acEndDate,"1899-12-31") )    {		sprintf( acWhrStr, "and trandate <= '%s'", acEndDate );		strcat( acSelStr, acWhrStr );    }	if ( strlen(acCardNo) > 0 )	{		sprintf( acWhrStr, " and ( cardno1 = %s or cardno2 = %s )", acCardNo, acCardNo );		strcat( acSelStr, acWhrStr );	}	if ( strlen(acTeller) > 0 )	{		sprintf( acWhrStr, " and teller = %s", acTeller );		strcat( acSelStr, acWhrStr );	}	if ( iSerSeqNo > 0 )	{		sprintf( acWhrStr, " and serseqno = %ld", iSerSeqNo );		strcat( acSelStr, acWhrStr );	}	if ( strlen(acBrc) > 0 )	{		sprintf( acWhrStr, " and brc = %s", acBrc );		strcat( acSelStr, acWhrStr );	}	if ( strlen(acTranDevType) > 0 )	{		sprintf( acWhrStr, " and trandevtype = %s", acTranDevType );		strcat( acSelStr, acWhrStr );	}	strcat( acSelStr, " order by trandate, serseqno" );	EXEC SQL PREPARE pre1_cur FROM :acSelStr;    if ( SQLCODE )    {        strcpy( g_acRspCode, "CMS1A7" );        pubCrtRspInfo( SQLCODE );        ERRLOG        goto Exit ;    }	EXEC SQL DECLARE cmstxdethis_cur CURSOR FOR pre1_cur;    if ( SQLCODE )    {        sprintf( g_acTrcMsg,"SQLCODE[%d]", SQLCODE);        TRCLOG4        strcpy( g_acRspCode, "CMS110" );        pubCrtRspInfo("cmstxdethis",SQLCODE );        ERRLOG        goto Exit ;    }	SQLOPENCUR(cmstxdethis_cur,"cmstxdethis_cur")    if ( SQLCODE )    {        sprintf( g_acTrcMsg,"SQLCODE[%d]", SQLCODE);        TRCLOG4        strcpy( g_acRspCode, "CMS111" );        pubCrtRspInfo("cmstxdethis",SQLCODE );        ERRLOG        goto Exit ;    }	for ( ; ; )	{		EXEC SQL FETCH cmstxdethis_cur INTO R_CMSTXDETHIS;		if ( SQLCODE == SQLNOTFOUND )			break;        if(SQLCODE)        {            sprintf( g_acTrcMsg,"SQLCODE[%d]", SQLCODE);            TRCLOG4            strcpy( g_acRspCode, "CMS112" );            pubCrtRspInfo( "cmstxdethis",SQLCODE );	SQLCLOSECUR(cmstxdethis_cur,"cmstxdethis_cur")            ERRLOG            goto Exit ;        }		/* 向结构体中赋值 */		pubVtoSCmstxdethis(&stCmsTxdetHis);		/* 取币种信息 */        EXEC SQL SELECT chname INTO :acChName                 FROM   pubcurrencyinfo                 WHERE  ccy = :cmstxdethis_ccy;        if( SQLCODE && SQLCODE != SQLNOTFOUND )        {        	strcpy(g_acRspCode,"CMS112");        	pubCrtRspInfo("pubcurrencyinfo",SQLCODE);        	ERRLOG	SQLCLOSECUR(cmstxdethis_cur,"cmstxdethis_cur")        	goto Exit;        }        EXEC SQL SELECT chname INTO :acChName2                 FROM   pubcurrencyinfo                 WHERE  ccy = :cmstxdethis_ccy2;        if( SQLCODE && SQLCODE != SQLNOTFOUND )        {        	strcpy(g_acRspCode,"CMS112");        	pubCrtRspInfo("pubcurrencyinfo",SQLCODE);        	ERRLOG	SQLCLOSECUR(cmstxdethis_cur,"cmstxdethis_cur")        	goto Exit;        }		/* 拼写文件 */		fprintf( fp, "\"%s\"~%d~\"%s\"~\"%s\"~\"%s\"~\"%s\"~\"%s\"~\"%s\"~\"%s\"~\"%s\"~\"%s\"~\"%s\"~\"%s\"~\"%s\"~\"%s\"~\"%s\"~\"%s\"~\"%s\"~\"%s\"~\"%s\"~\"%s\"~\"%s\"~\"%s\"~\"%s\"~\"%s\"~\"%s\"~\"%s\"~%.2lf~\"%s\"~\"%s\"~\"%s\"~%.2lf~%.2lf~%.2lf~%.2lf~%.2lf~%.2lf~%.2lf~\"%s\"~\"%s\"~\"%s\"~\"%s\"~\"%s\"\n",					 stCmsTxdetHis.trandate,		/* 交易日期 */					 stCmsTxdetHis.serseqno,		/* 交易流水号 */					 stCmsTxdetHis.teller,   		/* 交易柜员 */					 stCmsTxdetHis.brc,     		/* 交易机构码 */					 stCmsTxdetHis.frnttrandate,	/* 前置交易日期 */					 stCmsTxdetHis.frnttime,		/* 前置交易时间 */					 stCmsTxdetHis.frntstan,		/* 前置交易流水号 */					 stCmsTxdetHis.frntno,			/* 前置编号 */					 stCmsTxdetHis.trancode,		/* 交易代码 */					 stCmsTxdetHis.ccy,				/* 币种 */					 acChName,						/* 币种名称 */					 stCmsTxdetHis.ccy2,			/* 币种2 */					 acChName2,						/* 币种名称 */					 stCmsTxdetHis.trandevtype,		/* 业务发生地类型 */					 stCmsTxdetHis.trandevtypecomm,	/* 业务发生地类型描述 */					 stCmsTxdetHis.cardno1,			/* 卡号1 */					 stCmsTxdetHis.acctno1,			/* 帐号1 */					 stCmsTxdetHis.subacct1,		/* 款项代码1 */					 stCmsTxdetHis.acctseqno1,		/* 卡内帐户序号1 */					 stCmsTxdetHis.cardno2,			/* 卡号2 */					 stCmsTxdetHis.acctno2,			/* 帐号2 */					 stCmsTxdetHis.subacct2,		/* 款项代码2 */					 stCmsTxdetHis.acctseqno2,		/* 卡内帐户序号2 */					 stCmsTxdetHis.cardtrantype,	/* 卡交易类型 */					 stCmsTxdetHis.cardtrantypecomm,/* 卡交易类型描述 */					 stCmsTxdetHis.trankind,		/* 交易种类 */					 stCmsTxdetHis.trankindcomm,	/* 交易种类描述 */					 stCmsTxdetHis.tranamt,			/* 发生额 */					 stCmsTxdetHis.mid,				/* 商户代码 */					 stCmsTxdetHis.devid,			/* 设备代码 */					 stCmsTxdetHis.validf,			/* 有效标志 */					 stCmsTxdetHis.bankgetfee,		/* 银行收取手续费 */					 stCmsTxdetHis.custsharefee,	/* 持卡人分担手续费 */					 stCmsTxdetHis.banksharefee,	/* 银行分担手续费 */					 stCmsTxdetHis.bankassfee,		/* 银行分成手续费 */					 stCmsTxdetHis.bankpayfee,		/* 银行支付第三方手续费 */					 stCmsTxdetHis.assfee1,			/* 第三方支付银行手续费1 */					 stCmsTxdetHis.assfee2,			/* 第三方支付银行手续费2 */					 stCmsTxdetHis.frnttrandate,	/* 前置交易日期 */					 stCmsTxdetHis.frnttrancode,	/* 前置交易代码 */					 stCmsTxdetHis.frnttrancomm,	/* 前置交易代码描述 */					 stCmsTxdetHis.settledate,		/* 清算日期 */					 stCmsTxdetHis.devstan );		/* 设备流水号 */		iCount ++;	}	SQLCLOSECUR(cmstxdethis_cur,"cmstxdethis_cur")    EndFile( fp );    if (iCount == 0)    {        strcpy( g_acRspCode, "CMS1B7" );        pubCrtRspInfo( "历史外围交易登记簿");        ERRLOG        return FAILED;    }	/* 出口赋值 */Exit:	EndFile( fp );	if( !strcmp( g_acRspCode, RSP_OK ) )	{		SetInqFormid(pstPubcom, "216033") ;		sprintf( g_acTrcMsg,"柜员对卡交易登记簿查询正常结束");		TRCLOG4		return SUCCESS;	}	else	{		sprintf( g_acTrcMsg,"柜员对卡交易登记簿查询失败");		TRCLOG4		return FAILED ;	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -