三个导入导出功能完成。
This commit is contained in:
		@@ -9,93 +9,103 @@ using namespace std;
 | 
			
		||||
using namespace ocilib;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void ImportCarDealerAchievementToOracleCpp(const std::string& userName,
 | 
			
		||||
	const std::string& password,
 | 
			
		||||
	const std::string& tnsName,
 | 
			
		||||
	const std::vector<CarDealerAchievement>& achievementVector)
 | 
			
		||||
/************************************************
 | 
			
		||||
* \brief 向oracle数据库写入车商业绩表,C++实现。
 | 
			
		||||
* \param userName oracle数据库用户名
 | 
			
		||||
* \param password oracle数据库密码
 | 
			
		||||
* \param tnsName oracle TNS名称
 | 
			
		||||
* \param orderVector 车商业绩表数据
 | 
			
		||||
************************************************/
 | 
			
		||||
void ImportCarDealerAchievementToOracleCpp( const std::string &                       userName,
 | 
			
		||||
                                            const std::string &                       password,
 | 
			
		||||
                                            const std::string &                       tnsName,
 | 
			
		||||
                                            const std::vector<CarDealerAchievement> & achievementVector )
 | 
			
		||||
{
 | 
			
		||||
	ostring sqlImport =
 | 
			
		||||
		"BEGIN "
 | 
			
		||||
		"  car_dealer.data_import_util_pkg.import_cardealer_achvmnt( :a_the_year, "
 | 
			
		||||
		"                                                            :a_the_month, "
 | 
			
		||||
		"                                                            :a_car_dealer_code, "
 | 
			
		||||
		"                                                            :a_checked_achievement, "
 | 
			
		||||
		"                                                            :a_policy_amount, "
 | 
			
		||||
		"                                                            :a_cpic_amount, "
 | 
			
		||||
		"                                                            :a_picc_amount , "
 | 
			
		||||
		"                                                            :a_pingan_amount, "
 | 
			
		||||
		"                                                            :a_others_amount ); "
 | 
			
		||||
		"END; ";
 | 
			
		||||
			"BEGIN \n"
 | 
			
		||||
			"  car_dealer.data_import_util_pkg.import_cardealer_achvmnt( :a_the_year, \n"
 | 
			
		||||
			"                                                            :a_the_month, \n"
 | 
			
		||||
			"                                                            :a_car_dealer_code, \n"
 | 
			
		||||
			"                                                            :a_checked_achievement, \n"
 | 
			
		||||
			"                                                            :a_policy_amount, \n"
 | 
			
		||||
			"                                                            :a_cpic_amount, \n"
 | 
			
		||||
			"                                                            :a_picc_amount , \n"
 | 
			
		||||
			"                                                            :a_pingan_amount, \n"
 | 
			
		||||
			"                                                            :a_others_amount ); \n"
 | 
			
		||||
			"END; ";
 | 
			
		||||
 | 
			
		||||
	//初始化
 | 
			
		||||
	try
 | 
			
		||||
	{
 | 
			
		||||
		Environment::Initialize();
 | 
			
		||||
	}
 | 
			
		||||
	catch (exception & error)
 | 
			
		||||
	catch ( exception & error )
 | 
			
		||||
	{
 | 
			
		||||
		string errorMessage = "ocilib初始化失败!";
 | 
			
		||||
		errorMessage.append(error.what());
 | 
			
		||||
		errorMessage.append( error.what() );
 | 
			
		||||
 | 
			
		||||
		throw runtime_error(errorMessage);
 | 
			
		||||
		throw runtime_error( errorMessage );
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	Connection* pConn = nullptr;
 | 
			
		||||
	Statement* pStmt = nullptr;
 | 
			
		||||
	Connection * pConn = nullptr;
 | 
			
		||||
	Statement *  pStmt = nullptr;
 | 
			
		||||
 | 
			
		||||
	try
 | 
			
		||||
	{
 | 
			
		||||
		pConn = new Connection(userName, password, tnsName);
 | 
			
		||||
		pConn = new Connection( tnsName, userName, password );
 | 
			
		||||
	}
 | 
			
		||||
	catch (exception & error)
 | 
			
		||||
	catch ( exception & error )
 | 
			
		||||
	{
 | 
			
		||||
		string errorMessage = "连接oracle失败!";
 | 
			
		||||
		errorMessage.append(error.what());
 | 
			
		||||
		errorMessage.append( error.what() );
 | 
			
		||||
 | 
			
		||||
		Environment::Cleanup();
 | 
			
		||||
 | 
			
		||||
		throw runtime_error(errorMessage);
 | 
			
		||||
		throw runtime_error( errorMessage );
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	try
 | 
			
		||||
	{
 | 
			
		||||
		pStmt = new Statement(*pConn);
 | 
			
		||||
		pStmt = new Statement( *pConn );
 | 
			
		||||
 | 
			
		||||
		pStmt->Prepare(sqlImport);
 | 
			
		||||
		pStmt->AllowRebinding(true);
 | 
			
		||||
		pStmt->Prepare( sqlImport );
 | 
			
		||||
		pStmt->AllowRebinding( true );
 | 
			
		||||
 | 
			
		||||
		for (auto iter = achievementVector.begin();
 | 
			
		||||
			iter != achievementVector.end();
 | 
			
		||||
			++iter)
 | 
			
		||||
		for ( auto iter = achievementVector.begin();
 | 
			
		||||
		      iter != achievementVector.end();
 | 
			
		||||
		      ++iter )
 | 
			
		||||
		{
 | 
			
		||||
			string checkedAchievement = QString("%1").arg(static_cast<double>(iter->getCheckedAchievement())).toStdString();
 | 
			
		||||
			string policyAmount = QString("%1").arg(iter->getPolicyAmount()).toStdString();
 | 
			
		||||
			string cpicAmount = QString("%1").arg(iter->getCpicAmount()).toStdString();
 | 
			
		||||
			string piccAmount = QString("%1").arg(iter->getPiccAmount()).toStdString();
 | 
			
		||||
			string pinganAmount = QString("%1").arg(iter->getPinganAmount()).toStdString();
 | 
			
		||||
			string othersAmount = QString("%1").arg(iter->getOthersAmount()).toStdString();
 | 
			
		||||
			string theYear            = QString::fromStdWString( iter->getTheYear() ).toStdString().c_str();
 | 
			
		||||
			string theMonth           = QString::fromStdWString( iter->getTheMonth() ).toStdString().c_str();
 | 
			
		||||
			string carDealerCode      = QString::fromStdWString( iter->getCarDealerCode() ).toStdString().c_str();
 | 
			
		||||
			string checkedAchievement = QString( "%1" ).arg( static_cast<double>(iter->getCheckedAchievement()) ).toStdString();
 | 
			
		||||
			string policyAmount       = QString( "%1" ).arg( iter->getPolicyAmount() ).toStdString();
 | 
			
		||||
			string cpicAmount         = QString( "%1" ).arg( iter->getCpicAmount() ).toStdString();
 | 
			
		||||
			string piccAmount         = QString( "%1" ).arg( iter->getPiccAmount() ).toStdString();
 | 
			
		||||
			string pinganAmount       = QString( "%1" ).arg( iter->getPinganAmount() ).toStdString();
 | 
			
		||||
			string othersAmount       = QString( "%1" ).arg( iter->getOthersAmount() ).toStdString();
 | 
			
		||||
 | 
			
		||||
			pStmt->Bind<ostring, int>(ostring(":a_the_year"), ostring(QString::fromStdWString(iter->getTheYear()).toStdString().c_str()), 0, BindInfo::BindDirectionValues::In);
 | 
			
		||||
			pStmt->Bind<ostring, int>(ostring(":a_the_month"), ostring(QString::fromStdWString(iter->getTheMonth()).toStdString().c_str()), 0, BindInfo::BindDirectionValues::In);
 | 
			
		||||
			pStmt->Bind<ostring, int>(ostring(":a_car_dealer_code"), ostring(QString::fromStdWString(iter->getCarDealerCode()).toStdString().c_str()), 0, BindInfo::BindDirectionValues::In);
 | 
			
		||||
			pStmt->Bind<ostring, int>(ostring(":a_checked_achievement"), ostring(checkedAchievement.c_str()), 0, BindInfo::BindDirectionValues::In);
 | 
			
		||||
			pStmt->Bind<ostring, int>(ostring(":a_policy_amount"), ostring(policyAmount.c_str()), 0, BindInfo::BindDirectionValues::In);
 | 
			
		||||
			pStmt->Bind<ostring, int>(ostring(":a_cpic_amount"), ostring(cpicAmount), 0, BindInfo::BindDirectionValues::In);
 | 
			
		||||
			pStmt->Bind<ostring, int>(ostring(":a_picc_amount"), ostring(piccAmount), 0, BindInfo::BindDirectionValues::In);
 | 
			
		||||
			pStmt->Bind<ostring, int>(ostring(":a_pingan_amount"), ostring(pinganAmount), 0, BindInfo::BindDirectionValues::In);
 | 
			
		||||
			pStmt->Bind<ostring, int>(ostring(":a_others_amount"), ostring(othersAmount), 0, BindInfo::BindDirectionValues::In);
 | 
			
		||||
			pStmt->Bind<ostring, int>( ostring( ":a_the_year" ), theYear, 0, BindInfo::BindDirectionValues::In );
 | 
			
		||||
			pStmt->Bind<ostring, int>( ostring( ":a_the_month" ), theMonth, 0, BindInfo::BindDirectionValues::In );
 | 
			
		||||
			pStmt->Bind<ostring, int>( ostring( ":a_car_dealer_code" ), carDealerCode, 0, BindInfo::BindDirectionValues::In );
 | 
			
		||||
			pStmt->Bind<ostring, int>( ostring( ":a_checked_achievement" ), checkedAchievement, 0, BindInfo::BindDirectionValues::In );
 | 
			
		||||
			pStmt->Bind<ostring, int>( ostring( ":a_policy_amount" ), policyAmount, 0, BindInfo::BindDirectionValues::In );
 | 
			
		||||
			pStmt->Bind<ostring, int>( ostring( ":a_cpic_amount" ), cpicAmount, 0, BindInfo::BindDirectionValues::In );
 | 
			
		||||
			pStmt->Bind<ostring, int>( ostring( ":a_picc_amount" ), piccAmount, 0, BindInfo::BindDirectionValues::In );
 | 
			
		||||
			pStmt->Bind<ostring, int>( ostring( ":a_pingan_amount" ), pinganAmount, 0, BindInfo::BindDirectionValues::In );
 | 
			
		||||
			pStmt->Bind<ostring, int>( ostring( ":a_others_amount" ), othersAmount, 0, BindInfo::BindDirectionValues::In );
 | 
			
		||||
 | 
			
		||||
			pStmt->ExecutePrepared();
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	catch (exception & error)
 | 
			
		||||
	catch ( exception & error )
 | 
			
		||||
	{
 | 
			
		||||
		string errorMessage = "语句执行失败!";
 | 
			
		||||
		errorMessage.append(error.what());
 | 
			
		||||
		errorMessage.append( error.what() );
 | 
			
		||||
 | 
			
		||||
		Environment::Cleanup();
 | 
			
		||||
 | 
			
		||||
		throw runtime_error(errorMessage);
 | 
			
		||||
		throw runtime_error( errorMessage );
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	Environment::Cleanup();
 | 
			
		||||
@@ -109,59 +119,59 @@ void ImportCarDealerAchievementToOracleCpp(const std::string& userName,
 | 
			
		||||
* \param tnsName oracle TNS名称
 | 
			
		||||
* \param orderVector 车商业绩表数据
 | 
			
		||||
************************************************/
 | 
			
		||||
void ImportCarDealerAchievementToOracle(std::string                         userName,
 | 
			
		||||
	std::string                         password,
 | 
			
		||||
	std::string                         tnsName,
 | 
			
		||||
	std::vector<CarDealerAchievement>& achievementVector)
 | 
			
		||||
void ImportCarDealerAchievementToOracle( std::string                         userName,
 | 
			
		||||
                                         std::string                         password,
 | 
			
		||||
                                         std::string                         tnsName,
 | 
			
		||||
                                         std::vector<CarDealerAchievement> & achievementVector )
 | 
			
		||||
{
 | 
			
		||||
	OCI_Connection* pConnection = nullptr;
 | 
			
		||||
	OCI_Statement* pStatement = nullptr;
 | 
			
		||||
	int              returnCode = 0;
 | 
			
		||||
	OCI_Connection * pConnection = nullptr;
 | 
			
		||||
	OCI_Statement *  pStatement  = nullptr;
 | 
			
		||||
	int              returnCode  = 0;
 | 
			
		||||
 | 
			
		||||
	const otext* szSqlImport =
 | 
			
		||||
		"BEGIN "
 | 
			
		||||
		"  car_dealer.data_import_util_pkg.import_cardealer_achvmnt( :a_the_year, "
 | 
			
		||||
		"                                                            :a_the_month, "
 | 
			
		||||
		"                                                            :a_car_dealer_code, "
 | 
			
		||||
		"                                                            :a_checked_achievement, "
 | 
			
		||||
		"                                                            :a_policy_amount, "
 | 
			
		||||
		"                                                            :a_cpic_amount, "
 | 
			
		||||
		"                                                            :a_picc_amount , "
 | 
			
		||||
		"                                                            :a_pingan_amount, "
 | 
			
		||||
		"                                                            :a_others_amount ); "
 | 
			
		||||
		"END; ";
 | 
			
		||||
	const otext * szSqlImport =
 | 
			
		||||
			"BEGIN "
 | 
			
		||||
			"  car_dealer.data_import_util_pkg.import_cardealer_achvmnt( :a_the_year, "
 | 
			
		||||
			"                                                            :a_the_month, "
 | 
			
		||||
			"                                                            :a_car_dealer_code, "
 | 
			
		||||
			"                                                            :a_checked_achievement, "
 | 
			
		||||
			"                                                            :a_policy_amount, "
 | 
			
		||||
			"                                                            :a_cpic_amount, "
 | 
			
		||||
			"                                                            :a_picc_amount , "
 | 
			
		||||
			"                                                            :a_pingan_amount, "
 | 
			
		||||
			"                                                            :a_others_amount ); "
 | 
			
		||||
			"END; ";
 | 
			
		||||
 | 
			
		||||
	//初始化
 | 
			
		||||
	returnCode = OCI_Initialize(l_error_handler, nullptr, OCI_ENV_DEFAULT);
 | 
			
		||||
	returnCode = OCI_Initialize( l_error_handler, nullptr, OCI_ENV_DEFAULT );
 | 
			
		||||
 | 
			
		||||
	if (static_cast<bool>(returnCode) == false)
 | 
			
		||||
	if ( static_cast<bool>(returnCode) == false )
 | 
			
		||||
	{
 | 
			
		||||
		string errorMessage("ocilib初始化错误:");
 | 
			
		||||
		errorMessage.append(get_last_error_message());
 | 
			
		||||
		string errorMessage( "ocilib初始化错误:" );
 | 
			
		||||
		errorMessage.append( get_last_error_message() );
 | 
			
		||||
 | 
			
		||||
		throw runtime_error(errorMessage);
 | 
			
		||||
		throw runtime_error( errorMessage );
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	pConnection = OCI_ConnectionCreate(tnsName.c_str(),
 | 
			
		||||
		userName.c_str(),
 | 
			
		||||
		password.c_str(),
 | 
			
		||||
		OCI_SESSION_DEFAULT);
 | 
			
		||||
	pConnection = OCI_ConnectionCreate( tnsName.c_str(),
 | 
			
		||||
	                                    userName.c_str(),
 | 
			
		||||
	                                    password.c_str(),
 | 
			
		||||
	                                    OCI_SESSION_DEFAULT );
 | 
			
		||||
 | 
			
		||||
	pStatement = OCI_StatementCreate(pConnection);
 | 
			
		||||
	pStatement = OCI_StatementCreate( pConnection );
 | 
			
		||||
 | 
			
		||||
	OCI_AllowRebinding(pStatement, true);
 | 
			
		||||
	OCI_Prepare(pStatement, szSqlImport);
 | 
			
		||||
	OCI_AllowRebinding( pStatement, true );
 | 
			
		||||
	OCI_Prepare( pStatement, szSqlImport );
 | 
			
		||||
 | 
			
		||||
	for (auto iterAchievement = achievementVector.begin();
 | 
			
		||||
		iterAchievement != achievementVector.end();
 | 
			
		||||
		++iterAchievement)
 | 
			
		||||
	for ( auto iterAchievement = achievementVector.begin();
 | 
			
		||||
	      iterAchievement != achievementVector.end();
 | 
			
		||||
	      ++iterAchievement )
 | 
			
		||||
	{
 | 
			
		||||
		string checkedAchievement = QString("%1").arg(static_cast<double>(iterAchievement->getCheckedAchievement())).toStdString();
 | 
			
		||||
		string policyAmount = QString("%1").arg(iterAchievement->getPolicyAmount()).toStdString();
 | 
			
		||||
		string cpicAmount = QString("%1").arg(iterAchievement->getCpicAmount()).toStdString();
 | 
			
		||||
		string piccAmount = QString("%1").arg(iterAchievement->getPiccAmount()).toStdString();
 | 
			
		||||
		string pinganAmount = QString("%1").arg(iterAchievement->getPinganAmount()).toStdString();
 | 
			
		||||
		string othersAmount = QString("%1").arg(iterAchievement->getOthersAmount()).toStdString();
 | 
			
		||||
		string checkedAchievement = QString( "%1" ).arg( static_cast<double>(iterAchievement->getCheckedAchievement()) ).toStdString();
 | 
			
		||||
		string policyAmount       = QString( "%1" ).arg( iterAchievement->getPolicyAmount() ).toStdString();
 | 
			
		||||
		string cpicAmount         = QString( "%1" ).arg( iterAchievement->getCpicAmount() ).toStdString();
 | 
			
		||||
		string piccAmount         = QString( "%1" ).arg( iterAchievement->getPiccAmount() ).toStdString();
 | 
			
		||||
		string pinganAmount       = QString( "%1" ).arg( iterAchievement->getPinganAmount() ).toStdString();
 | 
			
		||||
		string othersAmount       = QString( "%1" ).arg( iterAchievement->getOthersAmount() ).toStdString();
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -172,102 +182,101 @@ void ImportCarDealerAchievementToOracle(std::string                         user
 | 
			
		||||
* \param tnsName oracle TNS名称
 | 
			
		||||
* \param orderVector 车商方案表数据
 | 
			
		||||
************************************************/
 | 
			
		||||
void ImportCarDealerSchemeToOracle(const std::string& userName,
 | 
			
		||||
	const std::string& password,
 | 
			
		||||
	const std::string& tnsName,
 | 
			
		||||
	std::vector<CarDealerScheme>& schemeVector)
 | 
			
		||||
void ImportCarDealerSchemeToOracle( const std::string &            userName,
 | 
			
		||||
                                    const std::string &            password,
 | 
			
		||||
                                    const std::string &            tnsName,
 | 
			
		||||
                                    std::vector<CarDealerScheme> & schemeVector )
 | 
			
		||||
{
 | 
			
		||||
	//防御性验证
 | 
			
		||||
	if (userName.empty() == true ||
 | 
			
		||||
		password.empty() == true ||
 | 
			
		||||
		tnsName.empty() == true ||
 | 
			
		||||
		schemeVector.empty() == true)
 | 
			
		||||
	if ( userName.empty() == true ||
 | 
			
		||||
	     password.empty() == true ||
 | 
			
		||||
	     tnsName.empty() == true ||
 | 
			
		||||
	     schemeVector.empty() == true )
 | 
			
		||||
	{
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	Connection* pConnection = nullptr;
 | 
			
		||||
	Statement* pStatement = nullptr;
 | 
			
		||||
	Connection * pConnection = nullptr;
 | 
			
		||||
	Statement *  pStatement  = nullptr;
 | 
			
		||||
 | 
			
		||||
	ostring sqlInsertScheme =
 | 
			
		||||
		"begin \n"
 | 
			
		||||
		"  car_dealer.data_import_util_pkg.import_carder_scheme( :the_year, \n"
 | 
			
		||||
		"                                                        :the_month, \n"
 | 
			
		||||
		"                                                        :car_dealer_code, \n"
 | 
			
		||||
		"                                                        :man_hour_price, \n"
 | 
			
		||||
		"                                                        :part_price, \n"
 | 
			
		||||
		"                                                        :claim_support, \n"
 | 
			
		||||
		"                                                        :scheme, \n"
 | 
			
		||||
		"                                                        :is_qualified ); \n"
 | 
			
		||||
		"end; ";
 | 
			
		||||
			"begin \n"
 | 
			
		||||
			"  car_dealer.data_import_util_pkg.import_cardealer_scheme( :the_year, \n"
 | 
			
		||||
			"                                                        :the_month, \n"
 | 
			
		||||
			"                                                        :car_dealer_code, \n"
 | 
			
		||||
			"                                                        :man_hour_price, \n"
 | 
			
		||||
			"                                                        :part_price, \n"
 | 
			
		||||
			"                                                        :claim_support, \n"
 | 
			
		||||
			"                                                        :scheme, \n"
 | 
			
		||||
			"                                                        :is_qualified ); \n"
 | 
			
		||||
			"end; ";
 | 
			
		||||
 | 
			
		||||
	//初始化
 | 
			
		||||
	try
 | 
			
		||||
	{
 | 
			
		||||
		Environment::Initialize();
 | 
			
		||||
	}
 | 
			
		||||
	catch (exception & error)
 | 
			
		||||
	catch ( exception & error )
 | 
			
		||||
	{
 | 
			
		||||
		QString errorMessage = "初始化ocilib失败!";
 | 
			
		||||
		errorMessage.append(QString::fromLocal8Bit(error.what()));
 | 
			
		||||
		errorMessage.append( QString::fromLocal8Bit( error.what() ) );
 | 
			
		||||
 | 
			
		||||
		throw runtime_error(errorMessage.toLocal8Bit());
 | 
			
		||||
		throw runtime_error( errorMessage.toLocal8Bit() );
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	//
 | 
			
		||||
	try
 | 
			
		||||
	{
 | 
			
		||||
		pConnection = new Connection(tnsName, userName, password);
 | 
			
		||||
		pConnection = new Connection( tnsName, userName, password );
 | 
			
		||||
	}
 | 
			
		||||
	catch (exception & error)
 | 
			
		||||
	catch ( exception & error )
 | 
			
		||||
	{
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	//准备语句
 | 
			
		||||
	try
 | 
			
		||||
	{
 | 
			
		||||
		pStatement = new Statement(*pConnection);
 | 
			
		||||
		pStatement = new Statement( *pConnection );
 | 
			
		||||
 | 
			
		||||
		pStatement->Prepare(sqlInsertScheme);
 | 
			
		||||
		pStatement->AllowRebinding(true);
 | 
			
		||||
		pStatement->Prepare( sqlInsertScheme );
 | 
			
		||||
		pStatement->AllowRebinding( true );
 | 
			
		||||
 | 
			
		||||
		for (auto iterScheme = schemeVector.begin();
 | 
			
		||||
			iterScheme != schemeVector.end();
 | 
			
		||||
			++iterScheme)
 | 
			
		||||
		for ( auto iterScheme = schemeVector.begin();
 | 
			
		||||
		      iterScheme != schemeVector.end();
 | 
			
		||||
		      ++iterScheme )
 | 
			
		||||
		{
 | 
			
		||||
			string theYear = QString::fromStdWString(iterScheme->getTheYear()).toLocal8Bit();
 | 
			
		||||
			string theMonth = QString::fromStdWString(iterScheme->getTheMonth()).toLocal8Bit();
 | 
			
		||||
			string carDealerCode = QString::fromStdWString(iterScheme->getCarDealerCode()).toLocal8Bit();
 | 
			
		||||
			string manHourPrice = QString::fromStdWString(iterScheme->getManHourPrice()).toLocal8Bit();
 | 
			
		||||
			string partPrice = QString::fromStdWString(iterScheme->getPartPrice()).toLocal8Bit();
 | 
			
		||||
			string claimSupport = QString::fromStdWString(iterScheme->getCarDealerCode()).toLocal8Bit();
 | 
			
		||||
			string scheme = QString::fromStdWString(iterScheme->getScheme()).toLocal8Bit();
 | 
			
		||||
			string isQualified = QString::fromStdWString(iterScheme->getIsQualified()).toLocal8Bit();
 | 
			
		||||
			string theYear       = QString::fromStdWString( iterScheme->getTheYear() ).toLocal8Bit();
 | 
			
		||||
			string theMonth      = QString::fromStdWString( iterScheme->getTheMonth() ).toLocal8Bit();
 | 
			
		||||
			string carDealerCode = QString::fromStdWString( iterScheme->getCarDealerCode() ).toLocal8Bit();
 | 
			
		||||
			string manHourPrice  = QString::fromStdWString( iterScheme->getManHourPrice() ).toLocal8Bit();
 | 
			
		||||
			string partPrice     = QString::fromStdWString( iterScheme->getPartPrice() ).toLocal8Bit();
 | 
			
		||||
			string claimSupport  = QString::fromStdWString( iterScheme->getCarDealerCode() ).toLocal8Bit();
 | 
			
		||||
			string scheme        = QString::fromStdWString( iterScheme->getScheme() ).toLocal8Bit();
 | 
			
		||||
			string isQualified   = QString::fromStdWString( iterScheme->getIsQualified() ).toLocal8Bit();
 | 
			
		||||
 | 
			
		||||
			try
 | 
			
		||||
			{
 | 
			
		||||
				pStatement->Bind<ostring, int>(ostring(":the_year"), theYear, theYear.size(), BindInfo::BindDirectionValues::In);
 | 
			
		||||
				pStatement->Bind<ostring, int>(ostring(":the_month"), theMonth, theMonth.size(), BindInfo::BindDirectionValues::In);
 | 
			
		||||
				pStatement->Bind<ostring, int>(ostring(":car_dealer_code"), carDealerCode, carDealerCode.size(), BindInfo::BindDirectionValues::In);
 | 
			
		||||
				pStatement->Bind<ostring, int>(ostring(":man_hour_price"), manHourPrice, manHourPrice.size(), BindInfo::BindDirectionValues::In);
 | 
			
		||||
				pStatement->Bind<ostring, int>(ostring(":claim_support"), claimSupport, claimSupport.size(), BindInfo::BindDirectionValues::In);
 | 
			
		||||
				pStatement->Bind<ostring, int>(ostring(":part_price"), partPrice, partPrice.size(), BindInfo::BindDirectionValues::In);
 | 
			
		||||
				pStatement->Bind<ostring, int>(ostring(":scheme"), scheme, scheme.size(), BindInfo::BindDirectionValues::In);
 | 
			
		||||
				pStatement->Bind<ostring, int>(ostring(":is_qualified"), isQualified, isQualified.size(), BindInfo::BindDirectionValues::In);
 | 
			
		||||
				pStatement->Bind<ostring, int>( ostring( ":the_year" ), theYear, theYear.size(), BindInfo::BindDirectionValues::In );
 | 
			
		||||
				pStatement->Bind<ostring, int>( ostring( ":the_month" ), theMonth, theMonth.size(), BindInfo::BindDirectionValues::In );
 | 
			
		||||
				pStatement->Bind<ostring, int>( ostring( ":car_dealer_code" ), carDealerCode, carDealerCode.size(), BindInfo::BindDirectionValues::In );
 | 
			
		||||
				pStatement->Bind<ostring, int>( ostring( ":man_hour_price" ), manHourPrice, manHourPrice.size(), BindInfo::BindDirectionValues::In );
 | 
			
		||||
				pStatement->Bind<ostring, int>( ostring( ":claim_support" ), claimSupport, claimSupport.size(), BindInfo::BindDirectionValues::In );
 | 
			
		||||
				pStatement->Bind<ostring, int>( ostring( ":part_price" ), partPrice, partPrice.size(), BindInfo::BindDirectionValues::In );
 | 
			
		||||
				pStatement->Bind<ostring, int>( ostring( ":scheme" ), scheme, scheme.size(), BindInfo::BindDirectionValues::In );
 | 
			
		||||
				pStatement->Bind<ostring, int>( ostring( ":is_qualified" ), isQualified, isQualified.size(), BindInfo::BindDirectionValues::In );
 | 
			
		||||
 | 
			
		||||
				pStatement->ExecutePrepared();
 | 
			
		||||
			}
 | 
			
		||||
			catch (exception & error)
 | 
			
		||||
			catch ( exception & error )
 | 
			
		||||
			{
 | 
			
		||||
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	catch (exception & error)
 | 
			
		||||
	catch ( exception & error )
 | 
			
		||||
	{
 | 
			
		||||
		Environment::Cleanup();
 | 
			
		||||
 | 
			
		||||
		throw runtime_error(error.what());
 | 
			
		||||
		throw runtime_error( error.what() );
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	Environment::Cleanup();
 | 
			
		||||
@@ -281,149 +290,149 @@ void ImportCarDealerSchemeToOracle(const std::string& userName,
 | 
			
		||||
* \param tnsName oracle TNS名称
 | 
			
		||||
* \param orderVector 送返修工单数据
 | 
			
		||||
************************************************/
 | 
			
		||||
void ImportRepairOrderToOracle(const std::string& userName,
 | 
			
		||||
	const std::string& password,
 | 
			
		||||
	const std::string& tnsName,
 | 
			
		||||
	const std::vector<RepairOrder>& orderVector)
 | 
			
		||||
void ImportRepairOrderToOracle( const std::string &              userName,
 | 
			
		||||
                                const std::string &              password,
 | 
			
		||||
                                const std::string &              tnsName,
 | 
			
		||||
                                const std::vector<RepairOrder> & orderVector )
 | 
			
		||||
{
 | 
			
		||||
	OCI_Connection* pConn = nullptr;
 | 
			
		||||
	OCI_Statement* pStmt = nullptr;
 | 
			
		||||
	OCI_Connection * pConn = nullptr;
 | 
			
		||||
	OCI_Statement *  pStmt = nullptr;
 | 
			
		||||
 | 
			
		||||
	int           returnCode = 0;
 | 
			
		||||
	const otext* szSqlImport =
 | 
			
		||||
		"BEGIN"
 | 
			
		||||
		"  car_dealer.data_import_util_pkg.import_repairing_order(:a_branch_name, \n"
 | 
			
		||||
		"                                                          :a_order_no,\n"
 | 
			
		||||
		"                                                          :a_order_type,\n"
 | 
			
		||||
		"                                                          :a_notify_no,\n"
 | 
			
		||||
		"                                                          :a_damage_area,\n"
 | 
			
		||||
		"                                                          :a_damage_date,\n"
 | 
			
		||||
		"                                                          :a_generating_date,\n\n"
 | 
			
		||||
		"                                                          :a_policy_no,"
 | 
			
		||||
		"                                                          :a_policy_no_jqx,\n"
 | 
			
		||||
		"                                                          :a_plate_number,\n"
 | 
			
		||||
		"                                                          :a_brand_name,\n"
 | 
			
		||||
		"                                                          :a_is_insurance_object,\n"
 | 
			
		||||
		"                                                          :a_is_success,\n"
 | 
			
		||||
		"                                                          :a_recommend_dealer_code,\n"
 | 
			
		||||
		"                                                          :a_recommend_dealer_name,\n"
 | 
			
		||||
		"                                                          :a_recomm_dealer_name_in_notify,\n"
 | 
			
		||||
		"                                                          :a_recomm_dealer_name_in_survey,\n"
 | 
			
		||||
		"                                                          :a_agent_name,\n"
 | 
			
		||||
		"                                                          :a_surveyor,\n"
 | 
			
		||||
		"                                                          :a_check_date,\n"
 | 
			
		||||
		"                                                          :a_repairing_start_date,\n"
 | 
			
		||||
		"                                                          :a_repairing_finish_date,\n"
 | 
			
		||||
		"                                                          :a_status,\n"
 | 
			
		||||
		"                                                          :a_lost_item_id,\n"
 | 
			
		||||
		"                                                          :a_surveyor_recomm_status );\n"
 | 
			
		||||
		"END;";
 | 
			
		||||
	int           returnCode  = 0;
 | 
			
		||||
	const otext * szSqlImport =
 | 
			
		||||
			"BEGIN"
 | 
			
		||||
			"  car_dealer.data_import_util_pkg.import_repairing_order(:a_branch_name, \n"
 | 
			
		||||
			"                                                          :a_order_no,\n"
 | 
			
		||||
			"                                                          :a_order_type,\n"
 | 
			
		||||
			"                                                          :a_notify_no,\n"
 | 
			
		||||
			"                                                          :a_damage_area,\n"
 | 
			
		||||
			"                                                          :a_damage_date,\n"
 | 
			
		||||
			"                                                          :a_generating_date,\n\n"
 | 
			
		||||
			"                                                          :a_policy_no,"
 | 
			
		||||
			"                                                          :a_policy_no_jqx,\n"
 | 
			
		||||
			"                                                          :a_plate_number,\n"
 | 
			
		||||
			"                                                          :a_brand_name,\n"
 | 
			
		||||
			"                                                          :a_is_insurance_object,\n"
 | 
			
		||||
			"                                                          :a_is_success,\n"
 | 
			
		||||
			"                                                          :a_recommend_dealer_code,\n"
 | 
			
		||||
			"                                                          :a_recommend_dealer_name,\n"
 | 
			
		||||
			"                                                          :a_recomm_dealer_name_in_notify,\n"
 | 
			
		||||
			"                                                          :a_recomm_dealer_name_in_survey,\n"
 | 
			
		||||
			"                                                          :a_agent_name,\n"
 | 
			
		||||
			"                                                          :a_surveyor,\n"
 | 
			
		||||
			"                                                          :a_check_date,\n"
 | 
			
		||||
			"                                                          :a_repairing_start_date,\n"
 | 
			
		||||
			"                                                          :a_repairing_finish_date,\n"
 | 
			
		||||
			"                                                          :a_status,\n"
 | 
			
		||||
			"                                                          :a_lost_item_id,\n"
 | 
			
		||||
			"                                                          :a_surveyor_recomm_status );\n"
 | 
			
		||||
			"END;";
 | 
			
		||||
 | 
			
		||||
	//初始化
 | 
			
		||||
	returnCode = OCI_Initialize(l_error_handler, nullptr, OCI_ENV_DEFAULT);
 | 
			
		||||
	returnCode = OCI_Initialize( l_error_handler, nullptr, OCI_ENV_DEFAULT );
 | 
			
		||||
 | 
			
		||||
	if (static_cast<bool>(returnCode) == false)
 | 
			
		||||
	if ( static_cast<bool>(returnCode) == false )
 | 
			
		||||
	{
 | 
			
		||||
		string errorMessage("ocilib初始化错误:");
 | 
			
		||||
		errorMessage.append(get_last_error_message());
 | 
			
		||||
		string errorMessage( "ocilib初始化错误:" );
 | 
			
		||||
		errorMessage.append( get_last_error_message() );
 | 
			
		||||
 | 
			
		||||
		throw runtime_error(errorMessage);
 | 
			
		||||
		throw runtime_error( errorMessage );
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	pConn = OCI_ConnectionCreate(tnsName.c_str(),
 | 
			
		||||
		userName.c_str(),
 | 
			
		||||
		password.c_str(),
 | 
			
		||||
		OCI_SESSION_DEFAULT);
 | 
			
		||||
	pStmt = OCI_StatementCreate(pConn);
 | 
			
		||||
	pConn = OCI_ConnectionCreate( tnsName.c_str(),
 | 
			
		||||
	                              userName.c_str(),
 | 
			
		||||
	                              password.c_str(),
 | 
			
		||||
	                              OCI_SESSION_DEFAULT );
 | 
			
		||||
	pStmt = OCI_StatementCreate( pConn );
 | 
			
		||||
 | 
			
		||||
	try
 | 
			
		||||
	{
 | 
			
		||||
		OCI_AllowRebinding(pStmt, true);
 | 
			
		||||
		OCI_Prepare(pStmt, szSqlImport);
 | 
			
		||||
		OCI_AllowRebinding( pStmt, true );
 | 
			
		||||
		OCI_Prepare( pStmt, szSqlImport );
 | 
			
		||||
	}
 | 
			
		||||
	catch (runtime_error & error)
 | 
			
		||||
	catch ( runtime_error & error )
 | 
			
		||||
	{
 | 
			
		||||
		OCI_ConnectionFree(pConn);
 | 
			
		||||
		OCI_ConnectionFree( pConn );
 | 
			
		||||
		OCI_Cleanup();
 | 
			
		||||
 | 
			
		||||
		throw error;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for (auto iterOrder = orderVector.begin();
 | 
			
		||||
		iterOrder != orderVector.end();
 | 
			
		||||
		++iterOrder)
 | 
			
		||||
	for ( auto iterOrder = orderVector.begin();
 | 
			
		||||
	      iterOrder != orderVector.end();
 | 
			
		||||
	      ++iterOrder )
 | 
			
		||||
	{
 | 
			
		||||
		try
 | 
			
		||||
		{
 | 
			
		||||
			string branchName = QString::fromStdWString(iterOrder->getBranchName()).toLocal8Bit();
 | 
			
		||||
			string orderNo = QString::fromStdWString(iterOrder->getOrderNo()).toLocal8Bit();
 | 
			
		||||
			string orderType = QString::fromStdWString(iterOrder->getOrderType()).toLocal8Bit();
 | 
			
		||||
			string notifyNo = QString::fromStdWString(iterOrder->getNotifyNo()).toLocal8Bit();
 | 
			
		||||
			string damageArea = QString::fromStdWString(iterOrder->getDamageArea()).toLocal8Bit();
 | 
			
		||||
			string damageDate = QString::fromStdWString(iterOrder->getDamageDate()).toLocal8Bit();
 | 
			
		||||
			string genDate = QString::fromStdWString(iterOrder->getGeneratingDate()).toLocal8Bit();
 | 
			
		||||
			string policyNo = QString::fromStdWString(iterOrder->getPolicyNo()).toLocal8Bit();
 | 
			
		||||
			string policyNoJQX = QString::fromStdWString(iterOrder->getPolicyNoJqx()).toLocal8Bit();
 | 
			
		||||
			string plateNumber = QString::fromStdWString(iterOrder->getPlateNumber()).toLocal8Bit();;
 | 
			
		||||
			string brandName = QString::fromStdWString(iterOrder->getBrandName()).toLocal8Bit();;
 | 
			
		||||
			string isInsuranceObject = QString::fromStdWString(iterOrder->getIsInsuranceObject()).toLocal8Bit();
 | 
			
		||||
			string isSuccess = QString::fromStdWString(iterOrder->getIsSuccess()).toLocal8Bit();
 | 
			
		||||
			string recommandDealerCode = QString::fromStdWString(iterOrder->getRecommandDealerCode()).toLocal8Bit();
 | 
			
		||||
			string recommandDealerName = QString::fromStdWString(iterOrder->getRecommandDealerName()).toLocal8Bit();
 | 
			
		||||
			string recommandDealerCodeInNameInNotify = QString::fromStdWString(iterOrder->getRecommandDealerNameInNotify()).toLocal8Bit();
 | 
			
		||||
			string recommandDealerCodeInSurvy = QString::fromStdWString(iterOrder->getRecommandDealerNameInSurvey()).toLocal8Bit();
 | 
			
		||||
			string agentName = QString::fromStdWString(iterOrder->getAgentName()).toLocal8Bit();
 | 
			
		||||
			string surveyor = QString::fromStdWString(iterOrder->getSurveyor()).toLocal8Bit();
 | 
			
		||||
			string repairingStartDate = QString::fromStdWString(iterOrder->getRepairingStartDate()).toLocal8Bit();
 | 
			
		||||
			string repairingEndDate = QString::fromStdWString(iterOrder->getRepairingFinishDate()).toLocal8Bit();
 | 
			
		||||
			string checkDate = QString::fromStdWString(iterOrder->getCheckDate()).toLocal8Bit();
 | 
			
		||||
			string status = QString::fromStdWString(iterOrder->getStatus()).toLocal8Bit();
 | 
			
		||||
			string lostItemID = QString::fromStdWString(iterOrder->getLostItemId()).toLocal8Bit();
 | 
			
		||||
			string surveyorRecommandStatus = QString::fromStdWString(iterOrder->getSurveyorRecommandStatus()).toLocal8Bit();
 | 
			
		||||
			string branchName                        = QString::fromStdWString( iterOrder->getBranchName() ).toLocal8Bit();
 | 
			
		||||
			string orderNo                           = QString::fromStdWString( iterOrder->getOrderNo() ).toLocal8Bit();
 | 
			
		||||
			string orderType                         = QString::fromStdWString( iterOrder->getOrderType() ).toLocal8Bit();
 | 
			
		||||
			string notifyNo                          = QString::fromStdWString( iterOrder->getNotifyNo() ).toLocal8Bit();
 | 
			
		||||
			string damageArea                        = QString::fromStdWString( iterOrder->getDamageArea() ).toLocal8Bit();
 | 
			
		||||
			string damageDate                        = QString::fromStdWString( iterOrder->getDamageDate() ).toLocal8Bit();
 | 
			
		||||
			string genDate                           = QString::fromStdWString( iterOrder->getGeneratingDate() ).toLocal8Bit();
 | 
			
		||||
			string policyNo                          = QString::fromStdWString( iterOrder->getPolicyNo() ).toLocal8Bit();
 | 
			
		||||
			string policyNoJQX                       = QString::fromStdWString( iterOrder->getPolicyNoJqx() ).toLocal8Bit();
 | 
			
		||||
			string plateNumber                       = QString::fromStdWString( iterOrder->getPlateNumber() ).toLocal8Bit();;
 | 
			
		||||
			string brandName                         = QString::fromStdWString( iterOrder->getBrandName() ).toLocal8Bit();;
 | 
			
		||||
			string isInsuranceObject                 = QString::fromStdWString( iterOrder->getIsInsuranceObject() ).toLocal8Bit();
 | 
			
		||||
			string isSuccess                         = QString::fromStdWString( iterOrder->getIsSuccess() ).toLocal8Bit();
 | 
			
		||||
			string recommandDealerCode               = QString::fromStdWString( iterOrder->getRecommandDealerCode() ).toLocal8Bit();
 | 
			
		||||
			string recommandDealerName               = QString::fromStdWString( iterOrder->getRecommandDealerName() ).toLocal8Bit();
 | 
			
		||||
			string recommandDealerCodeInNameInNotify = QString::fromStdWString( iterOrder->getRecommandDealerNameInNotify() ).toLocal8Bit();
 | 
			
		||||
			string recommandDealerCodeInSurvy        = QString::fromStdWString( iterOrder->getRecommandDealerNameInSurvey() ).toLocal8Bit();
 | 
			
		||||
			string agentName                         = QString::fromStdWString( iterOrder->getAgentName() ).toLocal8Bit();
 | 
			
		||||
			string surveyor                          = QString::fromStdWString( iterOrder->getSurveyor() ).toLocal8Bit();
 | 
			
		||||
			string repairingStartDate                = QString::fromStdWString( iterOrder->getRepairingStartDate() ).toLocal8Bit();
 | 
			
		||||
			string repairingEndDate                  = QString::fromStdWString( iterOrder->getRepairingFinishDate() ).toLocal8Bit();
 | 
			
		||||
			string checkDate                         = QString::fromStdWString( iterOrder->getCheckDate() ).toLocal8Bit();
 | 
			
		||||
			string status                            = QString::fromStdWString( iterOrder->getStatus() ).toLocal8Bit();
 | 
			
		||||
			string lostItemID                        = QString::fromStdWString( iterOrder->getLostItemId() ).toLocal8Bit();
 | 
			
		||||
			string surveyorRecommandStatus           = QString::fromStdWString( iterOrder->getSurveyorRecommandStatus() ).toLocal8Bit();
 | 
			
		||||
 | 
			
		||||
			OCI_BindString(pStmt, ":a_branch_name", const_cast<otext*>(branchName.c_str()), 0);
 | 
			
		||||
			OCI_BindString(pStmt, ":a_order_no", const_cast<otext*>(orderNo.c_str()), 0);
 | 
			
		||||
			OCI_BindString(pStmt, ":a_order_type", const_cast<otext*>(orderType.c_str()), 0);
 | 
			
		||||
			OCI_BindString(pStmt, ":a_notify_no", const_cast<otext*>(notifyNo.c_str()), 0);
 | 
			
		||||
			OCI_BindString(pStmt, ":a_damage_area", const_cast<otext*>(damageArea.c_str()), 0);
 | 
			
		||||
			OCI_BindString(pStmt, ":a_policy_no", const_cast<otext*>(policyNo.c_str()), 0);
 | 
			
		||||
			OCI_BindString(pStmt, ":a_policy_no_jqx", const_cast<otext*>(policyNoJQX.c_str()), 0);
 | 
			
		||||
			OCI_BindString(pStmt, ":a_plate_number", const_cast<otext*>(plateNumber.c_str()), 0);
 | 
			
		||||
			OCI_BindString(pStmt, ":a_brand_name", const_cast<otext*>(brandName.c_str()), 0);
 | 
			
		||||
			OCI_BindString(pStmt, ":a_is_insurance_object", const_cast<otext*>(isInsuranceObject.c_str()), 0);
 | 
			
		||||
			OCI_BindString(pStmt, ":a_is_success", const_cast<otext*>(isSuccess.c_str()), 0);
 | 
			
		||||
			OCI_BindString(pStmt, ":a_recommend_dealer_code", const_cast<otext*>(recommandDealerCode.c_str()), 0);
 | 
			
		||||
			OCI_BindString(pStmt, ":a_recommend_dealer_name", const_cast<otext*>(recommandDealerName.c_str()), 0);
 | 
			
		||||
			OCI_BindString(pStmt, ":a_recomm_dealer_name_in_notify", const_cast<otext*>(recommandDealerCodeInNameInNotify.c_str()), 0);
 | 
			
		||||
			OCI_BindString(pStmt, ":a_recomm_dealer_name_in_survey", const_cast<otext*>(recommandDealerCodeInSurvy.c_str()), 0);
 | 
			
		||||
			OCI_BindString(pStmt, ":a_agent_name", const_cast<otext*>(agentName.c_str()), 0);
 | 
			
		||||
			OCI_BindString(pStmt, ":a_surveyor", const_cast<otext*>(surveyor.c_str()), 0);
 | 
			
		||||
			OCI_BindString(pStmt, ":a_status", const_cast<otext*>(status.c_str()), 0);
 | 
			
		||||
			OCI_BindString(pStmt, ":a_lost_item_id", const_cast<otext*>(lostItemID.c_str()), 0);
 | 
			
		||||
			OCI_BindString(pStmt, ":a_surveyor_recomm_status", const_cast<otext*>(surveyorRecommandStatus.c_str()), 0);
 | 
			
		||||
			OCI_BindString( pStmt, ":a_branch_name", const_cast<otext*>(branchName.c_str()), 0 );
 | 
			
		||||
			OCI_BindString( pStmt, ":a_order_no", const_cast<otext*>(orderNo.c_str()), 0 );
 | 
			
		||||
			OCI_BindString( pStmt, ":a_order_type", const_cast<otext*>(orderType.c_str()), 0 );
 | 
			
		||||
			OCI_BindString( pStmt, ":a_notify_no", const_cast<otext*>(notifyNo.c_str()), 0 );
 | 
			
		||||
			OCI_BindString( pStmt, ":a_damage_area", const_cast<otext*>(damageArea.c_str()), 0 );
 | 
			
		||||
			OCI_BindString( pStmt, ":a_policy_no", const_cast<otext*>(policyNo.c_str()), 0 );
 | 
			
		||||
			OCI_BindString( pStmt, ":a_policy_no_jqx", const_cast<otext*>(policyNoJQX.c_str()), 0 );
 | 
			
		||||
			OCI_BindString( pStmt, ":a_plate_number", const_cast<otext*>(plateNumber.c_str()), 0 );
 | 
			
		||||
			OCI_BindString( pStmt, ":a_brand_name", const_cast<otext*>(brandName.c_str()), 0 );
 | 
			
		||||
			OCI_BindString( pStmt, ":a_is_insurance_object", const_cast<otext*>(isInsuranceObject.c_str()), 0 );
 | 
			
		||||
			OCI_BindString( pStmt, ":a_is_success", const_cast<otext*>(isSuccess.c_str()), 0 );
 | 
			
		||||
			OCI_BindString( pStmt, ":a_recommend_dealer_code", const_cast<otext*>(recommandDealerCode.c_str()), 0 );
 | 
			
		||||
			OCI_BindString( pStmt, ":a_recommend_dealer_name", const_cast<otext*>(recommandDealerName.c_str()), 0 );
 | 
			
		||||
			OCI_BindString( pStmt, ":a_recomm_dealer_name_in_notify", const_cast<otext*>(recommandDealerCodeInNameInNotify.c_str()), 0 );
 | 
			
		||||
			OCI_BindString( pStmt, ":a_recomm_dealer_name_in_survey", const_cast<otext*>(recommandDealerCodeInSurvy.c_str()), 0 );
 | 
			
		||||
			OCI_BindString( pStmt, ":a_agent_name", const_cast<otext*>(agentName.c_str()), 0 );
 | 
			
		||||
			OCI_BindString( pStmt, ":a_surveyor", const_cast<otext*>(surveyor.c_str()), 0 );
 | 
			
		||||
			OCI_BindString( pStmt, ":a_status", const_cast<otext*>(status.c_str()), 0 );
 | 
			
		||||
			OCI_BindString( pStmt, ":a_lost_item_id", const_cast<otext*>(lostItemID.c_str()), 0 );
 | 
			
		||||
			OCI_BindString( pStmt, ":a_surveyor_recomm_status", const_cast<otext*>(surveyorRecommandStatus.c_str()), 0 );
 | 
			
		||||
 | 
			
		||||
			OCI_BindString(pStmt, ":a_damage_date", const_cast<otext*>(damageDate.c_str()), 0);
 | 
			
		||||
			OCI_BindString(pStmt, ":a_generating_date", const_cast<otext*>(genDate.c_str()), 0);
 | 
			
		||||
			OCI_BindString(pStmt, ":a_check_date", const_cast<otext*>(checkDate.c_str()), 0);
 | 
			
		||||
			OCI_BindString(pStmt, ":a_repairing_start_date", const_cast<otext*>(repairingStartDate.c_str()), 0);
 | 
			
		||||
			OCI_BindString(pStmt, ":a_repairing_finish_date", const_cast<otext*>(repairingEndDate.c_str()), 0);
 | 
			
		||||
			OCI_BindString( pStmt, ":a_damage_date", const_cast<otext*>(damageDate.c_str()), 0 );
 | 
			
		||||
			OCI_BindString( pStmt, ":a_generating_date", const_cast<otext*>(genDate.c_str()), 0 );
 | 
			
		||||
			OCI_BindString( pStmt, ":a_check_date", const_cast<otext*>(checkDate.c_str()), 0 );
 | 
			
		||||
			OCI_BindString( pStmt, ":a_repairing_start_date", const_cast<otext*>(repairingStartDate.c_str()), 0 );
 | 
			
		||||
			OCI_BindString( pStmt, ":a_repairing_finish_date", const_cast<otext*>(repairingEndDate.c_str()), 0 );
 | 
			
		||||
 | 
			
		||||
			OCI_Execute(pStmt);
 | 
			
		||||
			OCI_Execute( pStmt );
 | 
			
		||||
		}
 | 
			
		||||
		catch (runtime_error & error)
 | 
			
		||||
		catch ( runtime_error & error )
 | 
			
		||||
		{
 | 
			
		||||
			//输出日志,让过程继续
 | 
			
		||||
			string errorMessage = "送返修工单编号";
 | 
			
		||||
 | 
			
		||||
			errorMessage.append(QString::fromStdWString(iterOrder->getOrderNo()).toLocal8Bit());
 | 
			
		||||
			errorMessage.append("保存失败,提示信息:");
 | 
			
		||||
			errorMessage.append(error.what());
 | 
			
		||||
			errorMessage.append( QString::fromStdWString( iterOrder->getOrderNo() ).toLocal8Bit() );
 | 
			
		||||
			errorMessage.append( "保存失败,提示信息:" );
 | 
			
		||||
			errorMessage.append( error.what() );
 | 
			
		||||
 | 
			
		||||
			output_error_message(errorMessage);
 | 
			
		||||
			output_error_message( errorMessage );
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	OCI_Commit(pConn);
 | 
			
		||||
	OCI_ConnectionFree(pConn);
 | 
			
		||||
	OCI_Commit( pConn );
 | 
			
		||||
	OCI_ConnectionFree( pConn );
 | 
			
		||||
	OCI_Cleanup();
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -14,10 +14,23 @@
 | 
			
		||||
* \param tnsName oracle TNS名称
 | 
			
		||||
* \param orderVector 车商业绩表数据
 | 
			
		||||
************************************************/
 | 
			
		||||
void ImportCarDealerAchievementToOracleCpp(const std::string& userName,
 | 
			
		||||
	const std::string& password,
 | 
			
		||||
	const std::string& tnsName,
 | 
			
		||||
	const std::vector<CarDealerAchievement>& achievementVector);
 | 
			
		||||
void ImportCarDealerAchievementToOracleCpp( const std::string &                       userName,
 | 
			
		||||
                                            const std::string &                       password,
 | 
			
		||||
                                            const std::string &                       tnsName,
 | 
			
		||||
                                            const std::vector<CarDealerAchievement> & achievementVector );
 | 
			
		||||
 | 
			
		||||
/************************************************
 | 
			
		||||
* \brief 向oracle数据库写入车商业绩表
 | 
			
		||||
* \param userName oracle数据库用户名
 | 
			
		||||
* \param password oracle数据库密码
 | 
			
		||||
* \param tnsName oracle TNS名称
 | 
			
		||||
* \param orderVector 车商业绩表数据
 | 
			
		||||
************************************************/
 | 
			
		||||
void ImportCarDealerAchievementToOracle( std::string                         userName,
 | 
			
		||||
                                         std::string                         password,
 | 
			
		||||
                                         std::string                         tnsName,
 | 
			
		||||
                                         std::vector<CarDealerAchievement> & achievementVector );
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/************************************************
 | 
			
		||||
* \brief 向oracle数据库写入车商方案表
 | 
			
		||||
@@ -26,10 +39,10 @@ void ImportCarDealerAchievementToOracleCpp(const std::string& userName,
 | 
			
		||||
* \param tnsName oracle TNS名称
 | 
			
		||||
* \param orderVector 车商方案表数据
 | 
			
		||||
************************************************/
 | 
			
		||||
void ImportCarDealerSchemeToOracle(const std::string& userName,
 | 
			
		||||
	const std::string& password,
 | 
			
		||||
	const std::string& tnsName,
 | 
			
		||||
	std::vector<CarDealerScheme>& achievementVector);
 | 
			
		||||
void ImportCarDealerSchemeToOracle( const std::string &            userName,
 | 
			
		||||
                                    const std::string &            password,
 | 
			
		||||
                                    const std::string &            tnsName,
 | 
			
		||||
                                    std::vector<CarDealerScheme> & achievementVector );
 | 
			
		||||
 | 
			
		||||
/************************************************
 | 
			
		||||
* \brief 向oracle数据库写入送返修工单信息
 | 
			
		||||
@@ -38,7 +51,7 @@ void ImportCarDealerSchemeToOracle(const std::string& userName,
 | 
			
		||||
* \param tnsName oracle TNS名称
 | 
			
		||||
* \param orderVector 送返修工单数据
 | 
			
		||||
************************************************/
 | 
			
		||||
void ImportRepairOrderToOracle(const std::string& userName,
 | 
			
		||||
	const std::string& password,
 | 
			
		||||
	const std::string& tnsName,
 | 
			
		||||
	const std::vector<RepairOrder>& orderVector);
 | 
			
		||||
void ImportRepairOrderToOracle( const std::string &              userName,
 | 
			
		||||
                                const std::string &              password,
 | 
			
		||||
                                const std::string &              tnsName,
 | 
			
		||||
                                const std::vector<RepairOrder> & orderVector );
 | 
			
		||||
 
 | 
			
		||||
@@ -22,15 +22,28 @@ void excelTest()
 | 
			
		||||
	vector<CarDealerAchievement> achievementsVector;
 | 
			
		||||
	vector<RepairOrder>          repairOrderVector;
 | 
			
		||||
 | 
			
		||||
	wstring filePath = L"D:/develop/projects_win/2019/car_dealer_util/数据/送返修工单/357783_1.xlsx";
 | 
			
		||||
	string userName = "car_dealer";
 | 
			
		||||
	string password = "cpic123456";
 | 
			
		||||
	string tnsName  = "xmcx1";
 | 
			
		||||
 | 
			
		||||
	string xlsFilePath = "D:/develop/projects_win/2019/car_dealer_util/数据/345517_1.xls";
 | 
			
		||||
	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";
 | 
			
		||||
 | 
			
		||||
	//string xlsFilePath = "D:/develop/projects_win/2019/car_dealer_util/数据/345517_1.xls";
 | 
			
		||||
 | 
			
		||||
	//测试车商方案
 | 
			
		||||
	//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);
 | 
			
		||||
 | 
			
		||||
	//LoadCarDealerSchemeFromXlsx(filePath, 0, 1, schemeVector);
 | 
			
		||||
	//LoadCarDealerAchievementFromXlsx( filePath, 0, 1, achievementsVector );
 | 
			
		||||
	LoadRepairOrderFromXlsx(filePath, 0, 1, repairOrderVector);
 | 
			
		||||
	ImportRepairOrderToOracle("car_dealer", "cpic123456", "xmcx1", repairOrderVector);
 | 
			
		||||
	
 | 
			
		||||
	return;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -38,5 +51,5 @@ void test_username()
 | 
			
		||||
{
 | 
			
		||||
	wstring userName = getUserName();
 | 
			
		||||
 | 
			
		||||
	QMessageBox::information(nullptr, "测试", QString::fromStdWString(userName));
 | 
			
		||||
	QMessageBox::information( nullptr, "测试", QString::fromStdWString( userName ) );
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user