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
xiaojing.zhang
fmp_vip
Commits
a6840766
Commit
a6840766
authored
Feb 08, 2018
by
NitefullWind
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 修复退款问题。 2. 修复结算时订单信息更新错误问题。
parent
00d44745
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
9 deletions
+43
-9
fmvip/db/item.cpp
+1
-0
fmvip/task/taskfinal.cpp
+16
-2
fmvip/task/taskqrpay.cpp
+8
-2
fmvip/task/taskrefund.cpp
+12
-3
fmvip/windows/fmviprefund.cpp
+5
-1
version.h
+1
-1
No files found.
fmvip/db/item.cpp
View file @
a6840766
...
...
@@ -296,6 +296,7 @@ void Pay::setId(unsigned long id)
StoreInfo
::
StoreInfo
()
:
Item
(),
_id
(
0
),
_storeId
(
""
),
_posId
(
""
),
_operatorId
(
""
),
...
...
fmvip/task/taskfinal.cpp
View file @
a6840766
...
...
@@ -51,8 +51,8 @@ void TaskFinal::packagePOSReq()
_order
->
setOrderAmount
(
getPosJsonValue
(
PosProps
.
OrderAmount
).
toInt
());
_order
->
setUndisAmount
(
getPosJsonValue
(
PosProps
.
UndisAmount
).
toInt
());
QJson
Object
productObj
=
getPosJsonValue
(
PosProps
.
Products
).
toObject
();
QString
productText
=
QJsonDocument
(
product
Obj
).
toJson
(
QJsonDocument
::
Compact
);
QJson
Array
productArray
=
getPosJsonValue
(
PosProps
.
Products
).
toArray
();
QString
productText
=
QJsonDocument
(
product
Array
).
toJson
(
QJsonDocument
::
Compact
);
_order
->
setProductText
(
productText
);
DBSP
()
->
persist
(
_order
);
...
...
@@ -68,6 +68,18 @@ void TaskFinal::packagePOSReq()
setError
(
FM_API_ERROR
,
info
);
return
;
}
if
(
posReqJsonObj
.
contains
(
PosProps
.
OrderAmount
))
{
_order
->
setOrderAmount
(
getPosJsonValue
(
PosProps
.
OrderAmount
).
toInt
());
}
if
(
posReqJsonObj
.
contains
(
PosProps
.
UndisAmount
))
{
_order
->
setUndisAmount
(
getPosJsonValue
(
PosProps
.
UndisAmount
).
toInt
());
}
if
(
posReqJsonObj
.
contains
(
PosProps
.
Products
))
{
QJsonArray
productArray
=
getPosJsonValue
(
PosProps
.
Products
).
toArray
();
QString
productText
=
QJsonDocument
(
productArray
).
toJson
(
QJsonDocument
::
Compact
);
_order
->
setProductText
(
productText
);
}
}
}
catch
(
const
odb
::
exception
&
e
)
{
...
...
@@ -153,6 +165,8 @@ void TaskFinal::packageServerReq()
DBSP
()
->
update
(
_order
);
DBSP
()
->
reload
<
Order
>
(
_order
);
// 从数据库读取支付信息
PayList
payList
=
_order
->
payList
();
...
...
fmvip/task/taskqrpay.cpp
View file @
a6840766
...
...
@@ -45,8 +45,8 @@ void TaskQRPay::packagePOSReq()
_order
->
setOrderAmount
(
getPosJsonValue
(
PosProps
.
OrderAmount
).
toInt
());
_order
->
setUndisAmount
(
getPosJsonValue
(
PosProps
.
UndisAmount
).
toInt
());
QJson
Object
productObj
=
getPosJsonValue
(
PosProps
.
Products
).
toObject
();
QString
productText
=
QJsonDocument
(
product
Obj
).
toJson
(
QJsonDocument
::
Compact
);
QJson
Array
productArray
=
getPosJsonValue
(
PosProps
.
Products
).
toArray
();
QString
productText
=
QJsonDocument
(
product
Array
).
toJson
(
QJsonDocument
::
Compact
);
_order
->
setProductText
(
productText
);
DBSP
()
->
persist
(
_order
);
...
...
@@ -62,6 +62,12 @@ void TaskQRPay::packagePOSReq()
setError
(
FM_API_ERROR
,
info
);
return
;
}
_order
->
setOrderAmount
(
getPosJsonValue
(
PosProps
.
OrderAmount
).
toInt
());
_order
->
setUndisAmount
(
getPosJsonValue
(
PosProps
.
UndisAmount
).
toInt
());
QJsonArray
productArray
=
getPosJsonValue
(
PosProps
.
Products
).
toArray
();
QString
productText
=
QJsonDocument
(
productArray
).
toJson
(
QJsonDocument
::
Compact
);
_order
->
setProductText
(
productText
);
}
QByteArray
reqData
=
QJsonDocument
(
posReqJsonObj
).
toJson
(
QJsonDocument
::
Compact
);
...
...
fmvip/task/taskrefund.cpp
View file @
a6840766
...
...
@@ -49,7 +49,7 @@ void TaskRefund::packagePOSReq()
}
else
{
_order
=
DBSP
()
->
load
<
Order
>
(
r
.
begin
()
->
id
());
// 检查
订单是否已结算
// 检查
支付列表是否为空
if
(
_order
->
payList
().
isEmpty
())
{
QString
info
=
QString
::
fromLocal8Bit
(
"订单中没有可以进行退款的支付."
);
FMP_ERROR
()
<<
info
;
...
...
@@ -76,8 +76,14 @@ void TaskRefund::setWindow()
}
// 未结算,仅有一笔支付则直接退该笔支付
else
if
(
_order
->
payList
().
size
()
==
1
)
{
try
{
transaction
t
(
DBSP
()
->
begin
());
QSharedPointer
<
Pay
>
firstPay
=
_order
->
payList
().
first
().
load
();
t
.
commit
();
onRefundPay
(
firstPay
->
id
());
}
catch
(
const
odb
::
exception
&
e
)
{
FMP_ERROR
()
<<
QString
::
fromLocal8Bit
(
"Exception: "
)
<<
e
.
what
();
}
}
// 其他情况显示界面
else
{
...
...
@@ -104,7 +110,10 @@ void TaskRefund::onRefundPay(unsigned long DBID)
posReqJsonObj
[
PosProps
.
TransId
]
=
session
()
->
data
(
PosProps
.
TransId
).
toString
();
try
{
odb
::
transaction
t
(
DBSP
()
->
begin
());
odb
::
transaction
t
;
if
(
!
odb
::
transaction
::
has_current
())
{
t
.
reset
(
DBSP
()
->
begin
());
}
QSharedPointer
<
Pay
>
payPointer
=
DBSP
()
->
load
<
Pay
>
(
DBID
);
posReqJsonObj
[
PosProps
.
TransId
]
=
payPointer
->
fmTransId
();
...
...
@@ -126,7 +135,7 @@ void TaskRefund::onRefundPay(unsigned long DBID)
qobject_cast
<
FMVipRefund
*>
(
_window
)
->
refresh
();
qobject_cast
<
FMVipRefund
*>
(
_window
)
->
setIsRefundSuccess
(
true
);
}
t
.
commit
();
}
else
{
QString
msg
=
searchJsonValue
(
rspObj
,
PosProps
.
Msg
).
toString
();
FMMsgWnd
::
FailureWnd
(
msg
,
_window
);
...
...
fmvip/windows/fmviprefund.cpp
View file @
a6840766
...
...
@@ -34,7 +34,11 @@ bool FMVipRefund::initWnd(Session *session)
unsigned
long
orderDBID
=
session
->
data
(
"RefundOrderDBID"
).
toULongLong
();
try
{
odb
::
transaction
t
(
DBSP
()
->
begin
());
odb
::
transaction
t
;
if
(
!
odb
::
transaction
::
has_current
())
{
t
.
reset
(
DBSP
()
->
begin
());
}
_pays
.
clear
();
_order
=
DBSP
()
->
load
<
Order
>
(
orderDBID
);
...
...
version.h
View file @
a6840766
...
...
@@ -5,7 +5,7 @@
#define VER_MINOR 1
#define VER_REVISION 0
#define VER_BUILD 4
7
#define VER_BUILD 4
8
//! Convert version numbers to string
#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