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
ff6f0816
Commit
ff6f0816
authored
Jul 24, 2020
by
宁斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、輸入會員手機號獲取會員信息
parent
2fd4d7af
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
51 changed files
with
1207 additions
and
242 deletions
+1207
-242
.git.zip
+0
-0
base-module/build.gradle
+6
-0
base-module/src/main/java/com/gingersoft/gsa/cloud/base/application/GsaCloudApplication.java
+8
-0
base-module/src/main/java/com/gingersoft/gsa/cloud/base/common/bean/OrderDetail.java
+26
-9
base-module/src/main/java/com/gingersoft/gsa/cloud/base/common/bean/PayMethod.java
+3
-0
base-module/src/main/java/com/gingersoft/gsa/cloud/base/common/bean/TableBean.java
+2
-0
base-module/src/main/java/com/gingersoft/gsa/cloud/base/common/bean/mealManage/MyOrderManage.java
+31
-4
base-module/src/main/java/com/gingersoft/gsa/cloud/base/utils/StringUtils.java
+191
-0
base-module/src/main/java/com/gingersoft/gsa/cloud/base/utils/encryption/MD5.java
+0
-65
base-module/src/main/java/com/gingersoft/gsa/cloud/constans/UserConstans.java
+1
-0
base-module/src/main/java/com/gingersoft/gsa/cloud/database/bean/Modifier.java
+10
-0
base-module/src/main/java/com/gingersoft/gsa/cloud/database/greendao/DaoMaster.java
+3
-3
base-module/src/main/java/com/gingersoft/gsa/cloud/database/greendao/DaoSession.java
+14
-14
base-module/src/main/java/com/gingersoft/gsa/cloud/database/utils/ModifierDaoUtils.java
+1
-1
base-module/src/main/java/com/gingersoft/gsa/cloud/globalconfig/applyOptions/MyResponseErrorListener.java
+1
-0
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/adapter/BasTextSectiontAdapter.java
+7
-7
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/adapter/BillMethodAdapter.java
+8
-1
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/bean/mode/BrandsBean.java
+10
-0
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/bean/view/SectionRestaurantItem.java
+36
-0
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/view/BeveLabelView.java
+289
-0
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/widget/dialog/ChooseRestaurantDialog.java
+11
-10
base-module/src/main/res/values/attrs.xml
+28
-0
config.gradle
+3
-3
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/contract/LoginInterfaceImpl.java
+9
-7
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/ui/activity/LoginActivity.java
+1
-1
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/ui/activity/WelcomeActivity.java
+1
-1
main-module/build.gradle
+2
-2
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/model/bean/SettlementReport.java
+10
-0
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/activity/NewMainActivity.java
+6
-4
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/activity/SettlementReportActivity.java
+15
-9
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/ui/adapter/TableManageSectiontAdapter.java
+33
-10
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/contract/MealStandContract.java
+4
-1
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/MealStandModel.java
+7
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/bean/FoodReason.java
+4
-4
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/service/MemberService.java
+25
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/MealStandPresenter.java
+0
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/OrderPayPresenter.java
+6
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/MealStandActivity.java
+44
-2
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/FineItemOneAdapter.java
+23
-31
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/FineItemTwoAdapter.java
+23
-31
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/meal/ComboAdapter.java
+20
-9
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/meal/FoodAdapter.java
+8
-3
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/meal/FoodGroupAdapter.java
+12
-5
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/meal/ModifierAdapter.java
+17
-3
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/widget/UseMemberDialog.java
+0
-0
table-module/src/main/res/layout/meal_dialog_use_member.xml
+120
-0
table-module/src/main/res/layout/meal_item_combo.xml
+16
-2
table-module/src/main/res/layout/meal_item_fine.xml
+85
-0
table-module/src/main/res/layout/meal_item_food.xml
+14
-0
table-module/src/main/res/layout/meal_item_food_group.xml
+13
-0
table-module/src/main/res/mipmap-xhdpi/meal_remaining_number.png
+0
-0
No files found.
.git.zip
0 → 100644
View file @
ff6f0816
File added
base-module/build.gradle
View file @
ff6f0816
...
...
@@ -94,6 +94,12 @@ dependencies {
api
'com.sunmi:printerlibrary:1.0.7'
//上下拉刷新
api
'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0'
//多功能輸入框
api
'com.rengwuxian.materialedittext:library:2.1.4'
//二维码扫描
api
'cn.yipianfengye.android:zxing-library:2.2'
// // 斜角标签
// api 'com.github.poqiao:BeveLabelView:1.0.3'
compile
"androidx.core:core-ktx:+"
implementation
'org.projectlombok:lombok:1.18.8'
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/base/application/GsaCloudApplication.java
View file @
ff6f0816
...
...
@@ -369,6 +369,10 @@ public class GsaCloudApplication extends BaseApplication {
return
(
String
)
SPUtils
.
get
(
context
,
UserConstans
.
brandRestaurantInfos
,
""
);
}
public
static
String
getGsPosShopId
(
Context
context
)
{
return
(
String
)
SPUtils
.
get
(
context
,
UserConstans
.
gsPosShopId
,
""
);
}
public
static
void
setLoginToken
(
Context
context
,
String
token
)
{
SPUtils
.
put
(
context
,
UserConstans
.
token
,
token
);
}
...
...
@@ -401,6 +405,10 @@ public class GsaCloudApplication extends BaseApplication {
SPUtils
.
put
(
context
,
UserConstans
.
brandRestaurantInfos
,
brandRestaurantIds
);
}
public
static
void
setGsPosShopId
(
Context
context
,
String
gsPosShopId
)
{
SPUtils
.
put
(
context
,
UserConstans
.
gsPosShopId
,
gsPosShopId
);
}
public
static
void
clearMemberInfo
()
{
setLoginToken
(
mAppContext
,
""
);
setMemberId
(
mAppContext
,
0
);
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/base/common/bean/OrderDetail.java
View file @
ff6f0816
...
...
@@ -8,6 +8,8 @@ import com.gingersoft.gsa.cloud.database.bean.Food;
import
com.gingersoft.gsa.cloud.database.bean.Modifier
;
import
com.gingersoft.gsa.cloud.print.bean.OrderDetails
;
import
org.greenrobot.greendao.annotation.Transient
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.Date
;
...
...
@@ -59,10 +61,13 @@ public class OrderDetail implements Serializable {
private
int
bgColor
;
//字體色
private
int
fontColor
;
//是否组合商品 1-组合商品 2-组合商品的子商品
private
int
ComboLevel
=
0
;
//套餐食品是否自動跟餐
private
boolean
isComboAuto
=
false
;
/**動態的最大選中數*/
private
String
currentMaxNumber
=
""
;
//"food" or "discount" or "modifiy"
private
int
prop
=
FOOD_PROP
;
/**
...
...
@@ -249,6 +254,7 @@ public class OrderDetail implements Serializable {
this
.
status
=
orderDetail
.
status
;
this
.
printSeting
=
orderDetail
.
printSeting
;
this
.
ktPrintMainItem
=
orderDetail
.
ktPrintMainItem
;
this
.
currentMaxNumber
=
orderDetail
.
currentMaxNumber
;
}
public
int
getSelected
()
{
...
...
@@ -611,6 +617,14 @@ public class OrderDetail implements Serializable {
this
.
ktPrintMainItem
=
ktPrintMainItem
;
}
public
String
getCurrentMaxNumber
()
{
return
currentMaxNumber
;
}
public
void
setCurrentMaxNumber
(
String
currentMaxNumber
)
{
this
.
currentMaxNumber
=
currentMaxNumber
;
}
/**
* 已送單食品轉換
*
...
...
@@ -725,31 +739,32 @@ public class OrderDetail implements Serializable {
/**
* 主食品轉換
*
* @param food
s
* @param food
* @param number
* @return
*/
public
static
OrderDetail
foodTransOrderDetails
(
Food
food
s
,
int
number
)
{
public
static
OrderDetail
foodTransOrderDetails
(
Food
food
,
int
number
)
{
OrderDetail
orderDetail
=
new
OrderDetail
();
orderDetail
.
setProductName
(
food
s
.
getFoodName
());
orderDetail
.
setTopId
(
food
s
.
getTopId
());
orderDetail
.
setProductName
(
food
.
getFoodName
());
orderDetail
.
setTopId
(
food
.
getTopId
());
orderDetail
.
setId
(
0
);
orderDetail
.
setParentId
(
0
);
orderDetail
.
setProductId
(
food
s
.
getId
());
orderDetail
.
setProductId
(
food
.
getId
());
// orderDetail.setParentId(foods.getParentId());
orderDetail
.
setUnit_price
(
food
s
.
getPrice
());
orderDetail
.
setUnit_price
(
food
.
getPrice
());
orderDetail
.
setPrice
(
number
*
orderDetail
.
getUnit_price
());
orderDetail
.
setNumber
(
number
);
orderDetail
.
setOrderId
(
MyOrderManage
.
getInstance
().
getOrderId
());
orderDetail
.
setPrintseting
(
food
s
.
getPrintSeting
());
orderDetail
.
setPrintseting
(
food
.
getPrintSeting
());
orderDetail
.
setIsfood
(
true
);
orderDetail
.
setNew
(
true
);
orderDetail
.
setType
(
FOOD_TYPE
);
orderDetail
.
setItemType
(
1
);
orderDetail
.
setProp
(
FOOD_PROP
);
orderDetail
.
setAutoMod
(
food
s
.
getAutoMod
());
int
comboLevel
=
food
s
.
isComboFood
()
?
1
:
0
;
orderDetail
.
setAutoMod
(
food
.
getAutoMod
());
int
comboLevel
=
food
.
isComboFood
()
?
1
:
0
;
orderDetail
.
setComboLevel
(
comboLevel
);
orderDetail
.
setCurrentMaxNumber
(
food
.
getCurrentMaxNumber
());
return
orderDetail
;
}
...
...
@@ -792,6 +807,7 @@ public class OrderDetail implements Serializable {
}
else
{
orderDetail
.
setSelected
(
1
);
}
orderDetail
.
setCurrentMaxNumber
(
foodCombo
.
getCurrentMaxNumber
());
return
orderDetail
;
}
...
...
@@ -823,6 +839,7 @@ public class OrderDetail implements Serializable {
orderDetail
.
setProp
(
MODIFIER_PROP
);
//手动点击细项 才将子食品作为主体被选中
orderDetail
.
setSelected
(
2
);
orderDetail
.
setCurrentMaxNumber
(
modifier
.
getCurrentMaxNumber
());
return
orderDetail
;
}
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/base/common/bean/PayMethod.java
View file @
ff6f0816
...
...
@@ -40,6 +40,9 @@ public class PayMethod {
private
int
payModeSize
=
14
;
private
int
payMoneySize
=
14
;
public
static
final
int
PAY_TYPE_CASH
=
1001
;
public
PayMethod
(
int
id
,
String
payName
,
String
createTime
,
String
remarks
,
String
NAME
,
String
NAME2
,
String
NAME3
,
String
PAYWAY
)
{
this
.
id
=
id
;
this
.
payName
=
payName
;
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/base/common/bean/TableBean.java
View file @
ff6f0816
...
...
@@ -73,6 +73,8 @@ public class TableBean {
* person : 2
* useStatus: 0
* sort : 0
* minSeatCount : 2
* maxSeatCount : 8
*/
private
int
id
;
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/base/common/bean/mealManage/MyOrderManage.java
View file @
ff6f0816
package
com
.
gingersoft
.
gsa
.
cloud
.
base
.
common
.
bean
.
mealManage
;
import
android.app.Activity
;
import
android.text.TextUtils
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.common.bean.BillOrderMoney
;
import
com.gingersoft.gsa.cloud.base.common.bean.OrderBean
;
import
com.gingersoft.gsa.cloud.base.common.bean.OrderDetail
;
import
com.gingersoft.gsa.cloud.base.common.bean.PayMethod
;
import
com.gingersoft.gsa.cloud.print.bean.OrderDetails
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.CommonTipDialog
;
import
com.jess.arms.utils.ArmsUtils
;
import
java.util.ArrayList
;
import
java.util.Date
;
...
...
@@ -157,9 +161,17 @@ public class MyOrderManage {
}
private
void
change_food_number
(
OrderDetail
orderFood
,
int
number
)
{
orderFood
.
setNumber
(
number
);
String
currentMaxNumber
=
orderFood
.
getCurrentMaxNumber
();
if
(!
TextUtils
.
isEmpty
(
currentMaxNumber
))
{
if
(
number
>
Integer
.
parseInt
(
currentMaxNumber
))
{
showSoldDialog
(
orderFood
);
orderFood
.
setNumber
(
Integer
.
parseInt
(
currentMaxNumber
));
}
else
{
orderFood
.
setNumber
(
number
);
}
}
else
{
orderFood
.
setNumber
(
number
);
}
setCalculatePrice
(
orderFood
);
}
...
...
@@ -180,14 +192,29 @@ public class MyOrderManage {
OrderDetail
datasBean
=
orderFoodList
.
get
(
i
);
if
(
datasBean
.
getParentIndex
()
==
parentIndex
)
{
// if (datasBean.getNumber() == 1) {
String
currentMaxNumber
=
datasBean
.
getCurrentMaxNumber
();
if
(!
TextUtils
.
isEmpty
(
currentMaxNumber
))
{
if
(
number
>
Integer
.
parseInt
(
currentMaxNumber
))
{
datasBean
.
setNumber
(
Integer
.
parseInt
(
currentMaxNumber
));
}
else
{
datasBean
.
setNumber
(
number
);
}
}
else
{
datasBean
.
setNumber
(
number
);
setCalculatePrice
(
datasBean
);
}
// datasBean.setNumber(number);
setCalculatePrice
(
datasBean
);
// }
}
}
}
}
private
void
showSoldDialog
(
OrderDetail
orderDetail
)
{
String
msg
=
"["
+
orderDetail
.
getProductName
()
+
"]"
+
"已售罄"
;
CommonTipDialog
.
showSurpisedDialog
(
GsaCloudApplication
.
getAppContext
().
getCurrentActivity
(),
msg
,
null
,
null
,
null
,
null
,
null
);
}
// private void change_child_number(OrderDetail orderFood, int number) {
//
// //每个组子项最大选择数量
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/base/utils/StringUtils.java
0 → 100644
View file @
ff6f0816
package
com
.
gingersoft
.
gsa
.
cloud
.
base
.
utils
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
StringUtils
{
/**
* 生成指定长度字符串,不足位右补空格,超出換行
*
* @param value
* @param totalLen
* @return
*/
public
static
String
[]
formatOrderPrintRow
(
String
value
,
int
totalLen
)
{
String
[]
strs
=
new
String
[
2
];
int
valueLength
=
0
;
String
chinese
=
"[\u4e00-\u9fa5]"
;
for
(
int
i
=
0
;
i
<
value
.
length
();
i
++)
{
String
temp
=
value
.
substring
(
i
,
i
+
1
);
if
(
temp
.
matches
(
chinese
))
{
valueLength
+=
2
;
}
else
{
valueLength
+=
1
;
}
}
if
(
totalLen
>
valueLength
)
{
int
temp
=
totalLen
-
valueLength
;
for
(
int
i
=
0
;
i
<
temp
;
i
++)
{
value
+=
" "
;
}
strs
[
0
]
=
value
;
}
else
{
String
startValue
=
value
.
substring
(
0
,
9
);
String
endValue
=
value
.
substring
(
9
,
value
.
length
());
strs
[
0
]
=
startValue
;
strs
[
1
]
=
endValue
;
}
return
strs
;
}
public
static
String
rightMakeupSpace
(
String
value
,
int
totalLen
)
{
int
valueLength
=
0
;
String
chinese
=
"[\u4e00-\u9fa5]"
;
for
(
int
i
=
0
;
i
<
value
.
length
();
i
++)
{
String
temp
=
value
.
substring
(
i
,
i
+
1
);
if
(
temp
.
matches
(
chinese
))
{
valueLength
+=
2
;
}
else
{
valueLength
+=
1
;
}
}
if
(
totalLen
>
valueLength
)
{
int
temp
=
totalLen
-
valueLength
;
for
(
int
i
=
0
;
i
<
temp
;
i
++)
{
value
+=
" "
;
}
}
return
value
;
}
public
static
String
leftMakeupSpace
(
String
value
,
int
totalLen
)
{
int
valueLength
=
0
;
String
chinese
=
"[\u4e00-\u9fa5]"
;
for
(
int
i
=
0
;
i
<
value
.
length
();
i
++)
{
String
temp
=
value
.
substring
(
i
,
i
+
1
);
if
(
temp
.
matches
(
chinese
))
{
valueLength
+=
2
;
}
else
{
valueLength
+=
1
;
}
}
if
(
totalLen
>
valueLength
)
{
int
temp
=
totalLen
-
valueLength
;
for
(
int
i
=
0
;
i
<
temp
;
i
++)
{
value
=
" "
+
value
;
}
}
return
value
;
}
public
static
int
getChineseValueLength
(
String
value
)
{
int
valueLength
=
0
;
String
chinese
=
"[\u4e00-\u9fa5]"
;
for
(
int
i
=
0
;
i
<
value
.
length
();
i
++)
{
String
temp
=
value
.
substring
(
i
,
i
+
1
);
if
(
temp
.
matches
(
chinese
))
{
valueLength
+=
2
;
}
else
{
valueLength
+=
1
;
}
}
return
valueLength
;
}
/**
* 给定一个长字符串内容,返回一个数组
*
* @param content 所有的内容
* @param count 需要每段截取的长度
* @return 所有分段的数组list
*/
public
static
List
<
String
>
getListFromContent
(
String
content
,
int
count
)
{
List
<
String
>
list
=
new
ArrayList
<>();
// 获取String的总长度
int
contentLength
=
content
.
length
();
if
(
contentLength
<
count
)
{
list
.
add
(
content
);
}
else
{
int
begin
=
0
;
// 获取需要切割多少段
int
cutCount
=
contentLength
/
count
;
int
cutCounts
=
contentLength
%
count
;
// 获取切割段的长度
if
(
cutCounts
!=
0
)
{
cutCount
++;
}
for
(
int
i
=
1
;
i
<=
cutCount
;
i
++)
{
String
temp
;
// 不是最后一段
if
(
i
!=
cutCount
)
{
temp
=
content
.
substring
(
begin
,
count
*
i
);
}
else
{
temp
=
content
.
substring
(
begin
,
contentLength
);
}
begin
=
count
*
i
;
list
.
add
(
temp
);
}
}
return
list
;
}
/**
* @param content
* @param begin
* @param end
* @return
*/
public
static
String
getPhoneByBlurCharAfter
(
String
content
,
int
begin
,
int
end
)
{
if
(
begin
>=
content
.
length
()
||
begin
<
0
)
{
return
content
;
}
if
(
end
>=
content
.
length
()
||
end
<
0
)
{
return
content
;
}
if
(
begin
>=
end
)
{
return
content
;
}
String
starStr
=
""
;
for
(
int
i
=
begin
;
i
<
end
;
i
++)
{
// starStr = starStr + GSAApplication.androidSetting.getvBlurChar();
}
return
content
.
substring
(
0
,
begin
)
+
starStr
+
content
.
substring
(
end
,
content
.
length
());
}
/**
* 超出的字符串使用替代符顯示(...)
*
* @param value
* @param omitBlur
* @param needOmitLength
* @return
*/
public
static
String
getEllipsizeStringByOmitBlur
(
String
value
,
String
omitBlur
,
int
needOmitLength
)
{
if
(
value
.
length
()
>
needOmitLength
)
{
return
value
.
substring
(
0
,
needOmitLength
-
1
)
+
omitBlur
;
}
return
value
;
}
}
\ No newline at end of file
base-module/src/main/java/com/gingersoft/gsa/cloud/base/utils/encryption/MD5.java
deleted
100644 → 0
View file @
2fd4d7af
package
com
.
gingersoft
.
gsa
.
cloud
.
base
.
utils
.
encryption
;
import
java.security.MessageDigest
;
import
java.security.NoSuchAlgorithmException
;
public
class
MD5
{
private
final
static
String
[]
strDigits
=
{
"0"
,
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
,
"7"
,
"8"
,
"9"
,
"a"
,
"b"
,
"c"
,
"d"
,
"e"
,
"f"
};
public
MD5
()
{
}
private
static
String
byteToArrayString
(
byte
bByte
)
{
int
iRet
=
bByte
;
// System.out.println("iRet="+iRet);
if
(
iRet
<
0
)
{
iRet
+=
256
;
}
int
iD1
=
iRet
/
16
;
int
iD2
=
iRet
%
16
;
return
strDigits
[
iD1
]
+
strDigits
[
iD2
];
}
private
static
String
byteToNum
(
byte
bByte
)
{
int
iRet
=
bByte
;
System
.
out
.
println
(
"iRet1="
+
iRet
);
if
(
iRet
<
0
)
{
iRet
+=
256
;
}
return
String
.
valueOf
(
iRet
);
}
private
static
String
byteToString
(
byte
[]
bByte
)
{
StringBuffer
sBuffer
=
new
StringBuffer
();
for
(
int
i
=
0
;
i
<
bByte
.
length
;
i
++)
{
sBuffer
.
append
(
byteToArrayString
(
bByte
[
i
]));
}
return
sBuffer
.
toString
();
}
public
static
String
GetMD5Code
(
String
strObj
)
{
String
resultString
=
null
;
try
{
resultString
=
new
String
(
strObj
);
MessageDigest
md
=
MessageDigest
.
getInstance
(
"MD5"
);
// md.digest()
resultString
=
byteToString
(
md
.
digest
(
strObj
.
getBytes
()));
}
catch
(
NoSuchAlgorithmException
ex
)
{
ex
.
printStackTrace
();
}
return
resultString
;
}
// 加密后解密
public
static
String
JM
(
String
inStr
)
{
char
[]
a
=
inStr
.
toCharArray
();
for
(
int
i
=
0
;
i
<
a
.
length
;
i
++)
{
a
[
i
]
=
(
char
)
(
a
[
i
]
^
't'
);
}
String
k
=
new
String
(
a
);
return
k
;
}
}
\ No newline at end of file
base-module/src/main/java/com/gingersoft/gsa/cloud/constans/UserConstans.java
View file @
ff6f0816
...
...
@@ -20,6 +20,7 @@ public class UserConstans {
public
static
String
restaurantName
=
"restaurant_name"
;
public
static
String
brandId
=
"brand_id"
;
public
static
String
brandName
=
"brand_name"
;
public
static
String
gsPosShopId
=
"gsPosShopId"
;
/**當前賬號下所有餐檯品牌Json*/
public
static
String
brandRestaurantInfos
=
"brand_restaurant_infos"
;
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/database/bean/Modifier.java
View file @
ff6f0816
...
...
@@ -403,7 +403,10 @@ public class Modifier {
/**字體顏色*/
private
int
fontColor
=
Color
.
parseColor
(
"#FFFFFF"
);
@Transient
/**最大可選數*/
private
int
selectQty
;
/**最大選中數*/
@Transient
private
String
maxNumber
=
""
;
/**動態的最大選中數*/
@Transient
...
...
@@ -1119,4 +1122,11 @@ public class Modifier {
this
.
isStatistic
=
isStatistic
;
}
public
int
getSelectQty
()
{
return
selectQty
;
}
public
void
setSelectQty
(
int
selectQty
)
{
this
.
selectQty
=
selectQty
;
}
}
base-module/src/main/java/com/gingersoft/gsa/cloud/database/greendao/DaoMaster.java
View file @
ff6f0816
...
...
@@ -28,10 +28,10 @@ public class DaoMaster extends AbstractDaoMaster {
FoodComboDao
.
createTable
(
db
,
ifNotExists
);
FoodModifierDao
.
createTable
(
db
,
ifNotExists
);
FunctionDao
.
createTable
(
db
,
ifNotExists
);
LanguageDao
.
createTable
(
db
,
ifNotExists
);
ModifierDao
.
createTable
(
db
,
ifNotExists
);
PrinterDeviceBeanDao
.
createTable
(
db
,
ifNotExists
);
PrintModelBeanDao
.
createTable
(
db
,
ifNotExists
);
LanguageDao
.
createTable
(
db
,
ifNotExists
);
PrintCurrencyBeanDao
.
createTable
(
db
,
ifNotExists
);
}
...
...
@@ -44,10 +44,10 @@ public class DaoMaster extends AbstractDaoMaster {
FoodComboDao
.
dropTable
(
db
,
ifExists
);
FoodModifierDao
.
dropTable
(
db
,
ifExists
);
FunctionDao
.
dropTable
(
db
,
ifExists
);
LanguageDao
.
dropTable
(
db
,
ifExists
);
ModifierDao
.
dropTable
(
db
,
ifExists
);
PrinterDeviceBeanDao
.
dropTable
(
db
,
ifExists
);
PrintModelBeanDao
.
dropTable
(
db
,
ifExists
);
LanguageDao
.
dropTable
(
db
,
ifExists
);
PrintCurrencyBeanDao
.
dropTable
(
db
,
ifExists
);
}
...
...
@@ -74,10 +74,10 @@ public class DaoMaster extends AbstractDaoMaster {
registerDaoClass
(
FoodComboDao
.
class
);
registerDaoClass
(
FoodModifierDao
.
class
);
registerDaoClass
(
FunctionDao
.
class
);
registerDaoClass
(
LanguageDao
.
class
);
registerDaoClass
(
ModifierDao
.
class
);
registerDaoClass
(
PrinterDeviceBeanDao
.
class
);
registerDaoClass
(
PrintModelBeanDao
.
class
);
registerDaoClass
(
LanguageDao
.
class
);
registerDaoClass
(
PrintCurrencyBeanDao
.
class
);
}
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/database/greendao/DaoSession.java
View file @
ff6f0816
...
...
@@ -15,10 +15,10 @@ import com.gingersoft.gsa.cloud.database.bean.Food;
import
com.gingersoft.gsa.cloud.database.bean.FoodCombo
;
import
com.gingersoft.gsa.cloud.database.bean.FoodModifier
;
import
com.gingersoft.gsa.cloud.database.bean.Function
;
import
com.gingersoft.gsa.cloud.database.bean.Language
;
import
com.gingersoft.gsa.cloud.database.bean.Modifier
;
import
com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean
;
import
com.gingersoft.gsa.cloud.database.bean.PrintModelBean
;
import
com.gingersoft.gsa.cloud.database.bean.Language
;
import
com.gingersoft.gsa.cloud.database.bean.PrintCurrencyBean
;
import
com.gingersoft.gsa.cloud.database.greendao.ComboItemDao
;
...
...
@@ -28,10 +28,10 @@ import com.gingersoft.gsa.cloud.database.greendao.FoodDao;
import
com.gingersoft.gsa.cloud.database.greendao.FoodComboDao
;
import
com.gingersoft.gsa.cloud.database.greendao.FoodModifierDao
;
import
com.gingersoft.gsa.cloud.database.greendao.FunctionDao
;
import
com.gingersoft.gsa.cloud.database.greendao.LanguageDao
;
import
com.gingersoft.gsa.cloud.database.greendao.ModifierDao
;
import
com.gingersoft.gsa.cloud.database.greendao.PrinterDeviceBeanDao
;
import
com.gingersoft.gsa.cloud.database.greendao.PrintModelBeanDao
;
import
com.gingersoft.gsa.cloud.database.greendao.LanguageDao
;
import
com.gingersoft.gsa.cloud.database.greendao.PrintCurrencyBeanDao
;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
...
...
@@ -50,10 +50,10 @@ public class DaoSession extends AbstractDaoSession {
private
final
DaoConfig
foodComboDaoConfig
;
private
final
DaoConfig
foodModifierDaoConfig
;
private
final
DaoConfig
functionDaoConfig
;
private
final
DaoConfig
languageDaoConfig
;
private
final
DaoConfig
modifierDaoConfig
;
private
final
DaoConfig
printerDeviceBeanDaoConfig
;
private
final
DaoConfig
printModelBeanDaoConfig
;
private
final
DaoConfig
languageDaoConfig
;
private
final
DaoConfig
printCurrencyBeanDaoConfig
;
private
final
ComboItemDao
comboItemDao
;
...
...
@@ -63,10 +63,10 @@ public class DaoSession extends AbstractDaoSession {
private
final
FoodComboDao
foodComboDao
;
private
final
FoodModifierDao
foodModifierDao
;
private
final
FunctionDao
functionDao
;
private
final
LanguageDao
languageDao
;
private
final
ModifierDao
modifierDao
;
private
final
PrinterDeviceBeanDao
printerDeviceBeanDao
;
private
final
PrintModelBeanDao
printModelBeanDao
;
private
final
LanguageDao
languageDao
;
private
final
PrintCurrencyBeanDao
printCurrencyBeanDao
;
public
DaoSession
(
Database
db
,
IdentityScopeType
type
,
Map
<
Class
<?
extends
AbstractDao
<?,
?>>,
DaoConfig
>
...
...
@@ -94,6 +94,9 @@ public class DaoSession extends AbstractDaoSession {
functionDaoConfig
=
daoConfigMap
.
get
(
FunctionDao
.
class
).
clone
();
functionDaoConfig
.
initIdentityScope
(
type
);
languageDaoConfig
=
daoConfigMap
.
get
(
LanguageDao
.
class
).
clone
();
languageDaoConfig
.
initIdentityScope
(
type
);
modifierDaoConfig
=
daoConfigMap
.
get
(
ModifierDao
.
class
).
clone
();
modifierDaoConfig
.
initIdentityScope
(
type
);
...
...
@@ -103,9 +106,6 @@ public class DaoSession extends AbstractDaoSession {
printModelBeanDaoConfig
=
daoConfigMap
.
get
(
PrintModelBeanDao
.
class
).
clone
();
printModelBeanDaoConfig
.
initIdentityScope
(
type
);
languageDaoConfig
=
daoConfigMap
.
get
(
LanguageDao
.
class
).
clone
();
languageDaoConfig
.
initIdentityScope
(
type
);
printCurrencyBeanDaoConfig
=
daoConfigMap
.
get
(
PrintCurrencyBeanDao
.
class
).
clone
();
printCurrencyBeanDaoConfig
.
initIdentityScope
(
type
);
...
...
@@ -116,10 +116,10 @@ public class DaoSession extends AbstractDaoSession {
foodComboDao
=
new
FoodComboDao
(
foodComboDaoConfig
,
this
);
foodModifierDao
=
new
FoodModifierDao
(
foodModifierDaoConfig
,
this
);
functionDao
=
new
FunctionDao
(
functionDaoConfig
,
this
);
languageDao
=
new
LanguageDao
(
languageDaoConfig
,
this
);
modifierDao
=
new
ModifierDao
(
modifierDaoConfig
,
this
);
printerDeviceBeanDao
=
new
PrinterDeviceBeanDao
(
printerDeviceBeanDaoConfig
,
this
);
printModelBeanDao
=
new
PrintModelBeanDao
(
printModelBeanDaoConfig
,
this
);
languageDao
=
new
LanguageDao
(
languageDaoConfig
,
this
);
printCurrencyBeanDao
=
new
PrintCurrencyBeanDao
(
printCurrencyBeanDaoConfig
,
this
);
registerDao
(
ComboItem
.
class
,
comboItemDao
);
...
...
@@ -129,10 +129,10 @@ public class DaoSession extends AbstractDaoSession {
registerDao
(
FoodCombo
.
class
,
foodComboDao
);
registerDao
(
FoodModifier
.
class
,
foodModifierDao
);
registerDao
(
Function
.
class
,
functionDao
);
registerDao
(
Language
.
class
,
languageDao
);
registerDao
(
Modifier
.
class
,
modifierDao
);
registerDao
(
PrinterDeviceBean
.
class
,
printerDeviceBeanDao
);
registerDao
(
PrintModelBean
.
class
,
printModelBeanDao
);
registerDao
(
Language
.
class
,
languageDao
);
registerDao
(
PrintCurrencyBean
.
class
,
printCurrencyBeanDao
);
}
...
...
@@ -144,10 +144,10 @@ public class DaoSession extends AbstractDaoSession {
foodComboDaoConfig
.
clearIdentityScope
();
foodModifierDaoConfig
.
clearIdentityScope
();
functionDaoConfig
.
clearIdentityScope
();
languageDaoConfig
.
clearIdentityScope
();
modifierDaoConfig
.
clearIdentityScope
();
printerDeviceBeanDaoConfig
.
clearIdentityScope
();
printModelBeanDaoConfig
.
clearIdentityScope
();
languageDaoConfig
.
clearIdentityScope
();
printCurrencyBeanDaoConfig
.
clearIdentityScope
();
}
...
...
@@ -179,6 +179,10 @@ public class DaoSession extends AbstractDaoSession {
return
functionDao
;
}
public
LanguageDao
getLanguageDao
()
{
return
languageDao
;
}
public
ModifierDao
getModifierDao
()
{
return
modifierDao
;
}
...
...
@@ -191,10 +195,6 @@ public class DaoSession extends AbstractDaoSession {
return
printModelBeanDao
;
}
public
LanguageDao
getLanguageDao
()
{
return
languageDao
;
}
public
PrintCurrencyBeanDao
getPrintCurrencyBeanDao
()
{
return
printCurrencyBeanDao
;
}
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/database/utils/ModifierDaoUtils.java
View file @
ff6f0816
...
...
@@ -400,7 +400,7 @@ public class ModifierDaoUtils {
order
.
setInvisible
(
c
.
getLong
(
c
.
getColumnIndex
(
"INVISIBLE"
)));
if
(
fid
!=
0
)
{
//非公共細項
order
.
set
MaxNumber
(
String
.
valueOf
(
c
.
getInt
(
c
.
getColumnIndex
(
"MAX_QTY"
)
)));
order
.
set
SelectQty
(
c
.
getInt
(
c
.
getColumnIndex
(
"MAX_QTY"
)));
String
defmodifier
=
c
.
getString
(
c
.
getColumnIndex
(
"DEFMODIFIER"
));
if
(!
TextUtils
.
isEmpty
(
defmodifier
)
&&
!
", "
.
equals
(
defmodifier
))
{
order
.
setDefmodifier
(
defmodifier
);
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/globalconfig/applyOptions/MyResponseErrorListener.java
View file @
ff6f0816
...
...
@@ -59,6 +59,7 @@ public class MyResponseErrorListener implements ResponseErrorListener {
ToastUtils
.
show
(
context
,
msg
);
}
}
private
String
convertStatusCode
(
Context
context
,
HttpException
httpException
)
{
String
msg
=
null
;
if
(
httpException
.
code
()
==
500
)
{
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/adapter/BasTextSectiontAdapter.java
View file @
ff6f0816
...
...
@@ -7,7 +7,7 @@ import android.widget.TextView;
import
com.gingersoft.gsa.cloud.base.R
;
import
com.gingersoft.gsa.cloud.base.R2
;
import
com.gingersoft.gsa.cloud.ui.bean.view.SectionHeader
;
import
com.gingersoft.gsa.cloud.ui.bean.view.Section
Tex
tItem
;
import
com.gingersoft.gsa.cloud.ui.bean.view.Section
Restauran
tItem
;
import
com.gingersoft.gsa.cloud.ui.view.section.BaseTextSection
;
import
com.gingersoft.gsa.cloud.ui.view.section.QDSectionHeaderView
;
import
com.qmuiteam.qmui.widget.section.QMUIDefaultStickySectionAdapter
;
...
...
@@ -25,7 +25,7 @@ import butterknife.ButterKnife;
* 修订历史:2020-02-09
* 描述:
*/
public
class
BasTextSectiontAdapter
extends
QMUIDefaultStickySectionAdapter
<
SectionHeader
,
Section
Tex
tItem
>
{
public
class
BasTextSectiontAdapter
extends
QMUIDefaultStickySectionAdapter
<
SectionHeader
,
Section
Restauran
tItem
>
{
@NonNull
@Override
...
...
@@ -40,7 +40,7 @@ public class BasTextSectiontAdapter extends QMUIDefaultStickySectionAdapter<Sect
}
@Override
protected
void
onBindSectionHeader
(
QMUIStickySectionAdapter
.
ViewHolder
holder
,
int
position
,
QMUISection
<
SectionHeader
,
Section
Tex
tItem
>
section
)
{
protected
void
onBindSectionHeader
(
QMUIStickySectionAdapter
.
ViewHolder
holder
,
int
position
,
QMUISection
<
SectionHeader
,
Section
Restauran
tItem
>
section
)
{
super
.
onBindSectionHeader
(
holder
,
position
,
section
);
QDSectionHeaderView
itemView
=
(
QDSectionHeaderView
)
holder
.
itemView
;
itemView
.
render
(
section
.
getHeader
(),
section
.
isFold
());
...
...
@@ -54,10 +54,10 @@ public class BasTextSectiontAdapter extends QMUIDefaultStickySectionAdapter<Sect
}
@Override
protected
void
onBindSectionItem
(
QMUIStickySectionAdapter
.
ViewHolder
holder
,
int
position
,
QMUISection
<
SectionHeader
,
Section
Tex
tItem
>
section
,
int
itemIndex
)
{
protected
void
onBindSectionItem
(
QMUIStickySectionAdapter
.
ViewHolder
holder
,
int
position
,
QMUISection
<
SectionHeader
,
Section
Restauran
tItem
>
section
,
int
itemIndex
)
{
super
.
onBindSectionItem
(
holder
,
position
,
section
,
itemIndex
);
ViewHolder
viewHolder
=
(
ViewHolder
)
holder
;
viewHolder
.
tv_name
.
setText
(
section
.
getItemAt
(
itemIndex
).
get
Text
());
viewHolder
.
tv_name
.
setText
(
section
.
getItemAt
(
itemIndex
).
get
RestaurantsBean
().
getRestaurantName
());
}
public
class
ViewHolder
extends
QMUIStickySectionAdapter
.
ViewHolder
{
...
...
@@ -73,8 +73,8 @@ public class BasTextSectiontAdapter extends QMUIDefaultStickySectionAdapter<Sect
return
tv_name
;
}
public
Section
TextItem
getSectionTex
tItem
(
int
position
)
{
Section
Tex
tItem
item
=
getSectionItem
(
position
);
public
Section
RestaurantItem
getSectionRestauran
tItem
(
int
position
)
{
Section
Restauran
tItem
item
=
getSectionItem
(
position
);
return
item
;
}
}
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/adapter/BillMethodAdapter.java
View file @
ff6f0816
package
com
.
gingersoft
.
gsa
.
cloud
.
ui
.
adapter
;
import
android.text.TextUtils
;
import
androidx.annotation.Nullable
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
...
...
@@ -22,7 +24,12 @@ public class BillMethodAdapter extends BaseQuickAdapter<PayMethod, BaseViewHolde
@Override
protected
void
convert
(
BaseViewHolder
helper
,
PayMethod
item
)
{
QMUIAlphaTextView
tv_bill_method_name
=
helper
.
getView
(
R
.
id
.
tv_bill_method_name
);
tv_bill_method_name
.
setText
(
item
.
getPayName
());
if
(
TextUtils
.
isEmpty
(
item
.
getPayName
()))
{
tv_bill_method_name
.
setText
(
" "
);
}
else
{
tv_bill_method_name
.
setText
(
item
.
getPayName
());
}
tv_bill_method_name
.
setTextSize
(
item
.
getPayModeSize
());
tv_bill_method_name
.
setTextColor
(
item
.
getPayModeTextColor
());
}
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/bean/mode/BrandsBean.java
View file @
ff6f0816
...
...
@@ -47,6 +47,7 @@ public class BrandsBean {
private
int
restaurantId
;
private
String
restaurantName
;
private
String
gsPosShopId
;
public
int
getRestaurantId
()
{
return
restaurantId
;
...
...
@@ -64,11 +65,20 @@ public class BrandsBean {
this
.
restaurantName
=
restaurantName
;
}
public
String
getGsPosShopId
()
{
return
gsPosShopId
;
}
public
void
setGsPosShopId
(
String
gsPosShopId
)
{
this
.
gsPosShopId
=
gsPosShopId
;
}
@Override
public
String
toString
()
{
return
"RestaurantsBean{"
+
"restaurantId="
+
restaurantId
+
", restaurantName='"
+
restaurantName
+
'\''
+
", gsPosShopId='"
+
gsPosShopId
+
'\''
+
'}'
;
}
}
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/bean/view/SectionRestaurantItem.java
0 → 100644
View file @
ff6f0816
package
com
.
gingersoft
.
gsa
.
cloud
.
ui
.
bean
.
view
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.BrandsBean
;
import
com.qmuiteam.qmui.widget.section.QMUISection.Model
;
import
java.util.Objects
;
/**
* 單個文字
*/
public
class
SectionRestaurantItem
implements
Model
<
SectionRestaurantItem
>
{
public
BrandsBean
.
BrandsData
.
RestaurantsBean
restaurantsBean
;
public
SectionRestaurantItem
(
BrandsBean
.
BrandsData
.
RestaurantsBean
restaurantsBean
)
{
this
.
restaurantsBean
=
restaurantsBean
;
}
public
BrandsBean
.
BrandsData
.
RestaurantsBean
getRestaurantsBean
()
{
return
restaurantsBean
;
}
@Override
public
SectionRestaurantItem
cloneForDiff
()
{
return
new
SectionRestaurantItem
(
restaurantsBean
);
}
@Override
public
boolean
isSameItem
(
SectionRestaurantItem
other
)
{
return
Objects
.
equals
(
restaurantsBean
,
other
.
restaurantsBean
);
}
@Override
public
boolean
isSameContent
(
SectionRestaurantItem
other
)
{
return
true
;
}
}
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/view/BeveLabelView.java
0 → 100644
View file @
ff6f0816
package
com
.
gingersoft
.
gsa
.
cloud
.
ui
.
view
;
import
android.content.Context
;
import
android.content.res.TypedArray
;
import
android.graphics.Canvas
;
import
android.graphics.Color
;
import
android.graphics.Paint
;
import
android.graphics.Path
;
import
android.text.TextUtils
;
import
android.util.AttributeSet
;
import
android.util.TypedValue
;
import
android.view.View
;
import
com.gingersoft.gsa.cloud.base.R
;
import
androidx.annotation.Nullable
;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
* 创建日期:2020-07-18
* 修订历史:2020-07-18
* 描述:
*/
public
class
BeveLabelView
extends
View
{
private
final
static
int
MODE_LEFT_TOP
=
0
;
private
final
static
int
MODE_RIGHT_TOP
=
1
;
private
final
static
int
MODE_LEFT_BOTTOM
=
2
;
private
final
static
int
MODE_RIGHT_BOTTOM
=
3
;
private
final
static
int
MODE_LEFT_TOP_FILL
=
4
;
private
final
static
int
MODE_RIGHT_TOP_FILL
=
5
;
private
final
static
int
MODE_LEFT_BOTTOM_FILL
=
6
;
private
final
static
int
MODE_RIGHT_BOTTOM_FILL
=
7
;
private
int
mBgColor
;
//背景颜色
private
String
mText
;
//显示文字
private
int
mTextSize
;
//文字大小
private
int
mTextColor
;
//文字颜色
private
int
mLength
;
//标题长度
private
int
mCorner
;
//圆角
private
int
mMode
;
//显示模式
private
Paint
mPaint
;
private
Path
path
;
private
int
mWidth
,
mHeight
;
private
int
mRotate
=
45
;
//因为默认模式是1,所以这时是45度
private
int
mX
,
mY
;
public
BeveLabelView
(
Context
context
)
{
super
(
context
);
}
public
BeveLabelView
(
Context
context
,
@Nullable
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
TypedArray
array
=
context
.
obtainStyledAttributes
(
attrs
,
R
.
styleable
.
BeveLabelView
);
mBgColor
=
array
.
getColor
(
R
.
styleable
.
BeveLabelView_label_bg_color
,
Color
.
RED
);
//默认红色
mText
=
array
.
getString
(
R
.
styleable
.
BeveLabelView_label_text
);
mTextSize
=
array
.
getDimensionPixelOffset
(
R
.
styleable
.
BeveLabelView_label_text_size
,
sp2px
(
11
));
mTextColor
=
array
.
getColor
(
R
.
styleable
.
BeveLabelView_label_text_color
,
Color
.
WHITE
);
mLength
=
array
.
getDimensionPixelOffset
(
R
.
styleable
.
BeveLabelView_label_length
,
dip2px
(
40
));
mCorner
=
array
.
getDimensionPixelOffset
(
R
.
styleable
.
BeveLabelView_label_corner
,
0
);
mMode
=
array
.
getInt
(
R
.
styleable
.
BeveLabelView_label_mode
,
1
);
mPaint
=
new
Paint
(
Paint
.
ANTI_ALIAS_FLAG
);
mPaint
.
setAntiAlias
(
true
);
path
=
new
Path
();
if
(
TextUtils
.
isEmpty
(
mText
))
{
mText
=
"Label"
;
}
}
public
BeveLabelView
(
Context
context
,
@Nullable
AttributeSet
attrs
,
int
defStyleAttr
)
{
super
(
context
,
attrs
,
defStyleAttr
);
}
public
void
setLableText
(
String
text
)
{
this
.
mText
=
text
;
}
@Override
protected
void
onMeasure
(
int
widthMeasureSpec
,
int
heightMeasureSpec
)
{
super
.
onMeasure
(
widthMeasureSpec
,
heightMeasureSpec
);
mHeight
=
mWidth
=
MeasureSpec
.
getSize
(
widthMeasureSpec
);
}
@Override
protected
void
onDraw
(
Canvas
canvas
)
{
// super.onDraw (canvas);
mPaint
.
setColor
(
mBgColor
);
drawBackgroundText
(
canvas
);
}
private
void
drawBackgroundText
(
Canvas
canvas
)
{
if
(
mWidth
!=
mHeight
)
{
throw
new
IllegalStateException
(
"width must equal to height"
);
//标签view 是一个正方形,
}
switch
(
mMode
)
{
case
MODE_LEFT_TOP:
mCorner
=
0
;
//没有铺满的时候mCorner要归零;
leftTopMeasure
();
getLeftTop
();
break
;
case
MODE_RIGHT_TOP:
mCorner
=
0
;
rightTopMeasure
();
getRightTop
();
break
;
case
MODE_LEFT_BOTTOM:
mCorner
=
0
;
leftBottomMeasure
();
getLeftBottom
();
break
;
case
MODE_RIGHT_BOTTOM:
mCorner
=
0
;
rightBottomMeasure
();
getRightBottom
();
break
;
case
MODE_LEFT_TOP_FILL:
leftTopMeasure
();
getLeftTopFill
();
if
(
mCorner
!=
0
)
{
canvas
.
drawPath
(
path
,
mPaint
);
getLeftTop
();
}
break
;
case
MODE_RIGHT_TOP_FILL:
rightTopMeasure
();
getRightTopFill
();
if
(
mCorner
!=
0
)
{
canvas
.
drawPath
(
path
,
mPaint
);
getRightTop
();
}
break
;
case
MODE_LEFT_BOTTOM_FILL:
leftBottomMeasure
();
getLeftBottomFill
();
if
(
mCorner
!=
0
)
{
canvas
.
drawPath
(
path
,
mPaint
);
getLeftBottom
();
}
break
;
case
MODE_RIGHT_BOTTOM_FILL:
rightBottomMeasure
();
getRightBottomFill
();
if
(
mCorner
!=
0
)
{
canvas
.
drawPath
(
path
,
mPaint
);
getRightBottom
();
}
break
;
default
:
}
canvas
.
drawPath
(
path
,
mPaint
);
mPaint
.
setTextSize
(
mTextSize
);
mPaint
.
setTextAlign
(
Paint
.
Align
.
CENTER
);
mPaint
.
setColor
(
mTextColor
);
canvas
.
translate
(
mX
,
mY
);
canvas
.
rotate
(
mRotate
);
int
baseLineY
=
-(
int
)
(
mPaint
.
descent
()
+
mPaint
.
ascent
())
/
2
;
//基线中间点的y轴计算公式
canvas
.
drawText
(
mText
,
0
,
baseLineY
,
mPaint
);
}
private
void
rightBottomMeasure
()
{
mRotate
=
-
45
;
mY
=
mX
=
mWidth
/
2
+
mLength
/
4
;
}
private
void
leftBottomMeasure
()
{
mRotate
=
45
;
mX
=
mWidth
/
2
-
mLength
/
4
;
mY
=
mHeight
/
2
+
mLength
/
4
;
}
private
void
rightTopMeasure
()
{
mRotate
=
45
;
mX
=
mWidth
/
2
+
mLength
/
4
;
mY
=
mHeight
/
2
-
mLength
/
4
;
}
private
void
leftTopMeasure
()
{
mRotate
=
-
45
;
mY
=
mX
=
mWidth
/
2
-
mLength
/
4
;
}
//左上角铺满
private
void
getLeftTopFill
()
{
if
(
mCorner
!=
0
)
{
path
.
addRoundRect
(
0
,
0
,
mWidth
/
2
,
mHeight
/
2
,
new
float
[]{
mCorner
,
mCorner
,
0
,
0
,
0
,
0
,
0
,
0
},
Path
.
Direction
.
CW
);
}
else
{
path
.
moveTo
(
0
,
0
);
path
.
lineTo
(
mWidth
,
0
);
path
.
lineTo
(
0
,
mHeight
);
path
.
close
();
}
}
//左上角不铺满
private
void
getLeftTop
()
{
path
.
moveTo
(
mCorner
!=
0
?
mCorner
:
mWidth
-
mLength
,
0
);
path
.
lineTo
(
mWidth
,
0
);
path
.
lineTo
(
0
,
mHeight
);
path
.
lineTo
(
0
,
mCorner
!=
0
?
mCorner
:
mHeight
-
mLength
);
path
.
close
();
}
//左下角铺满
private
void
getLeftBottomFill
()
{
if
(
mCorner
!=
0
)
{
path
.
addRoundRect
(
0
,
mHeight
/
2
,
mWidth
/
2
,
mHeight
,
new
float
[]{
0
,
0
,
0
,
0
,
0
,
0
,
mCorner
,
mCorner
},
Path
.
Direction
.
CW
);
}
else
{
path
.
moveTo
(
0
,
0
);
path
.
lineTo
(
mWidth
,
mHeight
);
path
.
lineTo
(
0
,
mHeight
);
path
.
close
();
}
}
//左下角不铺满
private
void
getLeftBottom
()
{
path
.
moveTo
(
0
,
0
);
path
.
lineTo
(
mWidth
,
mHeight
);
path
.
lineTo
(
mCorner
!=
0
?
mCorner
:
mWidth
-
mLength
,
mHeight
);
path
.
lineTo
(
0
,
mCorner
!=
0
?
mHeight
-
mCorner
:
mLength
);
path
.
close
();
}
//右上角铺满
private
void
getRightTopFill
()
{
if
(
mCorner
!=
0
)
{
path
.
addRoundRect
(
mWidth
/
2
,
0
,
mWidth
,
mHeight
/
2
,
new
float
[]{
0
,
0
,
mCorner
,
mCorner
,
0
,
0
,
0
,
0
},
Path
.
Direction
.
CW
);
}
else
{
path
.
moveTo
(
0
,
0
);
path
.
lineTo
(
mWidth
,
0
);
path
.
lineTo
(
mWidth
,
mHeight
);
path
.
close
();
}
}
//右上角不铺满
private
void
getRightTop
()
{
path
.
moveTo
(
0
,
0
);
path
.
lineTo
(
mCorner
!=
0
?
mWidth
-
mCorner
:
mLength
,
0
);
path
.
lineTo
(
mWidth
,
mCorner
!=
0
?
mCorner
:
mHeight
-
mLength
);
path
.
lineTo
(
mWidth
,
mHeight
);
path
.
close
();
}
//右下角铺满
private
void
getRightBottomFill
()
{
if
(
mCorner
!=
0
)
{
path
.
addRoundRect
(
mWidth
/
2
,
mHeight
/
2
,
mWidth
,
mHeight
,
new
float
[]{
0
,
0
,
0
,
0
,
mCorner
,
mCorner
,
0
,
0
},
Path
.
Direction
.
CW
);
}
else
{
path
.
moveTo
(
mWidth
,
0
);
path
.
lineTo
(
mWidth
,
mHeight
);
path
.
lineTo
(
0
,
mHeight
);
path
.
close
();
}
}
//右下角不铺满
private
void
getRightBottom
()
{
path
.
moveTo
(
mWidth
,
0
);
path
.
lineTo
(
mWidth
,
mCorner
!=
0
?
mHeight
-
mCorner
:
mLength
);
path
.
lineTo
(
mCorner
!=
0
?
mWidth
-
mCorner
:
mLength
,
mHeight
);
path
.
lineTo
(
0
,
mHeight
);
path
.
close
();
}
/**
* @param sp 转换大小
*/
private
int
sp2px
(
int
sp
)
{
return
(
int
)
TypedValue
.
applyDimension
(
TypedValue
.
COMPLEX_UNIT_SP
,
sp
,
getResources
().
getDisplayMetrics
());
}
/**
* @param dip 转换大小
*/
private
int
dip2px
(
int
dip
)
{
return
(
int
)
TypedValue
.
applyDimension
(
TypedValue
.
COMPLEX_UNIT_DIP
,
dip
,
getResources
().
getDisplayMetrics
());
}
}
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/widget/dialog/ChooseRestaurantDialog.java
View file @
ff6f0816
...
...
@@ -26,6 +26,7 @@ import com.gingersoft.gsa.cloud.base.R;
import
com.gingersoft.gsa.cloud.ui.adapter.BasTextSectiontAdapter
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.BrandsBean
;
import
com.gingersoft.gsa.cloud.ui.bean.view.SectionHeader
;
import
com.gingersoft.gsa.cloud.ui.bean.view.SectionRestaurantItem
;
import
com.gingersoft.gsa.cloud.ui.bean.view.SectionTextItem
;
import
com.jess.arms.utils.AndroidWorkaround
;
import
com.qmuiteam.qmui.QMUILog
;
...
...
@@ -210,7 +211,7 @@ public class ChooseRestaurantDialog extends Dialog {
private
Context
mContext
;
private
ChooseRestaurantDialog
mDialog
;
private
List
<
BrandsBean
.
BrandsData
>
mItems
;
private
List
<
QMUISection
<
SectionHeader
,
Section
Tex
tItem
>>
mQmuiSections
;
private
List
<
QMUISection
<
SectionHeader
,
Section
Restauran
tItem
>>
mQmuiSections
;
private
BasTextSectiontAdapter
mAdapter
;
private
QMUITopBar
mTopBar
;
...
...
@@ -282,10 +283,10 @@ public class ChooseRestaurantDialog extends Dialog {
mLayoutManager
=
createLayoutManager
();
mSectionLayout
.
setLayoutManager
(
mLayoutManager
);
mAdapter
=
new
BasTextSectiontAdapter
();
mAdapter
.
setCallback
(
new
QMUIStickySectionAdapter
.
Callback
<
SectionHeader
,
Section
Tex
tItem
>()
{
mAdapter
.
setCallback
(
new
QMUIStickySectionAdapter
.
Callback
<
SectionHeader
,
Section
Restauran
tItem
>()
{
@Override
public
void
loadMore
(
QMUISection
<
SectionHeader
,
Section
Tex
tItem
>
section
,
boolean
loadMoreBefore
)
{
public
void
loadMore
(
QMUISection
<
SectionHeader
,
Section
Restauran
tItem
>
section
,
boolean
loadMoreBefore
)
{
}
...
...
@@ -294,7 +295,7 @@ public class ChooseRestaurantDialog extends Dialog {
if
(
holder
instanceof
BasTextSectiontAdapter
.
ViewHolder
)
{
BasTextSectiontAdapter
.
ViewHolder
viewHolder
=
(
BasTextSectiontAdapter
.
ViewHolder
)
holder
;
if
(
viewHolder
.
getTvName
().
getText
()
!=
null
)
{
Section
TextItem
item
=
viewHolder
.
getSectionTex
tItem
(
position
);
Section
RestaurantItem
item
=
viewHolder
.
getSectionRestauran
tItem
(
position
);
if
(
mOnItemClickListener
!=
null
)
{
mOnItemClickListener
.
onItemClick
(
mDialog
,
item
,
position
);
}
...
...
@@ -316,8 +317,8 @@ public class ChooseRestaurantDialog extends Dialog {
mAdapter
.
setData
(
mQmuiSections
);
}
private
List
<
QMUISection
<
SectionHeader
,
Section
Tex
tItem
>>
restaurantsTransformToSection
(
List
<
BrandsBean
.
BrandsData
>
mItems
)
{
List
<
QMUISection
<
SectionHeader
,
Section
Tex
tItem
>>
qmuiSections
=
new
ArrayList
<>();
private
List
<
QMUISection
<
SectionHeader
,
Section
Restauran
tItem
>>
restaurantsTransformToSection
(
List
<
BrandsBean
.
BrandsData
>
mItems
)
{
List
<
QMUISection
<
SectionHeader
,
Section
Restauran
tItem
>>
qmuiSections
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
mItems
.
size
();
i
++)
{
BrandsBean
.
BrandsData
brandsBean
=
mItems
.
get
(
i
);
qmuiSections
.
add
(
createSection
(
brandsBean
));
...
...
@@ -325,11 +326,11 @@ public class ChooseRestaurantDialog extends Dialog {
return
qmuiSections
;
}
private
QMUISection
<
SectionHeader
,
Section
Tex
tItem
>
createSection
(
BrandsBean
.
BrandsData
brandsBean
)
{
private
QMUISection
<
SectionHeader
,
Section
Restauran
tItem
>
createSection
(
BrandsBean
.
BrandsData
brandsBean
)
{
SectionHeader
header
=
new
SectionHeader
(
brandsBean
.
getBrandName
());
ArrayList
<
Section
Tex
tItem
>
contents
=
new
ArrayList
<>();
ArrayList
<
Section
Restauran
tItem
>
contents
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
Objects
.
requireNonNull
(
brandsBean
.
getRestaurants
().
size
());
i
++)
{
contents
.
add
(
new
Section
TextItem
(
brandsBean
.
getRestaurants
().
get
(
i
).
getRestaurantId
(),
Objects
.
requireNonNull
(
brandsBean
.
getRestaurants
().
get
(
i
).
getRestaurantName
(
))));
contents
.
add
(
new
Section
RestaurantItem
(
Objects
.
requireNonNull
(
brandsBean
.
getRestaurants
().
get
(
i
))));
}
return
new
QMUISection
<>(
header
,
contents
,
false
);
}
...
...
@@ -363,7 +364,7 @@ public class ChooseRestaurantDialog extends Dialog {
public
interface
OnItemClickListener
{
void
onItemClick
(
ChooseRestaurantDialog
dialog
,
Section
Tex
tItem
item
,
int
position
);
void
onItemClick
(
ChooseRestaurantDialog
dialog
,
Section
Restauran
tItem
item
,
int
position
);
}
}
...
...
base-module/src/main/res/values/attrs.xml
View file @
ff6f0816
...
...
@@ -8,6 +8,34 @@
<attr
name=
"labelSrc"
format=
"reference"
/>
</declare-styleable>
<!--斜角标签-->
<declare-styleable
name=
"BeveLabelView"
>
<!--背景颜色-->
<attr
name=
"label_bg_color"
format=
"color|reference"
/>
<!--文字-->
<attr
name=
"label_text"
format=
"string"
/>
<!-- 文字颜色-->
<attr
name=
"label_text_color"
format=
"color|reference"
/>
<!--文字大小-->
<attr
name=
"label_text_size"
format=
"dimension"
/>
<attr
name=
"label_length"
format=
"dimension"
/>
<!-- 圆角-->
<attr
name=
"label_corner"
format=
"dimension"
/>
<attr
name=
"label_mode"
>
<!-- fill是沾满整个,-->
<enum
name=
"left_top"
value=
"0"
/>
<enum
name=
"right_top"
value=
"1"
/>
<enum
name=
"left_bottom"
value=
"2"
/>
<enum
name=
"right_bottom"
value=
"3"
/>
<enum
name=
"left_top_fill"
value=
"4"
/>
<enum
name=
"right_top_fill"
value=
"5"
/>
<enum
name=
"left_bottom_fill"
value=
"6"
/>
<enum
name=
"right_bottom_fill"
value=
"7"
/>
</attr>
</declare-styleable>
<declare-styleable
name=
"TriangleLabelView"
>
<attr
name=
"backgroundColor"
format=
"color"
/>
...
...
config.gradle
View file @
ff6f0816
...
...
@@ -6,9 +6,9 @@ ext {
minSdkVersion
:
19
,
//N5收銀機應用安卓開發環境要求Android OS Version: 5.1Android SDK Min Version: 19
targetSdkVersion
:
28
,
//正式版: 1.0.3 3
//內部測試版:1.1.
3 13
versionCode
:
1
3
,
versionName
:
"1.1.
3
"
//內部測試版:1.1.
7 17
versionCode
:
1
7
,
versionName
:
"1.1.
7
"
]
version
=
[
...
...
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/contract/LoginInterfaceImpl.java
View file @
ff6f0816
...
...
@@ -9,6 +9,7 @@ import com.gingersoft.gsa.cloud.constans.UserConstans;
import
com.gingersoft.gsa.cloud.base.utils.other.SPUtils
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.BrandsBean
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.LoginBean
;
import
com.gingersoft.gsa.cloud.ui.bean.view.SectionRestaurantItem
;
import
com.gingersoft.gsa.cloud.ui.bean.view.SectionTextItem
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.ChooseRestaurantDialog
;
import
com.gingersoft.gsa.cloud.login.mvp.presenter.BaseLoginPresenter
;
...
...
@@ -49,7 +50,7 @@ public abstract class LoginInterfaceImpl<P extends BaseLoginPresenter> extends B
BrandsBean
.
BrandsData
brandsBean
=
getOnlyBrand
(
brands
);
BrandsBean
.
BrandsData
.
RestaurantsBean
restaurantsBean
=
getOnlyRestaurant
(
brands
);
if
(
brandsBean
!=
null
)
{
saveBrandAndRestaurantInfo
(
brandsBean
.
getBrandId
(),
brandsBean
.
getBrandName
(),
restaurantsBean
.
getRestaurantId
(),
restaurantsBean
.
getRestaurantName
()
);
saveBrandAndRestaurantInfo
(
brandsBean
.
getBrandId
(),
brandsBean
.
getBrandName
(),
restaurantsBean
);
}
jumpDownloadActivity
();
}
else
{
...
...
@@ -75,20 +76,21 @@ public abstract class LoginInterfaceImpl<P extends BaseLoginPresenter> extends B
}
}
protected
void
ChooseRestaurantItemClick
(
List
<
BrandsBean
.
BrandsData
>
brands
,
ChooseRestaurantDialog
dialog
,
SectionTextItem
item
)
{
BrandsBean
.
BrandsData
brandsBean
=
getBrandByRestaurantId
(
brands
,
item
.
getId
());
protected
void
ChooseRestaurantItemClick
(
List
<
BrandsBean
.
BrandsData
>
brands
,
ChooseRestaurantDialog
dialog
,
BrandsBean
.
BrandsData
.
RestaurantsBean
item
)
{
BrandsBean
.
BrandsData
brandsBean
=
getBrandByRestaurantId
(
brands
,
item
.
get
Restaurant
Id
());
if
(
brandsBean
!=
null
)
{
saveBrandAndRestaurantInfo
(
brandsBean
.
getBrandId
(),
brandsBean
.
getBrandName
(),
item
.
getId
(),
item
.
getText
()
);
saveBrandAndRestaurantInfo
(
brandsBean
.
getBrandId
(),
brandsBean
.
getBrandName
(),
item
);
}
dialog
.
dismiss
();
jumpDownloadActivity
();
}
protected
void
saveBrandAndRestaurantInfo
(
int
brandId
,
String
brandName
,
int
restaurantId
,
String
restaurantName
)
{
protected
void
saveBrandAndRestaurantInfo
(
int
brandId
,
String
brandName
,
BrandsBean
.
BrandsData
.
RestaurantsBean
restaurantsBean
)
{
GsaCloudApplication
.
setBrandId
(
mContext
,
brandId
);
GsaCloudApplication
.
setBrandName
(
mContext
,
brandName
);
GsaCloudApplication
.
setRestaurantId
(
mContext
,
restaurantId
);
GsaCloudApplication
.
setRestaurantName
(
mContext
,
restaurantName
);
GsaCloudApplication
.
setRestaurantId
(
mContext
,
restaurantsBean
.
getRestaurantId
());
GsaCloudApplication
.
setRestaurantName
(
mContext
,
restaurantsBean
.
getRestaurantName
());
GsaCloudApplication
.
setGsPosShopId
(
mContext
,
restaurantsBean
.
getGsPosShopId
());
}
private
int
getRestaurantSize
(
List
<
BrandsBean
.
BrandsData
>
brands
)
{
...
...
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/ui/activity/LoginActivity.java
View file @
ff6f0816
...
...
@@ -317,7 +317,7 @@ public class LoginActivity extends LoginInterfaceImpl<LoginPresenter> implements
public
void
showChooseRestaurantDialog
(
List
<
BrandsBean
.
BrandsData
>
brandsBeans
,
List
<
BrandsBean
.
BrandsData
>
brands
)
{
new
ChooseRestaurantDialog
.
BottomListSheetBuilder
(
mContext
)
.
addBrandItems
(
brandsBeans
)
.
setOnItemClickListener
((
dialog
,
item
,
position
)
->
ChooseRestaurantItemClick
(
brands
,
dialog
,
item
))
.
setOnItemClickListener
((
dialog
,
item
,
position
)
->
ChooseRestaurantItemClick
(
brands
,
dialog
,
item
.
getRestaurantsBean
()
))
.
build
()
.
show
();
}
...
...
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/ui/activity/WelcomeActivity.java
View file @
ff6f0816
...
...
@@ -275,7 +275,7 @@ public class WelcomeActivity extends LoginInterfaceImpl<WelcomePresenter> implem
.
addBrandItems
(
brandsBeans
)
.
setOnItemClickListener
((
dialog
,
item
,
position
)
->
{
isChooseRestaurant
=
true
;
ChooseRestaurantItemClick
(
brands
,
dialog
,
item
);
ChooseRestaurantItemClick
(
brands
,
dialog
,
item
.
getRestaurantsBean
()
);
})
.
setOnDismissListener
(
dialog
->
{
if
(!
isChooseRestaurant
)
{
...
...
main-module/build.gradle
View file @
ff6f0816
...
...
@@ -46,7 +46,7 @@ android {
}
dependencies
{
implementation
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
//
implementation fileTree(include: ['*.jar'], dir: 'libs')
api
project
(
':updateApk'
)
...
...
@@ -61,7 +61,7 @@ dependencies {
implementation
'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation
'cn.bingoogolapple:bga-progressbar:1.0.1'
//进度条
implementation
files
(
'libs/nineoldandroids-2.4.0.jar'
)
//
implementation files('libs/nineoldandroids-2.4.0.jar')
implementation
"androidx.core:core-ktx:+"
implementation
"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
...
...
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/model/bean/SettlementReport.java
View file @
ff6f0816
...
...
@@ -366,11 +366,13 @@ public class SettlementReport {
* payName : 現金
* payNum : 2
* payAmount : 256
* payType : 1001
*/
private
String
payName
;
private
int
payNum
;
private
double
payAmount
;
private
int
payType
;
public
String
getPayName
()
{
return
payName
;
...
...
@@ -395,6 +397,14 @@ public class SettlementReport {
public
void
setPayAmount
(
double
payAmount
)
{
this
.
payAmount
=
payAmount
;
}
public
int
getPayType
()
{
return
payType
;
}
public
void
setPayType
(
int
payType
)
{
this
.
payType
=
payType
;
}
}
}
}
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/activity/NewMainActivity.java
View file @
ff6f0816
...
...
@@ -388,14 +388,16 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl
.
build
()
.
call
();
BrandsBean
.
BrandsData
brandsBean
=
RestaurantInfoUtils
.
getBrandByRestaurantId
(
brandsBeans
,
item
.
getId
());
BrandsBean
.
BrandsData
.
RestaurantsBean
restaurantsBean
=
item
.
getRestaurantsBean
();
BrandsBean
.
BrandsData
brandsBean
=
RestaurantInfoUtils
.
getBrandByRestaurantId
(
brandsBeans
,
restaurantsBean
.
getRestaurantId
());
if
(
brandsBean
!=
null
)
{
saveBrandAndRestaurantInfo
(
brandsBean
.
getBrandId
(),
brandsBean
.
getBrandName
(),
item
.
getId
(),
item
.
getText
());
saveBrandAndRestaurantInfo
(
brandsBean
.
getBrandId
(),
brandsBean
.
getBrandName
(),
restaurantsBean
.
getRestaurantId
(),
restaurantsBean
.
getRestaurantName
());
}
GsaCloudApplication
.
setRestaurantId
(
NewMainActivity
.
this
,
item
.
ge
tId
());
GsaCloudApplication
.
setRestaurantName
(
NewMainActivity
.
this
,
item
.
getText
());
GsaCloudApplication
.
setRestaurantId
(
NewMainActivity
.
this
,
restaurantsBean
.
getRestauran
tId
());
GsaCloudApplication
.
setRestaurantName
(
NewMainActivity
.
this
,
restaurantsBean
.
getRestaurantName
());
updateTitleInfo
();
...
...
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/activity/SettlementReportActivity.java
View file @
ff6f0816
...
...
@@ -29,6 +29,7 @@ import androidx.recyclerview.widget.RecyclerView;
import
com.billy.cc.core.component.CC
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.common.bean.PayMethod
;
import
com.gingersoft.gsa.cloud.base.utils.JsonUtils
;
import
com.gingersoft.gsa.cloud.base.utils.LanguageUtils
;
import
com.gingersoft.gsa.cloud.base.utils.MoneyUtil
;
...
...
@@ -376,15 +377,20 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
List
<
SettlementReport
.
DataBean
.
CashBean
>
cashList
=
datasBean
.
getCash
();
if
(
cashList
!=
null
&&
cashList
.
size
()
>
0
)
{
SettlementReport
.
DataBean
.
CashBean
cashBean
=
cashList
.
get
(
0
);
/**現金詳情*/
String
cashDetailText
=
LanguageUtils
.
get_language_system
(
this
,
"credit.cash.detail"
,
"現金詳情"
);
String
cashText
=
LanguageUtils
.
get_language_system
(
this
,
"credit.cash"
,
"現金"
);
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
"=============================================================="
,
null
,
null
,
null
,
null
));
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
null
,
null
,
cashDetailText
,
null
,
null
));
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
cashText
,
null
,
String
.
valueOf
(
cashBean
.
getPayNum
()),
null
,
cashStr
+
df
.
format
(
cashBean
.
getPayAmount
())));
//統計
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
headcountOrAverageConsumptionText
,
null
,
null
,
null
,
cashStr
+
df
.
format
(
cashBean
.
getPayAmount
())));
for
(
int
i
=
0
;
i
<
cashList
.
size
();
i
++)
{
SettlementReport
.
DataBean
.
CashBean
cashBean
=
cashList
.
get
(
i
);
if
(
cashBean
.
getPayType
()
==
PayMethod
.
PAY_TYPE_CASH
){
/**現金詳情*/
String
cashDetailText
=
LanguageUtils
.
get_language_system
(
this
,
"credit.cash.detail"
,
"現金詳情"
);
String
cashText
=
LanguageUtils
.
get_language_system
(
this
,
"credit.cash"
,
"現金"
);
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
"=============================================================="
,
null
,
null
,
null
,
null
));
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
null
,
null
,
cashDetailText
,
null
,
null
));
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
cashText
,
null
,
String
.
valueOf
(
cashBean
.
getPayNum
()),
null
,
cashStr
+
df
.
format
(
cashBean
.
getPayAmount
())));
//統計
settlementReportItem5s
.
add
(
new
SectionTextItem5
(
headcountOrAverageConsumptionText
,
null
,
null
,
null
,
cashStr
+
df
.
format
(
cashBean
.
getPayAmount
())));
break
;
}
}
}
List
<
SettlementReport
.
DataBean
.
AnalysisBean
>
analysisBeanList
=
datasBean
.
getAnalysis
();
...
...
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/ui/adapter/TableManageSectiontAdapter.java
View file @
ff6f0816
...
...
@@ -2,6 +2,7 @@ package com.gingersoft.gsa.cloud.manager.mvp.ui.adapter;
import
android.content.Context
;
import
android.graphics.Color
;
import
android.util.SparseArray
;
import
android.view.Gravity
;
import
android.view.View
;
import
android.view.ViewGroup
;
...
...
@@ -12,6 +13,7 @@ import android.widget.RelativeLayout;
import
android.widget.TextView
;
import
com.gingersoft.gsa.cloud.base.common.bean.TableItem
;
import
com.gingersoft.gsa.cloud.base.utils.StringUtils
;
import
com.gingersoft.gsa.cloud.manager.R
;
import
com.gingersoft.gsa.cloud.manager.R2
;
import
com.gingersoft.gsa.cloud.ui.bean.view.SectionHeader
;
...
...
@@ -19,6 +21,7 @@ import com.gingersoft.gsa.cloud.ui.view.TriangleLabelView;
import
com.gingersoft.gsa.cloud.ui.view.TriangleView
;
import
com.gingersoft.gsa.cloud.ui.view.qm.QDLoadingItemView
;
import
com.gingersoft.gsa.cloud.ui.view.section.QDSectionHeaderView
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.jess.arms.utils.DeviceUtils
;
import
com.qmuiteam.qmui.layout.QMUIRelativeLayout
;
import
com.qmuiteam.qmui.util.QMUIDisplayHelper
;
...
...
@@ -26,6 +29,8 @@ import com.qmuiteam.qmui.widget.section.QMUIDefaultStickySectionAdapter;
import
com.qmuiteam.qmui.widget.section.QMUISection
;
import
com.qmuiteam.qmui.widget.section.QMUIStickySectionAdapter
;
import
java.util.HashMap
;
import
androidx.annotation.NonNull
;
import
androidx.core.content.ContextCompat
;
import
butterknife.BindView
;
...
...
@@ -52,6 +57,7 @@ public class TableManageSectiontAdapter extends QMUIDefaultStickySectionAdapter<
private
float
mShadowAlpha
=
0.25f
;
private
int
mShadowElevationDp
=
14
;
private
HashMap
<
Long
,
Boolean
>
mSelectedStatus
=
new
HashMap
<>();
public
void
initItemDispalyHeight
()
{
float
screenHeight
=
DeviceUtils
.
getScreenHeight
(
context
)
-
75
-
75
;
...
...
@@ -65,6 +71,7 @@ public class TableManageSectiontAdapter extends QMUIDefaultStickySectionAdapter<
this
.
context
=
viewGroup
.
getContext
();
this
.
mRadius
=
QMUIDisplayHelper
.
dp2px
(
context
,
5
);
initItemDispalyHeight
();
return
new
QMUIStickySectionAdapter
.
ViewHolder
(
new
QDSectionHeaderView
(
viewGroup
.
getContext
()));
}
...
...
@@ -86,6 +93,12 @@ public class TableManageSectiontAdapter extends QMUIDefaultStickySectionAdapter<
super
.
onBindSectionHeader
(
holder
,
position
,
section
);
QDSectionHeaderView
itemView
=
(
QDSectionHeaderView
)
holder
.
itemView
;
itemView
.
render
(
section
.
getHeader
(),
section
.
isFold
());
for
(
int
i
=
0
;
i
<
section
.
getItemList
().
size
();
i
++)
{
TableItem
tableItem
=
section
.
getItemList
().
get
(
i
);
if
(!
mSelectedStatus
.
containsKey
(
tableItem
.
getId
()))
{
mSelectedStatus
.
put
(
tableItem
.
getId
(),
false
);
}
}
// itemView.setBackgroundColor(ContextCompat.getColor(context,R.color.theme_background_color));
itemView
.
getArrowView
().
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
...
...
@@ -112,8 +125,11 @@ public class TableManageSectiontAdapter extends QMUIDefaultStickySectionAdapter<
initAddItemDispalyMetrics
(
viewHolder
);
viewHolder
.
ll_container
.
setBackgroundColor
(
Color
.
parseColor
(
"#FFFFFFFF"
));
setBackGroundWork
(
viewHolder
,
Color
.
parseColor
(
"#FFFFFFFF"
),
R
.
color
.
black
,
R
.
color
.
theme_black
);
setBackGroundWork
(
viewHolder
,
Color
.
parseColor
(
"#FFFFFFFF"
),
R
.
color
.
black
,
R
.
color
.
theme_black
);
viewHolder
.
cb_checked
.
setChecked
(
false
);
viewHolder
.
cb_checked
.
setOnCheckedChangeListener
(
null
);
viewHolder
.
cb_checked
.
setVisibility
(
View
.
GONE
);
}
else
{
viewHolder
.
rl_table
.
setVisibility
(
View
.
VISIBLE
);
...
...
@@ -127,9 +143,9 @@ public class TableManageSectiontAdapter extends QMUIDefaultStickySectionAdapter<
viewHolder
.
tv_service_fee
.
setText
(
tableItem
.
getServiceCharge
()
+
"%"
);
viewHolder
.
tv_service_fee
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
viewHolder
.
tv_service_fee
.
setVisibility
(
View
.
INVISIBL
E
);
viewHolder
.
tv_service_fee
.
setVisibility
(
View
.
GON
E
);
}
if
(
isRadioEdit
&&
tableItem
.
getUseStatus
()
==
0
)
{
if
(
isRadioEdit
&&
tableItem
.
getUseStatus
()
==
0
&&
tableItem
.
getStatus
()
==
0
)
{
viewHolder
.
cb_checked
.
setChecked
(
tableItem
.
isChecked
());
viewHolder
.
cb_checked
.
setVisibility
(
View
.
VISIBLE
);
viewHolder
.
cb_checked
.
setOnCheckedChangeListener
(
new
CompoundButton
.
OnCheckedChangeListener
()
{
...
...
@@ -139,6 +155,8 @@ public class TableManageSectiontAdapter extends QMUIDefaultStickySectionAdapter<
}
});
}
else
{
viewHolder
.
cb_checked
.
setChecked
(
false
);
viewHolder
.
cb_checked
.
setOnCheckedChangeListener
(
null
);
viewHolder
.
cb_checked
.
setVisibility
(
View
.
GONE
);
}
}
...
...
@@ -149,6 +167,12 @@ public class TableManageSectiontAdapter extends QMUIDefaultStickySectionAdapter<
viewHolder
.
tv_table
.
setText
(
item
.
getTableName
());
if
(
StringUtils
.
getChineseValueLength
(
item
.
getTableName
())
>
5
)
{
viewHolder
.
tv_table
.
setTextSize
(
18
);
}
else
{
viewHolder
.
tv_table
.
setTextSize
(
22
);
}
if
(
item
.
getStatus
()
!=
0
)
{
viewHolder
.
tv_people
.
setVisibility
(
View
.
VISIBLE
);
if
(
item
.
getMinSeatCount
()
!=
0
||
item
.
getMaxSeatCount
()
!=
0
)
{
...
...
@@ -160,7 +184,6 @@ public class TableManageSectiontAdapter extends QMUIDefaultStickySectionAdapter<
}
else
{
//未開檯空間足夠可換行顯示
viewHolder
.
tv_table
.
setMaxLines
(
2
);
viewHolder
.
tv_table
.
setTextSize
(
22
);
viewHolder
.
tv_people
.
setVisibility
(
View
.
GONE
);
}
...
...
@@ -193,24 +216,24 @@ public class TableManageSectiontAdapter extends QMUIDefaultStickySectionAdapter<
viewHolder
.
ll_container
.
setBackgroundColor
(
Color
.
parseColor
(
"#FFFFFFFF"
));
if
(
item
.
getUseStatus
()
==
1
)
{
setBackGroundWork
(
viewHolder
,
Color
.
parseColor
(
"#FFD14141"
),
R
.
color
.
theme_white_color
,
R
.
color
.
theme_black
);
setBackGroundWork
(
viewHolder
,
Color
.
parseColor
(
"#FFD14141"
),
R
.
color
.
theme_white_color
,
R
.
color
.
theme_black
);
}
else
{
switch
(
item
.
getStatus
())
{
case
0
:
setBackGroundWork
(
viewHolder
,
Color
.
parseColor
(
"#FFFFFFFF"
),
R
.
color
.
black
,
R
.
color
.
theme_black
);
setBackGroundWork
(
viewHolder
,
Color
.
parseColor
(
"#FFFFFFFF"
),
R
.
color
.
black
,
R
.
color
.
theme_black
);
break
;
case
1
:
// setBackGroundWork(item, "2", R.drawable.table_shape_table_send, R.drawable.tablebutton_glassgreen_new, R.color.theme_white_color); break;
case
2
:
setBackGroundWork
(
viewHolder
,
Color
.
parseColor
(
"#FF249B65"
),
R
.
color
.
theme_white_color
,
R
.
color
.
theme_white_color
);
setBackGroundWork
(
viewHolder
,
Color
.
parseColor
(
"#FF249B65"
),
R
.
color
.
theme_white_color
,
R
.
color
.
theme_white_color
);
break
;
case
3
:
setBackGroundWork
(
viewHolder
,
Color
.
parseColor
(
"#FFE5AC00"
),
R
.
color
.
theme_white_color
,
R
.
color
.
theme_white_color
);
setBackGroundWork
(
viewHolder
,
Color
.
parseColor
(
"#FFE5AC00"
),
R
.
color
.
theme_white_color
,
R
.
color
.
theme_white_color
);
break
;
case
4
:
case
5
:
case
6
:
setBackGroundWork
(
viewHolder
,
ContextCompat
.
getColor
(
context
,
R
.
color
.
Violet
),
R
.
color
.
theme_white_color
,
R
.
color
.
theme_white_color
);
setBackGroundWork
(
viewHolder
,
ContextCompat
.
getColor
(
context
,
R
.
color
.
Violet
),
R
.
color
.
theme_white_color
,
R
.
color
.
theme_white_color
);
break
;
}
}
...
...
@@ -230,7 +253,7 @@ public class TableManageSectiontAdapter extends QMUIDefaultStickySectionAdapter<
viewHolder
.
rl_table
.
setLayoutParams
(
relativeLayout
);
}
private
void
setBackGroundWork
(
ViewHolder
viewHolder
,
int
defaultMainback
,
int
defaultFontColor
,
int
serviceFeeFontColor
)
{
private
void
setBackGroundWork
(
ViewHolder
viewHolder
,
int
defaultMainback
,
int
defaultFontColor
,
int
serviceFeeFontColor
)
{
if
(
defaultMainback
!=
-
1
)
{
viewHolder
.
ll_container
.
setBackgroundColor
(
defaultMainback
);
}
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/contract/MealStandContract.java
View file @
ff6f0816
...
...
@@ -21,6 +21,7 @@ import java.util.Map;
import
androidx.recyclerview.widget.RecyclerView
;
import
io.reactivex.Observable
;
import
okhttp3.RequestBody
;
import
retrofit2.http.Query
;
/**
...
...
@@ -118,7 +119,9 @@ public interface MealStandContract {
Observable
<
BaseRespose
>
printOrder
(
RequestBody
requestBody
);
Observable
<
FoodReason
>
getRestaurantFoodReason
(
int
brandId
,
int
restaurantId
,
int
type
);
Observable
<
FoodReason
>
getRestaurantFoodReason
(
int
brandId
,
int
restaurantId
,
int
type
);
Observable
<
BaseResult
>
queryMember
(
int
type
,
String
sign
,
String
shopName
);
List
<
Food
>
queryDB_AllFoodList
();
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/MealStandModel.java
View file @
ff6f0816
...
...
@@ -19,6 +19,7 @@ import com.gingersoft.gsa.cloud.database.utils.FoodDaoUtils;
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.service.MealService
;
import
com.gingersoft.gsa.cloud.table.mvp.model.service.MemberService
;
import
com.gingersoft.gsa.cloud.table.mvp.model.service.OrderPayService
;
import
com.google.gson.Gson
;
import
com.jess.arms.di.scope.ActivityScope
;
...
...
@@ -176,6 +177,12 @@ public class MealStandModel extends BaseModel implements MealStandContract.Model
}
@Override
public
Observable
<
BaseResult
>
queryMember
(
int
type
,
String
parm
,
String
shopName
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
MemberService
.
class
)
.
queryMember
(
type
,
parm
,
shopName
);
}
@Override
public
Observable
<
BaseResult
>
toOrderPay
(
RequestBody
formBody
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
OrderPayService
.
class
)
.
toOrderPay
(
formBody
);
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/bean/FoodReason.java
View file @
ff6f0816
...
...
@@ -52,7 +52,7 @@ public class FoodReason {
* uid : 1
* restaurantId : 410
* content : 顔色不好看
* type : 1
* type : 1
,2,3
* updateTime : 1585721573999
* createTime : 1585721573999
*/
...
...
@@ -61,7 +61,7 @@ public class FoodReason {
private
int
uid
;
private
int
restaurantId
;
private
String
content
;
private
int
type
;
private
String
type
;
private
long
updateTime
;
private
long
createTime
;
...
...
@@ -97,11 +97,11 @@ public class FoodReason {
this
.
content
=
content
;
}
public
int
getType
()
{
public
String
getType
()
{
return
type
;
}
public
void
setType
(
int
type
)
{
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/model/service/MemberService.java
0 → 100644
View file @
ff6f0816
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
model
.
service
;
import
com.gingersoft.gsa.cloud.base.common.bean.BaseResult
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.BaseRespose
;
import
io.reactivex.Observable
;
import
me.jessyan.retrofiturlmanager.RetrofitUrlManager
;
import
retrofit2.http.Field
;
import
retrofit2.http.FormUrlEncoded
;
import
retrofit2.http.GET
;
import
retrofit2.http.Headers
;
import
retrofit2.http.POST
;
import
retrofit2.http.Query
;
/**
* Created by Wyh on 2020/1/17.
*/
public
interface
MemberService
{
@Headers
({
"Domain-Name: update_version"
})
@GET
(
"member/getMemberInfo?"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
BaseResult
>
queryMember
(
@Query
(
"type"
)
int
type
,
@Query
(
"parm"
)
String
parm
,
@Query
(
"gsposShopId"
)
String
shopName
);
}
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/MealStandPresenter.java
View file @
ff6f0816
This diff is collapsed.
Click to expand it.
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/OrderPayPresenter.java
View file @
ff6f0816
...
...
@@ -191,6 +191,12 @@ public class OrderPayPresenter extends BaseOrderPresenter<OrderPayContract.Model
public
void
onNext
(
BaseResult
baseResult
)
{
if
(
baseResult
.
isSuccess
())
{
List
<
PayMethod
>
payMethods
=
JsonUtils
.
parseArray
(
baseResult
.
getData
(),
PayMethod
.
class
);
for
(
int
i
=
0
;
i
<
payMethods
.
size
();
i
++)
{
//這裡有對象為null的清機 排除掉
if
(
payMethods
.
get
(
i
)
==
null
)
{
payMethods
.
remove
(
i
);
}
}
mRootView
.
loadPayMethodsSuccess
(
payMethods
);
// mBillMethodList.addAll(payMethods);
// mBillMethodAdapter.notifyDataSetChanged();
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/MealStandActivity.java
View file @
ff6f0816
...
...
@@ -39,7 +39,9 @@ import com.gingersoft.gsa.cloud.base.common.bean.OrderBean;
import
com.gingersoft.gsa.cloud.base.common.bean.TableBean
;
import
com.gingersoft.gsa.cloud.base.common.bean.mealManage.MyOrderManage
;
import
com.gingersoft.gsa.cloud.base.common.bean.mealManage.OpenTableManage
;
import
com.gingersoft.gsa.cloud.base.utils.LanguageUtils
;
import
com.gingersoft.gsa.cloud.base.utils.VibratorUtils
;
import
com.gingersoft.gsa.cloud.base.utils.encryption.Md5
;
import
com.gingersoft.gsa.cloud.base.utils.other.SPUtils
;
import
com.gingersoft.gsa.cloud.database.bean.Food
;
import
com.gingersoft.gsa.cloud.database.utils.ComboItemDaoUtils
;
...
...
@@ -61,6 +63,7 @@ import com.gingersoft.gsa.cloud.table.mvp.ui.adapter.meal.SelectMealAdapter;
import
com.gingersoft.gsa.cloud.table.mvp.ui.fragment.FineItemAllFragment
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.widget.ChooseNumberDialog
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.adapter.meal.FoodGroupAdapter
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.widget.UseMemberDialog
;
import
com.gingersoft.gsa.cloud.ui.recylcler.Indicator.PagerConfig
;
import
com.gingersoft.gsa.cloud.ui.recylcler.Indicator.PagerGridLayoutManager
;
import
com.gingersoft.gsa.cloud.ui.recylcler.Indicator.PagerGridSnapHelper
;
...
...
@@ -74,16 +77,22 @@ import com.jess.arms.base.BaseFragmentActivity;
import
com.jess.arms.base.DefaultAdapter
;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.jess.arms.utils.DeviceUtils
;
import
com.jess.arms.utils.PermissionUtil
;
import
com.qmuiteam.qmui.alpha.QMUIAlphaTextView
;
import
com.qmuiteam.qmui.util.QMUIDisplayHelper
;
import
com.qmuiteam.qmui.util.QMUIDrawableHelper
;
import
com.qmuiteam.qmui.widget.dialog.QMUITipDialog
;
import
com.tbruyelle.rxpermissions2.RxPermissions
;
import
com.uuzuche.lib_zxing.activity.CaptureActivity
;
import
org.simple.eventbus.EventBus
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
butterknife.BindView
;
import
butterknife.OnClick
;
...
...
@@ -252,6 +261,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
private
static
final
int
FINISH
=
101
;
private
static
final
int
ORDER_CONTENT_CODE
=
1002
;
public
static
final
int
SCAN_REQUEST_CODE
=
0x0000c0de
;
private
int
ComboColCount
=
4
;
private
int
DiscountCol
=
3
;
...
...
@@ -271,7 +281,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
EventBus
.
getDefault
().
registerSticky
(
this
);
super
.
onCreate
(
savedInstanceState
);
OrderBean
order
=
MyOrderManage
.
getInstance
().
getOrderBean
();
if
(
order
!=
null
)
{
if
(
order
!=
null
)
{
// ArmsUtils.snackbarText("訂單ID:" + order.getId());
}
}
...
...
@@ -319,6 +329,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
//更新點餐信息
mPresenter
.
resetSelected
();
mPresenter
.
updateOrderFoodNumber
();
mPresenter
.
updateFoodSoldoutCtrData
();
initOrderDetail
();
}
...
...
@@ -367,6 +378,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
mPresenter
.
setRvMealClicked
(
false
);
mPresenter
.
changedMealByParentId
(
datasBean
.
getId
());
mPresenter
.
updateOrderFoodNumber
();
mPresenter
.
updateFoodSoldoutCtrData
();
}
});
...
...
@@ -544,17 +556,39 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
@OnClick
(
R2
.
id
.
btn_table
)
void
onClickTable
()
{
//type取值:1qrCdoetype,2:手機號,3:memberId
new
UseMemberDialog
.
BottomLayoutBuilder
(
this
)
.
setOnLayoutClickListener
(
new
UseMemberDialog
.
BottomLayoutBuilder
.
OnLayoutClickListener
()
{
@Override
public
void
onInputPhone
(
UseMemberDialog
dialog
,
String
phone
)
{
Map
<
String
,
String
>
parameterMap
=
new
HashMap
<>();
parameterMap
.
put
(
"type"
,
"2"
);
parameterMap
.
put
(
"parm"
,
phone
);
Md5
md5
=
new
Md5
();
String
sign
=
md5
.
getMD5ofStr
(
parameterMap
);
mPresenter
.
queryMember
(
2
,
sign
,
GsaCloudApplication
.
getGsPosShopId
(
mContext
));
}
@Override
public
void
onScanAction
(
UseMemberDialog
dialog
)
{
mPresenter
.
toScanActivity
();
}
})
.
build
()
.
show
();
}
@OnClick
(
R2
.
id
.
btn_multiple_selection
)
void
onClickMultipleSelection
()
{
currentFinePage
=
0
;
if
(
mPresenter
.
getSelectMealAdapter
().
getSelectedMode
()
==
SelectMealAdapter
.
MULTIPLE_SELECTED
)
{
mPresenter
.
getSelectMealAdapter
().
setSelectedMode
(
SelectMealAdapter
.
SINGLE_SELECTED
);
btn_delete
.
setVisibility
(
View
.
VISIBLE
);
setSelectFunctionVisibility
(
View
.
GONE
);
}
else
{
mPresenter
.
getSelectMealAdapter
().
setSelectedMode
(
SelectMealAdapter
.
MULTIPLE_SELECTED
);
btn_delete
.
setVisibility
(
View
.
GONE
);
setSelectFunctionVisibility
(
View
.
VISIBLE
);
loadFineItemData
();
}
...
...
@@ -585,8 +619,10 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
//搜索
if
(
mCurrentViewMode
==
MealConstant
.
ViewMode_keys
)
{
showViewModeVisibility
(
MealConstant
.
food_group_ViewMode
,
MealConstant
.
food_ViewMode
);
SPUtils
.
put
(
this
,
MealConstant
.
EXIT_IS_PLU_MODE
,
false
);
}
else
{
showViewModeVisibility
(
MealConstant
.
ViewMode_keys
);
SPUtils
.
put
(
this
,
MealConstant
.
EXIT_IS_PLU_MODE
,
true
);
}
setPluMode
();
}
else
if
(
id
==
R
.
id
.
btn_meal_delete
)
{
...
...
@@ -614,6 +650,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
}
}
else
if
(
id
==
R
.
id
.
btn_end
)
{
mPresenter
.
getSelectMealAdapter
().
setSelectedMode
(
SelectMealAdapter
.
SINGLE_SELECTED
);
btn_delete
.
setVisibility
(
View
.
VISIBLE
);
setSelectFunctionVisibility
(
View
.
GONE
);
//從多選頁離開 重置選中
mPresenter
.
resetSelected
();
...
...
@@ -629,7 +666,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
case
4
:
case
5
:
OrderBean
order
=
MyOrderManage
.
getInstance
().
getOrderBean
();
if
(
order
!=
null
)
{
if
(
order
!=
null
)
{
// ArmsUtils.snackbarText("訂單ID:" + order.getId());
}
mPresenter
.
changeNumber
(
i
);
...
...
@@ -754,6 +791,11 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
@Override
public
void
onComfirmClick
(
String
number
)
{
recordOperat
(
true
);
Integer
maxSeatCount
=
OpenTableManage
.
getDefault
().
getTableBean
().
getMaxSeatCount
();
if
(
maxSeatCount
!=
null
&&
maxSeatCount
.
intValue
()
<
Integer
.
parseInt
(
number
))
{
showMessage
(
"最大就餐人數不能超過"
+
maxSeatCount
.
intValue
()
+
"人!"
);
return
;
}
mPresenter
.
updateOrderPerson
(
number
,
btn_numberman
);
}
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/FineItemOneAdapter.java
View file @
ff6f0816
...
...
@@ -17,6 +17,7 @@ import com.gingersoft.gsa.cloud.table.R;
import
com.gingersoft.gsa.cloud.table.R2
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.SoldoutCtrFood
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.SoldoutCtrlActivity
;
import
com.gingersoft.gsa.cloud.ui.view.BeveLabelView
;
import
com.jess.arms.base.BaseHolder
;
import
com.jess.arms.base.DefaultAdapter
;
import
com.jess.arms.utils.ArmsUtils
;
...
...
@@ -82,7 +83,7 @@ public class FineItemOneAdapter extends DefaultAdapter<Modifier> {
@Override
public
int
getLayoutId
(
int
viewType
)
{
return
R
.
layout
.
meal_item_f
ood
;
return
R
.
layout
.
meal_item_f
ine
;
}
class
DateTimeItemHolder
extends
BaseHolder
<
Modifier
>
{
...
...
@@ -99,7 +100,8 @@ public class FineItemOneAdapter extends DefaultAdapter<Modifier> {
TextView
tv_soldout
;
@BindView
(
R2
.
id
.
iv_qtySold
)
ImageView
iv_qtySold
;
@BindView
(
R2
.
id
.
blv_soldout
)
BeveLabelView
blv_soldout
;
public
DateTimeItemHolder
(
View
itemView
)
{
super
(
itemView
);
...
...
@@ -221,22 +223,25 @@ public class FineItemOneAdapter extends DefaultAdapter<Modifier> {
RelativeLayout
.
LayoutParams
lp
=
new
RelativeLayout
.
LayoutParams
(
mp
);
lp
.
width
=
ArmsUtils
.
dip2px
(
mContext
,
16
);
lp
.
height
=
ArmsUtils
.
dip2px
(
mContext
,
16
);
lp
.
addRule
(
RelativeLayout
.
ALIGN_PARENT_RIGHT
);
tv_number
.
setLayoutParams
(
lp
);
tv_number
.
setVisibility
(
View
.
INVISIBLE
);
}
private
void
setStatus
(
Modifier
datasBean
)
{
tv_soldout
.
setMaxHeight
(
mOrderNumberShowSize
);
tv_soldout
.
setMinHeight
(
mOrderNumberShowSize
);
//
tv_soldout.setMaxHeight(mOrderNumberShowSize);
//
tv_soldout.setMinHeight(mOrderNumberShowSize);
tv_soldout
.
setTextSize
(
mOrderNumberFontSize
);
tv_soldout
.
setTextColor
(
Color
.
parseColor
(
"#
000000
"
));
tv_soldout
.
setBackgroundDrawable
(
mContext
.
getResources
().
getDrawable
(
R
.
drawable
.
ui_selector_white_rect
));
tv_soldout
.
setMinWidth
(
20
);
tv_soldout
.
setTextSize
(
10
);
tv_soldout
.
setGravity
(
Gravity
.
CENTER
);
tv_soldout
.
setTextColor
(
Color
.
parseColor
(
"#
FFFFFF
"
));
tv_soldout
.
setBackgroundDrawable
(
mContext
.
getResources
().
getDrawable
(
R
.
drawable
.
meal_shape_remaining_number_bg
));
//
tv_soldout.setMinWidth(20);
//
tv_soldout.setTextSize(10);
//
tv_soldout.setGravity(Gravity.CENTER);
tv_soldout
.
setVisibility
(
View
.
INVISIBLE
);
iv_qtySold
.
setVisibility
(
View
.
INVISIBLE
);
blv_soldout
.
setVisibility
(
View
.
INVISIBLE
);
/**
* 设置当前状态
*/
...
...
@@ -244,33 +249,20 @@ public class FineItemOneAdapter extends DefaultAdapter<Modifier> {
if
(
TextUtils
.
isEmpty
(
qty
))
{
tv_soldout
.
setVisibility
(
View
.
INVISIBLE
);
}
else
{
if
(
qty
.
equalsIgnoreCase
(
"售罄"
))
{
iv_qtySold
.
setVisibility
(
View
.
VISIBLE
);
// if (qty.equalsIgnoreCase("售罄")) {
// iv_qtySold.setVisibility(View.VISIBLE);
// } else {
// tv_soldout.setVisibility(View.VISIBLE);
// tv_soldout.setText(qty);
// }
if
(
qty
.
equalsIgnoreCase
(
"售罄"
)
||
qty
.
equalsIgnoreCase
(
"暫停"
)
)
{
blv_soldout
.
setLableText
(
qty
);
blv_soldout
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
tv_soldout
.
setVisibility
(
View
.
VISIBLE
);
tv_soldout
.
setText
(
qty
);
}
}
// for (SoldoutCtrFood sc : mCurrentSlodoutFoodList_Full) {
// if (sc.getType() == SoldoutCtrlActivity.MODIFIER_TYPE && sc.getModifierId().equals(datasBean.getMid())) {
// String name = sc.getQtyName();
// if (name.equals("")) {
// tv_soldout.setVisibility(View.INVISIBLE);
// } else {
// if (sc.getQtyName().equalsIgnoreCase("售罄")) {
// iv_qtySold.setVisibility(View.VISIBLE);
// datasBean.setSoldout(true);
// } else if (sc.getQtyName().equalsIgnoreCase("暫停")) {
// tv_soldout.setVisibility(View.VISIBLE);
// tv_soldout.setText(name);
// } else {
// tv_soldout.setVisibility(View.VISIBLE);
// tv_soldout.setText(name);
// datasBean.setMaxNumber(name);
// }
// }
// }
// }
}
}
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/FineItemTwoAdapter.java
View file @
ff6f0816
...
...
@@ -17,6 +17,7 @@ import com.gingersoft.gsa.cloud.table.R;
import
com.gingersoft.gsa.cloud.table.R2
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.SoldoutCtrFood
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.SoldoutCtrlActivity
;
import
com.gingersoft.gsa.cloud.ui.view.BeveLabelView
;
import
com.jess.arms.base.BaseHolder
;
import
com.jess.arms.base.DefaultAdapter
;
import
com.jess.arms.utils.ArmsUtils
;
...
...
@@ -82,7 +83,7 @@ public class FineItemTwoAdapter extends DefaultAdapter<Modifier> {
@Override
public
int
getLayoutId
(
int
viewType
)
{
return
R
.
layout
.
meal_item_f
ood
;
return
R
.
layout
.
meal_item_f
ine
;
}
class
FineItemHolder
extends
BaseHolder
<
Modifier
>
{
...
...
@@ -99,7 +100,8 @@ public class FineItemTwoAdapter extends DefaultAdapter<Modifier> {
TextView
tv_soldout
;
@BindView
(
R2
.
id
.
iv_qtySold
)
ImageView
iv_qtySold
;
@BindView
(
R2
.
id
.
blv_soldout
)
BeveLabelView
blv_soldout
;
public
FineItemHolder
(
View
itemView
)
{
super
(
itemView
);
...
...
@@ -257,24 +259,27 @@ public class FineItemTwoAdapter extends DefaultAdapter<Modifier> {
}
private
void
setStatus
(
Modifier
datasBean
)
{
tv_soldout
.
setMaxHeight
(
mOrderNumberShowSize
);
tv_soldout
.
setMinHeight
(
mOrderNumberShowSize
);
//
tv_soldout.setMaxHeight(mOrderNumberShowSize);
//
tv_soldout.setMinHeight(mOrderNumberShowSize);
tv_soldout
.
setTextSize
(
mOrderNumberFontSize
);
tv_soldout
.
setTextColor
(
Color
.
parseColor
(
"#
000000
"
));
tv_soldout
.
setBackgroundDrawable
(
mContext
.
getResources
().
getDrawable
(
R
.
drawable
.
ui_selector_white_rect
));
tv_soldout
.
setMinWidth
(
20
);
tv_soldout
.
setTextSize
(
10
);
tv_soldout
.
setGravity
(
Gravity
.
CENTER
);
tv_soldout
.
setTextColor
(
Color
.
parseColor
(
"#
FFFFFF
"
));
tv_soldout
.
setBackgroundDrawable
(
mContext
.
getResources
().
getDrawable
(
R
.
drawable
.
meal_shape_remaining_number_bg
));
//
tv_soldout.setMinWidth(20);
//
tv_soldout.setTextSize(10);
//
tv_soldout.setGravity(Gravity.CENTER);
ViewGroup
.
MarginLayoutParams
mp
=
new
ViewGroup
.
MarginLayoutParams
(
RelativeLayout
.
LayoutParams
.
WRAP_CONTENT
,
RelativeLayout
.
LayoutParams
.
WRAP_CONTENT
);
//item的宽高
mp
.
setMargins
(
0
,
0
,
0
,
0
);
//分别是margin_top那四个属性
RelativeLayout
.
LayoutParams
lp
=
new
RelativeLayout
.
LayoutParams
(
mp
);
lp
.
width
=
ArmsUtils
.
dip2px
(
mContext
,
16
);
lp
.
height
=
ArmsUtils
.
dip2px
(
mContext
,
16
);
lp
.
addRule
(
RelativeLayout
.
ALIGN_PARENT_RIGHT
);
tv_number
.
setLayoutParams
(
lp
);
tv_number
.
setVisibility
(
View
.
INVISIBLE
);
tv_soldout
.
setVisibility
(
View
.
INVISIBLE
);
iv_qtySold
.
setVisibility
(
View
.
INVISIBLE
);
blv_soldout
.
setVisibility
(
View
.
INVISIBLE
);
/**
* 设置当前状态
*/
...
...
@@ -282,33 +287,20 @@ public class FineItemTwoAdapter extends DefaultAdapter<Modifier> {
if
(
TextUtils
.
isEmpty
(
qty
))
{
tv_soldout
.
setVisibility
(
View
.
INVISIBLE
);
}
else
{
if
(
qty
.
equalsIgnoreCase
(
"售罄"
))
{
iv_qtySold
.
setVisibility
(
View
.
VISIBLE
);
// if (qty.equalsIgnoreCase("售罄")) {
//// iv_qtySold.setVisibility(View.VISIBLE);
//// } else {
//// tv_soldout.setVisibility(View.VISIBLE);
//// tv_soldout.setText(qty);
//// }
if
(
qty
.
equalsIgnoreCase
(
"售罄"
)
||
qty
.
equalsIgnoreCase
(
"暫停"
)
)
{
blv_soldout
.
setLableText
(
qty
);
blv_soldout
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
tv_soldout
.
setVisibility
(
View
.
VISIBLE
);
tv_soldout
.
setText
(
qty
);
}
}
// for (SoldoutCtrFood sc : mCurrentSlodoutFoodList_Full) {
// if (sc.getType() == SoldoutCtrlActivity.MODIFIER_TYPE && sc.getModifierId().equals(datasBean.getMid())) {
// String name = sc.getQtyName();
// if (name.equals("")) {
// tv_soldout.setVisibility(View.INVISIBLE);
// } else {
// if (sc.getQtyName().equalsIgnoreCase("售罄")) {
// iv_qtySold.setVisibility(View.VISIBLE);
// datasBean.setSoldout(true);
// } else if (sc.getQtyName().equalsIgnoreCase("暫停")) {
// tv_soldout.setVisibility(View.VISIBLE);
// tv_soldout.setText(name);
// } else {
// tv_soldout.setVisibility(View.VISIBLE);
// tv_soldout.setText(name);
// datasBean.setMaxNumber(name);
// }
// }
// }
// }
}
}
//
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/meal/ComboAdapter.java
View file @
ff6f0816
...
...
@@ -17,6 +17,7 @@ import com.gingersoft.gsa.cloud.database.bean.Food;
import
com.gingersoft.gsa.cloud.database.bean.Modifier
;
import
com.gingersoft.gsa.cloud.table.R
;
import
com.gingersoft.gsa.cloud.table.R2
;
import
com.gingersoft.gsa.cloud.ui.view.BeveLabelView
;
import
com.jess.arms.base.BaseHolder
;
import
com.jess.arms.base.DefaultAdapter
;
import
com.jess.arms.utils.ArmsUtils
;
...
...
@@ -85,6 +86,8 @@ public class ComboAdapter extends DefaultAdapter<ComboItem> {
ImageView
iv_qty_sold
;
@BindView
(
R2
.
id
.
iv_return
)
ImageView
iv_return
;
@BindView
(
R2
.
id
.
blv_soldout
)
BeveLabelView
blv_soldout
;
public
ComboItemHolder
(
View
itemView
)
{
super
(
itemView
);
...
...
@@ -205,14 +208,14 @@ public class ComboAdapter extends DefaultAdapter<ComboItem> {
private
void
setSolodStatus
(
ComboItem
datasBean
)
{
tv_soldout
.
setMaxHeight
(
OrderNumberChildFontSize
);
tv_soldout
.
setMinHeight
(
OrderNumberChildFontSize
);
//
tv_soldout.setMaxHeight(OrderNumberChildFontSize);
//
tv_soldout.setMinHeight(OrderNumberChildFontSize);
tv_soldout
.
setTextSize
(
OrderNumberChildFontSize
);
tv_soldout
.
setTextColor
(
Color
.
parseColor
(
"#000000"
));
tv_soldout
.
setBackgroundDrawable
(
mContext
.
getResources
().
getDrawable
(
R
.
drawable
.
ui_selector_white_rect
));
tv_soldout
.
setMinWidth
(
15
);
tv_soldout
.
setTextSize
(
8
);
tv_soldout
.
setGravity
(
Gravity
.
CENTER
);
//
tv_soldout.setTextColor(Color.parseColor("#000000"));
tv_soldout
.
setBackgroundDrawable
(
mContext
.
getResources
().
getDrawable
(
R
.
drawable
.
meal_shape_remaining_number_bg
));
//
tv_soldout.setMinWidth(15);
//
tv_soldout.setTextSize(8);
//
tv_soldout.setGravity(Gravity.CENTER);
RelativeLayout
.
LayoutParams
lp2
=
new
RelativeLayout
.
LayoutParams
(
new
ViewGroup
.
MarginLayoutParams
(
60
,
40
));
lp2
.
addRule
(
RelativeLayout
.
ALIGN_PARENT_BOTTOM
);
...
...
@@ -221,13 +224,21 @@ public class ComboAdapter extends DefaultAdapter<ComboItem> {
tv_soldout
.
setVisibility
(
View
.
INVISIBLE
);
iv_qty_sold
.
setVisibility
(
View
.
INVISIBLE
);
blv_soldout
.
setVisibility
(
View
.
INVISIBLE
);
String
qty
=
datasBean
.
getCurrentMaxNumber
();
if
(
TextUtils
.
isEmpty
(
qty
))
{
tv_soldout
.
setVisibility
(
View
.
INVISIBLE
);
}
else
{
if
(
qty
.
equalsIgnoreCase
(
"售罄"
))
{
iv_qty_sold
.
setVisibility
(
View
.
VISIBLE
);
// if (qty.equalsIgnoreCase("售罄")) {
// iv_qty_sold.setVisibility(View.VISIBLE);
// } else {
// tv_soldout.setVisibility(View.VISIBLE);
// tv_soldout.setText(qty);
// }
if
(
qty
.
equalsIgnoreCase
(
"售罄"
)
||
qty
.
equalsIgnoreCase
(
"暫停"
)
)
{
blv_soldout
.
setLableText
(
qty
);
blv_soldout
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
tv_soldout
.
setVisibility
(
View
.
VISIBLE
);
tv_soldout
.
setText
(
qty
);
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/meal/FoodAdapter.java
View file @
ff6f0816
...
...
@@ -18,6 +18,7 @@ import com.gingersoft.gsa.cloud.table.R;
import
com.gingersoft.gsa.cloud.table.R2
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.SoldoutCtrFood
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.SoldoutCtrlActivity
;
import
com.gingersoft.gsa.cloud.ui.view.BeveLabelView
;
import
com.jess.arms.base.BaseHolder
;
import
com.jess.arms.base.DefaultAdapter
;
import
com.jess.arms.utils.ArmsUtils
;
...
...
@@ -102,7 +103,8 @@ public class FoodAdapter extends DefaultAdapter<Food> {
TextView
tv_soldout
;
@BindView
(
R2
.
id
.
iv_qtySold
)
ImageView
iv_qtySold
;
@BindView
(
R2
.
id
.
blv_soldout
)
BeveLabelView
blv_soldout
;
public
FoodItemHolder
(
View
itemView
)
{
super
(
itemView
);
...
...
@@ -165,6 +167,7 @@ public class FoodAdapter extends DefaultAdapter<Food> {
RelativeLayout
.
LayoutParams
lp
=
new
RelativeLayout
.
LayoutParams
(
mp
);
lp
.
width
=
ArmsUtils
.
dip2px
(
mContext
,
16
);
lp
.
height
=
ArmsUtils
.
dip2px
(
mContext
,
16
);
lp
.
addRule
(
RelativeLayout
.
ALIGN_PARENT_RIGHT
);
tv_number
.
setLayoutParams
(
lp
);
tv_number
.
setTextSize
(
10
);
...
...
@@ -195,13 +198,15 @@ public class FoodAdapter extends DefaultAdapter<Food> {
tv_soldout
.
setVisibility
(
View
.
INVISIBLE
);
iv_qtySold
.
setVisibility
(
View
.
INVISIBLE
);
blv_soldout
.
setVisibility
(
View
.
INVISIBLE
);
String
qty
=
datasBean
.
getCurrentMaxNumber
();
if
(
TextUtils
.
isEmpty
(
qty
))
{
tv_soldout
.
setVisibility
(
View
.
INVISIBLE
);
}
else
{
if
(
qty
.
equalsIgnoreCase
(
"售罄"
))
{
iv_qtySold
.
setVisibility
(
View
.
VISIBLE
);
if
(
qty
.
equalsIgnoreCase
(
"售罄"
)
||
qty
.
equalsIgnoreCase
(
"暫停"
)
)
{
blv_soldout
.
setLableText
(
qty
);
blv_soldout
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
tv_soldout
.
setVisibility
(
View
.
VISIBLE
);
tv_soldout
.
setText
(
qty
);
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/meal/FoodGroupAdapter.java
View file @
ff6f0816
...
...
@@ -16,6 +16,7 @@ import com.gingersoft.gsa.cloud.table.R;
import
com.gingersoft.gsa.cloud.table.R2
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.SoldoutCtrFood
;
import
com.gingersoft.gsa.cloud.table.mvp.ui.activity.SoldoutCtrlActivity
;
import
com.gingersoft.gsa.cloud.ui.view.BeveLabelView
;
import
com.jess.arms.base.BaseHolder
;
import
com.jess.arms.base.DefaultAdapter
;
import
com.jess.arms.utils.ArmsUtils
;
...
...
@@ -99,6 +100,8 @@ public class FoodGroupAdapter extends DefaultAdapter<Food> {
TextView
tv_number
;
@BindView
(
R2
.
id
.
tv_soldout
)
TextView
tv_soldout
;
@BindView
(
R2
.
id
.
blv_soldout
)
BeveLabelView
blv_soldout
;
public
FoodlGroupItemHolder
(
View
itemView
)
{
super
(
itemView
);
...
...
@@ -213,6 +216,7 @@ public class FoodGroupAdapter extends DefaultAdapter<Food> {
RelativeLayout
.
LayoutParams
lp
=
new
RelativeLayout
.
LayoutParams
(
mp
);
lp
.
width
=
ArmsUtils
.
dip2px
(
mContext
,
16
);
lp
.
height
=
ArmsUtils
.
dip2px
(
mContext
,
16
);
lp
.
addRule
(
RelativeLayout
.
ALIGN_PARENT_RIGHT
);
tv_number
.
setLayoutParams
(
lp
);
if
(
datasBean
.
getNumber
()
==
0
)
{
...
...
@@ -228,12 +232,15 @@ public class FoodGroupAdapter extends DefaultAdapter<Food> {
tv_soldout
.
setMinHeight
(
mOrderNumberShowSize
);
tv_soldout
.
setTextSize
(
mOrderNumberFontSize
);
tv_soldout
.
setVisibility
(
View
.
INVISIBLE
);
blv_soldout
.
setVisibility
(
View
.
INVISIBLE
);
String
qty
=
datasBean
.
getMaxNumber
();
if
(
qty
.
equals
(
""
))
{
tv_soldout
.
setVisibility
(
View
.
IN
VISIBLE
);
}
else
{
t
v_soldout
.
setVisibility
(
View
.
VISIBLE
);
tv_soldout
.
set
Text
(
datasBean
.
getMaxNumber
());
if
(
!
qty
.
equals
(
""
))
{
// tv_soldout.setVisibility(View.
VISIBLE);
// tv_soldout.setText(datasBean.getMaxNumber());
bl
v_soldout
.
setVisibility
(
View
.
VISIBLE
);
blv_soldout
.
setLable
Text
(
datasBean
.
getMaxNumber
());
}
}
}
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/adapter/meal/ModifierAdapter.java
View file @
ff6f0816
...
...
@@ -11,6 +11,7 @@ import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication;
import
com.gingersoft.gsa.cloud.database.bean.Modifier
;
import
com.gingersoft.gsa.cloud.table.R
;
import
com.gingersoft.gsa.cloud.table.R2
;
import
com.gingersoft.gsa.cloud.ui.view.BeveLabelView
;
import
com.jess.arms.base.BaseHolder
;
import
com.jess.arms.base.DefaultAdapter
;
import
com.jess.arms.utils.ArmsUtils
;
...
...
@@ -79,6 +80,8 @@ public class ModifierAdapter extends DefaultAdapter<Modifier> {
ImageView
iv_qty_sold
;
@BindView
(
R2
.
id
.
iv_return
)
ImageView
iv_return
;
@BindView
(
R2
.
id
.
blv_soldout
)
BeveLabelView
blv_soldout
;
public
ComboItemHolder
(
View
itemView
)
{
super
(
itemView
);
...
...
@@ -153,17 +156,28 @@ public class ModifierAdapter extends DefaultAdapter<Modifier> {
// tv_soldout.setVisibility(View.VISIBLE);
// tv_soldout.setText(datasBean.getCurrentMaxNumber());
// }
tv_soldout
.
setBackgroundDrawable
(
mContext
.
getResources
().
getDrawable
(
R
.
drawable
.
meal_shape_remaining_number_bg
));
tv_soldout
.
setMaxHeight
(
OrderNumberChildShowSize
);
tv_soldout
.
setMinHeight
(
OrderNumberChildShowSize
);
tv_soldout
.
setTextSize
(
OrderNumberChildFontSize
);
tv_soldout
.
setVisibility
(
View
.
INVISIBLE
);
iv_qty_sold
.
setVisibility
(
View
.
INVISIBLE
);
blv_soldout
.
setVisibility
(
View
.
INVISIBLE
);
String
qty
=
datasBean
.
getCurrentMaxNumber
();
if
(
TextUtils
.
isEmpty
(
qty
))
{
tv_soldout
.
setVisibility
(
View
.
INVISIBLE
);
}
else
{
if
(
qty
.
equalsIgnoreCase
(
"售罄"
))
{
iv_qty_sold
.
setVisibility
(
View
.
VISIBLE
);
// if (qty.equalsIgnoreCase("售罄")) {
// iv_qty_sold.setVisibility(View.VISIBLE);
// } else {
// tv_soldout.setVisibility(View.VISIBLE);
// tv_soldout.setText(qty);
// }
if
(
qty
.
equalsIgnoreCase
(
"售罄"
)
||
qty
.
equalsIgnoreCase
(
"暫停"
)
)
{
blv_soldout
.
setLableText
(
qty
);
blv_soldout
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
tv_soldout
.
setVisibility
(
View
.
VISIBLE
);
tv_soldout
.
setText
(
qty
);
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/widget/UseMemberDialog.java
0 → 100644
View file @
ff6f0816
This diff is collapsed.
Click to expand it.
table-module/src/main/res/layout/meal_dialog_use_member.xml
0 → 100644
View file @
ff6f0816
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/theme_background_color"
android:orientation=
"vertical"
>
<com.qmuiteam.qmui.widget.QMUITopBar
android:id=
"@+id/topbar"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/head_height"
android:fitsSystemWindows=
"true"
app:qmui_topbar_title_color=
"@color/theme_white_color"
/>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<LinearLayout
android:id=
"@+id/ll_input_phone"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"@dimen/dp_20"
android:orientation=
"horizontal"
>
<com.rengwuxian.materialedittext.MaterialEditText
android:id=
"@+id/ed_phone"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:hint=
"請輸入手機號"
android:lines=
"1"
android:textSize=
"@dimen/sp_14"
android:inputType=
"number"
android:background=
"@drawable/table_shape_input_table_number_frame"
app:met_autoValidate=
"true"
app:met_baseColor=
"#0056d3"
app:met_clearButton=
"true"
app:met_floatingLabel=
"highlight"
app:met_iconPadding=
"2dp"
app:met_primaryColor=
"#982360"
app:met_singleLineEllipsis=
"false"
/>
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id=
"@+id/btn_query_memeber"
android:layout_width=
"wrap_content"
android:layout_height=
"@dimen/dp_40"
android:layout_marginLeft=
"@dimen/dp_10"
android:background=
"@color/theme_color"
android:text=
"查詢"
android:textColor=
"@color/theme_white_color"
/>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/recycler_memeber_info"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_below=
"@+id/ll_input_phone"
android:layout_above=
"@+id/btn_scan"
/>
<ImageView
android:id=
"@+id/iv_no_data"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:src=
"@drawable/png_no_record"
android:layout_centerInParent=
"true"
android:visibility=
"invisible"
/>
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id=
"@+id/btn_scan"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_40"
android:layout_margin=
"@dimen/dp_20"
android:layout_alignParentBottom=
"true"
android:background=
"@color/theme_color"
android:text=
"掃碼"
android:textColor=
"@color/theme_white_color"
android:textSize=
"@dimen/sp_14"
android:textStyle=
"bold"
/>
<LinearLayout
android:id=
"@+id/ll_bottom"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_40"
android:layout_alignParentBottom=
"true"
android:orientation=
"horizontal"
android:visibility=
"invisible"
>
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id=
"@+id/btn_use_member"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_gravity=
"bottom"
android:layout_weight=
"1"
android:background=
"@color/green_400"
android:clickable=
"true"
android:text=
"使用會員"
android:textColor=
"@color/theme_white_color"
android:textSize=
"@dimen/sp_14"
/>
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id=
"@+id/btn_clear_member"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_gravity=
"bottom"
android:layout_weight=
"1"
android:background=
"@color/blue_400"
android:clickable=
"true"
android:visibility=
"visible"
android:text=
"清除"
android:textColor=
"@color/theme_white_color"
android:textSize=
"@dimen/sp_14"
/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
table-module/src/main/res/layout/meal_item_combo.xml
View file @
ff6f0816
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/rl_container"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
...
...
@@ -21,12 +22,25 @@
android:id=
"@+id/tv_soldout"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParent
Righ
t=
"true"
android:layout_alignParent
Lef
t=
"true"
android:layout_gravity=
"right"
android:background=
"@drawable/meal_selector_soldout"
android:background=
"@drawable/meal_shape_remaining_number_bg"
android:visibility=
"invisible"
android:text=
"sold"
android:textAppearance=
"?android:attr/textAppearanceSmall"
/>
<com.gingersoft.gsa.cloud.ui.view.BeveLabelView
android:id=
"@+id/blv_soldout"
android:layout_width=
"25dp"
android:layout_height=
"25dp"
app:label_corner=
"8dp"
app:label_length=
"15dp"
app:label_bg_color=
"#D10035"
app:label_mode=
"left_top"
app:label_text=
"暫停"
app:label_text_color=
"@color/theme_white_color"
app:label_text_size=
"@dimen/sp_8"
/>
<ImageView
android:id=
"@+id/iv_qty_sold"
android:layout_width=
"@dimen/dp_30"
...
...
table-module/src/main/res/layout/meal_item_fine.xml
0 → 100644
View file @
ff6f0816
<?xml version="1.0" encoding="utf-8"?>
<com.qmuiteam.qmui.alpha.QMUIAlphaRelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/rl_container"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<TextView
android:id=
"@+id/tv_food_name"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"1px"
android:layout_marginTop=
"1px"
android:text=
"food"
android:gravity=
"center"
android:textAppearance=
"?android:attr/textAppearanceLarge"
android:textColor=
"@drawable/meal_selector_food_backgroup"
/>
<TextView
android:id=
"@+id/tv_number"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/ui_shape_red_oval"
android:layout_alignParentRight=
"true"
android:gravity=
"center"
android:text=
"number"
android:visibility=
"gone"
android:textAppearance=
"?android:attr/textAppearanceSmall"
android:textColor=
"@color/theme_white_color"
/>
<TextView
android:id=
"@+id/tv_soldout"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentLeft=
"true"
android:layout_alignParentBottom=
"true"
android:layout_gravity=
"right"
android:drawablePadding=
"@dimen/dp_1"
android:paddingTop=
"@dimen/dp_1"
android:paddingBottom=
"@dimen/dp_1"
android:paddingLeft=
"@dimen/dp_1"
android:paddingRight=
"@dimen/dp_6"
android:layout_marginRight=
"2px"
android:layout_marginTop=
"2px"
android:visibility=
"invisible"
android:textColor=
"@color/theme_white_color"
android:text=
"sold"
android:textStyle=
"bold"
/>
<com.gingersoft.gsa.cloud.ui.view.BeveLabelView
android:id=
"@+id/blv_soldout"
android:layout_width=
"25dp"
android:layout_height=
"25dp"
app:label_corner=
"8dp"
app:label_length=
"15dp"
app:label_bg_color=
"#D10035"
app:label_mode=
"left_top"
app:label_text=
"暫停"
app:label_text_color=
"@color/theme_white_color"
app:label_text_size=
"@dimen/sp_8"
/>
<!--<TextView-->
<!--android:id="@+id/tv_status"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_alignParentRight="true"-->
<!--android:layout_gravity="right"-->
<!--android:layout_marginRight="3px"-->
<!--android:layout_marginTop="2px"-->
<!--android:background="@drawable/selector_white_rect"-->
<!--android:text="sold" />-->
<ImageView
android:id=
"@+id/iv_qtySold"
android:layout_width=
"@dimen/dp_40"
android:layout_height=
"@dimen/dp_20"
android:layout_alignParentBottom=
"true"
android:layout_alignParentRight=
"true"
android:layout_gravity=
"right"
android:layout_marginRight=
"1px"
android:layout_marginTop=
"1px"
android:src=
"@drawable/sold"
android:text=
"sold"
/>
</com.qmuiteam.qmui.alpha.QMUIAlphaRelativeLayout>
table-module/src/main/res/layout/meal_item_food.xml
View file @
ff6f0816
<?xml version="1.0" encoding="utf-8"?>
<com.qmuiteam.qmui.alpha.QMUIAlphaRelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/rl_container"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
...
...
@@ -20,6 +21,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/ui_shape_red_oval"
android:layout_alignParentRight=
"true"
android:gravity=
"center"
android:text=
"number"
android:visibility=
"gone"
...
...
@@ -45,6 +47,18 @@
android:text=
"sold"
android:textStyle=
"bold"
/>
<com.gingersoft.gsa.cloud.ui.view.BeveLabelView
android:id=
"@+id/blv_soldout"
android:layout_width=
"40dp"
android:layout_height=
"40dp"
app:label_corner=
"10dp"
app:label_length=
"23dp"
app:label_bg_color=
"#D10035"
app:label_mode=
"left_top"
app:label_text=
"暫停"
app:label_text_color=
"@color/theme_white_color"
app:label_text_size=
"@dimen/sp_10"
/>
<!--<TextView-->
<!--android:id="@+id/tv_status"-->
<!--android:layout_width="wrap_content"-->
...
...
table-module/src/main/res/layout/meal_item_food_group.xml
View file @
ff6f0816
...
...
@@ -26,6 +26,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/ui_shape_red_oval"
android:layout_alignParentRight=
"true"
android:gravity=
"center"
android:text=
"number"
android:textAppearance=
"?android:attr/textAppearanceSmall"
...
...
@@ -44,6 +45,18 @@
android:textStyle=
"bold"
android:visibility=
"invisible"
/>
<com.gingersoft.gsa.cloud.ui.view.BeveLabelView
android:id=
"@+id/blv_soldout"
android:layout_width=
"35dp"
android:layout_height=
"35dp"
app:label_corner=
"8dp"
app:label_length=
"20dp"
app:label_bg_color=
"#D10035"
app:label_mode=
"left_top"
app:label_text=
"暫停"
app:label_text_color=
"@color/theme_white_color"
app:label_text_size=
"@dimen/sp_10"
/>
<View
android:id=
"@+id/right_line"
android:layout_width=
"2px"
...
...
table-module/src/main/res/mipmap-xhdpi/meal_remaining_number.png
0 → 100644
View file @
ff6f0816
471 Bytes
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