diff --git a/代码/cpp/car_dealer_util/proj/vs2019/car_dealer_util/car_dealer_util.vcxproj b/代码/cpp/car_dealer_util/proj/vs2019/car_dealer_util/car_dealer_util.vcxproj index 6ce60da..4579faa 100644 --- a/代码/cpp/car_dealer_util/proj/vs2019/car_dealer_util/car_dealer_util.vcxproj +++ b/代码/cpp/car_dealer_util/proj/vs2019/car_dealer_util/car_dealer_util.vcxproj @@ -25,8 +25,8 @@ + - @@ -63,8 +63,8 @@ + - diff --git a/代码/cpp/car_dealer_util/proj/vs2019/car_dealer_util/car_dealer_util.vcxproj.filters b/代码/cpp/car_dealer_util/proj/vs2019/car_dealer_util/car_dealer_util.vcxproj.filters index f3c8762..97b2a14 100644 --- a/代码/cpp/car_dealer_util/proj/vs2019/car_dealer_util/car_dealer_util.vcxproj.filters +++ b/代码/cpp/car_dealer_util/proj/vs2019/car_dealer_util/car_dealer_util.vcxproj.filters @@ -169,7 +169,7 @@ 窗口\内容窗口\数据管理\车商业绩表 - + 数据\数据结构\送返修推荐表 @@ -271,7 +271,7 @@ 数据\数据管理\导入导出\直接导入导出 - + 数据\数据结构\送返修推荐表 diff --git a/代码/cpp/car_dealer_util/source/Data/DataManipulation/Excel/LoadFromExcel.cpp b/代码/cpp/car_dealer_util/source/Data/DataManipulation/Excel/LoadFromExcel.cpp index 8cc34ed..962285b 100644 --- a/代码/cpp/car_dealer_util/source/Data/DataManipulation/Excel/LoadFromExcel.cpp +++ b/代码/cpp/car_dealer_util/source/Data/DataManipulation/Excel/LoadFromExcel.cpp @@ -384,6 +384,61 @@ void LoadRepairOrderFromXlsx( const std::wstring & filePath, pBook->release(); } +void LoadRepairSuggestionFromXlsx( const std::wstring & filePath, + unsigned sheetIndex, + unsigned startRowIndex, + std::vector & recordVector ) +{ + Book * pBook = xlCreateBookW(); + Sheet * pSheet = nullptr; + + if ( pBook == nullptr ) + { + throw runtime_error( "libxl库加载失败!" ); + } + + setKey( pBook ); + pSheet = pBook->getSheet( sheetIndex ); + + if ( pSheet == nullptr ) + { + string errorMessage = "读取sheet失败!"; + errorMessage.append( pBook->errorMessage() ); + + pBook->release(); + + throw runtime_error( errorMessage ); + } + + int lastRowIndex = pSheet->lastRow(); + int firstRowIndex = pSheet->firstRow(); + int rowIndex = firstRowIndex + startRowIndex; + + while ( rowIndex <= lastRowIndex ) + { + //起始列索引 + int colunmIndex = pSheet->firstCol(); + + 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 damageDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + wstring plateNumber = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + wstring brandName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + wstring messageType = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + wstring messageSendingDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + wstring dataSource = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true ); + + + + rowIndex++; + } + + pBook->release(); +} + void LoadRepairOrderFromXls( const std::wstring & filePath, unsigned sheetIndex, unsigned startRowIndex, diff --git a/代码/cpp/car_dealer_util/source/Data/DataManipulation/Excel/LoadFromExcel.h b/代码/cpp/car_dealer_util/source/Data/DataManipulation/Excel/LoadFromExcel.h index 3cbd76c..cf2c887 100644 --- a/代码/cpp/car_dealer_util/source/Data/DataManipulation/Excel/LoadFromExcel.h +++ b/代码/cpp/car_dealer_util/source/Data/DataManipulation/Excel/LoadFromExcel.h @@ -5,6 +5,7 @@ #include "../../Datastructure/CarDealerScheme/CarDealerScheme.h" #include "../../Datastructure/CarDealerAchievement/CarDealerAchievement.h" #include "../../Datastructure/RepairOrder/RepairOrder.h" +#include "../../Datastructure/RepairSuggestion/RepairSuggestionRecord.h" /************************************************ * \brief @@ -46,3 +47,8 @@ void LoadRepairOrderFromXlsx( const std::wstring & filePath, // unsigned sheetIndex, // unsigned startRowIndex, // std::vector & orderVector ); + +void LoadRepairSuggestionFromXlsx( const std::wstring & filePath, + unsigned int sheetIndex, + unsigned int startRowIndex, + std::vector & recordVector ); diff --git a/代码/cpp/car_dealer_util/source/Data/Datastructure/RepairSuggestion/RepairSuggestionRecord.cpp b/代码/cpp/car_dealer_util/source/Data/Datastructure/RepairSuggestion/RepairSuggestionRecord.cpp new file mode 100644 index 0000000..e69de29 diff --git a/代码/cpp/car_dealer_util/source/Data/Datastructure/RepairSuggestion/RepairSuggestionRecord.h b/代码/cpp/car_dealer_util/source/Data/Datastructure/RepairSuggestion/RepairSuggestionRecord.h new file mode 100644 index 0000000..17ffe20 --- /dev/null +++ b/代码/cpp/car_dealer_util/source/Data/Datastructure/RepairSuggestion/RepairSuggestionRecord.h @@ -0,0 +1,115 @@ +#pragma once + +#include + + +/************************************************ +* \brief 送返修推荐表记录 +************************************************/ +class RepairSuggestionRecord +{ +public: + RepairSuggestionRecord( std::wstring orderNo, + std::wstring orderType, + std::wstring notifyNo, + std::wstring suggestedCarDealerCode, + std::wstring suggestedCarDealerName, + std::wstring damageDate, + std::wstring plateNumber, + std::wstring brandName, + std::wstring messageType, + std::wstring messageSendingDate, + std::wstring dataSource ) + : orderNo_( std::move( orderNo ) ), + orderType_( std::move( orderType ) ), + notifyNo_( std::move( notifyNo ) ), + suggestedCarDealerCode_( std::move( suggestedCarDealerCode ) ), + suggestedCarDealerName_( std::move( suggestedCarDealerName ) ), + damageDate_( std::move( damageDate ) ), + plateNumber_( std::move( plateNumber ) ), + brandName_( std::move( brandName ) ), + messageType_( std::move( messageType ) ), + messageSendingDate_( std::move( messageSendingDate ) ), + dataSource_( std::move( dataSource ) ) + { + } + + RepairSuggestionRecord( const RepairSuggestionRecord & other ) + : orderNo_( other.orderNo_ ), + orderType_( other.orderType_ ), + notifyNo_( other.notifyNo_ ), + suggestedCarDealerCode_( other.suggestedCarDealerCode_ ), + suggestedCarDealerName_( other.suggestedCarDealerName_ ), + damageDate_( other.damageDate_ ), + plateNumber_( other.plateNumber_ ), + brandName_( other.brandName_ ), + messageType_( other.messageType_ ), + messageSendingDate_( other.messageSendingDate_ ), + dataSource_( other.dataSource_ ) + { + } + + RepairSuggestionRecord( RepairSuggestionRecord && other ) + : orderNo_( std::move( other.orderNo_ ) ), + orderType_( std::move( other.orderType_ ) ), + notifyNo_( std::move( other.notifyNo_ ) ), + suggestedCarDealerCode_( std::move( other.suggestedCarDealerCode_ ) ), + suggestedCarDealerName_( std::move( other.suggestedCarDealerName_ ) ), + damageDate_( std::move( other.damageDate_ ) ), + plateNumber_( std::move( other.plateNumber_ ) ), + brandName_( std::move( other.brandName_ ) ), + messageType_( std::move( other.messageType_ ) ), + messageSendingDate_( std::move( other.messageSendingDate_ ) ), + dataSource_( std::move( other.dataSource_ ) ) + { + } + + RepairSuggestionRecord & operator=( const RepairSuggestionRecord & other ) + { + if ( this == &other ) + return *this; + orderNo_ = other.orderNo_; + orderType_ = other.orderType_; + notifyNo_ = other.notifyNo_; + suggestedCarDealerCode_ = other.suggestedCarDealerCode_; + suggestedCarDealerName_ = other.suggestedCarDealerName_; + damageDate_ = other.damageDate_; + plateNumber_ = other.plateNumber_; + brandName_ = other.brandName_; + messageType_ = other.messageType_; + messageSendingDate_ = other.messageSendingDate_; + dataSource_ = other.dataSource_; + return *this; + } + + RepairSuggestionRecord & operator=( RepairSuggestionRecord && other ) + { + if ( this == &other ) + return *this; + orderNo_ = std::move( other.orderNo_ ); + orderType_ = std::move( other.orderType_ ); + notifyNo_ = std::move( other.notifyNo_ ); + suggestedCarDealerCode_ = std::move( other.suggestedCarDealerCode_ ); + suggestedCarDealerName_ = std::move( other.suggestedCarDealerName_ ); + damageDate_ = std::move( other.damageDate_ ); + plateNumber_ = std::move( other.plateNumber_ ); + brandName_ = std::move( other.brandName_ ); + messageType_ = std::move( other.messageType_ ); + messageSendingDate_ = std::move( other.messageSendingDate_ ); + dataSource_ = std::move( other.dataSource_ ); + return *this; + } + +private: + std::wstring orderNo_; + std::wstring orderType_; + std::wstring notifyNo_; + std::wstring suggestedCarDealerCode_; + std::wstring suggestedCarDealerName_; + std::wstring damageDate_; + std::wstring plateNumber_; + std::wstring brandName_; + std::wstring messageType_; + std::wstring messageSendingDate_; + std::wstring dataSource_; +}; diff --git a/代码/cpp/car_dealer_util/source/Data/Datastructure/RepairSuggestion/送返修推荐表.txt b/代码/cpp/car_dealer_util/source/Data/Datastructure/RepairSuggestion/送返修推荐表.txt new file mode 100644 index 0000000..e69de29 diff --git a/代码/cpp/car_dealer_util/source/Data/Datastructure/送返修推荐表/送返修推荐表.cpp b/代码/cpp/car_dealer_util/source/Data/Datastructure/送返修推荐表/送返修推荐表.cpp deleted file mode 100644 index c153b48..0000000 --- a/代码/cpp/car_dealer_util/source/Data/Datastructure/送返修推荐表/送返修推荐表.cpp +++ /dev/null @@ -1,2 +0,0 @@ - -#include "送返修推荐表.h" diff --git a/代码/cpp/car_dealer_util/source/Data/Datastructure/送返修推荐表/送返修推荐表.h b/代码/cpp/car_dealer_util/source/Data/Datastructure/送返修推荐表/送返修推荐表.h deleted file mode 100644 index 55aee80..0000000 --- a/代码/cpp/car_dealer_util/source/Data/Datastructure/送返修推荐表/送返修推荐表.h +++ /dev/null @@ -1,227 +0,0 @@ - -#pragma once - -#include -#include - -class repair_suggestion_record -{ -public: - - repair_suggestion_record(const std::wstring& 工单号, - const std::wstring& 工单类型, - const std::wstring& 报案号, - const std::wstring& 推荐车商代码, - const std::wstring& 推荐车商名称, - const std::wstring& 出险日期, - const std::wstring& 车牌号, - const std::wstring& 品牌名称, - const std::wstring& 短信类型, - const std::wstring& 发送时间, - const std::wstring& 数据来源) - : 工单号_(工单号), - 工单类型_(工单类型), - 报案号_(报案号), - 推荐车商代码_(推荐车商代码), - 推荐车商名称_(推荐车商名称), - 出险日期_(出险日期), - 车牌号_(车牌号), - 品牌名称_(品牌名称), - 短信类型_(短信类型), - 发送时间_(发送时间), - 数据来源_(数据来源) - { - } - - - - repair_suggestion_record(const repair_suggestion_record& other) - : 工单号_(other.工单号_), - 工单类型_(other.工单类型_), - 报案号_(other.报案号_), - 推荐车商代码_(other.推荐车商代码_), - 推荐车商名称_(other.推荐车商名称_), - 出险日期_(other.出险日期_), - 车牌号_(other.车牌号_), - 品牌名称_(other.品牌名称_), - 短信类型_(other.短信类型_), - 发送时间_(other.发送时间_), - 数据来源_(other.数据来源_) - { - } - - repair_suggestion_record(repair_suggestion_record&& other) - : 工单号_(std::move(other.工单号_)), - 工单类型_(std::move(other.工单类型_)), - 报案号_(std::move(other.报案号_)), - 推荐车商代码_(std::move(other.推荐车商代码_)), - 推荐车商名称_(std::move(other.推荐车商名称_)), - 出险日期_(std::move(other.出险日期_)), - 车牌号_(std::move(other.车牌号_)), - 品牌名称_(std::move(other.品牌名称_)), - 短信类型_(std::move(other.短信类型_)), - 发送时间_(std::move(other.发送时间_)), - 数据来源_(std::move(other.数据来源_)) - { - } - - repair_suggestion_record& operator=(const repair_suggestion_record& other) - { - if (this == &other) - return *this; - 工单号_ = other.工单号_; - 工单类型_ = other.工单类型_; - 报案号_ = other.报案号_; - 推荐车商代码_ = other.推荐车商代码_; - 推荐车商名称_ = other.推荐车商名称_; - 出险日期_ = other.出险日期_; - 车牌号_ = other.车牌号_; - 品牌名称_ = other.品牌名称_; - 短信类型_ = other.短信类型_; - 发送时间_ = other.发送时间_; - 数据来源_ = other.数据来源_; - return *this; - } - - repair_suggestion_record& operator=(repair_suggestion_record&& other) - { - if (this == &other) - return *this; - 工单号_ = std::move(other.工单号_); - 工单类型_ = std::move(other.工单类型_); - 报案号_ = std::move(other.报案号_); - 推荐车商代码_ = std::move(other.推荐车商代码_); - 推荐车商名称_ = std::move(other.推荐车商名称_); - 出险日期_ = std::move(other.出险日期_); - 车牌号_ = std::move(other.车牌号_); - 品牌名称_ = std::move(other.品牌名称_); - 短信类型_ = std::move(other.短信类型_); - 发送时间_ = std::move(other.发送时间_); - 数据来源_ = std::move(other.数据来源_); - return *this; - } - - - std::wstring get工单号() const - { - return 工单号_; - } - - void set工单号(const std::wstring& 工单号) - { - 工单号_ = 工单号; - } - - std::wstring get工单类型() const - { - return 工单类型_; - } - - void set工单类型(const std::wstring& 工单类型) - { - 工单类型_ = 工单类型; - } - - std::wstring get报案号() const - { - return 报案号_; - } - - void set报案号(const std::wstring& 报案号) - { - 报案号_ = 报案号; - } - - std::wstring get推荐车商代码() const - { - return 推荐车商代码_; - } - - void set推荐车商代码(const std::wstring& 推荐车商代码) - { - 推荐车商代码_ = 推荐车商代码; - } - - std::wstring get推荐车商名称() const - { - return 推荐车商名称_; - } - - void set推荐车商名称(const std::wstring& 推荐车商名称) - { - 推荐车商名称_ = 推荐车商名称; - } - - std::wstring get出险日期() const - { - return 出险日期_; - } - - void set出险日期(const std::wstring& 出险日期) - { - 出险日期_ = 出险日期; - } - - std::wstring get车牌号() const - { - return 车牌号_; - } - - void set车牌号(const std::wstring& 车牌号) - { - 车牌号_ = 车牌号; - } - - std::wstring get品牌名称() const - { - return 品牌名称_; - } - - void set品牌名称(const std::wstring& 品牌名称) - { - 品牌名称_ = 品牌名称; - } - - std::wstring get短信类型() const - { - return 短信类型_; - } - - void set短信类型(const std::wstring& 短信类型) - { - 短信类型_ = 短信类型; - } - - std::wstring get发送时间() const - { - return 发送时间_; - } - - void set发送时间(const std::wstring& 发送时间) - { - 发送时间_ = 发送时间; - } - - std::wstring get数据来源() const - { - return 数据来源_; - } - - void set数据来源(const std::wstring& 数据来源) - { - 数据来源_ = 数据来源; - } - -private: - std::wstring 工单号_; - std::wstring 工单类型_; - std::wstring 报案号_; - std::wstring 推荐车商代码_; - std::wstring 推荐车商名称_; - std::wstring 出险日期_; - std::wstring 车牌号_; - std::wstring 品牌名称_; - std::wstring 短信类型_; - std::wstring 发送时间_; - std::wstring 数据来源_; -}; diff --git a/数据/卢霖城 - 推荐表.xlsx b/数据/卢霖城 - 推荐表.xlsx index 811f459..39ed86b 100644 Binary files a/数据/卢霖城 - 推荐表.xlsx and b/数据/卢霖城 - 推荐表.xlsx differ