Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmp_epay
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhenfei.zhang
fmp_epay
Commits
c906f78f
Commit
c906f78f
authored
Nov 06, 2017
by
gujin.wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改一些崩溃bug
parent
e6812a0b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
62 additions
and
15 deletions
+62
-15
cquerythread.cpp
+1
-0
fmp_database.cpp
+7
-2
fmp_epay_checkmodel.h
+6
-1
fmp_epay_p.cpp
+0
-0
fmp_epay_p.h
+9
-2
fmp_epayview_dialog.cpp
+28
-8
fmp_epayview_dialog.h
+10
-1
version.h
+1
-1
No files found.
cquerythread.cpp
View file @
c906f78f
...
@@ -35,6 +35,7 @@ void CQueryThread::trySend()
...
@@ -35,6 +35,7 @@ void CQueryThread::trySend()
//write sqlite
//write sqlite
outjson
[
FMP_EPAY_TRANSID
]
=
_reqJson
[
FMP_EPAY_TRANSID
];
outjson
[
FMP_EPAY_TRANSID
]
=
_reqJson
[
FMP_EPAY_TRANSID
];
_fmPay
->
updateSqlite
(
outjson
);
_fmPay
->
updateSqlite
(
outjson
);
_fmPay
->
UpdateViewDetail
();
}
}
}
}
...
...
fmp_database.cpp
View file @
c906f78f
...
@@ -9,8 +9,13 @@
...
@@ -9,8 +9,13 @@
FMPDataBase
::
FMPDataBase
(
QString
dbname
,
QString
connectname
,
QObject
*
parent
)
:
QObject
(
parent
)
FMPDataBase
::
FMPDataBase
(
QString
dbname
,
QString
connectname
,
QObject
*
parent
)
:
QObject
(
parent
)
{
{
_db
=
QSqlDatabase
::
addDatabase
(
"QSQLITE"
,
connectname
);
if
(
!
QSqlDatabase
::
contains
(
connectname
))
{
_db
.
setDatabaseName
(
dbname
);
_db
=
QSqlDatabase
::
addDatabase
(
"QSQLITE"
,
connectname
);
}
else
{
_db
=
QSqlDatabase
::
database
(
connectname
);
}
_db
.
setDatabaseName
(
dbname
);
_isopen
=
_db
.
open
();
_isopen
=
_db
.
open
();
}
}
...
...
fmp_epay_checkmodel.h
View file @
c906f78f
...
@@ -48,7 +48,12 @@ public:
...
@@ -48,7 +48,12 @@ public:
}
}
}
}
return
QSqlTableModel
::
data
(
idx
,
role
);
if
(
QSqlTableModel
::
hasIndex
(
idx
.
row
(),
idx
.
column
()))
{
return
QSqlTableModel
::
data
(
idx
,
role
);
}
else
{
return
QVariant
();
}
}
}
};
};
...
...
fmp_epay_p.cpp
View file @
c906f78f
This diff is collapsed.
Click to expand it.
fmp_epay_p.h
View file @
c906f78f
...
@@ -72,6 +72,8 @@ public:
...
@@ -72,6 +72,8 @@ public:
bool
HttpPost
(
QJsonObject
&
outjson
,
QJsonObject
json
,
QString
&
error
,
int
timeout
=
60
);
bool
HttpPost
(
QJsonObject
&
outjson
,
QJsonObject
json
,
QString
&
error
,
int
timeout
=
60
);
void
GetDailyBillData
(
QVector
<
PayDetail
>
&
vecPay
);
void
GetDailyBillData
(
QVector
<
PayDetail
>
&
vecPay
);
void
UpdateViewDetail
();
//更新列表显示
void
WriteRedeemToSqlite
(
QJsonObject
redeemInfo
);
void
WriteRedeemToSqlite
(
QJsonObject
redeemInfo
);
FMPDataBase
*
GetDB
()
const
;
FMPDataBase
*
GetDB
()
const
;
...
@@ -98,14 +100,18 @@ private:
...
@@ -98,14 +100,18 @@ private:
void
CheckErrorOrder
();
//查询异常订单,如果有异常订单,则进入查询状态
void
CheckErrorOrder
();
//查询异常订单,如果有异常订单,则进入查询状态
signals
:
signals
:
void
apiFinished
();
void
apiError
();
void
apiError
();
void
apiFinish
();
void
error
(
QString
errormsg
);
void
error
(
QString
errormsg
);
void
finished
(
QJsonObject
json
);
void
finished
(
QJsonObject
json
);
protected
slots
:
protected
slots
:
void
witedata
();
void
witedata
();
void
payVip
();
void
vipFinal
();
QString
final
(
QString
fm_open_id
=
QString
());
public
:
public
:
FMPePay
*
q_ptr
;
FMPePay
*
q_ptr
;
...
@@ -119,6 +125,7 @@ public:
...
@@ -119,6 +125,7 @@ public:
CQueryThread
*
_queryThread
;
CQueryThread
*
_queryThread
;
ReverseThread
*
_reverseThread
;
ReverseThread
*
_reverseThread
;
QString
_pos_trans_id
;
QString
_pos_trans_id
;
QJsonObject
_origin_request
;
private
:
private
:
bool
_reverse_flag
;
bool
_reverse_flag
;
...
@@ -129,7 +136,7 @@ private:
...
@@ -129,7 +136,7 @@ private:
QSqlTableModel
*
_model
;
QSqlTableModel
*
_model
;
QFutureWatcher
<
QByteArray
>
*
_watcher
;
QFutureWatcher
<
QByteArray
>
*
_watcher
;
QJsonObject
_origin_request
;
QJsonObject
_docked_request
;
QJsonObject
_docked_request
;
QJsonObject
_origin_response
;
QJsonObject
_origin_response
;
QJsonObject
_docked_response
;
QJsonObject
_docked_response
;
...
...
fmp_epayview_dialog.cpp
View file @
c906f78f
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
#include "fmp_home_i.h"
#include "fmp_home_i.h"
#include "fmp_detaildialog.h"
#include "fmp_detaildialog.h"
#include "fmp_database.h"
#include "fmp_database.h"
#include "fmp_vip_i.h"
#include <QDebug>
#include <QDebug>
#include <fmp_settings_i.h>
#include <fmp_settings_i.h>
...
@@ -27,6 +28,8 @@
...
@@ -27,6 +28,8 @@
#include <QTableWidget>
#include <QTableWidget>
#include <QSqlQuery>
#include <QSqlQuery>
#include <QMessageBox>
#include <QMessageBox>
#include <QTcpSocket>
#include <QHostAddress>
FMPPayDialog
::
FMPPayDialog
(
FMPePayPrivate
*
control
,
QVariantHash
basicinfo
,
QWidget
*
parent
)
:
FMPPayDialog
::
FMPPayDialog
(
FMPePayPrivate
*
control
,
QVariantHash
basicinfo
,
QWidget
*
parent
)
:
_control
(
control
),
_control
(
control
),
...
@@ -274,6 +277,19 @@ void FMPPayDialog::show()
...
@@ -274,6 +277,19 @@ void FMPPayDialog::show()
return
QDialog
::
show
();
return
QDialog
::
show
();
}
}
void
FMPPayDialog
::
WidgetChange
()
{
//异常订单查询到支付结果后,更新列显示
if
(
_curt_btn
->
property
(
"index"
).
toInt
()
==
3
)
setWaitPayView
();
if
(
_curt_btn
->
property
(
"index"
).
toInt
()
==
4
)
setErrorOrderView
();
if
(
_curt_btn
->
property
(
"index"
).
toInt
()
==
5
)
setSuccessView
();
}
void
FMPPayDialog
::
onWidgetChange
()
void
FMPPayDialog
::
onWidgetChange
()
{
{
QPushButton
*
tmpcur
=
_curt_btn
;
QPushButton
*
tmpcur
=
_curt_btn
;
...
@@ -498,6 +514,7 @@ void FMPPayDialog::setPaySuccessView(QJsonObject json)
...
@@ -498,6 +514,7 @@ void FMPPayDialog::setPaySuccessView(QJsonObject json)
_success_flag
=
true
;
_success_flag
=
true
;
PlayAnimation
(
findChild
<
QWidget
*>
(
_curt_btn
->
property
(
"pageName"
).
toString
()),
ui
->
wdg_success_main
,
RightToLeft
);
PlayAnimation
(
findChild
<
QWidget
*>
(
_curt_btn
->
property
(
"pageName"
).
toString
()),
ui
->
wdg_success_main
,
RightToLeft
);
ui
->
btn_pay
->
setEnabled
(
false
);
}
}
void
FMPPayDialog
::
setRefundSuccessView
(
QJsonObject
json
)
void
FMPPayDialog
::
setRefundSuccessView
(
QJsonObject
json
)
...
@@ -855,7 +872,7 @@ void FMPPayDialog::PlayAnimation(QWidget *target0, QWidget *target1, Movemode mo
...
@@ -855,7 +872,7 @@ void FMPPayDialog::PlayAnimation(QWidget *target0, QWidget *target1, Movemode mo
//确定按钮
//确定按钮
void
FMPPayDialog
::
onBtnConfirmClicked
()
void
FMPPayDialog
::
onBtnConfirmClicked
()
{
{
if
(
_wait
==
NULL
)
if
(
_wait
==
NULL
)
{
{
_wait
=
new
FMPPayWait
(
this
);
_wait
=
new
FMPPayWait
(
this
);
...
@@ -901,10 +918,12 @@ void FMPPayDialog::onBtnConfirmClicked()
...
@@ -901,10 +918,12 @@ void FMPPayDialog::onBtnConfirmClicked()
return
;
return
;
}
}
if
(
ui
->
btn_pay
->
isChecked
())
if
(
ui
->
btn_pay
->
isChecked
())
{
{
_wait
->
SetContent
(
FMPPayWait
::
LOADING
,
QString
::
fromLocal8Bit
(
"支付中..."
));
_wait
->
SetContent
(
FMPPayWait
::
LOADING
,
QString
::
fromLocal8Bit
(
"支付中..."
));
_control
->
ControlPayJson
(
ui
->
lineedit_num
->
text
(),
ui
->
lineedit_code
->
text
());
_control
->
ControlPayJson
(
ui
->
lineedit_num
->
text
(),
ui
->
lineedit_code
->
text
());
}
}
else
else
{
{
...
@@ -936,17 +955,17 @@ void FMPPayDialog::on_btn_close_clicked()
...
@@ -936,17 +955,17 @@ void FMPPayDialog::on_btn_close_clicked()
{
{
if
(
!
_control
->
_is_api
){
if
(
!
_control
->
_is_api
){
this
->
close
();
this
->
close
();
_control
->
Uninit
();
_control
->
Uninit
();
}
}
else
{
else
{
if
(
!
_success_flag
){
if
(
!
_success_flag
&&!
_control
->
_queryThread
->
isRunning
()
){
fmp_forceClose_dialog
*
_force_close
=
new
fmp_forceClose_dialog
(
this
);
fmp_forceClose_dialog
*
_force_close
=
new
fmp_forceClose_dialog
(
this
);
_force_close
->
setModal
(
true
);
_force_close
->
setModal
(
true
);
_force_close
->
show
();
_force_close
->
show
();
}
}
else
{
else
{
this
->
close
();
this
->
close
();
_control
->
Uninit
();
//
_control->Uninit();
}
}
}
}
}
}
...
@@ -993,10 +1012,10 @@ void FMPPayDialog::on_btn_success_confirm_clicked()
...
@@ -993,10 +1012,10 @@ void FMPPayDialog::on_btn_success_confirm_clicked()
QWidget
*
nextwdg
=
findChild
<
QWidget
*>
(
_curt_btn
->
property
(
"pageName"
).
toString
());
QWidget
*
nextwdg
=
findChild
<
QWidget
*>
(
_curt_btn
->
property
(
"pageName"
).
toString
());
PlayAnimation
(
ui
->
wdg_success_main
,
nextwdg
,
LeftToRight
);
PlayAnimation
(
ui
->
wdg_success_main
,
nextwdg
,
LeftToRight
);
if
(
_control
->
_is_api
)
if
(
_control
->
_is_api
)
{
emit
apiFinished
();
on_btn_close_clicked
();
on_btn_close_clicked
();
}
_success_flag
=
false
;
}
}
void
FMPPayDialog
::
on_btn_paycheck_clicked
()
void
FMPPayDialog
::
on_btn_paycheck_clicked
()
...
@@ -1242,4 +1261,4 @@ void FMPPayDialog::Reverse()
...
@@ -1242,4 +1261,4 @@ void FMPPayDialog::Reverse()
}
}
}
}
_reverses
.
clear
();
_reverses
.
clear
();
}
}
\ No newline at end of file
fmp_epayview_dialog.h
View file @
c906f78f
...
@@ -62,7 +62,11 @@ public slots:
...
@@ -62,7 +62,11 @@ public slots:
void
setBasicInfo
(
QVariantHash
basicinfo
);
void
setBasicInfo
(
QVariantHash
basicinfo
);
void
on_cash_pay
();
void
on_cash_pay
();
void
on_force_close
();
void
on_force_close
();
void
WidgetChange
();
protected
:
protected
:
void
keyPressEvent
(
QKeyEvent
*
);
void
keyPressEvent
(
QKeyEvent
*
);
...
@@ -103,6 +107,7 @@ private slots:
...
@@ -103,6 +107,7 @@ private slots:
void
redeem
();
void
redeem
();
void
ShowPayDetail
(
const
QModelIndex
&
index
);
void
ShowPayDetail
(
const
QModelIndex
&
index
);
public
:
public
:
void
setPayView
();
void
setPayView
();
...
@@ -112,6 +117,9 @@ public:
...
@@ -112,6 +117,9 @@ public:
void
Reverse
();
void
Reverse
();
void
Reverse
(
const
QJsonObject
&
reverseReq
);
void
Reverse
(
const
QJsonObject
&
reverseReq
);
signals
:
void
apiFinished
();
private
:
private
:
...
@@ -141,6 +149,7 @@ public:
...
@@ -141,6 +149,7 @@ public:
int
_pay_total
;
//一笔订单的支付总额,包括 扫码支付额、卡券支付额......
int
_pay_total
;
//一笔订单的支付总额,包括 扫码支付额、卡券支付额......
QStringList
couponDes
;
QStringList
couponDes
;
QVector
<
QJsonObject
>
_redeem_results
;
//保存每张券的核销结果
QVector
<
QJsonObject
>
_redeem_results
;
//保存每张券的核销结果
private
:
private
:
Ui
::
FMPPayDialog
*
ui
;
Ui
::
FMPPayDialog
*
ui
;
...
...
version.h
View file @
c906f78f
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#define VER_MINOR 1
#define VER_MINOR 1
#define VER_REVISION 0
#define VER_REVISION 0
#define VER_BUILD
19
#define VER_BUILD
26
//! Convert version numbers to string
//! Convert version numbers to string
#define _STR(S) #S
#define _STR(S) #S
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment