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
fd2e5345
Commit
fd2e5345
authored
May 09, 2020
by
Wyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
5.09 接單已完成,正在修改prj打印
parent
fd30c52f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
46 changed files
with
877 additions
and
68 deletions
+877
-68
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/activity/NewMainActivity.java
+3
-3
main/src/main/res/drawable-xxhdpi/ic_sell_off_manger.png
+0
-0
main/src/main/res/drawable-xxhdpi/ic_takeaway_orders.png
+0
-0
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/WeatherRepository.kt
+7
-0
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/model/bean/DeliveryConfig.kt
+28
-0
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/model/bean/OrderList.kt
+10
-1
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/model/bean/ThirdItem.kt
+33
-0
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/model/bean/ThirdSend.kt
+27
-0
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/network/CoolWeatherNetwork.kt
+2
-0
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/network/ServiceCreator.kt
+2
-1
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/network/api/WeatherService.kt
+4
-0
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/model/viewModel/PageViewModel.kt
+26
-7
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/activity/OtherOrderActivity.kt
+1
-2
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/adapter/OtherOrdersAdapter.kt
+18
-0
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/fragment/PlaceholderFragment.kt
+0
-1
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/util/OtherOrderUtils.kt
+14
-4
other_order_mode/src/main/res/layout/layout_order_info_dialog_new.xml
+0
-0
other_order_mode/src/main/res/layout/layout_other_order_item.xml
+16
-4
print-module/src/main/AndroidManifest.xml
+1
-1
print-module/src/main/java/com/joe/print/PrintComponent.java
+8
-0
print-module/src/main/java/com/joe/print/mvp/model/server/GetPrintInfoService.java
+13
-0
print-module/src/main/java/com/joe/print/mvp/print/PrinterRoot.java
+18
-11
print-module/src/main/java/com/joe/print/mvp/print/service/PrjService.java
+95
-0
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrintActivity.java
+18
-16
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrinterAddActivity.java
+0
-4
print-module/src/main/java/com/joe/print/mvp/ui/activity/aaa.java
+89
-0
print-module/src/main/java/com/joe/print/mvp/ui/adapter/OtherOrderAdapter.java
+16
-9
print-module/src/main/res/layout/print_confirm_order_view.xml
+0
-0
print-module/src/main/res/layout/print_other_order_food_item.xml
+1
-1
public-base/src/main/java/com/gingersoft/gsa/cloud/base/application/GsaCloudApplication.java
+1
-1
public-base/src/main/java/com/gingersoft/gsa/cloud/ui/widget/dialog/LoadingDialog.java
+1
-1
public-base/src/main/res/drawable/shape_app_btn_unclickable.xml
+7
-0
public-base/src/main/res/transition/activity_fade.xml
+4
-0
public-base/src/main/res/transition/activity_slide.xml
+4
-0
public-base/src/main/res/values-v21/styles.xml
+10
-0
public-base/src/main/res/values/strings.xml
+1
-1
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/presenter/BaseLoginPresenter.java
+7
-0
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/di/component/RecoverPasswordComponent.java
+16
-0
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/di/module/RecoverPasswordModule.java
+36
-0
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/mvp/contract/RecoverPasswordContract.java
+16
-0
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/mvp/model/RecoverPasswordModel.java
+33
-0
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/mvp/presenter/RecoverPasswordPresenter.java
+40
-0
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/mvp/ui/activity/RecoverPasswordActivity.java
+110
-0
user-login/src/main/res/drawable/selector_login_btn.xml
+7
-0
user-login/src/main/res/layout/activity_recover_password.xml
+9
-0
user-login/src/main/res/layout/layout_recover_password.xml
+125
-0
No files found.
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/activity/NewMainActivity.java
View file @
fd2e5345
...
...
@@ -210,12 +210,12 @@ public class NewMainActivity extends BaseActivity<NewMainPresenter> implements N
functions
.
add
(
new
Function
((
long
)
151
,
0
,
5
,
"管理"
,
0
,
0
));
// functions.add(new Function((long) 142, 151, 5, "餐牌管理", R.drawable.ic_meals_menu_management));
functions
.
add
(
new
Function
((
long
)
142
,
151
,
5
,
"賬單管理"
,
R
.
drawable
.
ic_meals_menu_management
,
0
));
functions
.
add
(
new
Function
((
long
)
142
,
151
,
5
,
"
訂單管理"
,
R
.
drawable
.
ic_meals_menu_management
,
0
));
functions
.
add
(
new
Function
((
long
)
142
,
151
,
5
,
"
外賣接單"
,
R
.
drawable
.
ic_takeaway_orders
,
0
));
functions
.
add
(
new
Function
((
long
)
143
,
151
,
5
,
"餐臺管理"
,
R
.
drawable
.
ic_dining_table_management_close
,
1
));
functions
.
add
(
new
Function
((
long
)
144
,
151
,
5
,
"打印管理"
,
R
.
drawable
.
ic_print_management
,
0
));
functions
.
add
(
new
Function
((
long
)
145
,
151
,
5
,
"支付管理"
,
R
.
drawable
.
ic_pay_management_close
,
1
));
functions
.
add
(
new
Function
((
long
)
146
,
151
,
5
,
"折扣管理"
,
R
.
drawable
.
ic_discount_management_close
,
1
));
functions
.
add
(
new
Function
((
long
)
147
,
151
,
5
,
"沽清管理"
,
R
.
drawable
.
ic_
meals_menu_management
,
0
));
functions
.
add
(
new
Function
((
long
)
147
,
151
,
5
,
"沽清管理"
,
R
.
drawable
.
ic_
sell_off_manger
,
0
));
functions
.
add
(
new
Function
((
long
)
152
,
0
,
5
,
"員工"
,
0
,
0
));
functions
.
add
(
new
Function
((
long
)
147
,
152
,
5
,
"員工管理"
,
R
.
drawable
.
ic_staff_management_close
,
1
));
...
...
@@ -279,7 +279,7 @@ public class NewMainActivity extends BaseActivity<NewMainPresenter> implements N
.
setActionName
(
"showOrderCenterActivity"
)
.
build
()
.
call
();
}
else
if
(
name
.
equals
(
"
訂單管理
"
))
{
}
else
if
(
name
.
equals
(
"
外賣接單
"
))
{
CC
.
obtainBuilder
(
"Component.OtherOrder"
)
.
setActionName
(
"orderActivity"
)
.
build
()
...
...
main/src/main/res/drawable-xxhdpi/ic_sell_off_manger.png
0 → 100644
View file @
fd2e5345
2.07 KB
main/src/main/res/drawable-xxhdpi/ic_takeaway_orders.png
0 → 100644
View file @
fd2e5345
1.32 KB
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/WeatherRepository.kt
View file @
fd2e5345
...
...
@@ -82,6 +82,13 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw
data
}
suspend
fun
getDeliveryConfigDTO
(
restaurantId
:
String
)
=
withContext
(
Dispatchers
.
IO
)
{
val
requestBody
=
FormBody
.
Builder
()
.
add
(
"restaurantId"
,
restaurantId
)
.
build
()
network
.
getDeliveryConfigDTO
(
requestBody
)
}
companion
object
{
private
lateinit
var
instance
:
WeatherRepository
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/model/bean/DeliveryConfig.kt
0 → 100644
View file @
fd2e5345
package
com.gingersoft.gsa.other_order_mode.data.model.bean
data class
DeliveryConfig
(
val
`data`
:
Data
,
val
success
:
Boolean
,
val
sysTime
:
Long
)
{
data class
Data
(
val
list
:
List
<
DeliveryInfo
>)
{
data class
DeliveryInfo
(
val
addressDetail
:
String
,
val
deliveryCost
:
Double
,
val
desc
:
String
,
val
distributionFee
:
Double
,
val
distributionFeeMax
:
Double
,
val
distributionFeeMin
:
Double
,
val
distributionType
:
String
,
//區分當前是什麼類型的配送方式
val
id
:
Int
,
val
mapX
:
String
,
val
mapY
:
String
,
val
restaurantId
:
Int
,
val
restaurantName
:
String
,
val
restaurantPhone
:
String
,
val
type
:
Int
//為1時是第三方配送
)
}
}
\ No newline at end of file
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/model/bean/OrderList.kt
View file @
fd2e5345
...
...
@@ -51,7 +51,16 @@ class OrderList {
*/
var
delivery_man_phone_num
:
String
?
=
null
var
delivery_man_name
:
String
?
=
null
var
curStat
:
String
?
=
null
var
curStat
:
Int
=
0
//訂單已創建 1
// * * Order Assigned To Delivery Man - 配送員已接單 2
// * * Delivery Man Reached Pickup Point Nearby - 配送員已到達店鋪附近 3
// * * Delivery Man Reached Pickup Point - 配送员已到店 4
// * * Delivery In Progress - 訂單正在配送中 5
// * * Delivery Man Reached Destination Nearby - 配送員已到達目的地附近 6
// * * Order Delivered - 訂單已完成 7
// * * Order Cancelled Before Collection - 訂單已取消 - 取餐前 8
// * * Order Cancelled After Collection - 訂單已取消 - 取餐后 9
// * * Order Assigned To Another Delivery Man - 已指派另一位配送員 10
var
deliveryMode
:
String
?
=
null
var
trkNo
:
String
?
=
null
var
isDelete
:
Int
=
0
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/model/bean/ThirdItem.kt
0 → 100644
View file @
fd2e5345
package
com.gingersoft.gsa.other_order_mode.data.model.bean
class
ThirdItem
:
ArrayList
<
ThirdItem
.
ThirdItemItem
>()
{
data class
ThirdItemItem
(
val
descr
:
String
=
""
,
val
dim
:
Dim
=
Dim
(),
val
name
:
String
,
val
ori
:
String
=
""
,
val
qty
:
Int
,
val
sku
:
String
=
""
,
val
stg
:
String
=
"Normal"
,
val
typ
:
String
=
""
,
val
unt_price
:
UntPrice
,
val
wt
:
Wt
=
Wt
())
{
data class
Dim
(
val
hgt
:
Int
=
1
,
val
len
:
Int
=
1
,
val
unt
:
String
=
"cm"
,
//尺寸單位
val
wid
:
Int
=
1
)
data class
UntPrice
(
val
ccy
:
String
=
"HKD"
,
//金額單位
val
`val`
:
Double
)
data class
Wt
(
val
unt
:
String
=
"kg"
,
//重量單位
val
`val`
:
Int
=
1
)
}
}
\ No newline at end of file
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/model/bean/ThirdSend.kt
0 → 100644
View file @
fd2e5345
package
com.gingersoft.gsa.other_order_mode.data.model.bean
data class
ThirdSend
(
val
`data`
:
Data
,
val
success
:
Boolean
,
val
errCode
:
String
,
val
errMsg
:
String
,
val
sysTime
:
Long
)
{
data class
Data
(
val
createTime
:
Long
,
val
ctime
:
Long
,
val
curStat
:
String
,
val
delivery_man_name
:
String
,
val
delivery_man_phone_num
:
String
,
val
isDelete
:
Int
,
val
lUpd
:
Long
,
val
mchShipanyCommn
:
Double
,
val
mchUid
:
String
,
val
orderId
:
Int
,
val
restaurantId
:
Int
,
val
takeFoodCode
:
String
,
val
uid
:
String
,
val
updateTime
:
Long
)
}
\ No newline at end of file
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/network/CoolWeatherNetwork.kt
View file @
fd2e5345
...
...
@@ -31,6 +31,8 @@ class CoolWeatherNetwork {
suspend
fun
getDeliveryInfo
(
requestBody
:
RequestBody
)
=
orderService
.
getDeliveryInfo
(
requestBody
).
await
()
suspend
fun
getDeliveryConfigDTO
(
requestBody
:
RequestBody
)
=
gsposService
.
getDeliveryConfigDTO
(
requestBody
).
await
()
suspend
fun
getHistoryOrderList
(
requestBody
:
RequestBody
)
=
orderService
.
getHistoryOrderList
(
requestBody
).
await
()
private
suspend
fun
<
T
>
Call
<
T
>.
await
():
T
{
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/network/ServiceCreator.kt
View file @
fd2e5345
...
...
@@ -5,9 +5,10 @@ import okhttp3.OkHttpClient
import
retrofit2.Retrofit
import
retrofit2.converter.gson.GsonConverterFactory
import
retrofit2.converter.scalars.ScalarsConverterFactory
import
java.util.concurrent.TimeUnit
object
ServiceCreator
{
private
val
httpClient
=
OkHttpClient
.
Builder
().
addInterceptor
(
LoggingInterceptor
())
private
val
httpClient
=
OkHttpClient
.
Builder
().
connectTimeout
(
15
,
TimeUnit
.
SECONDS
).
addInterceptor
(
LoggingInterceptor
())
private
const
val
ROOT_SZ_URL
=
"http://192.168.1.74:6060"
private
const
val
ROOT_HK_TEST_URL
=
"https://hktest.ricepon.com:64377"
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/network/api/WeatherService.kt
View file @
fd2e5345
...
...
@@ -30,6 +30,9 @@ interface WeatherService {
@POST
(
"wechat/findRestDelivery"
)
fun
getDeliveryInfo
(
@Body
requestBody
:
RequestBody
):
Call
<
DeliveryBean
>
@POST
(
"gsa/getDeliveryConfigDTO"
)
fun
getDeliveryConfigDTO
(
@Body
requestBody
:
RequestBody
):
Call
<
DeliveryConfig
>
@POST
(
"wechat/findHistoryOrderList"
)
fun
getHistoryOrderList
(
@Body
requestBody
:
RequestBody
):
Call
<
HistoryOrderBean
>
}
\ No newline at end of file
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/model/viewModel/PageViewModel.kt
View file @
fd2e5345
...
...
@@ -20,10 +20,7 @@ import com.gingersoft.gsa.cloud.print.bean.OrderDetails
import
com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog
import
com.gingersoft.gsa.other_order_mode.R
import
com.gingersoft.gsa.other_order_mode.data.WeatherRepository
import
com.gingersoft.gsa.other_order_mode.data.model.bean.DeliveryBean
import
com.gingersoft.gsa.other_order_mode.data.model.bean.OrderList
import
com.gingersoft.gsa.other_order_mode.data.model.bean.ThirdItem
import
com.gingersoft.gsa.other_order_mode.data.model.bean.UpdateOrderBean
import
com.gingersoft.gsa.other_order_mode.data.model.bean.*
import
com.gingersoft.gsa.other_order_mode.ui.adapter.DeliveryAdapter
import
com.jess.arms.utils.ArmsUtils
import
kotlinx.coroutines.launch
...
...
@@ -62,6 +59,9 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
//派送員信息
var
deliveryBean
:
DeliveryBean
?
=
null
var
deliveryConfig
:
DeliveryConfig
?
=
null
/**
* 獲取訂單
*/
...
...
@@ -178,7 +178,6 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
* 2 已確認,外賣是指派送單,自取是製作完成
*/
fun
updateOrderStatus
(
context
:
Context
,
data
:
OrderList
.
DataBeanX
.
DataBean
,
orderDetails
:
OrderDetails
,
listener
:
(
Boolean
)
->
Unit
)
{
launch
({
val
status
=
when
(
data
.
STATUS
)
{
0
->
2
...
...
@@ -226,7 +225,15 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
}
else
{
showLoading
(
context
)
// 確認訂單
val
third
=
true
var
third
=
false
if
(
deliveryConfig
!=
null
)
{
for
(
i
in
0
until
deliveryConfig
!!
.
data
.
list
.
size
)
{
third
=
deliveryConfig
!!
.
data
.
list
[
i
].
let
{
(
it
.
distributionType
==
data
.
deliveryMode
&&
deliveryConfig
!!
.
data
.
list
[
i
].
type
==
1
)
}
}
}
Log
.
e
(
"eee"
,
"是否是第三方配送:$third"
)
if
(
third
)
{
// 如果是第三方物流,調用第三方接口
thirdSend
(
data
,
orderDetails
,
status
,
isPush
,
data
.
order_type
,
context
,
listener
)
...
...
@@ -293,8 +300,9 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
}
}
repository
.
thirdDelivery
(
data
.
Id
.
toString
(),
third
).
apply
{
cancelDialogForLoading
()
if
(
success
)
{
cancelDialogForLoading
(
)
ToastUtils
.
show
(
context
,
"訂單派送成功"
)
updateOrderAndPrint
(
data
,
status
,
isPush
,
orderDetails
,
context
,
listener
)
}
else
{
ToastUtils
.
show
(
context
,
"訂單派送失敗"
)
...
...
@@ -374,6 +382,17 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
})
}
fun
getDeliveryConfigDTO
(
context
:
Context
)
{
launch
({
repository
.
getDeliveryConfigDTO
(
GsaCloudApplication
.
getRestaurantId
(
context
).
toString
()).
apply
{
deliveryConfig
=
this
}
},
{
})
}
private
fun
launch
(
block
:
suspend
()
->
Unit
,
error
:
suspend
(
Throwable
)
->
Unit
)
=
viewModelScope
.
launch
{
try
{
block
()
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/activity/OtherOrderActivity.kt
View file @
fd2e5345
...
...
@@ -11,7 +11,6 @@ import android.media.SoundPool
import
android.os.Build
import
android.os.Bundle
import
android.os.IBinder
import
android.util.Log
import
android.view.View
import
android.widget.TextView
import
androidx.databinding.DataBindingUtil
...
...
@@ -19,7 +18,6 @@ import androidx.lifecycle.MutableLiveData
import
androidx.lifecycle.Observer
import
androidx.lifecycle.ViewModelProvider
import
androidx.viewpager.widget.ViewPager
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
import
com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils
import
com.gingersoft.gsa.cloud.ui.view.SwitchButton
import
com.gingersoft.gsa.other_order_mode.R
...
...
@@ -78,6 +76,7 @@ class OtherOrderActivity : BaseActivity() {
layoutHeight
=
layout_today_order_info
.
height
.
toFloat
()
}
pageViewModel
.
getDeliveryInfo
(
this
)
pageViewModel
.
getDeliveryConfigDTO
(
this
)
}
/**
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/adapter/OtherOrdersAdapter.kt
View file @
fd2e5345
...
...
@@ -44,6 +44,24 @@ class OtherOrdersAdapter(var context: Context) : Adapter<OtherOrdersAdapter.View
holder
.
binding
.
data
=
data
holder
.
binding
.
isSelf
=
data
.
order_type
==
7
data
.
trkNo
?.
apply
{
if
(
length
>
0
)
{
holder
.
binding
.
deliveryState
=
when
(
data
.
curStat
)
{
1
->
"訂單已創建"
2
->
"配送員已接單"
3
->
"配送員到店附近"
4
->
"配送員已到店"
5
->
"配送中"
6
->
"到達目的地附近"
7
->
"訂單已完成"
8
->
"訂單已取消"
//取餐前
9
->
"訂單已取消"
//取餐後
10
->
"已指派另一位配送員"
else
->
"訂單已創建"
}
}
}
var
state
:
String
?
=
null
val
bg
=
GradientDrawable
()
bg
.
cornerRadius
=
dp2px
(
5f
).
toFloat
()
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/fragment/PlaceholderFragment.kt
View file @
fd2e5345
...
...
@@ -41,7 +41,6 @@ class PlaceholderFragment : BaseFragment() {
getOrderList
(
this
,
false
)
// }
})
}
// 初始化recyclerview
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/util/OtherOrderUtils.kt
View file @
fd2e5345
...
...
@@ -2,8 +2,8 @@ package com.gingersoft.gsa.other_order_mode.util
import
android.app.Dialog
import
android.content.Context
import
android.util.Log
import
android.widget.Button
import
android.widget.ImageView
import
android.widget.TextView
import
androidx.databinding.DataBindingUtil
import
androidx.recyclerview.widget.LinearLayoutManager
...
...
@@ -11,7 +11,6 @@ import androidx.recyclerview.widget.RecyclerView
import
com.gingersoft.gsa.cloud.base.widget.DialogUtils
import
com.gingersoft.gsa.cloud.print.bean.OrderDetails
import
com.gingersoft.gsa.other_order_mode.R
import
com.gingersoft.gsa.other_order_mode.databinding.LayoutOrderInfoDialogBinding
import
com.gingersoft.gsa.other_order_mode.databinding.LayoutOrderInfoDialogNewBinding
import
com.gingersoft.gsa.other_order_mode.ui.adapter.FoodListAdapter
import
com.jess.arms.utils.ArmsUtils
...
...
@@ -28,10 +27,17 @@ object OtherOrderUtils {
layoutOrderInfoDialogBinding
.
data
=
orderData
layoutOrderInfoDialogBinding
.
isSelf
=
orderType
==
7
layoutOrderInfoDialogBinding
.
totalAmount
=
orderData
.
TOTAL_AMOUNT
!!
.
toDouble
()
layoutOrderInfoDialogBinding
.
showBtn
=
showBtn
//如果有物流號,就不顯示指派送貨按鈕
// if (orderData.trkNo != null && orderData.trkNo!!.isNotEmpty() && orderStuats == 2) {
// layoutOrderInfoDialogBinding.showBtn = false
// } else {
layoutOrderInfoDialogBinding
.
showBtn
=
showBtn
// }
val
btnContent
:
String
val
type
=
if
(
orderType
==
7
)
"自取"
else
"外賣"
val
orderStatus
:
String
when
(
orderStuats
)
{
2
->
{
if
(
orderType
==
7
)
{
...
...
@@ -73,9 +79,13 @@ object OtherOrderUtils {
//確認訂單,調用接口,並打印
listenter
?.
invoke
(
data
.
data
!!
[
0
],
dialog
)
}
hepler
.
getView
<
ImageView
>(
R
.
id
.
iv_close
).
setOnClickListener
{
dialog
.
dismiss
()
}
}
}.
setWidth
((
ArmsUtils
.
getScreenWidth
(
context
)
*
0.9
).
toInt
())
.
setHeight
((
ArmsUtils
.
getScreenHeidth
(
context
)
*
0.
8
).
toInt
())
.
setHeight
((
ArmsUtils
.
getScreenHeidth
(
context
)
*
0.
9
).
toInt
())
.
createDialogView
()
.
show
()
...
...
other_order_mode/src/main/res/layout/layout_order_info_dialog_new.xml
View file @
fd2e5345
This diff is collapsed.
Click to expand it.
other_order_mode/src/main/res/layout/layout_other_order_item.xml
View file @
fd2e5345
...
...
@@ -11,6 +11,10 @@
type=
"com.gingersoft.gsa.other_order_mode.data.model.bean.OrderList.DataBeanX.DataBean"
/>
<variable
name=
"delivery_state"
type=
"String"
/>
<variable
name=
"state"
type=
"String"
/>
...
...
@@ -86,6 +90,15 @@
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_delivery_state"
style=
"@style/otherOrder_item_info_title_textStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@{delivery_state}"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_order_user_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
@@ -99,11 +112,11 @@
<TextView
android:id=
"@+id/tv_order_time"
style=
"@style/otherOrder_item_create_time_textStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_5"
android:text=
"@{TimeUtils.parseTimeRepeat(data.cREATE_TIME,TimeUtils.DEFAULT_DATE_FORMAT)}"
style=
"@style/otherOrder_item_create_time_textStyle"
app:layout_constraintBottom_toBottomOf=
"@id/tv_order_user_name"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/tv_order_user_name"
/>
...
...
@@ -144,8 +157,7 @@
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_2"
android:layout_marginTop=
"@dimen/dp_5"
android:text=
"訂單號:"
android:text=
"取餐碼:"
app:layout_constraintLeft_toLeftOf=
"@id/tv_cellphone_num_text"
app:layout_constraintTop_toBottomOf=
"@id/tv_cellphone_num_text"
/>
...
...
@@ -154,7 +166,7 @@
style=
"@style/otherOrder_item_info_textStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@{data.
oRDER_NO
}"
android:text=
"@{data.
takeFoodCode
}"
app:layout_constraintLeft_toLeftOf=
"@id/tv_cellphone_num"
app:layout_constraintTop_toTopOf=
"@id/tv_order_num_text"
/>
...
...
print-module/src/main/AndroidManifest.xml
View file @
fd2e5345
...
...
@@ -15,7 +15,7 @@
<activity
android:name=
".mvp.ui.activity.PrinterListActivity"
/>
<activity
android:name=
".mvp.ui.activity.PrinterAddActivity"
/>
<service
android:name=
".mvp.print.service.PrjService"
/>
<meta-data
android:name=
"com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:value=
"ConfigModule"
/>
...
...
print-module/src/main/java/com/joe/print/PrintComponent.java
View file @
fd2e5345
...
...
@@ -10,6 +10,7 @@ import com.billy.cc.core.component.CC;
import
com.billy.cc.core.component.CCResult
;
import
com.billy.cc.core.component.CCUtil
;
import
com.billy.cc.core.component.IComponent
;
import
com.joe.print.mvp.print.service.PrjService
;
import
com.joe.print.mvp.ui.activity.IpPrintActivity
;
import
com.joe.print.mvp.ui.activity.PrintActivity
;
import
com.joe.print.mvp.ui.activity.PrinterListActivity
;
...
...
@@ -57,6 +58,13 @@ public class PrintComponent implements IComponent {
return
printOrderInfo
(
cc
);
case
"printActivity"
:
return
print
(
cc
);
case
"openPrintService"
:
//打開打印服務
Log
.
e
(
"eee"
,
"PrintComponent打開打印服務"
);
Intent
intent
=
new
Intent
(
cc
.
getContext
(),
PrjService
.
class
);
cc
.
getContext
().
startService
(
intent
);
CC
.
sendCCResult
(
cc
.
getCallId
(),
CCResult
.
success
());
break
;
default
:
// cc.callAsync(new IComponentCallback() {
// @Override
...
...
print-module/src/main/java/com/joe/print/mvp/model/server/GetPrintInfoService.java
0 → 100644
View file @
fd2e5345
package
com
.
joe
.
print
.
mvp
.
model
.
server
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.LoginBean
;
import
io.reactivex.Observable
;
import
me.jessyan.retrofiturlmanager.RetrofitUrlManager
;
import
retrofit2.http.GET
;
import
retrofit2.http.Query
;
public
interface
GetPrintInfoService
{
@GET
(
"prg/get"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
LoginBean
>
getPrintInfo
(
@Query
(
"restaurantId"
)
String
restaurantId
);
}
print-module/src/main/java/com/joe/print/mvp/print/PrinterRoot.java
View file @
fd2e5345
...
...
@@ -16,13 +16,12 @@ import androidx.recyclerview.widget.RecyclerView;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.utils.AidlUtil
;
import
com.gingersoft.gsa.cloud.constans.Constans
;
import
com.gingersoft.gsa.cloud.base.utils.other.SPUtils
;
import
com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils
;
import
com.gingersoft.gsa.cloud.base.utils.view.ImageUtils
;
import
com.gingersoft.gsa.cloud.base.utils.view.LayoutToBitmapUtils
;
import
com.gingersoft.gsa.cloud.base.widget.DialogUtils
;
import
com.gingersoft.gsa.cloud.constans.
Print
Constans
;
import
com.gingersoft.gsa.cloud.constans.Constans
;
import
com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean
;
import
com.gingersoft.gsa.cloud.print.PrintExecutor
;
import
com.gingersoft.gsa.cloud.print.PrintSocketHolder
;
...
...
@@ -391,21 +390,26 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
}
else
if
(
deftultPrint
.
equals
(
Constans
.
IP_PRINT
))
{
// 默認打印方式為ip打印,調用ip打印方法
// 獲取默認ip打印機,
if
(
!
Objects
.
equals
(
SPUtils
.
get
(
mContext
,
PrintConstans
.
DEFAULT_PRINT_IP
,
""
),
""
)
)
{
if
(
printerDeviceBeans
!=
null
&&
printerDeviceBeans
.
size
()
>
0
)
{
//有默認打印機
PrinterDeviceBean
printerDeviceBean
=
new
PrinterDeviceBean
();
printerDeviceBean
.
setIp
((
String
)
SPUtils
.
get
(
mContext
,
PrintConstans
.
DEFAULT_PRINT_IP
,
""
));
printerDeviceBean
.
setPort
((
Integer
)
SPUtils
.
get
(
mContext
,
PrintConstans
.
DEFAULT_PRINT_PORT
,
0
));
printerDeviceBean
.
setType
((
Integer
)
SPUtils
.
get
(
mContext
,
PrintConstans
.
DEFAULT_PRINT_PAPER
,
0
));
ipDevicePrint
(
printerDeviceBean
,
bitmaps
);
}
else
{
for
(
PrinterDeviceBean
printerDeviceBean
:
printerDeviceBeans
)
{
if
(
printerDeviceBean
.
getStatus
()
==
2
)
{
//默認打印機
ipDevicePrint
(
printerDeviceBeans
.
get
(
0
),
bitmaps
);
return
;
}
}
//沒有默認打印機,彈出彈窗,讓用戶選擇ip打印機
showIpPrintDeviceList
(
printerDeviceBeans
,
bitmaps
);
}
else
{
//沒有打印機,讓用戶去添加
setPrintState
(
PrintActivity
.
ADD_PRINT_DEVICE
);
}
}
}
private
void
showIpPrintDeviceList
(
List
<
PrinterDeviceBean
>
printerDeviceBeans
,
List
<
Bitmap
>
bitmaps
)
{
private
void
showIpPrintDeviceList
(
List
<
PrinterDeviceBean
>
printerDeviceBeans
,
List
<
Bitmap
>
bitmaps
)
{
if
(
printerDeviceBeans
!=
null
&&
printerDeviceBeans
.
size
()
>
0
)
{
if
(
printerDeviceBeans
.
size
()
==
1
)
{
//只有一台ip打印機時,直接打印
...
...
@@ -429,6 +433,7 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
}
.
setHeight
(
ArmsUtils
.
getScreenHeidth
(
mContext
)
/
2
)
.
createDialogView
()
.
setOnDismissListener
(
dialog
->
setPrintState
(
PrintActivity
.
DIMISS_LOADING
))
.
show
();
}
}
else
{
...
...
@@ -445,7 +450,9 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
/**
* ip設備打印
*/
public
void
ipDevicePrint
(
PrinterDeviceBean
printerDeviceBean
,
List
<
Bitmap
>
bitmaps
,
PrintSocketHolder
.
OnStateChangedListener
stateChangedListener
,
PrintExecutor
.
OnPrintResultListener
resultListener
)
{
public
void
ipDevicePrint
(
PrinterDeviceBean
printerDeviceBean
,
List
<
Bitmap
>
bitmaps
,
PrintSocketHolder
.
OnStateChangedListener
stateChangedListener
,
PrintExecutor
.
OnPrintResultListener
resultListener
)
{
int
paperType
=
printerDeviceBean
.
getType
();
//打印紙類型 1:58mm,2::80mm
int
printWidth
;
//打印出來的內容寬度
if
(
paperType
==
1
)
{
...
...
print-module/src/main/java/com/joe/print/mvp/print/service/PrjService.java
0 → 100644
View file @
fd2e5345
package
com
.
joe
.
print
.
mvp
.
print
.
service
;
import
android.app.Service
;
import
android.content.Intent
;
import
android.os.IBinder
;
import
android.util.Log
;
import
androidx.annotation.Nullable
;
import
com.jess.arms.integration.RepositoryManager
;
import
com.joe.print.mvp.model.server.GetPrintInfoService
;
import
java.util.concurrent.TimeUnit
;
import
javax.inject.Inject
;
import
io.reactivex.Observable
;
import
io.reactivex.Observer
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.disposables.Disposable
;
import
io.reactivex.schedulers.Schedulers
;
import
me.jessyan.rxerrorhandler.core.RxErrorHandler
;
import
me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber
;
/**
* 在用戶登錄成功後,打開打印service,每隔3~5秒請求一次。請求到了數據就進行打印邏輯
*/
public
class
PrjService
extends
Service
{
private
final
String
TAG
=
"PrjService"
;
@Inject
RxErrorHandler
mErrorHandler
;
@Override
public
void
onCreate
()
{
super
.
onCreate
();
Log
.
e
(
"eee"
,
"打開打印服務"
);
//開始請求
Observable
.
interval
(
0
,
3
,
TimeUnit
.
SECONDS
)
.
doOnNext
(
aLong
->{
Log
.
d
(
TAG
,
"第"
+
aLong
+
"次輪詢"
);
/*
* 步骤3:通过Retrofit发送网络请求
*
**/
new
RepositoryManager
().
obtainRetrofitService
(
GetPrintInfoService
.
class
)
.
getPrintInfo
(
"26"
)
.
subscribeOn
(
Schedulers
.
io
())
.
doOnSubscribe
(
disposable
->
{})
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
doAfterTerminate
(()
->
{})
.
subscribe
(
new
ErrorHandleSubscriber
<
Object
>(
mErrorHandler
)
{
@Override
public
void
onNext
(
Object
o
)
{
Log
.
e
(
"eee"
,
"请求到:"
+
o
);
}
@Override
public
void
onError
(
Throwable
t
)
{
super
.
onError
(
t
);
t
.
printStackTrace
();
}
});
}).
subscribe
(
new
Observer
<
Long
>()
{
@Override
public
void
onSubscribe
(
Disposable
d
)
{
}
@Override
public
void
onNext
(
Long
aLong
)
{
}
@Override
public
void
onError
(
Throwable
e
)
{
Log
.
d
(
TAG
,
"对Error事件作出响应"
+
e
.
getMessage
());
}
@Override
public
void
onComplete
()
{
Log
.
d
(
TAG
,
"对onComplete事件作出响应"
);
}
});
}
@Nullable
@Override
public
IBinder
onBind
(
Intent
intent
)
{
return
null
;
}
}
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrintActivity.java
View file @
fd2e5345
...
...
@@ -67,7 +67,7 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
public
final
static
int
FINISH
=
1003
;
//關閉頁面
public
final
static
int
ADD_PRINT_DEVICE
=
1004
;
//添加打印機
p
rivate
static
List
<
PrinterDeviceBean
>
printerDeviceBeans
;
p
ublic
static
List
<
PrinterDeviceBean
>
printerDeviceBeans
;
private
String
callId
;
private
PrinterRoot
printerInIt
;
...
...
@@ -111,22 +111,28 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
PrinterDeviceBean
deviceBean
=
(
PrinterDeviceBean
)
getIntent
().
getSerializableExtra
(
"deviceBean"
);
// if (type != PrinterRoot.PRINT_TEST) {
//不是测试才去获取打印机列表,获取到打印机列表之后就进行打印
mPresenter
.
getPrinterList
(
GsaCloudApplication
.
getRestaurantId
(
mContext
));
//不是测试才去获取打印机列表,获取到打印机列表之后就进行打印
// }
printerInIt
=
PrinterRoot
.
getPrinterByType
(
type
);
if
(
printerInIt
!=
null
)
{
printerInIt
.
setmContext
(
mContext
).
setPrintListener
(
this
);
}
printerInIt
.
print
(
printerDeviceBeans
);
// if (type == PrinterRoot.PRINT_TEST) {
// if (deviceBean != null) {
// printerInIt.ipDevicePrint(deviceBean, printerInIt.getPrintBitmap(mContext).get(""));
// } else {
// ToastUtils.show(mContext, "测试失败");
// }
// }
if
(
type
==
PrinterRoot
.
PRINT_TEST
)
{
if
(
deviceBean
!=
null
)
{
printerInIt
.
ipDevicePrint
(
deviceBean
,
printerInIt
.
getPrintBitmap
(
mContext
).
get
(
""
));
}
else
{
ToastUtils
.
show
(
mContext
,
"测试失败"
);
}
}
else
{
if
(
printerDeviceBeans
==
null
||
printerDeviceBeans
.
size
()
<=
0
)
{
mPresenter
.
getPrinterList
(
GsaCloudApplication
.
getRestaurantId
(
mContext
));
}
else
{
printerInIt
.
print
(
printerDeviceBeans
);
}
}
}
private
void
initDialog
()
{
...
...
@@ -297,12 +303,8 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
@Override
public
void
showPrinterList
(
List
<
PrinterDeviceBean
>
deviceBeans
)
{
// if (deviceBeans != null && deviceBeans.size() > 0) {
printerDeviceBeans
=
deviceBeans
;
// } else {
// //沒有配置打印機
// addPrintDevice();
// }
printerInIt
.
print
(
printerDeviceBeans
);
}
private
void
addPrintDevice
()
{
...
...
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrinterAddActivity.java
View file @
fd2e5345
...
...
@@ -182,10 +182,6 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
ipAddress
.
append
(
editText
.
getText
());
ipAddress
.
append
(
"."
);
}
// if (etPort.getText() == null || etPort.getText().toString().equals("")) {
// showMessage("請輸入端口號");
// return;
// }
hideKeyBoard
();
int
paperType
=
1
;
//打印紙類型
...
...
print-module/src/main/java/com/joe/print/mvp/ui/activity/aaa.java
0 → 100644
View file @
fd2e5345
package
com
.
joe
.
print
.
mvp
.
ui
.
activity
;
class
aaa
{
public
static
void
main
(
String
[]
age
)
{
int
[]
arr
=
new
int
[]{
4
,
1
,
8
,
5
,
3
,
2
,
9
,
10
,
6
,
7
};
int
[]
brr
=
new
int
[]{
5
,
1
,
2
,
3
,
8
,
4
,
9
,
10
,
6
,
7
};
partition
(
arr
,
0
,
9
);
for
(
int
i
=
0
;
i
<
arr
.
length
;
i
++)
{
System
.
out
.
print
(
arr
[
i
]
+
","
);
}
}
public
static
void
quickSort
(
int
[]
arr
,
int
startIndex
,
int
endIndex
)
{
if
(
arr
!=
null
&&
arr
.
length
>
0
)
{
int
start
=
startIndex
,
end
=
endIndex
;
int
target
=
arr
[
startIndex
];
while
(
start
<
end
)
{
while
(
start
<
end
)
{
if
(
arr
[
end
]
<
target
)
{
swap
(
arr
,
start
,
end
);
break
;
}
else
{
end
--;
}
}
while
(
start
<
end
)
{
if
(
arr
[
start
]
>
target
)
{
swap
(
arr
,
start
,
end
);
break
;
}
else
{
start
++;
}
}
}
}
}
public
static
void
swap
(
int
[]
arr
,
int
index1
,
int
index2
)
{
int
a
=
arr
[
index1
];
arr
[
index1
]
=
arr
[
index2
];
arr
[
index2
]
=
a
;
}
// public static int[] getLeastNumbers(int[] arr, int k) {
// if (k == 0 || arr.length == 0) {
// return new int[0];
// }
// // 最后一个参数表示我们要找的是下标为k-1的数
// return quickSearch(arr, 0, arr.length - 1, k - 1);
// }
//
// private static int[] quickSearch(int[] nums, int lo, int hi, int k) {
// // 每快排切分1次,找到排序后下标为j的元素,如果j恰好等于k就返回j以及j左边所有的数;
// int j = partition(nums, lo, hi);
// if (j == k) {
// return Arrays.copyOf(nums, j + 1);
// }
// // 否则根据下标j与k的大小关系来决定继续切分左段还是右段。
// return j > k ? quickSearch(nums, lo, j - 1, k) : quickSearch(nums, j + 1, hi, k);
// }
//
// // 快排切分,返回下标j,使得比nums[j]小的数都在j的左边,比nums[j]大的数都在j的右边。
private
static
void
partition
(
int
[]
nums
,
int
lo
,
int
hi
)
{
int
k
=
nums
[
lo
];
int
i
=
lo
,
j
=
hi
+
1
;
while
(
true
)
{
while
(++
i
<=
hi
&&
nums
[
i
]
<
k
);
while
(--
j
>=
lo
&&
nums
[
j
]
>
k
);
if
(
i
>=
j
)
{
break
;
}
// int t = nums[j];最近更新
// nums[j] = nums[i];
// nums[i] = t;
swap
(
nums
,
i
,
j
);
}
nums
[
lo
]
=
nums
[
j
];
nums
[
j
]
=
k
;
swap
(
nums
,
i
,
j
);
}
}
\ No newline at end of file
print-module/src/main/java/com/joe/print/mvp/ui/adapter/OtherOrderAdapter.java
View file @
fd2e5345
package
com
.
joe
.
print
.
mvp
.
ui
.
adapter
;
import
android.content.Context
;
import
android.util.Log
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.widget.ImageView
;
...
...
@@ -14,14 +15,17 @@ import com.chad.library.adapter.base.BaseViewHolder;
import
com.gingersoft.gsa.cloud.print.bean.OrderDetails
;
import
com.joe.print.R
;
import
org.w3c.dom.Text
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
static
com
.
qmuiteam
.
qmui
.
util
.
QMUIDisplayHelper
.
dp2px
;
import
static
com
.
qmuiteam
.
qmui
.
util
.
QMUIDisplayHelper
.
px2dp
;
public
class
OtherOrderAdapter
extends
BaseQuickAdapter
<
OrderDetails
.
DataBean
.
PRODUCTNAMEBean
,
BaseViewHolder
>
{
private
Context
context
;
private
int
indentation
;
private
int
indentation
=
5
;
private
boolean
isShowPrice
;
public
OtherOrderAdapter
(
Context
context
,
@Nullable
List
<
OrderDetails
.
DataBean
.
PRODUCTNAMEBean
>
data
,
boolean
isShowPrice
)
{
...
...
@@ -33,11 +37,13 @@ public class OtherOrderAdapter extends BaseQuickAdapter<OrderDetails.DataBean.PR
@Override
protected
void
convert
(
BaseViewHolder
helper
,
OrderDetails
.
DataBean
.
PRODUCTNAMEBean
item
)
{
helper
.
setText
(
R
.
id
.
tv_food_name
,
item
.
getPRODUCT_NAME
());
helper
.
setText
(
R
.
id
.
tv_food_number
,
item
.
getNum
());
helper
.
setText
(
R
.
id
.
tv_food_number
,
"x"
+
item
.
getNum
());
helper
.
setText
(
R
.
id
.
tv_food_price
,
item
.
getPRICE
());
helper
.
getView
(
R
.
id
.
tv_food_price
).
setVisibility
(
isShowPrice
?
View
.
VISIBLE
:
View
.
GONE
);
helper
.
getView
(
R
.
id
.
tv_food_price
).
setVisibility
(
isShowPrice
?
View
.
VISIBLE
:
View
.
INVISIBLE
);
if
(
helper
.
getAdapterPosition
()
==
0
)
{
indentation
=
new
BigDecimal
(((
TextView
)
helper
.
getView
(
R
.
id
.
tv_food_name
)).
getPaint
().
measureText
(
"哈"
)).
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
intValue
();
indentation
=
px2dp
(
context
,
(
int
)
((
TextView
)
helper
.
getView
(
R
.
id
.
tv_food_name
)).
getTextSize
());
Log
.
e
(
"eee"
,
"寬度:"
+
indentation
);
}
if
(
item
.
getChild
()
!=
null
&&
item
.
getChild
().
size
()
>
0
)
{
...
...
@@ -58,11 +64,12 @@ public class OtherOrderAdapter extends BaseQuickAdapter<OrderDetails.DataBean.PR
private
View
getChild
(
String
foodName
,
String
foodNum
,
String
price
,
int
leftMargin
)
{
View
view
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
print_other_order_food_item
,
null
,
false
);
ImageView
ivNext
=
view
.
findViewById
(
R
.
id
.
iv_food_item_next
);
ivNext
.
setPadding
(
dp2px
(
context
,
leftMargin
),
0
,
0
,
0
);
((
TextView
)
view
.
findViewById
(
R
.
id
.
tv_food_name
)).
setText
(
foodName
);
((
TextView
)
view
.
findViewById
(
R
.
id
.
tv_food_number
)).
setText
(
foodNum
);
// ((TextView) view.findViewById(R.id.tv_food_price)).setText(price);
TextView
tvFoodName
=
view
.
findViewById
(
R
.
id
.
tv_food_name
);
tvFoodName
.
setPadding
(
dp2px
(
context
,
leftMargin
),
0
,
0
,
0
);
tvFoodName
.
setText
(
"-"
+
foodName
);
((
TextView
)
view
.
findViewById
(
R
.
id
.
tv_food_number
)).
setText
(
"x"
+
foodNum
);
((
TextView
)
view
.
findViewById
(
R
.
id
.
tv_food_price
)).
setText
(
price
);
view
.
findViewById
(
R
.
id
.
tv_food_price
).
setVisibility
(
isShowPrice
?
View
.
VISIBLE
:
View
.
INVISIBLE
);
return
view
;
}
...
...
print-module/src/main/res/layout/print_confirm_order_view.xml
View file @
fd2e5345
This diff is collapsed.
Click to expand it.
print-module/src/main/res/layout/print_other_order_food_item.xml
View file @
fd2e5345
...
...
@@ -55,7 +55,7 @@
android:layout_height=
"wrap_content"
android:gravity=
"right"
android:textColor=
"@color/theme_333_color"
android:visibility=
"
gon
e"
android:visibility=
"
invisibl
e"
android:textSize=
"@dimen/dp_20"
app:layout_constraintHorizontal_weight=
"0.2"
app:layout_constraintLeft_toRightOf=
"@id/tv_food_number"
...
...
public-base/src/main/java/com/gingersoft/gsa/cloud/base/application/GsaCloudApplication.java
View file @
fd2e5345
...
...
@@ -150,7 +150,7 @@ public class GsaCloudApplication extends BaseApplication {
}
}
else
{
//如果當前機型不是上面兩種,那麼設置默認打印為ip打印
//
SPUtils.put(this, Constans.DEFAULT_PRINT_METHOD, Constans.IP_PRINT);
SPUtils
.
put
(
this
,
Constans
.
DEFAULT_PRINT_METHOD
,
Constans
.
IP_PRINT
);
}
//需要單獨配置域名URL的,在接口上添加@Headers({"Domain-Name: settlement_report_server"}),不添加則是使用默認域名
setGlobalDomain
();
...
...
public-base/src/main/java/com/gingersoft/gsa/cloud/ui/widget/dialog/LoadingDialog.java
View file @
fd2e5345
package
com
.
gingersoft
.
gsa
.
cloud
.
ui
.
widget
.
dialog
;
import
android.app.Activity
;
import
android.app.Dialog
;
import
android.content.Context
;
import
android.graphics.Color
;
...
...
@@ -11,6 +10,7 @@ import android.view.View;
import
android.view.Window
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
com.gingersoft.gsa.cloud.base.R
;
...
...
public-base/src/main/res/drawable/shape_app_btn_unclickable.xml
0 → 100644
View file @
fd2e5345
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:radius=
"@dimen/dp_8"
/>
<solid
android:color=
"@color/transparent_sixty_theme_color"
/>
</shape>
\ No newline at end of file
public-base/src/main/res/transition/activity_fade.xml
0 → 100644
View file @
fd2e5345
<?xml version="1.0" encoding="utf-8"?>
<fade
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:duration=
"1000"
/>
public-base/src/main/res/transition/activity_slide.xml
0 → 100644
View file @
fd2e5345
<?xml version="1.0" encoding="utf-8"?>
<slide
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:duration=
"1000"
/>
\ No newline at end of file
public-base/src/main/res/values-v21/styles.xml
0 → 100644
View file @
fd2e5345
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style
name=
"AppTheme"
parent=
"PublicTheme"
>
<item
name=
"QMUITopBarStyle"
>
@style/QDTopBar
</item>
<item
name=
"QMUITabSegmentStyle"
>
@style/QMUITabSegmentStyle
</item>
<item
name=
"android:windowActivityTransitions"
>
true
</item>
</style>
</resources>
\ No newline at end of file
public-base/src/main/res/values/strings.xml
View file @
fd2e5345
...
...
@@ -144,5 +144,5 @@
<string
name=
"wai"
>
外
</string>
<string
name=
"amount_unit"
>
$
</string>
<string
name=
"print_split_line"
>
------------------------------------------------------------------------------------------------------
</string>
<string
name=
"print_split_line"
>
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
</string>
</resources>
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/presenter/BaseLoginPresenter.java
View file @
fd2e5345
...
...
@@ -3,7 +3,9 @@ package com.gingersoft.gsa.cloud.user.login.mvp.presenter;
import
android.app.Activity
;
import
android.app.Application
;
import
android.content.Intent
;
import
android.util.Log
;
import
com.billy.cc.core.component.CC
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.LoginBean
;
import
com.gingersoft.gsa.cloud.user.login.mvp.contract.BaseLoginContract
;
...
...
@@ -79,6 +81,11 @@ public class BaseLoginPresenter<M extends BaseLoginContract.Model, V extends Bas
GsaCloudApplication
.
userName
=
info
.
getData
().
getUser
().
getUserName
();
mRootView
.
showMessage
(
"登陸成功"
);
mRootView
.
loginSuccess
(
info
);
//開啟打印服務
CC
.
obtainBuilder
(
"Component.Print"
)
.
setActionName
(
"openPrintService"
)
.
build
()
.
call
();
}
else
{
GsaCloudApplication
.
isLogin
=
false
;
mRootView
.
showMessage
(
info
.
getErrMsg
());
...
...
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/di/component/RecoverPasswordComponent.java
0 → 100644
View file @
fd2e5345
package
com
.
gingersoft
.
gsa
.
cloud
.
user
.
login
.
mvp
.
ui
.
activity
.
di
.
component
;
import
dagger.Component
;
import
com.jess.arms.di.component.AppComponent
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.di.module.RecoverPasswordModule
;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.mvp.ui.activity.RecoverPasswordActivity
;
@ActivityScope
@Component
(
modules
=
RecoverPasswordModule
.
class
,
dependencies
=
AppComponent
.
class
)
public
interface
RecoverPasswordComponent
{
void
inject
(
RecoverPasswordActivity
activity
);
}
\ No newline at end of file
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/di/module/RecoverPasswordModule.java
0 → 100644
View file @
fd2e5345
package
com
.
gingersoft
.
gsa
.
cloud
.
user
.
login
.
mvp
.
ui
.
activity
.
di
.
module
;
import
com.jess.arms.di.scope.ActivityScope
;
import
dagger.Module
;
import
dagger.Provides
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.mvp.contract.RecoverPasswordContract
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.mvp.model.RecoverPasswordModel
;
@Module
public
class
RecoverPasswordModule
{
private
RecoverPasswordContract
.
View
view
;
/**
* 构建RecoverPasswordModule时,将View的实现类传进来,这样就可以提供View的实现类给presenter
* @param view
*/
public
RecoverPasswordModule
(
RecoverPasswordContract
.
View
view
)
{
this
.
view
=
view
;
}
@ActivityScope
@Provides
RecoverPasswordContract
.
View
provideRecoverPasswordView
(){
return
this
.
view
;
}
@ActivityScope
@Provides
RecoverPasswordContract
.
Model
provideRecoverPasswordModel
(
RecoverPasswordModel
model
){
return
model
;
}
}
\ No newline at end of file
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/mvp/contract/RecoverPasswordContract.java
0 → 100644
View file @
fd2e5345
package
com
.
gingersoft
.
gsa
.
cloud
.
user
.
login
.
mvp
.
ui
.
activity
.
mvp
.
contract
;
import
com.jess.arms.mvp.IView
;
import
com.jess.arms.mvp.IModel
;
public
interface
RecoverPasswordContract
{
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface
View
extends
IView
{
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface
Model
extends
IModel
{
}
}
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/mvp/model/RecoverPasswordModel.java
0 → 100644
View file @
fd2e5345
package
com
.
gingersoft
.
gsa
.
cloud
.
user
.
login
.
mvp
.
ui
.
activity
.
mvp
.
model
;
import
android.app.Application
;
import
com.google.gson.Gson
;
import
com.jess.arms.integration.IRepositoryManager
;
import
com.jess.arms.mvp.BaseModel
;
import
com.jess.arms.di.scope.ActivityScope
;
import
javax.inject.Inject
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.mvp.contract.RecoverPasswordContract
;
@ActivityScope
public
class
RecoverPasswordModel
extends
BaseModel
implements
RecoverPasswordContract
.
Model
{
@Inject
Gson
mGson
;
@Inject
Application
mApplication
;
@Inject
public
RecoverPasswordModel
(
IRepositoryManager
repositoryManager
)
{
super
(
repositoryManager
);
}
@Override
public
void
onDestroy
()
{
super
.
onDestroy
();
this
.
mGson
=
null
;
this
.
mApplication
=
null
;
}
}
\ No newline at end of file
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/mvp/presenter/RecoverPasswordPresenter.java
0 → 100644
View file @
fd2e5345
package
com
.
gingersoft
.
gsa
.
cloud
.
user
.
login
.
mvp
.
ui
.
activity
.
mvp
.
presenter
;
import
android.app.Application
;
import
com.jess.arms.integration.AppManager
;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.jess.arms.mvp.BasePresenter
;
import
com.jess.arms.http.imageloader.ImageLoader
;
import
me.jessyan.rxerrorhandler.core.RxErrorHandler
;
import
javax.inject.Inject
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.mvp.contract.RecoverPasswordContract
;
@ActivityScope
public
class
RecoverPasswordPresenter
extends
BasePresenter
<
RecoverPasswordContract
.
Model
,
RecoverPasswordContract
.
View
>
{
@Inject
RxErrorHandler
mErrorHandler
;
@Inject
Application
mApplication
;
@Inject
ImageLoader
mImageLoader
;
@Inject
AppManager
mAppManager
;
@Inject
public
RecoverPasswordPresenter
(
RecoverPasswordContract
.
Model
model
,
RecoverPasswordContract
.
View
rootView
)
{
super
(
model
,
rootView
);
}
@Override
public
void
onDestroy
()
{
super
.
onDestroy
();
this
.
mErrorHandler
=
null
;
this
.
mAppManager
=
null
;
this
.
mImageLoader
=
null
;
this
.
mApplication
=
null
;
}
}
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/mvp/ui/activity/RecoverPasswordActivity.java
0 → 100644
View file @
fd2e5345
package
com
.
gingersoft
.
gsa
.
cloud
.
user
.
login
.
mvp
.
ui
.
activity
.
mvp
.
ui
.
activity
;
import
android.content.Intent
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.transition.Explode
;
import
android.transition.Fade
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
android.transition.Transition
;
import
android.transition.TransitionInflater
;
import
android.view.Window
;
import
com.gingersoft.gsa.cloud.user.login.R
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.di.component.DaggerRecoverPasswordComponent
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.di.module.RecoverPasswordModule
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.mvp.contract.RecoverPasswordContract
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.mvp.presenter.RecoverPasswordPresenter
;
import
com.jess.arms.base.BaseActivity
;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.utils.ArmsUtils
;
import
static
com
.
jess
.
arms
.
utils
.
Preconditions
.
checkNotNull
;
public
class
RecoverPasswordActivity
extends
BaseActivity
<
RecoverPasswordPresenter
>
implements
RecoverPasswordContract
.
View
{
@Override
public
void
setupActivityComponent
(
@NonNull
AppComponent
appComponent
)
{
DaggerRecoverPasswordComponent
//如找不到该类,请编译一下项目
.
builder
()
.
appComponent
(
appComponent
)
.
recoverPasswordModule
(
new
RecoverPasswordModule
(
this
))
.
build
()
.
inject
(
this
);
}
// @Override
// protected void onCreate(@Nullable Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// Fade fade = new Fade();
// fade.setDuration(1000);
// getWindow().setEnterTransition(fade);
// }
// }
@Override
public
int
initView
(
@Nullable
Bundle
savedInstanceState
)
{
return
R
.
layout
.
layout_recover_password
;
//如果你不需要框架帮你设置 setContentView(id) 需要自行设置,请返回 0
}
@Override
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
}
@Override
public
void
initIntent
()
{
}
@Override
public
void
initTopBar
()
{
findViewById
(
R
.
id
.
iv_recover_pwd_back
).
setOnClickListener
(
v
->
killMyself
());
}
@Override
public
void
initLanguage
()
{
}
@Override
public
void
initLayoutParams
()
{
}
@Override
public
void
initLayoutVisible
()
{
}
@Override
public
void
showLoading
(
String
message
)
{
}
@Override
public
void
hideLoading
()
{
}
@Override
public
void
showMessage
(
@NonNull
String
message
)
{
checkNotNull
(
message
);
ArmsUtils
.
snackbarText
(
message
);
}
@Override
public
void
launchActivity
(
@NonNull
Intent
intent
)
{
checkNotNull
(
intent
);
ArmsUtils
.
startActivity
(
intent
);
}
@Override
public
void
killMyself
()
{
finish
();
}
}
user-login/src/main/res/drawable/selector_login_btn.xml
0 → 100644
View file @
fd2e5345
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:drawable=
"@drawable/shape_app_btn"
android:state_checkable=
"true"
/>
<item
android:drawable=
"@drawable/shape_app_btn"
android:state_focused=
"true"
/>
<item
android:drawable=
"@drawable/shape_app_btn_unclickable"
/>
</selector>
\ No newline at end of file
user-login/src/main/res/layout/activity_recover_password.xml
0 → 100644
View file @
fd2e5345
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:orientation=
"vertical"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
</LinearLayout>
\ No newline at end of file
user-login/src/main/res/layout/layout_recover_password.xml
0 → 100644
View file @
fd2e5345
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:custom=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
android:fitsSystemWindows=
"true"
android:orientation=
"vertical"
>
<ImageView
android:id=
"@+id/iv_recover_pwd_back"
android:layout_width=
"wrap_content"
android:paddingLeft=
"@dimen/dp_15"
android:layout_height=
"?attr/qmui_topbar_height"
android:src=
"@drawable/ic_black_back"
custom:layout_constraintLeft_toLeftOf=
"parent"
custom:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/welcome_forget_pwd"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_40"
android:text=
"找回密碼"
android:textSize=
"@dimen/dp_26"
custom:layout_constraintLeft_toLeftOf=
"parent"
custom:layout_constraintRight_toRightOf=
"parent"
custom:layout_constraintTop_toBottomOf=
"@id/iv_recover_pwd_back"
/>
<TextView
android:id=
"@+id/tv_forget_pwd_phone_number"
style=
"@style/user_login_edit_title_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_15"
android:layout_marginTop=
"@dimen/dp_55"
android:text=
"手機號"
custom:layout_constraintLeft_toLeftOf=
"parent"
custom:layout_constraintTop_toBottomOf=
"@id/welcome_forget_pwd"
/>
<com.google.android.material.textfield.TextInputEditText
android:id=
"@+id/forget_mobile"
style=
"@style/user_login_edit_style"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:hint=
"請輸入手機號"
android:inputType=
"phone"
android:maxLength=
"11"
custom:layout_constraintLeft_toLeftOf=
"@id/tv_forget_pwd_phone_number"
custom:layout_constraintRight_toLeftOf=
"@id/btn_get_verify_code"
custom:layout_constraintTop_toBottomOf=
"@id/tv_forget_pwd_phone_number"
/>
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id=
"@+id/btn_get_verify_code"
android:layout_width=
"wrap_content"
android:layout_height=
"0dp"
android:background=
"@drawable/shape_app_btn"
android:gravity=
"center"
android:paddingLeft=
"@dimen/dp_14"
android:paddingRight=
"@dimen/dp_14"
android:text=
"獲取驗證碼"
android:textColor=
"@color/white"
custom:layout_constraintBottom_toBottomOf=
"@id/forget_mobile"
custom:layout_constraintRight_toRightOf=
"@id/line_phone_edit"
custom:layout_constraintTop_toTopOf=
"@id/forget_mobile"
/>
<View
android:id=
"@+id/line_phone_edit"
android:layout_width=
"0dp"
android:layout_height=
"@dimen/dp_1"
android:layout_marginLeft=
"@dimen/dp_15"
android:layout_marginRight=
"@dimen/dp_15"
android:background=
"@color/user_login_line_color"
custom:layout_constraintLeft_toLeftOf=
"parent"
custom:layout_constraintRight_toRightOf=
"parent"
custom:layout_constraintTop_toBottomOf=
"@id/forget_mobile"
/>
<TextView
android:id=
"@+id/tv_forget_pwd_verify"
style=
"@style/user_login_edit_title_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_30"
android:text=
"驗證碼"
custom:layout_constraintLeft_toLeftOf=
"@id/tv_forget_pwd_phone_number"
custom:layout_constraintTop_toBottomOf=
"@id/line_phone_edit"
/>
<com.google.android.material.textfield.TextInputEditText
android:id=
"@+id/forget_verify"
style=
"@style/user_login_edit_style"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:hint=
"請輸入驗證碼"
android:inputType=
"phone"
android:maxLength=
"6"
custom:layout_constraintLeft_toLeftOf=
"@id/line_phone_edit"
custom:layout_constraintRight_toRightOf=
"@id/line_phone_edit"
custom:layout_constraintTop_toBottomOf=
"@id/tv_forget_pwd_verify"
/>
<View
android:id=
"@+id/line_verify_code"
android:layout_width=
"0dp"
android:layout_height=
"@dimen/dp_1"
android:background=
"@color/user_login_line_color"
custom:layout_constraintLeft_toLeftOf=
"@id/line_phone_edit"
custom:layout_constraintRight_toRightOf=
"@id/line_phone_edit"
custom:layout_constraintTop_toBottomOf=
"@id/forget_verify"
/>
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id=
"@+id/next_step_btn"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"@dimen/dp_20"
android:background=
"@drawable/shape_app_btn"
android:gravity=
"center"
android:text=
"下一步"
android:textColor=
"@color/white"
custom:layout_constraintBottom_toBottomOf=
"parent"
custom:layout_constraintLeft_toLeftOf=
"@id/line_phone_edit"
custom:layout_constraintRight_toRightOf=
"@id/line_phone_edit"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
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