提交信息!

This commit is contained in:
Kane Wang 2020-11-27 16:47:22 +08:00
parent 773bba3c06
commit f961688dc1
6 changed files with 413 additions and 367 deletions

View File

@ -80,16 +80,16 @@ void LoadCarDealerSchemeFromXlsx( const wstring & filePath,
} }
//核对车商代码 //核对车商代码
auto iterCarDealer = pCarDealerMap->find(carDealerCode); auto iterCarDealer = pCarDealerMap->find( carDealerCode );
if ( iterCarDealer == pCarDealerMap->end() ) if ( iterCarDealer == pCarDealerMap->end() )
{ {
//没查到这个车商,清除掉已经读取的数据 //没查到这个车商,清除掉已经读取的数据
schemeVector.clear(); schemeVector.clear();
QString rowIndexString = QString::number(rowIndex, 'g', -1); QString rowIndexString = QString::number( rowIndex, 'g', -1 );
QString errorMessage = QString("") + rowIndexString + QString("行车商代码错误!"); QString errorMessage = QString( "" ) + rowIndexString + QString( "行车商代码错误!" );
throw runtime_error(errorMessage.toStdString()); throw runtime_error( errorMessage.toStdString() );
} }
CarDealerScheme carDealerScheme( theYear, CarDealerScheme carDealerScheme( theYear,
@ -149,7 +149,7 @@ void LoadCarDealerAchievementFromXlsx( const std::wstring & fileP
int firstColumnIndex = pSheet->firstCol(); int firstColumnIndex = pSheet->firstCol();
int rowIndex = firstRowIndex + startRowIndex; int rowIndex = firstRowIndex + startRowIndex;
unordered_map<wstring, CarDealer>* pCarDealerMap = GetCarDealerMap(); unordered_map<wstring, CarDealer> * pCarDealerMap = GetCarDealerMap();
while ( rowIndex <= lastRowIndex ) while ( rowIndex <= lastRowIndex )
{ {
@ -175,16 +175,18 @@ void LoadCarDealerAchievementFromXlsx( const std::wstring & fileP
} }
//核对车商代码 //核对车商代码
auto iterCarDealer = pCarDealerMap->find(carDealerCode); auto iterCarDealer = pCarDealerMap->find( carDealerCode );
if (iterCarDealer == pCarDealerMap->end()) if ( iterCarDealer == pCarDealerMap->end() )
{ {
//没查到这个车商,清除掉已经读取的数据 //没查到这个车商,清除掉已经读取的数据
achievementVector.clear(); achievementVector.clear();
QString rowIndexString = QString::number(rowIndex, 'g', -1); QString rowIndexString = QString::number( rowIndex, 'g', -1 );
QString errorMessage = QString("") + rowIndexString + QString("行车商代码错误!"); QString errorMessage = QString( "" ) + rowIndexString + QString( "行车商代码错误!" );
throw runtime_error(errorMessage.toStdString()); pBook->release();
throw runtime_error( errorMessage.toStdString() );
} }
//每个字段都要先判断数据类型再读写,防止填写表格的人填错内容。 //每个字段都要先判断数据类型再读写,防止填写表格的人填错内容。
@ -342,7 +344,7 @@ void LoadRepairOrderFromXlsx( const std::wstring & filePath,
int firstRowIndex = pSheet->firstRow(); int firstRowIndex = pSheet->firstRow();
int rowIndex = firstRowIndex + startRowIndex; int rowIndex = firstRowIndex + startRowIndex;
auto* pCarDealerMap = GetCarDealerMap(); auto * pCarDealerMap = GetCarDealerMap();
while ( rowIndex <= lastRowIndex ) while ( rowIndex <= lastRowIndex )
{ {
@ -466,8 +468,8 @@ void LoadRepairRecommandationFromXlsx( const std::wstring & fil
wstring orderNo = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); wstring orderNo = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
wstring orderType = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); wstring orderType = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
wstring notifyNo = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); wstring notifyNo = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
wstring suggestedCarDealerCode = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); wstring RecommandCarDealerCode = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
wstring suggestedCarDealerName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); wstring RecommandCarDealerName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
wstring damageDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); wstring damageDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
wstring plateNumber = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); wstring plateNumber = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
wstring brandName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); wstring brandName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
@ -478,8 +480,8 @@ void LoadRepairRecommandationFromXlsx( const std::wstring & fil
RepairRecommandationRecord record( orderNo, RepairRecommandationRecord record( orderNo,
orderType, orderType,
notifyNo, notifyNo,
suggestedCarDealerCode, RecommandCarDealerCode,
suggestedCarDealerName, RecommandCarDealerName,
damageDate, damageDate,
plateNumber, plateNumber,
brandName, brandName,

View File

@ -50,7 +50,7 @@ void LoadRepairOrderFromXlsx( const std::wstring & filePath,
// std::vector<RepairOrder> & orderVector ); // std::vector<RepairOrder> & orderVector );
/************************************************ /************************************************
* \brief * \brief
* \param filePath * \param filePath
* \param sheetIndex * \param sheetIndex
* \param startRowIndex * \param startRowIndex

View File

@ -437,10 +437,10 @@ void ImportRepairOrderToOracle( const std::string & userName,
OCI_Cleanup(); OCI_Cleanup();
} }
void ImportRepairSuggestionToOracle( const std::string & userName, void ImportRepairRecommandationToOracle( const std::string & userName,
const std::string & password, const std::string & password,
const std::string & tnsName, const std::string & tnsName,
const std::vector<RepairSuggestionRecord> & recordVector ) const std::vector<RepairRecommandationRecord> & recordVector )
{ {
OCI_Connection * pConn = nullptr; OCI_Connection * pConn = nullptr;
OCI_Statement * pStmt = nullptr; OCI_Statement * pStmt = nullptr;
@ -563,164 +563,164 @@ void ImportNewRepairMonitorToOracle( const std::string &
int returnCode = -1; int returnCode = -1;
QString sql = QString::fromUtf8( QString sql = QString::fromUtf8(
"BEGIN " \ "BEGIN "
" car_dealer.data_import_util_pkg.导入新送返修监控报表(:1, " \ " car_dealer.data_import_util_pkg.导入新送返修监控报表(:1, "
" :2, " \ " :2, "
" :3, " \ " :3, "
" :4, " \ " :4, "
" :5, " \ " :5, "
" :6, " \ " :6, "
" :7, " \ " :7, "
" :8, " \ " :8, "
" :9, " \ " :9, "
" :10, " \ " :10, "
" :11, " \ " :11, "
" :12, " \ " :12, "
" :13, " \ " :13, "
" :14, " \ " :14, "
" :15, " \ " :15, "
" :16, " \ " :16, "
" :17, " \ " :17, "
" :18, " \ " :18, "
" :19, " \ " :19, "
" :20, " \ " :20, "
" :21, " \ " :21, "
" :22, " \ " :22, "
" :23, " \ " :23, "
" :24, " \ " :24, "
" :25, " \ " :25, "
" :26, " \ " :26, "
" :27, " \ " :27, "
" :28, " \ " :28, "
" :29, " \ " :29, "
" :30, " \ " :30, "
" :31, " \ " :31, "
" :32, " \ " :32, "
" :33, " \ " :33, "
" :34, " \ " :34, "
" :35, " \ " :35, "
" :36, " \ " :36, "
" :37, " \ " :37, "
" :38, " \ " :38, "
" :39, " \ " :39, "
" :40, " \ " :40, "
" :41, " \ " :41, "
" :42, " \ " :42, "
" :43, " \ " :43, "
" :44, " \ " :44, "
" :45, " \ " :45, "
" :46, " \ " :46, "
" :47, " \ " :47, "
" :48, " \ " :48, "
" :49, " \ " :49, "
" :50, " \ " :50, "
" :51, " \ " :51, "
" :52, " \ " :52, "
" :53, " \ " :53, "
" :54, " \ " :54, "
" :55, " \ " :55, "
" :56, " \ " :56, "
" :57, " \ " :57, "
" :58, " \ " :58, "
" :59, " \ " :59, "
" :60, " \ " :60, "
" :61, " \ " :61, "
" :62, " \ " :62, "
" :63, " \ " :63, "
" :64, " \ " :64, "
" :65, " \ " :65, "
" :66, " \ " :66, "
" :67, " \ " :67, "
" :68, " \ " :68, "
" :69, " \ " :69, "
" :70, " \ " :70, "
" :71, " \ " :71, "
" :72, " \ " :72, "
" :73, " \ " :73, "
" :74, " \ " :74, "
" :75, " \ " :75, "
" :76, " \ " :76, "
" :77, " \ " :77, "
" :78, " \ " :78, "
" :79, " \ " :79, "
" :80, " \ " :80, "
" :81, " \ " :81, "
" :82, " \ " :82, "
" :83, " \ " :83, "
" :84, " \ " :84, "
" :85, " \ " :85, "
" :86, " \ " :86, "
" :87, " \ " :87, "
" :88, " \ " :88, "
" :89, " \ " :89, "
" :90, " \ " :90, "
" :91, " \ " :91, "
" :92, " \ " :92, "
" :93, " \ " :93, "
" :94, " \ " :94, "
" :95, " \ " :95, "
" :96, " \ " :96, "
" :97, " \ " :97, "
" :98, " \ " :98, "
" :99, " \ " :99, "
" :100, " \ " :100, "
" :101, " \ " :101, "
" :102, " \ " :102, "
" :103, " \ " :103, "
" :104, " \ " :104, "
" :105, " \ " :105, "
" :106, " \ " :106, "
" :107, " \ " :107, "
" :108, " \ " :108, "
" :109, " \ " :109, "
" :110, " \ " :110, "
" :111, " \ " :111, "
" :112, " \ " :112, "
" :113, " \ " :113, "
" :114, " \ " :114, "
" :115, " \ " :115, "
" :116, " \ " :116, "
" :117, " \ " :117, "
" :118, " \ " :118, "
" :119, " \ " :119, "
" :120, " \ " :120, "
" :121, " \ " :121, "
" :122, " \ " :122, "
" :123, " \ " :123, "
" :124, " \ " :124, "
" :125, " \ " :125, "
" :126, " \ " :126, "
" :127, " \ " :127, "
" :128, " \ " :128, "
" :129, " \ " :129, "
" :130, " \ " :130, "
" :131, " \ " :131, "
" :132, " \ " :132, "
" :133, " \ " :133, "
" :134, " \ " :134, "
" :135, " \ " :135, "
" :136, " \ " :136, "
" :137, " \ " :137, "
" :138, " \ " :138, "
" :139, " \ " :139, "
" :140, " \ " :140, "
" :141, " \ " :141, "
" :142, " \ " :142, "
" :143, " \ " :143, "
" :144, " \ " :144, "
" :145, " \ " :145, "
" :146, " \ " :146, "
" :147, " \ " :147, "
" :148, " \ " :148, "
" :149, " \ " :149, "
" :150, " \ " :150, "
" :151, " \ " :151, "
" :152, " \ " :152, "
" :153, " \ " :153, "
" :154, " \ " :154, "
" :155, " \ " :155, "
" :156, " \ " :156, "
" :157 ); " \ " :157 ); "
"END;" ); "END;" );
//初始化 //初始化
@ -929,163 +929,163 @@ void ImportNewRepairMonitorToOracle( const std::string &
continue; continue;
} }
OCI_BindString(pStatement, (const otext*)(":1"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":1"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":2"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":2"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":3"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":3"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":4"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":4"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":5"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":5"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":6"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":6"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":7"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":7"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":8"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":8"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":9"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":9"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":10"), (otext*)(vin码.c_str()), vin码.size()); OCI_BindString( pStatement, (const otext*)(":10"), (otext*)(vin码.c_str()), vin码.size() );
OCI_BindString(pStatement, (const otext*)(":11"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":11"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":12"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":12"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":13"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":13"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":14"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":14"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":15"), (otext*)(使.c_str()), 使.size()); OCI_BindString( pStatement, (const otext*)(":15"), (otext*)(使.c_str()), 使.size() );
OCI_BindString(pStatement, (const otext*)(":16"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":16"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":17"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":17"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":18"), (otext*)(9.c_str()), 9.size()); OCI_BindString( pStatement, (const otext*)(":18"), (otext*)(9.c_str()), 9.size() );
OCI_BindString(pStatement, (const otext*)(":19"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":19"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":20"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":20"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":21"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":21"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":22"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":22"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":23"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":23"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":24"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":24"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":25"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":25"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":26"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":26"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":27"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":27"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":28"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":28"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":29"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":29"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":30"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":30"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":31"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":31"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":32"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":32"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":33"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":33"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":34"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":34"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":35"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":35"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":36"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":36"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":37"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":37"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":38"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":38"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":39"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":39"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":40"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":40"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":41"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":41"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":42"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":42"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":43"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":43"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":44"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":44"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":45"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":45"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":46"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":46"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":47"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":47"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":48"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":48"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":49"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":49"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":50"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":50"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":51"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":51"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":52"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":52"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":53"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":53"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":54"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":54"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":55"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":55"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":56"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":56"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":57"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":57"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":58"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":58"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":59"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":59"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":60"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":60"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":61"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":61"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":62"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":62"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":63"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":63"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":64"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":64"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":65"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":65"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":66"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":66"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":67"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":67"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":68"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":68"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":69"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":69"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":70"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":70"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":71"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":71"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":72"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":72"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":73"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":73"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":74"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":74"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":75"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":75"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":76"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":76"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":77"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":77"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":78"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":78"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":79"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":79"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":80"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":80"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":81"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":81"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":82"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":82"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":83"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":83"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":84"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":84"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":85"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":85"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":86"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":86"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":87"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":87"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":88"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":88"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":89"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":89"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":90"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":90"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":91"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":91"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":92"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":92"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":93"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":93"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":94"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":94"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":95"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":95"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":96"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":96"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":97"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":97"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":98"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":98"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":99"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":99"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":100"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":100"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":101"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":101"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":102"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":102"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":103"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":103"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":104"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":104"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":105"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":105"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":106"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":106"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":107"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":107"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":108"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":108"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":109"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":109"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":110"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":110"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":111"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":111"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":112"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":112"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":113"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":113"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":114"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":114"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":115"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":115"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":116"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":116"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":117"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":117"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":118"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":118"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":119"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":119"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":120"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":120"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":121"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":121"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":122"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":122"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":123"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":123"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":124"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":124"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":125"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":125"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":126"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":126"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":127"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":127"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":128"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":128"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":129"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":129"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":130"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":130"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":131"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":131"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":132"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":132"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":133"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":133"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":134"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":134"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":135"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":135"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":136"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":136"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":137"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":137"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":138"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":138"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":139"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":139"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":140"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":140"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":141"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":141"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":142"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":142"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":143"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":143"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":144"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":144"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":145"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":145"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":146"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":146"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":147"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":147"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":148"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":148"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":149"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":149"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":150"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":150"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":151"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":151"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":152"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":152"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":153"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":153"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":154"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":154"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":155"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":155"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":156"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":156"), (otext*)(.c_str()), .size() );
OCI_BindString(pStatement, (const otext*)(":157"), (otext*)(.c_str()), .size()); OCI_BindString( pStatement, (const otext*)(":157"), (otext*)(.c_str()), .size() );
OCI_Execute( pStatement ); OCI_Execute( pStatement );

View File

@ -5,7 +5,7 @@
#include "../../Datastructure/CarDealerAchievement/CarDealerAchievement.h" #include "../../Datastructure/CarDealerAchievement/CarDealerAchievement.h"
#include "../../Datastructure/CarDealerScheme/CarDealerScheme.h" #include "../../Datastructure/CarDealerScheme/CarDealerScheme.h"
#include "../../Datastructure/RepairOrder/RepairOrder.h" #include "../../Datastructure/RepairOrder/RepairOrder.h"
#include "../../Datastructure/RepairSuggestion/RepairSuggestionRecord.h" #include "../../Datastructure/RepairSuggestion/RepairRecommandationRecord.h"
#include "../Excel/LoadFromExcel.h" #include "../Excel/LoadFromExcel.h"
@ -65,10 +65,11 @@ void ImportRepairOrderToOracle( const std::string & userName,
* \param tnsName * \param tnsName
* \param recordVector * \param recordVector
************************************************/ ************************************************/
void ImportRepairSuggestionToOracle( const std::string & userName, void ImportRepairRecommandationToOracle( const std::string & userName,
const std::string & password, const std::string & password,
const std::string & tnsName, const std::string & tnsName,
const std::vector<RepairSuggestionRecord> & recordVector ); const std::vector<RepairRecommandationRecord> & recordVector );
void ImportNewRepairMonitorToOracle( const std::string & userName, void ImportNewRepairMonitorToOracle( const std::string & userName,
const std::string & password, const std::string & password,

View File

@ -1,5 +1,10 @@
#include <QtWidgets/QtWidgets> #include <stdexcept>
#include <QtWidgets/QtWidgets>
#include "QRepairRecommendationWidget.h" #include "QRepairRecommendationWidget.h"
#include "../../Data/DataManipulation/Excel/LoadFromExcel.h"
#include "../../Data/DataManipulation/oracle/ImportToOracle.h"
using namespace std;
QRepairRecommendationWidget::QRepairRecommendationWidget( QWidget * parent ) QRepairRecommendationWidget::QRepairRecommendationWidget( QWidget * parent )
: QWidget( parent ) : QWidget( parent )
@ -16,7 +21,6 @@ void QRepairRecommendationWidget::onImport()
//打开文件 //打开文件
QString dir = QString::fromLocal8Bit( "." ); QString dir = QString::fromLocal8Bit( "." );
QString filter = QString::fromLocal8Bit( "Excel文件*.xlsx)" ); QString filter = QString::fromLocal8Bit( "Excel文件*.xlsx)" );
QStringList fileList = QFileDialog::getOpenFileNames( this, QStringList fileList = QFileDialog::getOpenFileNames( this,
QString::fromLocal8Bit( "请选择要导入的数据文件" ), QString::fromLocal8Bit( "请选择要导入的数据文件" ),
dir, dir,
@ -26,11 +30,50 @@ void QRepairRecommendationWidget::onImport()
recommandationVector.clear(); recommandationVector.clear();
//遍历文件列表,导入每一个文件 //遍历文件列表,导入每一个文件
try
{
for ( auto iterFile = fileList.begin(); for ( auto iterFile = fileList.begin();
iterFile != fileList.end(); iterFile != fileList.end();
++iterFile ) ++iterFile )
{ {
LoadRepairRecommandationFromXlsx( (*iterFile).toStdWString(),
0,
1,
recommandationVector );
}
}
catch ( runtime_error & error )
{
//清理数据,退出函数
recommandationVector.clear();
QMessageBox::critical( nullptr,
QString::fromLocal8Bit( "读取Excel表格出错" ),
QString::fromLocal8Bit( error.what() ) );
return;
}
//写入数据
try
{
//以后要修改
string userName = "car_dealer";
string password = "cpic123456";
string tnsName = "xmcx1";
ImportRepairRecommandationToOracle(userName, password, tnsName, recommandationVector);
}
catch ( runtime_error & error )
{
//清理数据,退出函数
recommandationVector.clear();
QMessageBox::critical( nullptr,
QString::fromLocal8Bit( "保存数据出错!" ),
QString::fromLocal8Bit( error.what() ) );
return;
} }
} }

View File

@ -49,7 +49,7 @@ void excelTest()
//测试送返修推荐 //测试送返修推荐
//LoadRepairSuggestionFromXlsx( filePathRepairSuggestion, 0, 1, suggestionRecordsVector ); //LoadRepairSuggestionFromXlsx( filePathRepairSuggestion, 0, 1, suggestionRecordsVector );
//ImportRepairSuggestionToOracle( userName, password, tnsName, suggestionRecordsVector); //ImportRepairRecommandationToOracle( userName, password, tnsName, suggestionRecordsVector);
//测试新送返修监控报表 //测试新送返修监控报表
//LoadNewRepairMonitorReportFromXlsx(filePathNewRepairMonitor, 0, 1, repairMonitorVector); //LoadNewRepairMonitorReportFromXlsx(filePathNewRepairMonitor, 0, 1, repairMonitorVector);