...
This commit is contained in:
@@ -389,7 +389,7 @@ void LoadRepairSuggestionFromXlsx( const std::wstring & filePat
|
||||
unsigned startRowIndex,
|
||||
std::vector<RepairSuggestionRecord> & recordVector )
|
||||
{
|
||||
Book * pBook = xlCreateBookW();
|
||||
Book * pBook = xlCreateXMLBookW();
|
||||
Sheet * pSheet = nullptr;
|
||||
|
||||
if ( pBook == nullptr )
|
||||
@@ -397,7 +397,16 @@ void LoadRepairSuggestionFromXlsx( const std::wstring & filePat
|
||||
throw runtime_error( "libxl库加载失败!" );
|
||||
}
|
||||
|
||||
if (pBook->load(filePath.c_str()) != true)
|
||||
{
|
||||
string errorMessage = "打开文件失败!";
|
||||
errorMessage.append(pBook->errorMessage());
|
||||
|
||||
throw runtime_error(errorMessage);
|
||||
}
|
||||
|
||||
setKey( pBook );
|
||||
|
||||
pSheet = pBook->getSheet( sheetIndex );
|
||||
|
||||
if ( pSheet == nullptr )
|
||||
@@ -431,8 +440,20 @@ void LoadRepairSuggestionFromXlsx( const std::wstring & filePat
|
||||
wstring messageSendingDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
wstring dataSource = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
|
||||
|
||||
|
||||
RepairSuggestionRecord record( orderNo,
|
||||
orderType,
|
||||
notifyNo,
|
||||
suggestedCarDealerCode,
|
||||
suggestedCarDealerName,
|
||||
damageDate,
|
||||
plateNumber,
|
||||
brandName,
|
||||
messageType,
|
||||
messageSendingDate,
|
||||
dataSource );
|
||||
|
||||
recordVector.push_back( record );
|
||||
|
||||
rowIndex++;
|
||||
}
|
||||
|
||||
|
@@ -48,6 +48,13 @@ void LoadRepairOrderFromXlsx( const std::wstring & filePath,
|
||||
// unsigned startRowIndex,
|
||||
// std::vector<RepairOrder> & orderVector );
|
||||
|
||||
/************************************************
|
||||
* \brief 读取送返修推荐表数据
|
||||
* \param filePath
|
||||
* \param sheetIndex
|
||||
* \param startRowIndex
|
||||
* \param recordVector
|
||||
************************************************/
|
||||
void LoadRepairSuggestionFromXlsx( const std::wstring & filePath,
|
||||
unsigned int sheetIndex,
|
||||
unsigned int startRowIndex,
|
||||
|
@@ -436,3 +436,27 @@ void ImportRepairOrderToOracle( const std::string & userName,
|
||||
OCI_ConnectionFree( pConn );
|
||||
OCI_Cleanup();
|
||||
}
|
||||
|
||||
void ImportRepairSuggestionToOracle( const std::string & userName,
|
||||
const std::string & password,
|
||||
const std::string & tnsName,
|
||||
const std::vector<RepairSuggestionRecord> & recordVector )
|
||||
{
|
||||
OCI_Connection * pConnection = nullptr;
|
||||
OCI_Statement * pStatement = nullptr;
|
||||
|
||||
const otext * szSql =
|
||||
"BEGIN \n" \
|
||||
" car_dealer.data_import_util_pkg.import_repairing_suggestion(:a_order_no, \n" \
|
||||
" :a_order_type, \n" \
|
||||
" :a_notify_no, \n" \
|
||||
" :a_sug_cardealer_code, \n" \
|
||||
" :a_sug_cardealer_name, \n" \
|
||||
" :a_damage_date, \n" \
|
||||
" :a_plateNo, \n" \
|
||||
" :a_brand_name, \n" \
|
||||
" :a_message_type, \n" \
|
||||
" :a_sending_date, \n" \
|
||||
" :a_data_source); \n" \
|
||||
"END;";
|
||||
}
|
||||
|
@@ -5,6 +5,7 @@
|
||||
#include "../../Datastructure/CarDealerAchievement/CarDealerAchievement.h"
|
||||
#include "../../Datastructure/CarDealerScheme/CarDealerScheme.h"
|
||||
#include "../../Datastructure/RepairOrder/RepairOrder.h"
|
||||
#include "../../Datastructure/RepairSuggestion/RepairSuggestionRecord.h"
|
||||
|
||||
|
||||
/************************************************
|
||||
@@ -55,3 +56,15 @@ void ImportRepairOrderToOracle( const std::string & userName,
|
||||
const std::string & password,
|
||||
const std::string & tnsName,
|
||||
const std::vector<RepairOrder> & orderVector );
|
||||
|
||||
/************************************************
|
||||
* \brief 将送返修推荐记录
|
||||
* \param userName
|
||||
* \param password
|
||||
* \param tnsName
|
||||
* \param recordVector
|
||||
************************************************/
|
||||
void ImportRepairSuggestionToOracle( const std::string & userName,
|
||||
const std::string & password,
|
||||
const std::string & tnsName,
|
||||
const std::vector<RepairSuggestionRecord> & recordVector );
|
||||
|
Reference in New Issue
Block a user