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

📄 cms660.sqc

📁 一整套完整的银行卡系统源代码
💻 SQC
字号:
/******************************************************************** **   源码文件名称 : cms660.SQC **   函数名称 	   : cms216060 **   所属子系统   : CMS  **   当前文件版本 : 1.0.0.0 **   作        者 : ZhouR  **   版本创建日期 : 2004/10/14 **   功能描述     : 卡写磁登记簿打印 **   修改记录     : **   修改人       修改日期     修改日期*********************************************************************/#include    "sysdefine.h"#include    <stdio.h>#include	"pubcom.h"#include	"funcapi.h"#include    "code.h"#include    "attrdef.h"#include    "cmscode.h"#include	"cmswritem.h"#include 	"errlog.h"EXEC SQL INCLUDE sqlca;#define 	OVERPAGE	45       /* 满页行数 */ #define 	OVERLINE	5        /* 换行行数 */ #define		LIMIT		50struct	prtdata{	char	acCardNo[CARDNO_LEN +1];			/* 卡号     */	char	acCustName[BIT31_LEN + 1];			/* 户名 	*/	char    acIdType[BIT11_LEN + 1];    	    /* 证件种类 */	char    acIdNo[BIT21_LEN + 1];              /* 证件号码 */	char	acWriteDate[DATE_LEN + 1];		 	/* 写磁日期 */	char    acWriteBrc[BRC_LEN + 1];   			/* 写磁机构码 */	char	acWriteTeller[BIT11_LEN + 1];		/* 写磁操作员 */};#define 	PRTLINE												\	if( prtline( fp, acFmtFile,acPrtData ) ) 					\	FUNCERR_PRO													\	iLineCount++;#define		PRTHEAD 											\	memset( acPrtData, 0x00, sizeof( acPrtData ) );				\	prtline( fp,"title:%s", acBankname);						\	iLineCount++;												\	memset( acPrtData, 0x00, sizeof( acPrtData ) );				\	prtline( fp, "title0:%s|%d",								\			 pstPubcom->acBrc, iPage	 );					    \	iLineCount++;												\	memset( acPrtData, 0x00, sizeof( acPrtData ) );				\	prtline( fp, "head:"	);									\	iLineCount++;												\	memset( acPrtData, 0x00, sizeof( acPrtData ) );				\	prtline( fp, "body:"	);									\	iLineCount++;#define		PRTBODY												\	memset( acPrtData, 0x00, sizeof( acPrtData ) );				\	prtline( fp, "body0:%s|%s|%s|%s|%s|%s|%s",			  		\			stPrtdata.acCardNo,	 	stPrtdata.acCustName,		\			stPrtdata.acIdType,		stPrtdata.acIdNo,			\			stPrtdata.acWriteDate,								\			stPrtdata.acWriteBrc,  	stPrtdata.acWriteTeller );	\	iLineCount++;												\	iLine	++ ;	#define		PRTFOOT												\	memset( acPrtData, 0x00, sizeof( acPrtData ) );				\	prtline( fp, "tail1:" );									\	iLineCount++;												\	memset( acPrtData, 0x00, sizeof( acPrtData ) );				\	prtline( fp, "bottm:%s", 									\			 pstPubcom->acTeller );								\	iLineCount++;												\	memset( acPrtData, 0x00, sizeof( acPrtData ) );				\	prtline( fp, "next:%s",pstPubcom->acTranDate );				\	iLineCount++;												\	iPage	++ ;	iLine	=	0 ;		int cms216060(pstPubcom)struct          pubcom          *pstPubcom;{	EXEC SQL BEGIN DECLARE SECTION;	char    caBrc[BRC_LEN +1];                  /* 机构代码 */	char    acBeginDate[DATE_LEN + 1 ];      	/* 起始写磁日期 */ 	char    acEndDate[DATE_LEN + 1 ];      		/* 终止写磁日期 */ 	char	acWhrStr[ 512 ];	EXEC SQL END   DECLARE SECTION;	char	acBankname[ 41 ];	char    acBuffer[11];	char    acIdType[3];	FILE	*fp,*fmtfp;							/* 文件指针	*/ 	char	acSelStr[ 301 ];	char	acWhrStr1[ 512 ];	char	acWhrStr2[ 512 ];	char	acWhrStr3[ 512 ];	char	acWhrStr4[ 512 ];	char	acWhrStr5[ 512 ];	char	acStr1[ 141 ];	int		iLineCount	=	0 ;	int		i, iPage, iLine ;	char	acFileName[ 101 ];	char	acFmtFile[ 101 ];	char	acPrtData[ 4096 ];	struct	prtdata	stPrtdata;	struct  cmswritem      stCmsWriteM;     	/* 卡写磁登记簿 */	memset( acBeginDate,   	0x00, sizeof( acBeginDate ));	memset( acEndDate,     	0x00, sizeof( acEndDate )  );  	memset( acBuffer, 	   	0x00, sizeof( acBuffer )   );	memset( acIdType, 	   	0x00, sizeof( acIdType )   );	memset( caBrc,          0x00, sizeof( caBrc )      );	memset( acSelStr, 	   	0x00, sizeof( acSelStr )   );	memset( acWhrStr, 	   	0x00, sizeof( acWhrStr )   );	memset( acWhrStr1, 	   	0x00, sizeof( acWhrStr1 )  );	memset( acWhrStr2, 	   	0x00, sizeof( acWhrStr2 )  );	memset( acWhrStr3, 	   	0x00, sizeof( acWhrStr3 )  );	memset( acWhrStr4, 	   	0x00, sizeof( acWhrStr4 )  );	memset( acWhrStr5, 	   	0x00, sizeof( acWhrStr5 )  );	memset( acStr1, 	   	0x00, sizeof( acStr1 )     );	memset( &stCmsWriteM, 	0x00, sizeof( struct cmswritem ));	memset( acBankname,    	0x00, sizeof( acBankname ) );	if ( pubGetBaseInfo("BANKNAME", acBankname ) )		FUNCERR_PRO	/* 取数据字典 */  	getstring( "Brc1",          caBrc       );	getstring( "BeginDate1", 	acBeginDate );	getstring( "EndDate1", 		acEndDate	);     		sprintf( g_acTrcMsg,"BeginDate[%s]EndDate[%s]",						 acBeginDate,acEndDate );  	TRCLOG4	fp = (FILE *)BeginFile( pstPubcom, NULL );	if ( fp == NULL )	{		ERRLOG		return FAILED ;	}    /*检查交易机构是否为中心机构,如果是,则申请机构可以为空,否则当申请机构为空时,将交易机构付给申请机构 */	if (!strcmp( pstPubcom->acBrcType, BRCTYPE_SITE)) /* 营业网点 */	{		if (strlen(caBrc) == 0)		{			strcpy( caBrc, pstPubcom->acBrc );			}		if (strcmp( pstPubcom->acBrc, caBrc))		{        	strcpy( g_acRspCode, "CMS214" );			pubCrtRspInfo( );			ERRLOG			goto Exit;		}	}	sprintf( acFmtFile, "%s/fmt/cms660.fmt", getenv("HOME") );	sprintf( g_acFmtFile, acFmtFile );          	if( ( fmtfp=fopen(acFmtFile,"r") ) == NULL )	{                                           		strcpy( g_acTrcMsg, acFmtFile );        		TRCLOG2                                 		strcpy( g_acRspCode, "CMS1B0" );		sprintf( g_acRspMsg, "打开格式文件[%s]错", acFmtFile );		ERRLOG		goto Exit;	}	iLine	=	0 ;			iPage	=	1 ;	sprintf( acWhrStr1, " select * from cmswritem where 1=1");	if ( strlen ( caBrc ) > 0 )                                      	{                                                                		sprintf( acWhrStr2, " and writebrc = '%s'", caBrc );         	}                                                                	if ( strcmp ( acBeginDate, INITDATE ) )	{		sprintf( acWhrStr3, "  and writedate >= '%s'",  acBeginDate );	}	if ( strcmp ( acEndDate, INITDATE ) )	{		sprintf( acWhrStr4, "   and writedate <= '%s'",  acEndDate );	}	sprintf( acWhrStr5, " ORDER BY writedate, cardno, serseqno DESC" );	sprintf( acWhrStr, "%s%s%s%s%s",acWhrStr1,acWhrStr2,acWhrStr3,acWhrStr4,acWhrStr5 ); 	strcpy( g_acTrcMsg, acWhrStr );	TRCLOG4                        	EXEC SQL    PREPARE pre_1 FROM :acWhrStr;	if ( SQLCODE )                      	{                                   		strcpy( g_acRspCode, "CMS1A7" );		pubCrtRspInfo( SQLCODE );       		ERRLOG                          		goto Exit;	}                                   	EXEC SQL    DECLARE wrt_l_cur CURSOR FOR pre_1;	if(SQLCODE)	{		sprintf( g_acTrcMsg,"SQLCODE[%d]", SQLCODE);  		TRCLOG4		strcpy( g_acRspCode, "CMS110" );		pubCrtRspInfo("cmswritem",SQLCODE );		ERRLOG		goto Exit ;	}	SQLOPENCUR(wrt_l_cur,"wrt_l_cur")	if(SQLCODE)	{		sprintf( g_acTrcMsg,"SQLCODE[%d]", SQLCODE);  		TRCLOG4		strcpy( g_acRspCode, "CMS111" );		pubCrtRspInfo("cmswritem",SQLCODE );		ERRLOG		goto Exit ;	}	for( ; ; )	{		memset( &stPrtdata,	0x00,	sizeof( struct prtdata ) );		pubInitCmspcdreg();		EXEC SQL FETCH wrt_l_cur into R_CMSWRITEM;		if( SQLCODE == SQLNOTFOUND )	break ;		sprintf( g_acTrcMsg,"SQLCODE[%d]", SQLCODE);  		TRCLOG4		if(SQLCODE)		{			sprintf( g_acTrcMsg,"SQLCODE[%d]", SQLCODE);  			TRCLOG4			strcpy( g_acRspCode, "CMS112" );			pubCrtRspInfo("cmswritem",SQLCODE );			ERRLOG	SQLCLOSECUR(wrt_l_cur,"wrt_l_cur")			goto Exit ;		}		sprintf( g_acTrcMsg,"SQLCODE[%d]", SQLCODE);  		TRCLOG4	    /* 转换币种 */		strcpy ( acIdType,	cmswritem_idtype );		TransMemo( "0001" , acIdType , acBuffer);		sprintf( g_acTrcMsg,"IdType[%s]", acBuffer );				TRCLOG4		strpack ( cmswritem_custname );		strcpy ( stPrtdata.acCardNo, 		cmswritem_cardno );		strncpy( stPrtdata.acCustName, 		cmswritem_custname, 30  );		strcpy ( stPrtdata.acIdType, 		acBuffer );		strcpy ( stPrtdata.acIdNo, 			cmswritem_idcode );		strcpy ( stPrtdata.acWriteDate, 	cmswritem_writedate  );		strcpy ( stPrtdata.acWriteBrc, 		cmswritem_writebrc  );		strcpy ( stPrtdata.acWriteTeller,  	cmswritem_writeteller );		sprintf(  g_acTrcMsg, "acCardNo[%s],acCustName[%s],acWriteDate[%s],"					"acWriteBrc[%s],acWriteTeller[%s]", 					stPrtdata.acCardNo, stPrtdata.acCustName, 					stPrtdata.acWriteDate, stPrtdata.acWriteBrc, 					stPrtdata.acWriteTeller );		TRCLOG4				if( iLine	==	0 ) { PRTHEAD }				PRTBODY				if( iLine % OVERPAGE == 0 )				{ PRTFOOT }		sprintf( g_acTrcMsg, "%s|%s|%s|%s|%s",	\				stPrtdata.acCardNo,									\			stPrtdata.acCustName,	stPrtdata.acWriteDate,		\			stPrtdata.acWriteBrc,  	stPrtdata.acWriteTeller );	\		TRCLOG4	}	SQLCLOSECUR(wrt_l_cur,"wrt_l_cur")		if( iLine < OVERPAGE && iLine != 0 )	{ PRTFOOT }	if( iLineCount == 0 )	{		strcpy( g_acRspCode, "CMS113" );		sprintf( g_acRspMsg, "无满足条件的纪录!" );		ERRLOG		goto	Exit ;	}	Exit:	fclose( fmtfp );	fclose( fp );	if( !strcmp( g_acRspCode, RSP_OK ) )	{		SetInqFormid(pstPubcom, "") ;		return SUCCESS; 	}	else 		return FAILED ;}

⌨️ 快捷键说明

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