You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
476 lines
11 KiB
C++
476 lines
11 KiB
C++
|
1 year ago
|
#include "mainwindow.h"
|
||
|
|
#include "ui_mainwindow.h"
|
||
|
|
#include <QDateTime>
|
||
|
|
#include "nowjavadll.h"
|
||
|
|
|
||
|
|
MainWindow::MainWindow(QWidget *parent)
|
||
|
|
: QMainWindow(parent)
|
||
|
|
, ui(new Ui::MainWindow)
|
||
|
|
{
|
||
|
|
ui->setupUi(this);
|
||
|
|
}
|
||
|
|
|
||
|
|
MainWindow::~MainWindow()
|
||
|
|
{
|
||
|
|
delete ui;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
void MainWindow::on_pushButton_clicked()
|
||
|
|
{
|
||
|
|
// int OpenParam(const int model,const int LocalAreaNo, const int LocalRoadNo, const int LocalStaNo,char * psiD,char * pInfo,const char * libPath,char * TempPath)
|
||
|
|
|
||
|
|
bool bRet;
|
||
|
|
int iRet;
|
||
|
|
int id;
|
||
|
|
int RoadNo;
|
||
|
|
int StaNo;
|
||
|
|
|
||
|
|
int SubAreaNo;
|
||
|
|
char buf[10240];
|
||
|
|
int iLen;
|
||
|
|
long long dTime;
|
||
|
|
QDateTime dateTime,tmptime;
|
||
|
|
QString qstr,qtemp;
|
||
|
|
// JsonAnalyStr jsstr;
|
||
|
|
int iClassNo;
|
||
|
|
|
||
|
|
char keyValue[64];
|
||
|
|
char Fieldname[64];
|
||
|
|
char Time1[64];
|
||
|
|
char Time2[64];
|
||
|
|
int ManId1;
|
||
|
|
int ManId2;
|
||
|
|
int partno;
|
||
|
|
|
||
|
|
int GroupNo;
|
||
|
|
|
||
|
|
QString enId;
|
||
|
|
QString exId;
|
||
|
|
int cardtype;
|
||
|
|
int Vegtype;
|
||
|
|
|
||
|
|
int Cash;
|
||
|
|
int MinFee;
|
||
|
|
int ExitFeeType;
|
||
|
|
int VehType;
|
||
|
|
int errcode;
|
||
|
|
char errbuf[512];
|
||
|
|
char IdBuf[128];
|
||
|
|
int iIdLen;
|
||
|
|
int LaneNo;
|
||
|
|
int CardType;
|
||
|
|
char keybuf[256];
|
||
|
|
char namebuf[256];
|
||
|
|
|
||
|
|
char dllbuf[256];
|
||
|
|
char Infobuf[256];
|
||
|
|
char lbuf[256];
|
||
|
|
char tbuf[256];
|
||
|
|
|
||
|
|
int LocalAreaNo ;
|
||
|
|
int LocalRoadNo ;
|
||
|
|
int LocalStaNo ;
|
||
|
|
|
||
|
|
LocalAreaNo = 15;
|
||
|
|
LocalRoadNo = 10;
|
||
|
|
LocalStaNo = 1004;
|
||
|
|
|
||
|
|
memset(dllbuf,0,sizeof(dllbuf));
|
||
|
|
memset(Infobuf,0,sizeof(Infobuf));
|
||
|
|
memset(lbuf,0,sizeof(lbuf));
|
||
|
|
memset(tbuf,0,sizeof(tbuf));
|
||
|
|
|
||
|
|
strcpy(dllbuf,"f:/javatestexe");
|
||
|
|
strcpy(Infobuf,"[[15,1802]]");
|
||
|
|
strcpy(lbuf,"f:/path/dbf/");
|
||
|
|
strcpy(tbuf,"f:/path/temp/");
|
||
|
|
|
||
|
|
// int OpenParam(const int model,const int LocalAreaNo, const int LocalRoadNo, const int LocalStaNo,char * psiD,char * pInfo,const char * libPath,char * TempPath);
|
||
|
|
|
||
|
|
iRet = OpenParam(0,Infobuf,dllbuf,lbuf,tbuf);
|
||
|
|
if(iRet <0)
|
||
|
|
{
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
|
||
|
|
id = 1;
|
||
|
|
iRet = GetVersion(id,1,buf,iLen);
|
||
|
|
if(0 ==iRet )
|
||
|
|
{
|
||
|
|
// ui->textEditVEROne->setPlainText(buf);
|
||
|
|
}
|
||
|
|
qstr = buf;
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
|
||
|
|
iRet = GetVersion(id,2,buf,iLen);
|
||
|
|
if(0 ==iRet )
|
||
|
|
{
|
||
|
|
// ui->textEditvERTwo->setPlainText(buf);
|
||
|
|
}
|
||
|
|
qstr = buf;
|
||
|
|
|
||
|
|
dTime = GetGenTime(id);
|
||
|
|
dateTime = QDateTime::fromMSecsSinceEpoch(dTime);
|
||
|
|
|
||
|
|
qstr = dateTime.toString("yyyy-MM-dd hh:mm:ss");
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
|
||
|
|
iRet = GetParamCName(id,buf,iLen);
|
||
|
|
qstr = buf;
|
||
|
|
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
iRet = GetParamPFName(id,buf,iLen);
|
||
|
|
qstr = buf;
|
||
|
|
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =10000;
|
||
|
|
iRet = GetParamsStatus(buf,iLen);
|
||
|
|
qstr = buf;
|
||
|
|
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
iRet = GetVerInfo(buf,iLen);
|
||
|
|
qstr = buf;
|
||
|
|
|
||
|
|
bRet = IsHoliday();
|
||
|
|
RoadNo = 10;
|
||
|
|
StaNo = 1004;
|
||
|
|
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =2000;
|
||
|
|
iRet = GetStaInfo(RoadNo,StaNo,SubAreaNo,buf,iLen);
|
||
|
|
// WRITE_LOG("GetStaInfo");
|
||
|
|
// WRITE_LOG(buf);
|
||
|
|
// iRet = jsstr.checkStaInfo(buf);
|
||
|
|
qstr = buf;
|
||
|
|
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
iRet = GetStaName(RoadNo,StaNo,true,buf,iLen);
|
||
|
|
qstr =buf;
|
||
|
|
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
iRet = GetStaName(RoadNo,StaNo,false,buf,iLen);
|
||
|
|
qstr =buf;
|
||
|
|
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
iRet = GetRoadName(RoadNo,buf,iLen);
|
||
|
|
qstr = buf;
|
||
|
|
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
|
||
|
|
/* iRet = GetLocalStaName(true,true,buf,iLen);
|
||
|
|
qstr = QString::fromLocal8Bit(buf);
|
||
|
|
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
iRet = GetLocalRoadName(buf,iLen);
|
||
|
|
qstr = QString::fromLocal8Bit(buf);
|
||
|
|
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
iRet = GetLocalAreaNoStr(buf,iLen);
|
||
|
|
qstr = QString::fromLocal8Bit(buf);
|
||
|
|
*/
|
||
|
|
strcpy(keyValue,"G0001110010010");
|
||
|
|
// strcpy(Fieldname,"BEGDATE");
|
||
|
|
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
|
||
|
|
memset(keybuf,0,sizeof(keybuf));
|
||
|
|
memset(namebuf,0,sizeof(namebuf));
|
||
|
|
iLen =250;
|
||
|
|
iIdLen =250;
|
||
|
|
bRet = BasicInfoIdFind(keyValue,keybuf,iLen,namebuf,iIdLen);
|
||
|
|
qstr = keybuf;
|
||
|
|
qtemp = namebuf;
|
||
|
|
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
memset(IdBuf,0,sizeof(IdBuf));
|
||
|
|
iIdLen =120;
|
||
|
|
strcpy(keyValue,"11010501");
|
||
|
|
|
||
|
|
memset(keybuf,0,sizeof(keybuf));
|
||
|
|
memset(namebuf,0,sizeof(namebuf));
|
||
|
|
iLen =250;
|
||
|
|
iIdLen =250;
|
||
|
|
bRet = BasicInfoHexFind(keyValue,keybuf,iLen,namebuf,iIdLen);
|
||
|
|
// bRet = BasicInfoHexFind(keyValue,keybuf,iLen,namebuf,iIdLen);
|
||
|
|
qstr = keybuf;
|
||
|
|
qtemp = namebuf;
|
||
|
|
|
||
|
|
memset(keyValue, 0, sizeof(keyValue));
|
||
|
|
|
||
|
|
|
||
|
|
/* SubAreaNo =11;
|
||
|
|
RoadNo = 0x1;
|
||
|
|
StaNo = 0x501;
|
||
|
|
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
memset(IdBuf,0,sizeof(IdBuf));
|
||
|
|
iIdLen =120;
|
||
|
|
bRet = BasicInfoHexFindName(SubAreaNo,RoadNo,StaNo,IdBuf,iIdLen,buf,iLen);
|
||
|
|
qstr = QString::fromLocal8Bit(buf);
|
||
|
|
*/
|
||
|
|
|
||
|
|
strcpy(keybuf,"11ab");
|
||
|
|
SubAreaNo =11;
|
||
|
|
RoadNo = 0x1;
|
||
|
|
StaNo = 0x501;
|
||
|
|
LaneNo =0x1;
|
||
|
|
memset(IdBuf,0,sizeof(IdBuf));
|
||
|
|
iIdLen =120;
|
||
|
|
|
||
|
|
iRet = LaneIdFind(keybuf,SubAreaNo,RoadNo,StaNo,LaneNo,IdBuf,iIdLen);
|
||
|
|
qstr = IdBuf;
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
memset(IdBuf,0,sizeof(IdBuf));
|
||
|
|
iIdLen =120;
|
||
|
|
|
||
|
|
memset(keyValue,0,sizeof(keyValue));
|
||
|
|
|
||
|
|
strcpy(keyValue,"内蒙");
|
||
|
|
strcpy(IdBuf,"1501");
|
||
|
|
bRet = IssuerCheck(keyValue,IdBuf);
|
||
|
|
|
||
|
|
//qstr = "11010808220000036899";
|
||
|
|
// strcpy(keyValue,"4601");
|
||
|
|
// bRet =NetNoCheck(keyValue);
|
||
|
|
|
||
|
|
cardtype =22;
|
||
|
|
VehType = 1;
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
|
||
|
|
// memset(keyValue,0,sizeof(keyValue));
|
||
|
|
// strcpy(Fieldname,"5401");
|
||
|
|
strcpy(Time1,"2015-09-20 00:00:00");
|
||
|
|
strcpy(Time2,"2099-12-31 00:00:00");
|
||
|
|
|
||
|
|
|
||
|
|
bRet= CardValid(keyValue,IdBuf,
|
||
|
|
Time1, Time2,
|
||
|
|
cardtype,VehType,
|
||
|
|
errcode, buf, iLen);
|
||
|
|
qstr = buf;
|
||
|
|
strcpy(keyValue,"11010745230000016854");
|
||
|
|
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
bRet = DoFindBlack(PFILE_ID_CARDBLACKLISTINC,keyValue, buf, iLen);
|
||
|
|
qstr = buf;
|
||
|
|
id =3;
|
||
|
|
// strcpy(keyValue,"3");
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
|
||
|
|
iRet = GetOBUReasonText(id,buf,iLen);
|
||
|
|
qstr = buf;
|
||
|
|
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
iRet = GetCardReasonText(id,buf,iLen);
|
||
|
|
qstr = buf;
|
||
|
|
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
iRet = GetVehBlackReasonText(id,buf,iLen);
|
||
|
|
qstr = buf;
|
||
|
|
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
iRet = GetVehGrayReasonText(id,buf,iLen);
|
||
|
|
qstr = buf;
|
||
|
|
|
||
|
|
//OBU黑名单
|
||
|
|
strcpy(keyValue,"2501159902000003");
|
||
|
|
strcpy(keyValue,"0000000000041515");
|
||
|
|
|
||
|
|
//qstr = "2501159902000003";
|
||
|
|
//bool IsOBUBlack(char * OBUContractSerialNumber,char * result,int &resultLen);
|
||
|
|
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
bRet = IsOBUBlack(keyValue,buf,iLen);
|
||
|
|
qstr = buf;
|
||
|
|
|
||
|
|
strcpy(keyValue,"11010745220000010159");
|
||
|
|
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
bRet = IsCardBlack(keyValue,buf,iLen);
|
||
|
|
qstr = buf;
|
||
|
|
// bRet = myCParamMan.IsOBUBlack(qstr, qstr2); //OBU黑名单
|
||
|
|
|
||
|
|
// bool DoFindBlack(const int PFileId, char * SearchStr,char * result,int &resultLen);
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
bRet = IsVehicleInProvBlack(keyValue,buf,iLen);
|
||
|
|
qstr = buf;
|
||
|
|
|
||
|
|
//全国车牌黑名单
|
||
|
|
// strcpy(keyValue,"32486712");
|
||
|
|
|
||
|
|
memset(keyValue,0,sizeof(keyValue));
|
||
|
|
iLen =500;
|
||
|
|
//qstr = "蒙A12345";
|
||
|
|
strcpy(keyValue,"蒙A12345");
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
bRet = IsVehicleBlack(keyValue,buf,iLen);
|
||
|
|
qstr = buf;
|
||
|
|
|
||
|
|
//大件车黑名单
|
||
|
|
// bool IsBigBlack(char *CarNo,char * result,int &resultLen);
|
||
|
|
|
||
|
|
//strcpy(keyValue,"76543711");
|
||
|
|
// qstr = "蒙A123456";
|
||
|
|
strcpy(keyValue,"蒙A12345");
|
||
|
|
// QStringToChar(keyValue,qstr,128,0);
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
bRet = IsBigBlack(keyValue,buf,iLen);
|
||
|
|
qstr = buf;
|
||
|
|
|
||
|
|
memset(keyValue,0,sizeof(keyValue));
|
||
|
|
keyValue[0] = 0xC3;
|
||
|
|
keyValue[1] = 0xC9;
|
||
|
|
strcat(keyValue,"KB1725_9");
|
||
|
|
// strcpy(keyValue,"2208241420");
|
||
|
|
//strcpy(keyValue,"smxczw123");
|
||
|
|
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =3000;
|
||
|
|
bRet = IsBigAppoint(keyValue, buf,iLen);
|
||
|
|
if(bRet)
|
||
|
|
{
|
||
|
|
// iRet = jsstr.checkBigPoint(buf);
|
||
|
|
}
|
||
|
|
|
||
|
|
qstr = buf;
|
||
|
|
|
||
|
|
memset(keyValue,0,sizeof(keyValue));
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =3000;
|
||
|
|
|
||
|
|
// qstr = "云A022UM_0";
|
||
|
|
// QStringToChar(keyValue,qstr,128,0);
|
||
|
|
strcpy(keyValue,"云A022UM_0");
|
||
|
|
bRet = IsSNBlack(keyValue, buf,iLen);
|
||
|
|
qstr = buf;
|
||
|
|
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =3000;
|
||
|
|
iRet = GetAutoClassInfo(dTime, iClassNo); //获取新的班次号
|
||
|
|
|
||
|
|
// int GetClassCName(const int ClassNo,char * result,int &resultLen);
|
||
|
|
|
||
|
|
dateTime = QDateTime::currentDateTime();
|
||
|
|
dTime = dateTime.toMSecsSinceEpoch();
|
||
|
|
|
||
|
|
tmptime.setMSecsSinceEpoch(dTime);
|
||
|
|
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =1000;
|
||
|
|
|
||
|
|
partno =0;
|
||
|
|
iRet = GetOptionalClassInfo(RoadNo,StaNo,partno,dTime,buf,iLen);
|
||
|
|
qstr = buf;
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
iClassNo =4;
|
||
|
|
iRet = GetClassCName(iClassNo,buf,iLen);
|
||
|
|
qstr = buf;
|
||
|
|
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
|
||
|
|
/* iRet = GetIDX(0,0,0,buf,iLen);
|
||
|
|
qstr = QString::fromLocal8Bit(buf);
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
|
||
|
|
iRet = GetRateVersion(buf,iLen);
|
||
|
|
qstr = QString::fromLocal8Bit(buf);
|
||
|
|
*/
|
||
|
|
ManId1 = 10;
|
||
|
|
RoadNo = 15;
|
||
|
|
StaNo = 205;
|
||
|
|
|
||
|
|
strcpy(keyValue,"1");
|
||
|
|
strcpy(Fieldname,"1");
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
bRet = CheckUserPassword(RoadNo,StaNo,keyValue,Fieldname,ManId1,ManId2,buf,iLen, GroupNo);
|
||
|
|
qstr = buf;
|
||
|
|
|
||
|
|
strcpy(keyValue,"15020423");
|
||
|
|
int CardId = 0xE0B637FE;
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =500;
|
||
|
|
bRet = CheckUserCard(RoadNo,StaNo,keyValue,CardId, ManId1, ManId2,buf,iLen, GroupNo);
|
||
|
|
|
||
|
|
qstr = buf;
|
||
|
|
|
||
|
|
strcpy(keyValue,"G0001110010010");
|
||
|
|
strcpy(Fieldname,"G0059150010040");
|
||
|
|
|
||
|
|
cardtype = 1;
|
||
|
|
Vegtype =1;
|
||
|
|
|
||
|
|
memset(buf,0,sizeof(buf));
|
||
|
|
iLen =8000;
|
||
|
|
|
||
|
|
RoadNo = 15;
|
||
|
|
StaNo = 1802;
|
||
|
|
bRet = GetMinFee(keyValue, Fieldname,RoadNo,StaNo,cardtype,Vegtype, buf,iLen);
|
||
|
|
qstr = buf;
|
||
|
|
|
||
|
|
Cash =100;
|
||
|
|
MinFee =100;
|
||
|
|
ExitFeeType = 3;
|
||
|
|
|
||
|
|
VehType =16;
|
||
|
|
CardType =5;
|
||
|
|
memset(errbuf,0,sizeof(errbuf));
|
||
|
|
|
||
|
|
bRet = CheckMinFee(Cash,MinFee,ExitFeeType,VehType,CardType,errcode, errbuf);
|
||
|
|
|
||
|
|
Cash =50;
|
||
|
|
MinFee =100;
|
||
|
|
ExitFeeType = 1;
|
||
|
|
VehType =1;
|
||
|
|
|
||
|
|
memset(errbuf,0,sizeof(errbuf));
|
||
|
|
|
||
|
|
bRet = CheckMinFee(Cash,MinFee,ExitFeeType,VehType,CardType,errcode, errbuf);
|
||
|
|
|
||
|
|
strcpy(keyValue,"0");
|
||
|
|
iRet = GetDiscount(keyValue,26,0);
|
||
|
|
|
||
|
|
iRet = UpdateParaFile("ROADCODE.DBF");
|
||
|
|
|
||
|
|
id =1;
|
||
|
|
iRet = GetVersion(id,1,buf,iLen);
|
||
|
|
if(0 ==iRet )
|
||
|
|
{
|
||
|
|
// ui->textEditVEROne->setPlainText(buf);
|
||
|
|
}
|
||
|
|
CloseParam();
|
||
|
|
|
||
|
|
ui->textEditInfo->insertPlainText("测试完成");
|
||
|
|
}
|