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
654437d8
Commit
654437d8
authored
Nov 04, 2020
by
宁斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改餐廳操作相關類
parent
fa4a065d
Hide whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
974 additions
and
367 deletions
+974
-367
base-module/src/main/java/com/gingersoft/gsa/cloud/base/application/GsaCloudApplication.java
+2
-0
base-module/src/main/java/com/gingersoft/gsa/cloud/constans/HttpsConstans.java
+7
-1
base-module/src/main/java/com/gingersoft/gsa/cloud/globalconfig/applyOptions/MyGlobalHttpHandler.java
+0
-1
base-module/src/main/res/drawable/selector_new_order_radio_bg.xml
+0
-3
config.gradle
+2
-2
database-module/src/main/java/com/gingersoft/gsa/cloud/database/bean/Discount.java
+10
-1
delivery_pick_module/src/main/java/com/gingersoft/gsa/delivery_pick_mode/model/viewModel/PageViewModel.kt
+0
-1
order-base/src/main/java/com/gingersoft/gsa/cloud/base/order/bean/OrderBean.java
+6
-8
order-base/src/main/java/com/gingersoft/gsa/cloud/base/order/cart/ShoppingCart.java
+1
-1
order-base/src/main/java/com/gingersoft/gsa/cloud/base/order/commodity/MealCommodity.java
+0
-3
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/contract/MealStandContract.java
+1
-1
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/contract/OrderContentContract.java
+1
-1
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/contract/TableContract.java
+4
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/MealStandModel.java
+7
-53
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/OrderContentModel.java
+8
-6
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/TableModel.java
+26
-3
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/bean/FoodSummary.java
+15
-3
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/constant/SkyOrderConstant.java
+15
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/service/TableService.java
+6
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/MoveTableAction.java
+5
-1
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/OnNetworkCallbackListener.java
+15
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/PrintServingPaperAction.java
+86
-3
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/PrintSkyOrderAction.java
+76
-3
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/ResetTableAction.java
+11
-10
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/SplitTableAction.java
+7
-1
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/TableAction.java
+20
-12
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/utils/MathUtils.java
+34
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/utils/MealConditionFilterUtils.java
+102
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/BaseOrderPresenter.java
+0
-6
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/MealStandPresenter.java
+7
-4
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/OrderContentPresenter.java
+7
-5
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/TablePresenter.java
+65
-111
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/MealStandActivity.java
+0
-6
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/TableActivity.java
+13
-9
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/FoodSummaryAdapter.java
+56
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/widget/SkyOrderDialog.java
+285
-69
table-module/src/main/res/layout/table_dialog_skyorder.xml
+5
-2
table-module/src/main/res/layout/table_input_skyorder_people_number.xml
+15
-14
table-module/src/main/res/layout/table_item_food_summary.xml
+23
-0
table-module/src/main/res/layout/table_item_skyorder.xml
+15
-19
table-module/src/main/res/layout/table_item_skyorder_meal_lenght.xml
+14
-0
table-module/src/main/res/layout/table_item_table_bottom.xml
+2
-4
table-module/src/main/res/mipmap-hdpi/table_skyorder_qrcode.png
+0
-0
No files found.
base-module/src/main/java/com/gingersoft/gsa/cloud/base/application/GsaCloudApplication.java
View file @
654437d8
...
@@ -238,6 +238,8 @@ public class GsaCloudApplication extends BaseApplication {
...
@@ -238,6 +238,8 @@ public class GsaCloudApplication extends BaseApplication {
RetrofitUrlManager
.
getInstance
().
putDomain
(
"ricepon_cloud_gsa"
,
HttpsConstans
.
ricepon_cloud_gsa
);
RetrofitUrlManager
.
getInstance
().
putDomain
(
"ricepon_cloud_gsa"
,
HttpsConstans
.
ricepon_cloud_gsa
);
//61177
//61177
RetrofitUrlManager
.
getInstance
().
putDomain
(
"ricepon_member"
,
HttpsConstans
.
RICEPON_MEMBER_61177
);
RetrofitUrlManager
.
getInstance
().
putDomain
(
"ricepon_member"
,
HttpsConstans
.
RICEPON_MEMBER_61177
);
//餐廳模塊請求地址
RetrofitUrlManager
.
getInstance
().
putDomain
(
"ricepon_restaurant"
,
HttpsConstans
.
ROOT_SERVER_ADDRESS_FORMAL_RESTAURANT
);
}
}
private
void
initPrint
()
{
private
void
initPrint
()
{
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/constans/HttpsConstans.java
View file @
654437d8
...
@@ -39,7 +39,8 @@ public class HttpsConstans {
...
@@ -39,7 +39,8 @@ public class HttpsConstans {
private
static
String
HTTP_ADDRESS_URL_HK
=
"http://a.ricepon.com:58201"
;
//香港測試
private
static
String
HTTP_ADDRESS_URL_HK
=
"http://a.ricepon.com:58201"
;
//香港測試
private
static
String
HTTP_ADDRESS_URL_PRE
=
"http://prf-m.ricepon.com/"
;
//預發佈
private
static
String
HTTP_ADDRESS_URL_PRE
=
"http://prf-m.ricepon.com/"
;
//預發佈
public
static
String
CLOUD_GSA_API_PATH
=
"/ricepon-cloud-gsa/api/"
;
//路徑
public
static
String
CLOUD_GSA_API_PATH
=
"/ricepon-cloud-gsa/api/"
;
//雲端GSA路徑
public
static
String
RESTAURANT_API_PATH
=
"/ricepon-restaurant/api/"
;
//餐廳模塊路徑
public
static
String
ROOT_SERVER_YOU_CHANG_HK
=
"http://192.168.1.142:9012/api/"
;
//友常本地
public
static
String
ROOT_SERVER_YOU_CHANG_HK
=
"http://192.168.1.142:9012/api/"
;
//友常本地
public
static
String
ROOT_SERVER_ZHI_WANG_HK
=
"http://192.168.1.169:9012/api/"
;
//世維本地
public
static
String
ROOT_SERVER_ZHI_WANG_HK
=
"http://192.168.1.169:9012/api/"
;
//世維本地
...
@@ -97,6 +98,8 @@ public class HttpsConstans {
...
@@ -97,6 +98,8 @@ public class HttpsConstans {
//默認url,配置這個值修改環境
//默認url,配置這個值修改環境
public
static
String
ROOT_SERVER_ADDRESS_FORMAL
=
HTTP_ADDRESS_URL_FORMAL
+
CLOUD_GSA_API_PATH
;
public
static
String
ROOT_SERVER_ADDRESS_FORMAL
=
HTTP_ADDRESS_URL_FORMAL
+
CLOUD_GSA_API_PATH
;
public
static
String
ROOT_SERVER_ADDRESS_FORMAL_RESTAURANT
=
HTTP_ADDRESS_URL_FORMAL
+
RESTAURANT_API_PATH
;
public
static
String
ROOT_SERVER
=
HTTP_ADDRESS_URL_FORMAL
;
public
static
String
ROOT_SERVER
=
HTTP_ADDRESS_URL_FORMAL
;
//修改這個值,配置外賣接單環境
//修改這個值,配置外賣接單環境
...
@@ -128,6 +131,7 @@ public class HttpsConstans {
...
@@ -128,6 +131,7 @@ public class HttpsConstans {
_SERVER_ADDRESS
=
HTTP_ADDRESS_URL_FORMAL
+
WECHAR_REPORT_PATH
;
_SERVER_ADDRESS
=
HTTP_ADDRESS_URL_FORMAL
+
WECHAR_REPORT_PATH
;
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL
=
HTTP_ADDRESS_URL_FORMAL
;
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL
=
HTTP_ADDRESS_URL_FORMAL
;
ROOT_SERVER_ADDRESS_FORMAL
=
HTTP_ADDRESS_URL_FORMAL
+
CLOUD_GSA_API_PATH
;
ROOT_SERVER_ADDRESS_FORMAL
=
HTTP_ADDRESS_URL_FORMAL
+
CLOUD_GSA_API_PATH
;
ROOT_SERVER_ADDRESS_FORMAL_RESTAURANT
=
HTTP_ADDRESS_URL_FORMAL
+
RESTAURANT_API_PATH
;
ROOT_URL
=
ROOT_FORMAL_URL
;
ROOT_URL
=
ROOT_FORMAL_URL
;
REPORT_SERVER_ADDRESS
=
REPORT_FORMAL_ADDRESS
+
REPORT_PATH
;
REPORT_SERVER_ADDRESS
=
REPORT_FORMAL_ADDRESS
+
REPORT_PATH
;
WECHAR_REPORT_SERVER_ADDRESS
=
WECHAR_REPORT_FORMAL_ADDRESS
+
WECHAR_REPORT_PATH
;
//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
WECHAR_REPORT_SERVER_ADDRESS
=
WECHAR_REPORT_FORMAL_ADDRESS
+
WECHAR_REPORT_PATH
;
//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
...
@@ -140,6 +144,7 @@ public class HttpsConstans {
...
@@ -140,6 +144,7 @@ public class HttpsConstans {
_SERVER_ADDRESS
=
WECHAR_REPORT_TEST_ADDRESS
+
WECHAR_REPORT_PATH
;
_SERVER_ADDRESS
=
WECHAR_REPORT_TEST_ADDRESS
+
WECHAR_REPORT_PATH
;
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL
=
REPORT_TEST_ADDRESS
;
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL
=
REPORT_TEST_ADDRESS
;
ROOT_SERVER_ADDRESS_FORMAL
=
HTTP_ADDRESS_URL_HK
+
CLOUD_GSA_API_PATH
;
ROOT_SERVER_ADDRESS_FORMAL
=
HTTP_ADDRESS_URL_HK
+
CLOUD_GSA_API_PATH
;
ROOT_SERVER_ADDRESS_FORMAL_RESTAURANT
=
HTTP_ADDRESS_URL_HK
+
RESTAURANT_API_PATH
;
ROOT_URL
=
ROOT_HK_TEST_URL
;
ROOT_URL
=
ROOT_HK_TEST_URL
;
REPORT_SERVER_ADDRESS
=
REPORT_TEST_ADDRESS
+
REPORT_PATH
;
REPORT_SERVER_ADDRESS
=
REPORT_TEST_ADDRESS
+
REPORT_PATH
;
WECHAR_REPORT_SERVER_ADDRESS
=
WECHAR_REPORT_TEST_ADDRESS
+
WECHAR_REPORT_PATH
;
//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
WECHAR_REPORT_SERVER_ADDRESS
=
WECHAR_REPORT_TEST_ADDRESS
+
WECHAR_REPORT_PATH
;
//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
...
@@ -152,6 +157,7 @@ public class HttpsConstans {
...
@@ -152,6 +157,7 @@ public class HttpsConstans {
_SERVER_ADDRESS
=
HTTP_ADDRESS_URL_PRE
+
WECHAR_REPORT_PATH
;
_SERVER_ADDRESS
=
HTTP_ADDRESS_URL_PRE
+
WECHAR_REPORT_PATH
;
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL
=
HTTP_ADDRESS_URL_PRE
;
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL
=
HTTP_ADDRESS_URL_PRE
;
ROOT_SERVER_ADDRESS_FORMAL
=
HTTP_ADDRESS_URL_PRE
+
CLOUD_GSA_API_PATH
;
ROOT_SERVER_ADDRESS_FORMAL
=
HTTP_ADDRESS_URL_PRE
+
CLOUD_GSA_API_PATH
;
ROOT_SERVER_ADDRESS_FORMAL_RESTAURANT
=
HTTP_ADDRESS_URL_PRE
+
RESTAURANT_API_PATH
;
ROOT_URL
=
HTTP_ADDRESS_URL_PRE
;
ROOT_URL
=
HTTP_ADDRESS_URL_PRE
;
REPORT_SERVER_ADDRESS
=
HTTP_ADDRESS_URL_PRE
+
REPORT_PATH
;
REPORT_SERVER_ADDRESS
=
HTTP_ADDRESS_URL_PRE
+
REPORT_PATH
;
WECHAR_REPORT_SERVER_ADDRESS
=
HTTP_ADDRESS_URL_PRE
+
WECHAR_REPORT_PATH
;
WECHAR_REPORT_SERVER_ADDRESS
=
HTTP_ADDRESS_URL_PRE
+
WECHAR_REPORT_PATH
;
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/globalconfig/applyOptions/MyGlobalHttpHandler.java
View file @
654437d8
...
@@ -43,7 +43,6 @@ public class MyGlobalHttpHandler implements GlobalHttpHandler {
...
@@ -43,7 +43,6 @@ public class MyGlobalHttpHandler implements GlobalHttpHandler {
Headers
headers
=
request
.
headers
();
Headers
headers
=
request
.
headers
();
for
(
int
i
=
0
;
i
<
headers
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
headers
.
size
();
i
++)
{
builder
.
set
(
headers
.
name
(
i
),
headers
.
value
(
i
));
builder
.
set
(
headers
.
name
(
i
),
headers
.
value
(
i
));
}
}
if
(
GsaCloudApplication
.
isLogin
){
if
(
GsaCloudApplication
.
isLogin
){
builder
.
set
(
"token"
,
token
);
builder
.
set
(
"token"
,
token
);
...
...
base-module/src/main/res/drawable/selector_new_order_radio_bg.xml
View file @
654437d8
...
@@ -4,6 +4,4 @@
...
@@ -4,6 +4,4 @@
<item
android:drawable=
"@drawable/shape_delivery_item_btn_normal"
/>
<item
android:drawable=
"@drawable/shape_delivery_item_btn_normal"
/>
</selector>
</selector>
\ No newline at end of file
config.gradle
View file @
654437d8
...
@@ -7,8 +7,8 @@ ext {
...
@@ -7,8 +7,8 @@ ext {
targetSdkVersion
:
29
,
targetSdkVersion
:
29
,
//正式版: 1.0.3 3
//正式版: 1.0.3 3
//內部測試版:1.2.0 20
//內部測試版:1.2.0 20
versionCode
:
1
0
,
versionCode
:
1
1
,
versionName
:
"1.1.
0
"
versionName
:
"1.1.
1
"
]
]
version
=
[
version
=
[
...
...
database-module/src/main/java/com/gingersoft/gsa/cloud/database/bean/Discount.java
View file @
654437d8
...
@@ -48,9 +48,13 @@ public class Discount {
...
@@ -48,9 +48,13 @@ public class Discount {
public
static
final
byte
DISCOUNT_TYPE_KEYBOARD
=
3
;
public
static
final
byte
DISCOUNT_TYPE_KEYBOARD
=
3
;
public
static
final
byte
DISCOUNT_TYPE_FREE_SERVICE_CHARGE
=
4
;
public
static
final
byte
DISCOUNT_TYPE_FREE_SERVICE_CHARGE
=
4
;
/**
/**
* 折扣可使用范围#0:食品;1:账单;
* 折扣可使用范围#0:食品;1:账单;
2:全部;
*/
*/
private
String
discountType
;
private
String
discountType
;
public
static
final
byte
discount_scope_commodity
=
0
;
public
static
final
byte
discount_scope_bill
=
1
;
public
static
final
byte
discount_scope_ALL
=
2
;
/**
/**
* 状态#0:启用;1:禁用;
* 状态#0:启用;1:禁用;
*/
*/
...
@@ -75,6 +79,11 @@ public class Discount {
...
@@ -75,6 +79,11 @@ public class Discount {
* 落單類型 0:餐檯模式,1:外賣模式,2:外送模式,3:自取模式
* 落單類型 0:餐檯模式,1:外賣模式,2:外送模式,3:自取模式
*/
*/
private
String
placeOrderType
;
private
String
placeOrderType
;
public
static
final
byte
ORDER_TYPE_MEAL_STAND
=
0
;
public
static
final
byte
ORDER_TYPE_TAKEAWAY
=
1
;
public
static
final
byte
ORDER_TYPE_DELIVERY
=
2
;
public
static
final
byte
ORDER_TYPE_SELF_COLLECTION
=
3
;
/**
/**
* 折扣上限
* 折扣上限
*/
*/
...
...
delivery_pick_module/src/main/java/com/gingersoft/gsa/delivery_pick_mode/model/viewModel/PageViewModel.kt
View file @
654437d8
...
@@ -2,7 +2,6 @@ package com.gingersoft.gsa.delivery_pick_mode.model.viewModel
...
@@ -2,7 +2,6 @@ package com.gingersoft.gsa.delivery_pick_mode.model.viewModel
import
android.app.Dialog
import
android.app.Dialog
import
android.content.Context
import
android.content.Context
import
android.util.Log
import
android.view.Gravity
import
android.view.Gravity
import
android.view.WindowManager
import
android.view.WindowManager
import
android.widget.TextView
import
android.widget.TextView
...
...
order-base/src/main/java/com/gingersoft/gsa/cloud/base/order/bean/OrderBean.java
View file @
654437d8
...
@@ -147,7 +147,9 @@ public class OrderBean {
...
@@ -147,7 +147,9 @@ public class OrderBean {
private
Long
id
;
private
Long
id
;
private
String
productName
;
private
String
productName
;
private
long
productId
;
private
long
productId
;
//單價
/**
* 單價
*/
private
double
price
;
private
double
price
;
private
double
lunchboxPrice
;
private
double
lunchboxPrice
;
private
int
number
;
private
int
number
;
...
@@ -173,12 +175,12 @@ public class OrderBean {
...
@@ -173,12 +175,12 @@ public class OrderBean {
private
Long
discountId
;
private
Long
discountId
;
/**折扣實體*/
/**折扣實體*/
private
RestaurantDiscountVO
restaurantDiscountVO
;
private
RestaurantDiscountVO
restaurantDiscountVO
;
/**
/**
* 是否参与
折扣
#0:不參與;1:參與;
* 是否参与
服務費
#0:不參與;1:參與;
**/
**/
private
byte
scAble
=
1
;
private
byte
scAble
=
1
;
/**
/**
* 額外食品加分
* 額外食品加分
*/
*/
...
@@ -341,10 +343,6 @@ public class OrderBean {
...
@@ -341,10 +343,6 @@ public class OrderBean {
return
restaurantDiscountVO
;
return
restaurantDiscountVO
;
}
}
public
void
setRestaurantDiscountVO
(
RestaurantDiscountVO
restaurantDiscountVO
)
{
this
.
restaurantDiscountVO
=
restaurantDiscountVO
;
}
public
byte
getScAble
()
{
public
byte
getScAble
()
{
return
scAble
;
return
scAble
;
}
}
...
...
order-base/src/main/java/com/gingersoft/gsa/cloud/base/order/cart/ShoppingCart.java
View file @
654437d8
...
@@ -45,7 +45,7 @@ public class ShoppingCart {
...
@@ -45,7 +45,7 @@ public class ShoppingCart {
/**
/**
* 賬單項列表
* 賬單項列表
*
*
* @see
CopyOnWriteArrayList 賬單計算放在子線程中保證同步問題使用CopyOnWriteArrayList
* @see
*/
*/
protected
List
<
BillItem
>
billItemList
=
new
ArrayList
<>();
protected
List
<
BillItem
>
billItemList
=
new
ArrayList
<>();
/**
/**
...
...
order-base/src/main/java/com/gingersoft/gsa/cloud/base/order/commodity/MealCommodity.java
View file @
654437d8
...
@@ -2,7 +2,6 @@ package com.gingersoft.gsa.cloud.base.order.commodity;
...
@@ -2,7 +2,6 @@ package com.gingersoft.gsa.cloud.base.order.commodity;
import
com.gingersoft.gsa.cloud.base.order.bean.OrderBean
;
import
com.gingersoft.gsa.cloud.base.order.bean.OrderBean
;
import
com.gingersoft.gsa.cloud.base.order.bean.discount.OrderDiscount
;
import
com.gingersoft.gsa.cloud.base.order.discount.NomalDiscount
;
import
com.gingersoft.gsa.cloud.base.order.discount.NomalDiscount
;
import
com.gingersoft.gsa.cloud.base.order.order.BaseOrder
;
import
com.gingersoft.gsa.cloud.base.order.order.BaseOrder
;
import
com.gingersoft.gsa.cloud.base.order.order.DoshokuOrder
;
import
com.gingersoft.gsa.cloud.base.order.order.DoshokuOrder
;
...
@@ -363,8 +362,6 @@ public class MealCommodity implements Commodity {
...
@@ -363,8 +362,6 @@ public class MealCommodity implements Commodity {
return
mealCommodityList
;
return
mealCommodityList
;
}
}
//PLU可输入子项
//食品数量支持小数 例如1.25
private
static
Discount
getDiscountItem
(
OrderBean
.
OrderDetailsBean
.
RestaurantDiscountVO
discountBean
)
{
private
static
Discount
getDiscountItem
(
OrderBean
.
OrderDetailsBean
.
RestaurantDiscountVO
discountBean
)
{
Discount
discount
=
new
Discount
();
Discount
discount
=
new
Discount
();
discount
.
setId
(
discountBean
.
getId
());
discount
.
setId
(
discountBean
.
getId
());
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/contract/MealStandContract.java
View file @
654437d8
...
@@ -149,6 +149,6 @@ public interface MealStandContract {
...
@@ -149,6 +149,6 @@ public interface MealStandContract {
List
<
FoodModifier
>
queryDB_FoodModifierList
(
long
fid
);
List
<
FoodModifier
>
queryDB_FoodModifierList
(
long
fid
);
List
<
Discount
>
queryDB_DiscountList
(
String
discountType
);
List
<
Discount
>
queryDB_DiscountList
(
byte
discountScope
,
byte
discountType
);
}
}
}
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/contract/OrderContentContract.java
View file @
654437d8
...
@@ -73,7 +73,7 @@ public interface OrderContentContract {
...
@@ -73,7 +73,7 @@ public interface OrderContentContract {
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface
Model
extends
BaseOrderContract
.
Model
{
interface
Model
extends
BaseOrderContract
.
Model
{
List
<
Discount
>
queryDB_DiscountList
(
String
discountType
);
List
<
Discount
>
queryDB_DiscountList
(
byte
discountScope
,
byte
discountType
);
Observable
<
BaseOrderRespose
>
createOrder
(
RequestBody
requestBody
);
Observable
<
BaseOrderRespose
>
createOrder
(
RequestBody
requestBody
);
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/contract/TableContract.java
View file @
654437d8
...
@@ -65,6 +65,8 @@ public interface TableContract {
...
@@ -65,6 +65,8 @@ public interface TableContract {
void
startMealStandActivity
();
void
startMealStandActivity
();
void
setBottomFunctionVisibility
(
boolean
show
);
void
setBottomFunctionVisibility
(
boolean
show
);
void
setLockVisibility
(
boolean
show
);
}
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
...
@@ -89,5 +91,7 @@ public interface TableContract {
...
@@ -89,5 +91,7 @@ public interface TableContract {
Observable
<
BaseResult
>
getSplitTables
(
int
tableId
);
Observable
<
BaseResult
>
getSplitTables
(
int
tableId
);
Observable
<
BaseResult
>
splitTable
(
int
tableId
);
Observable
<
BaseResult
>
splitTable
(
int
tableId
);
Observable
<
BaseResult
>
getFoodSummarys
(
int
restaurantId
,
boolean
isDefault
,
byte
businessType
);
}
}
}
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/MealStandModel.java
View file @
654437d8
...
@@ -21,6 +21,7 @@ import com.gingersoft.gsa.cloud.table.mvp.model.bean.FoodReason;
...
@@ -21,6 +21,7 @@ import com.gingersoft.gsa.cloud.table.mvp.model.bean.FoodReason;
import
com.gingersoft.gsa.cloud.table.mvp.model.service.MealService
;
import
com.gingersoft.gsa.cloud.table.mvp.model.service.MealService
;
import
com.gingersoft.gsa.cloud.table.mvp.model.service.MemberService
;
import
com.gingersoft.gsa.cloud.table.mvp.model.service.MemberService
;
import
com.gingersoft.gsa.cloud.table.mvp.model.service.OrderPayService
;
import
com.gingersoft.gsa.cloud.table.mvp.model.service.OrderPayService
;
import
com.gingersoft.gsa.cloud.table.mvp.model.utils.MealConditionFilterUtils
;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.jess.arms.integration.IRepositoryManager
;
import
com.jess.arms.integration.IRepositoryManager
;
...
@@ -67,52 +68,6 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model
...
@@ -67,52 +68,6 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model
this
.
mApplication
=
null
;
this
.
mApplication
=
null
;
}
}
/**
* 過濾食品條件
* @param foodList
* @param summary
* @return
*/
public
List
<
Food
>
foodConditionFilter
(
List
<
Food
>
foodList
,
int
summary
)
{
String
strSummary
=
String
.
valueOf
(
summary
);
List
<
Food
>
newFoodList
=
new
ArrayList
<>();
for
(
Food
food
:
foodList
)
{
String
foodSummary
=
food
.
getFoodSummary
();
if
(!
TextUtils
.
isEmpty
(
foodSummary
))
{
String
[]
summarys
=
foodSummary
.
split
(
","
);
for
(
String
item
:
summarys
)
{
if
(
item
.
equals
(
strSummary
))
{
newFoodList
.
add
(
food
);
}
}
}
}
return
newFoodList
;
}
/**
* 過濾套餐食品條件
* @param comboItemList
* @param summary
* @return
*/
public
List
<
ComboItem
>
comboConditionFilter
(
List
<
ComboItem
>
comboItemList
,
int
summary
)
{
String
strSummary
=
String
.
valueOf
(
summary
);
List
<
ComboItem
>
newComboItemList
=
new
ArrayList
<>();
for
(
ComboItem
comboItem
:
comboItemList
)
{
String
foodSummary
=
comboItem
.
getFoodSummary
();
if
(!
TextUtils
.
isEmpty
(
foodSummary
))
{
String
[]
summarys
=
foodSummary
.
split
(
","
);
for
(
String
item
:
summarys
)
{
if
(
item
.
equals
(
strSummary
))
{
newComboItemList
.
add
(
comboItem
);
}
}
}
}
return
newComboItemList
;
}
@Override
@Override
public
List
<
Food
>
queryDB_AllFoodList
()
{
public
List
<
Food
>
queryDB_AllFoodList
()
{
FoodDaoUtils
foodDaoUtils
=
new
FoodDaoUtils
(
mApplication
);
FoodDaoUtils
foodDaoUtils
=
new
FoodDaoUtils
(
mApplication
);
...
@@ -124,8 +79,7 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model
...
@@ -124,8 +79,7 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model
public
List
<
Food
>
queryDB_FoodGroupList
(
int
foodSummary
)
{
public
List
<
Food
>
queryDB_FoodGroupList
(
int
foodSummary
)
{
FoodDaoUtils
foodDaoUtils
=
new
FoodDaoUtils
(
mApplication
);
FoodDaoUtils
foodDaoUtils
=
new
FoodDaoUtils
(
mApplication
);
List
<
Food
>
foods
=
foodDaoUtils
.
queryFoodGroupByQueryBuilder
(
foodSummary
);
List
<
Food
>
foods
=
foodDaoUtils
.
queryFoodGroupByQueryBuilder
(
foodSummary
);
// return foods;
return
MealConditionFilterUtils
.
foodConditionFilter
(
foods
,
foodSummary
);
return
foodConditionFilter
(
foods
,
foodSummary
);
}
}
@Override
@Override
...
@@ -133,7 +87,7 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model
...
@@ -133,7 +87,7 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model
FoodDaoUtils
foodDaoUtils
=
new
FoodDaoUtils
(
mApplication
);
FoodDaoUtils
foodDaoUtils
=
new
FoodDaoUtils
(
mApplication
);
List
<
Food
>
foods
=
foodDaoUtils
.
queryFoodByQueryBuilder
(
parentId
,
foodSummary
);
List
<
Food
>
foods
=
foodDaoUtils
.
queryFoodByQueryBuilder
(
parentId
,
foodSummary
);
// return foods;
// return foods;
return
foodConditionFilter
(
foods
,
foodSummary
);
return
MealConditionFilterUtils
.
foodConditionFilter
(
foods
,
foodSummary
);
}
}
...
@@ -147,8 +101,7 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model
...
@@ -147,8 +101,7 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model
public
List
<
ComboItem
>
queryDB_ComboList
(
long
fid
,
int
foodSummary
)
{
public
List
<
ComboItem
>
queryDB_ComboList
(
long
fid
,
int
foodSummary
)
{
ComboItemDaoUtils
comboItemDao
=
new
ComboItemDaoUtils
(
mApplication
);
ComboItemDaoUtils
comboItemDao
=
new
ComboItemDaoUtils
(
mApplication
);
List
<
ComboItem
>
foodCombos
=
comboItemDao
.
queryComboItemsByFidQueryBuilder
(
fid
,
foodSummary
);
List
<
ComboItem
>
foodCombos
=
comboItemDao
.
queryComboItemsByFidQueryBuilder
(
fid
,
foodSummary
);
// return foodCombos;
return
MealConditionFilterUtils
.
comboConditionFilter
(
foodCombos
,
foodSummary
);
return
comboConditionFilter
(
foodCombos
,
foodSummary
);
}
}
@Override
@Override
...
@@ -163,9 +116,10 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model
...
@@ -163,9 +116,10 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model
}
}
@Override
@Override
public
List
<
Discount
>
queryDB_DiscountList
(
String
discountType
)
{
public
List
<
Discount
>
queryDB_DiscountList
(
byte
discountScope
,
byte
discountType
)
{
DiscountDaoUtils
discountDaoUtils
=
new
DiscountDaoUtils
(
mApplication
);
DiscountDaoUtils
discountDaoUtils
=
new
DiscountDaoUtils
(
mApplication
);
return
discountDaoUtils
.
queryDiscountByQueryBuilder
();
List
<
Discount
>
discountList
=
discountDaoUtils
.
queryDiscountByQueryBuilder
();
return
MealConditionFilterUtils
.
discountConditionFilter
(
discountList
,
discountScope
,
discountType
);
}
}
@Override
@Override
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/OrderContentModel.java
View file @
654437d8
...
@@ -14,6 +14,7 @@ import com.gingersoft.gsa.cloud.table.mvp.model.service.OrderPayService;
...
@@ -14,6 +14,7 @@ import com.gingersoft.gsa.cloud.table.mvp.model.service.OrderPayService;
import
com.gingersoft.gsa.cloud.table.mvp.model.service.TableService
;
import
com.gingersoft.gsa.cloud.table.mvp.model.service.TableService
;
import
com.gingersoft.gsa.cloud.database.bean.Discount
;
import
com.gingersoft.gsa.cloud.database.bean.Discount
;
import
com.gingersoft.gsa.cloud.database.utils.DiscountDaoUtils
;
import
com.gingersoft.gsa.cloud.database.utils.DiscountDaoUtils
;
import
com.gingersoft.gsa.cloud.table.mvp.model.utils.MealConditionFilterUtils
;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
import
com.google.gson.internal.LinkedTreeMap
;
import
com.google.gson.internal.LinkedTreeMap
;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.jess.arms.di.scope.ActivityScope
;
...
@@ -71,18 +72,19 @@ public class OrderContentModel extends BaseModel implements OrderContentContract
...
@@ -71,18 +72,19 @@ public class OrderContentModel extends BaseModel implements OrderContentContract
}
}
@Override
@Override
public
List
<
Discount
>
queryDB_DiscountList
(
String
discountType
)
{
DiscountDaoUtils
discountDaoUtils
=
new
DiscountDaoUtils
(
mApplication
);
return
discountDaoUtils
.
queryDiscountByQueryBuilder
();
}
@Override
public
Observable
<
BaseOrderRespose
>
loadOrder
(
long
orderId
)
{
public
Observable
<
BaseOrderRespose
>
loadOrder
(
long
orderId
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
MealService
.
class
)
return
mRepositoryManager
.
obtainRetrofitService
(
MealService
.
class
)
.
loadOrder
(
orderId
);
.
loadOrder
(
orderId
);
}
}
@Override
@Override
public
List
<
Discount
>
queryDB_DiscountList
(
byte
discountScope
,
byte
discountType
)
{
DiscountDaoUtils
discountDaoUtils
=
new
DiscountDaoUtils
(
mApplication
);
List
<
Discount
>
discountList
=
discountDaoUtils
.
queryDiscountByQueryBuilder
();
return
MealConditionFilterUtils
.
discountConditionFilter
(
discountList
,
discountScope
,
discountType
);
}
@Override
public
Observable
<
BaseOrderRespose
>
createOrder
(
RequestBody
requestBody
)
{
public
Observable
<
BaseOrderRespose
>
createOrder
(
RequestBody
requestBody
)
{
Observable
ob
=
mRepositoryManager
.
obtainRetrofitService
(
MealService
.
class
)
Observable
ob
=
mRepositoryManager
.
obtainRetrofitService
(
MealService
.
class
)
.
createOrder
(
requestBody
)
.
createOrder
(
requestBody
)
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/TableModel.java
View file @
654437d8
...
@@ -23,6 +23,10 @@ import java.util.List;
...
@@ -23,6 +23,10 @@ import java.util.List;
import
javax.inject.Inject
;
import
javax.inject.Inject
;
import
io.reactivex.Observable
;
import
io.reactivex.Observable
;
import
io.reactivex.ObservableSource
;
import
io.reactivex.Observer
;
import
io.reactivex.functions.Consumer
;
import
io.reactivex.functions.Function
;
import
okhttp3.RequestBody
;
import
okhttp3.RequestBody
;
...
@@ -74,13 +78,25 @@ public class TableModel extends BaseModel implements TableContract.Model {
...
@@ -74,13 +78,25 @@ public class TableModel extends BaseModel implements TableContract.Model {
@Override
@Override
public
Observable
<
TableBean
>
getTables
(
int
restaurantId
)
{
public
Observable
<
TableBean
>
getTables
(
int
restaurantId
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
TableService
.
class
)
return
mRepositoryManager
.
obtainRetrofitService
(
TableService
.
class
)
.
getTables
(
restaurantId
);
.
getTables
(
restaurantId
)
.
doOnError
(
new
Consumer
<
Throwable
>()
{
@Override
public
void
accept
(
Throwable
throwable
)
throws
Exception
{
return
;
}
})
.
flatMap
(
new
Function
<
TableBean
,
ObservableSource
<
TableBean
>>()
{
@Override
public
ObservableSource
<
TableBean
>
apply
(
TableBean
tableBean
)
throws
Exception
{
return
Observable
.
just
(
tableBean
);
}
});
}
}
@Override
@Override
public
Observable
<
TableDetail
>
getTable
(
int
tableId
,
String
tableNumber
)
{
public
Observable
<
TableDetail
>
getTable
(
int
tableId
,
String
tableNumber
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
TableService
.
class
)
return
mRepositoryManager
.
obtainRetrofitService
(
TableService
.
class
)
.
getTable
(
tableId
,
tableNumber
);
.
getTable
(
tableId
,
tableNumber
);
}
}
@Override
@Override
...
@@ -119,5 +135,11 @@ public class TableModel extends BaseModel implements TableContract.Model {
...
@@ -119,5 +135,11 @@ public class TableModel extends BaseModel implements TableContract.Model {
.
splitTable
(
tableId
);
.
splitTable
(
tableId
);
}
}
@Override
public
Observable
<
BaseResult
>
getFoodSummarys
(
int
restaurantId
,
boolean
isDefault
,
byte
businessType
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
TableService
.
class
)
.
getFoodSummarys
(
restaurantId
,
isDefault
,
businessType
);
}
}
}
\ No newline at end of file
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/bean/
Meal
Summary.java
→
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/bean/
Food
Summary.java
View file @
654437d8
...
@@ -7,14 +7,26 @@ import lombok.Setter;
...
@@ -7,14 +7,26 @@ import lombok.Setter;
* @author : bin
* @author : bin
* @create date: 2020-11-03
* @create date: 2020-11-03
* @update date: 2020-11-03
* @update date: 2020-11-03
* @description:
* @description:
餐種
*/
*/
@Getter
@Getter
@Setter
@Setter
public
class
MealSummary
{
public
class
FoodSummary
{
private
int
id
;
private
int
restaurantId
;
private
String
name
;
private
String
name
;
private
boolean
isDefault
;
/**
* 自定義字段
*/
private
boolean
selected
=
false
;
/**
* 用餐時長
*/
private
int
mealLength
=
120
;
public
static
final
byte
BUSINESS_TYPE_TAKEWAY
=
1
;
public
static
final
byte
BUSINESS_TYPE_SKYORDER
=
2
;
}
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/constant/SkyOrderConstant.java
0 → 100644
View file @
654437d8
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
constant
;
/**
* @author : bin
* @create date: 2020-11-04
* @update date: 2020-11-04
* @description:
*/
public
interface
SkyOrderConstant
{
String
check_status
=
"check_status"
;
String
delivery_time_hour
=
"delivery_time_hour"
;
String
delivery_time_minute
=
"delivery_time_minute"
;
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/service/TableService.java
View file @
654437d8
...
@@ -4,11 +4,13 @@ import com.gingersoft.gsa.cloud.base.common.bean.BaseResult;
...
@@ -4,11 +4,13 @@ import com.gingersoft.gsa.cloud.base.common.bean.BaseResult;
import
com.gingersoft.gsa.cloud.base.table.bean.TableBean
;
import
com.gingersoft.gsa.cloud.base.table.bean.TableBean
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.BaseOrderRespose
;
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.bean.TableDetail
;
import
io.reactivex.Observable
;
import
io.reactivex.Observable
;
import
me.jessyan.retrofiturlmanager.RetrofitUrlManager
;
import
me.jessyan.retrofiturlmanager.RetrofitUrlManager
;
import
okhttp3.RequestBody
;
import
okhttp3.RequestBody
;
import
retrofit2.http.Body
;
import
retrofit2.http.Body
;
import
retrofit2.http.GET
;
import
retrofit2.http.GET
;
import
retrofit2.http.Headers
;
import
retrofit2.http.POST
;
import
retrofit2.http.POST
;
import
retrofit2.http.Query
;
import
retrofit2.http.Query
;
...
@@ -41,4 +43,8 @@ public interface TableService {
...
@@ -41,4 +43,8 @@ public interface TableService {
@GET
(
"restaurantTable/getSplitTable"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
@GET
(
"restaurantTable/getSplitTable"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
BaseResult
>
splitTable
(
@Query
(
"tableId"
)
int
tableId
);
Observable
<
BaseResult
>
splitTable
(
@Query
(
"tableId"
)
int
tableId
);
@Headers
({
"Domain-Name: ricepon_restaurant"
})
@GET
(
"summary/getSummaryBusinessList"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
BaseResult
>
getFoodSummarys
(
@Query
(
"restaurantId"
)
int
restaurantId
,
@Query
(
"isDefault"
)
boolean
isDefault
,
@Query
(
"businessType"
)
byte
businessType
);
}
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/MoveTableAction.java
View file @
654437d8
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
table
.
action
;
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
table
.
action
;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.Context
;
import
com.gingersoft.gsa.cloud.base.table.bean.TableBean
;
import
com.gingersoft.gsa.cloud.base.table.bean.TableBean
;
...
@@ -14,7 +15,7 @@ import com.gingersoft.gsa.cloud.base.table.bean.TableBean;
...
@@ -14,7 +15,7 @@ import com.gingersoft.gsa.cloud.base.table.bean.TableBean;
*/
*/
public
class
MoveTableAction
extends
TableAction
{
public
class
MoveTableAction
extends
TableAction
{
public
MoveTableAction
(
Context
context
)
{
public
MoveTableAction
(
Activity
context
)
{
super
(
context
,
"轉台"
,
"請選擇檯號"
,
""
);
super
(
context
,
"轉台"
,
"請選擇檯號"
,
""
);
}
}
...
@@ -33,5 +34,8 @@ public class MoveTableAction extends TableAction {
...
@@ -33,5 +34,8 @@ public class MoveTableAction extends TableAction {
return
true
;
return
true
;
}
}
@Override
public
void
destroy
()
{
}
}
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/OnNetworkCallbackListener.java
0 → 100644
View file @
654437d8
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
table
.
action
;
/**
* @author : bin
* @create date: 2020-11-04
* @update date: 2020-11-04
* @description: 操作網絡回調結果
*/
public
interface
OnNetworkCallbackListener
<
T
>
{
void
onResult
(
T
t
);
void
onError
(
Throwable
t
);
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/PrintServingPaperAction.java
View file @
654437d8
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
table
.
action
;
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
table
.
action
;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.Context
;
import
com.billy.cc.core.component.CC
;
import
com.gingersoft.gsa.cloud.base.order.bean.OrderBean
;
import
com.gingersoft.gsa.cloud.base.order.commodity.OrderDetail
;
import
com.gingersoft.gsa.cloud.base.order.order.DoshokuOrder
;
import
com.gingersoft.gsa.cloud.base.table.bean.TableBean
;
import
com.gingersoft.gsa.cloud.base.table.bean.TableBean
;
import
com.gingersoft.gsa.cloud.constans.PrintConstans
;
import
com.gingersoft.gsa.cloud.table.R
;
import
com.gingersoft.gsa.cloud.table.R
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.BaseOrderRespose
;
import
com.gingersoft.gsa.cloud.table.mvp.model.utils.OrderAssemblyUtil
;
import
com.gingersoft.gsa.cloud.table.mvp.presenter.TablePresenter
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.CommonTipDialog
;
import
com.qmuiteam.qmui.widget.dialog.QMUIDialog
;
import
com.qmuiteam.qmui.widget.dialog.QMUIDialog
;
import
com.qmuiteam.qmui.widget.dialog.QMUIDialogAction
;
import
com.qmuiteam.qmui.widget.dialog.QMUIDialogAction
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
/**
* 作者:ELEGANT_BIN
* 作者:ELEGANT_BIN
* 版本:1.6.0
* 版本:1.6.0
...
@@ -15,9 +29,11 @@ import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
...
@@ -15,9 +29,11 @@ import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
*/
*/
public
class
PrintServingPaperAction
extends
TableAction
{
public
class
PrintServingPaperAction
extends
TableAction
{
private
TablePresenter
mTablePresenter
;
public
PrintServingPaperAction
(
Context
context
)
{
public
PrintServingPaperAction
(
Activity
context
,
TablePresenter
tablePresenter
)
{
super
(
context
,
"上菜紙"
,
"請選擇檯號"
,
""
);
super
(
context
,
"上菜紙"
,
"請選擇檯號"
,
""
);
this
.
mTablePresenter
=
tablePresenter
;
}
}
@Override
@Override
...
@@ -35,15 +51,65 @@ public class PrintServingPaperAction extends TableAction {
...
@@ -35,15 +51,65 @@ public class PrintServingPaperAction extends TableAction {
return
dataBean
.
getStatus
()
!=
0
;
return
dataBean
.
getStatus
()
!=
0
;
}
}
public
void
showActionTipDialog
(
TableBean
.
DataBean
dataBean
)
{
@Override
public
void
destroy
()
{
mTablePresenter
=
null
;
}
public
void
showActionTipDialog
(
TableBean
.
DataBean
tableBean
)
{
QMUIDialog
.
MessageDialogBuilder
dialogBuilder
=
new
QMUIDialog
.
MessageDialogBuilder
(
mContext
);
QMUIDialog
.
MessageDialogBuilder
dialogBuilder
=
new
QMUIDialog
.
MessageDialogBuilder
(
mContext
);
dialogBuilder
.
setTitleIcon
(
R
.
drawable
.
qmui_icon_dialog_doubt
);
dialogBuilder
.
setTitleIcon
(
R
.
drawable
.
qmui_icon_dialog_doubt
);
dialogBuilder
.
setMessage
(
"是否確認打印"
);
dialogBuilder
.
setMessage
(
"是否確認打印"
);
dialogBuilder
.
addAction
(
0
,
"確認"
,
QMUIDialogAction
.
ACTION_PROP_NEGATIVE
,
new
QMUIDialogAction
.
ActionListener
()
{
dialogBuilder
.
addAction
(
0
,
"確認"
,
QMUIDialogAction
.
ACTION_PROP_NEGATIVE
,
new
QMUIDialogAction
.
ActionListener
()
{
@Override
@Override
public
void
onClick
(
QMUIDialog
dialog
,
int
index
)
{
public
void
onClick
(
QMUIDialog
dialog
,
int
index
)
{
mTablePresenter
.
loadOrderToPrintParper
(
tableBean
,
new
OnNetworkCallbackListener
<
BaseOrderRespose
>()
{
@Override
public
void
onResult
(
BaseOrderRespose
respose
)
{
if
(
respose
.
isSuccess
())
{
DoshokuOrder
doshokuOrder
=
DoshokuOrder
.
getInstance
();
doshokuOrder
.
setOpenTableInfo
(
new
TableBean
.
DataBean
());
TableBean
.
DataBean
tableInfo
=
doshokuOrder
.
getOpenTableInfo
();
tableInfo
.
setPerson
(
0
);
OrderBean
orderBean
=
respose
.
getData
();
if
(
orderBean
!=
null
&&
respose
.
getData
().
getOrderDetails
()
!=
null
)
{
if
(
respose
.
getData
().
getCreateTime
()
!=
null
&&
tableBean
!=
null
)
{
//將開台時間設置為訂單創建時間
tableBean
.
setCreateTime
(
respose
.
getData
().
getCreateTime
());
}
tableInfo
.
setPerson
(
orderBean
.
getPerson
());
List
<
OrderBean
.
OrderDetailsBean
>
orderDetailsBeans
=
respose
.
getData
().
getOrderDetails
();
//緩存訂單信息
doshokuOrder
.
setOrderPlaced
(
new
OrderBean
(
orderBean
));
//緩存食品信息
List
<
OrderDetail
>
orderDetailList
=
OrderAssemblyUtil
.
assemblyOrder
(
OrderDetail
.
orderTransOrderDetails
(
orderDetailsBeans
));
doshokuOrder
.
getShoppingCart
().
setOrderCommodityList
(
orderDetailList
);
}
else
{
doshokuOrder
.
setOrderPlaced
(
null
);
doshokuOrder
.
getShoppingCart
().
setOrderCommodityList
(
new
ArrayList
<>());
}
doshokuOrder
.
setOpenTableInfo
(
tableBean
);
printParper
();
}
else
{
CommonTipDialog
.
showSurpisedDialog
(
mContext
,
respose
.
getErrMsg
(),
null
,
null
,
null
,
null
,
null
);
}
}
@Override
public
void
onError
(
Throwable
t
)
{
}
});
dialog
.
dismiss
();
dialog
.
dismiss
();
loadOrderToPrint
(
dataBean
);
}
}
});
});
dialogBuilder
.
addAction
(
"取消"
,
new
QMUIDialogAction
.
ActionListener
()
{
dialogBuilder
.
addAction
(
"取消"
,
new
QMUIDialogAction
.
ActionListener
()
{
...
@@ -55,4 +121,21 @@ public class PrintServingPaperAction extends TableAction {
...
@@ -55,4 +121,21 @@ public class PrintServingPaperAction extends TableAction {
});
});
dialogBuilder
.
create
(
R
.
style
.
MyDialogTheme2
).
show
();
dialogBuilder
.
create
(
R
.
style
.
MyDialogTheme2
).
show
();
}
}
/**
* 打印上菜紙
*/
private
void
printParper
()
{
CC
.
obtainBuilder
(
"Component.Print"
)
.
setActionName
(
"printActivity"
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
PrintConstans
.
PRINT_SERVE
)
.
build
()
.
callAsyncCallbackOnMainThread
((
cc
,
result
)
->
{
//清空賬單數據
DoshokuOrder
.
getInstance
().
initialization
();
cancel
();
});
}
}
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/PrintSkyOrderAction.java
View file @
654437d8
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
table
.
action
;
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
table
.
action
;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.Context
;
import
com.gingersoft.gsa.cloud.base.common.bean.BaseResult
;
import
com.gingersoft.gsa.cloud.base.table.bean.TableBean
;
import
com.gingersoft.gsa.cloud.base.table.bean.TableBean
;
import
com.gingersoft.gsa.cloud.base.utils.JsonUtils
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.FoodSummary
;
import
com.gingersoft.gsa.cloud.table.mvp.presenter.TablePresenter
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.widget.SkyOrderDialog
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.BaseRetryDialog
;
import
java.util.List
;
/**
/**
...
@@ -12,16 +21,19 @@ import com.gingersoft.gsa.cloud.base.table.bean.TableBean;
...
@@ -12,16 +21,19 @@ import com.gingersoft.gsa.cloud.base.table.bean.TableBean;
* 修订历史:2020-09-23
* 修订历史:2020-09-23
* 描述:餐檯模式-打印skyorder碼{@link com.gingersoft.gsa.cloud.table.mvp.ui.activity.TableActivity}
* 描述:餐檯模式-打印skyorder碼{@link com.gingersoft.gsa.cloud.table.mvp.ui.activity.TableActivity}
*/
*/
public
class
PrintSkyOrderAction
extends
TableAction
{
public
class
PrintSkyOrderAction
extends
TableAction
{
private
TablePresenter
mTablePresenter
;
private
SkyOrderDialog
mSkyOrderDialog
;
public
PrintSkyOrderAction
(
Context
context
)
{
public
PrintSkyOrderAction
(
Activity
context
,
TablePresenter
tablePresenter
)
{
super
(
context
,
"打印skyorder"
,
"請選擇檯號"
,
""
);
super
(
context
,
"打印skyorder"
,
"請選擇檯號"
,
""
);
this
.
mTablePresenter
=
tablePresenter
;
}
}
@Override
@Override
public
void
action
(
TableBean
.
DataBean
dataBean
)
{
public
void
action
(
TableBean
.
DataBean
dataBean
)
{
showSkyOrderDialog
();
}
}
@Override
@Override
...
@@ -29,4 +41,65 @@ public class PrintSkyOrderAction extends TableAction {
...
@@ -29,4 +41,65 @@ public class PrintSkyOrderAction extends TableAction {
return
true
;
return
true
;
}
}
@Override
public
void
destroy
()
{
mTablePresenter
=
null
;
if
(
mSkyOrderDialog
!=
null
)
{
mSkyOrderDialog
.
dismiss
();
mSkyOrderDialog
=
null
;
}
}
public
void
showSkyOrderDialog
()
{
if
(
mSkyOrderDialog
==
null
)
{
mSkyOrderDialog
=
new
SkyOrderDialog
(
mContext
).
build
();
mSkyOrderDialog
.
setOnRetryListener
(
new
BaseRetryDialog
.
OnRetryListener
()
{
@Override
public
void
onRetryClick
()
{
getFoodSummarys
();
}
});
mSkyOrderDialog
.
setCallbackListener
(
new
SkyOrderDialog
.
OnCallbackListener
()
{
@Override
public
void
lockState
(
boolean
state
)
{
skyOrderLockStateAction
(
state
);
}
@Override
public
void
onPrint
()
{
}
});
getFoodSummarys
();
}
mSkyOrderDialog
.
show
();
}
private
void
getFoodSummarys
(){
mTablePresenter
.
getFoodSummarys
(
new
OnNetworkCallbackListener
<
BaseResult
>()
{
@Override
public
void
onResult
(
BaseResult
result
)
{
if
(
result
.
isSuccess
())
{
if
(
result
.
getData
()
!=
null
)
{
List
<
FoodSummary
>
foodSummaryList
=
JsonUtils
.
parseArray
(
result
.
getData
(),
FoodSummary
.
class
);
mSkyOrderDialog
.
updateFoodSummaryList
(
foodSummaryList
);
}
else
{
mSkyOrderDialog
.
showEmptyView
(
true
,
0
,
null
);
}
}
else
{
mSkyOrderDialog
.
showEmptyView
(
false
,
0
,
null
);
}
mSkyOrderDialog
.
setProgressVisibility
(
false
);
}
@Override
public
void
onError
(
Throwable
t
)
{
mSkyOrderDialog
.
showEmptyView
(
false
,
0
,
t
);
mSkyOrderDialog
.
setProgressVisibility
(
false
);
}
});
mSkyOrderDialog
.
setProgressVisibility
(
true
);
}
}
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/ResetTableAction.java
View file @
654437d8
...
@@ -18,21 +18,18 @@ import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
...
@@ -18,21 +18,18 @@ import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
*/
*/
public
class
ResetTableAction
extends
TableAction
{
public
class
ResetTableAction
extends
TableAction
{
public
ResetTableAction
(
Context
context
)
{
public
ResetTableAction
(
Activity
context
)
{
super
(
context
,
"重置餐檯"
,
"請選擇需要重置的檯號"
,
""
);
super
(
context
,
"重置餐檯"
,
"請選擇需要重置的檯號"
,
""
);
}
}
@Override
@Override
public
void
action
(
TableBean
.
DataBean
dataBean
)
{
public
void
action
(
TableBean
.
DataBean
dataBean
)
{
new
SkyOrderDialog
((
Activity
)
mContext
)
setOperatContentText
(
dataBean
.
getTableName
());
.
build
()
if
(
dataBean
.
getSplitStatus
()
==
1
)
{
.
show
();
showSplitTableDialogAction
();
// setOperatContentText(dataBean.getTableName());
}
else
{
// if (dataBean.getSplitStatus() == 1) {
showActionTipDialog
(
dataBean
);
// showSplitTableDialogAction();
}
// } else {
// showActionTipDialog(dataBean);
// }
}
}
@Override
@Override
...
@@ -40,6 +37,10 @@ public class ResetTableAction extends TableAction {
...
@@ -40,6 +37,10 @@ public class ResetTableAction extends TableAction {
return
dataBean
.
getUseStatus
()
==
1
||
dataBean
.
getSplitStatus
()
==
1
;
return
dataBean
.
getUseStatus
()
==
1
||
dataBean
.
getSplitStatus
()
==
1
;
}
}
@Override
public
void
destroy
()
{
}
public
void
showActionTipDialog
(
TableBean
.
DataBean
dataBean
)
{
public
void
showActionTipDialog
(
TableBean
.
DataBean
dataBean
)
{
QMUIDialog
.
MessageDialogBuilder
dialogBuilder
=
new
QMUIDialog
.
MessageDialogBuilder
(
mContext
);
QMUIDialog
.
MessageDialogBuilder
dialogBuilder
=
new
QMUIDialog
.
MessageDialogBuilder
(
mContext
);
dialogBuilder
.
setTitleIcon
(
R
.
drawable
.
qmui_icon_dialog_doubt
);
dialogBuilder
.
setTitleIcon
(
R
.
drawable
.
qmui_icon_dialog_doubt
);
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/SplitTableAction.java
View file @
654437d8
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
table
.
action
;
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
table
.
action
;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.Context
;
import
com.gingersoft.gsa.cloud.base.table.bean.TableBean
;
import
com.gingersoft.gsa.cloud.base.table.bean.TableBean
;
...
@@ -13,7 +14,7 @@ import com.gingersoft.gsa.cloud.base.table.bean.TableBean;
...
@@ -13,7 +14,7 @@ import com.gingersoft.gsa.cloud.base.table.bean.TableBean;
*/
*/
public
class
SplitTableAction
extends
TableAction
{
public
class
SplitTableAction
extends
TableAction
{
public
SplitTableAction
(
Context
context
)
{
public
SplitTableAction
(
Activity
context
)
{
super
(
context
,
"分檯"
,
"請選擇檯號"
,
""
);
super
(
context
,
"分檯"
,
"請選擇檯號"
,
""
);
}
}
...
@@ -28,4 +29,9 @@ public class SplitTableAction extends TableAction {
...
@@ -28,4 +29,9 @@ public class SplitTableAction extends TableAction {
return
dataBean
.
getStatus
()
!=
0
;
return
dataBean
.
getStatus
()
!=
0
;
}
}
@Override
public
void
destroy
()
{
}
}
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/TableAction.java
View file @
654437d8
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
table
.
action
;
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
table
.
action
;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.Context
;
import
com.gingersoft.gsa.cloud.base.table.bean.TableBean
;
import
com.gingersoft.gsa.cloud.base.table.bean.TableBean
;
import
com.gingersoft.gsa.cloud.patterns.Strategy
;
import
com.gingersoft.gsa.cloud.patterns.Strategy
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.widget.SkyOrderDialog
;
import
lombok.Data
;
import
lombok.Data
;
/**
/**
...
@@ -15,25 +19,29 @@ import lombok.Data;
...
@@ -15,25 +19,29 @@ import lombok.Data;
@Data
@Data
public
abstract
class
TableAction
implements
Strategy
<
TableBean
.
DataBean
>
{
public
abstract
class
TableAction
implements
Strategy
<
TableBean
.
DataBean
>
{
p
ublic
Context
mContext
;
p
rotected
Activity
mContext
;
protected
String
actionTitle
;
protected
String
actionTitle
;
protected
String
actionHint
;
protected
String
actionHint
;
protected
String
actionContent
;
protected
String
actionContent
;
public
TableAction
(
Context
context
)
{
public
TableAction
(
Activity
context
)
{
this
.
mContext
=
context
;
this
.
mContext
=
context
;
}
}
public
TableAction
(
Context
context
,
String
actionTitle
,
String
actionHint
,
String
actionContent
)
{
public
TableAction
(
Activity
context
,
String
actionTitle
,
String
actionHint
,
String
actionContent
)
{
this
.
mContext
=
context
;
this
.
mContext
=
context
;
this
.
actionTitle
=
actionTitle
;
this
.
actionTitle
=
actionTitle
;
this
.
actionHint
=
actionHint
;
this
.
actionHint
=
actionHint
;
this
.
actionContent
=
actionContent
;
this
.
actionContent
=
actionContent
;
}
}
/**不同餐檯操作,對餐檯的過濾條件*/
/**
* 不同餐檯操作,對餐檯的過濾條件
*/
public
abstract
boolean
filterTableCondition
(
TableBean
.
DataBean
dataBean
);
public
abstract
boolean
filterTableCondition
(
TableBean
.
DataBean
dataBean
);
public
abstract
void
destroy
();
protected
void
setOperatContentText
(
String
content
)
{
protected
void
setOperatContentText
(
String
content
)
{
if
(
actionListener
!=
null
)
{
if
(
actionListener
!=
null
)
{
actionListener
.
setOperatContentText
(
content
);
actionListener
.
setOperatContentText
(
content
);
...
@@ -52,12 +60,6 @@ public abstract class TableAction implements Strategy<TableBean.DataBean> {
...
@@ -52,12 +60,6 @@ public abstract class TableAction implements Strategy<TableBean.DataBean> {
}
}
}
}
protected
void
loadOrderToPrint
(
TableBean
.
DataBean
tableBean
)
{
if
(
actionListener
!=
null
)
{
actionListener
.
loadOrderToPrint
(
tableBean
);
}
}
protected
void
showSplitTableDialogAction
()
{
protected
void
showSplitTableDialogAction
()
{
if
(
actionListener
!=
null
)
{
if
(
actionListener
!=
null
)
{
actionListener
.
showSplitTableDialogAction
();
actionListener
.
showSplitTableDialogAction
();
...
@@ -70,6 +72,12 @@ public abstract class TableAction implements Strategy<TableBean.DataBean> {
...
@@ -70,6 +72,12 @@ public abstract class TableAction implements Strategy<TableBean.DataBean> {
}
}
}
}
protected
void
skyOrderLockStateAction
(
boolean
state
)
{
if
(
actionListener
!=
null
)
{
actionListener
.
skyOrderLockState
(
state
);
}
}
public
void
cancel
()
{
public
void
cancel
()
{
if
(
actionListener
!=
null
)
{
if
(
actionListener
!=
null
)
{
actionListener
.
cancel
();
actionListener
.
cancel
();
...
@@ -89,12 +97,12 @@ public abstract class TableAction implements Strategy<TableBean.DataBean> {
...
@@ -89,12 +97,12 @@ public abstract class TableAction implements Strategy<TableBean.DataBean> {
void
moveTable
(
TableBean
.
DataBean
tableBean
);
void
moveTable
(
TableBean
.
DataBean
tableBean
);
void
loadOrderToPrint
(
TableBean
.
DataBean
tableBean
);
void
splitTableAction
(
TableBean
.
DataBean
tableBean
);
void
splitTableAction
(
TableBean
.
DataBean
tableBean
);
void
showSplitTableDialogAction
();
void
showSplitTableDialogAction
();
void
skyOrderLockState
(
boolean
state
);
void
cancel
();
void
cancel
();
}
}
}
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/utils/MathUtils.java
0 → 100644
View file @
654437d8
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
utils
;
import
java.util.List
;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
* 创建日期:2019/3/14
* 修订历史:2019/3/14
* 描述:
*/
public
class
MathUtils
{
/**
* 在一組数据内,找相近的数
*
* @param list
* @param targetNum 接近的数字
*/
public
static
int
findRecentNum
(
List
<
Integer
>
list
,
int
targetNum
)
{
// 差值实始化
int
diffNum
=
Math
.
abs
(
list
.
get
(
0
)
-
targetNum
);
// 最终结果
int
result
=
list
.
get
(
0
);
for
(
Integer
integer
:
list
)
{
int
diffNumTemp
=
Math
.
abs
(
integer
-
targetNum
);
if
(
diffNumTemp
<
diffNum
)
{
diffNum
=
diffNumTemp
;
result
=
integer
;
}
}
return
result
;
}
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/utils/MealConditionFilterUtils.java
0 → 100644
View file @
654437d8
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
utils
;
import
android.text.TextUtils
;
import
com.gingersoft.gsa.cloud.database.bean.ComboItem
;
import
com.gingersoft.gsa.cloud.database.bean.Discount
;
import
com.gingersoft.gsa.cloud.database.bean.Food
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author : bin
* @create date: 2020-11-04
* @update date: 2020-11-04
* @description:餐牌相關數據條件過濾
*/
public
class
MealConditionFilterUtils
{
/**
* 過濾食品條件
*
* @param foodList
* @param summary
* @return
*/
public
static
List
<
Food
>
foodConditionFilter
(
List
<
Food
>
foodList
,
int
summary
)
{
String
strSummary
=
String
.
valueOf
(
summary
);
List
<
Food
>
newFoodList
=
new
ArrayList
<>();
for
(
Food
food
:
foodList
)
{
String
foodSummary
=
food
.
getFoodSummary
();
if
(!
TextUtils
.
isEmpty
(
foodSummary
))
{
String
[]
summarys
=
foodSummary
.
split
(
","
);
for
(
String
item
:
summarys
)
{
if
(
item
.
equals
(
strSummary
))
{
newFoodList
.
add
(
food
);
}
}
}
}
return
newFoodList
;
}
/**
* 過濾套餐食品條件
*
* @param comboItemList
* @param summary
* @return
*/
public
static
List
<
ComboItem
>
comboConditionFilter
(
List
<
ComboItem
>
comboItemList
,
int
summary
)
{
String
strSummary
=
String
.
valueOf
(
summary
);
List
<
ComboItem
>
newComboItemList
=
new
ArrayList
<>();
for
(
ComboItem
comboItem
:
comboItemList
)
{
String
foodSummary
=
comboItem
.
getFoodSummary
();
if
(!
TextUtils
.
isEmpty
(
foodSummary
))
{
String
[]
summarys
=
foodSummary
.
split
(
","
);
for
(
String
item
:
summarys
)
{
if
(
item
.
equals
(
strSummary
))
{
newComboItemList
.
add
(
comboItem
);
}
}
}
}
return
newComboItemList
;
}
/**
* 過濾折扣條件
*
* @param discountList
* @param discountScope 折扣可使用范围
* @param placeOrderType 落單類型
* @return
*/
public
static
List
<
Discount
>
discountConditionFilter
(
List
<
Discount
>
discountList
,
byte
discountScope
,
byte
placeOrderType
)
{
String
strScope
=
String
.
valueOf
(
discountScope
);
String
strType
=
String
.
valueOf
(
placeOrderType
);
Map
<
String
,
Discount
>
newDiscountMaps
=
new
HashMap
<>();
for
(
Discount
discount
:
discountList
)
{
newDiscountMaps
.
put
(
discount
.
getDiscountType
()
+
"_"
+
discount
.
getPlaceOrderType
(),
discount
);
}
List
<
Discount
>
newDiscountList
=
new
ArrayList
<>();
for
(
String
key
:
newDiscountMaps
.
keySet
())
{
String
[]
keys
=
key
.
split
(
"_"
);
if
(
keys
.
length
==
2
)
{
String
scopeKey
=
keys
[
0
];
String
typeKeFy
=
keys
[
1
];
boolean
withinRange
=
scopeKey
.
contains
(
String
.
valueOf
(
Discount
.
discount_scope_ALL
))
||
scopeKey
.
contains
(
strScope
);
if
(
withinRange
&&
typeKeFy
.
contains
(
strType
))
{
Discount
discount
=
newDiscountMaps
.
get
(
key
);
newDiscountList
.
add
(
discount
);
}
}
}
return
newDiscountList
;
}
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/BaseOrderPresenter.java
View file @
654437d8
...
@@ -2,7 +2,6 @@ package com.gingersoft.gsa.cloud.table.mvp.presenter;
...
@@ -2,7 +2,6 @@ package com.gingersoft.gsa.cloud.table.mvp.presenter;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.app.Application
;
import
android.app.Application
;
import
android.os.Looper
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.widget.TextView
;
import
android.widget.TextView
;
...
@@ -19,8 +18,6 @@ import com.gingersoft.gsa.cloud.base.order.billItem.DiscountItem;
...
@@ -19,8 +18,6 @@ import com.gingersoft.gsa.cloud.base.order.billItem.DiscountItem;
import
com.gingersoft.gsa.cloud.base.order.billItem.RoundingItem
;
import
com.gingersoft.gsa.cloud.base.order.billItem.RoundingItem
;
import
com.gingersoft.gsa.cloud.base.order.billItem.ServiceChargeItem
;
import
com.gingersoft.gsa.cloud.base.order.billItem.ServiceChargeItem
;
import
com.gingersoft.gsa.cloud.base.order.cart.ShoppingCart
;
import
com.gingersoft.gsa.cloud.base.order.cart.ShoppingCart
;
import
com.gingersoft.gsa.cloud.base.order.commodity.MealCommodity
;
import
com.gingersoft.gsa.cloud.base.order.discount.MultyDiscount
;
import
com.gingersoft.gsa.cloud.base.order.discount.NomalDiscount
;
import
com.gingersoft.gsa.cloud.base.order.discount.NomalDiscount
;
import
com.gingersoft.gsa.cloud.base.order.order.BaseOrder
;
import
com.gingersoft.gsa.cloud.base.order.order.BaseOrder
;
import
com.gingersoft.gsa.cloud.base.order.order.DoshokuOrder
;
import
com.gingersoft.gsa.cloud.base.order.order.DoshokuOrder
;
...
@@ -55,8 +52,6 @@ import java.util.ArrayList;
...
@@ -55,8 +52,6 @@ import java.util.ArrayList;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.concurrent.CopyOnWriteArrayList
;
import
java.util.logging.Handler
;
import
javax.inject.Inject
;
import
javax.inject.Inject
;
...
@@ -301,7 +296,6 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -301,7 +296,6 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
setOrderMealPasteDSMark
();
setOrderMealPasteDSMark
();
//計算折扣金額
//計算折扣金額
double
discountableMoney
=
getDiscountableAmount
();
double
discountableMoney
=
getDiscountableAmount
();
// if (discountableMoney > 0 && mShoppingCart.getMultyDiscountList().size() > 0) {
if
(
mShoppingCart
.
getMultyDiscountList
().
size
()
>
0
)
{
if
(
mShoppingCart
.
getMultyDiscountList
().
size
()
>
0
)
{
//調用折扣鏈進行計算
//調用折扣鏈進行計算
totalAmount
=
MoneyUtil
.
sub
(
totalAmount
,
mShoppingCart
.
calculateLinkedDiscounts
(
discountableMoney
));
totalAmount
=
MoneyUtil
.
sub
(
totalAmount
,
mShoppingCart
.
calculateLinkedDiscounts
(
discountableMoney
));
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/MealStandPresenter.java
View file @
654437d8
...
@@ -17,6 +17,7 @@ import com.gingersoft.gsa.cloud.base.utils.LanguageUtils;
...
@@ -17,6 +17,7 @@ import com.gingersoft.gsa.cloud.base.utils.LanguageUtils;
import
com.gingersoft.gsa.cloud.base.utils.MoneyUtil
;
import
com.gingersoft.gsa.cloud.base.utils.MoneyUtil
;
import
com.gingersoft.gsa.cloud.base.utils.RestaurantExpandInfoUtils
;
import
com.gingersoft.gsa.cloud.base.utils.RestaurantExpandInfoUtils
;
import
com.gingersoft.gsa.cloud.base.utils.gson.GsonUtils
;
import
com.gingersoft.gsa.cloud.base.utils.gson.GsonUtils
;
import
com.gingersoft.gsa.cloud.constans.FoodSummaryConstans
;
import
com.gingersoft.gsa.cloud.table.R
;
import
com.gingersoft.gsa.cloud.table.R
;
import
com.gingersoft.gsa.cloud.table.mvp.contract.MealStandContract
;
import
com.gingersoft.gsa.cloud.table.mvp.contract.MealStandContract
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.FoodReason
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.FoodReason
;
...
@@ -51,13 +52,11 @@ import com.jess.arms.integration.AppManager;
...
@@ -51,13 +52,11 @@ import com.jess.arms.integration.AppManager;
import
com.jess.arms.utils.RxLifecycleUtils
;
import
com.jess.arms.utils.RxLifecycleUtils
;
import
com.qmuiteam.qmui.widget.dialog.QMUIDialog
;
import
com.qmuiteam.qmui.widget.dialog.QMUIDialog
;
import
com.qmuiteam.qmui.widget.dialog.QMUIDialogAction
;
import
com.qmuiteam.qmui.widget.dialog.QMUIDialogAction
;
import
com.xuexiang.rxutil2.RxBindingUtils
;
import
org.simple.eventbus.Subscriber
;
import
org.simple.eventbus.Subscriber
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.concurrent.TimeUnit
;
import
javax.inject.Inject
;
import
javax.inject.Inject
;
...
@@ -68,7 +67,6 @@ import io.reactivex.Observer;
...
@@ -68,7 +67,6 @@ import io.reactivex.Observer;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.annotations.NonNull
;
import
io.reactivex.annotations.NonNull
;
import
io.reactivex.disposables.Disposable
;
import
io.reactivex.disposables.Disposable
;
import
io.reactivex.functions.Consumer
;
import
io.reactivex.schedulers.Schedulers
;
import
io.reactivex.schedulers.Schedulers
;
import
me.jessyan.rxerrorhandler.core.RxErrorHandler
;
import
me.jessyan.rxerrorhandler.core.RxErrorHandler
;
import
me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber
;
import
me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber
;
...
@@ -2051,7 +2049,12 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -2051,7 +2049,12 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
}
}
mCurrentOrderDetailBean
=
currentOrderBean
;
mCurrentOrderDetailBean
=
currentOrderBean
;
List
<
Discount
>
discountList
=
filterDiscountByType
(
mModel
.
queryDB_DiscountList
(
"0"
),
"0"
);
List
<
Discount
>
discountList
;
if
(
BaseOrder
.
isCurrentOrderType
(
FoodSummaryConstans
.
TAKEAWAY_TYPE
))
{
discountList
=
mModel
.
queryDB_DiscountList
(
Discount
.
discount_scope_commodity
,
Discount
.
ORDER_TYPE_TAKEAWAY
);
}
else
{
discountList
=
mModel
.
queryDB_DiscountList
(
Discount
.
discount_scope_commodity
,
Discount
.
ORDER_TYPE_MEAL_STAND
);
}
mDiscountList
.
clear
();
mDiscountList
.
clear
();
mDiscountList
.
addAll
(
discountList
);
mDiscountList
.
addAll
(
discountList
);
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/OrderContentPresenter.java
View file @
654437d8
...
@@ -53,27 +53,23 @@ import com.gingersoft.gsa.cloud.table.mvp.ui.widget.DiscountDialog;
...
@@ -53,27 +53,23 @@ import com.gingersoft.gsa.cloud.table.mvp.ui.widget.DiscountDialog;
import
com.gingersoft.gsa.cloud.table.mvp.ui.widget.SplitTableDialog
;
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.BaseRetryDialog
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.CommonTipDialog
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.CommonTipDialog
;
import
com.jakewharton.rxbinding2.view.RxView
;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.jess.arms.http.imageloader.ImageLoader
;
import
com.jess.arms.http.imageloader.ImageLoader
;
import
com.jess.arms.integration.AppManager
;
import
com.jess.arms.integration.AppManager
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.jess.arms.utils.RxLifecycleUtils
;
import
com.jess.arms.utils.RxLifecycleUtils
;
import
com.scwang.smartrefresh.layout.api.RefreshLayout
;
import
com.scwang.smartrefresh.layout.api.RefreshLayout
;
import
com.xuexiang.rxutil2.RxBindingUtils
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.List
;
import
java.util.concurrent.TimeUnit
;
import
javax.inject.Inject
;
import
javax.inject.Inject
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.annotations.NonNull
;
import
io.reactivex.annotations.NonNull
;
import
io.reactivex.disposables.Disposable
;
import
io.reactivex.disposables.Disposable
;
import
io.reactivex.functions.Consumer
;
import
io.reactivex.schedulers.Schedulers
;
import
io.reactivex.schedulers.Schedulers
;
import
me.jessyan.rxerrorhandler.core.RxErrorHandler
;
import
me.jessyan.rxerrorhandler.core.RxErrorHandler
;
import
me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber
;
import
me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber
;
...
@@ -780,7 +776,13 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
...
@@ -780,7 +776,13 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
}
}
});
});
}
}
List
<
Discount
>
discountList
=
filterDiscountByType
(
mModel
.
queryDB_DiscountList
(
"1"
),
"1"
);
List
<
Discount
>
discountList
;
if
(
BaseOrder
.
isCurrentOrderType
(
FoodSummaryConstans
.
TAKEAWAY_TYPE
))
{
discountList
=
mModel
.
queryDB_DiscountList
(
Discount
.
discount_scope_bill
,
Discount
.
ORDER_TYPE_TAKEAWAY
);
}
else
{
discountList
=
mModel
.
queryDB_DiscountList
(
Discount
.
discount_scope_bill
,
Discount
.
ORDER_TYPE_MEAL_STAND
);
}
mDiscountDialog
.
addItems
(
discountList
);
mDiscountDialog
.
addItems
(
discountList
);
mDiscountDialog
.
build
().
show
();
mDiscountDialog
.
build
().
show
();
}
}
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/TablePresenter.java
View file @
654437d8
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
presenter
;
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
presenter
;
import
android.app.Activity
;
import
android.app.Application
;
import
android.app.Application
;
import
android.content.Context
;
import
android.content.Context
;
import
android.os.CountDownTimer
;
import
android.os.CountDownTimer
;
...
@@ -15,13 +16,17 @@ import com.gingersoft.gsa.cloud.base.order.order.DoshokuOrder;
...
@@ -15,13 +16,17 @@ import com.gingersoft.gsa.cloud.base.order.order.DoshokuOrder;
import
com.gingersoft.gsa.cloud.base.table.bean.TableBean
;
import
com.gingersoft.gsa.cloud.base.table.bean.TableBean
;
import
com.gingersoft.gsa.cloud.base.table.bean.TableExtBean
;
import
com.gingersoft.gsa.cloud.base.table.bean.TableExtBean
;
import
com.gingersoft.gsa.cloud.base.utils.JsonUtils
;
import
com.gingersoft.gsa.cloud.base.utils.JsonUtils
;
import
com.gingersoft.gsa.cloud.base.utils.other.SPUtils
;
import
com.gingersoft.gsa.cloud.base.utils.time.TimeUtils
;
import
com.gingersoft.gsa.cloud.base.utils.time.TimeUtils
;
import
com.gingersoft.gsa.cloud.table.ComponentTable
;
import
com.gingersoft.gsa.cloud.table.ComponentTable
;
import
com.gingersoft.gsa.cloud.table.R
;
import
com.gingersoft.gsa.cloud.table.R
;
import
com.gingersoft.gsa.cloud.table.mvp.contract.TableContract
;
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.BaseOrderRespose
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.FoodSummary
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.TableDetail
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.TableDetail
;
import
com.gingersoft.gsa.cloud.table.mvp.model.constant.SkyOrderConstant
;
import
com.gingersoft.gsa.cloud.table.mvp.model.table.action.MoveTableAction
;
import
com.gingersoft.gsa.cloud.table.mvp.model.table.action.MoveTableAction
;
import
com.gingersoft.gsa.cloud.table.mvp.model.table.action.OnNetworkCallbackListener
;
import
com.gingersoft.gsa.cloud.table.mvp.model.table.action.PrintServingPaperAction
;
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.PrintSkyOrderAction
;
import
com.gingersoft.gsa.cloud.table.mvp.model.table.action.ResetTableAction
;
import
com.gingersoft.gsa.cloud.table.mvp.model.table.action.ResetTableAction
;
...
@@ -31,6 +36,7 @@ import com.gingersoft.gsa.cloud.table.mvp.model.utils.OrderAssemblyUtil;
...
@@ -31,6 +36,7 @@ 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.activity.TableActivity
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.adapter.BottomFunctionAdapter
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.adapter.BottomFunctionAdapter
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.widget.FlowLayout
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.widget.FlowLayout
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.widget.SkyOrderDialog
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.widget.SplitTableDialog
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.widget.SplitTableDialog
;
import
com.gingersoft.gsa.cloud.constans.GoldConstants
;
import
com.gingersoft.gsa.cloud.constans.GoldConstants
;
import
com.gingersoft.gsa.cloud.constans.PrintConstans
;
import
com.gingersoft.gsa.cloud.constans.PrintConstans
;
...
@@ -100,6 +106,10 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
...
@@ -100,6 +106,10 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
private
TableActivity
IActivity
;
private
TableActivity
IActivity
;
/**
/**
* 打印skyorder彈窗
*/
private
SkyOrderDialog
mSkyOrderDialog
;
/**
* 分檯弹窗
* 分檯弹窗
*/
*/
private
SplitTableDialog
mSplitTableDialog
;
private
SplitTableDialog
mSplitTableDialog
;
...
@@ -135,7 +145,7 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
...
@@ -135,7 +145,7 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
initGetTableTimer
();
initGetTableTimer
();
}
}
private
void
initTableActions
(
Context
context
,
List
<
Function
>
functions
)
{
private
void
initTableActions
(
Activity
context
,
List
<
Function
>
functions
)
{
for
(
Function
function
:
functions
)
{
for
(
Function
function
:
functions
)
{
if
(
function
.
getResUrl
().
endsWith
(
"init"
))
{
if
(
function
.
getResUrl
().
endsWith
(
"init"
))
{
mTableActions
.
add
(
new
ResetTableAction
(
context
));
mTableActions
.
add
(
new
ResetTableAction
(
context
));
...
@@ -144,11 +154,17 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
...
@@ -144,11 +154,17 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
}
else
if
(
function
.
getResUrl
().
endsWith
(
"splite"
))
{
}
else
if
(
function
.
getResUrl
().
endsWith
(
"splite"
))
{
mTableActions
.
add
(
new
SplitTableAction
(
context
));
mTableActions
.
add
(
new
SplitTableAction
(
context
));
}
else
if
(
function
.
getResUrl
().
endsWith
(
"parper"
))
{
}
else
if
(
function
.
getResUrl
().
endsWith
(
"parper"
))
{
mTableActions
.
add
(
new
PrintServingPaperAction
(
context
));
mTableActions
.
add
(
new
PrintServingPaperAction
(
context
,
this
));
}
}
// else if (function.getResUrl().endsWith("skyorder")) {
// mTableActions.add(new PrintSkyOrderAction(context));
// }
if
(
mTableActions
.
size
()
==
2
&&
function
.
getResUrl
().
endsWith
(
"skyorder"
))
{
if
(
mTableActions
.
size
()
==
2
&&
function
.
getResUrl
().
endsWith
(
"skyorder"
))
{
//將skyorder功能添加到中間
//將skyorder功能添加到中間
mTableActions
.
add
(
new
PrintSkyOrderAction
(
context
));
mTableActions
.
add
(
new
PrintSkyOrderAction
(
context
,
this
));
boolean
lockedCheckState
=
(
boolean
)
SPUtils
.
get
(
SkyOrderConstant
.
check_status
,
false
);
mRootView
.
setLockVisibility
(
lockedCheckState
);
}
}
}
}
}
}
...
@@ -160,6 +176,9 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
...
@@ -160,6 +176,9 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
this
.
mAppManager
=
null
;
this
.
mAppManager
=
null
;
this
.
mImageLoader
=
null
;
this
.
mImageLoader
=
null
;
this
.
mApplication
=
null
;
this
.
mApplication
=
null
;
for
(
TableAction
action
:
mTableActions
)
{
action
.
destroy
();
}
cancelTableTimer
();
cancelTableTimer
();
}
}
...
@@ -211,10 +230,10 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
...
@@ -211,10 +230,10 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
newFunction
.
setParentId
(
175
);
newFunction
.
setParentId
(
175
);
newFunction
.
setGroupId
(
5
);
newFunction
.
setGroupId
(
5
);
newFunction
.
setId
(
366
);
newFunction
.
setId
(
366
);
newFunction
.
setResName
(
""
);
newFunction
.
setResName
(
"
skyorder
"
);
newFunction
.
setIcRes
(
0
);
newFunction
.
setIcRes
(
0
);
newFunction
.
setStatus
(
0
);
newFunction
.
setStatus
(
0
);
newFunction
.
setResUrl
(
""
);
newFunction
.
setResUrl
(
"
skyorder
"
);
functions
.
add
(
newFunction
);
functions
.
add
(
newFunction
);
for
(
int
i
=
0
;
i
<
functions
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
functions
.
size
();
i
++)
{
...
@@ -225,7 +244,7 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
...
@@ -225,7 +244,7 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
addFuctions
=
true
;
addFuctions
=
true
;
}
}
}
}
Collections
.
swap
(
functions
,
2
,
4
);
Collections
.
swap
(
functions
,
2
,
4
);
if
(
addFuctions
)
{
if
(
addFuctions
)
{
mBottomFunctionList
.
addAll
(
functions
);
mBottomFunctionList
.
addAll
(
functions
);
mRootView
.
setBottomFunctionVisibility
(
true
);
mRootView
.
setBottomFunctionVisibility
(
true
);
...
@@ -318,7 +337,7 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
...
@@ -318,7 +337,7 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
});
});
}
}
public
void
loadOrderToPrintParper
(
TableBean
.
DataBean
tableBean
)
{
public
void
loadOrderToPrintParper
(
TableBean
.
DataBean
tableBean
,
OnNetworkCallbackListener
networkCallBackListener
)
{
if
(
tableBean
.
getOrderId
()
==
null
)
{
if
(
tableBean
.
getOrderId
()
==
null
)
{
return
;
return
;
}
}
...
@@ -333,59 +352,16 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
...
@@ -333,59 +352,16 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
@Override
@Override
public
void
onNext
(
@NonNull
BaseOrderRespose
respose
)
{
public
void
onNext
(
@NonNull
BaseOrderRespose
respose
)
{
if
(
respose
.
isSuccess
())
{
if
(
networkCallBackListener
!=
null
)
{
networkCallBackListener
.
onResult
(
respose
);
DoshokuOrder
doshokuOrder
=
DoshokuOrder
.
getInstance
();
TableBean
.
DataBean
tableInfo
=
doshokuOrder
.
getOpenTableInfo
();
tableInfo
.
setPerson
(
0
);
//設置當前開台數據1584427984728 1584428017196 1584428086282
// 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
)
{
//將開台時間設置為訂單創建時間
openTableBean
.
setCreateTime
(
respose
.
getData
().
getCreateTime
());
}
tableInfo
.
setPerson
(
orderBean
.
getPerson
());
List
<
OrderBean
.
OrderDetailsBean
>
orderDetailsBeans
=
respose
.
getData
().
getOrderDetails
();
//緩存訂單信息
doshokuOrder
.
setOrderPlaced
(
new
OrderBean
(
orderBean
));
//緩存食品信息
List
<
OrderDetail
>
orderDetailList
=
OrderAssemblyUtil
.
assemblyOrder
(
OrderDetail
.
orderTransOrderDetails
(
orderDetailsBeans
));
doshokuOrder
.
getShoppingCart
().
setOrderCommodityList
(
orderDetailList
);
}
else
{
doshokuOrder
.
setOrderPlaced
(
null
);
doshokuOrder
.
getShoppingCart
().
setOrderCommodityList
(
new
ArrayList
<>());
}
doshokuOrder
.
setOpenTableInfo
(
openTableBean
);
printParper
();
}
else
{
CommonTipDialog
.
showSurpisedDialog
(
IActivity
,
respose
.
getErrMsg
(),
null
,
null
,
null
,
null
,
null
);
}
}
}
}
/**
@Override
* 打印上菜紙
public
void
onError
(
Throwable
t
)
{
*/
if
(
networkCallBackListener
!=
null
)
{
private
void
printParper
()
{
networkCallBackListener
.
onError
(
t
);
CC
.
obtainBuilder
(
"Component.Print"
)
}
.
setActionName
(
"printActivity"
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
PrintConstans
.
PRINT_SERVE
)
.
build
()
.
callAsyncCallbackOnMainThread
((
cc
,
result
)
->
{
//清空賬單數據
DoshokuOrder
.
getInstance
().
initialization
();
mRootView
.
canceTableAction
();
});
}
}
});
});
}
}
...
@@ -461,56 +437,6 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
...
@@ -461,56 +437,6 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
}
else
{
}
else
{
CommonTipDialog
.
showSurpisedDialog
(
IActivity
,
respose
.
getErrMsg
(),
null
,
null
,
null
,
null
,
null
);
CommonTipDialog
.
showSurpisedDialog
(
IActivity
,
respose
.
getErrMsg
(),
null
,
null
,
null
,
null
,
null
);
}
}
// if (respose.isSuccess()) {
// //設置當前開台數據
// TableBean.DataBean openTableBean;
// if (tableExtBean != null) {
// openTableBean = tableExtBean;
// if (mSplitTableDialog != null) {
// mSplitTableDialog.closeDialog();
// }
// } else {
// openTableBean = getTableById(tableId);
// }
// OpenTableManage.getDefault().setPeopleNumber(0);
// OpenTableManage.getDefault().setPeopleNumber(openTableBean.getSeatCount());
//
// OrderBean orderBean = respose.getData();
// if (orderBean != null && respose.getData().getOrderDetails() != null) {
// if (respose.getData().getCreateTime() != null && openTableBean != null) {
// //將開台時間設置為訂單創建時間
// openTableBean.setCreateTime(TimeUtils.getFormatTime(respose.getData().getCreateTime(), TimeUtils.DEFAULT_DATE_FORMAT));
// }
// OpenTableManage.getDefault().setPeopleNumber(orderBean.getPerson());
//
// List<OrderBean.OrderDetailsBean> orderDetailsBeans = orderBean.getOrderDetails();
//
// setFoodPoints(orderDetailsBeans);
// //設置套餐topId
// setTopId(orderDetailsBeans);
// //緩存訂單信息
// MyOrderManage.getInstance().setOrderBean(new OrderBean(orderBean));
// //緩存食品信息
// List<OrderDetail> orderDetailList = OrderAssemblyUtil.assemblyOrder(OrderDetail.orderTransOrderDetails(orderDetailsBeans));
// MyOrderManage.getInstance().setOrderFoodList(orderDetailList);
//
// if (orderBean.getMemberInfo() != null) {
// //设置会员信息
// MyOrderManage.getInstance().setMemberInfo(orderBean.getMemberInfo());
// MyOrderManage.getInstance().setMemberUpdateStatus(true + "-" + true);
// }else {
// MyOrderManage.getInstance().setMemberUpdateStatus(false + "-" + false);
// }
// } else {
// MyOrderManage.getInstance().setOrderBean(null);
// MyOrderManage.getInstance().setOrderFoodList(new ArrayList<>());
// }
// OpenTableManage.getDefault().setTableBean(openTableBean);
// mRootView.startMealStandActivity();
// } else {
// CommonTipDialog.showSurpisedDialog(IActivity, respose.getErrMsg(), null, null, null, null, null);
// }
}
}
});
});
}
}
...
@@ -807,6 +733,33 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
...
@@ -807,6 +733,33 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
}
}
}
}
public
void
getFoodSummarys
(
OnNetworkCallbackListener
networkCallBackListener
)
{
int
restaurantId
=
GsaCloudApplication
.
getRestaurantId
();
byte
businessType
=
FoodSummary
.
BUSINESS_TYPE_SKYORDER
;
mModel
.
getFoodSummarys
(
restaurantId
,
false
,
businessType
)
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
BaseResult
>(
mErrorHandler
)
{
@Override
public
void
onNext
(
@NonNull
BaseResult
result
)
{
if
(
networkCallBackListener
!=
null
)
{
networkCallBackListener
.
onResult
(
result
);
}
}
@Override
public
void
onError
(
Throwable
t
)
{
if
(
networkCallBackListener
!=
null
)
{
networkCallBackListener
.
onError
(
t
);
}
}
});
}
/**
/**
* 根据操作类型过滤一遍餐台
* 根据操作类型过滤一遍餐台
*/
*/
...
@@ -918,10 +871,6 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
...
@@ -918,10 +871,6 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
getTableToMove
(
tableBean
);
getTableToMove
(
tableBean
);
}
}
@Override
public
void
loadOrderToPrint
(
TableBean
.
DataBean
tableBean
)
{
loadOrderToPrintParper
(
tableBean
);
}
@Override
@Override
public
void
splitTableAction
(
TableBean
.
DataBean
tableBean
)
{
public
void
splitTableAction
(
TableBean
.
DataBean
tableBean
)
{
...
@@ -934,6 +883,11 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
...
@@ -934,6 +883,11 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
}
}
@Override
@Override
public
void
skyOrderLockState
(
boolean
state
)
{
mRootView
.
setLockVisibility
(
state
);
}
@Override
public
void
cancel
()
{
public
void
cancel
()
{
initTableActionParameter
();
initTableActionParameter
();
mRootView
.
canceTableAction
();
mRootView
.
canceTableAction
();
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/MealStandActivity.java
View file @
654437d8
...
@@ -42,7 +42,6 @@ import com.gingersoft.gsa.cloud.table.di.component.DaggerMealStandComponent;
...
@@ -42,7 +42,6 @@ import com.gingersoft.gsa.cloud.table.di.component.DaggerMealStandComponent;
import
com.gingersoft.gsa.cloud.table.mvp.contract.MealStandContract
;
import
com.gingersoft.gsa.cloud.table.mvp.contract.MealStandContract
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.SoldoutCtrFood
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.SoldoutCtrFood
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.event.InitTableEvent
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.event.InitTableEvent
;
import
com.gingersoft.gsa.cloud.table.mvp.presenter.BaseOrderPresenter
;
import
com.gingersoft.gsa.cloud.table.mvp.presenter.MealStandPresenter
;
import
com.gingersoft.gsa.cloud.table.mvp.presenter.MealStandPresenter
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.adapter.BaseFragmentAdapter
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.adapter.BaseFragmentAdapter
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.adapter.meal.FoodGroupAdapter
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.adapter.meal.FoodGroupAdapter
;
...
@@ -70,7 +69,6 @@ import com.jess.arms.di.component.AppComponent;
...
@@ -70,7 +69,6 @@ import com.jess.arms.di.component.AppComponent;
import
com.jess.arms.utils.ArmsUtils
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.qmuiteam.qmui.alpha.QMUIAlphaTextView
;
import
com.qmuiteam.qmui.alpha.QMUIAlphaTextView
;
import
com.qmuiteam.qmui.util.QMUIDisplayHelper
;
import
com.qmuiteam.qmui.util.QMUIDisplayHelper
;
import
com.xuexiang.rxutil2.RxBindingUtils
;
import
org.simple.eventbus.EventBus
;
import
org.simple.eventbus.EventBus
;
...
@@ -92,7 +90,6 @@ import androidx.viewpager.widget.ViewPager;
...
@@ -92,7 +90,6 @@ import androidx.viewpager.widget.ViewPager;
import
butterknife.BindView
;
import
butterknife.BindView
;
import
butterknife.OnClick
;
import
butterknife.OnClick
;
import
butterknife.OnLongClick
;
import
butterknife.OnLongClick
;
import
io.reactivex.functions.Consumer
;
import
static
com
.
jess
.
arms
.
utils
.
Preconditions
.
checkNotNull
;
import
static
com
.
jess
.
arms
.
utils
.
Preconditions
.
checkNotNull
;
...
@@ -322,8 +319,6 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
...
@@ -322,8 +319,6 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
initAutoQuit
();
initAutoQuit
();
}
}
mPresenter
.
getCurrentSoldoutFood
();
mPresenter
.
getCurrentSoldoutFood
();
// setViewDrawableColor();
}
}
private
void
initUIStyleConfiguration
()
{
private
void
initUIStyleConfiguration
()
{
...
@@ -1376,7 +1371,6 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
...
@@ -1376,7 +1371,6 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
btn_select_all
.
setVisibility
(
visibility
);
btn_select_all
.
setVisibility
(
visibility
);
}
}
public
boolean
isInitSentOrderDiscount
()
{
public
boolean
isInitSentOrderDiscount
()
{
return
initSentOrderDiscount
;
return
initSentOrderDiscount
;
}
}
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/TableActivity.java
View file @
654437d8
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
ui
.
activity
;
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
ui
.
activity
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.content.pm.ActivityInfo
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Message
;
import
android.os.Message
;
import
android.view.MenuItem
;
import
android.view.View
;
import
android.view.View
;
import
android.widget.AdapterView
;
import
android.widget.AdapterView
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.LinearLayout
;
import
android.widget.RelativeLayout
;
import
android.widget.SimpleAdapter
;
import
android.widget.SimpleAdapter
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.billy.cc.core.component.CC
;
import
com.billy.cc.core.component.CC
;
...
@@ -28,19 +27,14 @@ import com.gingersoft.gsa.cloud.table.mvp.ui.fragment.AllTableFragment;
...
@@ -28,19 +27,14 @@ 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.fragment.InputTableFragment
;
import
com.gingersoft.gsa.cloud.constans.GoldConstants
;
import
com.gingersoft.gsa.cloud.constans.GoldConstants
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog
;
import
com.google.android.material.bottomnavigation.BottomNavigationView
;
import
com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx
;
import
com.jess.arms.base.BaseFragmentActivity
;
import
com.jess.arms.base.BaseFragmentActivity
;
import
com.jess.arms.base.DefaultAdapter
;
import
com.jess.arms.base.DefaultAdapter
;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.kingja.loadsir.callback.Callback
;
import
com.kingja.loadsir.core.LoadService
;
import
com.kingja.loadsir.core.LoadService
;
import
com.kingja.loadsir.core.LoadSir
;
import
com.qmuiteam.qmui.alpha.QMUIAlphaImageButton
;
import
com.qmuiteam.qmui.alpha.QMUIAlphaImageButton
;
import
com.qmuiteam.qmui.arch.QMUIFragmentPagerAdapter
;
import
com.qmuiteam.qmui.arch.QMUIFragmentPagerAdapter
;
import
com.qmuiteam.qmui.layout.QMUIButton
;
import
com.qmuiteam.qmui.layout.QMUIButton
;
import
com.qmuiteam.qmui.util.QMUIDeviceHelper
;
import
com.qmuiteam.qmui.util.QMUIDisplayHelper
;
import
com.qmuiteam.qmui.util.QMUIDisplayHelper
;
import
com.qmuiteam.qmui.widget.QMUITopBar
;
import
com.qmuiteam.qmui.widget.QMUITopBar
;
import
com.qmuiteam.qmui.widget.popup.QMUIPopup
;
import
com.qmuiteam.qmui.widget.popup.QMUIPopup
;
...
@@ -50,7 +44,6 @@ import com.qmuiteam.qmui.widget.tab.QMUITabBuilder;
...
@@ -50,7 +44,6 @@ import com.qmuiteam.qmui.widget.tab.QMUITabBuilder;
import
com.qmuiteam.qmui.widget.tab.QMUITabIndicator
;
import
com.qmuiteam.qmui.widget.tab.QMUITabIndicator
;
import
com.qmuiteam.qmui.widget.tab.QMUITabSegment
;
import
com.qmuiteam.qmui.widget.tab.QMUITabSegment
;
import
com.scwang.smartrefresh.layout.api.RefreshLayout
;
import
com.scwang.smartrefresh.layout.api.RefreshLayout
;
import
com.xuexiang.rxutil2.RxBindingUtils
;
import
org.simple.eventbus.Subscriber
;
import
org.simple.eventbus.Subscriber
;
...
@@ -109,6 +102,11 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
...
@@ -109,6 +102,11 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
@BindView
(
R2
.
id
.
tv_table_action_content
)
@BindView
(
R2
.
id
.
tv_table_action_content
)
TextView
tv_table_action_content
;
TextView
tv_table_action_content
;
@BindView
(
R2
.
id
.
rl_skyorder
)
RelativeLayout
rl_skyorder
;
@BindView
(
R2
.
id
.
iv_lock
)
ImageView
iv_lock
;
private
LoadService
loadService
;
private
LoadService
loadService
;
/**
/**
...
@@ -163,7 +161,6 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
...
@@ -163,7 +161,6 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
// getTables(true, null);
// getTables(true, null);
// }
// }
// });
// });
// bn_table_function.getMenu().
initTabAndPager
();
initTabAndPager
();
getTables
(
true
,
null
);
getTables
(
true
,
null
);
}
}
...
@@ -335,6 +332,7 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
...
@@ -335,6 +332,7 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
btn_cancel_operat
.
setVisibility
(
View
.
VISIBLE
);
btn_cancel_operat
.
setVisibility
(
View
.
VISIBLE
);
ll_table_operat_content
.
setVisibility
(
View
.
VISIBLE
);
ll_table_operat_content
.
setVisibility
(
View
.
VISIBLE
);
rv_bottom_function
.
setVisibility
(
View
.
INVISIBLE
);
rv_bottom_function
.
setVisibility
(
View
.
INVISIBLE
);
rl_skyorder
.
setVisibility
(
View
.
INVISIBLE
);
setTableActionTitle
(
action
);
setTableActionTitle
(
action
);
}
}
...
@@ -352,6 +350,7 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
...
@@ -352,6 +350,7 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
btn_cancel_operat
.
setVisibility
(
View
.
INVISIBLE
);
btn_cancel_operat
.
setVisibility
(
View
.
INVISIBLE
);
ll_table_operat_content
.
setVisibility
(
View
.
INVISIBLE
);
ll_table_operat_content
.
setVisibility
(
View
.
INVISIBLE
);
rv_bottom_function
.
setVisibility
(
View
.
VISIBLE
);
rv_bottom_function
.
setVisibility
(
View
.
VISIBLE
);
rl_skyorder
.
setVisibility
(
View
.
VISIBLE
);
tv_table_action_hint
.
setText
(
""
);
tv_table_action_hint
.
setText
(
""
);
tv_table_action_content
.
setText
(
""
);
tv_table_action_content
.
setText
(
""
);
...
@@ -419,6 +418,11 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
...
@@ -419,6 +418,11 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
rv_bottom_function
.
setVisibility
(
show
==
true
?
View
.
VISIBLE
:
View
.
GONE
);
rv_bottom_function
.
setVisibility
(
show
==
true
?
View
.
VISIBLE
:
View
.
GONE
);
}
}
@Override
public
void
setLockVisibility
(
boolean
show
)
{
iv_lock
.
setVisibility
(
show
==
true
?
View
.
VISIBLE
:
View
.
GONE
);
}
private
void
initTabAndPager
()
{
private
void
initTabAndPager
()
{
QMUIFragmentPagerAdapter
pagerAdapter
=
new
QMUIFragmentPagerAdapter
(
getSupportFragmentManager
())
{
QMUIFragmentPagerAdapter
pagerAdapter
=
new
QMUIFragmentPagerAdapter
(
getSupportFragmentManager
())
{
@Override
@Override
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/FoodSummaryAdapter.java
0 → 100644
View file @
654437d8
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
ui
.
adapter
;
import
android.content.res.ColorStateList
;
import
android.graphics.Color
;
import
android.text.TextUtils
;
import
android.widget.TextView
;
import
androidx.annotation.Nullable
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
;
import
com.gingersoft.gsa.cloud.table.R
;
import
com.gingersoft.gsa.cloud.table.R2
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.FoodSummary
;
import
com.gingersoft.gsa.cloud.ui.bean.view.SectionTextItem3
;
import
com.gingersoft.gsa.cloud.ui.view.ColorUtils
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.qmuiteam.qmui.util.QMUIColorHelper
;
import
com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
;
import
com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButtonDrawable
;
import
java.util.List
;
import
butterknife.BindView
;
/**
* @author : bin
* @create date: 2020-11-04
* @update date: 2020-11-04
* @description:
*/
public
class
FoodSummaryAdapter
extends
BaseQuickAdapter
<
FoodSummary
,
BaseViewHolder
>
{
public
FoodSummaryAdapter
(
@Nullable
List
<
FoodSummary
>
data
)
{
super
(
R
.
layout
.
table_item_food_summary
,
data
);
}
@Override
protected
void
convert
(
BaseViewHolder
helper
,
FoodSummary
item
)
{
QMUIRoundButton
btn_summary
=
helper
.
getView
(
R
.
id
.
btn_summary
);
if
(
item
.
isSelected
())
{
btn_summary
.
setBackgroundColor
(
ArmsUtils
.
getColor
(
getContext
(),
R
.
color
.
theme_color
));
btn_summary
.
setStrokeColors
(
ColorStateList
.
valueOf
(
ArmsUtils
.
getColor
(
getContext
(),
R
.
color
.
theme_white_color
)));
btn_summary
.
setTextColor
(
ArmsUtils
.
getColor
(
getContext
(),
R
.
color
.
theme_white_color
));
}
else
{
btn_summary
.
setBackgroundColor
(
ArmsUtils
.
getColor
(
getContext
(),
R
.
color
.
theme_white_color
));
btn_summary
.
setStrokeColors
(
ColorStateList
.
valueOf
(
ArmsUtils
.
getColor
(
getContext
(),
R
.
color
.
theme_text_color_black
)));
btn_summary
.
setTextColor
(
ArmsUtils
.
getColor
(
getContext
(),
R
.
color
.
theme_text_color_black
));
}
if
(!
TextUtils
.
isEmpty
(
item
.
getName
()))
{
btn_summary
.
setText
(
item
.
getName
());
}
}
}
\ No newline at end of file
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/widget/SkyOrderDialog.java
View file @
654437d8
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
ui
.
widget
;
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
ui
.
widget
;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.app.Dialog
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
android.util.Log
;
import
android.view.Gravity
;
import
android.view.Gravity
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
...
@@ -15,30 +15,29 @@ import android.view.animation.AnimationSet;
...
@@ -15,30 +15,29 @@ import android.view.animation.AnimationSet;
import
android.view.animation.DecelerateInterpolator
;
import
android.view.animation.DecelerateInterpolator
;
import
android.view.animation.TranslateAnimation
;
import
android.view.animation.TranslateAnimation
;
import
android.widget.AdapterView
;
import
android.widget.AdapterView
;
import
android.widget.
EditText
;
import
android.widget.
CompoundButton
;
import
android.widget.LinearLayout
;
import
android.widget.LinearLayout
;
import
android.widget.ProgressBar
;
import
android.widget.ProgressBar
;
import
android.widget.SimpleAdapter
;
import
android.widget.SimpleAdapter
;
import
android.widget.TableLayout
;
import
android.widget.TableRow
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.appcompat.widget.AppCompatCheckBox
;
import
androidx.appcompat.widget.AppCompatCheckBox
;
import
androidx.recyclerview.widget.GridLayoutManager
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.gingersoft.gsa.cloud.base.common.bean.MemberInfo
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.gingersoft.gsa.cloud.base.order.bean.OrderBean
;
import
com.chad.library.adapter.base.listener.OnItemClickListener
;
import
com.gingersoft.gsa.cloud.base.order.order.BaseOrder
;
import
com.gingersoft.gsa.cloud.base.utils.other.SPUtils
;
import
com.gingersoft.gsa.cloud.base.order.order.DoshokuOrder
;
import
com.gingersoft.gsa.cloud.base.utils.time.TimeUtils
;
import
com.gingersoft.gsa.cloud.constans.FoodSummaryConstans
;
import
com.gingersoft.gsa.cloud.table.BuildConfig
;
import
com.gingersoft.gsa.cloud.table.R
;
import
com.gingersoft.gsa.cloud.table.R
;
import
com.gingersoft.gsa.cloud.table.R2
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.FoodSummary
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.MealSummary
;
import
com.gingersoft.gsa.cloud.table.mvp.model.constant.SkyOrderConstant
;
import
com.gingersoft.gsa.cloud.table.mvp.model.utils.MathUtils
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.adapter.FoodSummaryAdapter
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.BaseRetryDialog
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.BaseRetryDialog
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.jess.arms.utils.ThirdViewUtil
;
import
com.qmuiteam.qmui.QMUILog
;
import
com.qmuiteam.qmui.QMUILog
;
import
com.qmuiteam.qmui.alpha.QMUIAlphaTextView
;
import
com.qmuiteam.qmui.alpha.QMUIAlphaTextView
;
import
com.qmuiteam.qmui.util.QMUIDisplayHelper
;
import
com.qmuiteam.qmui.util.QMUIDisplayHelper
;
...
@@ -52,10 +51,6 @@ import java.util.HashMap;
...
@@ -52,10 +51,6 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.OnClick
;
/**
/**
* @author : bin
* @author : bin
* @create date: 2020-10-31
* @create date: 2020-10-31
...
@@ -65,13 +60,10 @@ import butterknife.OnClick;
...
@@ -65,13 +60,10 @@ import butterknife.OnClick;
public
class
SkyOrderDialog
extends
BaseRetryDialog
implements
View
.
OnClickListener
{
public
class
SkyOrderDialog
extends
BaseRetryDialog
implements
View
.
OnClickListener
{
private
static
final
String
TAG
=
"SkyOrderDialog"
;
private
static
final
String
TAG
=
"SkyOrderDialog"
;
AppCompatCheckBox
cb
T
itle
;
AppCompatCheckBox
cb
_t
itle
;
TextView
tvStartTime
;
TextView
tvStartTime
;
TextView
tvSplit
;
TextView
tvEndTime
;
TextView
tvEndTime
;
LinearLayout
clTime
;
RecyclerView
rvSummary
;
RecyclerView
rvSummary
;
TextView
tvTitle
;
MaterialEditText
edValue
;
MaterialEditText
edValue
;
QMUIAlphaTextView
btnAdd10
;
QMUIAlphaTextView
btnAdd10
;
QMUIAlphaTextView
btn7
;
QMUIAlphaTextView
btn7
;
...
@@ -100,7 +92,22 @@ public class SkyOrderDialog extends BaseRetryDialog implements View.OnClickListe
...
@@ -100,7 +92,22 @@ public class SkyOrderDialog extends BaseRetryDialog implements View.OnClickListe
private
QMUIPopup
mTimePopup
;
private
QMUIPopup
mTimePopup
;
private
List
<
MealSummary
>
mMealSummaryList
;
private
FoodSummaryAdapter
mFoodSummaryAdapter
;
private
List
<
FoodSummary
>
mFoodSummaryList
=
new
ArrayList
<>();
private
List
<
Integer
>
mDeliveryHours
=
new
ArrayList
<>();
private
List
<
Integer
>
mDeliveryMinute
=
new
ArrayList
<>();
private
int
hourSelectPosition
=
-
1
;
private
int
minuteSelectPosition
=
-
1
;
private
int
summaryId
=
2
;
private
int
[]
chooseDeliveryTimes
=
new
int
[
2
];
private
String
currentTimes
[];
//选中10+的次数
private
int
currentTenPlus
=
0
;
public
SkyOrderDialog
(
Activity
context
)
{
public
SkyOrderDialog
(
Activity
context
)
{
super
(
context
,
R
.
style
.
QMUI_BottomSheet
);
super
(
context
,
R
.
style
.
QMUI_BottomSheet
);
...
@@ -235,48 +242,20 @@ public class SkyOrderDialog extends BaseRetryDialog implements View.OnClickListe
...
@@ -235,48 +242,20 @@ public class SkyOrderDialog extends BaseRetryDialog implements View.OnClickListe
animateDown
();
animateDown
();
}
}
public
void
setMealSummaryList
(
List
<
MealSummary
>
mealSummaryList
)
{
this
.
mMealSummaryList
=
mealSummaryList
;
}
public
SkyOrderDialog
build
()
{
public
SkyOrderDialog
build
()
{
View
contentView
=
buildViews
();
View
contentView
=
buildViews
();
setContentView
(
contentView
,
new
LinearLayout
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
(
int
)
(
QMUIDisplayHelper
.
getScreenHeight
(
mContext
)
*
0.7
)));
setContentView
(
contentView
,
new
LinearLayout
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
(
int
)
(
QMUIDisplayHelper
.
getScreenHeight
(
mContext
)
*
0.7
5
)));
String
[]
startTextList
=
new
String
[]{
initRvSummaryAdapter
();
"10"
,
initCheckBoxListener
();
"11"
,
initDeliveryTimeClickListener
();
"12"
,
"14"
,
"15"
,
"16"
,
};
String
[]
endTextList
=
new
String
[]{
"10"
,
"20"
,
"30"
,
"40"
,
"50"
,
"55"
,
};
tvStartTime
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
showSelectTimePopup
(
tvStartTime
,
startTextList
);
}
});
tvEndTime
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
showSelectTimePopup
(
tvEndTime
,
endTextList
);
}
});
return
this
;
return
this
;
}
}
private
View
buildViews
()
{
private
View
buildViews
()
{
View
view
=
View
.
inflate
(
mContext
,
getContentViewLayoutId
(),
null
);
View
view
=
View
.
inflate
(
mContext
,
getContentViewLayoutId
(),
null
);
cb_title
=
view
.
findViewById
(
R
.
id
.
cb_title
);
tvStartTime
=
view
.
findViewById
(
R
.
id
.
tv_start_time
);
tvStartTime
=
view
.
findViewById
(
R
.
id
.
tv_start_time
);
tvEndTime
=
view
.
findViewById
(
R
.
id
.
tv_end_time
);
tvEndTime
=
view
.
findViewById
(
R
.
id
.
tv_end_time
);
rvSummary
=
view
.
findViewById
(
R
.
id
.
rv_summary
);
rvSummary
=
view
.
findViewById
(
R
.
id
.
rv_summary
);
...
@@ -315,6 +294,217 @@ public class SkyOrderDialog extends BaseRetryDialog implements View.OnClickListe
...
@@ -315,6 +294,217 @@ public class SkyOrderDialog extends BaseRetryDialog implements View.OnClickListe
return
view
;
return
view
;
}
}
private
void
initCheckBoxListener
()
{
cb_title
.
setOnCheckedChangeListener
(
new
CompoundButton
.
OnCheckedChangeListener
()
{
@Override
public
void
onCheckedChanged
(
CompoundButton
buttonView
,
boolean
isChecked
)
{
if
(
callbackListener
!=
null
)
{
callbackListener
.
lockState
(
isChecked
);
}
SPUtils
.
put
(
SkyOrderConstant
.
check_status
,
isChecked
);
}
});
}
private
void
initDeliveryTimeClickListener
()
{
String
[]
startTextList
=
new
String
[]{
"10"
,
"11"
,
"12"
,
"14"
,
"15"
,
"16"
,
};
String
[]
endTextList
=
new
String
[]{
"10"
,
"20"
,
"30"
,
"40"
,
"50"
,
"55"
,
};
tvStartTime
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
showSelectTimePopup
(
tvStartTime
,
startTextList
);
}
});
tvEndTime
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
showSelectTimePopup
(
tvEndTime
,
endTextList
);
}
});
}
public
void
initDeliveryHourTime
(
FoodSummary
foodSummary
)
{
long
currentTimeMillis
=
System
.
currentTimeMillis
();
//设置交檯时间(时)当前时间往后六小时
currentTimes
=
TimeUtils
.
getStringByFormat
(
currentTimeMillis
,
TimeUtils
.
DATE_FORMAT_DATE_HM
).
split
(
":"
);
int
currentHour
=
Integer
.
parseInt
(
currentTimes
[
0
]);
for
(
int
i
=
currentHour
;
i
<
currentHour
+
7
;
i
++)
{
mDeliveryHours
.
add
(
i
);
}
boolean
lockedCheckState
=
(
boolean
)
SPUtils
.
get
(
SkyOrderConstant
.
check_status
,
false
);
if
(
lockedCheckState
)
{
//交檯时间已锁定
setLockedDeliveryTime
();
}
else
{
//交檯时间未锁定,给一个默认选中时间
// setDefaultDeliveryTime(foodSummary);
}
}
private
void
setLockedDeliveryTime
()
{
String
lockedHour
=
(
String
)
SPUtils
.
get
(
SkyOrderConstant
.
delivery_time_hour
,
""
);
String
lockedMinute
=
(
String
)
SPUtils
.
get
(
SkyOrderConstant
.
delivery_time_minute
,
""
);
if
(!
TextUtils
.
isEmpty
(
lockedHour
))
{
chooseDeliveryTimes
[
0
]
=
Integer
.
parseInt
(
lockedHour
);
}
if
(!
TextUtils
.
isEmpty
(
lockedMinute
))
{
chooseDeliveryTimes
[
1
]
=
Integer
.
parseInt
(
lockedMinute
);
}
for
(
int
i
=
0
;
i
<
mDeliveryHours
.
size
();
i
++)
{
if
(
chooseDeliveryTimes
.
length
>
0
&&
chooseDeliveryTimes
[
0
]
==
mDeliveryHours
.
get
(
i
))
{
//找到当前选择的小时数下标
hourSelectPosition
=
i
;
break
;
}
}
for
(
int
j
=
0
;
j
<
mDeliveryMinute
.
size
();
j
++)
{
if
(
chooseDeliveryTimes
.
length
>
1
&&
chooseDeliveryTimes
[
1
]
==
mDeliveryMinute
.
get
(
j
))
{
//找到当前选择的分钟数下标
minuteSelectPosition
=
j
;
break
;
}
}
}
private
void
setDefaultDeliveryTime
(
FoodSummary
foodSummary
)
{
/**
* 设置默认小时数
*/
long
currentTimeMillis
=
System
.
currentTimeMillis
();
//设置默认交台时间为当前时间往后推多少分钟(可配置)
long
defaultDeliveryLater
=
currentTimeMillis
+
(
foodSummary
.
getMealLength
()
*
60
*
1000
);
String
defaultDeliveryLaterTimes
[]
=
TimeUtils
.
getStringByFormat
(
defaultDeliveryLater
,
TimeUtils
.
DATE_FORMAT_DATE_HM
).
split
(
":"
);
for
(
int
i
=
0
;
i
<
mDeliveryHours
.
size
();
i
++)
{
int
hour
=
mDeliveryHours
.
get
(
i
);
if
(
hour
==
Integer
.
parseInt
(
defaultDeliveryLaterTimes
[
0
]))
{
//设置默认交檯小时数
chooseDeliveryTimes
[
0
]
=
Integer
.
parseInt
(
defaultDeliveryLaterTimes
[
0
]);
hourSelectPosition
=
i
;
break
;
}
}
if
(
hourSelectPosition
==
-
1
)
{
//未设置默认交檯时,默认选中下一个小时
chooseDeliveryTimes
[
0
]
=
mDeliveryHours
.
get
(
1
);
hourSelectPosition
=
1
;
}
/**
* 设置默认分钟数
*/
//获取当前分钟
int
currentMinute
=
Integer
.
parseInt
(
currentTimes
[
1
]);
//找回与当前分钟数相近的整数
int
needNum
=
MathUtils
.
findRecentNum
(
mDeliveryMinute
,
currentMinute
);
//设置默认分钟数
chooseDeliveryTimes
[
1
]
=
needNum
;
for
(
int
i
=
0
;
i
<
mDeliveryMinute
.
size
();
i
++)
{
if
(
mDeliveryMinute
.
get
(
i
)
==
chooseDeliveryTimes
[
1
])
{
minuteSelectPosition
=
i
;
}
}
}
/**
* 更新餐種數據
*
* @param foodSummaryList
*/
public
void
updateFoodSummaryList
(
List
<
FoodSummary
>
foodSummaryList
)
{
if
(
mFoodSummaryList
.
size
()
==
0
)
{
//設置默認選中的餐種
setFoodSummaryTime
(
getDefalutFoodSummary
(
foodSummaryList
));
}
else
{
mFoodSummaryList
.
clear
();
}
mFoodSummaryList
.
addAll
(
foodSummaryList
);
mFoodSummaryAdapter
.
notifyDataSetChanged
();
}
/**
* 設置用餐時段
*/
private
void
setFoodSummaryTime
(
FoodSummary
foodSummary
)
{
if
(
foodSummary
==
null
)
{
return
;
}
if
(
mFoodSummaryList
!=
null
)
{
initSelectedStatus
(
mFoodSummaryList
);
}
initDeliveryHourTime
(
foodSummary
);
foodSummary
.
setSelected
(
true
);
mFoodSummaryAdapter
.
notifyDataSetChanged
();
}
/**
* 獲取默認選中的餐種
*
* @param foodSummaryList
* @return
*/
private
FoodSummary
getDefalutFoodSummary
(
List
<
FoodSummary
>
foodSummaryList
)
{
for
(
FoodSummary
foodSummary
:
foodSummaryList
)
{
if
(
foodSummary
.
isDefault
())
{
return
foodSummary
;
}
}
return
null
;
}
/**
* 初始化默認選中
*
* @param foodSummaryList
*/
private
void
initSelectedStatus
(
List
<
FoodSummary
>
foodSummaryList
)
{
for
(
FoodSummary
foodSummary
:
foodSummaryList
)
{
foodSummary
.
setSelected
(
false
);
}
}
private
void
initRvSummaryAdapter
()
{
mFoodSummaryAdapter
=
new
FoodSummaryAdapter
(
mFoodSummaryList
);
rvSummary
.
setAdapter
(
mFoodSummaryAdapter
);
mFoodSummaryAdapter
.
setOnItemClickListener
(
new
OnItemClickListener
()
{
@Override
public
void
onItemClick
(
@NonNull
BaseQuickAdapter
<?,
?>
adapter
,
@NonNull
View
view
,
int
position
)
{
setFoodSummaryTime
(
mFoodSummaryList
.
get
(
position
));
}
});
RecyclerView
.
LayoutManager
layoutManager
=
createLayoutManager
();
rvSummary
.
setLayoutManager
(
layoutManager
);
}
private
RecyclerView
.
LayoutManager
createLayoutManager
()
{
return
new
GridLayoutManager
(
mContext
,
4
,
LinearLayoutManager
.
VERTICAL
,
false
)
{
@Override
public
RecyclerView
.
LayoutParams
generateDefaultLayoutParams
()
{
return
new
RecyclerView
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
);
}
};
}
private
void
showSelectTimePopup
(
TextView
textView
,
String
[]
text
)
{
private
void
showSelectTimePopup
(
TextView
textView
,
String
[]
text
)
{
List
<
Map
<
String
,
Object
>>
lists
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
lists
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
text
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
text
.
length
;
i
++)
{
...
@@ -322,17 +512,29 @@ public class SkyOrderDialog extends BaseRetryDialog implements View.OnClickListe
...
@@ -322,17 +512,29 @@ public class SkyOrderDialog extends BaseRetryDialog implements View.OnClickListe
map
.
put
(
"text"
,
text
[
i
]);
map
.
put
(
"text"
,
text
[
i
]);
lists
.
add
(
map
);
lists
.
add
(
map
);
}
}
SimpleAdapter
adapter
=
new
SimpleAdapter
(
mContext
,
lists
,
R
.
layout
.
iu_item_base_text_section
SimpleAdapter
adapter
=
new
SimpleAdapter
(
mContext
,
lists
,
R
.
layout
.
table_item_skyorder_meal_lenght
,
new
String
[]{
"text"
}
,
new
String
[]{
"text"
}
,
new
int
[]{
R
.
id
.
tv_name
});
,
new
int
[]{
R
.
id
.
tv_name
});
mTimePopup
=
QMUIPopups
.
listPopup
(
mContext
,
QMUIDisplayHelper
.
getScreenWidth
(
mContext
)
/
3
,
QMUIDisplayHelper
.
getScreenHeight
(
mContext
),
adapter
,
new
AdapterView
.
OnItemClickListener
()
{
mTimePopup
=
QMUIPopups
.
listPopup
(
mContext
,
QMUIDisplayHelper
.
getScreenWidth
(
mContext
)
/
3
,
QMUIDisplayHelper
.
getScreenHeight
(
mContext
),
adapter
,
new
AdapterView
.
OnItemClickListener
()
{
@Override
@Override
public
void
onItemClick
(
AdapterView
<?>
parent
,
View
view
,
int
position
,
long
id
)
{
public
void
onItemClick
(
AdapterView
<?>
parent
,
View
view
,
int
position
,
long
id
)
{
mTimePopup
.
dismiss
();
boolean
lockedCheckState
=
(
boolean
)
SPUtils
.
get
(
SkyOrderConstant
.
check_status
,
false
);
if
(
lockedCheckState
)
{
SPUtils
.
put
(
SkyOrderConstant
.
delivery_time_hour
,
String
.
valueOf
(
chooseDeliveryTimes
[
0
]));
SPUtils
.
put
(
SkyOrderConstant
.
delivery_time_minute
,
String
.
valueOf
(
chooseDeliveryTimes
[
1
]));
}
else
{
SPUtils
.
put
(
SkyOrderConstant
.
delivery_time_hour
,
""
);
SPUtils
.
put
(
SkyOrderConstant
.
delivery_time_minute
,
""
);
}
SPUtils
.
put
(
SkyOrderConstant
.
check_status
,
lockedCheckState
);
textView
.
setText
(
lists
.
get
(
position
).
get
(
"text"
).
toString
());
textView
.
setText
(
lists
.
get
(
position
).
get
(
"text"
).
toString
());
mTimePopup
.
dismiss
();
}
}
}).
dimAmount
(
0.6f
).
show
(
textView
);
}).
show
(
textView
);
}
}
public
void
showEmptyView
(
boolean
isSuccess
,
int
size
,
Throwable
t
)
{
public
void
showEmptyView
(
boolean
isSuccess
,
int
size
,
Throwable
t
)
{
...
@@ -355,7 +557,7 @@ public class SkyOrderDialog extends BaseRetryDialog implements View.OnClickListe
...
@@ -355,7 +557,7 @@ public class SkyOrderDialog extends BaseRetryDialog implements View.OnClickListe
id
==
R
.
id
.
btn_6
||
id
==
R
.
id
.
btn_7
||
id
==
R
.
id
.
btn_8
||
id
==
R
.
id
.
btn_9
||
id
==
R
.
id
.
btn_add10
||
id
==
R
.
id
.
btn_0
||
id
==
R
.
id
.
btn_6
||
id
==
R
.
id
.
btn_7
||
id
==
R
.
id
.
btn_8
||
id
==
R
.
id
.
btn_9
||
id
==
R
.
id
.
btn_add10
||
id
==
R
.
id
.
btn_0
||
id
==
R
.
id
.
btn_clear
||
id
==
R
.
id
.
btn_delete
||
id
==
R
.
id
.
btn_sure
)
{
id
==
R
.
id
.
btn_clear
||
id
==
R
.
id
.
btn_delete
||
id
==
R
.
id
.
btn_sure
)
{
int
value
=
Integer
.
parseInt
(
edValue
.
getText
().
toString
()
);
String
value
=
edValue
.
getText
().
toString
(
);
int
i
=
Integer
.
parseInt
(
v
.
getTag
().
toString
());
int
i
=
Integer
.
parseInt
(
v
.
getTag
().
toString
());
switch
(
i
)
{
switch
(
i
)
{
...
@@ -369,21 +571,33 @@ public class SkyOrderDialog extends BaseRetryDialog implements View.OnClickListe
...
@@ -369,21 +571,33 @@ public class SkyOrderDialog extends BaseRetryDialog implements View.OnClickListe
case
7
:
case
7
:
case
8
:
case
8
:
case
9
:
case
9
:
edValue
.
setText
(
value
);
if
(!
TextUtils
.
isEmpty
(
value
))
{
edValue
.
setText
(
value
+
i
);
}
else
{
edValue
.
setText
(
String
.
valueOf
(
i
));
}
break
;
break
;
case
99
:
//+10
case
99
:
//+10
edValue
.
setText
(
value
+
10
);
if
(!
TextUtils
.
isEmpty
(
value
))
{
edValue
.
setText
(
String
.
valueOf
(
Integer
.
parseInt
(
value
)
+
10
));
}
else
{
edValue
.
setText
(
String
.
valueOf
(
i
));
}
break
;
break
;
case
98
:
//×
case
98
:
//×
edValue
.
setText
(
""
);
if
(!
TextUtils
.
isEmpty
(
value
))
{
edValue
.
setText
(
""
);
}
break
;
break
;
case
97
:
//√
case
97
:
//√
if
(
sumbit
Listener
!=
null
)
{
if
(
callback
Listener
!=
null
)
{
sumbit
Listener
.
onPrint
();
callback
Listener
.
onPrint
();
}
}
break
;
break
;
case
58
:
//clear
case
58
:
//clear
edValue
.
setText
(
""
);
if
(!
TextUtils
.
isEmpty
(
value
))
{
edValue
.
setText
(
""
);
}
break
;
break
;
default
:
default
:
break
;
break
;
...
@@ -391,13 +605,15 @@ public class SkyOrderDialog extends BaseRetryDialog implements View.OnClickListe
...
@@ -391,13 +605,15 @@ public class SkyOrderDialog extends BaseRetryDialog implements View.OnClickListe
}
}
}
}
private
On
SumbitListener
sumbit
Listener
;
private
On
CallbackListener
callback
Listener
;
public
void
set
SumbitListener
(
OnSumbitListener
sumbit
Listener
)
{
public
void
set
CallbackListener
(
OnCallbackListener
callback
Listener
)
{
this
.
sumbitListener
=
sumbit
Listener
;
this
.
callbackListener
=
callback
Listener
;
}
}
public
interface
OnSumbitListener
{
public
interface
OnCallbackListener
{
void
lockState
(
boolean
state
);
void
onPrint
();
void
onPrint
();
}
}
}
}
table-module/src/main/res/layout/table_dialog_skyorder.xml
View file @
654437d8
...
@@ -38,7 +38,8 @@
...
@@ -38,7 +38,8 @@
android:paddingStart=
"@dimen/dp_10"
android:paddingStart=
"@dimen/dp_10"
android:text=
"22:00"
android:text=
"22:00"
android:textColor=
"@color/theme_text_color"
android:textColor=
"@color/theme_text_color"
android:textSize=
"@dimen/sp_16"
android:textSize=
"@dimen/dp_18"
android:textStyle=
"bold"
app:layout_constraintLeft_toRightOf=
"@+id/cb_title"
/>
app:layout_constraintLeft_toRightOf=
"@+id/cb_title"
/>
<TextView
<TextView
...
@@ -48,6 +49,7 @@
...
@@ -48,6 +49,7 @@
android:layout_marginStart=
"@dimen/dp_20"
android:layout_marginStart=
"@dimen/dp_20"
android:layout_marginEnd=
"@dimen/dp_20"
android:layout_marginEnd=
"@dimen/dp_20"
android:text=
":"
android:text=
":"
android:textStyle=
"bold"
app:layout_constraintLeft_toRightOf=
"@+id/tv_start_time"
/>
app:layout_constraintLeft_toRightOf=
"@+id/tv_start_time"
/>
<TextView
<TextView
...
@@ -62,7 +64,8 @@
...
@@ -62,7 +64,8 @@
android:paddingEnd=
"@dimen/dp_10"
android:paddingEnd=
"@dimen/dp_10"
android:text=
"23:30"
android:text=
"23:30"
android:textColor=
"@color/theme_text_color"
android:textColor=
"@color/theme_text_color"
android:textSize=
"@dimen/sp_16"
android:textSize=
"@dimen/dp_18"
android:textStyle=
"bold"
app:layout_constraintLeft_toRightOf=
"@+id/tv_split"
/>
app:layout_constraintLeft_toRightOf=
"@+id/tv_split"
/>
</LinearLayout>
</LinearLayout>
...
...
table-module/src/main/res/layout/table_input_skyorder_people_number.xml
View file @
654437d8
...
@@ -7,7 +7,8 @@
...
@@ -7,7 +7,8 @@
<RelativeLayout
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_80"
android:layout_height=
"@dimen/dp_80"
android:layout_margin=
"@dimen/dp_15"
>
android:layout_marginStart=
"@dimen/dp_15"
android:layout_marginEnd=
"@dimen/dp_15"
>
<TextView
<TextView
android:id=
"@+id/tv_title"
android:id=
"@+id/tv_title"
...
@@ -74,7 +75,7 @@
...
@@ -74,7 +75,7 @@
android:tag=
"7"
android:tag=
"7"
android:text=
"@string/Key_7"
android:text=
"@string/Key_7"
android:textColor=
"@color/table_input_table_keypad"
android:textColor=
"@color/table_input_table_keypad"
android:textSize=
"@dimen/dp_3
0
"
/>
android:textSize=
"@dimen/dp_3
5
"
/>
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id=
"@+id/btn_8"
android:id=
"@+id/btn_8"
...
@@ -88,7 +89,7 @@
...
@@ -88,7 +89,7 @@
android:tag=
"8"
android:tag=
"8"
android:text=
"@string/Key_8"
android:text=
"@string/Key_8"
android:textColor=
"@color/table_input_table_keypad"
android:textColor=
"@color/table_input_table_keypad"
android:textSize=
"@dimen/dp_3
0
"
/>
android:textSize=
"@dimen/dp_3
5
"
/>
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id=
"@+id/btn_9"
android:id=
"@+id/btn_9"
...
@@ -101,7 +102,7 @@
...
@@ -101,7 +102,7 @@
android:tag=
"9"
android:tag=
"9"
android:text=
"@string/Key_9"
android:text=
"@string/Key_9"
android:textColor=
"@color/table_input_table_keypad"
android:textColor=
"@color/table_input_table_keypad"
android:textSize=
"@dimen/dp_3
0
"
/>
android:textSize=
"@dimen/dp_3
5
"
/>
</TableRow>
</TableRow>
<TableRow
<TableRow
...
@@ -123,7 +124,7 @@
...
@@ -123,7 +124,7 @@
android:tag=
"4"
android:tag=
"4"
android:text=
"@string/Key_4"
android:text=
"@string/Key_4"
android:textColor=
"@color/table_input_table_keypad"
android:textColor=
"@color/table_input_table_keypad"
android:textSize=
"@dimen/dp_3
0
"
/>
android:textSize=
"@dimen/dp_3
5
"
/>
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id=
"@+id/btn_5"
android:id=
"@+id/btn_5"
...
@@ -138,7 +139,7 @@
...
@@ -138,7 +139,7 @@
android:tag=
"5"
android:tag=
"5"
android:text=
"@string/Key_5"
android:text=
"@string/Key_5"
android:textColor=
"@color/table_input_table_keypad"
android:textColor=
"@color/table_input_table_keypad"
android:textSize=
"@dimen/dp_3
0
"
/>
android:textSize=
"@dimen/dp_3
5
"
/>
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id=
"@+id/btn_6"
android:id=
"@+id/btn_6"
...
@@ -152,7 +153,7 @@
...
@@ -152,7 +153,7 @@
android:tag=
"6"
android:tag=
"6"
android:text=
"@string/Key_6"
android:text=
"@string/Key_6"
android:textColor=
"@color/table_input_table_keypad"
android:textColor=
"@color/table_input_table_keypad"
android:textSize=
"@dimen/dp_3
0
"
/>
android:textSize=
"@dimen/dp_3
5
"
/>
</TableRow>
</TableRow>
<TableRow
<TableRow
...
@@ -174,7 +175,7 @@
...
@@ -174,7 +175,7 @@
android:tag=
"1"
android:tag=
"1"
android:text=
"@string/Key_1"
android:text=
"@string/Key_1"
android:textColor=
"@color/table_input_table_keypad"
android:textColor=
"@color/table_input_table_keypad"
android:textSize=
"@dimen/dp_3
0
"
/>
android:textSize=
"@dimen/dp_3
5
"
/>
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id=
"@+id/btn_2"
android:id=
"@+id/btn_2"
...
@@ -189,7 +190,7 @@
...
@@ -189,7 +190,7 @@
android:tag=
"2"
android:tag=
"2"
android:text=
"@string/Key_2"
android:text=
"@string/Key_2"
android:textColor=
"@color/table_input_table_keypad"
android:textColor=
"@color/table_input_table_keypad"
android:textSize=
"@dimen/dp_3
0
"
/>
android:textSize=
"@dimen/dp_3
5
"
/>
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id=
"@+id/btn_3"
android:id=
"@+id/btn_3"
...
@@ -203,7 +204,7 @@
...
@@ -203,7 +204,7 @@
android:tag=
"3"
android:tag=
"3"
android:text=
"@string/Key_3"
android:text=
"@string/Key_3"
android:textColor=
"@color/table_input_table_keypad"
android:textColor=
"@color/table_input_table_keypad"
android:textSize=
"@dimen/dp_3
0
"
/>
android:textSize=
"@dimen/dp_3
5
"
/>
</TableRow>
</TableRow>
<TableRow
<TableRow
...
@@ -241,7 +242,7 @@
...
@@ -241,7 +242,7 @@
android:tag=
"0"
android:tag=
"0"
android:text=
"@string/Key_0"
android:text=
"@string/Key_0"
android:textColor=
"@color/table_input_table_keypad"
android:textColor=
"@color/table_input_table_keypad"
android:textSize=
"@dimen/dp_3
0
"
/>
android:textSize=
"@dimen/dp_3
5
"
/>
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id=
"@+id/btn_add10"
android:id=
"@+id/btn_add10"
...
@@ -257,7 +258,7 @@
...
@@ -257,7 +258,7 @@
android:tag=
"99"
android:tag=
"99"
android:text=
"+10"
android:text=
"+10"
android:textColor=
"@color/table_input_table_keypad"
android:textColor=
"@color/table_input_table_keypad"
android:textSize=
"@dimen/dp_
28
"
/>
android:textSize=
"@dimen/dp_
30
"
/>
</TableRow>
</TableRow>
</TableLayout>
</TableLayout>
...
@@ -278,7 +279,7 @@
...
@@ -278,7 +279,7 @@
android:tag=
"98"
android:tag=
"98"
android:text=
"×"
android:text=
"×"
android:textColor=
"#1196DB"
android:textColor=
"#1196DB"
android:textSize=
"@dimen/dp_
2
5"
android:textSize=
"@dimen/dp_
3
5"
android:textStyle=
"bold"
/>
android:textStyle=
"bold"
/>
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
...
@@ -293,7 +294,7 @@
...
@@ -293,7 +294,7 @@
android:tag=
"98"
android:tag=
"98"
android:text=
"@string/Key_right"
android:text=
"@string/Key_right"
android:textColor=
"@color/theme_white_color"
android:textColor=
"@color/theme_white_color"
android:textSize=
"@dimen/dp_
2
5"
android:textSize=
"@dimen/dp_
3
5"
android:textStyle=
"bold"
/>
android:textStyle=
"bold"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
...
...
table-module/src/main/res/layout/table_item_food_summary.xml
0 → 100644
View file @
654437d8
<?xml version="1.0" encoding="utf-8"?>
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/btn_summary"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:textSize=
"@dimen/dp_14"
android:textColor=
"@color/theme_text_color_black"
android:text=
"早餐"
android:ellipsize=
"end"
android:maxLines=
"1"
android:paddingTop=
"@dimen/dp_8"
android:paddingBottom=
"@dimen/dp_8"
android:layout_margin=
"@dimen/dp_5"
app:qmui_borderColor=
"@color/theme_text_color_black"
app:qmui_radius=
"@dimen/dp_5"
app:qmui_backgroundColor=
"@color/theme_white_color"
>
</com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton>
\ No newline at end of file
table-module/src/main/res/layout/table_item_skyorder.xml
View file @
654437d8
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundRelativeLayout
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundRelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"@dimen/dp_80"
android:id=
"@+id/rl_skyorder"
android:layout_height=
"@dimen/dp_80"
android:layout_width=
"@dimen/dp_65"
android:layout_height=
"@dimen/dp_65"
android:layout_marginBottom=
"@dimen/dp_25"
android:gravity=
"center"
android:layout_alignParentBottom=
"true"
android:layout_alignParentBottom=
"true"
android:layout_centerHorizontal=
"true"
android:layout_centerHorizontal=
"true"
android:layout_above=
"@+id/rv_bottom_function"
android:gravity=
"center"
android:orientation=
"vertical"
android:orientation=
"vertical"
app:qmui_backgroundColor=
"@color/theme_color"
app:qmui_backgroundColor=
"@color/theme_color"
>
app:qmui_borderColor=
"@color/theme_hint_color"
>
<
Text
View
<
Image
View
android:id=
"@+id/
tv_nam
e"
android:id=
"@+id/
iv_skyorder_qrcod
e"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:drawableTint=
"@color/theme_white_color"
android:src=
"@mipmap/table_skyorder_qrcode"
android:drawableTop=
"@mipmap/table_skyorder_qrcode"
android:tint=
"@color/theme_white_color"
/>
android:text=
"skyorder"
android:layout_marginTop=
"@dimen/dp_5"
android:textColor=
"@color/theme_white_color"
android:textSize=
"@dimen/font_normal"
/>
<ImageView
<ImageView
android:id=
"@+id/iv_lock"
android:id=
"@+id/iv_lock"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:
tint=
"@color/theme_white_color
"
android:
layout_below=
"@+id/iv_skyorder_qrcode
"
android:
layout_below=
"@+id/tv_name
"
android:
src=
"@drawable/qrcode_time_lock
"
android:
src=
"@drawable/qrcode_time_lock"
/>
android:
tint=
"@color/theme_white_color"
/>
</com.qmuiteam.qmui.widget.roundwidget.QMUIRoundRelativeLayout>
</com.qmuiteam.qmui.widget.roundwidget.QMUIRoundRelativeLayout>
\ No newline at end of file
table-module/src/main/res/layout/table_item_skyorder_meal_lenght.xml
0 → 100644
View file @
654437d8
<?xml version="1.0" encoding="utf-8"?>
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/tv_name"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:paddingTop=
"@dimen/dp_15"
android:paddingBottom=
"@dimen/dp_15"
android:paddingRight=
"@dimen/dp_10"
android:paddingLeft=
"@dimen/dp_20"
android:gravity=
"center_vertical"
android:text=
"餐檯模式"
android:textColor=
"@color/theme_text_color_black"
android:textSize=
"@dimen/dp_18"
android:textStyle=
"bold"
/>
table-module/src/main/res/layout/table_item_table_bottom.xml
View file @
654437d8
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
android:layout_height=
"@dimen/dp_55"
android:layout_height=
"@dimen/dp_55"
android:gravity=
"center"
android:gravity=
"center"
android:orientation=
"vertical"
android:orientation=
"vertical"
android:background=
"@
drawable/ui_selector_item_background
"
>
android:background=
"@
color/theme_white_color
"
>
<ImageView
<ImageView
android:id=
"@+id/iv_icon"
android:id=
"@+id/iv_icon"
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
android:layout_marginTop=
"@dimen/dp_5"
android:layout_marginTop=
"@dimen/dp_5"
android:src=
"@mipmap/ic_launcher"
/>
android:src=
"@mipmap/ic_launcher"
/>
<TextView
<
com.qmuiteam.qmui.alpha.QMUIAlpha
TextView
android:id=
"@+id/tv_name"
android:id=
"@+id/tv_name"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
...
@@ -21,5 +21,4 @@
...
@@ -21,5 +21,4 @@
android:layout_marginTop=
"@dimen/dp_5"
android:layout_marginTop=
"@dimen/dp_5"
android:textColor=
"@color/theme_black"
android:textColor=
"@color/theme_black"
android:textSize=
"@dimen/font_normal"
/>
android:textSize=
"@dimen/font_normal"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
table-module/src/main/res/mipmap-
x
hdpi/table_skyorder_qrcode.png
→
table-module/src/main/res/mipmap-hdpi/table_skyorder_qrcode.png
View file @
654437d8
File moved
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