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
6ea54e48
Commit
6ea54e48
authored
Oct 30, 2018
by
李定达
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.悬浮窗拖动范围限制;2.部分日志降级为debug;3.o2o打印模板丰富逻辑添加
parent
977e83b5
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
117 additions
and
33 deletions
+117
-33
takeout/base/DB/fm_database.cpp
+8
-8
takeout/base/Print/printDocument.cpp
+1
-1
takeout/base/Print/printlib.cpp
+8
-1
takeout/control/ordergetwork.cpp
+1
-1
takeout/control/ordergetwork.h
+1
-0
takeout/control/orderlocalizework.cpp
+5
-5
takeout/control/orderprintwork.cpp
+41
-1
takeout/control/orderpushwork.cpp
+6
-6
takeout/main.cpp
+1
-1
takeout/model/posorderpool.cpp
+1
-1
takeout/preDefine.h
+4
-0
takeout/takeout.rc
+4
-4
takeout/view/floatForm.cpp
+32
-1
takeout/view/floatForm.h
+1
-0
takeout/view/floatForm.ui
+3
-3
No files found.
takeout/base/DB/fm_database.cpp
View file @
6ea54e48
...
...
@@ -47,7 +47,7 @@ bool FMDataBase::creat(QString sql, QString tablename)
bool
flag
=
query
.
exec
(
sql
);
if
(
!
flag
)
QLOG_
INFO
()
<<
query
.
lastError
();
QLOG_
ERROR
()
<<
query
.
lastError
();
return
flag
;
}
...
...
@@ -64,7 +64,7 @@ bool FMDataBase::dlt(QString table, QString condition)
bool
flag
=
query
.
exec
(
sql
);
if
(
!
flag
)
QLOG_
INFO
()
<<
query
.
lastError
();
QLOG_
ERROR
()
<<
query
.
lastError
();
return
flag
;
}
...
...
@@ -88,12 +88,12 @@ bool FMDataBase::insert(QString table, QVariantHash data)
sql
=
QString
(
"insert into %1 ("
).
arg
(
table
)
+
columnnamelist
.
join
(
", "
)
+
") values ("
+
columnvaluelist
.
join
(
", "
)
+
")"
;
QLOG_
INFO
()
<<
"inset sql : "
<<
sql
;
QLOG_
DEBUG
()
<<
"inset sql : "
<<
sql
;
bool
flag
=
query
.
exec
(
sql
);
if
(
!
flag
)
QLOG_
INFO
()
<<
query
.
lastError
();
QLOG_
ERROR
()
<<
query
.
lastError
();
return
flag
;
}
...
...
@@ -115,12 +115,12 @@ bool FMDataBase::update(QString table, QVariantHash data, QString condition)
sql
=
QString
(
"update %1 set "
).
arg
(
table
)
+
sql
+
" where "
+
condition
;
QLOG_
INFO
()
<<
"update sql : "
<<
sql
;
QLOG_
DEBUG
()
<<
"update sql : "
<<
sql
;
bool
flag
=
query
.
exec
(
sql
);
if
(
!
flag
)
QLOG_
INFO
()
<<
query
.
lastError
();
QLOG_
ERROR
()
<<
query
.
lastError
();
return
flag
;
}
...
...
@@ -143,12 +143,12 @@ bool FMDataBase::find(QString table, QSqlQuery &query, QStringList keylist, QStr
sql
+=
QString
(
" from %1 where "
).
arg
(
table
)
+
condition
;
QLOG_
INFO
()
<<
"find sql : "
<<
sql
;
QLOG_
DEBUG
()
<<
"find sql : "
<<
sql
;
bool
flag
=
tmpquery
.
exec
(
sql
);
if
(
!
flag
)
QLOG_
INFO
()
<<
tmpquery
.
lastError
();
QLOG_
ERROR
()
<<
tmpquery
.
lastError
();
query
=
tmpquery
;
...
...
takeout/base/Print/printDocument.cpp
View file @
6ea54e48
...
...
@@ -76,7 +76,7 @@ PrintDocument PrintDocument::ParseToDocument(const QString &content, bool &resul
{
result
=
false
;
error
=
"lock of '<' or '>'"
;
qDebug
()
<<
index
<<
"----------------------------------------"
;
//
qDebug()<<index<<"----------------------------------------";
return
PrintDocument
();
}
}
...
...
takeout/base/Print/printlib.cpp
View file @
6ea54e48
...
...
@@ -100,7 +100,8 @@ void PrintLib::_PrintLab( OrderObject* order)
QString
title
=
QString
(
" %2 %4/%5"
).
arg
(
datetime
,
QString
::
number
(
++
index
),
QString
::
number
(
allprod
));
QString
tmptitle
;
if
(
QString
(
"saas"
).
compare
(
order
->
channel
)
==
0
)
{
if
(
order
->
order_type
==
3
||
order
->
order_type
==
4
||
order
->
order_type
==
5
)
{
tmptitle
=
QString
(
"
\xE9\x9D\x9E\xE7\xA0\x81\xE8\x87\xAA\xE6\x8F\x90
"
).
append
(
order
->
code
).
append
(
" "
).
append
(
title
);
...
...
@@ -113,6 +114,12 @@ void PrintLib::_PrintLab( OrderObject* order)
{
tmptitle
=
QString
(
"
\xE9\x9D\x9E\xE7\xA0\x81\xE5\xA4\x96\xE5\x8D\x96
"
).
append
(
QString
::
number
(
order
->
order_index
)).
append
(
" "
).
append
(
title
);
}
}
else
{
QString
tmpstr
=
order
->
channel_name
;
tmptitle
=
tmpstr
.
append
(
QString
::
number
(
order
->
order_index
)).
append
(
" "
).
append
(
title
);;
}
QString
prodname
=
dish
->
name
;
...
...
takeout/control/ordergetwork.cpp
View file @
6ea54e48
...
...
@@ -513,7 +513,7 @@ void OrderGetWork::optOrder(const QJsonArray &orders)
if
(
_storeinfo
.
contains
(
LOGIN_STORE_PHONE
))
orderObject
.
setStore_phone
(
_storeinfo
[
LOGIN_STORE_PHONE
].
toString
());
QLOG_
INFO
()
<<
"----------------------------:"
<<
orderObject
.
delivery_time
;
QLOG_
DEBUG
()
<<
"----------------------------:"
<<
orderObject
.
delivery_time
;
//PosOrderPool::TryInsertOrder(orderObject);
POSTEVENTTYPE
(
PosEvent
::
s_inset_orderpool
,
orderObject
,
OrderObject
);
...
...
takeout/control/ordergetwork.h
View file @
6ea54e48
...
...
@@ -204,6 +204,7 @@ private:
data
.
insert
(
JSON_KEY_TIMESTAMP
,
timestamp
);
//data.insert(JSON_KEY_TIMESTAMP, 0);
data
.
insert
(
JSON_KEY_AUTOCONFIRM
,
autoconfirm
);
data
.
insert
(
JSON_KEY_STOREUNIFYID
,
json
[
JSON_KEY_UNIFYID
].
toString
());
return
true
;
}
...
...
takeout/control/orderlocalizework.cpp
View file @
6ea54e48
...
...
@@ -77,7 +77,7 @@ void OrderLocalizeWork::deleteOrder(QString orderid)
else
{
bool
flag
=
db
.
dlt
(
DEFAULT_DBFORM
,
QString
(
DB_KEY_ORDERID
).
append
(
"='%1'"
).
arg
(
orderid
));
QLOG_
INFO
()
<<
"delete order : "
<<
orderid
<<
"("
<<
flag
<<
")"
;
QLOG_
DEBUG
()
<<
"delete order : "
<<
orderid
<<
"("
<<
flag
<<
")"
;
}
}
...
...
@@ -103,16 +103,16 @@ void OrderLocalizeWork::otpOrder(QString orderid)
if
(
!
query
.
next
())
{
QLOG_
INFO
()
<<
"insert new order"
<<
hash
;
QLOG_
DEBUG
()
<<
"insert new order"
<<
hash
;
bool
flag
=
db
.
insert
(
DEFAULT_DBFORM
,
hash
);
QLOG_
WARN
()
<<
"insert new order : "
<<
orderid
<<
"("
<<
flag
<<
")"
;
QLOG_
DEBUG
()
<<
"insert new order : "
<<
orderid
<<
"("
<<
flag
<<
")"
;
}
else
{
//订单最后改变时间要同步到db
QLOG_
INFO
()
<<
"update order"
<<
hash
;
QLOG_
DEBUG
()
<<
"update order"
<<
hash
;
bool
flag
=
db
.
update
(
DEFAULT_DBFORM
,
hash
,
QString
(
DB_KEY_ORDERID
).
append
(
"='%1'"
).
arg
(
orderid
));
QLOG_
WARN
()
<<
"update order : "
<<
orderid
<<
"("
<<
flag
<<
")"
;
QLOG_
DEBUG
()
<<
"update order : "
<<
orderid
<<
"("
<<
flag
<<
")"
;
}
}
takeout/control/orderprintwork.cpp
View file @
6ea54e48
...
...
@@ -56,6 +56,8 @@ bool orderprintwork::event(QEvent *e)
int
prtwi
=
QSettings
(
prtinifile
,
QSettings
::
IniFormat
).
value
(
"Printer/PaperWidth"
,
0
).
toInt
();
if
(
QString
(
"saas"
).
compare
(
order
.
channel
,
Qt
::
CaseInsensitive
)
==
0
)
{
if
(
order
.
order_type
==
1
||
order
.
order_type
==
2
)
{
if
(
prtwi
<=
56
)
...
...
@@ -77,6 +79,25 @@ bool orderprintwork::event(QEvent *e)
else
file
.
setFileName
(
qApp
->
applicationDirPath
()
+
"/"
+
FILE_PRINT80_TEMPLET
);
}
}
else
{
if
(
order
.
order_type
==
1
||
order
.
order_type
==
2
)
{
if
(
prtwi
<=
56
)
file
.
setFileName
(
qApp
->
applicationDirPath
()
+
"/"
+
FILE_PRINTO2O_TEMPLET
);
else
file
.
setFileName
(
qApp
->
applicationDirPath
()
+
"/"
+
FILE_PRINTO2O80_TEMPLET
);
}
else
{
if
(
prtwi
<=
56
)
file
.
setFileName
(
qApp
->
applicationDirPath
()
+
"/"
+
FILE_PRINTO2OZZ_TEMPLET
);
else
file
.
setFileName
(
qApp
->
applicationDirPath
()
+
"/"
+
FILE_PRINTO2OZZ80_TEMPLET
);
}
}
qDebug
()
<<
"+++++++++++++++++++++++++++"
<<
file
.
fileName
();
...
...
@@ -163,7 +184,8 @@ bool orderprintwork::event(QEvent *e)
QFile
file
;
int
othprtw
=
QSettings
(
prtinifile
,
QSettings
::
IniFormat
).
value
(
"OtherPrinter/PaperWidth"
,
0
).
toInt
();
if
(
QString
(
"saas"
).
compare
(
order
.
channel
,
Qt
::
CaseInsensitive
)
==
0
)
{
if
(
order
.
order_type
==
1
||
order
.
order_type
==
2
)
{
if
(
othprtw
<=
56
)
...
...
@@ -185,6 +207,24 @@ bool orderprintwork::event(QEvent *e)
else
file
.
setFileName
(
qApp
->
applicationDirPath
()
+
"/"
+
FILE_PRINT80_TEMPLET
);
}
}
else
{
if
(
order
.
order_type
==
1
||
order
.
order_type
==
2
)
{
if
(
prtwi
<=
56
)
file
.
setFileName
(
qApp
->
applicationDirPath
()
+
"/"
+
FILE_PRINTO2O_TEMPLET
);
else
file
.
setFileName
(
qApp
->
applicationDirPath
()
+
"/"
+
FILE_PRINTO2O80_TEMPLET
);
}
else
{
if
(
prtwi
<=
56
)
file
.
setFileName
(
qApp
->
applicationDirPath
()
+
"/"
+
FILE_PRINTO2OZZ_TEMPLET
);
else
file
.
setFileName
(
qApp
->
applicationDirPath
()
+
"/"
+
FILE_PRINTO2OZZ80_TEMPLET
);
}
}
qDebug
()
<<
"+++++++++++++++++++++++++++"
<<
file
.
fileName
();
...
...
takeout/control/orderpushwork.cpp
View file @
6ea54e48
...
...
@@ -129,7 +129,7 @@ bool OrderPushWork::connectTcpServer()
_socket
->
addCaCertificates
(
qApp
->
applicationDirPath
()
+
"/"
+
"microwstest.sandload.cn.pem"
);
QLOG_
INFO
()
<<
_socket
->
errorString
();
QLOG_
WARN
()
<<
_socket
->
errorString
();
_socket
->
ignoreSslErrors
();
...
...
@@ -138,7 +138,7 @@ bool OrderPushWork::connectTcpServer()
_socket
->
setSslConfiguration
(
config
);
QLOG_
INFO
()
<<
_socket
->
errorString
();
QLOG_
WARN
()
<<
_socket
->
errorString
();
_istimeout
=
true
;
...
...
@@ -158,7 +158,7 @@ bool OrderPushWork::connectTcpServer()
loop
.
exec
();
}
QLOG_
INFO
()
<<
_socket
->
errorString
()
<<
_istimeout
;
QLOG_
WARN
()
<<
_socket
->
errorString
()
<<
_istimeout
;
return
!
_istimeout
;
}
...
...
@@ -225,7 +225,7 @@ bool OrderPushWork::loginTcpServer()
QByteArray
head
=
_socket
->
read
(
sizeof
(
Data_Head
));
QLOG_
INFO
()
<<
head
.
toHex
();
QLOG_
DEBUG
()
<<
head
.
toHex
();
quint32
len
=
0
;
int
cmd
=
-
1
;
...
...
@@ -291,9 +291,9 @@ void OrderPushWork::heartBeatTcpService()
continue
;
}
QLOG_
INFO
()
<<
"tmplenandsynSeq : "
<<
tmplenandsynSeq
;
QLOG_
DEBUG
()
<<
"tmplenandsynSeq : "
<<
tmplenandsynSeq
;
QLOG_
INFO
()
<<
"cmd : "
<<
cmd
;
QLOG_
DEBUG
()
<<
"cmd : "
<<
cmd
;
if
(
cmd
==
COMMAND_HEARDBEAT
)
{
...
...
takeout/main.cpp
View file @
6ea54e48
...
...
@@ -232,7 +232,7 @@ void InitLog()
QDir
().
mkdir
(
logDir
);
QsLogging
::
Logger
&
logger
=
QsLogging
::
Logger
::
instance
();
logger
.
setLoggingLevel
(
QsLogging
::
Debug
Level
);
logger
.
setLoggingLevel
(
QsLogging
::
Info
Level
);
QString
logPath
=
QString
(
"%1/%2"
).
arg
(
logDir
,
"takeout.log"
);
QsLogging
::
DestinationPtr
fileDst
(
QsLogging
::
DestinationFactory
::
MakeFileDestination
(
logPath
,
QsLogging
::
EnableLogRotation
,
QsLogging
::
MaxSizeBytes
(
2
*
1024
*
1024
),
QsLogging
::
MaxOldLogCount
(
6
)));
...
...
takeout/model/posorderpool.cpp
View file @
6ea54e48
...
...
@@ -406,7 +406,7 @@ bool PosOrderPool::event(QEvent *e)
if
(
e
->
type
()
==
PosEvent
::
s_inset_orderpool
)
{
QLOG_
INFO
()
<<
"PosEvent::s_inset_orderpool : "
<<
QThread
::
currentThreadId
();
QLOG_
DEBUG
()
<<
"PosEvent::s_inset_orderpool : "
<<
QThread
::
currentThreadId
();
OrderObject
order
(
this
);
...
...
takeout/preDefine.h
View file @
6ea54e48
...
...
@@ -261,6 +261,10 @@
#define FILE_PRINTTAKE80_TEMPLET "printtemplettake80.txt"
#define FILE_PRINTYY_TEMPLET "printtempletyy.txt"
#define FILE_PRINTYY80_TEMPLET "printtempletyy80.txt"
#define FILE_PRINTO2O_TEMPLET "printtempleto2o.txt"
#define FILE_PRINTO2O80_TEMPLET "printtempleto2o80.txt"
#define FILE_PRINTO2OZZ_TEMPLET "printtempleto2ozz.txt"
#define FILE_PRINTO2OZZ80_TEMPLET "printtempleto2ozz80.txt"
#define DEFAULT_PRINTF_MAIN_SESSION "Printer"
...
...
takeout/takeout.rc
View file @
6ea54e48
...
...
@@ -4,8 +4,8 @@
#include <winver.h>
#endif
VS_VERSION_INFO VERSIONINFO
FILEVERSION
2,0,0,9
PRODUCTVERSION
2,0,0,9
FILEVERSION
3,0,0,0
PRODUCTVERSION
3,0,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
...
...
@@ -22,12 +22,12 @@ VS_VERSION_INFO VERSIONINFO
BEGIN
VALUE "CompanyName", "ShangHai Freemud Co., Ltd."
VALUE "FileDescription", "FREEMUD Manager System"
VALUE "FileVersion", "
2.0.0.9
"
VALUE "FileVersion", "
3.0.0.0
"
VALUE "InternalName", "FREEMUD"
VALUE "LegalCopyright", "Copyright (C)2017-2020"
VALUE "OriginalFilename", "fmTakeout.exe"
VALUE "ProductName", "fmTakeout"
VALUE "ProductVersion", "
2.0.0.9
"
VALUE "ProductVersion", "
3.0.0.0
"
END
END
BLOCK "VarFileInfo"
...
...
takeout/view/floatForm.cpp
View file @
6ea54e48
...
...
@@ -11,6 +11,8 @@
#include <QByteArray>
#include <QJsonObject>
#include <QJsonDocument>
#include <QDesktopWidget>
#include <QPoint>
#include "event/fmapplication.h"
#include "event/posevent.h"
...
...
@@ -45,6 +47,8 @@ FloatForm::FloatForm(QWidget *parent) :
m_animation
.
setEasingCurve
(
QEasingCurve
::
InOutSine
);
m_raiseTimer
.
setInterval
(
2000
);
connect
(
&
m_raiseTimer
,
&
QTimer
::
timeout
,
this
,
&
FloatForm
::
raise
);
desktopSize
=
QApplication
::
desktop
()
->
screenGeometry
().
size
();
desktopSize
-=
QSize
(
242
,
100
);
_Init
();
}
...
...
@@ -165,7 +169,14 @@ void FloatForm::mouseMoveEvent(QMouseEvent *event)
{
QPoint
moveAmount
=
event
->
globalPos
()
-
m_lastMousePos
;
m_absMove
+=
moveAmount
;
move
(
pos
()
+
moveAmount
);
int
x
=
0
,
y
=
0
;
x
=
pos
().
x
()
+
moveAmount
.
x
();
y
=
pos
().
y
()
+
moveAmount
.
y
();
if
(
x
>
desktopSize
.
width
()){
x
=
desktopSize
.
width
();}
if
(
x
<
0
){
x
=
0
;}
if
(
y
>
desktopSize
.
height
()){
y
=
desktopSize
.
height
();}
if
(
y
<
0
){
y
=
0
;}
move
(
x
,
y
);
m_lastMousePos
=
event
->
globalPos
();
m_bMouseMove
=
true
;
}
...
...
@@ -213,6 +224,26 @@ void FloatForm::_Init()
setStyleSheet
(
"#floatWdg{ border-image: url(:float_normal.png); }"
);
move
(
ConfigManger
::
GetInstance
().
GetFloatInitPostion
());
QPoint
pos
=
ConfigManger
::
GetInstance
().
GetFloatInitPostion
();
if
(
pos
.
x
()
<
0
)
{
pos
.
setX
(
0
);
}
if
(
pos
.
y
()
<
0
)
{
pos
.
setY
(
0
);
}
if
(
pos
.
x
()
>
desktopSize
.
width
())
{
pos
.
setX
(
desktopSize
.
width
());
}
if
(
pos
.
y
()
>
desktopSize
.
height
())
{
pos
.
setY
(
desktopSize
.
height
());
}
move
(
pos
);
}
void
FloatForm
::
_Blink
()
...
...
takeout/view/floatForm.h
View file @
6ea54e48
...
...
@@ -28,6 +28,7 @@ protected:
void
mouseReleaseEvent
(
QMouseEvent
*
event
);
private
:
QSize
desktopSize
;
Ui
::
FloatForm
*
ui
;
// 记录左键按下去后是否移动过
bool
m_bMouseMove
;
...
...
takeout/view/floatForm.ui
View file @
6ea54e48
...
...
@@ -6,7 +6,7 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
2
10
</width>
<width>
2
42
</width>
<height>
100
</height>
</rect>
</property>
...
...
@@ -18,7 +18,7 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
2
10
</width>
<width>
2
42
</width>
<height>
100
</height>
</rect>
</property>
...
...
@@ -158,7 +158,7 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
2
10
</width>
<width>
2
42
</width>
<height>
100
</height>
</rect>
</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