#include <vector>
#include <string>
#include <QtWidgets/QMessageBox>
#include "test.h"
#include "../data/DataManipulation/Excel/LoadFromExcel.h"
#include "../data/DataManipulation/oracle/ImportToOracle.h"
#include "../system/system_util.h"

using namespace std;

void excelTest();
void test_username();

void test()
{
	excelTest();
}

void excelTest()
{
	vector<CarDealerScheme>        schemeVector;
	vector<CarDealerAchievement>   achievementsVector;
	vector<RepairOrder>            repairOrderVector;
	vector<RepairSuggestionRecord> suggestionRecordsVector;
	vector<NewRepairMonitorReportRecord> repairMonitorVector;

	string userName = "car_dealer";
	string password = "cpic123456";
	string tnsName  = "xmcx1";

	wstring filePathRepairOrder          = L"D:/develop/projects_win/2019/car_dealer_util/数据/送返修工单/357783_1.xlsx";
	wstring filePathCarDealerScheme      = L"D:/develop/projects_win/2019/car_dealer_util/数据/PC端导入模板（管理员版）.xlsx";
	wstring filePathCarDealerAchievement = L"D:/develop/projects_win/2019/car_dealer_util/数据/PC端导入模板（客户经理版）.xlsx";
	wstring filePathRepairSuggestion     = L"D:/develop/projects_win/2019/car_dealer_util/数据/卢霖城 - 推荐表.xlsx";
	wstring filePathNewRepairMonitor     = L"D:/develop/projects_win/2019/car_dealer_util/数据/新送返修监控报表.xlsx";

	//测试车商方案
	//LoadCarDealerSchemeFromXlsx( filePathCarDealerScheme, 0, 1, schemeVector );
	//ImportCarDealerSchemeToOracle( userName, password, tnsName, schemeVector );

	//测试车商业绩
	//LoadCarDealerAchievementFromXlsx( filePathCarDealerAchievement, 0, 1, achievementsVector );
	//ImportCarDealerAchievementToOracleCpp( userName, password, tnsName, achievementsVector );

	//测试送返修工单
	//LoadRepairOrderFromXlsx(filePathRepairOrder, 0, 1, repairOrderVector);
	//ImportRepairOrderToOracle("car_dealer", "cpic123456", "xmcx1", repairOrderVector);

	//测试送返修推荐
	//LoadRepairSuggestionFromXlsx( filePathRepairSuggestion, 0, 1, suggestionRecordsVector );
	//ImportRepairSuggestionToOracle( userName, password, tnsName, suggestionRecordsVector);
	
	//测试新送返修监控报表
	//LoadNewRepairMonitorReportFromXlsx(filePathNewRepairMonitor, 0, 1, repairMonitorVector);
	//ImportNewRepairMonitorToOracle(userName, password, tnsName, repairMonitorVector);
	
	return;
}

void test_username()
{
	wstring userName = getUserName();

	QMessageBox::information( nullptr, "测试", QString::fromStdWString( userName ) );
}
