回家吃饭

This commit is contained in:
Kane Wang 2020-06-28 11:36:19 +08:00
parent 21c3f5fe75
commit c2251573db
10 changed files with 180 additions and 233 deletions

View File

@ -25,8 +25,8 @@
<ClCompile Include="..\..\..\source\Data\Datastructure\CarDealerAchievement\CarDealerAchievement.cpp" />
<ClCompile Include="..\..\..\source\Data\Datastructure\CarDealerScheme\CarDealerScheme.cpp" />
<ClCompile Include="..\..\..\source\data\Datastructure\RepairOrder\RepairOrder.cpp" />
<ClCompile Include="..\..\..\source\Data\Datastructure\RepairSuggestion\RepairSuggestionRecord.cpp" />
<ClCompile Include="..\..\..\source\data\Datastructure\UserInfo\UserInfo.cpp" />
<ClCompile Include="..\..\..\source\Data\Datastructure\送返修推荐表\送返修推荐表.cpp" />
<ClCompile Include="..\..\..\source\data\excel\excel.cpp" />
<ClCompile Include="..\..\..\source\data\query\query_user.cpp" />
<ClCompile Include="..\..\..\source\db\ocilib\db_oper.cpp" />
@ -63,8 +63,8 @@
<ClInclude Include="..\..\..\source\Data\Datastructure\CarDealerAchievement\CarDealerAchievement.h" />
<ClInclude Include="..\..\..\source\Data\Datastructure\CarDealerScheme\CarDealerScheme.h" />
<ClInclude Include="..\..\..\source\data\Datastructure\RepairOrder\RepairOrder.h" />
<ClInclude Include="..\..\..\source\Data\Datastructure\RepairSuggestion\RepairSuggestionRecord.h" />
<ClInclude Include="..\..\..\source\data\Datastructure\UserInfo\UserInfo.h" />
<ClInclude Include="..\..\..\source\Data\Datastructure\送返修推荐表\送返修推荐表.h" />
<ClInclude Include="..\..\..\source\data\excel\excel.h" />
<ClInclude Include="..\..\..\source\data\query\query_user.h" />
<ClInclude Include="..\..\..\source\db\ocilib\db_oper.h" />

View File

@ -169,7 +169,7 @@
<ClCompile Include="..\..\..\source\Widgets\ContentWidget\QCarDealerAchievementWidget\QCarDealerAchievementWidget.cpp">
<Filter>窗口\内容窗口\数据管理\车商业绩表</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\Data\Datastructure\送返修推荐表\送返修推荐表.cpp">
<ClCompile Include="..\..\..\source\Data\Datastructure\RepairSuggestion\RepairSuggestionRecord.cpp">
<Filter>数据\数据结构\送返修推荐表</Filter>
</ClCompile>
</ItemGroup>
@ -271,7 +271,7 @@
<ClInclude Include="..\..\..\source\data\DataManipulation\FromExcelToOracle\FromExcelToOracle.h">
<Filter>数据\数据管理\导入导出\直接导入导出</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\Data\Datastructure\送返修推荐表\送返修推荐表.h">
<ClInclude Include="..\..\..\source\Data\Datastructure\RepairSuggestion\RepairSuggestionRecord.h">
<Filter>数据\数据结构\送返修推荐表</Filter>
</ClInclude>
</ItemGroup>

View File

@ -384,6 +384,61 @@ void LoadRepairOrderFromXlsx( const std::wstring & filePath,
pBook->release();
}
void LoadRepairSuggestionFromXlsx( const std::wstring & filePath,
unsigned sheetIndex,
unsigned startRowIndex,
std::vector<RepairSuggestionRecord> & 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,

View File

@ -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<RepairOrder> & orderVector );
void LoadRepairSuggestionFromXlsx( const std::wstring & filePath,
unsigned int sheetIndex,
unsigned int startRowIndex,
std::vector<RepairSuggestionRecord> & recordVector );

View File

@ -0,0 +1,115 @@
#pragma once
#include <string>
/************************************************
* \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_;
};

View File

@ -1,2 +0,0 @@

#include "送返修推荐表.h"

View File

@ -1,227 +0,0 @@

#pragma once
#include <string>
#include <iostream>
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 _;
};

Binary file not shown.