安联集成测试,交通厅未测试
This commit is contained in:
parent
eee2b7f226
commit
a9fa17ca85
@ -37,6 +37,7 @@ data class OrderDetailBean(
|
|||||||
val vehicleNum: String,
|
val vehicleNum: String,
|
||||||
val loadingAreaCode: String,
|
val loadingAreaCode: String,
|
||||||
val receiverAreaCode: String,
|
val receiverAreaCode: String,
|
||||||
|
val report: String,
|
||||||
val waybillInfo: WaybillInfo
|
val waybillInfo: WaybillInfo
|
||||||
|
|
||||||
|
|
||||||
@ -56,6 +57,7 @@ data class Goods(
|
|||||||
val goodCube: String,
|
val goodCube: String,
|
||||||
val goodItemGrossWeight: String,
|
val goodItemGrossWeight: String,
|
||||||
val goodName: String,
|
val goodName: String,
|
||||||
|
val packName: String,
|
||||||
val goodNum: String,
|
val goodNum: String,
|
||||||
val orderGoodsId: String
|
val orderGoodsId: String
|
||||||
)
|
)
|
||||||
|
@ -151,6 +151,8 @@ data class AuthTeamBean(
|
|||||||
var roadLicensevaridity: String="",
|
var roadLicensevaridity: String="",
|
||||||
var businessLicensePhoneUrl: String="",
|
var businessLicensePhoneUrl: String="",
|
||||||
var businessLicenseCreditCode: String="",
|
var businessLicenseCreditCode: String="",
|
||||||
|
var businessEnterpriseName: String="",
|
||||||
|
var businessLegalPerson: String="",
|
||||||
var businessLicenseEffectiveStart: String="",
|
var businessLicenseEffectiveStart: String="",
|
||||||
var businessLicenseEffectiveEnd: String="",
|
var businessLicenseEffectiveEnd: String="",
|
||||||
var idcardSex: String=""
|
var idcardSex: String=""
|
||||||
|
@ -192,8 +192,10 @@ class AuthDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
|
|||||||
recordNumber = it.recordNumber
|
recordNumber = it.recordNumber
|
||||||
barcodeNumber = it.barcodeNumber
|
barcodeNumber = it.barcodeNumber
|
||||||
passengerCapacity = it.passengerCapacity
|
passengerCapacity = it.passengerCapacity
|
||||||
totalWeight = if (it.totalWeight.contains("kg")) it.totalWeight.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 ""
|
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) {
|
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 {
|
upDrivingInfoBean.run {
|
||||||
overallDimension = it.overallDimension
|
overallDimension = it.overallDimension
|
||||||
energySignCode = it.energySign
|
energySignCode = it.energySign
|
||||||
|
@ -241,8 +241,10 @@ class EditDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
|
|||||||
recordNumber = it.recordNumber
|
recordNumber = it.recordNumber
|
||||||
barcodeNumber = it.barcodeNumber
|
barcodeNumber = it.barcodeNumber
|
||||||
passengerCapacity = it.passengerCapacity
|
passengerCapacity = it.passengerCapacity
|
||||||
totalWeight = if (it.totalWeight.contains("kg")) it.totalWeight.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 ""
|
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) {
|
if (it.inspectionRecord.length > 13) {
|
||||||
@ -255,14 +257,6 @@ class EditDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
|
|||||||
binding.tvEnd.text = changeDateNoneFormat
|
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")) {
|
if (it.overallDimension.contains("mm")) {
|
||||||
|
@ -52,6 +52,8 @@ class AuthTeamActivity : BaseActivity<ActivityAuthTeamBinding>(), View.OnClickLi
|
|||||||
|
|
||||||
result?.data?.run {
|
result?.data?.run {
|
||||||
upComInfoBean.businessLicenseCreditCode = creditCode
|
upComInfoBean.businessLicenseCreditCode = creditCode
|
||||||
|
upComInfoBean.businessEnterpriseName = companyName
|
||||||
|
upComInfoBean.businessLegalPerson = legalPerson
|
||||||
upComInfoBean.businessLicenseEffectiveStart =
|
upComInfoBean.businessLicenseEffectiveStart =
|
||||||
TimeUtil.changeDateNoneFormat(validFromDate)
|
TimeUtil.changeDateNoneFormat(validFromDate)
|
||||||
upComInfoBean.businessLicenseEffectiveEnd =
|
upComInfoBean.businessLicenseEffectiveEnd =
|
||||||
|
@ -48,6 +48,8 @@ class EditCaTeamActivity : BaseActivity<ActivityAuthTeamEditBinding>(), View.OnC
|
|||||||
|
|
||||||
result?.data?.run {
|
result?.data?.run {
|
||||||
upComInfoBean.businessLicenseCreditCode = creditCode
|
upComInfoBean.businessLicenseCreditCode = creditCode
|
||||||
|
upComInfoBean.businessEnterpriseName = companyName
|
||||||
|
upComInfoBean.businessLegalPerson = legalPerson
|
||||||
upComInfoBean.businessLicenseEffectiveStart =
|
upComInfoBean.businessLicenseEffectiveStart =
|
||||||
TimeUtil.changeDateNoneFormat(validFromDate)
|
TimeUtil.changeDateNoneFormat(validFromDate)
|
||||||
upComInfoBean.businessLicenseEffectiveEnd =
|
upComInfoBean.businessLicenseEffectiveEnd =
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.dahe.gldriver.ui.waybill.activity
|
package com.dahe.gldriver.ui.waybill.activity
|
||||||
|
|
||||||
import android.Manifest
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.view.View
|
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.Image
|
||||||
import com.alct.mdp.model.Location
|
import com.alct.mdp.model.Location
|
||||||
import com.amap.api.maps.model.LatLng
|
import com.amap.api.maps.model.LatLng
|
||||||
import com.dahe.gldriver.R
|
|
||||||
import com.dahe.gldriver.base.AppConfig
|
import com.dahe.gldriver.base.AppConfig
|
||||||
import com.dahe.gldriver.bean.LUInputBean
|
import com.dahe.gldriver.bean.LUInputBean
|
||||||
import com.dahe.gldriver.bean.OrderDetailBean
|
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.oss.OssServiceUtil
|
||||||
import com.dahe.gldriver.third.JTTProcess
|
import com.dahe.gldriver.third.JTTProcess
|
||||||
import com.dahe.gldriver.utils.GDLocationUtils
|
import com.dahe.gldriver.utils.GDLocationUtils
|
||||||
import com.dahe.gldriver.utils.LocationUtils
|
|
||||||
import com.dahe.gldriver.utils.OcrUtils
|
import com.dahe.gldriver.utils.OcrUtils
|
||||||
import com.dahe.gldriver.utils.OrderUtils
|
import com.dahe.gldriver.utils.OrderUtils
|
||||||
import com.dahe.mylibrary.adapter.GridImageAdapter
|
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.base.BaseActivity
|
||||||
import com.dahe.mylibrary.net.CommonResponseBean
|
import com.dahe.mylibrary.net.CommonResponseBean
|
||||||
import com.dahe.mylibrary.utils.ActivityUtils
|
import com.dahe.mylibrary.utils.ActivityUtils
|
||||||
import com.dahe.mylibrary.utils.BaseUtils
|
|
||||||
import com.dahe.mylibrary.utils.BitmapUtil
|
import com.dahe.mylibrary.utils.BitmapUtil
|
||||||
import com.dahe.mylibrary.utils.FileUtil
|
import com.dahe.mylibrary.utils.FileUtil
|
||||||
import com.dahe.mylibrary.utils.ImageLoader
|
|
||||||
import com.dahe.mylibrary.utils.LoadingUtils
|
import com.dahe.mylibrary.utils.LoadingUtils
|
||||||
import com.dahe.mylibrary.utils.PopsUtils
|
import com.dahe.mylibrary.utils.PopsUtils
|
||||||
|
import com.dahe.mylibrary.utils.TimeUtil
|
||||||
import com.dahe.mylibrary.utils.ToastUtils
|
import com.dahe.mylibrary.utils.ToastUtils
|
||||||
import com.dahe.mylibrary.weight.FullyGridLayoutManager
|
import com.dahe.mylibrary.weight.FullyGridLayoutManager
|
||||||
import com.luck.picture.lib.decoration.GridSpacingItemDecoration
|
import com.luck.picture.lib.decoration.GridSpacingItemDecoration
|
||||||
import com.luck.picture.lib.entity.LocalMedia
|
import com.luck.picture.lib.entity.LocalMedia
|
||||||
import com.luck.picture.lib.utils.DensityUtil
|
import com.luck.picture.lib.utils.DensityUtil
|
||||||
import com.permissionx.guolindev.PermissionX
|
|
||||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
import java.io.File
|
import java.io.File
|
||||||
@ -136,7 +131,7 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
setResultCallBack { data, oldPath ->
|
setResultCallBack { data, oldPath ->
|
||||||
picBean = WaybillPhoto()
|
picBean = WaybillPhoto()
|
||||||
picBean.run {
|
picBean.run {
|
||||||
localPhotoUrl = it[0].realPath
|
localPhotoUrl = it[0].availablePath
|
||||||
photoUrl = oldPath
|
photoUrl = oldPath
|
||||||
receiptType =
|
receiptType =
|
||||||
if (type == 1) "4" else if (type == 2) "5" else "6"
|
if (type == 1) "4" else if (type == 2) "5" else "6"
|
||||||
@ -165,7 +160,7 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
setResultCallBack { data, oldPath ->
|
setResultCallBack { data, oldPath ->
|
||||||
picBean = WaybillPhoto()
|
picBean = WaybillPhoto()
|
||||||
picBean.run {
|
picBean.run {
|
||||||
localPhotoUrl = it[0].realPath
|
localPhotoUrl = it[0].availablePath
|
||||||
photoUrl = oldPath
|
photoUrl = oldPath
|
||||||
receiptType =
|
receiptType =
|
||||||
if (type == 1) "4" else if (type == 2) "5" else "6"
|
if (type == 1) "4" else if (type == 2) "5" else "6"
|
||||||
@ -235,17 +230,15 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
showToast("卸货请上传卸货回单照片")
|
showToast("卸货请上传卸货回单照片")
|
||||||
return
|
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()
|
val l = Location()
|
||||||
l.baiduLongitude = bdLatLng.longitude
|
l.baiduLongitude = bdLatLng.longitude
|
||||||
l.baiduLatitude = bdLatLng.latitude
|
l.baiduLatitude = bdLatLng.latitude
|
||||||
@ -254,7 +247,7 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
|
|
||||||
if (orderType == 1) {//装货
|
if (orderType == 1) {//装货
|
||||||
load(l)
|
load(l)
|
||||||
}else{//卸货
|
} else {//卸货
|
||||||
unLoad(l)
|
unLoad(l)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -287,41 +280,70 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun load(location: Location) {
|
private fun load(location: Location) {
|
||||||
MDPLocationCollectionManager.pickup(mContext, orderBean.orderNum, location, object : OnResultListener {
|
MDPLocationCollectionManager.pickup(
|
||||||
override fun onSuccess() {
|
mContext,
|
||||||
Log.e("上报安联", "装货上传成功")
|
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?) {
|
DataManager.getInstance().driverLoadOrUnload(upBean)
|
||||||
Log.e("上报安联失败(装货):", p0 + p1)
|
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||||
ToastUtils.showToast(mContext,"""${p1},${p0}""")
|
.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) {
|
private fun unLoad(location: Location) {
|
||||||
MDPLocationCollectionManager.unload(mContext, "getShippingNoteNumber()", location,
|
MDPLocationCollectionManager.unload(mContext, orderBean.orderNum, location,
|
||||||
object : OnResultListener {
|
object : OnResultListener {
|
||||||
override fun onSuccess() {
|
override fun onSuccess() {
|
||||||
Log.e("上报安联", "卸货上传成功")
|
Log.e("上报安联", "卸货上传成功")
|
||||||
//交通厅
|
// 交通厅
|
||||||
// if (sob.getData().getReport() === 1) {
|
if (orderBean.report === "1") {
|
||||||
// JTTProcess.stop(mContext, sob, "")
|
JTTProcess.stop(mContext, orderBean, "")
|
||||||
// }
|
}
|
||||||
//卸货状态-平台
|
//卸货状态-平台
|
||||||
// hyr.dischargeCargo(lub)
|
// hyr.dischargeCargo(lub)
|
||||||
//卸货照片-安联
|
//卸货照片-安联
|
||||||
upUnloadImage()
|
upUnloadImage()
|
||||||
|
|
||||||
//卸货回单
|
//卸货回单
|
||||||
upTrafficSign()
|
upTrafficSign(location)
|
||||||
upTrafficReceipt()
|
upTrafficReceipt(location)
|
||||||
receiptImage()
|
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) {
|
override fun onFailure(s: String, s1: String) {
|
||||||
@ -336,8 +358,8 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
fun upLoadImage() {
|
fun upLoadImage() {
|
||||||
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||||
|
|
||||||
var photoPaht = upBean.waybillPhotoList.find { it.type=="1" }?.localPhotoUrl
|
var photoPaht = upBean.waybillPhotoList.find { it.type == "1" }?.localPhotoUrl
|
||||||
val file: File = File(photoPaht)
|
val file = File(photoPaht)
|
||||||
val image = Image()
|
val image = Image()
|
||||||
val base: String = BitmapUtil.imageToBase64(photoPaht)
|
val base: String = BitmapUtil.imageToBase64(photoPaht)
|
||||||
image.fileData = "data:image/" + FileUtil.lastName(file) + ";base64," + base
|
image.fileData = "data:image/" + FileUtil.lastName(file) + ";base64," + base
|
||||||
@ -349,13 +371,17 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
image.location = binding.tvLoca.text.toString()
|
image.location = binding.tvLoca.text.toString()
|
||||||
MDPLocationCollectionManager.uploadPickupImage(
|
MDPLocationCollectionManager.uploadPickupImage(
|
||||||
mContext,
|
mContext,
|
||||||
"sob.getData().getShippingNoteNumber()",
|
orderBean.orderNum,
|
||||||
image,
|
image,
|
||||||
object : OnResultListener {
|
object : OnResultListener {
|
||||||
override fun onSuccess() {
|
override fun onSuccess() {
|
||||||
Log.e("上报安联", "装货照片上传成功")
|
Log.e("上报安联", "装货照片上传成功")
|
||||||
Toast.makeText(mContext, "上传成功", Toast.LENGTH_SHORT).show()
|
Toast.makeText(mContext, "上传成功", Toast.LENGTH_SHORT).show()
|
||||||
finish()
|
ActivityUtils.startActivity(
|
||||||
|
mContext,
|
||||||
|
WaybillSuccActivity::class.java,
|
||||||
|
intent.extras
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onFailure(s: String, s1: String) {
|
override fun onFailure(s: String, s1: String) {
|
||||||
@ -366,8 +392,8 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
|
|
||||||
//上传安联卸货
|
//上传安联卸货
|
||||||
fun upUnloadImage() {
|
fun upUnloadImage() {
|
||||||
var photoPaht = upBean.waybillPhotoList.find { it.type=="1" }?.localPhotoUrl
|
var photoPaht = upBean.waybillPhotoList.find { it.type == "2" }?.localPhotoUrl
|
||||||
val file: File = File(photoPaht)
|
val file = File(photoPaht)
|
||||||
val image = Image()
|
val image = Image()
|
||||||
val base = BitmapUtil.imageToBase64(photoPaht)
|
val base = BitmapUtil.imageToBase64(photoPaht)
|
||||||
image.fileData = "data:image/" + FileUtil.lastName(file) + ";base64," + base
|
image.fileData = "data:image/" + FileUtil.lastName(file) + ";base64," + base
|
||||||
@ -379,13 +405,13 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
image.location = binding.tvLoca.text.toString()
|
image.location = binding.tvLoca.text.toString()
|
||||||
MDPLocationCollectionManager.uploadUnloadImage(
|
MDPLocationCollectionManager.uploadUnloadImage(
|
||||||
mContext,
|
mContext,
|
||||||
"sob.getData().getShippingNoteNumber()",
|
orderBean.orderNum,
|
||||||
image,
|
image,
|
||||||
object : OnResultListener {
|
object : OnResultListener {
|
||||||
override fun onSuccess() {
|
override fun onSuccess() {
|
||||||
Log.e("上报安联", "卸货照片上传成功")
|
Log.e("上报安联", "卸货照片上传成功")
|
||||||
Toast.makeText(mContext, "上传成功", Toast.LENGTH_SHORT).show()
|
// Toast.makeText(mContext, "上传成功", Toast.LENGTH_SHORT).show()
|
||||||
finish()
|
// finish()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onFailure(s: String, s1: String) {
|
override fun onFailure(s: String, s1: String) {
|
||||||
@ -400,36 +426,28 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
|
|
||||||
|
|
||||||
//上传安联-签收
|
//上传安联-签收
|
||||||
fun upTrafficSign() {
|
fun upTrafficSign(location: Location) {
|
||||||
//安联
|
//安联
|
||||||
val l = Location()
|
val gs = mutableListOf<Goods>()
|
||||||
l.baiduLongitude = latLng.longitude
|
orderBean.goodsList.forEach {
|
||||||
l.baiduLatitude = latLng.latitude
|
var g = Goods()
|
||||||
l.location = binding.tvLoca.text.toString()
|
g.goodsName = it.goodName
|
||||||
l.time = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(Date())
|
g.unit = it.packName
|
||||||
val gs: List<Goods> = java.util.ArrayList()
|
g.itemNo = it.orderGoodsId.toInt()
|
||||||
// for (wayChild in sob.getData().getWayChildren()) {
|
//实收
|
||||||
// if (wid == wayChild.getId() + "") {
|
g.quantity = 1
|
||||||
// for (good in wayChild.getGoods()) {
|
//应收
|
||||||
// val g = Goods()
|
g.receivedQuantity = 1
|
||||||
// g.goodsName = good.getGoodName()
|
//破损
|
||||||
// g.unit = good.getGoodUnit()
|
g.damageQuantity = 1
|
||||||
// g.itemNo = good.getId()
|
//丢失
|
||||||
// //实收
|
g.quantity = 1
|
||||||
// g.quantity = 1
|
gs.add(g)
|
||||||
// //应收
|
}
|
||||||
// g.receivedQuantity = 1
|
|
||||||
// //破损
|
|
||||||
// g.damageQuantity = 1
|
|
||||||
// //丢失
|
|
||||||
// g.quantity = 1
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
MDPLocationCollectionManager.sign(
|
MDPLocationCollectionManager.sign(
|
||||||
mContext,
|
mContext,
|
||||||
"sob.getData().getShippingNoteNumber()",
|
orderBean.orderNum,
|
||||||
l,
|
location,
|
||||||
gs,
|
gs,
|
||||||
object : OnResultListener {
|
object : OnResultListener {
|
||||||
override fun onSuccess() {
|
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(
|
MDPLocationCollectionManager.pod(
|
||||||
mContext,
|
mContext,
|
||||||
"sob.getData().getShippingNoteNumber()",
|
orderBean.orderNum,
|
||||||
l,
|
location,
|
||||||
object : OnResultListener {
|
object : OnResultListener {
|
||||||
override fun onSuccess() {
|
override fun onSuccess() {
|
||||||
Log.e("上报安联", "回单上传成功")
|
Log.e("上报安联", "回单上传成功")
|
||||||
@ -468,25 +481,36 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
//卸货回单照片
|
//卸货回单照片
|
||||||
fun receiptImage() {
|
fun receiptImage() {
|
||||||
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
///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 image = Image()
|
||||||
val base = BitmapUtil.imageToBase64("path")
|
val base = BitmapUtil.imageToBase64(photoPaht)
|
||||||
image.fileData = "data:image/" + FileUtil.lastName(file) + ";base64," + base
|
image.fileData = "data:image/" + FileUtil.lastName(file) + ";base64," + base
|
||||||
image.fileExt = FileUtil.lastName(file)
|
image.fileExt = FileUtil.lastName(file)
|
||||||
image.fileName = FileUtil.fileName(file)
|
image.fileName = FileUtil.fileName(file)
|
||||||
image.imageTakenDate = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(Date())
|
image.imageTakenDate = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(Date())
|
||||||
image.baiduLongitude = latLng.longitude
|
image.baiduLongitude = bdLatLng.longitude
|
||||||
image.baiduLatitude = latLng.latitude
|
image.baiduLatitude = bdLatLng.latitude
|
||||||
image.location = binding.tvLoca.text.toString()
|
image.location = binding.tvLoca.text.toString()
|
||||||
MDPLocationCollectionManager.uploadPODImage(
|
MDPLocationCollectionManager.uploadPODImage(
|
||||||
mContext,
|
mContext,
|
||||||
"sob.getData().getShippingNoteNumber()",
|
orderBean.orderNum,
|
||||||
image,
|
image,
|
||||||
object : OnResultListener {
|
object : OnResultListener {
|
||||||
override fun onSuccess() {
|
override fun onSuccess() {
|
||||||
Log.e("上报安联", "回单照片上传成功")
|
Log.e("上报安联", "回单照片上传成功")
|
||||||
|
|
||||||
|
//跳转成功页面,停止上传轨迹
|
||||||
|
OrderUtils.getInstance().stopUpLocation(mContext)
|
||||||
|
ActivityUtils.startActivity(
|
||||||
|
mContext,
|
||||||
|
WaybillSuccActivity::class.java,
|
||||||
|
intent.extras
|
||||||
|
)
|
||||||
Toast.makeText(mContext, "上传成功", Toast.LENGTH_SHORT).show()
|
Toast.makeText(mContext, "上传成功", Toast.LENGTH_SHORT).show()
|
||||||
finish()
|
// finish()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onFailure(s: String, s1: String) {
|
override fun onFailure(s: String, s1: String) {
|
||||||
@ -540,7 +564,7 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
myAdapter.notifyDataSetChanged()
|
myAdapter.notifyDataSetChanged()
|
||||||
picBean = WaybillPhoto()
|
picBean = WaybillPhoto()
|
||||||
picBean.run {
|
picBean.run {
|
||||||
localPhotoUrl = it[0].realPath
|
localPhotoUrl = it[0].availablePath
|
||||||
photoUrl = oldPath
|
photoUrl = oldPath
|
||||||
this.type = if (goodType == 1) "1" else "2"
|
this.type = if (goodType == 1) "1" else "2"
|
||||||
}
|
}
|
||||||
|
@ -11,10 +11,12 @@ import com.dahe.mylibrary.weight.ImageFileCompressEngine
|
|||||||
import com.luck.picture.lib.basic.PictureSelectionCameraModel
|
import com.luck.picture.lib.basic.PictureSelectionCameraModel
|
||||||
import com.luck.picture.lib.basic.PictureSelectionModel
|
import com.luck.picture.lib.basic.PictureSelectionModel
|
||||||
import com.luck.picture.lib.basic.PictureSelector
|
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.SelectMimeType
|
||||||
import com.luck.picture.lib.config.SelectModeConfig
|
import com.luck.picture.lib.config.SelectModeConfig
|
||||||
import com.luck.picture.lib.entity.LocalMedia
|
import com.luck.picture.lib.entity.LocalMedia
|
||||||
import com.luck.picture.lib.interfaces.OnResultCallbackListener
|
import com.luck.picture.lib.interfaces.OnResultCallbackListener
|
||||||
|
import com.luck.picture.lib.utils.MediaUtils
|
||||||
import com.lxj.xpopup.core.BottomPopupView
|
import com.lxj.xpopup.core.BottomPopupView
|
||||||
import kotlin.properties.Delegates
|
import kotlin.properties.Delegates
|
||||||
|
|
||||||
@ -74,6 +76,21 @@ class PopBottomPic(
|
|||||||
cameraModel.forResult(object : OnResultCallbackListener<LocalMedia> {
|
cameraModel.forResult(object : OnResultCallbackListener<LocalMedia> {
|
||||||
override fun onResult(result: ArrayList<LocalMedia>?) {
|
override fun onResult(result: ArrayList<LocalMedia>?) {
|
||||||
if (listener != null) {
|
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) }
|
result?.let { it1 -> listener.onResult(it1) }
|
||||||
}
|
}
|
||||||
dismiss()
|
dismiss()
|
||||||
@ -103,6 +120,21 @@ class PopBottomPic(
|
|||||||
selectionModel.forResult(object : OnResultCallbackListener<LocalMedia> {
|
selectionModel.forResult(object : OnResultCallbackListener<LocalMedia> {
|
||||||
override fun onResult(result: ArrayList<LocalMedia>) {
|
override fun onResult(result: ArrayList<LocalMedia>) {
|
||||||
if (listener != null) {
|
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) }
|
result?.let { it1 -> listener.onResult(it1) }
|
||||||
}
|
}
|
||||||
dismiss()
|
dismiss()
|
||||||
|
Loading…
Reference in New Issue
Block a user