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
587e6031
Commit
587e6031
authored
Dec 28, 2016
by
ss.dai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改重复入账问题
parent
f31ad1b9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
fmPlugin/fmPlugin.cpp
+14
-0
fmTakeaway/Control/flowControl.cpp
+6
-7
No files found.
fmPlugin/fmPlugin.cpp
View file @
587e6031
...
...
@@ -11,6 +11,8 @@
#include <QJsonDocument>
#include <QJsonArray>
#include <QTimer>
#include <QDir>
#include <QFile>
FmPlugin
&
FmPlugin
::
GetInstance
()
{
...
...
@@ -142,6 +144,15 @@ bool FmPlugin::GetOnDutyCashiers(QList<CashierObject> &cashiersList, QString &er
bool
FmPlugin
::
DoOrderEntry
(
const
OrderObject
*
orderObject
,
const
QString
&
cashierId
,
const
QString
&
cashierName
,
const
QString
&
shiftId
,
const
QString
&
shiftName
,
QString
&
error
)
{
QString
apppath
=
QCoreApplication
::
applicationDirPath
();
// 检查这单之前是否写过
QString
remark_file_path
=
QString
(
"%1/orders/%2/%3_%4"
).
arg
(
apppath
,
QDateTime
::
fromTime_t
(
orderObject
->
create_time
).
toString
(
"yyyy-MM-dd"
),
orderObject
->
channel
,
orderObject
->
order_id
);
QFile
file
(
remark_file_path
);
if
(
file
.
exists
())
{
error
=
"aready writed to haiding"
;
return
true
;
}
QString
inipath
=
apppath
+
QString
(
"/config.ini"
);
QSettings
set
(
inipath
,
QSettings
::
IniFormat
);
QUrl
url
;
...
...
@@ -180,6 +191,9 @@ bool FmPlugin::DoOrderEntry(const OrderObject *orderObject, const QString &cashi
error
=
recvJson
[
"echoMessage"
].
toString
();
return
false
;
}
QDir
().
mkpath
(
remark_file_path
.
mid
(
0
,
remark_file_path
.
lastIndexOf
(
"/"
)));
file
.
open
(
QFile
::
WriteOnly
);
file
.
close
();
return
true
;
}
...
...
fmTakeaway/Control/flowControl.cpp
View file @
587e6031
...
...
@@ -175,18 +175,17 @@ bool FlowControl::_PullOrder()
emit
changeOrderStatus
(
orderObject
,
oldStatus
);
}
}
//MARK(测试)
//if(orderObject->status == 6)
//{
if
(
orderObject
->
status
!=
1
&&
orderObject
->
status
!=
2
)
{
QString
error
;
if
(
FmPlugin
::
GetInstance
().
DoOrderEntry
(
orderObject
,
""
,
""
,
""
,
""
,
error
))
{
QLOG_INFO
()
<<
QString
(
"DoOrderEntry successful"
)
<<
error
;
QLOG_INFO
()
<<
QString
(
"
_PullOrder
DoOrderEntry successful"
)
<<
error
;
}
else
{
QLOG_INFO
()
<<
QString
(
"DoOrderEntry failed %1"
).
arg
(
error
);
QLOG_INFO
()
<<
QString
(
"
_PullOrder
DoOrderEntry failed %1"
).
arg
(
error
);
}
//
}
}
m_timestamp
=
orderObject
->
timestamp
;
}
syncTime
=
recvJson
[
JSON_SYNCTIME
].
toInt
()
*
1000
;
...
...
@@ -270,7 +269,7 @@ bool FlowControl::_ConfirmOrder(const QString &orderId, const DeliverObject &del
{
OrderObject
*
orderObject
=
m_ordersMap
.
value
(
orderId
);
emit
showAlert
(
AlertForm
::
LOADING
,
"正在录入
天天饮食
......"
);
emit
showAlert
(
AlertForm
::
LOADING
,
"正在录入
销售单
......"
);
QLOG_INFO
()
<<
QString
(
"[---order entry begin---]"
);
// 写入销售单
// TODO(用于鲜丰演示)
...
...
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