司机车辆提醒

This commit is contained in:
lijia 2024-04-24 15:33:37 +08:00
parent b1355100e2
commit 10f9be36c5
13 changed files with 338 additions and 50 deletions

View File

@ -100,3 +100,14 @@ data class WaterInfo(
val withdrawalsStatus: String
)
data class CardInfo(
val configValue: String,
val idcardEffectiveEnd: String,
val idcardEffectiveOverdue: String,
val idcardIsEndless: String,
val licenseEffectiveEnd: String,
val licenseEffectiveOverdue: String,
val qualificationCertificateEffectiveEnd: String,
val qualificationCertificateEffectiveOverdue: String
)

View File

@ -215,6 +215,13 @@ interface Api {
@GET(BASE_URL + "driver/driver/getDriverDocIntegrity")
fun getDriverDocIntegrity(): Observable<CommonResponseBean<UserDetail>>
/**
*查询司机证件过期情况
* @return Observable<CommonResponseBean<UserDetail>>
*/
@GET(BASE_URL + "driver/driver/getDriverExpiredDocuments")
fun getDriverExpiredDocuments(): Observable<CommonResponseBean<CardInfo>>
/**
* 司机认证成为车队长

View File

@ -30,10 +30,11 @@ import io.reactivex.rxjava3.schedulers.Schedulers
*/
class AuthDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
var ossServiceUtil: OssServiceUtil = OssServiceUtil.getInstance()
var driverInfoBean: UpDriverInfoBean = UpDriverInfoBean()
var backLicName = ""
override fun initView(savedInstanceState: Bundle?) {
setStatusBarColor(R.color.white)
setTitleBar("实名认证"){
@ -172,6 +173,7 @@ class AuthDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
.loadRoundImage(mContext, picPath.locPic, 12, binding.ivBack)
driverInfoBean.licensePhotoBackUrl = picPath.picPath
it?.run {
backLicName = it.name
driverInfoBean.licenseRecordNumber = recordNumber
}
}

View File

@ -27,6 +27,7 @@ import com.dahe.gldriver.ui.waybill.activity.WaybillDetailActivity
import com.dahe.gldriver.utils.OrderUtils
import com.dahe.gldriver.utils.SPUtils
import com.dahe.gldriver.utils.UserUtils
import com.dahe.glex.bean.CardInfo
import com.dahe.glex.bean.OrderBean
import com.dahe.glex.bean.UserBean
import com.dahe.glex.bean.UserDetail
@ -142,19 +143,19 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(), RefreshCallBack {
showToast("敬请期待")
}
llNotic.setOnClickListener {
val userInfo = SPUtils.instance.getUserInfo(mContext)
if (userInfo?.isCarCaptain == "1") {//是否是车队长0=否,1=是,9=未选择)
ActivityUtils.startActivity(
mContext,
EditCaTeamActivity::class.java,
Bundle().apply {
putString(AppConfig.ID, userInfo.captainId)
})
} else {
ActivityUtils.startActivity(mContext, PersonInfoActivity::class.java)
}
}
// llNotic.setOnClickListener {
// val userInfo = SPUtils.instance.getUserInfo(mContext)
// if (userInfo?.isCarCaptain == "1") {//是否是车队长0=否,1=是,9=未选择)
// ActivityUtils.startActivity(
// mContext,
// EditCaTeamActivity::class.java,
// Bundle().apply {
// putString(AppConfig.ID, userInfo.captainId)
// })
// } else {
// ActivityUtils.startActivity(mContext, PersonInfoActivity::class.java)
// }
// }
}
initData()
}
@ -209,10 +210,46 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(), RefreshCallBack {
if (t.data.idcardNo.isNullOrEmpty() || t.data.licenseNo.isNullOrEmpty() ||
(if (t.data.licenseType.contains("C")) false else t.data.qualificationCertificateEffectiveEnd.isNullOrEmpty()) || t.data.driverBankcardNumber.isNullOrEmpty() ||
t.data.isRealName == "0"
)
) {
binding.llNotic.visibility = View.VISIBLE
else
binding.llNotic.visibility = View.GONE
binding.run {
llNotic.setOnClickListener {
ActivityUtils.startActivity(
mContext,
PersonInfoActivity::class.java
)
}
}
} else {
DataManager.getInstance().getDriverExpiredDocuments()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
BaseObserver(mContext,
object : RxHttpCallBack<CardInfo>() {
override fun onSuccess(t: CommonResponseBean<CardInfo>) {
super.onSuccess(t)
if (t.data.licenseEffectiveOverdue == "1" || t.data.qualificationCertificateEffectiveOverdue == "1" || t.data.idcardEffectiveOverdue == "1") {
binding.llNotic.visibility = View.VISIBLE
binding.run {
llNotic.visibility = View.VISIBLE
btnNotic.text = "去更换"
tvNotic.text = "司机证件即将过期,请及时更换"
llNotic.setOnClickListener {
ActivityUtils.startActivity(
mContext,
PersonInfoActivity::class.java
)
}
}
} else {
binding.llNotic.visibility = View.GONE
}
}
})
)
}
}
}))
}

View File

@ -31,7 +31,9 @@ import com.dahe.gldriver.utils.AppVersionUtils
import com.dahe.gldriver.utils.OcrUtils
import com.dahe.gldriver.utils.SPUtils
import com.dahe.gldriver.utils.UserUtils
import com.dahe.glex.bean.CardInfo
import com.dahe.glex.bean.UserBean
import com.dahe.glex.bean.UserDetail
import com.dahe.glex.bean.WalletInfo
import com.dahe.mylibrary.base.BaseFragment
import com.dahe.mylibrary.callback.RefreshCallBack
@ -65,6 +67,7 @@ class MineFragment : BaseFragment<FragmentMineBinding>(), View.OnClickListener,
override fun onFragmentVisibleChange(isVisible: Boolean) {
if (isVisible) {
getUserData()
} else {
}
}
@ -132,6 +135,20 @@ class MineFragment : BaseFragment<FragmentMineBinding>(), View.OnClickListener,
}
}
// llNotic.setOnClickListener {
// val userInfo = SPUtils.instance.getUserInfo(mContext)
// if (userInfo?.isCarCaptain == "1") {//是否是车队长0=否,1=是,9=未选择)
// ActivityUtils.startActivity(
// mContext,
// EditCaTeamActivity::class.java,
// Bundle().apply {
// putString(AppConfig.ID, userInfo.captainId)
// })
// } else {
// ActivityUtils.startActivity(mContext, PersonInfoActivity::class.java)
// }
// }
}
}
@ -254,6 +271,61 @@ class MineFragment : BaseFragment<FragmentMineBinding>(), View.OnClickListener,
}
}
}))
val userInfo = SPUtils.instance.getUserInfo(mContext)
if (userInfo?.isCarCaptain == "1") {//是否是车队长0=否,1=是,9=未选择)
binding.llNotic.visibility = View.GONE
} else {
DataManager.getInstance().getDriverDocIntegrity()
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<UserDetail>() {
override fun onSuccess(t: CommonResponseBean<UserDetail>) {
super.onSuccess(t)
if (t == null || t.data == null)
return
if (t.data.idcardNo.isNullOrEmpty() || t.data.licenseNo.isNullOrEmpty() ||
(if (t.data.licenseType.contains("C")) false else t.data.qualificationCertificateEffectiveEnd.isNullOrEmpty()) || t.data.driverBankcardNumber.isNullOrEmpty() ||
t.data.isRealName == "0"
) {
binding.llNotic.visibility = View.VISIBLE
binding.llNotic.setOnClickListener {
ActivityUtils.startActivity(
mContext,
PersonInfoActivity::class.java
)
}
} else {
DataManager.getInstance().getDriverExpiredDocuments()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
BaseObserver(mContext,
object : RxHttpCallBack<CardInfo>() {
override fun onSuccess(t: CommonResponseBean<CardInfo>) {
super.onSuccess(t)
if (t.data.licenseEffectiveOverdue == "1" || t.data.qualificationCertificateEffectiveOverdue == "1" || t.data.idcardEffectiveOverdue == "1") {
binding.llNotic.visibility = View.VISIBLE
binding.run {
llNotic.visibility = View.VISIBLE
btnNotic.text = "去更换"
tvNotic.text = "司机证件即将过期,请及时更换"
llNotic.setOnClickListener {
ActivityUtils.startActivity(
mContext,
PersonInfoActivity::class.java
)
}
}
} else {
binding.llNotic.visibility = View.GONE
}
}
})
)
}
}
}))
}
}
private fun refreshView() {

View File

@ -16,6 +16,7 @@ import com.dahe.gldriver.ui.account.authperson.EditPersonActivity
import com.dahe.gldriver.ui.account.authperson.EditQualificationActivity
import com.dahe.gldriver.utils.OrderUtils
import com.dahe.gldriver.utils.SPUtils
import com.dahe.glex.bean.CardInfo
import com.dahe.glex.bean.UserDetail
import com.dahe.mylibrary.base.BaseActivity
import com.dahe.mylibrary.net.CommonResponseBean
@ -78,6 +79,26 @@ class PersonInfoActivity : BaseActivity<ActivityPersonInfoBinding>(), View.OnCli
initViewByData(t.data)
}
}))
DataManager.getInstance().getDriverExpiredDocuments()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
BaseObserver(mContext,
object : RxHttpCallBack<CardInfo>() {
override fun onSuccess(t: CommonResponseBean<CardInfo>) {
super.onSuccess(t)
binding.run {
tvNotic1.visibility =
if (t.data.idcardEffectiveOverdue == "1") View.VISIBLE else View.GONE//身份证是否过期
tvNotic2.visibility =
if (t.data.licenseEffectiveOverdue == "1") View.VISIBLE else View.GONE//驾驶证是否过期
tvNotic3.visibility =
if (t.data.qualificationCertificateEffectiveOverdue == "1") View.VISIBLE else View.GONE//从业资格证是否过期
}
}
})
)
}
override fun onClick(view: View?) {

View File

@ -11,6 +11,7 @@ import com.alct.mdp.model.Goods
import com.alct.mdp.model.Image
import com.alct.mdp.model.Location
import com.amap.api.maps.model.LatLng
import com.baidu.mapapi.utils.CoordinateConverter
import com.dahe.gldriver.base.AppConfig
import com.dahe.gldriver.bean.LUInputBean
import com.dahe.gldriver.bean.OrderDetailBean
@ -541,8 +542,8 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
it.getLongitude()//经 度
it.getLatitude()//纬 度
latLng = LatLng(it.latitude, it.longitude)
bdLatLng = GDLocationUtils.instance.convertGPSToBaidu(latLng)
binding.tvLoca.text = it.address
bdLatLng = GDLocationUtils.instance.gaoDeToBaidu(latLng)
} else {
showToast("定位失败,请检查定位权限是否开启")
}
@ -550,6 +551,8 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
}
}
private fun selGoodPic(goodType: Int?, myAdapter: GridImageAdapter) {
PopsUtils.getInstance().showSelPic(mContext, false, myAdapter) {
OssServiceUtil.getInstance().run {

View File

@ -150,7 +150,7 @@ class WaitLoadFragment : BaseFragment<FragmentWaybillListBinding>(), RefreshCall
}
@Subscribe
fun eventStatu(event: RefreshEvent) {
if (event.statu == 1) {
if (event.statu == 1||event.statu == 2) {
initData()
}
}

View File

@ -145,7 +145,7 @@ class WaitUnLoadFragment : BaseFragment<FragmentWaybillListBinding>(), RefreshCa
@Subscribe
fun eventStatu(event: RefreshEvent) {
if (event.statu == 2) {
if (event.statu == 1||event.statu == 2) {
initData()
}
}

View File

@ -11,22 +11,26 @@ import android.os.Build
import com.amap.api.location.AMapLocationClient
import com.amap.api.location.AMapLocationClientOption
import com.amap.api.location.AMapLocationListener
import com.amap.api.maps.CoordinateConverter
import com.amap.api.maps.model.LatLng
import com.baidu.mapapi.utils.CoordinateConverter
import com.dahe.gldriver.R
import com.dahe.gldriver.service.MyNotification
import java.lang.Exception
import kotlin.math.atan2
import kotlin.math.cos
import kotlin.math.sin
import kotlin.math.sqrt
class GDLocationUtils private constructor(){
class GDLocationUtils private constructor() {
//声明AMapLocationClient类对象
var mLocationClient : AMapLocationClient?= null;
var mLocationClient: AMapLocationClient? = null;
//声明AMapLocationClientOption对象
var mLocationOption: AMapLocationClientOption? = null
companion object{
companion object {
val instance = Holder.holder
}
@ -34,7 +38,7 @@ class GDLocationUtils private constructor(){
val holder = GDLocationUtils()
}
fun getLocation(ctx : Context,mLocationListener : AMapLocationListener){
fun getLocation(ctx: Context, mLocationListener: AMapLocationListener) {
//初始化定位
mLocationClient = AMapLocationClient(ctx)
//设置定位回调监听
@ -66,7 +70,7 @@ class GDLocationUtils private constructor(){
// mLocationClient?.enableBackgroundLocation(1,buildNotification(ctx))
//给定位客户端对象设置定位参数
mLocationClient?.setLocationOption(mLocationOption);
if(null != mLocationClient){
if (null != mLocationClient) {
mLocationClient?.setLocationOption(mLocationOption);
//设置场景模式后最好调用一次stop再调用start以保证场景模式生效
mLocationClient?.stopLocation()
@ -80,7 +84,7 @@ class GDLocationUtils private constructor(){
* @param ctx Context
* @param mLocationListener AMapLocationListener
*/
fun getLocation2(ctx : Context,mLocationListener : AMapLocationListener){
fun getLocation2(ctx: Context, mLocationListener: AMapLocationListener) {
//初始化定位
mLocationClient = AMapLocationClient(ctx)
//设置定位回调监听
@ -109,10 +113,13 @@ class GDLocationUtils private constructor(){
//设置是否允许模拟位置,默认为true允许模拟位置
mLocationOption?.setMockEnable(true)
//启动后台定位第一个参数为通知栏ID建议整个APP使用一个
mLocationClient?.enableBackgroundLocation(1,MyNotification.getInstance().getNotification(ctx))
mLocationClient?.enableBackgroundLocation(
1,
MyNotification.getInstance().getNotification(ctx)
)
//给定位客户端对象设置定位参数
mLocationClient?.setLocationOption(mLocationOption);
if(null != mLocationClient){
if (null != mLocationClient) {
mLocationClient?.setLocationOption(mLocationOption);
//设置场景模式后最好调用一次stop再调用start以保证场景模式生效
mLocationClient?.stopLocation()
@ -120,16 +127,46 @@ class GDLocationUtils private constructor(){
}
}
fun convertGPSToBaidu(srLatLng: LatLng): LatLng {
val converter = CoordinateConverter()
converter.from(CoordinateConverter.CoordType.COMMON)
converter.coord(com.baidu.mapapi.model.LatLng(srLatLng.latitude,srLatLng.longitude))
return LatLng(converter.convert().latitude,converter.convert().longitude)
fun convertGPSToBaidu(context: Context, srLatLng: LatLng): LatLng {
val converter = CoordinateConverter(context)
converter.from(CoordinateConverter.CoordType.GPS)
converter.coord(LatLng(srLatLng.latitude, srLatLng.longitude))
val convert = converter.convert()
return LatLng(convert.latitude, convert.longitude)
}
/**
* 高德转百度火星坐标gcj02ll>百度坐标bd09ll
* @param srLatLng LatLng
* @return LatLng
*/
fun gaoDeToBaidu(srLatLng: LatLng): LatLng {
var PI = 3.14159265358979324 * 3000.0 / 180.0;
var x = srLatLng.latitude
var y = srLatLng.longitude
var z = sqrt(x * x + y * y) + 0.00002 * sin(y * PI);
var theta = atan2(y, x) + 0.000003 * cos(x * PI);
return LatLng(z * cos(theta) + 0.0065, z * sin(theta) + 0.006);
}
fun stopLocation(){
if(null != mLocationClient){
/**
* 百度转高德百度坐标bd09ll>火星坐标gcj02ll
* @param srLatLng LatLng
* @return LatLng
*/
fun bdToGaoDe(srLatLng: LatLng): LatLng {
var PI = 3.14159265358979324 * 3000.0 / 180.0;
var x = srLatLng.longitude - 0.0065
var y = srLatLng.latitude - 0.006
var z = sqrt(x * x + y * y) - 0.00002 * sin(y * PI);
var theta = atan2(y, x) - 0.000003 * cos(x * PI);
return LatLng(z * cos(theta) + 0.0065, z * sin(theta) + 0.006);
}
fun stopLocation() {
if (null != mLocationClient) {
mLocationClient?.disableBackgroundLocation(true)
mLocationClient?.stopLocation()
}

View File

@ -43,8 +43,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:paddingBottom="@dimen/dp_20"
android:orientation="vertical">
android:orientation="vertical"
android:paddingBottom="@dimen/dp_20">
<com.dahe.mylibrary.weight.CircleBarView2
android:id="@+id/circleBarView2"
@ -127,6 +127,26 @@
android:textColor="@color/black"
android:textSize="@dimen/sp_16" />
<TextView
android:visibility="gone"
android:id="@+id/tvNotic1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/ivIcon"
android:layout_marginLeft="@dimen/dp_70"
android:layout_toRightOf="@+id/ivIcon"
android:background="#FFEDE5"
android:maxLines="1"
android:gravity="center"
android:paddingLeft="@dimen/dp_6"
android:paddingTop="@dimen/dp_3"
android:paddingRight="@dimen/dp_6"
android:paddingBottom="@dimen/dp_3"
android:singleLine="true"
android:text="证件即将过期"
android:textColor="@color/main_red"
android:textSize="@dimen/dp_10" />
<TextView
android:id="@+id/tvInfo"
android:layout_width="wrap_content"
@ -260,6 +280,26 @@
android:textColor="@color/black"
android:textSize="@dimen/sp_16" />
<TextView
android:visibility="gone"
android:id="@+id/tvNotic2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/ivIcon2"
android:layout_marginLeft="@dimen/dp_70"
android:layout_toRightOf="@+id/ivIcon2"
android:background="#FFEDE5"
android:maxLines="1"
android:gravity="center"
android:paddingLeft="@dimen/dp_6"
android:paddingTop="@dimen/dp_3"
android:paddingRight="@dimen/dp_6"
android:paddingBottom="@dimen/dp_3"
android:singleLine="true"
android:text="证件即将过期"
android:textColor="@color/main_red"
android:textSize="@dimen/dp_10" />
<TextView
android:id="@+id/tvDriverInfo"
android:layout_width="wrap_content"
@ -362,13 +402,13 @@
<androidx.cardview.widget.CardView
android:id="@+id/cvQua"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_15"
android:visibility="gone"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="@dimen/dp_8">
@ -394,6 +434,25 @@
android:text="从业资格证"
android:textColor="@color/black"
android:textSize="@dimen/sp_16" />
<TextView
android:visibility="gone"
android:id="@+id/tvNotic3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/ivIcon3"
android:layout_marginLeft="@dimen/dp_100"
android:layout_toRightOf="@+id/ivIcon3"
android:background="#FFEDE5"
android:maxLines="1"
android:gravity="center"
android:paddingLeft="@dimen/dp_6"
android:paddingTop="@dimen/dp_3"
android:paddingRight="@dimen/dp_6"
android:paddingBottom="@dimen/dp_3"
android:singleLine="true"
android:text="证件即将过期"
android:textColor="@color/main_red"
android:textSize="@dimen/dp_10" />
<TextView
android:id="@+id/tvQualiInfo"
@ -422,11 +481,11 @@
<LinearLayout
android:id="@+id/llQua"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/tvQualiInfo"
android:orientation="vertical">
android:orientation="vertical"
android:visibility="gone">
<View
android:layout_width="match_parent"
@ -537,9 +596,9 @@
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_8"
android:layout_marginBottom="@dimen/dp_15"
tools:text="412************062"
android:textColor="@color/color_c"
android:textSize="@dimen/sp_12" />
android:textSize="@dimen/sp_12"
tools:text="412************062" />
<Button
android:id="@+id/btnBank"
@ -556,11 +615,11 @@
<LinearLayout
android:id="@+id/llBank"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/tvBankInfo"
android:orientation="vertical">
android:orientation="vertical"
android:visibility="gone">
<View
android:layout_width="match_parent"
@ -688,12 +747,12 @@
android:textSize="@dimen/sp_12" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
<View
android:layout_width="@dimen/dp_0"
android:layout_height="@dimen/dp_10"/>
android:layout_height="@dimen/dp_10" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>

View File

@ -207,6 +207,7 @@
android:visibility="gone">
<TextView
android:id="@+id/tvNotic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
@ -217,6 +218,7 @@
android:textSize="@dimen/dp_12" />
<Button
android:id="@+id/btnNotic"
android:layout_width="@dimen/dp_65"
android:layout_height="@dimen/dp_22"
android:layout_marginRight="@dimen/dp_16"

View File

@ -110,13 +110,50 @@
</LinearLayout>
<LinearLayout
android:visibility="gone"
android:id="@+id/llNotic"
android:layout_below="@+id/headContent"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_36"
android:layout_marginTop="@dimen/dp_m_60"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="@dimen/dp_8"
>
<TextView
android:id="@+id/tvNotic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:maxLines="1"
android:singleLine="true"
android:layout_marginLeft="@dimen/dp_10"
android:text="您的实名认证资料不全,请继续进行上传证件。"
android:textColor="@color/main_red"
android:textSize="@dimen/dp_12" />
<Button
android:id="@+id/btnNotic"
android:layout_width="@dimen/dp_65"
android:layout_height="@dimen/dp_22"
android:layout_marginRight="@dimen/dp_16"
android:background="@drawable/shape_btn_11"
android:clickable="false"
android:text="立即认证"
android:textColor="@color/white"
android:textSize="@dimen/sp_11" />
</LinearLayout>
<RelativeLayout
android:id="@+id/rlMoney"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_120"
android:layout_below="@+id/headContent"
android:layout_below="@+id/llNotic"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_m_60"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_15"
android:background="@drawable/shape_white_12"
android:padding="@dimen/sp_16">