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
d28fc2cc
Commit
d28fc2cc
authored
Feb 26, 2018
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix 1:修复编译出错问题
parent
2a952a5e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
src/JsonModule.cpp
+10
-9
src/JsonModule.h
+2
-0
No files found.
src/JsonModule.cpp
View file @
d28fc2cc
...
...
@@ -51,8 +51,8 @@ using namespace rapidjson;
// std::string strOrderid = vOrderid.GetString();
// LOG(INFO)<<"statusCode:"<<iStatusCode;
// LOG(INFO)<<"msg:"<<strMsg
.data();
// LOG(INFO)<<"orderId:"<<strOrderid
.data();
// LOG(INFO)<<"msg:"<<strMsg
;
// LOG(INFO)<<"orderId:"<<strOrderid
;
// }
// }
...
...
@@ -133,6 +133,7 @@ bool JsonModule::getPushOrders(IN const char* json,OUT orderObj &order)
order
.
create_time
=
createTime
.
GetString
();
//用户信息
//TODO 顾客信息为数组 因接口改版目前只有一个顾客信息
rapidjson
::
Value
&
customer_array
=
orderContent_obj
[
"customer"
];
if
(
customer_array
.
IsArray
())
{
...
...
@@ -143,7 +144,7 @@ bool JsonModule::getPushOrders(IN const char* json,OUT orderObj &order)
order
.
customerInfo
.
account
=
accountId
.
GetString
();
rapidjson
::
Value
&
accountType
=
customer_obj
[
"accountType"
];
order
.
customerInfo
.
account_type
=
atoi
(
accountType
.
GetString
()
.
data
());
order
.
customerInfo
.
account_type
=
atoi
(
accountType
.
GetString
()
);
rapidjson
::
Value
&
level
=
customer_obj
[
"level"
];
order
.
customerInfo
.
account_level
=
level
.
GetString
();
...
...
@@ -159,7 +160,7 @@ bool JsonModule::getPushOrders(IN const char* json,OUT orderObj &order)
rapidjson
::
Value
&
orders_obj
=
orderContent_obj
[
"orders"
];
rapidjson
::
Value
&
deliveryStatus
=
orders_obj
[
"deliveryStatus"
];
order
.
deliveryInfo
.
status
=
atoi
(
deliveryStatus
.
GetString
()
.
data
());
order
.
deliveryInfo
.
status
=
atoi
(
deliveryStatus
.
GetString
()
);
rapidjson
::
Value
&
deliveryStatusDesc
=
orders_obj
[
"deliveryStatusDesc"
];
order
.
deliveryInfo
.
status_desc
=
deliveryStatusDesc
.
GetString
();
...
...
@@ -173,7 +174,7 @@ bool JsonModule::getPushOrders(IN const char* json,OUT orderObj &order)
rapidjson
::
Value
&
remark
=
orders_obj
[
"remark"
];
remark
.
GetString
();
rapidjson
::
Value
&
status
=
orders_obj
[
"status"
];
order
.
status
=
atoi
(
status
.
GetString
()
.
data
());
order
.
status
=
atoi
(
status
.
GetString
()
);
rapidjson
::
Value
&
statusDesc
=
orders_obj
[
"statusDesc"
];
order
.
status_desc
=
statusDesc
.
GetString
();
...
...
@@ -260,7 +261,7 @@ bool JsonModule::getPushOrders(IN const char* json,OUT orderObj &order)
detail
.
amount
=
amount
.
GetInt
();
rapidjson
::
Value
&
payType
=
payInfos_obj
[
"payType"
];
detail
.
type
=
atoi
(
payType
.
GetString
()
.
data
());
detail
.
type
=
atoi
(
payType
.
GetString
()
);
rapidjson
::
Value
&
transNum
=
payInfos_obj
[
"transNum"
];
detail
.
trans_id
=
transNum
.
GetString
();
...
...
@@ -277,7 +278,7 @@ bool JsonModule::getPushOrders(IN const char* json,OUT orderObj &order)
rapidjson
::
Value
&
totalPoint
=
points_obj
[
"totalPoint"
];
char
temp
[
20
]
=
{
0
};
int
iPoint
=
totalPoint
.
GetInt
();
itoa
(
iPoint
,
temp
,
10
);
sprintf
(
temp
,
"%d"
,
iPoint
);
order
.
bonusInfo
.
summary
=
temp
;
//积分信息详情
...
...
@@ -308,7 +309,7 @@ bool JsonModule::getPushOrders(IN const char* json,OUT orderObj &order)
detail
.
sku
=
sku
.
GetString
();
rapidjson
::
Value
&
type
=
pointDetails_obj
[
"type"
];
detail
.
type
=
atoi
(
type
.
GetString
()
.
data
());
detail
.
type
=
atoi
(
type
.
GetString
()
);
order
.
bonusInfo
.
vecDetail
.
push_back
(
detail
);
}
...
...
@@ -580,7 +581,7 @@ bool JsonModule::convertDataOds2Pos(const std::string &data, std::string &result
{
bool
rlt
=
true
;
orderObj
order
;
rlt
=
getPushOrders
(
data
.
data
(),
order
);
rlt
=
getPushOrders
(
data
.
c_str
(),
order
);
if
(
ORDERSTATUS_NEW
==
order
.
status
){
result
=
_convertToNewOrderJson
(
order
);
}
...
...
src/JsonModule.h
View file @
d28fc2cc
#ifndef JSON_MODULE_H
#define JSON_MODULE_H
#include <stdlib.h>
#include <stdio.h>
#include "../base/CommonStruct.h"
#include "../base/BaseDefine.h"
//std::string GetTestJson(const int statuscode,const char* msg,const char* orderid);
...
...
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