车辆类型接口替换
This commit is contained in:
parent
fe4b14176e
commit
6054bc3159
@ -72,6 +72,19 @@ interface Api {
|
|||||||
): Observable<CommonResponseBean<MutableList<DiCarColor>>>
|
): Observable<CommonResponseBean<MutableList<DiCarColor>>>
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询车辆类型字典
|
||||||
|
* @param name String
|
||||||
|
* @param groupType String (0=车头,1=挂车)
|
||||||
|
* @return Observable<CommonResponseBean<MutableList<DiCarColor>>>
|
||||||
|
*/
|
||||||
|
@GET(BASE_URL + "driver/common/dict/selectCarTypeVoAll")
|
||||||
|
fun selectCarTypeVoAll(
|
||||||
|
@Query("name") name: String,
|
||||||
|
@Query("groupType") groupType: String
|
||||||
|
): Observable<CommonResponseBean<MutableList<DiCarColor>>>
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取验证码
|
* 获取验证码
|
||||||
* */
|
* */
|
||||||
|
@ -157,7 +157,7 @@ class AuthDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
|
|||||||
|
|
||||||
//识别车辆类型后,调用接口匹配code值!!!???
|
//识别车辆类型后,调用接口匹配code值!!!???
|
||||||
DicUtils.getInstance()
|
DicUtils.getInstance()
|
||||||
.getCarTypeByValue(mContext, it.vehicleType) { position, item ->
|
.getCarTypeByValue(mContext, it.vehicleType,"0") { position, item ->
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
var data = item as DiCarColor
|
var data = item as DiCarColor
|
||||||
upDrivingInfoBean.run {
|
upDrivingInfoBean.run {
|
||||||
|
@ -54,7 +54,8 @@ class AuthTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
|
|||||||
mContext,
|
mContext,
|
||||||
this@AuthTrailerActivity,
|
this@AuthTrailerActivity,
|
||||||
"重型自卸半挂车",
|
"重型自卸半挂车",
|
||||||
true
|
true,
|
||||||
|
"1"
|
||||||
) { position, item ->
|
) { position, item ->
|
||||||
var data = item as DiCarColor
|
var data = item as DiCarColor
|
||||||
tvCarType.text = data.dictLabel
|
tvCarType.text = data.dictLabel
|
||||||
@ -123,7 +124,7 @@ class AuthTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
|
|||||||
|
|
||||||
//识别车辆类型后,调用接口匹配code值!!!???
|
//识别车辆类型后,调用接口匹配code值!!!???
|
||||||
DicUtils.getInstance()
|
DicUtils.getInstance()
|
||||||
.getCarTypeByValue(mContext, it.vehicleType) { position, item ->
|
.getCarTypeByValue(mContext, it.vehicleType,"1") { position, item ->
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
var data = item as DiCarColor
|
var data = item as DiCarColor
|
||||||
upDrivingInfoBean.run {
|
upDrivingInfoBean.run {
|
||||||
|
@ -210,7 +210,7 @@ class EditDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
|
|||||||
|
|
||||||
//识别车辆类型后,调用接口匹配code值!!!???
|
//识别车辆类型后,调用接口匹配code值!!!???
|
||||||
DicUtils.getInstance()
|
DicUtils.getInstance()
|
||||||
.getCarTypeByValue(mContext, it.vehicleType) { position, item ->
|
.getCarTypeByValue(mContext, it.vehicleType,"0") { position, item ->
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
var data = item as DiCarColor
|
var data = item as DiCarColor
|
||||||
upDrivingInfoBean.run {
|
upDrivingInfoBean.run {
|
||||||
|
@ -56,7 +56,8 @@ class EditTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
|
|||||||
mContext,
|
mContext,
|
||||||
this@EditTrailerActivity,
|
this@EditTrailerActivity,
|
||||||
"重型自卸半挂车",
|
"重型自卸半挂车",
|
||||||
true
|
true,
|
||||||
|
"1"
|
||||||
) { _, item ->
|
) { _, item ->
|
||||||
var data = item as DiCarColor
|
var data = item as DiCarColor
|
||||||
tvCarType.text = data.dictLabel
|
tvCarType.text = data.dictLabel
|
||||||
@ -171,7 +172,7 @@ class EditTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
|
|||||||
|
|
||||||
//识别车辆类型后,调用接口匹配code值!!!???
|
//识别车辆类型后,调用接口匹配code值!!!???
|
||||||
DicUtils.getInstance()
|
DicUtils.getInstance()
|
||||||
.getCarTypeByValue(mContext, it.vehicleType) { position, item ->
|
.getCarTypeByValue(mContext, it.vehicleType,"1") { position, item ->
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
var data = item as DiCarColor
|
var data = item as DiCarColor
|
||||||
upDrivingInfoBean.run {
|
upDrivingInfoBean.run {
|
||||||
|
@ -34,26 +34,53 @@ class DicUtils private constructor() {
|
|||||||
activity: AppCompatActivity,
|
activity: AppCompatActivity,
|
||||||
defaultCont: String = "重型半挂牵引车",
|
defaultCont: String = "重型半挂牵引车",
|
||||||
isLoading: Boolean = false,
|
isLoading: Boolean = false,
|
||||||
|
groupType: String = "0",
|
||||||
listener: OnOptionPickedListener
|
listener: OnOptionPickedListener
|
||||||
) {
|
) {
|
||||||
//车辆类型
|
//车辆类型
|
||||||
DataManager.getInstance().getSysDictDataList("vehicle_type")
|
DataManager.getInstance().selectCarTypeVoAll("",groupType)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(
|
.subscribe(
|
||||||
BaseObserver(context, object : RxHttpCallBack<MutableList<DiCarColor>>(if (isLoading) activity else null) {
|
BaseObserver(
|
||||||
override fun onSuccess(t: CommonResponseBean<MutableList<DiCarColor>>) {
|
context,
|
||||||
super.onSuccess(t)
|
object :
|
||||||
PickerUtils.getInstance()
|
RxHttpCallBack<MutableList<DiCarColor>>(if (isLoading) activity else null) {
|
||||||
.showSelectCarColor(
|
override fun onSuccess(t: CommonResponseBean<MutableList<DiCarColor>>) {
|
||||||
activity,
|
super.onSuccess(t)
|
||||||
"车辆类型",
|
PickerUtils.getInstance()
|
||||||
"重型半挂牵引车",
|
.showSelectCarColor(
|
||||||
t.data, listener
|
activity,
|
||||||
)
|
"车辆类型",
|
||||||
}
|
"重型半挂牵引车",
|
||||||
})
|
t.data, listener
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
// //车辆类型
|
||||||
|
// DataManager.getInstance().getSysDictDataList("vehicle_type")
|
||||||
|
// .subscribeOn(Schedulers.io())
|
||||||
|
// .observeOn(AndroidSchedulers.mainThread())
|
||||||
|
// .subscribe(
|
||||||
|
// BaseObserver(
|
||||||
|
// context,
|
||||||
|
// object :
|
||||||
|
// RxHttpCallBack<MutableList<DiCarColor>>(if (isLoading) activity else null) {
|
||||||
|
// override fun onSuccess(t: CommonResponseBean<MutableList<DiCarColor>>) {
|
||||||
|
// super.onSuccess(t)
|
||||||
|
// PickerUtils.getInstance()
|
||||||
|
// .showSelectCarColor(
|
||||||
|
// activity,
|
||||||
|
// "车辆类型",
|
||||||
|
// "重型半挂牵引车",
|
||||||
|
// t.data, listener
|
||||||
|
// )
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// )
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -65,10 +92,13 @@ class DicUtils private constructor() {
|
|||||||
fun getCarTypeByValue(
|
fun getCarTypeByValue(
|
||||||
context: Context,
|
context: Context,
|
||||||
value: String,
|
value: String,
|
||||||
|
groupType: String = "0",
|
||||||
listener: OnOptionPickedListener
|
listener: OnOptionPickedListener
|
||||||
) {
|
) {
|
||||||
|
if (value.isNullOrEmpty())
|
||||||
|
return
|
||||||
//车辆类型
|
//车辆类型
|
||||||
DataManager.getInstance().getSysDictDataList("vehicle_type")
|
DataManager.getInstance().selectCarTypeVoAll(value, groupType)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(
|
.subscribe(
|
||||||
@ -80,6 +110,20 @@ class DicUtils private constructor() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
//车辆类型
|
||||||
|
// DataManager.getInstance().getSysDictDataList("vehicle_type")
|
||||||
|
// .subscribeOn(Schedulers.io())
|
||||||
|
// .observeOn(AndroidSchedulers.mainThread())
|
||||||
|
// .subscribe(
|
||||||
|
// BaseObserver(context, object : RxHttpCallBack<MutableList<DiCarColor>>() {
|
||||||
|
// override fun onSuccess(t: CommonResponseBean<MutableList<DiCarColor>>) {
|
||||||
|
// super.onSuccess(t)
|
||||||
|
// var first = t.data?.firstOrNull { it.dictLabel == value }
|
||||||
|
// listener.onOptionPicked(0, first)
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -91,25 +135,28 @@ class DicUtils private constructor() {
|
|||||||
*/
|
*/
|
||||||
fun getCarColor(
|
fun getCarColor(
|
||||||
context: Context, appCompatActivity: AppCompatActivity,
|
context: Context, appCompatActivity: AppCompatActivity,
|
||||||
isLoading : Boolean=false,
|
isLoading: Boolean = false,
|
||||||
listener: OnOptionPickedListener
|
listener: OnOptionPickedListener
|
||||||
) {
|
) {
|
||||||
DataManager.getInstance().getSysDictDataList("plate_color")
|
DataManager.getInstance().getSysDictDataList("plate_color")
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(
|
.subscribe(
|
||||||
BaseObserver(context, object : RxHttpCallBack<MutableList<DiCarColor>>(if (isLoading) appCompatActivity else null) {
|
BaseObserver(
|
||||||
override fun onSuccess(t: CommonResponseBean<MutableList<DiCarColor>>) {
|
context,
|
||||||
super.onSuccess(t)
|
object :
|
||||||
PickerUtils.getInstance()
|
RxHttpCallBack<MutableList<DiCarColor>>(if (isLoading) appCompatActivity else null) {
|
||||||
.showSelectCarColor(
|
override fun onSuccess(t: CommonResponseBean<MutableList<DiCarColor>>) {
|
||||||
appCompatActivity,
|
super.onSuccess(t)
|
||||||
"车牌颜色",
|
PickerUtils.getInstance()
|
||||||
"黄色",
|
.showSelectCarColor(
|
||||||
t.data, listener
|
appCompatActivity,
|
||||||
)
|
"车牌颜色",
|
||||||
}
|
"黄色",
|
||||||
})
|
t.data, listener
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user