📄 cms038.sqc
字号:
/******************************************************************** ** 源码文件名称 : cms038.SQC ** 所属子系统 : CMS ** 当前文件版本 : 1.0.0.0 ** 作者 : guoyun ** 版本创建日期 : 2004/10/28 ** 功能描述 : 记名卡申请处理子交易 ** 修改记录 : ** 修改人 修改日期 修改日期*********************************************************************/#include "code.h"#include "attrdef.h"#include "sysdef.h"#include "pubcom.h"#include <stdio.h>#include <stdlib.h>#include <math.h>#include "cmscode.h"#include "cmspcdreg.h"#include "cmscardinfo.h"#include "cmscardkind.h"#include "ciscustomerinfo.h"#include "cmsacctm.h"EXEC SQL INCLUDE SQLCA;int cmsNameCardAplyPro( PUBCOM *pstPubcom ){ /*定义局部变量*/ int iRtn; /* 函数返回值 */ int iNumx; /* 数组计数器 */ int iNumy; /* 数组计数器 */ char acCardKind[ CARDKIND_LEN + 1 ]; /* 卡片种类 */ char acCustomId[ CUSTNO_LEN + 1 ]; /* 客户号 */ char acCustomName[ CUSTNAME_LEN + 1 ]; /* 客户姓名 */ char acCustomType[ FLAG_LEN + 1 ]; /* 客户类别 */ char acCardFlg[ FLAG_LEN + 1 ]; /* 卡标志 8:主卡 6:附卡*/ char acCheckFlag[ BIT8_LEN + 1 ]; /* 检查卡片种类标志 */ char acBuf[ CONDITION_LEN + 1 ]; /* 临时存储区 */ struct cmspcdreg stPcdReg; /* 预制卡申请登记表 */ struct cmscardkind stCardKind; /* 卡片种类表 */ struct cmsacctm stCmsAcctM; /* 卡账户对照表 */ struct cmscardinfo stCmsCardInfo; /* 卡片信息表 */ strcpy( g_acTrcMsg, "子交易: 记名卡申请处理子交易开始.." ); TRCLOG4 memset( &stPcdReg, 0x00, sizeof( struct cmspcdreg ) ); memset( &stCardKind, 0x00, sizeof( struct cmscardkind ) ); memset( &stCmsAcctM, 0x00, sizeof( struct cmsacctm ) ); memset( &stCmsCardInfo, 0x00, sizeof( struct cmscardinfo ) ); memset( acCardKind, 0x00, sizeof( acCardKind ) ); memset( acCustomId, 0x00, sizeof( acCustomId ) ); memset( acCustomName, 0x00, sizeof( acCustomName ) ); memset( acCardFlg, 0x00, sizeof( acCardFlg ) ); memset( acCheckFlag, 0x00, sizeof( acCheckFlag ) ); /* 取数据字典值 */ getstring("CardKind", acCardKind ); getstring("CustomId", acCustomId ); getstring("CustomName", acCustomName ); getstring("CustomType", acCustomType ); getstring("Flag1", acCardFlg ); /* 获取卡片种类表 */ iRtn = cmsApiGetCmsCardKind( acCardKind, &stCardKind ); if ( iRtn ) { ERRLOG return FAILED; } /* 检查卡片种类(全部属性)API是否为启用标志、检查卡种交易类型、检查业务发生地、是否是记名卡,发卡对象为个人 */ acCheckFlag[ BIT1_LEN ] = CHECK_YES; /* 检查启用标志 */ acCheckFlag[ BIT2_LEN ] = CHECK_YES; /* 检查卡种交易类型 */ acCheckFlag[ BIT3_LEN ] = CHECK_YES; /* 检查业务发生地 */ acCheckFlag[ BIT4_LEN ] = CHECK_YES; /* 检查发卡对象 个 */ acCheckFlag[ BIT5_LEN ] = CHECK_YES; /* 检查记名标志 */ acCheckFlag[ BIT6_LEN ] = CHECK_NO; /* 不检查挂失标志 */ iRtn = cmsApiChkCardKind( &stCardKind, acCheckFlag, LOGOPENACC, pstPubcom->acChannelId, PERSONALCARD, REGNAMECARD, CZEROS, "" ); if ( iRtn ) { ERRLOG return FAILED; } /* 检查客户类别为个人客户 */ if ( acCustomType[ BIT1_LEN ] != CUSTOMTYPE_P ) { sprintf( g_acRspCode, "CMS1C5" ); pubCrtRspInfo( ); ERRLOG return FAILED; } /* 检查卡片种类是否是客户指定的卡标志 8:主卡 6:附卡 */ if (acCardFlg[BIT1_LEN] == MAIN_CARD) { /* 检查卡片种类是否为主卡卡片种类 */ iRtn = cmsApiChkCardKindIsMainCard( &stCardKind ); if ( iRtn ) { ERRLOG return FAILED; } } else if (acCardFlg[BIT1_LEN] == SUBMAIN_CARD) { /* 检查卡片种类是否为附卡卡片种类 */ iRtn = cmsApiChkCardKindIsSubMainCard( &stCardKind ); if ( iRtn ) { ERRLOG return FAILED; } } /* 检查客户持卡数量是否超限并累计客户持卡数量 */ iRtn = cmsApiChkCustCardNumLimit( acCustomId, &stCardKind, acCardFlg[ BIT1_LEN ], FLAG_NORMAL ); if ( iRtn ) { ERRLOG return FAILED; } /*写预制卡登记簿 */ stPcdReg.serseqno = pstPubcom->lSerSeqNo; /* 流水号 */ sprintf( stPcdReg.vouchno,"%s%08ld",pstPubcom->acTranDate8,stPcdReg.serseqno); strcpy( stPcdReg.wishdate, pstPubcom->acTranDate );/* 希望制卡日期 */ strcpy( stPcdReg.aplydate, pstPubcom->acTranDate );/* 申请日期 */ strcpy( stPcdReg.aplybrc, pstPubcom->acBrc ); /* 申请机构 */ strcpy( stPcdReg.aplyteller,pstPubcom->acTeller ); /* 申请柜员 */ strcpy( stPcdReg.authteller,pstPubcom->acAteller ); /* 授权柜员 */ strcpy ( stPcdReg.cardkind, stCardKind.cardkind ); /* 卡片种类 */ stPcdReg.aplynum = 1; /* 申请数量 */ strcpy ( stPcdReg.voukind, stCardKind.voukind ); /* 凭证种类 */ strcpy( stPcdReg.custno, acCustomId); /* 客户号 */ strcpy(stPcdReg.custname,acCustomName); /* 姓名 */ stPcdReg.aplyflg[BIT1_LEN]=NAMECARDAPLY; /* 记名卡申请 */ stPcdReg.applflg[BIT1_LEN]=APPLYREG; /* 状态标志 */ stPcdReg.processflg[BIT1_LEN]=MKFILE_UNDONE; /* 处理标志 */ if( pubInstCmspcdreg( &stPcdReg ) ) { ERRLOG return FAILED; } /*写子交易流水*/ iRtn = cmsApiInsTranLog( pstPubcom, &stCmsCardInfo, &stCmsAcctM, "申请", "记名卡申请" ); if ( iRtn ) { ERRLOG return FAILED; } /* 子交易出口 */ setstring( "VouchNo", stPcdReg.vouchno ); /* 登记簿编号 */ strcpy( g_acTrcMsg, "子交易: 记名卡申请处理子交易结束.." ); TRCLOG4 strcpy( g_acRspCode, RSP_OK ); return SUCCESS;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -