📄 cms620.sqc
字号:
/********************************************************************** 源码文件名称 : cms620.SQC** 所属子系统 : CMS** 当前文件版本 : 4.0.0.0** 作者 : ZhouR** 版本创建日期 : 2004/10/15** 功能描述 : 差错通知登记簿查询打印** 修改记录 :** 修改人 修改日期 修改日期*********************************************************************/#include "code.h"#include "attrdef.h"#include "sysdef.h"#include "pubcom.h"#include "cmscode.h"#include <stdio.h>#include "cmswrongnote.h"EXEC SQL INCLUDE SQLCA;/********************************************************* 函数名称: cms216020** 功能描述:差错通知登记簿查询打印** 输入参数:** acBeginDate ---- 起始日期** acEndDate ---- 终止日期** acCardNo ---- 卡号** 输出参数:**** ** 返回结果: 0: 签约 -1: 失败 1: 未签约** 作 者 : ZhouR** 版本创建日期 : 2004/09/20** 修改记录 :** 修改人 修改日期 修改位置*******************************************************/int cms216020( PUBCOM *pstPubcom ){ /*定义局部变量*/ struct cmswrongnote stCmsAuthLog; /* 预授权登记簿 */ char acBeginDate[DATE_LEN + 1]; /* 起始日期 */ char acEndDate[DATE_LEN + 1]; /* 终止日期 */ char acCardNo[CARDNO_LEN + 1]; /* 卡号 */ char acBrc[BRC_LEN + 1]; /* 交易机构码 */ char acFileName[FILENAME_LEN + 1]; /* 文件名称 */ char acTableName[PRDCODE_LEN + 1]; /* 表名称 */ char acSelStr[CONDITION_LEN + 1]; char acWhrStr[CONDITION_LEN + 1]; char acWhrStr1[CONDITION_LEN + 1]; char acWhrStr2[CONDITION_LEN + 1]; char acWhrStr3[CONDITION_LEN + 1]; char acWhrStr4[CONDITION_LEN + 1]; char acWhrStr5[CONDITION_LEN + 1]; FILE *fp; /* 文件指针 */ strcpy( g_acRspMsg, "子交易: 差错通知登记簿查询打印子交易开始.." ); TRCLOG4 /* 初始化 */ memset( &stCmsAuthLog, 0x00, sizeof( struct cmswrongnote ) ); memset( acBeginDate, 0x00, sizeof( acBeginDate ) ); memset( acEndDate, 0x00, sizeof( acEndDate ) ); memset( acCardNo, 0x00, sizeof( acCardNo ) ); memset( acBrc, 0x00, sizeof( acBrc ) ); memset( acFileName, 0x00, sizeof( acFileName ) ); memset( acTableName, 0x00, sizeof( acTableName ) ); 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 ) ); /* 取数据字典值 */ getstring( "BeginDate1", acBeginDate ); getstring( "EndDate1", acEndDate ); getstring( "CardNo", acCardNo ); sprintf( g_acTrcMsg,"BeginDate1[%s]EndDate1[%s]CardNo[%s]", acBeginDate,acEndDate,acCardNo ); 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; } } if( GenSqlCmd( "216020" , acSelStr ) ) { ERRLOG goto Exit; } /* 定义日期区间 */ if ( strcmp ( acBeginDate, "1899-12-31" ) ) { sprintf( acWhrStr1, "and trandate >= '%s'", acBeginDate ); } if ( strcmp ( acEndDate,"1899-12-31") ) { sprintf( acWhrStr2, "and trandate <= '%s'", acEndDate ); } if ( strlen ( acCardNo ) > 0 ) { sprintf( acWhrStr3, "and cardno = '%s'", acCardNo ); strcpy( g_acTrcMsg, "acWhrStr3" ); TRCLOG3; } if ( strlen ( acBrc ) > 0 ) { sprintf( acWhrStr4, "and brc = '%s'", acBrc ); } sprintf( acWhrStr5, "ORDER BY trandate, cardno, serseqno DESC" ); sprintf(acWhrStr, " where 1=1 %s %s %s %s %s", acWhrStr1,acWhrStr2,acWhrStr3,acWhrStr4,acWhrStr5 ); strcpy( acTableName, "cms620" ); 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 , "216020" )) { ERRLOG goto Exit; } /* 准备数据 */ sprintf( g_acTrcMsg, "%s%s" ,acSelStr,acWhrStr); TRCLOG3 if ( DBSelect( "cmswrongnote", acSelStr, acWhrStr, fp ) ) { ERRLOG goto Exit; } /* 出口赋值 */Exit: EndFile( fp ); if( !strcmp( g_acRspCode, RSP_OK ) ) { SetInqFormid(pstPubcom, "216020") ; sprintf( g_acTrcMsg,"差错通知登记簿查询打印正常结束"); TRCLOG4 return SUCCESS; } else { sprintf( g_acTrcMsg,"差错通知登记簿查询打印失败"); TRCLOG4 return FAILED ; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -