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
dd1d7d70
Commit
dd1d7d70
authored
Sep 20, 2017
by
NitefullWind
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 修复商品数量错误Bug。 2. 修复POS结算时未传现金的Bug。 3. 数据库保存第三方交易号。
parent
2ef9375d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
6 deletions
+23
-6
global.h
+1
-0
task/taskfinal.cpp
+18
-5
task/taskothers.cpp
+4
-1
No files found.
global.h
View file @
dd1d7d70
...
...
@@ -243,6 +243,7 @@ const PropsMap::value_type PropsMapPairs[] =
PropsMap
::
value_type
(
PosProps
.
OrderAmount
,
"totalAmount"
),
PropsMap
::
value_type
(
PosProps
.
Pay_id
,
"typeModeFlag"
),
PropsMap
::
value_type
(
PosProps
.
Pay_amount
,
"amount"
),
PropsMap
::
value_type
(
PosProps
.
ConsumeNum
,
"consumeNum"
),
};
static
PropsMap
PosToServerProps
(
PropsMapPairs
,
PropsMapPairs
+
(
sizeof
(
PropsMapPairs
)
/
sizeof
(
PropsMapPairs
[
0
])));
...
...
task/taskfinal.cpp
View file @
dd1d7d70
...
...
@@ -28,8 +28,10 @@ void TaskFinal::packageServerReq()
transData
[
ServerProps
(
prop
)]
=
getPosJsonValue
(
prop
);
}
int
orderAmount
=
getPosJsonValue
(
PosProps
.
OrderAmount
).
toInt
();
if
(
transData
[
ServerProps
(
PosProps
.
PaidAmount
)].
toInt
()
==
0
)
{
transData
[
ServerProps
(
PosProps
.
PaidAmount
)]
=
transData
[
ServerProps
(
PosProps
.
OrderAmount
)]
;
transData
[
ServerProps
(
PosProps
.
PaidAmount
)]
=
orderAmount
;
}
// 产品列表
...
...
@@ -37,7 +39,7 @@ void TaskFinal::packageServerReq()
foreach
(
auto
p
,
getPosJsonValue
(
"products"
).
toArray
())
{
QJsonObject
product
;
product
[
"consumNum"
]
=
p
.
toObject
()[
"consume_num"
];
product
[
ServerProps
(
PosProps
.
ConsumeNum
)
]
=
p
.
toObject
()[
"consume_num"
];
int
price
=
p
.
toObject
()[
"price"
].
toDouble
()
*
100
;
product
[
"price"
]
=
price
;
product
[
"productId"
]
=
p
.
toObject
()[
"pid"
];
...
...
@@ -45,12 +47,15 @@ void TaskFinal::packageServerReq()
products
.
append
(
product
);
}
transData
[
"productList"
]
=
products
;
int
payTotalAmount
=
0
;
QJsonArray
payList
;
foreach
(
auto
p
,
getPosJsonValue
(
PosProps
.
Pay_ids
).
toArray
())
{
QJsonObject
pay
;
pay
[
"amount"
]
=
p
.
toObject
()[
"pay_amount"
];
int
payAmount
=
p
.
toObject
()[
"pay_amount"
].
toInt
();
payTotalAmount
+=
payAmount
;
pay
[
"amount"
]
=
payAmount
;
pay
[
"thirdPayTransId"
]
=
p
.
toObject
()[
"pay_transId"
].
toString
();
pay
[
"code"
]
=
p
.
toObject
()[
"code"
].
toString
();
pay
[
ServerProps
(
PosProps
.
TransId
)]
=
getPosJsonValue
(
PosProps
.
TransId
);
...
...
@@ -72,6 +77,14 @@ void TaskFinal::packageServerReq()
payList
.
append
(
pay
);
}
if
(
payTotalAmount
<
orderAmount
)
{
QJsonObject
cashPay
;
cashPay
[
"amount"
]
=
orderAmount
-
payTotalAmount
;
cashPay
[
ServerProps
(
PosProps
.
TransId
)]
=
getPosJsonValue
(
PosProps
.
TransId
);
cashPay
[
"typeModeFlag"
]
=
"20005"
;
payList
.
append
(
cashPay
);
}
transData
[
"payList"
]
=
payList
;
serverReqJsonObj
[
"data"
]
=
transData
;
}
...
...
@@ -117,7 +130,7 @@ void TaskFinal::packagePOSRsp()
QString
trans_id
=
getPosJsonValue
(
PosProps
.
TransId
).
toString
();
QString
fm_open_id
=
getServerJsonValue
(
PosProps
.
Fm_open_id
).
toString
();
QString
fm_id
=
getServerJsonValue
(
PosProps
.
Fm_id
).
toString
();
QString
fm_transId
=
""
;
QString
fm_transId
=
getServerJsonValue
(
"thirdPayTransId"
).
toString
()
;
FMBackup
::
instance
()
->
insertNewOrder
(
trans_id
,
fm_open_id
,
fm_id
,
fm_transId
);
}
}
...
...
task/taskothers.cpp
View file @
dd1d7d70
...
...
@@ -72,7 +72,10 @@ void TaskRefundOrder::packageServerReq()
if
(
fm_id
==
""
)
{
if
(
fm_transId
!=
""
)
{
fm_id
=
fm_transId
;
fm_id
=
FMBackup
::
instance
()
->
getOrderByTransId
(
trans_id
).
fm_id
;
if
(
fm_id
==
""
)
{
fm_id
=
fm_transId
;
}
}
if
(
fm_open_id
!=
""
&&
trans_id
!=
""
)
{
fm_id
=
FMBackup
::
instance
()
->
getOrderByTransId
(
trans_id
).
fm_id
;
...
...
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