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
f99df214
Commit
f99df214
authored
Nov 19, 2020
by
宁斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
餐檯輪訓調整
parent
2abd64bd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
44 changed files
with
491 additions
and
358 deletions
+491
-358
arms/src/main/java/com/jess/arms/http/log/DefaultFormatPrinter.java
+1
-1
base-module/src/main/java/com/gingersoft/gsa/cloud/base/utils/log/LogUtil.java
+1
-1
base-module/src/main/java/com/gingersoft/gsa/cloud/config/expandconfig/ExpandInfoSetting.java
+5
-0
base-module/src/main/java/com/gingersoft/gsa/cloud/config/globalconfig/applyOptions/MyResponseErrorListener.java
+9
-9
base-module/src/main/java/com/gingersoft/gsa/cloud/constans/HttpsConstans.java
+4
-3
base-module/src/main/java/com/gingersoft/gsa/cloud/function/FunctionManager.java
+1
-1
base-module/src/main/java/com/gingersoft/gsa/cloud/print/bean/PrintContent.java
+0
-1
database-module/src/main/java/com/gingersoft/gsa/cloud/database/bean/Discount.java
+50
-10
database-module/src/main/java/com/gingersoft/gsa/cloud/database/bean/PrintCurrencyBean.java
+1
-1
delivery_pick_module/src/main/java/com/gingersoft/gsa/delivery_pick_mode/data/network/ServiceCreator.kt
+0
-1
delivery_pick_module/src/main/java/com/gingersoft/gsa/delivery_pick_mode/model/viewModel/PageViewModel.kt
+1
-2
login-module/src/main/AndroidManifest.xml
+0
-1
order-base/src/main/java/com/gingersoft/gsa/cloud/base/order/bean/response/OrderDiscountResponse.java
+5
-48
order-base/src/main/java/com/gingersoft/gsa/cloud/base/order/commodity/OrderDetail.java
+1
-1
print-module/src/main/java/com/joe/print/mvp/print/PrintPrjKitchen.java
+26
-13
print-module/src/main/java/com/joe/print/mvp/print/service/PrjService.java
+2
-2
print-module/src/main/java/com/joe/print/mvp/print/utils/MyPrintUtils.java
+1
-1
table-base/src/main/java/com/gingersoft/gsa/cloud/base/table/bean/TableBean.java
+7
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/ComponentTable.java
+2
-0
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/OrderContentModel.java
+2
-1
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/TableModel.java
+6
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/bean/FoodSummary.java
+1
-1
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/bean/request/AddOrderRequest.java
+10
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/bean/request/CreateOrderRequest.java
+2
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/discount/BillDiscountAction.java
+5
-5
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/discount/MealDiscountAction.java
+7
-5
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/service/TableService.java
+3
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/PrintSkyorderAction.java
+3
-2
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/ResetSkyorderAction.java
+62
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/TableAction.java
+15
-7
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/BaseOrderPresenter.java
+11
-5
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/MealStandPresenter.java
+6
-58
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/OrderContentPresenter.java
+50
-63
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/OrderPayPresenter.java
+6
-6
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/TablePresenter.java
+80
-48
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/MealStandActivity.java
+4
-1
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/OrderContentActivity.java
+34
-25
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/TableActivity.java
+25
-6
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/BottomFunctionAdapter.java
+1
-1
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/widget/SkyOrderDialog.java
+1
-1
table-module/src/main/res/layout/table_activity_order_content.xml
+2
-2
table-module/src/main/res/layout/table_activity_table.xml
+28
-19
table-module/src/main/res/layout/table_item_skyorder.xml
+6
-6
No files found.
arms/src/main/java/com/jess/arms/http/log/DefaultFormatPrinter.java
View file @
f99df214
...
@@ -73,7 +73,7 @@ public class DefaultFormatPrinter implements FormatPrinter {
...
@@ -73,7 +73,7 @@ public class DefaultFormatPrinter implements FormatPrinter {
*
*
* @param request
* @param request
* @param bodyString
* @param bodyString
*/
*/
@Override
@Override
public
void
printJsonRequest
(
Request
request
,
String
bodyString
)
{
public
void
printJsonRequest
(
Request
request
,
String
bodyString
)
{
final
String
requestBody
=
LINE_SEPARATOR
+
BODY_TAG
+
LINE_SEPARATOR
+
bodyString
;
final
String
requestBody
=
LINE_SEPARATOR
+
BODY_TAG
+
LINE_SEPARATOR
+
bodyString
;
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/base/utils/log/LogUtil.java
View file @
f99df214
...
@@ -13,7 +13,7 @@ public class LogUtil {
...
@@ -13,7 +13,7 @@ public class LogUtil {
//可以全局控制是否打印log日志
//可以全局控制是否打印log日志
private
static
boolean
isPrintLog
=
true
;
private
static
boolean
isPrintLog
=
true
;
private
static
int
LOG_MAXLENGTH
=
5
000
;
private
static
int
LOG_MAXLENGTH
=
10
000
;
private
final
static
String
TAG
=
"LogUtil"
;
private
final
static
String
TAG
=
"LogUtil"
;
public
static
void
v
(
String
msg
)
{
public
static
void
v
(
String
msg
)
{
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/config/expandconfig/ExpandInfoSetting.java
View file @
f99df214
...
@@ -114,6 +114,11 @@ public class ExpandInfoSetting {
...
@@ -114,6 +114,11 @@ public class ExpandInfoSetting {
}
}
/**
* 掃碼獲取擴展類信息
* @param obj
* @return
*/
private
static
List
<
ExpandInfoSetting
>
scanExtendedConfiguration
(
Object
obj
)
{
private
static
List
<
ExpandInfoSetting
>
scanExtendedConfiguration
(
Object
obj
)
{
List
<
ExpandInfoSetting
>
expandInfoList
=
new
ArrayList
<>();
List
<
ExpandInfoSetting
>
expandInfoList
=
new
ArrayList
<>();
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/config/globalconfig/applyOptions/MyResponseErrorListener.java
View file @
f99df214
...
@@ -74,15 +74,15 @@ public class MyResponseErrorListener implements ResponseErrorListener {
...
@@ -74,15 +74,15 @@ public class MyResponseErrorListener implements ResponseErrorListener {
showloggedDialog
(
activity
,
ArmsUtils
.
getString
(
context
,
R
.
string
.
response_error_request_logged
));
showloggedDialog
(
activity
,
ArmsUtils
.
getString
(
context
,
R
.
string
.
response_error_request_logged
));
}
}
}
else
{
}
else
{
if
(
httpException
.
code
()
==
400
)
{
//
if (httpException.code() == 400) {
//Bad Request
//
//Bad Request
Activity
activity
=
GsaCloudApplication
.
getAppContext
().
getCurrentActivity
();
//
Activity activity = GsaCloudApplication.getAppContext().getCurrentActivity();
if
(
activity
==
null
||
!
activity
.
getClass
().
getSimpleName
().
equals
(
"LoginActivity"
))
{
//
if (activity == null || !activity.getClass().getSimpleName().equals("LoginActivity")) {
//不处于登录页面 返回到登录页
//
//不处于登录页面 返回到登录页
ArmsUtils
.
killAll
();
//
ArmsUtils.killAll();
toLoginActivity
(
activity
);
//
toLoginActivity(activity);
}
//
}
}
//
}
msg
=
httpException
.
message
();
msg
=
httpException
.
message
();
}
}
return
msg
;
return
msg
;
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/constans/HttpsConstans.java
View file @
f99df214
...
@@ -37,7 +37,7 @@ public class HttpsConstans {
...
@@ -37,7 +37,7 @@ public class HttpsConstans {
private
static
String
HTTP_ADDRESS_URL_FORMAL
=
"https://m.ricepon.com:8444"
;
//正式服務器
private
static
String
HTTP_ADDRESS_URL_FORMAL
=
"https://m.ricepon.com:8444"
;
//正式服務器
private
static
String
HTTP_ADDRESS_URL_SZ
=
"http://gingersoft.tpddns.cn:58201"
;
//深圳測試
private
static
String
HTTP_ADDRESS_URL_SZ
=
"http://gingersoft.tpddns.cn:58201"
;
//深圳測試
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/"
;
//雲端GSA路徑
public
static
String
CLOUD_GSA_API_PATH
=
"/ricepon-cloud-gsa/api/"
;
//雲端GSA路徑
public
static
String
RESTAURANT_API_PATH
=
"/ricepon-restaurant/api/"
;
//餐廳模塊路徑
public
static
String
RESTAURANT_API_PATH
=
"/ricepon-restaurant/api/"
;
//餐廳模塊路徑
...
@@ -77,8 +77,9 @@ public class HttpsConstans {
...
@@ -77,8 +77,9 @@ public class HttpsConstans {
public
static
String
API_RICEPON_MEMBER
=
"/ricepon-member/api/"
;
public
static
String
API_RICEPON_MEMBER
=
"/ricepon-member/api/"
;
//---------------------------------------打印skyorder QRCode----------------------------------------------------------------------------------
//---------------------------------------打印skyorder QRCode----------------------------------------------------------------------------------
public
static
final
String
PRINT_QRCODE_ADDRESS_URL_FORMAL
=
"http://m.ricepon.com"
;
public
static
final
String
PRINT_QRCODE_SUFFIX
=
"/member-web/qrcode/qrcode.html?WMP0&?arg="
;
public
static
final
String
PRINT_QRCODE_SUFFIX
=
"/member-web/qrcode/qrcode.html?WMP0&?arg="
;
public
static
String
PRINT_QRCODE_ADDRESS
=
HTTP_ADDRESS_URL_HK
+
PRINT_QRCODE_SUFFIX
;
public
static
String
PRINT_QRCODE_ADDRESS
=
PRINT_QRCODE_ADDRESS_URL_FORMAL
+
PRINT_QRCODE_SUFFIX
;
//--------------------------------------配置-----------------------------------------------------------------------------------
//--------------------------------------配置-----------------------------------------------------------------------------------
...
@@ -207,7 +208,7 @@ public class HttpsConstans {
...
@@ -207,7 +208,7 @@ public class HttpsConstans {
ricepon_cloud_gsa
=
HttpsConstans
.
ROOT_URL
+
HttpsConstans
.
CLOUD_GSA_API_PATH
;
ricepon_cloud_gsa
=
HttpsConstans
.
ROOT_URL
+
HttpsConstans
.
CLOUD_GSA_API_PATH
;
ricepon_member
=
HttpsConstans
.
ROOT_URL
+
API_RICEPON_MEMBER
;
ricepon_member
=
HttpsConstans
.
ROOT_URL
+
API_RICEPON_MEMBER
;
PRINT_QRCODE_ADDRESS
=
ROOT_SERVER
+
PRINT_QRCODE_SUFFIX
;
// PRINT_QRCODE_ADDRESS = PRINT_QRCODE_ADDRESS_URL_FORMAL
+ PRINT_QRCODE_SUFFIX;
}
}
public
static
String
ricepon_wechat
;
public
static
String
ricepon_wechat
;
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/function/FunctionManager.java
View file @
f99df214
...
@@ -35,7 +35,7 @@ public class FunctionManager {
...
@@ -35,7 +35,7 @@ public class FunctionManager {
FunctionDaoUtils
daoUtils
=
new
FunctionDaoUtils
(
context
);
FunctionDaoUtils
daoUtils
=
new
FunctionDaoUtils
(
context
);
List
<
Function
>
functionList
=
daoUtils
.
queryAllFunction
();
List
<
Function
>
functionList
=
daoUtils
.
queryAllFunction
();
return
filterFunctionByResLoction
(
functionList
,
fModules
,
resLoction
);
return
filterFunctionByResLoction
(
functionList
,
fModules
,
resLoction
);
}
}
private
List
<
Function
>
filterFunctionByResLoction
(
List
<
Function
>
functionList
,
FModule
[]
fModules
,
String
resLoction
)
{
private
List
<
Function
>
filterFunctionByResLoction
(
List
<
Function
>
functionList
,
FModule
[]
fModules
,
String
resLoction
)
{
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/print/bean/PrintContent.java
View file @
f99df214
...
@@ -8,5 +8,4 @@ package com.gingersoft.gsa.cloud.print.bean;
...
@@ -8,5 +8,4 @@ package com.gingersoft.gsa.cloud.print.bean;
* */
* */
public
interface
PrintContent
{
public
interface
PrintContent
{
}
}
database-module/src/main/java/com/gingersoft/gsa/cloud/database/bean/Discount.java
View file @
f99df214
package
com
.
gingersoft
.
gsa
.
cloud
.
database
.
bean
;
package
com
.
gingersoft
.
gsa
.
cloud
.
database
.
bean
;
import
androidx.annotation.NonNull
;
import
org.greenrobot.greendao.annotation.Entity
;
import
org.greenrobot.greendao.annotation.Entity
;
import
org.greenrobot.greendao.annotation.Id
;
import
org.greenrobot.greendao.annotation.Id
;
import
org.greenrobot.greendao.annotation.Property
;
import
org.greenrobot.greendao.annotation.Property
;
...
@@ -18,7 +20,7 @@ import org.greenrobot.greendao.annotation.Generated;
...
@@ -18,7 +20,7 @@ import org.greenrobot.greendao.annotation.Generated;
*/
*/
@Data
@Data
@Entity
@Entity
public
class
Discount
{
public
class
Discount
implements
Cloneable
{
/**
/**
...
@@ -146,13 +148,13 @@ public class Discount {
...
@@ -146,13 +148,13 @@ public class Discount {
@Generated
(
hash
=
1938515536
)
@Generated
(
hash
=
1938515536
)
public
Discount
(
Long
id
,
int
restaurantId
,
double
amount
,
int
discountValue
,
public
Discount
(
Long
id
,
int
restaurantId
,
double
amount
,
int
discountValue
,
int
type
,
String
discountType
,
int
status
,
String
remark
,
int
type
,
String
discountType
,
int
status
,
String
remark
,
byte
freeServiceCharge
,
byte
managerApproval
,
String
color
,
byte
freeServiceCharge
,
byte
managerApproval
,
String
color
,
String
placeOrderType
,
double
discountCap
,
double
salesAmount
,
String
placeOrderType
,
double
discountCap
,
double
salesAmount
,
byte
taxFree
,
byte
exclusive
,
byte
pause
,
byte
additionalDiscount
,
byte
taxFree
,
byte
exclusive
,
byte
pause
,
byte
additionalDiscount
,
byte
onlyOnce
,
double
minBillAmount
,
byte
pointsDeduction
,
byte
onlyOnce
,
double
minBillAmount
,
byte
pointsDeduction
,
byte
wholeFreePoints
,
byte
amountTypeMin
,
String
beginTime
,
byte
wholeFreePoints
,
byte
amountTypeMin
,
String
beginTime
,
String
endTime
)
{
String
endTime
)
{
this
.
id
=
id
;
this
.
id
=
id
;
this
.
restaurantId
=
restaurantId
;
this
.
restaurantId
=
restaurantId
;
this
.
amount
=
amount
;
this
.
amount
=
amount
;
...
@@ -180,10 +182,40 @@ public class Discount {
...
@@ -180,10 +182,40 @@ public class Discount {
this
.
endTime
=
endTime
;
this
.
endTime
=
endTime
;
}
}
@Generated
(
hash
=
1777606421
)
@Generated
(
hash
=
1777606421
)
public
Discount
()
{
public
Discount
()
{
}
}
public
Discount
(
Discount
discount
)
{
this
.
id
=
discount
.
id
;
this
.
restaurantId
=
discount
.
restaurantId
;
this
.
amount
=
discount
.
amount
;
this
.
discountValue
=
discount
.
discountValue
;
this
.
type
=
discount
.
type
;
this
.
discountType
=
discount
.
discountType
;
this
.
status
=
discount
.
status
;
this
.
remark
=
discount
.
remark
;
this
.
freeServiceCharge
=
discount
.
freeServiceCharge
;
this
.
managerApproval
=
discount
.
managerApproval
;
this
.
color
=
discount
.
color
;
this
.
placeOrderType
=
discount
.
placeOrderType
;
this
.
discountCap
=
discount
.
discountCap
;
this
.
salesAmount
=
discount
.
salesAmount
;
this
.
taxFree
=
discount
.
taxFree
;
this
.
exclusive
=
discount
.
exclusive
;
this
.
pause
=
discount
.
pause
;
this
.
additionalDiscount
=
discount
.
additionalDiscount
;
this
.
onlyOnce
=
discount
.
onlyOnce
;
this
.
minBillAmount
=
discount
.
minBillAmount
;
this
.
pointsDeduction
=
discount
.
pointsDeduction
;
this
.
wholeFreePoints
=
discount
.
wholeFreePoints
;
this
.
amountTypeMin
=
discount
.
amountTypeMin
;
this
.
beginTime
=
discount
.
beginTime
;
this
.
endTime
=
discount
.
endTime
;
this
.
memberId
=
discount
.
memberId
;
this
.
discountRecordId
=
discount
.
discountRecordId
;
}
public
Long
getId
()
{
public
Long
getId
()
{
return
this
.
id
;
return
this
.
id
;
...
@@ -390,6 +422,14 @@ public class Discount {
...
@@ -390,6 +422,14 @@ public class Discount {
}
}
@NonNull
@Override
public
Discount
clone
()
{
try
{
return
(
Discount
)
super
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
e
.
printStackTrace
();
}
return
new
Discount
(
this
);
}
}
}
database-module/src/main/java/com/gingersoft/gsa/cloud/database/bean/PrintCurrencyBean.java
View file @
f99df214
...
@@ -18,7 +18,7 @@ public class PrintCurrencyBean implements Serializable {
...
@@ -18,7 +18,7 @@ public class PrintCurrencyBean implements Serializable {
private
String
name
;
private
String
name
;
private
Integer
restaurantId
;
private
Integer
restaurantId
;
private
int
type
;
//1堂食,2外賣
private
int
type
;
//1堂食,2外賣
,3skyorder
private
int
foodComplexion
;
//食品顔色 0 黑色 2 紅色
private
int
foodComplexion
;
//食品顔色 0 黑色 2 紅色
private
int
modifierComplexion
;
//細項顔色 0 黑色 2 紅色
private
int
modifierComplexion
;
//細項顔色 0 黑色 2 紅色
private
int
deletes
;
//是否刪除 0 正常 1 刪除
private
int
deletes
;
//是否刪除 0 正常 1 刪除
...
...
delivery_pick_module/src/main/java/com/gingersoft/gsa/delivery_pick_mode/data/network/ServiceCreator.kt
View file @
f99df214
...
@@ -8,7 +8,6 @@ import com.gingersoft.gsa.cloud.constans.AppConstans
...
@@ -8,7 +8,6 @@ import com.gingersoft.gsa.cloud.constans.AppConstans
import
com.gingersoft.gsa.cloud.constans.HttpsConstans
import
com.gingersoft.gsa.cloud.constans.HttpsConstans
import
com.gingersoft.gsa.cloud.constans.HttpsConstans.ROOT_SERVER
import
com.gingersoft.gsa.cloud.constans.HttpsConstans.ROOT_SERVER
import
com.gingersoft.gsa.cloud.constans.HttpsConstans.URK_RICEPON_GSA
import
com.gingersoft.gsa.cloud.constans.HttpsConstans.URK_RICEPON_GSA
import
com.gingersoft.gsa.cloud.config.globalconfig.applyOptions.intercept.LoggingInterceptor
import
com.jess.arms.utils.DeviceUtils
import
com.jess.arms.utils.DeviceUtils
import
okhttp3.Headers
import
okhttp3.Headers
import
okhttp3.Interceptor
import
okhttp3.Interceptor
...
...
delivery_pick_module/src/main/java/com/gingersoft/gsa/delivery_pick_mode/model/viewModel/PageViewModel.kt
View file @
f99df214
...
@@ -206,7 +206,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
...
@@ -206,7 +206,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
}
}
}
}
}
}
confirmOrder
(
orderDetail
,
2
,
trafficType
,
restaurantId
,
isPrintPrj
=
true
,
isPrintBill
=
fals
e
)
{
confirmOrder
(
orderDetail
,
2
,
trafficType
,
restaurantId
,
isPrintPrj
=
true
,
isPrintBill
=
tru
e
)
{
//確認之後,刷新列表
//確認之後,刷新列表
refreshState
.
postValue
(
0
)
refreshState
.
postValue
(
0
)
}
}
...
@@ -390,7 +390,6 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
...
@@ -390,7 +390,6 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
})
})
}
}
fun
confirmOrder
(
dataBean
:
OrderDetails
.
DataBean
,
status
:
Int
,
trafficType
:
String
=
""
,
restaurantId
:
Int
,
isPrintPrj
:
Boolean
=
true
,
isPrintBill
:
Boolean
=
true
,
listener
:
(
MessageBean
)
->
Unit
)
{
fun
confirmOrder
(
dataBean
:
OrderDetails
.
DataBean
,
status
:
Int
,
trafficType
:
String
=
""
,
restaurantId
:
Int
,
isPrintPrj
:
Boolean
=
true
,
isPrintBill
:
Boolean
=
true
,
listener
:
(
MessageBean
)
->
Unit
)
{
launch
({
launch
({
when
(
dataBean
.
companyType
)
{
when
(
dataBean
.
companyType
)
{
...
...
login-module/src/main/AndroidManifest.xml
View file @
f99df214
...
@@ -59,7 +59,6 @@
...
@@ -59,7 +59,6 @@
<meta-data
<meta-data
android:name=
"design_height_in_dp"
android:name=
"design_height_in_dp"
android:value=
"640"
/>
android:value=
"640"
/>
<meta-data
<meta-data
android:name=
"android.max_aspect"
android:name=
"android.max_aspect"
android:value=
"2.4"
/>
android:value=
"2.4"
/>
...
...
order-base/src/main/java/com/gingersoft/gsa/cloud/base/order/bean/response/OrderDiscountResponse.java
View file @
f99df214
package
com
.
gingersoft
.
gsa
.
cloud
.
base
.
order
.
bean
.
response
;
package
com
.
gingersoft
.
gsa
.
cloud
.
base
.
order
.
bean
.
response
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
import
java.io.Serializable
;
import
lombok.Data
;
import
lombok.Data
;
/**
/**
...
@@ -12,7 +11,7 @@ import lombok.Data;
...
@@ -12,7 +11,7 @@ import lombok.Data;
* @description:
* @description:
*/
*/
@Data
@Data
public
class
OrderDiscountResponse
implements
Parcel
able
{
public
class
OrderDiscountResponse
implements
Serializ
able
{
/**
/**
* 餐廳折扣ID
* 餐廳折扣ID
...
@@ -42,55 +41,13 @@ public class OrderDiscountResponse implements Parcelable {
...
@@ -42,55 +41,13 @@ public class OrderDiscountResponse implements Parcelable {
/**
/**
* 优惠券折扣相关
* 优惠券折扣相关
*/
*/
// 消費滿
/**
* 消費滿
*/
private
Double
spend
;
private
Double
spend
;
/**
/**
* 是否累計滿減:0否,1是
* 是否累計滿減:0否,1是
*/
*/
private
Byte
accumulate
;
private
Byte
accumulate
;
@Override
public
int
describeContents
()
{
return
0
;
}
@Override
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
dest
.
writeValue
(
this
.
discountId
);
dest
.
writeDouble
(
this
.
discountAmount
);
dest
.
writeInt
(
this
.
discountValue
);
dest
.
writeInt
(
this
.
type
);
dest
.
writeByte
(
this
.
discountType
);
dest
.
writeString
(
this
.
remark
);
dest
.
writeString
(
this
.
remark2
);
dest
.
writeString
(
this
.
remark3
);
dest
.
writeValue
(
this
.
spend
);
dest
.
writeValue
(
this
.
accumulate
);
}
protected
OrderDiscountResponse
(
Parcel
in
)
{
this
.
discountId
=
(
Long
)
in
.
readValue
(
Long
.
class
.
getClassLoader
());
this
.
discountAmount
=
in
.
readDouble
();
this
.
discountValue
=
in
.
readInt
();
this
.
type
=
in
.
readInt
();
this
.
discountType
=
in
.
readByte
();
this
.
remark
=
in
.
readString
();
this
.
remark2
=
in
.
readString
();
this
.
remark3
=
in
.
readString
();
this
.
spend
=
(
Double
)
in
.
readValue
(
Double
.
class
.
getClassLoader
());
this
.
accumulate
=
(
Byte
)
in
.
readValue
(
Byte
.
class
.
getClassLoader
());
}
public
static
final
Creator
<
OrderDiscountResponse
>
CREATOR
=
new
Creator
<
OrderDiscountResponse
>()
{
@Override
public
OrderDiscountResponse
createFromParcel
(
Parcel
source
)
{
return
new
OrderDiscountResponse
(
source
);
}
@Override
public
OrderDiscountResponse
[]
newArray
(
int
size
)
{
return
new
OrderDiscountResponse
[
size
];
}
};
}
}
order-base/src/main/java/com/gingersoft/gsa/cloud/base/order/commodity/OrderDetail.java
View file @
f99df214
...
@@ -1222,7 +1222,7 @@ public class OrderDetail implements Commodity, Serializable {
...
@@ -1222,7 +1222,7 @@ public class OrderDetail implements Commodity, Serializable {
public
static
OrderDetail
modifierTransOrderDetail
(
Modifier
modifier
,
long
id
,
long
productId
,
int
number
)
{
public
static
OrderDetail
modifierTransOrderDetail
(
Modifier
modifier
,
long
id
,
long
productId
,
int
number
)
{
OrderDetail
orderDetail
=
new
OrderDetail
();
OrderDetail
orderDetail
=
new
OrderDetail
();
orderDetail
.
setProductName
(
modifier
.
getModifierName
());
orderDetail
.
setProductName
(
modifier
.
getModifierName
());
modifier
.
getKtPrintMainItem
(
);
orderDetail
.
setKtPrintMainItem
(
modifier
.
getKtPrintMainItem
()
);
orderDetail
.
setTopId
(
modifier
.
getTopId
());
orderDetail
.
setTopId
(
modifier
.
getTopId
());
orderDetail
.
setParentId
(
id
);
orderDetail
.
setParentId
(
id
);
orderDetail
.
setProductId
(
modifier
.
getMid
());
orderDetail
.
setProductId
(
modifier
.
getMid
());
...
...
print-module/src/main/java/com/joe/print/mvp/print/PrintPrjKitchen.java
View file @
f99df214
...
@@ -152,19 +152,32 @@ public class PrintPrjKitchen extends PrinterRoot {
...
@@ -152,19 +152,32 @@ public class PrintPrjKitchen extends PrinterRoot {
}
}
if
(
TextUtil
.
isEmptyOrNullOrUndefined
(
prjBean
.
getTableName
()))
{
if
(
TextUtil
.
isEmptyOrNullOrUndefined
(
prjBean
.
getTableName
()))
{
layoutOpenTableTime
.
setVisibility
(
View
.
GONE
);
layoutOpenTableTime
.
setVisibility
(
View
.
GONE
);
if
(
prjBean
.
getOrderType
()
==
7
)
{
switch
(
prjBean
.
getOrderType
())
{
tvTableNumber
.
setText
(
"自取"
);
case
1
:
tvTableNumber2
.
setText
(
"自取"
);
case
3
:
if
(!
TextUtil
.
isEmptyOrNullOrUndefined
(
prjBean
.
getTakeFoodCode
()))
{
tvTableNumber
.
setText
(
"堂食"
);
tvTakeCodeText
.
setVisibility
(
View
.
VISIBLE
);
tvTableNumber2
.
setText
(
"堂食"
);
tvTakeCode
.
setVisibility
(
View
.
VISIBLE
);
if
(!
TextUtil
.
isEmptyOrNullOrUndefined
(
prjBean
.
getTakeFoodCode
()))
{
tvTakeCode
.
setText
(
prjBean
.
getTakeFoodCode
());
tvTakeCodeText
.
setVisibility
(
View
.
VISIBLE
);
}
tvTakeCode
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
tvTakeCode
.
setText
(
prjBean
.
getTakeFoodCode
());
tvTableNumber
.
setText
(
"外賣"
);
}
tvTableNumber2
.
setText
(
"外賣"
);
break
;
tvOrderNumberText
.
setText
(
"訂單碼:"
);
case
7
:
tvOrderNumber
.
setText
(
prjBean
.
getTakeFoodCode
());
tvTableNumber
.
setText
(
"自取"
);
tvTableNumber2
.
setText
(
"自取"
);
if
(!
TextUtil
.
isEmptyOrNullOrUndefined
(
prjBean
.
getTakeFoodCode
()))
{
tvTakeCodeText
.
setVisibility
(
View
.
VISIBLE
);
tvTakeCode
.
setVisibility
(
View
.
VISIBLE
);
tvTakeCode
.
setText
(
prjBean
.
getTakeFoodCode
());
}
break
;
default
:
tvTableNumber
.
setText
(
"外賣"
);
tvTableNumber2
.
setText
(
"外賣"
);
tvOrderNumberText
.
setText
(
"訂單碼:"
);
tvOrderNumber
.
setText
(
prjBean
.
getTakeFoodCode
());
break
;
}
}
}
else
{
}
else
{
tvTableNumber
.
setText
(
prjBean
.
getTableName
());
tvTableNumber
.
setText
(
prjBean
.
getTableName
());
...
...
print-module/src/main/java/com/joe/print/mvp/print/service/PrjService.java
View file @
f99df214
...
@@ -462,8 +462,8 @@ public class PrjService extends Service implements ReceiveListener {
...
@@ -462,8 +462,8 @@ public class PrjService extends Service implements ReceiveListener {
private
PrintCurrencyBean
getPrintCurrencyBean
(
List
<
PrjBean
.
DataBean
.
Bean
>
beans
)
{
private
PrintCurrencyBean
getPrintCurrencyBean
(
List
<
PrjBean
.
DataBean
.
Bean
>
beans
)
{
PrintCurrencyBean
printCurrencyBean
=
null
;
PrintCurrencyBean
printCurrencyBean
=
null
;
if
(
beans
!=
null
&&
beans
.
size
()
>
0
)
{
if
(
beans
!=
null
&&
beans
.
size
()
>
0
)
{
if
(
beans
.
get
(
0
).
getOrderType
()
==
1
)
{
if
(
beans
.
get
(
0
).
getOrderType
()
==
1
||
beans
.
get
(
0
).
getOrderType
()
==
3
)
{
//堂食
//堂食
,skyorder
printCurrencyBean
=
MyPrintUtils
.
getPrintCurrencyBeanByType
(
mContext
,
1
);
printCurrencyBean
=
MyPrintUtils
.
getPrintCurrencyBeanByType
(
mContext
,
1
);
}
else
{
}
else
{
//外賣
//外賣
...
...
print-module/src/main/java/com/joe/print/mvp/print/utils/MyPrintUtils.java
View file @
f99df214
...
@@ -33,7 +33,7 @@ public class MyPrintUtils {
...
@@ -33,7 +33,7 @@ public class MyPrintUtils {
* 通過類型獲取打印通用配置
* 通過類型獲取打印通用配置
*
*
* @param context
* @param context
* @param type 1:堂食,2:外送
* @param type 1:堂食,2:外送
,3:skyorder下單
* @return
* @return
*/
*/
public
static
PrintCurrencyBean
getPrintCurrencyBeanByType
(
Context
context
,
int
type
)
{
public
static
PrintCurrencyBean
getPrintCurrencyBeanByType
(
Context
context
,
int
type
)
{
...
...
table-base/src/main/java/com/gingersoft/gsa/cloud/base/table/bean/TableBean.java
View file @
f99df214
...
@@ -155,8 +155,14 @@ public class TableBean {
...
@@ -155,8 +155,14 @@ public class TableBean {
*/
*/
private
long
summaryId
;
private
long
summaryId
;
/**
* scan表ID
*/
private
Long
scanId
;
public
DataBean
()
{
public
DataBean
()
{
}
}
public
DataBean
(
DataBean
dataBean
)
{
public
DataBean
(
DataBean
dataBean
)
{
...
@@ -183,6 +189,7 @@ public class TableBean {
...
@@ -183,6 +189,7 @@ public class TableBean {
this
.
tableNumber
=
dataBean
.
tableNumber
;
this
.
tableNumber
=
dataBean
.
tableNumber
;
this
.
skyQrCode
=
dataBean
.
skyQrCode
;
this
.
skyQrCode
=
dataBean
.
skyQrCode
;
this
.
summaryId
=
dataBean
.
summaryId
;
this
.
summaryId
=
dataBean
.
summaryId
;
this
.
scanId
=
dataBean
.
scanId
;
}
}
}
}
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/ComponentTable.java
View file @
f99df214
...
@@ -11,6 +11,7 @@ import com.gingersoft.gsa.cloud.table.mvp.ui.activity.orderManager.OrderCenterAc
...
@@ -11,6 +11,7 @@ import com.gingersoft.gsa.cloud.table.mvp.ui.activity.orderManager.OrderCenterAc
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.OrderPayActivity
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.OrderPayActivity
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.TableActivity
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.TableActivity
;
public
class
ComponentTable
implements
IComponent
{
public
class
ComponentTable
implements
IComponent
{
public
static
final
class
table
{
public
static
final
class
table
{
...
@@ -19,6 +20,7 @@ public class ComponentTable implements IComponent {
...
@@ -19,6 +20,7 @@ public class ComponentTable implements IComponent {
*/
*/
public
static
final
FModule
[]
bottom
=
{
public
static
final
FModule
[]
bottom
=
{
new
FModule
(
"table/bottom/init"
,
R
.
mipmap
.
table_init
,
0
),
new
FModule
(
"table/bottom/init"
,
R
.
mipmap
.
table_init
,
0
),
new
FModule
(
"table/bottom/initSkyorder"
,
R
.
mipmap
.
table_paper
,
0
),
new
FModule
(
"table/bottom/move"
,
R
.
mipmap
.
table_move
,
0
),
new
FModule
(
"table/bottom/move"
,
R
.
mipmap
.
table_move
,
0
),
new
FModule
(
"table/bottom/skyorder"
,
0
,
0
),
new
FModule
(
"table/bottom/skyorder"
,
0
,
0
),
new
FModule
(
"table/bottom/splite"
,
R
.
mipmap
.
table_splite
,
0
),
new
FModule
(
"table/bottom/splite"
,
R
.
mipmap
.
table_splite
,
0
),
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/contract/TableContract.java
View file @
f99df214
...
@@ -64,6 +64,8 @@ public interface TableContract {
...
@@ -64,6 +64,8 @@ public interface TableContract {
void
setBottomFunctionVisibility
(
boolean
show
);
void
setBottomFunctionVisibility
(
boolean
show
);
void
setLockVisibility
(
boolean
show
);
void
setLockVisibility
(
boolean
show
);
void
setCenterContentMarginBottom
(
int
bottomMargin
);
}
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
...
@@ -85,6 +87,8 @@ public interface TableContract {
...
@@ -85,6 +87,8 @@ public interface TableContract {
Observable
<
BaseOrderResponse
>
initTable
(
RequestBody
requestBody
);
Observable
<
BaseOrderResponse
>
initTable
(
RequestBody
requestBody
);
Observable
<
BaseResult
>
resetSkyorder
(
RequestBody
requestBody
);
Observable
<
BaseResult
>
getSplitTables
(
int
tableId
);
Observable
<
BaseResult
>
getSplitTables
(
int
tableId
);
Observable
<
BaseResult
>
splitTable
(
int
tableId
);
Observable
<
BaseResult
>
splitTable
(
int
tableId
);
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/OrderContentModel.java
View file @
f99df214
...
@@ -101,7 +101,8 @@ public class OrderContentModel extends BaseModel implements OrderContentContract
...
@@ -101,7 +101,8 @@ public class OrderContentModel extends BaseModel implements OrderContentContract
for
(
Object
o
:
tm
.
keySet
())
{
for
(
Object
o
:
tm
.
keySet
())
{
String
key
=
(
String
)
o
;
String
key
=
(
String
)
o
;
if
(
key
.
equals
(
"id"
))
{
if
(
key
.
equals
(
"id"
))
{
DoshokuOrder
.
getInstance
().
setOrderId
((
long
)
tm
.
get
(
key
));
double
orderId
=
(
double
)
tm
.
get
(
key
);
DoshokuOrder
.
getInstance
().
setOrderId
((
long
)
orderId
);
}
else
if
(
key
.
equals
(
"orderNo"
))
{
}
else
if
(
key
.
equals
(
"orderNo"
))
{
DoshokuOrder
.
getInstance
().
setOrderNo
((
String
)
tm
.
get
(
key
));
DoshokuOrder
.
getInstance
().
setOrderNo
((
String
)
tm
.
get
(
key
));
}
}
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/TableModel.java
View file @
f99df214
...
@@ -107,6 +107,12 @@ public class TableModel extends BaseModel implements TableContract.Model {
...
@@ -107,6 +107,12 @@ public class TableModel extends BaseModel implements TableContract.Model {
}
}
@Override
@Override
public
Observable
<
BaseResult
>
resetSkyorder
(
RequestBody
requestBody
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
TableService
.
class
)
.
resetSkyorder
(
requestBody
);
}
@Override
public
Observable
<
BaseResult
>
getSplitTables
(
int
tableId
)
{
public
Observable
<
BaseResult
>
getSplitTables
(
int
tableId
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
TableService
.
class
)
return
mRepositoryManager
.
obtainRetrofitService
(
TableService
.
class
)
.
getSplitTables
(
tableId
);
.
getSplitTables
(
tableId
);
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/bean/FoodSummary.java
View file @
f99df214
...
@@ -25,7 +25,7 @@ public class FoodSummary {
...
@@ -25,7 +25,7 @@ public class FoodSummary {
/**
/**
* 用餐時長
* 用餐時長
*/
*/
private
int
mealLength
=
120
;
private
long
diningTime
=
120
;
public
static
final
byte
BUSINESS_TYPE_TAKEWAY
=
1
;
public
static
final
byte
BUSINESS_TYPE_TAKEWAY
=
1
;
public
static
final
byte
BUSINESS_TYPE_SKYORDER
=
2
;
public
static
final
byte
BUSINESS_TYPE_SKYORDER
=
2
;
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/bean/request/AddOrderRequest.java
View file @
f99df214
...
@@ -27,9 +27,19 @@ public class AddOrderRequest {
...
@@ -27,9 +27,19 @@ public class AddOrderRequest {
private
long
tableId
;
private
long
tableId
;
private
String
tableNumber
;
private
String
tableNumber
;
/**
/**
* 合計金額
*/
/**
* 服務費
*/
/**
* 賬單小數
* 賬單小數
*/
*/
private
Double
rounding
;
private
Double
rounding
;
/**
* 總金額
*/
private
List
<
OrderDiscountRequest
>
discountDetails
;
private
List
<
OrderDiscountRequest
>
discountDetails
;
private
Map
<
String
,
List
<
OrderResponse
.
OrderDetailsBean
>>
maps
;
private
Map
<
String
,
List
<
OrderResponse
.
OrderDetailsBean
>>
maps
;
private
List
<
DeleteOrderRequest
>
deleteOrders
;
private
List
<
DeleteOrderRequest
>
deleteOrders
;
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/bean/request/CreateOrderRequest.java
View file @
f99df214
...
@@ -25,6 +25,8 @@ public class CreateOrderRequest {
...
@@ -25,6 +25,8 @@ public class CreateOrderRequest {
private
int
restaurantId
;
private
int
restaurantId
;
/**賬單小數*/
/**賬單小數*/
private
Double
rounding
;
private
Double
rounding
;
/**scan表ID*/
private
Long
scanId
;
private
List
<
OrderDiscountRequest
>
discountDetails
;
private
List
<
OrderDiscountRequest
>
discountDetails
;
private
Map
<
String
,
List
<
OrderResponse
.
OrderDetailsBean
>>
orderDetails
;
private
Map
<
String
,
List
<
OrderResponse
.
OrderDetailsBean
>>
orderDetails
;
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/discount/BillDiscountAction.java
View file @
f99df214
...
@@ -74,7 +74,7 @@ public class BillDiscountAction implements Strategy<Discount> {
...
@@ -74,7 +74,7 @@ public class BillDiscountAction implements Strategy<Discount> {
exclusiveDiscount
(
discount
);
exclusiveDiscount
(
discount
);
return
;
return
;
}
else
{
}
else
{
if
(
discount
.
getExclusive
()
==
1
&&
mNomalDiscountList
.
size
()
>
0
)
{
if
(
discount
.
getExclusive
()
==
1
&&
mNomalDiscountList
.
size
()
>
0
)
{
//獨佔折扣
//獨佔折扣
exclusiveDiscount
(
discount
);
exclusiveDiscount
(
discount
);
return
;
return
;
...
@@ -91,7 +91,7 @@ public class BillDiscountAction implements Strategy<Discount> {
...
@@ -91,7 +91,7 @@ public class BillDiscountAction implements Strategy<Discount> {
//
//
// break;
// break;
default
:
default
:
mListener
.
preformAddDiscount
(
discount
);
mListener
.
preformAddDiscount
(
discount
.
clone
()
);
break
;
break
;
}
}
}
}
...
@@ -149,7 +149,7 @@ public class BillDiscountAction implements Strategy<Discount> {
...
@@ -149,7 +149,7 @@ public class BillDiscountAction implements Strategy<Discount> {
if
(
exclusiveReplace
)
{
if
(
exclusiveReplace
)
{
mListener
.
exclusiveRemoveOthers
(
mNomalDiscountList
);
mListener
.
exclusiveRemoveOthers
(
mNomalDiscountList
);
}
}
mListener
.
preformAddDiscount
(
discount
);
mListener
.
preformAddDiscount
(
discount
.
clone
()
);
}
}
}
}
});
});
...
@@ -171,7 +171,7 @@ public class BillDiscountAction implements Strategy<Discount> {
...
@@ -171,7 +171,7 @@ public class BillDiscountAction implements Strategy<Discount> {
if
(
exclusiveReplace
)
{
if
(
exclusiveReplace
)
{
mListener
.
exclusiveRemoveOthers
(
mNomalDiscountList
);
mListener
.
exclusiveRemoveOthers
(
mNomalDiscountList
);
}
}
mListener
.
preformAddDiscount
(
discount
);
mListener
.
preformAddDiscount
(
discount
.
clone
()
);
}
}
}
}
})
})
...
@@ -199,7 +199,7 @@ public class BillDiscountAction implements Strategy<Discount> {
...
@@ -199,7 +199,7 @@ public class BillDiscountAction implements Strategy<Discount> {
// break;
// break;
default
:
default
:
mListener
.
exclusiveRemoveOthers
(
mNomalDiscountList
);
mListener
.
exclusiveRemoveOthers
(
mNomalDiscountList
);
mListener
.
preformAddDiscount
(
discount
);
mListener
.
preformAddDiscount
(
discount
.
clone
()
);
break
;
break
;
}
}
}
}
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/discount/MealDiscountAction.java
View file @
f99df214
...
@@ -2,6 +2,7 @@ package com.gingersoft.gsa.cloud.table.mvp.model.discount;
...
@@ -2,6 +2,7 @@ package com.gingersoft.gsa.cloud.table.mvp.model.discount;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.text.InputType
;
import
android.text.InputType
;
import
com.gingersoft.gsa.cloud.base.order.commodity.OrderDetail
;
import
com.gingersoft.gsa.cloud.base.order.commodity.OrderDetail
;
import
com.gingersoft.gsa.cloud.base.order.discount.MultyDiscount
;
import
com.gingersoft.gsa.cloud.base.order.discount.MultyDiscount
;
import
com.gingersoft.gsa.cloud.base.utils.MoneyUtil
;
import
com.gingersoft.gsa.cloud.base.utils.MoneyUtil
;
...
@@ -10,6 +11,7 @@ import com.gingersoft.gsa.cloud.patterns.Strategy;
...
@@ -10,6 +11,7 @@ import com.gingersoft.gsa.cloud.patterns.Strategy;
import
com.gingersoft.gsa.cloud.table.mvp.ui.widget.KeyboardDialog
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.widget.KeyboardDialog
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.CommonTipDialog
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.CommonTipDialog
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.jess.arms.utils.ArmsUtils
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -75,13 +77,13 @@ public class MealDiscountAction implements Strategy<Discount> {
...
@@ -75,13 +77,13 @@ public class MealDiscountAction implements Strategy<Discount> {
showCustomAmountDialog
(
discount
,
false
);
showCustomAmountDialog
(
discount
,
false
);
break
;
break
;
case
Discount
.
DISCOUNT_TYPE_KEYBOARD
:
case
Discount
.
DISCOUNT_TYPE_KEYBOARD
:
showKeyboardDialog
(
discount
,
false
);
showKeyboardDialog
(
discount
,
false
);
break
;
break
;
// case Discount.DISCOUNT_TYPE_FREE_SERVICE_CHARGE:
// case Discount.DISCOUNT_TYPE_FREE_SERVICE_CHARGE:
//
//
// break;
// break;
default
:
default
:
mListener
.
preformAddDiscount
(
discount
);
mListener
.
preformAddDiscount
(
discount
.
clone
()
);
break
;
break
;
}
}
}
}
...
@@ -140,7 +142,7 @@ public class MealDiscountAction implements Strategy<Discount> {
...
@@ -140,7 +142,7 @@ public class MealDiscountAction implements Strategy<Discount> {
if
(
exclusiveReplace
)
{
if
(
exclusiveReplace
)
{
mListener
.
exclusiveRemoveOthers
();
mListener
.
exclusiveRemoveOthers
();
}
}
mListener
.
preformAddDiscount
(
discount
);
mListener
.
preformAddDiscount
(
discount
.
clone
()
);
}
}
}
}
});
});
...
@@ -162,7 +164,7 @@ public class MealDiscountAction implements Strategy<Discount> {
...
@@ -162,7 +164,7 @@ public class MealDiscountAction implements Strategy<Discount> {
if
(
exclusiveReplace
)
{
if
(
exclusiveReplace
)
{
mListener
.
exclusiveRemoveOthers
();
mListener
.
exclusiveRemoveOthers
();
}
}
mListener
.
preformAddDiscount
(
discount
);
mListener
.
preformAddDiscount
(
discount
.
clone
()
);
}
}
}
}
})
})
...
@@ -190,7 +192,7 @@ public class MealDiscountAction implements Strategy<Discount> {
...
@@ -190,7 +192,7 @@ public class MealDiscountAction implements Strategy<Discount> {
// break;
// break;
default
:
default
:
mListener
.
exclusiveRemoveOthers
();
mListener
.
exclusiveRemoveOthers
();
mListener
.
preformAddDiscount
(
discount
);
mListener
.
preformAddDiscount
(
discount
.
clone
()
);
break
;
break
;
}
}
}
}
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/service/TableService.java
View file @
f99df214
...
@@ -36,6 +36,9 @@ public interface TableService {
...
@@ -36,6 +36,9 @@ public interface TableService {
@POST
(
"restaurantTable/set/status"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
@POST
(
"restaurantTable/set/status"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
BaseOrderResponse
>
initTable
(
@Body
RequestBody
requestBody
);
Observable
<
BaseOrderResponse
>
initTable
(
@Body
RequestBody
requestBody
);
@POST
(
"restaurantTable/skyOrderReset"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
BaseResult
>
resetSkyorder
(
@Body
RequestBody
requestBody
);
@GET
(
"restaurantTable/getSplitTableAvailable"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
@GET
(
"restaurantTable/getSplitTableAvailable"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
BaseResult
>
getSplitTables
(
@Query
(
"tableId"
)
int
tableId
);
Observable
<
BaseResult
>
getSplitTables
(
@Query
(
"tableId"
)
int
tableId
);
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/PrintSky
O
rderAction.java
→
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/PrintSky
o
rderAction.java
View file @
f99df214
...
@@ -31,14 +31,14 @@ import java.util.List;
...
@@ -31,14 +31,14 @@ import java.util.List;
* 修订历史: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
PrintSky
O
rderAction
extends
TableAction
{
public
class
PrintSky
o
rderAction
extends
TableAction
{
private
TablePresenter
mTablePresenter
;
private
TablePresenter
mTablePresenter
;
private
SkyOrderDialog
mSkyOrderDialog
;
private
SkyOrderDialog
mSkyOrderDialog
;
private
static
final
byte
PRINT_type
=
2
;
private
static
final
byte
PRINT_type
=
2
;
public
PrintSky
O
rderAction
(
Activity
context
,
TablePresenter
tablePresenter
)
{
public
PrintSky
o
rderAction
(
Activity
context
,
TablePresenter
tablePresenter
)
{
super
(
context
,
"打印skyorder"
,
"請選擇檯號"
,
""
);
super
(
context
,
"打印skyorder"
,
"請選擇檯號"
,
""
);
this
.
mTablePresenter
=
tablePresenter
;
this
.
mTablePresenter
=
tablePresenter
;
}
}
...
@@ -122,6 +122,7 @@ public class PrintSkyOrderAction extends TableAction {
...
@@ -122,6 +122,7 @@ public class PrintSkyOrderAction extends TableAction {
.
build
()
.
build
()
.
callAsyncCallbackOnMainThread
((
cc
,
result
)
->
{
.
callAsyncCallbackOnMainThread
((
cc
,
result
)
->
{
if
(
result
.
isSuccess
())
{
if
(
result
.
isSuccess
())
{
printSkyorderSuccess
();
}
else
{
}
else
{
ArmsUtils
.
makeText
(
mContext
,
"打印失敗"
);
ArmsUtils
.
makeText
(
mContext
,
"打印失敗"
);
}
}
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/ResetSkyorderAction.java
0 → 100644
View file @
f99df214
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
table
.
action
;
import
android.app.Activity
;
import
com.gingersoft.gsa.cloud.base.table.bean.TableBean
;
import
com.gingersoft.gsa.cloud.table.R
;
import
com.qmuiteam.qmui.widget.dialog.QMUIDialog
;
import
com.qmuiteam.qmui.widget.dialog.QMUIDialogAction
;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
* 创建日期:2020-09-23
* 修订历史:2020-09-23
* 描述:餐檯模式-重置skyorder餐檯{@link com.gingersoft.gsa.cloud.table.mvp.ui.activity.TableActivity}
*/
public
class
ResetSkyorderAction
extends
TableAction
{
public
ResetSkyorderAction
(
Activity
context
)
{
super
(
context
,
"重置Skyorder"
,
"請選擇需要重置的檯號"
,
""
);
}
@Override
public
void
action
(
TableBean
.
DataBean
dataBean
)
{
setOperatContentText
(
dataBean
.
getTableName
());
if
(
dataBean
.
getSplitStatus
()
==
1
)
{
showSplitTableDialogAction
();
}
else
{
showActionTipDialog
(
dataBean
);
}
}
@Override
public
boolean
filterTableCondition
(
TableBean
.
DataBean
dataBean
)
{
return
dataBean
.
getStatus
()
!=
0
;
}
@Override
public
void
destroy
()
{
}
public
void
showActionTipDialog
(
TableBean
.
DataBean
dataBean
)
{
QMUIDialog
.
MessageDialogBuilder
dialogBuilder
=
new
QMUIDialog
.
MessageDialogBuilder
(
mContext
);
dialogBuilder
.
setTitleIcon
(
R
.
drawable
.
qmui_icon_dialog_doubt
);
dialogBuilder
.
setMessage
(
"是否確認重置"
+
dataBean
.
getTableName
()
+
"號檯Skyorder?"
);
dialogBuilder
.
addAction
(
0
,
"確認"
,
QMUIDialogAction
.
ACTION_PROP_NEGATIVE
,
new
QMUIDialogAction
.
ActionListener
()
{
@Override
public
void
onClick
(
QMUIDialog
dialog
,
int
index
)
{
dialog
.
dismiss
();
resetSkyTable
(
dataBean
);
}
});
dialogBuilder
.
addAction
(
"取消"
,
new
QMUIDialogAction
.
ActionListener
()
{
@Override
public
void
onClick
(
QMUIDialog
dialog
,
int
index
)
{
dialog
.
dismiss
();
cancel
();
}
});
dialogBuilder
.
create
(
R
.
style
.
MyDialogTheme2
).
show
();
}
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/TableAction.java
View file @
f99df214
...
@@ -53,27 +53,33 @@ public abstract class TableAction implements Strategy<TableBean.DataBean> {
...
@@ -53,27 +53,33 @@ public abstract class TableAction implements Strategy<TableBean.DataBean> {
}
}
}
}
protected
void
resetSkyTable
(
TableBean
.
DataBean
tableBean
)
{
if
(
actionListener
!=
null
)
{
actionListener
.
resetSkyTable
(
tableBean
);
}
}
protected
void
moveTable
(
TableBean
.
DataBean
tableBean
)
{
protected
void
moveTable
(
TableBean
.
DataBean
tableBean
)
{
if
(
actionListener
!=
null
)
{
if
(
actionListener
!=
null
)
{
actionListener
.
moveTable
(
tableBean
);
actionListener
.
moveTable
(
tableBean
);
}
}
}
}
protected
void
showSplitTableDialogAction
()
{
protected
void
printSkyorderSuccess
()
{
if
(
actionListener
!=
null
)
{
if
(
actionListener
!=
null
)
{
actionListener
.
showSplitTableDialogAction
();
actionListener
.
printSkyorderSuccess
();
}
}
}
}
protected
void
s
plitTableAction
(
TableBean
.
DataBean
tableBean
)
{
protected
void
s
howSplitTableDialogAction
(
)
{
if
(
actionListener
!=
null
)
{
if
(
actionListener
!=
null
)
{
actionListener
.
s
plitTableAction
(
tableBean
);
actionListener
.
s
howSplitTableDialogAction
(
);
}
}
}
}
protected
void
printQRCodeSuccess
(
)
{
protected
void
splitTableAction
(
TableBean
.
DataBean
tableBean
)
{
if
(
actionListener
!=
null
)
{
if
(
actionListener
!=
null
)
{
actionListener
.
printQRCodeSuccess
(
);
actionListener
.
splitTableAction
(
tableBean
);
}
}
}
}
...
@@ -94,11 +100,13 @@ public abstract class TableAction implements Strategy<TableBean.DataBean> {
...
@@ -94,11 +100,13 @@ public abstract class TableAction implements Strategy<TableBean.DataBean> {
void
resetTable
(
TableBean
.
DataBean
tableBean
);
void
resetTable
(
TableBean
.
DataBean
tableBean
);
void
resetSkyTable
(
TableBean
.
DataBean
tableBean
);
void
moveTable
(
TableBean
.
DataBean
tableBean
);
void
moveTable
(
TableBean
.
DataBean
tableBean
);
void
splitTableAction
(
TableBean
.
DataBean
tableBean
);
void
splitTableAction
(
TableBean
.
DataBean
tableBean
);
void
print
QRCode
Success
();
void
print
Skyorder
Success
();
void
showSplitTableDialogAction
();
void
showSplitTableDialogAction
();
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/BaseOrderPresenter.java
View file @
f99df214
...
@@ -48,12 +48,15 @@ import com.jess.arms.utils.PermissionUtil;
...
@@ -48,12 +48,15 @@ import com.jess.arms.utils.PermissionUtil;
import
com.jess.arms.utils.RxLifecycleUtils
;
import
com.jess.arms.utils.RxLifecycleUtils
;
import
com.tbruyelle.rxpermissions2.RxPermissions
;
import
com.tbruyelle.rxpermissions2.RxPermissions
;
import
org.json.JSONObject
;
import
java.util.ArrayList
;
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
javax.inject.Inject
;
import
javax.inject.Inject
;
import
javax.xml.xpath.XPathFunction
;
import
io.reactivex.Observable
;
import
io.reactivex.Observable
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
...
@@ -364,7 +367,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -364,7 +367,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
return
totalAmount
;
return
totalAmount
;
}
}
})
})
//
.subscribeOn(AndroidSchedulers.mainThread())
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
new
Consumer
<
Double
>()
{
.
subscribe
(
new
Consumer
<
Double
>()
{
@Override
@Override
...
@@ -938,13 +941,16 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -938,13 +941,16 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
setChildScAbleByMainAble
(
newFoodList
);
setChildScAbleByMainAble
(
newFoodList
);
setChildDiscountByMainAblediscount
(
newFoodList
);
setChildDiscountByMainAblediscount
(
newFoodList
);
TableBean
.
DataBean
tableBean
=
mDoshokuOrder
.
getOpenTableInfo
();
int
restaurantId
=
GsaCloudApplication
.
getRestaurantId
();
int
restaurantId
=
GsaCloudApplication
.
getRestaurantId
();
CreateOrderRequest
request
=
new
CreateOrderRequest
();
CreateOrderRequest
request
=
new
CreateOrderRequest
();
request
.
setTableNumber
(
mDoshokuOrder
.
getOpenTableInfo
()
.
getTableNumber
());
request
.
setTableNumber
(
tableBean
.
getTableNumber
());
request
.
setOrderDetails
(
orderDetailBeanToFoodRequest
(
newFoodList
));
request
.
setOrderDetails
(
orderDetailBeanToFoodRequest
(
newFoodList
));
request
.
setPerson
(
mDoshokuOrder
.
getOpenTableInfo
().
getPerson
());
request
.
setPerson
(
tableBean
.
getPerson
());
request
.
setTableId
(
mDoshokuOrder
.
getOpenTableInfo
().
getId
());
request
.
setTableId
(
tableBean
.
getId
());
request
.
setTableName
(
mDoshokuOrder
.
getOpenTableInfo
().
getTableName
());
request
.
setTableName
(
tableBean
.
getTableName
());
request
.
setScanId
(
tableBean
.
getScanId
());
request
.
setRounding
(
getRounding
());
request
.
setRounding
(
getRounding
());
request
.
setRestaurantId
(
restaurantId
);
request
.
setRestaurantId
(
restaurantId
);
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/MealStandPresenter.java
View file @
f99df214
...
@@ -579,34 +579,6 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -579,34 +579,6 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
});
});
}
}
/**
* 暂时食品折扣只能有一个
*
* @return
*/
private
int
cutOutDiscount
()
{
OrderDetail
mainOrderDetail1
=
mSelectMealAdapter
.
getCurrentMainOrderDetail
();
if
(
mainOrderDetail1
!=
null
)
{
if
(
mainOrderDetail1
.
getItemType
()
==
1
)
{
for
(
int
i
=
0
;
i
<
mOrderMealList
.
size
();
i
++)
{
OrderDetail
orderDetail
=
mOrderMealList
.
get
(
i
);
if
(
orderDetail
.
getParentIndex
()
==
mainOrderDetail1
.
getMyIndex
()
&&
orderDetail
.
getType
()
==
OrderDetail
.
DISCOUNT_TYPE
)
{
if
(!
orderDetail
.
isNew
())
{
//已送单折扣不可替换
return
-
100
;
}
if
(
mOrderMealList
.
get
(
mSelectMealAdapter
.
getSelect_position
()).
getType
()
==
OrderDetail
.
DISCOUNT_TYPE
)
{
//选中折扣 替换原有折扣防止将折扣添加到下面一个食品
mSelectMealAdapter
.
setSelect_position
(
mSelectMealAdapter
.
getSelect_position
()
-
1
);
}
mSelectMealAdapter
.
removeItemByPosition
(
i
);
break
;
}
}
}
}
return
0
;
}
/**
/**
* 裁減掉已超出的細項
* 裁減掉已超出的細項
...
@@ -1179,34 +1151,6 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -1179,34 +1151,6 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
}
}
}
}
public
void
deleteOldFood
()
{
List
<
Integer
>
removeFoodIndex
=
new
ArrayList
<>();
//記錄删除所有已下单食品
for
(
int
i
=
0
;
i
<
getOrderFoodLists
().
size
();
i
++)
{
OrderDetail
myOrder
=
getOrderFoodLists
().
get
(
i
);
if
(!
myOrder
.
isNew
())
{
removeFoodIndex
.
add
(
myOrder
.
getMyIndex
());
}
else
{
//未下單单食品下新加的子项 一起删除
if
(
removeFoodIndex
.
indexOf
(
myOrder
.
getParentIndex
())
!=
-
1
)
{
removeFoodIndex
.
add
(
myOrder
.
getMyIndex
());
}
}
}
List
<
OrderDetail
>
orderFoodList
=
getOrderFoodLists
();
//删除所有已下单食品下子食品
for
(
int
i
=
removeFoodIndex
.
size
()
-
1
;
i
>=
0
;
i
--)
{
int
removeIndex
=
removeFoodIndex
.
get
(
i
)
-
1
;
if
(
removeIndex
>
-
1
&&
removeIndex
<
orderFoodList
.
size
())
{
orderFoodList
.
remove
(
removeIndex
);
}
}
if
(
removeFoodIndex
.
size
()
>
0
)
{
removeFoodIndex
.
clear
();
mSelectMealAdapter
.
notifyDataSetChanged
();
}
}
public
void
changedMealByParentId
(
long
parentId
)
{
public
void
changedMealByParentId
(
long
parentId
)
{
List
<
Food
>
foodList
=
mModel
.
queryDB_FoodList
(
parentId
,
BaseOrder
.
orderType
);
List
<
Food
>
foodList
=
mModel
.
queryDB_FoodList
(
parentId
,
BaseOrder
.
orderType
);
mFoodAdapter
.
resetSelect
(-
1
,
null
);
mFoodAdapter
.
resetSelect
(-
1
,
null
);
...
@@ -1364,7 +1308,6 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -1364,7 +1308,6 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
}
}
}
}
}
}
if
(
IActivity
.
getFoodGroupGridViewAdapter
()
!=
null
)
{
if
(
IActivity
.
getFoodGroupGridViewAdapter
()
!=
null
)
{
IActivity
.
getFoodGroupGridViewAdapter
().
notifyDataSetChanged
();
IActivity
.
getFoodGroupGridViewAdapter
().
notifyDataSetChanged
();
}
}
...
@@ -1612,6 +1555,10 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -1612,6 +1555,10 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
* @return
* @return
*/
*/
public
boolean
memberPointsCondition
(
double
pointsRedeem
,
String
foodName
)
{
public
boolean
memberPointsCondition
(
double
pointsRedeem
,
String
foodName
)
{
if
(
mTakeawayOrder
!=
null
)
{
//外賣新訂單 不需要驗證
return
true
;
}
MemberInfo
memberInfo
=
mDoshokuOrder
.
getMemberInfo
();
MemberInfo
memberInfo
=
mDoshokuOrder
.
getMemberInfo
();
if
(
memberInfo
==
null
)
{
if
(
memberInfo
==
null
)
{
//当前食品需要会员积分
//当前食品需要会员积分
...
@@ -1930,8 +1877,9 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -1930,8 +1877,9 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
public
int
addMultipleModifierItems
(
Modifier
modifierItem
,
int
addPosition
)
{
public
int
addMultipleModifierItems
(
Modifier
modifierItem
,
int
addPosition
)
{
int
overIndex
=
0
;
int
overIndex
=
0
;
for
(
int
i
=
0
;
i
<
mOrderMealList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
mOrderMealList
.
size
();
i
++)
{
if
(
overIndex
>
i
)
if
(
overIndex
>
i
)
{
continue
;
continue
;
}
OrderDetail
item
=
mOrderMealList
.
get
(
i
);
OrderDetail
item
=
mOrderMealList
.
get
(
i
);
if
(
item
.
getSelected
()
!=
0
)
{
if
(
item
.
getSelected
()
!=
0
)
{
if
(
item
.
getItemType
()
==
1
)
{
if
(
item
.
getItemType
()
==
1
)
{
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/OrderContentPresenter.java
View file @
f99df214
...
@@ -58,6 +58,8 @@ import com.jess.arms.integration.AppManager;
...
@@ -58,6 +58,8 @@ 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.rxjava.RxJavaUtils
;
import
com.xuexiang.rxutil2.rxjava.task.RxAsyncTask
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Collections
;
...
@@ -69,6 +71,7 @@ import javax.inject.Inject;
...
@@ -69,6 +71,7 @@ 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
;
...
@@ -106,12 +109,6 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
...
@@ -106,12 +109,6 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
private
List
<
Function
>
mFunctionList
=
new
ArrayList
<>();
private
List
<
Function
>
mFunctionList
=
new
ArrayList
<>();
/**
/**
* 定时获取餐台 定时器
*/
private
GetTableTimer
tableTimer
;
private
Disposable
mGetTablesDataDisposable
;
/**
* 分檯弹窗
* 分檯弹窗
*/
*/
private
SplitTableDialog
mSplitTableDialog
;
private
SplitTableDialog
mSplitTableDialog
;
...
@@ -121,11 +118,14 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
...
@@ -121,11 +118,14 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
*/
*/
private
BillDiscountAction
mNomalDiscountAction
;
private
BillDiscountAction
mNomalDiscountAction
;
private
Disposable
mGetTablesDataDisposable
;
private
Disposable
mTablesPollingDisposable
;
@Inject
@Inject
public
OrderContentPresenter
(
OrderContentContract
.
Model
model
,
OrderContentContract
.
View
rootView
)
{
public
OrderContentPresenter
(
OrderContentContract
.
Model
model
,
OrderContentContract
.
View
rootView
)
{
super
(
model
,
rootView
);
super
(
model
,
rootView
);
this
.
IActivity
=
(
OrderContentActivity
)
rootView
;
this
.
IActivity
=
(
OrderContentActivity
)
rootView
;
if
(!
mDoshokuOrder
.
isModifyOrder
())
{
if
(
mDoshokuOrder
!=
null
&&
!
mDoshokuOrder
.
isModifyOrder
())
{
//转移食品可多选
//转移食品可多选
mSelectMealAdapter
.
setSelectedMode
(
SelectMealAdapter
.
MULTIPLE_SELECTED
);
mSelectMealAdapter
.
setSelectedMode
(
SelectMealAdapter
.
MULTIPLE_SELECTED
);
}
}
...
@@ -151,6 +151,8 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
...
@@ -151,6 +151,8 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
this
.
mAppManager
=
null
;
this
.
mAppManager
=
null
;
this
.
mImageLoader
=
null
;
this
.
mImageLoader
=
null
;
this
.
mApplication
=
null
;
this
.
mApplication
=
null
;
stopTablePolling
();
}
}
public
void
initAdapter
()
{
public
void
initAdapter
()
{
...
@@ -181,6 +183,11 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
...
@@ -181,6 +183,11 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
if
(!
canPrint
())
{
if
(!
canPrint
())
{
return
;
return
;
}
}
if
(
BaseOrder
.
isCurrentOrderType
(
FoodSummaryConstans
.
TAKEAWAY_TYPE
))
{
//TODO 外賣新訂單印單
printOrder
(
DoshokuOrder
.
getInstance
().
getOpenTableInfo
().
getId
(),
false
);
return
;
}
if
(
hasNesOrderFoods
()
||
getNewDiscount
()
!=
null
)
{
if
(
hasNesOrderFoods
()
||
getNewDiscount
()
!=
null
)
{
//有未送單食品先送單
//有未送單食品先送單
sendOrder
(
true
,
null
);
sendOrder
(
true
,
null
);
...
@@ -250,32 +257,32 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
...
@@ -250,32 +257,32 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
if
(
mFunctionList
.
size
()
>
0
)
{
if
(
mFunctionList
.
size
()
>
0
)
{
mFunctionList
.
clear
();
mFunctionList
.
clear
();
}
}
if
(
BaseOrder
.
isCurrentOrderType
(
FoodSummaryConstans
.
RESTAURANT_MODE
)
&&
mDoshokuOrder
.
isModifyOrder
())
{
if
(
BaseOrder
.
isCurrentOrderType
(
FoodSummaryConstans
.
RESTAURANT_MODE
))
{
//修改訂單隱藏送單,印單功能
if
(
mDoshokuOrder
.
isModifyOrder
())
{
mFunctionList
.
add
(
new
Function
(
"結賬"
,
Color
.
parseColor
(
"#FFFFFF"
),
Color
.
parseColor
(
"#DC0000"
),
24
));
//修改訂單隱藏送單,印單功能
mFunctionList
.
add
(
new
Function
(
"折扣"
,
Color
.
parseColor
(
"#FFFFFF"
),
Color
.
parseColor
(
"#008577"
),
24
));
mFunctionList
.
add
(
new
Function
(
"結賬"
,
Color
.
parseColor
(
"#FFFFFF"
),
Color
.
parseColor
(
"#DC0000"
),
24
));
}
else
{
List
<
Function
>
functions
=
FunctionManager
.
getDefault
().
getFunctionByResModule
(
GsaCloudApplication
.
getAppContext
(),
ComponentTable
.
table
.
class
,
ComponentTable
.
table
.
order
,
"order"
);
for
(
int
i
=
0
;
i
<
functions
.
size
();
i
++)
{
if
(
functions
.
get
(
i
).
getParentId
()
==
0
)
{
functions
.
remove
(
i
);
}
}
// if (functions.size() > 0) {
// mFunctionList.addAll(functions);
// } else {
if
(
BaseOrder
.
isCurrentOrderType
(
FoodSummaryConstans
.
TAKEAWAY_TYPE
))
{
mFunctionList
.
add
(
new
Function
(
"折扣"
,
Color
.
parseColor
(
"#FFFFFF"
),
Color
.
parseColor
(
"#008577"
),
24
));
mFunctionList
.
add
(
new
Function
(
"折扣"
,
Color
.
parseColor
(
"#FFFFFF"
),
Color
.
parseColor
(
"#008577"
),
24
));
mFunctionList
.
add
(
new
Function
(
"印單"
,
Color
.
parseColor
(
"#FFFFFF"
),
Color
.
parseColor
(
"#FF8E04"
),
24
));
mFunctionList
.
add
(
new
Function
(
"送單信息"
,
Color
.
parseColor
(
"#FFFFFF"
),
Color
.
parseColor
(
"#008131"
),
24
));
}
else
{
}
else
{
// List<Function> functions = FunctionManager.getDefault().getFunctionByResModule(GsaCloudApplication.getAppContext(), ComponentTable.table.class, ComponentTable.table.order, "order");
// for (int i = 0; i < functions.size(); i++) {
// if (functions.get(i).getParentId() == 0) {
// functions.remove(i);
// }
// }
// if (functions.size() > 0) {
// mFunctionList.addAll(functions);
// } else {
mFunctionList
.
add
(
new
Function
(
"送單"
,
Color
.
parseColor
(
"#FFFFFF"
),
Color
.
parseColor
(
"#008131"
),
24
));
mFunctionList
.
add
(
new
Function
(
"送單"
,
Color
.
parseColor
(
"#FFFFFF"
),
Color
.
parseColor
(
"#008131"
),
24
));
mFunctionList
.
add
(
new
Function
(
"印單"
,
Color
.
parseColor
(
"#FFFFFF"
),
Color
.
parseColor
(
"#FF8E04"
),
24
));
mFunctionList
.
add
(
new
Function
(
"印單"
,
Color
.
parseColor
(
"#FFFFFF"
),
Color
.
parseColor
(
"#FF8E04"
),
24
));
mFunctionList
.
add
(
new
Function
(
"結賬"
,
Color
.
parseColor
(
"#FFFFFF"
),
Color
.
parseColor
(
"#DC0000"
),
24
));
mFunctionList
.
add
(
new
Function
(
"結賬"
,
Color
.
parseColor
(
"#FFFFFF"
),
Color
.
parseColor
(
"#DC0000"
),
24
));
mFunctionList
.
add
(
new
Function
(
"轉移"
,
Color
.
parseColor
(
"#FFFFFF"
),
Color
.
parseColor
(
"#FF4B9DFA"
),
24
));
mFunctionList
.
add
(
new
Function
(
"轉移"
,
Color
.
parseColor
(
"#FFFFFF"
),
Color
.
parseColor
(
"#FF4B9DFA"
),
24
));
mFunctionList
.
add
(
new
Function
(
"折扣"
,
Color
.
parseColor
(
"#FFFFFF"
),
Color
.
parseColor
(
"#008577"
),
24
));
mFunctionList
.
add
(
new
Function
(
"折扣"
,
Color
.
parseColor
(
"#FFFFFF"
),
Color
.
parseColor
(
"#008577"
),
24
));
// }
}
}
// }
}
else
if
(
BaseOrder
.
isCurrentOrderType
(
FoodSummaryConstans
.
TAKEAWAY_TYPE
))
{
mFunctionList
.
add
(
new
Function
(
"折扣"
,
Color
.
parseColor
(
"#FFFFFF"
),
Color
.
parseColor
(
"#008577"
),
24
));
mFunctionList
.
add
(
new
Function
(
"印單"
,
Color
.
parseColor
(
"#FFFFFF"
),
Color
.
parseColor
(
"#FF8E04"
),
24
));
mFunctionList
.
add
(
new
Function
(
"送單信息"
,
Color
.
parseColor
(
"#FFFFFF"
),
Color
.
parseColor
(
"#008131"
),
24
));
}
}
}
}
...
@@ -604,7 +611,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
...
@@ -604,7 +611,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
@Override
@Override
public
void
onNext
(
@NonNull
BaseResult
result
)
{
public
void
onNext
(
@NonNull
BaseResult
result
)
{
if
(
result
.
isSuccess
())
{
if
(
result
.
isSuccess
())
{
TableBean
.
DataBean
tableBean
=
JsonUtils
.
parseObject
(
result
.
getData
(),
TableBean
.
DataBean
.
class
);
TableBean
.
DataBean
tableBean
=
JsonUtils
.
parseObject
(
result
.
getData
(),
TableBean
.
DataBean
.
class
);
if
(
tableBean
!=
null
)
{
if
(
tableBean
!=
null
)
{
if
(
tableBean
.
getUseStatus
()
==
0
)
{
if
(
tableBean
.
getUseStatus
()
==
0
)
{
String
msg
=
"轉移到"
+
tableBean
.
getTableName
()
+
"號檯?"
;
String
msg
=
"轉移到"
+
tableBean
.
getTableName
()
+
"號檯?"
;
...
@@ -792,7 +799,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
...
@@ -792,7 +799,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
* @param info
* @param info
*/
*/
private
void
updateOrderDetails
(
BaseOrderResponse
info
)
{
private
void
updateOrderDetails
(
BaseOrderResponse
info
)
{
if
(
info
.
getData
()
!=
null
)
{
if
(
mDoshokuOrder
!=
null
&&
info
.
getData
()
!=
null
)
{
if
(
info
.
getData
().
getOrderDetails
()
!=
null
)
{
if
(
info
.
getData
().
getOrderDetails
()
!=
null
)
{
...
@@ -906,45 +913,25 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
...
@@ -906,45 +913,25 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
return
true
;
return
true
;
}
}
public
void
initGetTableTimer
()
{
public
void
startTablePolling
()
{
if
(
tableTimer
==
null
)
{
if
(
mTablesPollingDisposable
==
null
)
{
tableTimer
=
new
GetTableTimer
(
GoldConstants
.
refreshTime
*
1000
,
GoldConstants
.
refreshTime
*
1000
);
mTablesPollingDisposable
=
RxJavaUtils
.
polling
(
GoldConstants
.
refreshTime
)
}
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
TableActivity
.
isRefreshData
=
true
;
.
subscribe
(
new
Consumer
<
Long
>()
{
}
@Override
public
void
accept
(
Long
aLong
)
throws
Exception
{
public
void
startTableTimer
()
{
if
(
TableActivity
.
isRefreshData
)
{
initGetTableTimer
();
getTables
(
false
,
null
);
if
(
tableTimer
!=
null
)
{
}
tableTimer
.
start
();
}
}
});
}
public
void
cancelTableTimer
()
{
if
(
tableTimer
!=
null
)
{
tableTimer
.
cancel
();
}
}
}
}
/**
public
void
stopTablePolling
()
{
* 计时器类 定時更新餐台数据
if
(
mTablesPollingDisposable
!=
null
&&
!
mTablesPollingDisposable
.
isDisposed
())
{
*/
mTablesPollingDisposable
.
dispose
();
private
class
GetTableTimer
extends
CountDownTimer
{
mTablesPollingDisposable
=
null
;
public
GetTableTimer
(
long
millisInFuture
,
long
countDownInterval
)
{
super
(
millisInFuture
,
countDownInterval
);
// 参数依次为总时长,和计时的时间间隔
}
@Override
public
void
onFinish
()
{
// 计时完毕时触发
if
(
IActivity
.
isRefreshData
())
{
getTables
(
false
,
null
);
}
this
.
start
();
}
@Override
public
void
onTick
(
long
millisUntilFinished
)
{
// 计时过程显示
}
}
}
}
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/OrderPayPresenter.java
View file @
f99df214
...
@@ -121,12 +121,12 @@ public class OrderPayPresenter extends BaseOrderPresenter<OrderPayContract.Model
...
@@ -121,12 +121,12 @@ public class OrderPayPresenter extends BaseOrderPresenter<OrderPayContract.Model
if
(
payMethods
.
get
(
i
)
==
null
)
{
if
(
payMethods
.
get
(
i
)
==
null
)
{
payMethods
.
remove
(
i
);
payMethods
.
remove
(
i
);
}
}
if
(
BuildConfig
.
DEBUG
)
{
//
if (BuildConfig.DEBUG) {
if
(
i
==
0
)
{
//
if (i == 0) {
payMethods
.
get
(
i
).
setPayType
(
PayMethod
.
PAY_TYPE_INTEGRAL
);
//
payMethods.get(i).setPayType(PayMethod.PAY_TYPE_INTEGRAL);
payMethods
.
get
(
i
).
setPayName
(
"測試積分支付"
);
//
payMethods.get(i).setPayName("測試積分支付");
}
//
}
}
//
}
}
}
mRootView
.
loadPayMethodsSuccess
(
payMethods
);
mRootView
.
loadPayMethodsSuccess
(
payMethods
);
}
}
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/TablePresenter.java
View file @
f99df214
This diff is collapsed.
Click to expand it.
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/MealStandActivity.java
View file @
f99df214
...
@@ -619,7 +619,10 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
...
@@ -619,7 +619,10 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
dialog
.
dismiss
();
dialog
.
dismiss
();
DoshokuOrder
.
getInstance
().
setMemberInfo
(
mMemberInfo
);
DoshokuOrder
.
getInstance
().
setMemberInfo
(
mMemberInfo
);
//添加会员折扣行
//添加会员折扣行
mPresenter
.
getShoppingCart
().
addMultyDiscount
(
mPresenter
.
getShoppingCart
().
createMemberDiscount
(
mMemberInfo
,
BillItem
.
BILL_ITEM_NO_ORDER_STATUS
));
mPresenter
.
getShoppingCart
()
.
addMultyDiscount
(
mPresenter
.
getShoppingCart
()
.
createMemberDiscount
(
mMemberInfo
,
BillItem
.
BILL_ITEM_NO_ORDER_STATUS
));
useMember
();
useMember
();
if
(
DoshokuOrder
.
getInstance
().
needUpdateMemberInfo
())
{
if
(
DoshokuOrder
.
getInstance
().
needUpdateMemberInfo
())
{
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/OrderContentActivity.java
View file @
f99df214
...
@@ -14,6 +14,7 @@ import android.widget.Button;
...
@@ -14,6 +14,7 @@ import android.widget.Button;
import
android.widget.Chronometer
;
import
android.widget.Chronometer
;
import
android.widget.SimpleAdapter
;
import
android.widget.SimpleAdapter
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
androidx.core.content.ContextCompat
;
import
androidx.core.content.ContextCompat
;
...
@@ -22,13 +23,17 @@ import androidx.recyclerview.widget.DefaultItemAnimator;
...
@@ -22,13 +23,17 @@ import androidx.recyclerview.widget.DefaultItemAnimator;
import
androidx.recyclerview.widget.GridLayoutManager
;
import
androidx.recyclerview.widget.GridLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
androidx.recyclerview.widget.RecyclerView
;
import
androidx.viewpager.widget.ViewPager
;
import
androidx.viewpager.widget.ViewPager
;
import
com.gingersoft.gsa.cloud.app.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.app.GsaCloudApplication
;
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.order.BaseOrder
;
import
com.gingersoft.gsa.cloud.base.order.order.DoshokuOrder
;
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.utils.VibratorUtils
;
import
com.gingersoft.gsa.cloud.base.utils.VibratorUtils
;
import
com.gingersoft.gsa.cloud.base.utils.encryption.DESUtil
;
import
com.gingersoft.gsa.cloud.base.utils.encryption.DESUtil
;
import
com.gingersoft.gsa.cloud.base.utils.log.LogUtil
;
import
com.gingersoft.gsa.cloud.base.utils.log.LogUtil
;
import
com.gingersoft.gsa.cloud.base.utils.time.TimeUtils
;
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.R2
;
import
com.gingersoft.gsa.cloud.table.R2
;
import
com.gingersoft.gsa.cloud.table.di.component.DaggerOrderContentComponent
;
import
com.gingersoft.gsa.cloud.table.di.component.DaggerOrderContentComponent
;
...
@@ -187,18 +192,18 @@ public class OrderContentActivity extends BaseFragmentActivity<OrderContentPrese
...
@@ -187,18 +192,18 @@ public class OrderContentActivity extends BaseFragmentActivity<OrderContentPrese
@Override
@Override
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
initTopInfo
();
initOrderBill
(
mPresenter
.
getFoodTotal
(),
mPresenter
.
getTotalAmount
());
mPresenter
.
initTopFunctionData
();
mPresenter
.
initTopFunctionData
();
mPresenter
.
initAdapter
();
mPresenter
.
initAdapter
();
mPresenter
.
initItemListener
();
mPresenter
.
initItemListener
();
if
(!
mDoshokuOrder
.
isModifyOrder
())
{
initTopInfo
(
BaseOrder
.
orderType
);
initOrderBill
(
mPresenter
.
getFoodTotal
(),
mPresenter
.
getTotalAmount
());
if
(
BaseOrder
.
isCurrentOrderType
(
FoodSummaryConstans
.
RESTAURANT_MODE
)
&&
!
DoshokuOrder
.
getInstance
().
isModifyOrder
())
{
//根据倒计时时间自动退出当前页面
//根据倒计时时间自动退出当前页面
initAutoQuit
();
initAutoQuit
();
}
}
}
}
public
void
initOrderBill
(
double
wholeAmount
,
double
totalAmount
)
{
public
void
initOrderBill
(
double
wholeAmount
,
double
totalAmount
)
{
int
foodCount
=
mPresenter
.
getFoodCount
();
int
foodCount
=
mPresenter
.
getFoodCount
();
if
(
foodCount
>
0
)
{
if
(
foodCount
>
0
)
{
btn_order_count
.
setText
(
String
.
valueOf
(
foodCount
));
btn_order_count
.
setText
(
String
.
valueOf
(
foodCount
));
...
@@ -210,23 +215,27 @@ public class OrderContentActivity extends BaseFragmentActivity<OrderContentPrese
...
@@ -210,23 +215,27 @@ public class OrderContentActivity extends BaseFragmentActivity<OrderContentPrese
tv_total
.
setText
(
"$"
+
totalAmount
);
tv_total
.
setText
(
"$"
+
totalAmount
);
}
}
private
void
initTopInfo
()
{
private
void
initTopInfo
(
int
orderType
)
{
if
(
orderType
==
FoodSummaryConstans
.
RESTAURANT_MODE
)
{
TableBean
.
DataBean
tableInfo
=
mDoshokuOrder
.
getOpenTableInfo
();
TableBean
.
DataBean
tableInfo
=
mDoshokuOrder
.
getOpenTableInfo
();
Date
dd
=
mDoshokuOrder
.
getOpenTableTime
();
Date
dd
=
mDoshokuOrder
.
getOpenTableTime
();
String
openTime
=
String
.
format
(
"%tH:%tM"
,
dd
,
dd
);
String
openTime
=
String
.
format
(
"%tH:%tM"
,
dd
,
dd
);
String
tableno
;
if
(
tableInfo
.
getSplitStatus
()
!=
0
)
{
String
tableno
=
""
;
tableno
=
tableInfo
.
getTableName
().
trim
()
+
"-"
+
tableInfo
.
getTableNumber
().
trim
();
if
(
tableInfo
.
getSplitStatus
()
!=
0
)
{
}
else
{
tableno
=
tableInfo
.
getTableName
().
trim
()
+
"-"
+
tableInfo
.
getTableNumber
().
trim
();
tableno
=
tableInfo
.
getTableName
();
}
else
{
}
tableno
=
tableInfo
.
getTableName
();
btn_table
.
setText
(
tableno
);
btn_people_num
.
setText
(
tableInfo
.
getPerson
()
+
""
);
tv_time
.
setText
(
"時間:"
+
openTime
);
tv_server_main
.
setText
(
GsaCloudApplication
.
getMemberName
());
}
else
if
(
orderType
==
FoodSummaryConstans
.
TAKEAWAY_TYPE
)
{
btn_table
.
setText
(
"外賣"
);
btn_people_num
.
setText
(
"1"
);
tv_time
.
setText
(
"時間:"
+
TimeUtils
.
getCurrentDate
(
TimeUtils
.
DATE_FORMAT_DATE_HM
));
tv_server_main
.
setText
(
""
);
}
}
btn_table
.
setText
(
tableno
);
tv_time
.
setText
(
"時間:"
+
openTime
);
btn_people_num
.
setText
(
tableInfo
.
getPerson
()
+
""
);
tv_server_main
.
setText
(
GsaCloudApplication
.
getMemberName
());
}
}
private
void
useMember
()
{
private
void
useMember
()
{
...
@@ -356,14 +365,14 @@ public class OrderContentActivity extends BaseFragmentActivity<OrderContentPrese
...
@@ -356,14 +365,14 @@ public class OrderContentActivity extends BaseFragmentActivity<OrderContentPrese
@Override
@Override
public
void
onStartRefreshTableData
()
{
public
void
onStartRefreshTableData
()
{
isRefreshData
=
true
;
isRefreshData
=
true
;
mPresenter
.
startTable
Timer
();
mPresenter
.
startTable
Polling
();
getTables
(
false
,
null
);
getTables
(
false
,
null
);
}
}
@Override
@Override
public
void
onPauseRefreshTableData
()
{
public
void
onPauseRefreshTableData
()
{
isRefreshData
=
false
;
isRefreshData
=
false
;
mPresenter
.
cancelTableTimer
();
mPresenter
.
stopTablePolling
();
//立刻停止獲取餐檯接口
//立刻停止獲取餐檯接口
if
(
mPresenter
.
getGetTablesDataDisposable
()
!=
null
&&
!
mPresenter
.
getGetTablesDataDisposable
().
isDisposed
())
{
if
(
mPresenter
.
getGetTablesDataDisposable
()
!=
null
&&
!
mPresenter
.
getGetTablesDataDisposable
().
isDisposed
())
{
mPresenter
.
getGetTablesDataDisposable
().
dispose
();
mPresenter
.
getGetTablesDataDisposable
().
dispose
();
...
@@ -484,7 +493,7 @@ public class OrderContentActivity extends BaseFragmentActivity<OrderContentPrese
...
@@ -484,7 +493,7 @@ public class OrderContentActivity extends BaseFragmentActivity<OrderContentPrese
TableBean
.
DataBean
tableInfo
=
DoshokuOrder
.
getInstance
().
getOpenTableInfo
();
TableBean
.
DataBean
tableInfo
=
DoshokuOrder
.
getInstance
().
getOpenTableInfo
();
if
(
initTable
&&
tableInfo
!=
null
&&
!
mDoshokuOrder
.
isModifyOrder
())
{
if
(
initTable
&&
tableInfo
!=
null
&&
!
mDoshokuOrder
.
isModifyOrder
())
{
//通知更新餐台状态
//通知更新餐台状态
EventBus
.
getDefault
().
post
(
new
InitTableEvent
(
tableInfo
.
getId
(),
tableInfo
.
getTableNumber
()),
"initTable_status_event"
);
EventBus
.
getDefault
().
post
(
new
InitTableEvent
(
tableInfo
.
getId
(),
tableInfo
.
getTableNumber
()),
"initTable_status_event"
);
}
}
mAppManager
.
killActivity
(
MealStandActivity
.
class
);
mAppManager
.
killActivity
(
MealStandActivity
.
class
);
killMyself
();
killMyself
();
...
@@ -551,7 +560,7 @@ public class OrderContentActivity extends BaseFragmentActivity<OrderContentPrese
...
@@ -551,7 +560,7 @@ public class OrderContentActivity extends BaseFragmentActivity<OrderContentPrese
// 设置返回码和返回携带的数据
// 设置返回码和返回携带的数据
if
(
tableInfo
!=
null
)
{
if
(
tableInfo
!=
null
)
{
//通知更新餐台状态
//通知更新餐台状态
EventBus
.
getDefault
().
post
(
new
InitTableEvent
(
tableInfo
.
getId
(),
tableInfo
.
getTableNumber
()),
"initTable_status_event"
);
EventBus
.
getDefault
().
post
(
new
InitTableEvent
(
tableInfo
.
getId
(),
tableInfo
.
getTableNumber
()),
"initTable_status_event"
);
}
}
setResult
(
Activity
.
RESULT_OK
,
null
);
setResult
(
Activity
.
RESULT_OK
,
null
);
killMyself
();
killMyself
();
...
@@ -562,7 +571,7 @@ public class OrderContentActivity extends BaseFragmentActivity<OrderContentPrese
...
@@ -562,7 +571,7 @@ public class OrderContentActivity extends BaseFragmentActivity<OrderContentPrese
TableBean
.
DataBean
tableInfo
=
DoshokuOrder
.
getInstance
().
getOpenTableInfo
();
TableBean
.
DataBean
tableInfo
=
DoshokuOrder
.
getInstance
().
getOpenTableInfo
();
if
(
tableInfo
!=
null
)
{
if
(
tableInfo
!=
null
)
{
//通知更新餐台状态
//通知更新餐台状态
EventBus
.
getDefault
().
post
(
new
InitTableEvent
(
tableInfo
.
getId
(),
tableInfo
.
getTableNumber
()),
"initTable_status_event"
);
EventBus
.
getDefault
().
post
(
new
InitTableEvent
(
tableInfo
.
getId
(),
tableInfo
.
getTableNumber
()),
"initTable_status_event"
);
}
}
setResult
(
Activity
.
RESULT_OK
,
null
);
setResult
(
Activity
.
RESULT_OK
,
null
);
killMyself
();
killMyself
();
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/TableActivity.java
View file @
f99df214
...
@@ -4,6 +4,7 @@ import android.content.Intent;
...
@@ -4,6 +4,7 @@ import android.content.Intent;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Message
;
import
android.os.Message
;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewTreeObserver
;
import
android.widget.AdapterView
;
import
android.widget.AdapterView
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.LinearLayout
;
...
@@ -22,7 +23,7 @@ import com.gingersoft.gsa.cloud.table.di.component.DaggerTableComponent;
...
@@ -22,7 +23,7 @@ import com.gingersoft.gsa.cloud.table.di.component.DaggerTableComponent;
import
com.gingersoft.gsa.cloud.table.mvp.contract.TableContract
;
import
com.gingersoft.gsa.cloud.table.mvp.contract.TableContract
;
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.model.constant.TableActionConstant
;
import
com.gingersoft.gsa.cloud.table.mvp.model.constant.TableActionConstant
;
import
com.gingersoft.gsa.cloud.table.mvp.model.table.action.PrintSky
O
rderAction
;
import
com.gingersoft.gsa.cloud.table.mvp.model.table.action.PrintSky
o
rderAction
;
import
com.gingersoft.gsa.cloud.table.mvp.model.table.action.TableAction
;
import
com.gingersoft.gsa.cloud.table.mvp.model.table.action.TableAction
;
import
com.gingersoft.gsa.cloud.table.mvp.presenter.TablePresenter
;
import
com.gingersoft.gsa.cloud.table.mvp.presenter.TablePresenter
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.fragment.AllTableFragment
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.fragment.AllTableFragment
;
...
@@ -57,6 +58,7 @@ import java.util.Map;
...
@@ -57,6 +58,7 @@ import java.util.Map;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
androidx.constraintlayout.widget.ConstraintLayout
;
import
androidx.core.content.ContextCompat
;
import
androidx.core.content.ContextCompat
;
import
androidx.fragment.app.Fragment
;
import
androidx.fragment.app.Fragment
;
import
androidx.recyclerview.widget.DefaultItemAnimator
;
import
androidx.recyclerview.widget.DefaultItemAnimator
;
...
@@ -95,6 +97,9 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
...
@@ -95,6 +97,9 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
@BindView
(
R2
.
id
.
tv_show_popup
)
@BindView
(
R2
.
id
.
tv_show_popup
)
TextView
tv_show_popup
;
TextView
tv_show_popup
;
@BindView
(
R2
.
id
.
rl_center_content
)
RelativeLayout
rl_center_content
;
@BindView
(
R2
.
id
.
rv_bottom_function
)
@BindView
(
R2
.
id
.
rv_bottom_function
)
RecyclerView
rv_bottom_function
;
RecyclerView
rv_bottom_function
;
@BindView
(
R2
.
id
.
btn_cancel_operat
)
@BindView
(
R2
.
id
.
btn_cancel_operat
)
...
@@ -166,7 +171,6 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
...
@@ -166,7 +171,6 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
// getTables(true, null);
// getTables(true, null);
// }
// }
// });
// });
View
view
=
getWindow
().
getDecorView
();
initTabAndPager
();
initTabAndPager
();
getTables
(
true
,
null
);
getTables
(
true
,
null
);
}
}
...
@@ -324,7 +328,7 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
...
@@ -324,7 +328,7 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
@OnClick
(
R2
.
id
.
rl_skyorder
)
@OnClick
(
R2
.
id
.
rl_skyorder
)
public
void
clickSkyorder
()
{
public
void
clickSkyorder
()
{
TableAction
tableAction
=
mPresenter
.
getTableActionByClass
(
PrintSky
O
rderAction
.
class
);
TableAction
tableAction
=
mPresenter
.
getTableActionByClass
(
PrintSky
o
rderAction
.
class
);
if
(
tableAction
!=
null
)
{
if
(
tableAction
!=
null
)
{
mPresenter
.
setTableAction
(
tableAction
);
mPresenter
.
setTableAction
(
tableAction
);
setCurrentTableAction
(
tableAction
);
setCurrentTableAction
(
tableAction
);
...
@@ -396,14 +400,14 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
...
@@ -396,14 +400,14 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
@Override
@Override
public
void
onStartRefreshTableData
()
{
public
void
onStartRefreshTableData
()
{
isRefreshData
=
true
;
isRefreshData
=
true
;
mPresenter
.
startTable
Timer
();
mPresenter
.
startTable
Polling
();
getTables
(
false
,
null
);
getTables
(
false
,
null
);
}
}
@Override
@Override
public
void
onPauseRefreshTableData
()
{
public
void
onPauseRefreshTableData
()
{
isRefreshData
=
false
;
isRefreshData
=
false
;
mPresenter
.
cancelTableTimer
();
mPresenter
.
stopTablePolling
();
//立刻停止獲取餐檯接口
//立刻停止獲取餐檯接口
if
(
mPresenter
.
getGetTablesDataDisposable
()
!=
null
&&
!
mPresenter
.
getGetTablesDataDisposable
().
isDisposed
())
{
if
(
mPresenter
.
getGetTablesDataDisposable
()
!=
null
&&
!
mPresenter
.
getGetTablesDataDisposable
().
isDisposed
())
{
mPresenter
.
getGetTablesDataDisposable
().
dispose
();
mPresenter
.
getGetTablesDataDisposable
().
dispose
();
...
@@ -426,6 +430,14 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
...
@@ -426,6 +430,14 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
@Override
@Override
public
void
setBottomFunctionVisibility
(
boolean
show
)
{
public
void
setBottomFunctionVisibility
(
boolean
show
)
{
rv_bottom_function
.
setVisibility
(
show
==
true
?
View
.
VISIBLE
:
View
.
GONE
);
rv_bottom_function
.
setVisibility
(
show
==
true
?
View
.
VISIBLE
:
View
.
GONE
);
ViewTreeObserver
viewTreeObserver
=
rv_bottom_function
.
getViewTreeObserver
();
viewTreeObserver
.
addOnGlobalLayoutListener
(
new
ViewTreeObserver
.
OnGlobalLayoutListener
()
{
@Override
public
void
onGlobalLayout
()
{
rv_bottom_function
.
getViewTreeObserver
().
removeOnGlobalLayoutListener
(
this
);
setCenterContentMarginBottom
(
rv_bottom_function
.
getHeight
());
}
});
}
}
@Override
@Override
...
@@ -433,8 +445,15 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
...
@@ -433,8 +445,15 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
iv_lock
.
setVisibility
(
show
==
true
?
View
.
VISIBLE
:
View
.
GONE
);
iv_lock
.
setVisibility
(
show
==
true
?
View
.
VISIBLE
:
View
.
GONE
);
}
}
@Override
public
void
setCenterContentMarginBottom
(
int
bottomMargin
)
{
RelativeLayout
.
LayoutParams
layoutParams
=
(
RelativeLayout
.
LayoutParams
)
rl_center_content
.
getLayoutParams
();
layoutParams
.
bottomMargin
=
bottomMargin
;
rl_center_content
.
setLayoutParams
(
layoutParams
);
}
private
boolean
showSkyorderLayoutVisibility
(
boolean
show
)
{
private
boolean
showSkyorderLayoutVisibility
(
boolean
show
)
{
PrintSky
OrderAction
skyOrderAction
=
(
PrintSkyOrderAction
)
mPresenter
.
getTableActionByClass
(
PrintSkyO
rderAction
.
class
);
PrintSky
orderAction
skyOrderAction
=
(
PrintSkyorderAction
)
mPresenter
.
getTableActionByClass
(
PrintSkyo
rderAction
.
class
);
if
(
skyOrderAction
==
null
)
{
if
(
skyOrderAction
==
null
)
{
rl_skyorder
.
setVisibility
(
View
.
GONE
);
rl_skyorder
.
setVisibility
(
View
.
GONE
);
return
false
;
return
false
;
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/BottomFunctionAdapter.java
View file @
f99df214
...
@@ -107,6 +107,6 @@ public class BottomFunctionAdapter extends DefaultAdapter<Function> {
...
@@ -107,6 +107,6 @@ public class BottomFunctionAdapter extends DefaultAdapter<Function> {
tv_name
.
setText
(
item
.
getResName
());
tv_name
.
setText
(
item
.
getResName
());
}
}
}
}
}
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/widget/SkyOrderDialog.java
View file @
f99df214
...
@@ -399,7 +399,7 @@ public class SkyOrderDialog extends BaseRetryDialog implements View.OnClickListe
...
@@ -399,7 +399,7 @@ public class SkyOrderDialog extends BaseRetryDialog implements View.OnClickListe
*/
*/
long
currentTimeMillis
=
System
.
currentTimeMillis
();
long
currentTimeMillis
=
System
.
currentTimeMillis
();
//设置默认交台时间为当前时间往后推多少分钟(可配置)
//设置默认交台时间为当前时间往后推多少分钟(可配置)
long
defaultMealLater
=
currentTimeMillis
+
(
foodSummary
.
get
MealLength
()
*
60
*
1000
);
long
defaultMealLater
=
currentTimeMillis
+
(
foodSummary
.
get
DiningTime
()
*
60
*
1000
);
String
defaultMealLaterTimes
[]
=
TimeUtils
.
getStringByFormat
(
defaultMealLater
,
TimeUtils
.
DATE_FORMAT_DATE_HM
).
split
(
":"
);
String
defaultMealLaterTimes
[]
=
TimeUtils
.
getStringByFormat
(
defaultMealLater
,
TimeUtils
.
DATE_FORMAT_DATE_HM
).
split
(
":"
);
for
(
int
i
=
0
;
i
<
mMealHours
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
mMealHours
.
size
();
i
++)
{
int
hour
=
mMealHours
.
get
(
i
);
int
hour
=
mMealHours
.
get
(
i
);
...
...
table-module/src/main/res/layout/table_activity_order_content.xml
View file @
f99df214
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
android:drawableLeft=
"@drawable/qmui_icon_topbar_back"
android:drawableLeft=
"@drawable/qmui_icon_topbar_back"
android:gravity=
"center_vertical"
android:gravity=
"center_vertical"
android:paddingLeft=
"@dimen/dp_5"
android:paddingLeft=
"@dimen/dp_5"
android:text=
"
105A-2
"
android:text=
"
外賣
"
android:textColor=
"@color/theme_white_color"
android:textColor=
"@color/theme_white_color"
android:textSize=
"@dimen/font_large"
android:textSize=
"@dimen/font_large"
android:textStyle=
"bold"
/>
android:textStyle=
"bold"
/>
...
@@ -97,7 +97,7 @@
...
@@ -97,7 +97,7 @@
android:layout_alignParentRight=
"true"
android:layout_alignParentRight=
"true"
android:background=
"@color/trans"
android:background=
"@color/trans"
android:drawableLeft=
"@mipmap/meal_people_num_white"
android:drawableLeft=
"@mipmap/meal_people_num_white"
android:text=
"
8
"
android:text=
"
1
"
android:textColor=
"@color/theme_white_color"
android:textColor=
"@color/theme_white_color"
android:textSize=
"@dimen/font_large"
android:textSize=
"@dimen/font_large"
android:textStyle=
"bold"
/>
android:textStyle=
"bold"
/>
...
...
table-module/src/main/res/layout/table_activity_table.xml
View file @
f99df214
...
@@ -9,14 +9,14 @@
...
@@ -9,14 +9,14 @@
android:id=
"@+id/topbar"
android:id=
"@+id/topbar"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"?attr/qmui_topbar_height"
android:layout_height=
"?attr/qmui_topbar_height"
app:layout_constraintTop_toTopOf=
"parent"
app:qmui_topbar_title_color=
"@color/theme_white_color"
/>
app:qmui_topbar_title_color=
"@color/theme_white_color"
/>
<RelativeLayout
<RelativeLayout
android:id=
"@+id/rl_center_content"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_above=
"@+id/bn_table_function"
android:layout_marginTop=
"?attr/qmui_topbar_height"
android:layout_marginTop=
"?attr/qmui_topbar_height"
android:layout_marginBottom=
"@dimen/dp_60"
android:background=
"#FFE8E8E8"
>
android:background=
"#FFE8E8E8"
>
<TextView
<TextView
...
@@ -69,24 +69,33 @@
...
@@ -69,24 +69,33 @@
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
<androidx.
recyclerview.widget.RecyclerView
<androidx.
constraintlayout.widget.ConstraintLayout
android:id=
"@+id/
rv_bottom_function
"
android:id=
"@+id/
cl_bottom
"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_60"
android:layout_height=
"wrap_content"
android:layout_gravity=
"bottom"
android:layout_alignParentBottom=
"true"
>
android:layout_alignParentBottom=
"true"
android:background=
"@drawable/table_shape_table_bottom_function_layout"
android:orientation=
"horizontal"
/>
<include
layout=
"@layout/table_item_skyorder"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_bottom_function"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_gravity=
"bottom"
android:background=
"@drawable/table_shape_table_bottom_function_layout"
android:orientation=
"horizontal"
app:layout_constraintBottom_toBottomOf=
"parent"
/>
<com.qmuiteam.qmui.layout.QMUIButton
<include
layout=
"@layout/table_item_skyorder"
/>
android:id=
"@+id/btn_cancel_operat"
android:layout_width=
"match_parent"
<com.qmuiteam.qmui.layout.QMUIButton
android:layout_height=
"@dimen/dp_60"
android:id=
"@+id/btn_cancel_operat"
android:layout_alignParentBottom=
"true"
android:layout_width=
"match_parent"
android:background=
"@color/transparent"
android:layout_height=
"@dimen/dp_60"
android:text=
"取消"
android:layout_alignParentBottom=
"true"
android:textColor=
"@color/theme_white_color"
android:background=
"@color/transparent"
android:visibility=
"invisible"
/>
android:text=
"取消"
android:textColor=
"@color/theme_white_color"
android:visibility=
"invisible"
app:layout_constraintBottom_toBottomOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>
</RelativeLayout>
table-module/src/main/res/layout/table_item_skyorder.xml
View file @
f99df214
...
@@ -9,13 +9,13 @@
...
@@ -9,13 +9,13 @@
android:layout_marginBottom=
"@dimen/dp_27"
android:layout_marginBottom=
"@dimen/dp_27"
android:gravity=
"center"
android:gravity=
"center"
android:orientation=
"vertical"
android:orientation=
"vertical"
app:qmui_backgroundColor=
"@color/theme_color"
>
app:qmui_backgroundColor=
"@color/theme_color"
app:layout_constraintStart_toStartOf=
"@+id/rv_bottom_function"
app:layout_constraintEnd_toEndOf=
"@+id/rv_bottom_function"
app:layout_constraintBottom_toBottomOf=
"@+id/rv_bottom_function"
app:layout_constraintTop_toTopOf=
"@+id/rv_bottom_function"
app:layout_constraintBottom_toTopOf=
"@+id/rv_bottom_function"
>
<!-- app:layout_constraintStart_toStartOf="@+id/rv_bottom_function"-->
<!-- app:layout_constraintEnd_toEndOf="@+id/rv_bottom_function"-->
<!-- app:layout_constraintBottom_toBottomOf="@+id/rv_bottom_function"-->
<!-- app:layout_constraintTop_toTopOf="@+id/rv_bottom_function"-->
<!-- app:layout_constraintBottom_toTopOf="@+id/rv_bottom_function"-->
<ImageView
<ImageView
android:id=
"@+id/iv_skyorder_qrcode"
android:id=
"@+id/iv_skyorder_qrcode"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
...
...
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