Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9620f13b42 | ||
|
|
ea649da8dd | ||
|
|
edf3f494da | ||
|
|
2bdf0d45dc | ||
|
|
725860544a | ||
|
|
befc5419a2 | ||
|
|
f0778a34e3 | ||
|
|
fbe1492800 | ||
|
|
b5fb6bec07 | ||
|
|
80c67f9c79 | ||
|
|
932a33f3d1 |
@@ -35,10 +35,10 @@ android {
|
|||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.arpa.hndahesudintocctmsdriver"
|
applicationId "com.arpa.hndahesudintocctmsdriver"
|
||||||
minSdkVersion 24
|
minSdkVersion 23
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 67
|
versionCode 60
|
||||||
versionName "3.3.7"
|
versionName "3.3.0"
|
||||||
flavorDimensions "CHANNEL_VALUE"
|
flavorDimensions "CHANNEL_VALUE"
|
||||||
flavorDimensions "app_icon"
|
flavorDimensions "app_icon"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
@@ -101,11 +101,11 @@ android {
|
|||||||
app_icon : "@drawable/diver_logo_text",
|
app_icon : "@drawable/diver_logo_text",
|
||||||
GAODEKEY : "6791d69f6221a0841b521763af86eb01",
|
GAODEKEY : "6791d69f6221a0841b521763af86eb01",
|
||||||
JPUSH_PKGNAME: applicationId,
|
JPUSH_PKGNAME: applicationId,
|
||||||
JPUSH_APPKEY : "fba6f55621c670d8c1fe9191", //JPush 上注册的包名对应的 Appkey.
|
JPUSH_APPKEY : "571d93ae5117da6dee848c92", //JPush 上注册的包名对应的 Appkey.
|
||||||
JPUSH_CHANNEL: "developer-default"//暂时填写默认值即可.
|
JPUSH_CHANNEL: "developer-default"//暂时填写默认值即可.
|
||||||
]
|
]
|
||||||
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi-staging.alct56.com\"")
|
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi-staging.alct56.com\"")
|
||||||
buildConfigField("String", "BASE_URL", "\"https://app.test.dahehuoyun.com/api/\"")
|
buildConfigField("String", "BASE_URL", "\"http://app.test.dahehuoyun.com/api/\"")
|
||||||
buildConfigField "boolean", "isTest", "true"
|
buildConfigField "boolean", "isTest", "true"
|
||||||
//APP名称,可以在androidMainfest中引用
|
//APP名称,可以在androidMainfest中引用
|
||||||
resValue "string", "appName", "司机测试"
|
resValue "string", "appName", "司机测试"
|
||||||
@@ -114,9 +114,9 @@ android {
|
|||||||
applicationId "com.arpa.hndahesudintocctmsdriver"
|
applicationId "com.arpa.hndahesudintocctmsdriver"
|
||||||
manifestPlaceholders = [CHANNEL_VALUE: "大河好运司机",
|
manifestPlaceholders = [CHANNEL_VALUE: "大河好运司机",
|
||||||
app_icon : "@drawable/diver_logo",
|
app_icon : "@drawable/diver_logo",
|
||||||
GAODEKEY : "9480fd96746922630e9bf6c75a101059",
|
GAODEKEY : "78019612271411eca3af34db91930620",
|
||||||
JPUSH_PKGNAME: applicationId,
|
JPUSH_PKGNAME: applicationId,
|
||||||
JPUSH_APPKEY : "fba6f55621c670d8c1fe9191", //JPush 上注册的包名对应的 Appkey.
|
JPUSH_APPKEY : "571d93ae5117da6dee848c92", //JPush 上注册的包名对应的 Appkey.
|
||||||
JPUSH_CHANNEL: "developer-default"//暂时填写默认值即可.
|
JPUSH_CHANNEL: "developer-default"//暂时填写默认值即可.
|
||||||
]
|
]
|
||||||
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi.alct56.com\"")
|
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi.alct56.com\"")
|
||||||
@@ -126,6 +126,22 @@ android {
|
|||||||
resValue "string", "appName", "大河好运司机"
|
resValue "string", "appName", "大河好运司机"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
productbc {
|
||||||
|
applicationId "com.arpa.hndahesudintocctmsdriver.bc"
|
||||||
|
manifestPlaceholders = [CHANNEL_VALUE: "司机运营",
|
||||||
|
app_icon : "@drawable/diver_logo_yunying",
|
||||||
|
GAODEKEY : "f960bc6d14788238918bd014fa08a870",
|
||||||
|
JPUSH_PKGNAME: applicationId,
|
||||||
|
JPUSH_APPKEY : "571d93ae5117da6dee848c92", //JPush 上注册的包名对应的 Appkey.
|
||||||
|
JPUSH_CHANNEL: "developer-default"//暂时填写默认值即可.
|
||||||
|
]
|
||||||
|
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi.alct56.com\"")
|
||||||
|
buildConfigField("String", "BASE_URL", "\"http://app.dahehuoyun.com/api/\"")
|
||||||
|
buildConfigField "boolean", "isTest", "false"
|
||||||
|
//APP名称,可以在androidMainfest中引用
|
||||||
|
resValue "string", "appName", "司机运营"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// productFlavors.all { flavor ->
|
// productFlavors.all { flavor ->
|
||||||
// flavor.manifestPlaceholders = [CHANNEL_VALUE: name]
|
// flavor.manifestPlaceholders = [CHANNEL_VALUE: name]
|
||||||
@@ -228,6 +244,5 @@ dependencies {
|
|||||||
implementation 'com.github.getActivity:XToast:8.2'
|
implementation 'com.github.getActivity:XToast:8.2'
|
||||||
|
|
||||||
implementation project(path: ':mylibrary')
|
implementation project(path: ':mylibrary')
|
||||||
implementation 'com.lk.mapsdk:sdk-full:2.3.7'
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
<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" />
|
||||||
@@ -15,8 +14,6 @@
|
|||||||
<!--播音-->
|
<!--播音-->
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
<!-- 地图截屏图片保存等 -->
|
|
||||||
<uses-permission android:name="android.permission.READ_MEDIA_PERMISSION" />
|
|
||||||
<!-- 极光 -->
|
<!-- 极光 -->
|
||||||
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||||
<uses-permission android:name="android.permission.READ_PROFILE" />
|
<uses-permission android:name="android.permission.READ_PROFILE" />
|
||||||
@@ -56,7 +53,7 @@
|
|||||||
android:name="com.arpa.hndahesudintocctmsdriver.App"
|
android:name="com.arpa.hndahesudintocctmsdriver.App"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:excludeFromRecents="true"
|
android:excludeFromRecents="true"
|
||||||
android:icon="@mipmap/diver_logo"
|
android:icon="${app_icon}"
|
||||||
android:label="@string/appName"
|
android:label="@string/appName"
|
||||||
android:largeHeap="true"
|
android:largeHeap="true"
|
||||||
android:requestLegacyExternalStorage="true"
|
android:requestLegacyExternalStorage="true"
|
||||||
@@ -69,24 +66,19 @@
|
|||||||
android:name="com/alct/mdp"
|
android:name="com/alct/mdp"
|
||||||
android:required="false" />
|
android:required="false" />
|
||||||
|
|
||||||
<meta-data
|
|
||||||
android:name="com.lk.lbsapi.API_KEY"
|
|
||||||
android:value="EE1721986040968235494A762772C95410D9881BB10790FC0BCRFNPFKW4K6697" />
|
|
||||||
|
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.MainActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.MainActivity"
|
||||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:launchMode="singleTop"
|
android:launchMode="singleTop"
|
||||||
android:screenOrientation="portrait"></activity>
|
android:screenOrientation="portrait" ></activity>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.wallet.WithdrawalActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.wallet.WithdrawalActivity"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.wallet.UpBankActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.wallet.UpBankActivity"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait"/>
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.OrderAllActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.OrderAllActivity"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
@@ -101,13 +93,13 @@
|
|||||||
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: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="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivityBC"
|
||||||
android:screenOrientation="portrait">
|
android:screenOrientation="portrait">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -118,10 +110,8 @@
|
|||||||
<data android:mimeType="*/*" />
|
<data android:mimeType="*/*" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
</activity>
|
</activity> <activity
|
||||||
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity"
|
||||||
<activity
|
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivityBC"
|
|
||||||
android:screenOrientation="portrait">
|
android:screenOrientation="portrait">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -150,13 +140,13 @@
|
|||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.GetShangChuanActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.GetShangChuanActivity"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait"/>
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.AuthQualificationActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.AuthQualificationActivity"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait"/>
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.OrderListActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.OrderListActivity"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait"/>
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.HuoYunDelActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.HuoYunDelActivity"
|
||||||
android:screenOrientation="portrait">
|
android:screenOrientation="portrait">
|
||||||
@@ -169,17 +159,15 @@
|
|||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity"
|
||||||
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
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait"/>
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.login.WelcomeActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.login.WelcomeActivity"
|
||||||
android:exported="true"
|
|
||||||
android:screenOrientation="portrait">
|
android:screenOrientation="portrait">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
@@ -200,10 +188,10 @@
|
|||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.drivercircle.VideoReleaseActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.drivercircle.VideoReleaseActivity"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait"/>
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.WebPDFActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.WebPDFActivity"
|
||||||
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:screenOrientation="portrait">
|
android:screenOrientation="portrait">
|
||||||
@@ -211,13 +199,13 @@
|
|||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.drivercircle.HomePageActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.drivercircle.HomePageActivity"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait"/>
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.alert.VehicleChoiceActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.alert.VehicleChoiceActivity"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait"/>
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.OrderComplaintActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.OrderComplaintActivity"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait"/>
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.web.WebActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.web.WebActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
@@ -231,7 +219,7 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".ui.news.NewActivity"
|
android:name=".ui.news.NewActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.service.TrackService"
|
android:name="com.arpa.hndahesudintocctmsdriver.service.TrackService"
|
||||||
@@ -274,7 +262,7 @@
|
|||||||
<meta-data
|
<meta-data
|
||||||
android:name="com.amap.api.v2.apikey"
|
android:name="com.amap.api.v2.apikey"
|
||||||
android:value="${GAODEKEY}" />
|
android:value="${GAODEKEY}" />
|
||||||
<!-- android:value="702eaa84675618b8eb69298d9fd42ca3" />-->
|
<!-- android:value="702eaa84675618b8eb69298d9fd42ca3" />-->
|
||||||
|
|
||||||
<service android:name="com.amap.api.location.APSService"></service>
|
<service android:name="com.amap.api.location.APSService"></service>
|
||||||
|
|
||||||
@@ -285,7 +273,7 @@
|
|||||||
<!-- 极光-->
|
<!-- 极光-->
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="JPUSH_APPKEY"
|
android:name="JPUSH_APPKEY"
|
||||||
android:value="fba6f55621c670d8c1fe9191" /> <!-- </>值来自开发者平台取得的AppKey -->
|
android:value="571d93ae5117da6dee848c92" /> <!-- </>值来自开发者平台取得的AppKey -->
|
||||||
|
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="JPUSH_CHANNEL"
|
android:name="JPUSH_CHANNEL"
|
||||||
@@ -370,11 +358,10 @@
|
|||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".H5Activity"
|
android:name=".H5Activity"
|
||||||
android:launchMode="singleTask"
|
android:screenOrientation="portrait"
|
||||||
android:screenOrientation="portrait">
|
android:launchMode="singleTask">
|
||||||
<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" />
|
||||||
|
|
||||||
|
|||||||
@@ -23,9 +23,6 @@ import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
|||||||
import com.gyf.cactus.Cactus;
|
import com.gyf.cactus.Cactus;
|
||||||
import com.gyf.cactus.callback.CactusBackgroundCallback;
|
import com.gyf.cactus.callback.CactusBackgroundCallback;
|
||||||
import com.gyf.cactus.callback.CactusCallback;
|
import com.gyf.cactus.callback.CactusCallback;
|
||||||
import com.lk.mapsdk.base.mapapi.initializer.InitializerOptions;
|
|
||||||
import com.lk.mapsdk.base.mapapi.initializer.SDKInitializer;
|
|
||||||
import com.lk.mapsdk.base.mapapi.model.CoordType;
|
|
||||||
import com.tencent.bugly.crashreport.CrashReport;
|
import com.tencent.bugly.crashreport.CrashReport;
|
||||||
import com.umeng.commonsdk.UMConfigure;
|
import com.umeng.commonsdk.UMConfigure;
|
||||||
|
|
||||||
@@ -52,18 +49,6 @@ public class App extends Application {
|
|||||||
CommonBaseLibrary.getInstance().init(this, Api.BASE_URL);
|
CommonBaseLibrary.getInstance().init(this, Api.BASE_URL);
|
||||||
CrashReport.initCrashReport(getApplicationContext(), "0fa55ffad8", false);
|
CrashReport.initCrashReport(getApplicationContext(), "0fa55ffad8", false);
|
||||||
String state = SPUtil.getSP(con, "state_data", "authorization_state");
|
String state = SPUtil.getSP(con, "state_data", "authorization_state");
|
||||||
|
|
||||||
InitializerOptions options = new InitializerOptions();
|
|
||||||
// 设置是否使用Https网络请求,默认使用
|
|
||||||
options.setHttpsEnable(true);
|
|
||||||
// 设置坐标系,默认GCJ02
|
|
||||||
options.setCoordType(CoordType.GCJ02);
|
|
||||||
// SDK 初始化
|
|
||||||
SDKInitializer.initialization(getApplicationContext(), options);
|
|
||||||
|
|
||||||
// Log 开关使能
|
|
||||||
SDKInitializer.setLogEnable(true);
|
|
||||||
|
|
||||||
if ("1".equals(state)) {
|
if ("1".equals(state)) {
|
||||||
try {
|
try {
|
||||||
Context context = getApplicationContext();
|
Context context = getApplicationContext();
|
||||||
|
|||||||
@@ -1,157 +0,0 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.bean;
|
|
||||||
|
|
||||||
import android.os.Build;
|
|
||||||
import android.provider.Settings;
|
|
||||||
|
|
||||||
import androidx.activity.result.contract.ActivityResultContracts;
|
|
||||||
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.App;
|
|
||||||
import com.dahe.mylibrary.utils.AppUtils;
|
|
||||||
|
|
||||||
import java.util.Locale;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName AppInfoBean
|
|
||||||
* @Author john
|
|
||||||
* @Date 2024/7/22 15:31
|
|
||||||
* @Description TODO
|
|
||||||
*/
|
|
||||||
public class AppInfoBean {
|
|
||||||
private String userPhone;
|
|
||||||
private String macIpaddr = Settings.Secure.getString(App.getApp().getContentResolver(),Settings.Secure.ANDROID_ID);
|
|
||||||
// private String macIpaddr = android.os.Build.ID;
|
|
||||||
private String clientSource = "driver";
|
|
||||||
private String status = "";
|
|
||||||
private String mobilePhoneManufacturerName = android.os.Build.BRAND;
|
|
||||||
private String mobilePhoneProductName = android.os.Build.MODEL;
|
|
||||||
private String mobilePhoneMotherboardName = android.os.Build.BOARD;
|
|
||||||
private String mobilePhoneHardwareName = android.os.Build.DEVICE;
|
|
||||||
private String mobilePhoneMachineSystemLanguage = Locale.getDefault().getLanguage();
|
|
||||||
private String androidVersion=android.os.Build.VERSION.RELEASE;
|
|
||||||
private String androidSystemSdk = android.os.Build.VERSION.SDK_INT+"";
|
|
||||||
private String appVersionName = AppUtils.getAppVersionName();
|
|
||||||
private String appVersionNumber = AppUtils.getAppVersionCode()+"";
|
|
||||||
|
|
||||||
public String getUserPhone() {
|
|
||||||
return userPhone;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUserPhone(String userPhone) {
|
|
||||||
this.userPhone = userPhone;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMacIpaddr() {
|
|
||||||
return macIpaddr;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMacIpaddr(String macIpaddr) {
|
|
||||||
this.macIpaddr = macIpaddr;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getClientSource() {
|
|
||||||
return clientSource;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setClientSource(String clientSource) {
|
|
||||||
this.clientSource = clientSource;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatus(String status) {
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMobilePhoneManufacturerName() {
|
|
||||||
return mobilePhoneManufacturerName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMobilePhoneManufacturerName(String mobilePhoneManufacturerName) {
|
|
||||||
this.mobilePhoneManufacturerName = mobilePhoneManufacturerName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMobilePhoneProductName() {
|
|
||||||
return mobilePhoneProductName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMobilePhoneProductName(String mobilePhoneProductName) {
|
|
||||||
this.mobilePhoneProductName = mobilePhoneProductName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMobilePhoneMotherboardName() {
|
|
||||||
return mobilePhoneMotherboardName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMobilePhoneMotherboardName(String mobilePhoneMotherboardName) {
|
|
||||||
this.mobilePhoneMotherboardName = mobilePhoneMotherboardName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMobilePhoneHardwareName() {
|
|
||||||
return mobilePhoneHardwareName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMobilePhoneHardwareName(String mobilePhoneHardwareName) {
|
|
||||||
this.mobilePhoneHardwareName = mobilePhoneHardwareName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMobilePhoneMachineSystemLanguage() {
|
|
||||||
return mobilePhoneMachineSystemLanguage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMobilePhoneMachineSystemLanguage(String mobilePhoneMachineSystemLanguage) {
|
|
||||||
this.mobilePhoneMachineSystemLanguage = mobilePhoneMachineSystemLanguage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAndroidVersion() {
|
|
||||||
return androidVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAndroidVersion(String androidVersion) {
|
|
||||||
this.androidVersion = androidVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAndroidSystemSdk() {
|
|
||||||
return androidSystemSdk;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAndroidSystemSdk(String androidSystemSdk) {
|
|
||||||
this.androidSystemSdk = androidSystemSdk;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAppVersionName() {
|
|
||||||
return appVersionName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAppVersionName(String appVersionName) {
|
|
||||||
this.appVersionName = appVersionName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAppVersionNumber() {
|
|
||||||
return appVersionNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAppVersionNumber(String appVersionNumber) {
|
|
||||||
this.appVersionNumber = appVersionNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "AppInfoBean{" +
|
|
||||||
"userPhone='" + userPhone + '\'' +
|
|
||||||
", macIpaddr='" + macIpaddr + '\'' +
|
|
||||||
", clientSource='" + clientSource + '\'' +
|
|
||||||
", status='" + status + '\'' +
|
|
||||||
", mobilePhoneManufacturerName='" + mobilePhoneManufacturerName + '\'' +
|
|
||||||
", mobilePhoneProductName='" + mobilePhoneProductName + '\'' +
|
|
||||||
", mobilePhoneMotherboardName='" + mobilePhoneMotherboardName + '\'' +
|
|
||||||
", mobilePhoneHardwareName='" + mobilePhoneHardwareName + '\'' +
|
|
||||||
", mobilePhoneMachineSystemLanguage='" + mobilePhoneMachineSystemLanguage + '\'' +
|
|
||||||
", androidVersion='" + androidVersion + '\'' +
|
|
||||||
", androidSystemSdk='" + androidSystemSdk + '\'' +
|
|
||||||
", appVersionName='" + appVersionName + '\'' +
|
|
||||||
", appVersionNumber='" + appVersionNumber + '\'' +
|
|
||||||
'}';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -66,11 +66,6 @@ public class CarDelBean {
|
|||||||
private String owner;
|
private String owner;
|
||||||
private String roadLicense;
|
private String roadLicense;
|
||||||
private String roadLicensePhoto;
|
private String roadLicensePhoto;
|
||||||
private String trailerLicenseId;
|
|
||||||
|
|
||||||
private String policyPhotoUrl;
|
|
||||||
private String insuranceCompany;
|
|
||||||
private String insuranceEndDay;
|
|
||||||
private String roadLicenseSend;
|
private String roadLicenseSend;
|
||||||
private String roadLicenseValidity;
|
private String roadLicenseValidity;
|
||||||
private String threeImage;
|
private String threeImage;
|
||||||
@@ -84,14 +79,6 @@ public class CarDelBean {
|
|||||||
private String carPlateColorValue;
|
private String carPlateColorValue;
|
||||||
private String needUpQCPhoto;
|
private String needUpQCPhoto;
|
||||||
|
|
||||||
public String getTrailerLicenseId() {
|
|
||||||
return trailerLicenseId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTrailerLicenseId(String trailerLicenseId) {
|
|
||||||
this.trailerLicenseId = trailerLicenseId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getNeedUpQCPhoto() {
|
public String getNeedUpQCPhoto() {
|
||||||
return needUpQCPhoto;
|
return needUpQCPhoto;
|
||||||
}
|
}
|
||||||
@@ -108,30 +95,6 @@ public class CarDelBean {
|
|||||||
this.carPlateColorValue = carPlateColorValue;
|
this.carPlateColorValue = carPlateColorValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPolicyPhotoUrl() {
|
|
||||||
return policyPhotoUrl == null ? "" : policyPhotoUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPolicyPhotoUrl(String policyPhotoUrl) {
|
|
||||||
this.policyPhotoUrl = policyPhotoUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getInsuranceCompany() {
|
|
||||||
return insuranceCompany == null ? "" : insuranceCompany;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInsuranceCompany(String insuranceCompany) {
|
|
||||||
this.insuranceCompany = insuranceCompany;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getInsuranceEndDay() {
|
|
||||||
return insuranceEndDay == null ? "" : insuranceEndDay;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInsuranceEndDay(String insuranceEndDay) {
|
|
||||||
this.insuranceEndDay = insuranceEndDay;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCarEnergyTypValue() {
|
public String getCarEnergyTypValue() {
|
||||||
return carEnergyTypValue;
|
return carEnergyTypValue;
|
||||||
}
|
}
|
||||||
@@ -308,15 +271,6 @@ public class CarDelBean {
|
|||||||
private String threeImage;
|
private String threeImage;
|
||||||
private String type;
|
private String type;
|
||||||
private String vehicleNumber;
|
private String vehicleNumber;
|
||||||
private String trailerLicenseId;
|
|
||||||
|
|
||||||
public String getTrailerLicenseId() {
|
|
||||||
return trailerLicenseId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTrailerLicenseId(String trailerLicenseId) {
|
|
||||||
this.trailerLicenseId = trailerLicenseId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getBackImage() {
|
public String getBackImage() {
|
||||||
return backImage == null ? "" : backImage;
|
return backImage == null ? "" : backImage;
|
||||||
|
|||||||
@@ -48,33 +48,6 @@ public class DriverExpireBean {
|
|||||||
public static class DataDTO {
|
public static class DataDTO {
|
||||||
private String driverLicenseUpdateUrl;
|
private String driverLicenseUpdateUrl;
|
||||||
private String idCardUpdateUrl;
|
private String idCardUpdateUrl;
|
||||||
private String qualificationUpdateUrl;
|
|
||||||
private String roadLicenseUpdateUrl;
|
|
||||||
private String insuranceUpdateUrl;
|
|
||||||
|
|
||||||
public String getRoadLicenseUpdateUrl() {
|
|
||||||
return roadLicenseUpdateUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRoadLicenseUpdateUrl(String roadLicenseUpdateUrl) {
|
|
||||||
this.roadLicenseUpdateUrl = roadLicenseUpdateUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getInsuranceUpdateUrl() {
|
|
||||||
return insuranceUpdateUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInsuranceUpdateUrl(String insuranceUpdateUrl) {
|
|
||||||
this.insuranceUpdateUrl = insuranceUpdateUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getQualificationUpdateUrl() {
|
|
||||||
return qualificationUpdateUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setQualificationUpdateUrl(String qualificationUpdateUrl) {
|
|
||||||
this.qualificationUpdateUrl = qualificationUpdateUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDriverLicenseUpdateUrl() {
|
public String getDriverLicenseUpdateUrl() {
|
||||||
return driverLicenseUpdateUrl;
|
return driverLicenseUpdateUrl;
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ public class OCRVehicleBackLicenseBean {
|
|||||||
private int id;
|
private int id;
|
||||||
private String url;
|
private String url;
|
||||||
private String checkRecord;
|
private String checkRecord;
|
||||||
private String isSave;
|
|
||||||
private String approvedCapacity;
|
private String approvedCapacity;
|
||||||
private String allCapacity;
|
private String allCapacity;
|
||||||
private String size;
|
private String size;
|
||||||
@@ -72,14 +71,6 @@ public class OCRVehicleBackLicenseBean {
|
|||||||
private String carNumber;
|
private String carNumber;
|
||||||
private int licenseId;
|
private int licenseId;
|
||||||
|
|
||||||
public String getIsSave() {
|
|
||||||
return isSave;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsSave(String isSave) {
|
|
||||||
this.isSave = isSave;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getLicenseId() {
|
public int getLicenseId() {
|
||||||
return licenseId;
|
return licenseId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,9 +49,7 @@ public class OCRVehicleLicenseBean {
|
|||||||
private String address;
|
private String address;
|
||||||
private int carId;
|
private int carId;
|
||||||
private String carNumber;
|
private String carNumber;
|
||||||
private boolean carExist;
|
|
||||||
private String dateIssue;
|
private String dateIssue;
|
||||||
private String backImage;
|
|
||||||
private String engineNumber;
|
private String engineNumber;
|
||||||
private int id;
|
private int id;
|
||||||
private String model;
|
private String model;
|
||||||
@@ -62,41 +60,6 @@ public class OCRVehicleLicenseBean {
|
|||||||
private String type;
|
private String type;
|
||||||
private String url;
|
private String url;
|
||||||
private String vehicleNumber;
|
private String vehicleNumber;
|
||||||
private String licenseId;
|
|
||||||
|
|
||||||
public String getLicenseId() {
|
|
||||||
return licenseId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLicenseId(String licenseId) {
|
|
||||||
this.licenseId = licenseId;
|
|
||||||
}
|
|
||||||
|
|
||||||
private DataDto2 existCarInfo;
|
|
||||||
|
|
||||||
public DataDto2 getExistCarInfo() {
|
|
||||||
return existCarInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setExistCarInfo(DataDto2 existCarInfo) {
|
|
||||||
this.existCarInfo = existCarInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isCarExist() {
|
|
||||||
return carExist;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getBackImage() {
|
|
||||||
return backImage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBackImage(String backImage) {
|
|
||||||
this.backImage = backImage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCarExist(boolean carExist) {
|
|
||||||
this.carExist = carExist;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAddress() {
|
public String getAddress() {
|
||||||
return address == null ? "" : address;
|
return address == null ? "" : address;
|
||||||
@@ -210,44 +173,4 @@ public class OCRVehicleLicenseBean {
|
|||||||
this.vehicleNumber = vehicleNumber;
|
this.vehicleNumber = vehicleNumber;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class DataDto2 {
|
|
||||||
private String backImage;
|
|
||||||
private String carId;
|
|
||||||
private String licenseId;
|
|
||||||
|
|
||||||
private CarDelBean.DataDTO trailerResVo;
|
|
||||||
|
|
||||||
public CarDelBean.DataDTO getTrailerResVo() {
|
|
||||||
return trailerResVo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTrailerResVo(CarDelBean.DataDTO trailerResVo) {
|
|
||||||
this.trailerResVo = trailerResVo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLicenseId() {
|
|
||||||
return licenseId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLicenseId(String licenseId) {
|
|
||||||
this.licenseId = licenseId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getBackImage() {
|
|
||||||
return backImage == null ? "" : backImage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBackImage(String backImage) {
|
|
||||||
this.backImage = backImage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCarId() {
|
|
||||||
return carId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCarId(String carId) {
|
|
||||||
this.carId = carId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.event;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author hlh
|
|
||||||
* @version 1.0.0
|
|
||||||
* @date 2021/11/2 18:51
|
|
||||||
* @description:
|
|
||||||
*/
|
|
||||||
public class RefreshCarListEvent {
|
|
||||||
private String message;
|
|
||||||
|
|
||||||
public RefreshCarListEvent(String message) {
|
|
||||||
this.message = message;
|
|
||||||
}
|
|
||||||
public String getMessage() {
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
public void setMessage(String message) {
|
|
||||||
this.message = message;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -124,17 +124,6 @@ public class AuthRequest {
|
|||||||
RequestUtil.start(1, "saveCarRoadLicenseNo", re, con, hd);
|
RequestUtil.start(1, "saveCarRoadLicenseNo", re, con, hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
//车辆交强保险
|
|
||||||
public void saveTrafficInsurance(Context con, Handler hd, String id, String insuranceEndDay, String insuranceCompany) {
|
|
||||||
String mt = "{\n" +
|
|
||||||
"\t\"carId\": \"" + id + "\",\n" +
|
|
||||||
"\t\"insuranceEndDay\": \"" + insuranceEndDay + "\",\n" +
|
|
||||||
"\t\"insuranceCompany\": \"" + insuranceCompany + "\",\n" +
|
|
||||||
"}";
|
|
||||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getTrafficInsurance(), mt), getToken(con), con);
|
|
||||||
RequestUtil.start(1, "saveTrafficInsurance", re, con, hd);
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取资格证认证信息
|
//获取资格证认证信息
|
||||||
public void isDriverAuthQualification(Context con, Handler hd) {
|
public void isDriverAuthQualification(Context con, Handler hd) {
|
||||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getIsAuthDriverAuthQualification(), ""), getToken(con), con);
|
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getIsAuthDriverAuthQualification(), ""), getToken(con), con);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.request;
|
package com.arpa.hndahesudintocctmsdriver.request;
|
||||||
|
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean;
|
import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.TrackInputBean;
|
import com.arpa.hndahesudintocctmsdriver.request.bean.TrackInputBean;
|
||||||
@@ -8,7 +9,6 @@ import com.arpa.hndahesudintocctmsdriver.ui.home.HuoYuanFragmengt;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.ui.home.HuoYunDelActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.home.HuoYunDelActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.home.StartYunDanActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.home.StartYunDanActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.OrderComplaintActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.OrderComplaintActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.map.MapUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.map.MapUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||||
|
|||||||
@@ -49,8 +49,8 @@ public class OCRRequest {
|
|||||||
RequestUtil.start(12, CertificatesActivity.TYPE_NAME[2],re,con,hd);
|
RequestUtil.start(12, CertificatesActivity.TYPE_NAME[2],re,con,hd);
|
||||||
}
|
}
|
||||||
//行驶证背面识别
|
//行驶证背面识别
|
||||||
public void OCRVehicleLicenseBack(Context con, Handler hd, File file,String carId,String carNum,boolean isSave){
|
public void OCRVehicleLicenseBack(Context con, Handler hd, File file,String carId,String carNum){
|
||||||
Request re = OkHttpUtil.postFiles(new OkDate(RequestConstant.getVehicleLicenseBack()),file,getToken(con),carId,carNum,isSave);
|
Request re = OkHttpUtil.postFiles(new OkDate(RequestConstant.getVehicleLicenseBack()),file,getToken(con),carId,carNum);
|
||||||
RequestUtil.start(12, CertificatesActivity.TYPE_NAME_BANK[2],re,con,hd);
|
RequestUtil.start(12, CertificatesActivity.TYPE_NAME_BANK[2],re,con,hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ public class RequestConstant {
|
|||||||
//车辆详情
|
//车辆详情
|
||||||
private static final String GET_CAR_DEL = "/app/carDriver/getCarInfo";
|
private static final String GET_CAR_DEL = "/app/carDriver/getCarInfo";
|
||||||
//删除车辆
|
//删除车辆
|
||||||
private static final String DEL_CAR = "/app/carDriver/unBindCar";
|
private static final String DEL_CAR = "/app/carDriver/removeCar";
|
||||||
//上传车辆照片
|
//上传车辆照片
|
||||||
private static final String SAVECARIMG = "/app/carDriver/saveCarImg";
|
private static final String SAVECARIMG = "/app/carDriver/saveCarImg";
|
||||||
//上传头像保存
|
//上传头像保存
|
||||||
@@ -130,9 +130,6 @@ public class RequestConstant {
|
|||||||
private static final String DRIVER_AUTH_SAVECARREGISTERNO = "/app/carDriver/saveCarRegisterNo";
|
private static final String DRIVER_AUTH_SAVECARREGISTERNO = "/app/carDriver/saveCarRegisterNo";
|
||||||
//道路运输信息
|
//道路运输信息
|
||||||
private static final String DRIVER_AUTH_SAVECARROADLICENSENO = "/app/carDriver/saveCarRoadLicenseNo";
|
private static final String DRIVER_AUTH_SAVECARROADLICENSENO = "/app/carDriver/saveCarRoadLicenseNo";
|
||||||
|
|
||||||
//交强险
|
|
||||||
private static final String DRIVER_TRAFFIC_INSU = "/app/carDriver/saveCarInsurace";
|
|
||||||
//党员认证
|
//党员认证
|
||||||
private static final String PARTY_MEMBER = "/app/user/partyMember";
|
private static final String PARTY_MEMBER = "/app/user/partyMember";
|
||||||
//实名认证
|
//实名认证
|
||||||
@@ -162,16 +159,11 @@ public class RequestConstant {
|
|||||||
|
|
||||||
//车辆自动审核触发器
|
//车辆自动审核触发器
|
||||||
private static final String CAR_AUDIT = "/app/carDriver/carAutomaticAudit";
|
private static final String CAR_AUDIT = "/app/carDriver/carAutomaticAudit";
|
||||||
private static final String APP_INFO = "/common/app/logininfor";
|
|
||||||
|
|
||||||
public static String getCarAudit() {
|
public static String getCarAudit() {
|
||||||
return BASE_URL + CAR_AUDIT;
|
return BASE_URL + CAR_AUDIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String postAppInfo() {
|
|
||||||
return BASE_URL + APP_INFO;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getCarColor() {
|
public static String getCarColor() {
|
||||||
return BASE_URL + CAR_COLOR;
|
return BASE_URL + CAR_COLOR;
|
||||||
}
|
}
|
||||||
@@ -383,10 +375,6 @@ public class RequestConstant {
|
|||||||
return BASE_URL + DRIVER_AUTH_SAVECARROADLICENSENO;
|
return BASE_URL + DRIVER_AUTH_SAVECARROADLICENSENO;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getTrafficInsurance() {
|
|
||||||
return BASE_URL + DRIVER_TRAFFIC_INSU;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getSaveDrawCar() {
|
public static String getSaveDrawCar() {
|
||||||
return BASE_URL + SAVE_DRAW_CAR;
|
return BASE_URL + SAVE_DRAW_CAR;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import android.provider.Settings;
|
|||||||
|
|
||||||
import androidx.annotation.RequiresApi;
|
import androidx.annotation.RequiresApi;
|
||||||
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.AppInfoBean;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.VehicleEvent;
|
import com.arpa.hndahesudintocctmsdriver.event.VehicleEvent;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.business.Md5Util;
|
import com.arpa.hndahesudintocctmsdriver.ui.business.Md5Util;
|
||||||
@@ -119,14 +118,6 @@ public class UserRequset {
|
|||||||
RequestUtil.start(1, WoDeFragment.VEHICLE_DEL, re, con, hd);
|
RequestUtil.start(1, WoDeFragment.VEHICLE_DEL, re, con, hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
//车辆详情
|
|
||||||
public void vehicleDelTwo(String id) {
|
|
||||||
Map<String, Object> map = new HashMap<>();
|
|
||||||
map.put("carId", id);
|
|
||||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getGetCarDel(), MapUtil.mapJson(map)), getToken(con), con);
|
|
||||||
RequestUtil.start(1, "onlyGetDetail", re, con, hd);
|
|
||||||
}
|
|
||||||
|
|
||||||
//司机身份证认证
|
//司机身份证认证
|
||||||
public void driverIDAuth() {
|
public void driverIDAuth() {
|
||||||
String url = RequestConstant.BASE_URL + "/app/driver/auth/authInfo";
|
String url = RequestConstant.BASE_URL + "/app/driver/auth/authInfo";
|
||||||
@@ -146,24 +137,24 @@ public class UserRequset {
|
|||||||
|
|
||||||
//app更新
|
//app更新
|
||||||
public void upApp() {
|
public void upApp() {
|
||||||
String vs = "1.0.0";
|
// String vs = "1.0.0";
|
||||||
try {
|
// try {
|
||||||
// isOpenAppNoRe();
|
//// isOpenAppNoRe();
|
||||||
vs = con.getPackageManager().getPackageInfo(con.getPackageName(), 0).versionName;
|
// vs = con.getPackageManager().getPackageInfo(con.getPackageName(), 0).versionName;
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
// } catch (PackageManager.NameNotFoundException e) {
|
||||||
e.printStackTrace();
|
// e.printStackTrace();
|
||||||
}
|
// }
|
||||||
Map<String, Object> map = new HashMap<>();
|
// Map<String, Object> map = new HashMap<>();
|
||||||
map.put("source", 0);
|
// map.put("source", 0);
|
||||||
map.put("version", vs);
|
// map.put("version", vs);
|
||||||
Request re = OkHttpUtil.post(new OkDate(RequestConstant.getVERSION(), MapUtil.mapJson(map)), con);
|
// Request re = OkHttpUtil.post(new OkDate(RequestConstant.getVERSION(), MapUtil.mapJson(map)), con);
|
||||||
RequestUtil.start(1, "up_app", re, con, hd);
|
// RequestUtil.start(1, "up_app", re, con, hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断是否开启未知应用安装权限
|
* 判断是否开启未知应用安装权限
|
||||||
*/
|
*/
|
||||||
private void isOpenAppNoRe() {
|
private void isOpenAppNoRe(){
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
boolean b = con.getPackageManager().canRequestPackageInstalls();
|
boolean b = con.getPackageManager().canRequestPackageInstalls();
|
||||||
if (!b) {
|
if (!b) {
|
||||||
@@ -178,8 +169,8 @@ public class UserRequset {
|
|||||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||||
private void startInstallPermissionSettingActivity() {
|
private void startInstallPermissionSettingActivity() {
|
||||||
//注意这个是8.0新API
|
//注意这个是8.0新API
|
||||||
Uri packageURI = Uri.parse("package:" + con.getPackageName());
|
Uri packageURI = Uri.parse("package:" +con.getPackageName());
|
||||||
Intent intent = new Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES, packageURI);
|
Intent intent = new Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES,packageURI);
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
con.startActivity(intent);
|
con.startActivity(intent);
|
||||||
}
|
}
|
||||||
@@ -230,18 +221,7 @@ public class UserRequset {
|
|||||||
public void carAudit(String carId) {
|
public void carAudit(String carId) {
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
map.put("carId", carId);
|
map.put("carId", carId);
|
||||||
Request re = OkHttpUtil.get(new OkDate(RequestConstant.getCarAudit(), "get", Md5Util.resNoUrl(map)), getToken(con));
|
Request re = OkHttpUtil.get(new OkDate(RequestConstant.getCarAudit(),"get", Md5Util.resNoUrl(map)),getToken(con));
|
||||||
RequestUtil.start(1, VehicleAuthActivity.CAR_AUDIO, re, con, hd);
|
RequestUtil.start(1, VehicleAuthActivity.CAR_AUDIO, re, con, hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void postAppInfo(AppInfoBean appInfoBean, String type) {
|
|
||||||
// Request re = OkHttpUtil.get(new OkDate(RequestConstant.getCarAudit(),"get", gson.toJson(appInfoBean)),getToken(con));
|
|
||||||
Request re;
|
|
||||||
if ("put".equals(type)) {
|
|
||||||
re = OkHttpUtil.put(new OkDate(RequestConstant.postAppInfo(), type, gson.toJson(appInfoBean)), con);
|
|
||||||
} else {
|
|
||||||
re = OkHttpUtil.post(new OkDate(RequestConstant.postAppInfo(), type, gson.toJson(appInfoBean)), con);
|
|
||||||
}
|
|
||||||
RequestUtil.start(1, VehicleAuthActivity.APP_INFO, re, con, hd);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import android.util.Log;
|
|||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.R;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||||
@@ -28,14 +27,11 @@ public class MakeUpService extends Service {
|
|||||||
public void palyMp3(){
|
public void palyMp3(){
|
||||||
Log.e("开始播放","-----");
|
Log.e("开始播放","-----");
|
||||||
try {
|
try {
|
||||||
MediaPlayer mediaPlayer = MediaPlayer.create(this, R.raw.kujp9scu);
|
AssetFileDescriptor fd =getAssets().openFd("kujp9scu.mp3");
|
||||||
mediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
|
mediaPlayer.setDataSource(fd);
|
||||||
@Override
|
mediaPlayer.setLooping(false);//设置为循环播放
|
||||||
public void onPrepared(MediaPlayer mediaPlayer) {
|
mediaPlayer.prepare();//初始化播放器MediaPlayer
|
||||||
mediaPlayer.start();
|
mediaPlayer.start();
|
||||||
}
|
|
||||||
});
|
|
||||||
mediaPlayer.prepareAsync();
|
|
||||||
Log.e("播放成功","-----");
|
Log.e("播放成功","-----");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
@@ -18,13 +18,10 @@ import android.widget.Toast;
|
|||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||||
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.esign.esignsdk.EsignSdk;
|
import com.esign.esignsdk.EsignSdk;
|
||||||
import com.esign.esignsdk.data.AuthEvent;
|
|
||||||
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;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
@@ -48,8 +45,6 @@ import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -106,7 +101,6 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
|||||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("driverAuthQualification"), BaseBean.class);
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("driverAuthQualification"), BaseBean.class);
|
||||||
if (bb.getCode() == 200) {
|
if (bb.getCode() == 200) {
|
||||||
// initAuth();
|
// initAuth();
|
||||||
isAuth = true;
|
|
||||||
//判断是否从车辆进来 carId为空从个人认证进来需跳转实名认证,不为空车辆信息进入,需跳转车辆照片
|
//判断是否从车辆进来 carId为空从个人认证进来需跳转实名认证,不为空车辆信息进入,需跳转车辆照片
|
||||||
if (TextUtils.isEmpty(carId)) {
|
if (TextUtils.isEmpty(carId)) {
|
||||||
//从业资格证->实名认证
|
//从业资格证->实名认证
|
||||||
@@ -161,7 +155,6 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
|||||||
// finish();
|
// finish();
|
||||||
EsignSdk.getInstance().startH5Activity(act, StringUtil.isNull(String.valueOf(bb.getData()), ""));
|
EsignSdk.getInstance().startH5Activity(act, StringUtil.isNull(String.valueOf(bb.getData()), ""));
|
||||||
} else {
|
} else {
|
||||||
finish();
|
|
||||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_LONG).show();
|
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_LONG).show();
|
||||||
}//Log.e("url",CacheGroup.cacheList.get("authUrl"));
|
}//Log.e("url",CacheGroup.cacheList.get("authUrl"));
|
||||||
CacheGroup.cacheList.remove("authUrl");
|
CacheGroup.cacheList.remove("authUrl");
|
||||||
@@ -250,14 +243,12 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
value2.setOnClickListener(v -> {
|
value2.setOnClickListener(v -> {
|
||||||
if (!isAuth) {
|
DatePicker picker = new DatePicker(this);
|
||||||
DatePicker picker = new DatePicker(this);
|
picker.setBodyWidth(300);
|
||||||
picker.setBodyWidth(300);
|
picker.setOnDatePickedListener((year, month, day) -> value2.setText(year + "-" + month + "-" + day));
|
||||||
picker.setOnDatePickedListener((year, month, day) -> value2.setText(year + "-" + month + "-" + day));
|
picker.getWheelLayout().setDateMode(DateMode.YEAR_MONTH_DAY);
|
||||||
picker.getWheelLayout().setDateMode(DateMode.YEAR_MONTH_DAY);
|
picker.getWheelLayout().setDateLabel("年", "月", "日");
|
||||||
picker.getWheelLayout().setDateLabel("年", "月", "日");
|
picker.show();
|
||||||
picker.show();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
submit.setOnClickListener(v -> {
|
submit.setOnClickListener(v -> {
|
||||||
if (!isAuth) {
|
if (!isAuth) {
|
||||||
@@ -388,31 +379,4 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void processResult(AuthEvent auth) {
|
|
||||||
//添加实名/意愿/签署完成之后的逻辑
|
|
||||||
Log.e("-回调信息-", auth.result);
|
|
||||||
JSONObject jsonObject = JSON.parseObject(auth.result);
|
|
||||||
if ("success".equalsIgnoreCase(jsonObject.getString("res"))) {
|
|
||||||
if ("sign".equalsIgnoreCase(jsonObject.getString("key"))) {
|
|
||||||
Toast.makeText(con, "签署场景成功", Toast.LENGTH_SHORT).show();
|
|
||||||
} else if ("realName".equalsIgnoreCase(jsonObject.getString("key"))) {
|
|
||||||
Toast.makeText(con, "实名认证成功", Toast.LENGTH_SHORT).show();
|
|
||||||
} else {
|
|
||||||
Toast.makeText(con, "意愿认证成功", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
finish();
|
|
||||||
} else {
|
|
||||||
if ("sign".equalsIgnoreCase(jsonObject.getString("key"))) {
|
|
||||||
Toast.makeText(con, "签署场景失败", Toast.LENGTH_SHORT).show();
|
|
||||||
} else if ("realName".equalsIgnoreCase(jsonObject.getString("key"))) {
|
|
||||||
Toast.makeText(con, "实名认证失败", Toast.LENGTH_SHORT).show();
|
|
||||||
} else {
|
|
||||||
Toast.makeText(con, "意愿认证失败", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
EsignSdk.getInstance().finishH5Activity();
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ 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;
|
||||||
import com.dahe.mylibrary.utils.ActivityUtils;
|
import com.dahe.mylibrary.utils.ActivityUtils;
|
||||||
import com.dahe.mylibrary.utils.ToastUtils;
|
|
||||||
import com.esign.esignsdk.EsignSdk;
|
import com.esign.esignsdk.EsignSdk;
|
||||||
import com.esign.esignsdk.data.AuthEvent;
|
import com.esign.esignsdk.data.AuthEvent;
|
||||||
import com.github.gzuliyujiang.wheelpicker.contract.OnOptionPickedListener;
|
import com.github.gzuliyujiang.wheelpicker.contract.OnOptionPickedListener;
|
||||||
@@ -158,9 +157,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
|| CacheGroup.cacheList.get("saveVehicleLicense") != null || CacheGroup.cacheList.get("authUrl") != null
|
|| CacheGroup.cacheList.get("saveVehicleLicense") != null || CacheGroup.cacheList.get("authUrl") != null
|
||||||
|| CacheGroup.cacheList.get("saveDrawCar") != null) {
|
|| CacheGroup.cacheList.get("saveDrawCar") != null) {
|
||||||
if (CacheGroup.cacheList.get("driverAuthIdCard") != null) {
|
if (CacheGroup.cacheList.get("driverAuthIdCard") != null) {
|
||||||
if (customDialog != null) {
|
|
||||||
customDialog.dismiss();
|
|
||||||
}
|
|
||||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("driverAuthIdCard"), BaseBean.class);
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("driverAuthIdCard"), BaseBean.class);
|
||||||
if (bb.getCode() == 200) {
|
if (bb.getCode() == 200) {
|
||||||
Toast.makeText(con, "保存成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "保存成功", Toast.LENGTH_SHORT).show();
|
||||||
@@ -178,9 +174,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (CacheGroup.cacheList.get("driverAuthLicense") != null) {
|
if (CacheGroup.cacheList.get("driverAuthLicense") != null) {
|
||||||
if (customDialog != null) {
|
|
||||||
customDialog.dismiss();
|
|
||||||
}
|
|
||||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("driverAuthLicense"), BaseBean.class);
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("driverAuthLicense"), BaseBean.class);
|
||||||
if (bb.getCode() == 200) {
|
if (bb.getCode() == 200) {
|
||||||
Toast.makeText(con, "保存成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "保存成功", Toast.LENGTH_SHORT).show();
|
||||||
@@ -213,9 +206,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (CacheGroup.cacheList.get("saveVehicleLicense") != null) {
|
if (CacheGroup.cacheList.get("saveVehicleLicense") != null) {
|
||||||
if (customDialog != null) {
|
|
||||||
customDialog.dismiss();
|
|
||||||
}
|
|
||||||
CarZhengBean czb = gson.fromJson(CacheGroup.cacheList.get("saveVehicleLicense"), CarZhengBean.class);
|
CarZhengBean czb = gson.fromJson(CacheGroup.cacheList.get("saveVehicleLicense"), CarZhengBean.class);
|
||||||
if (czb.getCode() == 200) {
|
if (czb.getCode() == 200) {
|
||||||
String needUpQCPhoto = czb.getData().getNeedUpQCPhoto();//是否需要上传从业资格证
|
String needUpQCPhoto = czb.getData().getNeedUpQCPhoto();//是否需要上传从业资格证
|
||||||
@@ -224,19 +214,13 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
Toast.makeText(con, "车辆行驶证保存成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "车辆行驶证保存成功", Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
VehicleEvent ve = new VehicleEvent(String.valueOf(czb.getData().getCarId()));
|
VehicleEvent ve = new VehicleEvent(String.valueOf(czb.getData().getCarId()));
|
||||||
EventBus.getDefault().postSticky(ve);
|
EventBus.getDefault().post(ve);
|
||||||
|
|
||||||
// TODO: 2023/8/23
|
// TODO: 2023/8/23
|
||||||
if ("1".equals(isTrailer)) {//判断是否跳转挂车行驶证
|
if ("1".equals(isTrailer)) {//判断是否跳转挂车行驶证
|
||||||
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", String.valueOf(czb.getData().getCarId()));
|
in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
||||||
if (olb != null && olb.getData() != null && olb.getData().isCarExist()) {
|
|
||||||
CarDelBean carDelBean = new CarDelBean();
|
|
||||||
carDelBean.setRes(1);//保留字段 1:为绑定车辆,可以进行修改挂车信息
|
|
||||||
carDelBean.setData(gson.fromJson(gson.toJson(olb.getData().getExistCarInfo()), CarDelBean.DataDTO.class));
|
|
||||||
in.putExtra("cheData", gson.toJson(carDelBean));
|
|
||||||
}
|
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
} else if ("1".equals(needUpQCPhoto)) {//判断是否跳转从业资格证
|
} else if ("1".equals(needUpQCPhoto)) {//判断是否跳转从业资格证
|
||||||
Intent in = new Intent(con, AuthQualificationActivity.class);
|
Intent in = new Intent(con, AuthQualificationActivity.class);
|
||||||
@@ -247,7 +231,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
} else if ("1".equals(needUpRLPhoto)) {//判断是否跳转道路运输许可证
|
} else if ("1".equals(needUpRLPhoto)) {//判断是否跳转道路运输许可证
|
||||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
Intent in = new Intent(con, PhotoCarActivity.class);
|
||||||
in.putExtra("type", 3);
|
in.putExtra("type", 3);
|
||||||
in.putExtra("carExist", true);
|
|
||||||
in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
} else {
|
} else {
|
||||||
@@ -280,9 +263,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
CacheGroup.cacheList.remove("saveVehicleLicense");
|
CacheGroup.cacheList.remove("saveVehicleLicense");
|
||||||
}
|
}
|
||||||
if (CacheGroup.cacheList.get("saveDrawCar") != null) {
|
if (CacheGroup.cacheList.get("saveDrawCar") != null) {
|
||||||
if (customDialog != null) {
|
|
||||||
customDialog.dismiss();
|
|
||||||
}
|
|
||||||
Log.e("-saveDrawCar-", CacheGroup.cacheList.get("saveDrawCar"));
|
Log.e("-saveDrawCar-", CacheGroup.cacheList.get("saveDrawCar"));
|
||||||
CarZhengBean bb = gson.fromJson(CacheGroup.cacheList.get("saveDrawCar"), CarZhengBean.class);
|
CarZhengBean bb = gson.fromJson(CacheGroup.cacheList.get("saveDrawCar"), CarZhengBean.class);
|
||||||
if (bb.getCode() == 200) {
|
if (bb.getCode() == 200) {
|
||||||
@@ -303,7 +283,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
} else if ("1".equals(needUpRLPhoto)) {//现判断是否跳转道路运输许可证
|
} else if ("1".equals(needUpRLPhoto)) {//现判断是否跳转道路运输许可证
|
||||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
Intent in = new Intent(con, PhotoCarActivity.class);
|
||||||
in.putExtra("type", 3);
|
in.putExtra("type", 3);
|
||||||
in.putExtra("carExist", true);
|
|
||||||
in.putExtra("carId", carId);
|
in.putExtra("carId", carId);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
} else {
|
} else {
|
||||||
@@ -357,11 +336,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
}//Log.e("url",CacheGroup.cacheList.get("authUrl"));
|
}//Log.e("url",CacheGroup.cacheList.get("authUrl"));
|
||||||
CacheGroup.cacheList.remove("authUrl");
|
CacheGroup.cacheList.remove("authUrl");
|
||||||
} else {
|
} else {
|
||||||
//重复代码?
|
|
||||||
initView(null);
|
initView(null);
|
||||||
if (!(CacheGroup.cacheList.get(TYPE_NAME_BANK[2]) != null || CacheGroup.cacheList.get(TYPE_NAME_BANK[3]) != null)) {
|
initData();
|
||||||
initData();
|
|
||||||
}
|
|
||||||
pathOrcRes();
|
pathOrcRes();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -439,7 +415,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
// there_div.setVisibility(View.VISIBLE);
|
// there_div.setVisibility(View.VISIBLE);
|
||||||
if (c_str != null && !c_str.equals("")) {
|
if (c_str != null && !c_str.equals("")) {
|
||||||
cdb = gson.fromJson(c_str, CarDelBean.class);
|
cdb = gson.fromJson(c_str, CarDelBean.class);
|
||||||
oCrcarId = cdb.getData().getTrailerResVo().getTrailerLicenseId() + "";
|
|
||||||
initView(null);
|
initView(null);
|
||||||
initData();
|
initData();
|
||||||
} else {
|
} else {
|
||||||
@@ -696,16 +671,14 @@ 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(), "空数据"));
|
||||||
|
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||||
Glide.with(con).load(url1).into(img1);
|
Glide.with(con).load(url1).into(img1);
|
||||||
Glide.with(con).load(url2).into(img2);
|
Glide.with(con).load(url2).into(img2);
|
||||||
Glide.with(con).load(url3).into(img3);
|
Glide.with(con).load(url3).into(img3);
|
||||||
if (cdb.getRes() != 1) {
|
u_img.setText("已上传");
|
||||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
u_img2.setText("已上传");
|
||||||
u_img.setText("已上传");
|
u_img3.setText("点击查看");
|
||||||
u_img2.setText("已上传");
|
isAuth = true;
|
||||||
u_img3.setText("点击查看");
|
|
||||||
isAuth = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -765,8 +738,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
value1.setText(ocb.getData().getName());
|
value1.setText(ocb.getData().getName());
|
||||||
value2.setText(ocb.getData().getCardId());
|
value2.setText(ocb.getData().getCardId());
|
||||||
value3.setText(ocb.getData().getAddress());
|
value3.setText(ocb.getData().getAddress());
|
||||||
// Glide.with(con).load(url1).into(img1);
|
Glide.with(con).load(url1).into(img1);
|
||||||
Glide.with(con).load(path).into(img1);
|
|
||||||
fontId = ocb.getData().getId();
|
fontId = ocb.getData().getId();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
||||||
@@ -778,8 +750,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
if (ocbb.getCode() == 200) {
|
if (ocbb.getCode() == 200) {
|
||||||
url2 = ocbb.getData().getUrl();
|
url2 = ocbb.getData().getUrl();
|
||||||
value4.setText(ocbb.getData().getEndTime());
|
value4.setText(ocbb.getData().getEndTime());
|
||||||
// Glide.with(con).load(url2).into(img2);
|
Glide.with(con).load(url2).into(img2);
|
||||||
Glide.with(con).load(path).into(img2);
|
|
||||||
startTime = ocbb.getData().getStartTime();
|
startTime = ocbb.getData().getStartTime();
|
||||||
backId = ocbb.getData().getId();
|
backId = ocbb.getData().getId();
|
||||||
|
|
||||||
@@ -803,8 +774,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
value2.setText(StringUtil.isNull(od.getStartTime(), "识别异常"));
|
value2.setText(StringUtil.isNull(od.getStartTime(), "识别异常"));
|
||||||
value3.setText(StringUtil.isNull(od.getAllowType(), "识别异常"));
|
value3.setText(StringUtil.isNull(od.getAllowType(), "识别异常"));
|
||||||
value4.setText(StringUtil.isNull(od.getEndTime(), "识别异常"));
|
value4.setText(StringUtil.isNull(od.getEndTime(), "识别异常"));
|
||||||
// Glide.with(con).load(url1).into(img1);
|
Glide.with(con).load(url1).into(img1);
|
||||||
Glide.with(con).load(path).into(img1);
|
|
||||||
fontId = od.getId();
|
fontId = od.getId();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
||||||
@@ -816,8 +786,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
if (odlb.getCode() == 200) {
|
if (odlb.getCode() == 200) {
|
||||||
url2 = odlb.getData().getUrl();
|
url2 = odlb.getData().getUrl();
|
||||||
backId = odlb.getData().getId();
|
backId = odlb.getData().getId();
|
||||||
// Glide.with(con).load(url2).into(img2);
|
Glide.with(con).load(url2).into(img2);
|
||||||
Glide.with(con).load(path).into(img2);
|
|
||||||
//自动调取提交功能,实现页面自动跳转
|
//自动调取提交功能,实现页面自动跳转
|
||||||
subimt();
|
subimt();
|
||||||
} else {
|
} else {
|
||||||
@@ -833,22 +802,13 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
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);
|
||||||
if (olb.getCode() == 200) {
|
if (olb.getCode() == 200) {
|
||||||
if (olb.getData().isCarExist()) {
|
|
||||||
value1.setEnabled(false);
|
|
||||||
Glide.with(con).load(olb.getData().getExistCarInfo().getBackImage()).into(img2);
|
|
||||||
url2 = olb.getData().getExistCarInfo().getBackImage();
|
|
||||||
ToastUtils.showLongToast(con, "该车辆已存在,请仔细核对相关信息");
|
|
||||||
} else {
|
|
||||||
value1.setEnabled(true);
|
|
||||||
}
|
|
||||||
url1 = olb.getData().getUrl();
|
url1 = olb.getData().getUrl();
|
||||||
value1.setText(olb.getData().getCarNumber());
|
value1.setText(olb.getData().getCarNumber());
|
||||||
value2.setText(olb.getData().getType());
|
value2.setText(olb.getData().getType());
|
||||||
value3.setText(olb.getData().getOwner());
|
value3.setText(olb.getData().getOwner());
|
||||||
value4.setText(olb.getData().getVehicleNumber());
|
value4.setText(olb.getData().getVehicleNumber());
|
||||||
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);
|
|
||||||
oCrcarId = olb.getData().getCarId() + "";
|
oCrcarId = olb.getData().getCarId() + "";
|
||||||
Log.e("-cardId-", oCrcarId);
|
Log.e("-cardId-", oCrcarId);
|
||||||
} else {
|
} else {
|
||||||
@@ -861,9 +821,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
if (oblb.getCode() == 200) {
|
if (oblb.getCode() == 200) {
|
||||||
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);
|
//自动调取提交功能,实现页面自动跳转
|
||||||
//自动调取提交功能,实现页面自动跳转实现页面自动跳转
|
|
||||||
subimt();
|
subimt();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, oblb.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, oblb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
@@ -875,8 +834,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
if (ub.getCode() == 200) {
|
if (ub.getCode() == 200) {
|
||||||
url3 = ub.getData().getUrl();
|
url3 = ub.getData().getUrl();
|
||||||
fid = ub.getData().getId();
|
fid = ub.getData().getId();
|
||||||
// Glide.with(con).load(url3).into(img3);
|
Glide.with(con).load(url3).into(img3);
|
||||||
Glide.with(con).load(path).into(img3);
|
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
@@ -920,7 +878,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
new OCRRequest().OCRVehicleLicenseBack(con, hd, new File(path), oCrcarId, carNum, olb.getData().isCarExist());
|
new OCRRequest().OCRVehicleLicenseBack(con, hd, new File(path), oCrcarId, carNum);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
new AuthRequest().upload(con, hd, new File(path));
|
new AuthRequest().upload(con, hd, new File(path));
|
||||||
@@ -936,16 +894,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// if (cdb != null && cdb.getData().getTrailerResVo() &&cdb.getRes() == 1)
|
new OCRRequest().OCRVehicleLicenseBack(con, hd, new File(path), oCrcarId, carNum);
|
||||||
boolean isExist = false;
|
|
||||||
if (olb != null) {//主页识别成功后获取
|
|
||||||
isExist = olb.getData().isCarExist();
|
|
||||||
} else {
|
|
||||||
if (cdb != null && cdb.getData().getTrailerResVo() != null && cdb.getRes() == 1) {//上个页面带来数据
|
|
||||||
isExist = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
new OCRRequest().OCRVehicleLicenseBack(con, hd, new File(path), oCrcarId, carNum, isExist);
|
|
||||||
} else {
|
} else {
|
||||||
new AuthRequest().upload(con, hd, new File(path));
|
new AuthRequest().upload(con, hd, new File(path));
|
||||||
}
|
}
|
||||||
@@ -968,8 +917,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
switch (index) {
|
switch (index) {
|
||||||
case 0:
|
case 0:
|
||||||
if (ocb != null && ocbb != null) {
|
if (ocb != null && ocbb != null) {
|
||||||
customDialog = new CustomDialog(con, "网络请求中...");
|
|
||||||
customDialog.show();
|
|
||||||
IDInputBean ib = new IDInputBean();
|
IDInputBean ib = new IDInputBean();
|
||||||
ib.setIdcarName(str1);
|
ib.setIdcarName(str1);
|
||||||
ib.setIdcard(str2);
|
ib.setIdcard(str2);
|
||||||
@@ -992,8 +939,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
//olb
|
//olb
|
||||||
//{"档案编号","初次领证日期","准驾车型","有效期限(止)"},
|
//{"档案编号","初次领证日期","准驾车型","有效期限(止)"},
|
||||||
if (odl != null && odlb != null) {
|
if (odl != null && odlb != null) {
|
||||||
customDialog = new CustomDialog(con, "网络请求中...");
|
|
||||||
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(str1);
|
iib.setArchivesName(str1);
|
||||||
@@ -1010,25 +955,20 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if ((olb != null && !olb.getData().isCarExist() && oblb != null) || (olb != null && olb.getData().isCarExist())) {
|
if (olb != null && oblb != null) {
|
||||||
// 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;
|
||||||
// }
|
// }
|
||||||
customDialog = new CustomDialog(con, "网络请求中...");
|
|
||||||
customDialog.show();
|
|
||||||
HashMap<String, Object> map = new HashMap<>();
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
if ("".equals(url3)) {
|
if ("".equals(url3)) {
|
||||||
map.put("imgId", fid);
|
map.put("imgId", fid);
|
||||||
}
|
}
|
||||||
map.put("licenseId", olb.getData().isCarExist() ? olb.getData().getExistCarInfo().getLicenseId() : oblb.getData().getLicenseId());
|
map.put("licenseId", oblb.getData().getLicenseId());
|
||||||
map.put("carNumber", str1);
|
map.put("carNumber", str1);
|
||||||
map.put("type", str2);
|
map.put("type", str2);
|
||||||
map.put("owner", str3);
|
map.put("owner", str3);
|
||||||
map.put("vehicleNumber", str4);
|
map.put("vehicleNumber", str4);
|
||||||
// if (olb.getData().isCarExist()) {
|
|
||||||
// map.put("carId", olb.getData().getCarId());
|
|
||||||
// }
|
|
||||||
// map.put("carPlateColor", curColor.getValue());
|
// map.put("carPlateColor", curColor.getValue());
|
||||||
// map.put("carEnergyTyp", curEnergy.getValue());
|
// map.put("carEnergyTyp", curEnergy.getValue());
|
||||||
new AuthRequest().saveVehicleLicense(con, hd, MapUtil.mapJson(map));
|
new AuthRequest().saveVehicleLicense(con, hd, MapUtil.mapJson(map));
|
||||||
@@ -1037,27 +977,22 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if (olb != null || (cdb != null && cdb.getRes() == 1)) {
|
if (olb != null && oblb != null) {
|
||||||
// if (curEnergy==null){
|
// if (curEnergy==null){
|
||||||
// Toast.makeText(con,"请完善内容",Toast.LENGTH_SHORT).show();
|
// Toast.makeText(con,"请完善内容",Toast.LENGTH_SHORT).show();
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
customDialog = new CustomDialog(con, "网络请求中...");
|
|
||||||
customDialog.show();
|
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
if ("".equals(url3)) {
|
if ("".equals(url3)) {
|
||||||
map.put("imgId", fid);
|
map.put("imgId", fid);
|
||||||
}
|
}
|
||||||
// map.put("licenseId", oblb.getData().getLicenseId());
|
map.put("licenseId", oblb.getData().getLicenseId());
|
||||||
map.put("carId", carId);
|
map.put("carId", carId);
|
||||||
map.put("carNumberDraw", str1);
|
map.put("carNumberDraw", str1);
|
||||||
map.put("type", str2);
|
map.put("type", str2);
|
||||||
map.put("owner", str3);
|
map.put("owner", str3);
|
||||||
// map.put("carEnergyTyp", curEnergy.getValue());
|
// map.put("carEnergyTyp", curEnergy.getValue());
|
||||||
map.put("vehicleNumber", str4);
|
map.put("vehicleNumber", str4);
|
||||||
if (cdb != null && cdb.getRes() == 1 && cdb.getData() != null && cdb.getData().getTrailerResVo() != null) {
|
|
||||||
map.put("oldTrailerNumber", cdb.getData().getTrailerResVo().getCarNumber());
|
|
||||||
}
|
|
||||||
new AuthRequest().saveDrawCar(con, hd, MapUtil.mapJson(map));
|
new AuthRequest().saveDrawCar(con, hd, MapUtil.mapJson(map));
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, "请先上传资料", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "请先上传资料", Toast.LENGTH_SHORT).show();
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import com.arpa.hndahesudintocctmsdriver.bean.UploadBean;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.request.AuthRequest;
|
import com.arpa.hndahesudintocctmsdriver.request.AuthRequest;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.UserRequset;
|
import com.arpa.hndahesudintocctmsdriver.request.UserRequset;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.my.WoDeFragment;
|
import com.arpa.hndahesudintocctmsdriver.ui.my.WoDeFragment;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.file.ImageFileCompressUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.file.ImageFileCompressUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.img.GetImageAlert;
|
import com.arpa.hndahesudintocctmsdriver.util.img.GetImageAlert;
|
||||||
@@ -32,8 +31,6 @@ 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.bumptech.glide.Glide;
|
||||||
import com.github.gzuliyujiang.wheelpicker.DatePicker;
|
|
||||||
import com.github.gzuliyujiang.wheelpicker.annotation.DateMode;
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.luck.picture.lib.PictureSelector;
|
import com.luck.picture.lib.PictureSelector;
|
||||||
import com.luck.picture.lib.config.PictureConfig;
|
import com.luck.picture.lib.config.PictureConfig;
|
||||||
@@ -52,24 +49,23 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnClickListener {
|
public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnClickListener {
|
||||||
|
|
||||||
private String[] titles = {"车辆照片", "NFC照片", "车辆登记证书", "道路运输许可证", "车辆交强险"};
|
private String[] titles = {"车辆照片", "NFC照片", "车辆登记证书", "道路运输许可证"};
|
||||||
private String[] name1 = {"车辆照片", "NFC照片", "车辆登记证书照片", "道路运输许可证照片", "车辆交强险照片"};
|
private String[] name1 = {"车辆照片", "NFC照片", "车辆登记证书照片", "道路运输许可证照片"};
|
||||||
private String[] name2 = {"请上传车辆照片", "请上传NFC照片", "请上传车辆登记证书照片", "请上传道路运输许可证照片", "请上传车辆交强险照片"};
|
private String[] name2 = {"请上传车辆照片", "请上传NFC照片", "请上传车辆登记证书照片", "请上传道路运输许可证照片"};
|
||||||
private Boolean[] isShowEdit = {false, false, true, true, true};
|
private Boolean[] isShowEdit = {false, false, true, true};
|
||||||
private Boolean[] isShowSkip = {true, false, false, true, true};
|
private Boolean[] isShowSkip = {true, false, false, true};
|
||||||
private String[] tips = {
|
private String[] tips = {
|
||||||
"",
|
"",
|
||||||
"*注意: 没有粘贴NFC芯片的车辆无需上传,可直接跳过",
|
"*注意: 没有粘贴NFC芯片的车辆无需上传,可直接跳过",
|
||||||
"*注意: 没有可直接跳过,等候下次上传",
|
"*注意: 没有可直接跳过,等候下次上传",
|
||||||
"*注意: 4.5吨以下车辆不需要上传,可直接跳过",
|
"*注意: 4.5吨以下车辆不需要上传,可直接跳过"};
|
||||||
""};
|
|
||||||
|
|
||||||
|
|
||||||
private BaseRecyclerView brv;
|
private BaseRecyclerView brv;
|
||||||
private ImageView img;
|
private ImageView img;
|
||||||
private TextView title1, title2, title3, zjimg_name, upload_img, tvTips, tvSkip, value2;
|
private TextView title1, title2, title3, zjimg_name, upload_img, tvTips, tvSkip;
|
||||||
private EditText value1;
|
private EditText value1;
|
||||||
private LinearLayout llInfo, llDate;
|
private LinearLayout llInfo;
|
||||||
private RelativeLayout up_img;
|
private RelativeLayout up_img;
|
||||||
private Button submit;
|
private Button submit;
|
||||||
|
|
||||||
@@ -79,9 +75,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
private int type;//页面类型
|
private int type;//页面类型
|
||||||
private String path, carId, url;//图片路径
|
private String path, carId, url;//图片路径
|
||||||
private boolean carExist = false;
|
|
||||||
private GetImageAlert gia = new GetImageAlert();
|
private GetImageAlert gia = new GetImageAlert();
|
||||||
private CustomDialog customDialog;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void msgMethod(Message m) {
|
public void msgMethod(Message m) {
|
||||||
@@ -98,11 +92,6 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove(WoDeFragment.VEHICLE_DEL);
|
CacheGroup.cacheList.remove(WoDeFragment.VEHICLE_DEL);
|
||||||
}
|
}
|
||||||
if (CacheGroup.cacheList.get("onlyGetDetail") != null) {
|
|
||||||
Log.e("--res--", CacheGroup.cacheList.get("onlyGetDetail"));
|
|
||||||
cdb = gson.fromJson(CacheGroup.cacheList.get("onlyGetDetail"), CarDelBean.class);
|
|
||||||
CacheGroup.cacheList.remove("onlyGetDetail");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (CacheGroup.cacheList.get("upload") != null) {
|
if (CacheGroup.cacheList.get("upload") != null) {
|
||||||
@@ -120,16 +109,10 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
case 3:
|
case 3:
|
||||||
new AuthRequest().saveCarImg(con, hd, carId, ub.getData().getId(), 2);
|
new AuthRequest().saveCarImg(con, hd, carId, ub.getData().getId(), 2);
|
||||||
break;
|
break;
|
||||||
case 4:
|
|
||||||
new AuthRequest().saveCarImg(con, hd, carId, ub.getData().getId(), 7);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
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);
|
|
||||||
|
|
||||||
if (customDialog != null && customDialog.isShowing())
|
|
||||||
customDialog.dismiss();
|
|
||||||
CacheGroup.cacheList.remove("upload");
|
CacheGroup.cacheList.remove("upload");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,12 +130,8 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
Toast.makeText(con, "上传车辆登记证书照片", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "上传车辆登记证书照片", Toast.LENGTH_SHORT).show();
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
ur.vehicleDelTwo(carId);
|
|
||||||
Toast.makeText(con, "上传道路运输证成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "上传道路运输证成功", Toast.LENGTH_SHORT).show();
|
||||||
break;
|
break;
|
||||||
case 4:
|
|
||||||
Toast.makeText(con, "交强险证件上传成功", Toast.LENGTH_SHORT).show();
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
@@ -179,7 +158,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
IsAuthDriverAuthQualificationBean ib = gson.fromJson(CacheGroup.cacheList.get("saveCarRoadLicenseNo"), IsAuthDriverAuthQualificationBean.class);
|
IsAuthDriverAuthQualificationBean ib = gson.fromJson(CacheGroup.cacheList.get("saveCarRoadLicenseNo"), IsAuthDriverAuthQualificationBean.class);
|
||||||
if (ib.getCode() == 200) {
|
if (ib.getCode() == 200) {
|
||||||
//判断是否需要跳转挂车行驶证页面
|
//判断是否需要跳转挂车行驶证页面
|
||||||
if (!"".equals(carId) && cdb.getData() != null) {
|
if (!"".equals(carId)) {
|
||||||
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();
|
finish();
|
||||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||||
@@ -208,11 +187,8 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
con.startActivity(in);
|
con.startActivity(in);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
finish();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// if (!"".equals(carId) && cdb.getData().getIsTrailer() == 1) {
|
// if (!"".equals(carId) && cdb.getData().getIsTrailer() == 1) {
|
||||||
// if (!"".equals(carId)) {
|
// if (!"".equals(carId)) {
|
||||||
// finish();
|
// finish();
|
||||||
@@ -237,23 +213,8 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove("saveCarRoadLicenseNo");
|
CacheGroup.cacheList.remove("saveCarRoadLicenseNo");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CacheGroup.cacheList.get("saveTrafficInsurance") != null) {
|
|
||||||
Log.e("is", CacheGroup.cacheList.get("saveTrafficInsurance"));
|
|
||||||
IsAuthDriverAuthQualificationBean ddb = gson.fromJson(CacheGroup.cacheList.get("saveTrafficInsurance"), IsAuthDriverAuthQualificationBean.class);
|
|
||||||
if (ddb.getCode() == 200) {
|
|
||||||
Toast.makeText(con, "保存成功", Toast.LENGTH_SHORT).show();
|
|
||||||
finish();
|
|
||||||
} else {
|
|
||||||
Toast.makeText(con, ddb.getMsg(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
|
|
||||||
CacheGroup.cacheList.remove("saveTrafficInsurance");
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case ImageFileCompressUtil.COMPRESS_SUCCESS:
|
case ImageFileCompressUtil.COMPRESS_SUCCESS:
|
||||||
customDialog = new CustomDialog(con, "加载中...");
|
|
||||||
customDialog.show();
|
|
||||||
path = (String) m.obj;
|
path = (String) m.obj;
|
||||||
new AuthRequest().upload(con, hd, new File(path));
|
new AuthRequest().upload(con, hd, new File(path));
|
||||||
break;
|
break;
|
||||||
@@ -272,7 +233,6 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
title1 = findViewById(R.id.title1);
|
title1 = findViewById(R.id.title1);
|
||||||
title2 = findViewById(R.id.title2);
|
title2 = findViewById(R.id.title2);
|
||||||
title3 = findViewById(R.id.name1);
|
title3 = findViewById(R.id.name1);
|
||||||
value2 = findViewById(R.id.value2);
|
|
||||||
up_img = findViewById(R.id.up_img);
|
up_img = findViewById(R.id.up_img);
|
||||||
img = findViewById(R.id.img);
|
img = findViewById(R.id.img);
|
||||||
zjimg_name = findViewById(R.id.zjimg_name);
|
zjimg_name = findViewById(R.id.zjimg_name);
|
||||||
@@ -280,7 +240,6 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
tvTips = findViewById(R.id.tvTips);
|
tvTips = findViewById(R.id.tvTips);
|
||||||
value1 = findViewById(R.id.value1);
|
value1 = findViewById(R.id.value1);
|
||||||
llInfo = findViewById(R.id.llInfo);
|
llInfo = findViewById(R.id.llInfo);
|
||||||
llDate = findViewById(R.id.llDate);
|
|
||||||
tvSkip = findViewById(R.id.tvSkip);
|
tvSkip = findViewById(R.id.tvSkip);
|
||||||
submit = findViewById(R.id.submit);
|
submit = findViewById(R.id.submit);
|
||||||
|
|
||||||
@@ -288,12 +247,10 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
submit.setOnClickListener(this);
|
submit.setOnClickListener(this);
|
||||||
upload_img.setOnClickListener(this);
|
upload_img.setOnClickListener(this);
|
||||||
img.setOnClickListener(this);
|
img.setOnClickListener(this);
|
||||||
value2.setOnClickListener(this);
|
|
||||||
|
|
||||||
|
|
||||||
type = getIntent().getExtras().getInt("type");
|
type = getIntent().getExtras().getInt("type");
|
||||||
carId = getIntent().getExtras().getString("carId", "");
|
carId = getIntent().getExtras().getString("carId", "");
|
||||||
carExist = getIntent().getExtras().getBoolean("carExist", false);
|
|
||||||
changeViewByType(type);
|
changeViewByType(type);
|
||||||
|
|
||||||
ur = new UserRequset(con, hd);
|
ur = new UserRequset(con, hd);
|
||||||
@@ -350,14 +307,6 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
case R.id.img:
|
case R.id.img:
|
||||||
showBigImg();
|
showBigImg();
|
||||||
break;
|
break;
|
||||||
case R.id.value2:
|
|
||||||
DatePicker picker = new DatePicker(this);
|
|
||||||
picker.setBodyWidth(300);
|
|
||||||
picker.setOnDatePickedListener((year, month, day) -> value2.setText(year + "-" + month + "-" + day));
|
|
||||||
picker.getWheelLayout().setDateMode(DateMode.YEAR_MONTH_DAY);
|
|
||||||
picker.getWheelLayout().setDateLabel("年", "月", "日");
|
|
||||||
picker.show();
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,7 +315,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
* 展示大图片
|
* 展示大图片
|
||||||
*/
|
*/
|
||||||
private void showBigImg() {
|
private void showBigImg() {
|
||||||
if ((type == 3 && TextUtils.isEmpty(cdb.getData().getRoadLicensePhoto())) || (type == 4 && TextUtils.isEmpty(cdb.getData().getPolicyPhotoUrl()))) {
|
if (TextUtils.isEmpty(cdb.getData().getRoadLicensePhoto())) {
|
||||||
choicePhoto();
|
choicePhoto();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -411,21 +360,8 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
// .asImageViewer(img, cdb.getData().getRoadLicensePhoto(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
// .asImageViewer(img, cdb.getData().getRoadLicensePhoto(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||||
// .show();
|
// .show();
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
|
|
||||||
case 4:
|
|
||||||
if (cdb.getData().getPolicyPhotoUrl() != null && !"".equals(cdb.getData().getPolicyPhotoUrl())) {
|
|
||||||
//roadLicensePhoto
|
|
||||||
new XPopup.Builder(con)
|
|
||||||
.asImageViewer(img, cdb.getData().getPolicyPhotoUrl(), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
|
||||||
.show();
|
|
||||||
// new XPopup.Builder(con)
|
|
||||||
// .asImageViewer(img, cdb.getData().getRoadLicensePhoto(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
|
||||||
// .show();
|
|
||||||
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -475,15 +411,6 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
new AuthRequest().saveCarRoadLicenseNo(con, hd, carId, s1);
|
new AuthRequest().saveCarRoadLicenseNo(con, hd, carId, s1);
|
||||||
break;
|
break;
|
||||||
case 4:
|
|
||||||
String s2 = value1.getText().toString();
|
|
||||||
String v2 = value2.getText().toString();
|
|
||||||
if (TextUtils.isEmpty(s2) || TextUtils.isEmpty(v2)) {
|
|
||||||
Toast.makeText(this, "请补充证件信息", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
new AuthRequest().saveTrafficInsurance(con, hd, carId, v2, s2);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -515,17 +442,6 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
if (!TextUtils.isEmpty(cdb.getData().getRoadLicensePhoto())) {
|
if (!TextUtils.isEmpty(cdb.getData().getRoadLicensePhoto())) {
|
||||||
Glide.with(con).load(cdb.getData().getRoadLicensePhoto()).into(img);
|
Glide.with(con).load(cdb.getData().getRoadLicensePhoto()).into(img);
|
||||||
value1.setText(cdb.getData().getRoadLicense());
|
value1.setText(cdb.getData().getRoadLicense());
|
||||||
if (!carExist) {
|
|
||||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
|
||||||
upload_img.setText("已上传");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
} else if (4 == type) {
|
|
||||||
if (!TextUtils.isEmpty(cdb.getData().getPolicyPhotoUrl())) {
|
|
||||||
Glide.with(con).load(cdb.getData().getPolicyPhotoUrl()).into(img);
|
|
||||||
value1.setText(cdb.getData().getInsuranceCompany());
|
|
||||||
value2.setText(cdb.getData().getInsuranceEndDay());
|
|
||||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||||
upload_img.setText("已上传");
|
upload_img.setText("已上传");
|
||||||
}
|
}
|
||||||
@@ -611,10 +527,6 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
tvTips.setText(tips[type]);
|
tvTips.setText(tips[type]);
|
||||||
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) {
|
|
||||||
llDate.setVisibility(View.VISIBLE);
|
|
||||||
title3.setText("保险公司");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -14,10 +14,7 @@ import android.widget.Toast;
|
|||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.RefreshCarListEvent;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.VehicleEvent;
|
import com.arpa.hndahesudintocctmsdriver.event.VehicleEvent;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
|
||||||
import com.dahe.mylibrary.utils.ToastUtils;
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.luck.picture.lib.PictureSelector;
|
import com.luck.picture.lib.PictureSelector;
|
||||||
import com.luck.picture.lib.config.PictureConfig;
|
import com.luck.picture.lib.config.PictureConfig;
|
||||||
@@ -41,7 +38,6 @@ import com.scwang.smart.refresh.layout.SmartRefreshLayout;
|
|||||||
|
|
||||||
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.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -55,7 +51,6 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
|
|||||||
public String carId="";
|
public String carId="";
|
||||||
public static final String DEL_CAR="delete_che";
|
public static final String DEL_CAR="delete_che";
|
||||||
public static final String CAR_AUDIO="CAR_AUDIO";
|
public static final String CAR_AUDIO="CAR_AUDIO";
|
||||||
public static final String APP_INFO="APP_INFO";
|
|
||||||
private int submitIndex=0;
|
private int submitIndex=0;
|
||||||
private BaseBean bb;
|
private BaseBean bb;
|
||||||
private ImageView show_img;
|
private ImageView show_img;
|
||||||
@@ -70,7 +65,7 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
|
|||||||
CacheGroup.cacheList.remove(CAR_AUDIO);
|
CacheGroup.cacheList.remove(CAR_AUDIO);
|
||||||
}
|
}
|
||||||
if(CacheGroup.cacheList.get(WoDeFragment.VEHICLE_DEL)!=null){
|
if(CacheGroup.cacheList.get(WoDeFragment.VEHICLE_DEL)!=null){
|
||||||
Log.e("--res--lijia",CacheGroup.cacheList.get(WoDeFragment.VEHICLE_DEL));
|
Log.e("--res--",CacheGroup.cacheList.get(WoDeFragment.VEHICLE_DEL));
|
||||||
cdb=gson.fromJson(CacheGroup.cacheList.get(WoDeFragment.VEHICLE_DEL), CarDelBean.class);
|
cdb=gson.fromJson(CacheGroup.cacheList.get(WoDeFragment.VEHICLE_DEL), CarDelBean.class);
|
||||||
if(cdb.getCode()==200){
|
if(cdb.getCode()==200){
|
||||||
initView(null);
|
initView(null);
|
||||||
@@ -84,8 +79,6 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
|
|||||||
bb=gson.fromJson(CacheGroup.cacheList.get(DEL_CAR),BaseBean.class);
|
bb=gson.fromJson(CacheGroup.cacheList.get(DEL_CAR),BaseBean.class);
|
||||||
if (bb.getCode()==200) {
|
if (bb.getCode()==200) {
|
||||||
Toast.makeText(con,"删除成功",Toast.LENGTH_SHORT).show();
|
Toast.makeText(con,"删除成功",Toast.LENGTH_SHORT).show();
|
||||||
RefreshCarListEvent ve = new RefreshCarListEvent("");
|
|
||||||
EventBus.getDefault().post(ve);
|
|
||||||
finish();
|
finish();
|
||||||
}else{
|
}else{
|
||||||
Toast.makeText(con,"删除失败:"+bb.getMsg(),Toast.LENGTH_SHORT).show();
|
Toast.makeText(con,"删除失败:"+bb.getMsg(),Toast.LENGTH_SHORT).show();
|
||||||
@@ -173,13 +166,6 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
|
|||||||
private GetImageAlert gia=new GetImageAlert();
|
private GetImageAlert gia=new GetImageAlert();
|
||||||
private boolean key1,key2,key3=false;
|
private boolean key1,key2,key3=false;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
EventBus.getDefault().unregister(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initView(Object obj) {
|
public void initView(Object obj) {
|
||||||
super.initView(obj);
|
super.initView(obj);
|
||||||
@@ -221,12 +207,11 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
|
|||||||
RelativeLayout r5=v.findViewById(R.id.r5);
|
RelativeLayout r5=v.findViewById(R.id.r5);
|
||||||
RelativeLayout r6=v.findViewById(R.id.r6);
|
RelativeLayout r6=v.findViewById(R.id.r6);
|
||||||
RelativeLayout r7=v.findViewById(R.id.r7);
|
RelativeLayout r7=v.findViewById(R.id.r7);
|
||||||
RelativeLayout r8=v.findViewById(R.id.r8);
|
|
||||||
View vs1=v.findViewById(R.id.vs1);
|
View vs1=v.findViewById(R.id.vs1);
|
||||||
View vs2=v.findViewById(R.id.vs2);
|
View vs2=v.findViewById(R.id.vs2);
|
||||||
r4.setVisibility(View.GONE);
|
r4.setVisibility(View.GONE);
|
||||||
r5.setVisibility(View.GONE);
|
r5.setVisibility(View.GONE);
|
||||||
// vs1.setVisibility(View.GONE);
|
vs1.setVisibility(View.GONE);
|
||||||
vs2.setVisibility(View.GONE);
|
vs2.setVisibility(View.GONE);
|
||||||
if(!"".equals(carId) && cdb.getData().getIsTrailer()==1){
|
if(!"".equals(carId) && cdb.getData().getIsTrailer()==1){
|
||||||
r4.setVisibility(View.VISIBLE);
|
r4.setVisibility(View.VISIBLE);
|
||||||
@@ -316,17 +301,6 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
|
|||||||
Toast.makeText(con,"请先绑定挂车",Toast.LENGTH_SHORT).show();
|
Toast.makeText(con,"请先绑定挂车",Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
r8.setOnClickListener(v1->{
|
|
||||||
if(!"".equals(carId)){
|
|
||||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
|
||||||
in.putExtra("type", 4);
|
|
||||||
in.putExtra("carId", carId);
|
|
||||||
con.startActivity(in);
|
|
||||||
}else{
|
|
||||||
Toast.makeText(con,"请先绑定行驶证",Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
del.setOnClickListener(v13 -> {
|
del.setOnClickListener(v13 -> {
|
||||||
new XPopup.Builder(con)
|
new XPopup.Builder(con)
|
||||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||||
@@ -410,7 +384,7 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
|
|||||||
super.onResume();
|
super.onResume();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
|
@Subscribe
|
||||||
public void processResult(VehicleEvent event) {
|
public void processResult(VehicleEvent event) {
|
||||||
Log.e("-msg-",event.getMessage());
|
Log.e("-msg-",event.getMessage());
|
||||||
if(!"挂".equals(event.getMessage())) {
|
if(!"挂".equals(event.getMessage())) {
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import android.graphics.Outline;
|
|||||||
import android.location.Location;
|
import android.location.Location;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@@ -23,6 +22,7 @@ import android.widget.Toast;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.cardview.widget.CardView;
|
import androidx.cardview.widget.CardView;
|
||||||
|
import androidx.core.app.ActivityCompat;
|
||||||
|
|
||||||
import com.alct.mdp.MDPLocationCollectionManager;
|
import com.alct.mdp.MDPLocationCollectionManager;
|
||||||
import com.alct.mdp.callback.OnDownloadResultListener;
|
import com.alct.mdp.callback.OnDownloadResultListener;
|
||||||
@@ -36,6 +36,7 @@ import com.amap.api.maps.model.LatLng;
|
|||||||
import com.amap.api.maps.model.Marker;
|
import com.amap.api.maps.model.Marker;
|
||||||
import com.amap.api.maps.model.MarkerOptions;
|
import com.amap.api.maps.model.MarkerOptions;
|
||||||
import com.amap.api.maps.model.MyLocationStyle;
|
import com.amap.api.maps.model.MyLocationStyle;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.App;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.DriverExpireBean;
|
import com.arpa.hndahesudintocctmsdriver.bean.DriverExpireBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.ImageConfig;
|
import com.arpa.hndahesudintocctmsdriver.bean.ImageConfig;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.JTT;
|
import com.arpa.hndahesudintocctmsdriver.bean.JTT;
|
||||||
@@ -85,7 +86,13 @@ import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.util.time.Timer;
|
import com.arpa.hndahesudintocctmsdriver.util.time.Timer;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseFragment;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseFragment;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||||
|
import com.lxj.xpopup.util.XPermission;
|
||||||
import com.permissionx.guolindev.PermissionX;
|
import com.permissionx.guolindev.PermissionX;
|
||||||
|
import com.permissionx.guolindev.callback.RequestCallback;
|
||||||
|
import com.permissionx.guolindev.dialog.RationaleDialog;
|
||||||
|
import com.permissionx.guolindev.request.ChainTask;
|
||||||
|
import com.permissionx.guolindev.request.ExplainScope;
|
||||||
|
import com.permissionx.guolindev.request.ForwardScope;
|
||||||
import com.youth.banner.Banner;
|
import com.youth.banner.Banner;
|
||||||
import com.youth.banner.BannerConfig;
|
import com.youth.banner.BannerConfig;
|
||||||
import com.youth.banner.Transformer;
|
import com.youth.banner.Transformer;
|
||||||
@@ -97,6 +104,9 @@ import org.greenrobot.eventbus.Subscribe;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import pub.devrel.easypermissions.EasyPermissions;
|
||||||
|
import pub.devrel.easypermissions.helper.PermissionHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author hlh
|
* @author hlh
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
@@ -241,9 +251,7 @@ public class HomeFragment extends BaseFragment {
|
|||||||
in.putExtra("url", deb.getData().getIdCardUpdateUrl());
|
in.putExtra("url", deb.getData().getIdCardUpdateUrl());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!TextUtils.isEmpty(deb.getData().getDriverLicenseUpdateUrl()) || !TextUtils.isEmpty(deb.getData().getIdCardUpdateUrl())||
|
if (!"".equals(deb.getData().getDriverLicenseUpdateUrl()) || !"".equals(deb.getData().getIdCardUpdateUrl())) {
|
||||||
!TextUtils.isEmpty(deb.getData().getQualificationUpdateUrl())||!TextUtils.isEmpty(deb.getData().getRoadLicenseUpdateUrl())||
|
|
||||||
!TextUtils.isEmpty(deb.getData().getInsuranceUpdateUrl())) {
|
|
||||||
new XToast<>(act)
|
new XToast<>(act)
|
||||||
.setContentView(R.layout.view_bc)
|
.setContentView(R.layout.view_bc)
|
||||||
// 设置成可拖拽的
|
// 设置成可拖拽的
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import android.os.Bundle;
|
|||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
@@ -103,18 +102,14 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
|||||||
//Toast.makeText(con,"接单成功",Toast.LENGTH_SHORT).show();
|
//Toast.makeText(con,"接单成功",Toast.LENGTH_SHORT).show();
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
// EsignSdk.getInstance().startH5Activity(act, (String) bb.getData());
|
// EsignSdk.getInstance().startH5Activity(act, (String) bb.getData());
|
||||||
if (null==bb.getData()){
|
|
||||||
UiAuxiliary.homeRequest("接单");
|
|
||||||
Intent in = new Intent(con, StartYunDanActivity.class);
|
Intent intent = new Intent(this, H5Activity.class);
|
||||||
in.putExtra("id", "0");
|
intent.putExtra("url", (String) bb.getData());
|
||||||
startActivity(in);
|
intent.putExtra("view_file", false);
|
||||||
finish();
|
startActivity(intent);
|
||||||
}else{
|
|
||||||
Intent intent = new Intent(this, H5Activity.class);
|
|
||||||
intent.putExtra("url", (String) bb.getData());
|
|
||||||
intent.putExtra("view_file", false);
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
|
||||||
//finish();
|
//finish();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
|
|||||||
@@ -17,14 +17,29 @@ import androidx.annotation.NonNull;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.core.widget.NestedScrollView;
|
import androidx.core.widget.NestedScrollView;
|
||||||
|
|
||||||
|
|
||||||
import com.amap.api.location.AMapLocation;
|
import com.amap.api.location.AMapLocation;
|
||||||
import com.amap.api.location.AMapLocationClient;
|
import com.amap.api.location.AMapLocationClient;
|
||||||
import com.amap.api.location.AMapLocationClientOption;
|
import com.amap.api.location.AMapLocationClientOption;
|
||||||
import com.amap.api.location.AMapLocationListener;
|
import com.amap.api.location.AMapLocationListener;
|
||||||
|
import com.amap.api.maps.AMap;
|
||||||
|
import com.amap.api.maps.CameraUpdateFactory;
|
||||||
import com.amap.api.maps.LocationSource;
|
import com.amap.api.maps.LocationSource;
|
||||||
|
import com.amap.api.maps.MapView;
|
||||||
|
import com.amap.api.maps.model.BitmapDescriptorFactory;
|
||||||
|
import com.amap.api.maps.model.LatLng;
|
||||||
|
import com.amap.api.maps.model.LatLngBounds;
|
||||||
|
import com.amap.api.maps.model.MarkerOptions;
|
||||||
|
import com.amap.api.maps.model.PolylineOptions;
|
||||||
|
|
||||||
import com.amap.api.services.core.LatLonPoint;
|
import com.amap.api.services.core.LatLonPoint;
|
||||||
|
import com.amap.api.services.route.BusRouteResult;
|
||||||
|
import com.amap.api.services.route.DrivePath;
|
||||||
|
import com.amap.api.services.route.DriveRouteResult;
|
||||||
|
import com.amap.api.services.route.DriveStep;
|
||||||
|
import com.amap.api.services.route.RideRouteResult;
|
||||||
import com.amap.api.services.route.RouteSearch;
|
import com.amap.api.services.route.RouteSearch;
|
||||||
|
import com.amap.api.services.route.WalkRouteResult;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.dahe.mylibrary.utils.TimeUtil;
|
import com.dahe.mylibrary.utils.TimeUtil;
|
||||||
import com.dahe.mylibrary.utils.ToastUtils;
|
import com.dahe.mylibrary.utils.ToastUtils;
|
||||||
@@ -39,7 +54,6 @@ import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.ui.UiAuxiliary;
|
import com.arpa.hndahesudintocctmsdriver.ui.UiAuxiliary;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.GetShangChuanActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.GetShangChuanActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.OrderComplaintActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.OrderComplaintActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.WebPDFActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.WebPDFActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.location.LocationGDUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.location.LocationGDUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||||
@@ -51,32 +65,10 @@ import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.ScoreView;
|
import com.arpa.hndahesudintocctmsdriver.util.view.ScoreView;
|
||||||
import com.lk.mapsdk.base.mapapi.initializer.InitializerOptions;
|
|
||||||
import com.lk.mapsdk.base.mapapi.initializer.SDKInitializer;
|
|
||||||
import com.lk.mapsdk.base.mapapi.model.CoordType;
|
|
||||||
import com.lk.mapsdk.base.mapapi.model.LatLng;
|
|
||||||
import com.lk.mapsdk.base.mapapi.model.LatLngBounds;
|
|
||||||
import com.lk.mapsdk.map.mapapi.annotation.Marker;
|
|
||||||
import com.lk.mapsdk.map.mapapi.annotation.Polyline;
|
|
||||||
import com.lk.mapsdk.map.mapapi.annotation.options.MarkerOptions;
|
|
||||||
import com.lk.mapsdk.map.mapapi.annotation.options.PolylineOptions;
|
|
||||||
import com.lk.mapsdk.map.mapapi.annotation.util.BitmapDescriptorFactory;
|
|
||||||
import com.lk.mapsdk.map.mapapi.camera.MapStatusUpdateFactory;
|
|
||||||
import com.lk.mapsdk.map.mapapi.map.LKMap;
|
|
||||||
import com.lk.mapsdk.map.mapapi.map.MapView;
|
|
||||||
import com.lk.mapsdk.map.platform.style.layers.Property;
|
|
||||||
import com.lk.mapsdk.route.mapapi.base.AutoInfo;
|
|
||||||
import com.lk.mapsdk.route.mapapi.base.DrivingCostingOptionsInfo;
|
|
||||||
import com.lk.mapsdk.route.mapapi.base.LocationsInfo;
|
|
||||||
import com.lk.mapsdk.route.mapapi.driving.DrivingRoutePlan;
|
|
||||||
import com.lk.mapsdk.route.mapapi.driving.DrivingRoutePlanOptions;
|
|
||||||
import com.lk.mapsdk.route.mapapi.driving.DrivingRoutePlanResult;
|
|
||||||
import com.lk.mapsdk.route.mapapi.driving.OnDrivingRoutePlanListener;
|
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class StartYunDanActivity extends BaseActivity {
|
public class StartYunDanActivity extends BaseActivity {
|
||||||
@@ -87,7 +79,7 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
|
|
||||||
private String TAG = "StartYunDanActivity";
|
private String TAG = "StartYunDanActivity";
|
||||||
private NestedScrollView bottomSheet;
|
private NestedScrollView bottomSheet;
|
||||||
private MapView mapView;
|
private MapView map;
|
||||||
private BaseRecyclerView brv;
|
private BaseRecyclerView brv;
|
||||||
private AlphaAnimation mShowAnim, mHiddenAmin;//控件的显示和隐藏动画
|
private AlphaAnimation mShowAnim, mHiddenAmin;//控件的显示和隐藏动画
|
||||||
private LinearLayout protect;
|
private LinearLayout protect;
|
||||||
@@ -149,6 +141,7 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private UserBean ub;
|
private UserBean ub;
|
||||||
|
private AMap aMap;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
@@ -156,10 +149,6 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
StateStyleUtil.stateTextColor(this);
|
StateStyleUtil.stateTextColor(this);
|
||||||
setContentView(R.layout.activity_yundan_start);
|
setContentView(R.layout.activity_yundan_start);
|
||||||
con = this;
|
con = this;
|
||||||
mapView = findViewById(R.id.map);
|
|
||||||
mapView.onCreate(savedInstanceState);
|
|
||||||
mLKMap = mapView.getMap();
|
|
||||||
initMap();
|
|
||||||
id = getIntent().getExtras().getInt("id");
|
id = getIntent().getExtras().getInt("id");
|
||||||
brv = findViewById(R.id.brv);
|
brv = findViewById(R.id.brv);
|
||||||
protect = findViewById(R.id.protect);
|
protect = findViewById(R.id.protect);
|
||||||
@@ -169,10 +158,12 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
mBottomSheetBehavior.setHideable(false);
|
mBottomSheetBehavior.setHideable(false);
|
||||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||||
//mBottomSheetBehavior.set
|
//mBottomSheetBehavior.set
|
||||||
|
map = findViewById(R.id.map);
|
||||||
|
map.onCreate(savedInstanceState);
|
||||||
// initLoaction();
|
if (aMap == null) {
|
||||||
|
aMap = map.getMap();
|
||||||
|
initLoaction();
|
||||||
|
}
|
||||||
Log.e("--id--", "" + id);
|
Log.e("--id--", "" + id);
|
||||||
String userdata = SPUtil.getSP(con, "data", "userdata");
|
String userdata = SPUtil.getSP(con, "data", "userdata");
|
||||||
if (!userdata.equals("")) {
|
if (!userdata.equals("")) {
|
||||||
@@ -321,8 +312,7 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
initZX(upkey, v15, position, o, 1);
|
initZX(upkey, v15, position, o, 1);
|
||||||
});
|
});
|
||||||
// search();
|
search();
|
||||||
doSearch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initZX(boolean key, View v, int position, Object o, int type) {
|
public void initZX(boolean key, View v, int position, Object o, int type) {
|
||||||
@@ -456,8 +446,8 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
if (mapView != null) {
|
if (map != null) {
|
||||||
mapView.onResume();
|
map.onResume();
|
||||||
}
|
}
|
||||||
hyr.startOrder(id);
|
hyr.startOrder(id);
|
||||||
hyr.getEvaluate(id);
|
hyr.getEvaluate(id);
|
||||||
@@ -466,352 +456,223 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
if (mapView != null) {
|
if (map != null) {
|
||||||
mapView.onPause();
|
map.onPause();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
if (mapView != null) {
|
if (map != null) {
|
||||||
mapView.onDestroy();
|
map.onDestroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onSaveInstanceState(@NonNull @NotNull Bundle outState) {
|
protected void onSaveInstanceState(@NonNull @NotNull Bundle outState) {
|
||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
mapView.onSaveInstanceState(outState);
|
map.onSaveInstanceState(outState);
|
||||||
}
|
}
|
||||||
|
|
||||||
LocationSource.OnLocationChangedListener mListener;
|
LocationSource.OnLocationChangedListener mListener;
|
||||||
AMapLocationClient mlocationClient;
|
AMapLocationClient mlocationClient;
|
||||||
AMapLocationClientOption mLocationOption;
|
AMapLocationClientOption mLocationOption;
|
||||||
|
|
||||||
// public void initLoaction() {
|
public void initLoaction() {
|
||||||
// // 设置定位监听
|
// 设置定位监听
|
||||||
// aMap.setLocationSource(new LocationSource() {
|
aMap.setLocationSource(new LocationSource() {
|
||||||
// @Override
|
@Override
|
||||||
// public void activate(OnLocationChangedListener onLocationChangedListener) {
|
public void activate(OnLocationChangedListener onLocationChangedListener) {
|
||||||
// mListener = onLocationChangedListener;
|
mListener = onLocationChangedListener;
|
||||||
// if (mlocationClient == null) {
|
if (mlocationClient == null) {
|
||||||
// //初始化定位
|
//初始化定位
|
||||||
// try {
|
try {
|
||||||
// mlocationClient = new AMapLocationClient(con);
|
mlocationClient = new AMapLocationClient(con);
|
||||||
// } catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// e.printStackTrace();
|
e.printStackTrace();
|
||||||
// }
|
}
|
||||||
// //初始化定位参数
|
//初始化定位参数
|
||||||
// mLocationOption = new AMapLocationClientOption();
|
mLocationOption = new AMapLocationClientOption();
|
||||||
// //设置定位回调监听
|
//设置定位回调监听
|
||||||
// mlocationClient.setLocationListener(new AMapLocationListener() {
|
mlocationClient.setLocationListener(new AMapLocationListener() {
|
||||||
// @Override
|
@Override
|
||||||
// public void onLocationChanged(AMapLocation aMapLocation) {
|
public void onLocationChanged(AMapLocation aMapLocation) {
|
||||||
// if (mListener != null && aMapLocation != null) {
|
if (mListener != null && aMapLocation != null) {
|
||||||
// if (aMapLocation != null
|
if (aMapLocation != null
|
||||||
// && aMapLocation.getErrorCode() == 0) {
|
&& aMapLocation.getErrorCode() == 0) {
|
||||||
// mListener.onLocationChanged(aMapLocation);// 显示系统小蓝点
|
mListener.onLocationChanged(aMapLocation);// 显示系统小蓝点
|
||||||
// } else {
|
} else {
|
||||||
// String errText = "定位失败," + aMapLocation.getErrorCode() + ": " + aMapLocation.getErrorInfo();
|
String errText = "定位失败," + aMapLocation.getErrorCode() + ": " + aMapLocation.getErrorInfo();
|
||||||
// Log.e("AmapErr", errText);
|
Log.e("AmapErr", errText);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// //设置为高精度定位模式
|
//设置为高精度定位模式
|
||||||
// mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
|
mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
|
||||||
// // mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Battery_Saving);
|
// mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Battery_Saving);
|
||||||
// //设置定位模式为AMapLocationMode.Device_Sensors,仅设备模式。
|
//设置定位模式为AMapLocationMode.Device_Sensors,仅设备模式。
|
||||||
// //mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Device_Sensors);
|
//mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Device_Sensors);
|
||||||
// //获取一次定位结果:
|
//获取一次定位结果:
|
||||||
// //该方法默认为false。
|
//该方法默认为false。
|
||||||
// mLocationOption.setOnceLocation(true);
|
mLocationOption.setOnceLocation(true);
|
||||||
// //获取最近3s内精度最高的一次定位结果:
|
//获取最近3s内精度最高的一次定位结果:
|
||||||
// //设置setOnceLocationLatest(boolean b)接口为true,启动定位时SDK会返回最近3s内精度最高的一次定位结果。如果设置其为true,setOnceLocation(boolean b)接口也会被设置为true,反之不会,默认为false。
|
//设置setOnceLocationLatest(boolean b)接口为true,启动定位时SDK会返回最近3s内精度最高的一次定位结果。如果设置其为true,setOnceLocation(boolean b)接口也会被设置为true,反之不会,默认为false。
|
||||||
// mLocationOption.setOnceLocationLatest(true);
|
mLocationOption.setOnceLocationLatest(true);
|
||||||
// //设置是否返回地址信息(默认返回地址信息)
|
//设置是否返回地址信息(默认返回地址信息)
|
||||||
// mLocationOption.setNeedAddress(true);
|
mLocationOption.setNeedAddress(true);
|
||||||
// //设置是否允许模拟位置,默认为true,允许模拟位置
|
//设置是否允许模拟位置,默认为true,允许模拟位置
|
||||||
// mLocationOption.setMockEnable(true);
|
mLocationOption.setMockEnable(true);
|
||||||
// //单位是毫秒,默认30000毫秒,建议超时时间不要低于8000毫秒。
|
//单位是毫秒,默认30000毫秒,建议超时时间不要低于8000毫秒。
|
||||||
// mLocationOption.setHttpTimeOut(20000);
|
mLocationOption.setHttpTimeOut(20000);
|
||||||
// //关闭缓存机制
|
//关闭缓存机制
|
||||||
// mLocationOption.setLocationCacheEnable(false);
|
mLocationOption.setLocationCacheEnable(false);
|
||||||
// //设置定位参数
|
//设置定位参数
|
||||||
// mlocationClient.setLocationOption(mLocationOption);
|
mlocationClient.setLocationOption(mLocationOption);
|
||||||
// // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
|
// 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
|
||||||
// // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
|
// 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
|
||||||
// // 在定位结束后,在合适的生命周期调用onDestroy()方法
|
// 在定位结束后,在合适的生命周期调用onDestroy()方法
|
||||||
// // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
|
// 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
|
||||||
// mlocationClient.startLocation();//启动定位
|
mlocationClient.startLocation();//启动定位
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void deactivate() {
|
|
||||||
// mListener = null;
|
|
||||||
// if (mlocationClient != null) {
|
|
||||||
// mlocationClient.stopLocation();
|
|
||||||
// mlocationClient.onDestroy();
|
|
||||||
// }
|
|
||||||
// mlocationClient = null;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// // 设置为true表示显示定位层并可触发定位,false表示隐藏定位层并不可触发定位,默认是false
|
|
||||||
//// aMap.setMyLocationEnabled(true);
|
|
||||||
//// ld=new LocationGDUtil(con,hd);
|
|
||||||
//// ld.onCreate();
|
|
||||||
// }
|
|
||||||
|
|
||||||
private void initMap(){
|
|
||||||
// 通过InitializerOptions指定初始化配置参数
|
|
||||||
InitializerOptions options = new InitializerOptions();
|
|
||||||
// 设置是否使用Https网络请求,默认使用
|
|
||||||
// options.setIsHttpsEnable(true);
|
|
||||||
// 设置坐标系,默认GCJ02
|
|
||||||
// options.setCoorType(CoordType.GCJ02);
|
|
||||||
|
|
||||||
SDKInitializer.initialization(getApplicationContext(),options);
|
|
||||||
}
|
|
||||||
|
|
||||||
private DrivingRoutePlanOptions drivingRoutePlanOptions;
|
|
||||||
private List<LocationsInfo> locationsInfos;
|
|
||||||
|
|
||||||
private List<Polyline> polylines = new ArrayList<>();
|
|
||||||
private List<Marker> markers = new ArrayList<>();
|
|
||||||
|
|
||||||
private LKMap mLKMap;
|
|
||||||
|
|
||||||
private void doSearch() {
|
|
||||||
DrivingRoutePlan search = new DrivingRoutePlan();
|
|
||||||
|
|
||||||
drivingRoutePlanOptions = new DrivingRoutePlanOptions();
|
|
||||||
locationsInfos = new ArrayList<>();
|
|
||||||
// 设置开始坐标
|
|
||||||
LocationsInfo origin = new LocationsInfo();
|
|
||||||
origin.setLat(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()));
|
|
||||||
origin.setLon(Double.parseDouble(sob.getData().getWayChildren().get((0)).getLongitude()));
|
|
||||||
// 设置结束坐标
|
|
||||||
LocationsInfo dest = new LocationsInfo();
|
|
||||||
dest.setLat(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLatitude()));
|
|
||||||
dest.setLon(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLongitude()));
|
|
||||||
locationsInfos.add(origin);
|
|
||||||
locationsInfos.add(dest);
|
|
||||||
drivingRoutePlanOptions.setLocations(locationsInfos);
|
|
||||||
AutoInfo autoInfo = new AutoInfo();
|
|
||||||
DrivingCostingOptionsInfo drivingCostingOptionsInfo = new DrivingCostingOptionsInfo();
|
|
||||||
drivingCostingOptionsInfo.setAuto(autoInfo);
|
|
||||||
drivingRoutePlanOptions.setDrivingCostingOptions(drivingCostingOptionsInfo);
|
|
||||||
|
|
||||||
search.drivingRoutePlanRequest(drivingRoutePlanOptions, new OnDrivingRoutePlanListener() {
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onGetDrivingRoutePlanResult(DrivingRoutePlanResult routePlanResult) {
|
public void deactivate() {
|
||||||
addRoutePlanLine(routePlanResult);
|
mListener = null;
|
||||||
addRouteMarker();
|
if (mlocationClient != null) {
|
||||||
|
mlocationClient.stopLocation();
|
||||||
|
mlocationClient.onDestroy();
|
||||||
|
}
|
||||||
|
mlocationClient = null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
// 设置为true表示显示定位层并可触发定位,false表示隐藏定位层并不可触发定位,默认是false
|
||||||
|
aMap.setMyLocationEnabled(true);
|
||||||
/**
|
// ld=new LocationGDUtil(con,hd);
|
||||||
* 添加线路规划路线
|
// ld.onCreate();
|
||||||
*
|
|
||||||
* @param routePlanResult
|
|
||||||
*/
|
|
||||||
private void addRoutePlanLine(DrivingRoutePlanResult routePlanResult) {
|
|
||||||
if (routePlanResult == null) {
|
|
||||||
Toast.makeText(this, "没有检索到结果", Toast.LENGTH_LONG).show();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (routePlanResult.getRouteInfos() == null || routePlanResult.getRouteInfos().isEmpty()) {
|
|
||||||
Toast.makeText(this, "没有检索到结果", Toast.LENGTH_LONG).show();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<LatLng> latLngs = new ArrayList<>();
|
|
||||||
List<LatLng> all = new ArrayList<>();
|
|
||||||
mLKMap.removeOverlay(polylines);
|
|
||||||
polylines.clear();
|
|
||||||
|
|
||||||
if (routePlanResult.getRouteInfos().size()>0){
|
|
||||||
latLngs.clear();
|
|
||||||
latLngs.addAll(routePlanResult.getRouteInfos().get(0).getGeometry());
|
|
||||||
PolylineOptions options = new PolylineOptions();
|
|
||||||
options.width(8f)
|
|
||||||
.joinStyle(Property.LINE_JOIN_ROUND)
|
|
||||||
.points(latLngs)
|
|
||||||
.color(getResources().getColor(R.color.theme_color));
|
|
||||||
all.addAll(latLngs);
|
|
||||||
polylines.add((Polyline) mLKMap.addOverlay(options));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// for (int i = 0;i < routePlanResult.getRouteInfos().size();i ++){
|
|
||||||
// latLngs.clear();
|
|
||||||
// latLngs.addAll(routePlanResult.getRouteInfos().get(i).getGeometry());
|
|
||||||
// PolylineOptions options = new PolylineOptions();
|
|
||||||
// if(i == routePlanResult.getRouteInfos().size() - 1){
|
|
||||||
// options.width(8f)
|
|
||||||
//// .pattern(BitmapDescriptorFactory.fromResource(R.drawable.icon_roud_type))
|
|
||||||
// .joinStyle(Property.LINE_JOIN_ROUND)
|
|
||||||
// .points(latLngs)
|
|
||||||
// .color(getResources().getColor(R.color.theme_color));
|
|
||||||
// }else{
|
|
||||||
// options.width(8f)
|
|
||||||
//// .joinStyle(Property.LINE_JOIN_ROUND)
|
|
||||||
// .points(latLngs)
|
|
||||||
// .color(getResources().getColor(R.color.theme_color));
|
|
||||||
// }
|
|
||||||
// all.addAll(latLngs);
|
|
||||||
// polylines.add((Polyline) mLKMap.addOverlay(options));
|
|
||||||
// }
|
|
||||||
mLKMap.setMapStatus(MapStatusUpdateFactory.buildUpdateByLatLngBounds(new LatLngBounds(all),100,100,100,100));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加起始点标记
|
|
||||||
*/
|
|
||||||
private void addRouteMarker() {
|
|
||||||
mLKMap.removeOverlay(markers);
|
|
||||||
markers.clear();
|
|
||||||
MarkerOptions originOptions = new MarkerOptions()
|
|
||||||
.position(new LatLng(locationsInfos.get(0).getLat(),locationsInfos.get(0).getLon()))
|
|
||||||
.icon(BitmapDescriptorFactory.fromResource(R.mipmap.qi))
|
|
||||||
.iconGravity(Property.ICON_ANCHOR_BOTTOM)
|
|
||||||
.iconScale(0.5f);
|
|
||||||
markers.add((Marker) mLKMap.addOverlay(originOptions));
|
|
||||||
|
|
||||||
MarkerOptions destinationOptions = new MarkerOptions()
|
|
||||||
.position(new LatLng(locationsInfos.get(1).getLat(),locationsInfos.get(1).getLon()))
|
|
||||||
.icon(BitmapDescriptorFactory.fromResource(R.mipmap.zhong))
|
|
||||||
.iconGravity(Property.ICON_ANCHOR_BOTTOM)
|
|
||||||
.iconScale(0.5f);
|
|
||||||
markers.add((Marker) mLKMap.addOverlay(destinationOptions));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// private RouteSearch mRouteSearch;//路线查询器
|
private RouteSearch mRouteSearch;//路线查询器
|
||||||
// private List<LatLonPoint> lists = new ArrayList<>();
|
private List<LatLonPoint> lists = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
// public void search() {
|
public void search() {
|
||||||
//// try {
|
// try {
|
||||||
//// AMapLocationClient.updatePrivacyShow(con,true,true);
|
// AMapLocationClient.updatePrivacyShow(con,true,true);
|
||||||
//// AMapLocationClient.updatePrivacyAgree(con,true);
|
// AMapLocationClient.updatePrivacyAgree(con,true);
|
||||||
// mRouteSearch = new RouteSearch(this);
|
mRouteSearch = new RouteSearch(this);
|
||||||
//// } catch (AMapException e) {
|
// } catch (AMapException e) {
|
||||||
//// e.printStackTrace();
|
// e.printStackTrace();
|
||||||
//// }
|
|
||||||
// //设置数据回调监听器
|
|
||||||
// mRouteSearch.setRouteSearchListener(new OnRouteSearchListener());
|
|
||||||
// //设置开始位置坐标点(注意经纬度不能写反,会报错1800(只能规划到中国区域里的地图路线))
|
|
||||||
// LatLonPoint startPoint = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
|
|
||||||
// Double.parseDouble(sob.getData().getWayChildren().get((0)).getLongitude()));
|
|
||||||
// //设置目的地坐标点
|
|
||||||
// LatLonPoint endPoint = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLatitude()),
|
|
||||||
// Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLongitude()));
|
|
||||||
// //查询信息对象
|
|
||||||
// for (int i = 0; i < sob.getData().getWayChildren().size(); i++) {
|
|
||||||
// if (i != 0 && i != (sob.getData().getWayChildren().size() - 1)) {
|
|
||||||
// LatLonPoint sp = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get(i).getLatitude()),
|
|
||||||
// Double.parseDouble(sob.getData().getWayChildren().get((i)).getLongitude()));
|
|
||||||
// lists.add(sp);
|
|
||||||
// }
|
|
||||||
// }
|
// }
|
||||||
// RouteSearch.FromAndTo fromAndTo = new RouteSearch.FromAndTo(startPoint, endPoint);
|
//设置数据回调监听器
|
||||||
// //设置搜索参数 1.fromAndTo 路径的起点终点 2.路径规划的策略(这里是驾车模式,具体看高德API) 3.途
|
mRouteSearch.setRouteSearchListener(new OnRouteSearchListener());
|
||||||
// //经点,可选 4.避让区域,可选, 5.避让道路 ,可选
|
//设置开始位置坐标点(注意经纬度不能写反,会报错1800(只能规划到中国区域里的地图路线))
|
||||||
// RouteSearch.DriveRouteQuery query = new
|
LatLonPoint startPoint = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
|
||||||
// RouteSearch.DriveRouteQuery(fromAndTo, RouteSearch.DRIVING_SINGLE_DEFAULT, lists, null, "");
|
Double.parseDouble(sob.getData().getWayChildren().get((0)).getLongitude()));
|
||||||
// //开始异步查询
|
//设置目的地坐标点
|
||||||
// mRouteSearch.calculateDriveRouteAsyn(query);
|
LatLonPoint endPoint = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLatitude()),
|
||||||
// }
|
Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLongitude()));
|
||||||
|
//查询信息对象
|
||||||
|
for (int i = 0; i < sob.getData().getWayChildren().size(); i++) {
|
||||||
|
if (i != 0 && i != (sob.getData().getWayChildren().size() - 1)) {
|
||||||
|
LatLonPoint sp = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get(i).getLatitude()),
|
||||||
|
Double.parseDouble(sob.getData().getWayChildren().get((i)).getLongitude()));
|
||||||
|
lists.add(sp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
RouteSearch.FromAndTo fromAndTo = new RouteSearch.FromAndTo(startPoint, endPoint);
|
||||||
|
//设置搜索参数 1.fromAndTo 路径的起点终点 2.路径规划的策略(这里是驾车模式,具体看高德API) 3.途
|
||||||
|
//经点,可选 4.避让区域,可选, 5.避让道路 ,可选
|
||||||
|
RouteSearch.DriveRouteQuery query = new
|
||||||
|
RouteSearch.DriveRouteQuery(fromAndTo, RouteSearch.DRIVING_SINGLE_DEFAULT, lists, null, "");
|
||||||
|
//开始异步查询
|
||||||
|
mRouteSearch.calculateDriveRouteAsyn(query);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// class OnRouteSearchListener implements RouteSearch.OnRouteSearchListener {
|
class OnRouteSearchListener implements RouteSearch.OnRouteSearchListener {
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// public void onBusRouteSearched(BusRouteResult busRouteResult, int i) {
|
public void onBusRouteSearched(BusRouteResult busRouteResult, int i) {
|
||||||
//
|
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// public void onDriveRouteSearched(DriveRouteResult driveRouteResult, int rCode) {
|
public void onDriveRouteSearched(DriveRouteResult driveRouteResult, int rCode) {
|
||||||
// if (rCode == 1000) {//获取规划路线成功,获取到的是了,路线坐标点的集合
|
if (rCode == 1000) {//获取规划路线成功,获取到的是了,路线坐标点的集合
|
||||||
// List<DrivePath> paths = driveRouteResult.getPaths();
|
List<DrivePath> paths = driveRouteResult.getPaths();
|
||||||
// //创建存储坐标点的集合
|
//创建存储坐标点的集合
|
||||||
// List<LatLng> latLngs = new ArrayList<>();
|
List<LatLng> latLngs = new ArrayList<>();
|
||||||
// //遍历获取规划的所有路线坐标点
|
//遍历获取规划的所有路线坐标点
|
||||||
// for (DrivePath mDrivePath : paths) {
|
for (DrivePath mDrivePath : paths) {
|
||||||
// for (DriveStep mDriveStep : mDrivePath.getSteps()) {
|
for (DriveStep mDriveStep : mDrivePath.getSteps()) {
|
||||||
// for (LatLonPoint mLatLonPoint : mDriveStep.getPolyline()) {
|
for (LatLonPoint mLatLonPoint : mDriveStep.getPolyline()) {
|
||||||
// latLngs.add(new
|
latLngs.add(new
|
||||||
// LatLng(mLatLonPoint.getLatitude(), mLatLonPoint.getLongitude()));
|
LatLng(mLatLonPoint.getLatitude(), mLatLonPoint.getLongitude()));
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// //先清除一下,避免重复显示
|
//先清除一下,避免重复显示
|
||||||
// aMap.clear();
|
aMap.clear();
|
||||||
// //绘制起始位置和目的地marker
|
//绘制起始位置和目的地marker
|
||||||
// aMap.addMarker(new MarkerOptions()
|
aMap.addMarker(new MarkerOptions()
|
||||||
// .icon(BitmapDescriptorFactory.fromResource(R.mipmap.qi))
|
.icon(BitmapDescriptorFactory.fromResource(R.mipmap.qi))
|
||||||
// .position(new LatLng(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
|
.position(new LatLng(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
|
||||||
// Double.parseDouble(sob.getData().getWayChildren().get(0).getLongitude()))));
|
Double.parseDouble(sob.getData().getWayChildren().get(0).getLongitude()))));
|
||||||
// for (int i = 0; i < sob.getData().getWayChildren().size(); i++) {
|
for (int i = 0; i < sob.getData().getWayChildren().size(); i++) {
|
||||||
// if (i != 0 && i != (sob.getData().getWayChildren().size() - 1)) {
|
if (i != 0 && i != (sob.getData().getWayChildren().size() - 1)) {
|
||||||
// StartOrderBean.DataDTO.WayChildrenDTO sdw = sob.getData().getWayChildren().get(i);
|
StartOrderBean.DataDTO.WayChildrenDTO sdw = sob.getData().getWayChildren().get(i);
|
||||||
// int icon = 0;
|
int icon = 0;
|
||||||
// if (sdw.getType() == 1) {
|
if (sdw.getType() == 1) {
|
||||||
// icon = R.mipmap.z_loc;
|
icon = R.mipmap.z_loc;
|
||||||
// } else {
|
} else {
|
||||||
// icon = R.mipmap.x_loc;
|
icon = R.mipmap.x_loc;
|
||||||
// }
|
}
|
||||||
// aMap.addMarker(new MarkerOptions()
|
aMap.addMarker(new MarkerOptions()
|
||||||
// .icon(BitmapDescriptorFactory.fromResource(icon))
|
.icon(BitmapDescriptorFactory.fromResource(icon))
|
||||||
// .position(new LatLng(Double.parseDouble(sdw.getLatitude()), Double.parseDouble(sdw.getLongitude()))));
|
.position(new LatLng(Double.parseDouble(sdw.getLatitude()), Double.parseDouble(sdw.getLongitude()))));
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// aMap.addMarker(new MarkerOptions()
|
aMap.addMarker(new MarkerOptions()
|
||||||
// .icon(BitmapDescriptorFactory.fromResource(R.mipmap.zhong))
|
.icon(BitmapDescriptorFactory.fromResource(R.mipmap.zhong))
|
||||||
// .position(new LatLng(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLatitude()),
|
.position(new LatLng(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLatitude()),
|
||||||
// Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLongitude()))));
|
Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLongitude()))));
|
||||||
// //绘制规划路径路线
|
//绘制规划路径路线
|
||||||
// aMap.addPolyline(new PolylineOptions()
|
aMap.addPolyline(new PolylineOptions()
|
||||||
// //路线坐标点的集合
|
//路线坐标点的集合
|
||||||
// .addAll(latLngs)
|
.addAll(latLngs)
|
||||||
// //线的宽度
|
//线的宽度
|
||||||
// .width(8)
|
.width(8)
|
||||||
// .color(getResources().getColor(R.color.theme_color)));
|
.color(getResources().getColor(R.color.theme_color)));
|
||||||
// //设置画线的颜色
|
//设置画线的颜色
|
||||||
//
|
|
||||||
// //显示完整包含所有marker地图路线
|
//显示完整包含所有marker地图路线
|
||||||
// LatLngBounds.Builder builder = LatLngBounds.builder();
|
LatLngBounds.Builder builder = LatLngBounds.builder();
|
||||||
// for (int i = 0; i < latLngs.size(); i++) {
|
for (int i = 0; i < latLngs.size(); i++) {
|
||||||
// builder.include(latLngs.get(i));
|
builder.include(latLngs.get(i));
|
||||||
// }
|
}
|
||||||
// //显示全部marker,第二个参数是四周留空宽度
|
//显示全部marker,第二个参数是四周留空宽度
|
||||||
// aMap.moveCamera(CameraUpdateFactory.newLatLngBounds(builder.build(), 200));
|
aMap.moveCamera(CameraUpdateFactory.newLatLngBounds(builder.build(), 200));
|
||||||
// LatLng latLng = new LatLng(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
|
LatLng latLng = new LatLng(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
|
||||||
// Double.parseDouble(sob.getData().getWayChildren().get((0)).getLongitude()));//构造一个位置
|
Double.parseDouble(sob.getData().getWayChildren().get((0)).getLongitude()));//构造一个位置
|
||||||
// aMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 6));
|
aMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 6));
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// public void onWalkRouteSearched(WalkRouteResult walkRouteResult, int i) {
|
public void onWalkRouteSearched(WalkRouteResult walkRouteResult, int i) {
|
||||||
//
|
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// @Override
|
@Override
|
||||||
// public void onRideRouteSearched(RideRouteResult rideRouteResult, int i) {
|
public void onRideRouteSearched(RideRouteResult rideRouteResult, int i) {
|
||||||
//
|
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// }
|
}
|
||||||
|
|
||||||
public void up_traffic() {
|
public void up_traffic() {
|
||||||
// ShippingNoteInfo[] snis=new ShippingNoteInfo[1];
|
// ShippingNoteInfo[] snis=new ShippingNoteInfo[1];
|
||||||
@@ -833,25 +694,4 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
// });
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onStart() {
|
|
||||||
super.onStart();
|
|
||||||
mapView.onStart();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onStop() {
|
|
||||||
super.onStop();
|
|
||||||
mapView.onStop();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLowMemory() {
|
|
||||||
super.onLowMemory();
|
|
||||||
mapView.onDestroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -513,6 +513,11 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
|||||||
// for(int i=0;i<imgIds.size();i++){
|
// for(int i=0;i<imgIds.size();i++){
|
||||||
// Log.e("--imgIds--",imgIds.get(i)+"");
|
// Log.e("--imgIds--",imgIds.get(i)+"");
|
||||||
// }
|
// }
|
||||||
|
if(TextUtils.isEmpty(tempLoca.getTime())||TextUtils.isEmpty(tempLoca.getAddress())){
|
||||||
|
ToastUtils.showToast(this,"请选择时间以及地点");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case 0:
|
case 0:
|
||||||
//装货
|
//装货
|
||||||
@@ -566,9 +571,9 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
|||||||
case 2:
|
case 2:
|
||||||
if (imgIds != null && imgIds.size() > 0) {//卸货回单
|
if (imgIds != null && imgIds.size() > 0) {//卸货回单
|
||||||
//上传回单
|
//上传回单
|
||||||
urib.setLatitude(lgdu.getLatitude() + "");
|
urib.setLatitude(tempLoca.getLatitude() + "");
|
||||||
urib.setLongitude(lgdu.getLongitude() + "");
|
urib.setLongitude(tempLoca.getLongitude() + "");
|
||||||
urib.setLocationAddress(lgdu.getAddress());
|
urib.setLocationAddress(tempLoca.getAddress());
|
||||||
//装卸货类型
|
//装卸货类型
|
||||||
urib.setType(h_type + 1);
|
urib.setType(h_type + 1);
|
||||||
//回单id 数组
|
//回单id 数组
|
||||||
|
|||||||
@@ -1,14 +1,8 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.ui.login;
|
package com.arpa.hndahesudintocctmsdriver.ui.login;
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.wifi.WifiManager;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.provider.Settings;
|
|
||||||
import android.telecom.TelecomManager;
|
|
||||||
import android.telephony.TelephonyManager;
|
|
||||||
import android.text.SpannableStringBuilder;
|
import android.text.SpannableStringBuilder;
|
||||||
import android.text.TextPaint;
|
import android.text.TextPaint;
|
||||||
import android.text.method.LinkMovementMethod;
|
import android.text.method.LinkMovementMethod;
|
||||||
@@ -16,8 +10,6 @@ import android.text.style.ClickableSpan;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.CheckBox;
|
|
||||||
import android.widget.CompoundButton;
|
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
@@ -26,7 +18,6 @@ import android.widget.Toast;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.cardview.widget.CardView;
|
import androidx.cardview.widget.CardView;
|
||||||
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.AppInfoBean;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
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;
|
||||||
@@ -47,7 +38,6 @@ import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StatusBarUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StatusBarUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
||||||
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.TimerTask;
|
import java.util.TimerTask;
|
||||||
|
|
||||||
import cn.jiguang.verifysdk.api.AuthPageEventListener;
|
import cn.jiguang.verifysdk.api.AuthPageEventListener;
|
||||||
@@ -74,7 +64,8 @@ public class LoginActivity extends BaseActivity {
|
|||||||
private LoginBean loginBean;
|
private LoginBean loginBean;
|
||||||
private TimerTask tt;
|
private TimerTask tt;
|
||||||
private int timer_sum = 60;
|
private int timer_sum = 60;
|
||||||
private CheckBox cb;
|
private ImageButton agree_btn;
|
||||||
|
private CardView no_btn;
|
||||||
private UserRequset ur;
|
private UserRequset ur;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -97,22 +88,15 @@ public class LoginActivity extends BaseActivity {
|
|||||||
//存储登录记录
|
//存储登录记录
|
||||||
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();
|
|
||||||
if (loginBean.getCode() == 200) {
|
if (loginBean.getCode() == 200) {
|
||||||
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());
|
||||||
SPUtil.insSP(con, USER, USER_ID, loginBean.getData().getId() + "");
|
SPUtil.insSP(con, USER, USER_ID, loginBean.getData().getId() + "");
|
||||||
JPushInterface.setAlias(con, 0, loginBean.getData().getUname());
|
JPushInterface.setAlias(con, 0, loginBean.getData().getUname());
|
||||||
appInfoBean.setStatus("0");
|
|
||||||
appInfoBean.setUserPhone(String.valueOf(input_phone.getText()));
|
|
||||||
ur.postAppInfo(appInfoBean,"post");
|
|
||||||
UiAuxiliary.homeRequest("登录成功");
|
UiAuxiliary.homeRequest("登录成功");
|
||||||
finish();
|
finish();
|
||||||
} else {
|
} else {
|
||||||
appInfoBean.setStatus("1");
|
|
||||||
appInfoBean.setUserPhone(String.valueOf(input_phone.getText()));
|
|
||||||
ur.postAppInfo(appInfoBean,"post");
|
|
||||||
Toast.makeText(con, loginBean.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, loginBean.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove(LOGIN_RESULT);
|
CacheGroup.cacheList.remove(LOGIN_RESULT);
|
||||||
@@ -134,7 +118,8 @@ public class LoginActivity extends BaseActivity {
|
|||||||
input_phone = findViewById(R.id.input_phone);
|
input_phone = findViewById(R.id.input_phone);
|
||||||
input_code = findViewById(R.id.input_code);
|
input_code = findViewById(R.id.input_code);
|
||||||
getCode = findViewById(R.id.getCode);
|
getCode = findViewById(R.id.getCode);
|
||||||
cb = findViewById(R.id.cb);
|
agree_btn = findViewById(R.id.agree_btn);
|
||||||
|
no_btn = findViewById(R.id.no_btn);
|
||||||
ur = new UserRequset(con, hd);
|
ur = new UserRequset(con, hd);
|
||||||
initView(null);
|
initView(null);
|
||||||
}
|
}
|
||||||
@@ -147,18 +132,21 @@ public class LoginActivity extends BaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void initView(Object obj) {
|
public void initView(Object obj) {
|
||||||
super.initView(obj);
|
super.initView(obj);
|
||||||
cb.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
agree_btn.setOnClickListener(v -> {
|
||||||
if (isChecked) {
|
agree_btn.setVisibility(View.GONE);
|
||||||
key = true;
|
no_btn.setVisibility(View.VISIBLE);
|
||||||
} else {
|
key = false;
|
||||||
key = false;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
no_btn.setOnClickListener(v -> {
|
||||||
|
agree_btn.setVisibility(View.VISIBLE);
|
||||||
|
no_btn.setVisibility(View.GONE);
|
||||||
|
key = true;
|
||||||
|
|
||||||
|
});
|
||||||
ConfigBean cb = ConfigParts.getConfigParts(con);
|
ConfigBean cb = ConfigParts.getConfigParts(con);
|
||||||
if (cb != null) {
|
if (cb != null) {
|
||||||
url1 = cb.getData().getUserUrl();
|
url1 = cb.getData().getUserUrl();
|
||||||
url2 = "https://agreement.dahehuoyun.com/currency/#/";
|
url2 = "https://agreement.dahehuoyun.com/huawei/#/private";
|
||||||
}
|
}
|
||||||
TextView tv_content = findViewById(R.id.tv_content);
|
TextView tv_content = findViewById(R.id.tv_content);
|
||||||
String str = "我已阅读并同意相关服务条款和隐私政策《用户服务协议》和《隐私政策》";
|
String str = "我已阅读并同意相关服务条款和隐私政策《用户服务协议》和《隐私政策》";
|
||||||
|
|||||||
@@ -30,12 +30,10 @@ import androidx.core.app.ActivityCompat;
|
|||||||
|
|
||||||
import com.alct.mdp.MDPLocationCollectionManager;
|
import com.alct.mdp.MDPLocationCollectionManager;
|
||||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.AppInfoBean;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.ImageConfig;
|
import com.arpa.hndahesudintocctmsdriver.bean.ImageConfig;
|
||||||
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
||||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.UserRequset;
|
import com.arpa.hndahesudintocctmsdriver.request.UserRequset;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.UiAuxiliary;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.business.BusinessActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.business.BusinessActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||||
@@ -140,8 +138,8 @@ 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, "https://agreement.dahehuoyun.com/currency/#/",
|
.asCustom(new AgreementAlert(con, "https://agreement.dahehuoyun.com/huawei/#/private",
|
||||||
"https://agreement.dahehuoyun.com/rule/serviceAgreement/dist/index.html#/", hd))
|
"http://agreement.dahehuoyun.com/#/user", hd))
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
Glide.with(con)
|
Glide.with(con)
|
||||||
@@ -161,16 +159,6 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
|||||||
initRequest();
|
initRequest();
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
AppInfoBean appInfoBean = new AppInfoBean();
|
|
||||||
|
|
||||||
if (!UiAuxiliary.isLogin(con)) {
|
|
||||||
ur.postAppInfo(appInfoBean, "post");
|
|
||||||
}else{
|
|
||||||
String sp = SPUtil.getSP(con, LoginActivity.USER, LoginActivity.USER_UNAME);
|
|
||||||
appInfoBean.setUserPhone(sp);
|
|
||||||
appInfoBean.setStatus("0");
|
|
||||||
ur.postAppInfo(appInfoBean, "post");
|
|
||||||
}
|
|
||||||
|
|
||||||
// String[] permissions=new String[]{
|
// String[] permissions=new String[]{
|
||||||
// Manifest.permission.ACCESS_FINE_LOCATION,
|
// Manifest.permission.ACCESS_FINE_LOCATION,
|
||||||
|
|||||||
@@ -18,12 +18,12 @@ import androidx.annotation.NonNull;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.PersonEvent;
|
import com.arpa.hndahesudintocctmsdriver.event.PersonEvent;
|
||||||
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.business.BusinessActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.business.BusinessActivity;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.PicturlUtil;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.lxj.xpopup.XPopup;
|
import com.lxj.xpopup.XPopup;
|
||||||
@@ -63,32 +63,32 @@ public class MyFragment extends BaseFragment {
|
|||||||
private UserBean userBean;
|
private UserBean userBean;
|
||||||
private StartOrderBean sob;
|
private StartOrderBean sob;
|
||||||
private CarListBean clb;
|
private CarListBean clb;
|
||||||
private Gson gson = new Gson();
|
private Gson gson=new Gson();
|
||||||
private UserRequset ur;
|
private UserRequset ur;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void msgMethod(Message m) {
|
public void msgMethod(Message m) {
|
||||||
super.msgMethod(m);
|
super.msgMethod(m);
|
||||||
switch (m.what) {
|
switch (m.what){
|
||||||
case 200:
|
case 200:
|
||||||
refreshLayout.finishRefresh();
|
refreshLayout.finishRefresh();
|
||||||
if (CacheGroup.cacheList.get(WoDeFragment.VEHICLE_LIST) != null) {
|
if(CacheGroup.cacheList.get(WoDeFragment.VEHICLE_LIST)!=null){
|
||||||
clb = gson.fromJson(CacheGroup.cacheList.get(WoDeFragment.VEHICLE_LIST), CarListBean.class);
|
clb=gson.fromJson(CacheGroup.cacheList.get(WoDeFragment.VEHICLE_LIST),CarListBean.class);
|
||||||
if (clb.getCode() == 200) {
|
if(clb.getCode()==200){
|
||||||
initVehicleList(true);
|
initVehicleList(true);
|
||||||
} else {
|
}else{
|
||||||
Toast.makeText(con, clb.getRes(), Toast.LENGTH_LONG).show();
|
Toast.makeText(con,clb.getRes(),Toast.LENGTH_LONG).show();
|
||||||
initVehicleList(false);
|
initVehicleList(false);
|
||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove(WoDeFragment.VEHICLE_LIST);
|
CacheGroup.cacheList.remove(WoDeFragment.VEHICLE_LIST);
|
||||||
}
|
}
|
||||||
if (CacheGroup.cacheList.get("userdata") != null) {
|
if (CacheGroup.cacheList.get("userdata")!=null){
|
||||||
userBean = gson.fromJson(CacheGroup.cacheList.get("userdata"), UserBean.class);
|
userBean=gson.fromJson(CacheGroup.cacheList.get("userdata"), UserBean.class);
|
||||||
if (userBean.getCode() == 200) {
|
if(userBean.getCode()==200 ){
|
||||||
SPUtil.insSP(con, "data", "userdata", CacheGroup.cacheList.get("userdata"));
|
SPUtil.insSP(con,"data","userdata",CacheGroup.cacheList.get("userdata"));
|
||||||
initAuth();
|
initAuth();
|
||||||
} else {
|
}else{
|
||||||
Toast.makeText(con, userBean.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(con,userBean.getMsg(),Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove("userdata");
|
CacheGroup.cacheList.remove("userdata");
|
||||||
}
|
}
|
||||||
@@ -100,12 +100,12 @@ public class MyFragment extends BaseFragment {
|
|||||||
@org.jetbrains.annotations.Nullable
|
@org.jetbrains.annotations.Nullable
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable @org.jetbrains.annotations.Nullable ViewGroup container, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable @org.jetbrains.annotations.Nullable ViewGroup container, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
|
||||||
root = inflater.inflate(R.layout.fragment_my, container, false);
|
root=inflater.inflate(R.layout.fragment_my,container,false);
|
||||||
con = root.getContext();
|
con=root.getContext();
|
||||||
brv = root.findViewById(R.id.rv);
|
brv=root.findViewById(R.id.rv);
|
||||||
EventBus.getDefault().register(this);
|
EventBus.getDefault().register(this);
|
||||||
userBean = UserParts.getUser(con);
|
userBean= UserParts.getUser(con);
|
||||||
ur = new UserRequset(con, hd);
|
ur=new UserRequset(con,hd);
|
||||||
getRequest();
|
getRequest();
|
||||||
initId();
|
initId();
|
||||||
initRefreshLoad();
|
initRefreshLoad();
|
||||||
@@ -114,7 +114,7 @@ public class MyFragment extends BaseFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void initRefreshLoad() {
|
public void initRefreshLoad() {
|
||||||
refreshLayout = root.findViewById(R.id.srl);
|
refreshLayout =root.findViewById(R.id.srl);
|
||||||
refreshLayout.setOnRefreshListener(refreshLayout -> {
|
refreshLayout.setOnRefreshListener(refreshLayout -> {
|
||||||
getRequest();
|
getRequest();
|
||||||
});
|
});
|
||||||
@@ -123,7 +123,7 @@ public class MyFragment extends BaseFragment {
|
|||||||
@Override
|
@Override
|
||||||
public void initView(Object obj) {
|
public void initView(Object obj) {
|
||||||
super.initView(obj);
|
super.initView(obj);
|
||||||
brv_vehicle = root.findViewById(R.id.brv_vehicle);
|
brv_vehicle=root.findViewById(R.id.brv_vehicle);
|
||||||
ur.vehicleList("1");
|
ur.vehicleList("1");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,85 +131,83 @@ public class MyFragment extends BaseFragment {
|
|||||||
//执行中订单
|
//执行中订单
|
||||||
|
|
||||||
//车辆信息
|
//车辆信息
|
||||||
public void initVehicleList(boolean isSuccess) {
|
public void initVehicleList(boolean isSuccess){
|
||||||
//车辆信息
|
//车辆信息
|
||||||
List<ManyBean> list_vehicle = new ArrayList<>();
|
List<ManyBean> list_vehicle=new ArrayList<>();
|
||||||
for (CarListBean.DataDTO datum : clb.getData()) {
|
for (CarListBean.DataDTO datum : clb.getData()) {
|
||||||
list_vehicle.add(new ManyBean(datum, R.layout.my_item_vehicle));
|
list_vehicle.add(new ManyBean(datum,R.layout.my_item_vehicle));
|
||||||
}
|
}
|
||||||
if (list_vehicle.size() == 0) {
|
if(list_vehicle.size()==0){
|
||||||
list_vehicle.add(new ManyBean(new Model(), R.layout.my_item_vehicle_null));
|
list_vehicle.add(new ManyBean(new Model(),R.layout.my_item_vehicle_null));
|
||||||
}
|
}
|
||||||
brv_vehicle.creates(con, list_vehicle).setOnItemViewListener((position, o, v, layout) -> {
|
brv_vehicle.creates(con,list_vehicle).setOnItemViewListener((position, o, v, layout) -> {
|
||||||
switch (layout) {
|
switch (layout){
|
||||||
case R.layout.my_item_vehicle:
|
case R.layout.my_item_vehicle:
|
||||||
CarListBean.DataDTO cd = (CarListBean.DataDTO) o;
|
CarListBean.DataDTO cd= (CarListBean.DataDTO) o;
|
||||||
View br = v.findViewById(R.id.br);
|
View br=v.findViewById(R.id.br);
|
||||||
if (position == (clb.getData().size() - 1) && position != 2) {
|
if(position==(clb.getData().size()-1) && position!=2){
|
||||||
LinearLayout add_box = v.findViewById(R.id.add_box);
|
LinearLayout add_box=v.findViewById(R.id.add_box);
|
||||||
TextView add_no = v.findViewById(R.id.add_no);
|
TextView add_no=v.findViewById(R.id.add_no);
|
||||||
add_no.setVisibility(View.GONE);
|
add_no.setVisibility(View.GONE);
|
||||||
add_box.setVisibility(View.VISIBLE);
|
add_box.setVisibility(View.VISIBLE);
|
||||||
br.setVisibility(View.GONE);
|
br.setVisibility(View.GONE);
|
||||||
add_box.setOnClickListener(v1 -> {
|
add_box.setOnClickListener(v1 -> {
|
||||||
Intent in = new Intent(con, VehicleAuthActivity.class);
|
Intent in=new Intent(con, VehicleAuthActivity.class);
|
||||||
in.putExtra("carId", "");
|
in.putExtra("carId","");
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
v.setOnClickListener(v1 -> {
|
v.setOnClickListener(v1 -> {
|
||||||
Intent in = new Intent(con, VehicleAuthActivity.class);
|
Intent in=new Intent(con, VehicleAuthActivity.class);
|
||||||
in.putExtra("carId", cd.getCarId());
|
in.putExtra("carId",cd.getCarId());
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case R.layout.my_item_vehicle_null:
|
case R.layout.my_item_vehicle_null:
|
||||||
v.setOnClickListener(v12 -> {
|
v.setOnClickListener(v12 -> {
|
||||||
Intent in = new Intent(con, VehicleAuthActivity.class);
|
Intent in=new Intent(con, VehicleAuthActivity.class);
|
||||||
in.putExtra("carId", "");
|
in.putExtra("carId","");
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
class Model {
|
class Model{ }
|
||||||
}
|
|
||||||
|
|
||||||
public void getRequest() {
|
public void getRequest(){
|
||||||
sob = StartOrderParts.getStartOrder(con);
|
sob= StartOrderParts.getStartOrder(con);
|
||||||
ur.User();
|
ur.User();
|
||||||
ur.vehicleList("1");
|
ur.vehicleList("1");
|
||||||
}
|
}
|
||||||
|
|
||||||
private LinearLayout onGetUser, onAllOrder, onAuth, onDriverHome;
|
private LinearLayout onGetUser,onAllOrder,onAuth,onDriverHome;
|
||||||
private ImageView onContact, onOpinion, onUpdate, onSetUp;
|
private ImageView onContact,onOpinion,onUpdate,onSetUp;
|
||||||
private TextView name, phone;
|
private TextView name,phone;
|
||||||
private ImageView dang_auth, no_auth, name_auth;
|
private ImageView dang_auth,no_auth,name_auth;
|
||||||
private LinearLayout auth_box;
|
private LinearLayout auth_box;
|
||||||
private ImageView img_head;
|
private ImageView img_head;
|
||||||
|
|
||||||
public void initId() {
|
public void initId(){
|
||||||
//
|
//
|
||||||
name = root.findViewById(R.id.name);
|
name=root.findViewById(R.id.name);
|
||||||
phone = root.findViewById(R.id.phone);
|
phone=root.findViewById(R.id.phone);
|
||||||
dang_auth = root.findViewById(R.id.dang_auth);
|
dang_auth=root.findViewById(R.id.dang_auth);
|
||||||
no_auth = root.findViewById(R.id.no_auth);
|
no_auth=root.findViewById(R.id.no_auth);
|
||||||
name_auth = root.findViewById(R.id.name_auth);
|
name_auth=root.findViewById(R.id.name_auth);
|
||||||
auth_box = root.findViewById(R.id.auth_box);
|
auth_box=root.findViewById(R.id.auth_box);
|
||||||
//
|
//
|
||||||
onGetUser = root.findViewById(R.id.onGetUser);
|
onGetUser=root.findViewById(R.id.onGetUser);
|
||||||
onAllOrder = root.findViewById(R.id.onAllOrder);
|
onAllOrder=root.findViewById(R.id.onAllOrder);
|
||||||
onAuth = root.findViewById(R.id.onAuth);
|
onAuth=root.findViewById(R.id.onAuth);
|
||||||
onDriverHome = root.findViewById(R.id.onDriverHome);
|
onDriverHome=root.findViewById(R.id.onDriverHome);
|
||||||
onContact = root.findViewById(R.id.onContact);
|
onContact=root.findViewById(R.id.onContact);
|
||||||
onOpinion = root.findViewById(R.id.onOpinion);
|
onOpinion=root.findViewById(R.id.onOpinion);
|
||||||
onUpdate = root.findViewById(R.id.onUpdate);
|
onUpdate=root.findViewById(R.id.onUpdate);
|
||||||
onSetUp = root.findViewById(R.id.onSetUp);
|
onSetUp=root.findViewById(R.id.onSetUp);
|
||||||
img_head = root.findViewById(R.id.img_head);
|
img_head=root.findViewById(R.id.img_head);
|
||||||
//认证
|
//认证
|
||||||
no_auth.setOnClickListener(v -> startActivity(new Intent(con, PersonalAuthActivity.class)));
|
no_auth.setOnClickListener(v -> startActivity(new Intent(con, PersonalAuthActivity.class)));
|
||||||
//用户信息
|
//用户信息
|
||||||
@@ -224,27 +222,27 @@ public class MyFragment extends BaseFragment {
|
|||||||
.permissions(Manifest.permission.ACCESS_BACKGROUND_LOCATION)
|
.permissions(Manifest.permission.ACCESS_BACKGROUND_LOCATION)
|
||||||
.request((allGranted, grantedList, deniedList) -> {
|
.request((allGranted, grantedList, deniedList) -> {
|
||||||
if (allGranted) {
|
if (allGranted) {
|
||||||
Intent in = new Intent(con, BusinessActivity.class);
|
Intent in=new Intent(con, BusinessActivity.class);
|
||||||
in.putExtra("type", "餐饮");
|
in.putExtra("type","餐饮");
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getContext(), "请先开启定位权限", Toast.LENGTH_LONG).show();
|
Toast.makeText(getContext(),"请先开启定位权限",Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
//联系我们
|
//联系我们
|
||||||
onContact.setOnClickListener(v -> {
|
onContact.setOnClickListener(v -> {
|
||||||
String serviceMobile = "";
|
String serviceMobile="";
|
||||||
if (ConfigParts.getConfigParts(con) != null) {
|
if(ConfigParts.getConfigParts(con)!=null){
|
||||||
serviceMobile = ConfigParts.getConfigParts(con).getData().getServiceMobile();
|
serviceMobile=ConfigParts.getConfigParts(con).getData().getServiceMobile();
|
||||||
serviceMobile = StringUtil.isNull(serviceMobile, "");
|
serviceMobile=StringUtil.isNull(serviceMobile,"");
|
||||||
}
|
}
|
||||||
String[] title = {"平台客服:" + serviceMobile};
|
String[] title={"平台客服:"+serviceMobile};
|
||||||
String[] value = {serviceMobile};
|
String[] value={serviceMobile};
|
||||||
new XPopup.Builder(con)
|
new XPopup.Builder(con)
|
||||||
.isDarkTheme(false)
|
.isDarkTheme(false)
|
||||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||||
.asCenterList("请选择", title,
|
.asCenterList("请选择",title,
|
||||||
(position1, text) -> {
|
(position1, text) -> {
|
||||||
Intent intent = new Intent(Intent.ACTION_DIAL);
|
Intent intent = new Intent(Intent.ACTION_DIAL);
|
||||||
Uri data = Uri.parse("tel:" + value[position1]);
|
Uri data = Uri.parse("tel:" + value[position1]);
|
||||||
@@ -255,36 +253,36 @@ public class MyFragment extends BaseFragment {
|
|||||||
});
|
});
|
||||||
//咨询建议
|
//咨询建议
|
||||||
onOpinion.setOnClickListener(v -> {
|
onOpinion.setOnClickListener(v -> {
|
||||||
Intent in = new Intent(con, WebActivity.class);
|
Intent in=new Intent(con, WebActivity.class);
|
||||||
in.putExtra("title", "咨询建议");
|
in.putExtra("title","咨询建议");
|
||||||
in.putExtra("url", "");
|
in.putExtra("url","");
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
});
|
});
|
||||||
//检查更新
|
//检查更新
|
||||||
onUpdate.setOnClickListener(v -> Toast.makeText(con, "当前已经是最新版本", Toast.LENGTH_LONG).show());
|
onUpdate.setOnClickListener(v -> Toast.makeText(con,"当前已经是最新版本",Toast.LENGTH_LONG).show());
|
||||||
//系统设置
|
//系统设置
|
||||||
onSetUp.setOnClickListener(v -> startActivity(new Intent(con, SetupActivity.class)));
|
onSetUp.setOnClickListener(v -> startActivity(new Intent(con, SetupActivity.class)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initAuth() {
|
public void initAuth(){
|
||||||
if (userBean.getData() != null) {
|
if(userBean.getData()!=null){
|
||||||
name.setText(StringUtil.isNull(userBean.getData().getUname(), "未实名"));
|
name.setText(StringUtil.isNull(userBean.getData().getUname(),"未实名"));
|
||||||
phone.setText(StringUtil.isNull(userBean.getData().getRname(), ""));
|
phone.setText(StringUtil.isNull(userBean.getData().getRname(),""));
|
||||||
if (2 == userBean.getData().getPartyMemberStatus()) {
|
if(2==userBean.getData().getPartyMemberStatus()){
|
||||||
|
|
||||||
}
|
}
|
||||||
if ("1".equals(userBean.getData().getRealAuthentication())) {
|
if("1".equals(userBean.getData().getRealAuthentication())){
|
||||||
|
|
||||||
} else {
|
}else{
|
||||||
|
|
||||||
}
|
}
|
||||||
if (!"".equals(userBean.getData().getHeadportraitUrl())) {
|
if (!"".equals(userBean.getData().getHeadportraitUrl())){
|
||||||
Glide.with(con).load(userBean.getData().getHeadportraitUrl()).into(img_head);
|
Glide.with(con).load(userBean.getData().getHeadportraitUrl()).into(img_head);
|
||||||
}
|
}
|
||||||
if (userBean != null && 100003 == userBean.getData().getAuditStatus()) {
|
if(userBean!=null && 100003==userBean.getData().getAuditStatus()){
|
||||||
auth_box.setVisibility(View.GONE);
|
auth_box.setVisibility(View.GONE);
|
||||||
no_auth.setVisibility(View.GONE);
|
no_auth.setVisibility(View.GONE);
|
||||||
} else {
|
}else{
|
||||||
auth_box.setVisibility(View.GONE);
|
auth_box.setVisibility(View.GONE);
|
||||||
no_auth.setVisibility(View.VISIBLE);
|
no_auth.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
@@ -292,19 +290,12 @@ public class MyFragment extends BaseFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void processResult(VehicleEvent event) {
|
public void processResult(VehicleEvent event) {
|
||||||
Log.e("-msg-", event.getMessage());
|
Log.e("-msg-",event.getMessage());
|
||||||
if (!"挂".equals(event.getMessage())) {
|
if(!"挂".equals(event.getMessage())) {
|
||||||
ur.vehicleList("1");
|
ur.vehicleList("1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void refreshCarListEvent(RefreshCarListEvent event) {
|
|
||||||
Log.e("-msg-", event.getMessage());
|
|
||||||
ur.vehicleList("1");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void personResult(PersonEvent home) {
|
public void personResult(PersonEvent home) {
|
||||||
Log.e("-res-", home.getMessage());
|
Log.e("-res-", home.getMessage());
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class SetupActivity extends BaseActivity {
|
|||||||
String url2="";
|
String url2="";
|
||||||
String url3="";
|
String url3="";
|
||||||
String kefu="";
|
String kefu="";
|
||||||
private RelativeLayout r1,r2,r3,r4,r5,r6,r7,r8;
|
private RelativeLayout r1,r2,r3,r4,r5,r6,r7;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void msgMethod(Message m) {
|
public void msgMethod(Message m) {
|
||||||
@@ -73,9 +73,8 @@ 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="https://agreement.dahehuoyun.com/rule/serviceAgreement/dist/index.html#/";
|
url1="https://agreement.dahehuoyun.com/huawei/#/private";
|
||||||
// url2=cb.getData().getPrivateUrl();
|
url2=cb.getData().getPrivateUrl();
|
||||||
url2="https://agreement.dahehuoyun.com/currency/#/";
|
|
||||||
kefu=cb.getData().getServiceMobile();
|
kefu=cb.getData().getServiceMobile();
|
||||||
url3=cb.getData().getSecurityUrl();
|
url3=cb.getData().getSecurityUrl();
|
||||||
}
|
}
|
||||||
@@ -86,7 +85,6 @@ public class SetupActivity extends BaseActivity {
|
|||||||
r5=findViewById(R.id.r5);
|
r5=findViewById(R.id.r5);
|
||||||
r6=findViewById(R.id.r6);
|
r6=findViewById(R.id.r6);
|
||||||
r7=findViewById(R.id.r7);
|
r7=findViewById(R.id.r7);
|
||||||
r8=findViewById(R.id.r8);
|
|
||||||
ur=new UserRequset(con,hd);
|
ur=new UserRequset(con,hd);
|
||||||
initView(null);
|
initView(null);
|
||||||
}
|
}
|
||||||
@@ -120,12 +118,6 @@ public class SetupActivity extends BaseActivity {
|
|||||||
in.putExtra("url","https://smlt.esign.cn/hmfbZoeeGQqv");
|
in.putExtra("url","https://smlt.esign.cn/hmfbZoeeGQqv");
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
});
|
});
|
||||||
r8.setOnClickListener(v12 -> {
|
|
||||||
Intent in=new Intent(con,WebActivity.class);
|
|
||||||
in.putExtra("title","交易规则");
|
|
||||||
in.putExtra("url","https://agreement.dahehuoyun.com/rule/transactionRules/dist/index.html#/");
|
|
||||||
startActivity(in);
|
|
||||||
});
|
|
||||||
r6.setOnClickListener(v12 -> {
|
r6.setOnClickListener(v12 -> {
|
||||||
String[] title={"平台客服:"+kefu,"银行客服:95528","技术咨询:13460042961"};
|
String[] title={"平台客服:"+kefu,"银行客服:95528","技术咨询:13460042961"};
|
||||||
String[] value={kefu,"95528","13460042961"};
|
String[] value={kefu,"95528","13460042961"};
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import android.os.Bundle;
|
|||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
@@ -13,8 +12,6 @@ import android.widget.Toast;
|
|||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickHelper;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickListener;
|
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.arpa.hndahesudintocctmsdriver.R;
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
@@ -43,13 +40,13 @@ import java.util.List;
|
|||||||
* @date 2021/8/26 19:06
|
* @date 2021/8/26 19:06
|
||||||
* @description:
|
* @description:
|
||||||
*/
|
*/
|
||||||
public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClickListener {
|
public class UpBankActivity extends BaseAppCompatActivity {
|
||||||
|
|
||||||
private ImageView up_bank_img;
|
private ImageView up_bank_img;
|
||||||
private EditText bank_name, bank_number;
|
private EditText bank_name,bank_number;
|
||||||
private TextView submit;
|
private TextView submit;
|
||||||
private ImageView return_btn;
|
private ImageView return_btn;
|
||||||
public GetImageAlert gia = new GetImageAlert();
|
public GetImageAlert gia=new GetImageAlert();
|
||||||
String path;
|
String path;
|
||||||
private OCRBankBean ib;
|
private OCRBankBean ib;
|
||||||
private WalletRequest qr;
|
private WalletRequest qr;
|
||||||
@@ -58,36 +55,35 @@ public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClic
|
|||||||
@Override
|
@Override
|
||||||
public void msgMethod(Message m) {
|
public void msgMethod(Message m) {
|
||||||
super.msgMethod(m);
|
super.msgMethod(m);
|
||||||
switch (m.what) {
|
switch (m.what){
|
||||||
case RequsetCodeConstants.SUCCESS:
|
case RequsetCodeConstants.SUCCESS:
|
||||||
if (CacheGroup.cacheList.get("OCR_BANK") != null) {
|
if (CacheGroup.cacheList.get("OCR_BANK")!=null) {
|
||||||
ib = new Gson().fromJson(CacheGroup.cacheList.get("OCR_BANK"), OCRBankBean.class);
|
ib=new Gson().fromJson(CacheGroup.cacheList.get("OCR_BANK"),OCRBankBean.class);
|
||||||
if (ib.getCode() == 200) {
|
if(ib.getCode()==200){
|
||||||
initView(null);
|
initView(null);
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
WalletFragment.isInsBank = true;
|
WalletFragment.isInsBank=true;
|
||||||
} else {
|
}else{
|
||||||
Toast.makeText(con, ib.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(con,ib.getMsg(),Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove("OCR_BANK");
|
CacheGroup.cacheList.remove("OCR_BANK");
|
||||||
}
|
}
|
||||||
if (CacheGroup.cacheList.get("insBank") != null) {
|
if(CacheGroup.cacheList.get("insBank")!=null){
|
||||||
BaseBean bb = new Gson().fromJson(CacheGroup.cacheList.get("insBank"), BaseBean.class);
|
BaseBean bb=new Gson().fromJson(CacheGroup.cacheList.get("insBank"),BaseBean.class);
|
||||||
if (bb.getCode() == 200) {
|
if(bb.getCode()==200){
|
||||||
customDialog.dismiss();
|
Toast.makeText(con,"绑定成功",Toast.LENGTH_SHORT).show();
|
||||||
Toast.makeText(con, "绑定成功", Toast.LENGTH_SHORT).show();
|
|
||||||
finish();
|
finish();
|
||||||
} else {
|
}else{
|
||||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(con,bb.getMsg(),Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove("insBank");
|
CacheGroup.cacheList.remove("insBank");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ImageFileCompressUtil.COMPRESS_SUCCESS:
|
case ImageFileCompressUtil.COMPRESS_SUCCESS:
|
||||||
customDialog = new CustomDialog(con, "上传识别中...");
|
customDialog=new CustomDialog(con, "上传识别中...");
|
||||||
customDialog.show();
|
customDialog.show();
|
||||||
path = (String) m.obj;
|
path = (String) m.obj;
|
||||||
new OCRRequest().ORCBank(con, hd, new File(path));
|
new OCRRequest().ORCBank(con,hd,new File(path));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -99,18 +95,24 @@ public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClic
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
StateStyleUtil.stateTextColor(this);
|
StateStyleUtil.stateTextColor(this);
|
||||||
setContentView(R.layout.activity_bank_auth);
|
setContentView(R.layout.activity_bank_auth);
|
||||||
act = this;
|
act=this;
|
||||||
con = this;
|
con=this;
|
||||||
up_bank_img = findViewById(R.id.up_bank_img);
|
up_bank_img=findViewById(R.id.up_bank_img);
|
||||||
bank_name = findViewById(R.id.bank_name);
|
bank_name=findViewById(R.id.bank_name);
|
||||||
bank_number = findViewById(R.id.bank_number);
|
bank_number=findViewById(R.id.bank_number);
|
||||||
submit = findViewById(R.id.submit);
|
submit=findViewById(R.id.submit);
|
||||||
return_btn = findViewById(R.id.return_btn);
|
return_btn=findViewById(R.id.return_btn);
|
||||||
qr = new WalletRequest(con, hd);
|
qr=new WalletRequest(con,hd);
|
||||||
up_bank_img.setOnClickListener(v -> {
|
up_bank_img.setOnClickListener(v -> {
|
||||||
gia.showPopueWindow(this);
|
gia.showPopueWindow(this);
|
||||||
});
|
});
|
||||||
submit.setOnClickListener(new OnLimitClickHelper(this));
|
submit.setOnClickListener(v -> {
|
||||||
|
if(ib!=null){
|
||||||
|
submit();
|
||||||
|
}else{
|
||||||
|
Toast.makeText(con,"请先上传图片",Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
return_btn.setOnClickListener(v -> {
|
return_btn.setOnClickListener(v -> {
|
||||||
finish();
|
finish();
|
||||||
});
|
});
|
||||||
@@ -127,11 +129,11 @@ public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClic
|
|||||||
@Override
|
@Override
|
||||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
if (requestCode == 12 && resultCode == RESULT_OK) {
|
if (requestCode == 12 && resultCode == RESULT_OK) {
|
||||||
path = gia.getFile().getPath();
|
path=gia.getFile().getPath();
|
||||||
Log.e("图片地址:", path);
|
Log.e("图片地址:",path);
|
||||||
gia.dis();
|
gia.dis();
|
||||||
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
ImageFileCompressUtil.imageFileCompress(con,new File(path),hd);
|
||||||
} else if (requestCode == PictureConfig.CHOOSE_REQUEST && resultCode == RESULT_OK) {
|
} else if (requestCode == PictureConfig.CHOOSE_REQUEST && resultCode == RESULT_OK) {
|
||||||
List<LocalMedia> imgs = PictureSelector.obtainMultipleResult(data);
|
List<LocalMedia> imgs = PictureSelector.obtainMultipleResult(data);
|
||||||
if (imgs != null && imgs.size() > 0) {
|
if (imgs != null && imgs.size() > 0) {
|
||||||
@@ -141,43 +143,29 @@ public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClic
|
|||||||
if (TextUtils.isEmpty(paths)) {
|
if (TextUtils.isEmpty(paths)) {
|
||||||
paths = image.getPath();
|
paths = image.getPath();
|
||||||
}
|
}
|
||||||
path = paths;
|
path=paths;
|
||||||
Log.e("图片地址:", path);
|
Log.e("图片地址:",path);
|
||||||
gia.dis();
|
gia.dis();
|
||||||
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
ImageFileCompressUtil.imageFileCompress(con,new File(path),hd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void submit() {
|
public void submit(){
|
||||||
customDialog = new CustomDialog(con, "上传中,请稍后...");
|
String bankName=bank_name.getText().toString().trim();
|
||||||
customDialog.show();
|
String bankNumber=bank_number.getText().toString().trim();
|
||||||
String bankName = bank_name.getText().toString().trim();
|
if("".equals(bankName) || "".equals(bankNumber)){
|
||||||
String bankNumber = bank_number.getText().toString().trim();
|
Toast.makeText(con,"请先补充完整的银行卡信息",Toast.LENGTH_LONG).show();
|
||||||
if ("".equals(bankName) || "".equals(bankNumber)) {
|
|
||||||
Toast.makeText(con, "请先补充完整的银行卡信息", Toast.LENGTH_LONG).show();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
InsBankInputBean ibib = new InsBankInputBean();
|
InsBankInputBean ibib =new InsBankInputBean();
|
||||||
ibib.setCardNo(bankNumber);
|
ibib.setCardNo(bankNumber);
|
||||||
ibib.setCardType(Integer.parseInt(ib.getData().getBankCardType()));
|
ibib.setCardType(Integer.parseInt(ib.getData().getBankCardType()));
|
||||||
ibib.setBankName(bankName);
|
ibib.setBankName(bankName);
|
||||||
ibib.setCardUserType(1);
|
ibib.setCardUserType(1);
|
||||||
ibib.setImageId(ib.getData().getId());
|
ibib.setImageId(ib.getData().getId());
|
||||||
Log.e("-res-", new Gson().toJson(ibib));
|
Log.e("-res-",new Gson().toJson(ibib));
|
||||||
qr.insBankCard(ibib);
|
qr.insBankCard(ibib);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
switch (view.getId()) {
|
|
||||||
case R.id.submit:
|
|
||||||
if (ib != null) {
|
|
||||||
submit();
|
|
||||||
} else {
|
|
||||||
Toast.makeText(con, "请先上传图片", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -231,7 +231,6 @@ public class WalletFragment extends BaseFragment{
|
|||||||
bank_remove.setVisibility(View.VISIBLE);
|
bank_remove.setVisibility(View.VISIBLE);
|
||||||
} else{
|
} else{
|
||||||
bank_number.setVisibility(View.GONE);
|
bank_number.setVisibility(View.GONE);
|
||||||
bank_title_1.setText("未添加银行卡");
|
|
||||||
bank_add.setVisibility(View.VISIBLE);
|
bank_add.setVisibility(View.VISIBLE);
|
||||||
bank_remove.setVisibility(View.GONE);
|
bank_remove.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,12 +5,9 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.net.http.SslError;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.webkit.JavascriptInterface;
|
import android.webkit.JavascriptInterface;
|
||||||
import android.webkit.SslErrorHandler;
|
|
||||||
import android.webkit.WebResourceRequest;
|
import android.webkit.WebResourceRequest;
|
||||||
import android.webkit.WebSettings;
|
import android.webkit.WebSettings;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
@@ -84,11 +81,6 @@ public class WebActivity extends BaseActivity {
|
|||||||
webSettings.setJavaScriptEnabled(true);
|
webSettings.setJavaScriptEnabled(true);
|
||||||
webSettings.setDomStorageEnabled(true);
|
webSettings.setDomStorageEnabled(true);
|
||||||
webSettings.setDefaultTextEncodingName("utf-8");
|
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");
|
wv.addJavascriptInterface(new JavaScriptObject(con), "webObj");
|
||||||
//PaxWebChromeClient chromeClient=new PaxWebChromeClient();
|
//PaxWebChromeClient chromeClient=new PaxWebChromeClient();
|
||||||
//WebView加载web资源
|
//WebView加载web资源
|
||||||
@@ -119,12 +111,6 @@ public class WebActivity extends BaseActivity {
|
|||||||
wv.loadUrl(url);
|
wv.loadUrl(url);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
|
|
||||||
super.onReceivedSslError(view, handler, error);
|
|
||||||
handler.proceed();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
wv.setWebChromeClient(chromeClient);
|
wv.setWebChromeClient(chromeClient);
|
||||||
wv.loadUrl(url);
|
wv.loadUrl(url);
|
||||||
@@ -163,12 +149,6 @@ public class WebActivity extends BaseActivity {
|
|||||||
view.loadUrl(url);
|
view.loadUrl(url);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
|
|
||||||
super.onReceivedSslError(view, handler, error);
|
|
||||||
handler.proceed();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.arpa.hndahesudintocctmsdriver.util.http;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.app.VersionUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.app.VersionUtil;
|
||||||
import com.dahe.mylibrary.utils.AppUtils;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
@@ -42,7 +41,6 @@ public class OkHttpUtil {
|
|||||||
.post(body)
|
.post(body)
|
||||||
.headers(hb.build())
|
.headers(hb.build())
|
||||||
.addHeader("Version", VersionUtil.getVersion(con))
|
.addHeader("Version", VersionUtil.getVersion(con))
|
||||||
.addHeader("VersionCode",String.valueOf(AppUtils.getAppVersionCode()))
|
|
||||||
//.addHeader("sign",sign)
|
//.addHeader("sign",sign)
|
||||||
.removeHeader("User-Agent")
|
.removeHeader("User-Agent")
|
||||||
.addHeader("User-Agent",GetUtil.getUserAgent(con))
|
.addHeader("User-Agent",GetUtil.getUserAgent(con))
|
||||||
@@ -73,40 +71,6 @@ public class OkHttpUtil {
|
|||||||
.addHeader("Authorization", token)
|
.addHeader("Authorization", token)
|
||||||
.addHeader("Content-Type", "application/json")
|
.addHeader("Content-Type", "application/json")
|
||||||
.addHeader("Version", VersionUtil.getVersion(con))
|
.addHeader("Version", VersionUtil.getVersion(con))
|
||||||
.addHeader("VersionCode",String.valueOf(AppUtils.getAppVersionCode()))
|
|
||||||
//.addHeader("sign",sign)
|
|
||||||
.removeHeader("User-Agent")
|
|
||||||
.addHeader("User-Agent",GetUtil.getUserAgent(con))
|
|
||||||
.build();
|
|
||||||
return request;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Request put(OkDate od, Context con){
|
|
||||||
MediaType mediaType = MediaType.parse("application/json");
|
|
||||||
if(od.getMadiaType()!=null && od.getMadiaType().equals("")){
|
|
||||||
od.setMadiaType("{}");
|
|
||||||
}
|
|
||||||
// JSONObject jsonObject = JSON.parseObject(od.getMadiaType());
|
|
||||||
// jsonObject.put("timestamp", DateUtil.current());
|
|
||||||
// jsonObject.put("deviceId", GetUtil.getDeviceId(con));
|
|
||||||
// String sign = SecureUtil.signParamsSha1(jsonObject,SIGN_PASSWORD);
|
|
||||||
// Log.e("jsonObject",jsonObject.toString());
|
|
||||||
// Log.e("sign",sign);
|
|
||||||
// Map<String,Object> map=new HashMap<>();
|
|
||||||
// map.put("data",SecurityUtil.encrypt(jsonObject.toString()));
|
|
||||||
// Log.e("参数1",od.getMadiaType());
|
|
||||||
// Log.e("参数2",MapUtil.mapJson(map));
|
|
||||||
//MapUtil.mapJson(map)
|
|
||||||
RequestBody body = RequestBody.create(mediaType,od.getMadiaType());
|
|
||||||
Headers.Builder hb=new Headers.Builder();
|
|
||||||
hb.add("Content-Type","application/json");
|
|
||||||
hb.add("Cache-Control","no-cache");
|
|
||||||
Request request = new Request.Builder()
|
|
||||||
.url(od.getUrl())
|
|
||||||
.put(body)
|
|
||||||
.headers(hb.build())
|
|
||||||
.addHeader("Version", VersionUtil.getVersion(con))
|
|
||||||
.addHeader("VersionCode",String.valueOf(AppUtils.getAppVersionCode()))
|
|
||||||
//.addHeader("sign",sign)
|
//.addHeader("sign",sign)
|
||||||
.removeHeader("User-Agent")
|
.removeHeader("User-Agent")
|
||||||
.addHeader("User-Agent",GetUtil.getUserAgent(con))
|
.addHeader("User-Agent",GetUtil.getUserAgent(con))
|
||||||
@@ -122,7 +86,6 @@ public class OkHttpUtil {
|
|||||||
.url(od.getUrl())
|
.url(od.getUrl())
|
||||||
.get()
|
.get()
|
||||||
.headers(hb.build())
|
.headers(hb.build())
|
||||||
.addHeader("VersionCode",String.valueOf(AppUtils.getAppVersionCode()))
|
|
||||||
.build();
|
.build();
|
||||||
return request;
|
return request;
|
||||||
}
|
}
|
||||||
@@ -136,7 +99,6 @@ public class OkHttpUtil {
|
|||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.url(od.getUrl())
|
.url(od.getUrl())
|
||||||
.addHeader("Authorization", token)
|
.addHeader("Authorization", token)
|
||||||
.addHeader("VersionCode",String.valueOf(AppUtils.getAppVersionCode()))
|
|
||||||
.get()
|
.get()
|
||||||
.headers(hb.build())
|
.headers(hb.build())
|
||||||
.build();
|
.build();
|
||||||
@@ -167,7 +129,6 @@ public class OkHttpUtil {
|
|||||||
.url(od.getUrl())
|
.url(od.getUrl())
|
||||||
.method("POST", body)
|
.method("POST", body)
|
||||||
.addHeader("Authorization", token)
|
.addHeader("Authorization", token)
|
||||||
.addHeader("VersionCode",String.valueOf(AppUtils.getAppVersionCode()))
|
|
||||||
.addHeader("Cookie", "JSESSIONID=NqpqKQstwceQurcNK5hjl4GnTgiF4eSzZSo5a1rz")
|
.addHeader("Cookie", "JSESSIONID=NqpqKQstwceQurcNK5hjl4GnTgiF4eSzZSo5a1rz")
|
||||||
.build();
|
.build();
|
||||||
return request;
|
return request;
|
||||||
@@ -184,26 +145,23 @@ public class OkHttpUtil {
|
|||||||
.url(od.getUrl())
|
.url(od.getUrl())
|
||||||
.method("POST", body)
|
.method("POST", body)
|
||||||
.addHeader("Authorization", token)
|
.addHeader("Authorization", token)
|
||||||
.addHeader("VersionCode",String.valueOf(AppUtils.getAppVersionCode()))
|
|
||||||
.addHeader("Cookie", "JSESSIONID=NqpqKQstwceQurcNK5hjl4GnTgiF4eSzZSo5a1rz")
|
.addHeader("Cookie", "JSESSIONID=NqpqKQstwceQurcNK5hjl4GnTgiF4eSzZSo5a1rz")
|
||||||
.build();
|
.build();
|
||||||
return request;
|
return request;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Request postFiles(OkDate od,File file,String token,String carId,String carNum,boolean isSave) {
|
public static Request postFiles(OkDate od,File file,String token,String carId,String carNum) {
|
||||||
MediaType mediaType = MediaType.parse("text/plain");
|
MediaType mediaType = MediaType.parse("text/plain");
|
||||||
RequestBody body = new MultipartBody.Builder()
|
RequestBody body = new MultipartBody.Builder()
|
||||||
.setType(MultipartBody.FORM)
|
.setType(MultipartBody.FORM)
|
||||||
.addFormDataPart("file",file.getPath(),RequestBody.create(MediaType.parse("application/octet-stream"), file))
|
.addFormDataPart("file",file.getPath(),RequestBody.create(MediaType.parse("application/octet-stream"), file))
|
||||||
.addFormDataPart("carId",carId)
|
.addFormDataPart("carId",carId)
|
||||||
.addFormDataPart("carNum",carNum)
|
.addFormDataPart("carNum",carNum)
|
||||||
.addFormDataPart("isSave",isSave?"0":"1")
|
|
||||||
.build();
|
.build();
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.url(od.getUrl())
|
.url(od.getUrl())
|
||||||
.method("POST", body)
|
.method("POST", body)
|
||||||
.addHeader("Authorization", token)
|
.addHeader("Authorization", token)
|
||||||
.addHeader("VersionCode",String.valueOf(AppUtils.getAppVersionCode()))
|
|
||||||
.addHeader("Cookie", "JSESSIONID=NqpqKQstwceQurcNK5hjl4GnTgiF4eSzZSo5a1rz")
|
.addHeader("Cookie", "JSESSIONID=NqpqKQstwceQurcNK5hjl4GnTgiF4eSzZSo5a1rz")
|
||||||
.build();
|
.build();
|
||||||
return request;
|
return request;
|
||||||
|
|||||||
@@ -31,23 +31,23 @@ public class GetCarImageAlert {
|
|||||||
PopupWindow popupWindow;
|
PopupWindow popupWindow;
|
||||||
ImageView img;
|
ImageView img;
|
||||||
|
|
||||||
public void showPopueWindow(AppCompatActivity act,boolean key){
|
public void showPopueWindow(AppCompatActivity act, boolean key) {
|
||||||
View popView = View.inflate(act, R.layout.choice_car_timg,null);
|
View popView = View.inflate(act, R.layout.choice_car_timg, null);
|
||||||
Button btn_xiangce =popView.findViewById(R.id.btn_xiangce);
|
Button btn_xiangce = popView.findViewById(R.id.btn_xiangce);
|
||||||
Button btn_paizhao = popView.findViewById(R.id.btn_paizhao);
|
Button btn_paizhao = popView.findViewById(R.id.btn_paizhao);
|
||||||
Button btn_quxiao = popView.findViewById(R.id.btn_quxiao);
|
Button btn_quxiao = popView.findViewById(R.id.btn_quxiao);
|
||||||
View v_1=popView.findViewById(R.id.v_1);
|
View v_1 = popView.findViewById(R.id.v_1);
|
||||||
TextView tv_ts=popView.findViewById(R.id.tv_ts);
|
TextView tv_ts = popView.findViewById(R.id.tv_ts);
|
||||||
img=popView.findViewById(R.id.img);
|
img = popView.findViewById(R.id.img);
|
||||||
//获取屏幕宽高
|
//获取屏幕宽高
|
||||||
int weight =act.getResources().getDisplayMetrics().widthPixels;
|
int weight = act.getResources().getDisplayMetrics().widthPixels;
|
||||||
int height = act.getResources().getDisplayMetrics().heightPixels*2/3;
|
int height = act.getResources().getDisplayMetrics().heightPixels * 2 / 3;
|
||||||
popupWindow = new PopupWindow(popView,weight,height);
|
popupWindow = new PopupWindow(popView, weight, height);
|
||||||
//popupWindow.setAnimationStyle(R.style.anim_popup_dir);
|
//popupWindow.setAnimationStyle(R.style.anim_popup_dir);
|
||||||
popupWindow.setFocusable(true);
|
popupWindow.setFocusable(true);
|
||||||
//点击外部popueWindow消失
|
//点击外部popueWindow消失
|
||||||
popupWindow.setOutsideTouchable(true);
|
popupWindow.setOutsideTouchable(true);
|
||||||
if(key){
|
if (key) {
|
||||||
btn_xiangce.setVisibility(View.VISIBLE);
|
btn_xiangce.setVisibility(View.VISIBLE);
|
||||||
img.setImageResource(R.drawable.huidan);
|
img.setImageResource(R.drawable.huidan);
|
||||||
tv_ts.setText("请按照如图所示拍摄回单照片,回单照片必须保持清晰完整,能看清具体吨数,便于结算运费时核查,感谢配合。");
|
tv_ts.setText("请按照如图所示拍摄回单照片,回单照片必须保持清晰完整,能看清具体吨数,便于结算运费时核查,感谢配合。");
|
||||||
@@ -55,31 +55,41 @@ public class GetCarImageAlert {
|
|||||||
//请按照如图所示拍摄回单照片,回单照片必须保持清晰完整,能看清具体吨数,便于结算运费时核查,感谢配合。
|
//请按照如图所示拍摄回单照片,回单照片必须保持清晰完整,能看清具体吨数,便于结算运费时核查,感谢配合。
|
||||||
}
|
}
|
||||||
btn_xiangce.setOnClickListener(v -> {
|
btn_xiangce.setOnClickListener(v -> {
|
||||||
PermissionX.init(act)
|
try {
|
||||||
.permissions(Manifest.permission.READ_EXTERNAL_STORAGE)
|
PermissionX.init(act)
|
||||||
.request((allGranted, grantedList, deniedList) -> {
|
.permissions(Manifest.permission.READ_EXTERNAL_STORAGE)
|
||||||
if (allGranted) {
|
.request((allGranted, grantedList, deniedList) -> {
|
||||||
PicturlUtil.selectPicter(act, new ArrayList<>(), 1);
|
if (allGranted) {
|
||||||
} else {
|
PicturlUtil.selectPicter(act, new ArrayList<>(), 1);
|
||||||
Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
} else {
|
||||||
}
|
Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
} catch (Exception e) {
|
||||||
|
Toast.makeText(act.getBaseContext(), "程序出现问题了,请重新登录后重试!!!", Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
btn_paizhao.setOnClickListener(v -> {
|
btn_paizhao.setOnClickListener(v -> {
|
||||||
PermissionX.init(act)
|
try{
|
||||||
.permissions(Manifest.permission.CAMERA)
|
PermissionX.init(act)
|
||||||
.request((allGranted, grantedList, deniedList) -> {
|
.permissions(Manifest.permission.CAMERA)
|
||||||
if (allGranted) {
|
.request((allGranted, grantedList, deniedList) -> {
|
||||||
openCam(act);
|
if (allGranted) {
|
||||||
|
openCam(act);
|
||||||
// file=ImageGetUtil.createImageFile(act);
|
// file=ImageGetUtil.createImageFile(act);
|
||||||
// ImageGetUtil.cameraAlbumGetImage(act,file);
|
// ImageGetUtil.cameraAlbumGetImage(act,file);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}catch (Exception e){
|
||||||
|
Toast.makeText(act.getBaseContext(), "程序出现问题了,请重新登录后重试!!!", Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
img.setOnClickListener(v -> {
|
img.setOnClickListener(v -> {
|
||||||
if (!key){
|
if (!key) {
|
||||||
PermissionX.init(act)
|
PermissionX.init(act)
|
||||||
.permissions(Manifest.permission.CAMERA)
|
.permissions(Manifest.permission.CAMERA)
|
||||||
.request((allGranted, grantedList, deniedList) -> {
|
.request((allGranted, grantedList, deniedList) -> {
|
||||||
@@ -102,22 +112,22 @@ public class GetCarImageAlert {
|
|||||||
WindowManager.LayoutParams lp = act.getWindow().getAttributes();
|
WindowManager.LayoutParams lp = act.getWindow().getAttributes();
|
||||||
lp.alpha = 0.5f;
|
lp.alpha = 0.5f;
|
||||||
act.getWindow().setAttributes(lp);
|
act.getWindow().setAttributes(lp);
|
||||||
popupWindow.showAtLocation(popView, Gravity.BOTTOM,0,50);
|
popupWindow.showAtLocation(popView, Gravity.BOTTOM, 0, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
public File getFile() {
|
public File getFile() {
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dis(){
|
public void dis() {
|
||||||
popupWindow.dismiss();
|
popupWindow.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void openCam(AppCompatActivity act){
|
private void openCam(AppCompatActivity act) {
|
||||||
file=ImageGetUtil.createImageFile(act);
|
file = ImageGetUtil.createImageFile(act);
|
||||||
if (file!=null){
|
if (file != null) {
|
||||||
ImageGetUtil.cameraAlbumGetImage(act,file);
|
ImageGetUtil.cameraAlbumGetImage(act, file);
|
||||||
}else{
|
} else {
|
||||||
Toast.makeText(act.getBaseContext(), "路径创建失败,请清除缓存后重试", Toast.LENGTH_LONG).show();
|
Toast.makeText(act.getBaseContext(), "路径创建失败,请清除缓存后重试", Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import android.provider.MediaStore;
|
|||||||
|
|
||||||
import androidx.core.content.FileProvider;
|
import androidx.core.content.FileProvider;
|
||||||
|
|
||||||
import com.dahe.mylibrary.utils.AppUtils;
|
import com.sdk.base.framework.utils.app.AppUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -41,7 +41,7 @@ public class ImageGetUtil {
|
|||||||
if(imageFile!=null){
|
if(imageFile!=null){
|
||||||
if(Build.VERSION.SDK_INT>= Build.VERSION_CODES.N){
|
if(Build.VERSION.SDK_INT>= Build.VERSION_CODES.N){
|
||||||
/*7.0以上要通过FileProvider将File转化为Uri*/
|
/*7.0以上要通过FileProvider将File转化为Uri*/
|
||||||
uri = FileProvider.getUriForFile(act.getApplicationContext(), AppUtils.getAppPackageName()+".fileprovider",imageFile);
|
uri = FileProvider.getUriForFile(act.getApplicationContext(), AppUtils.getPackageName()+".fileprovider",imageFile);
|
||||||
}else {
|
}else {
|
||||||
/*7.0以下则直接使用Uri的fromFile方法将File转化为Uri*/
|
/*7.0以下则直接使用Uri的fromFile方法将File转化为Uri*/
|
||||||
uri = Uri.fromFile(imageFile);
|
uri = Uri.fromFile(imageFile);
|
||||||
|
|||||||
@@ -1,101 +0,0 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.util.location;
|
|
||||||
|
|
||||||
import static com.arpa.hndahesudintocctmsdriver.util.location.LocationGDUtil.RES;
|
|
||||||
|
|
||||||
import android.Manifest;
|
|
||||||
import android.content.Context;
|
|
||||||
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.os.Handler;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.core.app.ActivityCompat;
|
|
||||||
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.msg.MsgUtil;
|
|
||||||
import com.dahe.mylibrary.utils.ToastUtils;
|
|
||||||
import com.google.gson.Gson;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Locale;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName LocationManagerUtil
|
|
||||||
* @Author john
|
|
||||||
* @Date 2024/7/25 15:21
|
|
||||||
* @Description LocationManager本地定位
|
|
||||||
*/
|
|
||||||
public class LocationManagerUtil {
|
|
||||||
|
|
||||||
public static LocationManagerUtil mInstance = null;
|
|
||||||
|
|
||||||
public static LocationManagerUtil getInstance() {
|
|
||||||
if (null == mInstance) {
|
|
||||||
synchronized (LocationManagerUtil.class) {
|
|
||||||
if (null == mInstance) {
|
|
||||||
mInstance = new LocationManagerUtil();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return mInstance;
|
|
||||||
}
|
|
||||||
|
|
||||||
private LocationManagerUtil() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void getLocation(Context ctx, Handler hd) {
|
|
||||||
LocationManager locationManager = (LocationManager) ctx.getSystemService(Context.LOCATION_SERVICE);
|
|
||||||
|
|
||||||
//创建定位条件器
|
|
||||||
Criteria criteria = new Criteria();
|
|
||||||
//设置精度,Criteria.ACCURACY_FINE表示精确,Criteria.ACCURACY_COARSE表示粗略
|
|
||||||
criteria.setAccuracy(Criteria.ACCURACY_FINE);
|
|
||||||
//设置是否需要海拔信息
|
|
||||||
criteria.setAltitudeRequired(true);
|
|
||||||
//设置是否需要方位信息
|
|
||||||
criteria.setBearingRequired(true);
|
|
||||||
//设置是否允许运营商扣费
|
|
||||||
criteria.setCostAllowed(true);
|
|
||||||
//设置对电源的需求
|
|
||||||
criteria.setPowerRequirement(Criteria.POWER_LOW);
|
|
||||||
|
|
||||||
String bestProvider = locationManager.getBestProvider(criteria, true);
|
|
||||||
if (bestProvider != null) {
|
|
||||||
if (ActivityCompat.checkSelfPermission(ctx, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(ctx, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
|
||||||
ToastUtils.showToast(ctx, "请查看定位权限");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
locationManager.requestLocationUpdates(bestProvider, 300, 0, new LocationListener() {
|
|
||||||
@Override
|
|
||||||
public void onLocationChanged(@NonNull Location location) {
|
|
||||||
try {
|
|
||||||
Geocoder geocoder = new Geocoder(ctx, Locale.getDefault());
|
|
||||||
List<Address> fromLocation = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 1);
|
|
||||||
if (fromLocation != null && !fromLocation.isEmpty()) {
|
|
||||||
Address address = fromLocation.get(0);
|
|
||||||
String addressLine = address.getAddressLine(0);
|
|
||||||
String adminArea = address.getAdminArea();//省
|
|
||||||
String locality = address.getLocality();//市
|
|
||||||
String subLocality = address.getSubLocality();//县
|
|
||||||
String featureName = address.getFeatureName();//详细地址
|
|
||||||
CacheGroup.cacheList.put("getLocation", new Gson().toJson(address));
|
|
||||||
MsgUtil.addHdMsgWat(hd, RES);
|
|
||||||
locationManager.removeUpdates(this);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
ToastUtils.showToast(ctx, "定位失败,请查看定位权限");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.weight;
|
|
||||||
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
|
||||||
import com.dahe.mylibrary.utils.ToastUtils;
|
|
||||||
|
|
||||||
import java.util.Calendar;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName OnLimitClickHelper
|
|
||||||
* @Author john
|
|
||||||
* @Date 2024/4/22 14:28
|
|
||||||
* @Description TODO
|
|
||||||
*/
|
|
||||||
public class OnLimitClickHelper implements View.OnClickListener {
|
|
||||||
public static final int LIMIT_TIME = 2000;
|
|
||||||
private long lastClickTime = 0;
|
|
||||||
private OnLimitClickListener onLimitClickListener = null;
|
|
||||||
|
|
||||||
public OnLimitClickHelper(OnLimitClickListener onLimitClickListener){
|
|
||||||
this.onLimitClickListener = onLimitClickListener;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
long curTime = Calendar.getInstance().getTimeInMillis();
|
|
||||||
if (curTime - lastClickTime > LIMIT_TIME) {
|
|
||||||
lastClickTime = curTime;
|
|
||||||
if(onLimitClickListener != null){
|
|
||||||
onLimitClickListener.onClick(v);
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
ToastUtils.showToast(v.getContext(),"点击速度过快,请稍后重试");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.weight;
|
|
||||||
|
|
||||||
import android.view.View;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName OnLimitClickListener
|
|
||||||
* @Author john
|
|
||||||
* @Date 2024/4/22 14:28
|
|
||||||
* @Description TODO
|
|
||||||
*/
|
|
||||||
public interface OnLimitClickListener {
|
|
||||||
/**
|
|
||||||
* 按钮点击事件
|
|
||||||
* @param view
|
|
||||||
*/
|
|
||||||
void onClick(View view);
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 426 KiB |
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<item android:drawable="@drawable/read_select" android:state_checked="true"></item>
|
|
||||||
<item android:drawable="@drawable/read_nor" android:state_checked="false"></item>
|
|
||||||
<item android:drawable="@drawable/read_nor"></item>
|
|
||||||
</selector>
|
|
||||||
@@ -163,20 +163,20 @@
|
|||||||
android:textColor="#ffc4c4ce"
|
android:textColor="#ffc4c4ce"
|
||||||
android:textSize="@dimen/sp_13"
|
android:textSize="@dimen/sp_13"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/value2"
|
android:id="@+id/value2"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentRight="true"
|
android:textColor="#ff999999"
|
||||||
android:layout_marginLeft="@dimen/dp_30"
|
android:textSize="@dimen/sp_13"
|
||||||
android:background="@null"
|
android:maxLines="1"
|
||||||
|
android:hint="点击进行手动输入"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:gravity="right"
|
android:gravity="right"
|
||||||
android:hint="点击进行手动输入"
|
android:layout_marginLeft="@dimen/dp_30"
|
||||||
android:maxLines="1"
|
android:background="@null"
|
||||||
android:textColor="#ff999999"
|
/>
|
||||||
android:textSize="@dimen/sp_13" />
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<TextView
|
<TextView
|
||||||
|
|||||||
@@ -382,38 +382,5 @@
|
|||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/r8"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_marginTop="@dimen/dp_20"
|
|
||||||
android:layout_marginBottom="@dimen/dp_20"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="交强险保单"
|
|
||||||
android:textColor="#ff000000"
|
|
||||||
android:textSize="@dimen/sp_15"
|
|
||||||
/>
|
|
||||||
</LinearLayout>
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="@dimen/dp_6"
|
|
||||||
android:layout_height="@dimen/dp_10"
|
|
||||||
android:src="@mipmap/chevron"
|
|
||||||
android:scaleType="fitXY"
|
|
||||||
android:background="@null"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_centerVertical="true"/>
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="@dimen/dp_2"
|
|
||||||
android:background="#F6F6F9"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
@@ -104,15 +104,35 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
<CheckBox
|
android:padding="@dimen/dp_7"
|
||||||
android:layout_marginTop="@dimen/dp_3"
|
android:layout_marginTop="@dimen/dp_2"
|
||||||
android:id="@+id/cb"
|
android:layout_width="@dimen/dp_14"
|
||||||
android:layout_width="@dimen/dp_28"
|
android:layout_height="@dimen/dp_14"
|
||||||
android:layout_height="@dimen/dp_34"
|
app:cardCornerRadius="@dimen/dp_7"
|
||||||
android:button="@null"
|
app:cardBackgroundColor="@color/theme_color"
|
||||||
android:checked="false"
|
app:cardElevation="@dimen/dp_0">
|
||||||
android:drawableStart="@drawable/select_read"/>
|
<androidx.cardview.widget.CardView
|
||||||
|
android:padding="@dimen/dp_7"
|
||||||
|
android:id="@+id/no_btn"
|
||||||
|
android:layout_width="@dimen/dp_12"
|
||||||
|
android:layout_height="@dimen/dp_12"
|
||||||
|
app:cardCornerRadius="@dimen/dp_6"
|
||||||
|
app:cardBackgroundColor="#fff"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
app:cardElevation="@dimen/dp_0">
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/agree_btn"
|
||||||
|
android:layout_width="@dimen/dp_14"
|
||||||
|
android:layout_height="@dimen/dp_14"
|
||||||
|
android:src="@mipmap/choice"
|
||||||
|
android:scaleType="fitXY"
|
||||||
|
android:background="#fff"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:visibility="gone"
|
||||||
|
/>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_content"
|
android:id="@+id/tv_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
android:id="@+id/zjimg_name"
|
android:id="@+id/zjimg_name"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dp_16"
|
android:layout_marginTop="@dimen/dp_19"
|
||||||
android:text="从业资格证照片"
|
android:text="从业资格证照片"
|
||||||
android:textColor="#ff333333"
|
android:textColor="#ff333333"
|
||||||
android:textSize="@dimen/sp_15" />
|
android:textSize="@dimen/sp_15" />
|
||||||
@@ -91,7 +91,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_marginBottom="@dimen/dp_16"
|
android:layout_marginBottom="@dimen/dp_19"
|
||||||
android:text="点击上传图片"
|
android:text="点击上传图片"
|
||||||
android:textColor="@color/theme_color"
|
android:textColor="@color/theme_color"
|
||||||
android:textSize="@dimen/sp_15" />
|
android:textSize="@dimen/sp_15" />
|
||||||
@@ -100,7 +100,7 @@
|
|||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:visibility="gone"
|
||||||
android:id="@+id/llInfo"
|
android:id="@+id/llInfo"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -137,8 +137,6 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="@dimen/dp_14">
|
android:padding="@dimen/dp_14">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/cow1"
|
android:id="@+id/cow1"
|
||||||
|
|
||||||
@@ -164,55 +162,10 @@
|
|||||||
android:gravity="right"
|
android:gravity="right"
|
||||||
android:hint="点击进行手动输入"
|
android:hint="点击进行手动输入"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:singleLine="true"
|
|
||||||
android:textColor="#ff999999"
|
android:textColor="#ff999999"
|
||||||
android:textSize="@dimen/sp_13" />
|
android:textSize="@dimen/sp_13" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/llDate"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
>
|
|
||||||
<View
|
|
||||||
android:layout_marginTop="@dimen/dp_10"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="@dimen/dp_1"
|
|
||||||
android:background="@drawable/bottom_xu"/>
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/rlDate"
|
|
||||||
android:layout_marginTop="@dimen/dp_10"
|
|
||||||
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/name2"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="截止日期"
|
|
||||||
android:textColor="#ffc4c4ce"
|
|
||||||
android:textSize="@dimen/sp_13"
|
|
||||||
/>
|
|
||||||
<TextView
|
|
||||||
android:layout_toRightOf="@+id/name2"
|
|
||||||
android:id="@+id/value2"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textColor="#ff999999"
|
|
||||||
android:textSize="@dimen/sp_13"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:hint="请选择截止日期"
|
|
||||||
android:gravity="right"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:layout_marginLeft="@dimen/dp_10"
|
|
||||||
/>
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -4,12 +4,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
<!-- <com.amap.api.maps.MapView-->
|
<com.amap.api.maps.MapView
|
||||||
<!-- android:id="@+id/map"-->
|
|
||||||
<!-- android:layout_width="match_parent"-->
|
|
||||||
<!-- android:layout_height="match_parent"/>-->
|
|
||||||
|
|
||||||
<com.lk.mapsdk.map.mapapi.map.MapView
|
|
||||||
android:id="@+id/map"
|
android:id="@+id/map"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"/>
|
android:layout_height="match_parent"/>
|
||||||
|
|||||||
@@ -46,7 +46,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:visibility="gone">
|
android:visibility="gone"
|
||||||
|
>
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:id="@+id/btn_news"
|
android:id="@+id/btn_news"
|
||||||
|
|||||||
@@ -103,7 +103,6 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="@dimen/dp_30"
|
android:layout_marginLeft="@dimen/dp_30"
|
||||||
@@ -132,7 +131,6 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="@dimen/dp_30"
|
android:layout_marginLeft="@dimen/dp_30"
|
||||||
|
|||||||
@@ -146,35 +146,6 @@
|
|||||||
android:src="@mipmap/chevron" />
|
android:src="@mipmap/chevron" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="@dimen/dp_2"
|
|
||||||
android:background="#F6F6F9" />
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/r8"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingTop="@dimen/dp_20"
|
|
||||||
android:paddingBottom="@dimen/dp_20">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="交易规则"
|
|
||||||
android:textColor="#ff000000"
|
|
||||||
android:textSize="@dimen/sp_15" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="@dimen/dp_4"
|
|
||||||
android:layout_height="@dimen/dp_8"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:background="@null"
|
|
||||||
android:scaleType="fitXY"
|
|
||||||
android:src="@mipmap/chevron" />
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/dp_2"
|
android:layout_height="@dimen/dp_2"
|
||||||
@@ -304,19 +275,11 @@
|
|||||||
android:scaleType="fitXY"
|
android:scaleType="fitXY"
|
||||||
android:src="@mipmap/chevron" />
|
android:src="@mipmap/chevron" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/dp_2"
|
android:layout_height="@dimen/dp_2"
|
||||||
android:background="#F6F6F9" />
|
android:background="#F6F6F9" />
|
||||||
<TextView
|
|
||||||
android:layout_marginTop="@dimen/dp_20"
|
|
||||||
android:gravity="center"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="ICP备案号:豫ICP备09025418号-24A"
|
|
||||||
/>
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 606 KiB |
@@ -19,7 +19,6 @@ import com.alct.mdp.callback.OnResultListener;
|
|||||||
import com.alct.mdp.model.Goods;
|
import com.alct.mdp.model.Goods;
|
||||||
import com.alct.mdp.model.Image;
|
import com.alct.mdp.model.Image;
|
||||||
import com.alct.mdp.model.Location;
|
import com.alct.mdp.model.Location;
|
||||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
|
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.report.ALProcess;
|
import com.arpa.hndahesudintocctmsdriver.report.ALProcess;
|
||||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||||
@@ -94,15 +93,11 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
switch (m.what) {
|
switch (m.what) {
|
||||||
case RequsetCodeConstants.SUCCESS:
|
case RequsetCodeConstants.SUCCESS:
|
||||||
if (CacheGroup.cacheList.get("upload") != null) {
|
if (CacheGroup.cacheList.get("upload") != null) {
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
|
||||||
customDialog.dismiss();
|
|
||||||
}
|
|
||||||
Log.e("upload", CacheGroup.cacheList.get("upload"));
|
Log.e("upload", CacheGroup.cacheList.get("upload"));
|
||||||
ub = gson.fromJson(CacheGroup.cacheList.remove("upload"), UploadBean.class);
|
ub = gson.fromJson(CacheGroup.cacheList.remove("upload"), UploadBean.class);
|
||||||
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);
|
|
||||||
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);
|
||||||
@@ -117,10 +112,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]), BaseBean.class);
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]), BaseBean.class);
|
||||||
if (bb.getCode() == 200) {
|
if (bb.getCode() == 200) {
|
||||||
if (index == 2) {
|
if (index == 2) {
|
||||||
if (!keys) {//装货回单
|
if (!keys){//装货回单
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
|
||||||
customDialog.dismiss();
|
|
||||||
}
|
|
||||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
@@ -156,9 +148,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
hyr.uploadFile(new File(path));
|
hyr.uploadFile(new File(path));
|
||||||
}
|
}
|
||||||
} else {//识别失败后返回code500
|
} else {//识别失败后返回code500
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
|
||||||
customDialog.dismiss();
|
|
||||||
}
|
|
||||||
if (index == 0) {//装卸货车辆需要识别车牌号){
|
if (index == 0) {//装卸货车辆需要识别车牌号){
|
||||||
Toast.makeText(con, "装货照片包含车牌号、三分之二车身或者装卸货场景。", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "装货照片包含车牌号、三分之二车身或者装卸货场景。", Toast.LENGTH_SHORT).show();
|
||||||
} else if (index == 1) {
|
} else if (index == 1) {
|
||||||
@@ -171,7 +160,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
break;
|
break;
|
||||||
case 14://定位成功
|
case 14://定位成功
|
||||||
locationKey = true;
|
locationKey = true;
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
}
|
}
|
||||||
tv_loaction.setText("定位成功");
|
tv_loaction.setText("定位成功");
|
||||||
@@ -181,7 +170,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
break;
|
break;
|
||||||
case 16://定位失败
|
case 16://定位失败
|
||||||
locationKey = false;
|
locationKey = false;
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
}
|
}
|
||||||
tv_loaction.setText("定位失败,点击重试");
|
tv_loaction.setText("定位失败,点击重试");
|
||||||
@@ -201,7 +190,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
// if(index==1 || index==2){
|
// if(index==1 || index==2){
|
||||||
// new OCRRequest().OCRPlateLicense(con,hd,new File(path));
|
// new OCRRequest().OCRPlateLicense(con,hd,new File(path));
|
||||||
// }
|
// }
|
||||||
if ((index == 0 || index == 1) && !BuildConfig.isTest) {//装卸货车辆需要识别车牌号,测试环境不校验车牌号
|
if (index == 0 || index == 1) {//装卸货车辆需要识别车牌号
|
||||||
new OCRRequest().OCRCarPlateLicense(con, hd, new File(path));
|
new OCRRequest().OCRCarPlateLicense(con, hd, new File(path));
|
||||||
} else {
|
} else {
|
||||||
hyr.uploadFile(new File(path));
|
hyr.uploadFile(new File(path));
|
||||||
@@ -211,7 +200,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private LatLng latLng;
|
private LatLng latLng;
|
||||||
|
|
||||||
public LatLng convertGPSToBaidu(LatLng srLatLng) {
|
public LatLng convertGPSToBaidu(LatLng srLatLng) {
|
||||||
@@ -339,12 +327,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
path = gia.getFile().getPath();
|
path = gia.getFile().getPath();
|
||||||
Log.e("图片地址:", path);
|
Log.e("图片地址:", path);
|
||||||
gia.dis();
|
gia.dis();
|
||||||
|
|
||||||
if (customDialog != null && !customDialog.isShowing()) {
|
|
||||||
customDialog = new CustomDialog(con, "网络请求中...");
|
|
||||||
customDialog.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||||
} else if (requestCode == PictureConfig.CHOOSE_REQUEST && resultCode == RESULT_OK) {
|
} else if (requestCode == PictureConfig.CHOOSE_REQUEST && resultCode == RESULT_OK) {
|
||||||
List<LocalMedia> imgs = PictureSelector.obtainMultipleResult(data);
|
List<LocalMedia> imgs = PictureSelector.obtainMultipleResult(data);
|
||||||
@@ -358,12 +340,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
path = paths;
|
path = paths;
|
||||||
Log.e("图片地址:", path);
|
Log.e("图片地址:", path);
|
||||||
gia.dis();
|
gia.dis();
|
||||||
|
|
||||||
if (customDialog != null && !customDialog.isShowing()) {
|
|
||||||
customDialog = new CustomDialog(con, "网络请求中...");
|
|
||||||
customDialog.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -377,10 +353,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
// for(int i=0;i<imgIds.size();i++){
|
// for(int i=0;i<imgIds.size();i++){
|
||||||
// Log.e("--imgIds--",imgIds.get(i)+"");
|
// Log.e("--imgIds--",imgIds.get(i)+"");
|
||||||
// }
|
// }
|
||||||
if (customDialog != null && !customDialog.isShowing()) {
|
|
||||||
customDialog = new CustomDialog(con, "网络请求中...");
|
|
||||||
customDialog.show();
|
|
||||||
}
|
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case 0:
|
case 0:
|
||||||
//装货
|
//装货
|
||||||
@@ -564,9 +536,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
|
||||||
customDialog.dismiss();
|
|
||||||
}
|
|
||||||
Log.e("上报安联", "装货照片上传成功");
|
Log.e("上报安联", "装货照片上传成功");
|
||||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
finish();
|
finish();
|
||||||
@@ -599,9 +568,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
|
||||||
customDialog.dismiss();
|
|
||||||
}
|
|
||||||
Log.e("上报安联", "卸货照片上传成功");
|
Log.e("上报安联", "卸货照片上传成功");
|
||||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
finish();
|
finish();
|
||||||
@@ -610,9 +576,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onFailure(String s, String s1) {
|
public void onFailure(String s, String s1) {
|
||||||
Log.e("上报安联失败(卸货照片):", s + 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());
|
||||||
// SPUtil.insSP(con,"make","卸货-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
// SPUtil.insSP(con,"make","卸货-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||||
// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||||
@@ -638,9 +601,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
|
||||||
customDialog.dismiss();
|
|
||||||
}
|
|
||||||
Log.e("上报安联", "回单照片上传成功");
|
Log.e("上报安联", "回单照片上传成功");
|
||||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
finish();
|
finish();
|
||||||
@@ -688,6 +648,8 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传安联和交通厅,平台-装货
|
* 上传安联和交通厅,平台-装货
|
||||||
*/
|
*/
|
||||||
@@ -716,9 +678,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onFailure(String s, String s1) {
|
public void onFailure(String s, String s1) {
|
||||||
Log.e("上报安联失败(装货):", s + s1);
|
Log.e("上报安联失败(装货):", s + s1);
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
|
||||||
customDialog.dismiss();
|
|
||||||
}
|
|
||||||
new MessageUtils().showCenMessage(con, s1);
|
new MessageUtils().showCenMessage(con, s1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -756,9 +715,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onFailure(String s, String s1) {
|
public void onFailure(String s, String s1) {
|
||||||
Log.e("上报安联失败(卸货):", s + s1);
|
Log.e("上报安联失败(卸货):", s + s1);
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
|
||||||
customDialog.dismiss();
|
|
||||||
}
|
|
||||||
new MessageUtils().showCenMessage(con, s1);
|
new MessageUtils().showCenMessage(con, s1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -0,0 +1,876 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Message;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.Gravity;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.alct.mdp.MDPLocationCollectionManager;
|
||||||
|
import com.alct.mdp.callback.OnResultListener;
|
||||||
|
import com.alct.mdp.model.Goods;
|
||||||
|
import com.alct.mdp.model.Image;
|
||||||
|
import com.alct.mdp.model.Location;
|
||||||
|
import com.amap.api.services.core.AMapException;
|
||||||
|
import com.amap.api.services.core.LatLonPoint;
|
||||||
|
import com.amap.api.services.geocoder.GeocodeSearch;
|
||||||
|
import com.amap.api.services.help.Inputtips;
|
||||||
|
import com.amap.api.services.help.InputtipsQuery;
|
||||||
|
import com.amap.api.services.help.Tip;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.OCRRequest;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.BitmapUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.img.GetCarImageAlert;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.location.LocationUtil;
|
||||||
|
import com.baidu.mapapi.model.LatLng;
|
||||||
|
import com.baidu.mapapi.utils.CoordinateConverter;
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.dahe.mylibrary.utils.ToastUtils;
|
||||||
|
import com.github.gzuliyujiang.wheelpicker.DatimePicker;
|
||||||
|
import com.github.gzuliyujiang.wheelpicker.annotation.TimeMode;
|
||||||
|
import com.github.gzuliyujiang.wheelpicker.entity.DatimeEntity;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.luck.picture.lib.PictureSelector;
|
||||||
|
import com.luck.picture.lib.config.PictureConfig;
|
||||||
|
import com.luck.picture.lib.entity.LocalMedia;
|
||||||
|
import com.lxj.xpopup.XPopup;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.StartOrderBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.UploadBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.UploadReceiptInputBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.location.LocationGDUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.file.FileUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.file.ImageFileCompressUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.time.Timer;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||||
|
import com.lxj.xpopup.interfaces.OnSelectListener;
|
||||||
|
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ShangChuangImgActivity extends BaseAppCompatActivity implements Inputtips.InputtipsListener {
|
||||||
|
|
||||||
|
private TextView submit, name_top, name_body, address, tips, tips_x,tvDate,tvLocation;
|
||||||
|
private RelativeLayout getImg;
|
||||||
|
private EditText etAddress;
|
||||||
|
private Button btnOk;
|
||||||
|
private ImageView res_img, img_icon, img_delete;
|
||||||
|
private String[] names = {"装货", "卸货", "回单"};
|
||||||
|
public static String[] TYPE_NAME = {"zhuanghuo", "xiehuo", "huidan"};
|
||||||
|
private int index = 0;
|
||||||
|
//
|
||||||
|
private Gson gson = new Gson();
|
||||||
|
//
|
||||||
|
private LUInputBean lub = new LUInputBean();
|
||||||
|
private UploadReceiptInputBean urib = new UploadReceiptInputBean();
|
||||||
|
private LocationGDUtil lgdu;
|
||||||
|
public LocationUtil lu;
|
||||||
|
private List<Integer> imgIds = new ArrayList<>();
|
||||||
|
private UploadBean ub;
|
||||||
|
private HuoYuanRequset hyr;
|
||||||
|
//
|
||||||
|
private GetCarImageAlert gia = new GetCarImageAlert();
|
||||||
|
private CustomDialog customDialog;
|
||||||
|
private int id = 0;
|
||||||
|
private boolean key = true;
|
||||||
|
private boolean keys = false;
|
||||||
|
private boolean locationKey = false;
|
||||||
|
private TextView tv_loaction;
|
||||||
|
|
||||||
|
|
||||||
|
private String selDate;
|
||||||
|
private GeocodeSearch geocoderSearch;
|
||||||
|
|
||||||
|
private TempLoca tempLoca = new TempLoca();
|
||||||
|
private TempLoca tempLocaBd = new TempLoca();
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onGetInputtips(List<Tip> tipList, int rCode) {
|
||||||
|
if (rCode == AMapException.CODE_AMAP_SUCCESS) {
|
||||||
|
List<String> names = new ArrayList<String>();
|
||||||
|
if(tipList != null) {
|
||||||
|
int size = tipList.size();
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
Tip tip = tipList.get(i);
|
||||||
|
if(tip != null) {
|
||||||
|
names.add(tip.getDistrict()+tip.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
new XPopup.Builder(this)
|
||||||
|
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||||
|
.hasShadowBg(false) // 去掉半透明背景
|
||||||
|
.atView(etAddress)
|
||||||
|
.asAttachList(names.toArray(new String[0]), new int[]{}, new OnSelectListener() {
|
||||||
|
@Override
|
||||||
|
public void onSelect(int position, String text) {
|
||||||
|
Tip tip = tipList.get(position);
|
||||||
|
etAddress.setText(tip.getDistrict()+tip.getAddress()+tip.getName());
|
||||||
|
LatLonPoint latLonPoint = tip.getPoint();
|
||||||
|
tempLoca.setAddress(etAddress.getText().toString());
|
||||||
|
tempLoca.setLatitude(latLonPoint.getLatitude());
|
||||||
|
tempLoca.setLongitude(latLonPoint.getLongitude());
|
||||||
|
tempLoca.setTime(tvDate.getText().toString());
|
||||||
|
|
||||||
|
LatLng latLng = convertGPSToBaidu(new LatLng(latLonPoint.getLatitude(), latLonPoint.getLongitude()));
|
||||||
|
tempLocaBd.setLongitude(latLng.longitude);
|
||||||
|
tempLocaBd.setLatitude(latLng.latitude);
|
||||||
|
tempLocaBd.setAddress(etAddress.getText().toString());
|
||||||
|
tempLocaBd.setTime(tvDate.getText().toString());
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.show();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// SimpleAdapter aAdapter = new SimpleAdapter(getApplicationContext(), listString, R.layout.item_layout,
|
||||||
|
// new String[]{"name", "address"}, new int[]{R.id.poi_field_id, R.id.poi_value_id});
|
||||||
|
//
|
||||||
|
// minputlist.setAdapter(aAdapter);
|
||||||
|
// aAdapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class TempLoca{
|
||||||
|
private double latitude;
|
||||||
|
private double longitude;
|
||||||
|
private String address;
|
||||||
|
private String time;
|
||||||
|
|
||||||
|
public TempLoca() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public TempLoca(double latitude, double longitude, String address, String time) {
|
||||||
|
this.latitude = latitude;
|
||||||
|
this.longitude = longitude;
|
||||||
|
this.address = address;
|
||||||
|
this.time = time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getLatitude() {
|
||||||
|
return latitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLatitude(double latitude) {
|
||||||
|
this.latitude = latitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getLongitude() {
|
||||||
|
return longitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLongitude(double longitude) {
|
||||||
|
this.longitude = longitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddress() {
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddress(String address) {
|
||||||
|
this.address = address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTime() {
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTime(String time) {
|
||||||
|
this.time = time;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void msgMethod(Message m) {
|
||||||
|
super.msgMethod(m);
|
||||||
|
switch (m.what) {
|
||||||
|
case RequsetCodeConstants.SUCCESS:
|
||||||
|
if (CacheGroup.cacheList.get("upload") != null) {
|
||||||
|
Log.e("upload", CacheGroup.cacheList.get("upload"));
|
||||||
|
ub = gson.fromJson(CacheGroup.cacheList.remove("upload"), UploadBean.class);
|
||||||
|
if (ub.getCode() == 200) {
|
||||||
|
imgIds.add(ub.getData().getId());
|
||||||
|
Glide.with(con).load(ub.getData().getUrl()).into(res_img);
|
||||||
|
res_img.setVisibility(View.VISIBLE);
|
||||||
|
img_delete.setVisibility(View.VISIBLE);
|
||||||
|
img_icon.setVisibility(View.GONE);
|
||||||
|
key = false;
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove("upload");
|
||||||
|
}
|
||||||
|
for (int i = 0; i < TYPE_NAME.length; i++) {
|
||||||
|
if (CacheGroup.cacheList.get(TYPE_NAME[i]) != null) {
|
||||||
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]), BaseBean.class);
|
||||||
|
if (bb.getCode() == 200) {
|
||||||
|
if (index == 2) {
|
||||||
|
if (!keys){//装货回单
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove(TYPE_NAME[i]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CacheGroup.cacheList.get("carName") != null) {
|
||||||
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("carName"), BaseBean.class);
|
||||||
|
if (bb.getCode() == 200) {
|
||||||
|
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove("carName");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CacheGroup.cacheList.get("carNum") != null) {
|
||||||
|
Log.e("upload", CacheGroup.cacheList.get("carNum"));
|
||||||
|
CarInfoBean ub = gson.fromJson(CacheGroup.cacheList.remove("carNum"), CarInfoBean.class);
|
||||||
|
if (ub.getCode() == 200 && ub.getData().getData().getPrism_keyValueInfo().size() > 0) {
|
||||||
|
String value = ub.getData().getData().getPrism_keyValueInfo().get(0).getValue();
|
||||||
|
String forceMatching = ub.getData().getForceMatching();
|
||||||
|
if ("1".equals(forceMatching)) {//是否强校验车牌号 1:强校验
|
||||||
|
if (sob.getData().getCarNumber().equals(value)) {
|
||||||
|
hyr.uploadFile(new File(path));
|
||||||
|
} else {
|
||||||
|
new MessageUtils().showCenMessage(ShangChuangImgActivity.this, "车牌号不匹配!", "请重新拍照或联系管理员");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
hyr.uploadFile(new File(path));
|
||||||
|
}
|
||||||
|
} else {//识别失败后返回code500
|
||||||
|
if (index == 0) {//装卸货车辆需要识别车牌号){
|
||||||
|
Toast.makeText(con, "装货照片包含车牌号、三分之二车身或者装卸货场景。", Toast.LENGTH_SHORT).show();
|
||||||
|
} else if (index == 1) {
|
||||||
|
Toast.makeText(con, "卸货照片包含车牌号、三分之二车身或者装卸货场景。", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove("carNum");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 14://定位成功
|
||||||
|
locationKey = true;
|
||||||
|
customDialog.dismiss();
|
||||||
|
tv_loaction.setText("定位成功");
|
||||||
|
tv_loaction.setTextColor(getResources().getColor(R.color.theme_color, null));
|
||||||
|
latLng = convertGPSToBaidu(new LatLng(lgdu.getLatitude(), lgdu.getLongitude()));
|
||||||
|
initLocation();
|
||||||
|
break;
|
||||||
|
case 16://定位失败
|
||||||
|
locationKey = false;
|
||||||
|
customDialog.dismiss();
|
||||||
|
tv_loaction.setText("定位失败,点击重试");
|
||||||
|
tv_loaction.setTextColor(getResources().getColor(R.color.loaction_no_color, null));
|
||||||
|
Toast.makeText(con, "定位失败,请确认开启定位后重试!", Toast.LENGTH_LONG).show();
|
||||||
|
//定位结果接收
|
||||||
|
//finish();
|
||||||
|
break;
|
||||||
|
case 15:
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ImageFileCompressUtil.COMPRESS_SUCCESS:
|
||||||
|
path = (String) m.obj;
|
||||||
|
Log.e("res:", "选定图片结果");
|
||||||
|
Log.e("res:", path);
|
||||||
|
//选定图片结果
|
||||||
|
// if(index==1 || index==2){
|
||||||
|
// new OCRRequest().OCRPlateLicense(con,hd,new File(path));
|
||||||
|
// }
|
||||||
|
if (index == 0 || index == 1) {//装卸货车辆需要识别车牌号
|
||||||
|
new OCRRequest().OCRCarPlateLicense(con, hd, new File(path));
|
||||||
|
} else {
|
||||||
|
hyr.uploadFile(new File(path));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private LatLng latLng;
|
||||||
|
|
||||||
|
public LatLng convertGPSToBaidu(LatLng srLatLng) {
|
||||||
|
CoordinateConverter converter = new CoordinateConverter();
|
||||||
|
converter.from(CoordinateConverter.CoordType.COMMON);
|
||||||
|
converter.coord(srLatLng);
|
||||||
|
return converter.convert();
|
||||||
|
}
|
||||||
|
|
||||||
|
private String wid;
|
||||||
|
private int h_type;
|
||||||
|
String sobStr = "";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
StateStyleUtil.stateTextColor(this);
|
||||||
|
setContentView(R.layout.activity_shangchuan_bc);
|
||||||
|
con = this;
|
||||||
|
submit = findViewById(R.id.submit);
|
||||||
|
name_top = findViewById(R.id.name_top);
|
||||||
|
name_body = findViewById(R.id.name_body);
|
||||||
|
address = findViewById(R.id.address);
|
||||||
|
getImg = findViewById(R.id.getImg);
|
||||||
|
res_img = findViewById(R.id.res_img);
|
||||||
|
img_icon = findViewById(R.id.img_icon);
|
||||||
|
img_delete = findViewById(R.id.img_delete);
|
||||||
|
tv_loaction = findViewById(R.id.tv_loaction);
|
||||||
|
btnOk = findViewById(R.id.btnOk);
|
||||||
|
etAddress = findViewById(R.id.etAddress);
|
||||||
|
tvDate = findViewById(R.id.tvDate);
|
||||||
|
tvLocation = findViewById(R.id.tvLocation);
|
||||||
|
tips = findViewById(R.id.tips);
|
||||||
|
tips_x = findViewById(R.id.tips_x);
|
||||||
|
Bundle ins = getIntent().getExtras();
|
||||||
|
index = ins.getInt("type");
|
||||||
|
wid = ins.getString("wid");
|
||||||
|
h_type = ins.getInt("h_type");
|
||||||
|
keys = ins.getBoolean("keys");
|
||||||
|
sobStr = getIntent().getExtras().getString("sob");
|
||||||
|
//Log.e("---sdwStr--",sdwStr);
|
||||||
|
sob = new Gson().fromJson(sobStr, StartOrderBean.class);
|
||||||
|
initView(null);
|
||||||
|
customDialog = new CustomDialog(con, "正在定位当前位置...");
|
||||||
|
customDialog.show();
|
||||||
|
lgdu = new LocationGDUtil(con, hd);
|
||||||
|
//启动定位
|
||||||
|
lgdu.onCreate();
|
||||||
|
tv_loaction.setOnClickListener(v -> {
|
||||||
|
if (!locationKey) {
|
||||||
|
customDialog.show();
|
||||||
|
lgdu.onCreate();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
btnOk.setOnClickListener(v -> {
|
||||||
|
String s = etAddress.getText().toString();
|
||||||
|
if (TextUtils.isEmpty(selDate)){
|
||||||
|
ToastUtils.showToast(this,"请先选择时间");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!TextUtils.isEmpty(s)&&s.length()>=4){
|
||||||
|
|
||||||
|
InputtipsQuery inputquery = new InputtipsQuery(s, "");
|
||||||
|
// inputquery.setCityLimit(true);
|
||||||
|
Inputtips inputTips = new Inputtips(this, inputquery);
|
||||||
|
inputTips.setInputtipsListener(this);
|
||||||
|
inputTips.requestInputtipsAsyn();
|
||||||
|
|
||||||
|
|
||||||
|
// GeocodeQuery query = new GeocodeQuery(s, "100000");// 第一个参数表示地址,第二个参数表示查询城市,中文或者中文全拼,citycode、adcode,
|
||||||
|
// geocoderSearch.getFromLocationNameAsyn(query);// 设置同步地理编码请求
|
||||||
|
}else{
|
||||||
|
ToastUtils.showToast(this,"请输入地址且长度大于4");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
tvDate.setOnClickListener(v -> {
|
||||||
|
|
||||||
|
DatimePicker datimePicker = new DatimePicker(this);
|
||||||
|
datimePicker.setBodyWidth(300);
|
||||||
|
datimePicker.getWheelLayout().setRange(DatimeEntity.yearOnFuture(-1),DatimeEntity.yearOnFuture(10),DatimeEntity.now());
|
||||||
|
datimePicker.setOnDatimePickedListener((year, month, day, hour, minute, second) -> {
|
||||||
|
selDate = year+"-"+month+"-"+day+" "+ hour+":"+minute;
|
||||||
|
tvDate.setText(selDate);
|
||||||
|
});
|
||||||
|
datimePicker.getWheelLayout().setDateLabel("年", "月", "日");
|
||||||
|
datimePicker.getWheelLayout().setTimeLabel("时","分","");
|
||||||
|
datimePicker.getWheelLayout().setTimeMode(TimeMode.HOUR_24_NO_SECOND);
|
||||||
|
datimePicker.show();
|
||||||
|
});
|
||||||
|
|
||||||
|
hyr = new HuoYuanRequset(con, hd);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initData() {
|
||||||
|
//nfc初始化设置
|
||||||
|
NfcUtils nfcUtils = new NfcUtils(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initView(Object obj) {
|
||||||
|
super.initView(obj);
|
||||||
|
name_top.setText("上传" + names[index] + "照片");
|
||||||
|
name_body.setText(names[index] + "照片");
|
||||||
|
if (index == 1) {
|
||||||
|
tips.setVisibility(View.VISIBLE);
|
||||||
|
tips_x.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
submit.setOnClickListener(v -> {
|
||||||
|
if (imgIds.size() != 0) {
|
||||||
|
typeRequest();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "请先上传一张图片", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
getImg.setOnClickListener(v -> {
|
||||||
|
if (key) {
|
||||||
|
Log.e("--imgIds.size()--", imgIds.size() + "");
|
||||||
|
gia.showPopueWindow(this, true);
|
||||||
|
} else {
|
||||||
|
new XPopup.Builder(con)
|
||||||
|
.asImageViewer(res_img, ub.getData().getUrl(), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||||
|
.show();
|
||||||
|
// new XPopup.Builder(con)
|
||||||
|
// .asImageViewer(res_img, ub.getData().getUrl(), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||||
|
// .show();
|
||||||
|
Toast.makeText(con, "查看了照片", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
img_delete.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
imgIds = new ArrayList<>();
|
||||||
|
ub = new UploadBean();
|
||||||
|
res_img.setVisibility(View.GONE);
|
||||||
|
img_delete.setVisibility(View.GONE);
|
||||||
|
img_icon.setVisibility(View.VISIBLE);
|
||||||
|
key = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
String path;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
if (requestCode == 12 && resultCode == RESULT_OK) {
|
||||||
|
if (null == gia.getFile()) {
|
||||||
|
new ToastUtil(con, Gravity.CENTER, "图片选择失败").show(Toast.LENGTH_SHORT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
path = gia.getFile().getPath();
|
||||||
|
Log.e("图片地址:", path);
|
||||||
|
gia.dis();
|
||||||
|
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||||
|
} else if (requestCode == PictureConfig.CHOOSE_REQUEST && resultCode == RESULT_OK) {
|
||||||
|
List<LocalMedia> imgs = PictureSelector.obtainMultipleResult(data);
|
||||||
|
if (imgs != null && imgs.size() > 0) {
|
||||||
|
LocalMedia image = imgs.get(0);
|
||||||
|
|
||||||
|
String paths = image.getAndroidQToPath();
|
||||||
|
if (TextUtils.isEmpty(paths)) {
|
||||||
|
paths = image.getPath();
|
||||||
|
}
|
||||||
|
path = paths;
|
||||||
|
Log.e("图片地址:", path);
|
||||||
|
gia.dis();
|
||||||
|
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initLocation() {
|
||||||
|
address.setText(lgdu.getAddress());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void typeRequest() {
|
||||||
|
// for(int i=0;i<imgIds.size();i++){
|
||||||
|
// Log.e("--imgIds--",imgIds.get(i)+"");
|
||||||
|
// }
|
||||||
|
switch (index) {
|
||||||
|
case 0:
|
||||||
|
//装货
|
||||||
|
if (imgIds != null && imgIds.size() > 0) {
|
||||||
|
lub.setLatitude(tempLoca.getLatitude() + "");
|
||||||
|
lub.setLongitude(tempLoca.getLongitude() + "");
|
||||||
|
lub.setLocationAddress(tempLoca.getAddress());
|
||||||
|
lub.setImageId(imgIds);
|
||||||
|
lub.setWaybillId(wid);
|
||||||
|
Log.e("--装货信息", gson.toJson(lub));
|
||||||
|
if (locationKey) {//高德定位
|
||||||
|
if (keys) {
|
||||||
|
nfc();
|
||||||
|
loadInfo();
|
||||||
|
// up_traffic_start();
|
||||||
|
// up_image_z();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if (imgIds != null && imgIds.size() > 0) {
|
||||||
|
//卸货
|
||||||
|
lub.setLatitude(tempLoca.getLatitude() + "");
|
||||||
|
lub.setLongitude(tempLoca.getLongitude() + "");
|
||||||
|
lub.setLocationAddress(tempLoca.getAddress());
|
||||||
|
lub.setImageId(imgIds);
|
||||||
|
lub.setWaybillId(wid);
|
||||||
|
lub.setRealLoadTime(tempLoca.getTime());
|
||||||
|
Log.e("--卸货信息", gson.toJson(lub));
|
||||||
|
if (locationKey&&!TextUtils.isEmpty(tempLoca.address)) {
|
||||||
|
if (keys) {
|
||||||
|
nfc();
|
||||||
|
uploadInfo();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
if (imgIds != null && imgIds.size() > 0) {//卸货回单
|
||||||
|
//上传回单
|
||||||
|
urib.setLatitude(lgdu.getLatitude() + "");
|
||||||
|
urib.setLongitude(lgdu.getLongitude() + "");
|
||||||
|
urib.setLocationAddress(lgdu.getAddress());
|
||||||
|
//装卸货类型
|
||||||
|
urib.setType(h_type + 1);
|
||||||
|
//回单id 数组
|
||||||
|
urib.setReceiptId(imgIds);
|
||||||
|
//子运运单ID
|
||||||
|
urib.setWaybillId(wid);
|
||||||
|
Log.e("--回单信息", gson.toJson(urib));
|
||||||
|
if (locationKey) {
|
||||||
|
if (index == 2 && keys && !TextUtils.isEmpty(tempLoca.address)) {
|
||||||
|
up_trafficSign();
|
||||||
|
up_trafficReceipt();
|
||||||
|
receipt_image();
|
||||||
|
}
|
||||||
|
hyr.receipt(urib);
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private StartOrderBean sob;
|
||||||
|
|
||||||
|
public void nfc() {
|
||||||
|
// if(sob.getData().getNfcId().equals(nfcStr)){
|
||||||
|
// Toast.makeText(con,"nfcId匹配失败",Toast.LENGTH_LONG).show();
|
||||||
|
// }
|
||||||
|
if ("".equals(sob.getData().getNfcId()) || sob.getData().getNfcId() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MDPLocationCollectionManager.checkNfc(con, sob.getData().getShippingNoteNumber(),
|
||||||
|
sob.getData().getNfcId(), new OnResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Toast.makeText(con, "nfcId匹配成功", Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("不匹配", "" + s + s1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//上传安联-签收
|
||||||
|
public void up_trafficSign() {
|
||||||
|
//安联
|
||||||
|
Location l = new Location();
|
||||||
|
l.setBaiduLongitude(tempLocaBd.longitude);
|
||||||
|
l.setBaiduLatitude(tempLocaBd.latitude);
|
||||||
|
l.setLocation(tempLocaBd.getAddress());
|
||||||
|
l.setTime(tempLocaBd.getTime());
|
||||||
|
List<Goods> gs = new ArrayList<>();
|
||||||
|
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||||
|
if (wid.equals(wayChild.getId() + "")) {
|
||||||
|
for (StartOrderBean.DataDTO.WayChildrenDTO.GoodsDTO good : wayChild.getGoods()) {
|
||||||
|
Goods g = new Goods();
|
||||||
|
g.setGoodsName(good.getGoodName());
|
||||||
|
g.setUnit(good.getGoodUnit());
|
||||||
|
g.setItemNo(good.getId());
|
||||||
|
//实收
|
||||||
|
g.setQuantity(1);
|
||||||
|
//应收
|
||||||
|
g.setReceivedQuantity(1);
|
||||||
|
//破损
|
||||||
|
g.setDamageQuantity(1);
|
||||||
|
//丢失
|
||||||
|
g.setQuantity(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MDPLocationCollectionManager.sign(con, sob.getData().getShippingNoteNumber(), l, gs, new OnResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "签收成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(签收):", s + s1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//上传安联-回单
|
||||||
|
public void up_trafficReceipt() {
|
||||||
|
//安联
|
||||||
|
Location l = new Location();
|
||||||
|
l.setBaiduLongitude(tempLocaBd.longitude);
|
||||||
|
l.setBaiduLatitude(tempLocaBd.latitude);
|
||||||
|
l.setLocation(tempLocaBd.getAddress());
|
||||||
|
l.setTime(tempLocaBd.getTime());
|
||||||
|
MDPLocationCollectionManager.pod(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "回单上传成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(回单):", s + s1);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void up_image_z() {
|
||||||
|
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||||
|
File file = new File(path);
|
||||||
|
Image image = new Image();
|
||||||
|
String base = BitmapUtil.imageToBase64(path);
|
||||||
|
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||||
|
image.setFileExt(FileUtil.lastName(file));
|
||||||
|
image.setFileName(FileUtil.fileName(file));
|
||||||
|
image.setImageTakenDate(Timer.getTimerT());
|
||||||
|
image.setBaiduLongitude(tempLocaBd.longitude);
|
||||||
|
image.setBaiduLatitude(tempLocaBd.latitude);
|
||||||
|
image.setLocation(tempLocaBd.getAddress());
|
||||||
|
MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "装货照片上传成功");
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(装货照片):", s + s1);
|
||||||
|
// SPUtil.insSP(con,"make","装货",sob.getData().getShippingNoteNumber());
|
||||||
|
// SPUtil.insSP(con,"make","装货-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||||
|
// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||||
|
// startService(serviceIn);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void up_image() {
|
||||||
|
File file = new File(path);
|
||||||
|
Image image = new Image();
|
||||||
|
String base = BitmapUtil.imageToBase64(path);
|
||||||
|
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||||
|
image.setFileExt(FileUtil.lastName(file));
|
||||||
|
image.setFileName(FileUtil.fileName(file));
|
||||||
|
image.setImageTakenDate(tempLocaBd.getTime());
|
||||||
|
image.setBaiduLongitude(tempLocaBd.longitude);
|
||||||
|
image.setBaiduLatitude(tempLocaBd.latitude);
|
||||||
|
image.setLocation(tempLocaBd.getAddress());
|
||||||
|
MDPLocationCollectionManager.uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "卸货照片上传成功");
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(卸货照片):", s + s1);
|
||||||
|
// SPUtil.insSP(con,"make","卸货",sob.getData().getShippingNoteNumber());
|
||||||
|
// SPUtil.insSP(con,"make","卸货-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||||
|
// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||||
|
// startService(serviceIn);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void receipt_image() {
|
||||||
|
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||||
|
File file = new File(path);
|
||||||
|
Image image = new Image();
|
||||||
|
String base = BitmapUtil.imageToBase64(path);
|
||||||
|
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||||
|
image.setFileExt(FileUtil.lastName(file));
|
||||||
|
image.setFileName(FileUtil.fileName(file));
|
||||||
|
image.setImageTakenDate(tempLocaBd.getTime());
|
||||||
|
image.setBaiduLongitude(tempLocaBd.longitude);
|
||||||
|
image.setBaiduLatitude(tempLocaBd.latitude);
|
||||||
|
image.setLocation(tempLocaBd.getAddress());
|
||||||
|
MDPLocationCollectionManager.uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "回单照片上传成功");
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(回单照片):", s + s1);
|
||||||
|
// SPUtil.insSP(con,"make","回单",sob.getData().getShippingNoteNumber());
|
||||||
|
//// SPUtil.insSP(con,"make","回单-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||||
|
//// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||||
|
//// startService(serviceIn);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
//开启前台调度系统
|
||||||
|
//NfcUtils.mNfcAdapter.enableForegroundDispatch(this, NfcUtils.mPendingIntent, NfcUtils.mIntentFilter, NfcUtils.mTechList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
//关闭前台调度系统
|
||||||
|
//NfcUtils.mNfcAdapter.disableForegroundDispatch(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
String nfcStr = "";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onNewIntent(Intent intent) {
|
||||||
|
super.onNewIntent(intent);
|
||||||
|
//当该Activity接收到NFC标签时,运行该方法
|
||||||
|
//调用工具方法,读取NFC数据
|
||||||
|
try {
|
||||||
|
nfcStr = NfcUtils.readNFCId(intent);
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
Log.e("nfc", nfcStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传安联和交通厅,平台-装货
|
||||||
|
*/
|
||||||
|
private void loadInfo() {
|
||||||
|
//安联
|
||||||
|
if (sob.getData().getReportAlct() == 1) {
|
||||||
|
Location l = new Location();
|
||||||
|
l.setBaiduLongitude(tempLocaBd.longitude);
|
||||||
|
l.setBaiduLatitude(tempLocaBd.latitude);
|
||||||
|
l.setLocation(tempLocaBd.getAddress());
|
||||||
|
l.setTime(tempLocaBd.getTime());
|
||||||
|
MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "装货上传成功");
|
||||||
|
//交通厅
|
||||||
|
if (sob.getData().getReport() == 1) {
|
||||||
|
JTTProcess.start(con, sob, "");
|
||||||
|
}
|
||||||
|
//装货状态
|
||||||
|
hyr.loading(lub);
|
||||||
|
//装货照片
|
||||||
|
up_image_z();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(装货):", s + s1);
|
||||||
|
new MessageUtils().showCenMessage(con, s1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传安联和交通厅,平台-卸货
|
||||||
|
*/
|
||||||
|
private void uploadInfo() {
|
||||||
|
|
||||||
|
//安联
|
||||||
|
if (sob.getData().getReportAlct() == 1) {
|
||||||
|
Location l = new Location();
|
||||||
|
l.setBaiduLongitude(tempLocaBd.longitude);
|
||||||
|
l.setBaiduLatitude(tempLocaBd.latitude);
|
||||||
|
l.setLocation(tempLocaBd.getAddress());
|
||||||
|
l.setTime(tempLocaBd.getTime());
|
||||||
|
Log.e("-安联卸货信息-", gson.toJson(l));
|
||||||
|
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "卸货上传成功");
|
||||||
|
//交通厅
|
||||||
|
if (sob.getData().getReport() == 1) {
|
||||||
|
JTTProcess.stop(con, sob, "");
|
||||||
|
}
|
||||||
|
//卸货状态-平台
|
||||||
|
hyr.dischargeCargo4(lub);
|
||||||
|
//卸货照片-安联
|
||||||
|
up_image();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(卸货):", s + s1);
|
||||||
|
// new MessageUtils().showCenMessage(con, s1);
|
||||||
|
//运单状态不一致,平台更新状态
|
||||||
|
hyr.dischargeCargo4(lub);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,725 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Message;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.Gravity;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.alct.mdp.MDPLocationCollectionManager;
|
||||||
|
import com.alct.mdp.callback.OnResultListener;
|
||||||
|
import com.alct.mdp.model.Goods;
|
||||||
|
import com.alct.mdp.model.Image;
|
||||||
|
import com.alct.mdp.model.Location;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.StartOrderBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.UploadBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.OCRRequest;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.UploadReceiptInputBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.BitmapUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.file.FileUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.file.ImageFileCompressUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.img.GetCarImageAlert;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.location.LocationGDUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.location.LocationUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.time.Timer;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||||
|
import com.baidu.mapapi.model.LatLng;
|
||||||
|
import com.baidu.mapapi.utils.CoordinateConverter;
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.luck.picture.lib.PictureSelector;
|
||||||
|
import com.luck.picture.lib.config.PictureConfig;
|
||||||
|
import com.luck.picture.lib.entity.LocalMedia;
|
||||||
|
import com.lxj.xpopup.XPopup;
|
||||||
|
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||||
|
|
||||||
|
private TextView submit, name_top, name_body, address, tips, tips_x;
|
||||||
|
private RelativeLayout getImg;
|
||||||
|
private ImageView res_img, img_icon, img_delete;
|
||||||
|
private String[] names = {"装货", "卸货", "回单"};
|
||||||
|
public static String[] TYPE_NAME = {"zhuanghuo", "xiehuo", "huidan"};
|
||||||
|
private int index = 0;
|
||||||
|
//
|
||||||
|
private Gson gson = new Gson();
|
||||||
|
//
|
||||||
|
private LUInputBean lub = new LUInputBean();
|
||||||
|
private UploadReceiptInputBean urib = new UploadReceiptInputBean();
|
||||||
|
private LocationGDUtil lgdu;
|
||||||
|
public LocationUtil lu;
|
||||||
|
private List<Integer> imgIds = new ArrayList<>();
|
||||||
|
private UploadBean ub;
|
||||||
|
private HuoYuanRequset hyr;
|
||||||
|
//
|
||||||
|
private GetCarImageAlert gia = new GetCarImageAlert();
|
||||||
|
private CustomDialog customDialog;
|
||||||
|
private int id = 0;
|
||||||
|
private boolean key = true;
|
||||||
|
private boolean keys = false;
|
||||||
|
private boolean locationKey = false;
|
||||||
|
private TextView tv_loaction;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void msgMethod(Message m) {
|
||||||
|
super.msgMethod(m);
|
||||||
|
switch (m.what) {
|
||||||
|
case RequsetCodeConstants.SUCCESS:
|
||||||
|
if (CacheGroup.cacheList.get("upload") != null) {
|
||||||
|
Log.e("upload", CacheGroup.cacheList.get("upload"));
|
||||||
|
ub = gson.fromJson(CacheGroup.cacheList.remove("upload"), UploadBean.class);
|
||||||
|
if (ub.getCode() == 200) {
|
||||||
|
imgIds.add(ub.getData().getId());
|
||||||
|
Glide.with(con).load(ub.getData().getUrl()).into(res_img);
|
||||||
|
res_img.setVisibility(View.VISIBLE);
|
||||||
|
img_delete.setVisibility(View.VISIBLE);
|
||||||
|
img_icon.setVisibility(View.GONE);
|
||||||
|
key = false;
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove("upload");
|
||||||
|
}
|
||||||
|
for (int i = 0; i < TYPE_NAME.length; i++) {
|
||||||
|
if (CacheGroup.cacheList.get(TYPE_NAME[i]) != null) {
|
||||||
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]), BaseBean.class);
|
||||||
|
if (bb.getCode() == 200) {
|
||||||
|
if (index == 2) {
|
||||||
|
if (!keys){//装货回单
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove(TYPE_NAME[i]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CacheGroup.cacheList.get("carName") != null) {
|
||||||
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("carName"), BaseBean.class);
|
||||||
|
if (bb.getCode() == 200) {
|
||||||
|
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove("carName");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CacheGroup.cacheList.get("carNum") != null) {
|
||||||
|
Log.e("upload", CacheGroup.cacheList.get("carNum"));
|
||||||
|
CarInfoBean ub = gson.fromJson(CacheGroup.cacheList.remove("carNum"), CarInfoBean.class);
|
||||||
|
if (ub.getCode() == 200 && ub.getData().getData().getPrism_keyValueInfo().size() > 0) {
|
||||||
|
String value = ub.getData().getData().getPrism_keyValueInfo().get(0).getValue();
|
||||||
|
String forceMatching = ub.getData().getForceMatching();
|
||||||
|
if ("1".equals(forceMatching)) {//是否强校验车牌号 1:强校验
|
||||||
|
if (sob.getData().getCarNumber().equals(value)) {
|
||||||
|
hyr.uploadFile(new File(path));
|
||||||
|
} else {
|
||||||
|
new MessageUtils().showCenMessage(ShangChuangImgActivity.this, "车牌号不匹配!", "请重新拍照或联系管理员");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
hyr.uploadFile(new File(path));
|
||||||
|
}
|
||||||
|
} else {//识别失败后返回code500
|
||||||
|
if (index == 0) {//装卸货车辆需要识别车牌号){
|
||||||
|
Toast.makeText(con, "装货照片包含车牌号、三分之二车身或者装卸货场景。", Toast.LENGTH_SHORT).show();
|
||||||
|
} else if (index == 1) {
|
||||||
|
Toast.makeText(con, "卸货照片包含车牌号、三分之二车身或者装卸货场景。", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove("carNum");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 14://定位成功
|
||||||
|
locationKey = true;
|
||||||
|
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
tv_loaction.setText("定位成功");
|
||||||
|
tv_loaction.setTextColor(getResources().getColor(R.color.theme_color, null));
|
||||||
|
latLng = convertGPSToBaidu(new LatLng(lgdu.getLatitude(), lgdu.getLongitude()));
|
||||||
|
initLocation();
|
||||||
|
break;
|
||||||
|
case 16://定位失败
|
||||||
|
locationKey = false;
|
||||||
|
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
tv_loaction.setText("定位失败,点击重试");
|
||||||
|
tv_loaction.setTextColor(getResources().getColor(R.color.loaction_no_color, null));
|
||||||
|
Toast.makeText(con, "定位失败,请确认开启定位后重试!", Toast.LENGTH_LONG).show();
|
||||||
|
//定位结果接收
|
||||||
|
//finish();
|
||||||
|
break;
|
||||||
|
case 15:
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ImageFileCompressUtil.COMPRESS_SUCCESS:
|
||||||
|
path = (String) m.obj;
|
||||||
|
Log.e("res:", "选定图片结果");
|
||||||
|
Log.e("res:", path);
|
||||||
|
//选定图片结果
|
||||||
|
// if(index==1 || index==2){
|
||||||
|
// new OCRRequest().OCRPlateLicense(con,hd,new File(path));
|
||||||
|
// }
|
||||||
|
if (index == 0 || index == 1) {//装卸货车辆需要识别车牌号
|
||||||
|
new OCRRequest().OCRCarPlateLicense(con, hd, new File(path));
|
||||||
|
} else {
|
||||||
|
hyr.uploadFile(new File(path));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private LatLng latLng;
|
||||||
|
|
||||||
|
public LatLng convertGPSToBaidu(LatLng srLatLng) {
|
||||||
|
CoordinateConverter converter = new CoordinateConverter();
|
||||||
|
converter.from(CoordinateConverter.CoordType.COMMON);
|
||||||
|
converter.coord(srLatLng);
|
||||||
|
return converter.convert();
|
||||||
|
}
|
||||||
|
|
||||||
|
private String wid;
|
||||||
|
private int h_type;
|
||||||
|
String sobStr = "";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
StateStyleUtil.stateTextColor(this);
|
||||||
|
setContentView(R.layout.activity_shangchuan);
|
||||||
|
con = this;
|
||||||
|
submit = findViewById(R.id.submit);
|
||||||
|
name_top = findViewById(R.id.name_top);
|
||||||
|
name_body = findViewById(R.id.name_body);
|
||||||
|
address = findViewById(R.id.address);
|
||||||
|
getImg = findViewById(R.id.getImg);
|
||||||
|
res_img = findViewById(R.id.res_img);
|
||||||
|
img_icon = findViewById(R.id.img_icon);
|
||||||
|
img_delete = findViewById(R.id.img_delete);
|
||||||
|
tv_loaction = findViewById(R.id.tv_loaction);
|
||||||
|
tips = findViewById(R.id.tips);
|
||||||
|
tips_x = findViewById(R.id.tips_x);
|
||||||
|
Bundle ins = getIntent().getExtras();
|
||||||
|
index = ins.getInt("type");
|
||||||
|
wid = ins.getString("wid");
|
||||||
|
h_type = ins.getInt("h_type");
|
||||||
|
keys = ins.getBoolean("keys");
|
||||||
|
sobStr = getIntent().getExtras().getString("sob");
|
||||||
|
//Log.e("---sdwStr--",sdwStr);
|
||||||
|
sob = new Gson().fromJson(sobStr, StartOrderBean.class);
|
||||||
|
initView(null);
|
||||||
|
customDialog = new CustomDialog(con, "正在定位当前位置...");
|
||||||
|
customDialog.show();
|
||||||
|
lgdu = new LocationGDUtil(con, hd);
|
||||||
|
//启动定位
|
||||||
|
lgdu.onCreate();
|
||||||
|
// lu = new LocationUtil(con, hd);
|
||||||
|
// lu.onCreate();
|
||||||
|
// if (keys) {
|
||||||
|
// lu = new LocationUtil(con, hd);
|
||||||
|
// lu.onCreate();
|
||||||
|
// }
|
||||||
|
tv_loaction.setOnClickListener(v -> {
|
||||||
|
if (!locationKey) {
|
||||||
|
customDialog.show();
|
||||||
|
lgdu.onCreate();
|
||||||
|
// lu = new LocationUtil(con, hd);
|
||||||
|
// lu.onCreate();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
hyr = new HuoYuanRequset(con, hd);
|
||||||
|
// if (!NfcUtils.hasNfc(con)) {
|
||||||
|
// Toast.makeText(con,"请先开启nfc",Toast.LENGTH_LONG).show();
|
||||||
|
// }else{
|
||||||
|
// initData();
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initData() {
|
||||||
|
//nfc初始化设置
|
||||||
|
NfcUtils nfcUtils = new NfcUtils(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initView(Object obj) {
|
||||||
|
super.initView(obj);
|
||||||
|
name_top.setText("上传" + names[index] + "照片");
|
||||||
|
name_body.setText(names[index] + "照片");
|
||||||
|
if (index == 1) {
|
||||||
|
tips.setVisibility(View.VISIBLE);
|
||||||
|
tips_x.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
submit.setOnClickListener(v -> {
|
||||||
|
if (imgIds.size() != 0) {
|
||||||
|
typeRequest();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "请先上传一张图片", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
getImg.setOnClickListener(v -> {
|
||||||
|
if (key) {
|
||||||
|
Log.e("--imgIds.size()--", imgIds.size() + "");
|
||||||
|
gia.showPopueWindow(this, index == 2);
|
||||||
|
} else {
|
||||||
|
new XPopup.Builder(con)
|
||||||
|
.asImageViewer(res_img, ub.getData().getUrl(), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||||
|
.show();
|
||||||
|
// new XPopup.Builder(con)
|
||||||
|
// .asImageViewer(res_img, ub.getData().getUrl(), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||||
|
// .show();
|
||||||
|
Toast.makeText(con, "查看了照片", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
img_delete.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
imgIds = new ArrayList<>();
|
||||||
|
ub = new UploadBean();
|
||||||
|
res_img.setVisibility(View.GONE);
|
||||||
|
img_delete.setVisibility(View.GONE);
|
||||||
|
img_icon.setVisibility(View.VISIBLE);
|
||||||
|
key = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
String path;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
if (requestCode == 12 && resultCode == RESULT_OK) {
|
||||||
|
if (null == gia.getFile()) {
|
||||||
|
new ToastUtil(con, Gravity.CENTER, "图片选择失败").show(Toast.LENGTH_SHORT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
path = gia.getFile().getPath();
|
||||||
|
Log.e("图片地址:", path);
|
||||||
|
gia.dis();
|
||||||
|
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||||
|
} else if (requestCode == PictureConfig.CHOOSE_REQUEST && resultCode == RESULT_OK) {
|
||||||
|
List<LocalMedia> imgs = PictureSelector.obtainMultipleResult(data);
|
||||||
|
if (imgs != null && imgs.size() > 0) {
|
||||||
|
LocalMedia image = imgs.get(0);
|
||||||
|
|
||||||
|
String paths = image.getAndroidQToPath();
|
||||||
|
if (TextUtils.isEmpty(paths)) {
|
||||||
|
paths = image.getPath();
|
||||||
|
}
|
||||||
|
path = paths;
|
||||||
|
Log.e("图片地址:", path);
|
||||||
|
gia.dis();
|
||||||
|
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initLocation() {
|
||||||
|
address.setText(lgdu.getAddress());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void typeRequest() {
|
||||||
|
// for(int i=0;i<imgIds.size();i++){
|
||||||
|
// Log.e("--imgIds--",imgIds.get(i)+"");
|
||||||
|
// }
|
||||||
|
switch (index) {
|
||||||
|
case 0:
|
||||||
|
//装货
|
||||||
|
if (imgIds != null && imgIds.size() > 0) {
|
||||||
|
lub.setLatitude(lgdu.getLatitude() + "");
|
||||||
|
lub.setLongitude(lgdu.getLongitude() + "");
|
||||||
|
lub.setLocationAddress(lgdu.getAddress());
|
||||||
|
lub.setImageId(imgIds);
|
||||||
|
lub.setWaybillId(wid);
|
||||||
|
Log.e("--装货信息", gson.toJson(lub));
|
||||||
|
if (locationKey) {//高德定位
|
||||||
|
if (keys) {
|
||||||
|
nfc();
|
||||||
|
loadInfo();
|
||||||
|
// up_traffic_start();
|
||||||
|
// up_image_z();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if (imgIds != null && imgIds.size() > 0) {
|
||||||
|
//卸货
|
||||||
|
lub.setLatitude(lgdu.getLatitude() + "");
|
||||||
|
lub.setLongitude(lgdu.getLongitude() + "");
|
||||||
|
lub.setLocationAddress(lgdu.getAddress());
|
||||||
|
lub.setImageId(imgIds);
|
||||||
|
lub.setWaybillId(wid);
|
||||||
|
Log.e("--卸货信息", gson.toJson(lub));
|
||||||
|
if (locationKey) {
|
||||||
|
if (keys) {
|
||||||
|
nfc();
|
||||||
|
uploadInfo();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
if (imgIds != null && imgIds.size() > 0) {//卸货回单
|
||||||
|
//上传回单
|
||||||
|
urib.setLatitude(lgdu.getLatitude() + "");
|
||||||
|
urib.setLongitude(lgdu.getLongitude() + "");
|
||||||
|
urib.setLocationAddress(lgdu.getAddress());
|
||||||
|
//装卸货类型
|
||||||
|
urib.setType(h_type + 1);
|
||||||
|
//回单id 数组
|
||||||
|
urib.setReceiptId(imgIds);
|
||||||
|
//子运运单ID
|
||||||
|
urib.setWaybillId(wid);
|
||||||
|
Log.e("--回单信息", gson.toJson(urib));
|
||||||
|
if (locationKey) {
|
||||||
|
if (index == 2 && keys) {
|
||||||
|
up_trafficSign();
|
||||||
|
up_trafficReceipt();
|
||||||
|
receipt_image();
|
||||||
|
}
|
||||||
|
hyr.receipt(urib);
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private StartOrderBean sob;
|
||||||
|
|
||||||
|
public void nfc() {
|
||||||
|
// if(sob.getData().getNfcId().equals(nfcStr)){
|
||||||
|
// Toast.makeText(con,"nfcId匹配失败",Toast.LENGTH_LONG).show();
|
||||||
|
// }
|
||||||
|
if ("".equals(sob.getData().getNfcId()) || sob.getData().getNfcId() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MDPLocationCollectionManager.checkNfc(con, sob.getData().getShippingNoteNumber(),
|
||||||
|
sob.getData().getNfcId(), new OnResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Toast.makeText(con, "nfcId匹配成功", Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("不匹配", "" + s + s1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//上传安联-签收
|
||||||
|
public void up_trafficSign() {
|
||||||
|
//安联
|
||||||
|
Location l = new Location();
|
||||||
|
l.setBaiduLongitude(latLng.longitude);
|
||||||
|
l.setBaiduLatitude(latLng.latitude);
|
||||||
|
l.setLocation(lgdu.getAddress());
|
||||||
|
l.setTime(Timer.getTimerT());
|
||||||
|
List<Goods> gs = new ArrayList<>();
|
||||||
|
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||||
|
if (wid.equals(wayChild.getId() + "")) {
|
||||||
|
for (StartOrderBean.DataDTO.WayChildrenDTO.GoodsDTO good : wayChild.getGoods()) {
|
||||||
|
Goods g = new Goods();
|
||||||
|
g.setGoodsName(good.getGoodName());
|
||||||
|
g.setUnit(good.getGoodUnit());
|
||||||
|
g.setItemNo(good.getId());
|
||||||
|
//实收
|
||||||
|
g.setQuantity(1);
|
||||||
|
//应收
|
||||||
|
g.setReceivedQuantity(1);
|
||||||
|
//破损
|
||||||
|
g.setDamageQuantity(1);
|
||||||
|
//丢失
|
||||||
|
g.setQuantity(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MDPLocationCollectionManager.sign(con, sob.getData().getShippingNoteNumber(), l, gs, new OnResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "签收成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(签收):", s + s1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//上传安联-回单
|
||||||
|
public void up_trafficReceipt() {
|
||||||
|
//安联
|
||||||
|
Location l = new Location();
|
||||||
|
l.setBaiduLongitude(latLng.longitude);
|
||||||
|
l.setBaiduLatitude(latLng.latitude);
|
||||||
|
l.setLocation(lgdu.getAddress());
|
||||||
|
l.setTime(Timer.getTimerT());
|
||||||
|
MDPLocationCollectionManager.pod(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "回单上传成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(回单):", s + s1);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void up_image_z() {
|
||||||
|
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||||
|
File file = new File(path);
|
||||||
|
Image image = new Image();
|
||||||
|
String base = BitmapUtil.imageToBase64(path);
|
||||||
|
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||||
|
image.setFileExt(FileUtil.lastName(file));
|
||||||
|
image.setFileName(FileUtil.fileName(file));
|
||||||
|
image.setImageTakenDate(Timer.getTimerT());
|
||||||
|
image.setBaiduLongitude(latLng.longitude);
|
||||||
|
image.setBaiduLatitude(latLng.latitude);
|
||||||
|
image.setLocation(lgdu.getAddress());
|
||||||
|
MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "装货照片上传成功");
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(装货照片):", s + s1);
|
||||||
|
// SPUtil.insSP(con,"make","装货",sob.getData().getShippingNoteNumber());
|
||||||
|
// SPUtil.insSP(con,"make","装货-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||||
|
// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||||
|
// startService(serviceIn);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void up_image() {
|
||||||
|
File file = new File(path);
|
||||||
|
Image image = new Image();
|
||||||
|
String base = BitmapUtil.imageToBase64(path);
|
||||||
|
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||||
|
image.setFileExt(FileUtil.lastName(file));
|
||||||
|
image.setFileName(FileUtil.fileName(file));
|
||||||
|
image.setImageTakenDate(Timer.getTimerT());
|
||||||
|
image.setBaiduLongitude(latLng.longitude);
|
||||||
|
image.setBaiduLatitude(latLng.latitude);
|
||||||
|
image.setLocation(lgdu.getAddress());
|
||||||
|
MDPLocationCollectionManager.uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "卸货照片上传成功");
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(卸货照片):", s + s1);
|
||||||
|
// SPUtil.insSP(con,"make","卸货",sob.getData().getShippingNoteNumber());
|
||||||
|
// SPUtil.insSP(con,"make","卸货-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||||
|
// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||||
|
// startService(serviceIn);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void receipt_image() {
|
||||||
|
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||||
|
File file = new File(path);
|
||||||
|
Image image = new Image();
|
||||||
|
String base = BitmapUtil.imageToBase64(path);
|
||||||
|
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||||
|
image.setFileExt(FileUtil.lastName(file));
|
||||||
|
image.setFileName(FileUtil.fileName(file));
|
||||||
|
image.setImageTakenDate(Timer.getTimerT());
|
||||||
|
image.setBaiduLongitude(latLng.longitude);
|
||||||
|
image.setBaiduLatitude(latLng.latitude);
|
||||||
|
image.setLocation(lgdu.getAddress());
|
||||||
|
MDPLocationCollectionManager.uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "回单照片上传成功");
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(回单照片):", s + s1);
|
||||||
|
// SPUtil.insSP(con,"make","回单",sob.getData().getShippingNoteNumber());
|
||||||
|
//// SPUtil.insSP(con,"make","回单-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||||
|
//// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||||
|
//// startService(serviceIn);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
//开启前台调度系统
|
||||||
|
//NfcUtils.mNfcAdapter.enableForegroundDispatch(this, NfcUtils.mPendingIntent, NfcUtils.mIntentFilter, NfcUtils.mTechList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
//关闭前台调度系统
|
||||||
|
//NfcUtils.mNfcAdapter.disableForegroundDispatch(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
String nfcStr = "";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onNewIntent(Intent intent) {
|
||||||
|
super.onNewIntent(intent);
|
||||||
|
//当该Activity接收到NFC标签时,运行该方法
|
||||||
|
//调用工具方法,读取NFC数据
|
||||||
|
try {
|
||||||
|
nfcStr = NfcUtils.readNFCId(intent);
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
Log.e("nfc", nfcStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传安联和交通厅,平台-装货
|
||||||
|
*/
|
||||||
|
private void loadInfo() {
|
||||||
|
//安联
|
||||||
|
if (sob.getData().getReportAlct() == 1) {
|
||||||
|
Location l = new Location();
|
||||||
|
l.setBaiduLongitude(latLng.longitude);
|
||||||
|
l.setBaiduLatitude(latLng.latitude);
|
||||||
|
l.setLocation(lgdu.getAddress());
|
||||||
|
l.setTime(Timer.getTimerT());
|
||||||
|
MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "装货上传成功");
|
||||||
|
//交通厅
|
||||||
|
if (sob.getData().getReport() == 1) {
|
||||||
|
JTTProcess.start(con, sob, "");
|
||||||
|
}
|
||||||
|
//装货状态
|
||||||
|
hyr.loading(lub);
|
||||||
|
//装货照片
|
||||||
|
up_image_z();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(装货):", s + s1);
|
||||||
|
new MessageUtils().showCenMessage(con, s1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传安联和交通厅,平台-卸货
|
||||||
|
*/
|
||||||
|
private void uploadInfo() {
|
||||||
|
|
||||||
|
//安联
|
||||||
|
if (sob.getData().getReportAlct() == 1) {
|
||||||
|
Location l = new Location();
|
||||||
|
l.setBaiduLongitude(latLng.longitude);
|
||||||
|
l.setBaiduLatitude(latLng.latitude);
|
||||||
|
l.setLocation(lgdu.getAddress());
|
||||||
|
l.setTime(Timer.getTimerT());
|
||||||
|
Log.e("-安联卸货信息-", gson.toJson(l));
|
||||||
|
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "卸货上传成功");
|
||||||
|
//交通厅
|
||||||
|
if (sob.getData().getReport() == 1) {
|
||||||
|
JTTProcess.stop(con, sob, "");
|
||||||
|
}
|
||||||
|
//卸货状态-平台
|
||||||
|
hyr.dischargeCargo(lub);
|
||||||
|
//卸货照片-安联
|
||||||
|
up_image();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(卸货):", s + s1);
|
||||||
|
new MessageUtils().showCenMessage(con, s1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -12,7 +12,6 @@ buildscript {
|
|||||||
maven {
|
maven {
|
||||||
url 'https://maven.aliyun.com/repository/releases'
|
url 'https://maven.aliyun.com/repository/releases'
|
||||||
}
|
}
|
||||||
maven { url 'http://lbs-sdk.luokuang.com/repository/maven-releases/' }
|
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:4.2.2'
|
classpath 'com.android.tools.build:gradle:4.2.2'
|
||||||
@@ -32,10 +31,9 @@ allprojects {
|
|||||||
maven {
|
maven {
|
||||||
url 'https://maven.aliyun.com/repository/releases'
|
url 'https://maven.aliyun.com/repository/releases'
|
||||||
}
|
}
|
||||||
maven { url 'http://lbs-sdk.luokuang.com/repository/maven-releases/' }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task clean(type: Delete) {
|
task clean(type: Delete) {
|
||||||
delete rootProject.buildDir
|
delete rootProject.buildDir
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#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\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
@@ -29,24 +29,6 @@ public class ToastUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void showLongToast(Context mContext, String message) {
|
|
||||||
if (!TextUtils.isEmpty(message)) {
|
|
||||||
|
|
||||||
// if ( mToast != null) {
|
|
||||||
// mToast.cancel();
|
|
||||||
// }
|
|
||||||
// mToast = Toast.makeText(mContext, message, Toast.LENGTH_SHORT);
|
|
||||||
// mToast.show();
|
|
||||||
|
|
||||||
if (mToast == null) {
|
|
||||||
mToast = Toast.makeText(mContext, message, Toast.LENGTH_LONG);
|
|
||||||
} else {
|
|
||||||
mToast.setText(message);
|
|
||||||
}
|
|
||||||
mToast.show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void cancelToast(){
|
public static void cancelToast(){
|
||||||
if (mToast!=null)
|
if (mToast!=null)
|
||||||
mToast.cancel();
|
mToast.cancel();
|
||||||
|
|||||||