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
ef2056da
Commit
ef2056da
authored
Feb 03, 2021
by
宁斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、添加餐檯模式埋點記錄 2、餐檯模式選擇取消彈窗閃退問題處理 3、skyorder餐檯刪除數量提示調整為後台返回
parent
2194c6e3
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
362 additions
and
616 deletions
+362
-616
component-download/src/main/java/com/gingersoft/gsa/cloud/download/mvp/contract/DownloadContract.java
+5
-5
component-download/src/main/java/com/gingersoft/gsa/cloud/download/mvp/model/DownloadModel.java
+5
-5
component-download/src/main/java/com/gingersoft/gsa/cloud/download/mvp/model/service/DownloadService.java
+5
-5
component-download/src/main/java/com/gingersoft/gsa/cloud/download/mvp/presenter/DownloadPresenter.java
+199
-537
component-download/src/main/java/com/gingersoft/gsa/cloud/download/mvp/ui/activity/DownloadActivity.java
+0
-1
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/BaseOrderPresenter.java
+21
-5
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/MealStandPresenter.java
+14
-4
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/OrderContentPresenter.java
+5
-1
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/OrderPayPresenter.java
+6
-0
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/MealStandActivity.java
+9
-0
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/OrderPayActivity.java
+7
-4
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/TableActivity.java
+3
-4
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/orderManager/OrderCenterActivity.java
+6
-0
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/orderManager/OrderDetailActivity.java
+4
-0
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/widget/CancelFoodDialog.java
+9
-4
component-table/src/main/res/layout/table_dialog_cancel_food.xml
+2
-7
component-table/src/main/res/values/styles.xml
+4
-4
library-common/src/main/java/com/gingersoft/gsa/cloud/common/logan/LoganManager.java
+38
-17
library-common/src/main/res/values-v21/styles.xml
+7
-0
library-common/src/main/res/values-v21/styles.xml~
+0
-0
library-common/src/main/res/values/styles.xml
+6
-12
library-ui/src/main/java/com/gingersoft/gsa/cloud/ui/view/OrderPayView.java
+7
-1
No files found.
component-download/src/main/java/com/gingersoft/gsa/cloud/download/mvp/contract/DownloadContract.java
View file @
ef2056da
...
@@ -39,17 +39,17 @@ public interface DownloadContract {
...
@@ -39,17 +39,17 @@ public interface DownloadContract {
interface
Model
extends
IModel
{
interface
Model
extends
IModel
{
Observable
<
FunctionRespone
>
downFunctionList
(
long
userId
);
Observable
<
BaseResult
>
downFunctionList
(
long
userId
);
Observable
<
BaseResult
>
downFoodList
(
int
restaurantId
);
Observable
<
BaseResult
>
downFoodList
(
int
restaurantId
);
Observable
<
ModifierRespone
>
downModifier
(
int
restaurantId
);
Observable
<
BaseResult
>
downModifier
(
int
restaurantId
);
Observable
<
FoodComboRespone
>
downFoodCombo
(
int
restaurantId
);
Observable
<
BaseResult
>
downFoodCombo
(
int
restaurantId
);
Observable
<
ComboItemRespone
>
downComboItem
(
int
restaurantId
);
Observable
<
BaseResult
>
downComboItem
(
int
restaurantId
);
Observable
<
FoodModifierRespone
>
downFoodModifier
(
int
restaurantId
);
Observable
<
BaseResult
>
downFoodModifier
(
int
restaurantId
);
Observable
<
BaseResult
>
downDiscount
(
int
restaurantId
);
Observable
<
BaseResult
>
downDiscount
(
int
restaurantId
);
...
...
component-download/src/main/java/com/gingersoft/gsa/cloud/download/mvp/model/DownloadModel.java
View file @
ef2056da
...
@@ -53,7 +53,7 @@ public class DownloadModel extends BaseModel implements DownloadContract.Model {
...
@@ -53,7 +53,7 @@ public class DownloadModel extends BaseModel implements DownloadContract.Model {
}
}
@Override
@Override
public
Observable
<
FunctionRespone
>
downFunctionList
(
long
userId
)
{
public
Observable
<
BaseResult
>
downFunctionList
(
long
userId
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
DownloadService
.
class
)
return
mRepositoryManager
.
obtainRetrofitService
(
DownloadService
.
class
)
.
downFunctionList
(
userId
);
.
downFunctionList
(
userId
);
}
}
...
@@ -65,25 +65,25 @@ public class DownloadModel extends BaseModel implements DownloadContract.Model {
...
@@ -65,25 +65,25 @@ public class DownloadModel extends BaseModel implements DownloadContract.Model {
}
}
@Override
@Override
public
Observable
<
ModifierRespone
>
downModifier
(
int
restaurantId
)
{
public
Observable
<
BaseResult
>
downModifier
(
int
restaurantId
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
DownloadService
.
class
)
return
mRepositoryManager
.
obtainRetrofitService
(
DownloadService
.
class
)
.
downModifier
(
restaurantId
);
.
downModifier
(
restaurantId
);
}
}
@Override
@Override
public
Observable
<
FoodComboRespone
>
downFoodCombo
(
int
restaurantId
)
{
public
Observable
<
BaseResult
>
downFoodCombo
(
int
restaurantId
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
DownloadService
.
class
)
return
mRepositoryManager
.
obtainRetrofitService
(
DownloadService
.
class
)
.
downFoodCombo
(
restaurantId
);
.
downFoodCombo
(
restaurantId
);
}
}
@Override
@Override
public
Observable
<
ComboItemRespone
>
downComboItem
(
int
restaurantId
)
{
public
Observable
<
BaseResult
>
downComboItem
(
int
restaurantId
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
DownloadService
.
class
)
return
mRepositoryManager
.
obtainRetrofitService
(
DownloadService
.
class
)
.
downComboItem
(
restaurantId
);
.
downComboItem
(
restaurantId
);
}
}
@Override
@Override
public
Observable
<
FoodModifierRespone
>
downFoodModifier
(
int
restaurantId
)
{
public
Observable
<
BaseResult
>
downFoodModifier
(
int
restaurantId
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
DownloadService
.
class
)
return
mRepositoryManager
.
obtainRetrofitService
(
DownloadService
.
class
)
.
downFoodModifier
(
restaurantId
);
.
downFoodModifier
(
restaurantId
);
}
}
...
...
component-download/src/main/java/com/gingersoft/gsa/cloud/download/mvp/model/service/DownloadService.java
View file @
ef2056da
...
@@ -18,22 +18,22 @@ import retrofit2.http.Query;
...
@@ -18,22 +18,22 @@ import retrofit2.http.Query;
public
interface
DownloadService
{
public
interface
DownloadService
{
@GET
(
"user/resource/list"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
@GET
(
"user/resource/list"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
FunctionRespone
>
downFunctionList
(
@Query
(
"userId"
)
long
userId
);
Observable
<
BaseResult
>
downFunctionList
(
@Query
(
"userId"
)
long
userId
);
@GET
(
Api
.
food_list
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
@GET
(
Api
.
food_list
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
BaseResult
>
downFoodList
(
@Query
(
"restaurantId"
)
int
restaurantId
);
Observable
<
BaseResult
>
downFoodList
(
@Query
(
"restaurantId"
)
int
restaurantId
);
@GET
(
Api
.
modifier
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
@GET
(
Api
.
modifier
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
ModifierRespone
>
downModifier
(
@Query
(
"restaurantId"
)
int
restaurantId
);
Observable
<
BaseResult
>
downModifier
(
@Query
(
"restaurantId"
)
int
restaurantId
);
@GET
(
Api
.
food_package_relation
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
@GET
(
Api
.
food_package_relation
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
FoodComboRespone
>
downFoodCombo
(
@Query
(
"restaurantId"
)
int
restaurantId
);
Observable
<
BaseResult
>
downFoodCombo
(
@Query
(
"restaurantId"
)
int
restaurantId
);
@GET
(
Api
.
food_comboItem
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
@GET
(
Api
.
food_comboItem
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
ComboItemRespone
>
downComboItem
(
@Query
(
"restaurantId"
)
int
restaurantId
);
Observable
<
BaseResult
>
downComboItem
(
@Query
(
"restaurantId"
)
int
restaurantId
);
@GET
(
Api
.
food_modifiere_relation
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
@GET
(
Api
.
food_modifiere_relation
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
FoodModifierRespone
>
downFoodModifier
(
@Query
(
"restaurantId"
)
int
restaurantId
);
Observable
<
BaseResult
>
downFoodModifier
(
@Query
(
"restaurantId"
)
int
restaurantId
);
@GET
(
Api
.
restaurant_discount
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
@GET
(
Api
.
restaurant_discount
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
BaseResult
>
downDiscount
(
@Query
(
"restaurantId"
)
int
restaurantId
);
Observable
<
BaseResult
>
downDiscount
(
@Query
(
"restaurantId"
)
int
restaurantId
);
...
...
component-download/src/main/java/com/gingersoft/gsa/cloud/download/mvp/presenter/DownloadPresenter.java
View file @
ef2056da
package
com
.
gingersoft
.
gsa
.
cloud
.
download
.
mvp
.
presenter
;
package
com
.
gingersoft
.
gsa
.
cloud
.
download
.
mvp
.
presenter
;
import
android.app.Application
;
import
android.app.Application
;
import
com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager
;
import
com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager
;
import
com.billy.cc.core.component.CC
;
import
com.billy.cc.core.component.CC
;
import
com.gingersoft.gsa.cloud.common.core.user.UserContext
;
import
com.gingersoft.gsa.cloud.common.core.user.UserContext
;
import
com.gingersoft.gsa.cloud.common.Api
;
import
com.gingersoft.gsa.cloud.common.Api
;
import
com.gingersoft.gsa.cloud.common.bean.BaseResult
;
import
com.gingersoft.gsa.cloud.common.bean.BaseResult
;
import
com.gingersoft.gsa.cloud.common.logan.LoganManager
;
import
com.gingersoft.gsa.cloud.common.utils.CommonConfiguration
;
import
com.gingersoft.gsa.cloud.common.utils.CommonConfiguration
;
import
com.gingersoft.gsa.cloud.common.utils.JsonUtils
;
import
com.gingersoft.gsa.cloud.common.utils.JsonUtils
;
import
com.gingersoft.gsa.cloud.common.core.restaurant.utils.RestaurantExpandInfoUtils
;
import
com.gingersoft.gsa.cloud.common.core.restaurant.utils.RestaurantExpandInfoUtils
;
...
@@ -13,9 +15,15 @@ import com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils;
...
@@ -13,9 +15,15 @@ import com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils;
import
com.gingersoft.gsa.cloud.component.ComponentName
;
import
com.gingersoft.gsa.cloud.component.ComponentName
;
import
com.gingersoft.gsa.cloud.common.constans.HttpsConstans
;
import
com.gingersoft.gsa.cloud.common.constans.HttpsConstans
;
import
com.gingersoft.gsa.cloud.database.bean.ColorBean
;
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.Discount
;
import
com.gingersoft.gsa.cloud.database.bean.ExpandInfo
;
import
com.gingersoft.gsa.cloud.database.bean.ExpandInfo
;
import
com.gingersoft.gsa.cloud.database.bean.Food
;
import
com.gingersoft.gsa.cloud.database.bean.Food
;
import
com.gingersoft.gsa.cloud.database.bean.FoodCombo
;
import
com.gingersoft.gsa.cloud.database.bean.FoodModifier
;
import
com.gingersoft.gsa.cloud.database.bean.Function
;
import
com.gingersoft.gsa.cloud.database.bean.Modifier
;
import
com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean
;
import
com.gingersoft.gsa.cloud.database.bean.PrinterListBean
;
import
com.gingersoft.gsa.cloud.database.bean.PrinterListBean
;
import
com.gingersoft.gsa.cloud.database.utils.ColorDaoUtils
;
import
com.gingersoft.gsa.cloud.database.utils.ColorDaoUtils
;
import
com.gingersoft.gsa.cloud.database.utils.ComboItemDaoUtils
;
import
com.gingersoft.gsa.cloud.database.utils.ComboItemDaoUtils
;
...
@@ -111,6 +119,7 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
...
@@ -111,6 +119,7 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
//當前下載進度
//當前下載進度
private
float
currentProgress
=
0
;
private
float
currentProgress
=
0
;
private
List
<
Observable
>
mRequestObservables
=
new
ArrayList
<>();
private
List
<
Disposable
>
mDownDisposable
=
new
ArrayList
<>();
private
List
<
Disposable
>
mDownDisposable
=
new
ArrayList
<>();
@Inject
@Inject
...
@@ -126,6 +135,10 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
...
@@ -126,6 +135,10 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
this
.
mAppManager
=
null
;
this
.
mAppManager
=
null
;
this
.
mImageLoader
=
null
;
this
.
mImageLoader
=
null
;
this
.
mApplication
=
null
;
this
.
mApplication
=
null
;
mRequestObservables
.
clear
();
mRequestObservables
=
null
;
stopDownDisposable
();
}
}
public
void
initAdapter
()
{
public
void
initAdapter
()
{
...
@@ -147,124 +160,39 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
...
@@ -147,124 +160,39 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
IActivity
.
setTvProgress
(
0
);
IActivity
.
setTvProgress
(
0
);
stopDownDisposable
();
stopDownDisposable
();
initDownState
();
initDownState
();
setDownAverageRatio
();
setDownAverageRatio
();
addDownRequests
();
excuteDownRequests
();
}
private
void
addDownRequests
()
{
long
userId
=
UserContext
.
newInstance
().
getMemberId
();
int
restaurantId
=
RestaurantInfoManager
.
newInstance
().
getRestaurantId
();
int
restaurantId
=
RestaurantInfoManager
.
newInstance
().
getRestaurantId
();
mRequestObservables
.
add
(
mModel
.
downFunctionList
(
userId
));
List
<
DownloadRequest
>
requests
=
getDownloadRequests
(
getDownloadUrls
(
restaurantId
),
restaurantId
);
mRequestObservables
.
add
(
mModel
.
downFoodList
(
restaurantId
));
mRequestObservables
.
add
(
mModel
.
downModifier
(
restaurantId
));
DownloadManager
.
getInstance
().
takeRequestExecute
(
requests
,
new
DownloadManager
.
OnRunnableListener
()
{
mRequestObservables
.
add
(
mModel
.
downFoodCombo
(
restaurantId
));
mRequestObservables
.
add
(
mModel
.
downComboItem
(
restaurantId
));
@Override
mRequestObservables
.
add
(
mModel
.
downFoodModifier
(
restaurantId
));
public
void
run
(
Object
o
)
{
mRequestObservables
.
add
(
mModel
.
downDiscount
(
restaurantId
));
DownloadRequest
request
=
(
DownloadRequest
)
o
;
mRequestObservables
.
add
(
mModel
.
downExpandInfo
(
restaurantId
));
switch
(
request
.
getDownTag
())
{
mRequestObservables
.
add
(
mModel
.
downPrinterList
(
restaurantId
));
case
0
:
mRequestObservables
.
add
(
mModel
.
downColorList
());
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
;
}
}
});
}
}
p
ublic
void
stopDownDisposable
()
{
p
rivate
void
excuteDownRequests
()
{
for
(
int
i
=
0
;
i
<
mDownDisposable
.
size
();
i
++
)
{
if
(
mRequestObservables
!=
null
&&
mRequestObservables
.
size
()
>
0
)
{
if
(
mDownDisposable
.
get
(
i
)
!=
null
&&
!
mDownDisposable
.
get
(
i
).
isDisposed
()
)
{
for
(
int
i
=
0
;
i
<
mRequestObservables
.
size
();
i
++
)
{
mDownDisposable
.
get
(
i
).
dispose
(
);
downDataRequest
(
mRequestObservables
.
get
(
i
),
i
);
}
}
}
}
mDownDisposable
.
clear
();
}
}
public
void
downFun
(
int
downTag
)
{
private
void
downDataRequest
(
Observable
observable
,
int
downIndex
)
{
observable
long
userId
=
UserContext
.
newInstance
().
getMemberId
();
.
subscribeOn
(
Schedulers
.
io
())
mModel
.
downFunctionList
(
userId
)
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
FunctionRespone
>(
mErrorHandler
)
{
@Override
public
void
onSubscribe
(
Disposable
d
)
{
super
.
onSubscribe
(
d
);
mDownDisposable
.
add
(
d
);
}
@Override
public
void
onNext
(
@NonNull
FunctionRespone
functionBean
)
{
if
(
functionBean
.
isSuccess
())
{
if
(
functionBean
.
getData
()
!=
null
)
{
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
());
}
});
XFunctionManager
.
newInstance
().
updateFunctions
(
functionBean
.
getData
());
}
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
downFoodList
(
int
downTag
)
{
int
restaurantId
=
RestaurantInfoManager
.
newInstance
().
getRestaurantId
();
mModel
.
downFoodList
(
restaurantId
)
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
BaseResult
>(
mErrorHandler
)
{
.
subscribe
(
new
ErrorHandleSubscriber
<
BaseResult
>(
mErrorHandler
)
{
...
@@ -278,233 +206,12 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
...
@@ -278,233 +206,12 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
@Override
@Override
public
void
onNext
(
@NonNull
BaseResult
result
)
{
public
void
onNext
(
@NonNull
BaseResult
result
)
{
if
(
result
.
isSuccess
())
{
if
(
result
.
isSuccess
())
{
List
<
Food
>
foodList
=
GsonUtils
.
jsonToList
(
result
.
getData
(),
Food
.
class
);
if
(
foodList
!=
null
)
{
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
(
foodList
);
}
});
}
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
downModifier
(
int
downTag
)
{
int
restaurantId
=
RestaurantInfoManager
.
newInstance
().
getRestaurantId
();
mModel
.
downModifier
(
restaurantId
)
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
ModifierRespone
>(
mErrorHandler
)
{
@Override
public
void
onSubscribe
(
Disposable
d
)
{
super
.
onSubscribe
(
d
);
mDownDisposable
.
add
(
d
);
}
@Override
public
void
onNext
(
@NonNull
ModifierRespone
modifier
)
{
if
(
modifier
.
isSuccess
())
{
if
(
modifier
.
getData
()
!=
null
)
{
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
);
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
downFoodCombo
(
int
downTag
)
{
int
restaurantId
=
RestaurantInfoManager
.
newInstance
().
getRestaurantId
();
mModel
.
downFoodCombo
(
restaurantId
)
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
FoodComboRespone
>(
mErrorHandler
)
{
@Override
public
void
onSubscribe
(
Disposable
d
)
{
super
.
onSubscribe
(
d
);
mDownDisposable
.
add
(
d
);
}
@Override
public
void
onNext
(
@NonNull
FoodComboRespone
combo
)
{
if
(
combo
.
isSuccess
())
{
if
(
combo
.
getData
()
!=
null
)
{
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
);
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
downComboItem
(
int
downTag
)
{
int
restaurantId
=
RestaurantInfoManager
.
newInstance
().
getRestaurantId
();
mModel
.
downComboItem
(
restaurantId
)
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
ComboItemRespone
>(
mErrorHandler
)
{
@Override
public
void
onSubscribe
(
Disposable
d
)
{
super
.
onSubscribe
(
d
);
mDownDisposable
.
add
(
d
);
}
@Override
public
void
onNext
(
@NonNull
ComboItemRespone
combo
)
{
if
(
combo
.
isSuccess
())
{
if
(
combo
.
getData
()
!=
null
)
{
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
);
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
downFoodModifier
(
int
downTag
)
{
int
restaurantId
=
RestaurantInfoManager
.
newInstance
().
getRestaurantId
();
mModel
.
downFoodModifier
(
restaurantId
)
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
FoodModifierRespone
>(
mErrorHandler
)
{
@Override
saveToDatabase
(
result
.
getData
(),
downIndex
);
public
void
onSubscribe
(
Disposable
d
)
{
super
.
onSubscribe
(
d
);
mDownDisposable
.
add
(
d
);
}
@Override
DataDownLoadState
loadState
=
mList
.
get
(
downIndex
);
public
void
onNext
(
@NonNull
FoodModifierRespone
foodModifier
)
{
if
(
foodModifier
.
isSuccess
())
{
if
(
foodModifier
.
getData
()
!=
null
)
{
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
);
loadState
.
setState
(
2
);
mAapter
.
notifyItemChanged
(
down
Tag
);
mAapter
.
notifyItemChanged
(
down
Index
);
currentProgress
+=
loadState
.
getRatio
();
currentProgress
+=
loadState
.
getRatio
();
IActivity
.
setTvProgress
(
currentProgress
);
IActivity
.
setTvProgress
(
currentProgress
);
...
@@ -518,231 +225,178 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
...
@@ -518,231 +225,178 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
@Override
@Override
public
void
onError
(
Throwable
t
)
{
public
void
onError
(
Throwable
t
)
{
super
.
onError
(
t
);
super
.
onError
(
t
);
DataDownLoadState
loadState
=
mList
.
get
(
down
Tag
);
DataDownLoadState
loadState
=
mList
.
get
(
down
Index
);
loadState
.
setState
(
0
);
loadState
.
setState
(
0
);
mRootView
.
showMessage
(
"部分下載失敗,點擊刷新按鈕重新下載"
);
mRootView
.
showMessage
(
"部分下載失敗,點擊刷新按鈕重新下載"
);
}
}
});
});
}
}
public
void
downDiscount
(
int
downTag
)
{
private
void
saveToDatabase
(
Object
data
,
int
downIndex
)
{
int
restaurantId
=
RestaurantInfoManager
.
newInstance
().
getRestaurantId
();
try
{
mModel
.
downDiscount
(
restaurantId
)
switch
(
downIndex
)
{
.
observeOn
(
AndroidSchedulers
.
mainThread
())
case
0
:
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
List
<
Function
>
functionList
=
GsonUtils
.
jsonToList
(
data
,
Function
.
class
);
.
subscribe
(
new
ErrorHandleSubscriber
<
BaseResult
>(
mErrorHandler
)
{
if
(
functionList
!=
null
)
{
Observable
.
just
(
0
)
@Override
.
observeOn
(
Schedulers
.
io
())
public
void
onSubscribe
(
Disposable
d
)
{
.
subscribe
(
new
Consumer
<
Integer
>()
{
super
.
onSubscribe
(
d
);
@Override
mDownDisposable
.
add
(
d
);
public
void
accept
(
@NonNull
Integer
integer
)
throws
Exception
{
}
FunctionDaoUtils
functionDao
=
new
FunctionDaoUtils
(
IActivity
);
functionDao
.
deleteAll
();
@Override
functionDao
.
insertMultFunction
(
functionList
);
public
void
onNext
(
@NonNull
BaseResult
result
)
{
}
if
(
result
.
isSuccess
())
{
});
if
(
result
.
getData
()
!=
null
)
{
XFunctionManager
.
newInstance
().
updateFunctions
(
functionList
);
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
);
currentProgress
+=
loadState
.
getRatio
();
IActivity
.
setTvProgress
(
currentProgress
);
responseSuccessCount
++;
if
(
responseSuccessCount
==
requestCount
)
{
endDownReturn
();
}
}
}
}
break
;
@Override
case
1
:
public
void
onError
(
Throwable
t
)
{
List
<
Food
>
foodList
=
GsonUtils
.
jsonToList
(
data
,
Food
.
class
);
super
.
onError
(
t
);
if
(
foodList
!=
null
)
{
DataDownLoadState
loadState
=
mList
.
get
(
downTag
);
Observable
.
just
(
0
)
loadState
.
setState
(
0
);
.
observeOn
(
Schedulers
.
io
())
mRootView
.
showMessage
(
"部分下載失敗,點擊刷新按鈕重新下載"
);
.
subscribe
(
new
Consumer
<
Integer
>()
{
@Override
public
void
accept
(
@NonNull
Integer
integer
)
throws
Exception
{
FoodDaoUtils
foodDao
=
new
FoodDaoUtils
(
IActivity
);
foodDao
.
deleteAll
();
foodDao
.
insertMultFood
(
foodList
);
}
});
}
}
});
break
;
}
case
2
:
List
<
Modifier
>
modifierList
=
GsonUtils
.
jsonToList
(
data
,
Modifier
.
class
);
public
void
downExpandInfo
(
int
downTag
)
{
if
(
modifierList
!=
null
)
{
int
restaurantId
=
RestaurantInfoManager
.
newInstance
().
getRestaurantId
();
Observable
.
just
(
0
)
mModel
.
downExpandInfo
(
restaurantId
)
.
observeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
new
Consumer
<
Integer
>()
{
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
@Override
.
subscribe
(
new
ErrorHandleSubscriber
<
BaseResult
>(
mErrorHandler
)
{
public
void
accept
(
@NonNull
Integer
integer
)
throws
Exception
{
ModifierDaoUtils
modifierDao
=
new
ModifierDaoUtils
(
IActivity
);
@Override
modifierDao
.
deleteAll
();
public
void
onSubscribe
(
Disposable
d
)
{
modifierDao
.
insertMultModifier
(
modifierList
);
super
.
onSubscribe
(
d
);
CommonConfiguration
.
getInstance
().
saveModifierTopIdConfiguration
(
modifierList
);
mDownDisposable
.
add
(
d
);
}
});
}
}
break
;
@Override
case
3
:
public
void
onNext
(
@NonNull
BaseResult
result
)
{
List
<
FoodCombo
>
foodComboList
=
GsonUtils
.
jsonToList
(
data
,
FoodCombo
.
class
);
if
(
result
.
isSuccess
())
{
if
(
foodComboList
!=
null
)
{
if
(
result
.
getData
()
!=
null
)
{
Observable
.
just
(
0
)
Observable
.
just
(
0
)
.
observeOn
(
Schedulers
.
io
())
.
observeOn
(
Schedulers
.
io
())
.
subscribe
(
new
Consumer
<
Integer
>()
{
.
subscribe
(
new
Consumer
<
Integer
>()
{
@Override
@Override
public
void
accept
(
@NonNull
Integer
integer
)
throws
Exception
{
public
void
accept
(
@NonNull
Integer
integer
)
throws
Exception
{
FoodComboDaoUtils
comboDao
=
new
FoodComboDaoUtils
(
IActivity
);
ExpandInfoDaoUtils
expandInfoDaoUtils
=
new
ExpandInfoDaoUtils
(
IActivity
);
comboDao
.
deleteAll
();
expandInfoDaoUtils
.
deleteAll
();
comboDao
.
insertMultCombo
(
foodComboList
);
List
<
ExpandInfo
>
expandInfoList
=
JsonUtils
.
parseArray
(
result
.
getData
(),
ExpandInfo
.
class
);
CommonConfiguration
.
getInstance
().
saveComboIdConfiguration
(
foodComboList
);
if
(
expandInfoList
!=
null
)
{
}
expandInfoDaoUtils
.
insertMultExpandInfo
(
expandInfoList
);
});
RestaurantExpandInfoUtils
.
setCommonExpandInfo
(
expandInfoList
);
}
}
});
}
DataDownLoadState
loadState
=
mList
.
get
(
downTag
);
loadState
.
setState
(
2
);
mAapter
.
notifyItemChanged
(
downTag
);
currentProgress
+=
loadState
.
getRatio
();
IActivity
.
setTvProgress
(
currentProgress
);
responseSuccessCount
++;
if
(
responseSuccessCount
==
requestCount
)
{
endDownReturn
();
}
}
}
}
break
;
@Override
case
4
:
public
void
onError
(
Throwable
t
)
{
List
<
ComboItem
>
comboItemList
=
GsonUtils
.
jsonToList
(
data
,
ComboItem
.
class
);
super
.
onError
(
t
);
if
(
comboItemList
!=
null
)
{
DataDownLoadState
loadState
=
mList
.
get
(
downTag
);
Observable
.
just
(
0
)
loadState
.
setState
(
0
);
.
observeOn
(
Schedulers
.
io
())
mRootView
.
showMessage
(
"部分下載失敗,點擊刷新按鈕重新下載"
);
.
subscribe
(
new
Consumer
<
Integer
>()
{
@Override
public
void
accept
(
@NonNull
Integer
integer
)
throws
Exception
{
ComboItemDaoUtils
comboDao
=
new
ComboItemDaoUtils
(
IActivity
);
comboDao
.
deleteAll
();
comboDao
.
insertMultCombo
(
comboItemList
);
}
});
}
}
})
;
break
;
}
case
5
:
List
<
FoodModifier
>
foodModifierList
=
GsonUtils
.
jsonToList
(
data
,
FoodModifier
.
class
);
public
void
downPrinterList
(
int
downTag
)
{
if
(
foodModifierList
!=
null
)
{
int
restaurantId
=
RestaurantInfoManager
.
newInstance
().
getRestaurantId
();
Observable
.
just
(
0
)
mModel
.
downPrinterList
(
restaurantId
)
.
observeOn
(
Schedulers
.
io
()
)
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
new
Consumer
<
Integer
>()
{
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
@Override
.
subscribe
(
new
ErrorHandleSubscriber
<
BaseResult
>(
mErrorHandler
)
{
public
void
accept
(
@NonNull
Integer
integer
)
throws
Exception
{
FoodModifierDaoUtils
foodModifierDao
=
new
FoodModifierDaoUtils
(
IActivity
);
@Override
foodModifierDao
.
deleteAll
();
public
void
onSubscribe
(
Disposable
d
)
{
foodModifierDao
.
insertMultFoodModifier
(
foodModifierList
);
super
.
onSubscribe
(
d
);
}
mDownDisposable
.
add
(
d
);
}
);
}
}
break
;
@Override
case
6
:
public
void
onNext
(
@NonNull
BaseResult
result
)
{
List
<
Discount
>
discountList
=
GsonUtils
.
jsonToList
(
data
,
Discount
.
class
);
if
(
result
.
isSuccess
())
{
if
(
discountList
!=
null
)
{
if
(
result
.
getData
()
!=
null
)
{
Observable
.
just
(
0
)
Observable
.
just
(
0
)
.
observeOn
(
Schedulers
.
io
())
.
observeOn
(
Schedulers
.
io
())
.
subscribe
(
new
Consumer
<
Integer
>()
{
.
subscribe
(
new
Consumer
<
Integer
>()
{
@Override
@Override
public
void
accept
(
@NonNull
Integer
integer
)
throws
Exception
{
public
void
accept
(
@NonNull
Integer
integer
)
throws
Exception
{
DiscountDaoUtils
discountDaoUtils
=
new
DiscountDaoUtils
(
IActivity
);
PrinterDeviceDaoUtils
printerDeviceDaoUtils
=
new
PrinterDeviceDaoUtils
(
IActivity
);
discountDaoUtils
.
deleteAll
();
printerDeviceDaoUtils
.
deleteAll
();
discountDaoUtils
.
insertMultDiscount
(
discountList
);
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
();
}
}
}
}
break
;
@Override
case
7
:
public
void
onError
(
Throwable
t
)
{
List
<
ExpandInfo
>
expandInfoList
=
GsonUtils
.
jsonToList
(
data
,
ExpandInfo
.
class
);
super
.
onError
(
t
);
if
(
expandInfoList
!=
null
)
{
DataDownLoadState
loadState
=
mList
.
get
(
downTag
);
Observable
.
just
(
0
)
loadState
.
setState
(
0
);
.
observeOn
(
Schedulers
.
io
())
mRootView
.
showMessage
(
"部分下載失敗,點擊刷新按鈕重新下載"
);
.
subscribe
(
new
Consumer
<
Integer
>()
{
@Override
public
void
accept
(
@NonNull
Integer
integer
)
throws
Exception
{
ExpandInfoDaoUtils
expandInfoDaoUtils
=
new
ExpandInfoDaoUtils
(
IActivity
);
expandInfoDaoUtils
.
deleteAll
();
expandInfoDaoUtils
.
insertMultExpandInfo
(
expandInfoList
);
RestaurantExpandInfoUtils
.
setCommonExpandInfo
(
expandInfoList
);
}
});
}
}
})
;
break
;
}
case
8
:
PrinterListBean
printerListBean
=
JsonUtils
.
parseObject
(
data
,
PrinterListBean
.
class
);
if
(
printerListBean
!=
null
)
{
public
void
downColorList
(
int
downTag
)
{
Observable
.
just
(
0
)
mModel
.
downColorList
(
)
.
observeOn
(
Schedulers
.
io
()
)
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
new
Consumer
<
Integer
>()
{
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
@Override
.
subscribe
(
new
ErrorHandleSubscriber
<
BaseResult
>(
mErrorHandler
)
{
public
void
accept
(
@NonNull
Integer
integer
)
throws
Exception
{
PrinterDeviceDaoUtils
printerDeviceDaoUtils
=
new
PrinterDeviceDaoUtils
(
IActivity
);
@Override
printerDeviceDaoUtils
.
deleteAll
();
public
void
onSubscribe
(
Disposable
d
)
{
printerDeviceDaoUtils
.
insertMultPrinterDeviceBean
(
printerListBean
.
getList
());
super
.
onSubscribe
(
d
);
}
mDownDisposable
.
add
(
d
);
}
);
}
}
break
;
@Override
case
9
:
public
void
onNext
(
@NonNull
BaseResult
result
)
{
List
<
ColorBean
>
colorBeanList
=
GsonUtils
.
jsonToList
(
data
,
ColorBean
.
class
);
if
(
result
.
isSuccess
())
{
if
(
colorBeanList
!=
null
)
{
if
(
result
.
getData
()
!=
null
)
{
Observable
.
just
(
0
)
Observable
.
just
(
0
)
.
observeOn
(
Schedulers
.
io
())
.
observeOn
(
Schedulers
.
io
())
.
subscribe
(
new
Consumer
<
Integer
>()
{
.
subscribe
(
new
Consumer
<
Integer
>()
{
@Override
@Override
public
void
accept
(
@NonNull
Integer
integer
)
throws
Exception
{
public
void
accept
(
@NonNull
Integer
integer
)
throws
Exception
{
ColorDaoUtils
colorDaoUtils
=
new
ColorDaoUtils
(
IActivity
);
ColorDaoUtils
colorDaoUtils
=
new
ColorDaoUtils
(
IActivity
);
colorDaoUtils
.
deleteAll
();
colorDaoUtils
.
deleteAll
();
colorDaoUtils
.
insertMultColorBean
(
colorBeanList
);
List
<
ColorBean
>
colorBeanList
=
JsonUtils
.
parseArray
(
result
.
getData
(),
ColorBean
.
class
);
}
if
(
colorBeanList
!=
null
)
{
});
colorDaoUtils
.
insertMultColorBean
(
colorBeanList
);
}
}
});
}
DataDownLoadState
loadState
=
mList
.
get
(
downTag
);
loadState
.
setState
(
2
);
mAapter
.
notifyItemChanged
(
downTag
);
currentProgress
+=
loadState
.
getRatio
();
IActivity
.
setTvProgress
(
currentProgress
);
responseSuccessCount
++;
if
(
responseSuccessCount
==
requestCount
)
{
endDownReturn
();
}
}
}
}
break
;
}
}
catch
(
Exception
e
)
{
LoganManager
.
w_code
(
TAG
,
"下載異常="
+
e
.
getMessage
());
}
finally
{
@Override
}
public
void
onError
(
Throwable
t
)
{
super
.
onError
(
t
);
DataDownLoadState
loadState
=
mList
.
get
(
downTag
);
loadState
.
setState
(
0
);
mRootView
.
showMessage
(
"部分下載失敗,點擊刷新按鈕重新下載"
);
}
});
}
}
private
void
initDownState
()
{
private
void
initDownState
()
{
for
(
int
i
=
0
;
i
<
mList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
mList
.
size
();
i
++)
{
//初始化下载状态
//初始化下载状态
...
@@ -809,4 +463,12 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
...
@@ -809,4 +463,12 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
}
}
}
}
public
void
stopDownDisposable
()
{
for
(
int
i
=
0
;
i
<
mDownDisposable
.
size
();
i
++)
{
if
(
mDownDisposable
.
get
(
i
)
!=
null
&&
!
mDownDisposable
.
get
(
i
).
isDisposed
())
{
mDownDisposable
.
get
(
i
).
dispose
();
}
}
mDownDisposable
.
clear
();
}
}
}
component-download/src/main/java/com/gingersoft/gsa/cloud/download/mvp/ui/activity/DownloadActivity.java
View file @
ef2056da
...
@@ -199,7 +199,6 @@ public class DownloadActivity extends BaseActivity<DownloadPresenter> implements
...
@@ -199,7 +199,6 @@ public class DownloadActivity extends BaseActivity<DownloadPresenter> implements
@Override
@Override
public
void
killMyself
()
{
public
void
killMyself
()
{
mPresenter
.
stopDownDisposable
();
onBackPressed
();
onBackPressed
();
}
}
...
...
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/BaseOrderPresenter.java
View file @
ef2056da
...
@@ -12,6 +12,7 @@ import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager;
...
@@ -12,6 +12,7 @@ import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager;
import
com.gingersoft.gsa.cloud.common.core.restaurant.utils.RestaurantExpandInfoUtils
;
import
com.gingersoft.gsa.cloud.common.core.restaurant.utils.RestaurantExpandInfoUtils
;
import
com.gingersoft.gsa.cloud.common.core.table.TableBean
;
import
com.gingersoft.gsa.cloud.common.core.table.TableBean
;
import
com.gingersoft.gsa.cloud.common.core.user.UserContext
;
import
com.gingersoft.gsa.cloud.common.core.user.UserContext
;
import
com.gingersoft.gsa.cloud.common.logan.LoganManager
;
import
com.gingersoft.gsa.cloud.common.utils.LanguageUtils
;
import
com.gingersoft.gsa.cloud.common.utils.LanguageUtils
;
import
com.gingersoft.gsa.cloud.common.utils.MoneyUtil
;
import
com.gingersoft.gsa.cloud.common.utils.MoneyUtil
;
import
com.gingersoft.gsa.cloud.common.utils.time.TimeUtils
;
import
com.gingersoft.gsa.cloud.common.utils.time.TimeUtils
;
...
@@ -273,6 +274,8 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -273,6 +274,8 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
double
wholeAmount
=
getFoodTotal
();
double
wholeAmount
=
getFoodTotal
();
mShoppingCart
.
setWholeAmount
(
wholeAmount
);
mShoppingCart
.
setWholeAmount
(
wholeAmount
);
LoganManager
.
w_tableMode
(
TAG
,
"合計金額="
+
wholeAmount
);
disposable
=
Observable
.
just
(
wholeAmount
)
disposable
=
Observable
.
just
(
wholeAmount
)
.
subscribeOn
(
Schedulers
.
computation
())
.
subscribeOn
(
Schedulers
.
computation
())
/**
/**
...
@@ -285,13 +288,14 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -285,13 +288,14 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
int
serviceCharge
=
mDoshokuOrder
.
getOpenTableInfo
().
getServiceCharge
();
int
serviceCharge
=
mDoshokuOrder
.
getOpenTableInfo
().
getServiceCharge
();
if
(
serviceCharge
>
0
)
{
if
(
serviceCharge
>
0
)
{
ServiceChargeItem
item
=
new
ServiceChargeItem
(
serviceChargeStr
);
ServiceChargeItem
item
=
new
ServiceChargeItem
(
serviceChargeStr
);
double
serviceChargeMoney
=
getServiceableAmout
();
double
serviceChargeMoney
=
getServiceableAmout
();
totalAmount
=
item
.
updateBillItem
(
serviceChargeMoney
,
serviceCharge
);
totalAmount
=
item
.
updateBillItem
(
serviceChargeMoney
,
serviceCharge
);
if
(
Double
.
doubleToLongBits
(
item
.
getMoney
())
!=
0.0
)
{
if
(
Double
.
doubleToLongBits
(
item
.
getMoney
())
!=
0.0
)
{
mBillItemList
.
add
(
item
);
mBillItemList
.
add
(
item
);
mShoppingCart
.
setServiceCharge
(
item
.
getMoney
());
mShoppingCart
.
setServiceCharge
(
item
.
getMoney
());
}
}
LoganManager
.
w_tableMode
(
TAG
,
"服務費="
+
serviceChargeMoney
);
LoganManager
.
w_tableMode
(
TAG
,
LoganManager
.
EVENT_CALCULATE
,
"服務費後總金額="
+
totalAmount
);
}
}
}
}
return
totalAmount
;
return
totalAmount
;
...
@@ -312,6 +316,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -312,6 +316,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
if
(
orderDiscounts
!=
null
)
{
if
(
orderDiscounts
!=
null
)
{
for
(
OrderDiscountResponse
orderDiscount
:
orderDiscounts
)
{
for
(
OrderDiscountResponse
orderDiscount
:
orderDiscounts
)
{
if
(
orderDiscount
.
getType
()
==
OrderDiscountRequest
.
ORDER_DISCOUNT
)
{
if
(
orderDiscount
.
getType
()
==
OrderDiscountRequest
.
ORDER_DISCOUNT
)
{
LoganManager
.
w_tableMode
(
TAG
,
"已下單整單折扣金額="
+
orderDiscount
.
getDiscountAmount
());
//整單折扣
//整單折扣
Discount
discount
=
new
Discount
();
Discount
discount
=
new
Discount
();
discount
.
setId
(
orderDiscount
.
getDiscountId
());
discount
.
setId
(
orderDiscount
.
getDiscountId
());
...
@@ -326,7 +331,9 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -326,7 +331,9 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
if
(
memberInfo
!=
null
)
{
if
(
memberInfo
!=
null
)
{
mShoppingCart
.
addMultyDiscount
(
mShoppingCart
.
createMemberDiscount
(
memberInfo
,
BillItem
.
BILL_ITEM_ORDER_SENT_STATUS
));
mShoppingCart
.
addMultyDiscount
(
mShoppingCart
.
createMemberDiscount
(
memberInfo
,
BillItem
.
BILL_ITEM_ORDER_SENT_STATUS
));
}
}
LoganManager
.
w_tableMode
(
TAG
,
"已下單會員折扣比例="
+
memberInfo
.
getMemberPoint
());
}
else
if
(
orderDiscount
.
getType
()
==
OrderDiscountRequest
.
COUPON_DISCOUNT
)
{
}
else
if
(
orderDiscount
.
getType
()
==
OrderDiscountRequest
.
COUPON_DISCOUNT
)
{
LoganManager
.
w_tableMode
(
TAG
,
"已下單優惠券折扣金額="
+
orderDiscount
.
getDiscountAmount
());
//優惠券折扣
//優惠券折扣
CouponDiscountBean
couponDiscount
=
new
CouponDiscountBean
();
CouponDiscountBean
couponDiscount
=
new
CouponDiscountBean
();
couponDiscount
.
setCouponTypeName1
(
orderDiscount
.
getRemark
());
couponDiscount
.
setCouponTypeName1
(
orderDiscount
.
getRemark
());
...
@@ -345,9 +352,11 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -345,9 +352,11 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
setOrderMealPasteDSMark
();
setOrderMealPasteDSMark
();
//計算折扣金額
//計算折扣金額
double
discountableMoney
=
getDiscountableAmount
();
double
discountableMoney
=
getDiscountableAmount
();
LoganManager
.
w_tableMode
(
TAG
,
"可折扣金額="
+
discountableMoney
);
if
(
mShoppingCart
.
getMultyDiscountList
().
size
()
>
0
)
{
if
(
mShoppingCart
.
getMultyDiscountList
().
size
()
>
0
)
{
//調用折扣鏈進行計算
//調用折扣鏈進行計算
totalAmount
=
MoneyUtil
.
sub
(
totalAmount
,
mShoppingCart
.
calculateLinkedDiscounts
(
discountableMoney
));
totalAmount
=
MoneyUtil
.
sub
(
totalAmount
,
mShoppingCart
.
calculateLinkedDiscounts
(
discountableMoney
));
LoganManager
.
w_tableMode
(
TAG
,
LoganManager
.
EVENT_CALCULATE
,
"賬單後總金額="
+
totalAmount
);
}
}
return
totalAmount
;
return
totalAmount
;
}
}
...
@@ -360,6 +369,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -360,6 +369,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
public
Double
apply
(
Double
totalAmount
)
throws
Exception
{
public
Double
apply
(
Double
totalAmount
)
throws
Exception
{
double
roundingTotalAmount
=
getTotalAmountFilterByType
(
BillItem
.
ROUNDING_TYPE
);
double
roundingTotalAmount
=
getTotalAmountFilterByType
(
BillItem
.
ROUNDING_TYPE
);
if
(
roundingTotalAmount
>
0
)
{
if
(
roundingTotalAmount
>
0
)
{
LoganManager
.
w_tableMode
(
TAG
,
"賬單小數="
+
roundingTotalAmount
);
RoundingItem
item
=
new
RoundingItem
(
roundingStr
);
RoundingItem
item
=
new
RoundingItem
(
roundingStr
);
totalAmount
=
item
.
updateBillItem
(
roundingTotalAmount
);
totalAmount
=
item
.
updateBillItem
(
roundingTotalAmount
);
if
(
Double
.
doubleToLongBits
(
item
.
getMoney
())
!=
0.0
)
{
if
(
Double
.
doubleToLongBits
(
item
.
getMoney
())
!=
0.0
)
{
...
@@ -382,6 +392,8 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -382,6 +392,8 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
//刷新美食Item數據
//刷新美食Item數據
mSelectMealAdapter
.
notifyDataSetChanged
();
mSelectMealAdapter
.
notifyDataSetChanged
();
LoganManager
.
w_tableMode
(
TAG
,
"總金額="
+
totalAmount
);
if
(
mOrderContentActivity
!=
null
)
{
if
(
mOrderContentActivity
!=
null
)
{
mOrderContentActivity
.
initOrderBill
(
wholeAmount
,
totalAmount
);
mOrderContentActivity
.
initOrderBill
(
wholeAmount
,
totalAmount
);
}
}
...
@@ -454,13 +466,13 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -454,13 +466,13 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
public
void
onRequestPermissionSuccess
()
{
public
void
onRequestPermissionSuccess
()
{
String
title
=
null
;
String
title
=
null
;
if
(
IActivity
instanceof
MealStandActivity
)
{
if
(
IActivity
instanceof
MealStandActivity
)
{
title
=
"掃描會員碼"
;
title
=
"掃描會員碼"
;
}
else
if
(
IActivity
instanceof
OrderContentActivity
)
{
}
else
if
(
IActivity
instanceof
OrderContentActivity
)
{
title
=
"掃描優惠券碼"
;
title
=
"掃描優惠券碼"
;
}
}
CC
.
obtainBuilder
(
ComponentName
.
COMPONENT_SCAN
)
CC
.
obtainBuilder
(
ComponentName
.
COMPONENT_SCAN
)
.
setActionName
(
"openScanActivity"
)
.
setActionName
(
"openScanActivity"
)
.
addParam
(
"title"
,
title
)
.
addParam
(
"title"
,
title
)
.
build
()
.
build
()
.
callAsyncCallbackOnMainThread
((
cc
,
result
)
->
{
.
callAsyncCallbackOnMainThread
((
cc
,
result
)
->
{
...
@@ -488,6 +500,9 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -488,6 +500,9 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
}
}
OrderDetail
orderFood
=
mOrderMealList
.
get
(
mSelectMealAdapter
.
getSelect_full_start_position
());
OrderDetail
orderFood
=
mOrderMealList
.
get
(
mSelectMealAdapter
.
getSelect_full_start_position
());
OrderDetail
orderMainFood
=
mOrderMealList
.
get
(
mSelectMealAdapter
.
getMainStartPos
());
OrderDetail
orderMainFood
=
mOrderMealList
.
get
(
mSelectMealAdapter
.
getMainStartPos
());
LoganManager
.
w_tableMode
(
TAG
,
LoganManager
.
EVENT_MODIFY
,
orderFood
.
getProductName
()
+
" 數量="
+
number
);
mShoppingCart
.
changeNumber
(
number
,
orderFood
,
orderMainFood
,
mShoppingCart
.
changeNumber
(
number
,
orderFood
,
orderMainFood
,
mSelectMealAdapter
.
getSelect_full_start_position
(),
mSelectMealAdapter
.
getSelect_full_start_position
(),
mSelectMealAdapter
.
getSelect_full_end_position
(),
mSelectMealAdapter
.
getSelect_full_end_position
(),
...
@@ -495,6 +510,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -495,6 +510,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
@Override
@Override
public
void
achieveMaximum
(
String
name
)
{
public
void
achieveMaximum
(
String
name
)
{
String
msg
=
"["
+
name
+
"]"
+
"已售罄"
;
String
msg
=
"["
+
name
+
"]"
+
"已售罄"
;
LoganManager
.
w_tableMode
(
TAG
,
msg
);
CommonTipDialog
.
showSurpisedDialog
(
IActivity
,
msg
,
null
,
null
,
null
,
null
,
null
);
CommonTipDialog
.
showSurpisedDialog
(
IActivity
,
msg
,
null
,
null
,
null
,
null
,
null
);
}
}
});
});
...
@@ -948,7 +964,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
...
@@ -948,7 +964,7 @@ public abstract class BaseOrderPresenter<M extends BaseOrderContract.Model, V ex
}
}
protected
CreateOrderRequest
getCreateOrderRequest
(
List
<
OrderDetail
>
foodList
)
{
protected
CreateOrderRequest
getCreateOrderRequest
(
List
<
OrderDetail
>
foodList
)
{
List
<
OrderDetail
>
newFoodList
=
OrderDetail
.
transNewOrderDetails
(
foodList
);
List
<
OrderDetail
>
newFoodList
=
OrderDetail
.
transNewOrderDetails
(
foodList
);
if
(
RestaurantExpandInfoUtils
.
getValue
(
ExpandConstant
.
MergeSendFood
,
true
))
{
if
(
RestaurantExpandInfoUtils
.
getValue
(
ExpandConstant
.
MergeSendFood
,
true
))
{
//合并未送单主食品
//合并未送单主食品
mergeMainFoodNumber
(
newFoodList
);
mergeMainFoodNumber
(
newFoodList
);
...
...
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/MealStandPresenter.java
View file @
ef2056da
...
@@ -14,6 +14,7 @@ import com.gingersoft.gsa.cloud.common.constans.PrintConstans;
...
@@ -14,6 +14,7 @@ import com.gingersoft.gsa.cloud.common.constans.PrintConstans;
import
com.gingersoft.gsa.cloud.common.core.member.MemberInfo
;
import
com.gingersoft.gsa.cloud.common.core.member.MemberInfo
;
import
com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager
;
import
com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager
;
import
com.gingersoft.gsa.cloud.common.core.restaurant.utils.RestaurantExpandInfoUtils
;
import
com.gingersoft.gsa.cloud.common.core.restaurant.utils.RestaurantExpandInfoUtils
;
import
com.gingersoft.gsa.cloud.common.logan.LoganManager
;
import
com.gingersoft.gsa.cloud.common.utils.JsonUtils
;
import
com.gingersoft.gsa.cloud.common.utils.JsonUtils
;
import
com.gingersoft.gsa.cloud.common.utils.LanguageUtils
;
import
com.gingersoft.gsa.cloud.common.utils.LanguageUtils
;
import
com.gingersoft.gsa.cloud.common.utils.MoneyUtil
;
import
com.gingersoft.gsa.cloud.common.utils.MoneyUtil
;
...
@@ -199,7 +200,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -199,7 +200,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
this
.
mAppManager
=
null
;
this
.
mAppManager
=
null
;
this
.
mImageLoader
=
null
;
this
.
mImageLoader
=
null
;
this
.
mApplication
=
null
;
this
.
mApplication
=
null
;
if
(
mMealDiscountAction
!=
null
)
{
if
(
mMealDiscountAction
!=
null
)
{
mMealDiscountAction
.
destroy
();
mMealDiscountAction
.
destroy
();
}
}
}
}
...
@@ -317,6 +318,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -317,6 +318,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
if
(!
foodConditionFilter
(
datasBean
))
{
if
(!
foodConditionFilter
(
datasBean
))
{
return
;
return
;
}
}
LoganManager
.
w_tableMode
(
TAG
,
LoganManager
.
EVENT_ADD
+
"食品【"
+
datasBean
.
getFoodName
()
+
"】"
);
RvMealClicked
=
false
;
RvMealClicked
=
false
;
if
(
datasBean
.
getIsParent
()
==
0
)
{
if
(
datasBean
.
getIsParent
()
==
0
)
{
changedMealByParentId
(
datasBean
.
getId
());
changedMealByParentId
(
datasBean
.
getId
());
...
@@ -343,6 +345,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -343,6 +345,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
//已送單數量已等於最大數,不能繼續添加
//已送單數量已等於最大數,不能繼續添加
return
;
return
;
}
}
LoganManager
.
w_tableMode
(
TAG
,
LoganManager
.
EVENT_ADD
+
"子食品【"
+
datasBean
.
getName
()
+
"】"
);
//设置当前操作的套餐细项
//设置当前操作的套餐细项
long
id
=
mCurrentOrderDetailBean
.
isNew
()
?
mCurrentOrderDetailBean
.
getProductId
()
:
mCurrentOrderDetailBean
.
getId
();
long
id
=
mCurrentOrderDetailBean
.
isNew
()
?
mCurrentOrderDetailBean
.
getProductId
()
:
mCurrentOrderDetailBean
.
getId
();
mCurrentOrderDetailBean
=
OrderDetail
.
comboTransOrderDetail
(
datasBean
,
id
,
mCurrentOrderDetailBean
.
getProductId
(),
1
,
OrderDetail
.
COMBO_PROP
,
RvMealClicked
);
mCurrentOrderDetailBean
=
OrderDetail
.
comboTransOrderDetail
(
datasBean
,
id
,
mCurrentOrderDetailBean
.
getProductId
(),
1
,
OrderDetail
.
COMBO_PROP
,
RvMealClicked
);
...
@@ -375,6 +378,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -375,6 +378,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
//已送單數量已等於最大數,不能繼續添加
//已送單數量已等於最大數,不能繼續添加
return
;
return
;
}
}
LoganManager
.
w_tableMode
(
TAG
,
LoganManager
.
EVENT_ADD
+
"細項【"
+
datasBean
.
getName
()
+
"】"
);
// if (datasBean.isModKeyboard()) {
// if (datasBean.isModKeyboard()) {
// addModalKeyBoardModfier(datasBean.getModifier());
// addModalKeyBoardModfier(datasBean.getModifier());
// displayModalKeyBoardDialog();
// displayModalKeyBoardDialog();
...
@@ -401,6 +405,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -401,6 +405,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
if
(!
discountConditionFilter
(
discountBean
))
{
if
(!
discountConditionFilter
(
discountBean
))
{
return
;
return
;
}
}
LoganManager
.
w_tableMode
(
TAG
,
LoganManager
.
EVENT_ADD
+
"折扣【"
+
discountBean
.
getRemark
()
+
"】"
);
// if (cutOutDiscount() == -100) {
// if (cutOutDiscount() == -100) {
// return;
// return;
// }
// }
...
@@ -890,13 +895,13 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -890,13 +895,13 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
mergeMainFoodNumber
(
mOrderMealList
);
mergeMainFoodNumber
(
mOrderMealList
);
}
}
PrintContent
printContent
=
new
PrintContentAdapter
().
adaptationServingPaperContent
(
DoshokuOrder
.
getInstance
(),
mTableInfo
);
PrintContent
printContent
=
new
PrintContentAdapter
().
adaptationServingPaperContent
(
DoshokuOrder
.
getInstance
(),
mTableInfo
);
CC
.
obtainBuilder
(
ComponentName
.
COMPONENT_PRINT
)
CC
.
obtainBuilder
(
ComponentName
.
COMPONENT_PRINT
)
.
setActionName
(
"printActivity"
)
.
setActionName
(
"printActivity"
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
PrintConstans
.
PRINT_SERVE
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
PrintConstans
.
PRINT_SERVE
)
.
addParam
(
PrintConstans
.
PRINT_CONTENT
,
printContent
)
.
addParam
(
PrintConstans
.
PRINT_CONTENT
,
printContent
)
.
addParam
(
PrintConstans
.
PRINT_ORDER_NO
,
DoshokuOrder
.
getInstance
().
getOrderNo
())
.
addParam
(
PrintConstans
.
PRINT_ORDER_NO
,
DoshokuOrder
.
getInstance
().
getOrderNo
())
.
build
()
.
build
()
.
callAsyncCallbackOnMainThread
((
cc
,
result
)
->
{
.
callAsyncCallbackOnMainThread
((
cc
,
result
)
->
{
if
(
result
.
isSuccess
())
{
if
(
result
.
isSuccess
())
{
...
@@ -1062,6 +1067,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -1062,6 +1067,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
mCancelFoodDialog
.
build
().
dismiss
();
mCancelFoodDialog
.
build
().
dismiss
();
mCancelFoodDialog
=
null
;
mCancelFoodDialog
=
null
;
}
}
LoganManager
.
w_tableMode
(
TAG
,
LoganManager
.
EVENT_CLICK
+
"確刪除"
);
markDeleteFood
(
maxNumber
,
deleteNumber
,
reasonId
,
reason
);
markDeleteFood
(
maxNumber
,
deleteNumber
,
reasonId
,
reason
);
});
});
dialogBuilder
.
addAction
(
"取消"
,
(
dialog
,
index
)
->
dialog
.
dismiss
());
dialogBuilder
.
addAction
(
"取消"
,
(
dialog
,
index
)
->
dialog
.
dismiss
());
...
@@ -1074,6 +1080,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -1074,6 +1080,7 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
mCancelFoodDialog
.
setOnClickListener
(
new
CancelFoodDialog
.
OnClickListener
()
{
mCancelFoodDialog
.
setOnClickListener
(
new
CancelFoodDialog
.
OnClickListener
()
{
@Override
@Override
public
void
onItemClick
(
FoodReason
item
,
int
position
,
int
deleteNumber
)
{
public
void
onItemClick
(
FoodReason
item
,
int
position
,
int
deleteNumber
)
{
LoganManager
.
w_tableMode
(
TAG
,
LoganManager
.
EVENT_CLICK
+
"刪除原因="
+
item
.
getContent
());
showDeleteFoodDialog
(
deleteFood
.
getNumber
(),
deleteNumber
,
item
.
getId
(),
item
.
getContent
());
showDeleteFoodDialog
(
deleteFood
.
getNumber
(),
deleteNumber
,
item
.
getId
(),
item
.
getContent
());
}
}
});
});
...
@@ -1113,12 +1120,15 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
...
@@ -1113,12 +1120,15 @@ public class MealStandPresenter extends BaseOrderPresenter<MealStandContract.Mod
if
(!
deleteFood
.
isNew
())
{
if
(!
deleteFood
.
isNew
())
{
//TODO 刪除已下單食品
//TODO 刪除已下單食品
if
(!
deleteFood
.
isModify
())
{
if
(!
deleteFood
.
isModify
())
{
LoganManager
.
w_tableMode
(
TAG
,
LoganManager
.
EVENT_CLICK
+
"刪除已下單食品【"
+
deleteFood
.
getRemark
()
+
"】"
);
deleteWithOrderedFood
(
deleteFood
);
deleteWithOrderedFood
(
deleteFood
);
}
}
}
else
{
}
else
{
if
(
deleteStyle
==
2
)
{
if
(
deleteStyle
==
2
)
{
LoganManager
.
w_tableMode
(
TAG
,
LoganManager
.
EVENT_LONG_CLICK
+
"刪除【"
+
deleteFood
.
getRemark
()
+
"】"
);
mSelectMealAdapter
.
removeAllNewFoodItem
();
mSelectMealAdapter
.
removeAllNewFoodItem
();
}
else
{
}
else
{
LoganManager
.
w_tableMode
(
TAG
,
LoganManager
.
EVENT_CLICK
+
"刪除【"
+
deleteFood
.
getRemark
()
+
"】"
);
int
deletePosition
=
mSelectMealAdapter
.
removeFoodItem
();
int
deletePosition
=
mSelectMealAdapter
.
removeFoodItem
();
mRootView
.
setMealRvScrollToPosition
(
deletePosition
);
mRootView
.
setMealRvScrollToPosition
(
deletePosition
);
//更新最大可選數
//更新最大可選數
...
...
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/OrderContentPresenter.java
View file @
ef2056da
...
@@ -17,6 +17,7 @@ import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager;
...
@@ -17,6 +17,7 @@ import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager;
import
com.gingersoft.gsa.cloud.common.core.restaurant.utils.RestaurantExpandInfoUtils
;
import
com.gingersoft.gsa.cloud.common.core.restaurant.utils.RestaurantExpandInfoUtils
;
import
com.gingersoft.gsa.cloud.common.core.table.TableBean
;
import
com.gingersoft.gsa.cloud.common.core.table.TableBean
;
import
com.gingersoft.gsa.cloud.common.core.table.TableExtBean
;
import
com.gingersoft.gsa.cloud.common.core.table.TableExtBean
;
import
com.gingersoft.gsa.cloud.common.logan.LoganManager
;
import
com.gingersoft.gsa.cloud.common.utils.JsonUtils
;
import
com.gingersoft.gsa.cloud.common.utils.JsonUtils
;
import
com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils
;
import
com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils
;
import
com.gingersoft.gsa.cloud.component.ComponentName
;
import
com.gingersoft.gsa.cloud.component.ComponentName
;
...
@@ -174,6 +175,8 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
...
@@ -174,6 +175,8 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
@Override
@Override
public
void
onItemClick
(
View
v
,
Function
function
)
{
public
void
onItemClick
(
View
v
,
Function
function
)
{
LoganManager
.
w_tableMode
(
TAG
,
LoganManager
.
EVENT_CLICK
,
function
.
getResName
());
mRootView
.
recordOperat
(
true
);
mRootView
.
recordOperat
(
true
);
switch
(
function
.
getResName
())
{
switch
(
function
.
getResName
())
{
...
@@ -234,6 +237,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
...
@@ -234,6 +237,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
@Override
@Override
public
boolean
onItemLongClick
(
View
v
,
Function
datasBean
)
{
public
boolean
onItemLongClick
(
View
v
,
Function
datasBean
)
{
LoganManager
.
w_tableMode
(
TAG
,
LoganManager
.
EVENT_LONG_CLICK
,
datasBean
.
getResName
());
if
(
datasBean
.
getResName
().
equals
(
"印單"
)
||
datasBean
.
getResName
().
equals
(
"送單"
))
{
if
(
datasBean
.
getResName
().
equals
(
"印單"
)
||
datasBean
.
getResName
().
equals
(
"送單"
))
{
PrinterUtils
.
switchPrintMethod
(
IActivity
,
datasBean
,
mOrderTopFunctionAdapter
);
PrinterUtils
.
switchPrintMethod
(
IActivity
,
datasBean
,
mOrderTopFunctionAdapter
);
}
}
...
@@ -683,7 +687,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
...
@@ -683,7 +687,7 @@ public class OrderContentPresenter extends BaseOrderPresenter<OrderContentContra
updateBillInfo
();
updateBillInfo
();
IActivity
.
backPressed
();
IActivity
.
backPressed
();
}
else
{
}
else
{
mRootView
.
showMessage
(
"獲取訂單數據失敗"
);
mRootView
.
showMessage
(
info
.
getErrMsg
()
);
}
}
}
}
});
});
...
...
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/presenter/OrderPayPresenter.java
View file @
ef2056da
...
@@ -8,6 +8,7 @@ import com.gingersoft.gsa.cloud.common.constans.FoodSummaryConstans;
...
@@ -8,6 +8,7 @@ import com.gingersoft.gsa.cloud.common.constans.FoodSummaryConstans;
import
com.gingersoft.gsa.cloud.common.constans.HttpsConstans
;
import
com.gingersoft.gsa.cloud.common.constans.HttpsConstans
;
import
com.gingersoft.gsa.cloud.common.core.member.MemberInfo
;
import
com.gingersoft.gsa.cloud.common.core.member.MemberInfo
;
import
com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager
;
import
com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager
;
import
com.gingersoft.gsa.cloud.common.logan.LoganManager
;
import
com.gingersoft.gsa.cloud.common.utils.JsonUtils
;
import
com.gingersoft.gsa.cloud.common.utils.JsonUtils
;
import
com.gingersoft.gsa.cloud.common.utils.MoneyUtil
;
import
com.gingersoft.gsa.cloud.common.utils.MoneyUtil
;
import
com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils
;
import
com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils
;
...
@@ -180,10 +181,12 @@ public class OrderPayPresenter extends BaseOrderPresenter<OrderPayContract.Model
...
@@ -180,10 +181,12 @@ public class OrderPayPresenter extends BaseOrderPresenter<OrderPayContract.Model
}
}
}
}
}
}
LoganManager
.
w_pay
(
TAG
,
"支付成功"
);
mRootView
.
showMessage
(
"支付成功"
);
mRootView
.
showMessage
(
"支付成功"
);
//結賬成功
//結賬成功
mRootView
.
paySuccess
();
mRootView
.
paySuccess
();
}
else
{
}
else
{
LoganManager
.
w_pay
(
TAG
,
"支付失敗="
+
baseResult
.
getErrMsg
());
mRootView
.
showMessage
(
baseResult
.
getErrMsg
());
mRootView
.
showMessage
(
baseResult
.
getErrMsg
());
}
}
}
}
...
@@ -267,8 +270,11 @@ public class OrderPayPresenter extends BaseOrderPresenter<OrderPayContract.Model
...
@@ -267,8 +270,11 @@ public class OrderPayPresenter extends BaseOrderPresenter<OrderPayContract.Model
@Override
@Override
public
void
onNext
(
BaseResult
baseResult
)
{
public
void
onNext
(
BaseResult
baseResult
)
{
if
(
baseResult
.
isSuccess
())
{
if
(
baseResult
.
isSuccess
())
{
LoganManager
.
w_pay
(
TAG
,
"修改訂單支付成功"
);
//結賬成功
//結賬成功
mRootView
.
paySuccess
();
mRootView
.
paySuccess
();
}
else
{
LoganManager
.
w_pay
(
TAG
,
"修改訂單支付失敗="
+
baseResult
.
getErrMsg
());
}
}
}
}
});
});
...
...
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/MealStandActivity.java
View file @
ef2056da
...
@@ -41,6 +41,7 @@ import com.gingersoft.gsa.cloud.common.constans.MealConstant;
...
@@ -41,6 +41,7 @@ import com.gingersoft.gsa.cloud.common.constans.MealConstant;
import
com.gingersoft.gsa.cloud.common.core.member.MemberInfo
;
import
com.gingersoft.gsa.cloud.common.core.member.MemberInfo
;
import
com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager
;
import
com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager
;
import
com.gingersoft.gsa.cloud.common.core.table.TableBean
;
import
com.gingersoft.gsa.cloud.common.core.table.TableBean
;
import
com.gingersoft.gsa.cloud.common.logan.LoganManager
;
import
com.gingersoft.gsa.cloud.common.scan.ScanHelper
;
import
com.gingersoft.gsa.cloud.common.scan.ScanHelper
;
import
com.gingersoft.gsa.cloud.common.utils.LanguageUtils
;
import
com.gingersoft.gsa.cloud.common.utils.LanguageUtils
;
import
com.gingersoft.gsa.cloud.common.utils.VibratorUtils
;
import
com.gingersoft.gsa.cloud.common.utils.VibratorUtils
;
...
@@ -593,6 +594,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
...
@@ -593,6 +594,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
showMessage
(
"此食品不能參與折扣!"
);
showMessage
(
"此食品不能參與折扣!"
);
return
;
return
;
}
}
LoganManager
.
w_tableMode
(
TAG
,
LoganManager
.
EVENT_CLICK
+
"食品折扣"
);
//更新折扣数据
//更新折扣数据
mPresenter
.
loadDiscountData
();
mPresenter
.
loadDiscountData
();
...
@@ -604,6 +606,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
...
@@ -604,6 +606,7 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
if
(
BaseOrder
.
isCurrentOrderType
(
FoodSummaryConstans
.
TAKEAWAY_TYPE
))
{
if
(
BaseOrder
.
isCurrentOrderType
(
FoodSummaryConstans
.
TAKEAWAY_TYPE
))
{
return
;
return
;
}
}
LoganManager
.
w_tableMode
(
TAG
,
LoganManager
.
EVENT_CLICK
+
"餐檯名稱"
);
//type取值:1:qrCdoetype,2:手機號,3:memberId
//type取值:1:qrCdoetype,2:手機號,3:memberId
if
(
mUseMemberDialog
==
null
)
{
if
(
mUseMemberDialog
==
null
)
{
mUseMemberDialog
=
new
UseMemberDialog
(
this
)
mUseMemberDialog
=
new
UseMemberDialog
(
this
)
...
@@ -703,11 +706,13 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
...
@@ -703,11 +706,13 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
@OnClick
(
R2
.
id
.
btn_select_all
)
@OnClick
(
R2
.
id
.
btn_select_all
)
void
onClickSelectAll
()
{
void
onClickSelectAll
()
{
LoganManager
.
w_tableMode
(
TAG
,
"全選食品"
);
mPresenter
.
setSelectAll
();
mPresenter
.
setSelectAll
();
}
}
@OnClick
(
R2
.
id
.
btn_anti_selection
)
@OnClick
(
R2
.
id
.
btn_anti_selection
)
void
onClickAntiSelection
()
{
void
onClickAntiSelection
()
{
LoganManager
.
w_tableMode
(
TAG
,
"反選食品"
);
mPresenter
.
setAntiSelect
();
mPresenter
.
setAntiSelect
();
}
}
...
@@ -716,6 +721,10 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
...
@@ -716,6 +721,10 @@ public class MealStandActivity extends BaseFragmentActivity<MealStandPresenter>
R2
.
id
.
btn_taste
,
R2
.
id
.
btn_msg
,
R2
.
id
.
btn_delete
,
R2
.
id
.
btn_end
,
R2
.
id
.
iv_fine_back
})
R2
.
id
.
btn_taste
,
R2
.
id
.
btn_msg
,
R2
.
id
.
btn_delete
,
R2
.
id
.
btn_end
,
R2
.
id
.
iv_fine_back
})
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
LoganManager
.
w_tableMode
(
TAG
,
LoganManager
.
EVENT_CLICK
,
v
.
getTransitionName
());
}
recordOperat
(
true
);
recordOperat
(
true
);
//防抖處理
//防抖處理
...
...
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/OrderPayActivity.java
View file @
ef2056da
...
@@ -181,6 +181,7 @@ public class OrderPayActivity extends BaseActivity<OrderPayPresenter> implements
...
@@ -181,6 +181,7 @@ public class OrderPayActivity extends BaseActivity<OrderPayPresenter> implements
gsaPayView
.
setOnSelectPayClickLisenter
(
new
OrderPayView
.
OnSelectPayClickLisenter
()
{
gsaPayView
.
setOnSelectPayClickLisenter
(
new
OrderPayView
.
OnSelectPayClickLisenter
()
{
@Override
@Override
public
void
addClick
(
PayMethod
method
)
{
public
void
addClick
(
PayMethod
method
)
{
LoganManager
.
w_pay
(
TAG
,
LoganManager
.
EVENT_ADD
,
"支付方式="
+
method
.
getPayName
());
if
(
method
.
getPayType
()
==
PayMethod
.
PAY_TYPE_INTEGRAL
)
{
if
(
method
.
getPayType
()
==
PayMethod
.
PAY_TYPE_INTEGRAL
)
{
updateMemberInfo
();
updateMemberInfo
();
}
}
...
@@ -188,6 +189,7 @@ public class OrderPayActivity extends BaseActivity<OrderPayPresenter> implements
...
@@ -188,6 +189,7 @@ public class OrderPayActivity extends BaseActivity<OrderPayPresenter> implements
@Override
@Override
public
void
delClick
(
PayMethod
method
)
{
public
void
delClick
(
PayMethod
method
)
{
LoganManager
.
w_pay
(
TAG
,
LoganManager
.
EVENT_DELETE
,
"支付方式="
+
method
.
getPayName
());
if
(
method
.
getPayType
()
==
PayMethod
.
PAY_TYPE_INTEGRAL
)
{
if
(
method
.
getPayType
()
==
PayMethod
.
PAY_TYPE_INTEGRAL
)
{
updateMemberInfo
();
updateMemberInfo
();
}
}
...
@@ -201,6 +203,7 @@ public class OrderPayActivity extends BaseActivity<OrderPayPresenter> implements
...
@@ -201,6 +203,7 @@ public class OrderPayActivity extends BaseActivity<OrderPayPresenter> implements
gsaPayView
.
setOnFreeServiceStatusChangeLisenter
(
new
OrderPayView
.
OnFreeServiceStatusChangeLisenter
()
{
gsaPayView
.
setOnFreeServiceStatusChangeLisenter
(
new
OrderPayView
.
OnFreeServiceStatusChangeLisenter
()
{
@Override
@Override
public
void
onFreeServiceStautsChange
(
boolean
isUseFreeServicePayMethod
)
{
public
void
onFreeServiceStautsChange
(
boolean
isUseFreeServicePayMethod
)
{
LoganManager
.
w_pay
(
TAG
,
"是否選中免服務費支付方式="
+
isUseFreeServicePayMethod
);
mPresenter
.
setFreeServiceStauts
(
isUseFreeServicePayMethod
);
mPresenter
.
setFreeServiceStauts
(
isUseFreeServicePayMethod
);
}
}
});
});
...
@@ -234,6 +237,8 @@ public class OrderPayActivity extends BaseActivity<OrderPayPresenter> implements
...
@@ -234,6 +237,8 @@ public class OrderPayActivity extends BaseActivity<OrderPayPresenter> implements
double
wholeAmount
=
mPresenter
.
getFoodTotal
();
double
wholeAmount
=
mPresenter
.
getFoodTotal
();
tv_whole
.
setText
(
"合計 $"
+
wholeAmount
);
tv_whole
.
setText
(
"合計 $"
+
wholeAmount
);
LoganManager
.
w_pay
(
TAG
,
"合計金額="
+
wholeAmount
);
DoshokuOrder
.
getInstance
().
getShoppingCart
().
setWholeAmount
(
wholeAmount
);
DoshokuOrder
.
getInstance
().
getShoppingCart
().
setWholeAmount
(
wholeAmount
);
}
}
...
@@ -397,7 +402,6 @@ public class OrderPayActivity extends BaseActivity<OrderPayPresenter> implements
...
@@ -397,7 +402,6 @@ public class OrderPayActivity extends BaseActivity<OrderPayPresenter> implements
public
void
onClick
(
QMUIDialog
dialog
,
int
index
)
{
public
void
onClick
(
QMUIDialog
dialog
,
int
index
)
{
dialog
.
dismiss
();
dialog
.
dismiss
();
recordOperat
(
true
);
recordOperat
(
true
);
}
}
});
});
}
}
...
@@ -410,7 +414,6 @@ public class OrderPayActivity extends BaseActivity<OrderPayPresenter> implements
...
@@ -410,7 +414,6 @@ public class OrderPayActivity extends BaseActivity<OrderPayPresenter> implements
public
void
onClick
(
QMUIDialog
dialog
,
int
index
)
{
public
void
onClick
(
QMUIDialog
dialog
,
int
index
)
{
dialog
.
dismiss
();
dialog
.
dismiss
();
recordOperat
(
true
);
recordOperat
(
true
);
}
}
});
});
dialogBuilder
.
create
(
R
.
style
.
QMUI_Dialog
).
show
();
dialogBuilder
.
create
(
R
.
style
.
QMUI_Dialog
).
show
();
...
@@ -466,7 +469,7 @@ public class OrderPayActivity extends BaseActivity<OrderPayPresenter> implements
...
@@ -466,7 +469,7 @@ public class OrderPayActivity extends BaseActivity<OrderPayPresenter> implements
.
callAsyncCallbackOnMainThread
(
new
IComponentCallback
()
{
.
callAsyncCallbackOnMainThread
(
new
IComponentCallback
()
{
@Override
@Override
public
void
onResult
(
CC
cc
,
CCResult
result
)
{
public
void
onResult
(
CC
cc
,
CCResult
result
)
{
LoganManager
.
w_
tableMode
(
TAG
,
"printOpenInstructionAndBill "
+
"是否成功
:"
+
result
.
isSuccess
());
LoganManager
.
w_
pay
(
TAG
,
"開錢箱結果
:"
+
result
.
isSuccess
());
mAppManager
.
killActivity
(
"PrintActivity"
);
mAppManager
.
killActivity
(
"PrintActivity"
);
}
}
});
});
...
@@ -495,7 +498,7 @@ public class OrderPayActivity extends BaseActivity<OrderPayPresenter> implements
...
@@ -495,7 +498,7 @@ public class OrderPayActivity extends BaseActivity<OrderPayPresenter> implements
.
callAsyncCallbackOnMainThread
(
new
IComponentCallback
()
{
.
callAsyncCallbackOnMainThread
(
new
IComponentCallback
()
{
@Override
@Override
public
void
onResult
(
CC
cc
,
CCResult
result
)
{
public
void
onResult
(
CC
cc
,
CCResult
result
)
{
LoganManager
.
w_
tableMode
(
TAG
,
"printBill "
+
"是否成功打印
:"
+
result
.
isSuccess
());
LoganManager
.
w_
pay
(
TAG
,
"結賬單打印結果
:"
+
result
.
isSuccess
());
printEndBack
();
printEndBack
();
}
}
});
});
...
...
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/TableActivity.java
View file @
ef2056da
...
@@ -224,7 +224,6 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
...
@@ -224,7 +224,6 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
rightButton2
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
rightButton2
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
LoganManager
.
w_tableMode
(
TAG
,
"跳轉數據下載頁"
);
CC
.
obtainBuilder
(
ComponentName
.
COMPONENT_DOWNLOAD
)
CC
.
obtainBuilder
(
ComponentName
.
COMPONENT_DOWNLOAD
)
.
setActionName
(
"showDownloadActivity"
)
.
setActionName
(
"showDownloadActivity"
)
.
addParam
(
"fromPage"
,
2
)
.
addParam
(
"fromPage"
,
2
)
...
@@ -321,11 +320,11 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
...
@@ -321,11 +320,11 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
public
void
longClickSkyorder
()
{
public
void
longClickSkyorder
()
{
boolean
state
=
mPresenter
.
setSkyorderMode
();
boolean
state
=
mPresenter
.
setSkyorderMode
();
if
(
state
)
{
if
(
state
)
{
LoganManager
.
w_tableMode
(
TAG
,
"長按
鎖定Skyorder模式"
);
LoganManager
.
w_tableMode
(
TAG
,
LoganManager
.
EVENT_LONG_CLICK
,
"
鎖定Skyorder模式"
);
mTopBar
.
setTitle
(
"打印skyorder"
);
mTopBar
.
setTitle
(
"打印skyorder"
);
mPresenter
.
openSkyorderMode
();
mPresenter
.
openSkyorderMode
();
}
else
{
}
else
{
LoganManager
.
w_tableMode
(
TAG
,
"長按
解鎖Skyorder模式"
);
LoganManager
.
w_tableMode
(
TAG
,
LoganManager
.
EVENT_LONG_CLICK
,
"
解鎖Skyorder模式"
);
canceTableAction
();
canceTableAction
();
}
}
setLockVisibility
(
state
);
setLockVisibility
(
state
);
...
@@ -334,7 +333,7 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
...
@@ -334,7 +333,7 @@ public class TableActivity extends BaseFragmentActivity<TablePresenter> implemen
@OnClick
(
R2
.
id
.
rl_skyorder
)
@OnClick
(
R2
.
id
.
rl_skyorder
)
public
void
clickSkyorder
()
{
public
void
clickSkyorder
()
{
LoganManager
.
w_tableMode
(
TAG
,
"點擊Skyorder按鈕
"
);
LoganManager
.
w_tableMode
(
TAG
,
LoganManager
.
EVENT_CLICK
,
"Skyorder
"
);
TableAction
tableAction
=
mPresenter
.
getTableActionByClass
(
PrintSkyorderAction
.
class
);
TableAction
tableAction
=
mPresenter
.
getTableActionByClass
(
PrintSkyorderAction
.
class
);
if
(
tableAction
!=
null
)
{
if
(
tableAction
!=
null
)
{
mPresenter
.
setTableAction
(
tableAction
);
mPresenter
.
setTableAction
(
tableAction
);
...
...
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/orderManager/OrderCenterActivity.java
View file @
ef2056da
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
ui
.
activity
.
orderManager
;
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
ui
.
activity
.
orderManager
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Message
;
import
android.os.Message
;
import
android.view.View
;
import
android.view.View
;
...
@@ -15,6 +16,7 @@ import androidx.core.content.ContextCompat;
...
@@ -15,6 +16,7 @@ import androidx.core.content.ContextCompat;
import
androidx.fragment.app.Fragment
;
import
androidx.fragment.app.Fragment
;
import
androidx.viewpager.widget.ViewPager
;
import
androidx.viewpager.widget.ViewPager
;
import
com.gingersoft.gsa.cloud.common.logan.LoganManager
;
import
com.gingersoft.gsa.cloud.order.contract.OrderStatusContract
;
import
com.gingersoft.gsa.cloud.order.contract.OrderStatusContract
;
import
com.gingersoft.gsa.cloud.pay.pos.fragment.PosActionStatusExceptionFragment
;
import
com.gingersoft.gsa.cloud.pay.pos.fragment.PosActionStatusExceptionFragment
;
import
com.gingersoft.gsa.cloud.table.R
;
import
com.gingersoft.gsa.cloud.table.R
;
...
@@ -144,6 +146,10 @@ public class OrderCenterActivity extends BaseFragmentActivity<OrderCenterPresent
...
@@ -144,6 +146,10 @@ public class OrderCenterActivity extends BaseFragmentActivity<OrderCenterPresent
@OnClick
({
R2
.
id
.
btn_print_order
,
R2
.
id
.
btn_modify_order
,
R2
.
id
.
btn_tips
,
R2
.
id
.
btn_cancel_order
,
R2
.
id
.
btn_refund
})
@OnClick
({
R2
.
id
.
btn_print_order
,
R2
.
id
.
btn_modify_order
,
R2
.
id
.
btn_tips
,
R2
.
id
.
btn_cancel_order
,
R2
.
id
.
btn_refund
})
public
void
OnClick
(
View
v
)
{
public
void
OnClick
(
View
v
)
{
OrderManagerResponse
orderItem
=
getCurrentOrderFragment
().
getCheckedOrderBean
();
OrderManagerResponse
orderItem
=
getCurrentOrderFragment
().
getCheckedOrderBean
();
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
LoganManager
.
w_order
(
TAG
,
LoganManager
.
EVENT_CLICK
,
"按鈕:"
+
v
.
getTransitionName
());
}
LoganManager
.
w_order
(
TAG
,
LoganManager
.
EVENT_CLICK
,
"操作訂單:"
+
orderItem
.
getOrderNo
());
if
(
orderItem
!=
null
)
{
if
(
orderItem
!=
null
)
{
int
id
=
v
.
getId
();
int
id
=
v
.
getId
();
if
(
id
==
R
.
id
.
btn_print_order
)
{
if
(
id
==
R
.
id
.
btn_print_order
)
{
...
...
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/orderManager/OrderDetailActivity.java
View file @
ef2056da
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
ui
.
activity
.
orderManager
;
package
com
.
gingersoft
.
gsa
.
cloud
.
table
.
mvp
.
ui
.
activity
.
orderManager
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
android.util.Log
;
...
@@ -217,6 +218,9 @@ public class OrderDetailActivity extends BaseFragmentActivity<OrderDetailPresent
...
@@ -217,6 +218,9 @@ public class OrderDetailActivity extends BaseFragmentActivity<OrderDetailPresent
@OnClick
({
R2
.
id
.
btn_print_order
,
R2
.
id
.
btn_cancel_order
,
R2
.
id
.
btn_modify_order
,
R2
.
id
.
btn_tips
,
R2
.
id
.
btn_refund
})
@OnClick
({
R2
.
id
.
btn_print_order
,
R2
.
id
.
btn_cancel_order
,
R2
.
id
.
btn_modify_order
,
R2
.
id
.
btn_tips
,
R2
.
id
.
btn_refund
})
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
LoganManager
.
w_order
(
TAG
,
LoganManager
.
EVENT_CLICK
,
"按鈕:"
+
v
.
getTransitionName
());
}
int
id
=
v
.
getId
();
int
id
=
v
.
getId
();
if
(
id
==
R
.
id
.
btn_print_order
)
{
if
(
id
==
R
.
id
.
btn_print_order
)
{
mPresenter
.
printOrder
(
this
,
mOrderDetailItem
);
mPresenter
.
printOrder
(
this
,
mOrderDetailItem
);
...
...
component-table/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/widget/CancelFoodDialog.java
View file @
ef2056da
...
@@ -21,6 +21,7 @@ import com.google.android.flexbox.FlexWrap;
...
@@ -21,6 +21,7 @@ import com.google.android.flexbox.FlexWrap;
import
com.google.android.flexbox.FlexboxLayoutManager
;
import
com.google.android.flexbox.FlexboxLayoutManager
;
import
com.google.android.flexbox.JustifyContent
;
import
com.google.android.flexbox.JustifyContent
;
import
com.google.android.material.slider.Slider
;
import
com.google.android.material.slider.Slider
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.qmuiteam.qmui.layout.QMUILinearLayout
;
import
com.qmuiteam.qmui.layout.QMUILinearLayout
;
import
com.qmuiteam.qmui.util.QMUIDisplayHelper
;
import
com.qmuiteam.qmui.util.QMUIDisplayHelper
;
import
com.qmuiteam.qmui.widget.QMUIEmptyView
;
import
com.qmuiteam.qmui.widget.QMUIEmptyView
;
...
@@ -148,6 +149,7 @@ public class CancelFoodDialog extends BaseRetryDialog implements Slider.OnSlider
...
@@ -148,6 +149,7 @@ public class CancelFoodDialog extends BaseRetryDialog implements Slider.OnSlider
btn_all_number
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
btn_all_number
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
mCurrCancelNumber
=
mMaxCancelNumber
;
slider_food_count
.
setValue
(
mMaxCancelNumber
);
slider_food_count
.
setValue
(
mMaxCancelNumber
);
}
}
});
});
...
@@ -161,7 +163,7 @@ public class CancelFoodDialog extends BaseRetryDialog implements Slider.OnSlider
...
@@ -161,7 +163,7 @@ public class CancelFoodDialog extends BaseRetryDialog implements Slider.OnSlider
public
void
initParmas
()
{
public
void
initParmas
()
{
mCurrCancelNumber
=
1
;
mCurrCancelNumber
=
1
;
tv_number_value
.
setText
(
String
.
valueOf
(
mCurrCancelNumber
));
tv_number_value
.
setText
(
String
.
valueOf
(
mCurrCancelNumber
));
slider_food_count
.
setValueFrom
(
mCurrCancelNumber
);
slider_food_count
.
setValueFrom
(
0
);
slider_food_count
.
setValueTo
(
mMaxCancelNumber
);
slider_food_count
.
setValueTo
(
mMaxCancelNumber
);
slider_food_count
.
setValue
(
mCurrCancelNumber
);
slider_food_count
.
setValue
(
mCurrCancelNumber
);
}
}
...
@@ -176,6 +178,10 @@ public class CancelFoodDialog extends BaseRetryDialog implements Slider.OnSlider
...
@@ -176,6 +178,10 @@ public class CancelFoodDialog extends BaseRetryDialog implements Slider.OnSlider
mAdapter
=
new
FoodReasonAdapter
(
mItems
);
mAdapter
=
new
FoodReasonAdapter
(
mItems
);
}
}
mAdapter
.
setOnItemClickListener
((
adapter
,
view
,
position
)
->
{
mAdapter
.
setOnItemClickListener
((
adapter
,
view
,
position
)
->
{
if
(
mCurrCancelNumber
==
0
)
{
ArmsUtils
.
makeText
(
mContext
,
"請選擇取消數量"
);
return
;
}
if
(
onClickListener
!=
null
)
{
if
(
onClickListener
!=
null
)
{
onClickListener
.
onItemClick
(
mItems
.
get
(
position
),
position
,
getInputNumber
());
onClickListener
.
onItemClick
(
mItems
.
get
(
position
),
position
,
getInputNumber
());
}
}
...
@@ -225,13 +231,12 @@ public class CancelFoodDialog extends BaseRetryDialog implements Slider.OnSlider
...
@@ -225,13 +231,12 @@ public class CancelFoodDialog extends BaseRetryDialog implements Slider.OnSlider
@Override
@Override
public
void
onStartTrackingTouch
(
@NonNull
Slider
slider
)
{
public
void
onStartTrackingTouch
(
@NonNull
Slider
slider
)
{
mCurrCancelNumber
=
1
;
tv_number_value
.
setText
(
String
.
valueOf
(
slider
.
getValue
()));
}
}
@Override
@Override
public
void
onStopTrackingTouch
(
@NonNull
Slider
slider
)
{
public
void
onStopTrackingTouch
(
@NonNull
Slider
slider
)
{
mCurrCancelNumber
=
(
int
)
slider
.
getValue
();
tv_number_value
.
setText
(
String
.
valueOf
(
mCurrCancelNumber
));
}
}
public
interface
OnClickListener
{
public
interface
OnClickListener
{
...
...
component-table/src/main/res/layout/table_dialog_cancel_food.xml
View file @
ef2056da
...
@@ -69,19 +69,14 @@
...
@@ -69,19 +69,14 @@
android:layout_margin=
"@dimen/dp_8"
android:layout_margin=
"@dimen/dp_8"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<!-- <com.google.android.material.slider.Slider-->
<!-- android:id="@+id/slider_food_count"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- app:qmui_slider_bar_progress_color="@color/theme_color" />-->
<com.google.android.material.slider.Slider
<com.google.android.material.slider.Slider
android:id=
"@+id/slider_food_count"
android:id=
"@+id/slider_food_count"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:theme=
"@style/
ThemeOverlay.PrimaryPalette.Red
"
android:theme=
"@style/
SliderStyle
"
android:valueFrom=
"0"
android:valueFrom=
"0"
android:valueTo=
"11"
android:valueTo=
"11"
android:value=
"1"
android:stepSize=
"1"
/>
android:stepSize=
"1"
/>
<TextView
<TextView
...
...
component-table/src/main/res/values/styles.xml
View file @
ef2056da
...
@@ -8,8 +8,8 @@
...
@@ -8,8 +8,8 @@
<item
name=
"colorAccent"
>
@color/table_colorAccent
</item>
<item
name=
"colorAccent"
>
@color/table_colorAccent
</item>
</style>
</style>
<style
name=
"ThemeOverlay.PrimaryPalette.Red"
parent=
""
>
<!-- <style name="ThemeOverlay.PrimaryPalette.Red" parent="">--
>
<item
name=
"colorPrimary"
>
#e53935
</item
>
<!-- <item name="colorPrimary">#e53935</item>--
>
<item
name=
"colorPrimaryDark"
>
#ab000d
</item
>
<!-- <item name="colorPrimaryDark">#ab000d</item>--
>
</style
>
<!-- </style>--
>
</resources>
</resources>
library-common/src/main/java/com/gingersoft/gsa/cloud/common/logan/LoganManager.java
View file @
ef2056da
...
@@ -68,31 +68,52 @@ public class LoganManager {
...
@@ -68,31 +68,52 @@ public class LoganManager {
private
static
final
String
ORDER_BUSINESS_TAG
=
"order-> "
;
private
static
final
String
ORDER_BUSINESS_TAG
=
"order-> "
;
private
static
final
String
PAY_BUSINESS_TAG
=
"pay-> "
;
private
static
final
String
PAY_BUSINESS_TAG
=
"pay-> "
;
public
static
void
w_database
(
String
TAG
,
String
log
)
{
/*******************************交互事件類型**************************************/
Logan
.
w
(
DATABASE_BUSINESS_TAG
+
log
,
LoganConfig
.
CODE_LEVLE
);
public
static
final
String
EVENT_CLICK
=
"點擊->"
;
if
(
BuildConfig
.
DEBUG
)
{
public
static
final
String
EVENT_LONG_CLICK
=
"長按->"
;
printLog
(
TAG
,
log
);
public
static
final
String
EVENT_TOUCH
=
"觸摸->"
;
}
public
static
final
String
EVENT_SCOLL
=
"滑動->"
;
public
static
final
String
EVENT_RETRY
=
"重試加載->"
;
public
static
final
String
EVENT_PULL_DOWN
=
"下拉刷新->"
;
public
static
final
String
EVENT_PULL_UP
=
"上拉加載->"
;
/*******************************業務事件類型**************************************/
public
static
final
String
EVENT_CALCULATE
=
"計算->"
;
public
static
final
String
EVENT_ADD
=
"添加->"
;
public
static
final
String
EVENT_DELETE
=
"刪除->"
;
public
static
final
String
EVENT_MODIFY
=
"修改->"
;
public
static
final
String
EVENT_QUERY
=
"查詢->"
;
public
static
void
w_database
(
String
TAG
,
String
...
eventAndLog
)
{
w_business
(
DATABASE_BUSINESS_TAG
,
TAG
,
eventAndLog
);
}
}
public
static
void
w_printer
(
String
TAG
,
String
log
)
{
public
static
void
w_printer
(
String
TAG
,
String
...
eventAndLog
)
{
Logan
.
w
(
PRINTER_BUSINESS_TAG
+
log
,
LoganConfig
.
CODE_LEVLE
);
w_business
(
PRINTER_BUSINESS_TAG
,
TAG
,
eventAndLog
);
printLog
(
TAG
,
log
);
}
}
public
static
void
w_tableMode
(
String
TAG
,
String
log
)
{
public
static
void
w_tableMode
(
String
TAG
,
String
...
eventAndLog
)
{
Logan
.
w
(
TABLEMODE_BUSINESS_TAG
+
log
,
LoganConfig
.
CODE_LEVLE
);
w_business
(
TABLEMODE_BUSINESS_TAG
,
TAG
,
eventAndLog
);
printLog
(
TAG
,
log
);
}
}
public
static
void
w_order
(
String
TAG
,
String
log
)
{
public
static
void
w_order
(
String
TAG
,
String
...
eventAndLog
)
{
Logan
.
w
(
ORDER_BUSINESS_TAG
+
log
,
LoganConfig
.
CODE_LEVLE
);
w_business
(
ORDER_BUSINESS_TAG
,
TAG
,
eventAndLog
);
printLog
(
TAG
,
log
);
}
}
public
static
void
w_pay
(
String
TAG
,
String
log
)
{
public
static
void
w_pay
(
String
TAG
,
String
...
eventAndLog
)
{
Logan
.
w
(
PAY_BUSINESS_TAG
+
log
,
LoganConfig
.
CODE_LEVLE
);
w_business
(
PAY_BUSINESS_TAG
,
TAG
,
eventAndLog
);
printLog
(
TAG
,
log
);
}
private
static
void
w_business
(
String
BUSINESS_TAG
,
String
TAG
,
String
...
eventAndLog
)
{
if
(
eventAndLog
!=
null
)
{
if
(
eventAndLog
.
length
>
1
)
{
Logan
.
w
(
BUSINESS_TAG
+
eventAndLog
[
0
]
+
eventAndLog
[
1
],
LoganConfig
.
CODE_LEVLE
);
printLog
(
TAG
,
eventAndLog
[
0
]
+
eventAndLog
[
1
]);
}
else
{
Logan
.
w
(
BUSINESS_TAG
+
eventAndLog
[
0
],
LoganConfig
.
CODE_LEVLE
);
printLog
(
TAG
,
eventAndLog
[
0
]);
}
}
}
}
private
static
void
printLog
(
String
TAG
,
String
log
)
{
private
static
void
printLog
(
String
TAG
,
String
log
)
{
...
...
library-common/src/main/res/values-v21/styles.xml
View file @
ef2056da
...
@@ -12,4 +12,10 @@
...
@@ -12,4 +12,10 @@
<item
name=
"android:colorControlNormal"
>
@color/theme_color
</item>
<item
name=
"android:colorControlNormal"
>
@color/theme_color
</item>
<item
name=
"android:colorControlActivated"
>
@color/color_c9
</item>
<item
name=
"android:colorControlActivated"
>
@color/color_c9
</item>
</style>
</style>
<style
name=
"SliderStyle"
parent=
"Theme.MaterialComponents.NoActionBar"
>
<item
name=
"colorPrimary"
>
@color/colorPrimary
</item>
<item
name=
"colorPrimaryDark"
>
@color/colorPrimaryDark
</item>
</style>
</resources>
</resources>
\ No newline at end of file
library-common/src/main/res/values-v21/styles.xml~
deleted
100644 → 0
View file @
2194c6e3
File deleted
library-common/src/main/res/values/styles.xml
View file @
ef2056da
...
@@ -14,11 +14,6 @@
...
@@ -14,11 +14,6 @@
<item
name=
"android:backgroundDimEnabled"
>
true
</item>
<!--背景遮罩效果-->
<item
name=
"android:backgroundDimEnabled"
>
true
</item>
<!--背景遮罩效果-->
</style>
</style>
<!-- <style name="AppTheme" parent="PublicTheme">-->
<!-- <item name="QMUITopBarStyle">@style/QDTopBar</item>-->
<!-- <item name="QMUITabSegmentStyle">@style/QMUITabSegmentStyle</item>-->
<!-- </style>-->
<style
name=
"PublicTheme"
parent=
"QMUI.Compat.NoActionBar"
>
<style
name=
"PublicTheme"
parent=
"QMUI.Compat.NoActionBar"
>
...
@@ -151,17 +146,16 @@
...
@@ -151,17 +146,16 @@
<style
name=
"QMUITabSegmentStyle"
parent=
"QMUI.TabSegment"
>
<style
name=
"QMUITabSegmentStyle"
parent=
"QMUI.TabSegment"
>
<item
name=
"qmui_skin_support_tab_bg"
>
@color/qmui_config_color_white
</item>
<item
name=
"qmui_skin_support_tab_bg"
>
@color/qmui_config_color_white
</item>
<item
name=
"qmui_skin_support_tab_separator_color"
>
?attr/qmui_skin_support_color_separator
<item
name=
"qmui_skin_support_tab_separator_color"
>
?attr/qmui_skin_support_color_separator
</item>
</item>
<item
name=
"qmui_skin_support_tab_normal_color"
>
@color/normal_color
</item>
<item
name=
"qmui_skin_support_tab_normal_color"
>
@color/normal_color
</item>
<item
name=
"qmui_skin_support_tab_selected_color"
>
@color/theme_color
</item>
<item
name=
"qmui_skin_support_tab_selected_color"
>
@color/theme_color
</item>
<item
name=
"qmui_skin_support_tab_sign_count_view_text_color"
>
<item
name=
"qmui_skin_support_tab_sign_count_view_text_color"
>
@color/qmui_config_color_white
</item>
@color/qmui_config_color_white
<item
name=
"qmui_skin_support_tab_sign_count_view_bg_color"
>
?attr/qmui_config_color_red
</item>
</item>
<item
name=
"qmui_skin_support_tab_sign_count_view_bg_color"
>
?attr/qmui_config_color_red
</item>
</style>
</style>
<attr
name=
"MaterialComponentsStyle"
format=
"reference"
/>
<style
name=
"MaterialComponentsStyle"
parent=
"Widget.MaterialComponents.Slider"
/>
<style
name=
"QDRoundButtonStyle"
parent=
"@style/Button.Compat"
>
<style
name=
"QDRoundButtonStyle"
parent=
"@style/Button.Compat"
>
<item
name=
"android:layout_height"
>
40dp
</item>
<item
name=
"android:layout_height"
>
40dp
</item>
<item
name=
"android:layout_width"
>
wrap_content
</item>
<item
name=
"android:layout_width"
>
wrap_content
</item>
...
...
library-ui/src/main/java/com/gingersoft/gsa/cloud/ui/view/OrderPayView.java
View file @
ef2056da
...
@@ -12,6 +12,7 @@ import androidx.annotation.Nullable;
...
@@ -12,6 +12,7 @@ import androidx.annotation.Nullable;
import
com.gingersoft.gsa.cloud.app.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.app.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.common.core.member.MemberInfo
;
import
com.gingersoft.gsa.cloud.common.core.member.MemberInfo
;
import
com.gingersoft.gsa.cloud.common.logan.LoganManager
;
import
com.gingersoft.gsa.cloud.common.utils.LanguageUtils
;
import
com.gingersoft.gsa.cloud.common.utils.LanguageUtils
;
import
com.gingersoft.gsa.cloud.common.utils.MoneyUtil
;
import
com.gingersoft.gsa.cloud.common.utils.MoneyUtil
;
import
com.gingersoft.gsa.cloud.common.utils.VibratorUtils
;
import
com.gingersoft.gsa.cloud.common.utils.VibratorUtils
;
...
@@ -31,6 +32,7 @@ import java.util.List;
...
@@ -31,6 +32,7 @@ import java.util.List;
public
class
OrderPayView
extends
LinearLayout
{
public
class
OrderPayView
extends
LinearLayout
{
private
final
String
TAG
=
this
.
getClass
().
getSimpleName
();
private
Context
mContext
;
private
Context
mContext
;
/**
/**
...
@@ -217,6 +219,7 @@ public class OrderPayView extends LinearLayout {
...
@@ -217,6 +219,7 @@ public class OrderPayView extends LinearLayout {
@Override
@Override
public
void
onItemClick
(
PayMethod
datasBean
,
int
position
)
{
public
void
onItemClick
(
PayMethod
datasBean
,
int
position
)
{
LoganManager
.
w_pay
(
TAG
,
LoganManager
.
EVENT_CLICK
,
"支付方式="
+
datasBean
.
getPayName
());
recordOperat
(
context
);
recordOperat
(
context
);
mBillMoneyAdapter
.
setSelect_position
(
position
);
mBillMoneyAdapter
.
setSelect_position
(
position
);
mBillMoneyAdapter
.
notifyDataSetChanged
();
mBillMoneyAdapter
.
notifyDataSetChanged
();
...
@@ -246,6 +249,7 @@ public class OrderPayView extends LinearLayout {
...
@@ -246,6 +249,7 @@ public class OrderPayView extends LinearLayout {
//Exact
//Exact
view
.
findViewById
(
R
.
id
.
btn_exact
).
setOnClickListener
(
v
->
{
view
.
findViewById
(
R
.
id
.
btn_exact
).
setOnClickListener
(
v
->
{
LoganManager
.
w_pay
(
TAG
,
LoganManager
.
EVENT_CLICK
,
"Exact"
);
PayMethod
selectPayMethod
=
getSelectBillMoney
();
PayMethod
selectPayMethod
=
getSelectBillMoney
();
if
(
selectPayMethod
==
null
)
{
if
(
selectPayMethod
==
null
)
{
ToastUtils
.
show
(
context
,
"請選擇支付方式"
);
ToastUtils
.
show
(
context
,
"請選擇支付方式"
);
...
@@ -260,6 +264,7 @@ public class OrderPayView extends LinearLayout {
...
@@ -260,6 +264,7 @@ public class OrderPayView extends LinearLayout {
//sure
//sure
view
.
findViewById
(
R
.
id
.
btn_sure_pay
).
setOnClickListener
(
v
->
{
view
.
findViewById
(
R
.
id
.
btn_sure_pay
).
setOnClickListener
(
v
->
{
LoganManager
.
w_pay
(
TAG
,
LoganManager
.
EVENT_CLICK
,
"確認支付"
);
if
(
mBillMoneyList
.
size
()
==
0
)
{
if
(
mBillMoneyList
.
size
()
==
0
)
{
ToastUtils
.
show
(
context
,
"請選擇支付方式"
);
ToastUtils
.
show
(
context
,
"請選擇支付方式"
);
return
;
return
;
...
@@ -275,6 +280,7 @@ public class OrderPayView extends LinearLayout {
...
@@ -275,6 +280,7 @@ public class OrderPayView extends LinearLayout {
//Keypad
//Keypad
view
.
findViewById
(
R
.
id
.
layout_keypad
).
setOnClickListener
(
v
->
{
view
.
findViewById
(
R
.
id
.
layout_keypad
).
setOnClickListener
(
v
->
{
LoganManager
.
w_pay
(
TAG
,
LoganManager
.
EVENT_CLICK
,
"Keypad"
);
PayMethod
payMethod
=
getSelectBillMoney
();
PayMethod
payMethod
=
getSelectBillMoney
();
if
(
payMethod
==
null
)
{
if
(
payMethod
==
null
)
{
ToastUtils
.
show
(
context
,
"請選擇支付方式"
);
ToastUtils
.
show
(
context
,
"請選擇支付方式"
);
...
@@ -625,7 +631,7 @@ public class OrderPayView extends LinearLayout {
...
@@ -625,7 +631,7 @@ public class OrderPayView extends LinearLayout {
public
void
makeUpDifference
()
{
public
void
makeUpDifference
()
{
//補齊差價
//補齊差價
double
difference
=
getDifferenceMoney
();
double
difference
=
getDifferenceMoney
();
if
(
difference
>
0
)
{
if
(
difference
>
0
)
{
method
.
setPayMoney
(
difference
);
method
.
setPayMoney
(
difference
);
mBillMoneyAdapter
.
notifyDataSetChanged
();
mBillMoneyAdapter
.
notifyDataSetChanged
();
setDifferenceText
(
context
);
setDifferenceText
(
context
);
...
...
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