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
f7536466
Commit
f7536466
authored
Mar 26, 2018
by
guanghui.cui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口会员帐号字段
parent
31862199
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletions
+15
-1
src/JsonModule.cpp
+8
-0
src/main.cpp
+7
-1
No files found.
src/JsonModule.cpp
View file @
f7536466
...
@@ -318,6 +318,14 @@ bool JsonModule::getPushOrders(IN const char* json,OUT orderObj &order)
...
@@ -318,6 +318,14 @@ bool JsonModule::getPushOrders(IN const char* json,OUT orderObj &order)
rapidjson
::
Value
&
transNum
=
payInfos_obj
[
"transNum"
];
rapidjson
::
Value
&
transNum
=
payInfos_obj
[
"transNum"
];
detail
.
trans_id
=
transNum
.
GetString
();
detail
.
trans_id
=
transNum
.
GetString
();
if
(
payInfos_obj
.
HasMember
(
"accountId"
)){
rapidjson
::
Value
&
accountId
=
payInfos_obj
[
"accountId"
];
if
(
!
accountId
.
IsNull
()){
detail
.
account_id
=
accountId
.
GetString
();
}
}
order
.
payInfo
.
vecDetail
.
push_back
(
detail
);
order
.
payInfo
.
vecDetail
.
push_back
(
detail
);
}
}
}
}
...
...
src/main.cpp
View file @
f7536466
...
@@ -84,7 +84,8 @@ void* listen_pos_func(void* arg)
...
@@ -84,7 +84,8 @@ void* listen_pos_func(void* arg)
if
(
jsonTool
.
checkInitData
(
posRequestData
,
pos_listen_port
)
)
if
(
jsonTool
.
checkInitData
(
posRequestData
,
pos_listen_port
)
)
{
{
g_init_data_ods_back
.
clear
();
g_init_data_ods_back
.
clear
();
//g_init_data = posRequestData;
// g_init_data = posRequestData;
LOG
(
INFO
)
<<
"POS req data.:"
<<
posRequestData
.
c_str
();
jsonTool
.
convertInitDataPos2Ods
(
posRequestData
,
g_init_data
);
jsonTool
.
convertInitDataPos2Ods
(
posRequestData
,
g_init_data
);
//jsonTool.getPosResponseData(100, "successful!", responseData);
//jsonTool.getPosResponseData(100, "successful!", responseData);
LOG
(
INFO
)
<<
"POS init data.:"
<<
g_init_data
.
c_str
();
LOG
(
INFO
)
<<
"POS init data.:"
<<
g_init_data
.
c_str
();
...
@@ -307,11 +308,16 @@ int main()
...
@@ -307,11 +308,16 @@ int main()
LOG
(
INFO
)
<<
"ODS init back:"
<<
odsPushData
.
data
();
LOG
(
INFO
)
<<
"ODS init back:"
<<
odsPushData
.
data
();
while
(
!
bInitDone
){
while
(
!
bInitDone
){
LOG
(
INFO
)
<<
"wait for init done"
;
LOG
(
INFO
)
<<
"wait for init done"
;
if
(
!
ods
.
isValid
()
){
LOG
(
INFO
)
<<
"ods is not valid"
;
break
;
}
sleep
(
1
);
sleep
(
1
);
}
}
//检测是否有发送失败的订单,如果有的话,启动线程,先发送原先失败的订单
//检测是否有发送失败的订单,如果有的话,启动线程,先发送原先失败的订单
sqlite
.
query
(
"select * from fmOrderFailed"
,
vecFailedOrders
);
sqlite
.
query
(
"select * from fmOrderFailed"
,
vecFailedOrders
);
LOG
(
INFO
)
<<
"vecFailedOrders size:"
<<
vecFailedOrders
.
size
();
if
(
vecFailedOrders
.
size
()
>
0
){
if
(
vecFailedOrders
.
size
()
>
0
){
pthread_t
retry_thread_id
;
pthread_t
retry_thread_id
;
if
(
pthread_create
(
&
retry_thread_id
,
NULL
,
retry_send_pos_func
,
NULL
))
if
(
pthread_create
(
&
retry_thread_id
,
NULL
,
retry_send_pos_func
,
NULL
))
...
...
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