变更一下代码文目录名,防止qt编译中文路径出错。
@@ -0,0 +1,4 @@
|
||||
|
||||
#include "AppParameters.h"
|
||||
|
||||
UserInfo * pStaffInfo = nullptr;
|
@@ -0,0 +1,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
#include "../Datastructure/UserInfo/UserInfo.h"
|
||||
|
||||
extern UserInfo * pStaffInfo;
|
@@ -0,0 +1,10 @@
|
||||
|
||||
#include <libxl.h>
|
||||
#include "ExportToExcel.h"
|
||||
|
||||
using namespace libxl;
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
|
@@ -0,0 +1,2 @@
|
||||
#pragma once
|
||||
|
@@ -0,0 +1,785 @@
|
||||
#include <libxl.h>
|
||||
#include <stdexcept>
|
||||
#include "LoadFromExcel.h"
|
||||
#include "../../excel/excel.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace libxl;
|
||||
|
||||
|
||||
/************************************************
|
||||
* \brief 从Excel文件读取车商方案表
|
||||
* \param filePath Excel文件路径
|
||||
* \param schemeMap 存放车商方案数据的map
|
||||
************************************************/
|
||||
void LoadCarDealerSchemeFromXlsx( const wstring & filePath,
|
||||
unsigned int sheetIndex,
|
||||
unsigned int startRowIndex,
|
||||
vector<CarDealerScheme> & schemeVector )
|
||||
{
|
||||
Book * pBook = xlCreateXMLBookW();
|
||||
Sheet * pSheet = nullptr;
|
||||
|
||||
if ( pBook == nullptr )
|
||||
{
|
||||
throw runtime_error( "libxl库加载失败!" );
|
||||
}
|
||||
|
||||
setKey( pBook );
|
||||
|
||||
if ( pBook->load( filePath.c_str() ) != true )
|
||||
{
|
||||
string errorMessage = "打开文件失败!";
|
||||
errorMessage.append( pBook->errorMessage() );
|
||||
|
||||
throw runtime_error( errorMessage );
|
||||
}
|
||||
|
||||
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 firstColumnIndex = pSheet->firstCol();
|
||||
int rowIndex = firstRowIndex + startRowIndex;
|
||||
|
||||
while ( rowIndex <= lastRowIndex )
|
||||
{
|
||||
int colunmIndex = firstRowIndex;
|
||||
|
||||
const wstring && theYear = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex, true );
|
||||
const wstring && theMonth = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex + 1, true );
|
||||
const wstring && carDealerCode = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex + 2, true );
|
||||
const wstring && carDealerName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex + 3, true );
|
||||
const wstring && manHourPrice = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex + 4, true );
|
||||
const wstring && partPrice = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex + 5, true );
|
||||
const wstring && claimSupport = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex + 6, true );
|
||||
const wstring && scheme = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex + 7, true );
|
||||
const wstring && isQualified = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex + 8, true );
|
||||
|
||||
//空行跳过
|
||||
if ( carDealerCode.empty() == true )
|
||||
{
|
||||
rowIndex++;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
CarDealerScheme carDealerScheme( theYear,
|
||||
theMonth,
|
||||
carDealerCode,
|
||||
manHourPrice,
|
||||
partPrice,
|
||||
claimSupport,
|
||||
scheme,
|
||||
isQualified );
|
||||
|
||||
schemeVector.push_back( carDealerScheme );
|
||||
|
||||
rowIndex++;
|
||||
}
|
||||
|
||||
pBook->release();
|
||||
}
|
||||
|
||||
void LoadCarDealerAchievementFromXlsx( const std::wstring & filePath,
|
||||
unsigned sheetIndex,
|
||||
unsigned startRowIndex,
|
||||
std::vector<CarDealerAchievement> & achievementVector )
|
||||
{
|
||||
Book * pBook = xlCreateXMLBookW();
|
||||
Sheet * pSheet = nullptr;
|
||||
|
||||
if ( pBook == nullptr )
|
||||
{
|
||||
throw runtime_error( "libxl库加载失败!" );
|
||||
}
|
||||
|
||||
setKey( pBook );
|
||||
|
||||
if ( pBook->load( filePath.c_str() ) != true )
|
||||
{
|
||||
string errorMessage = "打开文件失败!";
|
||||
errorMessage.append( pBook->errorMessage() );
|
||||
|
||||
throw runtime_error( errorMessage );
|
||||
}
|
||||
|
||||
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 firstColumnIndex = pSheet->firstCol();
|
||||
int rowIndex = firstRowIndex + startRowIndex;
|
||||
|
||||
while ( rowIndex <= lastRowIndex )
|
||||
{
|
||||
int colunmIndex = firstRowIndex;
|
||||
|
||||
const wstring && theYear = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex, true );
|
||||
const wstring && theMonth = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex + 1, true );
|
||||
const wstring && carDealerCode = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex + 2, true );
|
||||
const wstring && carDealerName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex + 3, true );
|
||||
long double checkedAchievement = 0;
|
||||
int policyAmount = 0;
|
||||
int cpicAmount = 0;
|
||||
int piccAmount = 0;
|
||||
int pinganAmount = 0;
|
||||
int othersAmount = 0;
|
||||
|
||||
//空行跳过
|
||||
if ( carDealerCode.empty() == true )
|
||||
{
|
||||
rowIndex++;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
//每个字段都要先判断数据类型再读写,防止填写表格的人填错内容。
|
||||
CellType type = pSheet->cellType( rowIndex, firstColumnIndex + 4 );
|
||||
char errorMessage[1000];
|
||||
|
||||
//产值
|
||||
if ( type == CELLTYPE_NUMBER )
|
||||
{
|
||||
checkedAchievement = pSheet->readNum( rowIndex, firstColumnIndex + 4 );
|
||||
}
|
||||
else
|
||||
{
|
||||
pBook->release();
|
||||
|
||||
sprintf( errorMessage, "第%d行第%d列,格式错误,不是数字类型!", rowIndex, firstColumnIndex + 4 );
|
||||
|
||||
throw runtime_error( errorMessage );
|
||||
}
|
||||
|
||||
//签单数量
|
||||
type = pSheet->cellType( rowIndex, firstColumnIndex + 5 );
|
||||
|
||||
if ( type == CELLTYPE_NUMBER )
|
||||
{
|
||||
policyAmount = static_cast<int>(pSheet->readNum( rowIndex, firstColumnIndex + 5 ));
|
||||
}
|
||||
else
|
||||
{
|
||||
pBook->release();
|
||||
|
||||
sprintf( errorMessage, "第%d行第%d列,格式错误,不是数字类型!", rowIndex, firstColumnIndex + 5 );
|
||||
|
||||
throw runtime_error( errorMessage );
|
||||
}
|
||||
|
||||
//太平洋保险新车签单台次
|
||||
type = pSheet->cellType( rowIndex, firstColumnIndex + 6 );
|
||||
|
||||
if ( type == CELLTYPE_NUMBER )
|
||||
{
|
||||
cpicAmount = static_cast<int>(pSheet->readNum( rowIndex, firstColumnIndex + 6 ));
|
||||
}
|
||||
else
|
||||
{
|
||||
pBook->release();
|
||||
|
||||
sprintf( errorMessage, "第%d行第%d列,格式错误,不是数字类型!", rowIndex, firstColumnIndex + 6 );
|
||||
|
||||
throw runtime_error( errorMessage );
|
||||
}
|
||||
|
||||
//中国人保新车签单台次
|
||||
type = pSheet->cellType( rowIndex, firstColumnIndex + 7 );
|
||||
|
||||
if ( type == CELLTYPE_NUMBER )
|
||||
{
|
||||
piccAmount = static_cast<int>(pSheet->readNum( rowIndex, firstColumnIndex + 7 ));
|
||||
}
|
||||
else
|
||||
{
|
||||
pBook->release();
|
||||
|
||||
sprintf( errorMessage, "第%d行第%d列,格式错误,不是数字类型!", rowIndex, firstColumnIndex + 7 );
|
||||
|
||||
throw runtime_error( errorMessage );
|
||||
}
|
||||
|
||||
//中国平安新车签单台次
|
||||
type = pSheet->cellType( rowIndex, firstColumnIndex + 8 );
|
||||
|
||||
if ( type == CELLTYPE_NUMBER )
|
||||
{
|
||||
pinganAmount = static_cast<int>(pSheet->readNum( rowIndex, firstColumnIndex + 8 ));
|
||||
}
|
||||
else
|
||||
{
|
||||
pBook->release();
|
||||
|
||||
sprintf( errorMessage, "第%d行第%d列,格式错误,不是数字类型!", rowIndex, firstColumnIndex + 8 );
|
||||
|
||||
throw runtime_error( errorMessage );
|
||||
}
|
||||
|
||||
//其他保险公司新车签单台次
|
||||
type = pSheet->cellType( rowIndex, firstColumnIndex + 9 );
|
||||
|
||||
if ( type == CELLTYPE_NUMBER )
|
||||
{
|
||||
othersAmount = static_cast<int>(pSheet->readNum( rowIndex, firstColumnIndex + 9 ));
|
||||
}
|
||||
else
|
||||
{
|
||||
pBook->release();
|
||||
|
||||
sprintf( errorMessage, "第%d行第%d列,格式错误,不是数字类型!", rowIndex, firstColumnIndex + 9 );
|
||||
|
||||
throw runtime_error( errorMessage );
|
||||
}
|
||||
|
||||
CarDealerAchievement achievement( theYear,
|
||||
theMonth,
|
||||
carDealerCode,
|
||||
checkedAchievement,
|
||||
policyAmount,
|
||||
cpicAmount,
|
||||
piccAmount,
|
||||
pinganAmount,
|
||||
othersAmount );
|
||||
|
||||
achievementVector.push_back( achievement );
|
||||
|
||||
rowIndex++;
|
||||
}
|
||||
|
||||
pBook->release();
|
||||
}
|
||||
|
||||
void LoadRepairOrderFromXlsx( const std::wstring & filePath,
|
||||
unsigned sheetIndex,
|
||||
unsigned startRowIndex,
|
||||
std::vector<RepairOrder> & orderVector )
|
||||
{
|
||||
Book * pBook = xlCreateXMLBookW();
|
||||
Sheet * pSheet = nullptr;
|
||||
|
||||
if ( pBook == nullptr )
|
||||
{
|
||||
throw runtime_error( "libxl库加载失败!" );
|
||||
}
|
||||
|
||||
setKey( pBook );
|
||||
|
||||
if ( pBook->load( filePath.c_str() ) != true )
|
||||
{
|
||||
string errorMessage = "打开文件失败!";
|
||||
errorMessage.append( pBook->errorMessage() );
|
||||
|
||||
throw runtime_error( errorMessage );
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
//报案推荐车商代码在表格中不存在,但在数据库中存在。
|
||||
const wstring && branchName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
const wstring && orderNo = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
const wstring && orderType = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
const wstring && notifyNo = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
const wstring && damageArea = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
const wstring && damageDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
const wstring && generatingDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
const wstring && policyNo = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
const wstring && policyNoJQX = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
const wstring && plateNumber = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
const wstring && brandName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
const wstring && isInsuranceObject = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
const wstring && isSuccess = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
const wstring && recommandDealerCode = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
const wstring && recommandDealerName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
const wstring && recommandDealerCodeInNotify = L""; // ReadCellStringFromXlsx(pBook, sheetIndex, rowIndex, colunmIndex, true);
|
||||
const wstring && recommandDealerNameInNotify = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
const wstring && recommandDealerNameInSurvey = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
const wstring && agentName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
const wstring && surveyor = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
const wstring && checkDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
const wstring && repairingStartDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
const wstring && repairingFinishDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
const wstring && status = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
const wstring && lostItemID = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
const wstring && surveyorRecommandStatus = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
|
||||
//空行跳过
|
||||
if ( orderNo.empty() == true )
|
||||
{
|
||||
rowIndex++;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
RepairOrder order( branchName,
|
||||
orderNo,
|
||||
orderType,
|
||||
notifyNo,
|
||||
damageArea,
|
||||
damageDate,
|
||||
generatingDate,
|
||||
policyNo,
|
||||
policyNoJQX,
|
||||
plateNumber,
|
||||
brandName,
|
||||
isInsuranceObject,
|
||||
isSuccess,
|
||||
recommandDealerCode,
|
||||
recommandDealerName,
|
||||
recommandDealerCodeInNotify,
|
||||
recommandDealerNameInNotify,
|
||||
recommandDealerNameInSurvey,
|
||||
agentName,
|
||||
surveyor,
|
||||
checkDate,
|
||||
repairingStartDate,
|
||||
repairingFinishDate,
|
||||
status,
|
||||
lostItemID,
|
||||
surveyorRecommandStatus );
|
||||
|
||||
orderVector.push_back( order );
|
||||
|
||||
rowIndex++;
|
||||
}
|
||||
|
||||
pBook->release();
|
||||
}
|
||||
|
||||
void LoadRepairSuggestionFromXlsx( const std::wstring & filePath,
|
||||
unsigned sheetIndex,
|
||||
unsigned startRowIndex,
|
||||
std::vector<RepairSuggestionRecord> & recordVector )
|
||||
{
|
||||
Book * pBook = xlCreateXMLBookW();
|
||||
Sheet * pSheet = nullptr;
|
||||
|
||||
if ( pBook == nullptr )
|
||||
{
|
||||
throw runtime_error( "libxl库加载失败!" );
|
||||
}
|
||||
|
||||
if ( pBook->load( filePath.c_str() ) != true )
|
||||
{
|
||||
string errorMessage = "打开文件失败!";
|
||||
errorMessage.append( pBook->errorMessage() );
|
||||
|
||||
throw runtime_error( errorMessage );
|
||||
}
|
||||
|
||||
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 );
|
||||
|
||||
RepairSuggestionRecord record( orderNo,
|
||||
orderType,
|
||||
notifyNo,
|
||||
suggestedCarDealerCode,
|
||||
suggestedCarDealerName,
|
||||
damageDate,
|
||||
plateNumber,
|
||||
brandName,
|
||||
messageType,
|
||||
messageSendingDate,
|
||||
dataSource );
|
||||
|
||||
recordVector.push_back( record );
|
||||
|
||||
rowIndex++;
|
||||
}
|
||||
|
||||
pBook->release();
|
||||
}
|
||||
|
||||
void LoadNewRepairMonitorReportFromXlsx( const std::wstring & filePath,
|
||||
unsigned sheetIndex,
|
||||
unsigned startRowIndex,
|
||||
std::vector<NewRepairMonitorReportRecord> & recordVector )
|
||||
{
|
||||
Book * pBook = xlCreateXMLBookW();
|
||||
Sheet * pSheet = nullptr;
|
||||
|
||||
if ( pBook == nullptr )
|
||||
{
|
||||
throw runtime_error( "libxl库加载失败!" );
|
||||
}
|
||||
|
||||
setKey( pBook );
|
||||
|
||||
if ( pBook->load( filePath.c_str() ) != true )
|
||||
{
|
||||
string errorMessage = "打开文件失败!";
|
||||
errorMessage.append( pBook->errorMessage() );
|
||||
|
||||
throw runtime_error( errorMessage );
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
NewRepairMonitorReportRecord record;
|
||||
|
||||
record.分公司名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.部门组名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.报案号_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.报案日期_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.出险日期_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.出险地点_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.事故车目前位置_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.车损序号_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.车牌_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.vin码_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.车龄_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.品牌代码_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.品牌名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.车系名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.使用性质名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.保单号_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.标的车_三者车_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.是否9座以下企业用车_行政用车_家庭自用车_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.核价金额_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.核损配件核损金额_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.核损工时费核损金额_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.核损辅料核损金额_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.核损外修费核损金额_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.核损施救费核损金额_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.结案金额_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.结案配件核损金额_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.结案工时费核损金额_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.结案辅料核损金额_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.结案外修费核损金额_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.结案施救费核损金额_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.接报案人分公司名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.接报案人工号_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.接报案人名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第一任务分派时间_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第一定损员分公司_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第一定损员部门组名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第一定损员代码_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第一定损员名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第一车商是否已阅读_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第一车上是否预约进厂_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第一车商是否推荐失败_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第一车商是否进厂确认_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第一车商是否出场确认_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第二任务分派时间_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第二定损员分公司_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第二定损员部门组名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第二定损员代码_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第二定损员名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第二车商是否已阅读_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第二车上是否预约进厂_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第二车商是否推荐失败_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第二车商是否进厂确认_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第二车商是否出场确认_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第三任务分派时间_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第三定损员分公司_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第三定损员部门组名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第三定损员代码_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第三定损员名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第三车商是否已阅读_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第三车上是否预约进厂_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第三车商是否推荐失败_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第三车商是否进厂确认_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第三车商是否出场确认_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.其他查勘员信息_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.是否推荐_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.是否存在工单_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.工单类型_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.查勘员操作类型_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.案件状态名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.车状_当前状态_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.车状_报案环节_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.车状_现场推荐环节_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.车状_核价通过环节_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.车状_结案环节_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.承保车商代码_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.承保车商名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.报案车商分公司名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.报案车商部门组名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.报案车商代码_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.报案车商名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.现场推荐车商分公司名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.现场推荐车商代码_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.现场推荐车商名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.核价车商分公司名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.核价车商部门组名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.核价车商代码_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.核价车商名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.推荐车商与核价车商是否一致_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.核价修理厂归属公司代码_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.核价修理厂归属公司名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.核价修理厂_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.核价修理厂名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.估损单号_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.核价通过时间_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.定损员机构_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.定损员代码_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.定损员名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.结案车商分公司_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.结案车商部门组名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.结案车商代码_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.结案车商名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.推荐车商与结案车商是否一致_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.结案修理厂归属公司代码_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.结案修理厂归属公司名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.结案修理厂代码_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.结案修理厂名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.车辆进厂时间_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.车辆出厂时间_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.结案时间_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.事故经过_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.数据更新日期_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.备注_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.估损单模板_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.返修开关_报案_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.送修开关_报案_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.返修开关_核价_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.送修开关_核价_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.返修开关_结案_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.送修开关_结案_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.查勘员分公司名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.查勘员代码_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.查勘员名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.核价修理厂归属中支_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.结案修理厂归属中支_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.是否诉讼_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.座席推荐分公司代码_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.座席推荐分公司名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.座席推荐车商名代码_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.座席推荐车商名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.座席推荐操作类型_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.座席推荐排名_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第一次推荐分公司代码_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第一次推荐分公司名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第一次推荐车商代码_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第一次推荐车商名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第一次推荐工具_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第一次推荐操作类型_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第一次推荐排名_其他推荐信息_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第二次推荐分公司代码_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第二次推荐分公司名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第二次推荐车商代码_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第二次推荐车商名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第二次推荐工具_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第二次推荐操作类型_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第二次推荐排名_其他推荐信息_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第三次推荐分公司代码_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第三次推荐分公司名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第三次推荐车商代码_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第三次推荐车商名称_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第三次推荐工具_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第三次推荐操作类型_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.第三次推荐排名_其他推荐信息_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.其他推荐信息_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.推荐失败具体原因_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.是否现场报案_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.报案地点_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
record.是否在厂报案_ = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
|
||||
recordVector.push_back( record );
|
||||
|
||||
rowIndex++;
|
||||
}
|
||||
|
||||
pBook->release();
|
||||
}
|
||||
|
||||
void LoadRepairOrderFromXls( const std::wstring & filePath,
|
||||
unsigned sheetIndex,
|
||||
unsigned startRowIndex,
|
||||
std::vector<RepairOrder> & orderVector )
|
||||
{
|
||||
Book * pBook = xlCreateBookW();
|
||||
Sheet * pSheet = nullptr;
|
||||
|
||||
if ( pBook == nullptr )
|
||||
{
|
||||
throw runtime_error( "libxl库加载失败!" );
|
||||
}
|
||||
|
||||
setKey( pBook );
|
||||
|
||||
if ( pBook->load( filePath.c_str() ) != true )
|
||||
{
|
||||
string errorMessage = "打开文件失败!";
|
||||
errorMessage.append( pBook->errorMessage() );
|
||||
|
||||
throw runtime_error( errorMessage );
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
// const wstring && branchName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
// const wstring && orderNo = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
// const wstring && orderType = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
// const wstring && notifyNo = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
// const wstring && damageArea = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
// const wstring && damageDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
// const wstring && generatingDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
// const wstring && policyNo = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
// const wstring && policyNoJQX = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
// const wstring && plateNumber = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
// const wstring && brandName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
// const wstring && isInsuranceObject = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
// const wstring && isSuccess = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
// const wstring && recommandDealerCode = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
// const wstring && recommandDealerName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
// const wstring && recommandDealerCodeInNotify = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
// const wstring && recommandDealerNameInNotify = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
// const wstring && recommandDealerNameInSurvey = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
// const wstring && agentName = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
// const wstring && surveyor = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
// const wstring && checkDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
// const wstring && repairingStartDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
// const wstring && repairingFinishDate = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
// const wstring && status = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
// const wstring && lostItemID = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
// const wstring && surveyorRecommandStatus = ReadCellStringFromXlsx( pBook, sheetIndex, rowIndex, colunmIndex++, true );
|
||||
//
|
||||
// //空行跳过
|
||||
// if ( orderNo.empty() == true )
|
||||
// {
|
||||
// rowIndex++;
|
||||
//
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// RepairOrder order( branchName,
|
||||
// orderNo,
|
||||
// orderType,
|
||||
// notifyNo,
|
||||
// damageArea,
|
||||
// damageDate,
|
||||
// generatingDate,
|
||||
// policyNo,
|
||||
// policyNoJQX,
|
||||
// plateNumber,
|
||||
// brandName,
|
||||
// isInsuranceObject,
|
||||
// isSuccess,
|
||||
// recommandDealerCode,
|
||||
// recommandDealerName,
|
||||
// recommandDealerCodeInNotify,
|
||||
// recommandDealerNameInNotify,
|
||||
// recommandDealerNameInSurvey,
|
||||
// agentName,
|
||||
// surveyor,
|
||||
// checkDate,
|
||||
// repairingStartDate,
|
||||
// repairingFinishDate,
|
||||
// status,
|
||||
// lostItemID,
|
||||
// surveyorRecommandStatus );
|
||||
//
|
||||
// orderVector.push_back( order );
|
||||
|
||||
rowIndex++;
|
||||
}
|
||||
|
||||
pBook->release();
|
||||
}
|
@@ -0,0 +1,75 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "../../Datastructure/CarDealerScheme/CarDealerScheme.h"
|
||||
#include "../../Datastructure/CarDealerAchievement/CarDealerAchievement.h"
|
||||
#include "../../Datastructure/RepairOrder/RepairOrder.h"
|
||||
#include "../../Datastructure/RepairSuggestion/RepairSuggestionRecord.h"
|
||||
#include "../../Datastructure/新送返修监控报表/新送返修监控报表.h"
|
||||
|
||||
/************************************************
|
||||
* \brief
|
||||
* \param filePath
|
||||
* \param sheetIndex
|
||||
* \param startRowIndex
|
||||
* \param schemeVector
|
||||
************************************************/
|
||||
void LoadCarDealerSchemeFromXlsx( const std::wstring & filePath,
|
||||
unsigned int sheetIndex,
|
||||
unsigned int startRowIndex,
|
||||
std::vector<CarDealerScheme> & schemeVector );
|
||||
|
||||
/************************************************
|
||||
* \brief
|
||||
* \param filePath
|
||||
* \param sheetIndex
|
||||
* \param startRowIndex
|
||||
* \param achievementVector
|
||||
************************************************/
|
||||
void LoadCarDealerAchievementFromXlsx( const std::wstring & filePath,
|
||||
unsigned int sheetIndex,
|
||||
unsigned int startRowIndex,
|
||||
std::vector<CarDealerAchievement> & achievementVector );
|
||||
|
||||
/************************************************
|
||||
* \brief
|
||||
* \param filePath
|
||||
* \param sheetIndex
|
||||
* \param startRowIndex
|
||||
* \param orderVector
|
||||
************************************************/
|
||||
void LoadRepairOrderFromXlsx( const std::wstring & filePath,
|
||||
unsigned int sheetIndex,
|
||||
unsigned int startRowIndex,
|
||||
std::vector<RepairOrder> & orderVector );
|
||||
|
||||
// void LoadRepairOrderFromXls( const std::wstring & filePath,
|
||||
// unsigned sheetIndex,
|
||||
// unsigned startRowIndex,
|
||||
// std::vector<RepairOrder> & orderVector );
|
||||
|
||||
/************************************************
|
||||
* \brief 读取送返修推荐表数据
|
||||
* \param filePath
|
||||
* \param sheetIndex
|
||||
* \param startRowIndex
|
||||
* \param recordVector
|
||||
************************************************/
|
||||
void LoadRepairSuggestionFromXlsx( const std::wstring & filePath,
|
||||
unsigned int sheetIndex,
|
||||
unsigned int startRowIndex,
|
||||
std::vector<RepairSuggestionRecord> & recordVector );
|
||||
|
||||
|
||||
/************************************************
|
||||
* \brief 读取新送返修监控报表数据
|
||||
* \param filePath
|
||||
* \param sheetIndex
|
||||
* \param startRowIndex
|
||||
* \param recordVector
|
||||
************************************************/
|
||||
void LoadNewRepairMonitorReportFromXlsx( const std::wstring & filePath,
|
||||
unsigned int sheetIndex,
|
||||
unsigned int startRowIndex,
|
||||
std::vector<NewRepairMonitorReportRecord> & recordVector );
|
@@ -0,0 +1,106 @@
|
||||
#include <map>
|
||||
#include <stdexcept>
|
||||
#include <exception>
|
||||
#include <ocilib.hpp>
|
||||
#include <libxl.h>
|
||||
#include "FromExcelToOracle.h"
|
||||
|
||||
#include "../../excel/excel.h"
|
||||
|
||||
using namespace std;;
|
||||
using namespace ocilib;
|
||||
using namespace libxl;
|
||||
|
||||
|
||||
void RepairMonitoringFromExcelToOracle( const std::wstring & filePath,
|
||||
unsigned int sheetIndex,
|
||||
bool hasTitleRow,
|
||||
const std::string & tnsName,
|
||||
const std::string & userName,
|
||||
const std::string & password )
|
||||
{
|
||||
//防御性验证
|
||||
if ( filePath.empty() == true ||
|
||||
tnsName.empty() == true ||
|
||||
userName.empty() == true ||
|
||||
password.empty() == true )
|
||||
{
|
||||
throw runtime_error( "参数错误!" );
|
||||
}
|
||||
|
||||
//libxl对象
|
||||
Book * pBook = xlCreateBookW();
|
||||
Sheet * pSheet = nullptr;
|
||||
map<int, wstring> titleMap; //存放标题行
|
||||
unsigned int firstColumnIndex; //第一列
|
||||
unsigned int lastColumnIndex; //最后一列
|
||||
unsigned int firstRowIndex;
|
||||
unsigned int lastRowIndex;
|
||||
|
||||
//ocilib对象
|
||||
Connection * pConnection = nullptr;
|
||||
Statement * pStatement = nullptr;
|
||||
|
||||
if ( pBook == nullptr )
|
||||
{
|
||||
throw runtime_error( "libxl初始化失败!" );
|
||||
}
|
||||
|
||||
if ( pBook->load( filePath.c_str() ) != true )
|
||||
{
|
||||
throw runtime_error( "打开excel文件失败!" );
|
||||
}
|
||||
|
||||
pSheet = pBook->getSheet( sheetIndex );
|
||||
|
||||
if ( pSheet == nullptr )
|
||||
{
|
||||
throw runtime_error( "读取sheet失败失败!" );
|
||||
}
|
||||
|
||||
firstColumnIndex = pSheet->firstCol();
|
||||
lastColumnIndex = pSheet->lastCol();
|
||||
firstRowIndex = pSheet->firstRow();
|
||||
lastRowIndex = pSheet->lastRow();
|
||||
|
||||
unsigned int colIndex = firstColumnIndex;
|
||||
unsigned int rowIndex = firstRowIndex;
|
||||
|
||||
//保存标题
|
||||
if ( hasTitleRow )
|
||||
{
|
||||
while ( colIndex <= lastColumnIndex )
|
||||
{
|
||||
wstring && title = ReadCellStringFromXlsx( pBook, sheetIndex, firstRowIndex, colIndex, false );
|
||||
|
||||
titleMap.insert( pair<int, wstring>( colIndex, title ) );
|
||||
|
||||
++colIndex;
|
||||
}
|
||||
}
|
||||
|
||||
//逐行保存数据
|
||||
while ( colIndex <= lastColumnIndex )
|
||||
{
|
||||
wstring && title = ReadCellStringFromXlsx( pBook, sheetIndex, firstRowIndex, colIndex, false );
|
||||
|
||||
titleMap.insert( pair<int, wstring>( colIndex, title ) );
|
||||
|
||||
++colIndex;
|
||||
}
|
||||
|
||||
//逐行保存数据
|
||||
for ( rowIndex = firstRowIndex; rowIndex >= lastRowIndex; rowIndex++ )
|
||||
{
|
||||
//如果是标题行,就跳过
|
||||
if ( rowIndex == firstRowIndex )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//逐列绑定sql语句
|
||||
for ( colIndex = firstColumnIndex; colIndex <= lastColumnIndex; colIndex++ )
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
|
||||
void RepairMonitoringFromExcelToOracle( const std::wstring & filePath,
|
||||
unsigned int sheetIndex,
|
||||
bool hasTitleRow,
|
||||
const std::string & tnsName,
|
||||
const std::string & userName,
|
||||
const std::string & password );
|
@@ -0,0 +1,76 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "../../Datastructure/CarDealerAchievement/CarDealerAchievement.h"
|
||||
#include "../../Datastructure/CarDealerScheme/CarDealerScheme.h"
|
||||
#include "../../Datastructure/RepairOrder/RepairOrder.h"
|
||||
#include "../../Datastructure/RepairSuggestion/RepairSuggestionRecord.h"
|
||||
#include "../Excel/LoadFromExcel.h"
|
||||
|
||||
|
||||
/************************************************
|
||||
* \brief 向oracle数据库写入车商业绩表
|
||||
* \param userName oracle数据库用户名
|
||||
* \param password oracle数据库密码
|
||||
* \param tnsName oracle TNS名称
|
||||
* \param orderVector 车商业绩表数据
|
||||
************************************************/
|
||||
void ImportCarDealerAchievementToOracleCpp( const std::string & userName,
|
||||
const std::string & password,
|
||||
const std::string & tnsName,
|
||||
const std::vector<CarDealerAchievement> & achievementVector );
|
||||
|
||||
/************************************************
|
||||
* \brief 向oracle数据库写入车商业绩表
|
||||
* \param userName oracle数据库用户名
|
||||
* \param password oracle数据库密码
|
||||
* \param tnsName oracle TNS名称
|
||||
* \param orderVector 车商业绩表数据
|
||||
************************************************/
|
||||
void ImportCarDealerAchievementToOracle( std::string userName,
|
||||
std::string password,
|
||||
std::string tnsName,
|
||||
std::vector<CarDealerAchievement> & achievementVector );
|
||||
|
||||
|
||||
/************************************************
|
||||
* \brief 向oracle数据库写入车商方案表
|
||||
* \param userName oracle数据库用户名
|
||||
* \param password oracle数据库密码
|
||||
* \param tnsName oracle TNS名称
|
||||
* \param orderVector 车商方案表数据
|
||||
************************************************/
|
||||
void ImportCarDealerSchemeToOracle( const std::string & userName,
|
||||
const std::string & password,
|
||||
const std::string & tnsName,
|
||||
std::vector<CarDealerScheme> & achievementVector );
|
||||
|
||||
/************************************************
|
||||
* \brief 向oracle数据库写入送返修工单信息
|
||||
* \param userName oracle数据库用户名
|
||||
* \param password oracle数据库密码
|
||||
* \param tnsName oracle TNS名称
|
||||
* \param orderVector 送返修工单数据
|
||||
************************************************/
|
||||
void ImportRepairOrderToOracle( const std::string & userName,
|
||||
const std::string & password,
|
||||
const std::string & tnsName,
|
||||
const std::vector<RepairOrder> & orderVector );
|
||||
|
||||
/************************************************
|
||||
* \brief 将送返修推荐记录
|
||||
* \param userName
|
||||
* \param password
|
||||
* \param tnsName
|
||||
* \param recordVector
|
||||
************************************************/
|
||||
void ImportRepairSuggestionToOracle( const std::string & userName,
|
||||
const std::string & password,
|
||||
const std::string & tnsName,
|
||||
const std::vector<RepairSuggestionRecord> & recordVector );
|
||||
|
||||
void ImportNewRepairMonitorToOracle( const std::string & userName,
|
||||
const std::string & password,
|
||||
const std::string & tnsName,
|
||||
const std::vector<NewRepairMonitorReportRecord> & recordVector );
|
@@ -0,0 +1 @@
|
||||
#include "CarDealerAchievement.h"
|
@@ -0,0 +1,230 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
class CarDealerAchievement
|
||||
{
|
||||
public:
|
||||
|
||||
CarDealerAchievement( const std::wstring & theYear,
|
||||
const std::wstring & theMonth,
|
||||
const std::wstring & carDealerCode,
|
||||
const long double checkedAchievement,
|
||||
const int policyAmount,
|
||||
const int cpicAmount,
|
||||
const int piccAmount,
|
||||
const int pinganAmount,
|
||||
const int othersAmount )
|
||||
: theYear( theYear ),
|
||||
theMonth( theMonth ),
|
||||
carDealerCode( carDealerCode ),
|
||||
checkedAchievement( checkedAchievement ),
|
||||
policyAmount( policyAmount ),
|
||||
cpicAmount( cpicAmount ),
|
||||
piccAmount( piccAmount ),
|
||||
pinganAmount( pinganAmount ),
|
||||
othersAmount( othersAmount )
|
||||
{
|
||||
}
|
||||
|
||||
CarDealerAchievement( const wchar_t * theYear,
|
||||
const wchar_t * theMonth,
|
||||
const wchar_t * carDealerCode,
|
||||
const long double checkedAchievement,
|
||||
const int policyAmount,
|
||||
const int cpicAmount,
|
||||
const int piccAmount,
|
||||
const int pinganAmount,
|
||||
const int othersAmount )
|
||||
: theYear( theYear ),
|
||||
theMonth( theMonth ),
|
||||
carDealerCode( carDealerCode ),
|
||||
checkedAchievement( checkedAchievement ),
|
||||
policyAmount( policyAmount ),
|
||||
cpicAmount( cpicAmount ),
|
||||
piccAmount( piccAmount ),
|
||||
pinganAmount( pinganAmount ),
|
||||
othersAmount( othersAmount )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
CarDealerAchievement( const CarDealerAchievement & other )
|
||||
: theYear( other.theYear ),
|
||||
theMonth( other.theMonth ),
|
||||
carDealerCode( other.carDealerCode ),
|
||||
checkedAchievement( other.checkedAchievement ),
|
||||
policyAmount( other.policyAmount ),
|
||||
cpicAmount( other.cpicAmount ),
|
||||
piccAmount( other.piccAmount ),
|
||||
pinganAmount( other.pinganAmount ),
|
||||
othersAmount( other.othersAmount )
|
||||
{
|
||||
}
|
||||
|
||||
CarDealerAchievement( CarDealerAchievement && other )
|
||||
: theYear( std::move(other.theYear) ),
|
||||
theMonth( std::move(other.theMonth) ),
|
||||
carDealerCode( std::move(other.carDealerCode) ),
|
||||
checkedAchievement( other.checkedAchievement ),
|
||||
policyAmount( other.policyAmount ),
|
||||
cpicAmount( other.cpicAmount ),
|
||||
piccAmount( other.piccAmount ),
|
||||
pinganAmount( other.pinganAmount ),
|
||||
othersAmount( other.othersAmount )
|
||||
{
|
||||
}
|
||||
|
||||
CarDealerAchievement & operator=( const CarDealerAchievement & other )
|
||||
{
|
||||
if ( this == &other )
|
||||
return *this;
|
||||
theYear = other.theYear;
|
||||
theMonth = other.theMonth;
|
||||
carDealerCode = other.carDealerCode;
|
||||
checkedAchievement = other.checkedAchievement;
|
||||
policyAmount = other.policyAmount;
|
||||
cpicAmount = other.cpicAmount;
|
||||
piccAmount = other.piccAmount;
|
||||
pinganAmount = other.pinganAmount;
|
||||
othersAmount = other.othersAmount;
|
||||
return *this;
|
||||
}
|
||||
|
||||
CarDealerAchievement & operator=( CarDealerAchievement && other )
|
||||
{
|
||||
if ( this == &other )
|
||||
return *this;
|
||||
theYear = std::move( other.theYear );
|
||||
theMonth = std::move( other.theMonth );
|
||||
carDealerCode = std::move( other.carDealerCode );
|
||||
checkedAchievement = other.checkedAchievement;
|
||||
policyAmount = other.policyAmount;
|
||||
cpicAmount = other.cpicAmount;
|
||||
piccAmount = other.piccAmount;
|
||||
pinganAmount = other.pinganAmount;
|
||||
othersAmount = other.othersAmount;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
friend bool operator==( const CarDealerAchievement & lhs, const CarDealerAchievement & rhs )
|
||||
{
|
||||
return lhs.theYear == rhs.theYear
|
||||
&& lhs.theMonth == rhs.theMonth
|
||||
&& lhs.carDealerCode == rhs.carDealerCode
|
||||
&& lhs.checkedAchievement == rhs.checkedAchievement
|
||||
&& lhs.policyAmount == rhs.policyAmount
|
||||
&& lhs.cpicAmount == rhs.cpicAmount
|
||||
&& lhs.piccAmount == rhs.piccAmount
|
||||
&& lhs.pinganAmount == rhs.pinganAmount
|
||||
&& lhs.othersAmount == rhs.othersAmount;
|
||||
}
|
||||
|
||||
friend bool operator!=( const CarDealerAchievement & lhs, const CarDealerAchievement & rhs )
|
||||
{
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
|
||||
|
||||
std::wstring getTheYear() const
|
||||
{
|
||||
return theYear;
|
||||
}
|
||||
|
||||
void setTheYear( const std::wstring & theYear )
|
||||
{
|
||||
this->theYear = theYear;
|
||||
}
|
||||
|
||||
std::wstring getTheMonth() const
|
||||
{
|
||||
return theMonth;
|
||||
}
|
||||
|
||||
void setTheMonth( const std::wstring & theMonth )
|
||||
{
|
||||
this->theMonth = theMonth;
|
||||
}
|
||||
|
||||
std::wstring getCarDealerCode() const
|
||||
{
|
||||
return carDealerCode;
|
||||
}
|
||||
|
||||
void setCarDealerCode( const std::wstring & carDealerCode )
|
||||
{
|
||||
this->carDealerCode = carDealerCode;
|
||||
}
|
||||
|
||||
long double getCheckedAchievement() const
|
||||
{
|
||||
return checkedAchievement;
|
||||
}
|
||||
|
||||
void setCheckedAchievement( const long double checkedAchievement )
|
||||
{
|
||||
this->checkedAchievement = checkedAchievement;
|
||||
}
|
||||
|
||||
int getPolicyAmount() const
|
||||
{
|
||||
return policyAmount;
|
||||
}
|
||||
|
||||
void setPolicyAmount( const int policyAmount )
|
||||
{
|
||||
this->policyAmount = policyAmount;
|
||||
}
|
||||
|
||||
int getCpicAmount() const
|
||||
{
|
||||
return cpicAmount;
|
||||
}
|
||||
|
||||
void setCpicAmount( const int cpicAmount )
|
||||
{
|
||||
this->cpicAmount = cpicAmount;
|
||||
}
|
||||
|
||||
int getPiccAmount() const
|
||||
{
|
||||
return piccAmount;
|
||||
}
|
||||
|
||||
void setPiccAmount( const int piccAmount )
|
||||
{
|
||||
this->piccAmount = piccAmount;
|
||||
}
|
||||
|
||||
int getPinganAmount() const
|
||||
{
|
||||
return pinganAmount;
|
||||
}
|
||||
|
||||
void setPinganAmount( const int pinganAmount )
|
||||
{
|
||||
this->pinganAmount = pinganAmount;
|
||||
}
|
||||
|
||||
int getOthersAmount() const
|
||||
{
|
||||
return othersAmount;
|
||||
}
|
||||
|
||||
void setOthersAmount( const int othersAmount )
|
||||
{
|
||||
this->othersAmount = othersAmount;
|
||||
}
|
||||
|
||||
private:
|
||||
std::wstring theYear;
|
||||
std::wstring theMonth;
|
||||
std::wstring carDealerCode;
|
||||
long double checkedAchievement;
|
||||
int policyAmount;
|
||||
int cpicAmount;
|
||||
int piccAmount;
|
||||
int pinganAmount;
|
||||
int othersAmount;
|
||||
};
|
@@ -0,0 +1 @@
|
||||
#include "CarDealerScheme.h"
|
@@ -0,0 +1,193 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
class CarDealerScheme
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
CarDealerScheme( const std::wstring & theYear,
|
||||
const std::wstring & theMonth,
|
||||
const std::wstring & carDealerCode,
|
||||
const std::wstring & manHourPrice,
|
||||
const std::wstring & partPrice,
|
||||
const std::wstring & claimSupport,
|
||||
const std::wstring & scheme,
|
||||
const std::wstring & isQualified )
|
||||
: theYear( theYear ),
|
||||
theMonth( theMonth ),
|
||||
carDealerCode( carDealerCode ),
|
||||
manHourPrice( manHourPrice ),
|
||||
partPrice( partPrice ),
|
||||
claimSupport( claimSupport ),
|
||||
scheme( scheme ),
|
||||
isQualified( isQualified )
|
||||
{
|
||||
}
|
||||
|
||||
CarDealerScheme( const wchar_t * theYear,
|
||||
const wchar_t * theMonth,
|
||||
const wchar_t * carDealerCode,
|
||||
const wchar_t * manHourPrice,
|
||||
const wchar_t * partPrice,
|
||||
const wchar_t * claimSupport,
|
||||
const wchar_t * scheme,
|
||||
const wchar_t * isQualified )
|
||||
: theYear( theYear ),
|
||||
theMonth( theMonth ),
|
||||
carDealerCode( carDealerCode ),
|
||||
manHourPrice( manHourPrice ),
|
||||
partPrice( partPrice ),
|
||||
claimSupport( claimSupport ),
|
||||
scheme( scheme ),
|
||||
isQualified( isQualified )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
CarDealerScheme( const CarDealerScheme & other )
|
||||
: theYear( other.theYear ),
|
||||
theMonth( other.theMonth ),
|
||||
carDealerCode( other.carDealerCode ),
|
||||
manHourPrice( other.manHourPrice ),
|
||||
partPrice( other.partPrice ),
|
||||
claimSupport( other.claimSupport ),
|
||||
scheme( other.scheme ),
|
||||
isQualified( other.isQualified )
|
||||
{
|
||||
}
|
||||
|
||||
CarDealerScheme( CarDealerScheme && other )
|
||||
: theYear( std::move( other.theYear ) ),
|
||||
theMonth( std::move( other.theMonth ) ),
|
||||
carDealerCode( std::move( other.carDealerCode ) ),
|
||||
manHourPrice( std::move( other.manHourPrice ) ),
|
||||
partPrice( std::move( other.partPrice ) ),
|
||||
claimSupport( std::move( other.claimSupport ) ),
|
||||
scheme( std::move( other.scheme ) ),
|
||||
isQualified( std::move( other.isQualified ) )
|
||||
{
|
||||
}
|
||||
|
||||
CarDealerScheme & operator=( const CarDealerScheme & other )
|
||||
{
|
||||
if ( this == &other )
|
||||
return *this;
|
||||
theYear = other.theYear;
|
||||
theMonth = other.theMonth;
|
||||
carDealerCode = other.carDealerCode;
|
||||
manHourPrice = other.manHourPrice;
|
||||
partPrice = other.partPrice;
|
||||
claimSupport = other.claimSupport;
|
||||
scheme = other.scheme;
|
||||
isQualified = other.isQualified;
|
||||
return *this;
|
||||
}
|
||||
|
||||
CarDealerScheme & operator=( CarDealerScheme && other )
|
||||
{
|
||||
if ( this == &other )
|
||||
return *this;
|
||||
theYear = std::move( other.theYear );
|
||||
theMonth = std::move( other.theMonth );
|
||||
carDealerCode = std::move( other.carDealerCode );
|
||||
manHourPrice = std::move( other.manHourPrice );
|
||||
partPrice = std::move( other.partPrice );
|
||||
claimSupport = std::move( other.claimSupport );
|
||||
scheme = std::move( other.scheme );
|
||||
isQualified = std::move( other.isQualified );
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
std::wstring getTheYear() const
|
||||
{
|
||||
return theYear;
|
||||
}
|
||||
|
||||
void setTheYear( const std::wstring & theYear )
|
||||
{
|
||||
this->theYear = theYear;
|
||||
}
|
||||
|
||||
std::wstring getTheMonth() const
|
||||
{
|
||||
return theMonth;
|
||||
}
|
||||
|
||||
void setTheMonth( const std::wstring & theMonth )
|
||||
{
|
||||
this->theMonth = theMonth;
|
||||
}
|
||||
|
||||
std::wstring getCarDealerCode() const
|
||||
{
|
||||
return carDealerCode;
|
||||
}
|
||||
|
||||
void setCarDealerCode( const std::wstring & carDealerCode )
|
||||
{
|
||||
this->carDealerCode = carDealerCode;
|
||||
}
|
||||
|
||||
std::wstring getManHourPrice() const
|
||||
{
|
||||
return manHourPrice;
|
||||
}
|
||||
|
||||
void setManHourPrice( const std::wstring & manHourPrice )
|
||||
{
|
||||
this->manHourPrice = manHourPrice;
|
||||
}
|
||||
|
||||
std::wstring getPartPrice() const
|
||||
{
|
||||
return partPrice;
|
||||
}
|
||||
|
||||
void setPartPrice( const std::wstring & partPrice )
|
||||
{
|
||||
this->partPrice = partPrice;
|
||||
}
|
||||
|
||||
std::wstring getClaimSupport() const
|
||||
{
|
||||
return claimSupport;
|
||||
}
|
||||
|
||||
void setClaimSupport( const std::wstring & claimSupport )
|
||||
{
|
||||
this->claimSupport = claimSupport;
|
||||
}
|
||||
|
||||
std::wstring getScheme() const
|
||||
{
|
||||
return scheme;
|
||||
}
|
||||
|
||||
void setScheme( const std::wstring & scheme )
|
||||
{
|
||||
this->scheme = scheme;
|
||||
}
|
||||
|
||||
std::wstring getIsQualified() const
|
||||
{
|
||||
return isQualified;
|
||||
}
|
||||
|
||||
void setIsQualified( const std::wstring & isQualified )
|
||||
{
|
||||
this->isQualified = isQualified;
|
||||
}
|
||||
|
||||
private:
|
||||
std::wstring theYear;
|
||||
std::wstring theMonth;
|
||||
std::wstring carDealerCode;
|
||||
std::wstring manHourPrice;
|
||||
std::wstring partPrice;
|
||||
std::wstring claimSupport; //理赔支持
|
||||
std::wstring scheme;
|
||||
std::wstring isQualified; //是否达成预期
|
||||
};
|
@@ -0,0 +1,2 @@
|
||||
|
||||
#include "RepairOrder.h"
|
@@ -0,0 +1,514 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
class RepairOrder
|
||||
{
|
||||
public:
|
||||
RepairOrder( std::wstring branchName,
|
||||
std::wstring orderNo,
|
||||
std::wstring orderType,
|
||||
std::wstring notifyNo,
|
||||
std::wstring damageArea,
|
||||
std::wstring damageDate,
|
||||
std::wstring generatingDate,
|
||||
std::wstring policyNo,
|
||||
std::wstring policyNoJqx,
|
||||
std::wstring plateNumber,
|
||||
std::wstring brandName,
|
||||
std::wstring isInsuranceObject,
|
||||
std::wstring isSuccess,
|
||||
std::wstring recommandDealerCode,
|
||||
std::wstring recommandDealerName,
|
||||
std::wstring recommandDealerCodeInNotify,
|
||||
std::wstring recommandDealerNameInNotify,
|
||||
std::wstring recommandDealerNameInSurvey,
|
||||
std::wstring agentName,
|
||||
std::wstring surveyor,
|
||||
std::wstring checkDate,
|
||||
std::wstring repairingStartDate,
|
||||
std::wstring repairingFinishDate,
|
||||
std::wstring status,
|
||||
std::wstring lostItemId,
|
||||
std::wstring surveyorRecommandStatus )
|
||||
: branchName( std::move( branchName ) ),
|
||||
orderNo( std::move( orderNo ) ),
|
||||
orderType( std::move( orderType ) ),
|
||||
notifyNo( std::move( notifyNo ) ),
|
||||
damageArea( std::move( damageArea ) ),
|
||||
damageDate( std::move( damageDate ) ),
|
||||
generatingDate( std::move( generatingDate ) ),
|
||||
policyNo( std::move( policyNo ) ),
|
||||
policyNoJQX( std::move( policyNoJqx ) ),
|
||||
plateNumber( std::move( plateNumber ) ),
|
||||
brandName( std::move( brandName ) ),
|
||||
isInsuranceObject( std::move( isInsuranceObject ) ),
|
||||
isSuccess( std::move( isSuccess ) ),
|
||||
recommandDealerCode( std::move( recommandDealerCode ) ),
|
||||
recommandDealerName( std::move( recommandDealerName ) ),
|
||||
recommandDealerCodeInNotify( std::move( recommandDealerCodeInNotify ) ),
|
||||
recommandDealerNameInNotify( std::move( recommandDealerNameInNotify ) ),
|
||||
recommandDealerNameInSurvey( std::move( recommandDealerNameInSurvey ) ),
|
||||
agentName( std::move( agentName ) ),
|
||||
surveyor( std::move( surveyor ) ),
|
||||
checkDate( std::move( checkDate ) ),
|
||||
repairingStartDate( std::move( repairingStartDate ) ),
|
||||
repairingFinishDate( std::move( repairingFinishDate ) ),
|
||||
status( std::move( status ) ),
|
||||
lostItemID( std::move( lostItemId ) ),
|
||||
surveyorRecommandStatus( std::move( surveyorRecommandStatus ) )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
RepairOrder( const RepairOrder & other )
|
||||
: branchName( other.branchName ),
|
||||
orderNo( other.orderNo ),
|
||||
orderType( other.orderType ),
|
||||
notifyNo( other.notifyNo ),
|
||||
damageArea( other.damageArea ),
|
||||
damageDate( other.damageDate ),
|
||||
generatingDate( other.generatingDate ),
|
||||
policyNo( other.policyNo ),
|
||||
policyNoJQX( other.policyNoJQX ),
|
||||
plateNumber( other.plateNumber ),
|
||||
brandName( other.brandName ),
|
||||
isInsuranceObject( other.isInsuranceObject ),
|
||||
isSuccess( other.isSuccess ),
|
||||
recommandDealerCode( other.recommandDealerCode ),
|
||||
recommandDealerName( other.recommandDealerName ),
|
||||
recommandDealerCodeInNotify( other.recommandDealerCodeInNotify ),
|
||||
recommandDealerNameInNotify( other.recommandDealerNameInNotify ),
|
||||
recommandDealerNameInSurvey( other.recommandDealerNameInSurvey ),
|
||||
agentName( other.agentName ),
|
||||
surveyor( other.surveyor ),
|
||||
checkDate( other.checkDate ),
|
||||
repairingStartDate( other.repairingStartDate ),
|
||||
repairingFinishDate( other.repairingFinishDate ),
|
||||
status( other.status ),
|
||||
lostItemID( other.lostItemID ),
|
||||
surveyorRecommandStatus( other.surveyorRecommandStatus )
|
||||
{
|
||||
}
|
||||
|
||||
RepairOrder( RepairOrder && other )
|
||||
: branchName( std::move( other.branchName ) ),
|
||||
orderNo( std::move( other.orderNo ) ),
|
||||
orderType( std::move( other.orderType ) ),
|
||||
notifyNo( std::move( other.notifyNo ) ),
|
||||
damageArea( std::move( other.damageArea ) ),
|
||||
damageDate( std::move( other.damageDate ) ),
|
||||
generatingDate( std::move( other.generatingDate ) ),
|
||||
policyNo( std::move( other.policyNo ) ),
|
||||
policyNoJQX( std::move( other.policyNoJQX ) ),
|
||||
plateNumber( std::move( other.plateNumber ) ),
|
||||
brandName( std::move( other.brandName ) ),
|
||||
isInsuranceObject( std::move( other.isInsuranceObject ) ),
|
||||
isSuccess( std::move( other.isSuccess ) ),
|
||||
recommandDealerCode( std::move( other.recommandDealerCode ) ),
|
||||
recommandDealerName( std::move( other.recommandDealerName ) ),
|
||||
recommandDealerCodeInNotify( std::move( other.recommandDealerCodeInNotify ) ),
|
||||
recommandDealerNameInNotify( std::move( other.recommandDealerNameInNotify ) ),
|
||||
recommandDealerNameInSurvey( std::move( other.recommandDealerNameInSurvey ) ),
|
||||
agentName( std::move( other.agentName ) ),
|
||||
surveyor( std::move( other.surveyor ) ),
|
||||
checkDate( std::move( other.checkDate ) ),
|
||||
repairingStartDate( std::move( other.repairingStartDate ) ),
|
||||
repairingFinishDate( std::move( other.repairingFinishDate ) ),
|
||||
status( std::move( other.status ) ),
|
||||
lostItemID( std::move( other.lostItemID ) ),
|
||||
surveyorRecommandStatus( std::move( other.surveyorRecommandStatus ) )
|
||||
{
|
||||
}
|
||||
|
||||
RepairOrder & operator=( const RepairOrder & other )
|
||||
{
|
||||
if ( this == &other )
|
||||
return *this;
|
||||
branchName = other.branchName;
|
||||
orderNo = other.orderNo;
|
||||
orderType = other.orderType;
|
||||
notifyNo = other.notifyNo;
|
||||
damageArea = other.damageArea;
|
||||
damageDate = other.damageDate;
|
||||
generatingDate = other.generatingDate;
|
||||
policyNo = other.policyNo;
|
||||
policyNoJQX = other.policyNoJQX;
|
||||
plateNumber = other.plateNumber;
|
||||
brandName = other.brandName;
|
||||
isInsuranceObject = other.isInsuranceObject;
|
||||
isSuccess = other.isSuccess;
|
||||
recommandDealerCode = other.recommandDealerCode;
|
||||
recommandDealerName = other.recommandDealerName;
|
||||
recommandDealerCodeInNotify = other.recommandDealerCodeInNotify;
|
||||
recommandDealerNameInNotify = other.recommandDealerNameInNotify;
|
||||
recommandDealerNameInSurvey = other.recommandDealerNameInSurvey;
|
||||
agentName = other.agentName;
|
||||
surveyor = other.surveyor;
|
||||
checkDate = other.checkDate;
|
||||
repairingStartDate = other.repairingStartDate;
|
||||
repairingFinishDate = other.repairingFinishDate;
|
||||
status = other.status;
|
||||
lostItemID = other.lostItemID;
|
||||
surveyorRecommandStatus = other.surveyorRecommandStatus;
|
||||
return *this;
|
||||
}
|
||||
|
||||
RepairOrder & operator=( RepairOrder && other )
|
||||
{
|
||||
if ( this == &other )
|
||||
return *this;
|
||||
branchName = std::move( other.branchName );
|
||||
orderNo = std::move( other.orderNo );
|
||||
orderType = std::move( other.orderType );
|
||||
notifyNo = std::move( other.notifyNo );
|
||||
damageArea = std::move( other.damageArea );
|
||||
damageDate = std::move( other.damageDate );
|
||||
generatingDate = std::move( other.generatingDate );
|
||||
policyNo = std::move( other.policyNo );
|
||||
policyNoJQX = std::move( other.policyNoJQX );
|
||||
plateNumber = std::move( other.plateNumber );
|
||||
brandName = std::move( other.brandName );
|
||||
isInsuranceObject = std::move( other.isInsuranceObject );
|
||||
isSuccess = std::move( other.isSuccess );
|
||||
recommandDealerCode = std::move( other.recommandDealerCode );
|
||||
recommandDealerName = std::move( other.recommandDealerName );
|
||||
recommandDealerCodeInNotify = std::move( other.recommandDealerCodeInNotify );
|
||||
recommandDealerNameInNotify = std::move( other.recommandDealerNameInNotify );
|
||||
recommandDealerNameInSurvey = std::move( other.recommandDealerNameInSurvey );
|
||||
agentName = std::move( other.agentName );
|
||||
surveyor = std::move( other.surveyor );
|
||||
checkDate = std::move( other.checkDate );
|
||||
repairingStartDate = std::move( other.repairingStartDate );
|
||||
repairingFinishDate = std::move( other.repairingFinishDate );
|
||||
status = std::move( other.status );
|
||||
lostItemID = std::move( other.lostItemID );
|
||||
surveyorRecommandStatus = std::move( other.surveyorRecommandStatus );
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
friend bool operator==( const RepairOrder & lhs, const RepairOrder & rhs )
|
||||
{
|
||||
return lhs.branchName == rhs.branchName
|
||||
&& lhs.orderNo == rhs.orderNo
|
||||
&& lhs.orderType == rhs.orderType
|
||||
&& lhs.notifyNo == rhs.notifyNo
|
||||
&& lhs.damageArea == rhs.damageArea
|
||||
&& lhs.damageDate == rhs.damageDate
|
||||
&& lhs.generatingDate == rhs.generatingDate
|
||||
&& lhs.policyNo == rhs.policyNo
|
||||
&& lhs.policyNoJQX == rhs.policyNoJQX
|
||||
&& lhs.plateNumber == rhs.plateNumber
|
||||
&& lhs.brandName == rhs.brandName
|
||||
&& lhs.isInsuranceObject == rhs.isInsuranceObject
|
||||
&& lhs.isSuccess == rhs.isSuccess
|
||||
&& lhs.recommandDealerCode == rhs.recommandDealerCode
|
||||
&& lhs.recommandDealerName == rhs.recommandDealerName
|
||||
&& lhs.recommandDealerCodeInNotify == rhs.recommandDealerCodeInNotify
|
||||
&& lhs.recommandDealerNameInNotify == rhs.recommandDealerNameInNotify
|
||||
&& lhs.recommandDealerNameInSurvey == rhs.recommandDealerNameInSurvey
|
||||
&& lhs.agentName == rhs.agentName
|
||||
&& lhs.surveyor == rhs.surveyor
|
||||
&& lhs.checkDate == rhs.checkDate
|
||||
&& lhs.repairingStartDate == rhs.repairingStartDate
|
||||
&& lhs.repairingFinishDate == rhs.repairingFinishDate
|
||||
&& lhs.status == rhs.status
|
||||
&& lhs.lostItemID == rhs.lostItemID
|
||||
&& lhs.surveyorRecommandStatus == rhs.surveyorRecommandStatus;
|
||||
}
|
||||
|
||||
friend bool operator!=( const RepairOrder & lhs, const RepairOrder & rhs )
|
||||
{
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
|
||||
std::wstring getBranchName() const
|
||||
{
|
||||
return branchName;
|
||||
}
|
||||
|
||||
void setBranchName( const std::wstring & branchName )
|
||||
{
|
||||
this->branchName = branchName;
|
||||
}
|
||||
|
||||
std::wstring getOrderNo() const
|
||||
{
|
||||
return orderNo;
|
||||
}
|
||||
|
||||
void setOrderNo( const std::wstring & orderNo )
|
||||
{
|
||||
this->orderNo = orderNo;
|
||||
}
|
||||
|
||||
std::wstring getOrderType() const
|
||||
{
|
||||
return orderType;
|
||||
}
|
||||
|
||||
void setOrderType( const std::wstring & orderType )
|
||||
{
|
||||
this->orderType = orderType;
|
||||
}
|
||||
|
||||
std::wstring getNotifyNo() const
|
||||
{
|
||||
return notifyNo;
|
||||
}
|
||||
|
||||
void setNotifyNo( const std::wstring & notifyNo )
|
||||
{
|
||||
this->notifyNo = notifyNo;
|
||||
}
|
||||
|
||||
std::wstring getDamageArea() const
|
||||
{
|
||||
return damageArea;
|
||||
}
|
||||
|
||||
void setDamageArea( const std::wstring & damageArea )
|
||||
{
|
||||
this->damageArea = damageArea;
|
||||
}
|
||||
|
||||
std::wstring getDamageDate() const
|
||||
{
|
||||
return damageDate;
|
||||
}
|
||||
|
||||
void setDamageDate( const std::wstring & damageDate )
|
||||
{
|
||||
this->damageDate = damageDate;
|
||||
}
|
||||
|
||||
std::wstring getGeneratingDate() const
|
||||
{
|
||||
return generatingDate;
|
||||
}
|
||||
|
||||
void setGeneratingDate( const std::wstring & generatingDate )
|
||||
{
|
||||
this->generatingDate = generatingDate;
|
||||
}
|
||||
|
||||
std::wstring getPolicyNo() const
|
||||
{
|
||||
return policyNo;
|
||||
}
|
||||
|
||||
void setPolicyNo( const std::wstring & policyNo )
|
||||
{
|
||||
this->policyNo = policyNo;
|
||||
}
|
||||
|
||||
std::wstring getPolicyNoJqx() const
|
||||
{
|
||||
return policyNoJQX;
|
||||
}
|
||||
|
||||
void setPolicyNoJqx( const std::wstring & policyNoJqx )
|
||||
{
|
||||
policyNoJQX = policyNoJqx;
|
||||
}
|
||||
|
||||
std::wstring getPlateNumber() const
|
||||
{
|
||||
return plateNumber;
|
||||
}
|
||||
|
||||
void setPlateNumber( const std::wstring & plateNumber )
|
||||
{
|
||||
this->plateNumber = plateNumber;
|
||||
}
|
||||
|
||||
std::wstring getBrandName() const
|
||||
{
|
||||
return brandName;
|
||||
}
|
||||
|
||||
void setBrandName( const std::wstring & brandName )
|
||||
{
|
||||
this->brandName = brandName;
|
||||
}
|
||||
|
||||
std::wstring getIsInsuranceObject() const
|
||||
{
|
||||
return isInsuranceObject;
|
||||
}
|
||||
|
||||
void setIsInsuranceObject( const std::wstring & isInsuranceObject )
|
||||
{
|
||||
this->isInsuranceObject = isInsuranceObject;
|
||||
}
|
||||
|
||||
std::wstring getIsSuccess() const
|
||||
{
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
void setIsSuccess( const std::wstring & isSuccess )
|
||||
{
|
||||
this->isSuccess = isSuccess;
|
||||
}
|
||||
|
||||
std::wstring getRecommandDealerCode() const
|
||||
{
|
||||
return recommandDealerCode;
|
||||
}
|
||||
|
||||
void setRecommandDealerCode( const std::wstring & recommandDealerCode )
|
||||
{
|
||||
this->recommandDealerCode = recommandDealerCode;
|
||||
}
|
||||
|
||||
std::wstring getRecommandDealerName() const
|
||||
{
|
||||
return recommandDealerName;
|
||||
}
|
||||
|
||||
void setRecommandDealerName( const std::wstring & recommandDealerName )
|
||||
{
|
||||
this->recommandDealerName = recommandDealerName;
|
||||
}
|
||||
|
||||
std::wstring getRecommandDealerCodeInNotify() const
|
||||
{
|
||||
return recommandDealerCodeInNotify;
|
||||
}
|
||||
|
||||
void setRecommandDealerCodeInNotify( const std::wstring & recommandDealerCodeInNotify )
|
||||
{
|
||||
this->recommandDealerCodeInNotify = recommandDealerCodeInNotify;
|
||||
}
|
||||
|
||||
std::wstring getRecommandDealerNameInNotify() const
|
||||
{
|
||||
return recommandDealerNameInNotify;
|
||||
}
|
||||
|
||||
void setRecommandDealerNameInNotify( const std::wstring & recommandDealerNameInNotify )
|
||||
{
|
||||
this->recommandDealerNameInNotify = recommandDealerNameInNotify;
|
||||
}
|
||||
|
||||
std::wstring getRecommandDealerNameInSurvey() const
|
||||
{
|
||||
return recommandDealerNameInSurvey;
|
||||
}
|
||||
|
||||
void setRecommandDealerNameInSurvey( const std::wstring & recommandDealerNameInSurvey )
|
||||
{
|
||||
this->recommandDealerNameInSurvey = recommandDealerNameInSurvey;
|
||||
}
|
||||
|
||||
std::wstring getAgentName() const
|
||||
{
|
||||
return agentName;
|
||||
}
|
||||
|
||||
void setAgentName( const std::wstring & agentName )
|
||||
{
|
||||
this->agentName = agentName;
|
||||
}
|
||||
|
||||
std::wstring getSurveyor() const
|
||||
{
|
||||
return surveyor;
|
||||
}
|
||||
|
||||
void setSurveyor( const std::wstring & surveyor )
|
||||
{
|
||||
this->surveyor = surveyor;
|
||||
}
|
||||
|
||||
std::wstring getCheckDate() const
|
||||
{
|
||||
return checkDate;
|
||||
}
|
||||
|
||||
void setCheckDate( const std::wstring & checkDate )
|
||||
{
|
||||
this->checkDate = checkDate;
|
||||
}
|
||||
|
||||
std::wstring getRepairingStartDate() const
|
||||
{
|
||||
return repairingStartDate;
|
||||
}
|
||||
|
||||
void setRepairingStartDate( const std::wstring & repairingStartDate )
|
||||
{
|
||||
this->repairingStartDate = repairingStartDate;
|
||||
}
|
||||
|
||||
std::wstring getRepairingFinishDate() const
|
||||
{
|
||||
return repairingFinishDate;
|
||||
}
|
||||
|
||||
void setRepairingFinishDate( const std::wstring & repairingFinishDate )
|
||||
{
|
||||
this->repairingFinishDate = repairingFinishDate;
|
||||
}
|
||||
|
||||
std::wstring getStatus() const
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
void setStatus( const std::wstring & status )
|
||||
{
|
||||
this->status = status;
|
||||
}
|
||||
|
||||
std::wstring getLostItemId() const
|
||||
{
|
||||
return lostItemID;
|
||||
}
|
||||
|
||||
void setLostItemId( const std::wstring & lostItemId )
|
||||
{
|
||||
lostItemID = lostItemId;
|
||||
}
|
||||
|
||||
std::wstring getSurveyorRecommandStatus() const
|
||||
{
|
||||
return surveyorRecommandStatus;
|
||||
}
|
||||
|
||||
void setSurveyorRecommandStatus( const std::wstring & surveyorRecommandStatus )
|
||||
{
|
||||
this->surveyorRecommandStatus = surveyorRecommandStatus;
|
||||
}
|
||||
|
||||
private:
|
||||
std::wstring branchName;
|
||||
std::wstring orderNo;
|
||||
std::wstring orderType;
|
||||
std::wstring notifyNo;
|
||||
std::wstring damageArea;
|
||||
std::wstring damageDate;
|
||||
std::wstring generatingDate;
|
||||
std::wstring policyNo;
|
||||
std::wstring policyNoJQX;
|
||||
std::wstring plateNumber;
|
||||
std::wstring brandName;
|
||||
std::wstring isInsuranceObject;
|
||||
std::wstring isSuccess;
|
||||
std::wstring recommandDealerCode;
|
||||
std::wstring recommandDealerName;
|
||||
std::wstring recommandDealerCodeInNotify;
|
||||
std::wstring recommandDealerNameInNotify;
|
||||
std::wstring recommandDealerNameInSurvey;
|
||||
std::wstring agentName;
|
||||
std::wstring surveyor; //查勘员
|
||||
std::wstring checkDate;
|
||||
std::wstring repairingStartDate;
|
||||
std::wstring repairingFinishDate;
|
||||
std::wstring status;
|
||||
std::wstring lostItemID;
|
||||
std::wstring surveyorRecommandStatus;
|
||||
};
|
@@ -0,0 +1,225 @@
|
||||
#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;
|
||||
}
|
||||
|
||||
std::wstring getOrderNo() const
|
||||
{
|
||||
return orderNo_;
|
||||
}
|
||||
|
||||
void setOrderNo( const std::wstring & orderNo )
|
||||
{
|
||||
orderNo_ = orderNo;
|
||||
}
|
||||
|
||||
std::wstring getOrderType() const
|
||||
{
|
||||
return orderType_;
|
||||
}
|
||||
|
||||
void setOrderType( const std::wstring & orderType )
|
||||
{
|
||||
orderType_ = orderType;
|
||||
}
|
||||
|
||||
std::wstring getNotifyNo() const
|
||||
{
|
||||
return notifyNo_;
|
||||
}
|
||||
|
||||
void setNotifyNo( const std::wstring & notifyNo )
|
||||
{
|
||||
notifyNo_ = notifyNo;
|
||||
}
|
||||
|
||||
std::wstring getSuggestedCarDealerCode() const
|
||||
{
|
||||
return suggestedCarDealerCode_;
|
||||
}
|
||||
|
||||
void setSuggestedCarDealerCode( const std::wstring & suggestedCarDealerCode )
|
||||
{
|
||||
suggestedCarDealerCode_ = suggestedCarDealerCode;
|
||||
}
|
||||
|
||||
std::wstring getSuggestedCarDealerName() const
|
||||
{
|
||||
return suggestedCarDealerName_;
|
||||
}
|
||||
|
||||
void setSuggestedCarDealerName( const std::wstring & suggestedCarDealerName )
|
||||
{
|
||||
suggestedCarDealerName_ = suggestedCarDealerName;
|
||||
}
|
||||
|
||||
std::wstring getDamageDate() const
|
||||
{
|
||||
return damageDate_;
|
||||
}
|
||||
|
||||
void setDamageDate( const std::wstring & damageDate )
|
||||
{
|
||||
damageDate_ = damageDate;
|
||||
}
|
||||
|
||||
std::wstring getPlateNumber() const
|
||||
{
|
||||
return plateNumber_;
|
||||
}
|
||||
|
||||
void setPlateNumber( const std::wstring & plateNumber )
|
||||
{
|
||||
plateNumber_ = plateNumber;
|
||||
}
|
||||
|
||||
std::wstring getBrandName() const
|
||||
{
|
||||
return brandName_;
|
||||
}
|
||||
|
||||
void setBrandName( const std::wstring & brandName )
|
||||
{
|
||||
brandName_ = brandName;
|
||||
}
|
||||
|
||||
std::wstring getMessageType() const
|
||||
{
|
||||
return messageType_;
|
||||
}
|
||||
|
||||
void setMessageType( const std::wstring & messageType )
|
||||
{
|
||||
messageType_ = messageType;
|
||||
}
|
||||
|
||||
std::wstring getMessageSendingDate() const
|
||||
{
|
||||
return messageSendingDate_;
|
||||
}
|
||||
|
||||
void setMessageSendingDate( const std::wstring & messageSendingDate )
|
||||
{
|
||||
messageSendingDate_ = messageSendingDate;
|
||||
}
|
||||
|
||||
std::wstring getDataSource() const
|
||||
{
|
||||
return dataSource_;
|
||||
}
|
||||
|
||||
void setDataSource( const std::wstring & dataSource )
|
||||
{
|
||||
dataSource_ = dataSource;
|
||||
}
|
||||
|
||||
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_;
|
||||
};
|
@@ -0,0 +1,2 @@
|
||||
|
||||
#include "UserInfo.h"
|
@@ -0,0 +1,97 @@
|
||||
//用户信息相关
|
||||
#pragma once
|
||||
#include <QString>
|
||||
|
||||
class UserInfo
|
||||
{
|
||||
public:
|
||||
|
||||
UserInfo( const std::string & staffP13,
|
||||
const std::string & staffName,
|
||||
const std::string & staffPost )
|
||||
: staff_p13( staffP13 ),
|
||||
staff_name( staffName ),
|
||||
staff_post( staffPost )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
UserInfo( const UserInfo & other )
|
||||
: staff_p13( other.staff_p13 ),
|
||||
staff_name( other.staff_name ),
|
||||
staff_post( other.staff_post )
|
||||
{
|
||||
}
|
||||
|
||||
UserInfo( UserInfo && other )
|
||||
: staff_p13( std::move(other.staff_p13) ),
|
||||
staff_name( std::move(other.staff_name) ),
|
||||
staff_post( std::move(other.staff_post) )
|
||||
{
|
||||
}
|
||||
|
||||
UserInfo & operator=( const UserInfo & other )
|
||||
{
|
||||
if ( this == &other )
|
||||
return *this;
|
||||
staff_p13 = other.staff_p13;
|
||||
staff_name = other.staff_name;
|
||||
staff_post = other.staff_post;
|
||||
return *this;
|
||||
}
|
||||
|
||||
UserInfo & operator=( UserInfo && other )
|
||||
{
|
||||
if ( this == &other )
|
||||
return *this;
|
||||
staff_p13 = std::move( other.staff_p13 );
|
||||
staff_name = std::move( other.staff_name );
|
||||
staff_post = std::move( other.staff_post );
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
friend void swap( UserInfo & lhs, UserInfo & rhs ) noexcept
|
||||
{
|
||||
using std::swap;
|
||||
swap( lhs.staff_p13, rhs.staff_p13 );
|
||||
swap( lhs.staff_name, rhs.staff_name );
|
||||
swap( lhs.staff_post, rhs.staff_post );
|
||||
}
|
||||
|
||||
|
||||
std::string getStaffP13() const
|
||||
{
|
||||
return staff_p13;
|
||||
}
|
||||
|
||||
void setStaffP13( const std::string & staffP13 )
|
||||
{
|
||||
staff_p13 = staffP13;
|
||||
}
|
||||
|
||||
std::string getStaffName() const
|
||||
{
|
||||
return staff_name;
|
||||
}
|
||||
|
||||
void setStaffName( const std::string & staffName )
|
||||
{
|
||||
staff_name = staffName;
|
||||
}
|
||||
|
||||
std::string getStaffPost() const
|
||||
{
|
||||
return staff_post;
|
||||
}
|
||||
|
||||
void setStaffPost( const std::string & staffPost )
|
||||
{
|
||||
staff_post = staffPost;
|
||||
}
|
||||
|
||||
private:
|
||||
std::string staff_p13;
|
||||
std::string staff_name;
|
||||
std::string staff_post;
|
||||
};
|
@@ -0,0 +1,3 @@
|
||||
|
||||
#include "新送返修监控报表.h"
|
||||
|
@@ -0,0 +1,165 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
typedef struct NewRepairMonitorReportRecord_
|
||||
{
|
||||
std::wstring 分公司名称_;
|
||||
std::wstring 部门组名称_;
|
||||
std::wstring 报案号_;
|
||||
std::wstring 报案日期_;
|
||||
std::wstring 出险日期_;
|
||||
std::wstring 出险地点_;
|
||||
std::wstring 事故车目前位置_;
|
||||
std::wstring 车损序号_;
|
||||
std::wstring 车牌_;
|
||||
std::wstring vin码_;
|
||||
std::wstring 车龄_;
|
||||
std::wstring 品牌代码_;
|
||||
std::wstring 品牌名称_;
|
||||
std::wstring 车系名称_;
|
||||
std::wstring 使用性质名称_;
|
||||
std::wstring 保单号_;
|
||||
std::wstring 标的车_三者车_;
|
||||
std::wstring 是否9座以下企业用车_行政用车_家庭自用车_;
|
||||
std::wstring 核价金额_;
|
||||
std::wstring 核损配件核损金额_;
|
||||
std::wstring 核损工时费核损金额_;
|
||||
std::wstring 核损辅料核损金额_;
|
||||
std::wstring 核损外修费核损金额_;
|
||||
std::wstring 核损施救费核损金额_;
|
||||
std::wstring 结案金额_;
|
||||
std::wstring 结案配件核损金额_;
|
||||
std::wstring 结案工时费核损金额_;
|
||||
std::wstring 结案辅料核损金额_;
|
||||
std::wstring 结案外修费核损金额_;
|
||||
std::wstring 结案施救费核损金额_;
|
||||
std::wstring 接报案人分公司名称_;
|
||||
std::wstring 接报案人工号_;
|
||||
std::wstring 接报案人名称_;
|
||||
std::wstring 第一任务分派时间_;
|
||||
std::wstring 第一定损员分公司_;
|
||||
std::wstring 第一定损员部门组名称_;
|
||||
std::wstring 第一定损员代码_;
|
||||
std::wstring 第一定损员名称_;
|
||||
std::wstring 第一车商是否已阅读_;
|
||||
std::wstring 第一车上是否预约进厂_;
|
||||
std::wstring 第一车商是否推荐失败_;
|
||||
std::wstring 第一车商是否进厂确认_;
|
||||
std::wstring 第一车商是否出场确认_;
|
||||
std::wstring 第二任务分派时间_;
|
||||
std::wstring 第二定损员分公司_;
|
||||
std::wstring 第二定损员部门组名称_;
|
||||
std::wstring 第二定损员代码_;
|
||||
std::wstring 第二定损员名称_;
|
||||
std::wstring 第二车商是否已阅读_;
|
||||
std::wstring 第二车上是否预约进厂_;
|
||||
std::wstring 第二车商是否推荐失败_;
|
||||
std::wstring 第二车商是否进厂确认_;
|
||||
std::wstring 第二车商是否出场确认_;
|
||||
std::wstring 第三任务分派时间_;
|
||||
std::wstring 第三定损员分公司_;
|
||||
std::wstring 第三定损员部门组名称_;
|
||||
std::wstring 第三定损员代码_;
|
||||
std::wstring 第三定损员名称_;
|
||||
std::wstring 第三车商是否已阅读_;
|
||||
std::wstring 第三车上是否预约进厂_;
|
||||
std::wstring 第三车商是否推荐失败_;
|
||||
std::wstring 第三车商是否进厂确认_;
|
||||
std::wstring 第三车商是否出场确认_;
|
||||
std::wstring 其他查勘员信息_;
|
||||
std::wstring 是否推荐_;
|
||||
std::wstring 是否存在工单_;
|
||||
std::wstring 工单类型_;
|
||||
std::wstring 查勘员操作类型_;
|
||||
std::wstring 案件状态名称_;
|
||||
std::wstring 车状_当前状态_;
|
||||
std::wstring 车状_报案环节_;
|
||||
std::wstring 车状_现场推荐环节_;
|
||||
std::wstring 车状_核价通过环节_;
|
||||
std::wstring 车状_结案环节_;
|
||||
std::wstring 承保车商代码_;
|
||||
std::wstring 承保车商名称_;
|
||||
std::wstring 报案车商分公司名称_;
|
||||
std::wstring 报案车商部门组名称_;
|
||||
std::wstring 报案车商代码_;
|
||||
std::wstring 报案车商名称_;
|
||||
std::wstring 现场推荐车商分公司名称_;
|
||||
std::wstring 现场推荐车商代码_;
|
||||
std::wstring 现场推荐车商名称_;
|
||||
std::wstring 核价车商分公司名称_;
|
||||
std::wstring 核价车商部门组名称_;
|
||||
std::wstring 核价车商代码_;
|
||||
std::wstring 核价车商名称_;
|
||||
std::wstring 推荐车商与核价车商是否一致_;
|
||||
std::wstring 核价修理厂归属公司代码_;
|
||||
std::wstring 核价修理厂归属公司名称_;
|
||||
std::wstring 核价修理厂_;
|
||||
std::wstring 核价修理厂名称_;
|
||||
std::wstring 估损单号_;
|
||||
std::wstring 核价通过时间_;
|
||||
std::wstring 定损员机构_;
|
||||
std::wstring 定损员代码_;
|
||||
std::wstring 定损员名称_;
|
||||
std::wstring 结案车商分公司_;
|
||||
std::wstring 结案车商部门组名称_;
|
||||
std::wstring 结案车商代码_;
|
||||
std::wstring 结案车商名称_;
|
||||
std::wstring 推荐车商与结案车商是否一致_;
|
||||
std::wstring 结案修理厂归属公司代码_;
|
||||
std::wstring 结案修理厂归属公司名称_;
|
||||
std::wstring 结案修理厂代码_;
|
||||
std::wstring 结案修理厂名称_;
|
||||
std::wstring 车辆进厂时间_;
|
||||
std::wstring 车辆出厂时间_;
|
||||
std::wstring 结案时间_;
|
||||
std::wstring 事故经过_;
|
||||
std::wstring 数据更新日期_;
|
||||
std::wstring 备注_;
|
||||
std::wstring 估损单模板_;
|
||||
std::wstring 返修开关_报案_;
|
||||
std::wstring 送修开关_报案_;
|
||||
std::wstring 返修开关_核价_;
|
||||
std::wstring 送修开关_核价_;
|
||||
std::wstring 返修开关_结案_;
|
||||
std::wstring 送修开关_结案_;
|
||||
std::wstring 查勘员分公司名称_;
|
||||
std::wstring 查勘员代码_;
|
||||
std::wstring 查勘员名称_;
|
||||
std::wstring 核价修理厂归属中支_;
|
||||
std::wstring 结案修理厂归属中支_;
|
||||
std::wstring 是否诉讼_;
|
||||
std::wstring 座席推荐分公司代码_;
|
||||
std::wstring 座席推荐分公司名称_;
|
||||
std::wstring 座席推荐车商名代码_;
|
||||
std::wstring 座席推荐车商名称_;
|
||||
std::wstring 座席推荐操作类型_;
|
||||
std::wstring 座席推荐排名_;
|
||||
std::wstring 第一次推荐分公司代码_;
|
||||
std::wstring 第一次推荐分公司名称_;
|
||||
std::wstring 第一次推荐车商代码_;
|
||||
std::wstring 第一次推荐车商名称_;
|
||||
std::wstring 第一次推荐工具_;
|
||||
std::wstring 第一次推荐操作类型_;
|
||||
std::wstring 第一次推荐排名_其他推荐信息_;
|
||||
std::wstring 第二次推荐分公司代码_;
|
||||
std::wstring 第二次推荐分公司名称_;
|
||||
std::wstring 第二次推荐车商代码_;
|
||||
std::wstring 第二次推荐车商名称_;
|
||||
std::wstring 第二次推荐工具_;
|
||||
std::wstring 第二次推荐操作类型_;
|
||||
std::wstring 第二次推荐排名_其他推荐信息_;
|
||||
std::wstring 第三次推荐分公司代码_;
|
||||
std::wstring 第三次推荐分公司名称_;
|
||||
std::wstring 第三次推荐车商代码_;
|
||||
std::wstring 第三次推荐车商名称_;
|
||||
std::wstring 第三次推荐工具_;
|
||||
std::wstring 第三次推荐操作类型_;
|
||||
std::wstring 第三次推荐排名_其他推荐信息_;
|
||||
std::wstring 其他推荐信息_;
|
||||
std::wstring 推荐失败具体原因_;
|
||||
std::wstring 是否现场报案_;
|
||||
std::wstring 报案地点_;
|
||||
std::wstring 是否在厂报案_;
|
||||
} NewRepairMonitorReportRecord;
|
165
code/cpp/car_dealer_util/source/Data/excel/excel.cpp
Normal file
@@ -0,0 +1,165 @@
|
||||
#include <string>
|
||||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
#include <stdexcept>
|
||||
#include "excel.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace libxl;
|
||||
|
||||
void setKey( libxl::Book * pBook )
|
||||
{
|
||||
if ( pBook != nullptr )
|
||||
{
|
||||
pBook->setKey( L"cpic", L"windows-202d21040bc4e70060bc6264a6ucu7i1" );
|
||||
}
|
||||
}
|
||||
|
||||
void setKey( libxl::IBookT<char> * pBook )
|
||||
{
|
||||
if (pBook != nullptr)
|
||||
{
|
||||
pBook->setKey("cpic", "windows-202d21040bc4e70060bc6264a6ucu7i1");
|
||||
}
|
||||
}
|
||||
|
||||
std::wstring ReadCellStringFromXlsx( libxl::IBookT<wchar_t> * pBook,
|
||||
unsigned int sheetIndex,
|
||||
unsigned int rowIndex,
|
||||
unsigned int colIndex,
|
||||
bool isInteger )
|
||||
{
|
||||
using namespace libxl;
|
||||
|
||||
std::wstring returnValue;
|
||||
|
||||
int year = 0;
|
||||
int month = 0;
|
||||
int day = 0;
|
||||
int hour = 0;
|
||||
int min = 0;
|
||||
int second = 0;
|
||||
|
||||
//验证
|
||||
if ( pBook == nullptr )
|
||||
{
|
||||
throw std::logic_error( "ReadCellStringFromXlsx pSheet参数错误!" );
|
||||
}
|
||||
|
||||
ISheetT<wchar_t> * pSheet = pBook->getSheet( sheetIndex );
|
||||
CellType cellType = pSheet->cellType( rowIndex, colIndex );
|
||||
|
||||
//判断单元格类型
|
||||
switch ( cellType )
|
||||
{
|
||||
case CellType::CELLTYPE_BOOLEAN: //bool类型
|
||||
{
|
||||
returnValue = pSheet->readBool( rowIndex, colIndex ) ? L"true" : L"false";
|
||||
|
||||
break;
|
||||
}
|
||||
case CellType::CELLTYPE_NUMBER: //数字类型,还得再判断一下是不是日期类型
|
||||
{
|
||||
double cellValue = pSheet->readNum( rowIndex, colIndex );
|
||||
wchar_t buffer[50]; //生成字符串的缓冲区
|
||||
|
||||
if ( pSheet->isDate( rowIndex, colIndex ) == true )
|
||||
{
|
||||
//是日期类型
|
||||
if ( pBook->dateUnpack( cellValue,
|
||||
&year,
|
||||
&month,
|
||||
&day,
|
||||
&hour,
|
||||
&min,
|
||||
&second ) == false )
|
||||
{
|
||||
throw std::runtime_error( "转换日期格式失败!" );
|
||||
}
|
||||
|
||||
//排除bug
|
||||
if ( min >= 60 )
|
||||
{
|
||||
hour = hour + 1;
|
||||
min = min - 60;
|
||||
}
|
||||
|
||||
// if ( hour >= 24 )
|
||||
// {
|
||||
// day = day + 1;
|
||||
// hour = hour - 24;
|
||||
// }
|
||||
//
|
||||
// switch ( month )
|
||||
// {
|
||||
// case 1:
|
||||
// case 3:
|
||||
// case
|
||||
// }
|
||||
|
||||
wsprintfW( buffer, L"%d-%.2d-%.2d %.2d:%.2d:%.2d", year, month, day, hour, min, second );
|
||||
}
|
||||
else
|
||||
{
|
||||
//是数字类型, 根据isInteger参数选择输出整型或者浮点型
|
||||
if ( isInteger == true )
|
||||
{
|
||||
wsprintfW( buffer, L"%d", static_cast<long>(cellValue) );
|
||||
}
|
||||
else
|
||||
{
|
||||
wsprintfW( buffer, L"%f", cellValue );
|
||||
}
|
||||
}
|
||||
|
||||
returnValue = buffer;
|
||||
|
||||
break;
|
||||
}
|
||||
case CELLTYPE_STRING: //字符串类型,要先判断一下读取的结果是不是空值
|
||||
{
|
||||
const wchar_t * pValue = pSheet->readStr( rowIndex, colIndex );
|
||||
|
||||
if ( pValue != nullptr )
|
||||
{
|
||||
returnValue = pValue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
libxl::Sheet * getXlsxSheetByName( libxl::IBookT<wchar_t> * pBook, const std::wstring & sheetName )
|
||||
{
|
||||
Sheet * pSheet = nullptr;
|
||||
Sheet * pCurrentSheet = nullptr;
|
||||
|
||||
if ( pBook == nullptr )
|
||||
{
|
||||
throw logic_error( "参数错误!" );
|
||||
}
|
||||
|
||||
int sheetCount = pBook->sheetCount();
|
||||
int sheetIndex = 0;
|
||||
|
||||
while ( sheetIndex < sheetCount )
|
||||
{
|
||||
pCurrentSheet = pBook->getSheet( sheetIndex );
|
||||
|
||||
wstring currentSheetName = pCurrentSheet->name();
|
||||
|
||||
if ( currentSheetName == sheetName )
|
||||
{
|
||||
pSheet = pCurrentSheet;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
sheetIndex++;
|
||||
}
|
||||
|
||||
return pSheet;
|
||||
}
|
37
code/cpp/car_dealer_util/source/Data/excel/excel.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#pragma once
|
||||
#ifndef EXCEL_H_
|
||||
#define EXCEL_H_
|
||||
|
||||
#include <libxl.h>
|
||||
|
||||
/************************************************
|
||||
* \brief 注册libxl产品
|
||||
* \param pBook
|
||||
************************************************/
|
||||
void setKey( libxl::Book * pBook );
|
||||
void setKey( libxl::IBookT<char> * pBook );
|
||||
|
||||
/************************************************
|
||||
* \brief 从xlsx文件单元格中读取数据,以字符串为返回值。
|
||||
* \param pBook libxl的Book对象。
|
||||
* \param sheetIndex sheet的索引值
|
||||
* \param rowIndex 行号
|
||||
* \param colIndex 列号
|
||||
* \param isInteger 单元格为数字类型时,选择是输出整形还是浮点型字符串
|
||||
* \return 返回的字符串
|
||||
************************************************/
|
||||
std::wstring ReadCellStringFromXlsx( libxl::IBookT<wchar_t> * pBook,
|
||||
unsigned int sheetIndex,
|
||||
unsigned int rowIndex,
|
||||
unsigned int colIndex,
|
||||
bool isInteger );
|
||||
|
||||
/************************************************
|
||||
* \brief 通过名称获取sheet
|
||||
* \param sheetName
|
||||
* \return
|
||||
************************************************/
|
||||
libxl::Sheet * getXlsxSheetByName( libxl::IBookT<wchar_t> * pBook, const std::wstring & sheetName );
|
||||
|
||||
|
||||
#endif
|
87
code/cpp/car_dealer_util/source/Data/query/query_user.cpp
Normal file
@@ -0,0 +1,87 @@
|
||||
#include "query_user.h"
|
||||
|
||||
#include <stdexcept>
|
||||
#include <ocilib.h>
|
||||
#include "../../db/ocilib/db_oper.h"
|
||||
#include "../Datastructure/UserInfo/UserInfo.h"
|
||||
#include <ocilib.hpp>
|
||||
|
||||
using namespace std;
|
||||
|
||||
UserInfo queryUserInfo( const string & userName,
|
||||
const string & password,
|
||||
const string & tnsName,
|
||||
const string & staffP13 )
|
||||
{
|
||||
OCI_Connection * pConn = nullptr;
|
||||
OCI_Statement * pStmt = nullptr;
|
||||
OCI_Resultset * pResult = nullptr;
|
||||
int returnCode = 0;
|
||||
|
||||
|
||||
string sqlQueryStaff =
|
||||
"SELECT a.staff_p13, a.staff_name, b.staff_post \n"
|
||||
"FROM staff_info a, \n"
|
||||
"staff_post_code b \n"
|
||||
"WHERE a.staff_post_code = b.staff_post_code \n"
|
||||
"AND a.staff_p13 = :p13";
|
||||
|
||||
returnCode = OCI_Initialize( l_error_handler, nullptr, OCI_ENV_DEFAULT );
|
||||
|
||||
if ( static_cast<bool>(returnCode) == false )
|
||||
{
|
||||
string errorMessage( "ocilib初始化错误:" );
|
||||
errorMessage.append( get_last_error_message() );
|
||||
|
||||
throw runtime_error( errorMessage );
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
pConn = OCI_ConnectionCreate( tnsName.c_str(),
|
||||
userName.c_str(),
|
||||
password.c_str(),
|
||||
OCI_SESSION_DEFAULT );
|
||||
}
|
||||
catch ( runtime_error & error )
|
||||
{
|
||||
OCI_Cleanup();
|
||||
|
||||
throw error;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
pStmt = OCI_StatementCreate( pConn );
|
||||
|
||||
OCI_Prepare(pStmt, sqlQueryStaff.c_str());
|
||||
OCI_AllowRebinding( pStmt, true );
|
||||
OCI_BindString( pStmt, ":p13", const_cast<otext*>(staffP13.c_str()), staffP13.size() );
|
||||
|
||||
OCI_Execute( pStmt );
|
||||
|
||||
pResult = OCI_GetResultset( pStmt );
|
||||
|
||||
//检查结果集,如果没有返回,则说明没有此用户
|
||||
if ( OCI_FetchNext( pResult ) == false )
|
||||
{
|
||||
throw runtime_error( "用户不存在!" );
|
||||
}
|
||||
}
|
||||
catch ( runtime_error & error )
|
||||
{
|
||||
OCI_ConnectionFree( pConn );
|
||||
OCI_Cleanup();
|
||||
|
||||
throw error;
|
||||
}
|
||||
|
||||
UserInfo info( OCI_GetString( pResult, 1 ),
|
||||
OCI_GetString( pResult, 2 ),
|
||||
OCI_GetString( pResult, 3 ) );
|
||||
|
||||
OCI_ConnectionFree(pConn);
|
||||
OCI_Cleanup();
|
||||
|
||||
return info;
|
||||
}
|
10
code/cpp/car_dealer_util/source/Data/query/query_user.h
Normal file
@@ -0,0 +1,10 @@
|
||||
//查询用户、权限等相关数据
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
#include "../Datastructure/UserInfo/UserInfo.h"
|
||||
|
||||
UserInfo queryUserInfo( const std::string & userName,
|
||||
const std::string & password,
|
||||
const std::string & tnsName,
|
||||
const std::string & staffP13 );
|
After Width: | Height: | Size: 21 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/8218_box1.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/CNY_Red.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/CPIC.png
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/CPIC透明.png
Normal file
After Width: | Height: | Size: 46 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/app.ico
Normal file
After Width: | Height: | Size: 66 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/car.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/car2.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/cat.png
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/clean.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/dec.png
Normal file
After Width: | Height: | Size: 542 B |
BIN
code/cpp/car_dealer_util/source/Resources/edit.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/excel.png
Normal file
After Width: | Height: | Size: 6.2 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/face.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/find.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/folder.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/gear.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/login.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/manager.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/new.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/ok.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/option.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/plus.png
Normal file
After Width: | Height: | Size: 952 B |
BIN
code/cpp/car_dealer_util/source/Resources/print.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/quit.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/save.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/save2.png
Normal file
After Width: | Height: | Size: 7.5 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/telephone.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/tongji.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
code/cpp/car_dealer_util/source/Resources/x.png
Normal file
After Width: | Height: | Size: 24 KiB |
@@ -0,0 +1,33 @@
|
||||
#include "QCarDealerAchievementWidget.h"
|
||||
|
||||
QCarDealerAchievementWidget::QCarDealerAchievementWidget(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
QCarDealerAchievementWidget::~QCarDealerAchievementWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void QCarDealerAchievementWidget::init()
|
||||
{
|
||||
initData();
|
||||
initWidgets();
|
||||
initSignal();
|
||||
}
|
||||
|
||||
void QCarDealerAchievementWidget::initData()
|
||||
{
|
||||
}
|
||||
|
||||
void QCarDealerAchievementWidget::initWidgets()
|
||||
{
|
||||
setLayout(ui.pLayoutMain);
|
||||
}
|
||||
|
||||
void QCarDealerAchievementWidget::initSignal()
|
||||
{
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include "ui_QCarDealerAchievementWidget.h"
|
||||
|
||||
class QCarDealerAchievementWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QCarDealerAchievementWidget(QWidget *parent = Q_NULLPTR);
|
||||
~QCarDealerAchievementWidget();
|
||||
|
||||
private:
|
||||
void init();
|
||||
void initData();
|
||||
void initWidgets();
|
||||
void initSignal();
|
||||
|
||||
private:
|
||||
Ui::QCarDealerAchievementWidget ui;
|
||||
};
|
@@ -0,0 +1,165 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QCarDealerAchievementWidget</class>
|
||||
<widget class="QWidget" name="QCarDealerAchievementWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>680</width>
|
||||
<height>497</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>QCarDealerAchievementWidget</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>80</x>
|
||||
<y>40</y>
|
||||
<width>258</width>
|
||||
<height>240</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="pLayoutMain">
|
||||
<property name="leftMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="toolButton">
|
||||
<property name="text">
|
||||
<string>导入</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normalon>:/QMainFrame/Resources/excel.png</normalon>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTableWidget" name="tableWidget">
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>年度</string>
|
||||
</property>
|
||||
<property name="textAlignment">
|
||||
<set>AlignCenter</set>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>月份</string>
|
||||
</property>
|
||||
<property name="textAlignment">
|
||||
<set>AlignCenter</set>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>车商代码</string>
|
||||
</property>
|
||||
<property name="textAlignment">
|
||||
<set>AlignCenter</set>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>车商名称</string>
|
||||
</property>
|
||||
<property name="textAlignment">
|
||||
<set>AlignCenter</set>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>店内双签产值(万元)</string>
|
||||
</property>
|
||||
<property name="textAlignment">
|
||||
<set>AlignCenter</set>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>店内新车开票数</string>
|
||||
</property>
|
||||
<property name="textAlignment">
|
||||
<set>AlignCenter</set>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>我司新车签单台次</string>
|
||||
</property>
|
||||
<property name="textAlignment">
|
||||
<set>AlignCenter</set>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>人保新车签单台次</string>
|
||||
</property>
|
||||
<property name="textAlignment">
|
||||
<set>AlignCenter</set>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>平安新车签单台次</string>
|
||||
</property>
|
||||
<property name="textAlignment">
|
||||
<set>AlignCenter</set>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>其他保险公司新车签单台次</string>
|
||||
</property>
|
||||
<property name="textAlignment">
|
||||
<set>AlignCenter</set>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources>
|
||||
<include location="../../../resource.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
@@ -0,0 +1,33 @@
|
||||
#include "QCarDealerSchemaWidget.h"
|
||||
|
||||
QCarDealerSchemaWidget::QCarDealerSchemaWidget(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
QCarDealerSchemaWidget::~QCarDealerSchemaWidget()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void QCarDealerSchemaWidget::init()
|
||||
{
|
||||
initData();
|
||||
initWidgets();
|
||||
initSignal();
|
||||
}
|
||||
|
||||
void QCarDealerSchemaWidget::initData()
|
||||
{
|
||||
}
|
||||
|
||||
void QCarDealerSchemaWidget::initWidgets()
|
||||
{
|
||||
}
|
||||
|
||||
void QCarDealerSchemaWidget::initSignal()
|
||||
{
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include "ui_QCarDealerSchemaWidget.h"
|
||||
|
||||
class QCarDealerSchemaWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QCarDealerSchemaWidget(QWidget *parent = Q_NULLPTR);
|
||||
~QCarDealerSchemaWidget();
|
||||
|
||||
private:
|
||||
void init();
|
||||
void initData();
|
||||
void initWidgets();
|
||||
void initSignal();
|
||||
|
||||
private:
|
||||
Ui::QCarDealerSchemaWidget ui;
|
||||
};
|
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QCarDealerSchemaWidget</class>
|
||||
<widget class="QWidget" name="QCarDealerSchemaWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>725</width>
|
||||
<height>508</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>QCarDealerSchemaWidget</string>
|
||||
</property>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@@ -0,0 +1,33 @@
|
||||
#include "QDataManagementWidget.h"
|
||||
|
||||
QDataManagementWidget::QDataManagementWidget( QWidget * parent )
|
||||
: QWidget( parent )
|
||||
{
|
||||
ui.setupUi( this );
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
QDataManagementWidget::~QDataManagementWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void QDataManagementWidget::init()
|
||||
{
|
||||
initData();
|
||||
initWidgets();
|
||||
initSignal();
|
||||
}
|
||||
|
||||
void QDataManagementWidget::initData()
|
||||
{
|
||||
}
|
||||
|
||||
void QDataManagementWidget::initWidgets()
|
||||
{
|
||||
setLayout( ui.pLayoutMain );
|
||||
}
|
||||
|
||||
void QDataManagementWidget::initSignal()
|
||||
{
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include "ui_QDataManagementWidget.h"
|
||||
|
||||
class QDataManagementWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QDataManagementWidget(QWidget *parent = Q_NULLPTR);
|
||||
~QDataManagementWidget();
|
||||
|
||||
private:
|
||||
void init();
|
||||
void initData();
|
||||
void initWidgets();
|
||||
void initSignal();
|
||||
|
||||
private:
|
||||
Ui::QDataManagementWidget ui;
|
||||
};
|
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QDataManagementWidget</class>
|
||||
<widget class="QWidget" name="QDataManagementWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>759</width>
|
||||
<height>487</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>QDataManagementWidget</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="gridLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>20</y>
|
||||
<width>681</width>
|
||||
<height>431</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="pLayoutMain">
|
||||
<property name="leftMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
<string>车商业绩表</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_2">
|
||||
<attribute name="title">
|
||||
<string>车商方案表</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_3">
|
||||
<attribute name="title">
|
||||
<string>送返修工单</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_4">
|
||||
<attribute name="title">
|
||||
<string>新送返修监控报表</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_5">
|
||||
<attribute name="title">
|
||||
<string>送返修推荐表</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@@ -0,0 +1,11 @@
|
||||
#include "QRepairOrderWidget.h"
|
||||
|
||||
QRepairOrderWidget::QRepairOrderWidget(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
}
|
||||
|
||||
QRepairOrderWidget::~QRepairOrderWidget()
|
||||
{
|
||||
}
|
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include "ui_QRepairOrderWidget.h"
|
||||
|
||||
class QRepairOrderWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QRepairOrderWidget(QWidget *parent = Q_NULLPTR);
|
||||
~QRepairOrderWidget();
|
||||
|
||||
private:
|
||||
Ui::QRepairOrderWidget ui;
|
||||
};
|
@@ -0,0 +1,23 @@
|
||||
<UI version="4.0" >
|
||||
<class>QRepairOrderWidget</class>
|
||||
<widget class="QWidget" name="QRepairOrderWidget" >
|
||||
<property name="objectName" >
|
||||
<string notr="true">QRepairOrderWidget</string>
|
||||
</property>
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>QRepairOrderWidget</string>
|
||||
</property>
|
||||
</widget>
|
||||
<layoutDefault spacing="6" margin="11" />
|
||||
<pixmapfunction></pixmapfunction>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</UI>
|
@@ -0,0 +1,92 @@
|
||||
#include <iostream>
|
||||
#include "QLoginDialog.h"
|
||||
#include "../../system/system_util.h"
|
||||
#include "../../data/Datastructure/UserInfo/UserInfo.h"
|
||||
#include "../../data/query/query_user.h"
|
||||
#include "../../data/AppParameters/AppParameters.h"
|
||||
#include <QMessageBox>
|
||||
|
||||
using namespace std;
|
||||
|
||||
QLoginDialog::QLoginDialog( QWidget * parent )
|
||||
: QDialog( parent )
|
||||
{
|
||||
ui.setupUi( this );
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
QLoginDialog::~QLoginDialog()
|
||||
{
|
||||
}
|
||||
|
||||
void QLoginDialog::init()
|
||||
{
|
||||
initData();
|
||||
initWidgets();
|
||||
initSignal();
|
||||
}
|
||||
|
||||
void QLoginDialog::initData()
|
||||
{
|
||||
returnCode = EXIT;
|
||||
|
||||
systemUserName = QString::fromStdWString( getUserName() );
|
||||
}
|
||||
|
||||
void QLoginDialog::initSignal()
|
||||
{
|
||||
connect( ui.pButtonOK, SIGNAL( clicked() ), this, SLOT( onOK() ));
|
||||
connect( ui.pButtonExit, SIGNAL( clicked() ), this, SLOT( onExit() ));
|
||||
}
|
||||
|
||||
void QLoginDialog::initWidgets()
|
||||
{
|
||||
setLayout( ui.pLayoutMain );
|
||||
|
||||
ui.pEditSystemUserName->setText( systemUserName );
|
||||
|
||||
try
|
||||
{
|
||||
queryStaffInfo( systemUserName );
|
||||
}
|
||||
catch ( runtime_error & error )
|
||||
{
|
||||
//如果出现异常,就不让用户继续登录
|
||||
QMessageBox::critical( nullptr,
|
||||
"错误,请联系管理员!",
|
||||
QString::fromLocal8Bit( error.what() ) );
|
||||
|
||||
ui.pButtonOK->setEnabled( false );
|
||||
}
|
||||
}
|
||||
|
||||
void QLoginDialog::onOK()
|
||||
{
|
||||
returnCode = OK;
|
||||
|
||||
this->close();
|
||||
}
|
||||
|
||||
void QLoginDialog::onExit()
|
||||
{
|
||||
returnCode = EXIT;
|
||||
|
||||
this->close();
|
||||
}
|
||||
|
||||
void QLoginDialog::queryStaffInfo( const QString & systemUserName )
|
||||
{
|
||||
string userName = "car_dealer";
|
||||
string password = "cpic123456";
|
||||
string tnsName = "xmcx1";
|
||||
|
||||
string staffP13 = systemUserName.toLocal8Bit();
|
||||
|
||||
UserInfo && info = queryUserInfo( userName,
|
||||
password,
|
||||
tnsName,
|
||||
staffP13 );
|
||||
|
||||
pStaffInfo = new UserInfo( info );
|
||||
}
|
@@ -0,0 +1,39 @@
|
||||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
#include "ui_QLoginDialog.h"
|
||||
|
||||
class QLoginDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QLoginDialog(QWidget *parent = Q_NULLPTR);
|
||||
~QLoginDialog();
|
||||
|
||||
typedef enum { OK, EXIT } ReturnCode;
|
||||
|
||||
ReturnCode getReturnCode() const
|
||||
{
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
protected Q_SLOTS:
|
||||
void init();
|
||||
void initData();
|
||||
void initSignal();
|
||||
void initWidgets();
|
||||
|
||||
void onOK();
|
||||
void onExit();
|
||||
|
||||
private:
|
||||
void queryStaffInfo( const QString & systemUserName );
|
||||
|
||||
private:
|
||||
Ui::QLoginDialog ui;
|
||||
ReturnCode returnCode;
|
||||
QString systemUserName;
|
||||
QString cpicUserName;
|
||||
QString cpicP13;
|
||||
};
|
@@ -0,0 +1,286 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QLoginDialog</class>
|
||||
<widget class="QDialog" name="QLoginDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>350</width>
|
||||
<height>160</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>350</width>
|
||||
<height>160</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>350</width>
|
||||
<height>160</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>猜猜你是谁~~~~</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset>
|
||||
<normalon>:/QMainFrame/Resources/CPIC透明.png</normalon>
|
||||
</iconset>
|
||||
</property>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>349</width>
|
||||
<height>158</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="pLayoutMain">
|
||||
<property name="leftMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../../resource.qrc">:/QMainFrame/Resources/cat.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>人员信息:</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>85</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>85</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>系统用户名:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="pEditSystemUserName">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border: 1px solid silver;</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>85</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>85</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>人员名称:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="pEditUserName">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border: 1px solid silver;</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>85</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>85</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>岗位:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="pEditStaffPost">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border: 1px solid silver;</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="pButtonExit">
|
||||
<property name="text">
|
||||
<string>退出</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normalon>:/QMainFrame/Resources/quit.png</normalon>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="pButtonOK">
|
||||
<property name="text">
|
||||
<string>确认</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normalon>:/QMainFrame/Resources/ok.png</normalon>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources>
|
||||
<include location="../../resource.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
@@ -0,0 +1,34 @@
|
||||
|
||||
#include "QMainFrame.h"
|
||||
|
||||
QMainFrame::QMainFrame(QWidget* parent)
|
||||
: QMainWindow(parent)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
void QMainFrame::init()
|
||||
{
|
||||
initData();
|
||||
initWidgets();
|
||||
initSignal();
|
||||
}
|
||||
|
||||
void QMainFrame::initData()
|
||||
{
|
||||
pStackedWidget = new QStackedWidget(this);
|
||||
pWidgetDataManagement = new QDataManagementWidget(pStackedWidget);
|
||||
}
|
||||
|
||||
void QMainFrame::initWidgets()
|
||||
{
|
||||
pStackedWidget->addWidget(pWidgetDataManagement);
|
||||
|
||||
setCentralWidget(pStackedWidget);
|
||||
}
|
||||
|
||||
void QMainFrame::initSignal()
|
||||
{
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include <QtWidgets/QMainWindow>
|
||||
#include <QtWidgets/QStackedWidget>
|
||||
#include "QDataManagementWidget.h"
|
||||
#include "ui_QMainFrame.h"
|
||||
|
||||
class QMainFrame : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QMainFrame( QWidget * parent = Q_NULLPTR );
|
||||
|
||||
private:
|
||||
void init();
|
||||
void initData();
|
||||
void initWidgets();
|
||||
void initSignal();
|
||||
|
||||
private:
|
||||
Ui::QMainFrameClass ui;
|
||||
QStackedWidget * pStackedWidget;
|
||||
QDataManagementWidget * pWidgetDataManagement;
|
||||
};
|
100
code/cpp/car_dealer_util/source/Widgets/MainFrame/QMainFrame.ui
Normal file
@@ -0,0 +1,100 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QMainFrameClass</class>
|
||||
<widget class="QMainWindow" name="QMainFrameClass">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>796</width>
|
||||
<height>558</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>QMainFrame</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralWidget"/>
|
||||
<widget class="QMenuBar" name="menuBar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>796</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menu">
|
||||
<property name="title">
|
||||
<string>系统</string>
|
||||
</property>
|
||||
<addaction name="pActionExit"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menu_2">
|
||||
<property name="title">
|
||||
<string>帮助</string>
|
||||
</property>
|
||||
<addaction name="pActionAbout"/>
|
||||
</widget>
|
||||
<addaction name="menu"/>
|
||||
<addaction name="menu_2"/>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="mainToolBar">
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>36</width>
|
||||
<height>36</height>
|
||||
</size>
|
||||
</property>
|
||||
<attribute name="toolBarArea">
|
||||
<enum>TopToolBarArea</enum>
|
||||
</attribute>
|
||||
<attribute name="toolBarBreak">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<addaction name="pActionDataManagement"/>
|
||||
<addaction name="pActionParamentersManagement"/>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusBar"/>
|
||||
<action name="pActionExit">
|
||||
<property name="icon">
|
||||
<iconset resource="../../resource.qrc">
|
||||
<normaloff>:/QMainFrame/Resources/quit.png</normaloff>:/QMainFrame/Resources/quit.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>退出</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="pActionAbout">
|
||||
<property name="icon">
|
||||
<iconset resource="../../resource.qrc">
|
||||
<normaloff>:/QMainFrame/Resources/cat.png</normaloff>:/QMainFrame/Resources/cat.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>关于</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="pActionDataManagement">
|
||||
<property name="icon">
|
||||
<iconset resource="../../resource.qrc">
|
||||
<normaloff>:/QMainFrame/Resources/excel.png</normaloff>:/QMainFrame/Resources/excel.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>数据管理</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="pActionParamentersManagement">
|
||||
<property name="icon">
|
||||
<iconset resource="../../resource.qrc">
|
||||
<normaloff>:/QMainFrame/Resources/option.png</normaloff>:/QMainFrame/Resources/option.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>参数管理</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources>
|
||||
<include location="../../resource.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
BIN
code/cpp/car_dealer_util/source/car_dealer_util.ico
Normal file
After Width: | Height: | Size: 361 KiB |
2
code/cpp/car_dealer_util/source/car_dealer_util.rc
Normal file
@@ -0,0 +1,2 @@
|
||||
IDI_ICON1 ICON DISCARDABLE "car_dealer_util.ico"
|
||||
|
82
code/cpp/car_dealer_util/source/db/ocilib/db_oper.cpp
Normal file
@@ -0,0 +1,82 @@
|
||||
|
||||
#include <exception>
|
||||
#include <stdexcept>
|
||||
#include <QDebug>
|
||||
#include "db_oper.h"
|
||||
|
||||
const int ERROR_MESSAGE_LENGTH = 1001;
|
||||
|
||||
using namespace std;
|
||||
|
||||
void get_error_message(OCI_Error * pError, char * pszMessage, size_t length);
|
||||
|
||||
void initOciLib()
|
||||
{
|
||||
int returnCode = 0;
|
||||
char * pszErrorMessage = (char *)malloc(sizeof(char) * ERROR_MESSAGE_LENGTH);
|
||||
|
||||
returnCode = OCI_Initialize(NULL, NULL, OCI_ENV_DEFAULT);
|
||||
|
||||
if (!returnCode )
|
||||
{
|
||||
get_error_message(OCI_GetLastError(), pszErrorMessage, ERROR_MESSAGE_LENGTH - 1);
|
||||
|
||||
string message("OCILIB初始化失败!\n");
|
||||
|
||||
message += pszErrorMessage;
|
||||
|
||||
throw runtime_error(message);
|
||||
}
|
||||
|
||||
free(pszErrorMessage);
|
||||
}
|
||||
|
||||
void releaseOciLib()
|
||||
{
|
||||
OCI_Cleanup();
|
||||
}
|
||||
|
||||
void get_error_message(OCI_Error * pError, char * pszMessage, size_t length)
|
||||
{
|
||||
//防御性验证
|
||||
if (pError == NULL)
|
||||
{
|
||||
pszMessage[0] = NULL;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const otext * psz = OCI_ErrorGetString(pError);
|
||||
|
||||
strcpy_s(pszMessage, length, psz);
|
||||
}
|
||||
|
||||
void error_handler(OCI_Error * pError)
|
||||
{
|
||||
std::runtime_error error(OCI_ErrorGetString(pError));
|
||||
|
||||
OCI_Cleanup();
|
||||
|
||||
throw error;
|
||||
}
|
||||
|
||||
void l_error_handler(OCI_Error* pError)
|
||||
{
|
||||
string errorString = OCI_ErrorGetString(pError);
|
||||
|
||||
std::runtime_error error(OCI_ErrorGetString(pError));
|
||||
|
||||
throw error;
|
||||
}
|
||||
|
||||
void output_error_message( const std::string & errorMessage )
|
||||
{
|
||||
qDebug() << QString::fromLocal8Bit(errorMessage.c_str());
|
||||
}
|
||||
|
||||
std::string get_last_error_message()
|
||||
{
|
||||
OCI_Error * pError = OCI_GetLastError();
|
||||
|
||||
return std::string(OCI_ErrorGetString(pError));
|
||||
}
|
21
code/cpp/car_dealer_util/source/db/ocilib/db_oper.h
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
#ifndef _DB_OPER_H
|
||||
#define _DB_OPER_H
|
||||
|
||||
#include <ocilib.h>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
void initOciLib();
|
||||
|
||||
void releaseOciLib();
|
||||
|
||||
void error_handler(OCI_Error * pError);
|
||||
void l_error_handler(OCI_Error* pError);
|
||||
|
||||
void output_error_message(const std::string& errorMessage);
|
||||
|
||||
std::string get_last_error_message();
|
||||
|
||||
|
||||
#endif
|
101
code/cpp/car_dealer_util/source/main.cpp
Normal file
@@ -0,0 +1,101 @@
|
||||
#include <QtWidgets/QtWidgets>
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <stdexcept>
|
||||
#include "Widgets/MainFrame/QMainFrame.h"
|
||||
#include "QLoginDialog.h"
|
||||
#include "test/test.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
QApplication* pApp = nullptr;
|
||||
QMainFrame* pMainFrame = nullptr;
|
||||
QLoginDialog* pLoginDialog = nullptr;
|
||||
int returnCode = -1;
|
||||
|
||||
try
|
||||
{
|
||||
pApp = new QApplication(argc, argv);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
QMessageBox::critical(nullptr,
|
||||
"错误!",
|
||||
"1创建QApplication错误!\n请联系开发人员。");
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
test();
|
||||
|
||||
return 1;
|
||||
|
||||
//登录界面
|
||||
try
|
||||
{
|
||||
pLoginDialog = new QLoginDialog();
|
||||
|
||||
pLoginDialog->exec();
|
||||
|
||||
if (pLoginDialog->getReturnCode() == QLoginDialog::ReturnCode::EXIT)
|
||||
{
|
||||
//用户点了退出
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
catch (std::runtime_error error)
|
||||
{
|
||||
QMessageBox::critical(nullptr,
|
||||
"错误!",
|
||||
error.what());
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
pMainFrame = new QMainFrame();
|
||||
}
|
||||
catch (std::runtime_error& error)
|
||||
{
|
||||
QMessageBox::critical(nullptr,
|
||||
"错误!",
|
||||
error.what());
|
||||
|
||||
return -1;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
QMessageBox::critical(nullptr,
|
||||
"错误!",
|
||||
"创建窗口过程错误!\n请联系开发人员。");
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
pMainFrame->showMaximized();
|
||||
|
||||
returnCode = pApp->exec();
|
||||
}
|
||||
catch (std::runtime_error& error)
|
||||
{
|
||||
QMessageBox::critical(nullptr,
|
||||
"错误!",
|
||||
error.what());
|
||||
|
||||
return -1;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
QMessageBox::critical(nullptr,
|
||||
"错误!",
|
||||
"创建窗口过程错误!\n请联系开发人员。");
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
return returnCode;
|
||||
}
|
34
code/cpp/car_dealer_util/source/resource.qrc
Normal file
@@ -0,0 +1,34 @@
|
||||
<RCC>
|
||||
<qresource prefix="/QMainFrame">
|
||||
<file>Resources/8218_box1.png</file>
|
||||
<file>Resources/20121016085311441_easyicon_cn_128.png</file>
|
||||
<file>Resources/app.ico</file>
|
||||
<file>Resources/car.png</file>
|
||||
<file>Resources/car2.png</file>
|
||||
<file>Resources/cat.png</file>
|
||||
<file>Resources/clean.png</file>
|
||||
<file>Resources/CNY_Red.png</file>
|
||||
<file>Resources/CPIC.png</file>
|
||||
<file>Resources/CPIC透明.png</file>
|
||||
<file>Resources/dec.png</file>
|
||||
<file>Resources/edit.png</file>
|
||||
<file>Resources/excel.png</file>
|
||||
<file>Resources/face.png</file>
|
||||
<file>Resources/find.png</file>
|
||||
<file>Resources/folder.png</file>
|
||||
<file>Resources/gear.png</file>
|
||||
<file>Resources/login.png</file>
|
||||
<file>Resources/manager.png</file>
|
||||
<file>Resources/new.png</file>
|
||||
<file>Resources/ok.png</file>
|
||||
<file>Resources/option.png</file>
|
||||
<file>Resources/plus.png</file>
|
||||
<file>Resources/print.png</file>
|
||||
<file>Resources/quit.png</file>
|
||||
<file>Resources/save.png</file>
|
||||
<file>Resources/save2.png</file>
|
||||
<file>Resources/telephone.png</file>
|
||||
<file>Resources/tongji.png</file>
|
||||
<file>Resources/x.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
1
code/cpp/car_dealer_util/source/stdafx.cpp
Normal file
@@ -0,0 +1 @@
|
||||
#include "stdafx.h"
|
1
code/cpp/car_dealer_util/source/stdafx.h
Normal file
@@ -0,0 +1 @@
|
||||
#include <QtWidgets>
|
25
code/cpp/car_dealer_util/source/system/system_util.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
#include "system_util.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
const unsigned int BUFFER_SIZE = 1024;
|
||||
|
||||
std::wstring getUserName()
|
||||
{
|
||||
wstring userName;
|
||||
wchar_t szUserName[BUFFER_SIZE];
|
||||
DWORD userNameBufferSize = BUFFER_SIZE;
|
||||
|
||||
if ( GetUserNameW( szUserName, &userNameBufferSize ) == false )
|
||||
{
|
||||
throw runtime_error("获取操作系统用户名失败!");
|
||||
}
|
||||
|
||||
if ( userNameBufferSize != 0 )
|
||||
{
|
||||
userName = szUserName;
|
||||
}
|
||||
|
||||
return userName;
|
||||
}
|
8
code/cpp/car_dealer_util/source/system/system_util.h
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <windows.h>
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
|
||||
std::wstring getUserName();
|
64
code/cpp/car_dealer_util/source/test/test.cpp
Normal file
@@ -0,0 +1,64 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <QtWidgets/QMessageBox>
|
||||
#include "test.h"
|
||||
#include "../data/DataManipulation/Excel/LoadFromExcel.h"
|
||||
#include "../data/DataManipulation/oracle/ImportToOracle.h"
|
||||
#include "../system/system_util.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
void excelTest();
|
||||
void test_username();
|
||||
|
||||
void test()
|
||||
{
|
||||
excelTest();
|
||||
}
|
||||
|
||||
void excelTest()
|
||||
{
|
||||
vector<CarDealerScheme> schemeVector;
|
||||
vector<CarDealerAchievement> achievementsVector;
|
||||
vector<RepairOrder> repairOrderVector;
|
||||
vector<RepairSuggestionRecord> suggestionRecordsVector;
|
||||
vector<NewRepairMonitorReportRecord> repairMonitorVector;
|
||||
|
||||
string userName = "car_dealer";
|
||||
string password = "cpic123456";
|
||||
string tnsName = "xmcx1";
|
||||
|
||||
wstring filePathRepairOrder = L"D:/develop/projects_win/2019/car_dealer_util/数据/送返修工单/357783_1.xlsx";
|
||||
wstring filePathCarDealerScheme = L"D:/develop/projects_win/2019/car_dealer_util/数据/PC端导入模板(管理员版).xlsx";
|
||||
wstring filePathCarDealerAchievement = L"D:/develop/projects_win/2019/car_dealer_util/数据/PC端导入模板(客户经理版).xlsx";
|
||||
wstring filePathRepairSuggestion = L"D:/develop/projects_win/2019/car_dealer_util/数据/卢霖城 - 推荐表.xlsx";
|
||||
wstring filePathNewRepairMonitor = L"D:/develop/projects_win/2019/car_dealer_util/数据/新送返修监控报表.xlsx";
|
||||
|
||||
//测试车商方案
|
||||
//LoadCarDealerSchemeFromXlsx( filePathCarDealerScheme, 0, 1, schemeVector );
|
||||
//ImportCarDealerSchemeToOracle( userName, password, tnsName, schemeVector );
|
||||
|
||||
//测试车商业绩
|
||||
//LoadCarDealerAchievementFromXlsx( filePathCarDealerAchievement, 0, 1, achievementsVector );
|
||||
//ImportCarDealerAchievementToOracleCpp( userName, password, tnsName, achievementsVector );
|
||||
|
||||
//测试送返修工单
|
||||
//LoadRepairOrderFromXlsx(filePathRepairOrder, 0, 1, repairOrderVector);
|
||||
//ImportRepairOrderToOracle("car_dealer", "cpic123456", "xmcx1", repairOrderVector);
|
||||
|
||||
//测试送返修推荐
|
||||
//LoadRepairSuggestionFromXlsx( filePathRepairSuggestion, 0, 1, suggestionRecordsVector );
|
||||
//ImportRepairSuggestionToOracle( userName, password, tnsName, suggestionRecordsVector);
|
||||
|
||||
//测试新送返修监控报表
|
||||
LoadNewRepairMonitorReportFromXlsx(filePathNewRepairMonitor, 0, 1, repairMonitorVector);
|
||||
ImportNewRepairMonitorToOracle(userName, password, tnsName, repairMonitorVector);
|
||||
return;
|
||||
}
|
||||
|
||||
void test_username()
|
||||
{
|
||||
wstring userName = getUserName();
|
||||
|
||||
QMessageBox::information( nullptr, "测试", QString::fromStdWString( userName ) );
|
||||
}
|
4
code/cpp/car_dealer_util/source/test/test.h
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
void test();
|
2
code/cpp/car_dealer_util/source/新建文本文档.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
$(IntDir)\moc\%(RelativeDir)
|
||||
$(IntDir)\rcc\%(RelativeDir)
|