提交信息!

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() )
{
//没查到这个车商,清除掉已经读取的数据
schemeVector.clear();
QString rowIndexString = QString::number(rowIndex, 'g', -1);
QString errorMessage = QString("") + rowIndexString + QString("行车商代码错误!");
QString rowIndexString = QString::number( rowIndex, 'g', -1 );
QString errorMessage = QString( "" ) + rowIndexString + QString( "行车商代码错误!" );
throw runtime_error(errorMessage.toStdString());
throw runtime_error( errorMessage.toStdString() );
}
CarDealerScheme carDealerScheme( theYear,
@ -149,7 +149,7 @@ void LoadCarDealerAchievementFromXlsx( const std::wstring & fileP
int firstColumnIndex = pSheet->firstCol();
int rowIndex = firstRowIndex + startRowIndex;
unordered_map<wstring, CarDealer>* pCarDealerMap = GetCarDealerMap();
unordered_map<wstring, CarDealer> * pCarDealerMap = GetCarDealerMap();
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();
QString rowIndexString = QString::number(rowIndex, 'g', -1);
QString errorMessage = QString("") + rowIndexString + QString("行车商代码错误!");
QString rowIndexString = QString::number( rowIndex, 'g', -1 );
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 rowIndex = firstRowIndex + startRowIndex;
auto* pCarDealerMap = GetCarDealerMap();
auto * pCarDealerMap = GetCarDealerMap();
while ( rowIndex <= lastRowIndex )
{
@ -419,10 +421,10 @@ void LoadRepairOrderFromXlsx( const std::wstring & filePath,
pBook->release();
}
void LoadRepairRecommandationFromXlsx( const std::wstring & filePath,
unsigned sheetIndex,
unsigned startRowIndex,
std::vector<RepairRecommandationRecord> & recordVector )
void LoadRepairRecommandationFromXlsx( const std::wstring & filePath,
unsigned sheetIndex,
unsigned startRowIndex,
std::vector<RepairRecommandationRecord> & recordVector )
{
Book * pBook = xlCreateXMLBookW();
Sheet * pSheet = nullptr;
@ -466,8 +468,8 @@ void LoadRepairRecommandationFromXlsx( const std::wstring & fil
wstring orderNo = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
wstring orderType = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
wstring notifyNo = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
wstring suggestedCarDealerCode = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
wstring suggestedCarDealerName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
wstring RecommandCarDealerCode = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
wstring RecommandCarDealerName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
wstring damageDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
wstring plateNumber = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
wstring brandName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
@ -476,16 +478,16 @@ void LoadRepairRecommandationFromXlsx( const std::wstring & fil
wstring dataSource = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
RepairRecommandationRecord record( orderNo,
orderType,
notifyNo,
suggestedCarDealerCode,
suggestedCarDealerName,
damageDate,
plateNumber,
brandName,
messageType,
messageSendingDate,
dataSource );
orderType,
notifyNo,
RecommandCarDealerCode,
RecommandCarDealerName,
damageDate,
plateNumber,
brandName,
messageType,
messageSendingDate,
dataSource );
recordVector.push_back( record );

View File

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

View File

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

View File

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

View File

@ -1,5 +1,10 @@
#include <QtWidgets/QtWidgets>
#include <stdexcept>
#include <QtWidgets/QtWidgets>
#include "QRepairRecommendationWidget.h"
#include "../../Data/DataManipulation/Excel/LoadFromExcel.h"
#include "../../Data/DataManipulation/oracle/ImportToOracle.h"
using namespace std;
QRepairRecommendationWidget::QRepairRecommendationWidget( QWidget * parent )
: QWidget( parent )
@ -14,9 +19,8 @@ QRepairRecommendationWidget::~QRepairRecommendationWidget()
void QRepairRecommendationWidget::onImport()
{
//打开文件
QString dir = QString::fromLocal8Bit( "." );
QString filter = QString::fromLocal8Bit( "Excel文件*.xlsx)" );
QString dir = QString::fromLocal8Bit( "." );
QString filter = QString::fromLocal8Bit( "Excel文件*.xlsx)" );
QStringList fileList = QFileDialog::getOpenFileNames( this,
QString::fromLocal8Bit( "请选择要导入的数据文件" ),
dir,
@ -26,11 +30,50 @@ void QRepairRecommendationWidget::onImport()
recommandationVector.clear();
//遍历文件列表,导入每一个文件
for ( auto iterFile = fileList.begin();
iterFile != fileList.end();
++iterFile )
try
{
for ( auto iterFile = fileList.begin();
iterFile != fileList.end();
++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 );
//ImportRepairSuggestionToOracle( userName, password, tnsName, suggestionRecordsVector);
//ImportRepairRecommandationToOracle( userName, password, tnsName, suggestionRecordsVector);
//测试新送返修监控报表
//LoadNewRepairMonitorReportFromXlsx(filePathNewRepairMonitor, 0, 1, repairMonitorVector);