本文整理汇总了C++中des2src函数的典型用法代码示例。如果您正苦于以下问题:C++ des2src函数的具体用法?C++ des2src怎么用?C++ des2src使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了des2src函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: F846315
int F846315(TRUSERID *handle,int iRequest,ST_PACK *rPack,int *pRetCode,char *szMsg)
{
int ret=0;
CAccTrans *pAccTrans=CAccTrans::getInstance();
des2src(pAccTrans->trans.opercode,rPack->semp);
if(strlen(pAccTrans->trans.opercode)<1)
{
pAccTrans->trans.termid=rPack->lwithdraw_flag;
}
pAccTrans->trans.transcode=TC_TRANSREV;
ret=pAccTrans->InitTrans();
if(ret)
return ret;
// TRANS& trans=pAccTrans->trans;
ST_CPACK aPack;
ST_PACK *outPack = &(aPack.pack);
ResetNormalCPack(&aPack,0,1);
char oldaccdate[9]="";
des2src(oldaccdate,rPack->sdate3);
int oldtermid=rPack->lwithdraw_flag;
int oldtermseqno=rPack->lserial1;
char authrightflag=rPack->sstatus2[0];
if(strlen(oldaccdate)<1)
return E_INPUTNULL_ACCDATE;
if(oldtermid<1)
return E_INPUTNULL_TERMID;
if(oldtermseqno<1)
return E_INPUTNULL_TERMSEQNO;
des2src(pAccTrans->trans.chkopercode,rPack->semp_no);
if('1'==authrightflag)
{
ret=chk_oper_pwd(pAccTrans->trans.chkopercode,rPack->scust_limit);
if(ret)
return ret;
ret=AccTransRev(oldaccdate,oldtermid,oldtermseqno);
if(ret)
{
writelog(LOG_ERR,"acctransrev err ret=%d",ret);
return ret;
}
}
else
{
ret=OnlineTransRev(oldaccdate,oldtermid,oldtermseqno);
if(ret)
{
writelog(LOG_ERR,"acctransrev err ret=%d",ret);
return ret;
}
}
SetCol(handle,F_LVOL0,F_LVOL8,F_SDATE3,F_STIME3,F_SEMP,F_LSERIAL1,F_VSMESS,0);
outPack->lvol0=pAccTrans->trans.cardno;
outPack->lvol8=0;
des2src(outPack->sdate3,pAccTrans->trans.accdate);
des2src(outPack->stime3,pAccTrans->trans.acctime);
des2src(outPack->semp,pAccTrans->trans.opercode);
outPack->lserial1=pAccTrans->trans.termseqno;
strcpy(outPack->vsmess,pAccTrans->remark.c_str());
PutRow(handle,outPack,pRetCode,szMsg);
return 0;
}
示例2: F846314
int F846314(TRUSERID *handle,int iRequest,ST_PACK *rPack,int *pRetCode,char *szMsg)
{
int ret=0;
CAccTrans *pAccTrans=CAccTrans::getInstance();
// ret=pAccTrans->checkCfgUpdate();
// if(ret)
// return ret;
des2src(pAccTrans->trans.opercode,rPack->semp);
pAccTrans->trans.transcode=TC_CARDDRAW;
ret=pAccTrans->InitTrans();
if(ret)
return ret;
TRANS& trans=pAccTrans->trans;
ST_CPACK aPack;
ST_PACK *outPack = &(aPack.pack);
ResetNormalCPack(&aPack,0,1);
SetCol(handle,0);
trans.cardflag=1;
trans.usecardflag=1;
trans.cardno=rPack->lvol0;
trans.purseno=PURSE_NO_ONE;
trans.paycnt=rPack->lvol6+1;
trans.cardbefbal=rPack->lvol7/100.0;
trans.cardaftbal=trans.cardbefbal;
// trans.fundtype=PAYTYPE_CASH;
des2src(trans.cardphyid,rPack->sstation0);
trans.inputamt=rPack->damt0;
trans.unusedamt = trans.inputamt;
if(amtcmp(trans.inputamt,trans.cardbefbal)>0)
{
return ERRINFO(E_CARD_BALANCE_SHORTAGE,trans.cardbefbal);
}
T_t_card tCard;
memset(&tCard,0,sizeof(tCard));
ret=doCard(trans,tCard);
if(ret)
{
return ret;
}
// ret=UpdateCardBitmap(trans.cardno,trans.cardcnt,CARDBITMAPTYPE_DEC,0);
// if(ret)
// return ret;
T_t_account tCardAccount;
memset(&tCardAccount,0,sizeof(tCardAccount));
ret=DB_t_account_read_by_accno(tCard.accno,&tCardAccount);
if(ret)
{
writelog(LOG_ERR,"cardno[%d]",tCard.cardno);
if(DB_NOTFOUND==ret)
return ERRINFO(E_NOTEXIST_CARDACCNO,tCard.accno);
else
return E_DB_ACCOUNT_R;
}
if(tCardAccount.status[0]!=STATUS_NORMAL)
{
return ERRINFO(E_CARDACC_LOGOUT,tCardAccount.accno);
}
if(tCardAccount.lastpaycnt>trans.paycnt)
{
return ERRINFO(E_CARDCNT_LT_LASTCARDCNT,trans.paycnt,tCardAccount.lastpaycnt);
}
strcpy(trans.cardaccno,tCardAccount.accno);
trans.feetype=tCard.feetype;
trans.custid=tCard.custid;
strcpy(trans.draccno,tCardAccount.accno);
ret=pAccTrans->doTrans();
if(ret)
return ret;
ret=pAccTrans->doTransEnd();
if(ret)
return ret;
T_t_transdtl transdtl;
memset(&transdtl,0,sizeof(transdtl));
des2src(transdtl.transdate,trans.transdate);
des2src(transdtl.transtime,trans.transtime);
strcpy(transdtl.accdate,trans.accdate);
strcpy(transdtl.acctime,trans.acctime);
transdtl.termid=trans.termid;
transdtl.termseqno=trans.termseqno;
transdtl.transcode=trans.transcode;
// transdtl.paytype=trans.fundtype;
// des2src(transdtl.voucherno,trans.voucherno);
transdtl.cardno=trans.cardno;
transdtl.purseno=trans.purseno;
transdtl.transflag =TF_PAY;
transdtl.cardcnt=trans.paycnt;
transdtl.cardbefbal=trans.cardbefbal;
transdtl.cardaftbal=trans.cardaftbal;
transdtl.amount=trans.totaltransamt;
transdtl.managefee=trans.totalfeeamt;
transdtl.custid=tCardAccount.custid;
des2src(transdtl.custname,tCardAccount.accname);
des2src(transdtl.opercode,trans.opercode);
transdtl.status[0]=DTLSTATUS_SUCCESS;
transdtl.showcardno=atol(tCard.showcardno);
GetStuempnoByCustid(transdtl.custid,transdtl.stuempno);
//.........这里部分代码省略.........
示例3: F846334
int F846334(TRUSERID *handle,int iRequest,ST_PACK *rPack,int *pRetCode,char *szMsg)
{
int ret=0;
CAccTrans *pAccTrans=CAccTrans::getInstance();
des2src(pAccTrans->trans.opercode,rPack->semp);
pAccTrans->trans.transcode=TC_EACCDRAW;
ret=pAccTrans->InitTrans();
if(ret)
return ret;
TRANS& trans=pAccTrans->trans;
ST_CPACK aPack;
ST_PACK *outPack = &(aPack.pack);
ResetNormalCPack(&aPack,0,1);
SetCol(handle,0);
des2src(trans.eaccno,rPack->sbank_acc);
if(!strlen(trans.eaccno))
return E_INPUTNULL_ACCNO;
//去帐户信息
T_t_netacc eaccount;
memset(&eaccount,0,sizeof(eaccount));
ret=DB_t_netacc_read_by_accno(trans.eaccno,&eaccount);
if(ret)
{
writelog(LOG_ERR,"accno[%s]",trans.eaccno);
if(DB_NOTFOUND==ret)
return E_NOTEXIST_EACCNO;
else
return E_DB_ACCOUNT_R;
}
if(eaccount.status[0]!=STATUS_NORMAL)
{
return E_EACCNO_LOGOUT;
}
char seedkey[33]="";
char inpwd_crypt[65]="";
char inpwd_plain[65]="";
char dbpwd_plain[65]="";
des2src(inpwd_crypt,rPack->snote2);
if(!strlen(inpwd_crypt))
return E_PWD_NULL;
ret=GetSysParaVal(GLOBLE_SYSPARA_STATIC_KEY,seedkey);
if(ret)
return ret;
ret=decrypt_elec_card_pwd(0,seedkey,inpwd_crypt,inpwd_plain);
if(ret)
return E_EACCPWD;
ret=decrypt_elec_card_pwd(0,seedkey,eaccount.accpwd,dbpwd_plain);
if(ret)
return E_PWD_DECRYPT;
if(strcmp(inpwd_plain,dbpwd_plain)!=0)
return E_EACCPWD;
if(eaccount.stoppayflag[0]=='1')
return E_EACC_STOPPAY;
pAccTrans->trans.inputamt=rPack->damt0;
pAccTrans->trans.unusedamt = trans.inputamt;
if(amtcmp(pAccTrans->trans.inputamt,0)==0)
return E_INPUT_AMT_NULL;
if(amtcmp(pAccTrans->trans.inputamt,eaccount.balance)>0)
return E_BALANCE_SHORTAGE;
// 创建账号
pAccTrans->trans.custid=eaccount.custid;
pAccTrans->trans.fundtype=0;
ret=pAccTrans->doTrans();
if(ret)
return ret;
SetCol(handle,F_LVOL0,F_LVOL8,F_SDATE3,F_SEMP,F_LWITHDRAW_FLAG,F_LSERIAL1,F_VSMESS,0);
des2src(outPack->sdate3,pAccTrans->trans.accdate);
des2src(outPack->semp,trans.opercode);
outPack->lwithdraw_flag=trans.termid;
outPack->lserial1=trans.termseqno;
sprintf(outPack->vsmess,"%s %s 帐户余额:%.2f元",eaccount.accname,pAccTrans->remark.c_str(),pAccTrans->trans.draccaftbal);
des2src(trans.remark,outPack->vsmess);
PutRow(handle,outPack,pRetCode,szMsg);
return 0;
}
示例4: DoCardInsteadCancel
//取消换卡
static int DoCardInsteadCancel(TRUSERID *handle,ST_PACK *rPack,int *pRetCode,char *szMsg)
{
int ret=0;
CAccTrans *pAccTrans=CAccTrans::getInstance();
TRANS& trans=pAccTrans->trans;
ST_CPACK aPack;
ST_PACK *outPack = &(aPack.pack);
ResetNormalCPack(&aPack,0,1);
SetCol(handle,0);
SetCol(handle,F_LVOL1,F_LSAFE_LEVEL2,F_LVOL4,F_LVOL5,
F_SALL_NAME,F_SPAGER,F_SCERT_NO,
F_SEMAIL2,F_SMARKET_CODE,F_SDATE0,
F_LVOL0,F_STX_PWD,F_LVOL8,F_LVOL6,F_LSAFE_LEVEL,F_SMARKET_CODE2,F_SHOLDER_AC_NO,
F_SORDER0,F_SEMP,F_SDATE3,F_STIME3,F_LVOL11,F_LVOL12,
F_LWITHDRAW_FLAG,F_LSERIAL1,F_VSMESS,F_SNAME2,0);
T_t_card tCard;
memset(&tCard,0,sizeof(tCard));
ret=DB_t_card_read_by_cardno(trans.cardno,&tCard);
if(ret)
{
if(DB_NOTFOUND==ret)
return ERRINFO(E_NOTEXIST_CARDNO,trans.cardno);
else
return E_DB_CARD_R;
}
if(tCard.status[0]!=STATUS_NORMAL)
{
return ERRINFO(E_CARD_LOGOUT,trans.cardno);
}
if('1'==tCard.frozeflag[0])
{
return ERRINFO(E_CARD_FREEZE,trans.cardno);
}
if('1'==tCard.lossflag[0])
{
return ERRINFO(E_CARD_LOST,trans.cardno);
}
if('1'==tCard.badflag[0])
{
return ERRINFO(E_CARD_BADRECORD,trans.cardno);
}
T_t_account tCardAccount;
memset(&tCardAccount,0,sizeof(tCardAccount));
ret=DB_t_account_read_by_accno(tCard.accno,&tCardAccount);
if(ret)
{
if(DB_NOTFOUND==ret)
return ERRINFO(E_NOTEXIST_CARDACCNO,tCard.accno);
else
return E_DB_ACCOUNT_R;
}
T_t_customer customer;
memset(&customer,0,sizeof(customer));
if(tCard.custid)
{
ret=DB_t_customer_read_by_custid(tCard.custid,&customer);
if(ret)
{
if(DB_NOTFOUND==ret)
return ERRINFO(E_NOTEXIST_CUSTOMER,tCard.custid);
else
return E_DB_CUSTOMER_R;
}
}
char cardpwd[33]="";
char key[17]="";
strcpy(key,STATIC_SEED_KEY);
EncodePwd(key,cardpwd,tCard.cardpwd, 1);
T_t_cardinsteaddtl cardinsteaddtl;
memset(&cardinsteaddtl,0,sizeof(cardinsteaddtl));
ret=DB_t_cardinsteaddtl_read_lock_by_c0_and_cardno(trans.cardno,&cardinsteaddtl);
if(ret)
{
if(DB_NOTFOUND==ret)
return E_DB_CARDINSTEADDTL_N;
else
return E_DB_CARDINSTEADDTL_R;
}
if(cardinsteaddtl.status[0]==STATUS_NORMAL)
{
T_t_transdtl transdtl;
memset(&transdtl,0,sizeof(transdtl));
des2src(transdtl.transdate,trans.transdate);
des2src(transdtl.transtime,trans.transtime);
des2src(transdtl.accdate,pAccTrans->trans.accdate);
des2src(transdtl.acctime,trans.acctime);
transdtl.termid=trans.termid;
transdtl.termseqno=trans.termseqno;
transdtl.transcode=trans.transcode;
transdtl.paytype=trans.fundtype;
des2src(transdtl.voucherno,trans.voucherno);
transdtl.cardno=trans.cardno;
//.........这里部分代码省略.........
示例5: F847183
int F847183(TRUSERID *handle, int iRequest, ST_PACK *rPack, int *pRetCode, char *szMsg)
{
int ret = 0;
char tx_date[8+1] = ""; //发生日期
// char tx_time[6+1]=""; //发生时间
int cardno = 0; //卡号
char deviceid[8+1] = ""; //终端机ID
int serial_no = 0; //终端机流水号
int flag = 0;
double iSeqNo = 0;
T_t_tif_tradeserial tOldTradeserial; //当日流水表
T_t_tif_tradeserial tTradeserial; //当日流水表
T_t_tif_tradeserial_his tTradeserialhis; //历史流水表
T_t_tradecode tTradeCode;
T_t_card tCard;
char sysdate[11] = "";
char systime[9] = "";
char sYear[5] = "";
char sMonDay[5] = "";
char logic_date[9] = "";
int days = 0;
ST_CPACK aPack;
ST_PACK *out_pack = &(aPack.pack);
ST_PACK next_pack;
ResetNormalCPack(&aPack, 0, 1);
memset(&tTradeserial, 0, sizeof(tTradeserial));
memset(&tOldTradeserial, 0, sizeof(tOldTradeserial));
memset(&tTradeserialhis, 0, sizeof(tTradeserialhis));
memset(&tTradeCode, 0, sizeof tTradeCode);
memset(&tCard, 0, sizeof tCard);
getsysdate(sysdate);
getsystime(systime);
des2src(tTradeserial.enteract_time, systime);
des2src(tx_date, rPack->sbank_pwd);
// des2src(tx_time,rPack->sbank_code);
cardno = rPack->lvol0;
des2src(deviceid, rPack->sbank_pwd2);
serial_no = rPack->lvol1;
trim(rPack->scust_limit);
trim(rPack->scust_limit2);
trim(rPack->semp_pwd);
des2src(sYear, tx_date);
des2src(sMonDay, tx_date + 4);
if (strlen(rPack->scust_limit) == 0)
{
*pRetCode = E_OPER_NOT_EXIST;
goto L_RETU;
}
if (strlen(rPack->scust_limit2) == 0)
{
*pRetCode = E_INPUT_AUTH_OPER_NULL;
goto L_RETU;
}
if (strcmp(rPack->scust_limit, rPack->scust_limit2) == 0)
{
writelog(LOG_ERR, "oper[%s]auth_oper[%s]", rPack->scust_limit, rPack->scust_limit2);
*pRetCode = E_OPER_AND_AUTH_OPER_EQ;
goto L_RETU;
}
ret = chk_oper_pwd(rPack->scust_limit2, rPack->semp_pwd);
if (ret)
{
if (E_OPER_NOT_EXIST == ret)
*pRetCode = E_AUTH_OPER_NOT_EXIST;
else if (E_PASSWORD_WRONG == ret)
*pRetCode = E_AUTH_OPER_PWD;
else
*pRetCode = ret;
goto L_RETU;
}
ret = DB_t_card_read_by_cardno(cardno, &tCard);
if (ret)
{
if (DB_NOTFOUND == ret)
*pRetCode = E_CARDNO_NOT_EXIST;
else
*pRetCode = E_DB_CARD_R;
goto L_RETU;
}
if (tCard.cardattr[CARDSTAT_TYPE_REG] == '2')
{
writelog(LOG_ERR, "冲正交易卡号已注销cardid[%d]", tCard.cardno);
*pRetCode = E_ACTNO_LOGOUT;
goto L_RETU;
}
//查询当前流水表
ret = DB_t_tif_tradeserial_read_lock_by_c4_and_operate_date_and_serial_no_and_cardno(tx_date, serial_no, cardno, &tOldTradeserial);
if (ret)
{
writelog(LOG_ERR, "tx_date[%s]serial_no[%d]ret[%d]", tx_date, serial_no, ret);
if (DB_NOTFOUND != ret)
{
*pRetCode = E_DB_TRADESERIAL_R;
goto L_RETU;
}
}
//.........这里部分代码省略.........
示例6: F250001
int F250001(TRUSERID *handle,int iRequest,ST_PACK *rPack,int *pRetCode,char *szMsg)
{
int ret=0;
char host[16]=""; //对方机器的ip
short port=0;
ST_CPACK aPack;
ST_PACK *out_pack = &(aPack.pack);
//char senddata[327]="";
//char rcvdata[327]="";
CTcpSocket tcpsocket ;
ext_phone_trans_t PhoneTrans;
//memset(senddata,0x20,sizeof senddata);
//memset(rcvdata,0x20,sizeof rcvdata);
ResetNormalCPack(&aPack,0,1);
SetCol(handle,0);
SetCol(handle,F_SSECTYPES,0);
des2src(host,rPack->scust_auth);
port=rPack->lvol0;
memset(&PhoneTrans,0,sizeof(PhoneTrans));
memcpy(&PhoneTrans, rPack->ssectypes,127);
memset(PhoneTrans.plugdata,0x20,sizeof(PhoneTrans.plugdata));
memcpy(PhoneTrans.signcheck,gSignCheck,strlen(gSignCheck));
//writelog(LOG_ERR,"package_send=[%s] ",rPack->ssectypes);
writelog(LOG_INFO,"Connect to boss system ip_addr[%s],port[%d] ",host,port);
ret = tcpsocket.ConnectTcp(host, port);
if(!ret)
{
writelog(LOG_ERR,"Connect to boss system error,error code is [%d],ip_addr[%s],port[%d] ",ret,host,port);
*pRetCode=E_MOBILE_TRANS_CONNECT;
goto l_ret;
}
printf("send:[%s]\n",(char*)&PhoneTrans);
ret = tcpsocket.Send((char*)&PhoneTrans,sizeof(PhoneTrans));
if (ret<0)
{
// 发送时,端口有问题,包括被关闭
writelog(LOG_ERR,"Send to boss system error,error code is [%d] ",ret);
*pRetCode=E_MOBILE_TRANS_REQUEST;
goto l_ret;
}
else if(0==ret){
// 不应该出现这种情况
writelog(LOG_ERR,"Send to boss system error,CTcpSocket.Send should not return this error,error code is[%d]!\n",ret);
*pRetCode=E_MOBILE_TRANS_REQUEST;
goto l_ret;
}
memset(&PhoneTrans,0,sizeof(PhoneTrans));
if(rPack->lvol1==1)
{
ret = tcpsocket.Recv((char*)&PhoneTrans, sizeof(PhoneTrans), 15000);
tcpsocket.Close();
if (ret!=327)
{
writelog(LOG_ERR,"Receive from boss system error,error code is [%d] ",ret);
*pRetCode=E_MOBILE_TRANS_TIME_OUT;
goto l_ret; // 接收时候出错,或超时
}
printf("trans recv:[%s]\n",(char*)&PhoneTrans);
// memcpy(out_pack->ssectypes,&PhoneTrans,127);
if(strncmp(PhoneTrans.retnum,"00",2)!=0)
{
if(strncmp(PhoneTrans.retnum,"01",2)==0)
{
writelog(LOG_ERR,"trans error,mac error,ret[%s] ",PhoneTrans.retnum);
*pRetCode=E_MOBILE_CHECK_MAC;
goto l_ret;
}
if(strncmp(PhoneTrans.retnum,"02",2)==0)
{
writelog(LOG_ERR,"trans falied ret[%s] ",PhoneTrans.retnum);
*pRetCode=E_MOBILE_TRANS_FAILURE;
goto l_ret;
}
}
else
{
writelog(LOG_INFO,"trans success ret[%s] ","00");
}
}else{
ret=tcpsocket.Recv((char*)&PhoneTrans, sizeof(PhoneTrans), 15000);
tcpsocket.Close();
if (ret!=327)
{
writelog(LOG_ERR,"Receive from boss system error,error code is [%d] ",ret);
*pRetCode=E_MOBILE_TRANS_TIME_OUT;
goto l_ret; // 接收时候出错,或超时
}
printf("query recv:[%s]\n",(char*)&PhoneTrans);
// memcpy(out_pack->ssectypes,&PhoneTrans,127);
if(strncmp(PhoneTrans.retnum,"00",2)!=0)
{
if(strncmp(PhoneTrans.retnum,"01",2)==0)
//.........这里部分代码省略.........
示例7: SaveOldCardInfo
static int SaveOldCardInfo(TRUSERID *handle,ST_PACK *rPack,int *pRetCode,char *szMsg)
{
int ret=0;
CAccTrans *pAccTrans=CAccTrans::getInstance();
TRANS& trans=pAccTrans->trans;
T_t_card tCard;
memset(&tCard,0,sizeof(tCard));
ret=DB_t_card_read_by_cardno(trans.cardno,&tCard);
if(ret)
{
if(DB_NOTFOUND==ret)
return ERRINFO(E_NOTEXIST_CARDNO,trans.cardno);
else
return E_DB_CARD_R;
}
if(tCard.status[0]!=STATUS_NORMAL)
{
return ERRINFO(E_CARD_LOGOUT,trans.cardno);
}
if('1'==tCard.frozeflag[0])
{
return ERRINFO(E_CARD_FREEZE,trans.cardno);
}
if('1'==tCard.lossflag[0])
{
return ERRINFO(E_CARD_LOST,trans.cardno);
}
if('1'==tCard.badflag[0])
{
return ERRINFO(E_CARD_BADRECORD,trans.cardno);
}
//比较卡物理ID是否相同
if(strcmp(tCard.cardphyid,trans.cardphyid)!=0)
{
writelog(LOG_ERR,"db cardphyid[%s],input cardphyid[%s]",tCard.cardphyid,trans.cardphyid);
return E_CARD_PHYNO_DIFFER;
}
T_t_account tCardAccount;
memset(&tCardAccount,0,sizeof(tCardAccount));
ret=DB_t_account_read_lock_by_c0_and_accno(tCard.accno,&tCardAccount);
if(ret)
{
if(DB_NOTFOUND==ret)
return ERRINFO(E_NOTEXIST_CARDACCNO,tCard.accno);
else
return E_DB_ACCOUNT_R;
}
int existflag=0;
ret=IsExistUnGetSubsidy(tCard.cardno,&existflag);
if(ret)
{
return ret;
}
if(existflag)
{
ERRTIP("有未领补助,请领取补助后再换卡");
return E_COMMON_ERR;
}
ret=DB_t_cardinsteaddtl_del_by_cardno(trans.cardno);
if(ret)
{
if(DB_NOTFOUND!=ret)
return E_DB_CARDINSTEADDTL_R;
}
T_t_cardinsteaddtl cardinsteaddtl;
memset(&cardinsteaddtl,0,sizeof(cardinsteaddtl));
des2src(cardinsteaddtl.accdate,pAccTrans->trans.accdate);
cardinsteaddtl.termid = trans.termid;
cardinsteaddtl.termseqno = trans.termseqno;
cardinsteaddtl.cardno = trans.cardno;
cardinsteaddtl.oldcardtype=tCard.cardtype;
des2src(cardinsteaddtl.oldcardphyid,trans.cardphyid);
des2src(cardinsteaddtl.oldshowcardno,tCard.showcardno);
cardinsteaddtl.oldcardcnt = trans.paycnt;
cardinsteaddtl.oldcardbal = trans.cardbefbal;
cardinsteaddtl.oldsubsidyno=trans.cardsubsidyno;
cardinsteaddtl.revflag[0]='0';
cardinsteaddtl.status[0]=STATUS_NORMAL;
ret=DB_t_cardinsteaddtl_add(&cardinsteaddtl);
if(ret)
{
if(DB_REPEAT==ret)
return E_DB_CARDINSTEADDTL_E;
else
return E_DB_CARDINSTEADDTL_I;
}
T_t_cardver cardver;
memset(&cardver,0,sizeof(cardver));
cardver.cardno=tCard.cardno;
des2src(cardver.accdate,pAccTrans->trans.accdate);
cardver.termid=trans.termid;
cardver.termseqno=trans.termseqno;
cardver.status[0]=STATUS_NORMAL;
des2src(cardver.cardphyid,cardinsteaddtl.cardphyid);
//.........这里部分代码省略.........
示例8: F847104
int F847104(TRUSERID *handle,int iRequest,ST_PACK *rPack,int *pRetCode,char *szMsg)
{
int ret =0;
int len = 0;
int i=0;
int hi_cutid=0;
char h_showcardid[11] = ""; //显示卡号
char h_password[7] = ""; //卡密码
double h_temp_Card_id = 0; //卡号
double dSerialNo=0;
char seed_key[17] = ""; //种子密钥
char card_endtime[8 + 1] = ""; //卡的有效截至日期
char logicdate[11]=""; //业务日期
char sysdate[11]="";
char systime[9]="";
char sEndDate[9]="";
char sMsg[256]="";
char sMaxCardBalance[20]="";
char lost_date[11]="";
double dMaxCardBalance=0;
int lost_card_id=0;
T_t_pif_card tCard;
T_t_pif_card tOldCard;
T_t_cif_customer tCustomer;
T_t_pif_spefee tSpeFee;
// T_t_pif_cardlossinfo tCardLossInfo;
T_t_tif_tradeserial tradeserial;
T_t_aif_account tAccount;
InAcc IA;
ST_CPACK aPack;
ST_PACK *out_pack = &(aPack.pack);
ResetNormalCPack(&aPack,0,1);
SetCol(handle,0);
SetCol(handle,F_LVOL0,F_LVOL1,F_LVOL5,
F_SCUST_NO, F_SCUST_NO2,F_SCUST_AUTH,F_SCUST_AUTH2,
F_SDATE0,F_SNAME,F_SNAME2,
F_SOPEN_EMP,F_SSTATUS0,
F_DAMT2,F_LSERIAL1,F_VSMESS,0);
memset(&tCard,0,sizeof(tCard));
memset(&tOldCard,0,sizeof(tOldCard));
memset(&tCustomer,0,sizeof(tCustomer));
memset(&tSpeFee,0,sizeof(tSpeFee));
// memset(&tCardLossInfo,0,sizeof(tCardLossInfo));
memset(&tAccount,0,sizeof(tAccount));
memset(&tradeserial,0,sizeof(tradeserial));
memset(&IA,0,sizeof(IA));
getsysdate(sysdate);
getsystime(systime);
ret=GetLogicDate(logicdate); //业务日期
if(ret)
{
*pRetCode=ret;
goto L_RETU;
}
//检查客户信息,判断是否可以发行卡
hi_cutid=rPack->lvol0; //客户号
des2src(tCard.physical_no, rPack->sbank_acc); //物理卡号
trim(h_showcardid);
ret=IsExistFreezeCardByCustomId(hi_cutid);
if(ret)
{
*pRetCode = ret;
goto L_RETU;
}
ret=IsExistNoLostCardByCustomId(hi_cutid);
if(ret)
{
*pRetCode = ret;
goto L_RETU;
}
if(strlen(h_showcardid))
{
ret=IsExistShowCardNo(h_showcardid);
if(ret)
{
*pRetCode = ret;
goto L_RETU;
}
}
ret=IsExistCardByPhyCardNo(tCard.physical_no);
if(ret)
{
*pRetCode = ret;
goto L_RETU;
}
ret=GetLostCardIdByCustomId_TypeId(hi_cutid,CT_NORMAL,&lost_card_id);
if(ret)
{
writelog(LOG_ERR,"customer[%d]tCard type_id[%d]",hi_cutid,CT_NORMAL);
*pRetCode = ret;
goto L_RETU;
}
/*
ret=DB_t_pif_cardlossinfo_read_by_card_id_and_state_id(lost_card_id, STATE_VALID, &tCardLossInfo);
if(ret)
{
//.........这里部分代码省略.........
示例9: NormalTrans
static int NormalTrans(TRUSERID *handle,ST_PACK *rPack,int *pRetCode,char *szMsg)
{
int ret=0;
CAccTrans *pAccTrans=CAccTrans::getInstance();
TRANS& trans=pAccTrans->trans;
ST_CPACK aPack;
ST_PACK *outPack = &(aPack.pack);
ResetNormalCPack(&aPack,0,1);
SetCol(handle,0);
SetCol(handle,F_LVOL0,F_LVOL1,F_LVOL8,F_LVOL10,F_LVOL11,F_LVOL12,F_SDATE0,F_SPHONE3,F_SADDR,F_LSAFE_LEVEL2,
F_SDATE3,F_STIME3,F_SEMP,F_LWITHDRAW_FLAG,F_LSERIAL1,F_VSMESS,0);
des2src(trans.refno,rPack->sphone3); //交易参考号
if(strlen(trans.refno)!=14)
{
ERRTIP("交易参考号错误");
return E_COMMON_ERR;
}
T_t_refno tRefno;
memset(&tRefno,0,sizeof(tRefno));
ret=DB_t_refno_read_by_refno(trans.refno,&tRefno);
if(ret)
{
if(DB_NOTFOUND==ret)
return E_DB_REFNO_N;
else
return E_DB_REFNO_R;
}
if(strncmp(tRefno.mac,rPack->saddr,8)!=0)
{
ERRTIP("交易参考号MAC校验错误");
return E_COMMON_ERR;
}
if(RS_FAIL==tRefno.status)
{
ERRTIP("交易已失败");
return E_COMMON_ERR;
}
T_t_transdtl transdtl;
memset(&transdtl,0,sizeof(transdtl));
ret=DB_t_transdtl_read_by_accdate_and_termid_and_termseqno(tRefno.accdate,tRefno.termid,tRefno.termseqno,&transdtl);
if(ret)
{
if(DB_NOTFOUND==ret)
return E_NOTEXIST_TRANSDTL;
else
return E_DB_TRANSDTL_R;
}
int waterflag=0;
if(transdtl.exttype/1000==1)//水控
waterflag=1;
if(RS_SUCC==tRefno.status)
{
outPack->lvol0=transdtl.cardno;
outPack->lvol1=D4U5(transdtl.amount*100,0);
outPack->lvol8=D4U5(transdtl.cardaftbal*100,0);
if(waterflag)//水控
{
double wateraftbal= atof(transdtl.extdata);
outPack->lsafe_level2=D4U5(wateraftbal*100,0);
}
des2src(outPack->sdate3,transdtl.transdate);
des2src(outPack->stime3,transdtl.transtime);
des2src(outPack->semp,transdtl.opercode);
outPack->lwithdraw_flag=transdtl.termid;
outPack->lserial1=transdtl.termseqno;
des2src(outPack->sphone3,transdtl.refno);
des2src(outPack->saddr,tRefno.mac);
PutRow(handle,outPack,pRetCode,szMsg);
return 0;
}
if(transdtl.status[0]!=DTLSTATUS_INIT)
{
ERRTIP("交易流水表状态错误");
return E_COMMON_ERR;
}
des2src(trans.opercode,transdtl.opercode);
trans.termid=transdtl.termid;
trans.termseqno=transdtl.termseqno;
trans.cardflag=1;
trans.usecardflag=1;
trans.transcode=transdtl.transcode;
trans.cardno=transdtl.cardno;
trans.purseno=transdtl.purseno;
trans.paycnt=transdtl.cardcnt;
trans.cardbefbal=transdtl.cardbefbal;
trans.cardaftbal=transdtl.cardbefbal;
trans.inputamt= transdtl.amount;
trans.unusedamt = trans.inputamt;
CPaymentBase *payment;
payment = CPaymentBase::find_payment(transdtl.exttype);
if(NULL == payment)
{
return E_TRANS_FUNC_NONSUPPORT;
}
rPack->lcert_code = transdtl.exttype;
strcpy(rPack->sbank_acc,transdtl.extdata);
//.........这里部分代码省略.........
示例10: F930203
int F930203(TRUSERID *handle, int iRequest, ST_PACK *in_pack, int *pRetCode, char *szMsg) {
T_t_doordtl tDoordtl;
T_t_card tCard;
T_t_device device;
T_t_dooreventdtl event;
T_t_customer tCust;
int ret;
char weigand_no[12+1] = "";
memset(&device, 0, sizeof device);
writelog(LOG_INFO, "接收前置数据:device=[%d],parent_id=[%d],dev_no=[%d],cardno=[%d],phycarid=[%s],ret=[%d]",in_pack->lvol5, in_pack->lvol2, in_pack->lvol1,in_pack->lvol0,in_pack->sdate1,ret);
// 查询设备ID号
if (in_pack->lvol5 > 0) {
ret = DB_t_device_read_by_deviceid(in_pack->lvol5, &device);
} else {
// 先判断是不是有父设备ID
if (in_pack->lvol2 > 0)
ret = get_door_dev_by_parent_and_termid(&device, in_pack->lvol2
, in_pack->lvol1); // 通过机号查询
else {
// 判断父设备机号
if (in_pack->lvol3 > 0)
ret = find_device_by_parent_termid(&device, in_pack->lvol3, in_pack->lvol1
, in_pack->lserial0); // 通过父设备机号与设备机号查询
else {
// 通过子系统号与设备机号查询
ret = find_device_by_devinfo(&device, in_pack->lcert_code, in_pack->lvol1
, in_pack->sbank_code, in_pack->lserial0);
}
}
}
if (ret) {
writelog(LOG_ERR, "获取设备信息失败:deviceid=[%d],parent_id=[%d],dev_no=[%d],ret=[%d]",in_pack->lvol5, in_pack->lvol2, in_pack->lvol1, ret);
if (ret == E_DB_DEVICE_N) {
writelog(LOG_ERR, "上传记录找不到对应的设备termid[%d]type[%s]parent[%d][%d],sys[%d],phytype[%d]",in_pack->lvol1, in_pack->sbank_code, in_pack->lvol2, in_pack->lvol3, in_pack->lcert_code, in_pack->lserial0);
return ret;
} else {
*pRetCode = ret;
goto L_RETU;
}
}
// 没有物理卡号,也没有交易卡号
if ((strlen(in_pack->sdate1) == 0) && in_pack->lvol0 == 0) {
//事件
memset(&event, 0, sizeof event);
event.deviceid = device.deviceid;
event.eventcode = atoi(in_pack->semp_no);
des2src(event.eventmsg, in_pack->vsmess);
event.sysid= in_pack->lcert_code;
des2src(event.transdate, in_pack->sdate0);
des2src(event.transtime, in_pack->stime0);
getsysdate(event.coldate);
getsystime(event.coltime);
ret = DB_t_dooreventdtl_add(&event);
if (ret) {
if (DB_REPEAT == ret)
return 0;
return E_DB_DOOREVENTDTL_I;
}
return 0;
} else {
memset(&tCard, 0, sizeof tCard);
if(strlen(in_pack->sdate1) >0) { // 有物理卡号
ret = get_card_by_phyno(&tCard, in_pack->sdate1);
if (ret) {
if (ret == E_DB_CARD_N) {
ConverPhyNo(in_pack->sdate1, weigand_no);
ret = get_card_by_weigand_no(&tCard, weigand_no);
if (ret) {
writelog(LOG_ERR, "Get_card_by_weigand_no err,weigand_no=[%s],ret=[%d]", weigand_no, ret);
// 没有这张卡,仍然保留流水
if (ret != E_DB_CARD_N) {
*pRetCode = ret;
goto L_RETU;
}
}
} else {
*pRetCode = ret;
goto L_RETU;
}
}
} else { // 根据交易卡号查询
ret = DB_t_card_read_by_cardno(in_pack->lvol0, &tCard);
if(ret) {
*pRetCode = E_DB_CARD_R;
goto L_RETU;
}
}
memset(&tDoordtl, 0, sizeof tDoordtl);
tDoordtl.deviceid = device.deviceid;
des2src(tDoordtl.devphyid,device.devphyid);
writelog(LOG_DEBUG,"deviceid[%d],devphyid[%s]",device.deviceid,device.devphyid);
tDoordtl.cardno = tCard.cardno;
tDoordtl.sysid = in_pack->lcert_code;
tDoordtl.custid = tCard.custid;
if (!ret)
des2src(tDoordtl.cardphyid, tCard.cardphyid);
//.........这里部分代码省略.........
示例11: F847132
int F847132(TRUSERID *handle,int iRequest,ST_PACK *rPack,int *pRetCode,char *szMsg)
{
int ret=0;
int i=0;
int iTotalCnt=0;
double dTotalAmt=0.0;
double dSerialNo = 0;
char logicdate[11]=""; //业务日期
char sysdate[11]="";
char systime[9]="";
char sMsg[256]="";
T_t_tif_tradeserial tradeserial;
T_t_tif_savdtl tSavdtl;
T_t_tif_subsidy tSubsidy;
InAcc IA;
ST_CPACK aPack;
ST_PACK *out_pack = &(aPack.pack);
memset(&tSavdtl,0,sizeof(tSavdtl));
memset(&tSubsidy,0,sizeof(tSubsidy));
memset(&tradeserial,0,sizeof(tradeserial));
memset(&IA,0,sizeof(IA));
ResetNormalCPack(&aPack,0,1);
SetCol(handle,0);
SetCol(handle,F_VSMESS,0);
getsysdate(sysdate);
getsystime(systime);
ret=GetLogicDate(logicdate); //业务日期
if(ret)
{
*pRetCode=ret;
goto L_RETU;
}
if(strlen(rPack->scust_limit)<1)
{
*pRetCode=E_INPUT_BATCH_NO;
goto L_RETU;
}
if(strlen(rPack->scust_no)<1)
{
*pRetCode=E_INPUT_OPER_NULL;
goto L_RETU;
}
if(amtcmp(rPack->damt0,0)<=0)
{
*pRetCode=E_INPUT_AMT;
goto L_RETU;
}
des2src(tSubsidy.summary,rPack->semail); //补助摘要
if(strlen(rPack->semail)<1)
{
*pRetCode=E_INPUT_SUMMARY;
goto L_RETU;
}
des2src(tSubsidy.batch_no,rPack->scust_limit);
tSubsidy.bill_type=rPack->lvol2; //票据类型
des2src(tSubsidy.bill_no,rPack->scust_auth2); //票据号码
tSubsidy.amount=rPack->damt0; //补助金额
des2src(tSubsidy.subsidytype,rPack->smain_flag);//补助标志(0增值1减值)
des2src(tSubsidy.subsidytype,"1"); //补助标志(0增值1减值)
des2src(tSubsidy.broker_id,rPack->sname); //经办人身份证号
des2src(tSubsidy.broker_name,rPack->semail2); //经办人姓名
IA.dArrInAmt[0]=tradeserial.trade_fee;
switch(tSubsidy.bill_type)
{
case TYPE_CASH: //现金
IA.iArrInFeeSwitch[1]=1;
break;
case TYPE_BILL: //支票
IA.iArrInFeeSwitch[2]=1;
break;
case TYPE_FUNDBOOK: //经费本
IA.iArrInFeeSwitch[3]=1;
break;
default:
*pRetCode=E_INPUT_DEPOSIT_TYPE;
goto L_RETU;
}
ret=stat_subsidy_amount_by_batch_no(tSubsidy.batch_no, &iTotalCnt,&dTotalAmt);
if(ret)
{
*pRetCode = ret;
writelog(LOG_ERR,"ret[%d]",ret);
goto L_RETU;
}
if(iTotalCnt!=rPack->lvol3)
{
strcpy(szMsg,"补助人数与导入的数据不符");
*pRetCode=E_INPUT_DATA_INVAILD;
goto L_RETU;
}
if(amtcmp(dTotalAmt,rPack->damt0)!=0)
{
strcpy(szMsg,"补助总金额与导入的补助数据不符");
*pRetCode=E_INPUT_DATA_INVAILD;
goto L_RETU;
}
// writelog(LOG_DEBUG,"subsidy no : %s",tSubsidy.batch_no);
//.........这里部分代码省略.........
示例12: F950073
int F950073(TRUSERID *handle,int iRequest,ST_PACK *rPack,int *pRetCode,char *szMsg)
{
int ret;
char packid[30]={0};
char reqid[20]={0};
T_t_device tDevice;
T_t_transpack transpack;
CAccTrans& ats = CAccTrans::GetInst();
TRANS &trans = ats.trans;
ST_CPACK aPack;
ST_PACK *outPack = &(aPack.pack);
memset(&tDevice,0,sizeof tDevice);
memset(&transpack,0,sizeof transpack);
ResetNormalCPack(&aPack,0,1);
SetCol(handle,0);
SetCol(handle,F_LCERT_CODE,F_SPHONE3,F_LSERIAL0,F_LWITHDRAW_FLAG,0);
GetCpackDataString(rPack,transpack.reqdata);
des2src(tDevice.devphyid,rPack->sphone3);
ret = addPOSCheckPOS(rPack->lwithdraw_flag,tDevice);
if(ret)
{
outPack->lcert_code = ret;
}
else
{
des2src(transpack.transdate,rPack->sdate0);
des2src(transpack.transtime,rPack->stime0);
transpack.reqsno = rPack->lserial0;
sprintf(transpack.packetid,"%s%s%03d",transpack.transdate,transpack.transtime,transpack.reqsno%1000);
sprintf(transpack.reqid,"%d",tDevice.deviceid);
transpack.funcno = iRequest;
transpack.status[0]=TRANSPACKSTATE_NODEAL;
des2src(transpack.lastupdtime,trans.sysdatetime);
transpack.datalen = strlen(transpack.reqdata);
if(rPack->lvol10 == 2) // 中途拔卡,发送交易取消
{
transpack.status[0] = TRANSPACKSTATE_WRITEFAILD;
transpack.revflag = 0;
}
else if(rPack->lvol10 == 1)//交易冲正
{
transpack.revflag = 1;
}
else
{
transpack.errcode = ERRIF_DATA;
transpack.status[0] = TRANSPACKSTATE_DENY;
}
ret = DB_t_transpack_add(&transpack);
if(ret)
{
if(DB_REPEAT == ret)
{
//
des2src(packid,transpack.packetid);
des2src(reqid,transpack.reqid);
memset(&transpack,0,sizeof transpack);
ret = DB_t_transpack_read_lock_by_c0_and_packetid_and_reqid(packid,reqid,&transpack);
if(ret)
{
outPack->lcert_code = ERRIF_SYSTEM;
}
else
{
des2src(transpack.lastupdtime,trans.sysdatetime);
if(rPack->lvol10 == 2) // 中途拔卡,发送交易取消
{
transpack.status[0] = TRANSPACKSTATE_WRITEFAILD;
transpack.revflag = 0;
}
else if(rPack->lvol10 == 1)//交易冲正
{
transpack.revflag = 1;
transpack.retrycnt++;
}
else
{
transpack.errcode = ERRIF_DATA;
}
ret = DB_t_transpack_update_lock_by_c0(&transpack);
if(ret)
{
outPack->lcert_code = ERRIF_SYSTEM;
}
else
{
outPack->lcert_code = 0;
}
}
}
else
{
outPack->lcert_code = ERRIF_SYSTEM;
}
//.........这里部分代码省略.........
示例13: ReverseProcess
//冲正
int ReverseProcess(RevAcc * revacc)
{
int ret = -1;
int rows = 0;
char sTxdate[9] = "";
//char *pMessage = (char*) revacc->pVoidPointer;
T_t_tif_tradelog tTradelog;
T_t_tif_tradelog_his tTradeloghis;
memset(&tTradelog,0,sizeof tTradelog);
memset(&tTradeloghis,0,sizeof tTradeloghis);
GetLogicDate(sTxdate);
if(strcmp(revacc->sTxAccDate,sTxdate) == 0) //查当前账务表
{
ret = DB_t_tif_tradelog_open_select_by_c2_and_serino_and_seri_type_and_outorin(revacc->iSerialNo, revacc->iTradeNo, DBCR_DEBIT);
if(ret)
{
if(DB_NOTFOUND == ret)
return E_FAN_SERIAL_NOT_EXISTS;
else
return E_DB_TRADELOG_R;
}
while(1)
{
memset(&tTradelog,0,sizeof tTradelog);
ret = DB_t_tif_tradelog_fetch_select_by_c2(&tTradelog);
if(ret)
{
if(DB_NOTFOUND == ret)
{
if(rows > 0)
break;
else
return E_FAN_SERIAL_NOT_EXISTS;
}
else
return E_DB_TRADELOG_R;
}
rows++;
ret = do_reverse_balance(&tTradelog,revacc);
if(ret)
{
DB_t_tif_tradelog_close_select_by_c2();
return ret;
}
}
DB_t_tif_tradelog_close_select_by_c2();
}
else // 查历史账务表
{
ret = DB_t_tif_tradelog_his_open_select_by_c0_and_bak_date_and_serino_and_outorin(revacc->sTxAccDate, revacc->iSerialNo,DBCR_DEBIT );
if(ret)
{
if(DB_NOTFOUND == ret)
return E_FAN_SERIAL_NOT_EXISTS;
else
return E_DB_TRADELOG_R;
}
while(1)
{
memset(&tTradelog,0,sizeof tTradelog);
ret = DB_t_tif_tradelog_his_fetch_select_by_c0(&tTradeloghis);
if(ret)
{
if(DB_NOTFOUND == ret)
{
if(rows > 0)
break;
else
return E_FAN_SERIAL_NOT_EXISTS;
}
else
return E_DB_TRADELOG_R;
}
rows++;
tTradelog.fee_type = tTradeloghis.fee_type;
des2src(tTradelog.act_id,tTradeloghis.act_id);
des2src(tTradelog.subno,tTradeloghis.subno);
des2src(tTradelog.other_actid,tTradeloghis.other_actid);
des2src(tTradelog.other_subno,tTradeloghis.other_subno);
tTradelog.outorin= tTradeloghis.outorin;
tTradelog.op_fee= tTradeloghis.op_fee;
tTradelog.new_fee = tTradeloghis.new_fee;
tTradelog.cur_frozebala= tTradeloghis.cur_frozebala;
tTradelog.annex= tTradeloghis.annex;
des2src(tTradelog.comments,tTradeloghis.comments);
ret = do_reverse_balance(&tTradelog,revacc);
if(ret)
{
DB_t_tif_tradelog_his_close_select_by_c0();
return ret;
}
}
DB_t_tif_tradelog_his_close_select_by_c0();
}
//.........这里部分代码省略.........
示例14: do_reverse_balance
//.........这里部分代码省略.........
{
tAccountCr.cur_bala =D4U5(tAccountCr.cur_bala- tTradelog->op_fee,6); //总余额
if(tCfgsplit.txtype ==0) //第一次读取
{
ret = DB_t_tif_cfgsplit_read_by_txtype(tTradelog->fee_type, &tCfgsplit);
if(ret)
{
DB_t_aif_account_free_lock_cur();
return ret;
}
}
switch(tCfgsplit.fundtype)
{
case FUNDTYPE_BOARD: //搭伙费
tAccountCr.cur_frozebala =D4U5(tAccountCr.cur_frozebala- tTradelog->op_fee,6);
break;
default:
tAccountCr.cur_freebala =D4U5(tAccountCr.cur_freebala- tTradelog->op_fee,6); //可用余额
//更新卡余额
if(USE_CARD_TYPE_ONLINE==revacc->iUseCardFlag)
{
getsysdate(tAccountCr.reserve_1);
if(revacc->iTradeCnt>0)
tAccountCr.consume_count=revacc->iTradeCnt; //消费次数增加
if(amtcmp(revacc->dInCardBala,0)>=0)
{
//有入卡值,没有出卡值,计算出卡值,卡余额
revacc->dOutCardBala=D4U5(revacc->dInCardBala -tTradelog->op_fee,2);
tAccountCr.card_balance=revacc->dOutCardBala; //账户卡余额
}
}
else if(USE_CARD_TYPE_NULL==revacc->iUseCardFlag)
{
if((tAccountCr.consume_count<=revacc->iTradeCnt)||(strncmp(revacc->sTxDate,tAccountCr.reserve_1,8)>0))
{
strcpy(tAccountCr.reserve_1,revacc->sTxDate);
tAccountCr.card_balance=D4U5(revacc->dInCardBala - tTradelog->op_fee,2); //账户卡余额
}
revacc->dOutCardBala=D4U5(revacc->dInCardBala - tTradelog->op_fee,2);
}
break;
}
}
else
{
tAccountCr.cur_bala =D4U5(tAccountCr.cur_bala-tTradelog->op_fee,6); //当前总余额
tAccountCr.cur_freebala=D4U5(tAccountCr.cur_freebala-tTradelog->op_fee,6) ; //当前可用余额
}
}
ret = DB_t_aif_account_update_lock_by_cur(&tAccountCr);
if (ret)
{
writelog(LOG_ERR, "update account err[%d] account[%s]", ret,tAccountCr.account_id);
if (DB_NOTFOUND == ret)
return E_ACTNO_NOT_EXIST;
else
return E_DB_ACCOUNT_U;
}
DB_t_aif_account_free_lock_cur();
des2src(tTradelogDb.operate_date,revacc->sTxDate);
des2src(tTradelogDb.operate_time,revacc->sTxTime);
des2src(tTradelogDb.collect_date,revacc->sTxDate);
des2src(tTradelogDb.collect_time,revacc->sTxTime);
des2src(tTradelogDb.enteract_date,revacc->sTxDate);
des2src(tTradelogDb.enteract_time,revacc->sTxTime);
des2src(tTradelogDb.check_oper,revacc->sChkOper);
des2src(tTradelogDb.record_oper,revacc->sMdeOper);
tTradelogDb.serino = revacc->iRevSeriNo;
tTradelogDb.op_fee = -tTradelogDb.op_fee;
tTradelogDb.maindevice_id = revacc->maindevice_id;
tTradelogDb.device_id = 0;
ret = DB_t_tif_tradelog_add(&tTradelogDb);
if (ret)
{
writelog(LOG_ERR, "add ArrTradelog err[%d] seri_no[%d],seri_type[%d],fee_type[%d],act_id[%s]", ret,tTradelogDb.serino,tTradelogDb.seri_type,
tTradelogDb.fee_type,tTradelogDb.act_id);
return E_DB_TRADELOG_I;
}
memcpy(&tTradelogCr,&tTradelogDb,sizeof tTradelogCr);
tTradelogCr.new_fee = tAccountCr.cur_bala; //贷方帐户余额
tTradelogCr.cur_frozebala=tAccountCr.cur_frozebala; //冻结金额
des2src(tTradelogCr.act_id,tTradelogDb.other_actid);
des2src(tTradelogCr.subno,tTradelogDb.other_subno);
des2src(tTradelogCr.other_actid,tTradelogDb.act_id);
des2src(tTradelogCr.other_subno,tTradelogDb.subno);
tTradelogCr.outorin = DBCR_CREDIT;
ret = DB_t_tif_tradelog_add(&tTradelogCr);
if (ret)
{
writelog(LOG_ERR, "add ArrTradelog err[%d] seri_no[%d],seri_type[%d],fee_type[%d],act_id[%s]", ret,tTradelogCr.serino,tTradelogCr.seri_type,
tTradelogCr.fee_type,tTradelogCr.act_id);
return E_DB_TRADELOG_I;
}
return 0;
}
示例15: F847221
//.........这里部分代码省略.........
if(ret)
{
*pRetCode = ret;
goto L_RETU;
}
// 查询组可解款余额
memset(&group_cash,0,sizeof group_cash);
ret = DB_t_group_cash_report_read_lock_by_c1_and_groupid(old_serial.showid,&group_cash);
if(ret)
{
if(DB_NOTFOUND == ret)
*pRetCode = E_FAN_ACC_NOT_EXISTS;
else
*pRetCode = E_DB_GRP_CASH_RPT_R;
goto L_RETU;
}
/*
if(amtcmp(tx_money,group_cash.cur_money)>0)
{
*pRetCode = E_FAN_ACC_INSUFFICIENT;
DB_t_group_cash_report_free_lock_by_c1();
goto L_RETU;
}
*/
// 生成流水
memset(&serial,0,sizeof serial);
serial.serial_no = (int)dUniNo;
serial.serial_state = SERISTAT_DEBT;
serial.serial_type = TXCODE_FAN_RUSH_PAY;
getsysdate(serial.operate_date);
getsystime(serial.operate_time);
des2src(serial.collect_date,serial.operate_date);
des2src(serial.collect_time,serial.operate_time);
GetLogicDate(serial.enteract_date);
des2src(serial.enteract_time,serial.operate_time);
des2src(serial.opercode,rPack->scard0);
des2src(serial.reserve_1,rPack->scert_addr);
serial.cardbefbal = tx_money;
serial.trade_fee = tx_money * -1;
// 商户号
des2src(serial.showid,old_serial.showid);
// 入账
memset(&IA,0,sizeof IA);
IA.dArrInAmt[0] = serial.trade_fee;
IA.iCardNo = 0;
//收费类别为 1
IA.iFeeType = 1;
IA.iTxFlag = ACC_TYPE_RUSH;
IA.pVoidPointer = ia_buf;
ret = process(&IA,&serial);
if(ret)
{
writelog(LOG_ERR,"account process error [%d]",ret);
*pRetCode = ret;
DB_t_group_cash_report_free_lock_by_c1();
goto L_RETU;
}
SetCol(handle,0);
SetCol(handle,F_VSMESS,F_LVOL1,F_DAMT1,F_DAMT2,F_SBANK_ACC,0);
sprintf(out_pack->vsmess,"流水号:%d ",IA.iSerialNo);
for(i=1;i<=IA.iOutTxTypeCnt;i++)