📄 cms562.sqc
字号:
/********************************************************************** 源码文件名称 : cms562.SQC** 所属子系统 : CMS** 当前文件版本 : 4.0.0.0** 作者 : Feng** 版本创建日期 : 2006/01/21** 功能描述 : 欠费现金缴费** 修改记录 :** 修改人 修改日期 修改日期*********************************************************************/#include "code.h"#include "attrdef.h"#include "sysdef.h"#include "pubcom.h"#include "cmscode.h"#include <stdio.h>#include <fcntl.h>#include "cmscardinfo.h"#include "ciscustomerinfo.h"EXEC SQL INCLUDE SQLCA;int cmsCardYearFeePro( PUBCOM *pstPubcom ){ /*定义局部变量*/ struct cmscardinfo stCmsCardInfo; /* 卡片信息表 */ struct ciscustomerinfo stCisCustInfo; /* 客户信息表 */ char acCardStat[BIT21_LEN][BIT11_LEN]; /*卡状态检查标志*/ char acCardNo[CARDNO_LEN + 1]; /* 卡号 */ char acCardKind[CARDKIND_LEN + 1]; /* 卡号 */ char acTrack2[ TRACK2_LEN + 1 ]; /* 二磁道 */ char acTrack3[ TRACK3_LEN + 1 ]; /* 三磁道 */ int iNumx=0; int iNumy = 0; int iRtn; strcpy( g_acTrcMsg, "子交易: 欠费现金缴费子交易开始.." ); TRCLOG4 /* 初始化 */ memset( &stCmsCardInfo, 0x00, sizeof( struct cmscardinfo ) ); memset( &stCisCustInfo, 0x00, sizeof( struct ciscustomerinfo ) ); memset( acCardNo, 0x00, sizeof( acCardNo ) ); memset( acCardStat, 0x00, sizeof ( acCardStat ) ); memset( acTrack2, 0x00, sizeof( acTrack2 ) ); memset( acTrack3, 0x00, sizeof( acTrack3 ) ); /* 取数据字典值 */ getstring( "CardNo", acCardNo ); getstring( "Track2", acTrack2 ); sprintf( g_acTrcMsg, "磁道2[%s]", acTrack2 ); TRCLOG1 getstring( "Track3", acTrack3 ); sprintf( g_acTrcMsg, "磁道3[%s]", acTrack3 ); TRCLOG1 sprintf( g_acTrcMsg,"CardNo[%s]",acCardNo ); TRCLOG3 /* 从卡片信息表获取纪录 */ if( cmsApiGetCmsCardInfo( acCardNo, &stCmsCardInfo ) ) { ERRLOG return FAILED; } strcpy( g_acTrcMsg, "stCmsCardInfo" ); TRCLOG3; /* 卡检查状态数组除首位外全置为不检查 */ for ( iNumx = 0; iNumx < BIT21_LEN; iNumx ++ ) for ( iNumy = 0; iNumy < BIT11_LEN; iNumy ++ ) { if ( iNumy == 0 ) acCardStat[iNumx][iNumy] = CHECK_YES; else acCardStat[iNumx][iNumy] = CHECK_NO; } acCardStat[ BIT2_LEN ] [ BIT2_LEN ] = CHECK_YES; acCardStat[ BIT2_LEN ] [ BIT3_LEN ] = CHECK_YES; acCardStat[ BIT3_LEN ] [ BIT2_LEN ] = CHECK_YES; acCardStat[ BIT3_LEN ] [ BIT3_LEN ] = CHECK_YES; acCardStat[ BIT4_LEN ] [ BIT2_LEN ] = CHECK_YES; acCardStat[ BIT5_LEN ] [ BIT2_LEN ] = CHECK_YES; acCardStat[ BIT6_LEN ] [ BIT2_LEN ] = CHECK_YES; acCardStat[ BIT7_LEN ] [ BIT2_LEN ] = CHECK_YES; acCardStat[ BIT9_LEN ] [ BIT2_LEN ] = CHECK_YES; acCardStat[ BIT10_LEN ] [ BIT2_LEN ] = CHECK_YES; acCardStat[ BIT11_LEN ] [ BIT2_LEN ] = CHECK_YES; acCardStat[ BIT12_LEN ] [ BIT2_LEN ] = CHECK_YES; acCardStat[ BIT13_LEN ] [ BIT2_LEN ] = CHECK_YES; acCardStat[ BIT13_LEN ] [ BIT1_LEN ] = CHECK_NO; acCardStat[ BIT14_LEN ] [ BIT2_LEN ] = CHECK_YES; acCardStat[ BIT14_LEN ] [ BIT3_LEN ] = CHECK_YES; acCardStat[ BIT14_LEN ] [ BIT4_LEN ] = CHECK_YES; acCardStat[ BIT15_LEN ] [ BIT2_LEN ] = CHECK_YES; /* 检查卡状态是否正常 */ iRtn = cmsApiChkCardStatIsNormal( &stCmsCardInfo, acCardStat ); if ( iRtn ) { ERRLOG return FAILED; } strcpy( g_acTrcMsg, "检查卡状态是否正finish" ); TRCLOG1 strcpy( stCisCustInfo.customid, stCmsCardInfo.custno ); iRtn = pubReadCiscustomerinfo( &stCisCustInfo ) ; if ( iRtn ) { ERRLOG return FAILED; } /* 子交易出口 */ setstring( "CustomId", stCisCustInfo.customid ); /*客户号*/ setstring( "YFeeFlag", stCmsCardInfo.yfeeflag); /*是否要缴年费*/ setstring( "FeeYear", stCmsCardInfo.yfeeyear); /*已收取年费的年份*/ setstring( "YFeeRank", stCmsCardInfo.yearfeerank); /*年费级别*/ setdouble( "Amt3", &stCmsCardInfo.yfee); /*指定年费金额*/ setdouble( "Amt4", &stCmsCardInfo.yfeebal); /*未交年费总计*/ setstring( "IdType", stCisCustInfo.idtype ); /*证件类型*/ setstring( "IdNo", stCisCustInfo.idno ); /*证件号码*/ setstring( "CustomName", stCisCustInfo.customname ); /*客户名称*/ setstring( "CustomType", stCisCustInfo.customtype ); /*客户类别*/ /* 修改卡片信息表 */ strncpy( stCmsCardInfo.yfeeyear, pstPubcom->acTranDate, 4 ); stCmsCardInfo.yfeeyear[ 4 ] = '\0'; stCmsCardInfo.yfeebal = 0.0; stCmsCardInfo.cardstat[ BIT13_LEN ] = BIT13_CARDOK; iRtn = pubModiCmscardinfo( &stCmsCardInfo ); if ( iRtn ) { ERRLOG return FAILED; } strcpy( g_acTrcMsg, "子交易: 欠费现金缴费结束.." ); TRCLOG4 strcpy( g_acRspCode, RSP_OK ); return SUCCESS;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -