新路交装卸货回单等操作
This commit is contained in:
parent
a3a45d211b
commit
a20419f577
@ -22,27 +22,34 @@ data class PickupBean(
|
|||||||
data class GDLocation(
|
data class GDLocation(
|
||||||
var baiduLongitude: Double = 0.0,
|
var baiduLongitude: Double = 0.0,
|
||||||
var baiduLatitude: Double = 0.0,
|
var baiduLatitude: Double = 0.0,
|
||||||
var location: String,
|
var location: String = "",
|
||||||
var time: String,
|
var time: String = ""
|
||||||
var altitude: Double = 0.0,
|
|
||||||
var speed: Float = 0f,
|
|
||||||
var direction: Float = 0f,
|
|
||||||
var interval: Int = 0
|
|
||||||
)
|
)
|
||||||
|
|
||||||
data class UpimgBean(var shipmentCode: String="", var enterpriseCode: String="", var image: GDImage? = null)
|
data class UpimgBean(
|
||||||
|
var shipmentCode: String = "",
|
||||||
|
var enterpriseCode: String = "",
|
||||||
|
var image: GDImage? = null
|
||||||
|
)
|
||||||
|
|
||||||
data class GDImage(
|
data class GDImage(
|
||||||
var fileName: String, var fileData: String, var fileExt: String, var imageTakenDate: String
|
var fileName: String = "",
|
||||||
|
var fileData: String = "",
|
||||||
|
var fileExt: String = "",
|
||||||
|
var imageTakenDate: String = "",
|
||||||
|
var baiduLongitude: Double = 0.0,
|
||||||
|
var baiduLatitude: Double = 0.0,
|
||||||
|
var location: String = "",
|
||||||
|
var time: String = ""
|
||||||
)
|
)
|
||||||
|
|
||||||
data class InvoiceBean(
|
data class InvoiceBean(
|
||||||
var driverIdentification: String="",
|
var driverIdentification: String = "",
|
||||||
var driverInvoiceCode: String="",
|
var driverInvoiceCode: String = "",
|
||||||
var enterpriseCode: String=""
|
var enterpriseCode: String = ""
|
||||||
)
|
)
|
||||||
|
|
||||||
data class ShipmentStatusBean(var shipmentCode: String="", var enterpriseCode: String="")
|
data class ShipmentStatusBean(var shipmentCode: String = "", var enterpriseCode: String = "")
|
||||||
|
|
||||||
|
|
||||||
data class InvoicesBean(
|
data class InvoicesBean(
|
||||||
|
@ -3,14 +3,17 @@ package com.arpa.hndahesudintocctmsdriver.ui.waybill.activity
|
|||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.Toast
|
|
||||||
import androidx.recyclerview.widget.GridLayoutManager
|
import androidx.recyclerview.widget.GridLayoutManager
|
||||||
import com.amap.api.maps.model.LatLng
|
import com.amap.api.maps.model.LatLng
|
||||||
import com.arpa.hndahesudintocctmsdriver.base.AppConfig
|
import com.arpa.hndahesudintocctmsdriver.base.AppConfig
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.GDImage
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.GDLocation
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.LUInputBean
|
import com.arpa.hndahesudintocctmsdriver.bean.LUInputBean
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.OrderDetailBean
|
import com.arpa.hndahesudintocctmsdriver.bean.OrderDetailBean
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.UpPicBean
|
import com.arpa.hndahesudintocctmsdriver.bean.UpPicBean
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.WaybillPhoto
|
import com.arpa.hndahesudintocctmsdriver.bean.WaybillPhoto
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.callback.OnGDDownloadResultListener
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.callback.OnGDResultListener
|
||||||
import com.arpa.hndahesudintocctmsdriver.databinding.ActivityWaybillUppicBinding
|
import com.arpa.hndahesudintocctmsdriver.databinding.ActivityWaybillUppicBinding
|
||||||
import com.arpa.hndahesudintocctmsdriver.net.BaseObserver
|
import com.arpa.hndahesudintocctmsdriver.net.BaseObserver
|
||||||
import com.arpa.hndahesudintocctmsdriver.net.DataManager
|
import com.arpa.hndahesudintocctmsdriver.net.DataManager
|
||||||
@ -18,6 +21,7 @@ import com.arpa.hndahesudintocctmsdriver.net.RxHttpCallBack
|
|||||||
import com.arpa.hndahesudintocctmsdriver.oss.OssServiceUtil
|
import com.arpa.hndahesudintocctmsdriver.oss.OssServiceUtil
|
||||||
import com.arpa.hndahesudintocctmsdriver.third.JTTProcess
|
import com.arpa.hndahesudintocctmsdriver.third.JTTProcess
|
||||||
import com.arpa.hndahesudintocctmsdriver.utils.GDLocationUtils
|
import com.arpa.hndahesudintocctmsdriver.utils.GDLocationUtils
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.utils.NewLJUtils
|
||||||
import com.arpa.hndahesudintocctmsdriver.utils.OcrUtils
|
import com.arpa.hndahesudintocctmsdriver.utils.OcrUtils
|
||||||
import com.arpa.hndahesudintocctmsdriver.utils.OrderUtils
|
import com.arpa.hndahesudintocctmsdriver.utils.OrderUtils
|
||||||
import com.arpa.mylibrary.adapter.GridImageAdapter
|
import com.arpa.mylibrary.adapter.GridImageAdapter
|
||||||
@ -120,14 +124,15 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
)
|
)
|
||||||
|
|
||||||
var myAdapter = GridImageAdapter(mContext, mData)
|
var myAdapter = GridImageAdapter(mContext, mData)
|
||||||
myAdapter.selectMax = if (type==2) 6 else 1
|
myAdapter.selectMax = if (type == 2) 6 else 1
|
||||||
myAdapter.setOnItemClickListener(object : OnItemClickListener {
|
myAdapter.setOnItemClickListener(object : OnItemClickListener {
|
||||||
override fun onItemClick(v: View?, position: Int) {
|
override fun onItemClick(v: View?, position: Int) {
|
||||||
PopsUtils.getInstance()
|
PopsUtils.getInstance()
|
||||||
.showSelPic(mContext, if (type==2) 6 else 1, true, myAdapter) { it ->
|
.showSelPic(mContext, if (type == 2) 6 else 1, true, myAdapter) { it ->
|
||||||
OssServiceUtil.getInstance().asyncPutImages(it.map { it.availablePath },this@WaybillUpPicActivity
|
OssServiceUtil.getInstance().asyncPutImages(
|
||||||
|
it.map { it.availablePath }, this@WaybillUpPicActivity
|
||||||
) { success, failure ->
|
) { success, failure ->
|
||||||
upBean.waybillPhotoList.removeAll { it.type=="3" }
|
upBean.waybillPhotoList.removeAll { it.type == "3" }
|
||||||
success.forEachIndexed { index, s ->
|
success.forEachIndexed { index, s ->
|
||||||
picBean = WaybillPhoto()
|
picBean = WaybillPhoto()
|
||||||
picBean.run {
|
picBean.run {
|
||||||
@ -152,10 +157,11 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
|
|
||||||
override fun openPicture() {
|
override fun openPicture() {
|
||||||
PopsUtils.getInstance()
|
PopsUtils.getInstance()
|
||||||
.showSelPic(mContext, if (type==2) 6 else 1, true, myAdapter) { it ->
|
.showSelPic(mContext, if (type == 2) 6 else 1, true, myAdapter) { it ->
|
||||||
OssServiceUtil.getInstance().asyncPutImages(it.map { it.availablePath },this@WaybillUpPicActivity
|
OssServiceUtil.getInstance().asyncPutImages(
|
||||||
|
it.map { it.availablePath }, this@WaybillUpPicActivity
|
||||||
) { success, failure ->
|
) { success, failure ->
|
||||||
upBean.waybillPhotoList.removeAll { it.type=="3" }
|
upBean.waybillPhotoList.removeAll { it.type == "3" }
|
||||||
success.forEachIndexed { index, s ->
|
success.forEachIndexed { index, s ->
|
||||||
picBean = WaybillPhoto()
|
picBean = WaybillPhoto()
|
||||||
picBean.run {
|
picBean.run {
|
||||||
@ -258,7 +264,7 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var dis =
|
val dis =
|
||||||
TimeUtil.compareNowDate(TimeUtil.string2Millis(orderBean.waybillInfo.loadTime))
|
TimeUtil.compareNowDate(TimeUtil.string2Millis(orderBean.waybillInfo.loadTime))
|
||||||
if (dis <= 5) { //大于五分钟可以接单
|
if (dis <= 5) { //大于五分钟可以接单
|
||||||
ToastUtils.showToast(this@WaybillUpPicActivity, "请到卸货地再进行卸货操作!")
|
ToastUtils.showToast(this@WaybillUpPicActivity, "请到卸货地再进行卸货操作!")
|
||||||
@ -266,47 +272,85 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// val l = Location()
|
val l = GDLocation().apply {
|
||||||
// l.baiduLongitude = bdLatLng.longitude
|
baiduLongitude = bdLatLng.longitude
|
||||||
// l.baiduLatitude = bdLatLng.latitude
|
baiduLatitude = bdLatLng.latitude
|
||||||
// l.location = binding.tvLoca.text.toString()
|
location = binding.tvLoca.text.toString()
|
||||||
// l.time = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(Date())
|
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
|
|
||||||
// )
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }))
|
|
||||||
|
|
||||||
|
|
||||||
|
if (orderType == 1) {//装货
|
||||||
|
load(l)
|
||||||
|
} else {//卸货
|
||||||
|
unLoad(l)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// private fun load(location: Location) {
|
private fun load(location: GDLocation) {
|
||||||
|
NewLJUtils.getInstance()
|
||||||
|
.getShipmentStatus(mContext, orderBean.orderNum, object : OnGDDownloadResultListener {
|
||||||
|
override fun onSuccess(var1: String) {
|
||||||
|
if (var1 == "30") {
|
||||||
|
Log.e("上报安联", "装货上传成功")
|
||||||
|
// //上传安联和交通厅,平台-装货
|
||||||
|
// //交通厅
|
||||||
|
if (orderBean.report === "1") {
|
||||||
|
JTTProcess.start(mContext, orderBean, "")
|
||||||
|
}
|
||||||
|
|
||||||
|
upLoadImage()
|
||||||
|
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
} else {
|
||||||
|
NewLJUtils.getInstance()
|
||||||
|
.pickUp(mContext, orderBean.orderNum, location, object :
|
||||||
|
OnGDResultListener {
|
||||||
|
override fun onSuccess() {
|
||||||
|
Log.e("上报安联", "装货上传成功")
|
||||||
|
|
||||||
|
//上传安联和交通厅,平台-装货
|
||||||
|
//交通厅
|
||||||
|
if (orderBean.report === "1") {
|
||||||
|
JTTProcess.start(mContext, orderBean, "")
|
||||||
|
}
|
||||||
|
upLoadImage()
|
||||||
|
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(code: String, message: String) {
|
||||||
|
ToastUtils.showToast(mContext, """${code},${message}""")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onFailure(code: String, message: String) {
|
||||||
|
ToastUtils.showToast(mContext, """${code},${message}""")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// MDPLocationCollectionManager.pickup(
|
// MDPLocationCollectionManager.pickup(
|
||||||
// mContext,
|
// mContext,
|
||||||
// orderBean.orderNum,
|
// orderBean.orderNum,
|
||||||
@ -340,10 +384,43 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
// ToastUtils.showToast(mContext, """${p1},${p0}""")
|
// ToastUtils.showToast(mContext, """${p1},${p0}""")
|
||||||
// }
|
// }
|
||||||
// })
|
// })
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// private fun unLoad(location: Location) {
|
private fun unLoad(location: GDLocation) {
|
||||||
// showLoading()
|
showLoading()
|
||||||
|
NewLJUtils.getInstance()
|
||||||
|
.unload(mContext, orderBean.orderNum, location, object : OnGDResultListener {
|
||||||
|
override fun onSuccess() {
|
||||||
|
Log.e("上报安联", "卸货上传成功")
|
||||||
|
// 交通厅
|
||||||
|
if (orderBean.report === "1") {
|
||||||
|
JTTProcess.stop(mContext, orderBean, "")
|
||||||
|
}
|
||||||
|
//卸货状态-平台
|
||||||
|
// hyr.dischargeCargo(lub)
|
||||||
|
//卸货照片-安联
|
||||||
|
upUnloadImage()
|
||||||
|
|
||||||
|
//卸货回单
|
||||||
|
upTrafficSign(location)
|
||||||
|
upTrafficReceipt(location)
|
||||||
|
receiptImage()
|
||||||
|
|
||||||
|
//todo 平台更换运单状态 暂时注释
|
||||||
|
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(code: String, message: String) {
|
||||||
|
Log.e("上报安联失败(卸货):", code + message)
|
||||||
|
}
|
||||||
|
})
|
||||||
// MDPLocationCollectionManager.unload(mContext, orderBean.orderNum, location,
|
// MDPLocationCollectionManager.unload(mContext, orderBean.orderNum, location,
|
||||||
// object : OnResultListener {
|
// object : OnResultListener {
|
||||||
// override fun onSuccess() {
|
// override fun onSuccess() {
|
||||||
@ -379,24 +456,44 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
//// MessageUtils().showCenMessage(con, s1)
|
//// MessageUtils().showCenMessage(con, s1)
|
||||||
// }
|
// }
|
||||||
// })
|
// })
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
|
||||||
//上传安联装货
|
//上传安联装货
|
||||||
// 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(photoPaht)
|
val base: String = BitmapUtil.imageToBase64(photoPaht)
|
||||||
// val image = Image()
|
val file = File(photoPaht)
|
||||||
// val base: String = BitmapUtil.imageToBase64(photoPaht)
|
val image = GDImage().apply {
|
||||||
// image.fileData = "data:image/" + FileUtil.lastName(file) + ";base64," + base
|
fileData = "data:image/" + FileUtil.lastName(file) + ";base64," + base
|
||||||
// image.fileExt = FileUtil.lastName(file)
|
fileExt = FileUtil.lastName(file)
|
||||||
// image.fileName = FileUtil.fileName(file)
|
fileName = FileUtil.fileName(file)
|
||||||
// image.imageTakenDate = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(Date())
|
imageTakenDate = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(Date())
|
||||||
// image.baiduLongitude = bdLatLng.longitude
|
time = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(Date())
|
||||||
// image.baiduLatitude = bdLatLng.latitude
|
baiduLongitude = bdLatLng.longitude
|
||||||
// image.location = binding.tvLoca.text.toString()
|
baiduLatitude = bdLatLng.latitude
|
||||||
|
location = binding.tvLoca.text.toString()
|
||||||
|
}
|
||||||
|
|
||||||
|
NewLJUtils.getInstance()
|
||||||
|
.uploadPickupImage(mContext, orderBean.orderNum, image, object : OnGDResultListener {
|
||||||
|
override fun onSuccess() {
|
||||||
|
Log.e("上报安联", "装货照片上传成功")
|
||||||
|
ToastUtils.showToast(mContext, "上传成功")
|
||||||
|
ActivityUtils.startActivity(
|
||||||
|
mContext,
|
||||||
|
WaybillSuccActivity::class.java,
|
||||||
|
intent.extras
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onFailure(code: String, message: String) {
|
||||||
|
Log.e("上报安联失败(装货照片):", code + message)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// MDPLocationCollectionManager.uploadPickupImage(
|
// MDPLocationCollectionManager.uploadPickupImage(
|
||||||
// mContext,
|
// mContext,
|
||||||
// orderBean.orderNum,
|
// orderBean.orderNum,
|
||||||
@ -416,21 +513,35 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
// Log.e("上报安联失败(装货照片):", s + s1)
|
// Log.e("上报安联失败(装货照片):", s + s1)
|
||||||
// }
|
// }
|
||||||
// })
|
// })
|
||||||
// }
|
}
|
||||||
|
|
||||||
//上传安联卸货
|
//上传安联卸货
|
||||||
// fun upUnloadImage() {
|
fun upUnloadImage() {
|
||||||
// var photoPaht = upBean.waybillPhotoList.find { it.type == "2" }?.localPhotoUrl
|
var photoPaht = upBean.waybillPhotoList.find { it.type == "2" }?.localPhotoUrl
|
||||||
// val file = File(photoPaht)
|
val file = File(photoPaht)
|
||||||
// val image = Image()
|
val base = BitmapUtil.imageToBase64(photoPaht)
|
||||||
// val base = BitmapUtil.imageToBase64(photoPaht)
|
val image = GDImage().apply {
|
||||||
// image.fileData = "data:image/" + FileUtil.lastName(file) + ";base64," + base
|
fileData = "data:image/" + FileUtil.lastName(file) + ";base64," + base
|
||||||
// image.fileExt = FileUtil.lastName(file)
|
fileExt = FileUtil.lastName(file)
|
||||||
// image.fileName = FileUtil.fileName(file)
|
fileName = FileUtil.fileName(file)
|
||||||
// image.imageTakenDate = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(Date())
|
imageTakenDate = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(Date())
|
||||||
// image.baiduLongitude = bdLatLng.longitude
|
baiduLongitude = bdLatLng.longitude
|
||||||
// image.baiduLatitude = bdLatLng.latitude
|
baiduLatitude = bdLatLng.latitude
|
||||||
// image.location = binding.tvLoca.text.toString()
|
location = binding.tvLoca.text.toString()
|
||||||
|
time = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(Date())
|
||||||
|
}
|
||||||
|
|
||||||
|
NewLJUtils.getInstance()
|
||||||
|
.uploadUnloadImage(mContext, orderBean.orderNum, image, object : OnGDResultListener {
|
||||||
|
override fun onSuccess() {
|
||||||
|
Log.e("上报安联", "卸货照片上传成功")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onFailure(code: String, message: String) {
|
||||||
|
Log.e("上报安联失败(卸货照片):", code + message)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// MDPLocationCollectionManager.uploadUnloadImage(
|
// MDPLocationCollectionManager.uploadUnloadImage(
|
||||||
// mContext,
|
// mContext,
|
||||||
// orderBean.orderNum,
|
// orderBean.orderNum,
|
||||||
@ -450,28 +561,22 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
//// startService(serviceIn);
|
//// startService(serviceIn);
|
||||||
// }
|
// }
|
||||||
// })
|
// })
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
|
||||||
//上传安联-签收
|
//上传安联-签收
|
||||||
// fun upTrafficSign(location: Location) {
|
fun upTrafficSign(location: GDLocation) {
|
||||||
// //安联
|
//安联
|
||||||
// val gs = mutableListOf<Goods>()
|
NewLJUtils.getInstance()
|
||||||
// orderBean.goodsList.forEach {
|
.sign(mContext, orderBean.orderNum, location, object : OnGDResultListener {
|
||||||
// var g = Goods()
|
override fun onSuccess() {
|
||||||
// g.goodsName = it.goodName
|
Log.e("上报安联", "签收成功")
|
||||||
// g.unit = it.packName
|
}
|
||||||
// g.itemNo = it.orderGoodsId.toInt()
|
|
||||||
// //实收
|
override fun onFailure(code: String, message: String) {
|
||||||
// g.quantity = 1
|
Log.e("上报安联失败(签收):", code + message)
|
||||||
// //应收
|
}
|
||||||
// g.receivedQuantity = 1
|
})
|
||||||
// //破损
|
|
||||||
// g.damageQuantity = 1
|
|
||||||
// //丢失
|
|
||||||
// g.quantity = 1
|
|
||||||
// gs.add(g)
|
|
||||||
// }
|
|
||||||
// MDPLocationCollectionManager.sign(
|
// MDPLocationCollectionManager.sign(
|
||||||
// mContext,
|
// mContext,
|
||||||
// orderBean.orderNum,
|
// orderBean.orderNum,
|
||||||
@ -486,11 +591,21 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
// Log.e("上报安联失败(签收):", s + s1)
|
// Log.e("上报安联失败(签收):", s + s1)
|
||||||
// }
|
// }
|
||||||
// })
|
// })
|
||||||
// }
|
}
|
||||||
|
|
||||||
//上传安联-回单
|
//上传安联-回单
|
||||||
// fun upTrafficReceipt(location: Location) {
|
fun upTrafficReceipt(location: GDLocation) {
|
||||||
// //安联
|
//安联
|
||||||
|
NewLJUtils.getInstance()
|
||||||
|
.pod(mContext, orderBean.orderNum, location, object : OnGDResultListener {
|
||||||
|
override fun onSuccess() {
|
||||||
|
Log.e("上报安联", "回单上传成功")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onFailure(code: String, message: String) {
|
||||||
|
Log.e("上报安联失败(回单):", code + message)
|
||||||
|
}
|
||||||
|
})
|
||||||
// MDPLocationCollectionManager.pod(
|
// MDPLocationCollectionManager.pod(
|
||||||
// mContext,
|
// mContext,
|
||||||
// orderBean.orderNum,
|
// orderBean.orderNum,
|
||||||
@ -504,24 +619,60 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
// Log.e("上报安联失败(回单):", s + s1)
|
// Log.e("上报安联失败(回单):", s + s1)
|
||||||
// }
|
// }
|
||||||
// })
|
// })
|
||||||
// }
|
}
|
||||||
|
|
||||||
//卸货回单照片
|
//卸货回单照片
|
||||||
// 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
|
||||||
// var upCount = 0
|
var upCount = 0
|
||||||
// upBean.waybillPhotoList.filter { it.type == "3" && it.receiptType == "5" }.forEach { it ->
|
upBean.waybillPhotoList.filter { it.type == "3" && it.receiptType == "5" }.forEach { it ->
|
||||||
// var photoPaht = it.localPhotoUrl
|
var photoPaht = it.localPhotoUrl
|
||||||
// val file: File = File(photoPaht)
|
val file: File = File(photoPaht)
|
||||||
// val image = Image()
|
val base = BitmapUtil.imageToBase64(photoPaht)
|
||||||
// val base = BitmapUtil.imageToBase64(photoPaht)
|
val image = GDImage().apply {
|
||||||
// image.fileData = "data:image/" + FileUtil.lastName(file) + ";base64," + base
|
fileData = "data:image/" + FileUtil.lastName(file) + ";base64," + base
|
||||||
// image.fileExt = FileUtil.lastName(file)
|
fileExt = FileUtil.lastName(file)
|
||||||
// image.fileName = FileUtil.fileName(file)
|
fileName = FileUtil.fileName(file)
|
||||||
// image.imageTakenDate = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(Date())
|
imageTakenDate = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(Date())
|
||||||
// image.baiduLongitude = bdLatLng.longitude
|
time = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(Date())
|
||||||
// image.baiduLatitude = bdLatLng.latitude
|
baiduLongitude = bdLatLng.longitude
|
||||||
// image.location = binding.tvLoca.text.toString()
|
baiduLatitude = bdLatLng.latitude
|
||||||
|
location = binding.tvLoca.text.toString()
|
||||||
|
}
|
||||||
|
|
||||||
|
NewLJUtils.getInstance()
|
||||||
|
.uploadPODImage(mContext, orderBean.orderNum, image, object : OnGDResultListener {
|
||||||
|
override fun onSuccess() {
|
||||||
|
Log.e("上报安联", "回单照片上传成功")
|
||||||
|
upCount++
|
||||||
|
dissLoading()
|
||||||
|
if (upCount == upBean.waybillPhotoList.filter { it.type == "3" && it.receiptType == "5" }.size) {
|
||||||
|
//跳转成功页面,停止上传轨迹
|
||||||
|
OrderUtils.getInstance().stopUpLocation(mContext)
|
||||||
|
ActivityUtils.startActivity(
|
||||||
|
mContext,
|
||||||
|
WaybillSuccActivity::class.java,
|
||||||
|
intent.extras
|
||||||
|
)
|
||||||
|
ToastUtils.showToast(mContext, "上传成功")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onFailure(code: String, message: String) {
|
||||||
|
upCount++
|
||||||
|
if (upCount == upBean.waybillPhotoList.filter { it.type == "3" && it.receiptType == "5" }.size) {
|
||||||
|
//跳转成功页面,停止上传轨迹
|
||||||
|
OrderUtils.getInstance().stopUpLocation(mContext)
|
||||||
|
ActivityUtils.startActivity(
|
||||||
|
mContext,
|
||||||
|
WaybillSuccActivity::class.java,
|
||||||
|
intent.extras
|
||||||
|
)
|
||||||
|
ToastUtils.showToast(mContext, "上传成功")
|
||||||
|
}
|
||||||
|
Log.e("上报安联失败(回单照片):", code + message)
|
||||||
|
}
|
||||||
|
})
|
||||||
// MDPLocationCollectionManager.uploadPODImage(
|
// MDPLocationCollectionManager.uploadPODImage(
|
||||||
// mContext,
|
// mContext,
|
||||||
// orderBean.orderNum,
|
// orderBean.orderNum,
|
||||||
@ -564,52 +715,8 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
////// startService(serviceIn);
|
////// startService(serviceIn);
|
||||||
// }
|
// }
|
||||||
// })
|
// })
|
||||||
//
|
}
|
||||||
//
|
}
|
||||||
//
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//// var photoPaht =
|
|
||||||
//// upBean.waybillPhotoList.find { it.type == "3" && it.receiptType == "5" }?.localPhotoUrl
|
|
||||||
//// val file: File = File(photoPaht)
|
|
||||||
//// val image = Image()
|
|
||||||
//// 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 = bdLatLng.longitude
|
|
||||||
//// image.baiduLatitude = bdLatLng.latitude
|
|
||||||
//// image.location = binding.tvLoca.text.toString()
|
|
||||||
//// MDPLocationCollectionManager.uploadPODImage(
|
|
||||||
//// mContext,
|
|
||||||
//// orderBean.orderNum,
|
|
||||||
//// image,
|
|
||||||
//// object : OnResultListener {
|
|
||||||
//// override fun onSuccess() {
|
|
||||||
//// Log.e("上报安联", "回单照片上传成功")
|
|
||||||
//// dissLoading()
|
|
||||||
//// //跳转成功页面,停止上传轨迹
|
|
||||||
//// OrderUtils.getInstance().stopUpLocation(mContext)
|
|
||||||
//// ActivityUtils.startActivity(
|
|
||||||
//// mContext,
|
|
||||||
//// WaybillSuccActivity::class.java,
|
|
||||||
//// intent.extras
|
|
||||||
//// )
|
|
||||||
//// Toast.makeText(mContext, "上传成功", Toast.LENGTH_SHORT).show()
|
|
||||||
////// finish()
|
|
||||||
//// }
|
|
||||||
////
|
|
||||||
//// override fun onFailure(s: String, s1: String) {
|
|
||||||
//// Log.e("上报安联失败(回单照片):", s + s1)
|
|
||||||
//// // SPUtil.insSP(con,"make","回单",sob.getData().getShippingNoteNumber());
|
|
||||||
//////// SPUtil.insSP(con,"make","回单-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
|
||||||
//////// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
|
||||||
//////// startService(serviceIn);
|
|
||||||
//// }
|
|
||||||
//// })
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
private val mData: List<LocalMedia> = ArrayList()
|
private val mData: List<LocalMedia> = ArrayList()
|
||||||
|
Loading…
Reference in New Issue
Block a user