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
42c4ceaf
Commit
42c4ceaf
authored
Feb 05, 2018
by
guanghui.cui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
退单、状态变更实现
parent
bbce0280
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
6 deletions
+21
-6
src/JsonModule.cpp
+19
-6
src/JsonModule.h
+2
-0
No files found.
src/JsonModule.cpp
View file @
42c4ceaf
...
...
@@ -183,7 +183,7 @@ std::string JsonModule::convertToNewOrderJson(orderObj &obj)
writer
.
StartObject
();
writer
.
Key
(
"fm_cmd"
);
writer
.
Int
(
obj
.
fm_cmd
);
writer
.
Int
(
REQUEST_TYPE_NEWORDER_PUSH
);
writer
.
Key
(
"channel"
);
writer
.
String
(
obj
.
channel
.
c_str
());
...
...
@@ -465,7 +465,7 @@ std::string JsonModule::convertToOrderStatusJson(orderStatusObj &obj)
writer
.
StartObject
();
writer
.
Key
(
"fm_cmd"
);
writer
.
Int
(
obj
.
fm_cmd
);
writer
.
Int
(
REQUEST_TYPE_STATUS_CHANGE
);
writer
.
Key
(
"order_id"
);
writer
.
String
(
obj
.
order_id
.
c_str
());
...
...
@@ -488,7 +488,7 @@ std::string JsonModule::convertToRefundJson(refundObj &obj)
writer
.
StartObject
();
writer
.
Key
(
"fm_cmd"
);
writer
.
Int
(
obj
.
fm_cmd
);
writer
.
Int
(
REQUEST_TYPE_REFUND
);
writer
.
Key
(
"channel"
);
writer
.
String
(
obj
.
channel
.
c_str
());
...
...
@@ -578,7 +578,7 @@ std::string JsonModule::convertToStockWarnJson(stockWarnObj &obj)
writer
.
StartObject
();
writer
.
Key
(
"fm_cmd"
);
writer
.
Int
(
obj
.
fm_cmd
);
writer
.
Int
(
REQUEST_TYPE_STOCK_WARN
);
//----------------商品信息----------------
writer
.
Key
(
"products"
);
...
...
@@ -684,4 +684,18 @@ int JsonModule::_getPOSOrderStatus(int status)
break
;
}
return
rltStatus
;
}
\ No newline at end of file
}
void
JsonModule
::
getStatusObj
(
IN
orderObj
&
order_obj
,
OUT
orderStatusObj
&
status_obj
)
{
status_obj
.
order_id
=
order_obj
.
order_id
;
status_obj
.
order_status
=
order_obj
.
status
;
status_obj
.
delivery_status
=
order_obj
.
deliveryInfo
.
status
;
}
void
JsonModule
::
getRefundObj
(
IN
orderObj
&
order_obj
,
OUT
refundObj
&
refund_obj
)
{
refund_obj
.
order_id
=
order_obj
.
order_id
;
refund_obj
.
channel
=
order_obj
.
channel
;
refund_obj
.
refund_amount
=
order_obj
.
total_price
;
}
src/JsonModule.h
View file @
42c4ceaf
...
...
@@ -19,6 +19,8 @@ public:
std
::
string
convertToRefundJson
(
refundObj
&
obj
);
std
::
string
convertToStockWarnJson
(
stockWarnObj
&
obj
);
void
getStatusObj
(
IN
orderObj
&
order_obj
,
OUT
orderStatusObj
&
status_obj
);
void
getRefundObj
(
IN
orderObj
&
order_obj
,
OUT
refundObj
&
refund_obj
);
private
:
std
::
string
_getDeliveryTypeString
(
int
type
);
//订单状态转换(转换为POS对应的状态)
...
...
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