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