當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetLogicDate函數代碼示例

本文整理匯總了C++中GetLogicDate函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetLogicDate函數的具體用法?C++ GetLogicDate怎麽用?C++ GetLogicDate使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetLogicDate函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: F847105

int F847105(TRUSERID *handle,int iRequest,ST_PACK *rPack,int *pRetCode,char *szMsg)
{

	int ret =0;
	int i=0;
	int origin_card_id = 0;
	int bill_type=0;
	char physical_no[40+1] = "";
	char logicdate[11] = "";												//業務日期
	char sysdate[11]="";
	char lost_date[11]="";
	char systime[9]="";
	char sEndDate[9]="";
	char sMsg[256]="";
	T_t_pif_card		tCard;
	T_t_pif_cardlossinfo cardlossinfo;
	T_t_tif_tradeserial  tradeserial;
//	T_t_tif_savdtl tSavdtl;
	InAcc  IA;

	memset(&tCard,0,sizeof(tCard));
	memset(&cardlossinfo,0,sizeof(cardlossinfo));
	memset(&tradeserial,0,sizeof(tradeserial));
//	memset(&tSavdtl,0,sizeof(tSavdtl));
	memset(&IA,0,sizeof(IA));

	getsysdate(sysdate);
	getsystime(systime);
	ret=GetLogicDate(logicdate);											//業務日期
	if(ret)
	{
		*pRetCode=ret;
		goto L_RETU;
	}
	origin_card_id = rPack->lvol1;   										//原卡號
	des2src(physical_no, rPack->sbank_acc);							//物理卡號
	if(rPack->lvol1<1)
	{
		*pRetCode=E_INPUT_CARDNO_CANNOT_NULL;
		goto L_RETU;
	}
	//查詢支票經費本有無充值記錄
	/*
	ret=ChkSavdtl(origin_card_id,&tSavdtl);
	if(ret)
	{
		writelog(LOG_ERR,"ChkSavdtl ret[%d]",ret);
		*pRetCode=ret;
		goto L_RETU;
	}
	//Added by hhd at 2006-06-29 begin
	//增加判斷:如果入卡值大於100,檢查經費本知否充值過
	//否則不加任何判斷,退款到現金中
	if(amtcmp(rPack->damt2,100.00)<0)
	{
		tSavdtl.bill_type=TYPE_CASH;
	}
	*/
	//Added by hhd at 2006-06-29 end

	tradeserial.other_seri_no = 0;										//上傳端流水號
	tradeserial.serial_type=TXCODE_CALLBACK_CARD;						//功能號
	tradeserial.serial_state = SERISTAT_DEBT;								//流水狀態
	des2src(tradeserial.operate_date,sysdate);							//發生日期
	des2src(tradeserial.operate_time,systime);							//發生時間
	des2src(tradeserial.collect_date,sysdate);								//采集日期
	des2src(tradeserial.collect_time,systime);								//采集時間
	des2src(tradeserial.enteract_date,logicdate);							//處理日期
	des2src(tradeserial.enteract_time,systime);							//處理時間
	tradeserial.maindevice_id = rPack->lvol6;								//上傳工作站標識
	tradeserial.device_id = rPack->lvol7;									//采集設備標識
	tradeserial.purse_id = PURSE_NO_ONE;								//錢包號
	tradeserial.sys_id = 0;												//外部係統標識
	des2src(tradeserial.oper_code, rPack->scust_limit);					//操作員號
	tradeserial.card_id=origin_card_id;
	ret=DB_t_pif_card_read_lock_by_cur_and_card_id(origin_card_id,&tCard);
	if(ret)
	{
		if(DB_NOTFOUND==ret)
			*pRetCode= E_CARDNO_NOT_EXIST;
		else
			*pRetCode= E_DB_CARD_R;
		goto L_RETU;
	}
//	writelog(LOG_DEBUG,"input card_id[%d] card_id[%d]",origin_card_id,tCard.card_id);
	tradeserial.customer_id = tCard.cosumer_id;							//客戶標識
	if(strncmp(tCard.state_id,CARDSTAT_REG,4)==0)
	{
		//檢查物理卡號是否一致
		trim(physical_no);
		trim(tCard.physical_no);
		if(strcmp(tCard.physical_no,physical_no)!=0)
		{
			DB_t_pif_card_free_lock_by_cur();
			writelog(LOG_ERR,"db physical_no[%s],input physical_no[%s]",tCard.physical_no,physical_no);
			*pRetCode= E_CARD_PHYNO_DIFFER;
			goto L_RETU;
		}
	}
	else if('2'==tCard.state_id[CARDSTAT_TYPE_REG])
//.........這裏部分代碼省略.........
開發者ID:nykma,項目名稱:ykt4sungard,代碼行數:101,代碼來源:F847105.c

示例2: Do_Compare_file_shoudong

int Do_Compare_file_shoudong()
{
///*
	FILE *fp;
	TIniFile tf;
	char path_name[256]="";
	char file_name[256]="";
	int ret=0;
	int cnt=0;
	int i=0;

	BANK_COMPARE_RECODE compare,compare1;
	T_t_tif_bank_comp	bank_comp;
	T_t_tif_report_trans_comp trans_comp;
	T_t_tif_tradeserial	tradeserial;
	T_t_tif_tradeserial_his his_tradeserial;
	T_t_tif_diff_transfer  diff_transfer;

	char logicdate[10]="";
	char tmp_date[10]="";
	char forward_date[10]="";

	double trans_count=0;
	double bank_count=0;
	double trans_amt=0;
	double bank_amt=0;
	double second=0;

	double temp=0;
	char *p=getenv("BIN_PATH");

	ret=GetLogicDate(logicdate);								//業務日期
	if(ret)
	{
		writelog(LOG_ERR,"GetLogicDate error,errcode=[%d]",ret);
		return ret;
	}

	ret=datetime2second(logicdate, "YYYYMMDD", &second);
	if(ret)
	{
		writelog(LOG_ERR,"datetime2second error,errcode=[%d]",ret);
		return 	ret;
	}
	 //trans_count=0;
	 //bank_count=0;
	 //trans_amt=0;
	// bank_amt=0;

	second=second-24*60*60;
	ret=second2datetime(second, forward_date, "YYYYMMDD");
	if(ret)
	{
		writelog(LOG_ERR,"second2datetime error,errcode=[%d]",ret);
		return 	ret;
	}

	memset(&bank_comp,0,sizeof(bank_comp));
	memset(&compare,0,sizeof(compare));
	memset(&trans_comp,0,sizeof(trans_comp));
	memset(&tradeserial,0,sizeof(tradeserial));
	memset(&his_tradeserial,0,sizeof(his_tradeserial));

	memset(&compare1,0x30,sizeof(compare1));

	ret=DB_t_tif_report_trans_comp_read_by_cmp_date(forward_date,&trans_comp);
	if(ret!=100&&ret!=0)
	{
		writelog(LOG_ERR,"DB_t_tif_report_trans_comp_read_by_cmp_date error,errcode=[%d]",ret);
		goto LRet;
	}
	if(1==trans_comp.cmp_flag)
	{
		writelog(LOG_ERR,"trans_comp.cmp_flag =1,already compare!");
		goto LRet;
	}
	//配置環境變量
	if(p==NULL)
	{
	   	writelog(LOG_ERR,"Cann't get env HOME PATH\n");
	   	return -1;
	}
	//sprintf(path_name,"%s/ftp",p);
	sprintf(path_name,"%s",p);
	//strcpy(path_name,"/bank/ykt/src/bank/ftp");
	sprintf(file_name,"%s/XYK00002.%8.8s",path_name,forward_date);
	writelog(LOG_ERR,"Open indirect file=[%s]",file_name);
	if((fp = fopen(file_name,"rb"))==NULL)
	{
		writelog(LOG_ERR,"Open indirect file error,file=[%s]",file_name);
		return	-1;
	}

	while(!feof(fp))
	{
		memset(&bank_comp,0,sizeof(bank_comp));
		memset(&compare,0,sizeof(compare));
		cnt++;
		if(NULL==fgets((char *)(&compare),sizeof(compare),fp))
		{
//.........這裏部分代碼省略.........
開發者ID:nykma,項目名稱:ykt4sungard,代碼行數:101,代碼來源:transinfo.cpp

示例3: 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]="";
	char buf[64] = "";
	int write_failed = 0;
	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);
//.........這裏部分代碼省略.........
開發者ID:nykma,項目名稱:ykt4sungard,代碼行數:101,代碼來源:F847104.c

示例4: do_849009

/**
 * \brief 處理網銀轉賬入賬業務
 * \param in_pack 請求報文包
 * \param out_pack 輸出報文包
 * \param online_tx 聯機交易,當為1時,如果個人賬戶已注銷,則不能交易,
 *					當為0時,如果個人賬戶已注銷,則借記 現金,貸記 營業成本
 */
int do_849009(ST_PACK *in_pack,char *szMsg,ST_PACK *out_pack,int online_tx)
{
	int cust_id,card_id;
	int subsidy_no;
	int ret,count;
	char temp[64];
	double max_subsidy_money = 0.0;
	double total_money,dSerial;
	T_t_tif_subsidy subsidy;
	T_t_tif_tradeserial tSerial;
	T_t_aif_account account;
	T_t_tif_meslist tMesList;
	InAcc IA;
	if(amtcmp(in_pack->damt0,0.0) <= 0)
	{
		writelog(LOG_DEBUG,"input money error!");
		return E_INPUT_AMT;
	}

	memset(temp,0,sizeof temp);
	ret = GetParameter(GLOBAL_MAX_PER_SUBSIDY,temp);
	if(ret)
	{
		return ret;
	}
	max_subsidy_money = D4U5(atof(temp),2);
	
	// 流水號
	ret = getNewUniqNo(KEYTYPE_TRADESERIAL,&dSerial);
	if(ret)
	{
		return ret;
	}
	// 查詢卡信息
	ret = do_849008_query(in_pack,&cust_id,&card_id);
	if(ret)
	{
		writelog(LOG_DEBUG,"query customer information error!,ret[%d]",ret);
		return ret;
	}

	// 賬戶信息
	memset(&account,0,sizeof account);
	ret = DB_t_aif_account_read_by_card_id_and_purse_id(card_id,in_pack->lvol3,&account);
	if(ret)
	{
		// 賬戶表無信息
		if(DB_NOTFOUND == ret)
			return E_DB_ACCOUNT_N;
		else
			return E_DB_ACCOUNT_R;

	}
	// 生成流水記錄
	memset(&tSerial,0,sizeof tSerial);
	writelog(LOG_DEBUG,"cust_id[%d],Serial_no[%d]]",cust_id,in_pack->lvol2);
	ret = do_849008_query_serial(cust_id,in_pack->lvol2,&tSerial);
	if(ret)
	{
		return ret;
	}
	// 認為已經入賬成功,直接返回結果
	if(tSerial.serial_no > 0)
	{
		out_pack->lvol0 = tSerial.card_id;
		out_pack->lvol1 = tSerial.serial_no;
		out_pack->lvol2 = tSerial.customer_id;
		out_pack->damt0 = tSerial.trade_fee;
		return 0;
	}
	
	memset(&IA,0,sizeof IA);

	tSerial.serial_no = D2I(dSerial);
	tSerial.serial_type = TXCODE_NETFEE_TRANS; // 網銀轉賬
	tSerial.serial_state = SERISTAT_DEBT;
	des2src(tSerial.oper_code,in_pack->scust_no2);
	des2src(tSerial.operate_date,in_pack->sdate0);
	des2src(tSerial.operate_time,in_pack->stime0);
	GetLogicDate(tSerial.enteract_date);
	getsystime(tSerial.enteract_time);
	getsysdate(tSerial.collect_date);
	des2src(tSerial.collect_time,tSerial.enteract_time);
	tSerial.customer_id = cust_id;
	tSerial.card_id = card_id;
	tSerial.in_balance = 0.0;
	tSerial.out_balance = 0.0;
	tSerial.trade_fee = in_pack->damt0;
	tSerial.other_seri_no = in_pack->lvol2; // 銀行端流水號

	if(account.current_state >= ACCOUNTSTAT_LOGOUT)
	{
		// 個人賬戶已經注銷
//.........這裏部分代碼省略.........
開發者ID:nykma,項目名稱:ykt4sungard,代碼行數:101,代碼來源:F849009.cpp

示例5: 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);
	T_t_tif_meslist tMesList;
	T_t_pif_device t_device;
	T_t_pif_syskey tSyskey;

	memset(&t_device,0,sizeof t_device);
	memset(&tMesList,0,sizeof tMesList);
	memset(&tSavdtl,0,sizeof(tSavdtl));
	memset(&tSubsidy,0,sizeof(tSubsidy));
	memset(&tSyskey,0,sizeof tSyskey);
	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=get_batch_no_by_subsidy_no(tSubsidy.subsidy_no,tSubsidy.batch_no);
	if(ret)
	{
		*pRetCode = E_DB_SUBSIDYTMP_R;
		goto L_RETU;
	}
	*/
	// 下發補助時才生成批次號
	/*
	ret=judge_with_max_subsidy_no_within_new(tSubsidy.subsidy_no);
//.........這裏部分代碼省略.........
開發者ID:nykma,項目名稱:ykt4sungard,代碼行數:101,代碼來源:F847132.cpp

示例6: F847102

int F847102(TRUSERID *handle,int iRequest,ST_PACK *rPack,int *pRetCode,char *szMsg)
{
  	int ret = 0;
//	char logicdate[11] = "";
//	char enddate[10 + 1] = "";
	int	card_id = 0;
	char	Operator[33+1] = "";
//	int	Cut_id  = 0;
	int	maindevice_id = 0;
	int	device_id = 0;
	char logicdate[11]="";
	char sysdate[11]="";
	char systime[9]="";
	double	dUniqno = 0;
	T_t_pif_cardlossinfo cardlossinfo;
	T_t_tif_black_sheet black_sheet;
	T_t_tif_tradeserial  tradeserial;
       T_t_tif_meslist tMesList;
	T_t_pif_card	tCard;

	memset(&tradeserial,0,sizeof(tradeserial));
	memset(&cardlossinfo,0,sizeof(cardlossinfo));
	memset(&black_sheet,0,sizeof(black_sheet));
	memset(&tMesList,0,sizeof(tMesList));
	memset(&tCard,0,sizeof(tCard));

	getsysdate(sysdate);
	getsystime(systime);
	ret=GetLogicDate(logicdate);								//業務日期
	if(ret)
	{
		*pRetCode=ret;
		goto L_RETU;
	}
	card_id = rPack->lvol1;													//卡標識
//	Cut_id = rPack->lvol0;													//客戶號
	des2src(Operator,rPack->scust_limit);									//操作員號
	maindevice_id = rPack->lvol6;											//上傳工作站標識
	device_id = rPack->lvol7;												//采集設備標識

	//	檢查客戶信息,判斷是否可以掛失
	//修改卡標誌,置為正常狀態
	ret=DB_t_pif_card_read_lock_by_cur_and_card_id(card_id, &tCard);
	if(ret)
	{
		writelog(LOG_ERR,"card_id[%d]",card_id);
		if(DB_NOTFOUND==ret)
			*pRetCode= E_CARDNO_NOT_EXIST;
		else
			*pRetCode= E_DB_CARD_R;
		goto L_RETU;
	}
	if(card_id!=tCard.card_id)
	{
		DB_t_pif_card_free_lock_by_cur();
		writelog(LOG_ERR,"card_id[%d] db card_id[%d]",card_id,tCard.card_id);
		*pRetCode=E_DB_CARD_R;
		goto L_RETU;
	}
	if('2'==tCard.state_id[CARDSTAT_TYPE_REG])
	{
		DB_t_pif_card_free_lock_by_cur();
		*pRetCode = E_CARDNO_LOGOUT;
		goto L_RETU;
	}
	if('3'==tCard.state_id[CARDSTAT_TYPE_REG])
	{
		DB_t_pif_card_free_lock_by_cur();
		*pRetCode = E_CARDNO_WFAIL;
		goto L_RETU;
	}	
	if(STATE_TRUE==tCard.state_id[CARDSTAT_TYPE_LOST])
	{
		DB_t_pif_card_free_lock_by_cur();
		*pRetCode = E_CARDNO_LOST;
		goto L_RETU;
	}
	tCard.state_id[CARDSTAT_TYPE_LOST]=STATE_TRUE;
	//	修改卡狀態為掛失
	ret=DB_t_pif_card_update_lock_by_cur(&tCard);
	if(ret)
	{
		writelog(LOG_ERR,"card_id[%d]",card_id);
		if(DB_NOTFOUND==ret)
			*pRetCode= E_CARDNO_NOT_EXIST;
		else
			*pRetCode= E_DB_CARD_U;
		goto L_RETU;
	}
	DB_t_pif_card_free_lock_by_cur();

	//	插入卡掛失有效期限表
/*
	ret=GetLostCardValiddate(sysdate,enddate);											//獲得掛失有效期限
	if (ret)
	{
		*pRetCode = ret;
		goto L_RETU;
	}
	cardlossinfo.card_id = card_id;													//卡號
//.........這裏部分代碼省略.........
開發者ID:nykma,項目名稱:ykt4sungard,代碼行數:101,代碼來源:F847102.c

示例7: tend_to_enter_account

///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
//係統模擬入賬
 int tend_to_enter_account(ST_PACK *in_pack,InAcc *IA,int trade_code,T_t_tif_tradeserial *tradeserial){
	int ret = 0;
	int i=0;
	int	card_id = 0;
	char	Operator[33+1] = "";
	int	maindevice_id = 0;
	int	device_id = 0;
	char logicdate[11]="";
	char sysdate[11]="";
	char systime[9]="";
	double dUniqno = 0;
	char sMsg[256]="";

	T_t_cif_customer 	tCustomer;
	T_t_pif_spefee 	tSpeFee;
	T_t_aif_account	tAccount;
	T_t_pif_card	tCard;


	memset(&tCustomer,0,sizeof(tCustomer));
	memset(&tSpeFee,0,sizeof(tSpeFee));
	memset(&tAccount,0,sizeof(tAccount));
	memset(&tCard,0,sizeof(tCard));

	card_id=in_pack->lvol0;
	
	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);
		return ret;
	}
	ret=GetLogicDate(logicdate);								//業務日期
	if(ret)
	{
		writelog(LOG_ERR,"GetLogicDate error,errcode=[%d]",ret);
		return ret;
	}

	ret=DB_t_pif_card_read_by_card_id(card_id, &tCard);
	if(ret)
	{
		if(DB_NOTFOUND==ret)
			ret=E_CARDNO_NOT_EXIST;
		else
			ret=E_DB_CARD_R;
		return ret;
	}


	if(strncmp(tCard.state_id,CARDSTAT_REG,4)!=0)
	{
		if('2'==tCard.state_id[CARDSTAT_TYPE_REG])
			ret= E_CARDNO_LOGOUT;
		else if('3'==tCard.state_id[CARDSTAT_TYPE_REG])
			ret = E_CARD_CHANGE;
		else if(tCard.state_id[CARDSTAT_TYPE_LOST]==STATE_TRUE)
			ret=E_CARDNO_LOST;
		else if(tCard.state_id[CARDSTAT_TYPE_FREEZE]==STATE_TRUE)
			ret=E_CARDNO_FREEZE;
		else if(tCard.state_id[CARDSTAT_TYPE_WFAIL]==STATE_TRUE)
			ret=E_CARDNO_WFAIL;
		return ret;
	}

	
	//根據卡號和錢包號得到消費者賬號(借方)
	ret=DB_t_aif_account_read_by_card_id_and_purse_id(card_id, PURSE_NO_ONE,&tAccount);
	if(ret)
	{
		writelog(LOG_ERR,"DB_t_aif_account_read_by_card_id_and_purse_id ret[%d]card_id[%d]",ret,card_id);
		if(DB_NOTFOUND==ret)
			ret=E_ACTNO_NOT_EXIST;
		else
			ret=E_DB_ACCOUNT_R;
		return ret;
	}
	
	ret=DB_t_cif_customer_read_lock_by_cur_and_cut_id(tCard.cosumer_id, &tCustomer);
	if(ret)
	{
		writelog(LOG_ERR,"cut_id[%d]",tCard.cosumer_id);
		if(DB_NOTFOUND==ret)
			ret= E_CUSTOMER_NOT_EXIST;
		else
			ret= E_DB_CUSTOMER_R;
		return ret;
	}
	//得到收費類別
	if(0==tCustomer.fee_type)
	{
		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)
//.........這裏部分代碼省略.........
開發者ID:nykma,項目名稱:ykt4sungard,代碼行數:101,代碼來源:ext_consumer.cpp

示例8: F847127

int F847127(TRUSERID *handle,int iRequest,ST_PACK *rPack,int *pRetCode,char *szMsg)
{
    int i=0;
    int ret =0;
    char logicdate[11]="";										//業務日期
    char sysdate[11]="";
    char systime[9]="";
    InAcc	IA;
    char  ia_buf[1024]="";
    double dUniqno = 0;
    char sMsg[256]="";
    T_t_tif_tradeserial tradeserial;
    ST_CPACK aPack;
    ST_PACK *out_pack = &(aPack.pack);

    memset(&tradeserial,0,sizeof(tradeserial));
    memset(&IA,0,sizeof(IA));
    IA.pVoidPointer=ia_buf;
    ResetNormalCPack(&aPack,0,1);

    if(amtcmp(rPack->damt0,0)==0)
    {
        *pRetCode=E_INPUT_AMT_NULL;
        goto L_RETU;
    }
    trim(rPack->sbank_acc);
    trim(rPack->sbank_acc2);
    if(strcmp(rPack->sbank_acc,rPack->sbank_acc2)==0)
    {
        *pRetCode=E_INPUT_2ACTNO_EQ;
        goto L_RETU;
    }
    trim(rPack->scust_limit);
    trim(rPack->scust_limit2);
    trim(rPack->semp_pwd);
    if(strlen(rPack->scust_limit)==0)
    {
        *pRetCode=E_INPUT_OPER_NULL;
        goto L_RETU;
    }
    if(strlen(rPack->scust_limit2)==0)
    {
        *pRetCode=E_INPUT_OPER_NULL;
        goto L_RETU;
    }
    if(strcmp(rPack->scust_limit,rPack->scust_limit2)==0)
    {
        writelog(LOG_ERR,"oper1[%s]oper2[%s]",rPack->scust_limit,rPack->scust_limit2);
        *pRetCode=E_INPUT_2OPER_EQ;
        goto L_RETU;
    }
    ret=chk_oper_pwd(rPack->scust_limit2,rPack->semp_pwd);
    if(ret)
    {
        if(E_OPER_NOT_EXIST==ret)
            *pRetCode=E_INPUT_OPER_EXIST;
        else if(E_PASSWORD_WRONG==ret)
            *pRetCode=E_INPUT_OPER_PWD;
        else
            *pRetCode=ret;
        goto L_RETU;
    }
    getsysdate(sysdate);
    getsystime(systime);
    ret=GetLogicDate(logicdate);							//業務日期
    if(ret)
    {
        *pRetCode=ret;
        goto L_RETU;
    }
    tradeserial.trade_fee = rPack->damt0;						//發生金額
    ret = getNewUniqNo(KEYTYPE_TRADESERIAL,&dUniqno);  		//獲得最大流水號
    if(ret)
    {
        *pRetCode = ret;
        writelog(LOG_ERR," ERRCODE = [%d]",ret);
        goto L_RETU;
    }

    tradeserial.serial_no = D2I(dUniqno);							//流水號
    tradeserial.other_seri_no = 0;								//上傳端流水號
    tradeserial.serial_type  = TXCODE_CARD_DBCR;				//交易碼
    tradeserial.serial_state = SERISTAT_DEBT;						//流水狀態
    des2src(tradeserial.operate_date,sysdate);					//發生日期
    des2src(tradeserial.operate_time,systime);					//發生時間
    des2src(tradeserial.collect_date,sysdate);						//采集日期
    des2src(tradeserial.collect_time,systime);						//采集時間
    des2src(tradeserial.enteract_date,logicdate);					//處理日期
    des2src(tradeserial.enteract_time,systime);					//處理時間
    tradeserial.maindevice_id = rPack->lvol6;						//上傳工作站標識
    tradeserial.in_balance=rPack->damt0;						//入卡值
    tradeserial.trade_count=0;									//交易次數
    des2src(tradeserial.oper_code,rPack->scust_limit);			//操作員代碼
    des2src(tradeserial.reserve_1,rPack->scust_limit2);			//錯帳操作員代碼
    tradeserial.sys_id = 0;										//外部係統標識

    IA.iCardNo=0;
    IA.iFeeType=1;
    IA.dArrInAmt[0]=tradeserial.trade_fee;
    des2src(IA.sArrInActno[0],rPack->sbank_acc);				//借方帳號
//.........這裏部分代碼省略.........
開發者ID:nykma,項目名稱:ykt4sungard,代碼行數:101,代碼來源:F847127.cpp

示例9: F847106

int F847106(TRUSERID *handle,int iRequest,ST_PACK *rPack,int *pRetCode,char *szMsg)
{
	int i=0;
	int ret =0;
	char logicdate[11]="";										//業務日期
	char sysdate[11]="";
	char systime[9]="";
	int	type=0;
	InAcc	IA;
	double dSerialNo = 0;
	int card_id=0;
	char physical_no[41]="";
	char sMaxCardBalance[20]="";
	char sMsg[256]="";
	double dMaxCardBalance=0;
	T_t_tif_tradeserial  tradeserial;
	T_t_pif_card		tCard;
	T_t_tif_savdtl		tSavdtl;
	T_t_cif_customer tCustomer;
	T_t_pif_spefee 	tSpeFee;
	T_t_aif_account	tAccount;		//帳戶表

	ST_CPACK aPack;
	ST_PACK *out_pack = &(aPack.pack);

	memset(&tSavdtl,0,sizeof(tSavdtl));
	memset(&tCard,0,sizeof(tCard));
	memset(&tAccount,0,sizeof(tAccount));
	memset(&tradeserial,0,sizeof(tradeserial));
	memset(&tCustomer,0,sizeof(tCustomer));
	memset(&tSpeFee,0,sizeof(tSpeFee));
	memset(&IA,0,sizeof(IA));

	ResetNormalCPack(&aPack,0,1);
	SetCol(handle,0);
	SetCol(handle,F_LSERIAL1,F_DAMT2,F_DAMT3,F_VSMESS,0);
	if(amtcmp(rPack->damt0,0)<=0)
	{
		*pRetCode=E_INPUT_AMT;
		goto L_RETU;
	}
	if(amtcmp(rPack->damt1,0)<0)
	{
		*pRetCode=E_INPUT_CARD_BALA;
		goto L_RETU;
	}
	if(rPack->lvol10<1)
	{
		*pRetCode=E_INPUT_CARD_TXCNT;
		goto L_RETU;
	}
	card_id=rPack->lvol0;
	tradeserial.trade_fee = rPack->damt0;					//充值金額
	des2src(physical_no, rPack->sbank_acc);				//物理卡號
	getsysdate(sysdate);
	getsystime(systime);
	ret=GetLogicDate(logicdate);							//業務日期
	if(ret)
	{
		*pRetCode=ret;
		goto L_RETU;
	}
	ret=DB_t_pif_card_read_by_card_id(card_id, &tCard);
	if(ret)
	{
		if(DB_NOTFOUND==ret)
			*pRetCode=E_CARDNO_NOT_EXIST;
		else
			*pRetCode=E_DB_CARD_R;
		goto L_RETU;
	}
	if(strncmp(tCard.state_id,CARDSTAT_REG,4)!=0)
	{
		if('2'==tCard.state_id[CARDSTAT_TYPE_REG])
			*pRetCode = E_CARDNO_LOGOUT;
		else if('3'==tCard.state_id[CARDSTAT_TYPE_REG])
			*pRetCode = E_CARD_CHANGE;
		else if(tCard.state_id[CARDSTAT_TYPE_LOST]==STATE_TRUE)
			*pRetCode=E_CARDNO_LOST;
		else if(tCard.state_id[CARDSTAT_TYPE_FREEZE]==STATE_TRUE)
			*pRetCode=E_CARDNO_FREEZE;
		else if(tCard.state_id[CARDSTAT_TYPE_WFAIL]==STATE_TRUE)
			*pRetCode=E_CARDNO_WFAIL;
		goto L_RETU;
	}
	trim(physical_no);
	trim(tCard.physical_no);
	if(strcmp(tCard.physical_no,physical_no)!=0)
	{
		writelog(LOG_ERR,"db physical_no[%s],input physical_no[%s]",tCard.physical_no,physical_no);
		*pRetCode= E_CARD_PHYNO_DIFFER;
		goto L_RETU;
	}
	//根據卡號和錢包號得到消費者賬號(借方)
	ret=DB_t_aif_account_read_by_card_id_and_purse_id(card_id, PURSE_NO_ONE,&tAccount);
	if(ret)
	{
		writelog(LOG_ERR,"DB_t_aif_account_read_by_card_id_and_purse_id ret[%d]card_id[%d]",ret,card_id);
		if(DB_NOTFOUND==ret)
			*pRetCode=E_ACTNO_NOT_EXIST;
//.........這裏部分代碼省略.........
開發者ID:nykma,項目名稱:ykt4sungard,代碼行數:101,代碼來源:F847106.cpp

示例10: F847183


//.........這裏部分代碼省略.........
	{
		*pRetCode = E_TX_SERIAL_CZ;
		goto L_RETU;
	}
	if (tTradeserial.serial_state != SERISTAT_DEBT)
	{
		*pRetCode = E_TX_SERIAL_CANNOT_CZ;
		goto L_RETU;
	}
	if (amtcmp(tTradeserial.trade_fee, 0) == 0)
	{
		*pRetCode = E_TX_SERIAL_CANNOT_CZ;
		strcpy(szMsg,"交易金額有誤!");
		goto L_RETU;
	}

	ret = DB_t_tradecode_read_by_tradecode(tTradeserial.serial_type, &tTradeCode);
	if (ret)
	{
		if (DB_NOTFOUND == ret)
			*pRetCode = E_DB_TRADECODE_N;
		else
			*pRetCode = E_DB_TRADECODE_R;
		goto L_RETU;
	}

	if (tTradeCode.rush_flag != IS_YES)
	{
		*pRetCode = E_TX_SERIAL_CANNOT_CZ;
		strcpy(szMsg,"該交易不能被衝正");
		goto L_RETU;
	}

	ret = GetLogicDate(logic_date);						//業務日期
	if (ret)
	{
		*pRetCode = ret;
		writelog(LOG_ERR, "GetLogicDate  err ret[%d]", ret);
		goto L_RETU;
	}
	// 小於 0 , 則不判斷
	if (tTradeCode.rush_max_day >= 0)
	{
		ret = DiffDay(logic_date, tTradeserial.enteract_date, &days);
		if (ret)
		{
			*pRetCode = ret;
			goto L_RETU;
		}
		if (days > tTradeCode.rush_max_day)
		{
			writelog(LOG_ERR, "流水入賬日期[%s],已超過期限[%d]天",
					 tTradeserial.enteract_date, days);
			*pRetCode = E_TX_SERIAL_CANNOT_CZ;
			strcpy(szMsg, "流水日期已超過可衝正期限!");
			goto L_RETU;
		}
	}

	if (tTradeCode.restrict_oper == IS_YES)
	{
		if (strcmp(rPack->scust_limit, tTradeserial.opercode) != 0)
		{
			strcpy(szMsg, "必須由作此次交易的操作員來衝正");
			*pRetCode = E_TX_SERIAL_CANNOT_CZ;
			goto L_RETU;
開發者ID:Codiscope-Research,項目名稱:ykt4sungard,代碼行數:67,代碼來源:F847183.cpp

示例11: F847123

int F847123(TRUSERID *handle,int iRequest,ST_PACK *rPack,int *pRetCode,char *szMsg)
{
	int ret=0;
	int card_id=0;
	char sSeedKey[17] = "";							//種子密鑰
	char sPwd[7] = "";							//卡密碼
	char logicdate[11]="";
	char sysdate[11]="";
	char systime[9]="";
	double dSerialno=0;
	T_t_pif_card tCard;
	T_t_cif_customer tCustomer;
	T_t_pif_spefee 	tSpeFee;
	T_t_aif_account  tAccount;
	T_t_tif_tradeserial tTradeserial;
	ST_CPACK aPack;
	ST_PACK *out_pack = &(aPack.pack);

	memset(&tCard,0,sizeof(tCard));
	memset(&tCustomer,0,sizeof(tCustomer));
	memset(&tSpeFee,0,sizeof(tSpeFee));
	memset(&tAccount,0,sizeof(tAccount));
	memset(&tTradeserial,0,sizeof(tTradeserial));
	ResetNormalCPack(&aPack,0,1);
	SetCol(handle,0);
	SetCol(handle,F_LVOL0,F_LVOL1,F_LVOL10,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);

	card_id=rPack->lvol0;
	if(card_id<1)
	{
		*pRetCode=E_INPUT_CARDNO;
		goto L_RETU;
	}
	getsysdate(sysdate);
	getsystime(systime);
	ret=GetLogicDate(logicdate);								//業務日期
	if(ret)
	{
		*pRetCode=ret;
		goto L_RETU;
	}
	//判斷卡狀態是否為寫卡未成功狀態
	ret=DB_t_pif_card_read_lock_by_cur_and_card_id(card_id, &tCard);
	if(ret)
	{
		writelog(LOG_ERR,"card_id[%d]",card_id);
		if(DB_NOTFOUND==ret)
			*pRetCode= E_CARDNO_NOT_EXIST;
		else
			*pRetCode= E_DB_CARD_R;
		goto L_RETU;
	}
	if(card_id!=tCard.card_id)
	{
		writelog(LOG_ERR,"card_id[%d] db card_id[%d]",card_id,tCard.card_id);
		DB_t_pif_card_free_lock_by_cur();
		*pRetCode=E_DB_CARD_R;
		goto L_RETU;
	}
	if('3'!=tCard.state_id[CARDSTAT_TYPE_REG])
	{
		DB_t_pif_card_free_lock_by_cur();
		if('2'==tCard.state_id[CARDSTAT_TYPE_REG])
			*pRetCode=E_CARDNO_LOGOUT;
		else if(STATE_TRUE==tCard.state_id[CARDSTAT_TYPE_LOST])
			*pRetCode=E_CARDNO_LOST;
		else if(STATE_TRUE==tCard.state_id[CARDSTAT_TYPE_FREEZE])
			*pRetCode=E_CARDNO_FREEZE;
		else if(STATE_TRUE==tCard.state_id[CARDSTAT_TYPE_WFAIL])
			*pRetCode=E_CARDNO_WFAIL;
		else if(STATE_TRUE==tCard.state_id[CARDSTAT_TYPE_REG])
			*pRetCode=E_OLDCARDINFO_NOSAVE;
		goto L_RETU;
	}
	trim(rPack->sbank_acc);
	trim(rPack->scust_no);
	trim(rPack->sdate0);
	if(strlen(rPack->scust_no))
	{
		ret=IsExistShowCardNo(rPack->scust_no);
		if(ret)
		{
			*pRetCode = ret;
			goto L_RETU;
		}
	}
	if(strcmp(tCard.physical_no,rPack->sbank_acc)!=0)
	{
		ret=IsExistCardByPhyCardNo(rPack->sbank_acc);
		if(ret)
		{
			*pRetCode = ret;
			goto L_RETU;
		}
	}
	ret=IsInvalidDateTime(rPack->sdate0,"YYYYMMDD");
//.........這裏部分代碼省略.........
開發者ID:nykma,項目名稱:ykt4sungard,代碼行數:101,代碼來源:F847123.c

示例12: F930032

int F930032(TRUSERID *handle,int iRequest,ST_PACK *in_pack,int *pRetCode,char *szMsg) {
    int ret = 0;						//返回碼
    int hi_sign = 0;					//掛失解掛標誌
    double h_temp_Serial_no = 0;		//本地流水號
    char logicdate[11]="";
    char sysdate[11]="";
    char systime[9]="";
    int dev_id=0;
    T_t_tif_tradeserial  tradeserial;

    memset(&tradeserial,0,sizeof(tradeserial));
    hi_sign = in_pack->lvol6;												//掛失解掛標誌

    ret=chk_dyn_key(in_pack->lcert_code,in_pack->scust_limit2);
    if(ret) {
        *pRetCode = ret;
        goto L_RETU;
    }
    getsysdate(sysdate);
    getsystime(systime);
    ret=GetLogicDate(logicdate);												//業務日期
    if(ret) {
        *pRetCode = ret;
        goto L_RETU;
    }
    switch (hi_sign) {
    case 0:
        tradeserial.serial_type = TXCODE_CARD_LOSS;					//掛失
        break;
    case 1:
        tradeserial.serial_type = TXCODE_CARD_COMEBACK_LOSS;			//解掛
        break;
    case 2:
        tradeserial.serial_type = TXCODE_MODIFICATIONPW;				//修改密碼
        break;
    default:
        *pRetCode = -1;
        writelog(LOG_ERR,"掛失解掛修改密碼標誌出錯。ERRCODE[%d] ",*pRetCode);
        goto L_RETU;
        break;
    }
    /*	讀取設備ID	*/
    ret = GetDevIdByDevPhyId(&dev_id,in_pack->sdate1);
    if (ret) {
        *pRetCode = ret;
        writelog(LOG_ERR,"GetDevIdByDevPhyId err[%d] ",ret);
        goto L_RETU;
    }

    tradeserial.serial_state = SERISTAT_NODEBT;								//流水狀態

    ret = getNewUniqNo(KEYTYPE_TRADESERIAL,&h_temp_Serial_no);
    if(ret) {
        *pRetCode = ret;
        writelog(LOG_ERR,"獲取最大流水號錯誤: ERRCODE = [%d]",ret);
        goto L_RETU;
    }
    tradeserial.serial_no = D2I(h_temp_Serial_no);													//流水號

    snprintf(tradeserial.operate_date,9,"20%s",in_pack->spost_code);		//發生日期(格式化輸入的日期)
    des2src(tradeserial.operate_time,in_pack->spost_code2);			//發生時間(格式化輸入的時間)
    des2src(tradeserial.collect_date,sysdate);												//采集日期
    des2src(tradeserial.collect_time,systime);												//采集時間
    des2src(tradeserial.enteract_date,logicdate);											//處理日期
    des2src(tradeserial.enteract_time,systime);											//處理時間
    tradeserial.other_seri_no = in_pack->lvol4;													//上傳端流水號
    tradeserial.serial_state = SERISTAT_DEBT;													//流水狀態
    tradeserial.maindeviceid = in_pack->lcert_code;												//上傳工作站標識
    tradeserial.deviceid = dev_id;														//采集設備標識
    tradeserial.cardno = in_pack->lvol5;														//卡號
    Strncpy_t(tradeserial.showid,in_pack->sstation0,sizeof(tradeserial.showid));						//顯示卡號
    Strncpy_t(tradeserial.oldpwd,in_pack->sstock_code,sizeof(tradeserial.oldpwd));					//原始密碼
    Strncpy_t(tradeserial.newpwd,in_pack->sstock_code2,sizeof(tradeserial.newpwd));				//更新密碼
    des2src(tradeserial.opercode,"system");

    ret = DB_t_tif_tradeserial_add(&tradeserial);
    if (ret) {
        writelog(LOG_ERR,"ret[%d]",ret);
        if(DB_REPEAT==ret)
            *pRetCode = E_DB_TRADESERIAL_E;
        else
            *pRetCode = E_DB_TRADESERIAL_I;
        goto L_RETU;
    }
    return 0;
L_RETU:
    return -1;
}
開發者ID:Codiscope-Research,項目名稱:ykt4sungard,代碼行數:88,代碼來源:F930032.cpp

示例13: F847221


//.........這裏部分代碼省略.........
		*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++)
	{
		if(amtcmp(IA.dArrOutAmt[i],0)!=0)
開發者ID:Codiscope-Research,項目名稱:ykt4sungard,代碼行數:67,代碼來源:F847221.cpp

示例14: F847222

int F847222(TRUSERID *handle,int iRequest,ST_PACK *rPack,int *pRetCode,char *szMsg)
{

	int ret=0;
	char  ia_buf[1024]="";
	char sMsg[256]="";
	double dUniNo;
	InAcc IA;
	T_t_tif_tradeserial serial;
	T_t_aif_account account;
	T_t_cif_shop shop;
	trade_param_t param;
	int shop_id;
	
	ST_CPACK aPack;
	ST_PACK *out_pack = &(aPack.pack);
	int i;

	ResetNormalCPack(&aPack,0,1);

	shop_id = atoi(rPack->sbank_acc);
	if(shop_id <= 0)
	{
		*pRetCode = E_SHOP_ACTNO_NOT_EXIST;
		goto L_RETU;
	}
	if(strlen(rPack->scard0) <= 0)
	{
		*pRetCode = E_OPER_NOT_EXIST;
		goto L_RETU;
	}
	if(amtcmp(rPack->damt1,0)<=0)
	{
		*pRetCode = E_INPUT_AMT;
		goto L_RETU;
	}
	ret = CheckOperatorPwd(rPack->scard0,rPack->semp_pwd);
	if(ret)
	{
		*pRetCode = ret;
		goto L_RETU;
	}

	memset(&account,0,sizeof account);
	memset(&shop,0,sizeof shop);
	
	ret = DB_t_cif_shop_read_by_shop_id(shop_id,&shop);
	if(ret)
	{
		if(DB_NOTFOUND == ret)
			*pRetCode  = E_SHOP_ACTNO_NOT_EXIST;
		else
			*pRetCode = E_DB_SHOP_R;
		goto L_RETU;
	}
	if(strcmp(shop.is_indep, TYPE_YES))
	{
		*pRetCode = E_FAN_SHOP_NOT_INDEP;
		goto L_RETU;
	}
	memset(&IA,0,sizeof IA);
	memset(&param,0,sizeof param);
	param.pIA = &IA;
	IA.pVoidPointer = ia_buf;
	param.shop_id = shop.shop_id;
	param.remain_balance = rPack->damt1;
	
	ret = getNewUniqNo(KEYTYPE_TRADESERIAL,&dUniNo);
	if(ret)
	{
		*pRetCode = ret;
		goto L_RETU;
	}
	param.serial_no = D2I(dUniNo);

	//初始化流水記錄
	memset(&serial,0,sizeof serial);
	serial.serial_no = param.serial_no;
	serial.serial_state = SERISTAT_DEBT;
	serial.serial_type = TXCODE_FAN_BALANCE;
	// 借用顯示卡號字段保存商戶號
	sprintf(serial.showid,"%d",param.shop_id);
	getsysdate(serial.operate_date);
	getsystime(serial.operate_time);
	des2src(serial.collect_date,serial.operate_date);
	des2src(serial.collect_time,serial.operate_time);
	// 客戶號
	serial.customer_id = shop.cut_id;
	GetLogicDate(serial.enteract_date);
	des2src(serial.enteract_time,serial.operate_time);

	des2src(serial.oper_code,rPack->scard0);
	des2src(serial.reserve_1,rPack->scert_addr);
	serial.in_balance = param.remain_balance;
	serial.trade_fee = param.remain_balance;

	des2src(param.tx_date,serial.operate_date);
	des2src(param.tx_time,serial.operate_time);
	des2src(param.oper_code,rPack->scard0);
	
//.........這裏部分代碼省略.........
開發者ID:nykma,項目名稱:ykt4sungard,代碼行數:101,代碼來源:F847222.cpp

示例15: F847108

int F847108(TRUSERID *handle,int iRequest,ST_PACK *in_pack,int *pRetCode,char *szMsg)
{
	int ret = 0;
	int card_id = 0;
	char logicdate[11]="";
	double dUniqNo = 0; 
	T_t_pif_card  card;
    T_t_tif_writefailed tWriteFailed;
    
	memset(&card,0,sizeof(card));
    memset(&tWriteFailed, 0, sizeof tWriteFailed);
    
	ret=GetLogicDate(logicdate);								//業務日期
	if(ret)
	{
		*pRetCode=ret;
		goto L_RETU;
	}
	//修改原卡狀態為發卡寫卡失敗狀態
	card_id = in_pack->lvol0;

	if(in_pack->lvol0<1)
	{
		writelog(LOG_ERR,"in_pack->lserial1[%d]",in_pack->lvol0);
		*pRetCode=E_INPUT_CARDNO;
		goto L_RETU;
	}
	if(in_pack->lserial1<1)
	{
		writelog(LOG_ERR,"in_pack->lserial1[%d]",in_pack->lserial1);
		*pRetCode= E_INPUT_SERIALNO;
		goto L_RETU;
	}

	ret=DB_t_pif_card_read_lock_by_cur_and_card_id(card_id, &card);
	if(ret)
	{
		writelog(LOG_ERR,"card_id[%d]",card_id);
		if(DB_NOTFOUND==ret)
			*pRetCode= E_CARDNO_NOT_EXIST;
		else
			*pRetCode= E_DB_CARD_R;
		goto L_RETU;
	}

	if (STATE_FALSE == card.state_id[CARDSTAT_TYPE_WFAIL])
	{
	    card.state_id[CARDSTAT_TYPE_WFAIL]=STATE_TRUE;
	}

	ret=DB_t_pif_card_update_lock_by_cur(&card);
	if(ret)
	{
		writelog(LOG_ERR,"card_id[%d]",card_id);
		if(DB_NOTFOUND==ret)
			*pRetCode= E_CARDNO_NOT_EXIST;
		else
			*pRetCode= E_DB_CARD_U;
		goto L_RETU;
	}
	DB_t_pif_card_free_lock_by_cur();
    
    //寫入寫卡失敗表
	ret = getNewUniqNo(KEYTYPE_WRITEFAILED, &dUniqNo);              //獲得寫卡失敗表最大ID號
    if (ret)
    {
        writelog(LOG_ERR,"ret[%d]",ret);
        *pRetCode = ret;
        goto L_RETU;
    }

	tWriteFailed.id = D2I(dUniqNo);
	tWriteFailed.card_id = card_id;
	tWriteFailed.serial_no = in_pack->lserial1;
	tWriteFailed.serial_type = TXCODE_WRITE_ERROR;
	tWriteFailed.purese_no = PURSE_NO_ONE;
	tWriteFailed.deal_flag[0] = CARDWFAIL_PACKET_DEAL_FLAG_Y;
	des2src(tWriteFailed.tx_date,logicdate);
	des2src(tWriteFailed.comments, "發卡失敗");
	
	ret = DB_t_tif_writefailed_add(&tWriteFailed);
	if (ret)
	{
	    *pRetCode = E_DB_WRITEFAILED_I;
        goto L_RETU;    
	}

/*
	memset(card.comments,0,sizeof(card.comments));
	AddXmlItemStr(card.comments, XML_KEY_OPERATEDATE,logicdate);
	AddXmlItemInt(card.comments,XML_KEY_SERIALNO,in_pack->lserial1);
	AddXmlItemInt(card.comments,XML_KEY_TRADECODE,in_pack->lvol2);
*/	
	return 0;
L_RETU:
	return -1;
}
開發者ID:nykma,項目名稱:ykt4sungard,代碼行數:97,代碼來源:F847108.c


注:本文中的GetLogicDate函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。