提交信息!
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 rowIndexString = QString::number( rowIndex, 'g', -1 );
|
||||||
QString errorMessage = QString( "第" ) + rowIndexString + QString( "行车商代码错误!" );
|
QString errorMessage = QString( "第" ) + rowIndexString + QString( "行车商代码错误!" );
|
||||||
|
|
||||||
|
pBook->release();
|
||||||
|
|
||||||
throw runtime_error( errorMessage.toStdString() );
|
throw runtime_error( errorMessage.toStdString() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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,
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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;" );
|
||||||
|
|
||||||
//初始化
|
//初始化
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue