Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c3b570dad | ||
|
|
b29e3eaf03 |
+4
-24
@@ -33,13 +33,12 @@ android {
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.arpa.hndahesudintocctmsdriver"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 30
|
||||
versionCode 78
|
||||
versionName "3.4.8"
|
||||
versionCode 65
|
||||
versionName "3.3.5"
|
||||
flavorDimensions "CHANNEL_VALUE"
|
||||
flavorDimensions "app_icon"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
@@ -106,8 +105,7 @@ android {
|
||||
JPUSH_CHANNEL: "developer-default"//暂时填写默认值即可.
|
||||
]
|
||||
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi-staging.alct56.com\"")
|
||||
buildConfigField("String", "BASE_URL", "\"http://192.168.1.118:8080/api/\"")
|
||||
// buildConfigField("String", "BASE_URL", "\"http://linux.local:8080/api/\"")
|
||||
buildConfigField("String", "BASE_URL", "\"http://app.test.dahehuoyun.com/api/\"")
|
||||
buildConfigField "boolean", "isTest", "true"
|
||||
//APP名称,可以在androidMainfest中引用
|
||||
resValue "string", "appName", "司机测试"
|
||||
@@ -116,7 +114,7 @@ android {
|
||||
applicationId "com.arpa.hndahesudintocctmsdriver"
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "大河好运司机",
|
||||
app_icon : "@drawable/diver_logo",
|
||||
GAODEKEY : "9480fd96746922630e9bf6c75a101059",
|
||||
GAODEKEY : "c68051b43e79e47a1556fc695371c902",
|
||||
JPUSH_PKGNAME: applicationId,
|
||||
JPUSH_APPKEY : "fba6f55621c670d8c1fe9191", //JPush 上注册的包名对应的 Appkey.
|
||||
JPUSH_CHANNEL: "developer-default"//暂时填写默认值即可.
|
||||
@@ -128,22 +126,6 @@ android {
|
||||
resValue "string", "appName", "大河好运司机"
|
||||
}
|
||||
|
||||
productbc {
|
||||
applicationId "com.arpa.hndahesudintocctmsdriver.bc"
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "大河好运司机",
|
||||
app_icon : "@drawable/diver_logo",
|
||||
GAODEKEY : "f960bc6d14788238918bd014fa08a870",
|
||||
JPUSH_PKGNAME: applicationId,
|
||||
JPUSH_APPKEY : "fba6f55621c670d8c1fe9191", //JPush 上注册的包名对应的 Appkey.
|
||||
JPUSH_CHANNEL: "developer-default"//暂时填写默认值即可.
|
||||
]
|
||||
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi.alct56.com\"")
|
||||
buildConfigField("String", "BASE_URL", "\"http://app.dahehuoyun.com/api/\"")
|
||||
buildConfigField "boolean", "isTest", "false"
|
||||
//APP名称,可以在androidMainfest中引用
|
||||
resValue "string", "appName", "司机运营"
|
||||
}
|
||||
|
||||
}
|
||||
// productFlavors.all { flavor ->
|
||||
// flavor.manifestPlaceholders = [CHANNEL_VALUE: name]
|
||||
@@ -247,6 +229,4 @@ dependencies {
|
||||
|
||||
implementation project(path: ':mylibrary')
|
||||
|
||||
implementation files('libs/mdp-release.aar')
|
||||
|
||||
}
|
||||
Binary file not shown.
@@ -2,7 +2,6 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.arpa.hndahesudintocctmsdriver">
|
||||
|
||||
<uses-permission android:name="android.permission.CALL_PHONE" />
|
||||
<!-- 白名单 -->
|
||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
||||
@@ -12,6 +11,7 @@
|
||||
<!-- 录音 -->
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
||||
<!--播音-->
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
@@ -54,7 +54,7 @@
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.App"
|
||||
android:allowBackup="true"
|
||||
android:excludeFromRecents="true"
|
||||
android:icon="@mipmap/diver_log_yy"
|
||||
android:icon="@mipmap/diver_logo"
|
||||
android:label="@string/appName"
|
||||
android:largeHeap="true"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
@@ -72,14 +72,14 @@
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"></activity>
|
||||
android:screenOrientation="portrait" ></activity>
|
||||
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.wallet.WithdrawalActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.wallet.UpBankActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.OrderAllActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
@@ -94,11 +94,11 @@
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.PhotoCarActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||
android:windowSoftInputMode="adjustPan|stateHidden"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.VehicleAuthActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity"
|
||||
android:screenOrientation="portrait">
|
||||
@@ -143,13 +143,13 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.GetShangChuanActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.AuthQualificationActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.OrderListActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.HuoYunDelActivity"
|
||||
android:screenOrientation="portrait">
|
||||
@@ -162,19 +162,14 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||
android:windowSoftInputMode="adjustPan|stateHidden"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.AddCarSuccActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.FaceSuccActivity"
|
||||
android:exported="true"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.login.WelcomeActivity"
|
||||
android:exported="true"
|
||||
@@ -198,33 +193,28 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.drivercircle.VideoReleaseActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.WebPDFActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.StartYunDanActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait">
|
||||
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.drivercircle.HomePageActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.alert.VehicleChoiceActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.OrderComplaintActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.web.WebActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.web.WebOnlyOneActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.web.WebKfActivity"
|
||||
android:screenOrientation="portrait"
|
||||
@@ -234,7 +224,7 @@
|
||||
<activity
|
||||
android:name=".ui.news.NewActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
|
||||
<service
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.service.TrackService"
|
||||
@@ -254,15 +244,6 @@
|
||||
android:name="com.alct.mdp.MDPLocationService"
|
||||
android:exported="true"
|
||||
android:process=":mdpLocation_v1" />
|
||||
|
||||
<!--后台访问 gps-->
|
||||
<service
|
||||
android:name="com.express.mdp.GpsService"
|
||||
android:foregroundServiceType="location"
|
||||
android:label="GPS服务"
|
||||
android:priority="1000" />
|
||||
|
||||
|
||||
<service
|
||||
android:name="com.baidu.location.f"
|
||||
android:enabled="true"
|
||||
@@ -286,9 +267,10 @@
|
||||
<meta-data
|
||||
android:name="com.amap.api.v2.apikey"
|
||||
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"
|
||||
android:foregroundServiceType="location"></service>
|
||||
|
||||
<!--百度地图-->
|
||||
<meta-data
|
||||
@@ -382,39 +364,10 @@
|
||||
|
||||
<activity
|
||||
android:name=".H5Activity"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait">
|
||||
android:screenOrientation="portrait"
|
||||
android:launchMode="singleTask">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data
|
||||
android:host="demo"
|
||||
android:path="/signBack"
|
||||
android:scheme="esign" />
|
||||
<data
|
||||
android:host="demo"
|
||||
android:path="/realBack"
|
||||
android:scheme="esign" />
|
||||
|
||||
<data
|
||||
android:host="driver"
|
||||
android:path="/realBack"
|
||||
android:port="8088"
|
||||
android:scheme="dahe" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".H5Activity2"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
|
||||
@@ -63,8 +63,8 @@ public class App extends Application {
|
||||
}
|
||||
//在使用SDK各组件之前初始化context信息,传入ApplicationContext
|
||||
// 路由初始化
|
||||
// JVerificationInterface.setDebugMode(true);
|
||||
// JVerificationInterface.init(this, 5000, (code, msg) -> Log.d("tag", "code = " + code + " msg = " + msg));
|
||||
JVerificationInterface.setDebugMode(true);
|
||||
JVerificationInterface.init(this, 5000, (code, msg) -> Log.d("tag", "code = " + code + " msg = " + msg));
|
||||
//友盟
|
||||
//设置非debug版本开启
|
||||
if (!isDebugVersion(con)) {
|
||||
@@ -78,29 +78,30 @@ public class App extends Application {
|
||||
}
|
||||
}
|
||||
|
||||
// PendingIntent pendingIntent =
|
||||
// PendingIntent.getActivity(this, 0, new Intent(this, MainActivity.class), PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
// Cactus.getInstance()
|
||||
// .isDebug(true)
|
||||
// //可选,设置通知栏点击事件
|
||||
// .setPendingIntent(pendingIntent)
|
||||
//// .setBackgroundMusicEnabled(true)//可选,退到后台是否可以播放音乐
|
||||
//// .setMusicId(R.raw.main) //可选,设置音乐
|
||||
//// .setPendingIntent(pendingIntent)//可选,设置通知栏点击事件
|
||||
//// .addCallback(new CactusCallback())//可选,运行时回调
|
||||
// .setCrashRestartUIEnabled(true) //可选,设置奔溃可以重启,google原生rom android 10以下可以正常重启
|
||||
// .setCrashRestartUIEnabled(true)//可选,设置奔溃可以重启,google原生rom android 10以下可以正常重启
|
||||
// .setTitle("大河好运")
|
||||
// .setSmallIcon(R.drawable.diver_logo)
|
||||
// .addBackgroundCallback(new CactusBackgroundCallback() {
|
||||
// @Override
|
||||
// public void onBackground(boolean b) {
|
||||
// if (b){
|
||||
// getBillLocation();
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// .register(this);
|
||||
PendingIntent pendingIntent =
|
||||
PendingIntent.getActivity(this, 0, new Intent(this, MainActivity.class), PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
Cactus.getInstance()
|
||||
.isDebug(true)
|
||||
//可选,设置通知栏点击事件
|
||||
.setPendingIntent(pendingIntent)
|
||||
.setBackgroundMusicEnabled(true)//可选,退到后台是否可以播放音乐
|
||||
.setMusicId(R.raw.main) //可选,设置音乐
|
||||
// .setPendingIntent(pendingIntent)//可选,设置通知栏点击事件
|
||||
// .addCallback(new CactusCallback())//可选,运行时回调
|
||||
.setCrashRestartUIEnabled(true) //可选,设置奔溃可以重启,google原生rom android 10以下可以正常重启
|
||||
.setCrashRestartUIEnabled(true)//可选,设置奔溃可以重启,google原生rom android 10以下可以正常重启
|
||||
.setTitle("大河好运")
|
||||
.setContent("大河好运司机端为您提供服务")
|
||||
.setSmallIcon(R.drawable.diver_logo)
|
||||
.addBackgroundCallback(new CactusBackgroundCallback() {
|
||||
@Override
|
||||
public void onBackground(boolean b) {
|
||||
if (b){
|
||||
getBillLocation();
|
||||
}
|
||||
}
|
||||
})
|
||||
.register(this);
|
||||
}
|
||||
|
||||
public static App getApp() {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,6 @@ package com.arpa.hndahesudintocctmsdriver;
|
||||
import android.Manifest;
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
@@ -41,14 +40,10 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.cuspop.SimCenterPop;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.FaceEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.UserRequset;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.UiAuxiliary;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.FaceSuccActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.home.StartYunDanActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.dahe.mylibrary.utils.ActivityUtils;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.esign.esignsdk.EsignSdk;
|
||||
import com.esign.esignsdk.h5.base.WBH5FaceVerifySDK;
|
||||
@@ -78,38 +73,25 @@ public class H5Activity extends AppCompatActivity {
|
||||
|
||||
String curUrl = null;
|
||||
boolean viewFile = false;
|
||||
boolean isGoCar = false;
|
||||
|
||||
long time = System.currentTimeMillis();
|
||||
|
||||
ValueCallback<Uri> uploadMessage;
|
||||
private ValueCallback<Uri[]> uploadMessageAboveL;
|
||||
private final static int FILE_CHOOSER_RESULT_CODE = 10000;
|
||||
private Context ctx;
|
||||
private boolean isOk = false;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
super.setContentView(R.layout.activity_h5);
|
||||
ctx = this;
|
||||
|
||||
|
||||
mWebView = findViewById(R.id.webview);
|
||||
ImageView back = findViewById(R.id.back);
|
||||
TextView close = findViewById(R.id.close);
|
||||
TextView tvTitle = findViewById(R.id.tv_title);
|
||||
WebSettings webSetting = mWebView.getSettings();
|
||||
|
||||
String title = getIntent().getStringExtra("title");
|
||||
if (!TextUtils.isEmpty(title)) {
|
||||
tvTitle.setText(title);
|
||||
}
|
||||
|
||||
back.setOnClickListener(v -> {
|
||||
if (isOk) {
|
||||
ActivityUtils.finishToActivity(MainActivity.class, false);
|
||||
return;
|
||||
}
|
||||
if (mWebView.canGoBack()) {
|
||||
mWebView.goBack();
|
||||
} else {
|
||||
@@ -118,10 +100,6 @@ public class H5Activity extends AppCompatActivity {
|
||||
});
|
||||
|
||||
close.setOnClickListener(v -> {
|
||||
if (isOk) {
|
||||
ActivityUtils.finishToActivity(MainActivity.class, false);
|
||||
return;
|
||||
}
|
||||
if (mWebView.canGoBack()) {
|
||||
mWebView.goBack();
|
||||
} else {
|
||||
@@ -136,9 +114,6 @@ public class H5Activity extends AppCompatActivity {
|
||||
webSetting.setLoadWithOverviewMode(true);
|
||||
webSetting.setAllowFileAccess(true);
|
||||
webSetting.setAppCacheEnabled(true);
|
||||
webSetting.setAllowContentAccess(true);
|
||||
webSetting.setLoadsImagesAutomatically(true);
|
||||
webSetting.setMediaPlaybackRequiresUserGesture(true);
|
||||
String appCachePath = getApplication().getCacheDir().getAbsolutePath();
|
||||
webSetting.setAppCachePath(appCachePath);
|
||||
webSetting.setDatabaseEnabled(true);
|
||||
@@ -205,21 +180,11 @@ public class H5Activity extends AppCompatActivity {
|
||||
private void processExtraData() {
|
||||
|
||||
Intent intent = getIntent();
|
||||
isGoCar = intent.getBooleanExtra("isGoCar", false);
|
||||
Uri uri = intent.getData();
|
||||
Log.e("test", "===" + uri);
|
||||
if (uri != null) {
|
||||
// 芝麻认证刷脸结束返回获取后续操作页面地址
|
||||
// String callbackUrl = uri.getQueryParameter("callback");
|
||||
String urlString = uri.toString();
|
||||
if ("dahe://driver:8088/realBack".equals(urlString)) {
|
||||
Intent in = new Intent(ctx, FaceSuccActivity.class);
|
||||
in.putExtra("isGoCar", true);
|
||||
startActivity(in);
|
||||
ActivityUtils.finishToActivity(MainActivity.class, false);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
String callbackUrl = uri.getQueryParameter("realnameUrl");
|
||||
if (!TextUtils.isEmpty(callbackUrl)) {
|
||||
@@ -232,29 +197,15 @@ public class H5Activity extends AppCompatActivity {
|
||||
|
||||
} else {
|
||||
String url = intent.getStringExtra("url");
|
||||
if (TextUtils.isEmpty(url)) {
|
||||
ActivityUtils.finishToActivity(MainActivity.class, false);
|
||||
return;
|
||||
}
|
||||
viewFile = intent.getBooleanExtra("view_file", false);
|
||||
if (url.startsWith("alipay")) {
|
||||
|
||||
try {
|
||||
Intent intent2 = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||
intent2.putExtra("isGoCar", isGoCar);
|
||||
startActivity(intent2);
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
}
|
||||
// }else if (url.startsWith("https://agreement.dahehuoyun.com/#/1ba5c216/912f4c9587/5eb5184653/6ef9")) {
|
||||
} else if (url.startsWith("https://agreement.dahehuoyun.com")) {
|
||||
Intent in = new Intent(ctx, FaceSuccActivity.class);
|
||||
startActivity(in);
|
||||
if (isGoCar) {
|
||||
ActivityUtils.finishToActivity(MainActivity.class, false);
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (curUrl == null) {
|
||||
curUrl = url;
|
||||
@@ -274,30 +225,6 @@ public class H5Activity extends AppCompatActivity {
|
||||
Uri uri = Uri.parse(url);
|
||||
Log.e("test", "要加载的地址:" + uri.getScheme() + " " + url + " ");
|
||||
if (uri.getScheme().equals("http") || uri.getScheme().equals("https")) {
|
||||
// if (url.startsWith("https://agreement.dahehuoyun.com/#/1ba5c216/912f4c9587/5eb5184653/6ef9")) {
|
||||
if (url.startsWith("https://agreement.dahehuoyun.com")) {
|
||||
Intent in = new Intent(ctx, FaceSuccActivity.class);
|
||||
in.putExtra("isGoCar", isGoCar);
|
||||
startActivity(in);
|
||||
if (isGoCar) {
|
||||
ActivityUtils.finishToActivity(MainActivity.class, false);
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// if (isGoCar&&url.startsWith("https://agreement.dahehuoyun.com/#/1ba5c216/912f4c9587/5eb5184653/6ef9")){
|
||||
// isOk = true;
|
||||
// view.loadUrl(url);
|
||||
// new MessageUtils().showSimCenPop(ctx, "个人信息上传成功,请添加车辆信息!", "去添加",() -> {
|
||||
// Intent in = new Intent(ctx, CertificatesActivity.class);
|
||||
// in.putExtra("index", 2);
|
||||
// startActivity(in);
|
||||
// ActivityUtils.finishToActivity(MainActivity.class,false);
|
||||
// });
|
||||
// return true;
|
||||
// }
|
||||
view.loadUrl(url);
|
||||
return true;
|
||||
} else if (uri.getScheme().equals("js") || uri.getScheme().equals("jsbridge")) {
|
||||
@@ -334,12 +261,6 @@ public class H5Activity extends AppCompatActivity {
|
||||
// 实名认证结束 返回按钮/倒计时返回/暂不认证
|
||||
boolean status = uri.getBooleanQueryParameter("status", false);
|
||||
if (status) {
|
||||
//认证成功返回
|
||||
new Handler().postDelayed(() -> {
|
||||
FaceEvent he = new FaceEvent("刷脸成功");
|
||||
EventBus.getDefault().post(he);
|
||||
finish();
|
||||
}, 800);
|
||||
//认证成功返回
|
||||
Toast.makeText(H5Activity.this, "认证成功", Toast.LENGTH_LONG).show();
|
||||
finish();
|
||||
@@ -357,12 +278,6 @@ public class H5Activity extends AppCompatActivity {
|
||||
boolean status = uri.getBooleanQueryParameter("status", false);
|
||||
if (status) {
|
||||
//认证成功返回
|
||||
//认证成功返回
|
||||
// new Handler().postDelayed(() -> {
|
||||
// FaceEvent he = new FaceEvent("刷脸成功");
|
||||
// EventBus.getDefault().post(he);
|
||||
// finish();
|
||||
// }, 800);
|
||||
Toast.makeText(H5Activity.this, "认证成功", Toast.LENGTH_LONG).show();
|
||||
finish();
|
||||
}
|
||||
|
||||
@@ -1,485 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver;
|
||||
|
||||
import static android.webkit.WebSettings.LOAD_NO_CACHE;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.net.http.SslError;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.webkit.ConsoleMessage;
|
||||
import android.webkit.CookieManager;
|
||||
import android.webkit.CookieSyncManager;
|
||||
import android.webkit.JsPromptResult;
|
||||
import android.webkit.JsResult;
|
||||
import android.webkit.PermissionRequest;
|
||||
import android.webkit.SslErrorHandler;
|
||||
import android.webkit.ValueCallback;
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebResourceError;
|
||||
import android.webkit.WebResourceRequest;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.event.FaceEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StatusBar;
|
||||
import com.esign.esignsdk.h5.base.WBH5FaceVerifySDK;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
|
||||
import pub.devrel.easypermissions.EasyPermissions;
|
||||
import qiu.niorgai.StatusBarCompat;
|
||||
|
||||
/**
|
||||
* @author xingtian on 2019/3/25
|
||||
*/
|
||||
public class H5Activity2 extends AppCompatActivity {
|
||||
|
||||
public static final int REQUEST_PERMISSION_STORAGE = 0x00;
|
||||
public static final int REQUEST_PERMISSION_CAMERA = 0x01;
|
||||
|
||||
public final static String SCHEMA_REAL = "esign://demo/realBack";
|
||||
|
||||
public final static String SCHEMA_SIGN = "esign://demo/signBack";
|
||||
|
||||
private WebView mWebView;
|
||||
|
||||
String curUrl = null;
|
||||
boolean viewFile = false;
|
||||
|
||||
long time = System.currentTimeMillis();
|
||||
|
||||
ValueCallback<Uri> uploadMessage;
|
||||
private ValueCallback<Uri[]> uploadMessageAboveL;
|
||||
private final static int FILE_CHOOSER_RESULT_CODE = 10000;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
super.setContentView(R.layout.activity_h5);
|
||||
StatusBarCompat.setStatusBarColor(this, ContextCompat.getColor(this, R.color.white), 0);
|
||||
StatusBar.changeToLightStatusBar(this); //黑色 下边白色
|
||||
|
||||
mWebView = findViewById(R.id.webview);
|
||||
// ImageView back = findViewById(R.id.back);
|
||||
// TextView close = findViewById(R.id.close);
|
||||
WebSettings webSetting = mWebView.getSettings();
|
||||
|
||||
// back.setOnClickListener(v -> {
|
||||
// if (mWebView.canGoBack()) {
|
||||
// mWebView.goBack();
|
||||
// } else {
|
||||
// finish();
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// close.setOnClickListener(v -> {
|
||||
// if (mWebView.canGoBack()) {
|
||||
// mWebView.goBack();
|
||||
// } else {
|
||||
// finish();
|
||||
// }
|
||||
// });
|
||||
|
||||
webSetting.setJavaScriptEnabled(true);
|
||||
webSetting.setDomStorageEnabled(true);
|
||||
// webSetting.setAppCacheMaxSize(1024 * 1024 * 8);
|
||||
webSetting.setUseWideViewPort(true);
|
||||
webSetting.setLoadWithOverviewMode(true);
|
||||
webSetting.setAllowFileAccess(true);
|
||||
// webSetting.setAppCacheEnabled(true);
|
||||
String appCachePath = getApplication().getCacheDir().getAbsolutePath();
|
||||
// webSetting.setAppCachePath(appCachePath);
|
||||
webSetting.setDatabaseEnabled(true);
|
||||
webSetting.setCacheMode(LOAD_NO_CACHE);
|
||||
webSetting.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
WebView.setWebContentsDebuggingEnabled(true);
|
||||
}
|
||||
|
||||
CookieSyncManager.createInstance(this);
|
||||
CookieManager cookieManager = CookieManager.getInstance();
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
cookieManager.setAcceptThirdPartyCookies(mWebView, true);
|
||||
}
|
||||
cookieManager.setAcceptCookie(true);
|
||||
|
||||
|
||||
mWebView.setWebViewClient(new MyWebViewClient());
|
||||
mWebView.setWebChromeClient(new H5FaceWebChromeClient(this));
|
||||
|
||||
WBH5FaceVerifySDK.getInstance().setWebViewSettings(mWebView, getApplicationContext());
|
||||
|
||||
processExtraData();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
mWebView.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
mWebView.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
mWebView.stopLoading();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
try {
|
||||
if (mWebView != null) {
|
||||
mWebView.removeAllViews();
|
||||
mWebView.destroy();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
setIntent(intent);
|
||||
processExtraData();
|
||||
}
|
||||
|
||||
private void processExtraData() {
|
||||
|
||||
Intent intent = getIntent();
|
||||
Uri uri = intent.getData();
|
||||
Log.e("test", "===" + uri);
|
||||
if (uri != null) {
|
||||
// 芝麻认证刷脸结束返回获取后续操作页面地址
|
||||
// String callbackUrl = uri.getQueryParameter("callback");
|
||||
|
||||
String callbackUrl = uri.getQueryParameter("realnameUrl");
|
||||
if (!TextUtils.isEmpty(callbackUrl)) {
|
||||
try {
|
||||
mWebView.loadUrl(URLDecoder.decode(callbackUrl, "utf-8"));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
String url = intent.getStringExtra("url");
|
||||
viewFile = intent.getBooleanExtra("view_file", false);
|
||||
if (url.startsWith("alipay")) {
|
||||
|
||||
try {
|
||||
Intent intent2 = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||
startActivity(intent2);
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
if (curUrl == null) {
|
||||
curUrl = url;
|
||||
}
|
||||
mWebView.loadUrl(url);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private class MyWebViewClient extends WebViewClient {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
if (url == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Uri uri = Uri.parse(url);
|
||||
Log.e("test", "要加载的地址:" + uri.getScheme() + " " + url + " ");
|
||||
if (uri.getScheme().equals("http") || uri.getScheme().equals("https")) {
|
||||
view.loadUrl(url);
|
||||
return true;
|
||||
} else if (uri.getScheme().equals("js") || uri.getScheme().equals("jsbridge")) {
|
||||
|
||||
// js://signCallback?signResult=true 签署结果
|
||||
if (uri.getAuthority().equals("signCallback")) {
|
||||
if (viewFile) {
|
||||
view.loadUrl(curUrl);
|
||||
return true;
|
||||
} else {
|
||||
if (url.contains("signResult")) {
|
||||
boolean signResult = uri.getBooleanQueryParameter("signResult", false);
|
||||
Toast.makeText(H5Activity2.this, "签署结果: " + " signResult = " + signResult, Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
String tsignCode = uri.getQueryParameter("tsignCode");
|
||||
if ("0".equals(tsignCode)) {
|
||||
tsignCode = "签署成功";
|
||||
} else {
|
||||
tsignCode = "签署失败";
|
||||
}
|
||||
Toast.makeText(H5Activity2.this, "签署结果: " + tsignCode, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
//js://tsignRealBack?esignAppScheme=esign://app/callback&serviceId=854677892133554052&verifycode=4a52e2af0d0abfb7b285c4f05b5af133&status=true&passed=true
|
||||
//实名结果
|
||||
if (uri.getAuthority().equals("tsignRealBack")) {
|
||||
//实名结果字段
|
||||
if (uri.getQueryParameter("verifycode") != null) {
|
||||
String realVerifyCode = uri.getQueryParameter("verifycode");
|
||||
}
|
||||
// 实名认证结束 返回按钮/倒计时返回/暂不认证
|
||||
boolean status = uri.getBooleanQueryParameter("status", false);
|
||||
if (status) {
|
||||
//认证成功返回
|
||||
new Handler().postDelayed(() -> {
|
||||
FaceEvent he = new FaceEvent("刷脸成功");
|
||||
EventBus.getDefault().post(he);
|
||||
finish();
|
||||
}, 800);
|
||||
Toast.makeText(H5Activity2.this, "认证成功", Toast.LENGTH_LONG).show();
|
||||
// finish();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else if (url.startsWith(SCHEMA_REAL)) {
|
||||
//esign://app/realBack&serviceId=854677892133554052&verifycode=4a52e2af0d0abfb7b285c4f05b5af133&status=true&passed=true
|
||||
|
||||
//实名结果
|
||||
if (uri.getQueryParameter("verifycode") != null) {
|
||||
String realVerifyCode = uri.getQueryParameter("verifycode");
|
||||
}
|
||||
// 实名认证结束 返回按钮/倒计时返回/暂不认证
|
||||
boolean status = uri.getBooleanQueryParameter("status", false);
|
||||
if (status) {
|
||||
//认证成功返回
|
||||
new Handler().postDelayed(() -> {
|
||||
FaceEvent he = new FaceEvent("刷脸成功");
|
||||
EventBus.getDefault().post(he);
|
||||
finish();
|
||||
}, 800);
|
||||
Toast.makeText(H5Activity2.this, "认证成功", Toast.LENGTH_LONG).show();
|
||||
// finish();
|
||||
}
|
||||
|
||||
return true;
|
||||
} else if (url.startsWith(SCHEMA_SIGN)) {
|
||||
// js://signCallback?signResult=true 签署结果
|
||||
if (url.contains("signResult")) {
|
||||
boolean signResult = uri.getBooleanQueryParameter("signResult", false);
|
||||
Toast.makeText(H5Activity2.this, "签署结果: " + " signResult = " + signResult, Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
String tsignCode = uri.getQueryParameter("tsignCode");
|
||||
if ("0".equals(tsignCode)) {
|
||||
//延时1.5秒跳转运单详情页面
|
||||
// new Handler().postDelayed(() -> {
|
||||
// FaceEvent he = new FaceEvent("刷脸成功");
|
||||
// EventBus.getDefault().post(he);
|
||||
// finish();
|
||||
// }, 800);
|
||||
tsignCode = "签署成功";
|
||||
} else {
|
||||
tsignCode = "签署失败";
|
||||
}
|
||||
Toast.makeText(H5Activity2.this, "签署结果: " + tsignCode, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
// finish();
|
||||
return true;
|
||||
} else if (uri.getScheme().equals("alipays")) {
|
||||
// 跳转到支付宝刷脸
|
||||
// alipays://platformapi/startapp?appId=20000067&pd=NO&url=https%3A%2F%2Fzmcustprod.zmxy.com.cn%2Fcertify%2Fbegin.htm%3Ftoken%3DZM201811133000000050500431389414
|
||||
try {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||
startActivity(intent);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
|
||||
super.onReceivedError(view, request, error);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
|
||||
// super.onReceivedSslError(view, handler, error);
|
||||
handler.proceed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageStarted(WebView view, String url, Bitmap favicon) {
|
||||
super.onPageStarted(view, url, favicon);
|
||||
time = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
super.onPageFinished(view, url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadResource(WebView view, String url) {
|
||||
super.onLoadResource(view, url);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class H5FaceWebChromeClient extends WebChromeClient {
|
||||
private Activity activity;
|
||||
|
||||
public H5FaceWebChromeClient(Activity mActivity) {
|
||||
this.activity = mActivity;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onReceivedTitle(WebView view, String title) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result) {
|
||||
return super.onJsPrompt(view, url, message, defaultValue, result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onJsConfirm(WebView view, String url, String message, JsResult result) {
|
||||
return super.onJsConfirm(view, url, message, result);
|
||||
}
|
||||
|
||||
@TargetApi(8)
|
||||
@Override
|
||||
public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
|
||||
return super.onConsoleMessage(consoleMessage);
|
||||
}
|
||||
|
||||
public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType) {
|
||||
if (WBH5FaceVerifySDK.getInstance().recordVideoForApiBelow21(uploadMsg, acceptType, activity)) {
|
||||
return;
|
||||
}
|
||||
uploadMessage = uploadMsg;
|
||||
}
|
||||
|
||||
public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture) {
|
||||
if (WBH5FaceVerifySDK.getInstance().recordVideoForApiBelow21(uploadMsg, acceptType, activity)) {
|
||||
return;
|
||||
}
|
||||
uploadMessage = uploadMessage;
|
||||
}
|
||||
|
||||
@TargetApi(21)
|
||||
@Override
|
||||
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, FileChooserParams fileChooserParams) {
|
||||
if (WBH5FaceVerifySDK.getInstance().recordVideoForApi21(webView, filePathCallback, activity, fileChooserParams)) {
|
||||
return true;
|
||||
}
|
||||
uploadMessageAboveL = filePathCallback;
|
||||
recordVideo(H5Activity2.this);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPermissionRequest(PermissionRequest request) {
|
||||
request.grant(request.getResources());
|
||||
request.getOrigin();
|
||||
}
|
||||
}
|
||||
|
||||
public void recordVideo(Activity activity) {
|
||||
if (EasyPermissions.hasPermissions(activity, Manifest.permission.CAMERA)) {
|
||||
try {
|
||||
Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
|
||||
intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
|
||||
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
intent.putExtra("android.intent.extras.CAMERA_FACING", 1); // 调用前置摄像头
|
||||
activity.startActivityForResult(intent, FILE_CHOOSER_RESULT_CODE);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
EasyPermissions.requestPermissions(activity, "请同意使用相机功能", REQUEST_PERMISSION_CAMERA, Manifest.permission.CAMERA);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||
if (mWebView.canGoBack()) {
|
||||
mWebView.goBack();
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
|
||||
if (WBH5FaceVerifySDK.getInstance().receiveH5FaceVerifyResult(requestCode, resultCode, data)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (requestCode == FILE_CHOOSER_RESULT_CODE) {
|
||||
if (null == uploadMessage && null == uploadMessageAboveL) {
|
||||
return;
|
||||
}
|
||||
Uri result = data == null || resultCode != RESULT_OK ? null : data.getData();
|
||||
if (uploadMessageAboveL != null) {
|
||||
if (resultCode == RESULT_OK) {
|
||||
uploadMessageAboveL.onReceiveValue(new Uri[]{result});
|
||||
uploadMessageAboveL = null;
|
||||
} else {
|
||||
uploadMessageAboveL.onReceiveValue(new Uri[]{});
|
||||
uploadMessageAboveL = null;
|
||||
}
|
||||
} else if (uploadMessage != null) {
|
||||
if (resultCode == RESULT_OK) {
|
||||
uploadMessage.onReceiveValue(result);
|
||||
uploadMessage = null;
|
||||
} else {
|
||||
uploadMessage.onReceiveValue(Uri.EMPTY);
|
||||
uploadMessage = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
WBH5FaceVerifySDK.getInstance().recordVideo(this);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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 + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,395 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName CarInfoBean2
|
||||
* @Author john
|
||||
* @Date 2024/11/20 15:43
|
||||
* @Description TODO
|
||||
*/
|
||||
public class CarInfoBean2 implements Serializable {
|
||||
|
||||
|
||||
private int code;
|
||||
private DataDTO data;
|
||||
private String msg;
|
||||
private String remark;
|
||||
private int res;
|
||||
private boolean success;
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public DataDTO getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(DataDTO data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public int getRes() {
|
||||
return res;
|
||||
}
|
||||
|
||||
public void setRes(int res) {
|
||||
this.res = res;
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public static class DataDTO {
|
||||
private String allAuality;
|
||||
private String allCapacity;
|
||||
private String approvedCapacity;
|
||||
private String auditStatus;
|
||||
private String auditTime;
|
||||
private String backImage;
|
||||
private String backStatus;
|
||||
private String backTime;
|
||||
private String carId;
|
||||
private String carNumber;
|
||||
private String checkRecord;
|
||||
private String createTime;
|
||||
private String dateIssue;
|
||||
private String engineNumber;
|
||||
private String fileNumber;
|
||||
private String frontImage;
|
||||
private String frontStatus;
|
||||
private String frontTime;
|
||||
private String fuelType;
|
||||
private String id;
|
||||
private String model;
|
||||
private String nature;
|
||||
private String organizationName;
|
||||
private String owner;
|
||||
private String personCapacity;
|
||||
private String registerDate;
|
||||
private String remark;
|
||||
private String size;
|
||||
private String threeImage;
|
||||
private String threeImageStatus;
|
||||
private String towAuality;
|
||||
private String trailer;
|
||||
private String trailerId;
|
||||
private String type;
|
||||
private String vehicleAxis;
|
||||
private String vehicleNumber;
|
||||
|
||||
public String getTrailerId() {
|
||||
return trailerId;
|
||||
}
|
||||
|
||||
public void setTrailerId(String trailerId) {
|
||||
this.trailerId = trailerId;
|
||||
}
|
||||
|
||||
public String getAllAuality() {
|
||||
return allAuality;
|
||||
}
|
||||
|
||||
public void setAllAuality(String allAuality) {
|
||||
this.allAuality = allAuality;
|
||||
}
|
||||
|
||||
public String getAllCapacity() {
|
||||
return allCapacity;
|
||||
}
|
||||
|
||||
public void setAllCapacity(String allCapacity) {
|
||||
this.allCapacity = allCapacity;
|
||||
}
|
||||
|
||||
public String getApprovedCapacity() {
|
||||
return approvedCapacity;
|
||||
}
|
||||
|
||||
public void setApprovedCapacity(String approvedCapacity) {
|
||||
this.approvedCapacity = approvedCapacity;
|
||||
}
|
||||
|
||||
public String getAuditStatus() {
|
||||
return auditStatus;
|
||||
}
|
||||
|
||||
public void setAuditStatus(String auditStatus) {
|
||||
this.auditStatus = auditStatus;
|
||||
}
|
||||
|
||||
public String getAuditTime() {
|
||||
return auditTime;
|
||||
}
|
||||
|
||||
public void setAuditTime(String auditTime) {
|
||||
this.auditTime = auditTime;
|
||||
}
|
||||
|
||||
public String getBackImage() {
|
||||
return backImage;
|
||||
}
|
||||
|
||||
public void setBackImage(String backImage) {
|
||||
this.backImage = backImage;
|
||||
}
|
||||
|
||||
public String getBackStatus() {
|
||||
return backStatus;
|
||||
}
|
||||
|
||||
public void setBackStatus(String backStatus) {
|
||||
this.backStatus = backStatus;
|
||||
}
|
||||
|
||||
public String getBackTime() {
|
||||
return backTime;
|
||||
}
|
||||
|
||||
public void setBackTime(String backTime) {
|
||||
this.backTime = backTime;
|
||||
}
|
||||
|
||||
public String getCarId() {
|
||||
return carId;
|
||||
}
|
||||
|
||||
public void setCarId(String carId) {
|
||||
this.carId = carId;
|
||||
}
|
||||
|
||||
public String getCarNumber() {
|
||||
return carNumber;
|
||||
}
|
||||
|
||||
public void setCarNumber(String carNumber) {
|
||||
this.carNumber = carNumber;
|
||||
}
|
||||
|
||||
public String getCheckRecord() {
|
||||
return checkRecord;
|
||||
}
|
||||
|
||||
public void setCheckRecord(String checkRecord) {
|
||||
this.checkRecord = checkRecord;
|
||||
}
|
||||
|
||||
public String getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getDateIssue() {
|
||||
return dateIssue;
|
||||
}
|
||||
|
||||
public void setDateIssue(String dateIssue) {
|
||||
this.dateIssue = dateIssue;
|
||||
}
|
||||
|
||||
public String getEngineNumber() {
|
||||
return engineNumber;
|
||||
}
|
||||
|
||||
public void setEngineNumber(String engineNumber) {
|
||||
this.engineNumber = engineNumber;
|
||||
}
|
||||
|
||||
public String getFileNumber() {
|
||||
return fileNumber;
|
||||
}
|
||||
|
||||
public void setFileNumber(String fileNumber) {
|
||||
this.fileNumber = fileNumber;
|
||||
}
|
||||
|
||||
public String getFrontImage() {
|
||||
return frontImage;
|
||||
}
|
||||
|
||||
public void setFrontImage(String frontImage) {
|
||||
this.frontImage = frontImage;
|
||||
}
|
||||
|
||||
public String getFrontStatus() {
|
||||
return frontStatus;
|
||||
}
|
||||
|
||||
public void setFrontStatus(String frontStatus) {
|
||||
this.frontStatus = frontStatus;
|
||||
}
|
||||
|
||||
public String getFrontTime() {
|
||||
return frontTime;
|
||||
}
|
||||
|
||||
public void setFrontTime(String frontTime) {
|
||||
this.frontTime = frontTime;
|
||||
}
|
||||
|
||||
public String getFuelType() {
|
||||
return fuelType;
|
||||
}
|
||||
|
||||
public void setFuelType(String fuelType) {
|
||||
this.fuelType = fuelType;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getModel() {
|
||||
return model;
|
||||
}
|
||||
|
||||
public void setModel(String model) {
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
public String getNature() {
|
||||
return nature;
|
||||
}
|
||||
|
||||
public void setNature(String nature) {
|
||||
this.nature = nature;
|
||||
}
|
||||
|
||||
public String getOrganizationName() {
|
||||
return organizationName;
|
||||
}
|
||||
|
||||
public void setOrganizationName(String organizationName) {
|
||||
this.organizationName = organizationName;
|
||||
}
|
||||
|
||||
public String getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
public void setOwner(String owner) {
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public String getPersonCapacity() {
|
||||
return personCapacity;
|
||||
}
|
||||
|
||||
public void setPersonCapacity(String personCapacity) {
|
||||
this.personCapacity = personCapacity;
|
||||
}
|
||||
|
||||
public String getRegisterDate() {
|
||||
return registerDate;
|
||||
}
|
||||
|
||||
public void setRegisterDate(String registerDate) {
|
||||
this.registerDate = registerDate;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public void setSize(String size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
public String getThreeImage() {
|
||||
return threeImage;
|
||||
}
|
||||
|
||||
public void setThreeImage(String threeImage) {
|
||||
this.threeImage = threeImage;
|
||||
}
|
||||
|
||||
public String getThreeImageStatus() {
|
||||
return threeImageStatus;
|
||||
}
|
||||
|
||||
public void setThreeImageStatus(String threeImageStatus) {
|
||||
this.threeImageStatus = threeImageStatus;
|
||||
}
|
||||
|
||||
public String getTowAuality() {
|
||||
return towAuality;
|
||||
}
|
||||
|
||||
public void setTowAuality(String towAuality) {
|
||||
this.towAuality = towAuality;
|
||||
}
|
||||
|
||||
public String getTrailer() {
|
||||
return trailer;
|
||||
}
|
||||
|
||||
public void setTrailer(String trailer) {
|
||||
this.trailer = trailer;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getVehicleAxis() {
|
||||
return vehicleAxis;
|
||||
}
|
||||
|
||||
public void setVehicleAxis(String vehicleAxis) {
|
||||
this.vehicleAxis = vehicleAxis;
|
||||
}
|
||||
|
||||
public String getVehicleNumber() {
|
||||
return vehicleNumber;
|
||||
}
|
||||
|
||||
public void setVehicleNumber(String vehicleNumber) {
|
||||
this.vehicleNumber = vehicleNumber;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,18 +68,9 @@ public class CarListBean {
|
||||
private Object carImage;
|
||||
private String owner;
|
||||
private String vehicleNumber;
|
||||
private String outInvoice;
|
||||
private int auditStatus;
|
||||
private String drivingLicenseValidity;
|
||||
|
||||
public String getOutInvoice() {
|
||||
return outInvoice;
|
||||
}
|
||||
|
||||
public void setOutInvoice(String outInvoice) {
|
||||
this.outInvoice = outInvoice;
|
||||
}
|
||||
|
||||
public String getCarNumber() {
|
||||
return carNumber == null ? "" : carNumber;
|
||||
}
|
||||
|
||||
@@ -57,15 +57,12 @@ public class DriverAuthDataBean {
|
||||
private String idcardValidity;
|
||||
private String dirverAllowType;
|
||||
private int idcardPhoto;
|
||||
private String bankImgUrl;
|
||||
private String bankName;
|
||||
private String cardNo;
|
||||
private int idcardBackPhoto;
|
||||
private Object idcardPhotoHold;
|
||||
private String idcardAddress;
|
||||
private String idcardName;
|
||||
private int idcardSex;
|
||||
private int idCardStatus;//身份证认证状态;-1未提交 0待认证 1认证通过 2认证失败
|
||||
private int idCardStatus;
|
||||
private int driverLicenseStatus;
|
||||
private int qualificationCertificateStatus;
|
||||
private String idCardReason;
|
||||
@@ -144,30 +141,6 @@ public class DriverAuthDataBean {
|
||||
private Object mbindStatus;
|
||||
private Object mreason;
|
||||
|
||||
public String getBankImgUrl() {
|
||||
return bankImgUrl;
|
||||
}
|
||||
|
||||
public void setBankImgUrl(String bankImgUrl) {
|
||||
this.bankImgUrl = bankImgUrl;
|
||||
}
|
||||
|
||||
public String getBankName() {
|
||||
return bankName;
|
||||
}
|
||||
|
||||
public void setBankName(String bankName) {
|
||||
this.bankName = bankName;
|
||||
}
|
||||
|
||||
public String getCardNo() {
|
||||
return cardNo;
|
||||
}
|
||||
|
||||
public void setCardNo(String cardNo) {
|
||||
this.cardNo = cardNo;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -1,328 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName DriverUpBean
|
||||
* @Author john
|
||||
* @Date 2024/11/20 09:20
|
||||
* @Description TODO
|
||||
*/
|
||||
public class DriverUpBean implements Serializable {
|
||||
|
||||
private String frontImageUrl;
|
||||
private String backImageUrl;
|
||||
private String carNumber;
|
||||
private String type;
|
||||
private String owner;
|
||||
private String vehicleNumber;
|
||||
private String carLong;
|
||||
private String carWidth;
|
||||
private String carHeight;
|
||||
private String carId;
|
||||
private String carPlateColor;
|
||||
private String carEnergyTyp;
|
||||
|
||||
private DataDTO zjObj;
|
||||
|
||||
public String getCarId() {
|
||||
return carId;
|
||||
}
|
||||
|
||||
public void setCarId(String carId) {
|
||||
this.carId = carId;
|
||||
}
|
||||
|
||||
public String getFrontImageUrl() {
|
||||
return frontImageUrl;
|
||||
}
|
||||
|
||||
public void setFrontImageUrl(String frontImageUrl) {
|
||||
this.frontImageUrl = frontImageUrl;
|
||||
}
|
||||
|
||||
public String getBackImageUrl() {
|
||||
return backImageUrl;
|
||||
}
|
||||
|
||||
public void setBackImageUrl(String backImageUrl) {
|
||||
this.backImageUrl = backImageUrl;
|
||||
}
|
||||
|
||||
public String getCarNumber() {
|
||||
return carNumber;
|
||||
}
|
||||
|
||||
public void setCarNumber(String carNumber) {
|
||||
this.carNumber = carNumber;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
public void setOwner(String owner) {
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public String getVehicleNumber() {
|
||||
return vehicleNumber;
|
||||
}
|
||||
|
||||
public void setVehicleNumber(String vehicleNumber) {
|
||||
this.vehicleNumber = vehicleNumber;
|
||||
}
|
||||
|
||||
public String getCarLong() {
|
||||
return carLong;
|
||||
}
|
||||
|
||||
public void setCarLong(String carLong) {
|
||||
this.carLong = carLong;
|
||||
}
|
||||
|
||||
public String getCarWidth() {
|
||||
return carWidth;
|
||||
}
|
||||
|
||||
public void setCarWidth(String carWidth) {
|
||||
this.carWidth = carWidth;
|
||||
}
|
||||
|
||||
public String getCarHeight() {
|
||||
return carHeight;
|
||||
}
|
||||
|
||||
public void setCarHeight(String carHeight) {
|
||||
this.carHeight = carHeight;
|
||||
}
|
||||
|
||||
public String getCarPlateColor() {
|
||||
return carPlateColor;
|
||||
}
|
||||
|
||||
public void setCarPlateColor(String carPlateColor) {
|
||||
this.carPlateColor = carPlateColor;
|
||||
}
|
||||
|
||||
public String getCarEnergyTyp() {
|
||||
return carEnergyTyp;
|
||||
}
|
||||
|
||||
public void setCarEnergyTyp(String carEnergyTyp) {
|
||||
this.carEnergyTyp = carEnergyTyp;
|
||||
}
|
||||
|
||||
public DataDTO getZjObj() {
|
||||
return zjObj;
|
||||
}
|
||||
|
||||
public void setZjObj(DataDTO zjObj) {
|
||||
this.zjObj = zjObj;
|
||||
}
|
||||
|
||||
public static class DataDTO {
|
||||
|
||||
private String approveTon;
|
||||
private String recordId;
|
||||
private String note;
|
||||
private String passengers;
|
||||
private String vclDrwTn;
|
||||
private String overallDimen;
|
||||
private String vclN;
|
||||
private String enTn;
|
||||
private String loadTon;
|
||||
private String inspectionRecord;
|
||||
private String barCode;
|
||||
private String issuingAuthority;
|
||||
private String regTime;
|
||||
private String address;
|
||||
private String ownerName;
|
||||
private String engine;
|
||||
private String vin;
|
||||
private String licensedateOfissue;
|
||||
private String vcltype;
|
||||
private String vclBrand;
|
||||
private String natureOfUsage;
|
||||
|
||||
public String getApproveTon() {
|
||||
return approveTon;
|
||||
}
|
||||
|
||||
public void setApproveTon(String approveTon) {
|
||||
this.approveTon = approveTon;
|
||||
}
|
||||
|
||||
public String getRecordId() {
|
||||
return recordId;
|
||||
}
|
||||
|
||||
public void setRecordId(String recordId) {
|
||||
this.recordId = recordId;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public void setNote(String note) {
|
||||
this.note = note;
|
||||
}
|
||||
|
||||
public String getPassengers() {
|
||||
return passengers;
|
||||
}
|
||||
|
||||
public void setPassengers(String passengers) {
|
||||
this.passengers = passengers;
|
||||
}
|
||||
|
||||
public String getVclDrwTn() {
|
||||
return vclDrwTn;
|
||||
}
|
||||
|
||||
public void setVclDrwTn(String vclDrwTn) {
|
||||
this.vclDrwTn = vclDrwTn;
|
||||
}
|
||||
|
||||
public String getOverallDimen() {
|
||||
return overallDimen;
|
||||
}
|
||||
|
||||
public void setOverallDimen(String overallDimen) {
|
||||
this.overallDimen = overallDimen;
|
||||
}
|
||||
|
||||
public String getVclN() {
|
||||
return vclN;
|
||||
}
|
||||
|
||||
public void setVclN(String vclN) {
|
||||
this.vclN = vclN;
|
||||
}
|
||||
|
||||
public String getEnTn() {
|
||||
return enTn;
|
||||
}
|
||||
|
||||
public void setEnTn(String enTn) {
|
||||
this.enTn = enTn;
|
||||
}
|
||||
|
||||
public String getLoadTon() {
|
||||
return loadTon;
|
||||
}
|
||||
|
||||
public void setLoadTon(String loadTon) {
|
||||
this.loadTon = loadTon;
|
||||
}
|
||||
|
||||
public String getInspectionRecord() {
|
||||
return inspectionRecord;
|
||||
}
|
||||
|
||||
public void setInspectionRecord(String inspectionRecord) {
|
||||
this.inspectionRecord = inspectionRecord;
|
||||
}
|
||||
|
||||
public String getBarCode() {
|
||||
return barCode;
|
||||
}
|
||||
|
||||
public void setBarCode(String barCode) {
|
||||
this.barCode = barCode;
|
||||
}
|
||||
|
||||
public String getIssuingAuthority() {
|
||||
return issuingAuthority;
|
||||
}
|
||||
|
||||
public void setIssuingAuthority(String issuingAuthority) {
|
||||
this.issuingAuthority = issuingAuthority;
|
||||
}
|
||||
|
||||
public String getRegTime() {
|
||||
return regTime;
|
||||
}
|
||||
|
||||
public void setRegTime(String regTime) {
|
||||
this.regTime = regTime;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getOwnerName() {
|
||||
return ownerName;
|
||||
}
|
||||
|
||||
public void setOwnerName(String ownerName) {
|
||||
this.ownerName = ownerName;
|
||||
}
|
||||
|
||||
public String getEngine() {
|
||||
return engine;
|
||||
}
|
||||
|
||||
public void setEngine(String engine) {
|
||||
this.engine = engine;
|
||||
}
|
||||
|
||||
public String getVin() {
|
||||
return vin;
|
||||
}
|
||||
|
||||
public void setVin(String vin) {
|
||||
this.vin = vin;
|
||||
}
|
||||
|
||||
public String getLicensedateOfissue() {
|
||||
return licensedateOfissue;
|
||||
}
|
||||
|
||||
public void setLicensedateOfissue(String licensedateOfissue) {
|
||||
this.licensedateOfissue = licensedateOfissue;
|
||||
}
|
||||
|
||||
public String getVcltype() {
|
||||
return vcltype;
|
||||
}
|
||||
|
||||
public void setVcltype(String vcltype) {
|
||||
this.vcltype = vcltype;
|
||||
}
|
||||
|
||||
public String getVclBrand() {
|
||||
return vclBrand;
|
||||
}
|
||||
|
||||
public void setVclBrand(String vclBrand) {
|
||||
this.vclBrand = vclBrand;
|
||||
}
|
||||
|
||||
public String getNatureOfUsage() {
|
||||
return natureOfUsage;
|
||||
}
|
||||
|
||||
public void setNatureOfUsage(String natureOfUsage) {
|
||||
this.natureOfUsage = natureOfUsage;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* @ClassName GDImage
|
||||
* @Author john
|
||||
* @Date 2024/11/27 14:04
|
||||
* @Description TODO
|
||||
*/
|
||||
public class GDImage extends GDLocation{
|
||||
|
||||
|
||||
private String fileName;
|
||||
|
||||
private String fileData;
|
||||
|
||||
private String fileExt;
|
||||
|
||||
private String imageTakenDate;
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
public String getFileData() {
|
||||
return fileData;
|
||||
}
|
||||
|
||||
public void setFileData(String fileData) {
|
||||
this.fileData = fileData;
|
||||
}
|
||||
|
||||
public String getFileExt() {
|
||||
return fileExt;
|
||||
}
|
||||
|
||||
public void setFileExt(String fileExt) {
|
||||
this.fileExt = fileExt;
|
||||
}
|
||||
|
||||
public String getImageTakenDate() {
|
||||
return imageTakenDate;
|
||||
}
|
||||
|
||||
public void setImageTakenDate(String imageTakenDate) {
|
||||
this.imageTakenDate = imageTakenDate;
|
||||
}
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName GDLocation
|
||||
* @Author john
|
||||
* @Date 2024/11/27 13:59
|
||||
* @Description TODO
|
||||
*/
|
||||
public class GDLocation implements Serializable {
|
||||
|
||||
private double baiduLongitude;
|
||||
private double baiduLatitude;
|
||||
private String location;
|
||||
private String time;
|
||||
private double altitude;
|
||||
private float speed;
|
||||
private float direction;
|
||||
private int interval;
|
||||
|
||||
public double getBaiduLongitude() {
|
||||
return baiduLongitude;
|
||||
}
|
||||
|
||||
public void setBaiduLongitude(double baiduLongitude) {
|
||||
this.baiduLongitude = baiduLongitude;
|
||||
}
|
||||
|
||||
public double getBaiduLatitude() {
|
||||
return baiduLatitude;
|
||||
}
|
||||
|
||||
public void setBaiduLatitude(double baiduLatitude) {
|
||||
this.baiduLatitude = baiduLatitude;
|
||||
}
|
||||
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(String location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(String time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public double getAltitude() {
|
||||
return altitude;
|
||||
}
|
||||
|
||||
public void setAltitude(double altitude) {
|
||||
this.altitude = altitude;
|
||||
}
|
||||
|
||||
public float getSpeed() {
|
||||
return speed;
|
||||
}
|
||||
|
||||
public void setSpeed(float speed) {
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
public float getDirection() {
|
||||
return direction;
|
||||
}
|
||||
|
||||
public void setDirection(float direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
|
||||
public int getInterval() {
|
||||
return interval;
|
||||
}
|
||||
|
||||
public void setInterval(int interval) {
|
||||
this.interval = interval;
|
||||
}
|
||||
}
|
||||
@@ -83,8 +83,6 @@ public class HuoYuanDelBean {
|
||||
private String vehicleTypeName;
|
||||
private int vehicleLength;
|
||||
private String vehicleLengthName;
|
||||
private String carNumber;
|
||||
private String carId;
|
||||
private String namedDrivers;
|
||||
private String requirement;
|
||||
private String totalFreight;
|
||||
@@ -99,23 +97,6 @@ public class HuoYuanDelBean {
|
||||
private Object contactName;
|
||||
private Object contactPhone;
|
||||
|
||||
|
||||
public String getCarNumber() {
|
||||
return carNumber == null ? "" : carNumber;
|
||||
}
|
||||
|
||||
public void setCarNumber(String carNumber) {
|
||||
this.carNumber = carNumber;
|
||||
}
|
||||
|
||||
public String getCarId() {
|
||||
return carId == null ? "" : carId;
|
||||
}
|
||||
|
||||
public void setCarId(String carId) {
|
||||
this.carId = carId;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -55,33 +55,6 @@ public class OCRBankBean {
|
||||
private String validDate;
|
||||
private String bankCardType;
|
||||
private String bankName;
|
||||
private String expiryDate;
|
||||
private String type;
|
||||
private String cardNumber;
|
||||
|
||||
public String getExpiryDate() {
|
||||
return expiryDate;
|
||||
}
|
||||
|
||||
public void setExpiryDate(String expiryDate) {
|
||||
this.expiryDate = expiryDate;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getCardNumber() {
|
||||
return cardNumber;
|
||||
}
|
||||
|
||||
public void setCardNumber(String cardNumber) {
|
||||
this.cardNumber = cardNumber;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
|
||||
@@ -60,33 +60,6 @@ public class OCRCardBackBean {
|
||||
private String startTime;
|
||||
private String endTime;
|
||||
private String organizationName;
|
||||
private String validFrom;
|
||||
private String validTo;
|
||||
private String issue;
|
||||
|
||||
public String getIssue() {
|
||||
return issue;
|
||||
}
|
||||
|
||||
public void setIssue(String issue) {
|
||||
this.issue = issue;
|
||||
}
|
||||
|
||||
public String getValidFrom() {
|
||||
return validFrom;
|
||||
}
|
||||
|
||||
public void setValidFrom(String validFrom) {
|
||||
this.validFrom = validFrom;
|
||||
}
|
||||
|
||||
public String getValidTo() {
|
||||
return validTo;
|
||||
}
|
||||
|
||||
public void setValidTo(String validTo) {
|
||||
this.validTo = validTo;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
|
||||
@@ -63,51 +63,6 @@ public class OCRCardBean {
|
||||
private String cardId;
|
||||
private String birthday;
|
||||
private String sex;
|
||||
private String ethnicity;
|
||||
private String idcard;
|
||||
private String birth;
|
||||
private String validFrom;
|
||||
private String validTo;
|
||||
|
||||
public String getEthnicity() {
|
||||
return ethnicity;
|
||||
}
|
||||
|
||||
public void setEthnicity(String ethnicity) {
|
||||
this.ethnicity = ethnicity;
|
||||
}
|
||||
|
||||
public String getIdcard() {
|
||||
return idcard;
|
||||
}
|
||||
|
||||
public void setIdcard(String idcard) {
|
||||
this.idcard = idcard;
|
||||
}
|
||||
|
||||
public String getBirth() {
|
||||
return birth;
|
||||
}
|
||||
|
||||
public void setBirth(String birth) {
|
||||
this.birth = birth;
|
||||
}
|
||||
|
||||
public String getValidFrom() {
|
||||
return validFrom;
|
||||
}
|
||||
|
||||
public void setValidFrom(String validFrom) {
|
||||
this.validFrom = validFrom;
|
||||
}
|
||||
|
||||
public String getValidTo() {
|
||||
return validTo;
|
||||
}
|
||||
|
||||
public void setValidTo(String validTo) {
|
||||
this.validTo = validTo;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
|
||||
-36
@@ -58,42 +58,6 @@ public class OCRDrivingLicenseBackBean {
|
||||
private int id;
|
||||
private String url;
|
||||
private String archivesName;
|
||||
private String fileNumber;
|
||||
private String record;
|
||||
private String name;
|
||||
private String issuingAuthority;
|
||||
|
||||
public String getFileNumber() {
|
||||
return fileNumber;
|
||||
}
|
||||
|
||||
public void setFileNumber(String fileNumber) {
|
||||
this.fileNumber = fileNumber;
|
||||
}
|
||||
|
||||
public String getRecord() {
|
||||
return record;
|
||||
}
|
||||
|
||||
public void setRecord(String record) {
|
||||
this.record = record;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getIssuingAuthority() {
|
||||
return issuingAuthority;
|
||||
}
|
||||
|
||||
public void setIssuingAuthority(String issuingAuthority) {
|
||||
this.issuingAuthority = issuingAuthority;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
|
||||
@@ -68,70 +68,6 @@ public class OCRDrivingLicenseBean {
|
||||
private String allowType;
|
||||
private String sex;
|
||||
private String startTime;
|
||||
private String beginDate;
|
||||
private String endDate;
|
||||
private String firstGetDocDate;
|
||||
private String idcard;
|
||||
private String quasiDriveType;
|
||||
private String issuingAuthority;
|
||||
private String nationality;
|
||||
|
||||
|
||||
public String getBeginDate() {
|
||||
return beginDate;
|
||||
}
|
||||
|
||||
public void setBeginDate(String beginDate) {
|
||||
this.beginDate = beginDate;
|
||||
}
|
||||
|
||||
public String getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public void setEndDate(String endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public String getFirstGetDocDate() {
|
||||
return firstGetDocDate;
|
||||
}
|
||||
|
||||
public void setFirstGetDocDate(String firstGetDocDate) {
|
||||
this.firstGetDocDate = firstGetDocDate;
|
||||
}
|
||||
|
||||
public String getIdcard() {
|
||||
return idcard;
|
||||
}
|
||||
|
||||
public void setIdcard(String idcard) {
|
||||
this.idcard = idcard;
|
||||
}
|
||||
|
||||
public String getQuasiDriveType() {
|
||||
return quasiDriveType;
|
||||
}
|
||||
|
||||
public void setQuasiDriveType(String quasiDriveType) {
|
||||
this.quasiDriveType = quasiDriveType;
|
||||
}
|
||||
|
||||
public String getIssuingAuthority() {
|
||||
return issuingAuthority;
|
||||
}
|
||||
|
||||
public void setIssuingAuthority(String issuingAuthority) {
|
||||
this.issuingAuthority = issuingAuthority;
|
||||
}
|
||||
|
||||
public String getNationality() {
|
||||
return nationality;
|
||||
}
|
||||
|
||||
public void setNationality(String nationality) {
|
||||
this.nationality = nationality;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
|
||||
@@ -1,200 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName OCRQualiBean
|
||||
* @Author john
|
||||
* @Date 2024/11/19 15:53
|
||||
* @Description TODO
|
||||
*/
|
||||
public class OCRQualiBean {
|
||||
|
||||
|
||||
private int code;
|
||||
private DataDTO data;
|
||||
private String msg;
|
||||
private String remark;
|
||||
private int res;
|
||||
private boolean success;
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public DataDTO getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(DataDTO data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public int getRes() {
|
||||
return res;
|
||||
}
|
||||
|
||||
public void setRes(int res) {
|
||||
this.res = res;
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public static class DataDTO {
|
||||
private String address;
|
||||
private List<QualificationCategoryListDTO> qualification_category_list;
|
||||
private String nationality;
|
||||
private String issuing_authority;
|
||||
private String sex;
|
||||
private String birth_date;
|
||||
private String integrity_assessment_info;
|
||||
private String name;
|
||||
private String driving_class;
|
||||
private String certificate_number;
|
||||
private String continuing_education_info;
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public List<QualificationCategoryListDTO> getQualification_category_list() {
|
||||
return qualification_category_list;
|
||||
}
|
||||
|
||||
public void setQualification_category_list(List<QualificationCategoryListDTO> qualification_category_list) {
|
||||
this.qualification_category_list = qualification_category_list;
|
||||
}
|
||||
|
||||
public String getNationality() {
|
||||
return nationality;
|
||||
}
|
||||
|
||||
public void setNationality(String nationality) {
|
||||
this.nationality = nationality;
|
||||
}
|
||||
|
||||
public String getIssuing_authority() {
|
||||
return issuing_authority;
|
||||
}
|
||||
|
||||
public void setIssuing_authority(String issuing_authority) {
|
||||
this.issuing_authority = issuing_authority;
|
||||
}
|
||||
|
||||
public String getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(String sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getBirth_date() {
|
||||
return birth_date;
|
||||
}
|
||||
|
||||
public void setBirth_date(String birth_date) {
|
||||
this.birth_date = birth_date;
|
||||
}
|
||||
|
||||
public String getIntegrity_assessment_info() {
|
||||
return integrity_assessment_info;
|
||||
}
|
||||
|
||||
public void setIntegrity_assessment_info(String integrity_assessment_info) {
|
||||
this.integrity_assessment_info = integrity_assessment_info;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDriving_class() {
|
||||
return driving_class;
|
||||
}
|
||||
|
||||
public void setDriving_class(String driving_class) {
|
||||
this.driving_class = driving_class;
|
||||
}
|
||||
|
||||
public String getCertificate_number() {
|
||||
return certificate_number;
|
||||
}
|
||||
|
||||
public void setCertificate_number(String certificate_number) {
|
||||
this.certificate_number = certificate_number;
|
||||
}
|
||||
|
||||
public String getContinuing_education_info() {
|
||||
return continuing_education_info;
|
||||
}
|
||||
|
||||
public void setContinuing_education_info(String continuing_education_info) {
|
||||
this.continuing_education_info = continuing_education_info;
|
||||
}
|
||||
|
||||
public static class QualificationCategoryListDTO {
|
||||
private String issue_date;
|
||||
private String expiry_date;
|
||||
private String category;
|
||||
|
||||
public String getIssue_date() {
|
||||
return issue_date;
|
||||
}
|
||||
|
||||
public void setIssue_date(String issue_date) {
|
||||
this.issue_date = issue_date;
|
||||
}
|
||||
|
||||
public String getExpiry_date() {
|
||||
return expiry_date;
|
||||
}
|
||||
|
||||
public void setExpiry_date(String expiry_date) {
|
||||
this.expiry_date = expiry_date;
|
||||
}
|
||||
|
||||
public String getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
public void setCategory(String category) {
|
||||
this.category = category;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,177 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.bean;
|
||||
|
||||
/**
|
||||
* @ClassName OCRRoadBean
|
||||
* @Author john
|
||||
* @Date 2024/11/19 17:05
|
||||
* @Description TODO
|
||||
*/
|
||||
public class OCRRoadBean {
|
||||
|
||||
|
||||
private int code;
|
||||
private DataDTO data;
|
||||
private String msg;
|
||||
private String remark;
|
||||
private int res;
|
||||
private boolean success;
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public DataDTO getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(DataDTO data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public int getRes() {
|
||||
return res;
|
||||
}
|
||||
|
||||
public void setRes(int res) {
|
||||
this.res = res;
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public static class DataDTO {
|
||||
private String vehicleWeight;
|
||||
private String issuingAuthority;
|
||||
private String ownerName;
|
||||
private String businessCertificate;
|
||||
private String economicType;
|
||||
private String businessScope;
|
||||
private String vehicleNumber;
|
||||
private String licenseNumber;
|
||||
private String vehicleSize;
|
||||
private String ownerAddress;
|
||||
private String issueDate;
|
||||
private String vehicleType;
|
||||
|
||||
public String getVehicleWeight() {
|
||||
return vehicleWeight;
|
||||
}
|
||||
|
||||
public void setVehicleWeight(String vehicleWeight) {
|
||||
this.vehicleWeight = vehicleWeight;
|
||||
}
|
||||
|
||||
public String getIssuingAuthority() {
|
||||
return issuingAuthority;
|
||||
}
|
||||
|
||||
public void setIssuingAuthority(String issuingAuthority) {
|
||||
this.issuingAuthority = issuingAuthority;
|
||||
}
|
||||
|
||||
public String getOwnerName() {
|
||||
return ownerName;
|
||||
}
|
||||
|
||||
public void setOwnerName(String ownerName) {
|
||||
this.ownerName = ownerName;
|
||||
}
|
||||
|
||||
public String getBusinessCertificate() {
|
||||
return businessCertificate;
|
||||
}
|
||||
|
||||
public void setBusinessCertificate(String businessCertificate) {
|
||||
this.businessCertificate = businessCertificate;
|
||||
}
|
||||
|
||||
public String getEconomicType() {
|
||||
return economicType;
|
||||
}
|
||||
|
||||
public void setEconomicType(String economicType) {
|
||||
this.economicType = economicType;
|
||||
}
|
||||
|
||||
public String getBusinessScope() {
|
||||
return businessScope;
|
||||
}
|
||||
|
||||
public void setBusinessScope(String businessScope) {
|
||||
this.businessScope = businessScope;
|
||||
}
|
||||
|
||||
public String getVehicleNumber() {
|
||||
return vehicleNumber;
|
||||
}
|
||||
|
||||
public void setVehicleNumber(String vehicleNumber) {
|
||||
this.vehicleNumber = vehicleNumber;
|
||||
}
|
||||
|
||||
public String getLicenseNumber() {
|
||||
return licenseNumber;
|
||||
}
|
||||
|
||||
public void setLicenseNumber(String licenseNumber) {
|
||||
this.licenseNumber = licenseNumber;
|
||||
}
|
||||
|
||||
public String getVehicleSize() {
|
||||
return vehicleSize;
|
||||
}
|
||||
|
||||
public void setVehicleSize(String vehicleSize) {
|
||||
this.vehicleSize = vehicleSize;
|
||||
}
|
||||
|
||||
public String getOwnerAddress() {
|
||||
return ownerAddress;
|
||||
}
|
||||
|
||||
public void setOwnerAddress(String ownerAddress) {
|
||||
this.ownerAddress = ownerAddress;
|
||||
}
|
||||
|
||||
public String getIssueDate() {
|
||||
return issueDate;
|
||||
}
|
||||
|
||||
public void setIssueDate(String issueDate) {
|
||||
this.issueDate = issueDate;
|
||||
}
|
||||
|
||||
public String getVehicleType() {
|
||||
return vehicleType;
|
||||
}
|
||||
|
||||
public void setVehicleType(String vehicleType) {
|
||||
this.vehicleType = vehicleType;
|
||||
}
|
||||
}
|
||||
}
|
||||
-108
@@ -71,114 +71,6 @@ public class OCRVehicleBackLicenseBean {
|
||||
private String fileNumber;
|
||||
private String carNumber;
|
||||
private int licenseId;
|
||||
private String note;
|
||||
private String passengers;
|
||||
private String vclDrwTn;
|
||||
private String overallDimen;
|
||||
private String vclN;
|
||||
private String enTn;
|
||||
private String loadTon;
|
||||
private String inspectionRecord;
|
||||
private String barCode;
|
||||
private String approveTon;
|
||||
private String recordId;
|
||||
private String issuingAuthority;
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public void setNote(String note) {
|
||||
this.note = note;
|
||||
}
|
||||
|
||||
public String getPassengers() {
|
||||
return passengers;
|
||||
}
|
||||
|
||||
public void setPassengers(String passengers) {
|
||||
this.passengers = passengers;
|
||||
}
|
||||
|
||||
public String getVclDrwTn() {
|
||||
return vclDrwTn;
|
||||
}
|
||||
|
||||
public void setVclDrwTn(String vclDrwTn) {
|
||||
this.vclDrwTn = vclDrwTn;
|
||||
}
|
||||
|
||||
public String getOverallDimen() {
|
||||
return overallDimen;
|
||||
}
|
||||
|
||||
public void setOverallDimen(String overallDimen) {
|
||||
this.overallDimen = overallDimen;
|
||||
}
|
||||
|
||||
public String getVclN() {
|
||||
return vclN;
|
||||
}
|
||||
|
||||
public void setVclN(String vclN) {
|
||||
this.vclN = vclN;
|
||||
}
|
||||
|
||||
public String getEnTn() {
|
||||
return enTn;
|
||||
}
|
||||
|
||||
public void setEnTn(String enTn) {
|
||||
this.enTn = enTn;
|
||||
}
|
||||
|
||||
public String getLoadTon() {
|
||||
return loadTon;
|
||||
}
|
||||
|
||||
public void setLoadTon(String loadTon) {
|
||||
this.loadTon = loadTon;
|
||||
}
|
||||
|
||||
public String getInspectionRecord() {
|
||||
return inspectionRecord;
|
||||
}
|
||||
|
||||
public void setInspectionRecord(String inspectionRecord) {
|
||||
this.inspectionRecord = inspectionRecord;
|
||||
}
|
||||
|
||||
public String getBarCode() {
|
||||
return barCode;
|
||||
}
|
||||
|
||||
public void setBarCode(String barCode) {
|
||||
this.barCode = barCode;
|
||||
}
|
||||
|
||||
public String getApproveTon() {
|
||||
return approveTon;
|
||||
}
|
||||
|
||||
public void setApproveTon(String approveTon) {
|
||||
this.approveTon = approveTon;
|
||||
}
|
||||
|
||||
public String getRecordId() {
|
||||
return recordId;
|
||||
}
|
||||
|
||||
public void setRecordId(String recordId) {
|
||||
this.recordId = recordId;
|
||||
}
|
||||
|
||||
public String getIssuingAuthority() {
|
||||
return issuingAuthority;
|
||||
}
|
||||
|
||||
public void setIssuingAuthority(String issuingAuthority) {
|
||||
this.issuingAuthority = issuingAuthority;
|
||||
}
|
||||
|
||||
public String getIsSave() {
|
||||
return isSave;
|
||||
|
||||
@@ -63,96 +63,6 @@ public class OCRVehicleLicenseBean {
|
||||
private String url;
|
||||
private String vehicleNumber;
|
||||
private String licenseId;
|
||||
private String ownerName;
|
||||
private String regTime;
|
||||
private String issuingAuthority;
|
||||
private String engine;
|
||||
private String vclN;
|
||||
private String licensedateOfissue;
|
||||
private String vin;
|
||||
private String vcltype;
|
||||
private String vclBrand;
|
||||
private String natureOfUsage;
|
||||
|
||||
public String getOwnerName() {
|
||||
return ownerName;
|
||||
}
|
||||
|
||||
public void setOwnerName(String ownerName) {
|
||||
this.ownerName = ownerName;
|
||||
}
|
||||
|
||||
public String getRegTime() {
|
||||
return regTime;
|
||||
}
|
||||
|
||||
public void setRegTime(String regTime) {
|
||||
this.regTime = regTime;
|
||||
}
|
||||
|
||||
public String getIssuingAuthority() {
|
||||
return issuingAuthority;
|
||||
}
|
||||
|
||||
public void setIssuingAuthority(String issuingAuthority) {
|
||||
this.issuingAuthority = issuingAuthority;
|
||||
}
|
||||
|
||||
public String getEngine() {
|
||||
return engine;
|
||||
}
|
||||
|
||||
public void setEngine(String engine) {
|
||||
this.engine = engine;
|
||||
}
|
||||
|
||||
public String getVclN() {
|
||||
return vclN;
|
||||
}
|
||||
|
||||
public void setVclN(String vclN) {
|
||||
this.vclN = vclN;
|
||||
}
|
||||
|
||||
public String getLicensedateOfissue() {
|
||||
return licensedateOfissue;
|
||||
}
|
||||
|
||||
public void setLicensedateOfissue(String licensedateOfissue) {
|
||||
this.licensedateOfissue = licensedateOfissue;
|
||||
}
|
||||
|
||||
public String getVin() {
|
||||
return vin;
|
||||
}
|
||||
|
||||
public void setVin(String vin) {
|
||||
this.vin = vin;
|
||||
}
|
||||
|
||||
public String getVcltype() {
|
||||
return vcltype;
|
||||
}
|
||||
|
||||
public void setVcltype(String vcltype) {
|
||||
this.vcltype = vcltype;
|
||||
}
|
||||
|
||||
public String getVclBrand() {
|
||||
return vclBrand;
|
||||
}
|
||||
|
||||
public void setVclBrand(String vclBrand) {
|
||||
this.vclBrand = vclBrand;
|
||||
}
|
||||
|
||||
public String getNatureOfUsage() {
|
||||
return natureOfUsage;
|
||||
}
|
||||
|
||||
public void setNatureOfUsage(String natureOfUsage) {
|
||||
this.natureOfUsage = natureOfUsage;
|
||||
}
|
||||
|
||||
public String getLicenseId() {
|
||||
return licenseId;
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.bean;
|
||||
|
||||
/**
|
||||
* @ClassName WaybillStatusBean
|
||||
* @Author john
|
||||
* @Date 2024/10/14 15:40
|
||||
* @Description TODO
|
||||
*/
|
||||
public class WaybillStatusBean {
|
||||
|
||||
private int res;
|
||||
private int code;
|
||||
private boolean success;
|
||||
private String msg;
|
||||
private String data;
|
||||
|
||||
public int getRes() {
|
||||
return res;
|
||||
}
|
||||
|
||||
public void setRes(int res) {
|
||||
this.res = res;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(String data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.constant;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||
|
||||
/**
|
||||
* @author hlh
|
||||
* @version 1.0.0
|
||||
* @date 2022/1/10 11:34
|
||||
* @description:交通厅参数
|
||||
*/
|
||||
public class NewLJConstant {
|
||||
|
||||
public final static String ENTER_PRISE_CODE ="E0019169";
|
||||
|
||||
public final static String ENTER_PRISE_IDENTITY = BuildConfig.isTest?"95033cc3492e420d83d7f09eea1400ac":"9179388b0e0847e1862d6400f9cbc778";
|
||||
|
||||
public final static String ENTER_PRISE_KEY =BuildConfig.isTest?"e9844a9b0bba417e89cb8623489abd2f":"156d724e9701420198fcbd52cb1ca529";
|
||||
|
||||
}
|
||||
@@ -55,15 +55,15 @@ class MessagePop(context: Context) : CenterPopupView(context), View.OnClickListe
|
||||
}
|
||||
R.id.tvOk,R.id.tvPhone -> {
|
||||
dismiss()
|
||||
// if (XPermission.create(context).isGranted(Manifest.permission.CALL_PHONE)){
|
||||
if (XPermission.create(context).isGranted(Manifest.permission.CALL_PHONE)){
|
||||
val toString = tvPhone.text.toString()
|
||||
val intent = Intent(Intent.ACTION_DIAL)
|
||||
val data = Uri.parse("tel:$toString")
|
||||
intent.data = data
|
||||
context.startActivity(intent)
|
||||
// }else{
|
||||
// ToastUtils.showToast(context,"请开启电话权限")
|
||||
// }
|
||||
}else{
|
||||
ToastUtils.showToast(context,"请开启电话权限")
|
||||
}
|
||||
|
||||
// BaseUtils.callPhone(content as Activity, tvPhone.text.toString())
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.cuspop
|
||||
|
||||
/**
|
||||
* @ClassName MyRequestCallback
|
||||
* @Author john
|
||||
* @Date 2024/10/28 17:19
|
||||
* @Description TODO
|
||||
*/
|
||||
interface MyRequestCallback{
|
||||
fun onResult(allGranted: Boolean, grantedList: List<String?>, deniedList: List<String?>)
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import com.arpa.hndahesudintocctmsdriver.R
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity
|
||||
import com.lxj.xpopup.core.CenterPopupView
|
||||
import kotlinx.android.synthetic.main.pop_sim_center.view.*
|
||||
import org.bouncycastle.jcajce.provider.symmetric.Rijndael
|
||||
|
||||
|
||||
/**
|
||||
@@ -18,14 +17,10 @@ import org.bouncycastle.jcajce.provider.symmetric.Rijndael
|
||||
class SimCenterPop(context: Context) : CenterPopupView(context), View.OnClickListener {
|
||||
|
||||
lateinit var content: String
|
||||
lateinit var titleLeft: String
|
||||
lateinit var titleReft: String
|
||||
lateinit var secMessage: String
|
||||
|
||||
constructor(context: Context, message: String,titleLeft:String = "取消",titleRight: String = "去注册") : this(context) {
|
||||
constructor(context: Context, message: String) : this(context) {
|
||||
content = message
|
||||
this.titleReft = titleRight
|
||||
this.titleLeft = titleLeft
|
||||
}
|
||||
|
||||
|
||||
@@ -33,8 +28,6 @@ class SimCenterPop(context: Context) : CenterPopupView(context), View.OnClickLis
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
tvCancel.text = titleLeft
|
||||
tvOk.text = titleReft
|
||||
tvCancel.setOnClickListener(this)
|
||||
tvOk.setOnClickListener(this)
|
||||
tvContent.text = "$content"
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.cuspop
|
||||
|
||||
import android.content.Context
|
||||
import com.arpa.hndahesudintocctmsdriver.R
|
||||
import com.lxj.xpopup.core.PositionPopupView
|
||||
import com.lxj.xpopup.enums.DragOrientation
|
||||
import kotlinx.android.synthetic.main.popup_qq_msg.view.tvMessage
|
||||
import kotlinx.android.synthetic.main.popup_qq_msg.view.tvTitle
|
||||
|
||||
/**
|
||||
* Description: 自定义自由定位Position弹窗
|
||||
* Create by dance, at 2019/6/14
|
||||
*/
|
||||
class TopMsgPopup(context: Context,title:String, message: String) : PositionPopupView(context) {
|
||||
|
||||
private var message: String
|
||||
private var title: String
|
||||
|
||||
init {
|
||||
this.message = message
|
||||
this.title = title
|
||||
}
|
||||
override fun getImplLayoutId(): Int {
|
||||
return R.layout.popup_qq_msg
|
||||
}
|
||||
|
||||
override fun getDragOrientation(): DragOrientation {
|
||||
return DragOrientation.DragToLeft
|
||||
}
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
tvMessage.text = message
|
||||
tvTitle.text = title
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.event;
|
||||
|
||||
/**
|
||||
* @author hlh
|
||||
* @version 1.0.0
|
||||
* @date 2021/10/20 14:43
|
||||
* @description:
|
||||
*/
|
||||
public class HomeWaybillEvent {
|
||||
|
||||
private int message;
|
||||
|
||||
|
||||
public int getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(int message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public HomeWaybillEvent() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param message 1:刷新运单列表
|
||||
*/
|
||||
public HomeWaybillEvent(int message) {
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.event;
|
||||
|
||||
/**
|
||||
* @author hlh
|
||||
* @version 1.0.0
|
||||
* @date 2021/10/20 14:43
|
||||
* @description:
|
||||
*/
|
||||
public class WalletEvent {
|
||||
|
||||
private String message;
|
||||
|
||||
public WalletEvent(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package com.arpa.hndahesudintocctmsdriver.report;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alct.mdp.MDPLocationCollectionManager;
|
||||
@@ -13,11 +12,7 @@ import com.arpa.hndahesudintocctmsdriver.App;
|
||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.AuthParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.NewLJUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.msg.MsgUtil;
|
||||
import com.dahe.mylibrary.callback.OnGDDownloadResultListener;
|
||||
import com.dahe.mylibrary.callback.OnGDResultListener;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.DriverAuthDataBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.FqBean;
|
||||
@@ -47,53 +42,27 @@ public class ALProcess {
|
||||
|
||||
public static void verification(Context con){
|
||||
DriverAuthDataBean auth= AuthParts.getAuth(con);
|
||||
if (auth==null){
|
||||
return;
|
||||
}
|
||||
|
||||
// Identity idy=new Identity();
|
||||
// //企业代码
|
||||
// idy.setEnterpriseCode(BuildConfig.isTest?ENTERPRISE_CODE_TEXT:ENTERPRISE_CODE);
|
||||
// //企业app的身份码
|
||||
// idy.setAppIdentity(BuildConfig.isTest?APP_IDENTITY_TEXT:APP_IDENTITY);
|
||||
// //企业app验证码
|
||||
// idy.setAppKey(BuildConfig.isTest?APP_KEY_TEXT:APP_KEY);
|
||||
// //司机身份证
|
||||
// idy.setDriverIdentity(auth.getData().getIdcard());
|
||||
// //idy.setDriverIdentity("410725198311042012");
|
||||
// MDPLocationCollectionManager.register(con, idy, new OnResultListener() {
|
||||
// @Override
|
||||
// public void onSuccess() {
|
||||
// Log.e("--success--","验证成功");
|
||||
// getFq(con);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(java.lang.String s, java.lang.String s1) {
|
||||
// Log.e("--error--",s+s1+"");
|
||||
// new MessageUtils().showCenMessage(con,s1);
|
||||
// }
|
||||
// });
|
||||
|
||||
NewLJUtils.getInstance().getToken(con, new OnGDResultListener() {
|
||||
Identity idy=new Identity();
|
||||
//企业代码
|
||||
idy.setEnterpriseCode(BuildConfig.isTest?ENTERPRISE_CODE_TEXT:ENTERPRISE_CODE);
|
||||
//企业app的身份码
|
||||
idy.setAppIdentity(BuildConfig.isTest?APP_IDENTITY_TEXT:APP_IDENTITY);
|
||||
//企业app验证码
|
||||
idy.setAppKey(BuildConfig.isTest?APP_KEY_TEXT:APP_KEY);
|
||||
//司机身份证
|
||||
idy.setDriverIdentity(auth.getData().getIdcard());
|
||||
//idy.setDriverIdentity("410725198311042012");
|
||||
MDPLocationCollectionManager.register(con, idy, new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
NewLJUtils.getInstance().confirmInvoice(con, new OnGDResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
|
||||
}
|
||||
});
|
||||
Log.e("--success--","验证成功");
|
||||
getFq(con);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
|
||||
public void onFailure(java.lang.String s, java.lang.String s1) {
|
||||
Log.e("--error--",s+s1+"");
|
||||
new MessageUtils().showCenMessage(con,s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -157,88 +126,33 @@ public class ALProcess {
|
||||
}
|
||||
|
||||
|
||||
public static void verification(Context con,String carNum,Handler hd){
|
||||
public static void verification(Context con,Handler hd){
|
||||
DriverAuthDataBean auth= AuthParts.getAuth(con);
|
||||
if (auth==null){
|
||||
return;
|
||||
}
|
||||
if (TextUtils.isEmpty(carNum)){
|
||||
ToastUtils.showToast(con,"请选择车辆");
|
||||
return;
|
||||
}
|
||||
// Identity idy=new Identity();
|
||||
// //企业代码
|
||||
// idy.setEnterpriseCode(BuildConfig.isTest?ENTERPRISE_CODE_TEXT:ENTERPRISE_CODE);
|
||||
// //企业app的身份码
|
||||
// idy.setAppIdentity(BuildConfig.isTest?APP_IDENTITY_TEXT:APP_IDENTITY);
|
||||
// //企业app验证码
|
||||
// idy.setAppKey(BuildConfig.isTest?APP_KEY_TEXT:APP_KEY);
|
||||
// //司机身份证
|
||||
// idy.setDriverIdentity(auth.getData().getIdcard());
|
||||
// //idy.setDriverIdentity("410725198311042012");
|
||||
// MDPLocationCollectionManager.register(con, idy, new OnResultListener() {
|
||||
// @Override
|
||||
// public void onSuccess() {
|
||||
// MsgUtil.addHdMsgWatBody(hd, 1111,"认证成功");
|
||||
// Log.e("--success--","验证成功");
|
||||
// getFq(con);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(java.lang.String s, java.lang.String s1) {
|
||||
// Log.e("--error--",s+s1+"");
|
||||
// MsgUtil.addHdMsgWatBody(hd, 2222,s1);
|
||||
//// new MessageUtils().showCenMessage(con,s1);
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
NewLJUtils.getInstance().trucks(con, auth.getData().getIdcard(),carNum, new OnGDDownloadResultListener(){
|
||||
Identity idy=new Identity();
|
||||
//企业代码
|
||||
idy.setEnterpriseCode(BuildConfig.isTest?ENTERPRISE_CODE_TEXT:ENTERPRISE_CODE);
|
||||
//企业app的身份码
|
||||
idy.setAppIdentity(BuildConfig.isTest?APP_IDENTITY_TEXT:APP_IDENTITY);
|
||||
//企业app验证码
|
||||
idy.setAppKey(BuildConfig.isTest?APP_KEY_TEXT:APP_KEY);
|
||||
//司机身份证
|
||||
idy.setDriverIdentity(auth.getData().getIdcard());
|
||||
//idy.setDriverIdentity("410725198311042012");
|
||||
MDPLocationCollectionManager.register(con, idy, new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess(String var1) {
|
||||
public void onSuccess() {
|
||||
MsgUtil.addHdMsgWatBody(hd, 1111,"认证成功");
|
||||
Log.e("--success--","验证成功");
|
||||
getFq(con);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
MsgUtil.addHdMsgWatBody(hd, 2222,var2);
|
||||
public void onFailure(java.lang.String s, java.lang.String s1) {
|
||||
Log.e("--error--",s+s1+"");
|
||||
MsgUtil.addHdMsgWatBody(hd, 2222,s1);
|
||||
// new MessageUtils().showCenMessage(con,s1);
|
||||
}
|
||||
});
|
||||
|
||||
// NewLJUtils.getInstance().searchDriver(con, auth.getData().getIdcard(), new OnGDDownloadResultListener(){
|
||||
// @Override
|
||||
// public void onSuccess(String var1) {
|
||||
// MsgUtil.addHdMsgWatBody(hd, 1111,"认证成功");
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(String var1, String var2) {
|
||||
// MsgUtil.addHdMsgWatBody(hd, 2222,var2);
|
||||
// }
|
||||
// });
|
||||
|
||||
// NewLJUtils.getInstance().getToken(con, new OnGDResultListener() {
|
||||
// @Override
|
||||
// public void onSuccess() {
|
||||
// NewLJUtils.getInstance().confirmInvoice(con, new OnGDResultListener() {
|
||||
// @Override
|
||||
// public void onSuccess() {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(String var1, String var2) {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(String var1, String var2) {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.arpa.hndahesudintocctmsdriver.report;
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.amap.api.location.AMapLocationClient;
|
||||
@@ -79,9 +78,6 @@ public class JTTProcess {
|
||||
ShippingNoteInfo sni=new ShippingNoteInfo();
|
||||
StartOrderBean.DataDTO.WayChildrenDTO startWay=sob.getData().getWayChildren().get(0);
|
||||
StartOrderBean.DataDTO.WayChildrenDTO endWay=sob.getData().getWayChildren().get(sob.getData().getWayChildren().size()-1);
|
||||
if (TextUtils.isEmpty(endWay.getLatitude())||TextUtils.isEmpty(endWay.getLongitude())){
|
||||
return;
|
||||
}
|
||||
sni.setShippingNoteNumber(sob.getData().getShippingNoteNumber());
|
||||
sni.setSerialNumber("0000");
|
||||
sni.setStartLatitude(Double.parseDouble(startWay.getLatitude()));
|
||||
@@ -119,9 +115,6 @@ public class JTTProcess {
|
||||
//参数 ShippingNoteInfo 和 start 接口中的参数 ShippingNoteInfo 相
|
||||
//同,这里 shippingNoteInfo 信息只需传入运单号和分单号即可
|
||||
public static void send(Context con,StartOrderBean sob,String remark){
|
||||
if (sob.getData()==null){
|
||||
return;
|
||||
}
|
||||
ShippingNoteInfo[] snis=new ShippingNoteInfo[1];
|
||||
ShippingNoteInfo sni=new ShippingNoteInfo();
|
||||
sni.setShippingNoteNumber(sob.getData().getShippingNoteNumber());
|
||||
@@ -150,9 +143,6 @@ public class JTTProcess {
|
||||
ShippingNoteInfo sni=new ShippingNoteInfo();
|
||||
StartOrderBean.DataDTO.WayChildrenDTO startWay=sob.getData().getWayChildren().get(0);
|
||||
StartOrderBean.DataDTO.WayChildrenDTO endWay=sob.getData().getWayChildren().get(sob.getData().getWayChildren().size()-1);
|
||||
if (TextUtils.isEmpty(endWay.getLatitude())||TextUtils.isEmpty(endWay.getLongitude())){
|
||||
return;
|
||||
}
|
||||
sni.setShippingNoteNumber(sob.getData().getShippingNoteNumber());
|
||||
sni.setSerialNumber("0000");
|
||||
sni.setStartLatitude(Double.parseDouble(startWay.getLatitude()));
|
||||
@@ -186,9 +176,6 @@ public class JTTProcess {
|
||||
ShippingNoteInfo sni=new ShippingNoteInfo();
|
||||
StartOrderBean.DataDTO.WayChildrenDTO startWay=sob.getData().getWayChildren().get(0);
|
||||
StartOrderBean.DataDTO.WayChildrenDTO endWay=sob.getData().getWayChildren().get(sob.getData().getWayChildren().size()-1);
|
||||
if (TextUtils.isEmpty(endWay.getLatitude())||TextUtils.isEmpty(endWay.getLongitude())){
|
||||
return;
|
||||
}
|
||||
sni.setShippingNoteNumber(sob.getData().getShippingNoteNumber());
|
||||
sni.setSerialNumber("0000");
|
||||
sni.setStartLatitude(Double.parseDouble(startWay.getLatitude()));
|
||||
@@ -221,9 +208,6 @@ public class JTTProcess {
|
||||
ShippingNoteInfo sni=new ShippingNoteInfo();
|
||||
StartOrderBean.DataDTO.WayChildrenDTO startWay=sob.getData().getWayChildren().get(0);
|
||||
StartOrderBean.DataDTO.WayChildrenDTO endWay=sob.getData().getWayChildren().get(sob.getData().getWayChildren().size()-1);
|
||||
if (TextUtils.isEmpty(endWay.getLatitude())||TextUtils.isEmpty(endWay.getLongitude())){
|
||||
return;
|
||||
}
|
||||
sni.setShippingNoteNumber(sob.getData().getShippingNoteNumber());
|
||||
sni.setSerialNumber("0000");
|
||||
sni.setStartLatitude(Double.parseDouble(startWay.getLatitude()));
|
||||
|
||||
@@ -4,7 +4,6 @@ import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.util.Log;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.map.MapUtil;
|
||||
import com.google.gson.Gson;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.IDInputBean;
|
||||
@@ -75,22 +74,6 @@ public class AuthRequest {
|
||||
RequestUtil.start(1, "saveVehicleLicense", re, con, hd);
|
||||
}
|
||||
|
||||
//查询车辆信息-行驶证/app/carDriver/saveVehicleLicense
|
||||
public void getCarInfo(Context con, Handler hd, String carNum) {
|
||||
Map<String,Object> map=new HashMap<>();
|
||||
map.put("carNum",carNum);
|
||||
Request re = OkHttpUtil.posts(new OkDate(BuildConfig.BASE_URL+"app/carDriver/onlyGetVehicleLicense", MapUtil.mapJson(map)), getToken(con), con);
|
||||
RequestUtil.start(1, "getCarInfo", re, con, hd);
|
||||
}
|
||||
|
||||
//绑定车辆信息-行驶证/app/carDriver/saveVehicleLicense
|
||||
public void bindCar(Context con, Handler hd, String carId) {
|
||||
Map<String,Object> map=new HashMap<>();
|
||||
map.put("carId",carId);
|
||||
Request re = OkHttpUtil.posts(new OkDate(BuildConfig.BASE_URL+"app/carDriver/bindCar", MapUtil.mapJson(map)), getToken(con), con);
|
||||
RequestUtil.start(1, "bindCarInfo", re, con, hd);
|
||||
}
|
||||
|
||||
//上传头像
|
||||
public void upHeadImg(Context con, Handler hd, String imgUrl) {
|
||||
String mt = "{\"headportrait\": \"" + imgUrl + "\"}";
|
||||
@@ -169,7 +152,6 @@ public class AuthRequest {
|
||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getAuthUrl(), ""), getToken(con), con);
|
||||
RequestUtil.start(1, "authUrl", re, con, hd);
|
||||
}
|
||||
|
||||
//获取车牌颜色
|
||||
public void getCarColor(Context con, Handler hd) {
|
||||
// Map<String, Object> map = new HashMap<>();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.request;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||
import com.google.gson.Gson;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.TrackInputBean;
|
||||
@@ -73,17 +72,6 @@ public class HuoYuanRequset{
|
||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getAgreeOrder(),MapUtil.mapJson(map)),getToken(con),con);
|
||||
RequestUtil.start(1, HuoYunDelActivity.END,re,con,hd);
|
||||
}
|
||||
|
||||
// public void confirm2(String cid,int wid){
|
||||
// Map<String,Object> map=new HashMap<>();
|
||||
// map.put("carId",cid);
|
||||
// map.put("orderId",wid);
|
||||
// map.put("status",2);
|
||||
// map.put("imgUrl","");
|
||||
// Request re = OkHttpUtil.posts(new OkDate(BuildConfig.BASE_URL+"/app/driver/waybill/grab",MapUtil.mapJson(map)),getToken(con),con);
|
||||
// RequestUtil.start(1, "jfaklsdjfklasjdflk",re,con,hd);
|
||||
// }
|
||||
|
||||
//获取执行中的运单
|
||||
public void startOrder(int id){
|
||||
Map<String,Object> map=new HashMap<>();
|
||||
@@ -91,13 +79,6 @@ public class HuoYuanRequset{
|
||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getGetStartOrder(),MapUtil.mapJson(map)),getToken(con),con);
|
||||
RequestUtil.start(1, HuoYuanFragmengt.START_ORDER,re,con,hd);
|
||||
}
|
||||
|
||||
public void startOrder2(int id){
|
||||
Map<String,Object> map=new HashMap<>();
|
||||
map.put("waybillId",id);
|
||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getGetStartOrder(),MapUtil.mapJson(map)),getToken(con),con);
|
||||
RequestUtil.start(1, "refreshorderDetail",re,con,hd);
|
||||
}
|
||||
//装货
|
||||
public void loading(LUInputBean lub){
|
||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getLOADING(), gson.toJson(lub)),getToken(con),con);
|
||||
@@ -161,32 +142,6 @@ public class HuoYuanRequset{
|
||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getEvaluationV2(),MapUtil.mapJson(map)),getToken(con),con);
|
||||
RequestUtil.start(1, StartYunDanActivity.KEEP_EVALUTE,re,con,hd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取运单状态
|
||||
* @param waybillId
|
||||
*/
|
||||
public void getWaybillStatus(int waybillId){
|
||||
// Map<String,Object> map=new HashMap<>();
|
||||
// map.put("waybillId",waybillId);
|
||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getGetWaybillStatus()+"?waybillId="+waybillId,""),getToken(con),con);
|
||||
RequestUtil.start(1, "waybillStatus",re,con,hd);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取货源状态
|
||||
* @param orderId
|
||||
*/
|
||||
public void getOrderStatus(int orderId){
|
||||
// Map<String,Object> map=new HashMap<>();
|
||||
// map.put("waybillId",waybillId);
|
||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getGetOrderStatus()+"?orderId="+orderId,""),getToken(con),con);
|
||||
RequestUtil.start(1, "orderStatus",re,con,hd);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public final static String ASYMMETRYWAYBILL="waybill_getAsymmetryWaybill";
|
||||
|
||||
//获取装货失败信息
|
||||
|
||||
@@ -3,132 +3,65 @@ package com.arpa.hndahesudintocctmsdriver.request;
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.http.OkDate;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.http.OkHttpUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.http.RequestUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import okhttp3.Request;
|
||||
|
||||
public class OCRRequest {
|
||||
|
||||
public String getToken(Context con) {
|
||||
return SPUtil.getSP(con, LoginActivity.USER, LoginActivity.USER_TOKEN);
|
||||
return SPUtil.getSP(con, LoginActivity.USER,LoginActivity.USER_TOKEN);
|
||||
}
|
||||
|
||||
//银行卡识别
|
||||
public void ORCBank(Context con, Handler hd, File file) {
|
||||
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getOrcBank()), getToken(con), file);
|
||||
RequestUtil.start(12, "OCR_BANK", re, con, hd);
|
||||
public void ORCBank(Context con, Handler hd, File file){
|
||||
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getOrcBank()),getToken(con),file);
|
||||
RequestUtil.start(12, "OCR_BANK",re,con,hd);
|
||||
}
|
||||
|
||||
//银行卡识别-中交
|
||||
public void ORCBankZj(Context con, Handler hd, String imgUrl) {
|
||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getOrcBank() + "?imgurl=" + imgUrl, ""), getToken(con), con);
|
||||
RequestUtil.start(1, "OCR_BANK", re, con, hd);
|
||||
}
|
||||
|
||||
//从业资格证-中交
|
||||
public void ORCQualificaZj(Context con, Handler hd, String imgUrl) {
|
||||
Request re = OkHttpUtil.posts(new OkDate(BuildConfig.BASE_URL+"sinoiov/ocr/getTransQualificationCertOCR" + "?imgurl=" + imgUrl, ""), getToken(con), con);
|
||||
RequestUtil.start(1, "ORCQualificaZj", re, con, hd);
|
||||
}
|
||||
|
||||
//道路运输许可证-中交
|
||||
public void ORCRoadLicZj(Context con, Handler hd, String imgUrl) {
|
||||
Request re = OkHttpUtil.posts(new OkDate(BuildConfig.BASE_URL+"sinoiov/ocr/getVehicleRoadLicenseOCR" + "?faceDataUrl=" + imgUrl, ""), getToken(con), con);
|
||||
RequestUtil.start(1, "ORCRoadLicZj", re, con, hd);
|
||||
}
|
||||
|
||||
//身份证正面识别
|
||||
public void OCRCard(Context con, Handler hd, File file) {
|
||||
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getIdCardFront()), getToken(con), file);
|
||||
RequestUtil.start(12, CertificatesActivity.TYPE_NAME[0], re, con, hd);
|
||||
public void OCRCard(Context con, Handler hd, File file){
|
||||
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getIdCardFront()),getToken(con),file);
|
||||
RequestUtil.start(12, CertificatesActivity.TYPE_NAME[0],re,con,hd);
|
||||
}
|
||||
|
||||
//身份证背面识别
|
||||
public void OCRCardBack(Context con, Handler hd, File file) {
|
||||
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getIdCardBack()), getToken(con), file);
|
||||
RequestUtil.start(12, CertificatesActivity.TYPE_NAME_BANK[0], re, con, hd);
|
||||
public void OCRCardBack(Context con, Handler hd, File file){
|
||||
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getIdCardBack()),getToken(con),file);
|
||||
RequestUtil.start(12, CertificatesActivity.TYPE_NAME_BANK[0], re,con,hd);
|
||||
}
|
||||
|
||||
//身份证正面识别-中交
|
||||
public void OCRZjCard(Context con, Handler hd, String imgUrl) {
|
||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getIdCardFront() + "?faceDataUrl=" + imgUrl, ""), getToken(con), con);
|
||||
RequestUtil.start(1, CertificatesActivity.TYPE_NAME[0], re, con, hd);
|
||||
}
|
||||
|
||||
//身份证背面识别-中交
|
||||
public void OCRZjCardBack(Context con, Handler hd, String imgUrl) {
|
||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getIdCardFront() + "?backDataUrl=" + imgUrl, ""), getToken(con), con);
|
||||
RequestUtil.start(1, CertificatesActivity.TYPE_NAME_BANK[0], re, con, hd);
|
||||
}
|
||||
|
||||
//驾驶证正面识别
|
||||
public void OCRDrivingLicense(Context con, Handler hd, File file) {
|
||||
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getDrivingLicense()), getToken(con), file);
|
||||
RequestUtil.start(12, CertificatesActivity.TYPE_NAME[1], re, con, hd);
|
||||
public void OCRDrivingLicense(Context con, Handler hd, File file){
|
||||
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getDrivingLicense()),getToken(con),file);
|
||||
RequestUtil.start(12, CertificatesActivity.TYPE_NAME[1],re,con,hd);
|
||||
}
|
||||
|
||||
//驾驶证背面识别
|
||||
public void OCRDrivingLicenseBack(Context con, Handler hd, File file) {
|
||||
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getDrivingLicenseBack()), getToken(con), file);
|
||||
RequestUtil.start(12, CertificatesActivity.TYPE_NAME_BANK[1], re, con, hd);
|
||||
public void OCRDrivingLicenseBack(Context con, Handler hd, File file){
|
||||
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getDrivingLicenseBack()),getToken(con),file);
|
||||
RequestUtil.start(12, CertificatesActivity.TYPE_NAME_BANK[1],re,con,hd);
|
||||
}
|
||||
|
||||
//驾驶证正面识别-中交
|
||||
public void OCRDrivingLicenseZj(Context con, Handler hd, String imgUrl){
|
||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getDrivingLicense()+"?faceDataUrl="+imgUrl,""),getToken(con),con);
|
||||
RequestUtil.start(1, CertificatesActivity.TYPE_NAME[1],re,con,hd);
|
||||
}
|
||||
|
||||
//驾驶证背面识别-中交
|
||||
public void OCRDrivingLicenseBackZj(Context con, Handler hd, String imgUrl){
|
||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getDrivingLicense()+"?backDataUrl="+imgUrl,""),getToken(con),con);
|
||||
RequestUtil.start(1, CertificatesActivity.TYPE_NAME_BANK[1],re,con,hd);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//行驶证正面识别
|
||||
public void OCRVehicleLicense(Context con, Handler hd, File file) {
|
||||
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getVehicleLicense()), getToken(con), file);
|
||||
RequestUtil.start(12, CertificatesActivity.TYPE_NAME[2], re, con, hd);
|
||||
public void OCRVehicleLicense(Context con, Handler hd, File file){
|
||||
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getVehicleLicense()),getToken(con),file);
|
||||
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) {
|
||||
Request re = OkHttpUtil.postFiles(new OkDate(RequestConstant.getVehicleLicenseBack()), file, getToken(con), carId, carNum, isSave);
|
||||
RequestUtil.start(12, CertificatesActivity.TYPE_NAME_BANK[2], re, con, hd);
|
||||
public void OCRVehicleLicenseBack(Context con, Handler hd, File file,String carId,String carNum,boolean isSave){
|
||||
Request re = OkHttpUtil.postFiles(new OkDate(RequestConstant.getVehicleLicenseBack()),file,getToken(con),carId,carNum,isSave);
|
||||
RequestUtil.start(12, CertificatesActivity.TYPE_NAME_BANK[2],re,con,hd);
|
||||
}
|
||||
|
||||
public void OCRPlateLicense(Context con, Handler hd, File file){
|
||||
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getPlateLicense()),getToken(con),file);
|
||||
RequestUtil.start(12, "carName",re,con,hd);
|
||||
}
|
||||
|
||||
|
||||
//行驶证正面识别-中交
|
||||
public void OCRVehicleLicenseZj(Context con, Handler hd, String imgUrl) {
|
||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getVehicleLicense() + "?faceDataUrl=" + imgUrl, ""), getToken(con), con);
|
||||
RequestUtil.start(1, CertificatesActivity.TYPE_NAME[2], re, con, hd);
|
||||
}
|
||||
|
||||
//行驶证背面识别-中交
|
||||
public void OCRVehicleLicenseBackZj(Context con, Handler hd, String imgUrl) {
|
||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getVehicleLicense() + "?backDataUrl=" + imgUrl, ""), getToken(con), con);
|
||||
RequestUtil.start(1, CertificatesActivity.TYPE_NAME_BANK[2], re, con, hd);
|
||||
}
|
||||
|
||||
public void OCRPlateLicense(Context con, Handler hd, File file) {
|
||||
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getPlateLicense()), getToken(con), file);
|
||||
RequestUtil.start(12, "carName", re, con, hd);
|
||||
}
|
||||
|
||||
|
||||
public void OCRCarPlateLicense(Context con, Handler hd, File file) {
|
||||
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getPlateLicense2()), getToken(con), file);
|
||||
RequestUtil.start(12, "carNum", re, con, hd);
|
||||
public void OCRCarPlateLicense(Context con, Handler hd, File file){
|
||||
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getPlateLicense2()),getToken(con),file);
|
||||
RequestUtil.start(12, "carNum",re,con,hd);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class RequestConstant {
|
||||
//运单列表
|
||||
private static final String ORDER_LIST = "/app/driver/waybill/listV2";
|
||||
//抢单
|
||||
private static final String AGREE_ORDER = "/app/driver/waybill/grabDriverOrdersContructV2";
|
||||
private static final String AGREE_ORDER = "/app/driver/waybill/grabDriverOrdersContruct";
|
||||
//获取正在执行的运单/运单详情
|
||||
private static final String GET_START_ORDER = "/app/driver/waybill/getExecuteWaybill";
|
||||
//查看承运合同
|
||||
@@ -81,8 +81,6 @@ public class RequestConstant {
|
||||
private static final String COMPLAINT = "/app/driver/waybill/complaintV2";
|
||||
//保存评价信息
|
||||
private static final String EVALUATION_V2 = "/app/driver/waybill/evaluationV2";
|
||||
private static final String GET_WAYBILL_STATUS = "/app/driver/waybill/getWaybillStatus";
|
||||
private static final String GET_ORDER_STATUS = "/app/driver/order/getOrderStatus";
|
||||
//车辆列表
|
||||
private static final String GET_CAR_LIST = "/app/carDriver/getCarList";
|
||||
//车辆详情
|
||||
@@ -100,21 +98,17 @@ public class RequestConstant {
|
||||
//--ORC识别--
|
||||
|
||||
//银行卡识别
|
||||
// private static final String ORC_BANK = "/common/ocr/bank";
|
||||
private static final String ORC_BANK = "sinoiov/ocr/getBankcardOCR";
|
||||
private static final String ORC_BANK = "/common/ocr/bank";
|
||||
//身份证正面
|
||||
// private static final String ID_CARD_FRONT = "/common/ocr/idCardFront";
|
||||
private static final String ID_CARD_FRONT = "sinoiov/ocr/getIdCardLicenseV2";
|
||||
private static final String ID_CARD_FRONT = "/common/ocr/idCardFront";
|
||||
//身份证识别反面
|
||||
private static final String ID_CARD_BACK = "/common/ocr/idCardBack";
|
||||
//驾驶证正面
|
||||
// private static final String DRIVING_LICENSE = "/common/ocr/drivingLicense";
|
||||
private static final String DRIVING_LICENSE = "sinoiov/ocr/getDrivingLicenseOCRV2";
|
||||
private static final String DRIVING_LICENSE = "/common/ocr/drivingLicense";
|
||||
//驾驶证副页
|
||||
private static final String DRIVING_LICENSE_BACK = "/common/ocr/drivingLicenseBack";
|
||||
//行驶证正面
|
||||
// private static final String VEHICLE_LICENSE = "/common/ocr/vehicleLicense";
|
||||
private static final String VEHICLE_LICENSE = "sinoiov/ocr/getVehicleLicenseOCRV2";
|
||||
private static final String VEHICLE_LICENSE = "/common/ocr/vehicleLicense";
|
||||
//行驶证副页
|
||||
private static final String VEHICLE_LICENSE_BACK = "/common/ocr/v2/vehicleBackLicenseV3";
|
||||
//身份证认证信息
|
||||
@@ -130,7 +124,6 @@ public class RequestConstant {
|
||||
private static final String DRIVERAUTHLICENSE = "/app/driver/auth/driverAuthLicense";
|
||||
//行驶证认证
|
||||
private static final String SAVEVEHICLELICENSE = "/app/carDriver/saveVehicleLicense";
|
||||
// private static final String SAVEVEHICLELICENSE = "app/carDriver/save";
|
||||
//从业资格证认证
|
||||
private static final String DRIVER_AUTH_QUALIFICATION = "/app/driver/auth/driverAuthQualification";
|
||||
//车辆等级证书
|
||||
@@ -169,16 +162,11 @@ public class RequestConstant {
|
||||
|
||||
//车辆自动审核触发器
|
||||
private static final String CAR_AUDIT = "/app/carDriver/carAutomaticAudit";
|
||||
private static final String APP_INFO = "/common/app/logininfor";
|
||||
|
||||
public static String getCarAudit() {
|
||||
return BASE_URL + CAR_AUDIT;
|
||||
}
|
||||
|
||||
public static String postAppInfo() {
|
||||
return BASE_URL + APP_INFO;
|
||||
}
|
||||
|
||||
public static String getCarColor() {
|
||||
return BASE_URL + CAR_COLOR;
|
||||
}
|
||||
@@ -338,14 +326,6 @@ public class RequestConstant {
|
||||
return BASE_URL + EVALUATION_V2;
|
||||
}
|
||||
|
||||
public static String getGetWaybillStatus() {
|
||||
return BASE_URL + GET_WAYBILL_STATUS;
|
||||
}
|
||||
|
||||
public static String getGetOrderStatus() {
|
||||
return BASE_URL + GET_ORDER_STATUS;
|
||||
}
|
||||
|
||||
public static String getDRIVERAUTHIDCARD() {
|
||||
return BASE_URL + DRIVERAUTHIDCARD;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import android.provider.Settings;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.AppInfoBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.VehicleEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.business.Md5Util;
|
||||
@@ -80,12 +79,6 @@ public class UserRequset {
|
||||
RequestUtil.start(1, "userdata", re, con, hd);
|
||||
}
|
||||
|
||||
//账户信息
|
||||
public void User2() {
|
||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getUserUrl(), ""), getToken(con), con);
|
||||
RequestUtil.start(1, "userdata2", re, con, hd);
|
||||
}
|
||||
|
||||
//司机认证信息
|
||||
public void driverAuthData() {
|
||||
String mt = "{}";
|
||||
@@ -125,14 +118,6 @@ public class UserRequset {
|
||||
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() {
|
||||
String url = RequestConstant.BASE_URL + "/app/driver/auth/authInfo";
|
||||
@@ -169,7 +154,7 @@ public class UserRequset {
|
||||
/**
|
||||
* 判断是否开启未知应用安装权限
|
||||
*/
|
||||
private void isOpenAppNoRe() {
|
||||
private void isOpenAppNoRe(){
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
boolean b = con.getPackageManager().canRequestPackageInstalls();
|
||||
if (!b) {
|
||||
@@ -184,8 +169,8 @@ public class UserRequset {
|
||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||
private void startInstallPermissionSettingActivity() {
|
||||
//注意这个是8.0新API
|
||||
Uri packageURI = Uri.parse("package:" + con.getPackageName());
|
||||
Intent intent = new Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES, packageURI);
|
||||
Uri packageURI = Uri.parse("package:" +con.getPackageName());
|
||||
Intent intent = new Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES,packageURI);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
con.startActivity(intent);
|
||||
}
|
||||
@@ -236,18 +221,7 @@ public class UserRequset {
|
||||
public void carAudit(String carId) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
-115
@@ -16,123 +16,8 @@ public class LicenseInputBean {
|
||||
private int driverLicensePhoto;
|
||||
private String endTime;
|
||||
private String firstTime;
|
||||
private String address;
|
||||
private String quasiDriveType;
|
||||
private String beginDate;
|
||||
private String endDate;
|
||||
private String fileNumber;
|
||||
private String issuingAuthority;
|
||||
private String sex;
|
||||
private String name;
|
||||
private String idcard;
|
||||
private String organizationName;
|
||||
private String startTime;
|
||||
private String birthday;
|
||||
private String country;
|
||||
|
||||
public String getBirthday() {
|
||||
return birthday;
|
||||
}
|
||||
|
||||
public void setBirthday(String birthday) {
|
||||
this.birthday = birthday;
|
||||
}
|
||||
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
public void setCountry(String country) {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
public String getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(String startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public String getOrganizationName() {
|
||||
return organizationName;
|
||||
}
|
||||
|
||||
public void setOrganizationName(String organizationName) {
|
||||
this.organizationName = organizationName;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getQuasiDriveType() {
|
||||
return quasiDriveType;
|
||||
}
|
||||
|
||||
public void setQuasiDriveType(String quasiDriveType) {
|
||||
this.quasiDriveType = quasiDriveType;
|
||||
}
|
||||
|
||||
public String getBeginDate() {
|
||||
return beginDate;
|
||||
}
|
||||
|
||||
public void setBeginDate(String beginDate) {
|
||||
this.beginDate = beginDate;
|
||||
}
|
||||
|
||||
public String getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public void setEndDate(String endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public String getFileNumber() {
|
||||
return fileNumber;
|
||||
}
|
||||
|
||||
public void setFileNumber(String fileNumber) {
|
||||
this.fileNumber = fileNumber;
|
||||
}
|
||||
|
||||
public String getIssuingAuthority() {
|
||||
return issuingAuthority;
|
||||
}
|
||||
|
||||
public void setIssuingAuthority(String issuingAuthority) {
|
||||
this.issuingAuthority = issuingAuthority;
|
||||
}
|
||||
|
||||
public String getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(String sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getIdcard() {
|
||||
return idcard;
|
||||
}
|
||||
|
||||
public void setIdcard(String idcard) {
|
||||
this.idcard = idcard;
|
||||
}
|
||||
|
||||
public String getAllowType() {
|
||||
return allowType;
|
||||
|
||||
-40
@@ -1,40 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.request.bean.newlj;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName InvoiceBean
|
||||
* @Author john
|
||||
* @Date 2024/11/25 17:06
|
||||
* @Description TODO
|
||||
*/
|
||||
public class InvoiceBean implements Serializable {
|
||||
private String driverIdentification;
|
||||
private String driverInvoiceCode;
|
||||
private String enterpriseCode;
|
||||
|
||||
|
||||
public String getDriverIdentification() {
|
||||
return driverIdentification;
|
||||
}
|
||||
|
||||
public void setDriverIdentification(String driverIdentification) {
|
||||
this.driverIdentification = driverIdentification;
|
||||
}
|
||||
|
||||
public String getDriverInvoiceCode() {
|
||||
return driverInvoiceCode;
|
||||
}
|
||||
|
||||
public void setDriverInvoiceCode(String driverInvoiceCode) {
|
||||
this.driverInvoiceCode = driverInvoiceCode;
|
||||
}
|
||||
|
||||
public String getEnterpriseCode() {
|
||||
return enterpriseCode;
|
||||
}
|
||||
|
||||
public void setEnterpriseCode(String enterpriseCode) {
|
||||
this.enterpriseCode = enterpriseCode;
|
||||
}
|
||||
}
|
||||
-135
@@ -1,135 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.request.bean.newlj;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName InvoicesBean
|
||||
* @Author john
|
||||
* @Date 2024/11/29 13:08
|
||||
* @Description TODO
|
||||
*/
|
||||
public class InvoicesBean implements Serializable {
|
||||
private String totalPage;
|
||||
private String totalCount;
|
||||
private String pageSize;
|
||||
private String currentPage;
|
||||
private String sortField;
|
||||
private String sortDirection;
|
||||
private List<DataDTO> driverInvoices;
|
||||
|
||||
public String getTotalPage() {
|
||||
return totalPage;
|
||||
}
|
||||
|
||||
public void setTotalPage(String totalPage) {
|
||||
this.totalPage = totalPage;
|
||||
}
|
||||
|
||||
public String getTotalCount() {
|
||||
return totalCount;
|
||||
}
|
||||
|
||||
public void setTotalCount(String totalCount) {
|
||||
this.totalCount = totalCount;
|
||||
}
|
||||
|
||||
public String getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(String pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public String getCurrentPage() {
|
||||
return currentPage;
|
||||
}
|
||||
|
||||
public void setCurrentPage(String currentPage) {
|
||||
this.currentPage = currentPage;
|
||||
}
|
||||
|
||||
public String getSortField() {
|
||||
return sortField;
|
||||
}
|
||||
|
||||
public void setSortField(String sortField) {
|
||||
this.sortField = sortField;
|
||||
}
|
||||
|
||||
public String getSortDirection() {
|
||||
return sortDirection;
|
||||
}
|
||||
|
||||
public void setSortDirection(String sortDirection) {
|
||||
this.sortDirection = sortDirection;
|
||||
}
|
||||
|
||||
public List<DataDTO> getDriverInvoices() {
|
||||
return driverInvoices;
|
||||
}
|
||||
|
||||
public void setDriverInvoices(List<DataDTO> driverInvoices) {
|
||||
this.driverInvoices = driverInvoices;
|
||||
}
|
||||
|
||||
public static class DataDTO{
|
||||
|
||||
private String taxAmount;
|
||||
private String totalAmount;
|
||||
private String invoiceReceiverName;
|
||||
private String totalAmountIncludeTax;
|
||||
private String driverInvoiceCode;
|
||||
private String taxRate;
|
||||
|
||||
|
||||
public String getTaxAmount() {
|
||||
return taxAmount;
|
||||
}
|
||||
|
||||
public void setTaxAmount(String taxAmount) {
|
||||
this.taxAmount = taxAmount;
|
||||
}
|
||||
|
||||
public String getTotalAmount() {
|
||||
return totalAmount;
|
||||
}
|
||||
|
||||
public void setTotalAmount(String totalAmount) {
|
||||
this.totalAmount = totalAmount;
|
||||
}
|
||||
|
||||
public String getInvoiceReceiverName() {
|
||||
return invoiceReceiverName;
|
||||
}
|
||||
|
||||
public void setInvoiceReceiverName(String invoiceReceiverName) {
|
||||
this.invoiceReceiverName = invoiceReceiverName;
|
||||
}
|
||||
|
||||
public String getTotalAmountIncludeTax() {
|
||||
return totalAmountIncludeTax;
|
||||
}
|
||||
|
||||
public void setTotalAmountIncludeTax(String totalAmountIncludeTax) {
|
||||
this.totalAmountIncludeTax = totalAmountIncludeTax;
|
||||
}
|
||||
|
||||
public String getDriverInvoiceCode() {
|
||||
return driverInvoiceCode;
|
||||
}
|
||||
|
||||
public void setDriverInvoiceCode(String driverInvoiceCode) {
|
||||
this.driverInvoiceCode = driverInvoiceCode;
|
||||
}
|
||||
|
||||
public String getTaxRate() {
|
||||
return taxRate;
|
||||
}
|
||||
|
||||
public void setTaxRate(String taxRate) {
|
||||
this.taxRate = taxRate;
|
||||
}
|
||||
}
|
||||
}
|
||||
-41
@@ -1,41 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.request.bean.newlj;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName LjTokenBean
|
||||
* @Author john
|
||||
* @Date 2024/11/25 10:05
|
||||
* @Description TODO
|
||||
*/
|
||||
public class LjTokenBean implements Serializable {
|
||||
|
||||
|
||||
private String enterpriseCode;
|
||||
private String enterpriseIdentity;
|
||||
private String enterpriseKey;
|
||||
|
||||
public String getEnterpriseCode() {
|
||||
return enterpriseCode;
|
||||
}
|
||||
|
||||
public void setEnterpriseCode(String enterpriseCode) {
|
||||
this.enterpriseCode = enterpriseCode;
|
||||
}
|
||||
|
||||
public String getEnterpriseIdentity() {
|
||||
return enterpriseIdentity;
|
||||
}
|
||||
|
||||
public void setEnterpriseIdentity(String enterpriseIdentity) {
|
||||
this.enterpriseIdentity = enterpriseIdentity;
|
||||
}
|
||||
|
||||
public String getEnterpriseKey() {
|
||||
return enterpriseKey;
|
||||
}
|
||||
|
||||
public void setEnterpriseKey(String enterpriseKey) {
|
||||
this.enterpriseKey = enterpriseKey;
|
||||
}
|
||||
}
|
||||
-109
@@ -1,109 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.request.bean.newlj;
|
||||
|
||||
import com.alct.mdp.model.Location;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.GDLocation;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName PickupBean
|
||||
* @Author john
|
||||
* @Date 2024/11/25 10:19
|
||||
* @Description TODO
|
||||
*/
|
||||
public class PickupBean implements Serializable {
|
||||
|
||||
private String shipmentCode;
|
||||
private String enterpriseCode;
|
||||
private GDLocation location;
|
||||
|
||||
public String getShipmentCode() {
|
||||
return shipmentCode;
|
||||
}
|
||||
|
||||
public void setShipmentCode(String shipmentCode) {
|
||||
this.shipmentCode = shipmentCode;
|
||||
}
|
||||
|
||||
public String getEnterpriseCode() {
|
||||
return enterpriseCode;
|
||||
}
|
||||
|
||||
public void setEnterpriseCode(String enterpriseCode) {
|
||||
this.enterpriseCode = enterpriseCode;
|
||||
}
|
||||
|
||||
public GDLocation getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(GDLocation location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public static class LocationDTO {
|
||||
private String time;
|
||||
private double baiduLatitude;
|
||||
private double baiduLongitude;
|
||||
private double altitude;
|
||||
private double speed;
|
||||
private double bearing;
|
||||
private String location;
|
||||
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(String time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public double getBaiduLatitude() {
|
||||
return baiduLatitude;
|
||||
}
|
||||
|
||||
public void setBaiduLatitude(double baiduLatitude) {
|
||||
this.baiduLatitude = baiduLatitude;
|
||||
}
|
||||
|
||||
public double getBaiduLongitude() {
|
||||
return baiduLongitude;
|
||||
}
|
||||
|
||||
public void setBaiduLongitude(double baiduLongitude) {
|
||||
this.baiduLongitude = baiduLongitude;
|
||||
}
|
||||
|
||||
public double getAltitude() {
|
||||
return altitude;
|
||||
}
|
||||
|
||||
public void setAltitude(double altitude) {
|
||||
this.altitude = altitude;
|
||||
}
|
||||
|
||||
public double getSpeed() {
|
||||
return speed;
|
||||
}
|
||||
|
||||
public void setSpeed(double speed) {
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
public double getBearing() {
|
||||
return bearing;
|
||||
}
|
||||
|
||||
public void setBearing(double bearing) {
|
||||
this.bearing = bearing;
|
||||
}
|
||||
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(String location) {
|
||||
this.location = location;
|
||||
}
|
||||
}
|
||||
}
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.request.bean.newlj;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName ShipmentStatusBean
|
||||
* @Author john
|
||||
* @Date 2024/11/25 17:16
|
||||
* @Description TODO
|
||||
*/
|
||||
public class ShipmentStatusBean implements Serializable {
|
||||
private String shipmentCode;
|
||||
private String enterpriseCode;
|
||||
|
||||
|
||||
public String getShipmentCode() {
|
||||
return shipmentCode;
|
||||
}
|
||||
|
||||
public void setShipmentCode(String shipmentCode) {
|
||||
this.shipmentCode = shipmentCode;
|
||||
}
|
||||
|
||||
public String getEnterpriseCode() {
|
||||
return enterpriseCode;
|
||||
}
|
||||
|
||||
public void setEnterpriseCode(String enterpriseCode) {
|
||||
this.enterpriseCode = enterpriseCode;
|
||||
}
|
||||
}
|
||||
-118
@@ -1,118 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.request.bean.newlj;
|
||||
|
||||
import com.alct.mdp.model.Image;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.GDImage;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName UpimgBean
|
||||
* @Author john
|
||||
* @Date 2024/11/25 14:36
|
||||
* @Description TODO
|
||||
*/
|
||||
public class UpimgBean implements Serializable {
|
||||
|
||||
private String shipmentCode;
|
||||
private String enterpriseCode;
|
||||
private GDImage image;
|
||||
|
||||
public String getShipmentCode() {
|
||||
return shipmentCode;
|
||||
}
|
||||
|
||||
public void setShipmentCode(String shipmentCode) {
|
||||
this.shipmentCode = shipmentCode;
|
||||
}
|
||||
|
||||
public String getEnterpriseCode() {
|
||||
return enterpriseCode;
|
||||
}
|
||||
|
||||
public void setEnterpriseCode(String enterpriseCode) {
|
||||
this.enterpriseCode = enterpriseCode;
|
||||
}
|
||||
|
||||
public GDImage getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public void setImage(GDImage image) {
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
public static class ImageDTO {
|
||||
private String fileName;
|
||||
private String fileExt;
|
||||
private double baiduLongitude;
|
||||
private double baiduLatitude;
|
||||
private String location;
|
||||
private String imageTakenDate;
|
||||
private String time;
|
||||
private String fileData;
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
public String getFileExt() {
|
||||
return fileExt;
|
||||
}
|
||||
|
||||
public void setFileExt(String fileExt) {
|
||||
this.fileExt = fileExt;
|
||||
}
|
||||
|
||||
public double getBaiduLongitude() {
|
||||
return baiduLongitude;
|
||||
}
|
||||
|
||||
public void setBaiduLongitude(double baiduLongitude) {
|
||||
this.baiduLongitude = baiduLongitude;
|
||||
}
|
||||
|
||||
public double getBaiduLatitude() {
|
||||
return baiduLatitude;
|
||||
}
|
||||
|
||||
public void setBaiduLatitude(double baiduLatitude) {
|
||||
this.baiduLatitude = baiduLatitude;
|
||||
}
|
||||
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(String location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public String getImageTakenDate() {
|
||||
return imageTakenDate;
|
||||
}
|
||||
|
||||
public void setImageTakenDate(String imageTakenDate) {
|
||||
this.imageTakenDate = imageTakenDate;
|
||||
}
|
||||
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(String time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public String getFileData() {
|
||||
return fileData;
|
||||
}
|
||||
|
||||
public void setFileData(String fileData) {
|
||||
this.fileData = fileData;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,23 +4,11 @@ package com.arpa.hndahesudintocctmsdriver.request.net;
|
||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.UserBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.LoginRegInputBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.InvoiceBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.InvoicesBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.LjTokenBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.PickupBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.ShipmentStatusBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.UpimgBean;
|
||||
import com.dahe.mylibrary.net.CommonResponseBean;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.PUT;
|
||||
import retrofit2.http.Path;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
/**
|
||||
@@ -29,7 +17,7 @@ import retrofit2.http.Query;
|
||||
|
||||
public interface Api {
|
||||
|
||||
String BASE_URL = BuildConfig.isTest? "http://api.kehui56.cn/api/v1/":"https://api.kehui56.com/api/v1/";
|
||||
String BASE_URL = BuildConfig.BASE_URL;
|
||||
|
||||
|
||||
//获取版本
|
||||
@@ -38,128 +26,5 @@ public interface Api {
|
||||
// @POST(BASE_URL+"/common/register")
|
||||
// Observable<CommonResponseBean> log(@Body LoginRegInputBean bean);
|
||||
|
||||
@POST(BASE_URL+"openapi/enterprises/login")
|
||||
Observable<CommonResponseBean> getToken(@Body LjTokenBean bean);
|
||||
|
||||
@POST(BASE_URL+"openapi/enterprises/login")
|
||||
Call<HashMap<String, String>> getRefreshToken(@Body LjTokenBean bean);
|
||||
|
||||
|
||||
/**
|
||||
* 刷新token
|
||||
* @return
|
||||
*/
|
||||
@POST(BASE_URL+"openapi/enterprises/refresh-token/{refreshToken}")
|
||||
Observable<CommonResponseBean> refreshToken(@Path("refreshToken") String refreshToken);
|
||||
|
||||
/**
|
||||
* 运单提货
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@POST(BASE_URL+"openapi/shipments/pickup")
|
||||
Observable<CommonResponseBean> pickup(@Body PickupBean bean);
|
||||
|
||||
|
||||
/**
|
||||
* 运单卸货
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@POST(BASE_URL+"openapi/shipments/unload")
|
||||
Observable<CommonResponseBean> unload(@Body PickupBean bean);
|
||||
|
||||
|
||||
/**
|
||||
* 运单签收
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@POST(BASE_URL+"openapi/shipments/sign")
|
||||
Observable<CommonResponseBean> sign(@Body PickupBean bean);
|
||||
|
||||
|
||||
/**
|
||||
* 运单回单
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@POST(BASE_URL+"openapi/shipments/pod")
|
||||
Observable<CommonResponseBean> pod(@Body PickupBean bean);
|
||||
|
||||
|
||||
/**
|
||||
* 运单提货照片上传
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@POST(BASE_URL+"openapi/shipments/uploadPickupImage")
|
||||
Observable<CommonResponseBean> uploadPickupImage(@Body UpimgBean bean);
|
||||
|
||||
|
||||
/**
|
||||
* 运单卸货照片上传
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@POST(BASE_URL+"openapi/shipments/uploadUnloadImage")
|
||||
Observable<CommonResponseBean> uploadUnloadImage(@Body UpimgBean bean);
|
||||
|
||||
|
||||
/**
|
||||
* 运单回单照片上传
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@POST(BASE_URL+"openapi/shipments/uploadPODImage")
|
||||
Observable<CommonResponseBean> uploadPODImage(@Body UpimgBean bean);
|
||||
|
||||
|
||||
/**
|
||||
* 同意发票申请
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@PUT(BASE_URL+"openapi/confirmInvoice")
|
||||
Observable<CommonResponseBean> confirmInvoice(@Body InvoiceBean bean);
|
||||
|
||||
/**
|
||||
* 待同意发票列表获取
|
||||
* @param enterpriseCodeParam
|
||||
* @param driverIdentification
|
||||
* @param currentPage
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@GET(BASE_URL+"openapi/getInvoices")
|
||||
Observable<CommonResponseBean<InvoicesBean>> getInvoices(@Query("enterpriseCodeParam") String enterpriseCodeParam,
|
||||
@Query("driverIdentification") String driverIdentification,
|
||||
@Query("currentPage") int currentPage,
|
||||
@Query("pageSize") int pageSize);
|
||||
|
||||
|
||||
/**
|
||||
* 获取运单状态
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@POST(BASE_URL+"/openapi/getShipmentStatus")
|
||||
Observable<CommonResponseBean> getShipmentStatus(@Body ShipmentStatusBean bean);
|
||||
|
||||
@POST(BASE_URL+"/openapi/shipments/getPODImageNames")
|
||||
Observable<CommonResponseBean> getPODImageNames(@Body ShipmentStatusBean bean);
|
||||
|
||||
|
||||
@GET(BASE_URL+"/openapi/drivers")
|
||||
Observable<CommonResponseBean> searchDriver(@Query("identityNo") String identityNo);
|
||||
|
||||
|
||||
/**
|
||||
* 司机车辆绑定关系
|
||||
* @param identityNo
|
||||
* @return
|
||||
*/
|
||||
@GET(BASE_URL+"openapi/drivers/{identityNo}/trucks")
|
||||
Observable<CommonResponseBean> trucks(@Path("identityNo") String identityNo);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,114 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.request.net
|
||||
|
||||
import okhttp3.Interceptor
|
||||
import okhttp3.Request
|
||||
import okio.IOException
|
||||
import retrofit2.Response
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
|
||||
/**
|
||||
* @ClassName ApiInterceptor
|
||||
* @Author john
|
||||
* @Date 2024/11/29 17:05
|
||||
* @Description TODO
|
||||
*/
|
||||
class ApiInterceptor : Interceptor {
|
||||
|
||||
// 需要验证token的接口的路径集合
|
||||
// private val checkTokenInterface = arrayListOf(
|
||||
// "/example/user/info,
|
||||
// "/example/user/info/edit"
|
||||
// )
|
||||
|
||||
// 是否正在刷新token
|
||||
// 使用AtomicBoolean,确保多线程中获取的值一致
|
||||
// private var refreshingToken = AtomicBoolean(false)
|
||||
//
|
||||
// private val authHeaderKey = "token-key"
|
||||
//
|
||||
// // 当前token
|
||||
// private var currentToken = "tokenValue"
|
||||
|
||||
// override fun intercept(chain: Interceptor.Chain): Response {
|
||||
// 根据接口路径判断是否需要验证token
|
||||
// val checkToken = checkTokenInterface.contains(chain.request().url.encodedPath)
|
||||
// // 需要验证token则添加请求头,不需要则保持原样
|
||||
// var request = if (checkToken) {
|
||||
// chain.request().newBuilder()
|
||||
// .addHeader(authHeaderKey, currentToken)
|
||||
// .build()
|
||||
// } else {
|
||||
// chain.request()
|
||||
// }
|
||||
// // 获取响应
|
||||
// var response = chain.proceed(request)
|
||||
// if (checkToken) {
|
||||
// // 需要验证token,处理响应,判断token是否过期
|
||||
// response.body?.let { responseBody ->
|
||||
// try {
|
||||
// if (判断token过期的条件) {
|
||||
// runBlocking {
|
||||
// // 请求头中的token与currentToken仍然一样则需要刷新token
|
||||
// // 确保多线程中不会重复刷新
|
||||
// if (request.header(authHeaderKey) == currentToken){
|
||||
// // 标记为正在刷新token
|
||||
// if (refreshingToken.compareAndSet(false, true)) {
|
||||
// refreshToken(chain).takeIf { it.isNotEmpty() && it.isNotBlank() }?.let { newToken ->
|
||||
// // 保存newToken
|
||||
// currentToken = newToken
|
||||
// }
|
||||
// // 标记为刷新token已结束
|
||||
// refreshingToken.set(false)
|
||||
// }
|
||||
// }
|
||||
// // async{}.await()会等待方法块内的代码执行完毕。
|
||||
// // 等到refreshingToken为false时才会执行后续代码。
|
||||
// if (async { stopRefreshingToken() }.await()) {
|
||||
// // 携带newToken执行原请求获取响应
|
||||
// response = chain.proceed(chain.request().newBuilder()
|
||||
// .addHeader(authHeaderKey, currentToken)
|
||||
// .build())
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// } catch (e: Exception) {
|
||||
// e.printStackTrace()
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// // 返回最终的响应结果。
|
||||
// // 刷新token也可能失败,此时返回原响应,可以让用户重新登录。
|
||||
// return response
|
||||
// }
|
||||
//
|
||||
// private fun refreshToken(chain: Interceptor.Chain): String {
|
||||
// // 创建刷新token的请求
|
||||
// val refreshTokenRequest = Request.Builder()
|
||||
// .url("refresh token url")
|
||||
// .addHeader(authHeaderKey, currentToken)
|
||||
// .get()
|
||||
// .build()
|
||||
// return try {
|
||||
// // 获取响应并解析获得新token
|
||||
// val refreshTokenResponse = chain.proceed(refreshTokenRequest)
|
||||
// refreshTokenResponse.token
|
||||
// } catch (e: IOException) {
|
||||
// // 失败时返回空字符串
|
||||
// ""
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private suspend fun stopRefreshingToken(): Boolean {
|
||||
// return if (refreshingToken.get()) {
|
||||
// // 仍在刷新token中,延迟1秒后再次执行此方法
|
||||
// delay(1000)
|
||||
// stopRefreshingToken()
|
||||
// } else {
|
||||
// true
|
||||
// }
|
||||
// }
|
||||
override fun intercept(chain: Interceptor.Chain): okhttp3.Response {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class BaseObserver<T> implements Observer<CommonResponseBean<T>> {
|
||||
|
||||
@Override
|
||||
public void onNext(CommonResponseBean<T> tCommonResponseBean) {
|
||||
if ("0".equals(tCommonResponseBean.getCode())) {
|
||||
if (200==tCommonResponseBean.getCode()) {
|
||||
mRxHttpCallBack.onSuccess(tCommonResponseBean);
|
||||
} else {
|
||||
mRxHttpCallBack.onCodeError(mContext, tCommonResponseBean);
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.arpa.hndahesudintocctmsdriver.request.net;
|
||||
|
||||
|
||||
import com.dahe.mylibrary.CommonBaseLibrary;
|
||||
import com.dahe.mylibrary.net.JsonInterceptor;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
||||
@@ -1,119 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.request.net;
|
||||
|
||||
import static com.dahe.mylibrary.utils.BaseSPUtils.NEW_LJ_TOKEN;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import com.arpa.hndahesudintocctmsdriver.App;
|
||||
import com.arpa.hndahesudintocctmsdriver.constant.NewLJConstant;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.LjTokenBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.NewLJUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
||||
import com.dahe.mylibrary.CommonBaseLibrary;
|
||||
import com.dahe.mylibrary.net.CommonResponseBean;
|
||||
import com.dahe.mylibrary.net.ResultException;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import kotlin.jvm.Synchronized;
|
||||
import okhttp3.Interceptor;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import okhttp3.ResponseBody;
|
||||
import okio.Buffer;
|
||||
import okio.BufferedSource;
|
||||
|
||||
/**
|
||||
* json的Interceptor
|
||||
*/
|
||||
|
||||
public class JsonInterceptor implements Interceptor {
|
||||
private static final String TAG = "JsonInterceptor";
|
||||
|
||||
public JsonInterceptor() {
|
||||
}
|
||||
|
||||
// 使用AtomicBoolean,确保多线程中获取的值一致
|
||||
private AtomicBoolean refreshingToken = new AtomicBoolean(false);
|
||||
|
||||
@Override
|
||||
public Response intercept(Chain chain) throws IOException {
|
||||
Request request = chain.request();
|
||||
Response response = chain.proceed(request);
|
||||
ResponseBody responseBody = response.body();
|
||||
//为了不消耗buffer,我们这里使用source先获得buffer对象,然后clone()后使用
|
||||
BufferedSource source = responseBody.source();
|
||||
source.request(Long.MAX_VALUE); // Buffer the entire body.
|
||||
//获得返回的数据
|
||||
Buffer buffer = source.buffer();
|
||||
//使用前clone()下,避免直接消耗
|
||||
String responseBodyStr = buffer.clone().readString(Charset.forName("UTF-8"));
|
||||
Log.i(TAG, "result-body= " + responseBodyStr);
|
||||
try {
|
||||
|
||||
JSONObject jsonObject = new JSONObject(responseBodyStr);
|
||||
String str = jsonObject.optString("data");
|
||||
int code = jsonObject.optInt("code");
|
||||
if (401 == code) {
|
||||
refreshToken();
|
||||
// if (execute.body() != null) {
|
||||
// String refreshToken = execute.body().get("token");
|
||||
// SPUtils.put(App.getApp(), NEW_LJ_TOKEN, refreshToken);
|
||||
// }
|
||||
response.close();
|
||||
try {
|
||||
return chain.proceed(request);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (-1 == code) {
|
||||
jsonObject.put("data", new JSONObject());
|
||||
throw new ResultException();
|
||||
} else {
|
||||
if (TextUtils.isEmpty(str)) {
|
||||
jsonObject.put("data", new JSONObject());
|
||||
}
|
||||
}
|
||||
|
||||
String data = jsonObject.toString();
|
||||
responseBody = ResponseBody.create(MediaType.parse("application/json; charset=utf-8"), data);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
response = response.newBuilder().body(responseBody).build();
|
||||
return response;
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
private void refreshToken() throws IOException {
|
||||
Api api = CommonBaseLibrary.getRetrofit().newBuilder()
|
||||
.client(new OkHttpClient.Builder()
|
||||
.connectTimeout(30, TimeUnit.SECONDS)
|
||||
.readTimeout(30, TimeUnit.SECONDS)
|
||||
.writeTimeout(30, TimeUnit.SECONDS)
|
||||
.build())
|
||||
// .addNetworkInterceptor(new TokenInterceptor())
|
||||
.build().create(Api.class);
|
||||
LjTokenBean ljTokenBean = new LjTokenBean();
|
||||
ljTokenBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||
ljTokenBean.setEnterpriseIdentity(NewLJConstant.ENTER_PRISE_IDENTITY);
|
||||
ljTokenBean.setEnterpriseKey(NewLJConstant.ENTER_PRISE_KEY);
|
||||
retrofit2.Response<HashMap<String, String>> execute = api.getRefreshToken(ljTokenBean).execute();
|
||||
if (execute.body() != null) {
|
||||
String refreshToken = execute.body().get("token");
|
||||
SPUtils.put(App.getApp(), NEW_LJ_TOKEN, refreshToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-5
@@ -1,7 +1,5 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.request.net;
|
||||
|
||||
import static com.dahe.mylibrary.utils.BaseSPUtils.NEW_LJ_TOKEN;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
@@ -29,10 +27,9 @@ public class RequestHeadInterceptor implements Interceptor {
|
||||
@Override
|
||||
public Response intercept(Chain chain) throws IOException {
|
||||
Request.Builder builder = chain.request().newBuilder();
|
||||
String token = SPUtils.get(App.getApp(), NEW_LJ_TOKEN, "").toString();
|
||||
if (!TextUtils.isEmpty(token)) {
|
||||
if (!TextUtils.isEmpty(SPUtil.getSP(App.getApp(), LoginActivity.USER,LoginActivity.USER_TOKEN))) {
|
||||
// builder.addHeader("Authorization", SPUtils.getUserInfo(App.getApp()).getToken());
|
||||
builder.addHeader("token", token);
|
||||
builder.addHeader("Authorization", SPUtil.getSP(App.getApp(), LoginActivity.USER,LoginActivity.USER_TOKEN));
|
||||
}
|
||||
Request request = builder
|
||||
.addHeader("versionCode", AppUtils.getAppVersionCode() + "")
|
||||
|
||||
@@ -11,7 +11,6 @@ import android.view.Window;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.UiAuxiliary;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.NewLJUtils;
|
||||
import com.dahe.mylibrary.net.CommonResponseBean;
|
||||
import com.dahe.mylibrary.net.ResultException;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
@@ -87,15 +86,14 @@ public abstract class RxHttpCallBack<T> {
|
||||
dialog.dismiss();
|
||||
|
||||
}
|
||||
if ("401".equals(t.getCode())) {
|
||||
// NewLJUtils.getInstance().refreshToken(mContext);
|
||||
// UiAuxiliary.delLogin(mContext);
|
||||
// Intent intent = new Intent(mContext, MainActivity.class);
|
||||
// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
// mContext.startActivity(intent);
|
||||
// ToastUtils.showToast(mContext,"您的账号再异地登录,请重新登录");
|
||||
if (t.getCode() == 401) {
|
||||
UiAuxiliary.delLogin(mContext);
|
||||
Intent intent = new Intent(mContext, MainActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
mContext.startActivity(intent);
|
||||
ToastUtils.showToast(mContext,"您的账号再异地登录,请重新登录");
|
||||
}else{
|
||||
// ToastUtils.showToast(mContext,t.getMessage());
|
||||
ToastUtils.showToast(mContext,t.getMsg());
|
||||
}
|
||||
|
||||
// if (t.getMessage().getMsg_code() == 100 && SPUtils.hasUserInfo(mContext)) {
|
||||
|
||||
@@ -62,14 +62,14 @@ public class MakeUpService extends Service {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
// palyMp3();
|
||||
palyMp3();
|
||||
}
|
||||
|
||||
//开始
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
Log.e("服务开启","-----");
|
||||
palyMp3();
|
||||
|
||||
return START_STICKY;
|
||||
|
||||
}
|
||||
|
||||
@@ -3,12 +3,15 @@ package com.arpa.hndahesudintocctmsdriver.service;
|
||||
import android.app.Service;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Environment;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.amap.api.location.AMapLocation;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.FileIOUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
||||
@@ -18,8 +21,13 @@ import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.logging.Filter;
|
||||
|
||||
/**
|
||||
* @author hlh
|
||||
@@ -30,28 +38,51 @@ import java.util.TimerTask;
|
||||
public class TrackService extends Service {
|
||||
|
||||
private Context con;
|
||||
private TrackInputBean tib = new TrackInputBean();
|
||||
private TrackInputBean tib=new TrackInputBean();
|
||||
private LocationGDUtil l;
|
||||
private int timeSum = 1000 * 60 * 3;
|
||||
private String snn = "";
|
||||
private Gson gson = new Gson();
|
||||
private int timeSum=1000*60;
|
||||
private String snn="";
|
||||
private Gson gson=new Gson();
|
||||
private HuoYuanRequset hyr;
|
||||
|
||||
private Handler hd = new Handler(msg -> {
|
||||
switch (msg.what) {
|
||||
private Handler hd=new Handler(msg -> {
|
||||
switch (msg.what){
|
||||
case RequsetCodeConstants.SUCCESS:
|
||||
if (CacheGroup.cacheList.get("genzong") != null) {
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("genzong"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
Log.e("--轨迹上传--", "成功");
|
||||
} else {
|
||||
Log.e("--轨迹上传失败:--", bb.getMsg());
|
||||
if(CacheGroup.cacheList.get("genzong")!=null){
|
||||
BaseBean bb=gson.fromJson(CacheGroup.cacheList.get("genzong"),BaseBean.class);
|
||||
if(bb.getCode()==200){
|
||||
Log.e("--轨迹上传--","成功");
|
||||
}else{
|
||||
Log.e("--轨迹上传失败:--",bb.getMsg());
|
||||
}
|
||||
CacheGroup.cacheList.remove("genzong");
|
||||
}
|
||||
break;
|
||||
case LocationGDUtil.RES:
|
||||
genzong();
|
||||
if(CacheGroup.cacheList.get("getLocation")!=null){
|
||||
AMapLocation location = gson.fromJson(CacheGroup.cacheList.get("getLocation"), AMapLocation.class);
|
||||
String time2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
|
||||
String time = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
|
||||
// 当前时间:${time2},经纬度:${it.latitude}:${it.longitude}
|
||||
FileIOUtils.writeFileFromString(
|
||||
Environment.getExternalStorageDirectory()
|
||||
.toString() + "/crashinfo/" + "crash-"+time+".txt",
|
||||
"当前时间:"+time2+",经纬度:"+location.getLatitude()+":"+location.getLongitude(),
|
||||
true
|
||||
);
|
||||
// genzong(location);
|
||||
CacheGroup.cacheList.remove("getLocation");
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
String time2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
|
||||
String time = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
|
||||
FileIOUtils.writeFileFromString(
|
||||
Environment.getExternalStorageDirectory()
|
||||
.toString() + "/crashinfo/" + "crash-"+time+".txt",
|
||||
"当前时间:"+time2+",定位失败",
|
||||
true
|
||||
);
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
@@ -59,34 +90,32 @@ public class TrackService extends Service {
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
return null;
|
||||
}
|
||||
public IBinder onBind(Intent intent) {return null; }
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
con = this;
|
||||
// hyr = new HuoYuanRequset(con, hd);
|
||||
// Log.e("开始循环上传,等待100ms", "-----");
|
||||
// new Timer().schedule(new TimerTask() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// snn = SPUtil.getSP(con, "order", "ShippingNoteNumber");
|
||||
// if (!snn.equals("")) {
|
||||
// l = new LocationGDUtil(con, hd);
|
||||
// l.onCreate();
|
||||
// } else {
|
||||
// onDestroy();
|
||||
// }
|
||||
// }
|
||||
// }, 100, timeSum);
|
||||
con=this;
|
||||
hyr=new HuoYuanRequset(con,hd);
|
||||
Log.e("开始循环上传,等待100ms","-----");
|
||||
new Timer().schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
snn=SPUtil.getSP(con,"order","ShippingNoteNumber");
|
||||
if(!snn.equals("")) {
|
||||
l = new LocationGDUtil(con, hd);
|
||||
l.onCreate();
|
||||
}else{
|
||||
onDestroy();
|
||||
}
|
||||
}
|
||||
},100,timeSum);
|
||||
}
|
||||
|
||||
//开始
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
Log.e("服务开启", "-----");
|
||||
Log.e("服务开启","-----");
|
||||
return START_STICKY;
|
||||
|
||||
}
|
||||
@@ -96,19 +125,16 @@ public class TrackService extends Service {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
public void genzong() {
|
||||
// if (l == null || l.getLatitude() == 0d) {
|
||||
// return;
|
||||
// }
|
||||
// //经度
|
||||
// tib.setLatitude(l.getLatitude() + "");
|
||||
// //纬度
|
||||
// tib.setLongitude(l.getLongitude() + "");
|
||||
// Log.e("经度", l.getLatitude() + "");
|
||||
// Log.e("维度", l.getLongitude() + "");
|
||||
// //单号
|
||||
// tib.setShippingNoteNumber(snn);
|
||||
// hyr.trackTracking(tib);
|
||||
public void genzong(AMapLocation location){
|
||||
//经度
|
||||
tib.setLatitude(location.getLatitude()+"");
|
||||
//纬度
|
||||
tib.setLongitude(location.getLongitude()+"");
|
||||
Log.e("经度",location.getLatitude()+"");
|
||||
Log.e("维度",location.getLongitude()+"");
|
||||
//单号
|
||||
tib.setShippingNoteNumber(snn);
|
||||
hyr.trackTracking(tib);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import android.view.KeyEvent
|
||||
import android.widget.*
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.arpa.hndahesudintocctmsdriver.R
|
||||
import com.arpa.hndahesudintocctmsdriver.event.WalletEvent
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.home.HomeFragment
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.my.MyFragment
|
||||
@@ -24,7 +23,6 @@ import com.arpa.hndahesudintocctmsdriver.util.view.PanDuanUtil
|
||||
import com.google.gson.Gson
|
||||
import com.gyf.cactus.ext.cactusUpdateNotification
|
||||
import com.permissionx.guolindev.PermissionX
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
|
||||
@Suppress("DIVISION_BY_ZERO")
|
||||
@SuppressLint("SetTextI18n")
|
||||
@@ -95,7 +93,6 @@ class MainActivity : BaseAppCompatActivity() {
|
||||
bt.hide(fs[bt.index])
|
||||
bt.selectItem(fs[1])
|
||||
} else {
|
||||
EventBus.getDefault().post(WalletEvent("refresh"))
|
||||
bt.setDefaultFragment(fs[1])
|
||||
}
|
||||
bt.index = 1
|
||||
@@ -129,9 +126,9 @@ class MainActivity : BaseAppCompatActivity() {
|
||||
bt.index = 3
|
||||
}
|
||||
}
|
||||
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
// getPression()
|
||||
// }
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
getPression()
|
||||
}
|
||||
}
|
||||
|
||||
fun getPression() {
|
||||
|
||||
@@ -4,7 +4,6 @@ import android.content.Context;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
@@ -39,8 +38,7 @@ public class UiAuxiliary {
|
||||
}
|
||||
|
||||
public static void delLogin(Context con){
|
||||
// JPushInterface.deleteAlias(con,0);
|
||||
SPUtils.remove(con,"curWaybillId");
|
||||
JPushInterface.deleteAlias(con,0);
|
||||
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_TOKEN,"");
|
||||
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_UNAME,"");
|
||||
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_RNAME,"");
|
||||
|
||||
@@ -14,7 +14,6 @@ import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.web.WebOnlyOneActivity;
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.web.WebActivity;
|
||||
@@ -69,7 +68,7 @@ public class AgreementAlert extends CenterPopupView {
|
||||
@Override
|
||||
public void onClick(View widget) {
|
||||
//用户服务协议点击事件
|
||||
Intent in=new Intent(getContext(), WebOnlyOneActivity.class);
|
||||
Intent in=new Intent(getContext(), WebActivity.class);
|
||||
in.putExtra("url",url2);
|
||||
in.putExtra("title","用户服务协议");
|
||||
getContext().startActivity(in);
|
||||
@@ -88,7 +87,7 @@ public class AgreementAlert extends CenterPopupView {
|
||||
@Override
|
||||
public void onClick(View widget) {
|
||||
//用户服务协议点击事件
|
||||
Intent in=new Intent(getContext(), WebOnlyOneActivity.class);
|
||||
Intent in=new Intent(getContext(), WebActivity.class);
|
||||
in.putExtra("url",url);
|
||||
in.putExtra("title","隐私政策");
|
||||
getContext().startActivity(in);
|
||||
|
||||
+11
-35
@@ -20,13 +20,9 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.OCRQualiBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.OCRRequest;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.dahe.mylibrary.utils.ImageLoader;
|
||||
import com.dahe.mylibrary.utils.TimeUtil;
|
||||
import com.esign.esignsdk.EsignSdk;
|
||||
import com.esign.esignsdk.data.AuthEvent;
|
||||
import com.github.gzuliyujiang.wheelpicker.DatePicker;
|
||||
@@ -87,35 +83,13 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
if (CacheGroup.cacheList.get("upload") != null) {
|
||||
ub = gson.fromJson(CacheGroup.cacheList.get("upload"), UploadBean.class);
|
||||
if (ub.getCode() == 200) {
|
||||
if ("0".equals(type)) {//从业资格识别,党员认证不识别
|
||||
new OCRRequest().ORCQualificaZj(con, hd, ub.getData().getUrl());
|
||||
}
|
||||
|
||||
url = ub.getData().getUrl();
|
||||
ImageLoader.getInstance().loadImage(con,url,img);
|
||||
Glide.with(con).load(url).into(img);
|
||||
up_img.setVisibility(View.GONE);
|
||||
img.setVisibility(View.VISIBLE);
|
||||
}
|
||||
CacheGroup.cacheList.remove("upload");
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("ORCQualificaZj") != null) {
|
||||
OCRQualiBean ocrQualiBean = gson.fromJson(CacheGroup.cacheList.get("ORCQualificaZj"), OCRQualiBean.class);
|
||||
if (ocrQualiBean.getCode() == 200 && ocrQualiBean.getData() != null) {
|
||||
List<OCRQualiBean.DataDTO.QualificationCategoryListDTO> qualificationCategoryList = ocrQualiBean.getData().getQualification_category_list();
|
||||
if (qualificationCategoryList != null && qualificationCategoryList.size() > 0) {
|
||||
String expiryDate = qualificationCategoryList.get(0).getExpiry_date();
|
||||
if (!TextUtils.isEmpty(expiryDate)&&expiryDate.contains("-")){
|
||||
value2.setText(expiryDate);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove("ORCQualificaZj");
|
||||
}
|
||||
|
||||
|
||||
if (CacheGroup.cacheList.get("isAuthDriverAuthQualification") != null) {
|
||||
Log.e("is", CacheGroup.cacheList.get("isAuthDriverAuthQualification"));
|
||||
ib = gson.fromJson(CacheGroup.cacheList.get("isAuthDriverAuthQualification"), IsAuthDriverAuthQualificationBean.class);
|
||||
@@ -144,20 +118,21 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
}, 3000);
|
||||
}
|
||||
} else {
|
||||
if (isOverCar) {//从业资格证=》道路运输许可证
|
||||
finish();
|
||||
if (isOverCar){//从业资格证=》道路运输许可证
|
||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
in.putExtra("carId", carId);
|
||||
startActivity(in);
|
||||
} else {//资料传完 补传情况
|
||||
}else{//资料传完 补传情况
|
||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
con.startActivity(in);
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Toast.makeText(con, "资格证上传成功", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
@@ -230,7 +205,7 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
data_view = findViewById(R.id.data_view);
|
||||
type = getIntent().getExtras().getString("type");
|
||||
carId = getIntent().getExtras().getString("carId", "");
|
||||
isOverCar = getIntent().getExtras().getBoolean("isOverCar", false);
|
||||
isOverCar = getIntent().getExtras().getBoolean("isOverCar",false);
|
||||
ur = new UserRequset(con, hd);
|
||||
initView(null);
|
||||
if ("0".equals(type)) {
|
||||
@@ -242,9 +217,9 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
//new RZRequest().isDriverAuthQualification(con,hd);
|
||||
}
|
||||
if (TextUtils.isEmpty(carId)) {//carId不为空 从添加车辆进入 该操作不能跳过
|
||||
if (TextUtils.isEmpty(carId)){//carId不为空 从添加车辆进入 该操作不能跳过
|
||||
tvSkip.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
}else{
|
||||
tvSkip.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
@@ -325,6 +300,7 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
tvSkip.setOnClickListener(v -> {
|
||||
|
||||
|
||||
|
||||
if (type.equals("0")) {
|
||||
// finish();
|
||||
if (key) {
|
||||
@@ -372,13 +348,13 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
value2.setText(ib.getData().getQualificationCertificateValidity());
|
||||
up_img.setVisibility(View.GONE);
|
||||
img.setVisibility(View.VISIBLE);
|
||||
ImageLoader.getInstance().loadImage(con,url,img);
|
||||
Glide.with(con).load(url).into(img);
|
||||
upload_img.setText("已上传");
|
||||
} else {
|
||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||
isAuth = true;
|
||||
url = userBean.getData().getPartyMemberUrl();
|
||||
ImageLoader.getInstance().loadImage(con,url,img);
|
||||
Glide.with(con).load(url).into(img);
|
||||
up_img.setVisibility(View.GONE);
|
||||
img.setVisibility(View.VISIBLE);
|
||||
upload_img.setText("已上传");
|
||||
|
||||
+157
-606
File diff suppressed because it is too large
Load Diff
@@ -1,62 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.auth;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.PersonEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
import com.dahe.mylibrary.utils.ActivityUtils;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
/**
|
||||
* @ClassName FaceSuccActivity
|
||||
* @Author john
|
||||
* @Date 2024/12/2 10:27
|
||||
* @Description TODO
|
||||
*/
|
||||
public class FaceSuccActivity extends BaseAppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
StateStyleUtil.stateTextColor(this);
|
||||
setContentView(R.layout.activity_face_succ_result);
|
||||
con = this;
|
||||
initView(null);
|
||||
Button btnHome = findViewById(R.id.btnHome);
|
||||
Button btnAddCar = findViewById(R.id.btnAddCar);
|
||||
boolean isGoCar = getIntent().getBooleanExtra("isGoCar", false);
|
||||
if (isGoCar) {
|
||||
btnHome.setText("返回首页");
|
||||
btnAddCar.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
btnHome.setText("返回");
|
||||
btnAddCar.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
btnHome.setOnClickListener(v -> {
|
||||
finish();
|
||||
});
|
||||
btnAddCar.setOnClickListener(v -> {
|
||||
Intent in = new Intent(con, CertificatesActivity.class);
|
||||
in.putExtra("index", 2);
|
||||
startActivity(in);
|
||||
finish();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
EventBus.getDefault().post(new PersonEvent("刷脸成功"));
|
||||
}
|
||||
}
|
||||
+19
-72
@@ -1,14 +1,9 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.auth;
|
||||
|
||||
import static com.sdk.base.framework.utils.app.AppUtils.getPackageName;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.widget.ImageView;
|
||||
@@ -21,15 +16,9 @@ import androidx.annotation.Nullable;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.arpa.hndahesudintocctmsdriver.H5Activity;
|
||||
import com.arpa.hndahesudintocctmsdriver.H5Activity2;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.PersonEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.business.BusinessActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.PermissionUtils;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.dahe.mylibrary.utils.ActivityUtils;
|
||||
import com.dahe.mylibrary.utils.ImageLoader;
|
||||
import com.esign.esignsdk.EsignSdk;
|
||||
import com.esign.esignsdk.data.AuthEvent;
|
||||
import com.google.gson.Gson;
|
||||
@@ -53,7 +42,6 @@ import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||
import com.permissionx.guolindev.PermissionX;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@@ -77,15 +65,15 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
||||
super.msgMethod(m);
|
||||
switch (m.what) {
|
||||
case RequsetCodeConstants.SUCCESS:
|
||||
if (CacheGroup.cacheList.get("userdata2") != null) {
|
||||
ub = gson.fromJson(CacheGroup.cacheList.get("userdata2"), UserBean.class);
|
||||
if (CacheGroup.cacheList.get("userdata") != null) {
|
||||
ub = gson.fromJson(CacheGroup.cacheList.get("userdata"), UserBean.class);
|
||||
if (ub.getCode() == 200) {
|
||||
initView(ub);
|
||||
SPUtil.insSP(con, "data", "userdata", CacheGroup.cacheList.get("userdata2"));
|
||||
SPUtil.insSP(con, "data", "userdata", CacheGroup.cacheList.get("userdata"));
|
||||
} else {
|
||||
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove("userdata2");
|
||||
CacheGroup.cacheList.remove("userdata");
|
||||
}
|
||||
if (CacheGroup.cacheList.get("upload") != null) {
|
||||
upb = gson.fromJson(CacheGroup.cacheList.get("upload"), UploadBean.class);
|
||||
@@ -110,18 +98,11 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("authUrl"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
|
||||
Intent intent = new Intent(this, H5Activity.class);
|
||||
intent.putExtra("url", (String) bb.getData());
|
||||
intent.putExtra("view_file", false);
|
||||
// intent.putExtra("isGoCar", true);
|
||||
startActivity(intent);
|
||||
|
||||
// Bundle t = new Bundle();
|
||||
// t.putString("url",(String) bb.getData());
|
||||
// t.putBoolean("view_file", false);
|
||||
// ActivityUtils.startActivity(con, H5Activity2.class,t);
|
||||
|
||||
// EsignSdk.getInstance().startH5Activity(act, StringUtil.isNull(String.valueOf(bb.getData()), ""));
|
||||
// Intent intent = new Intent(this, H5Activity.class);
|
||||
// intent.putExtra("url", (String) bb.getData());
|
||||
// intent.putExtra("view_file", false);
|
||||
// startActivity(intent);
|
||||
EsignSdk.getInstance().startH5Activity(act, StringUtil.isNull(String.valueOf(bb.getData()), ""));
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_LONG).show();
|
||||
}//Log.e("url",CacheGroup.cacheList.get("authUrl"));
|
||||
@@ -187,45 +168,18 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
||||
// startActivityForResult(in, 12);
|
||||
//EsignSdk.getInstance().startH5Activity(act,"https://smlh5.esign.cn/usercenterFront/oemAuth/v3/realName/index?contextKey=b7b103b15b866ec4c72beef1dfe20828&appId=7438873235");
|
||||
if (key) {
|
||||
PermissionX.init(this)
|
||||
.permissions(Manifest.permission.CAMERA)
|
||||
.request((allGranted, grantedList, deniedList) -> {
|
||||
if(allGranted) {
|
||||
key = false;
|
||||
new AuthRequest().getAuthUrl(con, hd);
|
||||
new Handler().postDelayed(() -> {
|
||||
key = true;
|
||||
}, 3000);
|
||||
} else{
|
||||
new MessageUtils().showSimCenPop(con, "缺少相机权限,将无法为您提供服务,去开启!", "取消", "确认", () -> {
|
||||
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
startActivity(intent);
|
||||
});
|
||||
}
|
||||
});
|
||||
// EsignSdk.getInstance().startH5Activity(act, "");
|
||||
|
||||
key = false;
|
||||
new AuthRequest().getAuthUrl(con, hd);
|
||||
new Handler().postDelayed(() -> {
|
||||
key = true;
|
||||
}, 3000);
|
||||
}
|
||||
});
|
||||
//头像
|
||||
up_img.setOnClickListener(v -> {
|
||||
PermissionUtils.Companion.getInstance().showPermissionMessage(this, "拍摄,媒体查询权限使用说明", "用于拍照或者选择图片用于上传头像功能",
|
||||
new String[]{Manifest.permission.READ_EXTERNAL_STORAGE,Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.CAMERA},
|
||||
(allGranted, grantedList, deniedList) -> {
|
||||
if (allGranted) {
|
||||
gia.showPopueWindow(this);
|
||||
} else {
|
||||
new MessageUtils().showSimCenPop(con, "缺少拍摄,媒体查询权限,将无法为您提供服务,去开启!", "取消", "确认", () -> {
|
||||
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
startActivity(intent);
|
||||
});
|
||||
// Toast.makeText(act.getBaseContext(), "请先开启定位权限", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
|
||||
gia.showPopueWindow(this);
|
||||
});
|
||||
up_head.setOnClickListener(v -> {
|
||||
if (ub.getData().getHeadportraitUrl() != null && !ub.getData().getHeadportraitUrl().equals("")) {
|
||||
@@ -239,15 +193,10 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
||||
});
|
||||
hyr = new HuoYuanRequset(con, hd);
|
||||
ur = new UserRequset(con, hd);
|
||||
ur.User();
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
ur.User2();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
@@ -263,7 +212,7 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
||||
TextView name = findViewById(R.id.rname);
|
||||
name.setText(StringUtil.isNull(ub.getData().getRname(), "未实名"));
|
||||
if (ub.getData().getHeadportraitUrl() != null && !ub.getData().getHeadportraitUrl().equals("")) {
|
||||
ImageLoader.getInstance().loadImage(con,ub.getData().getHeadportraitUrl(),up_head);
|
||||
Glide.with(con).load(ub.getData().getHeadportraitUrl()).into(up_head);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,7 +220,7 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
||||
public void personResult(PersonEvent home) {
|
||||
Log.e("-res-", home.getMessage());
|
||||
if (ur != null) {
|
||||
ur.User2();
|
||||
ur.User();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -327,8 +276,6 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
||||
Toast.makeText(con, "签署场景成功", Toast.LENGTH_SHORT).show();
|
||||
} else if ("realName".equalsIgnoreCase(jsonObject.getString("key"))) {
|
||||
Toast.makeText(con, "实名认证成功", Toast.LENGTH_SHORT).show();
|
||||
EsignSdk.getInstance().finishH5Activity();
|
||||
finish();
|
||||
} else {
|
||||
Toast.makeText(con, "意愿认证成功", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.arpa.hndahesudintocctmsdriver.ui.auth;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.text.InputType;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
@@ -21,14 +20,10 @@ import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.CarDelBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.IsAuthDriverAuthQualificationBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.OCRBankBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.OCRRoadBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.UploadBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.AuthRequest;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.OCRRequest;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.UserRequset;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.my.WoDeFragment;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.wallet.WalletFragment;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.file.ImageFileCompressUtil;
|
||||
@@ -36,8 +31,7 @@ import com.arpa.hndahesudintocctmsdriver.util.img.GetImageAlert;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||
import com.dahe.mylibrary.utils.ImageLoader;
|
||||
import com.dahe.mylibrary.utils.PatternUtils;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.github.gzuliyujiang.wheelpicker.DatePicker;
|
||||
import com.github.gzuliyujiang.wheelpicker.annotation.DateMode;
|
||||
import com.google.gson.Gson;
|
||||
@@ -104,23 +98,6 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
}
|
||||
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("ORCRoadLicZj") != null) {
|
||||
if (customDialog != null && customDialog.isShowing())
|
||||
customDialog.dismiss();
|
||||
OCRRoadBean ib = new Gson().fromJson(CacheGroup.cacheList.get("ORCRoadLicZj"), OCRRoadBean.class);
|
||||
if (ib.getCode() == 200 && ib.getData() != null&&!TextUtils.isEmpty(ib.getData().getLicenseNumber())) {
|
||||
value1.setText(PatternUtils.getNumByStr(ib.getData().getLicenseNumber()));
|
||||
} else {
|
||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove("ORCRoadLicZj");
|
||||
}
|
||||
|
||||
|
||||
if (CacheGroup.cacheList.get("upload") != null) {
|
||||
@@ -136,31 +113,22 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
new AuthRequest().saveCarImg(con, hd, carId, ub.getData().getId(), 5);
|
||||
break;
|
||||
case 3:
|
||||
//道路运输证ocr识别
|
||||
new OCRRequest().ORCRoadLicZj(con, hd, ub.getData().getUrl());
|
||||
new AuthRequest().saveCarImg(con, hd, carId, ub.getData().getId(), 2);
|
||||
break;
|
||||
case 4:
|
||||
new AuthRequest().saveCarImg(con, hd, carId, ub.getData().getId(), 7);
|
||||
break;
|
||||
default:
|
||||
if (customDialog != null && customDialog.isShowing())
|
||||
customDialog.dismiss();
|
||||
break;
|
||||
}
|
||||
url = ub.getData().getUrl();
|
||||
// Glide.with(con).load(url).into(img);
|
||||
ImageLoader.getInstance().loadImage(con,path,img);
|
||||
|
||||
Glide.with(con).load(path).into(img);
|
||||
|
||||
if (customDialog != null && customDialog.isShowing())
|
||||
customDialog.dismiss();
|
||||
CacheGroup.cacheList.remove("upload");
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("saveCarImg") != null) {
|
||||
if (type!=3){
|
||||
if (customDialog != null && customDialog.isShowing())
|
||||
customDialog.dismiss();
|
||||
}
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("saveCarImg"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
switch (type) {
|
||||
@@ -174,8 +142,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
Toast.makeText(con, "上传车辆登记证书照片", Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
case 3:
|
||||
ur.vehicleDelTwo(carId);
|
||||
// Toast.makeText(con, "上传道路运输证成功", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(con, "上传道路运输证成功", Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
case 4:
|
||||
Toast.makeText(con, "交强险证件上传成功", Toast.LENGTH_SHORT).show();
|
||||
@@ -190,11 +157,11 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
Log.e("is", CacheGroup.cacheList.get("saveCarRegisterNo"));
|
||||
IsAuthDriverAuthQualificationBean ib = gson.fromJson(CacheGroup.cacheList.get("saveCarRegisterNo"), IsAuthDriverAuthQualificationBean.class);
|
||||
if (ib.getCode() == 200) {
|
||||
finish();
|
||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
in.putExtra("carId", carId);
|
||||
con.startActivity(in);
|
||||
finish();
|
||||
} else {
|
||||
Toast.makeText(con, ib.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@@ -208,11 +175,12 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
//判断是否需要跳转挂车行驶证页面
|
||||
if (!"".equals(carId) && cdb.getData() != null) {
|
||||
if (cdb.getData().getIsTrailer() == 1 && cdb.getData().getTrailerResVo() != null && !TextUtils.isEmpty(cdb.getData().getTrailerResVo().getCarNumber())) {//需要挂车,并且传过挂车直接结束
|
||||
finish();
|
||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
con.startActivity(in);
|
||||
finish();
|
||||
} else if (cdb.getData().getIsTrailer() == 1 && cdb.getData().getTrailerResVo() != null && TextUtils.isEmpty(cdb.getData().getTrailerResVo().getCarNumber())) {//需要挂车,没传过挂车,到挂车页面
|
||||
finish();
|
||||
Intent in = new Intent(con, CertificatesActivity.class);
|
||||
in.putExtra("index", 3);
|
||||
in.putExtra("carId", carId);
|
||||
@@ -220,7 +188,6 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
in.putExtra("cheData", new Gson().toJson(cdb));
|
||||
}
|
||||
startActivity(in);
|
||||
finish();
|
||||
} else if (cdb.getData().getIsTrailer() == 0) {//不需要挂车
|
||||
if ("1".equals(cdb.getData().getNeedUpQCPhoto())) {//需要从业资格证
|
||||
Intent in = new Intent(con, AuthQualificationActivity.class);
|
||||
@@ -229,10 +196,10 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
in.putExtra("isOverCar", false);
|
||||
startActivity(in);
|
||||
} else {
|
||||
finish();
|
||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
con.startActivity(in);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -393,7 +360,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
* 展示大图片
|
||||
*/
|
||||
private void showBigImg() {
|
||||
if ((type == 3 && TextUtils.isEmpty(cdb.getData().getRoadLicensePhoto())) || (type == 4 && TextUtils.isEmpty(cdb.getData().getPolicyPhotoUrl()))) {
|
||||
if ((type == 0 && TextUtils.isEmpty(cdb.getData().getRoadLicensePhoto())) || (type == 4 && TextUtils.isEmpty(cdb.getData().getPolicyPhotoUrl()))) {
|
||||
choicePhoto();
|
||||
return;
|
||||
}
|
||||
@@ -438,8 +405,8 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
// .asImageViewer(img, cdb.getData().getRoadLicensePhoto(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if (cdb.getData().getPolicyPhotoUrl() != null && !"".equals(cdb.getData().getPolicyPhotoUrl())) {
|
||||
@@ -451,8 +418,8 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
// .asImageViewer(img, cdb.getData().getRoadLicensePhoto(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -521,26 +488,26 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
if (null != cdb) {
|
||||
if (0 == type) {
|
||||
if (!TextUtils.isEmpty(cdb.getData().getCarImage())) {
|
||||
ImageLoader.getInstance().loadImage(con,cdb.getData().getCarImage(),img);
|
||||
Glide.with(con).load(cdb.getData().getCarImage()).into(img);
|
||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||
upload_img.setText("已上传");
|
||||
}
|
||||
} else if (1 == type) {
|
||||
if (!TextUtils.isEmpty(cdb.getData().getNfcImage())) {
|
||||
ImageLoader.getInstance().loadImage(con,cdb.getData().getNfcImage(),img);
|
||||
Glide.with(con).load(cdb.getData().getNfcImage()).into(img);
|
||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||
upload_img.setText("已上传");
|
||||
}
|
||||
} else if (2 == type) {
|
||||
if (!TextUtils.isEmpty(cdb.getData().getRegisterImage())) {
|
||||
ImageLoader.getInstance().loadImage(con,cdb.getData().getRegisterImage(),img);
|
||||
Glide.with(con).load(cdb.getData().getRegisterImage()).into(img);
|
||||
value1.setText(cdb.getData().getRegisterNo());
|
||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||
upload_img.setText("已上传");
|
||||
}
|
||||
} else if (3 == type) {
|
||||
if (!TextUtils.isEmpty(cdb.getData().getRoadLicensePhoto())) {
|
||||
ImageLoader.getInstance().loadImage(con,cdb.getData().getRoadLicensePhoto(),img);
|
||||
Glide.with(con).load(cdb.getData().getRoadLicensePhoto()).into(img);
|
||||
value1.setText(cdb.getData().getRoadLicense());
|
||||
if (!carExist) {
|
||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||
@@ -550,7 +517,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
}
|
||||
} else if (4 == type) {
|
||||
if (!TextUtils.isEmpty(cdb.getData().getPolicyPhotoUrl())) {
|
||||
ImageLoader.getInstance().loadImage(con,cdb.getData().getPolicyPhotoUrl(),img);
|
||||
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);
|
||||
@@ -639,11 +606,8 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
tvSkip.setVisibility(isShowSkip[type] ? View.GONE : View.VISIBLE);
|
||||
llInfo.setVisibility(isShowEdit[type] ? View.VISIBLE : View.GONE);
|
||||
if (type == 4) {
|
||||
value1.setInputType(InputType.TYPE_CLASS_TEXT);
|
||||
llDate.setVisibility(View.VISIBLE);
|
||||
title3.setText("保险公司");
|
||||
}else {
|
||||
value1.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,6 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
|
||||
public String carId="";
|
||||
public static final String DEL_CAR="delete_che";
|
||||
public static final String CAR_AUDIO="CAR_AUDIO";
|
||||
public static final String APP_INFO="APP_INFO";
|
||||
private int submitIndex=0;
|
||||
private BaseBean bb;
|
||||
private ImageView show_img;
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.home;
|
||||
|
||||
import static com.sdk.base.framework.utils.app.AppUtils.getPackageName;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Outline;
|
||||
import android.location.Location;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
@@ -28,7 +23,6 @@ import android.widget.Toast;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.cardview.widget.CardView;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.alct.mdp.MDPLocationCollectionManager;
|
||||
import com.alct.mdp.callback.OnDownloadResultListener;
|
||||
@@ -42,35 +36,22 @@ import com.amap.api.maps.model.LatLng;
|
||||
import com.amap.api.maps.model.Marker;
|
||||
import com.amap.api.maps.model.MarkerOptions;
|
||||
import com.amap.api.maps.model.MyLocationStyle;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.BankCardListBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.DriverExpireBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.ImageConfig;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.JTT;
|
||||
import com.arpa.hndahesudintocctmsdriver.constant.JTTConstant;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeWaybillEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.StartOrderParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.WalletRequest;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivityBC;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.news.NewActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.wallet.UpBankActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.web.WebOnlyOneActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.OneDayShowUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.PermissionUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.dahe.mylibrary.utils.TimeUtil;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.gyf.cactus.Cactus;
|
||||
import com.hjq.xtoast.XToast;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.core.BasePopupView;
|
||||
import com.lxj.xpopup.interfaces.OnConfirmListener;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.ALProcess;
|
||||
@@ -104,7 +85,6 @@ import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.time.Timer;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseFragment;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||
import com.lxj.xpopup.interfaces.SimpleCallback;
|
||||
import com.permissionx.guolindev.PermissionX;
|
||||
import com.youth.banner.Banner;
|
||||
import com.youth.banner.BannerConfig;
|
||||
@@ -115,11 +95,8 @@ import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import pub.devrel.easypermissions.EasyPermissions;
|
||||
|
||||
/**
|
||||
* @author hlh
|
||||
* @version 1.0.0
|
||||
@@ -140,11 +117,7 @@ public class HomeFragment extends BaseFragment {
|
||||
private HuoYuanListBean hb;
|
||||
private Gson gson = new Gson();
|
||||
private CardView btn_news, btn_loadin, btn_update;
|
||||
private LinearLayout order_all, llCurWay;
|
||||
|
||||
private TextView tvWaybill, tvGo, tvZX;
|
||||
|
||||
private ImageView ivType;
|
||||
private LinearLayout order_all;
|
||||
private HuoYuanListBean uab;
|
||||
private List<Marker> list = new ArrayList<>();
|
||||
private HuoYuanListDealBean hdb;
|
||||
@@ -153,10 +126,6 @@ public class HomeFragment extends BaseFragment {
|
||||
private ImageConfig ic;
|
||||
private DriverExpireBean deb;
|
||||
|
||||
private XToast xToast;
|
||||
|
||||
private boolean isUpAppShow = false;
|
||||
|
||||
|
||||
@Override
|
||||
public void msgMethod(Message m) {
|
||||
@@ -170,23 +139,6 @@ public class HomeFragment extends BaseFragment {
|
||||
refreshLayout.finishRefresh(500);
|
||||
keys = false;
|
||||
}
|
||||
|
||||
//银行卡信息接收
|
||||
if (CacheGroup.cacheList.get(dataName2) != null) {
|
||||
BankCardListBean bcb = new Gson().fromJson(CacheGroup.cacheList.get(dataName2), BankCardListBean.class);
|
||||
if (bcb.getCode() == 200) {
|
||||
if (bcb.getData() == null || bcb.getData().getRecords() == null || bcb.getData().getRecords().size() < 1) {
|
||||
new MessageUtils().showSimCenPop(con, "缺少银行卡可能会导致运费无法结算,是否去添加!", "取消", "确认", () -> {
|
||||
Intent in333 = new Intent(con, UpBankActivity.class);
|
||||
startActivity(in333);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(con, bcb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove(dataName2);
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("userdata") != null) {
|
||||
ub = gson.fromJson(CacheGroup.cacheList.get("userdata"), UserBean.class);
|
||||
if (ub.getCode() == 200) {
|
||||
@@ -194,13 +146,13 @@ public class HomeFragment extends BaseFragment {
|
||||
MsgUtil.addHdMsgWat(hd, 33);
|
||||
|
||||
//新用户注册,需弹窗提示注册
|
||||
// if ("0".equals(ub.getData().getRealAuthentication())) {
|
||||
// new MessageUtils().showSimCenPop(con, "该司机还未认证,未认证无法接单。是否去注册!", () -> {
|
||||
// Intent in = new Intent(con, CertificatesActivity.class);
|
||||
// in.putExtra("index", 0);
|
||||
// startActivity(in);
|
||||
// });
|
||||
// }
|
||||
if ("0".equals(ub.getData().getRealAuthentication())) {
|
||||
new MessageUtils().showSimCenPop(con, "该司机还未认证,未认证无法接单。是否去注册!", () -> {
|
||||
Intent in = new Intent(con, CertificatesActivity.class);
|
||||
in.putExtra("index", 0);
|
||||
startActivity(in);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@@ -213,24 +165,8 @@ public class HomeFragment extends BaseFragment {
|
||||
SPUtil.insSP(con, JTTConstant.JTT_DATA_NAME, JTTConstant.JTT_DATA_ORDER_KEY, gson.toJson(sob));
|
||||
initStart();
|
||||
StartOrderParts.setStartOrder(con, sob);
|
||||
if (sob.getData() != null && !sob.getData().getWaybillStatus().equals("已取消")) {
|
||||
StartOrderBean.DataDTO.WayChildrenDTO xData = null;
|
||||
for (int i = 0; i < sob.getData().getWayChildren().size(); i++) {
|
||||
if (2 == sob.getData().getWayChildren().get(i).getType()) {
|
||||
xData = sob.getData().getWayChildren().get(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (xData != null && xData.getStatus() == 3) {
|
||||
SPUtils.remove(con, "curWaybillId");
|
||||
llCurWay.setVisibility(View.GONE);
|
||||
} else {
|
||||
dealCurWay(sob.getData());
|
||||
ur.getJtts(sob.getData().getShippingNoteNumber());
|
||||
}
|
||||
} else {
|
||||
SPUtils.remove(con, "curWaybillId");
|
||||
llCurWay.setVisibility(View.GONE);
|
||||
if (sob.getData() != null) {
|
||||
ur.getJtts(sob.getData().getShippingNoteNumber());
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(con, sob.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
@@ -245,19 +181,6 @@ public class HomeFragment extends BaseFragment {
|
||||
new XPopup.Builder(con)
|
||||
.dismissOnBackPressed(false)
|
||||
.dismissOnTouchOutside(false)
|
||||
.setPopupCallback(new SimpleCallback() {
|
||||
@Override
|
||||
public void onShow(BasePopupView popupView) {
|
||||
super.onShow(popupView);
|
||||
isUpAppShow = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(BasePopupView popupView) {
|
||||
super.onDismiss(popupView);
|
||||
isUpAppShow = false;
|
||||
}
|
||||
})
|
||||
.asCustom(new UpAppAlert(con, uab.getData().getDownloadUrl(), uab.getData().getContent(), uab.getData().getVersion(), uab.getData().getForce()))
|
||||
.show();
|
||||
}
|
||||
@@ -277,40 +200,6 @@ public class HomeFragment extends BaseFragment {
|
||||
if (CacheGroup.cacheList.get(WoDeFragment.AUTH_DATA) != null) {
|
||||
DriverAuthDataBean dad = gson.fromJson(CacheGroup.cacheList.get(WoDeFragment.AUTH_DATA), DriverAuthDataBean.class);
|
||||
if (dad.getCode() == 200) {
|
||||
if (isUpAppShow) {
|
||||
CacheGroup.cacheList.remove(WoDeFragment.AUTH_DATA);
|
||||
return;
|
||||
}
|
||||
|
||||
if (dad.getData() == null) {
|
||||
new MessageUtils().showSimCenPop(con, "该司机缺少身份证,未认证无法接单。是否去添加!", "去添加", () -> {
|
||||
Intent in = new Intent(con, CertificatesActivity.class);
|
||||
in.putExtra("index", 0);
|
||||
startActivity(in);
|
||||
});
|
||||
CacheGroup.cacheList.remove(WoDeFragment.AUTH_DATA);
|
||||
return;
|
||||
}
|
||||
if (dad.getData() != null && TextUtils.isEmpty(dad.getData().getIdcard())) {
|
||||
new MessageUtils().showSimCenPop(con, "该司机缺少身份证,未认证无法接单。是否去添加!", "去添加", () -> {
|
||||
Intent in = new Intent(con, CertificatesActivity.class);
|
||||
in.putExtra("index", 0);
|
||||
startActivity(in);
|
||||
});
|
||||
} else if (dad.getData() != null && TextUtils.isEmpty(dad.getData().getCardNo())) {
|
||||
new MessageUtils().showSimCenPop(con, "该司机缺少银行卡,未认证无法接单。是否去添加!", "去添加", () -> {
|
||||
Intent in333 = new Intent(con, UpBankActivity.class);
|
||||
in333.putExtra("type", 1);
|
||||
startActivity(in333);
|
||||
});
|
||||
} else if (dad.getData() != null && TextUtils.isEmpty(dad.getData().getDriverLicense())) {
|
||||
new MessageUtils().showSimCenPop(con, "该司机缺少驾驶证,未认证无法接单。是否去添加!", "去添加", () -> {
|
||||
Intent in = new Intent(con, CertificatesActivity.class);
|
||||
in.putExtra("index", 0);
|
||||
startActivity(in);
|
||||
});
|
||||
}
|
||||
|
||||
SPUtil.insSP(con, "data", "authdata", CacheGroup.cacheList.get(WoDeFragment.AUTH_DATA));
|
||||
if (dad.getData() != null && 100003 == dad.getData().getAuditStatus()) {
|
||||
initAlct();
|
||||
@@ -352,15 +241,11 @@ public class HomeFragment extends BaseFragment {
|
||||
in.putExtra("url", deb.getData().getIdCardUpdateUrl());
|
||||
}
|
||||
}
|
||||
if (!TextUtils.isEmpty(deb.getData().getDriverLicenseUpdateUrl()) || !TextUtils.isEmpty(deb.getData().getIdCardUpdateUrl()) ||
|
||||
!TextUtils.isEmpty(deb.getData().getQualificationUpdateUrl()) || !TextUtils.isEmpty(deb.getData().getRoadLicenseUpdateUrl()) ||
|
||||
if (!TextUtils.isEmpty(deb.getData().getDriverLicenseUpdateUrl()) || !TextUtils.isEmpty(deb.getData().getIdCardUpdateUrl())||
|
||||
!TextUtils.isEmpty(deb.getData().getQualificationUpdateUrl())||!TextUtils.isEmpty(deb.getData().getRoadLicenseUpdateUrl())||
|
||||
!TextUtils.isEmpty(deb.getData().getInsuranceUpdateUrl())) {
|
||||
if (xToast == null) {
|
||||
xToast = new XToast(act);
|
||||
} else if (xToast != null && xToast.isShow()) {
|
||||
xToast.cancel();
|
||||
}
|
||||
xToast.setContentView(R.layout.view_bc)
|
||||
new XToast<>(act)
|
||||
.setContentView(R.layout.view_bc)
|
||||
// 设置成可拖拽的
|
||||
.setDraggable()
|
||||
// 设置显示时长
|
||||
@@ -375,22 +260,6 @@ public class HomeFragment extends BaseFragment {
|
||||
// 设置窗口背景阴影强度
|
||||
//.setBackgroundDimAmount(0.5f)
|
||||
.showAsDropDown(home_top, Gravity.BOTTOM, 1200, 1000);
|
||||
// new XToast<>(act)
|
||||
// .setContentView(R.layout.view_bc)
|
||||
// // 设置成可拖拽的
|
||||
// .setDraggable()
|
||||
// // 设置显示时长
|
||||
// .setDuration(1000 * 60 * 60 * 12)
|
||||
// .setOnClickListener(R.id.img_kf, (toast, view) -> {
|
||||
// toast.startActivity(in);
|
||||
// Log.e("-is-", view.isInTouchMode() + "");
|
||||
// })
|
||||
// // 设置动画样式
|
||||
// //.setAnimStyle(android.R.style.Animation_Translucent)
|
||||
// // 设置外层是否能被触摸
|
||||
// // 设置窗口背景阴影强度
|
||||
// //.setBackgroundDimAmount(0.5f)
|
||||
// .showAsDropDown(home_top, Gravity.BOTTOM, 1200, 1000);
|
||||
}
|
||||
CacheGroup.cacheList.remove("driverExpire");
|
||||
}
|
||||
@@ -451,8 +320,8 @@ public class HomeFragment extends BaseFragment {
|
||||
EventBus.getDefault().register(this);
|
||||
hyr = new HuoYuanRequset(con, hd);
|
||||
ur = new UserRequset(con, hd);
|
||||
initView(null);
|
||||
initRefreshLoad();
|
||||
initView(null);
|
||||
btn_news.setOnClickListener(v -> {
|
||||
|
||||
});
|
||||
@@ -461,7 +330,6 @@ public class HomeFragment extends BaseFragment {
|
||||
});
|
||||
btn_update.setOnClickListener(v -> {
|
||||
getRequest();
|
||||
refreshWaybills();
|
||||
});
|
||||
home_top.setOnClickListener(v -> {
|
||||
if (!UiAuxiliary.isLogin(con)) {
|
||||
@@ -522,7 +390,6 @@ public class HomeFragment extends BaseFragment {
|
||||
Log.e("下拉刷新", "pps");
|
||||
keys = true;
|
||||
getRequest();
|
||||
refreshWaybills();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -560,13 +427,6 @@ public class HomeFragment extends BaseFragment {
|
||||
order_box = v.findViewById(R.id.order_box);
|
||||
auth_box = v.findViewById(R.id.auth_box);
|
||||
order_all = v.findViewById(R.id.order_all);
|
||||
|
||||
llCurWay = v.findViewById(R.id.llCurWay);
|
||||
tvWaybill = v.findViewById(R.id.tvWaybill);
|
||||
tvGo = v.findViewById(R.id.tvGo);
|
||||
tvZX = v.findViewById(R.id.loadingAddress);
|
||||
ivType = v.findViewById(R.id.ivType);
|
||||
|
||||
ImageView fun_left = v.findViewById(R.id.fun_left);
|
||||
ImageView fun_right = v.findViewById(R.id.fun_right);
|
||||
fun_left.setOnClickListener(v16 -> startActivity(new Intent(con, OrderListActivity.class)));
|
||||
@@ -621,35 +481,18 @@ public class HomeFragment extends BaseFragment {
|
||||
v1.setOnClickListener(v2 -> {
|
||||
switch (position) {
|
||||
case 0:
|
||||
PermissionUtils.Companion.getInstance().showPermissionMessage(getActivity(), "位置权限使用说明", "用于向您推荐可能感兴趣的住宿、饮食、加油站、汽车维修等",
|
||||
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
|
||||
(allGranted, grantedList, deniedList) -> {
|
||||
//startActivity(new Intent(con, OrderListActivity.class));
|
||||
PermissionX.init(getActivity())
|
||||
.permissions(Manifest.permission.ACCESS_FINE_LOCATION)
|
||||
.request((allGranted, grantedList, deniedList) -> {
|
||||
if (allGranted) {
|
||||
Intent in = new Intent(con, BusinessActivity.class);
|
||||
in.putExtra("type", "餐饮");
|
||||
startActivity(in);
|
||||
} else {
|
||||
new MessageUtils().showSimCenPop(con, "缺少定位权限,将无法为您提供服务,去开启!", "取消", "确认", () -> {
|
||||
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
startActivity(intent);
|
||||
});
|
||||
// Toast.makeText(act.getBaseContext(), "请先开启定位权限", Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(act.getBaseContext(), "请先开启定位权限", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
//startActivity(new Intent(con, OrderListActivity.class));
|
||||
// PermissionX.init(getActivity())
|
||||
// .permissions(Manifest.permission.ACCESS_FINE_LOCATION)
|
||||
// .request((allGranted, grantedList, deniedList) -> {
|
||||
// if (allGranted) {
|
||||
// Intent in = new Intent(con, BusinessActivity.class);
|
||||
// in.putExtra("type", "餐饮");
|
||||
// startActivity(in);
|
||||
// } else {
|
||||
// Toast.makeText(act.getBaseContext(), "请先开启定位权限", Toast.LENGTH_LONG).show();
|
||||
// }
|
||||
// });
|
||||
//Toast.makeText(con,"定位开启失败,请检查配置项",Toast.LENGTH_LONG).show();
|
||||
break;
|
||||
case 1:
|
||||
@@ -673,11 +516,6 @@ public class HomeFragment extends BaseFragment {
|
||||
in5.putExtra("url", "https://ks.wjx.top/vm/h6Jqu8A.aspx");
|
||||
in5.putExtra("title", "知识竞猜");
|
||||
startActivity(in5);
|
||||
|
||||
// Intent in = new Intent(getContext(), WebActivity.class);
|
||||
// in.putExtra("url", "http://192.168.1.152:8080");
|
||||
// in.putExtra("title", "隐私政策");
|
||||
// getContext().startActivity(in);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -688,110 +526,11 @@ public class HomeFragment extends BaseFragment {
|
||||
initMap();
|
||||
}
|
||||
|
||||
|
||||
StartOrderBean.DataDTO.WayChildrenDTO zData = new StartOrderBean.DataDTO.WayChildrenDTO();
|
||||
StartOrderBean.DataDTO.WayChildrenDTO xData = new StartOrderBean.DataDTO.WayChildrenDTO();
|
||||
|
||||
/**
|
||||
* 一装一卸逻辑
|
||||
*
|
||||
* @param data
|
||||
*/
|
||||
private void dealCurWay(StartOrderBean.DataDTO data) {
|
||||
SPUtils.put(con, "curWaybillId", data.getWaybillId());
|
||||
|
||||
for (int i = 0; i < data.getWayChildren().size(); i++) {
|
||||
if (1 == data.getWayChildren().get(i).getType()) {
|
||||
zData = data.getWayChildren().get(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < data.getWayChildren().size(); i++) {
|
||||
if (2 == data.getWayChildren().get(i).getType()) {
|
||||
xData = data.getWayChildren().get(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
llCurWay.setVisibility(View.VISIBLE);
|
||||
tvWaybill.setText(data.getShippingNoteNumber());
|
||||
tvGo.setText(getGoText(zData.getStatus(), xData.getStatus()));
|
||||
if (data.getWaybillStatus().equals("待装货")) {
|
||||
tvZX.setText(zData.getAddress());
|
||||
ivType.setBackgroundResource(R.mipmap.zhuang);
|
||||
} else {
|
||||
tvZX.setText(xData.getAddress());
|
||||
ivType.setBackgroundResource(R.mipmap.xie);
|
||||
}
|
||||
|
||||
tvGo.setOnClickListener(v -> {
|
||||
int zStatus = zData.getStatus();
|
||||
int xStatus = xData.getStatus();
|
||||
if (zStatus == 0) {//未装货
|
||||
Intent in = new Intent(con, ShangChuangImgActivityBC.class);
|
||||
in.putExtra("type", 0);
|
||||
in.putExtra("reportAlct", data.getReportAlct());
|
||||
in.putExtra("wid", zData.getId() + "");
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
in.putExtra("keys", true);
|
||||
startActivity(in);
|
||||
} else if (zStatus == 1 && xStatus == 4) {//已装货未上传回单
|
||||
Intent in = new Intent(con, ShangChuangImgActivityBC.class);
|
||||
in.putExtra("type", 2);
|
||||
in.putExtra("reportAlct", data.getReportAlct());
|
||||
in.putExtra("wid", zData.getId() + "");
|
||||
in.putExtra("h_type", 0);
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
startActivity(in);
|
||||
} else if (zStatus == 3 && xStatus == 4) {//已上传装货回单,未卸货
|
||||
int dis = TimeUtil.compareNowDate(TimeUtil.string2Millis(zData.getImageTakenDate(), TimeUtil.DEFAULT_FORMAT4));
|
||||
if (dis > 5) {//大于五分钟可以接单
|
||||
Intent in = new Intent(con, ShangChuangImgActivityBC.class);
|
||||
in.putExtra("type", 1);
|
||||
in.putExtra("reportAlct", data.getReportAlct());
|
||||
in.putExtra("wid", xData.getId() + "");
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
in.putExtra("keys", true);
|
||||
startActivity(in);
|
||||
} else {
|
||||
ToastUtils.showToast(con, "请到卸货地再进行卸货操作!");
|
||||
}
|
||||
|
||||
} else if (zStatus == 3 && xStatus == 2) {//已卸货,未上传卸货回单
|
||||
Intent in = new Intent(con, ShangChuangImgActivityBC.class);
|
||||
in.putExtra("type", 2);
|
||||
in.putExtra("reportAlct", data.getReportAlct());
|
||||
in.putExtra("wid", xData.getId() + "");
|
||||
in.putExtra("h_type", 1);
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
in.putExtra("keys", true);
|
||||
startActivity(in);
|
||||
} else {
|
||||
ToastUtils.showToast(con, "已完成该运单");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private String getGoText(int zStatus, int xStatus) {
|
||||
if (zStatus == 0) {//未装货
|
||||
return "去装货";
|
||||
} else if (zStatus == 1 && xStatus == 4) {//已装货未上传回单
|
||||
return "装货回单";
|
||||
} else if (zStatus == 3 && xStatus == 4) {//已上传装货回单,未卸货
|
||||
return "去卸货";
|
||||
} else if (zStatus == 3 && xStatus == 2) {//已卸货,未上传卸货回单
|
||||
return "卸货回单";
|
||||
}
|
||||
return "已完成";
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void initMap() {
|
||||
getRequest();
|
||||
refreshWaybills();
|
||||
}
|
||||
|
||||
private CustomDialog customDialog;
|
||||
@@ -803,21 +542,15 @@ public class HomeFragment extends BaseFragment {
|
||||
// if((newTime-oldTime)>1000){
|
||||
// customDialog=new CustomDialog(con,"加载中...");
|
||||
// customDialog.show();
|
||||
// ur.upApp();
|
||||
// hyr.getHuoYuan(1, 100);
|
||||
ur.upApp();
|
||||
hyr.getHuoYuan(1, 100);
|
||||
ur.getImage(1);
|
||||
WalletRequest qr = new WalletRequest(con, hd);
|
||||
|
||||
|
||||
if (UiAuxiliary.isLogin(con)) {
|
||||
// int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
||||
ur.User();
|
||||
// if (!OneDayShowUtils.getInstance().todayIsShow(con)) {
|
||||
// qr.getBankCardList();
|
||||
// }
|
||||
ur.getDriverExpire();
|
||||
// hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
||||
// hyr.startOrder(0);
|
||||
//获取权限 应用市场审核不通过
|
||||
hyr.startOrder(0);
|
||||
ur.driverAuthData();
|
||||
}
|
||||
// oldTime= Calendar.getInstance().getTimeInMillis();
|
||||
@@ -876,13 +609,8 @@ public class HomeFragment extends BaseFragment {
|
||||
Log.e("开始轨迹上传服务", "-----");
|
||||
orderNum.setText("运单号:" + sob.getData().getShippingNoteNumber());
|
||||
order_state.setText("" + sob.getData().getWaybillStatus());
|
||||
try {
|
||||
// Intent serviceIn = new Intent(con, TrackService.class);
|
||||
// getActivity().startService(serviceIn);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Intent serviceIn = new Intent(con, TrackService.class);
|
||||
getActivity().startService(serviceIn);
|
||||
} else {
|
||||
SPUtil.insSP(con, "order", "ShippingNoteNumber", "");
|
||||
order_start.setVisibility(View.GONE);
|
||||
@@ -1053,7 +781,7 @@ public class HomeFragment extends BaseFragment {
|
||||
banner.isAutoPlay(true);
|
||||
banner.setIndicatorGravity(BannerConfig.CENTER);
|
||||
banner.setOnBannerListener(position -> {//System.out.println("跳转");
|
||||
Intent in = new Intent(con, WebOnlyOneActivity.class);
|
||||
Intent in = new Intent(con, WebActivity.class);
|
||||
Intent inL = new Intent(con, LoginActivity.class);
|
||||
in.putExtra("url", ic.getData().get(position).getJumpUrl());
|
||||
in.putExtra("title", ic.getData().get(position).getTitle());
|
||||
@@ -1074,7 +802,7 @@ public class HomeFragment extends BaseFragment {
|
||||
@Override
|
||||
public void displayImage(Context context, Object path, ImageView imageView) {
|
||||
if (HomeFragment.this != null && getActivity() != null && !getActivity().isDestroyed()) {
|
||||
com.dahe.mylibrary.utils.ImageLoader.getInstance().loadImage(con,path,imageView);
|
||||
Glide.with(con).load(path).into(imageView);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1172,65 +900,29 @@ public class HomeFragment extends BaseFragment {
|
||||
// }
|
||||
|
||||
public void initAlct() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
// if (!OneDayShowUtils.getInstance().todayIsShowQx(con)){
|
||||
// boolean b = EasyPermissions.hasPermissions(getActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
// Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
// Manifest.permission.ACCESS_FINE_LOCATION,
|
||||
// Manifest.permission.ACCESS_COARSE_LOCATION);
|
||||
// if (b) {
|
||||
// ALProcess.verification(con);
|
||||
// }
|
||||
PermissionX.init(getActivity())
|
||||
.permissions(Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.ACCESS_FINE_LOCATION,
|
||||
Manifest.permission.ACCESS_BACKGROUND_LOCATION,
|
||||
Manifest.permission.CAMERA,
|
||||
Manifest.permission.ACCESS_COARSE_LOCATION)
|
||||
.request((allGranted, grantedList, deniedList) -> {
|
||||
if (allGranted) {
|
||||
ALProcess.verification(con);
|
||||
} else {
|
||||
boolean accessCoarseLocation = deniedList.contains("android.permission.ACCESS_FINE_LOCATION");
|
||||
boolean contains = deniedList.contains("android.permission.WRITE_EXTERNAL_STORAGE");
|
||||
boolean camear = deniedList.contains("android.permission.CAMERA");
|
||||
if (accessCoarseLocation | contains) {
|
||||
new MessageUtils().showSimCenPop(con, "缺少定位权限或媒体和文件权限,会导致无法结算运费,去开启!", "取消", "确认", () -> {
|
||||
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
startActivity(intent);
|
||||
});
|
||||
} else if (camear) {
|
||||
new MessageUtils().showSimCenPop(con, "缺少相机权限,会导致无法实名认证,去开启!", "取消", "确认", () -> {
|
||||
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
startActivity(intent);
|
||||
});
|
||||
}
|
||||
PermissionX.init(getActivity())
|
||||
.permissions(Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.RECORD_AUDIO)
|
||||
.request((allGranted, grantedList, deniedList) -> {
|
||||
if (allGranted) {
|
||||
|
||||
}
|
||||
});
|
||||
// }
|
||||
} else {
|
||||
|
||||
} else {
|
||||
ALProcess.verification(con);
|
||||
}
|
||||
}
|
||||
});
|
||||
ALProcess.verification(con);
|
||||
MDPLocationCollectionManager.getInvoices(con, 10, 1, new OnDownloadResultListener() {
|
||||
@Override
|
||||
public void onSuccess(Object o) {
|
||||
Log.e("--成功信息--", new Gson().toJson(o));
|
||||
}
|
||||
|
||||
// ALProcess.verification(con);
|
||||
// MDPLocationCollectionManager.getInvoices(con, 10, 1, new OnDownloadResultListener() {
|
||||
// @Override
|
||||
// public void onSuccess(Object o) {
|
||||
// Log.e("--成功信息--", new Gson().toJson(o));
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(String s, String s1) {
|
||||
// Log.e("--失败信息--", s + s1);
|
||||
// }
|
||||
// });
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("--失败信息--", s + s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private MyLocationStyle myLocationStyle;//地图定位样式
|
||||
@@ -1306,36 +998,6 @@ public class HomeFragment extends BaseFragment {
|
||||
initView(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
// ToastUtils.showToast(con,"onstart");
|
||||
// refreshLayout.autoRefresh();
|
||||
refreshWaybills();
|
||||
}
|
||||
|
||||
private void refreshWaybills() {
|
||||
hyr.getHuoYuan(1, 100);
|
||||
if (UiAuxiliary.isLogin(con)) {
|
||||
int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
||||
hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void processResult(HomeWaybillEvent home) {
|
||||
// if (home.getMessage() == 1) {
|
||||
// int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
||||
// hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
||||
// hyr.getHuoYuan(1, 100);
|
||||
// } else {
|
||||
// int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
||||
// hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
class Model {
|
||||
|
||||
private int imageId;
|
||||
|
||||
@@ -231,8 +231,8 @@ public class HuoYuanFragmengt extends BaseFragment {
|
||||
if(sob!=null && sob.getData()!=null && sob.getData().getWayChildren().size()>0){
|
||||
SPUtil.insSP(con,"order","ShippingNoteNumber",sob.getData().getShippingNoteNumber());
|
||||
Log.e("开始轨迹上传服务","-----");
|
||||
// Intent serviceIn=new Intent(con,TrackService.class);
|
||||
// getActivity().startService(serviceIn);
|
||||
Intent serviceIn=new Intent(con,TrackService.class);
|
||||
getActivity().startService(serviceIn);
|
||||
list.add(new ManyBean(sob.getData(),R.layout.huoyuan_yundan));
|
||||
}else{
|
||||
SPUtil.insSP(con,"order","ShippingNoteNumber","");
|
||||
|
||||
+19
-264
@@ -1,28 +1,16 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.home;
|
||||
|
||||
import static com.sdk.base.framework.utils.app.AppUtils.getPackageName;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.provider.Settings;
|
||||
import android.text.Html;
|
||||
import android.text.Layout;
|
||||
import android.text.TextUtils;
|
||||
import android.text.method.HideReturnsTransformationMethod;
|
||||
import android.text.method.PasswordTransformationMethod;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
@@ -34,26 +22,19 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.arpa.hndahesudintocctmsdriver.H5Activity;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.JTT;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.WaybillStatusBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.FaceEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeWaybillEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.ALProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.PersonalAuthActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.img.ImageGetUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickHelper;
|
||||
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickListener;
|
||||
import com.dahe.mylibrary.utils.ActivityUtils;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.esign.esignsdk.EsignSdk;
|
||||
import com.esign.esignsdk.data.AuthEvent;
|
||||
import com.google.gson.Gson;
|
||||
@@ -79,15 +60,12 @@ import com.arpa.hndahesudintocctmsdriver.util.time.Timer;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||
import com.lxj.xpopup.interfaces.XPopupCallback;
|
||||
import com.permissionx.guolindev.PermissionX;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.TreeMap;
|
||||
|
||||
public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
|
||||
@@ -101,10 +79,6 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
private BasePopupView xp;
|
||||
private TextView car;
|
||||
private String cid;
|
||||
private String selectCarNum = "";
|
||||
|
||||
private String currOutInvoice = "0";
|
||||
|
||||
|
||||
@Override
|
||||
public void msgMethod(Message m) {
|
||||
@@ -129,23 +103,20 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
//Toast.makeText(con,"接单成功",Toast.LENGTH_SHORT).show();
|
||||
customDialog.dismiss();
|
||||
// EsignSdk.getInstance().startH5Activity(act, (String) bb.getData());
|
||||
if (null == bb.getData()) {
|
||||
if (null==bb.getData()){
|
||||
UiAuxiliary.homeRequest("接单");
|
||||
Intent in = new Intent(con, StartYunDanActivity.class);
|
||||
in.putExtra("id", "0");
|
||||
startActivity(in);
|
||||
finish();
|
||||
} else {
|
||||
}else{
|
||||
Intent intent = new Intent(this, H5Activity.class);
|
||||
intent.putExtra("url", (String) bb.getData());
|
||||
intent.putExtra("view_file", false);
|
||||
intent.putExtra("title", "合同签署");
|
||||
startActivity(intent);
|
||||
}
|
||||
//finish();
|
||||
} else {
|
||||
EventBus.getDefault().post(new HomeWaybillEvent(1));
|
||||
finish();
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
customDialog.dismiss();
|
||||
}
|
||||
@@ -163,63 +134,23 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
CacheGroup.cacheList.remove("jttRes");
|
||||
}
|
||||
|
||||
|
||||
if (CacheGroup.cacheList.get("orderStatus") != null) {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
isRegOk = true;
|
||||
|
||||
Log.e("orderStatus", CacheGroup.cacheList.get("orderStatus"));
|
||||
WaybillStatusBean status = gson.fromJson(CacheGroup.cacheList.get("orderStatus"), WaybillStatusBean.class);
|
||||
if (status.getCode() == 200) {
|
||||
if (regOkPop != null && regOkPop.isShow()) {
|
||||
regOkPop.dismiss();
|
||||
}
|
||||
if (status.getData() != null) {
|
||||
//执行运单下一步操作
|
||||
new XPopup.Builder(con)
|
||||
.asConfirm("请确认接单", "是否确定承运此运单?",
|
||||
"取消", "确认",
|
||||
() -> {
|
||||
Log.e("--id--", "cid:" + cid + "---wid:" + id);
|
||||
hyr.confirm(cid, id);
|
||||
}, () -> customDialog.dismiss(), false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局
|
||||
.show();
|
||||
} else {//订单已取消
|
||||
new MessageUtils().showSimCenPop(con, "运单异常将无法进行下步操作,请返回首页", "取消", "确定", () -> {
|
||||
SPUtils.remove(con, "curWaybillId");
|
||||
EventBus.getDefault().post(new HomeWaybillEvent(1));
|
||||
ActivityUtils.finishToActivity(MainActivity.class, false);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(con, status.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove("orderStatus");
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
int index = Integer.valueOf((String) m.obj);
|
||||
Log.e("--选择车辆--", clb.getData().get(index).getCarNumber());
|
||||
car.setText("选择车辆:" + clb.getData().get(index).getCarNumber());
|
||||
selectCarNum = clb.getData().get(index).getCarNumber();
|
||||
currOutInvoice = clb.getData().get(index).getOutInvoice();
|
||||
cid = clb.getData().get(index).getCarId();
|
||||
break;
|
||||
|
||||
case 1111://安联用户验证通过,接单
|
||||
hyr.getOrderStatus(id);
|
||||
// new XPopup.Builder(con)
|
||||
// .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||
// .asConfirm("请确认接单", "是否确定承运此运单?",
|
||||
// "取消", "确认",
|
||||
// () -> {
|
||||
// Log.e("--id--", "cid:" + cid + "---wid:" + id);
|
||||
// hyr.confirm(cid, id);
|
||||
// }, () -> customDialog.dismiss(), false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局
|
||||
// .show();
|
||||
new XPopup.Builder(con)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||
.asConfirm("请确认接单", "是否确定承运此运单?",
|
||||
"取消", "确认",
|
||||
() -> {
|
||||
Log.e("--id--", "cid:" + cid + "---wid:" + id);
|
||||
hyr.confirm(cid, id);
|
||||
}, () -> customDialog.dismiss(), false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局
|
||||
.show();
|
||||
break;
|
||||
case 2222://安联用户验证不通过
|
||||
customDialog.dismiss();
|
||||
@@ -269,8 +200,6 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
//2021/02/27记,类型声明错误
|
||||
ImageButton return_btn = v.findViewById(R.id.return_btn);
|
||||
ImageButton xuan = v.findViewById(R.id.xuan);
|
||||
CheckBox checkBox = v.findViewById(R.id.cb);
|
||||
TextView totalFreight = v.findViewById(R.id.totalFreight);
|
||||
ImageButton btnFp = v.findViewById(R.id.btnFp);
|
||||
TextView effectiveTime = v.findViewById(R.id.effectiveTime);
|
||||
TextView check_contract = v.findViewById(R.id.check_contract);
|
||||
@@ -281,15 +210,6 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
return_btn.setOnClickListener(v16 -> {
|
||||
finish();
|
||||
});
|
||||
totalFreight.setText("****");
|
||||
checkBox.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
if (isChecked) {
|
||||
totalFreight.setText(hyd.getData().getTotalFreight());
|
||||
} else {
|
||||
totalFreight.setText("****");
|
||||
}
|
||||
// totalFreight.setTransformationMethod(isChecked? HideReturnsTransformationMethod.getInstance(): PasswordTransformationMethod.getInstance());
|
||||
});
|
||||
// String textSource = "同意在符合相关税务机关要求的情况下代开<font color='#ff0000'>增值税发票</font>";
|
||||
String textSource = "公司已对运输合同条款充分解释说明,本人已充分理解、认可并签署;同意符合税务机关要求下<font color='#ff0000'>代开增值税发票</font>,产生的增值税及附加税本人承担。";
|
||||
tvZzs.setText(Html.fromHtml(textSource));
|
||||
@@ -332,26 +252,9 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
});
|
||||
//
|
||||
ImageButton xuanze = v.findViewById(R.id.xuanze);
|
||||
|
||||
if (hyd != null && hyd.getData() != null && !TextUtils.isEmpty(hyd.getData().getCarNumber())) {
|
||||
String carNumber = hyd.getData().getCarNumber();
|
||||
if (clb != null && !clb.getData().isEmpty()) {//判断车辆是否需要上传安联
|
||||
for (CarListBean.DataDTO datum : clb.getData()) {
|
||||
if (carNumber.equals(datum.getCarNumber())) {
|
||||
cid = hyd.getData().getCarId();
|
||||
car.setText("选择车辆:" + hyd.getData().getCarNumber());
|
||||
currOutInvoice = datum.getOutInvoice();
|
||||
selectCarNum = hyd.getData().getCarNumber();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else if (clb != null && clb.getData().size() == 1) {
|
||||
if (clb != null && clb.getData().size() == 1) {
|
||||
cid = clb.getData().get(0).getCarId();
|
||||
car.setText("选择车辆:" + clb.getData().get(0).getCarNumber());
|
||||
currOutInvoice = clb.getData().get(0).getOutInvoice();
|
||||
selectCarNum = clb.getData().get(0).getCarNumber();
|
||||
}
|
||||
xuanze.setOnClickListener(v1 -> {
|
||||
if (clb.getData().size() > 0) {
|
||||
@@ -364,7 +267,7 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
});
|
||||
//
|
||||
Button confirm_btn = v.findViewById(R.id.confirm_btn);
|
||||
confirm_btn.setOnClickListener(new OnLimitClickHelper(view -> {
|
||||
confirm_btn.setOnClickListener(v13 -> {
|
||||
if ("1".equals(UserParts.getUser(con).getData().getRealAuthentication())) {
|
||||
if (cid != null) {
|
||||
// if (fpKey){
|
||||
@@ -385,7 +288,7 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
Intent in = new Intent(con, PersonalAuthActivity.class);
|
||||
startActivity(in);
|
||||
}
|
||||
}));
|
||||
});
|
||||
BaseRecyclerView zhuang_data = v.findViewById(R.id.zhuang_rv1);
|
||||
BaseRecyclerView xie_data = v.findViewById(R.id.zhuang_rv2);
|
||||
List<Object> listz = new ArrayList<>();
|
||||
@@ -442,7 +345,6 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
|
||||
UiAuxiliary.homeRequest("接单");
|
||||
Intent in = new Intent(con, StartYunDanActivity.class);
|
||||
in.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
in.putExtra("id", "0");
|
||||
startActivity(in);
|
||||
finish();
|
||||
@@ -456,6 +358,7 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
// }, 2500);
|
||||
|
||||
|
||||
|
||||
// new Handler().postDelayed(() -> {
|
||||
//
|
||||
//
|
||||
@@ -520,158 +423,10 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
* 先判断安联用户信息验证,随后接单
|
||||
*/
|
||||
private void reOrder() {
|
||||
//开始倒计时
|
||||
startCountDown();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
try {
|
||||
PermissionX.init(this)
|
||||
.permissions(Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.ACCESS_FINE_LOCATION,
|
||||
Manifest.permission.ACCESS_COARSE_LOCATION)
|
||||
.request((allGranted, grantedList, deniedList) -> {
|
||||
if (allGranted) {
|
||||
customDialog = new CustomDialog(con, "正在接单...");
|
||||
customDialog.show();
|
||||
if ("0".equals(currOutInvoice)) {
|
||||
//验证安联用户是否通过
|
||||
ALProcess.verification(con, selectCarNum, hd);
|
||||
} else {
|
||||
hyr.getOrderStatus(id);
|
||||
}
|
||||
|
||||
} else {
|
||||
boolean accessCoarseLocation = deniedList.contains("android.permission.ACCESS_FINE_LOCATION");
|
||||
boolean contains = deniedList.contains("android.permission.WRITE_EXTERNAL_STORAGE");
|
||||
if (accessCoarseLocation | contains) {
|
||||
new MessageUtils().showSimCenPop(con, "缺少定位权限或媒体和文件权限,会导致无法接单,去开启!", "取消", "确认", () -> {
|
||||
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
startActivity(intent);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
customDialog = new CustomDialog(con, "正在接单...");
|
||||
customDialog.show();
|
||||
//验证安联用户是否通过
|
||||
ALProcess.verification(con, selectCarNum, hd);
|
||||
}
|
||||
|
||||
} else {
|
||||
customDialog = new CustomDialog(con, "正在接单...");
|
||||
customDialog.show();
|
||||
//验证安联用户是否通过
|
||||
ALProcess.verification(con, selectCarNum, hd);
|
||||
}
|
||||
|
||||
|
||||
// customDialog = new CustomDialog(con, "正在接单...");
|
||||
// customDialog.show();
|
||||
// //验证安联用户是否通过
|
||||
// ALProcess.verification(con, hd);
|
||||
customDialog = new CustomDialog(con, "正在接单...");
|
||||
customDialog.show();
|
||||
//验证安联用户是否通过
|
||||
ALProcess.verification(con, hd);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
// 取消倒计时,防止内存泄漏
|
||||
if (countDownTimer != null) {
|
||||
countDownTimer.cancel();
|
||||
}
|
||||
if (regOkPop != null && regOkPop.isShow()) {
|
||||
regOkPop.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
private CountDownTimer countDownTimer;
|
||||
private boolean isRegOk = false;
|
||||
private BasePopupView regOkPop;
|
||||
private void startCountDown() {
|
||||
countDownTimer = new CountDownTimer(30000, 1000) {
|
||||
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
// 更新TextView显示剩余时间
|
||||
System.out.println("asdf");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
if (!isRegOk) {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
//执行运单下一步操作
|
||||
regOkPop = new XPopup.Builder(con)
|
||||
.setPopupCallback(new XPopupCallback() {
|
||||
@Override
|
||||
public void onCreated(BasePopupView popupView) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeShow(BasePopupView popupView) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShow(BasePopupView popupView) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(BasePopupView popupView) {
|
||||
isRegOk = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeDismiss(BasePopupView popupView) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBackPressed(BasePopupView popupView) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onKeyBoardStateChanged(BasePopupView popupView, int height) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDrag(BasePopupView popupView, int value, float percent, boolean upOrLeft) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickOutside(BasePopupView popupView) {
|
||||
|
||||
}
|
||||
})
|
||||
.asConfirm("提示", "接单失败,请返回重新接单!",
|
||||
"取消", "确认",
|
||||
() -> {
|
||||
isRegOk = false;
|
||||
finish();
|
||||
}, () -> {
|
||||
}, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局
|
||||
.show();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}.start(); // 别忘了调用start()方法来启动倒计时
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,11 +186,9 @@ public class OrderAllActivity extends BaseActivity {
|
||||
case 200006:
|
||||
state4.setTextColor(getResources().getColor(R.color.blue));
|
||||
state4.setText(" 已评价");
|
||||
case 200005:
|
||||
state3.setTextColor(getResources().getColor(R.color.blue));
|
||||
state3.setText(" 已结算");
|
||||
case 200005:
|
||||
// state3.setTextColor(getResources().getColor(R.color.blue));
|
||||
// state3.setText(" 已结算");
|
||||
case 200004:
|
||||
state2.setTextColor(getResources().getColor(R.color.blue));
|
||||
state2.setText(" 已卸货");
|
||||
|
||||
+11
-63
@@ -3,7 +3,6 @@ package com.arpa.hndahesudintocctmsdriver.ui.home;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.animation.AlphaAnimation;
|
||||
@@ -41,11 +40,8 @@ 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.WalkRouteResult;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivityBC;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.dahe.mylibrary.utils.ImageLoader;
|
||||
import com.dahe.mylibrary.utils.TimeUtil;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||
@@ -77,7 +73,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
public class StartYunDanActivity extends BaseActivity {
|
||||
|
||||
@@ -102,7 +97,6 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
private boolean key = false;
|
||||
private int id = 0;
|
||||
LocationGDUtil ld;
|
||||
private TextView pl_submit;
|
||||
|
||||
@Override
|
||||
public void msgMethod(Message m) {
|
||||
@@ -110,14 +104,11 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
switch (m.what) {
|
||||
case RequsetCodeConstants.SUCCESS:
|
||||
//获取页面数据
|
||||
if (CacheGroup.cacheList.get("refreshorderDetail") != null && CacheGroup.cacheList.get(GET_EVALUTE) != null) {
|
||||
if (CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER) != null && CacheGroup.cacheList.get(GET_EVALUTE) != null) {
|
||||
Log.e("-评论-", CacheGroup.cacheList.get(GET_EVALUTE));
|
||||
Log.e("-运单-", CacheGroup.cacheList.get("refreshorderDetail"));
|
||||
sob = gson.fromJson(CacheGroup.cacheList.get("refreshorderDetail"), StartOrderBean.class);
|
||||
Log.e("-运单-", CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER));
|
||||
sob = gson.fromJson(CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER), StartOrderBean.class);
|
||||
wnb = gson.fromJson(CacheGroup.cacheList.get(GET_EVALUTE), WNewsBean.class);
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
if (sob.getCode() == 200 && sob.getData() != null) {
|
||||
id = sob.getData().getWaybillId();
|
||||
initView(null);
|
||||
@@ -129,14 +120,13 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
} else {
|
||||
Toast.makeText(con, sob.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove("refreshorderDetail");
|
||||
CacheGroup.cacheList.remove(HuoYuanFragmengt.START_ORDER);
|
||||
CacheGroup.cacheList.remove(GET_EVALUTE);
|
||||
}
|
||||
//保存评价
|
||||
if (CacheGroup.cacheList.get(KEEP_EVALUTE) != null) {
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(KEEP_EVALUTE), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
pl_submit.setVisibility(View.GONE);
|
||||
Toast.makeText(con, "评价保存成功", Toast.LENGTH_SHORT).show();
|
||||
hyr.startOrder(id);
|
||||
hyr.getEvaluate(id);
|
||||
@@ -212,33 +202,9 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
initStartBody(v);
|
||||
break;
|
||||
case R.layout.item_yundan_yunxing:
|
||||
LinearLayout llMoney = v.findViewById(R.id.llMoney);
|
||||
if (!sob.getData().getWaybillStatus().equals("已装货")
|
||||
&& !sob.getData().getWaybillStatus().equals("待装货")
|
||||
&& !sob.getData().getWaybillStatus().equals("待接单")) {
|
||||
if (sob.getData().getWaybillStatus().equals("已装货")) {
|
||||
StartOrderBean.DataDTO.WayChildrenDTO mySdw = new StartOrderBean.DataDTO.WayChildrenDTO();
|
||||
for (int i = 0; i < sob.getData().getWayChildren().size(); i++) {
|
||||
StartOrderBean.DataDTO.WayChildrenDTO sdw = sob.getData().getWayChildren().get(i);
|
||||
if (sdw.getType() == 1) {
|
||||
mySdw = sdw;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (mySdw.getStatus() == 3) {
|
||||
llMoney.setVisibility(View.GONE);
|
||||
} else {
|
||||
llMoney.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
llMoney.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
llMoney.setVisibility(View.GONE);
|
||||
}
|
||||
ImageView head_img = v.findViewById(R.id.head_img);
|
||||
if (ub != null && ub.getData() != null && !ub.getData().getHeadportraitUrl().equals("")) {
|
||||
ImageLoader.getInstance().loadImage(con,ub.getData().getHeadportraitUrl(),head_img);
|
||||
Glide.with(con).load(ub.getData().getHeadportraitUrl()).into(head_img);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -262,7 +228,7 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
sv2.initView();
|
||||
sv1.setScore(5);
|
||||
//设置是否可以修改评分,默认为true
|
||||
pl_submit = v.findViewById(R.id.pl_submit);
|
||||
TextView pl_submit = v.findViewById(R.id.pl_submit);
|
||||
TextView m_pl_value = v.findViewById(R.id.m_pl_value);
|
||||
TextView pl_value = v.findViewById(R.id.pl_value);
|
||||
if (wnb.getData() != null) {
|
||||
@@ -388,9 +354,8 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
String wid = sdw.getId() + "";
|
||||
if (sdw.getStatus() == 0) {
|
||||
if (type == 0) {
|
||||
Intent in = new Intent(con, ShangChuangImgActivityBC.class);
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
in.putExtra("type", type);
|
||||
in.putExtra("reportAlct", sob.getData().getReportAlct());
|
||||
in.putExtra("wid", wid);
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
in.putExtra("keys", key);
|
||||
@@ -399,17 +364,15 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
Toast.makeText(con, "您还没有装货", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else if (sdw.getStatus() == 1) {//装货回单
|
||||
Intent in = new Intent(con, ShangChuangImgActivityBC.class);
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
in.putExtra("type", 2);
|
||||
in.putExtra("reportAlct", sob.getData().getReportAlct());
|
||||
in.putExtra("wid", wid);
|
||||
in.putExtra("h_type", type);
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
startActivity(in);
|
||||
} else if (sdw.getStatus() == 2) {//上传收货单(卸货回单)
|
||||
Intent in = new Intent(con, ShangChuangImgActivityBC.class);
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
in.putExtra("type", 2);
|
||||
in.putExtra("reportAlct", sob.getData().getReportAlct());
|
||||
in.putExtra("wid", wid);
|
||||
in.putExtra("h_type", type);
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
@@ -427,9 +390,8 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
if (zInfo.getReceiptUrl() != null && zInfo.getReceiptUrl().size() > 0) {
|
||||
int dis = TimeUtil.compareNowDate(TimeUtil.string2Millis(zInfo.getImageTakenDate(), TimeUtil.DEFAULT_FORMAT4));
|
||||
if (dis > 5) {//大于五分钟可以接单
|
||||
Intent in = new Intent(con, ShangChuangImgActivityBC.class);
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
in.putExtra("type", type);
|
||||
in.putExtra("reportAlct", sob.getData().getReportAlct());
|
||||
in.putExtra("wid", wid);
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
in.putExtra("keys", key);
|
||||
@@ -484,23 +446,13 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
return str;
|
||||
}
|
||||
|
||||
private CustomDialog customDialog;
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
if (map != null) {
|
||||
map.onResume();
|
||||
}
|
||||
if (customDialog==null){
|
||||
customDialog = new CustomDialog(con, "网络请求中...");
|
||||
customDialog.show();
|
||||
}else{
|
||||
if (!customDialog.isShowing()){
|
||||
customDialog.show();
|
||||
}
|
||||
}
|
||||
hyr.startOrder2(id);
|
||||
hyr.startOrder(id);
|
||||
hyr.getEvaluate(id);
|
||||
}
|
||||
|
||||
@@ -611,10 +563,6 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
|
||||
|
||||
public void search() {
|
||||
String latitude = sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLatitude();
|
||||
if (TextUtils.isEmpty(latitude)) {
|
||||
return;
|
||||
}
|
||||
// try {
|
||||
// AMapLocationClient.updatePrivacyShow(con,true,true);
|
||||
// AMapLocationClient.updatePrivacyAgree(con,true);
|
||||
|
||||
+1
-2
@@ -21,7 +21,6 @@ import com.bumptech.glide.Glide;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
||||
import com.dahe.mylibrary.utils.ImageLoader;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
@@ -59,7 +58,7 @@ public class VideoReleaseActivity extends BaseActivity {
|
||||
public void initView(Object obj) {
|
||||
super.initView(obj);
|
||||
getFirstframe(videoPath);
|
||||
ImageLoader.getInstance().loadImage(con,new File(coverPath),video_cover);
|
||||
Glide.with(con).load(new File(coverPath)).into(video_cover);
|
||||
}
|
||||
|
||||
public void submit(View v){
|
||||
|
||||
+2
-3
@@ -8,7 +8,6 @@ import android.widget.TextView;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.dahe.mylibrary.utils.ImageLoader;
|
||||
import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
@@ -73,7 +72,7 @@ public class GetShangChuanActivity extends BaseActivity {
|
||||
//coordinate.setText(StringUtil.isNull(sdw.getLongitude(),"")+","+StringUtil.isNull(sdw.getLatitude(),""));
|
||||
//coordinate2.setText(StringUtil.isNull(sdw.getReceiptLongitude(),"")+","+StringUtil.isNull(sdw.getReceiptLatitude(),""));
|
||||
if(sdw.getSendPutImagesUrl()!=null && sdw.getSendPutImagesUrl().size()>=1){
|
||||
ImageLoader.getInstance().loadImage(con,sdw.getSendPutImagesUrl().get(0),img1);
|
||||
Glide.with(con).load(sdw.getSendPutImagesUrl().get(0)).into(img1);
|
||||
img1.setOnClickListener(v -> {
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(img1,sdw.getSendPutImagesUrl().get(0), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||
@@ -84,7 +83,7 @@ public class GetShangChuanActivity extends BaseActivity {
|
||||
});
|
||||
}
|
||||
if(sdw.getReceiptUrl()!=null && sdw.getReceiptUrl().size()>=1){
|
||||
ImageLoader.getInstance().loadImage(con,sdw.getReceiptUrl().get(0),img2);
|
||||
Glide.with(con).load(sdw.getReceiptUrl().get(0)).into(img2);
|
||||
img2.setOnClickListener(v -> {
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(img2,sdw.getReceiptUrl().get(0), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||
|
||||
+78
-462
@@ -1,12 +1,8 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan;
|
||||
|
||||
import static com.sdk.base.framework.utils.app.AppUtils.getPackageName;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
@@ -19,38 +15,24 @@ import android.widget.Toast;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alct.mdp.MDPLocationCollectionManager;
|
||||
import com.alct.mdp.callback.OnDownloadResultListener;
|
||||
import com.alct.mdp.callback.OnResultListener;
|
||||
import com.alct.mdp.model.Goods;
|
||||
import com.alct.mdp.model.Image;
|
||||
import com.alct.mdp.model.Location;
|
||||
import com.alct.mdp.model.ShipmentStatusEnum;
|
||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.GDImage;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.GDLocation;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.WaybillStatusBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeWaybillEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.ALProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.OCRRequest;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.TrackInputBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.BitmapUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.NewLJUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
||||
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.callback.OnGDDownloadResultListener;
|
||||
import com.dahe.mylibrary.callback.OnGDResultListener;
|
||||
import com.dahe.mylibrary.utils.ActivityUtils;
|
||||
import com.dahe.mylibrary.utils.ImageLoader;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.luck.picture.lib.PictureSelector;
|
||||
import com.luck.picture.lib.config.PictureConfig;
|
||||
@@ -74,8 +56,6 @@ import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
@@ -89,7 +69,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
private String[] names = {"装货", "卸货", "回单"};
|
||||
public static String[] TYPE_NAME = {"zhuanghuo", "xiehuo", "huidan"};
|
||||
private int index = 0;
|
||||
private int reportAlct = 1;//是否上报(安联城通) 0否 1是'
|
||||
//
|
||||
private Gson gson = new Gson();
|
||||
//
|
||||
@@ -109,20 +88,13 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
private boolean locationKey = false;
|
||||
private TextView tv_loaction;
|
||||
|
||||
private boolean isFinish = false;
|
||||
|
||||
@Override
|
||||
public void msgMethod(Message m) {
|
||||
super.msgMethod(m);
|
||||
switch (m.what) {
|
||||
case RequsetCodeConstants.ERROR:
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
break;
|
||||
case RequsetCodeConstants.SUCCESS:
|
||||
if (CacheGroup.cacheList.get("upload") != null) {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
|
||||
customDialog.dismiss();
|
||||
}
|
||||
Log.e("upload", CacheGroup.cacheList.get("upload"));
|
||||
@@ -130,7 +102,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
if (ub.getCode() == 200) {
|
||||
imgIds.add(ub.getData().getId());
|
||||
// Glide.with(con).load(ub.getData().getUrl()).into(res_img);
|
||||
ImageLoader.getInstance().loadImage(con,path,res_img);
|
||||
Glide.with(con).load(path).into(res_img);
|
||||
res_img.setVisibility(View.VISIBLE);
|
||||
img_delete.setVisibility(View.VISIBLE);
|
||||
img_icon.setVisibility(View.GONE);
|
||||
@@ -140,73 +112,20 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
CacheGroup.cacheList.remove("upload");
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("genzong") != null) {
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("genzong"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
Log.e("--轨迹上传--", "成功");
|
||||
} else {
|
||||
Log.e("--轨迹上传失败:--", bb.getMsg());
|
||||
}
|
||||
CacheGroup.cacheList.remove("genzong");
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("waybillStatus") != null) {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
Log.e("waybillStatus", CacheGroup.cacheList.get("waybillStatus"));
|
||||
WaybillStatusBean status = gson.fromJson(CacheGroup.cacheList.get("waybillStatus"), WaybillStatusBean.class);
|
||||
if (status.getCode() == 200) {
|
||||
if (status.getData() != null) {
|
||||
//执行运单下一步操作
|
||||
typeRequest();
|
||||
} else {//订单已取消
|
||||
new MessageUtils().showSimCenPop(con, "运单异常将无法进行下步操作,请返回首页", "取消", "确定", () -> {
|
||||
SPUtils.remove(con, "curWaybillId");
|
||||
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||
ActivityUtils.finishToActivity(MainActivity.class, false);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(con, status.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove("waybillStatus");
|
||||
}
|
||||
for (int i = 0; i < TYPE_NAME.length; i++) {
|
||||
if (CacheGroup.cacheList.get(TYPE_NAME[i]) != null) {
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]), BaseBean.class);
|
||||
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
|
||||
customDialog.dismiss();
|
||||
}
|
||||
if (bb.getCode() == 200) {
|
||||
if (index == 2) {
|
||||
if (!keys) {//装货回单
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}else if (reportAlct==0){
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||
if (!keys){//装货回单
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
} else if ((0 == index || 1 == index) && isFinish) {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
} else {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||
finish();
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove(TYPE_NAME[i]);
|
||||
@@ -231,16 +150,13 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
if (sob.getData().getCarNumber().equals(value)) {
|
||||
hyr.uploadFile(new File(path));
|
||||
} else {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
new MessageUtils().showCenMessage(ShangChuangImgActivity.this, "车牌号不匹配!", "请重新拍照或联系管理员");
|
||||
}
|
||||
} else {
|
||||
hyr.uploadFile(new File(path));
|
||||
}
|
||||
} else {//识别失败后返回code500
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
|
||||
customDialog.dismiss();
|
||||
}
|
||||
if (index == 0) {//装卸货车辆需要识别车牌号){
|
||||
@@ -255,7 +171,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
break;
|
||||
case 14://定位成功
|
||||
locationKey = true;
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
|
||||
customDialog.dismiss();
|
||||
}
|
||||
tv_loaction.setText("定位成功");
|
||||
@@ -265,21 +181,12 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
break;
|
||||
case 16://定位失败
|
||||
locationKey = false;
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
|
||||
customDialog.dismiss();
|
||||
}
|
||||
tv_loaction.setText("定位失败,点击重试");
|
||||
tv_loaction.setTextColor(getResources().getColor(R.color.loaction_no_color, null));
|
||||
|
||||
new MessageUtils().showSimCenPop(con, "缺少定位权限,去开启精确定位权限!", "取消", "确认", () -> {
|
||||
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
|
||||
// Toast.makeText(con, "定位失败,请确认开启定位后重试!", Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(con, "定位失败,请确认开启定位后重试!", Toast.LENGTH_LONG).show();
|
||||
//定位结果接收
|
||||
//finish();
|
||||
break;
|
||||
@@ -304,7 +211,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private LatLng latLng;
|
||||
|
||||
public LatLng convertGPSToBaidu(LatLng srLatLng) {
|
||||
@@ -337,14 +243,12 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
tips_x = findViewById(R.id.tips_x);
|
||||
Bundle ins = getIntent().getExtras();
|
||||
index = ins.getInt("type");
|
||||
reportAlct = ins.getInt("reportAlct");
|
||||
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();
|
||||
@@ -389,9 +293,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
submit.setOnClickListener(v -> {
|
||||
if (imgIds.size() != 0) {
|
||||
//判断运单是否已取消
|
||||
hyr.getWaybillStatus(sob.getData().getWaybillId());
|
||||
// typeRequest();
|
||||
typeRequest();
|
||||
} else {
|
||||
Toast.makeText(con, "请先上传一张图片", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@@ -437,7 +339,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
Log.e("图片地址:", path);
|
||||
gia.dis();
|
||||
|
||||
if (customDialog != null && !customDialog.isShowing()) {
|
||||
if (customDialog!=null&&!customDialog.isShowing()){
|
||||
customDialog = new CustomDialog(con, "网络请求中...");
|
||||
customDialog.show();
|
||||
}
|
||||
@@ -456,7 +358,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
Log.e("图片地址:", path);
|
||||
gia.dis();
|
||||
|
||||
if (customDialog != null && !customDialog.isShowing()) {
|
||||
if (customDialog!=null&&!customDialog.isShowing()){
|
||||
customDialog = new CustomDialog(con, "网络请求中...");
|
||||
customDialog.show();
|
||||
}
|
||||
@@ -474,12 +376,12 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
// for(int i=0;i<imgIds.size();i++){
|
||||
// Log.e("--imgIds--",imgIds.get(i)+"");
|
||||
// }
|
||||
if (customDialog != null && !customDialog.isShowing()) {
|
||||
customDialog = new CustomDialog(con, "网络请求中...");
|
||||
customDialog.show();
|
||||
}
|
||||
switch (index) {
|
||||
case 0:
|
||||
if (customDialog!=null&&!customDialog.isShowing()){
|
||||
customDialog = new CustomDialog(con, "网络请求中...");
|
||||
customDialog.show();
|
||||
}
|
||||
//装货
|
||||
if (imgIds != null && imgIds.size() > 0) {
|
||||
lub.setLatitude(lgdu.getLatitude() + "");
|
||||
@@ -490,78 +392,16 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
Log.e("--装货信息", gson.toJson(lub));
|
||||
if (locationKey) {//高德定位
|
||||
if (keys) {
|
||||
if (1==reportAlct){
|
||||
NewLJUtils.getInstance().getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnGDDownloadResultListener() {
|
||||
@Override
|
||||
public void onSuccess(String var1) {
|
||||
String string = var1;
|
||||
if (string.equals("30")) {//安联装货,单平台未装货
|
||||
isFinish = true;
|
||||
//平台确认装货
|
||||
hyr.loading(lub);
|
||||
} else {
|
||||
// nfc();
|
||||
loadInfo();
|
||||
}
|
||||
upLocation(lgdu.getLatitude() + "", lgdu.getLongitude() + "",sob.getData().getShippingNoteNumber());
|
||||
// NewLJUtils.getInstance().startLocationService(ShangChuangImgActivity.this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showToast(con, var2);
|
||||
}
|
||||
});
|
||||
}else{
|
||||
isFinish = true;
|
||||
//平台确认装货
|
||||
hyr.loading(lub);
|
||||
}
|
||||
|
||||
// MDPLocationCollectionManager.getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnDownloadResultListener() {
|
||||
// @Override
|
||||
// public void onSuccess(Object o) {
|
||||
//
|
||||
// String string = o.toString();
|
||||
// if (string.equals("PICKUPED")) {//安联装货,单平台未装货
|
||||
// isFinish = true;
|
||||
// //平台确认装货
|
||||
// hyr.loading(lub);
|
||||
// } else {
|
||||
// nfc();
|
||||
// loadInfo();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(String s, String s1) {
|
||||
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
// customDialog.dismiss();
|
||||
// }
|
||||
// ToastUtils.showToast(con, s1);
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
// nfc();
|
||||
// loadInfo();
|
||||
nfc();
|
||||
loadInfo();
|
||||
// up_traffic_start();
|
||||
// up_image_z();
|
||||
}
|
||||
} else {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
} else {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
@@ -576,76 +416,16 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
Log.e("--卸货信息", gson.toJson(lub));
|
||||
if (locationKey) {
|
||||
if (keys) {
|
||||
if (1==reportAlct){
|
||||
NewLJUtils.getInstance().getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnGDDownloadResultListener() {
|
||||
@Override
|
||||
public void onSuccess(String var1) {
|
||||
if (var1.equals("40")) {//安联装货,单平台未装货
|
||||
//卸货状态-平台
|
||||
isFinish = true;
|
||||
hyr.dischargeCargo(lub);
|
||||
} else {
|
||||
nfc();
|
||||
uploadInfo();
|
||||
}
|
||||
upLocation(lgdu.getLatitude() + "", lgdu.getLongitude() + "",sob.getData().getShippingNoteNumber());
|
||||
// NewLJUtils.getInstance().stopLocationService();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showToast(con, var2);
|
||||
}
|
||||
});
|
||||
|
||||
}else {
|
||||
//卸货状态-平台
|
||||
isFinish = true;
|
||||
hyr.dischargeCargo(lub);
|
||||
}
|
||||
|
||||
// MDPLocationCollectionManager.getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnDownloadResultListener() {
|
||||
// @Override
|
||||
// public void onSuccess(Object o) {
|
||||
// if (o.toString().equals("UNLOADED")) {//安联装货,单平台未装货
|
||||
// //卸货状态-平台
|
||||
// isFinish = true;
|
||||
// hyr.dischargeCargo(lub);
|
||||
// } else {
|
||||
// nfc();
|
||||
// uploadInfo();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(String s, String s1) {
|
||||
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
// customDialog.dismiss();
|
||||
// }
|
||||
// ToastUtils.showToast(con, s1);
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
// nfc();
|
||||
// uploadInfo();
|
||||
nfc();
|
||||
uploadInfo();
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
} else {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
@@ -664,23 +444,15 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
Log.e("--回单信息", gson.toJson(urib));
|
||||
if (locationKey) {
|
||||
if (index == 2 && keys) {
|
||||
if (1==reportAlct){
|
||||
up_trafficSign();
|
||||
}
|
||||
// up_trafficReceipt();
|
||||
// receipt_image();
|
||||
up_trafficSign();
|
||||
up_trafficReceipt();
|
||||
receipt_image();
|
||||
}
|
||||
hyr.receipt(urib);
|
||||
} else {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
@@ -715,7 +487,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
//上传安联-签收
|
||||
public void up_trafficSign() {
|
||||
//安联
|
||||
GDLocation l = new GDLocation();
|
||||
Location l = new Location();
|
||||
l.setBaiduLongitude(latLng.longitude);
|
||||
l.setBaiduLatitude(latLng.latitude);
|
||||
l.setLocation(lgdu.getAddress());
|
||||
@@ -739,245 +511,147 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NewLJUtils.getInstance().sign(con, sob.getData().getShippingNoteNumber(), l, new OnGDResultListener() {
|
||||
MDPLocationCollectionManager.sign(con, sob.getData().getShippingNoteNumber(), l, gs, new com.alct.mdp.callback.OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
NewLJUtils.getInstance().stopLocationService();
|
||||
up_trafficReceipt();
|
||||
receipt_image();
|
||||
Log.e("上报安联", "签收成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
Log.e("上报安联失败(签收):", var1 + var2);
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(签收):", s + s1);
|
||||
}
|
||||
});
|
||||
// MDPLocationCollectionManager.sign(con, sob.getData().getShippingNoteNumber(), l, gs, new com.alct.mdp.callback.OnResultListener() {
|
||||
// @Override
|
||||
// public void onSuccess() {
|
||||
// Log.e("上报安联", "签收成功");
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(String s, String s1) {
|
||||
// Log.e("上报安联失败(签收):", s + s1);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
//上传安联-回单
|
||||
public void up_trafficReceipt() {
|
||||
//安联
|
||||
GDLocation l = new GDLocation();
|
||||
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 com.alct.mdp.callback.OnResultListener() {
|
||||
|
||||
NewLJUtils.getInstance().pod(con, sob.getData().getShippingNoteNumber(), l, new OnGDResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "回单上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
Log.e("上报安联失败(回单):", var1 + var2);
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(回单):", s + s1);
|
||||
}
|
||||
|
||||
});
|
||||
// MDPLocationCollectionManager.pod(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||
//
|
||||
// @Override
|
||||
// public void onSuccess() {
|
||||
// Log.e("上报安联", "回单上传成功");
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(String s, String s1) {
|
||||
// Log.e("上报安联失败(回单):", s + s1);
|
||||
// }
|
||||
//
|
||||
// });
|
||||
}
|
||||
|
||||
public void up_image_z() {
|
||||
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||
File file = new File(path);
|
||||
GDImage image = new GDImage();
|
||||
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.setTime(Timer.getTimerT());
|
||||
image.setBaiduLongitude(latLng.longitude);
|
||||
image.setBaiduLatitude(latLng.latitude);
|
||||
image.setLocation(lgdu.getAddress());
|
||||
MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
||||
|
||||
String json = new Gson().toJson(image);
|
||||
|
||||
NewLJUtils.getInstance().uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new OnGDResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
|
||||
customDialog.dismiss();
|
||||
}
|
||||
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||
Log.e("上报安联", "装货照片上传成功");
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
Log.e("上报安联失败(装货照片):", var1 + var2);
|
||||
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);
|
||||
}
|
||||
});
|
||||
|
||||
// MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
||||
//
|
||||
// @Override
|
||||
// public void onSuccess() {
|
||||
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
// customDialog.dismiss();
|
||||
// }
|
||||
// EventBus.getDefault().post(new HomeWaybillEvent());
|
||||
// Log.e("上报安联", "装货照片上传成功");
|
||||
// Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
// finish();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(String s, String s1) {
|
||||
// Log.e("上报安联失败(装货照片):", s + s1);
|
||||
//// SPUtil.insSP(con,"make","装货",sob.getData().getShippingNoteNumber());
|
||||
//// SPUtil.insSP(con,"make","装货-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||
//// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||
//// startService(serviceIn);
|
||||
// }
|
||||
//
|
||||
// });
|
||||
});
|
||||
}
|
||||
|
||||
public void up_image() {
|
||||
File file = new File(path);
|
||||
GDImage image = new GDImage();
|
||||
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.setTime(Timer.getTimerT());
|
||||
image.setBaiduLongitude(latLng.longitude);
|
||||
image.setBaiduLatitude(latLng.latitude);
|
||||
image.setLocation(lgdu.getAddress());
|
||||
MDPLocationCollectionManager.uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
||||
|
||||
NewLJUtils.getInstance().uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new OnGDResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
|
||||
customDialog.dismiss();
|
||||
}
|
||||
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||
Log.e("上报安联", "卸货照片上传成功");
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
Log.e("上报安联失败(卸货照片):", var1 + var2);
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
});
|
||||
// MDPLocationCollectionManager.uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
||||
//
|
||||
// @Override
|
||||
// public void onSuccess() {
|
||||
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
// customDialog.dismiss();
|
||||
// }
|
||||
// EventBus.getDefault().post(new HomeWaybillEvent());
|
||||
// Log.e("上报安联", "卸货照片上传成功");
|
||||
// Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
// finish();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(String s, String s1) {
|
||||
// Log.e("上报安联失败(卸货照片):", s + s1);
|
||||
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
// customDialog.dismiss();
|
||||
// }
|
||||
//// SPUtil.insSP(con,"make","卸货",sob.getData().getShippingNoteNumber());
|
||||
//// SPUtil.insSP(con,"make","卸货-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||
//// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||
//// startService(serviceIn);
|
||||
// }
|
||||
//
|
||||
// });
|
||||
}
|
||||
|
||||
public void receipt_image() {
|
||||
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||
File file = new File(path);
|
||||
GDImage image = new GDImage();
|
||||
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.setTime(Timer.getTimerT());
|
||||
image.setBaiduLongitude(latLng.longitude);
|
||||
image.setBaiduLatitude(latLng.latitude);
|
||||
image.setLocation(lgdu.getAddress());
|
||||
MDPLocationCollectionManager.uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
||||
|
||||
NewLJUtils.getInstance().uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new OnGDResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
|
||||
customDialog.dismiss();
|
||||
}
|
||||
SPUtils.remove(con, "curWaybillId");
|
||||
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||
Log.e("上报安联", "回单照片上传成功");
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
Log.e("上报安联失败(回单照片):", var1 + var2);
|
||||
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);
|
||||
}
|
||||
|
||||
});
|
||||
// MDPLocationCollectionManager.uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
||||
//
|
||||
// @Override
|
||||
// public void onSuccess() {
|
||||
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
// customDialog.dismiss();
|
||||
// }
|
||||
// SPUtils.remove(con, "curWaybillId");
|
||||
// EventBus.getDefault().post(new HomeWaybillEvent());
|
||||
// Log.e("上报安联", "回单照片上传成功");
|
||||
// Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
// finish();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(String s, String s1) {
|
||||
// Log.e("上报安联失败(回单照片):", s + s1);
|
||||
//// SPUtil.insSP(con,"make","回单",sob.getData().getShippingNoteNumber());
|
||||
////// SPUtil.insSP(con,"make","回单-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||
////// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||
////// startService(serviceIn);
|
||||
// }
|
||||
//
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1010,19 +684,20 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 上传安联和交通厅,平台-装货
|
||||
*/
|
||||
private void loadInfo() {
|
||||
//安联
|
||||
if (sob.getData().getReportAlct() == 1) {
|
||||
GDLocation l = new GDLocation();
|
||||
Location l = new Location();
|
||||
l.setBaiduLongitude(latLng.longitude);
|
||||
l.setBaiduLatitude(latLng.latitude);
|
||||
l.setLocation(lgdu.getAddress());
|
||||
l.setTime(Timer.getTimerT());
|
||||
|
||||
NewLJUtils.getInstance().pickUp(con, sob.getData().getShippingNoteNumber(), l, new OnGDResultListener() {
|
||||
MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "装货上传成功");
|
||||
@@ -1030,7 +705,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
if (sob.getData().getReport() == 1) {
|
||||
JTTProcess.start(con, sob, "");
|
||||
}
|
||||
NewLJUtils.getInstance().startLocationService(ShangChuangImgActivity.this);
|
||||
//装货状态
|
||||
hyr.loading(lub);
|
||||
//装货照片
|
||||
@@ -1038,39 +712,14 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
Log.e("上报安联失败(装货):", var1 + var2);
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(装货):", s + s1);
|
||||
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
|
||||
customDialog.dismiss();
|
||||
}
|
||||
new MessageUtils().showCenMessage(con, var2);
|
||||
new MessageUtils().showCenMessage(con, s1);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||
// @Override
|
||||
// public void onSuccess() {
|
||||
// Log.e("上报安联", "装货上传成功");
|
||||
// //交通厅
|
||||
// if (sob.getData().getReport() == 1) {
|
||||
// JTTProcess.start(con, sob, "");
|
||||
// }
|
||||
// //装货状态
|
||||
// hyr.loading(lub);
|
||||
// //装货照片
|
||||
// up_image_z();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(String s, String s1) {
|
||||
// Log.e("上报安联失败(装货):", s + s1);
|
||||
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
// customDialog.dismiss();
|
||||
// }
|
||||
// new MessageUtils().showCenMessage(con, s1);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1082,14 +731,13 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
|
||||
//安联
|
||||
if (sob.getData().getReportAlct() == 1) {
|
||||
GDLocation l = new GDLocation();
|
||||
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));
|
||||
|
||||
NewLJUtils.getInstance().unload(con, sob.getData().getShippingNoteNumber(), l, new OnGDResultListener() {
|
||||
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "卸货上传成功");
|
||||
@@ -1097,7 +745,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
if (sob.getData().getReport() == 1) {
|
||||
JTTProcess.stop(con, sob, "");
|
||||
}
|
||||
|
||||
//卸货状态-平台
|
||||
hyr.dischargeCargo(lub);
|
||||
//卸货照片-安联
|
||||
@@ -1105,48 +752,17 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
Log.e("上报安联失败(卸货):", var1 + var2);
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(卸货):", s + s1);
|
||||
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
|
||||
customDialog.dismiss();
|
||||
}
|
||||
new MessageUtils().showCenMessage(con, var2);
|
||||
new MessageUtils().showCenMessage(con, s1);
|
||||
}
|
||||
});
|
||||
// MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||
// @Override
|
||||
// public void onSuccess() {
|
||||
// Log.e("上报安联", "卸货上传成功");
|
||||
// //交通厅
|
||||
// if (sob.getData().getReport() == 1) {
|
||||
// JTTProcess.stop(con, sob, "");
|
||||
// }
|
||||
// //卸货状态-平台
|
||||
// hyr.dischargeCargo(lub);
|
||||
// //卸货照片-安联
|
||||
// up_image();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(String s, String s1) {
|
||||
// Log.e("上报安联失败(卸货):", s + s1);
|
||||
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
// customDialog.dismiss();
|
||||
// }
|
||||
// new MessageUtils().showCenMessage(con, s1);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void upLocation(String lat,String lon,String shippingNoteNumber){
|
||||
TrackInputBean tib = new TrackInputBean();
|
||||
tib.setLatitude(lat);
|
||||
tib.setLongitude(lon);
|
||||
tib.setShippingNoteNumber(shippingNoteNumber);
|
||||
hyr.trackTracking(tib);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+97
-321
@@ -36,22 +36,16 @@ import com.amap.api.services.help.Tip;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.GDImage;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.GDLocation;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.StartOrderBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.UploadBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeWaybillEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.OCRRequest;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.TrackInputBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.UploadReceiptInputBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.BitmapUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.NewLJUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||
@@ -67,8 +61,6 @@ import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
import com.baidu.mapapi.model.LatLng;
|
||||
import com.baidu.mapapi.utils.CoordinateConverter;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.dahe.mylibrary.callback.OnGDDownloadResultListener;
|
||||
import com.dahe.mylibrary.callback.OnGDResultListener;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.github.gzuliyujiang.wheelpicker.DatePicker;
|
||||
import com.github.gzuliyujiang.wheelpicker.DatimePicker;
|
||||
@@ -86,8 +78,6 @@ import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.interfaces.OnSelectListener;
|
||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
@@ -118,8 +108,6 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
private GetCarImageAlert gia = new GetCarImageAlert();
|
||||
private CustomDialog customDialog;
|
||||
private int id = 0;
|
||||
|
||||
private int reportAlct = 1;//是否上报(安联城通) 0否 1是'
|
||||
private boolean key = true;
|
||||
private boolean keys = false;
|
||||
private boolean locationKey = false;
|
||||
@@ -131,7 +119,6 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
|
||||
private TempLoca tempLoca = new TempLoca();
|
||||
private TempLoca tempLocaBd = new TempLoca();
|
||||
private boolean isFinish = false;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -260,35 +247,12 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
if (index == 2) {
|
||||
if (!keys) {//装货回单
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}else if (reportAlct==0){
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||
if (!keys){//装货回单
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
} else if ((0 == index || 1 == index) && isFinish) {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
} else {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||
finish();
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove(TYPE_NAME[i]);
|
||||
@@ -403,7 +367,6 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
tips_x = findViewById(R.id.tips_x);
|
||||
Bundle ins = getIntent().getExtras();
|
||||
index = ins.getInt("type");
|
||||
reportAlct = ins.getInt("reportAlct");
|
||||
wid = ins.getString("wid");
|
||||
h_type = ins.getInt("h_type");
|
||||
keys = ins.getBoolean("keys");
|
||||
@@ -411,17 +374,17 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
//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();
|
||||
// }
|
||||
// });
|
||||
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();
|
||||
@@ -451,12 +414,12 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
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+'T'+hour+":"+minute+":"+second;
|
||||
selDate = year+"-"+month+"-"+day+" "+ hour+":"+minute;
|
||||
tvDate.setText(selDate);
|
||||
});
|
||||
datimePicker.getWheelLayout().setDateLabel("年", "月", "日");
|
||||
datimePicker.getWheelLayout().setTimeLabel("时","分","");
|
||||
datimePicker.getWheelLayout().setTimeMode(TimeMode.HOUR_24_HAS_SECOND);
|
||||
datimePicker.getWheelLayout().setTimeMode(TimeMode.HOUR_24_NO_SECOND);
|
||||
datimePicker.show();
|
||||
});
|
||||
|
||||
@@ -550,10 +513,6 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
// for(int i=0;i<imgIds.size();i++){
|
||||
// Log.e("--imgIds--",imgIds.get(i)+"");
|
||||
// }
|
||||
if (customDialog != null && !customDialog.isShowing()) {
|
||||
customDialog = new CustomDialog(con, "网络请求中...");
|
||||
customDialog.show();
|
||||
}
|
||||
switch (index) {
|
||||
case 0:
|
||||
//装货
|
||||
@@ -564,52 +523,18 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
lub.setImageId(imgIds);
|
||||
lub.setWaybillId(wid);
|
||||
Log.e("--装货信息", gson.toJson(lub));
|
||||
// if (locationKey) {//高德定位
|
||||
if (locationKey) {//高德定位
|
||||
if (keys) {
|
||||
if (1==reportAlct){
|
||||
NewLJUtils.getInstance().getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnGDDownloadResultListener() {
|
||||
@Override
|
||||
public void onSuccess(String var1) {
|
||||
String string = var1;
|
||||
if (string.equals("30")) {//安联装货,单平台未装货
|
||||
isFinish = true;
|
||||
//平台确认装货
|
||||
hyr.loading(lub);
|
||||
} else {
|
||||
// nfc();
|
||||
loadInfo();
|
||||
}
|
||||
upLocation(tempLoca.getLatitude() + "", tempLoca.getLongitude() + "",sob.getData().getShippingNoteNumber());
|
||||
// NewLJUtils.getInstance().startLocationService(ShangChuangImgActivity.this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showToast(con, var2);
|
||||
}
|
||||
});
|
||||
}else{
|
||||
isFinish = true;
|
||||
//平台确认装货
|
||||
upLocation(tempLoca.getLatitude() + "", tempLoca.getLongitude() + "",sob.getData().getShippingNoteNumber());
|
||||
hyr.loading(lub);
|
||||
}
|
||||
|
||||
nfc();
|
||||
loadInfo();
|
||||
// up_traffic_start();
|
||||
// up_image_z();
|
||||
}
|
||||
// } else {
|
||||
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
// customDialog.dismiss();
|
||||
// }
|
||||
// Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||
// }
|
||||
} else {
|
||||
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
} else {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
@@ -621,63 +546,29 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
lub.setLocationAddress(tempLoca.getAddress());
|
||||
lub.setImageId(imgIds);
|
||||
lub.setWaybillId(wid);
|
||||
lub.setRealLoadTime(tempLoca.getTime());
|
||||
Log.e("--卸货信息", gson.toJson(lub));
|
||||
// if (locationKey) {
|
||||
if (locationKey&&!TextUtils.isEmpty(tempLoca.address)) {
|
||||
if (keys) {
|
||||
if (1==reportAlct){
|
||||
NewLJUtils.getInstance().getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnGDDownloadResultListener() {
|
||||
@Override
|
||||
public void onSuccess(String var1) {
|
||||
if (var1.equals("40")) {//安联装货,单平台未装货
|
||||
//卸货状态-平台
|
||||
isFinish = true;
|
||||
hyr.dischargeCargo(lub);
|
||||
} else {
|
||||
nfc();
|
||||
uploadInfo();
|
||||
}
|
||||
upLocation(tempLoca.getLatitude() + "", tempLoca.getLongitude() + "",sob.getData().getShippingNoteNumber());
|
||||
// NewLJUtils.getInstance().stopLocationService();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showToast(con, var2);
|
||||
}
|
||||
});
|
||||
}else{
|
||||
//卸货状态-平台
|
||||
isFinish = true;
|
||||
upLocation(tempLoca.getLatitude() + "", tempLoca.getLongitude() + "",sob.getData().getShippingNoteNumber());
|
||||
hyr.dischargeCargo(lub);
|
||||
}
|
||||
|
||||
nfc();
|
||||
uploadInfo();
|
||||
|
||||
}
|
||||
|
||||
// } else {
|
||||
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
// customDialog.dismiss();
|
||||
// }
|
||||
// Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||
// }
|
||||
} else {
|
||||
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
} else {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (imgIds != null && imgIds.size() > 0) {//卸货回单
|
||||
//上传回单
|
||||
urib.setLatitude(tempLoca.getLatitude() + "");
|
||||
urib.setLongitude(tempLoca.getLongitude() + "");
|
||||
urib.setLocationAddress(tempLoca.getAddress());
|
||||
urib.setLatitude(lgdu.getLatitude() + "");
|
||||
urib.setLongitude(lgdu.getLongitude() + "");
|
||||
urib.setLocationAddress(lgdu.getAddress());
|
||||
//装卸货类型
|
||||
urib.setType(h_type + 1);
|
||||
//回单id 数组
|
||||
@@ -685,25 +576,17 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
//子运运单ID
|
||||
urib.setWaybillId(wid);
|
||||
Log.e("--回单信息", gson.toJson(urib));
|
||||
// if (locationKey) {
|
||||
if (index == 2 && keys) {
|
||||
if (1==reportAlct){
|
||||
up_trafficSign();
|
||||
}
|
||||
// up_trafficReceipt();
|
||||
// receipt_image();
|
||||
if (locationKey) {
|
||||
if (index == 2 && keys && !TextUtils.isEmpty(tempLoca.address)) {
|
||||
up_trafficSign();
|
||||
up_trafficReceipt();
|
||||
receipt_image();
|
||||
}
|
||||
hyr.receipt(urib);
|
||||
// } else {
|
||||
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
// customDialog.dismiss();
|
||||
// }
|
||||
// Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||
// }
|
||||
} else {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
} else {
|
||||
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
@@ -738,7 +621,7 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
//上传安联-签收
|
||||
public void up_trafficSign() {
|
||||
//安联
|
||||
GDLocation l = new GDLocation();
|
||||
Location l = new Location();
|
||||
l.setBaiduLongitude(tempLocaBd.longitude);
|
||||
l.setBaiduLatitude(tempLocaBd.latitude);
|
||||
l.setLocation(tempLocaBd.getAddress());
|
||||
@@ -762,18 +645,15 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
}
|
||||
}
|
||||
}
|
||||
NewLJUtils.getInstance().sign(con, sob.getData().getShippingNoteNumber(), l, new OnGDResultListener() {
|
||||
MDPLocationCollectionManager.sign(con, sob.getData().getShippingNoteNumber(), l, gs, new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
// NewLJUtils.getInstance().stopLocationService();
|
||||
up_trafficReceipt();
|
||||
receipt_image();
|
||||
Log.e("上报安联", "签收成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
Log.e("上报安联失败(签收):", var1 + var2);
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(签收):", s + s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -781,28 +661,30 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
//上传安联-回单
|
||||
public void up_trafficReceipt() {
|
||||
//安联
|
||||
GDLocation l = new GDLocation();
|
||||
Location l = new Location();
|
||||
l.setBaiduLongitude(tempLocaBd.longitude);
|
||||
l.setBaiduLatitude(tempLocaBd.latitude);
|
||||
l.setLocation(tempLocaBd.getAddress());
|
||||
l.setTime(tempLocaBd.getTime());
|
||||
NewLJUtils.getInstance().pod(con, sob.getData().getShippingNoteNumber(), l, new OnGDResultListener() {
|
||||
MDPLocationCollectionManager.pod(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "回单上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
Log.e("上报安联失败(回单):", var1 + var2);
|
||||
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);
|
||||
GDImage image = new GDImage();
|
||||
Image image = new Image();
|
||||
String base = BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||
image.setFileExt(FileUtil.lastName(file));
|
||||
@@ -811,51 +693,30 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
image.setBaiduLongitude(tempLocaBd.longitude);
|
||||
image.setBaiduLatitude(tempLocaBd.latitude);
|
||||
image.setLocation(tempLocaBd.getAddress());
|
||||
MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||
|
||||
NewLJUtils.getInstance().uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new OnGDResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||
Log.e("上报安联", "装货照片上传成功");
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
Log.e("上报安联失败(装货照片):", var1 + var2);
|
||||
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);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
// 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);
|
||||
GDImage image = new GDImage();
|
||||
Image image = new Image();
|
||||
String base = BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||
image.setFileExt(FileUtil.lastName(file));
|
||||
@@ -864,53 +725,31 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
image.setBaiduLongitude(tempLocaBd.longitude);
|
||||
image.setBaiduLatitude(tempLocaBd.latitude);
|
||||
image.setLocation(tempLocaBd.getAddress());
|
||||
MDPLocationCollectionManager.uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||
|
||||
NewLJUtils.getInstance().uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new OnGDResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||
Log.e("上报安联", "卸货照片上传成功");
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
Log.e("上报安联失败(卸货照片):", var1 + var2);
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
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);
|
||||
}
|
||||
});
|
||||
|
||||
// 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);
|
||||
GDImage image = new GDImage();
|
||||
Image image = new Image();
|
||||
String base = BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||
image.setFileExt(FileUtil.lastName(file));
|
||||
@@ -919,23 +758,24 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
image.setBaiduLongitude(tempLocaBd.longitude);
|
||||
image.setBaiduLatitude(tempLocaBd.latitude);
|
||||
image.setLocation(tempLocaBd.getAddress());
|
||||
NewLJUtils.getInstance().uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new OnGDResultListener() {
|
||||
MDPLocationCollectionManager.uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
SPUtils.remove(con, "curWaybillId");
|
||||
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||
Log.e("上报安联", "回单照片上传成功");
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
Log.e("上报安联失败(回单照片):", var1 + var2);
|
||||
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);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -977,20 +817,19 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
private void loadInfo() {
|
||||
//安联
|
||||
if (sob.getData().getReportAlct() == 1) {
|
||||
GDLocation l = new GDLocation();
|
||||
Location l = new Location();
|
||||
l.setBaiduLongitude(tempLocaBd.longitude);
|
||||
l.setBaiduLatitude(tempLocaBd.latitude);
|
||||
l.setLocation(tempLocaBd.getAddress());
|
||||
l.setTime(tempLocaBd.getTime());
|
||||
NewLJUtils.getInstance().pickUp(con, sob.getData().getShippingNoteNumber(), l, new OnGDResultListener() {
|
||||
MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "装货上传成功");
|
||||
//交通厅
|
||||
// if (sob.getData().getReport() == 1) {
|
||||
// JTTProcess.start(con, sob, "");
|
||||
// }
|
||||
// NewLJUtils.getInstance().startLocationService(ShangChuangImgActivityBC.this);
|
||||
if (sob.getData().getReport() == 1) {
|
||||
JTTProcess.start(con, sob, "");
|
||||
}
|
||||
//装货状态
|
||||
hyr.loading(lub);
|
||||
//装货照片
|
||||
@@ -998,39 +837,11 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
Log.e("上报安联失败(装货):", var1 + var2);
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
new MessageUtils().showCenMessage(con, var2);
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(装货):", s + s1);
|
||||
new MessageUtils().showCenMessage(con, s1);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 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);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1042,72 +853,37 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
|
||||
//安联
|
||||
if (sob.getData().getReportAlct() == 1) {
|
||||
GDLocation l = new GDLocation();
|
||||
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));
|
||||
|
||||
NewLJUtils.getInstance().unload(con, sob.getData().getShippingNoteNumber(), l, new OnGDResultListener() {
|
||||
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "卸货上传成功");
|
||||
//交通厅
|
||||
// if (sob.getData().getReport() == 1) {
|
||||
// JTTProcess.stop(con, sob, "");
|
||||
// }
|
||||
|
||||
if (sob.getData().getReport() == 1) {
|
||||
JTTProcess.stop(con, sob, "");
|
||||
}
|
||||
//卸货状态-平台
|
||||
hyr.dischargeCargo(lub);
|
||||
hyr.dischargeCargo4(lub);
|
||||
//卸货照片-安联
|
||||
up_image();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
Log.e("上报安联失败(卸货):", var1 + var2);
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
new MessageUtils().showCenMessage(con, var2);
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(卸货):", s + s1);
|
||||
// new MessageUtils().showCenMessage(con, s1);
|
||||
//运单状态不一致,平台更新状态
|
||||
hyr.dischargeCargo4(lub);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// 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);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void upLocation(String lat,String lon,String shippingNoteNumber){
|
||||
TrackInputBean tib = new TrackInputBean();
|
||||
tib.setLatitude(lat);
|
||||
tib.setLongitude(lon);
|
||||
tib.setShippingNoteNumber(shippingNoteNumber);
|
||||
hyr.trackTracking(tib);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ public class WebPDFActivity extends BaseActivity {
|
||||
protected void onPostExecute(Void aVoid) {
|
||||
super.onPostExecute(aVoid);
|
||||
pdf_view.fromStream(input[0])
|
||||
// .pages(0,1,2,3,4,5,6,7) // all pages are displayed by default
|
||||
.pages(0,1) // all pages are displayed by default
|
||||
.enableAnnotationRendering(true)
|
||||
.load();
|
||||
}
|
||||
|
||||
@@ -11,14 +11,11 @@ import android.telecom.TelecomManager;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.TextPaint;
|
||||
import android.text.TextUtils;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.text.style.ClickableSpan;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.TextView;
|
||||
@@ -27,15 +24,10 @@ import android.widget.Toast;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.cardview.widget.CardView;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.AppInfoBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.net.BaseObserver;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.net.DataManager;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.net.RxHttpCallBack;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.web.WebOnlyOneActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.NewLJUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickHelper;
|
||||
import com.dahe.mylibrary.net.CommonResponseBean;
|
||||
import com.google.gson.Gson;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
@@ -69,7 +61,6 @@ public class LoginActivity extends BaseActivity {
|
||||
public static final String USER = "user";
|
||||
public static final String USER_TOKEN = "token";
|
||||
public static final String USER_UNAME = "uname";
|
||||
public static final String USER_PHONE = "USER_PHONE";
|
||||
public static final String USER_RNAME = "rname";
|
||||
public static final String USER_ID = "id";
|
||||
|
||||
@@ -80,9 +71,9 @@ public class LoginActivity extends BaseActivity {
|
||||
private LoginBean loginBean;
|
||||
private TimerTask tt;
|
||||
private int timer_sum = 60;
|
||||
private CheckBox cb;
|
||||
private ImageButton agree_btn;
|
||||
private CardView no_btn;
|
||||
private UserRequset ur;
|
||||
private CustomDialog customDialog;
|
||||
|
||||
@Override
|
||||
public void msgMethod(Message m) {
|
||||
@@ -101,45 +92,23 @@ public class LoginActivity extends BaseActivity {
|
||||
Log.e("--短信发送res--", "短信发送成功");
|
||||
}
|
||||
if (CacheGroup.cacheList.get(LOGIN_RESULT) != null) {
|
||||
if (customDialog != null && customDialog.isShowing())
|
||||
customDialog.dismiss();
|
||||
|
||||
btn_login.setEnabled(true);
|
||||
btn_login.setBackgroundResource(R.drawable.bg_btn);
|
||||
//存储登录记录
|
||||
loginBean = new Gson().fromJson(CacheGroup.cacheList.get(LOGIN_RESULT), LoginBean.class);
|
||||
Log.e("--登录信息--", new Gson().toJson(loginBean));
|
||||
AppInfoBean appInfoBean = new AppInfoBean();
|
||||
if (loginBean.getCode() == 200) {
|
||||
//获取新路交token
|
||||
NewLJUtils.getInstance().getToken(con);
|
||||
SPUtil.insSP(con, USER, USER_TOKEN, loginBean.getData().getToken());
|
||||
SPUtil.insSP(con, USER, USER_UNAME, loginBean.getData().getUname());
|
||||
SPUtil.insSP(con, USER, USER_PHONE, loginBean.getData().getRegisterPhone());
|
||||
SPUtil.insSP(con, USER, USER_RNAME, loginBean.getData().getRname());
|
||||
SPUtil.insSP(con, USER, USER_ID, loginBean.getData().getId() + "");
|
||||
// JPushInterface.setAlias(con, 0, loginBean.getData().getUname());
|
||||
appInfoBean.setStatus("0");
|
||||
appInfoBean.setUserPhone(String.valueOf(input_phone.getText()));
|
||||
ur.postAppInfo(appInfoBean, "post");
|
||||
JPushInterface.setAlias(con, 0, loginBean.getData().getUname());
|
||||
UiAuxiliary.homeRequest("登录成功");
|
||||
finish();
|
||||
} else {
|
||||
appInfoBean.setStatus("1");
|
||||
appInfoBean.setUserPhone(String.valueOf(input_phone.getText()));
|
||||
ur.postAppInfo(appInfoBean, "post");
|
||||
Toast.makeText(con, loginBean.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove(LOGIN_RESULT);
|
||||
}
|
||||
break;
|
||||
|
||||
case RequsetCodeConstants.ERROR:
|
||||
if (customDialog != null && customDialog.isShowing())
|
||||
customDialog.dismiss();
|
||||
btn_login.setEnabled(true);
|
||||
btn_login.setBackgroundResource(R.drawable.bg_btn);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -156,12 +125,9 @@ public class LoginActivity extends BaseActivity {
|
||||
input_phone = findViewById(R.id.input_phone);
|
||||
input_code = findViewById(R.id.input_code);
|
||||
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);
|
||||
String phone = SPUtil.getSP(con, LoginActivity.USER, LoginActivity.USER_PHONE);
|
||||
if (!TextUtils.isEmpty(phone)){
|
||||
input_phone.setText(phone);
|
||||
}
|
||||
initView(null);
|
||||
}
|
||||
|
||||
@@ -173,18 +139,21 @@ public class LoginActivity extends BaseActivity {
|
||||
@Override
|
||||
public void initView(Object obj) {
|
||||
super.initView(obj);
|
||||
cb.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
if (isChecked) {
|
||||
key = true;
|
||||
} else {
|
||||
key = false;
|
||||
}
|
||||
agree_btn.setOnClickListener(v -> {
|
||||
agree_btn.setVisibility(View.GONE);
|
||||
no_btn.setVisibility(View.VISIBLE);
|
||||
key = false;
|
||||
});
|
||||
no_btn.setOnClickListener(v -> {
|
||||
agree_btn.setVisibility(View.VISIBLE);
|
||||
no_btn.setVisibility(View.GONE);
|
||||
key = true;
|
||||
|
||||
});
|
||||
ConfigBean cb = ConfigParts.getConfigParts(con);
|
||||
if (cb != null) {
|
||||
url1 = "https://agreement.dahehuoyun.com/#/user";
|
||||
url2 = "https://agreement.dahehuoyun.com/currency/#/";
|
||||
url1 = cb.getData().getUserUrl();
|
||||
url2 = "http://agreement.dahehuoyun.com/currency/#/";
|
||||
}
|
||||
TextView tv_content = findViewById(R.id.tv_content);
|
||||
String str = "我已阅读并同意相关服务条款和隐私政策《用户服务协议》和《隐私政策》";
|
||||
@@ -197,7 +166,7 @@ public class LoginActivity extends BaseActivity {
|
||||
public void onClick(View widget) {
|
||||
Log.e("-用户服务协议-", url1);
|
||||
//用户服务协议点击事件
|
||||
Intent in = new Intent(con, WebOnlyOneActivity.class);
|
||||
Intent in = new Intent(con, WebActivity.class);
|
||||
in.putExtra("title", "用户服务协议");
|
||||
in.putExtra("url", url1);
|
||||
startActivity(in);
|
||||
@@ -217,7 +186,7 @@ public class LoginActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onClick(View widget) {
|
||||
//隐私协议点击事件
|
||||
Intent in = new Intent(con, WebOnlyOneActivity.class);
|
||||
Intent in = new Intent(con, WebActivity.class);
|
||||
in.putExtra("title", "隐私政策");
|
||||
in.putExtra("url", url2);
|
||||
startActivity(in);
|
||||
@@ -252,16 +221,12 @@ public class LoginActivity extends BaseActivity {
|
||||
}
|
||||
}
|
||||
});
|
||||
btn_login.setOnClickListener(new OnLimitClickHelper(v -> {
|
||||
btn_login.setOnClickListener(v -> {
|
||||
String phone = String.valueOf(input_phone.getText());
|
||||
String code = String.valueOf(input_code.getText());
|
||||
Log.e("--code--", code);
|
||||
if (judgeFormat(phone, code)) {
|
||||
if (key) {
|
||||
btn_login.setEnabled(false);
|
||||
btn_login.setBackgroundResource(R.drawable.bg_btn_gray);
|
||||
customDialog = new CustomDialog(con, "登陆中...");
|
||||
customDialog.show();
|
||||
LoginRegInputBean lb = new LoginRegInputBean();
|
||||
lb.setRoleId(4);
|
||||
lb.setUname(phone);
|
||||
@@ -273,7 +238,7 @@ public class LoginActivity extends BaseActivity {
|
||||
Toast.makeText(con, "请先同意用户协议和隐私政策", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
}));
|
||||
});
|
||||
auto_login.setOnClickListener(v -> {
|
||||
JVerificationInterface.getToken(con, 20000, (i, s, s1) -> {
|
||||
JVerifyUIConfig uiConfig = new JVerifyUIConfig.Builder()
|
||||
|
||||
@@ -30,12 +30,10 @@ import androidx.core.app.ActivityCompat;
|
||||
|
||||
import com.alct.mdp.MDPLocationCollectionManager;
|
||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.AppInfoBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.ImageConfig;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.UserRequset;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.UiAuxiliary;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.business.BusinessActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||
@@ -140,17 +138,16 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
||||
new XPopup.Builder(con)
|
||||
.dismissOnBackPressed(false)
|
||||
.dismissOnTouchOutside(false)
|
||||
.asCustom(new AgreementAlert(con, "https://agreement.dahehuoyun.com/currency/#/",
|
||||
"https://agreement.dahehuoyun.com/#/user", hd))
|
||||
.asCustom(new AgreementAlert(con, "http://agreement.dahehuoyun.com/currency/#/",
|
||||
"http://agreement.dahehuoyun.com/rule/serviceAgreement/dist/index.html#/", hd))
|
||||
.show();
|
||||
}
|
||||
if (WelcomeActivity.this!=null&&!WelcomeActivity.this.isFinishing()){
|
||||
Glide.with(con)
|
||||
.load(SPUtils.getPreWelPic(this))
|
||||
.placeholder(startImageUrl.getDrawable())
|
||||
.error(R.drawable.welcome_bg_default)
|
||||
.into(startImageUrl);
|
||||
}
|
||||
Glide.with(con)
|
||||
.load(SPUtils.getPreWelPic(this))
|
||||
.placeholder(startImageUrl.getDrawable())
|
||||
.error(R.drawable.welcome_bg_default)
|
||||
.into(startImageUrl);
|
||||
|
||||
//SystemUtil.get
|
||||
}
|
||||
|
||||
@@ -162,16 +159,6 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
||||
initRequest();
|
||||
}
|
||||
}, 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[]{
|
||||
// Manifest.permission.ACCESS_FINE_LOCATION,
|
||||
@@ -293,12 +280,10 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
||||
|
||||
public void cdWelcome(String url) {
|
||||
if (!"".equals(url)) {
|
||||
if (WelcomeActivity.this!=null&&!WelcomeActivity.this.isFinishing()){
|
||||
Glide.with(con).load(url)
|
||||
.placeholder(startImageUrl.getDrawable())
|
||||
.error(R.drawable.welcome_bg_default)
|
||||
.into(startImageUrl);
|
||||
}
|
||||
Glide.with(con).load(url)
|
||||
.placeholder(startImageUrl.getDrawable())
|
||||
.error(R.drawable.welcome_bg_default)
|
||||
.into(startImageUrl);
|
||||
}
|
||||
SPUtils.setPreWelPic(this, url);
|
||||
cd_view.setVisibility(View.VISIBLE);
|
||||
@@ -346,8 +331,8 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
//在使用SDK各组件之前初始化context信息,传入ApplicationContext
|
||||
// 路由初始化
|
||||
// JVerificationInterface.setDebugMode(true);
|
||||
// JVerificationInterface.init(con, 5000, (code, msg) -> Log.d("tag", "code = " + code + " msg = " + msg));
|
||||
JVerificationInterface.setDebugMode(true);
|
||||
JVerificationInterface.init(con, 5000, (code, msg) -> Log.d("tag", "code = " + code + " msg = " + msg));
|
||||
//友盟
|
||||
//设置非debug版本开启
|
||||
if (!isDebugVersion(con)) {
|
||||
|
||||
@@ -17,19 +17,15 @@ import android.widget.Toast;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.UpAppBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.PersonEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.RefreshCarListEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.VehicleEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.StartOrderParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.alert.UpAppAlert;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.business.BusinessActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.PicturlUtil;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.dahe.mylibrary.utils.ImageLoader;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
|
||||
@@ -52,7 +48,6 @@ import com.permissionx.guolindev.PermissionX;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -98,25 +93,6 @@ public class MyFragment extends BaseFragment {
|
||||
}
|
||||
CacheGroup.cacheList.remove("userdata");
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("up_app") != null) {
|
||||
Log.e("up_app", CacheGroup.cacheList.get("up_app"));
|
||||
UpAppBean uab = new Gson().fromJson(CacheGroup.cacheList.get("up_app"), UpAppBean.class);
|
||||
if (uab.getCode() == 200) {
|
||||
if (uab.getData() != null) {
|
||||
new XPopup.Builder(con)
|
||||
.dismissOnBackPressed(false)
|
||||
.dismissOnTouchOutside(false)
|
||||
.asCustom(new UpAppAlert(con, uab.getData().getDownloadUrl(), uab.getData().getContent(), uab.getData().getVersion(), uab.getData().getForce()))
|
||||
.show();
|
||||
}else{
|
||||
Toast.makeText(con, "当前已经是最新版本", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}else{
|
||||
Toast.makeText(con, uab.getMsg(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove("up_app");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -286,10 +262,7 @@ public class MyFragment extends BaseFragment {
|
||||
startActivity(in);
|
||||
});
|
||||
//检查更新
|
||||
onUpdate.setOnClickListener(v -> {
|
||||
ur.upApp();
|
||||
}
|
||||
);
|
||||
onUpdate.setOnClickListener(v -> Toast.makeText(con, "当前已经是最新版本", Toast.LENGTH_LONG).show());
|
||||
//系统设置
|
||||
onSetUp.setOnClickListener(v -> startActivity(new Intent(con, SetupActivity.class)));
|
||||
}
|
||||
@@ -307,28 +280,15 @@ public class MyFragment extends BaseFragment {
|
||||
|
||||
}
|
||||
if (!"".equals(userBean.getData().getHeadportraitUrl())) {
|
||||
ImageLoader.getInstance().loadImage(con,userBean.getData().getHeadportraitUrl(),img_head);
|
||||
Glide.with(con).load(userBean.getData().getHeadportraitUrl()).into(img_head);
|
||||
}
|
||||
|
||||
if (userBean != null) {
|
||||
if ("0".equals(userBean.getData().getRealAuthentication())) {
|
||||
no_auth.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
if (100003 == userBean.getData().getAuditStatus()) {
|
||||
no_auth.setVisibility(View.GONE);
|
||||
} else {
|
||||
no_auth.setBackgroundResource(R.mipmap.icon_auth_wsh);
|
||||
}
|
||||
}
|
||||
if (userBean != null && 100003 == userBean.getData().getAuditStatus()) {
|
||||
auth_box.setVisibility(View.GONE);
|
||||
no_auth.setVisibility(View.GONE);
|
||||
} else {
|
||||
auth_box.setVisibility(View.GONE);
|
||||
no_auth.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
// if (userBean != null && 100003 == userBean.getData().getAuditStatus()) {
|
||||
// auth_box.setVisibility(View.GONE);
|
||||
// no_auth.setVisibility(View.GONE);
|
||||
// } else {
|
||||
// auth_box.setVisibility(View.GONE);
|
||||
// no_auth.setVisibility(View.VISIBLE);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -346,19 +306,11 @@ public class MyFragment extends BaseFragment {
|
||||
ur.vehicleList("1");
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
@Subscribe
|
||||
public void personResult(PersonEvent home) {
|
||||
Log.e("-res-", home.getMessage());
|
||||
if (ur != null) {
|
||||
ur.User();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
if (ur != null) {
|
||||
ur.User();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ import android.widget.Toast;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.web.WebOnlyOneActivity;
|
||||
import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
@@ -74,9 +73,9 @@ public class SetupActivity extends BaseActivity {
|
||||
ConfigBean cb= ConfigParts.getConfigParts(con);
|
||||
if(cb!=null){
|
||||
// url1=cb.getData().getUserUrl();
|
||||
url1="https://agreement.dahehuoyun.com/rule/serviceAgreement/dist/index.html#/";
|
||||
url1="http://agreement.dahehuoyun.com/rule/serviceAgreement/dist/index.html#/";
|
||||
// url2=cb.getData().getPrivateUrl();
|
||||
url2="https://agreement.dahehuoyun.com/currency/#/";
|
||||
url2="http://agreement.dahehuoyun.com/currency/#/";
|
||||
kefu=cb.getData().getServiceMobile();
|
||||
url3=cb.getData().getSecurityUrl();
|
||||
}
|
||||
@@ -95,19 +94,19 @@ public class SetupActivity extends BaseActivity {
|
||||
public void initView(Object obj) {
|
||||
super.initView(obj);
|
||||
r1.setOnClickListener(v12 -> {
|
||||
Intent in=new Intent(con, WebOnlyOneActivity.class);
|
||||
Intent in=new Intent(con,WebActivity.class);
|
||||
in.putExtra("title","隐私政策");
|
||||
in.putExtra("url",url2);
|
||||
startActivity(in);
|
||||
});
|
||||
r2.setOnClickListener(v12 -> {
|
||||
Intent in=new Intent(con,WebOnlyOneActivity.class);
|
||||
Intent in=new Intent(con,WebActivity.class);
|
||||
in.putExtra("title","用户协议");
|
||||
in.putExtra("url",url1);
|
||||
startActivity(in);
|
||||
});
|
||||
r3.setOnClickListener(v12 -> {
|
||||
Intent in=new Intent(con,WebOnlyOneActivity.class);
|
||||
Intent in=new Intent(con,WebActivity.class);
|
||||
in.putExtra("title","运输安全责任书");
|
||||
in.putExtra("url",url3);
|
||||
startActivity(in);
|
||||
@@ -122,14 +121,14 @@ public class SetupActivity extends BaseActivity {
|
||||
startActivity(in);
|
||||
});
|
||||
r8.setOnClickListener(v12 -> {
|
||||
Intent in=new Intent(con,WebOnlyOneActivity.class);
|
||||
Intent in=new Intent(con,WebActivity.class);
|
||||
in.putExtra("title","交易规则");
|
||||
in.putExtra("url","http://agreement.dahehuoyun.com/rule/transactionRules/dist/index.html#/");
|
||||
startActivity(in);
|
||||
});
|
||||
r6.setOnClickListener(v12 -> {
|
||||
String[] title={"平台客服:"+kefu};
|
||||
String[] value={kefu};
|
||||
String[] title={"平台客服:"+kefu,"银行客服:95528","技术咨询:13460042961"};
|
||||
String[] value={kefu,"95528","13460042961"};
|
||||
new XPopup.Builder(con)
|
||||
.isDarkTheme(false)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||
|
||||
+13
-110
@@ -13,18 +13,9 @@ import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.DriverAuthDataBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.UploadBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.AuthRequest;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.UserRequset;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.my.WoDeFragment;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickHelper;
|
||||
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickListener;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.dahe.mylibrary.utils.ImageLoader;
|
||||
import com.google.gson.Gson;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
||||
@@ -42,8 +33,6 @@ import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
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.util.List;
|
||||
@@ -58,17 +47,13 @@ public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClic
|
||||
|
||||
private ImageView up_bank_img;
|
||||
private EditText bank_name, bank_number;
|
||||
private TextView submit, skip;
|
||||
private TextView submit;
|
||||
private ImageView return_btn;
|
||||
public GetImageAlert gia = new GetImageAlert();
|
||||
String path;
|
||||
private OCRBankBean ib;
|
||||
DriverAuthDataBean dad;
|
||||
|
||||
boolean isAuth = false;
|
||||
private WalletRequest qr;
|
||||
private TextView tp;
|
||||
private String imageId;
|
||||
|
||||
@Override
|
||||
public void msgMethod(Message m) {
|
||||
@@ -77,45 +62,19 @@ public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClic
|
||||
case RequsetCodeConstants.SUCCESS:
|
||||
if (CacheGroup.cacheList.get("OCR_BANK") != null) {
|
||||
ib = new Gson().fromJson(CacheGroup.cacheList.get("OCR_BANK"), OCRBankBean.class);
|
||||
customDialog.dismiss();
|
||||
if (ib.getCode() == 200&&ib.getData()!=null) {
|
||||
if (ib.getCode() == 200) {
|
||||
initView(null);
|
||||
customDialog.dismiss();
|
||||
WalletFragment.isInsBank = true;
|
||||
} else {
|
||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(con, ib.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove("OCR_BANK");
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get(WoDeFragment.AUTH_DATA) != null) {
|
||||
dad = new Gson().fromJson(CacheGroup.cacheList.get(WoDeFragment.AUTH_DATA), DriverAuthDataBean.class);
|
||||
if (dad.getCode() == 200) {
|
||||
if (dad.getData() != null && !TextUtils.isEmpty(dad.getData().getCardNo())) {
|
||||
isAuth = true;
|
||||
skip.setVisibility(View.GONE);
|
||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||
bank_name.setText(dad.getData().getBankName());
|
||||
bank_number.setText(dad.getData().getCardNo());
|
||||
ImageLoader.getInstance().loadImage(con,dad.getData().getBankImgUrl(),up_bank_img);
|
||||
}
|
||||
|
||||
} else {
|
||||
Toast.makeText(con, dad.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove(WoDeFragment.AUTH_DATA);
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("insBank") != null) {
|
||||
if (customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
BaseBean bb = new Gson().fromJson(CacheGroup.cacheList.get("insBank"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
if (type == 1) {
|
||||
Intent in = new Intent(con, CertificatesActivity.class);
|
||||
in.putExtra("index", 1);
|
||||
startActivity(in);
|
||||
}
|
||||
customDialog.dismiss();
|
||||
Toast.makeText(con, "绑定成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
} else {
|
||||
@@ -123,39 +82,18 @@ public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClic
|
||||
}
|
||||
CacheGroup.cacheList.remove("insBank");
|
||||
}
|
||||
if (CacheGroup.cacheList.get("upload") != null) {
|
||||
UploadBean ub = new Gson().fromJson(CacheGroup.cacheList.get("upload"), UploadBean.class);
|
||||
if (ub.getCode() == 200) {
|
||||
imageId = ub.getData().getId()+"";
|
||||
new OCRRequest().ORCBankZj(con, hd, ub.getData().getUrl());
|
||||
|
||||
} else {
|
||||
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove("upload");
|
||||
}
|
||||
break;
|
||||
case ImageFileCompressUtil.COMPRESS_SUCCESS:
|
||||
customDialog = new CustomDialog(con, "上传识别中...");
|
||||
customDialog.show();
|
||||
path = (String) m.obj;
|
||||
|
||||
new AuthRequest().upload(con, hd, new File(path));
|
||||
|
||||
// new OCRRequest().ORCBank(con, hd, new File(path));
|
||||
new OCRRequest().ORCBank(con, hd, new File(path));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private CustomDialog customDialog;
|
||||
|
||||
|
||||
/**
|
||||
* 1:司机注册自动跳转
|
||||
* 0:钱包添加银行卡
|
||||
*/
|
||||
private int type = 0;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -163,47 +101,27 @@ public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClic
|
||||
setContentView(R.layout.activity_bank_auth);
|
||||
act = this;
|
||||
con = this;
|
||||
Bundle extras = getIntent().getExtras();
|
||||
if (extras != null) {
|
||||
type = getIntent().getExtras().getInt("type");
|
||||
}
|
||||
up_bank_img = findViewById(R.id.up_bank_img);
|
||||
bank_name = findViewById(R.id.bank_name);
|
||||
bank_number = findViewById(R.id.bank_number);
|
||||
submit = findViewById(R.id.submit);
|
||||
skip = findViewById(R.id.skip);
|
||||
return_btn = findViewById(R.id.return_btn);
|
||||
qr = new WalletRequest(con, hd);
|
||||
up_bank_img.setOnClickListener(v -> {
|
||||
if (isAuth) {
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(up_bank_img, dad.getData().getBankImgUrl(), new SmartGlideImageLoader(R.mipmap.ic_launcher_round))
|
||||
.show();
|
||||
} else {
|
||||
gia.showPopueWindow(this);
|
||||
}
|
||||
gia.showPopueWindow(this);
|
||||
});
|
||||
submit.setOnClickListener(new OnLimitClickHelper(this));
|
||||
skip.setOnClickListener(new OnLimitClickHelper(this));
|
||||
return_btn.setOnClickListener(v -> {
|
||||
finish();
|
||||
});
|
||||
|
||||
if (type == 1) {
|
||||
skip.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
skip.setVisibility(View.GONE);
|
||||
}
|
||||
UserRequset ur = new UserRequset(con, hd);
|
||||
ur.driverAuthData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView(Object obj) {
|
||||
super.initView(obj);
|
||||
bank_name.setText(ib.getData().getBankName());
|
||||
bank_number.setText(ib.getData().getCardNumber());
|
||||
ImageLoader.getInstance().loadImage(con,path,up_bank_img);
|
||||
bank_number.setText(ib.getData().getBankCardNumber());
|
||||
Glide.with(con).load(ib.getData().getUrl()).into(up_bank_img);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -232,21 +150,20 @@ public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClic
|
||||
}
|
||||
|
||||
public void submit() {
|
||||
customDialog = new CustomDialog(con, "上传中,请稍后...");
|
||||
customDialog.show();
|
||||
String bankName = bank_name.getText().toString().trim();
|
||||
String bankNumber = bank_number.getText().toString().trim();
|
||||
if ("".equals(bankName) || "".equals(bankNumber)) {
|
||||
Toast.makeText(con, "请先补充完整的银行卡信息", Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
customDialog = new CustomDialog(con, "上传中,请稍后...");
|
||||
customDialog.show();
|
||||
InsBankInputBean ibib = new InsBankInputBean();
|
||||
ibib.setCardNo(bankNumber);
|
||||
// ibib.setCardType(Integer.parseInt(ib.getData().getType()));
|
||||
ibib.setCardType(1);
|
||||
ibib.setCardType(Integer.parseInt(ib.getData().getBankCardType()));
|
||||
ibib.setBankName(bankName);
|
||||
ibib.setCardUserType(1);
|
||||
ibib.setImageId(Integer.parseInt(imageId));
|
||||
ibib.setImageId(ib.getData().getId());
|
||||
Log.e("-res-", new Gson().toJson(ibib));
|
||||
qr.insBankCard(ibib);
|
||||
}
|
||||
@@ -255,26 +172,12 @@ public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClic
|
||||
public void onClick(View view) {
|
||||
switch (view.getId()) {
|
||||
case R.id.submit:
|
||||
if (isAuth) {
|
||||
Intent in = new Intent(con, CertificatesActivity.class);
|
||||
in.putExtra("index", 1);
|
||||
startActivity(in);
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
if (ib != null) {
|
||||
submit();
|
||||
} else {
|
||||
Toast.makeText(con, "请先上传图片", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
case R.id.skip:
|
||||
new MessageUtils().showSimCenPop(con, "确定跳过银行卡?,可能会导致运费无法结算!", "取消", "确认", () -> {
|
||||
Intent in = new Intent(con, CertificatesActivity.class);
|
||||
in.putExtra("index", 1);
|
||||
startActivity(in);
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,6 @@ import android.widget.Toast;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.event.VehicleEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.WalletEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||
import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
@@ -34,8 +32,6 @@ import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseFragment;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
|
||||
@@ -127,7 +123,6 @@ public class WalletFragment extends BaseFragment{
|
||||
@Override
|
||||
public View onCreateView(@NonNull @NotNull LayoutInflater inflater, @Nullable @org.jetbrains.annotations.Nullable ViewGroup container, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
|
||||
root=inflater.inflate(R.layout.fragmengt_qianbao,container,false);
|
||||
EventBus.getDefault().register(this);
|
||||
dataName2="bcb";
|
||||
con=root.getContext();
|
||||
rv=root.findViewById(R.id.rv);
|
||||
@@ -236,7 +231,6 @@ public class WalletFragment extends BaseFragment{
|
||||
bank_remove.setVisibility(View.VISIBLE);
|
||||
} else{
|
||||
bank_number.setVisibility(View.GONE);
|
||||
bank_title_1.setText("未添加银行卡");
|
||||
bank_add.setVisibility(View.VISIBLE);
|
||||
bank_remove.setVisibility(View.GONE);
|
||||
}
|
||||
@@ -322,14 +316,5 @@ public class WalletFragment extends BaseFragment{
|
||||
// .show();
|
||||
// }
|
||||
|
||||
@Subscribe
|
||||
public void processResult(WalletEvent event) {
|
||||
Log.e("-msg-", event.getMessage());
|
||||
refreshLayout.autoRefresh();
|
||||
}
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,12 +5,9 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.net.http.SslError;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.webkit.JavascriptInterface;
|
||||
import android.webkit.SslErrorHandler;
|
||||
import android.webkit.WebResourceRequest;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
@@ -84,11 +81,6 @@ public class WebActivity extends BaseActivity {
|
||||
webSettings.setJavaScriptEnabled(true);
|
||||
webSettings.setDomStorageEnabled(true);
|
||||
webSettings.setDefaultTextEncodingName("utf-8");
|
||||
// 特别注意:5.1以上默认禁止了https和http混用,以下方式是开启
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||
}
|
||||
|
||||
wv.addJavascriptInterface(new JavaScriptObject(con), "webObj");
|
||||
//PaxWebChromeClient chromeClient=new PaxWebChromeClient();
|
||||
//WebView加载web资源
|
||||
@@ -119,12 +111,6 @@ public class WebActivity extends BaseActivity {
|
||||
wv.loadUrl(url);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
|
||||
super.onReceivedSslError(view, handler, error);
|
||||
handler.proceed();
|
||||
}
|
||||
});
|
||||
wv.setWebChromeClient(chromeClient);
|
||||
wv.loadUrl(url);
|
||||
@@ -163,12 +149,6 @@ public class WebActivity extends BaseActivity {
|
||||
view.loadUrl(url);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
|
||||
super.onReceivedSslError(view, handler, error);
|
||||
handler.proceed();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -203,8 +183,7 @@ public class WebActivity extends BaseActivity {
|
||||
|
||||
@JavascriptInterface
|
||||
public String getUserToken(){
|
||||
// Log.e("-token-",UserParts.getUser(con).getData().getToken());
|
||||
// return "woshitoken-androidfasdf";
|
||||
Log.e("-token-",UserParts.getUser(con).getData().getToken());
|
||||
return UserParts.getUser(con).getData().getToken();
|
||||
}
|
||||
|
||||
@@ -212,11 +191,7 @@ public class WebActivity extends BaseActivity {
|
||||
public void isSuccess(){
|
||||
finish();
|
||||
}
|
||||
@JavascriptInterface
|
||||
public void isPdfSuccess(){
|
||||
Toast.makeText(con, "签署成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,227 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.web;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.net.http.SslError;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.webkit.JavascriptInterface;
|
||||
import android.webkit.SslErrorHandler;
|
||||
import android.webkit.WebResourceRequest;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.UserBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.PaxWebChromeClient;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
||||
|
||||
/**
|
||||
* @author hlh
|
||||
* @version 1.0.0
|
||||
* @date 2021/8/6 16:48
|
||||
* @description:访问webview的activity
|
||||
*/
|
||||
public class WebOnlyOneActivity extends BaseActivity {
|
||||
|
||||
private String url = "";
|
||||
private String title = "";
|
||||
private WebView wv;
|
||||
private TextView title_tv;
|
||||
private PaxWebChromeClient chromeClient;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
StateStyleUtil.stateTextColor(this);
|
||||
setContentView(R.layout.activity_web);
|
||||
con = this;
|
||||
initHardwareAccelerate();
|
||||
wv = findViewById(R.id.wv);
|
||||
title_tv = findViewById(R.id.title);
|
||||
Intent in = getIntent();
|
||||
url = in.getExtras().getString("url");
|
||||
title = in.getExtras().getString("title");
|
||||
chromeClient = new PaxWebChromeClient(this, null, null);
|
||||
if ("咨询建议".equals(title)) {
|
||||
initOpinion();
|
||||
} else {
|
||||
initView(null);
|
||||
}
|
||||
}
|
||||
|
||||
private void initHardwareAccelerate() {
|
||||
try {
|
||||
if (Integer.parseInt(Build.VERSION.SDK) >= 11) {
|
||||
getWindow()
|
||||
.setFlags(
|
||||
android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
|
||||
android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint({"JavascriptInterface", "SetJavaScriptEnabled"})
|
||||
@Override
|
||||
public void initView(Object obj) {
|
||||
super.initView(obj);
|
||||
WebSettings webSettings = wv.getSettings();
|
||||
//设置网页有缓存的时候也继续读取新的地址
|
||||
webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
|
||||
webSettings.setJavaScriptEnabled(true);
|
||||
webSettings.setDomStorageEnabled(true);
|
||||
webSettings.setDefaultTextEncodingName("utf-8");
|
||||
// 特别注意:5.1以上默认禁止了https和http混用,以下方式是开启
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||
}
|
||||
|
||||
wv.addJavascriptInterface(new JavaScriptObject(con), "webObj");
|
||||
//PaxWebChromeClient chromeClient=new PaxWebChromeClient();
|
||||
//WebView加载web资源
|
||||
//覆盖WebView默认使用第三方或系统默认浏览器打开网页的行为,使网页用WebView打开
|
||||
wv.setWebViewClient(new WebViewClient() {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
|
||||
return super.shouldOverrideUrlLoading(view, request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url1) {
|
||||
//返回值是true的时候控制去WebView打开,为false调用系统浏览器或第三方浏览器
|
||||
Log.d("test", "webactivity..url:" + url);
|
||||
// if(!url.startsWith("http"))
|
||||
// {
|
||||
// Log.d("test","非http开头..url:"+url);
|
||||
// Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse(url));
|
||||
// boolean isInstall = getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY).size()>0;
|
||||
// Log.d("test","是否安装要跳转的app:"+isInstall);
|
||||
// if(isInstall)
|
||||
// {
|
||||
// startActivity(intent);
|
||||
// finish();
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
if (!url1.equals(url))
|
||||
return true;
|
||||
wv.loadUrl(url1);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
|
||||
super.onReceivedSslError(view, handler, error);
|
||||
handler.proceed();
|
||||
}
|
||||
});
|
||||
wv.setWebChromeClient(chromeClient);
|
||||
wv.loadUrl(url);
|
||||
title_tv.setText(title);
|
||||
}
|
||||
|
||||
public void initOpinion() {
|
||||
if (findViewById(R.id.return_btn) != null) {
|
||||
findViewById(R.id.return_btn).setOnClickListener(v -> {
|
||||
finish();
|
||||
});
|
||||
}
|
||||
title_tv.setText(title);
|
||||
UserBean ub = UserParts.getUser(con);
|
||||
wv.getSettings().setJavaScriptEnabled(true);
|
||||
wv.getSettings().setDomStorageEnabled(true); // 这个要加上
|
||||
String openid = ub.getData().getUname(); // 用户的openid
|
||||
String nickname = StringUtil.isNull(ub.getData().getRname(), "游客"); // 用户的nickname
|
||||
String headimgurl = StringUtil.isNull(ub.getData().getHeadportraitUrl(), ""); // 用户的头像url
|
||||
|
||||
/* 获得 webview url,请注意url单词是product而不是products,products是旧版本的参数,用错地址将不能成功提交 */
|
||||
String url = "https://support.qq.com/products/335639"; // 把1221数字换成你的产品ID,否则会不成功
|
||||
/* 准备post参数 */
|
||||
String postData = "nickname=" + nickname + "&avatar=" + headimgurl + "&openid=" + openid;
|
||||
wv.postUrl(url, postData.getBytes());
|
||||
wv.setWebChromeClient(chromeClient);
|
||||
wv.setWebViewClient(new WebViewClient() {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
|
||||
return super.shouldOverrideUrlLoading(view, request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
//返回值是true的时候控制去WebView打开,为false调用系统浏览器或第三方浏览器
|
||||
view.loadUrl(url);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
|
||||
super.onReceivedSslError(view, handler, error);
|
||||
handler.proceed();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
|
||||
chromeClient.onActivityResult(requestCode, resultCode, data);
|
||||
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
|
||||
public class JavaScriptObject {
|
||||
|
||||
Context mContxt;
|
||||
|
||||
public JavaScriptObject(Context mContxt) {
|
||||
this.mContxt = mContxt;
|
||||
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void getName() {
|
||||
Log.e("eeee-", "name");
|
||||
Toast.makeText(con, "hello", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public String getUserToken() {
|
||||
// Log.e("-token-",UserParts.getUser(con).getData().getToken());
|
||||
// return "woshitoken-androidfasdf";
|
||||
return UserParts.getUser(con).getData().getToken();
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void isSuccess() {
|
||||
finish();
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void isPdfSuccess() {
|
||||
Toast.makeText(con, "签署成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,240 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.util;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.FileUtils;
|
||||
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
|
||||
/**
|
||||
* @ClassName FileIOUtils
|
||||
* @Author john
|
||||
* @Date 2024/3/29 09:50
|
||||
* @Description TODO
|
||||
*/
|
||||
public class FileIOUtils {
|
||||
|
||||
private FileIOUtils() {
|
||||
throw new UnsupportedOperationException("u can't instantiate me...");
|
||||
}
|
||||
|
||||
private static final String LINE_SEP = System.getProperty("line.separator");
|
||||
|
||||
/**
|
||||
* 将输入流写入文件
|
||||
*
|
||||
* @param filePath 路径
|
||||
* @param is 输入流
|
||||
* @return {@code true}: 写入成功<br>{@code false}: 写入失败
|
||||
*/
|
||||
public static boolean writeFileFromIS(String filePath, final InputStream is) {
|
||||
return writeFileFromIS(FileUtils.getFileByPath(filePath), is, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将输入流写入文件
|
||||
*
|
||||
* @param filePath 路径
|
||||
* @param is 输入流
|
||||
* @param append 是否追加在文件末
|
||||
* @return {@code true}: 写入成功<br>{@code false}: 写入失败
|
||||
*/
|
||||
public static boolean writeFileFromIS(String filePath, final InputStream is, boolean append) {
|
||||
return writeFileFromIS(FileUtils.getFileByPath(filePath), is, append);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将输入流写入文件
|
||||
*
|
||||
* @param file 文件
|
||||
* @param is 输入流
|
||||
* @return {@code true}: 写入成功<br>{@code false}: 写入失败
|
||||
*/
|
||||
public static boolean writeFileFromIS(File file, final InputStream is) {
|
||||
return writeFileFromIS(file, is, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将输入流写入文件
|
||||
*
|
||||
* @param file 文件
|
||||
* @param is 输入流
|
||||
* @param append 是否追加在文件末
|
||||
* @return {@code true}: 写入成功<br>{@code false}: 写入失败
|
||||
*/
|
||||
public static boolean writeFileFromIS(File file, final InputStream is, boolean append) {
|
||||
if (!FileUtils.createOrExistsFile(file) || is == null) return false;
|
||||
OutputStream os = null;
|
||||
try {
|
||||
os = new BufferedOutputStream(new FileOutputStream(file, append));
|
||||
byte data[] = new byte[1024];
|
||||
int len;
|
||||
while ((len = is.read(data, 0, 1024)) != -1) {
|
||||
os.write(data, 0, len);
|
||||
}
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
} finally {
|
||||
try {
|
||||
is.close();
|
||||
os.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 将字符串写入文件
|
||||
*
|
||||
* @param filePath 文件路径
|
||||
* @param content 写入内容
|
||||
* @return {@code true}: 写入成功<br>{@code false}: 写入失败
|
||||
*/
|
||||
public static boolean writeFileFromString(String filePath, String content) {
|
||||
return writeFileFromString(FileUtils.getFileByPath(filePath), content, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将字符串写入文件
|
||||
*
|
||||
* @param filePath 文件路径
|
||||
* @param content 写入内容
|
||||
* @param append 是否追加在文件末
|
||||
* @return {@code true}: 写入成功<br>{@code false}: 写入失败
|
||||
*/
|
||||
public static boolean writeFileFromString(String filePath, String content, boolean append) {
|
||||
return writeFileFromString(FileUtils.getFileByPath(filePath), content, append);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将字符串写入文件
|
||||
*
|
||||
* @param file 文件
|
||||
* @param content 写入内容
|
||||
* @return {@code true}: 写入成功<br>{@code false}: 写入失败
|
||||
*/
|
||||
public static boolean writeFileFromString(File file, String content) {
|
||||
return writeFileFromString(file, content, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将字符串写入文件
|
||||
*
|
||||
* @param file 文件
|
||||
* @param content 写入内容
|
||||
* @param append 是否追加在文件末
|
||||
* @return {@code true}: 写入成功<br>{@code false}: 写入失败
|
||||
*/
|
||||
public static boolean writeFileFromString(File file, String content, boolean append) {
|
||||
if (file == null || content == null) return false;
|
||||
if (!FileUtils.createOrExistsFile(file)) return false;
|
||||
BufferedWriter bw = null;
|
||||
try {
|
||||
bw = new BufferedWriter(new FileWriter(file, append));
|
||||
bw.write(content);
|
||||
bw.newLine();
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
} finally {
|
||||
try {
|
||||
bw.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 读取文件到字符串中
|
||||
*
|
||||
* @param filePath 文件路径
|
||||
* @return 字符串
|
||||
*/
|
||||
public static String readFile2String(String filePath) {
|
||||
return readFile2String(FileUtils.getFileByPath(filePath), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取文件到字符串中
|
||||
*
|
||||
* @param filePath 文件路径
|
||||
* @param charsetName 编码格式
|
||||
* @return 字符串
|
||||
*/
|
||||
public static String readFile2String(String filePath, String charsetName) {
|
||||
return readFile2String(FileUtils.getFileByPath(filePath), charsetName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取文件到字符串中
|
||||
*
|
||||
* @param file 文件
|
||||
* @return 字符串
|
||||
*/
|
||||
public static String readFile2String(File file) {
|
||||
return readFile2String(file, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取文件到字符串中
|
||||
*
|
||||
* @param file 文件
|
||||
* @param charsetName 编码格式
|
||||
* @return 字符串
|
||||
*/
|
||||
public static String readFile2String(File file, String charsetName) {
|
||||
if (!FileUtils.isFileExists(file)) return null;
|
||||
BufferedReader reader = null;
|
||||
try {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (isSpace(charsetName)) {
|
||||
reader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
|
||||
} else {
|
||||
reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), charsetName));
|
||||
}
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
sb.append(line).append(LINE_SEP);
|
||||
}
|
||||
// delete the last line separator
|
||||
return sb.delete(sb.length() - LINE_SEP.length(), sb.length()).toString();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
} finally {
|
||||
try {
|
||||
reader.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static boolean isSpace(String s) {
|
||||
if (s == null) return true;
|
||||
for (int i = 0, len = s.length(); i < len; ++i) {
|
||||
if (!Character.isWhitespace(s.charAt(i))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,8 +27,7 @@ class MessageUtils {
|
||||
XPopup.Builder(ctx) //
|
||||
.hasNavigationBar(false)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗对象,推荐设置这个
|
||||
.asCustom(MessagePop(ctx, message).setOnMyItemClickListener(object :
|
||||
MessagePop.OnMyItemClickListener {
|
||||
.asCustom(MessagePop(ctx, message).setOnMyItemClickListener(object : MessagePop.OnMyItemClickListener{
|
||||
override fun onItemClick(startTime: String, endTime: String) {
|
||||
}
|
||||
}))
|
||||
@@ -39,20 +38,14 @@ class MessageUtils {
|
||||
XPopup.Builder(ctx) //
|
||||
.hasNavigationBar(false)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗对象,推荐设置这个
|
||||
.asCustom(MessagePop(ctx, message, message2).setOnMyItemClickListener(object :
|
||||
MessagePop.OnMyItemClickListener {
|
||||
.asCustom(MessagePop(ctx, message,message2).setOnMyItemClickListener(object : MessagePop.OnMyItemClickListener{
|
||||
override fun onItemClick(startTime: String, endTime: String) {
|
||||
}
|
||||
}))
|
||||
.show()
|
||||
}
|
||||
|
||||
fun showSimCenPop(
|
||||
ctx: Context,
|
||||
message: String,
|
||||
titleRight:String = "去注册",
|
||||
onMyItemClickListener: SimCenterPop.OnMyItemClickListener
|
||||
) {
|
||||
fun showSimCenPop(ctx: Context, message: String,onMyItemClickListener: SimCenterPop.OnMyItemClickListener){
|
||||
|
||||
// XPopup.Builder(ctx) //
|
||||
// .hasNavigationBar(false)
|
||||
@@ -69,36 +62,7 @@ class MessageUtils {
|
||||
XPopup.Builder(ctx) //
|
||||
.hasNavigationBar(false)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗对象,推荐设置这个
|
||||
.asCustom(SimCenterPop(ctx, message, titleRight = titleRight).setOnMyItemClickListener(onMyItemClickListener))
|
||||
.show()
|
||||
|
||||
}
|
||||
|
||||
fun showSimCenPop(
|
||||
ctx: Context,
|
||||
message: String,
|
||||
left: String,
|
||||
right: String,
|
||||
onMyItemClickListener: SimCenterPop.OnMyItemClickListener
|
||||
) {
|
||||
|
||||
// XPopup.Builder(ctx) //
|
||||
// .hasNavigationBar(false)
|
||||
// .isDestroyOnDismiss(true) //对于只使用一次的弹窗对象,推荐设置这个
|
||||
// .asCustom(SimCenterPop(ctx,message).setOnMyItemClickListener(object : SimCenterPop.OnMyItemClickListener{
|
||||
// override fun onItemClick() {
|
||||
// val intent = Intent(ctx, CertificatesActivity::class.java)
|
||||
// intent.putExtra("index", type)
|
||||
// ctx.startActivity(intent)
|
||||
// }
|
||||
// }))
|
||||
// .show()
|
||||
|
||||
XPopup.Builder(ctx) //
|
||||
.hasNavigationBar(false)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗对象,推荐设置这个
|
||||
.dismissOnTouchOutside(false)
|
||||
.asCustom(SimCenterPop(ctx, message,left,right).setOnMyItemClickListener(onMyItemClickListener))
|
||||
.asCustom(SimCenterPop(ctx,message).setOnMyItemClickListener(onMyItemClickListener))
|
||||
.show()
|
||||
|
||||
}
|
||||
|
||||
@@ -1,810 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.util;
|
||||
|
||||
import static com.dahe.mylibrary.utils.BaseSPUtils.NEW_LJ_TOKEN;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.App;
|
||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.DriverAuthDataBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.GDImage;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.GDLocation;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.IsAuthCardBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.constant.NewLJConstant;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.AuthParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.AuthRequest;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.InvoiceBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.InvoicesBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.LjTokenBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.PickupBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.ShipmentStatusBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.UpimgBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.net.BaseObserver;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.net.DataManager;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.net.RxHttpCallBack;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.http.RequestUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||
import com.dahe.mylibrary.bean.DriverBean;
|
||||
import com.dahe.mylibrary.callback.OnGDDownloadResultListener;
|
||||
import com.dahe.mylibrary.callback.OnGDResultListener;
|
||||
import com.dahe.mylibrary.net.CommonResponseBean;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.express.mdp.Api;
|
||||
import com.express.mdp.Callback;
|
||||
import com.google.gson.Gson;
|
||||
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* @ClassName NewLJUtils
|
||||
* @Author john
|
||||
* @Date 2024/11/25 09:53
|
||||
* @Description TODO
|
||||
*/
|
||||
public class NewLJUtils {
|
||||
|
||||
|
||||
private static class SingletonHolder {
|
||||
private static final NewLJUtils INSTANCE = new NewLJUtils();
|
||||
}
|
||||
|
||||
private NewLJUtils() {
|
||||
}
|
||||
|
||||
public static final NewLJUtils getInstance() {
|
||||
return SingletonHolder.INSTANCE;
|
||||
}
|
||||
|
||||
public void getToken(Context ctx) {
|
||||
LjTokenBean ljTokenBean = new LjTokenBean();
|
||||
ljTokenBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||
ljTokenBean.setEnterpriseIdentity(NewLJConstant.ENTER_PRISE_IDENTITY);
|
||||
ljTokenBean.setEnterpriseKey(NewLJConstant.ENTER_PRISE_KEY);
|
||||
|
||||
DataManager.getInstance().getToken(ljTokenBean)
|
||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||
@Override
|
||||
public void onSuccess(CommonResponseBean t) {
|
||||
super.onSuccess(t);
|
||||
SPUtils.put(ctx, NEW_LJ_TOKEN, t.getToken());
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 刷新token
|
||||
*
|
||||
* @param ctx
|
||||
*/
|
||||
public void refreshToken(Context ctx) {
|
||||
String token = SPUtils.get(ctx, NEW_LJ_TOKEN, "").toString();
|
||||
DataManager.getInstance().refreshToken(token)
|
||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||
@Override
|
||||
public void onSuccess(CommonResponseBean<CommonResponseBean> t) {
|
||||
super.onSuccess(t);
|
||||
SPUtils.put(ctx, NEW_LJ_TOKEN, t.getToken());
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
public void getToken(Context ctx, OnGDResultListener listener) {
|
||||
LjTokenBean ljTokenBean = new LjTokenBean();
|
||||
ljTokenBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||
ljTokenBean.setEnterpriseIdentity(NewLJConstant.ENTER_PRISE_IDENTITY);
|
||||
ljTokenBean.setEnterpriseKey(NewLJConstant.ENTER_PRISE_KEY);
|
||||
|
||||
DataManager.getInstance().getToken(ljTokenBean)
|
||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||
@Override
|
||||
public void onSuccess(CommonResponseBean t) {
|
||||
super.onSuccess(t);
|
||||
SPUtils.put(ctx, NEW_LJ_TOKEN, t.getToken());
|
||||
if (listener != null)
|
||||
listener.onSuccess();
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 运单提货
|
||||
*
|
||||
* @param ctx
|
||||
* @param shipmentCode
|
||||
* @param location
|
||||
*/
|
||||
public void pickUp(Context ctx, String shipmentCode, GDLocation location, OnGDResultListener listener) {
|
||||
if (TextUtils.isEmpty(shipmentCode)) {
|
||||
ToastUtils.showToast(ctx, "运单号不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Double.isNaN(location.getBaiduLatitude()) || Double.isNaN(location.getBaiduLongitude())) {
|
||||
ToastUtils.showToast(ctx, "经纬度不能为空");
|
||||
return;
|
||||
}
|
||||
PickupBean pickupBean = new PickupBean();
|
||||
pickupBean.setShipmentCode(shipmentCode);
|
||||
pickupBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||
pickupBean.setLocation(location);
|
||||
DataManager.getInstance().pickup(pickupBean)
|
||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||
@Override
|
||||
public void onSuccess(CommonResponseBean t) {
|
||||
super.onSuccess(t);
|
||||
if (listener != null) {
|
||||
listener.onSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||
super.onCodeError(mContext, t);
|
||||
if (listener != null) {
|
||||
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage()) ? "运单提货操作异常" : t.getMessage());
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 运单卸货
|
||||
*
|
||||
* @param ctx
|
||||
* @param shipmentCode
|
||||
* @param location
|
||||
*/
|
||||
public void unload(Context ctx, String shipmentCode, GDLocation location, OnGDResultListener listener) {
|
||||
if (TextUtils.isEmpty(shipmentCode)) {
|
||||
ToastUtils.showToast(ctx, "运单号不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Double.isNaN(location.getBaiduLatitude()) || Double.isNaN(location.getBaiduLongitude())) {
|
||||
ToastUtils.showToast(ctx, "经纬度不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
PickupBean pickupBean = new PickupBean();
|
||||
pickupBean.setShipmentCode(shipmentCode);
|
||||
pickupBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||
pickupBean.setLocation(location);
|
||||
DataManager.getInstance().unload(pickupBean)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||
@Override
|
||||
public void onSuccess(CommonResponseBean t) {
|
||||
super.onSuccess(t);
|
||||
if (listener != null) {
|
||||
listener.onSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||
super.onCodeError(mContext, t);
|
||||
if (listener != null) {
|
||||
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage()) ? "运单卸货操作异常" : t.getMessage());
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 运单签收
|
||||
*
|
||||
* @param ctx
|
||||
* @param shipmentCode
|
||||
* @param location
|
||||
*/
|
||||
public void sign(Context ctx, String shipmentCode, GDLocation location, OnGDResultListener listener) {
|
||||
if (TextUtils.isEmpty(shipmentCode)) {
|
||||
ToastUtils.showToast(ctx, "运单号不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Double.isNaN(location.getBaiduLatitude()) || Double.isNaN(location.getBaiduLongitude())) {
|
||||
ToastUtils.showToast(ctx, "经纬度不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
PickupBean pickupBean = new PickupBean();
|
||||
pickupBean.setShipmentCode(shipmentCode);
|
||||
pickupBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||
pickupBean.setLocation(location);
|
||||
DataManager.getInstance().sign(pickupBean)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||
@Override
|
||||
public void onSuccess(CommonResponseBean t) {
|
||||
super.onSuccess(t);
|
||||
if (listener != null) {
|
||||
listener.onSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||
super.onCodeError(mContext, t);
|
||||
if (listener != null) {
|
||||
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage()) ? "运单签收操作异常" : t.getMessage());
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 运单回单
|
||||
*
|
||||
* @param ctx
|
||||
* @param shipmentCode
|
||||
* @param location
|
||||
*/
|
||||
public void pod(Context ctx, String shipmentCode, GDLocation location, OnGDResultListener listener) {
|
||||
if (TextUtils.isEmpty(shipmentCode)) {
|
||||
ToastUtils.showToast(ctx, "运单号不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Double.isNaN(location.getBaiduLatitude()) || Double.isNaN(location.getBaiduLongitude())) {
|
||||
ToastUtils.showToast(ctx, "经纬度不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
PickupBean pickupBean = new PickupBean();
|
||||
pickupBean.setShipmentCode(shipmentCode);
|
||||
pickupBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||
pickupBean.setLocation(location);
|
||||
DataManager.getInstance().pod(pickupBean)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||
@Override
|
||||
public void onSuccess(CommonResponseBean t) {
|
||||
super.onSuccess(t);
|
||||
if (listener != null) {
|
||||
listener.onSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||
super.onCodeError(mContext, t);
|
||||
if (listener != null) {
|
||||
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage()) ? "运单回单操作异常" : t.getMessage());
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 运单提货照片上传
|
||||
*
|
||||
* @param ctx
|
||||
* @param shipmentCode
|
||||
* @param imageDTO
|
||||
*/
|
||||
public void uploadPickupImage(Context ctx, String shipmentCode, GDImage imageDTO, OnGDResultListener listener) {
|
||||
if (TextUtils.isEmpty(shipmentCode)) {
|
||||
ToastUtils.showToast(ctx, "运单号不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if (TextUtils.isEmpty(imageDTO.getFileName())) {
|
||||
ToastUtils.showToast(ctx, "照片不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
UpimgBean pickupBean = new UpimgBean();
|
||||
pickupBean.setShipmentCode(shipmentCode);
|
||||
pickupBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||
pickupBean.setImage(imageDTO);
|
||||
DataManager.getInstance().uploadPickupImage(pickupBean)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||
@Override
|
||||
public void onSuccess(CommonResponseBean t) {
|
||||
super.onSuccess(t);
|
||||
if (listener != null) {
|
||||
listener.onSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||
super.onCodeError(mContext, t);
|
||||
if (listener != null) {
|
||||
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage()) ? "运单提货照片操作异常" : t.getMessage());
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 运单卸货照片上传
|
||||
*
|
||||
* @param ctx
|
||||
* @param shipmentCode
|
||||
* @param imageDTO
|
||||
*/
|
||||
public void uploadUnloadImage(Context ctx, String shipmentCode, GDImage imageDTO, OnGDResultListener listener) {
|
||||
if (TextUtils.isEmpty(shipmentCode)) {
|
||||
ToastUtils.showToast(ctx, "运单号不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if (TextUtils.isEmpty(imageDTO.getFileName())) {
|
||||
ToastUtils.showToast(ctx, "照片不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
UpimgBean pickupBean = new UpimgBean();
|
||||
pickupBean.setShipmentCode(shipmentCode);
|
||||
pickupBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||
pickupBean.setImage(imageDTO);
|
||||
DataManager.getInstance().uploadUnloadImage(pickupBean)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||
@Override
|
||||
public void onSuccess(CommonResponseBean t) {
|
||||
super.onSuccess(t);
|
||||
if (listener != null) {
|
||||
listener.onSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||
super.onCodeError(mContext, t);
|
||||
if (listener != null) {
|
||||
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage()) ? "运单卸货照片操作异常" : t.getMessage());
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 运单回单照片上传
|
||||
*
|
||||
* @param ctx
|
||||
* @param shipmentCode
|
||||
* @param imageDTO
|
||||
*/
|
||||
public void uploadPODImage(Context ctx, String shipmentCode, GDImage imageDTO, OnGDResultListener listener) {
|
||||
if (TextUtils.isEmpty(shipmentCode)) {
|
||||
ToastUtils.showToast(ctx, "运单号不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if (TextUtils.isEmpty(imageDTO.getFileName())) {
|
||||
ToastUtils.showToast(ctx, "照片不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
UpimgBean pickupBean = new UpimgBean();
|
||||
pickupBean.setShipmentCode(shipmentCode);
|
||||
pickupBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||
pickupBean.setImage(imageDTO);
|
||||
DataManager.getInstance().uploadPODImage(pickupBean)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||
@Override
|
||||
public void onSuccess(CommonResponseBean t) {
|
||||
super.onSuccess(t);
|
||||
if (listener != null) {
|
||||
listener.onSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||
super.onCodeError(mContext, t);
|
||||
if (listener != null) {
|
||||
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage()) ? "运单回单照片操作异常" : t.getMessage());
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取发票列表
|
||||
*
|
||||
* @param ctx
|
||||
* @param listener
|
||||
*/
|
||||
public void getInvoices(Context ctx, OnGDResultListener listener) {
|
||||
DriverAuthDataBean auth = AuthParts.getAuth(ctx);
|
||||
if (auth == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
DataManager.getInstance().getInvoices(NewLJConstant.ENTER_PRISE_CODE, auth.getData().getIdcard(), 1, 100)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean<InvoicesBean>>() {
|
||||
@Override
|
||||
public void onSuccess(CommonResponseBean<CommonResponseBean<InvoicesBean>> t) {
|
||||
super.onSuccess(t);
|
||||
if (t.getData().getData().getDriverInvoices().size() > 0) {
|
||||
confirmInvoice(ctx, new OnGDResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
Log.e("NewLJUtils", var1 + var2);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean<InvoicesBean>> t) {
|
||||
super.onCodeError(mContext, t);
|
||||
// Log.e("NewLJUtils", t.getMsg().toString());
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 同意发票申请
|
||||
*
|
||||
* @param ctx
|
||||
*/
|
||||
public void confirmInvoice(Context ctx, OnGDResultListener listener) {
|
||||
DriverAuthDataBean auth = AuthParts.getAuth(ctx);
|
||||
if (auth == null) {
|
||||
return;
|
||||
}
|
||||
searchDriver(ctx, auth.getData().getIdcard(), new OnGDDownloadResultListener() {
|
||||
@Override
|
||||
public void onSuccess(String var1) {
|
||||
InvoiceBean invoiceBean = new InvoiceBean();
|
||||
invoiceBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||
invoiceBean.setDriverInvoiceCode(var1);
|
||||
invoiceBean.setDriverIdentification(auth.getData().getIdcard());
|
||||
DataManager.getInstance().confirmInvoice(invoiceBean)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||
@Override
|
||||
public void onSuccess(CommonResponseBean t) {
|
||||
super.onSuccess(t);
|
||||
if (listener != null) {
|
||||
listener.onSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||
super.onCodeError(mContext, t);
|
||||
if (listener != null) {
|
||||
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage()) ? "同意发票异常" : t.getMessage());
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//查询身份证信息
|
||||
// new AuthRequest().getCard(ctx, new Handler(msg -> {
|
||||
// switch (msg.what) {
|
||||
// case RequsetCodeConstants.ERROR:
|
||||
// Toast.makeText(ctx, RequsetCodeConstants.FEEDBACK_TEXT, Toast.LENGTH_SHORT).show();
|
||||
// break;
|
||||
// case RequsetCodeConstants.UNKONWN:
|
||||
// Toast.makeText(ctx, RequsetCodeConstants.UNKONWN_TEXT, Toast.LENGTH_SHORT).show();
|
||||
// break;
|
||||
// case RequsetCodeConstants.SERVER_ERROR:
|
||||
// Toast.makeText(ctx, RequsetCodeConstants.SERVER_ERROR_TEXT, Toast.LENGTH_SHORT).show();
|
||||
// break;
|
||||
// case RequsetCodeConstants.GATEWAY_ERROR:
|
||||
// Toast.makeText(ctx, RequsetCodeConstants.GATEWAY_ERROR_TEXT, Toast.LENGTH_SHORT).show();
|
||||
// break;
|
||||
// case RequsetCodeConstants.SUCCESS:
|
||||
// IsAuthCardBean iacb = new Gson().fromJson(CacheGroup.cacheList.get(CertificatesActivity.ISAUTH), IsAuthCardBean.class);
|
||||
// if (iacb != null || iacb.getData() != null || !TextUtils.isEmpty(iacb.getData().getIdcard())) {
|
||||
// //根据身份证号查询路交司机信息
|
||||
// searchDriver(ctx, iacb.getData().getIdcard(), new OnGDDownloadResultListener() {
|
||||
// @Override
|
||||
// public void onSuccess(String var1) {
|
||||
// InvoiceBean invoiceBean = new InvoiceBean();
|
||||
// invoiceBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||
// invoiceBean.setDriverInvoiceCode(var1);
|
||||
// invoiceBean.setDriverIdentification(iacb.getData().getIdcard());
|
||||
// DataManager.getInstance().confirmInvoice(invoiceBean)
|
||||
// .subscribeOn(Schedulers.io())
|
||||
// .observeOn(AndroidSchedulers.mainThread())
|
||||
// .subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||
// @Override
|
||||
// public void onSuccess(CommonResponseBean t) {
|
||||
// super.onSuccess(t);
|
||||
// if (listener != null) {
|
||||
// listener.onSuccess();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||
// super.onCodeError(mContext, t);
|
||||
// if (listener != null) {
|
||||
// listener.onFailure(t.getCode() + "", t.getMessage());
|
||||
// }
|
||||
// }
|
||||
// }));
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(String var1, String var2) {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
// } else {
|
||||
// Toast.makeText(ctx, "缺少身份证信息", Toast.LENGTH_SHORT).show();
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// return false;
|
||||
// }));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 运单状态查询
|
||||
*
|
||||
* @param ctx
|
||||
* @param shipmentCode
|
||||
*/
|
||||
public void getShipmentStatus(Context ctx, String shipmentCode, OnGDDownloadResultListener listener) {
|
||||
ShipmentStatusBean shipmentStatusBean = new ShipmentStatusBean();
|
||||
shipmentStatusBean.setShipmentCode(shipmentCode);
|
||||
shipmentStatusBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||
DataManager.getInstance().getShipmentStatus(shipmentStatusBean)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||
@Override
|
||||
public void onSuccess(CommonResponseBean t) {
|
||||
super.onSuccess(t);
|
||||
if (listener != null) {
|
||||
listener.onSuccess(t.getStatusCode());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||
super.onCodeError(mContext, t);
|
||||
if (listener != null) {
|
||||
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage()) ? "运单状态查询异常" : t.getMessage());
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
public void getPODImageNames(Context ctx, String shipmentCode) {
|
||||
ShipmentStatusBean shipmentStatusBean = new ShipmentStatusBean();
|
||||
shipmentStatusBean.setShipmentCode(shipmentCode);
|
||||
shipmentStatusBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||
DataManager.getInstance().getPODImageNames(shipmentStatusBean)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||
@Override
|
||||
public void onSuccess(CommonResponseBean t) {
|
||||
super.onSuccess(t);
|
||||
System.out.println("sadf");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||
super.onCodeError(mContext, t);
|
||||
System.out.println("sadf");
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启位置上传
|
||||
*
|
||||
* @param act
|
||||
*/
|
||||
public void startLocationService(AppCompatActivity act) {
|
||||
DriverAuthDataBean auth = AuthParts.getAuth(act);
|
||||
if (auth == null) {
|
||||
return;
|
||||
}
|
||||
searchDriver(act, auth.getData().getIdcard(), new OnGDDownloadResultListener() {
|
||||
@Override
|
||||
public void onSuccess(String var1) {
|
||||
try {
|
||||
//开启定位服务
|
||||
if (BuildConfig.isTest) {
|
||||
Api.setBaseUrl("https://kehui56.cn/api", "https://api.kehui56.cn/api");
|
||||
}
|
||||
String result = Api.startLocationService(act, var1, s -> {
|
||||
Log.e("位置上报", s);
|
||||
});
|
||||
System.out.println(result);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//查询身份证信息
|
||||
// new AuthRequest().getCard(act, new Handler(msg -> {
|
||||
// switch (msg.what) {
|
||||
// case RequsetCodeConstants.ERROR:
|
||||
// Toast.makeText(act, RequsetCodeConstants.FEEDBACK_TEXT, Toast.LENGTH_SHORT).show();
|
||||
// break;
|
||||
// case RequsetCodeConstants.UNKONWN:
|
||||
// Toast.makeText(act, RequsetCodeConstants.UNKONWN_TEXT, Toast.LENGTH_SHORT).show();
|
||||
// break;
|
||||
// case RequsetCodeConstants.SERVER_ERROR:
|
||||
// Toast.makeText(act, RequsetCodeConstants.SERVER_ERROR_TEXT, Toast.LENGTH_SHORT).show();
|
||||
// break;
|
||||
// case RequsetCodeConstants.GATEWAY_ERROR:
|
||||
// Toast.makeText(act, RequsetCodeConstants.GATEWAY_ERROR_TEXT, Toast.LENGTH_SHORT).show();
|
||||
// break;
|
||||
// case RequsetCodeConstants.SUCCESS:
|
||||
// IsAuthCardBean iacb = new Gson().fromJson(CacheGroup.cacheList.get(CertificatesActivity.ISAUTH), IsAuthCardBean.class);
|
||||
// if (iacb != null || iacb.getData() != null || !TextUtils.isEmpty(iacb.getData().getIdcard())) {
|
||||
// //根据身份证号查询路交司机信息
|
||||
// searchDriver(act,iacb.getData().getIdcard(), new OnGDDownloadResultListener() {
|
||||
// @Override
|
||||
// public void onSuccess(String var1) {
|
||||
// try {
|
||||
// //开启定位服务
|
||||
// Api.setBaseUrl("https://kehui56.cn/api", "https://api.kehui56.cn/api");
|
||||
// String result = Api.startLocationService(act, var1, s -> {
|
||||
// Log.e("位置上报", s);
|
||||
// });
|
||||
// } catch (Exception e) {
|
||||
// throw new RuntimeException(e);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(String var1, String var2) {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
// } else {
|
||||
// Toast.makeText(act, "缺少身份证信息", Toast.LENGTH_SHORT).show();
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// return false;
|
||||
// }));
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭定位服务
|
||||
*/
|
||||
public void stopLocationService() {
|
||||
Api.stopLocationService();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询司机
|
||||
*/
|
||||
public void searchDriver(Context ctx, String idCard, OnGDDownloadResultListener listener) {
|
||||
DataManager.getInstance().searchDriver(idCard)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||
@Override
|
||||
public void onSuccess(CommonResponseBean<CommonResponseBean> t) {
|
||||
super.onSuccess(t);
|
||||
DriverBean driver = t.getDriver();
|
||||
if (driver != null && !TextUtils.isEmpty(driver.getDriverCode())) {
|
||||
if (listener != null)
|
||||
listener.onSuccess(driver.getDriverCode());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||
super.onCodeError(mContext, t);
|
||||
if (listener != null)
|
||||
listener.onFailure(t.getCode(), TextUtils.isEmpty(t.getMessage()) ? "司机异常请联系管理员" : t.getMessage());
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 人车绑定关系
|
||||
* @param ctx
|
||||
* @param idCard
|
||||
* @param listener
|
||||
*/
|
||||
public void trucks(Context ctx, String idCard,String carNum, OnGDDownloadResultListener listener){
|
||||
DataManager.getInstance().trucks(idCard)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||
@Override
|
||||
public void onSuccess(CommonResponseBean<CommonResponseBean> t) {
|
||||
super.onSuccess(t);
|
||||
String[] licensePlateNos = t.getLicensePlateNos();
|
||||
if (listener!=null){
|
||||
if (licensePlateNos.length==0){
|
||||
listener.onFailure(t.getCode(), "该司机暂未绑定任何车辆");
|
||||
}else{
|
||||
boolean isHasCar = false;
|
||||
for (int i = 0; i < licensePlateNos.length; i++) {
|
||||
if (licensePlateNos[i].equals(carNum)){
|
||||
isHasCar = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isHasCar){
|
||||
listener.onSuccess("人车绑定正常");
|
||||
}else{
|
||||
listener.onFailure(t.getCode(), "司机车辆绑定异常");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||
super.onCodeError(mContext, t);
|
||||
if (listener != null)
|
||||
listener.onFailure(t.getCode(), TextUtils.isEmpty(t.getMessage()) ? "司机异常" : t.getMessage());
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||
import com.dahe.mylibrary.utils.TimeUtil;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* @ClassName OneDayShowUtils
|
||||
* @Author john
|
||||
* @Date 2024/9/11 15:33
|
||||
* @Description TODO
|
||||
*/
|
||||
public class OneDayShowUtils {
|
||||
|
||||
private static class SingletonHolder {
|
||||
private static final OneDayShowUtils INSTANCE = new OneDayShowUtils();
|
||||
}
|
||||
|
||||
private OneDayShowUtils() {
|
||||
}
|
||||
|
||||
public static final OneDayShowUtils getInstance() {
|
||||
return OneDayShowUtils.SingletonHolder.INSTANCE;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param ctx
|
||||
* @return true:当天已弹出 false:当天未弹出
|
||||
*/
|
||||
public boolean todayIsShow(Context ctx) {
|
||||
String preday = (String) SPUtils.get(ctx, "PREDAY", "");
|
||||
if (TextUtils.isEmpty(preday)) {
|
||||
String nowString = TimeUtil.getNowString("yyyy-MM-dd");
|
||||
SPUtils.put(ctx, "PREDAY", nowString);
|
||||
return false;
|
||||
} else {
|
||||
boolean today = TimeUtil.isToday(preday, new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()));
|
||||
if (!today) {
|
||||
String nowString = TimeUtil.getNowString("yyyy-MM-dd");
|
||||
SPUtils.put(ctx, "PREDAY", nowString);
|
||||
}
|
||||
return today;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param ctx
|
||||
* @return true:当天已弹出 false:当天未弹出
|
||||
*/
|
||||
public boolean todayIsShowQx(Context ctx) {
|
||||
String preday = (String) SPUtils.get(ctx, "permission", "");
|
||||
if (TextUtils.isEmpty(preday)) {
|
||||
String nowString = TimeUtil.getNowString("yyyy-MM-dd");
|
||||
SPUtils.put(ctx, "permission", nowString);
|
||||
return false;
|
||||
} else {
|
||||
boolean today = TimeUtil.isToday(preday, new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()));
|
||||
if (!today) {
|
||||
String nowString = TimeUtil.getNowString("yyyy-MM-dd");
|
||||
SPUtils.put(ctx, "permission", nowString);
|
||||
}
|
||||
return today;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,137 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.util
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import androidx.annotation.NonNull
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import com.arpa.hndahesudintocctmsdriver.cuspop.MessagePop
|
||||
import com.arpa.hndahesudintocctmsdriver.cuspop.MyRequestCallback
|
||||
import com.arpa.hndahesudintocctmsdriver.cuspop.TopMsgPopup
|
||||
import com.arpa.hndahesudintocctmsdriver.cuspop.SimCenterPop
|
||||
import com.lxj.xpopup.XPopup
|
||||
import com.lxj.xpopup.core.BasePopupView
|
||||
import com.permissionx.guolindev.PermissionX
|
||||
import com.permissionx.guolindev.callback.RequestCallback
|
||||
|
||||
/**
|
||||
* @ClassName MessageUtils
|
||||
* @Author 用户
|
||||
* @Date 2023/8/15 09:51
|
||||
* @Description TODO
|
||||
*/
|
||||
class PermissionUtils {
|
||||
|
||||
companion object {
|
||||
fun getInstance() = InstanceHelper.sSingle
|
||||
}
|
||||
|
||||
object InstanceHelper {
|
||||
val sSingle = PermissionUtils()
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 显示权限申请
|
||||
* @param activity AppCompatActivity
|
||||
* @param message String
|
||||
* @param permission List<String>
|
||||
* @param callback RequestCallback
|
||||
* @return BasePopupView?
|
||||
*/
|
||||
fun showPermissionMessage(activity: FragmentActivity,title:String, message: String,vararg permission:String,callback: MyRequestCallback){
|
||||
val show = XPopup.Builder(activity)
|
||||
.hasShadowBg(false)
|
||||
.hasBlurBg(false)
|
||||
.isTouchThrough(true)
|
||||
.isCenterHorizontal(true)
|
||||
.offsetY(140)
|
||||
.asCustom(
|
||||
TopMsgPopup(
|
||||
activity,
|
||||
title,
|
||||
message
|
||||
)
|
||||
)
|
||||
.show()
|
||||
|
||||
PermissionX.init(activity)
|
||||
.permissions(listOf(*permission))
|
||||
.request { allGranted, grantedList, deniedList ->
|
||||
show.dismiss()
|
||||
if (callback!=null){
|
||||
callback.onResult(allGranted,grantedList,deniedList)
|
||||
}
|
||||
}
|
||||
}
|
||||
fun showCenMessage(ctx: Context, message: String, message2: String) {
|
||||
XPopup.Builder(ctx) //
|
||||
.hasNavigationBar(false)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗对象,推荐设置这个
|
||||
.asCustom(MessagePop(ctx, message, message2).setOnMyItemClickListener(object :
|
||||
MessagePop.OnMyItemClickListener {
|
||||
override fun onItemClick(startTime: String, endTime: String) {
|
||||
}
|
||||
}))
|
||||
.show()
|
||||
}
|
||||
|
||||
fun showSimCenPop(
|
||||
ctx: Context,
|
||||
message: String,
|
||||
onMyItemClickListener: SimCenterPop.OnMyItemClickListener
|
||||
) {
|
||||
|
||||
// XPopup.Builder(ctx) //
|
||||
// .hasNavigationBar(false)
|
||||
// .isDestroyOnDismiss(true) //对于只使用一次的弹窗对象,推荐设置这个
|
||||
// .asCustom(SimCenterPop(ctx,message).setOnMyItemClickListener(object : SimCenterPop.OnMyItemClickListener{
|
||||
// override fun onItemClick() {
|
||||
// val intent = Intent(ctx, CertificatesActivity::class.java)
|
||||
// intent.putExtra("index", type)
|
||||
// ctx.startActivity(intent)
|
||||
// }
|
||||
// }))
|
||||
// .show()
|
||||
|
||||
XPopup.Builder(ctx) //
|
||||
.hasNavigationBar(false)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗对象,推荐设置这个
|
||||
.asCustom(SimCenterPop(ctx, message).setOnMyItemClickListener(onMyItemClickListener))
|
||||
.show()
|
||||
|
||||
}
|
||||
|
||||
fun showSimCenPop(
|
||||
ctx: Context,
|
||||
message: String,
|
||||
left: String,
|
||||
right: String,
|
||||
onMyItemClickListener: SimCenterPop.OnMyItemClickListener
|
||||
) {
|
||||
|
||||
// XPopup.Builder(ctx) //
|
||||
// .hasNavigationBar(false)
|
||||
// .isDestroyOnDismiss(true) //对于只使用一次的弹窗对象,推荐设置这个
|
||||
// .asCustom(SimCenterPop(ctx,message).setOnMyItemClickListener(object : SimCenterPop.OnMyItemClickListener{
|
||||
// override fun onItemClick() {
|
||||
// val intent = Intent(ctx, CertificatesActivity::class.java)
|
||||
// intent.putExtra("index", type)
|
||||
// ctx.startActivity(intent)
|
||||
// }
|
||||
// }))
|
||||
// .show()
|
||||
|
||||
XPopup.Builder(ctx) //
|
||||
.hasNavigationBar(false)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗对象,推荐设置这个
|
||||
.asCustom(
|
||||
SimCenterPop(ctx, message, left, right).setOnMyItemClickListener(
|
||||
onMyItemClickListener
|
||||
)
|
||||
)
|
||||
.show()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -81,39 +81,6 @@ public class OkHttpUtil {
|
||||
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)
|
||||
.removeHeader("User-Agent")
|
||||
.addHeader("User-Agent",GetUtil.getUserAgent(con))
|
||||
.build();
|
||||
return request;
|
||||
}
|
||||
|
||||
public static Request get(OkDate od){
|
||||
Headers.Builder hb=new Headers.Builder();
|
||||
hb.add("Content-Type","application/json");
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.util.img;
|
||||
|
||||
import static com.sdk.base.framework.utils.app.AppUtils.getPackageName;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.provider.Settings;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
@@ -18,7 +13,6 @@ import android.widget.Toast;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.PicturlUtil;
|
||||
import com.permissionx.guolindev.PermissionX;
|
||||
|
||||
@@ -62,17 +56,12 @@ public class GetCarImageAlert {
|
||||
}
|
||||
btn_xiangce.setOnClickListener(v -> {
|
||||
PermissionX.init(act)
|
||||
.permissions(Manifest.permission.READ_EXTERNAL_STORAGE,Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||
.permissions(Manifest.permission.READ_EXTERNAL_STORAGE)
|
||||
.request((allGranted, grantedList, deniedList) -> {
|
||||
if (allGranted) {
|
||||
PicturlUtil.selectPicter(act, new ArrayList<>(), 1);
|
||||
} else {
|
||||
new MessageUtils().showSimCenPop(act, "缺少媒体和文件权限,将无法选择照片,去开启!", "取消", "确认", () -> {
|
||||
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
act.startActivity(intent);
|
||||
});
|
||||
Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -85,12 +74,7 @@ public class GetCarImageAlert {
|
||||
// file=ImageGetUtil.createImageFile(act);
|
||||
// ImageGetUtil.cameraAlbumGetImage(act,file);
|
||||
} else {
|
||||
new MessageUtils().showSimCenPop(act, "缺少相机权限,将无法进行拍照或选择照片,去开启!", "取消", "确认", () -> {
|
||||
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
act.startActivity(intent);
|
||||
});
|
||||
Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -102,12 +86,7 @@ public class GetCarImageAlert {
|
||||
if (allGranted) {
|
||||
openCam(act);
|
||||
} else {
|
||||
new MessageUtils().showSimCenPop(act, "缺少相机权限,将无法进行拍照或选择照片,去开启!", "取消", "确认", () -> {
|
||||
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
act.startActivity(intent);
|
||||
});
|
||||
Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.util.img;
|
||||
|
||||
import static com.sdk.base.framework.utils.app.AppUtils.getPackageName;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.provider.Settings;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
@@ -15,7 +10,6 @@ import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.PicturlUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.permissionx.guolindev.PermissionX;
|
||||
@@ -51,37 +45,25 @@ public class GetImageAlert {
|
||||
|
||||
btn_xiangce.setOnClickListener(v -> {
|
||||
PermissionX.init(act)
|
||||
.permissions(Manifest.permission.READ_EXTERNAL_STORAGE,Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.CAMERA)
|
||||
.permissions(Manifest.permission.READ_EXTERNAL_STORAGE)
|
||||
.request((allGranted, grantedList, deniedList) -> {
|
||||
if (allGranted) {
|
||||
PicturlUtil.selectPicter(act, new ArrayList<>(), 1);
|
||||
} else {
|
||||
new MessageUtils().showSimCenPop(act, "缺少相机,媒体权限,将无法为您提供服务,去开启!", "取消", "确认", () -> {
|
||||
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
act.startActivity(intent);
|
||||
});
|
||||
// Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
});
|
||||
btn_paizhao.setOnClickListener(v -> {
|
||||
|
||||
PermissionX.init(act)
|
||||
.permissions(Manifest.permission.READ_EXTERNAL_STORAGE,Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.CAMERA)
|
||||
.permissions(Manifest.permission.CAMERA)
|
||||
.request((allGranted, grantedList, deniedList) -> {
|
||||
if (allGranted) {
|
||||
file = ImageGetUtil.createImageFile(act);
|
||||
ImageGetUtil.cameraAlbumGetImage(act, file);
|
||||
} else {
|
||||
new MessageUtils().showSimCenPop(act, "缺少相机,媒体权限,将无法为您提供服务,去开启!", "取消", "确认", () -> {
|
||||
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
act.startActivity(intent);
|
||||
});
|
||||
// Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -8,7 +8,9 @@ import com.amap.api.location.AMapLocation;
|
||||
import com.amap.api.location.AMapLocationClient;
|
||||
import com.amap.api.location.AMapLocationClientOption;
|
||||
import com.amap.api.location.AMapLocationListener;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.msg.MsgUtil;
|
||||
import com.google.gson.Gson;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
@@ -74,6 +76,7 @@ public class LocationGDUtil {
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date date = new Date(aMapLocation.getTime());
|
||||
df.format(date);
|
||||
CacheGroup.cacheList.put("getLocation",new Gson().toJson(aMapLocation));
|
||||
MsgUtil.addHdMsgWat(hd,RES);
|
||||
if (mLocationClient!=null) {
|
||||
mLocationClient.onDestroy();
|
||||
|
||||
-101
@@ -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, "定位失败,请查看定位权限");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -28,8 +28,6 @@ public abstract class BaseActivity extends Activity {
|
||||
private String title_text="空白标题";
|
||||
|
||||
public Handler hd=new Handler(msg -> {
|
||||
if (this==null||this.isFinishing())
|
||||
return true;
|
||||
msgMethod(msg);
|
||||
return false;
|
||||
});
|
||||
|
||||
-2
@@ -25,8 +25,6 @@ public class BaseAppCompatActivity extends AppCompatActivity {
|
||||
public static String dataName,dataName2,dataName3="";
|
||||
public View root;
|
||||
public Handler hd=new Handler(msg -> {
|
||||
if (this==null||this.isFinishing())
|
||||
return true;
|
||||
msgMethod(msg);
|
||||
return false;
|
||||
});
|
||||
|
||||
@@ -105,8 +105,6 @@ public class BaseRecyclerView extends RecyclerView {
|
||||
ra.addItem(mb);
|
||||
}
|
||||
public void adds(List<ManyBean> list){
|
||||
if (ra==null)
|
||||
return;
|
||||
ra.add(list);
|
||||
}
|
||||
public AdapterAlls createsH(Context con, List<ManyBean> list){
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 43 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 788 B |
Binary file not shown.
|
Before Width: | Height: | Size: 1.5 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.7 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user