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

📄 tuxedo.cpp

📁 本源码为移动公司话费查询中间件TUXEDO使用的实例
💻 CPP
📖 第 1 页 / 共 5 页
字号:
			strcpy(input2.num[0],"10");strcpy(input2.num[1],"2");strcpy(input2.num[2],"4");
			strcpy(input2.num[3],"6");strcpy(input2.num[4],"7");strcpy(input2.num[5],"4");
			
	}

	if((str=strstr(rebuf,"合计"))!=NULL)
	{
		endindex=1;
	}
	else
	{	
		//rebuf=rebuf+114;//将前面的横线去掉
		int countindex=0;
		number = strlen(rebuf);
		while(number>2)
		{
			//	str=rebuf;
			countindex=0;
			if((countindex=daishouaddline(rebuf,11,4))>0)
			{//加记录到内存
				m_fFeeCount=m_fFeeCount+atof(Param[6]);//费用
			
			/*	for(int j=0;j<input2.count;j++)
				{
					if(strlen(rtrim(Param[atoi(input2.num[j])-1]))!=0)
						m_pShppRequest->AddFieldVal(Param[atoi(input2.num[j])-1],strlen(rtrim(Param[atoi(input2.num[j])-1])));
					else
						m_pShppRequest->AddFieldVal("无",2);
				}
			*/
				m_pShppRequest->AddFieldVal(Param[9],strlen(Param[9]));
				m_pShppRequest->AddFieldVal(Param[1],strlen(Param[1]));
				m_pShppRequest->AddFieldVal(Param[3],strlen(Param[3]));
				m_pShppRequest->AddFieldVal(Param[5],strlen(Param[5]));
				m_pShppRequest->AddFieldVal(Param[6],strlen(Param[6]));
				m_nCountLine=m_nCountLine+1;
				number=number-countindex;
				rebuf=rebuf+countindex;
				while(rebuf[0]==' ')
				{
					rebuf=rebuf+1;
					number=number-1;
				}
			}//添加记录结束		
			else
			{
				m_pShppRequest->Reset();
				return -1;
			}
		}
	}
	
	if((endindex==1)&&(m_nCountLine!=0))
	{
		//处理结尾
		char pList[256];
		m_pShppRequest->PutParameter(s_chSeparator);		
		sprintf(pList,"代收话单 总费用:%0.2f元;",m_fFeeCount);
		m_tempfee=m_tempfee+m_fFeeCount;
		m_pShppRequest->PutParameter(pList);
		sprintf(pList,"代收话单 总次数:%d次;", m_nCountLine);
		m_tempcount=m_tempcount+m_nCountLine;
		m_pShppRequest->PutParameter(pList);
		m_pShppRequest->PutParameter(s_chSeparator);

//		*m_pfOutFeeCount += m_fFeeCount;
//		*m_pnLineCount += m_nCountLine;
		//m_pShppRequest->Flush();
		
		m_fFeeCount  = 0.0;
		m_nCountLine = 0;
		startindex   = 0;
		endindex     = 0;
	}

	return 0;
}
//==========================================
int CTuxedo::gprs(char *rebuf,char *phone)
{
	char *str=NULL;
	int number = 100;
//	char linebuf[256];
	if((strstr(rebuf,"合计")!=NULL)&&(startindex==0)&&(strstr(rebuf,"-------")==NULL))
		return 0;
	if((strstr(rebuf,"--------")!=NULL)&&(strlen(rebuf)<150))
		return 0;	
	if((strstr(rebuf,"合计")!=NULL)&&(startindex==0))
		return 0;
	if(strlen(rebuf)<10)
		return 0;
	if((strstr(rebuf,"合计")!=NULL))
	{
		endindex=1;
		if((endindex==1)&&(m_nCountLine!=0))
		{
			//处理结尾
			char pList[256];
			m_pShppRequest->PutParameter(s_chSeparator);		
			sprintf(pList,"GPRS话单 总次数:%d次;", m_nCountLine);
			m_tempfee=m_tempfee+m_fFeeCount;
			m_tempcount=m_tempcount+m_nCountLine;
			m_pShppRequest->PutParameter(pList);
			m_pShppRequest->PutParameter(s_chSeparator);
			
			//	*m_pfOutFeeCount += m_fFeeCount;
			//	*m_pnLineCount += m_nCountLine;
			
			m_fFeeCount  = 0.0;
			m_nCountLine = 0;
			startindex   = 0;
			endindex     = 0;
		}
		return 0;
	}

	if(startindex==0)
	{
		m_pShppRequest->ResetField();
		m_pShppRequest->AddPrintField(9);    
		m_pShppRequest->AddPrintField(10);    
		m_pShppRequest->AddPrintField(13);   
		m_pShppRequest->AddPrintField(9);   
		m_pShppRequest->AddPrintField(9,2);   
		m_pShppRequest->PrintLine("GPRS话单",LPLCENTER);
//		m_pShppRequest->PutParameter("对方号码    方式  日期 时间     时长 话费 通话地");
 		m_pShppRequest->PutParameter("呼叫类型   APN代码     日期    流量(K)   漫游地");
		m_pShppRequest->PutParameter(s_chSeparator);
		
		startindex  = 1;
		m_fFeeCount =0.0;//费用
		m_nCountLine=0;;//行数
		
		input1.count = 9;
		for(int i=0;i<15;i++)
			for(int j=0;j<3;j++)
			{
				input1.num[i][j]='\0';
			    input2.num[i][j]='\0';
			}
		strcpy(input1.num[0],"9");strcpy(input1.num[1],"17");strcpy(input1.num[2],"21");
		strcpy(input1.num[3],"20");strcpy(input1.num[4],"20");strcpy(input1.num[5],"11");
		strcpy(input1.num[6],"9");strcpy(input1.num[7],"6");strcpy(input1.num[8],"9");

		input2.count = 5;//count 里面存放的几个是时间
			strcpy(input2.num[0],"1");strcpy(input2.num[1],"3");strcpy(input2.num[2],"4");
			strcpy(input2.num[3],"6");strcpy(input2.num[4],"9");strcpy(input2.num[5],"4");			
			
	}
	
	if((str=strstr(rebuf,"合计"))!=NULL)
	{
		endindex=1;
	}
	else
	{	
//		rebuf=rebuf+114;//将前面的横线去掉
		int countindex=0;
		number = strlen(rebuf);
		while(number>2)
		{
			countindex=0;
			if((countindex=daishouaddline(rebuf,10,4))>0)
			{
				/*for(int j=0;j<input2.count;j++)
				{
						m_pShppRequest->AddFieldVal(rtrim(Param[atoi(input2.num[j])-1]),strlen(rtrim(Param[atoi(input2.num[j])-1])));
				}*/
	   			m_pShppRequest->AddFieldVal(Param[0],strlen(Param[0]));
				m_pShppRequest->AddFieldVal(Param[2],strlen(Param[2]));
				m_pShppRequest->AddFieldVal(Param[3],strlen(Param[3]));
				m_pShppRequest->AddFieldVal(Param[5],strlen(Param[5]));
				m_pShppRequest->AddFieldVal(Param[8],strlen(Param[8]));
				
				m_nCountLine=m_nCountLine+1;
				number=number-countindex;
				rebuf=rebuf+countindex;
				while(rebuf[0]==' ')
				{
					rebuf=rebuf+1;
					number=number-1;
				}
			}//添加记录结束		
			else
			{
				m_pShppRequest->Reset();
				return -1;
			}
		}
	}
	
	if((endindex==1)&&(m_nCountLine!=0))
	{
		//处理结尾
		char pList[256];
		m_pShppRequest->PutParameter(s_chSeparator);		
		sprintf(pList,"GPRS话单 总次数:%d次;", m_nCountLine);
		m_tempfee=m_tempfee+m_fFeeCount;
		m_tempcount=m_tempcount+m_nCountLine;
		m_pShppRequest->PutParameter(pList);
		m_pShppRequest->PutParameter(s_chSeparator);
		
	//	*m_pfOutFeeCount += m_fFeeCount;
	//	*m_pnLineCount += m_nCountLine;

		m_fFeeCount  = 0.0;
		m_nCountLine = 0;
		startindex   = 0;
		endindex     = 0;
	}

	return 0;
}
//==========================================
int CTuxedo::yidongcaixin(char *rebuf,char *phone)
{
	char *str=NULL;
	int number = 100;
	float tempfee = 0.0;
	if((strstr(rebuf,"合计")!=NULL)&&(startindex==0)&&(strstr(rebuf,"-------")==NULL))
		return 0;
	if((strstr(rebuf,"--------")!=NULL)&&(strlen(rebuf)<150))
		return 0;	
	if((strstr(rebuf,"合计")!=NULL)&&(startindex==0))
		return 0;
	if(strlen(rebuf)<10)
		return 0;
	if((strstr(rebuf,"合计")!=NULL))
	{
		endindex=1;
		if((endindex==1)&&(m_nCountLine!=0))
		{
			//处理结尾
			char pList[256];
			m_pShppRequest->PutParameter(s_chSeparator);		
			sprintf(pList,"移动彩信话单 总费用:%0.2f元;",m_fFeeCount);
			m_pShppRequest->PutParameter(pList);
			sprintf(pList,"移动彩信话单 总次数:%d次;", m_nCountLine);
			m_tempfee=m_tempfee+m_fFeeCount;
			m_tempcount=m_tempcount+m_nCountLine;
			m_pShppRequest->PutParameter(pList);
			m_pShppRequest->PutParameter(s_chSeparator);
			
			//		*m_pfOutFeeCount += m_fFeeCount;
			//		*m_pnLineCount += m_nCountLine;
			//m_pShppRequest->Flush();
			
			m_fFeeCount  = 0.0;
			m_nCountLine = 0;
			startindex   = 0;
			endindex     = 0;
		}
		return 0;
	}

	if(startindex==0)
	{
		m_pShppRequest->ResetField();
		m_pShppRequest->AddPrintField(13);    
		m_pShppRequest->AddPrintField(9);    
		m_pShppRequest->AddPrintField(14);    
		m_pShppRequest->AddPrintField(7,2);  
		m_pShppRequest->AddPrintField(7,2);   
		m_pShppRequest->PrintLine("移动彩信话单",LPLCENTER);
	  //m_pShppRequest->PutParameter("对方号码    方式  日期 时间     时长 话费 通话地");
		m_pShppRequest->PutParameter("接受方地址   话单类型      时间     通信费 信息费");
		
		startindex  = 1;
		m_fFeeCount =0.0;//费用
		m_nCountLine=0;;//行数
		
		input1.count = 9;
		for(int i=0;i<15;i++)
			for(int j=0;j<3;j++)
			{
				input1.num[i][j]='\0';
			    input2.num[i][j]='\0';
			}
		strcpy(input1.num[0],"12");strcpy(input1.num[1],"32");strcpy(input1.num[2],"9");
		strcpy(input1.num[3],"9");strcpy(input1.num[4],"20");strcpy(input1.num[5],"14");
		strcpy(input1.num[6],"7");strcpy(input1.num[7],"7");strcpy(input1.num[8],"8");

		input2.count = 5;//count 里面存放的几个是时间
			strcpy(input2.num[0],"2");strcpy(input2.num[1],"3");strcpy(input2.num[2],"5");
			strcpy(input2.num[3],"8");strcpy(input2.num[4],"9");strcpy(input2.num[5],"5");			
			
	}
	
	if((str=strstr(rebuf,"合计"))!=NULL)
	{
		endindex=1;
	}
	else
	{	
//		rebuf=rebuf+114;//将前面的横线去掉
		int countindex=0;
		number = strlen(rebuf);
		while(number>2)
		{
			countindex=0;
			if((countindex=daishouaddline(rebuf,10,5))>0)
			{//加记录到内存
				tempfee = 0.0;
				tempfee=atof(Param[7]);
				tempfee=tempfee+atof(Param[8]);
				m_fFeeCount=m_fFeeCount+tempfee;//费用
				
			//	for(int j=0;j<input2.count;j++)
			//		m_pShppRequest->AddFieldVal(Param[atoi(input2.num[j])-1],strlen(rtrim(Param[atoi(input2.num[j])-1])));
				m_pShppRequest->AddFieldVal(Param[1],strlen(Param[1]));
				m_pShppRequest->AddFieldVal(Param[2],strlen(Param[2]));
				m_pShppRequest->AddFieldVal(Param[4],strlen(Param[4]));
				m_pShppRequest->AddFieldVal(Param[7],strlen(Param[7]));
				m_pShppRequest->AddFieldVal(Param[8],strlen(Param[8]));
				
				m_nCountLine=m_nCountLine+1;
				number=number-countindex;
				rebuf=rebuf+countindex;
				while(rebuf[0]==' ')
				{
					rebuf=rebuf+1;
					number=number-1;
				}			
			}//添加记录结束		
			else
			{
				m_pShppRequest->Reset();
				return -1;
			}
		}
	}

	if((endindex==1)&&(m_nCountLine!=0))
	{
		//处理结尾
		char pList[256];
		m_pShppRequest->PutParameter(s_chSeparator);		
		sprintf(pList,"移动彩信话单 总费用:%0.2f元;",m_fFeeCount);
		m_pShppRequest->PutParameter(pList);
		sprintf(pList,"移动彩信话单 总次数:%d次;", m_nCountLine);
		m_tempfee=m_tempfee+m_fFeeCount;
		m_tempcount=m_tempcount+m_nCountLine;
		m_pShppRequest->PutParameter(pList);
		m_pShppRequest->PutParameter(s_chSeparator);

//		*m_pfOutFeeCount += m_fFeeCount;
//		*m_pnLineCount += m_nCountLine;
		//m_pShppRequest->Flush();
		
		m_fFeeCount  = 0.0;
		m_nCountLine = 0;
		startindex   = 0;
		endindex     = 0;
	}

	return 0;
}
//==========================================
int CTuxedo::yidonggouwu(char *rebuf,char *phone)
{
	char *str=NULL;
	int number = 100;
	float tempfee=0.0;	
	if((strstr(rebuf,"合计")!=NULL)&&(startindex==0)&&(strstr(rebuf,"-------")==NULL))
		return 0;
	if((strstr(rebuf,"--------")!=NULL)&&(strlen(rebuf)<150))
		return 0;	
	if((strstr(rebuf,"合计")!=NULL)&&(startindex==0))
		return 0;
	if(strlen(rebuf)<10)
		return 0;
	if(startindex==0)
	{
		m_pShppRequest->ResetField();
		m_pShppRequest->AddPrintField(18);    
		m_pShppRequest->AddPrintField(13);     
		m_pShppRequest->AddPrintField(4);    
		m_pShppRequest->AddPrintField(6);   
		m_pShppRequest->AddPrintField(9);  
		m_pShppRequest->PrintLine("移动电话购物话单",LPLCENTER);
	  //m_pShppRequest->PutParameter("对方号码    方式  日期 时间     时长 话费 通话地");
		m_pShppRequest->PutParameter("物品名称       购物时间      数量  费用    地点");
		m_pShppRequest->PutParameter(s_chSeparator);
		
		startindex  = 1;
		m_fFeeCount =0.0;//费用
		m_nCountLine=0;;//行数
		
		input1.count = 7;
		for(int i=0;i<15;i++)
			for(int j=0;j<3;j++)
			{
				input1.num[i][j]='\0';
			    input2.num[i][j]='\0';
			}
		strcpy(input1.num[0],"15");strcpy(input1.num[1],"15");strcpy(input1.num[2],"10");
		strcpy(input1.num[3],"27");strcpy(input1.num[4],"33");strcpy(input1.num[5],"6");
		strcpy(input1.num[6],"7");

		input2.count = 5;//count 里面存放的几个是时间
			strcpy(input2.num[0],"6");strcpy(input2.num[1],"4");strcpy(input2.num[2],"7");
			strcpy(input2.num[3],"8");strcpy(input2.num[4],"3");strcpy(input2.num[5],"4");			
			
	}
	
	if((str=strstr(rebuf,"合计"))!=NULL)
	{
		endindex=1;
	}
	else
	{	
//		rebuf=rebuf+114;//将前面的横线去掉
		int countindex=0;
		number = strlen(rebuf);
		while(number>2)
		{
			//	str=rebuf;
			countindex=0;
			if((countindex=daishouaddline(rebuf,8,4))>0)
			{//加记录到内存
				m_fFeeCount=m_fFeeCount+atof(Param[7]);//费用			

/*				for(int j=0;j<input2.count;j++)
				{
					if(strlen(rtrim(Param[atoi(input2.num[j])-1]))!=0)
						m_pShppRequest->AddFieldVal(Param[atoi(input2.num[j])-1],strlen(rtrim(Param[atoi(input2.num[j])-1])));
					else
						m_pShppRequest->AddFieldVal("无",2);
				}
*/
				m_pShppRequest->AddFieldVal(Param[5],strlen(Param[5]));
				m_pShppRequest->AddFieldVal(Param[3],strlen(Param[3]));
				m_pShppRequest->AddFieldVal(Param[6],strlen(Param[6]));
				m_pShppRequest->AddFieldVal(Param[7],strlen(Param[7]));
				m_pShppRequest->AddFieldVal(Param[2],strlen(Param[2]));
				
				m_nCountLine=m_nCountLine+1;
				number=number-countindex;
				rebuf=rebuf+countindex;
				while(rebuf[0]==' ')
				{
					rebuf=rebuf+1;
					number=number-1;
				}
				
			}//添加记录结束			
			else
			{
				m_pShppRequest->Reset();
				return -1;
			}
		}
	}
	
	if((endindex==1)&&(m_nCountLine!=0))
	{
		//处理结尾
		char pList[256];
		m_pShppRequest->PutParameter(s_chSeparator);		
		sprintf(pList,"移动电话购物话单 总费用:%0.2f元;",m_fFeeCount);
		m_pShppRequest->PutParameter(pList);
		sprintf(pList,"移动电话购物话单 总次数:%d次;", m_nCountLine);
		m_tempfee=m_tempfee+m_fFeeCount;
		m_tempcount=m_tempcount+m_nCountLine;
		m_pShppRequest->PutParameter(pList);
		m_pShppRequest->PutParameter(s_chSeparat

⌨️ 快捷键说明

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