📄 cmsmang.sqc
字号:
** pstNewCardInfo ---- 新卡卡片信息结构 ** 输出参数: ** 返回结果:int ** 0 ---- 成功 ** -1 ---- 失败*******************************************************/int cmsApiChgCardSetValue( pstCmsCardInfo, pstNewCardInfo )struct cmscardinfo * pstCmsCardInfo; /* 旧卡信息表结构 */struct cmscardinfo * pstNewCardInfo; /* 新卡信息表结构 */{ /* 定义 局部变量 */ int iRtn; /* 函数返回值 */ sprintf( g_acTrcMsg, "cmsApiChgCardSetValue begin " ); TRCLOG2 /* 将旧卡卡片信息中需要保留的信息传递给新卡 */ /* 账户序号 */ strcpy( pstNewCardInfo->acctseqno, pstCmsCardInfo->acctseqno ); /* 客户账号 主账号 */ strcpy( pstNewCardInfo->acctno, pstCmsCardInfo->acctno ); /* 款项代码 */ strcpy( pstNewCardInfo->subacct, pstCmsCardInfo->subacct ); /* 发卡机构 */ strcpy( pstNewCardInfo->issuebrc, pstCmsCardInfo->issuebrc ); /* 发卡柜员 */ strcpy( pstNewCardInfo->teller, pstCmsCardInfo->teller ); /* 客户号 */ strcpy( pstNewCardInfo->custno, pstCmsCardInfo->custno ); /* 旧卡是主卡 */ if ( pstCmsCardInfo->cardflg[ BIT1_LEN ] == MAIN_CARD ) strcpy( pstNewCardInfo->maincardno, pstNewCardInfo->cardno ); else /* 旧卡是附卡 */ strcpy( pstNewCardInfo->maincardno, pstCmsCardInfo->maincardno ); /* 发卡日期 */ strcpy( pstNewCardInfo->usedate, pstCmsCardInfo->usedate ); /* 有折标志 */ strcpy( pstNewCardInfo->hasbankbook,pstCmsCardInfo->hasbankbook ); /* 员工卡标志 */ strcpy( pstNewCardInfo->empflg, pstCmsCardInfo->empflg ); /* 旧卡号 */ /* 新卡号 */ /* 有效期 */ strcpy( pstNewCardInfo->validdate, pstCmsCardInfo->validdate ); /* 信用等级 2006/01/04 库表取消字段 modify by Feng strcpy( pstNewCardInfo->credlev, pstCmsCardInfo->credlev ); */ /* 年费标志 */ strcpy( pstNewCardInfo->yfeeflag, pstCmsCardInfo->yfeeflag ); /* 已收年费年份 2006/01/04 库表取消字段 modify by Feng strcpy( pstNewCardInfo->yfeeyear, pstCmsCardInfo->yfeeyear ); */ /* 工本费标志 */ strcpy( pstNewCardInfo->madfeeflag, pstCmsCardInfo->madfeeflag ); /* 对账单处理方式 */ strcpy( pstNewCardInfo->billway, pstCmsCardInfo->billway ); /* 对账单邮寄地址类型 */ strcpy( pstNewCardInfo->billaddtype,pstCmsCardInfo->billaddtype ); /* 卡片来源 */ strcpy( pstNewCardInfo->cardsrc, pstCmsCardInfo->cardsrc ); /* 地区代码 */ strcpy( pstNewCardInfo->areacode, pstCmsCardInfo->areacode ); /* 附卡张数 */ pstNewCardInfo->acdcnt = pstCmsCardInfo->acdcnt; /* 附卡交易限额 */ pstNewCardInfo->acdlmt = pstCmsCardInfo->acdlmt; /* 附卡已用金额 */ pstNewCardInfo->acduseamt = pstCmsCardInfo->acduseamt; /* 指定年费金额 */ pstNewCardInfo->yfee = pstCmsCardInfo->yfee; /* 未交年费总计 */ pstNewCardInfo->yfeebal = pstCmsCardInfo->yfeebal; /* 卡主帐户余额 */ pstNewCardInfo->currbal = pstCmsCardInfo->currbal; /* 卡主帐户可支用余额 */ pstNewCardInfo->availbal = pstCmsCardInfo->availbal; strcpy( pstNewCardInfo->cardflg, pstCmsCardInfo->cardflg ); strcpy( pstNewCardInfo->markflg, pstCmsCardInfo->markflg ); /* 卡状态保留位 */ pstNewCardInfo->cardstat[ BIT4_LEN ] = pstCmsCardInfo->cardstat[ BIT4_LEN ]; pstNewCardInfo->cardstat[ BIT11_LEN ]= pstCmsCardInfo->cardstat[ BIT11_LEN]; pstNewCardInfo->cardstat[ BIT12_LEN ]= pstCmsCardInfo->cardstat[ BIT12_LEN]; pstNewCardInfo->cardstat[ BIT13_LEN ]= pstCmsCardInfo->cardstat[ BIT13_LEN]; /* 新增加字段 Feng add in 2006-01-04 begin */ pstNewCardInfo->serverlevel = pstCmsCardInfo->serverlevel; strcpy( pstNewCardInfo->yearfeerank, pstCmsCardInfo->yearfeerank ); /* 新增加字段 Feng add in 2006-01-04 end */ sprintf( g_acTrcMsg, "cmsApiChgCardSetValue end " ); TRCLOG2 return SUCCESS;}/******************************************************* ** 函数名称:cmsApiChgCardSetAcct ** 功能描述:换卡更新卡账户对照表 ** 换卡时将旧卡的对照表复制给新卡号, ** 并修改原旧卡的帐户对照表中的记录为已换卡。 ** 输入参数: ** pstCmsCardInfo ---- 旧卡卡片信息结构 ** pstNewCardInfo ---- 新卡卡片信息结构 ** 输出参数: ** 返回结果:int ** 0 ---- 成功 ** -1 ---- 失败*******************************************************/int cmsApiChgCardSetAcct( pstCmsCardInfo, pstNewCardInfo )struct cmscardinfo * pstCmsCardInfo; /* 旧卡信息表结构 */struct cmscardinfo * pstNewCardInfo; /* 新卡信息表结构 */{ /* 定义 局部变量 */ struct cmsacctm stCmsAcctM; /* 旧卡帐户对照表结构 */ struct cmsacctm stNewAcctM; /* 新卡帐户对照表结构 */ int iRtn; /* 函数返回值 */ sprintf( g_acTrcMsg, "cmsApiChgCardSetAcct begin " ); TRCLOG2 /* 初始化卡帐户对照表结构 */ memset( &stCmsAcctM, 0x00, sizeof( struct cmsacctm ) ); memset( &stNewAcctM, 0x00, sizeof( struct cmsacctm ) ); /* 将旧卡号赋给旧卡账户对照表结构 */ strcpy( stCmsAcctM.cardno, pstCmsCardInfo->cardno ); /* 循环从旧卡账户对照表获取纪录并锁住纪录 */ pubStoVCmsacctm( &stCmsAcctM ); EXEC SQL DECLARE acc_l_cur CURSOR FOR SELECT * FROM CMSACCTM WHERE cardno = :cmsacctm_cardno FOR UPDATE; /* 定义游标出错 if ( SQLCODE ) { strcpy( g_acRspCode, "CMS110" ); pubCrtRspInfo( "cmsacctm", SQLCODE ); ERRLOG return FAILED; } */ SQLOPENCUR(acc_l_cur,"acc_l_cur") /* 打开游表出错 */ if ( SQLCODE ) { strcpy( g_acRspCode, "CMS111" ); pubCrtRspInfo( "cmsacctm", SQLCODE ); ERRLOG return FAILED; } while ( TRUE ) { pubInitCmsacctm(); EXEC SQL FETCH acc_l_cur INTO R_CMSACCTM ; /* 取游表出错 */ if ( SQLCODE && SQLCODE != SQLNOTFOUND ) { strcpy( g_acRspCode, "CMS112" ); pubCrtRspInfo( "cmsacctm", SQLCODE ); ERRLOG SQLCLOSECUR(acc_l_cur,"acc_l_cur") return FAILED; } /* 记录不存在 */ else if ( SQLCODE == SQLNOTFOUND ) break; /* 记录存在 */ pubVtoSCmsacctm( &stCmsAcctM ); /* 将旧卡账户对照表赋值到新卡账户对照表 */ memcpy( &stNewAcctM, &stCmsAcctM, sizeof( struct cmsacctm ) ); /* 修改新卡账户对照表中卡号 */ strcpy( stNewAcctM.cardno, pstNewCardInfo->cardno ); /* 插入新卡账户对照表 */ iRtn = pubInstCmsacctm( &stNewAcctM ); if ( iRtn ) { ERRLOG SQLCLOSECUR(acc_l_cur,"acc_l_cur") return FAILED; } /* 修改旧卡账户对照表 */ stCmsAcctM.status[ BIT1_LEN ] = CHGCARD_STS; /* 已经换卡 */ pubStoVCmsacctm( &stCmsAcctM ); EXEC SQL UPDATE CMSACCTM SET status = :cmsacctm_status WHERE CURRENT OF acc_l_cur; /* 修改出错 */ if ( SQLCODE ) { strcpy( g_acRspCode, "CMS114" ); pubCrtRspInfo( "cmsacctn", SQLCODE ); ERRLOG SQLCLOSECUR(acc_l_cur,"acc_l_cur") return FAILED; } } SQLCLOSECUR(acc_l_cur,"acc_l_cur") pubInitCmscardinfo(); strcpy( cmscardinfo_oldcardno, pstCmsCardInfo->cardno ); strcpy( cmscardinfo_newcardno, pstNewCardInfo->cardno ); /* 修改卡片交易限额表 */ EXEC SQL UPDATE cmstlimt SET cardno = :cmscardinfo_newcardno WHERE cardno = :cmscardinfo_oldcardno; if ( SQLCODE && SQLCODE != SQLNOTFOUND ) { strcpy( g_acRspCode, "CMS114" ); /* 数据库更新错误 */ pubCrtRspInfo( "cmstlimt",SQLCODE ); ERRLOG return FAILED; } /* 修改卡交易统计表 */ EXEC SQL UPDATE cmsttotal SET cardno = :cmscardinfo_newcardno WHERE cardno = :cmscardinfo_oldcardno; if ( SQLCODE && SQLCODE != SQLNOTFOUND ) { strcpy( g_acRspCode, "CMS114" ); /* 数据库更新错误 */ pubCrtRspInfo( "cmsttotal",SQLCODE ); ERRLOG return FAILED; } /* 修改卡账户顺序号表 */ EXEC SQL UPDATE cmscuststopm SET maincardno = :cmscardinfo_newcardno WHERE maincardno = :cmscardinfo_oldcardno; if ( SQLCODE && SQLCODE != SQLNOTFOUND ) { strcpy( g_acRspCode, "CMS114" ); /* 数据库更新错误 */ pubCrtRspInfo( "cmscuststopm",SQLCODE ); ERRLOG return FAILED; } EXEC SQL UPDATE cmscuststopm SET accecardno = :cmscardinfo_newcardno WHERE accecardno = :cmscardinfo_oldcardno; if ( SQLCODE && SQLCODE != SQLNOTFOUND ) { strcpy( g_acRspCode, "CMS114" ); /* 数据库更新错误 */ pubCrtRspInfo( "cmscuststopm",SQLCODE ); ERRLOG return FAILED; } sprintf( g_acTrcMsg, "cmsApiChgCardSetAcct end " ); TRCLOG2 return SUCCESS;}/********************************************************* 函数名称:cmsApiInsTranLog** 功能描述:卡非帐务交易登记子交易流水** 输入参数:** pstPubCom ---- 公共结构** pstCardInfo ---- 卡信息表结构** pstAcctm ---- 卡账户对照表结构** pcMemoCode ---- 摘要码** pcMemo ---- 摘要** 输出参数:** 返回结果:int** 0 ---- 成功** -1 ---- 失败*******************************************************/int cmsApiInsTranLog( pstPubCom, pstCardInfo, pstAcctm, pcMemoCode, pcMemo )PUBCOM * pstPubCom; /* 公共结构 */struct cmscardinfo * pstCardInfo; /* 卡信息表结构 */struct cmsacctm * pstAcctm; /* 卡账户对照表 */char * pcMemoCode; /* 摘要码 */char * pcMemo; /* 摘要 */{ /* 定义 局部变量 */ struct glssubtranslog stGlsLog; /* 子交易流水结构 */ int iRtn; /* 函数返回值 */ sprintf( g_acTrcMsg, "cmsApiInsTranLog begin " ); TRCLOG2 memset( &stGlsLog, 0x00, sizeof( struct glssubtranslog ) ); strcpy( stGlsLog.trandate, pstPubCom->acTranDate ); stGlsLog.serseqno = pstPubCom->lSerSeqNo; stGlsLog.ctxnseq = pstPubCom->iTxnSeq; strcpy( stGlsLog.trancode, pstPubCom->acTranCode ); strcpy( stGlsLog.subtrancode, pstPubCom->acSubTranCode ); strcpy( stGlsLog.submark, pstPubCom->acSubMark ); strcpy( stGlsLog.brc, pstPubCom->acBrc ); strcpy( stGlsLog.openbrc, pstCardInfo->issuebrc ); strcpy( stGlsLog.profitbrc, pstCardInfo->issuebrc ); strcpy( stGlsLog.teller, pstPubCom->acTeller ); strcpy( stGlsLog.rteller, pstPubCom->acRteller ); strcpy( stGlsLog.ateller, pstPubCom->acAteller ); strcpy( stGlsLog.acctno, pstAcctm->acctno ); strcpy( stGlsLog.subacctno, pstAcctm->subacct ); strcpy( stGlsLog.customerid, pstCardInfo->custno ); strcpy( stGlsLog.subsys, "CMS" ); strcpy( stGlsLog.transource, pstPubCom->acChannelId ); strcpy( stGlsLog.termcode, pstPubCom->acTermCode ); stGlsLog.termseq = pstPubCom->lTermSeq; strcpy( stGlsLog.termdate, pstPubCom->acTermDate ); strcpy( stGlsLog.termtime, pstPubCom->acTermTime ); strcpy( stGlsLog.effectdate, pstPubCom->acTranDate ); strcpy( stGlsLog.billdate, pstPubCom->acTranDate ); strcpy( stGlsLog.time, pstPubCom->acTranTime ); strcpy( stGlsLog.revsubtran, pstPubCom->acSubTranCode ); strcpy( stGlsLog.postflag, ZEROSTR ); stGlsLog.cancelstan = 0; strcpy( stGlsLog.trantype, ZEROSTR ); strcpy( stGlsLog.reviewflag, ZEROSTR ); strcpy( stGlsLog.cardno, pstCardInfo->cardno ); strcpy( stGlsLog.canceltransflag, ZEROSTR ); strcpy( stGlsLog.cancelflag, ZEROSTR ); strcpy( stGlsLog.cashtranflag, CASHSTR ); strcpy( stGlsLog.cdflag, DEBITSTR ); strcpy( stGlsLog.memocode, pcMemoCode ); strcpy( stGlsLog.memo, pcMemo ); /* 调用GLS子交易流水API */ if ( pubWrtTransLog ( pstPubCom, &stGlsLog ) ) { ERRLOG; return FAILED; } sprintf( g_acTrcMsg, "cmsApiInsTranLog end " ); TRCLOG2 return SUCCESS;}/******************************************************* ** 函数名称:cmsApiOpenCard ** 功能描述:开卡 ** 输入参数: ** pstPubCom ---- 公共PUBCOM ** pcCardNo ---- 卡号 ** pcCardKind ---- 卡片种类 ** pcCcy ---- 币种 ** pcAcctNo ---- 客户账号 ** pcSubAcct ---- 款项代码 ** pcAcctSeqNo ---- 账号序号 ** pcCustomId ---- 客户号 ** pcPasswd ---- 初始密码 ** pcUnitCode ---- 代理单位编号 ** pcOpnMode ---- 开卡方式 ** "1":有折开卡 ** "0":无折开卡 ** 输出参数: ** pcCardNo ---- 卡号 ** 返回结果:int ** 0 ---- 成功 ** -1 ---- 失败*******************************************************/int cmsApiOpenCard( pstPubcom,pcCardNo,pcCardKind,pcCcy,pcAcctNo,pcSubAcct,\ pcAcctSeqNo, pcCustomId, pcPasswd, pcUnitCode, pcOpnMode )struct pubcom * pstPubcom; /* 公共PUBCOM */char * pcCardNo; /* 卡号 */char * pcCardKind; /* 卡片种类 */char * pcCcy; /* 币种 */char * pcAcctNo; /* 客户账号 */char * pcSubAcct; /* 款项代码 */char * pcAcctSeqNo; /* 帐户序号 */char * pcCustomId; /* 客户号 */char * pcPasswd; /* 密码 */char * pcUnitCode; /* 代理单位编号 */char * pcOpnMode; /* 开卡方式 */{ /* 定义 局部变量 */ struct cmscardinfo stCmsCardInfo; /* 卡片信息表 */ struct cmscardkind stCmsCardKind; /* 卡片种类表 */ struct cmsacctm stCmsAcctM; /* 卡帐户对照表结构 */ struct ciscustomerinfo stCisInfo; /* 客户基本信息结构 */ int iRtn; /* 函数返回值 */ char acCheckFlag[ BIT8_LEN + 1 ]; /* 检查卡片种类标志 */ char acCardFlg[ FLAG_LEN+1 ]; /* 卡标志 长度2 */ /* 8:主卡 */ /* 6:附卡 */ char acSubTranCode[ TRANCODE_LEN + 1 ]; /* 子交易码 */ char acTranType[ BIT3_LEN ]; /* 发卡类型 长度2 */ /* 0:无折发卡 */ /* 1:有折发卡 */ /* 2:专用卡发卡 */ char acMemo[ MEMO_LEN + 1 ]; /* 备注 */ char acFlag4[ FLAG_LEN+1 ]; /* 自带卡标志长度2 */ /* 0:自带卡 */ /* 1:本行发卡 */ strcpy( g_acTrcMsg, "Api: cmsApiOpenCard处理开始.." ); TRCLOG2 sprintf( g_acTrcMsg, "卡号=[%s]", pcCardNo ); TRCLOG1 sprintf( g_acTrcMsg, "卡片种类=[%s]", pcCardKind ); TRCLOG1 sprintf( g_acTrcMsg, "币种=[%s]", pcCcy ); TRCLOG1 sprintf( g_acTrcMsg, "客户账号=[%s]", pcAcctNo ); TRCLOG1 sprintf( g_acTrcMsg, "款项账号=[%s]", pcSubAcct ); TRCLOG1 sprintf( g_acTrcMsg, "账户序号=[%s]", pcAcctSeqNo ); TRCLOG1 sprintf( g_acTrcMsg, "客户号=[%s]", pcCustomId ); TRCLOG1 sprintf( g_acTrcMsg, "密码=[%s]", pcPasswd ); TRCLOG1 sprintf( g_acTrcMsg, "单位编号=[%s]", pcUnitCode ); TRCLOG1 sprintf( g_acTrcMsg, "开卡方式=[%s]", pcOpnMode ); TRCLOG1 /* 初始化 */ memset( &stCmsCardInfo, 0x00, sizeof( struct cmscardinfo ) );
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -