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
2f081428
Commit
2f081428
authored
Feb 06, 2018
by
guanghui.cui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JSON字段转换
parent
cd4aa8be
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
84 deletions
+91
-84
CMakeLists.txt
+7
-0
src/JsonModule.cpp
+75
-77
src/JsonModule.h
+9
-7
No files found.
CMakeLists.txt
View file @
2f081428
...
@@ -17,6 +17,13 @@ add_compile_options(-std=c++11)
...
@@ -17,6 +17,13 @@ add_compile_options(-std=c++11)
#设置执行文件输出目录
#设置执行文件输出目录
SET
(
EXECUTABLE_OUTPUT_PATH
${
PROJECT_SOURCE_DIR
}
/bin
)
SET
(
EXECUTABLE_OUTPUT_PATH
${
PROJECT_SOURCE_DIR
}
/bin
)
#设置编译后的可执行程序优先调用本地库(和可执行程序在同一个文件夹下的库)
SET
(
CMAKE_BUILD_WITH_INSTALL_RPATH TRUE
)
SET
(
CMAKE_SKIP_BUILD_RPATH TRUE
)
SET
(
CMAKE_BUILD_WITH_INSTALL_RPATH TRUE
)
SET
(
CMAKE_INSTALL_RPATH
"."
)
SET
(
CMAKE_LIBRARY_PATH
"."
)
# 查找目录下的所有源文件,并将名称保存到 DIR_ 变量中
# 查找目录下的所有源文件,并将名称保存到 DIR_ 变量中
aux_source_directory
(
./3rdParty/easylogging/ DIR_LOGS
)
aux_source_directory
(
./3rdParty/easylogging/ DIR_LOGS
)
...
...
src/JsonModule.cpp
View file @
2f081428
This diff is collapsed.
Click to expand it.
src/JsonModule.h
View file @
2f081428
...
@@ -12,7 +12,7 @@ public:
...
@@ -12,7 +12,7 @@ public:
JsonModule
();
JsonModule
();
~
JsonModule
();
~
JsonModule
();
void
getPushOrders
(
IN
const
char
*
json
,
OUT
std
::
vector
<
orderObj
>
&
vecOrders
);
bool
getPushOrders
(
IN
const
char
*
json
,
OUT
orderObj
&
order
);
/* 功能:判断是否是初始化数据
/* 功能:判断是否是初始化数据
* 参数:[1]待判断数据
* 参数:[1]待判断数据
...
@@ -53,17 +53,19 @@ public:
...
@@ -53,17 +53,19 @@ public:
* */
* */
bool
convertDataOds2Pos
(
IN
const
std
::
string
&
data
,
OUT
std
::
string
&
result
);
bool
convertDataOds2Pos
(
IN
const
std
::
string
&
data
,
OUT
std
::
string
&
result
);
std
::
string
convertToNewOrderJson
(
orderObj
&
obj
);
std
::
string
convertToOrderStatusJson
(
orderStatusObj
&
obj
);
std
::
string
convertToRefundJson
(
refundObj
&
obj
);
std
::
string
convertToStockWarnJson
(
stockWarnObj
&
obj
);
void
getStatusObj
(
IN
orderObj
&
order_obj
,
OUT
orderStatusObj
&
status_obj
);
void
getRefundObj
(
IN
orderObj
&
order_obj
,
OUT
refundObj
&
refund_obj
);
private
:
private
:
std
::
string
_getDeliveryTypeString
(
int
type
);
std
::
string
_getDeliveryTypeString
(
int
type
);
//订单状态转换(转换为POS对应的状态)
//订单状态转换(转换为POS对应的状态)
int
_getPOSOrderStatus
(
int
status
);
int
_getPOSOrderStatus
(
int
status
);
void
_getStatusObj
(
IN
orderObj
&
order_obj
,
OUT
orderStatusObj
&
status_obj
);
void
_getRefundObj
(
IN
orderObj
&
order_obj
,
OUT
refundObj
&
refund_obj
);
std
::
string
_convertToNewOrderJson
(
orderObj
&
obj
);
std
::
string
_convertToOrderStatusJson
(
orderStatusObj
&
obj
);
std
::
string
_convertToRefundJson
(
refundObj
&
obj
);
std
::
string
_convertToStockWarnJson
(
stockWarnObj
&
obj
);
};
};
#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