Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
takeout_sbk
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
yunpeng.song
takeout_sbk
Commits
a3c1aa47
Commit
a3c1aa47
authored
Oct 20, 2017
by
yunpeng.song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加openssl认证支持
parent
d2c36461
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
53 additions
and
5 deletions
+53
-5
fmTakeaway/Control/flowControl.cpp
+25
-3
fmTakeaway/DTools/configManger.cpp
+10
-0
fmTakeaway/DTools/configManger.h
+2
-0
fmTakeaway/DTools/dataManger.cpp
+5
-1
fmTakeaway/Network/billSocket.cpp
+9
-0
fmTakeaway/Network/billSocket.h
+1
-0
fmTakeaway/preDefine.h
+1
-1
No files found.
fmTakeaway/Control/flowControl.cpp
View file @
a3c1aa47
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
#include <QMap>
#include <QMap>
#include <QFile>
#include <QFile>
#include <DTools/orderstatus.h>
#include <DTools/orderstatus.h>
//#include "windows.h"
#include <QHostInfo>
#include <QHostInfo>
...
@@ -168,14 +167,16 @@ void FlowControl::_GetOrder(const QString &orderId, const QString &channel)
...
@@ -168,14 +167,16 @@ void FlowControl::_GetOrder(const QString &orderId, const QString &channel)
void
FlowControl
::
_ClickOMSAssignArea
()
void
FlowControl
::
_ClickOMSAssignArea
()
{
{
QPoint
point
=
ConfigManger
::
GetOMSBtnPostion
();
QPoint
point
=
ConfigManger
::
Get
Instance
().
Get
OMSBtnPostion
();
SetCursorPos
(
point
.
x
(),
point
.
y
());
SetCursorPos
(
point
.
x
(),
point
.
y
());
mouse_event
(
MOUSEEVENTF_LEFTDOWN
,
0
,
0
,
0
,
0
);
mouse_event
(
MOUSEEVENTF_LEFTDOWN
,
0
,
0
,
0
,
0
);
mouse_event
(
MOUSEEVENTF_LEFTUP
,
0
,
0
,
0
,
0
);
mouse_event
(
MOUSEEVENTF_LEFTUP
,
0
,
0
,
0
,
0
);
QLOG_INFO
()
<<
QString
(
"点击目标坐标x%1:,y:%2"
).
arg
(
point
.
x
()).
arg
(
point
.
y
());
}
}
void
FlowControl
::
onGetNewStoreInfo
()
void
FlowControl
::
onGetNewStoreInfo
()
{
{
QLOG_INFO
()
<<
"Openssl support:"
<<
QSslSocket
::
supportsSsl
();
m_timestamp
=
"0"
;
m_timestamp
=
"0"
;
m_loginSocket
=
new
BillSocket
(
this
);
m_loginSocket
=
new
BillSocket
(
this
);
m_pullOrderSocket
=
new
BillSocket
(
this
);
m_pullOrderSocket
=
new
BillSocket
(
this
);
...
@@ -211,6 +212,10 @@ bool FlowControl::_Login()
...
@@ -211,6 +212,10 @@ bool FlowControl::_Login()
m_password
,
m_posId
,
m_cashierId
,
_GetIpAddress
());
m_password
,
m_posId
,
m_cashierId
,
_GetIpAddress
());
emit
showAlert
(
AlertForm
::
LOADING
,
"正在登录......"
);
emit
showAlert
(
AlertForm
::
LOADING
,
"正在登录......"
);
QLOG_INFO
()
<<
QString
(
"[---login---][requestData:%1]"
).
arg
(
_GetJsonStr
(
sendJson
));
QLOG_INFO
()
<<
QString
(
"[---login---][requestData:%1]"
).
arg
(
_GetJsonStr
(
sendJson
));
if
(
ConfigManger
::
GetInstance
().
GetLoginSslConfig
())
{
m_loginSocket
->
SetSslConfig
();
}
m_loginSocket
->
SetUrl
(
QUrl
(
ConfigManger
::
GetInstance
().
GetLoginServerUrl
()
+
m_loginSocket
->
SetUrl
(
QUrl
(
ConfigManger
::
GetInstance
().
GetLoginServerUrl
()
+
ConfigManger
::
GetInstance
().
GetInterfaceName
(
INI_INTERFACE_ILOGIN
)));
ConfigManger
::
GetInstance
().
GetInterfaceName
(
INI_INTERFACE_ILOGIN
)));
result
=
m_loginSocket
->
Request
(
sendJson
,
recvJson
,
error
);
result
=
m_loginSocket
->
Request
(
sendJson
,
recvJson
,
error
);
...
@@ -271,6 +276,14 @@ bool FlowControl::_PullOrder()
...
@@ -271,6 +276,14 @@ bool FlowControl::_PullOrder()
sendJson
=
DataManger
::
GetInstance
().
GetPullOrderData
(
info
.
orderId
,
info
.
channel
,
m_storeId
,
info
.
pageNumber
,
info
.
pageSize
);
sendJson
=
DataManger
::
GetInstance
().
GetPullOrderData
(
info
.
orderId
,
info
.
channel
,
m_storeId
,
info
.
pageNumber
,
info
.
pageSize
);
QLOG_INFO
()
<<
QString
(
"[---pull order---][requestData:%1]"
).
arg
(
_GetJsonStr
(
sendJson
));
QLOG_INFO
()
<<
QString
(
"[---pull order---][requestData:%1]"
).
arg
(
_GetJsonStr
(
sendJson
));
if
(
ConfigManger
::
GetInstance
().
GetOrderSslConfig
())
{
m_pullOrderSocket
->
SetSslConfig
();
QLOG_INFO
()
<<
"load ssl"
;
}
else
{
QLOG_INFO
()
<<
"load not ssl"
;
}
m_pullOrderSocket
->
SetUrl
(
QUrl
(
ConfigManger
::
GetInstance
().
GetOrderServerUrl
()
+
m_pullOrderSocket
->
SetUrl
(
QUrl
(
ConfigManger
::
GetInstance
().
GetOrderServerUrl
()
+
ConfigManger
::
GetInstance
().
GetInterfaceName
(
INI_INTERFACE_PULLORDER
)));
ConfigManger
::
GetInstance
().
GetInterfaceName
(
INI_INTERFACE_PULLORDER
)));
result
=
m_pullOrderSocket
->
Request
(
sendJson
,
recvJson
,
error
);
result
=
m_pullOrderSocket
->
Request
(
sendJson
,
recvJson
,
error
);
...
@@ -490,6 +503,14 @@ bool FlowControl::_ConfirmOrder(const QString &orderId, const DeliverObject &del
...
@@ -490,6 +503,14 @@ bool FlowControl::_ConfirmOrder(const QString &orderId, const DeliverObject &del
{
{
m_procOrderSocket
=
new
BillSocket
(
this
);
m_procOrderSocket
=
new
BillSocket
(
this
);
}
}
if
(
ConfigManger
::
GetInstance
().
GetOrderSslConfig
())
{
m_procOrderSocket
->
SetSslConfig
();
QLOG_INFO
()
<<
"load ssl"
;
}
else
{
QLOG_INFO
()
<<
"load not ssl"
;
}
m_procOrderSocket
->
SetUrl
(
QUrl
(
ConfigManger
::
GetInstance
().
GetOrderServerUrl
()
+
m_procOrderSocket
->
SetUrl
(
QUrl
(
ConfigManger
::
GetInstance
().
GetOrderServerUrl
()
+
ConfigManger
::
GetInstance
().
GetInterfaceName
(
INI_INTERFACE_CONFIRM
)));
ConfigManger
::
GetInstance
().
GetInterfaceName
(
INI_INTERFACE_CONFIRM
)));
result
=
m_procOrderSocket
->
Request
(
sendJson
,
recvJson
,
error
);
result
=
m_procOrderSocket
->
Request
(
sendJson
,
recvJson
,
error
);
...
@@ -980,7 +1001,8 @@ void FlowControl::_ClearOrder()
...
@@ -980,7 +1001,8 @@ void FlowControl::_ClearOrder()
{
{
QLOG_INFO
()
<<
QString
(
"clear order %1"
).
arg
(
order
->
order_id
);
QLOG_INFO
()
<<
QString
(
"clear order %1"
).
arg
(
order
->
order_id
);
emit
clearorder
(
order
->
order_id
,
order
->
status
);
emit
clearorder
(
order
->
order_id
,
order
->
status
);
m_ordersMap
.
remove
(
order
->
order_id
);
m_ordersMap
.
value
(
order
->
order_id
)
->
deleteLater
();
delete
m_ordersMap
.
take
(
order
->
order_id
);
}
}
}
}
}
}
...
...
fmTakeaway/DTools/configManger.cpp
View file @
a3c1aa47
...
@@ -145,5 +145,15 @@ QPoint ConfigManger::GetOMSBtnPostion()
...
@@ -145,5 +145,15 @@ QPoint ConfigManger::GetOMSBtnPostion()
return
m_userConfig
->
value
(
INI_OMSBTNPOSTION
).
toPoint
();
return
m_userConfig
->
value
(
INI_OMSBTNPOSTION
).
toPoint
();
}
}
int
ConfigManger
::
GetLoginSslConfig
()
{
return
m_config
->
value
(
"SSLConfig/login"
).
toInt
();
}
int
ConfigManger
::
GetOrderSslConfig
()
{
return
m_config
->
value
(
"SSLConfig/order"
).
toInt
();
}
fmTakeaway/DTools/configManger.h
View file @
a3c1aa47
...
@@ -122,6 +122,8 @@ public:
...
@@ -122,6 +122,8 @@ public:
QString
GetIpAddress
();
QString
GetIpAddress
();
QPoint
GetOMSBtnPostion
();
QPoint
GetOMSBtnPostion
();
int
GetLoginSslConfig
();
int
GetOrderSslConfig
();
private
:
private
:
ConfigManger
();
ConfigManger
();
...
...
fmTakeaway/DTools/dataManger.cpp
View file @
a3c1aa47
...
@@ -134,8 +134,12 @@ QJsonObject DataManger::GetRefundOrderData(const QString &reason, const QString
...
@@ -134,8 +134,12 @@ QJsonObject DataManger::GetRefundOrderData(const QString &reason, const QString
{
{
QJsonObject
rObj
;
QJsonObject
rObj
;
rObj
.
insert
(
JSON_BUSINESSID
,
orderId
);
rObj
.
insert
(
JSON_BUSINESSID
,
orderId
);
rObj
.
insert
(
JSON_REASON
,
reason
);
//TEST
rObj
.
insert
(
JSON_REASON
,
"其它"
);
//rObj.insert(JSON_REASON, reason);
rObj
.
insert
(
JSON_CODE
,
-
1
);
rObj
.
insert
(
JSON_CODE
,
-
1
);
rObj
.
insert
(
JSON_CHANNEL
,
channel
);
rObj
.
insert
(
JSON_CHANNEL
,
channel
);
rObj
.
insert
(
JSON_SHOPCODE
,
m_storeId
);
rObj
.
insert
(
JSON_SHOPCODE
,
m_storeId
);
return
rObj
;
return
rObj
;
...
...
fmTakeaway/Network/billSocket.cpp
View file @
a3c1aa47
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
#include "preDefine.h"
#include "preDefine.h"
#include <QEventLoop>
#include <QEventLoop>
#include <QTimer>
#include <QTimer>
#include <QSslConfiguration>
BillSocket
::
BillSocket
(
QObject
*
parent
)
BillSocket
::
BillSocket
(
QObject
*
parent
)
:
QObject
(
parent
)
:
QObject
(
parent
)
...
@@ -55,3 +56,11 @@ void BillSocket::SetUrl(QUrl url)
...
@@ -55,3 +56,11 @@ void BillSocket::SetUrl(QUrl url)
{
{
m_networkRequest
.
setUrl
(
url
);
m_networkRequest
.
setUrl
(
url
);
}
}
void
BillSocket
::
SetSslConfig
()
{
QSslConfiguration
m_sslConfig
=
QSslConfiguration
::
defaultConfiguration
();
m_sslConfig
.
setPeerVerifyMode
(
QSslSocket
::
VerifyNone
);
m_sslConfig
.
setProtocol
(
QSsl
::
AnyProtocol
);
m_networkRequest
.
setSslConfiguration
(
m_sslConfig
);
}
fmTakeaway/Network/billSocket.h
View file @
a3c1aa47
...
@@ -16,6 +16,7 @@ public:
...
@@ -16,6 +16,7 @@ public:
bool
Request
(
const
QJsonObject
&
requestJson
,
QJsonObject
&
recvJson
,
QString
&
error
);
bool
Request
(
const
QJsonObject
&
requestJson
,
QJsonObject
&
recvJson
,
QString
&
error
);
void
SetUrl
(
QUrl
url
);
void
SetUrl
(
QUrl
url
);
void
SetSslConfig
();
private
:
private
:
QNetworkAccessManager
m_networkManger
;
QNetworkAccessManager
m_networkManger
;
...
...
fmTakeaway/preDefine.h
View file @
a3c1aa47
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#define APP_THEME "deaufult"
#define APP_THEME "deaufult"
#define APP_VERSION "1.201
6092
3.01"
#define APP_VERSION "1.201
7101
3.01"
#define SERVER_PASSWORD "posoperator@freemud.cn"
#define SERVER_PASSWORD "posoperator@freemud.cn"
#define CONFIG_NAME "config.ini"
#define CONFIG_NAME "config.ini"
...
...
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