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
a7c8409d
Commit
a7c8409d
authored
Aug 21, 2017
by
yunpeng.song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
ff3faa37
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
25 deletions
+52
-25
fmTakeaway/Control/flowControl.cpp
+16
-15
fmTakeaway/Control/flowControl.h
+1
-0
fmTakeaway/DTools/orderstatus.cpp
+25
-5
fmTakeaway/DTools/orderstatus.h
+2
-1
fmTakeaway/detailForm.cpp
+3
-2
fmTakeaway/mainForm.cpp
+5
-2
No files found.
fmTakeaway/Control/flowControl.cpp
View file @
a7c8409d
...
...
@@ -159,17 +159,17 @@ FlowControl::FlowControl()
void
FlowControl
::
onGetNewStoreInfo
()
{
if
(
m_bFirstRecvInfo
)
{
m_timestamp
=
"0"
;
m_loginSocket
=
new
BillSocket
(
this
);
m_pullOrderSocket
=
new
BillSocket
(
this
);
m_procOrderSocket
=
new
BillSocket
(
this
);
m_pullDishesSocket
=
new
BillSocket
(
this
);
_GetStoreInfo
();
_Login
();
m_bFirstRecvInfo
=
false
;
}
//
if(m_bFirstRecvInfo)
//
{
m_timestamp
=
"0"
;
m_loginSocket
=
new
BillSocket
(
this
);
m_pullOrderSocket
=
new
BillSocket
(
this
);
m_procOrderSocket
=
new
BillSocket
(
this
);
m_pullDishesSocket
=
new
BillSocket
(
this
);
_GetStoreInfo
();
_Login
();
m_bFirstRecvInfo
=
false
;
//
}
return
;
}
...
...
@@ -228,7 +228,7 @@ bool FlowControl::_Login()
emit
hideAlert
();
emit
setStoreInfo
(
m_storeId
);
emit
setCashierInfo
(
m_cashierId
);
Orderstatus
::
getInstance
();
Orderstatus
::
getInstance
()
.
deleteRecord
(
QDate
::
currentDate
().
addMonths
(
-
1
).
toString
(
"yyyy-MM-dd"
))
;
_PullOrder
();
onDoUpdDishesStatus
();
}
...
...
@@ -305,7 +305,7 @@ bool FlowControl::_PullOrder()
.
arg
(
_GetJsonStr
(
jsonObject
));
if
(
!
Orderstatus
::
getInstance
().
isorderexit
(
orderObject
->
order_id
))
{
Orderstatus
::
getInstance
().
statusinsert
(
orderObject
->
order_id
,
0
,
0
,
0
,
0
);
Orderstatus
::
getInstance
().
statusinsert
(
orderObject
->
order_id
,
0
,
0
,
0
,
0
,
QDate
::
currentDate
().
toString
(
"yyyy-MM-dd"
)
);
}
emit
changeOrderStatus
(
orderObject
);
}
else
...
...
@@ -1063,7 +1063,7 @@ bool FlowControl::_GetReplyJson(const int& actionId,const QJsonObject &content,Q
}
else
{
if
(
m_b
FirstRecvInfo
&&
content
.
contains
(
"storeId"
)){
if
(
m_b
LoginResult
&&
content
.
contains
(
"storeId"
)){
result
=
_GetLoginReplyJson
(
content
,
data
,
error
);
}
else
{
...
...
@@ -1080,7 +1080,8 @@ bool FlowControl::_GetLoginReplyJson(const QJsonObject &content, QJsonObject &da
m_posId
=
content
[
"posId"
].
toString
();
m_cashierId
=
content
[
"operatorId"
].
toString
();
//m_bDate=content["businessDate"].toString();
emit
doLogin
();
if
(
m_bFirstRecvInfo
)
emit
doLogin
();
}
bool
FlowControl
::
_GetQueryReplyJson
(
QJsonObject
&
data
,
QString
&
error
,
const
QString
&
orderId
)
...
...
fmTakeaway/Control/flowControl.h
View file @
a7c8409d
...
...
@@ -54,6 +54,7 @@ private:
QMap
<
QString
,
OrderObject
*>
m_ordersMap
;
// 是否第一次获取到门店信息
bool
m_bFirstRecvInfo
;
bool
m_bLoginResult
;
// HttpServer
JQHttpServer
::
TcpServerManage
*
m_tcpServerManage
;
...
...
fmTakeaway/DTools/orderstatus.cpp
View file @
a7c8409d
...
...
@@ -25,7 +25,7 @@ Orderstatus::Orderstatus()
if
(
!
isTableExist
){
QLOG_INFO
()
<<
"table status does not exist"
;
query
.
prepare
(
QString
(
"create table status (orderId varchar(20) primary key, "
"isput int(1),isrefund int(1),isreport int(1),isbackreport int(1))"
));
"isput int(1),isrefund int(1),isreport int(1),isbackreport int(1)
,creatTime varchar(20)
)"
));
if
(
!
query
.
exec
())
{
QLOG_ERROR
()
<<
query
.
lastError
().
text
()
<<
QString
::
number
(
query
.
lastError
().
type
())
<<
"create table"
;
...
...
@@ -43,8 +43,8 @@ Orderstatus &Orderstatus::getInstance()
return
order
;
}
bool
Orderstatus
::
statusinsert
(
const
QString
&
orderId
,
const
int
&
putstatus
,
const
int
&
re
fundstatus
,
const
int
&
reportstatus
,
const
int
&
refundreportstatus
)
bool
Orderstatus
::
statusinsert
(
const
QString
&
orderId
,
const
int
&
putstatus
,
const
int
&
refundstatus
,
const
int
&
re
portstatus
,
const
int
&
refundreportstatus
,
const
QString
&
creatTime
)
{
if
(
!
db
.
open
())
{
...
...
@@ -53,9 +53,10 @@ bool Orderstatus::statusinsert(const QString &orderId, const int &putstatus,
}
bool
result
;
QSqlQuery
query
(
db
);
query
.
prepare
(
QString
(
"insert into status values('%1',%2,%3,%4,%5)"
).
arg
(
orderId
).
arg
(
QString
::
number
(
putstatus
))
query
.
prepare
(
QString
(
"insert into status values('%1',%2,%3,%4,%5
,'%6'
)"
).
arg
(
orderId
).
arg
(
QString
::
number
(
putstatus
))
.
arg
(
QString
::
number
(
refundstatus
)).
arg
(
QString
::
number
(
reportstatus
))
.
arg
(
QString
::
number
(
refundreportstatus
)));
.
arg
(
QString
::
number
(
refundreportstatus
)).
arg
(
creatTime
));
qDebug
()
<<
creatTime
;
if
(
!
query
.
exec
())
{
QLOG_ERROR
()
<<
query
.
lastError
().
text
()
<<
QString
::
number
(
query
.
lastError
().
type
())
<<
"statusinsert"
;
...
...
@@ -282,3 +283,22 @@ bool Orderstatus::isorderexit(const QString &orderId)
return
result
;
}
bool
Orderstatus
::
deleteRecord
(
QString
creatTime
)
{
if
(
!
db
.
open
())
{
QLOG_ERROR
()
<<
"sqlite open failed"
<<
db
.
lastError
().
text
();
return
false
;
}
bool
result
=
true
;
QSqlQuery
query
(
db
);
query
.
prepare
(
QString
(
"delete from status where creatTime<'%1'"
).
arg
(
creatTime
));
if
(
!
query
.
exec
())
{
QLOG_ERROR
()
<<
query
.
lastError
().
text
()
<<
__FUNCTION__
;
result
=
false
;
}
db
.
close
();
return
result
;
}
fmTakeaway/DTools/orderstatus.h
View file @
a7c8409d
...
...
@@ -21,7 +21,7 @@ public:
*返回:true操作成功,false失败
**/
bool
statusinsert
(
const
QString
&
orderId
,
const
int
&
putstatus
,
const
int
&
refundstatus
,
const
int
&
reportstatus
,
const
int
&
refundreportstatus
);
const
int
&
reportstatus
,
const
int
&
refundreportstatus
,
const
QString
&
creatTime
);
/**
*功能:更新入账状态
*参数:[1]订单号[2]入账状态
...
...
@@ -76,6 +76,7 @@ public:
*返回:true是,false否
**/
bool
isorderexit
(
const
QString
&
orderId
);
bool
deleteRecord
(
QString
creatTime
);
private
:
Orderstatus
();
Orderstatus
(
Orderstatus
const
&
);
...
...
fmTakeaway/detailForm.cpp
View file @
a7c8409d
...
...
@@ -12,7 +12,7 @@ DetailForm::DetailForm(QWidget *parent) :
ui
->
setupUi
(
this
);
connect
(
this
,
&
DetailForm
::
processOrder
,
&
FlowControl
::
GetInstance
(),
&
FlowControl
::
onProcessOrder
);
connect
(
this
,
&
DetailForm
::
processRejectOrder
,
&
FlowControl
::
GetInstance
(),
&
FlowControl
::
onProcessRejectOrder
);
m_rejectForm
=
NULL
;
_Init
();
}
...
...
@@ -86,7 +86,8 @@ void DetailForm::InitData(OrderObject *orderObject)
{
ui
->
detailBtn3
->
hide
();
}
m_rejectForm
=
new
RejectForm
(
this
);
if
(
m_rejectForm
==
NULL
)
m_rejectForm
=
new
RejectForm
(
this
);
}
void
DetailForm
::
_Init
()
...
...
fmTakeaway/mainForm.cpp
View file @
a7c8409d
...
...
@@ -263,8 +263,11 @@ void MainForm::onHideAlert()
void
MainForm
::
onShowAlert
(
AlertForm
::
Type
type
,
const
QString
&
msg
)
{
m_alertForm
->
SetContent
(
type
,
msg
);
m_alertForm
->
show
();
if
(
this
->
isVisible
())
{
m_alertForm
->
SetContent
(
type
,
msg
);
m_alertForm
->
show
();
}
}
void
MainForm
::
onSetStoreInfo
(
const
QString
&
storeId
)
...
...
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