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
cd47f584
Commit
cd47f584
authored
Mar 09, 2018
by
guanghui.cui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
字段错误修复
parent
bdac79cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
src/JsonModule.cpp
+7
-6
src/main.cpp
+5
-5
No files found.
src/JsonModule.cpp
View file @
cd47f584
...
@@ -596,20 +596,21 @@ bool JsonModule::getOdsResponseData(const std::string &posResponse, const std::s
...
@@ -596,20 +596,21 @@ bool JsonModule::getOdsResponseData(const std::string &posResponse, const std::s
return
false
;
return
false
;
}
}
if
(
!
document
.
HasMember
(
"fm_cmd"
)
)
if
(
!
document
1
.
HasMember
(
"fm_cmd"
)
)
{
{
LOG
(
INFO
)
<<
"Don't have needed parames"
;
LOG
(
INFO
)
<<
"Don't have needed parames
.
"
;
return
false
;
return
false
;
}
}
int
fm_cmd
=
document
[
"fm_cmd"
].
GetInt
();
int
fm_cmd
=
document1
[
"fm_cmd"
].
GetInt
();
LOG
(
INFO
)
<<
"fm_cmd:"
<<
fm_cmd
;
bool
rlt
=
false
;
bool
rlt
=
false
;
if
(
fm_cmd
==
REQUEST_TYPE_NEWORDER_PUSH
){
if
(
fm_cmd
==
REQUEST_TYPE_NEWORDER_PUSH
){
rlt
=
_getOrderResponseJson
(
posResponse
,
orderData
,
result
);
rlt
=
_getOrderResponseJson
(
posResponse
,
orderData
,
result
);
}
}
else
if
(
fm_cmd
==
REQUEST_TYPE_STOCK_WARN
){
//
else if(fm_cmd==REQUEST_TYPE_STOCK_WARN){
rlt
=
_getStockWarnResponseJson
(
posResponse
,
orderData
,
result
);
//
rlt=_getStockWarnResponseJson(posResponse,orderData,result);
}
//
}
return
rlt
;
return
rlt
;
}
}
...
...
src/main.cpp
View file @
cd47f584
...
@@ -221,7 +221,7 @@ int main()
...
@@ -221,7 +221,7 @@ int main()
if
(
ods
.
receive
(
odsPushData
)
)
if
(
ods
.
receive
(
odsPushData
)
)
{
{
LOG
(
INFO
)
<<
"----------------recved ODS data------------------"
;
LOG
(
INFO
)
<<
"----------------recved ODS data------------------
.
"
;
LOG
(
INFO
)
<<
odsPushData
;
LOG
(
INFO
)
<<
odsPushData
;
if
(
!
jsonTool
.
isHeartbeatData
(
odsPushData
.
data
())){
if
(
!
jsonTool
.
isHeartbeatData
(
odsPushData
.
data
())){
if
(
jsonTool
.
convertDataOds2Pos
(
odsPushData
,
pushPosData
)
)
if
(
jsonTool
.
convertDataOds2Pos
(
odsPushData
,
pushPosData
)
)
...
@@ -239,11 +239,11 @@ int main()
...
@@ -239,11 +239,11 @@ int main()
LOG
(
INFO
)
<<
"pos response data:"
<<
tmpBuf
;
LOG
(
INFO
)
<<
"pos response data:"
<<
tmpBuf
;
std
::
string
tmp
(
tmpBuf
);
std
::
string
tmp
(
tmpBuf
);
//pos发送过来的数据为gb2312编码,需要转换为utf8
//pos发送过来的数据为gb2312编码,需要转换为utf8
std
::
string
tmpUtf8
=
charset_g2u
(
tmp
);
//
std::string tmpUtf8= charset_g2u(tmp);
LOG
(
INFO
)
<<
"gb2312 to utf8:"
<<
tmpUtf8
.
data
();
//
LOG(INFO)<<"gb2312 to utf8:"<<tmpUtf8.data();
jsonTool
.
getOdsResponseData
(
tmpUtf8
,
pushPosData
,
responseData
);
//
jsonTool.getOdsResponseData(tmpUtf8, pushPosData, responseData);
//jsonTool.getOdsResponseData(tmp, odsPush
Data, responseData);
jsonTool
.
getOdsResponseData
(
tmp
,
pushPos
Data
,
responseData
);
}
else
}
else
{
{
jsonTool
.
getOdsResponseData
(
101
,
"receive data from [POS] failed!"
,
responseData
);
jsonTool
.
getOdsResponseData
(
101
,
"receive data from [POS] failed!"
,
responseData
);
...
...
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