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

📄 cms663.sqc

📁 一整套完整的银行卡系统源代码
💻 SQC
字号:
/******************************************************************** **   源码文件名称 : cms663.SQC **   函数名称 	   : cms216063 **   所属子系统   : CMS  **   当前文件版本 : 1.0.0.0 **   作        者 : xuliang  **   版本创建日期 : 2004/12/30 **   功能描述     : 打印开卡登记簿 **   修改记录     : **   修改人       修改日期     修改日期*********************************************************************/#include    "sysdefine.h"#include    <stdio.h>#include	"pubcom.h"#include	"funcapi.h"#include <fcntl.h>#include    "code.h"#include    "attrdef.h"#include    "cmscode.h"#include "ciscustomerinfo.h"#include "cmsacctm.h"#include	"cmscardinfo.h"#include "pubinq.h"#include 	"errlog.h"EXEC SQL INCLUDE sqlca;#define 	OVERPAGE	45       /* 满页行数 */ #define 	OVERLINE	5        /* 换行行数 */ #define		LIMIT		50struct	prtdata{	char	acCardNo[CARDNO_LEN +1];			/* 卡号   	        */	char	acCardKind[BIT11_LEN + 1];	        /* 卡片种类         */ 	char    acCardFlg[BIT11_LEN + 1];           /* 卡标志           */	char    acCardObject[BIT21_LEN + 1];        /* 发卡对象         */	char    acCardAttr[BIT11_LEN + 1];          /* 卡片属性代码     */	char    acMarkFlg[BIT9_LEN + 1];           /* 记名卡/非记名卡标志   */	char    acIssueBrc[BRC_LEN + 1];            /* 发卡机构码       */	char    acTeller[TNAME_LEN + 1];            /* 发卡交易柜员     */	char    acUseDate[DATE_LEN + 1];            /* 启用日期         */	char    acCustName[FUNC_NAME_LEN + 1];     	/* 客户姓名     */	char    acIdNo[IDNO_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|%s|%s|%s", 		\            stPrtdata.acCardNo,    								\			stPrtdata.acCustName,   stPrtdata.acIdNo,			\			stPrtdata.acCardKind,   stPrtdata.acCardFlg,        \             stPrtdata.acCardAttr,  	    \            stPrtdata.acMarkFlg,    stPrtdata.acIssueBrc, 		\			stPrtdata.acTeller,  	stPrtdata.acUseDate );    	\	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 cms216063(pstPubcom)struct          pubcom          *pstPubcom;{	EXEC SQL BEGIN DECLARE SECTION;    char    acBeginDate[DATE_LEN + 1 ];         /* 起始日期        */	char    acEndDate[DATE_LEN + 1 ];           /* 终止日期        */	char    acIssueBrc[BRC_LEN + 1 ];           /* 交易机构        */	char	acWhrStr[ 512 ];	EXEC SQL END   DECLARE SECTION;	char	acBankname[ 41 ];    char    acBuffer[512];    char    acBuffer1[512];    char    acBuffer2[512];    char    acBuffer3[512];	struct  ciscustomerinfo  stCisCustomerInfo; /* 客户公用基本信息文件 */	BASESUBACCTINFO          stDpsAccInfo;      /* 静态表       */	struct  cmsacctm         stCmsAcctM;        /* 卡帐户对照表 */    char    acCardFlg[BIT11_LEN + 1];           /* 卡标志           */    char    acCardObject[BIT21_LEN + 1];        /* 发卡对象         */    char    acCardAttr[BIT11_LEN + 1];          /* 卡片属性代码     */    char    acMarkFlg[BIT9_LEN + 1];           /* 记名卡/非记名卡标志   */	FILE	*fp,*fmtfp;							/* 文件指针	       */ 	int     iRtn;	char	acSelStr[ 301 ];	int		iLineCount	=	0 ;	int		i, iPage, iLine ;    char    acTableName[PRDCODE_LEN + 1];        /* 表名称 */    char    acFileName[FILENAME_LEN + 1];        /* 文件名称 */	char	acFmtFile[ 101 ];	char	acPrtData[ 4096 ];	struct	prtdata	stPrtdata;	struct cmscardinfo      stCmscardinfo;       /* 卡片信息表  */	memset( acBuffer, 	   0x00, sizeof( acBuffer )   );	memset( acBuffer1, 	   0x00, sizeof( acBuffer1 )  );	memset( acSelStr, 	   0x00, sizeof( acSelStr )   );	memset( acWhrStr, 	   0x00, sizeof( acWhrStr )   );	memset( &stCisCustomerInfo, 0x00,   sizeof( struct ciscustomerinfo ) );	memset( &stDpsAccInfo,      0x00,   sizeof( BASESUBACCTINFO ) );	memset( &stCmsAcctM,        0x00,   sizeof( struct cmsacctm ) );        memset( acIssueBrc,    0x00, sizeof( acIssueBrc )  );     memset( acFileName,    0x00, sizeof( acFileName ) );    memset( acTableName,   0x00, sizeof( acTableName ) );	memset( &stCmscardinfo,  0x00, sizeof( struct cmscardinfo ) );	memset( acBankname,    0x00, sizeof(acBankname));	if ( pubGetBaseInfo("BANKNAME", acBankname ) )		FUNCERR_PRO	/* 取数据字典 */      getstring( "BeginDate1",    acBeginDate );    getstring( "EndDate1",     acEndDate   );	strcpy(  acIssueBrc , pstPubcom->acBrc  );    sprintf( g_acTrcMsg,"BeginDate[%s]EndDate[%s]",                         acBeginDate,acEndDate );    TRCLOG4		fp = (FILE *)BeginFile( pstPubcom, NULL );	if ( fp == NULL )	{		ERRLOG		return FAILED ;	}	sprintf( acFmtFile, "%s/fmt/cms663.fmt", getenv("HOME") );	sprintf( g_acFmtFile, acFmtFile );            	if( ( fmtfp=fopen( acFmtFile,"r" ) ) == NULL )	{                                             		strcpy( g_acTrcMsg, acFmtFile );          		TRCLOG4                                   		strcpy( g_acRspCode, "CMS1B0" );		sprintf( g_acRspMsg, "打开格式文件[%s]错", acFmtFile );		ERRLOG		goto Exit;	}	iLine	=	0 ;			iPage	=	1 ;	sprintf( acWhrStr, " select * from cmscardinfo ");	strcat( acWhrStr, "  where 1=1 and usedate<>'' ");       if ( strcmp ( acBeginDate, INITDATE ) )    {       sprintf( acWhrStr+strlen(acWhrStr), " and usedate >= '%s'",  acBeginDate );    }    if ( strcmp ( acEndDate, INITDATE ) )    {       sprintf( acWhrStr+strlen(acWhrStr), " and usedate <= '%s'",  acEndDate);    } 	if ( strlen ( acIssueBrc ) > 0 )	{	   sprintf( acWhrStr+strlen(acWhrStr), " and issuebrc = '%s'" ,  acIssueBrc);	}	sprintf( acWhrStr+strlen(acWhrStr), " ORDER BY usedate, cardno DESC" );	strcpy( g_acTrcMsg, acWhrStr );	TRCLOG4                            strcpy( acTableName, "cms663" );    sprintf( acFileName, "%s%s%s", acTableName, pstPubcom->acBrc,pstPubcom->acTeller);	EXEC SQL    PREPARE pre_1 FROM :acWhrStr;	if ( SQLCODE )                      	{                                   		strcpy( g_acRspCode, "CMS1A7" );		pubCrtRspInfo( SQLCODE );       		ERRLOG                          		goto Exit;	}                                   	EXEC SQL    DECLARE cardinfo_cur CURSOR FOR pre_1;	if(SQLCODE)	{		sprintf( g_acTrcMsg,"SQLCODE[%d]", SQLCODE);  		TRCLOG4		strcpy( g_acRspCode, "CMS110" );		pubCrtRspInfo("cmscardinfo",SQLCODE );		ERRLOG		goto Exit ;	}	SQLOPENCUR(cardinfo_cur,"cardinfo_cur")	if(SQLCODE)	{		sprintf( g_acTrcMsg,"SQLCODE[%d]", SQLCODE);  		TRCLOG4		strcpy( g_acRspCode, "CMS111" );		pubCrtRspInfo("cmscardinfo",SQLCODE );		ERRLOG		goto Exit ;	}	for( ; ; )	{	    memset( acBuffer,      0x00, sizeof( acBuffer )   );	    memset( acBuffer1,     0x00, sizeof( acBuffer1 )  );	    memset( acBuffer2,     0x00, sizeof( acBuffer2 )   );	    memset( acBuffer3,     0x00, sizeof( acBuffer3 )   );		memset( &stPrtdata,	0x00,	sizeof( struct prtdata ) );		pubInitCmspcdreg();		EXEC SQL FETCH cardinfo_cur into R_CMSCARDINFO;		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( "cmscardinfo",SQLCODE );			ERRLOG	SQLCLOSECUR(cardinfo_cur,"cardinfo_cur")			goto Exit ;		}		sprintf( g_acTrcMsg,"SQLCODE[%d]", SQLCODE);  		TRCLOG4		/* 翻译卡标志 */		strcpy ( acCardFlg, cmscardinfo_cardflg );		TransMemo( "0002" , acCardFlg , acBuffer);		/* 翻译发卡对象 */		strcpy ( acCardObject, cmscardinfo_cardobject );		TransMemo( "0003" , acCardObject , acBuffer1);		/* 翻译卡片属性代码 */		strcpy ( acCardAttr, cmscardinfo_cardattr );		TransMemo( "0004" , acCardAttr , acBuffer2);		/* 翻译记名卡/非记名卡标志 */		strcpy ( acMarkFlg, cmscardinfo_markflg );		TransMemo( "0005" , acMarkFlg , acBuffer3);		sprintf( g_acTrcMsg,"SQLCODE[%s][%s][%s][%s]", acBuffer, acBuffer1,acBuffer2,acBuffer3 );  		TRCLOG4		EXEC SQL SELECT * INTO R_CISCUSTOMERINFO from ciscustomerinfo			WHERE customid = :cmscardinfo_custno;		sprintf( g_acTrcMsg,"[%s][%s]", stDpsAccInfo.acCustomName,stDpsAccInfo.acIdNo);  		TRCLOG4		strpack ( cmscardinfo_teller );		strpack ( cmscardinfo_usedate );		strpack ( ciscustomerinfo_customname );		strcpy ( stPrtdata.acCardNo, 	cmscardinfo_cardno   );		strcpy ( stPrtdata.acCardKind, 	cmscardinfo_cardkind   );		strcpy ( stPrtdata.acCardFlg,  acBuffer );		strcpy ( stPrtdata.acCardObject,  acBuffer1 );		strcpy ( stPrtdata.acCardAttr,  acBuffer2 );		strcpy ( stPrtdata.acMarkFlg,  acBuffer3 );		strcpy ( stPrtdata.acIssueBrc,  cmscardinfo_issuebrc );		strcpy ( stPrtdata.acTeller,  cmscardinfo_teller );		strcpy ( stPrtdata.acUseDate,  cmscardinfo_usedate );		strncpy ( stPrtdata.acCustName,  ciscustomerinfo_customname, 30 );		strcpy ( stPrtdata.acIdNo,  	ciscustomerinfo_idno );				if( iLine	==	0 ) { PRTHEAD }				PRTBODY				if( iLine % OVERPAGE == 0 )				{ PRTFOOT }		sprintf( g_acTrcMsg, "%s|%s|%s|%s|%s|%s|%s|%s|%s",		\	        stPrtdata.acCardNo,     stPrtdata.acCardKind,    \            stPrtdata.acCardFlg,                                    \            stPrtdata.acCardObject,  stPrtdata.acCardAttr,      \            stPrtdata.acMarkFlg,                            \            stPrtdata.acIssueBrc, stPrtdata.acTeller, \            stPrtdata.acUseDate );    \		TRCLOG4	}	SQLCLOSECUR(cardinfo_cur,"cardinfo_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 + -