⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tx_dispatch.c

📁 UNIX/LINUX平台下面SMS网管原代码
💻 C
📖 第 1 页 / 共 4 页
字号:
	bs->debi_amt = bs->debi_amt/100;	//转账成功之后转账金额还原为原来的金额
	/* 转帐成功后需要更新 转帐金额 */
	if( DB_update_agrr_amt(bs->cid, bs->debi_acct, bs->debi_amt) )
	{
		bs->result = 1002;
		return FAILURE;
	}

	return( SUCCESS) ;
}
/* 
 * 交易码:1604
 * 功能  :一本通转出
 * 客户  :签约客户
 */
int b1604( TRADE_HEAD *tr_h, BIG_STRC *bs)
{
	int ret = -1;
	double aggr_amt = 0.00;
	double max_limit = 0.00;
	int pAccType;
	
	if (strlen(bs->debi_acct) <=4) 
	{
		strcpy(bs->debi_aid,bs->debi_acct);
		memset(bs->debi_acct,'\0',sizeof(bs->debi_acct));
		
	}	
	if((ret = DB_search_acct(bs->debi_acct,bs->cid,bs->debi_aid,pAccType)) != 0)
	{
		if(ret == 100)
		{
			bs->result = 2000 ;		//签约客户不存在 
			return (FAILURE);
		}
		else
		{
			bs->result = 1406 ;
			return (FAILURE);
		}
	}
	pub_trim(bs->debi_acct);
	if(strlen(bs->debi_acct) != 10)
	{
		bs->result= 2005;      //转出帐户类型不符
		return (FAILURE);
	}

	/* 转帐前需要判断转帐金额是否超限 */
	if((ret=DB_seek_limit(&aggr_amt, &max_limit, bs->cid, bs->debi_acct)) !=SUCCESS)
	{
	if(ret==100)
	{
		bms_trace("ret[%d]", ret);
		bs->result = 1500;
		return FAILURE;
	}
	else
		{
		bs->result = 1002;
		return FAILURE;
	}
}

	bms_trace("aggr=[%.2lf], max_limit[%.2lf]", aggr_amt, max_limit);

	if( aggr_amt + bs->debi_amt > max_limit)
	{
		bs->result = 1502;
		return FAILURE;
	}

	//strcpy(bs->auther, "1");
	bs->debi_curr = 10 ;					//币种:10、人民币
	bs->pz_type = 2;							//交易类型:1、一本通转出
	pub_trim(bs->cred_acct);
	if(strlen(bs->cred_acct) == 10)
		strcpy(bs->notes1, "3");	//一本通客户
	else if(strlen(bs->cred_acct) == 17)
		strcpy(bs->notes1, "2");	//一卡通客户
	else
		strcpy(bs->notes1, "1");	//普通存折客户

	strcpy(bs->cred_aid,"AP01");
	bs->debi_amt = bs->debi_amt * 100 ;	//金额扩大100倍
	
	/*******addby zhongyp 20051108 *********/
	bs->optcode = 1005;
	if(CallHost(bs) == FAILURE) return FAILURE;
	bms_trace("bs->name[%s]", bs->name);
	bs->optcode = 1604;
	/**********/
	if(CallHost(bs) == FAILURE) return FAILURE;

	bs->debi_amt = bs->debi_amt/100;	//转账成功之后转账金额还原为原来的金额
	/* 转帐成功后需要更新 转帐金额 */
	if( DB_update_agrr_amt(bs->cid, bs->debi_acct, bs->debi_amt) )
	{
		bs->result = 1002;
		return FAILURE;
	}

	return( SUCCESS) ;
}
/* 
 * 交易码:1605
 * 功能  :普通存折转出
 * 客户  :签约客户
 */
int b1605( TRADE_HEAD *tr_h, BIG_STRC *bs)
{
	int ret = -1;
	double aggr_amt = 0.00;
	double max_limit = 0.00;
	int pAccType;
	
	if (strlen(bs->debi_acct) <=4) 
	{
		strcpy(bs->debi_aid,bs->debi_acct);
		memset(bs->debi_acct,'\0',sizeof(bs->debi_acct));
		
	}	
	if((ret = DB_search_acct(bs->debi_acct,bs->cid,bs->debi_aid,pAccType)) != 0)
	{
		if(ret == 100)
		{
			bs->result = 2000 ;		//签约客户不存在 
			return (FAILURE);
		}
		else
		{
			bs->result = 1406 ;
			return (FAILURE);
		}
	}
	pub_trim(bs->debi_acct);
	if(strlen(bs->debi_acct) != 15)
        {
                bs->result= 2005;      //转出帐户类型不符
                return (FAILURE);
        }

	/* 转帐前需要判断转帐金额是否超限 */
	if((ret=DB_seek_limit(&aggr_amt, &max_limit, bs->cid, bs->debi_acct)) !=SUCCESS)
	{
	if(ret==100)
	{
		bms_trace("ret[%d]", ret);
		bs->result = 1500;
		return FAILURE;
	}
	else
		{
		bs->result = 1002;
		return FAILURE;
	}
}
	bms_trace("aggr=[%.2lf], max_limit[%.2lf]", aggr_amt, max_limit);

	if( aggr_amt + bs->debi_amt > max_limit)
	{
		bs->result = 1502;
		return FAILURE;
	}

	//strcpy(bs->auther, "1");
	bs->debi_curr = 10 ;		//币种:10、人民币
	bs->pz_type = 2;
	pub_trim(bs->cred_acct);
	if(strlen(bs->cred_acct) == 10)
		strcpy(bs->notes1, "3");	//一本通客户
	else if(strlen(bs->cred_acct) == 17)
		strcpy(bs->notes1, "2");	//一卡通客户
	else
		strcpy(bs->notes1, "1");	//普通存折客户
	
	strcpy(bs->cred_aid,"AP01");
	bs->debi_amt = bs->debi_amt * 100 ;	//金额扩大100倍
	bms_trace("bs->debi_amt[%.2lf]", bs->debi_amt);
	
	/*******addby zhongyp 20051108 *********/
	bs->optcode = 1005;
	if(CallHost(bs) == FAILURE) return FAILURE;
	bms_trace("bs->name[%s]", bs->name);
	bs->optcode = 1605;
	/**********/
	if(CallHost(bs) == FAILURE) return FAILURE;

	bs->debi_amt = bs->debi_amt/100;	//转账成功之后转账金额还原为原来的金额
	bms_trace("bs->debi_amt[%.2lf]", bs->debi_amt);
	/* 转帐成功后需要更新 转帐金额 */
	if( DB_update_agrr_amt(bs->cid, bs->debi_acct, bs->debi_amt) )
	{
		bs->result = 1002;
		return FAILURE;
	}

	return( SUCCESS) ;
}

/* 
 * 交易码:1700
 * 功能  :帐户挂失
 * 客户  :签约客户
 */
int b1700( TRADE_HEAD *tr_h, BIG_STRC *bs)
{
	int ret = -1;
	int pAccType;
	
	if (strlen(bs->debi_acct) <=4) 
	{
		strcpy(bs->debi_aid,bs->debi_acct);
		memset(bs->debi_acct,'\0',sizeof(bs->debi_acct));
		
	}	
	if((ret = DB_search_acct(bs->debi_acct,bs->cid,bs->debi_aid,pAccType)) != 0)
	{
		if(ret == 100)
		{
			bs->result = 2000 ;		//签约客户不存在 
			return (FAILURE);
		}
		else
		{
			bs->result = 1406 ;
			return (FAILURE);
		}
	}
	if(CallHost(bs) == FAILURE) return FAILURE;

	return( SUCCESS) ;
}

/* 
 * 交易码:1100
 * 功能  :余额查询
 * 客户  :非签约客户
 */
int b1100( TRADE_HEAD *tr_h, BIG_STRC *bs)
{
	int ret = -1;

	if(CallHost(bs) == FAILURE) return FAILURE;
	
	if ( (ret=FormFile(bs->optcode, bs->address, bs->debi_acct, bs)) != SUCCESS) 
	{
			bs->result = 1406;
			return FAILURE;
	}
	
	return( SUCCESS) ;
}

/* 
 * 交易码:1101
 * 功能  :当日明细查询
 * 客户  :非签约客户
 */
int b1101( TRADE_HEAD *tr_h, BIG_STRC *bs)
{
	int ret = -1;
		
	sprintf(bs->date2, "%ld", GetDate());
	//strcpy(bs->date2, "20051225");
	bs->pz_type = 1; //1.当日明细 2.历史明细
	
	if(CallHost(bs) == FAILURE) return FAILURE;

	ret = FormFile(bs->optcode, bs->address, bs->debi_acct, bs);
	if( ret )
	{
		if( ret == 1006)
		{
			bs->result = 1006;
			return FAILURE;
		}
		else
		{
			bs->result = 1406;
			return FAILURE;
		}
	}

	return( SUCCESS) ;
}

/* 
 * 交易码:1102
 * 功能  :历史明细查询
 * 客户  :非签约客户
 */
int b1102( TRADE_HEAD *tr_h, BIG_STRC *bs)
{
	int ret = -1;
	int ActiveLog = 0;
	int Page = 0 ;

	if(strlen(bs->date2)==0)
		sprintf(bs->date2, "%ld", GetDate());
	bs->pz_type = 2; //1.当日明细 2.历史明细
	
	if(CallHost(bs) == FAILURE) return FAILURE;

	ret = FormFile(bs->optcode, bs->address, bs->debi_acct, bs);
	if( ret )
	{
		if( ret == 1006)
		{
			bs->result = 1006;
			return FAILURE;
		}
		else
		{
			bs->result = 1406;
			return FAILURE;
		}
	}

	return( SUCCESS) ;
}
/* 
 * 交易码:1103
 * 功能  :未登折明细查询
 * 客户  :非签约客户
 */
int b1103( TRADE_HEAD *tr_h, BIG_STRC *bs)
{
	int ret = -1;
	
	sprintf(bs->date2, "%ld", GetDate());
	
	if(CallHost(bs) == FAILURE) return FAILURE;

	ret = FormFile(bs->optcode, bs->address, bs->debi_acct, bs);
	if( ret )
	{
		if( ret == 1006)
		{
			bs->result = 1006;
			return FAILURE;
		}
		else
		{
			bs->result = 1406;
			return FAILURE;
		}
	}

	return( SUCCESS) ;
}
/* 
 * 交易码:1104
 * 功能  :挂失
 * 客户  :非签约客户
 */
int b1104( TRADE_HEAD *tr_h, BIG_STRC *bs)
{
	int ret = -1;

	if(CallHost(bs) == FAILURE) return FAILURE;

	return( SUCCESS) ;
}


/* 
 * 交易码:1400
 * 功能  :验证帐户密码
 * 客户  :非签约客户
 */
int b1400( TRADE_HEAD *tr_h, BIG_STRC *bs)
{
	int ret = -1;

	if(strlen(bs->debi_acct) == 15)
		strcpy(bs->notes1, "01");
	else if(strlen(bs->debi_acct) == 10)
		strcpy(bs->notes1, "03");
	else if(strlen(bs->debi_acct) == 17)
		strcpy(bs->notes1, "02");
	else
		strcpy(bs->notes1, "04");

	bms_trace("account=[%s] passwd1=[%s]",bs->debi_acct,bs->passwd1) ;
	bs->bill_flg = 1;	//查询密码
	if(CallHost(bs) == FAILURE) return FAILURE;

	return( SUCCESS) ;
}

/* 
 * 交易码:1800
 * 功能  :余额查询
 * 客户  :对公签约客户
 */
int b1800( TRADE_HEAD *tr_h, BIG_STRC *bs)
{
	int ret = -1;

	if(CallHost(bs) == FAILURE) return FAILURE;

	return( SUCCESS) ;
}
/* 
 * 交易码:1801
 * 功能  :余额查询
 * 客户  :对公签约客户
 */
int b1801( TRADE_HEAD *tr_h, BIG_STRC *bs)
{
	int ret = -1;
	
	if (strlen(bs->debi_acct) <=4) 
	{
		strcpy(bs->debi_aid,bs->debi_acct);
		memset(bs->debi_acct,'\0',sizeof(bs->debi_acct));
	}
	if((ret = DB_search_co_acct(bs->debi_acct,bs->cid,bs->debi_aid)) != 0)
	{
  if(ret == 100)
	{
			bs->result = 2000 ;		//签约客户不存在 
			return (FAILURE);
	}
	else
	{
		bs->result = 1406 ;
		return (FAILURE);
	}
}
	
	if(CallHost(bs) == FAILURE) return FAILURE;

	if ( (ret=FormFile(bs->optcode, bs->address, bs->debi_acct, bs)) != SUCCESS) {
			bs->result = 1406;
			return FAILURE;
		}
	
	return( SUCCESS) ;
}

/* 
 * 交易码:1802
 * 功能  :当日明细查询
 * 客户  :对公签约客户
 */
int b1802( TRADE_HEAD *tr_h, BIG_STRC *bs)
{
	int ret = -1;
	if (strlen(bs->debi_acct) <=4) 
	{
		strcpy(bs->debi_aid,bs->debi_acct);
		memset(bs->debi_acct,'\0',sizeof(bs->debi_acct));
	}
	if((ret = DB_search_co_acct(bs->debi_acct,bs->cid,bs->debi_aid)) != 0)
	{
  if(ret == 100)
	{
			bs->result = 2000 ;		//签约客户不存在 
			return (FAILURE);
	}
	else
	{
		bs->result = 1406 ;
		return (FAILURE);
	}
}
	
	sprintf(bs->date2, "%ld", GetDate());
	//strcpy(bs->date2, "20051225");
	bs->pz_type = 1; //1.当日明细 2.历史明细
	bms_trace("bs->debi_acct[%s]", bs->debi_acct);
	if(CallHost(bs) == FAILURE) return FAILURE;

	ret = FormFile(bs->optcode, bs->address, bs->debi_acct, bs);
	if( ret )
	{
		if( ret == 1006)
		{
			bs->result = 1006;
			return FAILURE;
		}
		else
		{
			bs->result = 1406;
			return FAILURE;
		}
	}
	return( SUCCESS) ;
}

/* 
 * 交易码:1803
 * 功能  :历史明细查询
 * 客户  :对公签约客户
 */
int b1803( TRADE_HEAD *tr_h, BIG_STRC *bs)
{
	int ret = -1;
	
	if (strlen(bs->debi_acct) <=4) 
	{
		strcpy(bs->debi_aid,bs->debi_acct);
		memset(bs->debi_acct,'\0',sizeof(bs->debi_acct));
	}
	if((ret = DB_search_co_acct(bs->debi_acct,bs->cid,bs->debi_aid)) != 0)
	{
  if(ret == 100)
	{
			bs->result = 2000 ;		//签约客户不存在 
			return (FAILURE);
	}
	else
	{
		bs->result = 1406 ;
		return (FAILURE);
	}
}
	
//sprintf(bs->date2, "%ld", GetDate());
  if(strlen(bs->date2) == 0)
  	sprintf(bs->date2, "%ld", GetDate());
	
	bs->pz_type = 2; //1.当日明细 2.历史明细
	if(CallHost(bs) == FAILURE) return FAILURE;

	ret = FormFile(bs->optcode, bs->address, bs->debi_acct, bs);
	if( ret )
	{
		if( ret == 1006)
		{
			bs->result = 1006;
			return FAILURE;
		}
		else
		{
			bs->result = 1406;
			return FAILURE;
		}
	}
	return( SUCCESS) ;
}
/* 
 * 交易码:1804
 * 功能  :查询贷款帐户还款情况
 * 客户  :签约客户
 */
int b1804( TRADE_HEAD *tr_h, BIG_STRC *bs)
{
	int ret = -1;
	char orgfile[128];
	
	memset(orgfile, '\0', sizeof(orgfile));
		
	if(CallHost(bs) == FAILURE) return FAILURE;

	sprintf(bs->address, "%05d.%04d",bs->trade_serial,bs->optcode);	
	
	bms_trace("FormFile beginning........");
	ret = FormFile(bs->optcode, bs->address, bs->debi_acct, bs);
	if( ret )
	{
		if( ret == 1006)
		{
			bs->result = 1006;
			return FAILURE;
		}
		else
		{
			bs->result = 1406;
			return FAILURE;
		}
	}
	return( SUCCESS) ;
}
/* 
 * 交易码:1805
 * 功能  :查询对公贷款基本信息
 * 客户  :签约客户
 */
int b1805( TRADE_HEAD *tr_h, BIG_STRC *bs)
{
	int ret = -1;
	char orgfile[128];
	
	memset(orgfile, '\0', sizeof(orgfile));
		
	if(CallHost(bs) == FAILURE) return FAILURE;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -