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
e209e25a
Commit
e209e25a
authored
Nov 10, 2020
by
Wyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、外送自動接單 2、外送自取、預約單自動接單
Signed-off-by: Wyh <1239658231>
parent
c6a57b39
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
185 additions
and
73 deletions
+185
-73
base-module/build.gradle
+0
-1
base-module/src/main/java/com/gingersoft/gsa/cloud/config/globalconfig/applyOptions/intercept/LoggingInterceptor.java
+1
-1
base-module/src/main/java/com/gingersoft/gsa/cloud/constans/ExpandConstant.java
+4
-1
base-module/src/main/java/com/gingersoft/gsa/cloud/constans/FoodSummaryConstans.java
+1
-1
coldchain-module/src/main/java/com/gingersoft/coldchain_module/mvp/ui/activity/ColdChainMainActivity.java
+1
-1
config.gradle
+3
-2
delivery_pick_module/src/main/java/com/gingersoft/gsa/delivery_pick_mode/data/network/ServiceCreator.kt
+1
-2
delivery_pick_module/src/main/java/com/gingersoft/gsa/delivery_pick_mode/model/viewModel/PageViewModel.kt
+108
-38
delivery_pick_module/src/main/java/com/gingersoft/gsa/delivery_pick_mode/mvp/presenter/SendOrderPresenter.java
+1
-1
delivery_pick_module/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/activity/DeliveryOrderMainActivity.kt
+50
-21
delivery_pick_module/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/activity/OrderDetailsActivity.kt
+1
-1
delivery_pick_module/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/fragment/PlaceholderFragment.kt
+0
-1
delivery_pick_module/src/main/res/layout/activity_other_order.xml
+13
-1
print-module/src/main/java/com/joe/print/mvp/print/PrintOtherOrderClosing.java
+1
-1
No files found.
base-module/build.gradle
View file @
e209e25a
...
...
@@ -168,7 +168,6 @@ dependencies {
api
'androidx.core:core-ktx:+'
implementation
"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
api
'com.github.huangyanbin:SmartTable:2.2.0'
api
rootProject
.
ext
.
dependencies
[
'logan'
]
}
repositories
{
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/config/globalconfig/applyOptions/intercept/LoggingInterceptor.java
View file @
e209e25a
package
com
.
gingersoft
.
gsa
.
cloud
.
globalconfig
.
applyOptions
.
intercept
;
package
com
.
gingersoft
.
gsa
.
cloud
.
config
.
globalconfig
.
applyOptions
.
intercept
;
import
com.gingersoft.gsa.cloud.base.utils.log.LogUtil
;
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/constans/ExpandConstant.java
View file @
e209e25a
...
...
@@ -15,7 +15,10 @@ public class ExpandConstant {
public
final
static
String
PrintStatisticsAmount
=
"PrintStatisticsAmount"
;
//是否顯示統計打印數
public
final
static
String
PrintFirstOrder
=
"PrintFirstOrder"
;
//是否打印"頭單"文字
public
final
static
String
FrozenChainAutoOrder
=
"FrozenChainAutoOrder"
;
//是否自動接單 為0true
public
final
static
String
FrozenChainAutoOrder
=
"FrozenChainAutoOrder"
;
//凍鏈是否自動接單 為0時true
public
final
static
String
TakeawayAutoOrder
=
"TakeawayAutoOrder"
;
//外賣/自取 是否自動接單 為0時true
public
final
static
String
Rounding
=
"Rounding"
;
public
final
static
String
RoundingDecimal
=
"RoundingDecimal"
;
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/constans/FoodSummaryConstans.java
View file @
e209e25a
...
...
@@ -25,7 +25,7 @@ public interface FoodSummaryConstans {
*/
int
MEAL_MENU
=
4
;
/**
*
冷
鏈餐種
*
凍
鏈餐種
*/
int
COLD_CHAIN
=
5
;
/**
...
...
coldchain-module/src/main/java/com/gingersoft/coldchain_module/mvp/ui/activity/ColdChainMainActivity.java
View file @
e209e25a
...
...
@@ -169,7 +169,7 @@ public class ColdChainMainActivity extends BaseFragmentActivity<ColdChainMainPre
@Override
public
void
onNext
(
Long
aLong
)
{
mPresenter
.
updateExpandInfo
(
ExpandConstant
.
FrozenChainAutoOrder
,
new
String
[]{
RestaurantExpandInfoUtils
.
VALUE_INT
},
new
String
[]{
RestaurantExpandInfoUtils
.
getValue
(
ExpandConstant
.
FrozenChainAutoOrder
,
false
)
?
"0"
:
"1"
});
//
mPresenter.updateExpandInfo(ExpandConstant.FrozenChainAutoOrder, new String[]{RestaurantExpandInfoUtils.VALUE_INT}, new String[]{RestaurantExpandInfoUtils.getValue(ExpandConstant.FrozenChainAutoOrder, false) ? "0" : "1"});
if
(!
isChecked
)
{
mPresenter
.
stopAutoReceivingOrders
();
}
else
{
...
...
config.gradle
View file @
e209e25a
...
...
@@ -131,9 +131,10 @@ ext {
"immersionbar"
:
"com.gyf.immersionbar:immersionbar:3.0.0"
,
// fragment快速实现(可选)
"immersionbar-components"
:
"com.gyf.immersionbar:immersionbar-components:3.0.0"
,
//獲取權限
"permissionx"
:
'com.permissionx.guolindev:permissionx:1.3.1'
,
//美團點評-日誌監聽https://github.com/Meituan-Dianping/Logan/tree/master/Example/Logan-Android
"logan"
:
'com.dianping.android.sdk:logan:1.2.4'
,
//滴滴開源 哆啦A夢:辅助开发工具、测试效率工具、视觉辅助工具
"doraemonkit"
:
'com.didichuxing.doraemonkit:dokitx:3.3.3'
]
...
...
delivery_pick_module/src/main/java/com/gingersoft/gsa/delivery_pick_mode/data/network/ServiceCreator.kt
View file @
e209e25a
...
...
@@ -7,7 +7,7 @@ import com.gingersoft.gsa.cloud.constans.AppConstans
import
com.gingersoft.gsa.cloud.constans.HttpsConstans
import
com.gingersoft.gsa.cloud.constans.HttpsConstans.ROOT_SERVER
import
com.gingersoft.gsa.cloud.constans.HttpsConstans.URK_RICEPON_GSA
import
com.gingersoft.gsa.cloud.globalconfig.applyOptions.intercept.LoggingInterceptor
import
com.gingersoft.gsa.cloud.
config.
globalconfig.applyOptions.intercept.LoggingInterceptor
import
com.jess.arms.utils.DeviceUtils
import
okhttp3.Headers
import
okhttp3.Interceptor
...
...
@@ -133,7 +133,6 @@ object ServiceCreator {
token
=
Aes
.
aesEncrypt
(
"9_"
+
memberId
+
"_"
+
System
.
currentTimeMillis
()
+
"_"
+
loginToken
)
token
=
token
.
replace
(
"\r|\n"
.
toRegex
(),
""
)
builder
.
set
(
"token"
,
token
)
Log
.
e
(
"eee"
,
"添加Token:"
+
token
);
}
val
request1
=
chain
.
request
().
newBuilder
().
headers
(
builder
.
build
()).
build
()
return
chain
.
proceed
(
request1
)
...
...
delivery_pick_module/src/main/java/com/gingersoft/gsa/delivery_pick_mode/model/viewModel/PageViewModel.kt
View file @
e209e25a
...
...
@@ -14,7 +14,6 @@ import androidx.recyclerview.widget.RecyclerView
import
com.billy.cc.core.component.CC
import
com.gingersoft.gsa.cloud.app.GsaCloudApplication
import
com.gingersoft.gsa.cloud.base.common.bean.PayMethod
import
com.gingersoft.gsa.cloud.base.order.bean.mealManger.MyOrderManage
import
com.gingersoft.gsa.cloud.base.order.order.TakeawayOrder
import
com.gingersoft.gsa.cloud.base.utils.gson.GsonUtils
import
com.gingersoft.gsa.cloud.base.utils.okhttpUtils.OkHttp3Utils
...
...
@@ -32,6 +31,7 @@ import com.gingersoft.gsa.delivery_pick_mode.data.WeatherRepository
import
com.gingersoft.gsa.delivery_pick_mode.data.model.bean.*
import
com.gingersoft.gsa.delivery_pick_mode.ui.adapter.DeliveryAdapter
import
com.gingersoft.gsa.delivery_pick_mode.util.OtherOrderUtils
import
com.gingersoft.gsa.delivery_pick_mode.util.RxTimerUtil
import
com.jess.arms.utils.ArmsUtils
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.launch
...
...
@@ -53,11 +53,13 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
val
Transportation
=
1009
//修改運輸工具成功
}
val
restaurantId
by
lazy
{
GsaCloudApplication
.
getRestaurantId
()
}
var
mOrderNum
=
arrayListOf
<
MutableLiveData
<
Int
>>()
var
mOrderList
=
arrayListOf
<
MutableLiveData
<
ArrayList
<
OrderList
.
DataBeanX
.
DataBean
>>>()
var
orderList
=
MutableLiveData
<
OrderList
>()
//其他的所有數據
var
otherInfo
=
MutableLiveData
<
OrderList
.
DataBeanX
.
DataBean
>()
...
...
@@ -65,12 +67,16 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
//刷新狀態,值為當前頁面的下標
var
refreshState
=
MutableLiveData
(
0
)
//訂單號
var
orderNo
:
String
=
""
//手機號
var
phone
:
String
=
""
//派送員信息
var
deliveryBean
:
DeliveryBean
?
=
null
//接單超時時間
var
timeOut
=
0
...
...
@@ -80,6 +86,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
var
bookingConfigTime
=
MutableLiveData
<
Int
>()
//預約單配置時間
var
addServiceChargeBean
=
MutableLiveData
<
AddServiceChargeBean
>()
/**
* 獲取訂單數量
* status
...
...
@@ -145,11 +152,6 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
if
(
position
>
1
)
{
orderType
=
0
}
// if (orderType != 0 && !fragmentStatus[position].contains("8")) {
// fragmentStatus[position] += ",8"
// } else {
// fragmentStatus[position].removePrefix(",8")
// }
repository
.
requestOrderList
(
restaurantId
,
fragmentStatus
[
position
],
fragmentType
[
position
],
page
,
orderNo
,
phone
,
orderType
?:
0
).
apply
{
if
(
isSuccess
())
{
...
...
@@ -169,6 +171,86 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
})
}
/**
* 開始自動確認訂單
*/
fun
startAutoConfirmOrder
()
{
RxTimerUtil
.
interval
({
launch
({
//獲取即時單
repository
.
requestOrderList
(
restaurantId
.
toString
(),
fragmentStatus
[
1
],
fragmentType
[
0
],
"1"
,
orderNo
,
phone
,
0
).
apply
{
if
(
isSuccess
())
{
val
data
=
getData
()
if
(
data
!=
null
)
{
val
dataList
=
data
.
data
//這裡判斷數量大於1,默認有一條配置數據,忽略掉
if
(
dataList
!=
null
&&
dataList
.
size
>
1
)
{
//確認訂單之前得先獲取訂單詳情
val
orderInfo
=
repository
.
getOrderInfo
(
dataList
[
0
].
Id
.
toString
())
if
(
orderInfo
.
data
!=
null
&&
orderInfo
.
data
!!
.
isNotEmpty
())
{
val
orderDetail
=
orderInfo
.
data
!!
[
0
]
if
(
orderDetail
.
order_type
==
7
)
{
//如果是自取單,將物流類型改為本店
orderDetail
.
companyType
=
0
}
var
trafficType
=
""
if
(
orderDetail
.
companyType
==
2
)
{
//lalamove
val
transportationBean
=
getTransportationConfig
(
restaurantId
)
if
(
transportationBean
.
success
&&
transportationBean
.
data
!=
null
&&
transportationBean
.
data
.
list
!=
null
)
{
for
(
value
in
transportationBean
.
data
.
list
)
{
if
(
value
.
status
==
1
)
{
//默認交通工具,判斷價格是不是在這個金額範圍內,如果在,則不提示,如果不在,提示用戶修改交通工具
trafficType
=
value
.
type
.
toString
()
}
}
}
}
confirmOrder
(
orderDetail
,
2
,
trafficType
,
restaurantId
,
isPrintPrj
=
true
,
isPrintBill
=
false
)
{
//確認之後,刷新列表
refreshState
.
postValue
(
0
)
}
}
}
else
{
}
}
else
{
}
}
else
{
}
}
//獲取預約單
repository
.
requestOrderList
(
restaurantId
.
toString
(),
fragmentStatus
[
1
],
fragmentType
[
0
],
"1"
,
orderNo
,
phone
,
1
).
apply
{
if
(
isSuccess
())
{
val
data
=
getData
()
if
(
data
!=
null
)
{
val
dataList
=
data
.
data
//這裡判斷數量大於1,默認有一條配置數據,忽略掉
if
(
dataList
!=
null
&&
dataList
.
size
>
1
)
{
//確認訂單之前得先獲取訂單詳情
val
orderInfo
=
repository
.
getOrderInfo
(
dataList
[
0
].
Id
.
toString
())
if
(
orderInfo
.
data
!=
null
&&
orderInfo
.
data
!!
.
isNotEmpty
())
{
val
orderDetail
=
orderInfo
.
data
!!
[
0
]
updateOrderAndPrint
(
restaurantId
,
orderDetail
,
8
,
false
)
{
refreshState
.
postValue
(
0
)
}
}
}
}
}
}
},
{
})
},
10
*
1000
)
}
fun
stopAutoConfirmOrder
()
{
RxTimerUtil
.
cancelInterval
()
}
private
fun
OrderList
.
loadInfo
(
isLoadMore
:
Boolean
,
position
:
Int
)
{
getData
()
?.
statistics
?.
let
{
bookingOrderNum
.
value
=
it
.
reservationNumber
...
...
@@ -240,20 +322,6 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
}
/**
* 根據餐廳ID和訂單ID獲取物流信息
*/
// fun getShipanyOrderTime(restaurantId: String, orderId: String) {
// launch({
// repository.getShipanyOrderTime(restaurantId, orderId).apply {
// }
// }, {
// //出錯
// it.printStackTrace()
// })
// }
var
orderDetails
=
MutableLiveData
<
OrderDetails
>()
//獲取訂單詳情和物流送達時間
...
...
@@ -288,14 +356,10 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
}
}
val
estimatedBean
=
withContext
(
Dispatchers
.
Default
)
{
repository
.
getShipanyOrderTime
(
restaurantId
.
toString
(),
orderId
,
type
)
}
//1、预计整张订单完成时间2、預計配送員接單時間3、預計配送員到店時間4、配送員預計送達時間
// if (estimatedBean.data.estimated_time > 0) {
if
(
estimatedBean
.
data
!=
null
)
{
data
.
estimatedTime
=
estimatedTime
+
(
"${estimatedBean.data.estimated_time}分鐘後"
)
}
orderDetails
.
postValue
(
orderDetail
)
// } else {
// data.estimatedTime = ""
// }
}
}
}
...
...
@@ -327,20 +391,20 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
}
fun
confirmOrder
(
dataBean
:
OrderDetails
.
DataBean
,
status
:
Int
,
trafficType
:
String
=
""
,
restaurantId
:
Int
,
isPrint
:
Boolean
=
true
,
listener
:
(
MessageBean
)
->
Unit
)
{
fun
confirmOrder
(
dataBean
:
OrderDetails
.
DataBean
,
status
:
Int
,
trafficType
:
String
=
""
,
restaurantId
:
Int
,
isPrint
Prj
:
Boolean
=
true
,
isPrintBill
:
Boolean
=
true
,
listener
:
(
MessageBean
)
->
Unit
)
{
launch
({
when
(
dataBean
.
companyType
)
{
0
->
{
//本店
updateOrderAndPrint
(
restaurantId
,
dataBean
,
status
,
isPrint
,
listener
)
updateOrderAndPrint
(
restaurantId
,
dataBean
,
status
,
isPrint
Prj
,
listener
)
}
1
->
{
//zeek
thirdSend
(
restaurantId
,
dataBean
,
trafficType
,
status
,
isPrint
,
listener
)
thirdSend
(
restaurantId
,
dataBean
,
trafficType
,
status
,
isPrint
Prj
,
isPrintBill
,
listener
)
}
2
->
{
//lalamove
thirdSend
(
restaurantId
,
dataBean
,
trafficType
,
status
,
isPrint
,
listener
)
thirdSend
(
restaurantId
,
dataBean
,
trafficType
,
status
,
isPrint
Prj
,
isPrintBill
,
listener
)
}
}
},
{
...
...
@@ -440,16 +504,20 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
})
}
fun
updateOrderAndPrint
(
restaurantId
:
Int
,
dataBean
:
OrderDetails
.
DataBean
,
status
:
Int
,
isPrint
:
Boolean
=
true
,
listener
:
(
MessageBean
)
->
Unit
)
{
updateOrderAndPrint
(
restaurantId
,
dataBean
,
status
,
isPrint
,
isPrint
,
listener
)
}
/**
* 修改訂單狀態並打印,狀態為0,1,2才打印
*/
fun
updateOrderAndPrint
(
restaurantId
:
Int
,
dataBean
:
OrderDetails
.
DataBean
,
status
:
Int
,
isPrint
:
Boolean
=
true
,
listener
:
(
MessageBean
)
->
Unit
)
{
fun
updateOrderAndPrint
(
restaurantId
:
Int
,
dataBean
:
OrderDetails
.
DataBean
,
status
:
Int
,
isPrint
Prj
:
Boolean
=
true
,
isPrintBill
:
Boolean
=
true
,
listener
:
(
MessageBean
)
->
Unit
)
{
launch
({
repository
.
gsUpdateOrderStatus
(
dataBean
.
ID
,
status
,
dataBean
.
order_type
,
1
,
""
,
""
,
""
,
"0"
,
""
,
1
,
0
).
apply
{
if
(
status
==
0
||
status
==
1
||
status
==
2
||
status
==
8
)
{
//確認送單
//添加數據到prj
if
(
isPrint
)
{
if
(
isPrint
Prj
)
{
val
ids
=
StringBuffer
()
dataBean
.
PRODUCT_NAME
.
let
{
if
(
it
!=
null
)
{
...
...
@@ -484,7 +552,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
})
}
if
(
this
.
code
==
"1"
)
{
if
(
isPrint
)
{
if
(
isPrint
Bill
)
{
// 打印印單
// 初始化用於打印的view
// 送單成功後,再調用接口獲取取餐碼
...
...
@@ -597,7 +665,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
/**
* 第三方派送
*/
private
fun
thirdSend
(
restaurantId
:
Int
,
dataBean
:
OrderDetails
.
DataBean
,
trafficType
:
String
,
status
:
Int
,
isPrint
:
Boolean
=
true
,
listener
:
(
MessageBean
)
->
Unit
)
{
private
fun
thirdSend
(
restaurantId
:
Int
,
dataBean
:
OrderDetails
.
DataBean
,
trafficType
:
String
,
status
:
Int
,
isPrint
Prj
:
Boolean
=
true
,
isPrintBill
:
Boolean
=
true
,
listener
:
(
MessageBean
)
->
Unit
)
{
val
third
=
ThirdItem
()
//將食品數據轉為第三方需要的數據
dataBean
.
PRODUCT_NAME
?.
let
{
...
...
@@ -612,16 +680,17 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
}
}
//調用第三方物流接口
callThird
(
dataBean
,
trafficType
,
third
,
restaurantId
,
status
,
isPrint
,
listener
)
callThird
(
dataBean
,
trafficType
,
third
,
restaurantId
,
status
,
isPrint
Prj
,
isPrintBill
,
listener
)
}
private
fun
callThird
(
dataBean
:
OrderDetails
.
DataBean
,
trafficType
:
String
,
third
:
ThirdItem
,
restaurantId
:
Int
,
status
:
Int
,
isPrint
:
Boolean
=
true
,
listener
:
(
MessageBean
)
->
Unit
)
{
private
fun
callThird
(
dataBean
:
OrderDetails
.
DataBean
,
trafficType
:
String
,
third
:
ThirdItem
,
restaurantId
:
Int
,
status
:
Int
,
isPrint
Prj
:
Boolean
=
true
,
isPrintBill
:
Boolean
=
true
,
listener
:
(
MessageBean
)
->
Unit
)
{
launch
({
repository
.
thirdDelivery
(
dataBean
.
ID
.
toString
(),
trafficType
,
third
).
apply
{
if
(
success
)
{
if
(
isPrint
)
{
updateOrderAndPrint
(
restaurantId
,
dataBean
,
status
,
isPrint
,
listener
)
if
(
isPrint
Prj
||
isPrintBill
)
{
updateOrderAndPrint
(
restaurantId
,
dataBean
,
status
,
isPrint
Prj
,
isPrintBill
,
listener
)
}
else
{
//都不打印,說明是修改交通工具
listener
(
getMsgBean
(
Transportation
,
errMsg
?:
"修改運輸工具成功"
,
success
))
}
}
else
if
(!
TextUtil
.
isEmptyOrNullOrUndefined
(
errMsg
))
{
...
...
@@ -643,9 +712,9 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
getOrderInfo
(
dataBean
.
ID
.
toString
())
{
if
(
it
?.
data
!=
null
&&
it
.
data
!!
.
isNotEmpty
()
&&
it
.
data
!!
[
0
].
isDelete
==
0
)
{
//已經指派第三方物流,就調用修改訂單狀態接口
updateOrderAndPrint
(
restaurantId
,
dataBean
,
status
,
isPrint
,
listener
)
updateOrderAndPrint
(
restaurantId
,
dataBean
,
status
,
isPrint
Prj
,
isPrintBill
,
listener
)
}
else
{
callThird
(
dataBean
,
trafficType
,
third
,
restaurantId
,
status
,
isPrint
,
listener
)
callThird
(
dataBean
,
trafficType
,
third
,
restaurantId
,
status
,
isPrint
Prj
,
isPrintBill
,
listener
)
}
}
}
else
{
...
...
@@ -854,6 +923,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
}
var
payTypeBean
=
MutableLiveData
<
List
<
PayMethod
>>()
/**
* 獲取支付方式
*/
...
...
delivery_pick_module/src/main/java/com/gingersoft/gsa/delivery_pick_mode/mvp/presenter/SendOrderPresenter.java
View file @
e209e25a
...
...
@@ -3,7 +3,7 @@ package com.gingersoft.gsa.delivery_pick_mode.mvp.presenter;
import
android.app.Activity
;
import
android.app.Application
;
import
com.gingersoft.gsa.cloud.
base.application
.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.
app
.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.common.bean.BaseResult
;
import
com.gingersoft.gsa.cloud.base.order.order.TakeawayOrder
;
import
com.gingersoft.gsa.cloud.base.utils.other.TextUtil
;
...
...
delivery_pick_module/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/activity/DeliveryOrderMainActivity.kt
View file @
e209e25a
...
...
@@ -103,28 +103,24 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
//餐廳營業信息
loadRestaurantInfo
(
binding
)
cl_order_info
.
post
{
layoutHeight
=
cl_order_info
.
height
.
toFloat
()
}
btn_open_or_close_info
.
post
{
btnHeight
=
btn_open_or_close_info
.
height
.
toFloat
()
}
initInfoHeight
()
layout_immediate_order
.
setOnClickListener
{
it
.
background
=
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
shape_left_themecolor_radius_btn
)
layout_booking_order
.
background
=
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
shape_right_white_radius_btn
)
tv_immediate_order
.
setTextColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
white
))
tv_booking_order
.
setTextColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
theme_333_color
))
pageViewModel
.
appointmentType
.
postValue
(
0
)
initOrderType
()
//是否自動接單
cb_takeaway_auto_receiving_orders
.
setOnCheckedChangeListener
{
buttonView
,
isChecked
->
if
(
isChecked
){
pageViewModel
.
startAutoConfirmOrder
()
}
else
{
pageViewModel
.
stopAutoConfirmOrder
()
}
layout_booking_order
.
setOnClickListener
{
it
.
background
=
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
shape_right_themecolor_radius_btn
)
layout_immediate_order
.
background
=
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
shape_left_white_radius_btn
)
tv_booking_order
.
setTextColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
white
))
tv_immediate_order
.
setTextColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
theme_333_color
))
pageViewModel
.
appointmentType
.
postValue
(
1
)
RestaurantExpandInfoUtils
.
setValue
(
ExpandConstant
.
TakeawayAutoOrder
,
isChecked
)
}
cb_takeaway_auto_receiving_orders
.
isChecked
=
RestaurantExpandInfoUtils
.
getValue
<
Boolean
>(
ExpandConstant
.
TakeawayAutoOrder
,
false
)
pageViewModel
.
apply
{
if
(
cb_takeaway_auto_receiving_orders
.
isChecked
){
startAutoConfirmOrder
()
}
getDeliveryInfo
(
restaurantId
.
toString
(),
memberId
.
toString
())
balanceBean
.
observe
(
this
@DeliveryOrderMainActivity
,
Observer
{
it
?.
data
?.
let
{
data
->
...
...
@@ -151,6 +147,38 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
}
}
/**
* 獲取高度用於收起展開
*/
private
fun
initInfoHeight
()
{
cl_order_info
.
post
{
layoutHeight
=
cl_order_info
.
height
.
toFloat
()
}
btn_open_or_close_info
.
post
{
btnHeight
=
btn_open_or_close_info
.
height
.
toFloat
()
}
}
/**
* 初始化即時單,預約單選中狀態
*/
private
fun
initOrderType
()
{
layout_immediate_order
.
setOnClickListener
{
it
.
background
=
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
shape_left_themecolor_radius_btn
)
layout_booking_order
.
background
=
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
shape_right_white_radius_btn
)
tv_immediate_order
.
setTextColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
white
))
tv_booking_order
.
setTextColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
theme_333_color
))
pageViewModel
.
appointmentType
.
postValue
(
0
)
}
layout_booking_order
.
setOnClickListener
{
it
.
background
=
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
shape_right_themecolor_radius_btn
)
layout_immediate_order
.
background
=
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
shape_left_white_radius_btn
)
tv_booking_order
.
setTextColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
white
))
tv_immediate_order
.
setTextColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
theme_333_color
))
pageViewModel
.
appointmentType
.
postValue
(
1
)
}
}
private
fun
initViewPager
()
{
val
sectionsPagerAdapter
=
SectionsPagerAdapter
(
this
,
supportFragmentManager
,
ints
)
view_pager
.
adapter
=
sectionsPagerAdapter
...
...
@@ -406,6 +434,7 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
override
fun
onDestroy
()
{
super
.
onDestroy
()
pageViewModel
.
stopAutoConfirmOrder
()
bind
?.
setOnPostCallBack
(
null
)
bind
?.
execute
{}
cancelDialogForLoading
()
...
...
@@ -603,9 +632,9 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
.
setActionName
(
"showMealStandActivity"
)
.
build
()
.
call
()
SPUtils
.
remove
(
SendOrderActivity
.
MEMBER_NAME_KEY
)
SPUtils
.
remove
(
SendOrderActivity
.
MEMBER_PHONE_KEY
)
SPUtils
.
remove
(
SendOrderActivity
.
MEMBER_ADDRESS_KEY
)
SPUtils
.
remove
(
SendOrderActivity
.
MEMBER_NAME_KEY
)
SPUtils
.
remove
(
SendOrderActivity
.
MEMBER_PHONE_KEY
)
SPUtils
.
remove
(
SendOrderActivity
.
MEMBER_ADDRESS_KEY
)
pop
!!
.
dismiss
()
}
}
...
...
delivery_pick_module/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/activity/OrderDetailsActivity.kt
View file @
e209e25a
...
...
@@ -596,7 +596,7 @@ class OrderDetailsActivity : BaseActivity<IPresenter>() {
private
fun
PageViewModel
.
confirmOrder
(
orderDetails
:
OrderDetails
.
DataBean
,
trafficType
:
String
=
""
,
isPrint
:
Boolean
=
true
)
{
showLoading
()
var
status
=
2
confirmOrder
(
orderDetails
,
status
,
trafficType
,
restaurantId
,
if
(
isBookingOrder
)
false
else
isPrint
,
listener
)
confirmOrder
(
orderDetails
,
status
,
trafficType
,
restaurantId
,
if
(
isBookingOrder
)
false
else
isPrint
,
if
(
isBookingOrder
)
false
else
isPrint
,
listener
)
}
/**
...
...
delivery_pick_module/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/fragment/PlaceholderFragment.kt
View file @
e209e25a
...
...
@@ -38,7 +38,6 @@ class PlaceholderFragment : BaseFragment(R.layout.fragment_other_order) {
pageViewModel
.
apply
{
// 綁定狀態,如果這個值發生變化
refreshState
.
observe
(
viewLifecycleOwner
,
Observer
{
Log
.
e
(
"CSDN_LQR0"
,
"頁面pageindex$it"
+
"當前頁面$position"
)
if
(
position
==
it
)
{
page
=
1
getOrderList
(
false
)
...
...
delivery_pick_module/src/main/res/layout/activity_other_order.xml
View file @
e209e25a
...
...
@@ -183,7 +183,7 @@
android:background=
"@drawable/shape_restaurant_state_bg"
android:text=
"營業中 "
app:layout_constraintBottom_toBottomOf=
"@id/ed_order_num_search"
app:layout_constraintRight_to
RightOf=
"parent
"
app:layout_constraintRight_to
LeftOf=
"@id/cb_takeaway_auto_receiving_orders
"
app:layout_constraintTop_toTopOf=
"@id/ed_order_num_search"
/>
<ImageView
...
...
@@ -196,6 +196,18 @@
app:layout_constraintRight_toRightOf=
"@id/tv_restaurant_state"
app:layout_constraintTop_toTopOf=
"@id/tv_restaurant_state"
/>
<androidx.appcompat.widget.AppCompatCheckBox
android:id=
"@+id/cb_takeaway_auto_receiving_orders"
style=
"@style/MyCheckbox_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layoutDirection=
"ltr"
android:text=
"自動接單"
android:textColor=
"@color/color_a9"
app:layout_constraintBottom_toBottomOf=
"@id/ed_order_num_search"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/ed_order_num_search"
/>
<!-- -->
<!-- <com.gingersoft.gsa.cloud.ui.view.SwitchButton-->
<!-- android:id="@+id/btn_switch_restaurant_state"-->
...
...
print-module/src/main/java/com/joe/print/mvp/print/PrintOtherOrderClosing.java
View file @
e209e25a
...
...
@@ -10,7 +10,7 @@ import android.widget.TextView;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.gingersoft.gsa.cloud.
base.application
.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.
app
.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.order.commodity.OrderDetail
;
import
com.gingersoft.gsa.cloud.base.order.order.TakeawayOrder
;
import
com.gingersoft.gsa.cloud.base.utils.MoneyUtil
;
...
...
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