Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmtakeout
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
李定达
fmtakeout
Commits
f614c7cd
Commit
f614c7cd
authored
Mar 19, 2019
by
xiaoqing.gu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.6.0第三方配送对接
parent
c768bf9d
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
653 additions
and
14 deletions
+653
-14
takeout/base/Print/newprintlib.cpp
+1
-1
takeout/control/driverinfogetwork.cpp
+192
-0
takeout/control/driverinfogetwork.h
+138
-0
takeout/control/ordergetwork.cpp
+6
-0
takeout/control/orderpushwork.cpp
+49
-0
takeout/control/orderpushwork.h
+2
-0
takeout/event/posevent.cpp
+3
-0
takeout/event/posevent.h
+5
-0
takeout/main.cpp
+8
-1
takeout/model/posorderpool.cpp
+76
-0
takeout/model/posorderpool.h
+16
-0
takeout/preDefine.h
+1
-0
takeout/takeout.pro
+5
-3
takeout/view/newdetailform.cpp
+18
-0
takeout/view/newdetailform.ui
+48
-3
takeout/view/newmainform.cpp
+47
-3
takeout/view/ordertypeform.cpp
+31
-0
takeout/view/ordertypeform.h
+4
-0
takeout/view/ordertypeform.ui
+3
-3
No files found.
takeout/base/Print/newprintlib.cpp
View file @
f614c7cd
...
@@ -494,7 +494,7 @@ bool NewPrintLib::PrintLabel(const QString &config, OrderObject *order)
...
@@ -494,7 +494,7 @@ bool NewPrintLib::PrintLabel(const QString &config, OrderObject *order)
while
(
num
>
0
)
while
(
num
>
0
)
{
{
QByteArray
data
=
config
.
to
Utf8
();
QByteArray
data
=
config
.
to
Local8Bit
();
char
*
tmpconfig
=
NULL
;
char
*
tmpconfig
=
NULL
;
...
...
takeout/control/driverinfogetwork.cpp
0 → 100644
View file @
f614c7cd
#include "driverinfogetwork.h"
#include "event/fmapplication.h"
#include "event/posevent.h"
#include "QsLog.h"
#include <QJsonArray>
DriverInfoGetWork
::
DriverInfoGetWork
(
WorkObject
*
parent
)
:
WorkObject
(
parent
)
{
_isgetorder
=
false
;
FMApplication
::
subscibeEvent
(
this
,
PosEvent
::
s_get_order_status
);
FMApplication
::
subscibeEvent
(
this
,
PosEvent
::
s_token_change
);
FMApplication
::
subscibeEvent
(
this
,
PosEvent
::
s_login_storeinfo
);
FMApplication
::
subscibeEvent
(
this
,
PosEvent
::
s_need_get_driver_info
);
}
DriverInfoGetWork
::~
DriverInfoGetWork
()
{
qDebug
()
<<
""
;
while
(
!
_stoped
)
{
_stopflag
=
true
;
emit
quit
();
EVENTWAIT
(
10
);
}
}
bool
DriverInfoGetWork
::
event
(
QEvent
*
e
)
{
if
(
e
->
type
()
==
PosEvent
::
s_get_order_status
)
{
bool
isgetorder
=
false
;
GETEVENTINFO
(
isgetorder
,
e
,
bool
);
QLOG_DEBUG
()
<<
"DriverInfoGetWork::event::PosEvent::s_get_order_status:"
<<
isgetorder
;
_isgetorder
=
isgetorder
;
return
true
;
}
if
(
e
->
type
()
==
PosEvent
::
s_token_change
)
{
QString
token
;
GETEVENTINFO
(
token
,
e
,
QString
);
QLOG_DEBUG
()
<<
"DriverInfoGetWork::event::PosEvent::s_token_chang:"
<<
token
;
_token
=
token
;
emit
quit
();
return
true
;
}
if
(
e
->
type
()
==
PosEvent
::
s_login_storeinfo
)
{
QVariantMap
storeinfo
;
GETEVENTINFO
(
storeinfo
,
e
,
QVariantMap
);
QLOG_DEBUG
()
<<
"StallsGetWork::event::PosEvent::s_login_storeinfo:"
<<
storeinfo
;
_storeinfo
=
storeinfo
;
return
true
;
}
if
(
e
->
type
()
==
PosEvent
::
s_need_get_driver_info
)
{
QLOG_INFO
()
<<
QThread
::
currentThreadId
()
<<
"OrderGetWork PosEvent::s_need_get_order"
;
emit
quitwork
();
return
true
;
}
return
WorkObject
::
event
(
e
);
}
void
DriverInfoGetWork
::
setUrl
(
const
QString
&
url
)
{
_url
=
url
;
}
void
DriverInfoGetWork
::
workstart
()
{
if
(
_token
.
isEmpty
())
{
QEventLoop
loop
;
connect
(
this
,
&
DriverInfoGetWork
::
quit
,
&
loop
,
&
QEventLoop
::
quit
);
loop
.
exec
();
}
if
(
_isgetorder
)
{
QEventLoop
loop
;
connect
(
this
,
&
DriverInfoGetWork
::
quit
,
&
loop
,
&
QEventLoop
::
quit
);
loop
.
exec
();
}
QLOG_DEBUG
()
<<
"DriverInfoGetWork::workstart loop start"
;
while
(
!
_stopflag
)
{
if
(
!
getDriverInfo
())
{
QLOG_WARN
()
<<
"DriverInfoGetWork::getDriverInfo failed wait "
<<
DEFAULT_STALLS_TIMEOUT
;
QTimer
timer
;
QEventLoop
loop
;
connect
(
this
,
&
DriverInfoGetWork
::
quit
,
&
loop
,
&
QEventLoop
::
quit
);
connect
(
&
timer
,
&
QTimer
::
timeout
,
&
loop
,
&
QEventLoop
::
quit
);
timer
.
start
(
DEFAULT_STALLS_TIMEOUT
);
loop
.
exec
();
continue
;
}
//获取档口信息完成后检擦是否退出表示
if
(
_stopflag
)
break
;
QEventLoop
loop
;
connect
(
this
,
&
DriverInfoGetWork
::
quit
,
&
loop
,
&
QEventLoop
::
quit
);
connect
(
this
,
&
DriverInfoGetWork
::
quitwork
,
&
loop
,
&
QEventLoop
::
quit
);
loop
.
exec
();
}
_stoped
=
true
;
}
bool
DriverInfoGetWork
::
getDriverInfo
()
{
QJsonObject
json
,
recvjson
;
QString
realurl
;
QString
error
;
if
(
!
GetDriverInfoDataProcess
::
getDriverInfoRequest
(
json
,
_storeinfo
))
{
QLOG_ERROR
()
<<
"getDriverInfoRequest failed"
;
return
false
;
}
QLOG_INFO
()
<<
"getDriverInfoRequest request json : "
<<
json
;
if
(
!
GetDriverInfoDataProcess
::
getRealUrl
(
ADVANCEORDER
,
json
,
_url
,
realurl
))
{
QLOG_ERROR
()
<<
"GetDriverInfoDataProcess getRealUrl failed"
;
return
false
;
}
QLOG_INFO
()
<<
"GetDriverInfoDataProcess request url :"
<<
realurl
;
if
(
!
this
->
S_Request
(
json
,
recvjson
,
realurl
,
error
))
{
QLOG_ERROR
()
<<
"getDriverInfo failed : "
<<
error
;
return
false
;
}
QLOG_INFO
()
<<
"getDriverInfo return json : "
<<
recvjson
;
return
praseRecvJson
(
recvjson
);
}
bool
DriverInfoGetWork
::
praseRecvJson
(
QJsonObject
&
json
)
{
if
(
!
json
.
contains
(
JSON_KEY_CODE
)
||
QString
(
"ok"
).
compare
(
json
[
JSON_KEY_CODE
].
toString
(),
Qt
::
CaseInsensitive
)
!=
0
)
{
QLOG_ERROR
()
<<
"DriverInfoGetWork::praseRecvJson failed"
;
return
false
;
}
if
(
!
json
.
contains
(
JSON_KEY_RESULT
))
{
QLOG_ERROR
()
<<
"DriverInfoGetWork::praseRecvJson failed"
;
return
false
;
}
QJsonArray
result
=
json
[
JSON_KEY_RESULT
].
toArray
();
QLOG_DEBUG
()
<<
"QJsonArray result:"
<<
result
.
size
();
for
(
int
i
=
0
;
i
<
result
.
size
();
i
++
)
{
QJsonObject
driverInfo
=
result
.
at
(
i
).
toObject
();
QLOG_DEBUG
()
<<
"driverinfo input:"
<<
driverInfo
;
QVariantMap
map
;
map
.
insert
(
JSON_ORDERID
,
driverInfo
[
"order_id"
].
toString
());
map
.
insert
(
"rider_name"
,
driverInfo
[
"rider_name"
].
toString
());
map
.
insert
(
"rider_phone"
,
driverInfo
[
"rider_phone"
].
toString
());
POSTEVENTTYPE
(
PosEvent
::
s_get_driver_info
,
map
,
QVariantMap
);
}
return
true
;
}
takeout/control/driverinfogetwork.h
0 → 100644
View file @
f614c7cd
#ifndef DRIVERINFOGETWORK_H
#define DRIVERINFOGETWORK_H
#include <QEvent>
#include <QString>
#include <QJsonObject>
#include <QTimer>
#include <QEventLoop>
#include "workobject.h"
#include "preDefine.h"
#include "base/Arithmetic/cretopt.h"
#define ADVANCEORDER 0
class
DriverInfoGetWork
:
public
WorkObject
{
Q_OBJECT
public
:
explicit
DriverInfoGetWork
(
WorkObject
*
parent
=
0
);
~
DriverInfoGetWork
();
bool
event
(
QEvent
*
e
);
void
setUrl
(
const
QString
&
url
);
signals
:
void
quitwork
();
public
slots
:
void
workstart
();
private
:
bool
getDriverInfo
();
bool
praseRecvJson
(
QJsonObject
&
json
);
private
:
QVariantMap
_storeinfo
;
QString
_token
;
QString
_url
;
bool
_isgetorder
;
};
class
GetDriverInfoDataProcess
{
public
:
friend
class
DriverInfoGetWork
;
private
:
static
bool
getAction
(
int
REQ
,
QString
&
action
)
{
#ifndef USE_QAACTION
switch
(
REQ
)
{
case
ADVANCEORDER
:
action
=
QString
(
"saas.order.deliveryInfo"
);
return
true
;
default
:
return
false
;
}
#else
switch
(
REQ
)
{
case
ADVANCEORDER
:
action
=
QString
(
"qasaas.order.deliveryInfo"
);
return
true
;
default
:
return
false
;
}
#endif
}
static
bool
getAccess_Token
(
QString
&
access_toekn
)
{
access_toekn
=
DEFAULT_ACCESS_TOKEN
;
return
true
;
}
static
bool
getVer
(
QString
&
ver
)
{
ver
=
"1"
;
return
true
;
}
static
bool
getRealUrl
(
int
reqtype
,
const
QJsonObject
&
json
,
const
QString
&
url
,
QString
&
realurl
)
{
QString
action
,
access_token
,
ver
,
sign
;
if
(
!
GetDriverInfoDataProcess
::
requestGetRSASign
(
reqtype
,
json
,
sign
,
action
,
access_token
,
ver
))
return
false
;
QString
tmpurl
=
url
;
realurl
=
tmpurl
.
arg
(
action
,
access_token
,
ver
,
sign
);
return
true
;
}
static
bool
requestGetRSASign
(
int
reqtype
,
const
QJsonObject
&
json
,
QString
&
sign
,
QString
&
action
,
QString
&
access_token
,
QString
&
ver
)
{
QJsonObject
tmpjson
;
if
(
!
GetDriverInfoDataProcess
::
getAction
(
reqtype
,
action
)
||
!
GetDriverInfoDataProcess
::
getAccess_Token
(
access_token
)
||
!
GetDriverInfoDataProcess
::
getVer
(
ver
))
return
false
;
GetDriverInfoDataProcess
::
getComplateJson
(
action
,
access_token
,
ver
,
json
,
tmpjson
);
return
CretOperate
::
GetSign
(
tmpjson
,
sign
);
}
static
void
getComplateJson
(
QString
action
,
QString
access_token
,
QString
ver
,
const
QJsonObject
&
json
,
QJsonObject
&
complatejson
)
{
complatejson
=
json
;
complatejson
.
insert
(
JSON_KEY_ACTION
,
action
);
complatejson
.
insert
(
JSON_KEY_ACCESS_TOKEN
,
access_token
);
complatejson
.
insert
(
JSON_KEY_VER
,
ver
);
}
static
bool
getDriverInfoRequest
(
QJsonObject
&
data
,
QVariantMap
&
map
)
{
if
(
!
map
.
contains
(
JSON_STOREID
))
{
return
false
;
}
data
.
insert
(
JSON_KEY_PARTNERID
,
map
[
JSON_KEY_PARTNERID
].
toString
());
data
.
insert
(
JSON_STOREID
,
map
[
JSON_STOREID
].
toString
());
return
true
;
}
};
#endif // DRIVERINFOGETWORK_H
takeout/control/ordergetwork.cpp
View file @
f614c7cd
...
@@ -335,6 +335,12 @@ bool OrderGetWork::PullOrder(unsigned int timeout, QString &error)
...
@@ -335,6 +335,12 @@ bool OrderGetWork::PullOrder(unsigned int timeout, QString &error)
OrderGetDataProcess
::
getTimestamp
(
recvjson
,
_timestamp
);
OrderGetDataProcess
::
getTimestamp
(
recvjson
,
_timestamp
);
QVariantMap
map
;
map
.
insert
(
EVENT_KEY_STATUS
,
true
);
map
.
insert
(
EVENT_KEY_MSG
,
error
);
POSTEVENTTYPE
(
PosEvent
::
s_get_order_status
,
map
,
QVariantMap
);
return
true
;
return
true
;
}
}
...
...
takeout/control/orderpushwork.cpp
View file @
f614c7cd
...
@@ -387,6 +387,47 @@ void OrderPushWork::heartBeatTcpService()
...
@@ -387,6 +387,47 @@ void OrderPushWork::heartBeatTcpService()
continue
;
continue
;
}
}
else
if
(
cmd
==
COMMAND_LOGIN_REQ
)
{
quint32
reallen
=
0
;
QByteArray
tmplen
=
_socket
->
read
(
4
);
OrderPushDataProcess
::
getRealLen
(
tmplen
,
reallen
);
QByteArray
msgdata
=
_socket
->
read
(
reallen
);
needPostDriverEvent
(
msgdata
);
QByteArray
data
;
OrderPushDataProcess
::
getMSGResponseData
(
data
,
tmplenandsynSeq
);
QLOG_INFO
()
<<
"tcp response data : "
<<
data
.
toHex
();
_socket
->
write
(
data
);
//_socket->waitForBytesWritten();
_istimeout
=
true
;
{
QEventLoop
loop
;
QTimer
timer
;
connect
(
this
,
&
OrderPushWork
::
quit
,
&
loop
,
&
QEventLoop
::
quit
);
connect
(
&
timer
,
&
QTimer
::
timeout
,
&
loop
,
&
QEventLoop
::
quit
);
connect
(
this
,
&
OrderPushWork
::
writeready
,
&
loop
,
&
QEventLoop
::
quit
);
timer
.
start
(
30
*
1000
);
loop
.
exec
();
}
continue
;
}
QLOG_ERROR
()
<<
"not support cmdtype"
;
QLOG_ERROR
()
<<
"not support cmdtype"
;
_socket
->
readAll
();
_socket
->
readAll
();
break
;
break
;
...
@@ -403,6 +444,14 @@ bool OrderPushWork::checkMsgData(const QByteArray &msgdata)
...
@@ -403,6 +444,14 @@ bool OrderPushWork::checkMsgData(const QByteArray &msgdata)
return
false
;
return
false
;
}
}
bool
OrderPushWork
::
needPostDriverEvent
(
const
QByteArray
&
msgdata
)
{
QLOG_INFO
()
<<
"recv driver_get_work info : "
<<
msgdata
;
DEFAULTPOSTEVENT
(
PosEvent
::
s_need_get_driver_info
,
QString
::
fromUtf8
(
msgdata
));
return
false
;
}
bool
OrderPushWork
::
GetServiceList
()
bool
OrderPushWork
::
GetServiceList
()
{
{
if
(
_serurl
.
isEmpty
())
if
(
_serurl
.
isEmpty
())
...
...
takeout/control/orderpushwork.h
View file @
f614c7cd
...
@@ -138,6 +138,8 @@ public:
...
@@ -138,6 +138,8 @@ public:
bool
getHost
(
QString
&
ip
,
qint16
&
port
);
bool
getHost
(
QString
&
ip
,
qint16
&
port
);
//检查是否有效的MSG
//检查是否有效的MSG
bool
checkMsgData
(
const
QByteArray
&
msgdata
);
bool
checkMsgData
(
const
QByteArray
&
msgdata
);
//收到骑手接单消息后推送需要拉取骑手信息的事件
bool
needPostDriverEvent
(
const
QByteArray
&
msgdata
);
private
:
private
:
bool
GetServiceList
();
bool
GetServiceList
();
...
...
takeout/event/posevent.cpp
View file @
f614c7cd
...
@@ -30,6 +30,9 @@ QEvent::Type PosEvent::s_change_stalls = static_cast<QEvent::Type>(QEvent::regis
...
@@ -30,6 +30,9 @@ QEvent::Type PosEvent::s_change_stalls = static_cast<QEvent::Type>(QEvent::regis
QEvent
::
Type
PosEvent
::
s_show_stalls
=
static_cast
<
QEvent
::
Type
>
(
QEvent
::
registerEventType
());
QEvent
::
Type
PosEvent
::
s_show_stalls
=
static_cast
<
QEvent
::
Type
>
(
QEvent
::
registerEventType
());
QEvent
::
Type
PosEvent
::
s_get_prtmodel
=
static_cast
<
QEvent
::
Type
>
(
QEvent
::
registerEventType
());
QEvent
::
Type
PosEvent
::
s_get_prtmodel
=
static_cast
<
QEvent
::
Type
>
(
QEvent
::
registerEventType
());
QEvent
::
Type
PosEvent
::
s_driver_order_status
=
static_cast
<
QEvent
::
Type
>
(
QEvent
::
registerEventType
());
QEvent
::
Type
PosEvent
::
s_get_driver_info
=
static_cast
<
QEvent
::
Type
>
(
QEvent
::
registerEventType
());
QEvent
::
Type
PosEvent
::
s_need_get_driver_info
=
static_cast
<
QEvent
::
Type
>
(
QEvent
::
registerEventType
());
PosEvent
::
PosEvent
(
Type
e
)
:
QEvent
(
e
)
PosEvent
::
PosEvent
(
Type
e
)
:
QEvent
(
e
)
{
{
...
...
takeout/event/posevent.h
View file @
f614c7cd
...
@@ -116,6 +116,11 @@ public:
...
@@ -116,6 +116,11 @@ public:
//---------------------打印模板-----------------------
//---------------------打印模板-----------------------
static
Type
s_get_prtmodel
;
static
Type
s_get_prtmodel
;
//---------------------第三方配送---------------------
static
Type
s_driver_order_status
;
//拉取到骑手信息并缓存后,推送事件,展示界面响应事件,展示图标
static
Type
s_get_driver_info
;
//登陆拉取骑手信息后,推送事件,posorderpool响应事件,将骑手信息缓存
static
Type
s_need_get_driver_info
;
//收到消息中心推送的cmd=5的消息的时候,推送的事件
private:
private:
//事件携带的信息,该内存你应当在堆中分配
//事件携带的信息,该内存你应当在堆中分配
void
*
_info
;
void
*
_info
;
...
...
takeout/main.cpp
View file @
f614c7cd
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
#include "control/prtmodelgetwork.h"
#include "control/prtmodelgetwork.h"
#include "control/stallsgetwork.h"
#include "control/stallsgetwork.h"
#include "control/networkcheckwork.h"
#include "control/networkcheckwork.h"
#include "control/driverinfogetwork.h"
#include "base/Dump/dump.h"
#include "base/Dump/dump.h"
#include "base/DB/fm_database.h"
#include "base/DB/fm_database.h"
//#include "view/loginform.h"
//#include "view/loginform.h"
...
@@ -161,6 +162,8 @@ int main(int argc, char *argv[])
...
@@ -161,6 +162,8 @@ int main(int argc, char *argv[])
QThread
stallsThread
;
QThread
stallsThread
;
//获取打印模板线程
//获取打印模板线程
QThread
prtModelThread
;
QThread
prtModelThread
;
//获取骑手信息线程
QThread
driverInfoThread
;
QLOG_INFO
()
<<
"Thread List :"
<<
&
thread
<<
&
threadt
<<
QThread
::
currentThread
();
QLOG_INFO
()
<<
"Thread List :"
<<
&
thread
<<
&
threadt
<<
QThread
::
currentThread
();
//初始化打印文件
//初始化打印文件
InitPtr
();
InitPtr
();
...
@@ -190,11 +193,13 @@ int main(int argc, char *argv[])
...
@@ -190,11 +193,13 @@ int main(int argc, char *argv[])
StallsGetWork
stallsgetwork
;
StallsGetWork
stallsgetwork
;
//获取打印模板
//获取打印模板
prtModelGetWork
prtmodelgetwork
;
prtModelGetWork
prtmodelgetwork
;
//拉取骑手信息
DriverInfoGetWork
driverinfogetwork
;
//网络超时工作
//网络超时工作
NetworkCheckWork
networkcheckwork
;
NetworkCheckWork
networkcheckwork
;
driverinfogetwork
.
setUrl
(
geturl
);
prtmodelgetwork
.
setUrl
(
geturl
);
prtmodelgetwork
.
setUrl
(
geturl
);
stallsgetwork
.
setUrl
(
geturl
);
stallsgetwork
.
setUrl
(
geturl
);
pickuporderwork
.
setUrl
(
geturl
);
pickuporderwork
.
setUrl
(
geturl
);
...
@@ -214,6 +219,7 @@ int main(int argc, char *argv[])
...
@@ -214,6 +219,7 @@ int main(int argc, char *argv[])
stallsgetwork
.
moveToThread
(
&
stallsThread
,
true
);
stallsgetwork
.
moveToThread
(
&
stallsThread
,
true
);
prtmodelgetwork
.
moveToThread
(
&
prtModelThread
,
true
);
prtmodelgetwork
.
moveToThread
(
&
prtModelThread
,
true
);
driverinfogetwork
.
moveToThread
(
&
driverInfoThread
,
true
);
//启动tcp长链接和拉单工作流
//启动tcp长链接和拉单工作流
thread
.
start
();
thread
.
start
();
threadt
.
start
();
threadt
.
start
();
...
@@ -223,6 +229,7 @@ int main(int argc, char *argv[])
...
@@ -223,6 +229,7 @@ int main(int argc, char *argv[])
checkipthread
.
start
();
checkipthread
.
start
();
stallsThread
.
start
();
stallsThread
.
start
();
prtModelThread
.
start
();
prtModelThread
.
start
();
driverInfoThread
.
start
();
//界面类定义及初始化
//界面类定义及初始化
#ifndef FM_NEW_UI
#ifndef FM_NEW_UI
MainForm
mainform
;
MainForm
mainform
;
...
...
takeout/model/posorderpool.cpp
View file @
f614c7cd
...
@@ -47,6 +47,7 @@ PosOrderPool::PosOrderPool(QObject *parent) : QObject(parent)
...
@@ -47,6 +47,7 @@ PosOrderPool::PosOrderPool(QObject *parent) : QObject(parent)
FMApplication
::
subscibeEvent
(
this
,
PosEvent
::
s_change_orderpool
);
FMApplication
::
subscibeEvent
(
this
,
PosEvent
::
s_change_orderpool
);
FMApplication
::
subscibeEvent
(
this
,
PosEvent
::
s_location_orderpool
);
FMApplication
::
subscibeEvent
(
this
,
PosEvent
::
s_location_orderpool
);
FMApplication
::
subscibeEvent
(
this
,
PosEvent
::
s_pickuporder_remind
);
FMApplication
::
subscibeEvent
(
this
,
PosEvent
::
s_pickuporder_remind
);
FMApplication
::
subscibeEvent
(
this
,
PosEvent
::
s_get_driver_info
);
loadOrders
();
loadOrders
();
...
@@ -424,6 +425,36 @@ bool PosOrderPool::GetOrderStatusAndOrderType(QString key, int &status, int &ref
...
@@ -424,6 +425,36 @@ bool PosOrderPool::GetOrderStatusAndOrderType(QString key, int &status, int &ref
return
true
;
return
true
;
}
}
bool
PosOrderPool
::
GetDriverInfo
(
QString
key
,
QString
&
rider_name
,
QString
&
rider_phone
)
{
QMutexLocker
loker
(
&
s_mutex
);
if
(
!
s_order_pool
.
contains
(
key
))
return
false
;
Order_Info
info
=
s_order_pool
[
key
];
rider_name
=
info
.
rider_name
;
rider_phone
=
info
.
rider_phone
;
return
true
;
}
bool
PosOrderPool
::
GetDriverStatus
(
QString
key
,
int
&
status
)
{
QMutexLocker
loker
(
&
s_mutex
);
if
(
!
s_order_pool
.
contains
(
key
))
return
false
;
Order_Info
info
=
s_order_pool
[
key
];
status
=
info
.
driver_order_status
;
return
true
;
}
bool
PosOrderPool
::
TryChangeOrderPrintStatus
(
QString
key
,
int
order_print_status
)
bool
PosOrderPool
::
TryChangeOrderPrintStatus
(
QString
key
,
int
order_print_status
)
{
{
QMutexLocker
loker
(
&
s_mutex
);
QMutexLocker
loker
(
&
s_mutex
);
...
@@ -462,6 +493,37 @@ bool PosOrderPool::TryChangeOrderRemindStatus(QString key, int order_remind_stat
...
@@ -462,6 +493,37 @@ bool PosOrderPool::TryChangeOrderRemindStatus(QString key, int order_remind_stat
return
true
;
return
true
;
}
}
bool
PosOrderPool
::
TryChangeDriverInfo
(
QString
key
,
QVariantMap
&
map
)
{
QMutexLocker
loker
(
&
s_mutex
);
if
(
!
s_order_pool
.
contains
(
key
))
return
false
;
Order_Info
info
=
s_order_pool
[
key
];
QLOG_DEBUG
()
<<
"TryChangeDriverInfo:"
<<
info
.
driver_order_status
;
if
(
info
.
driver_order_status
!=
1
)
{
info
.
driver_order_status
=
1
;
info
.
rider_name
=
map
[
"rider_name"
].
toString
();
info
.
rider_phone
=
map
[
"rider_phone"
].
toString
();
s_order_pool
.
insert
(
key
,
info
);
// DEFAULTPOSTEVENT(PosEvent::s_driver_order_status, key);
QVariantMap
map
;
map
.
insert
(
EVENT_KEY_ORDERID
,
info
.
order_id
);
map
.
insert
(
EVENT_KEY_DRIVER_STATUS
,
1
);
POSTEVENTTYPE
(
PosEvent
::
s_driver_order_status
,
map
,
QVariantMap
);
}
return
true
;
}
bool
PosOrderPool
::
GetOrderBaseInfo
(
QString
key
,
QVariantHash
&
hash
)
bool
PosOrderPool
::
GetOrderBaseInfo
(
QString
key
,
QVariantHash
&
hash
)
{
{
QMutexLocker
loker
(
&
s_mutex
);
QMutexLocker
loker
(
&
s_mutex
);
...
@@ -705,6 +767,20 @@ bool PosOrderPool::event(QEvent *e)
...
@@ -705,6 +767,20 @@ bool PosOrderPool::event(QEvent *e)
return
true
;
return
true
;
}
}
if
(
e
->
type
()
==
PosEvent
::
s_get_driver_info
)
{
QLOG_INFO
()
<<
"PosEvent::s_get_driver_info : "
<<
QThread
::
currentThreadId
();
QVariantMap
map
;
GETEVENTINFO
(
map
,
e
,
QVariantMap
);
TryChangeDriverInfo
(
map
[
JSON_ORDERID
].
toString
(),
map
);
return
true
;
}
return
QObject
::
event
(
e
);
return
QObject
::
event
(
e
);
}
}
...
...
takeout/model/posorderpool.h
View file @
f614c7cd
...
@@ -53,6 +53,9 @@
...
@@ -53,6 +53,9 @@
info.order_refund_status = 0; \
info.order_refund_status = 0; \
info.order_print_status = 0; \
info.order_print_status = 0; \
info.order_change_time = QDateTime::currentDateTime().toTime_t(); \
info.order_change_time = QDateTime::currentDateTime().toTime_t(); \
info.driver_order_status = 0; \
info.rider_name = ""; \
info.rider_phone = ""; \
} while (0)
} while (0)
#define INCTAKEOUT(tmpstatus, tk_new, tk_make, tk_send, tk_refund) do { \
#define INCTAKEOUT(tmpstatus, tk_new, tk_make, tk_send, tk_refund) do { \
...
@@ -180,6 +183,12 @@ typedef struct
...
@@ -180,6 +183,12 @@ typedef struct
QString
reserved4
;
QString
reserved4
;
//保留字段5
//保留字段5
QString
reserved5
;
QString
reserved5
;
//骑手接单的状态
int
driver_order_status
;
//骑手姓名
QString
rider_name
;
//骑手电话
QString
rider_phone
;
}
Order_Info
;
}
Order_Info
;
...
@@ -210,6 +219,10 @@ public:
...
@@ -210,6 +219,10 @@ public:
static
bool
GetOrderStatusAndOrderType
(
QString
key
,
int
&
status
,
int
&
refund_status
,
int
&
order_type
,
bool
&
oldorder
);
static
bool
GetOrderStatusAndOrderType
(
QString
key
,
int
&
status
,
int
&
refund_status
,
int
&
order_type
,
bool
&
oldorder
);
static
bool
GetDriverInfo
(
QString
key
,
QString
&
rider_name
,
QString
&
rider_phone
);
static
bool
GetDriverStatus
(
QString
key
,
int
&
status
);
template
<
typename
T
>
template
<
typename
T
>
static
bool
GetOrderIndex
(
T
&
t
,
std
::
function
<
bool
(
OrderObject
&
order
,
T
&
)
>
fun
)
static
bool
GetOrderIndex
(
T
&
t
,
std
::
function
<
bool
(
OrderObject
&
order
,
T
&
)
>
fun
)
{
{
...
@@ -242,6 +255,9 @@ private:
...
@@ -242,6 +255,9 @@ private:
static
bool
TryChangeOrderRemindStatus
(
QString
key
,
int
order_remind_status
);
static
bool
TryChangeOrderRemindStatus
(
QString
key
,
int
order_remind_status
);
//修改骑手接单状态
static
bool
TryChangeDriverInfo
(
QString
key
,
QVariantMap
&
map
);
static
void
removeOrderInfo
(
QString
key
);
static
void
removeOrderInfo
(
QString
key
);
static
void
GetOrderStatus
(
const
OrderObject
*
order
,
int
&
status
);
static
void
GetOrderStatus
(
const
OrderObject
*
order
,
int
&
status
);
...
...
takeout/preDefine.h
View file @
f614c7cd
...
@@ -204,6 +204,7 @@
...
@@ -204,6 +204,7 @@
#define JSON_KEY_REFUNDSTATUS "refund_status"
#define JSON_KEY_REFUNDSTATUS "refund_status"
#define EVENT_KEY_STATUS "status"
#define EVENT_KEY_STATUS "status"
#define EVENT_KEY_DRIVER_STATUS "driver_status"
#define EVENT_KEY_MSG "msg"
#define EVENT_KEY_MSG "msg"
#define EVENT_KEY_ORDERID "order_id"
#define EVENT_KEY_ORDERID "order_id"
...
...
takeout/takeout.pro
View file @
f614c7cd
...
@@ -21,7 +21,7 @@ LIBS += -L$$PWD/lib -llibeay32 -lssleay32 -lwinspool
...
@@ -21,7 +21,7 @@ LIBS += -L$$PWD/lib -llibeay32 -lssleay32 -lwinspool
LIBS
+=
-
lWs2_32
LIBS
+=
-
lWs2_32
LIBS
+=
-
lDbghelp
LIBS
+=
-
lDbghelp
DEFINES
+=
USE_QAACTION
#
DEFINES += USE_QAACTION
DEFINES
+=
FM_NEW_UI
DEFINES
+=
FM_NEW_UI
#DEFINES += FM_TEST
#DEFINES += FM_TEST
...
@@ -83,7 +83,8 @@ SOURCES += main.cpp \
...
@@ -83,7 +83,8 @@ SOURCES += main.cpp \
control
/
prtmodelgetwork
.
cpp
\
control
/
prtmodelgetwork
.
cpp
\
model
/
prtmodelpool
.
cpp
\
model
/
prtmodelpool
.
cpp
\
view
/
newchangeshiftsform
.
cpp
\
view
/
newchangeshiftsform
.
cpp
\
base
/
Arithmetic
/
cretopt
.
cpp
base
/
Arithmetic
/
cretopt
.
cpp
\
control
/
driverinfogetwork
.
cpp
HEADERS
+=
\
HEADERS
+=
\
event
/
fmapplication
.
h
\
event
/
fmapplication
.
h
\
...
@@ -141,7 +142,8 @@ HEADERS += \
...
@@ -141,7 +142,8 @@ HEADERS += \
base
/
System
/
downloader
.
h
\
base
/
System
/
downloader
.
h
\
control
/
prtmodelgetwork
.
h
\
control
/
prtmodelgetwork
.
h
\
model
/
prtmodelpool
.
h
\
model
/
prtmodelpool
.
h
\
view
/
newchangeshiftsform
.
h
view
/
newchangeshiftsform
.
h
\
control
/
driverinfogetwork
.
h
DISTFILES
+=
takeout
.
rc
DISTFILES
+=
takeout
.
rc
...
...
takeout/view/newdetailform.cpp
View file @
f614c7cd
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
#include "event/fmapplication.h"
#include "event/fmapplication.h"
#include "event/posevent.h"
#include "event/posevent.h"
#include "model/posorderpool.h"
#include "model/posorderpool.h"
#include "model/posorderpool.h"
#include "QsLog.h"
#include "QsLog.h"
NewDetailForm
::
NewDetailForm
(
QWidget
*
parent
)
:
NewDetailForm
::
NewDetailForm
(
QWidget
*
parent
)
:
...
@@ -35,6 +36,12 @@ void NewDetailForm::InitData(OrderObject *orderObject, bool flag)
...
@@ -35,6 +36,12 @@ void NewDetailForm::InitData(OrderObject *orderObject, bool flag)
ui
->
dishTableWidget
->
setRowCount
(
0
);
ui
->
dishTableWidget
->
setRowCount
(
0
);
ui
->
detailBtn2
->
show
();
ui
->
detailBtn2
->
show
();
ui
->
detailBtn3
->
show
();
ui
->
detailBtn3
->
show
();
QString
rider_name
=
""
;
QString
rider_phone
=
""
;
PosOrderPool
::
GetDriverInfo
(
_orderid
,
rider_name
,
rider_phone
);
QLOG_DEBUG
()
<<
"driverinfo"
<<
rider_name
<<
rider_phone
;
//ui->detailBtn1->hide();
//ui->detailBtn1->hide();
//"<h2><i>Hello</i><font color=red>Qt!</font></h2>"
//"<h2><i>Hello</i><font color=red>Qt!</font></h2>"
...
@@ -106,6 +113,17 @@ void NewDetailForm::InitData(OrderObject *orderObject, bool flag)
...
@@ -106,6 +113,17 @@ void NewDetailForm::InitData(OrderObject *orderObject, bool flag)
}
}
//ui->deliveryInfoLb_dec->setText(QString::fromLocal8Bit("【%1】【%2】").arg(orderObject->delivery_party,timeStr));
//ui->deliveryInfoLb_dec->setText(QString::fromLocal8Bit("【%1】【%2】").arg(orderObject->delivery_party,timeStr));
if
(
!
rider_name
.
isEmpty
()
||
!
rider_phone
.
isEmpty
())
{
ui
->
deliverydriverLb_dec
->
setText
(
QString
::
fromLocal8Bit
(
"【%1】【%2】"
).
arg
(
rider_name
,
rider_phone
));
ui
->
deliverydriverLb_dec
->
setWordWrap
(
true
);
}
else
{
ui
->
deliverydriverLb_dec
->
clear
();
}
QList
<
DiscountObject
*>
list
=
orderObject
->
disList
;
QList
<
DiscountObject
*>
list
=
orderObject
->
disList
;
QString
disStr
;
QString
disStr
;
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++
)
{
...
...
takeout/view/newdetailform.ui
View file @
f614c7cd
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
font: 75 14pt
"
微软雅黑
"
;
font: 75 14pt
"
微软雅黑
"
;
}
}
#orderInfoLb,#orderMemoLb,#customerInfoLb,#addressLb,#deliveryInfoLb,#promotionInfoLb,#checkInfoLb
#orderInfoLb,#orderMemoLb,#customerInfoLb,#addressLb,#deliveryInfoLb,#promotionInfoLb,#checkInfoLb
,#deliverydriverLb
{
{
font: 11pt
"
微软雅黑
"
;
font: 11pt
"
微软雅黑
"
;
...
@@ -83,7 +83,7 @@
...
@@ -83,7 +83,7 @@
}
}
#orderInfoLb_dec, #orderMemoLb_dec, #customerInfoLb_dec, #addressLb_dec, #deliveryInfoLb_dec, #promotionInfoLb_dec, #checkInfoLb_dec
#orderInfoLb_dec, #orderMemoLb_dec, #customerInfoLb_dec, #addressLb_dec, #deliveryInfoLb_dec, #promotionInfoLb_dec, #checkInfoLb_dec
,#deliverydriverLb_dec
{
{
font: 11pt
"
微软雅黑
"
;
font: 11pt
"
微软雅黑
"
;
background-color:rgb(250, 249, 249);
background-color:rgb(250, 249, 249);
...
@@ -842,6 +842,51 @@
...
@@ -842,6 +842,51 @@
</layout>
</layout>
</item>
</item>
<item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_12"
>
<property
name=
"spacing"
>
<number>
0
</number>
</property>
<item>
<widget
class=
"QLabel"
name=
"deliverydriverLb"
>
<property
name=
"minimumSize"
>
<size>
<width>
75
</width>
<height>
30
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
75
</width>
<height>
40
</height>
</size>
</property>
<property
name=
"text"
>
<string>
骑手信息
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"deliverydriverLb_dec"
>
<property
name=
"minimumSize"
>
<size>
<width>
0
</width>
<height>
40
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
16777215
</width>
<height>
16777215
</height>
</size>
</property>
<property
name=
"text"
>
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_7"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_7"
>
<property
name=
"spacing"
>
<property
name=
"spacing"
>
<number>
0
</number>
<number>
0
</number>
...
@@ -953,7 +998,7 @@
...
@@ -953,7 +998,7 @@
<number>
20
</number>
<number>
20
</number>
</property>
</property>
<property
name=
"topMargin"
>
<property
name=
"topMargin"
>
<number>
4
0
</number>
<number>
2
0
</number>
</property>
</property>
<property
name=
"rightMargin"
>
<property
name=
"rightMargin"
>
<number>
20
</number>
<number>
20
</number>
...
...
takeout/view/newmainform.cpp
View file @
f614c7cd
...
@@ -49,6 +49,7 @@ NewMainForm::NewMainForm(QWidget *parent) :
...
@@ -49,6 +49,7 @@ NewMainForm::NewMainForm(QWidget *parent) :
FMApplication
::
subscibeEvent
(
this
,
PosEvent
::
s_show_mainform
);
FMApplication
::
subscibeEvent
(
this
,
PosEvent
::
s_show_mainform
);
FMApplication
::
subscibeEvent
(
this
,
PosEvent
::
s_network_outtime
);
FMApplication
::
subscibeEvent
(
this
,
PosEvent
::
s_network_outtime
);
FMApplication
::
subscibeEvent
(
this
,
PosEvent
::
s_show_stalls
);
FMApplication
::
subscibeEvent
(
this
,
PosEvent
::
s_show_stalls
);
FMApplication
::
subscibeEvent
(
this
,
PosEvent
::
s_driver_order_status
);
//this->show();
//this->show();
this
->
showFullScreen
();
this
->
showFullScreen
();
...
@@ -604,6 +605,34 @@ bool NewMainForm::event(QEvent *e)
...
@@ -604,6 +605,34 @@ bool NewMainForm::event(QEvent *e)
return
true
;
return
true
;
}
}
if
(
e
->
type
()
==
PosEvent
::
s_driver_order_status
)
{
QVariantMap
map
;
GETEVENTINFO
(
map
,
e
,
QVariantMap
);
QLOG_DEBUG
()
<<
"PosEvent::s_driver_order_status:"
<<
map
;
QString
orderid
=
map
[
JSON_ORDERID
].
toString
();
OrderObject
order
;
if
(
!
PosOrderPool
::
GetOrderObject
(
orderid
,
order
))
return
true
;
Order_Index
tmp
=
{
order
.
status
,
order
.
refund_status
};
if
(
_order_indexs
.
contains
(
order
.
order_id
))
{
_order_indexs
.
insert
(
order
.
order_id
,
tmp
);
UpdateTableWidget
(
order
);
}
else
{
_order_indexs
.
insert
(
order
.
order_id
,
tmp
);
InsertTableWidget
(
order
);
}
return
true
;
}
if
(
e
->
type
()
==
PosEvent
::
s_login_storeinfo
)
if
(
e
->
type
()
==
PosEvent
::
s_login_storeinfo
)
{
{
QVariantMap
map
;
QVariantMap
map
;
...
@@ -790,11 +819,17 @@ void NewMainForm::UpdateTableWidget(OrderObject &orderObject)
...
@@ -790,11 +819,17 @@ void NewMainForm::UpdateTableWidget(OrderObject &orderObject)
for
(
int
i
=
0
;
i
<
table
->
rowCount
();
i
++
)
for
(
int
i
=
0
;
i
<
table
->
rowCount
();
i
++
)
{
{
OrderTypeForm
*
pwd
=
(
OrderTypeForm
*
)
table
->
cellWidget
(
i
,
1
);
OrderTypeForm
*
pwd
=
(
OrderTypeForm
*
)
table
->
cellWidget
(
i
,
1
);
OrderTypeForm
*
cwd
=
(
OrderTypeForm
*
)
table
->
cellWidget
(
i
,
2
);
OrderOptForm
*
opt
=
(
OrderOptForm
*
)
table
->
cellWidget
(
i
,
6
);
OrderOptForm
*
opt
=
(
OrderOptForm
*
)
table
->
cellWidget
(
i
,
6
);
if
(
orderObject
.
order_id
.
compare
(
pwd
->
order_id
())
==
0
)
if
(
orderObject
.
order_id
.
compare
(
pwd
->
order_id
())
==
0
)
{
{
int
driver_status
;
PosOrderPool
::
GetDriverStatus
(
orderObject
.
order_id
,
driver_status
);
QString
channelName
;
getOrderChannelName
(
&
orderObject
,
channelName
);
pwd
->
InitShow
(
orderObject
.
order_id
,
orderObject
.
status
,
orderObject
.
refund_status
,
orderObject
.
order_type
);
pwd
->
InitShow
(
orderObject
.
order_id
,
orderObject
.
status
,
orderObject
.
refund_status
,
orderObject
.
order_type
);
cwd
->
InitChannelShow
(
orderObject
.
order_id
,
orderObject
.
status
,
orderObject
.
refund_status
,
orderObject
.
order_type
,
channelName
,
driver_status
);
opt
->
InitShow
(
orderObject
.
order_id
,
orderObject
.
status
,
orderObject
.
refund_status
,
orderObject
.
order_type
);
opt
->
InitShow
(
orderObject
.
order_id
,
orderObject
.
status
,
orderObject
.
refund_status
,
orderObject
.
order_type
);
break
;
break
;
}
}
...
@@ -890,9 +925,18 @@ void NewMainForm::InsertTableWidget(OrderObject &orderObject)
...
@@ -890,9 +925,18 @@ void NewMainForm::InsertTableWidget(OrderObject &orderObject)
getOrderChannelName
(
&
orderObject
,
channelName
);
getOrderChannelName
(
&
orderObject
,
channelName
);
QTableWidgetItem
*
item0
=
new
QTableWidgetItem
(
QString
(
channelName
));
//渠道使用ordertypeform进行插入和订单状态一样的操作
item0
->
setTextAlignment
(
Qt
::
AlignCenter
);
int
driver_status
=
0
;
table
->
setItem
(
0
,
2
,
item0
);
// 渠道
PosOrderPool
::
GetDriverStatus
(
orderObject
.
order_id
,
driver_status
);
OrderTypeForm
*
cWdg
=
new
OrderTypeForm
(
table
);
cWdg
->
InitChannelShow
(
orderObject
.
order_id
,
orderObject
.
status
,
orderObject
.
refund_status
,
orderObject
.
order_type
,
channelName
,
driver_status
);
connect
(
cWdg
,
&
OrderTypeForm
::
showOrderInfo
,
this
,
&
NewMainForm
::
onPickUpGetOrder
);
table
->
setCellWidget
(
0
,
2
,
cWdg
);
// 渠道
// QTableWidgetItem *item0 = new QTableWidgetItem(QString(channelName));
// item0->setTextAlignment(Qt::AlignCenter);
// table->setItem(0, 2, item0); // 渠道
// QTableWidgetItem *item1 = new QTableWidgetItem(orderObject.order_id);
// QTableWidgetItem *item1 = new QTableWidgetItem(orderObject.order_id);
// item1->setTextAlignment(Qt::AlignCenter);
// item1->setTextAlignment(Qt::AlignCenter);
// table->setItem(0, 3, item1); // 订单ID
// table->setItem(0, 3, item1); // 订单ID
...
...
takeout/view/ordertypeform.cpp
View file @
f614c7cd
...
@@ -4,6 +4,9 @@
...
@@ -4,6 +4,9 @@
#include <QMouseEvent>
#include <QMouseEvent>
#include "QsLog.h"
#include "QsLog.h"
#include "event/fmapplication.h"
#include "event/posevent.h"
#include "preDefine.h"
OrderTypeForm
::
OrderTypeForm
(
QWidget
*
parent
)
:
OrderTypeForm
::
OrderTypeForm
(
QWidget
*
parent
)
:
...
@@ -15,6 +18,7 @@ OrderTypeForm::OrderTypeForm(QWidget *parent) :
...
@@ -15,6 +18,7 @@ OrderTypeForm::OrderTypeForm(QWidget *parent) :
_order_status
=
DefaultOrder
;
_order_status
=
DefaultOrder
;
_refund_status
=
DefaultOrder
;
_refund_status
=
DefaultOrder
;
_order_type
=
DefaultOrderType
;
_order_type
=
DefaultOrderType
;
_drive_status
=
0
;
}
}
OrderTypeForm
::~
OrderTypeForm
()
OrderTypeForm
::~
OrderTypeForm
()
...
@@ -22,6 +26,7 @@ OrderTypeForm::~OrderTypeForm()
...
@@ -22,6 +26,7 @@ OrderTypeForm::~OrderTypeForm()
delete
ui
;
delete
ui
;
}
}
void
OrderTypeForm
::
mousePressEvent
(
QMouseEvent
*
e
)
void
OrderTypeForm
::
mousePressEvent
(
QMouseEvent
*
e
)
{
{
if
(
e
->
buttons
()
&
Qt
::
LeftButton
)
if
(
e
->
buttons
()
&
Qt
::
LeftButton
)
...
@@ -50,6 +55,32 @@ void OrderTypeForm::InitShow(QString order_id, int order_status, int refund_stat
...
@@ -50,6 +55,32 @@ void OrderTypeForm::InitShow(QString order_id, int order_status, int refund_stat
}
}
void
OrderTypeForm
::
InitChannelShow
(
QString
order_id
,
int
order_status
,
int
refund_status
,
int
order_type
,
QString
channel
,
int
driver_status
)
{
_order_id
=
order_id
;
_order_status
=
order_status
;
_refund_status
=
refund_status
;
_order_type
=
order_type
;
_drive_status
=
driver_status
;
// if(_order_type == AppointmentTakeout || _order_type == AppointmentDining || _order_type == AppointmentInvite)
// {
// ui->ordertypelabel_type->setStyleSheet("#ordertypelabel_type{ border-image: url(:yy.png)}");
// }
if
(
!
(
_order_status
==
CancelOrder
||
_order_status
==
ServiceOrder
||
_order_status
==
RefusedOrder
||
_order_status
==
CompleteRefundOrder
||
_order_status
==
CompleteOrder
))
{
if
(
_drive_status
==
1
)
{
ui
->
ordertypelabel_type
->
setStyleSheet
(
"#ordertypelabel_type{ border-image: url(:yy.png)}"
);
}
}
ui
->
ordertypelabel_name
->
setText
(
channel
);
ui
->
ordertypelabel_name
->
adjustSize
();
}
void
OrderTypeForm
::
SetNameStyle
(
int
status
)
void
OrderTypeForm
::
SetNameStyle
(
int
status
)
{
{
switch
(
status
)
{
switch
(
status
)
{
...
...
takeout/view/ordertypeform.h
View file @
f614c7cd
#ifndef ORDERTYPEFORM_H
#ifndef ORDERTYPEFORM_H
#define ORDERTYPEFORM_H
#define ORDERTYPEFORM_H
...
@@ -22,6 +23,8 @@ public:
...
@@ -22,6 +23,8 @@ public:
void
InitShow
(
QString
order_id
,
int
order_status
,
int
refund_status
,
int
order_type
);
void
InitShow
(
QString
order_id
,
int
order_status
,
int
refund_status
,
int
order_type
);
void
InitChannelShow
(
QString
order_id
,
int
order_status
,
int
refund_status
,
int
order_type
,
QString
channel
,
int
driver_status
);
QString
order_id
()
const
;
QString
order_id
()
const
;
int
order_status
()
const
;
int
order_status
()
const
;
...
@@ -42,6 +45,7 @@ private:
...
@@ -42,6 +45,7 @@ private:
int
_order_status
;
int
_order_status
;
int
_refund_status
;
int
_refund_status
;
int
_order_type
;
int
_order_type
;
int
_drive_status
;
};
};
...
...
takeout/view/ordertypeform.ui
View file @
f614c7cd
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<rect>
<rect>
<x>
0
</x>
<x>
0
</x>
<y>
0
</y>
<y>
0
</y>
<width>
74
</width>
<width>
86
</width>
<height>
28
</height>
<height>
28
</height>
</rect>
</rect>
</property>
</property>
...
@@ -64,13 +64,13 @@
...
@@ -64,13 +64,13 @@
<widget
class=
"QLabel"
name=
"ordertypelabel_name"
>
<widget
class=
"QLabel"
name=
"ordertypelabel_name"
>
<property
name=
"minimumSize"
>
<property
name=
"minimumSize"
>
<size>
<size>
<width>
48
</width>
<width>
70
</width>
<height>
20
</height>
<height>
20
</height>
</size>
</size>
</property>
</property>
<property
name=
"maximumSize"
>
<property
name=
"maximumSize"
>
<size>
<size>
<width>
48
</width>
<width>
70
</width>
<height>
20
</height>
<height>
20
</height>
</size>
</size>
</property>
</property>
...
...
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