安联认证 接单调试
This commit is contained in:
parent
e580b8872e
commit
eee2b7f226
@ -111,7 +111,7 @@ class App : Application() {
|
||||
//安联初始化
|
||||
if (packageName == getCurrentProcessName(this)) {
|
||||
//Log.e("--使用的测试环境--",BuildConfig.OPEN_API_URL);
|
||||
MDPLocationCollectionManager.initialize(this, BuildConfig.OPEN_AL_URL)
|
||||
MDPLocationCollectionManager.initialize(applicationContext, BuildConfig.OPEN_AL_URL)
|
||||
MDPLocationCollectionManager.initServiceProcessProguard(context) // 保活代码
|
||||
startService(Intent(this, PlayerMusicService::class.java)) // 保活代码
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ data class WaybillPhoto(
|
||||
var location: String= "",
|
||||
var longitude: String= "",
|
||||
var photoUrl: String= "",
|
||||
var localPhotoUrl: String= "",
|
||||
var receiptType: String= "",
|
||||
var sortvarue: String= "",
|
||||
var type: String= ""
|
||||
|
@ -346,7 +346,7 @@ public class OssServiceUtil {
|
||||
}
|
||||
|
||||
public interface picResultCallback {
|
||||
void getPicData(PutObjectResult data, String oldPath);
|
||||
void getPicData(PutObjectResult data, String netPath);
|
||||
}
|
||||
|
||||
public interface PicsResultCallback {
|
||||
|
@ -49,8 +49,7 @@ class ALProcess {
|
||||
idy.appKey = if (BuildConfig.isTest) APP_KEY_TEXT else APP_KEY
|
||||
//司机身份证
|
||||
idy.driverIdentity = userInfo?.idcard
|
||||
// idy.driverIdentity = "410823197610206636"
|
||||
//idy.setDriverIdentity("410725198311042012");
|
||||
// idy.driverIdentity = "410423199703041014"
|
||||
MDPLocationCollectionManager.register(con, idy, object : OnResultListener {
|
||||
override fun onSuccess() {
|
||||
Log.e("--success--", "验证成功")
|
||||
|
@ -70,7 +70,7 @@ class LauncherActivity : BaseActivity<ActivityLauncherBinding>() {
|
||||
//安联初始化
|
||||
if (packageName == getCurrentProcessName(this)) {
|
||||
//Log.e("--使用的测试环境--",BuildConfig.OPEN_API_URL);
|
||||
MDPLocationCollectionManager.initialize(this, BuildConfig.OPEN_AL_URL)
|
||||
MDPLocationCollectionManager.initialize(applicationContext, BuildConfig.OPEN_AL_URL)
|
||||
}
|
||||
//初始化交通厅
|
||||
JTTProcess.init(application)
|
||||
|
@ -12,6 +12,7 @@ import com.dahe.gldriver.adapter.GridItemAdapter
|
||||
import com.dahe.gldriver.adapter.WaybillAdapter
|
||||
import com.dahe.gldriver.base.AppConfig
|
||||
import com.dahe.gldriver.base.WebActivity
|
||||
import com.dahe.gldriver.bean.AuthTeamBean
|
||||
import com.dahe.gldriver.bean.GridBean
|
||||
import com.dahe.gldriver.databinding.FragmentHomeBinding
|
||||
import com.dahe.gldriver.event.GoWaybillEvent
|
||||
@ -19,10 +20,12 @@ import com.dahe.gldriver.net.BaseObserver
|
||||
import com.dahe.gldriver.net.DataManager
|
||||
import com.dahe.gldriver.net.RxHttpCallBack
|
||||
import com.dahe.gldriver.third.ALProcess
|
||||
import com.dahe.gldriver.ui.account.authteam.EditCaTeamActivity
|
||||
import com.dahe.gldriver.ui.home.activity.BusinessActivity
|
||||
import com.dahe.gldriver.ui.mine.activity.PersonInfoActivity
|
||||
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.OrderBean
|
||||
import com.dahe.glex.bean.UserBean
|
||||
@ -140,7 +143,17 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(), RefreshCallBack {
|
||||
}
|
||||
|
||||
llNotic.setOnClickListener {
|
||||
ActivityUtils.startActivity(mContext, PersonInfoActivity::class.java)
|
||||
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()
|
||||
@ -178,26 +191,33 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(), RefreshCallBack {
|
||||
})
|
||||
)
|
||||
|
||||
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
|
||||
else
|
||||
binding.llNotic.visibility = View.GONE
|
||||
}
|
||||
}))
|
||||
|
||||
//执行中运单轨迹上传
|
||||
OrderUtils.getInstance().upLocation(mContext)
|
||||
|
||||
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
|
||||
else
|
||||
binding.llNotic.visibility = View.GONE
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
DataManager.getInstance().getUserInfo()
|
||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<UserBean>() {
|
||||
@ -210,8 +230,6 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(), RefreshCallBack {
|
||||
//初始化安联
|
||||
if (t.data.auditStatus == "100003")
|
||||
ALProcess.verification(mContext)
|
||||
|
||||
|
||||
}
|
||||
}))
|
||||
|
||||
|
@ -6,6 +6,7 @@ import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.viewpager2.widget.ViewPager2.GONE
|
||||
import androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback
|
||||
import com.dahe.gldriver.adapter.PagersAdapter
|
||||
import com.dahe.gldriver.base.AppConfig
|
||||
@ -78,6 +79,9 @@ class DriverTeamDetailActivity : BaseActivity<ActivityDriverTeamDetailBinding>()
|
||||
|
||||
mFragmentContainerHelper.handlePageSelected(0, true)
|
||||
|
||||
binding.run {
|
||||
tvStatu.visibility = GONE
|
||||
}
|
||||
binding.viewPager.adapter = pagerAdapter
|
||||
binding.viewPager.currentItem = 0
|
||||
binding.viewPager.registerOnPageChangeCallback(object : OnPageChangeCallback() {
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.dahe.gldriver.ui.waybill.activity
|
||||
|
||||
import android.Manifest
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
@ -11,8 +12,10 @@ 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.dahe.gldriver.R
|
||||
import com.dahe.gldriver.base.AppConfig
|
||||
import com.dahe.gldriver.bean.LUInputBean
|
||||
import com.dahe.gldriver.bean.OrderDetailBean
|
||||
import com.dahe.gldriver.bean.UpPicBean
|
||||
import com.dahe.gldriver.bean.WaybillPhoto
|
||||
import com.dahe.gldriver.databinding.ActivityWaybillUppicBinding
|
||||
@ -22,6 +25,7 @@ import com.dahe.gldriver.net.RxHttpCallBack
|
||||
import com.dahe.gldriver.oss.OssServiceUtil
|
||||
import com.dahe.gldriver.third.JTTProcess
|
||||
import com.dahe.gldriver.utils.GDLocationUtils
|
||||
import com.dahe.gldriver.utils.LocationUtils
|
||||
import com.dahe.gldriver.utils.OcrUtils
|
||||
import com.dahe.gldriver.utils.OrderUtils
|
||||
import com.dahe.mylibrary.adapter.GridImageAdapter
|
||||
@ -29,8 +33,10 @@ import com.dahe.mylibrary.adapter.GridImageAdapter.OnItemClickListener
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.mylibrary.net.CommonResponseBean
|
||||
import com.dahe.mylibrary.utils.ActivityUtils
|
||||
import com.dahe.mylibrary.utils.BaseUtils
|
||||
import com.dahe.mylibrary.utils.BitmapUtil
|
||||
import com.dahe.mylibrary.utils.FileUtil
|
||||
import com.dahe.mylibrary.utils.ImageLoader
|
||||
import com.dahe.mylibrary.utils.LoadingUtils
|
||||
import com.dahe.mylibrary.utils.PopsUtils
|
||||
import com.dahe.mylibrary.utils.ToastUtils
|
||||
@ -38,6 +44,7 @@ import com.dahe.mylibrary.weight.FullyGridLayoutManager
|
||||
import com.luck.picture.lib.decoration.GridSpacingItemDecoration
|
||||
import com.luck.picture.lib.entity.LocalMedia
|
||||
import com.luck.picture.lib.utils.DensityUtil
|
||||
import com.permissionx.guolindev.PermissionX
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||
import java.io.File
|
||||
@ -61,6 +68,7 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
||||
lateinit var bdLatLng: LatLng
|
||||
|
||||
private val lub: LUInputBean = LUInputBean()
|
||||
lateinit var orderBean: OrderDetailBean
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
upBean = UpPicBean()
|
||||
@ -78,8 +86,6 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
||||
tvRece.text = "装货回单"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
binding.run {
|
||||
tvPosi.setOnClickListener {
|
||||
getLocation()
|
||||
@ -130,6 +136,7 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
||||
setResultCallBack { data, oldPath ->
|
||||
picBean = WaybillPhoto()
|
||||
picBean.run {
|
||||
localPhotoUrl = it[0].realPath
|
||||
photoUrl = oldPath
|
||||
receiptType =
|
||||
if (type == 1) "4" else if (type == 2) "5" else "6"
|
||||
@ -158,6 +165,7 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
||||
setResultCallBack { data, oldPath ->
|
||||
picBean = WaybillPhoto()
|
||||
picBean.run {
|
||||
localPhotoUrl = it[0].realPath
|
||||
photoUrl = oldPath
|
||||
receiptType =
|
||||
if (type == 1) "4" else if (type == 2) "5" else "6"
|
||||
@ -189,6 +197,17 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
||||
subMit(type)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//获取运单信息
|
||||
DataManager.getInstance().orderDetail(orderId)
|
||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<OrderDetailBean>() {
|
||||
override fun onSuccess(t: CommonResponseBean<OrderDetailBean>) {
|
||||
super.onSuccess(t)
|
||||
orderBean = t.data
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
private fun subMit(orderType: Int?) {
|
||||
@ -233,48 +252,54 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
||||
l.location = binding.tvLoca.text.toString()
|
||||
l.time = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(Date())
|
||||
|
||||
if (orderType == 1) {//装货
|
||||
load(l)
|
||||
}else{//卸货
|
||||
unLoad(l)
|
||||
}
|
||||
|
||||
|
||||
DataManager.getInstance().driverLoadOrUnload(upBean)
|
||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
|
||||
override fun onSuccess(t: CommonResponseBean<Any>) {
|
||||
super.onSuccess(t)
|
||||
if (1 == orderType) {
|
||||
ActivityUtils.startActivity(
|
||||
mContext,
|
||||
WaybillSuccActivity::class.java,
|
||||
intent.extras
|
||||
)
|
||||
//装货成功-开启轨迹上传
|
||||
OrderUtils.getInstance().upLocation(mContext)
|
||||
} else {
|
||||
OrderUtils.getInstance().stopUpLocation(mContext)
|
||||
ActivityUtils.startActivity(
|
||||
mContext,
|
||||
WaybillSuccActivity::class.java,
|
||||
intent.extras
|
||||
)
|
||||
}
|
||||
}
|
||||
}))
|
||||
// DataManager.getInstance().driverLoadOrUnload(upBean)
|
||||
// .subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||
// .subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
|
||||
// override fun onSuccess(t: CommonResponseBean<Any>) {
|
||||
// super.onSuccess(t)
|
||||
// if (1 == orderType) {
|
||||
// ActivityUtils.startActivity(
|
||||
// mContext,
|
||||
// WaybillSuccActivity::class.java,
|
||||
// intent.extras
|
||||
// )
|
||||
// //装货成功-开启轨迹上传
|
||||
// OrderUtils.getInstance().upLocation(mContext)
|
||||
// } else {
|
||||
// OrderUtils.getInstance().stopUpLocation(mContext)
|
||||
// ActivityUtils.startActivity(
|
||||
// mContext,
|
||||
// WaybillSuccActivity::class.java,
|
||||
// intent.extras
|
||||
// )
|
||||
// }
|
||||
// }
|
||||
// }))
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun load(location: Location) {
|
||||
MDPLocationCollectionManager.pickup(mContext, "", location, object : OnResultListener {
|
||||
MDPLocationCollectionManager.pickup(mContext, orderBean.orderNum, location, object : OnResultListener {
|
||||
override fun onSuccess() {
|
||||
Log.e("上报安联", "装货上传成功")
|
||||
|
||||
//上传安联和交通厅,平台-装货
|
||||
// JTTProcess.start(mContext, sob, "")
|
||||
JTTProcess.start(mContext, orderBean, "")
|
||||
upLoadImage()
|
||||
|
||||
}
|
||||
|
||||
override fun onFailure(p0: String?, p1: String?) {
|
||||
Log.e("上报安联失败(装货):", p0 + p1)
|
||||
ToastUtils.showToast(mContext,"""${p1},${p0}""")
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -310,9 +335,11 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
||||
//上传安联装货
|
||||
fun upLoadImage() {
|
||||
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||
val file: File = File("")
|
||||
|
||||
var photoPaht = upBean.waybillPhotoList.find { it.type=="1" }?.localPhotoUrl
|
||||
val file: File = File(photoPaht)
|
||||
val image = Image()
|
||||
val base: String = BitmapUtil.imageToBase64("path")
|
||||
val base: String = BitmapUtil.imageToBase64(photoPaht)
|
||||
image.fileData = "data:image/" + FileUtil.lastName(file) + ";base64," + base
|
||||
image.fileExt = FileUtil.lastName(file)
|
||||
image.fileName = FileUtil.fileName(file)
|
||||
@ -339,9 +366,10 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
||||
|
||||
//上传安联卸货
|
||||
fun upUnloadImage() {
|
||||
val file: File = File("path")
|
||||
var photoPaht = upBean.waybillPhotoList.find { it.type=="1" }?.localPhotoUrl
|
||||
val file: File = File(photoPaht)
|
||||
val image = Image()
|
||||
val base = BitmapUtil.imageToBase64("path")
|
||||
val base = BitmapUtil.imageToBase64(photoPaht)
|
||||
image.fileData = "data:image/" + FileUtil.lastName(file) + ";base64," + base
|
||||
image.fileExt = FileUtil.lastName(file)
|
||||
image.fileName = FileUtil.fileName(file)
|
||||
@ -512,6 +540,7 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
||||
myAdapter.notifyDataSetChanged()
|
||||
picBean = WaybillPhoto()
|
||||
picBean.run {
|
||||
localPhotoUrl = it[0].realPath
|
||||
photoUrl = oldPath
|
||||
this.type = if (goodType == 1) "1" else "2"
|
||||
}
|
||||
|
@ -3,16 +3,16 @@
|
||||
android:id="@+id/refresh"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true">
|
||||
>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
@ -193,7 +193,7 @@
|
||||
android:paddingRight="@dimen/dp_14"></androidx.recyclerview.widget.RecyclerView>
|
||||
|
||||
<LinearLayout
|
||||
android:visibility="gone"
|
||||
|
||||
android:id="@+id/llNotic"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_36"
|
||||
|
Loading…
Reference in New Issue
Block a user