当前位置: 首页>>代码示例>>C++>>正文


C++ D4U5函数代码示例

本文整理汇总了C++中D4U5函数的典型用法代码示例。如果您正苦于以下问题:C++ D4U5函数的具体用法?C++ D4U5怎么用?C++ D4U5使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了D4U5函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DoResponse

static int DoResponse(const T_t_cardtrans& cardtrans, TRUSERID *handle, int *pRetCode, char *szMsg)
{
    CAccTrans& ats = CAccTrans::GetInst();
    TRANS& trans = ats.trans;
    ST_CPACK aPack;
    ST_PACK *outPack = &(aPack.pack);
    ResetNormalCPack(&aPack, 0, 1);
    SetCol(handle, F_LVOL0, F_LVOL1, F_LVOL7, F_LVOL8, F_DAMT0, F_LCERT_CODE,
           F_SDATE0, F_STIME0, F_LWITHDRAW_FLAG, F_LSERIAL0, F_LSERIAL1, F_SNOTE, F_VSMESS, 0);
    outPack->lwithdraw_flag = trans.termid;
    outPack->lvol0 = trans.cardno;
    outPack->lvol7 = D4U5(trans.cardbefbal * 100, 0);
    outPack->lvol8 = D4U5(trans.cardaftbal * 100, 0);

    if(trans.errcode)
    {
        outPack->lvol1 = 1;
        outPack->damt0 = trans.addamt;
        outPack->lcert_code = trans.transcode;
        outPack->lserial0 = cardtrans.termid;
        outPack->lserial1 = cardtrans.termseqno;
        strcpy(outPack->sdate0, cardtrans.transdate);
        strcpy(outPack->stime0, cardtrans.transtime);
        strcpy(outPack->snote, trans.remark);
    }
    PutRow(handle, outPack, pRetCode, szMsg);
    return 0;
}
开发者ID:Codiscope-Research,项目名称:ykt4sungard,代码行数:28,代码来源:F200001.cpp

示例2: amtcmp

//金额比较函数,只比较小数点前2位
int amtcmp(double amt1,double amt2)
{
	long long lAmt1=D4U5(amt1,2)*100;
	long long lAmt2=D4U5(amt2,2)*100;
	long long lAmt=lAmt1-lAmt2;
	if(0==lAmt)
		return 0;
	else if(lAmt<0)
		return -1;
	else
		return   1;
}
开发者ID:nykma,项目名称:ykt4sungard,代码行数:13,代码来源:pubfunc.c

示例3: do_refundment_subsidy

static int do_refundment_subsidy(T_t_aif_account *account,double *subsidy_money,char *opercode,int subsidy_no)
{
	T_t_tif_subsidy tSubsidy;
	char tx_date[9]="";
	char tx_time[7]="";
	double total_money = 0.0;
	int ret;
	char status[2] = "";

	getsysdate(tx_date);
	getsystime(tx_time);
	status[0] = SUBSIDY_STAT_NORMAL;
	// 按交易卡号退款
	ret = DB_t_tif_subsidy_open_select_for_update_by_c3_and_cardno_and_status(
		account->cardno,status);
	if(ret)
	{
		if(DB_NOTFOUND != ret)
		{
			writelog(LOG_ERR,"open subsidy error,cardno[%d],ret[%d]",account->cardno,ret);
			return E_DB_SUBSIDY_R;
		}
	}
	else
	{
		while(1)
		{
			memset(&tSubsidy,0,sizeof tSubsidy);
			ret = DB_t_tif_subsidy_fetch_select_by_c3(&tSubsidy);
			if(ret)
			{
				if(DB_NOTFOUND == ret)
					break;
				writelog(LOG_ERR,"read subsidy error,cardno[%d],ret[%d]",account->cardno,ret);
				return E_DB_SUBSIDY_R;
			}
			if(subsidy_no > -1 && tSubsidy.subsidy_no < subsidy_no)
			{
				writelog(LOG_INFO,"cardid[%d]online subsidy_no[%d],db subsidy_no[%d] ignore",
						 account->cardno,subsidy_no,tSubsidy.subsidy_no);
				continue;
			}
			total_money += D4U5(tSubsidy.amount,2);
			tSubsidy.status[0] = SUBSIDY_STAT_FINISHED;
			des2src(tSubsidy.get_date,tx_date);
			des2src(tSubsidy.get_time,tx_time);
			des2src(tSubsidy.opercode,opercode);
			ret = DB_t_tif_subsidy_update_lock_by_c3(&tSubsidy);
			if(ret)
			{
				writelog(LOG_ERR,"update subsidy error,cardno[%d],subsidy_no[%d],ret[%d]",
						 tSubsidy.cardno,tSubsidy.subsidy_no,ret);
				return E_DB_SUBSIDY_U;
			}
		}
	}
	*subsidy_money = total_money;
	return 0;
}
开发者ID:nykma,项目名称:ykt4sungard,代码行数:59,代码来源:F847105.cpp

示例4: D2I

// 将浮点数转换为整型
int D2I(double value)
{
    /*
    double smaller = floor(value);
    double bigger = ceil(value);
    return (int)(((bigger - value) > (value - smaller)) ? smaller : bigger);
    */
    return (int)D4U5(value,0);
}
开发者ID:nykma,项目名称:ykt4sungard,代码行数:10,代码来源:pubfunc.c

示例5: do_rush_balance

static int do_rush_balance(T_t_tif_tradelog * tradelog,InAcc * pIA,T_t_tif_tradeserial* pSerial)
{
	int ret;
	int subindex;
	T_t_aif_account account;
	// 初始化入账模块
	subindex = pIA->iSubIndex;
	memset(pIA,0,sizeof(InAcc));
	pIA->dArrInAmt[0] = tradelog->op_fee * -1;
	des2src(pIA->sArrInActno[0],tradelog->act_id);
	pIA->iSubIndex = subindex;
	ret = process(pIA,pSerial);
	if(ret)
	{
		writelog(LOG_ERR,"消费解款冲正,账号[%s]失败[%.2lf]"
			,tradelog->act_id,tradelog->op_fee);
		return ret;
	}
	memset(&account,0,sizeof account);
	ret = DB_t_aif_account_read_by_account_id(tradelog->act_id,&account);
	if(ret)
	{
		writelog(LOG_ERR,"查询商户账户失败ret[%d]",ret);
		if(DB_NOTFOUND == ret)
			return E_DB_ACCOUNT_N;
		else
			return E_DB_ACCOUNT_R;
	}
	// 更新账户余额
	account.last_bala =D4U5(account.last_bala+ tradelog->op_fee,2);
	account.last_freebala = D4U5(account.last_freebala+ tradelog->op_fee,2);
	ret = DB_t_aif_account_update_by_account_id(tradelog->act_id,&account);
	if(ret)
	{
		writelog(LOG_ERR,"冲正后更新账户可用解款金额失败account[%s]"
			,tradelog->act_id);
		if(DB_NOTFOUND == ret)
			return E_DB_ACCOUNT_N;
		else
			return E_DB_ACCOUNT_U;
	}
	pSerial->trade_fee = D4U5(pSerial->trade_fee+tradelog->op_fee,2);
	return 0;
}
开发者ID:nykma,项目名称:ykt4sungard,代码行数:44,代码来源:F847223.c

示例6: CardTransProcess

int CardTransProcess(T_t_cardtrans& cardtrans)
{
    CAccTrans& ats = CAccTrans::GetInst();
    TRANS& trans = ats.trans;
    int ret = DB_t_cardtrans_read_lock_by_c0_and_cardno(trans.cardno, &cardtrans);
    if(ret)
    {
        if(DB_NOTFOUND == ret)
            return 0;
        else
            return E_DB_CARDTRANS_R;
    }
    ret = CardTransCheck(cardtrans);
    if(ret)
    {
        DB_t_cardtrans_free_lock_by_c0();
        return ret;
    }
    if(trans.errcode)
    {
        trans.cardaftbal = cardtrans.cardaftbal;
        trans.addamt = D4U5(trans.cardaftbal - trans.cardbefbal);
        trans.transcode = cardtrans.transcode;
        if(trans.transcode)
        {
            T_t_transcode *_pCfgTransCode = ats.getCfgTranscode(cardtrans.transcode);
            if(_pCfgTransCode)
                strcpy(trans.remark, _pCfgTransCode->transname);
        }
        cardtrans.updcnt++;
        strcpy(cardtrans.updtime, trans.sysdatetime);
        ret = DB_t_cardtrans_update_lock_by_c0(&cardtrans);
        if(ret)
        {
            return E_DB_CARDTRANS_U;
        }
    }
    else
    {
        DB_t_cardtrans_free_lock_by_c0();
    }
    return 0;
}
开发者ID:Codiscope-Research,项目名称:ykt4sungard,代码行数:43,代码来源:F200001.cpp

示例7: DoCardInsteadCancel


//.........这里部分代码省略.........
        transdtl.cardaftbal=transdtl.cardbefbal;

        transdtl.managefee=trans.totalfeeamt;
        transdtl.amount=trans.totaltransamt;
        transdtl.custid=tCard.custid;
        des2src(transdtl.custname,customer.custname);
        des2src(transdtl.stuempno,customer.stuempno);
        des2src(transdtl.opercode,trans.opercode);
        transdtl.status[0]=DTLSTATUS_SUCCESS;
        des2src(transdtl.showcardno,cardinsteaddtl.oldshowcardno);
        ret=DB_t_transdtl_add(&transdtl);
        if(ret) {
            if(DB_REPEAT==ret)
                return E_DB_TRANSDTL_E;
            else
                return E_DB_TRANSDTL_I;
        }
        outPack->lvol1=tCard.custid;
        outPack->lsafe_level2=customer.custtype;
        outPack->lvol5=tCard.feetype;
        des2src(outPack->sall_name,customer.custname);
        des2src(outPack->spager,customer.stuempno);
        des2src(outPack->scert_no,customer.deptcode);
        des2src(outPack->semail2,customer.idno);
        des2src(outPack->smarket_code,customer.sex);
        des2src(outPack->sdate0,tCard.expiredate);
        sprintf(outPack->sholder_ac_no,"%d",10);				//发行方标识
        des2src(outPack->smarket_code2,customer.idtype);
        des2src(outPack->sname2,tCard.cardverno);
        outPack->lsafe_level=tCard.cardtype;
        outPack->lvol0=tCard.cardno;
        outPack->lvol8=(int)(cardinsteaddtl.oldcardbal*100);
        outPack->lvol4=cardinsteaddtl.oldsubsidyno;
        outPack->lvol11=D4U5(tCardAccount.singlemaxamt*100,0);
        outPack->lvol12=D4U5(tCardAccount.daycostmaxamt*100,0);
        outPack->lvol6=cardinsteaddtl.oldcardcnt;
        des2src(outPack->sorder0,tCard.showcardno);
        des2src(outPack->sdate3,pAccTrans->trans.accdate);
        des2src(outPack->stime3,pAccTrans->trans.acctime);
        des2src(outPack->semp,trans.opercode);
        outPack->lwithdraw_flag=trans.termid;
        outPack->lserial1=trans.termseqno;
        des2src(outPack->stx_pwd,cardpwd);
        PutRow(handle,outPack,pRetCode,szMsg);
        return 0;
    }
    if(cardinsteaddtl.revflag[0]=='1') {
        return E_CARDINSTEAD_CANCEL;
    }
    T_t_card cardtmp;
    memset(&cardtmp,0,sizeof(cardtmp));
    ret=DB_t_card_read_by_cardphyid_and_status(trans.cardphyid,"1",&cardtmp);
    if(ret!=DB_NOTFOUND) {
        if(DB_SUCCESS==ret)
            return ERRINFO(E_EXIST_CARDPHYID,trans.cardphyid);
        else
            return E_DB_CARD_R;
    }
    if(pAccTrans->sysPara.bEnableCardMgr) {
        ret=DB_t_card_read_by_showcardno_and_status(trans.showcardno,"1",&tCard);
        if(ret!=DB_NOTFOUND) {
            if(DB_SUCCESS==ret)
                return ERRINFO(E_EXIST_SHOWCARDNO,trans.showcardno);
            else
                return E_DB_CARD_R;
        }
开发者ID:Codiscope-Research,项目名称:ykt4sungard,代码行数:67,代码来源:F846325.cpp

示例8: F846310


//.........这里部分代码省略.........

	if(tCard.custid>0)
	{
		ret=DB_t_customer_read_by_custid(tCard.custid,&tCustomer);
		if(ret)
		{
			if(DB_NOTFOUND==ret)
				return E_NOTEXIST_CUSTOMER;
			else
				return E_DB_CUSTOMER_R;
		}
	}
	T_t_transdtl transdtl;
	memset(&transdtl,0,sizeof(transdtl));

	strcpy(transdtl.transdate,trans.transdate);
	strcpy(transdtl.transtime,trans.transtime);
	strcpy(transdtl.accdate,trans.accdate);
	strcpy(transdtl.acctime,trans.acctime);
	transdtl.termid=trans.termid;
	transdtl.termseqno=trans.termseqno;
//	des2src(transdtl.collectdate,rPack->sdate1);
//	des2src(transdtl.collecttime,rPack->stime1);
	transdtl.transcode=trans.transcode;
//	transdtl.paytype=rPack->lvol9;
//	des2src(transdtl.voucherno,rPack->scust_auth2);
	transdtl.cardno=trans.cardno;
	transdtl.purseno=PURSE_NO_ONE;
	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.frontno=0;
	//des2src(transdtl.devphyid,rPack->sname);
	//transdtl.devseqno=rPack->lserial0;
	//des2src(transdtl.bankcode,rPack->sbank_code);
	//des2src(transdtl.bankcardno,rPack->scard0);
	//des2src(transdtl.mobile,rPack->sphone2);
	des2src(transdtl.opercode,trans.opercode);
	transdtl.status[0]=DTLSTATUS_SUCCESS;
	transdtl.revflag[0]='0';
	transdtl.errcode=0;
	transdtl.custid=tCardAccount.custid;
    des2src(transdtl.showcardno,tCard.showcardno);	
	GetCustBaseInfoByCustID(transdtl.custid,transdtl.custname,transdtl.stuempno,NULL);
	ret=DB_t_transdtl_add(&transdtl);
	if(ret)
	{
	  if(DB_REPEAT==ret)
	    return E_DB_TRANSDTL_E;
	  else
	    return E_DB_TRANSDTL_I;
	}		
    SetCol(handle,F_LVOL1,F_LSAFE_LEVEL2,F_LVOL5,F_LVOL6,
           F_SALL_NAME,F_SPAGER,F_SCERT_NO,F_SHOLDER_AC_NO,F_LSAFE_LEVEL,F_SMARKET_CODE2,
           F_SEMAIL2,F_SMARKET_CODE,F_SDATE0,F_SNOTE,
           F_SSTAT_TYPE,F_SSTAT_TYPE2,F_SNATION_CODE,F_SBRANCH_CODE0,
           F_LVOL0,F_STX_PWD,F_LVOL8,F_LVOL11,F_LVOL12,
           F_SORDER0,F_SORDER1,F_SORDER2,F_SDATE3,F_STIME3,F_SEMP,
           F_LWITHDRAW_FLAG,F_LSERIAL1,F_VSMESS,F_SNAME2,0);
	outPack->lvol1=tCustomer.custid;
	outPack->lsafe_level2=tCustomer.custtype;
	outPack->lvol5=tCard.feetype;
	des2src(outPack->sall_name,tCustomer.custname);
	des2src(outPack->spager,tCustomer.stuempno);
	des2src(outPack->scert_no,tCustomer.deptcode);
	des2src(outPack->semail2,tCustomer.idno);
	des2src(outPack->smarket_code,tCustomer.sex);
	des2src(outPack->smarket_code2,tCustomer.idtype);
	outPack->lsafe_level=tCard.cardtype;
	des2src(outPack->sdate0,tCard.expiredate);
	outPack->lvol0=tCard.cardno;
	outPack->lvol6=trans.paycnt;
	des2src(outPack->stx_pwd,tCard.cardpwd);  
	des2src(outPack->sorder0,tCard.showcardno); 
    des2src(outPack->sname2,tCard.cardverno);
	//	des2src(outPack->sorder0,tCard.showcardno);   
	strcpy(outPack->snote,CARD_STRUCT_VERSION);			  //制卡版本号
	strcpy(outPack->sorder1,CARD_REGISTER_PUBLISH_CODE);	  //发卡注册标识号
	strcpy(outPack->sorder2,CARD_REGISTER_SERVICE_CODE);	  //服务注册标识号
	outPack->lvol8=D4U5(pAccTrans->trans.cardaftbal*100,0);
	outPack->lvol11=D4U5(tCardAccount.singlemaxamt*100,0);
	outPack->lvol12=D4U5(tCardAccount.daycostmaxamt*100,0);
	sprintf(outPack->sholder_ac_no,"%d",tCustomer.custid);  //客户号
	des2src(outPack->sstat_type,tCustomer.idtype);		  //证件类型
	des2src(outPack->snation_code,tCustomer.country); 	  //国籍
	des2src(outPack->sstat_type2,tCustomer.nation); //民族
	des2src(outPack->sbranch_code0,tCustomer.areacode);	  //院校代码  
	des2src(outPack->sdate3,pAccTrans->trans.accdate);
    des2src(outPack->stime3,pAccTrans->trans.acctime);
	des2src(outPack->semp,trans.opercode);
	outPack->lwithdraw_flag=trans.termid;
	outPack->lserial1=trans.termseqno;
	sprintf(trans.remark,"%s卡余额%.2lf元",pAccTrans->remark.c_str(),pAccTrans->trans.cardaftbal);
	des2src(outPack->vsmess,trans.remark);
	PutRow(handle,outPack,pRetCode,szMsg);
	return 0;
}
开发者ID:nykma,项目名称:ykt4sungard,代码行数:101,代码来源:F846310.cpp

示例9: DoCardInstead


//.........这里部分代码省略.........
        DB_t_cardinsteaddtl_free_lock_by_c0();
        strcpy(szMsg,"保存的卡信息与原卡物理ID不一致");
        return E_CARD_PHYNO_DIFFER;
    }
    //核对原物理ID是否一致
    if(strcmp(cardinsteaddtl.oldcardphyid,rPack->scust_no)!=0) {
        DB_t_cardinsteaddtl_free_lock_by_c0();
        return E_CARD_PHYNO_DIFFER;
    }
    if(cardinsteaddtl.revflag[0]=='1') {
        DB_t_cardinsteaddtl_free_lock_by_c0();
        return E_CARDINSTEAD_CANCEL;
    }
    if(cardinsteaddtl.status[0]=='2') {
        DB_t_cardinsteaddtl_free_lock_by_c0();
        if(strcmp(cardinsteaddtl.cardphyid,trans.cardphyid)!=0) {
            return ERRINFO(E_CARD_PHYNO_DIFFER,trans.cardphyid,cardinsteaddtl.cardphyid);
        }
        outPack->lvol1=tCard.custid;
        outPack->lsafe_level2=customer.custtype;
        outPack->lvol5=tCard.feetype;
        des2src(outPack->sall_name,customer.custname);
        des2src(outPack->spager,customer.stuempno);
        des2src(outPack->scert_no,customer.deptcode);
        des2src(outPack->semail2,customer.idno);
        des2src(outPack->smarket_code,customer.sex);
        des2src(outPack->sdate0,tCard.expiredate);
        sprintf(outPack->sholder_ac_no,"%d",10);				//发行方标识
        des2src(outPack->smarket_code2,customer.idtype);
        outPack->lsafe_level=tCard.cardtype;
        des2src(outPack->sname2,tCard.cardverno);
        outPack->lvol0=tCard.cardno;
        outPack->lvol8=(int)(cardinsteaddtl.oldcardbal*100);
        outPack->lvol11=D4U5(tCardAccount.singlemaxamt*100,0);
        outPack->lvol12=D4U5(tCardAccount.daycostmaxamt*100,0);
        outPack->lvol6=cardinsteaddtl.oldcardcnt;
        outPack->lvol4=cardinsteaddtl.oldsubsidyno;
        des2src(outPack->sorder0,tCard.showcardno);
        des2src(outPack->sdate3,pAccTrans->trans.accdate);
        des2src(outPack->semp,trans.opercode);
        des2src(outPack->stx_pwd,cardpwd);
        outPack->lwithdraw_flag=trans.termid;
        outPack->lserial1=trans.termseqno;
        PutRow(handle,outPack,pRetCode,szMsg);
        return 0;
    }
    cardinsteaddtl.status[0]=STATUS_DELETE;
    des2src(cardinsteaddtl.cardphyid,trans.cardphyid);
    des2src(cardinsteaddtl.showcardno,trans.showcardno);
    ret=DB_t_cardinsteaddtl_update_lock_by_c0(&cardinsteaddtl);
    if(ret) {
        return E_DB_CARDINSTEADDTL_U;
    }
    //检查新卡物理id
    T_t_card cardtmp;
    memset(&cardtmp,0,sizeof(cardtmp));
    ret=DB_t_card_read_by_cardphyid_and_status(trans.cardphyid,"1",&cardtmp);
    if(ret!=DB_NOTFOUND) {
        if(DB_SUCCESS==ret)
            return ERRINFO(E_EXIST_CARDPHYID,trans.cardphyid);
        else
            return E_DB_CARD_R;
    }
    if(pAccTrans->sysPara.bEnableCardMgr) {
        ret=DB_t_card_read_by_showcardno_and_status(trans.showcardno,"1",&cardtmp);
        if(ret!=DB_NOTFOUND) {
开发者ID:Codiscope-Research,项目名称:ykt4sungard,代码行数:67,代码来源:F846325.cpp

示例10: packege_elec_request

static int packege_elec_request(ST_PACK *in_pack,int flag,char *send_data){
	int ret;
	ext_elect_req_t* elect_req_t;
	elect_req_t=(ext_elect_req_t*)send_data;
	double money=0;			//充值金额
	char serialno[10]="";
	char sysdate[11]="";
	char systime[9]="";
	char sysdatetime[20]="";
	unsigned char buf[106]="";
	unsigned char soutmd5[16]="";
	char outmd5[32]="";
	T_t_pif_card	tCard;
	memset(&tCard,0,sizeof(tCard));
	if(flag==1){//房间查询不加密
		memcpy(elect_req_t->prix,"0",1);
	}else{
		memcpy(elect_req_t->prix,"1",1);
	}
	
	memcpy(elect_req_t->length,"0141",4);	
	
	if(flag==1){
		memcpy(elect_req_t->type,"0001",4);
		
	}else if(flag==2){
		memcpy(elect_req_t->type,"0002",4);
	}

	memset(elect_req_t->bitery,'0',sizeof(elect_req_t->bitery));
	sprintf(elect_req_t->room,"%-20s",in_pack->saddr);
	ret=DB_t_pif_card_read_by_card_id(in_pack->lvol0, &tCard);
	if(ret)
	{
		if(DB_NOTFOUND==ret)
			ret=E_CARDNO_NOT_EXIST;
		else
			ret=E_DB_CARD_R;
		return ret;
	}
	sprintf(elect_req_t->cutid,"%-22d",tCard.cosumer_id);	
	money = in_pack->damt1;
	int i_money=D2I(D4U5(money*100,0));
	sprintf(elect_req_t->money,"%07d",i_money);
	ret=get_datetime_from_db(sysdate,systime);
	if(ret)
	{
		writelog(LOG_ERR,"get_datetime_from_db error,error code=[%d]",ret);
		getsysdate(sysdate);
		getsystime(systime);
	}
	strcpy(sysdatetime,sysdate+4);
	strcat(sysdatetime,systime);
	memcpy(elect_req_t->datetime,sysdatetime,10);
	memcpy(elect_req_t->tracenum,sysdate,8);
	sprintf(serialno,"%010d",in_pack->lvol6);
	memcpy(elect_req_t->tracenum+8,serialno,10);
	memcpy(elect_req_t->retnum,"0000",4);
	memcpy(elect_req_t->clientid,"0001",4);
	memset(outmd5,'0',32);
	if(flag==1){
		sprintf(elect_req_t->signcheck,"%s",outmd5);
	}else if(flag==2){
		memcpy(buf,elect_req_t->type,105);	
		writelog(LOG_ERR,"buf data=[%s]",buf);
		CalcMD5(buf,105,soutmd5);
		dec2hex(soutmd5,16,outmd5);
		writelog(LOG_ERR,"outmd5 data=[%s]",outmd5);
		sprintf(elect_req_t->signcheck,"%s",outmd5);
	}	
	
	
	return 0;
	
}
开发者ID:nykma,项目名称:ykt4sungard,代码行数:75,代码来源:ext_consumer.cpp

示例11: packege_send_data

static int packege_send_data(ST_PACK *in_pack,int flag,char *send_data){
	int ret =0;
	//char cellphone[31]="";	//充值手机号
	double money=0;			//充值金额
	char sysdate[11]="";
	char systime[9]="";
	char sysdatetime[20]="";
	char serialno[20]="";
	char sMoney[20]="";
	T_t_pif_card	tCard;
//	ext_phone_trans_t phone_trans_struct;
	ext_phone_trans_t* phone_trans_struct;
	phone_trans_struct=(ext_phone_trans_t*)send_data;
	
	memset(&tCard,0,sizeof(tCard));
	memset(phone_trans_struct,0,sizeof(ext_phone_trans_t));
	
	phone_trans_struct->prix[0]=0x31;
	memcpy(phone_trans_struct->length,"0067",4);
	if(1==flag)
	{
		memcpy(phone_trans_struct->type,"0100",4);
	}
	else if(2==flag)
	{
		memcpy(phone_trans_struct->type,"0200",4);		
	}
	//memcpy(phone_trans_struct->bitery,"0000000000000000",16);
	memset(phone_trans_struct->bitery,'0',sizeof(phone_trans_struct->bitery));
	ret=DB_t_pif_card_read_by_card_id(in_pack->lvol0, &tCard);
	if(ret)
	{
		if(DB_NOTFOUND==ret)
			ret=E_CARDNO_NOT_EXIST;
		else
			ret=E_DB_CARD_R;
		return ret;
	}
	sprintf(phone_trans_struct->cutid,"%-22d",tCard.cosumer_id);	
	money = in_pack->damt1;
	int i_money=D2I(D4U5(money*100,0));
	sprintf(sMoney,"%07d",i_money);
	memcpy(phone_trans_struct->money,sMoney,sizeof(phone_trans_struct->money));
	ret=get_datetime_from_db(sysdate,systime);
	if(ret)
	{
		writelog(LOG_ERR,"get_datetime_from_db error,error code=[%d]",ret);
		getsysdate(sysdate);
		getsystime(systime);
	}
	strcpy(sysdatetime,sysdate+4);
	strcat(sysdatetime,systime);
	memcpy(phone_trans_struct->datetime,sysdatetime,10);
	memcpy(phone_trans_struct->tracenum,sysdate,8);
	sprintf(serialno,"%06d",in_pack->lvol6%1000000);
	memcpy(phone_trans_struct->tracenum+8,serialno,6);
	memcpy(phone_trans_struct->phone,in_pack->sphone,strlen(in_pack->sphone));
	memcpy(phone_trans_struct->retnum,"00",2);
	memset(phone_trans_struct->plugdata,0x20,sizeof(phone_trans_struct->plugdata));

	/*
	memcpy(send_data,phone_trans_struct->prix,1);
	memcpy(send_data+1,phone_trans_struct->length,4);
	memcpy(send_data+5,phone_trans_struct->type,4);
	memcpy(send_data+9,phone_trans_struct->bitery,16);
	memcpy(send_data+25,phone_trans_struct->cutid,22);
	memcpy(send_data+47,phone_trans_struct->money,7);
	memcpy(send_data+54,phone_trans_struct->datetime,10);
	memcpy(send_data+64,phone_trans_struct->tracenum,14);
	memcpy(send_data+78,phone_trans_struct->phone,11);
	memcpy(send_data+89,phone_trans_struct->retnum,2);
	memcpy(send_data+91,phone_trans_struct->plugdata,36);
	*/
	writelog(LOG_ERR,"package send data=[%s]",send_data);
	return 0;
	
}
开发者ID:nykma,项目名称:ykt4sungard,代码行数:77,代码来源:ext_consumer.cpp

示例12: F847119


//.........这里部分代码省略.........
			writelog(LOG_ERR,"input card_id [%d],tradeserial card_id[%d]",card_id,old_tradeserial.card_id);
			*pRetCode=E_CARDNO_SERIAL_NE;
			goto L_RETU;
		}
		serial_type=old_tradeserial.serial_type;
		flag=TYPE_CUR;
	}
	else
	{
		ret=DB_t_tif_tradeserial_his_read_by_bak_date_and_serial_no(operate_date,iSerialno,&tradeserialhis);
		if(ret)
		{
			writelog(LOG_ERR,"operate_date[%s]Serialno[%d]",operate_date,iSerialno);
			if(DB_NOTFOUND==ret)
				*pRetCode=E_SERIALNO_NOT_EXIST;
			else
				*pRetCode=E_DB_TRADESERIAL_R;
			goto L_RETU;
		}
		if(card_id!=tradeserialhis.card_id)
		{
			writelog(LOG_ERR,"input card_id [%d],tradeserial card_id[%d]",card_id,tradeserialhis.card_id);
			*pRetCode=E_CARDNO_SERIAL_NE;
			goto L_RETU;
		}
		serial_type=tradeserialhis.serial_type;
		flag=TYPE_HIS;
	}
	if(TYPE_CUR==flag)
	{
		seri_in_bala=old_tradeserial.in_balance;
		seri_out_bala=old_tradeserial.out_balance;
		strncpy(tx_date,old_tradeserial.operate_date,sizeof(tx_date));
		dAmt=D4U5(old_tradeserial.out_balance-old_tradeserial.in_balance,2); 		//发生额=出卡值-入卡值
	}
	else
	{
		seri_in_bala=tradeserialhis.in_balance;
		seri_out_bala=tradeserialhis.out_balance;
		strncpy(tx_date,tradeserialhis.operate_date,sizeof(tx_date));
		dAmt=D4U5(tradeserialhis.out_balance-tradeserialhis.in_balance,2); 		//发生额=出卡值-入卡值
	}
	des2src(old_physical_no,tCard.physical_no);
	trim(physical_no);
	trim(old_physical_no);
	switch(serial_type)
	{
		//发行正式卡
		case  847101:
		//补办正式卡
		case  847104:
		//发行过渡临时卡
		case 847116:
		//发行非记名临时卡
		case 847124:
		case 847125:
		case 847126:
			if(strcmp(old_physical_no,physical_no)!=0)
			{
				ret=IsExistCardByPhyCardNo(physical_no);
				if(ret)
				{
					*pRetCode = ret;
					goto L_RETU;
				}
				//修改卡标志,置为正常状态
开发者ID:nykma,项目名称:ykt4sungard,代码行数:67,代码来源:F847119.c

示例13: F850020

int F850020(TRUSERID *handle,int iRequest,ST_PACK *rPack,int *pRetCode,char *szMsg)
{
	int ret=0;
	CAccTrans *pAccTrans=CAccTrans::getInstance();
	TRANS& trans=pAccTrans->trans;
	pAccTrans->trans.transcode=TC_WATERBALRETURN;
	des2src(pAccTrans->trans.opercode,rPack->semp);
	pAccTrans->trans.termid=rPack->lwithdraw_flag;
	ret=pAccTrans->InitTrans();
	if(ret)
		return ret;			
    ST_CPACK aPack;
    ST_PACK *outPack = &(aPack.pack);
    memset(&aPack,0,sizeof(aPack));
    ResetNormalCPack(&aPack,0,1);
	SetCol(handle,0);
	SetCol(handle,F_LVOL0,F_LVOL1,F_LVOL2,F_LVOL3,F_LVOL8,F_SDATE0,F_SPHONE3,F_SADDR,F_LVOL5,F_LVOL9,F_LSAFE_LEVEL,F_LSAFE_LEVEL2,
		F_SDATE3,F_STIME3,F_SEMP,F_LWITHDRAW_FLAG,F_LSERIAL1,F_VSMESS,0);
	trans.cardflag=1;
	trans.usecardflag=1;	
	trans.cardno=rPack->lvol0;	
	trans.purseno=PURSE_NO_ONE;
	trans.dpscnt=rPack->lvol5+1;
	trans.cardbefbal=rPack->lvol7/100.0;
	trans.cardaftbal=trans.cardbefbal;
	des2src(trans.cardphyid,rPack->sstation1);
	
	double waterbefbal = D4U5(rPack->lsafe_level/100.0);
	double wateraftbal = 0;
	trans.inputamt= waterbefbal;	

	T_t_pursetype  pursetype;

	memset(&pursetype,0,sizeof(pursetype));

	pursetype.pursetype=rPack->lvol1;
	if(pursetype.pursetype<1)
	{
		ERRTIP("请输入小钱包类型");
		return E_COMMON_ERR;
	}
	ret=DB_t_pursetype_read_by_pursetype(pursetype.pursetype,&pursetype);
	if(ret)
	{
		if(DB_NOTFOUND==ret)
		{	
			ERRTIP("钱包类型[%d]不存在",pursetype.pursetype);
			return E_COMMON_ERR;
		}
		else
			return E_DB_PURSETYPE_R;
	}
	if(!pursetype.enableflag)
	{
		ERRTIP("钱包类型[%d]未启用",pursetype.pursetype);
		return E_COMMON_ERR;
	}
	if(!pursetype.refundflag)
	{
		ERRTIP("钱包类型[%d]不允许退款",pursetype.pursetype);
		return E_COMMON_ERR;		
	}
	if(amtcmp(trans.inputamt,pursetype.pursemaxbal)>0)
		trans.inputamt=pursetype.pursemaxbal;
	T_t_card  tCard;
	memset(&tCard,0,sizeof(tCard));

	T_t_account tAccount;
	memset(&tAccount,0,sizeof(tAccount));
	
	ret=pAccTrans->CheckAcc(&tCard,&tAccount);
	if(ret)
	{
		writelog(LOG_ERR,"检查状态失败");
		return ret;
	}
	T_t_cardbalance  cardbalance;
	memset(&cardbalance,0,sizeof(cardbalance));
	ret=DB_t_cardbalance_read_lock_by_c0_and_accno_and_pursetype(tAccount.accno,pursetype.pursetype,&cardbalance);
	if(ret)
	{
		if(DB_NOTFOUND==ret)
			return E_DB_CARDBALANCE_N;
		else
			return E_DB_CARDBALANCE_R;
	}
	if(rPack->lvol2)
	{
		//有卡
		if(amtcmp(trans.inputamt,cardbalance.balance)>0)
			trans.inputamt=cardbalance.balance;	
	}
	else
	{
		//无卡
		if(amtcmp(cardbalance.cardbal,cardbalance.balance)>0)
			trans.inputamt=cardbalance.balance;
		else		
			trans.inputamt=cardbalance.cardbal;
	}
//.........这里部分代码省略.........
开发者ID:nykma,项目名称:ykt4sungard,代码行数:101,代码来源:F850020.cpp

示例14: F847104


//.........这里部分代码省略.........
	if(tCustomer.fee_type<1)
	{
		ret=DB_t_pif_spefee_read_by_dept_code_and_cut_type(tCustomer.classdept_no, tCustomer.cut_type,&tSpeFee);
		if(ret)
		{
			if(DB_NOTFOUND==ret)
			{
				tCustomer.fee_type=tCustomer.cut_type;
			}
			else
			{
				DB_t_cif_customer_free_lock_cur();
				*pRetCode=E_DB_SPEFEE_R;
				goto L_RETU;
			}
		}
		else
		{
			tCustomer.fee_type=tSpeFee.fee_type;
		}
		//更新客户表的收费类别字段
		ret=DB_t_cif_customer_update_lock_by_cur(&tCustomer);
		if(ret)
		{
			if(DB_NOTFOUND==ret)
				*pRetCode= E_CUSTOMER_NOT_EXIST;
			else
				*pRetCode= E_DB_CUSTOMER_U;
			goto L_RETU;
		}
	}
	DB_t_cif_customer_free_lock_cur();

	tradeserial.trade_fee =D4U5(rPack->damt0,2);
	//	准备数据插入卡信息表
	memcpy(seed_key,STATIC_SEED_KEY,16);			//读种子密钥
	if(strlen(tCustomer.can_time)==8)
	{
		ret=IsInvalidDateTime(tCustomer.can_time,"YYYYMMDD");
		if(ret)
		{
			*pRetCode=E_TB_CUSTOMER_ENDTIME;
			goto L_RETU;
		}
		if(strncmp(tCustomer.can_time,sysdate,8)<=0)
		{
			*pRetCode=E_TB_CUSTOMER_ENDTIME;
			goto L_RETU;
		}
		des2src(card_endtime,tCustomer.can_time);
	}
	else if(strlen(rPack->sdate0)==0)
	{
		*pRetCode=E_TB_CUSTOMER_NO_ENDTIME;
		goto L_RETU;
	}
	else
	{
		ret=IsInvalidDateTime(rPack->sdate0,"YYYYMMDD");
		if(ret)
		{
			*pRetCode = E_INPUT_DATE;
			goto L_RETU;
		}
		if(strncmp(rPack->sdate0,sysdate,8)<=0)
		{
开发者ID:nykma,项目名称:ykt4sungard,代码行数:67,代码来源:F847104.c

示例15: F847101


//.........这里部分代码省略.........
	if(tCustomer.fee_type<1)
	{
		ret=DB_t_pif_spefee_read_by_dept_code_and_cut_type(tCustomer.classdept_no, tCustomer.cut_type,&tSpeFee);
		if(ret)
		{
			if(DB_NOTFOUND==ret)
			{
				tCustomer.fee_type=tCustomer.cut_type;
			}
			else
			{
				DB_t_cif_customer_free_lock_cur();
				*pRetCode=E_DB_SPEFEE_R;
				goto L_RETU;
			}
		}
		else
		{
			tCustomer.fee_type=tSpeFee.fee_type;
		}
		//更新客户表的收费类别字段
		ret=DB_t_cif_customer_update_lock_by_cur(&tCustomer);
		if(ret)
		{
			if(DB_NOTFOUND==ret)
				*pRetCode= E_CUSTOMER_NOT_EXIST;
			else
				*pRetCode= E_DB_CUSTOMER_U;
			goto L_RETU;
		}
	}
	DB_t_cif_customer_free_lock_cur();

	tradeserial.trade_fee =D4U5(rPack->damt0,2);

	//检查金额是否超过最大额度
	ret=GetParameter(GLOBE_MAXCARDBALANCE,sMaxCardBalance);
	if(ret)
	{
		*pRetCode=ret;
		goto L_RETU;
	}
	dMaxCardBalance=atof(sMaxCardBalance);
	if(amtcmp(tradeserial.trade_fee,dMaxCardBalance)>0)
	{
		writelog(LOG_ERR,"tradeserial.trade_fee[%lf]",tradeserial.trade_fee);
		*pRetCode=E_AMT_EXCEED_MAX;
		goto L_RETU;
	}
	//	准备数据插入卡信息表
	memcpy(seed_key,STATIC_SEED_KEY,16);			//读种子密钥

	if(strlen(tCustomer.can_time)==8)
	{
		ret=IsInvalidDateTime(tCustomer.can_time,"YYYYMMDD");
		if(ret)
		{
			*pRetCode=E_TB_CUSTOMER_ENDTIME;
			goto L_RETU;
		}
		if(strncmp(tCustomer.can_time,sysdate,8)<=0)
		{
			*pRetCode=E_TB_CUSTOMER_ENDTIME;
			goto L_RETU;
		}
		des2src(card_endtime,tCustomer.can_time);
开发者ID:nykma,项目名称:ykt4sungard,代码行数:67,代码来源:F847101.cpp


注:本文中的D4U5函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。