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
064b676c
Commit
064b676c
authored
Nov 08, 2017
by
gujin.wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加卡券支付
parent
ce2bca46
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
13 deletions
+32
-13
fmvip/fmvipdispatcher.cpp
+18
-1
fmvip/global.h
+14
-12
No files found.
fmvip/fmvipdispatcher.cpp
View file @
064b676c
...
...
@@ -18,7 +18,7 @@
#include <ctkPluginContext.h>
#undef StartService
#include <fmp_epay_i.h>
#include "fmp_redeem_i.h"
FMVipDispatcher
::
FMVipDispatcher
(
QObject
*
parent
)
:
QObject
(
parent
),
...
...
@@ -81,6 +81,23 @@ void FMVipDispatcher::doTask(const QByteArray &reqData, QByteArray &rspData)
}
break
;
}
case
FM_Coupon_Pay
:{
if
(
_ctx
){
ctkServiceReference
ref
=
_ctx
->
getServiceReference
<
FMPRedeemInterface
>
();
FMPRedeemInterface
*
redeem
=
_ctx
->
getService
<
FMPRedeemInterface
>
(
ref
);
//for test
// jsonObj["store_id"] = "fm99999";
// jsonObj["pos_id"] = "01";
// jsonObj["operator_id"] = "00000002";
// jsonObj["partner_id"] = 1371;
QJsonObject
result
=
redeem
->
Redeem
(
jsonObj
);
rspData
=
QJsonDocument
(
result
).
toJson
(
QJsonDocument
::
Compact
);
}
else
{
rspData
=
QString
::
fromLocal8Bit
(
"{
\"
msg:
\"
:
\"
卡券服务不可用
\"
}"
).
toUtf8
();
}
break
;
}
case
FM_Refund
:
{
TaskRefund
taskRefund
(
jsonObj
);
rspData
=
taskRefund
.
doTask
();
...
...
fmvip/global.h
View file @
064b676c
...
...
@@ -33,6 +33,7 @@ enum FM_TYPE {
FM_Coupon
=
1009
,
FM_Order_Revoke
,
FM_QR_Pay
=
10031
,
FM_Coupon_Pay
,
FM_QR_Refund
=
10041
,
FM_Refund_Pay
,
FM_Refund_Order
...
...
@@ -280,20 +281,21 @@ const PropsMap::value_type PropsMapPairs[] =
};
static
PropsMap
PosToServerProps
(
PropsMapPairs
,
PropsMapPairs
+
(
sizeof
(
PropsMapPairs
)
/
sizeof
(
PropsMapPairs
[
0
])));
class
FMPropsMap
{
public
:
static
QString
get
(
QString
posProp
)
{
PropsMap
::
iterator
it
=
PosToServerProps
.
find
(
posProp
);
if
(
it
!=
PosToServerProps
.
end
())
{
return
it
->
second
;
}
return
posProp
;
}
};
//
class FMPropsMap
//
{
//
public:
//
static QString get(QString posProp) {
//
PropsMap::iterator it = PosToServerProps.find(posProp);
//
if(it != PosToServerProps.end()) {
//
return it->second;
// }
//
return posProp;
//
}
//
};
#endif
#define ServerProps(posProp) FMPropsMap::get(posProp)
//#define ServerProps(posProp) FMPropsMap::get(posProp)
#define ServerProps(posProp) PosToServerProps.find(posProp) == PosToServerProps.end() ? posProp : PosToServerProps[posProp]
// 签名字段
const
static
QString
SignProps
[]
=
{
...
...
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