证件过期优化,内容不一致问题优化

This commit is contained in:
lijia 2024-04-24 16:42:21 +08:00
parent 10f9be36c5
commit e161aed122
14 changed files with 373 additions and 182 deletions

View File

@ -31,6 +31,10 @@ class CarsAdapter() :
}"""
)
setGone(R.id.tvNotic,
!(item?.roadLicenseValidityOverdue=="1"||item?.licenseValidityOverdue=="1")
)
ImageLoader.getInstance()
.loadRoundImage(context, item?.carUrl, 6, getView<ImageView>(R.id.ivHead))
}

View File

@ -12,6 +12,8 @@ data class CarBean(
val carHeight: String="",
var carId: String="",
var driverId: String="",
var roadLicenseValidityOverdue: String="",
var licenseValidityOverdue: String="",
val carLong: String="",
val carUrl: String="",
val carWidth: String="",

View File

@ -108,6 +108,13 @@ data class CardInfo(
val licenseEffectiveEnd: String,
val licenseEffectiveOverdue: String,
val qualificationCertificateEffectiveEnd: String,
val qualificationCertificateEffectiveOverdue: String
val qualificationCertificateEffectiveOverdue: String,
//车辆
val carId: String,
val roadLicenseValidityOverdue: String,//道路运输证是否过期
val vehicleNum: String,
val licenseValidityOverdue: String//驾驶证是否过期
)

View File

@ -222,6 +222,13 @@ interface Api {
@GET(BASE_URL + "driver/driver/getDriverExpiredDocuments")
fun getDriverExpiredDocuments(): Observable<CommonResponseBean<CardInfo>>
/**
*查询车辆证件过期情况
* @return Observable<CommonResponseBean<UserDetail>>
*/
@GET(BASE_URL + "driver/car/getCarExpiredDocumentsByDriverId")
fun getCarExpiredDocumentsByDriverId(): Observable<CommonResponseBean<MutableList<CardInfo>>>
/**
* 司机认证成为车队长
@ -450,7 +457,7 @@ interface Api {
* @param userBean UserBean
* @return Observable<CommonResponseBean<Any>>
*/
@POST(BASE_URL+"driver/driver/setUpDriverAvatar")
@POST(BASE_URL + "driver/driver/setUpDriverAvatar")
fun setUpDriverAvatar(@Body upPersonHead: UpPersonHead): Observable<CommonResponseBean<Any>>
@ -482,7 +489,7 @@ interface Api {
* @param captainId String
* @return Observable<CommonResponseBean<CaptainBean>>
*/
@GET(BASE_URL+"driver/captain/getCaptainDetail")
@GET(BASE_URL + "driver/captain/getCaptainDetail")
fun getCaptainDetail(@Query("captainId") captainId: String): Observable<CommonResponseBean<AuthTeamBean>>
/**
@ -586,11 +593,11 @@ interface Api {
* 查询司机消息通知列表
* @return Observable<CommonResponseBean<MutableList<MessageBean>>>
*/
@GET(BASE_URL+"driver/message/list")
fun messageList():Observable<CommonResponseBean<MutableList<MessageBean>>>
@GET(BASE_URL + "driver/message/list")
fun messageList(): Observable<CommonResponseBean<MutableList<MessageBean>>>
@GET(BASE_URL+"driver/message/read")
fun messageRead(@Query("messageId") messageId :String):Observable<CommonResponseBean<Any>>
@GET(BASE_URL + "driver/message/read")
fun messageRead(@Query("messageId") messageId: String): Observable<CommonResponseBean<Any>>
companion object {
// String BASE_URL = "https://tmstest.dahehuoyun.com/";

View File

@ -10,6 +10,7 @@ import com.dahe.gldriver.net.DataManager
import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.oss.OssServiceUtil
import com.dahe.gldriver.ui.HomeActivity
import com.dahe.gldriver.utils.CommonPopUtils
import com.dahe.gldriver.utils.OcrUtils
import com.dahe.mylibrary.utils.PickerUtils
import com.dahe.mylibrary.base.BaseActivity
@ -37,7 +38,7 @@ class AuthDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
override fun initView(savedInstanceState: Bundle?) {
setStatusBarColor(R.color.white)
setTitleBar("实名认证"){
setTitleBar("实名认证") {
ActivityUtils.startActivity(mContext, HomeActivity::class.java)
}
@ -93,44 +94,48 @@ class AuthDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
licenseEffectiveEnd = tvEnd.text.toString()
}
}
if (driverInfoBean.licenseName.isNullOrBlank() || driverInfoBean.licensePhotoBackUrl.isNullOrBlank()||
driverInfoBean.licenseNo.isNullOrBlank()||driverInfoBean.licenseType.isNullOrBlank()||
driverInfoBean.licenseEffectiveStart.isNullOrBlank()||driverInfoBean.licenseEffectiveEnd.isNullOrBlank()) {
if (driverInfoBean.licenseName.isNullOrBlank() || driverInfoBean.licensePhotoBackUrl.isNullOrBlank() ||
driverInfoBean.licenseNo.isNullOrBlank() || driverInfoBean.licenseType.isNullOrBlank() ||
driverInfoBean.licenseEffectiveStart.isNullOrBlank() || driverInfoBean.licenseEffectiveEnd.isNullOrBlank()
) {
ToastUtils.showToast(mContext, "请完善信息")
return
}
if (driverInfoBean.licenseName != backLicName) {
CommonPopUtils.getInstance().showCommCenterPop(mContext, content = "检测到主副页识别姓名不一致,是否继续上传?") {
DataManager.getInstance().setUpDriverLicense(driverInfoBean)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
override fun onSuccess(t: CommonResponseBean<Any>) {
super.onSuccess(t)
if (driverInfoBean.licenseType.contains("C")) {//C证
ActivityUtils.startActivity(
mContext,
AuthBankCardActivity::class.java
)
} else {
ActivityUtils.startActivity(
mContext,
AuthQualificationActivity::class.java
)
}
finish()
}
}))
}
}
DataManager.getInstance().setUpDriverLicense(driverInfoBean)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
override fun onSuccess(t: CommonResponseBean<Any>) {
super.onSuccess(t)
if (driverInfoBean.licenseType.contains("C")){//C证
ActivityUtils.startActivity(
mContext,
AuthBankCardActivity::class.java
)
}else{
ActivityUtils.startActivity(
mContext,
AuthQualificationActivity::class.java
)
}
finish()
}
}))
}
private fun selFrontPic() {
OcrUtils.getInstance().ocrDriver(mContext, this) { picPath, result ->
if (result?.data?.face==null){
ToastUtils.showToast(mContext,"请选择正确证件照片")
if (result?.data?.face == null) {
ToastUtils.showToast(mContext, "请选择正确证件照片")
return@ocrDriver
}
result?.data?.face?.data.let {
@ -164,8 +169,8 @@ class AuthDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
private fun selBackPic() {
OcrUtils.getInstance().ocrDriver(mContext, this) { picPath, result ->
if (result?.data?.back==null){
ToastUtils.showToast(mContext,"请选择正确证件照片")
if (result?.data?.back == null) {
ToastUtils.showToast(mContext, "请选择正确证件照片")
return@ocrDriver
}
result?.data?.back?.data.let {

View File

@ -11,6 +11,7 @@ import com.dahe.gldriver.net.DataManager
import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.ui.HomeActivity
import com.dahe.gldriver.ui.account.AuthSuccActivity
import com.dahe.gldriver.utils.CommonPopUtils
import com.dahe.gldriver.utils.DicUtils
import com.dahe.gldriver.utils.OcrUtils
import com.dahe.mylibrary.base.BaseActivity
@ -48,6 +49,11 @@ class AuthDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
subMit()
}
binding.run {
tvCarColor.text = "黄色"
upDrivingInfoBean.run {
plateColorCode = "2"
plateColor = "黄色"
}
ivFront.setOnClickListener {
selFrontPic()
}
@ -180,15 +186,15 @@ class AuthDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
ToastUtils.showToast(mContext, "请选择正确证件照片")
return@ocrDriveing
}
ImageLoader.getInstance()
.loadRoundImage(mContext, picPath.locPic, 12, binding.ivBack)
upDrivingInfoBean.licenseBackUrl = picPath.picPath//行驶证照片(反面)
result?.data?.back?.data?.let {
backLicCarNum = it.licensePlateNumber
ImageLoader.getInstance()
.loadRoundImage(mContext, picPath.locPic, 12, binding.ivBack)
upDrivingInfoBean.run {
inspectionRecord = it.inspectionRecord
licenseBackUrl = picPath.picPath//行驶证照片(反面)
recordNumber = it.recordNumber
barcodeNumber = it.barcodeNumber
passengerCapacity = it.passengerCapacity
@ -261,34 +267,39 @@ class AuthDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
owner = binding.etOwner.text.trim().toString()
useNature = binding.etUseNature.text.trim().toString()
}
if (upDrivingInfoBean.vehicleNum!=backLicCarNum){
ToastUtils.showToast(mContext,"主副页车牌号码不一致,请重新上传")
return
if (upDrivingInfoBean.licenseBackUrl.isNullOrEmpty()){
showToast("请完善车辆信息")
return@subMit
}
DataManager.getInstance().addCar(upDrivingInfoBean)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<UpDrivingInfoBean>() {
override fun onSuccess(t: CommonResponseBean<UpDrivingInfoBean>) {
super.onSuccess(t)
if (upDrivingInfoBean.isTrailer == "1") {
finish()
ActivityUtils.startActivity(
mContext,
AuthTrailerActivity::class.java,
Bundle().apply {
putString(AppConfig.CAR_ID, t.data.carId)
putBoolean(AppConfig.IS_GO_MINE,true)
})
} else {
ActivityUtils.startActivity(mContext, AuthSuccActivity::class.java,Bundle().apply {
putBoolean(AppConfig.IS_GO_MINE,true)
})
}
}
}))
if (upDrivingInfoBean.vehicleNum!=backLicCarNum){
CommonPopUtils.getInstance().showCommCenterPop(mContext, content = "检测到主副页识别车牌号内容不一致,是否继续上传?"){
DataManager.getInstance().addCar(upDrivingInfoBean)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<UpDrivingInfoBean>() {
override fun onSuccess(t: CommonResponseBean<UpDrivingInfoBean>) {
super.onSuccess(t)
if (upDrivingInfoBean.isTrailer == "1") {
finish()
ActivityUtils.startActivity(
mContext,
AuthTrailerActivity::class.java,
Bundle().apply {
putString(AppConfig.CAR_ID, t.data.carId)
putBoolean(AppConfig.IS_GO_MINE,true)
})
} else {
ActivityUtils.startActivity(mContext, AuthSuccActivity::class.java,Bundle().apply {
putBoolean(AppConfig.IS_GO_MINE,true)
})
}
}
}))
}
}
}

View File

@ -10,6 +10,7 @@ import com.dahe.gldriver.net.BaseObserver
import com.dahe.gldriver.net.DataManager
import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.ui.account.AuthSuccActivity
import com.dahe.gldriver.utils.CommonPopUtils
import com.dahe.gldriver.utils.DicUtils
import com.dahe.gldriver.utils.OcrUtils
import com.dahe.mylibrary.base.BaseActivity
@ -30,12 +31,13 @@ import io.reactivex.rxjava3.schedulers.Schedulers
*/
class AuthTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
var carId :String = ""
var carId: String = ""
var upDrivingInfoBean = UpDrivingInfoBean()
var backLicCarNum = ""
override fun initView(savedInstanceState: Bundle?) {
setStatusBarColor(R.color.white)
setTitleBar("实名认证", true)
carId = intent.extras?.getString(AppConfig.CAR_ID,"").toString()
carId = intent.extras?.getString(AppConfig.CAR_ID, "").toString()
binding.run {
ivFront.setOnClickListener {
@ -48,7 +50,12 @@ class AuthTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
tvCarType.setOnClickListener {
//车辆类型
DicUtils.getInstance()
.selectDicCarType(mContext, this@AuthTrailerActivity,"重型自卸半挂车",true) { position, item ->
.selectDicCarType(
mContext,
this@AuthTrailerActivity,
"重型自卸半挂车",
true
) { position, item ->
var data = item as DiCarColor
tvCarType.text = data.dictLabel
upDrivingInfoBean.run {
@ -60,7 +67,7 @@ class AuthTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
tvCarColor.setOnClickListener {
DicUtils.getInstance()
.getCarColor(mContext, this@AuthTrailerActivity,true) { position, item ->
.getCarColor(mContext, this@AuthTrailerActivity, true) { position, item ->
var data = item as DiCarColor
tvCarColor.text = data.dictLabel
upDrivingInfoBean.run {
@ -93,8 +100,8 @@ class AuthTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
*/
private fun selFrontPic() {
OcrUtils.getInstance().ocrDriveing(mContext, this) { picPath, result ->
if (result?.data?.face==null){
ToastUtils.showToast(mContext,"请选择正确证件照片")
if (result?.data?.face == null) {
ToastUtils.showToast(mContext, "请选择正确证件照片")
return@ocrDriveing
}
@ -138,23 +145,28 @@ class AuthTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
private fun selBackPic() {
OcrUtils.getInstance().ocrDriveing(mContext, this) { picPath, result ->
if (result?.data?.back==null){
ToastUtils.showToast(mContext,"请选择正确证件照片")
if (result?.data?.back == null) {
ToastUtils.showToast(mContext, "请选择正确证件照片")
return@ocrDriveing
}
ImageLoader.getInstance()
.loadRoundImage(mContext, picPath.locPic, 12, binding.ivBack)
upDrivingInfoBean.licenseBackUrl = picPath.picPath//行驶证照片(反面)
result?.data?.back?.data?.let {
backLicCarNum = it.licensePlateNumber
ImageLoader.getInstance()
.loadRoundImage(mContext, picPath.locPic, 12, binding.ivBack)
upDrivingInfoBean.run {
inspectionRecord = it.inspectionRecord
recordNumber = it.recordNumber
licenseBackUrl = picPath.picPath//行驶证照片(反面)
barcodeNumber = it.barcodeNumber
passengerCapacity = it.passengerCapacity
totalWeight = if (it.totalWeight.contains("kg")) it.totalWeight.split("kg")[0] else ""
curbWeight = if (it.curbWeight.contains("kg")) it.curbWeight.split("kg")[0] else ""
approvedLoad = if (it.permittedWeight.contains("kg")) it.permittedWeight.split("kg")[0] else ""
totalWeight =
if (it.totalWeight.contains("kg")) it.totalWeight.split("kg")[0] else ""
curbWeight =
if (it.curbWeight.contains("kg")) it.curbWeight.split("kg")[0] else ""
approvedLoad =
if (it.permittedWeight.contains("kg")) it.permittedWeight.split("kg")[0] else ""
}
//车长
@ -162,9 +174,12 @@ class AuthTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
var overall = it.overallDimension.replace("mm", "")
var splits = overall.split("×")
if (splits.size == 3) {
upDrivingInfoBean.carLong = if (splits[0].toIntOrNull()!=null) splits[0] else ""
upDrivingInfoBean.carWidth = if (splits[1].toIntOrNull()!=null) splits[1] else ""
upDrivingInfoBean.carHeight = if (splits[2].toIntOrNull()!=null) splits[2] else ""
upDrivingInfoBean.carLong =
if (splits[0].toIntOrNull() != null) splits[0] else ""
upDrivingInfoBean.carWidth =
if (splits[1].toIntOrNull() != null) splits[1] else ""
upDrivingInfoBean.carHeight =
if (splits[2].toIntOrNull() != null) splits[2] else ""
}
}
if (it.inspectionRecord.length > 19) {
@ -203,14 +218,20 @@ class AuthTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
carId = this@AuthTrailerActivity.carId
}
DataManager.getInstance().addTrailer(upDrivingInfoBean)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
override fun onSuccess(t: CommonResponseBean<Any>) {
super.onSuccess(t)
ActivityUtils.startActivity(mContext, AuthSuccActivity::class.java)
}
}))
if (upDrivingInfoBean.vehicleNum != backLicCarNum) {
CommonPopUtils.getInstance().showCommCenterPop(mContext, content = "检测到主副页识别车牌号内容不一致,是否继续上传?") {
DataManager.getInstance().addTrailer(upDrivingInfoBean)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
override fun onSuccess(t: CommonResponseBean<Any>) {
super.onSuccess(t)
ActivityUtils.startActivity(mContext, AuthSuccActivity::class.java)
}
}))
}
}
}
}

View File

@ -11,6 +11,7 @@ import com.dahe.gldriver.net.BaseObserver
import com.dahe.gldriver.net.DataManager
import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.oss.OssServiceUtil
import com.dahe.gldriver.utils.CommonPopUtils
import com.dahe.gldriver.utils.OcrUtils
import com.dahe.glex.bean.UserDetail
import com.dahe.mylibrary.utils.PickerUtils
@ -34,7 +35,7 @@ class EditDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
var driverInfoBean = UserDetail()
var backLicName = ""
override fun initView(savedInstanceState: Bundle?) {
setStatusBarColor(R.color.white)
setTitleBar("实名认证", true)
@ -103,14 +104,25 @@ class EditDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
binding.run {
etName.setText(driverInfoBean.licenseName)
backLicName = driverInfoBean.licenseName
etId.setText(driverInfoBean.licenseNo)
tvStart.text = driverInfoBean.licenseEffectiveStart
tvEnd.text = driverInfoBean.licenseEffectiveEnd
tvCarType.text = driverInfoBean.licenseType
ImageLoader.getInstance()
.loadRoundImage(mContext, driverInfoBean.licensePhotoFaceUrl, 12, ivFront)
.loadRoundImage(
mContext,
driverInfoBean.licensePhotoFaceUrl,
12,
ivFront
)
ImageLoader.getInstance()
.loadRoundImage(mContext, driverInfoBean.licensePhotoBackUrl, 12, ivBack)
.loadRoundImage(
mContext,
driverInfoBean.licensePhotoBackUrl,
12,
ivBack
)
}
}
}))
@ -126,34 +138,38 @@ class EditDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
licenseEffectiveEnd = tvEnd.text.toString()
}
}
if (driverInfoBean.licenseName.isNullOrBlank() || driverInfoBean.licensePhotoBackUrl.isNullOrBlank()||
driverInfoBean.licenseNo.isNullOrBlank()||driverInfoBean.licenseType.isNullOrBlank()||
driverInfoBean.licenseEffectiveStart.isNullOrBlank()||driverInfoBean.licenseEffectiveEnd.isNullOrBlank()) {
if (driverInfoBean.licenseName.isNullOrBlank() || driverInfoBean.licensePhotoBackUrl.isNullOrBlank() ||
driverInfoBean.licenseNo.isNullOrBlank() || driverInfoBean.licenseType.isNullOrBlank() ||
driverInfoBean.licenseEffectiveStart.isNullOrBlank() || driverInfoBean.licenseEffectiveEnd.isNullOrBlank()
) {
ToastUtils.showToast(mContext, "请完善信息")
return
}
DataManager.getInstance().reUpDriverLicense(driverInfoBean)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
override fun onSuccess(t: CommonResponseBean<Any>) {
super.onSuccess(t)
showToast("修改成功")
setResult(RESULT_OK)
finish()
if (driverInfoBean.licenseName != backLicName) {
CommonPopUtils.getInstance()
.showCommCenterPop(mContext, content = "检测到主副页识别姓名不一致,是否继续上传?") {
DataManager.getInstance().reUpDriverLicense(driverInfoBean)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
override fun onSuccess(t: CommonResponseBean<Any>) {
super.onSuccess(t)
showToast("修改成功")
setResult(RESULT_OK)
finish()
}
}))
}
}))
}
}
private fun selFrontPic() {
OcrUtils.getInstance().ocrDriver(mContext, this) { picPath, result ->
if (result?.data?.face==null){
ToastUtils.showToast(mContext,"请选择正确证件照片")
if (result?.data?.face == null) {
ToastUtils.showToast(mContext, "请选择正确证件照片")
return@ocrDriver
}
@ -188,8 +204,8 @@ class EditDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
private fun selBackPic() {
OcrUtils.getInstance().ocrDriver(mContext, this) { picPath, result ->
if (result?.data?.back==null){
ToastUtils.showToast(mContext,"请选择正确证件照片")
if (result?.data?.back == null) {
ToastUtils.showToast(mContext, "请选择正确证件照片")
return@ocrDriver
}
result?.data?.back?.data.let {

View File

@ -11,6 +11,7 @@ import com.dahe.gldriver.net.BaseObserver
import com.dahe.gldriver.net.DataManager
import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.ui.account.AuthSuccActivity
import com.dahe.gldriver.utils.CommonPopUtils
import com.dahe.gldriver.utils.DicUtils
import com.dahe.gldriver.utils.OcrUtils
import com.dahe.mylibrary.base.BaseActivity
@ -44,6 +45,11 @@ class EditDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
}
binding.run {
btnOk.text = "确定"
tvCarColor.text = "黄色"
upDrivingInfoBean.run {
plateColorCode = "2"
plateColor = "黄色"
}
ivFront.setOnClickListener {
selFrontPic()
}
@ -91,7 +97,7 @@ class EditDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
}
}
tvEnd.setOnClickListener {
PickerUtils.getInstance().showDateSim(this@EditDrivingActivity,"有效结束日期") {
PickerUtils.getInstance().showDateSim(this@EditDrivingActivity, "有效结束日期") {
tvEnd.text = it
}
}
@ -157,6 +163,7 @@ class EditDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
.loadRoundImage(mContext, data.roadLicensePhotoUrl, 12, ivRoadFront)
etCarNum.setText(data.vehicleNum)
backLicCarNum = data.vehicleNum
tvCarType.text = data.vehicleType
etOwner.setText(data.owner)
@ -177,8 +184,8 @@ class EditDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
*/
private fun selFrontPic() {
OcrUtils.getInstance().ocrDriveing(mContext, this) { picPath, result ->
if (result?.data?.face==null){
ToastUtils.showToast(mContext,"请选择正确证件照片")
if (result?.data?.face == null) {
ToastUtils.showToast(mContext, "请选择正确证件照片")
return@ocrDriveing
}
@ -226,25 +233,30 @@ class EditDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
private fun selBackPic() {
OcrUtils.getInstance().ocrDriveing(mContext, this) { picPath, result ->
if (result?.data?.back==null){
ToastUtils.showToast(mContext,"请选择正确证件照片")
if (result?.data?.back == null) {
ToastUtils.showToast(mContext, "请选择正确证件照片")
return@ocrDriveing
}
ImageLoader.getInstance()
.loadRoundImage(mContext, picPath.locPic, 12, binding.ivBack)
upDrivingInfoBean.licenseBackUrl = picPath.picPath//行驶证照片(反面)
result?.data?.back?.data?.let {
ImageLoader.getInstance()
.loadRoundImage(mContext, picPath.locPic, 12, binding.ivBack)
backLicCarNum = it.licensePlateNumber
upDrivingInfoBean.run {
inspectionRecord = it.inspectionRecord
recordNumber = it.recordNumber
licenseBackUrl = picPath.picPath//行驶证照片(反面)
barcodeNumber = it.barcodeNumber
passengerCapacity = it.passengerCapacity
totalWeight = if (it.totalWeight.contains("kg")) it.totalWeight.split("kg")[0] else ""//总质量
curbWeight = if (it.curbWeight.contains("kg")) it.curbWeight.split("kg")[0] else ""//整备质量
approvedLoad = if (it.permittedWeight.contains("kg")) it.permittedWeight.split("kg")[0] else ""//核定载质量
tractionWeight = if (it.tractionWeight.contains("kg")) it.tractionWeight.split("kg")[0] else ""//牵引总质量
totalWeight =
if (it.totalWeight.contains("kg")) it.totalWeight.split("kg")[0] else ""//总质量
curbWeight =
if (it.curbWeight.contains("kg")) it.curbWeight.split("kg")[0] else ""//整备质量
approvedLoad =
if (it.permittedWeight.contains("kg")) it.permittedWeight.split("kg")[0] else ""//核定载质量
tractionWeight =
if (it.tractionWeight.contains("kg")) it.tractionWeight.split("kg")[0] else ""//牵引总质量
}
if (it.inspectionRecord.length > 13) {
@ -263,9 +275,12 @@ class EditDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
var overall = it.overallDimension.replace("mm", "")
var splits = overall.split("×")
if (splits.size == 3) {
upDrivingInfoBean.carLong = if (splits[0].toIntOrNull()!=null) splits[0] else ""
upDrivingInfoBean.carWidth = if (splits[1].toIntOrNull()!=null) splits[1] else ""
upDrivingInfoBean.carHeight = if (splits[2].toIntOrNull()!=null) splits[2] else ""
upDrivingInfoBean.carLong =
if (splits[0].toIntOrNull() != null) splits[0] else ""
upDrivingInfoBean.carWidth =
if (splits[1].toIntOrNull() != null) splits[1] else ""
upDrivingInfoBean.carHeight =
if (splits[2].toIntOrNull() != null) splits[2] else ""
}
}
upDrivingInfoBean.run {
@ -308,22 +323,26 @@ class EditDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
useNature = binding.etUseNature.text.trim().toString()
}
if (upDrivingInfoBean.vehicleNum!=backLicCarNum){
ToastUtils.showToast(mContext,"主副页车牌号码不一致,请重新上传")
return
if (upDrivingInfoBean.vehicleNum != backLicCarNum) {
CommonPopUtils.getInstance().showCommCenterPop(
mContext,
content = "检测到主副页识别车牌号内容不一致,是否继续上传?"
) {
DataManager.getInstance().editCar(upDrivingInfoBean)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<UpDrivingInfoBean>() {
override fun onSuccess(t: CommonResponseBean<UpDrivingInfoBean>) {
super.onSuccess(t)
showToast("修改成功")
setResult(RESULT_OK)
finish()
}
}))
}
}
DataManager.getInstance().editCar(upDrivingInfoBean)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<UpDrivingInfoBean>() {
override fun onSuccess(t: CommonResponseBean<UpDrivingInfoBean>) {
super.onSuccess(t)
showToast("修改成功")
setResult(RESULT_OK)
finish()
}
}))
}

View File

@ -11,6 +11,7 @@ import com.dahe.gldriver.net.BaseObserver
import com.dahe.gldriver.net.DataManager
import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.ui.account.AuthSuccActivity
import com.dahe.gldriver.utils.CommonPopUtils
import com.dahe.gldriver.utils.DicUtils
import com.dahe.gldriver.utils.OcrUtils
import com.dahe.mylibrary.base.BaseActivity
@ -33,6 +34,7 @@ class EditTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
var carId: String = ""
var upDrivingInfoBean = UpDrivingInfoBean()
var backLicCarNum = ""
override fun initView(savedInstanceState: Bundle?) {
setStatusBarColor(R.color.white)
setTitleBar("实名认证", true)
@ -135,6 +137,8 @@ class EditTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
tvCarColor.text = data.trailerPlateColor
// tvEnd.text = data.licenseValidity
backLicCarNum = data.vehicleNum
}
@ -193,15 +197,16 @@ class EditTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
ToastUtils.showToast(mContext, "请选择正确证件照片")
return@ocrDriveing
}
ImageLoader.getInstance()
.loadRoundImage(mContext, picPath.locPic, 12, binding.ivBack)
upDrivingInfoBean.licenseBackUrl = picPath.picPath//行驶证照片(反面)
result?.data?.back?.data?.let {
backLicCarNum = it.licensePlateNumber
ImageLoader.getInstance()
.loadRoundImage(mContext, picPath.locPic, 12, binding.ivBack)
upDrivingInfoBean.run {
inspectionRecord = it.inspectionRecord
recordNumber = it.recordNumber
licenseBackUrl = picPath.picPath//行驶证照片(反面)
barcodeNumber = it.barcodeNumber
passengerCapacity = it.passengerCapacity
totalWeight =
@ -265,31 +270,39 @@ class EditTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
if (this@EditTrailerActivity.carId.toIntOrNull() != null) this@EditTrailerActivity.carId else ""
}
if (this@EditTrailerActivity.carId.toIntOrNull() != null) {
DataManager.getInstance().addTrailer(upDrivingInfoBean)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
override fun onSuccess(t: CommonResponseBean<Any>) {
super.onSuccess(t)
showToast("修改成功")
setResult(RESULT_OK)
finish()
}
}))
} else {
DataManager.getInstance().editTrailer(upDrivingInfoBean)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
override fun onSuccess(t: CommonResponseBean<Any>) {
super.onSuccess(t)
showToast("修改成功")
setResult(RESULT_OK)
finish()
}
}))
if (upDrivingInfoBean.vehicleNum != backLicCarNum) {
CommonPopUtils.getInstance().showCommCenterPop(
mContext,
content = "检测到主副页识别车牌号内容不一致,是否继续上传?"
) {
if (this@EditTrailerActivity.carId.toIntOrNull() != null) {
DataManager.getInstance().addTrailer(upDrivingInfoBean)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
override fun onSuccess(t: CommonResponseBean<Any>) {
super.onSuccess(t)
showToast("修改成功")
setResult(RESULT_OK)
finish()
}
}))
} else {
DataManager.getInstance().editTrailer(upDrivingInfoBean)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
override fun onSuccess(t: CommonResponseBean<Any>) {
super.onSuccess(t)
showToast("修改成功")
setResult(RESULT_OK)
finish()
}
}))
}
}
}
}
}

View File

@ -272,6 +272,7 @@ class MineFragment : BaseFragment<FragmentMineBinding>(), View.OnClickListener,
}
}))
//司机证件缺失过期提醒
val userInfo = SPUtils.instance.getUserInfo(mContext)
if (userInfo?.isCarCaptain == "1") {//是否是车队长0=否,1=是,9=未选择)
binding.llNotic.visibility = View.GONE

View File

@ -12,6 +12,7 @@ import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.ui.account.authperson.EditDrivingActivity
import com.dahe.gldriver.ui.account.authperson.EditRoadActivity
import com.dahe.gldriver.ui.account.authperson.EditTrailerActivity
import com.dahe.glex.bean.CardInfo
import com.dahe.mylibrary.base.BaseActivity
import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.utils.ActivityUtils
@ -157,6 +158,25 @@ class CarDetailActivity : BaseActivity<ActivityCarDetailBinding>(), View.OnClick
initViewByData(t.data)
}
}))
//判断车辆证件是否过期
DataManager.getInstance().getCarExpiredDocumentsByDriverId()
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<MutableList<CardInfo>>() {
override fun onSuccess(t: CommonResponseBean<MutableList<CardInfo>>) {
super.onSuccess(t)
if (t.data != null && t.data.size > 0) {
t.data.find { it.carId == carId }.let {
binding.run {
tvNotic1.visibility =
if (it?.licenseValidityOverdue == "1") View.VISIBLE else View.GONE
tvNotic3.visibility =
if (it?.roadLicenseValidityOverdue == "1") View.VISIBLE else View.GONE
}
}
}
}
}))
}
private fun initViewByData(data: CarDetail) {

View File

@ -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"
@ -395,6 +415,26 @@
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_130"
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"
android:layout_width="wrap_content"

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_90"
xmlns:tools="http://schemas.android.com/tools"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_15"
android:background="@color/white"
@ -31,13 +31,38 @@
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/tvCarNum"
android:layout_width="wrap_content"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="豫A4982S"
android:textColor="@color/black"
android:textSize="@dimen/sp_18" />
android:layout_alignParentBottom="true"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tvCarNum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="豫A4982S"
android:textColor="@color/black"
android:textSize="@dimen/sp_18" />
<TextView
android:id="@+id/tvNotic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_6"
android:background="#FFEDE5"
android:gravity="center"
android:maxLines="1"
android:paddingLeft="@dimen/dp_6"
android:paddingTop="@dimen/dp_3"
android:paddingRight="@dimen/dp_6"
android:paddingBottom="@dimen/dp_3"
android:text="证件即将过期"
android:textColor="@color/main_red"
android:textSize="@dimen/dp_10"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
@ -58,11 +83,11 @@
android:textSize="@dimen/sp_12" />
<TextView
android:gravity="center"
android:id="@+id/tvCarLen"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:maxLines="1"
android:singleLine="true"
android:text="16米"
@ -75,9 +100,9 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
tools:text="30吨"
android:textColor="@color/color_9"
android:textSize="@dimen/sp_12" />
android:textSize="@dimen/sp_12"
tools:text="30吨" />
</LinearLayout>