修改web版功能
This commit is contained in:
@@ -45,43 +45,43 @@ const static char g_cszConnstringYwgl[] =
|
||||
const static char g_cszUserNameYwgl[] = "ccx99";
|
||||
const static char g_cszPasswordYwgl[] = "c92IT09";
|
||||
|
||||
void queryTelsalePolicyGifts(vector<TelSalePolicyGift>& giftList)
|
||||
{
|
||||
SAConnection connection;
|
||||
SACommand command;
|
||||
|
||||
string strSQL = "select id, trim(name), default_price from w_dx_gifts";
|
||||
|
||||
command.setConnection(&connection);
|
||||
command.setCommandText(strSQL.c_str());
|
||||
|
||||
try
|
||||
{
|
||||
connection.Connect(g_cszConnstringYwgl,
|
||||
g_cszUserNameYwgl,
|
||||
g_cszPasswordYwgl,
|
||||
SA_Informix_Client);
|
||||
|
||||
command.Execute();
|
||||
}
|
||||
catch (SAException& error)
|
||||
{
|
||||
throw runtime_error(error.ErrText());
|
||||
}
|
||||
|
||||
while (command.FetchNext())
|
||||
{
|
||||
TelSalePolicyGift gift;
|
||||
|
||||
gift.Id(command.Field(1).asLong());
|
||||
gift.GiftName((const char *)(command.Field(2).asString()));
|
||||
gift.GiftDefaultPrice((const char *)(command.Field(3).asString()));
|
||||
|
||||
giftList.push_back(gift);
|
||||
}
|
||||
|
||||
connection.Disconnect();
|
||||
}
|
||||
// void queryTelsalePolicyGifts(vector<TelSalePolicyGift>& giftList)
|
||||
// {
|
||||
// SAConnection connection;
|
||||
// SACommand command;
|
||||
//
|
||||
// string strSQL = "select id, trim(name), default_price from w_dx_gifts";
|
||||
//
|
||||
// command.setConnection(&connection);
|
||||
// command.setCommandText(strSQL.c_str());
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// connection.Connect(g_cszConnstringYwgl,
|
||||
// g_cszUserNameYwgl,
|
||||
// g_cszPasswordYwgl,
|
||||
// SA_Informix_Client);
|
||||
//
|
||||
// command.Execute();
|
||||
// }
|
||||
// catch (SAException& error)
|
||||
// {
|
||||
// throw runtime_error(error.ErrText());
|
||||
// }
|
||||
//
|
||||
// while (command.FetchNext())
|
||||
// {
|
||||
// TelSalePolicyGift gift;
|
||||
//
|
||||
// gift.Id(command.Field(1).asLong());
|
||||
// gift.GiftName((const char *)(command.Field(2).asString()));
|
||||
// gift.GiftDefaultPrice((const char *)(command.Field(3).asString()));
|
||||
//
|
||||
// giftList.push_back(gift);
|
||||
// }
|
||||
//
|
||||
// connection.Disconnect();
|
||||
// }
|
||||
|
||||
void SaveTelSalePolicyInfo(const SPolicyRecord& policy, const vector<TelSalePolicyGift>& giftList)
|
||||
{
|
||||
@@ -286,7 +286,7 @@ void QueryTelSalePolicyInfo(const string& strPolicyNo,
|
||||
policy.strInputDate = command.Field("czrq").asString();
|
||||
policy.strCDLH = command.Field("chdlh").asString();
|
||||
|
||||
QueryPolicyGifts(policy.strPolicySerial, policy.strGifts, policy.dGiftPriceSum);
|
||||
//QueryPolicyGifts(policy.strPolicySerial, policy.strGifts, policy.dGiftPriceSum);
|
||||
|
||||
vPolicyInfo.push_back(policy);
|
||||
}
|
||||
@@ -299,66 +299,66 @@ void QueryTelSalePolicyInfo(const string& strPolicyNo,
|
||||
}
|
||||
}
|
||||
|
||||
void QueryPolicyGifts(const string& strPolicyNo, string& strGifts, double dGiftPriceSum)
|
||||
{
|
||||
SAConnection connection;
|
||||
SACommand command;
|
||||
|
||||
string strSQL =
|
||||
"select gift_name, gift_price "
|
||||
" from w_dxbd_gift_i "
|
||||
" where bdh = '" + strPolicyNo + "'";
|
||||
|
||||
string strSQLSum =
|
||||
"select sum( gift_price ) "
|
||||
" from w_dxbd_gift_i "
|
||||
" where bdh = '" + strPolicyNo + "'";
|
||||
|
||||
try
|
||||
{
|
||||
command.setConnection(&connection);
|
||||
command.setCommandText(strSQL.c_str());
|
||||
|
||||
connection.Connect(g_cszConnstringYwgl,
|
||||
g_cszUserNameYwgl,
|
||||
g_cszPasswordYwgl,
|
||||
SA_Informix_Client);
|
||||
|
||||
command.Execute();
|
||||
|
||||
strGifts.clear();
|
||||
dGiftPriceSum = 0.0;
|
||||
|
||||
while (command.FetchNext())
|
||||
{
|
||||
if (!strGifts.empty())
|
||||
{
|
||||
strGifts.append("; ");
|
||||
}
|
||||
|
||||
strGifts.append(command.Field("gift_name").asString());
|
||||
strGifts.append(" ");
|
||||
strGifts.append(command.Field("gift_price").asString());
|
||||
strGifts.append("元");
|
||||
|
||||
dGiftPriceSum += command.Field("gift_price").asDouble();
|
||||
}
|
||||
|
||||
/*command.setCommandText( strSQLSum.c_str() );
|
||||
command.Execute();
|
||||
|
||||
if ( command.FetchNext() )
|
||||
{
|
||||
strGiftPriceSum = command.Field( 0 ).asString();
|
||||
}*/
|
||||
|
||||
connection.Disconnect();
|
||||
}
|
||||
catch (SAException& error)
|
||||
{
|
||||
throw runtime_error(error.ErrText());
|
||||
}
|
||||
}
|
||||
// void QueryPolicyGifts(const string& strPolicyNo, string& strGifts, double dGiftPriceSum)
|
||||
// {
|
||||
// SAConnection connection;
|
||||
// SACommand command;
|
||||
//
|
||||
// string strSQL =
|
||||
// "select gift_name, gift_price "
|
||||
// " from w_dxbd_gift_i "
|
||||
// " where bdh = '" + strPolicyNo + "'";
|
||||
//
|
||||
// string strSQLSum =
|
||||
// "select sum( gift_price ) "
|
||||
// " from w_dxbd_gift_i "
|
||||
// " where bdh = '" + strPolicyNo + "'";
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// command.setConnection(&connection);
|
||||
// command.setCommandText(strSQL.c_str());
|
||||
//
|
||||
// connection.Connect(g_cszConnstringYwgl,
|
||||
// g_cszUserNameYwgl,
|
||||
// g_cszPasswordYwgl,
|
||||
// SA_Informix_Client);
|
||||
//
|
||||
// command.Execute();
|
||||
//
|
||||
// strGifts.clear();
|
||||
// dGiftPriceSum = 0.0;
|
||||
//
|
||||
// while (command.FetchNext())
|
||||
// {
|
||||
// if (!strGifts.empty())
|
||||
// {
|
||||
// strGifts.append("; ");
|
||||
// }
|
||||
//
|
||||
// strGifts.append(command.Field("gift_name").asString());
|
||||
// strGifts.append(" ");
|
||||
// strGifts.append(command.Field("gift_price").asString());
|
||||
// strGifts.append("元");
|
||||
//
|
||||
// dGiftPriceSum += command.Field("gift_price").asDouble();
|
||||
// }
|
||||
//
|
||||
// /*command.setCommandText( strSQLSum.c_str() );
|
||||
// command.Execute();
|
||||
//
|
||||
// if ( command.FetchNext() )
|
||||
// {
|
||||
// strGiftPriceSum = command.Field( 0 ).asString();
|
||||
// }*/
|
||||
//
|
||||
// connection.Disconnect();
|
||||
// }
|
||||
// catch (SAException& error)
|
||||
// {
|
||||
// throw runtime_error(error.ErrText());
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
/*void readTelsaleXlsFile(const string strFilePath, vector<SPolicyRecord> & listPolicy, bool hasTitle, bool isXML )
|
||||
|
@@ -47,27 +47,7 @@ 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
|
||||
@@ -84,6 +64,8 @@ typedef struct
|
||||
string strInputDate;
|
||||
} SPolicyQuery;
|
||||
|
||||
|
||||
|
||||
class TelSalePolicyGift
|
||||
{
|
||||
public:
|
||||
@@ -91,20 +73,20 @@ public:
|
||||
{
|
||||
};
|
||||
|
||||
TelSalePolicyGift(int id, const string & name, const 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; }
|
||||
void Id(int val) { m_id = val; }
|
||||
void Id( int val ) { m_id = val; }
|
||||
|
||||
string GiftName() const { return m_giftName; }
|
||||
void GiftName(string val) { m_giftName = val; }
|
||||
void GiftName( string val ) { m_giftName = val; }
|
||||
|
||||
string GiftDefaultPrice() const { return m_giftDefaultPrice; }
|
||||
void GiftDefaultPrice(string val) { m_giftDefaultPrice = val; }
|
||||
void GiftDefaultPrice( string val ) { m_giftDefaultPrice = val; }
|
||||
|
||||
private:
|
||||
int m_id;
|
||||
@@ -121,7 +103,7 @@ private:
|
||||
// Qualifier: 查询礼品信息
|
||||
// Parameter: vector<TelSalePolicyGift> & giftList 礼品列表
|
||||
//************************************
|
||||
void queryTelsalePolicyGifts(vector<TelSalePolicyGift> & giftList);
|
||||
//void queryTelsalePolicyGifts(vector<TelSalePolicyGift> & giftList);
|
||||
|
||||
//************************************
|
||||
// Method: SaveTelSalePolicyInfo
|
||||
@@ -132,7 +114,7 @@ void queryTelsalePolicyGifts(vector<TelSalePolicyGift> & giftList);
|
||||
// Parameter: const SPolicyRecord & policy
|
||||
// Parameter: const vector<TelSalePolicyGift> & giftList
|
||||
//************************************
|
||||
void SaveTelSalePolicyInfo(const SPolicyRecord & policy, const vector<TelSalePolicyGift> & giftList);
|
||||
void SaveTelSalePolicyInfo( const SPolicyRecord & policy, const vector<TelSalePolicyGift> & giftList );
|
||||
|
||||
//************************************
|
||||
// Method: QueryTelSalePolicyInfo
|
||||
@@ -146,11 +128,11 @@ void SaveTelSalePolicyInfo(const SPolicyRecord & policy, const vector<TelSalePol
|
||||
// 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);
|
||||
void QueryTelSalePolicyInfo( const string & strPolicyNo,
|
||||
const string & strOperatorCode,
|
||||
const string & strStartDate,
|
||||
const string & strEndDate,
|
||||
vector<SPolicyQuery> & vPolicyInfo );
|
||||
|
||||
//************************************
|
||||
// Method: QueryPolicyGifts
|
||||
@@ -161,13 +143,13 @@ void QueryTelSalePolicyInfo(const string & strPolicyNo,
|
||||
// Parameter: const string & strPolicyNo
|
||||
// Parameter: string & strGifts
|
||||
//************************************
|
||||
void QueryPolicyGifts(const string & strPolicyNo,
|
||||
string & strGifts,
|
||||
double dGiftPriceSum);
|
||||
// void QueryPolicyGifts(const string & strPolicyNo,
|
||||
// string & strGifts,
|
||||
// double dGiftPriceSum);
|
||||
|
||||
//void readTelsaleXlsFile( const string & strFilePath, vector<SPolicyRecord> & listPolicy, bool hasTitle, bool isXML );
|
||||
|
||||
void readTelsaleXlsxFile(const wstring & filePath, vector<SPolicyRecord> & listPolicy, bool hasTitle);
|
||||
void readTelsaleXlsxFile( const wstring & filePath, vector<SPolicyRecord> & listPolicy, bool hasTitle );
|
||||
|
||||
/************************************************
|
||||
* \brief 读取xls文件的单元格内容,返回std::string
|
||||
@@ -176,7 +158,7 @@ void readTelsaleXlsxFile(const wstring & filePath, vector<SPolicyRecord> & listP
|
||||
* \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
|
||||
@@ -185,6 +167,6 @@ string readXlsCell(ISheetT<char> * pSheet, int iRowIndex, int iColIndex);
|
||||
* \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__
|
||||
|
@@ -168,6 +168,9 @@
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="pEditPassword">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="maxLength">
|
||||
<number>999</number>
|
||||
</property>
|
||||
@@ -284,7 +287,7 @@
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources>
|
||||
<include location="resource.qrc"/>
|
||||
<include location="resources.qrc"/>
|
||||
<include location="resource.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
@@ -86,7 +86,7 @@ void QTelSalePolicyInfoInputWidget::InitGiftTable()
|
||||
|
||||
try
|
||||
{
|
||||
queryTelsalePolicyGifts( giftsList );
|
||||
//queryTelsalePolicyGifts( giftsList );
|
||||
}
|
||||
catch ( runtime_error & error )
|
||||
{
|
||||
|
Reference in New Issue
Block a user