Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmp_takeout
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
zhenfei.zhang
fmp_takeout
Commits
5af0bec7
Commit
5af0bec7
authored
Apr 11, 2017
by
jackalone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ini config
parent
90696ca8
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
32 additions
and
13 deletions
+32
-13
Thread/workThread/flowcontroll.cpp
+13
-3
Thread/workThread/flowcontroll.h
+2
-0
Tool/initclass.cpp
+10
-9
Tool/initclass.h
+1
-1
Ui/MainWindow.cpp
+5
-0
Ui/MainWindow.h
+1
-0
global/preDefine.h
+0
-0
No files found.
Thread/workThread/flowcontroll.cpp
View file @
5af0bec7
...
...
@@ -32,10 +32,12 @@ flowControll::flowControll(QObject *parent) : QObject(parent),m_loginSocket(0),
{
m_storeId
=
""
,
m_posId
=
/*getHostMacAddress()*/
"001
"
;
m_posId
=
"
"
;
m_passwd
=
""
;
m_cashierId
=
""
,
m_cashiername
=
""
;
m_timestamp
=
"0"
;
}
flowControll
&
flowControll
::
GetInstance
()
...
...
@@ -387,8 +389,10 @@ bool flowControll::GetCashObject(QList<CashierObject>& cashiersList)
CashierObject
cashierObj
;
InitClass
::
GetInstance
().
GetCathInfo
(
cashierObj
.
name
,
cashierObj
.
shiftId
,
cashierObj
.
shiftName
);
cashierObj
.
id
=
m_pos
Id
;
cashierObj
.
id
=
m_cashier
Id
;
cashiersList
.
append
(
cashierObj
);
qDebug
()
<<
"this is "
<<
cashierObj
.
name
;
emit
updateCashier
(
cashierObj
.
name
);
return
1
;
}
//-----//订单的处理
...
...
@@ -442,7 +446,13 @@ bool flowControll::_GetStoreInfo() //获取门店信息
result = database::GetInstance().GetStoreInfo(m_storeId, m_posId, m_cashierId, m_bDate, error);
}
#endif
result
=
InitClass
::
GetInstance
().
GetStoreInfo
(
m_storeId
,
m_passwd
,
m_cashierId
);
QList
<
CashierObject
>
cashiersList
;
GetCashObject
(
cashiersList
);
result
=
InitClass
::
GetInstance
().
GetStoreInfo
(
m_storeId
,
m_posId
,
m_passwd
,
m_cashierId
);
if
(
m_posId
==
""
)
{
m_posId
=
getHostMacAddress
();
}
QLOG_INFO
()
<<
QString
(
"get storeInfo finsh. [result:%1][msg:%2][storeId:%3,posId:%4,cashierId:%5,bdate:%6]"
)
.
arg
(
result
).
arg
(
error
,
m_storeId
,
m_posId
,
m_cashierId
,
m_bDate
.
toString
(
"yyyy-MM-dd"
));
...
...
Thread/workThread/flowcontroll.h
View file @
5af0bec7
...
...
@@ -41,6 +41,7 @@ private:
QString
m_passwd
;
QString
m_posId
;
QString
m_cashierId
;
QString
m_cashiername
;
QDateTime
m_bDate
;
QString
m_timestamp
;
// 拉取订单的时间戳
QMap
<
QString
,
OrderObject
*>
m_ordersMap
;
// 订单容器
...
...
@@ -57,6 +58,7 @@ signals:
void
showCashierChooseForm
(
const
QList
<
CashierObject
>&
cashiers
);
// 显示收银员选择窗
void
showOrderDetails
(
OrderObject
*
orderObject
);
//获取订单详情信号
void
TodetailForm
(
const
QString
&
str
);
void
updateCashier
(
QString
str
);
public
slots
:
void
onStartFlow
();
//线程的初始化工作
...
...
Tool/initclass.cpp
View file @
5af0bec7
...
...
@@ -416,13 +416,14 @@ void InitClass::GetSalesLipIpPort(QString &ip,int &port)
}
#endif
bool
InitClass
::
GetStoreInfo
(
QString
&
m_storeid
,
QString
&
m_passd
,
QString
&
m_cashid
)
bool
InitClass
::
GetStoreInfo
(
QString
&
m_storeid
,
QString
&
m_p
osid
,
QString
&
m_p
assd
,
QString
&
m_cashid
)
{
QString
apppath
=
QCoreApplication
::
applicationDirPath
();
QSettings
*
settings
=
new
QSettings
(
QString
(
"%1/fmPos.ini"
).
arg
(
apppath
),
QSettings
::
IniFormat
);
m_storeid
=
settings
->
value
(
"STOREINFO/storeId"
).
toString
();
m_passd
=
settings
->
value
(
"STOREINFO/passwd"
).
toString
();
m_cashid
=
settings
->
value
(
"STOREINFO/cashierId"
).
toString
();
QSettings
*
settings
=
new
QSettings
(
QString
(
"%1/FreemudPOS.ini"
).
arg
(
apppath
),
QSettings
::
IniFormat
);
m_storeid
=
settings
->
value
(
"FMTAKEOOUT/storeId"
).
toString
();
m_posid
=
settings
->
value
(
"FMTAKEOOUT/posid"
).
toString
();
m_passd
=
settings
->
value
(
"FMTAKEOOUT/passwd"
).
toString
();
m_cashid
=
settings
->
value
(
"FMTAKEOOUT/cashierId"
).
toString
();
delete
settings
;
return
1
;
}
...
...
@@ -430,10 +431,10 @@ bool InitClass::GetStoreInfo(QString &m_storeid,QString &m_passd,QString &m_cash
void
InitClass
::
GetCathInfo
(
QString
&
m_cashname
,
QString
&
m_shiftid
,
QString
&
m_shiftname
)
{
QString
apppath
=
QCoreApplication
::
applicationDirPath
();
QSettings
*
settings
=
new
QSettings
(
QString
(
"%1/
fmPos
.ini"
).
arg
(
apppath
),
QSettings
::
IniFormat
);
m_cashname
=
settings
->
value
(
"
CASH
/cashname"
).
toString
();
m_shiftid
=
settings
->
value
(
"
CASH
/shiftid"
).
toInt
();
m_shiftname
=
settings
->
value
(
"
CASH
/shiftname"
).
toInt
();
QSettings
*
settings
=
new
QSettings
(
QString
(
"%1/
FreemudPOS
.ini"
).
arg
(
apppath
),
QSettings
::
IniFormat
);
m_cashname
=
settings
->
value
(
"
FMTAKEOOUT
/cashname"
).
toString
();
m_shiftid
=
settings
->
value
(
"
FMTAKEOOUT
/shiftid"
).
toInt
();
m_shiftname
=
settings
->
value
(
"
FMTAKEOOUT
/shiftname"
).
toInt
();
delete
settings
;
}
...
...
Tool/initclass.h
View file @
5af0bec7
...
...
@@ -28,7 +28,7 @@ public:
//销售单的IP及其port
//void GetSalesLipIpPort(QString &ip,int &port);
QString
strpath
;
bool
GetStoreInfo
(
QString
&
m_storeid
,
QString
&
m_passd
,
QString
&
m_cashid
);
bool
GetStoreInfo
(
QString
&
m_storeid
,
QString
&
m_p
osid
,
QString
&
m_p
assd
,
QString
&
m_cashid
);
void
GetCathInfo
(
QString
&
m_cashname
,
QString
&
m_shiftid
,
QString
&
m_shiftname
);
private
:
...
...
Ui/MainWindow.cpp
View file @
5af0bec7
...
...
@@ -85,6 +85,7 @@ MainWindow::MainWindow(QWidget *parent) :
connect
(
&
flowControll
::
GetInstance
(),
&
flowControll
::
showDeliverChooseForm
,
this
,
&
MainWindow
::
onshowDeliverChooseForm
);
//显示配送员选择窗
connect
(
&
flowControll
::
GetInstance
(),
&
flowControll
::
showCashierChooseForm
,
this
,
&
MainWindow
::
onShowCashierChooseForm
);
//显示收银员选择窗
connect
(
&
flowControll
::
GetInstance
(),
&
flowControll
::
showOrderDetails
,
this
,
&
MainWindow
::
onShowOrderDetails
);
//显示订单的详情
connect
(
&
flowControll
::
GetInstance
(),
&
flowControll
::
updateCashier
,
this
,
&
MainWindow
::
onUpdateshowCashier
);
psetting
=
new
PrintSetting
(
this
);
m_keyBoadForm
=
new
KeyBoardForm
(
this
);
connect
(
ui
->
mainEdtSearch
,
SIGNAL
(
ShowNumPad
()),
m_keyBoadForm
,
SLOT
(
show
()));
//显示数字键盘
...
...
@@ -336,6 +337,10 @@ void MainWindow::onUpdateCashier(const CashierObject &cashier)
ui
->
mainLabCashier
->
setText
(
cashier
.
name
);
}
void
MainWindow
::
onUpdateshowCashier
(
QString
cashname
)
{
ui
->
mainLabCashier
->
setText
(
cashname
);
}
void
MainWindow
::
OnBtnCashier
()
{
emit
getOnDutyCashiers
();
...
...
Ui/MainWindow.h
View file @
5af0bec7
...
...
@@ -92,6 +92,7 @@ public:
Q_SLOT
void
onMainTabBtnClicked
();
Q_SLOT
void
onMainTableItemClicked
(
QTableWidgetItem
*
item
);
Q_SLOT
void
onUpdateCashier
(
const
CashierObject
&
cashier
);
Q_SLOT
void
onUpdateshowCashier
(
QString
cashname
);
Q_SLOT
void
onMainBtnDown
();
Q_SLOT
void
onMainbtnUp
();
Q_SLOT
void
onMainClose
();
...
...
global/preDefine.h
View file @
5af0bec7
No preview for this file type
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