安联集成测试,交通厅未测试

This commit is contained in:
lijia 2024-04-22 11:01:33 +08:00
parent eee2b7f226
commit a9fa17ca85
8 changed files with 160 additions and 109 deletions

View File

@ -37,6 +37,7 @@ data class OrderDetailBean(
val vehicleNum: String,
val loadingAreaCode: String,
val receiverAreaCode: String,
val report: String,
val waybillInfo: WaybillInfo
@ -56,6 +57,7 @@ data class Goods(
val goodCube: String,
val goodItemGrossWeight: String,
val goodName: String,
val packName: String,
val goodNum: String,
val orderGoodsId: String
)

View File

@ -151,6 +151,8 @@ data class AuthTeamBean(
var roadLicensevaridity: String="",
var businessLicensePhoneUrl: String="",
var businessLicenseCreditCode: String="",
var businessEnterpriseName: String="",
var businessLegalPerson: String="",
var businessLicenseEffectiveStart: String="",
var businessLicenseEffectiveEnd: String="",
var idcardSex: String=""

View File

@ -192,8 +192,10 @@ 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 ""
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) {
@ -207,15 +209,6 @@ class AuthDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
}
}
//牵引总质量
if (it.tractionWeight.contains("kg")) {
upDrivingInfoBean.tractionWeight = it.tractionWeight.split("kg")[0]
}
//核定载质量
if (it.permittedWeight.contains("kg")) {
upDrivingInfoBean.approvedLoad = it.permittedWeight.split("kg")[0]
}
upDrivingInfoBean.run {
overallDimension = it.overallDimension
energySignCode = it.energySign

View File

@ -241,8 +241,10 @@ class EditDrivingActivity : 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 ""
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) {
@ -255,14 +257,6 @@ class EditDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
binding.tvEnd.text = changeDateNoneFormat
}
}
//牵引总质量
if (it.tractionWeight.contains("kg")) {
upDrivingInfoBean.tractionWeight = it.tractionWeight.split("kg")[0]
}
//核定载质量
if (it.permittedWeight.contains("kg")) {
upDrivingInfoBean.approvedLoad = it.permittedWeight.split("kg")[0]
}
//车长
if (it.overallDimension.contains("mm")) {

View File

@ -52,6 +52,8 @@ class AuthTeamActivity : BaseActivity<ActivityAuthTeamBinding>(), View.OnClickLi
result?.data?.run {
upComInfoBean.businessLicenseCreditCode = creditCode
upComInfoBean.businessEnterpriseName = companyName
upComInfoBean.businessLegalPerson = legalPerson
upComInfoBean.businessLicenseEffectiveStart =
TimeUtil.changeDateNoneFormat(validFromDate)
upComInfoBean.businessLicenseEffectiveEnd =

View File

@ -48,6 +48,8 @@ class EditCaTeamActivity : BaseActivity<ActivityAuthTeamEditBinding>(), View.OnC
result?.data?.run {
upComInfoBean.businessLicenseCreditCode = creditCode
upComInfoBean.businessEnterpriseName = companyName
upComInfoBean.businessLegalPerson = legalPerson
upComInfoBean.businessLicenseEffectiveStart =
TimeUtil.changeDateNoneFormat(validFromDate)
upComInfoBean.businessLicenseEffectiveEnd =

View File

@ -1,6 +1,5 @@
package com.dahe.gldriver.ui.waybill.activity
import android.Manifest
import android.os.Bundle
import android.util.Log
import android.view.View
@ -12,7 +11,6 @@ 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
@ -25,7 +23,6 @@ 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
@ -33,18 +30,16 @@ 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.TimeUtil
import com.dahe.mylibrary.utils.ToastUtils
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
@ -136,7 +131,7 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
setResultCallBack { data, oldPath ->
picBean = WaybillPhoto()
picBean.run {
localPhotoUrl = it[0].realPath
localPhotoUrl = it[0].availablePath
photoUrl = oldPath
receiptType =
if (type == 1) "4" else if (type == 2) "5" else "6"
@ -165,7 +160,7 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
setResultCallBack { data, oldPath ->
picBean = WaybillPhoto()
picBean.run {
localPhotoUrl = it[0].realPath
localPhotoUrl = it[0].availablePath
photoUrl = oldPath
receiptType =
if (type == 1) "4" else if (type == 2) "5" else "6"
@ -235,17 +230,15 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
showToast("卸货请上传卸货回单照片")
return
}
var dis =
TimeUtil.compareNowDate(TimeUtil.string2Millis(orderBean.waybillInfo.loadTime))
if (dis <= 5) { //大于五分钟可以接单
ToastUtils.showToast(this@WaybillUpPicActivity, "请到卸货地再进行卸货操作!")
return
}
}
//装货
// lub.latitude = latLng.latitude.toString()
// lub.longitude = latLng.longitude.toString()
// lub.locationAddress = binding.tvLoca.text.toString()
// //todo imageId需确定
// lub.imageId = upBean.waybillPhotoList.filter { it.type == "1" }.map { it.photoUrl.toInt() }
// lub.waybillId = ""
val l = Location()
l.baiduLongitude = bdLatLng.longitude
l.baiduLatitude = bdLatLng.latitude
@ -254,7 +247,7 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
if (orderType == 1) {//装货
load(l)
}else{//卸货
} else {//卸货
unLoad(l)
}
@ -287,41 +280,70 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
}
private fun load(location: Location) {
MDPLocationCollectionManager.pickup(mContext, orderBean.orderNum, location, object : OnResultListener {
override fun onSuccess() {
Log.e("上报安联", "装货上传成功")
MDPLocationCollectionManager.pickup(
mContext,
orderBean.orderNum,
location,
object : OnResultListener {
override fun onSuccess() {
Log.e("上报安联", "装货上传成功")
//上传安联和交通厅,平台-装货
JTTProcess.start(mContext, orderBean, "")
upLoadImage()
//上传安联和交通厅,平台-装货
//交通厅
if (orderBean.report === "1") {
JTTProcess.start(mContext, orderBean, "")
}
}
upLoadImage()
override fun onFailure(p0: String?, p1: String?) {
Log.e("上报安联失败(装货):", p0 + p1)
ToastUtils.showToast(mContext,"""${p1},${p0}""")
}
})
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)
//装货成功-开启轨迹上传
OrderUtils.getInstance().upLocation(mContext)
}
}))
}
override fun onFailure(p0: String?, p1: String?) {
Log.e("上报安联失败(装货):", p0 + p1)
ToastUtils.showToast(mContext, """${p1},${p0}""")
}
})
}
private fun unLoad(location: Location) {
MDPLocationCollectionManager.unload(mContext, "getShippingNoteNumber()", location,
MDPLocationCollectionManager.unload(mContext, orderBean.orderNum, location,
object : OnResultListener {
override fun onSuccess() {
Log.e("上报安联", "卸货上传成功")
//交通厅
// if (sob.getData().getReport() === 1) {
// JTTProcess.stop(mContext, sob, "")
// }
// 交通厅
if (orderBean.report === "1") {
JTTProcess.stop(mContext, orderBean, "")
}
//卸货状态-平台
// hyr.dischargeCargo(lub)
//卸货照片-安联
upUnloadImage()
//卸货回单
upTrafficSign()
upTrafficReceipt()
upTrafficSign(location)
upTrafficReceipt(location)
receiptImage()
//平台更换运单状态
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)
}
}))
}
override fun onFailure(s: String, s1: String) {
@ -336,8 +358,8 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
fun upLoadImage() {
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
var photoPaht = upBean.waybillPhotoList.find { it.type=="1" }?.localPhotoUrl
val file: File = File(photoPaht)
var photoPaht = upBean.waybillPhotoList.find { it.type == "1" }?.localPhotoUrl
val file = File(photoPaht)
val image = Image()
val base: String = BitmapUtil.imageToBase64(photoPaht)
image.fileData = "data:image/" + FileUtil.lastName(file) + ";base64," + base
@ -349,13 +371,17 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
image.location = binding.tvLoca.text.toString()
MDPLocationCollectionManager.uploadPickupImage(
mContext,
"sob.getData().getShippingNoteNumber()",
orderBean.orderNum,
image,
object : OnResultListener {
override fun onSuccess() {
Log.e("上报安联", "装货照片上传成功")
Toast.makeText(mContext, "上传成功", Toast.LENGTH_SHORT).show()
finish()
ActivityUtils.startActivity(
mContext,
WaybillSuccActivity::class.java,
intent.extras
)
}
override fun onFailure(s: String, s1: String) {
@ -366,8 +392,8 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
//上传安联卸货
fun upUnloadImage() {
var photoPaht = upBean.waybillPhotoList.find { it.type=="1" }?.localPhotoUrl
val file: File = File(photoPaht)
var photoPaht = upBean.waybillPhotoList.find { it.type == "2" }?.localPhotoUrl
val file = File(photoPaht)
val image = Image()
val base = BitmapUtil.imageToBase64(photoPaht)
image.fileData = "data:image/" + FileUtil.lastName(file) + ";base64," + base
@ -379,13 +405,13 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
image.location = binding.tvLoca.text.toString()
MDPLocationCollectionManager.uploadUnloadImage(
mContext,
"sob.getData().getShippingNoteNumber()",
orderBean.orderNum,
image,
object : OnResultListener {
override fun onSuccess() {
Log.e("上报安联", "卸货照片上传成功")
Toast.makeText(mContext, "上传成功", Toast.LENGTH_SHORT).show()
finish()
// Toast.makeText(mContext, "上传成功", Toast.LENGTH_SHORT).show()
// finish()
}
override fun onFailure(s: String, s1: String) {
@ -400,36 +426,28 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
//上传安联-签收
fun upTrafficSign() {
fun upTrafficSign(location: Location) {
//安联
val l = Location()
l.baiduLongitude = latLng.longitude
l.baiduLatitude = latLng.latitude
l.location = binding.tvLoca.text.toString()
l.time = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(Date())
val gs: List<Goods> = java.util.ArrayList()
// for (wayChild in sob.getData().getWayChildren()) {
// if (wid == wayChild.getId() + "") {
// for (good in wayChild.getGoods()) {
// val g = Goods()
// g.goodsName = good.getGoodName()
// g.unit = good.getGoodUnit()
// g.itemNo = good.getId()
// //实收
// g.quantity = 1
// //应收
// g.receivedQuantity = 1
// //破损
// g.damageQuantity = 1
// //丢失
// g.quantity = 1
// }
// }
// }
val gs = mutableListOf<Goods>()
orderBean.goodsList.forEach {
var g = Goods()
g.goodsName = it.goodName
g.unit = it.packName
g.itemNo = it.orderGoodsId.toInt()
//实收
g.quantity = 1
//应收
g.receivedQuantity = 1
//破损
g.damageQuantity = 1
//丢失
g.quantity = 1
gs.add(g)
}
MDPLocationCollectionManager.sign(
mContext,
"sob.getData().getShippingNoteNumber()",
l,
orderBean.orderNum,
location,
gs,
object : OnResultListener {
override fun onSuccess() {
@ -443,17 +461,12 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
}
//上传安联-回单
fun upTrafficReceipt() {
fun upTrafficReceipt(location: Location) {
//安联
val l = Location()
l.baiduLongitude = latLng.longitude
l.baiduLatitude = latLng.latitude
l.location = binding.tvLoca.text.toString()
l.time = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(Date())
MDPLocationCollectionManager.pod(
mContext,
"sob.getData().getShippingNoteNumber()",
l,
orderBean.orderNum,
location,
object : OnResultListener {
override fun onSuccess() {
Log.e("上报安联", "回单上传成功")
@ -468,25 +481,36 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
//卸货回单照片
fun receiptImage() {
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
val file: File = File("")
var photoPaht =
upBean.waybillPhotoList.find { it.type == "3" && it.receiptType == "5" }?.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)
image.imageTakenDate = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(Date())
image.baiduLongitude = latLng.longitude
image.baiduLatitude = latLng.latitude
image.baiduLongitude = bdLatLng.longitude
image.baiduLatitude = bdLatLng.latitude
image.location = binding.tvLoca.text.toString()
MDPLocationCollectionManager.uploadPODImage(
mContext,
"sob.getData().getShippingNoteNumber()",
orderBean.orderNum,
image,
object : OnResultListener {
override fun onSuccess() {
Log.e("上报安联", "回单照片上传成功")
//跳转成功页面,停止上传轨迹
OrderUtils.getInstance().stopUpLocation(mContext)
ActivityUtils.startActivity(
mContext,
WaybillSuccActivity::class.java,
intent.extras
)
Toast.makeText(mContext, "上传成功", Toast.LENGTH_SHORT).show()
finish()
// finish()
}
override fun onFailure(s: String, s1: String) {
@ -540,7 +564,7 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
myAdapter.notifyDataSetChanged()
picBean = WaybillPhoto()
picBean.run {
localPhotoUrl = it[0].realPath
localPhotoUrl = it[0].availablePath
photoUrl = oldPath
this.type = if (goodType == 1) "1" else "2"
}

View File

@ -11,10 +11,12 @@ import com.dahe.mylibrary.weight.ImageFileCompressEngine
import com.luck.picture.lib.basic.PictureSelectionCameraModel
import com.luck.picture.lib.basic.PictureSelectionModel
import com.luck.picture.lib.basic.PictureSelector
import com.luck.picture.lib.config.PictureMimeType
import com.luck.picture.lib.config.SelectMimeType
import com.luck.picture.lib.config.SelectModeConfig
import com.luck.picture.lib.entity.LocalMedia
import com.luck.picture.lib.interfaces.OnResultCallbackListener
import com.luck.picture.lib.utils.MediaUtils
import com.lxj.xpopup.core.BottomPopupView
import kotlin.properties.Delegates
@ -74,6 +76,21 @@ class PopBottomPic(
cameraModel.forResult(object : OnResultCallbackListener<LocalMedia> {
override fun onResult(result: ArrayList<LocalMedia>?) {
if (listener != null) {
result?.forEach {
if (it.width == 0 || it.height == 0) {
if (PictureMimeType.isHasImage(it.mimeType)) {
val imageExtraInfo =
MediaUtils.getImageSize(context, it.path)
it.width = imageExtraInfo.width
it.height = imageExtraInfo.height
} else if (PictureMimeType.isHasVideo(it.mimeType)) {
val videoExtraInfo =
MediaUtils.getVideoSize(context, it.path)
it.width = videoExtraInfo.width
it.height = videoExtraInfo.height
}
}
}
result?.let { it1 -> listener.onResult(it1) }
}
dismiss()
@ -103,6 +120,21 @@ class PopBottomPic(
selectionModel.forResult(object : OnResultCallbackListener<LocalMedia> {
override fun onResult(result: ArrayList<LocalMedia>) {
if (listener != null) {
result?.forEach {
if (it.width == 0 || it.height == 0) {
if (PictureMimeType.isHasImage(it.mimeType)) {
val imageExtraInfo =
MediaUtils.getImageSize(context, it.path)
it.width = imageExtraInfo.width
it.height = imageExtraInfo.height
} else if (PictureMimeType.isHasVideo(it.mimeType)) {
val videoExtraInfo =
MediaUtils.getVideoSize(context, it.path)
it.width = videoExtraInfo.width
it.height = videoExtraInfo.height
}
}
}
result?.let { it1 -> listener.onResult(it1) }
}
dismiss()