提交信息!
This commit is contained in:
parent
773bba3c06
commit
f961688dc1
@ -184,6 +184,8 @@ void LoadCarDealerAchievementFromXlsx( const std::wstring & fileP
|
||||
QString rowIndexString = QString::number( rowIndex, 'g', -1 );
|
||||
QString errorMessage = QString( "第" ) + rowIndexString + QString( "行车商代码错误!" );
|
||||
|
||||
pBook->release();
|
||||
|
||||
throw runtime_error( errorMessage.toStdString() );
|
||||
}
|
||||
|
||||
@ -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 );
|
||||
@ -478,8 +480,8 @@ void LoadRepairRecommandationFromXlsx( const std::wstring & fil
|
||||
RepairRecommandationRecord record( orderNo,
|
||||
orderType,
|
||||
notifyNo,
|
||||
suggestedCarDealerCode,
|
||||
suggestedCarDealerName,
|
||||
RecommandCarDealerCode,
|
||||
RecommandCarDealerName,
|
||||
damageDate,
|
||||
plateNumber,
|
||||
brandName,
|
||||
|
@ -50,7 +50,7 @@ void LoadRepairOrderFromXlsx( const std::wstring & filePath,
|
||||
// std::vector<RepairOrder> & orderVector );
|
||||
|
||||
/************************************************
|
||||
* \brief 读取送返修推荐表数据
|
||||
* \brief 读取卢霖城送返修推荐表数据
|
||||
* \param filePath
|
||||
* \param sheetIndex
|
||||
* \param startRowIndex
|
||||
|
@ -437,10 +437,10 @@ void ImportRepairOrderToOracle( const std::string & userName,
|
||||
OCI_Cleanup();
|
||||
}
|
||||
|
||||
void ImportRepairSuggestionToOracle( const std::string & userName,
|
||||
void ImportRepairRecommandationToOracle( const std::string & userName,
|
||||
const std::string & password,
|
||||
const std::string & tnsName,
|
||||
const std::vector<RepairSuggestionRecord> & recordVector )
|
||||
const std::vector<RepairRecommandationRecord> & recordVector )
|
||||
{
|
||||
OCI_Connection * pConn = nullptr;
|
||||
OCI_Statement * pStmt = nullptr;
|
||||
@ -563,164 +563,164 @@ void ImportNewRepairMonitorToOracle( const std::string &
|
||||
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 ); " \
|
||||
"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;" );
|
||||
|
||||
//初始化
|
||||
|
@ -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,10 +65,11 @@ void ImportRepairOrderToOracle( const std::string & userName,
|
||||
* \param tnsName
|
||||
* \param recordVector
|
||||
************************************************/
|
||||
void ImportRepairSuggestionToOracle( const std::string & userName,
|
||||
void ImportRepairRecommandationToOracle( const std::string & userName,
|
||||
const std::string & password,
|
||||
const std::string & tnsName,
|
||||
const std::vector<RepairSuggestionRecord> & recordVector );
|
||||
const std::vector<RepairRecommandationRecord> & recordVector );
|
||||
|
||||
|
||||
void ImportNewRepairMonitorToOracle( const std::string & userName,
|
||||
const std::string & password,
|
||||
|
@ -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 )
|
||||
@ -16,7 +21,6 @@ void QRepairRecommendationWidget::onImport()
|
||||
//打开文件
|
||||
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();
|
||||
|
||||
//遍历文件列表,导入每一个文件
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user