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
aa04da1b
Commit
aa04da1b
authored
Oct 27, 2020
by
宁斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加折扣邏輯
parent
5dd12608
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
745 additions
and
260 deletions
+745
-260
arms/build.gradle
+1
-0
base-module/src/main/java/com/gingersoft/gsa/cloud/bean/expandInfo/UIStyleExtendedConfiguration.java
+2
-2
base-module/src/main/java/com/gingersoft/gsa/cloud/patterns/Strategy.java
+4
-1
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/view/OrderPayView.java
+2
-2
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/widget/dialog/CommonTipDialog.java
+15
-24
base-module/src/main/res/values/styles.xml
+11
-0
config.gradle
+4
-0
database-module/build.gradle
+1
-1
database-module/src/main/java/com/gingersoft/gsa/cloud/database/bean/Discount.java
+288
-55
database-module/src/main/java/com/gingersoft/gsa/cloud/database/greendao/DaoMaster.java
+2
-2
database-module/src/main/java/com/gingersoft/gsa/cloud/database/greendao/DiscountDao.java
+138
-32
order-base/src/main/java/com/gingersoft/gsa/cloud/base/order/bean/OrderBean.java
+4
-4
order-base/src/main/java/com/gingersoft/gsa/cloud/base/order/bean/discount/OrderDiscount.java
+2
-2
order-base/src/main/java/com/gingersoft/gsa/cloud/base/order/billItem/DiscountItem.java
+0
-2
order-base/src/main/java/com/gingersoft/gsa/cloud/base/order/cart/ShoppingCart.java
+7
-4
order-base/src/main/java/com/gingersoft/gsa/cloud/base/order/commodity/MealCommodity.java
+1
-1
order-base/src/main/java/com/gingersoft/gsa/cloud/base/order/commodity/OrderDetail.java
+3
-2
order-base/src/main/java/com/gingersoft/gsa/cloud/base/order/discount/NomalDiscount.java
+13
-9
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/discount/DiscountAction.java
+17
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/discount/NomalDiscountAction.java
+82
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/TableAction.java
+2
-2
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/BaseOrderPresenter.java
+57
-46
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/MealStandPresenter.java
+45
-20
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/OrderContentPresenter.java
+19
-9
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/TablePresenter.java
+2
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/orderManager/AllOrderPresenter.java
+3
-2
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/MealStandActivity.java
+16
-2
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/orderManager/OrderDetailActivity.java
+3
-2
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/meal/DiscountAdapter.java
+0
-4
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/meal/FoodAdapter.java
+1
-10
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/meal/SelectMealAdapter.java
+0
-20
No files found.
arms/build.gradle
View file @
aa04da1b
...
@@ -101,6 +101,7 @@ dependencies {
...
@@ -101,6 +101,7 @@ dependencies {
exclude
module:
'support-annotations'
exclude
module:
'support-annotations'
}
}
api
rootProject
.
ext
.
dependencies
[
'rxerrorhandler2'
]
api
rootProject
.
ext
.
dependencies
[
'rxerrorhandler2'
]
api
rootProject
.
ext
.
dependencies
[
"rxbinding"
]
//network
//network
api
(
rootProject
.
ext
.
dependencies
[
"retrofit"
])
{
api
(
rootProject
.
ext
.
dependencies
[
"retrofit"
])
{
exclude
module:
'okhttp'
exclude
module:
'okhttp'
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/bean/expandInfo/UIStyleExtendedConfiguration.java
View file @
aa04da1b
...
@@ -61,7 +61,7 @@ public class UIStyleExtendedConfiguration {
...
@@ -61,7 +61,7 @@ public class UIStyleExtendedConfiguration {
.
remark
(
"套餐高度"
)
.
remark
(
"套餐高度"
)
.
build
();
.
build
();
private
ExpandInfoSetting
discountHeight
=
ExpandInfoSetting
.
builder
()
private
ExpandInfoSetting
discountHeight
=
ExpandInfoSetting
.
builder
()
.
valueInt
(
8
0
)
.
valueInt
(
9
0
)
.
remark
(
"餐牌折扣Item高度"
)
.
remark
(
"餐牌折扣Item高度"
)
.
build
();
.
build
();
private
ExpandInfoSetting
LayoutQtyHeight
=
ExpandInfoSetting
.
builder
()
private
ExpandInfoSetting
LayoutQtyHeight
=
ExpandInfoSetting
.
builder
()
...
@@ -100,7 +100,7 @@ public class UIStyleExtendedConfiguration {
...
@@ -100,7 +100,7 @@ public class UIStyleExtendedConfiguration {
.
remark
(
"細項字體大小"
)
.
remark
(
"細項字體大小"
)
.
build
();
.
build
();
private
ExpandInfoSetting
discountFontSize
=
ExpandInfoSetting
.
builder
()
private
ExpandInfoSetting
discountFontSize
=
ExpandInfoSetting
.
builder
()
.
valueInt
(
1
4
)
.
valueInt
(
1
6
)
.
remark
(
"折扣字體大小"
)
.
remark
(
"折扣字體大小"
)
.
build
();
.
build
();
private
ExpandInfoSetting
soldoutFoodFlagFontSize
=
ExpandInfoSetting
.
builder
()
private
ExpandInfoSetting
soldoutFoodFlagFontSize
=
ExpandInfoSetting
.
builder
()
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/patterns/Strategy.java
View file @
aa04da1b
...
@@ -9,6 +9,9 @@ package com.gingersoft.gsa.cloud.patterns;
...
@@ -9,6 +9,9 @@ package com.gingersoft.gsa.cloud.patterns;
*/
*/
public
interface
Strategy
<
T
>
{
public
interface
Strategy
<
T
>
{
/**具體行為實現方法*/
/**
* 具體行為實現方法
*/
void
action
(
T
t
);
void
action
(
T
t
);
}
}
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/view/OrderPayView.java
View file @
aa04da1b
...
@@ -47,7 +47,7 @@ public class OrderPayView extends LinearLayout {
...
@@ -47,7 +47,7 @@ public class OrderPayView extends LinearLayout {
/**
/**
* 服務費金額
* 服務費金額
*/
*/
private
d
ouble
serviceCharge
=
0.0
;
private
D
ouble
serviceCharge
=
0.0
;
private
MemberInfo
memberInfo
;
private
MemberInfo
memberInfo
;
...
@@ -99,7 +99,7 @@ public class OrderPayView extends LinearLayout {
...
@@ -99,7 +99,7 @@ public class OrderPayView extends LinearLayout {
this
.
totalAmount
=
totalAmount
;
this
.
totalAmount
=
totalAmount
;
}
}
public
void
setServiceCharge
(
d
ouble
serviceCharge
)
{
public
void
setServiceCharge
(
D
ouble
serviceCharge
)
{
this
.
serviceCharge
=
serviceCharge
;
this
.
serviceCharge
=
serviceCharge
;
}
}
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/widget/dialog/CommonTipDialog.java
View file @
aa04da1b
...
@@ -189,39 +189,30 @@ public class CommonTipDialog {
...
@@ -189,39 +189,30 @@ public class CommonTipDialog {
* @param context
* @param context
* @param title
* @param title
* @param placeholder
* @param placeholder
* @param c
* @param object
* @param methodName
* @param parameterTypes
* @param parameters
*/
*/
public
static
void
showEdit
TextDialog
(
Activity
context
,
String
title
,
String
placeholder
,
Class
c
,
Object
object
,
String
methodName
,
Class
[]
parameterTypes
,
Object
[]
parameters
)
{
public
static
void
showEdit
Dialog
(
Activity
context
,
String
title
,
String
placeholder
,
int
inputType
,
OnEditTextListener
onEditTextListener
)
{
final
QMUIDialog
.
EditTextDialogBuilder
dialogBuilder
=
new
QMUIDialog
.
EditTextDialogBuilder
(
context
);
final
QMUIDialog
.
EditTextDialogBuilder
dialogBuilder
=
new
QMUIDialog
.
EditTextDialogBuilder
(
context
);
dialogBuilder
.
setTitle
(
title
);
dialogBuilder
.
setTitle
(
title
);
dialogBuilder
.
setPlaceholder
(
placeholder
);
dialogBuilder
.
setPlaceholder
(
placeholder
);
dialogBuilder
.
setInputType
(
InputType
.
TYPE_CLASS_TEXT
);
dialogBuilder
.
setInputType
(
inputType
);
dialogBuilder
.
addAction
(
0
,
"確認"
,
QMUIDialogAction
.
ACTION_PROP_NEGATIVE
,
(
dialog
,
index
)
->
{
dialogBuilder
.
addAction
(
0
,
"確認"
,
QMUIDialogAction
.
ACTION_PROP_NEGATIVE
,
(
dialog
,
index
)
->
{
dialog
.
dismiss
();
dialog
.
dismiss
();
if
(
TextUtils
.
isEmpty
(
methodName
))
{
if
(
onEditTextListener
!=
null
)
{
return
;
CharSequence
text
=
dialogBuilder
.
getEditText
().
getText
();
}
onEditTextListener
.
inputText
(
text
.
toString
());
try
{
Method
method
=
c
.
getDeclaredMethod
(
methodName
,
parameterTypes
);
method
.
setAccessible
(
true
);
method
.
invoke
(
object
,
parameters
);
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
catch
(
InvocationTargetException
e
)
{
e
.
printStackTrace
();
}
catch
(
NoSuchMethodException
e
)
{
e
.
printStackTrace
();
}
}
});
});
if
(!
TextUtils
.
isEmpty
(
methodName
))
{
dialogBuilder
.
addAction
(
"取消"
,
(
dialog
,
index
)
->
dialog
.
dismiss
());
dialogBuilder
.
addAction
(
"取消"
,
(
dialog
,
index
)
->
dialog
.
dismiss
());
dialogBuilder
.
create
(
R
.
style
.
MyEditDialogTheme
).
show
();
}
dialogBuilder
.
create
(
R
.
style
.
MyDialogTheme2
).
show
();
}
}
private
OnEditTextListener
onEditTextListener
;
public
void
setOnEditTextListener
(
OnEditTextListener
onEditTextListener
)
{
this
.
onEditTextListener
=
onEditTextListener
;
}
public
interface
OnEditTextListener
{
void
inputText
(
String
text
);
}
}
}
base-module/src/main/res/values/styles.xml
View file @
aa04da1b
...
@@ -177,6 +177,17 @@
...
@@ -177,6 +177,17 @@
<item
name=
"qmui_dialog_menu_item_style"
>
@style/DialogTheme2MenuItemStyle
</item>
<item
name=
"qmui_dialog_menu_item_style"
>
@style/DialogTheme2MenuItemStyle
</item>
</style>
</style>
<style
name=
"MyEditDialogTheme"
parent=
"QMUI.Dialog.EditContent"
>
<!-- <item name="qmui_dialog_wrapper_style">@style/dialog_wrapper_style_63</item>-->
<item
name=
"qmui_dialog_title_style"
>
@style/DialogTheme2TitleStyle
</item>
<item
name=
"qmui_dialog_action_container_style"
>
@style/DialogTheme2ActionContainerStyle
</item>
<item
name=
"qmui_dialog_action_style"
>
@style/DialogTheme2ActionStyle
</item>
<item
name=
"qmui_dialog_message_content_style"
>
@style/DialogTheme2MessageContentStyle
</item>
<item
name=
"qmui_dialog_menu_container_style"
>
@style/DialogTheme2MenuContainerStyle
</item>
<item
name=
"qmui_dialog_menu_item_style"
>
@style/DialogTheme2MenuItemStyle
</item>
</style>
<style
name=
"ReleaseDialogTheme"
parent=
"MyDialogTheme2"
>
<style
name=
"ReleaseDialogTheme"
parent=
"MyDialogTheme2"
>
<!-- <item name="qmui_dialog_wrapper_style">@style/QMUI.Dialog.Wrapper</item>-->
<!-- <item name="qmui_dialog_wrapper_style">@style/QMUI.Dialog.Wrapper</item>-->
<item
name=
"qmui_dialog_message_content_style"
>
@style/ReleaseMessageContentStyle
</item>
<item
name=
"qmui_dialog_message_content_style"
>
@style/ReleaseMessageContentStyle
</item>
...
...
config.gradle
View file @
aa04da1b
...
@@ -79,6 +79,10 @@ ext {
...
@@ -79,6 +79,10 @@ ext {
"rxpermissions2"
:
"com.tbruyelle.rxpermissions2:rxpermissions:0.9.5@aar"
,
"rxpermissions2"
:
"com.tbruyelle.rxpermissions2:rxpermissions:0.9.5@aar"
,
"rxerrorhandler2"
:
"me.jessyan:rxerrorhandler:2.1.1"
,
"rxerrorhandler2"
:
"me.jessyan:rxerrorhandler:2.1.1"
,
//rxbinding
"rxbinding"
:
"com.jakewharton.rxbinding4:rxbinding:4.0.0"
,
//tools
//tools
"dagger2"
:
"com.google.dagger:dagger:${version["
dagger2SdkVersion
"]}"
,
"dagger2"
:
"com.google.dagger:dagger:${version["
dagger2SdkVersion
"]}"
,
"dagger2-android"
:
"com.google.dagger:dagger-android:${version["
dagger2SdkVersion
"]}"
,
"dagger2-android"
:
"com.google.dagger:dagger-android:${version["
dagger2SdkVersion
"]}"
,
...
...
database-module/build.gradle
View file @
aa04da1b
...
@@ -51,7 +51,7 @@ android {
...
@@ -51,7 +51,7 @@ android {
/**
/**
* 版本号
* 版本号
*/
*/
schemaVersion
2
0
schemaVersion
2
1
/**
/**
* greendao输出dao的数据库操作实体类文件夹(相对路径 包名+自定义路径名称,包将创建于包名的直接路径下)
* greendao输出dao的数据库操作实体类文件夹(相对路径 包名+自定义路径名称,包将创建于包名的直接路径下)
*/
*/
...
...
database-module/src/main/java/com/gingersoft/gsa/cloud/database/bean/Discount.java
View file @
aa04da1b
package
com
.
gingersoft
.
gsa
.
cloud
.
database
.
bean
;
package
com
.
gingersoft
.
gsa
.
cloud
.
database
.
bean
;
import
org.greenrobot.greendao.annotation.Entity
;
import
org.greenrobot.greendao.annotation.Entity
;
import
org.greenrobot.greendao.annotation.Generated
;
import
org.greenrobot.greendao.annotation.Id
;
import
org.greenrobot.greendao.annotation.Id
;
import
org.greenrobot.greendao.annotation.Property
;
import
org.greenrobot.greendao.annotation.Property
;
import
org.greenrobot.greendao.annotation.Transient
;
import
org.greenrobot.greendao.annotation.Transient
;
import
lombok.Data
;
import
lombok.Data
;
import
org.greenrobot.greendao.annotation.Generated
;
/**
/**
* 作者:ELEGANT_BIN
* 作者:ELEGANT_BIN
* 版本:1.6.0
* 版本:1.6.0
...
@@ -18,6 +20,7 @@ import lombok.Data;
...
@@ -18,6 +20,7 @@ import lombok.Data;
@Entity
@Entity
public
class
Discount
{
public
class
Discount
{
/**
/**
* ID
* ID
*/
*/
...
@@ -25,19 +28,25 @@ public class Discount {
...
@@ -25,19 +28,25 @@ public class Discount {
@Id
(
autoincrement
=
true
)
@Id
(
autoincrement
=
true
)
private
Long
id
;
private
Long
id
;
private
int
restaurant
_i
d
;
private
int
restaurant
I
d
;
/**
/**
* 金額
* 金額
*/
*/
private
double
amount
;
private
double
amount
;
/**
/**
* 折扣
* 折扣
比例
*/
*/
private
double
discount_v
alue
;
private
int
discountV
alue
;
/**
/**
* 类型#0:金额;1:折扣
;
* 类型#0:金额;1:折扣
比例;2:自定義金額;3:自定義金額鍵盤輸入;4:免服務費
*/
*/
private
int
type
;
private
int
type
;
public
static
final
byte
DISCOUNT_TYPE_AMOUNT
=
0
;
public
static
final
byte
DISCOUNT_TYPE_RATE
=
1
;
public
static
final
byte
DISCOUNT_TYPE_CUSTOM_AMOUNT
=
2
;
public
static
final
byte
DISCOUNT_TYPE_KEYBOARD
=
3
;
public
static
final
byte
DISCOUNT_TYPE_FREE_SERVICE_CHARGE
=
4
;
/**
/**
* 折扣可使用范围#0:食品;1:账单;
* 折扣可使用范围#0:食品;1:账单;
*/
*/
...
@@ -50,9 +59,69 @@ public class Discount {
...
@@ -50,9 +59,69 @@ public class Discount {
* 折扣描述
* 折扣描述
*/
*/
private
String
remark
;
private
String
remark
;
private
String
begin_time
;
/**
private
String
end_time
;
* 是否免服務費 0:否,1:是
*/
private
byte
freeServiceCharge
;
/**
* 是否經理批准 0:否,1:是
*/
private
byte
managerApproval
;
/**
* 顏色
*/
private
String
color
;
/**
* 落單類型 0:餐檯模式,1:外賣模式,2:外送模式,3:自取模式
*/
private
String
placeOrderType
;
/**
* 折扣上限
*/
private
double
discountCap
;
/**
* 銷售額
*/
private
double
salesAmount
;
/**
* 免稅 0:否,1:是
*/
private
byte
taxFree
;
/**
* 獨佔折扣 0:否,1:是
*/
private
byte
exclusive
;
/**
* 暫停 0:否,1:是
*/
private
byte
pause
;
/**
* 折上折 0:否,1:是
*/
private
byte
additionalDiscount
;
/**
* 只一次 0:否,1:是
*/
private
byte
onlyOnce
;
/**
* 最小賬單金額
*/
private
double
minBillAmount
;
/**
* 扣減積分 0:否,1:是
*/
private
byte
pointsDeduction
;
/**
* 整單免積分 0:否,1:是
*/
private
byte
wholeFreePoints
;
/**
* 最小金額類型 0:合計,1:總金額 默認 1
*/
private
byte
amountTypeMin
;
private
String
beginTime
;
private
String
endTime
;
/**
/**
* 自定義字段
* 自定義字段
...
@@ -61,133 +130,297 @@ public class Discount {
...
@@ -61,133 +130,297 @@ public class Discount {
private
long
memberId
=
-
1
;
private
long
memberId
=
-
1
;
@Generated
(
hash
=
901376651
)
@Generated
(
hash
=
637151409
)
public
Discount
(
Long
id
,
int
restaurant_id
,
double
amount
,
double
discount_value
,
public
Discount
(
Long
id
,
int
restaurantId
,
double
amount
,
int
discountValue
,
int
type
,
String
discountType
,
int
status
,
String
remark
,
String
begin_time
,
int
type
,
String
discountType
,
int
status
,
String
remark
,
String
end_time
)
{
byte
freeServiceCharge
,
byte
managerApproval
,
String
color
,
String
placeOrderType
,
double
discountCap
,
double
salesAmount
,
byte
taxFree
,
byte
exclusive
,
byte
pause
,
byte
additionalDiscount
,
byte
onlyOnce
,
double
minBillAmount
,
byte
pointsDeduction
,
byte
wholeFreePoints
,
byte
amountTypeMin
,
String
beginTime
,
String
endTime
)
{
this
.
id
=
id
;
this
.
id
=
id
;
this
.
restaurant
_id
=
restaurant_i
d
;
this
.
restaurant
Id
=
restaurantI
d
;
this
.
amount
=
amount
;
this
.
amount
=
amount
;
this
.
discount
_value
=
discount_v
alue
;
this
.
discount
Value
=
discountV
alue
;
this
.
type
=
type
;
this
.
type
=
type
;
this
.
discountType
=
discountType
;
this
.
discountType
=
discountType
;
this
.
status
=
status
;
this
.
status
=
status
;
this
.
remark
=
remark
;
this
.
remark
=
remark
;
this
.
begin_time
=
begin_time
;
this
.
freeServiceCharge
=
freeServiceCharge
;
this
.
end_time
=
end_time
;
this
.
managerApproval
=
managerApproval
;
this
.
color
=
color
;
this
.
placeOrderType
=
placeOrderType
;
this
.
discountCap
=
discountCap
;
this
.
salesAmount
=
salesAmount
;
this
.
taxFree
=
taxFree
;
this
.
exclusive
=
exclusive
;
this
.
pause
=
pause
;
this
.
additionalDiscount
=
additionalDiscount
;
this
.
onlyOnce
=
onlyOnce
;
this
.
minBillAmount
=
minBillAmount
;
this
.
pointsDeduction
=
pointsDeduction
;
this
.
wholeFreePoints
=
wholeFreePoints
;
this
.
amountTypeMin
=
amountTypeMin
;
this
.
beginTime
=
beginTime
;
this
.
endTime
=
endTime
;
}
}
@Generated
(
hash
=
1777606421
)
@Generated
(
hash
=
1777606421
)
public
Discount
()
{
public
Discount
()
{
}
}
public
long
getMemberId
()
{
return
memberId
;
}
public
void
setMemberId
(
long
memberId
)
{
this
.
memberId
=
memberId
;
}
public
Long
getId
()
{
public
Long
getId
()
{
return
this
.
id
;
return
this
.
id
;
}
}
public
void
setId
(
Long
id
)
{
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
this
.
id
=
id
;
}
}
public
int
getRestaurantId
()
{
public
int
getRestaurant_id
()
{
return
this
.
restaurantId
;
return
this
.
restaurant_id
;
}
}
public
void
setRestaurantId
(
int
restaurantId
)
{
public
void
setRestaurant_id
(
int
restaurant_id
)
{
this
.
restaurantId
=
restaurantId
;
this
.
restaurant_id
=
restaurant_id
;
}
}
public
double
getAmount
()
{
public
double
getAmount
()
{
return
this
.
amount
;
return
this
.
amount
;
}
}
public
void
setAmount
(
double
amount
)
{
public
void
setAmount
(
double
amount
)
{
this
.
amount
=
amount
;
this
.
amount
=
amount
;
}
}
public
int
getDiscountValue
()
{
public
double
getDiscount_value
()
{
return
this
.
discountValue
;
return
this
.
discount_value
;
}
}
public
void
setDiscountValue
(
int
discountValue
)
{
public
void
setDiscount_value
(
double
discount_value
)
{
this
.
discountValue
=
discountValue
;
this
.
discount_value
=
discount_value
;
}
}
public
int
getType
()
{
public
int
getType
()
{
return
this
.
type
;
return
this
.
type
;
}
}
public
void
setType
(
int
type
)
{
public
void
setType
(
int
type
)
{
this
.
type
=
type
;
this
.
type
=
type
;
}
}
public
String
getDiscountType
()
{
public
String
getDiscountType
()
{
return
this
.
discountType
;
return
this
.
discountType
;
}
}
public
void
setDiscountType
(
String
discountType
)
{
public
void
setDiscountType
(
String
discountType
)
{
this
.
discountType
=
discountType
;
this
.
discountType
=
discountType
;
}
}
public
int
getStatus
()
{
public
int
getStatus
()
{
return
this
.
status
;
return
this
.
status
;
}
}
public
void
setStatus
(
int
status
)
{
public
void
setStatus
(
int
status
)
{
this
.
status
=
status
;
this
.
status
=
status
;
}
}
public
String
getRemark
()
{
public
String
getRemark
()
{
return
this
.
remark
;
return
this
.
remark
;
}
}
public
void
setRemark
(
String
remark
)
{
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
this
.
remark
=
remark
;
}
}
public
Byte
getFreeServiceCharge
()
{
return
this
.
freeServiceCharge
;
}
public
void
setFreeServiceCharge
(
Byte
freeServiceCharge
)
{
this
.
freeServiceCharge
=
freeServiceCharge
;
}
public
Byte
getManagerApproval
()
{
return
this
.
managerApproval
;
}
public
void
setManagerApproval
(
Byte
managerApproval
)
{
this
.
managerApproval
=
managerApproval
;
}
public
String
getColor
()
{
return
this
.
color
;
}
public
void
setColor
(
String
color
)
{
this
.
color
=
color
;
}
public
String
getPlaceOrderType
()
{
return
this
.
placeOrderType
;
}
public
void
setPlaceOrderType
(
String
placeOrderType
)
{
this
.
placeOrderType
=
placeOrderType
;
}
public
double
getDiscountCap
()
{
return
this
.
discountCap
;
}
public
void
setDiscountCap
(
double
discountCap
)
{
this
.
discountCap
=
discountCap
;
}
public
Double
getSalesAmount
()
{
return
this
.
salesAmount
;
}
public
void
setSalesAmount
(
Double
salesAmount
)
{
this
.
salesAmount
=
salesAmount
;
}
public
String
getBegin_tim
e
()
{
public
Byte
getTaxFre
e
()
{
return
this
.
begin_tim
e
;
return
this
.
taxFre
e
;
}
}
public
void
setTaxFree
(
Byte
taxFree
)
{
this
.
taxFree
=
taxFree
;
}
public
void
setBegin_time
(
String
begin_time
)
{
public
Byte
getExclusive
(
)
{
this
.
begin_time
=
begin_tim
e
;
return
this
.
exclusiv
e
;
}
}
public
void
setExclusive
(
Byte
exclusive
)
{
this
.
exclusive
=
exclusive
;
}
public
Byte
getPause
()
{
return
this
.
pause
;
}
public
void
setPause
(
Byte
pause
)
{
this
.
pause
=
pause
;
}
public
Byte
getAdditionalDiscount
()
{
return
this
.
additionalDiscount
;
}
public
String
getEnd_time
(
)
{
public
void
setAdditionalDiscount
(
Byte
additionalDiscount
)
{
return
this
.
end_time
;
this
.
additionalDiscount
=
additionalDiscount
;
}
}
public
Byte
getOnlyOnce
()
{
return
this
.
onlyOnce
;
}
public
void
setOnlyOnce
(
Byte
onlyOnce
)
{
this
.
onlyOnce
=
onlyOnce
;
}
public
Double
getMinBillAmount
()
{
return
this
.
minBillAmount
;
}
public
void
setMinBillAmount
(
Double
minBillAmount
)
{
this
.
minBillAmount
=
minBillAmount
;
}
public
Byte
getPointsDeduction
()
{
return
this
.
pointsDeduction
;
}
public
void
setPointsDeduction
(
Byte
pointsDeduction
)
{
this
.
pointsDeduction
=
pointsDeduction
;
}
public
Byte
getWholeFreePoints
()
{
return
this
.
wholeFreePoints
;
}
public
void
setWholeFreePoints
(
Byte
wholeFreePoints
)
{
this
.
wholeFreePoints
=
wholeFreePoints
;
}
public
Byte
getAmountTypeMin
()
{
return
this
.
amountTypeMin
;
}
public
void
setAmountTypeMin
(
Byte
amountTypeMin
)
{
this
.
amountTypeMin
=
amountTypeMin
;
}
public
String
getBeginTime
()
{
return
this
.
beginTime
;
}
public
void
setBeginTime
(
String
beginTime
)
{
this
.
beginTime
=
beginTime
;
}
public
String
getEndTime
()
{
return
this
.
endTime
;
}
public
void
setEndTime
(
String
endTime
)
{
this
.
endTime
=
endTime
;
}
public
void
setFreeServiceCharge
(
byte
freeServiceCharge
)
{
this
.
freeServiceCharge
=
freeServiceCharge
;
}
public
void
setManagerApproval
(
byte
managerApproval
)
{
this
.
managerApproval
=
managerApproval
;
}
public
void
setDiscountCap
(
long
discountCap
)
{
this
.
discountCap
=
discountCap
;
}
public
void
setSalesAmount
(
double
salesAmount
)
{
this
.
salesAmount
=
salesAmount
;
}
public
void
setTaxFree
(
byte
taxFree
)
{
this
.
taxFree
=
taxFree
;
}
public
void
setExclusive
(
byte
exclusive
)
{
this
.
exclusive
=
exclusive
;
}
public
void
setPause
(
byte
pause
)
{
this
.
pause
=
pause
;
}
public
void
setAdditionalDiscount
(
byte
additionalDiscount
)
{
this
.
additionalDiscount
=
additionalDiscount
;
}
public
void
setOnlyOnce
(
byte
onlyOnce
)
{
this
.
onlyOnce
=
onlyOnce
;
}
public
void
setMinBillAmount
(
double
minBillAmount
)
{
this
.
minBillAmount
=
minBillAmount
;
}
public
void
setPointsDeduction
(
byte
pointsDeduction
)
{
this
.
pointsDeduction
=
pointsDeduction
;
}
public
void
setWholeFreePoints
(
byte
wholeFreePoints
)
{
this
.
wholeFreePoints
=
wholeFreePoints
;
}
public
void
set
End_time
(
String
end_time
)
{
public
void
set
AmountTypeMin
(
byte
amountTypeMin
)
{
this
.
end_time
=
end_time
;
this
.
amountTypeMin
=
amountTypeMin
;
}
}
...
...
database-module/src/main/java/com/gingersoft/gsa/cloud/database/greendao/DaoMaster.java
View file @
aa04da1b
...
@@ -14,10 +14,10 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType;
...
@@ -14,10 +14,10 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
/**
* Master of DAO (schema version 2
0
): knows all DAOs.
* Master of DAO (schema version 2
1
): knows all DAOs.
*/
*/
public
class
DaoMaster
extends
AbstractDaoMaster
{
public
class
DaoMaster
extends
AbstractDaoMaster
{
public
static
final
int
SCHEMA_VERSION
=
2
0
;
public
static
final
int
SCHEMA_VERSION
=
2
1
;
/** Creates underlying database table using DAOs. */
/** Creates underlying database table using DAOs. */
public
static
void
createAllTables
(
Database
db
,
boolean
ifNotExists
)
{
public
static
void
createAllTables
(
Database
db
,
boolean
ifNotExists
)
{
...
...
database-module/src/main/java/com/gingersoft/gsa/cloud/database/greendao/DiscountDao.java
View file @
aa04da1b
...
@@ -25,15 +25,30 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
...
@@ -25,15 +25,30 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
*/
*/
public
static
class
Properties
{
public
static
class
Properties
{
public
final
static
Property
Id
=
new
Property
(
0
,
Long
.
class
,
"id"
,
true
,
"_id"
);
public
final
static
Property
Id
=
new
Property
(
0
,
Long
.
class
,
"id"
,
true
,
"_id"
);
public
final
static
Property
Restaurant
_id
=
new
Property
(
1
,
int
.
class
,
"restaurant_i
d"
,
false
,
"RESTAURANT_ID"
);
public
final
static
Property
Restaurant
Id
=
new
Property
(
1
,
int
.
class
,
"restaurantI
d"
,
false
,
"RESTAURANT_ID"
);
public
final
static
Property
Amount
=
new
Property
(
2
,
double
.
class
,
"amount"
,
false
,
"AMOUNT"
);
public
final
static
Property
Amount
=
new
Property
(
2
,
double
.
class
,
"amount"
,
false
,
"AMOUNT"
);
public
final
static
Property
Discount
_value
=
new
Property
(
3
,
double
.
class
,
"discount_v
alue"
,
false
,
"DISCOUNT_VALUE"
);
public
final
static
Property
Discount
Value
=
new
Property
(
3
,
int
.
class
,
"discountV
alue"
,
false
,
"DISCOUNT_VALUE"
);
public
final
static
Property
Type
=
new
Property
(
4
,
int
.
class
,
"type"
,
false
,
"TYPE"
);
public
final
static
Property
Type
=
new
Property
(
4
,
int
.
class
,
"type"
,
false
,
"TYPE"
);
public
final
static
Property
DiscountType
=
new
Property
(
5
,
String
.
class
,
"discountType"
,
false
,
"DISCOUNT_TYPE"
);
public
final
static
Property
DiscountType
=
new
Property
(
5
,
String
.
class
,
"discountType"
,
false
,
"DISCOUNT_TYPE"
);
public
final
static
Property
Status
=
new
Property
(
6
,
int
.
class
,
"status"
,
false
,
"STATUS"
);
public
final
static
Property
Status
=
new
Property
(
6
,
int
.
class
,
"status"
,
false
,
"STATUS"
);
public
final
static
Property
Remark
=
new
Property
(
7
,
String
.
class
,
"remark"
,
false
,
"REMARK"
);
public
final
static
Property
Remark
=
new
Property
(
7
,
String
.
class
,
"remark"
,
false
,
"REMARK"
);
public
final
static
Property
Begin_time
=
new
Property
(
8
,
String
.
class
,
"begin_time"
,
false
,
"BEGIN_TIME"
);
public
final
static
Property
FreeServiceCharge
=
new
Property
(
8
,
byte
.
class
,
"freeServiceCharge"
,
false
,
"FREE_SERVICE_CHARGE"
);
public
final
static
Property
End_time
=
new
Property
(
9
,
String
.
class
,
"end_time"
,
false
,
"END_TIME"
);
public
final
static
Property
ManagerApproval
=
new
Property
(
9
,
byte
.
class
,
"managerApproval"
,
false
,
"MANAGER_APPROVAL"
);
public
final
static
Property
Color
=
new
Property
(
10
,
String
.
class
,
"color"
,
false
,
"COLOR"
);
public
final
static
Property
PlaceOrderType
=
new
Property
(
11
,
String
.
class
,
"placeOrderType"
,
false
,
"PLACE_ORDER_TYPE"
);
public
final
static
Property
DiscountCap
=
new
Property
(
12
,
long
.
class
,
"discountCap"
,
false
,
"DISCOUNT_CAP"
);
public
final
static
Property
SalesAmount
=
new
Property
(
13
,
double
.
class
,
"salesAmount"
,
false
,
"SALES_AMOUNT"
);
public
final
static
Property
TaxFree
=
new
Property
(
14
,
byte
.
class
,
"taxFree"
,
false
,
"TAX_FREE"
);
public
final
static
Property
Exclusive
=
new
Property
(
15
,
byte
.
class
,
"exclusive"
,
false
,
"EXCLUSIVE"
);
public
final
static
Property
Pause
=
new
Property
(
16
,
byte
.
class
,
"pause"
,
false
,
"PAUSE"
);
public
final
static
Property
AdditionalDiscount
=
new
Property
(
17
,
byte
.
class
,
"additionalDiscount"
,
false
,
"ADDITIONAL_DISCOUNT"
);
public
final
static
Property
OnlyOnce
=
new
Property
(
18
,
byte
.
class
,
"onlyOnce"
,
false
,
"ONLY_ONCE"
);
public
final
static
Property
MinBillAmount
=
new
Property
(
19
,
double
.
class
,
"minBillAmount"
,
false
,
"MIN_BILL_AMOUNT"
);
public
final
static
Property
PointsDeduction
=
new
Property
(
20
,
byte
.
class
,
"pointsDeduction"
,
false
,
"POINTS_DEDUCTION"
);
public
final
static
Property
WholeFreePoints
=
new
Property
(
21
,
byte
.
class
,
"wholeFreePoints"
,
false
,
"WHOLE_FREE_POINTS"
);
public
final
static
Property
AmountTypeMin
=
new
Property
(
22
,
byte
.
class
,
"amountTypeMin"
,
false
,
"AMOUNT_TYPE_MIN"
);
public
final
static
Property
BeginTime
=
new
Property
(
23
,
String
.
class
,
"beginTime"
,
false
,
"BEGIN_TIME"
);
public
final
static
Property
EndTime
=
new
Property
(
24
,
String
.
class
,
"endTime"
,
false
,
"END_TIME"
);
}
}
...
@@ -50,15 +65,30 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
...
@@ -50,15 +65,30 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
String
constraint
=
ifNotExists
?
"IF NOT EXISTS "
:
""
;
String
constraint
=
ifNotExists
?
"IF NOT EXISTS "
:
""
;
db
.
execSQL
(
"CREATE TABLE "
+
constraint
+
"\"DISCOUNT\" ("
+
//
db
.
execSQL
(
"CREATE TABLE "
+
constraint
+
"\"DISCOUNT\" ("
+
//
"\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ,"
+
// 0: id
"\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ,"
+
// 0: id
"\"RESTAURANT_ID\" INTEGER NOT NULL ,"
+
// 1: restaurant
_i
d
"\"RESTAURANT_ID\" INTEGER NOT NULL ,"
+
// 1: restaurant
I
d
"\"AMOUNT\" REAL NOT NULL ,"
+
// 2: amount
"\"AMOUNT\" REAL NOT NULL ,"
+
// 2: amount
"\"DISCOUNT_VALUE\"
REAL NOT NULL ,"
+
// 3: discount_v
alue
"\"DISCOUNT_VALUE\"
INTEGER NOT NULL ,"
+
// 3: discountV
alue
"\"TYPE\" INTEGER NOT NULL ,"
+
// 4: type
"\"TYPE\" INTEGER NOT NULL ,"
+
// 4: type
"\"DISCOUNT_TYPE\" TEXT,"
+
// 5: discountType
"\"DISCOUNT_TYPE\" TEXT,"
+
// 5: discountType
"\"STATUS\" INTEGER NOT NULL ,"
+
// 6: status
"\"STATUS\" INTEGER NOT NULL ,"
+
// 6: status
"\"REMARK\" TEXT,"
+
// 7: remark
"\"REMARK\" TEXT,"
+
// 7: remark
"\"BEGIN_TIME\" TEXT,"
+
// 8: begin_time
"\"FREE_SERVICE_CHARGE\" INTEGER NOT NULL ,"
+
// 8: freeServiceCharge
"\"END_TIME\" TEXT);"
);
// 9: end_time
"\"MANAGER_APPROVAL\" INTEGER NOT NULL ,"
+
// 9: managerApproval
"\"COLOR\" TEXT,"
+
// 10: color
"\"PLACE_ORDER_TYPE\" TEXT,"
+
// 11: placeOrderType
"\"DISCOUNT_CAP\" INTEGER NOT NULL ,"
+
// 12: discountCap
"\"SALES_AMOUNT\" REAL NOT NULL ,"
+
// 13: salesAmount
"\"TAX_FREE\" INTEGER NOT NULL ,"
+
// 14: taxFree
"\"EXCLUSIVE\" INTEGER NOT NULL ,"
+
// 15: exclusive
"\"PAUSE\" INTEGER NOT NULL ,"
+
// 16: pause
"\"ADDITIONAL_DISCOUNT\" INTEGER NOT NULL ,"
+
// 17: additionalDiscount
"\"ONLY_ONCE\" INTEGER NOT NULL ,"
+
// 18: onlyOnce
"\"MIN_BILL_AMOUNT\" REAL NOT NULL ,"
+
// 19: minBillAmount
"\"POINTS_DEDUCTION\" INTEGER NOT NULL ,"
+
// 20: pointsDeduction
"\"WHOLE_FREE_POINTS\" INTEGER NOT NULL ,"
+
// 21: wholeFreePoints
"\"AMOUNT_TYPE_MIN\" INTEGER NOT NULL ,"
+
// 22: amountTypeMin
"\"BEGIN_TIME\" TEXT,"
+
// 23: beginTime
"\"END_TIME\" TEXT);"
);
// 24: endTime
}
}
/** Drops the underlying database table. */
/** Drops the underlying database table. */
...
@@ -75,9 +105,9 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
...
@@ -75,9 +105,9 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
if
(
id
!=
null
)
{
if
(
id
!=
null
)
{
stmt
.
bindLong
(
1
,
id
);
stmt
.
bindLong
(
1
,
id
);
}
}
stmt
.
bindLong
(
2
,
entity
.
getRestaurant
_i
d
());
stmt
.
bindLong
(
2
,
entity
.
getRestaurant
I
d
());
stmt
.
bindDouble
(
3
,
entity
.
getAmount
());
stmt
.
bindDouble
(
3
,
entity
.
getAmount
());
stmt
.
bind
Double
(
4
,
entity
.
getDiscount_v
alue
());
stmt
.
bind
Long
(
4
,
entity
.
getDiscountV
alue
());
stmt
.
bindLong
(
5
,
entity
.
getType
());
stmt
.
bindLong
(
5
,
entity
.
getType
());
String
discountType
=
entity
.
getDiscountType
();
String
discountType
=
entity
.
getDiscountType
();
...
@@ -90,15 +120,38 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
...
@@ -90,15 +120,38 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
if
(
remark
!=
null
)
{
if
(
remark
!=
null
)
{
stmt
.
bindString
(
8
,
remark
);
stmt
.
bindString
(
8
,
remark
);
}
}
stmt
.
bindLong
(
9
,
entity
.
getFreeServiceCharge
());
stmt
.
bindLong
(
10
,
entity
.
getManagerApproval
());
String
begin_time
=
entity
.
getBegin_time
();
String
color
=
entity
.
getColor
();
if
(
begin_time
!=
null
)
{
if
(
color
!=
null
)
{
stmt
.
bindString
(
9
,
begin_time
);
stmt
.
bindString
(
11
,
color
);
}
}
String
end_time
=
entity
.
getEnd_time
();
String
placeOrderType
=
entity
.
getPlaceOrderType
();
if
(
end_time
!=
null
)
{
if
(
placeOrderType
!=
null
)
{
stmt
.
bindString
(
10
,
end_time
);
stmt
.
bindString
(
12
,
placeOrderType
);
}
stmt
.
bindLong
(
13
,
entity
.
getDiscountCap
());
stmt
.
bindDouble
(
14
,
entity
.
getSalesAmount
());
stmt
.
bindLong
(
15
,
entity
.
getTaxFree
());
stmt
.
bindLong
(
16
,
entity
.
getExclusive
());
stmt
.
bindLong
(
17
,
entity
.
getPause
());
stmt
.
bindLong
(
18
,
entity
.
getAdditionalDiscount
());
stmt
.
bindLong
(
19
,
entity
.
getOnlyOnce
());
stmt
.
bindDouble
(
20
,
entity
.
getMinBillAmount
());
stmt
.
bindLong
(
21
,
entity
.
getPointsDeduction
());
stmt
.
bindLong
(
22
,
entity
.
getWholeFreePoints
());
stmt
.
bindLong
(
23
,
entity
.
getAmountTypeMin
());
String
beginTime
=
entity
.
getBeginTime
();
if
(
beginTime
!=
null
)
{
stmt
.
bindString
(
24
,
beginTime
);
}
String
endTime
=
entity
.
getEndTime
();
if
(
endTime
!=
null
)
{
stmt
.
bindString
(
25
,
endTime
);
}
}
}
}
...
@@ -110,9 +163,9 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
...
@@ -110,9 +163,9 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
if
(
id
!=
null
)
{
if
(
id
!=
null
)
{
stmt
.
bindLong
(
1
,
id
);
stmt
.
bindLong
(
1
,
id
);
}
}
stmt
.
bindLong
(
2
,
entity
.
getRestaurant
_i
d
());
stmt
.
bindLong
(
2
,
entity
.
getRestaurant
I
d
());
stmt
.
bindDouble
(
3
,
entity
.
getAmount
());
stmt
.
bindDouble
(
3
,
entity
.
getAmount
());
stmt
.
bind
Double
(
4
,
entity
.
getDiscount_v
alue
());
stmt
.
bind
Long
(
4
,
entity
.
getDiscountV
alue
());
stmt
.
bindLong
(
5
,
entity
.
getType
());
stmt
.
bindLong
(
5
,
entity
.
getType
());
String
discountType
=
entity
.
getDiscountType
();
String
discountType
=
entity
.
getDiscountType
();
...
@@ -125,15 +178,38 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
...
@@ -125,15 +178,38 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
if
(
remark
!=
null
)
{
if
(
remark
!=
null
)
{
stmt
.
bindString
(
8
,
remark
);
stmt
.
bindString
(
8
,
remark
);
}
}
stmt
.
bindLong
(
9
,
entity
.
getFreeServiceCharge
());
stmt
.
bindLong
(
10
,
entity
.
getManagerApproval
());
String
color
=
entity
.
getColor
();
if
(
color
!=
null
)
{
stmt
.
bindString
(
11
,
color
);
}
String
placeOrderType
=
entity
.
getPlaceOrderType
();
if
(
placeOrderType
!=
null
)
{
stmt
.
bindString
(
12
,
placeOrderType
);
}
stmt
.
bindLong
(
13
,
entity
.
getDiscountCap
());
stmt
.
bindDouble
(
14
,
entity
.
getSalesAmount
());
stmt
.
bindLong
(
15
,
entity
.
getTaxFree
());
stmt
.
bindLong
(
16
,
entity
.
getExclusive
());
stmt
.
bindLong
(
17
,
entity
.
getPause
());
stmt
.
bindLong
(
18
,
entity
.
getAdditionalDiscount
());
stmt
.
bindLong
(
19
,
entity
.
getOnlyOnce
());
stmt
.
bindDouble
(
20
,
entity
.
getMinBillAmount
());
stmt
.
bindLong
(
21
,
entity
.
getPointsDeduction
());
stmt
.
bindLong
(
22
,
entity
.
getWholeFreePoints
());
stmt
.
bindLong
(
23
,
entity
.
getAmountTypeMin
());
String
begin
_time
=
entity
.
getBegin_t
ime
();
String
begin
Time
=
entity
.
getBeginT
ime
();
if
(
begin
_t
ime
!=
null
)
{
if
(
begin
T
ime
!=
null
)
{
stmt
.
bindString
(
9
,
begin_t
ime
);
stmt
.
bindString
(
24
,
beginT
ime
);
}
}
String
end
_time
=
entity
.
getEnd_t
ime
();
String
end
Time
=
entity
.
getEndT
ime
();
if
(
end
_t
ime
!=
null
)
{
if
(
end
T
ime
!=
null
)
{
stmt
.
bindString
(
10
,
end_t
ime
);
stmt
.
bindString
(
25
,
endT
ime
);
}
}
}
}
...
@@ -146,15 +222,30 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
...
@@ -146,15 +222,30 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
public
Discount
readEntity
(
Cursor
cursor
,
int
offset
)
{
public
Discount
readEntity
(
Cursor
cursor
,
int
offset
)
{
Discount
entity
=
new
Discount
(
//
Discount
entity
=
new
Discount
(
//
cursor
.
isNull
(
offset
+
0
)
?
null
:
cursor
.
getLong
(
offset
+
0
),
// id
cursor
.
isNull
(
offset
+
0
)
?
null
:
cursor
.
getLong
(
offset
+
0
),
// id
cursor
.
getInt
(
offset
+
1
),
// restaurant
_i
d
cursor
.
getInt
(
offset
+
1
),
// restaurant
I
d
cursor
.
getDouble
(
offset
+
2
),
// amount
cursor
.
getDouble
(
offset
+
2
),
// amount
cursor
.
get
Double
(
offset
+
3
),
// discount_v
alue
cursor
.
get
Int
(
offset
+
3
),
// discountV
alue
cursor
.
getInt
(
offset
+
4
),
// type
cursor
.
getInt
(
offset
+
4
),
// type
cursor
.
isNull
(
offset
+
5
)
?
null
:
cursor
.
getString
(
offset
+
5
),
// discountType
cursor
.
isNull
(
offset
+
5
)
?
null
:
cursor
.
getString
(
offset
+
5
),
// discountType
cursor
.
getInt
(
offset
+
6
),
// status
cursor
.
getInt
(
offset
+
6
),
// status
cursor
.
isNull
(
offset
+
7
)
?
null
:
cursor
.
getString
(
offset
+
7
),
// remark
cursor
.
isNull
(
offset
+
7
)
?
null
:
cursor
.
getString
(
offset
+
7
),
// remark
cursor
.
isNull
(
offset
+
8
)
?
null
:
cursor
.
getString
(
offset
+
8
),
// begin_time
(
byte
)
cursor
.
getShort
(
offset
+
8
),
// freeServiceCharge
cursor
.
isNull
(
offset
+
9
)
?
null
:
cursor
.
getString
(
offset
+
9
)
// end_time
(
byte
)
cursor
.
getShort
(
offset
+
9
),
// managerApproval
cursor
.
isNull
(
offset
+
10
)
?
null
:
cursor
.
getString
(
offset
+
10
),
// color
cursor
.
isNull
(
offset
+
11
)
?
null
:
cursor
.
getString
(
offset
+
11
),
// placeOrderType
cursor
.
getLong
(
offset
+
12
),
// discountCap
cursor
.
getDouble
(
offset
+
13
),
// salesAmount
(
byte
)
cursor
.
getShort
(
offset
+
14
),
// taxFree
(
byte
)
cursor
.
getShort
(
offset
+
15
),
// exclusive
(
byte
)
cursor
.
getShort
(
offset
+
16
),
// pause
(
byte
)
cursor
.
getShort
(
offset
+
17
),
// additionalDiscount
(
byte
)
cursor
.
getShort
(
offset
+
18
),
// onlyOnce
cursor
.
getDouble
(
offset
+
19
),
// minBillAmount
(
byte
)
cursor
.
getShort
(
offset
+
20
),
// pointsDeduction
(
byte
)
cursor
.
getShort
(
offset
+
21
),
// wholeFreePoints
(
byte
)
cursor
.
getShort
(
offset
+
22
),
// amountTypeMin
cursor
.
isNull
(
offset
+
23
)
?
null
:
cursor
.
getString
(
offset
+
23
),
// beginTime
cursor
.
isNull
(
offset
+
24
)
?
null
:
cursor
.
getString
(
offset
+
24
)
// endTime
);
);
return
entity
;
return
entity
;
}
}
...
@@ -162,15 +253,30 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
...
@@ -162,15 +253,30 @@ public class DiscountDao extends AbstractDao<Discount, Long> {
@Override
@Override
public
void
readEntity
(
Cursor
cursor
,
Discount
entity
,
int
offset
)
{
public
void
readEntity
(
Cursor
cursor
,
Discount
entity
,
int
offset
)
{
entity
.
setId
(
cursor
.
isNull
(
offset
+
0
)
?
null
:
cursor
.
getLong
(
offset
+
0
));
entity
.
setId
(
cursor
.
isNull
(
offset
+
0
)
?
null
:
cursor
.
getLong
(
offset
+
0
));
entity
.
setRestaurant
_i
d
(
cursor
.
getInt
(
offset
+
1
));
entity
.
setRestaurant
I
d
(
cursor
.
getInt
(
offset
+
1
));
entity
.
setAmount
(
cursor
.
getDouble
(
offset
+
2
));
entity
.
setAmount
(
cursor
.
getDouble
(
offset
+
2
));
entity
.
setDiscount
_value
(
cursor
.
getDouble
(
offset
+
3
));
entity
.
setDiscount
Value
(
cursor
.
getInt
(
offset
+
3
));
entity
.
setType
(
cursor
.
getInt
(
offset
+
4
));
entity
.
setType
(
cursor
.
getInt
(
offset
+
4
));
entity
.
setDiscountType
(
cursor
.
isNull
(
offset
+
5
)
?
null
:
cursor
.
getString
(
offset
+
5
));
entity
.
setDiscountType
(
cursor
.
isNull
(
offset
+
5
)
?
null
:
cursor
.
getString
(
offset
+
5
));
entity
.
setStatus
(
cursor
.
getInt
(
offset
+
6
));
entity
.
setStatus
(
cursor
.
getInt
(
offset
+
6
));
entity
.
setRemark
(
cursor
.
isNull
(
offset
+
7
)
?
null
:
cursor
.
getString
(
offset
+
7
));
entity
.
setRemark
(
cursor
.
isNull
(
offset
+
7
)
?
null
:
cursor
.
getString
(
offset
+
7
));
entity
.
setBegin_time
(
cursor
.
isNull
(
offset
+
8
)
?
null
:
cursor
.
getString
(
offset
+
8
));
entity
.
setFreeServiceCharge
((
byte
)
cursor
.
getShort
(
offset
+
8
));
entity
.
setEnd_time
(
cursor
.
isNull
(
offset
+
9
)
?
null
:
cursor
.
getString
(
offset
+
9
));
entity
.
setManagerApproval
((
byte
)
cursor
.
getShort
(
offset
+
9
));
entity
.
setColor
(
cursor
.
isNull
(
offset
+
10
)
?
null
:
cursor
.
getString
(
offset
+
10
));
entity
.
setPlaceOrderType
(
cursor
.
isNull
(
offset
+
11
)
?
null
:
cursor
.
getString
(
offset
+
11
));
entity
.
setDiscountCap
(
cursor
.
getLong
(
offset
+
12
));
entity
.
setSalesAmount
(
cursor
.
getDouble
(
offset
+
13
));
entity
.
setTaxFree
((
byte
)
cursor
.
getShort
(
offset
+
14
));
entity
.
setExclusive
((
byte
)
cursor
.
getShort
(
offset
+
15
));
entity
.
setPause
((
byte
)
cursor
.
getShort
(
offset
+
16
));
entity
.
setAdditionalDiscount
((
byte
)
cursor
.
getShort
(
offset
+
17
));
entity
.
setOnlyOnce
((
byte
)
cursor
.
getShort
(
offset
+
18
));
entity
.
setMinBillAmount
(
cursor
.
getDouble
(
offset
+
19
));
entity
.
setPointsDeduction
((
byte
)
cursor
.
getShort
(
offset
+
20
));
entity
.
setWholeFreePoints
((
byte
)
cursor
.
getShort
(
offset
+
21
));
entity
.
setAmountTypeMin
((
byte
)
cursor
.
getShort
(
offset
+
22
));
entity
.
setBeginTime
(
cursor
.
isNull
(
offset
+
23
)
?
null
:
cursor
.
getString
(
offset
+
23
));
entity
.
setEndTime
(
cursor
.
isNull
(
offset
+
24
)
?
null
:
cursor
.
getString
(
offset
+
24
));
}
}
@Override
@Override
...
...
order-base/src/main/java/com/gingersoft/gsa/cloud/base/order/bean/OrderBean.java
View file @
aa04da1b
...
@@ -42,8 +42,8 @@ public class OrderBean {
...
@@ -42,8 +42,8 @@ public class OrderBean {
public
OrderBean
(
OrderBean
orderBean
)
{
public
OrderBean
(
OrderBean
orderBean
)
{
this
.
id
=
orderBean
.
id
;
this
.
id
=
orderBean
.
id
;
this
.
status
=
orderBean
.
status
;
this
.
orderNo
=
orderBean
.
orderNo
;
this
.
orderNo
=
orderBean
.
orderNo
;
this
.
status
=
orderBean
.
status
;
this
.
person
=
orderBean
.
person
;
this
.
person
=
orderBean
.
person
;
this
.
memberInfo
=
orderBean
.
memberInfo
;
this
.
memberInfo
=
orderBean
.
memberInfo
;
this
.
discountDetails
=
orderBean
.
discountDetails
;
this
.
discountDetails
=
orderBean
.
discountDetails
;
...
@@ -452,7 +452,7 @@ public class OrderBean {
...
@@ -452,7 +452,7 @@ public class OrderBean {
public
static
class
RestaurantDiscountVO
implements
Serializable
{
public
static
class
RestaurantDiscountVO
implements
Serializable
{
private
long
id
;
private
long
id
;
private
int
type
;
private
int
type
;
private
floa
t
discountValue
;
private
in
t
discountValue
;
private
String
remark
;
private
String
remark
;
private
double
discountAmount
;
private
double
discountAmount
;
...
@@ -472,11 +472,11 @@ public class OrderBean {
...
@@ -472,11 +472,11 @@ public class OrderBean {
this
.
type
=
type
;
this
.
type
=
type
;
}
}
public
floa
t
getDiscountValue
()
{
public
in
t
getDiscountValue
()
{
return
discountValue
;
return
discountValue
;
}
}
public
void
setDiscountValue
(
floa
t
discountValue
)
{
public
void
setDiscountValue
(
in
t
discountValue
)
{
this
.
discountValue
=
discountValue
;
this
.
discountValue
=
discountValue
;
}
}
...
...
order-base/src/main/java/com/gingersoft/gsa/cloud/base/order/bean/discount/OrderDiscount.java
View file @
aa04da1b
...
@@ -256,12 +256,12 @@ public class OrderDiscount {
...
@@ -256,12 +256,12 @@ public class OrderDiscount {
*/
*/
public
static
double
calculationDiscount
(
Discount
discount
,
double
sourcePrice
)
{
public
static
double
calculationDiscount
(
Discount
discount
,
double
sourcePrice
)
{
double
discountPrice
;
double
discountPrice
;
if
(
discount
.
getType
()
==
0
)
{
if
(
discount
.
getType
()
==
Discount
.
DISCOUNT_TYPE_AMOUNT
)
{
//金額折扣
//金額折扣
discountPrice
=
discount
.
getAmount
();
discountPrice
=
discount
.
getAmount
();
}
else
{
}
else
{
//百分比折扣
//百分比折扣
discountPrice
=
MoneyUtil
.
divide
(
MoneyUtil
.
multiply
(
sourcePrice
,
discount
.
getDiscount
_v
alue
()),
100
).
doubleValue
();
discountPrice
=
MoneyUtil
.
divide
(
MoneyUtil
.
multiply
(
sourcePrice
,
discount
.
getDiscount
V
alue
()),
100
).
doubleValue
();
}
}
if
(
sourcePrice
<
discountPrice
)
{
if
(
sourcePrice
<
discountPrice
)
{
//折扣金額不能超出總額
//折扣金額不能超出總額
...
...
order-base/src/main/java/com/gingersoft/gsa/cloud/base/order/billItem/DiscountItem.java
View file @
aa04da1b
...
@@ -22,8 +22,6 @@ public class DiscountItem extends BillItem {
...
@@ -22,8 +22,6 @@ public class DiscountItem extends BillItem {
super
(
name
,
money
,
status
,
type
);
super
(
name
,
money
,
status
,
type
);
}
}
public
void
updateBillItem
(
int
type
)
{
public
void
updateBillItem
(
int
type
)
{
}
}
...
...
order-base/src/main/java/com/gingersoft/gsa/cloud/base/order/cart/ShoppingCart.java
View file @
aa04da1b
...
@@ -18,6 +18,7 @@ import com.jess.arms.utils.Preconditions;
...
@@ -18,6 +18,7 @@ import com.jess.arms.utils.Preconditions;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.concurrent.CopyOnWriteArrayList
;
import
lombok.Getter
;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.Setter
;
...
@@ -48,6 +49,7 @@ public class ShoppingCart {
...
@@ -48,6 +49,7 @@ public class ShoppingCart {
protected
List
<
OrderDetail
>
orderCommodityList
=
new
ArrayList
<>();
protected
List
<
OrderDetail
>
orderCommodityList
=
new
ArrayList
<>();
/**
/**
* 賬單項列表
* 賬單項列表
* @see CopyOnWriteArrayList 賬單計算放在子線程中保證同步問題使用CopyOnWriteArrayList
*/
*/
protected
List
<
BillItem
>
billItemList
=
new
ArrayList
<>();
protected
List
<
BillItem
>
billItemList
=
new
ArrayList
<>();
/**
/**
...
@@ -81,8 +83,8 @@ public class ShoppingCart {
...
@@ -81,8 +83,8 @@ public class ShoppingCart {
private
ShoppingCartNumberChange
cartNumberChange
=
new
ShoppingCartNumberChange
(
orderCommodityList
);
private
ShoppingCartNumberChange
cartNumberChange
=
new
ShoppingCartNumberChange
(
orderCommodityList
);
public
void
changeNumber
(
int
number
,
OrderDetail
orderFood
,
OrderDetail
orderMainFood
,
int
select_Full_start_position
,
int
select_Full_end_position
,
ShoppingCartNumberChange
.
OnNumberChangeListener
listener
)
{
public
void
changeNumber
(
int
number
,
OrderDetail
orderFood
,
OrderDetail
orderMainFood
,
int
select_Full_start_position
,
int
select_Full_end_position
,
ShoppingCartNumberChange
.
OnNumberChangeListener
listener
)
{
cartNumberChange
.
changeNumber
(
number
,
orderFood
,
orderMainFood
,
select_Full_start_position
,
select_Full_end_position
,
listener
);
cartNumberChange
.
changeNumber
(
number
,
orderFood
,
orderMainFood
,
select_Full_start_position
,
select_Full_end_position
,
listener
);
}
}
/**
/**
...
@@ -250,7 +252,8 @@ public class ShoppingCart {
...
@@ -250,7 +252,8 @@ public class ShoppingCart {
private
void
updateDiscountBillItem
(
List
<
MultyDiscount
>
multyDiscountArrays
)
{
private
void
updateDiscountBillItem
(
List
<
MultyDiscount
>
multyDiscountArrays
)
{
byte
discountType
=
BillItem
.
NOMAL_DISCOUNT_TYPE
;
byte
discountType
=
BillItem
.
NOMAL_DISCOUNT_TYPE
;
for
(
MultyDiscount
discount
:
multyDiscountArrays
)
{
for
(
int
i
=
multyDiscountArrays
.
size
()
-
1
;
i
>=
0
;
i
--)
{
MultyDiscount
discount
=
multyDiscountArrays
.
get
(
i
);
if
(
discount
instanceof
NomalDiscount
)
{
if
(
discount
instanceof
NomalDiscount
)
{
discountType
=
BillItem
.
NOMAL_DISCOUNT_TYPE
;
discountType
=
BillItem
.
NOMAL_DISCOUNT_TYPE
;
}
else
if
(
discount
instanceof
MemberDiscount
)
{
}
else
if
(
discount
instanceof
MemberDiscount
)
{
...
@@ -279,7 +282,7 @@ public class ShoppingCart {
...
@@ -279,7 +282,7 @@ public class ShoppingCart {
Discount
discount
=
new
Discount
();
Discount
discount
=
new
Discount
();
discount
.
setRemark
(
"9折"
);
discount
.
setRemark
(
"9折"
);
discount
.
setType
(
1
);
discount
.
setType
(
1
);
discount
.
setDiscount
_v
alue
(
10
);
discount
.
setDiscount
V
alue
(
10
);
multyDiscounts
=
shoppingCart
.
addNomalDiscountToLinked
(
multyDiscounts
,
discount
,
0
);
multyDiscounts
=
shoppingCart
.
addNomalDiscountToLinked
(
multyDiscounts
,
discount
,
0
);
shoppingCart
.
addMultyDiscount
(
multyDiscounts
);
shoppingCart
.
addMultyDiscount
(
multyDiscounts
);
...
...
order-base/src/main/java/com/gingersoft/gsa/cloud/base/order/commodity/MealCommodity.java
View file @
aa04da1b
...
@@ -367,7 +367,7 @@ public class MealCommodity implements Commodity {
...
@@ -367,7 +367,7 @@ public class MealCommodity implements Commodity {
private
static
Discount
getDiscountItem
(
OrderBean
.
OrderDetailsBean
.
RestaurantDiscountVO
discountBean
)
{
private
static
Discount
getDiscountItem
(
OrderBean
.
OrderDetailsBean
.
RestaurantDiscountVO
discountBean
)
{
Discount
discount
=
new
Discount
();
Discount
discount
=
new
Discount
();
discount
.
setId
(
discountBean
.
getId
());
discount
.
setId
(
discountBean
.
getId
());
discount
.
setDiscount
_v
alue
(
discountBean
.
getDiscountValue
());
discount
.
setDiscount
V
alue
(
discountBean
.
getDiscountValue
());
discount
.
setAmount
(
discountBean
.
getDiscountAmount
());
discount
.
setAmount
(
discountBean
.
getDiscountAmount
());
discount
.
setType
(
discountBean
.
getType
());
discount
.
setType
(
discountBean
.
getType
());
discount
.
setRemark
(
discountBean
.
getRemark
());
discount
.
setRemark
(
discountBean
.
getRemark
());
...
...
order-base/src/main/java/com/gingersoft/gsa/cloud/base/order/commodity/OrderDetail.java
View file @
aa04da1b
...
@@ -2,6 +2,7 @@ package com.gingersoft.gsa.cloud.base.order.commodity;
...
@@ -2,6 +2,7 @@ package com.gingersoft.gsa.cloud.base.order.commodity;
import
com.gingersoft.gsa.cloud.base.order.bean.OrderBean
;
import
com.gingersoft.gsa.cloud.base.order.bean.OrderBean
;
import
com.gingersoft.gsa.cloud.base.order.bean.discount.OrderDiscount
;
import
com.gingersoft.gsa.cloud.base.order.bean.discount.OrderDiscount
;
import
com.gingersoft.gsa.cloud.base.order.discount.NomalDiscount
;
import
com.gingersoft.gsa.cloud.base.order.order.DoshokuOrder
;
import
com.gingersoft.gsa.cloud.base.order.order.DoshokuOrder
;
import
com.gingersoft.gsa.cloud.base.utils.MoneyUtil
;
import
com.gingersoft.gsa.cloud.base.utils.MoneyUtil
;
import
com.gingersoft.gsa.cloud.database.bean.ComboItem
;
import
com.gingersoft.gsa.cloud.database.bean.ComboItem
;
...
@@ -1073,7 +1074,7 @@ public class OrderDetail implements Commodity, Serializable {
...
@@ -1073,7 +1074,7 @@ public class OrderDetail implements Commodity, Serializable {
private
static
Discount
getDiscountItem
(
OrderBean
.
OrderDetailsBean
.
RestaurantDiscountVO
discountBean
)
{
private
static
Discount
getDiscountItem
(
OrderBean
.
OrderDetailsBean
.
RestaurantDiscountVO
discountBean
)
{
Discount
discount
=
new
Discount
();
Discount
discount
=
new
Discount
();
discount
.
setId
(
discountBean
.
getId
());
discount
.
setId
(
discountBean
.
getId
());
discount
.
setDiscount
_v
alue
(
discountBean
.
getDiscountValue
());
discount
.
setDiscount
V
alue
(
discountBean
.
getDiscountValue
());
discount
.
setAmount
(
discountBean
.
getDiscountAmount
());
discount
.
setAmount
(
discountBean
.
getDiscountAmount
());
discount
.
setType
(
discountBean
.
getType
());
discount
.
setType
(
discountBean
.
getType
());
discount
.
setRemark
(
discountBean
.
getRemark
());
discount
.
setRemark
(
discountBean
.
getRemark
());
...
@@ -1238,7 +1239,7 @@ public class OrderDetail implements Commodity, Serializable {
...
@@ -1238,7 +1239,7 @@ public class OrderDetail implements Commodity, Serializable {
*/
*/
public
static
OrderDetail
discountTransOrderDetail
(
Discount
discount
,
boolean
isNew
,
long
id
,
double
sourcePrice
)
{
public
static
OrderDetail
discountTransOrderDetail
(
Discount
discount
,
boolean
isNew
,
long
id
,
double
sourcePrice
)
{
double
discountPrice
=
Order
Discount
.
calculationDiscount
(
discount
,
sourcePrice
);
double
discountPrice
=
Nomal
Discount
.
calculationDiscount
(
discount
,
sourcePrice
);
OrderDetail
orderDetail
=
new
OrderDetail
();
OrderDetail
orderDetail
=
new
OrderDetail
();
orderDetail
.
setProductName
(
discount
.
getRemark
());
orderDetail
.
setProductName
(
discount
.
getRemark
());
...
...
order-base/src/main/java/com/gingersoft/gsa/cloud/base/order/discount/NomalDiscount.java
View file @
aa04da1b
...
@@ -13,20 +13,20 @@ import lombok.Getter;
...
@@ -13,20 +13,20 @@ import lombok.Getter;
* 描述: 整單折扣{@link Discount}
* 描述: 整單折扣{@link Discount}
*/
*/
@Getter
@Getter
public
class
NomalDiscount
extends
MultyDiscount
{
public
class
NomalDiscount
extends
MultyDiscount
{
private
Discount
discount
;
private
Discount
discount
;
public
NomalDiscount
(
String
name
,
int
status
,
MultyDiscount
nextMultyDiscount
,
Discount
discount
)
{
public
NomalDiscount
(
String
name
,
int
status
,
MultyDiscount
nextMultyDiscount
,
Discount
discount
)
{
super
(
name
,
status
,
nextMultyDiscount
);
super
(
name
,
status
,
nextMultyDiscount
);
this
.
discount
=
discount
;
this
.
discount
=
discount
;
}
}
@Override
@Override
public
double
calculate
(
double
money
)
{
public
double
calculate
(
double
money
)
{
if
(
discount
!=
null
)
{
if
(
discount
!=
null
)
{
discountMoney
=
calculationDiscount
(
discount
,
money
);
discountMoney
=
calculationDiscount
(
discount
,
money
);
money
=
MoneyUtil
.
sum
(
money
,
discountMoney
);
money
=
MoneyUtil
.
sum
(
money
,
discountMoney
);
}
}
return
super
.
calculate
(
money
);
return
super
.
calculate
(
money
);
}
}
...
@@ -40,12 +40,16 @@ public class NomalDiscount extends MultyDiscount{
...
@@ -40,12 +40,16 @@ public class NomalDiscount extends MultyDiscount{
*/
*/
public
static
double
calculationDiscount
(
Discount
discount
,
double
sourceMoney
)
{
public
static
double
calculationDiscount
(
Discount
discount
,
double
sourceMoney
)
{
double
discountMoney
;
double
discountMoney
;
if
(
discount
.
getType
()
==
0
)
{
if
(
discount
.
getType
()
==
Discount
.
DISCOUNT_TYPE_RATE
)
{
//百分比折扣
discountMoney
=
MoneyUtil
.
divide
(
MoneyUtil
.
multiply
(
sourceMoney
,
discount
.
getDiscountValue
()),
100
).
doubleValue
();
}
else
{
//金額折扣
//金額折扣
discountMoney
=
discount
.
getAmount
();
discountMoney
=
discount
.
getAmount
();
}
else
{
}
//百分比折扣
if
(
Double
.
doubleToLongBits
(
discount
.
getDiscountCap
())
!=
0
&&
discount
.
getDiscountCap
()
<
discountMoney
)
{
discountMoney
=
MoneyUtil
.
divide
(
MoneyUtil
.
multiply
(
sourceMoney
,
discount
.
getDiscount_value
()),
100
).
doubleValue
();
//不能大於折扣上限
discountMoney
=
discount
.
getDiscountCap
();
}
}
if
(
sourceMoney
<
discountMoney
)
{
if
(
sourceMoney
<
discountMoney
)
{
//折扣金額不能超出總額
//折扣金額不能超出總額
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/discount/DiscountAction.java
0 → 100644
View file @
aa04da1b
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
discount
;
import
com.gingersoft.gsa.cloud.base.order.discount.MultyDiscount
;
import
com.gingersoft.gsa.cloud.database.bean.Discount
;
import
com.gingersoft.gsa.cloud.patterns.Strategy
;
/**
* @author : bin
* @create date: 2020-10-27
* @update date: 2020-10-27
* @description:
*/
public
interface
DiscountAction
{
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/discount/NomalDiscountAction.java
0 → 100644
View file @
aa04da1b
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
discount
;
import
android.app.Activity
;
import
android.content.Context
;
import
android.text.InputType
;
import
com.gingersoft.gsa.cloud.base.order.discount.MultyDiscount
;
import
com.gingersoft.gsa.cloud.base.order.discount.NomalDiscount
;
import
com.gingersoft.gsa.cloud.database.bean.Discount
;
import
com.gingersoft.gsa.cloud.patterns.Strategy
;
import
com.gingersoft.gsa.cloud.table.mvp.model.table.action.TableAction
;
import
com.gingersoft.gsa.cloud.ui.view.AddKeyBoard
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.CommonTipDialog
;
import
java.util.List
;
/**
* @author : bin
* @create date: 2020-10-27
* @update date: 2020-10-27
* @description:
*/
public
class
NomalDiscountAction
implements
Strategy
<
Discount
>
{
public
Context
mContext
;
private
List
<
NomalDiscount
>
mNomalDiscountList
;
public
NomalDiscountAction
(
Context
context
,
List
<
NomalDiscount
>
nomalDiscountList
)
{
this
.
mContext
=
context
;
this
.
mNomalDiscountList
=
nomalDiscountList
;
}
@Override
public
void
action
(
Discount
discount
)
{
for
(
NomalDiscount
nomalDiscount
:
mNomalDiscountList
)
{
Discount
item
=
nomalDiscount
.
getDiscount
();
if
()
{
}
}
if
(
discount
.
getOnlyOnce
()
==
1
)
{
//此折扣只一次
return
;
}
if
(
discount
.
getExclusive
()
==
1
)
{
//獨佔折扣
}
switch
(
discount
.
getType
())
{
case
Discount
.
DISCOUNT_TYPE_AMOUNT
:
case
Discount
.
DISCOUNT_TYPE_RATE
:
break
;
case
Discount
.
DISCOUNT_TYPE_CUSTOM_AMOUNT
:
showCustomAmountDialog
(
discount
);
break
;
case
Discount
.
DISCOUNT_TYPE_KEYBOARD
:
showKeyboardDialog
(
discount
);
break
;
case
Discount
.
DISCOUNT_TYPE_FREE_SERVICE_CHARGE
:
break
;
default
:
break
;
}
}
private
void
showCustomAmountDialog
(
Discount
discount
)
{
CommonTipDialog
.
showEditDialog
((
Activity
)
mContext
,
discount
.
getRemark
(),
"請輸入折扣金額"
,
InputType
.
TYPE_CLASS_NUMBER
|
InputType
.
TYPE_NUMBER_FLAG_DECIMAL
,
new
CommonTipDialog
.
OnEditTextListener
()
{
@Override
public
void
inputText
(
String
text
)
{
}
});
}
private
void
showKeyboardDialog
(
Discount
discount
)
{
}
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/table/action/TableAction.java
View file @
aa04da1b
...
@@ -20,8 +20,8 @@ public abstract class TableAction implements Strategy<TableBean.DataBean> {
...
@@ -20,8 +20,8 @@ public abstract class TableAction implements Strategy<TableBean.DataBean> {
protected
String
actionHint
;
protected
String
actionHint
;
protected
String
actionContent
;
protected
String
actionContent
;
public
TableAction
(
Context
mC
ontext
)
{
public
TableAction
(
Context
c
ontext
)
{
this
.
mContext
=
mC
ontext
;
this
.
mContext
=
c
ontext
;
}
}
public
TableAction
(
Context
context
,
String
actionTitle
,
String
actionHint
,
String
actionContent
)
{
public
TableAction
(
Context
context
,
String
actionTitle
,
String
actionHint
,
String
actionContent
)
{
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/BaseOrderPresenter.java
View file @
aa04da1b
...
@@ -20,6 +20,7 @@ import com.gingersoft.gsa.cloud.base.order.billItem.RoundingItem;
...
@@ -20,6 +20,7 @@ import com.gingersoft.gsa.cloud.base.order.billItem.RoundingItem;
import
com.gingersoft.gsa.cloud.base.order.billItem.ServiceChargeItem
;
import
com.gingersoft.gsa.cloud.base.order.billItem.ServiceChargeItem
;
import
com.gingersoft.gsa.cloud.base.order.cart.ShoppingCart
;
import
com.gingersoft.gsa.cloud.base.order.cart.ShoppingCart
;
import
com.gingersoft.gsa.cloud.base.order.commodity.MealCommodity
;
import
com.gingersoft.gsa.cloud.base.order.commodity.MealCommodity
;
import
com.gingersoft.gsa.cloud.base.order.discount.MultyDiscount
;
import
com.gingersoft.gsa.cloud.base.order.discount.NomalDiscount
;
import
com.gingersoft.gsa.cloud.base.order.discount.NomalDiscount
;
import
com.gingersoft.gsa.cloud.base.order.order.BaseOrder
;
import
com.gingersoft.gsa.cloud.base.order.order.BaseOrder
;
import
com.gingersoft.gsa.cloud.base.order.order.DoshokuOrder
;
import
com.gingersoft.gsa.cloud.base.order.order.DoshokuOrder
;
...
@@ -54,6 +55,7 @@ import java.util.ArrayList;
...
@@ -54,6 +55,7 @@ import java.util.ArrayList;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.concurrent.CopyOnWriteArrayList
;
import
java.util.logging.Handler
;
import
java.util.logging.Handler
;
import
javax.inject.Inject
;
import
javax.inject.Inject
;
...
@@ -92,9 +94,10 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -92,9 +94,10 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
protected
M
mModel
;
protected
M
mModel
;
protected
V
mRootView
;
protected
V
mRootView
;
protected
BaseOrderPresenter
mBaseOrderPresenter
;
private
Activity
IActivity
;
private
Activity
IActivity
;
private
MealStandActivity
mMealStandActivity
;
private
OrderContentActivity
mOrderContentActivity
;
private
OrderContentActivity
mOrderContentActivity
;
protected
BaseOrderPresenter
mBaseOrderPresenter
;
private
MealStandPresenter
mMealStandPresenter
;
private
MealStandPresenter
mMealStandPresenter
;
/**
/**
...
@@ -138,11 +141,6 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -138,11 +141,6 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
*/
*/
private
OrderBean
orderPlaced
;
private
OrderBean
orderPlaced
;
protected
OrderDetail
mCurrentOrderDetailBean
;
//選中操作的食品下標
protected
int
orderSelectPosition
=
-
1
;
//币種
//币種
protected
String
cashStr
=
"$"
;
protected
String
cashStr
=
"$"
;
protected
String
serviceChargeStr
=
"服務費"
;
protected
String
serviceChargeStr
=
"服務費"
;
...
@@ -152,9 +150,9 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -152,9 +150,9 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
private
Disposable
disposable
;
private
Disposable
disposable
;
public
abstract
void
createOrder
(
boolean
isPrint
,
Class
afterToActivity
);
public
abstract
void
createOrder
(
boolean
isPrint
,
Class
<?>
afterToActivity
);
public
abstract
void
addOrderFood
(
boolean
isPrint
,
Class
afterToActivity
);
public
abstract
void
addOrderFood
(
boolean
isPrint
,
Class
<?>
afterToActivity
);
void
saveCreateTime
(
long
createTime
)
{
void
saveCreateTime
(
long
createTime
)
{
if
(
mDoshokuOrder
==
null
)
{
if
(
mDoshokuOrder
==
null
)
{
...
@@ -171,7 +169,9 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -171,7 +169,9 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
this
.
mBaseOrderPresenter
=
this
;
this
.
mBaseOrderPresenter
=
this
;
this
.
IActivity
=
(
Activity
)
mRootView
;
this
.
IActivity
=
(
Activity
)
mRootView
;
if
(
IActivity
instanceof
OrderContentActivity
)
{
if
(
IActivity
instanceof
MealStandActivity
)
{
mMealStandActivity
=
(
MealStandActivity
)
IActivity
;
}
else
if
(
IActivity
instanceof
OrderContentActivity
)
{
mOrderContentActivity
=
(
OrderContentActivity
)
IActivity
;
mOrderContentActivity
=
(
OrderContentActivity
)
IActivity
;
}
}
if
(
this
instanceof
MealStandPresenter
)
{
if
(
this
instanceof
MealStandPresenter
)
{
...
@@ -233,18 +233,20 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -233,18 +233,20 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
disposable
=
Observable
.
just
(
wholeAmount
)
disposable
=
Observable
.
just
(
wholeAmount
)
.
subscribeOn
(
Schedulers
.
computation
())
.
subscribeOn
(
Schedulers
.
computation
())
/**
/**
* 計算服務費
* 計算服務費
(堂食)
*/
*/
.
map
(
new
Function
<
Double
,
Double
>()
{
.
map
(
new
Function
<
Double
,
Double
>()
{
@Override
@Override
public
Double
apply
(
Double
totalAmount
)
throws
Exception
{
public
Double
apply
(
Double
totalAmount
)
throws
Exception
{
int
serviceCharge
=
mDoshokuOrder
.
getOpenTableInfo
().
getServiceCharge
();
if
(
mDoshokuOrder
!=
null
)
{
if
(
serviceCharge
>
0
)
{
int
serviceCharge
=
mDoshokuOrder
.
getOpenTableInfo
().
getServiceCharge
();
ServiceChargeItem
item
=
new
ServiceChargeItem
(
serviceChargeStr
);
if
(
serviceCharge
>
0
)
{
totalAmount
=
item
.
updateBillItem
(
totalAmount
,
serviceCharge
);
ServiceChargeItem
item
=
new
ServiceChargeItem
(
serviceChargeStr
);
if
(
Double
.
doubleToLongBits
(
item
.
getMoney
())
!=
0.0
)
{
totalAmount
=
item
.
updateBillItem
(
totalAmount
,
serviceCharge
);
mBillItemList
.
add
(
item
);
if
(
Double
.
doubleToLongBits
(
item
.
getMoney
())
!=
0.0
)
{
mShoppingCart
.
setServiceCharge
(
item
.
getMoney
());
mBillItemList
.
add
(
item
);
mShoppingCart
.
setServiceCharge
(
item
.
getMoney
());
}
}
}
}
}
return
totalAmount
;
return
totalAmount
;
...
@@ -256,7 +258,12 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -256,7 +258,12 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
.
map
(
new
Function
<
Double
,
Double
>()
{
.
map
(
new
Function
<
Double
,
Double
>()
{
@Override
@Override
public
Double
apply
(
Double
totalAmount
)
throws
Exception
{
public
Double
apply
(
Double
totalAmount
)
throws
Exception
{
if
(
mMealStandPresenter
!=
null
&&
orderPlaced
!=
null
)
{
if
(
mMealStandActivity
!=
null
&&
orderPlaced
!=
null
&&
mMealStandActivity
.
isInitSentOrderDiscount
()
==
false
)
{
mMealStandActivity
.
setInitSentOrderDiscount
(
true
);
//添加已送單折扣
//添加已送單折扣
List
<
OrderDiscount
.
Respose
>
orderDiscounts
=
orderPlaced
.
getDiscountDetails
();
List
<
OrderDiscount
.
Respose
>
orderDiscounts
=
orderPlaced
.
getDiscountDetails
();
if
(
orderDiscounts
!=
null
)
{
if
(
orderDiscounts
!=
null
)
{
...
@@ -269,7 +276,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -269,7 +276,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
if
(
orderDiscount
.
getDiscountValue
()
!=
0
)
{
if
(
orderDiscount
.
getDiscountValue
()
!=
0
)
{
//百分比折扣
//百分比折扣
discount
.
setType
(
1
);
discount
.
setType
(
1
);
discount
.
setDiscount
_v
alue
(
orderDiscount
.
getDiscountValue
());
discount
.
setDiscount
V
alue
(
orderDiscount
.
getDiscountValue
());
}
}
if
(
orderDiscount
.
getDiscountAmount
()
!=
0
)
{
if
(
orderDiscount
.
getDiscountAmount
()
!=
0
)
{
//金額折扣
//金額折扣
...
@@ -373,8 +380,6 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -373,8 +380,6 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
@Override
@Override
public
void
onItemClick
(
OrderDetail
datasBean
,
int
position
)
{
public
void
onItemClick
(
OrderDetail
datasBean
,
int
position
)
{
mRootView
.
recordOperat
(
true
);
mRootView
.
recordOperat
(
true
);
orderSelectPosition
=
position
;
mSelectMealAdapter
.
setMyOrderManageSelectPosition
();
}
}
@Override
@Override
...
@@ -382,20 +387,17 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -382,20 +387,17 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
mRootView
.
recordOperat
(
true
);
mRootView
.
recordOperat
(
true
);
if
(
datasBean
.
getNumber
()
==
1
)
{
if
(
datasBean
.
getNumber
()
==
1
)
{
mSelectMealAdapter
.
removeFoodItem
();
mSelectMealAdapter
.
removeFoodItem
();
mSelectMealAdapter
.
notifyDataSetChanged
();
updateBillInfo
();
}
else
{
}
else
{
changeNumber
(
datasBean
.
getNumber
()
-
1
);
changeNumber
(
datasBean
.
getNumber
()
-
1
);
}
}
mSelectMealAdapter
.
notifyDataSetChanged
();
//更新折扣
updateBillInfo
();
}
}
@Override
@Override
public
void
onMealCountAdd
(
OrderDetail
datasBean
,
int
position
)
{
public
void
onMealCountAdd
(
OrderDetail
datasBean
,
int
position
)
{
mRootView
.
recordOperat
(
true
);
mRootView
.
recordOperat
(
true
);
changeNumber
(
datasBean
.
getNumber
()
+
1
);
changeNumber
(
datasBean
.
getNumber
()
+
1
);
//更新折扣
updateBillInfo
();
}
}
@Override
@Override
...
@@ -436,16 +438,16 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -436,16 +438,16 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
}
}
OrderDetail
orderFood
=
mOrderMealList
.
get
(
mSelectMealAdapter
.
getSelect_full_start_position
());
OrderDetail
orderFood
=
mOrderMealList
.
get
(
mSelectMealAdapter
.
getSelect_full_start_position
());
OrderDetail
orderMainFood
=
mOrderMealList
.
get
(
mSelectMealAdapter
.
getMainStartPos
());
OrderDetail
orderMainFood
=
mOrderMealList
.
get
(
mSelectMealAdapter
.
getMainStartPos
());
mShoppingCart
.
changeNumber
(
number
,
orderFood
,
orderMainFood
,
mShoppingCart
.
changeNumber
(
number
,
orderFood
,
orderMainFood
,
mSelectMealAdapter
.
getSelect_full_start_position
(),
mSelectMealAdapter
.
getSelect_full_start_position
(),
mSelectMealAdapter
.
getSelect_full_end_position
(),
mSelectMealAdapter
.
getSelect_full_end_position
(),
new
ShoppingCartNumberChange
.
OnNumberChangeListener
()
{
new
ShoppingCartNumberChange
.
OnNumberChangeListener
()
{
@Override
@Override
public
void
achieveMaximum
(
String
name
)
{
public
void
achieveMaximum
(
String
name
)
{
String
msg
=
"["
+
name
+
"]"
+
"已售罄"
;
String
msg
=
"["
+
name
+
"]"
+
"已售罄"
;
CommonTipDialog
.
showSurpisedDialog
(
IActivity
,
msg
,
null
,
null
,
null
,
null
,
null
);
CommonTipDialog
.
showSurpisedDialog
(
IActivity
,
msg
,
null
,
null
,
null
,
null
,
null
);
}
}
});
});
if
(
mMealStandPresenter
!=
null
)
{
if
(
mMealStandPresenter
!=
null
)
{
mMealStandPresenter
.
updateMealSoldoutCtrData
();
mMealStandPresenter
.
updateMealSoldoutCtrData
();
mMealStandPresenter
.
updateOrderFoodNumber
();
mMealStandPresenter
.
updateOrderFoodNumber
();
...
@@ -474,16 +476,16 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -474,16 +476,16 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
if
(
mOrderMealList
.
size
()
<=
0
)
{
if
(
mOrderMealList
.
size
()
<=
0
)
{
return
false
;
return
false
;
}
}
// if (myOrderManage.getSelmainstartpositon
() > mOrderMealList.size()) {
if
(
mSelectMealAdapter
.
getMainStartPos
()
>
mOrderMealList
.
size
())
{
//
return false;
return
false
;
//
}
}
// OrderDetail orderMainFood = mOrderMealList.get(myOrderManage.getSelmainstartpositon
());
OrderDetail
orderMainFood
=
mOrderMealList
.
get
(
mSelectMealAdapter
.
getMainStartPos
());
//
if (mMealStandPresenter != null && orderMainFood != null) {
if
(
mMealStandPresenter
!=
null
&&
orderMainFood
!=
null
)
{
//
//積分是否滿足
//積分是否滿足
//
if (!mMealStandPresenter.memberPointsCondition(orderMainFood.getPointsRedeem() * i, orderMainFood.getProductName())) {
if
(!
mMealStandPresenter
.
memberPointsCondition
(
orderMainFood
.
getPointsRedeem
()
*
i
,
orderMainFood
.
getProductName
()))
{
//
return false;
return
false
;
//
}
}
//
}
}
return
true
;
return
true
;
}
}
...
@@ -492,7 +494,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -492,7 +494,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
*
*
* @param isPrint 是否印單
* @param isPrint 是否印單
*/
*/
public
void
sendOrder
(
boolean
isPrint
,
Class
afterToActivity
)
{
public
void
sendOrder
(
boolean
isPrint
,
Class
<?>
afterToActivity
)
{
if
(!
sendOrderConditionFilter
())
{
if
(!
sendOrderConditionFilter
())
{
return
;
return
;
}
}
...
@@ -510,11 +512,11 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -510,11 +512,11 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
}
}
}
}
private
void
executeCreateOrder
(
boolean
isPrint
,
Class
afterToActivity
)
{
private
void
executeCreateOrder
(
boolean
isPrint
,
Class
<?>
afterToActivity
)
{
createOrder
(
isPrint
,
afterToActivity
);
createOrder
(
isPrint
,
afterToActivity
);
}
}
private
void
executeAddOrderFood
(
boolean
isPrint
,
Class
afterToActivity
)
{
private
void
executeAddOrderFood
(
boolean
isPrint
,
Class
<?>
afterToActivity
)
{
addOrderFood
(
isPrint
,
afterToActivity
);
addOrderFood
(
isPrint
,
afterToActivity
);
}
}
...
@@ -613,6 +615,15 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -613,6 +615,15 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
}
}
/**
/**
* 創建訂單后保存OrderNo
*
* @param orderNo
*/
protected
void
setOrderNo
(
String
orderNo
)
{
mDoshokuOrder
.
setOrderNo
(
orderNo
);
}
/**
* 重置選中狀態
* 重置選中狀態
*/
*/
public
void
resetSelected
()
{
public
void
resetSelected
()
{
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/MealStandPresenter.java
View file @
aa04da1b
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
presenter
;
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
presenter
;
import
android.app.Application
;
import
android.app.Application
;
import
android.text.InputType
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.util.SparseArray
;
import
android.util.SparseArray
;
import
android.view.View
;
import
android.view.View
;
import
com.billy.cc.core.component.CC
;
import
com.billy.cc.core.component.CC
;
import
com.gingersoft.gsa.cloud.aspectj.XClickUtil
;
import
com.gingersoft.gsa.cloud.aspectj.XClickUtil
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
...
@@ -24,12 +26,14 @@ import com.gingersoft.gsa.cloud.base.utils.LanguageUtils;
...
@@ -24,12 +26,14 @@ import com.gingersoft.gsa.cloud.base.utils.LanguageUtils;
import
com.gingersoft.gsa.cloud.base.utils.MoneyUtil
;
import
com.gingersoft.gsa.cloud.base.utils.MoneyUtil
;
import
com.gingersoft.gsa.cloud.base.utils.RestaurantExpandInfoUtils
;
import
com.gingersoft.gsa.cloud.base.utils.RestaurantExpandInfoUtils
;
import
com.gingersoft.gsa.cloud.base.utils.gson.GsonUtils
;
import
com.gingersoft.gsa.cloud.base.utils.gson.GsonUtils
;
import
com.gingersoft.gsa.cloud.patterns.Strategy
;
import
com.gingersoft.gsa.cloud.table.R
;
import
com.gingersoft.gsa.cloud.table.R
;
import
com.gingersoft.gsa.cloud.table.mvp.contract.MealStandContract
;
import
com.gingersoft.gsa.cloud.table.mvp.contract.MealStandContract
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.FoodReason
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.FoodReason
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.SoldoutCtrFood
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.SoldoutCtrFood
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.request.AddOrderRequest
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.request.AddOrderRequest
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.request.CreateOrderRequest
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.request.CreateOrderRequest
;
import
com.gingersoft.gsa.cloud.table.mvp.model.discount.NomalDiscountAction
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.MealStandActivity
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.MealStandActivity
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.adapter.meal.ComboAdapter
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.adapter.meal.ComboAdapter
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.adapter.meal.DiscountAdapter
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.adapter.meal.DiscountAdapter
;
...
@@ -57,6 +61,7 @@ import com.jess.arms.integration.AppManager;
...
@@ -57,6 +61,7 @@ import com.jess.arms.integration.AppManager;
import
com.jess.arms.utils.RxLifecycleUtils
;
import
com.jess.arms.utils.RxLifecycleUtils
;
import
com.qmuiteam.qmui.widget.dialog.QMUIDialog
;
import
com.qmuiteam.qmui.widget.dialog.QMUIDialog
;
import
com.qmuiteam.qmui.widget.dialog.QMUIDialogAction
;
import
com.qmuiteam.qmui.widget.dialog.QMUIDialogAction
;
import
com.qmuiteam.qmui.widget.dialog.QMUIDialogBuilder
;
import
org.simple.eventbus.Subscriber
;
import
org.simple.eventbus.Subscriber
;
...
@@ -139,15 +144,17 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -139,15 +144,17 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
*/
*/
private
List
<
SoldoutCtrFood
>
mSoldoutCtrList
=
new
ArrayList
<>();
private
List
<
SoldoutCtrFood
>
mSoldoutCtrList
=
new
ArrayList
<>();
private
NomalDiscountAction
mNomalDiscountAction
;
private
OrderDetail
mCurrentOrderDetailBean
;
private
boolean
RvMealClicked
;
private
boolean
RvMealClicked
;
@Inject
@Inject
public
MealStandPresenter
(
MealStandContract
.
Model
model
,
MealStandContract
.
View
rootView
)
{
public
MealStandPresenter
(
MealStandContract
.
Model
model
,
MealStandContract
.
View
rootView
)
{
super
(
model
,
rootView
);
super
(
model
,
rootView
);
this
.
IActivity
=
(
MealStandActivity
)
rootView
;
this
.
IActivity
=
(
MealStandActivity
)
rootView
;
this
.
mNomalDiscountAction
=
new
NomalDiscountAction
(
IActivity
,
mShoppingCart
.
getMultyDiscountList
());
// initBillItem();
// updateBillInfo();
}
}
@Override
@Override
...
@@ -203,11 +210,6 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -203,11 +210,6 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
if
(
mSelectMealAdapter
!=
null
)
{
if
(
mSelectMealAdapter
!=
null
)
{
mRootView
.
setSelectFoodAdapter
(
mSelectMealAdapter
);
mRootView
.
setSelectFoodAdapter
(
mSelectMealAdapter
);
}
}
// myOrderManage.setSelectMealAdapter(mSelectMealAdapter);
// if (mFoodGroupAdapter == null) {
// mFoodGroupAdapter = new FoodGroupAdapter(IActivity, mFoodGroupList);
// mRootView.setFoodGroupAdapter(mFoodGroupAdapter);
// }
if
(
mFoodAdapter
==
null
)
{
if
(
mFoodAdapter
==
null
)
{
mFoodAdapter
=
new
FoodAdapter
(
IActivity
,
mFoodList
,
1
);
mFoodAdapter
=
new
FoodAdapter
(
IActivity
,
mFoodList
,
1
);
mRootView
.
setFoodAdapter
(
mFoodAdapter
);
mRootView
.
setFoodAdapter
(
mFoodAdapter
);
...
@@ -246,7 +248,6 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -246,7 +248,6 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
RvMealClicked
=
true
;
RvMealClicked
=
true
;
//设置当前操作的食品
//设置当前操作的食品
mCurrentOrderDetailBean
=
datasBean
;
mCurrentOrderDetailBean
=
datasBean
;
mSelectMealAdapter
.
setMyOrderManageSelectPosition
();
loadComboData
(
datasBean
,
true
);
loadComboData
(
datasBean
,
true
);
}
}
...
@@ -351,22 +352,43 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -351,22 +352,43 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
@Override
@Override
public
void
onItemClick
(
View
view
,
int
viewType
,
Object
data
,
int
position
)
{
public
void
onItemClick
(
View
view
,
int
viewType
,
Object
data
,
int
position
)
{
Discount
d
atas
Bean
=
(
Discount
)
data
;
Discount
d
iscount
Bean
=
(
Discount
)
data
;
mRootView
.
recordOperat
(
true
);
mRootView
.
recordOperat
(
true
);
if
(
XClickUtil
.
isFastDoubleClick
(
view
,
1000
))
{
if
(
XClickUtil
.
isFastDoubleClick
(
view
,
1000
))
{
return
;
return
;
}
}
if
(!
discountConditionFilter
(
d
atas
Bean
))
{
if
(!
discountConditionFilter
(
d
iscount
Bean
))
{
return
;
return
;
}
}
if
(
cutOutDiscount
()
==
-
100
)
{
if
(
cutOutDiscount
()
==
-
100
)
{
return
;
return
;
}
}
addDiscountItem
(
datasBean
);
if
(
discountBean
.
getType
()
==
Discount
.
DISCOUNT_TYPE_CUSTOM_AMOUNT
)
{
//更新賬單金額
showCustomAmountDialog
(
discountBean
);
updateBillInfo
();
}
else
{
addDiscountItem
(
discountBean
);
}
// mNomalDiscountAction.action(discountBean, new Strategy.CallBackListener() {
//
// @Override
// public void callBack(Object o) {
// addDiscountItem((Discount) o);
// }
// });
// new NomalDiscountAction().
}
});
}
private
void
showCustomAmountDialog
(
Discount
discountBean
)
{
CommonTipDialog
.
showEditDialog
(
IActivity
,
discountBean
.
getRemark
(),
"請輸入折扣金額"
,
InputType
.
TYPE_CLASS_NUMBER
|
InputType
.
TYPE_NUMBER_FLAG_DECIMAL
,
new
CommonTipDialog
.
OnEditTextListener
()
{
@Override
public
void
inputText
(
String
text
)
{
discountBean
.
setType
(
Discount
.
DISCOUNT_TYPE_AMOUNT
);
discountBean
.
setAmount
(
Double
.
parseDouble
(
text
));
addDiscountItem
(
discountBean
);
}
}
});
});
}
}
...
@@ -458,6 +480,9 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -458,6 +480,9 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
mCurrentOrderDetailBean
=
OrderDetail
.
discountTransOrderDetail
(
datasBean
,
true
,
id
,
getDisountSourcePrice
());
mCurrentOrderDetailBean
=
OrderDetail
.
discountTransOrderDetail
(
datasBean
,
true
,
id
,
getDisountSourcePrice
());
int
addPosition
=
mSelectMealAdapter
.
addFoodItem
(
mCurrentOrderDetailBean
);
int
addPosition
=
mSelectMealAdapter
.
addFoodItem
(
mCurrentOrderDetailBean
);
mRootView
.
setMealRvScrollToPosition
(
addPosition
);
mRootView
.
setMealRvScrollToPosition
(
addPosition
);
//更新賬單金額
updateBillInfo
();
}
}
private
void
loadComboData
(
OrderDetail
food
,
boolean
isSelectedMeal
)
{
private
void
loadComboData
(
OrderDetail
food
,
boolean
isSelectedMeal
)
{
...
@@ -784,7 +809,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -784,7 +809,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
}
}
@Override
@Override
public
void
createOrder
(
boolean
isPrint
,
Class
afterToActivity
)
{
public
void
createOrder
(
boolean
isPrint
,
Class
<?>
afterToActivity
)
{
CreateOrderRequest
request
=
getCreateOrderRequest
(
getOrderFoodLists
());
CreateOrderRequest
request
=
getCreateOrderRequest
(
getOrderFoodLists
());
RequestBody
requestBody
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json"
),
GsonUtils
.
GsonString
(
request
));
RequestBody
requestBody
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json"
),
GsonUtils
.
GsonString
(
request
));
String
json
=
GsonUtils
.
GsonString
(
request
);
String
json
=
GsonUtils
.
GsonString
(
request
);
...
@@ -804,16 +829,16 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -804,16 +829,16 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
if
(
info
.
getData
()
!=
null
)
{
if
(
info
.
getData
()
!=
null
)
{
if
(
info
.
getData
()
instanceof
Double
)
{
if
(
info
.
getData
()
instanceof
Double
)
{
//未上線,避免正式版閃退
//未上線,避免正式版閃退
setOrderId
((
D
ouble
)
info
.
getData
());
setOrderId
((
d
ouble
)
info
.
getData
());
mDoshokuOrder
.
setOrderNo
(((
Double
)
info
.
getData
()).
longValue
()
+
""
);
setOrderNo
(((
Double
)
info
.
getData
()).
longValue
()
+
""
);
}
else
{
}
else
{
LinkedTreeMap
tm
=
(
LinkedTreeMap
)
info
.
getData
();
LinkedTreeMap
tm
=
(
LinkedTreeMap
)
info
.
getData
();
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"
))
{
setOrderId
((
D
ouble
)
tm
.
get
(
key
));
setOrderId
((
d
ouble
)
tm
.
get
(
key
));
}
else
if
(
key
.
equals
(
"orderNo"
))
{
}
else
if
(
key
.
equals
(
"orderNo"
))
{
mDoshokuOrder
.
setOrderNo
((
String
)
tm
.
get
(
key
));
setOrderNo
((
String
)
tm
.
get
(
key
));
}
}
}
}
}
}
...
@@ -829,7 +854,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -829,7 +854,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
}
}
@Override
@Override
public
void
addOrderFood
(
boolean
isPrint
,
Class
afterToActivity
)
{
public
void
addOrderFood
(
boolean
isPrint
,
Class
<?>
afterToActivity
)
{
List
<
OrderDetail
>
foodLists
=
getOrderFoodLists
();
List
<
OrderDetail
>
foodLists
=
getOrderFoodLists
();
for
(
OrderDetail
food
:
foodLists
)
{
for
(
OrderDetail
food
:
foodLists
)
{
food
.
setOrderId
(
mDoshokuOrder
.
getOrderId
());
food
.
setOrderId
(
mDoshokuOrder
.
getOrderId
());
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/OrderContentPresenter.java
View file @
aa04da1b
...
@@ -18,6 +18,8 @@ import com.gingersoft.gsa.cloud.base.order.billItem.DiscountItem;
...
@@ -18,6 +18,8 @@ import com.gingersoft.gsa.cloud.base.order.billItem.DiscountItem;
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.bean.discount.CouponDiscountBean
;
import
com.gingersoft.gsa.cloud.base.order.bean.discount.CouponDiscountBean
;
import
com.gingersoft.gsa.cloud.base.order.bean.discount.CouponDiscountResult
;
import
com.gingersoft.gsa.cloud.base.order.bean.discount.CouponDiscountResult
;
import
com.gingersoft.gsa.cloud.base.order.discount.MultyDiscount
;
import
com.gingersoft.gsa.cloud.base.order.discount.NomalDiscount
;
import
com.gingersoft.gsa.cloud.base.order.order.BaseOrder
;
import
com.gingersoft.gsa.cloud.base.order.order.BaseOrder
;
import
com.gingersoft.gsa.cloud.base.order.order.DoshokuOrder
;
import
com.gingersoft.gsa.cloud.base.order.order.DoshokuOrder
;
import
com.gingersoft.gsa.cloud.base.table.bean.TableBean
;
import
com.gingersoft.gsa.cloud.base.table.bean.TableBean
;
...
@@ -278,7 +280,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
...
@@ -278,7 +280,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
}
}
@Override
@Override
public
void
createOrder
(
boolean
isPrint
,
Class
afterToActivity
)
{
public
void
createOrder
(
boolean
isPrint
,
Class
<?>
afterToActivity
)
{
CreateOrderRequest
request
=
getCreateOrderRequest
(
getOrderFoodLists
());
CreateOrderRequest
request
=
getCreateOrderRequest
(
getOrderFoodLists
());
RequestBody
requestBody
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json"
),
GsonUtils
.
GsonString
(
request
));
RequestBody
requestBody
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json"
),
GsonUtils
.
GsonString
(
request
));
String
json
=
GsonUtils
.
GsonString
(
request
);
String
json
=
GsonUtils
.
GsonString
(
request
);
...
@@ -299,7 +301,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
...
@@ -299,7 +301,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
}
}
@Override
@Override
public
void
addOrderFood
(
boolean
isPrint
,
Class
afterToActivity
)
{
public
void
addOrderFood
(
boolean
isPrint
,
Class
<?>
afterToActivity
)
{
List
<
OrderDetail
>
foodLists
=
getOrderFoodLists
();
List
<
OrderDetail
>
foodLists
=
getOrderFoodLists
();
for
(
OrderDetail
food
:
foodLists
)
{
for
(
OrderDetail
food
:
foodLists
)
{
food
.
setOrderId
(
mDoshokuOrder
.
getOrderId
());
food
.
setOrderId
(
mDoshokuOrder
.
getOrderId
());
...
@@ -322,7 +324,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
...
@@ -322,7 +324,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
});
});
}
}
private
void
sendOrderRespose
(
BaseOrderRespose
info
,
boolean
isPrint
,
Class
afterToActivity
)
{
private
void
sendOrderRespose
(
BaseOrderRespose
info
,
boolean
isPrint
,
Class
<?>
afterToActivity
)
{
if
(
info
==
null
)
{
if
(
info
==
null
)
{
if
(
isPrint
)
{
if
(
isPrint
)
{
printOrder
(
mTableInfo
.
getId
(),
true
);
printOrder
(
mTableInfo
.
getId
(),
true
);
...
@@ -352,7 +354,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
...
@@ -352,7 +354,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
/**
/**
* 送單打印上菜纸
* 送單打印上菜纸
*/
*/
private
void
printSendOrder
(
Class
afterToActivity
)
{
private
void
printSendOrder
(
Class
<?>
afterToActivity
)
{
if
(
afterToActivity
!=
null
)
{
if
(
afterToActivity
!=
null
)
{
mRootView
.
startActivityForResult
(
OrderContentActivity
.
BILL_CODE
,
afterToActivity
,
null
);
mRootView
.
startActivityForResult
(
OrderContentActivity
.
BILL_CODE
,
afterToActivity
,
null
);
}
}
...
@@ -456,7 +458,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
...
@@ -456,7 +458,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
if
(
memberInfo
!=
null
)
{
if
(
memberInfo
!=
null
)
{
updateBillItem
=
true
;
updateBillItem
=
true
;
mDoshokuOrder
.
setMemberInfo
(
memberInfo
);
mDoshokuOrder
.
setMemberInfo
(
memberInfo
);
mShoppingCart
.
addMultyDiscount
(
mShoppingCart
.
createMemberDiscount
(
memberInfo
,
BillItem
.
BILL_ITEM_NO_ORDER_STATUS
));
mShoppingCart
.
addMultyDiscount
(
mShoppingCart
.
createMemberDiscount
(
memberInfo
,
BillItem
.
BILL_ITEM_NO_ORDER_STATUS
));
}
}
CouponDiscountBean
couponBean
=
couponResult
.
getCouponBean
();
CouponDiscountBean
couponBean
=
couponResult
.
getCouponBean
();
if
(
couponBean
!=
null
)
{
if
(
couponBean
!=
null
)
{
...
@@ -464,7 +466,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
...
@@ -464,7 +466,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
return
;
return
;
}
}
updateBillItem
=
true
;
updateBillItem
=
true
;
mShoppingCart
.
addMultyDiscount
(
mShoppingCart
.
createCouponDiscount
(
couponBean
,
BillItem
.
BILL_ITEM_NO_ORDER_STATUS
));
mShoppingCart
.
addMultyDiscount
(
mShoppingCart
.
createCouponDiscount
(
couponBean
,
BillItem
.
BILL_ITEM_NO_ORDER_STATUS
));
}
}
if
(
updateBillItem
)
{
if
(
updateBillItem
)
{
updateBillInfo
();
updateBillInfo
();
...
@@ -745,7 +747,17 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
...
@@ -745,7 +747,17 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
mDiscountDialog
.
setOnClickListener
(
new
DiscountDialog
.
Builder
.
OnClickListener
()
{
mDiscountDialog
.
setOnClickListener
(
new
DiscountDialog
.
Builder
.
OnClickListener
()
{
@Override
@Override
public
void
onItemClick
(
Discount
item
,
int
position
)
{
public
void
onItemClick
(
Discount
item
,
int
position
)
{
mShoppingCart
.
addMultyDiscount
(
mShoppingCart
.
createNomalDiscount
(
item
,
BillItem
.
BILL_ITEM_NO_ORDER_STATUS
));
if
(
item
.
getOnlyOnce
()
==
1
)
{
//此折扣只一次
return
;
}
if
(
item
.
getExclusive
()
==
1
)
{
//獨佔折扣
}
MultyDiscount
nomalDiscount
=
mShoppingCart
.
createNomalDiscount
(
item
,
BillItem
.
BILL_ITEM_NO_ORDER_STATUS
);
mShoppingCart
.
addMultyDiscount
(
nomalDiscount
);
updateBillInfo
();
updateBillInfo
();
}
}
...
@@ -757,8 +769,6 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
...
@@ -757,8 +769,6 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
}
}
List
<
Discount
>
discountList
=
filterDiscountByType
(
mModel
.
queryDB_DiscountList
(
"1"
),
"1"
);
List
<
Discount
>
discountList
=
filterDiscountByType
(
mModel
.
queryDB_DiscountList
(
"1"
),
"1"
);
mDiscountDialog
.
addItems
(
discountList
);
mDiscountDialog
.
addItems
(
discountList
);
// mDiscountDialog.addItems(getDiscountList());
// mDiscountDialog.setTopBarBagcolor(mFunctionList.get(4).getBackgroundColor());
mDiscountDialog
.
build
().
show
();
mDiscountDialog
.
build
().
show
();
}
}
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/TablePresenter.java
View file @
aa04da1b
...
@@ -429,6 +429,8 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
...
@@ -429,6 +429,8 @@ public class TablePresenter extends BasePresenter<TableContract.Model, TableCont
//設置用餐人數
//設置用餐人數
openTableBean
.
setPerson
(
orderBean
.
getPerson
());
openTableBean
.
setPerson
(
orderBean
.
getPerson
());
//緩存訂單信息
//緩存訂單信息
doshokuOrder
.
setOrderId
(
orderBean
.
getId
());
doshokuOrder
.
setOrderNo
(
orderBean
.
getOrderNo
());
doshokuOrder
.
setOrderPlaced
(
new
OrderBean
(
orderBean
));
doshokuOrder
.
setOrderPlaced
(
new
OrderBean
(
orderBean
));
doshokuOrder
.
getShoppingCart
().
addCommodityList
(
OrderDetail
.
orderTransOrderDetails
(
mealCommoditysBeans
));
doshokuOrder
.
getShoppingCart
().
addCommodityList
(
OrderDetail
.
orderTransOrderDetails
(
mealCommoditysBeans
));
if
(
orderBean
.
getMemberInfo
()
!=
null
)
{
if
(
orderBean
.
getMemberInfo
()
!=
null
)
{
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/orderManager/AllOrderPresenter.java
View file @
aa04da1b
...
@@ -39,6 +39,7 @@ import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
...
@@ -39,6 +39,7 @@ import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.concurrent.CopyOnWriteArrayList
;
import
javax.inject.Inject
;
import
javax.inject.Inject
;
...
@@ -214,9 +215,9 @@ public class AllOrderPresenter extends BasePresenter<AllOrderContract.Model, All
...
@@ -214,9 +215,9 @@ public class AllOrderPresenter extends BasePresenter<AllOrderContract.Model, All
});
});
}
}
private
List
<
BillItem
>
getOrderMoneyList
(
OrderDetailItem
orderDetailItem
,
double
totalMoney
)
{
private
Array
List
<
BillItem
>
getOrderMoneyList
(
OrderDetailItem
orderDetailItem
,
double
totalMoney
)
{
List
<
SectionTextItem3
>
printOrderMoneyList
=
new
ArrayList
<>();
List
<
SectionTextItem3
>
printOrderMoneyList
=
new
ArrayList
<>();
List
<
BillItem
>
printBillOrderMoneyList
=
new
ArrayList
<>();
Array
List
<
BillItem
>
printBillOrderMoneyList
=
new
ArrayList
<>();
SectionTextItem3
serviceAmountSection
=
getOrderServiceAmountSection
(
orderDetailItem
);
SectionTextItem3
serviceAmountSection
=
getOrderServiceAmountSection
(
orderDetailItem
);
if
(
serviceAmountSection
!=
null
)
{
if
(
serviceAmountSection
!=
null
)
{
printOrderMoneyList
.
add
(
serviceAmountSection
);
printOrderMoneyList
.
add
(
serviceAmountSection
);
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/MealStandActivity.java
View file @
aa04da1b
...
@@ -22,6 +22,7 @@ import android.widget.LinearLayout;
...
@@ -22,6 +22,7 @@ import android.widget.LinearLayout;
import
android.widget.RelativeLayout
;
import
android.widget.RelativeLayout
;
import
android.widget.ScrollView
;
import
android.widget.ScrollView
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.billy.cc.core.component.CC
;
import
com.billy.cc.core.component.CC
;
import
com.gingersoft.gsa.cloud.aspectj.XClickUtil
;
import
com.gingersoft.gsa.cloud.aspectj.XClickUtil
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
...
@@ -62,6 +63,7 @@ import com.gingersoft.gsa.cloud.ui.view.RecyclerViewNoBugLinearLayoutManager;
...
@@ -62,6 +63,7 @@ import com.gingersoft.gsa.cloud.ui.view.RecyclerViewNoBugLinearLayoutManager;
import
com.gingersoft.gsa.cloud.ui.view.SearchKeyBoardView
;
import
com.gingersoft.gsa.cloud.ui.view.SearchKeyBoardView
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog
;
import
com.gingersoft.gsa.cloud.zxing.MipcaCaptureActivity
;
import
com.gingersoft.gsa.cloud.zxing.MipcaCaptureActivity
;
import
com.jakewharton.rxbinding4.view.RxView
;
import
com.jess.arms.base.BaseFragmentActivity
;
import
com.jess.arms.base.BaseFragmentActivity
;
import
com.jess.arms.base.DefaultAdapter
;
import
com.jess.arms.base.DefaultAdapter
;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.di.component.AppComponent
;
...
@@ -250,6 +252,11 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
...
@@ -250,6 +252,11 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
private
int
mCurrentViewMode
;
private
int
mCurrentViewMode
;
private
boolean
isPluMode
=
false
;
private
boolean
isPluMode
=
false
;
/**
* 是否已初始化 已送單的折扣
*/
private
boolean
initSentOrderDiscount
=
false
;
private
ImageView
[]
ivPoints
;
private
ImageView
[]
ivPoints
;
private
int
mPageIndex
;
private
int
mPageIndex
;
private
int
totalPage
;
private
int
totalPage
;
...
@@ -824,7 +831,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
...
@@ -824,7 +831,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
public
void
returnBeforeActivity
(
boolean
initTable
)
{
public
void
returnBeforeActivity
(
boolean
initTable
)
{
SPUtils
.
put
(
this
,
MealConstant
.
EXIT_IS_PLU_MODE
,
isPluMode
);
SPUtils
.
put
(
this
,
MealConstant
.
EXIT_IS_PLU_MODE
,
isPluMode
);
if
(
BaseOrder
.
isCurrentOrderType
(
FoodSummaryConstans
.
RESTAURANT_MODE
)
&&
initTable
&&
!
DoshokuOrder
.
getInstance
().
isModifyOrder
())
{
if
(
BaseOrder
.
isCurrentOrderType
(
FoodSummaryConstans
.
RESTAURANT_MODE
)
&&
initTable
&&
!
DoshokuOrder
.
getInstance
().
isModifyOrder
())
{
TableBean
.
DataBean
dataBean
=
DoshokuOrder
.
getInstance
().
getOpenTableInfo
();
TableBean
.
DataBean
dataBean
=
DoshokuOrder
.
getInstance
().
getOpenTableInfo
();
//通知更新餐台状态
//通知更新餐台状态
EventBus
.
getDefault
().
post
(
new
InitTableEvent
(
dataBean
.
getId
(),
dataBean
.
getTableNumber
()),
"initTable_status_event"
);
EventBus
.
getDefault
().
post
(
new
InitTableEvent
(
dataBean
.
getId
(),
dataBean
.
getTableNumber
()),
"initTable_status_event"
);
}
}
...
@@ -1304,7 +1311,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
...
@@ -1304,7 +1311,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
return
;
return
;
}
}
TableBean
.
DataBean
dataBean
=
DoshokuOrder
.
getInstance
().
getOpenTableInfo
();
TableBean
.
DataBean
dataBean
=
DoshokuOrder
.
getInstance
().
getOpenTableInfo
();
mPresenter
.
queryMember
(
1
,
qrCodeResult
,
GsaCloudApplication
.
getGsPosShopId
(),
dataBean
.
getId
(),
dataBean
.
getTableNumber
());
mPresenter
.
queryMember
(
1
,
qrCodeResult
,
GsaCloudApplication
.
getGsPosShopId
(),
dataBean
.
getId
(),
dataBean
.
getTableNumber
());
}
}
}
}
...
@@ -1348,4 +1355,11 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
...
@@ -1348,4 +1355,11 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
}
}
public
boolean
isInitSentOrderDiscount
()
{
return
initSentOrderDiscount
;
}
public
void
setInitSentOrderDiscount
(
boolean
initSentOrderDiscount
)
{
this
.
initSentOrderDiscount
=
initSentOrderDiscount
;
}
}
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/orderManager/OrderDetailActivity.java
View file @
aa04da1b
...
@@ -52,6 +52,7 @@ import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
...
@@ -52,6 +52,7 @@ import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.concurrent.CopyOnWriteArrayList
;
import
butterknife.BindView
;
import
butterknife.BindView
;
import
butterknife.OnClick
;
import
butterknife.OnClick
;
...
@@ -534,8 +535,8 @@ public class OrderDetailActivity extends BaseActivity<OrderDetailPresenter> impl
...
@@ -534,8 +535,8 @@ public class OrderDetailActivity extends BaseActivity<OrderDetailPresenter> impl
}
}
private
List
<
BillItem
>
getOrderMoneyList
()
{
private
Array
List
<
BillItem
>
getOrderMoneyList
()
{
List
<
BillItem
>
billOrderMoneyList
=
new
ArrayList
<>();
Array
List
<
BillItem
>
billOrderMoneyList
=
new
ArrayList
<>();
if
(
mOrderCenterMoneyList
!=
null
)
{
if
(
mOrderCenterMoneyList
!=
null
)
{
for
(
SectionTextItem3
item
:
mOrderCenterMoneyList
)
{
for
(
SectionTextItem3
item
:
mOrderCenterMoneyList
)
{
BillItem
billItem
=
new
BillOrderMoney
();
BillItem
billItem
=
new
BillOrderMoney
();
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/meal/DiscountAdapter.java
View file @
aa04da1b
...
@@ -32,15 +32,11 @@ public class DiscountAdapter extends DefaultAdapter<Discount> {
...
@@ -32,15 +32,11 @@ public class DiscountAdapter extends DefaultAdapter<Discount> {
private
int
fontSize
;
private
int
fontSize
;
private
int
colHeight
;
private
int
colHeight
;
private
int
currentSelectPosition
=
0
;
public
DiscountAdapter
(
Context
context
,
List
<
Discount
>
infos
)
{
public
DiscountAdapter
(
Context
context
,
List
<
Discount
>
infos
)
{
super
(
infos
);
super
(
infos
);
this
.
mContext
=
context
;
this
.
mContext
=
context
;
fontSize
=
GsaCloudApplication
.
uiStyleConfiguration
.
getDiscountFontSizeValue
();
fontSize
=
GsaCloudApplication
.
uiStyleConfiguration
.
getDiscountFontSizeValue
();
colHeight
=
GsaCloudApplication
.
uiStyleConfiguration
.
getDiscountHeightValue
();
colHeight
=
GsaCloudApplication
.
uiStyleConfiguration
.
getDiscountHeightValue
();
}
}
@Override
@Override
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/meal/FoodAdapter.java
View file @
aa04da1b
...
@@ -175,19 +175,10 @@ public class FoodAdapter extends DefaultAdapter<Food> {
...
@@ -175,19 +175,10 @@ public class FoodAdapter extends DefaultAdapter<Food> {
private
void
setStatus
(
Food
datasBean
)
{
private
void
setStatus
(
Food
datasBean
)
{
tv_soldout
.
setMaxHeight
(
mSoldoutFoodFlagHeight
);
tv_soldout
.
setMinHeight
(
mSoldoutFoodFlagHeight
);
tv_soldout
.
setMinHeight
(
mSoldoutFoodFlagHeight
);
tv_soldout
.
setTextSize
(
mSoldoutFoodFlagFontSize
);
tv_soldout
.
setTextSize
(
mSoldoutFoodFlagFontSize
);
// tv_soldout.setTextColor(Color.parseColor("#000000"));
tv_soldout
.
setBackgroundDrawable
(
mContext
.
getResources
().
getDrawable
(
R
.
drawable
.
meal_shape_remaining_number_bg
));
tv_soldout
.
setBackgroundDrawable
(
mContext
.
getResources
().
getDrawable
(
R
.
drawable
.
meal_shape_remaining_number_bg
));
// tv_soldout.setMinWidth(20);
tv_soldout
.
setGravity
(
Gravity
.
CENTER
);
// tv_soldout.setTextSize(10);
// tv_soldout.setGravity(Gravity.CENTER);
// RelativeLayout.LayoutParams lp2 = new RelativeLayout.LayoutParams(new ViewGroup.MarginLayoutParams(60, 40));
// lp2.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
// lp2.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
// tv_soldout.setLayoutParams(lp2);
tv_soldout
.
setVisibility
(
View
.
INVISIBLE
);
tv_soldout
.
setVisibility
(
View
.
INVISIBLE
);
iv_qtySold
.
setVisibility
(
View
.
INVISIBLE
);
iv_qtySold
.
setVisibility
(
View
.
INVISIBLE
);
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/meal/SelectMealAdapter.java
View file @
aa04da1b
...
@@ -176,7 +176,6 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> {
...
@@ -176,7 +176,6 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> {
}
}
private
void
setViewVisibility
(
OrderDetail
datasBean
)
{
private
void
setViewVisibility
(
OrderDetail
datasBean
)
{
if
(
datasBean
.
getAblediscount
()
==
0
)
{
if
(
datasBean
.
getAblediscount
()
==
0
)
{
tv_D
.
setVisibility
(
View
.
VISIBLE
);
tv_D
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
}
else
{
...
@@ -343,7 +342,6 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> {
...
@@ -343,7 +342,6 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> {
setSelectPosition
(
select_position
);
setSelectPosition
(
select_position
);
setIndex
();
setIndex
();
setItemNo
(
datasBean
);
setItemNo
(
datasBean
);
setMyOrderManageSelectPosition
();
return
addPosition
;
return
addPosition
;
}
}
...
@@ -434,8 +432,6 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> {
...
@@ -434,8 +432,6 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> {
setSelectPosition
(
select_position
);
setSelectPosition
(
select_position
);
setMyOrderManageSelectPosition
();
mMealStandActivity
.
showViewModeVisibility
(
MealConstant
.
food_group_ViewMode
,
MealConstant
.
food_ViewMode
);
mMealStandActivity
.
showViewModeVisibility
(
MealConstant
.
food_group_ViewMode
,
MealConstant
.
food_ViewMode
);
}
}
...
@@ -460,7 +456,6 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> {
...
@@ -460,7 +456,6 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> {
setIndex
();
setIndex
();
setSelectPosition
(
select_position
);
setSelectPosition
(
select_position
);
setMyOrderManageSelectPosition
();
}
}
/**
/**
...
@@ -483,8 +478,6 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> {
...
@@ -483,8 +478,6 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> {
setSelectPosition
(
select_position
);
setSelectPosition
(
select_position
);
setMyOrderManageSelectPosition
();
if
(
mMealStandActivity
!=
null
)
{
if
(
mMealStandActivity
!=
null
)
{
mMealStandActivity
.
showViewModeVisibility
(
MealConstant
.
food_group_ViewMode
,
MealConstant
.
food_ViewMode
);
mMealStandActivity
.
showViewModeVisibility
(
MealConstant
.
food_group_ViewMode
,
MealConstant
.
food_ViewMode
);
}
}
...
@@ -583,7 +576,6 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> {
...
@@ -583,7 +576,6 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> {
}
}
setIndex
();
setIndex
();
setSelectPosition
(
select_position
);
setSelectPosition
(
select_position
);
setMyOrderManageSelectPosition
();
}
}
private
void
removeIntactFoodItem
()
{
private
void
removeIntactFoodItem
()
{
...
@@ -619,16 +611,6 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> {
...
@@ -619,16 +611,6 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> {
return
remove
;
return
remove
;
}
}
public
void
setMyOrderManageSelectPosition
()
{
// MyOrderManage.getInstance().setSelect_Full_start_position(select_full_start_position);
// MyOrderManage.getInstance().setSelect_Full_end_position(select_full_end_position);
// MyOrderManage.getInstance().setSelstartpostion(select_start_position);
// MyOrderManage.getInstance().setSelendpostion(select_end_position);
// MyOrderManage.getInstance().setSelmainendpostion(mainEndPos);
// MyOrderManage.getInstance().setSelmainstartpositon(mainStartPos);
// MyOrderManage.getInstance().setSelpostion(select_position);
}
/**
/**
* 获取食品第细项最后一个子项位置
* 获取食品第细项最后一个子项位置
*
*
...
@@ -977,8 +959,6 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> {
...
@@ -977,8 +959,6 @@ public class SelectMealAdapter extends DefaultAdapter<OrderDetail> {
mOnItemClickListener
.
onCurrentOrderDetail
(
mInfos
.
get
(
select_position
),
select_position
);
mOnItemClickListener
.
onCurrentOrderDetail
(
mInfos
.
get
(
select_position
),
select_position
);
}
}
notifyDataSetChanged
();
notifyDataSetChanged
();
setMyOrderManageSelectPosition
();
}
}
/**
/**
...
...
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