Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmp_vip
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_vip
Commits
4305996f
Commit
4305996f
authored
Jul 26, 2017
by
NitefullWind
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 将POS发来的商品单价,以分为单位传给服务端。 2. 支付超时后,自动发起退款。 3. 与服务端超时时间设置为60秒。
parent
ea7f1f7d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
4 deletions
+13
-4
fmnetwork.cpp
+2
-1
task/taskfinal.cpp
+2
-2
task/taskpay.cpp
+9
-1
No files found.
fmnetwork.cpp
View file @
4305996f
...
...
@@ -44,7 +44,8 @@ int FMNetwork::send(const QString &url, const QByteArray &reqData, QByteArray &r
QTimer
timer
;
timer
.
setSingleShot
(
true
);
connect
(
&
timer
,
SIGNAL
(
timeout
()),
&
loop
,
SLOT
(
quit
()));
timer
.
start
(
1000
*
30
);
timer
.
start
(
1000
*
60
);
loop
.
exec
();
if
(
timer
.
isActive
())
...
...
task/taskfinal.cpp
View file @
4305996f
...
...
@@ -34,7 +34,8 @@ void TaskFinal::packageServerReq()
{
QJsonObject
product
;
product
[
"consumNum"
]
=
p
.
toObject
()[
"consume_num"
];
product
[
"price"
]
=
p
.
toObject
()[
"price"
];
int
price
=
p
.
toObject
()[
"price"
].
toDouble
()
*
100
;
product
[
"price"
]
=
price
;
product
[
"productId"
]
=
p
.
toObject
()[
"pid"
];
products
.
append
(
product
);
...
...
@@ -76,7 +77,6 @@ bool TaskFinal::sendToServer(bool isShowMsg)
// 备份
if
(
error
()
==
FM_API_NETWORERROR
)
{
if
(
searchJsonValue
(
serverReqJsonObj
,
ServerProps
(
PosProps
.
CodeAmount
)).
toInt
()
==
0
&&
searchJsonValue
(
serverReqJsonObj
,
ServerProps
(
PosProps
.
ScoreAmount
)).
toInt
()
==
0
&&
searchJsonValue
(
serverReqJsonObj
,
ServerProps
(
PosProps
.
Coupons
)).
toArray
().
isEmpty
())
{
...
...
task/taskpay.cpp
View file @
4305996f
...
...
@@ -82,7 +82,8 @@ void TaskPay::packageServerReq()
QJsonObject
obj
=
clientArray
[
i
].
toObject
();
QJsonObject
serverObj
;
serverObj
[
"consumeNum"
]
=
obj
[
"consume_num"
];
serverObj
[
"price"
]
=
obj
[
"price"
].
toInt
();
int
price
=
obj
[
"price"
].
toString
().
toDouble
()
*
100
;
serverObj
[
"price"
]
=
price
;
serverObj
[
"productId"
]
=
obj
[
"pid"
];
products
.
push_back
(
serverObj
);
}
...
...
@@ -165,5 +166,12 @@ void TaskPay::packagePOSRsp()
void
TaskPay
::
onPay
()
{
sendToServer
();
if
(
error
()
==
FM_API_TIMEOUT
)
{
FMP_INFO
()
<<
"Pay failed: timeout. To reversal."
;
TaskRefundPay
taskRefundPay
(
posReqJsonObj
);
taskRefundPay
.
doTask
();
}
_window
->
accept
();
}
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