Compare commits
24
Commits
ocrcamera
...
manyflavors
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9620f13b42 | ||
|
|
ea649da8dd | ||
|
|
edf3f494da | ||
|
|
2bdf0d45dc | ||
|
|
725860544a | ||
|
|
befc5419a2 | ||
|
|
f0778a34e3 | ||
|
|
d3915a92a0 | ||
|
|
fbe1492800 | ||
|
|
b5fb6bec07 | ||
|
|
80c67f9c79 | ||
|
|
932a33f3d1 | ||
|
|
35c37fdf51 | ||
|
|
c3a3a5cfe6 | ||
|
|
a7aee4af57 | ||
|
|
1c3d20ac43 | ||
|
|
f37ffa779a | ||
|
|
7d60c08e61 | ||
|
|
45d8b3351d | ||
|
|
10a379ed8f | ||
|
|
a44df1ee8c | ||
|
|
50cc329a4d | ||
|
|
360f492b8a | ||
|
|
dc4f34efd7 |
+39
-28
@@ -37,9 +37,10 @@ android {
|
|||||||
applicationId "com.arpa.hndahesudintocctmsdriver"
|
applicationId "com.arpa.hndahesudintocctmsdriver"
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 57
|
versionCode 60
|
||||||
versionName "3.2.7"
|
versionName "3.3.0"
|
||||||
flavorDimensions "CHANNEL_VALUE"
|
flavorDimensions "CHANNEL_VALUE"
|
||||||
|
flavorDimensions "app_icon"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
javaCompileOptions {
|
javaCompileOptions {
|
||||||
|
|
||||||
@@ -56,27 +57,7 @@ android {
|
|||||||
// 还可以添加 'x86', 'x86_64', 'mips', 'mips64' , 'arm64-v8a'
|
// 还可以添加 'x86', 'x86_64', 'mips', 'mips64' , 'arm64-v8a'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
manifestPlaceholders = [
|
|
||||||
JPUSH_PKGNAME : applicationId,
|
|
||||||
JPUSH_APPKEY : "571d93ae5117da6dee848c92", //JPush 上注册的包名对应的 Appkey.
|
|
||||||
JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可.
|
|
||||||
MEIZU_APPKEY : "MZ-魅族的APPKEY",
|
|
||||||
MEIZU_APPID : "MZ-魅族的APPID",
|
|
||||||
XIAOMI_APPID : "MI-小米的APPID",
|
|
||||||
XIAOMI_APPKEY : "MI-小米的APPKEY",
|
|
||||||
OPPO_APPKEY : "OP-oppo的APPKEY",
|
|
||||||
OPPO_APPID : "OP-oppo的APPID",
|
|
||||||
OPPO_APPSECRET : "OP-oppo的APPSECRET",
|
|
||||||
VIVO_APPKEY : "vivo的APPKEY",
|
|
||||||
VIVO_APPID : "vivo的APPID"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
// sourceSets {
|
|
||||||
// main {
|
|
||||||
// jniLibs.srcDirs = ['libs']
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
@@ -115,7 +96,14 @@ android {
|
|||||||
|
|
||||||
productFlavors {
|
productFlavors {
|
||||||
qa {
|
qa {
|
||||||
manifestPlaceholders = [CHANNEL_VALUE: "好运司机测试"]
|
applicationId "com.arpa.hndahesudintocctmsdriver.text"
|
||||||
|
manifestPlaceholders = [CHANNEL_VALUE: "司机测试",
|
||||||
|
app_icon : "@drawable/diver_logo_text",
|
||||||
|
GAODEKEY : "6791d69f6221a0841b521763af86eb01",
|
||||||
|
JPUSH_PKGNAME: applicationId,
|
||||||
|
JPUSH_APPKEY : "571d93ae5117da6dee848c92", //JPush 上注册的包名对应的 Appkey.
|
||||||
|
JPUSH_CHANNEL: "developer-default"//暂时填写默认值即可.
|
||||||
|
]
|
||||||
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi-staging.alct56.com\"")
|
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi-staging.alct56.com\"")
|
||||||
buildConfigField("String", "BASE_URL", "\"http://app.test.dahehuoyun.com/api/\"")
|
buildConfigField("String", "BASE_URL", "\"http://app.test.dahehuoyun.com/api/\"")
|
||||||
buildConfigField "boolean", "isTest", "true"
|
buildConfigField "boolean", "isTest", "true"
|
||||||
@@ -123,7 +111,14 @@ android {
|
|||||||
resValue "string", "appName", "司机测试"
|
resValue "string", "appName", "司机测试"
|
||||||
}
|
}
|
||||||
product {
|
product {
|
||||||
manifestPlaceholders = [CHANNEL_VALUE: "大河好运司机"]
|
applicationId "com.arpa.hndahesudintocctmsdriver"
|
||||||
|
manifestPlaceholders = [CHANNEL_VALUE: "大河好运司机",
|
||||||
|
app_icon : "@drawable/diver_logo",
|
||||||
|
GAODEKEY : "78019612271411eca3af34db91930620",
|
||||||
|
JPUSH_PKGNAME: applicationId,
|
||||||
|
JPUSH_APPKEY : "571d93ae5117da6dee848c92", //JPush 上注册的包名对应的 Appkey.
|
||||||
|
JPUSH_CHANNEL: "developer-default"//暂时填写默认值即可.
|
||||||
|
]
|
||||||
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi.alct56.com\"")
|
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi.alct56.com\"")
|
||||||
buildConfigField("String", "BASE_URL", "\"http://app.dahehuoyun.com/api/\"")
|
buildConfigField("String", "BASE_URL", "\"http://app.dahehuoyun.com/api/\"")
|
||||||
buildConfigField "boolean", "isTest", "false"
|
buildConfigField "boolean", "isTest", "false"
|
||||||
@@ -131,10 +126,26 @@ android {
|
|||||||
resValue "string", "appName", "大河好运司机"
|
resValue "string", "appName", "大河好运司机"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
productbc {
|
||||||
|
applicationId "com.arpa.hndahesudintocctmsdriver.bc"
|
||||||
|
manifestPlaceholders = [CHANNEL_VALUE: "司机运营",
|
||||||
|
app_icon : "@drawable/diver_logo_yunying",
|
||||||
|
GAODEKEY : "f960bc6d14788238918bd014fa08a870",
|
||||||
|
JPUSH_PKGNAME: applicationId,
|
||||||
|
JPUSH_APPKEY : "571d93ae5117da6dee848c92", //JPush 上注册的包名对应的 Appkey.
|
||||||
|
JPUSH_CHANNEL: "developer-default"//暂时填写默认值即可.
|
||||||
|
]
|
||||||
|
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi.alct56.com\"")
|
||||||
|
buildConfigField("String", "BASE_URL", "\"http://app.dahehuoyun.com/api/\"")
|
||||||
|
buildConfigField "boolean", "isTest", "false"
|
||||||
|
//APP名称,可以在androidMainfest中引用
|
||||||
|
resValue "string", "appName", "司机运营"
|
||||||
}
|
}
|
||||||
productFlavors.all { flavor ->
|
|
||||||
flavor.manifestPlaceholders = [CHANNEL_VALUE: name]
|
|
||||||
}
|
}
|
||||||
|
// productFlavors.all { flavor ->
|
||||||
|
// flavor.manifestPlaceholders = [CHANNEL_VALUE: name]
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
android.applicationVariants.all { variant ->
|
android.applicationVariants.all { variant ->
|
||||||
@@ -176,8 +187,8 @@ dependencies {
|
|||||||
implementation 'com.scwang.smart:refresh-footer-ball:2.0.1' //球脉冲加载
|
implementation 'com.scwang.smart:refresh-footer-ball:2.0.1' //球脉冲加载
|
||||||
implementation 'com.scwang.smart:refresh-footer-classics:2.0.1' //经典加载
|
implementation 'com.scwang.smart:refresh-footer-classics:2.0.1' //经典加载
|
||||||
//更新版本
|
//更新版本
|
||||||
implementation 'com.github.jenly1314.AppUpdater:app-updater:1.1.0'
|
implementation 'com.github.jenly1314.AppUpdater:app-updater:1.2.0'
|
||||||
implementation 'com.github.jenly1314.AppUpdater:app-dialog:1.1.0'
|
implementation 'com.github.jenly1314.AppUpdater:app-dialog:1.2.0'
|
||||||
//轮播插件
|
//轮播插件
|
||||||
implementation 'com.github.zhpanvip:BannerViewPager:3.5.4'
|
implementation 'com.github.zhpanvip:BannerViewPager:3.5.4'
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
android:name="com.arpa.hndahesudintocctmsdriver.App"
|
android:name="com.arpa.hndahesudintocctmsdriver.App"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:excludeFromRecents="true"
|
android:excludeFromRecents="true"
|
||||||
android:icon="@drawable/diver_logo"
|
android:icon="${app_icon}"
|
||||||
android:label="@string/appName"
|
android:label="@string/appName"
|
||||||
android:largeHeap="true"
|
android:largeHeap="true"
|
||||||
android:requestLegacyExternalStorage="true"
|
android:requestLegacyExternalStorage="true"
|
||||||
@@ -97,7 +97,20 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.VehicleAuthActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.VehicleAuthActivity"
|
||||||
android:screenOrientation="portrait"/>
|
android:screenOrientation="portrait"/>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivityBC"
|
||||||
|
android:screenOrientation="portrait">
|
||||||
|
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.nfc.action.TAG_DISCOVERED" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
|
||||||
|
<data android:mimeType="*/*" />
|
||||||
|
</intent-filter>
|
||||||
|
|
||||||
|
</activity> <activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity"
|
||||||
android:screenOrientation="portrait">
|
android:screenOrientation="portrait">
|
||||||
|
|
||||||
@@ -111,6 +124,7 @@
|
|||||||
|
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity2"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity2"
|
||||||
android:screenOrientation="portrait">
|
android:screenOrientation="portrait">
|
||||||
@@ -247,7 +261,7 @@
|
|||||||
<!--高德地图-->
|
<!--高德地图-->
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="com.amap.api.v2.apikey"
|
android:name="com.amap.api.v2.apikey"
|
||||||
android:value="78019612271411eca3af34db91930620" />
|
android:value="${GAODEKEY}" />
|
||||||
<!-- android:value="702eaa84675618b8eb69298d9fd42ca3" />-->
|
<!-- android:value="702eaa84675618b8eb69298d9fd42ca3" />-->
|
||||||
|
|
||||||
<service android:name="com.amap.api.location.APSService"></service>
|
<service android:name="com.amap.api.location.APSService"></service>
|
||||||
@@ -382,7 +396,7 @@
|
|||||||
</receiver>
|
</receiver>
|
||||||
<provider
|
<provider
|
||||||
android:name="androidx.core.content.FileProvider"
|
android:name="androidx.core.content.FileProvider"
|
||||||
android:authorities="com.arpa.hndahesudintocctmsdriver.fileprovider"
|
android:authorities="${applicationId}.fileprovider"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:grantUriPermissions="true"
|
android:grantUriPermissions="true"
|
||||||
tools:ignore="WrongManifestParent">
|
tools:ignore="WrongManifestParent">
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
|||||||
import com.gyf.cactus.Cactus;
|
import com.gyf.cactus.Cactus;
|
||||||
import com.gyf.cactus.callback.CactusBackgroundCallback;
|
import com.gyf.cactus.callback.CactusBackgroundCallback;
|
||||||
import com.gyf.cactus.callback.CactusCallback;
|
import com.gyf.cactus.callback.CactusCallback;
|
||||||
|
import com.tencent.bugly.crashreport.CrashReport;
|
||||||
import com.umeng.commonsdk.UMConfigure;
|
import com.umeng.commonsdk.UMConfigure;
|
||||||
|
|
||||||
import cn.jiguang.verifysdk.api.JVerificationInterface;
|
import cn.jiguang.verifysdk.api.JVerificationInterface;
|
||||||
@@ -46,6 +47,7 @@ public class App extends Application {
|
|||||||
mApplication = this;
|
mApplication = this;
|
||||||
con = getBaseContext();
|
con = getBaseContext();
|
||||||
CommonBaseLibrary.getInstance().init(this, Api.BASE_URL);
|
CommonBaseLibrary.getInstance().init(this, Api.BASE_URL);
|
||||||
|
CrashReport.initCrashReport(getApplicationContext(), "0fa55ffad8", false);
|
||||||
String state = SPUtil.getSP(con, "state_data", "authorization_state");
|
String state = SPUtil.getSP(con, "state_data", "authorization_state");
|
||||||
if ("1".equals(state)) {
|
if ("1".equals(state)) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -224,27 +224,6 @@ public class H5Activity extends AppCompatActivity {
|
|||||||
|
|
||||||
Uri uri = Uri.parse(url);
|
Uri uri = Uri.parse(url);
|
||||||
Log.e("test", "要加载的地址:" + uri.getScheme() + " " + url + " ");
|
Log.e("test", "要加载的地址:" + uri.getScheme() + " " + url + " ");
|
||||||
|
|
||||||
|
|
||||||
// if (url.contains("callback")) {
|
|
||||||
// // 实名认证结束 返回按钮/倒计时返回/暂不认证
|
|
||||||
// boolean status = uri.getBooleanQueryParameter("passed", false);
|
|
||||||
// if (status) {
|
|
||||||
//
|
|
||||||
// new Handler().postDelayed(() -> {
|
|
||||||
// FaceEvent he = new FaceEvent("刷脸成功");
|
|
||||||
// EventBus.getDefault().post(he);
|
|
||||||
// finish();
|
|
||||||
// }, 4000);
|
|
||||||
// }else{
|
|
||||||
// if (mWebView.canGoBack()) {
|
|
||||||
// mWebView.goBack();
|
|
||||||
// }
|
|
||||||
// Toast.makeText(H5Activity.this, "认证失败,请重新刷脸认证", Toast.LENGTH_SHORT).show();
|
|
||||||
// }
|
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (uri.getScheme().equals("http") || uri.getScheme().equals("https")) {
|
if (uri.getScheme().equals("http") || uri.getScheme().equals("https")) {
|
||||||
view.loadUrl(url);
|
view.loadUrl(url);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -1,11 +1,18 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.cuspop
|
package com.arpa.hndahesudintocctmsdriver.cuspop
|
||||||
|
|
||||||
|
import android.Manifest
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import android.widget.Toast
|
||||||
|
import androidx.fragment.app.FragmentActivity
|
||||||
import com.arpa.hndahesudintocctmsdriver.R
|
import com.arpa.hndahesudintocctmsdriver.R
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil
|
||||||
|
import com.dahe.mylibrary.utils.ToastUtils
|
||||||
import com.lxj.xpopup.core.CenterPopupView
|
import com.lxj.xpopup.core.CenterPopupView
|
||||||
|
import com.lxj.xpopup.util.XPermission
|
||||||
|
import com.permissionx.guolindev.PermissionX
|
||||||
import kotlinx.android.synthetic.main.load.view.*
|
import kotlinx.android.synthetic.main.load.view.*
|
||||||
import kotlinx.android.synthetic.main.pop_message_center.view.*
|
import kotlinx.android.synthetic.main.pop_message_center.view.*
|
||||||
|
|
||||||
@@ -48,11 +55,16 @@ class MessagePop(context: Context) : CenterPopupView(context), View.OnClickListe
|
|||||||
}
|
}
|
||||||
R.id.tvOk,R.id.tvPhone -> {
|
R.id.tvOk,R.id.tvPhone -> {
|
||||||
dismiss()
|
dismiss()
|
||||||
|
if (XPermission.create(context).isGranted(Manifest.permission.CALL_PHONE)){
|
||||||
val toString = tvPhone.text.toString()
|
val toString = tvPhone.text.toString()
|
||||||
val intent = Intent(Intent.ACTION_DIAL)
|
val intent = Intent(Intent.ACTION_DIAL)
|
||||||
val data = Uri.parse("tel:$toString")
|
val data = Uri.parse("tel:$toString")
|
||||||
intent.data = data
|
intent.data = data
|
||||||
context.startActivity(intent)
|
context.startActivity(intent)
|
||||||
|
}else{
|
||||||
|
ToastUtils.showToast(context,"请开启电话权限")
|
||||||
|
}
|
||||||
|
|
||||||
// BaseUtils.callPhone(content as Activity, tvPhone.text.toString())
|
// BaseUtils.callPhone(content as Activity, tvPhone.text.toString())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.request;
|
package com.arpa.hndahesudintocctmsdriver.request;
|
||||||
|
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean;
|
import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.TrackInputBean;
|
import com.arpa.hndahesudintocctmsdriver.request.bean.TrackInputBean;
|
||||||
@@ -8,7 +9,6 @@ import com.arpa.hndahesudintocctmsdriver.ui.home.HuoYuanFragmengt;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.ui.home.HuoYunDelActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.home.HuoYunDelActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.home.StartYunDanActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.home.StartYunDanActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.OrderComplaintActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.OrderComplaintActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.map.MapUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.map.MapUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||||
@@ -89,6 +89,11 @@ public class HuoYuanRequset{
|
|||||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getUNLOADING(), gson.toJson(lub)),getToken(con),con);
|
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getUNLOADING(), gson.toJson(lub)),getToken(con),con);
|
||||||
RequestUtil.start(1, ShangChuangImgActivity.TYPE_NAME[1],re,con,hd);
|
RequestUtil.start(1, ShangChuangImgActivity.TYPE_NAME[1],re,con,hd);
|
||||||
}
|
}
|
||||||
|
//卸货-补传
|
||||||
|
public void dischargeCargo4(LUInputBean lub){
|
||||||
|
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getUNLOADING4(), gson.toJson(lub)),getToken(con),con);
|
||||||
|
RequestUtil.start(1, ShangChuangImgActivity.TYPE_NAME[1],re,con,hd);
|
||||||
|
}
|
||||||
//回单
|
//回单
|
||||||
public void receipt(UploadReceiptInputBean urib){
|
public void receipt(UploadReceiptInputBean urib){
|
||||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getUploadReceipt(), gson.toJson(urib)),getToken(con),con);
|
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getUploadReceipt(), gson.toJson(urib)),getToken(con),con);
|
||||||
|
|||||||
@@ -67,6 +67,8 @@ public class RequestConstant {
|
|||||||
private static final String LOADING = "/app/driver/waybill/loadingV2";
|
private static final String LOADING = "/app/driver/waybill/loadingV2";
|
||||||
//卸货
|
//卸货
|
||||||
private static final String UNLOADING = "/app/driver/waybill/unloadV2";
|
private static final String UNLOADING = "/app/driver/waybill/unloadV2";
|
||||||
|
//卸货-补传
|
||||||
|
private static final String UNLOADING4 = "/app/driver/waybill/unloadV4";
|
||||||
//上传回单
|
//上传回单
|
||||||
private static final String UPLOAD_RECEIPT = "/app/driver/waybill/uploadReceipt";
|
private static final String UPLOAD_RECEIPT = "/app/driver/waybill/uploadReceipt";
|
||||||
//轨迹跟踪
|
//轨迹跟踪
|
||||||
@@ -209,9 +211,13 @@ public class RequestConstant {
|
|||||||
return BASE_URL + BANK_CARD_LIST;
|
return BASE_URL + BANK_CARD_LIST;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getXiaoXiListUrl() { return BASE_URL + XIAOXI_LIST; }
|
public static String getXiaoXiListUrl() {
|
||||||
|
return BASE_URL + XIAOXI_LIST;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getXiaoxiAll() { return BASE_URL +XIAOXI_ALL; }
|
public static String getXiaoxiAll() {
|
||||||
|
return BASE_URL + XIAOXI_ALL;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getOrderList() {
|
public static String getOrderList() {
|
||||||
return BASE_URL + ORDER_LIST;
|
return BASE_URL + ORDER_LIST;
|
||||||
@@ -241,6 +247,10 @@ public class RequestConstant {
|
|||||||
return BASE_URL + UNLOADING;
|
return BASE_URL + UNLOADING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getUNLOADING4() {
|
||||||
|
return BASE_URL + UNLOADING4;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getGetEvaluate() {
|
public static String getGetEvaluate() {
|
||||||
return BASE_URL + GET_EVALUATE;
|
return BASE_URL + GET_EVALUATE;
|
||||||
}
|
}
|
||||||
@@ -293,15 +303,25 @@ public class RequestConstant {
|
|||||||
return BASE_URL + ISAUTH_IDCARD;
|
return BASE_URL + ISAUTH_IDCARD;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getIsauthDriverauthLicense() { return BASE_URL +ISAUTH_DRIVERAUTH_LICENSE; }
|
public static String getIsauthDriverauthLicense() {
|
||||||
|
return BASE_URL + ISAUTH_DRIVERAUTH_LICENSE;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getUploadReceipt() { return BASE_URL +UPLOAD_RECEIPT; }
|
public static String getUploadReceipt() {
|
||||||
|
return BASE_URL + UPLOAD_RECEIPT;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getUPLOAD() { return BASE_URL +UPLOAD; }
|
public static String getUPLOAD() {
|
||||||
|
return BASE_URL + UPLOAD;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getTrackTracking() {return BASE_URL +TRACK_TRACKING; }
|
public static String getTrackTracking() {
|
||||||
|
return BASE_URL + TRACK_TRACKING;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getEvaluationV2() { return BASE_URL +EVALUATION_V2; }
|
public static String getEvaluationV2() {
|
||||||
|
return BASE_URL + EVALUATION_V2;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getDRIVERAUTHIDCARD() {
|
public static String getDRIVERAUTHIDCARD() {
|
||||||
return BASE_URL + DRIVERAUTHIDCARD;
|
return BASE_URL + DRIVERAUTHIDCARD;
|
||||||
@@ -319,27 +339,45 @@ public class RequestConstant {
|
|||||||
return BASE_URL + SAVECARIMG;
|
return BASE_URL + SAVECARIMG;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getUploadHead() { return BASE_URL +UPLOAD_HEAD; }
|
public static String getUploadHead() {
|
||||||
|
return BASE_URL + UPLOAD_HEAD;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getInsBankcard() {
|
public static String getInsBankcard() {
|
||||||
return BASE_URL + INS_BANKCARD;
|
return BASE_URL + INS_BANKCARD;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getDelCar() { return BASE_URL +DEL_CAR; }
|
public static String getDelCar() {
|
||||||
|
return BASE_URL + DEL_CAR;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getXiaoxiDel() { return BASE_URL +XIAOXI_DEL; }
|
public static String getXiaoxiDel() {
|
||||||
|
return BASE_URL + XIAOXI_DEL;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getCOMPLAINT() { return BASE_URL+COMPLAINT; }
|
public static String getCOMPLAINT() {
|
||||||
|
return BASE_URL + COMPLAINT;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getXiaoxiDelAll() { return BASE_URL+XIAOXI_DEL_ALL; }
|
public static String getXiaoxiDelAll() {
|
||||||
|
return BASE_URL + XIAOXI_DEL_ALL;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getDriverAuthQualification() { return BASE_URL+DRIVER_AUTH_QUALIFICATION; }
|
public static String getDriverAuthQualification() {
|
||||||
|
return BASE_URL + DRIVER_AUTH_QUALIFICATION;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getDriverSaveCarRegisterNo() { return BASE_URL+DRIVER_AUTH_SAVECARREGISTERNO; }
|
public static String getDriverSaveCarRegisterNo() {
|
||||||
|
return BASE_URL + DRIVER_AUTH_SAVECARREGISTERNO;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getDriverSaveCarRoadLicenseNo() { return BASE_URL+DRIVER_AUTH_SAVECARROADLICENSENO; }
|
public static String getDriverSaveCarRoadLicenseNo() {
|
||||||
|
return BASE_URL + DRIVER_AUTH_SAVECARROADLICENSENO;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getSaveDrawCar() { return BASE_URL+SAVE_DRAW_CAR; }
|
public static String getSaveDrawCar() {
|
||||||
|
return BASE_URL + SAVE_DRAW_CAR;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getIsAuthDriverAuthQualification() {
|
public static String getIsAuthDriverAuthQualification() {
|
||||||
return BASE_URL + IS_AUTH_DRIVER_AUTH_QUALIFICATION;
|
return BASE_URL + IS_AUTH_DRIVER_AUTH_QUALIFICATION;
|
||||||
@@ -381,7 +419,9 @@ public class RequestConstant {
|
|||||||
return BASE_URL + WITHDRAWALS_CONFIG;
|
return BASE_URL + WITHDRAWALS_CONFIG;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getGetErrorOrder() { return BASE_URL+GET_ERROR_ORDER; }
|
public static String getGetErrorOrder() {
|
||||||
|
return BASE_URL + GET_ERROR_ORDER;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getGetExampleList() {
|
public static String getGetExampleList() {
|
||||||
return BASE_URL + GET_EXAMPLE_LIST;
|
return BASE_URL + GET_EXAMPLE_LIST;
|
||||||
|
|||||||
@@ -137,18 +137,18 @@ public class UserRequset {
|
|||||||
|
|
||||||
//app更新
|
//app更新
|
||||||
public void upApp() {
|
public void upApp() {
|
||||||
String vs = "1.0.0";
|
// String vs = "1.0.0";
|
||||||
try {
|
// try {
|
||||||
// isOpenAppNoRe();
|
//// isOpenAppNoRe();
|
||||||
vs = con.getPackageManager().getPackageInfo(con.getPackageName(), 0).versionName;
|
// vs = con.getPackageManager().getPackageInfo(con.getPackageName(), 0).versionName;
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
// } catch (PackageManager.NameNotFoundException e) {
|
||||||
e.printStackTrace();
|
// e.printStackTrace();
|
||||||
}
|
// }
|
||||||
Map<String, Object> map = new HashMap<>();
|
// Map<String, Object> map = new HashMap<>();
|
||||||
map.put("source", 0);
|
// map.put("source", 0);
|
||||||
map.put("version", vs);
|
// map.put("version", vs);
|
||||||
Request re = OkHttpUtil.post(new OkDate(RequestConstant.getVERSION(), MapUtil.mapJson(map)), con);
|
// Request re = OkHttpUtil.post(new OkDate(RequestConstant.getVERSION(), MapUtil.mapJson(map)), con);
|
||||||
RequestUtil.start(1, "up_app", re, con, hd);
|
// RequestUtil.start(1, "up_app", re, con, hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -15,6 +15,15 @@ public class LUInputBean {
|
|||||||
private String locationAddress;
|
private String locationAddress;
|
||||||
private String longitude;
|
private String longitude;
|
||||||
private String waybillId;
|
private String waybillId;
|
||||||
|
private String realLoadTime;
|
||||||
|
|
||||||
|
public String getRealLoadTime() {
|
||||||
|
return realLoadTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRealLoadTime(String realLoadTime) {
|
||||||
|
this.realLoadTime = realLoadTime;
|
||||||
|
}
|
||||||
|
|
||||||
public List<Integer> getImageId() {
|
public List<Integer> getImageId() {
|
||||||
return imageId;
|
return imageId;
|
||||||
|
|||||||
@@ -138,6 +138,7 @@ class MainActivity : BaseAppCompatActivity() {
|
|||||||
Manifest.permission.ACCESS_BACKGROUND_LOCATION,
|
Manifest.permission.ACCESS_BACKGROUND_LOCATION,
|
||||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||||
|
Manifest.permission.CALL_PHONE,
|
||||||
Manifest.permission.RECORD_AUDIO,
|
Manifest.permission.RECORD_AUDIO,
|
||||||
Manifest.permission.CAMERA)
|
Manifest.permission.CAMERA)
|
||||||
.request { allGranted, grantedList, deniedList ->
|
.request { allGranted, grantedList, deniedList ->
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.ui.alert;
|
package com.arpa.hndahesudintocctmsdriver.ui.alert;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.provider.Settings;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
@@ -12,6 +16,8 @@ import androidx.annotation.NonNull;
|
|||||||
|
|
||||||
import com.king.app.updater.AppUpdater;
|
import com.king.app.updater.AppUpdater;
|
||||||
import com.king.app.updater.callback.AppUpdateCallback;
|
import com.king.app.updater.callback.AppUpdateCallback;
|
||||||
|
import com.king.app.updater.constant.Constants;
|
||||||
|
import com.king.app.updater.util.AppUtils;
|
||||||
import com.lxj.xpopup.core.CenterPopupView;
|
import com.lxj.xpopup.core.CenterPopupView;
|
||||||
import com.arpa.hndahesudintocctmsdriver.R;
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
|
|
||||||
@@ -27,8 +33,8 @@ import java.io.File;
|
|||||||
*/
|
*/
|
||||||
public class UpAppAlert extends CenterPopupView {
|
public class UpAppAlert extends CenterPopupView {
|
||||||
|
|
||||||
private TextView content,vs;
|
private TextView content, vs, tvContent;
|
||||||
private Button tv_cancel,tv_confirm;
|
private Button tv_cancel, tv_confirm, tvOk;
|
||||||
private LinearLayout up_div;
|
private LinearLayout up_div;
|
||||||
private String url = "";
|
private String url = "";
|
||||||
private String body = "";
|
private String body = "";
|
||||||
@@ -52,6 +58,7 @@ public class UpAppAlert extends CenterPopupView {
|
|||||||
protected int getImplLayoutId() {
|
protected int getImplLayoutId() {
|
||||||
return R.layout.alert_up_app;
|
return R.layout.alert_up_app;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UpAppAlert(@NonNull @NotNull Context context) {
|
public UpAppAlert(@NonNull @NotNull Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
|
|
||||||
@@ -63,6 +70,8 @@ public class UpAppAlert extends CenterPopupView {
|
|||||||
content = findViewById(R.id.tv_content);
|
content = findViewById(R.id.tv_content);
|
||||||
tv_cancel = findViewById(R.id.tv_cancel);
|
tv_cancel = findViewById(R.id.tv_cancel);
|
||||||
tv_confirm = findViewById(R.id.tv_confirm);
|
tv_confirm = findViewById(R.id.tv_confirm);
|
||||||
|
tvContent = findViewById(R.id.tvContent);
|
||||||
|
tvOk = findViewById(R.id.tvOk);
|
||||||
up_div = findViewById(R.id.up_div);
|
up_div = findViewById(R.id.up_div);
|
||||||
progress_view = findViewById(R.id.progress);
|
progress_view = findViewById(R.id.progress);
|
||||||
content = findViewById(R.id.tv_content);
|
content = findViewById(R.id.tv_content);
|
||||||
@@ -83,9 +92,9 @@ public class UpAppAlert extends CenterPopupView {
|
|||||||
System.exit(1);
|
System.exit(1);
|
||||||
});
|
});
|
||||||
tv_confirm.setOnClickListener(v -> {
|
tv_confirm.setOnClickListener(v -> {
|
||||||
new AppUpdater.Builder()
|
new AppUpdater.Builder(con)
|
||||||
.setUrl(url)
|
.setUrl(url)
|
||||||
.build(con)
|
.build()
|
||||||
.setUpdateCallback(new AppUpdateCallback() {
|
.setUpdateCallback(new AppUpdateCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onStart(String url) {
|
public void onStart(String url) {
|
||||||
@@ -93,6 +102,7 @@ public class UpAppAlert extends CenterPopupView {
|
|||||||
tv_confirm.setVisibility(GONE);
|
tv_confirm.setVisibility(GONE);
|
||||||
up_div.setVisibility(VISIBLE);
|
up_div.setVisibility(VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onProgress(long progress, long total, boolean isChange) {
|
public void onProgress(long progress, long total, boolean isChange) {
|
||||||
// Log.e("progress",progress+"");
|
// Log.e("progress",progress+"");
|
||||||
@@ -109,7 +119,11 @@ public class UpAppAlert extends CenterPopupView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFinish(File file) {
|
public void onFinish(File file) {
|
||||||
|
tvContent.setText("下载完成,请及时安装!");
|
||||||
|
tvOk.setVisibility(VISIBLE);
|
||||||
|
tvOk.setOnClickListener(v1 -> {
|
||||||
|
AppUtils.installApk(getContext(), file, getContext().getPackageName() + Constants.DEFAULT_FILE_PROVIDER);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.start();
|
.start();
|
||||||
|
|||||||
+6
-1
@@ -229,6 +229,11 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
|||||||
gia.showPopueWindow(this);
|
gia.showPopueWindow(this);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
up_img.setOnClickListener(v -> {
|
||||||
|
if (!isAuth) {
|
||||||
|
gia.showPopueWindow(this);
|
||||||
|
}
|
||||||
|
});
|
||||||
img.setOnClickListener(v -> {
|
img.setOnClickListener(v -> {
|
||||||
if (!"".equals(url)) {
|
if (!"".equals(url)) {
|
||||||
new XPopup.Builder(con).asImageViewer(img, url, new SmartGlideImageLoader(R.mipmap.ic_launcher_round)).show();
|
new XPopup.Builder(con).asImageViewer(img, url, new SmartGlideImageLoader(R.mipmap.ic_launcher_round)).show();
|
||||||
@@ -250,7 +255,7 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
|||||||
String id = value1.getText() + "";
|
String id = value1.getText() + "";
|
||||||
String date = value2.getText() + "";
|
String date = value2.getText() + "";
|
||||||
if ("0".equals(type)) {
|
if ("0".equals(type)) {
|
||||||
if (!"".equals(id) && !"".equals(date) && !"".equals(url)) {
|
if (!"".equals(date) && !"".equals(url)) {
|
||||||
new AuthRequest().driverAuthQualification(con, hd, id, ub.getData().getId(), date);
|
new AuthRequest().driverAuthQualification(con, hd, id, ub.getData().getId(), date);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, "请补充证件信息", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "请补充证件信息", Toast.LENGTH_SHORT).show();
|
||||||
|
|||||||
+3
-1
@@ -660,7 +660,9 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
Log.e("挂车信息", gson.toJson(cdb));
|
Log.e("挂车信息", gson.toJson(cdb));
|
||||||
if (cdb != null && cdb.getData().getTrailerResVo() != null) {
|
if (cdb != null && cdb.getData().getTrailerResVo() != null
|
||||||
|
&& !TextUtils.isEmpty(cdb.getData().getTrailerResVo().getFrontImage())
|
||||||
|
&& !TextUtils.isEmpty(cdb.getData().getTrailerResVo().getBackImage())) {
|
||||||
url1 = StringUtil.isNull(cdb.getData().getTrailerResVo().getFrontImage(), "");
|
url1 = StringUtil.isNull(cdb.getData().getTrailerResVo().getFrontImage(), "");
|
||||||
url2 = StringUtil.isNull(cdb.getData().getTrailerResVo().getBackImage(), "");
|
url2 = StringUtil.isNull(cdb.getData().getTrailerResVo().getBackImage(), "");
|
||||||
url3 = StringUtil.isNull(cdb.getData().getTrailerResVo().getThreeImage(), "");
|
url3 = StringUtil.isNull(cdb.getData().getTrailerResVo().getThreeImage(), "");
|
||||||
|
|||||||
@@ -159,12 +159,12 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
if (ib.getCode() == 200) {
|
if (ib.getCode() == 200) {
|
||||||
//判断是否需要跳转挂车行驶证页面
|
//判断是否需要跳转挂车行驶证页面
|
||||||
if (!"".equals(carId)) {
|
if (!"".equals(carId)) {
|
||||||
if (cdb.getData().getIsTrailer() == 1&&!TextUtils.isEmpty(cdb.getData().getTrailerResVo().getCarNumber())){//需要挂车,并且传过挂车直接结束
|
if (cdb.getData().getIsTrailer() == 1 && cdb.getData().getTrailerResVo() != null && !TextUtils.isEmpty(cdb.getData().getTrailerResVo().getCarNumber())) {//需要挂车,并且传过挂车直接结束
|
||||||
finish();
|
finish();
|
||||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||||
in.putExtra("type", 3);
|
in.putExtra("type", 3);
|
||||||
con.startActivity(in);
|
con.startActivity(in);
|
||||||
}else if(cdb.getData().getIsTrailer() == 1&&TextUtils.isEmpty(cdb.getData().getTrailerResVo().getCarNumber())){//需要挂车,没传过挂车,到挂车页面
|
} else if (cdb.getData().getIsTrailer() == 1 && cdb.getData().getTrailerResVo() != null && TextUtils.isEmpty(cdb.getData().getTrailerResVo().getCarNumber())) {//需要挂车,没传过挂车,到挂车页面
|
||||||
finish();
|
finish();
|
||||||
Intent in = new Intent(con, CertificatesActivity.class);
|
Intent in = new Intent(con, CertificatesActivity.class);
|
||||||
in.putExtra("index", 3);
|
in.putExtra("index", 3);
|
||||||
@@ -315,6 +315,10 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
* 展示大图片
|
* 展示大图片
|
||||||
*/
|
*/
|
||||||
private void showBigImg() {
|
private void showBigImg() {
|
||||||
|
if (TextUtils.isEmpty(cdb.getData().getRoadLicensePhoto())) {
|
||||||
|
choicePhoto();
|
||||||
|
return;
|
||||||
|
}
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 0:
|
case 0:
|
||||||
if (cdb.getData().getRoadLicensePhoto() != null && !cdb.getData().getCarImage().equals("")) {
|
if (cdb.getData().getRoadLicensePhoto() != null && !cdb.getData().getCarImage().equals("")) {
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import android.graphics.Outline;
|
|||||||
import android.location.Location;
|
import android.location.Location;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@@ -23,6 +22,7 @@ import android.widget.Toast;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.cardview.widget.CardView;
|
import androidx.cardview.widget.CardView;
|
||||||
|
import androidx.core.app.ActivityCompat;
|
||||||
|
|
||||||
import com.alct.mdp.MDPLocationCollectionManager;
|
import com.alct.mdp.MDPLocationCollectionManager;
|
||||||
import com.alct.mdp.callback.OnDownloadResultListener;
|
import com.alct.mdp.callback.OnDownloadResultListener;
|
||||||
@@ -36,6 +36,7 @@ import com.amap.api.maps.model.LatLng;
|
|||||||
import com.amap.api.maps.model.Marker;
|
import com.amap.api.maps.model.Marker;
|
||||||
import com.amap.api.maps.model.MarkerOptions;
|
import com.amap.api.maps.model.MarkerOptions;
|
||||||
import com.amap.api.maps.model.MyLocationStyle;
|
import com.amap.api.maps.model.MyLocationStyle;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.App;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.DriverExpireBean;
|
import com.arpa.hndahesudintocctmsdriver.bean.DriverExpireBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.ImageConfig;
|
import com.arpa.hndahesudintocctmsdriver.bean.ImageConfig;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.JTT;
|
import com.arpa.hndahesudintocctmsdriver.bean.JTT;
|
||||||
@@ -85,7 +86,13 @@ import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.util.time.Timer;
|
import com.arpa.hndahesudintocctmsdriver.util.time.Timer;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseFragment;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseFragment;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||||
|
import com.lxj.xpopup.util.XPermission;
|
||||||
import com.permissionx.guolindev.PermissionX;
|
import com.permissionx.guolindev.PermissionX;
|
||||||
|
import com.permissionx.guolindev.callback.RequestCallback;
|
||||||
|
import com.permissionx.guolindev.dialog.RationaleDialog;
|
||||||
|
import com.permissionx.guolindev.request.ChainTask;
|
||||||
|
import com.permissionx.guolindev.request.ExplainScope;
|
||||||
|
import com.permissionx.guolindev.request.ForwardScope;
|
||||||
import com.youth.banner.Banner;
|
import com.youth.banner.Banner;
|
||||||
import com.youth.banner.BannerConfig;
|
import com.youth.banner.BannerConfig;
|
||||||
import com.youth.banner.Transformer;
|
import com.youth.banner.Transformer;
|
||||||
@@ -97,6 +104,9 @@ import org.greenrobot.eventbus.Subscribe;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import pub.devrel.easypermissions.EasyPermissions;
|
||||||
|
import pub.devrel.easypermissions.helper.PermissionHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author hlh
|
* @author hlh
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
@@ -545,7 +555,6 @@ public class HomeFragment extends BaseFragment {
|
|||||||
ur.getImage(1);
|
ur.getImage(1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (UiAuxiliary.isLogin(con)) {
|
if (UiAuxiliary.isLogin(con)) {
|
||||||
ur.User();
|
ur.User();
|
||||||
ur.getDriverExpire();
|
ur.getDriverExpire();
|
||||||
|
|||||||
+6
-9
@@ -31,7 +31,6 @@ import com.amap.api.maps.model.LatLngBounds;
|
|||||||
import com.amap.api.maps.model.MarkerOptions;
|
import com.amap.api.maps.model.MarkerOptions;
|
||||||
import com.amap.api.maps.model.PolylineOptions;
|
import com.amap.api.maps.model.PolylineOptions;
|
||||||
|
|
||||||
import com.amap.api.services.core.AMapException;
|
|
||||||
import com.amap.api.services.core.LatLonPoint;
|
import com.amap.api.services.core.LatLonPoint;
|
||||||
import com.amap.api.services.route.BusRouteResult;
|
import com.amap.api.services.route.BusRouteResult;
|
||||||
import com.amap.api.services.route.DrivePath;
|
import com.amap.api.services.route.DrivePath;
|
||||||
@@ -40,7 +39,7 @@ import com.amap.api.services.route.DriveStep;
|
|||||||
import com.amap.api.services.route.RideRouteResult;
|
import com.amap.api.services.route.RideRouteResult;
|
||||||
import com.amap.api.services.route.RouteSearch;
|
import com.amap.api.services.route.RouteSearch;
|
||||||
import com.amap.api.services.route.WalkRouteResult;
|
import com.amap.api.services.route.WalkRouteResult;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.dahe.mylibrary.utils.TimeUtil;
|
import com.dahe.mylibrary.utils.TimeUtil;
|
||||||
import com.dahe.mylibrary.utils.ToastUtils;
|
import com.dahe.mylibrary.utils.ToastUtils;
|
||||||
@@ -55,7 +54,6 @@ import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.ui.UiAuxiliary;
|
import com.arpa.hndahesudintocctmsdriver.ui.UiAuxiliary;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.GetShangChuanActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.GetShangChuanActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.OrderComplaintActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.OrderComplaintActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.WebPDFActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.WebPDFActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.location.LocationGDUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.location.LocationGDUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||||
@@ -71,7 +69,6 @@ import com.arpa.hndahesudintocctmsdriver.util.view.ScoreView;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class StartYunDanActivity extends BaseActivity {
|
public class StartYunDanActivity extends BaseActivity {
|
||||||
@@ -387,22 +384,22 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
for (int i = 0; i < sob.getData().getWayChildren().size(); i++) {
|
for (int i = 0; i < sob.getData().getWayChildren().size(); i++) {
|
||||||
if (sob.getData().getWayChildren().get(i).getType() == 1) {
|
if (sob.getData().getWayChildren().get(i).getType() == 1) {
|
||||||
zInfo = sob.getData().getWayChildren().get(i);
|
zInfo = sob.getData().getWayChildren().get(i);
|
||||||
int dis = TimeUtil.compareNowDate(TimeUtil.string2Millis(zInfo.getImageTakenDate(), TimeUtil.DEFAULT_FORMAT4));
|
|
||||||
if (dis > 5) {
|
|
||||||
if (zInfo.getReceiptUrl() != null && zInfo.getReceiptUrl().size() > 0) {
|
if (zInfo.getReceiptUrl() != null && zInfo.getReceiptUrl().size() > 0) {
|
||||||
|
int dis = TimeUtil.compareNowDate(TimeUtil.string2Millis(zInfo.getImageTakenDate(), TimeUtil.DEFAULT_FORMAT4));
|
||||||
|
if (dis > 5) {//大于五分钟可以接单
|
||||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||||
in.putExtra("type", type);
|
in.putExtra("type", type);
|
||||||
in.putExtra("wid", wid);
|
in.putExtra("wid", wid);
|
||||||
in.putExtra("sob", gson.toJson(sob));
|
in.putExtra("sob", gson.toJson(sob));
|
||||||
in.putExtra("keys", key);
|
in.putExtra("keys", key);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
|
} else {
|
||||||
|
ToastUtils.showToast(StartYunDanActivity.this, "请到卸货地再进行卸货操作!");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
ToastUtils.showToast(StartYunDanActivity.this, "请先上传出货单,再进行卸货操作!");
|
ToastUtils.showToast(StartYunDanActivity.this, "请先上传出货单,再进行卸货操作!");
|
||||||
}
|
}
|
||||||
} else {//大于五分钟可以接单
|
|
||||||
ToastUtils.showToast(StartYunDanActivity.this, "装卸货时间间隔过短,请稍后重试!");
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+894
@@ -0,0 +1,894 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Message;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.Gravity;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
import android.widget.SimpleAdapter;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
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.CameraUpdateFactory;
|
||||||
|
import com.amap.api.services.core.AMapException;
|
||||||
|
import com.amap.api.services.core.LatLonPoint;
|
||||||
|
import com.amap.api.services.geocoder.GeocodeAddress;
|
||||||
|
import com.amap.api.services.geocoder.GeocodeQuery;
|
||||||
|
import com.amap.api.services.geocoder.GeocodeResult;
|
||||||
|
import com.amap.api.services.geocoder.GeocodeSearch;
|
||||||
|
import com.amap.api.services.geocoder.RegeocodeResult;
|
||||||
|
import com.amap.api.services.help.Inputtips;
|
||||||
|
import com.amap.api.services.help.InputtipsQuery;
|
||||||
|
import com.amap.api.services.help.Tip;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.StartOrderBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.UploadBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.OCRRequest;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.UploadReceiptInputBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.BitmapUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.file.FileUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.file.ImageFileCompressUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.img.GetCarImageAlert;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.location.LocationGDUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.location.LocationUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.time.Timer;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||||
|
import com.baidu.mapapi.model.LatLng;
|
||||||
|
import com.baidu.mapapi.utils.CoordinateConverter;
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.dahe.mylibrary.utils.ToastUtils;
|
||||||
|
import com.github.gzuliyujiang.wheelpicker.DatePicker;
|
||||||
|
import com.github.gzuliyujiang.wheelpicker.DatimePicker;
|
||||||
|
import com.github.gzuliyujiang.wheelpicker.annotation.DateMode;
|
||||||
|
import com.github.gzuliyujiang.wheelpicker.annotation.TimeMode;
|
||||||
|
import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener;
|
||||||
|
import com.github.gzuliyujiang.wheelpicker.contract.OnDatimePickedListener;
|
||||||
|
import com.github.gzuliyujiang.wheelpicker.entity.DateEntity;
|
||||||
|
import com.github.gzuliyujiang.wheelpicker.entity.DatimeEntity;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.luck.picture.lib.PictureSelector;
|
||||||
|
import com.luck.picture.lib.config.PictureConfig;
|
||||||
|
import com.luck.picture.lib.entity.LocalMedia;
|
||||||
|
import com.lxj.xpopup.XPopup;
|
||||||
|
import com.lxj.xpopup.interfaces.OnSelectListener;
|
||||||
|
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements Inputtips.InputtipsListener {
|
||||||
|
|
||||||
|
private TextView submit, name_top, name_body, address, tips, tips_x,tvDate,tvLocation;
|
||||||
|
private RelativeLayout getImg;
|
||||||
|
private EditText etAddress;
|
||||||
|
private Button btnOk;
|
||||||
|
private ImageView res_img, img_icon, img_delete;
|
||||||
|
private String[] names = {"装货", "卸货", "回单"};
|
||||||
|
public static String[] TYPE_NAME = {"zhuanghuo", "xiehuo", "huidan"};
|
||||||
|
private int index = 0;
|
||||||
|
//
|
||||||
|
private Gson gson = new Gson();
|
||||||
|
//
|
||||||
|
private LUInputBean lub = new LUInputBean();
|
||||||
|
private UploadReceiptInputBean urib = new UploadReceiptInputBean();
|
||||||
|
private LocationGDUtil lgdu;
|
||||||
|
public LocationUtil lu;
|
||||||
|
private List<Integer> imgIds = new ArrayList<>();
|
||||||
|
private UploadBean ub;
|
||||||
|
private HuoYuanRequset hyr;
|
||||||
|
//
|
||||||
|
private GetCarImageAlert gia = new GetCarImageAlert();
|
||||||
|
private CustomDialog customDialog;
|
||||||
|
private int id = 0;
|
||||||
|
private boolean key = true;
|
||||||
|
private boolean keys = false;
|
||||||
|
private boolean locationKey = false;
|
||||||
|
private TextView tv_loaction;
|
||||||
|
|
||||||
|
|
||||||
|
private String selDate;
|
||||||
|
private GeocodeSearch geocoderSearch;
|
||||||
|
|
||||||
|
private TempLoca tempLoca = new TempLoca();
|
||||||
|
private TempLoca tempLocaBd = new TempLoca();
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onGetInputtips(List<Tip> tipList, int rCode) {
|
||||||
|
if (rCode == AMapException.CODE_AMAP_SUCCESS) {
|
||||||
|
List<String> names = new ArrayList<String>();
|
||||||
|
if(tipList != null) {
|
||||||
|
int size = tipList.size();
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
Tip tip = tipList.get(i);
|
||||||
|
if(tip != null) {
|
||||||
|
names.add(tip.getDistrict()+tip.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
new XPopup.Builder(this)
|
||||||
|
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||||
|
.hasShadowBg(false) // 去掉半透明背景
|
||||||
|
.atView(etAddress)
|
||||||
|
.asAttachList(names.toArray(new String[0]), new int[]{}, new OnSelectListener() {
|
||||||
|
@Override
|
||||||
|
public void onSelect(int position, String text) {
|
||||||
|
Tip tip = tipList.get(position);
|
||||||
|
etAddress.setText(tip.getDistrict()+tip.getAddress()+tip.getName());
|
||||||
|
LatLonPoint latLonPoint = tip.getPoint();
|
||||||
|
tempLoca.setAddress(etAddress.getText().toString());
|
||||||
|
tempLoca.setLatitude(latLonPoint.getLatitude());
|
||||||
|
tempLoca.setLongitude(latLonPoint.getLongitude());
|
||||||
|
tempLoca.setTime(tvDate.getText().toString());
|
||||||
|
|
||||||
|
LatLng latLng = convertGPSToBaidu(new LatLng(latLonPoint.getLatitude(), latLonPoint.getLongitude()));
|
||||||
|
tempLocaBd.setLongitude(latLng.longitude);
|
||||||
|
tempLocaBd.setLatitude(latLng.latitude);
|
||||||
|
tempLocaBd.setAddress(etAddress.getText().toString());
|
||||||
|
tempLocaBd.setTime(tvDate.getText().toString());
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.show();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// SimpleAdapter aAdapter = new SimpleAdapter(getApplicationContext(), listString, R.layout.item_layout,
|
||||||
|
// new String[]{"name", "address"}, new int[]{R.id.poi_field_id, R.id.poi_value_id});
|
||||||
|
//
|
||||||
|
// minputlist.setAdapter(aAdapter);
|
||||||
|
// aAdapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class TempLoca{
|
||||||
|
private double latitude;
|
||||||
|
private double longitude;
|
||||||
|
private String address;
|
||||||
|
private String time;
|
||||||
|
|
||||||
|
public TempLoca() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public TempLoca(double latitude, double longitude, String address, String time) {
|
||||||
|
this.latitude = latitude;
|
||||||
|
this.longitude = longitude;
|
||||||
|
this.address = address;
|
||||||
|
this.time = time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getLatitude() {
|
||||||
|
return latitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLatitude(double latitude) {
|
||||||
|
this.latitude = latitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getLongitude() {
|
||||||
|
return longitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLongitude(double longitude) {
|
||||||
|
this.longitude = longitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddress() {
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddress(String address) {
|
||||||
|
this.address = address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTime() {
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTime(String time) {
|
||||||
|
this.time = time;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void msgMethod(Message m) {
|
||||||
|
super.msgMethod(m);
|
||||||
|
switch (m.what) {
|
||||||
|
case RequsetCodeConstants.SUCCESS:
|
||||||
|
if (CacheGroup.cacheList.get("upload") != null) {
|
||||||
|
Log.e("upload", CacheGroup.cacheList.get("upload"));
|
||||||
|
ub = gson.fromJson(CacheGroup.cacheList.remove("upload"), UploadBean.class);
|
||||||
|
if (ub.getCode() == 200) {
|
||||||
|
imgIds.add(ub.getData().getId());
|
||||||
|
Glide.with(con).load(ub.getData().getUrl()).into(res_img);
|
||||||
|
res_img.setVisibility(View.VISIBLE);
|
||||||
|
img_delete.setVisibility(View.VISIBLE);
|
||||||
|
img_icon.setVisibility(View.GONE);
|
||||||
|
key = false;
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove("upload");
|
||||||
|
}
|
||||||
|
for (int i = 0; i < TYPE_NAME.length; i++) {
|
||||||
|
if (CacheGroup.cacheList.get(TYPE_NAME[i]) != null) {
|
||||||
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]), BaseBean.class);
|
||||||
|
if (bb.getCode() == 200) {
|
||||||
|
if (index == 2) {
|
||||||
|
if (!keys){//装货回单
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove(TYPE_NAME[i]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CacheGroup.cacheList.get("carName") != null) {
|
||||||
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("carName"), BaseBean.class);
|
||||||
|
if (bb.getCode() == 200) {
|
||||||
|
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove("carName");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CacheGroup.cacheList.get("carNum") != null) {
|
||||||
|
Log.e("upload", CacheGroup.cacheList.get("carNum"));
|
||||||
|
CarInfoBean ub = gson.fromJson(CacheGroup.cacheList.remove("carNum"), CarInfoBean.class);
|
||||||
|
if (ub.getCode() == 200 && ub.getData().getData().getPrism_keyValueInfo().size() > 0) {
|
||||||
|
String value = ub.getData().getData().getPrism_keyValueInfo().get(0).getValue();
|
||||||
|
String forceMatching = ub.getData().getForceMatching();
|
||||||
|
if ("1".equals(forceMatching)) {//是否强校验车牌号 1:强校验
|
||||||
|
if (sob.getData().getCarNumber().equals(value)) {
|
||||||
|
hyr.uploadFile(new File(path));
|
||||||
|
} else {
|
||||||
|
new MessageUtils().showCenMessage(ShangChuangImgActivityBC.this, "车牌号不匹配!", "请重新拍照或联系管理员");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
hyr.uploadFile(new File(path));
|
||||||
|
}
|
||||||
|
} else {//识别失败后返回code500
|
||||||
|
if (index == 0) {//装卸货车辆需要识别车牌号){
|
||||||
|
Toast.makeText(con, "装货照片包含车牌号、三分之二车身或者装卸货场景。", Toast.LENGTH_SHORT).show();
|
||||||
|
} else if (index == 1) {
|
||||||
|
Toast.makeText(con, "卸货照片包含车牌号、三分之二车身或者装卸货场景。", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove("carNum");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 14://定位成功
|
||||||
|
locationKey = true;
|
||||||
|
customDialog.dismiss();
|
||||||
|
tv_loaction.setText("定位成功");
|
||||||
|
tv_loaction.setTextColor(getResources().getColor(R.color.theme_color, null));
|
||||||
|
latLng = convertGPSToBaidu(new LatLng(lgdu.getLatitude(), lgdu.getLongitude()));
|
||||||
|
initLocation();
|
||||||
|
break;
|
||||||
|
case 16://定位失败
|
||||||
|
locationKey = false;
|
||||||
|
customDialog.dismiss();
|
||||||
|
tv_loaction.setText("定位失败,点击重试");
|
||||||
|
tv_loaction.setTextColor(getResources().getColor(R.color.loaction_no_color, null));
|
||||||
|
Toast.makeText(con, "定位失败,请确认开启定位后重试!", Toast.LENGTH_LONG).show();
|
||||||
|
//定位结果接收
|
||||||
|
//finish();
|
||||||
|
break;
|
||||||
|
case 15:
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ImageFileCompressUtil.COMPRESS_SUCCESS:
|
||||||
|
path = (String) m.obj;
|
||||||
|
Log.e("res:", "选定图片结果");
|
||||||
|
Log.e("res:", path);
|
||||||
|
//选定图片结果
|
||||||
|
// if(index==1 || index==2){
|
||||||
|
// new OCRRequest().OCRPlateLicense(con,hd,new File(path));
|
||||||
|
// }
|
||||||
|
if (index == 0 || index == 1) {//装卸货车辆需要识别车牌号
|
||||||
|
new OCRRequest().OCRCarPlateLicense(con, hd, new File(path));
|
||||||
|
} else {
|
||||||
|
hyr.uploadFile(new File(path));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private LatLng latLng;
|
||||||
|
|
||||||
|
public LatLng convertGPSToBaidu(LatLng srLatLng) {
|
||||||
|
CoordinateConverter converter = new CoordinateConverter();
|
||||||
|
converter.from(CoordinateConverter.CoordType.COMMON);
|
||||||
|
converter.coord(srLatLng);
|
||||||
|
return converter.convert();
|
||||||
|
}
|
||||||
|
|
||||||
|
private String wid;
|
||||||
|
private int h_type;
|
||||||
|
String sobStr = "";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
StateStyleUtil.stateTextColor(this);
|
||||||
|
setContentView(R.layout.activity_shangchuan_bc);
|
||||||
|
con = this;
|
||||||
|
submit = findViewById(R.id.submit);
|
||||||
|
name_top = findViewById(R.id.name_top);
|
||||||
|
name_body = findViewById(R.id.name_body);
|
||||||
|
address = findViewById(R.id.address);
|
||||||
|
getImg = findViewById(R.id.getImg);
|
||||||
|
res_img = findViewById(R.id.res_img);
|
||||||
|
img_icon = findViewById(R.id.img_icon);
|
||||||
|
img_delete = findViewById(R.id.img_delete);
|
||||||
|
tv_loaction = findViewById(R.id.tv_loaction);
|
||||||
|
btnOk = findViewById(R.id.btnOk);
|
||||||
|
etAddress = findViewById(R.id.etAddress);
|
||||||
|
tvDate = findViewById(R.id.tvDate);
|
||||||
|
tvLocation = findViewById(R.id.tvLocation);
|
||||||
|
tips = findViewById(R.id.tips);
|
||||||
|
tips_x = findViewById(R.id.tips_x);
|
||||||
|
Bundle ins = getIntent().getExtras();
|
||||||
|
index = ins.getInt("type");
|
||||||
|
wid = ins.getString("wid");
|
||||||
|
h_type = ins.getInt("h_type");
|
||||||
|
keys = ins.getBoolean("keys");
|
||||||
|
sobStr = getIntent().getExtras().getString("sob");
|
||||||
|
//Log.e("---sdwStr--",sdwStr);
|
||||||
|
sob = new Gson().fromJson(sobStr, StartOrderBean.class);
|
||||||
|
initView(null);
|
||||||
|
customDialog = new CustomDialog(con, "正在定位当前位置...");
|
||||||
|
customDialog.show();
|
||||||
|
lgdu = new LocationGDUtil(con, hd);
|
||||||
|
//启动定位
|
||||||
|
lgdu.onCreate();
|
||||||
|
tv_loaction.setOnClickListener(v -> {
|
||||||
|
if (!locationKey) {
|
||||||
|
customDialog.show();
|
||||||
|
lgdu.onCreate();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
btnOk.setOnClickListener(v -> {
|
||||||
|
String s = etAddress.getText().toString();
|
||||||
|
if (TextUtils.isEmpty(selDate)){
|
||||||
|
ToastUtils.showToast(this,"请先选择时间");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!TextUtils.isEmpty(s)&&s.length()>=4){
|
||||||
|
|
||||||
|
InputtipsQuery inputquery = new InputtipsQuery(s, "");
|
||||||
|
// inputquery.setCityLimit(true);
|
||||||
|
Inputtips inputTips = new Inputtips(this, inputquery);
|
||||||
|
inputTips.setInputtipsListener(this);
|
||||||
|
inputTips.requestInputtipsAsyn();
|
||||||
|
|
||||||
|
|
||||||
|
// GeocodeQuery query = new GeocodeQuery(s, "100000");// 第一个参数表示地址,第二个参数表示查询城市,中文或者中文全拼,citycode、adcode,
|
||||||
|
// geocoderSearch.getFromLocationNameAsyn(query);// 设置同步地理编码请求
|
||||||
|
}else{
|
||||||
|
ToastUtils.showToast(this,"请输入地址且长度大于4");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
tvDate.setOnClickListener(v -> {
|
||||||
|
|
||||||
|
DatimePicker datimePicker = new DatimePicker(this);
|
||||||
|
datimePicker.setBodyWidth(300);
|
||||||
|
datimePicker.getWheelLayout().setRange(DatimeEntity.yearOnFuture(-1),DatimeEntity.yearOnFuture(10),DatimeEntity.now());
|
||||||
|
datimePicker.setOnDatimePickedListener((year, month, day, hour, minute, second) -> {
|
||||||
|
selDate = year+"-"+month+"-"+day+" "+ hour+":"+minute;
|
||||||
|
tvDate.setText(selDate);
|
||||||
|
});
|
||||||
|
datimePicker.getWheelLayout().setDateLabel("年", "月", "日");
|
||||||
|
datimePicker.getWheelLayout().setTimeLabel("时","分","");
|
||||||
|
datimePicker.getWheelLayout().setTimeMode(TimeMode.HOUR_24_NO_SECOND);
|
||||||
|
datimePicker.show();
|
||||||
|
});
|
||||||
|
|
||||||
|
hyr = new HuoYuanRequset(con, hd);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initData() {
|
||||||
|
//nfc初始化设置
|
||||||
|
NfcUtils nfcUtils = new NfcUtils(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initView(Object obj) {
|
||||||
|
super.initView(obj);
|
||||||
|
name_top.setText("上传" + names[index] + "照片");
|
||||||
|
name_body.setText(names[index] + "照片");
|
||||||
|
if (index == 1) {
|
||||||
|
tips.setVisibility(View.VISIBLE);
|
||||||
|
tips_x.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
submit.setOnClickListener(v -> {
|
||||||
|
if (imgIds.size() != 0) {
|
||||||
|
typeRequest();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "请先上传一张图片", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
getImg.setOnClickListener(v -> {
|
||||||
|
if (key) {
|
||||||
|
Log.e("--imgIds.size()--", imgIds.size() + "");
|
||||||
|
gia.showPopueWindow(this, true);
|
||||||
|
} else {
|
||||||
|
new XPopup.Builder(con)
|
||||||
|
.asImageViewer(res_img, ub.getData().getUrl(), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||||
|
.show();
|
||||||
|
// new XPopup.Builder(con)
|
||||||
|
// .asImageViewer(res_img, ub.getData().getUrl(), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||||
|
// .show();
|
||||||
|
Toast.makeText(con, "查看了照片", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
img_delete.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
imgIds = new ArrayList<>();
|
||||||
|
ub = new UploadBean();
|
||||||
|
res_img.setVisibility(View.GONE);
|
||||||
|
img_delete.setVisibility(View.GONE);
|
||||||
|
img_icon.setVisibility(View.VISIBLE);
|
||||||
|
key = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
String path;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
if (requestCode == 12 && resultCode == RESULT_OK) {
|
||||||
|
if (null == gia.getFile()) {
|
||||||
|
new ToastUtil(con, Gravity.CENTER, "图片选择失败").show(Toast.LENGTH_SHORT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
path = gia.getFile().getPath();
|
||||||
|
Log.e("图片地址:", path);
|
||||||
|
gia.dis();
|
||||||
|
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||||
|
} else if (requestCode == PictureConfig.CHOOSE_REQUEST && resultCode == RESULT_OK) {
|
||||||
|
List<LocalMedia> imgs = PictureSelector.obtainMultipleResult(data);
|
||||||
|
if (imgs != null && imgs.size() > 0) {
|
||||||
|
LocalMedia image = imgs.get(0);
|
||||||
|
|
||||||
|
String paths = image.getAndroidQToPath();
|
||||||
|
if (TextUtils.isEmpty(paths)) {
|
||||||
|
paths = image.getPath();
|
||||||
|
}
|
||||||
|
path = paths;
|
||||||
|
Log.e("图片地址:", path);
|
||||||
|
gia.dis();
|
||||||
|
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initLocation() {
|
||||||
|
address.setText(lgdu.getAddress());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void typeRequest() {
|
||||||
|
// for(int i=0;i<imgIds.size();i++){
|
||||||
|
// Log.e("--imgIds--",imgIds.get(i)+"");
|
||||||
|
// }
|
||||||
|
if(TextUtils.isEmpty(tempLoca.getTime())||TextUtils.isEmpty(tempLoca.getAddress())){
|
||||||
|
ToastUtils.showToast(this,"请选择时间以及地点");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (index) {
|
||||||
|
case 0:
|
||||||
|
//装货
|
||||||
|
if (imgIds != null && imgIds.size() > 0) {
|
||||||
|
lub.setLatitude(tempLoca.getLatitude() + "");
|
||||||
|
lub.setLongitude(tempLoca.getLongitude() + "");
|
||||||
|
lub.setLocationAddress(tempLoca.getAddress());
|
||||||
|
lub.setImageId(imgIds);
|
||||||
|
lub.setWaybillId(wid);
|
||||||
|
Log.e("--装货信息", gson.toJson(lub));
|
||||||
|
if (locationKey) {//高德定位
|
||||||
|
if (keys) {
|
||||||
|
nfc();
|
||||||
|
loadInfo();
|
||||||
|
// up_traffic_start();
|
||||||
|
// up_image_z();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if (imgIds != null && imgIds.size() > 0) {
|
||||||
|
//卸货
|
||||||
|
lub.setLatitude(tempLoca.getLatitude() + "");
|
||||||
|
lub.setLongitude(tempLoca.getLongitude() + "");
|
||||||
|
lub.setLocationAddress(tempLoca.getAddress());
|
||||||
|
lub.setImageId(imgIds);
|
||||||
|
lub.setWaybillId(wid);
|
||||||
|
lub.setRealLoadTime(tempLoca.getTime());
|
||||||
|
Log.e("--卸货信息", gson.toJson(lub));
|
||||||
|
if (locationKey&&!TextUtils.isEmpty(tempLoca.address)) {
|
||||||
|
if (keys) {
|
||||||
|
nfc();
|
||||||
|
uploadInfo();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
if (imgIds != null && imgIds.size() > 0) {//卸货回单
|
||||||
|
//上传回单
|
||||||
|
urib.setLatitude(tempLoca.getLatitude() + "");
|
||||||
|
urib.setLongitude(tempLoca.getLongitude() + "");
|
||||||
|
urib.setLocationAddress(tempLoca.getAddress());
|
||||||
|
//装卸货类型
|
||||||
|
urib.setType(h_type + 1);
|
||||||
|
//回单id 数组
|
||||||
|
urib.setReceiptId(imgIds);
|
||||||
|
//子运运单ID
|
||||||
|
urib.setWaybillId(wid);
|
||||||
|
Log.e("--回单信息", gson.toJson(urib));
|
||||||
|
if (locationKey) {
|
||||||
|
if (index == 2 && keys && !TextUtils.isEmpty(tempLoca.address)) {
|
||||||
|
up_trafficSign();
|
||||||
|
up_trafficReceipt();
|
||||||
|
receipt_image();
|
||||||
|
}
|
||||||
|
hyr.receipt(urib);
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private StartOrderBean sob;
|
||||||
|
|
||||||
|
public void nfc() {
|
||||||
|
// if(sob.getData().getNfcId().equals(nfcStr)){
|
||||||
|
// Toast.makeText(con,"nfcId匹配失败",Toast.LENGTH_LONG).show();
|
||||||
|
// }
|
||||||
|
if ("".equals(sob.getData().getNfcId()) || sob.getData().getNfcId() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MDPLocationCollectionManager.checkNfc(con, sob.getData().getShippingNoteNumber(),
|
||||||
|
sob.getData().getNfcId(), new OnResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Toast.makeText(con, "nfcId匹配成功", Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("不匹配", "" + s + s1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//上传安联-签收
|
||||||
|
public void up_trafficSign() {
|
||||||
|
//安联
|
||||||
|
Location l = new Location();
|
||||||
|
l.setBaiduLongitude(tempLocaBd.longitude);
|
||||||
|
l.setBaiduLatitude(tempLocaBd.latitude);
|
||||||
|
l.setLocation(tempLocaBd.getAddress());
|
||||||
|
l.setTime(tempLocaBd.getTime());
|
||||||
|
List<Goods> gs = new ArrayList<>();
|
||||||
|
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||||
|
if (wid.equals(wayChild.getId() + "")) {
|
||||||
|
for (StartOrderBean.DataDTO.WayChildrenDTO.GoodsDTO good : wayChild.getGoods()) {
|
||||||
|
Goods g = new Goods();
|
||||||
|
g.setGoodsName(good.getGoodName());
|
||||||
|
g.setUnit(good.getGoodUnit());
|
||||||
|
g.setItemNo(good.getId());
|
||||||
|
//实收
|
||||||
|
g.setQuantity(1);
|
||||||
|
//应收
|
||||||
|
g.setReceivedQuantity(1);
|
||||||
|
//破损
|
||||||
|
g.setDamageQuantity(1);
|
||||||
|
//丢失
|
||||||
|
g.setQuantity(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MDPLocationCollectionManager.sign(con, sob.getData().getShippingNoteNumber(), l, gs, new OnResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "签收成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(签收):", s + s1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//上传安联-回单
|
||||||
|
public void up_trafficReceipt() {
|
||||||
|
//安联
|
||||||
|
Location l = new Location();
|
||||||
|
l.setBaiduLongitude(tempLocaBd.longitude);
|
||||||
|
l.setBaiduLatitude(tempLocaBd.latitude);
|
||||||
|
l.setLocation(tempLocaBd.getAddress());
|
||||||
|
l.setTime(tempLocaBd.getTime());
|
||||||
|
MDPLocationCollectionManager.pod(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "回单上传成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(回单):", s + s1);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void up_image_z() {
|
||||||
|
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||||
|
File file = new File(path);
|
||||||
|
Image image = new Image();
|
||||||
|
String base = BitmapUtil.imageToBase64(path);
|
||||||
|
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||||
|
image.setFileExt(FileUtil.lastName(file));
|
||||||
|
image.setFileName(FileUtil.fileName(file));
|
||||||
|
image.setImageTakenDate(Timer.getTimerT());
|
||||||
|
image.setBaiduLongitude(tempLocaBd.longitude);
|
||||||
|
image.setBaiduLatitude(tempLocaBd.latitude);
|
||||||
|
image.setLocation(tempLocaBd.getAddress());
|
||||||
|
MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "装货照片上传成功");
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void up_image() {
|
||||||
|
File file = new File(path);
|
||||||
|
Image image = new Image();
|
||||||
|
String base = BitmapUtil.imageToBase64(path);
|
||||||
|
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||||
|
image.setFileExt(FileUtil.lastName(file));
|
||||||
|
image.setFileName(FileUtil.fileName(file));
|
||||||
|
image.setImageTakenDate(tempLocaBd.getTime());
|
||||||
|
image.setBaiduLongitude(tempLocaBd.longitude);
|
||||||
|
image.setBaiduLatitude(tempLocaBd.latitude);
|
||||||
|
image.setLocation(tempLocaBd.getAddress());
|
||||||
|
MDPLocationCollectionManager.uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "卸货照片上传成功");
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void receipt_image() {
|
||||||
|
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||||
|
File file = new File(path);
|
||||||
|
Image image = new Image();
|
||||||
|
String base = BitmapUtil.imageToBase64(path);
|
||||||
|
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||||
|
image.setFileExt(FileUtil.lastName(file));
|
||||||
|
image.setFileName(FileUtil.fileName(file));
|
||||||
|
image.setImageTakenDate(tempLocaBd.getTime());
|
||||||
|
image.setBaiduLongitude(tempLocaBd.longitude);
|
||||||
|
image.setBaiduLatitude(tempLocaBd.latitude);
|
||||||
|
image.setLocation(tempLocaBd.getAddress());
|
||||||
|
MDPLocationCollectionManager.uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "回单照片上传成功");
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
//开启前台调度系统
|
||||||
|
//NfcUtils.mNfcAdapter.enableForegroundDispatch(this, NfcUtils.mPendingIntent, NfcUtils.mIntentFilter, NfcUtils.mTechList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
//关闭前台调度系统
|
||||||
|
//NfcUtils.mNfcAdapter.disableForegroundDispatch(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
String nfcStr = "";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onNewIntent(Intent intent) {
|
||||||
|
super.onNewIntent(intent);
|
||||||
|
//当该Activity接收到NFC标签时,运行该方法
|
||||||
|
//调用工具方法,读取NFC数据
|
||||||
|
try {
|
||||||
|
nfcStr = NfcUtils.readNFCId(intent);
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
Log.e("nfc", nfcStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传安联和交通厅,平台-装货
|
||||||
|
*/
|
||||||
|
private void loadInfo() {
|
||||||
|
//安联
|
||||||
|
if (sob.getData().getReportAlct() == 1) {
|
||||||
|
Location l = new Location();
|
||||||
|
l.setBaiduLongitude(tempLocaBd.longitude);
|
||||||
|
l.setBaiduLatitude(tempLocaBd.latitude);
|
||||||
|
l.setLocation(tempLocaBd.getAddress());
|
||||||
|
l.setTime(tempLocaBd.getTime());
|
||||||
|
MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "装货上传成功");
|
||||||
|
//交通厅
|
||||||
|
if (sob.getData().getReport() == 1) {
|
||||||
|
JTTProcess.start(con, sob, "");
|
||||||
|
}
|
||||||
|
//装货状态
|
||||||
|
hyr.loading(lub);
|
||||||
|
//装货照片
|
||||||
|
up_image_z();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(装货):", s + s1);
|
||||||
|
new MessageUtils().showCenMessage(con, s1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传安联和交通厅,平台-卸货
|
||||||
|
*/
|
||||||
|
private void uploadInfo() {
|
||||||
|
|
||||||
|
//安联
|
||||||
|
if (sob.getData().getReportAlct() == 1) {
|
||||||
|
Location l = new Location();
|
||||||
|
l.setBaiduLongitude(tempLocaBd.longitude);
|
||||||
|
l.setBaiduLatitude(tempLocaBd.latitude);
|
||||||
|
l.setLocation(tempLocaBd.getAddress());
|
||||||
|
l.setTime(tempLocaBd.getTime());
|
||||||
|
Log.e("-安联卸货信息-", gson.toJson(l));
|
||||||
|
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "卸货上传成功");
|
||||||
|
//交通厅
|
||||||
|
if (sob.getData().getReport() == 1) {
|
||||||
|
JTTProcess.stop(con, sob, "");
|
||||||
|
}
|
||||||
|
//卸货状态-平台
|
||||||
|
hyr.dischargeCargo4(lub);
|
||||||
|
//卸货照片-安联
|
||||||
|
up_image();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(卸货):", s + s1);
|
||||||
|
// new MessageUtils().showCenMessage(con, s1);
|
||||||
|
//运单状态不一致,平台更新状态
|
||||||
|
hyr.dischargeCargo4(lub);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -51,6 +51,9 @@ public class AdapterAlls extends RecyclerView.Adapter<AdapterAlls.ViewHolder> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void add(List<ManyBean> addMessageList) {
|
public void add(List<ManyBean> addMessageList) {
|
||||||
|
if (object==null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
//增加数据
|
//增加数据
|
||||||
int position = object.size();
|
int position = object.size();
|
||||||
object.addAll(position, addMessageList);
|
object.addAll(position, addMessageList);
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ public class GetCarImageAlert {
|
|||||||
//请按照如图所示拍摄回单照片,回单照片必须保持清晰完整,能看清具体吨数,便于结算运费时核查,感谢配合。
|
//请按照如图所示拍摄回单照片,回单照片必须保持清晰完整,能看清具体吨数,便于结算运费时核查,感谢配合。
|
||||||
}
|
}
|
||||||
btn_xiangce.setOnClickListener(v -> {
|
btn_xiangce.setOnClickListener(v -> {
|
||||||
|
try {
|
||||||
PermissionX.init(act)
|
PermissionX.init(act)
|
||||||
.permissions(Manifest.permission.READ_EXTERNAL_STORAGE)
|
.permissions(Manifest.permission.READ_EXTERNAL_STORAGE)
|
||||||
.request((allGranted, grantedList, deniedList) -> {
|
.request((allGranted, grantedList, deniedList) -> {
|
||||||
@@ -64,18 +65,41 @@ public class GetCarImageAlert {
|
|||||||
Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} catch (Exception e) {
|
||||||
|
Toast.makeText(act.getBaseContext(), "程序出现问题了,请重新登录后重试!!!", Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
btn_paizhao.setOnClickListener(v -> {
|
btn_paizhao.setOnClickListener(v -> {
|
||||||
|
try{
|
||||||
PermissionX.init(act)
|
PermissionX.init(act)
|
||||||
.permissions(Manifest.permission.CAMERA)
|
.permissions(Manifest.permission.CAMERA)
|
||||||
.request((allGranted, grantedList, deniedList) -> {
|
.request((allGranted, grantedList, deniedList) -> {
|
||||||
if (allGranted) {
|
if (allGranted) {
|
||||||
file=ImageGetUtil.createImageFile(act);
|
openCam(act);
|
||||||
ImageGetUtil.cameraAlbumGetImage(act,file);
|
// file=ImageGetUtil.createImageFile(act);
|
||||||
|
// ImageGetUtil.cameraAlbumGetImage(act,file);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}catch (Exception e){
|
||||||
|
Toast.makeText(act.getBaseContext(), "程序出现问题了,请重新登录后重试!!!", Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
img.setOnClickListener(v -> {
|
||||||
|
if (!key) {
|
||||||
|
PermissionX.init(act)
|
||||||
|
.permissions(Manifest.permission.CAMERA)
|
||||||
|
.request((allGranted, grantedList, deniedList) -> {
|
||||||
|
if (allGranted) {
|
||||||
|
openCam(act);
|
||||||
|
} else {
|
||||||
|
Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
btn_quxiao.setOnClickListener(v -> popupWindow.dismiss());
|
btn_quxiao.setOnClickListener(v -> popupWindow.dismiss());
|
||||||
//popupWindow消失屏幕变为不透明
|
//popupWindow消失屏幕变为不透明
|
||||||
@@ -99,4 +123,13 @@ public class GetCarImageAlert {
|
|||||||
popupWindow.dismiss();
|
popupWindow.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void openCam(AppCompatActivity act) {
|
||||||
|
file = ImageGetUtil.createImageFile(act);
|
||||||
|
if (file != null) {
|
||||||
|
ImageGetUtil.cameraAlbumGetImage(act, file);
|
||||||
|
} else {
|
||||||
|
Toast.makeText(act.getBaseContext(), "路径创建失败,请清除缓存后重试", Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import android.provider.MediaStore;
|
|||||||
|
|
||||||
import androidx.core.content.FileProvider;
|
import androidx.core.content.FileProvider;
|
||||||
|
|
||||||
|
import com.sdk.base.framework.utils.app.AppUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
@@ -39,7 +41,7 @@ public class ImageGetUtil {
|
|||||||
if(imageFile!=null){
|
if(imageFile!=null){
|
||||||
if(Build.VERSION.SDK_INT>= Build.VERSION_CODES.N){
|
if(Build.VERSION.SDK_INT>= Build.VERSION_CODES.N){
|
||||||
/*7.0以上要通过FileProvider将File转化为Uri*/
|
/*7.0以上要通过FileProvider将File转化为Uri*/
|
||||||
uri = FileProvider.getUriForFile(act.getApplicationContext(),"com.arpa.hndahesudintocctmsdriver.fileprovider",imageFile);
|
uri = FileProvider.getUriForFile(act.getApplicationContext(), AppUtils.getPackageName()+".fileprovider",imageFile);
|
||||||
}else {
|
}else {
|
||||||
/*7.0以下则直接使用Uri的fromFile方法将File转化为Uri*/
|
/*7.0以下则直接使用Uri的fromFile方法将File转化为Uri*/
|
||||||
uri = Uri.fromFile(imageFile);
|
uri = Uri.fromFile(imageFile);
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 432 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 426 KiB |
@@ -55,11 +55,11 @@
|
|||||||
android:layout_width="@dimen/dp_90"
|
android:layout_width="@dimen/dp_90"
|
||||||
android:layout_height="@dimen/dp_90"
|
android:layout_height="@dimen/dp_90"
|
||||||
android:background="#EEEEEE">
|
android:background="#EEEEEE">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="@dimen/dp_23"
|
android:layout_width="@dimen/dp_23"
|
||||||
android:layout_height="@dimen/dp_23"
|
android:layout_height="@dimen/dp_23"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerInParent="true"
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
android:scaleType="fitXY"
|
android:scaleType="fitXY"
|
||||||
android:src="@mipmap/up_img" />
|
android:src="@mipmap/up_img" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
@@ -118,6 +118,7 @@
|
|||||||
android:background="@drawable/bg_bai"
|
android:background="@drawable/bg_bai"
|
||||||
android:elevation="@dimen/dp_1">
|
android:elevation="@dimen/dp_1">
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
|
android:visibility="gone"
|
||||||
android:id="@+id/cow1"
|
android:id="@+id/cow1"
|
||||||
android:layout_marginBottom="@dimen/dp_10"
|
android:layout_marginBottom="@dimen/dp_10"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -130,28 +131,28 @@
|
|||||||
android:textColor="#ffc4c4ce"
|
android:textColor="#ffc4c4ce"
|
||||||
android:textSize="@dimen/sp_13"
|
android:textSize="@dimen/sp_13"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/value1"
|
android:id="@+id/value1"
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="#ff999999"
|
android:layout_alignParentRight="true"
|
||||||
android:textSize="@dimen/sp_13"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:hint="点击进行手动输入"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:layout_marginLeft="@dimen/dp_30"
|
android:layout_marginLeft="@dimen/dp_30"
|
||||||
android:gravity="right"
|
|
||||||
android:background="@null"
|
android:background="@null"
|
||||||
/>
|
android:ellipsize="end"
|
||||||
|
android:gravity="right"
|
||||||
|
android:hint="点击进行手动输入"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="#ff999999"
|
||||||
|
android:textSize="@dimen/sp_13" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
<View
|
<View
|
||||||
|
android:visibility="gone"
|
||||||
android:id="@+id/vs"
|
android:id="@+id/vs"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/dp_1"
|
android:layout_height="@dimen/dp_1"
|
||||||
android:background="@drawable/bottom_xu"/>
|
android:background="@drawable/bottom_xu"/>
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_marginTop="@dimen/dp_10"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
<TextView
|
<TextView
|
||||||
|
|||||||
@@ -0,0 +1,225 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/activity_shangchuan"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/bg_theme">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="@dimen/dp_300"
|
||||||
|
android:layout_height="@dimen/dp_207"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="@dimen/dp_16"
|
||||||
|
android:src="@mipmap/top_creativity" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_58">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/return_btn"
|
||||||
|
android:layout_width="@dimen/dp_40"
|
||||||
|
android:layout_height="@dimen/dp_31"
|
||||||
|
android:layout_marginLeft="@dimen/dp_30"
|
||||||
|
android:padding="@dimen/dp_10"
|
||||||
|
android:scaleType="fitXY"
|
||||||
|
android:src="@mipmap/return_lefts" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_loaction"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginRight="@dimen/dp_30"
|
||||||
|
android:padding="@dimen/dp_5"
|
||||||
|
android:text="定位成功"
|
||||||
|
android:textColor="@color/theme_color"
|
||||||
|
android:textSize="@dimen/sp_14" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp_38"
|
||||||
|
android:layout_marginTop="@dimen/dp_8"
|
||||||
|
android:text="补传"
|
||||||
|
android:textColor="#ff000000"
|
||||||
|
android:textSize="@dimen/sp_23" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvDate"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_50"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:hint="请选择时间"></TextView>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
>
|
||||||
|
<EditText
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:id="@+id/etAddress"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_50"
|
||||||
|
android:hint="请输入地址"></EditText>
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/red"
|
||||||
|
android:text="确定"
|
||||||
|
android:id="@+id/btnOk"
|
||||||
|
></Button>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvLocation"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
></TextView>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/name_top"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp_38"
|
||||||
|
android:layout_marginTop="@dimen/dp_8"
|
||||||
|
android:text="上传卸货照片"
|
||||||
|
android:textColor="#ff000000"
|
||||||
|
android:textSize="@dimen/sp_23" />
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/getImg1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp_38"
|
||||||
|
android:layout_marginTop="@dimen/dp_33"
|
||||||
|
android:layout_marginRight="@dimen/dp_38"
|
||||||
|
app:cardCornerRadius="@dimen/dp_8">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/getImg"
|
||||||
|
android:layout_width="@dimen/dp_90"
|
||||||
|
android:layout_height="@dimen/dp_90"
|
||||||
|
android:layout_marginLeft="@dimen/dp_11"
|
||||||
|
android:layout_marginTop="@dimen/dp_13"
|
||||||
|
android:layout_marginBottom="@dimen/dp_13"
|
||||||
|
android:background="#EEEEEE">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/res_img"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/img_icon"
|
||||||
|
android:layout_width="@dimen/dp_23"
|
||||||
|
android:layout_height="@dimen/dp_23"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:src="@mipmap/up_img" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/img_delete"
|
||||||
|
android:layout_width="@dimen/dp_25"
|
||||||
|
android:layout_height="@dimen/dp_25"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:padding="@dimen/dp_3"
|
||||||
|
android:src="@mipmap/icon_delete"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp_8"
|
||||||
|
android:layout_marginTop="@dimen/dp_13"
|
||||||
|
android:layout_marginRight="@dimen/dp_10"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/name_body"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_7"
|
||||||
|
android:text="卸货照片"
|
||||||
|
android:textColor="#ff000000"
|
||||||
|
android:textSize="@dimen/sp_13" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/address"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_13"
|
||||||
|
android:text=""
|
||||||
|
android:textColor="#ff999999"
|
||||||
|
android:textSize="@dimen/sp_13" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp_38"
|
||||||
|
android:layout_marginTop="@dimen/dp_10"
|
||||||
|
android:layout_marginRight="@dimen/dp_38">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tips_x"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="*"
|
||||||
|
android:textColor="#E61829"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tips"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="卸货照片包含车牌号、三分之二车身或者卸货场景"
|
||||||
|
android:textColor="#E61829"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_42"
|
||||||
|
android:layout_marginLeft="@dimen/dp_38"
|
||||||
|
android:layout_marginTop="@dimen/dp_33"
|
||||||
|
android:layout_marginRight="@dimen/dp_38"
|
||||||
|
app:cardBackgroundColor="@color/red"
|
||||||
|
app:cardCornerRadius="@dimen/dp_21">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/submit"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="提交"
|
||||||
|
android:textColor="#fff"
|
||||||
|
android:textSize="@dimen/sp_15" />
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
@@ -99,6 +99,8 @@
|
|||||||
android:textSize="@dimen/sp_17"
|
android:textSize="@dimen/sp_17"
|
||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:layout_marginBottom="@dimen/dp_3"/>
|
android:layout_marginBottom="@dimen/dp_3"/>
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_marginTop="@dimen/dp_8"
|
android:layout_marginTop="@dimen/dp_8"
|
||||||
@@ -122,6 +124,7 @@
|
|||||||
android:progressDrawable="@drawable/par_bg"
|
android:progressDrawable="@drawable/par_bg"
|
||||||
/>
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tvContent"
|
||||||
android:layout_marginTop="@dimen/dp_6"
|
android:layout_marginTop="@dimen/dp_6"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -131,6 +134,20 @@
|
|||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_marginLeft="@dimen/dp_18"
|
||||||
|
android:layout_marginRight="@dimen/dp_18"
|
||||||
|
android:id="@+id/tvOk"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="立即安装"
|
||||||
|
android:textColor="@color/theme_color"
|
||||||
|
android:textSize="@dimen/sp_17"
|
||||||
|
android:background="@null"
|
||||||
|
android:layout_marginBottom="@dimen/dp_13"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/force_box"
|
android:id="@+id/force_box"
|
||||||
|
|||||||
@@ -46,7 +46,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:visibility="gone">
|
android:visibility="gone"
|
||||||
|
>
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:id="@+id/btn_news"
|
android:id="@+id/btn_news"
|
||||||
|
|||||||
+55
-105
@@ -29,12 +29,9 @@ import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.img.GetCarImageAlert;
|
import com.arpa.hndahesudintocctmsdriver.util.img.GetCarImageAlert;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.location.LocationUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.location.LocationUtil;
|
||||||
import com.baidu.mapapi.CoordType;
|
|
||||||
import com.baidu.mapapi.SDKInitializer;
|
|
||||||
import com.baidu.mapapi.model.LatLng;
|
import com.baidu.mapapi.model.LatLng;
|
||||||
import com.baidu.mapapi.utils.CoordinateConverter;
|
import com.baidu.mapapi.utils.CoordinateConverter;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.dahe.mylibrary.utils.ToastUtils;
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.luck.picture.lib.PictureSelector;
|
import com.luck.picture.lib.PictureSelector;
|
||||||
import com.luck.picture.lib.config.PictureConfig;
|
import com.luck.picture.lib.config.PictureConfig;
|
||||||
@@ -47,7 +44,6 @@ import com.arpa.hndahesudintocctmsdriver.bean.UploadBean;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean;
|
import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.UploadReceiptInputBean;
|
import com.arpa.hndahesudintocctmsdriver.request.bean.UploadReceiptInputBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.location.LocationGDUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.location.LocationGDUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||||
@@ -115,17 +111,17 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
if (CacheGroup.cacheList.get(TYPE_NAME[i]) != null) {
|
if (CacheGroup.cacheList.get(TYPE_NAME[i]) != null) {
|
||||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]), BaseBean.class);
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]), BaseBean.class);
|
||||||
if (bb.getCode() == 200) {
|
if (bb.getCode() == 200) {
|
||||||
if (!keys) {
|
if (index == 2) {
|
||||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
if (!keys){//装货回单
|
||||||
finish();
|
|
||||||
} else {
|
|
||||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove(TYPE_NAME[i]);
|
CacheGroup.cacheList.remove(TYPE_NAME[i]);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CacheGroup.cacheList.get("carName") != null) {
|
if (CacheGroup.cacheList.get("carName") != null) {
|
||||||
@@ -164,14 +160,19 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
break;
|
break;
|
||||||
case 14://定位成功
|
case 14://定位成功
|
||||||
locationKey = true;
|
locationKey = true;
|
||||||
|
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
tv_loaction.setText("定位成功");
|
tv_loaction.setText("定位成功");
|
||||||
tv_loaction.setTextColor(getResources().getColor(R.color.theme_color, null));
|
tv_loaction.setTextColor(getResources().getColor(R.color.theme_color, null));
|
||||||
|
latLng = convertGPSToBaidu(new LatLng(lgdu.getLatitude(), lgdu.getLongitude()));
|
||||||
initLocation();
|
initLocation();
|
||||||
break;
|
break;
|
||||||
case 16://定位失败
|
case 16://定位失败
|
||||||
locationKey = false;
|
locationKey = false;
|
||||||
|
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
tv_loaction.setText("定位失败,点击重试");
|
tv_loaction.setText("定位失败,点击重试");
|
||||||
tv_loaction.setTextColor(getResources().getColor(R.color.loaction_no_color, null));
|
tv_loaction.setTextColor(getResources().getColor(R.color.loaction_no_color, null));
|
||||||
Toast.makeText(con, "定位失败,请确认开启定位后重试!", Toast.LENGTH_LONG).show();
|
Toast.makeText(con, "定位失败,请确认开启定位后重试!", Toast.LENGTH_LONG).show();
|
||||||
@@ -199,6 +200,14 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private LatLng latLng;
|
||||||
|
|
||||||
|
public LatLng convertGPSToBaidu(LatLng srLatLng) {
|
||||||
|
CoordinateConverter converter = new CoordinateConverter();
|
||||||
|
converter.from(CoordinateConverter.CoordType.COMMON);
|
||||||
|
converter.coord(srLatLng);
|
||||||
|
return converter.convert();
|
||||||
|
}
|
||||||
|
|
||||||
private String wid;
|
private String wid;
|
||||||
private int h_type;
|
private int h_type;
|
||||||
@@ -235,8 +244,8 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
lgdu = new LocationGDUtil(con, hd);
|
lgdu = new LocationGDUtil(con, hd);
|
||||||
//启动定位
|
//启动定位
|
||||||
lgdu.onCreate();
|
lgdu.onCreate();
|
||||||
lu = new LocationUtil(con, hd);
|
// lu = new LocationUtil(con, hd);
|
||||||
lu.onCreate();
|
// lu.onCreate();
|
||||||
// if (keys) {
|
// if (keys) {
|
||||||
// lu = new LocationUtil(con, hd);
|
// lu = new LocationUtil(con, hd);
|
||||||
// lu.onCreate();
|
// lu.onCreate();
|
||||||
@@ -245,8 +254,8 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
if (!locationKey) {
|
if (!locationKey) {
|
||||||
customDialog.show();
|
customDialog.show();
|
||||||
lgdu.onCreate();
|
lgdu.onCreate();
|
||||||
lu = new LocationUtil(con, hd);
|
// lu = new LocationUtil(con, hd);
|
||||||
lu.onCreate();
|
// lu.onCreate();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
hyr = new HuoYuanRequset(con, hd);
|
hyr = new HuoYuanRequset(con, hd);
|
||||||
@@ -356,10 +365,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
Log.e("--装货信息", gson.toJson(lub));
|
Log.e("--装货信息", gson.toJson(lub));
|
||||||
if (locationKey) {//高德定位
|
if (locationKey) {//高德定位
|
||||||
if (keys) {
|
if (keys) {
|
||||||
if (lu!=null&&lu.getErrorCode()!=161){
|
|
||||||
ToastUtils.showToast(this,"百度地图定位失败,请确认开启定位后重试!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
nfc();
|
nfc();
|
||||||
loadInfo();
|
loadInfo();
|
||||||
// up_traffic_start();
|
// up_traffic_start();
|
||||||
@@ -384,10 +389,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
Log.e("--卸货信息", gson.toJson(lub));
|
Log.e("--卸货信息", gson.toJson(lub));
|
||||||
if (locationKey) {
|
if (locationKey) {
|
||||||
if (keys) {
|
if (keys) {
|
||||||
if (lu!=null&&lu.getErrorCode()!=161){
|
|
||||||
ToastUtils.showToast(this,"百度地图定位失败,请确认开启定位后重试!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
nfc();
|
nfc();
|
||||||
uploadInfo();
|
uploadInfo();
|
||||||
|
|
||||||
@@ -416,10 +417,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
Log.e("--回单信息", gson.toJson(urib));
|
Log.e("--回单信息", gson.toJson(urib));
|
||||||
if (locationKey) {
|
if (locationKey) {
|
||||||
if (index == 2 && keys) {
|
if (index == 2 && keys) {
|
||||||
if (lu!=null&&lu.getErrorCode()!=161){
|
|
||||||
ToastUtils.showToast(this,"百度地图定位失败,请确认开启定位后重试!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
up_trafficSign();
|
up_trafficSign();
|
||||||
up_trafficReceipt();
|
up_trafficReceipt();
|
||||||
receipt_image();
|
receipt_image();
|
||||||
@@ -439,34 +436,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
|
|
||||||
private StartOrderBean sob;
|
private StartOrderBean sob;
|
||||||
|
|
||||||
//上传安联和交通厅-装货
|
|
||||||
public void up_traffic_start() {
|
|
||||||
//安联
|
|
||||||
if (sob.getData().getReportAlct() == 1) {
|
|
||||||
Location l = new Location();
|
|
||||||
l.setBaiduLongitude(lu.getLongitude());
|
|
||||||
l.setBaiduLatitude(lu.getLatitude());
|
|
||||||
l.setLocation(lu.getAddress());
|
|
||||||
l.setTime(Timer.getTimerT());
|
|
||||||
MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess() {
|
|
||||||
Log.e("上报安联", "装货上传成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(String s, String s1) {
|
|
||||||
Log.e("上报安联失败(装货):", s + s1);
|
|
||||||
new MessageUtils().showCenMessage(con, s1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
//交通厅
|
|
||||||
if (sob.getData().getReport() == 1) {
|
|
||||||
JTTProcess.start(con, sob, "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void nfc() {
|
public void nfc() {
|
||||||
// if(sob.getData().getNfcId().equals(nfcStr)){
|
// if(sob.getData().getNfcId().equals(nfcStr)){
|
||||||
// Toast.makeText(con,"nfcId匹配失败",Toast.LENGTH_LONG).show();
|
// Toast.makeText(con,"nfcId匹配失败",Toast.LENGTH_LONG).show();
|
||||||
@@ -488,41 +457,13 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//上传安联和交通厅-卸货
|
|
||||||
public void up_traffic_end() {
|
|
||||||
//安联
|
|
||||||
if (sob.getData().getReportAlct() == 1) {
|
|
||||||
Location l = new Location();
|
|
||||||
l.setBaiduLongitude(lu.getLongitude());
|
|
||||||
l.setBaiduLatitude(lu.getLatitude());
|
|
||||||
l.setLocation(lu.getAddress());
|
|
||||||
l.setTime(Timer.getTimerT());
|
|
||||||
Log.e("-安联卸货信息-", gson.toJson(l));
|
|
||||||
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess() {
|
|
||||||
Log.e("上报安联", "卸货上传成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(String s, String s1) {
|
|
||||||
Log.e("上报安联失败(卸货):", s + s1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
//交通厅
|
|
||||||
if (sob.getData().getReport() == 1) {
|
|
||||||
JTTProcess.stop(con, sob, "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//上传安联-签收
|
//上传安联-签收
|
||||||
public void up_trafficSign() {
|
public void up_trafficSign() {
|
||||||
//安联
|
//安联
|
||||||
Location l = new Location();
|
Location l = new Location();
|
||||||
l.setBaiduLongitude(lu.getLongitude());
|
l.setBaiduLongitude(latLng.longitude);
|
||||||
l.setBaiduLatitude(lu.getLatitude());
|
l.setBaiduLatitude(latLng.latitude);
|
||||||
l.setLocation(lu.getAddress());
|
l.setLocation(lgdu.getAddress());
|
||||||
l.setTime(Timer.getTimerT());
|
l.setTime(Timer.getTimerT());
|
||||||
List<Goods> gs = new ArrayList<>();
|
List<Goods> gs = new ArrayList<>();
|
||||||
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||||
@@ -560,9 +501,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
public void up_trafficReceipt() {
|
public void up_trafficReceipt() {
|
||||||
//安联
|
//安联
|
||||||
Location l = new Location();
|
Location l = new Location();
|
||||||
l.setBaiduLongitude(lu.getLongitude());
|
l.setBaiduLongitude(latLng.longitude);
|
||||||
l.setBaiduLatitude(lu.getLatitude());
|
l.setBaiduLatitude(latLng.latitude);
|
||||||
l.setLocation(lu.getAddress());
|
l.setLocation(lgdu.getAddress());
|
||||||
l.setTime(Timer.getTimerT());
|
l.setTime(Timer.getTimerT());
|
||||||
MDPLocationCollectionManager.pod(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
MDPLocationCollectionManager.pod(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||||
|
|
||||||
@@ -588,14 +529,16 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
image.setFileExt(FileUtil.lastName(file));
|
image.setFileExt(FileUtil.lastName(file));
|
||||||
image.setFileName(FileUtil.fileName(file));
|
image.setFileName(FileUtil.fileName(file));
|
||||||
image.setImageTakenDate(Timer.getTimerT());
|
image.setImageTakenDate(Timer.getTimerT());
|
||||||
image.setBaiduLongitude(lu.getLongitude());
|
image.setBaiduLongitude(latLng.longitude);
|
||||||
image.setBaiduLatitude(lu.getLatitude());
|
image.setBaiduLatitude(latLng.latitude);
|
||||||
image.setLocation(lu.getAddress());
|
image.setLocation(lgdu.getAddress());
|
||||||
MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
Log.e("上报安联", "装货照片上传成功");
|
Log.e("上报安联", "装货照片上传成功");
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -618,14 +561,16 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
image.setFileExt(FileUtil.lastName(file));
|
image.setFileExt(FileUtil.lastName(file));
|
||||||
image.setFileName(FileUtil.fileName(file));
|
image.setFileName(FileUtil.fileName(file));
|
||||||
image.setImageTakenDate(Timer.getTimerT());
|
image.setImageTakenDate(Timer.getTimerT());
|
||||||
image.setBaiduLongitude(lu.getLongitude());
|
image.setBaiduLongitude(latLng.longitude);
|
||||||
image.setBaiduLatitude(lu.getLatitude());
|
image.setBaiduLatitude(latLng.latitude);
|
||||||
image.setLocation(lu.getAddress());
|
image.setLocation(lgdu.getAddress());
|
||||||
MDPLocationCollectionManager.uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
MDPLocationCollectionManager.uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
Log.e("上报安联", "卸货照片上传成功");
|
Log.e("上报安联", "卸货照片上传成功");
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -649,14 +594,16 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
image.setFileExt(FileUtil.lastName(file));
|
image.setFileExt(FileUtil.lastName(file));
|
||||||
image.setFileName(FileUtil.fileName(file));
|
image.setFileName(FileUtil.fileName(file));
|
||||||
image.setImageTakenDate(Timer.getTimerT());
|
image.setImageTakenDate(Timer.getTimerT());
|
||||||
image.setBaiduLongitude(lu.getLongitude());
|
image.setBaiduLongitude(latLng.longitude);
|
||||||
image.setBaiduLatitude(lu.getLatitude());
|
image.setBaiduLatitude(latLng.latitude);
|
||||||
image.setLocation(lu.getAddress());
|
image.setLocation(lgdu.getAddress());
|
||||||
MDPLocationCollectionManager.uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
MDPLocationCollectionManager.uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
Log.e("上报安联", "回单照片上传成功");
|
Log.e("上报安联", "回单照片上传成功");
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -700,6 +647,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
Log.e("nfc", nfcStr);
|
Log.e("nfc", nfcStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传安联和交通厅,平台-装货
|
* 上传安联和交通厅,平台-装货
|
||||||
*/
|
*/
|
||||||
@@ -707,9 +657,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
//安联
|
//安联
|
||||||
if (sob.getData().getReportAlct() == 1) {
|
if (sob.getData().getReportAlct() == 1) {
|
||||||
Location l = new Location();
|
Location l = new Location();
|
||||||
l.setBaiduLongitude(lu.getLongitude());
|
l.setBaiduLongitude(latLng.longitude);
|
||||||
l.setBaiduLatitude(lu.getLatitude());
|
l.setBaiduLatitude(latLng.latitude);
|
||||||
l.setLocation(lu.getAddress());
|
l.setLocation(lgdu.getAddress());
|
||||||
l.setTime(Timer.getTimerT());
|
l.setTime(Timer.getTimerT());
|
||||||
MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -719,10 +669,10 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
if (sob.getData().getReport() == 1) {
|
if (sob.getData().getReport() == 1) {
|
||||||
JTTProcess.start(con, sob, "");
|
JTTProcess.start(con, sob, "");
|
||||||
}
|
}
|
||||||
//装货照片
|
|
||||||
up_image_z();
|
|
||||||
//装货状态
|
//装货状态
|
||||||
hyr.loading(lub);
|
hyr.loading(lub);
|
||||||
|
//装货照片
|
||||||
|
up_image_z();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -743,9 +693,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
//安联
|
//安联
|
||||||
if (sob.getData().getReportAlct() == 1) {
|
if (sob.getData().getReportAlct() == 1) {
|
||||||
Location l = new Location();
|
Location l = new Location();
|
||||||
l.setBaiduLongitude(lu.getLongitude());
|
l.setBaiduLongitude(latLng.longitude);
|
||||||
l.setBaiduLatitude(lu.getLatitude());
|
l.setBaiduLatitude(latLng.latitude);
|
||||||
l.setLocation(lu.getAddress());
|
l.setLocation(lgdu.getAddress());
|
||||||
l.setTime(Timer.getTimerT());
|
l.setTime(Timer.getTimerT());
|
||||||
Log.e("-安联卸货信息-", gson.toJson(l));
|
Log.e("-安联卸货信息-", gson.toJson(l));
|
||||||
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||||
@@ -756,10 +706,10 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
if (sob.getData().getReport() == 1) {
|
if (sob.getData().getReport() == 1) {
|
||||||
JTTProcess.stop(con, sob, "");
|
JTTProcess.stop(con, sob, "");
|
||||||
}
|
}
|
||||||
//卸货照片-安联
|
|
||||||
up_image();
|
|
||||||
//卸货状态-平台
|
//卸货状态-平台
|
||||||
hyr.dischargeCargo(lub);
|
hyr.dischargeCargo(lub);
|
||||||
|
//卸货照片-安联
|
||||||
|
up_image();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
+876
@@ -0,0 +1,876 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Message;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.Gravity;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
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.services.core.AMapException;
|
||||||
|
import com.amap.api.services.core.LatLonPoint;
|
||||||
|
import com.amap.api.services.geocoder.GeocodeSearch;
|
||||||
|
import com.amap.api.services.help.Inputtips;
|
||||||
|
import com.amap.api.services.help.InputtipsQuery;
|
||||||
|
import com.amap.api.services.help.Tip;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.OCRRequest;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.BitmapUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.img.GetCarImageAlert;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.location.LocationUtil;
|
||||||
|
import com.baidu.mapapi.model.LatLng;
|
||||||
|
import com.baidu.mapapi.utils.CoordinateConverter;
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.dahe.mylibrary.utils.ToastUtils;
|
||||||
|
import com.github.gzuliyujiang.wheelpicker.DatimePicker;
|
||||||
|
import com.github.gzuliyujiang.wheelpicker.annotation.TimeMode;
|
||||||
|
import com.github.gzuliyujiang.wheelpicker.entity.DatimeEntity;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.luck.picture.lib.PictureSelector;
|
||||||
|
import com.luck.picture.lib.config.PictureConfig;
|
||||||
|
import com.luck.picture.lib.entity.LocalMedia;
|
||||||
|
import com.lxj.xpopup.XPopup;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.StartOrderBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.UploadBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.UploadReceiptInputBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.location.LocationGDUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.file.FileUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.file.ImageFileCompressUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.time.Timer;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||||
|
import com.lxj.xpopup.interfaces.OnSelectListener;
|
||||||
|
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ShangChuangImgActivity extends BaseAppCompatActivity implements Inputtips.InputtipsListener {
|
||||||
|
|
||||||
|
private TextView submit, name_top, name_body, address, tips, tips_x,tvDate,tvLocation;
|
||||||
|
private RelativeLayout getImg;
|
||||||
|
private EditText etAddress;
|
||||||
|
private Button btnOk;
|
||||||
|
private ImageView res_img, img_icon, img_delete;
|
||||||
|
private String[] names = {"装货", "卸货", "回单"};
|
||||||
|
public static String[] TYPE_NAME = {"zhuanghuo", "xiehuo", "huidan"};
|
||||||
|
private int index = 0;
|
||||||
|
//
|
||||||
|
private Gson gson = new Gson();
|
||||||
|
//
|
||||||
|
private LUInputBean lub = new LUInputBean();
|
||||||
|
private UploadReceiptInputBean urib = new UploadReceiptInputBean();
|
||||||
|
private LocationGDUtil lgdu;
|
||||||
|
public LocationUtil lu;
|
||||||
|
private List<Integer> imgIds = new ArrayList<>();
|
||||||
|
private UploadBean ub;
|
||||||
|
private HuoYuanRequset hyr;
|
||||||
|
//
|
||||||
|
private GetCarImageAlert gia = new GetCarImageAlert();
|
||||||
|
private CustomDialog customDialog;
|
||||||
|
private int id = 0;
|
||||||
|
private boolean key = true;
|
||||||
|
private boolean keys = false;
|
||||||
|
private boolean locationKey = false;
|
||||||
|
private TextView tv_loaction;
|
||||||
|
|
||||||
|
|
||||||
|
private String selDate;
|
||||||
|
private GeocodeSearch geocoderSearch;
|
||||||
|
|
||||||
|
private TempLoca tempLoca = new TempLoca();
|
||||||
|
private TempLoca tempLocaBd = new TempLoca();
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onGetInputtips(List<Tip> tipList, int rCode) {
|
||||||
|
if (rCode == AMapException.CODE_AMAP_SUCCESS) {
|
||||||
|
List<String> names = new ArrayList<String>();
|
||||||
|
if(tipList != null) {
|
||||||
|
int size = tipList.size();
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
Tip tip = tipList.get(i);
|
||||||
|
if(tip != null) {
|
||||||
|
names.add(tip.getDistrict()+tip.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
new XPopup.Builder(this)
|
||||||
|
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||||
|
.hasShadowBg(false) // 去掉半透明背景
|
||||||
|
.atView(etAddress)
|
||||||
|
.asAttachList(names.toArray(new String[0]), new int[]{}, new OnSelectListener() {
|
||||||
|
@Override
|
||||||
|
public void onSelect(int position, String text) {
|
||||||
|
Tip tip = tipList.get(position);
|
||||||
|
etAddress.setText(tip.getDistrict()+tip.getAddress()+tip.getName());
|
||||||
|
LatLonPoint latLonPoint = tip.getPoint();
|
||||||
|
tempLoca.setAddress(etAddress.getText().toString());
|
||||||
|
tempLoca.setLatitude(latLonPoint.getLatitude());
|
||||||
|
tempLoca.setLongitude(latLonPoint.getLongitude());
|
||||||
|
tempLoca.setTime(tvDate.getText().toString());
|
||||||
|
|
||||||
|
LatLng latLng = convertGPSToBaidu(new LatLng(latLonPoint.getLatitude(), latLonPoint.getLongitude()));
|
||||||
|
tempLocaBd.setLongitude(latLng.longitude);
|
||||||
|
tempLocaBd.setLatitude(latLng.latitude);
|
||||||
|
tempLocaBd.setAddress(etAddress.getText().toString());
|
||||||
|
tempLocaBd.setTime(tvDate.getText().toString());
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.show();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// SimpleAdapter aAdapter = new SimpleAdapter(getApplicationContext(), listString, R.layout.item_layout,
|
||||||
|
// new String[]{"name", "address"}, new int[]{R.id.poi_field_id, R.id.poi_value_id});
|
||||||
|
//
|
||||||
|
// minputlist.setAdapter(aAdapter);
|
||||||
|
// aAdapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class TempLoca{
|
||||||
|
private double latitude;
|
||||||
|
private double longitude;
|
||||||
|
private String address;
|
||||||
|
private String time;
|
||||||
|
|
||||||
|
public TempLoca() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public TempLoca(double latitude, double longitude, String address, String time) {
|
||||||
|
this.latitude = latitude;
|
||||||
|
this.longitude = longitude;
|
||||||
|
this.address = address;
|
||||||
|
this.time = time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getLatitude() {
|
||||||
|
return latitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLatitude(double latitude) {
|
||||||
|
this.latitude = latitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getLongitude() {
|
||||||
|
return longitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLongitude(double longitude) {
|
||||||
|
this.longitude = longitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddress() {
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddress(String address) {
|
||||||
|
this.address = address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTime() {
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTime(String time) {
|
||||||
|
this.time = time;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void msgMethod(Message m) {
|
||||||
|
super.msgMethod(m);
|
||||||
|
switch (m.what) {
|
||||||
|
case RequsetCodeConstants.SUCCESS:
|
||||||
|
if (CacheGroup.cacheList.get("upload") != null) {
|
||||||
|
Log.e("upload", CacheGroup.cacheList.get("upload"));
|
||||||
|
ub = gson.fromJson(CacheGroup.cacheList.remove("upload"), UploadBean.class);
|
||||||
|
if (ub.getCode() == 200) {
|
||||||
|
imgIds.add(ub.getData().getId());
|
||||||
|
Glide.with(con).load(ub.getData().getUrl()).into(res_img);
|
||||||
|
res_img.setVisibility(View.VISIBLE);
|
||||||
|
img_delete.setVisibility(View.VISIBLE);
|
||||||
|
img_icon.setVisibility(View.GONE);
|
||||||
|
key = false;
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove("upload");
|
||||||
|
}
|
||||||
|
for (int i = 0; i < TYPE_NAME.length; i++) {
|
||||||
|
if (CacheGroup.cacheList.get(TYPE_NAME[i]) != null) {
|
||||||
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]), BaseBean.class);
|
||||||
|
if (bb.getCode() == 200) {
|
||||||
|
if (index == 2) {
|
||||||
|
if (!keys){//装货回单
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove(TYPE_NAME[i]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CacheGroup.cacheList.get("carName") != null) {
|
||||||
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("carName"), BaseBean.class);
|
||||||
|
if (bb.getCode() == 200) {
|
||||||
|
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove("carName");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CacheGroup.cacheList.get("carNum") != null) {
|
||||||
|
Log.e("upload", CacheGroup.cacheList.get("carNum"));
|
||||||
|
CarInfoBean ub = gson.fromJson(CacheGroup.cacheList.remove("carNum"), CarInfoBean.class);
|
||||||
|
if (ub.getCode() == 200 && ub.getData().getData().getPrism_keyValueInfo().size() > 0) {
|
||||||
|
String value = ub.getData().getData().getPrism_keyValueInfo().get(0).getValue();
|
||||||
|
String forceMatching = ub.getData().getForceMatching();
|
||||||
|
if ("1".equals(forceMatching)) {//是否强校验车牌号 1:强校验
|
||||||
|
if (sob.getData().getCarNumber().equals(value)) {
|
||||||
|
hyr.uploadFile(new File(path));
|
||||||
|
} else {
|
||||||
|
new MessageUtils().showCenMessage(ShangChuangImgActivity.this, "车牌号不匹配!", "请重新拍照或联系管理员");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
hyr.uploadFile(new File(path));
|
||||||
|
}
|
||||||
|
} else {//识别失败后返回code500
|
||||||
|
if (index == 0) {//装卸货车辆需要识别车牌号){
|
||||||
|
Toast.makeText(con, "装货照片包含车牌号、三分之二车身或者装卸货场景。", Toast.LENGTH_SHORT).show();
|
||||||
|
} else if (index == 1) {
|
||||||
|
Toast.makeText(con, "卸货照片包含车牌号、三分之二车身或者装卸货场景。", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove("carNum");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 14://定位成功
|
||||||
|
locationKey = true;
|
||||||
|
customDialog.dismiss();
|
||||||
|
tv_loaction.setText("定位成功");
|
||||||
|
tv_loaction.setTextColor(getResources().getColor(R.color.theme_color, null));
|
||||||
|
latLng = convertGPSToBaidu(new LatLng(lgdu.getLatitude(), lgdu.getLongitude()));
|
||||||
|
initLocation();
|
||||||
|
break;
|
||||||
|
case 16://定位失败
|
||||||
|
locationKey = false;
|
||||||
|
customDialog.dismiss();
|
||||||
|
tv_loaction.setText("定位失败,点击重试");
|
||||||
|
tv_loaction.setTextColor(getResources().getColor(R.color.loaction_no_color, null));
|
||||||
|
Toast.makeText(con, "定位失败,请确认开启定位后重试!", Toast.LENGTH_LONG).show();
|
||||||
|
//定位结果接收
|
||||||
|
//finish();
|
||||||
|
break;
|
||||||
|
case 15:
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ImageFileCompressUtil.COMPRESS_SUCCESS:
|
||||||
|
path = (String) m.obj;
|
||||||
|
Log.e("res:", "选定图片结果");
|
||||||
|
Log.e("res:", path);
|
||||||
|
//选定图片结果
|
||||||
|
// if(index==1 || index==2){
|
||||||
|
// new OCRRequest().OCRPlateLicense(con,hd,new File(path));
|
||||||
|
// }
|
||||||
|
if (index == 0 || index == 1) {//装卸货车辆需要识别车牌号
|
||||||
|
new OCRRequest().OCRCarPlateLicense(con, hd, new File(path));
|
||||||
|
} else {
|
||||||
|
hyr.uploadFile(new File(path));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private LatLng latLng;
|
||||||
|
|
||||||
|
public LatLng convertGPSToBaidu(LatLng srLatLng) {
|
||||||
|
CoordinateConverter converter = new CoordinateConverter();
|
||||||
|
converter.from(CoordinateConverter.CoordType.COMMON);
|
||||||
|
converter.coord(srLatLng);
|
||||||
|
return converter.convert();
|
||||||
|
}
|
||||||
|
|
||||||
|
private String wid;
|
||||||
|
private int h_type;
|
||||||
|
String sobStr = "";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
StateStyleUtil.stateTextColor(this);
|
||||||
|
setContentView(R.layout.activity_shangchuan_bc);
|
||||||
|
con = this;
|
||||||
|
submit = findViewById(R.id.submit);
|
||||||
|
name_top = findViewById(R.id.name_top);
|
||||||
|
name_body = findViewById(R.id.name_body);
|
||||||
|
address = findViewById(R.id.address);
|
||||||
|
getImg = findViewById(R.id.getImg);
|
||||||
|
res_img = findViewById(R.id.res_img);
|
||||||
|
img_icon = findViewById(R.id.img_icon);
|
||||||
|
img_delete = findViewById(R.id.img_delete);
|
||||||
|
tv_loaction = findViewById(R.id.tv_loaction);
|
||||||
|
btnOk = findViewById(R.id.btnOk);
|
||||||
|
etAddress = findViewById(R.id.etAddress);
|
||||||
|
tvDate = findViewById(R.id.tvDate);
|
||||||
|
tvLocation = findViewById(R.id.tvLocation);
|
||||||
|
tips = findViewById(R.id.tips);
|
||||||
|
tips_x = findViewById(R.id.tips_x);
|
||||||
|
Bundle ins = getIntent().getExtras();
|
||||||
|
index = ins.getInt("type");
|
||||||
|
wid = ins.getString("wid");
|
||||||
|
h_type = ins.getInt("h_type");
|
||||||
|
keys = ins.getBoolean("keys");
|
||||||
|
sobStr = getIntent().getExtras().getString("sob");
|
||||||
|
//Log.e("---sdwStr--",sdwStr);
|
||||||
|
sob = new Gson().fromJson(sobStr, StartOrderBean.class);
|
||||||
|
initView(null);
|
||||||
|
customDialog = new CustomDialog(con, "正在定位当前位置...");
|
||||||
|
customDialog.show();
|
||||||
|
lgdu = new LocationGDUtil(con, hd);
|
||||||
|
//启动定位
|
||||||
|
lgdu.onCreate();
|
||||||
|
tv_loaction.setOnClickListener(v -> {
|
||||||
|
if (!locationKey) {
|
||||||
|
customDialog.show();
|
||||||
|
lgdu.onCreate();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
btnOk.setOnClickListener(v -> {
|
||||||
|
String s = etAddress.getText().toString();
|
||||||
|
if (TextUtils.isEmpty(selDate)){
|
||||||
|
ToastUtils.showToast(this,"请先选择时间");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!TextUtils.isEmpty(s)&&s.length()>=4){
|
||||||
|
|
||||||
|
InputtipsQuery inputquery = new InputtipsQuery(s, "");
|
||||||
|
// inputquery.setCityLimit(true);
|
||||||
|
Inputtips inputTips = new Inputtips(this, inputquery);
|
||||||
|
inputTips.setInputtipsListener(this);
|
||||||
|
inputTips.requestInputtipsAsyn();
|
||||||
|
|
||||||
|
|
||||||
|
// GeocodeQuery query = new GeocodeQuery(s, "100000");// 第一个参数表示地址,第二个参数表示查询城市,中文或者中文全拼,citycode、adcode,
|
||||||
|
// geocoderSearch.getFromLocationNameAsyn(query);// 设置同步地理编码请求
|
||||||
|
}else{
|
||||||
|
ToastUtils.showToast(this,"请输入地址且长度大于4");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
tvDate.setOnClickListener(v -> {
|
||||||
|
|
||||||
|
DatimePicker datimePicker = new DatimePicker(this);
|
||||||
|
datimePicker.setBodyWidth(300);
|
||||||
|
datimePicker.getWheelLayout().setRange(DatimeEntity.yearOnFuture(-1),DatimeEntity.yearOnFuture(10),DatimeEntity.now());
|
||||||
|
datimePicker.setOnDatimePickedListener((year, month, day, hour, minute, second) -> {
|
||||||
|
selDate = year+"-"+month+"-"+day+" "+ hour+":"+minute;
|
||||||
|
tvDate.setText(selDate);
|
||||||
|
});
|
||||||
|
datimePicker.getWheelLayout().setDateLabel("年", "月", "日");
|
||||||
|
datimePicker.getWheelLayout().setTimeLabel("时","分","");
|
||||||
|
datimePicker.getWheelLayout().setTimeMode(TimeMode.HOUR_24_NO_SECOND);
|
||||||
|
datimePicker.show();
|
||||||
|
});
|
||||||
|
|
||||||
|
hyr = new HuoYuanRequset(con, hd);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initData() {
|
||||||
|
//nfc初始化设置
|
||||||
|
NfcUtils nfcUtils = new NfcUtils(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initView(Object obj) {
|
||||||
|
super.initView(obj);
|
||||||
|
name_top.setText("上传" + names[index] + "照片");
|
||||||
|
name_body.setText(names[index] + "照片");
|
||||||
|
if (index == 1) {
|
||||||
|
tips.setVisibility(View.VISIBLE);
|
||||||
|
tips_x.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
submit.setOnClickListener(v -> {
|
||||||
|
if (imgIds.size() != 0) {
|
||||||
|
typeRequest();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "请先上传一张图片", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
getImg.setOnClickListener(v -> {
|
||||||
|
if (key) {
|
||||||
|
Log.e("--imgIds.size()--", imgIds.size() + "");
|
||||||
|
gia.showPopueWindow(this, true);
|
||||||
|
} else {
|
||||||
|
new XPopup.Builder(con)
|
||||||
|
.asImageViewer(res_img, ub.getData().getUrl(), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||||
|
.show();
|
||||||
|
// new XPopup.Builder(con)
|
||||||
|
// .asImageViewer(res_img, ub.getData().getUrl(), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||||
|
// .show();
|
||||||
|
Toast.makeText(con, "查看了照片", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
img_delete.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
imgIds = new ArrayList<>();
|
||||||
|
ub = new UploadBean();
|
||||||
|
res_img.setVisibility(View.GONE);
|
||||||
|
img_delete.setVisibility(View.GONE);
|
||||||
|
img_icon.setVisibility(View.VISIBLE);
|
||||||
|
key = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
String path;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
if (requestCode == 12 && resultCode == RESULT_OK) {
|
||||||
|
if (null == gia.getFile()) {
|
||||||
|
new ToastUtil(con, Gravity.CENTER, "图片选择失败").show(Toast.LENGTH_SHORT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
path = gia.getFile().getPath();
|
||||||
|
Log.e("图片地址:", path);
|
||||||
|
gia.dis();
|
||||||
|
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||||
|
} else if (requestCode == PictureConfig.CHOOSE_REQUEST && resultCode == RESULT_OK) {
|
||||||
|
List<LocalMedia> imgs = PictureSelector.obtainMultipleResult(data);
|
||||||
|
if (imgs != null && imgs.size() > 0) {
|
||||||
|
LocalMedia image = imgs.get(0);
|
||||||
|
|
||||||
|
String paths = image.getAndroidQToPath();
|
||||||
|
if (TextUtils.isEmpty(paths)) {
|
||||||
|
paths = image.getPath();
|
||||||
|
}
|
||||||
|
path = paths;
|
||||||
|
Log.e("图片地址:", path);
|
||||||
|
gia.dis();
|
||||||
|
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initLocation() {
|
||||||
|
address.setText(lgdu.getAddress());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void typeRequest() {
|
||||||
|
// for(int i=0;i<imgIds.size();i++){
|
||||||
|
// Log.e("--imgIds--",imgIds.get(i)+"");
|
||||||
|
// }
|
||||||
|
switch (index) {
|
||||||
|
case 0:
|
||||||
|
//装货
|
||||||
|
if (imgIds != null && imgIds.size() > 0) {
|
||||||
|
lub.setLatitude(tempLoca.getLatitude() + "");
|
||||||
|
lub.setLongitude(tempLoca.getLongitude() + "");
|
||||||
|
lub.setLocationAddress(tempLoca.getAddress());
|
||||||
|
lub.setImageId(imgIds);
|
||||||
|
lub.setWaybillId(wid);
|
||||||
|
Log.e("--装货信息", gson.toJson(lub));
|
||||||
|
if (locationKey) {//高德定位
|
||||||
|
if (keys) {
|
||||||
|
nfc();
|
||||||
|
loadInfo();
|
||||||
|
// up_traffic_start();
|
||||||
|
// up_image_z();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if (imgIds != null && imgIds.size() > 0) {
|
||||||
|
//卸货
|
||||||
|
lub.setLatitude(tempLoca.getLatitude() + "");
|
||||||
|
lub.setLongitude(tempLoca.getLongitude() + "");
|
||||||
|
lub.setLocationAddress(tempLoca.getAddress());
|
||||||
|
lub.setImageId(imgIds);
|
||||||
|
lub.setWaybillId(wid);
|
||||||
|
lub.setRealLoadTime(tempLoca.getTime());
|
||||||
|
Log.e("--卸货信息", gson.toJson(lub));
|
||||||
|
if (locationKey&&!TextUtils.isEmpty(tempLoca.address)) {
|
||||||
|
if (keys) {
|
||||||
|
nfc();
|
||||||
|
uploadInfo();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
if (imgIds != null && imgIds.size() > 0) {//卸货回单
|
||||||
|
//上传回单
|
||||||
|
urib.setLatitude(lgdu.getLatitude() + "");
|
||||||
|
urib.setLongitude(lgdu.getLongitude() + "");
|
||||||
|
urib.setLocationAddress(lgdu.getAddress());
|
||||||
|
//装卸货类型
|
||||||
|
urib.setType(h_type + 1);
|
||||||
|
//回单id 数组
|
||||||
|
urib.setReceiptId(imgIds);
|
||||||
|
//子运运单ID
|
||||||
|
urib.setWaybillId(wid);
|
||||||
|
Log.e("--回单信息", gson.toJson(urib));
|
||||||
|
if (locationKey) {
|
||||||
|
if (index == 2 && keys && !TextUtils.isEmpty(tempLoca.address)) {
|
||||||
|
up_trafficSign();
|
||||||
|
up_trafficReceipt();
|
||||||
|
receipt_image();
|
||||||
|
}
|
||||||
|
hyr.receipt(urib);
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private StartOrderBean sob;
|
||||||
|
|
||||||
|
public void nfc() {
|
||||||
|
// if(sob.getData().getNfcId().equals(nfcStr)){
|
||||||
|
// Toast.makeText(con,"nfcId匹配失败",Toast.LENGTH_LONG).show();
|
||||||
|
// }
|
||||||
|
if ("".equals(sob.getData().getNfcId()) || sob.getData().getNfcId() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MDPLocationCollectionManager.checkNfc(con, sob.getData().getShippingNoteNumber(),
|
||||||
|
sob.getData().getNfcId(), new OnResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Toast.makeText(con, "nfcId匹配成功", Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("不匹配", "" + s + s1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//上传安联-签收
|
||||||
|
public void up_trafficSign() {
|
||||||
|
//安联
|
||||||
|
Location l = new Location();
|
||||||
|
l.setBaiduLongitude(tempLocaBd.longitude);
|
||||||
|
l.setBaiduLatitude(tempLocaBd.latitude);
|
||||||
|
l.setLocation(tempLocaBd.getAddress());
|
||||||
|
l.setTime(tempLocaBd.getTime());
|
||||||
|
List<Goods> gs = new ArrayList<>();
|
||||||
|
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||||
|
if (wid.equals(wayChild.getId() + "")) {
|
||||||
|
for (StartOrderBean.DataDTO.WayChildrenDTO.GoodsDTO good : wayChild.getGoods()) {
|
||||||
|
Goods g = new Goods();
|
||||||
|
g.setGoodsName(good.getGoodName());
|
||||||
|
g.setUnit(good.getGoodUnit());
|
||||||
|
g.setItemNo(good.getId());
|
||||||
|
//实收
|
||||||
|
g.setQuantity(1);
|
||||||
|
//应收
|
||||||
|
g.setReceivedQuantity(1);
|
||||||
|
//破损
|
||||||
|
g.setDamageQuantity(1);
|
||||||
|
//丢失
|
||||||
|
g.setQuantity(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MDPLocationCollectionManager.sign(con, sob.getData().getShippingNoteNumber(), l, gs, new OnResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "签收成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(签收):", s + s1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//上传安联-回单
|
||||||
|
public void up_trafficReceipt() {
|
||||||
|
//安联
|
||||||
|
Location l = new Location();
|
||||||
|
l.setBaiduLongitude(tempLocaBd.longitude);
|
||||||
|
l.setBaiduLatitude(tempLocaBd.latitude);
|
||||||
|
l.setLocation(tempLocaBd.getAddress());
|
||||||
|
l.setTime(tempLocaBd.getTime());
|
||||||
|
MDPLocationCollectionManager.pod(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "回单上传成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(回单):", s + s1);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void up_image_z() {
|
||||||
|
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||||
|
File file = new File(path);
|
||||||
|
Image image = new Image();
|
||||||
|
String base = BitmapUtil.imageToBase64(path);
|
||||||
|
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||||
|
image.setFileExt(FileUtil.lastName(file));
|
||||||
|
image.setFileName(FileUtil.fileName(file));
|
||||||
|
image.setImageTakenDate(Timer.getTimerT());
|
||||||
|
image.setBaiduLongitude(tempLocaBd.longitude);
|
||||||
|
image.setBaiduLatitude(tempLocaBd.latitude);
|
||||||
|
image.setLocation(tempLocaBd.getAddress());
|
||||||
|
MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "装货照片上传成功");
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void up_image() {
|
||||||
|
File file = new File(path);
|
||||||
|
Image image = new Image();
|
||||||
|
String base = BitmapUtil.imageToBase64(path);
|
||||||
|
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||||
|
image.setFileExt(FileUtil.lastName(file));
|
||||||
|
image.setFileName(FileUtil.fileName(file));
|
||||||
|
image.setImageTakenDate(tempLocaBd.getTime());
|
||||||
|
image.setBaiduLongitude(tempLocaBd.longitude);
|
||||||
|
image.setBaiduLatitude(tempLocaBd.latitude);
|
||||||
|
image.setLocation(tempLocaBd.getAddress());
|
||||||
|
MDPLocationCollectionManager.uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "卸货照片上传成功");
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void receipt_image() {
|
||||||
|
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||||
|
File file = new File(path);
|
||||||
|
Image image = new Image();
|
||||||
|
String base = BitmapUtil.imageToBase64(path);
|
||||||
|
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||||
|
image.setFileExt(FileUtil.lastName(file));
|
||||||
|
image.setFileName(FileUtil.fileName(file));
|
||||||
|
image.setImageTakenDate(tempLocaBd.getTime());
|
||||||
|
image.setBaiduLongitude(tempLocaBd.longitude);
|
||||||
|
image.setBaiduLatitude(tempLocaBd.latitude);
|
||||||
|
image.setLocation(tempLocaBd.getAddress());
|
||||||
|
MDPLocationCollectionManager.uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "回单照片上传成功");
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
//开启前台调度系统
|
||||||
|
//NfcUtils.mNfcAdapter.enableForegroundDispatch(this, NfcUtils.mPendingIntent, NfcUtils.mIntentFilter, NfcUtils.mTechList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
//关闭前台调度系统
|
||||||
|
//NfcUtils.mNfcAdapter.disableForegroundDispatch(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
String nfcStr = "";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onNewIntent(Intent intent) {
|
||||||
|
super.onNewIntent(intent);
|
||||||
|
//当该Activity接收到NFC标签时,运行该方法
|
||||||
|
//调用工具方法,读取NFC数据
|
||||||
|
try {
|
||||||
|
nfcStr = NfcUtils.readNFCId(intent);
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
Log.e("nfc", nfcStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传安联和交通厅,平台-装货
|
||||||
|
*/
|
||||||
|
private void loadInfo() {
|
||||||
|
//安联
|
||||||
|
if (sob.getData().getReportAlct() == 1) {
|
||||||
|
Location l = new Location();
|
||||||
|
l.setBaiduLongitude(tempLocaBd.longitude);
|
||||||
|
l.setBaiduLatitude(tempLocaBd.latitude);
|
||||||
|
l.setLocation(tempLocaBd.getAddress());
|
||||||
|
l.setTime(tempLocaBd.getTime());
|
||||||
|
MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "装货上传成功");
|
||||||
|
//交通厅
|
||||||
|
if (sob.getData().getReport() == 1) {
|
||||||
|
JTTProcess.start(con, sob, "");
|
||||||
|
}
|
||||||
|
//装货状态
|
||||||
|
hyr.loading(lub);
|
||||||
|
//装货照片
|
||||||
|
up_image_z();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(装货):", s + s1);
|
||||||
|
new MessageUtils().showCenMessage(con, s1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传安联和交通厅,平台-卸货
|
||||||
|
*/
|
||||||
|
private void uploadInfo() {
|
||||||
|
|
||||||
|
//安联
|
||||||
|
if (sob.getData().getReportAlct() == 1) {
|
||||||
|
Location l = new Location();
|
||||||
|
l.setBaiduLongitude(tempLocaBd.longitude);
|
||||||
|
l.setBaiduLatitude(tempLocaBd.latitude);
|
||||||
|
l.setLocation(tempLocaBd.getAddress());
|
||||||
|
l.setTime(tempLocaBd.getTime());
|
||||||
|
Log.e("-安联卸货信息-", gson.toJson(l));
|
||||||
|
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "卸货上传成功");
|
||||||
|
//交通厅
|
||||||
|
if (sob.getData().getReport() == 1) {
|
||||||
|
JTTProcess.stop(con, sob, "");
|
||||||
|
}
|
||||||
|
//卸货状态-平台
|
||||||
|
hyr.dischargeCargo4(lub);
|
||||||
|
//卸货照片-安联
|
||||||
|
up_image();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(卸货):", s + s1);
|
||||||
|
// new MessageUtils().showCenMessage(con, s1);
|
||||||
|
//运单状态不一致,平台更新状态
|
||||||
|
hyr.dischargeCargo4(lub);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
+725
@@ -0,0 +1,725 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Message;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.Gravity;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
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.arpa.hndahesudintocctmsdriver.R;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.StartOrderBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.UploadBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.OCRRequest;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.UploadReceiptInputBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.BitmapUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.file.FileUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.file.ImageFileCompressUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.img.GetCarImageAlert;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.location.LocationGDUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.location.LocationUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.time.Timer;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||||
|
import com.baidu.mapapi.model.LatLng;
|
||||||
|
import com.baidu.mapapi.utils.CoordinateConverter;
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.luck.picture.lib.PictureSelector;
|
||||||
|
import com.luck.picture.lib.config.PictureConfig;
|
||||||
|
import com.luck.picture.lib.entity.LocalMedia;
|
||||||
|
import com.lxj.xpopup.XPopup;
|
||||||
|
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||||
|
|
||||||
|
private TextView submit, name_top, name_body, address, tips, tips_x;
|
||||||
|
private RelativeLayout getImg;
|
||||||
|
private ImageView res_img, img_icon, img_delete;
|
||||||
|
private String[] names = {"装货", "卸货", "回单"};
|
||||||
|
public static String[] TYPE_NAME = {"zhuanghuo", "xiehuo", "huidan"};
|
||||||
|
private int index = 0;
|
||||||
|
//
|
||||||
|
private Gson gson = new Gson();
|
||||||
|
//
|
||||||
|
private LUInputBean lub = new LUInputBean();
|
||||||
|
private UploadReceiptInputBean urib = new UploadReceiptInputBean();
|
||||||
|
private LocationGDUtil lgdu;
|
||||||
|
public LocationUtil lu;
|
||||||
|
private List<Integer> imgIds = new ArrayList<>();
|
||||||
|
private UploadBean ub;
|
||||||
|
private HuoYuanRequset hyr;
|
||||||
|
//
|
||||||
|
private GetCarImageAlert gia = new GetCarImageAlert();
|
||||||
|
private CustomDialog customDialog;
|
||||||
|
private int id = 0;
|
||||||
|
private boolean key = true;
|
||||||
|
private boolean keys = false;
|
||||||
|
private boolean locationKey = false;
|
||||||
|
private TextView tv_loaction;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void msgMethod(Message m) {
|
||||||
|
super.msgMethod(m);
|
||||||
|
switch (m.what) {
|
||||||
|
case RequsetCodeConstants.SUCCESS:
|
||||||
|
if (CacheGroup.cacheList.get("upload") != null) {
|
||||||
|
Log.e("upload", CacheGroup.cacheList.get("upload"));
|
||||||
|
ub = gson.fromJson(CacheGroup.cacheList.remove("upload"), UploadBean.class);
|
||||||
|
if (ub.getCode() == 200) {
|
||||||
|
imgIds.add(ub.getData().getId());
|
||||||
|
Glide.with(con).load(ub.getData().getUrl()).into(res_img);
|
||||||
|
res_img.setVisibility(View.VISIBLE);
|
||||||
|
img_delete.setVisibility(View.VISIBLE);
|
||||||
|
img_icon.setVisibility(View.GONE);
|
||||||
|
key = false;
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove("upload");
|
||||||
|
}
|
||||||
|
for (int i = 0; i < TYPE_NAME.length; i++) {
|
||||||
|
if (CacheGroup.cacheList.get(TYPE_NAME[i]) != null) {
|
||||||
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]), BaseBean.class);
|
||||||
|
if (bb.getCode() == 200) {
|
||||||
|
if (index == 2) {
|
||||||
|
if (!keys){//装货回单
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove(TYPE_NAME[i]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CacheGroup.cacheList.get("carName") != null) {
|
||||||
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("carName"), BaseBean.class);
|
||||||
|
if (bb.getCode() == 200) {
|
||||||
|
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove("carName");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CacheGroup.cacheList.get("carNum") != null) {
|
||||||
|
Log.e("upload", CacheGroup.cacheList.get("carNum"));
|
||||||
|
CarInfoBean ub = gson.fromJson(CacheGroup.cacheList.remove("carNum"), CarInfoBean.class);
|
||||||
|
if (ub.getCode() == 200 && ub.getData().getData().getPrism_keyValueInfo().size() > 0) {
|
||||||
|
String value = ub.getData().getData().getPrism_keyValueInfo().get(0).getValue();
|
||||||
|
String forceMatching = ub.getData().getForceMatching();
|
||||||
|
if ("1".equals(forceMatching)) {//是否强校验车牌号 1:强校验
|
||||||
|
if (sob.getData().getCarNumber().equals(value)) {
|
||||||
|
hyr.uploadFile(new File(path));
|
||||||
|
} else {
|
||||||
|
new MessageUtils().showCenMessage(ShangChuangImgActivity.this, "车牌号不匹配!", "请重新拍照或联系管理员");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
hyr.uploadFile(new File(path));
|
||||||
|
}
|
||||||
|
} else {//识别失败后返回code500
|
||||||
|
if (index == 0) {//装卸货车辆需要识别车牌号){
|
||||||
|
Toast.makeText(con, "装货照片包含车牌号、三分之二车身或者装卸货场景。", Toast.LENGTH_SHORT).show();
|
||||||
|
} else if (index == 1) {
|
||||||
|
Toast.makeText(con, "卸货照片包含车牌号、三分之二车身或者装卸货场景。", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove("carNum");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 14://定位成功
|
||||||
|
locationKey = true;
|
||||||
|
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
tv_loaction.setText("定位成功");
|
||||||
|
tv_loaction.setTextColor(getResources().getColor(R.color.theme_color, null));
|
||||||
|
latLng = convertGPSToBaidu(new LatLng(lgdu.getLatitude(), lgdu.getLongitude()));
|
||||||
|
initLocation();
|
||||||
|
break;
|
||||||
|
case 16://定位失败
|
||||||
|
locationKey = false;
|
||||||
|
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
tv_loaction.setText("定位失败,点击重试");
|
||||||
|
tv_loaction.setTextColor(getResources().getColor(R.color.loaction_no_color, null));
|
||||||
|
Toast.makeText(con, "定位失败,请确认开启定位后重试!", Toast.LENGTH_LONG).show();
|
||||||
|
//定位结果接收
|
||||||
|
//finish();
|
||||||
|
break;
|
||||||
|
case 15:
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ImageFileCompressUtil.COMPRESS_SUCCESS:
|
||||||
|
path = (String) m.obj;
|
||||||
|
Log.e("res:", "选定图片结果");
|
||||||
|
Log.e("res:", path);
|
||||||
|
//选定图片结果
|
||||||
|
// if(index==1 || index==2){
|
||||||
|
// new OCRRequest().OCRPlateLicense(con,hd,new File(path));
|
||||||
|
// }
|
||||||
|
if (index == 0 || index == 1) {//装卸货车辆需要识别车牌号
|
||||||
|
new OCRRequest().OCRCarPlateLicense(con, hd, new File(path));
|
||||||
|
} else {
|
||||||
|
hyr.uploadFile(new File(path));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private LatLng latLng;
|
||||||
|
|
||||||
|
public LatLng convertGPSToBaidu(LatLng srLatLng) {
|
||||||
|
CoordinateConverter converter = new CoordinateConverter();
|
||||||
|
converter.from(CoordinateConverter.CoordType.COMMON);
|
||||||
|
converter.coord(srLatLng);
|
||||||
|
return converter.convert();
|
||||||
|
}
|
||||||
|
|
||||||
|
private String wid;
|
||||||
|
private int h_type;
|
||||||
|
String sobStr = "";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
StateStyleUtil.stateTextColor(this);
|
||||||
|
setContentView(R.layout.activity_shangchuan);
|
||||||
|
con = this;
|
||||||
|
submit = findViewById(R.id.submit);
|
||||||
|
name_top = findViewById(R.id.name_top);
|
||||||
|
name_body = findViewById(R.id.name_body);
|
||||||
|
address = findViewById(R.id.address);
|
||||||
|
getImg = findViewById(R.id.getImg);
|
||||||
|
res_img = findViewById(R.id.res_img);
|
||||||
|
img_icon = findViewById(R.id.img_icon);
|
||||||
|
img_delete = findViewById(R.id.img_delete);
|
||||||
|
tv_loaction = findViewById(R.id.tv_loaction);
|
||||||
|
tips = findViewById(R.id.tips);
|
||||||
|
tips_x = findViewById(R.id.tips_x);
|
||||||
|
Bundle ins = getIntent().getExtras();
|
||||||
|
index = ins.getInt("type");
|
||||||
|
wid = ins.getString("wid");
|
||||||
|
h_type = ins.getInt("h_type");
|
||||||
|
keys = ins.getBoolean("keys");
|
||||||
|
sobStr = getIntent().getExtras().getString("sob");
|
||||||
|
//Log.e("---sdwStr--",sdwStr);
|
||||||
|
sob = new Gson().fromJson(sobStr, StartOrderBean.class);
|
||||||
|
initView(null);
|
||||||
|
customDialog = new CustomDialog(con, "正在定位当前位置...");
|
||||||
|
customDialog.show();
|
||||||
|
lgdu = new LocationGDUtil(con, hd);
|
||||||
|
//启动定位
|
||||||
|
lgdu.onCreate();
|
||||||
|
// lu = new LocationUtil(con, hd);
|
||||||
|
// lu.onCreate();
|
||||||
|
// if (keys) {
|
||||||
|
// lu = new LocationUtil(con, hd);
|
||||||
|
// lu.onCreate();
|
||||||
|
// }
|
||||||
|
tv_loaction.setOnClickListener(v -> {
|
||||||
|
if (!locationKey) {
|
||||||
|
customDialog.show();
|
||||||
|
lgdu.onCreate();
|
||||||
|
// lu = new LocationUtil(con, hd);
|
||||||
|
// lu.onCreate();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
hyr = new HuoYuanRequset(con, hd);
|
||||||
|
// if (!NfcUtils.hasNfc(con)) {
|
||||||
|
// Toast.makeText(con,"请先开启nfc",Toast.LENGTH_LONG).show();
|
||||||
|
// }else{
|
||||||
|
// initData();
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initData() {
|
||||||
|
//nfc初始化设置
|
||||||
|
NfcUtils nfcUtils = new NfcUtils(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initView(Object obj) {
|
||||||
|
super.initView(obj);
|
||||||
|
name_top.setText("上传" + names[index] + "照片");
|
||||||
|
name_body.setText(names[index] + "照片");
|
||||||
|
if (index == 1) {
|
||||||
|
tips.setVisibility(View.VISIBLE);
|
||||||
|
tips_x.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
submit.setOnClickListener(v -> {
|
||||||
|
if (imgIds.size() != 0) {
|
||||||
|
typeRequest();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "请先上传一张图片", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
getImg.setOnClickListener(v -> {
|
||||||
|
if (key) {
|
||||||
|
Log.e("--imgIds.size()--", imgIds.size() + "");
|
||||||
|
gia.showPopueWindow(this, index == 2);
|
||||||
|
} else {
|
||||||
|
new XPopup.Builder(con)
|
||||||
|
.asImageViewer(res_img, ub.getData().getUrl(), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||||
|
.show();
|
||||||
|
// new XPopup.Builder(con)
|
||||||
|
// .asImageViewer(res_img, ub.getData().getUrl(), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||||
|
// .show();
|
||||||
|
Toast.makeText(con, "查看了照片", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
img_delete.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
imgIds = new ArrayList<>();
|
||||||
|
ub = new UploadBean();
|
||||||
|
res_img.setVisibility(View.GONE);
|
||||||
|
img_delete.setVisibility(View.GONE);
|
||||||
|
img_icon.setVisibility(View.VISIBLE);
|
||||||
|
key = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
String path;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
if (requestCode == 12 && resultCode == RESULT_OK) {
|
||||||
|
if (null == gia.getFile()) {
|
||||||
|
new ToastUtil(con, Gravity.CENTER, "图片选择失败").show(Toast.LENGTH_SHORT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
path = gia.getFile().getPath();
|
||||||
|
Log.e("图片地址:", path);
|
||||||
|
gia.dis();
|
||||||
|
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||||
|
} else if (requestCode == PictureConfig.CHOOSE_REQUEST && resultCode == RESULT_OK) {
|
||||||
|
List<LocalMedia> imgs = PictureSelector.obtainMultipleResult(data);
|
||||||
|
if (imgs != null && imgs.size() > 0) {
|
||||||
|
LocalMedia image = imgs.get(0);
|
||||||
|
|
||||||
|
String paths = image.getAndroidQToPath();
|
||||||
|
if (TextUtils.isEmpty(paths)) {
|
||||||
|
paths = image.getPath();
|
||||||
|
}
|
||||||
|
path = paths;
|
||||||
|
Log.e("图片地址:", path);
|
||||||
|
gia.dis();
|
||||||
|
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initLocation() {
|
||||||
|
address.setText(lgdu.getAddress());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void typeRequest() {
|
||||||
|
// for(int i=0;i<imgIds.size();i++){
|
||||||
|
// Log.e("--imgIds--",imgIds.get(i)+"");
|
||||||
|
// }
|
||||||
|
switch (index) {
|
||||||
|
case 0:
|
||||||
|
//装货
|
||||||
|
if (imgIds != null && imgIds.size() > 0) {
|
||||||
|
lub.setLatitude(lgdu.getLatitude() + "");
|
||||||
|
lub.setLongitude(lgdu.getLongitude() + "");
|
||||||
|
lub.setLocationAddress(lgdu.getAddress());
|
||||||
|
lub.setImageId(imgIds);
|
||||||
|
lub.setWaybillId(wid);
|
||||||
|
Log.e("--装货信息", gson.toJson(lub));
|
||||||
|
if (locationKey) {//高德定位
|
||||||
|
if (keys) {
|
||||||
|
nfc();
|
||||||
|
loadInfo();
|
||||||
|
// up_traffic_start();
|
||||||
|
// up_image_z();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if (imgIds != null && imgIds.size() > 0) {
|
||||||
|
//卸货
|
||||||
|
lub.setLatitude(lgdu.getLatitude() + "");
|
||||||
|
lub.setLongitude(lgdu.getLongitude() + "");
|
||||||
|
lub.setLocationAddress(lgdu.getAddress());
|
||||||
|
lub.setImageId(imgIds);
|
||||||
|
lub.setWaybillId(wid);
|
||||||
|
Log.e("--卸货信息", gson.toJson(lub));
|
||||||
|
if (locationKey) {
|
||||||
|
if (keys) {
|
||||||
|
nfc();
|
||||||
|
uploadInfo();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
if (imgIds != null && imgIds.size() > 0) {//卸货回单
|
||||||
|
//上传回单
|
||||||
|
urib.setLatitude(lgdu.getLatitude() + "");
|
||||||
|
urib.setLongitude(lgdu.getLongitude() + "");
|
||||||
|
urib.setLocationAddress(lgdu.getAddress());
|
||||||
|
//装卸货类型
|
||||||
|
urib.setType(h_type + 1);
|
||||||
|
//回单id 数组
|
||||||
|
urib.setReceiptId(imgIds);
|
||||||
|
//子运运单ID
|
||||||
|
urib.setWaybillId(wid);
|
||||||
|
Log.e("--回单信息", gson.toJson(urib));
|
||||||
|
if (locationKey) {
|
||||||
|
if (index == 2 && keys) {
|
||||||
|
up_trafficSign();
|
||||||
|
up_trafficReceipt();
|
||||||
|
receipt_image();
|
||||||
|
}
|
||||||
|
hyr.receipt(urib);
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private StartOrderBean sob;
|
||||||
|
|
||||||
|
public void nfc() {
|
||||||
|
// if(sob.getData().getNfcId().equals(nfcStr)){
|
||||||
|
// Toast.makeText(con,"nfcId匹配失败",Toast.LENGTH_LONG).show();
|
||||||
|
// }
|
||||||
|
if ("".equals(sob.getData().getNfcId()) || sob.getData().getNfcId() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MDPLocationCollectionManager.checkNfc(con, sob.getData().getShippingNoteNumber(),
|
||||||
|
sob.getData().getNfcId(), new OnResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Toast.makeText(con, "nfcId匹配成功", Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("不匹配", "" + s + s1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//上传安联-签收
|
||||||
|
public void up_trafficSign() {
|
||||||
|
//安联
|
||||||
|
Location l = new Location();
|
||||||
|
l.setBaiduLongitude(latLng.longitude);
|
||||||
|
l.setBaiduLatitude(latLng.latitude);
|
||||||
|
l.setLocation(lgdu.getAddress());
|
||||||
|
l.setTime(Timer.getTimerT());
|
||||||
|
List<Goods> gs = new ArrayList<>();
|
||||||
|
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||||
|
if (wid.equals(wayChild.getId() + "")) {
|
||||||
|
for (StartOrderBean.DataDTO.WayChildrenDTO.GoodsDTO good : wayChild.getGoods()) {
|
||||||
|
Goods g = new Goods();
|
||||||
|
g.setGoodsName(good.getGoodName());
|
||||||
|
g.setUnit(good.getGoodUnit());
|
||||||
|
g.setItemNo(good.getId());
|
||||||
|
//实收
|
||||||
|
g.setQuantity(1);
|
||||||
|
//应收
|
||||||
|
g.setReceivedQuantity(1);
|
||||||
|
//破损
|
||||||
|
g.setDamageQuantity(1);
|
||||||
|
//丢失
|
||||||
|
g.setQuantity(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MDPLocationCollectionManager.sign(con, sob.getData().getShippingNoteNumber(), l, gs, new OnResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "签收成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(签收):", s + s1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//上传安联-回单
|
||||||
|
public void up_trafficReceipt() {
|
||||||
|
//安联
|
||||||
|
Location l = new Location();
|
||||||
|
l.setBaiduLongitude(latLng.longitude);
|
||||||
|
l.setBaiduLatitude(latLng.latitude);
|
||||||
|
l.setLocation(lgdu.getAddress());
|
||||||
|
l.setTime(Timer.getTimerT());
|
||||||
|
MDPLocationCollectionManager.pod(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "回单上传成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(回单):", s + s1);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void up_image_z() {
|
||||||
|
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||||
|
File file = new File(path);
|
||||||
|
Image image = new Image();
|
||||||
|
String base = BitmapUtil.imageToBase64(path);
|
||||||
|
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||||
|
image.setFileExt(FileUtil.lastName(file));
|
||||||
|
image.setFileName(FileUtil.fileName(file));
|
||||||
|
image.setImageTakenDate(Timer.getTimerT());
|
||||||
|
image.setBaiduLongitude(latLng.longitude);
|
||||||
|
image.setBaiduLatitude(latLng.latitude);
|
||||||
|
image.setLocation(lgdu.getAddress());
|
||||||
|
MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "装货照片上传成功");
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void up_image() {
|
||||||
|
File file = new File(path);
|
||||||
|
Image image = new Image();
|
||||||
|
String base = BitmapUtil.imageToBase64(path);
|
||||||
|
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||||
|
image.setFileExt(FileUtil.lastName(file));
|
||||||
|
image.setFileName(FileUtil.fileName(file));
|
||||||
|
image.setImageTakenDate(Timer.getTimerT());
|
||||||
|
image.setBaiduLongitude(latLng.longitude);
|
||||||
|
image.setBaiduLatitude(latLng.latitude);
|
||||||
|
image.setLocation(lgdu.getAddress());
|
||||||
|
MDPLocationCollectionManager.uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "卸货照片上传成功");
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void receipt_image() {
|
||||||
|
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||||
|
File file = new File(path);
|
||||||
|
Image image = new Image();
|
||||||
|
String base = BitmapUtil.imageToBase64(path);
|
||||||
|
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||||
|
image.setFileExt(FileUtil.lastName(file));
|
||||||
|
image.setFileName(FileUtil.fileName(file));
|
||||||
|
image.setImageTakenDate(Timer.getTimerT());
|
||||||
|
image.setBaiduLongitude(latLng.longitude);
|
||||||
|
image.setBaiduLatitude(latLng.latitude);
|
||||||
|
image.setLocation(lgdu.getAddress());
|
||||||
|
MDPLocationCollectionManager.uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "回单照片上传成功");
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
//开启前台调度系统
|
||||||
|
//NfcUtils.mNfcAdapter.enableForegroundDispatch(this, NfcUtils.mPendingIntent, NfcUtils.mIntentFilter, NfcUtils.mTechList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
//关闭前台调度系统
|
||||||
|
//NfcUtils.mNfcAdapter.disableForegroundDispatch(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
String nfcStr = "";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onNewIntent(Intent intent) {
|
||||||
|
super.onNewIntent(intent);
|
||||||
|
//当该Activity接收到NFC标签时,运行该方法
|
||||||
|
//调用工具方法,读取NFC数据
|
||||||
|
try {
|
||||||
|
nfcStr = NfcUtils.readNFCId(intent);
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
Log.e("nfc", nfcStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传安联和交通厅,平台-装货
|
||||||
|
*/
|
||||||
|
private void loadInfo() {
|
||||||
|
//安联
|
||||||
|
if (sob.getData().getReportAlct() == 1) {
|
||||||
|
Location l = new Location();
|
||||||
|
l.setBaiduLongitude(latLng.longitude);
|
||||||
|
l.setBaiduLatitude(latLng.latitude);
|
||||||
|
l.setLocation(lgdu.getAddress());
|
||||||
|
l.setTime(Timer.getTimerT());
|
||||||
|
MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "装货上传成功");
|
||||||
|
//交通厅
|
||||||
|
if (sob.getData().getReport() == 1) {
|
||||||
|
JTTProcess.start(con, sob, "");
|
||||||
|
}
|
||||||
|
//装货状态
|
||||||
|
hyr.loading(lub);
|
||||||
|
//装货照片
|
||||||
|
up_image_z();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(装货):", s + s1);
|
||||||
|
new MessageUtils().showCenMessage(con, s1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传安联和交通厅,平台-卸货
|
||||||
|
*/
|
||||||
|
private void uploadInfo() {
|
||||||
|
|
||||||
|
//安联
|
||||||
|
if (sob.getData().getReportAlct() == 1) {
|
||||||
|
Location l = new Location();
|
||||||
|
l.setBaiduLongitude(latLng.longitude);
|
||||||
|
l.setBaiduLatitude(latLng.latitude);
|
||||||
|
l.setLocation(lgdu.getAddress());
|
||||||
|
l.setTime(Timer.getTimerT());
|
||||||
|
Log.e("-安联卸货信息-", gson.toJson(l));
|
||||||
|
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "卸货上传成功");
|
||||||
|
//交通厅
|
||||||
|
if (sob.getData().getReport() == 1) {
|
||||||
|
JTTProcess.stop(con, sob, "");
|
||||||
|
}
|
||||||
|
//卸货状态-平台
|
||||||
|
hyr.dischargeCargo(lub);
|
||||||
|
//卸货照片-安联
|
||||||
|
up_image();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(卸货):", s + s1);
|
||||||
|
new MessageUtils().showCenMessage(con, s1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
apply from: "compile.gradle"
|
apply from: "compile.gradle"
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = "1.5.0"
|
// ext.kotlin_version = "1.5.0"
|
||||||
// ext.kotlin_version = "1.6.10"
|
ext.kotlin_version = "1.6.10"
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter() // 这个
|
jcenter() // 这个
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ dependencies {
|
|||||||
api rootProject.ext.dependencies["Xpopup"]
|
api rootProject.ext.dependencies["Xpopup"]
|
||||||
api rootProject.ext.dependencies["Countdownview"]
|
api rootProject.ext.dependencies["Countdownview"]
|
||||||
// api rootProject.ext.dependencies["CheckVersionLib"]
|
// api rootProject.ext.dependencies["CheckVersionLib"]
|
||||||
// api rootProject.ext.dependencies["Bugly"]
|
api rootProject.ext.dependencies["Bugly"]
|
||||||
// api rootProject.ext.dependencies["Zxing"]
|
// api rootProject.ext.dependencies["Zxing"]
|
||||||
api rootProject.ext.dependencies["Multidex"]
|
api rootProject.ext.dependencies["Multidex"]
|
||||||
// api rootProject.ext.dependencies["FlycoTabLayout"]
|
// api rootProject.ext.dependencies["FlycoTabLayout"]
|
||||||
|
|||||||
Reference in New Issue
Block a user