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
29f0d7f2
Commit
29f0d7f2
authored
Apr 17, 2018
by
guanghui.cui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品详情添加原价字段
parent
4ff5cce1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+7
-2
base/CommonStruct.h
+2
-1
src/JsonModule.cpp
+4
-0
src/main.cpp
+1
-1
No files found.
base/CommonStruct.h
View file @
29f0d7f2
...
@@ -12,7 +12,8 @@ struct product
...
@@ -12,7 +12,8 @@ struct product
std
::
string
bom_id
;
//商品分组组合ID
std
::
string
bom_id
;
//商品分组组合ID
std
::
string
bag_id
;
//商品口袋ID
std
::
string
bag_id
;
//商品口袋ID
std
::
string
name
;
//商品名称
std
::
string
name
;
//商品名称
int
price
=
0
;
//商品价格
int
original_price
=
0
;
//商品原价
int
price
=
0
;
//商品价格(折后价)
int
qty
=
0
;
//商品数量
int
qty
=
0
;
//商品数量
std
::
string
sku
;
//商品SKU
std
::
string
sku
;
//商品SKU
};
};
...
...
src/JsonModule.cpp
View file @
29f0d7f2
...
@@ -260,6 +260,7 @@ bool JsonModule::getPushOrders(IN const char* json,OUT orderObj &order)
...
@@ -260,6 +260,7 @@ bool JsonModule::getPushOrders(IN const char* json,OUT orderObj &order)
structProduct
.
pro
.
combo_id
=
GetJsonStringSafe
(
product_obj
,
"catgId"
);
structProduct
.
pro
.
combo_id
=
GetJsonStringSafe
(
product_obj
,
"catgId"
);
structProduct
.
pro
.
bom_id
=
GetJsonStringSafe
(
product_obj
,
"groupIndex"
);
structProduct
.
pro
.
bom_id
=
GetJsonStringSafe
(
product_obj
,
"groupIndex"
);
structProduct
.
pro
.
name
=
GetJsonStringSafe
(
product_obj
,
"name"
);
structProduct
.
pro
.
name
=
GetJsonStringSafe
(
product_obj
,
"name"
);
structProduct
.
pro
.
original_price
=
GetJsonIntSafe
(
product_obj
,
"originalPrice"
);
structProduct
.
pro
.
price
=
GetJsonIntSafe
(
product_obj
,
"price"
);
structProduct
.
pro
.
price
=
GetJsonIntSafe
(
product_obj
,
"price"
);
GetJsonStringSafe
(
product_obj
,
"productType"
);
GetJsonStringSafe
(
product_obj
,
"productType"
);
structProduct
.
pro
.
qty
=
GetJsonIntSafe
(
product_obj
,
"qty"
);
structProduct
.
pro
.
qty
=
GetJsonIntSafe
(
product_obj
,
"qty"
);
...
@@ -1021,6 +1022,9 @@ std::string JsonModule::_convertToNewOrderJson(orderObj &obj)
...
@@ -1021,6 +1022,9 @@ std::string JsonModule::_convertToNewOrderJson(orderObj &obj)
writer
.
Key
(
"name"
);
writer
.
Key
(
"name"
);
writer
.
String
(
obj
.
vecProducts
[
i
].
pro
.
name
.
c_str
());
writer
.
String
(
obj
.
vecProducts
[
i
].
pro
.
name
.
c_str
());
writer
.
Key
(
"original_price"
);
writer
.
Int
(
obj
.
vecProducts
[
i
].
pro
.
original_price
);
writer
.
Key
(
"price"
);
writer
.
Key
(
"price"
);
writer
.
Int
(
obj
.
vecProducts
[
i
].
pro
.
price
);
writer
.
Int
(
obj
.
vecProducts
[
i
].
pro
.
price
);
...
...
src/main.cpp
View file @
29f0d7f2
...
@@ -247,7 +247,7 @@ int main()
...
@@ -247,7 +247,7 @@ int main()
#ifdef WIN32
#ifdef WIN32
WSADATA
transData
;
WSADATA
transData
;
WSAStartup
(
MAKEWORD
(
2
,
2
),
&
transData
);
WSAStartup
(
MAKEWORD
(
2
,
2
),
&
transData
);
//
ShowWindow(GetConsoleWindow(), SW_HIDE); //隐藏窗口,后台运行
ShowWindow
(
GetConsoleWindow
(),
SW_HIDE
);
//隐藏窗口,后台运行
#else
#else
signal
(
SIGPIPE
,
SIG_IGN
);
signal
(
SIGPIPE
,
SIG_IGN
);
#endif
#endif
...
...
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