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
891537b0
Commit
891537b0
authored
Mar 24, 2017
by
ss.dai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2
parent
01718d6e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
59 additions
and
17 deletions
+59
-17
fmTakeaway/Control/flowControl.cpp
+43
-10
fmTakeaway/DTools/configManger.cpp
+5
-0
fmTakeaway/DTools/configManger.h
+6
-0
fmTakeaway/DTools/dataManger.cpp
+2
-1
fmTakeaway/detailForm.cpp
+2
-6
fmTakeaway/preDefine.h
+1
-0
No files found.
fmTakeaway/Control/flowControl.cpp
View file @
891537b0
...
...
@@ -218,19 +218,52 @@ bool FlowControl::_PullOrder()
}
}
if
(
orderObject
->
status
==
2
&&
orderObject
->
courier_name
.
isEmpty
()
)
if
(
orderObject
->
status
==
2
&&
orderObject
->
delivery_status
==
1
)
{
// 打印
QString
error
;
QLOG_INFO
()
<<
QString
(
"[---begin print---]."
);
if
(
FmPrinter
::
GetInstance
().
DoPrint
(
ConfigManger
::
GetInstance
().
GetPrinterName
(),
orderObject
,
error
))
{
QLOG_INFO
()
<<
QString
(
"print sucessful"
);
}
else
{
QLOG_INFO
()
<<
QString
(
"print failed, %1"
).
arg
(
error
);
}
QString
fileDir
=
QString
(
"%1/printed"
).
arg
(
QApplication
::
applicationDirPath
());
QDir
().
mkdir
(
fileDir
);
QString
filePath
=
QString
(
"%1/%2_%3"
).
arg
(
fileDir
,
orderObject
->
channel
,
orderObject
->
order_id
);
QFile
file
(
filePath
);
if
(
!
file
.
exists
())
{
QString
error
;
QLOG_INFO
()
<<
QString
(
"[---begin print---]."
);
if
(
FmPrinter
::
GetInstance
().
DoPrint
(
ConfigManger
::
GetInstance
().
GetPrinterName
(),
orderObject
,
error
))
{
QLOG_INFO
()
<<
QString
(
"print sucessful"
);
file
.
open
(
QIODevice
::
WriteOnly
);
file
.
close
();
}
else
{
QLOG_INFO
()
<<
QString
(
"print failed, %1"
).
arg
(
error
);
}
}
}
if
(
orderObject
->
order_type
==
3
||
orderObject
->
order_type
==
4
)
{
// 打印
QString
fileDir
=
QString
(
"%1/printed"
).
arg
(
QApplication
::
applicationDirPath
());
QDir
().
mkdir
(
fileDir
);
QString
filePath
=
QString
(
"%1/%2_%3"
).
arg
(
fileDir
,
orderObject
->
channel
,
orderObject
->
order_id
);
QFile
file
(
filePath
);
if
(
!
file
.
exists
())
{
QString
error
;
QLOG_INFO
()
<<
QString
(
"[---begin print---]."
);
if
(
FmPrinter
::
GetInstance
().
DoPrint
(
ConfigManger
::
GetInstance
().
GetPrinterName
(),
orderObject
,
error
))
{
QLOG_INFO
()
<<
QString
(
"print sucessful"
);
file
.
open
(
QIODevice
::
WriteOnly
);
file
.
close
();
}
else
{
QLOG_INFO
()
<<
QString
(
"print failed, %1"
).
arg
(
error
);
}
}
}
m_timestamp
=
orderObject
->
timestamp
;
...
...
fmTakeaway/DTools/configManger.cpp
View file @
891537b0
...
...
@@ -86,6 +86,11 @@ QString ConfigManger::GetDbServerIp()
return
m_config
->
value
(
INI_DBSERVERIP
).
toString
();
}
QString
ConfigManger
::
GetPrefix
()
{
return
m_config
->
value
(
INI_PREFIX
).
toString
();
}
int
ConfigManger
::
GetDbServerPort
()
{
return
m_config
->
value
(
INI_DBSERVERPORT
).
toInt
();
...
...
fmTakeaway/DTools/configManger.h
View file @
891537b0
...
...
@@ -80,6 +80,12 @@ public:
* 返回:销售单地址
* */
QString
GetDbServerIp
();
/* 功能:获取帐号前缀
* 参数:NULL
* 返回:销售单地址
* */
QString
GetPrefix
();
/* 功能:获取销售单写入端口
* 参数:NULL
* 返回:销售单端口
...
...
fmTakeaway/DTools/dataManger.cpp
View file @
891537b0
#include "dataManger.h"
#include "preDefine.h"
#include "configManger.h"
// 请求类型
enum
...
...
@@ -26,7 +27,7 @@ QJsonObject DataManger::GetLoginData(const QString &storeId, const QString &pass
{
QJsonObject
rObj
,
cObj
;
rObj
.
insert
(
JSON_REQTYPE
,
LOGIN
);
cObj
.
insert
(
JSON_USERNAME
,
storeId
);
cObj
.
insert
(
JSON_USERNAME
,
ConfigManger
::
GetInstance
().
GetPrefix
()
+
storeId
);
cObj
.
insert
(
JSON_PASSWORD
,
password
);
rObj
.
insert
(
JSON_CURRENTUSER
,
cObj
);
rObj
.
insert
(
JSON_STATIONID
,
stationId
);
...
...
fmTakeaway/detailForm.cpp
View file @
891537b0
...
...
@@ -170,12 +170,8 @@ void DetailForm::onOperaBtnClicked()
void
DetailForm
::
on_detailBtn1_clicked
()
{
QLOG_INFO
()
<<
"re print..............."
;
if
(
!
m_orderObject
->
courier_name
.
isEmpty
())
{
QLOG_INFO
()
<<
"---------------------"
<<
m_orderObject
->
courier_name
;
QString
error
;
FmPrinter
::
GetInstance
().
DoPrint
(
ConfigManger
::
GetInstance
().
GetPrinterName
(),
m_orderObject
,
error
);
}
QString
error
;
FmPrinter
::
GetInstance
().
DoPrint
(
ConfigManger
::
GetInstance
().
GetPrinterName
(),
m_orderObject
,
error
);
}
void
DetailForm
::
on_detailBtn0_clicked
()
...
...
fmTakeaway/preDefine.h
View file @
891537b0
...
...
@@ -19,6 +19,7 @@
#define INI_PASSWORD "SqlServer/password"
#define INI_DATABASE "SqlServer/database"
#define INI_SERVER "FmServer/url"
#define INI_PREFIX "FmServer/prefix"
#define INI_PRINTERNAME "Printer/name"
#define INI_FLOATPOSTION "Float/postion"
#define INI_FLOATOPACITY "Float/opacity"
...
...
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