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
107b62e6
Commit
107b62e6
authored
Jun 21, 2017
by
NitefullWind
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 开发结算和退款接口。
parent
84c508d0
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
30 deletions
+64
-30
global.h
+8
-7
task/taskfactory.cpp
+3
-11
task/taskfinal.cpp
+9
-7
task/taskothers.cpp
+31
-5
task/taskothers.h
+13
-0
No files found.
global.h
View file @
107b62e6
...
...
@@ -16,9 +16,7 @@ const static QStringList FM_Type_List = QString(
"member_charge_request,"
"order_request,"
"integral_request,"
"order_refund_request,"
"charge_refund_request,"
"order_revoke_request"
).
split
(
","
);
"refund_request"
).
split
(
","
);
// 服务端请求类型
const
static
QStringList
FM_Server_Type
=
QString
(
...
...
@@ -27,9 +25,9 @@ const static QStringList FM_Server_Type = QString(
"member_charge_request,"
"order_request,"
"integral_request,"
"refund,"
"order_refund_request,"
"charge_refund_request,"
"order_revoke_request"
).
split
(
","
);
"order_correct_request"
).
split
(
","
);
// 请求类型的枚举值
enum
FM_TYPE
{
...
...
@@ -38,9 +36,9 @@ enum FM_TYPE {
FM_Fund
,
FM_Pay
,
FM_Final
,
FM_Refund
,
FM_Order_Refund
,
FM_Charge_Refund
,
FM_Order_Revoke
FM_Order_Correct
};
enum
Member_Type
{
...
...
@@ -205,6 +203,9 @@ const PropsMap::value_type PropsMapPairs[] =
PropsMap
::
value_type
(
PosProps
.
OrderAmount
,
"amount"
),
PropsMap
::
value_type
(
PosProps
.
PaidAmount
,
"pay_amount"
),
PropsMap
::
value_type
(
PosProps
.
CodeAmount
,
"code_amount"
),
PropsMap
::
value_type
(
PosProps
.
CashAmount
,
"cash_amount"
),
PropsMap
::
value_type
(
PosProps
.
ScoreAmount
,
"score_amount"
),
PropsMap
::
value_type
(
PosProps
.
ThirdAmount
,
"third_amount"
),
PropsMap
::
value_type
(
PosProps
.
Transaction
,
"transaction"
),
PropsMap
::
value_type
(
PosProps
.
CouponList
,
"coupon_list"
),
PropsMap
::
value_type
(
PosProps
.
Coupon_disAmount
,
"dis_amount"
),
...
...
task/taskfactory.cpp
View file @
107b62e6
#include "taskfactory.h"
#
include
"taskfactory.h"
#include "tasklogin.h"
#include "taskpay.h"
#include "taskfund.h"
...
...
@@ -45,16 +45,8 @@ FMTask* TaskFactory::Task(QByteArray data)
task
=
new
TaskCoupon
(
jsonObj
);
break
;
}
case
FM_Order_Refund
:
{
task
=
new
TaskRefundOrder
(
jsonObj
);
break
;
}
case
FM_Order_Revoke
:
{
task
=
new
TaskRefundPay
(
jsonObj
);
break
;
}
case
FM_Charge_Refund
:
{
task
=
new
TaskRefundOrder
(
jsonObj
);
case
FM_Refund
:
{
task
=
new
TaskRefund
(
jsonObj
);
break
;
}
default
:
...
...
task/taskfinal.cpp
View file @
107b62e6
...
...
@@ -2,6 +2,7 @@
#include "fmbackup.h"
#include <QDateTime>
#include <QJsonDocument>
#include <QDebug>
TaskFinal
::
TaskFinal
(
QJsonObject
&
jsonObj
,
QObject
*
parent
)
:
FMTaskNoWnd
(
jsonObj
,
FM_Final
,
0
,
parent
)
...
...
@@ -13,8 +14,9 @@ void TaskFinal::packageServerReq()
std
::
vector
<
QString
>
p1
;
p1
.
push_back
(
PosProps
.
Fm_id
);
p1
.
push_back
(
PosProps
.
TransId
);
foreach
(
auto
prop
,
p1
)
{
serverRspJsonObj
[
ServerProps
(
prop
)]
=
getPosJsonValue
(
prop
);
foreach
(
QString
prop
,
p1
)
{
qDebug
()
<<
prop
<<
getPosJsonValue
(
prop
);
serverReqJsonObj
[
ServerProps
(
prop
)]
=
getPosJsonValue
(
prop
);
}
QJsonObject
trans
;
...
...
@@ -22,7 +24,7 @@ void TaskFinal::packageServerReq()
p2
.
push_back
(
PosProps
.
Fm_open_id
);
p2
.
push_back
(
PosProps
.
OrderAmount
);
p2
.
push_back
(
PosProps
.
PaidAmount
);
foreach
(
auto
prop
,
p2
)
{
foreach
(
QString
prop
,
p2
)
{
trans
[
ServerProps
(
prop
)]
=
getPosJsonValue
(
prop
);
}
...
...
@@ -30,7 +32,7 @@ void TaskFinal::packageServerReq()
// 储值金、积分、第三方、代金券
int
codeAmount
=
0
,
scoreAmount
=
0
,
cashAmount
=
0
,
thirdAmount
=
0
;
trans
[
"third
PayT
ype"
]
=
4
;
trans
[
"third
_pay_t
ype"
]
=
4
;
foreach
(
auto
pay_v
,
getPosJsonValue
(
PosProps
.
Pay_ids
).
toArray
())
{
QJsonObject
pay_ob
=
pay_v
.
toObject
();
...
...
@@ -43,12 +45,12 @@ void TaskFinal::packageServerReq()
coupons
.
append
(
pay_ob
[
PosProps
.
Coupon_code
].
toString
());
}
else
if
(
type
==
"10001"
||
type
==
"10004"
)
{
thirdAmount
=
pay_ob
[
PosProps
.
Pay_amount
].
toInt
();
trans
[
ServerProps
(
PosProps
.
Pay_transId
)
]
=
pay_ob
[
PosProps
.
Pay_transId
];
trans
[
"third_pay_trans_id"
]
=
pay_ob
[
PosProps
.
Pay_transId
];
if
(
type
==
"10001"
)
{
// 支付宝
trans
[
"third
PayT
ype"
]
=
1
;
trans
[
"third
_pay_t
ype"
]
=
1
;
}
else
if
(
type
==
"10004"
)
{
// 微信
trans
[
"third
PayT
ype"
]
=
2
;
trans
[
"third
_pay_t
ype"
]
=
2
;
}
}
}
...
...
task/taskothers.cpp
View file @
107b62e6
...
...
@@ -60,9 +60,37 @@ void TaskCoupon::packagePOSRsp()
TaskRefund
::
TaskRefund
(
QJsonObject
&
jsonObj
,
QObject
*
parent
)
:
FMTaskNoWnd
(
jsonObj
,
FM_Refund
,
0
,
parent
)
{
}
void
TaskRefund
::
packageServerReq
()
{
}
void
TaskRefund
::
packagePOSRsp
()
{
}
QByteArray
TaskRefund
::
doTask
()
{
if
(
posReqJsonObj
.
contains
(
PosProps
.
Fm_id
)
&&
getPosJsonValue
(
PosProps
.
Fm_id
).
toString
()
!=
""
)
{
TaskRefundOrder
task
(
posReqJsonObj
,
this
);
return
task
.
doTask
();
}
else
{
TaskRefundPay
task
(
posReqJsonObj
,
this
);
return
task
.
doTask
();
}
}
TaskRefundPay
::
TaskRefundPay
(
QJsonObject
&
jsonObj
,
QObject
*
parent
)
:
FMTaskNoWnd
(
jsonObj
,
FM_Order_Re
voke
,
0
,
parent
)
:
FMTaskNoWnd
(
jsonObj
,
FM_Order_Re
fund
,
0
,
parent
)
{
}
...
...
@@ -85,16 +113,14 @@ void TaskRefundPay::packagePOSRsp()
TaskRefundOrder
::
TaskRefundOrder
(
QJsonObject
&
jsonObj
,
QObject
*
parent
)
:
FMTaskNoWnd
(
jsonObj
,
FM_Order_
Refund
,
0
,
parent
)
:
FMTaskNoWnd
(
jsonObj
,
FM_Order_
Correct
,
0
,
parent
)
{
}
void
TaskRefundOrder
::
packageServerReq
()
{
QJsonObject
trans
;
trans
[
ServerProps
(
PosProps
.
Fm_id
)]
=
getPosJsonValue
(
PosProps
.
Fm_id
);
serverReqJsonObj
[
ServerProps
(
PosProps
.
Transaction
)]
=
trans
;
serverReqJsonObj
[
ServerProps
(
PosProps
.
Fm_id
)]
=
getPosJsonValue
(
PosProps
.
Fm_id
);
}
void
TaskRefundOrder
::
packagePOSRsp
()
...
...
task/taskothers.h
View file @
107b62e6
...
...
@@ -13,6 +13,19 @@ public:
void
packagePOSRsp
();
};
// POS退款
class
TaskRefund
:
public
FMTaskNoWnd
{
Q_OBJECT
public
:
explicit
TaskRefund
(
QJsonObject
&
jsonObj
,
QObject
*
parent
=
0
);
void
packageServerReq
();
void
packagePOSRsp
();
protected
:
QByteArray
doTask
();
};
// 支付退款
class
TaskRefundPay
:
public
FMTaskNoWnd
{
...
...
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