安联库删除
This commit is contained in:
parent
5a9ada8d24
commit
a3cae11a8a
@ -179,10 +179,10 @@ dependencies {
|
||||
|
||||
//安联
|
||||
//当引入的与之前引入的库有重复冲突部分的时候,使用compileOnly
|
||||
implementation files('libs\\mdp_sdk.jar')
|
||||
implementation 'com.loopj.android:android-async-http:1.4.9'
|
||||
implementation 'com.j256.ormlite:ormlite-android:4.48'
|
||||
implementation 'com.j256.ormlite:ormlite-core:4.48'
|
||||
// implementation files('libs\\mdp_sdk.jar')
|
||||
// implementation 'com.loopj.android:android-async-http:1.4.9'
|
||||
// implementation 'com.j256.ormlite:ormlite-android:4.48'
|
||||
// implementation 'com.j256.ormlite:ormlite-core:4.48'
|
||||
implementation 'com.github.hotchemi:permissionsdispatcher:2.3.1'
|
||||
annotationProcessor 'com.github.hotchemi:permissionsdispatcher-processor:2.3.1'
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -91,13 +91,13 @@
|
||||
android:name="android.notch_support"
|
||||
android:value="true" />
|
||||
|
||||
<meta-data
|
||||
android:name="com.amap.api.v2.apikey"
|
||||
android:value="78019612271411eca3af34db91930620" />
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.amap.api.v2.apikey"-->
|
||||
<!-- android:value="78019612271411eca3af34db91930620" />-->
|
||||
|
||||
<service
|
||||
android:name="com.amap.api.location.APSService"
|
||||
android:foregroundServiceType="location" />
|
||||
<!-- <service-->
|
||||
<!-- android:name="com.amap.api.location.APSService"-->
|
||||
<!-- android:foregroundServiceType="location" />-->
|
||||
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_icon"
|
||||
|
@ -8,7 +8,6 @@ import android.os.Process
|
||||
import android.util.Log
|
||||
import cn.jiguang.api.utils.JCollectionAuth
|
||||
import cn.jpush.android.api.JPushInterface
|
||||
import com.alct.mdp.MDPLocationCollectionManager
|
||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig
|
||||
import com.arpa.hndahesudintocctmsdriver.net.Api
|
||||
import com.arpa.hndahesudintocctmsdriver.oss.OssServiceUtil
|
||||
@ -98,7 +97,7 @@ class App : Application() {
|
||||
//安联初始化
|
||||
if (packageName == getCurrentProcessName(this)) {
|
||||
//Log.e("--使用的测试环境--",BuildConfig.OPEN_API_URL);
|
||||
MDPLocationCollectionManager.initialize(applicationContext, BuildConfig.OPEN_AL_URL)
|
||||
// MDPLocationCollectionManager.initialize(applicationContext, BuildConfig.OPEN_AL_URL)
|
||||
// MDPLocationCollectionManager.initServiceProcessProguard(applicationContext) // 保活代码
|
||||
// startService(Intent(this, PlayerMusicService::class.java)) // 保活代码
|
||||
}
|
||||
|
@ -1,104 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.third
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.alct.mdp.MDPLocationCollectionManager
|
||||
import com.alct.mdp.callback.OnDownloadResultListener
|
||||
import com.alct.mdp.callback.OnResultListener
|
||||
import com.alct.mdp.model.Identity
|
||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.FqBean
|
||||
import com.arpa.hndahesudintocctmsdriver.utils.SPUtils
|
||||
import com.google.gson.Gson
|
||||
|
||||
/**
|
||||
* @author hlh
|
||||
* @version 1.0.0
|
||||
* @date 2021/8/16 10:35
|
||||
* @description:安联流程
|
||||
*/
|
||||
class ALProcess {
|
||||
companion object {
|
||||
//企业代码
|
||||
private const val ENTERPRISE_CODE = "E0019169"
|
||||
|
||||
//企业app的身份码
|
||||
private const val APP_IDENTITY = "b4a472a025e443b383970cdd5465552e"
|
||||
|
||||
//企业app验证码
|
||||
private const val APP_KEY = "b948efbb4c2a4ba0805c534f2fba0c89"
|
||||
|
||||
//企业代码-测试
|
||||
private const val ENTERPRISE_CODE_TEXT = "E0019093"
|
||||
|
||||
//企业app的身份码-测试
|
||||
private const val APP_IDENTITY_TEXT = "a15b4ba5bd2542cc9a6bea9bdadf9ef9"
|
||||
|
||||
//企业app验证码-测试
|
||||
private const val APP_KEY_TEXT = "07a6256cad5642138ed6e962a5a157be"
|
||||
fun verification(con: Context?) {
|
||||
val userInfo = SPUtils.instance.getUserInfo(con)
|
||||
val idy = Identity()
|
||||
//企业代码
|
||||
idy.enterpriseCode = if (BuildConfig.isTest) ENTERPRISE_CODE_TEXT else ENTERPRISE_CODE
|
||||
//企业app的身份码
|
||||
idy.appIdentity = if (BuildConfig.isTest) APP_IDENTITY_TEXT else APP_IDENTITY
|
||||
//企业app验证码
|
||||
idy.appKey = if (BuildConfig.isTest) APP_KEY_TEXT else APP_KEY
|
||||
//司机身份证
|
||||
idy.driverIdentity = userInfo?.idcard
|
||||
// idy.driverIdentity = "410423199703041014"
|
||||
MDPLocationCollectionManager.register(con, idy, object : OnResultListener {
|
||||
override fun onSuccess() {
|
||||
Log.e("--success--", "验证成功")
|
||||
getFq(con)
|
||||
}
|
||||
|
||||
override fun onFailure(s: String, s1: String) {
|
||||
Log.e("--error--", s + s1 + "")
|
||||
// new MessageUtils().showCenMessage(con,s1);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun getFq(con: Context?) {
|
||||
MDPLocationCollectionManager.getInvoices(
|
||||
con,
|
||||
100,
|
||||
1,
|
||||
object : OnDownloadResultListener {
|
||||
override fun onSuccess(o: Any) {
|
||||
Log.e("--获取发票列表成功--", Gson().toJson(o))
|
||||
try {
|
||||
val fb = Gson().fromJson(Gson().toJson(o), FqBean::class.java)
|
||||
applyFq(con, fb)
|
||||
} catch (e: Exception) {
|
||||
Log.e("--失败--", "数据解析失败")
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFailure(s: String, s1: String) {
|
||||
Log.e("--获取发票列表失败--", s + s1 + "")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun applyFq(con: Context?, fb: FqBean) {
|
||||
for (driverInvoice in fb.driverInvoices) {
|
||||
MDPLocationCollectionManager.confirmInvoice(
|
||||
con,
|
||||
if (BuildConfig.isTest) ENTERPRISE_CODE_TEXT else ENTERPRISE_CODE,
|
||||
driverInvoice.driverInvoiceCode,
|
||||
object : OnResultListener {
|
||||
override fun onSuccess() {
|
||||
Log.e("--成功--", "申请发票成功")
|
||||
}
|
||||
|
||||
override fun onFailure(s: String, s1: String) {
|
||||
Log.e("--失败--", "申请发票失败$s$s1")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -6,10 +6,8 @@ import android.os.Bundle
|
||||
import android.os.Process
|
||||
import cn.jiguang.api.utils.JCollectionAuth
|
||||
import cn.jpush.android.api.JPushInterface
|
||||
import com.alct.mdp.MDPLocationCollectionManager
|
||||
import com.amap.api.location.AMapLocationClient
|
||||
import com.amap.api.maps.MapsInitializer
|
||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig
|
||||
import com.arpa.hndahesudintocctmsdriver.databinding.ActivityLauncherBinding
|
||||
import com.arpa.hndahesudintocctmsdriver.third.JTTProcess
|
||||
import com.arpa.hndahesudintocctmsdriver.third.SPUtil
|
||||
@ -82,10 +80,7 @@ class LauncherActivity : BaseActivity<ActivityLauncherBinding>() {
|
||||
//安联初始化
|
||||
if (packageName == getCurrentProcessName(this)) {
|
||||
//Log.e("--使用的测试环境--",BuildConfig.OPEN_API_URL);
|
||||
MDPLocationCollectionManager.initialize(
|
||||
applicationContext,
|
||||
BuildConfig.OPEN_AL_URL
|
||||
)
|
||||
|
||||
}
|
||||
//初始化交通厅
|
||||
JTTProcess.init(application)
|
||||
|
@ -20,7 +20,6 @@ import com.arpa.hndahesudintocctmsdriver.event.GoWaybillEvent
|
||||
import com.arpa.hndahesudintocctmsdriver.net.BaseObserver
|
||||
import com.arpa.hndahesudintocctmsdriver.net.DataManager
|
||||
import com.arpa.hndahesudintocctmsdriver.net.RxHttpCallBack
|
||||
import com.arpa.hndahesudintocctmsdriver.third.ALProcess
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.home.activity.BusinessActivity
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.mine.activity.PersonInfoActivity
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.waybill.activity.WaybillDetailActivity
|
||||
@ -207,7 +206,8 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(), RefreshCallBack {
|
||||
|
||||
|
||||
// getLocation()
|
||||
ALProcess.verification(mContext)
|
||||
//安联认证
|
||||
// ALProcess.verification(mContext)
|
||||
//证件过期判断+轨迹上传判断
|
||||
DataManager.getInstance().getUserInfo()
|
||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||
@ -220,7 +220,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(), RefreshCallBack {
|
||||
|
||||
//初始化安联
|
||||
if (t.data.auditStatus == "100003") {
|
||||
ALProcess.verification(mContext)
|
||||
|
||||
}
|
||||
|
||||
//执行中运单轨迹上传
|
||||
|
@ -5,11 +5,6 @@ import android.util.Log
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import com.alct.mdp.MDPLocationCollectionManager
|
||||
import com.alct.mdp.callback.OnResultListener
|
||||
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.arpa.hndahesudintocctmsdriver.base.AppConfig
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.LUInputBean
|
||||
@ -271,17 +266,17 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
||||
}
|
||||
}
|
||||
|
||||
val l = Location()
|
||||
l.baiduLongitude = bdLatLng.longitude
|
||||
l.baiduLatitude = bdLatLng.latitude
|
||||
l.location = binding.tvLoca.text.toString()
|
||||
l.time = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(Date())
|
||||
// val l = Location()
|
||||
// l.baiduLongitude = bdLatLng.longitude
|
||||
// l.baiduLatitude = bdLatLng.latitude
|
||||
// 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)
|
||||
}
|
||||
// if (orderType == 1) {//装货
|
||||
// load(l)
|
||||
// } else {//卸货
|
||||
// unLoad(l)
|
||||
// }
|
||||
|
||||
|
||||
// DataManager.getInstance().driverLoadOrUnload(upBean)
|
||||
@ -311,273 +306,122 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
||||
|
||||
}
|
||||
|
||||
private fun load(location: Location) {
|
||||
MDPLocationCollectionManager.pickup(
|
||||
mContext,
|
||||
orderBean.orderNum,
|
||||
location,
|
||||
object : OnResultListener {
|
||||
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(p0: String?, p1: String?) {
|
||||
Log.e("上报安联失败(装货):", p0 + p1)
|
||||
ToastUtils.showToast(mContext, """${p1},${p0}""")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun unLoad(location: Location) {
|
||||
showLoading()
|
||||
MDPLocationCollectionManager.unload(mContext, orderBean.orderNum, location,
|
||||
object : OnResultListener {
|
||||
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(s: String, s1: String) {
|
||||
Log.e("上报安联失败(卸货):", s + s1)
|
||||
// MessageUtils().showCenMessage(con, s1)
|
||||
}
|
||||
})
|
||||
}
|
||||
// private fun load(location: Location) {
|
||||
// MDPLocationCollectionManager.pickup(
|
||||
// mContext,
|
||||
// orderBean.orderNum,
|
||||
// location,
|
||||
// object : OnResultListener {
|
||||
// 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(p0: String?, p1: String?) {
|
||||
// Log.e("上报安联失败(装货):", p0 + p1)
|
||||
// ToastUtils.showToast(mContext, """${p1},${p0}""")
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
//
|
||||
// private fun unLoad(location: Location) {
|
||||
// showLoading()
|
||||
// MDPLocationCollectionManager.unload(mContext, orderBean.orderNum, location,
|
||||
// object : OnResultListener {
|
||||
// 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(s: String, s1: String) {
|
||||
// Log.e("上报安联失败(卸货):", s + s1)
|
||||
//// MessageUtils().showCenMessage(con, s1)
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
|
||||
//上传安联装货
|
||||
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(photoPaht)
|
||||
val image = Image()
|
||||
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)
|
||||
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.uploadPickupImage(
|
||||
mContext,
|
||||
orderBean.orderNum,
|
||||
image,
|
||||
object : OnResultListener {
|
||||
override fun onSuccess() {
|
||||
Log.e("上报安联", "装货照片上传成功")
|
||||
Toast.makeText(mContext, "上传成功", Toast.LENGTH_SHORT).show()
|
||||
ActivityUtils.startActivity(
|
||||
mContext,
|
||||
WaybillSuccActivity::class.java,
|
||||
intent.extras
|
||||
)
|
||||
}
|
||||
|
||||
override fun onFailure(s: String, s1: String) {
|
||||
Log.e("上报安联失败(装货照片):", s + s1)
|
||||
}
|
||||
})
|
||||
}
|
||||
// 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(photoPaht)
|
||||
// val image = Image()
|
||||
// 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)
|
||||
// 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.uploadPickupImage(
|
||||
// mContext,
|
||||
// orderBean.orderNum,
|
||||
// image,
|
||||
// object : OnResultListener {
|
||||
// override fun onSuccess() {
|
||||
// Log.e("上报安联", "装货照片上传成功")
|
||||
// Toast.makeText(mContext, "上传成功", Toast.LENGTH_SHORT).show()
|
||||
// ActivityUtils.startActivity(
|
||||
// mContext,
|
||||
// WaybillSuccActivity::class.java,
|
||||
// intent.extras
|
||||
// )
|
||||
// }
|
||||
//
|
||||
// override fun onFailure(s: String, s1: String) {
|
||||
// Log.e("上报安联失败(装货照片):", s + s1)
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
//上传安联卸货
|
||||
fun upUnloadImage() {
|
||||
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
|
||||
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.uploadUnloadImage(
|
||||
mContext,
|
||||
orderBean.orderNum,
|
||||
image,
|
||||
object : OnResultListener {
|
||||
override fun onSuccess() {
|
||||
Log.e("上报安联", "卸货照片上传成功")
|
||||
// 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);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//上传安联-签收
|
||||
fun upTrafficSign(location: Location) {
|
||||
//安联
|
||||
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,
|
||||
orderBean.orderNum,
|
||||
location,
|
||||
gs,
|
||||
object : OnResultListener {
|
||||
override fun onSuccess() {
|
||||
Log.e("上报安联", "签收成功")
|
||||
}
|
||||
|
||||
override fun onFailure(s: String, s1: String) {
|
||||
Log.e("上报安联失败(签收):", s + s1)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//上传安联-回单
|
||||
fun upTrafficReceipt(location: Location) {
|
||||
//安联
|
||||
MDPLocationCollectionManager.pod(
|
||||
mContext,
|
||||
orderBean.orderNum,
|
||||
location,
|
||||
object : OnResultListener {
|
||||
override fun onSuccess() {
|
||||
Log.e("上报安联", "回单上传成功")
|
||||
}
|
||||
|
||||
override fun onFailure(s: String, s1: String) {
|
||||
Log.e("上报安联失败(回单):", s + s1)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//卸货回单照片
|
||||
fun receiptImage() {
|
||||
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||
var upCount = 0
|
||||
upBean.waybillPhotoList.filter { it.type == "3" && it.receiptType == "5" }.forEach { it ->
|
||||
var photoPaht = it.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("上报安联", "回单照片上传成功")
|
||||
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
|
||||
)
|
||||
Toast.makeText(mContext, "上传成功", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
|
||||
// finish()
|
||||
}
|
||||
|
||||
override fun onFailure(s: String, s1: 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
|
||||
)
|
||||
Toast.makeText(mContext, "上传成功", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
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);
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// var photoPaht =
|
||||
// upBean.waybillPhotoList.find { it.type == "3" && it.receiptType == "5" }?.localPhotoUrl
|
||||
// val file: File = File(photoPaht)
|
||||
// fun upUnloadImage() {
|
||||
// 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
|
||||
@ -587,34 +431,185 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
||||
// image.baiduLongitude = bdLatLng.longitude
|
||||
// image.baiduLatitude = bdLatLng.latitude
|
||||
// image.location = binding.tvLoca.text.toString()
|
||||
// MDPLocationCollectionManager.uploadPODImage(
|
||||
// MDPLocationCollectionManager.uploadUnloadImage(
|
||||
// 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()
|
||||
// Log.e("上报安联", "卸货照片上传成功")
|
||||
//// 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());
|
||||
// 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);
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
|
||||
//上传安联-签收
|
||||
// fun upTrafficSign(location: Location) {
|
||||
// //安联
|
||||
// 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,
|
||||
// orderBean.orderNum,
|
||||
// location,
|
||||
// gs,
|
||||
// object : OnResultListener {
|
||||
// override fun onSuccess() {
|
||||
// Log.e("上报安联", "签收成功")
|
||||
// }
|
||||
//
|
||||
// override fun onFailure(s: String, s1: String) {
|
||||
// Log.e("上报安联失败(签收):", s + s1)
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
//上传安联-回单
|
||||
// fun upTrafficReceipt(location: Location) {
|
||||
// //安联
|
||||
// MDPLocationCollectionManager.pod(
|
||||
// mContext,
|
||||
// orderBean.orderNum,
|
||||
// location,
|
||||
// object : OnResultListener {
|
||||
// override fun onSuccess() {
|
||||
// Log.e("上报安联", "回单上传成功")
|
||||
// }
|
||||
//
|
||||
// override fun onFailure(s: String, s1: String) {
|
||||
// Log.e("上报安联失败(回单):", s + s1)
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
//卸货回单照片
|
||||
// fun receiptImage() {
|
||||
// ///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||
// var upCount = 0
|
||||
// upBean.waybillPhotoList.filter { it.type == "3" && it.receiptType == "5" }.forEach { it ->
|
||||
// var photoPaht = it.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("上报安联", "回单照片上传成功")
|
||||
// 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
|
||||
// )
|
||||
// Toast.makeText(mContext, "上传成功", Toast.LENGTH_SHORT).show()
|
||||
// }
|
||||
//
|
||||
//// finish()
|
||||
// }
|
||||
//
|
||||
// override fun onFailure(s: String, s1: 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
|
||||
// )
|
||||
// Toast.makeText(mContext, "上传成功", Toast.LENGTH_SHORT).show()
|
||||
// }
|
||||
// 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);
|
||||
// }
|
||||
// })
|
||||
}
|
||||
// }
|
||||
// })
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// }
|
||||
//
|
||||
//// 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()
|
||||
|
Loading…
Reference in New Issue
Block a user