?? tuxedo.cpp
字號:
}
//if(startindex==0)
if(!m_bFlag1)
{
m_pShppRequest->ResetField();
m_pShppRequest->ResetField();
m_pShppRequest->AddPrintField(13); //主叫號
m_pShppRequest->AddPrintField(12); //叫呼轉號碼
m_pShppRequest->AddPrintField(13);//4日期 時間20020321 03-21
m_pShppRequest->AddPrintField(5,2); //5時長(秒)
m_pShppRequest->AddPrintField(6,2); //6話費
m_pShppRequest->PrintLine("語音話單-呼轉語音話單",LPLCENTER);
// m_pShppRequest->PutParameter("對方號碼 方式 日期 時間 時長 話費 通話地");
m_pShppRequest->PutParameter("主叫號碼 呼轉號碼 日期 時長 話費 ");
m_pShppRequest->PutParameter(s_chSeparator);
startindex = 1;
m_bFlag1=TRUE;
m_fFeeCount =0.0;//費用
m_nCountLine=0;;//行數
input1.count = 11;
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],"15");
strcpy(input1.num[3],"20");strcpy(input1.num[4],"5");strcpy(input1.num[5],"6");
strcpy(input1.num[6],"4");strcpy(input1.num[7],"11");strcpy(input1.num[8],"10");
strcpy(input1.num[9],"10");strcpy(input1.num[10],"6");
input2.count = 7;//1參數 第1,2是否可能超長 2參數 那個是時間 3參數 費用在那幾個字段內
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],"10");
strcpy(input2.num[6],"11");strcpy(input2.num[7],"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=putongaddline(rebuf,input1,input2))>0)
try
{
countindex=daishouaddline(rebuf,12,4);
}
catch(...)
{
printf("呼轉語音分解函數%s %d\n",phone,__LINE__);
return -1;
}
if(countindex>0)
{//加記錄到內存
try
{
tempfee=0.0;
tempfee=atof(Param[8]);//費用
tempfee=tempfee+atof(Param[9]);//費用
tempfee=tempfee+atof(Param[10]);//費用
m_fFeeCount=m_fFeeCount+tempfee;
char tempbuf1[6];
memset(tempbuf1,'\0',6);
sprintf(tempbuf1,"%.2f",tempfee);
//for(int j=0;j<input2.count-4;j++)
// m_pShppRequest->AddFieldVal(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(tempbuf1,strlen(tempbuf1));
}
catch(...)
{
printf("呼轉語音分解函數%s %d\n",phone,__LINE__);
return -1;
}
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::vpmn(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,"VPMN基本話費")!=NULL)
return 0;
if(startindex==0)
{
m_pShppRequest->ResetField();
m_pShppRequest->AddPrintField(13); //1對方號碼
m_pShppRequest->AddPrintField(4); //2方式
m_pShppRequest->AddPrintField(13); //3日期 時間20020321 03-21
m_pShppRequest->AddPrintField(6,2); //4時長(秒)
m_pShppRequest->AddPrintField(6,2); //5話費
m_pShppRequest->AddPrintField(7,2); //6本方所在地
m_pShppRequest->PrintLine("VPMN語音話單",LPLCENTER);
m_pShppRequest->PutParameter("對方號碼 方式 日期 時間 時長 話費 通話地");
m_pShppRequest->PutParameter(s_chSeparator);
startindex = 1;
m_fFeeCount =0.0;//費用
m_nCountLine=0;;//行數
input1.count = 13;
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],"20");
strcpy(input1.num[3],"5");strcpy(input1.num[4],"5");strcpy(input1.num[5],"7");
strcpy(input1.num[6],"7");strcpy(input1.num[7],"7");strcpy(input1.num[8],"5");
strcpy(input1.num[9],"9");strcpy(input1.num[10],"7");strcpy(input1.num[11],"7");
strcpy(input1.num[12],"6");
input2.count = 6;//count 里面存放的幾個是時間
strcpy(input2.num[0],"1");strcpy(input2.num[1],"2");strcpy(input2.num[2],"3");
strcpy(input2.num[3],"5");strcpy(input2.num[4],"14");strcpy(input2.num[5],"10");
strcpy(input2.num[6],"3");
}
if((str=strstr(rebuf,"合計"))!=NULL)
{
endindex=1;
// number=number-(str-rebuf);
}
else
{
// rebuf=rebuf+114;//將前面的橫線去掉
int countindex=0;
number = strlen(rebuf);
while(number>2)
{
try
{
countindex=daishouaddline(rebuf,14,3);
}
catch(...)
{
printf("vpmn分解函數%s %d\n",phone,__LINE__);
return -1;
}
if(countindex>0)
{//加記錄到內存
m_fFeeCount=m_fFeeCount+atof(Param[13]);//費用
try
{
if(strncmp(Param[0],phone,strlen(phone))==0)
{
m_pShppRequest->AddFieldVal(Param[1],strlen(rtrim(Param[1])));
m_pShppRequest->AddFieldVal("主",2);
}
else
{
m_pShppRequest->AddFieldVal(Param[0],strlen(rtrim(Param[0])));
m_pShppRequest->AddFieldVal("被",2);
}
/*for(int j=2;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[2],strlen(Param[2]));
m_pShppRequest->AddFieldVal(Param[4],strlen(Param[4]));
m_pShppRequest->AddFieldVal(Param[13],strlen(Param[13]));
m_pShppRequest->AddFieldVal(Param[9],strlen(Param[9]));
}
catch(...)
{
printf("vpmn分解函數%s %d\n",phone,__LINE__);
return -1;
}
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,"VPMN語音話單 總費用:%0.2f元;",m_fFeeCount);
m_tempfee=m_tempfee+m_fFeeCount;
m_pShppRequest->PutParameter(pList);
sprintf(pList,"VPMN語音話單 總次數:%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::yuyinzazhi(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(startindex==0)
{
m_pShppRequest->ResetField();
m_pShppRequest->AddPrintField(11); //1對方號碼
m_pShppRequest->AddPrintField(14); //2方式
m_pShppRequest->AddPrintField(7); //3日期 時間20020321 03-21
m_pShppRequest->AddPrintField(11); //4時長(秒)
m_pShppRequest->AddPrintField(6,2); //5話費
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 = 6;
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],"22");
strcpy(input1.num[3],"11");strcpy(input1.num[4],"11");strcpy(input1.num[5],"11");
input2.count = 5;//count 里面存放的幾個是時間
strcpy(input2.num[0],"2");strcpy(input2.num[1],"3");strcpy(input2.num[2],"5");
strcpy(input2.num[3],"6");strcpy(input2.num[4],"7");strcpy(input2.num[5],"3");
}
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,7,3))>0)
{//加記錄到內存
m_fFeeCount=m_fFeeCount+atof(Param[6]);//費用
// 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[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::putongduanxin(char *rebuf,char *phone)
{
char *str=NULL;
int number = 100;
// char linebuf[256];
float tempfee = 0.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_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;
}
if(startindex==0)
{
m_pShppRequest->ResetField();
m_pShppRequest->ResetField();
m_pShppRequest->AddPrintField(15); //主叫號
m_pShppRequest->AddPrintField(5); //叫呼轉號碼
m_pShppRequest->AddPrintField(15);//4日期 時間20020321 03-21
m_pShppRequest->AddPrintField(7); //5時長(秒)
m_pShppRequest->AddPrintField(8); //6話費
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 = 8;
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],"24");strcpy(input1.num[1],"24");strcpy(input1.num[2],"22");
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -