Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
FmTakeaway
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
shangshang.dai
FmTakeaway
Commits
e9f6f75a
Commit
e9f6f75a
authored
Aug 11, 2017
by
shangshang.dai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增
1:订单长时间没有配送员配送则提醒门店
parent
77ab336c
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
64 additions
and
5 deletions
+64
-5
fmTakeaway/Control/flowControl.cpp
+29
-2
fmTakeaway/Control/flowControl.h
+11
-0
fmTakeaway/DTools/configManger.cpp
+5
-0
fmTakeaway/DTools/configManger.h
+6
-0
fmTakeaway/main.cpp
+1
-0
fmTakeaway/mainForm.cpp
+6
-0
fmTakeaway/mainForm.h
+1
-1
fmTakeaway/preDefine.h
+1
-0
run/config.ini
+4
-2
No files found.
fmTakeaway/Control/flowControl.cpp
View file @
e9f6f75a
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
#include <QTimer>
#include <QTimer>
#include <QDir>
#include <QDir>
#include <QApplication>
#include <QApplication>
#include <QTime>
FlowControl
&
FlowControl
::
GetInstance
()
FlowControl
&
FlowControl
::
GetInstance
()
{
{
...
@@ -27,6 +28,30 @@ FlowControl::FlowControl()
...
@@ -27,6 +28,30 @@ FlowControl::FlowControl()
m_procOrderSocket
=
NULL
;
m_procOrderSocket
=
NULL
;
FmPlugin
::
GetInstance
().
SetRemoteInfo
(
ConfigManger
::
GetInstance
().
GetDbServerIp
(),
ConfigManger
::
GetInstance
().
GetDbServerPort
());
FmPlugin
::
GetInstance
().
SetRemoteInfo
(
ConfigManger
::
GetInstance
().
GetDbServerIp
(),
ConfigManger
::
GetInstance
().
GetDbServerPort
());
m_tChekDelivery
.
start
(
1000
);
connect
(
&
m_tChekDelivery
,
&
QTimer
::
timeout
,
this
,
&
FlowControl
::
_ChekDeliveryStatus
);
}
void
FlowControl
::
_ChekDeliveryStatus
()
{
qDebug
()
<<
__FUNCTION__
;
qint64
alramTime
=
(
qint64
)
ConfigManger
::
GetInstance
().
GetDeliveryAlramTime
();
qint64
crtTimestamp
=
QDateTime
::
currentMSecsSinceEpoch
()
/
1000
;
foreach
(
OrderObject
*
obj
,
m_listOrder
)
{
if
(
obj
->
order_type
==
1
&&
obj
->
courier_name
.
isEmpty
()
&&
obj
->
status
==
2
)
{
qDebug
()
<<
"11111111111111"
<<
crtTimestamp
<<
" '"
<<
obj
->
create_time
<<
" "
<<
alramTime
;
if
((
crtTimestamp
-
obj
->
create_time
)
>
alramTime
)
{
emit
showAlert
(
AlertForm
::
ERROR
,
QString
(
"请注意,%1[%2]号订单[%3]长时间无人配送."
).
arg
(
obj
->
channelName
).
arg
(
obj
->
order_index
).
arg
(
obj
->
order_id
));
m_listOrder
.
removeOne
(
obj
);
break
;
}
}
}
}
}
void
FlowControl
::
onGetNewStoreInfo
(
const
QString
&
operator_id
,
const
QString
&
pos_id
,
const
QString
&
store_id
,
const
QString
&
business_date
)
void
FlowControl
::
onGetNewStoreInfo
(
const
QString
&
operator_id
,
const
QString
&
pos_id
,
const
QString
&
store_id
,
const
QString
&
business_date
)
...
@@ -172,6 +197,8 @@ bool FlowControl::_PullOrder()
...
@@ -172,6 +197,8 @@ bool FlowControl::_PullOrder()
}
}
emit
changeOrderStatus
(
orderObject
,
-
100
,
bRed
);
emit
changeOrderStatus
(
orderObject
,
-
100
,
bRed
);
m_listOrder
.
append
(
orderObject
);
}
else
}
else
{
{
//旧数据有更新
//旧数据有更新
...
@@ -217,7 +244,6 @@ bool FlowControl::_PullOrder()
...
@@ -217,7 +244,6 @@ bool FlowControl::_PullOrder()
}
}
}
}
}
}
if
(
orderObject
->
delivery_status
==
1
)
if
(
orderObject
->
delivery_status
==
1
)
{
{
// 打印
// 打印
...
@@ -240,7 +266,6 @@ bool FlowControl::_PullOrder()
...
@@ -240,7 +266,6 @@ bool FlowControl::_PullOrder()
{
{
QLOG_INFO
()
<<
QString
(
"print failed, %1"
).
arg
(
error
);
QLOG_INFO
()
<<
QString
(
"print failed, %1"
).
arg
(
error
);
}
}
}
}
}
}
...
@@ -598,6 +623,8 @@ QString FlowControl::_GetJsonStr(const QJsonObject &json)
...
@@ -598,6 +623,8 @@ QString FlowControl::_GetJsonStr(const QJsonObject &json)
return
QString
(
QJsonDocument
(
json
).
toJson
(
QJsonDocument
::
Compact
)).
replace
(
"
\"
"
,
""
);
return
QString
(
QJsonDocument
(
json
).
toJson
(
QJsonDocument
::
Compact
)).
replace
(
"
\"
"
,
""
);
}
}
void
FlowControl
::
onProcessOrder
(
const
QString
&
operation
,
const
QString
&
orderId
,
const
DeliverObject
&
deliverObj
)
void
FlowControl
::
onProcessOrder
(
const
QString
&
operation
,
const
QString
&
orderId
,
const
DeliverObject
&
deliverObj
)
{
{
if
(
!
operation
.
compare
(
OPERATION_GETDELIVERS
))
if
(
!
operation
.
compare
(
OPERATION_GETDELIVERS
))
...
...
fmTakeaway/Control/flowControl.h
View file @
e9f6f75a
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
#include "Model/cashierObject.h"
#include "Model/cashierObject.h"
#include "alertForm.h"
#include "alertForm.h"
#include <QMap>
#include <QMap>
#include <QTimer>
class
FlowControl
:
public
QObject
class
FlowControl
:
public
QObject
{
{
...
@@ -41,6 +42,10 @@ private:
...
@@ -41,6 +42,10 @@ private:
// 是否第一次获取到门店信息
// 是否第一次获取到门店信息
bool
m_bFirstRecvInfo
;
bool
m_bFirstRecvInfo
;
// 待检测订单配送状态的容器
QList
<
OrderObject
*>
m_listOrder
;
QTimer
m_tChekDelivery
;
signals
:
signals
:
/* 功能:隐藏通知窗口
/* 功能:隐藏通知窗口
* 参数:NULL
* 参数:NULL
...
@@ -145,6 +150,12 @@ private slots:
...
@@ -145,6 +150,12 @@ private slots:
* */
* */
QString
_GetJsonStr
(
const
QJsonObject
&
json
);
QString
_GetJsonStr
(
const
QJsonObject
&
json
);
/* 功能:检测订单配送状态
* 参数:NULL
* 返回:NULL
* */
void
_ChekDeliveryStatus
();
public
slots
:
public
slots
:
/* 功能:获取到新的门店信息
/* 功能:获取到新的门店信息
* 参数:[1]操作员ID[2]POS机ID
* 参数:[1]操作员ID[2]POS机ID
...
...
fmTakeaway/DTools/configManger.cpp
View file @
e9f6f75a
...
@@ -122,5 +122,10 @@ int ConfigManger::GetDbServerPort()
...
@@ -122,5 +122,10 @@ int ConfigManger::GetDbServerPort()
return
m_config
->
value
(
INI_DBSERVERPORT
).
toInt
();
return
m_config
->
value
(
INI_DBSERVERPORT
).
toInt
();
}
}
int
ConfigManger
::
GetDeliveryAlramTime
()
{
return
m_config
->
value
(
INI_ALRAMTIME
).
toInt
()
*
60
;
}
fmTakeaway/DTools/configManger.h
View file @
e9f6f75a
...
@@ -104,6 +104,12 @@ public:
...
@@ -104,6 +104,12 @@ public:
* */
* */
int
GetDbServerPort
();
int
GetDbServerPort
();
/* 功能:获取检测订单配送状态的提醒时间
* 参数:NULL
* 返回:有效的时间(ms)
* */
int
GetDeliveryAlramTime
();
private
:
private
:
ConfigManger
();
ConfigManger
();
ConfigManger
(
ConfigManger
const
&
);
ConfigManger
(
ConfigManger
const
&
);
...
...
fmTakeaway/main.cpp
View file @
e9f6f75a
...
@@ -78,6 +78,7 @@ int main(int argc, char *argv[])
...
@@ -78,6 +78,7 @@ int main(int argc, char *argv[])
FloatForm
f
;
FloatForm
f
;
MainForm
w
;
MainForm
w
;
QObject
::
connect
(
&
w
,
&
MainForm
::
showFloatForm
,
&
f
,
&
FloatForm
::
onShow
);
QObject
::
connect
(
&
w
,
&
MainForm
::
showFloatForm
,
&
f
,
&
FloatForm
::
onShow
);
QObject
::
connect
(
&
w
,
&
MainForm
::
hideFloatForm
,
&
f
,
&
FloatForm
::
hide
);
QObject
::
connect
(
&
w
,
&
MainForm
::
startRemind
,
&
f
,
&
FloatForm
::
onStartRemind
);
QObject
::
connect
(
&
w
,
&
MainForm
::
startRemind
,
&
f
,
&
FloatForm
::
onStartRemind
);
QObject
::
connect
(
&
w
,
&
MainForm
::
stopRemind
,
&
f
,
&
FloatForm
::
onStopRemind
);
QObject
::
connect
(
&
w
,
&
MainForm
::
stopRemind
,
&
f
,
&
FloatForm
::
onStopRemind
);
QObject
::
connect
(
&
f
,
&
FloatForm
::
showMainForm
,
&
w
,
&
MainForm
::
show
);
QObject
::
connect
(
&
f
,
&
FloatForm
::
showMainForm
,
&
w
,
&
MainForm
::
show
);
...
...
fmTakeaway/mainForm.cpp
View file @
e9f6f75a
...
@@ -272,6 +272,12 @@ void MainForm::onHideAlert()
...
@@ -272,6 +272,12 @@ void MainForm::onHideAlert()
void
MainForm
::
onShowAlert
(
AlertForm
::
Type
type
,
const
QString
&
msg
)
void
MainForm
::
onShowAlert
(
AlertForm
::
Type
type
,
const
QString
&
msg
)
{
{
m_alertForm
->
hide
();
if
(
isHidden
())
{
emit
hideFloatForm
();
show
();
}
m_alertForm
->
SetContent
(
type
,
msg
);
m_alertForm
->
SetContent
(
type
,
msg
);
m_alertForm
->
show
();
m_alertForm
->
show
();
}
}
...
...
fmTakeaway/mainForm.h
View file @
e9f6f75a
...
@@ -98,6 +98,7 @@ signals:
...
@@ -98,6 +98,7 @@ signals:
* 返回:NULL
* 返回:NULL
* */
* */
void
showFloatForm
();
void
showFloatForm
();
void
hideFloatForm
();
/* 功能:通知悬浮窗开始提示
/* 功能:通知悬浮窗开始提示
* 参数:[1]提示类型 0新订单1退款申请
* 参数:[1]提示类型 0新订单1退款申请
* 返回:NULL
* 返回:NULL
...
@@ -114,7 +115,6 @@ signals:
...
@@ -114,7 +115,6 @@ signals:
* */
* */
void
getOrderDetails
(
const
QString
&
orderId
);
void
getOrderDetails
(
const
QString
&
orderId
);
private
slots
:
private
slots
:
/* 功能:初始化
/* 功能:初始化
* 参数:NULL
* 参数:NULL
...
...
fmTakeaway/preDefine.h
View file @
e9f6f75a
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#define INI_BLINKINTERVAL "Float/blinkInterval"
#define INI_BLINKINTERVAL "Float/blinkInterval"
#define INI_SOUNDINTERVAL "Float/soundInterval"
#define INI_SOUNDINTERVAL "Float/soundInterval"
#define INI_REENTRY "Features/reEntry"
#define INI_REENTRY "Features/reEntry"
#define INI_ALRAMTIME "Features/alramTime"
#define INI_TCPPORT "TcpServer/Port"
#define INI_TCPPORT "TcpServer/Port"
#define INI_DBSERVERIP "DbServer/ip"
#define INI_DBSERVERIP "DbServer/ip"
#define INI_DBSERVERPORT "DbServer/port"
#define INI_DBSERVERPORT "DbServer/port"
...
...
run/config.ini
View file @
e9f6f75a
...
@@ -11,4 +11,6 @@ ip=127.0.0.1
...
@@ -11,4 +11,6 @@ ip=127.0.0.1
port
=
7776
port
=
7776
;是否有重新录单的按钮
;是否有重新录单的按钮
[Features]
[Features]
reEntry
=
1
reEntry
=
1
\ No newline at end of file
;检测订单的配送状态的提醒时间阈值(min)
alramTime
=
20
\ No newline at end of file
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