telsale-management/代码/telsale_aux_kit/source/DataManipulation.h

143 lines
3.8 KiB
C++

/*!
* \file DataManipulation.h
* \date 2014/08/18 15:43
*
* \author Kane
* Contact: user@company.com
*
* \brief 转介绍数据处理
*
* TODO: long description
*
* \note
*/
#ifndef DataManipulation_h__
#define DataManipulation_h__
#include <libxl.h>
#include <string>
#include <vector>
#include "SystemData.h"
using namespace std;
using namespace libxl;
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;
bool bIsAutotraderCall;
} SPolicyRecord;
typedef struct
{
string strPolicySerial;
string strSalerCode;
string strDeptName;
string strOfficeName;
string strCDLH;
string strAutoTraderCode;
string strAutoTraderName;
double dGiftPriceSum;
string strGifts;
string strInputDate;
} SPolicyQuery;
class TelSalePolicyGift
{
public:
TelSalePolicyGift() {};
TelSalePolicyGift( int id, string & name, string & defaultPrice ) : m_id( id ), m_giftName( name ), m_giftDefaultPrice( defaultPrice ) {}
inline int Id() const { return m_id; }
void Id(int val) { m_id = val; }
string GiftName() const { return m_giftName; }
void GiftName(string val) { m_giftName = val; }
string GiftDefaultPrice() const { return m_giftDefaultPrice; }
void GiftDefaultPrice(string val) { m_giftDefaultPrice = val; }
private:
int m_id;
string m_giftName;
string m_giftDefaultPrice;
};
//************************************
// Method: queryTelsalePolicyGifts
// FullName: queryTelsalePolicyGifts
// Access: public
// Returns: void
// Qualifier: 查询礼品信息
// Parameter: vector<TelSalePolicyGift> & giftList 礼品列表
//************************************
void queryTelsalePolicyGifts( vector<TelSalePolicyGift> &giftList );
//************************************
// Method: SaveTelSalePolicyInfo
// FullName: SaveTelSalePolicyInfo
// Access: public
// Returns: void
// Qualifier:
// Parameter: const SPolicyRecord & policy
// Parameter: const vector<TelSalePolicyGift> & giftList
//************************************
void SaveTelSalePolicyInfo( const SPolicyRecord & policy, const vector<TelSalePolicyGift> & giftList );
//************************************
// 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
//************************************
void QueryTelSalePolicyInfo( const string & strPolicyNo,
const string & strOperatorCode,
const string & strStartDate,
const string & strEndDate,
vector<SPolicyQuery> & vPolicyInfo );
//************************************
// Method: QueryPolicyGifts
// FullName: QueryPolicyGifts
// Access: public
// Returns: void
// Qualifier: 查询礼品列表,生成字符串
// Parameter: const string & strPolicyNo
// Parameter: string & strGifts
//************************************
void QueryPolicyGifts( const string & strPolicyNo,
string & strGifts,
double dGiftPriceSum );
void readTelsaleXlsFile( const string strFilePath, vector<SPolicyRecord> & listPolicy, bool hasTitle, bool isXML );
void readTelsaleXlsxFile( wchar_t * wszFilePath, vector<SPolicyRecord> & listPolicy, bool hasTitle );
string readXlsCell( ISheetT<char> * pSheet, int iRowIndex, int iColIndex );
string readXlsxCell( ISheetT<wchar_t> * pSheet, int iRowIndex, int iColIndex);
#endif // DataManipulation_h__