2018-06-01 09:36:01 +00:00
|
|
|
|
/*!
|
|
|
|
|
* \file DataManipulation.h
|
|
|
|
|
* \date 2014/08/18 15:43
|
|
|
|
|
*
|
|
|
|
|
* \author Kane
|
|
|
|
|
* Contact: user@company.com
|
|
|
|
|
*
|
2018-06-01 10:21:26 +00:00
|
|
|
|
* \brief 转介绍数据处理
|
2018-06-01 09:36:01 +00:00
|
|
|
|
*
|
|
|
|
|
* TODO: long description
|
|
|
|
|
*
|
|
|
|
|
* \note
|
2018-06-04 12:54:29 +00:00
|
|
|
|
*/
|
2018-06-01 09:36:01 +00:00
|
|
|
|
|
|
|
|
|
#ifndef DataManipulation_h__
|
|
|
|
|
#define DataManipulation_h__
|
|
|
|
|
|
|
|
|
|
#include <libxl.h>
|
|
|
|
|
#include <string>
|
2018-06-04 12:54:29 +00:00
|
|
|
|
#include <QtCore/QString>
|
2018-06-01 09:36:01 +00:00
|
|
|
|
#include <vector>
|
2018-06-02 09:47:28 +00:00
|
|
|
|
#include <unordered_map>
|
2018-06-01 09:36:01 +00:00
|
|
|
|
#include "SystemData.h"
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
using namespace libxl;
|
|
|
|
|
|
2018-06-04 12:54:29 +00:00
|
|
|
|
//准备废弃
|
2018-06-01 09:36:01 +00:00
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
string strPolicySerial;
|
|
|
|
|
string strSignDate;
|
|
|
|
|
string strSalerCode;
|
|
|
|
|
string strSalerName;
|
|
|
|
|
string strSalerDeptCode;
|
|
|
|
|
string strSalerDeptName;
|
|
|
|
|
string strSalerOfficeCode;
|
|
|
|
|
string strSalerOfficeName;
|
|
|
|
|
string strAutoTraderCode;
|
|
|
|
|
string strAutoTraderName;
|
|
|
|
|
string strCustomerName;
|
|
|
|
|
string strPlateSerial;
|
|
|
|
|
string strFrameSerial;
|
|
|
|
|
string strEngineSerial;
|
|
|
|
|
string strOperatorDate;
|
|
|
|
|
string strOperatorCode;
|
2018-06-04 12:54:29 +00:00
|
|
|
|
bool bIsAutotraderCall;
|
|
|
|
|
} SPolicyRecord;
|
2018-06-01 09:36:01 +00:00
|
|
|
|
|
2018-06-20 09:56:06 +00:00
|
|
|
|
|
2018-06-04 12:54:29 +00:00
|
|
|
|
|
|
|
|
|
//准备废弃
|
2018-06-01 09:36:01 +00:00
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
string strPolicySerial;
|
|
|
|
|
string strSalerCode;
|
|
|
|
|
string strDeptName;
|
|
|
|
|
string strOfficeName;
|
|
|
|
|
string strCDLH;
|
|
|
|
|
string strAutoTraderCode;
|
|
|
|
|
string strAutoTraderName;
|
|
|
|
|
double dGiftPriceSum;
|
|
|
|
|
string strGifts;
|
|
|
|
|
string strInputDate;
|
2018-06-04 12:54:29 +00:00
|
|
|
|
} SPolicyQuery;
|
2018-06-01 09:36:01 +00:00
|
|
|
|
|
2018-06-20 09:56:06 +00:00
|
|
|
|
|
|
|
|
|
|
2018-06-01 09:36:01 +00:00
|
|
|
|
class TelSalePolicyGift
|
|
|
|
|
{
|
|
|
|
|
public:
|
2018-06-04 12:54:29 +00:00
|
|
|
|
TelSalePolicyGift()
|
|
|
|
|
{
|
|
|
|
|
};
|
|
|
|
|
|
2018-06-20 09:56:06 +00:00
|
|
|
|
TelSalePolicyGift( int id, const string & name, const string & defaultPrice ) : m_id( id ),
|
|
|
|
|
m_giftName( name ),
|
|
|
|
|
m_giftDefaultPrice( defaultPrice )
|
2018-06-04 12:54:29 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
2018-06-01 09:36:01 +00:00
|
|
|
|
|
|
|
|
|
inline int Id() const { return m_id; }
|
2018-06-20 09:56:06 +00:00
|
|
|
|
void Id( int val ) { m_id = val; }
|
2018-06-01 09:36:01 +00:00
|
|
|
|
|
|
|
|
|
string GiftName() const { return m_giftName; }
|
2018-06-20 09:56:06 +00:00
|
|
|
|
void GiftName( string val ) { m_giftName = val; }
|
2018-06-01 09:36:01 +00:00
|
|
|
|
|
|
|
|
|
string GiftDefaultPrice() const { return m_giftDefaultPrice; }
|
2018-06-20 09:56:06 +00:00
|
|
|
|
void GiftDefaultPrice( string val ) { m_giftDefaultPrice = val; }
|
2018-06-01 09:36:01 +00:00
|
|
|
|
|
|
|
|
|
private:
|
2018-06-04 12:54:29 +00:00
|
|
|
|
int m_id;
|
2018-06-01 09:36:01 +00:00
|
|
|
|
string m_giftName;
|
|
|
|
|
string m_giftDefaultPrice;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//************************************
|
|
|
|
|
// Method: queryTelsalePolicyGifts
|
|
|
|
|
// FullName: queryTelsalePolicyGifts
|
|
|
|
|
// Access: public
|
|
|
|
|
// Returns: void
|
2018-06-01 10:21:26 +00:00
|
|
|
|
// Qualifier: 查询礼品信息
|
|
|
|
|
// Parameter: vector<TelSalePolicyGift> & giftList 礼品列表
|
2018-06-01 09:36:01 +00:00
|
|
|
|
//************************************
|
2018-06-20 09:56:06 +00:00
|
|
|
|
//void queryTelsalePolicyGifts(vector<TelSalePolicyGift> & giftList);
|
2018-06-01 09:36:01 +00:00
|
|
|
|
|
|
|
|
|
//************************************
|
|
|
|
|
// Method: SaveTelSalePolicyInfo
|
|
|
|
|
// FullName: SaveTelSalePolicyInfo
|
|
|
|
|
// Access: public
|
|
|
|
|
// Returns: void
|
|
|
|
|
// Qualifier:
|
|
|
|
|
// Parameter: const SPolicyRecord & policy
|
|
|
|
|
// Parameter: const vector<TelSalePolicyGift> & giftList
|
|
|
|
|
//************************************
|
2018-06-20 09:56:06 +00:00
|
|
|
|
void SaveTelSalePolicyInfo( const SPolicyRecord & policy, const vector<TelSalePolicyGift> & giftList );
|
2018-06-01 09:36:01 +00:00
|
|
|
|
|
|
|
|
|
//************************************
|
|
|
|
|
// Method: QueryTelSalePolicyInfo
|
|
|
|
|
// FullName: QueryTelSalePolicyInfo
|
|
|
|
|
// Access: public
|
|
|
|
|
// Returns: void
|
|
|
|
|
// Qualifier:
|
|
|
|
|
// Parameter: const string & strPolicyNo
|
|
|
|
|
// Parameter: const string & strOperatorCode
|
|
|
|
|
// Parameter: const string & strStartDate
|
|
|
|
|
// Parameter: const string & strEndDate
|
|
|
|
|
// Parameter: vector<SPolicyQuery> & vPolicyInfo
|
|
|
|
|
//************************************
|
2018-06-20 09:56:06 +00:00
|
|
|
|
void QueryTelSalePolicyInfo( const string & strPolicyNo,
|
|
|
|
|
const string & strOperatorCode,
|
|
|
|
|
const string & strStartDate,
|
|
|
|
|
const string & strEndDate,
|
|
|
|
|
vector<SPolicyQuery> & vPolicyInfo );
|
2018-06-01 09:36:01 +00:00
|
|
|
|
|
|
|
|
|
//************************************
|
|
|
|
|
// Method: QueryPolicyGifts
|
|
|
|
|
// FullName: QueryPolicyGifts
|
|
|
|
|
// Access: public
|
|
|
|
|
// Returns: void
|
2018-06-01 10:21:26 +00:00
|
|
|
|
// Qualifier: 查询礼品列表,生成字符串
|
2018-06-01 09:36:01 +00:00
|
|
|
|
// Parameter: const string & strPolicyNo
|
|
|
|
|
// Parameter: string & strGifts
|
|
|
|
|
//************************************
|
2018-06-20 09:56:06 +00:00
|
|
|
|
// void QueryPolicyGifts(const string & strPolicyNo,
|
|
|
|
|
// string & strGifts,
|
|
|
|
|
// double dGiftPriceSum);
|
2018-06-01 09:36:01 +00:00
|
|
|
|
|
2018-06-02 09:47:28 +00:00
|
|
|
|
//void readTelsaleXlsFile( const string & strFilePath, vector<SPolicyRecord> & listPolicy, bool hasTitle, bool isXML );
|
2018-06-01 09:36:01 +00:00
|
|
|
|
|
2018-06-20 09:56:06 +00:00
|
|
|
|
void readTelsaleXlsxFile( const wstring & filePath, vector<SPolicyRecord> & listPolicy, bool hasTitle );
|
2018-06-04 12:54:29 +00:00
|
|
|
|
|
|
|
|
|
/************************************************
|
|
|
|
|
* \brief 读取xls文件的单元格内容,返回std::string
|
|
|
|
|
* \param pSheet xls文件的sheet对象指针
|
|
|
|
|
* \param iRowIndex 行索引
|
|
|
|
|
* \param iColIndex 列索引
|
|
|
|
|
* \return 返回读取的单元格内容,以std::string为载体
|
|
|
|
|
************************************************/
|
2018-06-20 09:56:06 +00:00
|
|
|
|
string readXlsCell( ISheetT<char> * pSheet, int iRowIndex, int iColIndex );
|
2018-06-04 12:54:29 +00:00
|
|
|
|
|
|
|
|
|
/************************************************
|
|
|
|
|
* \brief 读取xlsx文件的单元格内容,返回std::string
|
|
|
|
|
* \param pSheet xlsx文件的sheet对象指针
|
|
|
|
|
* \param iRowIndex 行索引
|
|
|
|
|
* \param iColIndex 列索引
|
|
|
|
|
* \return 返回读取的单元格内容,以std::string为载体
|
|
|
|
|
************************************************/
|
2018-06-20 09:56:06 +00:00
|
|
|
|
string readXlsxCell( ISheetT<wchar_t> * pSheet, int iRowIndex, int iColIndex );
|
2018-06-04 12:54:29 +00:00
|
|
|
|
|
|
|
|
|
#endif // DataManipulation_h__
|