重构
This commit is contained in:
		@@ -167,9 +167,11 @@
 | 
			
		||||
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
 | 
			
		||||
    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
 | 
			
		||||
    <LibraryPath>D:\develop\sdk\cpp\Qt\qt_5.10.1\5.10.1\msvc2017_64\lib;$(LibraryPath)</LibraryPath>
 | 
			
		||||
    <IncludePath>$(QTDIR)\include;$(QTDIR)\include\QtCore;$(IncludePath)</IncludePath>
 | 
			
		||||
  </PropertyGroup>
 | 
			
		||||
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
 | 
			
		||||
    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
 | 
			
		||||
    <IncludePath>$(QTDIR)\include;$(QTDIR)\include\QtCore;$(IncludePath)</IncludePath>
 | 
			
		||||
  </PropertyGroup>
 | 
			
		||||
  <Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
 | 
			
		||||
    <Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." />
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,3 @@
 | 
			
		||||
 | 
			
		||||
#include <SQLAPI.h>
 | 
			
		||||
#include <string>
 | 
			
		||||
#include <sstream>
 | 
			
		||||
@@ -10,17 +9,17 @@
 | 
			
		||||
#include "StringCodeConverter.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma comment( lib, "user32.lib")
 | 
			
		||||
#pragma comment( lib, "version.lib")
 | 
			
		||||
#pragma comment( lib, "oleaut32.lib")
 | 
			
		||||
#pragma comment( lib, "ole32.lib")
 | 
			
		||||
#pragma comment( lib, "libxl.lib")
 | 
			
		||||
//#pragma comment( lib, "user32.lib")
 | 
			
		||||
//#pragma comment( lib, "version.lib")
 | 
			
		||||
//#pragma comment( lib, "oleaut32.lib")
 | 
			
		||||
//#pragma comment( lib, "ole32.lib")
 | 
			
		||||
//#pragma comment( lib, "libxl.lib")
 | 
			
		||||
 | 
			
		||||
#ifdef _DEBUG
 | 
			
		||||
#pragma comment( lib, "sqlapisd.lib")
 | 
			
		||||
#else
 | 
			
		||||
#pragma comment( lib, "sqlapis.lib")
 | 
			
		||||
#endif
 | 
			
		||||
// #ifdef _DEBUG
 | 
			
		||||
// #pragma comment( lib, "sqlapisd.lib")
 | 
			
		||||
// #else
 | 
			
		||||
// #pragma comment( lib, "sqlapis.lib")
 | 
			
		||||
// #endif
 | 
			
		||||
 | 
			
		||||
const char g_cszConnectStringIDS6[] =
 | 
			
		||||
		"DRIVER={};"
 | 
			
		||||
@@ -58,8 +57,7 @@ void queryTelsalePolicyGifts( vector<TelSalePolicyGift> &giftList )
 | 
			
		||||
 | 
			
		||||
	try
 | 
			
		||||
	{
 | 
			
		||||
		connection.Connect(
 | 
			
		||||
			g_cszConnstringYwgl,
 | 
			
		||||
		connection.Connect(g_cszConnstringYwgl,
 | 
			
		||||
		                   g_cszUserNameYwgl,
 | 
			
		||||
		                   g_cszPasswordYwgl,
 | 
			
		||||
		                   SA_Informix_Client);
 | 
			
		||||
@@ -110,7 +108,8 @@ void SaveTelSalePolicyInfo(const SPolicyRecord & policy, const vector<TelSalePol
 | 
			
		||||
		strAutotraderCall = "0";
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	ostrCommand << "insert into w_dxbd_i ( jjbj, khjl, khjllx, bdh, zhjywy, zhjywymc, zhjywybm, zhjywybmm, kshdm, kshmc, czydm, czrq , chdlh, chshdm, chshmc, khmc, chph, chjh, fdjh ) "
 | 
			
		||||
	ostrCommand <<
 | 
			
		||||
			"insert into w_dxbd_i ( jjbj, khjl, khjllx, bdh, zhjywy, zhjywymc, zhjywybm, zhjywybmm, kshdm, kshmc, czydm, czrq , chdlh, chshdm, chshmc, khmc, chph, chjh, fdjh ) "
 | 
			
		||||
			"values( 1, 0, 0, "
 | 
			
		||||
			<< "trim('" << policy.strPolicySerial << "'), "
 | 
			
		||||
			<< "trim('" << policy.strSalerCode << "'), "
 | 
			
		||||
@@ -473,7 +472,7 @@ string readXlsCell(ISheetT<char> * pSheet, int iRowIndex, int iColIndex)
 | 
			
		||||
			memset(szNum, NULL, 40);
 | 
			
		||||
 | 
			
		||||
			iCell = pSheet->readNum(iRowIndex, iColIndex);
 | 
			
		||||
		sprintf( szNum, "%d", iCell );
 | 
			
		||||
			sprintf_s(szNum, "%d", iCell);
 | 
			
		||||
			strCell = szNum;
 | 
			
		||||
 | 
			
		||||
			break;
 | 
			
		||||
@@ -508,7 +507,7 @@ string readXlsxCell(ISheetT<wchar_t> * pSheet, int iRowIndex, int iColIndex)
 | 
			
		||||
			memset(szNum, NULL, 40);
 | 
			
		||||
 | 
			
		||||
			iCell = pSheet->readNum(iRowIndex, iColIndex);
 | 
			
		||||
		sprintf( szNum, "%d", iCell );
 | 
			
		||||
			sprintf_s(szNum, "%d", iCell);
 | 
			
		||||
			strReturn = szNum;
 | 
			
		||||
 | 
			
		||||
			break;
 | 
			
		||||
@@ -598,5 +597,3 @@ void readTelsaleXlsxFile( const wstring & filePath, vector<SPolicyRecord> & list
 | 
			
		||||
 | 
			
		||||
	pBook->release();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -17,6 +17,7 @@
 | 
			
		||||
 | 
			
		||||
#include <libxl.h>
 | 
			
		||||
#include <string>
 | 
			
		||||
#include <QtCore/QString>
 | 
			
		||||
#include <vector>
 | 
			
		||||
#include <unordered_map>
 | 
			
		||||
#include "SystemData.h"
 | 
			
		||||
@@ -24,6 +25,7 @@
 | 
			
		||||
using namespace std;
 | 
			
		||||
using namespace libxl;
 | 
			
		||||
 | 
			
		||||
//准备废弃
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
	string strPolicySerial;
 | 
			
		||||
@@ -45,6 +47,29 @@ typedef struct
 | 
			
		||||
	bool   bIsAutotraderCall;
 | 
			
		||||
}          SPolicyRecord;
 | 
			
		||||
 | 
			
		||||
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;
 | 
			
		||||
@@ -62,8 +87,15 @@ typedef struct
 | 
			
		||||
class TelSalePolicyGift
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
	TelSalePolicyGift() {};
 | 
			
		||||
	TelSalePolicyGift( int id, string & name, string & defaultPrice ) : m_id( id ), m_giftName( name ), m_giftDefaultPrice( defaultPrice ) {}
 | 
			
		||||
	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; }
 | 
			
		||||
	void       Id(int val) { m_id = val; }
 | 
			
		||||
@@ -81,7 +113,6 @@ private:
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
//************************************
 | 
			
		||||
// Method:    queryTelsalePolicyGifts
 | 
			
		||||
// FullName:  queryTelsalePolicyGifts
 | 
			
		||||
@@ -138,7 +169,22 @@ void QueryPolicyGifts( const string & strPolicyNo,
 | 
			
		||||
 | 
			
		||||
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__
 | 
			
		||||
		Reference in New Issue
	
	Block a user