Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
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
shuai.liu
takeaway
Commits
ab1c6221
Commit
ab1c6221
authored
Nov 13, 2018
by
刘帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加入账反馈接口
parent
ef406819
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
10 deletions
+24
-10
fmTakeaway/controls/flowControl.cpp
+21
-7
fmTakeaway/controls/flowControl.h
+3
-3
No files found.
fmTakeaway/controls/flowControl.cpp
View file @
ab1c6221
...
@@ -118,11 +118,10 @@ FlowControl::FlowControl()
...
@@ -118,11 +118,10 @@ FlowControl::FlowControl()
socket
->
write
(
replyData
.
toUtf8
());
socket
->
write
(
replyData
.
toUtf8
());
socket
->
waitForBytesWritten
(
1000
);
socket
->
waitForBytesWritten
(
1000
);
}
}
if
(
recvObj
.
contains
(
"reqtype"
)
&&
if
(
recvObj
.
contains
(
"reqtype"
))
//
(
recvObj
[
"reqtype"
]
==
25
||
recvObj
[
"reqtype"
]
==
80
))
//商品库存同步
{
{
recvObj
.
insert
(
"token"
,
m_token
);
recvObj
.
insert
(
"token"
,
m_token
);
_onStockSync
(
recvObj
);
componentProxy
(
recvObj
);
}
}
}
}
socket
->
close
();
socket
->
close
();
...
@@ -449,20 +448,35 @@ void FlowControl::_onGetMenu()
...
@@ -449,20 +448,35 @@ void FlowControl::_onGetMenu()
);
);
}
}
//TODO
STOCK_SYNC
//TODO
转发组件请求
void
FlowControl
::
_onStockSync
(
QJsonObject
obj
)
void
FlowControl
::
componentProxy
(
QJsonObject
obj
)
{
{
QByteArray
request
=
QJsonDocument
(
obj
).
toJson
();
QByteArray
request
=
QJsonDocument
(
obj
).
toJson
();
int
reqtype
=
obj
[
"reqtype"
].
toInt
();
m_http
.
Post
(
request
m_http
.
Post
(
request
,[
this
](
const
QByteArray
&
data
)
,[
this
,
reqtype
](
const
QByteArray
&
data
)
{
if
(
reqtype
==
23
)
{
QLOG_INFO
()
<<
QString
(
"入账反馈返回数据:
\n
%1"
).
arg
(
QString
(
data
).
simplified
());
}
else
{
{
QLOG_INFO
()
<<
QString
(
"同步库存返回数据:
\n
%1"
).
arg
(
QString
(
data
).
simplified
());
QLOG_INFO
()
<<
QString
(
"同步库存返回数据:
\n
%1"
).
arg
(
QString
(
data
).
simplified
());
}
}
,[
this
](
const
QNetworkReply
::
NetworkError
&
error
)
}
,[
this
,
reqtype
](
const
QNetworkReply
::
NetworkError
&
error
)
{
if
(
reqtype
==
23
)
{
QLOG_ERROR
()
<<
QString
(
"入账反馈失败: %1"
).
arg
(
error
);
}
else
{
{
showAlertForm
(
AlertForm
::
ERROR
,
"同步库存失败[网络错误,请检查网络连接]"
,
true
);
showAlertForm
(
AlertForm
::
ERROR
,
"同步库存失败[网络错误,请检查网络连接]"
,
true
);
QLOG_ERROR
()
<<
QString
(
"同步库存失败: %1"
).
arg
(
error
);
QLOG_ERROR
()
<<
QString
(
"同步库存失败: %1"
).
arg
(
error
);
}
}
}
);
);
}
}
...
...
fmTakeaway/controls/flowControl.h
View file @
ab1c6221
...
@@ -107,11 +107,11 @@ private slots:
...
@@ -107,11 +107,11 @@ private slots:
* */
* */
void
_onGetCode
();
void
_onGetCode
();
/* 功能:
库存同步
/* 功能:
转发组件请求
* 参数:
[1]同步库存接口json
字串
* 参数:
组件请求
字串
* 返回:NULL
* 返回:NULL
* */
* */
void
_onStockSync
(
QJsonObject
obj
);
void
componentProxy
(
QJsonObject
obj
);
/* 功能:部分退款后续处理
/* 功能:部分退款后续处理
* 参数:[1]订单id
* 参数:[1]订单id
...
...
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