调通听接口,未测试

This commit is contained in:
lijia 2024-04-27 17:14:44 +08:00
parent bf7d337b99
commit b58a92a381
26 changed files with 415 additions and 240 deletions

View File

@ -105,9 +105,9 @@ class App : Application() {
//初始化交通厅
JTTProcess.init(this)
SPUtil.insSP(this, "state_data", "authorization_state", "1")
// SPUtil.insSP(this, "state_data", "authorization_state", "1")
} catch (e: Exception) {
SPUtil.insSP(this, "state_data", "authorization_state", "0")
// SPUtil.insSP(this, "state_data", "authorization_state", "0")
}
}
}

View File

@ -0,0 +1,17 @@
package com.arpa.hndahesudintocctmsdriver.bean
/**
* @ClassName Jtt
* @Author john
* @Date 2024/4/27 16:19
* @Description TODO
*/
data class MyJtt(
val orderNum: String,
val trafficCode: String,
val trafficId: String,
val trafficName: String,
val trafficNum: String,
val orderId: String,
val trafficType: String
)

View File

@ -142,7 +142,7 @@ data class AuthTeamBean(
var idcardEffectiveStart: String="",
var idcardEthnicity: String="",
var idcardFrontUrl: String="",
var idcardIsEndless: String="",
var idcardIsEndless: String="0",
var idcardName: String="",
var idcardNo: String="",
var roadLicensePhotoUrl: String="",

View File

@ -0,0 +1,13 @@
package com.arpa.hndahesudintocctmsdriver.callback
import com.arpa.hndahesudintocctmsdriver.bean.UpDrivingInfoBean
/**
* @ClassName OnCarInfoInterface
* @Author john
* @Date 2024/4/27 15:48
* @Description TODO
*/
open interface OnCarInfoInterface {
fun onResutl(upDrivingInfoBean: UpDrivingInfoBean)
}

View File

@ -33,6 +33,7 @@ import com.arpa.hndahesudintocctmsdriver.bean.UpQualiInfoBean
import com.arpa.hndahesudintocctmsdriver.bean.UpRate
import com.arpa.hndahesudintocctmsdriver.bean.UpRoadInfoBean
import com.arpa.glex.bean.*
import com.arpa.hndahesudintocctmsdriver.bean.MyJtt
import com.arpa.mylibrary.net.CommonResponseBean
import io.reactivex.rxjava3.core.Observable
import okhttp3.MultipartBody
@ -283,6 +284,16 @@ interface Api {
): Observable<CommonResponseBean<MutableList<OrderBean>>>
/**
* 根据货源ID查询交通厅账号信息
*
* @param orderId String
* @return Observable<CommonResponseBean<Jtt>>
*/
@GET(BASE_URL+"driver/driverWaybill/getTrafficConfigByWaybillId")
fun getTrafficConfigByWaybillId(@Query("orderId") orderId: String): Observable<CommonResponseBean<MyJtt>>
/**
* 货源详情
* */

View File

@ -4,7 +4,7 @@ import android.app.Application
import android.content.Context
import android.content.Intent
import android.util.Log
import com.arpa.hndahesudintocctmsdriver.bean.JTT
import com.arpa.hndahesudintocctmsdriver.bean.MyJtt
import com.arpa.hndahesudintocctmsdriver.bean.OrderDetailBean
import com.arpa.hndahesudintocctmsdriver.utils.SPUtils
import com.arpa.hndahesudintocctmsdriver.utils.StringUtil
@ -35,14 +35,14 @@ object JTTProcess {
}
//获取授权
fun auth(con: Context) {
val jttStr: String = SPUtil.getSP(con, "data", "jtt")
val jtt = gson.fromJson(jttStr, JTT::class.java)
if (jtt.data == null) {
fun auth(con: Context, data: MyJtt) {
// val jttStr: String = SPUtil.getSP(con, "data", "jtt")
// val jtt = gson.fromJson(jttStr, JTT::class.java)
if (data == null) {
return
}
LocationOpenApi.auth(con, APPID, StringUtil.isNull(jtt.data.trafficCode, APP_SECURITY),
StringUtil.isNull(jtt.data.trafficId, CODE),
LocationOpenApi.auth(con, APPID, StringUtil.isNull(data.trafficCode, APP_SECURITY),
StringUtil.isNull(data.trafficId, CODE),
ENVIRONMENT, object : OnResultListener {
override fun onFailure(s: String, s1: String) {
Log.e("交通厅-获取授权", s + s1)

View File

@ -3,8 +3,10 @@ package com.arpa.hndahesudintocctmsdriver.ui.account.authperson
import android.os.Bundle
import com.arpa.hndahesudintocctmsdriver.R
import com.arpa.hndahesudintocctmsdriver.base.AppConfig
import com.arpa.hndahesudintocctmsdriver.bean.CarBean
import com.arpa.hndahesudintocctmsdriver.bean.DiCarColor
import com.arpa.hndahesudintocctmsdriver.bean.UpDrivingInfoBean
import com.arpa.hndahesudintocctmsdriver.callback.OnCarInfoInterface
import com.arpa.hndahesudintocctmsdriver.databinding.ActivityAuthDrivingBinding
import com.arpa.hndahesudintocctmsdriver.net.BaseObserver
import com.arpa.hndahesudintocctmsdriver.net.DataManager
@ -157,7 +159,7 @@ class AuthDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
//识别车辆类型后调用接口匹配code值
DicUtils.getInstance()
.getCarTypeByValue(mContext, it.vehicleType,"0") { position, item ->
.getCarTypeByValue(mContext, it.vehicleType, "0") { position, item ->
if (item != null) {
var data = item as DiCarColor
upDrivingInfoBean.run {
@ -198,10 +200,14 @@ class AuthDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
recordNumber = it.recordNumber
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) {
@ -228,9 +234,12 @@ class AuthDrivingActivity : 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 ""
}
}
@ -267,45 +276,82 @@ class AuthDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
owner = binding.etOwner.text.trim().toString()
useNature = binding.etUseNature.text.trim().toString()
}
if (upDrivingInfoBean.licenseBackUrl.isNullOrEmpty()){
if (upDrivingInfoBean.licenseBackUrl.isNullOrEmpty()) {
showToast("请完善车辆信息")
return@subMit
}
if (upDrivingInfoBean.vehicleNum!=backLicCarNum){
CommonPopUtils.getInstance().showCommCenterPop(mContext, content = "检测到主副页识别车牌号内容不一致,是否继续上传?"){
upApi()
if (upDrivingInfoBean.vehicleNum != backLicCarNum) {
CommonPopUtils.getInstance().showCommCenterPop(
mContext,
content = "检测到主副页识别车牌号内容不一致,是否继续上传?"
) {
upApi()
}
}else{
} else {
upApi()
}
}
fun upApi(){
DataManager.getInstance().addCar(upDrivingInfoBean)
fun upApi() {
DataManager.getInstance().getCarByCarVehicleNum(upDrivingInfoBean.vehicleNum)
.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 (t.data==null){
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)
})
}
}
})
)
}else{
DataManager.getInstance().bindCar(CarBean(carId = upDrivingInfoBean.carId))
.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,
Bundle().apply {
putBoolean(AppConfig.IS_GO_MINE, true)
})
}
}))
}
}
}))
}
@ -313,36 +359,15 @@ class AuthDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
* 根据车牌号查询车辆信任
* @param carNum String
*/
private fun getCarInfoByCarNum(carNum: String) {
private fun getCarInfoByCarNum(carNum: String, onCarInfoInterface: OnCarInfoInterface) {
DataManager.getInstance().getCarByCarVehicleNum(carNum)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<UpDrivingInfoBean>() {
override fun onSuccess(t: CommonResponseBean<UpDrivingInfoBean>) {
super.onSuccess(t)
t.data.let {
binding.run {
ImageLoader.getInstance()
.loadRoundImage(mContext, it.licenseFaceUrl, 12, ivFront)
ImageLoader.getInstance()
.loadRoundImage(mContext, it.licenseBackUrl, 12, ivBack)
ImageLoader.getInstance()
.loadRoundImage(mContext, it.carUrl, 12, ivCar)
ImageLoader.getInstance()
.loadRoundImage(mContext, it.roadLicensePhotoUrl, 12, ivRoadFront)
etCarNum.setText(it.vehicleNum)
etOwner.setText(it.owner)
tvCarType.text = it.vehicleType
etUseNature.setText(it.useNature)
etID.setText(it.roadLicense)
tvDate.text = it.roadLicenseValidity
}
}
onCarInfoInterface.onResutl(t.data)
}
}))
}
}

View File

@ -1,6 +1,7 @@
package com.arpa.hndahesudintocctmsdriver.ui.account.authperson
import android.os.Bundle
import com.arpa.glex.bean.UserDetail
import com.arpa.hndahesudintocctmsdriver.R
import com.arpa.hndahesudintocctmsdriver.base.AppConfig
import com.arpa.hndahesudintocctmsdriver.bean.FaceBean
@ -68,6 +69,18 @@ class AuthFaceActivity : BaseActivity<ActivityAuthFaceBinding>() {
}
override fun initDate() {
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?.isRealName != "0") {
ActivityUtils.startActivity(mContext, HomeActivity::class.java)
}
}
}))
}
override fun onStart() {

View File

@ -1,6 +1,7 @@
package com.arpa.hndahesudintocctmsdriver.ui.account.authperson
import android.os.Bundle
import com.alibaba.idst.nui.DateUtil.DEFAULT_FORMAT_DATE
import com.arpa.hndahesudintocctmsdriver.R
import com.arpa.hndahesudintocctmsdriver.bean.UpPersonInfoBean
import com.arpa.hndahesudintocctmsdriver.databinding.ActivityAuthPersonBinding
@ -18,6 +19,8 @@ import com.arpa.mylibrary.utils.TimeUtil
import com.arpa.mylibrary.utils.ToastUtils
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
import java.text.SimpleDateFormat
import java.util.Locale
/**
* @ClassName AuthRoleActivity
@ -33,8 +36,8 @@ class AuthPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
var perInfoBean: UpPersonInfoBean = UpPersonInfoBean()
override fun initView(savedInstanceState: Bundle?) {
setStatusBarColor(R.color.white)
setTitleBar("实名认证"){
ActivityUtils.startActivity(mContext,HomeActivity::class.java)
setTitleBar("实名认证") {
ActivityUtils.startActivity(mContext, HomeActivity::class.java)
}
// isOnlyShow = intent.extras?.getBoolean(AppConfig.IS_ONLY_SHOW, false) == true
@ -60,6 +63,13 @@ class AuthPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
return@setOnClickListener
}
if (!tvEnd.text.toString().contains("长期")) {
if (TimeUtil.compareDate(tvEnd.text.toString(), SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()))) {
ToastUtils.showToast(mContext, "身份证已过期,请及时更换最新证件")
}
}
DataManager.getInstance().setUpDriverIdCard(perInfoBean)
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
@ -159,7 +169,7 @@ class AuthPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
override fun onBackPressed() {
super.onBackPressed()
ActivityUtils.startActivity(mContext,HomeActivity::class.java)
ActivityUtils.startActivity(mContext, HomeActivity::class.java)
}
override fun initDate() {

View File

@ -38,6 +38,11 @@ class AuthTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
carId = intent.extras?.getString(AppConfig.CAR_ID, "").toString()
binding.run {
tvCarColor.text = "黄色"
upDrivingInfoBean.run {
plateColorCode = "2"
plateColor = "黄色"
}
ivFront.setOnClickListener {
selFrontPic()
}

View File

@ -2,6 +2,7 @@ package com.arpa.hndahesudintocctmsdriver.ui.account.authperson
import android.os.Bundle
import android.view.View
import com.arpa.glex.bean.UserDetail
import com.arpa.hndahesudintocctmsdriver.R
import com.arpa.hndahesudintocctmsdriver.base.AppConfig
import com.arpa.hndahesudintocctmsdriver.databinding.ActivityAuthPersonBinding
@ -10,7 +11,6 @@ import com.arpa.hndahesudintocctmsdriver.net.DataManager
import com.arpa.hndahesudintocctmsdriver.net.RxHttpCallBack
import com.arpa.hndahesudintocctmsdriver.utils.OcrUtils
import com.arpa.hndahesudintocctmsdriver.utils.UserUtils
import com.arpa.glex.bean.UserDetail
import com.arpa.mylibrary.base.BaseActivity
import com.arpa.mylibrary.net.CommonResponseBean
import com.arpa.mylibrary.utils.ActivityUtils
@ -20,6 +20,8 @@ import com.arpa.mylibrary.utils.TimeUtil
import com.arpa.mylibrary.utils.ToastUtils
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
import java.text.SimpleDateFormat
import java.util.Locale
/**
* @ClassName AuthRoleActivity
@ -38,6 +40,8 @@ class EditPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
setResult(RESULT_OK)
finish()
}
var isOnlyShow =
intent.extras?.getBoolean(AppConfig.IS_ONLY_SHOW, false) == true
binding.run {
btnOk.text = "确定"
@ -62,6 +66,13 @@ class EditPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
return@setOnClickListener
}
if (!tvEnd.text.toString().contains("长期")) {
if (TimeUtil.compareDate(tvEnd.text.toString(),
SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()))) {
ToastUtils.showToast(mContext, "身份证已过期,请及时更换最新证件")
}
}
DataManager.getInstance().reUpDriverIdCard(perInfoBean)
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {

View File

@ -38,6 +38,11 @@ class EditTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
binding.run {
btnOk.text = "确定"
tvCarColor.text = "黄色"
upDrivingInfoBean.run {
plateColorCode = "2"
plateColor = "黄色"
}
ivFront.setOnClickListener {
selFrontPic()
}

View File

@ -29,6 +29,7 @@ import com.arpa.glex.bean.CardInfo
import com.arpa.glex.bean.OrderBean
import com.arpa.glex.bean.UserBean
import com.arpa.glex.bean.UserDetail
import com.arpa.hndahesudintocctmsdriver.bean.MyJtt
import com.arpa.mylibrary.base.BaseFragment
import com.arpa.mylibrary.callback.RefreshCallBack
import com.arpa.mylibrary.net.CommonResponseBean
@ -190,6 +191,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(), RefreshCallBack {
})
)
DataManager.getInstance().getUserInfo()
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<UserBean>() {
@ -207,6 +209,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(), RefreshCallBack {
//执行中运单轨迹上传
OrderUtils.getInstance().upLocation(mContext)
val userInfo = SPUtils.instance.getUserInfo(mContext)
if (userInfo?.isCarCaptain == "1") {//是否是车队长0=否,1=是,9=未选择)
binding.llNotic.visibility = View.GONE

View File

@ -83,7 +83,7 @@ class InviteDriverActivity : BaseActivity<ActivityInviteDriverBinding>(), Refres
}
override fun getRefreshDate(stat: Int, page: Int, count: Int) {
getDrivers()
}
private fun getDrivers() {

View File

@ -225,7 +225,7 @@ class MineFragment : BaseFragment<FragmentMineBinding>(), View.OnClickListener,
6 -> {
ActivityUtils.startActivity(mContext, WebActivity::class.java, Bundle().apply {
putString("title", "关于我们")
putString("url", "www.baidu.com")
putString("url", "http://www.dahehuoyun.com/index.html")
})
}

View File

@ -168,8 +168,8 @@ class CarDetailActivity : BaseActivity<ActivityCarDetailBinding>(), View.OnClick
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
// tvNotic1.visibility =
// if (it?.licenseValidityOverdue == "1") View.VISIBLE else View.GONE
tvNotic3.visibility =
if (it?.roadLicenseValidityOverdue == "1") View.VISIBLE else View.GONE
}

View File

@ -3,6 +3,7 @@ package com.arpa.hndahesudintocctmsdriver.ui.mine.activity
import android.content.Context
import android.graphics.Color
import android.os.Bundle
import android.view.View
import androidx.fragment.app.Fragment
import androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback
import com.arpa.hndahesudintocctmsdriver.adapter.PagersAdapter
@ -138,6 +139,7 @@ class CarTeamManActivity : BaseActivity<ActivityCarTeamBinding>() {
val data = t.data
binding.run {
tvCapName.text = data.captainName
tvStatu.visibility = if (data.auditStatus == "100003") View.GONE else View.VISIBLE
tvStatu.text =
if (data.auditStatus == "100002") "审核中" else if (data.auditStatus == "100003") "审核通过" else if (data.auditStatus == "100001") "待认证" else "待认证"
ImageLoader.getInstance().loadCircleImage(mContext, data.avatar, ivHead)

View File

@ -2,6 +2,10 @@ package com.arpa.hndahesudintocctmsdriver.ui.mine.activity
import android.os.Bundle
import android.view.View
import cn.jpush.android.api.JPushInterface
import cn.jpush.android.ups.JPushUPSManager
import cn.jpush.android.ups.TokenResult
import cn.jpush.android.ups.UPSTurnCallBack
import com.arpa.hndahesudintocctmsdriver.R
import com.arpa.hndahesudintocctmsdriver.databinding.ActivitySettingBinding
import com.arpa.hndahesudintocctmsdriver.push.PushHelper
@ -34,23 +38,13 @@ class SettingActivity : BaseActivity<ActivitySettingBinding>(), View.OnClickList
when (view?.id) {
binding.rlOne.id -> {
if (binding.svTog.isOpened) {
PushHelper.delete(mContext, object : PushAliasListener {
override fun onResult(isSuccess: Boolean) {
binding.svTog.toggleSwitch(false)
}
})
JPushUPSManager.turnOffPush(mContext) {
binding.svTog.toggleSwitch(false)
}
} else {
PushHelper.setAlias(mContext, object : PushAliasListener {
override fun onResult(isSuccess: Boolean) {
if (isSuccess){
binding.svTog.toggleSwitch(true)
}else{
showToast("开启失败,请登录重试")
}
}
})
JPushUPSManager.turnOnPush(
mContext
) { binding.svTog.toggleSwitch(true) }
}
}

View File

@ -28,10 +28,13 @@ import com.arpa.mylibrary.utils.ActivityUtils
import com.arpa.mylibrary.utils.BaseUtils
import com.arpa.mylibrary.utils.ConvertUtils
import com.arpa.mylibrary.utils.LoadingUtils
import com.arpa.mylibrary.utils.TimeUtil
import com.arpa.mylibrary.utils.ToastUtils
import com.permissionx.guolindev.PermissionX
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
import java.text.SimpleDateFormat
import java.util.Locale
/**
* @ClassName WaybillDetailActivity
@ -98,7 +101,10 @@ class WaybillDetailActivity : BaseActivity<ActivityWaybillDetailBinding>() {
|${s}""".trimMargin()
}
binding.run {
tvTime.text = t.data.receiverDeadline
tvTime.text = """${TimeUtil.changeDateNoneFormat(t.data.receiverDeadline,
"yyyy-MM-dd"
)} 卸货"""
tvCom.text = t.data.receiverBusinessName
tvUnloadDis.text = t.data.distance + "km"
tvCarType.text = """${t.data.vehicleLength} ${t.data.vehicleType}"""

View File

@ -7,6 +7,7 @@ import android.os.Bundle
import com.arpa.hndahesudintocctmsdriver.base.AppConfig
import com.arpa.hndahesudintocctmsdriver.base.AppConfig.NEED_UP_ORDER
import com.arpa.hndahesudintocctmsdriver.bean.CarBean
import com.arpa.hndahesudintocctmsdriver.bean.MyJtt
import com.arpa.hndahesudintocctmsdriver.bean.OrderDetailBean
import com.arpa.hndahesudintocctmsdriver.bean.UpDriverCar
import com.arpa.hndahesudintocctmsdriver.callback.OnResultListener
@ -14,6 +15,7 @@ import com.arpa.hndahesudintocctmsdriver.net.BaseObserver
import com.arpa.hndahesudintocctmsdriver.net.DataManager
import com.arpa.hndahesudintocctmsdriver.net.RxHttpCallBack
import com.arpa.hndahesudintocctmsdriver.service.UpLocationService2
import com.arpa.hndahesudintocctmsdriver.third.JTTProcess
import com.arpa.hndahesudintocctmsdriver.ui.waybill.activity.WaybillLoadActivity
import com.arpa.mylibrary.base.SingletonNoPHolder
import com.arpa.mylibrary.net.CommonResponseBean
@ -112,7 +114,7 @@ class OrderUtils private constructor() {
return
}
CommonPopUtils.getInstance()
.showCarList(context, t.data, true,selDriverId,selCarId) {
.showCarList(context, t.data, true, selDriverId, selCarId) {
//分配车辆redeliveryOrder
DataManager.getInstance()
.redeliveryOrder(UpDriverCar(orderId, it.driverId, it.carId))
@ -146,7 +148,7 @@ class OrderUtils private constructor() {
return
}
CommonPopUtils.getInstance()
.showCarList(context, t.data, false,selDriverId,selCarId) {
.showCarList(context, t.data, false, selDriverId, selCarId) {
//接单接口
receivingOrders(context, orderId, it, listener)
}
@ -210,7 +212,7 @@ class OrderUtils private constructor() {
*/
fun upLocation(context: Context) {
val userInfo = SPUtils.instance.getUserInfo(context)
if (userInfo!=null && userInfo.isCarCaptain == "1")//车队长角色不需要上传轨迹
if (userInfo != null && userInfo.isCarCaptain == "1")//车队长角色不需要上传轨迹
return
DataManager.getInstance().orderDetail("")
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
@ -229,6 +231,20 @@ class OrderUtils private constructor() {
} else {
context.startService(Intent(context, UpLocationService2::class.java))
}
// //初始化交通厅
// DataManager.getInstance().getTrafficConfigByWaybillId(t.data.orderId)
DataManager.getInstance().getTrafficConfigByWaybillId("98")
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(context, object : RxHttpCallBack<MyJtt>() {
override fun onSuccess(t: CommonResponseBean<MyJtt>) {
super.onSuccess(t)
if (t.data != null && !t.data.trafficCode.isNullOrEmpty()) {
JTTProcess.auth(context,t.data)
}
}
}))
} else {
context.stopService(Intent(context, UpLocationService2::class.java))
BaseSPUtils.remove(context, NEED_UP_ORDER)

View File

@ -45,6 +45,9 @@
android:background="@drawable/head_defaut" />
<TextView
android:maxWidth="@dimen/dp_160"
android:maxLines="1"
android:ellipsize="end"
android:id="@+id/tvCapName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

View File

@ -8,6 +8,7 @@
<include layout="@layout/common_toolbar"></include>
<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_15"
@ -84,4 +85,13 @@
</LinearLayout>
</LinearLayout>
<TextView
android:layout_marginTop="@dimen/dp_20"
android:gravity="center"
android:layout_marginBottom="@dimen/dp_20"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="ICP备案号:豫ICP备09025418号-24A"
/>
</LinearLayout>

View File

@ -8,9 +8,9 @@
app:srlEnableLoadMore="false">
<androidx.core.widget.NestedScrollView
android:fillViewport="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:fillViewport="true">
<RelativeLayout
android:layout_width="match_parent"
@ -55,10 +55,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
tools:text="张学友"
android:textColor="@color/black"
android:textSize="@dimen/sp_18"
android:textStyle="bold" />
android:textStyle="bold"
tools:text="张学友" />
</LinearLayout>
@ -111,168 +111,174 @@
</LinearLayout>
<LinearLayout
android:visibility="gone"
android:id="@+id/llNotic"
android:id="@+id/lltwo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
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/llNotic"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_15"
android:background="@drawable/shape_white_12"
android:padding="@dimen/sp_16">
<TextView
android:id="@+id/tvMoneyTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="我的钱包"
android:textColor="@color/black"
android:textSize="@dimen/sp_16"
android:textStyle="bold"></TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/tvMoneyTitle"
android:layout_alignParentRight="true"
android:drawableRight="@drawable/right_gray"
android:drawablePadding="@dimen/dp_5"
android:gravity="bottom"
android:text="进入钱包"
android:textColor="@color/color_9"
android:textSize="@dimen/sp_12"></TextView>
android:orientation="vertical">
<LinearLayout
android:visibility="gone"
android:id="@+id/llNotic"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal">
android:layout_height="@dimen/dp_36"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="@dimen/dp_8">
<LinearLayout
android:layout_width="0dp"
<TextView
android:id="@+id/tvNotic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
android:maxLines="1"
android:singleLine="true"
android:text="您的实名认证资料不全,请继续进行上传证件。"
android:textColor="@color/main_red"
android:textSize="@dimen/dp_12" />
<TextView
android:id="@+id/tvWalletBa"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:text="26431.5"
android:textColor="@color/black"
android:textSize="@dimen/sp_20"
android:textStyle="bold"></TextView>
<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" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:text="余额(元)"
android:textColor="@color/color_9"
android:textSize="@dimen/sp_12"></TextView>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/tvBankNum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:textColor="@color/black"
android:textSize="@dimen/sp_20"
android:textStyle="bold"></TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:text="银行卡"
android:textColor="@color/color_9"
android:textSize="@dimen/sp_12"></TextView>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/tvIncome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2643.5"
android:textColor="@color/black"
android:textSize="@dimen/sp_20"
android:textStyle="bold"></TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:text="累计收益(元)"
android:textColor="@color/color_9"
android:textSize="@dimen/sp_12"></TextView>
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:id="@+id/rlMoney"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_120"
android:layout_below="@+id/llNotic"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_15"
android:background="@drawable/shape_white_12"
android:padding="@dimen/sp_16">
</RelativeLayout>
<TextView
android:id="@+id/tvMoneyTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="我的钱包"
android:textColor="@color/black"
android:textSize="@dimen/sp_16"
android:textStyle="bold"></TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/tvMoneyTitle"
android:layout_alignParentRight="true"
android:drawableRight="@drawable/right_gray"
android:drawablePadding="@dimen/dp_5"
android:gravity="bottom"
android:text="进入钱包"
android:textColor="@color/color_9"
android:textSize="@dimen/sp_12"></TextView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/tvWalletBa"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:text="26431.5"
android:textColor="@color/black"
android:textSize="@dimen/sp_20"
android:textStyle="bold"></TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:text="余额(元)"
android:textColor="@color/color_9"
android:textSize="@dimen/sp_12"></TextView>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/tvBankNum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:textColor="@color/black"
android:textSize="@dimen/sp_20"
android:textStyle="bold"></TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:text="银行卡"
android:textColor="@color/color_9"
android:textSize="@dimen/sp_12"></TextView>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/tvIncome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2643.5"
android:textColor="@color/black"
android:textSize="@dimen/sp_20"
android:textStyle="bold"></TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:text="累计收益(元)"
android:textColor="@color/color_9"
android:textSize="@dimen/sp_12"></TextView>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
<RelativeLayout
android:id="@+id/rlTools"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_120"
android:layout_below="@+id/rlMoney"
android:layout_below="@+id/lltwo"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginRight="@dimen/dp_15"

View File

@ -143,7 +143,7 @@
android:id="@+id/tvCom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="@dimen/dp_200"
android:maxWidth="@dimen/dp_140"
android:maxLines="1"
android:ellipsize="end"
android:layout_alignTop="@+id/imgHead"

View File

@ -201,7 +201,7 @@
android:id="@+id/ivHead"
android:layout_width="@dimen/dp_41"
android:layout_height="@dimen/dp_41"
android:background="@color/color_9" />
android:src="@color/color_9" />
<LinearLayout
android:layout_width="wrap_content"
@ -211,10 +211,12 @@
<TextView
android:id="@+id/tvComName"
android:maxLines="1"
android:singleLine="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:text="安徽东阳矿业科技有限公司"
android:text="安徽东阳矿业科技有限公司安徽东阳矿业科技有限公司"
android:textColor="@color/black"
android:textSize="@dimen/sp_15" />

View File

@ -1714,6 +1714,29 @@ public final class TimeUtil {
}
}
/**
* 比较时间大小
*
* @param compareDate
* @return
*/
public static boolean compareDate( String compareDate, DateFormat format) {
DateFormat df = format;
try {
Date now = df.parse(getNowString(format)) ;
Date compare = df.parse(compareDate);
if (now.after(compare)) {
return true;
} else {
return false;
}
} catch (ParseException e) {
e.printStackTrace();
return false;
}
}
/**
* 比较时间大小
*