Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
supplier
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
王宇航
supplier
Commits
3639ad20
Commit
3639ad20
authored
Sep 24, 2020
by
宁斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、餐檯代碼結構調整 2、賬單管理折扣未送單 先送單再進入結賬頁
parent
9a665eff
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
450 additions
and
561 deletions
+450
-561
base-module/src/main/java/com/gingersoft/gsa/cloud/database/bean/Function.java
+1
-4
base-module/src/main/java/com/gingersoft/gsa/cloud/patterns/Strategy.java
+14
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/contract/TableContract.java
+4
-3
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/constant/TableActionConstant.java
+0
-12
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/PrintServingPaperAction.java
+0
-50
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/ResetTableAction.java
+0
-34
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/SplitTableStrategy.java
+0
-13
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/TableActionStrategy.java
+0
-46
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/MoveTableAction.java
+11
-7
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/PrintServingPaperAction.java
+59
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/PrintSkyOrderAction.java
+6
-11
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/ResetTableAction.java
+59
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/SplitTableAction.java
+8
-6
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/TableAction.java
+102
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/BaseOrderPresenter.java
+2
-2
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/OrderContentPresenter.java
+34
-22
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/TablePresenter.java
+102
-240
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/MealStandActivity.java
+11
-11
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/OrderContentActivity.java
+7
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/OrderPayActivity.java
+1
-1
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/TableActivity.java
+27
-97
table-module/src/main/res/layout/table_activity_table.xml
+2
-2
No files found.
base-module/src/main/java/com/gingersoft/gsa/cloud/database/bean/Function.java
View file @
3639ad20
...
...
@@ -8,9 +8,6 @@ import org.greenrobot.greendao.annotation.NotNull;
import
org.greenrobot.greendao.annotation.Property
;
import
org.greenrobot.greendao.annotation.Transient
;
import
lombok.Data
;
import
lombok.extern.java.Log
;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
...
...
@@ -35,7 +32,7 @@ public class Function {
private
String
resName
;
private
String
resUrl
;
private
String
imageURL
;
/
/暫時沒有imageURL,用本地資源代替
/
**暫時沒有imageURL,用本地資源代替*/
private
int
icRes
;
/**狀態
* 0 未开通
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/patterns/Strategy.java
0 → 100644
View file @
3639ad20
package
com
.
gingersoft
.
gsa
.
cloud
.
patterns
;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
* 创建日期:2020-09-24
* 修订历史:2020-09-24
* 描述:
*/
public
interface
Strategy
<
T
>
{
/**具體操作行為實現方法*/
void
action
(
T
t
);
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/contract/TableContract.java
View file @
3639ad20
...
...
@@ -6,6 +6,7 @@ import com.gingersoft.gsa.cloud.database.bean.Modifier;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.BaseOrderRespose
;
import
com.gingersoft.gsa.cloud.base.common.bean.table.TableBean
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.TableDetail
;
import
com.gingersoft.gsa.cloud.table.mvp.model.table.action.TableAction
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.fragment.AllTableFragment
;
import
com.jess.arms.base.DefaultAdapter
;
import
com.jess.arms.mvp.IView
;
...
...
@@ -49,13 +50,13 @@ public interface TableContract {
void
setBottomFunctionRecycleLayoutManager
(
int
orientation
);
void
setCurrent
OperatType
(
int
type
);
void
setCurrent
TableAction
(
TableAction
action
);
void
set
Operat
ContentText
(
String
contentText
);
void
set
TableAction
ContentText
(
String
contentText
);
String
getOperatContentText
();
void
setTableActionTitle
();
void
setTableActionTitle
(
TableAction
action
);
void
canceTableAction
();
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/constant/TableActionConstant.java
View file @
3639ad20
...
...
@@ -24,16 +24,4 @@ public interface TableActionConstant {
int
table_status_4
=
4
;
int
table_status_5
=
5
;
/**
* 1#分台
* 2#上菜纸
* 3#重置
* 4#转台
* 5#sky_order
*/
int
splite_table_1
=
1
;
int
print_parper_2
=
2
;
int
init_table_3
=
3
;
int
move_table_4
=
4
;
int
skyorder_mode_5
=
5
;
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/PrintServingPaperAction.java
deleted
100644 → 0
View file @
9a665eff
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
table
;
import
android.content.Context
;
import
com.gingersoft.gsa.cloud.base.common.bean.table.TableBean
;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
* 创建日期:2020-09-23
* 修订历史:2020-09-23
* 描述:餐檯模式-打印上菜紙{@link com.gingersoft.gsa.cloud.table.mvp.ui.activity.TableActivity}
*/
public
class
PrintServingPaperAction
extends
TableActionStrategy
{
public
PrintServingPaperAction
(
Context
context
)
{
super
(
context
);
}
@Override
public
void
action
(
TableBean
.
DataBean
dataBean
)
{
if
(
dataBean
.
getSplitStatus
()
==
1
)
{
splitTableAction
();
}
else
{
// showOperatTipDialog(dataBean);
}
}
// public void showOperatTipDialog(TableBean.DataBean dataBean) {
// QMUIDialog.MessageDialogBuilder dialogBuilder = new QMUIDialog.MessageDialogBuilder(mContext);
// dialogBuilder.setTitleIcon(R.drawable.qmui_icon_dialog_doubt);
// dialogBuilder.setMessage("是否確認打印");
// dialogBuilder.addAction(0, "確認", QMUIDialogAction.ACTION_PROP_NEGATIVE, new QMUIDialogAction.ActionListener() {
// @Override
// public void onClick(QMUIDialog dialog, int index) {
// dialog.dismiss();
// loadOrderToPrint(dataBean.getId(), dataBean.getOrderId());
// }
// });
// dialogBuilder.addAction("取消", new QMUIDialogAction.ActionListener() {
// @Override
// public void onClick(QMUIDialog dialog, int index) {
// dialog.dismiss();
// cancel();
// }
// });
// dialogBuilder.create(R.style.MyDialogTheme2).show();
// }
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/ResetTableAction.java
deleted
100644 → 0
View file @
9a665eff
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
table
;
import
android.content.Context
;
import
com.gingersoft.gsa.cloud.base.common.bean.table.TableBean
;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
* 创建日期:2020-09-23
* 修订历史:2020-09-23
* 描述:餐檯模式-重置餐檯{@link com.gingersoft.gsa.cloud.table.mvp.ui.activity.TableActivity}
*/
public
class
ResetTableAction
extends
TableActionStrategy
implements
SplitTableStrategy
{
public
ResetTableAction
(
Context
context
)
{
super
(
context
);
}
@Override
public
void
splitTableAction
()
{
}
@Override
public
void
action
(
TableBean
.
DataBean
dataBean
)
{
}
@Override
public
void
cancel
()
{
}
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/SplitTableStrategy.java
deleted
100644 → 0
View file @
9a665eff
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
table
;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
* 创建日期:2020-09-23
* 修订历史:2020-09-23
* 描述:分檯策略接口 需要對分檯進行操作需要實現此接口
*/
public
interface
SplitTableStrategy
{
void
splitTableAction
();
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/TableActionStrategy.java
deleted
100644 → 0
View file @
9a665eff
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
table
;
import
android.content.Context
;
import
com.gingersoft.gsa.cloud.base.common.bean.table.TableBean
;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
* 创建日期:2020-09-23
* 修订历史:2020-09-23
* 描述:餐檯功能策略類,所有餐檯功能都需要繼承這個
*/
public
abstract
class
TableActionStrategy
{
protected
Context
mContext
;
public
TableActionStrategy
(
Context
context
)
{
this
.
mContext
=
context
;
}
public
abstract
void
action
(
TableBean
.
DataBean
dataBean
);
protected
void
splitTableAction
(){
if
(
actionListener
!=
null
)
{
actionListener
.
splitTableAction
();
}
}
protected
void
cancel
()
{
if
(
actionListener
!=
null
)
{
actionListener
.
cancel
();
}
}
private
OnActionListener
actionListener
;
public
void
setActionListener
(
OnActionListener
actionListener
)
{
this
.
actionListener
=
actionListener
;
}
public
interface
OnActionListener
{
void
splitTableAction
();
void
cancel
();
}
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/MoveTableAction.java
→
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/
action/
MoveTableAction.java
View file @
3639ad20
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
table
;
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
table
.
action
;
import
android.content.Context
;
...
...
@@ -11,21 +11,25 @@ import com.gingersoft.gsa.cloud.base.common.bean.table.TableBean;
* 修订历史:2020-09-23
* 描述:餐檯模式-轉台{@link com.gingersoft.gsa.cloud.table.mvp.ui.activity.TableActivity}
*/
public
class
MoveTableAction
extends
TableActionStrategy
implements
SplitTableStrategy
{
public
class
MoveTableAction
extends
TableAction
{
public
MoveTableAction
(
Context
context
)
{
super
(
context
);
super
(
context
,
"轉台"
,
"請選擇檯號"
,
""
);
}
@Override
public
void
action
(
TableBean
.
DataBean
dataBean
)
{
if
(
dataBean
.
getSplitStatus
()
==
1
)
{
showSplitTableDialogAction
();
}
else
{
//獲取餐檯狀態
moveTable
(
dataBean
);
}
}
@Override
public
void
splitTableAction
(
)
{
public
boolean
filterTableCondition
(
TableBean
.
DataBean
dataBean
)
{
return
true
;
}
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/PrintServingPaperAction.java
0 → 100644
View file @
3639ad20
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
table
.
action
;
import
android.content.Context
;
import
com.gingersoft.gsa.cloud.base.common.bean.table.TableBean
;
import
com.gingersoft.gsa.cloud.table.R
;
import
com.qmuiteam.qmui.widget.dialog.QMUIDialog
;
import
com.qmuiteam.qmui.widget.dialog.QMUIDialogAction
;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
* 创建日期:2020-09-23
* 修订历史:2020-09-23
* 描述:餐檯模式-打印上菜紙{@link com.gingersoft.gsa.cloud.table.mvp.ui.activity.TableActivity}
*/
public
class
PrintServingPaperAction
extends
TableAction
{
public
PrintServingPaperAction
(
Context
context
)
{
super
(
context
,
"上菜紙"
,
"請選擇檯號"
,
""
);
}
@Override
public
void
action
(
TableBean
.
DataBean
dataBean
)
{
setOperatContentText
(
dataBean
.
getTableName
());
if
(
dataBean
.
getSplitStatus
()
==
1
)
{
showSplitTableDialogAction
();
}
else
{
showActionTipDialog
(
dataBean
);
}
}
@Override
public
boolean
filterTableCondition
(
TableBean
.
DataBean
dataBean
)
{
return
dataBean
.
getStatus
()
!=
0
;
}
public
void
showActionTipDialog
(
TableBean
.
DataBean
dataBean
)
{
QMUIDialog
.
MessageDialogBuilder
dialogBuilder
=
new
QMUIDialog
.
MessageDialogBuilder
(
mContext
);
dialogBuilder
.
setTitleIcon
(
R
.
drawable
.
qmui_icon_dialog_doubt
);
dialogBuilder
.
setMessage
(
"是否確認打印"
);
dialogBuilder
.
addAction
(
0
,
"確認"
,
QMUIDialogAction
.
ACTION_PROP_NEGATIVE
,
new
QMUIDialogAction
.
ActionListener
()
{
@Override
public
void
onClick
(
QMUIDialog
dialog
,
int
index
)
{
dialog
.
dismiss
();
loadOrderToPrint
(
dataBean
);
}
});
dialogBuilder
.
addAction
(
"取消"
,
new
QMUIDialogAction
.
ActionListener
()
{
@Override
public
void
onClick
(
QMUIDialog
dialog
,
int
index
)
{
dialog
.
dismiss
();
cancel
();
}
});
dialogBuilder
.
create
(
R
.
style
.
MyDialogTheme2
).
show
();
}
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/PrintSkyOrderAction.java
→
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/
action/
PrintSkyOrderAction.java
View file @
3639ad20
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
table
;
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
table
.
action
;
import
android.content.Context
;
...
...
@@ -11,26 +11,21 @@ import com.gingersoft.gsa.cloud.base.common.bean.table.TableBean;
* 修订历史:2020-09-23
* 描述:餐檯模式-打印skyorder碼{@link com.gingersoft.gsa.cloud.table.mvp.ui.activity.TableActivity}
*/
public
class
PrintSkyOrderAction
extends
TableAction
Strategy
implements
SplitTableStrategy
{
public
class
PrintSkyOrderAction
extends
TableAction
{
public
PrintSkyOrderAction
(
Context
context
)
{
super
(
context
);
super
(
context
,
"打印skyorder"
,
"請選擇檯號"
,
""
);
}
@Override
public
void
splitTableAction
()
{
}
@Override
public
void
action
(
TableBean
.
DataBean
dataBean
)
{
}
@Override
public
void
cancel
(
)
{
public
boolean
filterTableCondition
(
TableBean
.
DataBean
dataBean
)
{
return
true
;
}
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/ResetTableAction.java
0 → 100644
View file @
3639ad20
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
table
.
action
;
import
android.content.Context
;
import
com.gingersoft.gsa.cloud.base.common.bean.table.TableBean
;
import
com.gingersoft.gsa.cloud.table.R
;
import
com.qmuiteam.qmui.widget.dialog.QMUIDialog
;
import
com.qmuiteam.qmui.widget.dialog.QMUIDialogAction
;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
* 创建日期:2020-09-23
* 修订历史:2020-09-23
* 描述:餐檯模式-重置餐檯{@link com.gingersoft.gsa.cloud.table.mvp.ui.activity.TableActivity}
*/
public
class
ResetTableAction
extends
TableAction
{
public
ResetTableAction
(
Context
context
)
{
super
(
context
,
"重置餐檯"
,
"請選擇需要重置的檯號"
,
""
);
}
@Override
public
void
action
(
TableBean
.
DataBean
dataBean
)
{
setOperatContentText
(
dataBean
.
getTableName
());
if
(
dataBean
.
getSplitStatus
()
==
1
)
{
showSplitTableDialogAction
();
}
else
{
showActionTipDialog
(
dataBean
);
}
}
@Override
public
boolean
filterTableCondition
(
TableBean
.
DataBean
dataBean
)
{
return
dataBean
.
getUseStatus
()
==
1
||
dataBean
.
getSplitStatus
()
==
1
;
}
public
void
showActionTipDialog
(
TableBean
.
DataBean
dataBean
)
{
QMUIDialog
.
MessageDialogBuilder
dialogBuilder
=
new
QMUIDialog
.
MessageDialogBuilder
(
mContext
);
dialogBuilder
.
setTitleIcon
(
R
.
drawable
.
qmui_icon_dialog_doubt
);
dialogBuilder
.
setMessage
(
"是否確認重置"
+
dataBean
.
getTableName
()
+
"號檯?"
);
dialogBuilder
.
addAction
(
0
,
"確認"
,
QMUIDialogAction
.
ACTION_PROP_NEGATIVE
,
new
QMUIDialogAction
.
ActionListener
()
{
@Override
public
void
onClick
(
QMUIDialog
dialog
,
int
index
)
{
dialog
.
dismiss
();
resetTable
(
dataBean
);
}
});
dialogBuilder
.
addAction
(
"取消"
,
new
QMUIDialogAction
.
ActionListener
()
{
@Override
public
void
onClick
(
QMUIDialog
dialog
,
int
index
)
{
dialog
.
dismiss
();
cancel
();
}
});
dialogBuilder
.
create
(
R
.
style
.
MyDialogTheme2
).
show
();
}
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/SplitTableAction.java
→
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/
action/
SplitTableAction.java
View file @
3639ad20
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
table
;
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
table
.
action
;
import
android.content.Context
;
...
...
@@ -11,19 +11,21 @@ import com.gingersoft.gsa.cloud.base.common.bean.table.TableBean;
* 修订历史:2020-09-23
* 描述:餐檯模式-分檯{@link com.gingersoft.gsa.cloud.table.mvp.ui.activity.TableActivity}
*/
public
class
SplitTableAction
extends
TableAction
Strategy
{
public
class
SplitTableAction
extends
TableAction
{
public
SplitTableAction
(
Context
context
)
{
super
(
context
);
super
(
context
,
"分檯"
,
"請選擇檯號"
,
""
);
}
@Override
public
void
action
(
TableBean
.
DataBean
dataBean
)
{
setOperatContentText
(
dataBean
.
getTableName
());
splitTableAction
(
dataBean
);
}
@Override
public
void
cancel
(
)
{
public
boolean
filterTableCondition
(
TableBean
.
DataBean
dataBean
)
{
return
dataBean
.
getStatus
()
!=
0
;
}
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/TableAction.java
0 → 100644
View file @
3639ad20
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
table
.
action
;
import
android.content.Context
;
import
com.gingersoft.gsa.cloud.base.common.bean.table.TableBean
;
import
com.gingersoft.gsa.cloud.patterns.Strategy
;
import
lombok.Data
;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
* 创建日期:2020-09-23
* 修订历史:2020-09-23
* 描述:餐檯功能策略類,所有餐檯功能都需要繼承這個類
*/
@Data
public
abstract
class
TableAction
implements
Strategy
<
TableBean
.
DataBean
>
{
public
Context
mContext
;
protected
String
actionTitle
;
protected
String
actionHint
;
protected
String
actionContent
;
public
TableAction
(
Context
mContext
)
{
this
.
mContext
=
mContext
;
}
public
TableAction
(
Context
context
,
String
actionTitle
,
String
actionHint
,
String
actionContent
)
{
this
.
mContext
=
context
;
this
.
actionTitle
=
actionTitle
;
this
.
actionHint
=
actionHint
;
this
.
actionContent
=
actionContent
;
}
/**不同餐檯操作,對餐檯的過濾條件*/
public
abstract
boolean
filterTableCondition
(
TableBean
.
DataBean
dataBean
);
protected
void
setOperatContentText
(
String
content
)
{
if
(
actionListener
!=
null
)
{
actionListener
.
setOperatContentText
(
content
);
}
}
protected
void
resetTable
(
TableBean
.
DataBean
tableBean
)
{
if
(
actionListener
!=
null
)
{
actionListener
.
resetTable
(
tableBean
);
}
}
protected
void
moveTable
(
TableBean
.
DataBean
tableBean
)
{
if
(
actionListener
!=
null
)
{
actionListener
.
moveTable
(
tableBean
);
}
}
protected
void
loadOrderToPrint
(
TableBean
.
DataBean
tableBean
)
{
if
(
actionListener
!=
null
)
{
actionListener
.
loadOrderToPrint
(
tableBean
);
}
}
protected
void
showSplitTableDialogAction
()
{
if
(
actionListener
!=
null
)
{
actionListener
.
showSplitTableDialogAction
();
}
}
protected
void
splitTableAction
(
TableBean
.
DataBean
tableBean
)
{
if
(
actionListener
!=
null
)
{
actionListener
.
splitTableAction
(
tableBean
);
}
}
public
void
cancel
()
{
if
(
actionListener
!=
null
)
{
actionListener
.
cancel
();
}
}
private
OnActionListener
actionListener
;
public
void
setActionListener
(
OnActionListener
actionListener
)
{
this
.
actionListener
=
actionListener
;
}
public
interface
OnActionListener
{
void
setOperatContentText
(
String
content
);
void
resetTable
(
TableBean
.
DataBean
tableBean
);
void
moveTable
(
TableBean
.
DataBean
tableBean
);
void
loadOrderToPrint
(
TableBean
.
DataBean
tableBean
);
void
splitTableAction
(
TableBean
.
DataBean
tableBean
);
void
showSplitTableDialogAction
();
void
cancel
();
}
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/BaseOrderPresenter.java
View file @
3639ad20
...
...
@@ -394,7 +394,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
// }
// }
// }
pr
ivate
void
addSentOrderDiscount
()
{
pr
otected
void
addSentOrderDiscount
()
{
OrderBean
orderBean
=
myOrderManage
.
getOrderBean
();
if
(
orderBean
!=
null
)
{
List
<
OrderDiscount
.
Respose
>
discountDetails
=
orderBean
.
getDiscountDetails
();
...
...
@@ -450,7 +450,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
/**
* 添加餐檯服務費
*/
pr
ivate
void
addTableServiceAmount
()
{
pr
otected
void
addTableServiceAmount
()
{
TableBean
.
DataBean
dataBean
=
OpenTableManage
.
getDefault
().
getTableBean
();
if
(
dataBean
==
null
)
{
return
;
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/OrderContentPresenter.java
View file @
3639ad20
...
...
@@ -12,14 +12,15 @@ import com.gingersoft.gsa.cloud.aspectj.XClickUtil;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.common.bean.BaseResult
;
import
com.gingersoft.gsa.cloud.base.common.bean.BillOrderMoney
;
import
com.gingersoft.gsa.cloud.base.common.bean.discount.CouponDiscountBean
;
import
com.gingersoft.gsa.cloud.base.common.bean.MemberInfo
;
import
com.gingersoft.gsa.cloud.base.common.bean.OrderBean
;
import
com.gingersoft.gsa.cloud.base.common.bean.OrderDetail
;
import
com.gingersoft.gsa.cloud.base.common.bean.
table.Table
Bean
;
import
com.gingersoft.gsa.cloud.base.common.bean.
table.TableExtBean
;
import
com.gingersoft.gsa.cloud.base.common.bean.
discount.CouponDiscount
Bean
;
import
com.gingersoft.gsa.cloud.base.common.bean.
discount.CouponDiscountResult
;
import
com.gingersoft.gsa.cloud.base.common.bean.mealManger.MyOrderManage
;
import
com.gingersoft.gsa.cloud.base.common.bean.mealManger.OpenTableManage
;
import
com.gingersoft.gsa.cloud.base.common.bean.table.TableBean
;
import
com.gingersoft.gsa.cloud.base.common.bean.table.TableExtBean
;
import
com.gingersoft.gsa.cloud.base.utils.JsonUtils
;
import
com.gingersoft.gsa.cloud.base.utils.gson.GsonUtils
;
import
com.gingersoft.gsa.cloud.constans.GoldConstants
;
...
...
@@ -29,9 +30,9 @@ import com.gingersoft.gsa.cloud.database.bean.Function;
import
com.gingersoft.gsa.cloud.function.FunctionManager
;
import
com.gingersoft.gsa.cloud.print.PrinterUtils
;
import
com.gingersoft.gsa.cloud.table.ComponentTable
;
import
com.gingersoft.gsa.cloud.table.R
;
import
com.gingersoft.gsa.cloud.table.mvp.contract.OrderContentContract
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.BaseOrderRespose
;
import
com.gingersoft.gsa.cloud.base.common.bean.discount.CouponDiscountResult
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.TableDetail
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.request.AddOrderRequest
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.request.CreateOrderRequest
;
...
...
@@ -50,6 +51,7 @@ import com.gingersoft.gsa.cloud.ui.widget.dialog.CommonTipDialog;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.jess.arms.http.imageloader.ImageLoader
;
import
com.jess.arms.integration.AppManager
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.jess.arms.utils.RxLifecycleUtils
;
import
com.scwang.smartrefresh.layout.api.RefreshLayout
;
...
...
@@ -356,7 +358,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
mRootView
.
showMessage
(
"送單成功"
);
//刷新食品列表
if
(
afterToActivity
!=
null
)
{
update
FoodList
(
info
);
update
OrderDetails
(
info
);
}
printSendOrder
(
afterToActivity
);
}
...
...
@@ -506,7 +508,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
@Override
public
void
onNext
(
@NonNull
BaseOrderRespose
info
)
{
update
FoodList
(
info
);
update
OrderDetails
(
info
);
}
});
}
...
...
@@ -652,9 +654,9 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
mRootView
.
showMessage
(
"轉移成功"
);
updateFoodList
(
info
);
updateOrderDetails
(
info
);
updateBillOrderItem
();
IActivity
.
initOrderDetail
();
IActivity
.
backPressed
();
}
else
{
...
...
@@ -771,23 +773,33 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
}
/**
* 更新
食品列表
* 更新
訂單詳情
*
* @param info
*/
private
void
updateFoodList
(
BaseOrderRespose
info
)
{
if
(
info
.
getData
()
!=
null
&&
info
.
getData
().
getOrderDetails
()
!=
null
)
{
OpenTableManage
.
getDefault
().
setPeopleNumber
(
info
.
getData
().
getPerson
());
//緩存訂單信息
MyOrderManage
.
getInstance
().
setOrderBean
(
new
OrderBean
(
info
.
getData
()));
//緩存食品信息
List
<
OrderDetail
>
orderDetailList
=
OrderAssemblyUtil
.
assemblyOrder
(
OrderDetail
.
orderTransOrderDetails
(
info
.
getData
().
getOrderDetails
()));
mOrderFoodList
.
clear
();
mOrderFoodList
.
addAll
(
orderDetailList
);
mSelectMealAdapter
.
notifyDataSetChanged
();
mSelectMealAdapter
.
setIndex
();
private
void
updateOrderDetails
(
BaseOrderRespose
info
)
{
if
(
info
.
getData
()
!=
null
)
{
if
(
info
.
getData
().
getOrderDetails
()
!=
null
)
{
OpenTableManage
.
getDefault
().
setPeopleNumber
(
info
.
getData
().
getPerson
());
//緩存訂單信息
MyOrderManage
.
getInstance
().
setOrderBean
(
new
OrderBean
(
info
.
getData
()));
//緩存食品信息
List
<
OrderDetail
>
orderDetailList
=
OrderAssemblyUtil
.
assemblyOrder
(
OrderDetail
.
orderTransOrderDetails
(
info
.
getData
().
getOrderDetails
()));
mOrderFoodList
.
clear
();
mOrderFoodList
.
addAll
(
orderDetailList
);
mSelectMealAdapter
.
notifyDataSetChanged
();
mSelectMealAdapter
.
setIndex
();
}
for
(
BillOrderMoney
billOrderMoney:
mOrderMoneyList
)
{
//將已有折扣 服務費狀態改為已送單
billOrderMoney
.
setStatus
(
BillOrderMoney
.
BILL_ITEM_ORDER_SENT_STATUS
);
billOrderMoney
.
setTextColor
(
ArmsUtils
.
getColor
(
IActivity
,
R
.
color
.
theme_black
));
}
mOrderMoneyAdapter
.
notifyDataSetChanged
();
}
}
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/TablePresenter.java
View file @
3639ad20
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
presenter
;
import
android.app.Application
;
import
android.content.Context
;
import
android.os.CountDownTimer
;
import
android.text.TextUtils
;
import
android.view.View
;
...
...
@@ -30,8 +31,12 @@ import com.gingersoft.gsa.cloud.table.R;
import
com.gingersoft.gsa.cloud.table.mvp.contract.TableContract
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.BaseOrderRespose
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.TableDetail
;
import
com.gingersoft.gsa.cloud.table.mvp.model.constant.TableActionConstant
;
import
com.gingersoft.gsa.cloud.table.mvp.model.table.TableActionStrategy
;
import
com.gingersoft.gsa.cloud.table.mvp.model.table.action.MoveTableAction
;
import
com.gingersoft.gsa.cloud.table.mvp.model.table.action.PrintServingPaperAction
;
import
com.gingersoft.gsa.cloud.table.mvp.model.table.action.PrintSkyOrderAction
;
import
com.gingersoft.gsa.cloud.table.mvp.model.table.action.ResetTableAction
;
import
com.gingersoft.gsa.cloud.table.mvp.model.table.action.SplitTableAction
;
import
com.gingersoft.gsa.cloud.table.mvp.model.table.action.TableAction
;
import
com.gingersoft.gsa.cloud.table.mvp.model.utils.OrderAssemblyUtil
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.TableActivity
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.adapter.BottomFunctionAdapter
;
...
...
@@ -103,18 +108,8 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
private
BottomFunctionAdapter
mBottomFunctionAdapter
;
private
List
<
Function
>
mBottomFunctionList
=
new
ArrayList
<>();
private
TableActionStrategy
mTableAction
;
/**
* 当前选择的操作:
* 1#分台
* 2#上菜纸
* 3#重置
* 4#转台
* 5#sky_order
* 6#結賬、
* 10#餐檯模式
*/
private
int
mCurrentOperatType
=
-
1
;
private
TableAction
mTableAction
;
private
List
<
TableAction
>
mTableActions
=
new
ArrayList
<>();
/**
* 选中操作的台名、id、分檯編號
*/
...
...
@@ -128,7 +123,6 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
private
long
targetTableId
;
private
String
targetTableNumber
=
""
;
//定时获取餐台 定时器
private
GetTableTimer
tableTimer
;
private
Disposable
mGetTablesDataDisposable
;
...
...
@@ -137,9 +131,18 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
super
(
model
,
rootView
);
this
.
IActivity
=
(
TableActivity
)
rootView
;
initTableActions
(
IActivity
);
initGetTableTimer
();
}
private
void
initTableActions
(
Context
context
)
{
mTableActions
.
add
(
new
ResetTableAction
(
context
));
mTableActions
.
add
(
new
MoveTableAction
(
context
));
mTableActions
.
add
(
new
SplitTableAction
(
context
));
mTableActions
.
add
(
new
PrintServingPaperAction
(
context
));
mTableActions
.
add
(
new
PrintSkyOrderAction
(
context
));
}
@Override
public
void
onDestroy
()
{
super
.
onDestroy
();
...
...
@@ -174,37 +177,15 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
// mRootView.showMessage("服務已到期,請前往續費");
// return;
// }
// if (function.getResUrl().equals(ComponentTable.table.bottom[0].getKeyRes())) {
// //重置
// mRootView.setCurrentOperatType(TableActionConstant.init_table_3);
// } else if (function.getResUrl().equals(ComponentTable.table.bottom[1].getKeyRes())) {
// //轉檯
// mRootView.setCurrentOperatType(TableActionConstant.move_table_4);
// } else if (function.getResUrl().equals(ComponentTable.table.bottom[3].getKeyRes())) {
// //上菜紙
// mRootView.setCurrentOperatType(TableActionConstant.print_parper_2);
// }
switch
(
position
)
{
case
0
:
// mTableAction = new ResetTableAction();
//重置
mRootView
.
setCurrentOperatType
(
TableActionConstant
.
init_table_3
);
break
;
case
1
:
// mTableAction = new MoveTableAction();
//轉檯
mRootView
.
setCurrentOperatType
(
TableActionConstant
.
move_table_4
);
break
;
case
2
:
// mTableAction = new SplitTableAction();
//分檯
mRootView
.
setCurrentOperatType
(
TableActionConstant
.
splite_table_1
);
break
;
case
3
:
// mTableAction = new PrintServingPaperAction();
//上菜紙
mRootView
.
setCurrentOperatType
(
TableActionConstant
.
print_parper_2
);
break
;
if
(
mTableActions
.
size
()
>
position
)
{
mTableAction
=
mTableActions
.
get
(
position
);
if
(
mTableAction
!=
null
)
{
boolean
isMoveTableAction
=
mTableAction
instanceof
MoveTableAction
;
if
(!
isMoveTableAction
)
{
filterTableByAction
();
}
mRootView
.
setCurrentTableAction
(
mTableAction
);
}
}
}
});
...
...
@@ -319,11 +300,11 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
});
}
public
void
loadOrderToPrint
(
long
tableId
,
Long
orderId
)
{
if
(
orderId
==
null
)
{
public
void
loadOrderToPrint
Parper
(
TableBean
.
DataBean
tableBean
)
{
if
(
tableBean
.
getOrderId
()
==
null
)
{
return
;
}
mModel
.
getOrderById
(
orderId
)
mModel
.
getOrderById
(
tableBean
.
getOrderId
()
)
.
subscribeOn
(
Schedulers
.
io
())
.
doOnSubscribe
(
disposable
->
mRootView
.
showLoading
(
null
))
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
...
...
@@ -337,11 +318,11 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
if
(
respose
.
isSuccess
())
{
OpenTableManage
.
getDefault
().
setPeopleNumber
(
0
);
//設置當前開台數據1584427984728 1584428017196 1584428086282
TableBean
.
DataBean
dataBean
=
getTableById
(
tableId
);
TableBean
.
DataBean
openTableBean
=
null
;
if
(
dataBean
!=
null
)
{
openTableBean
=
new
TableBean
.
DataBean
(
dataBean
);
}
//
TableBean.DataBean dataBean = getTableById(tableId);
TableBean
.
DataBean
openTableBean
=
tableBean
;
//
if (dataBean != null) {
//
openTableBean = new TableBean.DataBean(dataBean);
//
}
OrderBean
orderBean
=
respose
.
getData
();
if
(
orderBean
!=
null
&&
respose
.
getData
().
getOrderDetails
()
!=
null
)
{
if
(
respose
.
getData
().
getCreateTime
()
!=
null
&&
openTableBean
!=
null
)
{
...
...
@@ -522,7 +503,7 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
return
0
;
}
public
void
getTable
(
TableBean
.
DataBean
dataBean
)
{
public
void
getTable
ToMove
(
TableBean
.
DataBean
dataBean
)
{
mModel
.
getTable
(
dataBean
.
getId
(),
dataBean
.
getTableNumber
())
.
subscribeOn
(
Schedulers
.
io
())
.
doOnSubscribe
(
disposable
->
mRootView
.
showLoading
(
null
))
...
...
@@ -553,7 +534,7 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
originalTableName
=
tableBean
.
getTableName
();
originalTableId
=
tableBean
.
getId
();
originalTableNumber
=
tableBean
.
getTableNumber
();
mRootView
.
set
Operat
ContentText
(
"由: "
+
originalTableName
+
" 轉到 "
);
mRootView
.
set
TableAction
ContentText
(
"由: "
+
originalTableName
+
" 轉到 "
);
}
else
{
if
(
tableBean
.
getUseStatus
()
==
1
)
{
mRootView
.
showMessage
(
"此檯使用中."
);
...
...
@@ -563,11 +544,11 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
targetTableId
=
tableBean
.
getId
();
targetTableNumber
=
tableBean
.
getTableNumber
();
if
(
tableBean
.
getStatus
()
==
1
||
tableBean
.
getStatus
()
==
2
||
tableBean
.
getStatus
()
==
3
)
{
mRootView
.
set
Operat
ContentText
(
"由: "
+
originalTableName
+
" 合併 "
+
targetTableName
);
mRootView
.
set
TableAction
ContentText
(
"由: "
+
originalTableName
+
" 合併 "
+
targetTableName
);
}
else
{
mRootView
.
set
Operat
ContentText
(
"由: "
+
originalTableName
+
" 轉到 "
+
targetTableName
);
mRootView
.
set
TableAction
ContentText
(
"由: "
+
originalTableName
+
" 轉到 "
+
targetTableName
);
}
show
OperatTip
Dialog
(
tableBean
);
show
MoveAction
Dialog
(
tableBean
);
}
}
}
else
{
...
...
@@ -742,42 +723,6 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
});
}
public
void
loadOrderList
(
long
orderId
,
boolean
isPrintParper
)
{
RequestBody
requestBody
=
new
FormBody
.
Builder
()
.
add
(
"orderId"
,
orderId
+
""
)
.
build
();
mModel
.
initTable
(
requestBody
)
.
subscribeOn
(
Schedulers
.
io
())
.
doOnSubscribe
(
disposable
->
mRootView
.
showLoading
(
null
))
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
doAfterTerminate
(()
->
mRootView
.
hideLoading
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
BaseOrderRespose
>(
mErrorHandler
)
{
@Override
public
void
onNext
(
@NonNull
BaseOrderRespose
respose
)
{
if
(
respose
.
isSuccess
())
{
if
(
isPrintParper
)
{
//打印上菜紙
startPrintParper
();
}
}
else
{
mRootView
.
showMessage
(
respose
.
getErrMsg
());
}
}
});
}
private
void
startPrintParper
()
{
}
/**
* 刷新分檯数据
*/
...
...
@@ -791,108 +736,51 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
/**
* 根据操作类型过滤一遍餐台
*/
public
void
filterTableBy
OperatType
()
{
public
void
filterTableBy
Action
()
{
if
(
mTableList
.
size
()
==
0
)
{
return
;
}
List
<
TableBean
.
DataBean
>
filterTableBeanList
=
new
ArrayList
<>();
//如果是餐檯操作過一遍筛选
switch
(
mCurrentOperatType
)
{
case
TableActionConstant
.
splite_table_1
:
for
(
int
i
=
0
;
i
<
mTableList
.
size
();
i
++)
{
// if (mTableList.get(i).getStatus() != 0 || mTableList.get(i).getSplitStatus() == 1 ? true : false) {
if
(
mTableList
.
get
(
i
).
getStatus
()
!=
0
)
{
filterTableBeanList
.
add
(
mTableList
.
get
(
i
));
}
}
break
;
case
TableActionConstant
.
print_parper_2
:
for
(
int
i
=
0
;
i
<
mTableList
.
size
();
i
++)
{
if
(
mTableList
.
get
(
i
).
getStatus
()
!=
0
)
{
filterTableBeanList
.
add
(
mTableList
.
get
(
i
));
}
}
break
;
case
TableActionConstant
.
init_table_3
:
for
(
int
i
=
0
;
i
<
mTableList
.
size
();
i
++)
{
if
(
mTableList
.
get
(
i
).
getUseStatus
()
==
1
||
mTableList
.
get
(
i
).
getSplitStatus
()
==
1
)
{
filterTableBeanList
.
add
(
mTableList
.
get
(
i
));
}
if
(
mTableAction
!=
null
)
{
for
(
int
i
=
0
;
i
<
mTableList
.
size
();
i
++)
{
TableBean
.
DataBean
dataBean
=
mTableList
.
get
(
i
);
if
(
mTableAction
.
filterTableCondition
(
dataBean
))
{
filterTableBeanList
.
add
(
dataBean
);
}
break
;
// case TableActionConstant.skyorder_mode_5:
// for (int i = 0; i < datasBeans.size(); i++) {
// mTableList.add(datasBeans.get(i));
// }
// break;
case
TableActionConstant
.
move_table_4
:
case
-
1
:
//正常餐檯模式下顯示所有餐檯數據
filterTableBeanList
.
addAll
(
mTableList
);
break
;
}
}
else
{
//正常餐檯模式下顯示所有餐檯數據
filterTableBeanList
.
addAll
(
mTableList
);
}
IActivity
.
nofilyFragmentUpdateTableData
(
filterTableBeanList
);
}
public
void
show
OperatTip
Dialog
(
TableBean
.
DataBean
dataBean
)
{
public
void
show
MoveAction
Dialog
(
TableBean
.
DataBean
dataBean
)
{
QMUIDialog
.
MessageDialogBuilder
dialogBuilder
=
new
QMUIDialog
.
MessageDialogBuilder
(
IActivity
);
dialogBuilder
.
setTitleIcon
(
R
.
drawable
.
qmui_icon_dialog_doubt
);
//是否合併檯
boolean
isMergeTable
=
false
;
switch
(
mCurrentOperatType
)
{
case
TableActionConstant
.
splite_table_1
:
break
;
case
TableActionConstant
.
print_parper_2
:
dialogBuilder
.
setMessage
(
"是否確認打印"
);
break
;
case
TableActionConstant
.
init_table_3
:
dialogBuilder
.
setMessage
(
"是否確認重置"
+
dataBean
.
getTableName
()
+
"號檯?"
);
break
;
case
TableActionConstant
.
move_table_4
:
String
message
;
if
(
dataBean
.
getStatus
()
==
1
||
dataBean
.
getStatus
()
==
2
||
dataBean
.
getStatus
()
==
3
)
{
message
=
"是否由%s號檯合併到%s號檯"
;
isMergeTable
=
true
;
}
else
{
message
=
"是否由%s號檯轉到%s號檯"
;
}
dialogBuilder
.
setMessage
(
String
.
format
(
message
,
originalTableName
,
targetTableName
));
break
;
case
TableActionConstant
.
skyorder_mode_5
:
break
;
String
message
;
if
(
dataBean
.
getStatus
()
==
1
||
dataBean
.
getStatus
()
==
2
||
dataBean
.
getStatus
()
==
3
)
{
message
=
"是否由%s號檯合併到%s號檯"
;
isMergeTable
=
true
;
}
else
{
message
=
"是否由%s號檯轉到%s號檯"
;
}
dialogBuilder
.
setMessage
(
String
.
format
(
message
,
originalTableName
,
targetTableName
));
boolean
finalIsMergeTable
=
isMergeTable
;
dialogBuilder
.
addAction
(
0
,
"確認"
,
QMUIDialogAction
.
ACTION_PROP_NEGATIVE
,
new
QMUIDialogAction
.
ActionListener
()
{
@Override
public
void
onClick
(
QMUIDialog
dialog
,
int
index
)
{
dialog
.
dismiss
();
switch
(
mCurrentOperatType
)
{
case
TableActionConstant
.
splite_table_1
:
break
;
case
TableActionConstant
.
print_parper_2
:
loadOrderToPrint
(
dataBean
.
getId
(),
dataBean
.
getOrderId
());
break
;
case
TableActionConstant
.
init_table_3
:
initTable
(
dataBean
.
getId
(),
dataBean
.
getTableNumber
(),
true
);
break
;
case
TableActionConstant
.
move_table_4
:
turnTable
(
originalTableId
,
targetTableId
,
originalTableNumber
,
targetTableNumber
,
finalIsMergeTable
);
break
;
case
TableActionConstant
.
skyorder_mode_5
:
break
;
}
turnTable
(
originalTableId
,
targetTableId
,
originalTableNumber
,
targetTableNumber
,
finalIsMergeTable
);
}
});
dialogBuilder
.
addAction
(
"取消"
,
new
QMUIDialogAction
.
ActionListener
()
{
@Override
public
void
onClick
(
QMUIDialog
dialog
,
int
index
)
{
//重置之前選的餐檯數據
initTableActionParameter
();
mRootView
.
setTableActionTitle
();
dialog
.
dismiss
();
mTableAction
.
cancel
();
}
});
dialogBuilder
.
create
(
R
.
style
.
MyDialogTheme2
).
show
();
...
...
@@ -904,32 +792,17 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
mSplitTableDialog
.
setOnClickListener
(
new
SplitTableDialog
.
OnClickListener
()
{
@Override
public
void
onItemClick
(
SplitTableDialog
dialog
,
TableBean
.
DataBean
dataBean
,
int
position
)
{
int
currentChooseOperatType
=
getCurrentChooseOperatType
();
switch
(
currentChooseOperatType
)
{
case
TableActionConstant
.
print_parper_2
:
case
TableActionConstant
.
init_table_3
:
showOperatTipDialog
(
dataBean
);
break
;
case
TableActionConstant
.
move_table_4
:
mSplitTableDialog
.
closeDialog
();
//獲取餐檯狀態
getTable
(
dataBean
);
break
;
default
:
mSplitTableDialog
.
closeDialog
();
openTable
(
dataBean
.
getId
(),
dataBean
);
break
;
if
(
mTableAction
!=
null
)
{
if
(
mTableAction
instanceof
MoveTableAction
)
{
getTableToMove
(
dataBean
);
}
else
{
mTableAction
.
action
(
dataBean
);
}
}
else
{
//開台操作
openTable
(
dataBean
.
getId
(),
dataBean
);
}
// if (mTableAction != null) {
// if (mTableAction instanceof PrintServingPaperAction || mTableAction instanceof ResetTableAction) {
//
// }
//
// } else {
// //開台操作
// mSplitTableDialog.closeDialog();
// openTable(dataBean.getId(), dataBean);
// }
mSplitTableDialog
.
closeDialog
();
}
});
mSplitTableDialog
.
setOnRetryListener
(
new
BaseRetryDialog
.
OnRetryListener
()
{
...
...
@@ -950,11 +823,40 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
public
boolean
doTableAction
(
TableBean
.
DataBean
dataBean
)
{
if
(
mTableAction
!=
null
)
{
mTableAction
.
action
(
dataBean
);
mTableAction
.
setActionListener
(
new
TableActionStrategy
.
OnActionListener
()
{
mTableAction
.
setActionListener
(
new
TableAction
.
OnActionListener
()
{
@Override
public
void
setOperatContentText
(
String
content
)
{
mRootView
.
setTableActionContentText
(
content
);
}
@Override
public
void
resetTable
(
TableBean
.
DataBean
tableBean
)
{
initTable
(
tableBean
.
getId
(),
tableBean
.
getTableNumber
(),
true
);
}
@Override
public
void
moveTable
(
TableBean
.
DataBean
tableBean
)
{
if
(
dataBean
.
getId
()
==
tableBean
.
getId
()){
CommonTipDialog
.
showSurpisedDialog
(
IActivity
,
"相同檯不能轉移"
,
null
,
null
,
null
,
null
,
null
);
return
;
}
getTableToMove
(
tableBean
);
}
@Override
public
void
loadOrderToPrint
(
TableBean
.
DataBean
tableBean
)
{
loadOrderToPrintParper
(
tableBean
);
}
@Override
public
void
splitTableAction
()
{
// showSplitTableDialog(dataBean.getId());
public
void
splitTableAction
(
TableBean
.
DataBean
tableBean
)
{
splitTable
(
tableBean
);
}
@Override
public
void
showSplitTableDialogAction
()
{
showSplitTableDialog
(
dataBean
.
getId
());
}
@Override
...
...
@@ -1038,46 +940,6 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
return
mGetTablesDataDisposable
;
}
public
int
getCurrentChooseOperatType
()
{
return
mCurrentOperatType
;
}
public
void
setCurrentChooseOperatType
(
int
mCurrentOperatType
)
{
this
.
mCurrentOperatType
=
mCurrentOperatType
;
}
public
String
getOriginalTableName
()
{
return
originalTableName
;
}
public
void
setOriginalTableName
(
String
originalTableName
)
{
this
.
originalTableName
=
originalTableName
;
}
public
long
getOriginalTableId
()
{
return
originalTableId
;
}
public
void
setOriginalTableId
(
int
originalTableId
)
{
this
.
originalTableId
=
originalTableId
;
}
public
String
getTargetTableName
()
{
return
targetTableName
;
}
public
void
setTargetTableName
(
String
targetTableName
)
{
this
.
targetTableName
=
targetTableName
;
}
public
long
getTargetTableId
()
{
return
targetTableId
;
}
public
void
setTargetTableId
(
int
targetTableId
)
{
this
.
targetTableId
=
targetTableId
;
}
public
List
<
TableBean
.
DataBean
>
getTableList
()
{
return
mTableList
;
}
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/MealStandActivity.java
View file @
3639ad20
...
...
@@ -23,16 +23,6 @@ import android.widget.LinearLayout;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.fragment.app.Fragment
;
import
androidx.fragment.app.FragmentManager
;
import
androidx.recyclerview.widget.DefaultItemAnimator
;
import
androidx.recyclerview.widget.GridLayoutManager
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
androidx.viewpager.widget.ViewPager
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.common.bean.BillOrderMoney
;
import
com.gingersoft.gsa.cloud.base.common.bean.MemberInfo
;
...
...
@@ -84,6 +74,15 @@ import java.util.ArrayList;
import
java.util.Arrays
;
import
java.util.List
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.fragment.app.Fragment
;
import
androidx.fragment.app.FragmentManager
;
import
androidx.recyclerview.widget.DefaultItemAnimator
;
import
androidx.recyclerview.widget.GridLayoutManager
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
androidx.viewpager.widget.ViewPager
;
import
butterknife.BindView
;
import
butterknife.OnClick
;
import
butterknife.OnLongClick
;
...
...
@@ -291,8 +290,9 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
mPresenter
.
initMealData
();
//搜索
keyView
.
setOnConfirmCallBack
(
inputText
->
{
if
(
TextUtils
.
isEmpty
(
inputText
))
if
(
TextUtils
.
isEmpty
(
inputText
))
{
return
;
}
mPresenter
.
toFindMeal
(
inputText
);
});
if
(!
MyOrderManage
.
getInstance
().
isModifyOrder
())
{
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/OrderContentActivity.java
View file @
3639ad20
...
...
@@ -218,12 +218,19 @@ public class OrderContentActivity extends BaseFragmentActivity<OrderContentPrese
//TODO 暫未分檯功能
// tableno = GSAApplication.tableContract.getTableno().trim() + "-" + GSAApplication.tableContract.getTableno_split().trim();
}
if
(
MyOrderManage
.
getInstance
().
getMemberInfo
()
!=
null
)
{
useMember
();
}
btn_table
.
setText
(
tableno
);
tv_time
.
setText
(
"時間:"
+
openTime
);
btn_people_num
.
setText
(
OpenTableManage
.
getDefault
().
getPeopleNumber
()
+
""
);
tv_server_main
.
setText
(
GsaCloudApplication
.
getMemberName
());
}
private
void
useMember
()
{
btn_table
.
setBackgroundResource
(
R
.
color
.
pink_300
);
}
@Override
protected
void
onPause
()
{
super
.
onPause
();
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/OrderPayActivity.java
View file @
3639ad20
...
...
@@ -221,7 +221,6 @@ public class OrderPayActivity extends BaseActivity<OrderPayPresenter> implements
tableno
=
OpenTableManage
.
getDefault
().
getTableBean
().
getTableName
().
trim
()
+
"-"
+
OpenTableManage
.
getDefault
().
getSplitNo
().
trim
();
}
btn_table
.
setText
(
tableno
);
tv_time
.
setText
(
"時間:"
+
openTime
);
btn_people_num
.
setText
(
OpenTableManage
.
getDefault
().
getPeopleNumber
()
+
""
);
tv_server_main
.
setText
(
GsaCloudApplication
.
getMemberName
());
...
...
@@ -230,6 +229,7 @@ public class OrderPayActivity extends BaseActivity<OrderPayPresenter> implements
tv_action_name
.
setText
(
"結賬"
);
}
public
void
initOrderDetail
()
{
double
wholeAmount
=
mPresenter
.
getFoodTotal
();
tv_whole
.
setText
(
"合計 $"
+
wholeAmount
);
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/TableActivity.java
View file @
3639ad20
...
...
@@ -20,13 +20,10 @@ import com.gingersoft.gsa.cloud.table.di.component.DaggerTableComponent;
import
com.gingersoft.gsa.cloud.table.mvp.contract.TableContract
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.event.InitTableEvent
;
import
com.gingersoft.gsa.cloud.table.mvp.model.constant.TableActionConstant
;
import
com.gingersoft.gsa.cloud.table.mvp.
presenter.OrderContentPresenter
;
import
com.gingersoft.gsa.cloud.table.mvp.
model.table.action.TableAction
;
import
com.gingersoft.gsa.cloud.table.mvp.presenter.TablePresenter
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.fragment.AllTableFragment
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.fragment.InputTableFragment
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.widget.SplitTableDialog
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.BaseRetryDialog
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.CommonTipDialog
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog
;
import
com.jess.arms.base.BaseFragmentActivity
;
import
com.jess.arms.base.DefaultAdapter
;
...
...
@@ -97,10 +94,10 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
@BindView
(
R2
.
id
.
ll_table_operat_content
)
LinearLayout
ll_table_operat_content
;
@BindView
(
R2
.
id
.
tv_
operat
_hint
)
TextView
tv_
operat
_hint
;
@BindView
(
R2
.
id
.
tv_
operat
_content
)
TextView
tv_
operat
_content
;
@BindView
(
R2
.
id
.
tv_
table_action
_hint
)
TextView
tv_
table_action
_hint
;
@BindView
(
R2
.
id
.
tv_
table_action
_content
)
TextView
tv_
table_action
_content
;
@BindView
(
R2
.
id
.
iv_tab_icon
)
ImageView
iv_tab_icon
;
...
...
@@ -257,8 +254,9 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
@Override
public
void
launchActivity
(
@NonNull
Intent
intent
)
{
if
(
intent
!=
null
)
if
(
intent
!=
null
)
{
ArmsUtils
.
startActivity
(
intent
);
}
}
@Override
...
...
@@ -269,7 +267,7 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
@Override
public
void
returnTableList
(
List
<
TableBean
.
DataBean
>
dataBeanList
)
{
if
(
dataBeanList
!=
null
&&
dataBeanList
.
size
()
>
0
)
{
mPresenter
.
filterTableBy
OperatType
();
mPresenter
.
filterTableBy
Action
();
}
}
...
...
@@ -293,52 +291,13 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
if
(
dataBean
==
null
)
{
return
;
}
// boolean doAction = mPresenter.doTableAction(dataBean);
// if (!doAction) {
// if (dataBean.getSplitStatus() == 1) {
// showSplitTableDialog(dataBean.getId());
// } else {
// mPresenter.openTable(dataBean.getId(), null);
// }
// }
switch
(
mPresenter
.
getCurrentChooseOperatType
())
{
case
TableActionConstant
.
splite_table_1
:
setOperatContentText
(
dataBean
.
getTableName
());
mPresenter
.
splitTable
(
dataBean
);
break
;
case
TableActionConstant
.
print_parper_2
:
case
TableActionConstant
.
init_table_3
:
setOperatContentText
(
dataBean
.
getTableName
());
if
(
dataBean
.
getSplitStatus
()
==
1
)
{
mPresenter
.
showSplitTableDialog
(
dataBean
.
getId
());
}
else
{
mPresenter
.
showOperatTipDialog
(
dataBean
);
}
break
;
case
TableActionConstant
.
move_table_4
:
if
(
mPresenter
.
getOriginalTableId
()
==
dataBean
.
getId
())
{
CommonTipDialog
.
showCancelDialog
(
this
,
"相同檯不能转檯"
,
OrderContentPresenter
.
class
,
mPresenter
,
""
,
null
,
null
);
return
;
}
if
(
dataBean
.
getSplitStatus
()
==
1
)
{
mPresenter
.
showSplitTableDialog
(
dataBean
.
getId
());
}
else
{
//獲取餐檯狀態
mPresenter
.
getTable
(
dataBean
);
}
//獲取餐檯狀態
// mPresenter.getTable(dataBean.getId());
break
;
case
TableActionConstant
.
skyorder_mode_5
:
break
;
default
:
if
(
dataBean
.
getSplitStatus
()
==
1
)
{
mPresenter
.
showSplitTableDialog
(
dataBean
.
getId
());
}
else
{
mPresenter
.
openTable
(
dataBean
.
getId
(),
null
);
}
break
;
boolean
doAction
=
mPresenter
.
doTableAction
(
dataBean
);
if
(!
doAction
)
{
if
(
dataBean
.
getSplitStatus
()
==
1
)
{
mPresenter
.
showSplitTableDialog
(
dataBean
.
getId
());
}
else
{
mPresenter
.
openTable
(
dataBean
.
getId
(),
null
);
}
}
}
...
...
@@ -351,59 +310,30 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
}
@Override
public
void
setCurrentOperatType
(
int
type
)
{
mPresenter
.
setCurrentChooseOperatType
(
type
);
public
void
setCurrentTableAction
(
TableAction
action
)
{
btn_cancel_operat
.
setVisibility
(
View
.
VISIBLE
);
ll_table_operat_content
.
setVisibility
(
View
.
VISIBLE
);
rv_bottom_function
.
setVisibility
(
View
.
INVISIBLE
);
//转台不需要过滤
if
(
mPresenter
.
getCurrentChooseOperatType
()
!=
TableActionConstant
.
move_table_4
)
{
//根据操作类型过滤一遍餐台
mPresenter
.
filterTableByOperatType
();
}
setTableActionTitle
();
setTableActionTitle
(
action
);
}
@Override
public
void
setTableActionTitle
()
{
switch
(
mPresenter
.
getCurrentChooseOperatType
())
{
case
TableActionConstant
.
splite_table_1
:
tv_operat_hint
.
setText
(
"請選擇檯號"
);
tv_operat_content
.
setText
(
""
);
mTopBar
.
setTitle
(
"分檯"
);
break
;
case
TableActionConstant
.
print_parper_2
:
tv_operat_hint
.
setText
(
"請選擇檯號"
);
tv_operat_content
.
setText
(
""
);
mTopBar
.
setTitle
(
"上菜紙"
);
break
;
case
TableActionConstant
.
init_table_3
:
tv_operat_hint
.
setText
(
"請選擇需要重置的檯號"
);
tv_operat_content
.
setText
(
""
);
mTopBar
.
setTitle
(
"重置檯號"
);
break
;
case
TableActionConstant
.
move_table_4
:
tv_operat_hint
.
setText
(
"請選擇檯號"
);
tv_operat_content
.
setText
(
""
);
mTopBar
.
setTitle
(
"轉檯"
);
break
;
case
TableActionConstant
.
skyorder_mode_5
:
break
;
}
public
void
setTableActionTitle
(
TableAction
action
)
{
mTopBar
.
setTitle
(
action
.
getActionTitle
());
tv_table_action_hint
.
setText
(
action
.
getActionHint
());
tv_table_action_content
.
setText
(
action
.
getActionContent
());
//移除back鍵
mTopBar
.
removeAllLeftViews
();
}
@Override
public
void
canceTableAction
()
{
mPresenter
.
setCurrentChooseOperatType
(-
1
);
btn_cancel_operat
.
setVisibility
(
View
.
INVISIBLE
);
ll_table_operat_content
.
setVisibility
(
View
.
INVISIBLE
);
rv_bottom_function
.
setVisibility
(
View
.
VISIBLE
);
tv_
operat
_hint
.
setText
(
""
);
tv_
operat
_content
.
setText
(
""
);
tv_
table_action
_hint
.
setText
(
""
);
tv_
table_action
_content
.
setText
(
""
);
mTopBar
.
setTitle
(
"餐檯模式"
);
//添加back鍵
mTopBar
.
removeAllLeftViews
();
...
...
@@ -414,7 +344,7 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
}
});
mPresenter
.
initTableActionParameter
();
mPresenter
.
filterTableBy
OperatType
();
mPresenter
.
filterTableBy
Action
();
}
@Override
...
...
@@ -423,13 +353,13 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
}
@Override
public
void
set
Operat
ContentText
(
String
contentText
)
{
tv_
operat
_content
.
setText
(
contentText
);
public
void
set
TableAction
ContentText
(
String
contentText
)
{
tv_
table_action
_content
.
setText
(
contentText
);
}
@Override
public
String
getOperatContentText
()
{
return
tv_
operat
_content
.
getText
().
toString
();
return
tv_
table_action
_content
.
getText
().
toString
();
}
@Override
...
...
table-module/src/main/res/layout/table_activity_table.xml
View file @
3639ad20
...
...
@@ -48,7 +48,7 @@
android:visibility=
"invisible"
>
<TextView
android:id=
"@+id/tv_
operat
_hint"
android:id=
"@+id/tv_
table_action
_hint"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
""
...
...
@@ -56,7 +56,7 @@
android:textSize=
"@dimen/font_normal3"
/>
<TextView
android:id=
"@+id/tv_
operat
_content"
android:id=
"@+id/tv_
table_action
_content"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/normal_space"
...
...
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