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
7a67d049
Commit
7a67d049
authored
Aug 06, 2018
by
wuyang.zou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug: before try catch
parent
7d27352c
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
107 additions
and
40 deletions
+107
-40
fmTakeout/Control/flowControl.cpp
+28
-12
fmTakeout/Control/flowControl.h
+15
-0
fmTakeout/DTools/printSumBillPosDB.cpp
+6
-4
fmTakeout/Model/orderObject.h
+2
-2
fmTakeout/Network/billSocket.cpp
+14
-18
fmTakeout/detailForm.cpp
+1
-3
fmTakeout/floatForm.cpp
+12
-0
fmTakeout/floatForm.h
+14
-0
fmTakeout/main.cpp
+5
-0
fmTakeout/mainForm.cpp
+8
-0
fmTakeout/mainForm.h
+1
-0
fmTakeout/preDefine.h
+1
-1
No files found.
fmTakeout/Control/flowControl.cpp
View file @
7a67d049
...
...
@@ -216,6 +216,7 @@ void FlowControl::_ClickToNotifySimPullOrder()
m_notifySimPullTimer
->
start
(
1000
*
10
);
QLOG_INFO
()
<<
QString
::
fromLocal8Bit
(
"[<<<<---FM外卖插件通知 Simphony 获取订单数据--->>>>]"
);
emit
doHideMainShowFloatFrom
();
//emit doLockFloatForm();
_ClickOMSAssignArea
();
}
else
{
m_notifySimPullTimer
->
start
(
1000
*
20
);
...
...
@@ -306,6 +307,7 @@ void FlowControl::_OrderAnalysis(const QJsonObject& jsonObject)
QLOG_INFO
()
<<
QString
(
"[<<<<---FmTakeout _OrderAnalysis:NewOrder m_simValidOrdersList:%1 --->>>>]"
)
<<
m_simValidOrdersList
;
QLOG_INFO
()
<<
QString
(
"[<<<<---FmTakeout _OrderAnalysis:NewOrder _ClickOMSAssignArea --->>>>]"
);
emit
doHideMainShowFloatFrom
();
//emit doLockFloatForm();
_ClickOMSAssignArea
();
}
break
;
...
...
@@ -325,6 +327,7 @@ void FlowControl::_OrderAnalysis(const QJsonObject& jsonObject)
QLOG_INFO
()
<<
QString
(
"[<<<<---FmTakeout _OrderAnalysis:OrderConfirmed m_simValidOrdersList:%1 --->>>>]"
)
<<
m_simValidOrdersList
;
QLOG_INFO
()
<<
QString
(
"[<<<<---FmTakeout _OrderAnalysis:OrderConfirmed _ClickOMSAssignArea --->>>>]"
);
emit
doHideMainShowFloatFrom
();
//emit doLockFloatForm();
_ClickOMSAssignArea
();
}
break
;
...
...
@@ -343,6 +346,7 @@ void FlowControl::_OrderAnalysis(const QJsonObject& jsonObject)
QLOG_INFO
()
<<
QString
(
"[<<<<---FmTakeout _OrderAnalysis:Sendout m_simValidOrdersList:%1 --->>>>]"
)
<<
m_simValidOrdersList
;
QLOG_INFO
()
<<
QString
(
"[<<<<---FmTakeout _OrderAnalysis:Sendout _ClickOMSAssignArea --->>>>]"
);
emit
doHideMainShowFloatFrom
();
//emit doLockFloatForm();
_ClickOMSAssignArea
();
}
break
;
...
...
@@ -387,6 +391,7 @@ void FlowControl::_OrderAnalysis(const QJsonObject& jsonObject)
QLOG_INFO
()
<<
QString
(
"[<<<<---FmTakeout _OrderAnalysis:Cancled m_simValidOrdersList:%1 --->>>>]"
)
<<
m_simValidOrdersList
;
QLOG_INFO
()
<<
QString
(
"[<<<<---FmTakeout _OrderAnalysis:Cancled _ClickOMSAssignArea --->>>>]"
);
//emit doHideMainShowFloatFrom();
//emit doLockFloatForm();
//_ClickOMSAssignArea();
}
/***case:校验此订单push到POS后的小票号是否空:[POS已模拟点单但未返回小票号]***/
...
...
@@ -504,7 +509,7 @@ bool FlowControl::_Login()
m_bLoginResult
=
true
;
m_clearTimer
->
start
(
1000
*
60
*
60
*
2
);
// 5分钟执行一次清理任务:正式上线需要两小时清理一次;
m_heartTimer
->
start
(
1000
*
60
*
5
);
m_pullTimer
->
start
(
1000
*
5
);
m_pullTimer
->
start
(
1000
*
1
);
m_notifySimPullTimer
->
start
(
10
*
1000
);
emit
doPullOrder
(
QString
(),
QString
());
}
...
...
@@ -611,7 +616,7 @@ bool FlowControl::_PullOrderDetail(const QString& orderId)
m_pullTimer
->
start
(
1000
*
20
);
_AddOrderPull
(
orderId
);
}
else
{
m_pullTimer
->
start
(
1000
*
5
);
m_pullTimer
->
start
(
1000
*
1
);
}
qDebug
()
<<
"[<<<<---Pull Order Detail Result--->>>>]"
<<
result
;
return
result
;
...
...
@@ -780,6 +785,7 @@ bool FlowControl::_ConfirmOrder(const QString &orderId)
QLOG_INFO
()
<<
QString
(
"[<<<<---FmTakeout _ConfirmOrder: m_simValidOrdersList:%1 --->>>>]"
)
<<
m_simValidOrdersList
;
QLOG_INFO
()
<<
QString
(
"[<<<<---FmTakeout _ConfirmOrder: _ClickOMSAssignArea --->>>>]"
);
emit
doHideMainShowFloatFrom
();
//emit doLockFloatForm();
_ClickOMSAssignArea
();
}
}
...
...
@@ -847,6 +853,7 @@ bool FlowControl::_RefuseOrder(const QString &orderId, int refuseCode,const QStr
QLOG_INFO
()
<<
QString
(
"[<<<<---FmTakeout _RefuseOrder: m_simValidOrdersList:%1 --->>>>]"
)
<<
m_simValidOrdersList
;
QLOG_INFO
()
<<
QString
(
"[<<<<---FmTakeout _RefuseOrder: _ClickOMSAssignArea --->>>>]"
);
emit
doHideMainShowFloatFrom
();
//emit doLockFloatForm();
_ClickOMSAssignArea
();
}
}
...
...
@@ -984,6 +991,7 @@ bool FlowControl::_RefuseRefund(const QString& orderId)
bool
FlowControl
::
_RefundOrder
(
const
QString
&
orderId
,
int
reasonCode
,
const
QString
&
reason
,
const
QString
&
dishesListString
)
{
QLOG_INFO
()
<<
QString
(
"[<<<<---FlowControl::_RefundOrder--->>>>][orderId:%1 reasonCode:%2 reason:%3 dishesListString:]"
).
arg
(
orderId
).
arg
(
reasonCode
).
arg
(
reason
).
arg
(
dishesListString
);
QString
error
;
bool
result
;
...
...
@@ -991,14 +999,7 @@ bool FlowControl::_RefundOrder(const QString &orderId,int reasonCode,const QStri
QJsonObject
recvJson
;
sendJson
=
DataManger
::
GetInstance
().
GetRefundOrderData
(
reasonCode
,
reason
,
orderId
,
m_FmOrdersMap
.
value
(
orderId
)
->
channel
,
dishesListString
);
emit
showAlert
(
AlertForm
::
LOADING
,
QString
::
fromLocal8Bit
(
"正在通信......"
));
QLOG_INFO
()
<<
QString
(
"[<<<<---Refund Order Begin--->>>>][requestData:%1]"
)
<<
sendJson
;
if
(
ConfigManger
::
GetInstance
().
GetOrderSslConfig
())
{
m_refundOrderSocket
->
SetSslConfig
();
QLOG_INFO
()
<<
"load ssl"
;
}
else
{
QLOG_INFO
()
<<
"load not ssl"
;
}
// 如果退款原因:商品已售完,使用下面接口;
if
(
3
==
reasonCode
)
{
m_refundOrderSocket
->
SetUrl
(
QUrl
(
ConfigManger
::
GetInstance
().
GetOrderServerUrl
()
+
...
...
@@ -1007,6 +1008,13 @@ bool FlowControl::_RefundOrder(const QString &orderId,int reasonCode,const QStri
else
{
m_refundOrderSocket
->
SetUrl
(
QUrl
(
ConfigManger
::
GetInstance
().
GetOrderServerUrl
()
+
ConfigManger
::
GetInstance
().
GetInterfaceName
(
INI_INTERFACE_CANCLE
)));
}
if
(
ConfigManger
::
GetInstance
().
GetOrderSslConfig
())
{
m_refundOrderSocket
->
SetSslConfig
();
QLOG_INFO
()
<<
"load ssl"
;
}
else
{
QLOG_INFO
()
<<
"load not ssl"
;
}
QLOG_INFO
()
<<
QString
(
"[<<<<---Refund Order Request: --->>>>]"
)
<<
m_refundOrderSocket
->
GetUrl
();
result
=
m_refundOrderSocket
->
PostRequest
(
sendJson
,
recvJson
,
error
);
QLOG_INFO
()
<<
QString
(
"[<<<<---Refund Order Finish--->>>>][result:%1][msg:%2][recvData:]"
)
...
...
@@ -1032,6 +1040,9 @@ bool FlowControl::_RefundOrder(const QString &orderId,int reasonCode,const QStri
int
oldOrderStatus
=
orderObject
->
orderStatus
;
orderObject
->
orderStatus
=
orderStatus
;
emit
changeOrderStatus
(
orderObject
,
oldOrderStatus
);
emit
doHideMainShowFloatFrom
();
//退货订单,将此订单添加到simphony 模拟点单列表中;
QLOG_INFO
()
<<
QString
(
"[<<<<---FmTakeout _RefundOrder: orderObject->id:%1 , orderObject->orderStatus:%2 --->>>>]"
).
arg
(
orderObject
->
id
).
arg
(
orderObject
->
orderStatus
);
QLOG_INFO
()
<<
QString
(
"[<<<<---FmTakeout _RefundOrder: orderObject->id:%1 , orderObject->isCancle:%2 --->>>>]"
).
arg
(
orderObject
->
id
).
arg
(
orderObject
->
isCancle
);
...
...
@@ -1053,7 +1064,6 @@ bool FlowControl::_RefundOrder(const QString &orderId,int reasonCode,const QStri
QLOG_INFO
()
<<
QString
(
"[<<<<---FmTakeout _RefundOrder: m_simValidOrdersList:%1 --->>>>]"
)
<<
m_simValidOrdersList
;
QLOG_INFO
()
<<
QString
(
"[<<<<---FmTakeout _RefundOrder: _ClickOMSAssignArea --->>>>]"
);
m_OrderEntryMutex
.
unlock
();
emit
doHideMainShowFloatFrom
();
_ClickOMSAssignArea
();
//必须执行,否则退货,点击取消后,就不会再提醒了;
}
...
...
@@ -1363,6 +1373,7 @@ bool FlowControl::_ResponseHttpRequest(const QJsonObject &content,QJsonObject &d
break
;
case
4
:
//simphony汇报小票号信息回复
result
=
_ResponseSimphony04Request
(
content
,
data
,
error
);
//emit doUnLockFloatFrom();
break
;
case
5
:
//simphony更新订单数据到POS本地数据库以便POS打印小票及汇总单信息 回复
result
=
_ResponseSimphony05Request
(
content
,
data
,
error
);
...
...
@@ -1704,15 +1715,19 @@ bool FlowControl::_ResponseSimReqFristOrderData(QJsonObject &data, QString &erro
}
else
if
(
"BAIDU"
==
orderObject
->
channel
){
tempOrderType
=
11
;
tempOrderPayType
=
83
;
tempSbkAppPayValue
=
orderObject
->
id
;
}
else
if
(
"ELE"
==
orderObject
->
channel
){
tempOrderType
=
11
;
tempOrderPayType
=
83
;
tempSbkAppPayValue
=
orderObject
->
id
;
}
else
if
(
"MEITUAN"
==
orderObject
->
channel
){
tempOrderType
=
11
;
tempOrderPayType
=
83
;
tempSbkAppPayValue
=
orderObject
->
id
;
}
else
{
tempOrderType
=
11
;
tempOrderPayType
=
83
;
tempSbkAppPayValue
=
orderObject
->
id
;
}
// 如果是退单,更新订单的来源类型;
if
(
orderObject
->
pushOrderType
==
0
)
{
...
...
@@ -1722,10 +1737,10 @@ bool FlowControl::_ResponseSimReqFristOrderData(QJsonObject &data, QString &erro
cObj
.
insert
(
"orderPayType"
,
tempOrderPayType
);
cObj
.
insert
(
"sbkAppPayType"
,
tempSbkAppPayType
);
cObj
.
insert
(
"sbkAppPayValue"
,
tempSbkAppPayValue
);
cObj
.
insert
(
"orderTransFlowNo"
,
(
orderObject
->
thirdPartyBatch
).
length
()
?
orderObject
->
thirdPartyBatch
:
QString
(
'0'
)
);
//第三方交易流水号
cObj
.
insert
(
"orderTransFlowNo"
,
(
orderObject
->
thirdPartyBatch
).
length
()
?
orderObject
->
thirdPartyBatch
:
QString
(
"0"
)
);
//第三方交易流水号
cObj
.
insert
(
"packFree"
,
orderObject
->
packageFee
);
cObj
.
insert
(
"deliveryFree"
,
orderObject
->
deliveryPrice
);
cObj
.
insert
(
"waybillId"
,
(
orderObject
->
waybillId
).
length
()
?
orderObject
->
waybillId
:
QString
(
'0'
)
);
cObj
.
insert
(
"waybillId"
,
(
orderObject
->
waybillId
).
length
()
?
orderObject
->
waybillId
:
QString
(
"0"
)
);
cObj
.
insert
(
"pos_sale_id"
,
orderObject
->
posCheckNo
);
cObj
.
insert
(
"order_status"
,
orderObject
->
orderStatus
);
//订单的状态
cObj
.
insert
(
"pay_ebcode"
,
orderObject
->
channel
);
...
...
@@ -1941,5 +1956,6 @@ void FlowControl::onProcessRejectOrder(const QString &orderId, const int &reason
void
FlowControl
::
onProcessRepealOrder
(
const
QString
&
orderId
,
const
int
&
reasonCode
,
const
QString
&
reason
,
const
QString
&
dishesListString
)
{
QLOG_INFO
()
<<
QString
(
"[<<<<---FlowControl::onProcessRepealOrder: --->>>>]"
);
_RefundOrder
(
orderId
,
reasonCode
,
reason
,
dishesListString
);
}
fmTakeout/Control/flowControl.h
View file @
7a67d049
...
...
@@ -128,6 +128,19 @@ signals:
* */
void
doHideMainShowFloatFrom
();
/* 功能:通知 锁住 悬浮窗
* 参数:NULL
* 返回:NULL
* */
void
doLockFloatForm
();
/* 功能:通知 解锁 悬浮窗
* 参数:NULL
* 返回:NULL
* */
void
doUnLockFloatFrom
();
/* 功能:设置主界面门店信息
* 参数:[1]门店号
* 返回:NULL
...
...
@@ -148,11 +161,13 @@ signals:
* 返回:NULL
* */
void
setNetStatus
(
const
QString
&
status
);
/* 功能:更改订单显示表
* 参数:[1]订单对象[2]旧订单的状态
* 返回:NULL
* */
void
changeOrderStatus
(
OrderObject
*
orderObject
,
int
oldStatus
=-
100
);
/* 功能:显示订单详情界面
* 参数:[1]收银员信息
* 返回:NULL
...
...
fmTakeout/DTools/printSumBillPosDB.cpp
View file @
7a67d049
...
...
@@ -72,12 +72,14 @@ bool PrintSumBillPosDB::insertOrderSumBill(OrderObject* orderObj,const QString&
query
.
addBindValue
(
orderObj
->
addressDetail
);
// --收货者
query
.
addBindValue
(
orderObj
->
consigneePhone
);
// --收货者-电话
query
.
addBindValue
(
orderObj
->
id
);
// --订单编号
query
.
addBindValue
((
orderObj
->
waybillId
).
length
()
?
orderObj
->
waybillId
:
0
);
// --物流编号
query
.
addBindValue
((
orderObj
->
pickupCode
).
length
()
?
orderObj
->
pickupCode
.
toInt
()
:
0
);
// --取餐号;
query
.
addBindValue
((
orderObj
->
waybillId
).
length
()
?
orderObj
->
waybillId
:
QString
(
"0"
)
);
// --物流编号
query
.
addBindValue
((
orderObj
->
pickupCode
).
length
()
?
orderObj
->
pickupCode
.
toInt
()
:
0
);
// --取餐号;
query
.
addBindValue
(
orderObj
->
riderPhone
);
// --配送者电话
query
.
addBindValue
(
orderObj
->
riderName
);
// -配送者名称
QLOG_INFO
()
<<
QString
(
"waybillId:%1"
).
arg
((
orderObj
->
waybillId
).
length
()
?
orderObj
->
waybillId
:
0
);
QLOG_INFO
()
<<
QString
(
"[<<<--PrintSumBillPosDB::insertOrderSumBill waybillId length :%1-->>>>]"
).
arg
((
orderObj
->
waybillId
).
length
());
QLOG_INFO
()
<<
QString
(
"[<<<--PrintSumBillPosDB::insertOrderSumBill waybillId :%1-->>>>]"
).
arg
(
orderObj
->
waybillId
);
QLOG_INFO
()
<<
QString
(
"[<<<--PrintSumBillPosDB::insertOrderSumBill waybillId:%1-->>>>]"
).
arg
((
orderObj
->
waybillId
).
length
()
?
orderObj
->
waybillId
:
QString
(
"0"
));
if
(
!
query
.
exec
())
{
...
...
@@ -91,7 +93,7 @@ bool PrintSumBillPosDB::insertOrderSumBill(OrderObject* orderObj,const QString&
.
arg
(
orderObj
->
lastName
).
arg
(
orderObj
->
customerName
).
arg
(
temp_customerSex
)
.
arg
(
0
).
arg
(
qdaTi
.
addSecs
(
60
*
60
*
8
).
toString
(
"yyyy-MM-dd hh:mm:ss"
)).
arg
(
FlowControl
::
GetInstance
().
_GetCashierId
()).
arg
(
""
).
arg
(
""
)
.
arg
(
orderObj
->
consigneeName
).
arg
(
orderObj
->
addressDetail
).
arg
(
orderObj
->
consigneePhone
).
arg
(
orderObj
->
id
)
.
arg
((
orderObj
->
waybillId
).
length
()
?
orderObj
->
waybillId
:
0
).
arg
(
orderObj
->
pickupCode
.
length
()
==
0
?
0
:
orderObj
->
pickupCode
.
toInt
()).
arg
(
orderObj
->
riderPhone
).
arg
(
orderObj
->
riderName
);
.
arg
((
orderObj
->
waybillId
).
length
()
?
orderObj
->
waybillId
:
QString
(
"0"
)
).
arg
(
orderObj
->
pickupCode
.
length
()
==
0
?
0
:
orderObj
->
pickupCode
.
toInt
()).
arg
(
orderObj
->
riderPhone
).
arg
(
orderObj
->
riderName
);
}
else
{
QLOG_INFO
()
<<
QString
(
"[<<<<---SqlServer Database:Insert OrderId %1 Into customer_info Success--->>>>]"
).
arg
(
orderObj
->
id
);
result
=
true
;
...
...
fmTakeout/Model/orderObject.h
View file @
7a67d049
...
...
@@ -88,10 +88,10 @@ public:
QString
id
;
//编号
QString
payfmId
;
//FM唯一码
QString
thirdPartyBatch
;
//第三方交易流水号
QString
thirdPartyBatch
;
//第三方交易流水号
int
orderType
;
//订单类型: 用来区分是 正常订单(1) 预订单(2) 还是 客诉单:3 (星巴克定义客诉单的类型:12);
QString
orgOrderId
;
//原始订单编号
QString
waybillId
;
//运单号
QString
waybillId
;
//运单号
QString
watercourseId
;
//流水号
QString
pickupCode
;
//取餐号
QString
customerId
;
//用户编号
...
...
fmTakeout/Network/billSocket.cpp
View file @
7a67d049
...
...
@@ -6,6 +6,7 @@
#include <QTimer>
#include <QFile>
#include <QSslConfiguration>
#include "QsLog.h"
BillSocket
::
BillSocket
(
QObject
*
parent
)
:
QObject
(
parent
)
...
...
@@ -22,44 +23,45 @@ BillSocket::~BillSocket()
bool
BillSocket
::
PostRequest
(
const
QJsonObject
&
requestJson
,
QJsonObject
&
recvJson
,
QString
&
error
)
{
//设置Http请求管理的网络访问权限设置;
if
(
QNetworkAccessManager
::
Accessible
!=
m_networkManger
.
networkAccessible
())
{
//QLOG_INFO()<<QString("[<<<PostRequest: request: >>>>]")<< requestJson;
if
(
QNetworkAccessManager
::
Accessible
!=
m_networkManger
.
networkAccessible
())
{
m_networkManger
.
setNetworkAccessible
(
QNetworkAccessManager
::
Accessible
);
}
//设置Http请求的请求参数:requestJson;
QByteArray
sendArray
=
QJsonDocument
(
requestJson
).
toJson
(
QJsonDocument
::
Compact
);
QEventLoop
eventLoop
;
//QLOG_INFO()<<QString("[<<<PostRequest: sendArray: >>>>]")<< sendArray;
QNetworkReply
*
reply
=
m_networkManger
.
post
(
m_networkRequest
,
sendArray
);
//QLOG_INFO()<<QString("[<<<PostRequest: reply : >>>>]")<< reply;
connect
(
&
m_networkManger
,
SIGNAL
(
networkAccessibleChanged
(
QNetworkAccessManager
::
NetworkAccessibility
)),
&
eventLoop
,
SLOT
(
quit
()));
connect
(
reply
,
SIGNAL
(
finished
()),
&
eventLoop
,
SLOT
(
quit
()));
connect
(
reply
,
SIGNAL
(
error
(
QNetworkReply
::
NetworkError
)),
&
eventLoop
,
SLOT
(
quit
()));
// 加用定时器防止网络出现异常长时间不返回导致的阻塞
QTimer
::
singleShot
(
VALUE_NETTIMEOUT
,
&
eventLoop
,
&
QEventLoop
::
quit
);
eventLoop
.
exec
();
//QLOG_INFO()<<QString("[<<<PostRequest: jiexi ding dan shuju: >>>>]")<< reply;
//获取Http请求的返回json数据;
if
(
reply
->
error
()
!=
QNetworkReply
::
NoError
)
{
if
(
reply
->
error
()
!=
QNetworkReply
::
NoError
)
{
QLOG_INFO
()
<<
QString
(
"[<<<PostRequest: reply->error(): >>>>]"
)
<<
reply
->
error
();
error
=
reply
->
errorString
();
return
false
;
}
QByteArray
recvArray
=
reply
->
readAll
();
if
(
recvArray
.
size
()
==
0
)
{
//QLOG_INFO()<<QString("[<<<PostRequest: reply->readAll(): >>>>]")<< recvArray;
if
(
recvArray
.
size
()
==
0
)
{
error
=
"nothing recved"
;
return
false
;
}
recvJson
=
QJsonDocument
::
fromJson
(
recvArray
).
object
();
//QLOG_INFO()<<QString("[<<<PostRequest: recvJson: >>>>]")<< recvJson;
reply
->
deleteLater
();
return
true
;
}
bool
BillSocket
::
GetRequest
(
QJsonObject
&
recvJson
,
QString
&
error
)
{
if
(
QNetworkAccessManager
::
Accessible
!=
m_networkManger
.
networkAccessible
())
{
if
(
QNetworkAccessManager
::
Accessible
!=
m_networkManger
.
networkAccessible
())
{
m_networkManger
.
setNetworkAccessible
(
QNetworkAccessManager
::
Accessible
);
}
QEventLoop
eventLoop
;
...
...
@@ -70,22 +72,17 @@ bool BillSocket::GetRequest( QJsonObject &recvJson, QString &error)
// 加用定时器防止网络出现异常长时间不返回导致的阻塞
QTimer
::
singleShot
(
VALUE_NETTIMEOUT
,
&
eventLoop
,
&
QEventLoop
::
quit
);
eventLoop
.
exec
();
if
(
reply
->
error
()
!=
QNetworkReply
::
NoError
)
{
if
(
reply
->
error
()
!=
QNetworkReply
::
NoError
)
{
error
=
reply
->
errorString
();
return
false
;
}
QByteArray
recvArray
=
reply
->
readAll
();
if
(
recvArray
.
size
()
==
0
)
{
if
(
recvArray
.
size
()
==
0
)
{
error
=
"nothing recved"
;
return
false
;
}
recvJson
=
QJsonDocument
::
fromJson
(
recvArray
).
object
();
reply
->
deleteLater
();
return
true
;
}
...
...
@@ -105,7 +102,6 @@ void BillSocket::SetSslConfig()
m_sslConfig
.
setPeerVerifyMode
(
QSslSocket
::
VerifyNone
);
m_sslConfig
.
setProtocol
(
QSsl
::
AnyProtocol
);
m_networkRequest
.
setSslConfiguration
(
m_sslConfig
);
/*
QSslConfiguration m_sslConfig = QSslConfiguration::defaultConfiguration();
QString keyDir = QGuiApplication::applicationDirPath() + "/key/";
...
...
fmTakeout/detailForm.cpp
View file @
7a67d049
...
...
@@ -151,9 +151,7 @@ void DetailForm::onOperaBtnClicked()
QLOG_INFO
()
<<
QString
(
"[<<<<---DetailForm::onOperaBtnClicked: --->>>>]"
)
<<
m_refuseForm
->
m_reasonCode
<<
m_refuseForm
->
m_reasonStr
<<
m_refuseForm
->
m_refundDishesListString
;
emit
processRepealOrder
(
pBtn
->
property
(
"orderId"
).
toString
(),
m_refuseForm
->
m_reasonCode
,
m_refuseForm
->
m_reasonStr
,
m_refuseForm
->
m_refundDishesListString
);
}
}
else
{
}
else
{
emit
processOrder
(
pBtn
->
property
(
"operation"
).
toString
(),
pBtn
->
property
(
"orderId"
).
toString
());
}
}
...
...
fmTakeout/floatForm.cpp
View file @
7a67d049
...
...
@@ -182,3 +182,15 @@ void FloatForm::onShow()
show
();
m_raiseTimer
.
start
();
}
void
FloatForm
::
onLockFloatForm
(){
QLOG_INFO
()
<<
QString
(
"[<<<----FloatForm::onLockFloatForm : Lock Float Form --->>>>]"
);
this
->
setEnabled
(
false
);
}
void
FloatForm
::
onUnLockFloatForm
(){
QLOG_INFO
()
<<
QString
(
"[<<<----FloatForm::onUnLockFloatForm : unLock Float Form --->>>>]"
);
this
->
setEnabled
(
true
);
}
fmTakeout/floatForm.h
View file @
7a67d049
...
...
@@ -92,6 +92,20 @@ public slots:
* 返回:NULL
* */
void
onShow
();
/* 功能:锁住窗口:enable(false);
* 参数:NULL
* 返回:NULL
* */
void
onLockFloatForm
();
/* 功能:解锁窗口:enable(true);
* 参数:NULL
* 返回:NULL
* */
void
onUnLockFloatForm
();
};
#endif // FLOATFORM_H
fmTakeout/main.cpp
View file @
7a67d049
...
...
@@ -87,8 +87,13 @@ int main(int argc, char *argv[])
FloatForm
f
;
MainForm
w
;
QObject
::
connect
(
&
w
,
&
MainForm
::
showFloatForm
,
&
f
,
&
FloatForm
::
onShow
);
QObject
::
connect
(
&
FlowControl
::
GetInstance
(),
&
FlowControl
::
startRemind
,
&
f
,
&
FloatForm
::
onStartRemind
);
QObject
::
connect
(
&
FlowControl
::
GetInstance
(),
&
FlowControl
::
doHideMainShowFloatFrom
,
&
w
,
&
MainForm
::
on_mainBtnHide_clicked
);
QObject
::
connect
(
&
FlowControl
::
GetInstance
(),
&
FlowControl
::
doLockFloatForm
,
&
f
,
&
FloatForm
::
onLockFloatForm
);
QObject
::
connect
(
&
FlowControl
::
GetInstance
(),
&
FlowControl
::
doUnLockFloatFrom
,
&
f
,
&
FloatForm
::
onUnLockFloatForm
);
QObject
::
connect
(
&
w
,
&
MainForm
::
startRemind
,
&
f
,
&
FloatForm
::
onStartRemind
);
QObject
::
connect
(
&
w
,
&
MainForm
::
stopRemind
,
&
f
,
&
FloatForm
::
onStopRemind
);
QObject
::
connect
(
&
f
,
&
FloatForm
::
showMainForm
,
&
w
,
&
MainForm
::
show
);
...
...
fmTakeout/mainForm.cpp
View file @
7a67d049
...
...
@@ -207,6 +207,14 @@ void MainForm::on_mainBtnHide_clicked()
showFloatForm
();
}
/*
void MainForm::on_mainBtnHideAndLockForm()
{
on_mainBtnHide_clicked();
emit lockFloatForm();
}
*/
void
MainForm
::
onShowOrderDetails
(
OrderObject
*
orderObject
)
{
m_detailForm
->
InitData
(
orderObject
);
...
...
fmTakeout/mainForm.h
View file @
7a67d049
...
...
@@ -100,6 +100,7 @@ signals:
* 返回:NULL
* */
void
showFloatForm
();
/* 功能:通知悬浮窗开始提示
* 参数:[1]提示类型 0新订单1退款申请
* 返回:NULL
...
...
fmTakeout/preDefine.h
View file @
7a67d049
...
...
@@ -74,7 +74,7 @@
#define JSON_SUBPRODUCTS "addExtra"
#define JSON_ID "id"
#define JSON_ORDERID "orderId"
#define JSON_ORDER_ID "order
_i
d"
#define JSON_ORDER_ID "order
I
d"
#define JSON_BUSINESSID "businessId"
#define JSON_REASON "reason"
#define JSON_REASONCODE "reason_code"
...
...
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