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
4632a17e
Commit
4632a17e
authored
Mar 21, 2018
by
guanghui.cui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
库存预警接口修改
parent
b310872f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
25 deletions
+26
-25
base/BaseDefine.h
+2
-1
src/JsonModule.cpp
+24
-24
No files found.
base/BaseDefine.h
View file @
4632a17e
...
...
@@ -92,6 +92,6 @@
//推送类型
#define ODS_PUSH_TYPE_HEARTBEAT 3 //心跳
#define ODS_PUSH_TYPE_STOCKWARN 10
15
//库存预警
#define ODS_PUSH_TYPE_STOCKWARN 10
06
//库存预警
#endif
\ No newline at end of file
src/JsonModule.cpp
View file @
4632a17e
...
...
@@ -555,16 +555,22 @@ bool JsonModule::getInitBackData(IN const char* inJson,OUT std::string& outJson)
rapidjson
::
Value
&
code
=
document
[
"code"
];
status_code
=
atoi
(
code
.
GetString
());
if
(
document
.
HasMember
(
"
O
rderConfirmType"
)){
autoconfirm
=
document
[
"
O
rderConfirmType"
].
GetInt
();
if
(
document
.
HasMember
(
"
o
rderConfirmType"
)){
autoconfirm
=
document
[
"
o
rderConfirmType"
].
GetInt
();
}
if
(
document
.
HasMember
(
"
O
rderPushPosIndex"
)){
default_pos
=
document
[
"
O
rderPushPosIndex"
].
GetString
();
if
(
document
.
HasMember
(
"
o
rderPushPosIndex"
)){
default_pos
=
document
[
"
o
rderPushPosIndex"
].
GetString
();
}
if
(
document
.
HasMember
(
"message"
)){
msg
=
document
[
"message"
].
GetString
();
// if(document.HasMember("message")){
// msg = document["message"].GetString();
// }
if
(
status_code
==
100
){
msg
=
"success"
;
}
else
{
msg
=
"failed"
;
}
rapidjson
::
StringBuffer
buffer
;
...
...
@@ -1405,29 +1411,23 @@ void JsonModule::_getStockWarnObj(IN const char* json,OUT stockWarnObj &warn_obj
}
else
{
rapidjson
::
Value
&
products_array
=
document
[
"products"
];
if
(
products_array
.
IsArray
())
{
for
(
unsigned
int
i
=
0
;
i
<
products_array
.
Size
();
i
++
){
rapidjson
::
Value
&
product_obj
=
products_array
[
i
];
productWarn
detail
;
productWarn
detail
;
rapidjson
::
Value
&
qty
=
product_obj
[
"qty"
];
detail
.
stock
=
qty
.
GetInt
();
rapidjson
::
Value
&
qty
=
document
[
"qty"
];
detail
.
stock
=
qty
.
GetInt
();
rapidjson
::
Value
&
sku
=
product_obj
[
"sku"
];
detail
.
sku
=
sku
.
GetString
();
rapidjson
::
Value
&
sku
=
document
[
"sku"
];
detail
.
sku
=
sku
.
GetString
();
rapidjson
::
Value
&
safeQty
=
product_obj
[
"safeQty"
];
detail
.
safeQty
=
safeQty
.
GetInt
();
if
(
document
.
HasMember
(
"saftQty"
)){
rapidjson
::
Value
&
safeQty
=
document
[
"saftQty"
];
detail
.
safeQty
=
safeQty
.
GetInt
();
}
rapidjson
::
Value
&
alertTime
=
product_obj
[
"alertTime"
];
detail
.
alertTime
=
alertTime
.
GetString
();
rapidjson
::
Value
&
alertTime
=
document
[
"alertTime"
];
detail
.
alertTime
=
alertTime
.
GetString
();
warn_obj
.
vecProducts
.
push_back
(
detail
);
}
}
warn_obj
.
vecProducts
.
push_back
(
detail
);
}
}
...
...
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