Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cc86f031b7 | ||
|
|
bb85e8ace7 | ||
|
|
35a2329073 | ||
|
|
c6c0fdbb6f | ||
|
|
d561b3598a | ||
|
|
1f0613ffcf | ||
|
|
80a257273b | ||
|
|
5a846d220d | ||
|
|
736c73ea11 | ||
|
|
153d7c2c82 | ||
|
|
01bd0e03ff | ||
|
|
82b1413429 | ||
|
|
8b2007a11d | ||
|
|
d181d819b0 | ||
|
|
ae21a860b6 | ||
|
|
1042fbd283 | ||
|
|
781e58ab44 | ||
|
|
f1ffdd31af | ||
|
|
d053e4492f | ||
|
|
3b7a77c45b | ||
|
|
5cf861671b | ||
|
|
7fdb48817f | ||
|
|
496319c04b | ||
|
|
258058d86c | ||
|
|
cf94fa8573 | ||
|
|
86d3599110 | ||
|
|
23ca8f1411 | ||
|
|
e126ecb8e7 | ||
|
|
cfc32bfe66 | ||
|
|
7614dc4476 | ||
|
|
c9fcd9fb91 | ||
|
|
ab59be9f94 | ||
|
|
e59e2d0fa4 | ||
|
|
e41edf7b58 | ||
|
|
5d4389329d | ||
|
|
6fcaa21d57 | ||
|
|
041bcaf2ec | ||
|
|
291578cd72 | ||
|
|
b97d3dcb61 | ||
|
|
f0da8e0234 | ||
|
|
1ef4f3b9ca | ||
|
|
ab34920c8f | ||
|
|
63026819f8 | ||
|
|
83fc537c8d | ||
|
|
7a02706b75 | ||
|
|
8de8c92b79 | ||
|
|
d78ec09c04 | ||
|
|
40d344e245 | ||
|
|
866a46a7cb | ||
|
|
c6a4d3bca3 | ||
|
|
e4bdf1384f | ||
|
|
671ca60854 | ||
|
|
f0e7d63ae0 | ||
|
|
f648050328 | ||
|
|
c5f16d7d17 | ||
|
|
cabbe363a9 | ||
|
|
7d29c5ec89 | ||
|
|
bfbe7e9b5f | ||
|
|
6fc87c0d2e | ||
|
|
a7db2019ad | ||
|
|
d8f80ad07d | ||
|
|
f5e24e2273 | ||
|
|
f13815709d | ||
|
|
1b40375c3c | ||
|
|
ca76fd4cc3 | ||
|
|
61c22800f7 | ||
|
|
88144de31c | ||
|
|
deb11d4d99 | ||
|
|
9388a6ac87 | ||
|
|
0b2d42c090 | ||
|
|
77481c73f6 | ||
|
|
2da410bcd4 | ||
|
|
c6005ee9a1 | ||
|
|
65994b8eda | ||
|
|
d0df0bd42e |
+28
-20
@@ -2,8 +2,7 @@ plugins {
|
|||||||
id 'com.android.application'
|
id 'com.android.application'
|
||||||
id 'kotlin-android'
|
id 'kotlin-android'
|
||||||
id 'kotlin-kapt'
|
id 'kotlin-kapt'
|
||||||
id 'com.huawei.agconnect'
|
// id 'kotlin-android-extensions'
|
||||||
id 'kotlin-android-extensions'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
@@ -38,17 +37,17 @@ android {
|
|||||||
applicationId "com.arpa.hndahesudintocctmsdriver"
|
applicationId "com.arpa.hndahesudintocctmsdriver"
|
||||||
minSdkVersion 24
|
minSdkVersion 24
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 72
|
versionCode 75
|
||||||
versionName "3.4.2"
|
versionName "3.4.5"
|
||||||
flavorDimensions "CHANNEL_VALUE"
|
flavorDimensions "CHANNEL_VALUE"
|
||||||
flavorDimensions "app_icon"
|
flavorDimensions "app_icon"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
javaCompileOptions {
|
javaCompileOptions {
|
||||||
|
|
||||||
annotationProcessorOptions {
|
// annotationProcessorOptions {
|
||||||
includeCompileClasspath = true
|
// includeCompileClasspath = true
|
||||||
arguments = [moduleName: project.getName()]
|
// arguments = [moduleName: project.getName()]
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
ndk {
|
ndk {
|
||||||
@@ -83,17 +82,17 @@ android {
|
|||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
jvmTarget = '1.8'
|
jvmTarget = '1.8'
|
||||||
}
|
}
|
||||||
allprojects {
|
// allprojects {
|
||||||
repositories {
|
// repositories {
|
||||||
maven { url "https://jitpack.io" }
|
// maven { url "https://jitpack.io" }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
repositories {
|
// repositories {
|
||||||
flatDir {
|
// flatDir {
|
||||||
dirs 'libs'
|
// dirs 'libs'
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
productFlavors {
|
productFlavors {
|
||||||
qa {
|
qa {
|
||||||
@@ -157,6 +156,9 @@ android {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
||||||
|
// implementation(fileTree("libs"))
|
||||||
|
// implementation(name: 'mdp-release', ext: 'aar')
|
||||||
|
|
||||||
implementation 'com.google.android.material:material:1.2.1'
|
implementation 'com.google.android.material:material:1.2.1'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
|
||||||
implementation 'com.caverock:androidsvg-aar:1.3'
|
implementation 'com.caverock:androidsvg-aar:1.3'
|
||||||
@@ -186,7 +188,8 @@ dependencies {
|
|||||||
implementation 'com.alibaba:fastjson:1.2.61'
|
implementation 'com.alibaba:fastjson:1.2.61'
|
||||||
implementation 'org.bouncycastle:bcprov-jdk15on:1.55'
|
implementation 'org.bouncycastle:bcprov-jdk15on:1.55'
|
||||||
implementation 'org.apache.commons:commons-lang3:3.5'
|
implementation 'org.apache.commons:commons-lang3:3.5'
|
||||||
implementation(name: 'locationgd-androidx_2.1.0', ext: 'aar')//交通厅
|
// implementation(name: 'locationgd-androidx_2.1.0', ext: 'aar')//交通厅
|
||||||
|
implementation files('libs/locationgd-androidx_2.1.0.aar')
|
||||||
//安联
|
//安联
|
||||||
// implementation 'com.google.code.gson:gson:2.8.6'
|
// implementation 'com.google.code.gson:gson:2.8.6'
|
||||||
implementation 'com.loopj.android:android-async-http:1.4.9'
|
implementation 'com.loopj.android:android-async-http:1.4.9'
|
||||||
@@ -213,8 +216,10 @@ dependencies {
|
|||||||
//EventBus
|
//EventBus
|
||||||
implementation 'org.greenrobot:eventbus:3.1.1'
|
implementation 'org.greenrobot:eventbus:3.1.1'
|
||||||
//易签宝
|
//易签宝
|
||||||
implementation(name: 'EsignSDK', ext: 'aar')
|
// implementation(name: 'EsignSDK', ext: 'aar')
|
||||||
implementation 'pub.devrel:easypermissions:1.3.0'
|
implementation 'pub.devrel:easypermissions:1.3.0'
|
||||||
|
implementation files('libs/EsignSDK.aar')
|
||||||
|
|
||||||
|
|
||||||
implementation "com.squareup.retrofit2:retrofit:2.4.0"
|
implementation "com.squareup.retrofit2:retrofit:2.4.0"
|
||||||
// implementation "com.squareup.retrofit2:converter-gson:2.4.0"
|
// implementation "com.squareup.retrofit2:converter-gson:2.4.0"
|
||||||
@@ -229,6 +234,9 @@ dependencies {
|
|||||||
//
|
//
|
||||||
implementation 'com.github.getActivity:XToast:8.2'
|
implementation 'com.github.getActivity:XToast:8.2'
|
||||||
|
|
||||||
|
implementation files('libs/mdp-release.aar')
|
||||||
|
// implementation(name: 'mdp-release', ext: 'aar')
|
||||||
implementation project(path: ':mylibrary')
|
implementation project(path: ':mylibrary')
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Binary file not shown.
@@ -2,6 +2,7 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="com.arpa.hndahesudintocctmsdriver">
|
package="com.arpa.hndahesudintocctmsdriver">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.CALL_PHONE" />
|
<uses-permission android:name="android.permission.CALL_PHONE" />
|
||||||
<!-- 白名单 -->
|
<!-- 白名单 -->
|
||||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
||||||
@@ -93,14 +94,15 @@
|
|||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.PhotoCarActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.PhotoCarActivity"
|
||||||
android:windowSoftInputMode="adjustPan|stateHidden"
|
android:screenOrientation="portrait"
|
||||||
android:screenOrientation="portrait" />
|
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||||
<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.ShangChuangImgActivity"
|
android:name=".ui.home.shangchuan.ShangChuangImgActivity"
|
||||||
android:screenOrientation="portrait">
|
android:screenOrientation="portrait"
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.nfc.action.TAG_DISCOVERED" />
|
<action android:name="android.nfc.action.TAG_DISCOVERED" />
|
||||||
@@ -113,8 +115,24 @@
|
|||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivityBC"
|
android:name=".ui.home.shangchuan.ShangChuangImgNewActivity"
|
||||||
android:screenOrientation="portrait">
|
android:screenOrientation="portrait"
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
|
<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=".ui.home.shangchuan.ShangChuangImgActivityBC"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.nfc.action.TAG_DISCOVERED" />
|
<action android:name="android.nfc.action.TAG_DISCOVERED" />
|
||||||
@@ -128,8 +146,9 @@
|
|||||||
|
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity2"
|
android:name=".ui.home.shangchuan.ShangChuangImgActivity2"
|
||||||
android:screenOrientation="portrait">
|
android:screenOrientation="portrait"
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.nfc.action.TAG_DISCOVERED" />
|
<action android:name="android.nfc.action.TAG_DISCOVERED" />
|
||||||
@@ -161,11 +180,16 @@
|
|||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity"
|
||||||
android:windowSoftInputMode="adjustPan|stateHidden"
|
android:screenOrientation="portrait"
|
||||||
android:screenOrientation="portrait"/>
|
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.AddCarSuccActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.AddCarSuccActivity"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
|
<activity
|
||||||
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.FaceSuccActivity"
|
||||||
|
android:exported="true"
|
||||||
|
android:screenOrientation="portrait" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
@@ -198,6 +222,7 @@
|
|||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.StartYunDanActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.StartYunDanActivity"
|
||||||
|
android:launchMode="singleTop"
|
||||||
android:screenOrientation="portrait">
|
android:screenOrientation="portrait">
|
||||||
|
|
||||||
</activity>
|
</activity>
|
||||||
@@ -214,6 +239,10 @@
|
|||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.web.WebActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.web.WebActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||||
|
<activity
|
||||||
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.web.WebOnlyOneActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.web.WebKfActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.web.WebKfActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
@@ -243,6 +272,12 @@
|
|||||||
android:name="com.alct.mdp.MDPLocationService"
|
android:name="com.alct.mdp.MDPLocationService"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:process=":mdpLocation_v1" />
|
android:process=":mdpLocation_v1" />
|
||||||
|
|
||||||
|
<service
|
||||||
|
android:name="com.express.mdp.GpsService"
|
||||||
|
android:foregroundServiceType="location"
|
||||||
|
android:label="GPS服务"
|
||||||
|
android:priority="1000" />
|
||||||
<service
|
<service
|
||||||
android:name="com.baidu.location.f"
|
android:name="com.baidu.location.f"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
@@ -349,7 +384,8 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity android:name=".ui.NFCActivity">
|
<activity android:name=".ui.NFCActivity"
|
||||||
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.nfc.action.TAG_DISCOVERED" />
|
<action android:name="android.nfc.action.TAG_DISCOVERED" />
|
||||||
|
|
||||||
@@ -362,10 +398,12 @@
|
|||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".H5Activity"
|
android:name=".H5Activity"
|
||||||
|
android:launchMode="singleTask"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:launchMode="singleTask">
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
|
||||||
@@ -377,16 +415,24 @@
|
|||||||
android:host="demo"
|
android:host="demo"
|
||||||
android:path="/realBack"
|
android:path="/realBack"
|
||||||
android:scheme="esign" />
|
android:scheme="esign" />
|
||||||
|
|
||||||
|
<data
|
||||||
|
android:host="driver"
|
||||||
|
android:path="/realBack"
|
||||||
|
android:port="8088"
|
||||||
|
android:scheme="dahe" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".H5Activity2"
|
android:name=".H5Activity2"
|
||||||
|
android:launchMode="singleTask"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:launchMode="singleTask">
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
|
||||||
|
|||||||
@@ -41,9 +41,11 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.cuspop.SimCenterPop;
|
import com.arpa.hndahesudintocctmsdriver.cuspop.SimCenterPop;
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.FaceEvent;
|
import com.arpa.hndahesudintocctmsdriver.event.FaceEvent;
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.UserRequset;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.UiAuxiliary;
|
import com.arpa.hndahesudintocctmsdriver.ui.UiAuxiliary;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.ui.auth.FaceSuccActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.home.StartYunDanActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.home.StartYunDanActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||||
import com.dahe.mylibrary.utils.ActivityUtils;
|
import com.dahe.mylibrary.utils.ActivityUtils;
|
||||||
@@ -209,6 +211,15 @@ public class H5Activity extends AppCompatActivity {
|
|||||||
if (uri != null) {
|
if (uri != null) {
|
||||||
// 芝麻认证刷脸结束返回获取后续操作页面地址
|
// 芝麻认证刷脸结束返回获取后续操作页面地址
|
||||||
// String callbackUrl = uri.getQueryParameter("callback");
|
// String callbackUrl = uri.getQueryParameter("callback");
|
||||||
|
String urlString = uri.toString();
|
||||||
|
if ("dahe://driver:8088/realBack".equals(urlString)) {
|
||||||
|
Intent in = new Intent(ctx, FaceSuccActivity.class);
|
||||||
|
in.putExtra("isGoCar", true);
|
||||||
|
startActivity(in);
|
||||||
|
ActivityUtils.finishToActivity(MainActivity.class, false);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
String callbackUrl = uri.getQueryParameter("realnameUrl");
|
String callbackUrl = uri.getQueryParameter("realnameUrl");
|
||||||
if (!TextUtils.isEmpty(callbackUrl)) {
|
if (!TextUtils.isEmpty(callbackUrl)) {
|
||||||
@@ -223,13 +234,23 @@ public class H5Activity extends AppCompatActivity {
|
|||||||
String url = intent.getStringExtra("url");
|
String url = intent.getStringExtra("url");
|
||||||
viewFile = intent.getBooleanExtra("view_file", false);
|
viewFile = intent.getBooleanExtra("view_file", false);
|
||||||
if (url.startsWith("alipay")) {
|
if (url.startsWith("alipay")) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Intent intent2 = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
Intent intent2 = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||||
|
intent2.putExtra("isGoCar", isGoCar);
|
||||||
startActivity(intent2);
|
startActivity(intent2);
|
||||||
return;
|
return;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
|
// }else if (url.startsWith("https://agreement.dahehuoyun.com/#/1ba5c216/912f4c9587/5eb5184653/6ef9")) {
|
||||||
|
} else if (url.startsWith("https://agreement.dahehuoyun.com")) {
|
||||||
|
Intent in = new Intent(ctx, FaceSuccActivity.class);
|
||||||
|
startActivity(in);
|
||||||
|
if (isGoCar) {
|
||||||
|
ActivityUtils.finishToActivity(MainActivity.class, false);
|
||||||
|
} else {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (curUrl == null) {
|
if (curUrl == null) {
|
||||||
curUrl = url;
|
curUrl = url;
|
||||||
@@ -249,17 +270,30 @@ 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 (uri.getScheme().equals("http") || uri.getScheme().equals("https")) {
|
if (uri.getScheme().equals("http") || uri.getScheme().equals("https")) {
|
||||||
if (isGoCar&&url.startsWith("http://agreement.dahehuoyun.com/#/1ba5c216/912f4c9587/5eb5184653/6ef9")){
|
// if (url.startsWith("https://agreement.dahehuoyun.com/#/1ba5c216/912f4c9587/5eb5184653/6ef9")) {
|
||||||
isOk = true;
|
if (url.startsWith("https://agreement.dahehuoyun.com")) {
|
||||||
view.loadUrl(url);
|
Intent in = new Intent(ctx, FaceSuccActivity.class);
|
||||||
new MessageUtils().showSimCenPop(ctx, "个人信息上传成功,请添加车辆信息!", "去添加",() -> {
|
in.putExtra("isGoCar", isGoCar);
|
||||||
Intent in = new Intent(ctx, CertificatesActivity.class);
|
|
||||||
in.putExtra("index", 2);
|
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
|
if (isGoCar) {
|
||||||
ActivityUtils.finishToActivity(MainActivity.class, false);
|
ActivityUtils.finishToActivity(MainActivity.class, false);
|
||||||
});
|
} else {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if (isGoCar&&url.startsWith("https://agreement.dahehuoyun.com/#/1ba5c216/912f4c9587/5eb5184653/6ef9")){
|
||||||
|
// isOk = true;
|
||||||
|
// view.loadUrl(url);
|
||||||
|
// new MessageUtils().showSimCenPop(ctx, "个人信息上传成功,请添加车辆信息!", "去添加",() -> {
|
||||||
|
// Intent in = new Intent(ctx, CertificatesActivity.class);
|
||||||
|
// in.putExtra("index", 2);
|
||||||
|
// startActivity(in);
|
||||||
|
// ActivityUtils.finishToActivity(MainActivity.class,false);
|
||||||
|
// });
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
view.loadUrl(url);
|
view.loadUrl(url);
|
||||||
return true;
|
return true;
|
||||||
} else if (uri.getScheme().equals("js") || uri.getScheme().equals("jsbridge")) {
|
} else if (uri.getScheme().equals("js") || uri.getScheme().equals("jsbridge")) {
|
||||||
@@ -320,11 +354,11 @@ public class H5Activity extends AppCompatActivity {
|
|||||||
if (status) {
|
if (status) {
|
||||||
//认证成功返回
|
//认证成功返回
|
||||||
//认证成功返回
|
//认证成功返回
|
||||||
new Handler().postDelayed(() -> {
|
// new Handler().postDelayed(() -> {
|
||||||
FaceEvent he = new FaceEvent("刷脸成功");
|
// FaceEvent he = new FaceEvent("刷脸成功");
|
||||||
EventBus.getDefault().post(he);
|
// EventBus.getDefault().post(he);
|
||||||
finish();
|
// finish();
|
||||||
}, 800);
|
// }, 800);
|
||||||
Toast.makeText(H5Activity.this, "认证成功", Toast.LENGTH_LONG).show();
|
Toast.makeText(H5Activity.this, "认证成功", Toast.LENGTH_LONG).show();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,10 +99,19 @@ public class CarInfoBean2 implements Serializable {
|
|||||||
private String threeImageStatus;
|
private String threeImageStatus;
|
||||||
private String towAuality;
|
private String towAuality;
|
||||||
private String trailer;
|
private String trailer;
|
||||||
|
private String trailerId;
|
||||||
private String type;
|
private String type;
|
||||||
private String vehicleAxis;
|
private String vehicleAxis;
|
||||||
private String vehicleNumber;
|
private String vehicleNumber;
|
||||||
|
|
||||||
|
public String getTrailerId() {
|
||||||
|
return trailerId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTrailerId(String trailerId) {
|
||||||
|
this.trailerId = trailerId;
|
||||||
|
}
|
||||||
|
|
||||||
public String getAllAuality() {
|
public String getAllAuality() {
|
||||||
return allAuality;
|
return allAuality;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName GDImage
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/11/27 14:04
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public class GDImage extends GDLocation{
|
||||||
|
|
||||||
|
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
|
private String fileData;
|
||||||
|
|
||||||
|
private String fileExt;
|
||||||
|
|
||||||
|
private String imageTakenDate;
|
||||||
|
|
||||||
|
public String getFileName() {
|
||||||
|
return fileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFileName(String fileName) {
|
||||||
|
this.fileName = fileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFileData() {
|
||||||
|
return fileData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFileData(String fileData) {
|
||||||
|
this.fileData = fileData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFileExt() {
|
||||||
|
return fileExt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFileExt(String fileExt) {
|
||||||
|
this.fileExt = fileExt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImageTakenDate() {
|
||||||
|
return imageTakenDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImageTakenDate(String imageTakenDate) {
|
||||||
|
this.imageTakenDate = imageTakenDate;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName GDLocation
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/11/27 13:59
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public class GDLocation implements Serializable {
|
||||||
|
|
||||||
|
private double baiduLongitude;
|
||||||
|
private double baiduLatitude;
|
||||||
|
private String location;
|
||||||
|
private String time;
|
||||||
|
private double altitude;
|
||||||
|
private float speed;
|
||||||
|
private float direction;
|
||||||
|
private int interval;
|
||||||
|
|
||||||
|
public double getBaiduLongitude() {
|
||||||
|
return baiduLongitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBaiduLongitude(double baiduLongitude) {
|
||||||
|
this.baiduLongitude = baiduLongitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getBaiduLatitude() {
|
||||||
|
return baiduLatitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBaiduLatitude(double baiduLatitude) {
|
||||||
|
this.baiduLatitude = baiduLatitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLocation() {
|
||||||
|
return location;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLocation(String location) {
|
||||||
|
this.location = location;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTime() {
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTime(String time) {
|
||||||
|
this.time = time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getAltitude() {
|
||||||
|
return altitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAltitude(double altitude) {
|
||||||
|
this.altitude = altitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getSpeed() {
|
||||||
|
return speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpeed(float speed) {
|
||||||
|
this.speed = speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getDirection() {
|
||||||
|
return direction;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDirection(float direction) {
|
||||||
|
this.direction = direction;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getInterval() {
|
||||||
|
return interval;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterval(int interval) {
|
||||||
|
this.interval = interval;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -83,6 +83,8 @@ public class HuoYuanDelBean {
|
|||||||
private String vehicleTypeName;
|
private String vehicleTypeName;
|
||||||
private int vehicleLength;
|
private int vehicleLength;
|
||||||
private String vehicleLengthName;
|
private String vehicleLengthName;
|
||||||
|
private String carNumber;
|
||||||
|
private String carId;
|
||||||
private String namedDrivers;
|
private String namedDrivers;
|
||||||
private String requirement;
|
private String requirement;
|
||||||
private String totalFreight;
|
private String totalFreight;
|
||||||
@@ -97,6 +99,23 @@ public class HuoYuanDelBean {
|
|||||||
private Object contactName;
|
private Object contactName;
|
||||||
private Object contactPhone;
|
private Object contactPhone;
|
||||||
|
|
||||||
|
|
||||||
|
public String getCarNumber() {
|
||||||
|
return carNumber == null ? "" : carNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCarNumber(String carNumber) {
|
||||||
|
this.carNumber = carNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCarId() {
|
||||||
|
return carId == null ? "" : carId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCarId(String carId) {
|
||||||
|
this.carId = carId;
|
||||||
|
}
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.constant;
|
||||||
|
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hlh
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2022/1/10 11:34
|
||||||
|
* @description:交通厅参数
|
||||||
|
*/
|
||||||
|
public class NewLJConstant {
|
||||||
|
|
||||||
|
public final static String ENTER_PRISE_CODE ="E0019169";
|
||||||
|
|
||||||
|
public final static String ENTER_PRISE_IDENTITY = BuildConfig.isTest?"95033cc3492e420d83d7f09eea1400ac":"9179388b0e0847e1862d6400f9cbc778";
|
||||||
|
|
||||||
|
public final static String ENTER_PRISE_KEY =BuildConfig.isTest?"e9844a9b0bba417e89cb8623489abd2f":"156d724e9701420198fcbd52cb1ca529";
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,20 +1,12 @@
|
|||||||
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 android.widget.TextView
|
||||||
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.pop_message_center.view.*
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,9 +30,14 @@ class MessagePop(context: Context) : CenterPopupView(context), View.OnClickListe
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun getImplLayoutId() = R.layout.pop_message_center
|
override fun getImplLayoutId() = R.layout.pop_message_center
|
||||||
|
private lateinit var tvPhone : TextView
|
||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
super.onCreate()
|
super.onCreate()
|
||||||
|
val tvCancel = findViewById<View>(R.id.tvCancel) as TextView
|
||||||
|
val tvOk = findViewById<View>(R.id.tvOk) as TextView
|
||||||
|
tvPhone = findViewById<View>(R.id.tvPhone) as TextView
|
||||||
|
val tvContent = findViewById<View>(R.id.tvContent) as TextView
|
||||||
|
val tvMessage2 = findViewById<View>(R.id.tvMessage2) as TextView
|
||||||
tvCancel.setOnClickListener(this)
|
tvCancel.setOnClickListener(this)
|
||||||
tvOk.setOnClickListener(this)
|
tvOk.setOnClickListener(this)
|
||||||
tvPhone.setOnClickListener(this)
|
tvPhone.setOnClickListener(this)
|
||||||
@@ -55,15 +52,15 @@ 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)){
|
// 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{
|
// }else{
|
||||||
ToastUtils.showToast(context,"请开启电话权限")
|
// ToastUtils.showToast(context,"请开启电话权限")
|
||||||
}
|
// }
|
||||||
|
|
||||||
// BaseUtils.callPhone(content as Activity, tvPhone.text.toString())
|
// BaseUtils.callPhone(content as Activity, tvPhone.text.toString())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,9 @@ package com.arpa.hndahesudintocctmsdriver.cuspop
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import android.widget.TextView
|
||||||
import com.arpa.hndahesudintocctmsdriver.R
|
import com.arpa.hndahesudintocctmsdriver.R
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity
|
|
||||||
import com.lxj.xpopup.core.CenterPopupView
|
import com.lxj.xpopup.core.CenterPopupView
|
||||||
import kotlinx.android.synthetic.main.pop_sim_center.view.*
|
|
||||||
import org.bouncycastle.jcajce.provider.symmetric.Rijndael
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -33,6 +31,10 @@ class SimCenterPop(context: Context) : CenterPopupView(context), View.OnClickLis
|
|||||||
|
|
||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
super.onCreate()
|
super.onCreate()
|
||||||
|
val tvCancel = findViewById<View>(R.id.tvCancel) as TextView
|
||||||
|
val tvOk = findViewById<View>(R.id.tvOk) as TextView
|
||||||
|
val tvContent = findViewById<View>(R.id.tvContent) as TextView
|
||||||
|
|
||||||
tvCancel.text = titleLeft
|
tvCancel.text = titleLeft
|
||||||
tvOk.text = titleReft
|
tvOk.text = titleReft
|
||||||
tvCancel.setOnClickListener(this)
|
tvCancel.setOnClickListener(this)
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.cuspop
|
package com.arpa.hndahesudintocctmsdriver.cuspop
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.view.View
|
||||||
|
import android.widget.TextView
|
||||||
import com.arpa.hndahesudintocctmsdriver.R
|
import com.arpa.hndahesudintocctmsdriver.R
|
||||||
import com.lxj.xpopup.core.PositionPopupView
|
import com.lxj.xpopup.core.PositionPopupView
|
||||||
import com.lxj.xpopup.enums.DragOrientation
|
import com.lxj.xpopup.enums.DragOrientation
|
||||||
import kotlinx.android.synthetic.main.popup_qq_msg.view.tvMessage
|
|
||||||
import kotlinx.android.synthetic.main.popup_qq_msg.view.tvTitle
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description: 自定义自由定位Position弹窗
|
* Description: 自定义自由定位Position弹窗
|
||||||
@@ -30,6 +30,9 @@ class TopMsgPopup(context: Context,title:String, message: String) : PositionPopu
|
|||||||
|
|
||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
super.onCreate()
|
super.onCreate()
|
||||||
|
val tvMessage = findViewById<View>(R.id.tvMessage) as TextView
|
||||||
|
val tvTitle = findViewById<View>(R.id.tvTitle) as TextView
|
||||||
|
|
||||||
tvMessage.text = message
|
tvMessage.text = message
|
||||||
tvTitle.text = title
|
tvTitle.text = title
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,10 @@ import com.arpa.hndahesudintocctmsdriver.App;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||||
import com.arpa.hndahesudintocctmsdriver.parts.AuthParts;
|
import com.arpa.hndahesudintocctmsdriver.parts.AuthParts;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.NewLJUtils;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.msg.MsgUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.msg.MsgUtil;
|
||||||
|
import com.dahe.mylibrary.callback.OnGDDownloadResultListener;
|
||||||
|
import com.dahe.mylibrary.callback.OnGDResultListener;
|
||||||
import com.dahe.mylibrary.utils.ToastUtils;
|
import com.dahe.mylibrary.utils.ToastUtils;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.DriverAuthDataBean;
|
import com.arpa.hndahesudintocctmsdriver.bean.DriverAuthDataBean;
|
||||||
@@ -47,27 +50,49 @@ public class ALProcess {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Identity idy=new Identity();
|
// Identity idy=new Identity();
|
||||||
//企业代码
|
// //企业代码
|
||||||
idy.setEnterpriseCode(BuildConfig.isTest?ENTERPRISE_CODE_TEXT:ENTERPRISE_CODE);
|
// idy.setEnterpriseCode(BuildConfig.isTest?ENTERPRISE_CODE_TEXT:ENTERPRISE_CODE);
|
||||||
//企业app的身份码
|
// //企业app的身份码
|
||||||
idy.setAppIdentity(BuildConfig.isTest?APP_IDENTITY_TEXT:APP_IDENTITY);
|
// idy.setAppIdentity(BuildConfig.isTest?APP_IDENTITY_TEXT:APP_IDENTITY);
|
||||||
//企业app验证码
|
// //企业app验证码
|
||||||
idy.setAppKey(BuildConfig.isTest?APP_KEY_TEXT:APP_KEY);
|
// idy.setAppKey(BuildConfig.isTest?APP_KEY_TEXT:APP_KEY);
|
||||||
//司机身份证
|
// //司机身份证
|
||||||
idy.setDriverIdentity(auth.getData().getIdcard());
|
// idy.setDriverIdentity(auth.getData().getIdcard());
|
||||||
//idy.setDriverIdentity("410725198311042012");
|
// //idy.setDriverIdentity("410725198311042012");
|
||||||
MDPLocationCollectionManager.register(con, idy, new OnResultListener() {
|
// MDPLocationCollectionManager.register(con, idy, new OnResultListener() {
|
||||||
|
// @Override
|
||||||
|
// public void onSuccess() {
|
||||||
|
// Log.e("--success--","验证成功");
|
||||||
|
// getFq(con);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onFailure(java.lang.String s, java.lang.String s1) {
|
||||||
|
// Log.e("--error--",s+s1+"");
|
||||||
|
// new MessageUtils().showCenMessage(con,s1);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
NewLJUtils.getInstance().getToken(con, new OnGDResultListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
Log.e("--success--","验证成功");
|
NewLJUtils.getInstance().confirmInvoice(con, new OnGDResultListener() {
|
||||||
getFq(con);
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(java.lang.String s, java.lang.String s1) {
|
public void onFailure(String var1, String var2) {
|
||||||
Log.e("--error--",s+s1+"");
|
|
||||||
new MessageUtils().showCenMessage(con,s1);
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String var1, String var2) {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -133,31 +158,69 @@ public class ALProcess {
|
|||||||
|
|
||||||
public static void verification(Context con,Handler hd){
|
public static void verification(Context con,Handler hd){
|
||||||
DriverAuthDataBean auth= AuthParts.getAuth(con);
|
DriverAuthDataBean auth= AuthParts.getAuth(con);
|
||||||
Identity idy=new Identity();
|
if (auth==null){
|
||||||
//企业代码
|
return;
|
||||||
idy.setEnterpriseCode(BuildConfig.isTest?ENTERPRISE_CODE_TEXT:ENTERPRISE_CODE);
|
}
|
||||||
//企业app的身份码
|
// Identity idy=new Identity();
|
||||||
idy.setAppIdentity(BuildConfig.isTest?APP_IDENTITY_TEXT:APP_IDENTITY);
|
// //企业代码
|
||||||
//企业app验证码
|
// idy.setEnterpriseCode(BuildConfig.isTest?ENTERPRISE_CODE_TEXT:ENTERPRISE_CODE);
|
||||||
idy.setAppKey(BuildConfig.isTest?APP_KEY_TEXT:APP_KEY);
|
// //企业app的身份码
|
||||||
//司机身份证
|
// idy.setAppIdentity(BuildConfig.isTest?APP_IDENTITY_TEXT:APP_IDENTITY);
|
||||||
idy.setDriverIdentity(auth.getData().getIdcard());
|
// //企业app验证码
|
||||||
//idy.setDriverIdentity("410725198311042012");
|
// idy.setAppKey(BuildConfig.isTest?APP_KEY_TEXT:APP_KEY);
|
||||||
MDPLocationCollectionManager.register(con, idy, new OnResultListener() {
|
// //司机身份证
|
||||||
|
// idy.setDriverIdentity(auth.getData().getIdcard());
|
||||||
|
// //idy.setDriverIdentity("410725198311042012");
|
||||||
|
// MDPLocationCollectionManager.register(con, idy, new OnResultListener() {
|
||||||
|
// @Override
|
||||||
|
// public void onSuccess() {
|
||||||
|
// MsgUtil.addHdMsgWatBody(hd, 1111,"认证成功");
|
||||||
|
// Log.e("--success--","验证成功");
|
||||||
|
// getFq(con);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onFailure(java.lang.String s, java.lang.String s1) {
|
||||||
|
// Log.e("--error--",s+s1+"");
|
||||||
|
// MsgUtil.addHdMsgWatBody(hd, 2222,s1);
|
||||||
|
//// new MessageUtils().showCenMessage(con,s1);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
NewLJUtils.getInstance().searchDriver(con, auth.getData().getIdcard(), new OnGDDownloadResultListener(){
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess(String var1) {
|
||||||
MsgUtil.addHdMsgWatBody(hd, 1111,"认证成功");
|
MsgUtil.addHdMsgWatBody(hd, 1111,"认证成功");
|
||||||
Log.e("--success--","验证成功");
|
|
||||||
getFq(con);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(java.lang.String s, java.lang.String s1) {
|
public void onFailure(String var1, String var2) {
|
||||||
Log.e("--error--",s+s1+"");
|
MsgUtil.addHdMsgWatBody(hd, 2222,var2);
|
||||||
MsgUtil.addHdMsgWatBody(hd, 2222,s1);
|
|
||||||
// new MessageUtils().showCenMessage(con,s1);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// NewLJUtils.getInstance().getToken(con, new OnGDResultListener() {
|
||||||
|
// @Override
|
||||||
|
// public void onSuccess() {
|
||||||
|
// NewLJUtils.getInstance().confirmInvoice(con, new OnGDResultListener() {
|
||||||
|
// @Override
|
||||||
|
// public void onSuccess() {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onFailure(String var1, String var2) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onFailure(String var1, String var2) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,6 +80,12 @@ public class UserRequset {
|
|||||||
RequestUtil.start(1, "userdata", re, con, hd);
|
RequestUtil.start(1, "userdata", re, con, hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//账户信息
|
||||||
|
public void User2() {
|
||||||
|
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getUserUrl(), ""), getToken(con), con);
|
||||||
|
RequestUtil.start(1, "userdata2", re, con, hd);
|
||||||
|
}
|
||||||
|
|
||||||
//司机认证信息
|
//司机认证信息
|
||||||
public void driverAuthData() {
|
public void driverAuthData() {
|
||||||
String mt = "{}";
|
String mt = "{}";
|
||||||
|
|||||||
+40
@@ -0,0 +1,40 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.request.bean.newlj;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName InvoiceBean
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/11/25 17:06
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public class InvoiceBean implements Serializable {
|
||||||
|
private String driverIdentification;
|
||||||
|
private String driverInvoiceCode;
|
||||||
|
private String enterpriseCode;
|
||||||
|
|
||||||
|
|
||||||
|
public String getDriverIdentification() {
|
||||||
|
return driverIdentification;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDriverIdentification(String driverIdentification) {
|
||||||
|
this.driverIdentification = driverIdentification;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDriverInvoiceCode() {
|
||||||
|
return driverInvoiceCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDriverInvoiceCode(String driverInvoiceCode) {
|
||||||
|
this.driverInvoiceCode = driverInvoiceCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEnterpriseCode() {
|
||||||
|
return enterpriseCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnterpriseCode(String enterpriseCode) {
|
||||||
|
this.enterpriseCode = enterpriseCode;
|
||||||
|
}
|
||||||
|
}
|
||||||
+135
@@ -0,0 +1,135 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.request.bean.newlj;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName InvoicesBean
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/11/29 13:08
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public class InvoicesBean implements Serializable {
|
||||||
|
private String totalPage;
|
||||||
|
private String totalCount;
|
||||||
|
private String pageSize;
|
||||||
|
private String currentPage;
|
||||||
|
private String sortField;
|
||||||
|
private String sortDirection;
|
||||||
|
private List<DataDTO> driverInvoices;
|
||||||
|
|
||||||
|
public String getTotalPage() {
|
||||||
|
return totalPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalPage(String totalPage) {
|
||||||
|
this.totalPage = totalPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTotalCount() {
|
||||||
|
return totalCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalCount(String totalCount) {
|
||||||
|
this.totalCount = totalCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPageSize() {
|
||||||
|
return pageSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPageSize(String pageSize) {
|
||||||
|
this.pageSize = pageSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCurrentPage() {
|
||||||
|
return currentPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrentPage(String currentPage) {
|
||||||
|
this.currentPage = currentPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSortField() {
|
||||||
|
return sortField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSortField(String sortField) {
|
||||||
|
this.sortField = sortField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSortDirection() {
|
||||||
|
return sortDirection;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSortDirection(String sortDirection) {
|
||||||
|
this.sortDirection = sortDirection;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<DataDTO> getDriverInvoices() {
|
||||||
|
return driverInvoices;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDriverInvoices(List<DataDTO> driverInvoices) {
|
||||||
|
this.driverInvoices = driverInvoices;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class DataDTO{
|
||||||
|
|
||||||
|
private String taxAmount;
|
||||||
|
private String totalAmount;
|
||||||
|
private String invoiceReceiverName;
|
||||||
|
private String totalAmountIncludeTax;
|
||||||
|
private String driverInvoiceCode;
|
||||||
|
private String taxRate;
|
||||||
|
|
||||||
|
|
||||||
|
public String getTaxAmount() {
|
||||||
|
return taxAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaxAmount(String taxAmount) {
|
||||||
|
this.taxAmount = taxAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTotalAmount() {
|
||||||
|
return totalAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalAmount(String totalAmount) {
|
||||||
|
this.totalAmount = totalAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInvoiceReceiverName() {
|
||||||
|
return invoiceReceiverName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInvoiceReceiverName(String invoiceReceiverName) {
|
||||||
|
this.invoiceReceiverName = invoiceReceiverName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTotalAmountIncludeTax() {
|
||||||
|
return totalAmountIncludeTax;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalAmountIncludeTax(String totalAmountIncludeTax) {
|
||||||
|
this.totalAmountIncludeTax = totalAmountIncludeTax;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDriverInvoiceCode() {
|
||||||
|
return driverInvoiceCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDriverInvoiceCode(String driverInvoiceCode) {
|
||||||
|
this.driverInvoiceCode = driverInvoiceCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaxRate() {
|
||||||
|
return taxRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaxRate(String taxRate) {
|
||||||
|
this.taxRate = taxRate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+41
@@ -0,0 +1,41 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.request.bean.newlj;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName LjTokenBean
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/11/25 10:05
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public class LjTokenBean implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
private String enterpriseCode;
|
||||||
|
private String enterpriseIdentity;
|
||||||
|
private String enterpriseKey;
|
||||||
|
|
||||||
|
public String getEnterpriseCode() {
|
||||||
|
return enterpriseCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnterpriseCode(String enterpriseCode) {
|
||||||
|
this.enterpriseCode = enterpriseCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEnterpriseIdentity() {
|
||||||
|
return enterpriseIdentity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnterpriseIdentity(String enterpriseIdentity) {
|
||||||
|
this.enterpriseIdentity = enterpriseIdentity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEnterpriseKey() {
|
||||||
|
return enterpriseKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnterpriseKey(String enterpriseKey) {
|
||||||
|
this.enterpriseKey = enterpriseKey;
|
||||||
|
}
|
||||||
|
}
|
||||||
+109
@@ -0,0 +1,109 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.request.bean.newlj;
|
||||||
|
|
||||||
|
import com.alct.mdp.model.Location;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.GDLocation;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName PickupBean
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/11/25 10:19
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public class PickupBean implements Serializable {
|
||||||
|
|
||||||
|
private String shipmentCode;
|
||||||
|
private String enterpriseCode;
|
||||||
|
private GDLocation location;
|
||||||
|
|
||||||
|
public String getShipmentCode() {
|
||||||
|
return shipmentCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShipmentCode(String shipmentCode) {
|
||||||
|
this.shipmentCode = shipmentCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEnterpriseCode() {
|
||||||
|
return enterpriseCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnterpriseCode(String enterpriseCode) {
|
||||||
|
this.enterpriseCode = enterpriseCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GDLocation getLocation() {
|
||||||
|
return location;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLocation(GDLocation location) {
|
||||||
|
this.location = location;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class LocationDTO {
|
||||||
|
private String time;
|
||||||
|
private double baiduLatitude;
|
||||||
|
private double baiduLongitude;
|
||||||
|
private double altitude;
|
||||||
|
private double speed;
|
||||||
|
private double bearing;
|
||||||
|
private String location;
|
||||||
|
|
||||||
|
public String getTime() {
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTime(String time) {
|
||||||
|
this.time = time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getBaiduLatitude() {
|
||||||
|
return baiduLatitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBaiduLatitude(double baiduLatitude) {
|
||||||
|
this.baiduLatitude = baiduLatitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getBaiduLongitude() {
|
||||||
|
return baiduLongitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBaiduLongitude(double baiduLongitude) {
|
||||||
|
this.baiduLongitude = baiduLongitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getAltitude() {
|
||||||
|
return altitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAltitude(double altitude) {
|
||||||
|
this.altitude = altitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getSpeed() {
|
||||||
|
return speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpeed(double speed) {
|
||||||
|
this.speed = speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getBearing() {
|
||||||
|
return bearing;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBearing(double bearing) {
|
||||||
|
this.bearing = bearing;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLocation() {
|
||||||
|
return location;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLocation(String location) {
|
||||||
|
this.location = location;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+31
@@ -0,0 +1,31 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.request.bean.newlj;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName ShipmentStatusBean
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/11/25 17:16
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public class ShipmentStatusBean implements Serializable {
|
||||||
|
private String shipmentCode;
|
||||||
|
private String enterpriseCode;
|
||||||
|
|
||||||
|
|
||||||
|
public String getShipmentCode() {
|
||||||
|
return shipmentCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShipmentCode(String shipmentCode) {
|
||||||
|
this.shipmentCode = shipmentCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEnterpriseCode() {
|
||||||
|
return enterpriseCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnterpriseCode(String enterpriseCode) {
|
||||||
|
this.enterpriseCode = enterpriseCode;
|
||||||
|
}
|
||||||
|
}
|
||||||
+118
@@ -0,0 +1,118 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.request.bean.newlj;
|
||||||
|
|
||||||
|
import com.alct.mdp.model.Image;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.GDImage;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName UpimgBean
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/11/25 14:36
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public class UpimgBean implements Serializable {
|
||||||
|
|
||||||
|
private String shipmentCode;
|
||||||
|
private String enterpriseCode;
|
||||||
|
private GDImage image;
|
||||||
|
|
||||||
|
public String getShipmentCode() {
|
||||||
|
return shipmentCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShipmentCode(String shipmentCode) {
|
||||||
|
this.shipmentCode = shipmentCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEnterpriseCode() {
|
||||||
|
return enterpriseCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnterpriseCode(String enterpriseCode) {
|
||||||
|
this.enterpriseCode = enterpriseCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GDImage getImage() {
|
||||||
|
return image;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImage(GDImage image) {
|
||||||
|
this.image = image;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ImageDTO {
|
||||||
|
private String fileName;
|
||||||
|
private String fileExt;
|
||||||
|
private double baiduLongitude;
|
||||||
|
private double baiduLatitude;
|
||||||
|
private String location;
|
||||||
|
private String imageTakenDate;
|
||||||
|
private String time;
|
||||||
|
private String fileData;
|
||||||
|
|
||||||
|
public String getFileName() {
|
||||||
|
return fileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFileName(String fileName) {
|
||||||
|
this.fileName = fileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFileExt() {
|
||||||
|
return fileExt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFileExt(String fileExt) {
|
||||||
|
this.fileExt = fileExt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getBaiduLongitude() {
|
||||||
|
return baiduLongitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBaiduLongitude(double baiduLongitude) {
|
||||||
|
this.baiduLongitude = baiduLongitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getBaiduLatitude() {
|
||||||
|
return baiduLatitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBaiduLatitude(double baiduLatitude) {
|
||||||
|
this.baiduLatitude = baiduLatitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLocation() {
|
||||||
|
return location;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLocation(String location) {
|
||||||
|
this.location = location;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImageTakenDate() {
|
||||||
|
return imageTakenDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImageTakenDate(String imageTakenDate) {
|
||||||
|
this.imageTakenDate = imageTakenDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTime() {
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTime(String time) {
|
||||||
|
this.time = time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFileData() {
|
||||||
|
return fileData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFileData(String fileData) {
|
||||||
|
this.fileData = fileData;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,11 +4,23 @@ package com.arpa.hndahesudintocctmsdriver.request.net;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.UserBean;
|
import com.arpa.hndahesudintocctmsdriver.bean.UserBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.LoginRegInputBean;
|
import com.arpa.hndahesudintocctmsdriver.request.bean.LoginRegInputBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.InvoiceBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.InvoicesBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.LjTokenBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.PickupBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.ShipmentStatusBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.UpimgBean;
|
||||||
import com.dahe.mylibrary.net.CommonResponseBean;
|
import com.dahe.mylibrary.net.CommonResponseBean;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
import io.reactivex.rxjava3.core.Observable;
|
import io.reactivex.rxjava3.core.Observable;
|
||||||
|
import retrofit2.Call;
|
||||||
import retrofit2.http.Body;
|
import retrofit2.http.Body;
|
||||||
|
import retrofit2.http.GET;
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
|
import retrofit2.http.PUT;
|
||||||
|
import retrofit2.http.Path;
|
||||||
import retrofit2.http.Query;
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -17,7 +29,7 @@ import retrofit2.http.Query;
|
|||||||
|
|
||||||
public interface Api {
|
public interface Api {
|
||||||
|
|
||||||
String BASE_URL = BuildConfig.BASE_URL;
|
String BASE_URL = BuildConfig.isTest? "http://api.kehui56.cn/api/v1/":"https://api.kehui56.com/api/v1/";
|
||||||
|
|
||||||
|
|
||||||
//获取版本
|
//获取版本
|
||||||
@@ -26,5 +38,119 @@ public interface Api {
|
|||||||
// @POST(BASE_URL+"/common/register")
|
// @POST(BASE_URL+"/common/register")
|
||||||
// Observable<CommonResponseBean> log(@Body LoginRegInputBean bean);
|
// Observable<CommonResponseBean> log(@Body LoginRegInputBean bean);
|
||||||
|
|
||||||
|
@POST(BASE_URL+"openapi/enterprises/login")
|
||||||
|
Observable<CommonResponseBean> getToken(@Body LjTokenBean bean);
|
||||||
|
|
||||||
|
@POST(BASE_URL+"openapi/enterprises/login")
|
||||||
|
Call<HashMap<String, String>> getRefreshToken(@Body LjTokenBean bean);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 刷新token
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@POST(BASE_URL+"openapi/enterprises/refresh-token/{refreshToken}")
|
||||||
|
Observable<CommonResponseBean> refreshToken(@Path("refreshToken") String refreshToken);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运单提货
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@POST(BASE_URL+"openapi/shipments/pickup")
|
||||||
|
Observable<CommonResponseBean> pickup(@Body PickupBean bean);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运单卸货
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@POST(BASE_URL+"openapi/shipments/unload")
|
||||||
|
Observable<CommonResponseBean> unload(@Body PickupBean bean);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运单签收
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@POST(BASE_URL+"openapi/shipments/sign")
|
||||||
|
Observable<CommonResponseBean> sign(@Body PickupBean bean);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运单回单
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@POST(BASE_URL+"openapi/shipments/pod")
|
||||||
|
Observable<CommonResponseBean> pod(@Body PickupBean bean);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运单提货照片上传
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@POST(BASE_URL+"openapi/shipments/uploadPickupImage")
|
||||||
|
Observable<CommonResponseBean> uploadPickupImage(@Body UpimgBean bean);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运单卸货照片上传
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@POST(BASE_URL+"openapi/shipments/uploadUnloadImage")
|
||||||
|
Observable<CommonResponseBean> uploadUnloadImage(@Body UpimgBean bean);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运单回单照片上传
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@POST(BASE_URL+"openapi/shipments/uploadPODImage")
|
||||||
|
Observable<CommonResponseBean> uploadPODImage(@Body UpimgBean bean);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同意发票申请
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PUT(BASE_URL+"openapi/confirmInvoice")
|
||||||
|
Observable<CommonResponseBean> confirmInvoice(@Body InvoiceBean bean);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 待同意发票列表获取
|
||||||
|
* @param enterpriseCodeParam
|
||||||
|
* @param driverIdentification
|
||||||
|
* @param currentPage
|
||||||
|
* @param pageSize
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET(BASE_URL+"openapi/getInvoices")
|
||||||
|
Observable<CommonResponseBean<InvoicesBean>> getInvoices(@Query("enterpriseCodeParam") String enterpriseCodeParam,
|
||||||
|
@Query("driverIdentification") String driverIdentification,
|
||||||
|
@Query("currentPage") int currentPage,
|
||||||
|
@Query("pageSize") int pageSize);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取运单状态
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@POST(BASE_URL+"/openapi/getShipmentStatus")
|
||||||
|
Observable<CommonResponseBean> getShipmentStatus(@Body ShipmentStatusBean bean);
|
||||||
|
|
||||||
|
@POST(BASE_URL+"/openapi/shipments/getPODImageNames")
|
||||||
|
Observable<CommonResponseBean> getPODImageNames(@Body ShipmentStatusBean bean);
|
||||||
|
|
||||||
|
|
||||||
|
@GET(BASE_URL+"/openapi/drivers")
|
||||||
|
Observable<CommonResponseBean> searchDriver(@Query("identityNo") String identityNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,114 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.request.net
|
||||||
|
|
||||||
|
import okhttp3.Interceptor
|
||||||
|
import okhttp3.Request
|
||||||
|
import okio.IOException
|
||||||
|
import retrofit2.Response
|
||||||
|
import java.util.concurrent.atomic.AtomicBoolean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName ApiInterceptor
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/11/29 17:05
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
class ApiInterceptor : Interceptor {
|
||||||
|
|
||||||
|
// 需要验证token的接口的路径集合
|
||||||
|
// private val checkTokenInterface = arrayListOf(
|
||||||
|
// "/example/user/info,
|
||||||
|
// "/example/user/info/edit"
|
||||||
|
// )
|
||||||
|
|
||||||
|
// 是否正在刷新token
|
||||||
|
// 使用AtomicBoolean,确保多线程中获取的值一致
|
||||||
|
// private var refreshingToken = AtomicBoolean(false)
|
||||||
|
//
|
||||||
|
// private val authHeaderKey = "token-key"
|
||||||
|
//
|
||||||
|
// // 当前token
|
||||||
|
// private var currentToken = "tokenValue"
|
||||||
|
|
||||||
|
// override fun intercept(chain: Interceptor.Chain): Response {
|
||||||
|
// 根据接口路径判断是否需要验证token
|
||||||
|
// val checkToken = checkTokenInterface.contains(chain.request().url.encodedPath)
|
||||||
|
// // 需要验证token则添加请求头,不需要则保持原样
|
||||||
|
// var request = if (checkToken) {
|
||||||
|
// chain.request().newBuilder()
|
||||||
|
// .addHeader(authHeaderKey, currentToken)
|
||||||
|
// .build()
|
||||||
|
// } else {
|
||||||
|
// chain.request()
|
||||||
|
// }
|
||||||
|
// // 获取响应
|
||||||
|
// var response = chain.proceed(request)
|
||||||
|
// if (checkToken) {
|
||||||
|
// // 需要验证token,处理响应,判断token是否过期
|
||||||
|
// response.body?.let { responseBody ->
|
||||||
|
// try {
|
||||||
|
// if (判断token过期的条件) {
|
||||||
|
// runBlocking {
|
||||||
|
// // 请求头中的token与currentToken仍然一样则需要刷新token
|
||||||
|
// // 确保多线程中不会重复刷新
|
||||||
|
// if (request.header(authHeaderKey) == currentToken){
|
||||||
|
// // 标记为正在刷新token
|
||||||
|
// if (refreshingToken.compareAndSet(false, true)) {
|
||||||
|
// refreshToken(chain).takeIf { it.isNotEmpty() && it.isNotBlank() }?.let { newToken ->
|
||||||
|
// // 保存newToken
|
||||||
|
// currentToken = newToken
|
||||||
|
// }
|
||||||
|
// // 标记为刷新token已结束
|
||||||
|
// refreshingToken.set(false)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// // async{}.await()会等待方法块内的代码执行完毕。
|
||||||
|
// // 等到refreshingToken为false时才会执行后续代码。
|
||||||
|
// if (async { stopRefreshingToken() }.await()) {
|
||||||
|
// // 携带newToken执行原请求获取响应
|
||||||
|
// response = chain.proceed(chain.request().newBuilder()
|
||||||
|
// .addHeader(authHeaderKey, currentToken)
|
||||||
|
// .build())
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// } catch (e: Exception) {
|
||||||
|
// e.printStackTrace()
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// // 返回最终的响应结果。
|
||||||
|
// // 刷新token也可能失败,此时返回原响应,可以让用户重新登录。
|
||||||
|
// return response
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// private fun refreshToken(chain: Interceptor.Chain): String {
|
||||||
|
// // 创建刷新token的请求
|
||||||
|
// val refreshTokenRequest = Request.Builder()
|
||||||
|
// .url("refresh token url")
|
||||||
|
// .addHeader(authHeaderKey, currentToken)
|
||||||
|
// .get()
|
||||||
|
// .build()
|
||||||
|
// return try {
|
||||||
|
// // 获取响应并解析获得新token
|
||||||
|
// val refreshTokenResponse = chain.proceed(refreshTokenRequest)
|
||||||
|
// refreshTokenResponse.token
|
||||||
|
// } catch (e: IOException) {
|
||||||
|
// // 失败时返回空字符串
|
||||||
|
// ""
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// private suspend fun stopRefreshingToken(): Boolean {
|
||||||
|
// return if (refreshingToken.get()) {
|
||||||
|
// // 仍在刷新token中,延迟1秒后再次执行此方法
|
||||||
|
// delay(1000)
|
||||||
|
// stopRefreshingToken()
|
||||||
|
// } else {
|
||||||
|
// true
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
override fun intercept(chain: Interceptor.Chain): okhttp3.Response {
|
||||||
|
TODO("Not yet implemented")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ public class BaseObserver<T> implements Observer<CommonResponseBean<T>> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(CommonResponseBean<T> tCommonResponseBean) {
|
public void onNext(CommonResponseBean<T> tCommonResponseBean) {
|
||||||
if (200==tCommonResponseBean.getCode()) {
|
if ("0".equals(tCommonResponseBean.getCode())) {
|
||||||
mRxHttpCallBack.onSuccess(tCommonResponseBean);
|
mRxHttpCallBack.onSuccess(tCommonResponseBean);
|
||||||
} else {
|
} else {
|
||||||
mRxHttpCallBack.onCodeError(mContext, tCommonResponseBean);
|
mRxHttpCallBack.onCodeError(mContext, tCommonResponseBean);
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.arpa.hndahesudintocctmsdriver.request.net;
|
|||||||
|
|
||||||
|
|
||||||
import com.dahe.mylibrary.CommonBaseLibrary;
|
import com.dahe.mylibrary.CommonBaseLibrary;
|
||||||
import com.dahe.mylibrary.net.JsonInterceptor;
|
|
||||||
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,119 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.request.net;
|
||||||
|
|
||||||
|
import static com.dahe.mylibrary.utils.BaseSPUtils.NEW_LJ_TOKEN;
|
||||||
|
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.App;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.constant.NewLJConstant;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.LjTokenBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.NewLJUtils;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
||||||
|
import com.dahe.mylibrary.CommonBaseLibrary;
|
||||||
|
import com.dahe.mylibrary.net.CommonResponseBean;
|
||||||
|
import com.dahe.mylibrary.net.ResultException;
|
||||||
|
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
|
import io.reactivex.rxjava3.core.Observable;
|
||||||
|
import kotlin.jvm.Synchronized;
|
||||||
|
import okhttp3.Interceptor;
|
||||||
|
import okhttp3.MediaType;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.Response;
|
||||||
|
import okhttp3.ResponseBody;
|
||||||
|
import okio.Buffer;
|
||||||
|
import okio.BufferedSource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* json的Interceptor
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class JsonInterceptor implements Interceptor {
|
||||||
|
private static final String TAG = "JsonInterceptor";
|
||||||
|
|
||||||
|
public JsonInterceptor() {
|
||||||
|
}
|
||||||
|
|
||||||
|
// 使用AtomicBoolean,确保多线程中获取的值一致
|
||||||
|
private AtomicBoolean refreshingToken = new AtomicBoolean(false);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Response intercept(Chain chain) throws IOException {
|
||||||
|
Request request = chain.request();
|
||||||
|
Response response = chain.proceed(request);
|
||||||
|
ResponseBody responseBody = response.body();
|
||||||
|
//为了不消耗buffer,我们这里使用source先获得buffer对象,然后clone()后使用
|
||||||
|
BufferedSource source = responseBody.source();
|
||||||
|
source.request(Long.MAX_VALUE); // Buffer the entire body.
|
||||||
|
//获得返回的数据
|
||||||
|
Buffer buffer = source.buffer();
|
||||||
|
//使用前clone()下,避免直接消耗
|
||||||
|
String responseBodyStr = buffer.clone().readString(Charset.forName("UTF-8"));
|
||||||
|
Log.i(TAG, "result-body= " + responseBodyStr);
|
||||||
|
try {
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject(responseBodyStr);
|
||||||
|
String str = jsonObject.optString("data");
|
||||||
|
int code = jsonObject.optInt("code");
|
||||||
|
if (401 == code) {
|
||||||
|
refreshToken();
|
||||||
|
// if (execute.body() != null) {
|
||||||
|
// String refreshToken = execute.body().get("token");
|
||||||
|
// SPUtils.put(App.getApp(), NEW_LJ_TOKEN, refreshToken);
|
||||||
|
// }
|
||||||
|
response.close();
|
||||||
|
try {
|
||||||
|
return chain.proceed(request);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (-1 == code) {
|
||||||
|
jsonObject.put("data", new JSONObject());
|
||||||
|
throw new ResultException();
|
||||||
|
} else {
|
||||||
|
if (TextUtils.isEmpty(str)) {
|
||||||
|
jsonObject.put("data", new JSONObject());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String data = jsonObject.toString();
|
||||||
|
responseBody = ResponseBody.create(MediaType.parse("application/json; charset=utf-8"), data);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
response = response.newBuilder().body(responseBody).build();
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Synchronized
|
||||||
|
private void refreshToken() throws IOException {
|
||||||
|
Api api = CommonBaseLibrary.getRetrofit().newBuilder()
|
||||||
|
.client(new OkHttpClient.Builder()
|
||||||
|
.connectTimeout(30, TimeUnit.SECONDS)
|
||||||
|
.readTimeout(30, TimeUnit.SECONDS)
|
||||||
|
.writeTimeout(30, TimeUnit.SECONDS)
|
||||||
|
.build())
|
||||||
|
// .addNetworkInterceptor(new TokenInterceptor())
|
||||||
|
.build().create(Api.class);
|
||||||
|
LjTokenBean ljTokenBean = new LjTokenBean();
|
||||||
|
ljTokenBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||||
|
ljTokenBean.setEnterpriseIdentity(NewLJConstant.ENTER_PRISE_IDENTITY);
|
||||||
|
ljTokenBean.setEnterpriseKey(NewLJConstant.ENTER_PRISE_KEY);
|
||||||
|
retrofit2.Response<HashMap<String, String>> execute = api.getRefreshToken(ljTokenBean).execute();
|
||||||
|
if (execute.body() != null) {
|
||||||
|
String refreshToken = execute.body().get("token");
|
||||||
|
SPUtils.put(App.getApp(), NEW_LJ_TOKEN, refreshToken);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+5
-2
@@ -1,5 +1,7 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.request.net;
|
package com.arpa.hndahesudintocctmsdriver.request.net;
|
||||||
|
|
||||||
|
import static com.dahe.mylibrary.utils.BaseSPUtils.NEW_LJ_TOKEN;
|
||||||
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
@@ -27,9 +29,10 @@ public class RequestHeadInterceptor implements Interceptor {
|
|||||||
@Override
|
@Override
|
||||||
public Response intercept(Chain chain) throws IOException {
|
public Response intercept(Chain chain) throws IOException {
|
||||||
Request.Builder builder = chain.request().newBuilder();
|
Request.Builder builder = chain.request().newBuilder();
|
||||||
if (!TextUtils.isEmpty(SPUtil.getSP(App.getApp(), LoginActivity.USER,LoginActivity.USER_TOKEN))) {
|
String token = SPUtils.get(App.getApp(), NEW_LJ_TOKEN, "").toString();
|
||||||
|
if (!TextUtils.isEmpty(token)) {
|
||||||
// builder.addHeader("Authorization", SPUtils.getUserInfo(App.getApp()).getToken());
|
// builder.addHeader("Authorization", SPUtils.getUserInfo(App.getApp()).getToken());
|
||||||
builder.addHeader("Authorization", SPUtil.getSP(App.getApp(), LoginActivity.USER,LoginActivity.USER_TOKEN));
|
builder.addHeader("token", token);
|
||||||
}
|
}
|
||||||
Request request = builder
|
Request request = builder
|
||||||
.addHeader("versionCode", AppUtils.getAppVersionCode() + "")
|
.addHeader("versionCode", AppUtils.getAppVersionCode() + "")
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import android.view.Window;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.UiAuxiliary;
|
import com.arpa.hndahesudintocctmsdriver.ui.UiAuxiliary;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.NewLJUtils;
|
||||||
import com.dahe.mylibrary.net.CommonResponseBean;
|
import com.dahe.mylibrary.net.CommonResponseBean;
|
||||||
import com.dahe.mylibrary.net.ResultException;
|
import com.dahe.mylibrary.net.ResultException;
|
||||||
import com.dahe.mylibrary.utils.ToastUtils;
|
import com.dahe.mylibrary.utils.ToastUtils;
|
||||||
@@ -86,14 +87,15 @@ public abstract class RxHttpCallBack<T> {
|
|||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
|
|
||||||
}
|
}
|
||||||
if (t.getCode() == 401) {
|
if ("401".equals(t.getCode())) {
|
||||||
UiAuxiliary.delLogin(mContext);
|
// NewLJUtils.getInstance().refreshToken(mContext);
|
||||||
Intent intent = new Intent(mContext, MainActivity.class);
|
// UiAuxiliary.delLogin(mContext);
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
// Intent intent = new Intent(mContext, MainActivity.class);
|
||||||
mContext.startActivity(intent);
|
// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||||
ToastUtils.showToast(mContext,"您的账号再异地登录,请重新登录");
|
// mContext.startActivity(intent);
|
||||||
|
// ToastUtils.showToast(mContext,"您的账号再异地登录,请重新登录");
|
||||||
}else{
|
}else{
|
||||||
ToastUtils.showToast(mContext,t.getMsg());
|
// ToastUtils.showToast(mContext,t.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (t.getMessage().getMsg_code() == 100 && SPUtils.hasUserInfo(mContext)) {
|
// if (t.getMessage().getMsg_code() == 100 && SPUtils.hasUserInfo(mContext)) {
|
||||||
|
|||||||
@@ -0,0 +1,89 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.service;
|
||||||
|
|
||||||
|
import android.app.Notification;
|
||||||
|
import android.app.NotificationChannel;
|
||||||
|
import android.app.NotificationManager;
|
||||||
|
import android.app.PendingIntent;
|
||||||
|
import android.app.Service;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.IBinder;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.core.app.NotificationCompat;
|
||||||
|
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
|
import com.express.mdp.gps.a;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName TrackForeService
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/12/2 13:12
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public class TrackForeService extends Service {
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public IBinder onBind(Intent intent) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
|
||||||
|
// String var3 = "channelId" + System.currentTimeMillis();
|
||||||
|
// NotificationCompat.Builder var4;
|
||||||
|
// NotificationCompat.Builder var10001 = var4 = new NotificationCompat.Builder;
|
||||||
|
// var4.<init>(this, var3);
|
||||||
|
// var4.setContentText("运单轨迹服务");
|
||||||
|
// var4.setContentTitle("");
|
||||||
|
// var10001.setSmallIcon(var1);
|
||||||
|
// var10001.setAutoCancel(false);
|
||||||
|
// var10001.setShowWhen(true);
|
||||||
|
// var10001.setWhen(System.currentTimeMillis());
|
||||||
|
// var10001.setPriority(2);
|
||||||
|
// var10001.setOngoing(true);
|
||||||
|
// var10001.setDefaults(-1);
|
||||||
|
// NotificationManager var7 = (NotificationManager)this.getSystemService("notification");
|
||||||
|
// if (Build.VERSION.SDK_INT >= 26) {
|
||||||
|
// NotificationChannel var5;
|
||||||
|
// var5 = new NotificationChannel.<init>(var3, var2, 4);
|
||||||
|
// var7.createNotificationChannel(var5);
|
||||||
|
// var4.setChannelId(var3);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// a var10000 = this;
|
||||||
|
// Notification var6 = var4.build();
|
||||||
|
// var4.setContentIntent((PendingIntent)null);
|
||||||
|
// var7.notify(6, var6);
|
||||||
|
// var10000.startForeground(6, var6);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 判断是否为8.0版本以上
|
||||||
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||||
|
// 获取系统服务管理器
|
||||||
|
NotificationManager manage = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
|
String id = "channelId" + System.currentTimeMillis();
|
||||||
|
String name = "通知分类名称";
|
||||||
|
// 建立通知通道
|
||||||
|
NotificationChannel notificationChannel = new NotificationChannel(id, name, NotificationManager.IMPORTANCE_DEFAULT);
|
||||||
|
manage.createNotificationChannel(notificationChannel);
|
||||||
|
|
||||||
|
Notification build = new NotificationCompat.Builder(this, id)
|
||||||
|
.setContentTitle("前台服务")
|
||||||
|
.setContentText("运单轨迹服务")
|
||||||
|
.setWhen(System.currentTimeMillis()) // 当前时间
|
||||||
|
.setSmallIcon(R.drawable.ic_launcher_background) // 图标
|
||||||
|
.setProgress(100, 10, false) // 进度
|
||||||
|
.build();
|
||||||
|
|
||||||
|
// 第一个参数唯一就好
|
||||||
|
startForeground(1, build);
|
||||||
|
manage.notify(1, build);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.ui;
|
package com.arpa.hndahesudintocctmsdriver.ui;
|
||||||
|
|
||||||
|
import static com.dahe.mylibrary.utils.BaseSPUtils.NEW_LJ_TOKEN;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||||
@@ -41,6 +43,7 @@ public class UiAuxiliary {
|
|||||||
public static void delLogin(Context con){
|
public static void delLogin(Context con){
|
||||||
// JPushInterface.deleteAlias(con,0);
|
// JPushInterface.deleteAlias(con,0);
|
||||||
SPUtils.remove(con,"curWaybillId");
|
SPUtils.remove(con,"curWaybillId");
|
||||||
|
SPUtils.remove(con,NEW_LJ_TOKEN);
|
||||||
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_TOKEN,"");
|
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_TOKEN,"");
|
||||||
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_UNAME,"");
|
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_UNAME,"");
|
||||||
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_RNAME,"");
|
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_RNAME,"");
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import android.widget.TextView;
|
|||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.ui.web.WebOnlyOneActivity;
|
||||||
import com.lxj.xpopup.core.CenterPopupView;
|
import com.lxj.xpopup.core.CenterPopupView;
|
||||||
import com.arpa.hndahesudintocctmsdriver.R;
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.web.WebActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.web.WebActivity;
|
||||||
@@ -68,7 +69,7 @@ public class AgreementAlert extends CenterPopupView {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View widget) {
|
public void onClick(View widget) {
|
||||||
//用户服务协议点击事件
|
//用户服务协议点击事件
|
||||||
Intent in=new Intent(getContext(), WebActivity.class);
|
Intent in=new Intent(getContext(), WebOnlyOneActivity.class);
|
||||||
in.putExtra("url",url2);
|
in.putExtra("url",url2);
|
||||||
in.putExtra("title","用户服务协议");
|
in.putExtra("title","用户服务协议");
|
||||||
getContext().startActivity(in);
|
getContext().startActivity(in);
|
||||||
@@ -87,7 +88,7 @@ public class AgreementAlert extends CenterPopupView {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View widget) {
|
public void onClick(View widget) {
|
||||||
//用户服务协议点击事件
|
//用户服务协议点击事件
|
||||||
Intent in=new Intent(getContext(), WebActivity.class);
|
Intent in=new Intent(getContext(), WebOnlyOneActivity.class);
|
||||||
in.putExtra("url",url);
|
in.putExtra("url",url);
|
||||||
in.putExtra("title","隐私政策");
|
in.putExtra("title","隐私政策");
|
||||||
getContext().startActivity(in);
|
getContext().startActivity(in);
|
||||||
|
|||||||
+6
-5
@@ -25,6 +25,7 @@ import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.request.OCRRequest;
|
import com.arpa.hndahesudintocctmsdriver.request.OCRRequest;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.dahe.mylibrary.utils.ImageLoader;
|
||||||
import com.dahe.mylibrary.utils.TimeUtil;
|
import com.dahe.mylibrary.utils.TimeUtil;
|
||||||
import com.esign.esignsdk.EsignSdk;
|
import com.esign.esignsdk.EsignSdk;
|
||||||
import com.esign.esignsdk.data.AuthEvent;
|
import com.esign.esignsdk.data.AuthEvent;
|
||||||
@@ -91,7 +92,7 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
url = ub.getData().getUrl();
|
url = ub.getData().getUrl();
|
||||||
Glide.with(con).load(url).into(img);
|
ImageLoader.getInstance().loadImage(con,url,img);
|
||||||
up_img.setVisibility(View.GONE);
|
up_img.setVisibility(View.GONE);
|
||||||
img.setVisibility(View.VISIBLE);
|
img.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
@@ -104,7 +105,7 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
|||||||
List<OCRQualiBean.DataDTO.QualificationCategoryListDTO> qualificationCategoryList = ocrQualiBean.getData().getQualification_category_list();
|
List<OCRQualiBean.DataDTO.QualificationCategoryListDTO> qualificationCategoryList = ocrQualiBean.getData().getQualification_category_list();
|
||||||
if (qualificationCategoryList != null && qualificationCategoryList.size() > 0) {
|
if (qualificationCategoryList != null && qualificationCategoryList.size() > 0) {
|
||||||
String expiryDate = qualificationCategoryList.get(0).getExpiry_date();
|
String expiryDate = qualificationCategoryList.get(0).getExpiry_date();
|
||||||
if (expiryDate.contains("-")){
|
if (!TextUtils.isEmpty(expiryDate)&&expiryDate.contains("-")){
|
||||||
value2.setText(expiryDate);
|
value2.setText(expiryDate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -143,7 +144,6 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
|||||||
}, 3000);
|
}, 3000);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
finish();
|
|
||||||
if (isOverCar) {//从业资格证=》道路运输许可证
|
if (isOverCar) {//从业资格证=》道路运输许可证
|
||||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
Intent in = new Intent(con, PhotoCarActivity.class);
|
||||||
in.putExtra("type", 3);
|
in.putExtra("type", 3);
|
||||||
@@ -154,6 +154,7 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
|||||||
in.putExtra("type", 3);
|
in.putExtra("type", 3);
|
||||||
con.startActivity(in);
|
con.startActivity(in);
|
||||||
}
|
}
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -371,13 +372,13 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
|||||||
value2.setText(ib.getData().getQualificationCertificateValidity());
|
value2.setText(ib.getData().getQualificationCertificateValidity());
|
||||||
up_img.setVisibility(View.GONE);
|
up_img.setVisibility(View.GONE);
|
||||||
img.setVisibility(View.VISIBLE);
|
img.setVisibility(View.VISIBLE);
|
||||||
Glide.with(con).load(url).into(img);
|
ImageLoader.getInstance().loadImage(con,url,img);
|
||||||
upload_img.setText("已上传");
|
upload_img.setText("已上传");
|
||||||
} else {
|
} else {
|
||||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||||
isAuth = true;
|
isAuth = true;
|
||||||
url = userBean.getData().getPartyMemberUrl();
|
url = userBean.getData().getPartyMemberUrl();
|
||||||
Glide.with(con).load(url).into(img);
|
ImageLoader.getInstance().loadImage(con,url,img);
|
||||||
up_img.setVisibility(View.GONE);
|
up_img.setVisibility(View.GONE);
|
||||||
img.setVisibility(View.VISIBLE);
|
img.setVisibility(View.VISIBLE);
|
||||||
upload_img.setText("已上传");
|
upload_img.setText("已上传");
|
||||||
|
|||||||
+147
-56
@@ -1,11 +1,13 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.ui.auth;
|
package com.arpa.hndahesudintocctmsdriver.ui.auth;
|
||||||
|
|
||||||
|
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.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
|
import android.provider.Settings;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -35,8 +37,10 @@ import com.arpa.hndahesudintocctmsdriver.event.VehicleEvent;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.ui.wallet.UpBankActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.wallet.UpBankActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.PickerUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.PickerUtils;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.PicturlUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.map.MapUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.map.MapUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickHelper;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.bumptech.glide.request.RequestOptions;
|
import com.bumptech.glide.request.RequestOptions;
|
||||||
import com.bumptech.glide.request.target.Target;
|
import com.bumptech.glide.request.target.Target;
|
||||||
@@ -85,6 +89,8 @@ import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||||
import com.lxj.xpopup.photoview.PhotoView;
|
import com.lxj.xpopup.photoview.PhotoView;
|
||||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||||
|
import com.lxj.xpopup.util.XPermission;
|
||||||
|
import com.permissionx.guolindev.PermissionX;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
@@ -120,6 +126,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
private int[] typeImgTwo = {R.mipmap.id_back, R.mipmap.license_back, R.mipmap.vehicle_license_back, R.mipmap.vehicle_license_back};
|
private int[] typeImgTwo = {R.mipmap.id_back, R.mipmap.license_back, R.mipmap.vehicle_license_back, R.mipmap.vehicle_license_back};
|
||||||
private int index = 0;
|
private int index = 0;
|
||||||
private String carExistCarId = "";
|
private String carExistCarId = "";
|
||||||
|
private String trailerId = "";
|
||||||
private DicBean.DataDTO curColor, curEnergy;
|
private DicBean.DataDTO curColor, curEnergy;
|
||||||
private TextView zj_name, zjimg_name, zjimg2_name, zj_name2, zj_name3;
|
private TextView zj_name, zjimg_name, zjimg2_name, zj_name2, zj_name3;
|
||||||
private TextView name1, name2, name3, name4, value5, value6;
|
private TextView name1, name2, name3, name4, value5, value6;
|
||||||
@@ -209,8 +216,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
key = true;
|
key = true;
|
||||||
}, 3000);
|
}, 3000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
@@ -221,12 +226,25 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
Log.e("url", CacheGroup.cacheList.get("authUrl"));
|
Log.e("url", CacheGroup.cacheList.get("authUrl"));
|
||||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("authUrl"), BaseBean.class);
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("authUrl"), BaseBean.class);
|
||||||
if (bb.getCode() == 200) {
|
if (bb.getCode() == 200) {
|
||||||
|
PermissionX.init(this)
|
||||||
|
.permissions(Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA)
|
||||||
|
.request((allGranted, grantedList, deniedList) -> {
|
||||||
|
if (allGranted) {
|
||||||
Intent intent = new Intent(this, H5Activity.class);
|
Intent intent = new Intent(this, H5Activity.class);
|
||||||
intent.putExtra("url", (String) bb.getData());
|
intent.putExtra("url", (String) bb.getData());
|
||||||
intent.putExtra("view_file", false);
|
intent.putExtra("view_file", false);
|
||||||
intent.putExtra("title", "人脸识别");
|
intent.putExtra("title", "人脸识别");
|
||||||
intent.putExtra("isGoCar", true);
|
intent.putExtra("isGoCar", true);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
} else {
|
||||||
|
new MessageUtils().showSimCenPop(act, "缺少相机,媒体权限,将无法为您提供服务,去开启!", "取消", "确认", () -> {
|
||||||
|
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
|
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||||
|
intent.setData(uri);
|
||||||
|
act.startActivity(intent);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
// EsignSdk.getInstance().startH5Activity(act, StringUtil.isNull(String.valueOf(bb.getData()), ""));
|
// EsignSdk.getInstance().startH5Activity(act, StringUtil.isNull(String.valueOf(bb.getData()), ""));
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_LONG).show();
|
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_LONG).show();
|
||||||
@@ -280,22 +298,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
con.startActivity(in);
|
con.startActivity(in);
|
||||||
}
|
}
|
||||||
finish();
|
finish();
|
||||||
// if ("1".equals(needUpQCPhoto)) {
|
|
||||||
// //现逻辑:上传行驶证信息后 判断是否跳转从业资格证
|
|
||||||
// Intent in = new Intent(con, AuthQualificationActivity.class);
|
|
||||||
// in.putExtra("type", "0");
|
|
||||||
// in.putExtra("isOverCar", false);
|
|
||||||
// in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
|
||||||
// startActivity(in);
|
|
||||||
// } else {
|
|
||||||
// //原逻辑:上传行驶证信息后 跳转车辆照片页面
|
|
||||||
// Intent in = new Intent(con, PhotoCarActivity.class);
|
|
||||||
// in.putExtra("type", 0);
|
|
||||||
// in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
|
||||||
// con.startActivity(in);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, czb.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, czb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
@@ -311,7 +313,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
String needUpQCPhoto = bb.getData().getNeedUpQCPhoto();
|
String needUpQCPhoto = bb.getData().getNeedUpQCPhoto();
|
||||||
String needUpRLPhoto = bb.getData().getNeedUpRLPhoto();//是否需要上传道路运输证到
|
String needUpRLPhoto = bb.getData().getNeedUpRLPhoto();//是否需要上传道路运输证到
|
||||||
Toast.makeText(con, "挂车信息保存成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "挂车信息保存成功", Toast.LENGTH_SHORT).show();
|
||||||
finish();
|
|
||||||
VehicleEvent ve = new VehicleEvent("挂");
|
VehicleEvent ve = new VehicleEvent("挂");
|
||||||
EventBus.getDefault().post(ve);
|
EventBus.getDefault().post(ve);
|
||||||
|
|
||||||
@@ -335,6 +337,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
in.putExtra("carId", carId);
|
in.putExtra("carId", carId);
|
||||||
con.startActivity(in);
|
con.startActivity(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
finish();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, "挂车信息保存失败", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "挂车信息保存失败", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
@@ -459,12 +463,25 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
Log.e("url", CacheGroup.cacheList.get("authUrl"));
|
Log.e("url", CacheGroup.cacheList.get("authUrl"));
|
||||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("authUrl"), BaseBean.class);
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("authUrl"), BaseBean.class);
|
||||||
if (bb.getCode() == 200) {
|
if (bb.getCode() == 200) {
|
||||||
|
PermissionX.init(this)
|
||||||
|
.permissions(Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA)
|
||||||
|
.request((allGranted, grantedList, deniedList) -> {
|
||||||
|
if (allGranted) {
|
||||||
Intent intent = new Intent(this, H5Activity.class);
|
Intent intent = new Intent(this, H5Activity.class);
|
||||||
intent.putExtra("url", (String) bb.getData());
|
intent.putExtra("url", (String) bb.getData());
|
||||||
intent.putExtra("view_file", false);
|
intent.putExtra("view_file", false);
|
||||||
intent.putExtra("title", "人脸识别");
|
intent.putExtra("title", "人脸识别");
|
||||||
intent.putExtra("isGoCar", true);
|
intent.putExtra("isGoCar", true);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
} else {
|
||||||
|
new MessageUtils().showSimCenPop(act, "缺少相机,媒体权限,将无法为您提供服务,去开启!", "取消", "确认", () -> {
|
||||||
|
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
|
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||||
|
intent.setData(uri);
|
||||||
|
act.startActivity(intent);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
// EsignSdk.getInstance().startH5Activity(act, StringUtil.isNull(String.valueOf(bb.getData()), ""));
|
// EsignSdk.getInstance().startH5Activity(act, StringUtil.isNull(String.valueOf(bb.getData()), ""));
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_LONG).show();
|
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_LONG).show();
|
||||||
@@ -476,6 +493,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
if (bb.getCode() == 200 && bb.getData() != null) {
|
if (bb.getCode() == 200 && bb.getData() != null) {
|
||||||
if (!TextUtils.isEmpty(bb.getData().getCarId())) {
|
if (!TextUtils.isEmpty(bb.getData().getCarId())) {
|
||||||
carExistCarId = bb.getData().getCarId();
|
carExistCarId = bb.getData().getCarId();
|
||||||
|
trailerId = bb.getData().getTrailerId();
|
||||||
value1.setEnabled(false);
|
value1.setEnabled(false);
|
||||||
value2.setEnabled(false);
|
value2.setEnabled(false);
|
||||||
value3.setEnabled(false);
|
value3.setEnabled(false);
|
||||||
@@ -483,7 +501,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
// img2.setEnabled(false);
|
// img2.setEnabled(false);
|
||||||
u_img2.setEnabled(false);
|
u_img2.setEnabled(false);
|
||||||
url2 = bb.getData().getBackImage();
|
url2 = bb.getData().getBackImage();
|
||||||
Glide.with(con).load(bb.getData().getBackImage()).into(img2);
|
ImageLoader.getInstance().loadImage(con,bb.getData().getBackImage(),img2);
|
||||||
// url2 = olb.getData().getExistCarInfo().getBackImage();
|
// url2 = olb.getData().getExistCarInfo().getBackImage();
|
||||||
ToastUtils.showLongToast(con, "该车辆已存在,请仔细核对相关信息");
|
ToastUtils.showLongToast(con, "该车辆已存在,请仔细核对相关信息");
|
||||||
}
|
}
|
||||||
@@ -497,7 +515,16 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
if (bb.getCode() == 200) {
|
if (bb.getCode() == 200) {
|
||||||
VehicleEvent ve = new VehicleEvent(String.valueOf(carExistCarId));
|
VehicleEvent ve = new VehicleEvent(String.valueOf(carExistCarId));
|
||||||
EventBus.getDefault().postSticky(ve);
|
EventBus.getDefault().postSticky(ve);
|
||||||
|
if (("0".equals(trailerId) || TextUtils.isEmpty(trailerId)) && value2.getText().toString().contains("牵")) {
|
||||||
|
Intent in = new Intent(con, CertificatesActivity.class);
|
||||||
|
in.putExtra("index", 3);
|
||||||
|
in.putExtra("carId", carExistCarId);
|
||||||
|
startActivity(in);
|
||||||
finish();
|
finish();
|
||||||
|
} else {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
ToastUtils.showToast(con, bb.getMsg());
|
ToastUtils.showToast(con, bb.getMsg());
|
||||||
} else {
|
} else {
|
||||||
ToastUtils.showToast(con, bb.getMsg());
|
ToastUtils.showToast(con, bb.getMsg());
|
||||||
@@ -506,7 +533,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
} else {
|
} else {
|
||||||
pathOrcRes();
|
pathOrcRes();
|
||||||
//重复代码?
|
//重复代码?
|
||||||
initView(null);
|
// initView(null);
|
||||||
if (!(CacheGroup.cacheList.get(TYPE_NAME_BANK[2]) != null || CacheGroup.cacheList.get(TYPE_NAME_BANK[3]) != null)) {
|
if (!(CacheGroup.cacheList.get(TYPE_NAME_BANK[2]) != null || CacheGroup.cacheList.get(TYPE_NAME_BANK[3]) != null)) {
|
||||||
initData();
|
initData();
|
||||||
}
|
}
|
||||||
@@ -611,6 +638,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
initView(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -721,7 +749,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
submit.setOnClickListener(v -> {
|
submit.setOnClickListener(new OnLimitClickHelper(v->{
|
||||||
if (!isAuth) {
|
if (!isAuth) {
|
||||||
subimt();
|
subimt();
|
||||||
} else {
|
} else {
|
||||||
@@ -765,7 +793,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -788,8 +816,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
value2.setText(iacb.getData().getIdcard());
|
value2.setText(iacb.getData().getIdcard());
|
||||||
value3.setText(iacb.getData().getIdcardAddress());
|
value3.setText(iacb.getData().getIdcardAddress());
|
||||||
value4.setText(iacb.getData().getIdcardValidity());
|
value4.setText(iacb.getData().getIdcardValidity());
|
||||||
Glide.with(con).load(url1).into(img1);
|
ImageLoader.getInstance().loadImage(con,url1,img1);
|
||||||
Glide.with(con).load(url2).into(img2);
|
ImageLoader.getInstance().loadImage(con,url2,img2);
|
||||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||||
u_img.setText("已上传");
|
u_img.setText("已上传");
|
||||||
u_img2.setText("已上传");
|
u_img2.setText("已上传");
|
||||||
@@ -809,8 +837,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
value3.setText(iadalb.getData().getAllowType());
|
value3.setText(iadalb.getData().getAllowType());
|
||||||
value4.setText(iadalb.getData().getDriverLicenseValidity());
|
value4.setText(iadalb.getData().getDriverLicenseValidity());
|
||||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||||
Glide.with(con).load(url1).into(img1);
|
ImageLoader.getInstance().loadImage(con,url1,img1);
|
||||||
Glide.with(con).load(url2).into(img2);
|
ImageLoader.getInstance().loadImage(con,url2,img2);
|
||||||
u_img.setText("已上传");
|
u_img.setText("已上传");
|
||||||
u_img2.setText("已上传");
|
u_img2.setText("已上传");
|
||||||
isAuth = true;
|
isAuth = true;
|
||||||
@@ -829,9 +857,9 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
value5.setText(StringUtil.isNull(cdb.getData().getCarPlateColorValue(), "空数据"));
|
value5.setText(StringUtil.isNull(cdb.getData().getCarPlateColorValue(), "空数据"));
|
||||||
value6.setText(StringUtil.isNull(cdb.getData().getCarEnergyTypValue(), "空数据"));
|
value6.setText(StringUtil.isNull(cdb.getData().getCarEnergyTypValue(), "空数据"));
|
||||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||||
Glide.with(con).load(url1).into(img1);
|
ImageLoader.getInstance().loadImage(con,url1,img1);
|
||||||
Glide.with(con).load(url2).into(img2);
|
ImageLoader.getInstance().loadImage(con,url2,img2);
|
||||||
Glide.with(con).load(url3).into(img3);
|
ImageLoader.getInstance().loadImage(con,url3,img3);
|
||||||
u_img.setText("已上传");
|
u_img.setText("已上传");
|
||||||
u_img2.setText("已上传");
|
u_img2.setText("已上传");
|
||||||
u_img3.setText("点击查看");
|
u_img3.setText("点击查看");
|
||||||
@@ -851,9 +879,9 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
value3.setText(StringUtil.isNull(cdb.getData().getTrailerResVo().getOwner(), "空数据"));
|
value3.setText(StringUtil.isNull(cdb.getData().getTrailerResVo().getOwner(), "空数据"));
|
||||||
value4.setText(StringUtil.isNull(cdb.getData().getTrailerResVo().getVehicleNumber(), "空数据"));
|
value4.setText(StringUtil.isNull(cdb.getData().getTrailerResVo().getVehicleNumber(), "空数据"));
|
||||||
value6.setText(StringUtil.isNull(cdb.getData().getCarEnergyTypValue(), "空数据"));
|
value6.setText(StringUtil.isNull(cdb.getData().getCarEnergyTypValue(), "空数据"));
|
||||||
Glide.with(con).load(url1).into(img1);
|
ImageLoader.getInstance().loadImage(con,url1,img1);
|
||||||
Glide.with(con).load(url2).into(img2);
|
ImageLoader.getInstance().loadImage(con,url2,img2);
|
||||||
Glide.with(con).load(url3).into(img3);
|
ImageLoader.getInstance().loadImage(con,url3,img3);
|
||||||
if (cdb.getRes() != 1) {
|
if (cdb.getRes() != 1) {
|
||||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||||
u_img.setText("已上传");
|
u_img.setText("已上传");
|
||||||
@@ -915,27 +943,29 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
case 0:
|
case 0:
|
||||||
if (CacheGroup.cacheList.get(TYPE_NAME[0]) != null) {
|
if (CacheGroup.cacheList.get(TYPE_NAME[0]) != null) {
|
||||||
ocb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[0]), OCRCardBean.class);
|
ocb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[0]), OCRCardBean.class);
|
||||||
|
ImageLoader.getInstance().loadImage(con, path, img1, typeImgOne[index]);
|
||||||
if (ocb.getCode() == 200 && ocb.getData() != null) {
|
if (ocb.getCode() == 200 && ocb.getData() != null) {
|
||||||
// url1 = ocb.getData().getUrl();
|
// url1 = ocb.getData().getUrl();
|
||||||
value1.setText(ocb.getData().getName());
|
value1.setText(ocb.getData().getName());
|
||||||
value2.setText(ocb.getData().getIdcard());
|
value2.setText(ocb.getData().getIdcard());
|
||||||
value3.setText(ocb.getData().getAddress());
|
value3.setText(ocb.getData().getAddress());
|
||||||
Glide.with(con).load(path).into(img1);
|
// Glide.with(con).load(path).into(img1);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "识别失败请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove(TYPE_NAME[0]);
|
CacheGroup.cacheList.remove(TYPE_NAME[0]);
|
||||||
}
|
}
|
||||||
if (CacheGroup.cacheList.get(TYPE_NAME_BANK[0]) != null) {
|
if (CacheGroup.cacheList.get(TYPE_NAME_BANK[0]) != null) {
|
||||||
ocbb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME_BANK[0]), OCRCardBackBean.class);
|
ocbb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME_BANK[0]), OCRCardBackBean.class);
|
||||||
|
ImageLoader.getInstance().loadImage(con, path, img2, typeImgTwo[index]);
|
||||||
if (ocbb.getCode() == 200 && ocbb.getData() != null) {
|
if (ocbb.getCode() == 200 && ocbb.getData() != null) {
|
||||||
value4.setText(ocbb.getData().getValidTo());
|
value4.setText(ocbb.getData().getValidTo());
|
||||||
Glide.with(con).load(path).into(img2);
|
// Glide.with(con).load(path).into(img2);
|
||||||
startTime = ocbb.getData().getValidFrom();
|
startTime = ocbb.getData().getValidFrom();
|
||||||
//自动调取提交功能,实现页面自动跳转
|
//自动调取提交功能,实现页面自动跳转
|
||||||
subimt();
|
subimt();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "识别失败请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove(TYPE_NAME_BANK[0]);
|
CacheGroup.cacheList.remove(TYPE_NAME_BANK[0]);
|
||||||
}
|
}
|
||||||
@@ -944,6 +974,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
//{"档案编号","初次领证日期","准驾车型","有效期限(止)"},
|
//{"档案编号","初次领证日期","准驾车型","有效期限(止)"},
|
||||||
if (CacheGroup.cacheList.get(TYPE_NAME[1]) != null) {
|
if (CacheGroup.cacheList.get(TYPE_NAME[1]) != null) {
|
||||||
odl = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[1]), OCRDrivingLicenseBean.class);
|
odl = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[1]), OCRDrivingLicenseBean.class);
|
||||||
|
ImageLoader.getInstance().loadImage(con, path, img1, typeImgOne[index]);
|
||||||
if (odl.getCode() == 200 && odl.getData() != null) {
|
if (odl.getCode() == 200 && odl.getData() != null) {
|
||||||
OCRDrivingLicenseBean.DataDTO od = odl.getData();
|
OCRDrivingLicenseBean.DataDTO od = odl.getData();
|
||||||
// url1 = odl.getData().getUrl();
|
// url1 = odl.getData().getUrl();
|
||||||
@@ -952,20 +983,22 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
value2.setText(StringUtil.isNull(od.getFirstGetDocDate(), "识别异常"));
|
value2.setText(StringUtil.isNull(od.getFirstGetDocDate(), "识别异常"));
|
||||||
value3.setText(StringUtil.isNull(od.getQuasiDriveType(), "识别异常"));
|
value3.setText(StringUtil.isNull(od.getQuasiDriveType(), "识别异常"));
|
||||||
value4.setText(StringUtil.isNull(od.getEndDate(), "识别异常"));
|
value4.setText(StringUtil.isNull(od.getEndDate(), "识别异常"));
|
||||||
Glide.with(con).load(path).into(img1);
|
|
||||||
|
// Glide.with(con).load(path).into(img1);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "识别失败请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove(TYPE_NAME[1]);
|
CacheGroup.cacheList.remove(TYPE_NAME[1]);
|
||||||
}
|
}
|
||||||
if (CacheGroup.cacheList.get(TYPE_NAME_BANK[1]) != null) {
|
if (CacheGroup.cacheList.get(TYPE_NAME_BANK[1]) != null) {
|
||||||
odlb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME_BANK[1]), OCRDrivingLicenseBackBean.class);
|
odlb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME_BANK[1]), OCRDrivingLicenseBackBean.class);
|
||||||
|
ImageLoader.getInstance().loadImage(con, path, img2, typeImgTwo[index]);
|
||||||
if (odlb.getCode() == 200 && odlb.getData() != null) {
|
if (odlb.getCode() == 200 && odlb.getData() != null) {
|
||||||
Glide.with(con).load(path).into(img2);
|
// Glide.with(con).load(path).into(img2);
|
||||||
//自动调取提交功能,实现页面自动跳转
|
//自动调取提交功能,实现页面自动跳转
|
||||||
subimt();
|
subimt();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "识别失败请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove(TYPE_NAME_BANK[1]);
|
CacheGroup.cacheList.remove(TYPE_NAME_BANK[1]);
|
||||||
}
|
}
|
||||||
@@ -976,6 +1009,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
if (CacheGroup.cacheList.get(TYPE_NAME[2]) != null) {
|
if (CacheGroup.cacheList.get(TYPE_NAME[2]) != null) {
|
||||||
Log.e("olb", CacheGroup.cacheList.get(TYPE_NAME[2]));
|
Log.e("olb", CacheGroup.cacheList.get(TYPE_NAME[2]));
|
||||||
olb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[2]), OCRVehicleLicenseBean.class);
|
olb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[2]), OCRVehicleLicenseBean.class);
|
||||||
|
ImageLoader.getInstance().loadImage(con, path, img1, typeImgOne[index]);
|
||||||
|
if (olb.getCode() == 200 && olb.getData() != null) {
|
||||||
if (2 == index && olb.getData().getVclN().contains("挂")) {
|
if (2 == index && olb.getData().getVclN().contains("挂")) {
|
||||||
Toast.makeText(con, "该证件为挂车,请上传行驶证证件", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "该证件为挂车,请上传行驶证证件", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
@@ -985,7 +1020,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
Toast.makeText(con, "未识别到挂车相关信息,请上传挂车行驶证证件", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "未识别到挂车相关信息,请上传挂车行驶证证件", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (olb.getCode() == 200 && olb.getData() != null) {
|
|
||||||
carExistCarId = "";
|
carExistCarId = "";
|
||||||
value1.setEnabled(true);
|
value1.setEnabled(true);
|
||||||
value2.setEnabled(true);
|
value2.setEnabled(true);
|
||||||
@@ -1000,27 +1034,30 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
value4.setText(olb.getData().getVin());
|
value4.setText(olb.getData().getVin());
|
||||||
// fontId = olb.getData().getId();
|
// fontId = olb.getData().getId();
|
||||||
// Glide.with(con).load(url1).into(img1);
|
// Glide.with(con).load(url1).into(img1);
|
||||||
Glide.with(con).load(path).into(img1);
|
// Glide.with(con).load(path).into(img1);
|
||||||
|
|
||||||
oCrcarId = olb.getData().getCarId() + "";
|
oCrcarId = olb.getData().getCarId() + "";
|
||||||
if (!TextUtils.isEmpty(olb.getData().getVclN()) && !olb.getData().getVclN().contains("挂"))
|
if (!TextUtils.isEmpty(olb.getData().getVclN()) && !olb.getData().getVclN().contains("挂"))
|
||||||
new AuthRequest().getCarInfo(con, hd, olb.getData().getVclN());
|
new AuthRequest().getCarInfo(con, hd, olb.getData().getVclN());
|
||||||
Log.e("-cardId-", oCrcarId);
|
Log.e("-cardId-", oCrcarId);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "识别失败请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove(TYPE_NAME[2]);
|
CacheGroup.cacheList.remove(TYPE_NAME[2]);
|
||||||
}
|
}
|
||||||
if (CacheGroup.cacheList.get(TYPE_NAME_BANK[2]) != null) {
|
if (CacheGroup.cacheList.get(TYPE_NAME_BANK[2]) != null) {
|
||||||
oblb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME_BANK[2]), OCRVehicleBackLicenseBean.class);
|
oblb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME_BANK[2]), OCRVehicleBackLicenseBean.class);
|
||||||
|
ImageLoader.getInstance().loadImage(con, path, img2, typeImgTwo[index]);
|
||||||
if (oblb.getCode() == 200 && oblb.getData() != null) {
|
if (oblb.getCode() == 200 && oblb.getData() != null) {
|
||||||
// url2 = oblb.getData().getUrl();
|
// url2 = oblb.getData().getUrl();
|
||||||
// backId = oblb.getData().getId();
|
// backId = oblb.getData().getId();
|
||||||
// Glide.with(con).load(url2).into(img2);
|
// Glide.with(con).load(url2).into(img2);
|
||||||
Glide.with(con).load(path).into(img2);
|
|
||||||
|
// Glide.with(con).load(path).into(img2);
|
||||||
//自动调取提交功能,实现页面自动跳转实现页面自动跳转
|
//自动调取提交功能,实现页面自动跳转实现页面自动跳转
|
||||||
subimt();
|
subimt();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "识别失败请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove(TYPE_NAME_BANK[2]);
|
CacheGroup.cacheList.remove(TYPE_NAME_BANK[2]);
|
||||||
}
|
}
|
||||||
@@ -1111,16 +1148,30 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
String str2 = value2.getText().toString().trim();
|
String str2 = value2.getText().toString().trim();
|
||||||
String str3 = value3.getText().toString().trim();
|
String str3 = value3.getText().toString().trim();
|
||||||
String str4 = value4.getText().toString().trim();
|
String str4 = value4.getText().toString().trim();
|
||||||
if ("".equals(str1) || "".equals(str2) || "".equals(str3) || "".equals(str4) || "".equals(url1) || "".equals(url2)) {
|
// if ("".equals(str1) || "".equals(str2) || "".equals(str3) || "".equals(url1) || "".equals(url2)) {
|
||||||
Toast.makeText(con, "请补充完整的信息", Toast.LENGTH_LONG).show();
|
// Toast.makeText(con, "请补充完整的信息", Toast.LENGTH_LONG).show();
|
||||||
// Toast.makeText(con, "请补充完整的" + name[index], Toast.LENGTH_LONG).show();
|
//// Toast.makeText(con, "请补充完整的" + name[index], Toast.LENGTH_LONG).show();
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case 0:
|
case 0:
|
||||||
|
if ("".equals(str1) || "".equals(str2) || "".equals(str3) || "".equals(str4) || "".equals(url1) || "".equals(url2)) {
|
||||||
|
Toast.makeText(con, "请补充完整的信息", Toast.LENGTH_LONG).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (ocb != null && ocbb != null) {
|
if (ocb != null && ocbb != null) {
|
||||||
|
if (ocb.getData() == null) {
|
||||||
|
ToastUtils.showToast(con, "主页照片识别失败,请重新上传");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ocbb == null || ocbb.getData() == null) {
|
||||||
|
ToastUtils.showToast(con, "副页照片识别失败,请重新上传");
|
||||||
|
return;
|
||||||
|
}
|
||||||
customDialog = new CustomDialog(con, "网络请求中...");
|
customDialog = new CustomDialog(con, "网络请求中...");
|
||||||
customDialog.show();
|
customDialog.show();
|
||||||
|
|
||||||
IDInputBean ib = new IDInputBean();
|
IDInputBean ib = new IDInputBean();
|
||||||
ib.setIdcarName(str1);
|
ib.setIdcarName(str1);
|
||||||
ib.setIdcard(str2);
|
ib.setIdcard(str2);
|
||||||
@@ -1142,9 +1193,25 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
case 1:
|
case 1:
|
||||||
//olb
|
//olb
|
||||||
//{"档案编号","初次领证日期","准驾车型","有效期限(止)"},
|
//{"档案编号","初次领证日期","准驾车型","有效期限(止)"},
|
||||||
|
if ("".equals(str1) || "".equals(str2) || "".equals(str3) || "".equals(str4) || "".equals(url1) || "".equals(url2)) {
|
||||||
|
Toast.makeText(con, "请补充完整的信息", Toast.LENGTH_LONG).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (odl != null && odlb != null) {
|
if (odl != null && odlb != null) {
|
||||||
|
|
||||||
|
if (odl.getData() == null) {
|
||||||
|
ToastUtils.showToast(con, "主页照片识别失败,请重新上传");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (odlb == null || odlb.getData() == null) {
|
||||||
|
ToastUtils.showToast(con, "副页照片识别失败,请重新上传");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
customDialog = new CustomDialog(con, "网络请求中...");
|
customDialog = new CustomDialog(con, "网络请求中...");
|
||||||
customDialog.show();
|
customDialog.show();
|
||||||
|
|
||||||
Log.e("ocr", new Gson().toJson(odl));
|
Log.e("ocr", new Gson().toJson(odl));
|
||||||
LicenseInputBean iib = new LicenseInputBean();
|
LicenseInputBean iib = new LicenseInputBean();
|
||||||
iib.setArchivesName(odlb.getData().getFileNumber());
|
iib.setArchivesName(odlb.getData().getFileNumber());
|
||||||
@@ -1177,11 +1244,26 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
new AuthRequest().bindCar(con, hd, carExistCarId);
|
new AuthRequest().bindCar(con, hd, carExistCarId);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if ("".equals(str1) || "".equals(str2) || "".equals(str3) || "".equals(str4) || "".equals(url1) || "".equals(url2)) {
|
||||||
|
Toast.makeText(con, "请补充完整的信息", Toast.LENGTH_LONG).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if ((olb != null && !olb.getData().isCarExist() && oblb != null) || (olb != null && olb.getData().isCarExist())) {
|
if ((olb != null && !olb.getData().isCarExist() && oblb != null) || (olb != null && olb.getData().isCarExist())) {
|
||||||
// if (curColor == null || curEnergy == null) {
|
// if (curColor == null || curEnergy == null) {
|
||||||
// Toast.makeText(con, "请完善内容", Toast.LENGTH_SHORT).show();
|
// Toast.makeText(con, "请完善内容", Toast.LENGTH_SHORT).show();
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
|
if (olb.getData() == null) {
|
||||||
|
ToastUtils.showToast(con, "主页照片识别失败,请重新上传");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (oblb == null || oblb.getData() == null) {
|
||||||
|
ToastUtils.showToast(con, "副页照片识别失败,请重新上传");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
customDialog = new CustomDialog(con, "网络请求中...");
|
customDialog = new CustomDialog(con, "网络请求中...");
|
||||||
customDialog.show();
|
customDialog.show();
|
||||||
HashMap<String, Object> map = new HashMap<>();
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
@@ -1194,6 +1276,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
// map.put("ownerName", str3);
|
// map.put("ownerName", str3);
|
||||||
// map.put("vin", str4);//车辆识别代号
|
// map.put("vin", str4);//车辆识别代号
|
||||||
|
|
||||||
|
|
||||||
String carLong = "";
|
String carLong = "";
|
||||||
String carWidth = "";
|
String carWidth = "";
|
||||||
String carHeight = "";
|
String carHeight = "";
|
||||||
@@ -1287,11 +1370,20 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
|
if ("".equals(str1) || "".equals(str2) || "".equals(str3) || "".equals(str4) || "".equals(url1) || "".equals(url2)) {
|
||||||
|
Toast.makeText(con, "请补充完整的信息", Toast.LENGTH_LONG).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (olb != null || (cdb != null && cdb.getRes() == 1)) {
|
if (olb != null || (cdb != null && cdb.getRes() == 1)) {
|
||||||
// if (curEnergy==null){
|
if (olb.getData() == null) {
|
||||||
// Toast.makeText(con,"请完善内容",Toast.LENGTH_SHORT).show();
|
ToastUtils.showToast(con, "主页照片识别失败,请重新上传");
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
if (oblb == null || oblb.getData() == null) {
|
||||||
|
ToastUtils.showToast(con, "副页照片识别失败,请重新上传");
|
||||||
|
return;
|
||||||
|
}
|
||||||
customDialog = new CustomDialog(con, "网络请求中...");
|
customDialog = new CustomDialog(con, "网络请求中...");
|
||||||
customDialog.show();
|
customDialog.show();
|
||||||
// Map<String, Object> map = new HashMap<>();
|
// Map<String, Object> map = new HashMap<>();
|
||||||
@@ -1328,7 +1420,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
// map.put("fileNumber", oblb.getData().getRecordId());//档案编号
|
// map.put("fileNumber", oblb.getData().getRecordId());//档案编号
|
||||||
// map.put("towAuality", oblb.getData().getVclDrwTn());//准牵引总质量
|
// map.put("towAuality", oblb.getData().getVclDrwTn());//准牵引总质量
|
||||||
|
|
||||||
|
|
||||||
String carLong = "";
|
String carLong = "";
|
||||||
String carWidth = "";
|
String carWidth = "";
|
||||||
String carHeight = "";
|
String carHeight = "";
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.ui.auth;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.event.PersonEvent;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||||
|
import com.dahe.mylibrary.utils.ActivityUtils;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName FaceSuccActivity
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/12/2 10:27
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public class FaceSuccActivity extends BaseAppCompatActivity {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
StateStyleUtil.stateTextColor(this);
|
||||||
|
setContentView(R.layout.activity_face_succ_result);
|
||||||
|
con = this;
|
||||||
|
initView(null);
|
||||||
|
Button btnHome = findViewById(R.id.btnHome);
|
||||||
|
Button btnAddCar = findViewById(R.id.btnAddCar);
|
||||||
|
boolean isGoCar = getIntent().getBooleanExtra("isGoCar", false);
|
||||||
|
if (isGoCar) {
|
||||||
|
btnHome.setText("返回首页");
|
||||||
|
btnAddCar.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
btnHome.setText("返回");
|
||||||
|
btnAddCar.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
btnHome.setOnClickListener(v -> {
|
||||||
|
finish();
|
||||||
|
});
|
||||||
|
btnAddCar.setOnClickListener(v -> {
|
||||||
|
Intent in = new Intent(con, CertificatesActivity.class);
|
||||||
|
in.putExtra("index", 2);
|
||||||
|
startActivity(in);
|
||||||
|
finish();
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
EventBus.getDefault().post(new PersonEvent("刷脸成功"));
|
||||||
|
}
|
||||||
|
}
|
||||||
+30
-7
@@ -1,5 +1,7 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.ui.auth;
|
package com.arpa.hndahesudintocctmsdriver.ui.auth;
|
||||||
|
|
||||||
|
import static com.sdk.base.framework.utils.app.AppUtils.getPackageName;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
@@ -27,6 +29,7 @@ import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.util.PermissionUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.PermissionUtils;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.dahe.mylibrary.utils.ActivityUtils;
|
import com.dahe.mylibrary.utils.ActivityUtils;
|
||||||
|
import com.dahe.mylibrary.utils.ImageLoader;
|
||||||
import com.esign.esignsdk.EsignSdk;
|
import com.esign.esignsdk.EsignSdk;
|
||||||
import com.esign.esignsdk.data.AuthEvent;
|
import com.esign.esignsdk.data.AuthEvent;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
@@ -74,15 +77,15 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
|||||||
super.msgMethod(m);
|
super.msgMethod(m);
|
||||||
switch (m.what) {
|
switch (m.what) {
|
||||||
case RequsetCodeConstants.SUCCESS:
|
case RequsetCodeConstants.SUCCESS:
|
||||||
if (CacheGroup.cacheList.get("userdata") != null) {
|
if (CacheGroup.cacheList.get("userdata2") != null) {
|
||||||
ub = gson.fromJson(CacheGroup.cacheList.get("userdata"), UserBean.class);
|
ub = gson.fromJson(CacheGroup.cacheList.get("userdata2"), UserBean.class);
|
||||||
if (ub.getCode() == 200) {
|
if (ub.getCode() == 200) {
|
||||||
initView(ub);
|
initView(ub);
|
||||||
SPUtil.insSP(con, "data", "userdata", CacheGroup.cacheList.get("userdata"));
|
SPUtil.insSP(con, "data", "userdata", CacheGroup.cacheList.get("userdata2"));
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove("userdata");
|
CacheGroup.cacheList.remove("userdata2");
|
||||||
}
|
}
|
||||||
if (CacheGroup.cacheList.get("upload") != null) {
|
if (CacheGroup.cacheList.get("upload") != null) {
|
||||||
upb = gson.fromJson(CacheGroup.cacheList.get("upload"), UploadBean.class);
|
upb = gson.fromJson(CacheGroup.cacheList.get("upload"), UploadBean.class);
|
||||||
@@ -207,7 +210,22 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
|||||||
});
|
});
|
||||||
//头像
|
//头像
|
||||||
up_img.setOnClickListener(v -> {
|
up_img.setOnClickListener(v -> {
|
||||||
|
PermissionUtils.Companion.getInstance().showPermissionMessage(this, "拍摄,媒体查询权限使用说明", "用于拍照或者选择图片用于上传头像功能",
|
||||||
|
new String[]{Manifest.permission.READ_EXTERNAL_STORAGE,Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.CAMERA},
|
||||||
|
(allGranted, grantedList, deniedList) -> {
|
||||||
|
if (allGranted) {
|
||||||
gia.showPopueWindow(this);
|
gia.showPopueWindow(this);
|
||||||
|
} else {
|
||||||
|
new MessageUtils().showSimCenPop(con, "缺少拍摄,媒体查询权限,将无法为您提供服务,去开启!", "取消", "确认", () -> {
|
||||||
|
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
|
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||||
|
intent.setData(uri);
|
||||||
|
startActivity(intent);
|
||||||
|
});
|
||||||
|
// Toast.makeText(act.getBaseContext(), "请先开启定位权限", Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
up_head.setOnClickListener(v -> {
|
up_head.setOnClickListener(v -> {
|
||||||
if (ub.getData().getHeadportraitUrl() != null && !ub.getData().getHeadportraitUrl().equals("")) {
|
if (ub.getData().getHeadportraitUrl() != null && !ub.getData().getHeadportraitUrl().equals("")) {
|
||||||
@@ -221,10 +239,15 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
|||||||
});
|
});
|
||||||
hyr = new HuoYuanRequset(con, hd);
|
hyr = new HuoYuanRequset(con, hd);
|
||||||
ur = new UserRequset(con, hd);
|
ur = new UserRequset(con, hd);
|
||||||
ur.User();
|
|
||||||
EventBus.getDefault().register(this);
|
EventBus.getDefault().register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
ur.User2();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
@@ -240,7 +263,7 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
|||||||
TextView name = findViewById(R.id.rname);
|
TextView name = findViewById(R.id.rname);
|
||||||
name.setText(StringUtil.isNull(ub.getData().getRname(), "未实名"));
|
name.setText(StringUtil.isNull(ub.getData().getRname(), "未实名"));
|
||||||
if (ub.getData().getHeadportraitUrl() != null && !ub.getData().getHeadportraitUrl().equals("")) {
|
if (ub.getData().getHeadportraitUrl() != null && !ub.getData().getHeadportraitUrl().equals("")) {
|
||||||
Glide.with(con).load(ub.getData().getHeadportraitUrl()).into(up_head);
|
ImageLoader.getInstance().loadImage(con,ub.getData().getHeadportraitUrl(),up_head);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,7 +271,7 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
|||||||
public void personResult(PersonEvent home) {
|
public void personResult(PersonEvent home) {
|
||||||
Log.e("-res-", home.getMessage());
|
Log.e("-res-", home.getMessage());
|
||||||
if (ur != null) {
|
if (ur != null) {
|
||||||
ur.User();
|
ur.User2();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.arpa.hndahesudintocctmsdriver.ui.auth;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
|
import android.text.InputType;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -35,7 +36,7 @@ import com.arpa.hndahesudintocctmsdriver.util.img.GetImageAlert;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||||
import com.bumptech.glide.Glide;
|
import com.dahe.mylibrary.utils.ImageLoader;
|
||||||
import com.dahe.mylibrary.utils.PatternUtils;
|
import com.dahe.mylibrary.utils.PatternUtils;
|
||||||
import com.github.gzuliyujiang.wheelpicker.DatePicker;
|
import com.github.gzuliyujiang.wheelpicker.DatePicker;
|
||||||
import com.github.gzuliyujiang.wheelpicker.annotation.DateMode;
|
import com.github.gzuliyujiang.wheelpicker.annotation.DateMode;
|
||||||
@@ -110,9 +111,10 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (CacheGroup.cacheList.get("ORCRoadLicZj") != null) {
|
if (CacheGroup.cacheList.get("ORCRoadLicZj") != null) {
|
||||||
OCRRoadBean ib = new Gson().fromJson(CacheGroup.cacheList.get("ORCRoadLicZj"), OCRRoadBean.class);
|
if (customDialog != null && customDialog.isShowing())
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
if (ib.getCode() == 200 && ib.getData() != null) {
|
OCRRoadBean ib = new Gson().fromJson(CacheGroup.cacheList.get("ORCRoadLicZj"), OCRRoadBean.class);
|
||||||
|
if (ib.getCode() == 200 && ib.getData() != null&&!TextUtils.isEmpty(ib.getData().getLicenseNumber())) {
|
||||||
value1.setText(PatternUtils.getNumByStr(ib.getData().getLicenseNumber()));
|
value1.setText(PatternUtils.getNumByStr(ib.getData().getLicenseNumber()));
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
||||||
@@ -148,15 +150,17 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
url = ub.getData().getUrl();
|
url = ub.getData().getUrl();
|
||||||
// Glide.with(con).load(url).into(img);
|
// Glide.with(con).load(url).into(img);
|
||||||
Glide.with(con).load(path).into(img);
|
ImageLoader.getInstance().loadImage(con,path,img);
|
||||||
|
|
||||||
|
|
||||||
CacheGroup.cacheList.remove("upload");
|
CacheGroup.cacheList.remove("upload");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CacheGroup.cacheList.get("saveCarImg") != null) {
|
if (CacheGroup.cacheList.get("saveCarImg") != null) {
|
||||||
|
if (type!=3){
|
||||||
if (customDialog != null && customDialog.isShowing())
|
if (customDialog != null && customDialog.isShowing())
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("saveCarImg"), BaseBean.class);
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("saveCarImg"), BaseBean.class);
|
||||||
if (bb.getCode() == 200) {
|
if (bb.getCode() == 200) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
@@ -171,7 +175,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
ur.vehicleDelTwo(carId);
|
ur.vehicleDelTwo(carId);
|
||||||
Toast.makeText(con, "上传道路运输证成功", Toast.LENGTH_SHORT).show();
|
// Toast.makeText(con, "上传道路运输证成功", Toast.LENGTH_SHORT).show();
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
Toast.makeText(con, "交强险证件上传成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "交强险证件上传成功", Toast.LENGTH_SHORT).show();
|
||||||
@@ -186,11 +190,11 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
Log.e("is", CacheGroup.cacheList.get("saveCarRegisterNo"));
|
Log.e("is", CacheGroup.cacheList.get("saveCarRegisterNo"));
|
||||||
IsAuthDriverAuthQualificationBean ib = gson.fromJson(CacheGroup.cacheList.get("saveCarRegisterNo"), IsAuthDriverAuthQualificationBean.class);
|
IsAuthDriverAuthQualificationBean ib = gson.fromJson(CacheGroup.cacheList.get("saveCarRegisterNo"), IsAuthDriverAuthQualificationBean.class);
|
||||||
if (ib.getCode() == 200) {
|
if (ib.getCode() == 200) {
|
||||||
finish();
|
|
||||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
Intent in = new Intent(con, PhotoCarActivity.class);
|
||||||
in.putExtra("type", 3);
|
in.putExtra("type", 3);
|
||||||
in.putExtra("carId", carId);
|
in.putExtra("carId", carId);
|
||||||
con.startActivity(in);
|
con.startActivity(in);
|
||||||
|
finish();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, ib.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, ib.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
@@ -204,12 +208,11 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
//判断是否需要跳转挂车行驶证页面
|
//判断是否需要跳转挂车行驶证页面
|
||||||
if (!"".equals(carId) && cdb.getData() != null) {
|
if (!"".equals(carId) && cdb.getData() != null) {
|
||||||
if (cdb.getData().getIsTrailer() == 1 && cdb.getData().getTrailerResVo() != null && !TextUtils.isEmpty(cdb.getData().getTrailerResVo().getCarNumber())) {//需要挂车,并且传过挂车直接结束
|
if (cdb.getData().getIsTrailer() == 1 && cdb.getData().getTrailerResVo() != null && !TextUtils.isEmpty(cdb.getData().getTrailerResVo().getCarNumber())) {//需要挂车,并且传过挂车直接结束
|
||||||
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 && cdb.getData().getTrailerResVo() != null && TextUtils.isEmpty(cdb.getData().getTrailerResVo().getCarNumber())) {//需要挂车,没传过挂车,到挂车页面
|
|
||||||
finish();
|
finish();
|
||||||
|
} else if (cdb.getData().getIsTrailer() == 1 && cdb.getData().getTrailerResVo() != null && TextUtils.isEmpty(cdb.getData().getTrailerResVo().getCarNumber())) {//需要挂车,没传过挂车,到挂车页面
|
||||||
Intent in = new Intent(con, CertificatesActivity.class);
|
Intent in = new Intent(con, CertificatesActivity.class);
|
||||||
in.putExtra("index", 3);
|
in.putExtra("index", 3);
|
||||||
in.putExtra("carId", carId);
|
in.putExtra("carId", carId);
|
||||||
@@ -217,6 +220,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
in.putExtra("cheData", new Gson().toJson(cdb));
|
in.putExtra("cheData", new Gson().toJson(cdb));
|
||||||
}
|
}
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
|
finish();
|
||||||
} else if (cdb.getData().getIsTrailer() == 0) {//不需要挂车
|
} else if (cdb.getData().getIsTrailer() == 0) {//不需要挂车
|
||||||
if ("1".equals(cdb.getData().getNeedUpQCPhoto())) {//需要从业资格证
|
if ("1".equals(cdb.getData().getNeedUpQCPhoto())) {//需要从业资格证
|
||||||
Intent in = new Intent(con, AuthQualificationActivity.class);
|
Intent in = new Intent(con, AuthQualificationActivity.class);
|
||||||
@@ -225,10 +229,10 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
in.putExtra("isOverCar", false);
|
in.putExtra("isOverCar", false);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
} else {
|
} else {
|
||||||
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);
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -517,26 +521,26 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
if (null != cdb) {
|
if (null != cdb) {
|
||||||
if (0 == type) {
|
if (0 == type) {
|
||||||
if (!TextUtils.isEmpty(cdb.getData().getCarImage())) {
|
if (!TextUtils.isEmpty(cdb.getData().getCarImage())) {
|
||||||
Glide.with(con).load(cdb.getData().getCarImage()).into(img);
|
ImageLoader.getInstance().loadImage(con,cdb.getData().getCarImage(),img);
|
||||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||||
upload_img.setText("已上传");
|
upload_img.setText("已上传");
|
||||||
}
|
}
|
||||||
} else if (1 == type) {
|
} else if (1 == type) {
|
||||||
if (!TextUtils.isEmpty(cdb.getData().getNfcImage())) {
|
if (!TextUtils.isEmpty(cdb.getData().getNfcImage())) {
|
||||||
Glide.with(con).load(cdb.getData().getNfcImage()).into(img);
|
ImageLoader.getInstance().loadImage(con,cdb.getData().getNfcImage(),img);
|
||||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||||
upload_img.setText("已上传");
|
upload_img.setText("已上传");
|
||||||
}
|
}
|
||||||
} else if (2 == type) {
|
} else if (2 == type) {
|
||||||
if (!TextUtils.isEmpty(cdb.getData().getRegisterImage())) {
|
if (!TextUtils.isEmpty(cdb.getData().getRegisterImage())) {
|
||||||
Glide.with(con).load(cdb.getData().getRegisterImage()).into(img);
|
ImageLoader.getInstance().loadImage(con,cdb.getData().getRegisterImage(),img);
|
||||||
value1.setText(cdb.getData().getRegisterNo());
|
value1.setText(cdb.getData().getRegisterNo());
|
||||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||||
upload_img.setText("已上传");
|
upload_img.setText("已上传");
|
||||||
}
|
}
|
||||||
} else if (3 == type) {
|
} else if (3 == type) {
|
||||||
if (!TextUtils.isEmpty(cdb.getData().getRoadLicensePhoto())) {
|
if (!TextUtils.isEmpty(cdb.getData().getRoadLicensePhoto())) {
|
||||||
Glide.with(con).load(cdb.getData().getRoadLicensePhoto()).into(img);
|
ImageLoader.getInstance().loadImage(con,cdb.getData().getRoadLicensePhoto(),img);
|
||||||
value1.setText(cdb.getData().getRoadLicense());
|
value1.setText(cdb.getData().getRoadLicense());
|
||||||
if (!carExist) {
|
if (!carExist) {
|
||||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||||
@@ -546,7 +550,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
} else if (4 == type) {
|
} else if (4 == type) {
|
||||||
if (!TextUtils.isEmpty(cdb.getData().getPolicyPhotoUrl())) {
|
if (!TextUtils.isEmpty(cdb.getData().getPolicyPhotoUrl())) {
|
||||||
Glide.with(con).load(cdb.getData().getPolicyPhotoUrl()).into(img);
|
ImageLoader.getInstance().loadImage(con,cdb.getData().getPolicyPhotoUrl(),img);
|
||||||
value1.setText(cdb.getData().getInsuranceCompany());
|
value1.setText(cdb.getData().getInsuranceCompany());
|
||||||
value2.setText(cdb.getData().getInsuranceEndDay());
|
value2.setText(cdb.getData().getInsuranceEndDay());
|
||||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||||
@@ -635,8 +639,11 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
tvSkip.setVisibility(isShowSkip[type] ? View.GONE : View.VISIBLE);
|
tvSkip.setVisibility(isShowSkip[type] ? View.GONE : View.VISIBLE);
|
||||||
llInfo.setVisibility(isShowEdit[type] ? View.VISIBLE : View.GONE);
|
llInfo.setVisibility(isShowEdit[type] ? View.VISIBLE : View.GONE);
|
||||||
if (type == 4) {
|
if (type == 4) {
|
||||||
|
value1.setInputType(InputType.TYPE_CLASS_TEXT);
|
||||||
llDate.setVisibility(View.VISIBLE);
|
llDate.setVisibility(View.VISIBLE);
|
||||||
title3.setText("保险公司");
|
title3.setText("保险公司");
|
||||||
|
}else {
|
||||||
|
value1.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.news.NewActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.news.NewActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.wallet.UpBankActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.wallet.UpBankActivity;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.ui.web.WebOnlyOneActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.OneDayShowUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.OneDayShowUtils;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.PermissionUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.PermissionUtils;
|
||||||
@@ -68,6 +69,7 @@ import com.google.gson.Gson;
|
|||||||
import com.gyf.cactus.Cactus;
|
import com.gyf.cactus.Cactus;
|
||||||
import com.hjq.xtoast.XToast;
|
import com.hjq.xtoast.XToast;
|
||||||
import com.lxj.xpopup.XPopup;
|
import com.lxj.xpopup.XPopup;
|
||||||
|
import com.lxj.xpopup.core.BasePopupView;
|
||||||
import com.lxj.xpopup.interfaces.OnConfirmListener;
|
import com.lxj.xpopup.interfaces.OnConfirmListener;
|
||||||
import com.arpa.hndahesudintocctmsdriver.R;
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
import com.arpa.hndahesudintocctmsdriver.report.ALProcess;
|
import com.arpa.hndahesudintocctmsdriver.report.ALProcess;
|
||||||
@@ -101,6 +103,7 @@ 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.interfaces.SimpleCallback;
|
||||||
import com.permissionx.guolindev.PermissionX;
|
import com.permissionx.guolindev.PermissionX;
|
||||||
import com.youth.banner.Banner;
|
import com.youth.banner.Banner;
|
||||||
import com.youth.banner.BannerConfig;
|
import com.youth.banner.BannerConfig;
|
||||||
@@ -151,6 +154,8 @@ public class HomeFragment extends BaseFragment {
|
|||||||
|
|
||||||
private XToast xToast;
|
private XToast xToast;
|
||||||
|
|
||||||
|
private boolean isUpAppShow = false;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void msgMethod(Message m) {
|
public void msgMethod(Message m) {
|
||||||
@@ -239,6 +244,19 @@ public class HomeFragment extends BaseFragment {
|
|||||||
new XPopup.Builder(con)
|
new XPopup.Builder(con)
|
||||||
.dismissOnBackPressed(false)
|
.dismissOnBackPressed(false)
|
||||||
.dismissOnTouchOutside(false)
|
.dismissOnTouchOutside(false)
|
||||||
|
.setPopupCallback(new SimpleCallback() {
|
||||||
|
@Override
|
||||||
|
public void onShow(BasePopupView popupView) {
|
||||||
|
super.onShow(popupView);
|
||||||
|
isUpAppShow = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDismiss(BasePopupView popupView) {
|
||||||
|
super.onDismiss(popupView);
|
||||||
|
isUpAppShow = false;
|
||||||
|
}
|
||||||
|
})
|
||||||
.asCustom(new UpAppAlert(con, uab.getData().getDownloadUrl(), uab.getData().getContent(), uab.getData().getVersion(), uab.getData().getForce()))
|
.asCustom(new UpAppAlert(con, uab.getData().getDownloadUrl(), uab.getData().getContent(), uab.getData().getVersion(), uab.getData().getForce()))
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
@@ -258,6 +276,11 @@ public class HomeFragment extends BaseFragment {
|
|||||||
if (CacheGroup.cacheList.get(WoDeFragment.AUTH_DATA) != null) {
|
if (CacheGroup.cacheList.get(WoDeFragment.AUTH_DATA) != null) {
|
||||||
DriverAuthDataBean dad = gson.fromJson(CacheGroup.cacheList.get(WoDeFragment.AUTH_DATA), DriverAuthDataBean.class);
|
DriverAuthDataBean dad = gson.fromJson(CacheGroup.cacheList.get(WoDeFragment.AUTH_DATA), DriverAuthDataBean.class);
|
||||||
if (dad.getCode() == 200) {
|
if (dad.getCode() == 200) {
|
||||||
|
if (isUpAppShow) {
|
||||||
|
CacheGroup.cacheList.remove(WoDeFragment.AUTH_DATA);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (dad.getData() == null) {
|
if (dad.getData() == null) {
|
||||||
new MessageUtils().showSimCenPop(con, "该司机缺少身份证,未认证无法接单。是否去添加!", "去添加", () -> {
|
new MessageUtils().showSimCenPop(con, "该司机缺少身份证,未认证无法接单。是否去添加!", "去添加", () -> {
|
||||||
Intent in = new Intent(con, CertificatesActivity.class);
|
Intent in = new Intent(con, CertificatesActivity.class);
|
||||||
@@ -437,6 +460,7 @@ public class HomeFragment extends BaseFragment {
|
|||||||
});
|
});
|
||||||
btn_update.setOnClickListener(v -> {
|
btn_update.setOnClickListener(v -> {
|
||||||
getRequest();
|
getRequest();
|
||||||
|
refreshWaybills();
|
||||||
});
|
});
|
||||||
home_top.setOnClickListener(v -> {
|
home_top.setOnClickListener(v -> {
|
||||||
if (!UiAuxiliary.isLogin(con)) {
|
if (!UiAuxiliary.isLogin(con)) {
|
||||||
@@ -497,6 +521,7 @@ public class HomeFragment extends BaseFragment {
|
|||||||
Log.e("下拉刷新", "pps");
|
Log.e("下拉刷新", "pps");
|
||||||
keys = true;
|
keys = true;
|
||||||
getRequest();
|
getRequest();
|
||||||
|
refreshWaybills();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -761,6 +786,7 @@ public class HomeFragment extends BaseFragment {
|
|||||||
*/
|
*/
|
||||||
public void initMap() {
|
public void initMap() {
|
||||||
getRequest();
|
getRequest();
|
||||||
|
refreshWaybills();
|
||||||
}
|
}
|
||||||
|
|
||||||
private CustomDialog customDialog;
|
private CustomDialog customDialog;
|
||||||
@@ -773,18 +799,18 @@ public class HomeFragment extends BaseFragment {
|
|||||||
// customDialog=new CustomDialog(con,"加载中...");
|
// customDialog=new CustomDialog(con,"加载中...");
|
||||||
// customDialog.show();
|
// customDialog.show();
|
||||||
ur.upApp();
|
ur.upApp();
|
||||||
hyr.getHuoYuan(1, 100);
|
// hyr.getHuoYuan(1, 100);
|
||||||
ur.getImage(1);
|
ur.getImage(1);
|
||||||
WalletRequest qr = new WalletRequest(con, hd);
|
WalletRequest qr = new WalletRequest(con, hd);
|
||||||
|
|
||||||
if (UiAuxiliary.isLogin(con)) {
|
if (UiAuxiliary.isLogin(con)) {
|
||||||
int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
// int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
||||||
ur.User();
|
ur.User();
|
||||||
// if (!OneDayShowUtils.getInstance().todayIsShow(con)) {
|
// if (!OneDayShowUtils.getInstance().todayIsShow(con)) {
|
||||||
// qr.getBankCardList();
|
// qr.getBankCardList();
|
||||||
// }
|
// }
|
||||||
ur.getDriverExpire();
|
ur.getDriverExpire();
|
||||||
hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
// hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
||||||
// hyr.startOrder(0);
|
// hyr.startOrder(0);
|
||||||
//获取权限 应用市场审核不通过
|
//获取权限 应用市场审核不通过
|
||||||
ur.driverAuthData();
|
ur.driverAuthData();
|
||||||
@@ -1022,7 +1048,7 @@ public class HomeFragment extends BaseFragment {
|
|||||||
banner.isAutoPlay(true);
|
banner.isAutoPlay(true);
|
||||||
banner.setIndicatorGravity(BannerConfig.CENTER);
|
banner.setIndicatorGravity(BannerConfig.CENTER);
|
||||||
banner.setOnBannerListener(position -> {//System.out.println("跳转");
|
banner.setOnBannerListener(position -> {//System.out.println("跳转");
|
||||||
Intent in = new Intent(con, WebActivity.class);
|
Intent in = new Intent(con, WebOnlyOneActivity.class);
|
||||||
Intent inL = new Intent(con, LoginActivity.class);
|
Intent inL = new Intent(con, LoginActivity.class);
|
||||||
in.putExtra("url", ic.getData().get(position).getJumpUrl());
|
in.putExtra("url", ic.getData().get(position).getJumpUrl());
|
||||||
in.putExtra("title", ic.getData().get(position).getTitle());
|
in.putExtra("title", ic.getData().get(position).getTitle());
|
||||||
@@ -1043,7 +1069,7 @@ public class HomeFragment extends BaseFragment {
|
|||||||
@Override
|
@Override
|
||||||
public void displayImage(Context context, Object path, ImageView imageView) {
|
public void displayImage(Context context, Object path, ImageView imageView) {
|
||||||
if (HomeFragment.this != null && getActivity() != null && !getActivity().isDestroyed()) {
|
if (HomeFragment.this != null && getActivity() != null && !getActivity().isDestroyed()) {
|
||||||
Glide.with(con).load(path).into(imageView);
|
com.dahe.mylibrary.utils.ImageLoader.getInstance().loadImage(con,path,imageView);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1154,6 +1180,7 @@ public class HomeFragment extends BaseFragment {
|
|||||||
.permissions(Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
.permissions(Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||||
Manifest.permission.ACCESS_FINE_LOCATION,
|
Manifest.permission.ACCESS_FINE_LOCATION,
|
||||||
|
Manifest.permission.ACCESS_BACKGROUND_LOCATION,
|
||||||
Manifest.permission.CAMERA,
|
Manifest.permission.CAMERA,
|
||||||
Manifest.permission.ACCESS_COARSE_LOCATION)
|
Manifest.permission.ACCESS_COARSE_LOCATION)
|
||||||
.request((allGranted, grantedList, deniedList) -> {
|
.request((allGranted, grantedList, deniedList) -> {
|
||||||
@@ -1274,14 +1301,32 @@ public class HomeFragment extends BaseFragment {
|
|||||||
initView(null);
|
initView(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Override
|
||||||
public void processResult(HomeWaybillEvent home) {
|
public void onStart() {
|
||||||
if (home.getMessage() == 1) {
|
super.onStart();
|
||||||
|
// ToastUtils.showToast(con,"onstart");
|
||||||
|
// refreshLayout.autoRefresh();
|
||||||
|
refreshWaybills();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshWaybills() {
|
||||||
hyr.getHuoYuan(1, 100);
|
hyr.getHuoYuan(1, 100);
|
||||||
} else {
|
if (UiAuxiliary.isLogin(con)) {
|
||||||
int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
||||||
hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void processResult(HomeWaybillEvent home) {
|
||||||
|
// if (home.getMessage() == 1) {
|
||||||
|
// int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
||||||
|
// hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
||||||
|
// hyr.getHuoYuan(1, 100);
|
||||||
|
// } else {
|
||||||
|
// int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
||||||
|
// hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,6 +133,8 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
//finish();
|
//finish();
|
||||||
} else {
|
} else {
|
||||||
|
EventBus.getDefault().post(new HomeWaybillEvent(1));
|
||||||
|
finish();
|
||||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
}
|
}
|
||||||
@@ -313,7 +315,11 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
|||||||
});
|
});
|
||||||
//
|
//
|
||||||
ImageButton xuanze = v.findViewById(R.id.xuanze);
|
ImageButton xuanze = v.findViewById(R.id.xuanze);
|
||||||
if (clb != null && clb.getData().size() == 1) {
|
|
||||||
|
if (hyd!=null&&hyd.getData()!=null&& !TextUtils.isEmpty(hyd.getData().getCarNumber())){
|
||||||
|
cid = hyd.getData().getCarId();
|
||||||
|
car.setText("选择车辆:" + hyd.getData().getCarNumber());
|
||||||
|
}else if (clb != null && clb.getData().size() == 1) {
|
||||||
cid = clb.getData().get(0).getCarId();
|
cid = clb.getData().get(0).getCarId();
|
||||||
car.setText("选择车辆:" + clb.getData().get(0).getCarNumber());
|
car.setText("选择车辆:" + clb.getData().get(0).getCarNumber());
|
||||||
}
|
}
|
||||||
@@ -406,6 +412,7 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
|||||||
|
|
||||||
UiAuxiliary.homeRequest("接单");
|
UiAuxiliary.homeRequest("接单");
|
||||||
Intent in = new Intent(con, StartYunDanActivity.class);
|
Intent in = new Intent(con, StartYunDanActivity.class);
|
||||||
|
in.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||||
in.putExtra("id", "0");
|
in.putExtra("id", "0");
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
finish();
|
finish();
|
||||||
@@ -532,4 +539,9 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
|||||||
// ALProcess.verification(con, hd);
|
// ALProcess.verification(con, hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
EventBus.getDefault().unregister(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -44,6 +44,7 @@ import com.amap.api.services.route.WalkRouteResult;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.dahe.mylibrary.utils.ImageLoader;
|
||||||
import com.dahe.mylibrary.utils.TimeUtil;
|
import com.dahe.mylibrary.utils.TimeUtil;
|
||||||
import com.dahe.mylibrary.utils.ToastUtils;
|
import com.dahe.mylibrary.utils.ToastUtils;
|
||||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||||
@@ -234,7 +235,7 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
ImageView head_img = v.findViewById(R.id.head_img);
|
ImageView head_img = v.findViewById(R.id.head_img);
|
||||||
if (ub != null && ub.getData() != null && !ub.getData().getHeadportraitUrl().equals("")) {
|
if (ub != null && ub.getData() != null && !ub.getData().getHeadportraitUrl().equals("")) {
|
||||||
Glide.with(con).load(ub.getData().getHeadportraitUrl()).into(head_img);
|
ImageLoader.getInstance().loadImage(con,ub.getData().getHeadportraitUrl(),head_img);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
+2
-1
@@ -21,6 +21,7 @@ import com.bumptech.glide.Glide;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.R;
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
||||||
|
import com.dahe.mylibrary.utils.ImageLoader;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
@@ -58,7 +59,7 @@ public class VideoReleaseActivity extends BaseActivity {
|
|||||||
public void initView(Object obj) {
|
public void initView(Object obj) {
|
||||||
super.initView(obj);
|
super.initView(obj);
|
||||||
getFirstframe(videoPath);
|
getFirstframe(videoPath);
|
||||||
Glide.with(con).load(new File(coverPath)).into(video_cover);
|
ImageLoader.getInstance().loadImage(con,new File(coverPath),video_cover);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void submit(View v){
|
public void submit(View v){
|
||||||
|
|||||||
+3
-2
@@ -8,6 +8,7 @@ import android.widget.TextView;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.dahe.mylibrary.utils.ImageLoader;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.lxj.xpopup.XPopup;
|
import com.lxj.xpopup.XPopup;
|
||||||
import com.arpa.hndahesudintocctmsdriver.R;
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
@@ -72,7 +73,7 @@ public class GetShangChuanActivity extends BaseActivity {
|
|||||||
//coordinate.setText(StringUtil.isNull(sdw.getLongitude(),"")+","+StringUtil.isNull(sdw.getLatitude(),""));
|
//coordinate.setText(StringUtil.isNull(sdw.getLongitude(),"")+","+StringUtil.isNull(sdw.getLatitude(),""));
|
||||||
//coordinate2.setText(StringUtil.isNull(sdw.getReceiptLongitude(),"")+","+StringUtil.isNull(sdw.getReceiptLatitude(),""));
|
//coordinate2.setText(StringUtil.isNull(sdw.getReceiptLongitude(),"")+","+StringUtil.isNull(sdw.getReceiptLatitude(),""));
|
||||||
if(sdw.getSendPutImagesUrl()!=null && sdw.getSendPutImagesUrl().size()>=1){
|
if(sdw.getSendPutImagesUrl()!=null && sdw.getSendPutImagesUrl().size()>=1){
|
||||||
Glide.with(con).load(sdw.getSendPutImagesUrl().get(0)).into(img1);
|
ImageLoader.getInstance().loadImage(con,sdw.getSendPutImagesUrl().get(0),img1);
|
||||||
img1.setOnClickListener(v -> {
|
img1.setOnClickListener(v -> {
|
||||||
new XPopup.Builder(con)
|
new XPopup.Builder(con)
|
||||||
.asImageViewer(img1,sdw.getSendPutImagesUrl().get(0), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
.asImageViewer(img1,sdw.getSendPutImagesUrl().get(0), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||||
@@ -83,7 +84,7 @@ public class GetShangChuanActivity extends BaseActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if(sdw.getReceiptUrl()!=null && sdw.getReceiptUrl().size()>=1){
|
if(sdw.getReceiptUrl()!=null && sdw.getReceiptUrl().size()>=1){
|
||||||
Glide.with(con).load(sdw.getReceiptUrl().get(0)).into(img2);
|
ImageLoader.getInstance().loadImage(con,sdw.getReceiptUrl().get(0),img2);
|
||||||
img2.setOnClickListener(v -> {
|
img2.setOnClickListener(v -> {
|
||||||
new XPopup.Builder(con)
|
new XPopup.Builder(con)
|
||||||
.asImageViewer(img2,sdw.getReceiptUrl().get(0), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
.asImageViewer(img2,sdw.getReceiptUrl().get(0), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||||
|
|||||||
+288
-62
@@ -27,13 +27,17 @@ import com.alct.mdp.model.Location;
|
|||||||
import com.alct.mdp.model.ShipmentStatusEnum;
|
import com.alct.mdp.model.ShipmentStatusEnum;
|
||||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
|
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.GDImage;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.GDLocation;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.WaybillStatusBean;
|
import com.arpa.hndahesudintocctmsdriver.bean.WaybillStatusBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.HomeWaybillEvent;
|
import com.arpa.hndahesudintocctmsdriver.event.HomeWaybillEvent;
|
||||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.OCRRequest;
|
import com.arpa.hndahesudintocctmsdriver.request.OCRRequest;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.TrackInputBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.BitmapUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.BitmapUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.NewLJUtils;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||||
@@ -42,7 +46,10 @@ import com.arpa.hndahesudintocctmsdriver.util.location.LocationUtil;
|
|||||||
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.callback.OnGDDownloadResultListener;
|
||||||
|
import com.dahe.mylibrary.callback.OnGDResultListener;
|
||||||
import com.dahe.mylibrary.utils.ActivityUtils;
|
import com.dahe.mylibrary.utils.ActivityUtils;
|
||||||
|
import com.dahe.mylibrary.utils.ImageLoader;
|
||||||
import com.dahe.mylibrary.utils.ToastUtils;
|
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;
|
||||||
@@ -107,6 +114,11 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
public void msgMethod(Message m) {
|
public void msgMethod(Message m) {
|
||||||
super.msgMethod(m);
|
super.msgMethod(m);
|
||||||
switch (m.what) {
|
switch (m.what) {
|
||||||
|
case RequsetCodeConstants.ERROR:
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
break;
|
||||||
case RequsetCodeConstants.SUCCESS:
|
case RequsetCodeConstants.SUCCESS:
|
||||||
if (CacheGroup.cacheList.get("upload") != null) {
|
if (CacheGroup.cacheList.get("upload") != null) {
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
@@ -117,7 +129,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
if (ub.getCode() == 200) {
|
if (ub.getCode() == 200) {
|
||||||
imgIds.add(ub.getData().getId());
|
imgIds.add(ub.getData().getId());
|
||||||
// Glide.with(con).load(ub.getData().getUrl()).into(res_img);
|
// Glide.with(con).load(ub.getData().getUrl()).into(res_img);
|
||||||
Glide.with(con).load(path).into(res_img);
|
ImageLoader.getInstance().loadImage(con,path,res_img);
|
||||||
res_img.setVisibility(View.VISIBLE);
|
res_img.setVisibility(View.VISIBLE);
|
||||||
img_delete.setVisibility(View.VISIBLE);
|
img_delete.setVisibility(View.VISIBLE);
|
||||||
img_icon.setVisibility(View.GONE);
|
img_icon.setVisibility(View.GONE);
|
||||||
@@ -127,6 +139,17 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove("upload");
|
CacheGroup.cacheList.remove("upload");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CacheGroup.cacheList.get("genzong") != null) {
|
||||||
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("genzong"), BaseBean.class);
|
||||||
|
if (bb.getCode() == 200) {
|
||||||
|
Log.e("--轨迹上传--", "成功");
|
||||||
|
} else {
|
||||||
|
Log.e("--轨迹上传失败:--", bb.getMsg());
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove("genzong");
|
||||||
|
}
|
||||||
|
|
||||||
if (CacheGroup.cacheList.get("waybillStatus") != null) {
|
if (CacheGroup.cacheList.get("waybillStatus") != null) {
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
@@ -174,6 +197,8 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
}
|
}
|
||||||
|
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||||
|
finish();
|
||||||
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]);
|
||||||
@@ -456,29 +481,54 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
Log.e("--装货信息", gson.toJson(lub));
|
Log.e("--装货信息", gson.toJson(lub));
|
||||||
if (locationKey) {//高德定位
|
if (locationKey) {//高德定位
|
||||||
if (keys) {
|
if (keys) {
|
||||||
MDPLocationCollectionManager.getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnDownloadResultListener() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(Object o) {
|
|
||||||
|
|
||||||
String string = o.toString();
|
NewLJUtils.getInstance().getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnGDDownloadResultListener() {
|
||||||
if (string.equals("PICKUPED")) {//安联装货,单平台未装货
|
@Override
|
||||||
|
public void onSuccess(String var1) {
|
||||||
|
String string = var1;
|
||||||
|
if (string.equals("30")) {//安联装货,单平台未装货
|
||||||
isFinish = true;
|
isFinish = true;
|
||||||
//平台确认装货
|
//平台确认装货
|
||||||
hyr.loading(lub);
|
hyr.loading(lub);
|
||||||
} else {
|
} else {
|
||||||
nfc();
|
// nfc();
|
||||||
loadInfo();
|
loadInfo();
|
||||||
}
|
}
|
||||||
|
upLocation(lgdu.getLatitude() + "", lgdu.getLongitude() + "",sob.getData().getShippingNoteNumber());
|
||||||
|
// NewLJUtils.getInstance().startLocationService(ShangChuangImgActivity.this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(String s, String s1) {
|
public void onFailure(String var1, String var2) {
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
}
|
}
|
||||||
ToastUtils.showToast(con, s1);
|
ToastUtils.showToast(con, var2);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// MDPLocationCollectionManager.getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnDownloadResultListener() {
|
||||||
|
// @Override
|
||||||
|
// public void onSuccess(Object o) {
|
||||||
|
//
|
||||||
|
// String string = o.toString();
|
||||||
|
// if (string.equals("PICKUPED")) {//安联装货,单平台未装货
|
||||||
|
// isFinish = true;
|
||||||
|
// //平台确认装货
|
||||||
|
// hyr.loading(lub);
|
||||||
|
// } else {
|
||||||
|
// nfc();
|
||||||
|
// loadInfo();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onFailure(String s, String s1) {
|
||||||
|
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
// customDialog.dismiss();
|
||||||
|
// }
|
||||||
|
// ToastUtils.showToast(con, s1);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
// nfc();
|
// nfc();
|
||||||
@@ -511,10 +561,11 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
Log.e("--卸货信息", gson.toJson(lub));
|
Log.e("--卸货信息", gson.toJson(lub));
|
||||||
if (locationKey) {
|
if (locationKey) {
|
||||||
if (keys) {
|
if (keys) {
|
||||||
MDPLocationCollectionManager.getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnDownloadResultListener() {
|
|
||||||
|
NewLJUtils.getInstance().getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnGDDownloadResultListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Object o) {
|
public void onSuccess(String var1) {
|
||||||
if (o.toString().equals("UNLOADED")) {//安联装货,单平台未装货
|
if (var1.equals("40")) {//安联装货,单平台未装货
|
||||||
//卸货状态-平台
|
//卸货状态-平台
|
||||||
isFinish = true;
|
isFinish = true;
|
||||||
hyr.dischargeCargo(lub);
|
hyr.dischargeCargo(lub);
|
||||||
@@ -522,17 +573,41 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
nfc();
|
nfc();
|
||||||
uploadInfo();
|
uploadInfo();
|
||||||
}
|
}
|
||||||
|
upLocation(lgdu.getLatitude() + "", lgdu.getLongitude() + "",sob.getData().getShippingNoteNumber());
|
||||||
|
// NewLJUtils.getInstance().stopLocationService();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(String s, String s1) {
|
public void onFailure(String var1, String var2) {
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
}
|
}
|
||||||
ToastUtils.showToast(con, s1);
|
ToastUtils.showToast(con, var2);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// MDPLocationCollectionManager.getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnDownloadResultListener() {
|
||||||
|
// @Override
|
||||||
|
// public void onSuccess(Object o) {
|
||||||
|
// if (o.toString().equals("UNLOADED")) {//安联装货,单平台未装货
|
||||||
|
// //卸货状态-平台
|
||||||
|
// isFinish = true;
|
||||||
|
// hyr.dischargeCargo(lub);
|
||||||
|
// } else {
|
||||||
|
// nfc();
|
||||||
|
// uploadInfo();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onFailure(String s, String s1) {
|
||||||
|
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
// customDialog.dismiss();
|
||||||
|
// }
|
||||||
|
// ToastUtils.showToast(con, s1);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
// nfc();
|
// nfc();
|
||||||
// uploadInfo();
|
// uploadInfo();
|
||||||
@@ -569,8 +644,8 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
if (locationKey) {
|
if (locationKey) {
|
||||||
if (index == 2 && keys) {
|
if (index == 2 && keys) {
|
||||||
up_trafficSign();
|
up_trafficSign();
|
||||||
up_trafficReceipt();
|
// up_trafficReceipt();
|
||||||
receipt_image();
|
// receipt_image();
|
||||||
}
|
}
|
||||||
hyr.receipt(urib);
|
hyr.receipt(urib);
|
||||||
} else {
|
} else {
|
||||||
@@ -617,7 +692,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
//上传安联-签收
|
//上传安联-签收
|
||||||
public void up_trafficSign() {
|
public void up_trafficSign() {
|
||||||
//安联
|
//安联
|
||||||
Location l = new Location();
|
GDLocation l = new GDLocation();
|
||||||
l.setBaiduLongitude(latLng.longitude);
|
l.setBaiduLongitude(latLng.longitude);
|
||||||
l.setBaiduLatitude(latLng.latitude);
|
l.setBaiduLatitude(latLng.latitude);
|
||||||
l.setLocation(lgdu.getAddress());
|
l.setLocation(lgdu.getAddress());
|
||||||
@@ -641,56 +716,86 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MDPLocationCollectionManager.sign(con, sob.getData().getShippingNoteNumber(), l, gs, new com.alct.mdp.callback.OnResultListener() {
|
|
||||||
|
NewLJUtils.getInstance().sign(con, sob.getData().getShippingNoteNumber(), l, new OnGDResultListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
|
NewLJUtils.getInstance().stopLocationService();
|
||||||
|
up_trafficReceipt();
|
||||||
|
receipt_image();
|
||||||
Log.e("上报安联", "签收成功");
|
Log.e("上报安联", "签收成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(String s, String s1) {
|
public void onFailure(String var1, String var2) {
|
||||||
Log.e("上报安联失败(签收):", s + s1);
|
Log.e("上报安联失败(签收):", var1 + var2);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// MDPLocationCollectionManager.sign(con, sob.getData().getShippingNoteNumber(), l, gs, new com.alct.mdp.callback.OnResultListener() {
|
||||||
|
// @Override
|
||||||
|
// public void onSuccess() {
|
||||||
|
// Log.e("上报安联", "签收成功");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onFailure(String s, String s1) {
|
||||||
|
// Log.e("上报安联失败(签收):", s + s1);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
//上传安联-回单
|
//上传安联-回单
|
||||||
public void up_trafficReceipt() {
|
public void up_trafficReceipt() {
|
||||||
//安联
|
//安联
|
||||||
Location l = new Location();
|
GDLocation l = new GDLocation();
|
||||||
l.setBaiduLongitude(latLng.longitude);
|
l.setBaiduLongitude(latLng.longitude);
|
||||||
l.setBaiduLatitude(latLng.latitude);
|
l.setBaiduLatitude(latLng.latitude);
|
||||||
l.setLocation(lgdu.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() {
|
|
||||||
|
|
||||||
|
NewLJUtils.getInstance().pod(con, sob.getData().getShippingNoteNumber(), l, new OnGDResultListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
Log.e("上报安联", "回单上传成功");
|
Log.e("上报安联", "回单上传成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(String s, String s1) {
|
public void onFailure(String var1, String var2) {
|
||||||
Log.e("上报安联失败(回单):", s + s1);
|
Log.e("上报安联失败(回单):", var1 + var2);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
// MDPLocationCollectionManager.pod(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);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
public void up_image_z() {
|
public void up_image_z() {
|
||||||
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||||
File file = new File(path);
|
File file = new File(path);
|
||||||
Image image = new Image();
|
GDImage image = new GDImage();
|
||||||
String base = BitmapUtil.imageToBase64(path);
|
String base = BitmapUtil.imageToBase64(path);
|
||||||
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||||
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.setTime(Timer.getTimerT());
|
||||||
image.setBaiduLongitude(latLng.longitude);
|
image.setBaiduLongitude(latLng.longitude);
|
||||||
image.setBaiduLatitude(latLng.latitude);
|
image.setBaiduLatitude(latLng.latitude);
|
||||||
image.setLocation(lgdu.getAddress());
|
image.setLocation(lgdu.getAddress());
|
||||||
MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
|
||||||
|
|
||||||
|
String json = new Gson().toJson(image);
|
||||||
|
|
||||||
|
NewLJUtils.getInstance().uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new OnGDResultListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
@@ -703,30 +808,50 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(String s, String s1) {
|
public void onFailure(String var1, String var2) {
|
||||||
Log.e("上报安联失败(装货照片):", s + s1);
|
Log.e("上报安联失败(装货照片):", var1 + var2);
|
||||||
// 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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onSuccess() {
|
||||||
|
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
// customDialog.dismiss();
|
||||||
|
// }
|
||||||
|
// EventBus.getDefault().post(new HomeWaybillEvent());
|
||||||
|
// 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() {
|
public void up_image() {
|
||||||
File file = new File(path);
|
File file = new File(path);
|
||||||
Image image = new Image();
|
GDImage image = new GDImage();
|
||||||
String base = BitmapUtil.imageToBase64(path);
|
String base = BitmapUtil.imageToBase64(path);
|
||||||
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||||
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.setTime(Timer.getTimerT());
|
||||||
image.setBaiduLongitude(latLng.longitude);
|
image.setBaiduLongitude(latLng.longitude);
|
||||||
image.setBaiduLatitude(latLng.latitude);
|
image.setBaiduLatitude(latLng.latitude);
|
||||||
image.setLocation(lgdu.getAddress());
|
image.setLocation(lgdu.getAddress());
|
||||||
MDPLocationCollectionManager.uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
|
||||||
|
|
||||||
|
NewLJUtils.getInstance().uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new OnGDResultListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
@@ -739,34 +864,56 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(String s, String s1) {
|
public void onFailure(String var1, String var2) {
|
||||||
Log.e("上报安联失败(卸货照片):", s + s1);
|
Log.e("上报安联失败(卸货照片):", var1 + var2);
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
}
|
}
|
||||||
// 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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
// MDPLocationCollectionManager.uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onSuccess() {
|
||||||
|
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
// customDialog.dismiss();
|
||||||
|
// }
|
||||||
|
// EventBus.getDefault().post(new HomeWaybillEvent());
|
||||||
|
// Log.e("上报安联", "卸货照片上传成功");
|
||||||
|
// Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
// finish();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onFailure(String s, String s1) {
|
||||||
|
// Log.e("上报安联失败(卸货照片):", s + s1);
|
||||||
|
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
// customDialog.dismiss();
|
||||||
|
// }
|
||||||
|
//// 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() {
|
public void receipt_image() {
|
||||||
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||||
File file = new File(path);
|
File file = new File(path);
|
||||||
Image image = new Image();
|
GDImage image = new GDImage();
|
||||||
String base = BitmapUtil.imageToBase64(path);
|
String base = BitmapUtil.imageToBase64(path);
|
||||||
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||||
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.setTime(Timer.getTimerT());
|
||||||
image.setBaiduLongitude(latLng.longitude);
|
image.setBaiduLongitude(latLng.longitude);
|
||||||
image.setBaiduLatitude(latLng.latitude);
|
image.setBaiduLatitude(latLng.latitude);
|
||||||
image.setLocation(lgdu.getAddress());
|
image.setLocation(lgdu.getAddress());
|
||||||
MDPLocationCollectionManager.uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
|
||||||
|
|
||||||
|
NewLJUtils.getInstance().uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new OnGDResultListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
@@ -780,15 +927,34 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(String s, String s1) {
|
public void onFailure(String var1, String var2) {
|
||||||
Log.e("上报安联失败(回单照片):", s + s1);
|
Log.e("上报安联失败(回单照片):", var1 + var2);
|
||||||
// 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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
// MDPLocationCollectionManager.uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onSuccess() {
|
||||||
|
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
// customDialog.dismiss();
|
||||||
|
// }
|
||||||
|
// SPUtils.remove(con, "curWaybillId");
|
||||||
|
// EventBus.getDefault().post(new HomeWaybillEvent());
|
||||||
|
// 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
|
@Override
|
||||||
@@ -827,12 +993,13 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
private void loadInfo() {
|
private void loadInfo() {
|
||||||
//安联
|
//安联
|
||||||
if (sob.getData().getReportAlct() == 1) {
|
if (sob.getData().getReportAlct() == 1) {
|
||||||
Location l = new Location();
|
GDLocation l = new GDLocation();
|
||||||
l.setBaiduLongitude(latLng.longitude);
|
l.setBaiduLongitude(latLng.longitude);
|
||||||
l.setBaiduLatitude(latLng.latitude);
|
l.setBaiduLatitude(latLng.latitude);
|
||||||
l.setLocation(lgdu.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() {
|
|
||||||
|
NewLJUtils.getInstance().pickUp(con, sob.getData().getShippingNoteNumber(), l, new OnGDResultListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
Log.e("上报安联", "装货上传成功");
|
Log.e("上报安联", "装货上传成功");
|
||||||
@@ -840,6 +1007,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
if (sob.getData().getReport() == 1) {
|
if (sob.getData().getReport() == 1) {
|
||||||
JTTProcess.start(con, sob, "");
|
JTTProcess.start(con, sob, "");
|
||||||
}
|
}
|
||||||
|
NewLJUtils.getInstance().startLocationService(ShangChuangImgActivity.this);
|
||||||
//装货状态
|
//装货状态
|
||||||
hyr.loading(lub);
|
hyr.loading(lub);
|
||||||
//装货照片
|
//装货照片
|
||||||
@@ -847,14 +1015,39 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(String s, String s1) {
|
public void onFailure(String var1, String var2) {
|
||||||
Log.e("上报安联失败(装货):", s + s1);
|
Log.e("上报安联失败(装货):", var1 + var2);
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
}
|
}
|
||||||
new MessageUtils().showCenMessage(con, s1);
|
new MessageUtils().showCenMessage(con, var2);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.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);
|
||||||
|
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
// customDialog.dismiss();
|
||||||
|
// }
|
||||||
|
// new MessageUtils().showCenMessage(con, s1);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -866,13 +1059,14 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
|
|
||||||
//安联
|
//安联
|
||||||
if (sob.getData().getReportAlct() == 1) {
|
if (sob.getData().getReportAlct() == 1) {
|
||||||
Location l = new Location();
|
GDLocation l = new GDLocation();
|
||||||
l.setBaiduLongitude(latLng.longitude);
|
l.setBaiduLongitude(latLng.longitude);
|
||||||
l.setBaiduLatitude(latLng.latitude);
|
l.setBaiduLatitude(latLng.latitude);
|
||||||
l.setLocation(lgdu.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() {
|
|
||||||
|
NewLJUtils.getInstance().unload(con, sob.getData().getShippingNoteNumber(), l, new OnGDResultListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
Log.e("上报安联", "卸货上传成功");
|
Log.e("上报安联", "卸货上传成功");
|
||||||
@@ -880,6 +1074,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
if (sob.getData().getReport() == 1) {
|
if (sob.getData().getReport() == 1) {
|
||||||
JTTProcess.stop(con, sob, "");
|
JTTProcess.stop(con, sob, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
//卸货状态-平台
|
//卸货状态-平台
|
||||||
hyr.dischargeCargo(lub);
|
hyr.dischargeCargo(lub);
|
||||||
//卸货照片-安联
|
//卸货照片-安联
|
||||||
@@ -887,17 +1082,48 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(String s, String s1) {
|
public void onFailure(String var1, String var2) {
|
||||||
Log.e("上报安联失败(卸货):", s + s1);
|
Log.e("上报安联失败(卸货):", var1 + var2);
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
}
|
}
|
||||||
new MessageUtils().showCenMessage(con, s1);
|
new MessageUtils().showCenMessage(con, var2);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.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);
|
||||||
|
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
// customDialog.dismiss();
|
||||||
|
// }
|
||||||
|
// new MessageUtils().showCenMessage(con, s1);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void upLocation(String lat,String lon,String shippingNoteNumber){
|
||||||
|
TrackInputBean tib = new TrackInputBean();
|
||||||
|
tib.setLatitude(lat);
|
||||||
|
tib.setLongitude(lon);
|
||||||
|
tib.setShippingNoteNumber(shippingNoteNumber);
|
||||||
|
hyr.trackTracking(tib);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+900
@@ -0,0 +1,900 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Message;
|
||||||
|
import android.provider.Settings;
|
||||||
|
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.OnDownloadResultListener;
|
||||||
|
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.BuildConfig;
|
||||||
|
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.bean.WaybillStatusBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.event.HomeWaybillEvent;
|
||||||
|
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.ui.MainActivity;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.BitmapUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
||||||
|
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.ActivityUtils;
|
||||||
|
import com.dahe.mylibrary.utils.ToastUtils;
|
||||||
|
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 org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ShangChuangImgNewActivity 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;
|
||||||
|
|
||||||
|
private boolean isFinish = false;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void msgMethod(Message m) {
|
||||||
|
super.msgMethod(m);
|
||||||
|
switch (m.what) {
|
||||||
|
case RequsetCodeConstants.SUCCESS:
|
||||||
|
if (CacheGroup.cacheList.get("upload") != null) {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
Glide.with(con).load(path).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");
|
||||||
|
}
|
||||||
|
if (CacheGroup.cacheList.get("waybillStatus") != null) {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
Log.e("waybillStatus", CacheGroup.cacheList.get("waybillStatus"));
|
||||||
|
WaybillStatusBean status = gson.fromJson(CacheGroup.cacheList.get("waybillStatus"), WaybillStatusBean.class);
|
||||||
|
if (status.getCode() == 200) {
|
||||||
|
if (status.getData() != null) {
|
||||||
|
//执行运单下一步操作
|
||||||
|
typeRequest();
|
||||||
|
} else {//订单已取消
|
||||||
|
new MessageUtils().showSimCenPop(con, "运单异常将无法进行下步操作,请返回首页", "取消", "确定", () -> {
|
||||||
|
SPUtils.remove(con, "curWaybillId");
|
||||||
|
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||||
|
ActivityUtils.finishToActivity(MainActivity.class, false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, status.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove("waybillStatus");
|
||||||
|
}
|
||||||
|
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) {//装货回单
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
} else if ((0 == index || 1 == index) && isFinish) {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
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 {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
new MessageUtils().showCenMessage(ShangChuangImgNewActivity.this, "车牌号不匹配!", "请重新拍照或联系管理员");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
hyr.uploadFile(new File(path));
|
||||||
|
}
|
||||||
|
} else {//识别失败后返回code500
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
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));
|
||||||
|
|
||||||
|
new MessageUtils().showSimCenPop(con, "缺少定位权限,去开启精确定位权限!", "取消", "确认", () -> {
|
||||||
|
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
|
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||||
|
intent.setData(uri);
|
||||||
|
startActivity(intent);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// 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) && !BuildConfig.isTest) {//装卸货车辆需要识别车牌号,测试环境不校验车牌号
|
||||||
|
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) {
|
||||||
|
//判断运单是否已取消
|
||||||
|
hyr.getWaybillStatus(sob.getData().getWaybillId());
|
||||||
|
// 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();
|
||||||
|
|
||||||
|
if (customDialog != null && !customDialog.isShowing()) {
|
||||||
|
customDialog = new CustomDialog(con, "网络请求中...");
|
||||||
|
customDialog.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
|
|
||||||
|
if (customDialog != null && !customDialog.isShowing()) {
|
||||||
|
customDialog = new CustomDialog(con, "网络请求中...");
|
||||||
|
customDialog.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
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 (customDialog != null && !customDialog.isShowing()) {
|
||||||
|
customDialog = new CustomDialog(con, "网络请求中...");
|
||||||
|
customDialog.show();
|
||||||
|
}
|
||||||
|
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) {
|
||||||
|
MDPLocationCollectionManager.getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnDownloadResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Object o) {
|
||||||
|
|
||||||
|
String string = o.toString();
|
||||||
|
if (string.equals("PICKUPED")) {//安联装货,单平台未装货
|
||||||
|
isFinish = true;
|
||||||
|
//平台确认装货
|
||||||
|
hyr.loading(lub);
|
||||||
|
} else {
|
||||||
|
nfc();
|
||||||
|
loadInfo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
ToastUtils.showToast(con, s1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// nfc();
|
||||||
|
// loadInfo();
|
||||||
|
// up_traffic_start();
|
||||||
|
// up_image_z();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
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) {
|
||||||
|
MDPLocationCollectionManager.getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnDownloadResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Object o) {
|
||||||
|
if (o.toString().equals("UNLOADED")) {//安联装货,单平台未装货
|
||||||
|
//卸货状态-平台
|
||||||
|
isFinish = true;
|
||||||
|
hyr.dischargeCargo(lub);
|
||||||
|
} else {
|
||||||
|
nfc();
|
||||||
|
uploadInfo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
ToastUtils.showToast(con, s1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// nfc();
|
||||||
|
// uploadInfo();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
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 {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
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() {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||||
|
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() {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||||
|
Log.e("上报安联", "卸货照片上传成功");
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(卸货照片):", s + s1);
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
// 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() {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
SPUtils.remove(con, "curWaybillId");
|
||||||
|
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||||
|
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);
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
new MessageUtils().showCenMessage(con, s1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+1
-1
@@ -58,7 +58,7 @@ public class WebPDFActivity extends BaseActivity {
|
|||||||
protected void onPostExecute(Void aVoid) {
|
protected void onPostExecute(Void aVoid) {
|
||||||
super.onPostExecute(aVoid);
|
super.onPostExecute(aVoid);
|
||||||
pdf_view.fromStream(input[0])
|
pdf_view.fromStream(input[0])
|
||||||
.pages(0,1) // all pages are displayed by default
|
// .pages(0,1,2,3,4,5,6,7) // all pages are displayed by default
|
||||||
.enableAnnotationRendering(true)
|
.enableAnnotationRendering(true)
|
||||||
.load();
|
.load();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,10 @@ import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.request.net.BaseObserver;
|
import com.arpa.hndahesudintocctmsdriver.request.net.BaseObserver;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.net.DataManager;
|
import com.arpa.hndahesudintocctmsdriver.request.net.DataManager;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.net.RxHttpCallBack;
|
import com.arpa.hndahesudintocctmsdriver.request.net.RxHttpCallBack;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.ui.web.WebOnlyOneActivity;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.NewLJUtils;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickHelper;
|
||||||
import com.dahe.mylibrary.net.CommonResponseBean;
|
import com.dahe.mylibrary.net.CommonResponseBean;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.arpa.hndahesudintocctmsdriver.R;
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
@@ -76,6 +80,7 @@ public class LoginActivity extends BaseActivity {
|
|||||||
private int timer_sum = 60;
|
private int timer_sum = 60;
|
||||||
private CheckBox cb;
|
private CheckBox cb;
|
||||||
private UserRequset ur;
|
private UserRequset ur;
|
||||||
|
private CustomDialog customDialog;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void msgMethod(Message m) {
|
public void msgMethod(Message m) {
|
||||||
@@ -94,11 +99,18 @@ public class LoginActivity extends BaseActivity {
|
|||||||
Log.e("--短信发送res--", "短信发送成功");
|
Log.e("--短信发送res--", "短信发送成功");
|
||||||
}
|
}
|
||||||
if (CacheGroup.cacheList.get(LOGIN_RESULT) != null) {
|
if (CacheGroup.cacheList.get(LOGIN_RESULT) != null) {
|
||||||
|
if (customDialog != null && customDialog.isShowing())
|
||||||
|
customDialog.dismiss();
|
||||||
|
|
||||||
|
btn_login.setEnabled(true);
|
||||||
|
btn_login.setBackgroundResource(R.drawable.bg_btn);
|
||||||
//存储登录记录
|
//存储登录记录
|
||||||
loginBean = new Gson().fromJson(CacheGroup.cacheList.get(LOGIN_RESULT), LoginBean.class);
|
loginBean = new Gson().fromJson(CacheGroup.cacheList.get(LOGIN_RESULT), LoginBean.class);
|
||||||
Log.e("--登录信息--", new Gson().toJson(loginBean));
|
Log.e("--登录信息--", new Gson().toJson(loginBean));
|
||||||
AppInfoBean appInfoBean = new AppInfoBean();
|
AppInfoBean appInfoBean = new AppInfoBean();
|
||||||
if (loginBean.getCode() == 200) {
|
if (loginBean.getCode() == 200) {
|
||||||
|
//获取新路交token
|
||||||
|
NewLJUtils.getInstance().getToken(con);
|
||||||
SPUtil.insSP(con, USER, USER_TOKEN, loginBean.getData().getToken());
|
SPUtil.insSP(con, USER, USER_TOKEN, loginBean.getData().getToken());
|
||||||
SPUtil.insSP(con, USER, USER_UNAME, loginBean.getData().getUname());
|
SPUtil.insSP(con, USER, USER_UNAME, loginBean.getData().getUname());
|
||||||
SPUtil.insSP(con, USER, USER_RNAME, loginBean.getData().getRname());
|
SPUtil.insSP(con, USER, USER_RNAME, loginBean.getData().getRname());
|
||||||
@@ -118,6 +130,13 @@ public class LoginActivity extends BaseActivity {
|
|||||||
CacheGroup.cacheList.remove(LOGIN_RESULT);
|
CacheGroup.cacheList.remove(LOGIN_RESULT);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case RequsetCodeConstants.ERROR:
|
||||||
|
if (customDialog != null && customDialog.isShowing())
|
||||||
|
customDialog.dismiss();
|
||||||
|
btn_login.setEnabled(true);
|
||||||
|
btn_login.setBackgroundResource(R.drawable.bg_btn);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -157,7 +176,7 @@ public class LoginActivity extends BaseActivity {
|
|||||||
|
|
||||||
ConfigBean cb = ConfigParts.getConfigParts(con);
|
ConfigBean cb = ConfigParts.getConfigParts(con);
|
||||||
if (cb != null) {
|
if (cb != null) {
|
||||||
url1 = cb.getData().getUserUrl();
|
url1 = "https://agreement.dahehuoyun.com/#/user";
|
||||||
url2 = "https://agreement.dahehuoyun.com/currency/#/";
|
url2 = "https://agreement.dahehuoyun.com/currency/#/";
|
||||||
}
|
}
|
||||||
TextView tv_content = findViewById(R.id.tv_content);
|
TextView tv_content = findViewById(R.id.tv_content);
|
||||||
@@ -171,7 +190,7 @@ public class LoginActivity extends BaseActivity {
|
|||||||
public void onClick(View widget) {
|
public void onClick(View widget) {
|
||||||
Log.e("-用户服务协议-", url1);
|
Log.e("-用户服务协议-", url1);
|
||||||
//用户服务协议点击事件
|
//用户服务协议点击事件
|
||||||
Intent in = new Intent(con, WebActivity.class);
|
Intent in = new Intent(con, WebOnlyOneActivity.class);
|
||||||
in.putExtra("title", "用户服务协议");
|
in.putExtra("title", "用户服务协议");
|
||||||
in.putExtra("url", url1);
|
in.putExtra("url", url1);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
@@ -191,7 +210,7 @@ public class LoginActivity extends BaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View widget) {
|
public void onClick(View widget) {
|
||||||
//隐私协议点击事件
|
//隐私协议点击事件
|
||||||
Intent in = new Intent(con, WebActivity.class);
|
Intent in = new Intent(con, WebOnlyOneActivity.class);
|
||||||
in.putExtra("title", "隐私政策");
|
in.putExtra("title", "隐私政策");
|
||||||
in.putExtra("url", url2);
|
in.putExtra("url", url2);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
@@ -226,12 +245,16 @@ public class LoginActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
btn_login.setOnClickListener(v -> {
|
btn_login.setOnClickListener(new OnLimitClickHelper(v -> {
|
||||||
String phone = String.valueOf(input_phone.getText());
|
String phone = String.valueOf(input_phone.getText());
|
||||||
String code = String.valueOf(input_code.getText());
|
String code = String.valueOf(input_code.getText());
|
||||||
Log.e("--code--", code);
|
Log.e("--code--", code);
|
||||||
if (judgeFormat(phone, code)) {
|
if (judgeFormat(phone, code)) {
|
||||||
if (key) {
|
if (key) {
|
||||||
|
btn_login.setEnabled(false);
|
||||||
|
btn_login.setBackgroundResource(R.drawable.bg_btn_gray);
|
||||||
|
customDialog = new CustomDialog(con, "登陆中...");
|
||||||
|
customDialog.show();
|
||||||
LoginRegInputBean lb = new LoginRegInputBean();
|
LoginRegInputBean lb = new LoginRegInputBean();
|
||||||
lb.setRoleId(4);
|
lb.setRoleId(4);
|
||||||
lb.setUname(phone);
|
lb.setUname(phone);
|
||||||
@@ -243,7 +266,7 @@ public class LoginActivity extends BaseActivity {
|
|||||||
Toast.makeText(con, "请先同意用户协议和隐私政策", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "请先同意用户协议和隐私政策", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}));
|
||||||
auto_login.setOnClickListener(v -> {
|
auto_login.setOnClickListener(v -> {
|
||||||
JVerificationInterface.getToken(con, 20000, (i, s, s1) -> {
|
JVerificationInterface.getToken(con, 20000, (i, s, s1) -> {
|
||||||
JVerifyUIConfig uiConfig = new JVerifyUIConfig.Builder()
|
JVerifyUIConfig uiConfig = new JVerifyUIConfig.Builder()
|
||||||
|
|||||||
@@ -140,16 +140,17 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
|||||||
new XPopup.Builder(con)
|
new XPopup.Builder(con)
|
||||||
.dismissOnBackPressed(false)
|
.dismissOnBackPressed(false)
|
||||||
.dismissOnTouchOutside(false)
|
.dismissOnTouchOutside(false)
|
||||||
.asCustom(new AgreementAlert(con, "http://agreement.dahehuoyun.com/currency/#/",
|
.asCustom(new AgreementAlert(con, "https://agreement.dahehuoyun.com/currency/#/",
|
||||||
"http://agreement.dahehuoyun.com/rule/serviceAgreement/dist/index.html#/", hd))
|
"https://agreement.dahehuoyun.com/#/user", hd))
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
if (WelcomeActivity.this!=null&&!WelcomeActivity.this.isFinishing()){
|
||||||
Glide.with(con)
|
Glide.with(con)
|
||||||
.load(SPUtils.getPreWelPic(this))
|
.load(SPUtils.getPreWelPic(this))
|
||||||
.placeholder(startImageUrl.getDrawable())
|
.placeholder(startImageUrl.getDrawable())
|
||||||
.error(R.drawable.welcome_bg_default)
|
.error(R.drawable.welcome_bg_default)
|
||||||
.into(startImageUrl);
|
.into(startImageUrl);
|
||||||
|
}
|
||||||
//SystemUtil.get
|
//SystemUtil.get
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -292,11 +293,13 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
|||||||
|
|
||||||
public void cdWelcome(String url) {
|
public void cdWelcome(String url) {
|
||||||
if (!"".equals(url)) {
|
if (!"".equals(url)) {
|
||||||
|
if (WelcomeActivity.this!=null&&!WelcomeActivity.this.isFinishing()){
|
||||||
Glide.with(con).load(url)
|
Glide.with(con).load(url)
|
||||||
.placeholder(startImageUrl.getDrawable())
|
.placeholder(startImageUrl.getDrawable())
|
||||||
.error(R.drawable.welcome_bg_default)
|
.error(R.drawable.welcome_bg_default)
|
||||||
.into(startImageUrl);
|
.into(startImageUrl);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
SPUtils.setPreWelPic(this, url);
|
SPUtils.setPreWelPic(this, url);
|
||||||
cd_view.setVisibility(View.VISIBLE);
|
cd_view.setVisibility(View.VISIBLE);
|
||||||
new CountDownTimer(cd * 1000, 1000) {
|
new CountDownTimer(cd * 1000, 1000) {
|
||||||
|
|||||||
@@ -16,16 +16,22 @@ import android.widget.Toast;
|
|||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.UpAppBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.PersonEvent;
|
import com.arpa.hndahesudintocctmsdriver.event.PersonEvent;
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.RefreshCarListEvent;
|
import com.arpa.hndahesudintocctmsdriver.event.RefreshCarListEvent;
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.VehicleEvent;
|
import com.arpa.hndahesudintocctmsdriver.event.VehicleEvent;
|
||||||
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
||||||
import com.arpa.hndahesudintocctmsdriver.parts.StartOrderParts;
|
import com.arpa.hndahesudintocctmsdriver.parts.StartOrderParts;
|
||||||
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.ui.alert.UpAppAlert;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.business.BusinessActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.business.BusinessActivity;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.NewLJUtils;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.PicturlUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.PicturlUtil;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.dahe.mylibrary.utils.ImageLoader;
|
||||||
|
import com.dahe.mylibrary.utils.ToastUtils;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.lxj.xpopup.XPopup;
|
import com.lxj.xpopup.XPopup;
|
||||||
|
|
||||||
@@ -48,6 +54,7 @@ import com.permissionx.guolindev.PermissionX;
|
|||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -93,6 +100,25 @@ public class MyFragment extends BaseFragment {
|
|||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove("userdata");
|
CacheGroup.cacheList.remove("userdata");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CacheGroup.cacheList.get("up_app") != null) {
|
||||||
|
Log.e("up_app", CacheGroup.cacheList.get("up_app"));
|
||||||
|
UpAppBean uab = new Gson().fromJson(CacheGroup.cacheList.get("up_app"), UpAppBean.class);
|
||||||
|
if (uab.getCode() == 200) {
|
||||||
|
if (uab.getData() != null) {
|
||||||
|
new XPopup.Builder(con)
|
||||||
|
.dismissOnBackPressed(false)
|
||||||
|
.dismissOnTouchOutside(false)
|
||||||
|
.asCustom(new UpAppAlert(con, uab.getData().getDownloadUrl(), uab.getData().getContent(), uab.getData().getVersion(), uab.getData().getForce()))
|
||||||
|
.show();
|
||||||
|
}else{
|
||||||
|
Toast.makeText(con, "当前已经是最新版本", Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
Toast.makeText(con, uab.getMsg(), Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove("up_app");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -262,7 +288,10 @@ public class MyFragment extends BaseFragment {
|
|||||||
startActivity(in);
|
startActivity(in);
|
||||||
});
|
});
|
||||||
//检查更新
|
//检查更新
|
||||||
onUpdate.setOnClickListener(v -> Toast.makeText(con, "当前已经是最新版本", Toast.LENGTH_LONG).show());
|
onUpdate.setOnClickListener(v -> {
|
||||||
|
ur.upApp();
|
||||||
|
}
|
||||||
|
);
|
||||||
//系统设置
|
//系统设置
|
||||||
onSetUp.setOnClickListener(v -> startActivity(new Intent(con, SetupActivity.class)));
|
onSetUp.setOnClickListener(v -> startActivity(new Intent(con, SetupActivity.class)));
|
||||||
}
|
}
|
||||||
@@ -280,18 +309,31 @@ public class MyFragment extends BaseFragment {
|
|||||||
|
|
||||||
}
|
}
|
||||||
if (!"".equals(userBean.getData().getHeadportraitUrl())) {
|
if (!"".equals(userBean.getData().getHeadportraitUrl())) {
|
||||||
Glide.with(con).load(userBean.getData().getHeadportraitUrl()).into(img_head);
|
ImageLoader.getInstance().loadImage(con,userBean.getData().getHeadportraitUrl(),img_head);
|
||||||
}
|
}
|
||||||
if (userBean != null && 100003 == userBean.getData().getAuditStatus()) {
|
|
||||||
auth_box.setVisibility(View.GONE);
|
if (userBean != null) {
|
||||||
|
if ("0".equals(userBean.getData().getRealAuthentication())) {
|
||||||
|
no_auth.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
if (100003 == userBean.getData().getAuditStatus()) {
|
||||||
no_auth.setVisibility(View.GONE);
|
no_auth.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
auth_box.setVisibility(View.GONE);
|
no_auth.setBackgroundResource(R.mipmap.icon_auth_wsh);
|
||||||
no_auth.setVisibility(View.VISIBLE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if (userBean != null && 100003 == userBean.getData().getAuditStatus()) {
|
||||||
|
// auth_box.setVisibility(View.GONE);
|
||||||
|
// no_auth.setVisibility(View.GONE);
|
||||||
|
// } else {
|
||||||
|
// auth_box.setVisibility(View.GONE);
|
||||||
|
// no_auth.setVisibility(View.VISIBLE);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void processResult(VehicleEvent event) {
|
public void processResult(VehicleEvent event) {
|
||||||
Log.e("-msg-", event.getMessage());
|
Log.e("-msg-", event.getMessage());
|
||||||
@@ -306,11 +348,19 @@ public class MyFragment extends BaseFragment {
|
|||||||
ur.vehicleList("1");
|
ur.vehicleList("1");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
public void personResult(PersonEvent home) {
|
public void personResult(PersonEvent home) {
|
||||||
Log.e("-res-", home.getMessage());
|
Log.e("-res-", home.getMessage());
|
||||||
if (ur != null) {
|
if (ur != null) {
|
||||||
ur.User();
|
ur.User();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
if (ur != null) {
|
||||||
|
ur.User();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import android.widget.Toast;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.ui.web.WebOnlyOneActivity;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.lxj.xpopup.XPopup;
|
import com.lxj.xpopup.XPopup;
|
||||||
import com.arpa.hndahesudintocctmsdriver.R;
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
@@ -73,9 +74,9 @@ public class SetupActivity extends BaseActivity {
|
|||||||
ConfigBean cb= ConfigParts.getConfigParts(con);
|
ConfigBean cb= ConfigParts.getConfigParts(con);
|
||||||
if(cb!=null){
|
if(cb!=null){
|
||||||
// url1=cb.getData().getUserUrl();
|
// url1=cb.getData().getUserUrl();
|
||||||
url1="http://agreement.dahehuoyun.com/rule/serviceAgreement/dist/index.html#/";
|
url1="https://agreement.dahehuoyun.com/rule/serviceAgreement/dist/index.html#/";
|
||||||
// url2=cb.getData().getPrivateUrl();
|
// url2=cb.getData().getPrivateUrl();
|
||||||
url2="http://agreement.dahehuoyun.com/currency/#/";
|
url2="https://agreement.dahehuoyun.com/currency/#/";
|
||||||
kefu=cb.getData().getServiceMobile();
|
kefu=cb.getData().getServiceMobile();
|
||||||
url3=cb.getData().getSecurityUrl();
|
url3=cb.getData().getSecurityUrl();
|
||||||
}
|
}
|
||||||
@@ -94,19 +95,19 @@ public class SetupActivity extends BaseActivity {
|
|||||||
public void initView(Object obj) {
|
public void initView(Object obj) {
|
||||||
super.initView(obj);
|
super.initView(obj);
|
||||||
r1.setOnClickListener(v12 -> {
|
r1.setOnClickListener(v12 -> {
|
||||||
Intent in=new Intent(con,WebActivity.class);
|
Intent in=new Intent(con, WebOnlyOneActivity.class);
|
||||||
in.putExtra("title","隐私政策");
|
in.putExtra("title","隐私政策");
|
||||||
in.putExtra("url",url2);
|
in.putExtra("url",url2);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
});
|
});
|
||||||
r2.setOnClickListener(v12 -> {
|
r2.setOnClickListener(v12 -> {
|
||||||
Intent in=new Intent(con,WebActivity.class);
|
Intent in=new Intent(con,WebOnlyOneActivity.class);
|
||||||
in.putExtra("title","用户协议");
|
in.putExtra("title","用户协议");
|
||||||
in.putExtra("url",url1);
|
in.putExtra("url",url1);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
});
|
});
|
||||||
r3.setOnClickListener(v12 -> {
|
r3.setOnClickListener(v12 -> {
|
||||||
Intent in=new Intent(con,WebActivity.class);
|
Intent in=new Intent(con,WebOnlyOneActivity.class);
|
||||||
in.putExtra("title","运输安全责任书");
|
in.putExtra("title","运输安全责任书");
|
||||||
in.putExtra("url",url3);
|
in.putExtra("url",url3);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
@@ -121,7 +122,7 @@ public class SetupActivity extends BaseActivity {
|
|||||||
startActivity(in);
|
startActivity(in);
|
||||||
});
|
});
|
||||||
r8.setOnClickListener(v12 -> {
|
r8.setOnClickListener(v12 -> {
|
||||||
Intent in=new Intent(con,WebActivity.class);
|
Intent in=new Intent(con,WebOnlyOneActivity.class);
|
||||||
in.putExtra("title","交易规则");
|
in.putExtra("title","交易规则");
|
||||||
in.putExtra("url","http://agreement.dahehuoyun.com/rule/transactionRules/dist/index.html#/");
|
in.putExtra("url","http://agreement.dahehuoyun.com/rule/transactionRules/dist/index.html#/");
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickHelper;
|
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickHelper;
|
||||||
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickListener;
|
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickListener;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.dahe.mylibrary.utils.ImageLoader;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.arpa.hndahesudintocctmsdriver.R;
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
||||||
@@ -95,7 +96,7 @@ public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClic
|
|||||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||||
bank_name.setText(dad.getData().getBankName());
|
bank_name.setText(dad.getData().getBankName());
|
||||||
bank_number.setText(dad.getData().getCardNo());
|
bank_number.setText(dad.getData().getCardNo());
|
||||||
Glide.with(con).load(dad.getData().getBankImgUrl()).into(up_bank_img);
|
ImageLoader.getInstance().loadImage(con,dad.getData().getBankImgUrl(),up_bank_img);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -202,7 +203,7 @@ public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClic
|
|||||||
super.initView(obj);
|
super.initView(obj);
|
||||||
bank_name.setText(ib.getData().getBankName());
|
bank_name.setText(ib.getData().getBankName());
|
||||||
bank_number.setText(ib.getData().getCardNumber());
|
bank_number.setText(ib.getData().getCardNumber());
|
||||||
Glide.with(con).load(path).into(up_bank_img);
|
ImageLoader.getInstance().loadImage(con,path,up_bank_img);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -0,0 +1,227 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.ui.web;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.net.http.SslError;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.webkit.JavascriptInterface;
|
||||||
|
import android.webkit.SslErrorHandler;
|
||||||
|
import android.webkit.WebResourceRequest;
|
||||||
|
import android.webkit.WebSettings;
|
||||||
|
import android.webkit.WebView;
|
||||||
|
import android.webkit.WebViewClient;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.UserBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.PaxWebChromeClient;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hlh
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2021/8/6 16:48
|
||||||
|
* @description:访问webview的activity
|
||||||
|
*/
|
||||||
|
public class WebOnlyOneActivity extends BaseActivity {
|
||||||
|
|
||||||
|
private String url = "";
|
||||||
|
private String title = "";
|
||||||
|
private WebView wv;
|
||||||
|
private TextView title_tv;
|
||||||
|
private PaxWebChromeClient chromeClient;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
StateStyleUtil.stateTextColor(this);
|
||||||
|
setContentView(R.layout.activity_web);
|
||||||
|
con = this;
|
||||||
|
initHardwareAccelerate();
|
||||||
|
wv = findViewById(R.id.wv);
|
||||||
|
title_tv = findViewById(R.id.title);
|
||||||
|
Intent in = getIntent();
|
||||||
|
url = in.getExtras().getString("url");
|
||||||
|
title = in.getExtras().getString("title");
|
||||||
|
chromeClient = new PaxWebChromeClient(this, null, null);
|
||||||
|
if ("咨询建议".equals(title)) {
|
||||||
|
initOpinion();
|
||||||
|
} else {
|
||||||
|
initView(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initHardwareAccelerate() {
|
||||||
|
try {
|
||||||
|
if (Integer.parseInt(Build.VERSION.SDK) >= 11) {
|
||||||
|
getWindow()
|
||||||
|
.setFlags(
|
||||||
|
android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
|
||||||
|
android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint({"JavascriptInterface", "SetJavaScriptEnabled"})
|
||||||
|
@Override
|
||||||
|
public void initView(Object obj) {
|
||||||
|
super.initView(obj);
|
||||||
|
WebSettings webSettings = wv.getSettings();
|
||||||
|
//设置网页有缓存的时候也继续读取新的地址
|
||||||
|
webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
|
||||||
|
webSettings.setJavaScriptEnabled(true);
|
||||||
|
webSettings.setDomStorageEnabled(true);
|
||||||
|
webSettings.setDefaultTextEncodingName("utf-8");
|
||||||
|
// 特别注意:5.1以上默认禁止了https和http混用,以下方式是开启
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||||
|
webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||||
|
}
|
||||||
|
|
||||||
|
wv.addJavascriptInterface(new JavaScriptObject(con), "webObj");
|
||||||
|
//PaxWebChromeClient chromeClient=new PaxWebChromeClient();
|
||||||
|
//WebView加载web资源
|
||||||
|
//覆盖WebView默认使用第三方或系统默认浏览器打开网页的行为,使网页用WebView打开
|
||||||
|
wv.setWebViewClient(new WebViewClient() {
|
||||||
|
@Override
|
||||||
|
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
|
||||||
|
return super.shouldOverrideUrlLoading(view, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldOverrideUrlLoading(WebView view, String url1) {
|
||||||
|
//返回值是true的时候控制去WebView打开,为false调用系统浏览器或第三方浏览器
|
||||||
|
Log.d("test", "webactivity..url:" + url);
|
||||||
|
// if(!url.startsWith("http"))
|
||||||
|
// {
|
||||||
|
// Log.d("test","非http开头..url:"+url);
|
||||||
|
// Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse(url));
|
||||||
|
// boolean isInstall = getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY).size()>0;
|
||||||
|
// Log.d("test","是否安装要跳转的app:"+isInstall);
|
||||||
|
// if(isInstall)
|
||||||
|
// {
|
||||||
|
// startActivity(intent);
|
||||||
|
// finish();
|
||||||
|
// }
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
if (!url1.equals(url))
|
||||||
|
return true;
|
||||||
|
wv.loadUrl(url1);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
|
||||||
|
super.onReceivedSslError(view, handler, error);
|
||||||
|
handler.proceed();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
wv.setWebChromeClient(chromeClient);
|
||||||
|
wv.loadUrl(url);
|
||||||
|
title_tv.setText(title);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initOpinion() {
|
||||||
|
if (findViewById(R.id.return_btn) != null) {
|
||||||
|
findViewById(R.id.return_btn).setOnClickListener(v -> {
|
||||||
|
finish();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
title_tv.setText(title);
|
||||||
|
UserBean ub = UserParts.getUser(con);
|
||||||
|
wv.getSettings().setJavaScriptEnabled(true);
|
||||||
|
wv.getSettings().setDomStorageEnabled(true); // 这个要加上
|
||||||
|
String openid = ub.getData().getUname(); // 用户的openid
|
||||||
|
String nickname = StringUtil.isNull(ub.getData().getRname(), "游客"); // 用户的nickname
|
||||||
|
String headimgurl = StringUtil.isNull(ub.getData().getHeadportraitUrl(), ""); // 用户的头像url
|
||||||
|
|
||||||
|
/* 获得 webview url,请注意url单词是product而不是products,products是旧版本的参数,用错地址将不能成功提交 */
|
||||||
|
String url = "https://support.qq.com/products/335639"; // 把1221数字换成你的产品ID,否则会不成功
|
||||||
|
/* 准备post参数 */
|
||||||
|
String postData = "nickname=" + nickname + "&avatar=" + headimgurl + "&openid=" + openid;
|
||||||
|
wv.postUrl(url, postData.getBytes());
|
||||||
|
wv.setWebChromeClient(chromeClient);
|
||||||
|
wv.setWebViewClient(new WebViewClient() {
|
||||||
|
@Override
|
||||||
|
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
|
||||||
|
return super.shouldOverrideUrlLoading(view, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||||
|
//返回值是true的时候控制去WebView打开,为false调用系统浏览器或第三方浏览器
|
||||||
|
view.loadUrl(url);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
|
||||||
|
super.onReceivedSslError(view, handler, error);
|
||||||
|
handler.proceed();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
|
||||||
|
chromeClient.onActivityResult(requestCode, resultCode, data);
|
||||||
|
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class JavaScriptObject {
|
||||||
|
|
||||||
|
Context mContxt;
|
||||||
|
|
||||||
|
public JavaScriptObject(Context mContxt) {
|
||||||
|
this.mContxt = mContxt;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@JavascriptInterface
|
||||||
|
public void getName() {
|
||||||
|
Log.e("eeee-", "name");
|
||||||
|
Toast.makeText(con, "hello", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
@JavascriptInterface
|
||||||
|
public String getUserToken() {
|
||||||
|
// Log.e("-token-",UserParts.getUser(con).getData().getToken());
|
||||||
|
// return "woshitoken-androidfasdf";
|
||||||
|
return UserParts.getUser(con).getData().getToken();
|
||||||
|
}
|
||||||
|
|
||||||
|
@JavascriptInterface
|
||||||
|
public void isSuccess() {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@JavascriptInterface
|
||||||
|
public void isPdfSuccess() {
|
||||||
|
Toast.makeText(con, "签署成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,759 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.util;
|
||||||
|
|
||||||
|
import static com.dahe.mylibrary.utils.BaseSPUtils.NEW_LJ_TOKEN;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.App;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.DriverAuthDataBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.GDImage;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.GDLocation;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.IsAuthCardBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.constant.NewLJConstant;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.parts.AuthParts;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.AuthRequest;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.InvoiceBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.InvoicesBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.LjTokenBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.PickupBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.ShipmentStatusBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.UpimgBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.net.BaseObserver;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.net.DataManager;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.net.RxHttpCallBack;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.http.RequestUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||||
|
import com.dahe.mylibrary.bean.DriverBean;
|
||||||
|
import com.dahe.mylibrary.callback.OnGDDownloadResultListener;
|
||||||
|
import com.dahe.mylibrary.callback.OnGDResultListener;
|
||||||
|
import com.dahe.mylibrary.net.CommonResponseBean;
|
||||||
|
import com.dahe.mylibrary.utils.ToastUtils;
|
||||||
|
import com.express.mdp.Api;
|
||||||
|
import com.express.mdp.Callback;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
|
||||||
|
|
||||||
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName NewLJUtils
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/11/25 09:53
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public class NewLJUtils {
|
||||||
|
|
||||||
|
|
||||||
|
private static class SingletonHolder {
|
||||||
|
private static final NewLJUtils INSTANCE = new NewLJUtils();
|
||||||
|
}
|
||||||
|
|
||||||
|
private NewLJUtils() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final NewLJUtils getInstance() {
|
||||||
|
return SingletonHolder.INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getToken(Context ctx) {
|
||||||
|
LjTokenBean ljTokenBean = new LjTokenBean();
|
||||||
|
ljTokenBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||||
|
ljTokenBean.setEnterpriseIdentity(NewLJConstant.ENTER_PRISE_IDENTITY);
|
||||||
|
ljTokenBean.setEnterpriseKey(NewLJConstant.ENTER_PRISE_KEY);
|
||||||
|
|
||||||
|
DataManager.getInstance().getToken(ljTokenBean)
|
||||||
|
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(CommonResponseBean t) {
|
||||||
|
super.onSuccess(t);
|
||||||
|
SPUtils.put(ctx, NEW_LJ_TOKEN, t.getToken());
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 刷新token
|
||||||
|
* @param ctx
|
||||||
|
*/
|
||||||
|
public void refreshToken(Context ctx){
|
||||||
|
String token = SPUtils.get(ctx, NEW_LJ_TOKEN, "").toString();
|
||||||
|
DataManager.getInstance().refreshToken(token)
|
||||||
|
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(CommonResponseBean<CommonResponseBean> t) {
|
||||||
|
super.onSuccess(t);
|
||||||
|
SPUtils.put(ctx, NEW_LJ_TOKEN, t.getToken());
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getToken(Context ctx, OnGDResultListener listener) {
|
||||||
|
LjTokenBean ljTokenBean = new LjTokenBean();
|
||||||
|
ljTokenBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||||
|
ljTokenBean.setEnterpriseIdentity(NewLJConstant.ENTER_PRISE_IDENTITY);
|
||||||
|
ljTokenBean.setEnterpriseKey(NewLJConstant.ENTER_PRISE_KEY);
|
||||||
|
|
||||||
|
DataManager.getInstance().getToken(ljTokenBean)
|
||||||
|
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(CommonResponseBean t) {
|
||||||
|
super.onSuccess(t);
|
||||||
|
SPUtils.put(ctx, NEW_LJ_TOKEN, t.getToken());
|
||||||
|
if (listener != null)
|
||||||
|
listener.onSuccess();
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运单提货
|
||||||
|
*
|
||||||
|
* @param ctx
|
||||||
|
* @param shipmentCode
|
||||||
|
* @param location
|
||||||
|
*/
|
||||||
|
public void pickUp(Context ctx, String shipmentCode, GDLocation location, OnGDResultListener listener) {
|
||||||
|
if (TextUtils.isEmpty(shipmentCode)) {
|
||||||
|
ToastUtils.showToast(ctx, "运单号不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Double.isNaN(location.getBaiduLatitude()) || Double.isNaN(location.getBaiduLongitude())) {
|
||||||
|
ToastUtils.showToast(ctx, "经纬度不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
PickupBean pickupBean = new PickupBean();
|
||||||
|
pickupBean.setShipmentCode(shipmentCode);
|
||||||
|
pickupBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||||
|
pickupBean.setLocation(location);
|
||||||
|
DataManager.getInstance().pickup(pickupBean)
|
||||||
|
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(CommonResponseBean t) {
|
||||||
|
super.onSuccess(t);
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onSuccess();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||||
|
super.onCodeError(mContext, t);
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage())?"运单操作异常":t.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运单卸货
|
||||||
|
*
|
||||||
|
* @param ctx
|
||||||
|
* @param shipmentCode
|
||||||
|
* @param location
|
||||||
|
*/
|
||||||
|
public void unload(Context ctx, String shipmentCode, GDLocation location, OnGDResultListener listener) {
|
||||||
|
if (TextUtils.isEmpty(shipmentCode)) {
|
||||||
|
ToastUtils.showToast(ctx, "运单号不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Double.isNaN(location.getBaiduLatitude()) || Double.isNaN(location.getBaiduLongitude())) {
|
||||||
|
ToastUtils.showToast(ctx, "经纬度不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
PickupBean pickupBean = new PickupBean();
|
||||||
|
pickupBean.setShipmentCode(shipmentCode);
|
||||||
|
pickupBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||||
|
pickupBean.setLocation(location);
|
||||||
|
DataManager.getInstance().unload(pickupBean)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(CommonResponseBean t) {
|
||||||
|
super.onSuccess(t);
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onSuccess();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||||
|
super.onCodeError(mContext, t);
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage())?"运单操作异常":t.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运单签收
|
||||||
|
*
|
||||||
|
* @param ctx
|
||||||
|
* @param shipmentCode
|
||||||
|
* @param location
|
||||||
|
*/
|
||||||
|
public void sign(Context ctx, String shipmentCode, GDLocation location, OnGDResultListener listener) {
|
||||||
|
if (TextUtils.isEmpty(shipmentCode)) {
|
||||||
|
ToastUtils.showToast(ctx, "运单号不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Double.isNaN(location.getBaiduLatitude()) || Double.isNaN(location.getBaiduLongitude())) {
|
||||||
|
ToastUtils.showToast(ctx, "经纬度不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
PickupBean pickupBean = new PickupBean();
|
||||||
|
pickupBean.setShipmentCode(shipmentCode);
|
||||||
|
pickupBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||||
|
pickupBean.setLocation(location);
|
||||||
|
DataManager.getInstance().sign(pickupBean)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(CommonResponseBean t) {
|
||||||
|
super.onSuccess(t);
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onSuccess();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||||
|
super.onCodeError(mContext, t);
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage())?"运单操作异常":t.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运单回单
|
||||||
|
*
|
||||||
|
* @param ctx
|
||||||
|
* @param shipmentCode
|
||||||
|
* @param location
|
||||||
|
*/
|
||||||
|
public void pod(Context ctx, String shipmentCode, GDLocation location, OnGDResultListener listener) {
|
||||||
|
if (TextUtils.isEmpty(shipmentCode)) {
|
||||||
|
ToastUtils.showToast(ctx, "运单号不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Double.isNaN(location.getBaiduLatitude()) || Double.isNaN(location.getBaiduLongitude())) {
|
||||||
|
ToastUtils.showToast(ctx, "经纬度不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
PickupBean pickupBean = new PickupBean();
|
||||||
|
pickupBean.setShipmentCode(shipmentCode);
|
||||||
|
pickupBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||||
|
pickupBean.setLocation(location);
|
||||||
|
DataManager.getInstance().pod(pickupBean)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(CommonResponseBean t) {
|
||||||
|
super.onSuccess(t);
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onSuccess();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||||
|
super.onCodeError(mContext, t);
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage())?"运单操作异常":t.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运单提货照片上传
|
||||||
|
*
|
||||||
|
* @param ctx
|
||||||
|
* @param shipmentCode
|
||||||
|
* @param imageDTO
|
||||||
|
*/
|
||||||
|
public void uploadPickupImage(Context ctx, String shipmentCode, GDImage imageDTO, OnGDResultListener listener) {
|
||||||
|
if (TextUtils.isEmpty(shipmentCode)) {
|
||||||
|
ToastUtils.showToast(ctx, "运单号不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TextUtils.isEmpty(imageDTO.getFileName())) {
|
||||||
|
ToastUtils.showToast(ctx, "照片不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
UpimgBean pickupBean = new UpimgBean();
|
||||||
|
pickupBean.setShipmentCode(shipmentCode);
|
||||||
|
pickupBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||||
|
pickupBean.setImage(imageDTO);
|
||||||
|
DataManager.getInstance().uploadPickupImage(pickupBean)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(CommonResponseBean t) {
|
||||||
|
super.onSuccess(t);
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onSuccess();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||||
|
super.onCodeError(mContext, t);
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage())?"运单操作异常":t.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运单卸货照片上传
|
||||||
|
*
|
||||||
|
* @param ctx
|
||||||
|
* @param shipmentCode
|
||||||
|
* @param imageDTO
|
||||||
|
*/
|
||||||
|
public void uploadUnloadImage(Context ctx, String shipmentCode, GDImage imageDTO, OnGDResultListener listener) {
|
||||||
|
if (TextUtils.isEmpty(shipmentCode)) {
|
||||||
|
ToastUtils.showToast(ctx, "运单号不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TextUtils.isEmpty(imageDTO.getFileName())) {
|
||||||
|
ToastUtils.showToast(ctx, "照片不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
UpimgBean pickupBean = new UpimgBean();
|
||||||
|
pickupBean.setShipmentCode(shipmentCode);
|
||||||
|
pickupBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||||
|
pickupBean.setImage(imageDTO);
|
||||||
|
DataManager.getInstance().uploadUnloadImage(pickupBean)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(CommonResponseBean t) {
|
||||||
|
super.onSuccess(t);
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onSuccess();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||||
|
super.onCodeError(mContext, t);
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage())?"运单操作异常":t.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运单回单照片上传
|
||||||
|
*
|
||||||
|
* @param ctx
|
||||||
|
* @param shipmentCode
|
||||||
|
* @param imageDTO
|
||||||
|
*/
|
||||||
|
public void uploadPODImage(Context ctx, String shipmentCode, GDImage imageDTO, OnGDResultListener listener) {
|
||||||
|
if (TextUtils.isEmpty(shipmentCode)) {
|
||||||
|
ToastUtils.showToast(ctx, "运单号不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TextUtils.isEmpty(imageDTO.getFileName())) {
|
||||||
|
ToastUtils.showToast(ctx, "照片不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
UpimgBean pickupBean = new UpimgBean();
|
||||||
|
pickupBean.setShipmentCode(shipmentCode);
|
||||||
|
pickupBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||||
|
pickupBean.setImage(imageDTO);
|
||||||
|
DataManager.getInstance().uploadPODImage(pickupBean)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(CommonResponseBean t) {
|
||||||
|
super.onSuccess(t);
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onSuccess();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||||
|
super.onCodeError(mContext, t);
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage())?"运单操作异常":t.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取发票列表
|
||||||
|
*
|
||||||
|
* @param ctx
|
||||||
|
* @param listener
|
||||||
|
*/
|
||||||
|
public void getInvoices(Context ctx, OnGDResultListener listener) {
|
||||||
|
DriverAuthDataBean auth = AuthParts.getAuth(ctx);
|
||||||
|
if (auth == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
DataManager.getInstance().getInvoices(NewLJConstant.ENTER_PRISE_CODE, auth.getData().getIdcard(), 1, 100)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean<InvoicesBean>>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(CommonResponseBean<CommonResponseBean<InvoicesBean>> t) {
|
||||||
|
super.onSuccess(t);
|
||||||
|
if (t.getData().getData().getDriverInvoices().size() > 0) {
|
||||||
|
confirmInvoice(ctx, new OnGDResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String var1, String var2) {
|
||||||
|
Log.e("NewLJUtils", var1 + var2);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean<InvoicesBean>> t) {
|
||||||
|
super.onCodeError(mContext, t);
|
||||||
|
// Log.e("NewLJUtils", t.getMsg().toString());
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同意发票申请
|
||||||
|
*
|
||||||
|
* @param ctx
|
||||||
|
*/
|
||||||
|
public void confirmInvoice(Context ctx, OnGDResultListener listener) {
|
||||||
|
DriverAuthDataBean auth = AuthParts.getAuth(ctx);
|
||||||
|
if (auth == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
searchDriver(ctx, auth.getData().getIdcard(), new OnGDDownloadResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(String var1) {
|
||||||
|
InvoiceBean invoiceBean = new InvoiceBean();
|
||||||
|
invoiceBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||||
|
invoiceBean.setDriverInvoiceCode(var1);
|
||||||
|
invoiceBean.setDriverIdentification(auth.getData().getIdcard());
|
||||||
|
DataManager.getInstance().confirmInvoice(invoiceBean)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(CommonResponseBean t) {
|
||||||
|
super.onSuccess(t);
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onSuccess();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||||
|
super.onCodeError(mContext, t);
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage())?"运单操作异常":t.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String var1, String var2) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//查询身份证信息
|
||||||
|
// new AuthRequest().getCard(ctx, new Handler(msg -> {
|
||||||
|
// switch (msg.what) {
|
||||||
|
// case RequsetCodeConstants.ERROR:
|
||||||
|
// Toast.makeText(ctx, RequsetCodeConstants.FEEDBACK_TEXT, Toast.LENGTH_SHORT).show();
|
||||||
|
// break;
|
||||||
|
// case RequsetCodeConstants.UNKONWN:
|
||||||
|
// Toast.makeText(ctx, RequsetCodeConstants.UNKONWN_TEXT, Toast.LENGTH_SHORT).show();
|
||||||
|
// break;
|
||||||
|
// case RequsetCodeConstants.SERVER_ERROR:
|
||||||
|
// Toast.makeText(ctx, RequsetCodeConstants.SERVER_ERROR_TEXT, Toast.LENGTH_SHORT).show();
|
||||||
|
// break;
|
||||||
|
// case RequsetCodeConstants.GATEWAY_ERROR:
|
||||||
|
// Toast.makeText(ctx, RequsetCodeConstants.GATEWAY_ERROR_TEXT, Toast.LENGTH_SHORT).show();
|
||||||
|
// break;
|
||||||
|
// case RequsetCodeConstants.SUCCESS:
|
||||||
|
// IsAuthCardBean iacb = new Gson().fromJson(CacheGroup.cacheList.get(CertificatesActivity.ISAUTH), IsAuthCardBean.class);
|
||||||
|
// if (iacb != null || iacb.getData() != null || !TextUtils.isEmpty(iacb.getData().getIdcard())) {
|
||||||
|
// //根据身份证号查询路交司机信息
|
||||||
|
// searchDriver(ctx, iacb.getData().getIdcard(), new OnGDDownloadResultListener() {
|
||||||
|
// @Override
|
||||||
|
// public void onSuccess(String var1) {
|
||||||
|
// InvoiceBean invoiceBean = new InvoiceBean();
|
||||||
|
// invoiceBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||||
|
// invoiceBean.setDriverInvoiceCode(var1);
|
||||||
|
// invoiceBean.setDriverIdentification(iacb.getData().getIdcard());
|
||||||
|
// DataManager.getInstance().confirmInvoice(invoiceBean)
|
||||||
|
// .subscribeOn(Schedulers.io())
|
||||||
|
// .observeOn(AndroidSchedulers.mainThread())
|
||||||
|
// .subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||||
|
// @Override
|
||||||
|
// public void onSuccess(CommonResponseBean t) {
|
||||||
|
// super.onSuccess(t);
|
||||||
|
// if (listener != null) {
|
||||||
|
// listener.onSuccess();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||||
|
// super.onCodeError(mContext, t);
|
||||||
|
// if (listener != null) {
|
||||||
|
// listener.onFailure(t.getCode() + "", t.getMessage());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }));
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onFailure(String var1, String var2) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// } else {
|
||||||
|
// Toast.makeText(ctx, "缺少身份证信息", Toast.LENGTH_SHORT).show();
|
||||||
|
// }
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// return false;
|
||||||
|
// }));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运单状态查询
|
||||||
|
*
|
||||||
|
* @param ctx
|
||||||
|
* @param shipmentCode
|
||||||
|
*/
|
||||||
|
public void getShipmentStatus(Context ctx, String shipmentCode, OnGDDownloadResultListener listener) {
|
||||||
|
ShipmentStatusBean shipmentStatusBean = new ShipmentStatusBean();
|
||||||
|
shipmentStatusBean.setShipmentCode(shipmentCode);
|
||||||
|
shipmentStatusBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||||
|
DataManager.getInstance().getShipmentStatus(shipmentStatusBean)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(CommonResponseBean t) {
|
||||||
|
super.onSuccess(t);
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onSuccess(t.getStatusCode());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||||
|
super.onCodeError(mContext, t);
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage())?"运单操作异常":t.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getPODImageNames(Context ctx, String shipmentCode) {
|
||||||
|
ShipmentStatusBean shipmentStatusBean = new ShipmentStatusBean();
|
||||||
|
shipmentStatusBean.setShipmentCode(shipmentCode);
|
||||||
|
shipmentStatusBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||||
|
DataManager.getInstance().getPODImageNames(shipmentStatusBean)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(CommonResponseBean t) {
|
||||||
|
super.onSuccess(t);
|
||||||
|
System.out.println("sadf");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||||
|
super.onCodeError(mContext, t);
|
||||||
|
System.out.println("sadf");
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开启位置上传
|
||||||
|
*
|
||||||
|
* @param act
|
||||||
|
*/
|
||||||
|
public void startLocationService(AppCompatActivity act) {
|
||||||
|
DriverAuthDataBean auth = AuthParts.getAuth(act);
|
||||||
|
if (auth == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
searchDriver(act, auth.getData().getIdcard(), new OnGDDownloadResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(String var1) {
|
||||||
|
try {
|
||||||
|
//开启定位服务
|
||||||
|
Api.setBaseUrl("https://kehui56.cn/api", "https://api.kehui56.cn/api");
|
||||||
|
String result = Api.startLocationService(act, var1, s -> {
|
||||||
|
Log.e("位置上报", s);
|
||||||
|
});
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String var1, String var2) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//查询身份证信息
|
||||||
|
// new AuthRequest().getCard(act, new Handler(msg -> {
|
||||||
|
// switch (msg.what) {
|
||||||
|
// case RequsetCodeConstants.ERROR:
|
||||||
|
// Toast.makeText(act, RequsetCodeConstants.FEEDBACK_TEXT, Toast.LENGTH_SHORT).show();
|
||||||
|
// break;
|
||||||
|
// case RequsetCodeConstants.UNKONWN:
|
||||||
|
// Toast.makeText(act, RequsetCodeConstants.UNKONWN_TEXT, Toast.LENGTH_SHORT).show();
|
||||||
|
// break;
|
||||||
|
// case RequsetCodeConstants.SERVER_ERROR:
|
||||||
|
// Toast.makeText(act, RequsetCodeConstants.SERVER_ERROR_TEXT, Toast.LENGTH_SHORT).show();
|
||||||
|
// break;
|
||||||
|
// case RequsetCodeConstants.GATEWAY_ERROR:
|
||||||
|
// Toast.makeText(act, RequsetCodeConstants.GATEWAY_ERROR_TEXT, Toast.LENGTH_SHORT).show();
|
||||||
|
// break;
|
||||||
|
// case RequsetCodeConstants.SUCCESS:
|
||||||
|
// IsAuthCardBean iacb = new Gson().fromJson(CacheGroup.cacheList.get(CertificatesActivity.ISAUTH), IsAuthCardBean.class);
|
||||||
|
// if (iacb != null || iacb.getData() != null || !TextUtils.isEmpty(iacb.getData().getIdcard())) {
|
||||||
|
// //根据身份证号查询路交司机信息
|
||||||
|
// searchDriver(act,iacb.getData().getIdcard(), new OnGDDownloadResultListener() {
|
||||||
|
// @Override
|
||||||
|
// public void onSuccess(String var1) {
|
||||||
|
// try {
|
||||||
|
// //开启定位服务
|
||||||
|
// Api.setBaseUrl("https://kehui56.cn/api", "https://api.kehui56.cn/api");
|
||||||
|
// String result = Api.startLocationService(act, var1, s -> {
|
||||||
|
// Log.e("位置上报", s);
|
||||||
|
// });
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// throw new RuntimeException(e);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onFailure(String var1, String var2) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// } else {
|
||||||
|
// Toast.makeText(act, "缺少身份证信息", Toast.LENGTH_SHORT).show();
|
||||||
|
// }
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// return false;
|
||||||
|
// }));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关闭定位服务
|
||||||
|
*/
|
||||||
|
public void stopLocationService() {
|
||||||
|
Api.stopLocationService();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询司机
|
||||||
|
*/
|
||||||
|
public void searchDriver(Context ctx, String idCard, OnGDDownloadResultListener listener) {
|
||||||
|
DataManager.getInstance().searchDriver(idCard)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(CommonResponseBean<CommonResponseBean> t) {
|
||||||
|
super.onSuccess(t);
|
||||||
|
DriverBean driver = t.getDriver();
|
||||||
|
if (driver != null && !TextUtils.isEmpty(driver.getDriverCode())) {
|
||||||
|
if (listener != null)
|
||||||
|
listener.onSuccess(driver.getDriverCode());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||||
|
super.onCodeError(mContext, t);
|
||||||
|
if (listener != null)
|
||||||
|
listener.onFailure(t.getCode(), TextUtils.isEmpty(t.getMessage())?"运单操作异常":t.getMessage());
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -28,6 +28,8 @@ public abstract class BaseActivity extends Activity {
|
|||||||
private String title_text="空白标题";
|
private String title_text="空白标题";
|
||||||
|
|
||||||
public Handler hd=new Handler(msg -> {
|
public Handler hd=new Handler(msg -> {
|
||||||
|
if (this==null||this.isFinishing())
|
||||||
|
return true;
|
||||||
msgMethod(msg);
|
msgMethod(msg);
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|||||||
+2
@@ -25,6 +25,8 @@ public class BaseAppCompatActivity extends AppCompatActivity {
|
|||||||
public static String dataName,dataName2,dataName3="";
|
public static String dataName,dataName2,dataName3="";
|
||||||
public View root;
|
public View root;
|
||||||
public Handler hd=new Handler(msg -> {
|
public Handler hd=new Handler(msg -> {
|
||||||
|
if (this==null||this.isFinishing())
|
||||||
|
return true;
|
||||||
msgMethod(msg);
|
msgMethod(msg);
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -105,6 +105,8 @@ public class BaseRecyclerView extends RecyclerView {
|
|||||||
ra.addItem(mb);
|
ra.addItem(mb);
|
||||||
}
|
}
|
||||||
public void adds(List<ManyBean> list){
|
public void adds(List<ManyBean> list){
|
||||||
|
if (ra==null)
|
||||||
|
return;
|
||||||
ra.add(list);
|
ra.add(list);
|
||||||
}
|
}
|
||||||
public AdapterAlls createsH(Context con, List<ManyBean> list){
|
public AdapterAlls createsH(Context con, List<ManyBean> list){
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 43 KiB |
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<gradient android:angle="0" android:useLevel="true"
|
||||||
|
android:startColor="#0b64f6 " android:endColor="#5cb3fd"
|
||||||
|
android:centerX="0" android:centerY="0"
|
||||||
|
android:gradientRadius="@dimen/dp_63" />
|
||||||
|
<corners android:radius="@dimen/dp_19" />
|
||||||
|
</shape>
|
||||||
|
|
||||||
|
</item>
|
||||||
|
</selector>
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="#AAAAAA" />
|
||||||
|
<corners android:topLeftRadius="@dimen/dp_29" android:topRightRadius="@dimen/dp_29"
|
||||||
|
android:bottomLeftRadius="@dimen/dp_29" android:bottomRightRadius="@dimen/dp_29" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="#E1ECFF" />
|
||||||
|
<corners android:radius="@dimen/dp_19" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
<?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"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/white"
|
||||||
|
tools:context=".ui.auth.CertificatesActivity">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/return_btn"
|
||||||
|
android:layout_width="@dimen/dp_40"
|
||||||
|
android:layout_height="@dimen/dp_31"
|
||||||
|
android:layout_marginLeft="@dimen/dp_28"
|
||||||
|
android:layout_marginTop="@dimen/dp_58"
|
||||||
|
android:padding="@dimen/dp_10"
|
||||||
|
android:scaleType="fitXY"
|
||||||
|
android:src="@mipmap/return_lefts" />
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_marginTop="@dimen/dp_210"
|
||||||
|
android:id="@+id/img"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:background="@drawable/face_success"></ImageView>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvTitle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/img"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:text="恭喜您! 实名认证成功"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_16" />
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_marginTop="@dimen/dp_10"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_46"
|
||||||
|
android:layout_below="@+id/tvTitle"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnHome"
|
||||||
|
android:layout_width="@dimen/dp_110"
|
||||||
|
android:layout_height="@dimen/dp_38"
|
||||||
|
android:background="@drawable/bg_btn_green16"
|
||||||
|
android:text="返回首页"
|
||||||
|
android:textColor="#0966FF" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_marginLeft="@dimen/dp_20"
|
||||||
|
android:id="@+id/btnAddCar"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:layout_width="@dimen/dp_110"
|
||||||
|
android:layout_height="@dimen/dp_38"
|
||||||
|
android:background="@drawable/bg_btn_deepgreen16"
|
||||||
|
android:text="添加车辆" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
<?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"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/rl_title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="44dp"
|
||||||
|
>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/back"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:src="@mipmap/btn_back" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/close"
|
||||||
|
android:layout_toRightOf="@id/back"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:text="关闭" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:layout_marginLeft="70dp"
|
||||||
|
android:layout_marginRight="60dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:textSize="17sp"
|
||||||
|
android:textColor="@color/color_333333"
|
||||||
|
android:text="人脸识别" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<com.esign.esignsdk.h5.view.X5WebView
|
||||||
|
android:id="@+id/webview"
|
||||||
|
android:layout_below="@id/rl_title"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/rl_title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_exception"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/color_white"
|
||||||
|
android:layout_below="@id/rl_title"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone"
|
||||||
|
>
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="80dp"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:src="@mipmap/icon_exception"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@color/color_282828"
|
||||||
|
android:text="@string/exception_tips"
|
||||||
|
android:gravity="center_horizontal"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
android:layout_marginLeft="@dimen/dp_14"
|
android:layout_marginLeft="@dimen/dp_14"
|
||||||
android:layout_width="@dimen/dp_143"
|
android:layout_width="@dimen/dp_143"
|
||||||
android:layout_height="@dimen/dp_36"
|
android:layout_height="@dimen/dp_36"
|
||||||
android:src="@mipmap/icon_auth_new"/>
|
android:background="@mipmap/icon_auth_new"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 49 KiB |
@@ -1,23 +0,0 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver;
|
|
||||||
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author hlh
|
|
||||||
* @version 1.0.0
|
|
||||||
* @date 2021/10/12 16:53
|
|
||||||
* @description:
|
|
||||||
*/
|
|
||||||
public class test1 {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void te(){
|
|
||||||
String s = new BigDecimal("100.000").subtract(new BigDecimal("5")).toString();
|
|
||||||
Log.i("",s);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+5
-35
@@ -1,39 +1,9 @@
|
|||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
plugins {
|
||||||
|
id 'com.android.application' version '7.2.2' apply false
|
||||||
|
id 'com.android.library' version '7.2.2' apply false
|
||||||
|
id 'org.jetbrains.kotlin.android' version '1.9.22' apply false
|
||||||
|
}
|
||||||
apply from: "compile.gradle"
|
apply from: "compile.gradle"
|
||||||
buildscript {
|
|
||||||
// ext.kotlin_version = "1.5.0"
|
|
||||||
ext.kotlin_version = "1.6.10"
|
|
||||||
repositories {
|
|
||||||
google()
|
|
||||||
jcenter() // 这个
|
|
||||||
mavenCentral()
|
|
||||||
maven { url 'http://developer.huawei.com/repo/'}
|
|
||||||
maven { url 'https://repo1.maven.org/maven2/' }
|
|
||||||
maven {
|
|
||||||
url 'https://maven.aliyun.com/repository/releases'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dependencies {
|
|
||||||
classpath 'com.android.tools.build:gradle:4.2.2'
|
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
||||||
classpath 'com.huawei.agconnect:agcp:1.4.1.300'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
allprojects {
|
|
||||||
repositories {
|
|
||||||
google()
|
|
||||||
jcenter() // Warning: this repository is going to shut down soon
|
|
||||||
mavenCentral()
|
|
||||||
maven {url 'http://developer.huawei.com/repo/'}
|
|
||||||
maven { url 'https://www.jitpack.io' }
|
|
||||||
maven { url 'https://repo1.maven.org/maven2/' }
|
|
||||||
maven {
|
|
||||||
url 'https://maven.aliyun.com/repository/releases'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
task clean(type: Delete) {
|
task clean(type: Delete) {
|
||||||
delete rootProject.buildDir
|
delete rootProject.buildDir
|
||||||
}
|
}
|
||||||
+2
-1
@@ -1,6 +1,7 @@
|
|||||||
#Mon Jul 12 10:16:49 CST 2021
|
#Mon Jul 12 10:16:49 CST 2021
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-6.7.1-bin.zip
|
#distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-6.7.1-bin.zip
|
||||||
|
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-7.3.3-bin.zip
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ android {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
// implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||||
implementation 'androidx.core:core-ktx:1.3.1'
|
implementation 'androidx.core:core-ktx:1.3.1'
|
||||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||||
implementation 'com.google.android.material:material:1.2.1'
|
implementation 'com.google.android.material:material:1.2.1'
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.dahe.mylibrary.bean;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName DriverBean
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/11/28 12:24
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public class DriverBean implements Serializable {
|
||||||
|
|
||||||
|
private String driverCode;
|
||||||
|
private String isTaxRegistered;
|
||||||
|
private String taxRegisterStatus;
|
||||||
|
private String taxRegisterStatusDescription;
|
||||||
|
|
||||||
|
public String getDriverCode() {
|
||||||
|
return driverCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDriverCode(String driverCode) {
|
||||||
|
this.driverCode = driverCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIsTaxRegistered() {
|
||||||
|
return isTaxRegistered;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsTaxRegistered(String isTaxRegistered) {
|
||||||
|
this.isTaxRegistered = isTaxRegistered;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaxRegisterStatus() {
|
||||||
|
return taxRegisterStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaxRegisterStatus(String taxRegisterStatus) {
|
||||||
|
this.taxRegisterStatus = taxRegisterStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaxRegisterStatusDescription() {
|
||||||
|
return taxRegisterStatusDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaxRegisterStatusDescription(String taxRegisterStatusDescription) {
|
||||||
|
this.taxRegisterStatusDescription = taxRegisterStatusDescription;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.dahe.mylibrary.callback;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName OnGDDownloadResultListener
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/11/25 18:22
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public interface OnGDDownloadResultListener {
|
||||||
|
void onSuccess(String var1);
|
||||||
|
|
||||||
|
void onFailure(String var1, String var2);
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.dahe.mylibrary.callback;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName OnGDResultListener
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/11/25 17:48
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public interface OnGDResultListener {
|
||||||
|
|
||||||
|
void onSuccess();
|
||||||
|
|
||||||
|
void onFailure(String var1, String var2);
|
||||||
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.dahe.mylibrary.net;
|
package com.dahe.mylibrary.net;
|
||||||
|
|
||||||
|
import com.dahe.mylibrary.bean.DriverBean;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -8,13 +10,59 @@ import java.io.Serializable;
|
|||||||
|
|
||||||
public class CommonResponseBean<T> implements Serializable {
|
public class CommonResponseBean<T> implements Serializable {
|
||||||
private T data;
|
private T data;
|
||||||
private int code;
|
private String code;
|
||||||
private String info;
|
private String info;
|
||||||
private String msg;
|
private String msg;
|
||||||
|
private String message;
|
||||||
private String url;
|
private String url;
|
||||||
private String fileName;
|
private String fileName;
|
||||||
|
private String token;
|
||||||
|
private String expiryIn;
|
||||||
|
private String statusCode;
|
||||||
private boolean success;
|
private boolean success;
|
||||||
|
|
||||||
|
private DriverBean driver;
|
||||||
|
|
||||||
|
public DriverBean getDriver() {
|
||||||
|
return driver;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDriver(DriverBean driver) {
|
||||||
|
this.driver = driver;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatusCode() {
|
||||||
|
return statusCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatusCode(String statusCode) {
|
||||||
|
this.statusCode = statusCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMessage(String message) {
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getToken() {
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setToken(String token) {
|
||||||
|
this.token = token;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExpiryIn() {
|
||||||
|
return expiryIn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExpiryIn(String expiryIn) {
|
||||||
|
this.expiryIn = expiryIn;
|
||||||
|
}
|
||||||
|
|
||||||
public T getData() {
|
public T getData() {
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -23,11 +71,11 @@ public class CommonResponseBean<T> implements Serializable {
|
|||||||
this.data = data;
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCode() {
|
public String getCode() {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCode(int code) {
|
public void setCode(String code) {
|
||||||
this.code = code;
|
this.code = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ public class BaseSPUtils {
|
|||||||
public static final String USER_INFO_KEY = "user_info_key";
|
public static final String USER_INFO_KEY = "user_info_key";
|
||||||
public static final String NET_SERVICE_TEST = "net_service_test";
|
public static final String NET_SERVICE_TEST = "net_service_test";
|
||||||
public static final String SEARRH_CACHE = "search_cache";
|
public static final String SEARRH_CACHE = "search_cache";
|
||||||
|
public static final String NEW_LJ_TOKEN = "NEW_LJ_TOKEN";
|
||||||
public static final String NAVI_PH_EDIT_CACHE = "navi_ph_edit_cache";
|
public static final String NAVI_PH_EDIT_CACHE = "navi_ph_edit_cache";
|
||||||
public static final String FIRST_OPEN = "first_open";
|
public static final String FIRST_OPEN = "first_open";
|
||||||
public static final String KEY_PRIVACY_AGREEMENT = "privacy_agreement";
|
public static final String KEY_PRIVACY_AGREEMENT = "privacy_agreement";
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.dahe.mylibrary.utils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName Gps
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/12/13 17:25
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public class Gps {
|
||||||
|
private double wgLon;
|
||||||
|
private double wgLat;
|
||||||
|
|
||||||
|
public Gps(double wgLat,double wgLon) {
|
||||||
|
this.wgLat = wgLat;
|
||||||
|
this.wgLon = wgLon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getWgLon() {
|
||||||
|
return wgLon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWgLon(double wgLon) {
|
||||||
|
this.wgLon = wgLon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getWgLat() {
|
||||||
|
return wgLat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWgLat(double wgLat) {
|
||||||
|
this.wgLat = wgLat;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,9 +1,12 @@
|
|||||||
package com.dahe.mylibrary.utils;
|
package com.dahe.mylibrary.utils;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.bumptech.glide.load.MultiTransformation;
|
import com.bumptech.glide.load.MultiTransformation;
|
||||||
@@ -70,10 +73,20 @@ public class ImageLoader {
|
|||||||
*/
|
*/
|
||||||
public void loadImage(Context context, final Object url, final ImageView imageView, RequestOptions requestOptions, int placeholder) {
|
public void loadImage(Context context, final Object url, final ImageView imageView, RequestOptions requestOptions, int placeholder) {
|
||||||
if (null != context) {
|
if (null != context) {
|
||||||
|
if (context instanceof Activity) {
|
||||||
|
Activity activity = (Activity) context;
|
||||||
|
if (activity != null && !activity.isFinishing()) {
|
||||||
if (placeholder != -1)
|
if (placeholder != -1)
|
||||||
requestOptions = requestOptions.placeholder(placeholder).error(placeholder);
|
requestOptions = requestOptions.placeholder(placeholder).error(placeholder);
|
||||||
Glide.with(context).load(url).centerCrop().apply(requestOptions).into(imageView);
|
Glide.with(context).load(url).centerCrop().apply(requestOptions).into(imageView);
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
if (placeholder != -1)
|
||||||
|
requestOptions = requestOptions.placeholder(placeholder).error(placeholder);
|
||||||
|
Glide.with(context).load(url).centerCrop().apply(requestOptions).into(imageView);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,539 @@
|
|||||||
|
package com.dahe.mylibrary.utils;
|
||||||
|
|
||||||
|
|
||||||
|
import android.Manifest;
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.location.Address;
|
||||||
|
import android.location.Criteria;
|
||||||
|
import android.location.Geocoder;
|
||||||
|
import android.location.Location;
|
||||||
|
import android.location.LocationListener;
|
||||||
|
import android.location.LocationManager;
|
||||||
|
import android.location.LocationProvider;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.provider.Settings;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import androidx.core.app.ActivityCompat;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ondear
|
||||||
|
* time : 16/11/13
|
||||||
|
* desc : 定位相关工具类
|
||||||
|
*/
|
||||||
|
public class RxLocationUtils {
|
||||||
|
|
||||||
|
public static double pi = 3.1415926535897932384626;
|
||||||
|
public static double a = 6378245.0;
|
||||||
|
public static double ee = 0.00669342162296594323;
|
||||||
|
private static OnLocationChangeListener mListener;
|
||||||
|
private static MyLocationListener myLocationListener;
|
||||||
|
private static LocationManager mLocationManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断Gps是否可用
|
||||||
|
*
|
||||||
|
* @return {@code true}: 是<br>{@code false}: 否
|
||||||
|
*/
|
||||||
|
public static boolean isGpsEnabled(Context context) {
|
||||||
|
LocationManager lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
|
||||||
|
return lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断定位是否可用
|
||||||
|
*
|
||||||
|
* @return {@code true}: 是<br>{@code false}: 否
|
||||||
|
*/
|
||||||
|
public static boolean isLocationEnabled(Context context) {
|
||||||
|
LocationManager lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
|
||||||
|
return lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER) || lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打开Gps设置界面
|
||||||
|
*/
|
||||||
|
public static void openGpsSettings(Context context) {
|
||||||
|
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
|
||||||
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
context.startActivity(intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册
|
||||||
|
* <p>使用完记得调用{@link #unregister()}</p>
|
||||||
|
* <p>需添加权限 {@code <uses-permission android:name="android.permission.INTERNET"/>}</p>
|
||||||
|
* <p>需添加权限 {@code <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>}</p>
|
||||||
|
* <p>需添加权限 {@code <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>}</p>
|
||||||
|
* <p>如果{@code minDistance}为0,则通过{@code minTime}来定时更新;</p>
|
||||||
|
* <p>{@code minDistance}不为0,则以{@code minDistance}为准;</p>
|
||||||
|
* <p>两者都为0,则随时刷新。</p>
|
||||||
|
*
|
||||||
|
* @param minTime 位置信息更新周期(单位:毫秒)
|
||||||
|
* @param minDistance 位置变化最小距离:当位置距离变化超过此值时,将更新位置信息(单位:米)
|
||||||
|
* @param listener 位置刷新的回调接口
|
||||||
|
* @return {@code true}: 初始化成功<br>{@code false}: 初始化失败
|
||||||
|
*/
|
||||||
|
public static boolean register(Context context, long minTime, long minDistance, OnLocationChangeListener listener) {
|
||||||
|
if (listener == null) return false;
|
||||||
|
if (ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
ActivityCompat.requestPermissions((Activity) context, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 1);
|
||||||
|
ActivityCompat.requestPermissions((Activity) context, new String[]{Manifest.permission.ACCESS_COARSE_LOCATION}, 1);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
mLocationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
|
||||||
|
mListener = listener;
|
||||||
|
if (!isLocationEnabled(context)) {
|
||||||
|
ToastUtils.showToast(context, "无法定位,请打开定位服务");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
String provider = mLocationManager.getBestProvider(getCriteria(), true);
|
||||||
|
|
||||||
|
Location location = mLocationManager.getLastKnownLocation(provider);
|
||||||
|
if (location != null) listener.getLastKnownLocation(location);
|
||||||
|
if (myLocationListener == null) myLocationListener = new MyLocationListener();
|
||||||
|
mLocationManager.requestLocationUpdates(provider, minTime, minDistance, myLocationListener);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注销
|
||||||
|
*/
|
||||||
|
public static void unregister() {
|
||||||
|
if (mLocationManager != null) {
|
||||||
|
if (myLocationListener != null) {
|
||||||
|
mLocationManager.removeUpdates(myLocationListener);
|
||||||
|
myLocationListener = null;
|
||||||
|
}
|
||||||
|
mLocationManager = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置定位参数
|
||||||
|
*
|
||||||
|
* @return {@link Criteria}
|
||||||
|
*/
|
||||||
|
private static Criteria getCriteria() {
|
||||||
|
Criteria criteria = new Criteria();
|
||||||
|
//设置定位精确度 Criteria.ACCURACY_COARSE比较粗略,Criteria.ACCURACY_FINE则比较精细
|
||||||
|
criteria.setAccuracy(Criteria.ACCURACY_FINE);
|
||||||
|
//设置是否要求速度
|
||||||
|
criteria.setSpeedRequired(false);
|
||||||
|
// 设置是否允许运营商收费
|
||||||
|
criteria.setCostAllowed(false);
|
||||||
|
//设置是否需要方位信息
|
||||||
|
criteria.setBearingRequired(false);
|
||||||
|
//设置是否需要海拔信息
|
||||||
|
criteria.setAltitudeRequired(false);
|
||||||
|
// 设置对电源的需求
|
||||||
|
criteria.setPowerRequirement(Criteria.POWER_LOW);
|
||||||
|
return criteria;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据经纬度获取地理位置
|
||||||
|
*
|
||||||
|
* @param context 上下文
|
||||||
|
* @param latitude 纬度
|
||||||
|
* @param longitude 经度
|
||||||
|
* @return {@link Address}
|
||||||
|
*/
|
||||||
|
public static Address getAddress(Context context, double latitude, double longitude) {
|
||||||
|
Geocoder geocoder = new Geocoder(context, Locale.getDefault());
|
||||||
|
try {
|
||||||
|
List<Address> addresses = geocoder.getFromLocation(latitude, longitude, 1);
|
||||||
|
if (addresses.size() > 0) return addresses.get(0);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据经纬度获取所在国家
|
||||||
|
*
|
||||||
|
* @param context 上下文
|
||||||
|
* @param latitude 纬度
|
||||||
|
* @param longitude 经度
|
||||||
|
* @return 所在国家
|
||||||
|
*/
|
||||||
|
public static String getCountryName(Context context, double latitude, double longitude) {
|
||||||
|
Address address = getAddress(context, latitude, longitude);
|
||||||
|
return address == null ? "unknown" : address.getCountryName();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据经纬度获取所在地
|
||||||
|
*
|
||||||
|
* @param context 上下文
|
||||||
|
* @param latitude 纬度
|
||||||
|
* @param longitude 经度
|
||||||
|
* @return 所在地
|
||||||
|
*/
|
||||||
|
public static String getLocality(Context context, double latitude, double longitude) {
|
||||||
|
Address address = getAddress(context, latitude, longitude);
|
||||||
|
return address == null ? "unknown" : address.getLocality();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据经纬度获取所在街道
|
||||||
|
*
|
||||||
|
* @param context 上下文
|
||||||
|
* @param latitude 纬度
|
||||||
|
* @param longitude 经度
|
||||||
|
* @return 所在街道
|
||||||
|
*/
|
||||||
|
public static String getStreet(Context context, double latitude, double longitude) {
|
||||||
|
Address address = getAddress(context, latitude, longitude);
|
||||||
|
return address == null ? "unknown" : address.getAddressLine(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据经纬度获取详细地址
|
||||||
|
*
|
||||||
|
* @param context 上下文
|
||||||
|
* @param latitude 纬度
|
||||||
|
* @param longitude 经度
|
||||||
|
* @return 所在街道
|
||||||
|
*/
|
||||||
|
public static String getFeature(Context context, double latitude, double longitude) {
|
||||||
|
Address address = getAddress(context, latitude, longitude);
|
||||||
|
return address == null ? "未知地点" : address.getFeatureName();
|
||||||
|
}
|
||||||
|
|
||||||
|
//------------------------------------------坐标转换工具start--------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GPS坐标 转换成 角度
|
||||||
|
* 例如 113.202222 转换成 113°12′8″
|
||||||
|
*
|
||||||
|
* @param location
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String gpsToDegree(double location) {
|
||||||
|
double degree = Math.floor(location);
|
||||||
|
double minute_temp = (location - degree) * 60;
|
||||||
|
double minute = Math.floor(minute_temp);
|
||||||
|
// double second = Math.floor((minute_temp - minute)*60);
|
||||||
|
String second = new DecimalFormat("#.##").format((minute_temp - minute) * 60);
|
||||||
|
return (int) degree + "°" + (int) minute + "′" + second + "″";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际 GPS84 坐标系
|
||||||
|
* 转换成
|
||||||
|
* [国测局坐标系] 火星坐标系 (GCJ-02)
|
||||||
|
* <p>
|
||||||
|
* World Geodetic System ==> Mars Geodetic System
|
||||||
|
*
|
||||||
|
* @param lon 经度
|
||||||
|
* @param lat 纬度
|
||||||
|
* @return GPS实体类
|
||||||
|
*/
|
||||||
|
public static Gps GPS84ToGCJ02(double lat, double lon) {
|
||||||
|
if (outOfChina(lat, lon)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
double dLat = transformLat(lon - 105.0, lat - 35.0);
|
||||||
|
double dLon = transformLon(lon - 105.0, lat - 35.0);
|
||||||
|
double radLat = lat / 180.0 * pi;
|
||||||
|
double magic = Math.sin(radLat);
|
||||||
|
magic = 1 - ee * magic * magic;
|
||||||
|
double sqrtMagic = Math.sqrt(magic);
|
||||||
|
dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi);
|
||||||
|
dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi);
|
||||||
|
double mgLat = lat + dLat;
|
||||||
|
double mgLon = lon + dLon;
|
||||||
|
return new Gps(mgLat, mgLon);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [国测局坐标系] 火星坐标系 (GCJ-02)
|
||||||
|
* 转换成
|
||||||
|
* 国际 GPS84 坐标系
|
||||||
|
*
|
||||||
|
* @param lon 火星经度
|
||||||
|
* @param lat 火星纬度
|
||||||
|
*/
|
||||||
|
public static Gps GCJ02ToGPS84(double lat, double lon) {
|
||||||
|
Gps gps = transform(lat, lon);
|
||||||
|
double lontitude = lon * 2 - gps.getWgLon();
|
||||||
|
double latitude = lat * 2 - gps.getWgLat();
|
||||||
|
return new Gps(latitude, lontitude);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 火星坐标系 (GCJ-02)
|
||||||
|
* 转换成
|
||||||
|
* 百度坐标系 (BD-09)
|
||||||
|
*
|
||||||
|
* @param gg_lon 经度
|
||||||
|
* @param gg_lat 纬度
|
||||||
|
*/
|
||||||
|
public static Gps GCJ02ToBD09(double gg_lat, double gg_lon) {
|
||||||
|
double x = gg_lon, y = gg_lat;
|
||||||
|
double z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * pi);
|
||||||
|
double theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * pi);
|
||||||
|
double bd_lon = z * Math.cos(theta) + 0.0065;
|
||||||
|
double bd_lat = z * Math.sin(theta) + 0.006;
|
||||||
|
return new Gps(bd_lat, bd_lon);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际 GPS84 坐标系
|
||||||
|
* 转换成
|
||||||
|
* 百度坐标系 (BD-09)
|
||||||
|
*
|
||||||
|
* @param lon 经度
|
||||||
|
* @param lat 纬度
|
||||||
|
*/
|
||||||
|
public static Gps GPS84ToBD09(double lat, double lon) {
|
||||||
|
Gps gps = GPS84ToGCJ02(lat,lon);
|
||||||
|
if (gps == null) {
|
||||||
|
return new Gps(lat,lon);
|
||||||
|
}
|
||||||
|
//GCJ-02 转 BD-09
|
||||||
|
return GCJ02ToBD09(gps.getWgLat(), gps.getWgLon());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百度坐标系 (BD-09)
|
||||||
|
* 转换成
|
||||||
|
* 火星坐标系 (GCJ-02)
|
||||||
|
*
|
||||||
|
* @param bd_lon 百度*经度
|
||||||
|
* @param bd_lat 百度*纬度
|
||||||
|
* @return GPS实体类
|
||||||
|
*/
|
||||||
|
public static Gps BD09ToGCJ02(double bd_lat, double bd_lon) {
|
||||||
|
double x = bd_lon - 0.0065, y = bd_lat - 0.006;
|
||||||
|
double z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * pi);
|
||||||
|
double theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * pi);
|
||||||
|
double gg_lon = z * Math.cos(theta);
|
||||||
|
double gg_lat = z * Math.sin(theta);
|
||||||
|
return new Gps(gg_lat, gg_lon);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百度坐标系 (BD-09)
|
||||||
|
* 转换成
|
||||||
|
* 国际 GPS84 坐标系
|
||||||
|
*
|
||||||
|
* @param bd_lon 百度*经度
|
||||||
|
* @param bd_lat 百度*纬度
|
||||||
|
* @return GPS实体类
|
||||||
|
*/
|
||||||
|
public static Gps BD09ToGPS84(double bd_lat, double bd_lon) {
|
||||||
|
Gps gcj02 = BD09ToGCJ02(bd_lat, bd_lon);
|
||||||
|
Gps map84 = GCJ02ToGPS84(gcj02.getWgLat(),
|
||||||
|
gcj02.getWgLon());
|
||||||
|
return map84;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 不在中国范围内
|
||||||
|
*
|
||||||
|
* @param lon 经度
|
||||||
|
* @param lat 纬度
|
||||||
|
* @return boolean值
|
||||||
|
*/
|
||||||
|
public static boolean outOfChina(double lat, double lon) {
|
||||||
|
if (lon < 72.004 || lon > 137.8347)
|
||||||
|
return true;
|
||||||
|
return lat < 0.8293 || lat > 55.8271;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转化算法
|
||||||
|
*
|
||||||
|
* @param lon
|
||||||
|
* @param lat
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Gps transform(double lat, double lon) {
|
||||||
|
if (outOfChina(lat, lon)) {
|
||||||
|
return new Gps(lat, lon);
|
||||||
|
}
|
||||||
|
double dLat = transformLat(lon - 105.0, lat - 35.0);
|
||||||
|
double dLon = transformLon(lon - 105.0, lat - 35.0);
|
||||||
|
double radLat = lat / 180.0 * pi;
|
||||||
|
double magic = Math.sin(radLat);
|
||||||
|
magic = 1 - ee * magic * magic;
|
||||||
|
double sqrtMagic = Math.sqrt(magic);
|
||||||
|
dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi);
|
||||||
|
dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi);
|
||||||
|
double mgLat = lat + dLat;
|
||||||
|
double mgLon = lon + dLon;
|
||||||
|
return new Gps(mgLat, mgLon);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 纬度转化算法
|
||||||
|
*
|
||||||
|
* @param x
|
||||||
|
* @param y
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static double transformLat(double x, double y) {
|
||||||
|
double ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y
|
||||||
|
+ 0.2 * Math.sqrt(Math.abs(x));
|
||||||
|
ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0;
|
||||||
|
ret += (20.0 * Math.sin(y * pi) + 40.0 * Math.sin(y / 3.0 * pi)) * 2.0 / 3.0;
|
||||||
|
ret += (160.0 * Math.sin(y / 12.0 * pi) + 320 * Math.sin(y * pi / 30.0)) * 2.0 / 3.0;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 经度转化算法
|
||||||
|
*
|
||||||
|
* @param x
|
||||||
|
* @param y
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static double transformLon(double x, double y) {
|
||||||
|
double ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1
|
||||||
|
* Math.sqrt(Math.abs(x));
|
||||||
|
ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0;
|
||||||
|
ret += (20.0 * Math.sin(x * pi) + 40.0 * Math.sin(x / 3.0 * pi)) * 2.0 / 3.0;
|
||||||
|
ret += (150.0 * Math.sin(x / 12.0 * pi) + 300.0 * Math.sin(x / 30.0
|
||||||
|
* pi)) * 2.0 / 3.0;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnLocationChangeListener {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取最后一次保留的坐标
|
||||||
|
*
|
||||||
|
* @param location 坐标
|
||||||
|
*/
|
||||||
|
void getLastKnownLocation(Location location);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当坐标改变时触发此函数,如果Provider传进相同的坐标,它就不会被触发
|
||||||
|
*
|
||||||
|
* @param location 坐标
|
||||||
|
*/
|
||||||
|
void onLocationChanged(Location location);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* provider的在可用、暂时不可用和无服务三个状态直接切换时触发此函数
|
||||||
|
*
|
||||||
|
* @param provider 提供者
|
||||||
|
* @param status 状态
|
||||||
|
* @param extras provider可选包
|
||||||
|
*/
|
||||||
|
void onStatusChanged(String provider, int status, Bundle extras);//位置状态发生改变
|
||||||
|
|
||||||
|
void onProviderEnabled(String provider);
|
||||||
|
|
||||||
|
void onProviderDisabled(String provider);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class MyLocationListener
|
||||||
|
implements LocationListener {
|
||||||
|
/**
|
||||||
|
* 当坐标改变时触发此函数,如果Provider传进相同的坐标,它就不会被触发
|
||||||
|
*
|
||||||
|
* @param location 坐标
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onLocationChanged(Location location) {
|
||||||
|
if (mListener != null) {
|
||||||
|
mListener.onLocationChanged(location);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* provider的在可用、暂时不可用和无服务三个状态直接切换时触发此函数
|
||||||
|
*
|
||||||
|
* @param provider 提供者
|
||||||
|
* @param status 状态
|
||||||
|
* @param extras provider可选包
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onStatusChanged(String provider, int status, Bundle extras) {
|
||||||
|
if (mListener != null) {
|
||||||
|
mListener.onStatusChanged(provider, status, extras);
|
||||||
|
}
|
||||||
|
switch (status) {
|
||||||
|
case LocationProvider.AVAILABLE:
|
||||||
|
Log.d("onStatusChanged", "当前GPS状态为可见状态");
|
||||||
|
break;
|
||||||
|
case LocationProvider.OUT_OF_SERVICE:
|
||||||
|
Log.d("onStatusChanged", "当前GPS状态为服务区外状态");
|
||||||
|
break;
|
||||||
|
case LocationProvider.TEMPORARILY_UNAVAILABLE:
|
||||||
|
Log.d("onStatusChanged", "当前GPS状态为暂停服务状态");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* provider被enable时触发此函数,比如GPS被打开
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onProviderEnabled(String provider) {
|
||||||
|
if (mListener != null) {
|
||||||
|
mListener.onProviderEnabled(provider);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* provider被disable时触发此函数,比如GPS被关闭
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onProviderDisabled(String provider) {
|
||||||
|
if (mListener != null) {
|
||||||
|
mListener.onProviderDisabled(provider);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//===========================================坐标转换工具end====================================
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private static final double EARTH_RADIUS = 6378137.0; //地球半径
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算两个经纬度之间的距离
|
||||||
|
*
|
||||||
|
* @param longitude
|
||||||
|
* @param latitude
|
||||||
|
* @param longitude2
|
||||||
|
* @param latitude2
|
||||||
|
* @return 单位米
|
||||||
|
*/
|
||||||
|
public static double getDistance(double longitude, double latitude, double longitude2, double latitude2) {
|
||||||
|
double lat1 = rad(latitude);
|
||||||
|
double lat2 = rad(latitude2);
|
||||||
|
double a = lat1 - lat2;
|
||||||
|
double b = rad(longitude) - rad(longitude2);
|
||||||
|
double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(lat1) * Math.cos(lat2) * Math.pow(Math.sin(b / 2), 2)));
|
||||||
|
s = s * EARTH_RADIUS;
|
||||||
|
s = Math.round(s * 10000) / 10000; //四舍五入
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 弧度换为角度
|
||||||
|
* @param d
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private static double rad(double d) {
|
||||||
|
return d * Math.PI / 180.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,3 +1,27 @@
|
|||||||
|
pluginManagement {
|
||||||
|
repositories {
|
||||||
|
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
|
||||||
|
maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' }
|
||||||
|
maven { url "https://jitpack.io" }
|
||||||
|
gradlePluginPortal()
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencyResolutionManagement {
|
||||||
|
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||||
|
repositories {
|
||||||
|
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
|
||||||
|
maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' }
|
||||||
|
maven { url "https://jitpack.io" }
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
rootProject.name = "wangluohuoyun"
|
rootProject.name = "wangluohuoyun"
|
||||||
include ':app'
|
include ':app'
|
||||||
//include ':AliyunVideoCommon'
|
//include ':AliyunVideoCommon'
|
||||||
|
|||||||
Reference in New Issue
Block a user