Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
familyMart_takeaway
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
guanghui.cui
familyMart_takeaway
Commits
ec0875eb
Commit
ec0875eb
authored
Mar 13, 2018
by
guanghui.cui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
json字段更新
parent
f49cc9e4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
14 deletions
+10
-14
base/CommonStruct.h
+1
-0
src/JsonModule.cpp
+9
-14
No files found.
base/CommonStruct.h
View file @
ec0875eb
...
...
@@ -134,6 +134,7 @@ struct orderObj
int
reduced_price
=
0
;
//折扣总金额
std
::
string
pickup_code
;
//自取订单取餐码
std
::
string
pickup_point
;
//自取订单取餐处
std
::
string
invoice_pickup_code
;
//订单发票提出码
store
storeInfo
;
//门店信息
delivery
deliveryInfo
;
//配送信息
...
...
src/JsonModule.cpp
View file @
ec0875eb
...
...
@@ -164,7 +164,7 @@ bool JsonModule::getPushOrders(IN const char* json,OUT orderObj &order)
if
(
invoice_obj
.
HasMember
(
"transNum"
))
{
rapidjson
::
Value
&
transNum
=
invoice_obj
[
"transNum"
];
transNum
.
GetString
();
order
.
invoice_pickup_code
=
transNum
.
GetString
();
}
}
...
...
@@ -303,8 +303,10 @@ bool JsonModule::getPushOrders(IN const char* json,OUT orderObj &order)
rapidjson
::
Value
&
amount
=
payInfos_obj
[
"amount"
];
detail
.
amount
=
amount
.
GetInt
();
//支付类型需要拼接 channel+payType
rapidjson
::
Value
&
payType
=
payInfos_obj
[
"payType"
];
detail
.
type
=
atoi
(
payType
.
GetString
());
std
::
string
_strType
=
order
.
channel
+
payType
.
GetString
();
detail
.
type
=
atoi
(
_strType
.
data
());
rapidjson
::
Value
&
transNum
=
payInfos_obj
[
"transNum"
];
detail
.
trans_id
=
transNum
.
GetString
();
...
...
@@ -696,6 +698,9 @@ std::string JsonModule::_convertToNewOrderJson(orderObj &obj)
writer
.
Key
(
"pickup_point"
);
writer
.
String
(
obj
.
pickup_point
.
c_str
());
writer
.
Key
(
"invoice_pickup_code"
);
writer
.
String
(
obj
.
invoice_pickup_code
.
c_str
());
//----------------门店信息----------------
writer
.
Key
(
"store"
);
writer
.
StartObject
();
...
...
@@ -1402,10 +1407,7 @@ bool JsonModule::_getStockWarnResponseJson(IN const std::string& posResponse, IN
document
.
Parse
(
posResponse
.
c_str
());
document1
.
Parse
(
orderData
.
c_str
());
if
(
!
document
.
HasMember
(
"status_code"
)
||
!
document1
.
HasMember
(
"order_id"
)
||
!
document1
.
HasMember
(
"status"
)
||
!
document1
.
HasMember
(
"channel"
)
)
if
(
!
document
.
HasMember
(
"status_code"
)
||
!
document1
.
HasMember
(
"channel"
)
)
{
LOG
(
INFO
)
<<
"Don't have needed parames"
;
return
false
;
...
...
@@ -1414,8 +1416,7 @@ bool JsonModule::_getStockWarnResponseJson(IN const std::string& posResponse, IN
int
status_code
=
document
[
"status_code"
].
GetInt
();
std
::
string
msg
=
document
[
"msg"
].
GetString
();
std
::
string
order_id
=
document1
[
"order_id"
].
GetString
();
int
status
=
document1
[
"status"
].
GetInt
();
std
::
string
channel
=
document1
[
"channel"
].
GetString
();
rapidjson
::
StringBuffer
buffer
;
...
...
@@ -1425,15 +1426,9 @@ bool JsonModule::_getStockWarnResponseJson(IN const std::string& posResponse, IN
writer
.
Key
(
"fm_cmd"
);
writer
.
Int
(
1016
);
writer
.
Key
(
"order_id"
);
writer
.
String
(
order_id
.
c_str
());
writer
.
Key
(
"channel"
);
writer
.
String
(
channel
.
c_str
());
writer
.
Key
(
"status"
);
writer
.
Int
(
status
);
writer
.
Key
(
"status_code"
);
writer
.
Int
(
status_code
);
...
...
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