Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
670bf385ac | ||
|
|
383f8a9a80 |
+58
-84
@@ -3,7 +3,6 @@ plugins {
|
||||
id 'kotlin-android'
|
||||
id 'kotlin-kapt'
|
||||
id 'com.huawei.agconnect'
|
||||
id 'kotlin-android-extensions'
|
||||
}
|
||||
|
||||
android {
|
||||
@@ -16,31 +15,28 @@ android {
|
||||
keyPassword '123456'
|
||||
storeFile file('key.jks')
|
||||
storePassword '123456'
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
// debug {
|
||||
// keyAlias 'key0'
|
||||
// keyPassword '123456'
|
||||
// storeFile file('key.jks')
|
||||
// storePassword '123456'
|
||||
// }
|
||||
// release {
|
||||
// keyAlias 'key0'
|
||||
// keyPassword '123456'
|
||||
// storeFile file('key.jks')
|
||||
// storePassword '123456'
|
||||
// }
|
||||
debug {
|
||||
keyAlias 'key0'
|
||||
keyPassword '123456'
|
||||
storeFile file('key.jks')
|
||||
storePassword '123456'
|
||||
}
|
||||
release {
|
||||
keyAlias 'key0'
|
||||
keyPassword '123456'
|
||||
storeFile file('key.jks')
|
||||
storePassword '123456'
|
||||
}
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.arpa.hndahesudintocctmsdriver"
|
||||
minSdkVersion 24
|
||||
minSdkVersion 22
|
||||
targetSdkVersion 30
|
||||
versionCode 67
|
||||
versionName "3.3.7"
|
||||
versionCode 50
|
||||
versionName "3.2.0"
|
||||
flavorDimensions "CHANNEL_VALUE"
|
||||
flavorDimensions "app_icon"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
javaCompileOptions {
|
||||
|
||||
@@ -53,12 +49,26 @@ android {
|
||||
ndk {
|
||||
|
||||
//选择要添加的对应 cpu 类型的 .so 库。
|
||||
abiFilters 'armeabi-v7a', 'arm64-v8a'
|
||||
abiFilters 'armeabi', 'armeabi-v7a'
|
||||
// 还可以添加 'x86', 'x86_64', 'mips', 'mips64' , 'arm64-v8a'
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
manifestPlaceholders = [
|
||||
JPUSH_PKGNAME : applicationId,
|
||||
JPUSH_APPKEY : "571d93ae5117da6dee848c92", //JPush 上注册的包名对应的 Appkey.
|
||||
JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可.
|
||||
MEIZU_APPKEY : "MZ-魅族的APPKEY",
|
||||
MEIZU_APPID : "MZ-魅族的APPID",
|
||||
XIAOMI_APPID : "MI-小米的APPID",
|
||||
XIAOMI_APPKEY : "MI-小米的APPKEY",
|
||||
OPPO_APPKEY : "OP-oppo的APPKEY",
|
||||
OPPO_APPID : "OP-oppo的APPID",
|
||||
OPPO_APPSECRET : "OP-oppo的APPSECRET",
|
||||
VIVO_APPKEY : "vivo的APPKEY",
|
||||
VIVO_APPID : "vivo的APPID"
|
||||
]
|
||||
}
|
||||
sourceSets {
|
||||
main {
|
||||
jniLibs.srcDirs = ['libs']
|
||||
@@ -69,10 +79,9 @@ android {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
signingConfig signingConfigs.config
|
||||
}
|
||||
debug {
|
||||
signingConfig signingConfigs.config
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
@@ -96,53 +105,28 @@ android {
|
||||
|
||||
productFlavors {
|
||||
qa {
|
||||
applicationId "com.arpa.hndahesudintocctmsdriver.text"
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "司机测试",
|
||||
app_icon : "@drawable/diver_logo_text",
|
||||
GAODEKEY : "6791d69f6221a0841b521763af86eb01",
|
||||
JPUSH_PKGNAME: applicationId,
|
||||
JPUSH_APPKEY : "fba6f55621c670d8c1fe9191", //JPush 上注册的包名对应的 Appkey.
|
||||
JPUSH_CHANNEL: "developer-default"//暂时填写默认值即可.
|
||||
]
|
||||
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi-staging.alct56.com\"")
|
||||
buildConfigField("String", "BASE_URL", "\"https://app.test.dahehuoyun.com/api/\"")
|
||||
buildConfigField "boolean", "isTest", "true"
|
||||
//APP名称,可以在androidMainfest中引用
|
||||
resValue "string", "appName", "司机测试"
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "大河好运司机"]
|
||||
buildConfigField("String", "OPEN_API_URL", "\"http://192.168.111.244:4009\"")
|
||||
buildConfigField("String", "BASE_URL", "\"http://app.dahehuoyun.com/api/\"")
|
||||
}
|
||||
product {
|
||||
applicationId "com.arpa.hndahesudintocctmsdriver"
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "大河好运司机",
|
||||
app_icon : "@drawable/diver_logo",
|
||||
GAODEKEY : "9480fd96746922630e9bf6c75a101059",
|
||||
JPUSH_PKGNAME: applicationId,
|
||||
JPUSH_APPKEY : "fba6f55621c670d8c1fe9191", //JPush 上注册的包名对应的 Appkey.
|
||||
JPUSH_CHANNEL: "developer-default"//暂时填写默认值即可.
|
||||
]
|
||||
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi.alct56.com\"")
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "大河好运司机"]
|
||||
buildConfigField("String", "AL_BASE", "\"https://oapi.alct56.com\"")
|
||||
buildConfigField("String", "BASE_URL", "\"http://app.dahehuoyun.com/api/\"")
|
||||
buildConfigField "boolean", "isTest", "false"
|
||||
//APP名称,可以在androidMainfest中引用
|
||||
resValue "string", "appName", "大河好运司机"
|
||||
}
|
||||
|
||||
}
|
||||
// productFlavors.all { flavor ->
|
||||
// flavor.manifestPlaceholders = [CHANNEL_VALUE: name]
|
||||
// }
|
||||
productFlavors.all { flavor ->
|
||||
flavor.manifestPlaceholders = [CHANNEL_VALUE: name]
|
||||
}
|
||||
|
||||
|
||||
android.applicationVariants.all { variant ->
|
||||
variant.outputs.all {
|
||||
def date = new Date().format("MMdd_HH-mm" , TimeZone.getTimeZone("GMT+08"))
|
||||
def isText = variant.productFlavors[0].properties.get("buildConfigFields").getAt("isTest").properties.get("value")
|
||||
def appName = null
|
||||
if (isText == "true") {
|
||||
appName = '大河好运司机测试_'
|
||||
} else {
|
||||
appName = '大河好运司机_'
|
||||
if(variant.buildType.name.equals('release')){
|
||||
outputFileName = "dhhy-driver-"+date+"-${versionName}.apk"
|
||||
}
|
||||
outputFileName = appName + "${variant.buildType.name}_${defaultConfig.versionName}_${date}.apk"
|
||||
}
|
||||
}
|
||||
lintOptions {
|
||||
@@ -159,8 +143,6 @@ dependencies {
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
|
||||
implementation 'com.caverock:androidsvg-aar:1.3'
|
||||
|
||||
//当引入的与之前引入的库有重复冲突部分的时候,使用compileOnly
|
||||
implementation files('libs\\mdp_sdk.jar')
|
||||
//压缩工具
|
||||
implementation 'top.zibin:Luban:1.1.3'
|
||||
//角标
|
||||
@@ -171,14 +153,13 @@ dependencies {
|
||||
implementation 'com.scwang.smart:refresh-footer-ball:2.0.1' //球脉冲加载
|
||||
implementation 'com.scwang.smart:refresh-footer-classics:2.0.1' //经典加载
|
||||
//更新版本
|
||||
implementation 'com.github.jenly1314.AppUpdater:app-updater:1.2.0'
|
||||
implementation 'com.github.jenly1314.AppUpdater:app-dialog:1.2.0'
|
||||
implementation 'com.github.jenly1314.AppUpdater:app-updater:1.1.0'
|
||||
implementation 'com.github.jenly1314.AppUpdater:app-dialog:1.1.0'
|
||||
//轮播插件
|
||||
implementation 'com.github.zhpanvip:BannerViewPager:3.5.4'
|
||||
//
|
||||
//弹出框
|
||||
// implementation 'com.lxj:xpopup:2.2.8'
|
||||
//工具类
|
||||
//implementation 'cn.hutool:hutool-all:5.7.11'
|
||||
// implementation 'com.github.li-xiaojun:XPopup:2.8.15'
|
||||
//交通厅
|
||||
implementation 'com.lzy.net:okgo:3.0.4'
|
||||
implementation 'com.alibaba:fastjson:1.2.61'
|
||||
@@ -186,12 +167,12 @@ dependencies {
|
||||
implementation 'org.apache.commons:commons-lang3:3.5'
|
||||
implementation (name:'locationgd-androidx_2.1.0', ext:'aar')//交通厅
|
||||
//安联
|
||||
// implementation 'com.google.code.gson:gson:2.8.6'
|
||||
implementation 'com.loopj.android:android-async-http:1.4.9'
|
||||
implementation 'com.j256.ormlite:ormlite-android:4.48'
|
||||
implementation 'com.j256.ormlite:ormlite-core:4.48'
|
||||
compileOnly 'com.github.hotchemi:permissionsdispatcher:2.3.1'
|
||||
annotationProcessor 'com.github.hotchemi:permissionsdispatcher-processor:2.3.1'
|
||||
implementation "org.permissionsdispatcher:permissionsdispatcher:4.6.0"
|
||||
kapt "org.permissionsdispatcher:permissionsdispatcher-processor:4.6.0"
|
||||
|
||||
//极光认证
|
||||
implementation 'cn.jiguang.sdk:jverification:2.7.1' // 此处以2.7.1 版本为例。a
|
||||
implementation 'cn.jiguang.sdk:jpush:4.2.4' // 此处以JPush 4.2.4 版本为例。
|
||||
@@ -203,31 +184,24 @@ dependencies {
|
||||
implementation 'com.umeng.umsdk:asms:1.4.1'// 必选
|
||||
implementation 'com.umeng.umsdk:apm:1.4.2' // 错误分析升级为独立SDK,看crash数据请一定集成,可选
|
||||
implementation 'com.umeng.umsdk:abtest:1.0.0'//使用U-App中ABTest能力,可选
|
||||
//动态权限获取
|
||||
implementation "org.permissionsdispatcher:permissionsdispatcher:4.6.0"
|
||||
kapt "org.permissionsdispatcher:permissionsdispatcher-processor:4.6.0"
|
||||
|
||||
//选择器
|
||||
implementation 'com.github.gzu-liyujiang.AndroidPicker:WheelPicker:3.1.1'
|
||||
//EventBus
|
||||
implementation 'org.greenrobot:eventbus:3.1.1'
|
||||
//易签宝
|
||||
implementation(name: 'EsignSDK', ext: 'aar')
|
||||
implementation 'pub.devrel:easypermissions:1.3.0'
|
||||
|
||||
implementation "com.squareup.retrofit2:retrofit:2.4.0"
|
||||
// implementation "com.squareup.retrofit2:converter-gson:2.4.0"
|
||||
implementation "com.squareup.retrofit2:adapter-rxjava2:2.4.0"
|
||||
// implementation 'com.squareup.okhttp3:logging-interceptor:3.9.0'
|
||||
|
||||
implementation "io.reactivex.rxjava2:rxjava:2.1.5"
|
||||
implementation "io.reactivex.rxjava2:rxandroid:2.0.1"
|
||||
|
||||
//pdf展示
|
||||
implementation 'com.github.barteksc:android-pdf-viewer:3.2.0-beta.1'
|
||||
//
|
||||
//工具类
|
||||
//implementation 'cn.hutool:hutool-all:5.7.11'
|
||||
implementation 'com.github.getActivity:XToast:8.2'
|
||||
|
||||
//易签宝
|
||||
implementation(name:'EsignSDK', ext:'aar')
|
||||
|
||||
//当引入的与之前引入的库有重复冲突部分的时候,使用compileOnly
|
||||
implementation files('libs\\mdp_sdk.jar')
|
||||
|
||||
implementation project(path: ':mylibrary')
|
||||
implementation 'com.lk.mapsdk:sdk-full:2.3.7'
|
||||
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -2,8 +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" />
|
||||
<!-- 基础权限 -->
|
||||
@@ -15,12 +13,8 @@
|
||||
<!--播音-->
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<!-- 地图截屏图片保存等 -->
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_PERMISSION" />
|
||||
<!-- 极光 -->
|
||||
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||
<uses-permission android:name="android.permission.READ_PROFILE" />
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" />
|
||||
<uses-permission android:name="android.permission.CALL_PHONE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
@@ -28,7 +22,6 @@
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
|
||||
|
||||
<!-- Optional -->
|
||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <!-- 用于开启 debug 版本的应用在6.0 系统上 层叠窗口权限 -->
|
||||
@@ -54,30 +47,25 @@
|
||||
<uses-permission android:name="android.permission.NFC" />
|
||||
<application
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.App"
|
||||
android:allowBackup="true"
|
||||
android:allowBackup="false"
|
||||
android:excludeFromRecents="true"
|
||||
android:icon="@mipmap/diver_logo"
|
||||
android:label="@string/appName"
|
||||
android:icon="@drawable/diver_logo"
|
||||
android:label="@string/app_name"
|
||||
android:largeHeap="true"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:usesCleartextTraffic="true"
|
||||
tools:replace="android:label,android:allowBackup">
|
||||
tools:replace="android:icon,android:allowBackup">
|
||||
|
||||
<uses-library
|
||||
android:name="com/alct/mdp"
|
||||
android:required="false" />
|
||||
|
||||
<meta-data
|
||||
android:name="com.lk.lbsapi.API_KEY"
|
||||
android:value="EE1721986040968235494A762772C95410D9881BB10790FC0BCRFNPFKW4K6697" />
|
||||
|
||||
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.MainActivity"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="true"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait" ></activity>
|
||||
|
||||
@@ -101,42 +89,13 @@
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.PhotoCarActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.VehicleAuthActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity"
|
||||
android:screenOrientation="portrait">
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.nfc.action.TAG_DISCOVERED" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
|
||||
<data android:mimeType="*/*" />
|
||||
</intent-filter>
|
||||
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivityBC"
|
||||
android:screenOrientation="portrait">
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.nfc.action.TAG_DISCOVERED" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
|
||||
<data android:mimeType="*/*" />
|
||||
</intent-filter>
|
||||
|
||||
</activity>
|
||||
|
||||
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity2"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait">
|
||||
|
||||
<intent-filter>
|
||||
@@ -169,8 +128,7 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.AddCarSuccActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
@@ -179,7 +137,6 @@
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.login.WelcomeActivity"
|
||||
android:exported="true"
|
||||
android:screenOrientation="portrait">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
@@ -198,9 +155,7 @@
|
||||
android:screenOrientation="portrait">
|
||||
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.drivercircle.VideoReleaseActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.WebPDFActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
@@ -257,7 +212,7 @@
|
||||
android:process=":remote"></service>
|
||||
<service
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.service.PlayerMusicService"
|
||||
android:exported="true"
|
||||
android:exported="false"
|
||||
android:process=":music_v1" />
|
||||
<service
|
||||
android:name="com.alct.mdp.job.LocationUploadJobService"
|
||||
@@ -273,7 +228,7 @@
|
||||
<!--高德地图-->
|
||||
<meta-data
|
||||
android:name="com.amap.api.v2.apikey"
|
||||
android:value="${GAODEKEY}" />
|
||||
android:value="78019612271411eca3af34db91930620" />
|
||||
<!-- android:value="702eaa84675618b8eb69298d9fd42ca3" />-->
|
||||
|
||||
<service android:name="com.amap.api.location.APSService"></service>
|
||||
@@ -285,7 +240,7 @@
|
||||
<!-- 极光-->
|
||||
<meta-data
|
||||
android:name="JPUSH_APPKEY"
|
||||
android:value="fba6f55621c670d8c1fe9191" /> <!-- </>值来自开发者平台取得的AppKey -->
|
||||
android:value="571d93ae5117da6dee848c92" /> <!-- </>值来自开发者平台取得的AppKey -->
|
||||
|
||||
<meta-data
|
||||
android:name="JPUSH_CHANNEL"
|
||||
@@ -315,8 +270,10 @@
|
||||
<!-- 易签宝 -->
|
||||
<activity
|
||||
android:name="com.esign.esignsdk.h5.H5Activity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
|
||||
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
|
||||
tools:ignore="AppLinkUrlError">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
@@ -332,7 +289,7 @@
|
||||
<!-- 若您的业务中有使用极光富媒体功能,或者极光早上好功能,需要把此 Activity 的 exported 修改成 true 覆盖 mavenCentral 上的组件。 -->
|
||||
<activity
|
||||
android:name="cn.jpush.android.ui.PopWinActivity"
|
||||
android:exported="true"
|
||||
android:exported="false"
|
||||
android:theme="@style/MyDialogStyle"
|
||||
tools:node="replace">
|
||||
<intent-filter>
|
||||
@@ -346,7 +303,7 @@
|
||||
<activity
|
||||
android:name="cn.jpush.android.ui.PushActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:exported="true"
|
||||
android:exported="false"
|
||||
android:theme="@android:style/Theme.NoTitleBar"
|
||||
tools:node="replace">
|
||||
<intent-filter>
|
||||
@@ -357,7 +314,8 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity android:name=".ui.NFCActivity">
|
||||
<activity android:name=".ui.NFCActivity"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="android.nfc.action.TAG_DISCOVERED" />
|
||||
|
||||
@@ -367,28 +325,6 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".H5Activity"
|
||||
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" />
|
||||
|
||||
<data
|
||||
android:host="demo"
|
||||
android:path="/signBack"
|
||||
android:scheme="esign" />
|
||||
<data
|
||||
android:host="demo"
|
||||
android:path="/realBack"
|
||||
android:scheme="esign" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<service
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.push.XService"
|
||||
android:enabled="true"
|
||||
@@ -409,7 +345,7 @@
|
||||
</receiver>
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
android:authorities="com.arpa.hndahesudintocctmsdriver.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true"
|
||||
tools:ignore="WrongManifestParent">
|
||||
|
||||
@@ -2,10 +2,7 @@ package com.arpa.hndahesudintocctmsdriver;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.app.Application;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
@@ -14,30 +11,18 @@ import android.util.Log;
|
||||
import com.alct.mdp.MDPLocationCollectionManager;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.net.Api;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.BillLocationUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.dahe.mylibrary.CommonBaseLibrary;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.esign.esignsdk.EsignSdk;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||
import com.gyf.cactus.Cactus;
|
||||
import com.gyf.cactus.callback.CactusBackgroundCallback;
|
||||
import com.gyf.cactus.callback.CactusCallback;
|
||||
import com.lk.mapsdk.base.mapapi.initializer.InitializerOptions;
|
||||
import com.lk.mapsdk.base.mapapi.initializer.SDKInitializer;
|
||||
import com.lk.mapsdk.base.mapapi.model.CoordType;
|
||||
import com.tencent.bugly.crashreport.CrashReport;
|
||||
import com.umeng.commonsdk.UMConfigure;
|
||||
|
||||
import cn.jiguang.verifysdk.api.JVerificationInterface;
|
||||
|
||||
public class App extends Application {
|
||||
|
||||
// String key = "f9d35b1133cff1f6e3960c89b249e03f";
|
||||
String key = "19ac0aa74338e487e45057faf7212401";
|
||||
String license = "HF41uGxM/1i3CtW98DimoA97BlNTAnQ+DiEAihYmZ2jR1jqC4be253joEJbOJgFDIzp5aIoeuXSWWHFaDVfaHL2Pksbq5f8M8EqsVhP9q/i1xGYSYf6MJVlHdMAVLWgR0Kra+n8dVzkSDuZeyJuDsskAmZaGFQN1CqnWYCI1tmV1Tk4A57e9LQMed0U11QWjdshdU2DGqBXKmGE419PdW3NmIxOR2u9iB1OKBmvzCUT8RAYyBzSn/yhU++YJ25g5a8Pb5kOvi+eOh+PEFEcQL6oOp/CF4Iw5nadlsLhc+XEnVJpwL2myZBoSlVcKxrJKbRn1/DIgXBueKKnqhyHKdJlpqI9eghAlRF0p2Q4f23m89mWRZf4nhKzTeXGIjCTFO4TNVucrlGU7tyJcrRCDVdfV24fziH+hB3QGckpuYzzjefr7hZalLRJ/w8dPw/8dCY1wnWq3AJ3zw2g1PzMxl51q7AgdKvwc1ERcGBns0zb8PK6vGKCnJq3uHiJEnslbTI0MEosje+h+OPO7hf2QofErewjI19wHEOv4dTvuFLh3VmGFMObAmov5kI47705fjSxCvAPGATBrfUSwim+5EQ1hanc5IcXe0/nOTiRUNEpZ+x65zVydqAs7490yqQiIUQvPazEwcal7vH2OD54lCcgpxKxqdmGc5/bp5UnqB45+n+iuInV/Q9DMOQVk15uaVZmhS8VaCqH21CmfH/ZGLb9wiEpaRLrPZLKX3bK7MT9Z0/OlDnb2QUKU8LMMIhLuQQntzsf0Wn4kA/0e9QAJJQ==";
|
||||
|
||||
// String license = "eQQm7gCZPF58Cy4i9OGkqSdFdDnFF0VSUVpw92WcrNLx7zVbpGJwjQhnKL8b0piApIbOTog5log/S1ZIxoUQogueaG84BQlJfRwKjtvpVWImlmhthQyQd2ogRqGkm3rkVGeG9wK49fzP3g5AtghNF05je2rQWd/Tyy/wutXq0e0rvR/bEckFaZ4BesQaYd0MejFC3lA8BjxNWiuvCKs15e1aRUOU5vwN5wsaTsTHokBIYhioSxOoGgHn6NrX6K9Dsl9uTWZ2dOVK/jEzYsNt6E/1Ww2ck1XmIWdRCQNmCpgikuPT0ACAL/w7UaRoWzM/Pm+akWqyp+bEavHT1Vhug3HAHOSGfOghGw2NerNlyEg8h6cVneMx+TsidnQ0ZG29aqdcLBRsvi26BYJJCA8+0WXjT+73RhS8g97Rfb6h0/W//5Az8UNZ6dp6XvUi2EJXQRhY5hkHiuwWT2W1ik+6wiiURkkrBACKbO1kmZWbVpRIe3Y3pcr3Q/V+oAcyPHRXCxu+JIe/j40/epuRrCyf8yvKsZ2Dnkl4QQmlwNqlW1F/arS+19G6zOG+6VKwtbI01A1R9SU1TYOA5UL/Qpo6Gyi3Ec3/irgQlzkq1rZrOIS4oo6tghul/zcG8rjno3luqHYwIZf8vAVfpwBesIVcANCOIuTRPU3A8vdmUoK/twGIchPapmjlAzLhjZ4KoAbNeMsWu3sN6kF44xofLMghos2X8OtvUA9CMD37v2FpYoM75qavyoivsBAbb6mG0p5TmkZ37BxfaGGP6SYrCa9ygQ==";
|
||||
String key = "f9d35b1133cff1f6e3960c89b249e03f";
|
||||
String license = "eQQm7gCZPF58Cy4i9OGkqSdFdDnFF0VSUVpw92WcrNLx7zVbpGJwjQhnKL8b0piApIbOTog5log/S1ZIxoUQogueaG84BQlJfRwKjtvpVWImlmhthQyQd2ogRqGkm3rkVGeG9wK49fzP3g5AtghNF05je2rQWd/Tyy/wutXq0e0rvR/bEckFaZ4BesQaYd0MejFC3lA8BjxNWiuvCKs15e1aRUOU5vwN5wsaTsTHokBIYhioSxOoGgHn6NrX6K9Dsl9uTWZ2dOVK/jEzYsNt6E/1Ww2ck1XmIWdRCQNmCpgikuPT0ACAL/w7UaRoWzM/Pm+akWqyp+bEavHT1Vhug3HAHOSGfOghGw2NerNlyEg8h6cVneMx+TsidnQ0ZG29aqdcLBRsvi26BYJJCA8+0WXjT+73RhS8g97Rfb6h0/W//5Az8UNZ6dp6XvUi2EJXQRhY5hkHiuwWT2W1ik+6wiiURkkrBACKbO1kmZWbVpRIe3Y3pcr3Q/V+oAcyPHRXCxu+JIe/j40/epuRrCyf8yvKsZ2Dnkl4QQmlwNqlW1F/arS+19G6zOG+6VKwtbI01A1R9SU1TYOA5UL/Qpo6Gyi3Ec3/irgQlzkq1rZrOIS4oo6tghul/zcG8rjno3luqHYwIZf8vAVfpwBesIVcANCOIuTRPU3A8vdmUoK/twGIchPapmjlAzLhjZ4KoAbNeMsWu3sN6kF44xofLMghos2X8OtvUA9CMD37v2FpYoM75qavyoivsBAbb6mG0p5TmkZ37BxfaGGP6SYrCa9ygQ==";
|
||||
|
||||
public final static int APP_STATUS_KILLED = 0; // 表示应用是被杀死后在启动的
|
||||
public final static int APP_STATUS_NORMAL = 1; // 表示应用时正常的启动流程
|
||||
@@ -48,22 +33,11 @@ public class App extends Application {
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
mApplication = this;
|
||||
//初始化log
|
||||
LogUtil.init(BuildConfig.DEBUG);
|
||||
con = getBaseContext();
|
||||
CommonBaseLibrary.getInstance().init(this, Api.BASE_URL);
|
||||
CrashReport.initCrashReport(getApplicationContext(), "0fa55ffad8", false);
|
||||
String state = SPUtil.getSP(con, "state_data", "authorization_state");
|
||||
|
||||
InitializerOptions options = new InitializerOptions();
|
||||
// 设置是否使用Https网络请求,默认使用
|
||||
options.setHttpsEnable(true);
|
||||
// 设置坐标系,默认GCJ02
|
||||
options.setCoordType(CoordType.GCJ02);
|
||||
// SDK 初始化
|
||||
SDKInitializer.initialization(getApplicationContext(), options);
|
||||
|
||||
// Log 开关使能
|
||||
SDKInitializer.setLogEnable(true);
|
||||
|
||||
if ("1".equals(state)) {
|
||||
try {
|
||||
Context context = getApplicationContext();
|
||||
@@ -73,8 +47,8 @@ public class App extends Application {
|
||||
res.updateConfiguration(config, res.getDisplayMetrics());
|
||||
//安联初始化
|
||||
if (context.getPackageName().equals(getCurrentProcessName(context))) {
|
||||
//Log.e("--使用的测试环境--",BuildConfig.OPEN_API_URL);
|
||||
MDPLocationCollectionManager.initialize(this, BuildConfig.OPEN_AL_URL);
|
||||
//LogUtil.e("--使用的测试环境--",BuildConfig.OPEN_API_URL);
|
||||
MDPLocationCollectionManager.initialize(this, BuildConfig.AL_BASE);
|
||||
}
|
||||
//在使用SDK各组件之前初始化context信息,传入ApplicationContext
|
||||
// 路由初始化
|
||||
@@ -89,33 +63,9 @@ public class App extends Application {
|
||||
JTTProcess.init(this);
|
||||
//QupaiHttpFinal.getInstance().initOkHttpFinal();
|
||||
} catch (Exception e) {
|
||||
Log.e("-error-", "初始化失败sss");
|
||||
LogUtil.e("-error-", "初始化失败sss");
|
||||
}
|
||||
}
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
public static App getApp() {
|
||||
@@ -136,10 +86,6 @@ public class App extends Application {
|
||||
UMConfigure.init(getApplicationContext(), UMConfigure.DEVICE_TYPE_PHONE, "");
|
||||
}
|
||||
|
||||
private void getBillLocation() {
|
||||
BillLocationUtils.getInstance().getBillLocation(con);
|
||||
}
|
||||
|
||||
private static String getCurrentProcessName(Context context) {
|
||||
String currentProcessName = "";
|
||||
int pid = android.os.Process.myPid();
|
||||
|
||||
@@ -1,481 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver;
|
||||
|
||||
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.view.View;
|
||||
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.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
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.ui.UiAuxiliary;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.home.StartYunDanActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.esign.esignsdk.EsignSdk;
|
||||
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 static android.webkit.WebSettings.LOAD_NO_CACHE;
|
||||
|
||||
/**
|
||||
* @author xingtian on 2019/3/25
|
||||
*/
|
||||
public class H5Activity 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);
|
||||
|
||||
|
||||
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(H5Activity.this, "签署结果: " + " signResult = " + signResult, Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
String tsignCode = uri.getQueryParameter("tsignCode");
|
||||
if ("0".equals(tsignCode)) {
|
||||
tsignCode = "签署成功";
|
||||
} else {
|
||||
tsignCode = "签署失败";
|
||||
}
|
||||
Toast.makeText(H5Activity.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) {
|
||||
//认证成功返回
|
||||
Toast.makeText(H5Activity.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) {
|
||||
//认证成功返回
|
||||
Toast.makeText(H5Activity.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(H5Activity.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(H5Activity.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(H5Activity.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 + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -66,11 +66,6 @@ public class CarDelBean {
|
||||
private String owner;
|
||||
private String roadLicense;
|
||||
private String roadLicensePhoto;
|
||||
private String trailerLicenseId;
|
||||
|
||||
private String policyPhotoUrl;
|
||||
private String insuranceCompany;
|
||||
private String insuranceEndDay;
|
||||
private String roadLicenseSend;
|
||||
private String roadLicenseValidity;
|
||||
private String threeImage;
|
||||
@@ -82,23 +77,6 @@ public class CarDelBean {
|
||||
private String registerNo;
|
||||
private String carEnergyTypValue;
|
||||
private String carPlateColorValue;
|
||||
private String needUpQCPhoto;
|
||||
|
||||
public String getTrailerLicenseId() {
|
||||
return trailerLicenseId;
|
||||
}
|
||||
|
||||
public void setTrailerLicenseId(String trailerLicenseId) {
|
||||
this.trailerLicenseId = trailerLicenseId;
|
||||
}
|
||||
|
||||
public String getNeedUpQCPhoto() {
|
||||
return needUpQCPhoto;
|
||||
}
|
||||
|
||||
public void setNeedUpQCPhoto(String needUpQCPhoto) {
|
||||
this.needUpQCPhoto = needUpQCPhoto;
|
||||
}
|
||||
|
||||
public String getCarPlateColorValue() {
|
||||
return carPlateColorValue;
|
||||
@@ -108,30 +86,6 @@ public class CarDelBean {
|
||||
this.carPlateColorValue = carPlateColorValue;
|
||||
}
|
||||
|
||||
public String getPolicyPhotoUrl() {
|
||||
return policyPhotoUrl == null ? "" : policyPhotoUrl;
|
||||
}
|
||||
|
||||
public void setPolicyPhotoUrl(String policyPhotoUrl) {
|
||||
this.policyPhotoUrl = policyPhotoUrl;
|
||||
}
|
||||
|
||||
public String getInsuranceCompany() {
|
||||
return insuranceCompany == null ? "" : insuranceCompany;
|
||||
}
|
||||
|
||||
public void setInsuranceCompany(String insuranceCompany) {
|
||||
this.insuranceCompany = insuranceCompany;
|
||||
}
|
||||
|
||||
public String getInsuranceEndDay() {
|
||||
return insuranceEndDay == null ? "" : insuranceEndDay;
|
||||
}
|
||||
|
||||
public void setInsuranceEndDay(String insuranceEndDay) {
|
||||
this.insuranceEndDay = insuranceEndDay;
|
||||
}
|
||||
|
||||
public String getCarEnergyTypValue() {
|
||||
return carEnergyTypValue;
|
||||
}
|
||||
@@ -308,15 +262,6 @@ public class CarDelBean {
|
||||
private String threeImage;
|
||||
private String type;
|
||||
private String vehicleNumber;
|
||||
private String trailerLicenseId;
|
||||
|
||||
public String getTrailerLicenseId() {
|
||||
return trailerLicenseId;
|
||||
}
|
||||
|
||||
public void setTrailerLicenseId(String trailerLicenseId) {
|
||||
this.trailerLicenseId = trailerLicenseId;
|
||||
}
|
||||
|
||||
public String getBackImage() {
|
||||
return backImage == null ? "" : backImage;
|
||||
|
||||
@@ -1,150 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName CarInfoBean
|
||||
* @Author 用户
|
||||
* @Date 2023/8/17 15:35
|
||||
* @Description TODO
|
||||
*/
|
||||
public class CarInfoBean {
|
||||
|
||||
|
||||
private int code;
|
||||
private DataDTO data;
|
||||
private String msg;
|
||||
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 int getRes() {
|
||||
return res;
|
||||
}
|
||||
|
||||
public void setRes(int res) {
|
||||
this.res = res;
|
||||
}
|
||||
|
||||
public Boolean getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(Boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public static class DataDTO {
|
||||
private Object code;
|
||||
private DataDTO.DataDTO2 data;
|
||||
private Object message;
|
||||
private String forceMatching;
|
||||
|
||||
|
||||
public String getForceMatching() {
|
||||
return forceMatching;
|
||||
}
|
||||
|
||||
public void setForceMatching(String forceMatching) {
|
||||
this.forceMatching = forceMatching;
|
||||
}
|
||||
|
||||
public Object getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(Object code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public DataDTO2 getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(DataDTO2 data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public Object getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(Object message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public static class DataDTO2 {
|
||||
private List<DataDTO.DataDTO2.PrismKeyValueInfoDTO> prism_keyValueInfo;
|
||||
|
||||
public List<DataDTO.DataDTO2.PrismKeyValueInfoDTO> getPrism_keyValueInfo() {
|
||||
return prism_keyValueInfo;
|
||||
}
|
||||
|
||||
public void setPrism_keyValueInfo(List<DataDTO.DataDTO2.PrismKeyValueInfoDTO> prism_keyValueInfo) {
|
||||
this.prism_keyValueInfo = prism_keyValueInfo;
|
||||
}
|
||||
|
||||
public static class PrismKeyValueInfoDTO {
|
||||
private int keyProb;
|
||||
private int valueProb;
|
||||
private String value;
|
||||
private String key;
|
||||
|
||||
public int getKeyProb() {
|
||||
return keyProb;
|
||||
}
|
||||
|
||||
public void setKeyProb(int keyProb) {
|
||||
this.keyProb = keyProb;
|
||||
}
|
||||
|
||||
public int getValueProb() {
|
||||
return valueProb;
|
||||
}
|
||||
|
||||
public void setValueProb(int valueProb) {
|
||||
this.valueProb = valueProb;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -56,33 +56,6 @@ public class CarZhengBean {
|
||||
|
||||
public static class DataDTO {
|
||||
private int carId;
|
||||
private String needUpQCPhoto;
|
||||
private String isTrailer;
|
||||
private String needUpRLPhoto;
|
||||
|
||||
public String getNeedUpRLPhoto() {
|
||||
return needUpRLPhoto;
|
||||
}
|
||||
|
||||
public void setNeedUpRLPhoto(String needUpRLPhoto) {
|
||||
this.needUpRLPhoto = needUpRLPhoto;
|
||||
}
|
||||
|
||||
public String getIsTrailer() {
|
||||
return isTrailer;
|
||||
}
|
||||
|
||||
public void setIsTrailer(String isTrailer) {
|
||||
this.isTrailer = isTrailer;
|
||||
}
|
||||
|
||||
public String getNeedUpQCPhoto() {
|
||||
return needUpQCPhoto;
|
||||
}
|
||||
|
||||
public void setNeedUpQCPhoto(String needUpQCPhoto) {
|
||||
this.needUpQCPhoto = needUpQCPhoto;
|
||||
}
|
||||
|
||||
public int getCarId() {
|
||||
return carId;
|
||||
|
||||
@@ -48,33 +48,6 @@ public class DriverExpireBean {
|
||||
public static class DataDTO {
|
||||
private String driverLicenseUpdateUrl;
|
||||
private String idCardUpdateUrl;
|
||||
private String qualificationUpdateUrl;
|
||||
private String roadLicenseUpdateUrl;
|
||||
private String insuranceUpdateUrl;
|
||||
|
||||
public String getRoadLicenseUpdateUrl() {
|
||||
return roadLicenseUpdateUrl;
|
||||
}
|
||||
|
||||
public void setRoadLicenseUpdateUrl(String roadLicenseUpdateUrl) {
|
||||
this.roadLicenseUpdateUrl = roadLicenseUpdateUrl;
|
||||
}
|
||||
|
||||
public String getInsuranceUpdateUrl() {
|
||||
return insuranceUpdateUrl;
|
||||
}
|
||||
|
||||
public void setInsuranceUpdateUrl(String insuranceUpdateUrl) {
|
||||
this.insuranceUpdateUrl = insuranceUpdateUrl;
|
||||
}
|
||||
|
||||
public String getQualificationUpdateUrl() {
|
||||
return qualificationUpdateUrl;
|
||||
}
|
||||
|
||||
public void setQualificationUpdateUrl(String qualificationUpdateUrl) {
|
||||
this.qualificationUpdateUrl = qualificationUpdateUrl;
|
||||
}
|
||||
|
||||
public String getDriverLicenseUpdateUrl() {
|
||||
return driverLicenseUpdateUrl;
|
||||
|
||||
-9
@@ -59,7 +59,6 @@ public class OCRVehicleBackLicenseBean {
|
||||
private int id;
|
||||
private String url;
|
||||
private String checkRecord;
|
||||
private String isSave;
|
||||
private String approvedCapacity;
|
||||
private String allCapacity;
|
||||
private String size;
|
||||
@@ -72,14 +71,6 @@ public class OCRVehicleBackLicenseBean {
|
||||
private String carNumber;
|
||||
private int licenseId;
|
||||
|
||||
public String getIsSave() {
|
||||
return isSave;
|
||||
}
|
||||
|
||||
public void setIsSave(String isSave) {
|
||||
this.isSave = isSave;
|
||||
}
|
||||
|
||||
public int getLicenseId() {
|
||||
return licenseId;
|
||||
}
|
||||
|
||||
@@ -49,9 +49,7 @@ public class OCRVehicleLicenseBean {
|
||||
private String address;
|
||||
private int carId;
|
||||
private String carNumber;
|
||||
private boolean carExist;
|
||||
private String dateIssue;
|
||||
private String backImage;
|
||||
private String engineNumber;
|
||||
private int id;
|
||||
private String model;
|
||||
@@ -62,41 +60,6 @@ public class OCRVehicleLicenseBean {
|
||||
private String type;
|
||||
private String url;
|
||||
private String vehicleNumber;
|
||||
private String licenseId;
|
||||
|
||||
public String getLicenseId() {
|
||||
return licenseId;
|
||||
}
|
||||
|
||||
public void setLicenseId(String licenseId) {
|
||||
this.licenseId = licenseId;
|
||||
}
|
||||
|
||||
private DataDto2 existCarInfo;
|
||||
|
||||
public DataDto2 getExistCarInfo() {
|
||||
return existCarInfo;
|
||||
}
|
||||
|
||||
public void setExistCarInfo(DataDto2 existCarInfo) {
|
||||
this.existCarInfo = existCarInfo;
|
||||
}
|
||||
|
||||
public boolean isCarExist() {
|
||||
return carExist;
|
||||
}
|
||||
|
||||
public String getBackImage() {
|
||||
return backImage;
|
||||
}
|
||||
|
||||
public void setBackImage(String backImage) {
|
||||
this.backImage = backImage;
|
||||
}
|
||||
|
||||
public void setCarExist(boolean carExist) {
|
||||
this.carExist = carExist;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address == null ? "" : address;
|
||||
@@ -210,44 +173,4 @@ public class OCRVehicleLicenseBean {
|
||||
this.vehicleNumber = vehicleNumber;
|
||||
}
|
||||
}
|
||||
|
||||
public static class DataDto2 {
|
||||
private String backImage;
|
||||
private String carId;
|
||||
private String licenseId;
|
||||
|
||||
private CarDelBean.DataDTO trailerResVo;
|
||||
|
||||
public CarDelBean.DataDTO getTrailerResVo() {
|
||||
return trailerResVo;
|
||||
}
|
||||
|
||||
public void setTrailerResVo(CarDelBean.DataDTO trailerResVo) {
|
||||
this.trailerResVo = trailerResVo;
|
||||
}
|
||||
|
||||
public String getLicenseId() {
|
||||
return licenseId;
|
||||
}
|
||||
|
||||
public void setLicenseId(String licenseId) {
|
||||
this.licenseId = licenseId;
|
||||
}
|
||||
|
||||
public String getBackImage() {
|
||||
return backImage == null ? "" : backImage;
|
||||
}
|
||||
|
||||
public void setBackImage(String backImage) {
|
||||
this.backImage = backImage;
|
||||
}
|
||||
|
||||
public String getCarId() {
|
||||
return carId;
|
||||
}
|
||||
|
||||
public void setCarId(String carId) {
|
||||
this.carId = carId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,7 +257,6 @@ public class StartOrderBean {
|
||||
private String realityTimeDate;
|
||||
private int status;
|
||||
private String longitude;
|
||||
private String imageTakenDate;
|
||||
private String latitude;
|
||||
private List<GoodsDTO> goods;
|
||||
private int report;
|
||||
@@ -281,14 +280,6 @@ public class StartOrderBean {
|
||||
private String distance;
|
||||
private int isEvaluation;
|
||||
|
||||
public String getImageTakenDate() {
|
||||
return imageTakenDate;
|
||||
}
|
||||
|
||||
public void setImageTakenDate(String imageTakenDate) {
|
||||
this.imageTakenDate = imageTakenDate;
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.constant;
|
||||
|
||||
/**
|
||||
* @ClassName HYConstant
|
||||
* @Author 用户
|
||||
* @Date 2023/8/29 09:32
|
||||
* @Description TODO
|
||||
*/
|
||||
public class HYConstant {
|
||||
|
||||
//-------------安联---------------start
|
||||
//企业代码
|
||||
private static final String ENTERPRISE_CODE="E0019169";
|
||||
//企业app的身份码
|
||||
private static final String APP_IDENTITY="b4a472a025e443b383970cdd5465552e";
|
||||
//企业app验证码
|
||||
private static final String APP_KEY="b948efbb4c2a4ba0805c534f2fba0c89";
|
||||
|
||||
//企业代码-测试
|
||||
private static final String ENTERPRISE_CODE_TEXT="E0019093";
|
||||
//企业app的身份码-测试
|
||||
private static final String APP_IDENTITY_TEXT="a15b4ba5bd2542cc9a6bea9bdadf9ef9";
|
||||
//企业app验证码-测试
|
||||
private static final String APP_KEY_TEXT="07a6256cad5642138ed6e962a5a157be";
|
||||
//-------------安联---------------end
|
||||
|
||||
|
||||
//-------------交通厅---------------start
|
||||
public final static String JTT_DATA_NAME="jtt_data";
|
||||
public final static String JTT_DATA_JTTORDER_KEY="JTT_order_key";
|
||||
public final static String JTT_DATA_ORDER_KEY="order_key";
|
||||
//-------------交通厅---------------end
|
||||
|
||||
//--------------E签宝--------------start
|
||||
String key = "19ac0aa74338e487e45057faf7212401";
|
||||
String license = "HF41uGxM/1i3CtW98DimoA97BlNTAnQ+DiEAihYmZ2jR1jqC4be253joEJbOJgFDIzp5aIoeuXSWWHFaDVfaHL2Pksbq5f8M8EqsVhP9q/i1xGYSYf6MJVlHdMAVLWgR0Kra+n8dVzkSDuZeyJuDsskAmZaGFQN1CqnWYCI1tmV1Tk4A57e9LQMed0U11QWjdshdU2DGqBXKmGE419PdW3NmIxOR2u9iB1OKBmvzCUT8RAYyBzSn/yhU++YJ25g5a8Pb5kOvi+eOh+PEFEcQL6oOp/CF4Iw5nadlsLhc+XEnVJpwL2myZBoSlVcKxrJKbRn1/DIgXBueKKnqhyHKdJlpqI9eghAlRF0p2Q4f23m89mWRZf4nhKzTeXGIjCTFO4TNVucrlGU7tyJcrRCDVdfV24fziH+hB3QGckpuYzzjefr7hZalLRJ/w8dPw/8dCY1wnWq3AJ3zw2g1PzMxl51q7AgdKvwc1ERcGBns0zb8PK6vGKCnJq3uHiJEnslbTI0MEosje+h+OPO7hf2QofErewjI19wHEOv4dTvuFLh3VmGFMObAmov5kI47705fjSxCvAPGATBrfUSwim+5EQ1hanc5IcXe0/nOTiRUNEpZ+x65zVydqAs7490yqQiIUQvPazEwcal7vH2OD54lCcgpxKxqdmGc5/bp5UnqB45+n+iuInV/Q9DMOQVk15uaVZmhS8VaCqH21CmfH/ZGLb9wiEpaRLrPZLKX3bK7MT9Z0/OlDnb2QUKU8LMMIhLuQQntzsf0Wn4kA/0e9QAJJQ==";
|
||||
//-------------E签宝---------------end
|
||||
|
||||
//--------------交通厅--------------start
|
||||
private final static String APPID="com.arpa.hndahesudintocctmsdriver";
|
||||
private final static String APP_SECURITY="01e20fc6585a42738ac88a12321dc41bff473b4b20184aacbbcee7d7864359a6";
|
||||
private final static String CODE="41110447";
|
||||
private final static String ENVIRONMENT="release";
|
||||
//-------------交通厅---------------end
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.cuspop
|
||||
|
||||
import android.Manifest
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import com.arpa.hndahesudintocctmsdriver.R
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil
|
||||
import com.dahe.mylibrary.utils.ToastUtils
|
||||
import com.lxj.xpopup.core.CenterPopupView
|
||||
import com.lxj.xpopup.util.XPermission
|
||||
import com.permissionx.guolindev.PermissionX
|
||||
import kotlinx.android.synthetic.main.load.view.*
|
||||
import kotlinx.android.synthetic.main.pop_message_center.view.*
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName MessagePop
|
||||
* @Author 用户
|
||||
* @Date 2023/8/14 18:01
|
||||
* @Description TODO
|
||||
*/
|
||||
class MessagePop(context: Context) : CenterPopupView(context), View.OnClickListener {
|
||||
|
||||
lateinit var content :String
|
||||
var secMessage :String? = ""
|
||||
|
||||
constructor(context: Context,message : String) :this(context) {
|
||||
content = message
|
||||
}
|
||||
|
||||
constructor(context: Context,message : String,message2 : String) :this(context) {
|
||||
content = message
|
||||
secMessage = message2
|
||||
}
|
||||
|
||||
override fun getImplLayoutId() = R.layout.pop_message_center
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
tvCancel.setOnClickListener(this)
|
||||
tvOk.setOnClickListener(this)
|
||||
tvPhone.setOnClickListener(this)
|
||||
tvContent.text = "$content"
|
||||
tvMessage2.text =secMessage
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
when(v?.id){
|
||||
R.id.tvCancel -> {
|
||||
dismiss()
|
||||
}
|
||||
R.id.tvOk,R.id.tvPhone -> {
|
||||
dismiss()
|
||||
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,"请开启电话权限")
|
||||
}
|
||||
|
||||
// BaseUtils.callPhone(content as Activity, tvPhone.text.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private var listener: OnMyItemClickListener? = null
|
||||
fun setOnMyItemClickListener(listener: OnMyItemClickListener?): MessagePop {
|
||||
this.listener = listener
|
||||
return this
|
||||
}
|
||||
|
||||
interface OnMyItemClickListener {
|
||||
fun onItemClick(startTime: String, endTime: String)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.cuspop
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
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.*
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName MessagePop
|
||||
* @Author 用户
|
||||
* @Date 2023/8/14 18:01
|
||||
* @Description TODO
|
||||
*/
|
||||
class SimCenterPop(context: Context) : CenterPopupView(context), View.OnClickListener {
|
||||
|
||||
lateinit var content: String
|
||||
lateinit var secMessage: String
|
||||
|
||||
constructor(context: Context, message: String) : this(context) {
|
||||
content = message
|
||||
}
|
||||
|
||||
|
||||
override fun getImplLayoutId() = R.layout.pop_sim_center
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
tvCancel.setOnClickListener(this)
|
||||
tvOk.setOnClickListener(this)
|
||||
tvContent.text = "$content"
|
||||
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
when (v?.id) {
|
||||
R.id.tvCancel -> {
|
||||
dismiss()
|
||||
}
|
||||
R.id.tvOk -> {
|
||||
dismiss()
|
||||
listener?.onItemClick()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private var listener: OnMyItemClickListener? = null
|
||||
fun setOnMyItemClickListener(listener: OnMyItemClickListener): SimCenterPop {
|
||||
this.listener = listener
|
||||
return this
|
||||
}
|
||||
|
||||
interface OnMyItemClickListener {
|
||||
fun onItemClick()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.event;
|
||||
|
||||
/**
|
||||
* @author hlh
|
||||
* @version 1.0.0
|
||||
* @date 2021/10/20 14:43
|
||||
* @description:
|
||||
*/
|
||||
public class FaceEvent {
|
||||
|
||||
private String message;
|
||||
|
||||
public FaceEvent(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.event;
|
||||
|
||||
/**
|
||||
* @author hlh
|
||||
* @version 1.0.0
|
||||
* @date 2021/11/2 18:51
|
||||
* @description:
|
||||
*/
|
||||
public class RefreshCarListEvent {
|
||||
private String message;
|
||||
|
||||
public RefreshCarListEvent(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.arpa.hndahesudintocctmsdriver.parts;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.google.gson.Gson;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.DriverAuthDataBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||
@@ -19,7 +20,7 @@ public class AuthParts {
|
||||
|
||||
public static DriverAuthDataBean getAuth(Context con){
|
||||
String authData=SPUtil.getSP(con,"data","authdata");
|
||||
Log.e("--data--",authData);
|
||||
LogUtil.e("--data--",authData);
|
||||
if("".equals(authData)){
|
||||
return null;
|
||||
}else {
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.arpa.hndahesudintocctmsdriver.service.MakeUpService;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.home.HuoYunDelActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.home.StartYunDanActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.login.WelcomeActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
@@ -25,7 +26,7 @@ public class PushMessageReceiver extends JPushMessageReceiver {
|
||||
|
||||
@Override
|
||||
public void onMessage(Context context, CustomMessage customMessage) {
|
||||
Log.e(TAG, "[onMessage] " + customMessage);
|
||||
LogUtil.e(TAG, "[onMessage] " + customMessage);
|
||||
Intent intent = new Intent("com.jiguang.demo.message");
|
||||
intent.putExtra("msg", customMessage.message);
|
||||
context.sendBroadcast(intent);
|
||||
@@ -33,7 +34,7 @@ public class PushMessageReceiver extends JPushMessageReceiver {
|
||||
|
||||
@Override
|
||||
public void onNotifyMessageOpened(Context context, NotificationMessage message) {
|
||||
Log.e(TAG, "[onNotifyMessageOpened] " + message);
|
||||
LogUtil.e(TAG, "[onNotifyMessageOpened] " + message);
|
||||
try{
|
||||
//打开自定义的Activity
|
||||
JSONObject json=new JSONObject(message.notificationExtras);
|
||||
@@ -41,7 +42,7 @@ public class PushMessageReceiver extends JPushMessageReceiver {
|
||||
String url=json.getString("url");
|
||||
if(url.indexOf("driver/detail")!=-1){
|
||||
int id=Integer.parseInt(url.split("=")[1]);
|
||||
Log.e("-url-",url+"_"+id);
|
||||
LogUtil.e("-url-",url+"_"+id);
|
||||
Intent in=new Intent(context, HuoYunDelActivity.class);
|
||||
in.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
|
||||
in.putExtra("id",Integer.parseInt(url.split("=")[1]));
|
||||
@@ -54,7 +55,7 @@ public class PushMessageReceiver extends JPushMessageReceiver {
|
||||
}
|
||||
|
||||
}catch (Throwable throwable){
|
||||
Log.e("123", "[onNotifyMessageOpened] " + message);
|
||||
LogUtil.e("123", "[onNotifyMessageOpened] " + message);
|
||||
Intent in=new Intent(context, WelcomeActivity.class);
|
||||
in.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
|
||||
context.startActivity(in);
|
||||
@@ -63,7 +64,7 @@ public class PushMessageReceiver extends JPushMessageReceiver {
|
||||
|
||||
@Override
|
||||
public void onMultiActionClicked(Context context, Intent intent) {
|
||||
Log.e(TAG, "[onMultiActionClicked] 用户点击了通知栏按钮");
|
||||
LogUtil.e(TAG, "[onMultiActionClicked] 用户点击了通知栏按钮");
|
||||
String nActionExtra = intent.getExtras().getString(JPushInterface.EXTRA_NOTIFICATION_ACTION_EXTRA);
|
||||
|
||||
//开发者根据不同 Action 携带的 extra 字段来分配不同的动作。
|
||||
@@ -72,19 +73,19 @@ public class PushMessageReceiver extends JPushMessageReceiver {
|
||||
return;
|
||||
}
|
||||
if (nActionExtra.equals("my_extra1")) {
|
||||
Log.e(TAG, "[onMultiActionClicked] 用户点击通知栏按钮一");
|
||||
LogUtil.e(TAG, "[onMultiActionClicked] 用户点击通知栏按钮一");
|
||||
} else if (nActionExtra.equals("my_extra2")) {
|
||||
Log.e(TAG, "[onMultiActionClicked] 用户点击通知栏按钮二");
|
||||
LogUtil.e(TAG, "[onMultiActionClicked] 用户点击通知栏按钮二");
|
||||
} else if (nActionExtra.equals("my_extra3")) {
|
||||
Log.e(TAG, "[onMultiActionClicked] 用户点击通知栏按钮三");
|
||||
LogUtil.e(TAG, "[onMultiActionClicked] 用户点击通知栏按钮三");
|
||||
} else {
|
||||
Log.e(TAG, "[onMultiActionClicked] 用户点击通知栏按钮未定义");
|
||||
LogUtil.e(TAG, "[onMultiActionClicked] 用户点击通知栏按钮未定义");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNotifyMessageArrived(Context context,NotificationMessage message) {
|
||||
Log.e(TAG, "[onNotifyMessageArrived] " + message);
|
||||
LogUtil.e(TAG, "[onNotifyMessageArrived] " + message);
|
||||
JSONObject json= null;
|
||||
String str="";
|
||||
try {
|
||||
@@ -103,24 +104,24 @@ public class PushMessageReceiver extends JPushMessageReceiver {
|
||||
|
||||
@Override
|
||||
public void onNotifyMessageDismiss(Context context, NotificationMessage message) {
|
||||
Log.e(TAG, "[onNotifyMessageDismiss] " + message);
|
||||
LogUtil.e(TAG, "[onNotifyMessageDismiss] " + message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRegister(Context context, String registrationId) {
|
||||
Log.e(TAG, "[onRegister] " + registrationId);
|
||||
LogUtil.e(TAG, "[onRegister] " + registrationId);
|
||||
Intent intent = new Intent("com.jiguang.demo.register");
|
||||
context.sendBroadcast(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnected(Context context, boolean isConnected) {
|
||||
Log.e(TAG, "[onConnected] " + isConnected);
|
||||
LogUtil.e(TAG, "[onConnected] " + isConnected);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommandResult(Context context, CmdMessage cmdMessage) {
|
||||
Log.e(TAG, "[onCommandResult] " + cmdMessage);
|
||||
LogUtil.e(TAG, "[onCommandResult] " + cmdMessage);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -150,7 +151,7 @@ public class PushMessageReceiver extends JPushMessageReceiver {
|
||||
@Override
|
||||
public void onNotificationSettingsCheck(Context context, boolean isOn, int source) {
|
||||
super.onNotificationSettingsCheck(context, isOn, source);
|
||||
Log.e(TAG, "[onNotificationSettingsCheck] isOn:" + isOn + ",source:" + source);
|
||||
LogUtil.e(TAG, "[onNotificationSettingsCheck] isOn:" + isOn + ",source:" + source);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+6
-4
@@ -3,6 +3,8 @@ package com.arpa.hndahesudintocctmsdriver.push;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
|
||||
import cn.jpush.android.api.JPushMessage;
|
||||
|
||||
/**
|
||||
@@ -49,7 +51,7 @@ public class TagAliasOperatorHelper {
|
||||
logs += ", tags is exceed limit need to clean";
|
||||
}
|
||||
logs += ", errorCode:" + jPushMessage.getErrorCode();
|
||||
Log.e(TAG, logs);
|
||||
LogUtil.e(TAG, logs);
|
||||
//ToastHelper.showOther(context,logs);
|
||||
}
|
||||
}
|
||||
@@ -63,7 +65,7 @@ public class TagAliasOperatorHelper {
|
||||
//ToastHelper.showOk(context,"modify success");
|
||||
}else{
|
||||
String logs = "Failed to modify tags, errorCode:" + jPushMessage.getErrorCode();
|
||||
Log.e(TAG, logs);
|
||||
LogUtil.e(TAG, logs);
|
||||
//ToastHelper.showOther(context,logs);
|
||||
}
|
||||
}
|
||||
@@ -77,7 +79,7 @@ public class TagAliasOperatorHelper {
|
||||
//ToastHelper.showOk(context,"modify success");
|
||||
}else{
|
||||
String logs = "Failed to modify alias, errorCode:" + jPushMessage.getErrorCode();
|
||||
Log.e(TAG, logs);
|
||||
LogUtil.e(TAG, logs);
|
||||
//ToastHelper.showOther(context,logs);
|
||||
//MMKV.defaultMMKV().putString(AdvActivity.ALIAS_DATA, "");
|
||||
}
|
||||
@@ -92,7 +94,7 @@ public class TagAliasOperatorHelper {
|
||||
//ToastHelper.showOk(context,"modify success");
|
||||
}else{
|
||||
String logs = "Failed to set mobile number, errorCode:" + jPushMessage.getErrorCode();
|
||||
Log.e(TAG, logs);
|
||||
LogUtil.e(TAG, logs);
|
||||
//ToastHelper.showOther(context,logs);
|
||||
//MMKV.defaultMMKV().putString(AdvActivity.MN_DATA, "");
|
||||
}
|
||||
|
||||
@@ -8,11 +8,8 @@ import com.alct.mdp.MDPLocationCollectionManager;
|
||||
import com.alct.mdp.callback.OnDownloadResultListener;
|
||||
import com.alct.mdp.callback.OnResultListener;
|
||||
import com.alct.mdp.model.Identity;
|
||||
import com.arpa.hndahesudintocctmsdriver.App;
|
||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.AuthParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.msg.MsgUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.google.gson.Gson;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.DriverAuthDataBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.FqBean;
|
||||
@@ -32,37 +29,26 @@ public class ALProcess {
|
||||
//企业app验证码
|
||||
private static final String APP_KEY="b948efbb4c2a4ba0805c534f2fba0c89";
|
||||
|
||||
//企业代码-测试
|
||||
private static final String ENTERPRISE_CODE_TEXT="E0019093";
|
||||
//企业app的身份码-测试
|
||||
private static final String APP_IDENTITY_TEXT="a15b4ba5bd2542cc9a6bea9bdadf9ef9";
|
||||
//企业app验证码-测试
|
||||
private static final String APP_KEY_TEXT="07a6256cad5642138ed6e962a5a157be";
|
||||
|
||||
|
||||
public static void verification(Context con){
|
||||
DriverAuthDataBean auth= AuthParts.getAuth(con);
|
||||
Identity idy=new Identity();
|
||||
//企业代码
|
||||
idy.setEnterpriseCode(BuildConfig.isTest?ENTERPRISE_CODE_TEXT:ENTERPRISE_CODE);
|
||||
idy.setEnterpriseCode(ENTERPRISE_CODE);
|
||||
//企业app的身份码
|
||||
idy.setAppIdentity(BuildConfig.isTest?APP_IDENTITY_TEXT:APP_IDENTITY);
|
||||
idy.setAppIdentity(APP_IDENTITY);
|
||||
//企业app验证码
|
||||
idy.setAppKey(BuildConfig.isTest?APP_KEY_TEXT:APP_KEY);
|
||||
idy.setAppKey(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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -71,18 +57,18 @@ public class ALProcess {
|
||||
MDPLocationCollectionManager.getInvoices(con, 100, 1, new OnDownloadResultListener() {
|
||||
@Override
|
||||
public void onSuccess(Object o) {
|
||||
Log.e("--获取发票列表成功--",new Gson().toJson(o));
|
||||
LogUtil.e("--获取发票列表成功--",new Gson().toJson(o));
|
||||
try{
|
||||
FqBean fb=new Gson().fromJson(new Gson().toJson(o),FqBean.class);
|
||||
applyFq(con,fb);
|
||||
}catch (Exception e){
|
||||
Log.e("--失败--","数据解析失败");
|
||||
LogUtil.e("--失败--","数据解析失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("--获取发票列表失败--",s+s1+"");
|
||||
LogUtil.e("--获取发票列表失败--",s+s1+"");
|
||||
}
|
||||
|
||||
});
|
||||
@@ -91,16 +77,16 @@ public class ALProcess {
|
||||
|
||||
public static void applyFq(Context con,FqBean fb){
|
||||
for (FqBean.Invoice driverInvoice : fb.getDriverInvoices()) {
|
||||
MDPLocationCollectionManager.confirmInvoice(con, BuildConfig.isTest?ENTERPRISE_CODE_TEXT:ENTERPRISE_CODE, driverInvoice.getDriverInvoiceCode(), new OnResultListener() {
|
||||
MDPLocationCollectionManager.confirmInvoice(con, ENTERPRISE_CODE, driverInvoice.getDriverInvoiceCode(), new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
|
||||
Log.e("--成功--","申请发票成功");
|
||||
LogUtil.e("--成功--","申请发票成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("--失败--","申请发票失败"+s+s1);
|
||||
LogUtil.e("--失败--","申请发票失败"+s+s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -126,33 +112,4 @@ public class ALProcess {
|
||||
}
|
||||
|
||||
|
||||
public static void verification(Context con,Handler hd){
|
||||
DriverAuthDataBean auth= AuthParts.getAuth(con);
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.arpa.hndahesudintocctmsdriver.bean.JTT;
|
||||
import com.arpa.hndahesudintocctmsdriver.constant.JTTConstant;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.service.JTTSendService;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||
import com.google.gson.Gson;
|
||||
@@ -56,12 +57,10 @@ public class JTTProcess {
|
||||
ENVIRONMENT, new OnResultListener() {
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("交通厅-获取授权",s+s1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(List<ShippingNoteInfo> list) {
|
||||
Log.e("交通厅-获取授权",gson.toJson(list));
|
||||
if(list.size()>0){
|
||||
SPUtil.insSP(con,JTTConstant.JTT_DATA_NAME,JTTConstant.JTT_DATA_JTTORDER_KEY,gson.toJson(list.get(0)));
|
||||
Intent in=new Intent(con, JTTSendService.class);
|
||||
@@ -89,19 +88,19 @@ public class JTTProcess {
|
||||
sni.setEndLocationText(endWay.getAddress());
|
||||
sni.setEndCountrySubdivisionCode(sob.getData().getEndCountrySubdivisionCode());
|
||||
snis[0]=sni;
|
||||
Log.e("起点代码",sob.getData().getStartCountrySubdivisionCode());
|
||||
Log.e("终点代码",sob.getData().getEndCountrySubdivisionCode());
|
||||
LogUtil.e("起点代码",sob.getData().getStartCountrySubdivisionCode());
|
||||
LogUtil.e("终点代码",sob.getData().getEndCountrySubdivisionCode());
|
||||
// AMapLocationClient.updatePrivacyShow(con,true,true);
|
||||
// AMapLocationClient.updatePrivacyAgree(con,true);
|
||||
LocationOpenApi.start(con, sob.getData().getCarNumber(), UserParts.getUser(con).getData().getRname(), remark,snis, new OnResultListener() {
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("交通厅-开启定位失败",s+s1+"");
|
||||
LogUtil.e("交通厅-开启定位失败",s+s1+"");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(List<ShippingNoteInfo> list) {
|
||||
Log.e("交通厅-开启定位成功",gson.toJson(list));
|
||||
LogUtil.e("交通厅-开启定位成功",gson.toJson(list));
|
||||
if(list.size()>0){
|
||||
SPUtil.insSP(con, JTTConstant.JTT_DATA_NAME,JTTConstant.JTT_DATA_JTTORDER_KEY,gson.toJson(list.get(0)));
|
||||
Intent in=new Intent(con, JTTSendService.class);
|
||||
@@ -125,12 +124,12 @@ public class JTTProcess {
|
||||
LocationOpenApi.send(con,sob.getData().getCarNumber(), UserParts.getUser(con).getData().getRname(), remark,snis, new OnSendResultListener() {
|
||||
@Override
|
||||
public void onFailure(String s, String s1, List<ShippingNoteInfo> list) {
|
||||
Log.e("交通厅-发送定位失败",s+s1+"");
|
||||
LogUtil.e("交通厅-发送定位失败",s+s1+"");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(List<ShippingNoteInfo> list) {
|
||||
Log.e("交通厅-发送定位成功",gson.toJson(list));
|
||||
LogUtil.e("交通厅-发送定位成功",gson.toJson(list));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -158,12 +157,12 @@ public class JTTProcess {
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("交通厅-暂停定位失败",s+s1+"");
|
||||
LogUtil.e("交通厅-暂停定位失败",s+s1+"");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(List<ShippingNoteInfo> list) {
|
||||
Log.e("交通厅-暂停定位成功",gson.toJson(list));
|
||||
LogUtil.e("交通厅-暂停定位成功",gson.toJson(list));
|
||||
}
|
||||
|
||||
});
|
||||
@@ -191,12 +190,12 @@ public class JTTProcess {
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("交通厅-重启定位失败",s+s1+"");
|
||||
LogUtil.e("交通厅-重启定位失败",s+s1+"");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(List<ShippingNoteInfo> list) {
|
||||
Log.e("交通厅-重启定位成功",gson.toJson(list));
|
||||
LogUtil.e("交通厅-重启定位成功",gson.toJson(list));
|
||||
}
|
||||
|
||||
});
|
||||
@@ -224,12 +223,12 @@ public class JTTProcess {
|
||||
LocationOpenApi.stop(con, sob.getData().getCarNumber(),UserParts.getUser(con).getData().getRname(), remark,snis, new OnResultListener() {
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("交通厅-结束定位失败",s+s1+"");
|
||||
LogUtil.e("交通厅-结束定位失败",s+s1+"");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(List<ShippingNoteInfo> list) {
|
||||
Log.e("交通厅-结束定位成功",gson.toJson(list));
|
||||
LogUtil.e("交通厅-结束定位成功",gson.toJson(list));
|
||||
Intent stopIntent = new Intent(con,JTTSendService.class);
|
||||
con.stopService(stopIntent);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,6 @@ public class AuthRequest {
|
||||
|
||||
//驾驶证认证
|
||||
public void driverAuthLicense(Context con, Handler hd, LicenseInputBean iib) {
|
||||
Log.e("--认证信息--", gson.toJson(iib));
|
||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getDRIVERAUTHLICENSE(), gson.toJson(iib)), getToken(con), con);
|
||||
RequestUtil.start(1, "driverAuthLicense", re, con, hd);
|
||||
}
|
||||
@@ -124,17 +123,6 @@ public class AuthRequest {
|
||||
RequestUtil.start(1, "saveCarRoadLicenseNo", re, con, hd);
|
||||
}
|
||||
|
||||
//车辆交强保险
|
||||
public void saveTrafficInsurance(Context con, Handler hd, String id, String insuranceEndDay, String insuranceCompany) {
|
||||
String mt = "{\n" +
|
||||
"\t\"carId\": \"" + id + "\",\n" +
|
||||
"\t\"insuranceEndDay\": \"" + insuranceEndDay + "\",\n" +
|
||||
"\t\"insuranceCompany\": \"" + insuranceCompany + "\",\n" +
|
||||
"}";
|
||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getTrafficInsurance(), mt), getToken(con), con);
|
||||
RequestUtil.start(1, "saveTrafficInsurance", re, con, hd);
|
||||
}
|
||||
|
||||
//获取资格证认证信息
|
||||
public void isDriverAuthQualification(Context con, Handler hd) {
|
||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getIsAuthDriverAuthQualification(), ""), getToken(con), con);
|
||||
|
||||
@@ -25,10 +25,5 @@ public class BusinessRequest {
|
||||
Request re = OkHttpUtil.get(new OkDate(url+ Md5Util.resUrl(longitude,latitude,name), "post", ""));
|
||||
RequestUtil.start(12, "business_list",re,con,hd);
|
||||
}
|
||||
public void GetBusiness(Context con, Handler hd, String id){
|
||||
String url="https://openapi.dianping.com/router/poiinfo/detailinfo";
|
||||
Request re = OkHttpUtil.get(new OkDate(url+Md5Util.resDelUrl(id), "post", ""));
|
||||
RequestUtil.start(1, "business",re,con,hd);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -89,11 +89,6 @@ public class HuoYuanRequset{
|
||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getUNLOADING(), gson.toJson(lub)),getToken(con),con);
|
||||
RequestUtil.start(1, ShangChuangImgActivity.TYPE_NAME[1],re,con,hd);
|
||||
}
|
||||
//卸货-补传
|
||||
public void dischargeCargo4(LUInputBean lub){
|
||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getUNLOADING4(), gson.toJson(lub)),getToken(con),con);
|
||||
RequestUtil.start(1, ShangChuangImgActivity.TYPE_NAME[1],re,con,hd);
|
||||
}
|
||||
//回单
|
||||
public void receipt(UploadReceiptInputBean urib){
|
||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getUploadReceipt(), gson.toJson(urib)),getToken(con),con);
|
||||
|
||||
@@ -66,7 +66,6 @@ public class NewsRequest {
|
||||
public void delNewsAll(Context con, Handler hd,Model m){
|
||||
m.setId(0);
|
||||
token= SPUtil.getSP(con, LoginActivity.USER,LoginActivity.USER_TOKEN);
|
||||
Log.e("-xm-",gson.toJson(m));
|
||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getXiaoxiDelAll(),gson.toJson(m)),getToken(con),con);
|
||||
RequestUtil.start(1, NewsActivity.NEWS_DEL,re,con,hd);
|
||||
///app/message/setReadAll
|
||||
|
||||
@@ -49,8 +49,8 @@ public class OCRRequest {
|
||||
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);
|
||||
public void OCRVehicleLicenseBack(Context con, Handler hd, File file,String carId,String carNum){
|
||||
Request re = OkHttpUtil.postFiles(new OkDate(RequestConstant.getVehicleLicenseBack()),file,getToken(con),carId,carNum);
|
||||
RequestUtil.start(12, CertificatesActivity.TYPE_NAME_BANK[2],re,con,hd);
|
||||
}
|
||||
|
||||
@@ -59,9 +59,4 @@ public class OCRRequest {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.request;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||
|
||||
public class RequestConstant {
|
||||
|
||||
public static String TOKEN="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MzA0MDE3OTIsInVzZXJJZCI6ODAsImlhdCI6MTYyNzcyMzM5Mn0.f9Q-UZVduW6nt1s0L-3vYsrOJJ8iuSCSlJ9uu8yIxBI";
|
||||
//域名地址http://request.one-clouds.com/api https://huoyun.mzxd56.com/api http://app.dahehuoyun.com/api
|
||||
public static String BASE_URL = BuildConfig.BASE_URL;
|
||||
public static String BASE_URL ="http://app.dahehuoyun.com/api";
|
||||
//版本更新/app/check/version
|
||||
public static String VERSION ="/app/check/version";
|
||||
//全部代码
|
||||
@@ -67,8 +65,6 @@ public class RequestConstant {
|
||||
private static final String LOADING="/app/driver/waybill/loadingV2";
|
||||
//卸货
|
||||
private static final String UNLOADING="/app/driver/waybill/unloadV2";
|
||||
//卸货-补传
|
||||
private static final String UNLOADING4 = "/app/driver/waybill/unloadV4";
|
||||
//上传回单
|
||||
private static final String UPLOAD_RECEIPT="/app/driver/waybill/uploadReceipt";
|
||||
//轨迹跟踪
|
||||
@@ -86,7 +82,7 @@ public class RequestConstant {
|
||||
//车辆详情
|
||||
private static final String GET_CAR_DEL="/app/carDriver/getCarInfo";
|
||||
//删除车辆
|
||||
private static final String DEL_CAR = "/app/carDriver/unBindCar";
|
||||
private static final String DEL_CAR="/app/carDriver/removeCar";
|
||||
//上传车辆照片
|
||||
private static final String SAVECARIMG="/app/carDriver/saveCarImg";
|
||||
//上传头像保存
|
||||
@@ -130,9 +126,6 @@ public class RequestConstant {
|
||||
private static final String DRIVER_AUTH_SAVECARREGISTERNO="/app/carDriver/saveCarRegisterNo";
|
||||
//道路运输信息
|
||||
private static final String DRIVER_AUTH_SAVECARROADLICENSENO="/app/carDriver/saveCarRoadLicenseNo";
|
||||
|
||||
//交强险
|
||||
private static final String DRIVER_TRAFFIC_INSU = "/app/carDriver/saveCarInsurace";
|
||||
//党员认证
|
||||
private static final String PARTY_MEMBER="/app/user/partyMember";
|
||||
//实名认证
|
||||
@@ -140,9 +133,6 @@ public class RequestConstant {
|
||||
//车牌号
|
||||
private static final String PLATE_LICENSE="/common/ocr/plateLicense";
|
||||
|
||||
//车牌号2
|
||||
private static final String PLATE_LICENSE2 = "/common/aliyun/ocr/RecognizeCarNumber";
|
||||
|
||||
//添加挂车
|
||||
private static final String SAVE_DRAW_CAR="/app/carDriver/saveDrawCar";
|
||||
//提现记录
|
||||
@@ -162,16 +152,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;
|
||||
}
|
||||
@@ -219,13 +204,9 @@ public class RequestConstant {
|
||||
return BASE_URL + BANK_CARD_LIST;
|
||||
}
|
||||
|
||||
public static String getXiaoXiListUrl() {
|
||||
return BASE_URL + XIAOXI_LIST;
|
||||
}
|
||||
public static String getXiaoXiListUrl() { return BASE_URL + XIAOXI_LIST; }
|
||||
|
||||
public static String getXiaoxiAll() {
|
||||
return BASE_URL + XIAOXI_ALL;
|
||||
}
|
||||
public static String getXiaoxiAll() { return BASE_URL +XIAOXI_ALL; }
|
||||
|
||||
public static String getOrderList() {
|
||||
return BASE_URL +ORDER_LIST;
|
||||
@@ -255,10 +236,6 @@ public class RequestConstant {
|
||||
return BASE_URL +UNLOADING;
|
||||
}
|
||||
|
||||
public static String getUNLOADING4() {
|
||||
return BASE_URL + UNLOADING4;
|
||||
}
|
||||
|
||||
public static String getGetEvaluate() {
|
||||
return BASE_URL +GET_EVALUATE;
|
||||
}
|
||||
@@ -311,25 +288,15 @@ public class RequestConstant {
|
||||
return BASE_URL +ISAUTH_IDCARD;
|
||||
}
|
||||
|
||||
public static String getIsauthDriverauthLicense() {
|
||||
return BASE_URL + ISAUTH_DRIVERAUTH_LICENSE;
|
||||
}
|
||||
public static String getIsauthDriverauthLicense() { return BASE_URL +ISAUTH_DRIVERAUTH_LICENSE; }
|
||||
|
||||
public static String getUploadReceipt() {
|
||||
return BASE_URL + UPLOAD_RECEIPT;
|
||||
}
|
||||
public static String getUploadReceipt() { return BASE_URL +UPLOAD_RECEIPT; }
|
||||
|
||||
public static String getUPLOAD() {
|
||||
return BASE_URL + UPLOAD;
|
||||
}
|
||||
public static String getUPLOAD() { return BASE_URL +UPLOAD; }
|
||||
|
||||
public static String getTrackTracking() {
|
||||
return BASE_URL + TRACK_TRACKING;
|
||||
}
|
||||
public static String getTrackTracking() {return BASE_URL +TRACK_TRACKING; }
|
||||
|
||||
public static String getEvaluationV2() {
|
||||
return BASE_URL + EVALUATION_V2;
|
||||
}
|
||||
public static String getEvaluationV2() { return BASE_URL +EVALUATION_V2; }
|
||||
|
||||
public static String getDRIVERAUTHIDCARD() {
|
||||
return BASE_URL +DRIVERAUTHIDCARD;
|
||||
@@ -347,49 +314,27 @@ public class RequestConstant {
|
||||
return BASE_URL +SAVECARIMG;
|
||||
}
|
||||
|
||||
public static String getUploadHead() {
|
||||
return BASE_URL + UPLOAD_HEAD;
|
||||
}
|
||||
public static String getUploadHead() { return BASE_URL +UPLOAD_HEAD; }
|
||||
|
||||
public static String getInsBankcard() {
|
||||
return BASE_URL +INS_BANKCARD;
|
||||
}
|
||||
|
||||
public static String getDelCar() {
|
||||
return BASE_URL + DEL_CAR;
|
||||
}
|
||||
public static String getDelCar() { return BASE_URL +DEL_CAR; }
|
||||
|
||||
public static String getXiaoxiDel() {
|
||||
return BASE_URL + XIAOXI_DEL;
|
||||
}
|
||||
public static String getXiaoxiDel() { return BASE_URL +XIAOXI_DEL; }
|
||||
|
||||
public static String getCOMPLAINT() {
|
||||
return BASE_URL + COMPLAINT;
|
||||
}
|
||||
public static String getCOMPLAINT() { return BASE_URL+COMPLAINT; }
|
||||
|
||||
public static String getXiaoxiDelAll() {
|
||||
return BASE_URL + XIAOXI_DEL_ALL;
|
||||
}
|
||||
public static String getXiaoxiDelAll() { return BASE_URL+XIAOXI_DEL_ALL; }
|
||||
|
||||
public static String getDriverAuthQualification() {
|
||||
return BASE_URL + DRIVER_AUTH_QUALIFICATION;
|
||||
}
|
||||
public static String getDriverAuthQualification() { return BASE_URL+DRIVER_AUTH_QUALIFICATION; }
|
||||
|
||||
public static String getDriverSaveCarRegisterNo() {
|
||||
return BASE_URL + DRIVER_AUTH_SAVECARREGISTERNO;
|
||||
}
|
||||
public static String getDriverSaveCarRegisterNo() { return BASE_URL+DRIVER_AUTH_SAVECARREGISTERNO; }
|
||||
|
||||
public static String getDriverSaveCarRoadLicenseNo() {
|
||||
return BASE_URL + DRIVER_AUTH_SAVECARROADLICENSENO;
|
||||
}
|
||||
public static String getDriverSaveCarRoadLicenseNo() { return BASE_URL+DRIVER_AUTH_SAVECARROADLICENSENO; }
|
||||
|
||||
public static String getTrafficInsurance() {
|
||||
return BASE_URL + DRIVER_TRAFFIC_INSU;
|
||||
}
|
||||
|
||||
public static String getSaveDrawCar() {
|
||||
return BASE_URL + SAVE_DRAW_CAR;
|
||||
}
|
||||
public static String getSaveDrawCar() { return BASE_URL+SAVE_DRAW_CAR; }
|
||||
|
||||
public static String getIsAuthDriverAuthQualification() {
|
||||
return BASE_URL+IS_AUTH_DRIVER_AUTH_QUALIFICATION;
|
||||
@@ -431,9 +376,7 @@ public class RequestConstant {
|
||||
return BASE_URL+WITHDRAWALS_CONFIG;
|
||||
}
|
||||
|
||||
public static String getGetErrorOrder() {
|
||||
return BASE_URL + GET_ERROR_ORDER;
|
||||
}
|
||||
public static String getGetErrorOrder() { return BASE_URL+GET_ERROR_ORDER; }
|
||||
|
||||
public static String getGetExampleList() {
|
||||
return BASE_URL+GET_EXAMPLE_LIST;
|
||||
@@ -447,10 +390,6 @@ public class RequestConstant {
|
||||
return BASE_URL+PLATE_LICENSE;
|
||||
}
|
||||
|
||||
public static String getPlateLicense2() {
|
||||
return BASE_URL + PLATE_LICENSE2;
|
||||
}
|
||||
|
||||
public static String getGetImage() {
|
||||
return BASE_URL+GET_IMAGE;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -119,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";
|
||||
@@ -233,15 +224,4 @@ public class UserRequset {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,15 +15,6 @@ public class LUInputBean {
|
||||
private String locationAddress;
|
||||
private String longitude;
|
||||
private String waybillId;
|
||||
private String realLoadTime;
|
||||
|
||||
public String getRealLoadTime() {
|
||||
return realLoadTime;
|
||||
}
|
||||
|
||||
public void setRealLoadTime(String realLoadTime) {
|
||||
this.realLoadTime = realLoadTime;
|
||||
}
|
||||
|
||||
public List<Integer> getImageId() {
|
||||
return imageId;
|
||||
|
||||
@@ -23,8 +23,8 @@ public interface Api {
|
||||
//获取版本
|
||||
String VERSION = BASE_URL + "app/version";
|
||||
|
||||
// @POST(BASE_URL+"/common/register")
|
||||
// Observable<CommonResponseBean> log(@Body LoginRegInputBean bean);
|
||||
@POST(BASE_URL+"/common/register")
|
||||
Observable<CommonResponseBean> log(@Body LoginRegInputBean bean);
|
||||
|
||||
}
|
||||
|
||||
|
||||
+5
-4
@@ -2,6 +2,7 @@ package com.arpa.hndahesudintocctmsdriver.request.net;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.dahe.mylibrary.net.JsonUtils;
|
||||
import com.dahe.mylibrary.utils.MD5Utils;
|
||||
import com.dahe.mylibrary.utils.StringUtils;
|
||||
@@ -70,7 +71,7 @@ public class CreateJsonUtils {
|
||||
map.put("api_key", "xccdb-power-bank");
|
||||
map.put("sign", MD5Utils.md5(JsonUtils.getInstance().getGson().toJson(map)));
|
||||
map.put("time", TimeUtil.getNowMills());
|
||||
Log.i(TAG, new Gson().toJson(map));
|
||||
LogUtil.e(TAG, new Gson().toJson(map));
|
||||
return new Gson().toJson(map);
|
||||
}
|
||||
|
||||
@@ -123,15 +124,15 @@ public class CreateJsonUtils {
|
||||
}
|
||||
try {
|
||||
signStr = (sign1(requestDataMap) + "&api_key=xccdb-power-bank").replaceFirst("&", "");
|
||||
Log.i(TAG, "createRequestBody: " + sign1(requestDataMap));
|
||||
LogUtil.e(TAG, "createRequestBody: " + sign1(requestDataMap));
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Log.i(TAG, "createRequestBody: " + signStr);
|
||||
LogUtil.e(TAG, "createRequestBody: " + signStr);
|
||||
for (String keySet : requestDataMap.keySet()) {
|
||||
requestBodyMap.put(keySet, RequestBody.create(MediaType.parse("multipart/form-data"), requestDataMap.get(keySet) + ""));
|
||||
}
|
||||
Log.i(TAG, "createRequestBody: " + MD5Utils.md5((signStr)));
|
||||
LogUtil.e(TAG, "createRequestBody: " + MD5Utils.md5((signStr)));
|
||||
requestBodyMap.put("sign", RequestBody.create(MediaType.parse("multipart/form-data"),
|
||||
MD5Utils.md5((signStr))));
|
||||
requestBodyMap.put("time", RequestBody.create(MediaType.parse("multipart/form-data"), TimeUtil.getNowMills() / 1000 + ""));
|
||||
|
||||
-1
@@ -37,7 +37,6 @@ public class RequestHeadInterceptor implements Interceptor {
|
||||
.addHeader("deviceType", "ANDROID")
|
||||
.addHeader("language", BaseUtils.getLanguage(App.getApp())+"")
|
||||
.build();
|
||||
Log.i(TAG, "intercept: " + request.headers());
|
||||
return chain.proceed(request);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,6 @@ public class JTTSendService extends Service {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
Log.e("交通厅","开启位置上传");
|
||||
con=this;
|
||||
String str= SPUtil.getSP(con, JTTConstant.JTT_DATA_NAME,JTTConstant.JTT_DATA_JTTORDER_KEY);
|
||||
String str2=SPUtil.getSP(con,JTTConstant.JTT_DATA_NAME,JTTConstant.JTT_DATA_ORDER_KEY);
|
||||
@@ -103,7 +102,6 @@ public class JTTSendService extends Service {
|
||||
//开始
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
Log.e("服务开启","-----");
|
||||
return START_STICKY;
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.google.gson.Gson;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.TrackInputBean;
|
||||
@@ -54,7 +55,7 @@ public class LocationService extends Service {
|
||||
super.onCreate();
|
||||
con=this;
|
||||
hyr=new HuoYuanRequset(con,hd);
|
||||
Log.e("开始循环上传,等待100ms","-----");
|
||||
LogUtil.e("开始循环上传,等待100ms","-----");
|
||||
new Timer().schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -67,7 +68,6 @@ public class LocationService extends Service {
|
||||
//开始
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
Log.e("服务开启","-----");
|
||||
return START_STICKY;
|
||||
|
||||
}
|
||||
@@ -84,10 +84,8 @@ public class LocationService extends Service {
|
||||
tib.setLatitude(l.getLatitude()+"");
|
||||
//纬度
|
||||
tib.setLongitude(l.getLongitude()+"");
|
||||
Log.e("经度",l.getLatitude()+"");
|
||||
Log.e("维度",l.getLongitude()+"");
|
||||
sum+=3;
|
||||
Log.e("当前app后台服务存活时间(手机息屏状态)",sum+"秒");
|
||||
LogUtil.e("当前app后台服务存活时间(手机息屏状态)",sum+"秒");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import com.alct.mdp.MDPLocationCollectionManager;
|
||||
import com.alct.mdp.model.Image;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.google.gson.Gson;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.msg.MsgUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||
@@ -55,7 +56,6 @@ public class MakeUpAlService extends Service {
|
||||
//开始
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
Log.e("服务开启","-----");
|
||||
return START_STICKY;
|
||||
|
||||
}
|
||||
@@ -90,12 +90,12 @@ public class MakeUpAlService extends Service {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联","装货照片上传成功");
|
||||
LogUtil.e("上报安联","装货照片上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(装货照片):",s+s1);
|
||||
LogUtil.e("上报安联失败(装货照片):",s+s1);
|
||||
}
|
||||
|
||||
});
|
||||
@@ -106,12 +106,12 @@ public class MakeUpAlService extends Service {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联","卸货照片上传成功");
|
||||
LogUtil.e("上报安联","卸货照片上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(卸货照片):",s+s1);
|
||||
LogUtil.e("上报安联失败(卸货照片):",s+s1);
|
||||
}
|
||||
|
||||
});
|
||||
@@ -122,12 +122,12 @@ public class MakeUpAlService extends Service {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联","回单照片上传成功");
|
||||
LogUtil.e("上报安联","回单照片上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(回单照片):",s+s1);
|
||||
LogUtil.e("上报安联失败(回单照片):",s+s1);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -10,7 +10,6 @@ import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||
@@ -26,20 +25,14 @@ public class MakeUpService extends Service {
|
||||
|
||||
private MediaPlayer mediaPlayer = new MediaPlayer();
|
||||
public void palyMp3(){
|
||||
Log.e("开始播放","-----");
|
||||
try {
|
||||
MediaPlayer mediaPlayer = MediaPlayer.create(this, R.raw.kujp9scu);
|
||||
mediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
|
||||
@Override
|
||||
public void onPrepared(MediaPlayer mediaPlayer) {
|
||||
AssetFileDescriptor fd =getAssets().openFd("kujp9scu.mp3");
|
||||
mediaPlayer.setDataSource(fd);
|
||||
mediaPlayer.setLooping(false);//设置为循环播放
|
||||
mediaPlayer.prepare();//初始化播放器MediaPlayer
|
||||
mediaPlayer.start();
|
||||
}
|
||||
});
|
||||
mediaPlayer.prepareAsync();
|
||||
Log.e("播放成功","-----");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Log.e("播放失败","-----");
|
||||
}
|
||||
}
|
||||
private Handler hd=new Handler(msg -> {
|
||||
@@ -68,7 +61,6 @@ public class MakeUpService extends Service {
|
||||
//开始
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
Log.e("服务开启","-----");
|
||||
|
||||
return START_STICKY;
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ public class RestartService extends Service {
|
||||
|
||||
//Service被启动的时候回调onStartCommand方法
|
||||
public int onStartCommand(Intent intent, int flags, int startId){
|
||||
Log.e("---static---","启动");
|
||||
return START_STICKY;
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -59,7 +59,6 @@ public class TestService extends Service {
|
||||
@Override
|
||||
public void run() {
|
||||
notification("消息","您有一条新的订单");
|
||||
Log.e("1234","1234");
|
||||
}
|
||||
},100,5000);
|
||||
}
|
||||
@@ -67,14 +66,12 @@ public class TestService extends Service {
|
||||
|
||||
//Service被启动的时候回调onStartCommand方法
|
||||
public int onStartCommand(Intent intent, int flags, int startId){
|
||||
Log.e("---static---","启动");
|
||||
return START_STICKY;
|
||||
}
|
||||
|
||||
//Service被销毁的时候回调onDestroy方法
|
||||
public void onDestroy(){
|
||||
super.onDestroy();
|
||||
Log.e("---static---","关闭");
|
||||
Intent intentOne = new Intent(con,TestService.class);
|
||||
startService(intentOne);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.google.gson.Gson;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
||||
@@ -43,9 +44,9 @@ public class TrackService extends Service {
|
||||
if(CacheGroup.cacheList.get("genzong")!=null){
|
||||
BaseBean bb=gson.fromJson(CacheGroup.cacheList.get("genzong"),BaseBean.class);
|
||||
if(bb.getCode()==200){
|
||||
Log.e("--轨迹上传--","成功");
|
||||
LogUtil.e("--轨迹上传--","成功");
|
||||
}else{
|
||||
Log.e("--轨迹上传失败:--",bb.getMsg());
|
||||
LogUtil.e("--轨迹上传失败:--",bb.getMsg());
|
||||
}
|
||||
CacheGroup.cacheList.remove("genzong");
|
||||
}
|
||||
@@ -66,7 +67,7 @@ public class TrackService extends Service {
|
||||
super.onCreate();
|
||||
con=this;
|
||||
hyr=new HuoYuanRequset(con,hd);
|
||||
Log.e("开始循环上传,等待100ms","-----");
|
||||
LogUtil.e("开始循环上传,等待100ms","-----");
|
||||
new Timer().schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -84,7 +85,7 @@ public class TrackService extends Service {
|
||||
//开始
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
Log.e("服务开启","-----");
|
||||
LogUtil.e("服务开启","-----");
|
||||
return START_STICKY;
|
||||
|
||||
}
|
||||
@@ -99,8 +100,8 @@ public class TrackService extends Service {
|
||||
tib.setLatitude(l.getLatitude()+"");
|
||||
//纬度
|
||||
tib.setLongitude(l.getLongitude()+"");
|
||||
Log.e("经度",l.getLatitude()+"");
|
||||
Log.e("维度",l.getLongitude()+"");
|
||||
LogUtil.e("经度",l.getLatitude()+"");
|
||||
LogUtil.e("维度",l.getLongitude()+"");
|
||||
//单号
|
||||
tib.setShippingNoteNumber(snn);
|
||||
hyr.trackTracking(tib);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui
|
||||
|
||||
import android.Manifest
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
@@ -20,12 +19,11 @@ import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BottomTabUtil
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.PanDuanUtil
|
||||
import com.dahe.mylibrary.utils.RootCheck
|
||||
import com.google.gson.Gson
|
||||
import com.gyf.cactus.ext.cactusUpdateNotification
|
||||
import com.lxj.xpopup.XPopup
|
||||
import com.permissionx.guolindev.PermissionX
|
||||
|
||||
@Suppress("DIVISION_BY_ZERO")
|
||||
@SuppressLint("SetTextI18n")
|
||||
class MainActivity : BaseAppCompatActivity() {
|
||||
|
||||
private var ibs = arrayOf<ImageView>()
|
||||
@@ -41,8 +39,7 @@ class MainActivity : BaseAppCompatActivity() {
|
||||
1 -> {
|
||||
isExit = false;
|
||||
}
|
||||
RequsetCodeConstants.SUCCESS -> {
|
||||
}
|
||||
RequsetCodeConstants.SUCCESS -> {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,10 +47,7 @@ class MainActivity : BaseAppCompatActivity() {
|
||||
super.onCreate(savedInstanceState)
|
||||
StateStyleUtil.stateTextColor(this)
|
||||
setContentView(R.layout.activity_main)
|
||||
cactusUpdateNotification {
|
||||
setTitle("好运司机")
|
||||
setContent("您的接单小助手")
|
||||
}
|
||||
isRoot()
|
||||
con = this
|
||||
act = this
|
||||
//隐藏标题栏
|
||||
@@ -135,12 +129,7 @@ class MainActivity : BaseAppCompatActivity() {
|
||||
PermissionX.init(this)
|
||||
.permissions(Manifest.permission.ACCESS_FINE_LOCATION,
|
||||
Manifest.permission.ACCESS_COARSE_LOCATION,
|
||||
Manifest.permission.ACCESS_BACKGROUND_LOCATION,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.CALL_PHONE,
|
||||
Manifest.permission.RECORD_AUDIO,
|
||||
Manifest.permission.CAMERA)
|
||||
Manifest.permission.ACCESS_BACKGROUND_LOCATION)
|
||||
.request { allGranted, grantedList, deniedList ->
|
||||
if (allGranted) {
|
||||
|
||||
@@ -161,7 +150,6 @@ class MainActivity : BaseAppCompatActivity() {
|
||||
fun jumpLogin() {
|
||||
var inl = Intent(con, LoginActivity::class.java)
|
||||
startActivity(inl)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -189,4 +177,17 @@ class MainActivity : BaseAppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
fun isRoot() {
|
||||
if (RootCheck.isRoot()) {
|
||||
XPopup.Builder(this)
|
||||
.isDestroyOnDismiss(true)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||
.asConfirm("警告", "该设备已ROOT,存在安全隐! 请更换安全设备后继续使用!",
|
||||
"取消", "确定", {
|
||||
System.exit(0)
|
||||
// moveTaskToBack(true)
|
||||
}, null, true).show()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -84,7 +84,6 @@ public class NFCActivity extends BaseAppCompatActivity {
|
||||
|
||||
}
|
||||
});
|
||||
Log.e("nfc",str);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.alert;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.LinearLayout;
|
||||
@@ -16,8 +12,6 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import com.king.app.updater.AppUpdater;
|
||||
import com.king.app.updater.callback.AppUpdateCallback;
|
||||
import com.king.app.updater.constant.Constants;
|
||||
import com.king.app.updater.util.AppUtils;
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
|
||||
@@ -33,8 +27,8 @@ import java.io.File;
|
||||
*/
|
||||
public class UpAppAlert extends CenterPopupView {
|
||||
|
||||
private TextView content, vs, tvContent;
|
||||
private Button tv_cancel, tv_confirm, tvOk;
|
||||
private TextView content,vs;
|
||||
private Button tv_cancel,tv_confirm;
|
||||
private LinearLayout up_div;
|
||||
private String url="";
|
||||
private String body="";
|
||||
@@ -58,7 +52,6 @@ public class UpAppAlert extends CenterPopupView {
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.alert_up_app;
|
||||
}
|
||||
|
||||
public UpAppAlert(@NonNull @NotNull Context context) {
|
||||
super(context);
|
||||
|
||||
@@ -70,8 +63,6 @@ public class UpAppAlert extends CenterPopupView {
|
||||
content=findViewById(R.id.tv_content);
|
||||
tv_cancel=findViewById(R.id.tv_cancel);
|
||||
tv_confirm=findViewById(R.id.tv_confirm);
|
||||
tvContent = findViewById(R.id.tvContent);
|
||||
tvOk = findViewById(R.id.tvOk);
|
||||
up_div=findViewById(R.id.up_div);
|
||||
progress_view=findViewById(R.id.progress);
|
||||
content=findViewById(R.id.tv_content);
|
||||
@@ -92,9 +83,9 @@ public class UpAppAlert extends CenterPopupView {
|
||||
System.exit(1);
|
||||
});
|
||||
tv_confirm.setOnClickListener(v -> {
|
||||
new AppUpdater.Builder(con)
|
||||
new AppUpdater.Builder()
|
||||
.setUrl(url)
|
||||
.build()
|
||||
.build(con)
|
||||
.setUpdateCallback(new AppUpdateCallback() {
|
||||
@Override
|
||||
public void onStart(String url) {
|
||||
@@ -102,7 +93,6 @@ public class UpAppAlert extends CenterPopupView {
|
||||
tv_confirm.setVisibility(GONE);
|
||||
up_div.setVisibility(VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProgress(long progress, long total, boolean isChange) {
|
||||
// Log.e("progress",progress+"");
|
||||
@@ -119,11 +109,7 @@ public class UpAppAlert extends CenterPopupView {
|
||||
|
||||
@Override
|
||||
public void onFinish(File file) {
|
||||
tvContent.setText("下载完成,请及时安装!");
|
||||
tvOk.setVisibility(VISIBLE);
|
||||
tvOk.setOnClickListener(v1 -> {
|
||||
AppUtils.installApk(getContext(), file, getContext().getPackageName() + Constants.DEFAULT_FILE_PROVIDER);
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
.start();
|
||||
|
||||
+13
-83
@@ -18,13 +18,11 @@ import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.esign.esignsdk.EsignSdk;
|
||||
import com.esign.esignsdk.data.AuthEvent;
|
||||
import com.github.gzuliyujiang.wheelpicker.DatePicker;
|
||||
import com.github.gzuliyujiang.wheelpicker.annotation.DateMode;
|
||||
import com.google.gson.Gson;
|
||||
@@ -46,9 +44,6 @@ import com.arpa.hndahesudintocctmsdriver.util.file.ImageFileCompressUtil;
|
||||
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 org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
@@ -91,7 +86,7 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
CacheGroup.cacheList.remove("upload");
|
||||
}
|
||||
if (CacheGroup.cacheList.get("isAuthDriverAuthQualification") != null) {
|
||||
Log.e("is", CacheGroup.cacheList.get("isAuthDriverAuthQualification"));
|
||||
LogUtil.e("is", CacheGroup.cacheList.get("isAuthDriverAuthQualification"));
|
||||
ib = gson.fromJson(CacheGroup.cacheList.get("isAuthDriverAuthQualification"), IsAuthDriverAuthQualificationBean.class);
|
||||
if (ib.getCode() == 200) {
|
||||
if (ib.getData() != null) {
|
||||
@@ -106,10 +101,8 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("driverAuthQualification"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
// initAuth();
|
||||
isAuth = true;
|
||||
//判断是否从车辆进来 carId为空从个人认证进来需跳转实名认证,不为空车辆信息进入,需跳转车辆照片
|
||||
if (TextUtils.isEmpty(carId)) {
|
||||
//从业资格证->实名认证
|
||||
// finish();
|
||||
if (key) {
|
||||
key = false;
|
||||
new AuthRequest().getAuthUrl(con, hd);
|
||||
@@ -117,21 +110,6 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
key = true;
|
||||
}, 3000);
|
||||
}
|
||||
} else {
|
||||
finish();
|
||||
if (isOverCar){//从业资格证=》道路运输许可证
|
||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
in.putExtra("carId", carId);
|
||||
startActivity(in);
|
||||
}else{//资料传完 补传情况
|
||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
con.startActivity(in);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Toast.makeText(con, "资格证上传成功", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
@@ -155,15 +133,14 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("authUrl") != null) {
|
||||
Log.e("url", CacheGroup.cacheList.get("authUrl"));
|
||||
LogUtil.e("url", CacheGroup.cacheList.get("authUrl"));
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("authUrl"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
// finish();
|
||||
finish();
|
||||
EsignSdk.getInstance().startH5Activity(act, StringUtil.isNull(String.valueOf(bb.getData()), ""));
|
||||
} else {
|
||||
finish();
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_LONG).show();
|
||||
}//Log.e("url",CacheGroup.cacheList.get("authUrl"));
|
||||
}//LogUtil.e("url",CacheGroup.cacheList.get("authUrl"));
|
||||
CacheGroup.cacheList.remove("authUrl");
|
||||
}
|
||||
break;
|
||||
@@ -177,8 +154,6 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
|
||||
private String type = "0";
|
||||
private String carId = "";
|
||||
private boolean isOverCar = false;
|
||||
private UserBean userBean;
|
||||
|
||||
@Override
|
||||
@@ -204,8 +179,6 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
vs = findViewById(R.id.vs);
|
||||
data_view = findViewById(R.id.data_view);
|
||||
type = getIntent().getExtras().getString("type");
|
||||
carId = getIntent().getExtras().getString("carId", "");
|
||||
isOverCar = getIntent().getExtras().getBoolean("isOverCar",false);
|
||||
ur = new UserRequset(con, hd);
|
||||
initView(null);
|
||||
if ("0".equals(type)) {
|
||||
@@ -217,11 +190,6 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
//new RZRequest().isDriverAuthQualification(con,hd);
|
||||
}
|
||||
if (TextUtils.isEmpty(carId)){//carId不为空 从添加车辆进入 该操作不能跳过
|
||||
tvSkip.setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
tvSkip.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean key = true;
|
||||
@@ -236,38 +204,30 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
gia.showPopueWindow(this);
|
||||
}
|
||||
});
|
||||
up_img.setOnClickListener(v -> {
|
||||
if (!isAuth) {
|
||||
gia.showPopueWindow(this);
|
||||
}
|
||||
});
|
||||
img.setOnClickListener(v -> {
|
||||
if (!"".equals(url)) {
|
||||
new XPopup.Builder(con).asImageViewer(img, url, new SmartGlideImageLoader(R.mipmap.ic_launcher_round)).show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(img, url, true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(img, url, true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
.show();
|
||||
}
|
||||
});
|
||||
value2.setOnClickListener(v -> {
|
||||
if (!isAuth) {
|
||||
DatePicker picker = new DatePicker(this);
|
||||
picker.setBodyWidth(300);
|
||||
picker.setOnDatePickedListener((year, month, day) -> value2.setText(year + "-" + month + "-" + day));
|
||||
picker.getWheelLayout().setDateMode(DateMode.YEAR_MONTH_DAY);
|
||||
picker.getWheelLayout().setDateLabel("年", "月", "日");
|
||||
picker.show();
|
||||
}
|
||||
});
|
||||
submit.setOnClickListener(v -> {
|
||||
if (!isAuth) {
|
||||
String id = value1.getText() + "";
|
||||
String date = value2.getText() + "";
|
||||
if ("0".equals(type)) {
|
||||
if (!"".equals(date) && !"".equals(url)) {
|
||||
if (!"".equals(id) && !"".equals(date) && !"".equals(url)) {
|
||||
new AuthRequest().driverAuthQualification(con, hd, id, ub.getData().getId(), date);
|
||||
} else {
|
||||
Toast.makeText(con, "请补充证件信息", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(con, "提交信息不完整", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else {
|
||||
if (!"".equals(url)) {
|
||||
@@ -298,9 +258,6 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
});
|
||||
|
||||
tvSkip.setOnClickListener(v -> {
|
||||
|
||||
|
||||
|
||||
if (type.equals("0")) {
|
||||
// finish();
|
||||
if (key) {
|
||||
@@ -368,7 +325,7 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == 12 && resultCode == RESULT_OK) {
|
||||
path = gia.getFile().getPath();
|
||||
Log.e("图片地址:", path);
|
||||
LogUtil.e("图片地址:", path);
|
||||
gia.dis();
|
||||
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||
} else if (requestCode == PictureConfig.CHOOSE_REQUEST && resultCode == RESULT_OK) {
|
||||
@@ -381,38 +338,11 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
paths = image.getPath();
|
||||
}
|
||||
path = paths;
|
||||
Log.e("图片地址:", path);
|
||||
LogUtil.e("图片地址:", path);
|
||||
gia.dis();
|
||||
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Subscribe
|
||||
public void processResult(AuthEvent auth) {
|
||||
//添加实名/意愿/签署完成之后的逻辑
|
||||
Log.e("-回调信息-", auth.result);
|
||||
JSONObject jsonObject = JSON.parseObject(auth.result);
|
||||
if ("success".equalsIgnoreCase(jsonObject.getString("res"))) {
|
||||
if ("sign".equalsIgnoreCase(jsonObject.getString("key"))) {
|
||||
Toast.makeText(con, "签署场景成功", Toast.LENGTH_SHORT).show();
|
||||
} else if ("realName".equalsIgnoreCase(jsonObject.getString("key"))) {
|
||||
Toast.makeText(con, "实名认证成功", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(con, "意愿认证成功", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
finish();
|
||||
} else {
|
||||
if ("sign".equalsIgnoreCase(jsonObject.getString("key"))) {
|
||||
Toast.makeText(con, "签署场景失败", Toast.LENGTH_SHORT).show();
|
||||
} else if ("realName".equalsIgnoreCase(jsonObject.getString("key"))) {
|
||||
Toast.makeText(con, "实名认证失败", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(con, "意愿认证失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
EsignSdk.getInstance().finishH5Activity();
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+67
-295
@@ -4,16 +4,13 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
@@ -21,32 +18,22 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.cardview.widget.CardView;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.DicBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.SinglePickBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.cuspop.SimCenterPop;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.PersonEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.VehicleEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.PickerUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.map.MapUtil;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
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.github.gzuliyujiang.wheelpicker.contract.OnOptionPickedListener;
|
||||
import com.google.gson.Gson;
|
||||
import com.luck.picture.lib.PictureSelector;
|
||||
import com.luck.picture.lib.config.PictureConfig;
|
||||
import com.luck.picture.lib.entity.LocalMedia;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.core.ImageViewerPopupView;
|
||||
import com.lxj.xpopup.interfaces.XPopupImageLoader;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
||||
@@ -77,10 +64,8 @@ import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||
import com.lxj.xpopup.photoview.PhotoView;
|
||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
@@ -132,7 +117,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
private String url2 = "";
|
||||
private String url3 = "";
|
||||
private boolean[] keys = {false, false, false};
|
||||
private boolean key = true;
|
||||
|
||||
public void FalseKeys() {
|
||||
for (int i = 0; i < keys.length; i++) {
|
||||
@@ -155,12 +139,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
break;
|
||||
case RequsetCodeConstants.SUCCESS:
|
||||
if (CacheGroup.cacheList.get("driverAuthIdCard") != null || CacheGroup.cacheList.get("driverAuthLicense") != null
|
||||
|| CacheGroup.cacheList.get("saveVehicleLicense") != null || CacheGroup.cacheList.get("authUrl") != null
|
||||
|| CacheGroup.cacheList.get("saveDrawCar") != null) {
|
||||
|| CacheGroup.cacheList.get("saveVehicleLicense") != null || CacheGroup.cacheList.get("saveDrawCar") != null) {
|
||||
if (CacheGroup.cacheList.get("driverAuthIdCard") != null) {
|
||||
if (customDialog != null) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("driverAuthIdCard"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
Toast.makeText(con, "保存成功", Toast.LENGTH_SHORT).show();
|
||||
@@ -178,22 +158,15 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("driverAuthLicense") != null) {
|
||||
if (customDialog != null) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("driverAuthLicense"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
Toast.makeText(con, "保存成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
|
||||
//上传驾驶证信息页面 进行实名认证操作
|
||||
if (key) {
|
||||
key = false;
|
||||
new AuthRequest().getAuthUrl(con, hd);
|
||||
new Handler().postDelayed(() -> {
|
||||
key = true;
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
//上传驾驶证信息页面 跳转资格证信息页面
|
||||
Intent in = new Intent(con, AuthQualificationActivity.class);
|
||||
in.putExtra("type", "0");
|
||||
startActivity(in);
|
||||
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
@@ -201,118 +174,40 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
CacheGroup.cacheList.remove("driverAuthLicense");
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("authUrl") != null) {
|
||||
Log.e("url", CacheGroup.cacheList.get("authUrl"));
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("authUrl"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
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"));
|
||||
CacheGroup.cacheList.remove("authUrl");
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("saveVehicleLicense") != null) {
|
||||
if (customDialog != null) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
CarZhengBean czb = gson.fromJson(CacheGroup.cacheList.get("saveVehicleLicense"), CarZhengBean.class);
|
||||
if (czb.getCode() == 200) {
|
||||
String needUpQCPhoto = czb.getData().getNeedUpQCPhoto();//是否需要上传从业资格证
|
||||
String isTrailer = czb.getData().getIsTrailer();//是否需要上传挂车
|
||||
String needUpRLPhoto = czb.getData().getNeedUpRLPhoto();//是否需要上传道路运输证到
|
||||
Toast.makeText(con, "车辆行驶证保存成功", Toast.LENGTH_SHORT).show();
|
||||
|
||||
finish();
|
||||
VehicleEvent ve = new VehicleEvent(String.valueOf(czb.getData().getCarId()));
|
||||
EventBus.getDefault().postSticky(ve);
|
||||
EventBus.getDefault().post(ve);
|
||||
|
||||
// TODO: 2023/8/23
|
||||
if ("1".equals(isTrailer)) {//判断是否跳转挂车行驶证
|
||||
Intent in = new Intent(con, CertificatesActivity.class);
|
||||
in.putExtra("index", 3);
|
||||
in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
||||
if (olb != null && olb.getData() != null && olb.getData().isCarExist()) {
|
||||
CarDelBean carDelBean = new CarDelBean();
|
||||
carDelBean.setRes(1);//保留字段 1:为绑定车辆,可以进行修改挂车信息
|
||||
carDelBean.setData(gson.fromJson(gson.toJson(olb.getData().getExistCarInfo()), CarDelBean.DataDTO.class));
|
||||
in.putExtra("cheData", gson.toJson(carDelBean));
|
||||
}
|
||||
startActivity(in);
|
||||
} else if ("1".equals(needUpQCPhoto)) {//判断是否跳转从业资格证
|
||||
Intent in = new Intent(con, AuthQualificationActivity.class);
|
||||
in.putExtra("type", "0");
|
||||
in.putExtra("isOverCar", true);
|
||||
in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
||||
startActivity(in);
|
||||
} else if ("1".equals(needUpRLPhoto)) {//判断是否跳转道路运输许可证
|
||||
//上传行驶证信息后 跳转车辆照片页面
|
||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
in.putExtra("carExist", true);
|
||||
in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
||||
startActivity(in);
|
||||
} else {
|
||||
//跳转成功页面
|
||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
in.putExtra("type", 0);
|
||||
in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
||||
con.startActivity(in);
|
||||
}
|
||||
finish();
|
||||
// if ("1".equals(needUpQCPhoto)) {
|
||||
// //现逻辑:上传行驶证信息后 判断是否跳转从业资格证
|
||||
// Intent in = new Intent(con, AuthQualificationActivity.class);
|
||||
// in.putExtra("type", "0");
|
||||
// in.putExtra("isOverCar", false);
|
||||
// in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
||||
// startActivity(in);
|
||||
// } else {
|
||||
// //原逻辑:上传行驶证信息后 跳转车辆照片页面
|
||||
// Intent in = new Intent(con, PhotoCarActivity.class);
|
||||
// in.putExtra("type", 0);
|
||||
// in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
||||
// con.startActivity(in);
|
||||
// }
|
||||
|
||||
|
||||
} else {
|
||||
Toast.makeText(con, czb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove("saveVehicleLicense");
|
||||
}
|
||||
if (CacheGroup.cacheList.get("saveDrawCar") != null) {
|
||||
if (customDialog != null) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
Log.e("-saveDrawCar-", CacheGroup.cacheList.get("saveDrawCar"));
|
||||
CarZhengBean bb = gson.fromJson(CacheGroup.cacheList.get("saveDrawCar"), CarZhengBean.class);
|
||||
LogUtil.e("-saveDrawCar-", CacheGroup.cacheList.get("saveDrawCar"));
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("saveDrawCar"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
String needUpQCPhoto = bb.getData().getNeedUpQCPhoto();
|
||||
String needUpRLPhoto = bb.getData().getNeedUpRLPhoto();//是否需要上传道路运输证到
|
||||
Toast.makeText(con, "挂车信息保存成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
VehicleEvent ve = new VehicleEvent("挂");
|
||||
EventBus.getDefault().post(ve);
|
||||
|
||||
if ("1".equals(needUpQCPhoto)) {
|
||||
//现逻辑:上传挂车保信息后 判断是否跳转从业资格证
|
||||
Intent in = new Intent(con, AuthQualificationActivity.class);
|
||||
in.putExtra("type", "0");
|
||||
in.putExtra("carId", carId);
|
||||
in.putExtra("isOverCar", true);
|
||||
startActivity(in);
|
||||
} else if ("1".equals(needUpRLPhoto)) {//现判断是否跳转道路运输许可证
|
||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
in.putExtra("carExist", true);
|
||||
in.putExtra("carId", carId);
|
||||
startActivity(in);
|
||||
} else {
|
||||
//原逻辑:挂车信息保存成功跳转成功页面
|
||||
//挂车信息保存成功跳转成功页面
|
||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
in.putExtra("carId", carId);
|
||||
con.startActivity(in);
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
Toast.makeText(con, "挂车信息保存失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@@ -346,22 +241,9 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
});
|
||||
}
|
||||
CacheGroup.cacheList.remove(CAR_ENERGY_TYPE);
|
||||
} else if (CacheGroup.cacheList.get("authUrl") != null) {
|
||||
//实名认证校验
|
||||
Log.e("url", CacheGroup.cacheList.get("authUrl"));
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("authUrl"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
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"));
|
||||
CacheGroup.cacheList.remove("authUrl");
|
||||
} else {
|
||||
//重复代码?
|
||||
initView(null);
|
||||
if (!(CacheGroup.cacheList.get(TYPE_NAME_BANK[2]) != null || CacheGroup.cacheList.get(TYPE_NAME_BANK[3]) != null)) {
|
||||
initData();
|
||||
}
|
||||
pathOrcRes();
|
||||
}
|
||||
break;
|
||||
@@ -379,7 +261,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
StateStyleUtil.stateTextColor(this);
|
||||
setContentView(R.layout.activity_shangchuan_xsz);
|
||||
EventBus.getDefault().register(this);
|
||||
llColor = findViewById(R.id.llColor);
|
||||
llCarName = findViewById(R.id.llCarName);
|
||||
llType = findViewById(R.id.llType);
|
||||
@@ -439,7 +320,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
// there_div.setVisibility(View.VISIBLE);
|
||||
if (c_str != null && !c_str.equals("")) {
|
||||
cdb = gson.fromJson(c_str, CarDelBean.class);
|
||||
oCrcarId = cdb.getData().getTrailerResVo().getTrailerLicenseId() + "";
|
||||
initView(null);
|
||||
initData();
|
||||
} else {
|
||||
@@ -448,8 +328,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
break;
|
||||
case 2:
|
||||
llCarName.setVisibility(View.GONE);
|
||||
// llColor.setVisibility(View.VISIBLE);
|
||||
// llType.setVisibility(View.VISIBLE);
|
||||
llColor.setVisibility(View.VISIBLE);
|
||||
llType.setVisibility(View.VISIBLE);
|
||||
type_img.setImageResource(R.mipmap.auth_icon_3);
|
||||
// there_div.setVisibility(View.VISIBLE);
|
||||
if (c_str != null && !c_str.equals("")) {
|
||||
@@ -488,11 +368,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
img1.setOnClickListener(v -> {
|
||||
if (!url1.equals("")) {
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(img1, url1, new SmartGlideImageLoader(R.mipmap.ic_launcher_round))
|
||||
.asImageViewer(img1, url1, true, -1, -1, 50, false, new ImageLoader())
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(img1, url1, true, -1, -1, 50, false, new ImageLoader())
|
||||
// .show();
|
||||
}else{
|
||||
if (!isAuth) {
|
||||
FalseKeys();
|
||||
@@ -505,11 +382,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
img2.setOnClickListener(v -> {
|
||||
if (!url2.equals("")) {
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(img2, url2, new SmartGlideImageLoader(R.mipmap.ic_launcher_round))
|
||||
.asImageViewer(img2, url2, true, -1, -1, 50, false, new ImageLoader())
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(img2, url2, true, -1, -1, 50, false, new ImageLoader())
|
||||
// .show();
|
||||
}else{
|
||||
if (!isAuth) {
|
||||
FalseKeys();
|
||||
@@ -552,11 +426,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
gia.showPopueWindow(this);
|
||||
} else if (!url3.equals("")) {
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(img3, url3, new SmartGlideImageLoader(R.mipmap.ic_launcher_round))
|
||||
.asImageViewer(img3, url3, true, -1, -1, 50, false, new ImageLoader())
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(img3, url3, true, -1, -1, 50, false, new ImageLoader())
|
||||
// .show();
|
||||
}
|
||||
});
|
||||
value5.setOnClickListener(v -> {
|
||||
@@ -584,21 +455,11 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
startActivity(in1);
|
||||
break;
|
||||
case 1:
|
||||
//传驾驶证信息页面 跳转实名认证
|
||||
// finish();
|
||||
if (key) {
|
||||
key = false;
|
||||
new AuthRequest().getAuthUrl(con, hd);
|
||||
new Handler().postDelayed(() -> {
|
||||
key = true;
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
finish();
|
||||
//上传驾驶证信息页面 跳转资格证信息页面
|
||||
// finish();
|
||||
// Intent in2 = new Intent(con, AuthQualificationActivity.class);
|
||||
// in2.putExtra("type", "0");
|
||||
// startActivity(in2);
|
||||
Intent in2 = new Intent(con, AuthQualificationActivity.class);
|
||||
in2.putExtra("type", "0");
|
||||
startActivity(in2);
|
||||
break;
|
||||
case 2:
|
||||
finish();
|
||||
@@ -613,12 +474,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
boolean isAuth = false;
|
||||
|
||||
public void initData() {
|
||||
@@ -684,10 +539,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
Log.e("挂车信息", gson.toJson(cdb));
|
||||
if (cdb != null && cdb.getData().getTrailerResVo() != null
|
||||
&& !TextUtils.isEmpty(cdb.getData().getTrailerResVo().getFrontImage())
|
||||
&& !TextUtils.isEmpty(cdb.getData().getTrailerResVo().getBackImage())) {
|
||||
LogUtil.e("挂车信息", gson.toJson(cdb));
|
||||
if (cdb != null && cdb.getData().getTrailerResVo() != null) {
|
||||
url1 = StringUtil.isNull(cdb.getData().getTrailerResVo().getFrontImage(), "");
|
||||
url2 = StringUtil.isNull(cdb.getData().getTrailerResVo().getBackImage(), "");
|
||||
url3 = StringUtil.isNull(cdb.getData().getTrailerResVo().getThreeImage(), "");
|
||||
@@ -696,17 +549,15 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
value3.setText(StringUtil.isNull(cdb.getData().getTrailerResVo().getOwner(), "空数据"));
|
||||
value4.setText(StringUtil.isNull(cdb.getData().getTrailerResVo().getVehicleNumber(), "空数据"));
|
||||
value6.setText(StringUtil.isNull(cdb.getData().getCarEnergyTypValue(), "空数据"));
|
||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||
Glide.with(con).load(url1).into(img1);
|
||||
Glide.with(con).load(url2).into(img2);
|
||||
Glide.with(con).load(url3).into(img3);
|
||||
if (cdb.getRes() != 1) {
|
||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||
u_img.setText("已上传");
|
||||
u_img2.setText("已上传");
|
||||
u_img3.setText("点击查看");
|
||||
isAuth = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -720,7 +571,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == 12 && resultCode == RESULT_OK) {
|
||||
path = gia.getFile().getPath();
|
||||
Log.e("图片地址:", path);
|
||||
LogUtil.e("图片地址:", path);
|
||||
gia.dis();
|
||||
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||
} else if (requestCode == PictureConfig.CHOOSE_REQUEST && resultCode == RESULT_OK) {
|
||||
@@ -733,7 +584,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
paths = image.getPath();
|
||||
}
|
||||
path = paths;
|
||||
Log.e("图片地址:", path);
|
||||
LogUtil.e("图片地址:", path);
|
||||
gia.dis();
|
||||
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||
}
|
||||
@@ -765,8 +616,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
value1.setText(ocb.getData().getName());
|
||||
value2.setText(ocb.getData().getCardId());
|
||||
value3.setText(ocb.getData().getAddress());
|
||||
// Glide.with(con).load(url1).into(img1);
|
||||
Glide.with(con).load(path).into(img1);
|
||||
Glide.with(con).load(url1).into(img1);
|
||||
fontId = ocb.getData().getId();
|
||||
} else {
|
||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
||||
@@ -778,13 +628,9 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
if (ocbb.getCode() == 200) {
|
||||
url2 = ocbb.getData().getUrl();
|
||||
value4.setText(ocbb.getData().getEndTime());
|
||||
// Glide.with(con).load(url2).into(img2);
|
||||
Glide.with(con).load(path).into(img2);
|
||||
Glide.with(con).load(url2).into(img2);
|
||||
startTime = ocbb.getData().getStartTime();
|
||||
backId = ocbb.getData().getId();
|
||||
|
||||
//自动调取提交功能,实现页面自动跳转
|
||||
subimt();
|
||||
} else {
|
||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@@ -803,8 +649,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
value2.setText(StringUtil.isNull(od.getStartTime(), "识别异常"));
|
||||
value3.setText(StringUtil.isNull(od.getAllowType(), "识别异常"));
|
||||
value4.setText(StringUtil.isNull(od.getEndTime(), "识别异常"));
|
||||
// Glide.with(con).load(url1).into(img1);
|
||||
Glide.with(con).load(path).into(img1);
|
||||
Glide.with(con).load(url1).into(img1);
|
||||
fontId = od.getId();
|
||||
} else {
|
||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
||||
@@ -816,10 +661,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
if (odlb.getCode() == 200) {
|
||||
url2 = odlb.getData().getUrl();
|
||||
backId = odlb.getData().getId();
|
||||
// Glide.with(con).load(url2).into(img2);
|
||||
Glide.with(con).load(path).into(img2);
|
||||
//自动调取提交功能,实现页面自动跳转
|
||||
subimt();
|
||||
Glide.with(con).load(url2).into(img2);
|
||||
} else {
|
||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@@ -830,27 +672,18 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
case 2:
|
||||
//{"车牌号","车辆类型","所有人","车辆识别代码"}
|
||||
if (CacheGroup.cacheList.get(TYPE_NAME[2]) != null) {
|
||||
Log.e("olb", CacheGroup.cacheList.get(TYPE_NAME[2]));
|
||||
LogUtil.e("olb", CacheGroup.cacheList.get(TYPE_NAME[2]));
|
||||
olb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[2]), OCRVehicleLicenseBean.class);
|
||||
if (olb.getCode() == 200) {
|
||||
if (olb.getData().isCarExist()) {
|
||||
value1.setEnabled(false);
|
||||
Glide.with(con).load(olb.getData().getExistCarInfo().getBackImage()).into(img2);
|
||||
url2 = olb.getData().getExistCarInfo().getBackImage();
|
||||
ToastUtils.showLongToast(con, "该车辆已存在,请仔细核对相关信息");
|
||||
} else {
|
||||
value1.setEnabled(true);
|
||||
}
|
||||
url1 = olb.getData().getUrl();
|
||||
value1.setText(olb.getData().getCarNumber());
|
||||
value2.setText(olb.getData().getType());
|
||||
value3.setText(olb.getData().getOwner());
|
||||
value4.setText(olb.getData().getVehicleNumber());
|
||||
fontId = olb.getData().getId();
|
||||
// Glide.with(con).load(url1).into(img1);
|
||||
Glide.with(con).load(path).into(img1);
|
||||
Glide.with(con).load(url1).into(img1);
|
||||
oCrcarId = olb.getData().getCarId() + "";
|
||||
Log.e("-cardId-", oCrcarId);
|
||||
LogUtil.e("-cardId-", oCrcarId);
|
||||
} else {
|
||||
Toast.makeText(con, olb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@@ -861,10 +694,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
if (oblb.getCode() == 200) {
|
||||
url2 = oblb.getData().getUrl();
|
||||
backId = oblb.getData().getId();
|
||||
// Glide.with(con).load(url2).into(img2);
|
||||
Glide.with(con).load(path).into(img2);
|
||||
//自动调取提交功能,实现页面自动跳转实现页面自动跳转
|
||||
subimt();
|
||||
Glide.with(con).load(url2).into(img2);
|
||||
} else {
|
||||
Toast.makeText(con, oblb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@@ -875,8 +705,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
if (ub.getCode() == 200) {
|
||||
url3 = ub.getData().getUrl();
|
||||
fid = ub.getData().getId();
|
||||
// Glide.with(con).load(url3).into(img3);
|
||||
Glide.with(con).load(path).into(img3);
|
||||
Glide.with(con).load(url3).into(img3);
|
||||
} else {
|
||||
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@@ -900,7 +729,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
if (keys[0]) {
|
||||
new OCRRequest().OCRCard(con, hd, new File(path));
|
||||
} else {
|
||||
Log.e("res" + new File(path).getName(), new File(path).getPath());
|
||||
LogUtil.e("res" + new File(path).getName(), new File(path).getPath());
|
||||
new OCRRequest().OCRCardBack(con, hd, new File(path));
|
||||
}
|
||||
break;
|
||||
@@ -920,14 +749,14 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
customDialog.dismiss();
|
||||
return;
|
||||
}
|
||||
new OCRRequest().OCRVehicleLicenseBack(con, hd, new File(path), oCrcarId, carNum, olb.getData().isCarExist());
|
||||
new OCRRequest().OCRVehicleLicenseBack(con, hd, new File(path), oCrcarId, carNum);
|
||||
|
||||
} else {
|
||||
new AuthRequest().upload(con, hd, new File(path));
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
Log.e("添加挂车", "挂车" + oCrcarId);
|
||||
LogUtil.e("添加挂车", "挂车" + oCrcarId);
|
||||
if (keys[0]) {
|
||||
new OCRRequest().OCRVehicleLicense(con, hd, new File(path));
|
||||
} else if (keys[1]) {
|
||||
@@ -936,16 +765,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
customDialog.dismiss();
|
||||
return;
|
||||
}
|
||||
// if (cdb != null && cdb.getData().getTrailerResVo() &&cdb.getRes() == 1)
|
||||
boolean isExist = false;
|
||||
if (olb != null) {//主页识别成功后获取
|
||||
isExist = olb.getData().isCarExist();
|
||||
} else {
|
||||
if (cdb != null && cdb.getData().getTrailerResVo() != null && cdb.getRes() == 1) {//上个页面带来数据
|
||||
isExist = true;
|
||||
}
|
||||
}
|
||||
new OCRRequest().OCRVehicleLicenseBack(con, hd, new File(path), oCrcarId, carNum, isExist);
|
||||
new OCRRequest().OCRVehicleLicenseBack(con, hd, new File(path), oCrcarId, carNum);
|
||||
} else {
|
||||
new AuthRequest().upload(con, hd, new File(path));
|
||||
}
|
||||
@@ -968,8 +788,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
switch (index) {
|
||||
case 0:
|
||||
if (ocb != null && ocbb != null) {
|
||||
customDialog = new CustomDialog(con, "网络请求中...");
|
||||
customDialog.show();
|
||||
IDInputBean ib = new IDInputBean();
|
||||
ib.setIdcarName(str1);
|
||||
ib.setIdcard(str2);
|
||||
@@ -992,9 +810,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
//olb
|
||||
//{"档案编号","初次领证日期","准驾车型","有效期限(止)"},
|
||||
if (odl != null && odlb != null) {
|
||||
customDialog = new CustomDialog(con, "网络请求中...");
|
||||
customDialog.show();
|
||||
Log.e("ocr", new Gson().toJson(odl));
|
||||
LogUtil.e("ocr", new Gson().toJson(odl));
|
||||
LicenseInputBean iib = new LicenseInputBean();
|
||||
iib.setArchivesName(str1);
|
||||
iib.setDriverLicenseName(value7.getText().toString());
|
||||
@@ -1010,54 +826,44 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if ((olb != null && !olb.getData().isCarExist() && oblb != null) || (olb != null && olb.getData().isCarExist())) {
|
||||
// if (curColor == null || curEnergy == null) {
|
||||
// Toast.makeText(con, "请完善内容", Toast.LENGTH_SHORT).show();
|
||||
// return;
|
||||
// }
|
||||
customDialog = new CustomDialog(con, "网络请求中...");
|
||||
customDialog.show();
|
||||
if (olb != null && oblb != null) {
|
||||
if (curColor==null||curEnergy==null){
|
||||
Toast.makeText(con,"请完善内容",Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
if ("".equals(url3)) {
|
||||
map.put("imgId", fid);
|
||||
}
|
||||
map.put("licenseId", olb.getData().isCarExist() ? olb.getData().getExistCarInfo().getLicenseId() : oblb.getData().getLicenseId());
|
||||
map.put("licenseId", oblb.getData().getLicenseId());
|
||||
map.put("carNumber", str1);
|
||||
map.put("type", str2);
|
||||
map.put("owner", str3);
|
||||
map.put("vehicleNumber", str4);
|
||||
// if (olb.getData().isCarExist()) {
|
||||
// map.put("carId", olb.getData().getCarId());
|
||||
// }
|
||||
// map.put("carPlateColor", curColor.getValue());
|
||||
// map.put("carEnergyTyp", curEnergy.getValue());
|
||||
map.put("carPlateColor", curColor.getValue());
|
||||
map.put("carEnergyTyp", curEnergy.getValue());
|
||||
new AuthRequest().saveVehicleLicense(con, hd, MapUtil.mapJson(map));
|
||||
} else {
|
||||
Toast.makeText(con, "请先上传资料", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (olb != null || (cdb != null && cdb.getRes() == 1)) {
|
||||
if (olb != null && oblb != null) {
|
||||
// if (curEnergy==null){
|
||||
// Toast.makeText(con,"请完善内容",Toast.LENGTH_SHORT).show();
|
||||
// return;
|
||||
// }
|
||||
customDialog = new CustomDialog(con, "网络请求中...");
|
||||
customDialog.show();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if ("".equals(url3)) {
|
||||
map.put("imgId", fid);
|
||||
}
|
||||
// map.put("licenseId", oblb.getData().getLicenseId());
|
||||
map.put("licenseId", oblb.getData().getLicenseId());
|
||||
map.put("carId", carId);
|
||||
map.put("carNumberDraw", str1);
|
||||
map.put("type", str2);
|
||||
map.put("owner", str3);
|
||||
// map.put("carEnergyTyp", curEnergy.getValue());
|
||||
map.put("vehicleNumber", str4);
|
||||
if (cdb != null && cdb.getRes() == 1 && cdb.getData() != null && cdb.getData().getTrailerResVo() != null) {
|
||||
map.put("oldTrailerNumber", cdb.getData().getTrailerResVo().getCarNumber());
|
||||
}
|
||||
new AuthRequest().saveDrawCar(con, hd, MapUtil.mapJson(map));
|
||||
} else {
|
||||
Toast.makeText(con, "请先上传资料", Toast.LENGTH_SHORT).show();
|
||||
@@ -1073,56 +879,22 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
EventBus.getDefault().post(he);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void processResult(AuthEvent auth) {
|
||||
//添加实名/意愿/签署完成之后的逻辑
|
||||
Log.e("-回调信息-", auth.result);
|
||||
JSONObject jsonObject = JSON.parseObject(auth.result);
|
||||
if ("success".equalsIgnoreCase(jsonObject.getString("res"))) {
|
||||
EsignSdk.getInstance().finishH5Activity();
|
||||
new MessageUtils().showSimCenPop(con, "个人信息上传成功,请添加车辆信息!", () -> {
|
||||
finish();
|
||||
Intent in = new Intent(con, CertificatesActivity.class);
|
||||
in.putExtra("index", 2);
|
||||
startActivity(in);
|
||||
public static class ImageLoader implements XPopupImageLoader {
|
||||
@Override
|
||||
public void loadImage(int position, @NonNull Object url, @NonNull ImageView imageView) {
|
||||
//必须指定Target.SIZE_ORIGINAL,否则无法拿到原图,就无法享用天衣无缝的动画
|
||||
Glide.with(imageView).load(url).apply(new RequestOptions().placeholder(R.mipmap.ic_launcher_round).override(Target.SIZE_ORIGINAL)).into(imageView);
|
||||
}
|
||||
|
||||
});
|
||||
if ("sign".equalsIgnoreCase(jsonObject.getString("key"))) {
|
||||
Toast.makeText(con, "签署场景成功", Toast.LENGTH_SHORT).show();
|
||||
} else if ("realName".equalsIgnoreCase(jsonObject.getString("key"))) {
|
||||
Toast.makeText(con, "实名认证成功", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(con, "意愿认证成功", Toast.LENGTH_SHORT).show();
|
||||
@Override
|
||||
public File getImageFile(@NonNull Context context, @NonNull Object uri) {
|
||||
try {
|
||||
return Glide.with(context).downloadOnly().load(uri).submit().get();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
if ("sign".equalsIgnoreCase(jsonObject.getString("key"))) {
|
||||
Toast.makeText(con, "签署场景失败", Toast.LENGTH_SHORT).show();
|
||||
} else if ("realName".equalsIgnoreCase(jsonObject.getString("key"))) {
|
||||
Toast.makeText(con, "实名认证失败", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(con, "意愿认证失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
EsignSdk.getInstance().finishH5Activity();
|
||||
finish();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// public static class ImageLoader implements XPopupImageLoader {
|
||||
// @Override
|
||||
// public void loadImage(int position, @NonNull Object url, @NonNull ImageView imageView) {
|
||||
// //必须指定Target.SIZE_ORIGINAL,否则无法拿到原图,就无法享用天衣无缝的动画
|
||||
// Glide.with(imageView).load(url).apply(new RequestOptions().placeholder(R.mipmap.ic_launcher_round).override(Target.SIZE_ORIGINAL)).into(imageView);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public File getImageFile(@NonNull Context context, @NonNull Object uri) {
|
||||
// try {
|
||||
// return Glide.with(context).downloadOnly().load(uri).submit().get();
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
+8
-20
@@ -5,7 +5,6 @@ import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
@@ -15,9 +14,9 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.arpa.hndahesudintocctmsdriver.H5Activity;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.PersonEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.esign.esignsdk.EsignSdk;
|
||||
import com.esign.esignsdk.data.AuthEvent;
|
||||
@@ -41,7 +40,6 @@ import com.arpa.hndahesudintocctmsdriver.util.file.ImageFileCompressUtil;
|
||||
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 org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@@ -94,18 +92,13 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
||||
CacheGroup.cacheList.remove("upHeadImg");
|
||||
}
|
||||
if (CacheGroup.cacheList.get("authUrl") != null) {
|
||||
Log.e("url", CacheGroup.cacheList.get("authUrl"));
|
||||
LogUtil.e("url", CacheGroup.cacheList.get("authUrl"));
|
||||
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);
|
||||
// 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"));
|
||||
}//LogUtil.e("url",CacheGroup.cacheList.get("authUrl"));
|
||||
CacheGroup.cacheList.remove("authUrl");
|
||||
}
|
||||
break;
|
||||
@@ -168,8 +161,6 @@ 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) {
|
||||
// EsignSdk.getInstance().startH5Activity(act, "");
|
||||
|
||||
key = false;
|
||||
new AuthRequest().getAuthUrl(con, hd);
|
||||
new Handler().postDelayed(() -> {
|
||||
@@ -184,11 +175,8 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
||||
up_head.setOnClickListener(v -> {
|
||||
if (ub.getData().getHeadportraitUrl() != null && !ub.getData().getHeadportraitUrl().equals("")) {
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(up_head, ub.getData().getHeadportraitUrl(), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||
.asImageViewer(up_head, ub.getData().getHeadportraitUrl(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(up_head, ub.getData().getHeadportraitUrl(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
}
|
||||
});
|
||||
hyr = new HuoYuanRequset(con, hd);
|
||||
@@ -218,7 +206,7 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
||||
|
||||
@Subscribe
|
||||
public void personResult(PersonEvent home) {
|
||||
Log.e("-res-", home.getMessage());
|
||||
LogUtil.e("-res-", home.getMessage());
|
||||
if (ur != null) {
|
||||
ur.User();
|
||||
}
|
||||
@@ -235,7 +223,7 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == 12 && resultCode == RESULT_OK) {
|
||||
path = gia.getFile().getPath();
|
||||
Log.e("图片地址:", path);
|
||||
LogUtil.e("图片地址:", path);
|
||||
gia.dis();
|
||||
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||
} else if (requestCode == PictureConfig.CHOOSE_REQUEST && resultCode == RESULT_OK) {
|
||||
@@ -247,7 +235,7 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
||||
paths = image.getPath();
|
||||
}
|
||||
path = paths;
|
||||
Log.e("图片地址:", path);
|
||||
LogUtil.e("图片地址:", path);
|
||||
gia.dis();
|
||||
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||
}
|
||||
@@ -269,7 +257,7 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
||||
@Subscribe
|
||||
public void processResult(AuthEvent auth) {
|
||||
//添加实名/意愿/签署完成之后的逻辑
|
||||
Log.e("-回调信息-", auth.result);
|
||||
LogUtil.e("-回调信息-", auth.result);
|
||||
JSONObject jsonObject = JSON.parseObject(auth.result);
|
||||
if ("success".equalsIgnoreCase(jsonObject.getString("res"))) {
|
||||
if ("sign".equalsIgnoreCase(jsonObject.getString("key"))) {
|
||||
|
||||
+28
-165
@@ -24,22 +24,19 @@ import com.arpa.hndahesudintocctmsdriver.bean.UploadBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.AuthRequest;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.UserRequset;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.my.WoDeFragment;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.file.ImageFileCompressUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.img.GetImageAlert;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.github.gzuliyujiang.wheelpicker.DatePicker;
|
||||
import com.github.gzuliyujiang.wheelpicker.annotation.DateMode;
|
||||
import com.google.gson.Gson;
|
||||
import com.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;
|
||||
@@ -52,24 +49,23 @@ import java.util.List;
|
||||
*/
|
||||
public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnClickListener {
|
||||
|
||||
private String[] titles = {"车辆照片", "NFC照片", "车辆登记证书", "道路运输许可证", "车辆交强险"};
|
||||
private String[] name1 = {"车辆照片", "NFC照片", "车辆登记证书照片", "道路运输许可证照片", "车辆交强险照片"};
|
||||
private String[] name2 = {"请上传车辆照片", "请上传NFC照片", "请上传车辆登记证书照片", "请上传道路运输许可证照片", "请上传车辆交强险照片"};
|
||||
private Boolean[] isShowEdit = {false, false, true, true, true};
|
||||
private Boolean[] isShowSkip = {true, false, false, true, true};
|
||||
private String[] titles = {"车辆照片", "NFC照片", "车辆登记证书", "道路运输许可证"};
|
||||
private String[] name1 = {"车辆照片", "NFC照片", "车辆登记证书照片", "道路运输许可证照片"};
|
||||
private String[] name2 = {"请上传车辆照片", "请上传NFC照片", "请上传车辆登记证书照片", "请上传道路运输许可证照片"};
|
||||
private Boolean[] isShowEdit = {false, false, true, true};
|
||||
private Boolean[] isShowSkip = {true, false, false, false};
|
||||
private String[] tips = {
|
||||
"",
|
||||
"*注意: 没有粘贴NFC芯片的车辆无需上传,可直接跳过",
|
||||
"*注意: 没有可直接跳过,等候下次上传",
|
||||
"*注意: 4.5吨以下车辆不需要上传,可直接跳过",
|
||||
""};
|
||||
"*注意: 4.5吨一下车辆不需要上传,可直接跳过"};
|
||||
|
||||
|
||||
private BaseRecyclerView brv;
|
||||
private ImageView img;
|
||||
private TextView title1, title2, title3, zjimg_name, upload_img, tvTips, tvSkip, value2;
|
||||
private TextView title1, title2, title3, zjimg_name, upload_img, tvTips, tvSkip;
|
||||
private EditText value1;
|
||||
private LinearLayout llInfo, llDate;
|
||||
private LinearLayout llInfo;
|
||||
private RelativeLayout up_img;
|
||||
private Button submit;
|
||||
|
||||
@@ -79,9 +75,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
|
||||
private int type;//页面类型
|
||||
private String path, carId, url;//图片路径
|
||||
private boolean carExist = false;
|
||||
private GetImageAlert gia = new GetImageAlert();
|
||||
private CustomDialog customDialog;
|
||||
|
||||
@Override
|
||||
public void msgMethod(Message m) {
|
||||
@@ -89,7 +83,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
switch (m.what) {
|
||||
case 200:
|
||||
if (CacheGroup.cacheList.get(WoDeFragment.VEHICLE_DEL) != null) {
|
||||
Log.e("--res--", CacheGroup.cacheList.get(WoDeFragment.VEHICLE_DEL));
|
||||
LogUtil.e("--res--", CacheGroup.cacheList.get(WoDeFragment.VEHICLE_DEL));
|
||||
cdb = gson.fromJson(CacheGroup.cacheList.get(WoDeFragment.VEHICLE_DEL), CarDelBean.class);
|
||||
if (cdb.getCode() == 200) {
|
||||
showImgToView();
|
||||
@@ -98,11 +92,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("upload") != null) {
|
||||
@@ -120,16 +109,10 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
case 3:
|
||||
new AuthRequest().saveCarImg(con, hd, carId, ub.getData().getId(), 2);
|
||||
break;
|
||||
case 4:
|
||||
new AuthRequest().saveCarImg(con, hd, carId, ub.getData().getId(), 7);
|
||||
break;
|
||||
}
|
||||
url = ub.getData().getUrl();
|
||||
// Glide.with(con).load(url).into(img);
|
||||
Glide.with(con).load(path).into(img);
|
||||
Glide.with(con).load(url).into(img);
|
||||
|
||||
if (customDialog != null && customDialog.isShowing())
|
||||
customDialog.dismiss();
|
||||
CacheGroup.cacheList.remove("upload");
|
||||
}
|
||||
|
||||
@@ -147,12 +130,8 @@ 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();
|
||||
break;
|
||||
case 4:
|
||||
Toast.makeText(con, "交强险证件上传成功", Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
@@ -160,7 +139,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
CacheGroup.cacheList.remove("saveCarImg");
|
||||
}
|
||||
if (CacheGroup.cacheList.get("saveCarRegisterNo") != null) {
|
||||
Log.e("is", CacheGroup.cacheList.get("saveCarRegisterNo"));
|
||||
LogUtil.e("is", CacheGroup.cacheList.get("saveCarRegisterNo"));
|
||||
IsAuthDriverAuthQualificationBean ib = gson.fromJson(CacheGroup.cacheList.get("saveCarRegisterNo"), IsAuthDriverAuthQualificationBean.class);
|
||||
if (ib.getCode() == 200) {
|
||||
finish();
|
||||
@@ -175,17 +154,12 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("saveCarRoadLicenseNo") != null) {
|
||||
Log.e("is", CacheGroup.cacheList.get("saveCarRoadLicenseNo"));
|
||||
LogUtil.e("is", CacheGroup.cacheList.get("saveCarRoadLicenseNo"));
|
||||
IsAuthDriverAuthQualificationBean ib = gson.fromJson(CacheGroup.cacheList.get("saveCarRoadLicenseNo"), IsAuthDriverAuthQualificationBean.class);
|
||||
if (ib.getCode() == 200) {
|
||||
//判断是否需要跳转挂车行驶证页面
|
||||
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);
|
||||
} else if (cdb.getData().getIsTrailer() == 1 && cdb.getData().getTrailerResVo() != null && TextUtils.isEmpty(cdb.getData().getTrailerResVo().getCarNumber())) {//需要挂车,没传过挂车,到挂车页面
|
||||
if (!"".equals(carId) && cdb.getData().getIsTrailer() == 1) {
|
||||
if (!"".equals(carId)) {
|
||||
finish();
|
||||
Intent in = new Intent(con, CertificatesActivity.class);
|
||||
in.putExtra("index", 3);
|
||||
@@ -194,66 +168,22 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
in.putExtra("cheData", new Gson().toJson(cdb));
|
||||
}
|
||||
startActivity(in);
|
||||
} else if (cdb.getData().getIsTrailer() == 0) {//不需要挂车
|
||||
if ("1".equals(cdb.getData().getNeedUpQCPhoto())) {//需要从业资格证
|
||||
Intent in = new Intent(con, AuthQualificationActivity.class);
|
||||
in.putExtra("type", "0");
|
||||
in.putExtra("carId", carId);
|
||||
in.putExtra("isOverCar", false);
|
||||
startActivity(in);
|
||||
} else {
|
||||
Toast.makeText(con, "请先绑定行驶证", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else {
|
||||
finish();
|
||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
con.startActivity(in);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
|
||||
|
||||
// if (!"".equals(carId) && cdb.getData().getIsTrailer() == 1) {
|
||||
// if (!"".equals(carId)) {
|
||||
// finish();
|
||||
// Intent in = new Intent(con, CertificatesActivity.class);
|
||||
// in.putExtra("index", 3);
|
||||
// in.putExtra("carId", carId);
|
||||
// if (cdb != null) {
|
||||
// in.putExtra("cheData", new Gson().toJson(cdb));
|
||||
// }
|
||||
// startActivity(in);
|
||||
// } else {
|
||||
// Toast.makeText(con, "请先绑定行驶证", Toast.LENGTH_SHORT).show();
|
||||
// }
|
||||
// } else {
|
||||
// finish();
|
||||
// Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||
// in.putExtra("type", 3);
|
||||
// con.startActivity(in);
|
||||
// }
|
||||
} else {
|
||||
Toast.makeText(con, ib.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove("saveCarRoadLicenseNo");
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("saveTrafficInsurance") != null) {
|
||||
Log.e("is", CacheGroup.cacheList.get("saveTrafficInsurance"));
|
||||
IsAuthDriverAuthQualificationBean ddb = gson.fromJson(CacheGroup.cacheList.get("saveTrafficInsurance"), IsAuthDriverAuthQualificationBean.class);
|
||||
if (ddb.getCode() == 200) {
|
||||
Toast.makeText(con, "保存成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
} else {
|
||||
Toast.makeText(con, ddb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
CacheGroup.cacheList.remove("saveTrafficInsurance");
|
||||
}
|
||||
break;
|
||||
case ImageFileCompressUtil.COMPRESS_SUCCESS:
|
||||
customDialog = new CustomDialog(con, "加载中...");
|
||||
customDialog.show();
|
||||
path = (String) m.obj;
|
||||
new AuthRequest().upload(con, hd, new File(path));
|
||||
break;
|
||||
@@ -272,7 +202,6 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
title1 = findViewById(R.id.title1);
|
||||
title2 = findViewById(R.id.title2);
|
||||
title3 = findViewById(R.id.name1);
|
||||
value2 = findViewById(R.id.value2);
|
||||
up_img = findViewById(R.id.up_img);
|
||||
img = findViewById(R.id.img);
|
||||
zjimg_name = findViewById(R.id.zjimg_name);
|
||||
@@ -280,7 +209,6 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
tvTips = findViewById(R.id.tvTips);
|
||||
value1 = findViewById(R.id.value1);
|
||||
llInfo = findViewById(R.id.llInfo);
|
||||
llDate = findViewById(R.id.llDate);
|
||||
tvSkip = findViewById(R.id.tvSkip);
|
||||
submit = findViewById(R.id.submit);
|
||||
|
||||
@@ -288,12 +216,10 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
submit.setOnClickListener(this);
|
||||
upload_img.setOnClickListener(this);
|
||||
img.setOnClickListener(this);
|
||||
value2.setOnClickListener(this);
|
||||
|
||||
|
||||
type = getIntent().getExtras().getInt("type");
|
||||
carId = getIntent().getExtras().getString("carId", "");
|
||||
carExist = getIntent().getExtras().getBoolean("carExist", false);
|
||||
changeViewByType(type);
|
||||
|
||||
ur = new UserRequset(con, hd);
|
||||
@@ -315,7 +241,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == 12 && resultCode == RESULT_OK) {
|
||||
path = gia.getFile().getPath();
|
||||
Log.e("图片地址:", path);
|
||||
LogUtil.e("图片地址:", path);
|
||||
gia.dis();
|
||||
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||
} else if (requestCode == PictureConfig.CHOOSE_REQUEST && resultCode == RESULT_OK) {
|
||||
@@ -328,7 +254,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
paths = image.getPath();
|
||||
}
|
||||
path = paths;
|
||||
Log.e("图片地址:", path);
|
||||
LogUtil.e("图片地址:", path);
|
||||
gia.dis();
|
||||
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||
}
|
||||
@@ -350,14 +276,6 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
case R.id.img:
|
||||
showBigImg();
|
||||
break;
|
||||
case R.id.value2:
|
||||
DatePicker picker = new DatePicker(this);
|
||||
picker.setBodyWidth(300);
|
||||
picker.setOnDatePickedListener((year, month, day) -> value2.setText(year + "-" + month + "-" + day));
|
||||
picker.getWheelLayout().setDateMode(DateMode.YEAR_MONTH_DAY);
|
||||
picker.getWheelLayout().setDateLabel("年", "月", "日");
|
||||
picker.show();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -366,66 +284,37 @@ 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()))) {
|
||||
choicePhoto();
|
||||
return;
|
||||
}
|
||||
switch (type) {
|
||||
case 0:
|
||||
if (cdb.getData().getRoadLicensePhoto() != null && !cdb.getData().getCarImage().equals("")) {
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(img, cdb.getData().getCarImage(), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||
.asImageViewer(img, cdb.getData().getCarImage(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(img, cdb.getData().getCarImage(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (cdb.getData().getRoadLicensePhoto() != null && !cdb.getData().getNfcImage().equals("")) {
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(img, cdb.getData().getNfcImage(), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||
.asImageViewer(img, cdb.getData().getNfcImage(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(img, cdb.getData().getNfcImage(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (cdb.getData().getRoadLicensePhoto() != null && !cdb.getData().getRegisterImage().equals("")) {
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(img, cdb.getData().getRegisterImage(), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||
.asImageViewer(img, cdb.getData().getRegisterImage(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(img, cdb.getData().getRegisterImage(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (cdb.getData().getRoadLicensePhoto() != null && !"".equals(cdb.getData().getRoadLicensePhoto())) {
|
||||
//roadLicensePhoto
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(img, cdb.getData().getRoadLicensePhoto(), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||
.asImageViewer(img, cdb.getData().getRoadLicensePhoto(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(img, cdb.getData().getRoadLicensePhoto(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if (cdb.getData().getPolicyPhotoUrl() != null && !"".equals(cdb.getData().getPolicyPhotoUrl())) {
|
||||
//roadLicensePhoto
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(img, cdb.getData().getPolicyPhotoUrl(), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(img, cdb.getData().getRoadLicensePhoto(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -444,8 +333,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
if (!TextUtils.isEmpty(url)||(cdb!=null&&!TextUtils.isEmpty(cdb.getData().getCarImage()))){
|
||||
finish();
|
||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
||||
// in.putExtra("type", 1);
|
||||
in.putExtra("type", 3);
|
||||
in.putExtra("type", 1);
|
||||
in.putExtra("carId", carId);
|
||||
con.startActivity(in);
|
||||
} else{
|
||||
@@ -462,7 +350,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
case 2:
|
||||
String s = value1.getText().toString();
|
||||
if (TextUtils.isEmpty(s)) {
|
||||
Toast.makeText(this, "请补充证件信息", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(this, "请完善证号", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
new AuthRequest().saveCarRegisterNo(con,hd,carId,s);
|
||||
@@ -470,20 +358,11 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
case 3:
|
||||
String s1 = value1.getText().toString();
|
||||
if (TextUtils.isEmpty(s1)) {
|
||||
Toast.makeText(this, "请补充证件信息", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(this, "请完善证号", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
new AuthRequest().saveCarRoadLicenseNo(con,hd,carId,s1);
|
||||
break;
|
||||
case 4:
|
||||
String s2 = value1.getText().toString();
|
||||
String v2 = value2.getText().toString();
|
||||
if (TextUtils.isEmpty(s2) || TextUtils.isEmpty(v2)) {
|
||||
Toast.makeText(this, "请补充证件信息", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
new AuthRequest().saveTrafficInsurance(con, hd, carId, v2, s2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -515,17 +394,6 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
if (!TextUtils.isEmpty(cdb.getData().getRoadLicensePhoto())) {
|
||||
Glide.with(con).load(cdb.getData().getRoadLicensePhoto()).into(img);
|
||||
value1.setText(cdb.getData().getRoadLicense());
|
||||
if (!carExist) {
|
||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||
upload_img.setText("已上传");
|
||||
}
|
||||
|
||||
}
|
||||
} else if (4 == type) {
|
||||
if (!TextUtils.isEmpty(cdb.getData().getPolicyPhotoUrl())) {
|
||||
Glide.with(con).load(cdb.getData().getPolicyPhotoUrl()).into(img);
|
||||
value1.setText(cdb.getData().getInsuranceCompany());
|
||||
value2.setText(cdb.getData().getInsuranceEndDay());
|
||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||
upload_img.setText("已上传");
|
||||
}
|
||||
@@ -558,8 +426,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
if (0 == type) {
|
||||
finish();
|
||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
||||
// in.putExtra("type", 1);
|
||||
in.putExtra("type", 3);
|
||||
in.putExtra("type", 1);
|
||||
in.putExtra("carId", carId);
|
||||
con.startActivity(in);
|
||||
} else if (1 == type) {
|
||||
@@ -611,10 +478,6 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
tvTips.setText(tips[type]);
|
||||
tvSkip.setVisibility(isShowSkip[type] ? View.GONE : View.VISIBLE);
|
||||
llInfo.setVisibility(isShowEdit[type] ? View.VISIBLE : View.GONE);
|
||||
if (type == 4) {
|
||||
llDate.setVisibility(View.VISIBLE);
|
||||
title3.setText("保险公司");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+10
-39
@@ -14,10 +14,8 @@ import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.event.RefreshCarListEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.VehicleEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.google.gson.Gson;
|
||||
import com.luck.picture.lib.PictureSelector;
|
||||
import com.luck.picture.lib.config.PictureConfig;
|
||||
@@ -36,12 +34,10 @@ import com.arpa.hndahesudintocctmsdriver.util.file.ImageFileCompressUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||
import com.scwang.smart.refresh.layout.SmartRefreshLayout;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
@@ -55,7 +51,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;
|
||||
@@ -70,7 +65,7 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
|
||||
CacheGroup.cacheList.remove(CAR_AUDIO);
|
||||
}
|
||||
if(CacheGroup.cacheList.get(WoDeFragment.VEHICLE_DEL)!=null){
|
||||
Log.e("--res--lijia",CacheGroup.cacheList.get(WoDeFragment.VEHICLE_DEL));
|
||||
LogUtil.e("--res--",CacheGroup.cacheList.get(WoDeFragment.VEHICLE_DEL));
|
||||
cdb=gson.fromJson(CacheGroup.cacheList.get(WoDeFragment.VEHICLE_DEL), CarDelBean.class);
|
||||
if(cdb.getCode()==200){
|
||||
initView(null);
|
||||
@@ -84,8 +79,6 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
|
||||
bb=gson.fromJson(CacheGroup.cacheList.get(DEL_CAR),BaseBean.class);
|
||||
if (bb.getCode()==200) {
|
||||
Toast.makeText(con,"删除成功",Toast.LENGTH_SHORT).show();
|
||||
RefreshCarListEvent ve = new RefreshCarListEvent("");
|
||||
EventBus.getDefault().post(ve);
|
||||
finish();
|
||||
}else{
|
||||
Toast.makeText(con,"删除失败:"+bb.getMsg(),Toast.LENGTH_SHORT).show();
|
||||
@@ -166,20 +159,13 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
|
||||
refreshLayout=findViewById(R.id.srl);
|
||||
carId=getIntent().getExtras().getString("carId");
|
||||
ur=new UserRequset(con,hd);
|
||||
Log.e("--carId--",carId+"--");
|
||||
LogUtil.e("--carId--",carId+"--");
|
||||
initRefreshLoad();
|
||||
}
|
||||
|
||||
private GetImageAlert gia=new GetImageAlert();
|
||||
private boolean key1,key2,key3=false;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView(Object obj) {
|
||||
super.initView(obj);
|
||||
@@ -221,12 +207,11 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
|
||||
RelativeLayout r5=v.findViewById(R.id.r5);
|
||||
RelativeLayout r6=v.findViewById(R.id.r6);
|
||||
RelativeLayout r7=v.findViewById(R.id.r7);
|
||||
RelativeLayout r8=v.findViewById(R.id.r8);
|
||||
View vs1=v.findViewById(R.id.vs1);
|
||||
View vs2=v.findViewById(R.id.vs2);
|
||||
r4.setVisibility(View.GONE);
|
||||
r5.setVisibility(View.GONE);
|
||||
// vs1.setVisibility(View.GONE);
|
||||
vs1.setVisibility(View.GONE);
|
||||
vs2.setVisibility(View.GONE);
|
||||
if(!"".equals(carId) && cdb.getData().getIsTrailer()==1){
|
||||
r4.setVisibility(View.VISIBLE);
|
||||
@@ -237,11 +222,8 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
|
||||
carImage.setOnClickListener(v14 -> {
|
||||
if(cdb!=null && cdb.getData()!=null && cdb.getData().getCarImage()!=null && !cdb.getData().getCarImage().equals("")){
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(carImage,cdb.getData().getCarImage(), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||
.asImageViewer(carImage,cdb.getData().getCarImage(), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(carImage,cdb.getData().getCarImage(), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
}
|
||||
});
|
||||
r1.setOnClickListener(v12 -> {
|
||||
@@ -316,17 +298,6 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
|
||||
Toast.makeText(con,"请先绑定挂车",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
|
||||
r8.setOnClickListener(v1->{
|
||||
if(!"".equals(carId)){
|
||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
||||
in.putExtra("type", 4);
|
||||
in.putExtra("carId", carId);
|
||||
con.startActivity(in);
|
||||
}else{
|
||||
Toast.makeText(con,"请先绑定行驶证",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
del.setOnClickListener(v13 -> {
|
||||
new XPopup.Builder(con)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||
@@ -366,7 +337,7 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == 12 && resultCode == RESULT_OK) {
|
||||
path=gia.getFile().getPath();
|
||||
Log.e("图片地址:",path);
|
||||
LogUtil.e("图片地址:",path);
|
||||
gia.dis();
|
||||
ImageFileCompressUtil.imageFileCompress(con,new File(path),hd);
|
||||
} else if (requestCode == PictureConfig.CHOOSE_REQUEST && resultCode == RESULT_OK) {
|
||||
@@ -379,7 +350,7 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
|
||||
paths = image.getPath();
|
||||
}
|
||||
path=paths;
|
||||
Log.e("图片地址:",path);
|
||||
LogUtil.e("图片地址:",path);
|
||||
gia.dis();
|
||||
ImageFileCompressUtil.imageFileCompress(con,new File(path),hd);
|
||||
}
|
||||
@@ -394,7 +365,7 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
|
||||
public void initRefreshLoad(){
|
||||
refreshLayout=findViewById(R.id.srl);
|
||||
refreshLayout.setOnRefreshListener(refreshLayout -> {
|
||||
Log.e("下拉刷新","pps");
|
||||
LogUtil.e("下拉刷新","pps");
|
||||
if("".equals(carId)){
|
||||
initView(null);
|
||||
refreshLayout.finishRefresh();
|
||||
@@ -410,9 +381,9 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
|
||||
@Subscribe
|
||||
public void processResult(VehicleEvent event) {
|
||||
Log.e("-msg-",event.getMessage());
|
||||
LogUtil.e("-msg-",event.getMessage());
|
||||
if(!"挂".equals(event.getMessage())) {
|
||||
carId = event.getMessage();
|
||||
}
|
||||
|
||||
+16
-100
@@ -2,7 +2,6 @@ package com.arpa.hndahesudintocctmsdriver.ui.business;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
@@ -10,15 +9,7 @@ import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.amap.api.services.core.AMapException;
|
||||
import com.amap.api.services.core.LatLonPoint;
|
||||
import com.amap.api.services.core.PoiItem;
|
||||
import com.amap.api.services.core.SuggestionCity;
|
||||
import com.amap.api.services.poisearch.PoiResult;
|
||||
import com.amap.api.services.poisearch.PoiSearch;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||
import com.dahe.mylibrary.utils.ImageLoader;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.google.gson.Gson;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.BusinessBean;
|
||||
@@ -49,7 +40,7 @@ import okhttp3.Response;
|
||||
* @date 2021/9/6 9:59
|
||||
* @description:
|
||||
*/
|
||||
public class BusinessActivity extends BaseActivity implements PoiSearch.OnPoiSearchListener {
|
||||
public class BusinessActivity extends BaseActivity {
|
||||
|
||||
private BaseRecyclerView business_type;
|
||||
private BaseRecyclerView business_list;
|
||||
@@ -61,16 +52,13 @@ public class BusinessActivity extends BaseActivity implements PoiSearch.OnPoiSea
|
||||
private CustomDialog customDialog;
|
||||
private int sum=0;
|
||||
private String type="餐饮";
|
||||
private PoiSearch.Query query;
|
||||
private List<PoiItem> poiItems;// poi数据
|
||||
|
||||
@Override
|
||||
public void msgMethod(Message m) {
|
||||
super.msgMethod(m);
|
||||
switch (m.what){
|
||||
case RequsetCodeConstants.SUCCESS:
|
||||
if(CacheGroup.cacheList.get("business_list")!=null){
|
||||
Log.e("--res--", CacheGroup.cacheList.get("business_list") + "");
|
||||
LogUtil.e("--res--",CacheGroup.cacheList.get("business_list")+"");
|
||||
blb=gson.fromJson(CacheGroup.cacheList.get("business_list"),BusinessListBean.class);
|
||||
if(blb.getCode()==200){
|
||||
forGetBusDel();
|
||||
@@ -82,21 +70,7 @@ public class BusinessActivity extends BaseActivity implements PoiSearch.OnPoiSea
|
||||
break;
|
||||
case LocationGDUtil.RES:
|
||||
address.setText(ld.getAddress());
|
||||
// new BusinessRequest().GetBusinessList(con,hd,ld.getLongitude()+"",ld.getLatitude()+"",type);
|
||||
|
||||
try {
|
||||
customDialog.dismiss();
|
||||
LatLonPoint lp = new LatLonPoint(ld.getLatitude(), ld.getLongitude());
|
||||
PoiSearch poiSearch = new PoiSearch(this, query);
|
||||
poiSearch.setOnPoiSearchListener(this);
|
||||
poiSearch.setBound(new PoiSearch.SearchBound(lp, 5000, true));//
|
||||
// 设置搜索区域为以lp点为圆心,其周围5000米范围
|
||||
poiSearch.searchPOIAsyn();// 异步搜索
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
new BusinessRequest().GetBusinessList(con,hd,ld.getLongitude()+"",ld.getLatitude()+"",type);
|
||||
break;
|
||||
case 2:
|
||||
BusinessBean.DataDTO bds=gson.fromJson((String) m.obj,BusinessBean.DataDTO.class);
|
||||
@@ -104,7 +78,7 @@ public class BusinessActivity extends BaseActivity implements PoiSearch.OnPoiSea
|
||||
initBusListDel();
|
||||
break;
|
||||
case 3:
|
||||
Log.e("aaa", (String) m.obj);
|
||||
LogUtil.e("aaa",(String) m.obj);
|
||||
BusinessBean.DataDTO bd=gson.fromJson((String) m.obj,BusinessBean.DataDTO.class);
|
||||
|
||||
if(bd!=null){
|
||||
@@ -112,7 +86,7 @@ public class BusinessActivity extends BaseActivity implements PoiSearch.OnPoiSea
|
||||
try {
|
||||
business_list.addItemV(bd);
|
||||
}catch (Exception e){
|
||||
Log.e("遇到了", bd.toString());
|
||||
LogUtil.e("遇到了",bd.toString());
|
||||
}
|
||||
//}
|
||||
}
|
||||
@@ -139,13 +113,9 @@ public class BusinessActivity extends BaseActivity implements PoiSearch.OnPoiSea
|
||||
customDialog.show();
|
||||
ld=new LocationGDUtil(con,hd);
|
||||
ld.onCreate();
|
||||
|
||||
changeType(type);
|
||||
|
||||
}
|
||||
|
||||
List<Object> list_type=new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void initView(Object obj) {
|
||||
super.initView(obj);
|
||||
@@ -163,56 +133,15 @@ public class BusinessActivity extends BaseActivity implements PoiSearch.OnPoiSea
|
||||
bbs=new ArrayList<>();
|
||||
customDialog=new CustomDialog(con, "正在切换...");
|
||||
customDialog.show();
|
||||
changeType(m.getType_name());
|
||||
// new BusinessRequest().GetBusinessList(con,hd,ld.getLongitude()+"",ld.getLatitude()+"",m.getType_name());
|
||||
new BusinessRequest().GetBusinessList(con,hd,ld.getLongitude()+"",ld.getLatitude()+"",m.getType_name());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPoiSearched(PoiResult poiResult, int i) {
|
||||
if (poiResult != null && poiResult.getQuery() != null) {// 搜索poi的结果
|
||||
poiItems = poiResult.getPois();// 当搜索不到poiitem数据时,会返回含有搜索关键字的城市信息
|
||||
if (poiItems != null && poiItems.size() > 0) {
|
||||
initBusListDel();
|
||||
} else {
|
||||
ToastUtils.showToast(con, "对不起,没有搜索到相关数据!");
|
||||
}
|
||||
} else {
|
||||
ToastUtils.showToast(con, "对不起,没有搜索到相关数据!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPoiItemSearched(PoiItem poiItem, int i) {
|
||||
System.out.println(poiItem);
|
||||
}
|
||||
|
||||
private void changeType(String type) {
|
||||
query = new PoiSearch.Query(type, "", "");
|
||||
query.setExtensions("all");
|
||||
query.setPageSize(20);// 设置每页最多返回多少条poiitem
|
||||
query.setPageNum(0);// 设置查第一页
|
||||
|
||||
if (ld.getLatitude() != 0) {
|
||||
try {
|
||||
|
||||
LatLonPoint lp = new LatLonPoint(ld.getLatitude(), ld.getLongitude());
|
||||
PoiSearch poiSearch = new PoiSearch(this, query);
|
||||
poiSearch.setOnPoiSearchListener(this);
|
||||
poiSearch.setBound(new PoiSearch.SearchBound(lp, 5000, true));//
|
||||
// 设置搜索区域为以lp点为圆心,其周围5000米范围
|
||||
poiSearch.searchPOIAsyn();// 异步搜索
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void forGetBusDel(){
|
||||
customDialog.dismiss();
|
||||
//business_list.remo
|
||||
Log.e("-数组-", gson.toJson(blb));
|
||||
LogUtil.e("-数组-",gson.toJson(blb));
|
||||
for (int i=0;i<blb.getData().getResults().size();i++) {
|
||||
//new BusinessRequest().GetBusiness(con,hd,blb.getData().getResults().get(i).getOpenshopid());
|
||||
String url="https://openapi.dianping.com/router/poiinfo/detailinfo";
|
||||
@@ -222,29 +151,15 @@ public class BusinessActivity extends BaseActivity implements PoiSearch.OnPoiSea
|
||||
|
||||
|
||||
public void initBusListDel(){
|
||||
customDialog.dismiss();
|
||||
//开始渲染
|
||||
business_list.createV(con, poiItems, R.layout.item_business_list).setOnItemViewListener((position, o, v) -> {
|
||||
PoiItem bd = (PoiItem) o;
|
||||
ImageView img = v.findViewById(R.id.photo_url);
|
||||
TextView name = v.findViewById(R.id.name);
|
||||
TextView address = v.findViewById(R.id.address);
|
||||
TextView taste = v.findViewById(R.id.taste);
|
||||
|
||||
if (bd.getPhotos().size() > 0 && !TextUtils.isEmpty(bd.getPhotos().get(0).getUrl())) {
|
||||
ImageLoader.getInstance().loadRoundImage(con, bd.getPhotos().get(0).getUrl(), 10, img);
|
||||
}
|
||||
|
||||
name.setText(bd.getTitle());
|
||||
address.setText(bd.getSnippet());
|
||||
taste.setText(bd.getTel());
|
||||
|
||||
// v.setOnClickListener(v1 -> {
|
||||
business_list.createV(con,bbs,R.layout.item_business_list).setOnItemViewListener((position, o, v) -> {
|
||||
BusinessBean.DataDTO bd= (BusinessBean.DataDTO) o;
|
||||
v.setOnClickListener(v1 -> {
|
||||
// Intent in=new Intent(con, WebActivity.class);
|
||||
// in.putExtra("url",bd.getBusiness_url());
|
||||
// in.putExtra("title",bd.getName());
|
||||
// startActivity(in);
|
||||
// });
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -266,16 +181,16 @@ public class BusinessActivity extends BaseActivity implements PoiSearch.OnPoiSea
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
if(response.code()==200){
|
||||
String body=response.body().string();
|
||||
Log.e("-body-", body);
|
||||
LogUtil.e("-body-",body);
|
||||
BusinessBean bb=gson.fromJson(body,BusinessBean.class);
|
||||
if(bb.getCode()==200){
|
||||
sum++;
|
||||
//bbs.add(bb.getData());
|
||||
if(sum==1){
|
||||
Log.e("--添加--", bbs.size() + "_" + blb.getData().getResults().size());
|
||||
LogUtil.e("--添加--",bbs.size()+"_"+blb.getData().getResults().size());
|
||||
MsgUtil.addHdMsgWatBody(hd,2,gson.toJson(bb.getData()));
|
||||
}else{
|
||||
Log.e("--添加--", bbs.size() + "_" + blb.getData().getResults().size());
|
||||
LogUtil.e("--添加--",bbs.size()+"_"+blb.getData().getResults().size());
|
||||
MsgUtil.addHdMsgWatBody(hd,3,gson.toJson(bb.getData()));
|
||||
}
|
||||
}
|
||||
@@ -287,6 +202,7 @@ public class BusinessActivity extends BaseActivity implements PoiSearch.OnPoiSea
|
||||
}
|
||||
|
||||
|
||||
|
||||
class Model{
|
||||
private String type_name;
|
||||
private int type_img;
|
||||
|
||||
@@ -19,8 +19,8 @@ import java.util.Set;
|
||||
* @description:
|
||||
*/
|
||||
public class Md5Util {
|
||||
static String app_key="1000055";
|
||||
static String appSecret="4e0d1be81540c4d1f0868d329b3229467f071f6c";
|
||||
static String app_key="3d4c1b5592f9ae09";
|
||||
static String appSecret="642cc46b385264595df7cce271250a1cb782b39c";
|
||||
static String[] strs={"app_key","deviceId","longitude","latitude","keyword","timestamp","format","v","sign_method","session","sign"};
|
||||
static String[] strsDel={"app_key","deviceId","openshopid","timestamp","format","v","sign_method","session","sign"};
|
||||
public static String resUrl(String longitude,String latitude,String keyword){
|
||||
@@ -35,7 +35,7 @@ public class Md5Util {
|
||||
requestParam.put("format", "json");
|
||||
requestParam.put("v", "1");
|
||||
requestParam.put("sign_method", "MD5");
|
||||
requestParam.put("session", "c1fc1773a27d47e988725bc6df150626dbda0b4d");
|
||||
requestParam.put("session", "cb2007c78d055247f7f242760173268caef1183a");
|
||||
requestParam.put("sign", generateSign(requestParam,appSecret,"MD5"));
|
||||
str+="?";
|
||||
for(int i=0;i<requestParam.size();i++){
|
||||
|
||||
@@ -7,7 +7,6 @@ import android.graphics.Outline;
|
||||
import android.location.Location;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -43,13 +42,12 @@ import com.arpa.hndahesudintocctmsdriver.constant.JTTConstant;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.StartOrderParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.news.NewActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.PicturlUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.google.gson.Gson;
|
||||
import com.gyf.cactus.Cactus;
|
||||
import com.hjq.xtoast.XToast;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.interfaces.OnConfirmListener;
|
||||
@@ -126,7 +124,6 @@ public class HomeFragment extends BaseFragment {
|
||||
private ImageConfig ic;
|
||||
private DriverExpireBean deb;
|
||||
|
||||
|
||||
@Override
|
||||
public void msgMethod(Message m) {
|
||||
super.msgMethod(m);
|
||||
@@ -144,22 +141,13 @@ public class HomeFragment extends BaseFragment {
|
||||
if (ub.getCode() == 200) {
|
||||
SPUtil.insSP(con, "data", "userdata", CacheGroup.cacheList.get("userdata"));
|
||||
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);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove("userdata");
|
||||
}
|
||||
if (CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER) != null) {
|
||||
Log.e("--sob--", CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER));
|
||||
LogUtil.e("--sob--", CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER));
|
||||
sob = gson.fromJson(CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER), StartOrderBean.class);
|
||||
if (sob.getCode() == 200) {
|
||||
SPUtil.insSP(con, JTTConstant.JTT_DATA_NAME, JTTConstant.JTT_DATA_ORDER_KEY, gson.toJson(sob));
|
||||
@@ -174,7 +162,7 @@ public class HomeFragment extends BaseFragment {
|
||||
CacheGroup.cacheList.remove(HuoYuanFragmengt.START_ORDER);
|
||||
}
|
||||
if (CacheGroup.cacheList.get("up_app") != null) {
|
||||
Log.e("up_app", CacheGroup.cacheList.get("up_app"));
|
||||
LogUtil.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) {
|
||||
@@ -188,7 +176,7 @@ public class HomeFragment extends BaseFragment {
|
||||
CacheGroup.cacheList.remove("up_app");
|
||||
}
|
||||
if (CacheGroup.cacheList.get("hl") != null) {
|
||||
Log.e("hl", CacheGroup.cacheList.get("hl"));
|
||||
LogUtil.e("hl", CacheGroup.cacheList.get("hl"));
|
||||
uab = new Gson().fromJson(CacheGroup.cacheList.get("hl"), HuoYuanListBean.class);
|
||||
if (uab.getCode() == 200) {
|
||||
initOrder();
|
||||
@@ -210,7 +198,7 @@ public class HomeFragment extends BaseFragment {
|
||||
CacheGroup.cacheList.remove(WoDeFragment.AUTH_DATA);
|
||||
}
|
||||
if (CacheGroup.cacheList.get("dealList") != null) {
|
||||
Log.e("历史货源", CacheGroup.cacheList.get("dealList"));
|
||||
LogUtil.e("历史货源", CacheGroup.cacheList.get("dealList"));
|
||||
hdb = gson.fromJson(CacheGroup.cacheList.get("dealList"), HuoYuanListDealBean.class);
|
||||
if (hdb.getCode() == 200) {
|
||||
insDeal();
|
||||
@@ -229,7 +217,7 @@ public class HomeFragment extends BaseFragment {
|
||||
CacheGroup.cacheList.remove("getImage");
|
||||
}
|
||||
if (CacheGroup.cacheList.get("driverExpire") != null) {
|
||||
Log.e("过期数据:", CacheGroup.cacheList.get("driverExpire"));
|
||||
LogUtil.e("过期数据:", CacheGroup.cacheList.get("driverExpire"));
|
||||
deb = gson.fromJson(CacheGroup.cacheList.get("driverExpire"), DriverExpireBean.class);
|
||||
if (deb.getCode() == 200) {
|
||||
Intent in = new Intent(con, WebActivity.class);
|
||||
@@ -241,9 +229,7 @@ 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())||
|
||||
!TextUtils.isEmpty(deb.getData().getInsuranceUpdateUrl())) {
|
||||
if (!"".equals(deb.getData().getDriverLicenseUpdateUrl()) || !"".equals(deb.getData().getIdCardUpdateUrl())) {
|
||||
new XToast<>(act)
|
||||
.setContentView(R.layout.view_bc)
|
||||
// 设置成可拖拽的
|
||||
@@ -252,7 +238,7 @@ public class HomeFragment extends BaseFragment {
|
||||
.setDuration(1000 * 60 * 60 * 12)
|
||||
.setOnClickListener(R.id.img_kf, (toast, view) -> {
|
||||
toast.startActivity(in);
|
||||
Log.e("-is-", view.isInTouchMode() + "");
|
||||
LogUtil.e("-is-", view.isInTouchMode() + "");
|
||||
})
|
||||
// 设置动画样式
|
||||
//.setAnimStyle(android.R.style.Animation_Translucent)
|
||||
@@ -359,7 +345,7 @@ public class HomeFragment extends BaseFragment {
|
||||
.setDuration(1000 * 60 * 60 * 12)
|
||||
.setOnClickListener(R.id.img_kf, (toast, view) -> {
|
||||
toast.startActivity(in);
|
||||
Log.e("-is-", view.isInTouchMode() + "");
|
||||
LogUtil.e("-is-", view.isInTouchMode() + "");
|
||||
})
|
||||
// 设置动画样式
|
||||
//.setAnimStyle(android.R.style.Animation_Translucent)
|
||||
@@ -377,7 +363,7 @@ public class HomeFragment extends BaseFragment {
|
||||
// } catch (UnknownHostException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// Log.e("-ip-",":"+str);
|
||||
// LogUtil.e("-ip-",":"+str);
|
||||
// }
|
||||
// }.start();
|
||||
return root;
|
||||
@@ -387,7 +373,7 @@ public class HomeFragment extends BaseFragment {
|
||||
public void initRefreshLoad() {
|
||||
refreshLayout = root.findViewById(R.id.srl);
|
||||
refreshLayout.setOnRefreshListener(refreshLayout -> {
|
||||
Log.e("下拉刷新", "pps");
|
||||
LogUtil.e("下拉刷新", "pps");
|
||||
keys = true;
|
||||
getRequest();
|
||||
});
|
||||
@@ -398,7 +384,6 @@ public class HomeFragment extends BaseFragment {
|
||||
@Override
|
||||
public void initView(Object obj) {
|
||||
super.initView(obj);
|
||||
Cactus.getInstance().updateNotification(getActivity());
|
||||
List<ManyBean> list = new ArrayList<>();
|
||||
list.add(new ManyBean(new Model(), R.layout.item_home));
|
||||
as = brv.creates(con, list);
|
||||
@@ -483,7 +468,7 @@ public class HomeFragment extends BaseFragment {
|
||||
case 0:
|
||||
//startActivity(new Intent(con, OrderListActivity.class));
|
||||
PermissionX.init(getActivity())
|
||||
.permissions(Manifest.permission.ACCESS_FINE_LOCATION)
|
||||
.permissions(Manifest.permission.ACCESS_BACKGROUND_LOCATION)
|
||||
.request((allGranted, grantedList, deniedList) -> {
|
||||
if (allGranted) {
|
||||
Intent in = new Intent(con, BusinessActivity.class);
|
||||
@@ -545,8 +530,6 @@ public class HomeFragment extends BaseFragment {
|
||||
ur.upApp();
|
||||
hyr.getHuoYuan(1, 100);
|
||||
ur.getImage(1);
|
||||
|
||||
|
||||
if (UiAuxiliary.isLogin(con)) {
|
||||
ur.User();
|
||||
ur.getDriverExpire();
|
||||
@@ -606,7 +589,7 @@ public class HomeFragment extends BaseFragment {
|
||||
if (sob != null && sob.getData() != null && 0 < sob.getData().getWayChildren().size()) {
|
||||
//order_start.setVisibility(View.VISIBLE);
|
||||
SPUtil.insSP(con, "order", "ShippingNoteNumber", sob.getData().getShippingNoteNumber());
|
||||
Log.e("开始轨迹上传服务", "-----");
|
||||
LogUtil.e("开始轨迹上传服务", "-----");
|
||||
orderNum.setText("运单号:" + sob.getData().getShippingNoteNumber());
|
||||
order_state.setText("" + sob.getData().getWaybillStatus());
|
||||
Intent serviceIn = new Intent(con, TrackService.class);
|
||||
@@ -801,16 +784,14 @@ public class HomeFragment extends BaseFragment {
|
||||
private class MyLoader extends ImageLoader {
|
||||
@Override
|
||||
public void displayImage(Context context, Object path, ImageView imageView) {
|
||||
if (HomeFragment.this != null && getActivity() != null && !getActivity().isDestroyed()) {
|
||||
Glide.with(con).load(path).into(imageView);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void addMap(double latitude, double longitude, String title, String price, int id) {
|
||||
if (aMap != null) {
|
||||
Log.e("longitude", longitude + "");
|
||||
Log.e("latitude", latitude + "");
|
||||
LogUtil.e("longitude", longitude + "");
|
||||
LogUtil.e("latitude", latitude + "");
|
||||
MarkerOptions markerOption = new MarkerOptions();
|
||||
markerOption.position(new LatLng(latitude, longitude));
|
||||
View infoWindow = LayoutInflater.from(con).inflate(
|
||||
@@ -871,7 +852,7 @@ public class HomeFragment extends BaseFragment {
|
||||
}
|
||||
return false;
|
||||
});
|
||||
//Log.e("--长度--",aMap.getMapScreenMarkers().size()+"个");
|
||||
//LogUtil.e("--长度--",aMap.getMapScreenMarkers().size()+"个");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -902,7 +883,6 @@ public class HomeFragment extends BaseFragment {
|
||||
public void initAlct() {
|
||||
PermissionX.init(getActivity())
|
||||
.permissions(Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.RECORD_AUDIO)
|
||||
.request((allGranted, grantedList, deniedList) -> {
|
||||
if (allGranted) {
|
||||
@@ -915,12 +895,12 @@ public class HomeFragment extends BaseFragment {
|
||||
MDPLocationCollectionManager.getInvoices(con, 10, 1, new OnDownloadResultListener() {
|
||||
@Override
|
||||
public void onSuccess(Object o) {
|
||||
Log.e("--成功信息--", new Gson().toJson(o));
|
||||
LogUtil.e("--成功信息--", new Gson().toJson(o));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("--失败信息--", s + s1);
|
||||
LogUtil.e("--失败信息--", s + s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -977,8 +957,8 @@ public class HomeFragment extends BaseFragment {
|
||||
double lat = location.getLatitude();
|
||||
//纬度
|
||||
double lng = location.getLongitude();
|
||||
Log.e("定位信息1", location.getLatitude() + "");
|
||||
Log.e("定位信息2", location.getLongitude() + "");
|
||||
LogUtil.e("定位信息1", location.getLatitude() + "");
|
||||
LogUtil.e("定位信息2", location.getLongitude() + "");
|
||||
//实现第一次定位成功,将地图中心移动到定位点
|
||||
CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(new
|
||||
LatLng(lat, lng), 11);
|
||||
@@ -986,7 +966,7 @@ public class HomeFragment extends BaseFragment {
|
||||
} else {
|
||||
//错误信息
|
||||
String error = bundle.get("errorInfo").toString();
|
||||
Log.e("Map", error);
|
||||
LogUtil.e("Map", error);
|
||||
Toast.makeText(con, "地图定位失败" + error, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
@@ -994,7 +974,7 @@ public class HomeFragment extends BaseFragment {
|
||||
|
||||
@Subscribe
|
||||
public void processResult(HomeEvent home) {
|
||||
Log.e("-res-", home.getMessage());
|
||||
LogUtil.e("-res-", home.getMessage());
|
||||
initView(null);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import com.alct.mdp.MDPLocationCollectionManager;
|
||||
import com.alct.mdp.callback.OnDownloadResultListener;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.google.gson.Gson;
|
||||
import com.haozhang.lib.SlantedTextView;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
@@ -86,7 +87,7 @@ public class HuoYuanFragmengt extends BaseFragment {
|
||||
case RequsetCodeConstants.SUCCESS:
|
||||
if (!UiAuxiliary.isLogin(con)){
|
||||
if (CacheGroup.cacheList.get("hl")!=null && CacheGroup.cacheList.get("up_app")!=null){
|
||||
Log.e("未登录货源1",CacheGroup.cacheList.get("hl"));
|
||||
LogUtil.e("未登录货源1",CacheGroup.cacheList.get("hl"));
|
||||
hb=gson.fromJson(CacheGroup.cacheList.get("hl"),HuoYuanListBean.class);
|
||||
if(hb.getCode()==200){
|
||||
initView(null);
|
||||
@@ -110,9 +111,9 @@ public class HuoYuanFragmengt extends BaseFragment {
|
||||
}else{
|
||||
if (CacheGroup.cacheList.get("hl")!=null && CacheGroup.cacheList.get(START_ORDER)!=null
|
||||
&& CacheGroup.cacheList.get("userdata")!=null && CacheGroup.cacheList.get("up_app")!=null){
|
||||
Log.e("货源",CacheGroup.cacheList.get("hl"));
|
||||
Log.e("user",CacheGroup.cacheList.get("userdata"));
|
||||
Log.e("up_app",CacheGroup.cacheList.get("up_app"));
|
||||
LogUtil.e("货源",CacheGroup.cacheList.get("hl"));
|
||||
LogUtil.e("user",CacheGroup.cacheList.get("userdata"));
|
||||
LogUtil.e("up_app",CacheGroup.cacheList.get("up_app"));
|
||||
hb=gson.fromJson(CacheGroup.cacheList.get("hl"),HuoYuanListBean.class);
|
||||
sob=gson.fromJson(CacheGroup.cacheList.get(START_ORDER),StartOrderBean.class);
|
||||
user=gson.fromJson(CacheGroup.cacheList.get("userdata"),UserBean.class);
|
||||
@@ -137,7 +138,7 @@ public class HuoYuanFragmengt extends BaseFragment {
|
||||
delCac();
|
||||
}
|
||||
if(CacheGroup.cacheList.get(WoDeFragment.AUTH_DATA)!=null){
|
||||
Log.e("--认证信息--",CacheGroup.cacheList.get(WoDeFragment.AUTH_DATA));
|
||||
LogUtil.e("--认证信息--",CacheGroup.cacheList.get(WoDeFragment.AUTH_DATA));
|
||||
DriverAuthDataBean dad=gson.fromJson(CacheGroup.cacheList.get(WoDeFragment.AUTH_DATA),DriverAuthDataBean.class);
|
||||
if (dad.getCode()==200) {
|
||||
SPUtil.insSP(con,"data","authdata",CacheGroup.cacheList.get(WoDeFragment.AUTH_DATA));
|
||||
@@ -207,7 +208,7 @@ public class HuoYuanFragmengt extends BaseFragment {
|
||||
public void initRefreshLoad(){
|
||||
refreshLayout=root.findViewById(R.id.srl);
|
||||
refreshLayout.setOnRefreshListener(refreshLayout -> {
|
||||
Log.e("下拉刷新","pps");
|
||||
LogUtil.e("下拉刷新","pps");
|
||||
delCac();
|
||||
hd.sendEmptyMessageDelayed(10, 10000);
|
||||
hyr.getHuoYuan(1,100);
|
||||
@@ -230,7 +231,7 @@ public class HuoYuanFragmengt extends BaseFragment {
|
||||
list.add(new ManyBean(new model(),R.layout.renzheng));
|
||||
if(sob!=null && sob.getData()!=null && sob.getData().getWayChildren().size()>0){
|
||||
SPUtil.insSP(con,"order","ShippingNoteNumber",sob.getData().getShippingNoteNumber());
|
||||
Log.e("开始轨迹上传服务","-----");
|
||||
LogUtil.e("开始轨迹上传服务","-----");
|
||||
Intent serviceIn=new Intent(con,TrackService.class);
|
||||
getActivity().startService(serviceIn);
|
||||
list.add(new ManyBean(sob.getData(),R.layout.huoyuan_yundan));
|
||||
@@ -263,11 +264,11 @@ public class HuoYuanFragmengt extends BaseFragment {
|
||||
MDPLocationCollectionManager.getInvoices(con, 10, 1, new OnDownloadResultListener() {
|
||||
@Override
|
||||
public void onSuccess(Object o) {
|
||||
Log.e("--成功信息--",new Gson().toJson(o));
|
||||
LogUtil.e("--成功信息--",new Gson().toJson(o));
|
||||
}
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("--失败信息--",s+s1);
|
||||
LogUtil.e("--失败信息--",s+s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -281,7 +282,7 @@ public class HuoYuanFragmengt extends BaseFragment {
|
||||
user_state=1;
|
||||
}
|
||||
}
|
||||
Log.e("--登录状态--",UiAuxiliary.isLogin(con)+"");
|
||||
LogUtil.e("--登录状态--",UiAuxiliary.isLogin(con)+"");
|
||||
TextView rz=v.findViewById(R.id.rz);
|
||||
TextView state_body=v.findViewById(R.id.state_body);
|
||||
state_body.setText(states_body[user_state]);
|
||||
@@ -297,7 +298,7 @@ public class HuoYuanFragmengt extends BaseFragment {
|
||||
startActivity(in2);
|
||||
break;
|
||||
case 2:
|
||||
Log.e("路径",PushConstant.ORDER_ALL);
|
||||
LogUtil.e("路径",PushConstant.ORDER_ALL);
|
||||
//ARouter.getInstance().build(PushConstant.ORDER_ALL).navigation();
|
||||
Intent in3=new Intent(con, OrderAllActivity.class);
|
||||
startActivity(in3);
|
||||
@@ -345,12 +346,12 @@ public class HuoYuanFragmengt extends BaseFragment {
|
||||
Button qiang=v1.findViewById(R.id.qiang);
|
||||
TextView type_timer=v1.findViewById(R.id.type_timer);
|
||||
qiang.setOnClickListener(v22 -> {
|
||||
Log.e("user",new Gson().toJson(user));
|
||||
LogUtil.e("user",new Gson().toJson(user));
|
||||
if(UiAuxiliary.isLogin(con) && user!=null){
|
||||
if(user.getData().getAuditStatus()==100003){
|
||||
Intent in=new Intent(con,HuoYunDelActivity.class);
|
||||
in.putExtra("id",hdr.getOrderId());
|
||||
Log.e("---id---",hdr.getOrderId()+"");
|
||||
LogUtil.e("---id---",hdr.getOrderId()+"");
|
||||
startActivity(in);
|
||||
}else{
|
||||
new XPopup.Builder(act)
|
||||
@@ -393,12 +394,12 @@ public class HuoYuanFragmengt extends BaseFragment {
|
||||
qiang.setText("抢单");
|
||||
}
|
||||
v1.setOnClickListener(v2 -> {
|
||||
Log.e("user",new Gson().toJson(user));
|
||||
LogUtil.e("user",new Gson().toJson(user));
|
||||
if(UiAuxiliary.isLogin(con) && user!=null){
|
||||
if(user.getData().getAuditStatus()==100003){
|
||||
Intent in=new Intent(con,HuoYunDelActivity.class);
|
||||
in.putExtra("id",hdr.getOrderId());
|
||||
Log.e("---id---",hdr.getOrderId()+"");
|
||||
LogUtil.e("---id---",hdr.getOrderId()+"");
|
||||
startActivity(in);
|
||||
}else{
|
||||
Toast.makeText(con,"请认证之后再接单",Toast.LENGTH_SHORT).show();
|
||||
|
||||
+21
-99
@@ -1,14 +1,12 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.home;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.text.Html;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageButton;
|
||||
@@ -20,27 +18,21 @@ import androidx.annotation.Nullable;
|
||||
|
||||
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.event.FaceEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||
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.auth.PersonalAuthActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.img.ImageGetUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
import com.dahe.mylibrary.utils.ActivityUtils;
|
||||
import com.esign.esignsdk.EsignSdk;
|
||||
import com.esign.esignsdk.data.AuthEvent;
|
||||
import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.core.BasePopupView;
|
||||
import com.lxj.xpopup.interfaces.OnCancelListener;
|
||||
import com.lxj.xpopup.interfaces.OnConfirmListener;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
||||
@@ -97,24 +89,12 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
CacheGroup.cacheList.remove(WoDeFragment.VEHICLE_LIST);
|
||||
}
|
||||
if (CacheGroup.cacheList.get(END) != null) {
|
||||
Log.e("--end--", CacheGroup.cacheList.get(END));
|
||||
LogUtil.e("--end--", CacheGroup.cacheList.get(END));
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(END), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
//Toast.makeText(con,"接单成功",Toast.LENGTH_SHORT).show();
|
||||
customDialog.dismiss();
|
||||
// EsignSdk.getInstance().startH5Activity(act, (String) bb.getData());
|
||||
if (null==bb.getData()){
|
||||
UiAuxiliary.homeRequest("接单");
|
||||
Intent in = new Intent(con, StartYunDanActivity.class);
|
||||
in.putExtra("id", "0");
|
||||
startActivity(in);
|
||||
finish();
|
||||
}else{
|
||||
Intent intent = new Intent(this, H5Activity.class);
|
||||
intent.putExtra("url", (String) bb.getData());
|
||||
intent.putExtra("view_file", false);
|
||||
startActivity(intent);
|
||||
}
|
||||
EsignSdk.getInstance().startH5Activity(act, (String) bb.getData());
|
||||
//finish();
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
@@ -137,25 +117,10 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
break;
|
||||
case 13:
|
||||
int index = Integer.valueOf((String) m.obj);
|
||||
Log.e("--选择车辆--", clb.getData().get(index).getCarNumber());
|
||||
LogUtil.e("--选择车辆--", clb.getData().get(index).getCarNumber());
|
||||
car.setText("选择车辆:" + clb.getData().get(index).getCarNumber());
|
||||
cid = clb.getData().get(index).getCarId();
|
||||
break;
|
||||
case 1111://安联用户验证通过,接单
|
||||
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();
|
||||
new MessageUtils().showCenMessage(con, (String) m.obj);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,7 +237,20 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
if (cid != null) {
|
||||
// if (fpKey){
|
||||
if (key) {
|
||||
reOrder();
|
||||
new XPopup.Builder(con)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||
.asConfirm("请确认接单", "是否确定承运此运单?",
|
||||
"取消", "确认",
|
||||
new OnConfirmListener() {
|
||||
@Override
|
||||
public void onConfirm() {
|
||||
LogUtil.e("--id--", "cid:" + cid + "---wid:" + id);
|
||||
customDialog = new CustomDialog(con, "正在接单...");
|
||||
customDialog.show();
|
||||
hyr.confirm(cid, id);
|
||||
}
|
||||
}, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局
|
||||
.show();
|
||||
} else {
|
||||
Toast.makeText(con, "请先同意并签署运输合同", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@@ -306,7 +284,7 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
HuoYuanDelBean.DataDTO.SendInfoDTO hdsg = (HuoYuanDelBean.DataDTO.SendInfoDTO) o1;
|
||||
type.setImageResource(R.mipmap.zhuang);
|
||||
String goodsData = "";
|
||||
Log.e("--goodsData--", goodsData);
|
||||
LogUtil.e("--goodsData--", goodsData);
|
||||
for (int i = 0; i < hdsg.getGoods().size(); i++) {
|
||||
if (i != 0) {
|
||||
goodsData += "\n" + hdsg.getGoods().get(i).getGoodName() + "|" + hdsg.getGoods().get(i).getGoodNum() + hdsg.getGoods().get(i).getGoodUnit() + "|货物价值(元):" + hdsg.getGoods().get(i).getGoodPrice();
|
||||
@@ -324,7 +302,7 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
HuoYuanDelBean.DataDTO.PutInfoDTO hdsg = (HuoYuanDelBean.DataDTO.PutInfoDTO) o1;
|
||||
type.setImageResource(R.mipmap.xie);
|
||||
String goodsData = "";
|
||||
Log.e("--goodsData--", goodsData);
|
||||
LogUtil.e("--goodsData--", goodsData);
|
||||
for (int i = 0; i < hdsg.getGoods().size(); i++) {
|
||||
if (i != 0) {
|
||||
goodsData += "\n" + hdsg.getGoods().get(i).getGoodName() + "|" + hdsg.getGoods().get(i).getGoodNum() + hdsg.getGoods().get(i).getGoodUnit() + "|货物价值(元):" + hdsg.getGoods().get(i).getGoodPrice();
|
||||
@@ -339,55 +317,10 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
});
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void faceResult(FaceEvent home) {
|
||||
Log.e("-res-", home.getMessage());
|
||||
|
||||
UiAuxiliary.homeRequest("接单");
|
||||
Intent in = new Intent(con, StartYunDanActivity.class);
|
||||
in.putExtra("id", "0");
|
||||
startActivity(in);
|
||||
finish();
|
||||
|
||||
// new Handler().postDelayed(() -> {
|
||||
// UiAuxiliary.homeRequest("接单");
|
||||
// Intent in = new Intent(con, StartYunDanActivity.class);
|
||||
// in.putExtra("id", "0");
|
||||
// startActivity(in);
|
||||
// finish();
|
||||
// }, 2500);
|
||||
|
||||
|
||||
|
||||
// new Handler().postDelayed(() -> {
|
||||
//
|
||||
//
|
||||
// UiAuxiliary.homeRequest("接单");
|
||||
//// //ur.getJtt(hyd.getData().getId());
|
||||
//
|
||||
// Intent in = new Intent(con, StartYunDanActivity.class);
|
||||
// in.putExtra("id", "0");
|
||||
// startActivity(in);
|
||||
//
|
||||
// ActivityUtils.finishActivity(H5Activity.class);
|
||||
// finish();
|
||||
//
|
||||
//
|
||||
// }, 1500);
|
||||
|
||||
// UiAuxiliary.homeRequest("接单");
|
||||
|
||||
// Intent in = new Intent(con, StartYunDanActivity.class);
|
||||
// in.putExtra("id", "0");
|
||||
// startActivity(in);
|
||||
// finish();
|
||||
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void processResult(AuthEvent auth) {
|
||||
//添加实名/意愿/签署完成之后的逻辑
|
||||
Log.e("-回调信息-", auth.result);
|
||||
LogUtil.e("-回调信息-", auth.result);
|
||||
JSONObject jsonObject = JSON.parseObject(auth.result);
|
||||
if ("success".equalsIgnoreCase(jsonObject.getString("res"))) {
|
||||
if ("sign".equalsIgnoreCase(jsonObject.getString("key"))) {
|
||||
@@ -418,15 +351,4 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 接单
|
||||
* 先判断安联用户信息验证,随后接单
|
||||
*/
|
||||
private void reOrder() {
|
||||
customDialog = new CustomDialog(con, "正在接单...");
|
||||
customDialog.show();
|
||||
//验证安联用户是否通过
|
||||
ALProcess.verification(con, hd);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.google.gson.Gson;
|
||||
import com.haozhang.lib.SlantedTextView;
|
||||
import com.lxj.xpopup.core.BasePopupView;
|
||||
@@ -47,7 +48,7 @@ public class OrderAllActivity extends BaseActivity {
|
||||
switch (m.what){
|
||||
case RequsetCodeConstants.SUCCESS:
|
||||
if (CacheGroup.cacheList.get(USER_ORDER_LIST)!=null && index==1) {
|
||||
Log.e("结果2",CacheGroup.cacheList.get(USER_ORDER_LIST));
|
||||
LogUtil.e("结果2",CacheGroup.cacheList.get(USER_ORDER_LIST));
|
||||
olb=gson.fromJson(CacheGroup.cacheList.get(USER_ORDER_LIST),OrderListBean.class);
|
||||
if(olb.getCode()==200){
|
||||
initView(null);
|
||||
@@ -81,7 +82,7 @@ public class OrderAllActivity extends BaseActivity {
|
||||
}else{
|
||||
Toast.makeText(con,"抢单",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
// xp.dismiss();
|
||||
xp.dismiss();
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
@@ -91,14 +92,14 @@ public class OrderAllActivity extends BaseActivity {
|
||||
public void initRefreshLoad() {
|
||||
refreshLayout =findViewById(R.id.srl);
|
||||
refreshLayout.setOnRefreshListener(refreshLayout -> {
|
||||
Log.e("下拉刷新", "pps");
|
||||
LogUtil.e("下拉刷新", "pps");
|
||||
index=1;
|
||||
dataKey=true;
|
||||
timer="";
|
||||
ur.getListV2(index,10);
|
||||
});
|
||||
refreshLayout.setOnLoadMoreListener(refreshLayout -> {
|
||||
Log.e("上拉加载", "次数"+index);
|
||||
LogUtil.e("上拉加载", "次数"+index);
|
||||
if(dataKey){
|
||||
index++;
|
||||
ur.getListV2(index,10);
|
||||
@@ -167,7 +168,7 @@ public class OrderAllActivity extends BaseActivity {
|
||||
v.setTop(getResources().getDimensionPixelOffset(R.dimen.dp_10));
|
||||
OrderListBean.DataDTO.ListDTO idl= (OrderListBean.DataDTO.ListDTO) o;
|
||||
v.setOnClickListener(v1 -> {
|
||||
Log.e("id",idl.getOrderId()+"");
|
||||
LogUtil.e("id",idl.getOrderId()+"");
|
||||
Intent in=new Intent(con,StartYunDanActivity.class);
|
||||
in.putExtra("id",idl.getOrderId());
|
||||
startActivity(in);
|
||||
@@ -205,7 +206,7 @@ public class OrderAllActivity extends BaseActivity {
|
||||
state4.setText(" 已评价");
|
||||
}
|
||||
SlantedTextView states=v.findViewById(R.id.states);
|
||||
Log.e("类型",":"+ld.getDispatchType());
|
||||
LogUtil.e("类型",":"+ld.getDispatchType());
|
||||
if(ld.getDispatchType()==1){
|
||||
states.setText("派单");
|
||||
} else if(ld.getDispatchType()==2) {
|
||||
|
||||
@@ -11,6 +11,7 @@ import android.widget.Toast;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.interfaces.OnConfirmListener;
|
||||
@@ -54,13 +55,13 @@ public class OrderListActivity extends BaseActivity {
|
||||
public void initRefreshLoad() {
|
||||
refreshLayout =findViewById(R.id.srl);
|
||||
refreshLayout.setOnRefreshListener(refreshLayout -> {
|
||||
Log.e("下拉刷新", "pps");
|
||||
LogUtil.e("下拉刷新", "pps");
|
||||
index=1;
|
||||
dataKey=true;
|
||||
hyr.getHuoYuan(index,10);
|
||||
});
|
||||
refreshLayout.setOnLoadMoreListener(refreshLayout -> {
|
||||
Log.e("上拉加载", "次数"+index);
|
||||
LogUtil.e("上拉加载", "次数"+index);
|
||||
if(dataKey){
|
||||
index++;
|
||||
hyr.getHuoYuan(index,10);
|
||||
@@ -81,7 +82,7 @@ public class OrderListActivity extends BaseActivity {
|
||||
refreshLayout.finishRefresh();
|
||||
refreshLayout.finishLoadMore();
|
||||
if(CacheGroup.cacheList.get("hl")!=null){
|
||||
Log.e("货源",CacheGroup.cacheList.get("hl"));
|
||||
LogUtil.e("货源",CacheGroup.cacheList.get("hl"));
|
||||
hb=gson.fromJson(CacheGroup.cacheList.get("hl"),HuoYuanListBean.class);
|
||||
if(hb.getCode()==200){
|
||||
if(index==1){
|
||||
@@ -95,7 +96,7 @@ public class OrderListActivity extends BaseActivity {
|
||||
CacheGroup.cacheList.remove("hl");
|
||||
}
|
||||
if(CacheGroup.cacheList.get("dealList")!=null){
|
||||
Log.e("历史货源",CacheGroup.cacheList.get("dealList"));
|
||||
LogUtil.e("历史货源",CacheGroup.cacheList.get("dealList"));
|
||||
hdb=gson.fromJson(CacheGroup.cacheList.get("dealList"),HuoYuanListDealBean.class);
|
||||
if(hdb.getCode()==200){
|
||||
insDeal();
|
||||
|
||||
+222
-402
@@ -17,17 +17,31 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
|
||||
|
||||
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.amap.api.maps.AMap;
|
||||
import com.amap.api.maps.CameraUpdateFactory;
|
||||
import com.amap.api.maps.LocationSource;
|
||||
import com.amap.api.maps.MapView;
|
||||
import com.amap.api.maps.model.BitmapDescriptorFactory;
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.amap.api.maps.model.LatLngBounds;
|
||||
import com.amap.api.maps.model.MarkerOptions;
|
||||
import com.amap.api.maps.model.PolylineOptions;
|
||||
|
||||
import com.amap.api.services.core.AMapException;
|
||||
import com.amap.api.services.core.LatLonPoint;
|
||||
import com.amap.api.services.route.BusRouteResult;
|
||||
import com.amap.api.services.route.DrivePath;
|
||||
import com.amap.api.services.route.DriveRouteResult;
|
||||
import com.amap.api.services.route.DriveStep;
|
||||
import com.amap.api.services.route.RideRouteResult;
|
||||
import com.amap.api.services.route.RouteSearch;
|
||||
import com.amap.api.services.route.WalkRouteResult;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.dahe.mylibrary.utils.TimeUtil;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||
import com.google.gson.Gson;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
@@ -51,27 +65,6 @@ import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.ScoreView;
|
||||
import com.lk.mapsdk.base.mapapi.initializer.InitializerOptions;
|
||||
import com.lk.mapsdk.base.mapapi.initializer.SDKInitializer;
|
||||
import com.lk.mapsdk.base.mapapi.model.CoordType;
|
||||
import com.lk.mapsdk.base.mapapi.model.LatLng;
|
||||
import com.lk.mapsdk.base.mapapi.model.LatLngBounds;
|
||||
import com.lk.mapsdk.map.mapapi.annotation.Marker;
|
||||
import com.lk.mapsdk.map.mapapi.annotation.Polyline;
|
||||
import com.lk.mapsdk.map.mapapi.annotation.options.MarkerOptions;
|
||||
import com.lk.mapsdk.map.mapapi.annotation.options.PolylineOptions;
|
||||
import com.lk.mapsdk.map.mapapi.annotation.util.BitmapDescriptorFactory;
|
||||
import com.lk.mapsdk.map.mapapi.camera.MapStatusUpdateFactory;
|
||||
import com.lk.mapsdk.map.mapapi.map.LKMap;
|
||||
import com.lk.mapsdk.map.mapapi.map.MapView;
|
||||
import com.lk.mapsdk.map.platform.style.layers.Property;
|
||||
import com.lk.mapsdk.route.mapapi.base.AutoInfo;
|
||||
import com.lk.mapsdk.route.mapapi.base.DrivingCostingOptionsInfo;
|
||||
import com.lk.mapsdk.route.mapapi.base.LocationsInfo;
|
||||
import com.lk.mapsdk.route.mapapi.driving.DrivingRoutePlan;
|
||||
import com.lk.mapsdk.route.mapapi.driving.DrivingRoutePlanOptions;
|
||||
import com.lk.mapsdk.route.mapapi.driving.DrivingRoutePlanResult;
|
||||
import com.lk.mapsdk.route.mapapi.driving.OnDrivingRoutePlanListener;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -87,7 +80,7 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
|
||||
private String TAG="StartYunDanActivity";
|
||||
private NestedScrollView bottomSheet;
|
||||
private MapView mapView;
|
||||
private MapView map;
|
||||
private BaseRecyclerView brv;
|
||||
private AlphaAnimation mShowAnim, mHiddenAmin;//控件的显示和隐藏动画
|
||||
private LinearLayout protect;
|
||||
@@ -110,8 +103,8 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
case RequsetCodeConstants.SUCCESS:
|
||||
//获取页面数据
|
||||
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(HuoYuanFragmengt.START_ORDER));
|
||||
LogUtil.e("-评论-",CacheGroup.cacheList.get(GET_EVALUTE));
|
||||
LogUtil.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(sob.getCode()==200 && sob.getData()!=null){
|
||||
@@ -143,12 +136,12 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
break;
|
||||
case 15:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
}
|
||||
|
||||
private UserBean ub;
|
||||
private AMap aMap;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
@@ -156,10 +149,6 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
StateStyleUtil.stateTextColor(this);
|
||||
setContentView(R.layout.activity_yundan_start);
|
||||
con=this;
|
||||
mapView = findViewById(R.id.map);
|
||||
mapView.onCreate(savedInstanceState);
|
||||
mLKMap = mapView.getMap();
|
||||
initMap();
|
||||
id=getIntent().getExtras().getInt("id");
|
||||
brv=findViewById(R.id.brv);
|
||||
protect=findViewById(R.id.protect);
|
||||
@@ -169,11 +158,13 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
mBottomSheetBehavior.setHideable(false);
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||
//mBottomSheetBehavior.set
|
||||
|
||||
|
||||
// initLoaction();
|
||||
|
||||
Log.e("--id--", "" + id);
|
||||
map=findViewById(R.id.map);
|
||||
map.onCreate(savedInstanceState);
|
||||
if (aMap == null) {
|
||||
aMap = map.getMap();
|
||||
initLoaction();
|
||||
}
|
||||
LogUtil.e("--id--",""+id);
|
||||
String userdata= SPUtil.getSP(con,"data","userdata");
|
||||
if(!userdata.equals("")){
|
||||
ub=gson.fromJson(userdata,UserBean.class);
|
||||
@@ -213,8 +204,7 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
Glide.with(con).load(ub.getData().getHeadportraitUrl()).into(head_img);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -247,7 +237,7 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
m_pl_value.setEnabled(false);
|
||||
}
|
||||
if(datum.getType()==1){
|
||||
Log.e("分数", datum.getAttitudeScore() + "_");
|
||||
LogUtil.e("分数",datum.getAttitudeScore()+"_");
|
||||
sv2.setScore(datum.getAttitudeScore());
|
||||
pl_value.setText(datum.getContent());
|
||||
}
|
||||
@@ -258,7 +248,7 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
String evaluate=m_pl_value.getText()+"";
|
||||
if(id!=0){
|
||||
if(evaluate.length()>=5){
|
||||
Log.e("星星", "" + sv1.getScore());
|
||||
LogUtil.e("星星",""+sv1.getScore());
|
||||
hyr.keepEvaluate(sv1.getScore(),m_pl_value.getText()+"",id);
|
||||
}else{
|
||||
Toast.makeText(con,"写够5个字才是好司机~",Toast.LENGTH_SHORT).show();
|
||||
@@ -292,7 +282,7 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
get_contract.setOnClickListener(v13 -> {
|
||||
Intent in=new Intent(con, WebPDFActivity.class);
|
||||
in.putExtra("title","电子合同");
|
||||
Log.e("--地址--", sob.getData().getContractUrl());
|
||||
LogUtil.e("--地址--",sob.getData().getContractUrl());
|
||||
in.putExtra("url",sob.getData().getContractUrl());
|
||||
startActivity(in);
|
||||
});
|
||||
@@ -321,8 +311,7 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
}
|
||||
initZX(upkey, v15, position, o, 1);
|
||||
});
|
||||
// search();
|
||||
doSearch();
|
||||
search();
|
||||
}
|
||||
|
||||
public void initZX(boolean key,View v,int position,Object o,int type){
|
||||
@@ -370,14 +359,14 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
}else{
|
||||
Toast.makeText(con,"您还没有装货",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else if (sdw.getStatus() == 1) {//装货回单
|
||||
}else if(sdw.getStatus()==1){
|
||||
Intent in=new Intent(con, ShangChuangImgActivity.class);
|
||||
in.putExtra("type",2);
|
||||
in.putExtra("wid",wid);
|
||||
in.putExtra("h_type",type);
|
||||
in.putExtra("sob",gson.toJson(sob));
|
||||
startActivity(in);
|
||||
} else if (sdw.getStatus() == 2) {//上传收货单(卸货回单)
|
||||
}else if(sdw.getStatus()==2){
|
||||
Intent in=new Intent(con, ShangChuangImgActivity.class);
|
||||
in.putExtra("type",2);
|
||||
in.putExtra("wid",wid);
|
||||
@@ -389,31 +378,13 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
Intent in=new Intent(con, GetShangChuanActivity.class);
|
||||
in.putExtra("sdwStr",gson.toJson(sdw));
|
||||
startActivity(in);
|
||||
} else {//卸货照片
|
||||
StartOrderBean.DataDTO.WayChildrenDTO zInfo;
|
||||
for (int i = 0; i < sob.getData().getWayChildren().size(); i++) {
|
||||
if (sob.getData().getWayChildren().get(i).getType() == 1) {
|
||||
zInfo = sob.getData().getWayChildren().get(i);
|
||||
if (zInfo.getReceiptUrl() != null && zInfo.getReceiptUrl().size() > 0) {
|
||||
int dis = TimeUtil.compareNowDate(TimeUtil.string2Millis(zInfo.getImageTakenDate(), TimeUtil.DEFAULT_FORMAT4));
|
||||
if (dis > 5) {//大于五分钟可以接单
|
||||
}else{
|
||||
Intent in=new Intent(con, ShangChuangImgActivity.class);
|
||||
in.putExtra("type",type);
|
||||
in.putExtra("wid",wid);
|
||||
in.putExtra("sob",gson.toJson(sob));
|
||||
in.putExtra("keys",key);
|
||||
startActivity(in);
|
||||
} else {
|
||||
ToastUtils.showToast(StartYunDanActivity.this, "请到卸货地再进行卸货操作!");
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
ToastUtils.showToast(StartYunDanActivity.this, "请先上传出货单,再进行卸货操作!");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -447,8 +418,7 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
//str="待卸货";
|
||||
str="确认卸货";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
@@ -456,8 +426,8 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
if (mapView != null) {
|
||||
mapView.onResume();
|
||||
if(map!=null){
|
||||
map.onResume();
|
||||
}
|
||||
hyr.startOrder(id);
|
||||
hyr.getEvaluate(id);
|
||||
@@ -466,352 +436,223 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
if (mapView != null) {
|
||||
mapView.onPause();
|
||||
if(map!=null){
|
||||
map.onPause();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mapView != null) {
|
||||
mapView.onDestroy();
|
||||
if(map!=null){
|
||||
map.onDestroy();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(@NonNull @NotNull Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
mapView.onSaveInstanceState(outState);
|
||||
map.onSaveInstanceState(outState);
|
||||
}
|
||||
|
||||
LocationSource.OnLocationChangedListener mListener;
|
||||
AMapLocationClient mlocationClient;
|
||||
AMapLocationClientOption mLocationOption;
|
||||
|
||||
// public void initLoaction() {
|
||||
// // 设置定位监听
|
||||
// aMap.setLocationSource(new LocationSource() {
|
||||
// @Override
|
||||
// public void activate(OnLocationChangedListener onLocationChangedListener) {
|
||||
// mListener = onLocationChangedListener;
|
||||
// if (mlocationClient == null) {
|
||||
// //初始化定位
|
||||
// try {
|
||||
// mlocationClient = new AMapLocationClient(con);
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// //初始化定位参数
|
||||
// mLocationOption = new AMapLocationClientOption();
|
||||
// //设置定位回调监听
|
||||
// mlocationClient.setLocationListener(new AMapLocationListener() {
|
||||
// @Override
|
||||
// public void onLocationChanged(AMapLocation aMapLocation) {
|
||||
// if (mListener != null && aMapLocation != null) {
|
||||
// if (aMapLocation != null
|
||||
// && aMapLocation.getErrorCode() == 0) {
|
||||
// mListener.onLocationChanged(aMapLocation);// 显示系统小蓝点
|
||||
// } else {
|
||||
// String errText = "定位失败," + aMapLocation.getErrorCode() + ": " + aMapLocation.getErrorInfo();
|
||||
// Log.e("AmapErr", errText);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// //设置为高精度定位模式
|
||||
// mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
|
||||
// // mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Battery_Saving);
|
||||
// //设置定位模式为AMapLocationMode.Device_Sensors,仅设备模式。
|
||||
// //mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Device_Sensors);
|
||||
// //获取一次定位结果:
|
||||
// //该方法默认为false。
|
||||
// mLocationOption.setOnceLocation(true);
|
||||
// //获取最近3s内精度最高的一次定位结果:
|
||||
// //设置setOnceLocationLatest(boolean b)接口为true,启动定位时SDK会返回最近3s内精度最高的一次定位结果。如果设置其为true,setOnceLocation(boolean b)接口也会被设置为true,反之不会,默认为false。
|
||||
// mLocationOption.setOnceLocationLatest(true);
|
||||
// //设置是否返回地址信息(默认返回地址信息)
|
||||
// mLocationOption.setNeedAddress(true);
|
||||
// //设置是否允许模拟位置,默认为true,允许模拟位置
|
||||
// mLocationOption.setMockEnable(true);
|
||||
// //单位是毫秒,默认30000毫秒,建议超时时间不要低于8000毫秒。
|
||||
// mLocationOption.setHttpTimeOut(20000);
|
||||
// //关闭缓存机制
|
||||
// mLocationOption.setLocationCacheEnable(false);
|
||||
// //设置定位参数
|
||||
// mlocationClient.setLocationOption(mLocationOption);
|
||||
// // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
|
||||
// // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
|
||||
// // 在定位结束后,在合适的生命周期调用onDestroy()方法
|
||||
// // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
|
||||
// mlocationClient.startLocation();//启动定位
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void deactivate() {
|
||||
// mListener = null;
|
||||
// if (mlocationClient != null) {
|
||||
// mlocationClient.stopLocation();
|
||||
// mlocationClient.onDestroy();
|
||||
// }
|
||||
// mlocationClient = null;
|
||||
// }
|
||||
// });
|
||||
// // 设置为true表示显示定位层并可触发定位,false表示隐藏定位层并不可触发定位,默认是false
|
||||
//// aMap.setMyLocationEnabled(true);
|
||||
//// ld=new LocationGDUtil(con,hd);
|
||||
//// ld.onCreate();
|
||||
// }
|
||||
|
||||
private void initMap(){
|
||||
// 通过InitializerOptions指定初始化配置参数
|
||||
InitializerOptions options = new InitializerOptions();
|
||||
// 设置是否使用Https网络请求,默认使用
|
||||
// options.setIsHttpsEnable(true);
|
||||
// 设置坐标系,默认GCJ02
|
||||
// options.setCoorType(CoordType.GCJ02);
|
||||
|
||||
SDKInitializer.initialization(getApplicationContext(),options);
|
||||
}
|
||||
|
||||
private DrivingRoutePlanOptions drivingRoutePlanOptions;
|
||||
private List<LocationsInfo> locationsInfos;
|
||||
|
||||
private List<Polyline> polylines = new ArrayList<>();
|
||||
private List<Marker> markers = new ArrayList<>();
|
||||
|
||||
private LKMap mLKMap;
|
||||
|
||||
private void doSearch() {
|
||||
DrivingRoutePlan search = new DrivingRoutePlan();
|
||||
|
||||
drivingRoutePlanOptions = new DrivingRoutePlanOptions();
|
||||
locationsInfos = new ArrayList<>();
|
||||
// 设置开始坐标
|
||||
LocationsInfo origin = new LocationsInfo();
|
||||
origin.setLat(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()));
|
||||
origin.setLon(Double.parseDouble(sob.getData().getWayChildren().get((0)).getLongitude()));
|
||||
// 设置结束坐标
|
||||
LocationsInfo dest = new LocationsInfo();
|
||||
dest.setLat(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLatitude()));
|
||||
dest.setLon(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLongitude()));
|
||||
locationsInfos.add(origin);
|
||||
locationsInfos.add(dest);
|
||||
drivingRoutePlanOptions.setLocations(locationsInfos);
|
||||
AutoInfo autoInfo = new AutoInfo();
|
||||
DrivingCostingOptionsInfo drivingCostingOptionsInfo = new DrivingCostingOptionsInfo();
|
||||
drivingCostingOptionsInfo.setAuto(autoInfo);
|
||||
drivingRoutePlanOptions.setDrivingCostingOptions(drivingCostingOptionsInfo);
|
||||
|
||||
search.drivingRoutePlanRequest(drivingRoutePlanOptions, new OnDrivingRoutePlanListener() {
|
||||
|
||||
public void initLoaction(){
|
||||
// 设置定位监听
|
||||
aMap.setLocationSource(new LocationSource() {
|
||||
@Override
|
||||
public void onGetDrivingRoutePlanResult(DrivingRoutePlanResult routePlanResult) {
|
||||
addRoutePlanLine(routePlanResult);
|
||||
addRouteMarker();
|
||||
public void activate(OnLocationChangedListener onLocationChangedListener) {
|
||||
mListener = onLocationChangedListener;
|
||||
if (mlocationClient == null) {
|
||||
//初始化定位
|
||||
try {
|
||||
mlocationClient = new AMapLocationClient(con);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
//初始化定位参数
|
||||
mLocationOption = new AMapLocationClientOption();
|
||||
//设置定位回调监听
|
||||
mlocationClient.setLocationListener(new AMapLocationListener() {
|
||||
@Override
|
||||
public void onLocationChanged(AMapLocation aMapLocation) {
|
||||
if (mListener != null&&aMapLocation != null) {
|
||||
if (aMapLocation != null
|
||||
&&aMapLocation.getErrorCode() == 0) {
|
||||
mListener.onLocationChanged(aMapLocation);// 显示系统小蓝点
|
||||
} else {
|
||||
String errText = "定位失败," + aMapLocation.getErrorCode()+ ": " + aMapLocation.getErrorInfo();
|
||||
LogUtil.e("AmapErr",errText);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
//设置为高精度定位模式
|
||||
mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
|
||||
// mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Battery_Saving);
|
||||
//设置定位模式为AMapLocationMode.Device_Sensors,仅设备模式。
|
||||
//mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Device_Sensors);
|
||||
//获取一次定位结果:
|
||||
//该方法默认为false。
|
||||
mLocationOption.setOnceLocation(true);
|
||||
//获取最近3s内精度最高的一次定位结果:
|
||||
//设置setOnceLocationLatest(boolean b)接口为true,启动定位时SDK会返回最近3s内精度最高的一次定位结果。如果设置其为true,setOnceLocation(boolean b)接口也会被设置为true,反之不会,默认为false。
|
||||
mLocationOption.setOnceLocationLatest(true);
|
||||
//设置是否返回地址信息(默认返回地址信息)
|
||||
mLocationOption.setNeedAddress(true);
|
||||
//设置是否允许模拟位置,默认为true,允许模拟位置
|
||||
mLocationOption.setMockEnable(true);
|
||||
//单位是毫秒,默认30000毫秒,建议超时时间不要低于8000毫秒。
|
||||
mLocationOption.setHttpTimeOut(20000);
|
||||
//关闭缓存机制
|
||||
mLocationOption.setLocationCacheEnable(false);
|
||||
//设置定位参数
|
||||
mlocationClient.setLocationOption(mLocationOption);
|
||||
// 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
|
||||
// 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
|
||||
// 在定位结束后,在合适的生命周期调用onDestroy()方法
|
||||
// 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
|
||||
mlocationClient.startLocation();//启动定位
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加线路规划路线
|
||||
*
|
||||
* @param routePlanResult
|
||||
*/
|
||||
private void addRoutePlanLine(DrivingRoutePlanResult routePlanResult) {
|
||||
if (routePlanResult == null) {
|
||||
Toast.makeText(this, "没有检索到结果", Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
@Override
|
||||
public void deactivate() {
|
||||
mListener = null;
|
||||
if (mlocationClient != null) {
|
||||
mlocationClient.stopLocation();
|
||||
mlocationClient.onDestroy();
|
||||
}
|
||||
mlocationClient = null;
|
||||
}
|
||||
});
|
||||
// 设置为true表示显示定位层并可触发定位,false表示隐藏定位层并不可触发定位,默认是false
|
||||
aMap.setMyLocationEnabled(true);
|
||||
// ld=new LocationGDUtil(con,hd);
|
||||
// ld.onCreate();
|
||||
}
|
||||
|
||||
if (routePlanResult.getRouteInfos() == null || routePlanResult.getRouteInfos().isEmpty()) {
|
||||
Toast.makeText(this, "没有检索到结果", Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
|
||||
private RouteSearch mRouteSearch;//路线查询器
|
||||
private List<LatLonPoint> lists=new ArrayList<>();
|
||||
|
||||
|
||||
public void search(){
|
||||
// try {
|
||||
// AMapLocationClient.updatePrivacyShow(con,true,true);
|
||||
// AMapLocationClient.updatePrivacyAgree(con,true);
|
||||
mRouteSearch = new RouteSearch(this);
|
||||
// } catch (AMapException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//设置数据回调监听器
|
||||
mRouteSearch.setRouteSearchListener(new OnRouteSearchListener());
|
||||
//设置开始位置坐标点(注意经纬度不能写反,会报错1800(只能规划到中国区域里的地图路线))
|
||||
LatLonPoint startPoint=new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
|
||||
Double.parseDouble(sob.getData().getWayChildren().get((0)).getLongitude()));
|
||||
//设置目的地坐标点
|
||||
LatLonPoint endPoint = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size()-1)).getLatitude()),
|
||||
Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size()-1)).getLongitude()));
|
||||
//查询信息对象
|
||||
for (int i=0;i<sob.getData().getWayChildren().size();i++){
|
||||
if(i!=0 && i!=(sob.getData().getWayChildren().size()-1)){
|
||||
LatLonPoint sp=new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get(i).getLatitude()),
|
||||
Double.parseDouble(sob.getData().getWayChildren().get((i)).getLongitude()));
|
||||
lists.add(sp);
|
||||
}
|
||||
}
|
||||
RouteSearch.FromAndTo fromAndTo = new RouteSearch.FromAndTo(startPoint,endPoint);
|
||||
//设置搜索参数 1.fromAndTo 路径的起点终点 2.路径规划的策略(这里是驾车模式,具体看高德API) 3.途
|
||||
//经点,可选 4.避让区域,可选, 5.避让道路 ,可选
|
||||
RouteSearch.DriveRouteQuery query = new
|
||||
RouteSearch.DriveRouteQuery(fromAndTo,RouteSearch.DRIVING_SINGLE_DEFAULT,lists,null,"");
|
||||
//开始异步查询
|
||||
mRouteSearch.calculateDriveRouteAsyn(query);
|
||||
}
|
||||
|
||||
|
||||
|
||||
class OnRouteSearchListener implements RouteSearch.OnRouteSearchListener{
|
||||
|
||||
@Override
|
||||
public void onBusRouteSearched(BusRouteResult busRouteResult, int i) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDriveRouteSearched(DriveRouteResult driveRouteResult, int rCode) {
|
||||
if (rCode == 1000){//获取规划路线成功,获取到的是了,路线坐标点的集合
|
||||
List<DrivePath> paths = driveRouteResult.getPaths();
|
||||
//创建存储坐标点的集合
|
||||
List<LatLng> latLngs = new ArrayList<>();
|
||||
List<LatLng> all = new ArrayList<>();
|
||||
mLKMap.removeOverlay(polylines);
|
||||
polylines.clear();
|
||||
|
||||
if (routePlanResult.getRouteInfos().size()>0){
|
||||
latLngs.clear();
|
||||
latLngs.addAll(routePlanResult.getRouteInfos().get(0).getGeometry());
|
||||
PolylineOptions options = new PolylineOptions();
|
||||
options.width(8f)
|
||||
.joinStyle(Property.LINE_JOIN_ROUND)
|
||||
.points(latLngs)
|
||||
.color(getResources().getColor(R.color.theme_color));
|
||||
all.addAll(latLngs);
|
||||
polylines.add((Polyline) mLKMap.addOverlay(options));
|
||||
//遍历获取规划的所有路线坐标点
|
||||
for (DrivePath mDrivePath : paths) {
|
||||
for (DriveStep mDriveStep : mDrivePath.getSteps()) {
|
||||
for (LatLonPoint mLatLonPoint : mDriveStep.getPolyline()) {
|
||||
latLngs.add(new
|
||||
LatLng(mLatLonPoint.getLatitude(),mLatLonPoint.getLongitude()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// for (int i = 0;i < routePlanResult.getRouteInfos().size();i ++){
|
||||
// latLngs.clear();
|
||||
// latLngs.addAll(routePlanResult.getRouteInfos().get(i).getGeometry());
|
||||
// PolylineOptions options = new PolylineOptions();
|
||||
// if(i == routePlanResult.getRouteInfos().size() - 1){
|
||||
// options.width(8f)
|
||||
//// .pattern(BitmapDescriptorFactory.fromResource(R.drawable.icon_roud_type))
|
||||
// .joinStyle(Property.LINE_JOIN_ROUND)
|
||||
// .points(latLngs)
|
||||
// .color(getResources().getColor(R.color.theme_color));
|
||||
// }else{
|
||||
// options.width(8f)
|
||||
//// .joinStyle(Property.LINE_JOIN_ROUND)
|
||||
// .points(latLngs)
|
||||
// .color(getResources().getColor(R.color.theme_color));
|
||||
// }
|
||||
// all.addAll(latLngs);
|
||||
// polylines.add((Polyline) mLKMap.addOverlay(options));
|
||||
// }
|
||||
mLKMap.setMapStatus(MapStatusUpdateFactory.buildUpdateByLatLngBounds(new LatLngBounds(all),100,100,100,100));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加起始点标记
|
||||
*/
|
||||
private void addRouteMarker() {
|
||||
mLKMap.removeOverlay(markers);
|
||||
markers.clear();
|
||||
MarkerOptions originOptions = new MarkerOptions()
|
||||
.position(new LatLng(locationsInfos.get(0).getLat(),locationsInfos.get(0).getLon()))
|
||||
}
|
||||
//先清除一下,避免重复显示
|
||||
aMap.clear();
|
||||
//绘制起始位置和目的地marker
|
||||
aMap.addMarker(new MarkerOptions()
|
||||
.icon(BitmapDescriptorFactory.fromResource(R.mipmap.qi))
|
||||
.iconGravity(Property.ICON_ANCHOR_BOTTOM)
|
||||
.iconScale(0.5f);
|
||||
markers.add((Marker) mLKMap.addOverlay(originOptions));
|
||||
|
||||
MarkerOptions destinationOptions = new MarkerOptions()
|
||||
.position(new LatLng(locationsInfos.get(1).getLat(),locationsInfos.get(1).getLon()))
|
||||
.position(new LatLng(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
|
||||
Double.parseDouble(sob.getData().getWayChildren().get(0).getLongitude()))));
|
||||
for(int i=0;i<sob.getData().getWayChildren().size();i++){
|
||||
if(i!=0 && i!=(sob.getData().getWayChildren().size()-1)){
|
||||
StartOrderBean.DataDTO.WayChildrenDTO sdw=sob.getData().getWayChildren().get(i);
|
||||
int icon=0;
|
||||
if(sdw.getType()==1){
|
||||
icon=R.mipmap.z_loc;
|
||||
}else{
|
||||
icon=R.mipmap.x_loc;
|
||||
}
|
||||
aMap.addMarker(new MarkerOptions()
|
||||
.icon(BitmapDescriptorFactory.fromResource(icon))
|
||||
.position(new LatLng(Double.parseDouble(sdw.getLatitude()),Double.parseDouble(sdw.getLongitude()))));
|
||||
}
|
||||
}
|
||||
aMap.addMarker(new MarkerOptions()
|
||||
.icon(BitmapDescriptorFactory.fromResource(R.mipmap.zhong))
|
||||
.iconGravity(Property.ICON_ANCHOR_BOTTOM)
|
||||
.iconScale(0.5f);
|
||||
markers.add((Marker) mLKMap.addOverlay(destinationOptions));
|
||||
.position(new LatLng(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size()-1)).getLatitude()),
|
||||
Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size()-1)).getLongitude()))));
|
||||
//绘制规划路径路线
|
||||
aMap.addPolyline(new PolylineOptions()
|
||||
//路线坐标点的集合
|
||||
.addAll(latLngs)
|
||||
//线的宽度
|
||||
.width(8)
|
||||
.color(getResources().getColor(R.color.theme_color)));
|
||||
//设置画线的颜色
|
||||
|
||||
//显示完整包含所有marker地图路线
|
||||
LatLngBounds.Builder builder =LatLngBounds.builder();
|
||||
for (int i = 0; i < latLngs.size(); i++) {
|
||||
builder.include(latLngs.get(i));
|
||||
}
|
||||
//显示全部marker,第二个参数是四周留空宽度
|
||||
aMap.moveCamera(CameraUpdateFactory.newLatLngBounds(builder.build(),200));
|
||||
LatLng latLng = new LatLng(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
|
||||
Double.parseDouble(sob.getData().getWayChildren().get((0)).getLongitude()));//构造一个位置
|
||||
aMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng,6));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWalkRouteSearched(WalkRouteResult walkRouteResult, int i) {
|
||||
|
||||
// private RouteSearch mRouteSearch;//路线查询器
|
||||
// private List<LatLonPoint> lists = new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRideRouteSearched(RideRouteResult rideRouteResult, int i) {
|
||||
|
||||
// public void search() {
|
||||
//// try {
|
||||
//// AMapLocationClient.updatePrivacyShow(con,true,true);
|
||||
//// AMapLocationClient.updatePrivacyAgree(con,true);
|
||||
// mRouteSearch = new RouteSearch(this);
|
||||
//// } catch (AMapException e) {
|
||||
//// e.printStackTrace();
|
||||
//// }
|
||||
// //设置数据回调监听器
|
||||
// mRouteSearch.setRouteSearchListener(new OnRouteSearchListener());
|
||||
// //设置开始位置坐标点(注意经纬度不能写反,会报错1800(只能规划到中国区域里的地图路线))
|
||||
// LatLonPoint startPoint = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
|
||||
// Double.parseDouble(sob.getData().getWayChildren().get((0)).getLongitude()));
|
||||
// //设置目的地坐标点
|
||||
// LatLonPoint endPoint = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLatitude()),
|
||||
// Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLongitude()));
|
||||
// //查询信息对象
|
||||
// for (int i = 0; i < sob.getData().getWayChildren().size(); i++) {
|
||||
// if (i != 0 && i != (sob.getData().getWayChildren().size() - 1)) {
|
||||
// LatLonPoint sp = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get(i).getLatitude()),
|
||||
// Double.parseDouble(sob.getData().getWayChildren().get((i)).getLongitude()));
|
||||
// lists.add(sp);
|
||||
// }
|
||||
// }
|
||||
// RouteSearch.FromAndTo fromAndTo = new RouteSearch.FromAndTo(startPoint, endPoint);
|
||||
// //设置搜索参数 1.fromAndTo 路径的起点终点 2.路径规划的策略(这里是驾车模式,具体看高德API) 3.途
|
||||
// //经点,可选 4.避让区域,可选, 5.避让道路 ,可选
|
||||
// RouteSearch.DriveRouteQuery query = new
|
||||
// RouteSearch.DriveRouteQuery(fromAndTo, RouteSearch.DRIVING_SINGLE_DEFAULT, lists, null, "");
|
||||
// //开始异步查询
|
||||
// mRouteSearch.calculateDriveRouteAsyn(query);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
// class OnRouteSearchListener implements RouteSearch.OnRouteSearchListener {
|
||||
//
|
||||
// @Override
|
||||
// public void onBusRouteSearched(BusRouteResult busRouteResult, int i) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onDriveRouteSearched(DriveRouteResult driveRouteResult, int rCode) {
|
||||
// if (rCode == 1000) {//获取规划路线成功,获取到的是了,路线坐标点的集合
|
||||
// List<DrivePath> paths = driveRouteResult.getPaths();
|
||||
// //创建存储坐标点的集合
|
||||
// List<LatLng> latLngs = new ArrayList<>();
|
||||
// //遍历获取规划的所有路线坐标点
|
||||
// for (DrivePath mDrivePath : paths) {
|
||||
// for (DriveStep mDriveStep : mDrivePath.getSteps()) {
|
||||
// for (LatLonPoint mLatLonPoint : mDriveStep.getPolyline()) {
|
||||
// latLngs.add(new
|
||||
// LatLng(mLatLonPoint.getLatitude(), mLatLonPoint.getLongitude()));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// //先清除一下,避免重复显示
|
||||
// aMap.clear();
|
||||
// //绘制起始位置和目的地marker
|
||||
// aMap.addMarker(new MarkerOptions()
|
||||
// .icon(BitmapDescriptorFactory.fromResource(R.mipmap.qi))
|
||||
// .position(new LatLng(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
|
||||
// Double.parseDouble(sob.getData().getWayChildren().get(0).getLongitude()))));
|
||||
// for (int i = 0; i < sob.getData().getWayChildren().size(); i++) {
|
||||
// if (i != 0 && i != (sob.getData().getWayChildren().size() - 1)) {
|
||||
// StartOrderBean.DataDTO.WayChildrenDTO sdw = sob.getData().getWayChildren().get(i);
|
||||
// int icon = 0;
|
||||
// if (sdw.getType() == 1) {
|
||||
// icon = R.mipmap.z_loc;
|
||||
// } else {
|
||||
// icon = R.mipmap.x_loc;
|
||||
// }
|
||||
// aMap.addMarker(new MarkerOptions()
|
||||
// .icon(BitmapDescriptorFactory.fromResource(icon))
|
||||
// .position(new LatLng(Double.parseDouble(sdw.getLatitude()), Double.parseDouble(sdw.getLongitude()))));
|
||||
// }
|
||||
// }
|
||||
// aMap.addMarker(new MarkerOptions()
|
||||
// .icon(BitmapDescriptorFactory.fromResource(R.mipmap.zhong))
|
||||
// .position(new LatLng(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLatitude()),
|
||||
// Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLongitude()))));
|
||||
// //绘制规划路径路线
|
||||
// aMap.addPolyline(new PolylineOptions()
|
||||
// //路线坐标点的集合
|
||||
// .addAll(latLngs)
|
||||
// //线的宽度
|
||||
// .width(8)
|
||||
// .color(getResources().getColor(R.color.theme_color)));
|
||||
// //设置画线的颜色
|
||||
//
|
||||
// //显示完整包含所有marker地图路线
|
||||
// LatLngBounds.Builder builder = LatLngBounds.builder();
|
||||
// for (int i = 0; i < latLngs.size(); i++) {
|
||||
// builder.include(latLngs.get(i));
|
||||
// }
|
||||
// //显示全部marker,第二个参数是四周留空宽度
|
||||
// aMap.moveCamera(CameraUpdateFactory.newLatLngBounds(builder.build(), 200));
|
||||
// LatLng latLng = new LatLng(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
|
||||
// Double.parseDouble(sob.getData().getWayChildren().get((0)).getLongitude()));//构造一个位置
|
||||
// aMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 6));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onWalkRouteSearched(WalkRouteResult walkRouteResult, int i) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onRideRouteSearched(RideRouteResult rideRouteResult, int i) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }
|
||||
}
|
||||
|
||||
public void up_traffic(){
|
||||
// ShippingNoteInfo[] snis=new ShippingNoteInfo[1];
|
||||
@@ -824,34 +665,13 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
// LocationOpenApi.stop(con, snis, new OnResultListener() {
|
||||
// @Override
|
||||
// public void onSuccess() {
|
||||
// Log.e("关闭定位成功","卸货货上传成功");
|
||||
// LogUtil.e("关闭定位成功","卸货货上传成功");
|
||||
// }
|
||||
// @Override
|
||||
// public void onFailure(String s, String s1) {
|
||||
// Log.e("关闭定位失败:",s+s1);
|
||||
// LogUtil.e("关闭定位失败:",s+s1);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
mapView.onStart();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
mapView.onStop();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onLowMemory() {
|
||||
super.onLowMemory();
|
||||
mapView.onDestroy();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-182
@@ -1,182 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.home.drivercircle;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.media.MediaMetadataRetriever;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
//import com.alibaba.sdk.android.vod.upload.VODSVideoUploadCallback;
|
||||
//import com.alibaba.sdk.android.vod.upload.VODSVideoUploadClient;
|
||||
//import com.alibaba.sdk.android.vod.upload.VODSVideoUploadClientImpl;
|
||||
//import com.alibaba.sdk.android.vod.upload.model.SvideoInfo;
|
||||
//import com.alibaba.sdk.android.vod.upload.session.VodHttpClientConfig;
|
||||
//import com.alibaba.sdk.android.vod.upload.session.VodSessionCreateInfo;
|
||||
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 java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* @author hlh
|
||||
* @version 1.0.0
|
||||
* @date 2021/11/4 17:15
|
||||
* @description:
|
||||
*/
|
||||
|
||||
public class VideoReleaseActivity extends BaseActivity {
|
||||
|
||||
private String videoPath="";
|
||||
private String coverPath="";
|
||||
private String video_title="用户未设置";
|
||||
private ImageView video_cover;
|
||||
@Override
|
||||
protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
StateStyleUtil.stateTextColor(this);
|
||||
setContentView(R.layout.activity_video_release);
|
||||
con=this;
|
||||
video_cover=findViewById(R.id.video_cover);
|
||||
videoPath=getIntent().getExtras().getString("path");
|
||||
setTitle("发布");
|
||||
initView(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView(Object obj) {
|
||||
super.initView(obj);
|
||||
getFirstframe(videoPath);
|
||||
Glide.with(con).load(new File(coverPath)).into(video_cover);
|
||||
}
|
||||
|
||||
public void submit(View v){
|
||||
|
||||
//uplod();
|
||||
}
|
||||
|
||||
private void getFirstframe(String path){
|
||||
MediaMetadataRetriever mmr=new MediaMetadataRetriever();//实例化MediaMetadataRetriever对象
|
||||
File file=new File(path);//实例化File对象,文件路径为/storage/emulated/0/shipin.mp4 (手机根目录)
|
||||
if(!file.exists()){
|
||||
Log.e("s","文件不存在");
|
||||
}
|
||||
mmr.setDataSource(path);
|
||||
Bitmap bitmap = mmr.getFrameAtTime(0); //0表示首帧图片
|
||||
mmr.release(); //释放MediaMetadataRetriever对象
|
||||
if(bitmap!=null){
|
||||
Log.e("s","获取视频缩略图成功");
|
||||
//存储媒体已经挂载,并且挂载点可读/写。
|
||||
if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
||||
bitmap.recycle(); //回收bitmap
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Calendar now = new GregorianCalendar();
|
||||
SimpleDateFormat simpleDate = new SimpleDateFormat("yyyyMMddHHmmss", Locale.getDefault());
|
||||
String picture_Name = simpleDate.format(now.getTime()); //获取当前时间戳作为文件名称,避免同名
|
||||
String framePath = "/storage/emulated/0/DCIM/Camera/"; //图片保存文件夹
|
||||
File frame_file = new File(framePath);
|
||||
if (!frame_file.exists()) { //// 如果路径不存在,就创建路径
|
||||
frame_file.mkdirs();
|
||||
}
|
||||
File picture_file = new File(framePath,picture_Name + ".jpg"); // 创建路径和文件名的File对象
|
||||
FileOutputStream out = new FileOutputStream(picture_file);
|
||||
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, out);
|
||||
out.flush();
|
||||
out.close(); //注意关闭文件流
|
||||
Log.e("s","保存图片成功");
|
||||
coverPath=picture_file.getPath();
|
||||
} catch (Exception e) {
|
||||
Log.e("保存图片失败",e.getMessage().toString());
|
||||
Toast.makeText(con, "保存图片失败!" + e.getMessage().toString(), Toast.LENGTH_LONG).show();
|
||||
e.printStackTrace();
|
||||
}
|
||||
}else{
|
||||
Log.e("e","获取视频缩略图失败");
|
||||
}
|
||||
}
|
||||
|
||||
private String accessKeyId="";
|
||||
private String accessKeySecret="";
|
||||
private String securityToken="";
|
||||
private String expriedTime="";
|
||||
private String requestID="";
|
||||
|
||||
// public void uplod(){
|
||||
// VODSVideoUploadClient vodsVideoUploadClient = new VODSVideoUploadClientImpl(getApplicationContext());
|
||||
// vodsVideoUploadClient.init();
|
||||
// //构建上传参数
|
||||
// //参数请确保存在,如不存在SDK内部将会直接将错误throw Exception
|
||||
// //文件路径保证存在之外因为Android 6.0之后需要动态获取权限,请开发者自行实现获取"文件读写权限"
|
||||
// VodHttpClientConfig vodHttpClientConfig = new VodHttpClientConfig.Builder()
|
||||
// .setMaxRetryCount(2)//重试次数
|
||||
// .setConnectionTimeout(15 * 1000)//连接超时
|
||||
// .setSocketTimeout(15 * 1000)//socket超时
|
||||
// .build();
|
||||
// //构建短视频VideoInfo,常见的描述、标题、详情都可以设置
|
||||
// SvideoInfo svideoInfo = new SvideoInfo();
|
||||
// svideoInfo.setTitle(video_title);//标题
|
||||
// svideoInfo.setDesc("-无-");//文件详情
|
||||
// svideoInfo.setCateId(1);//分类ID
|
||||
// //构建点播上传参数(重要)
|
||||
// VodSessionCreateInfo vodSessionCreateInfo =new VodSessionCreateInfo.Builder()
|
||||
// .setImagePath(coverPath)//图片地址
|
||||
// .setVideoPath(videoPath)//视频地址
|
||||
// .setAccessKeyId(accessKeyId)//临时accessKeyId
|
||||
// .setAccessKeySecret(accessKeySecret)//临时accessKeySecret
|
||||
// .setSecurityToken(securityToken)//securityToken
|
||||
// .setExpriedTime(expriedTime)//STStoken过期时间
|
||||
// .setRequestID(requestID)//requestID,开发者可以传将获取STS返回的requestID设置也可以不设
|
||||
// .setIsTranscode(true)//是否转码,如开启转码请AppSever务必监听服务端转码成功的通知
|
||||
// .setSvideoInfo(svideoInfo)//短视频信息
|
||||
// .setVodHttpClientConfig(vodHttpClientConfig)//网络参数
|
||||
// .build();
|
||||
// vodsVideoUploadClient.uploadWithVideoAndImg(vodSessionCreateInfo, new VODSVideoUploadCallback() {
|
||||
// @Override
|
||||
// public void onUploadSucceed(String videoId, String imageUrl) {
|
||||
// //上传成功返回视频ID和图片URL
|
||||
// Log.d("-success-","onUploadSucceed"+ "videoId:"+ videoId + "imageUrl" + imageUrl);
|
||||
// }
|
||||
// @Override
|
||||
// public void onUploadFailed(String code, String message) {
|
||||
// //上传失败返回错误码和message,错误码有详细的错误信息请开发者仔细阅读
|
||||
// Log.d("-error-","onUploadFailed" + "code" + code + "message" + message);
|
||||
// }
|
||||
// @Override
|
||||
// public void onUploadProgress(long uploadedSize, long totalSize) {
|
||||
// //上传的进度回调,非UI线程
|
||||
// Log.d("-进度-","onUploadProgress" + uploadedSize * 100 / totalSize);
|
||||
// //progress = uploadedSize * 100 / totalSize;
|
||||
// //handler.sendEmptyMessage(0);
|
||||
// }
|
||||
// @Override
|
||||
// public void onSTSTokenExpried() {
|
||||
// Log.d("过期","onSTSTokenExpried");
|
||||
// //STS token过期之后刷新STStoken,如正在上传将会断点续传
|
||||
// // vodsVideoUploadClient.refreshSTSToken(accessKeyId,accessKeySecret,securityToken,expriedTime);
|
||||
// }
|
||||
// @Override
|
||||
// public void onUploadRetry(String code, String message) {
|
||||
// //上传重试的提醒
|
||||
// //Log.d(TAG,"onUploadRetry" + "code" + code + "message" + message);
|
||||
// }
|
||||
// @Override
|
||||
// public void onUploadRetryResume() {
|
||||
// //上传重试成功的回调,告知用户重试成功
|
||||
// //Log.d(TAG,"onUploadRetryResume");
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
}
|
||||
+4
-11
@@ -1,12 +1,12 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
@@ -16,7 +16,6 @@ import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||
|
||||
/**
|
||||
* @author hlh
|
||||
@@ -39,7 +38,7 @@ public class GetShangChuanActivity extends BaseActivity {
|
||||
con=this;
|
||||
initFind();
|
||||
sdwStr=getIntent().getExtras().getString("sdwStr");
|
||||
Log.e("---sdwStr--",sdwStr);
|
||||
LogUtil.e("---sdwStr--",sdwStr);
|
||||
sdw=new Gson().fromJson(sdwStr,StartOrderBean.DataDTO.WayChildrenDTO.class);
|
||||
initView(null);
|
||||
}
|
||||
@@ -75,22 +74,16 @@ public class GetShangChuanActivity extends BaseActivity {
|
||||
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))
|
||||
.asImageViewer(img1,sdw.getSendPutImagesUrl().get(0), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(img1,sdw.getSendPutImagesUrl().get(0), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
});
|
||||
}
|
||||
if(sdw.getReceiptUrl()!=null && sdw.getReceiptUrl().size()>=1){
|
||||
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))
|
||||
.asImageViewer(img2,sdw.getReceiptUrl().get(0), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(img2,sdw.getReceiptUrl().get(0), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
});
|
||||
}
|
||||
//new GlideUrl(sdw.getSendPutImagesUrl().toString(), new LazyHeaders.Builder().addHeader("Cookie", AppCurrentUser.getInstance().getUserCookie()).build());
|
||||
|
||||
+120
-245
@@ -19,19 +19,12 @@ import com.alct.mdp.callback.OnResultListener;
|
||||
import com.alct.mdp.model.Goods;
|
||||
import com.alct.mdp.model.Image;
|
||||
import com.alct.mdp.model.Location;
|
||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.ALProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.OCRRequest;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.BitmapUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.img.GetCarImageAlert;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.location.LocationUtil;
|
||||
import com.baidu.mapapi.model.LatLng;
|
||||
import com.baidu.mapapi.utils.CoordinateConverter;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.google.gson.Gson;
|
||||
import com.luck.picture.lib.PictureSelector;
|
||||
@@ -45,7 +38,9 @@ import com.arpa.hndahesudintocctmsdriver.bean.UploadBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.UploadReceiptInputBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.location.LocationGDUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.location.LocationUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.file.FileUtil;
|
||||
@@ -54,7 +49,6 @@ import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.time.Timer;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
@@ -75,7 +69,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
private LUInputBean lub=new LUInputBean();
|
||||
private UploadReceiptInputBean urib=new UploadReceiptInputBean();
|
||||
private LocationGDUtil lgdu;
|
||||
public LocationUtil lu;
|
||||
private LocationUtil lu;
|
||||
private List<Integer> imgIds=new ArrayList<>();
|
||||
private UploadBean ub;
|
||||
private HuoYuanRequset hyr;
|
||||
@@ -94,15 +88,11 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
switch (m.what){
|
||||
case RequsetCodeConstants.SUCCESS:
|
||||
if (CacheGroup.cacheList.get("upload")!=null) {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
Log.e("upload", CacheGroup.cacheList.get("upload"));
|
||||
LogUtil.e("upload",CacheGroup.cacheList.get("upload"));
|
||||
ub=gson.fromJson(CacheGroup.cacheList.remove("upload"),UploadBean.class);
|
||||
if(ub.getCode()==200){
|
||||
imgIds.add(ub.getData().getId());
|
||||
// Glide.with(con).load(ub.getData().getUrl()).into(res_img);
|
||||
Glide.with(con).load(path).into(res_img);
|
||||
Glide.with(con).load(ub.getData().getUrl()).into(res_img);
|
||||
res_img.setVisibility(View.VISIBLE);
|
||||
img_delete.setVisibility(View.VISIBLE);
|
||||
img_icon.setVisibility(View.GONE);
|
||||
@@ -116,20 +106,17 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
if (CacheGroup.cacheList.get(TYPE_NAME[i])!=null) {
|
||||
BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]),BaseBean.class);
|
||||
if(bb.getCode()==200){
|
||||
if (index == 2) {
|
||||
if (!keys) {//装货回单
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
if(!keys){
|
||||
Toast.makeText(con,"上传成功",Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}else{
|
||||
Toast.makeText(con,"上传成功",Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}else{
|
||||
Toast.makeText(con,bb.getMsg(),Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove(TYPE_NAME[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(CacheGroup.cacheList.get("carName")!=null){
|
||||
@@ -139,51 +126,17 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
CacheGroup.cacheList.remove("carName");
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("carNum") != null) {
|
||||
Log.e("upload", CacheGroup.cacheList.get("carNum"));
|
||||
CarInfoBean ub = gson.fromJson(CacheGroup.cacheList.remove("carNum"), CarInfoBean.class);
|
||||
if (ub.getCode() == 200 && ub.getData().getData().getPrism_keyValueInfo().size() > 0) {
|
||||
String value = ub.getData().getData().getPrism_keyValueInfo().get(0).getValue();
|
||||
String forceMatching = ub.getData().getForceMatching();
|
||||
if ("1".equals(forceMatching)) {//是否强校验车牌号 1:强校验
|
||||
if (sob.getData().getCarNumber().equals(value)) {
|
||||
hyr.uploadFile(new File(path));
|
||||
} else {
|
||||
new MessageUtils().showCenMessage(ShangChuangImgActivity.this, "车牌号不匹配!", "请重新拍照或联系管理员");
|
||||
}
|
||||
} else {
|
||||
hyr.uploadFile(new File(path));
|
||||
}
|
||||
} else {//识别失败后返回code500
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
if (index == 0) {//装卸货车辆需要识别车牌号){
|
||||
Toast.makeText(con, "装货照片包含车牌号、三分之二车身或者装卸货场景。", Toast.LENGTH_SHORT).show();
|
||||
} else if (index == 1) {
|
||||
Toast.makeText(con, "卸货照片包含车牌号、三分之二车身或者装卸货场景。", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}
|
||||
CacheGroup.cacheList.remove("carNum");
|
||||
}
|
||||
break;
|
||||
case 14://定位成功
|
||||
locationKey=true;
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
tv_loaction.setText("定位成功");
|
||||
tv_loaction.setTextColor(getResources().getColor(R.color.theme_color,null));
|
||||
latLng = convertGPSToBaidu(new LatLng(lgdu.getLatitude(), lgdu.getLongitude()));
|
||||
initLocation();
|
||||
break;
|
||||
case 16://定位失败
|
||||
locationKey=false;
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
tv_loaction.setText("定位失败,点击重试");
|
||||
tv_loaction.setTextColor(getResources().getColor(R.color.loaction_no_color,null));
|
||||
Toast.makeText(con,"定位失败,请确认开启定位后重试!",Toast.LENGTH_LONG).show();
|
||||
@@ -195,32 +148,18 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
|
||||
case ImageFileCompressUtil.COMPRESS_SUCCESS:
|
||||
path= (String) m.obj;
|
||||
Log.e("res:", "选定图片结果");
|
||||
Log.e("res:", path);
|
||||
LogUtil.e("res:","选定图片结果");
|
||||
LogUtil.e("res:",path);
|
||||
//选定图片结果
|
||||
// if(index==1 || index==2){
|
||||
// new OCRRequest().OCRPlateLicense(con,hd,new File(path));
|
||||
// }
|
||||
if ((index == 0 || index == 1) && !BuildConfig.isTest) {//装卸货车辆需要识别车牌号,测试环境不校验车牌号
|
||||
new OCRRequest().OCRCarPlateLicense(con, hd, new File(path));
|
||||
} else {
|
||||
hyr.uploadFile(new File(path));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
}
|
||||
|
||||
private LatLng latLng;
|
||||
|
||||
public LatLng convertGPSToBaidu(LatLng srLatLng) {
|
||||
CoordinateConverter converter = new CoordinateConverter();
|
||||
converter.from(CoordinateConverter.CoordType.COMMON);
|
||||
converter.coord(srLatLng);
|
||||
return converter.convert();
|
||||
}
|
||||
|
||||
private String wid;
|
||||
private int h_type;
|
||||
String sobStr="";
|
||||
@@ -248,7 +187,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
h_type=ins.getInt("h_type");
|
||||
keys=ins.getBoolean("keys");
|
||||
sobStr=getIntent().getExtras().getString("sob");
|
||||
//Log.e("---sdwStr--",sdwStr);
|
||||
//LogUtil.e("---sdwStr--",sdwStr);
|
||||
sob=new Gson().fromJson(sobStr, StartOrderBean.class);
|
||||
initView(null);
|
||||
customDialog=new CustomDialog(con, "正在定位当前位置...");
|
||||
@@ -256,18 +195,16 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
lgdu=new LocationGDUtil(con,hd);
|
||||
//启动定位
|
||||
lgdu.onCreate();
|
||||
// lu = new LocationUtil(con, hd);
|
||||
// lu.onCreate();
|
||||
// if (keys) {
|
||||
// lu = new LocationUtil(con, hd);
|
||||
// lu.onCreate();
|
||||
// }
|
||||
lu=new LocationUtil(con,hd);
|
||||
lu.onCreate();
|
||||
if (keys){
|
||||
lu=new LocationUtil(con,hd);
|
||||
lu.onCreate();
|
||||
}
|
||||
tv_loaction.setOnClickListener(v -> {
|
||||
if (!locationKey){
|
||||
customDialog.show();
|
||||
lgdu.onCreate();
|
||||
// lu = new LocationUtil(con, hd);
|
||||
// lu.onCreate();
|
||||
}
|
||||
});
|
||||
hyr=new HuoYuanRequset(con,hd);
|
||||
@@ -301,15 +238,12 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
});
|
||||
getImg.setOnClickListener(v -> {
|
||||
if(key){
|
||||
Log.e("--imgIds.size()--", imgIds.size() + "");
|
||||
LogUtil.e("--imgIds.size()--",imgIds.size()+"");
|
||||
gia.showPopueWindow(this,index==2);
|
||||
}else{
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(res_img, ub.getData().getUrl(), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||
.asImageViewer(res_img, ub.getData().getUrl(), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(res_img, ub.getData().getUrl(), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
Toast.makeText(con,"查看了照片", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
@@ -337,14 +271,8 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
return;
|
||||
}
|
||||
path=gia.getFile().getPath();
|
||||
Log.e("图片地址:", path);
|
||||
LogUtil.e("图片地址:",path);
|
||||
gia.dis();
|
||||
|
||||
if (customDialog != null && !customDialog.isShowing()) {
|
||||
customDialog = new CustomDialog(con, "网络请求中...");
|
||||
customDialog.show();
|
||||
}
|
||||
|
||||
ImageFileCompressUtil.imageFileCompress(con,new File(path),hd);
|
||||
} else if (requestCode == PictureConfig.CHOOSE_REQUEST && resultCode == RESULT_OK) {
|
||||
List<LocalMedia> imgs = PictureSelector.obtainMultipleResult(data);
|
||||
@@ -356,14 +284,8 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
paths = image.getPath();
|
||||
}
|
||||
path=paths;
|
||||
Log.e("图片地址:", path);
|
||||
LogUtil.e("图片地址:",path);
|
||||
gia.dis();
|
||||
|
||||
if (customDialog != null && !customDialog.isShowing()) {
|
||||
customDialog = new CustomDialog(con, "网络请求中...");
|
||||
customDialog.show();
|
||||
}
|
||||
|
||||
ImageFileCompressUtil.imageFileCompress(con,new File(path),hd);
|
||||
}
|
||||
}
|
||||
@@ -375,12 +297,8 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
|
||||
public void typeRequest(){
|
||||
// for(int i=0;i<imgIds.size();i++){
|
||||
// Log.e("--imgIds--",imgIds.get(i)+"");
|
||||
// LogUtil.e("--imgIds--",imgIds.get(i)+"");
|
||||
// }
|
||||
if (customDialog != null && !customDialog.isShowing()) {
|
||||
customDialog = new CustomDialog(con, "网络请求中...");
|
||||
customDialog.show();
|
||||
}
|
||||
switch (index){
|
||||
case 0:
|
||||
//装货
|
||||
@@ -390,13 +308,13 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
lub.setLocationAddress(lgdu.getAddress());
|
||||
lub.setImageId(imgIds);
|
||||
lub.setWaybillId(wid);
|
||||
Log.e("--装货信息", gson.toJson(lub));
|
||||
if (locationKey) {//高德定位
|
||||
LogUtil.e("--装货信息", gson.toJson(lub));
|
||||
if(locationKey){
|
||||
hyr.loading(lub);
|
||||
if(keys){
|
||||
nfc();
|
||||
loadInfo();
|
||||
// up_traffic_start();
|
||||
// up_image_z();
|
||||
up_traffic_start();
|
||||
up_image_z();
|
||||
}
|
||||
}else{
|
||||
Toast.makeText(con,"定位异常,请重新定位",Toast.LENGTH_SHORT).show();
|
||||
@@ -414,14 +332,14 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
lub.setLocationAddress(lgdu.getAddress());
|
||||
lub.setImageId(imgIds);
|
||||
lub.setWaybillId(wid);
|
||||
Log.e("--卸货信息", gson.toJson(lub));
|
||||
LogUtil.e("--卸货信息", gson.toJson(lub));
|
||||
if(locationKey){
|
||||
if(keys){
|
||||
nfc();
|
||||
uploadInfo();
|
||||
|
||||
up_traffic_end();
|
||||
up_image();
|
||||
}
|
||||
|
||||
hyr.dischargeCargo(lub);
|
||||
}else{
|
||||
Toast.makeText(con,"定位异常,请重新定位",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@@ -431,7 +349,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (imgIds != null && imgIds.size() > 0) {//卸货回单
|
||||
if(imgIds!=null && imgIds.size()>0){
|
||||
//上传回单
|
||||
urib.setLatitude(lgdu.getLatitude()+"");
|
||||
urib.setLongitude(lgdu.getLongitude()+"");
|
||||
@@ -442,7 +360,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
urib.setReceiptId(imgIds);
|
||||
//子运运单ID
|
||||
urib.setWaybillId(wid);
|
||||
Log.e("--回单信息", gson.toJson(urib));
|
||||
LogUtil.e("--回单信息",gson.toJson(urib));
|
||||
if(locationKey) {
|
||||
if (index == 2 && keys) {
|
||||
up_trafficSign();
|
||||
@@ -450,20 +368,46 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
receipt_image();
|
||||
}
|
||||
hyr.receipt(urib);
|
||||
} else {
|
||||
}{
|
||||
Toast.makeText(con,"定位异常,请重新定位",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}else{
|
||||
Toast.makeText(con,"图片上传异常,请重新上传",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
}
|
||||
|
||||
private StartOrderBean sob;
|
||||
|
||||
//上传安联和交通厅-装货
|
||||
public void up_traffic_start(){
|
||||
//安联
|
||||
if(sob.getData().getReportAlct()==1) {
|
||||
Location l = new Location();
|
||||
l.setBaiduLongitude(lu.getLongitude());
|
||||
l.setBaiduLatitude(lu.getLatitude());
|
||||
l.setLocation(lu.getAddress());
|
||||
l.setTime(Timer.getTimerT());
|
||||
MDPLocationCollectionManager.pickup(con,sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
LogUtil.e("上报安联", "装货上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
LogUtil.e("上报安联失败(装货):", s + s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
//交通厅
|
||||
if(sob.getData().getReport()==1){
|
||||
JTTProcess.start(con,sob,"");
|
||||
}
|
||||
}
|
||||
|
||||
public void nfc(){
|
||||
// if(sob.getData().getNfcId().equals(nfcStr)){
|
||||
// Toast.makeText(con,"nfcId匹配失败",Toast.LENGTH_LONG).show();
|
||||
@@ -480,18 +424,46 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("不匹配", "" + s + s1);
|
||||
LogUtil.e("不匹配",""+s+s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//上传安联和交通厅-卸货
|
||||
public void up_traffic_end(){
|
||||
//安联
|
||||
if(sob.getData().getReportAlct()==1){
|
||||
Location l=new Location();
|
||||
l.setBaiduLongitude(lu.getLongitude());
|
||||
l.setBaiduLatitude(lu.getLatitude());
|
||||
l.setLocation(lu.getAddress());
|
||||
l.setTime(Timer.getTimerT());
|
||||
LogUtil.e("-安联卸货信息-",gson.toJson(l));
|
||||
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
LogUtil.e("上报安联","卸货上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
LogUtil.e("上报安联失败(卸货):",s+s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
//交通厅
|
||||
if(sob.getData().getReport()==1){
|
||||
JTTProcess.stop(con,sob,"");
|
||||
}
|
||||
}
|
||||
|
||||
//上传安联-签收
|
||||
public void up_trafficSign(){
|
||||
//安联
|
||||
Location l=new Location();
|
||||
l.setBaiduLongitude(latLng.longitude);
|
||||
l.setBaiduLatitude(latLng.latitude);
|
||||
l.setLocation(lgdu.getAddress());
|
||||
l.setBaiduLongitude(lu.getLongitude());
|
||||
l.setBaiduLatitude(lu.getLatitude());
|
||||
l.setLocation(lu.getAddress());
|
||||
l.setTime(Timer.getTimerT());
|
||||
List<Goods> gs=new ArrayList<>();
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||
@@ -515,12 +487,12 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
MDPLocationCollectionManager.sign(con, sob.getData().getShippingNoteNumber(), l,gs, new com.alct.mdp.callback.OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "签收成功");
|
||||
LogUtil.e("上报安联","签收成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(签收):", s + s1);
|
||||
LogUtil.e("上报安联失败(签收):",s+s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -529,20 +501,20 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
public void up_trafficReceipt(){
|
||||
//安联
|
||||
Location l=new Location();
|
||||
l.setBaiduLongitude(latLng.longitude);
|
||||
l.setBaiduLatitude(latLng.latitude);
|
||||
l.setLocation(lgdu.getAddress());
|
||||
l.setBaiduLongitude(lu.getLongitude());
|
||||
l.setBaiduLatitude(lu.getLatitude());
|
||||
l.setLocation(lu.getAddress());
|
||||
l.setTime(Timer.getTimerT());
|
||||
MDPLocationCollectionManager.pod(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "回单上传成功");
|
||||
LogUtil.e("上报安联","回单上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(回单):", s + s1);
|
||||
LogUtil.e("上报安联失败(回单):",s+s1);
|
||||
}
|
||||
|
||||
});
|
||||
@@ -557,24 +529,19 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
image.setFileExt(FileUtil.lastName(file));
|
||||
image.setFileName(FileUtil.fileName(file));
|
||||
image.setImageTakenDate(Timer.getTimerT());
|
||||
image.setBaiduLongitude(latLng.longitude);
|
||||
image.setBaiduLatitude(latLng.latitude);
|
||||
image.setLocation(lgdu.getAddress());
|
||||
image.setBaiduLongitude(lu.getLongitude());
|
||||
image.setBaiduLatitude(lu.getLatitude());
|
||||
image.setLocation(lu.getAddress());
|
||||
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();
|
||||
}
|
||||
Log.e("上报安联", "装货照片上传成功");
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
LogUtil.e("上报安联","装货照片上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(装货照片):", s + s1);
|
||||
LogUtil.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);
|
||||
@@ -592,27 +559,19 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
image.setFileExt(FileUtil.lastName(file));
|
||||
image.setFileName(FileUtil.fileName(file));
|
||||
image.setImageTakenDate(Timer.getTimerT());
|
||||
image.setBaiduLongitude(latLng.longitude);
|
||||
image.setBaiduLatitude(latLng.latitude);
|
||||
image.setLocation(lgdu.getAddress());
|
||||
image.setBaiduLongitude(lu.getLongitude());
|
||||
image.setBaiduLatitude(lu.getLatitude());
|
||||
image.setLocation(lu.getAddress());
|
||||
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();
|
||||
}
|
||||
Log.e("上报安联", "卸货照片上传成功");
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
LogUtil.e("上报安联","卸货照片上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(卸货照片):", s + s1);
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
LogUtil.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);
|
||||
@@ -631,24 +590,19 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
image.setFileExt(FileUtil.lastName(file));
|
||||
image.setFileName(FileUtil.fileName(file));
|
||||
image.setImageTakenDate(Timer.getTimerT());
|
||||
image.setBaiduLongitude(latLng.longitude);
|
||||
image.setBaiduLatitude(latLng.latitude);
|
||||
image.setLocation(lgdu.getAddress());
|
||||
image.setBaiduLongitude(lu.getLongitude());
|
||||
image.setBaiduLatitude(lu.getLatitude());
|
||||
image.setLocation(lu.getAddress());
|
||||
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();
|
||||
}
|
||||
Log.e("上报安联", "回单照片上传成功");
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
LogUtil.e("上报安联","回单照片上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(回单照片):", s + s1);
|
||||
LogUtil.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);
|
||||
@@ -684,87 +638,8 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Log.e("nfc", nfcStr);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 上传安联和交通厅,平台-装货
|
||||
*/
|
||||
private void loadInfo() {
|
||||
//安联
|
||||
if (sob.getData().getReportAlct() == 1) {
|
||||
Location l = new Location();
|
||||
l.setBaiduLongitude(latLng.longitude);
|
||||
l.setBaiduLatitude(latLng.latitude);
|
||||
l.setLocation(lgdu.getAddress());
|
||||
l.setTime(Timer.getTimerT());
|
||||
MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传安联和交通厅,平台-卸货
|
||||
*/
|
||||
private void uploadInfo() {
|
||||
|
||||
//安联
|
||||
if (sob.getData().getReportAlct() == 1) {
|
||||
Location l = new Location();
|
||||
l.setBaiduLongitude(latLng.longitude);
|
||||
l.setBaiduLatitude(latLng.latitude);
|
||||
l.setLocation(lgdu.getAddress());
|
||||
l.setTime(Timer.getTimerT());
|
||||
Log.e("-安联卸货信息-", gson.toJson(l));
|
||||
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new 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);
|
||||
}
|
||||
});
|
||||
LogUtil.e("nfc",nfcStr);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-713
@@ -1,713 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alct.mdp.MDPLocationCollectionManager;
|
||||
import com.alct.mdp.callback.OnResultListener;
|
||||
import com.alct.mdp.model.Goods;
|
||||
import com.alct.mdp.model.Image;
|
||||
import com.alct.mdp.model.Location;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.StartOrderBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.UploadBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.UploadReceiptInputBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.BitmapUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.file.FileUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.file.ImageFileCompressUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.img.GetCarImageAlert;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.location.LocationGDUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.location.LocationUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.time.Timer;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.luck.picture.lib.PictureSelector;
|
||||
import com.luck.picture.lib.config.PictureConfig;
|
||||
import com.luck.picture.lib.entity.LocalMedia;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ShangChuangImgActivity2 extends BaseAppCompatActivity {
|
||||
|
||||
private TextView submit,name_top,name_body,address,tips,tips_x;
|
||||
private RelativeLayout getImg;
|
||||
private ImageView res_img,img_icon,img_delete;
|
||||
private String[] names={"装货","卸货","回单"};
|
||||
public static String[] TYPE_NAME={"zhuanghuo","xiehuo","huidan"};
|
||||
private int index=0;
|
||||
//
|
||||
private Gson gson=new Gson();
|
||||
//
|
||||
private LUInputBean lub=new LUInputBean();
|
||||
private UploadReceiptInputBean urib=new UploadReceiptInputBean();
|
||||
private LocationGDUtil lgdu;
|
||||
private LocationUtil lu;
|
||||
private List<Integer> imgIds=new ArrayList<>();
|
||||
private UploadBean ub;
|
||||
private HuoYuanRequset hyr;
|
||||
//
|
||||
private GetCarImageAlert gia=new GetCarImageAlert();
|
||||
private CustomDialog customDialog;
|
||||
private int id=0;
|
||||
private boolean key=true;
|
||||
private boolean keys=false;
|
||||
private boolean locationKey=false;
|
||||
private TextView tv_loaction;
|
||||
|
||||
@Override
|
||||
public void msgMethod(Message m) {
|
||||
super.msgMethod(m);
|
||||
switch (m.what){
|
||||
case RequsetCodeConstants.SUCCESS:
|
||||
if (CacheGroup.cacheList.get("upload")!=null) {
|
||||
Log.e("upload",CacheGroup.cacheList.get("upload"));
|
||||
ub=gson.fromJson(CacheGroup.cacheList.remove("upload"),UploadBean.class);
|
||||
if(ub.getCode()==200){
|
||||
imgIds.add(ub.getData().getId());
|
||||
Glide.with(con).load(ub.getData().getUrl()).into(res_img);
|
||||
res_img.setVisibility(View.VISIBLE);
|
||||
img_delete.setVisibility(View.VISIBLE);
|
||||
img_icon.setVisibility(View.GONE);
|
||||
key=false;
|
||||
}else{
|
||||
Toast.makeText(con,ub.getMsg(),Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove("upload");
|
||||
}
|
||||
for(int i=0;i<TYPE_NAME.length;i++){
|
||||
if (CacheGroup.cacheList.get(TYPE_NAME[i])!=null) {
|
||||
BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]),BaseBean.class);
|
||||
if(bb.getCode()==200){
|
||||
if(!keys){
|
||||
Toast.makeText(con,"上传成功",Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}else{
|
||||
Toast.makeText(con,"上传成功",Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
}else{
|
||||
Toast.makeText(con,bb.getMsg(),Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove(TYPE_NAME[i]);
|
||||
}
|
||||
}
|
||||
if(CacheGroup.cacheList.get("carName")!=null){
|
||||
BaseBean bb=gson.fromJson(CacheGroup.cacheList.get("carName"),BaseBean.class);
|
||||
if(bb.getCode()==200){
|
||||
|
||||
}
|
||||
CacheGroup.cacheList.remove("carName");
|
||||
}
|
||||
break;
|
||||
case 14://定位成功
|
||||
locationKey=true;
|
||||
customDialog.dismiss();
|
||||
tv_loaction.setText("定位成功");
|
||||
tv_loaction.setTextColor(getResources().getColor(R.color.theme_color,null));
|
||||
initLocation();
|
||||
break;
|
||||
case 16://定位失败
|
||||
locationKey=false;
|
||||
customDialog.dismiss();
|
||||
tv_loaction.setText("定位失败,点击重试");
|
||||
tv_loaction.setTextColor(getResources().getColor(R.color.loaction_no_color,null));
|
||||
Toast.makeText(con,"定位失败,请确认开启定位后重试!",Toast.LENGTH_LONG).show();
|
||||
//定位结果接收
|
||||
//finish();
|
||||
break;
|
||||
case 15:
|
||||
break;
|
||||
|
||||
case ImageFileCompressUtil.COMPRESS_SUCCESS:
|
||||
path= (String) m.obj;
|
||||
Log.e("res:","选定图片结果");
|
||||
Log.e("res:",path);
|
||||
//选定图片结果
|
||||
// if(index==1 || index==2){
|
||||
// new OCRRequest().OCRPlateLicense(con,hd,new File(path));
|
||||
// }
|
||||
hyr.uploadFile(new File(path));
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
}
|
||||
|
||||
private String wid;
|
||||
private int h_type;
|
||||
String sobStr="";
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
StateStyleUtil.stateTextColor(this);
|
||||
setContentView(R.layout.activity_shangchuan);
|
||||
con=this;
|
||||
submit=findViewById(R.id.submit);
|
||||
name_top=findViewById(R.id.name_top);
|
||||
name_body=findViewById(R.id.name_body);
|
||||
address=findViewById(R.id.address);
|
||||
getImg=findViewById(R.id.getImg);
|
||||
res_img=findViewById(R.id.res_img);
|
||||
img_icon=findViewById(R.id.img_icon);
|
||||
img_delete=findViewById(R.id.img_delete);
|
||||
tv_loaction=findViewById(R.id.tv_loaction);
|
||||
tips=findViewById(R.id.tips);
|
||||
tips_x=findViewById(R.id.tips_x);
|
||||
Bundle ins=getIntent().getExtras();
|
||||
index=ins.getInt("type");
|
||||
wid=ins.getString("wid");
|
||||
h_type=ins.getInt("h_type");
|
||||
keys=ins.getBoolean("keys");
|
||||
sobStr=getIntent().getExtras().getString("sob");
|
||||
//Log.e("---sdwStr--",sdwStr);
|
||||
sob=new Gson().fromJson(sobStr, StartOrderBean.class);
|
||||
initView(null);
|
||||
customDialog=new CustomDialog(con, "正在定位当前位置...");
|
||||
customDialog.show();
|
||||
lgdu=new LocationGDUtil(con,hd);
|
||||
//启动定位
|
||||
lgdu.onCreate();
|
||||
lu=new LocationUtil(con,hd);
|
||||
lu.onCreate();
|
||||
if (keys){
|
||||
lu=new LocationUtil(con,hd);
|
||||
lu.onCreate();
|
||||
}
|
||||
tv_loaction.setOnClickListener(v -> {
|
||||
if (!locationKey){
|
||||
customDialog.show();
|
||||
lgdu.onCreate();
|
||||
}
|
||||
});
|
||||
hyr=new HuoYuanRequset(con,hd);
|
||||
// if (!NfcUtils.hasNfc(con)) {
|
||||
// Toast.makeText(con,"请先开启nfc",Toast.LENGTH_LONG).show();
|
||||
// }else{
|
||||
// initData();
|
||||
// }
|
||||
}
|
||||
|
||||
public void initData() {
|
||||
//nfc初始化设置
|
||||
NfcUtils nfcUtils = new NfcUtils(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView(Object obj) {
|
||||
super.initView(obj);
|
||||
name_top.setText("上传"+names[index]+"照片");
|
||||
name_body.setText(names[index]+"照片");
|
||||
if(index==1){
|
||||
tips.setVisibility(View.VISIBLE);
|
||||
tips_x.setVisibility(View.VISIBLE);
|
||||
}
|
||||
submit.setOnClickListener(v -> {
|
||||
if(imgIds.size()!=0){
|
||||
typeRequest();
|
||||
}else{
|
||||
Toast.makeText(con,"请先上传一张图片",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
getImg.setOnClickListener(v -> {
|
||||
if(key){
|
||||
Log.e("--imgIds.size()--",imgIds.size()+"");
|
||||
gia.showPopueWindow(this,true);
|
||||
// gia.showPopueWindow(this,index==2);
|
||||
}else{
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(res_img, ub.getData().getUrl(), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(res_img, ub.getData().getUrl(), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
Toast.makeText(con,"查看了照片", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
img_delete.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
imgIds=new ArrayList<>();
|
||||
ub=new UploadBean();
|
||||
res_img.setVisibility(View.GONE);
|
||||
img_delete.setVisibility(View.GONE);
|
||||
img_icon.setVisibility(View.VISIBLE);
|
||||
key=true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
String path;
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == 12 && resultCode == RESULT_OK) {
|
||||
if (null==gia.getFile()){
|
||||
new ToastUtil(con, Gravity.CENTER,"图片选择失败").show(Toast.LENGTH_SHORT);
|
||||
return;
|
||||
}
|
||||
path=gia.getFile().getPath();
|
||||
Log.e("图片地址:",path);
|
||||
gia.dis();
|
||||
ImageFileCompressUtil.imageFileCompress(con,new File(path),hd);
|
||||
} else if (requestCode == PictureConfig.CHOOSE_REQUEST && resultCode == RESULT_OK) {
|
||||
List<LocalMedia> imgs = PictureSelector.obtainMultipleResult(data);
|
||||
if (imgs != null && imgs.size() > 0) {
|
||||
LocalMedia image = imgs.get(0);
|
||||
|
||||
String paths = image.getAndroidQToPath();
|
||||
if (TextUtils.isEmpty(paths)) {
|
||||
paths = image.getPath();
|
||||
}
|
||||
path=paths;
|
||||
Log.e("图片地址:",path);
|
||||
gia.dis();
|
||||
ImageFileCompressUtil.imageFileCompress(con,new File(path),hd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void initLocation(){
|
||||
address.setText(lgdu.getAddress());
|
||||
}
|
||||
|
||||
public void typeRequest(){
|
||||
// for(int i=0;i<imgIds.size();i++){
|
||||
// Log.e("--imgIds--",imgIds.get(i)+"");
|
||||
// }
|
||||
switch (index){
|
||||
case 0:
|
||||
//装货
|
||||
if(imgIds!=null && imgIds.size()>0) {
|
||||
lub.setLatitude(lgdu.getLatitude() + "");
|
||||
lub.setLongitude(lgdu.getLongitude() + "");
|
||||
lub.setLocationAddress(lgdu.getAddress());
|
||||
lub.setImageId(imgIds);
|
||||
lub.setWaybillId(wid);
|
||||
Log.e("--装货信息", gson.toJson(lub));
|
||||
if(locationKey){
|
||||
// hyr.loading(lub);
|
||||
if(keys){
|
||||
nfc();
|
||||
up_traffic_start();
|
||||
up_image_z();
|
||||
}
|
||||
}else{
|
||||
Toast.makeText(con,"定位异常,请重新定位",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}else{
|
||||
Toast.makeText(con,"图片上传异常,请重新上传",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if(imgIds!=null && imgIds.size()>0) {
|
||||
//卸货
|
||||
lub.setLatitude(lgdu.getLatitude() + "");
|
||||
lub.setLongitude(lgdu.getLongitude() + "");
|
||||
lub.setLocationAddress(lgdu.getAddress());
|
||||
lub.setImageId(imgIds);
|
||||
lub.setWaybillId(wid);
|
||||
Log.e("--卸货信息", gson.toJson(lub));
|
||||
if(locationKey){
|
||||
if(keys){
|
||||
nfc();
|
||||
up_traffic_end();
|
||||
up_image();
|
||||
}
|
||||
// hyr.dischargeCargo(lub);
|
||||
}else{
|
||||
Toast.makeText(con,"定位异常,请重新定位",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}else{
|
||||
Toast.makeText(con,"图片上传异常,请重新上传",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(imgIds!=null && imgIds.size()>0){//卸货回单
|
||||
//上传回单
|
||||
urib.setLatitude(lgdu.getLatitude()+"");
|
||||
urib.setLongitude(lgdu.getLongitude()+"");
|
||||
urib.setLocationAddress(lgdu.getAddress());
|
||||
//装卸货类型
|
||||
urib.setType(h_type+1);
|
||||
//回单id 数组
|
||||
urib.setReceiptId(imgIds);
|
||||
//子运运单ID
|
||||
urib.setWaybillId(wid);
|
||||
Log.e("--回单信息",gson.toJson(urib));
|
||||
if(locationKey) {
|
||||
if (index == 2 && keys) {
|
||||
up_trafficSign();
|
||||
up_trafficReceipt();
|
||||
receipt_image();
|
||||
}
|
||||
// hyr.receipt(urib);
|
||||
}else{
|
||||
Toast.makeText(con,"定位异常,请重新定位",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}else{
|
||||
Toast.makeText(con,"图片上传异常,请重新上传",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
}
|
||||
|
||||
private StartOrderBean sob;
|
||||
|
||||
//上传安联和交通厅-装货
|
||||
public void up_traffic_start(){
|
||||
//安联
|
||||
if(sob.getData().getReportAlct()==1) {
|
||||
|
||||
StartOrderBean.DataDTO.WayChildrenDTO data = new StartOrderBean.DataDTO.WayChildrenDTO();
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||
if (wayChild.getType()==1){
|
||||
data = wayChild;
|
||||
}
|
||||
}
|
||||
|
||||
Location l = new Location();
|
||||
l.setBaiduLongitude(Double.parseDouble(data.getLongitude()));
|
||||
l.setBaiduLatitude(Double.parseDouble(data.getLatitude()));
|
||||
l.setLocation(data.getAddress());
|
||||
l.setTime(data.getImageTakenDate());
|
||||
MDPLocationCollectionManager.pickup(con,sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "装货上传成功");
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,"装货上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(装货):", s + s1);
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,s + s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
//交通厅
|
||||
if(sob.getData().getReport()==1){
|
||||
JTTProcess.start(con,sob,"");
|
||||
}
|
||||
}
|
||||
|
||||
public void nfc(){
|
||||
// if(sob.getData().getNfcId().equals(nfcStr)){
|
||||
// Toast.makeText(con,"nfcId匹配失败",Toast.LENGTH_LONG).show();
|
||||
// }
|
||||
if("".equals(sob.getData().getNfcId()) || sob.getData().getNfcId()==null){
|
||||
return;
|
||||
}
|
||||
MDPLocationCollectionManager.checkNfc(con, sob.getData().getShippingNoteNumber(),
|
||||
sob.getData().getNfcId(), new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Toast.makeText(con,"nfcId匹配成功",Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("不匹配",""+s+s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//上传安联和交通厅-卸货
|
||||
public void up_traffic_end(){
|
||||
//安联
|
||||
if(sob.getData().getReportAlct()==1){
|
||||
StartOrderBean.DataDTO.WayChildrenDTO data = new StartOrderBean.DataDTO.WayChildrenDTO();
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||
if (wayChild.getType()==2){
|
||||
data = wayChild;
|
||||
}
|
||||
}
|
||||
Location l=new Location();
|
||||
l.setBaiduLongitude(Double.parseDouble(data.getLongitude()));
|
||||
l.setBaiduLatitude(Double.parseDouble(data.getLatitude()));
|
||||
l.setLocation(data.getAddress());
|
||||
l.setTime(data.getImageTakenDate());
|
||||
Log.e("-安联卸货信息-",gson.toJson(l));
|
||||
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联","卸货上传成功");
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,"卸货上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(卸货):",s+s1);
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,s+s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
//交通厅
|
||||
if(sob.getData().getReport()==1){
|
||||
JTTProcess.stop(con,sob,"");
|
||||
}
|
||||
}
|
||||
|
||||
//上传安联-签收
|
||||
public void up_trafficSign(){
|
||||
StartOrderBean.DataDTO.WayChildrenDTO data = new StartOrderBean.DataDTO.WayChildrenDTO();
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||
if (wayChild.getType()==2){
|
||||
data = wayChild;
|
||||
}
|
||||
}
|
||||
//安联
|
||||
Location l=new Location();
|
||||
l.setBaiduLongitude(Double.parseDouble(data.getLongitude()));
|
||||
l.setBaiduLatitude(Double.parseDouble(data.getLatitude()));
|
||||
l.setLocation(data.getAddress());
|
||||
l.setTime(data.getImageTakenDate());
|
||||
List<Goods> gs=new ArrayList<>();
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||
if(wid.equals(wayChild.getId()+"")){
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO.GoodsDTO good : wayChild.getGoods()) {
|
||||
Goods g=new Goods();
|
||||
g.setGoodsName(good.getGoodName());
|
||||
g.setUnit(good.getGoodUnit());
|
||||
g.setItemNo(good.getId());
|
||||
//实收
|
||||
g.setQuantity(1);
|
||||
//应收
|
||||
g.setReceivedQuantity(1);
|
||||
//破损
|
||||
g.setDamageQuantity(1);
|
||||
//丢失
|
||||
g.setQuantity(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
MDPLocationCollectionManager.sign(con, sob.getData().getShippingNoteNumber(), l,gs, new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联","签收成功");
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,"签收成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,s+s1);
|
||||
Log.e("上报安联失败(签收):",s+s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//上传安联-回单
|
||||
public void up_trafficReceipt(){
|
||||
StartOrderBean.DataDTO.WayChildrenDTO data = new StartOrderBean.DataDTO.WayChildrenDTO();
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||
if (wayChild.getType()==2){
|
||||
data = wayChild;
|
||||
}
|
||||
}
|
||||
//安联
|
||||
Location l=new Location();
|
||||
l.setBaiduLongitude(Double.parseDouble(data.getLongitude()));
|
||||
l.setBaiduLatitude(Double.parseDouble(data.getLatitude()));
|
||||
l.setLocation(data.getAddress());
|
||||
l.setTime(data.getImageTakenDate());
|
||||
MDPLocationCollectionManager.pod(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联","回单上传成功");
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,"回单上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(回单):",s+s1);
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,s+s1);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public void up_image_z(){
|
||||
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||
|
||||
StartOrderBean.DataDTO.WayChildrenDTO data = new StartOrderBean.DataDTO.WayChildrenDTO();
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||
if (wayChild.getType()==1){
|
||||
data = wayChild;
|
||||
}
|
||||
}
|
||||
|
||||
File file=new File(path);
|
||||
Image image=new Image();
|
||||
String base= BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/"+ FileUtil.lastName(file) +";base64,"+base);
|
||||
image.setFileExt(FileUtil.lastName(file));
|
||||
image.setFileName(FileUtil.fileName(file));
|
||||
image.setImageTakenDate(data.getImageTakenDate());
|
||||
image.setBaiduLongitude(Double.parseDouble(data.getLongitude()));
|
||||
image.setBaiduLatitude(Double.parseDouble(data.getLatitude()));
|
||||
image.setLocation(data.getAddress());
|
||||
MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联","装货照片上传成功");
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,"装货照片上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(装货照片):",s+s1);
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,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(){
|
||||
|
||||
StartOrderBean.DataDTO.WayChildrenDTO data = new StartOrderBean.DataDTO.WayChildrenDTO();
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||
if (wayChild.getType()==2){
|
||||
data = wayChild;
|
||||
}
|
||||
}
|
||||
|
||||
File file=new File(path);
|
||||
Image image=new Image();
|
||||
String base= BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/"+ FileUtil.lastName(file) +";base64,"+base);
|
||||
image.setFileExt(FileUtil.lastName(file));
|
||||
image.setFileName(FileUtil.fileName(file));
|
||||
image.setImageTakenDate(data.getImageTakenDate());
|
||||
image.setBaiduLongitude(Double.parseDouble(data.getLongitude()));
|
||||
image.setBaiduLatitude(Double.parseDouble(data.getLatitude()));
|
||||
image.setLocation(data.getAddress());
|
||||
MDPLocationCollectionManager.uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联","卸货照片上传成功");
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,"卸货照片上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(卸货照片):",s+s1);
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,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
|
||||
StartOrderBean.DataDTO.WayChildrenDTO data = new StartOrderBean.DataDTO.WayChildrenDTO();
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||
if (wayChild.getType()==2){
|
||||
data = wayChild;
|
||||
}
|
||||
}
|
||||
|
||||
File file=new File(path);
|
||||
Image image=new Image();
|
||||
String base= BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/"+ FileUtil.lastName(file) +";base64,"+base);
|
||||
image.setFileExt(FileUtil.lastName(file));
|
||||
image.setFileName(FileUtil.fileName(file));
|
||||
image.setImageTakenDate(data.getImageTakenDate());
|
||||
image.setBaiduLongitude(Double.parseDouble(data.getLongitude()));
|
||||
image.setBaiduLatitude(Double.parseDouble(data.getLatitude()));
|
||||
image.setLocation(data.getAddress());
|
||||
MDPLocationCollectionManager.uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联","回单照片上传成功");
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,"回单照片上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(回单照片):",s+s1);
|
||||
ToastUtils.showToast(ShangChuangImgActivity2.this,s+s1);
|
||||
// SPUtil.insSP(con,"make","回单",sob.getData().getShippingNoteNumber());
|
||||
//// SPUtil.insSP(con,"make","回单-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||
//// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||
//// startService(serviceIn);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
//开启前台调度系统
|
||||
//NfcUtils.mNfcAdapter.enableForegroundDispatch(this, NfcUtils.mPendingIntent, NfcUtils.mIntentFilter, NfcUtils.mTechList);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
//关闭前台调度系统
|
||||
//NfcUtils.mNfcAdapter.disableForegroundDispatch(this);
|
||||
}
|
||||
|
||||
String nfcStr="";
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
//当该Activity接收到NFC标签时,运行该方法
|
||||
//调用工具方法,读取NFC数据
|
||||
try {
|
||||
nfcStr = NfcUtils.readNFCId(intent);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Log.e("nfc",nfcStr);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
-889
@@ -1,889 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.SimpleAdapter;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alct.mdp.MDPLocationCollectionManager;
|
||||
import com.alct.mdp.callback.OnResultListener;
|
||||
import com.alct.mdp.model.Goods;
|
||||
import com.alct.mdp.model.Image;
|
||||
import com.alct.mdp.model.Location;
|
||||
import com.amap.api.maps.CameraUpdateFactory;
|
||||
import com.amap.api.services.core.AMapException;
|
||||
import com.amap.api.services.core.LatLonPoint;
|
||||
import com.amap.api.services.geocoder.GeocodeAddress;
|
||||
import com.amap.api.services.geocoder.GeocodeQuery;
|
||||
import com.amap.api.services.geocoder.GeocodeResult;
|
||||
import com.amap.api.services.geocoder.GeocodeSearch;
|
||||
import com.amap.api.services.geocoder.RegeocodeResult;
|
||||
import com.amap.api.services.help.Inputtips;
|
||||
import com.amap.api.services.help.InputtipsQuery;
|
||||
import com.amap.api.services.help.Tip;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.StartOrderBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.UploadBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.OCRRequest;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.UploadReceiptInputBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.BitmapUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.file.FileUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.file.ImageFileCompressUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.img.GetCarImageAlert;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.location.LocationGDUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.location.LocationUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.time.Timer;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
import com.baidu.mapapi.model.LatLng;
|
||||
import com.baidu.mapapi.utils.CoordinateConverter;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.github.gzuliyujiang.wheelpicker.DatePicker;
|
||||
import com.github.gzuliyujiang.wheelpicker.DatimePicker;
|
||||
import com.github.gzuliyujiang.wheelpicker.annotation.DateMode;
|
||||
import com.github.gzuliyujiang.wheelpicker.annotation.TimeMode;
|
||||
import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener;
|
||||
import com.github.gzuliyujiang.wheelpicker.contract.OnDatimePickedListener;
|
||||
import com.github.gzuliyujiang.wheelpicker.entity.DateEntity;
|
||||
import com.github.gzuliyujiang.wheelpicker.entity.DatimeEntity;
|
||||
import com.google.gson.Gson;
|
||||
import com.luck.picture.lib.PictureSelector;
|
||||
import com.luck.picture.lib.config.PictureConfig;
|
||||
import com.luck.picture.lib.entity.LocalMedia;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.interfaces.OnSelectListener;
|
||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements Inputtips.InputtipsListener {
|
||||
|
||||
private TextView submit, name_top, name_body, address, tips, tips_x,tvDate,tvLocation;
|
||||
private RelativeLayout getImg;
|
||||
private EditText etAddress;
|
||||
private Button btnOk;
|
||||
private ImageView res_img, img_icon, img_delete;
|
||||
private String[] names = {"装货", "卸货", "回单"};
|
||||
public static String[] TYPE_NAME = {"zhuanghuo", "xiehuo", "huidan"};
|
||||
private int index = 0;
|
||||
//
|
||||
private Gson gson = new Gson();
|
||||
//
|
||||
private LUInputBean lub = new LUInputBean();
|
||||
private UploadReceiptInputBean urib = new UploadReceiptInputBean();
|
||||
private LocationGDUtil lgdu;
|
||||
public LocationUtil lu;
|
||||
private List<Integer> imgIds = new ArrayList<>();
|
||||
private UploadBean ub;
|
||||
private HuoYuanRequset hyr;
|
||||
//
|
||||
private GetCarImageAlert gia = new GetCarImageAlert();
|
||||
private CustomDialog customDialog;
|
||||
private int id = 0;
|
||||
private boolean key = true;
|
||||
private boolean keys = false;
|
||||
private boolean locationKey = false;
|
||||
private TextView tv_loaction;
|
||||
|
||||
|
||||
private String selDate;
|
||||
private GeocodeSearch geocoderSearch;
|
||||
|
||||
private TempLoca tempLoca = new TempLoca();
|
||||
private TempLoca tempLocaBd = new TempLoca();
|
||||
|
||||
|
||||
@Override
|
||||
public void onGetInputtips(List<Tip> tipList, int rCode) {
|
||||
if (rCode == AMapException.CODE_AMAP_SUCCESS) {
|
||||
List<String> names = new ArrayList<String>();
|
||||
if(tipList != null) {
|
||||
int size = tipList.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
Tip tip = tipList.get(i);
|
||||
if(tip != null) {
|
||||
names.add(tip.getDistrict()+tip.getName());
|
||||
}
|
||||
}
|
||||
|
||||
new XPopup.Builder(this)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||
.hasShadowBg(false) // 去掉半透明背景
|
||||
.atView(etAddress)
|
||||
.asAttachList(names.toArray(new String[0]), new int[]{}, new OnSelectListener() {
|
||||
@Override
|
||||
public void onSelect(int position, String text) {
|
||||
Tip tip = tipList.get(position);
|
||||
etAddress.setText(tip.getDistrict()+tip.getAddress()+tip.getName());
|
||||
LatLonPoint latLonPoint = tip.getPoint();
|
||||
tempLoca.setAddress(etAddress.getText().toString());
|
||||
tempLoca.setLatitude(latLonPoint.getLatitude());
|
||||
tempLoca.setLongitude(latLonPoint.getLongitude());
|
||||
tempLoca.setTime(tvDate.getText().toString());
|
||||
|
||||
LatLng latLng = convertGPSToBaidu(new LatLng(latLonPoint.getLatitude(), latLonPoint.getLongitude()));
|
||||
tempLocaBd.setLongitude(latLng.longitude);
|
||||
tempLocaBd.setLatitude(latLng.latitude);
|
||||
tempLocaBd.setAddress(etAddress.getText().toString());
|
||||
tempLocaBd.setTime(tvDate.getText().toString());
|
||||
|
||||
}
|
||||
})
|
||||
.show();
|
||||
|
||||
|
||||
|
||||
// SimpleAdapter aAdapter = new SimpleAdapter(getApplicationContext(), listString, R.layout.item_layout,
|
||||
// new String[]{"name", "address"}, new int[]{R.id.poi_field_id, R.id.poi_value_id});
|
||||
//
|
||||
// minputlist.setAdapter(aAdapter);
|
||||
// aAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
class TempLoca{
|
||||
private double latitude;
|
||||
private double longitude;
|
||||
private String address;
|
||||
private String time;
|
||||
|
||||
public TempLoca() {
|
||||
|
||||
}
|
||||
|
||||
public TempLoca(double latitude, double longitude, String address, String time) {
|
||||
this.latitude = latitude;
|
||||
this.longitude = longitude;
|
||||
this.address = address;
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public double getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
public void setLatitude(double latitude) {
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
public double getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public void setLongitude(double longitude) {
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(String time) {
|
||||
this.time = time;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void msgMethod(Message m) {
|
||||
super.msgMethod(m);
|
||||
switch (m.what) {
|
||||
case RequsetCodeConstants.SUCCESS:
|
||||
if (CacheGroup.cacheList.get("upload") != null) {
|
||||
Log.e("upload", CacheGroup.cacheList.get("upload"));
|
||||
ub = gson.fromJson(CacheGroup.cacheList.remove("upload"), UploadBean.class);
|
||||
if (ub.getCode() == 200) {
|
||||
imgIds.add(ub.getData().getId());
|
||||
Glide.with(con).load(ub.getData().getUrl()).into(res_img);
|
||||
res_img.setVisibility(View.VISIBLE);
|
||||
img_delete.setVisibility(View.VISIBLE);
|
||||
img_icon.setVisibility(View.GONE);
|
||||
key = false;
|
||||
} else {
|
||||
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove("upload");
|
||||
}
|
||||
for (int i = 0; i < TYPE_NAME.length; i++) {
|
||||
if (CacheGroup.cacheList.get(TYPE_NAME[i]) != null) {
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
if (index == 2) {
|
||||
if (!keys){//装货回单
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove(TYPE_NAME[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (CacheGroup.cacheList.get("carName") != null) {
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("carName"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
|
||||
}
|
||||
CacheGroup.cacheList.remove("carName");
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("carNum") != null) {
|
||||
Log.e("upload", CacheGroup.cacheList.get("carNum"));
|
||||
CarInfoBean ub = gson.fromJson(CacheGroup.cacheList.remove("carNum"), CarInfoBean.class);
|
||||
if (ub.getCode() == 200 && ub.getData().getData().getPrism_keyValueInfo().size() > 0) {
|
||||
String value = ub.getData().getData().getPrism_keyValueInfo().get(0).getValue();
|
||||
String forceMatching = ub.getData().getForceMatching();
|
||||
if ("1".equals(forceMatching)) {//是否强校验车牌号 1:强校验
|
||||
if (sob.getData().getCarNumber().equals(value)) {
|
||||
hyr.uploadFile(new File(path));
|
||||
} else {
|
||||
new MessageUtils().showCenMessage(ShangChuangImgActivityBC.this, "车牌号不匹配!", "请重新拍照或联系管理员");
|
||||
}
|
||||
} else {
|
||||
hyr.uploadFile(new File(path));
|
||||
}
|
||||
} else {//识别失败后返回code500
|
||||
if (index == 0) {//装卸货车辆需要识别车牌号){
|
||||
Toast.makeText(con, "装货照片包含车牌号、三分之二车身或者装卸货场景。", Toast.LENGTH_SHORT).show();
|
||||
} else if (index == 1) {
|
||||
Toast.makeText(con, "卸货照片包含车牌号、三分之二车身或者装卸货场景。", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}
|
||||
CacheGroup.cacheList.remove("carNum");
|
||||
}
|
||||
break;
|
||||
case 14://定位成功
|
||||
locationKey = true;
|
||||
customDialog.dismiss();
|
||||
tv_loaction.setText("定位成功");
|
||||
tv_loaction.setTextColor(getResources().getColor(R.color.theme_color, null));
|
||||
latLng = convertGPSToBaidu(new LatLng(lgdu.getLatitude(), lgdu.getLongitude()));
|
||||
initLocation();
|
||||
break;
|
||||
case 16://定位失败
|
||||
locationKey = false;
|
||||
customDialog.dismiss();
|
||||
tv_loaction.setText("定位失败,点击重试");
|
||||
tv_loaction.setTextColor(getResources().getColor(R.color.loaction_no_color, null));
|
||||
Toast.makeText(con, "定位失败,请确认开启定位后重试!", Toast.LENGTH_LONG).show();
|
||||
//定位结果接收
|
||||
//finish();
|
||||
break;
|
||||
case 15:
|
||||
break;
|
||||
|
||||
case ImageFileCompressUtil.COMPRESS_SUCCESS:
|
||||
path = (String) m.obj;
|
||||
Log.e("res:", "选定图片结果");
|
||||
Log.e("res:", path);
|
||||
//选定图片结果
|
||||
// if(index==1 || index==2){
|
||||
// new OCRRequest().OCRPlateLicense(con,hd,new File(path));
|
||||
// }
|
||||
if (index == 0 || index == 1) {//装卸货车辆需要识别车牌号
|
||||
new OCRRequest().OCRCarPlateLicense(con, hd, new File(path));
|
||||
} else {
|
||||
hyr.uploadFile(new File(path));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
private LatLng latLng;
|
||||
|
||||
public LatLng convertGPSToBaidu(LatLng srLatLng) {
|
||||
CoordinateConverter converter = new CoordinateConverter();
|
||||
converter.from(CoordinateConverter.CoordType.COMMON);
|
||||
converter.coord(srLatLng);
|
||||
return converter.convert();
|
||||
}
|
||||
|
||||
private String wid;
|
||||
private int h_type;
|
||||
String sobStr = "";
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
StateStyleUtil.stateTextColor(this);
|
||||
setContentView(R.layout.activity_shangchuan_bc);
|
||||
con = this;
|
||||
submit = findViewById(R.id.submit);
|
||||
name_top = findViewById(R.id.name_top);
|
||||
name_body = findViewById(R.id.name_body);
|
||||
address = findViewById(R.id.address);
|
||||
getImg = findViewById(R.id.getImg);
|
||||
res_img = findViewById(R.id.res_img);
|
||||
img_icon = findViewById(R.id.img_icon);
|
||||
img_delete = findViewById(R.id.img_delete);
|
||||
tv_loaction = findViewById(R.id.tv_loaction);
|
||||
btnOk = findViewById(R.id.btnOk);
|
||||
etAddress = findViewById(R.id.etAddress);
|
||||
tvDate = findViewById(R.id.tvDate);
|
||||
tvLocation = findViewById(R.id.tvLocation);
|
||||
tips = findViewById(R.id.tips);
|
||||
tips_x = findViewById(R.id.tips_x);
|
||||
Bundle ins = getIntent().getExtras();
|
||||
index = ins.getInt("type");
|
||||
wid = ins.getString("wid");
|
||||
h_type = ins.getInt("h_type");
|
||||
keys = ins.getBoolean("keys");
|
||||
sobStr = getIntent().getExtras().getString("sob");
|
||||
//Log.e("---sdwStr--",sdwStr);
|
||||
sob = new Gson().fromJson(sobStr, StartOrderBean.class);
|
||||
initView(null);
|
||||
customDialog = new CustomDialog(con, "正在定位当前位置...");
|
||||
customDialog.show();
|
||||
lgdu = new LocationGDUtil(con, hd);
|
||||
//启动定位
|
||||
lgdu.onCreate();
|
||||
tv_loaction.setOnClickListener(v -> {
|
||||
if (!locationKey) {
|
||||
customDialog.show();
|
||||
lgdu.onCreate();
|
||||
}
|
||||
});
|
||||
|
||||
btnOk.setOnClickListener(v -> {
|
||||
String s = etAddress.getText().toString();
|
||||
if (TextUtils.isEmpty(selDate)){
|
||||
ToastUtils.showToast(this,"请先选择时间");
|
||||
return;
|
||||
}
|
||||
if (!TextUtils.isEmpty(s)&&s.length()>=4){
|
||||
|
||||
InputtipsQuery inputquery = new InputtipsQuery(s, "");
|
||||
// inputquery.setCityLimit(true);
|
||||
Inputtips inputTips = new Inputtips(this, inputquery);
|
||||
inputTips.setInputtipsListener(this);
|
||||
inputTips.requestInputtipsAsyn();
|
||||
|
||||
|
||||
// GeocodeQuery query = new GeocodeQuery(s, "100000");// 第一个参数表示地址,第二个参数表示查询城市,中文或者中文全拼,citycode、adcode,
|
||||
// geocoderSearch.getFromLocationNameAsyn(query);// 设置同步地理编码请求
|
||||
}else{
|
||||
ToastUtils.showToast(this,"请输入地址且长度大于4");
|
||||
}
|
||||
});
|
||||
|
||||
tvDate.setOnClickListener(v -> {
|
||||
|
||||
DatimePicker datimePicker = new DatimePicker(this);
|
||||
datimePicker.setBodyWidth(300);
|
||||
datimePicker.getWheelLayout().setRange(DatimeEntity.yearOnFuture(-1),DatimeEntity.yearOnFuture(10),DatimeEntity.now());
|
||||
datimePicker.setOnDatimePickedListener((year, month, day, hour, minute, second) -> {
|
||||
selDate = year+"-"+month+"-"+day+" "+ hour+":"+minute;
|
||||
tvDate.setText(selDate);
|
||||
});
|
||||
datimePicker.getWheelLayout().setDateLabel("年", "月", "日");
|
||||
datimePicker.getWheelLayout().setTimeLabel("时","分","");
|
||||
datimePicker.getWheelLayout().setTimeMode(TimeMode.HOUR_24_NO_SECOND);
|
||||
datimePicker.show();
|
||||
});
|
||||
|
||||
hyr = new HuoYuanRequset(con, hd);
|
||||
}
|
||||
|
||||
public void initData() {
|
||||
//nfc初始化设置
|
||||
NfcUtils nfcUtils = new NfcUtils(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView(Object obj) {
|
||||
super.initView(obj);
|
||||
name_top.setText("上传" + names[index] + "照片");
|
||||
name_body.setText(names[index] + "照片");
|
||||
if (index == 1) {
|
||||
tips.setVisibility(View.VISIBLE);
|
||||
tips_x.setVisibility(View.VISIBLE);
|
||||
}
|
||||
submit.setOnClickListener(v -> {
|
||||
if (imgIds.size() != 0) {
|
||||
typeRequest();
|
||||
} else {
|
||||
Toast.makeText(con, "请先上传一张图片", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
getImg.setOnClickListener(v -> {
|
||||
if (key) {
|
||||
Log.e("--imgIds.size()--", imgIds.size() + "");
|
||||
gia.showPopueWindow(this, true);
|
||||
} else {
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(res_img, ub.getData().getUrl(), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(res_img, ub.getData().getUrl(), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
Toast.makeText(con, "查看了照片", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
img_delete.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
imgIds = new ArrayList<>();
|
||||
ub = new UploadBean();
|
||||
res_img.setVisibility(View.GONE);
|
||||
img_delete.setVisibility(View.GONE);
|
||||
img_icon.setVisibility(View.VISIBLE);
|
||||
key = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
String path;
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == 12 && resultCode == RESULT_OK) {
|
||||
if (null == gia.getFile()) {
|
||||
new ToastUtil(con, Gravity.CENTER, "图片选择失败").show(Toast.LENGTH_SHORT);
|
||||
return;
|
||||
}
|
||||
path = gia.getFile().getPath();
|
||||
Log.e("图片地址:", path);
|
||||
gia.dis();
|
||||
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||
} else if (requestCode == PictureConfig.CHOOSE_REQUEST && resultCode == RESULT_OK) {
|
||||
List<LocalMedia> imgs = PictureSelector.obtainMultipleResult(data);
|
||||
if (imgs != null && imgs.size() > 0) {
|
||||
LocalMedia image = imgs.get(0);
|
||||
|
||||
String paths = image.getAndroidQToPath();
|
||||
if (TextUtils.isEmpty(paths)) {
|
||||
paths = image.getPath();
|
||||
}
|
||||
path = paths;
|
||||
Log.e("图片地址:", path);
|
||||
gia.dis();
|
||||
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void initLocation() {
|
||||
address.setText(lgdu.getAddress());
|
||||
}
|
||||
|
||||
public void typeRequest() {
|
||||
// for(int i=0;i<imgIds.size();i++){
|
||||
// Log.e("--imgIds--",imgIds.get(i)+"");
|
||||
// }
|
||||
switch (index) {
|
||||
case 0:
|
||||
//装货
|
||||
if (imgIds != null && imgIds.size() > 0) {
|
||||
lub.setLatitude(tempLoca.getLatitude() + "");
|
||||
lub.setLongitude(tempLoca.getLongitude() + "");
|
||||
lub.setLocationAddress(tempLoca.getAddress());
|
||||
lub.setImageId(imgIds);
|
||||
lub.setWaybillId(wid);
|
||||
Log.e("--装货信息", gson.toJson(lub));
|
||||
if (locationKey) {//高德定位
|
||||
if (keys) {
|
||||
nfc();
|
||||
loadInfo();
|
||||
// up_traffic_start();
|
||||
// up_image_z();
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
} else {
|
||||
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (imgIds != null && imgIds.size() > 0) {
|
||||
//卸货
|
||||
lub.setLatitude(tempLoca.getLatitude() + "");
|
||||
lub.setLongitude(tempLoca.getLongitude() + "");
|
||||
lub.setLocationAddress(tempLoca.getAddress());
|
||||
lub.setImageId(imgIds);
|
||||
lub.setWaybillId(wid);
|
||||
lub.setRealLoadTime(tempLoca.getTime());
|
||||
Log.e("--卸货信息", gson.toJson(lub));
|
||||
if (locationKey&&!TextUtils.isEmpty(tempLoca.address)) {
|
||||
if (keys) {
|
||||
nfc();
|
||||
uploadInfo();
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
} else {
|
||||
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (imgIds != null && imgIds.size() > 0) {//卸货回单
|
||||
//上传回单
|
||||
urib.setLatitude(lgdu.getLatitude() + "");
|
||||
urib.setLongitude(lgdu.getLongitude() + "");
|
||||
urib.setLocationAddress(lgdu.getAddress());
|
||||
//装卸货类型
|
||||
urib.setType(h_type + 1);
|
||||
//回单id 数组
|
||||
urib.setReceiptId(imgIds);
|
||||
//子运运单ID
|
||||
urib.setWaybillId(wid);
|
||||
Log.e("--回单信息", gson.toJson(urib));
|
||||
if (locationKey) {
|
||||
if (index == 2 && keys && !TextUtils.isEmpty(tempLoca.address)) {
|
||||
up_trafficSign();
|
||||
up_trafficReceipt();
|
||||
receipt_image();
|
||||
}
|
||||
hyr.receipt(urib);
|
||||
} else {
|
||||
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private StartOrderBean sob;
|
||||
|
||||
public void nfc() {
|
||||
// if(sob.getData().getNfcId().equals(nfcStr)){
|
||||
// Toast.makeText(con,"nfcId匹配失败",Toast.LENGTH_LONG).show();
|
||||
// }
|
||||
if ("".equals(sob.getData().getNfcId()) || sob.getData().getNfcId() == null) {
|
||||
return;
|
||||
}
|
||||
MDPLocationCollectionManager.checkNfc(con, sob.getData().getShippingNoteNumber(),
|
||||
sob.getData().getNfcId(), new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Toast.makeText(con, "nfcId匹配成功", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("不匹配", "" + s + s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//上传安联-签收
|
||||
public void up_trafficSign() {
|
||||
//安联
|
||||
Location l = new Location();
|
||||
l.setBaiduLongitude(tempLocaBd.longitude);
|
||||
l.setBaiduLatitude(tempLocaBd.latitude);
|
||||
l.setLocation(tempLocaBd.getAddress());
|
||||
l.setTime(tempLocaBd.getTime());
|
||||
List<Goods> gs = new ArrayList<>();
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||
if (wid.equals(wayChild.getId() + "")) {
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO.GoodsDTO good : wayChild.getGoods()) {
|
||||
Goods g = new Goods();
|
||||
g.setGoodsName(good.getGoodName());
|
||||
g.setUnit(good.getGoodUnit());
|
||||
g.setItemNo(good.getId());
|
||||
//实收
|
||||
g.setQuantity(1);
|
||||
//应收
|
||||
g.setReceivedQuantity(1);
|
||||
//破损
|
||||
g.setDamageQuantity(1);
|
||||
//丢失
|
||||
g.setQuantity(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
MDPLocationCollectionManager.sign(con, sob.getData().getShippingNoteNumber(), l, gs, new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "签收成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(签收):", s + s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//上传安联-回单
|
||||
public void up_trafficReceipt() {
|
||||
//安联
|
||||
Location l = new Location();
|
||||
l.setBaiduLongitude(tempLocaBd.longitude);
|
||||
l.setBaiduLatitude(tempLocaBd.latitude);
|
||||
l.setLocation(tempLocaBd.getAddress());
|
||||
l.setTime(tempLocaBd.getTime());
|
||||
MDPLocationCollectionManager.pod(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "回单上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(回单):", s + s1);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public void up_image_z() {
|
||||
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||
File file = new File(path);
|
||||
Image image = new Image();
|
||||
String base = BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||
image.setFileExt(FileUtil.lastName(file));
|
||||
image.setFileName(FileUtil.fileName(file));
|
||||
image.setImageTakenDate(Timer.getTimerT());
|
||||
image.setBaiduLongitude(tempLocaBd.longitude);
|
||||
image.setBaiduLatitude(tempLocaBd.latitude);
|
||||
image.setLocation(tempLocaBd.getAddress());
|
||||
MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "装货照片上传成功");
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(装货照片):", s + s1);
|
||||
// SPUtil.insSP(con,"make","装货",sob.getData().getShippingNoteNumber());
|
||||
// SPUtil.insSP(con,"make","装货-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||
// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||
// startService(serviceIn);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public void up_image() {
|
||||
File file = new File(path);
|
||||
Image image = new Image();
|
||||
String base = BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||
image.setFileExt(FileUtil.lastName(file));
|
||||
image.setFileName(FileUtil.fileName(file));
|
||||
image.setImageTakenDate(tempLocaBd.getTime());
|
||||
image.setBaiduLongitude(tempLocaBd.longitude);
|
||||
image.setBaiduLatitude(tempLocaBd.latitude);
|
||||
image.setLocation(tempLocaBd.getAddress());
|
||||
MDPLocationCollectionManager.uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "卸货照片上传成功");
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(卸货照片):", s + s1);
|
||||
// SPUtil.insSP(con,"make","卸货",sob.getData().getShippingNoteNumber());
|
||||
// SPUtil.insSP(con,"make","卸货-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||
// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||
// startService(serviceIn);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public void receipt_image() {
|
||||
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||
File file = new File(path);
|
||||
Image image = new Image();
|
||||
String base = BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||
image.setFileExt(FileUtil.lastName(file));
|
||||
image.setFileName(FileUtil.fileName(file));
|
||||
image.setImageTakenDate(tempLocaBd.getTime());
|
||||
image.setBaiduLongitude(tempLocaBd.longitude);
|
||||
image.setBaiduLatitude(tempLocaBd.latitude);
|
||||
image.setLocation(tempLocaBd.getAddress());
|
||||
MDPLocationCollectionManager.uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "回单照片上传成功");
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(回单照片):", s + s1);
|
||||
// SPUtil.insSP(con,"make","回单",sob.getData().getShippingNoteNumber());
|
||||
//// SPUtil.insSP(con,"make","回单-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||
//// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||
//// startService(serviceIn);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
//开启前台调度系统
|
||||
//NfcUtils.mNfcAdapter.enableForegroundDispatch(this, NfcUtils.mPendingIntent, NfcUtils.mIntentFilter, NfcUtils.mTechList);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
//关闭前台调度系统
|
||||
//NfcUtils.mNfcAdapter.disableForegroundDispatch(this);
|
||||
}
|
||||
|
||||
String nfcStr = "";
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
//当该Activity接收到NFC标签时,运行该方法
|
||||
//调用工具方法,读取NFC数据
|
||||
try {
|
||||
nfcStr = NfcUtils.readNFCId(intent);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Log.e("nfc", nfcStr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 上传安联和交通厅,平台-装货
|
||||
*/
|
||||
private void loadInfo() {
|
||||
//安联
|
||||
if (sob.getData().getReportAlct() == 1) {
|
||||
Location l = new Location();
|
||||
l.setBaiduLongitude(tempLocaBd.longitude);
|
||||
l.setBaiduLatitude(tempLocaBd.latitude);
|
||||
l.setLocation(tempLocaBd.getAddress());
|
||||
l.setTime(tempLocaBd.getTime());
|
||||
MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "装货上传成功");
|
||||
//交通厅
|
||||
if (sob.getData().getReport() == 1) {
|
||||
JTTProcess.start(con, sob, "");
|
||||
}
|
||||
//装货状态
|
||||
hyr.loading(lub);
|
||||
//装货照片
|
||||
up_image_z();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(装货):", s + s1);
|
||||
new MessageUtils().showCenMessage(con, s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传安联和交通厅,平台-卸货
|
||||
*/
|
||||
private void uploadInfo() {
|
||||
|
||||
//安联
|
||||
if (sob.getData().getReportAlct() == 1) {
|
||||
Location l = new Location();
|
||||
l.setBaiduLongitude(tempLocaBd.longitude);
|
||||
l.setBaiduLatitude(tempLocaBd.latitude);
|
||||
l.setLocation(tempLocaBd.getAddress());
|
||||
l.setTime(tempLocaBd.getTime());
|
||||
Log.e("-安联卸货信息-", gson.toJson(l));
|
||||
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "卸货上传成功");
|
||||
//交通厅
|
||||
if (sob.getData().getReport() == 1) {
|
||||
JTTProcess.stop(con, sob, "");
|
||||
}
|
||||
//卸货状态-平台
|
||||
hyr.dischargeCargo4(lub);
|
||||
//卸货照片-安联
|
||||
up_image();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(卸货):", s + s1);
|
||||
// new MessageUtils().showCenMessage(con, s1);
|
||||
//运单状态不一致,平台更新状态
|
||||
hyr.dischargeCargo4(lub);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,14 +1,8 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.login;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.wifi.WifiManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.provider.Settings;
|
||||
import android.telecom.TelecomManager;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.TextPaint;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
@@ -16,8 +10,6 @@ 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;
|
||||
@@ -26,11 +18,11 @@ 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.util.log.LogUtil;
|
||||
import com.dahe.mylibrary.net.CommonResponseBean;
|
||||
import com.google.gson.Gson;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
@@ -47,7 +39,6 @@ import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StatusBarUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import cn.jiguang.verifysdk.api.AuthPageEventListener;
|
||||
@@ -74,7 +65,8 @@ 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;
|
||||
|
||||
@Override
|
||||
@@ -91,28 +83,21 @@ public class LoginActivity extends BaseActivity {
|
||||
break;
|
||||
case RequsetCodeConstants.SUCCESS:
|
||||
if (CacheGroup.cacheList.get(CODE_RESULT) != null) {
|
||||
Log.e("--短信发送res--", "短信发送成功");
|
||||
LogUtil.e("--短信发送res--", "短信发送成功");
|
||||
}
|
||||
if (CacheGroup.cacheList.get(LOGIN_RESULT) != null) {
|
||||
//存储登录记录
|
||||
loginBean = new Gson().fromJson(CacheGroup.cacheList.get(LOGIN_RESULT), LoginBean.class);
|
||||
Log.e("--登录信息--", new Gson().toJson(loginBean));
|
||||
AppInfoBean appInfoBean = new AppInfoBean();
|
||||
LogUtil.e("--登录信息--", new Gson().toJson(loginBean));
|
||||
if (loginBean.getCode() == 200) {
|
||||
SPUtil.insSP(con, USER, USER_TOKEN, loginBean.getData().getToken());
|
||||
SPUtil.insSP(con, USER, USER_UNAME, loginBean.getData().getUname());
|
||||
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");
|
||||
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);
|
||||
@@ -134,7 +119,8 @@ 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);
|
||||
initView(null);
|
||||
}
|
||||
@@ -147,18 +133,21 @@ public class LoginActivity extends BaseActivity {
|
||||
@Override
|
||||
public void initView(Object obj) {
|
||||
super.initView(obj);
|
||||
cb.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
if (isChecked) {
|
||||
key = true;
|
||||
} else {
|
||||
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 = cb.getData().getUserUrl();
|
||||
url2 = "https://agreement.dahehuoyun.com/currency/#/";
|
||||
url2 = "https://agreement.dahehuoyun.com/huawei/#/private";
|
||||
}
|
||||
TextView tv_content = findViewById(R.id.tv_content);
|
||||
String str = "我已阅读并同意相关服务条款和隐私政策《用户服务协议》和《隐私政策》";
|
||||
@@ -169,7 +158,7 @@ public class LoginActivity extends BaseActivity {
|
||||
ssb.setSpan(new ClickableSpan() {
|
||||
@Override
|
||||
public void onClick(View widget) {
|
||||
Log.e("-用户服务协议-", url1);
|
||||
LogUtil.e("-用户服务协议-", url1);
|
||||
//用户服务协议点击事件
|
||||
Intent in = new Intent(con, WebActivity.class);
|
||||
in.putExtra("title", "用户服务协议");
|
||||
@@ -212,7 +201,7 @@ public class LoginActivity extends BaseActivity {
|
||||
getCode.setOnClickListener(v -> {
|
||||
String phone = String.valueOf(input_phone.getText());
|
||||
if ("".equals(phone) || phone == null) {
|
||||
Log.e("点击事件", "请先输入手机号");
|
||||
LogUtil.e("点击事件", "请先输入手机号");
|
||||
Toast.makeText(con, "请先输入手机号", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
if (11 == phone.length() && phone.indexOf("1") == 0) {
|
||||
@@ -229,7 +218,7 @@ public class LoginActivity extends BaseActivity {
|
||||
btn_login.setOnClickListener(v -> {
|
||||
String phone = String.valueOf(input_phone.getText());
|
||||
String code = String.valueOf(input_code.getText());
|
||||
Log.e("--code--", code);
|
||||
LogUtil.e("--code--", code);
|
||||
if (judgeFormat(phone, code)) {
|
||||
if (key) {
|
||||
LoginRegInputBean lb = new LoginRegInputBean();
|
||||
|
||||
@@ -29,16 +29,14 @@ import androidx.cardview.widget.CardView;
|
||||
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;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.esign.esignsdk.EsignSdk;
|
||||
import com.google.gson.Gson;
|
||||
@@ -87,6 +85,9 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
||||
@Override
|
||||
public void msgMethod(Message m) {
|
||||
super.msgMethod(m);
|
||||
System.out.println("csdf");
|
||||
System.out.println("csdf");
|
||||
System.out.println("csdf");
|
||||
switch (m.what) {
|
||||
case 200:
|
||||
if (CacheGroup.cacheList.get("getImage") != null) {
|
||||
@@ -140,8 +141,8 @@ 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/rule/serviceAgreement/dist/index.html#/", hd))
|
||||
.asCustom(new AgreementAlert(con, "https://agreement.dahehuoyun.com/huawei/#/private",
|
||||
"http://agreement.dahehuoyun.com/#/user", hd))
|
||||
.show();
|
||||
}
|
||||
Glide.with(con)
|
||||
@@ -161,16 +162,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,
|
||||
@@ -231,10 +222,10 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
||||
|
||||
br.close();
|
||||
} catch (java.io.FileNotFoundException ex) {
|
||||
Log.d("TAG", "WhiteListPermissionFilter.cfg - FileNotFoundException");
|
||||
LogUtil.e("TAG", "WhiteListPermissionFilter.cfg - FileNotFoundException");
|
||||
return true;
|
||||
} catch (java.io.IOException ex) {
|
||||
Log.d("TAG", "WhiteListPermissionFilter.cfg - IOException");
|
||||
LogUtil.e("TAG", "WhiteListPermissionFilter.cfg - IOException");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -242,7 +233,7 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
||||
|
||||
while (it.hasNext()) {
|
||||
String whitelistItem = it.next();
|
||||
Log.d("TAG", "whitelistItem:" + whitelistItem);
|
||||
LogUtil.e("TAG", "whitelistItem:" + whitelistItem);
|
||||
if (packagename.contains(whitelistItem)) {
|
||||
return false;
|
||||
}
|
||||
@@ -267,14 +258,14 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
Log.e("error", "配置项信息加载失败" + e.toString());
|
||||
LogUtil.e("error", "配置项信息加载失败" + e.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
if (response.code() == 200) {
|
||||
String body = response.body().string();
|
||||
Log.e("-body-", body);
|
||||
LogUtil.e("-body-", body);
|
||||
ConfigBean cb = new Gson().fromJson(body, ConfigBean.class);
|
||||
if (cb.getCode() == 200) {
|
||||
ConfigParts.setParts(con, cb);
|
||||
@@ -320,12 +311,8 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
||||
}, cd * 1000);
|
||||
}
|
||||
|
||||
// String keys = "f9d35b1133cff1f6e3960c89b249e03f";
|
||||
// String license = "eQQm7gCZPF58Cy4i9OGkqSdFdDnFF0VSUVpw92WcrNLx7zVbpGJwjQhnKL8b0piApIbOTog5log/S1ZIxoUQogueaG84BQlJfRwKjtvpVWImlmhthQyQd2ogRqGkm3rkVGeG9wK49fzP3g5AtghNF05je2rQWd/Tyy/wutXq0e0rvR/bEckFaZ4BesQaYd0MejFC3lA8BjxNWiuvCKs15e1aRUOU5vwN5wsaTsTHokBIYhioSxOoGgHn6NrX6K9Dsl9uTWZ2dOVK/jEzYsNt6E/1Ww2ck1XmIWdRCQNmCpgikuPT0ACAL/w7UaRoWzM/Pm+akWqyp+bEavHT1Vhug3HAHOSGfOghGw2NerNlyEg8h6cVneMx+TsidnQ0ZG29aqdcLBRsvi26BYJJCA8+0WXjT+73RhS8g97Rfb6h0/W//5Az8UNZ6dp6XvUi2EJXQRhY5hkHiuwWT2W1ik+6wiiURkkrBACKbO1kmZWbVpRIe3Y3pcr3Q/V+oAcyPHRXCxu+JIe/j40/epuRrCyf8yvKsZ2Dnkl4QQmlwNqlW1F/arS+19G6zOG+6VKwtbI01A1R9SU1TYOA5UL/Qpo6Gyi3Ec3/irgQlzkq1rZrOIS4oo6tghul/zcG8rjno3luqHYwIZf8vAVfpwBesIVcANCOIuTRPU3A8vdmUoK/twGIchPapmjlAzLhjZ4KoAbNeMsWu3sN6kF44xofLMghos2X8OtvUA9CMD37v2FpYoM75qavyoivsBAbb6mG0p5TmkZ37BxfaGGP6SYrCa9ygQ==";
|
||||
|
||||
String keys = "19ac0aa74338e487e45057faf7212401";
|
||||
String license = "HF41uGxM/1i3CtW98DimoA97BlNTAnQ+DiEAihYmZ2jR1jqC4be253joEJbOJgFDIzp5aIoeuXSWWHFaDVfaHL2Pksbq5f8M8EqsVhP9q/i1xGYSYf6MJVlHdMAVLWgR0Kra+n8dVzkSDuZeyJuDsskAmZaGFQN1CqnWYCI1tmV1Tk4A57e9LQMed0U11QWjdshdU2DGqBXKmGE419PdW3NmIxOR2u9iB1OKBmvzCUT8RAYyBzSn/yhU++YJ25g5a8Pb5kOvi+eOh+PEFEcQL6oOp/CF4Iw5nadlsLhc+XEnVJpwL2myZBoSlVcKxrJKbRn1/DIgXBueKKnqhyHKdJlpqI9eghAlRF0p2Q4f23m89mWRZf4nhKzTeXGIjCTFO4TNVucrlGU7tyJcrRCDVdfV24fziH+hB3QGckpuYzzjefr7hZalLRJ/w8dPw/8dCY1wnWq3AJ3zw2g1PzMxl51q7AgdKvwc1ERcGBns0zb8PK6vGKCnJq3uHiJEnslbTI0MEosje+h+OPO7hf2QofErewjI19wHEOv4dTvuFLh3VmGFMObAmov5kI47705fjSxCvAPGATBrfUSwim+5EQ1hanc5IcXe0/nOTiRUNEpZ+x65zVydqAs7490yqQiIUQvPazEwcal7vH2OD54lCcgpxKxqdmGc5/bp5UnqB45+n+iuInV/Q9DMOQVk15uaVZmhS8VaCqH21CmfH/ZGLb9wiEpaRLrPZLKX3bK7MT9Z0/OlDnb2QUKU8LMMIhLuQQntzsf0Wn4kA/0e9QAJJQ==";
|
||||
|
||||
String keys = "f9d35b1133cff1f6e3960c89b249e03f";
|
||||
String license = "eQQm7gCZPF58Cy4i9OGkqSdFdDnFF0VSUVpw92WcrNLx7zVbpGJwjQhnKL8b0piApIbOTog5log/S1ZIxoUQogueaG84BQlJfRwKjtvpVWImlmhthQyQd2ogRqGkm3rkVGeG9wK49fzP3g5AtghNF05je2rQWd/Tyy/wutXq0e0rvR/bEckFaZ4BesQaYd0MejFC3lA8BjxNWiuvCKs15e1aRUOU5vwN5wsaTsTHokBIYhioSxOoGgHn6NrX6K9Dsl9uTWZ2dOVK/jEzYsNt6E/1Ww2ck1XmIWdRCQNmCpgikuPT0ACAL/w7UaRoWzM/Pm+akWqyp+bEavHT1Vhug3HAHOSGfOghGw2NerNlyEg8h6cVneMx+TsidnQ0ZG29aqdcLBRsvi26BYJJCA8+0WXjT+73RhS8g97Rfb6h0/W//5Az8UNZ6dp6XvUi2EJXQRhY5hkHiuwWT2W1ik+6wiiURkkrBACKbO1kmZWbVpRIe3Y3pcr3Q/V+oAcyPHRXCxu+JIe/j40/epuRrCyf8yvKsZ2Dnkl4QQmlwNqlW1F/arS+19G6zOG+6VKwtbI01A1R9SU1TYOA5UL/Qpo6Gyi3Ec3/irgQlzkq1rZrOIS4oo6tghul/zcG8rjno3luqHYwIZf8vAVfpwBesIVcANCOIuTRPU3A8vdmUoK/twGIchPapmjlAzLhjZ4KoAbNeMsWu3sN6kF44xofLMghos2X8OtvUA9CMD37v2FpYoM75qavyoivsBAbb6mG0p5TmkZ37BxfaGGP6SYrCa9ygQ==";
|
||||
|
||||
public void init() {
|
||||
String state = SPUtil.getSP(con, "state_data", "authorization_state");
|
||||
@@ -338,13 +325,13 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
||||
res.updateConfiguration(config, res.getDisplayMetrics());
|
||||
//安联初始化
|
||||
if (context.getPackageName().equals(getCurrentProcessName(context))) {
|
||||
//Log.e("--使用的测试环境--",BuildConfig.OPEN_API_URL);
|
||||
MDPLocationCollectionManager.initialize(getApplicationContext(), BuildConfig.OPEN_AL_URL);
|
||||
//LogUtil.e("--使用的测试环境--",BuildConfig.OPEN_API_URL);
|
||||
MDPLocationCollectionManager.initialize(getApplicationContext(), "https://oapi.alct56.com");
|
||||
}
|
||||
//在使用SDK各组件之前初始化context信息,传入ApplicationContext
|
||||
// 路由初始化
|
||||
JVerificationInterface.setDebugMode(true);
|
||||
JVerificationInterface.init(con, 5000, (code, msg) -> Log.d("tag", "code = " + code + " msg = " + msg));
|
||||
JVerificationInterface.init(con, 5000, (code, msg) -> LogUtil.e("tag", "code = " + code + " msg = " + msg));
|
||||
//友盟
|
||||
//设置非debug版本开启
|
||||
if (!isDebugVersion(con)) {
|
||||
@@ -353,7 +340,7 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
||||
EsignSdk.getInstance().init(keys, license);
|
||||
JTTProcess.init(getApplication());
|
||||
} catch (Exception e) {
|
||||
Log.e("-error-", "初始化失败sss");
|
||||
LogUtil.e("-error-", "初始化失败sss");
|
||||
}
|
||||
}
|
||||
SPUtil.insSP(con, "state_data", "authorization_state", "1");
|
||||
|
||||
@@ -18,12 +18,13 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
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.business.BusinessActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.PicturlUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
@@ -170,14 +171,12 @@ public class MyFragment extends BaseFragment {
|
||||
startActivity(in);
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
class Model {
|
||||
}
|
||||
class Model{ }
|
||||
|
||||
public void getRequest(){
|
||||
sob= StartOrderParts.getStartOrder(con);
|
||||
@@ -293,21 +292,14 @@ public class MyFragment extends BaseFragment {
|
||||
|
||||
@Subscribe
|
||||
public void processResult(VehicleEvent event) {
|
||||
Log.e("-msg-", event.getMessage());
|
||||
LogUtil.e("-msg-",event.getMessage());
|
||||
if(!"挂".equals(event.getMessage())) {
|
||||
ur.vehicleList("1");
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void refreshCarListEvent(RefreshCarListEvent event) {
|
||||
Log.e("-msg-", event.getMessage());
|
||||
ur.vehicleList("1");
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void personResult(PersonEvent home) {
|
||||
Log.e("-res-", home.getMessage());
|
||||
LogUtil.e("-res-", home.getMessage());
|
||||
if (ur != null) {
|
||||
ur.User();
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public class SetupActivity extends BaseActivity {
|
||||
String url2="";
|
||||
String url3="";
|
||||
String kefu="";
|
||||
private RelativeLayout r1,r2,r3,r4,r5,r6,r7,r8;
|
||||
private RelativeLayout r1,r2,r3,r4,r5,r6,r7;
|
||||
|
||||
@Override
|
||||
public void msgMethod(Message m) {
|
||||
@@ -73,9 +73,8 @@ 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#/";
|
||||
// url2=cb.getData().getPrivateUrl();
|
||||
url2="https://agreement.dahehuoyun.com/currency/#/";
|
||||
url1="https://agreement.dahehuoyun.com/huawei/#/private";
|
||||
url2=cb.getData().getPrivateUrl();
|
||||
kefu=cb.getData().getServiceMobile();
|
||||
url3=cb.getData().getSecurityUrl();
|
||||
}
|
||||
@@ -86,7 +85,6 @@ public class SetupActivity extends BaseActivity {
|
||||
r5=findViewById(R.id.r5);
|
||||
r6=findViewById(R.id.r6);
|
||||
r7=findViewById(R.id.r7);
|
||||
r8=findViewById(R.id.r8);
|
||||
ur=new UserRequset(con,hd);
|
||||
initView(null);
|
||||
}
|
||||
@@ -120,12 +118,6 @@ public class SetupActivity extends BaseActivity {
|
||||
in.putExtra("url","https://smlt.esign.cn/hmfbZoeeGQqv");
|
||||
startActivity(in);
|
||||
});
|
||||
r8.setOnClickListener(v12 -> {
|
||||
Intent in=new Intent(con,WebActivity.class);
|
||||
in.putExtra("title","交易规则");
|
||||
in.putExtra("url","https://agreement.dahehuoyun.com/rule/transactionRules/dist/index.html#/");
|
||||
startActivity(in);
|
||||
});
|
||||
r6.setOnClickListener(v12 -> {
|
||||
String[] title={"平台客服:"+kefu,"银行客服:95528","技术咨询:13460042961"};
|
||||
String[] value={kefu,"95528","13460042961"};
|
||||
|
||||
@@ -16,6 +16,7 @@ import android.widget.Toast;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
@@ -35,7 +36,6 @@ import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseFragment;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||
import com.zhpan.bannerview.BannerViewPager;
|
||||
import com.zhpan.bannerview.constants.PageStyle;
|
||||
|
||||
@@ -110,7 +110,7 @@ public class WoDeFragment extends BaseFragment {
|
||||
public void initRefreshLoad(){
|
||||
refreshLayout=root.findViewById(R.id.srl);
|
||||
refreshLayout.setOnRefreshListener(refreshLayout -> {
|
||||
Log.e("下拉刷新","pps");
|
||||
LogUtil.e("下拉刷新","pps");
|
||||
ur.User();
|
||||
ur.driverAuthData();
|
||||
ur.vehicleList("1");
|
||||
@@ -177,11 +177,8 @@ public class WoDeFragment extends BaseFragment {
|
||||
headportraitUrl.setOnClickListener(v1 -> {
|
||||
if(ub.getData().getHeadportraitUrl()!=null && !ub.getData().getHeadportraitUrl().equals("")){
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(headportraitUrl,ub.getData().getHeadportraitUrl(),new SmartGlideImageLoader(R.mipmap.ic_launcher_round))
|
||||
.asImageViewer(headportraitUrl,ub.getData().getHeadportraitUrl(), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(headportraitUrl,ub.getData().getHeadportraitUrl(), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
}else{
|
||||
Intent in=new Intent(con, PersonalAuthActivity.class);
|
||||
startActivity(in);
|
||||
@@ -257,7 +254,7 @@ public class WoDeFragment extends BaseFragment {
|
||||
}
|
||||
data_view.setVisibility(View.VISIBLE);
|
||||
ins_view.setVisibility(View.GONE);
|
||||
Log.e("--body--",gson.toJson(clb.getData().get(position)));
|
||||
LogUtil.e("--body--",gson.toJson(clb.getData().get(position)));
|
||||
v.setOnClickListener(v1 -> {
|
||||
Intent in=new Intent(con, VehicleAuthActivity.class);
|
||||
in.putExtra("carId",clb.getData().get(position).getCarId());
|
||||
|
||||
@@ -11,6 +11,7 @@ import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.google.gson.Gson;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
||||
@@ -108,13 +109,13 @@ public class NewsActivity extends BaseAppCompatActivity {
|
||||
public void initRefreshLoad(){
|
||||
refreshLayout=findViewById(R.id.srl);
|
||||
refreshLayout.setOnRefreshListener(refreshLayout -> {
|
||||
Log.e("下拉刷新","pps");
|
||||
LogUtil.e("下拉刷新","pps");
|
||||
index=1;
|
||||
new NewsRequest().getXiaoXiList(con,hd,type,index);
|
||||
});
|
||||
refreshLayout.autoRefresh();
|
||||
refreshLayout.setOnLoadMoreListener(refreshLayout -> {
|
||||
Log.e("上拉加载","bbs");
|
||||
LogUtil.e("上拉加载","bbs");
|
||||
index++;
|
||||
new NewsRequest().getXiaoXiList(con,hd,type,index);
|
||||
refreshLayout.finishLoadMore();
|
||||
|
||||
@@ -14,6 +14,7 @@ import android.widget.Toast;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.google.gson.Gson;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.XiaoXiListBean;
|
||||
@@ -68,7 +69,7 @@ public class NewsFragment extends BaseFragment {
|
||||
refreshLayout=root.findViewById(R.id.srl);
|
||||
refreshLayout.setEnableLoadMore(true);
|
||||
refreshLayout.setOnRefreshListener(refreshLayout -> {
|
||||
Log.e("下拉刷新","pps");
|
||||
LogUtil.e("下拉刷新","pps");
|
||||
new NewsRequest().getXiaoXiLists(con,hd);
|
||||
});
|
||||
refreshLayout.autoRefresh();
|
||||
|
||||
@@ -5,7 +5,6 @@ import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
@@ -13,8 +12,7 @@ import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickHelper;
|
||||
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickListener;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.google.gson.Gson;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
@@ -43,7 +41,7 @@ import java.util.List;
|
||||
* @date 2021/8/26 19:06
|
||||
* @description:
|
||||
*/
|
||||
public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClickListener {
|
||||
public class UpBankActivity extends BaseAppCompatActivity {
|
||||
|
||||
private ImageView up_bank_img;
|
||||
private EditText bank_name,bank_number;
|
||||
@@ -74,7 +72,6 @@ public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClic
|
||||
if(CacheGroup.cacheList.get("insBank")!=null){
|
||||
BaseBean bb=new Gson().fromJson(CacheGroup.cacheList.get("insBank"),BaseBean.class);
|
||||
if(bb.getCode()==200){
|
||||
customDialog.dismiss();
|
||||
Toast.makeText(con,"绑定成功",Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}else{
|
||||
@@ -110,7 +107,13 @@ public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClic
|
||||
up_bank_img.setOnClickListener(v -> {
|
||||
gia.showPopueWindow(this);
|
||||
});
|
||||
submit.setOnClickListener(new OnLimitClickHelper(this));
|
||||
submit.setOnClickListener(v -> {
|
||||
if(ib!=null){
|
||||
submit();
|
||||
}else{
|
||||
Toast.makeText(con,"请先上传图片",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
return_btn.setOnClickListener(v -> {
|
||||
finish();
|
||||
});
|
||||
@@ -129,7 +132,7 @@ public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClic
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == 12 && resultCode == RESULT_OK) {
|
||||
path=gia.getFile().getPath();
|
||||
Log.e("图片地址:", path);
|
||||
LogUtil.e("图片地址:",path);
|
||||
gia.dis();
|
||||
ImageFileCompressUtil.imageFileCompress(con,new File(path),hd);
|
||||
} else if (requestCode == PictureConfig.CHOOSE_REQUEST && resultCode == RESULT_OK) {
|
||||
@@ -142,7 +145,7 @@ public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClic
|
||||
paths = image.getPath();
|
||||
}
|
||||
path=paths;
|
||||
Log.e("图片地址:", path);
|
||||
LogUtil.e("图片地址:",path);
|
||||
gia.dis();
|
||||
ImageFileCompressUtil.imageFileCompress(con,new File(path),hd);
|
||||
}
|
||||
@@ -150,8 +153,6 @@ 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)){
|
||||
@@ -164,20 +165,8 @@ public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClic
|
||||
ibib.setBankName(bankName);
|
||||
ibib.setCardUserType(1);
|
||||
ibib.setImageId(ib.getData().getId());
|
||||
Log.e("-res-", new Gson().toJson(ibib));
|
||||
LogUtil.e("-res-",new Gson().toJson(ibib));
|
||||
qr.insBankCard(ibib);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
switch (view.getId()) {
|
||||
case R.id.submit:
|
||||
if (ib != null) {
|
||||
submit();
|
||||
} else {
|
||||
Toast.makeText(con, "请先上传图片", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
@@ -34,7 +35,6 @@ import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
|
||||
public class WalletFragment extends BaseFragment{
|
||||
|
||||
public static UserBean userBean;
|
||||
@@ -138,7 +138,7 @@ public class WalletFragment extends BaseFragment{
|
||||
public void initRefreshLoad(){
|
||||
refreshLayout=root.findViewById(R.id.srl);
|
||||
refreshLayout.setOnRefreshListener(refreshLayout -> {
|
||||
Log.e("下拉刷新","pps");
|
||||
LogUtil.e("下拉刷新","pps");
|
||||
qr.getBankCardList();
|
||||
qr.getContracts();
|
||||
ur.User();
|
||||
@@ -182,7 +182,7 @@ public class WalletFragment extends BaseFragment{
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||
.asConfirm("好运值说明", "好运值是您在大河好运网络货运平台所赚取的运费总额,包括已提现到银行卡的金额和未提现的电子账户余额。",
|
||||
"取消", "确认",
|
||||
() -> Log.e("1","1"), null, false, R.layout.alert_close) //最后一个参数绑定已有布局
|
||||
() -> LogUtil.e("1","1"), null, false, R.layout.alert_close) //最后一个参数绑定已有布局
|
||||
.show();
|
||||
});
|
||||
//运单量
|
||||
@@ -231,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);
|
||||
}
|
||||
@@ -280,7 +279,7 @@ public class WalletFragment extends BaseFragment{
|
||||
// .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||
// .asConfirm("好运值说明", "好运值是您在大河好运网络货运平台所赚取的运费总额,包括已提现到银行卡的金额和未提现的电子账户余额。",
|
||||
// "取消", "确认",
|
||||
// () -> Log.e("1","1"), null, false, R.layout.alert_close) //最后一个参数绑定已有布局
|
||||
// () -> LogUtil.e("1","1"), null, false, R.layout.alert_close) //最后一个参数绑定已有布局
|
||||
// .show();
|
||||
// }
|
||||
//
|
||||
|
||||
+2
-1
@@ -17,6 +17,7 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.ConfigRecordBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.log.LogUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.weight.pop.CenterPop;
|
||||
import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
@@ -225,7 +226,7 @@ public class WithdrawalActivity extends BaseActivity {
|
||||
public void initRefreshLoad(){
|
||||
srl=findViewById(R.id.srl);
|
||||
srl.setOnRefreshListener(refreshLayout -> {
|
||||
Log.e("下拉刷新","pps");
|
||||
LogUtil.e("下拉刷新","pps");
|
||||
qr.changeRecord();
|
||||
|
||||
// if("".equals(carId)){
|
||||
|
||||
@@ -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资源
|
||||
@@ -102,13 +94,10 @@ public class WebActivity extends BaseActivity {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
//返回值是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);
|
||||
@@ -119,12 +108,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 +146,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();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -197,13 +174,11 @@ public class WebActivity extends BaseActivity {
|
||||
|
||||
@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 UserParts.getUser(con).getData().getToken();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.util;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.JTT;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.StartOrderBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.constant.JTTConstant;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.StartOrderParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.UserRequset;
|
||||
import com.arpa.hndahesudintocctmsdriver.service.TrackService;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.home.HuoYuanFragmengt;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||
import com.dahe.mylibrary.utils.SelectPhotoUtils5;
|
||||
import com.google.gson.Gson;
|
||||
|
||||
/**
|
||||
* @ClassName BillLocationUtils
|
||||
* @Author 用户
|
||||
* @Date 2022/10/17 10:24
|
||||
* @Description TODO
|
||||
*/
|
||||
public class BillLocationUtils {
|
||||
|
||||
private Context con;
|
||||
|
||||
|
||||
private static class SingletonHolder {
|
||||
private static final BillLocationUtils INSTANCE = new BillLocationUtils();
|
||||
}
|
||||
|
||||
private BillLocationUtils() {
|
||||
}
|
||||
|
||||
public static final BillLocationUtils getInstance() {
|
||||
return SingletonHolder.INSTANCE;
|
||||
}
|
||||
|
||||
private HuoYuanRequset hyr;
|
||||
private UserRequset ur;
|
||||
public void getBillLocation(Context con) {
|
||||
this.con = con;
|
||||
hyr = new HuoYuanRequset(con, hd);
|
||||
ur = new UserRequset(con, hd);
|
||||
//获取执行中的运单
|
||||
hyr.startOrder(0);
|
||||
}
|
||||
|
||||
public Handler hd = new Handler(msg -> {
|
||||
msgMethod(msg);
|
||||
return false;
|
||||
});
|
||||
|
||||
public void msgMethod(Message m) {
|
||||
switch (m.what) {
|
||||
case RequsetCodeConstants.SUCCESS:
|
||||
Gson gson = new Gson();
|
||||
// Toast.makeText(con,RequsetCodeConstants.FEEDBACK_TEXT,Toast.LENGTH_SHORT).show();
|
||||
if (CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER) != null) {
|
||||
StartOrderBean sob = gson.fromJson(CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER), StartOrderBean.class);
|
||||
if (sob.getCode() == 200) {
|
||||
if (sob.getData() != null) {
|
||||
SPUtil.insSP(con, JTTConstant.JTT_DATA_NAME, JTTConstant.JTT_DATA_ORDER_KEY, gson.toJson(sob));
|
||||
initStart(sob);
|
||||
StartOrderParts.setStartOrder(con, sob);
|
||||
ur.getJtts(sob.getData().getShippingNoteNumber());
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(con, sob.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove(HuoYuanFragmengt.START_ORDER);
|
||||
break;
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("jttRes") != null) {
|
||||
JTT jtt = gson.fromJson(CacheGroup.cacheList.get("jttRes"), JTT.class);
|
||||
if (jtt.getCode() == 200) {
|
||||
SPUtil.insSP(con, "data", "jtt", CacheGroup.cacheList.get("jttRes"));
|
||||
JTTProcess.auth(con);
|
||||
} else {
|
||||
Toast.makeText(con, StringUtil.isNull(jtt.getMsg(), "返回错误"), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove("jttRes");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void initStart(StartOrderBean sob) {
|
||||
if (sob.getData() != null) {
|
||||
if (sob != null && sob.getData() != null && 0 < sob.getData().getWayChildren().size()) {
|
||||
//order_start.setVisibility(View.VISIBLE);
|
||||
SPUtil.insSP(con, "order", "ShippingNoteNumber", sob.getData().getShippingNoteNumber());
|
||||
Log.e("开始轨迹上传服务", "-----");
|
||||
Intent serviceIn = new Intent(con, TrackService.class);
|
||||
con.startService(serviceIn);
|
||||
} else {
|
||||
SPUtil.insSP(con, "order", "ShippingNoteNumber", "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.util
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.arpa.hndahesudintocctmsdriver.cuspop.MessagePop
|
||||
import com.arpa.hndahesudintocctmsdriver.cuspop.SimCenterPop
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity
|
||||
import com.lxj.xpopup.XPopup
|
||||
|
||||
/**
|
||||
* @ClassName MessageUtils
|
||||
* @Author 用户
|
||||
* @Date 2023/8/15 09:51
|
||||
* @Description TODO
|
||||
*/
|
||||
class MessageUtils {
|
||||
|
||||
companion object {
|
||||
fun getInstance() = InstanceHelper.sSingle
|
||||
}
|
||||
|
||||
object InstanceHelper {
|
||||
val sSingle = MessageUtils()
|
||||
}
|
||||
|
||||
fun showCenMessage(ctx: Context, message: String) {
|
||||
XPopup.Builder(ctx) //
|
||||
.hasNavigationBar(false)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗对象,推荐设置这个
|
||||
.asCustom(MessagePop(ctx, message).setOnMyItemClickListener(object : MessagePop.OnMyItemClickListener{
|
||||
override fun onItemClick(startTime: String, endTime: String) {
|
||||
}
|
||||
}))
|
||||
.show()
|
||||
}
|
||||
|
||||
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()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -51,9 +51,6 @@ public class AdapterAlls extends RecyclerView.Adapter<AdapterAlls.ViewHolder> {
|
||||
}
|
||||
|
||||
public void add(List<ManyBean> addMessageList) {
|
||||
if (object==null){
|
||||
return;
|
||||
}
|
||||
//增加数据
|
||||
int position = object.size();
|
||||
object.addAll(position, addMessageList);
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.arpa.hndahesudintocctmsdriver.util.http;
|
||||
import android.content.Context;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.util.app.VersionUtil;
|
||||
import com.dahe.mylibrary.utils.AppUtils;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@@ -42,7 +41,6 @@ public class OkHttpUtil {
|
||||
.post(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))
|
||||
@@ -73,40 +71,6 @@ public class OkHttpUtil {
|
||||
.addHeader("Authorization", token)
|
||||
.addHeader("Content-Type", "application/json")
|
||||
.addHeader("Version", VersionUtil.getVersion(con))
|
||||
.addHeader("VersionCode",String.valueOf(AppUtils.getAppVersionCode()))
|
||||
//.addHeader("sign",sign)
|
||||
.removeHeader("User-Agent")
|
||||
.addHeader("User-Agent",GetUtil.getUserAgent(con))
|
||||
.build();
|
||||
return request;
|
||||
}
|
||||
|
||||
public static Request put(OkDate od, Context con){
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
if(od.getMadiaType()!=null && od.getMadiaType().equals("")){
|
||||
od.setMadiaType("{}");
|
||||
}
|
||||
// JSONObject jsonObject = JSON.parseObject(od.getMadiaType());
|
||||
// jsonObject.put("timestamp", DateUtil.current());
|
||||
// jsonObject.put("deviceId", GetUtil.getDeviceId(con));
|
||||
// String sign = SecureUtil.signParamsSha1(jsonObject,SIGN_PASSWORD);
|
||||
// Log.e("jsonObject",jsonObject.toString());
|
||||
// Log.e("sign",sign);
|
||||
// Map<String,Object> map=new HashMap<>();
|
||||
// map.put("data",SecurityUtil.encrypt(jsonObject.toString()));
|
||||
// Log.e("参数1",od.getMadiaType());
|
||||
// Log.e("参数2",MapUtil.mapJson(map));
|
||||
//MapUtil.mapJson(map)
|
||||
RequestBody body = RequestBody.create(mediaType,od.getMadiaType());
|
||||
Headers.Builder hb=new Headers.Builder();
|
||||
hb.add("Content-Type","application/json");
|
||||
hb.add("Cache-Control","no-cache");
|
||||
Request request = new Request.Builder()
|
||||
.url(od.getUrl())
|
||||
.put(body)
|
||||
.headers(hb.build())
|
||||
.addHeader("Version", VersionUtil.getVersion(con))
|
||||
.addHeader("VersionCode",String.valueOf(AppUtils.getAppVersionCode()))
|
||||
//.addHeader("sign",sign)
|
||||
.removeHeader("User-Agent")
|
||||
.addHeader("User-Agent",GetUtil.getUserAgent(con))
|
||||
@@ -122,7 +86,6 @@ public class OkHttpUtil {
|
||||
.url(od.getUrl())
|
||||
.get()
|
||||
.headers(hb.build())
|
||||
.addHeader("VersionCode",String.valueOf(AppUtils.getAppVersionCode()))
|
||||
.build();
|
||||
return request;
|
||||
}
|
||||
@@ -136,7 +99,6 @@ public class OkHttpUtil {
|
||||
Request request = new Request.Builder()
|
||||
.url(od.getUrl())
|
||||
.addHeader("Authorization", token)
|
||||
.addHeader("VersionCode",String.valueOf(AppUtils.getAppVersionCode()))
|
||||
.get()
|
||||
.headers(hb.build())
|
||||
.build();
|
||||
@@ -167,7 +129,6 @@ public class OkHttpUtil {
|
||||
.url(od.getUrl())
|
||||
.method("POST", body)
|
||||
.addHeader("Authorization", token)
|
||||
.addHeader("VersionCode",String.valueOf(AppUtils.getAppVersionCode()))
|
||||
.addHeader("Cookie", "JSESSIONID=NqpqKQstwceQurcNK5hjl4GnTgiF4eSzZSo5a1rz")
|
||||
.build();
|
||||
return request;
|
||||
@@ -184,26 +145,23 @@ public class OkHttpUtil {
|
||||
.url(od.getUrl())
|
||||
.method("POST", body)
|
||||
.addHeader("Authorization", token)
|
||||
.addHeader("VersionCode",String.valueOf(AppUtils.getAppVersionCode()))
|
||||
.addHeader("Cookie", "JSESSIONID=NqpqKQstwceQurcNK5hjl4GnTgiF4eSzZSo5a1rz")
|
||||
.build();
|
||||
return request;
|
||||
}
|
||||
|
||||
public static Request postFiles(OkDate od,File file,String token,String carId,String carNum,boolean isSave) {
|
||||
public static Request postFiles(OkDate od,File file,String token,String carId,String carNum) {
|
||||
MediaType mediaType = MediaType.parse("text/plain");
|
||||
RequestBody body = new MultipartBody.Builder()
|
||||
.setType(MultipartBody.FORM)
|
||||
.addFormDataPart("file",file.getPath(),RequestBody.create(MediaType.parse("application/octet-stream"), file))
|
||||
.addFormDataPart("carId",carId)
|
||||
.addFormDataPart("carNum",carNum)
|
||||
.addFormDataPart("isSave",isSave?"0":"1")
|
||||
.build();
|
||||
Request request = new Request.Builder()
|
||||
.url(od.getUrl())
|
||||
.method("POST", body)
|
||||
.addHeader("Authorization", token)
|
||||
.addHeader("VersionCode",String.valueOf(AppUtils.getAppVersionCode()))
|
||||
.addHeader("Cookie", "JSESSIONID=NqpqKQstwceQurcNK5hjl4GnTgiF4eSzZSo5a1rz")
|
||||
.build();
|
||||
return request;
|
||||
|
||||
@@ -70,27 +70,13 @@ public class GetCarImageAlert {
|
||||
.permissions(Manifest.permission.CAMERA)
|
||||
.request((allGranted, grantedList, deniedList) -> {
|
||||
if (allGranted) {
|
||||
openCam(act);
|
||||
// file=ImageGetUtil.createImageFile(act);
|
||||
// ImageGetUtil.cameraAlbumGetImage(act,file);
|
||||
file=ImageGetUtil.createImageFile(act);
|
||||
ImageGetUtil.cameraAlbumGetImage(act,file);
|
||||
} else {
|
||||
Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
});
|
||||
img.setOnClickListener(v -> {
|
||||
if (!key){
|
||||
PermissionX.init(act)
|
||||
.permissions(Manifest.permission.CAMERA)
|
||||
.request((allGranted, grantedList, deniedList) -> {
|
||||
if (allGranted) {
|
||||
openCam(act);
|
||||
} else {
|
||||
Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
btn_quxiao.setOnClickListener(v -> popupWindow.dismiss());
|
||||
//popupWindow消失屏幕变为不透明
|
||||
popupWindow.setOnDismissListener(() -> {
|
||||
@@ -113,13 +99,4 @@ public class GetCarImageAlert {
|
||||
popupWindow.dismiss();
|
||||
}
|
||||
|
||||
private void openCam(AppCompatActivity act){
|
||||
file=ImageGetUtil.createImageFile(act);
|
||||
if (file!=null){
|
||||
ImageGetUtil.cameraAlbumGetImage(act,file);
|
||||
}else{
|
||||
Toast.makeText(act.getBaseContext(), "路径创建失败,请清除缓存后重试", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,8 +9,6 @@ import android.provider.MediaStore;
|
||||
|
||||
import androidx.core.content.FileProvider;
|
||||
|
||||
import com.dahe.mylibrary.utils.AppUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -41,7 +39,7 @@ public class ImageGetUtil {
|
||||
if(imageFile!=null){
|
||||
if(Build.VERSION.SDK_INT>= Build.VERSION_CODES.N){
|
||||
/*7.0以上要通过FileProvider将File转化为Uri*/
|
||||
uri = FileProvider.getUriForFile(act.getApplicationContext(), AppUtils.getAppPackageName()+".fileprovider",imageFile);
|
||||
uri = FileProvider.getUriForFile(act.getApplicationContext(),"com.arpa.hndahesudintocctmsdriver.fileprovider",imageFile);
|
||||
}else {
|
||||
/*7.0以下则直接使用Uri的fromFile方法将File转化为Uri*/
|
||||
uri = Uri.fromFile(imageFile);
|
||||
|
||||
-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, "定位失败,请查看定位权限");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,6 @@ public class LocationUtil{
|
||||
|
||||
private double latitude;
|
||||
private double longitude;
|
||||
private int errorCode;
|
||||
private String address;
|
||||
private Context con;
|
||||
private Handler hd;
|
||||
@@ -40,10 +39,6 @@ public class LocationUtil{
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public double getErrorCode() {
|
||||
return errorCode;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
@@ -67,7 +62,7 @@ public class LocationUtil{
|
||||
//LocationMode.Hight_Accuracy:高精度;
|
||||
//LocationMode. Battery_Saving:低功耗;
|
||||
//LocationMode. Device_Sensors:仅使用设备;
|
||||
option.setCoorType("BD09ll");
|
||||
option.setCoorType("GCJ02");
|
||||
//可选,设置返回经纬度坐标类型,默认GCJ02
|
||||
//GCJ02:国测局坐标;
|
||||
//BD09ll:百度经纬度坐标;
|
||||
@@ -117,8 +112,7 @@ public class LocationUtil{
|
||||
float radius = location.getRadius(); //获取定位精度,默认值为0.0f
|
||||
String coorType = location.getCoorType();
|
||||
//获取经纬度坐标类型,以LocationClientOption中设置过的坐标类型为准
|
||||
errorCode = location.getLocType();
|
||||
String locTypeDescription = location.getLocTypeDescription();
|
||||
int errorCode = location.getLocType();
|
||||
//获取定位类型、定位错误返回码,具体信息可参照类参考中BDLocation类中的说明
|
||||
Log.e("定位位置address",address+"");
|
||||
Log.e("定位坐标latitude",latitude+"");
|
||||
|
||||
@@ -1,40 +1,176 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.util.log;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
||||
import java.security.SecureRandom;
|
||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.DESKeySpec;
|
||||
|
||||
/**
|
||||
* @author hlh
|
||||
* @version 1.0.0
|
||||
* @date 2022/1/10 16:55
|
||||
* @description:日志工具类
|
||||
* author :
|
||||
* e-mail :
|
||||
* time :
|
||||
* desc : Log日志输出工具类
|
||||
* version: 1.0
|
||||
*/
|
||||
public class LogUtil {
|
||||
public static boolean isDebug = BuildConfig.DEBUG;
|
||||
// 是否在log中显示行号
|
||||
public static final String TAG = "com.hddhsd.drive";
|
||||
public static boolean SHOW_LINE_NUMBER_IN_LOG = isDebug;
|
||||
//是否已初始化
|
||||
public static boolean initFlag = false;
|
||||
|
||||
public static void show(String title,String value){
|
||||
Log.e(title,value);
|
||||
Log.d(title,value);
|
||||
|
||||
public static void init(boolean debugFlag) {
|
||||
isDebug = debugFlag;
|
||||
SHOW_LINE_NUMBER_IN_LOG = debugFlag;
|
||||
initFlag = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印Log.w信息
|
||||
*
|
||||
* @param aPrintLogStr 打印信息字符串
|
||||
*/
|
||||
public static void w(String aPrintLogStr) {
|
||||
log(TAG, aPrintLogStr, Log.WARN, false);
|
||||
}
|
||||
|
||||
public static void w(String tag, String aPrintLogStr) {
|
||||
log(tag, aPrintLogStr, Log.WARN, false);
|
||||
}
|
||||
|
||||
public static void i(String tag, String aPrintLogStr) {
|
||||
log(tag, aPrintLogStr, Log.INFO, false);
|
||||
}
|
||||
|
||||
public static void i(String aPrintLogStr) {
|
||||
log(TAG, aPrintLogStr, Log.INFO, false);
|
||||
}
|
||||
|
||||
public static void callerI(String aPrintLogStr) {
|
||||
log(TAG, aPrintLogStr, Log.INFO, true);
|
||||
}
|
||||
|
||||
public static void d(String tag, String aPrintLogStr) {
|
||||
log(tag, aPrintLogStr, Log.DEBUG, false);
|
||||
}
|
||||
|
||||
public static void d(String aPrintLogStr) {
|
||||
log(TAG, aPrintLogStr, Log.DEBUG, false);
|
||||
}
|
||||
|
||||
public static void e(String tag, String aPrintLogStr) {
|
||||
log(tag, aPrintLogStr, Log.ERROR, false);
|
||||
}
|
||||
|
||||
public static void e(String aPrintLogStr) {
|
||||
log(TAG, aPrintLogStr, Log.ERROR, false);
|
||||
}
|
||||
|
||||
public static void v(String tag, String aPrintLogStr) {
|
||||
log(tag, aPrintLogStr, Log.VERBOSE, false);
|
||||
}
|
||||
/**
|
||||
* 判断当前应用是否是debug状态
|
||||
*/
|
||||
public static boolean isApkInDebug(Context context) {
|
||||
try {
|
||||
ApplicationInfo info = context.getApplicationInfo();
|
||||
return (info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param tag log的tag
|
||||
* @param content log的内容
|
||||
* @param logType log的类型,如Log.INFO,Log.DEBUG等
|
||||
* @param showCaller 是否显示调用者的方法名和行号等
|
||||
*/
|
||||
@SuppressLint("DefaultLocale")
|
||||
public static void log(String tag, String content, int logType, boolean showCaller) {
|
||||
if (!initFlag) {
|
||||
init(true);
|
||||
Log.e("LogUtil", "LogUtil没有初始化,请先初始化后使用,如果未初始化Log将不会输出显示");
|
||||
}
|
||||
if (isDebug) {
|
||||
if (SHOW_LINE_NUMBER_IN_LOG) {
|
||||
Throwable throwable = new Throwable();
|
||||
|
||||
//LogUtils.LOGI的depth是0, 该函数的depth是1, 调用者的depth是2,调用者的调用者是3
|
||||
int methodDepth = 2;
|
||||
StackTraceElement[] stackTraceElements = throwable.getStackTrace();
|
||||
|
||||
if (methodDepth < stackTraceElements.length) {
|
||||
StackTraceElement element = stackTraceElements[methodDepth];
|
||||
|
||||
if (showCaller) {
|
||||
if ((methodDepth + 1) < stackTraceElements.length) {
|
||||
StackTraceElement elementCaller = stackTraceElements[methodDepth + 1];
|
||||
|
||||
if (elementCaller != null && elementCaller.getFileName() != null) {
|
||||
|
||||
String callerClassName = elementCaller.getFileName().substring(0, elementCaller.getFileName().lastIndexOf("."));
|
||||
String className = element.getFileName().substring(0, element.getFileName().lastIndexOf("."));
|
||||
@SuppressLint("DefaultLocale") String loginfo = String.format("[%s.%s() (%s:%d)]", callerClassName, elementCaller.getMethodName(), elementCaller.getFileName(), elementCaller.getLineNumber());
|
||||
loginfo = loginfo + "\n";
|
||||
loginfo = loginfo + " " + String.format("[%s.%s() (%s:%d)]%s", className, element.getMethodName(), element.getFileName(), element.getLineNumber(), content);
|
||||
|
||||
content = loginfo;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
if (element != null && element.getFileName() != null) {
|
||||
String className = element.getFileName().substring(0, element.getFileName().lastIndexOf("."));
|
||||
content = String.format("[%s.%s() (%s:%d)]%s", className, element.getMethodName(), element.getFileName(), element.getLineNumber(), content);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (content.length() <= 3400) {
|
||||
log(logType, "返回值:" + content, tag);
|
||||
} else {
|
||||
int flag = 0;
|
||||
for (int i = 0; i < (content.length() / 3400); i++) {
|
||||
flag = i + 1;
|
||||
log(logType, "返回值(" + flag + "):"
|
||||
+ content.substring(i * 3400, flag * 3400), tag);
|
||||
}
|
||||
log(logType, "返回值(" + (flag + 1) + "):"
|
||||
+ content.substring(flag * 3400), tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void log(int logType, String content, String tag) {
|
||||
switch (logType) {
|
||||
case Log.INFO:
|
||||
Log.i(tag, "===================>" + content);
|
||||
break;
|
||||
case Log.DEBUG:
|
||||
Log.d(tag, "===================>" + content);
|
||||
break;
|
||||
case Log.ERROR:
|
||||
Log.e(tag, "===================>" + content);
|
||||
break;
|
||||
case Log.WARN:
|
||||
Log.w(tag, "===================>" + content);
|
||||
break;
|
||||
case Log.VERBOSE:
|
||||
Log.v(tag, "===================>" + content);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
public static byte[] desDecrypt(byte[] encryptText, String desKeyParameter) throws Exception {
|
||||
SecureRandom sr = new SecureRandom();
|
||||
byte rawKeyData[] = desKeyParameter.getBytes();
|
||||
DESKeySpec dks = new DESKeySpec(rawKeyData);
|
||||
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
|
||||
SecretKey key = keyFactory.generateSecret(dks);
|
||||
Cipher cipher = Cipher.getInstance("DES");
|
||||
cipher.init(Cipher.DECRYPT_MODE, key, sr);
|
||||
byte encryptedData[] = encryptText;
|
||||
byte decryptedData[] = cipher.doFinal(encryptedData);
|
||||
return decryptedData;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,12 +12,12 @@ import android.os.Message;
|
||||
public class MsgUtil {
|
||||
|
||||
public static void addHdMsgWat(Handler hd,int what){
|
||||
Message msg=Message.obtain();
|
||||
Message msg=new Message();
|
||||
msg.what=what;
|
||||
hd.sendMessage(msg);
|
||||
}
|
||||
public static void addHdMsgWatBody(Handler hd,int what,String body){
|
||||
Message msg=Message.obtain();
|
||||
Message msg=new Message();
|
||||
msg.what=what;
|
||||
msg.obj=body;
|
||||
hd.sendMessage(msg);
|
||||
|
||||
@@ -10,6 +10,7 @@ import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
@@ -17,6 +18,7 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||
import com.luck.picture.lib.broadcast.BroadcastManager;
|
||||
import com.scwang.smart.refresh.layout.SmartRefreshLayout;
|
||||
|
||||
public abstract class BaseActivity extends Activity {
|
||||
@@ -81,6 +83,7 @@ public abstract class BaseActivity extends Activity {
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
|
||||
}
|
||||
|
||||
MyReceiver receiver;
|
||||
@@ -91,7 +94,7 @@ public abstract class BaseActivity extends Activity {
|
||||
filter.addAction("exit_app");
|
||||
if(receiver!=null){
|
||||
Log.e("广播概况",receiver.toString()+"_"+this.toString());
|
||||
registerReceiver(receiver,filter);
|
||||
registerReceiver(receiver,filter,"com.dhhy.receiver",new Handler());
|
||||
}
|
||||
}
|
||||
class MyReceiver extends BroadcastReceiver {
|
||||
|
||||
+3
-1
@@ -9,6 +9,7 @@ import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -71,6 +72,7 @@ public class BaseAppCompatActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
|
||||
}
|
||||
|
||||
MyReceiver receiver;
|
||||
@@ -79,7 +81,7 @@ public class BaseAppCompatActivity extends AppCompatActivity {
|
||||
receiver = new MyReceiver();
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction("exit_app");
|
||||
registerReceiver(receiver,filter);
|
||||
registerReceiver(receiver,filter,"com.dhhy.receiver",new Handler());
|
||||
}
|
||||
class MyReceiver extends BroadcastReceiver {
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ public class BaseFragment extends Fragment {
|
||||
receiver = new MyReceiver();
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction("exit_app");
|
||||
getActivity().registerReceiver(receiver,filter);
|
||||
getActivity().registerReceiver(receiver,filter,"com.dhhy.receiver",new Handler());
|
||||
}
|
||||
class MyReceiver extends BroadcastReceiver {
|
||||
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.util.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.ColorMatrix;
|
||||
import android.graphics.ColorMatrixColorFilter;
|
||||
import android.graphics.Paint;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
/**
|
||||
* @ClassName GrayFrameLayout
|
||||
* @Author 用户
|
||||
* @Date 2023/1/29 15:28
|
||||
* @Description TODO
|
||||
*/
|
||||
public class GrayFrameLayout extends FrameLayout {
|
||||
private Paint mPaint = new Paint();
|
||||
|
||||
public GrayFrameLayout(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
ColorMatrix cm = new ColorMatrix();
|
||||
cm.setSaturation(0);
|
||||
mPaint.setColorFilter(new ColorMatrixColorFilter(cm));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatchDraw(Canvas canvas) {
|
||||
canvas.saveLayer(null, mPaint, Canvas.ALL_SAVE_FLAG);
|
||||
super.dispatchDraw(canvas);
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
canvas.saveLayer(null, mPaint, Canvas.ALL_SAVE_FLAG);
|
||||
super.draw(canvas);
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.weight;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
/**
|
||||
* @ClassName OnLimitClickHelper
|
||||
* @Author john
|
||||
* @Date 2024/4/22 14:28
|
||||
* @Description TODO
|
||||
*/
|
||||
public class OnLimitClickHelper implements View.OnClickListener {
|
||||
public static final int LIMIT_TIME = 2000;
|
||||
private long lastClickTime = 0;
|
||||
private OnLimitClickListener onLimitClickListener = null;
|
||||
|
||||
public OnLimitClickHelper(OnLimitClickListener onLimitClickListener){
|
||||
this.onLimitClickListener = onLimitClickListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
long curTime = Calendar.getInstance().getTimeInMillis();
|
||||
if (curTime - lastClickTime > LIMIT_TIME) {
|
||||
lastClickTime = curTime;
|
||||
if(onLimitClickListener != null){
|
||||
onLimitClickListener.onClick(v);
|
||||
}
|
||||
}else{
|
||||
ToastUtils.showToast(v.getContext(),"点击速度过快,请稍后重试");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.weight;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
/**
|
||||
* @ClassName OnLimitClickListener
|
||||
* @Author john
|
||||
* @Date 2024/4/22 14:28
|
||||
* @Description TODO
|
||||
*/
|
||||
public interface OnLimitClickListener {
|
||||
/**
|
||||
* 按钮点击事件
|
||||
* @param view
|
||||
*/
|
||||
void onClick(View view);
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 8.0 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 7.0 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user