Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
takeaway
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
shuai.liu
takeaway
Commits
c97c9952
Commit
c97c9952
authored
Dec 21, 2022
by
xiaoqing.gu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.打印放在component 2.补打逻辑修改
parent
154a1ec4
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
66 additions
and
3 deletions
+66
-3
fmTakeaway/controls/flowControl.cpp
+2
-1
fmTakeaway/detailform.cpp
+32
-0
fmTakeaway/mainwindow.cpp
+11
-1
fmTakeaway/models/orderObject.h
+5
-0
fmTakeaway/tools/configManage.cpp
+2
-0
fmTakeaway/tools/configManage.h
+14
-1
No files found.
fmTakeaway/controls/flowControl.cpp
View file @
c97c9952
...
@@ -145,7 +145,8 @@ FlowControl::FlowControl()
...
@@ -145,7 +145,8 @@ FlowControl::FlowControl()
void
FlowControl
::
Start
()
void
FlowControl
::
Start
()
{
{
QLOG_INFO
()
<<
QString
(
">>>>>>>>>>>>>>>>>>程序启动%1<<<<<<<<<<<<<<<<<<"
).
arg
(
PRODUCT_VERSION
);
QLOG_INFO
()
<<
QString
(
">>>>>>>>>>>>>>>>>>程序启动%1<<<<<<<<<<<<<<<<<<"
).
arg
(
PRODUCT_VERSION
);
QString
storeId
=
ConfigManage
::
Instance
().
storeId
();
// QString storeId = ConfigManage::Instance().storeId();
QString
storeId
=
ConfigManage
::
Instance
().
cloudStoreId
();
if
(
!
storeId
.
isEmpty
()
)
if
(
!
storeId
.
isEmpty
()
)
{
{
m_storeInfo
.
sotoreId
=
storeId
;
m_storeInfo
.
sotoreId
=
storeId
;
...
...
fmTakeaway/detailform.cpp
View file @
c97c9952
...
@@ -202,6 +202,38 @@ void DetailForm::on_detail_btnReprint_clicked()
...
@@ -202,6 +202,38 @@ void DetailForm::on_detail_btnReprint_clicked()
QLOG_ERROR
()
<<
"read print configruation failed!"
;
QLOG_ERROR
()
<<
"read print configruation failed!"
;
return
;
return
;
}
}
//获取发票二维码地址
QString
fileName
=
QCoreApplication
::
applicationDirPath
()
+
"/printer/"
+
QDate
::
currentDate
().
toString
(
"yyyy-MM-dd"
)
+
"/barcode.txt"
;
QFile
file
(
fileName
);
QDir
().
mkpath
(
QFileInfo
(
fileName
).
absolutePath
());
if
(
!
file
.
open
(
QIODevice
::
ReadWrite
|
QIODevice
::
Text
))
{
qDebug
()
<<
"read printed failed!"
;
return
false
;
}
QTextStream
in
(
&
file
);
QString
String
=
in
.
readLine
();
//返回文件的一行,不包含换行符。
while
(
!
String
.
isNull
())
{
QJsonObject
ret
;
QJsonParseError
err
;
QJsonDocument
doc
=
QJsonDocument
::
fromJson
(
String
.
toUtf8
(),
&
err
);
if
(
err
.
error
!=
QJsonParseError
::
NoError
)
{
return
;
}
ret
=
doc
.
object
();
if
(
ret
.
keys
().
at
(
0
)
==
m_orderObj
->
order_id
)
{
m_orderObj
->
barcodeId
=
ret
[
m_orderObj
->
order_id
].
toString
();
}
}
QString
error
;
QString
error
;
PrintLib
::
GetInstance
().
DoPrint
(
QString
::
fromLocal8Bit
(
file
.
readAll
()),
m_orderObj
,
error
);
PrintLib
::
GetInstance
().
DoPrint
(
QString
::
fromLocal8Bit
(
file
.
readAll
()),
m_orderObj
,
error
);
QLOG_INFO
()
<<
"print result: "
<<
error
;
QLOG_INFO
()
<<
"print result: "
<<
error
;
...
...
fmTakeaway/mainwindow.cpp
View file @
c97c9952
...
@@ -288,6 +288,16 @@ void MainWindow::_GetOrderAdditional(OrderObject *orderObj, QTableWidget *&table
...
@@ -288,6 +288,16 @@ void MainWindow::_GetOrderAdditional(OrderObject *orderObj, QTableWidget *&table
}
}
break
;
break
;
case
6
:
case
6
:
//已完成的订单申请退单时 status:6 refund_status:20,
//插件没做处理,问题解决 2022/10/12
if
(
orderObj
->
refund_status
==
20
)
{
statusDesc
=
"申请退款"
;
operation
=
OPERATION_AGREE_REFUND
;
table
=
ui
->
main_tableDCL
;
break
;
}
if
(
orderObj
->
refund_status
==
22
)
if
(
orderObj
->
refund_status
==
22
)
{
{
statusDesc
=
"申请部分退款"
;
statusDesc
=
"申请部分退款"
;
...
@@ -466,7 +476,7 @@ void MainWindow::onUpdateOrderDisplay(OrderObject *orderObj)
...
@@ -466,7 +476,7 @@ void MainWindow::onUpdateOrderDisplay(OrderObject *orderObj)
}
}
}
}
_PrintNewOrder
(
orderObj
);
//
_PrintNewOrder(orderObj);
// 插入订单
// 插入订单
orderObj
->
table
=
table
;
orderObj
->
table
=
table
;
table
->
insertRow
(
0
);
table
->
insertRow
(
0
);
...
...
fmTakeaway/models/orderObject.h
View file @
c97c9952
...
@@ -143,6 +143,7 @@ class OrderObject : public QObject
...
@@ -143,6 +143,7 @@ class OrderObject : public QObject
Q_PROPERTY
(
QStringList
records
READ
getrecords
WRITE
setrecords
)
Q_PROPERTY
(
QStringList
records
READ
getrecords
WRITE
setrecords
)
Q_PROPERTY
(
QStringList
dis_desc
READ
getdis_desc
WRITE
setdis_desc
)
Q_PROPERTY
(
QStringList
dis_desc
READ
getdis_desc
WRITE
setdis_desc
)
Q_PROPERTY
(
int
total_amount
READ
gettotal_amount
WRITE
settotal_amount
)
Q_PROPERTY
(
int
total_amount
READ
gettotal_amount
WRITE
settotal_amount
)
Q_PROPERTY
(
QString
barcodeId
READ
getbarcodeId
WRITE
setbarcodeId
)
public
:
public
:
OrderObject
(
QObject
*
parent
=
0
)
:
QObject
(
parent
){}
OrderObject
(
QObject
*
parent
=
0
)
:
QObject
(
parent
){}
...
@@ -286,6 +287,9 @@ private:
...
@@ -286,6 +287,9 @@ private:
inline
int
gettotal_amount
(){
return
total_amount
;
}
inline
int
gettotal_amount
(){
return
total_amount
;
}
inline
void
settotal_amount
(
const
int
&
v
){
total_amount
=
v
;
}
inline
void
settotal_amount
(
const
int
&
v
){
total_amount
=
v
;
}
inline
QString
getbarcodeId
(){
return
barcodeId
;
}
inline
void
setbarcodeId
(
const
QString
&
v
){
barcodeId
=
v
;
}
public
:
public
:
QString
order_id
;
// 订单ID
QString
order_id
;
// 订单ID
QString
order_view_id
;
// 美团订单号,其他平台为空
QString
order_view_id
;
// 美团订单号,其他平台为空
...
@@ -336,6 +340,7 @@ public:
...
@@ -336,6 +340,7 @@ public:
// 自定义属性
// 自定义属性
QTableWidget
*
table
=
nullptr
;
// 记录该订单目前在哪个表格中
QTableWidget
*
table
=
nullptr
;
// 记录该订单目前在哪个表格中
QString
barcodeId
;
//发票二维码地址
};
};
#endif // ORDEROBJECT_H
#endif // ORDEROBJECT_H
fmTakeaway/tools/configManage.cpp
View file @
c97c9952
...
@@ -34,6 +34,8 @@ ConfigManage::ConfigManage()
...
@@ -34,6 +34,8 @@ ConfigManage::ConfigManage()
m_clientIni
=
new
QSettings
(
QString
(
"%1/client.ini"
).
arg
(
g_appDir
),
QSettings
::
IniFormat
);
m_clientIni
=
new
QSettings
(
QString
(
"%1/client.ini"
).
arg
(
g_appDir
),
QSettings
::
IniFormat
);
m_userIni
=
new
QSettings
(
QString
(
"%1/user.ini"
).
arg
(
g_appDir
),
QSettings
::
IniFormat
);
m_userIni
=
new
QSettings
(
QString
(
"%1/user.ini"
).
arg
(
g_appDir
),
QSettings
::
IniFormat
);
m_printerIni
=
new
QSettings
(
QString
(
"%1/printer.ini"
).
arg
(
g_appDir
),
QSettings
::
IniFormat
);
m_printerIni
=
new
QSettings
(
QString
(
"%1/printer.ini"
).
arg
(
g_appDir
),
QSettings
::
IniFormat
);
m_stockIni
=
new
QSettings
(
QString
(
"%1/stock.ini"
).
arg
(
g_appDir
),
QSettings
::
IniFormat
);
m_storeIni
=
new
QSettings
(
QString
(
"%1/store.ini"
).
arg
(
g_appDir
),
QSettings
::
IniFormat
);
}
}
fmTakeaway/tools/configManage.h
View file @
c97c9952
...
@@ -148,7 +148,7 @@ public:
...
@@ -148,7 +148,7 @@ public:
// 库存同步时间间隔,单位秒
// 库存同步时间间隔,单位秒
inline
int
stockSyncInterval
(){
inline
int
stockSyncInterval
(){
return
m_
user
Ini
->
value
(
"stock/intervalSync"
,
30
).
toInt
();
return
m_
client
Ini
->
value
(
"stock/intervalSync"
,
30
).
toInt
();
}
}
// 是否进行库存同步
// 是否进行库存同步
...
@@ -156,6 +156,17 @@ public:
...
@@ -156,6 +156,17 @@ public:
return
m_userIni
->
value
(
"stock/enable"
,
false
).
toBool
();
return
m_userIni
->
value
(
"stock/enable"
,
false
).
toBool
();
}
}
//云pos门店信息
inline
QString
cloudStoreId
()
{
return
m_storeIni
->
value
(
"storeInfo/storeId"
).
toString
();
}
inline
void
setCloudStoreId
(
const
QString
&
storeId
)
{
return
m_storeIni
->
setValue
(
"storeInfo/storeId"
,
storeId
);
}
private
:
private
:
ConfigManage
();
ConfigManage
();
...
@@ -163,6 +174,8 @@ private:
...
@@ -163,6 +174,8 @@ private:
QSettings
*
m_clientIni
;
QSettings
*
m_clientIni
;
QSettings
*
m_userIni
;
QSettings
*
m_userIni
;
QSettings
*
m_printerIni
;
QSettings
*
m_printerIni
;
QSettings
*
m_stockIni
;
QSettings
*
m_storeIni
;
};
};
#endif // CONFIGMANAGE_H
#endif // CONFIGMANAGE_H
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