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
cc2bb8ac
Commit
cc2bb8ac
authored
Oct 14, 2020
by
宁斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、食品組 食品 細項 折扣寬高行列字體大小可配置
parent
f142c320
Hide whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
850 additions
and
842 deletions
+850
-842
base-module/src/main/java/com/gingersoft/gsa/cloud/base/Api.java
+2
-0
base-module/src/main/java/com/gingersoft/gsa/cloud/base/application/GsaCloudApplication.java
+4
-0
base-module/src/main/java/com/gingersoft/gsa/cloud/base/utils/RestaurantExpandInfoUtils.java
+70
-36
base-module/src/main/java/com/gingersoft/gsa/cloud/bean/RestaurantExpandInfo.java
+50
-78
base-module/src/main/java/com/gingersoft/gsa/cloud/constans/GoldConstants.java
+7
-7
base-module/src/main/java/com/gingersoft/gsa/cloud/database/bean/ColorBean.java
+98
-0
base-module/src/main/java/com/gingersoft/gsa/cloud/database/bean/ExpandInfo.java
+34
-63
base-module/src/main/java/com/gingersoft/gsa/cloud/database/bean/Food.java
+0
-271
base-module/src/main/java/com/gingersoft/gsa/cloud/database/greendao/DaoMaster.java
+3
-0
base-module/src/main/java/com/gingersoft/gsa/cloud/database/greendao/DaoSession.java
+14
-0
base-module/src/main/java/com/gingersoft/gsa/cloud/database/greendao/ExpandInfoDao.java
+2
-22
base-module/src/main/java/com/gingersoft/gsa/cloud/database/utils/ColorDaoUtils.java
+155
-0
config.gradle
+2
-2
download-module/src/main/java/com/gingersoft/gsa/cloud/download/mvp/contract/DownloadContract.java
+2
-0
download-module/src/main/java/com/gingersoft/gsa/cloud/download/mvp/model/DownloadModel.java
+7
-0
download-module/src/main/java/com/gingersoft/gsa/cloud/download/mvp/model/downmanager/DownloadManager.java
+23
-42
download-module/src/main/java/com/gingersoft/gsa/cloud/download/mvp/model/downmanager/DownloadRequest.java
+0
-1
download-module/src/main/java/com/gingersoft/gsa/cloud/download/mvp/model/downmanager/DownloadTaskImp.java
+35
-30
download-module/src/main/java/com/gingersoft/gsa/cloud/download/mvp/model/service/DownloadService.java
+3
-0
download-module/src/main/java/com/gingersoft/gsa/cloud/download/mvp/presenter/DownloadPresenter.java
+205
-181
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/activity/ExpandListActivity.java
+1
-1
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/presenter/BaseOrderPresenter.java
+1
-1
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/presenter/MealStandPresenter.java
+4
-1
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/presenter/OrderContentPresenter.java
+8
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/ui/activity/MealStandActivity.java
+53
-14
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/ui/activity/OrderContentActivity.java
+1
-1
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/ui/activity/SoldoutCtrlActivity.java
+14
-16
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/ui/adapter/CurrentSlodoutFoodAdapter.java
+5
-7
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/ui/adapter/FineItemOneAdapter.java
+5
-5
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/ui/adapter/FineItemTwoAdapter.java
+5
-5
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/ui/adapter/meal/ComboAdapter.java
+5
-5
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/ui/adapter/meal/DiscountAdapter.java
+11
-10
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/ui/adapter/meal/FoodAdapter.java
+8
-18
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/ui/adapter/meal/FoodGroupAdapter.java
+7
-15
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/ui/adapter/meal/ModifierAdapter.java
+5
-9
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/ui/fragment/FineItemAllFragment.java
+1
-1
No files found.
base-module/src/main/java/com/gingersoft/gsa/cloud/base/Api.java
View file @
cc2bb8ac
...
...
@@ -32,4 +32,6 @@ public interface Api {
String
printerDevice_list
=
"printerDevice/list"
;
//日誌上傳
String
upload_app_log
=
"public/cloud/gsa/upload"
;
//獲取顏色表數據
String
color_list
=
"food/getColorList"
;
}
base-module/src/main/java/com/gingersoft/gsa/cloud/base/application/GsaCloudApplication.java
View file @
cc2bb8ac
...
...
@@ -68,6 +68,8 @@ public class GsaCloudApplication extends BaseApplication {
private
Activity
mCurrentActivity
;
public
static
RestaurantExpandInfo
androidSetting
;
public
static
RestaurantExpandInfo
.
UIStyleConfiguration
uiStyleConfiguration
;
public
static
RestaurantExpandInfo
.
FunctionConfiguration
functionConfiguration
;
/**
* 是否開啟皮膚切換
*/
...
...
@@ -128,6 +130,8 @@ public class GsaCloudApplication extends BaseApplication {
AppCrashHandler
.
getInstance
().
init
(
this
);
androidSetting
=
new
RestaurantExpandInfo
();
uiStyleConfiguration
=
new
RestaurantExpandInfo
.
UIStyleConfiguration
();
functionConfiguration
=
new
RestaurantExpandInfo
.
FunctionConfiguration
();
isLogin
=
(
boolean
)
SPUtils
.
get
(
this
,
PrintConstans
.
IS_LOGIN
,
false
);
initExpandInfo
();
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/base/utils/RestaurantExpandInfoUtils.java
View file @
cc2bb8ac
package
com
.
gingersoft
.
gsa
.
cloud
.
base
.
utils
;
import
android.text.TextUtils
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.bean.RestaurantExpandInfo
;
import
com.gingersoft.gsa.cloud.constans.ExpandConstant
;
import
com.gingersoft.gsa.cloud.database.bean.ExpandInfo
;
import
java.lang.reflect.Field
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -68,44 +71,75 @@ public class RestaurantExpandInfoUtils {
}
}
// for (ExpandInfo expandInfo : expandInfoList) {
// if (expandInfo.getValueInt() != null) {
// map.put(expandInfo.getSettingName(), expandInfo.getValueInt());
// } else {
// map.put(expandInfo.getSettingName(), expandInfo.getValueChar());
// }
// }
//
// List<Map> uiFields = ReflectionUtils.getFiledsInfo(RestaurantExpandInfo.UIStyleConfiguration.class);
// List<Map> functionFields = ReflectionUtils.getFiledsInfo(RestaurantExpandInfo.FunctionConfiguration.class);
// for (Map fields : uiFields) {
// String expandinfoName = (String) fields.get("name");
// if (map.containsKey(expandinfoName)) {
// Field field = (Field) fields.get("field");
// Object value = map.get(expandinfoName);
// try {
// field.set(expandinfoName,value);
// } catch (IllegalAccessException e) {
// e.printStackTrace();
// }
// }
// }
// for (Map field : functionFields) {
// if (map.containsKey(field)) {
// String expandinfoName = (String) field.get("name");
// if (map.containsKey(expandinfoName)) {
// Field curField = (Field) field.get("field");
// Object value = map.get(expandinfoName);
// try {
// curField.set(expandinfoName,value);
// } catch (IllegalAccessException e) {
// e.printStackTrace();
// }
// }
// }
// }
for
(
ExpandInfo
expandInfo
:
expandInfoList
)
{
if
(
expandInfo
.
getDataType
()
==
ExpandInfo
.
data_type_int
)
{
map
.
put
(
expandInfo
.
getSettingName
(),
expandInfo
.
getValueInt
());
}
else
if
(
expandInfo
.
getDataType
()
==
ExpandInfo
.
data_type_string
)
{
map
.
put
(
expandInfo
.
getSettingName
(),
expandInfo
.
getValueChar
());
}
else
if
(
expandInfo
.
getDataType
()
==
ExpandInfo
.
data_type_boolean
)
{
map
.
put
(
expandInfo
.
getSettingName
(),
expandInfo
.
getValueInt
()
==
0
);
}
else
if
(
expandInfo
.
getDataType
()
==
ExpandInfo
.
data_type_date
)
{
map
.
put
(
expandInfo
.
getSettingName
(),
expandInfo
.
getValueDatetime
());
}
else
{
//之前的老數據 默認DataType == 0
if
(
expandInfo
.
getValueInt
()
!=
null
)
{
map
.
put
(
expandInfo
.
getSettingName
(),
expandInfo
.
getValueInt
());
}
else
if
(!
TextUtils
.
isEmpty
(
expandInfo
.
getValueChar
()))
{
map
.
put
(
expandInfo
.
getSettingName
(),
expandInfo
.
getValueChar
());
}
else
if
(!
TextUtils
.
isEmpty
(
expandInfo
.
getValueDatetime
()))
{
map
.
put
(
expandInfo
.
getSettingName
(),
expandInfo
.
getValueDatetime
());
}
}
}
RestaurantExpandInfo
.
UIStyleConfiguration
uiStyleConfiguration
=
GsaCloudApplication
.
uiStyleConfiguration
;
Field
uiFields
[]
=
uiStyleConfiguration
.
getClass
().
getDeclaredFields
();
for
(
Field
field
:
uiFields
)
{
String
expandinfoName
=
field
.
getName
();
if
(
map
.
containsKey
(
expandinfoName
))
{
Object
value
=
map
.
get
(
expandinfoName
);
try
{
field
.
setAccessible
(
true
);
Object
fieldType
=
field
.
get
(
uiStyleConfiguration
);
boolean
typeMatch
=
(
value
instanceof
Integer
&&
fieldType
instanceof
Integer
)
||
(
value
instanceof
String
&&
fieldType
instanceof
String
)
||
(
value
instanceof
Boolean
&&
fieldType
instanceof
Boolean
);
if
(!
typeMatch
)
{
//後台配置的類型與前端的不一致 直接不管
continue
;
}
field
.
set
(
uiStyleConfiguration
,
value
);
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
}
}
RestaurantExpandInfo
.
FunctionConfiguration
functionConfiguration
=
GsaCloudApplication
.
functionConfiguration
;
Field
functionFields
[]
=
functionConfiguration
.
getClass
().
getDeclaredFields
();
for
(
Field
field
:
functionFields
)
{
String
expandinfoName
=
field
.
getName
();
if
(
map
.
containsKey
(
expandinfoName
))
{
Object
value
=
map
.
get
(
expandinfoName
);
try
{
field
.
setAccessible
(
true
);
Object
fieldType
=
field
.
get
(
functionConfiguration
);
boolean
typeMatch
=
(
value
instanceof
Integer
&&
fieldType
instanceof
Integer
)
||
(
value
instanceof
String
&&
fieldType
instanceof
String
)
||
(
value
instanceof
Boolean
&&
fieldType
instanceof
Boolean
);
if
(!
typeMatch
)
{
//後台配置的類型與前端的不一致 直接不管
continue
;
}
field
.
set
(
functionConfiguration
,
value
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
}
public
static
<
T
>
T
getValue
(
String
name
,
Object
defaultValue
)
{
if
(
map
!=
null
&&
map
.
containsKey
(
name
))
{
return
(
T
)
map
.
get
(
name
);
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/bean/RestaurantExpandInfo.java
View file @
cc2bb8ac
...
...
@@ -12,98 +12,70 @@ import lombok.Data;
@Data
public
class
RestaurantExpandInfo
{
private
int
TableDirection
;
private
int
RefreshTime
=
1
;
private
int
ItemDecimals
;
private
int
RoundingDecimal
=
1
;
private
int
Rounding
;
private
int
SystemLanguage
=
2
;
private
int
nowLanguageIndex
=
1
;
private
String
orderlanguage
=
"1,2,3"
;
private
String
LanageName
=
"中文,粵語,英文"
;
private
int
DataLanguage
=
2
;
private
boolean
MemberLoginCover
=
true
;
private
boolean
BillTextScroll
=
true
;
private
boolean
EnableErrorLog
=
true
;
private
int
AutoQuitTime
=
600
;
/**
* UI配置相關
*/
private
int
FoodTypeCol
=
4
;
private
int
FoodTypeRow
=
1
;
private
int
FoodCol
=
4
;
private
int
ModCol
=
5
;
private
int
DiscountCol
=
5
;
private
int
LayoutFoodTypeHeight
=
100
;
private
int
FoodBtnHeight
=
120
;
private
int
LayoutQtyHeight
=
40
;
private
int
LayoutQuitHeight
=
40
;
private
int
ModBtnHeight
=
75
;
private
int
FoodTypeFontSize
=
12
;
private
int
FoodFontSize
=
12
;
private
int
ModFontSize
=
14
;
private
int
BillListFontSize
=
12
;
private
int
BillTotalFontSize
=
12
;
private
int
FoodlListFontSize
=
18
;
private
int
ReportFontSize
=
15
;
private
int
orderInfoFontSize
=
16
;
private
int
OrderNumberShowSize
=
20
;
private
int
OrderNumberFontSize
=
7
;
private
int
OrderNumberChildShowSize
=
20
;
private
int
OrderNumberChildFontSize
=
10
;
@Data
public
static
final
class
UIStyleConfiguration
{
private
int
foodGroupRow
=
5
;
private
int
foodGroupColumn
=
2
;
private
int
foodRow
=
4
;
private
int
comboRow
=
4
;
private
int
modRow
=
4
;
private
int
discountRow
=
4
;
private
int
foodGroupBtnHeight
=
100
;
/**
* 食品組、食品、細項、折扣行列寬高
*/
private
int
foodGroupRow
=
2
;
private
int
foodGroupColumn
=
6
;
private
int
foodColumn
=
4
;
private
int
comboColumn
=
4
;
private
int
modColumn
=
4
;
private
int
discountColumn
=
4
;
/**
* 食品組、食品、細項、折扣Item高度
*/
private
int
foodGroupBtnHeight
=
150
;
private
int
foodBtnHeight
=
120
;
private
int
modBtnHeight
=
80
;
private
int
comboHeight
=
90
;
private
int
discountHeight
=
80
;
private
int
foodGroupFontSize
=
12
;
private
int
foodFontSize
=
12
;
private
int
LayoutQtyHeight
=
40
;
/**
* 食品組、食品、細項、折扣字體大小
*/
private
int
foodGroupFontSize
=
14
;
private
int
foodFontSize
=
14
;
private
int
comboFontSize
=
12
;
private
int
modFontSize
=
14
;
private
int
discountFontSize
=
14
;
private
int
modFontSize
=
12
;
private
int
discountFontSize
=
12
;
private
int
OrderNumberShowSize
=
20
;
private
int
OrderNumberFontSize
=
7
;
private
int
OrderNumberChildShowSize
=
20
;
private
int
OrderNumberChildFontSize
=
10
;
//估清控制食品字體大小
private
int
soldoutCtrlFoodFontSize
=
16
;
}
@Data
public
static
final
class
FunctionConfiguration
{
/**
* 賬單小數相關
*/
private
int
Rounding
;
private
int
RoundingDecimal
;
private
int
ItemDecimals
;
private
String
DeliveryPrintCount
;
//外送印單打印次數
private
String
DeliveryClosingPC
;
//外送結賬打印次數
private
String
TableModePrintCount
;
//餐檯印單打印次數
private
String
TableModeClosingPC
;
//餐檯模式結賬單打印次數
private
String
OrderReceivingTimeout
;
//外送接單超時時間
private
String
PrintMemberInfo
;
//是否打印會員信息
private
String
PrintPage
;
//是否打印頁數
private
String
PrintMergerFood
;
//是否合併食品
private
String
PrintStatisticsAmount
;
//是否顯示統計打印數
private
String
PrintFirstOrder
;
//是否打印"頭單"文字
private
String
FrozenChainAutoOrder
;
//是否自動接單 為0true
private
String
MergeSendFood
;
/**
* 送單自動打印上菜紙
*/
private
String
AutoPrinterPaper
;
/**
* 結賬是否打印積分二維碼
*/
private
String
ToPrintQRCode
;
private
int
DeliveryPrintCount
;
//外送印單打印次數
private
int
DeliveryClosingPC
;
//外送結賬打印次數
private
int
TableModePrintCount
;
//餐檯印單打印次數
private
int
TableModeClosingPC
;
//餐檯模式結賬單打印次數
private
int
OrderReceivingTimeout
;
//外送接單超時時間
private
int
PrintMemberInfo
;
//是否打印會員信息
private
int
PrintPage
;
//是否打印頁數
private
int
PrintMergerFood
;
//是否合併食品
private
int
PrintStatisticsAmount
;
//是否顯示統計打印數
private
int
PrintFirstOrder
;
//是否打印"頭單"文字
private
int
FrozenChainAutoOrder
;
//是否自動接單 為0true
private
int
MergeSendFood
;
//送單是否自動合併食品
private
int
AutoPrinterPaper
;
//送單自動打印上菜紙
private
int
ToPrintQRCode
;
//結賬是否打印積分二維碼
private
int
AutoQuitTime
=
600
;
//餐檯模式下單頁多少秒不操作返回餐檯頁面
}
}
base-module/src/main/java/com/gingersoft/gsa/cloud/constans/GoldConstants.java
View file @
cc2bb8ac
...
...
@@ -15,11 +15,11 @@ public interface GoldConstants {
int
refreshTime
=
3
;
// boolean isRefreshData = false;
int
DetailColCount
=
4
;
int
foodGriupColCount
=
5
;
//食品組列數
int
foodGriupRows
=
2
;
//食品組行數
int
foodGriupColumns
=
5
;
//食品組列數
int
foodGriupPageSize
=
1
0
;
//食品組最大顯示數
//
int DetailColCount = 4;
//
int foodGriupColCount = 5;//食品組列數
//
//
int foodGriupRows = 2;//食品組行數
//
int foodGriupColumns = 5;//食品組列數
//
int
foodGriupPageSize
=
1
2
;
//食品組最大顯示數
}
base-module/src/main/java/com/gingersoft/gsa/cloud/database/bean/ColorBean.java
0 → 100644
View file @
cc2bb8ac
package
com
.
gingersoft
.
gsa
.
cloud
.
database
.
bean
;
import
org.greenrobot.greendao.annotation.Entity
;
import
lombok.Data
;
import
org.greenrobot.greendao.annotation.Generated
;
@Data
@Entity
public
class
ColorBean
{
/**
* colorId : 0
* colorStart : $00AF3D0C
* colorStop : $00581C05
* fontColor : $00FDFDFD
* androidColor : #0B0B61
* androidFontColor : #FFFFFF
* createTime : Dec 12, 2018 6:03:58 PM
* editTime : Dec 12, 2018 6:03:58 PM
*/
private
int
colorId
;
private
String
colorStart
;
private
String
colorStop
;
private
String
fontColor
;
private
String
androidColor
;
private
String
androidFontColor
;
private
String
createTime
;
private
String
editTime
;
@Generated
(
hash
=
703020793
)
public
ColorBean
(
int
colorId
,
String
colorStart
,
String
colorStop
,
String
fontColor
,
String
androidColor
,
String
androidFontColor
,
String
createTime
,
String
editTime
)
{
this
.
colorId
=
colorId
;
this
.
colorStart
=
colorStart
;
this
.
colorStop
=
colorStop
;
this
.
fontColor
=
fontColor
;
this
.
androidColor
=
androidColor
;
this
.
androidFontColor
=
androidFontColor
;
this
.
createTime
=
createTime
;
this
.
editTime
=
editTime
;
}
@Generated
(
hash
=
521532773
)
public
ColorBean
()
{
}
public
int
getColorId
()
{
return
this
.
colorId
;
}
public
void
setColorId
(
int
colorId
)
{
this
.
colorId
=
colorId
;
}
public
String
getColorStart
()
{
return
this
.
colorStart
;
}
public
void
setColorStart
(
String
colorStart
)
{
this
.
colorStart
=
colorStart
;
}
public
String
getColorStop
()
{
return
this
.
colorStop
;
}
public
void
setColorStop
(
String
colorStop
)
{
this
.
colorStop
=
colorStop
;
}
public
String
getFontColor
()
{
return
this
.
fontColor
;
}
public
void
setFontColor
(
String
fontColor
)
{
this
.
fontColor
=
fontColor
;
}
public
String
getAndroidColor
()
{
return
this
.
androidColor
;
}
public
void
setAndroidColor
(
String
androidColor
)
{
this
.
androidColor
=
androidColor
;
}
public
String
getAndroidFontColor
()
{
return
this
.
androidFontColor
;
}
public
void
setAndroidFontColor
(
String
androidFontColor
)
{
this
.
androidFontColor
=
androidFontColor
;
}
public
String
getCreateTime
()
{
return
this
.
createTime
;
}
public
void
setCreateTime
(
String
createTime
)
{
this
.
createTime
=
createTime
;
}
public
String
getEditTime
()
{
return
this
.
editTime
;
}
public
void
setEditTime
(
String
editTime
)
{
this
.
editTime
=
editTime
;
}
}
base-module/src/main/java/com/gingersoft/gsa/cloud/database/bean/ExpandInfo.java
View file @
cc2bb8ac
...
...
@@ -6,6 +6,8 @@ import org.greenrobot.greendao.annotation.Id;
import
org.greenrobot.greendao.annotation.Property
;
import
org.greenrobot.greendao.annotation.Transient
;
import
lombok.Data
;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
...
...
@@ -13,6 +15,7 @@ import org.greenrobot.greendao.annotation.Transient;
* 修订历史:2020-05-08
* 描述:餐廳擴展設置表
*/
@Data
@Entity
public
class
ExpandInfo
{
...
...
@@ -30,21 +33,33 @@ public class ExpandInfo {
*/
private
Integer
valueInt
;
private
String
valueChar
;
private
int
valueBoolean
;
private
String
valueDatetime
;
/**
* 功能说明
*/
private
String
remark
;
private
int
dataType
;
//配置的數據類型 1:整形,2:字符型,3:布爾型,4:日期類型
private
String
sort
;
//排序
/**
* 配置的數據類型
* 1:整形
* 2:字符型
* 3:布爾型
* 4:日期類型
*/
private
int
dataType
;
//是否被編輯了
@Transient
private
boolean
isUpdate
=
false
;
//是否被編輯了
private
boolean
isUpdate
=
false
;
@Generated
(
hash
=
136088095
)
public
ExpandInfo
(
Long
id
,
int
restaurantId
,
String
settingName
,
Integer
valueInt
,
String
valueChar
,
String
valueDatetime
,
String
remark
,
int
dataType
,
String
sort
,
int
valueBoolean
)
{
public
static
final
int
data_type_int
=
1
;
public
static
final
int
data_type_string
=
2
;
public
static
final
int
data_type_boolean
=
3
;
public
static
final
int
data_type_date
=
4
;
@Generated
(
hash
=
372331474
)
public
ExpandInfo
(
Long
id
,
int
restaurantId
,
String
settingName
,
Integer
valueInt
,
String
valueChar
,
String
valueDatetime
,
String
remark
,
int
dataType
)
{
this
.
id
=
id
;
this
.
restaurantId
=
restaurantId
;
this
.
settingName
=
settingName
;
...
...
@@ -53,95 +68,59 @@ public class ExpandInfo {
this
.
valueDatetime
=
valueDatetime
;
this
.
remark
=
remark
;
this
.
dataType
=
dataType
;
this
.
sort
=
sort
;
this
.
valueBoolean
=
valueBoolean
;
}
@Generated
(
hash
=
9429432
)
public
ExpandInfo
()
{
}
public
Long
getId
()
{
return
this
.
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
int
getRestaurantId
()
{
return
restaurantId
;
return
this
.
restaurantId
;
}
public
void
setRestaurantId
(
int
restaurantId
)
{
this
.
restaurantId
=
restaurantId
;
}
public
String
getSettingName
()
{
return
settingName
;
return
this
.
settingName
;
}
public
void
setSettingName
(
String
settingName
)
{
this
.
settingName
=
settingName
;
}
public
Integer
getValueInt
()
{
return
valueInt
;
return
this
.
valueInt
;
}
public
void
setValueInt
(
Integer
valueInt
)
{
this
.
valueInt
=
valueInt
;
}
public
String
getValueChar
()
{
return
valueChar
;
return
this
.
valueChar
;
}
public
void
setValueChar
(
String
valueChar
)
{
this
.
valueChar
=
valueChar
;
}
public
String
getRemark
()
{
return
remark
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
public
String
getValueDatetime
()
{
return
valueDatetime
;
return
this
.
valueDatetime
;
}
public
void
setValueDatetime
(
String
valueDatetime
)
{
this
.
valueDatetime
=
valueDatetime
;
}
public
String
getRemark
()
{
return
this
.
remark
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
public
int
getDataType
()
{
return
dataType
;
return
this
.
dataType
;
}
public
void
setDataType
(
int
dataType
)
{
this
.
dataType
=
dataType
;
}
public
String
getSort
()
{
return
sort
;
}
public
void
setSort
(
String
sort
)
{
this
.
sort
=
sort
;
}
public
int
getValueBoolean
()
{
return
valueBoolean
;
}
public
void
setValueBoolean
(
int
valueBoolean
)
{
this
.
valueBoolean
=
valueBoolean
;
}
public
boolean
isUpdate
()
{
return
isUpdate
;
}
...
...
@@ -149,12 +128,4 @@ public class ExpandInfo {
public
void
setUpdate
(
boolean
update
)
{
isUpdate
=
update
;
}
public
boolean
getIsUpdate
()
{
return
this
.
isUpdate
;
}
public
void
setIsUpdate
(
boolean
isUpdate
)
{
this
.
isUpdate
=
isUpdate
;
}
}
base-module/src/main/java/com/gingersoft/gsa/cloud/database/bean/Food.java
View file @
cc2bb8ac
...
...
@@ -28,277 +28,6 @@ import com.gingersoft.gsa.cloud.database.greendao.FoodDao;
@Entity
public
class
Food
{
// /**
// * ID
// */
// @Property(nameInDb = "FID")
// @Id(autoincrement = true)
// private Long id;
//
// /**
// * 上級ID (如0=最高級)
// */
// private Long parentId;
// /**
// * 商户ID
// */
// private Long restaurantId;
// /**食品ID*/
//// private Long fid;
// /**
// * 是否組別
// */
// private Byte isParent;
// /**
// * 排序
// */
// private Long seqNo;
// /**
// * 名稱1
// */
// private String foodName;
// /**
// * 食品名称1
// */
// private String foodName1;
// /**
// * 食品名称2
// */
// private String foodName2;
// /**
// * 自定義食品編號
// */
// private String plu;
// /**
// * 本地对应ID
// */
// private String posFid;
// /**
// * 描述
// */
// private String foodDesc;
// /**
// * 限制比例#0不做判断;(人数*N)
// */
// private Long limitAmount;
// /**
// * 限制类型#1:表示每次送单限制 ;2:表示整单限制
// */
// private Long limitType;
// /**
// * 餐种
// */
// private Long foodSummary;
// /**
// * 0=顯示, 1=隱藏, 2=暫停,3=只显示,不操作
// */
// private Long invisible;
// /**
// * 自動跳出細項頁
// */
// private Byte autoMod;
// /**
// * 金額
// */
// private Double price;
// /**
// * 原價 (刪除線)
// */
// private Double marketPrice;
// /**
// * 餐盒费
// */
// private Double lunchboxPrice;
// /**
// * 食品小图片
// */
// private String imgUrlSmall;
// /**
// * 食品大图片
// */
// private String imageurl;
// /**
// * ricepon显示状态,当为0的时候,取Invisible的状态:0=顯示, 1=隱藏, 2=暫停
// */
// private Long riceponInvisible;
// /**
// * 成本
// */
// private Double cost;
// /**
// * 開始日期
// */
// private Date startDate;
// /**
// * 結束日期
// */
// private Date endDate;
// /**
// * 贊
// */
// private Long like;
// /**
// * 已售
// */
// private Long totalSold;
// /**
// * 是否显示已售
// */
// private Long isSold;
// /**
// * 创建人
// */
// private String createBy;
//
// private Date createTime;
// /**
// * 更新人
// */
// private String updateBy;
// /**
// * 更新时间
// */
// private Date updateTime;
// /**
// * 時段, 請關聯到m_period_info
// */
// private Long periodId;
// /**
// * 是否参与折扣#1:可折扣
// */
// private Long ableDiscount;
// /**
// * 是否外卖#0:是;1:否
// */
// private Long takeaway;
// /**
// * 餐頁面中藍色按鈕有沒有編輯按鈕 (筆的圖按) 0=不可編輯 1=可編輯
// */
// private Long blueEdit;
// /**
// * 購物車中是否可編輯 (加入口味) 0=隱藏購物車中食品的編輯按鈕 1=顯示按鈕
// */
// private Long cartEdit;
// /**
// * 相同項目自動合併 0=不自動合併 1=自動合併
// */
// private Long autoMerge;
// /**
// * 打印設定, 用逗號分隔, *=切紙
// */
// private String printSeting;
// /**
// * 是否打印叫号小票
// */
// private Long isPrintQueueCode;
// /**
// * 打印叫号小票对应队ID
// */
// private Long queueHeadId;
// /**
// * 是否需要經理批準
// */
// private Long approve;
// /**
// * 0=系統顏色, 1=黑色, 2=紅色
// */
// private Long printFont;
// /**
// * 自動顯示細項
// */
// private Long advPrice;
// /**
// * 當金額=0時, 是否打印在帳單上
// */
// private Long printToBill;
// /**
// * 額外食品加分
// */
// private Double pointsAdd;
// /**
// * 額外積分比率
// */
// private Long pointsRatio;
// /**
// * 換購食品所需積分
// */
// private Double pointsRedeem;
// /**
// * 是否打印主项
// */
// private Long ktPrintMainItem;
// /**
// * 是否打印价格
// */
// private Long ktShowPrice;
// /**
// * 0食品清单打印 账单打印//1食品清单不打印 账单不打印//2食品清单打印 账单不打印//3食品清单不打印 账单打印
// */
// private Long printTo;
// /**
// * 食品数量是否同步 餐台人数
// */
// private Long toPax;
// /**
// * 食品类型 0普通食品 1称重食品
// */
// private Long foodType;
// /**
// * gspos自定义表中的Id
// */
// private Long majorMainId;
// /**
// * 部门Id
// */
// private Long deptId;
// /**
// * 是否收取服務費
// */
// private Byte serviceCharge;
// /**
// * 顏色ID
// */
// private Long colorId;
// /**
// * 0:新增;1:修改;2:刪除
// */
// private Long conditions;
// /**
// * 是否同步 0:否 1:是
// */
// private Long isRt;
// /**
// * 是否删除:0正常,1删除
// */
// private Long deletes;
// /**
// * 是否時長食物 0=普通食品 1=計費食品 2=免費N小時 3=時段對沖 4=入場費食品
// */
// private Long isTimingFood;
// /**
// * 最低持續時間
// */
// private Long minLongTime;
//
// private Long unitTime;
// /**
// * 單位價格
// */
// private Double unitPrice;
// /**
// * 免費時間(小時)
// */
// private Long freeLongTime;
// /**
// * 免費開始時間
// */
// private Date freePeriodBegin;
// /**
// * 是否參與會員喜好統計 0 參與 1 不參與
// */
// private Long isStatistic;
/**
* ID
*/
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/database/greendao/DaoMaster.java
View file @
cc2bb8ac
...
...
@@ -21,6 +21,7 @@ public class DaoMaster extends AbstractDaoMaster {
/** Creates underlying database table using DAOs. */
public
static
void
createAllTables
(
Database
db
,
boolean
ifNotExists
)
{
ColorBeanDao
.
createTable
(
db
,
ifNotExists
);
ComboItemDao
.
createTable
(
db
,
ifNotExists
);
DiscountDao
.
createTable
(
db
,
ifNotExists
);
ExpandInfoDao
.
createTable
(
db
,
ifNotExists
);
...
...
@@ -37,6 +38,7 @@ public class DaoMaster extends AbstractDaoMaster {
/** Drops underlying database table using DAOs. */
public
static
void
dropAllTables
(
Database
db
,
boolean
ifExists
)
{
ColorBeanDao
.
dropTable
(
db
,
ifExists
);
ComboItemDao
.
dropTable
(
db
,
ifExists
);
DiscountDao
.
dropTable
(
db
,
ifExists
);
ExpandInfoDao
.
dropTable
(
db
,
ifExists
);
...
...
@@ -67,6 +69,7 @@ public class DaoMaster extends AbstractDaoMaster {
public
DaoMaster
(
Database
db
)
{
super
(
db
,
SCHEMA_VERSION
);
registerDaoClass
(
ColorBeanDao
.
class
);
registerDaoClass
(
ComboItemDao
.
class
);
registerDaoClass
(
DiscountDao
.
class
);
registerDaoClass
(
ExpandInfoDao
.
class
);
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/database/greendao/DaoSession.java
View file @
cc2bb8ac
...
...
@@ -8,6 +8,7 @@ import org.greenrobot.greendao.database.Database;
import
org.greenrobot.greendao.identityscope.IdentityScopeType
;
import
org.greenrobot.greendao.internal.DaoConfig
;
import
com.gingersoft.gsa.cloud.database.bean.ColorBean
;
import
com.gingersoft.gsa.cloud.database.bean.ComboItem
;
import
com.gingersoft.gsa.cloud.database.bean.Discount
;
import
com.gingersoft.gsa.cloud.database.bean.ExpandInfo
;
...
...
@@ -21,6 +22,7 @@ import com.gingersoft.gsa.cloud.database.bean.PrintCurrencyBean;
import
com.gingersoft.gsa.cloud.database.bean.PrintModelBean
;
import
com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean
;
import
com.gingersoft.gsa.cloud.database.greendao.ColorBeanDao
;
import
com.gingersoft.gsa.cloud.database.greendao.ComboItemDao
;
import
com.gingersoft.gsa.cloud.database.greendao.DiscountDao
;
import
com.gingersoft.gsa.cloud.database.greendao.ExpandInfoDao
;
...
...
@@ -43,6 +45,7 @@ import com.gingersoft.gsa.cloud.database.greendao.PrinterDeviceBeanDao;
*/
public
class
DaoSession
extends
AbstractDaoSession
{
private
final
DaoConfig
colorBeanDaoConfig
;
private
final
DaoConfig
comboItemDaoConfig
;
private
final
DaoConfig
discountDaoConfig
;
private
final
DaoConfig
expandInfoDaoConfig
;
...
...
@@ -56,6 +59,7 @@ public class DaoSession extends AbstractDaoSession {
private
final
DaoConfig
printModelBeanDaoConfig
;
private
final
DaoConfig
printerDeviceBeanDaoConfig
;
private
final
ColorBeanDao
colorBeanDao
;
private
final
ComboItemDao
comboItemDao
;
private
final
DiscountDao
discountDao
;
private
final
ExpandInfoDao
expandInfoDao
;
...
...
@@ -73,6 +77,9 @@ public class DaoSession extends AbstractDaoSession {
daoConfigMap
)
{
super
(
db
);
colorBeanDaoConfig
=
daoConfigMap
.
get
(
ColorBeanDao
.
class
).
clone
();
colorBeanDaoConfig
.
initIdentityScope
(
type
);
comboItemDaoConfig
=
daoConfigMap
.
get
(
ComboItemDao
.
class
).
clone
();
comboItemDaoConfig
.
initIdentityScope
(
type
);
...
...
@@ -109,6 +116,7 @@ public class DaoSession extends AbstractDaoSession {
printerDeviceBeanDaoConfig
=
daoConfigMap
.
get
(
PrinterDeviceBeanDao
.
class
).
clone
();
printerDeviceBeanDaoConfig
.
initIdentityScope
(
type
);
colorBeanDao
=
new
ColorBeanDao
(
colorBeanDaoConfig
,
this
);
comboItemDao
=
new
ComboItemDao
(
comboItemDaoConfig
,
this
);
discountDao
=
new
DiscountDao
(
discountDaoConfig
,
this
);
expandInfoDao
=
new
ExpandInfoDao
(
expandInfoDaoConfig
,
this
);
...
...
@@ -122,6 +130,7 @@ public class DaoSession extends AbstractDaoSession {
printModelBeanDao
=
new
PrintModelBeanDao
(
printModelBeanDaoConfig
,
this
);
printerDeviceBeanDao
=
new
PrinterDeviceBeanDao
(
printerDeviceBeanDaoConfig
,
this
);
registerDao
(
ColorBean
.
class
,
colorBeanDao
);
registerDao
(
ComboItem
.
class
,
comboItemDao
);
registerDao
(
Discount
.
class
,
discountDao
);
registerDao
(
ExpandInfo
.
class
,
expandInfoDao
);
...
...
@@ -137,6 +146,7 @@ public class DaoSession extends AbstractDaoSession {
}
public
void
clear
()
{
colorBeanDaoConfig
.
clearIdentityScope
();
comboItemDaoConfig
.
clearIdentityScope
();
discountDaoConfig
.
clearIdentityScope
();
expandInfoDaoConfig
.
clearIdentityScope
();
...
...
@@ -151,6 +161,10 @@ public class DaoSession extends AbstractDaoSession {
printerDeviceBeanDaoConfig
.
clearIdentityScope
();
}
public
ColorBeanDao
getColorBeanDao
()
{
return
colorBeanDao
;
}
public
ComboItemDao
getComboItemDao
()
{
return
comboItemDao
;
}
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/database/greendao/ExpandInfoDao.java
View file @
cc2bb8ac
...
...
@@ -32,8 +32,6 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> {
public
final
static
Property
ValueDatetime
=
new
Property
(
5
,
String
.
class
,
"valueDatetime"
,
false
,
"VALUE_DATETIME"
);
public
final
static
Property
Remark
=
new
Property
(
6
,
String
.
class
,
"remark"
,
false
,
"REMARK"
);
public
final
static
Property
DataType
=
new
Property
(
7
,
int
.
class
,
"dataType"
,
false
,
"DATA_TYPE"
);
public
final
static
Property
Sort
=
new
Property
(
8
,
String
.
class
,
"sort"
,
false
,
"SORT"
);
public
final
static
Property
ValueBoolean
=
new
Property
(
9
,
int
.
class
,
"valueBoolean"
,
false
,
"VALUE_BOOLEAN"
);
}
...
...
@@ -56,9 +54,7 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> {
"\"VALUE_CHAR\" TEXT,"
+
// 4: valueChar
"\"VALUE_DATETIME\" TEXT,"
+
// 5: valueDatetime
"\"REMARK\" TEXT,"
+
// 6: remark
"\"DATA_TYPE\" INTEGER NOT NULL ,"
+
// 7: dataType
"\"SORT\" TEXT,"
+
// 8: sort
"\"VALUE_BOOLEAN\" INTEGER NOT NULL );"
);
// 9: valueBoolean
"\"DATA_TYPE\" INTEGER NOT NULL );"
);
// 7: dataType
}
/** Drops the underlying database table. */
...
...
@@ -102,12 +98,6 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> {
stmt
.
bindString
(
7
,
remark
);
}
stmt
.
bindLong
(
8
,
entity
.
getDataType
());
String
sort
=
entity
.
getSort
();
if
(
sort
!=
null
)
{
stmt
.
bindString
(
9
,
sort
);
}
stmt
.
bindLong
(
10
,
entity
.
getValueBoolean
());
}
@Override
...
...
@@ -145,12 +135,6 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> {
stmt
.
bindString
(
7
,
remark
);
}
stmt
.
bindLong
(
8
,
entity
.
getDataType
());
String
sort
=
entity
.
getSort
();
if
(
sort
!=
null
)
{
stmt
.
bindString
(
9
,
sort
);
}
stmt
.
bindLong
(
10
,
entity
.
getValueBoolean
());
}
@Override
...
...
@@ -168,9 +152,7 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> {
cursor
.
isNull
(
offset
+
4
)
?
null
:
cursor
.
getString
(
offset
+
4
),
// valueChar
cursor
.
isNull
(
offset
+
5
)
?
null
:
cursor
.
getString
(
offset
+
5
),
// valueDatetime
cursor
.
isNull
(
offset
+
6
)
?
null
:
cursor
.
getString
(
offset
+
6
),
// remark
cursor
.
getInt
(
offset
+
7
),
// dataType
cursor
.
isNull
(
offset
+
8
)
?
null
:
cursor
.
getString
(
offset
+
8
),
// sort
cursor
.
getInt
(
offset
+
9
)
// valueBoolean
cursor
.
getInt
(
offset
+
7
)
// dataType
);
return
entity
;
}
...
...
@@ -185,8 +167,6 @@ public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> {
entity
.
setValueDatetime
(
cursor
.
isNull
(
offset
+
5
)
?
null
:
cursor
.
getString
(
offset
+
5
));
entity
.
setRemark
(
cursor
.
isNull
(
offset
+
6
)
?
null
:
cursor
.
getString
(
offset
+
6
));
entity
.
setDataType
(
cursor
.
getInt
(
offset
+
7
));
entity
.
setSort
(
cursor
.
isNull
(
offset
+
8
)
?
null
:
cursor
.
getString
(
offset
+
8
));
entity
.
setValueBoolean
(
cursor
.
getInt
(
offset
+
9
));
}
@Override
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/database/utils/ColorDaoUtils.java
0 → 100644
View file @
cc2bb8ac
package
com
.
gingersoft
.
gsa
.
cloud
.
database
.
utils
;
import
android.content.Context
;
import
android.util.Log
;
import
com.gingersoft.gsa.cloud.database.DaoManager
;
import
com.gingersoft.gsa.cloud.database.bean.ColorBean
;
import
com.gingersoft.gsa.cloud.database.greendao.ColorBeanDao
;
import
java.util.List
;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
* 创建日期:2020-01-02
* 修订历史:2020-01-02
* 描述:
*/
public
class
ColorDaoUtils
{
private
static
final
String
TAG
=
ColorDaoUtils
.
class
.
getSimpleName
();
private
DaoManager
mManager
;
private
Context
mContext
;
public
ColorDaoUtils
(
Context
context
)
{
mManager
=
DaoManager
.
getInstance
();
mManager
.
init
(
context
);
this
.
mContext
=
context
;
}
/**
* 清除緩存
*/
public
void
detachAll
()
{
ColorBeanDao
colorBeanDao
=
DaoManager
.
getInstance
().
getDaoSession
().
getColorBeanDao
();
colorBeanDao
.
detachAll
();
}
/**
* 完成Food记录的插入,如果表未创建,先创建Food表
*
* @param colorBean
* @return
*/
public
boolean
insertColorBean
(
ColorBean
colorBean
)
{
boolean
flag
=
false
;
flag
=
mManager
.
getDaoSession
().
getColorBeanDao
().
insert
(
colorBean
)
==
-
1
?
false
:
true
;
Log
.
i
(
TAG
,
"insert ColorBeanItem :"
+
flag
+
"-->"
+
colorBean
.
toString
());
return
flag
;
}
/**
* 插入多条数据,在子线程操作
*
* @param colorBeanList
* @return
*/
public
boolean
insertMultColorBean
(
final
List
<
ColorBean
>
colorBeanList
)
{
boolean
flag
=
false
;
try
{
mManager
.
getDaoSession
().
runInTx
(
new
Runnable
()
{
@Override
public
void
run
()
{
for
(
ColorBean
colorBean
:
colorBeanList
)
{
mManager
.
getDaoSession
().
insertOrReplace
(
colorBean
);
}
}
});
flag
=
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
flag
;
}
/**
* 修改一条数据
*
* @param colorBean
* @return
*/
public
boolean
updateColorBean
(
ColorBean
colorBean
)
{
boolean
flag
=
false
;
try
{
mManager
.
getDaoSession
().
update
(
colorBean
);
flag
=
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
flag
;
}
/**
* 删除单条记录
*
* @param colorBean
* @return
*/
public
boolean
deleteColorBean
(
ColorBean
colorBean
)
{
boolean
flag
=
false
;
try
{
//按照id删除
mManager
.
getDaoSession
().
delete
(
colorBean
);
flag
=
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
flag
;
}
/**
* 删除所有记录
*
* @return
*/
public
boolean
deleteAll
()
{
boolean
flag
=
false
;
try
{
//按照id删除
mManager
.
getDaoSession
().
deleteAll
(
ColorBean
.
class
);
flag
=
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
flag
;
}
/**
* 查询所有记录
*
* @return
*/
public
List
<
ColorBean
>
queryAllColorBean
()
{
return
mManager
.
getDaoSession
().
loadAll
(
ColorBean
.
class
);
}
/**
* 根据主键id查询记录
*
* @param key
* @return
*/
public
ColorBean
queryColorBeanById
(
long
key
)
{
return
mManager
.
getDaoSession
().
load
(
ColorBean
.
class
,
key
);
}
/**
* 使用native sql进行查询操作
*/
public
List
<
ColorBean
>
queryColorBeanByNativeSql
(
String
sql
,
String
[]
conditions
)
{
return
mManager
.
getDaoSession
().
queryRaw
(
ColorBean
.
class
,
sql
,
conditions
);
}
}
config.gradle
View file @
cc2bb8ac
...
...
@@ -7,8 +7,8 @@ ext {
targetSdkVersion
:
29
,
//正式版: 1.0.3 3
//內部測試版:1.2.0 20
versionCode
:
8
,
versionName
:
"1.0.
8
"
versionCode
:
9
,
versionName
:
"1.0.
9
"
]
version
=
[
...
...
download-module/src/main/java/com/gingersoft/gsa/cloud/download/mvp/contract/DownloadContract.java
View file @
cc2bb8ac
...
...
@@ -66,5 +66,7 @@ public interface DownloadContract {
Observable
<
BaseResult
>
downExpandInfo
(
int
restaurantId
);
Observable
<
BaseResult
>
downPrinterList
(
int
restaurantId
);
Observable
<
BaseResult
>
downColorList
();
}
}
download-module/src/main/java/com/gingersoft/gsa/cloud/download/mvp/model/DownloadModel.java
View file @
cc2bb8ac
...
...
@@ -125,5 +125,11 @@ public class DownloadModel extends BaseModel implements DownloadContract.Model {
.
downPrinterList
(
restaurantId
);
}
@Override
public
Observable
<
BaseResult
>
downColorList
()
{
return
mRepositoryManager
.
obtainRetrofitService
(
DownloadService
.
class
)
.
downColorList
();
}
}
\ No newline at end of file
download-module/src/main/java/com/gingersoft/gsa/cloud/download/mvp/model/downmanager/DownloadManager.java
View file @
cc2bb8ac
...
...
@@ -36,7 +36,7 @@ public class DownloadManager {
return
downloadManager
;
}
public
DownloadManager
takeRequestExecute
(
List
<
DownloadRequest
>
requests
,
DownloadPresenter
presenter
)
{
public
DownloadManager
takeRequestExecute
(
List
<
DownloadRequest
>
requests
)
{
this
.
requestCount
=
requests
.
size
();
//重置响应数
this
.
responseSuccessCount
=
0
;
...
...
@@ -46,66 +46,47 @@ public class DownloadManager {
for
(
int
i
=
0
;
i
<
requests
.
size
();
i
++)
{
DownloadRequest
request
=
requests
.
get
(
i
);
if
(
request
!=
null
)
{
DownloadTaskImp
taskImp
=
new
DownloadTaskImp
(
request
,
presenter
);
DownloadTaskImp
taskImp
=
new
DownloadTaskImp
(
request
);
poolManager
.
putExecutableTasks
(
taskImp
);
}
}
return
this
;
}
public
DownloadManager
takeRequestExecute
(
List
<
DownloadRequest
>
requests
,
OnRunnableListener
listener
)
{
if
(
listener
==
null
)
{
return
this
;
}
public
void
download
(
DownloadRequest
request
)
{
OkHttp3Utils
.
get
(
request
.
getUrl
())
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
new
Observer
<
String
>()
{
@Override
public
void
onSubscribe
(
Disposable
d
)
{
}
@Override
public
void
onNext
(
String
data
)
{
if
(
listener
!=
null
)
{
listener
.
onSuccess
(
data
,
request
.
getDownTag
());
}
//同步响应数加+1
responseSuccessCount
++;
}
this
.
requestCount
=
requests
.
size
();
//重置响应数
this
.
responseSuccessCount
=
0
;
@Override
public
void
onError
(
Throwable
t
)
{
if
(
listener
!=
null
)
{
listener
.
onError
(
t
,
request
.
getDownTag
());
}
responseErrorCount
++;
}
ThreadPoolManager
poolManager
=
ThreadPoolManager
.
getInstence
();
for
(
int
i
=
0
;
i
<
requests
.
size
();
i
++)
{
DownloadRequest
request
=
requests
.
get
(
i
);
if
(
request
!=
null
)
{
poolManager
.
putExecutableTasks
(
new
Runnable
()
{
@Override
public
void
onComplete
()
{
if
(
responseSuccessCount
==
requestCount
)
{
if
(
listener
!=
null
)
{
listener
.
noComplete
();
}
}
public
void
run
()
{
listener
.
run
(
request
);
}
});
}
}
return
this
;
}
private
On
DownloadResult
Listener
listener
;
private
On
Runnable
Listener
listener
;
public
void
set
DownloadResultListener
(
OnDownloadResult
Listener
listener
)
{
public
void
set
RunnableListener
(
OnRunnable
Listener
listener
)
{
this
.
listener
=
listener
;
}
public
interface
OnDownloadResultListener
{
void
onSuccess
(
String
respose
,
int
downTag
);
void
onError
(
Throwable
t
,
int
downTag
);
public
interface
OnRunnableListener
{
void
noComplete
(
);
void
run
(
Object
o
);
}
}
download-module/src/main/java/com/gingersoft/gsa/cloud/download/mvp/model/downmanager/DownloadRequest.java
View file @
cc2bb8ac
...
...
@@ -14,7 +14,6 @@ public class DownloadRequest {
private
int
restaurantId
;
public
int
getDownTag
()
{
return
downTag
;
}
...
...
download-module/src/main/java/com/gingersoft/gsa/cloud/download/mvp/model/downmanager/DownloadTaskImp.java
View file @
cc2bb8ac
...
...
@@ -14,41 +14,46 @@ public class DownloadTaskImp implements Runnable {
private
DownloadRequest
request
;
private
DownloadPresenter
presenter
;
public
DownloadTaskImp
(
DownloadRequest
request
,
DownloadPresenter
presenter
)
{
// public DownloadTaskImp(DownloadRequest request, DownloadPresenter presenter) {
// this.request = request;
// this.presenter = presenter;
// }
public
DownloadTaskImp
(
DownloadRequest
request
)
{
this
.
request
=
request
;
this
.
presenter
=
presenter
;
}
@Override
public
void
run
()
{
switch
(
request
.
getDownTag
())
{
case
0
:
presenter
.
downFun
(
request
.
getDownTag
());
break
;
case
1
:
presenter
.
downFoodList
(
request
.
getDownTag
());
break
;
case
2
:
presenter
.
downModifier
(
request
.
getDownTag
());
break
;
case
3
:
presenter
.
downFoodCombo
(
request
.
getDownTag
());
break
;
case
4
:
presenter
.
downComboItem
(
request
.
getDownTag
());
break
;
case
5
:
presenter
.
downFoodModifier
(
request
.
getDownTag
());
break
;
case
6
:
presenter
.
downDiscount
(
request
.
getDownTag
());
break
;
case
7
:
presenter
.
downExpandInfo
(
request
.
getDownTag
());
break
;
case
8
:
presenter
.
downPrinterList
(
request
.
getDownTag
());
break
;
}
//
switch (request.getDownTag()) {
//
case 0:
//
presenter.downFun(request.getDownTag());
//
break;
//
case 1:
//
presenter.downFoodList(request.getDownTag());
//
break;
//
case 2:
//
presenter.downModifier(request.getDownTag());
//
break;
//
case 3:
//
presenter.downFoodCombo(request.getDownTag());
//
break;
//
case 4:
//
presenter.downComboItem(request.getDownTag());
//
break;
//
case 5:
//
presenter.downFoodModifier(request.getDownTag());
//
break;
//
case 6:
//
presenter.downDiscount(request.getDownTag());
//
break;
//
case 7:
//
presenter.downExpandInfo(request.getDownTag());
//
break;
//
case 8:
//
presenter.downPrinterList(request.getDownTag());
//
break;
//
}
}
}
download-module/src/main/java/com/gingersoft/gsa/cloud/download/mvp/model/service/DownloadService.java
View file @
cc2bb8ac
...
...
@@ -46,4 +46,7 @@ public interface DownloadService {
@GET
(
Api
.
printerDevice_list
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
BaseResult
>
downPrinterList
(
@Query
(
"restaurantId"
)
int
restaurantId
);
@GET
(
Api
.
color_list
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
BaseResult
>
downColorList
();
}
download-module/src/main/java/com/gingersoft/gsa/cloud/download/mvp/presenter/DownloadPresenter.java
View file @
cc2bb8ac
...
...
@@ -3,6 +3,7 @@ package com.gingersoft.gsa.cloud.download.mvp.presenter;
import
android.app.Application
;
import
com.billy.cc.core.component.CC
;
import
com.bumptech.glide.Glide
;
import
com.gingersoft.gsa.cloud.base.Api
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.common.bean.BaseResult
;
...
...
@@ -11,10 +12,12 @@ import com.gingersoft.gsa.cloud.base.utils.RestaurantExpandInfoUtils;
import
com.gingersoft.gsa.cloud.base.utils.CommonConfiguration
;
import
com.gingersoft.gsa.cloud.base.utils.JsonUtils
;
import
com.gingersoft.gsa.cloud.constans.HttpsConstans
;
import
com.gingersoft.gsa.cloud.database.bean.ColorBean
;
import
com.gingersoft.gsa.cloud.database.bean.Discount
;
import
com.gingersoft.gsa.cloud.database.bean.ExpandInfo
;
import
com.gingersoft.gsa.cloud.database.bean.Function
;
import
com.gingersoft.gsa.cloud.database.bean.PrinterListBean
;
import
com.gingersoft.gsa.cloud.database.utils.ColorDaoUtils
;
import
com.gingersoft.gsa.cloud.database.utils.ComboItemDaoUtils
;
import
com.gingersoft.gsa.cloud.database.utils.DiscountDaoUtils
;
import
com.gingersoft.gsa.cloud.database.utils.ExpandInfoDaoUtils
;
...
...
@@ -47,9 +50,11 @@ import java.util.List;
import
javax.inject.Inject
;
import
io.reactivex.Observable
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.annotations.NonNull
;
import
io.reactivex.disposables.Disposable
;
import
io.reactivex.functions.Consumer
;
import
io.reactivex.schedulers.Schedulers
;
import
me.jessyan.rxerrorhandler.core.RxErrorHandler
;
import
me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber
;
...
...
@@ -83,9 +88,9 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
private
DataDownLoadAdapter
mAapter
;
private
List
<
DataDownLoadState
>
mList
=
new
ArrayList
<>();
private
String
[]
downTitles
=
{
"功能列表"
,
"食品列表"
,
"食品細項"
,
"食品套餐"
,
"套餐食品"
,
"食品細項"
,
"折扣信息"
,
"擴展信息"
,
"打印機列表"
};
private
String
[]
downTitles
=
{
"功能列表"
,
"食品列表"
,
"食品細項"
,
"食品套餐"
,
"套餐食品"
,
"食品細項"
,
"折扣信息"
,
"擴展信息"
,
"打印機列表"
,
"顏色列表"
};
//下載所佔比例
private
int
[]
ratios
=
{
5
,
46
,
22
,
5
,
5
,
5
,
4
,
4
,
4
};
private
int
[]
ratios
=
{
5
,
46
,
22
,
5
,
5
,
5
,
3
,
3
,
3
,
3
};
private
String
urlList
[]
=
{
HttpsConstans
.
ROOT_SERVER_ADDRESS_FORMAL
+
Api
.
download_function_list
,
HttpsConstans
.
ROOT_SERVER_ADDRESS_FORMAL
+
Api
.
food_list
,
...
...
@@ -95,12 +100,8 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
HttpsConstans
.
ROOT_SERVER_ADDRESS_FORMAL
+
Api
.
food_modifiere_relation
,
HttpsConstans
.
ROOT_SERVER_ADDRESS_FORMAL
+
Api
.
restaurant_discount
,
HttpsConstans
.
ROOT_SERVER_ADDRESS_FORMAL
+
Api
.
expand_info
,
HttpsConstans
.
ROOT_SERVER_ADDRESS_FORMAL
+
Api
.
printerDevice_list
};
// private String[] downTitles = {"打印機列表"};
// //下載所佔比例
// private int[] ratios = {100};
// private String urlList[] = {HttpsConstans.ROOT_SERVER_ADDRESS_FORMAL + Api.printerDevice_list};
HttpsConstans
.
ROOT_SERVER_ADDRESS_FORMAL
+
Api
.
printerDevice_list
,
HttpsConstans
.
ROOT_SERVER_ADDRESS_FORMAL
+
Api
.
color_list
};
//当前请求响应成功数
private
int
responseSuccessCount
;
...
...
@@ -154,130 +155,62 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
List
<
DownloadRequest
>
requests
=
getDownloadRequests
(
getDownloadUrls
(
restaurantId
),
restaurantId
);
DownloadManager
.
getInstance
().
takeRequestExecute
(
requests
,
this
);
// .setDownloadResultListener(new DownloadManager.OnDownloadResultListener() {
//
// @Override
// public void onSuccess(String respose, int downTag) {
// switch (downTag) {
// case 0://
// FunctionRespone functionBean = GsonUtils.GsonToBean(respose, FunctionRespone.class);
// if (functionBean != null) {
// FunctionDaoUtils functionDao = new FunctionDaoUtils(IActivity);
// functionDao.deleteAll();
// if (functionBean.isSuccess() && functionBean.getData() != null) {
// functionDao.insertMultFunction(functionBean.getData());
// }
// }
// break;
// case 1:
// FoodBean foodBean = GsonUtils.GsonToBean(respose, FoodBean.class);
// if (foodBean != null) {
// FoodDaoUtils foodDao = new FoodDaoUtils(IActivity);
// foodDao.deleteAll();
// if (foodBean.isSuccess() && foodBean.getData() != null) {
// foodDao.insertMultFood(foodBean.getData());
// }
// }
// break;
// case 2:
// ModifierRespone modifier = GsonUtils.GsonToBean(respose, ModifierRespone.class);
// if (modifier != null) {
// ModifierDaoUtils modifierDao = new ModifierDaoUtils(IActivity);
// modifierDao.deleteAll();
// if (modifier.isSuccess() && modifier.getData() != null) {
// modifierDao.insertMultModifier(modifier.getData());
// }
// }
// break;
// case 3:
// FoodComboRespone combo = GsonUtils.GsonToBean(respose, FoodComboRespone.class);
// if (combo != null) {
// FoodComboDaoUtils comboDao = new FoodComboDaoUtils(IActivity);
// comboDao.deleteAll();
// if (combo.isSuccess() && combo.getData() != null) {
// comboDao.insertMultCombo(combo.getData());
// }
// }
// break;
// case 4:
// FoodModifierRespone foodModifier = GsonUtils.GsonToBean(respose, FoodModifierRespone.class);
// if (foodModifier != null) {
// FoodModifierDaoUtils foodModifierDao = new FoodModifierDaoUtils(IActivity);
// foodModifierDao.deleteAll();
// if (foodModifier.isSuccess() && foodModifier.getData() != null) {
// foodModifierDao.insertMultFoodModifier(foodModifier.getData());
// }
// }
// break;
// }
// mList.get(downTag).setState(2);
// mAapter.notifyItemChanged(downTag);
// }
//
// @Override
// public void onError(Throwable t, int downTag) {
// mRootView.showMessage("部分下載失敗,點擊刷新按鈕重新下載");
// }
//
// @Override
// public void noComplete() {
// endDownReturn();
// }
// });
DownloadManager
.
getInstance
().
takeRequestExecute
(
requests
,
new
DownloadManager
.
OnRunnableListener
()
{
@Override
public
void
run
(
Object
o
)
{
DownloadRequest
request
=
(
DownloadRequest
)
o
;
switch
(
request
.
getDownTag
())
{
case
0
:
downFun
(
request
.
getDownTag
());
break
;
case
1
:
downFoodList
(
request
.
getDownTag
());
break
;
case
2
:
downModifier
(
request
.
getDownTag
());
break
;
case
3
:
downFoodCombo
(
request
.
getDownTag
());
break
;
case
4
:
downComboItem
(
request
.
getDownTag
());
break
;
case
5
:
downFoodModifier
(
request
.
getDownTag
());
break
;
case
6
:
downDiscount
(
request
.
getDownTag
());
break
;
case
7
:
downExpandInfo
(
request
.
getDownTag
());
break
;
case
8
:
downPrinterList
(
request
.
getDownTag
());
break
;
case
9
:
downColorList
(
request
.
getDownTag
());
break
;
}
}
});
}
public
void
stopDownDisposable
()
{
for
(
int
i
=
0
;
i
<
mDownDisposable
.
size
();
i
++)
{
if
(
mDownDisposable
.
get
(
i
)
!=
null
&&
!
mDownDisposable
.
get
(
i
).
isDisposed
())
if
(
mDownDisposable
.
get
(
i
)
!=
null
&&
!
mDownDisposable
.
get
(
i
).
isDisposed
())
{
mDownDisposable
.
get
(
i
).
dispose
();
}
}
mDownDisposable
.
clear
();
}
private
List
<
Function
>
getFunctions
()
{
List
<
Function
>
functions
=
new
ArrayList
<>();
Function
function
=
new
Function
();
function
.
setResName
(
"重置餐檯"
);
function
.
setId
((
long
)
1
);
function
.
setResUrl
(
"table/bottom/init"
);
functions
.
add
(
function
);
Function
function2
=
new
Function
();
function2
.
setResName
(
"轉檯"
);
function2
.
setId
((
long
)
2
);
function2
.
setResUrl
(
"table/bottom/move"
);
functions
.
add
(
function2
);
Function
function3
=
new
Function
();
function3
.
setResName
(
"分檯"
);
function3
.
setId
((
long
)
3
);
function3
.
setResUrl
(
"table/bottom/splite"
);
functions
.
add
(
function3
);
Function
function4
=
new
Function
();
function4
.
setResName
(
"上菜紙"
);
function4
.
setId
((
long
)
4
);
function4
.
setResUrl
(
"table/bottom/parper"
);
functions
.
add
(
function4
);
Function
function5
=
new
Function
();
function5
.
setResName
(
"skyorder"
);
function5
.
setId
((
long
)
5
);
function5
.
setResUrl
(
"table/bottom/skyorder"
);
functions
.
add
(
function5
);
return
functions
;
}
public
void
downFun
(
int
downTag
)
{
// List<Function> functions = getFunctions();
long
userId
=
GsaCloudApplication
.
getMemberId
();
mModel
.
downFunctionList
(
userId
)
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
FunctionRespone
>(
mErrorHandler
)
{
...
...
@@ -291,11 +224,17 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
@Override
public
void
onNext
(
@NonNull
FunctionRespone
functionBean
)
{
if
(
functionBean
.
isSuccess
())
{
if
(
functionBean
.
getData
()
!=
null
)
{
FunctionDaoUtils
functionDao
=
new
FunctionDaoUtils
(
IActivity
);
functionDao
.
deleteAll
();
functionDao
.
insertMultFunction
(
functionBean
.
getData
());
Observable
.
just
(
0
)
.
observeOn
(
Schedulers
.
io
())
.
subscribe
(
new
Consumer
<
Integer
>()
{
@Override
public
void
accept
(
@NonNull
Integer
integer
)
throws
Exception
{
FunctionDaoUtils
functionDao
=
new
FunctionDaoUtils
(
IActivity
);
functionDao
.
deleteAll
();
functionDao
.
insertMultFunction
(
functionBean
.
getData
());
}
});
}
DataDownLoadState
loadState
=
mList
.
get
(
downTag
);
...
...
@@ -324,8 +263,6 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
public
void
downFoodList
(
int
downTag
)
{
int
restaurantId
=
GsaCloudApplication
.
getRestaurantId
();
mModel
.
downFoodList
(
restaurantId
)
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
FoodBean
>(
mErrorHandler
)
{
...
...
@@ -339,11 +276,17 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
@Override
public
void
onNext
(
@NonNull
FoodBean
foodBean
)
{
if
(
foodBean
.
isSuccess
())
{
if
(
foodBean
.
getData
()
!=
null
)
{
FoodDaoUtils
foodDao
=
new
FoodDaoUtils
(
IActivity
);
foodDao
.
deleteAll
();
foodDao
.
insertMultFood
(
foodBean
.
getData
());
Observable
.
just
(
0
)
.
observeOn
(
Schedulers
.
io
())
.
subscribe
(
new
Consumer
<
Integer
>()
{
@Override
public
void
accept
(
@NonNull
Integer
integer
)
throws
Exception
{
FoodDaoUtils
foodDao
=
new
FoodDaoUtils
(
IActivity
);
foodDao
.
deleteAll
();
foodDao
.
insertMultFood
(
foodBean
.
getData
());
}
});
}
DataDownLoadState
loadState
=
mList
.
get
(
downTag
);
...
...
@@ -372,8 +315,6 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
public
void
downModifier
(
int
downTag
)
{
int
restaurantId
=
GsaCloudApplication
.
getRestaurantId
();
mModel
.
downModifier
(
restaurantId
)
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
ModifierRespone
>(
mErrorHandler
)
{
...
...
@@ -387,12 +328,18 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
@Override
public
void
onNext
(
@NonNull
ModifierRespone
modifier
)
{
if
(
modifier
.
isSuccess
())
{
if
(
modifier
.
getData
()
!=
null
)
{
ModifierDaoUtils
modifierDao
=
new
ModifierDaoUtils
(
IActivity
);
modifierDao
.
deleteAll
();
modifierDao
.
insertMultModifier
(
modifier
.
getData
());
CommonConfiguration
.
getInstance
().
saveModifierTopIdConfiguration
(
modifier
.
getData
());
Observable
.
just
(
0
)
.
observeOn
(
Schedulers
.
io
())
.
subscribe
(
new
Consumer
<
Integer
>()
{
@Override
public
void
accept
(
@NonNull
Integer
integer
)
throws
Exception
{
ModifierDaoUtils
modifierDao
=
new
ModifierDaoUtils
(
IActivity
);
modifierDao
.
deleteAll
();
modifierDao
.
insertMultModifier
(
modifier
.
getData
());
CommonConfiguration
.
getInstance
().
saveModifierTopIdConfiguration
(
modifier
.
getData
());
}
});
}
DataDownLoadState
loadState
=
mList
.
get
(
downTag
);
...
...
@@ -421,8 +368,6 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
public
void
downFoodCombo
(
int
downTag
)
{
int
restaurantId
=
GsaCloudApplication
.
getRestaurantId
();
mModel
.
downFoodCombo
(
restaurantId
)
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
FoodComboRespone
>(
mErrorHandler
)
{
...
...
@@ -436,12 +381,18 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
@Override
public
void
onNext
(
@NonNull
FoodComboRespone
combo
)
{
if
(
combo
.
isSuccess
())
{
if
(
combo
.
getData
()
!=
null
)
{
FoodComboDaoUtils
comboDao
=
new
FoodComboDaoUtils
(
IActivity
);
comboDao
.
deleteAll
();
comboDao
.
insertMultCombo
(
combo
.
getData
());
CommonConfiguration
.
getInstance
().
saveComboIdConfiguration
(
combo
.
getData
());
Observable
.
just
(
0
)
.
observeOn
(
Schedulers
.
io
())
.
subscribe
(
new
Consumer
<
Integer
>()
{
@Override
public
void
accept
(
@NonNull
Integer
integer
)
throws
Exception
{
FoodComboDaoUtils
comboDao
=
new
FoodComboDaoUtils
(
IActivity
);
comboDao
.
deleteAll
();
comboDao
.
insertMultCombo
(
combo
.
getData
());
CommonConfiguration
.
getInstance
().
saveComboIdConfiguration
(
combo
.
getData
());
}
});
}
DataDownLoadState
loadState
=
mList
.
get
(
downTag
);
...
...
@@ -471,8 +422,6 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
public
void
downComboItem
(
int
downTag
)
{
int
restaurantId
=
GsaCloudApplication
.
getRestaurantId
();
mModel
.
downComboItem
(
restaurantId
)
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
ComboItemRespone
>(
mErrorHandler
)
{
...
...
@@ -486,11 +435,17 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
@Override
public
void
onNext
(
@NonNull
ComboItemRespone
combo
)
{
if
(
combo
.
isSuccess
())
{
if
(
combo
.
getData
()
!=
null
)
{
ComboItemDaoUtils
comboDao
=
new
ComboItemDaoUtils
(
IActivity
);
comboDao
.
deleteAll
();
comboDao
.
insertMultCombo
(
combo
.
getData
());
Observable
.
just
(
0
)
.
observeOn
(
Schedulers
.
io
())
.
subscribe
(
new
Consumer
<
Integer
>()
{
@Override
public
void
accept
(
@NonNull
Integer
integer
)
throws
Exception
{
ComboItemDaoUtils
comboDao
=
new
ComboItemDaoUtils
(
IActivity
);
comboDao
.
deleteAll
();
comboDao
.
insertMultCombo
(
combo
.
getData
());
}
});
}
DataDownLoadState
loadState
=
mList
.
get
(
downTag
);
...
...
@@ -519,8 +474,6 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
public
void
downFoodModifier
(
int
downTag
)
{
int
restaurantId
=
GsaCloudApplication
.
getRestaurantId
();
mModel
.
downFoodModifier
(
restaurantId
)
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
FoodModifierRespone
>(
mErrorHandler
)
{
...
...
@@ -534,13 +487,18 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
@Override
public
void
onNext
(
@NonNull
FoodModifierRespone
foodModifier
)
{
if
(
foodModifier
.
isSuccess
())
{
if
(
foodModifier
.
getData
()
!=
null
)
{
FoodModifierDaoUtils
foodModifierDao
=
new
FoodModifierDaoUtils
(
IActivity
);
foodModifierDao
.
deleteAll
();
foodModifierDao
.
insertMultFoodModifier
(
foodModifier
.
getData
());
Observable
.
just
(
0
)
.
observeOn
(
Schedulers
.
io
())
.
subscribe
(
new
Consumer
<
Integer
>()
{
@Override
public
void
accept
(
@NonNull
Integer
integer
)
throws
Exception
{
FoodModifierDaoUtils
foodModifierDao
=
new
FoodModifierDaoUtils
(
IActivity
);
foodModifierDao
.
deleteAll
();
foodModifierDao
.
insertMultFoodModifier
(
foodModifier
.
getData
());
}
});
}
DataDownLoadState
loadState
=
mList
.
get
(
downTag
);
loadState
.
setState
(
2
);
mAapter
.
notifyItemChanged
(
downTag
);
...
...
@@ -567,8 +525,6 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
public
void
downDiscount
(
int
downTag
)
{
int
restaurantId
=
GsaCloudApplication
.
getRestaurantId
();
mModel
.
downDiscount
(
restaurantId
)
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
BaseResult
>(
mErrorHandler
)
{
...
...
@@ -582,16 +538,21 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
@Override
public
void
onNext
(
@NonNull
BaseResult
result
)
{
if
(
result
.
isSuccess
())
{
if
(
result
.
getData
()
!=
null
)
{
DiscountDaoUtils
discountDaoUtils
=
new
DiscountDaoUtils
(
IActivity
);
discountDaoUtils
.
deleteAll
();
List
<
Discount
>
discountList
=
JsonUtils
.
parseArray
(
result
.
getData
(),
Discount
.
class
);
if
(
discountList
!=
null
)
{
discountDaoUtils
.
insertMultDiscount
(
discountList
);
}
Observable
.
just
(
0
)
.
observeOn
(
Schedulers
.
io
())
.
subscribe
(
new
Consumer
<
Integer
>()
{
@Override
public
void
accept
(
@NonNull
Integer
integer
)
throws
Exception
{
DiscountDaoUtils
discountDaoUtils
=
new
DiscountDaoUtils
(
IActivity
);
discountDaoUtils
.
deleteAll
();
List
<
Discount
>
discountList
=
JsonUtils
.
parseArray
(
result
.
getData
(),
Discount
.
class
);
if
(
discountList
!=
null
)
{
discountDaoUtils
.
insertMultDiscount
(
discountList
);
}
}
});
}
DataDownLoadState
loadState
=
mList
.
get
(
downTag
);
loadState
.
setState
(
2
);
mAapter
.
notifyItemChanged
(
downTag
);
...
...
@@ -618,8 +579,6 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
public
void
downExpandInfo
(
int
downTag
)
{
int
restaurantId
=
GsaCloudApplication
.
getRestaurantId
();
mModel
.
downExpandInfo
(
restaurantId
)
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
BaseResult
>(
mErrorHandler
)
{
...
...
@@ -634,13 +593,20 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
public
void
onNext
(
@NonNull
BaseResult
result
)
{
if
(
result
.
isSuccess
())
{
if
(
result
.
getData
()
!=
null
)
{
ExpandInfoDaoUtils
expandInfoDaoUtils
=
new
ExpandInfoDaoUtils
(
IActivity
);
expandInfoDaoUtils
.
deleteAll
();
List
<
ExpandInfo
>
expandInfoList
=
JsonUtils
.
parseArray
(
result
.
getData
(),
ExpandInfo
.
class
);
if
(
expandInfoList
!=
null
)
{
expandInfoDaoUtils
.
insertMultExpandInfo
(
expandInfoList
);
RestaurantExpandInfoUtils
.
setCommonExpandInfo
(
expandInfoList
);
}
Observable
.
just
(
0
)
.
observeOn
(
Schedulers
.
io
())
.
subscribe
(
new
Consumer
<
Integer
>()
{
@Override
public
void
accept
(
@NonNull
Integer
integer
)
throws
Exception
{
ExpandInfoDaoUtils
expandInfoDaoUtils
=
new
ExpandInfoDaoUtils
(
IActivity
);
expandInfoDaoUtils
.
deleteAll
();
List
<
ExpandInfo
>
expandInfoList
=
JsonUtils
.
parseArray
(
result
.
getData
(),
ExpandInfo
.
class
);
if
(
expandInfoList
!=
null
)
{
expandInfoDaoUtils
.
insertMultExpandInfo
(
expandInfoList
);
RestaurantExpandInfoUtils
.
setCommonExpandInfo
(
expandInfoList
);
}
}
});
}
DataDownLoadState
loadState
=
mList
.
get
(
downTag
);
loadState
.
setState
(
2
);
...
...
@@ -668,8 +634,6 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
public
void
downPrinterList
(
int
downTag
)
{
int
restaurantId
=
GsaCloudApplication
.
getRestaurantId
();
mModel
.
downPrinterList
(
restaurantId
)
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
BaseResult
>(
mErrorHandler
)
{
...
...
@@ -683,14 +647,74 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
@Override
public
void
onNext
(
@NonNull
BaseResult
result
)
{
if
(
result
.
isSuccess
())
{
if
(
result
.
getData
()
!=
null
)
{
Observable
.
just
(
0
)
.
observeOn
(
Schedulers
.
io
())
.
subscribe
(
new
Consumer
<
Integer
>()
{
@Override
public
void
accept
(
@NonNull
Integer
integer
)
throws
Exception
{
PrinterDeviceDaoUtils
printerDeviceDaoUtils
=
new
PrinterDeviceDaoUtils
(
IActivity
);
printerDeviceDaoUtils
.
deleteAll
();
PrinterListBean
printerListBean
=
JsonUtils
.
parseObject
(
result
.
getData
(),
PrinterListBean
.
class
);
if
(
printerListBean
!=
null
&&
printerListBean
.
getList
()
!=
null
)
{
printerDeviceDaoUtils
.
insertMultPrinterDeviceBean
(
printerListBean
.
getList
());
}
}
});
}
DataDownLoadState
loadState
=
mList
.
get
(
downTag
);
loadState
.
setState
(
2
);
mAapter
.
notifyItemChanged
(
downTag
);
currentProgress
+=
loadState
.
getRatio
();
IActivity
.
setTvProgress
(
currentProgress
);
responseSuccessCount
++;
if
(
responseSuccessCount
==
requestCount
)
{
endDownReturn
();
}
}
}
@Override
public
void
onError
(
Throwable
t
)
{
super
.
onError
(
t
);
DataDownLoadState
loadState
=
mList
.
get
(
downTag
);
loadState
.
setState
(
0
);
mRootView
.
showMessage
(
"部分下載失敗,點擊刷新按鈕重新下載"
);
}
});
}
public
void
downColorList
(
int
downTag
)
{
mModel
.
downColorList
()
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
BaseResult
>(
mErrorHandler
)
{
@Override
public
void
onSubscribe
(
Disposable
d
)
{
super
.
onSubscribe
(
d
);
mDownDisposable
.
add
(
d
);
}
@Override
public
void
onNext
(
@NonNull
BaseResult
result
)
{
if
(
result
.
isSuccess
())
{
if
(
result
.
getData
()
!=
null
)
{
PrinterDeviceDaoUtils
printerDeviceDaoUtils
=
new
PrinterDeviceDaoUtils
(
IActivity
);
printerDeviceDaoUtils
.
deleteAll
();
PrinterListBean
printerListBean
=
JsonUtils
.
parseObject
(
result
.
getData
(),
PrinterListBean
.
class
);
if
(
printerListBean
!=
null
&&
printerListBean
.
getList
()
!=
null
)
{
printerDeviceDaoUtils
.
insertMultPrinterDeviceBean
(
printerListBean
.
getList
());
}
Observable
.
just
(
0
)
.
observeOn
(
Schedulers
.
io
())
.
subscribe
(
new
Consumer
<
Integer
>()
{
@Override
public
void
accept
(
@NonNull
Integer
integer
)
throws
Exception
{
ColorDaoUtils
colorDaoUtils
=
new
ColorDaoUtils
(
IActivity
);
colorDaoUtils
.
deleteAll
();
List
<
ColorBean
>
colorBeanList
=
JsonUtils
.
parseArray
(
result
.
getData
(),
ColorBean
.
class
);
if
(
colorBeanList
!=
null
)
{
colorDaoUtils
.
insertMultColorBean
(
colorBeanList
);
}
}
});
}
DataDownLoadState
loadState
=
mList
.
get
(
downTag
);
loadState
.
setState
(
2
);
...
...
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/activity/ExpandListActivity.java
View file @
cc2bb8ac
...
...
@@ -132,7 +132,7 @@ public class ExpandListActivity extends BaseActivity<ExpandListPresenter> implem
List
<
ExpandInfo
>
data
=
expandListAdapter
.
getData
();
List
<
ExpandInfo
>
updateDate
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
data
.
size
();
i
++)
{
if
(
data
.
get
(
i
).
getI
sUpdate
())
{
if
(
data
.
get
(
i
).
i
sUpdate
())
{
updateDate
.
add
(
data
.
get
(
i
));
}
}
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/presenter/BaseOrderPresenter.java
View file @
cc2bb8ac
...
...
@@ -1400,7 +1400,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
*
* @param foodList
*/
pr
ivate
void
mergeMainFoodNumber
(
List
<
OrderDetail
>
foodList
)
{
pr
otected
void
mergeMainFoodNumber
(
List
<
OrderDetail
>
foodList
)
{
List
<
Integer
>
removeIndexs
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
foodList
.
size
();
i
++)
{
OrderDetail
orderFood
=
foodList
.
get
(
i
);
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/presenter/MealStandPresenter.java
View file @
cc2bb8ac
...
...
@@ -864,6 +864,10 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
*/
private
void
printSendOrder
(
boolean
initTable
)
{
if
(
RestaurantExpandInfoUtils
.
getValue
(
ExpandConstant
.
AutoPrinterPaper
,
true
))
{
if
(
RestaurantExpandInfoUtils
.
getValue
(
ExpandConstant
.
MergeSendFood
,
true
))
{
//合并主食品
mergeMainFoodNumber
(
mOrderFoodList
);
}
CC
.
obtainBuilder
(
"Component.Print"
)
.
setActionName
(
"printActivity"
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
PrintConstans
.
PRINT_SERVE
)
...
...
@@ -871,7 +875,6 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
.
callAsyncCallbackOnMainThread
((
cc
,
result
)
->
{
if
(
result
.
isSuccess
())
{
}
else
{
mRootView
.
showMessage
(
"打印失敗"
);
}
//打印成功
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/presenter/OrderContentPresenter.java
View file @
cc2bb8ac
...
...
@@ -379,6 +379,10 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
mRootView
.
startActivityForResult
(
OrderContentActivity
.
BILL_CODE
,
afterToActivity
,
null
);
}
if
(
RestaurantExpandInfoUtils
.
getValue
(
ExpandConstant
.
AutoPrinterPaper
,
true
))
{
if
(
RestaurantExpandInfoUtils
.
getValue
(
ExpandConstant
.
MergeSendFood
,
true
))
{
//合并主食品
mergeMainFoodNumber
(
mOrderFoodList
);
}
CC
.
obtainBuilder
(
"Component.Print"
)
.
setActionName
(
"printActivity"
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
PrintConstans
.
PRINT_SERVE
)
...
...
@@ -418,6 +422,10 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
@Override
public
void
onNext
(
@NonNull
BaseOrderRespose
info
)
{
if
(
info
!=
null
&&
info
.
isSuccess
())
{
if
(
RestaurantExpandInfoUtils
.
getValue
(
ExpandConstant
.
MergeSendFood
,
true
))
{
//合并主食品
mergeMainFoodNumber
(
mOrderFoodList
);
}
CC
.
obtainBuilder
(
"Component.Print"
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
PrintConstans
.
PRINT_SLIP
)
//印單
.
setActionName
(
"printActivity"
)
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/ui/activity/MealStandActivity.java
View file @
cc2bb8ac
...
...
@@ -71,6 +71,7 @@ import com.qmuiteam.qmui.util.QMUIDrawableHelper;
import
org.simple.eventbus.EventBus
;
import
java.text.DecimalFormat
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
...
...
@@ -84,6 +85,7 @@ import androidx.recyclerview.widget.GridLayoutManager;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
androidx.viewpager.widget.ViewPager
;
import
butterknife.BindView
;
import
butterknife.OnClick
;
import
butterknife.OnLongClick
;
...
...
@@ -255,8 +257,13 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
private
static
final
int
ORDER_CONTENT_CODE
=
1002
;
public
static
final
int
SCAN_REQUEST_CODE
=
0x0000c0de
;
private
int
ComboColCount
=
4
;
private
int
DiscountCol
=
3
;
private
int
foodGroupRow
=
2
;
private
int
foodGroupColumn
=
6
;
private
int
foodColumn
=
4
;
private
int
comboColumn
=
4
;
private
int
modColumn
=
4
;
private
int
discountColumn
=
4
;
@Override
public
void
setupActivityComponent
(
@NonNull
AppComponent
appComponent
)
{
...
...
@@ -282,6 +289,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
@Override
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
initUIStyleConfiguration
();
initViewMap
();
//初始化Plu模式
setPluMode
();
...
...
@@ -306,6 +314,15 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
initTableDetail
();
}
private
void
initUIStyleConfiguration
()
{
foodGroupColumn
=
GsaCloudApplication
.
uiStyleConfiguration
.
getFoodGroupColumn
();
foodGroupRow
=
GsaCloudApplication
.
uiStyleConfiguration
.
getFoodGroupRow
();
foodColumn
=
GsaCloudApplication
.
uiStyleConfiguration
.
getFoodColumn
();
comboColumn
=
GsaCloudApplication
.
uiStyleConfiguration
.
getComboColumn
();
modColumn
=
GsaCloudApplication
.
uiStyleConfiguration
.
getModColumn
();
discountColumn
=
GsaCloudApplication
.
uiStyleConfiguration
.
getModColumn
();
}
private
void
initTableDetail
()
{
if
(
OpenTableManage
.
getDefault
().
getPeopleNumber
()
==
0
)
{
showChoosePeopleNumDialog
(
false
);
...
...
@@ -342,11 +359,17 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
//总的页数向上取整
totalPage
=
(
int
)
Math
.
ceil
(
foodGroupList
.
size
()
*
1.0
/
GoldConstants
.
foodGriupPageSize
);
int
Rows
=
GoldConstants
.
foodGriupRows
;
if
(
foodGroupList
.
size
()
<=
GoldConstants
.
foodGriupColumns
)
{
// int Rows = GoldConstants.foodGriupRows;
// if (foodGroupList.size() <= GoldConstants.foodGriupColumns) {
// Rows = 1;
// }
// mLayoutManager = new PagerGridLayoutManager(Rows, GoldConstants.foodGriupColumns, PagerGridLayoutManager.HORIZONTAL);
int
Rows
=
foodGroupRow
;
if
(
foodGroupList
.
size
()
<=
foodGroupColumn
)
{
Rows
=
1
;
}
mLayoutManager
=
new
PagerGridLayoutManager
(
Rows
,
GoldConstants
.
foodGriupColumns
,
PagerGridLayoutManager
.
HORIZONTAL
);
mLayoutManager
=
new
PagerGridLayoutManager
(
Rows
,
foodGroupColumn
,
PagerGridLayoutManager
.
HORIZONTAL
);
// 水平分页布局管理器
mLayoutManager
.
setPageListener
(
this
);
...
...
@@ -379,7 +402,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
}
});
int
mParentColHeight
=
GsaCloudApplication
.
androidSetting
.
getLayoutFoodTypeHeight
()
/
GsaCloudApplication
.
androidSetting
.
getFoodTypeRow
()
*
Rows
;
int
mParentColHeight
=
GsaCloudApplication
.
uiStyleConfiguration
.
getFoodGroupBtnHeight
()
*
Rows
;
//设置ViewPager适配器
rv_food_group
.
setLayoutParams
(
new
LinearLayout
.
LayoutParams
(
...
...
@@ -794,7 +817,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
public
void
onChronometerTick
(
Chronometer
chronometer
)
{
// 执行一下看看是否按下了home键的线程
// 如果开始计时到现在超过了autoQuitTime秒
if
(
SystemClock
.
elapsedRealtime
()
-
chronometer
.
getBase
()
>
GsaCloudApplication
.
androidSetting
.
getAutoQuitTime
()
*
1000
)
{
if
(
SystemClock
.
elapsedRealtime
()
-
chronometer
.
getBase
()
>
GsaCloudApplication
.
functionConfiguration
.
getAutoQuitTime
()
*
1000
)
{
// 停止计时
chronometer
.
stop
();
returnBeforeActivity
(
true
);
...
...
@@ -967,14 +990,30 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
@Override
public
void
setFoodGroupRecycleSpanCount
(
int
size
)
{
DecimalFormat
df
=
new
DecimalFormat
(
"###.00"
);
String
span
=
df
.
format
((
double
)
size
/
foodGroupColumn
);
int
spanCount
=
(
int
)
Math
.
ceil
(
Double
.
parseDouble
(
span
));
//33.333
boolean
twoRow
=
spanCount
>
1
&&
spanCount
<
2
||
spanCount
==
2
;
// if (size <= foodGroupColumn) {
// setFoodGroupRecycleLayoutManager(GridLayoutManager.HORIZONTAL);
// foodGroupRecycleLayoutManager.setSpanCount(1);
// } else if (twoRow) {
// setFoodGroupRecycleLayoutManager(GridLayoutManager.VERTICAL);
// foodGroupRecycleLayoutManager.setSpanCount(foodGroupColumn);
// } else {
// setFoodGroupRecycleLayoutManager(GridLayoutManager.HORIZONTAL);
// foodGroupRecycleLayoutManager.setSpanCount(foodGroupColumn);
// }
}
@Override
public
void
setFoodRecycleSpanCount
(
int
size
)
{
if
(
size
>
0
)
{
if
(
size
>
GoldConstants
.
DetailColCount
)
{
if
(
size
>
foodColumn
)
{
setFoodRecycleLayoutManager
(
LinearLayoutManager
.
VERTICAL
);
foodRecycleLayoutManager
.
setSpanCount
(
GoldConstants
.
DetailColCount
);
foodRecycleLayoutManager
.
setSpanCount
(
foodColumn
);
}
else
{
//只有一行就使用水平显示以免不能占满
setFoodRecycleLayoutManager
(
LinearLayoutManager
.
HORIZONTAL
);
...
...
@@ -985,9 +1024,9 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
@Override
public
void
setComboRecycleSpanCount
(
int
size
)
{
if
(
size
>
0
)
{
// if (size >
ComboColCount
) {
// if (size >
comboRow
) {
setComboRecycleLayoutManager
(
LinearLayoutManager
.
VERTICAL
);
comboRecycleLayoutManager
.
setSpanCount
(
ComboColCount
);
comboRecycleLayoutManager
.
setSpanCount
(
comboColumn
);
// } else if (size <= ComboColCount) {
// } else {
// //只有一行就使用水平显示以免不能占满
...
...
@@ -999,9 +1038,9 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
@Override
public
void
setModifierRecycleSpanCount
(
int
size
)
{
if
(
size
>
0
)
{
// if (size >
ComboColCount
) {
// if (size >
modRow
) {
setModifierRecycleLayoutManager
(
LinearLayoutManager
.
VERTICAL
);
modifierRecycleLayoutManager
.
setSpanCount
(
ComboColCount
);
modifierRecycleLayoutManager
.
setSpanCount
(
modColumn
);
// } else if (size <= ComboColCount) {
// } else {
// //只有一行就使用水平显示以免不能占满
...
...
@@ -1014,7 +1053,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
public
void
setDiscountRecycleSpanCount
(
int
size
)
{
if
(
size
>
0
)
{
setDiscountRecycleLayoutManager
(
LinearLayoutManager
.
VERTICAL
);
discountRecycleLayoutManager
.
setSpanCount
(
DiscountCol
);
discountRecycleLayoutManager
.
setSpanCount
(
discountColumn
);
}
}
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/ui/activity/OrderContentActivity.java
View file @
cc2bb8ac
...
...
@@ -445,7 +445,7 @@ public class OrderContentActivity extends BaseFragmentActivity<OrderContentPrese
public
void
onChronometerTick
(
Chronometer
chronometer
)
{
// 执行一下看看是否按下了home键的线程
// 如果开始计时到现在超过了autoQuitTime秒
if
(
SystemClock
.
elapsedRealtime
()
-
chronometer
.
getBase
()
>
GsaCloudApplication
.
androidSetting
.
getAutoQuitTime
()
*
1000
)
{
if
(
SystemClock
.
elapsedRealtime
()
-
chronometer
.
getBase
()
>
GsaCloudApplication
.
functionConfiguration
.
getAutoQuitTime
()
*
1000
)
{
// 停止计时
chronometer
.
stop
();
returnTableActivity
(
true
);
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/ui/activity/SoldoutCtrlActivity.java
View file @
cc2bb8ac
...
...
@@ -138,7 +138,6 @@ public class SoldoutCtrlActivity extends BaseFragmentActivity<SoldoutCtrlPresent
private
FineItemOneselfFragment
oneselfFineItemFragment
;
private
FineItemAllFragment
modMsgFineItemFragment
,
modSasteFineItemFragment
;
private
String
[]
mFineTabTitles
=
{
"子項"
,
"口味"
,
"特別信息"
};
// private String[] mFineTabTitles = {"口味", "特別信息"};
private
int
mCurrentFinePageIndex
;
private
boolean
mInitModData
=
false
;
...
...
@@ -149,10 +148,9 @@ public class SoldoutCtrlActivity extends BaseFragmentActivity<SoldoutCtrlPresent
private
FoodGroupAdapter
mFoodGroupAdapter
;
private
PagerGridLayoutManager
mLayoutManager
;
private
int
mParentRowCount
;
private
int
mParentColCount
;
private
int
mDetailColCount
=
1
;
private
int
foodGroupRow
=
2
;
private
int
foodGroupColumn
=
6
;
private
int
foodColumn
=
4
;
@Override
public
void
setupActivityComponent
(
@NonNull
AppComponent
appComponent
)
{
...
...
@@ -225,9 +223,9 @@ public class SoldoutCtrlActivity extends BaseFragmentActivity<SoldoutCtrlPresent
para1
.
height
=
screenHeidth
*
33
/
100
;
recycle_current_soldout_food
.
setLayoutParams
(
para1
);
mParentRowCount
=
GsaCloudApplication
.
androidSetting
.
getFoodTypeRow
();
mParentColCount
=
GsaCloudApplication
.
androidSetting
.
getFoodTypeCol
();
mDetailColCount
=
GsaCloudApplication
.
androidSetting
.
getFoodCol
();
foodGroupColumn
=
GsaCloudApplication
.
uiStyleConfiguration
.
getFoodGroupColumn
();
foodGroupRow
=
GsaCloudApplication
.
uiStyleConfiguration
.
getFoodGroupRow
();
foodColumn
=
GsaCloudApplication
.
uiStyleConfiguration
.
getFoodColumn
();
}
public
void
initFoodGroupView
(
List
<
Food
>
foodGroupList
)
{
...
...
@@ -235,11 +233,12 @@ public class SoldoutCtrlActivity extends BaseFragmentActivity<SoldoutCtrlPresent
//总的页数向上取整
totalPage
=
(
int
)
Math
.
ceil
(
foodGroupList
.
size
()
*
1.0
/
GoldConstants
.
foodGriupPageSize
);
int
Rows
=
GoldConstants
.
foodGriupRows
;
if
(
foodGroupList
.
size
()
<=
GoldConstants
.
foodGriupColumns
)
{
int
Rows
=
foodGroupRow
;
if
(
foodGroupList
.
size
()
<=
foodGroupColumn
)
{
Rows
=
1
;
}
mLayoutManager
=
new
PagerGridLayoutManager
(
Rows
,
GoldConstants
.
foodGriupColumns
,
PagerGridLayoutManager
.
HORIZONTAL
);
mLayoutManager
=
new
PagerGridLayoutManager
(
Rows
,
foodGroupColumn
,
PagerGridLayoutManager
.
HORIZONTAL
);
// 水平分页布局管理器
mLayoutManager
.
setPageListener
(
this
);
...
...
@@ -256,7 +255,6 @@ public class SoldoutCtrlActivity extends BaseFragmentActivity<SoldoutCtrlPresent
@Override
public
void
onChanged
()
{
super
.
onChanged
();
int
count
=
mFoodGroupAdapter
.
getItemCount
();
}
});
...
...
@@ -301,7 +299,7 @@ public class SoldoutCtrlActivity extends BaseFragmentActivity<SoldoutCtrlPresent
}
});
int
mParentColHeight
=
GsaCloudApplication
.
androidSetting
.
getLayoutFoodTypeHeight
()
/
GsaCloudApplication
.
androidSetting
.
getFoodType
Row
()
*
Rows
;
int
mParentColHeight
=
GsaCloudApplication
.
uiStyleConfiguration
.
getFoodGroupBtnHeight
()
/
GsaCloudApplication
.
uiStyleConfiguration
.
getFoodGroup
Row
()
*
Rows
;
//设置ViewPager适配器
recycle_food_group
.
setLayoutParams
(
new
LinearLayout
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
mParentColHeight
));
...
...
@@ -639,10 +637,10 @@ public class SoldoutCtrlActivity extends BaseFragmentActivity<SoldoutCtrlPresent
@Override
public
void
setFoodRecycleSpanCount
(
int
size
)
{
if
(
size
>
0
)
{
if
(
size
>
mDetailColCount
)
{
if
(
size
>
foodColumn
)
{
initFoodLayoutManager
(
LinearLayoutManager
.
VERTICAL
);
foodRecycleLayoutManager
.
setSpanCount
(
mDetailColCount
);
}
else
if
(
size
<=
mDetailColCount
)
{
foodRecycleLayoutManager
.
setSpanCount
(
foodColumn
);
}
else
{
//只有一行就使用水平显示以免不能占满
initFoodLayoutManager
(
LinearLayoutManager
.
HORIZONTAL
);
}
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/ui/adapter/CurrentSlodoutFoodAdapter.java
View file @
cc2bb8ac
...
...
@@ -28,9 +28,8 @@ import butterknife.BindView;
public
class
CurrentSlodoutFoodAdapter
extends
DefaultAdapter
<
SoldoutCtrFood
>
{
private
Context
mContext
;
private
View
convertView
;
//字体大小
private
int
mFoodlList
FontSize
;
private
int
soldoutCtrlFood
FontSize
;
private
int
select_position
=
0
;
...
...
@@ -38,7 +37,7 @@ public class CurrentSlodoutFoodAdapter extends DefaultAdapter<SoldoutCtrFood> {
public
CurrentSlodoutFoodAdapter
(
Context
context
,
List
<
SoldoutCtrFood
>
infos
)
{
super
(
infos
);
this
.
mContext
=
context
;
this
.
mFoodlListFontSize
=
GsaCloudApplication
.
androidSetting
.
getFoodlList
FontSize
();
this
.
soldoutCtrlFoodFontSize
=
GsaCloudApplication
.
uiStyleConfiguration
.
getSoldoutCtrlFood
FontSize
();
}
public
void
setSelectPosition
(
int
select_position
)
{
...
...
@@ -83,7 +82,6 @@ public class CurrentSlodoutFoodAdapter extends DefaultAdapter<SoldoutCtrFood> {
@Override
public
BaseHolder
<
SoldoutCtrFood
>
getHolder
(
View
v
,
int
viewType
)
{
convertView
=
v
;
return
new
CurrentSlodoutItemHolder
(
v
);
}
...
...
@@ -122,9 +120,9 @@ public class CurrentSlodoutFoodAdapter extends DefaultAdapter<SoldoutCtrFood> {
tv_value
.
setText
(
datasBean
.
getQtyName
());
//设置字体
tv_value
.
setTextSize
(
mFoodlList
FontSize
);
tv_name
.
setTextSize
(
mFoodlList
FontSize
);
tv_number
.
setTextSize
(
mFoodlList
FontSize
);
tv_value
.
setTextSize
(
soldoutCtrlFood
FontSize
);
tv_name
.
setTextSize
(
soldoutCtrlFood
FontSize
);
tv_number
.
setTextSize
(
soldoutCtrlFood
FontSize
);
int
selected
=
datasBean
.
getSelected
();
switch
(
selected
)
{
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/ui/adapter/FineItemOneAdapter.java
View file @
cc2bb8ac
...
...
@@ -57,11 +57,11 @@ public class FineItemOneAdapter extends DefaultAdapter<Modifier> {
public
FineItemOneAdapter
(
Context
context
,
List
<
Modifier
>
infos
)
{
super
(
infos
);
this
.
mContext
=
context
;
this
.
mOrderNumberShowSize
=
GsaCloudApplication
.
androidSetting
.
getOrderNumberChildShowSize
();
this
.
mOrderNumberFontSize
=
GsaCloudApplication
.
androidSetting
.
getOrderNumberChildFontSize
();
this
.
mModFontSize
=
GsaCloudApplication
.
androidSetting
.
getModFontSize
();
this
.
mColHeight
=
GsaCloudApplication
.
androidSetting
.
getModBtnHeight
();
this
.
mColwidth
=
(
int
)
((
DeviceUtils
.
getScreenWidth
(
context
)
/
GsaCloudApplication
.
androidSetting
.
getModCol
()));
this
.
mOrderNumberShowSize
=
GsaCloudApplication
.
uiStyleConfiguration
.
getOrderNumberChildShowSize
();
this
.
mOrderNumberFontSize
=
GsaCloudApplication
.
uiStyleConfiguration
.
getOrderNumberChildFontSize
();
this
.
mModFontSize
=
GsaCloudApplication
.
uiStyleConfiguration
.
getModFontSize
();
this
.
mColHeight
=
GsaCloudApplication
.
uiStyleConfiguration
.
getModBtnHeight
();
this
.
mColwidth
=
(
int
)
((
DeviceUtils
.
getScreenWidth
(
context
)
/
GsaCloudApplication
.
uiStyleConfiguration
.
getModColumn
()));
// Db_Color dc = new Db_Color(context);
// mColorList = dc.query("");
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/ui/adapter/FineItemTwoAdapter.java
View file @
cc2bb8ac
...
...
@@ -58,11 +58,11 @@ public class FineItemTwoAdapter extends DefaultAdapter<Modifier> {
public
FineItemTwoAdapter
(
Context
context
,
List
<
Modifier
>
infos
)
{
super
(
infos
);
this
.
mContext
=
context
;
this
.
mOrderNumberShowSize
=
GsaCloudApplication
.
androidSetting
.
getOrderNumberChildShowSize
();
this
.
mOrderNumberFontSize
=
GsaCloudApplication
.
androidSetting
.
getOrderNumberChildFontSize
();
this
.
mModFontSize
=
GsaCloudApplication
.
androidSetting
.
getModFontSize
();
this
.
mColwidth
=
(
int
)
((
DeviceUtils
.
getScreenWidth
(
context
)
/
GsaCloudApplication
.
androidSetting
.
getModCol
()));
this
.
mColHeight
=
GsaCloudApplication
.
androidSetting
.
getModBtnHeight
();
this
.
mOrderNumberShowSize
=
GsaCloudApplication
.
uiStyleConfiguration
.
getOrderNumberChildShowSize
();
this
.
mOrderNumberFontSize
=
GsaCloudApplication
.
uiStyleConfiguration
.
getOrderNumberChildFontSize
();
this
.
mModFontSize
=
GsaCloudApplication
.
uiStyleConfiguration
.
getModFontSize
();
this
.
mColwidth
=
(
int
)
((
DeviceUtils
.
getScreenWidth
(
context
)
/
GsaCloudApplication
.
uiStyleConfiguration
.
getModColumn
()));
this
.
mColHeight
=
GsaCloudApplication
.
uiStyleConfiguration
.
getModBtnHeight
();
// Db_Color dc = new Db_Color(context);
// mColorList = dc.query("");
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/ui/adapter/meal/ComboAdapter.java
View file @
cc2bb8ac
...
...
@@ -52,10 +52,10 @@ public class ComboAdapter extends DefaultAdapter<ComboItem> {
int
ComboColCount
=
4
;
int
screenWidth
=
(
int
)
DeviceUtils
.
getScreenWidth
(
context
);
ColWidth
=
((
screenWidth
-
ComboColCount
)
/
ComboColCount
);
ColHeight
=
GsaCloudApplication
.
androidSetting
.
getModBtnHeight
();
FontSize
=
GsaCloudApplication
.
androidSetting
.
getModFontSize
();
OrderNumberChildShowSize
=
GsaCloudApplication
.
androidSetting
.
getOrderNumberChildShowSize
();
OrderNumberChildFontSize
=
GsaCloudApplication
.
androidSetting
.
getOrderNumberChildFontSize
();
ColHeight
=
GsaCloudApplication
.
uiStyleConfiguration
.
getModBtnHeight
();
FontSize
=
GsaCloudApplication
.
uiStyleConfiguration
.
getModFontSize
();
OrderNumberChildShowSize
=
GsaCloudApplication
.
uiStyleConfiguration
.
getOrderNumberChildShowSize
();
OrderNumberChildFontSize
=
GsaCloudApplication
.
uiStyleConfiguration
.
getOrderNumberChildFontSize
();
}
@Override
...
...
@@ -252,7 +252,7 @@ public class ComboAdapter extends DefaultAdapter<ComboItem> {
private
void
initComboLayoutParams
()
{
ViewGroup
.
LayoutParams
layoutParams
=
tv_name
.
getLayoutParams
();
//这里减2 减去分割线宽度
layoutParams
.
width
=
ColWidth
-
4
;
//
layoutParams.width = ColWidth - 4;
layoutParams
.
height
=
ColHeight
;
tv_name
.
setLayoutParams
(
layoutParams
);
}
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/ui/adapter/meal/DiscountAdapter.java
View file @
cc2bb8ac
...
...
@@ -2,6 +2,7 @@ package com.gingersoft.gsa.cloud.bean.mvp.ui.adapter.meal;
import
android.content.Context
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.TextView
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
...
...
@@ -28,9 +29,7 @@ public class DiscountAdapter extends DefaultAdapter<Discount> {
private
Context
mContext
;
private
int
fontSize
;
private
int
colWidth
;
private
int
colHeight
;
private
int
currentSelectPosition
=
0
;
...
...
@@ -39,10 +38,9 @@ public class DiscountAdapter extends DefaultAdapter<Discount> {
super
(
infos
);
this
.
mContext
=
context
;
fontSize
=
GsaCloudApplication
.
androidSetting
.
getModFontSize
();
// int DetailColCount = GSAApplication.androidSetting.getDiscountCol();
// colWidth = (int) (DeviceUtils.getScreenWidth(mContext) / DetailColCount);
// colHeight = GSAApplication.androidSetting.getModBtnHeight();
fontSize
=
GsaCloudApplication
.
uiStyleConfiguration
.
getDiscountFontSize
();
colHeight
=
GsaCloudApplication
.
uiStyleConfiguration
.
getDiscountHeight
();
}
@Override
...
...
@@ -72,6 +70,7 @@ public class DiscountAdapter extends DefaultAdapter<Discount> {
@Override
public
void
setData
(
Discount
datasBean
,
int
position
)
{
initLayoutParams
();
initName
(
datasBean
);
setColor
(
datasBean
);
}
...
...
@@ -80,10 +79,6 @@ public class DiscountAdapter extends DefaultAdapter<Discount> {
String
desc
=
datasBean
.
getRemark
();
tv_name
.
setText
(
desc
);
tv_name
.
setTextSize
(
fontSize
);
// tv_name.setMaxWidth(colWidth);
// tv_name.setWidth(colWidth);
// tv_name.setHeight(colHeight);
}
private
void
setColor
(
Discount
datasBean
)
{
...
...
@@ -94,6 +89,12 @@ public class DiscountAdapter extends DefaultAdapter<Discount> {
tv_name
.
setBackgroundColor
(
color
);
tv_name
.
setTextColor
(
fontColor
);
}
private
void
initLayoutParams
()
{
ViewGroup
.
LayoutParams
layoutParams
=
tv_name
.
getLayoutParams
();
layoutParams
.
height
=
colHeight
;
tv_name
.
setLayoutParams
(
layoutParams
);
}
}
private
OnItemClickListener
mOnItemClickListener
;
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/ui/adapter/meal/FoodAdapter.java
View file @
cc2bb8ac
...
...
@@ -39,9 +39,6 @@ public class FoodAdapter extends DefaultAdapter<Food> {
private
Context
mContext
;
//所有沽清类型
private
List
<
SoldoutCtrFood
>
mCurrentSlodoutFoodList_Full
=
new
ArrayList
<>();
private
int
mOrderNumberShowSize
;
private
int
mOrderNumberFontSize
;
private
int
mFoodFontSize
;
...
...
@@ -64,12 +61,12 @@ public class FoodAdapter extends DefaultAdapter<Food> {
super
(
infos
);
this
.
mContext
=
context
;
this
.
mFromType
=
fromType
;
this
.
mOrderNumberShowSize
=
GsaCloudApplication
.
androidSetting
.
getOrderNumberChildShowSize
();
this
.
mOrderNumberFontSize
=
GsaCloudApplication
.
androidSetting
.
getOrderNumberChildFontSize
();
this
.
mFoodFontSize
=
GsaCloudApplication
.
androidSetting
.
getFoodFontSize
();
this
.
mColwidth
=
(
int
)
((
DeviceUtils
.
getScreenWidth
(
context
)
/
GsaCloudApplication
.
androidSetting
.
getFoodCol
()));
this
.
mColHeight
=
GsaCloudApplication
.
androidSetting
.
getFoodBtnHeight
();
this
.
mLayoutQtyHeight
=
GsaCloudApplication
.
androidSetting
.
getLayoutQtyHeight
();
this
.
mOrderNumberShowSize
=
GsaCloudApplication
.
uiStyleConfiguration
.
getOrderNumberChildShowSize
();
this
.
mOrderNumberFontSize
=
GsaCloudApplication
.
uiStyleConfiguration
.
getOrderNumberChildFontSize
();
this
.
mFoodFontSize
=
GsaCloudApplication
.
uiStyleConfiguration
.
getFoodFontSize
();
this
.
mColwidth
=
(
int
)
((
DeviceUtils
.
getScreenWidth
(
context
)
/
GsaCloudApplication
.
uiStyleConfiguration
.
getFoodColumn
()));
this
.
mColHeight
=
GsaCloudApplication
.
uiStyleConfiguration
.
getFoodBtnHeight
();
this
.
mLayoutQtyHeight
=
GsaCloudApplication
.
uiStyleConfiguration
.
getLayoutQtyHeight
();
}
@Override
...
...
@@ -250,16 +247,9 @@ public class FoodAdapter extends DefaultAdapter<Food> {
currentSelectPosition
=
position
;
}
if
(
mOnItemClickListener
!=
null
)
if
(
mOnItemClickListener
!=
null
)
{
mOnItemClickListener
.
onItemClick
(
mInfos
.
get
(
position
),
position
);
}
public
List
<
SoldoutCtrFood
>
getCurrentSlodoutFoodList_Full
()
{
return
mCurrentSlodoutFoodList_Full
;
}
public
void
setCurrentSlodoutFoodList_Full
(
List
<
SoldoutCtrFood
>
mCurrentSlodoutFoodList_Full
)
{
this
.
mCurrentSlodoutFoodList_Full
=
mCurrentSlodoutFoodList_Full
;
}
}
public
int
getCurrentSelectPosition
()
{
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/ui/adapter/meal/FoodGroupAdapter.java
View file @
cc2bb8ac
...
...
@@ -37,9 +37,6 @@ public class FoodGroupAdapter extends DefaultAdapter<Food> {
private
Context
mContext
;
//所有沽清类型
private
List
<
SoldoutCtrFood
>
mCurrentSlodoutFoodList_Full
=
new
ArrayList
<>();
// private List<Color.DatasBean> mColorList;
private
int
mOrderNumberShowSize
;
private
int
mOrderNumberFontSize
;
private
int
FoodTypeFontSize
;
...
...
@@ -59,14 +56,12 @@ public class FoodGroupAdapter extends DefaultAdapter<Food> {
this
.
mContext
=
context
;
this
.
mFromType
=
fromType
;
this
.
mOrderNumberShowSize
=
GsaCloudApplication
.
androidSetting
.
getOrderNumberShowSize
();
this
.
mOrderNumberFontSize
=
GsaCloudApplication
.
androidSetting
.
getOrderNumberFontSize
();
this
.
FoodTypeFontSize
=
GsaCloudApplication
.
androidSetting
.
getFoodTypeFontSize
();
int
foodCol
=
GsaCloudApplication
.
androidSetting
.
getFoodTypeCol
();
this
.
mParentColWidth
=
(
int
)
(
DeviceUtils
.
getScreenWidth
(
context
)
/
foodCol
);
this
.
mParentColHeight
=
GsaCloudApplication
.
androidSetting
.
getLayoutFoodTypeHeight
()
/
GsaCloudApplication
.
androidSetting
.
getFoodTypeRow
();
this
.
mLayoutQtyHeight
=
GsaCloudApplication
.
androidSetting
.
getLayoutQtyHeight
();
this
.
mOrderNumberShowSize
=
GsaCloudApplication
.
uiStyleConfiguration
.
getOrderNumberShowSize
();
this
.
mOrderNumberFontSize
=
GsaCloudApplication
.
uiStyleConfiguration
.
getOrderNumberFontSize
();
this
.
FoodTypeFontSize
=
GsaCloudApplication
.
uiStyleConfiguration
.
getFoodGroupFontSize
();
this
.
mParentColWidth
=
(
int
)
(
DeviceUtils
.
getScreenWidth
(
context
)
/
GsaCloudApplication
.
uiStyleConfiguration
.
getFoodGroupColumn
());
this
.
mParentColHeight
=
GsaCloudApplication
.
uiStyleConfiguration
.
getFoodGroupBtnHeight
();
this
.
mLayoutQtyHeight
=
GsaCloudApplication
.
uiStyleConfiguration
.
getLayoutQtyHeight
();
}
...
...
@@ -206,7 +201,7 @@ public class FoodGroupAdapter extends DefaultAdapter<Food> {
tv_number
.
setTextSize
(
10
);
tv_number
.
setHeight
(
mLayoutQtyHeight
);
ViewGroup
.
MarginLayoutParams
mp
=
new
ViewGroup
.
MarginLayoutParams
(
mOrderNumberShowSize
,
mOrderNumberShowSize
);
//item�Ŀ��
ViewGroup
.
MarginLayoutParams
mp
=
new
ViewGroup
.
MarginLayoutParams
(
mOrderNumberShowSize
,
mOrderNumberShowSize
);
mp
.
setMargins
(
0
,
0
,
0
,
0
);
RelativeLayout
.
LayoutParams
lp
=
new
RelativeLayout
.
LayoutParams
(
mp
);
lp
.
width
=
ArmsUtils
.
dip2px
(
mContext
,
16
);
...
...
@@ -240,9 +235,6 @@ public class FoodGroupAdapter extends DefaultAdapter<Food> {
}
}
public
void
setCurrentSlodoutFoodList_Full
(
List
<
SoldoutCtrFood
>
currentSlodoutFoodList_Full
)
{
this
.
mCurrentSlodoutFoodList_Full
=
currentSlodoutFoodList_Full
;
}
private
OnItemClickListener
mOnItemClickListener
;
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/ui/adapter/meal/ModifierAdapter.java
View file @
cc2bb8ac
...
...
@@ -33,7 +33,6 @@ public class ModifierAdapter extends DefaultAdapter<Modifier> {
private
Context
mContext
;
private
int
ColWidth
;
private
int
ColHeight
;
private
int
FontSize
;
...
...
@@ -45,13 +44,10 @@ public class ModifierAdapter extends DefaultAdapter<Modifier> {
super
(
infos
);
this
.
mContext
=
context
;
int
ComboColCount
=
4
;
int
screenWidth
=
(
int
)
DeviceUtils
.
getScreenWidth
(
context
);
ColWidth
=
((
screenWidth
-
ComboColCount
)
/
ComboColCount
);
ColHeight
=
GsaCloudApplication
.
androidSetting
.
getModBtnHeight
();
FontSize
=
GsaCloudApplication
.
androidSetting
.
getModFontSize
();
OrderNumberChildShowSize
=
GsaCloudApplication
.
androidSetting
.
getOrderNumberChildShowSize
();
OrderNumberChildFontSize
=
GsaCloudApplication
.
androidSetting
.
getOrderNumberChildFontSize
();
ColHeight
=
GsaCloudApplication
.
uiStyleConfiguration
.
getModBtnHeight
();
FontSize
=
GsaCloudApplication
.
uiStyleConfiguration
.
getModFontSize
();
OrderNumberChildShowSize
=
GsaCloudApplication
.
uiStyleConfiguration
.
getOrderNumberChildShowSize
();
OrderNumberChildFontSize
=
GsaCloudApplication
.
uiStyleConfiguration
.
getOrderNumberChildFontSize
();
}
@Override
...
...
@@ -182,7 +178,7 @@ public class ModifierAdapter extends DefaultAdapter<Modifier> {
private
void
initModifierLayoutParams
()
{
ViewGroup
.
LayoutParams
layoutParams
=
tv_name
.
getLayoutParams
();
//这里减2 减去分割线宽度
layoutParams
.
width
=
ColWidth
-
4
;
//
layoutParams.width = ColWidth - 4;
layoutParams
.
height
=
ColHeight
;
tv_name
.
setLayoutParams
(
layoutParams
);
}
...
...
table-module/src/main/java/com/gingersoft/gsa/cloud/bean/mvp/ui/fragment/FineItemAllFragment.java
View file @
cc2bb8ac
...
...
@@ -80,7 +80,7 @@ public class FineItemAllFragment extends BaseFragment<FineItemAllPresenter> impl
@Override
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
modCol
=
GsaCloudApplication
.
androidSetting
.
getModCol
();
modCol
=
GsaCloudApplication
.
uiStyleConfiguration
.
getModColumn
();
mPresenter
.
initAdapter
();
mPresenter
.
initItemListener
(
mContext
);
...
...
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