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

191 lines
5.3 KiB
C
Raw Normal View History

/*!
* \file DataManipulation.h
* \date 2014/08/18 15:43
*
* \author Kane
* Contact: user@company.com
*
2018-06-01 10:21:26 +00:00
* \brief
*
* TODO: long description
*
* \note
2018-06-04 12:54:29 +00:00
*/
#ifndef DataManipulation_h__
#define DataManipulation_h__
#include <libxl.h>
#include <string>
2018-06-04 12:54:29 +00:00
#include <QtCore/QString>
#include <vector>
2018-06-02 09:47:28 +00:00
#include <unordered_map>
#include "SystemData.h"
using namespace std;
using namespace libxl;
2018-06-04 12:54:29 +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-04 12:54:29 +00:00
class PolicyRecord
{
private:
QString policySerial;
QString signDate;
QString salerCode;
QString salerName;
QString salerDeptCode;
QString salerDeptName;
QString salerOfficeCode;
QString salerOfficeName;
QString autoTraderCode;
QString autoTraderName;
QString customerName;
QString plateSerial;
QString frameSerial;
QString engineSerial;
QString operatorDate;
QString operatorCode;
bool isAutotraderCall;
};
//准备废弃
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;
class TelSalePolicyGift
{
public:
2018-06-04 12:54:29 +00:00
TelSalePolicyGift()
{
};
TelSalePolicyGift(int id, const string & name, const string & defaultPrice) : m_id(id),
m_giftName(name),
m_giftDefaultPrice(defaultPrice)
{
}
inline int Id() const { return m_id; }
2018-06-04 12:54:29 +00:00
void Id(int val) { m_id = val; }
string GiftName() const { return m_giftName; }
2018-06-04 12:54:29 +00:00
void GiftName(string val) { m_giftName = val; }
string GiftDefaultPrice() const { return m_giftDefaultPrice; }
2018-06-04 12:54:29 +00:00
void GiftDefaultPrice(string val) { m_giftDefaultPrice = val; }
private:
2018-06-04 12:54:29 +00:00
int m_id;
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-04 12:54:29 +00:00
void queryTelsalePolicyGifts(vector<TelSalePolicyGift> & giftList);
//************************************
// Method: SaveTelSalePolicyInfo
// FullName: SaveTelSalePolicyInfo
// Access: public
// Returns: void
// Qualifier:
// Parameter: const SPolicyRecord & policy
// Parameter: const vector<TelSalePolicyGift> & giftList
//************************************
2018-06-04 12:54:29 +00:00
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
//************************************
2018-06-04 12:54:29 +00:00
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
2018-06-01 10:21:26 +00:00
// Qualifier: 查询礼品列表,生成字符串
// Parameter: const string & strPolicyNo
// Parameter: string & strGifts
//************************************
2018-06-04 12:54:29 +00:00
void QueryPolicyGifts(const string & strPolicyNo,
string & strGifts,
double dGiftPriceSum);
2018-06-02 09:47:28 +00:00
//void readTelsaleXlsFile( const string & strFilePath, vector<SPolicyRecord> & listPolicy, bool hasTitle, bool isXML );
2018-06-04 12:54:29 +00:00
void readTelsaleXlsxFile(const wstring & filePath, vector<SPolicyRecord> & listPolicy, bool hasTitle);
/************************************************
* \brief xls文件的单元格内容std::string
* \param pSheet xls文件的sheet对象指针
* \param iRowIndex
* \param iColIndex
* \return std::string为载体
************************************************/
string readXlsCell(ISheetT<char> * pSheet, int iRowIndex, int iColIndex);
/************************************************
* \brief xlsx文件的单元格内容std::string
* \param pSheet xlsx文件的sheet对象指针
* \param iRowIndex
* \param iColIndex
* \return std::string为载体
************************************************/
string readXlsxCell(ISheetT<wchar_t> * pSheet, int iRowIndex, int iColIndex);
#endif // DataManipulation_h__