Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
505c68fb6b | ||
|
|
053d819d27 | ||
|
|
45d8b3351d | ||
|
|
10a379ed8f | ||
|
|
a44df1ee8c | ||
|
|
50cc329a4d | ||
|
|
360f492b8a | ||
|
|
dc4f34efd7 | ||
|
|
3955131756 | ||
|
|
f4d2048d81 | ||
|
|
244a3f22eb |
+32
-20
@@ -16,27 +16,29 @@ android {
|
|||||||
keyPassword '123456'
|
keyPassword '123456'
|
||||||
storeFile file('key.jks')
|
storeFile file('key.jks')
|
||||||
storePassword '123456'
|
storePassword '123456'
|
||||||
|
v1SigningEnabled true
|
||||||
|
v2SigningEnabled true
|
||||||
}
|
}
|
||||||
debug {
|
// debug {
|
||||||
keyAlias 'key0'
|
// keyAlias 'key0'
|
||||||
keyPassword '123456'
|
// keyPassword '123456'
|
||||||
storeFile file('key.jks')
|
// storeFile file('key.jks')
|
||||||
storePassword '123456'
|
// storePassword '123456'
|
||||||
}
|
// }
|
||||||
release {
|
// release {
|
||||||
keyAlias 'key0'
|
// keyAlias 'key0'
|
||||||
keyPassword '123456'
|
// keyPassword '123456'
|
||||||
storeFile file('key.jks')
|
// storeFile file('key.jks')
|
||||||
storePassword '123456'
|
// storePassword '123456'
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.arpa.hndahesudintocctmsdriver"
|
applicationId "com.arpa.hndahesudintocctmsdriver"
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 57
|
versionCode 59
|
||||||
versionName "3.2.7"
|
versionName "3.2.9"
|
||||||
flavorDimensions "CHANNEL_VALUE"
|
flavorDimensions "CHANNEL_VALUE"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
javaCompileOptions {
|
javaCompileOptions {
|
||||||
@@ -86,9 +88,10 @@ android {
|
|||||||
release {
|
release {
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
signingConfig signingConfigs.config
|
||||||
}
|
}
|
||||||
debug {
|
debug {
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
signingConfig signingConfigs.config
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
@@ -113,15 +116,19 @@ android {
|
|||||||
productFlavors {
|
productFlavors {
|
||||||
qa {
|
qa {
|
||||||
manifestPlaceholders = [CHANNEL_VALUE: "好运司机测试"]
|
manifestPlaceholders = [CHANNEL_VALUE: "好运司机测试"]
|
||||||
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi-staging.alct56.com/api/v1/openapi/\"")
|
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi-staging.alct56.com\"")
|
||||||
buildConfigField("String", "BASE_URL", "\"http://app.test.dahehuoyun.com/api/\"")
|
buildConfigField("String", "BASE_URL", "\"http://app.test.dahehuoyun.com/api/\"")
|
||||||
buildConfigField "boolean", "isTest", "true"
|
buildConfigField "boolean", "isTest", "true"
|
||||||
|
//APP名称,可以在androidMainfest中引用
|
||||||
|
resValue "string", "appName", "司机测试"
|
||||||
}
|
}
|
||||||
product {
|
product {
|
||||||
manifestPlaceholders = [CHANNEL_VALUE: "大河好运司机"]
|
manifestPlaceholders = [CHANNEL_VALUE: "大河好运司机"]
|
||||||
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi.alct56.com\"")
|
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi.alct56.com\"")
|
||||||
buildConfigField("String", "BASE_URL", "\"http://app.dahehuoyun.com/api/\"")
|
buildConfigField("String", "BASE_URL", "\"http://app.dahehuoyun.com/api/\"")
|
||||||
buildConfigField "boolean", "isTest", "false"
|
buildConfigField "boolean", "isTest", "false"
|
||||||
|
//APP名称,可以在androidMainfest中引用
|
||||||
|
resValue "string", "appName", "大河好运司机"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -133,9 +140,14 @@ android {
|
|||||||
android.applicationVariants.all { variant ->
|
android.applicationVariants.all { variant ->
|
||||||
variant.outputs.all {
|
variant.outputs.all {
|
||||||
def date = new Date().format("MMdd_HH-mm" , TimeZone.getTimeZone("GMT+08"))
|
def date = new Date().format("MMdd_HH-mm" , TimeZone.getTimeZone("GMT+08"))
|
||||||
if(variant.buildType.name.equals('release')){
|
def isText = variant.productFlavors[0].properties.get("buildConfigFields").getAt("isTest").properties.get("value")
|
||||||
outputFileName = "dhhy-driver-"+date+"-${versionName}.apk"
|
def appName = null
|
||||||
|
if (isText=="true") {
|
||||||
|
appName = '大河好运司机测试_'
|
||||||
|
}else{
|
||||||
|
appName = '大河好运司机_'
|
||||||
}
|
}
|
||||||
|
outputFileName =appName+"${variant.buildType.name}_${defaultConfig.versionName}_${date}.apk"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lintOptions {
|
lintOptions {
|
||||||
@@ -164,8 +176,8 @@ dependencies {
|
|||||||
implementation 'com.scwang.smart:refresh-footer-ball:2.0.1' //球脉冲加载
|
implementation 'com.scwang.smart:refresh-footer-ball:2.0.1' //球脉冲加载
|
||||||
implementation 'com.scwang.smart:refresh-footer-classics:2.0.1' //经典加载
|
implementation 'com.scwang.smart:refresh-footer-classics:2.0.1' //经典加载
|
||||||
//更新版本
|
//更新版本
|
||||||
implementation 'com.github.jenly1314.AppUpdater:app-updater:1.1.0'
|
implementation 'com.github.jenly1314.AppUpdater:app-updater:1.2.0'
|
||||||
implementation 'com.github.jenly1314.AppUpdater:app-dialog:1.1.0'
|
implementation 'com.github.jenly1314.AppUpdater:app-dialog:1.2.0'
|
||||||
//轮播插件
|
//轮播插件
|
||||||
implementation 'com.github.zhpanvip:BannerViewPager:3.5.4'
|
implementation 'com.github.zhpanvip:BannerViewPager:3.5.4'
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||||
<uses-permission android:name="android.permission.EACCES" />
|
<uses-permission android:name="android.permission.EACCES" />
|
||||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||||
|
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
||||||
<uses-feature
|
<uses-feature
|
||||||
android:name="android.hardware.nfc"
|
android:name="android.hardware.nfc"
|
||||||
android:required="true" />
|
android:required="true" />
|
||||||
@@ -54,13 +54,13 @@
|
|||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:excludeFromRecents="true"
|
android:excludeFromRecents="true"
|
||||||
android:icon="@drawable/diver_logo"
|
android:icon="@drawable/diver_logo"
|
||||||
android:label="@string/app_name"
|
android:label="@string/appName"
|
||||||
android:largeHeap="true"
|
android:largeHeap="true"
|
||||||
android:requestLegacyExternalStorage="true"
|
android:requestLegacyExternalStorage="true"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppTheme"
|
android:theme="@style/AppTheme"
|
||||||
android:usesCleartextTraffic="true"
|
android:usesCleartextTraffic="true"
|
||||||
tools:replace="android:icon">
|
tools:replace="android:label,android:allowBackup">
|
||||||
|
|
||||||
<uses-library
|
<uses-library
|
||||||
android:name="com/alct/mdp"
|
android:name="com/alct/mdp"
|
||||||
@@ -111,6 +111,21 @@
|
|||||||
|
|
||||||
</activity>
|
</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
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity2"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity2"
|
||||||
android:screenOrientation="portrait">
|
android:screenOrientation="portrait">
|
||||||
|
|||||||
@@ -9,27 +9,41 @@ import android.content.IntentFilter;
|
|||||||
import android.content.pm.ApplicationInfo;
|
import android.content.pm.ApplicationInfo;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
|
import android.os.Environment;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import androidx.core.app.ActivityCompat;
|
||||||
|
|
||||||
import com.alct.mdp.MDPLocationCollectionManager;
|
import com.alct.mdp.MDPLocationCollectionManager;
|
||||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.net.Api;
|
import com.arpa.hndahesudintocctmsdriver.request.net.Api;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.BillLocationUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.BillLocationUtils;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.location.LocationGDUtil;
|
||||||
import com.dahe.mylibrary.CommonBaseLibrary;
|
import com.dahe.mylibrary.CommonBaseLibrary;
|
||||||
|
import com.dahe.mylibrary.utils.TimeUtil;
|
||||||
import com.dahe.mylibrary.utils.ToastUtils;
|
import com.dahe.mylibrary.utils.ToastUtils;
|
||||||
import com.esign.esignsdk.EsignSdk;
|
import com.esign.esignsdk.EsignSdk;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||||
import com.gyf.cactus.Cactus;
|
import com.gyf.cactus.Cactus;
|
||||||
import com.gyf.cactus.callback.CactusBackgroundCallback;
|
import com.gyf.cactus.callback.CactusBackgroundCallback;
|
||||||
import com.gyf.cactus.callback.CactusCallback;
|
import com.gyf.cactus.callback.CactusCallback;
|
||||||
|
import com.permissionx.guolindev.PermissionX;
|
||||||
|
import com.tencent.bugly.crashreport.CrashReport;
|
||||||
import com.umeng.commonsdk.UMConfigure;
|
import com.umeng.commonsdk.UMConfigure;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Timer;
|
||||||
|
import java.util.TimerTask;
|
||||||
|
|
||||||
import cn.jiguang.verifysdk.api.JVerificationInterface;
|
import cn.jiguang.verifysdk.api.JVerificationInterface;
|
||||||
|
|
||||||
public class App extends Application {
|
public class App extends Application implements CactusCallback {
|
||||||
|
|
||||||
// String key = "f9d35b1133cff1f6e3960c89b249e03f";
|
// String key = "f9d35b1133cff1f6e3960c89b249e03f";
|
||||||
String key = "19ac0aa74338e487e45057faf7212401";
|
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 = "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==";
|
||||||
|
|
||||||
@@ -40,12 +54,14 @@ public class App extends Application {
|
|||||||
public static int APP_STATUS = APP_STATUS_KILLED; // 记录App的启动状态
|
public static int APP_STATUS = APP_STATUS_KILLED; // 记录App的启动状态
|
||||||
private Context con;
|
private Context con;
|
||||||
public static App mApplication = null;
|
public static App mApplication = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
mApplication = this;
|
mApplication = this;
|
||||||
con = getBaseContext();
|
con = getBaseContext();
|
||||||
CommonBaseLibrary.getInstance().init(this, Api.BASE_URL);
|
CommonBaseLibrary.getInstance().init(this, Api.BASE_URL);
|
||||||
|
CrashReport.initCrashReport(getApplicationContext(), "0fa55ffad8", false);
|
||||||
String state = SPUtil.getSP(con, "state_data", "authorization_state");
|
String state = SPUtil.getSP(con, "state_data", "authorization_state");
|
||||||
if ("1".equals(state)) {
|
if ("1".equals(state)) {
|
||||||
try {
|
try {
|
||||||
@@ -76,29 +92,34 @@ public class App extends Application {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// PendingIntent pendingIntent =
|
PendingIntent pendingIntent =
|
||||||
// PendingIntent.getActivity(this, 0, new Intent(this, MainActivity.class), PendingIntent.FLAG_UPDATE_CURRENT);
|
PendingIntent.getActivity(this, 0, new Intent(this, MainActivity.class), PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
// Cactus.getInstance()
|
Cactus.getInstance()
|
||||||
// .isDebug(true)
|
.isDebug(true)
|
||||||
// //可选,设置通知栏点击事件
|
.setTitle("好运司机")
|
||||||
// .setPendingIntent(pendingIntent)
|
.setContent("您的接单助手!")
|
||||||
//// .setBackgroundMusicEnabled(true)//可选,退到后台是否可以播放音乐
|
.setChannelId("gld")
|
||||||
//// .setMusicId(R.raw.main) //可选,设置音乐
|
.setChannelName("好运司机")
|
||||||
//// .setPendingIntent(pendingIntent)//可选,设置通知栏点击事件
|
.setServiceId(Integer.MAX_VALUE)
|
||||||
//// .addCallback(new CactusCallback())//可选,运行时回调
|
//可选,设置通知栏点击事件
|
||||||
// .setCrashRestartUIEnabled(true) //可选,设置奔溃可以重启,google原生rom android 10以下可以正常重启
|
.setPendingIntent(pendingIntent)
|
||||||
// .setCrashRestartUIEnabled(true)//可选,设置奔溃可以重启,google原生rom android 10以下可以正常重启
|
.setBackgroundMusicEnabled(true)//可选,退到后台是否可以播放音乐
|
||||||
// .setTitle("大河好运")
|
.setMusicId(R.raw.main) //可选,设置音乐
|
||||||
// .setSmallIcon(R.drawable.diver_logo)
|
// .setPendingIntent(pendingIntent)//可选,设置通知栏点击事件
|
||||||
// .addBackgroundCallback(new CactusBackgroundCallback() {
|
// .addCallback(new CactusCallback())//可选,运行时回调
|
||||||
// @Override
|
.setCrashRestartUIEnabled(true) //可选,设置奔溃可以重启,google原生rom android 10以下可以正常重启
|
||||||
// public void onBackground(boolean b) {
|
.setCrashRestartUIEnabled(true)//可选,设置奔溃可以重启,google原生rom android 10以下可以正常重启
|
||||||
// if (b){
|
.setSmallIcon(R.drawable.diver_logo)
|
||||||
// getBillLocation();
|
.addCallback(this)
|
||||||
// }
|
.addBackgroundCallback(new CactusBackgroundCallback() {
|
||||||
// }
|
@Override
|
||||||
// })
|
public void onBackground(boolean b) {
|
||||||
// .register(this);
|
if (b) {
|
||||||
|
getBillLocation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static App getApp() {
|
public static App getApp() {
|
||||||
@@ -147,4 +168,62 @@ public class App extends Application {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doWork(int i) {
|
||||||
|
|
||||||
|
|
||||||
|
new Timer().schedule(new TimerTask() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
FileOutputStream fos = null;
|
||||||
|
try {
|
||||||
|
String nowString = TimeUtil.getNowString(TimeUtil.DEFAULT_FORMAT);
|
||||||
|
String content = i + "当前时间:"+nowString;
|
||||||
|
String fileName = "location" + ".txt";
|
||||||
|
|
||||||
|
if (Environment.getExternalStorageState().equals(
|
||||||
|
Environment.MEDIA_MOUNTED)) {
|
||||||
|
//获取文件输出路径
|
||||||
|
String path = Environment.getExternalStorageDirectory()
|
||||||
|
+ "/crashinfo2/";
|
||||||
|
//创建文件夹和文件
|
||||||
|
File dir = new File(path);
|
||||||
|
if (!dir.exists()) {
|
||||||
|
dir.mkdirs();
|
||||||
|
}
|
||||||
|
// File file = new File(path + fileName);
|
||||||
|
// if (!file.exists())
|
||||||
|
// file.createNewFile();
|
||||||
|
//创建输出流
|
||||||
|
fos = new FileOutputStream(path + fileName,true);
|
||||||
|
File file = new File(path + fileName);
|
||||||
|
if (file.exists()){
|
||||||
|
fos.write('\r');
|
||||||
|
}
|
||||||
|
//向文件中写出数据
|
||||||
|
fos.write(content.toString().getBytes());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fos.flush();
|
||||||
|
fos.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if (fos != null) {
|
||||||
|
fos.close();
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 100, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStop() {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -224,27 +224,6 @@ public class H5Activity extends AppCompatActivity {
|
|||||||
|
|
||||||
Uri uri = Uri.parse(url);
|
Uri uri = Uri.parse(url);
|
||||||
Log.e("test", "要加载的地址:" + uri.getScheme() + " " + url + " ");
|
Log.e("test", "要加载的地址:" + uri.getScheme() + " " + url + " ");
|
||||||
|
|
||||||
|
|
||||||
// if (url.contains("callback")) {
|
|
||||||
// // 实名认证结束 返回按钮/倒计时返回/暂不认证
|
|
||||||
// boolean status = uri.getBooleanQueryParameter("passed", false);
|
|
||||||
// if (status) {
|
|
||||||
//
|
|
||||||
// new Handler().postDelayed(() -> {
|
|
||||||
// FaceEvent he = new FaceEvent("刷脸成功");
|
|
||||||
// EventBus.getDefault().post(he);
|
|
||||||
// finish();
|
|
||||||
// }, 4000);
|
|
||||||
// }else{
|
|
||||||
// if (mWebView.canGoBack()) {
|
|
||||||
// mWebView.goBack();
|
|
||||||
// }
|
|
||||||
// Toast.makeText(H5Activity.this, "认证失败,请重新刷脸认证", Toast.LENGTH_SHORT).show();
|
|
||||||
// }
|
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (uri.getScheme().equals("http") || uri.getScheme().equals("https")) {
|
if (uri.getScheme().equals("http") || uri.getScheme().equals("https")) {
|
||||||
view.loadUrl(url);
|
view.loadUrl(url);
|
||||||
return true;
|
return true;
|
||||||
@@ -312,16 +291,19 @@ public class H5Activity extends AppCompatActivity {
|
|||||||
} else {
|
} else {
|
||||||
String tsignCode = uri.getQueryParameter("tsignCode");
|
String tsignCode = uri.getQueryParameter("tsignCode");
|
||||||
if ("0".equals(tsignCode)) {
|
if ("0".equals(tsignCode)) {
|
||||||
FaceEvent he = new FaceEvent("刷脸成功");
|
//延时1.5秒跳转运单详情页面
|
||||||
EventBus.getDefault().post(he);
|
new Handler().postDelayed(() -> {
|
||||||
finish();
|
FaceEvent he = new FaceEvent("刷脸成功");
|
||||||
|
EventBus.getDefault().post(he);
|
||||||
|
finish();
|
||||||
|
}, 800);
|
||||||
tsignCode = "签署成功";
|
tsignCode = "签署成功";
|
||||||
} else {
|
} else {
|
||||||
tsignCode = "签署失败";
|
tsignCode = "签署失败";
|
||||||
}
|
}
|
||||||
Toast.makeText(H5Activity.this, "签署结果: " + tsignCode, Toast.LENGTH_LONG).show();
|
Toast.makeText(H5Activity.this, "签署结果: " + tsignCode, Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
finish();
|
// finish();
|
||||||
return true;
|
return true;
|
||||||
} else if (uri.getScheme().equals("alipays")) {
|
} else if (uri.getScheme().equals("alipays")) {
|
||||||
// 跳转到支付宝刷脸
|
// 跳转到支付宝刷脸
|
||||||
|
|||||||
@@ -1,14 +1,18 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.cuspop
|
package com.arpa.hndahesudintocctmsdriver.cuspop
|
||||||
|
|
||||||
import android.app.Activity
|
import android.Manifest
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import android.widget.Toast
|
||||||
|
import androidx.fragment.app.FragmentActivity
|
||||||
import com.arpa.hndahesudintocctmsdriver.R
|
import com.arpa.hndahesudintocctmsdriver.R
|
||||||
import com.dahe.mylibrary.utils.BaseUtils
|
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil
|
||||||
import com.dahe.mylibrary.utils.ToastUtils
|
import com.dahe.mylibrary.utils.ToastUtils
|
||||||
import com.lxj.xpopup.core.CenterPopupView
|
import com.lxj.xpopup.core.CenterPopupView
|
||||||
|
import com.lxj.xpopup.util.XPermission
|
||||||
|
import com.permissionx.guolindev.PermissionX
|
||||||
import kotlinx.android.synthetic.main.load.view.*
|
import kotlinx.android.synthetic.main.load.view.*
|
||||||
import kotlinx.android.synthetic.main.pop_message_center.view.*
|
import kotlinx.android.synthetic.main.pop_message_center.view.*
|
||||||
|
|
||||||
@@ -51,12 +55,16 @@ class MessagePop(context: Context) : CenterPopupView(context), View.OnClickListe
|
|||||||
}
|
}
|
||||||
R.id.tvOk,R.id.tvPhone -> {
|
R.id.tvOk,R.id.tvPhone -> {
|
||||||
dismiss()
|
dismiss()
|
||||||
val toString = tvPhone.text.toString()
|
if (XPermission.create(context).isGranted(Manifest.permission.CALL_PHONE)){
|
||||||
val intent = Intent(Intent.ACTION_CALL)
|
val toString = tvPhone.text.toString()
|
||||||
val data = Uri.parse("tel:$toString")
|
val intent = Intent(Intent.ACTION_DIAL)
|
||||||
intent.data = data
|
val data = Uri.parse("tel:$toString")
|
||||||
context.startActivity(intent)
|
intent.data = data
|
||||||
dismiss()
|
context.startActivity(intent)
|
||||||
|
}else{
|
||||||
|
ToastUtils.showToast(context,"请开启电话权限")
|
||||||
|
}
|
||||||
|
|
||||||
// BaseUtils.callPhone(content as Activity, tvPhone.text.toString())
|
// BaseUtils.callPhone(content as Activity, tvPhone.text.toString())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ public class ALProcess {
|
|||||||
//企业代码-测试
|
//企业代码-测试
|
||||||
private static final String ENTERPRISE_CODE_TEXT="E0019093";
|
private static final String ENTERPRISE_CODE_TEXT="E0019093";
|
||||||
//企业app的身份码-测试
|
//企业app的身份码-测试
|
||||||
private static final String APP_IDENTITY_TEXT="07a6256cad5642138ed6e962a5a157be";
|
private static final String APP_IDENTITY_TEXT="a15b4ba5bd2542cc9a6bea9bdadf9ef9";
|
||||||
//企业app验证码-测试
|
//企业app验证码-测试
|
||||||
private static final String APP_KEY_TEXT="a15b4ba5bd2542cc9a6bea9bdadf9ef9";
|
private static final String APP_KEY_TEXT="07a6256cad5642138ed6e962a5a157be";
|
||||||
|
|
||||||
|
|
||||||
public static void verification(Context con){
|
public static void verification(Context con){
|
||||||
@@ -141,6 +141,7 @@ public class ALProcess {
|
|||||||
MDPLocationCollectionManager.register(con, idy, new OnResultListener() {
|
MDPLocationCollectionManager.register(con, idy, new OnResultListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
|
MsgUtil.addHdMsgWatBody(hd, 1111,"认证成功");
|
||||||
Log.e("--success--","验证成功");
|
Log.e("--success--","验证成功");
|
||||||
getFq(con);
|
getFq(con);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,6 +138,7 @@ class MainActivity : BaseAppCompatActivity() {
|
|||||||
Manifest.permission.ACCESS_BACKGROUND_LOCATION,
|
Manifest.permission.ACCESS_BACKGROUND_LOCATION,
|
||||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||||
|
Manifest.permission.CALL_PHONE,
|
||||||
Manifest.permission.RECORD_AUDIO,
|
Manifest.permission.RECORD_AUDIO,
|
||||||
Manifest.permission.CAMERA)
|
Manifest.permission.CAMERA)
|
||||||
.request { allGranted, grantedList, deniedList ->
|
.request { allGranted, grantedList, deniedList ->
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.arpa.hndahesudintocctmsdriver.ui.alert;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
@@ -12,6 +13,8 @@ import androidx.annotation.NonNull;
|
|||||||
|
|
||||||
import com.king.app.updater.AppUpdater;
|
import com.king.app.updater.AppUpdater;
|
||||||
import com.king.app.updater.callback.AppUpdateCallback;
|
import com.king.app.updater.callback.AppUpdateCallback;
|
||||||
|
import com.king.app.updater.constant.Constants;
|
||||||
|
import com.king.app.updater.util.AppUtils;
|
||||||
import com.lxj.xpopup.core.CenterPopupView;
|
import com.lxj.xpopup.core.CenterPopupView;
|
||||||
import com.arpa.hndahesudintocctmsdriver.R;
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
|
|
||||||
@@ -27,8 +30,8 @@ import java.io.File;
|
|||||||
*/
|
*/
|
||||||
public class UpAppAlert extends CenterPopupView {
|
public class UpAppAlert extends CenterPopupView {
|
||||||
|
|
||||||
private TextView content,vs;
|
private TextView content,vs,tvContent;
|
||||||
private Button tv_cancel,tv_confirm;
|
private Button tv_cancel,tv_confirm,tvOk;
|
||||||
private LinearLayout up_div;
|
private LinearLayout up_div;
|
||||||
private String url="";
|
private String url="";
|
||||||
private String body="";
|
private String body="";
|
||||||
@@ -63,6 +66,8 @@ public class UpAppAlert extends CenterPopupView {
|
|||||||
content=findViewById(R.id.tv_content);
|
content=findViewById(R.id.tv_content);
|
||||||
tv_cancel=findViewById(R.id.tv_cancel);
|
tv_cancel=findViewById(R.id.tv_cancel);
|
||||||
tv_confirm=findViewById(R.id.tv_confirm);
|
tv_confirm=findViewById(R.id.tv_confirm);
|
||||||
|
tvContent=findViewById(R.id.tvContent);
|
||||||
|
tvOk=findViewById(R.id.tvOk);
|
||||||
up_div=findViewById(R.id.up_div);
|
up_div=findViewById(R.id.up_div);
|
||||||
progress_view=findViewById(R.id.progress);
|
progress_view=findViewById(R.id.progress);
|
||||||
content=findViewById(R.id.tv_content);
|
content=findViewById(R.id.tv_content);
|
||||||
@@ -109,7 +114,11 @@ public class UpAppAlert extends CenterPopupView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFinish(File file) {
|
public void onFinish(File file) {
|
||||||
|
tvContent.setText("下载完成,请及时安装!");
|
||||||
|
tvOk.setVisibility(VISIBLE);
|
||||||
|
tvOk.setOnClickListener(v1 -> {
|
||||||
|
AppUtils.installApk(getContext(),file,getContext().getPackageName() + Constants.DEFAULT_FILE_PROVIDER);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.start();
|
.start();
|
||||||
|
|||||||
+6
-1
@@ -229,6 +229,11 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
|||||||
gia.showPopueWindow(this);
|
gia.showPopueWindow(this);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
up_img.setOnClickListener(v -> {
|
||||||
|
if (!isAuth) {
|
||||||
|
gia.showPopueWindow(this);
|
||||||
|
}
|
||||||
|
});
|
||||||
img.setOnClickListener(v -> {
|
img.setOnClickListener(v -> {
|
||||||
if (!"".equals(url)) {
|
if (!"".equals(url)) {
|
||||||
new XPopup.Builder(con).asImageViewer(img, url, new SmartGlideImageLoader(R.mipmap.ic_launcher_round)).show();
|
new XPopup.Builder(con).asImageViewer(img, url, new SmartGlideImageLoader(R.mipmap.ic_launcher_round)).show();
|
||||||
@@ -250,7 +255,7 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
|||||||
String id = value1.getText() + "";
|
String id = value1.getText() + "";
|
||||||
String date = value2.getText() + "";
|
String date = value2.getText() + "";
|
||||||
if ("0".equals(type)) {
|
if ("0".equals(type)) {
|
||||||
if (!"".equals(id) && !"".equals(date) && !"".equals(url)) {
|
if (!"".equals(date) && !"".equals(url)) {
|
||||||
new AuthRequest().driverAuthQualification(con, hd, id, ub.getData().getId(), date);
|
new AuthRequest().driverAuthQualification(con, hd, id, ub.getData().getId(), date);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, "请补充证件信息", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "请补充证件信息", Toast.LENGTH_SHORT).show();
|
||||||
|
|||||||
@@ -315,6 +315,10 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
* 展示大图片
|
* 展示大图片
|
||||||
*/
|
*/
|
||||||
private void showBigImg() {
|
private void showBigImg() {
|
||||||
|
if (TextUtils.isEmpty(cdb.getData().getRoadLicensePhoto())){
|
||||||
|
choicePhoto();
|
||||||
|
return;
|
||||||
|
}
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 0:
|
case 0:
|
||||||
if (cdb.getData().getRoadLicensePhoto() != null && !cdb.getData().getCarImage().equals("")) {
|
if (cdb.getData().getRoadLicensePhoto() != null && !cdb.getData().getCarImage().equals("")) {
|
||||||
|
|||||||
+221
-201
@@ -40,7 +40,10 @@ import com.amap.api.services.route.DriveStep;
|
|||||||
import com.amap.api.services.route.RideRouteResult;
|
import com.amap.api.services.route.RideRouteResult;
|
||||||
import com.amap.api.services.route.RouteSearch;
|
import com.amap.api.services.route.RouteSearch;
|
||||||
import com.amap.api.services.route.WalkRouteResult;
|
import com.amap.api.services.route.WalkRouteResult;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||||
import com.bumptech.glide.Glide;
|
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.android.material.bottomsheet.BottomSheetBehavior;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.arpa.hndahesudintocctmsdriver.R;
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
@@ -73,11 +76,11 @@ import java.util.List;
|
|||||||
|
|
||||||
public class StartYunDanActivity extends BaseActivity {
|
public class StartYunDanActivity extends BaseActivity {
|
||||||
|
|
||||||
public static final String GET_EVALUTE="getEvalute";
|
public static final String GET_EVALUTE = "getEvalute";
|
||||||
public static final String KEEP_EVALUTE="keepEvalte";
|
public static final String KEEP_EVALUTE = "keepEvalte";
|
||||||
public static final String GET_COMPLAINT="getComplaint";
|
public static final String GET_COMPLAINT = "getComplaint";
|
||||||
|
|
||||||
private String TAG="StartYunDanActivity";
|
private String TAG = "StartYunDanActivity";
|
||||||
private NestedScrollView bottomSheet;
|
private NestedScrollView bottomSheet;
|
||||||
private MapView map;
|
private MapView map;
|
||||||
private BaseRecyclerView brv;
|
private BaseRecyclerView brv;
|
||||||
@@ -85,57 +88,58 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
private LinearLayout protect;
|
private LinearLayout protect;
|
||||||
//private RelativeLayout title_rl;
|
//private RelativeLayout title_rl;
|
||||||
private TextView title;
|
private TextView title;
|
||||||
private ScoreView sv1,sv2;
|
private ScoreView sv1, sv2;
|
||||||
private Gson gson=new Gson();
|
private Gson gson = new Gson();
|
||||||
private StartOrderBean sob;
|
private StartOrderBean sob;
|
||||||
private WNewsBean wnb;
|
private WNewsBean wnb;
|
||||||
private HuoYuanRequset hyr;
|
private HuoYuanRequset hyr;
|
||||||
//是否处于展开状态
|
//是否处于展开状态
|
||||||
private boolean key=false;
|
private boolean key = false;
|
||||||
private int id=0;
|
private int id = 0;
|
||||||
LocationGDUtil ld;
|
LocationGDUtil ld;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void msgMethod(Message m) {
|
public void msgMethod(Message m) {
|
||||||
super.msgMethod(m);
|
super.msgMethod(m);
|
||||||
switch (m.what){
|
switch (m.what) {
|
||||||
case RequsetCodeConstants.SUCCESS:
|
case RequsetCodeConstants.SUCCESS:
|
||||||
//获取页面数据
|
//获取页面数据
|
||||||
if (CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER)!=null && CacheGroup.cacheList.get(GET_EVALUTE)!=null) {
|
if (CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER) != null && CacheGroup.cacheList.get(GET_EVALUTE) != null) {
|
||||||
Log.e("-评论-",CacheGroup.cacheList.get(GET_EVALUTE));
|
Log.e("-评论-", CacheGroup.cacheList.get(GET_EVALUTE));
|
||||||
Log.e("-运单-",CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER));
|
Log.e("-运单-", CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER));
|
||||||
sob=gson.fromJson(CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER), StartOrderBean.class);
|
sob = gson.fromJson(CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER), StartOrderBean.class);
|
||||||
wnb=gson.fromJson(CacheGroup.cacheList.get(GET_EVALUTE), WNewsBean.class);
|
wnb = gson.fromJson(CacheGroup.cacheList.get(GET_EVALUTE), WNewsBean.class);
|
||||||
if(sob.getCode()==200 && sob.getData()!=null){
|
if (sob.getCode() == 200 && sob.getData() != null) {
|
||||||
id = sob.getData().getWaybillId();
|
id = sob.getData().getWaybillId();
|
||||||
initView(null);
|
initView(null);
|
||||||
}else if(sob.getData()==null){
|
} else if (sob.getData() == null) {
|
||||||
// Toast.makeText(con,"运单执行结束",Toast.LENGTH_SHORT).show();
|
// Toast.makeText(con,"运单执行结束",Toast.LENGTH_SHORT).show();
|
||||||
SPUtil.insSP(con,"order","ShippingNoteNumber","");
|
SPUtil.insSP(con, "order", "ShippingNoteNumber", "");
|
||||||
UiAuxiliary.homeRequest("运单结束");
|
UiAuxiliary.homeRequest("运单结束");
|
||||||
// finish();
|
// finish();
|
||||||
}else{
|
} else {
|
||||||
Toast.makeText(con,sob.getMsg(),Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, sob.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove(HuoYuanFragmengt.START_ORDER);
|
CacheGroup.cacheList.remove(HuoYuanFragmengt.START_ORDER);
|
||||||
CacheGroup.cacheList.remove(GET_EVALUTE);
|
CacheGroup.cacheList.remove(GET_EVALUTE);
|
||||||
}
|
}
|
||||||
//保存评价
|
//保存评价
|
||||||
if(CacheGroup.cacheList.get(KEEP_EVALUTE)!=null){
|
if (CacheGroup.cacheList.get(KEEP_EVALUTE) != null) {
|
||||||
BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(KEEP_EVALUTE),BaseBean.class);
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(KEEP_EVALUTE), BaseBean.class);
|
||||||
if(bb.getCode()==200){
|
if (bb.getCode() == 200) {
|
||||||
Toast.makeText(con,"评价保存成功",Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "评价保存成功", Toast.LENGTH_SHORT).show();
|
||||||
hyr.startOrder(id);
|
hyr.startOrder(id);
|
||||||
hyr.getEvaluate(id);
|
hyr.getEvaluate(id);
|
||||||
}else{
|
} else {
|
||||||
Toast.makeText(con,bb.getMsg(),Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove(KEEP_EVALUTE);
|
CacheGroup.cacheList.remove(KEEP_EVALUTE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 15:
|
case 15:
|
||||||
break;
|
break;
|
||||||
default:break;
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,28 +151,28 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
StateStyleUtil.stateTextColor(this);
|
StateStyleUtil.stateTextColor(this);
|
||||||
setContentView(R.layout.activity_yundan_start);
|
setContentView(R.layout.activity_yundan_start);
|
||||||
con=this;
|
con = this;
|
||||||
id=getIntent().getExtras().getInt("id");
|
id = getIntent().getExtras().getInt("id");
|
||||||
brv=findViewById(R.id.brv);
|
brv = findViewById(R.id.brv);
|
||||||
protect=findViewById(R.id.protect);
|
protect = findViewById(R.id.protect);
|
||||||
title=findViewById(R.id.title);
|
title = findViewById(R.id.title);
|
||||||
bottomSheet =findViewById(R.id.bottom_sheet);
|
bottomSheet = findViewById(R.id.bottom_sheet);
|
||||||
BottomSheetBehavior mBottomSheetBehavior = BottomSheetBehavior.from(bottomSheet);
|
BottomSheetBehavior mBottomSheetBehavior = BottomSheetBehavior.from(bottomSheet);
|
||||||
mBottomSheetBehavior.setHideable(false);
|
mBottomSheetBehavior.setHideable(false);
|
||||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||||
//mBottomSheetBehavior.set
|
//mBottomSheetBehavior.set
|
||||||
map=findViewById(R.id.map);
|
map = findViewById(R.id.map);
|
||||||
map.onCreate(savedInstanceState);
|
map.onCreate(savedInstanceState);
|
||||||
if (aMap == null) {
|
if (aMap == null) {
|
||||||
aMap = map.getMap();
|
aMap = map.getMap();
|
||||||
initLoaction();
|
initLoaction();
|
||||||
}
|
}
|
||||||
Log.e("--id--",""+id);
|
Log.e("--id--", "" + id);
|
||||||
String userdata= SPUtil.getSP(con,"data","userdata");
|
String userdata = SPUtil.getSP(con, "data", "userdata");
|
||||||
if(!userdata.equals("")){
|
if (!userdata.equals("")) {
|
||||||
ub=gson.fromJson(userdata,UserBean.class);
|
ub = gson.fromJson(userdata, UserBean.class);
|
||||||
}
|
}
|
||||||
hyr=new HuoYuanRequset(con,hd);
|
hyr = new HuoYuanRequset(con, hd);
|
||||||
// hyr.startOrder(id);
|
// hyr.startOrder(id);
|
||||||
// hyr.getEvaluate(id);
|
// hyr.getEvaluate(id);
|
||||||
}
|
}
|
||||||
@@ -184,59 +188,60 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
//控件隐藏的动画
|
//控件隐藏的动画
|
||||||
mHiddenAmin = new AlphaAnimation(1.0f, 0.0f);
|
mHiddenAmin = new AlphaAnimation(1.0f, 0.0f);
|
||||||
mHiddenAmin.setDuration(1000);
|
mHiddenAmin.setDuration(1000);
|
||||||
List<ManyBean> list=new ArrayList<>();
|
List<ManyBean> list = new ArrayList<>();
|
||||||
//list.add(new ManyBean(new model(),R.layout.yundan_start_top));
|
//list.add(new ManyBean(new model(),R.layout.yundan_start_top));
|
||||||
list.add(new ManyBean(sob.getData(),R.layout.item_yundan_yunxing));
|
list.add(new ManyBean(sob.getData(), R.layout.item_yundan_yunxing));
|
||||||
list.add(new ManyBean(sob.getData(),R.layout.yundan_start_bottom));
|
list.add(new ManyBean(sob.getData(), R.layout.yundan_start_bottom));
|
||||||
brv.creates(con,list).setOnItemViewListener((position, o, v, layout) -> {
|
brv.creates(con, list).setOnItemViewListener((position, o, v, layout) -> {
|
||||||
switch (layout){
|
switch (layout) {
|
||||||
case R.layout.yundan_start_top:
|
case R.layout.yundan_start_top:
|
||||||
ImageButton return_btn=v.findViewById(R.id.return_btn);
|
ImageButton return_btn = v.findViewById(R.id.return_btn);
|
||||||
return_btn.setOnClickListener(v1 -> finish());
|
return_btn.setOnClickListener(v1 -> finish());
|
||||||
break;
|
break;
|
||||||
case R.layout.yundan_start_bottom:
|
case R.layout.yundan_start_bottom:
|
||||||
initStartBody(v);
|
initStartBody(v);
|
||||||
break;
|
break;
|
||||||
case R.layout.item_yundan_yunxing:
|
case R.layout.item_yundan_yunxing:
|
||||||
ImageView head_img=v.findViewById(R.id.head_img);
|
ImageView head_img = v.findViewById(R.id.head_img);
|
||||||
if(ub!=null && ub.getData()!=null && !ub.getData().getHeadportraitUrl().equals("")){
|
if (ub != null && ub.getData() != null && !ub.getData().getHeadportraitUrl().equals("")) {
|
||||||
Glide.with(con).load(ub.getData().getHeadportraitUrl()).into(head_img);
|
Glide.with(con).load(ub.getData().getHeadportraitUrl()).into(head_img);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: break;
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean iskey=false;
|
private boolean iskey = false;
|
||||||
|
|
||||||
private void initStartBody(View v){
|
private void initStartBody(View v) {
|
||||||
LinearLayout jiesuan=v.findViewById(R.id.jiesuan);
|
LinearLayout jiesuan = v.findViewById(R.id.jiesuan);
|
||||||
// if(id==0){
|
// if(id==0){
|
||||||
// jiesuan.setVisibility(View.GONE);
|
// jiesuan.setVisibility(View.GONE);
|
||||||
// }else{
|
// }else{
|
||||||
// jiesuan.setVisibility(View.VISIBLE);
|
// jiesuan.setVisibility(View.VISIBLE);
|
||||||
// }
|
// }
|
||||||
sv1=v.findViewById(R.id.score1);
|
sv1 = v.findViewById(R.id.score1);
|
||||||
sv2=v.findViewById(R.id.score2);
|
sv2 = v.findViewById(R.id.score2);
|
||||||
sv1.initView();
|
sv1.initView();
|
||||||
sv2.initView();
|
sv2.initView();
|
||||||
sv1.setScore(5);
|
sv1.setScore(5);
|
||||||
//设置是否可以修改评分,默认为true
|
//设置是否可以修改评分,默认为true
|
||||||
TextView pl_submit=v.findViewById(R.id.pl_submit);
|
TextView pl_submit = v.findViewById(R.id.pl_submit);
|
||||||
TextView m_pl_value=v.findViewById(R.id.m_pl_value);
|
TextView m_pl_value = v.findViewById(R.id.m_pl_value);
|
||||||
TextView pl_value=v.findViewById(R.id.pl_value);
|
TextView pl_value = v.findViewById(R.id.pl_value);
|
||||||
if(wnb.getData()!=null){
|
if (wnb.getData() != null) {
|
||||||
for (WNewsBean.DataDTO datum : wnb.getData()) {
|
for (WNewsBean.DataDTO datum : wnb.getData()) {
|
||||||
if(datum.getType()==0){
|
if (datum.getType() == 0) {
|
||||||
sv1.setScore(datum.getAttitudeScore());
|
sv1.setScore(datum.getAttitudeScore());
|
||||||
m_pl_value.setText(datum.getContent());
|
m_pl_value.setText(datum.getContent());
|
||||||
pl_submit.setVisibility(View.GONE);
|
pl_submit.setVisibility(View.GONE);
|
||||||
sv1.setUpKey(false);
|
sv1.setUpKey(false);
|
||||||
m_pl_value.setEnabled(false);
|
m_pl_value.setEnabled(false);
|
||||||
}
|
}
|
||||||
if(datum.getType()==1){
|
if (datum.getType() == 1) {
|
||||||
Log.e("分数",datum.getAttitudeScore()+"_");
|
Log.e("分数", datum.getAttitudeScore() + "_");
|
||||||
sv2.setScore(datum.getAttitudeScore());
|
sv2.setScore(datum.getAttitudeScore());
|
||||||
pl_value.setText(datum.getContent());
|
pl_value.setText(datum.getContent());
|
||||||
}
|
}
|
||||||
@@ -244,45 +249,45 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
sv2.setUpKey(false);
|
sv2.setUpKey(false);
|
||||||
pl_submit.setOnClickListener(v12 -> {
|
pl_submit.setOnClickListener(v12 -> {
|
||||||
String evaluate=m_pl_value.getText()+"";
|
String evaluate = m_pl_value.getText() + "";
|
||||||
if(id!=0){
|
if (id != 0) {
|
||||||
if(evaluate.length()>=5){
|
if (evaluate.length() >= 5) {
|
||||||
Log.e("星星",""+sv1.getScore());
|
Log.e("星星", "" + sv1.getScore());
|
||||||
hyr.keepEvaluate(sv1.getScore(),m_pl_value.getText()+"",id);
|
hyr.keepEvaluate(sv1.getScore(), m_pl_value.getText() + "", id);
|
||||||
}else{
|
} else {
|
||||||
Toast.makeText(con,"写够5个字才是好司机~",Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "写够5个字才是好司机~", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
Toast.makeText(con,"运单尚未结束",Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "运单尚未结束", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Button complaint=v.findViewById(R.id.complaint);
|
Button complaint = v.findViewById(R.id.complaint);
|
||||||
complaint.setOnClickListener(v1 -> {
|
complaint.setOnClickListener(v1 -> {
|
||||||
Intent in=new Intent(con, OrderComplaintActivity.class);
|
Intent in = new Intent(con, OrderComplaintActivity.class);
|
||||||
in.putExtra("id",id);
|
in.putExtra("id", id);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
});
|
});
|
||||||
BaseRecyclerView bv_zhuang=v.findViewById(R.id.bv_zhuang);
|
BaseRecyclerView bv_zhuang = v.findViewById(R.id.bv_zhuang);
|
||||||
BaseRecyclerView bv_xie=v.findViewById(R.id.bv_xie);
|
BaseRecyclerView bv_xie = v.findViewById(R.id.bv_xie);
|
||||||
//bv_zhuang.set
|
//bv_zhuang.set
|
||||||
List<Object> list_zhuang=new ArrayList<>();
|
List<Object> list_zhuang = new ArrayList<>();
|
||||||
List<Object> list_xie=new ArrayList<>();
|
List<Object> list_xie = new ArrayList<>();
|
||||||
for(int i=0;i<sob.getData().getWayChildren().size();i++){
|
for (int i = 0; i < sob.getData().getWayChildren().size(); i++) {
|
||||||
StartOrderBean.DataDTO.WayChildrenDTO sdw=sob.getData().getWayChildren().get(i);
|
StartOrderBean.DataDTO.WayChildrenDTO sdw = sob.getData().getWayChildren().get(i);
|
||||||
if(sdw.getType()==1){
|
if (sdw.getType() == 1) {
|
||||||
sdw.setUpdateTime(StringUtil.isNull((String) sdw.getUpdateTime(),"未装货"));
|
sdw.setUpdateTime(StringUtil.isNull((String) sdw.getUpdateTime(), "未装货"));
|
||||||
list_zhuang.add(sdw);
|
list_zhuang.add(sdw);
|
||||||
}else{
|
} else {
|
||||||
sdw.setUpdateTime(StringUtil.isNull((String) sdw.getUpdateTime(),"未卸货"));
|
sdw.setUpdateTime(StringUtil.isNull((String) sdw.getUpdateTime(), "未卸货"));
|
||||||
list_xie.add(sdw);
|
list_xie.add(sdw);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TextView get_contract=v.findViewById(R.id.get_contract);
|
TextView get_contract = v.findViewById(R.id.get_contract);
|
||||||
get_contract.setOnClickListener(v13 -> {
|
get_contract.setOnClickListener(v13 -> {
|
||||||
Intent in=new Intent(con, WebPDFActivity.class);
|
Intent in = new Intent(con, WebPDFActivity.class);
|
||||||
in.putExtra("title","电子合同");
|
in.putExtra("title", "电子合同");
|
||||||
Log.e("--地址--",sob.getData().getContractUrl());
|
Log.e("--地址--", sob.getData().getContractUrl());
|
||||||
in.putExtra("url",sob.getData().getContractUrl());
|
in.putExtra("url", sob.getData().getContractUrl());
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
});
|
});
|
||||||
// v.findViewById(R.id.upload_receipt).setOnClickListener(new View.OnClickListener() {
|
// v.findViewById(R.id.upload_receipt).setOnClickListener(new View.OnClickListener() {
|
||||||
@@ -294,134 +299,149 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
// startActivity(in);
|
// startActivity(in);
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
bv_zhuang.createV(con,list_zhuang,R.layout.item_huoyuan_start_zx).setOnItemViewListener((position, o, v14) -> {
|
bv_zhuang.createV(con, list_zhuang, R.layout.item_huoyuan_start_zx).setOnItemViewListener((position, o, v14) -> {
|
||||||
//
|
//
|
||||||
boolean upkey=false;
|
boolean upkey = false;
|
||||||
if(position==0){
|
if (position == 0) {
|
||||||
upkey=true;
|
upkey = true;
|
||||||
}
|
}
|
||||||
initZX(upkey, v14,position,o,0);
|
initZX(upkey, v14, position, o, 0);
|
||||||
});
|
});
|
||||||
bv_xie.createV(con,list_xie,R.layout.item_huoyuan_start_zx).setOnItemViewListener((position, o, v15) -> {
|
bv_xie.createV(con, list_xie, R.layout.item_huoyuan_start_zx).setOnItemViewListener((position, o, v15) -> {
|
||||||
//
|
//
|
||||||
boolean upkey=false;
|
boolean upkey = false;
|
||||||
if(position==(list_xie.size()-1)){
|
if (position == (list_xie.size() - 1)) {
|
||||||
upkey=true;
|
upkey = true;
|
||||||
}
|
}
|
||||||
initZX(upkey, v15, position, o, 1);
|
initZX(upkey, v15, position, o, 1);
|
||||||
});
|
});
|
||||||
search();
|
search();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initZX(boolean key,View v,int position,Object o,int type){
|
public void initZX(boolean key, View v, int position, Object o, int type) {
|
||||||
StartOrderBean.DataDTO.WayChildrenDTO sdw= (StartOrderBean.DataDTO.WayChildrenDTO) o;
|
StartOrderBean.DataDTO.WayChildrenDTO sdw = (StartOrderBean.DataDTO.WayChildrenDTO) o;
|
||||||
TextView index=v.findViewById(R.id.index);
|
TextView index = v.findViewById(R.id.index);
|
||||||
TextView s_zx=v.findViewById(R.id.s_zx);
|
TextView s_zx = v.findViewById(R.id.s_zx);
|
||||||
TextView j_zx=v.findViewById(R.id.j_zx);
|
TextView j_zx = v.findViewById(R.id.j_zx);
|
||||||
if(type==1){
|
if (type == 1) {
|
||||||
s_zx.setText("实际卸货时间:");
|
s_zx.setText("实际卸货时间:");
|
||||||
j_zx.setText("计划卸货时间:");
|
j_zx.setText("计划卸货时间:");
|
||||||
}
|
}
|
||||||
if(position==0){
|
if (position == 0) {
|
||||||
if(type==0){
|
if (type == 0) {
|
||||||
index.setText("装货地");
|
index.setText("装货地");
|
||||||
}else{
|
} else {
|
||||||
index.setText("卸货地");
|
index.setText("卸货地");
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
if(type==0) {
|
if (type == 0) {
|
||||||
index.setText("第" + (position + 1) + "装货地");
|
index.setText("第" + (position + 1) + "装货地");
|
||||||
}else{
|
} else {
|
||||||
index.setText("第" + (position + 1) + "卸货地");
|
index.setText("第" + (position + 1) + "卸货地");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TextView goodName=v.findViewById(R.id.goodName);
|
TextView goodName = v.findViewById(R.id.goodName);
|
||||||
TextView goodNum=v.findViewById(R.id.goodNum);
|
TextView goodNum = v.findViewById(R.id.goodNum);
|
||||||
TextView goodUnit=v.findViewById(R.id.goodUnit);
|
TextView goodUnit = v.findViewById(R.id.goodUnit);
|
||||||
goodName.setText(sdw.getGoods().get(0).getGoodName());
|
goodName.setText(sdw.getGoods().get(0).getGoodName());
|
||||||
goodNum.setText(sdw.getGoods().get(0).getGoodNum());
|
goodNum.setText(sdw.getGoods().get(0).getGoodNum());
|
||||||
goodUnit.setText(sdw.getGoods().get(0).getGoodUnit());
|
goodUnit.setText(sdw.getGoods().get(0).getGoodUnit());
|
||||||
TextView huoyuan_state=v.findViewById(R.id.huoyuan_state);
|
TextView huoyuan_state = v.findViewById(R.id.huoyuan_state);
|
||||||
huoyuan_state.setText(stateText(sdw.getStatus(),type));
|
huoyuan_state.setText(stateText(sdw.getStatus(), type));
|
||||||
huoyuan_state.setOnClickListener(new View.OnClickListener() {
|
huoyuan_state.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
String wid= sdw.getId()+"";
|
String wid = sdw.getId() + "";
|
||||||
if(sdw.getStatus()==0){
|
if (sdw.getStatus() == 0) {
|
||||||
if(type==0){
|
if (type == 0) {
|
||||||
Intent in=new Intent(con, ShangChuangImgActivity.class);
|
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||||
in.putExtra("type",type);
|
in.putExtra("type", type);
|
||||||
in.putExtra("wid",wid);
|
in.putExtra("wid", wid);
|
||||||
in.putExtra("sob",gson.toJson(sob));
|
in.putExtra("sob", gson.toJson(sob));
|
||||||
in.putExtra("keys",key);
|
in.putExtra("keys", key);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
}else{
|
} else {
|
||||||
Toast.makeText(con,"您还没有装货",Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "您还没有装货", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}else if(sdw.getStatus()==1){//装货回单
|
} else if (sdw.getStatus() == 1) {//装货回单
|
||||||
if(type==0){
|
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||||
Intent in=new Intent(con, ShangChuangImgActivity.class);
|
in.putExtra("type", 2);
|
||||||
in.putExtra("type",2);
|
in.putExtra("wid", wid);
|
||||||
in.putExtra("wid",wid);
|
in.putExtra("h_type", type);
|
||||||
in.putExtra("h_type",type);
|
in.putExtra("sob", gson.toJson(sob));
|
||||||
in.putExtra("sob",gson.toJson(sob));
|
startActivity(in);
|
||||||
startActivity(in);
|
} else if (sdw.getStatus() == 2) {//上传收货单(卸货回单)
|
||||||
}else{
|
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||||
Toast.makeText(con,"您还没有上传回单信息",Toast.LENGTH_SHORT).show();
|
in.putExtra("type", 2);
|
||||||
|
in.putExtra("wid", wid);
|
||||||
|
in.putExtra("h_type", type);
|
||||||
|
in.putExtra("sob", gson.toJson(sob));
|
||||||
|
in.putExtra("keys", key);
|
||||||
|
startActivity(in);
|
||||||
|
} else if (sdw.getStatus() == 3) {
|
||||||
|
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) {//大于五分钟可以接单
|
||||||
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else if(sdw.getStatus()==2){//上传收货单(卸货回单)
|
|
||||||
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));
|
|
||||||
in.putExtra("keys",key);
|
|
||||||
startActivity(in);
|
|
||||||
}else if(sdw.getStatus()==3){
|
|
||||||
Intent in=new Intent(con, GetShangChuanActivity.class);
|
|
||||||
in.putExtra("sdwStr",gson.toJson(sdw));
|
|
||||||
startActivity(in);
|
|
||||||
}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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public String stateText(int state,int type){
|
public String stateText(int state, int type) {
|
||||||
String str="";
|
String str = "";
|
||||||
//0待装货,1已装货 2已卸货 3已上传回单 4待卸货
|
//0待装货,1已装货 2已卸货 3已上传回单 4待卸货
|
||||||
switch (state){
|
switch (state) {
|
||||||
case 0://str="待装货";
|
case 0://str="待装货";
|
||||||
if(type==0){
|
if (type == 0) {
|
||||||
str="立即装货";
|
str = "立即装货";
|
||||||
// str="确认装货";
|
// str="确认装货";
|
||||||
}else{
|
} else {
|
||||||
str="请先装货";
|
str = "请先装货";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1://str="已装货";
|
case 1://str="已装货";
|
||||||
str="上传出货单";
|
str = "上传出货单";
|
||||||
// str="确认回单";
|
// str="确认回单";
|
||||||
break;
|
break;
|
||||||
case 2://str="已卸货";
|
case 2://str="已卸货";
|
||||||
str="上传收货单";
|
str = "上传收货单";
|
||||||
// str="确认回单";
|
// str="确认回单";
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
//str="已上传回单";
|
//str="已上传回单";
|
||||||
str="查看凭证";
|
str = "查看凭证";
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
//str="待卸货";
|
//str="待卸货";
|
||||||
str="确认卸货";
|
str = "确认卸货";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
break;
|
break;
|
||||||
default:break;
|
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
@@ -429,7 +449,7 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
if(map!=null){
|
if (map != null) {
|
||||||
map.onResume();
|
map.onResume();
|
||||||
}
|
}
|
||||||
hyr.startOrder(id);
|
hyr.startOrder(id);
|
||||||
@@ -439,7 +459,7 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
if(map!=null){
|
if (map != null) {
|
||||||
map.onPause();
|
map.onPause();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -447,7 +467,7 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
if(map!=null){
|
if (map != null) {
|
||||||
map.onDestroy();
|
map.onDestroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -457,11 +477,12 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
map.onSaveInstanceState(outState);
|
map.onSaveInstanceState(outState);
|
||||||
}
|
}
|
||||||
|
|
||||||
LocationSource.OnLocationChangedListener mListener;
|
LocationSource.OnLocationChangedListener mListener;
|
||||||
AMapLocationClient mlocationClient;
|
AMapLocationClient mlocationClient;
|
||||||
AMapLocationClientOption mLocationOption;
|
AMapLocationClientOption mLocationOption;
|
||||||
|
|
||||||
public void initLoaction(){
|
public void initLoaction() {
|
||||||
// 设置定位监听
|
// 设置定位监听
|
||||||
aMap.setLocationSource(new LocationSource() {
|
aMap.setLocationSource(new LocationSource() {
|
||||||
@Override
|
@Override
|
||||||
@@ -480,13 +501,13 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
mlocationClient.setLocationListener(new AMapLocationListener() {
|
mlocationClient.setLocationListener(new AMapLocationListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onLocationChanged(AMapLocation aMapLocation) {
|
public void onLocationChanged(AMapLocation aMapLocation) {
|
||||||
if (mListener != null&&aMapLocation != null) {
|
if (mListener != null && aMapLocation != null) {
|
||||||
if (aMapLocation != null
|
if (aMapLocation != null
|
||||||
&&aMapLocation.getErrorCode() == 0) {
|
&& aMapLocation.getErrorCode() == 0) {
|
||||||
mListener.onLocationChanged(aMapLocation);// 显示系统小蓝点
|
mListener.onLocationChanged(aMapLocation);// 显示系统小蓝点
|
||||||
} else {
|
} else {
|
||||||
String errText = "定位失败," + aMapLocation.getErrorCode()+ ": " + aMapLocation.getErrorInfo();
|
String errText = "定位失败," + aMapLocation.getErrorCode() + ": " + aMapLocation.getErrorInfo();
|
||||||
Log.e("AmapErr",errText);
|
Log.e("AmapErr", errText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -538,45 +559,44 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
|
|
||||||
|
|
||||||
private RouteSearch mRouteSearch;//路线查询器
|
private RouteSearch mRouteSearch;//路线查询器
|
||||||
private List<LatLonPoint> lists=new ArrayList<>();
|
private List<LatLonPoint> lists = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
public void search(){
|
public void search() {
|
||||||
// try {
|
// try {
|
||||||
// AMapLocationClient.updatePrivacyShow(con,true,true);
|
// AMapLocationClient.updatePrivacyShow(con,true,true);
|
||||||
// AMapLocationClient.updatePrivacyAgree(con,true);
|
// AMapLocationClient.updatePrivacyAgree(con,true);
|
||||||
mRouteSearch = new RouteSearch(this);
|
mRouteSearch = new RouteSearch(this);
|
||||||
// } catch (AMapException e) {
|
// } catch (AMapException e) {
|
||||||
// e.printStackTrace();
|
// e.printStackTrace();
|
||||||
// }
|
// }
|
||||||
//设置数据回调监听器
|
//设置数据回调监听器
|
||||||
mRouteSearch.setRouteSearchListener(new OnRouteSearchListener());
|
mRouteSearch.setRouteSearchListener(new OnRouteSearchListener());
|
||||||
//设置开始位置坐标点(注意经纬度不能写反,会报错1800(只能规划到中国区域里的地图路线))
|
//设置开始位置坐标点(注意经纬度不能写反,会报错1800(只能规划到中国区域里的地图路线))
|
||||||
LatLonPoint startPoint=new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
|
LatLonPoint startPoint = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
|
||||||
Double.parseDouble(sob.getData().getWayChildren().get((0)).getLongitude()));
|
Double.parseDouble(sob.getData().getWayChildren().get((0)).getLongitude()));
|
||||||
//设置目的地坐标点
|
//设置目的地坐标点
|
||||||
LatLonPoint endPoint = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size()-1)).getLatitude()),
|
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()));
|
Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLongitude()));
|
||||||
//查询信息对象
|
//查询信息对象
|
||||||
for (int i=0;i<sob.getData().getWayChildren().size();i++){
|
for (int i = 0; i < sob.getData().getWayChildren().size(); i++) {
|
||||||
if(i!=0 && i!=(sob.getData().getWayChildren().size()-1)){
|
if (i != 0 && i != (sob.getData().getWayChildren().size() - 1)) {
|
||||||
LatLonPoint sp=new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get(i).getLatitude()),
|
LatLonPoint sp = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get(i).getLatitude()),
|
||||||
Double.parseDouble(sob.getData().getWayChildren().get((i)).getLongitude()));
|
Double.parseDouble(sob.getData().getWayChildren().get((i)).getLongitude()));
|
||||||
lists.add(sp);
|
lists.add(sp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RouteSearch.FromAndTo fromAndTo = new RouteSearch.FromAndTo(startPoint,endPoint);
|
RouteSearch.FromAndTo fromAndTo = new RouteSearch.FromAndTo(startPoint, endPoint);
|
||||||
//设置搜索参数 1.fromAndTo 路径的起点终点 2.路径规划的策略(这里是驾车模式,具体看高德API) 3.途
|
//设置搜索参数 1.fromAndTo 路径的起点终点 2.路径规划的策略(这里是驾车模式,具体看高德API) 3.途
|
||||||
//经点,可选 4.避让区域,可选, 5.避让道路 ,可选
|
//经点,可选 4.避让区域,可选, 5.避让道路 ,可选
|
||||||
RouteSearch.DriveRouteQuery query = new
|
RouteSearch.DriveRouteQuery query = new
|
||||||
RouteSearch.DriveRouteQuery(fromAndTo,RouteSearch.DRIVING_SINGLE_DEFAULT,lists,null,"");
|
RouteSearch.DriveRouteQuery(fromAndTo, RouteSearch.DRIVING_SINGLE_DEFAULT, lists, null, "");
|
||||||
//开始异步查询
|
//开始异步查询
|
||||||
mRouteSearch.calculateDriveRouteAsyn(query);
|
mRouteSearch.calculateDriveRouteAsyn(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class OnRouteSearchListener implements RouteSearch.OnRouteSearchListener {
|
||||||
class OnRouteSearchListener implements RouteSearch.OnRouteSearchListener{
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBusRouteSearched(BusRouteResult busRouteResult, int i) {
|
public void onBusRouteSearched(BusRouteResult busRouteResult, int i) {
|
||||||
@@ -585,7 +605,7 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDriveRouteSearched(DriveRouteResult driveRouteResult, int rCode) {
|
public void onDriveRouteSearched(DriveRouteResult driveRouteResult, int rCode) {
|
||||||
if (rCode == 1000){//获取规划路线成功,获取到的是了,路线坐标点的集合
|
if (rCode == 1000) {//获取规划路线成功,获取到的是了,路线坐标点的集合
|
||||||
List<DrivePath> paths = driveRouteResult.getPaths();
|
List<DrivePath> paths = driveRouteResult.getPaths();
|
||||||
//创建存储坐标点的集合
|
//创建存储坐标点的集合
|
||||||
List<LatLng> latLngs = new ArrayList<>();
|
List<LatLng> latLngs = new ArrayList<>();
|
||||||
@@ -594,7 +614,7 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
for (DriveStep mDriveStep : mDrivePath.getSteps()) {
|
for (DriveStep mDriveStep : mDrivePath.getSteps()) {
|
||||||
for (LatLonPoint mLatLonPoint : mDriveStep.getPolyline()) {
|
for (LatLonPoint mLatLonPoint : mDriveStep.getPolyline()) {
|
||||||
latLngs.add(new
|
latLngs.add(new
|
||||||
LatLng(mLatLonPoint.getLatitude(),mLatLonPoint.getLongitude()));
|
LatLng(mLatLonPoint.getLatitude(), mLatLonPoint.getLongitude()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -605,24 +625,24 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
.icon(BitmapDescriptorFactory.fromResource(R.mipmap.qi))
|
.icon(BitmapDescriptorFactory.fromResource(R.mipmap.qi))
|
||||||
.position(new LatLng(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
|
.position(new LatLng(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
|
||||||
Double.parseDouble(sob.getData().getWayChildren().get(0).getLongitude()))));
|
Double.parseDouble(sob.getData().getWayChildren().get(0).getLongitude()))));
|
||||||
for(int i=0;i<sob.getData().getWayChildren().size();i++){
|
for (int i = 0; i < sob.getData().getWayChildren().size(); i++) {
|
||||||
if(i!=0 && i!=(sob.getData().getWayChildren().size()-1)){
|
if (i != 0 && i != (sob.getData().getWayChildren().size() - 1)) {
|
||||||
StartOrderBean.DataDTO.WayChildrenDTO sdw=sob.getData().getWayChildren().get(i);
|
StartOrderBean.DataDTO.WayChildrenDTO sdw = sob.getData().getWayChildren().get(i);
|
||||||
int icon=0;
|
int icon = 0;
|
||||||
if(sdw.getType()==1){
|
if (sdw.getType() == 1) {
|
||||||
icon=R.mipmap.z_loc;
|
icon = R.mipmap.z_loc;
|
||||||
}else{
|
} else {
|
||||||
icon=R.mipmap.x_loc;
|
icon = R.mipmap.x_loc;
|
||||||
}
|
}
|
||||||
aMap.addMarker(new MarkerOptions()
|
aMap.addMarker(new MarkerOptions()
|
||||||
.icon(BitmapDescriptorFactory.fromResource(icon))
|
.icon(BitmapDescriptorFactory.fromResource(icon))
|
||||||
.position(new LatLng(Double.parseDouble(sdw.getLatitude()),Double.parseDouble(sdw.getLongitude()))));
|
.position(new LatLng(Double.parseDouble(sdw.getLatitude()), Double.parseDouble(sdw.getLongitude()))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
aMap.addMarker(new MarkerOptions()
|
aMap.addMarker(new MarkerOptions()
|
||||||
.icon(BitmapDescriptorFactory.fromResource(R.mipmap.zhong))
|
.icon(BitmapDescriptorFactory.fromResource(R.mipmap.zhong))
|
||||||
.position(new LatLng(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size()-1)).getLatitude()),
|
.position(new LatLng(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLatitude()),
|
||||||
Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size()-1)).getLongitude()))));
|
Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLongitude()))));
|
||||||
//绘制规划路径路线
|
//绘制规划路径路线
|
||||||
aMap.addPolyline(new PolylineOptions()
|
aMap.addPolyline(new PolylineOptions()
|
||||||
//路线坐标点的集合
|
//路线坐标点的集合
|
||||||
@@ -633,15 +653,15 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
//设置画线的颜色
|
//设置画线的颜色
|
||||||
|
|
||||||
//显示完整包含所有marker地图路线
|
//显示完整包含所有marker地图路线
|
||||||
LatLngBounds.Builder builder =LatLngBounds.builder();
|
LatLngBounds.Builder builder = LatLngBounds.builder();
|
||||||
for (int i = 0; i < latLngs.size(); i++) {
|
for (int i = 0; i < latLngs.size(); i++) {
|
||||||
builder.include(latLngs.get(i));
|
builder.include(latLngs.get(i));
|
||||||
}
|
}
|
||||||
//显示全部marker,第二个参数是四周留空宽度
|
//显示全部marker,第二个参数是四周留空宽度
|
||||||
aMap.moveCamera(CameraUpdateFactory.newLatLngBounds(builder.build(),200));
|
aMap.moveCamera(CameraUpdateFactory.newLatLngBounds(builder.build(), 200));
|
||||||
LatLng latLng = new LatLng(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
|
LatLng latLng = new LatLng(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
|
||||||
Double.parseDouble(sob.getData().getWayChildren().get((0)).getLongitude()));//构造一个位置
|
Double.parseDouble(sob.getData().getWayChildren().get((0)).getLongitude()));//构造一个位置
|
||||||
aMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng,6));
|
aMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 6));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -657,7 +677,7 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void up_traffic(){
|
public void up_traffic() {
|
||||||
// ShippingNoteInfo[] snis=new ShippingNoteInfo[1];
|
// ShippingNoteInfo[] snis=new ShippingNoteInfo[1];
|
||||||
// ShippingNoteInfo sni=new ShippingNoteInfo();
|
// ShippingNoteInfo sni=new ShippingNoteInfo();
|
||||||
// sni.setShippingNoteNumber(sob.getData().getShippingNoteNumber());
|
// sni.setShippingNoteNumber(sob.getData().getShippingNoteNumber());
|
||||||
|
|||||||
+60
-97
@@ -19,7 +19,6 @@ import com.alct.mdp.callback.OnResultListener;
|
|||||||
import com.alct.mdp.model.Goods;
|
import com.alct.mdp.model.Goods;
|
||||||
import com.alct.mdp.model.Image;
|
import com.alct.mdp.model.Image;
|
||||||
import com.alct.mdp.model.Location;
|
import com.alct.mdp.model.Location;
|
||||||
import com.arpa.hndahesudintocctmsdriver.H5Activity;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
|
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.report.ALProcess;
|
import com.arpa.hndahesudintocctmsdriver.report.ALProcess;
|
||||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||||
@@ -30,6 +29,8 @@ import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.img.GetCarImageAlert;
|
import com.arpa.hndahesudintocctmsdriver.util.img.GetCarImageAlert;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.location.LocationUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.location.LocationUtil;
|
||||||
|
import com.baidu.mapapi.model.LatLng;
|
||||||
|
import com.baidu.mapapi.utils.CoordinateConverter;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.luck.picture.lib.PictureSelector;
|
import com.luck.picture.lib.PictureSelector;
|
||||||
@@ -43,7 +44,6 @@ import com.arpa.hndahesudintocctmsdriver.bean.UploadBean;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean;
|
import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.UploadReceiptInputBean;
|
import com.arpa.hndahesudintocctmsdriver.request.bean.UploadReceiptInputBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.location.LocationGDUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.location.LocationGDUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||||
@@ -111,17 +111,17 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
if (CacheGroup.cacheList.get(TYPE_NAME[i]) != null) {
|
if (CacheGroup.cacheList.get(TYPE_NAME[i]) != null) {
|
||||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]), BaseBean.class);
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]), BaseBean.class);
|
||||||
if (bb.getCode() == 200) {
|
if (bb.getCode() == 200) {
|
||||||
if (!keys) {
|
if (index == 2) {
|
||||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
if (!keys){//装货回单
|
||||||
finish();
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
} else {
|
finish();
|
||||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
}
|
||||||
finish();
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove(TYPE_NAME[i]);
|
CacheGroup.cacheList.remove(TYPE_NAME[i]);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CacheGroup.cacheList.get("carName") != null) {
|
if (CacheGroup.cacheList.get("carName") != null) {
|
||||||
@@ -163,6 +163,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
tv_loaction.setText("定位成功");
|
tv_loaction.setText("定位成功");
|
||||||
tv_loaction.setTextColor(getResources().getColor(R.color.theme_color, null));
|
tv_loaction.setTextColor(getResources().getColor(R.color.theme_color, null));
|
||||||
|
latLng = convertGPSToBaidu(new LatLng(lgdu.getLatitude(), lgdu.getLongitude()));
|
||||||
initLocation();
|
initLocation();
|
||||||
break;
|
break;
|
||||||
case 16://定位失败
|
case 16://定位失败
|
||||||
@@ -195,6 +196,14 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private LatLng latLng;
|
||||||
|
|
||||||
|
public LatLng convertGPSToBaidu(LatLng srLatLng) {
|
||||||
|
CoordinateConverter converter = new CoordinateConverter();
|
||||||
|
converter.from(CoordinateConverter.CoordType.COMMON);
|
||||||
|
converter.coord(srLatLng);
|
||||||
|
return converter.convert();
|
||||||
|
}
|
||||||
|
|
||||||
private String wid;
|
private String wid;
|
||||||
private int h_type;
|
private int h_type;
|
||||||
@@ -231,16 +240,18 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
lgdu = new LocationGDUtil(con, hd);
|
lgdu = new LocationGDUtil(con, hd);
|
||||||
//启动定位
|
//启动定位
|
||||||
lgdu.onCreate();
|
lgdu.onCreate();
|
||||||
lu = new LocationUtil(con, hd);
|
// lu = new LocationUtil(con, hd);
|
||||||
lu.onCreate();
|
// lu.onCreate();
|
||||||
if (keys) {
|
// if (keys) {
|
||||||
lu = new LocationUtil(con, hd);
|
// lu = new LocationUtil(con, hd);
|
||||||
lu.onCreate();
|
// lu.onCreate();
|
||||||
}
|
// }
|
||||||
tv_loaction.setOnClickListener(v -> {
|
tv_loaction.setOnClickListener(v -> {
|
||||||
if (!locationKey) {
|
if (!locationKey) {
|
||||||
customDialog.show();
|
customDialog.show();
|
||||||
lgdu.onCreate();
|
lgdu.onCreate();
|
||||||
|
// lu = new LocationUtil(con, hd);
|
||||||
|
// lu.onCreate();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
hyr = new HuoYuanRequset(con, hd);
|
hyr = new HuoYuanRequset(con, hd);
|
||||||
@@ -348,8 +359,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
lub.setImageId(imgIds);
|
lub.setImageId(imgIds);
|
||||||
lub.setWaybillId(wid);
|
lub.setWaybillId(wid);
|
||||||
Log.e("--装货信息", gson.toJson(lub));
|
Log.e("--装货信息", gson.toJson(lub));
|
||||||
if (locationKey) {
|
if (locationKey) {//高德定位
|
||||||
|
|
||||||
if (keys) {
|
if (keys) {
|
||||||
nfc();
|
nfc();
|
||||||
loadInfo();
|
loadInfo();
|
||||||
@@ -422,34 +432,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
|
|
||||||
private StartOrderBean sob;
|
private StartOrderBean sob;
|
||||||
|
|
||||||
//上传安联和交通厅-装货
|
|
||||||
public void up_traffic_start() {
|
|
||||||
//安联
|
|
||||||
if (sob.getData().getReportAlct() == 1) {
|
|
||||||
Location l = new Location();
|
|
||||||
l.setBaiduLongitude(lu.getLongitude());
|
|
||||||
l.setBaiduLatitude(lu.getLatitude());
|
|
||||||
l.setLocation(lu.getAddress());
|
|
||||||
l.setTime(Timer.getTimerT());
|
|
||||||
MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess() {
|
|
||||||
Log.e("上报安联", "装货上传成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(String s, String s1) {
|
|
||||||
Log.e("上报安联失败(装货):", s + s1);
|
|
||||||
new MessageUtils().showCenMessage(con, s1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
//交通厅
|
|
||||||
if (sob.getData().getReport() == 1) {
|
|
||||||
JTTProcess.start(con, sob, "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void nfc() {
|
public void nfc() {
|
||||||
// if(sob.getData().getNfcId().equals(nfcStr)){
|
// if(sob.getData().getNfcId().equals(nfcStr)){
|
||||||
// Toast.makeText(con,"nfcId匹配失败",Toast.LENGTH_LONG).show();
|
// Toast.makeText(con,"nfcId匹配失败",Toast.LENGTH_LONG).show();
|
||||||
@@ -471,41 +453,13 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//上传安联和交通厅-卸货
|
|
||||||
public void up_traffic_end() {
|
|
||||||
//安联
|
|
||||||
if (sob.getData().getReportAlct() == 1) {
|
|
||||||
Location l = new Location();
|
|
||||||
l.setBaiduLongitude(lu.getLongitude());
|
|
||||||
l.setBaiduLatitude(lu.getLatitude());
|
|
||||||
l.setLocation(lu.getAddress());
|
|
||||||
l.setTime(Timer.getTimerT());
|
|
||||||
Log.e("-安联卸货信息-", gson.toJson(l));
|
|
||||||
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess() {
|
|
||||||
Log.e("上报安联", "卸货上传成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(String s, String s1) {
|
|
||||||
Log.e("上报安联失败(卸货):", s + s1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
//交通厅
|
|
||||||
if (sob.getData().getReport() == 1) {
|
|
||||||
JTTProcess.stop(con, sob, "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//上传安联-签收
|
//上传安联-签收
|
||||||
public void up_trafficSign() {
|
public void up_trafficSign() {
|
||||||
//安联
|
//安联
|
||||||
Location l = new Location();
|
Location l = new Location();
|
||||||
l.setBaiduLongitude(lu.getLongitude());
|
l.setBaiduLongitude(latLng.longitude);
|
||||||
l.setBaiduLatitude(lu.getLatitude());
|
l.setBaiduLatitude(latLng.latitude);
|
||||||
l.setLocation(lu.getAddress());
|
l.setLocation(lgdu.getAddress());
|
||||||
l.setTime(Timer.getTimerT());
|
l.setTime(Timer.getTimerT());
|
||||||
List<Goods> gs = new ArrayList<>();
|
List<Goods> gs = new ArrayList<>();
|
||||||
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||||
@@ -543,9 +497,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
public void up_trafficReceipt() {
|
public void up_trafficReceipt() {
|
||||||
//安联
|
//安联
|
||||||
Location l = new Location();
|
Location l = new Location();
|
||||||
l.setBaiduLongitude(lu.getLongitude());
|
l.setBaiduLongitude(latLng.longitude);
|
||||||
l.setBaiduLatitude(lu.getLatitude());
|
l.setBaiduLatitude(latLng.latitude);
|
||||||
l.setLocation(lu.getAddress());
|
l.setLocation(lgdu.getAddress());
|
||||||
l.setTime(Timer.getTimerT());
|
l.setTime(Timer.getTimerT());
|
||||||
MDPLocationCollectionManager.pod(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
MDPLocationCollectionManager.pod(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||||
|
|
||||||
@@ -571,14 +525,16 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
image.setFileExt(FileUtil.lastName(file));
|
image.setFileExt(FileUtil.lastName(file));
|
||||||
image.setFileName(FileUtil.fileName(file));
|
image.setFileName(FileUtil.fileName(file));
|
||||||
image.setImageTakenDate(Timer.getTimerT());
|
image.setImageTakenDate(Timer.getTimerT());
|
||||||
image.setBaiduLongitude(lu.getLongitude());
|
image.setBaiduLongitude(latLng.longitude);
|
||||||
image.setBaiduLatitude(lu.getLatitude());
|
image.setBaiduLatitude(latLng.latitude);
|
||||||
image.setLocation(lu.getAddress());
|
image.setLocation(lgdu.getAddress());
|
||||||
MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
Log.e("上报安联", "装货照片上传成功");
|
Log.e("上报安联", "装货照片上传成功");
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -601,14 +557,16 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
image.setFileExt(FileUtil.lastName(file));
|
image.setFileExt(FileUtil.lastName(file));
|
||||||
image.setFileName(FileUtil.fileName(file));
|
image.setFileName(FileUtil.fileName(file));
|
||||||
image.setImageTakenDate(Timer.getTimerT());
|
image.setImageTakenDate(Timer.getTimerT());
|
||||||
image.setBaiduLongitude(lu.getLongitude());
|
image.setBaiduLongitude(latLng.longitude);
|
||||||
image.setBaiduLatitude(lu.getLatitude());
|
image.setBaiduLatitude(latLng.latitude);
|
||||||
image.setLocation(lu.getAddress());
|
image.setLocation(lgdu.getAddress());
|
||||||
MDPLocationCollectionManager.uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
MDPLocationCollectionManager.uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
Log.e("上报安联", "卸货照片上传成功");
|
Log.e("上报安联", "卸货照片上传成功");
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -632,14 +590,16 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
image.setFileExt(FileUtil.lastName(file));
|
image.setFileExt(FileUtil.lastName(file));
|
||||||
image.setFileName(FileUtil.fileName(file));
|
image.setFileName(FileUtil.fileName(file));
|
||||||
image.setImageTakenDate(Timer.getTimerT());
|
image.setImageTakenDate(Timer.getTimerT());
|
||||||
image.setBaiduLongitude(lu.getLongitude());
|
image.setBaiduLongitude(latLng.longitude);
|
||||||
image.setBaiduLatitude(lu.getLatitude());
|
image.setBaiduLatitude(latLng.latitude);
|
||||||
image.setLocation(lu.getAddress());
|
image.setLocation(lgdu.getAddress());
|
||||||
MDPLocationCollectionManager.uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
MDPLocationCollectionManager.uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
Log.e("上报安联", "回单照片上传成功");
|
Log.e("上报安联", "回单照片上传成功");
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -683,6 +643,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
Log.e("nfc", nfcStr);
|
Log.e("nfc", nfcStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传安联和交通厅,平台-装货
|
* 上传安联和交通厅,平台-装货
|
||||||
*/
|
*/
|
||||||
@@ -690,9 +653,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
//安联
|
//安联
|
||||||
if (sob.getData().getReportAlct() == 1) {
|
if (sob.getData().getReportAlct() == 1) {
|
||||||
Location l = new Location();
|
Location l = new Location();
|
||||||
l.setBaiduLongitude(lu.getLongitude());
|
l.setBaiduLongitude(latLng.longitude);
|
||||||
l.setBaiduLatitude(lu.getLatitude());
|
l.setBaiduLatitude(latLng.latitude);
|
||||||
l.setLocation(lu.getAddress());
|
l.setLocation(lgdu.getAddress());
|
||||||
l.setTime(Timer.getTimerT());
|
l.setTime(Timer.getTimerT());
|
||||||
MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -702,10 +665,10 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
if (sob.getData().getReport() == 1) {
|
if (sob.getData().getReport() == 1) {
|
||||||
JTTProcess.start(con, sob, "");
|
JTTProcess.start(con, sob, "");
|
||||||
}
|
}
|
||||||
//装货照片
|
|
||||||
up_image_z();
|
|
||||||
//装货状态
|
//装货状态
|
||||||
hyr.loading(lub);
|
hyr.loading(lub);
|
||||||
|
//装货照片
|
||||||
|
up_image_z();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -726,9 +689,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
//安联
|
//安联
|
||||||
if (sob.getData().getReportAlct() == 1) {
|
if (sob.getData().getReportAlct() == 1) {
|
||||||
Location l = new Location();
|
Location l = new Location();
|
||||||
l.setBaiduLongitude(lu.getLongitude());
|
l.setBaiduLongitude(latLng.longitude);
|
||||||
l.setBaiduLatitude(lu.getLatitude());
|
l.setBaiduLatitude(latLng.latitude);
|
||||||
l.setLocation(lu.getAddress());
|
l.setLocation(lgdu.getAddress());
|
||||||
l.setTime(Timer.getTimerT());
|
l.setTime(Timer.getTimerT());
|
||||||
Log.e("-安联卸货信息-", gson.toJson(l));
|
Log.e("-安联卸货信息-", gson.toJson(l));
|
||||||
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||||
@@ -739,10 +702,10 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
if (sob.getData().getReport() == 1) {
|
if (sob.getData().getReport() == 1) {
|
||||||
JTTProcess.stop(con, sob, "");
|
JTTProcess.stop(con, sob, "");
|
||||||
}
|
}
|
||||||
//卸货照片-安联
|
|
||||||
up_image();
|
|
||||||
//卸货状态-平台
|
//卸货状态-平台
|
||||||
hyr.dischargeCargo(lub);
|
hyr.dischargeCargo(lub);
|
||||||
|
//卸货照片-安联
|
||||||
|
up_image();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+760
@@ -0,0 +1,760 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Message;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.Gravity;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.alct.mdp.MDPLocationCollectionManager;
|
||||||
|
import com.alct.mdp.callback.OnResultListener;
|
||||||
|
import com.alct.mdp.model.Goods;
|
||||||
|
import com.alct.mdp.model.Image;
|
||||||
|
import com.alct.mdp.model.Location;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.StartOrderBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.UploadBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.OCRRequest;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.UploadReceiptInputBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.BitmapUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.file.FileUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.file.ImageFileCompressUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.img.GetCarImageAlert;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.location.LocationGDUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.location.LocationUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.time.Timer;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||||
|
import com.baidu.mapapi.model.LatLng;
|
||||||
|
import com.baidu.mapapi.utils.CoordinateConverter;
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.luck.picture.lib.PictureSelector;
|
||||||
|
import com.luck.picture.lib.config.PictureConfig;
|
||||||
|
import com.luck.picture.lib.entity.LocalMedia;
|
||||||
|
import com.lxj.xpopup.XPopup;
|
||||||
|
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ShangChuangImgActivityBC extends BaseAppCompatActivity {
|
||||||
|
|
||||||
|
private TextView submit, name_top, name_body, address, tips, tips_x;
|
||||||
|
private RelativeLayout getImg;
|
||||||
|
private ImageView res_img, img_icon, img_delete;
|
||||||
|
private String[] names = {"装货", "卸货", "回单"};
|
||||||
|
public static String[] TYPE_NAME = {"zhuanghuo", "xiehuo", "huidan"};
|
||||||
|
private int index = 0;
|
||||||
|
//
|
||||||
|
private Gson gson = new Gson();
|
||||||
|
//
|
||||||
|
private LUInputBean lub = new LUInputBean();
|
||||||
|
private UploadReceiptInputBean urib = new UploadReceiptInputBean();
|
||||||
|
private LocationGDUtil lgdu;
|
||||||
|
public LocationUtil lu;
|
||||||
|
private List<Integer> imgIds = new ArrayList<>();
|
||||||
|
private UploadBean ub;
|
||||||
|
private HuoYuanRequset hyr;
|
||||||
|
//
|
||||||
|
private GetCarImageAlert gia = new GetCarImageAlert();
|
||||||
|
private CustomDialog customDialog;
|
||||||
|
private int id = 0;
|
||||||
|
private boolean key = true;
|
||||||
|
private boolean keys = false;
|
||||||
|
private boolean locationKey = false;
|
||||||
|
private TextView tv_loaction;
|
||||||
|
|
||||||
|
private TempLoca tempLoca = new TempLoca(36.11944878,120.10315118,"中国山东省青岛市黄岛区铁峰山路","2023-09-23 11:19");
|
||||||
|
|
||||||
|
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);
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
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(lgdu.getLatitude() + "");
|
||||||
|
lub.setLongitude(lgdu.getLongitude() + "");
|
||||||
|
lub.setLocationAddress(lgdu.getAddress());
|
||||||
|
lub.setImageId(imgIds);
|
||||||
|
lub.setWaybillId(wid);
|
||||||
|
Log.e("--装货信息", gson.toJson(lub));
|
||||||
|
if (locationKey) {//高德定位
|
||||||
|
if (keys) {
|
||||||
|
nfc();
|
||||||
|
loadInfo();
|
||||||
|
// up_traffic_start();
|
||||||
|
// up_image_z();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if (imgIds != null && imgIds.size() > 0) {
|
||||||
|
//卸货
|
||||||
|
lub.setLatitude(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();
|
||||||
|
uploadInfo();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
if (imgIds != null && imgIds.size() > 0) {//卸货回单
|
||||||
|
//上传回单
|
||||||
|
urib.setLatitude(lgdu.getLatitude() + "");
|
||||||
|
urib.setLongitude(lgdu.getLongitude() + "");
|
||||||
|
urib.setLocationAddress(lgdu.getAddress());
|
||||||
|
//装卸货类型
|
||||||
|
urib.setType(h_type + 1);
|
||||||
|
//回单id 数组
|
||||||
|
urib.setReceiptId(imgIds);
|
||||||
|
//子运运单ID
|
||||||
|
urib.setWaybillId(wid);
|
||||||
|
Log.e("--回单信息", gson.toJson(urib));
|
||||||
|
if (locationKey) {
|
||||||
|
if (index == 2 && keys) {
|
||||||
|
up_trafficSign();
|
||||||
|
up_trafficReceipt();
|
||||||
|
receipt_image();
|
||||||
|
}
|
||||||
|
hyr.receipt(urib);
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private StartOrderBean sob;
|
||||||
|
|
||||||
|
public void nfc() {
|
||||||
|
// if(sob.getData().getNfcId().equals(nfcStr)){
|
||||||
|
// Toast.makeText(con,"nfcId匹配失败",Toast.LENGTH_LONG).show();
|
||||||
|
// }
|
||||||
|
if ("".equals(sob.getData().getNfcId()) || sob.getData().getNfcId() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MDPLocationCollectionManager.checkNfc(con, sob.getData().getShippingNoteNumber(),
|
||||||
|
sob.getData().getNfcId(), new OnResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Toast.makeText(con, "nfcId匹配成功", Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("不匹配", "" + s + s1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//上传安联-签收
|
||||||
|
public void up_trafficSign() {
|
||||||
|
//安联
|
||||||
|
Location l = new Location();
|
||||||
|
l.setBaiduLongitude(tempLoca.longitude);
|
||||||
|
l.setBaiduLatitude(tempLoca.latitude);
|
||||||
|
l.setLocation(tempLoca.getAddress());
|
||||||
|
l.setTime(tempLoca.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(tempLoca.longitude);
|
||||||
|
l.setBaiduLatitude(tempLoca.latitude);
|
||||||
|
l.setLocation(tempLoca.getAddress());
|
||||||
|
l.setTime(tempLoca.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(latLng.longitude);
|
||||||
|
image.setBaiduLatitude(latLng.latitude);
|
||||||
|
image.setLocation(lgdu.getAddress());
|
||||||
|
MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "装货照片上传成功");
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(装货照片):", s + s1);
|
||||||
|
// SPUtil.insSP(con,"make","装货",sob.getData().getShippingNoteNumber());
|
||||||
|
// SPUtil.insSP(con,"make","装货-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||||
|
// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||||
|
// startService(serviceIn);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void up_image() {
|
||||||
|
File file = new File(path);
|
||||||
|
Image image = new Image();
|
||||||
|
String base = BitmapUtil.imageToBase64(path);
|
||||||
|
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||||
|
image.setFileExt(FileUtil.lastName(file));
|
||||||
|
image.setFileName(FileUtil.fileName(file));
|
||||||
|
image.setImageTakenDate(tempLoca.getTime());
|
||||||
|
image.setBaiduLongitude(tempLoca.longitude);
|
||||||
|
image.setBaiduLatitude(tempLoca.latitude);
|
||||||
|
image.setLocation(tempLoca.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(tempLoca.getTime());
|
||||||
|
image.setBaiduLongitude(tempLoca.longitude);
|
||||||
|
image.setBaiduLatitude(tempLoca.latitude);
|
||||||
|
image.setLocation(tempLoca.getAddress());
|
||||||
|
MDPLocationCollectionManager.uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "回单照片上传成功");
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(回单照片):", s + s1);
|
||||||
|
// SPUtil.insSP(con,"make","回单",sob.getData().getShippingNoteNumber());
|
||||||
|
//// SPUtil.insSP(con,"make","回单-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||||
|
//// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||||
|
//// startService(serviceIn);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
//开启前台调度系统
|
||||||
|
//NfcUtils.mNfcAdapter.enableForegroundDispatch(this, NfcUtils.mPendingIntent, NfcUtils.mIntentFilter, NfcUtils.mTechList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
//关闭前台调度系统
|
||||||
|
//NfcUtils.mNfcAdapter.disableForegroundDispatch(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
String nfcStr = "";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onNewIntent(Intent intent) {
|
||||||
|
super.onNewIntent(intent);
|
||||||
|
//当该Activity接收到NFC标签时,运行该方法
|
||||||
|
//调用工具方法,读取NFC数据
|
||||||
|
try {
|
||||||
|
nfcStr = NfcUtils.readNFCId(intent);
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
Log.e("nfc", nfcStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传安联和交通厅,平台-装货
|
||||||
|
*/
|
||||||
|
private void loadInfo() {
|
||||||
|
//安联
|
||||||
|
if (sob.getData().getReportAlct() == 1) {
|
||||||
|
Location l = new Location();
|
||||||
|
l.setBaiduLongitude(latLng.longitude);
|
||||||
|
l.setBaiduLatitude(latLng.latitude);
|
||||||
|
l.setLocation(lgdu.getAddress());
|
||||||
|
l.setTime(Timer.getTimerT());
|
||||||
|
MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
Log.e("上报安联", "装货上传成功");
|
||||||
|
//交通厅
|
||||||
|
if (sob.getData().getReport() == 1) {
|
||||||
|
JTTProcess.start(con, sob, "");
|
||||||
|
}
|
||||||
|
//装货状态
|
||||||
|
hyr.loading(lub);
|
||||||
|
//装货照片
|
||||||
|
up_image_z();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(装货):", s + s1);
|
||||||
|
new MessageUtils().showCenMessage(con, s1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传安联和交通厅,平台-卸货
|
||||||
|
*/
|
||||||
|
private void uploadInfo() {
|
||||||
|
|
||||||
|
//安联
|
||||||
|
if (sob.getData().getReportAlct() == 1) {
|
||||||
|
Location l = new Location();
|
||||||
|
l.setBaiduLongitude(tempLoca.longitude);
|
||||||
|
l.setBaiduLatitude(tempLoca.latitude);
|
||||||
|
l.setLocation(tempLoca.getAddress());
|
||||||
|
l.setTime(tempLoca.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.dischargeCargo(lub);
|
||||||
|
//卸货照片-安联
|
||||||
|
up_image();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
Log.e("上报安联失败(卸货):", s + s1);
|
||||||
|
new MessageUtils().showCenMessage(con, s1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,14 +1,21 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.ui.news;
|
package com.arpa.hndahesudintocctmsdriver.ui.news;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Environment;
|
||||||
|
import android.provider.Settings;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.R;
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BottomTabUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BottomTabUtil;
|
||||||
|
import com.dahe.mylibrary.utils.ToastUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author hlh
|
* @author hlh
|
||||||
@@ -27,6 +34,33 @@ public class NewActivity extends BaseAppCompatActivity {
|
|||||||
fs[0] =new NewsFragment();
|
fs[0] =new NewsFragment();
|
||||||
BottomTabUtil bt =new BottomTabUtil(this,R.id.body, fs);
|
BottomTabUtil bt =new BottomTabUtil(this,R.id.body, fs);
|
||||||
bt.selectItem(fs[0]);
|
bt.selectItem(fs[0]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||||
|
if (!Environment.isExternalStorageManager()) {
|
||||||
|
Intent intent = new Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION);
|
||||||
|
intent.setData(Uri.parse("package:" + getPackageName()));
|
||||||
|
this.startActivityForResult(intent, 1024);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isRefuse = false;
|
||||||
|
@Override
|
||||||
|
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
if (requestCode == 1024 && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||||
|
// 检查是否有权限
|
||||||
|
if (Environment.isExternalStorageManager()) {
|
||||||
|
isRefuse = false;
|
||||||
|
ToastUtils.showToast(this,"授权成功");
|
||||||
|
// 授权成功
|
||||||
|
} else {
|
||||||
|
isRefuse = true;
|
||||||
|
ToastUtils.showToast(this,"授权失败");
|
||||||
|
// 授权失败
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,9 @@ public class AdapterAlls extends RecyclerView.Adapter<AdapterAlls.ViewHolder> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void add(List<ManyBean> addMessageList) {
|
public void add(List<ManyBean> addMessageList) {
|
||||||
|
if (object==null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
//增加数据
|
//增加数据
|
||||||
int position = object.size();
|
int position = object.size();
|
||||||
object.addAll(position, addMessageList);
|
object.addAll(position, addMessageList);
|
||||||
|
|||||||
@@ -70,13 +70,27 @@ public class GetCarImageAlert {
|
|||||||
.permissions(Manifest.permission.CAMERA)
|
.permissions(Manifest.permission.CAMERA)
|
||||||
.request((allGranted, grantedList, deniedList) -> {
|
.request((allGranted, grantedList, deniedList) -> {
|
||||||
if (allGranted) {
|
if (allGranted) {
|
||||||
file=ImageGetUtil.createImageFile(act);
|
openCam(act);
|
||||||
ImageGetUtil.cameraAlbumGetImage(act,file);
|
// file=ImageGetUtil.createImageFile(act);
|
||||||
|
// ImageGetUtil.cameraAlbumGetImage(act,file);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
img.setOnClickListener(v -> {
|
||||||
|
if (!key){
|
||||||
|
PermissionX.init(act)
|
||||||
|
.permissions(Manifest.permission.CAMERA)
|
||||||
|
.request((allGranted, grantedList, deniedList) -> {
|
||||||
|
if (allGranted) {
|
||||||
|
openCam(act);
|
||||||
|
} else {
|
||||||
|
Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
btn_quxiao.setOnClickListener(v -> popupWindow.dismiss());
|
btn_quxiao.setOnClickListener(v -> popupWindow.dismiss());
|
||||||
//popupWindow消失屏幕变为不透明
|
//popupWindow消失屏幕变为不透明
|
||||||
popupWindow.setOnDismissListener(() -> {
|
popupWindow.setOnDismissListener(() -> {
|
||||||
@@ -99,4 +113,13 @@ public class GetCarImageAlert {
|
|||||||
popupWindow.dismiss();
|
popupWindow.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void openCam(AppCompatActivity act){
|
||||||
|
file=ImageGetUtil.createImageFile(act);
|
||||||
|
if (file!=null){
|
||||||
|
ImageGetUtil.cameraAlbumGetImage(act,file);
|
||||||
|
}else{
|
||||||
|
Toast.makeText(act.getBaseContext(), "路径创建失败,请清除缓存后重试", Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ public class LocationUtil{
|
|||||||
|
|
||||||
private double latitude;
|
private double latitude;
|
||||||
private double longitude;
|
private double longitude;
|
||||||
|
private int errorCode;
|
||||||
private String address;
|
private String address;
|
||||||
private Context con;
|
private Context con;
|
||||||
private Handler hd;
|
private Handler hd;
|
||||||
@@ -39,6 +40,10 @@ public class LocationUtil{
|
|||||||
return longitude;
|
return longitude;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double getErrorCode() {
|
||||||
|
return errorCode;
|
||||||
|
}
|
||||||
|
|
||||||
public String getAddress() {
|
public String getAddress() {
|
||||||
return address;
|
return address;
|
||||||
}
|
}
|
||||||
@@ -62,7 +67,7 @@ public class LocationUtil{
|
|||||||
//LocationMode.Hight_Accuracy:高精度;
|
//LocationMode.Hight_Accuracy:高精度;
|
||||||
//LocationMode. Battery_Saving:低功耗;
|
//LocationMode. Battery_Saving:低功耗;
|
||||||
//LocationMode. Device_Sensors:仅使用设备;
|
//LocationMode. Device_Sensors:仅使用设备;
|
||||||
option.setCoorType("GCJ02");
|
option.setCoorType("BD09ll");
|
||||||
//可选,设置返回经纬度坐标类型,默认GCJ02
|
//可选,设置返回经纬度坐标类型,默认GCJ02
|
||||||
//GCJ02:国测局坐标;
|
//GCJ02:国测局坐标;
|
||||||
//BD09ll:百度经纬度坐标;
|
//BD09ll:百度经纬度坐标;
|
||||||
@@ -112,7 +117,8 @@ public class LocationUtil{
|
|||||||
float radius = location.getRadius(); //获取定位精度,默认值为0.0f
|
float radius = location.getRadius(); //获取定位精度,默认值为0.0f
|
||||||
String coorType = location.getCoorType();
|
String coorType = location.getCoorType();
|
||||||
//获取经纬度坐标类型,以LocationClientOption中设置过的坐标类型为准
|
//获取经纬度坐标类型,以LocationClientOption中设置过的坐标类型为准
|
||||||
int errorCode = location.getLocType();
|
errorCode = location.getLocType();
|
||||||
|
String locTypeDescription = location.getLocTypeDescription();
|
||||||
//获取定位类型、定位错误返回码,具体信息可参照类参考中BDLocation类中的说明
|
//获取定位类型、定位错误返回码,具体信息可参照类参考中BDLocation类中的说明
|
||||||
Log.e("定位位置address",address+"");
|
Log.e("定位位置address",address+"");
|
||||||
Log.e("定位坐标latitude",latitude+"");
|
Log.e("定位坐标latitude",latitude+"");
|
||||||
|
|||||||
@@ -55,13 +55,13 @@
|
|||||||
android:layout_width="@dimen/dp_90"
|
android:layout_width="@dimen/dp_90"
|
||||||
android:layout_height="@dimen/dp_90"
|
android:layout_height="@dimen/dp_90"
|
||||||
android:background="#EEEEEE">
|
android:background="#EEEEEE">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="@dimen/dp_23"
|
android:layout_width="@dimen/dp_23"
|
||||||
android:layout_height="@dimen/dp_23"
|
android:layout_height="@dimen/dp_23"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerInParent="true"
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
android:scaleType="fitXY"
|
android:scaleType="fitXY"
|
||||||
android:src="@mipmap/up_img"/>
|
android:src="@mipmap/up_img" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_marginLeft="@dimen/dp_8"
|
android:layout_marginLeft="@dimen/dp_8"
|
||||||
@@ -118,6 +118,7 @@
|
|||||||
android:background="@drawable/bg_bai"
|
android:background="@drawable/bg_bai"
|
||||||
android:elevation="@dimen/dp_1">
|
android:elevation="@dimen/dp_1">
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
|
android:visibility="gone"
|
||||||
android:id="@+id/cow1"
|
android:id="@+id/cow1"
|
||||||
android:layout_marginBottom="@dimen/dp_10"
|
android:layout_marginBottom="@dimen/dp_10"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -130,28 +131,28 @@
|
|||||||
android:textColor="#ffc4c4ce"
|
android:textColor="#ffc4c4ce"
|
||||||
android:textSize="@dimen/sp_13"
|
android:textSize="@dimen/sp_13"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/value1"
|
android:id="@+id/value1"
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="#ff999999"
|
android:layout_alignParentRight="true"
|
||||||
android:textSize="@dimen/sp_13"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:hint="点击进行手动输入"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:layout_marginLeft="@dimen/dp_30"
|
android:layout_marginLeft="@dimen/dp_30"
|
||||||
android:gravity="right"
|
|
||||||
android:background="@null"
|
android:background="@null"
|
||||||
/>
|
android:ellipsize="end"
|
||||||
|
android:gravity="right"
|
||||||
|
android:hint="点击进行手动输入"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="#ff999999"
|
||||||
|
android:textSize="@dimen/sp_13" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
<View
|
<View
|
||||||
|
android:visibility="gone"
|
||||||
android:id="@+id/vs"
|
android:id="@+id/vs"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/dp_1"
|
android:layout_height="@dimen/dp_1"
|
||||||
android:background="@drawable/bottom_xu"/>
|
android:background="@drawable/bottom_xu"/>
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_marginTop="@dimen/dp_10"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
<TextView
|
<TextView
|
||||||
|
|||||||
@@ -0,0 +1,175 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:background="@drawable/bg_theme"
|
||||||
|
android:id="@+id/activity_shangchuan">
|
||||||
|
<ImageView
|
||||||
|
android:layout_marginTop="@dimen/dp_16"
|
||||||
|
android:layout_width="@dimen/dp_300"
|
||||||
|
android:layout_height="@dimen/dp_207"
|
||||||
|
android:src="@mipmap/top_creativity"
|
||||||
|
android:layout_centerHorizontal="true"/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_marginTop="@dimen/dp_58"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/return_btn"
|
||||||
|
android:layout_marginLeft="@dimen/dp_30"
|
||||||
|
android:layout_width="@dimen/dp_40"
|
||||||
|
android:layout_height="@dimen/dp_31"
|
||||||
|
android:src="@mipmap/return_lefts"
|
||||||
|
android:padding="@dimen/dp_10"
|
||||||
|
android:scaleType="fitXY"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_loaction"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="@dimen/sp_14"
|
||||||
|
android:text="定位成功"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_marginRight="@dimen/dp_30"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:padding="@dimen/dp_5"
|
||||||
|
android:textColor="@color/theme_color"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_marginLeft="@dimen/dp_38"
|
||||||
|
android:layout_marginTop="@dimen/dp_8"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="补传"
|
||||||
|
android:textColor="#ff000000"
|
||||||
|
android:textSize="@dimen/sp_23"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/name_top"
|
||||||
|
android:layout_marginLeft="@dimen/dp_38"
|
||||||
|
android:layout_marginTop="@dimen/dp_8"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="上传卸货照片"
|
||||||
|
android:textColor="#ff000000"
|
||||||
|
android:textSize="@dimen/sp_23"
|
||||||
|
/>
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/getImg1"
|
||||||
|
android:layout_marginTop="@dimen/dp_33"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp_38"
|
||||||
|
android:layout_marginRight="@dimen/dp_38"
|
||||||
|
app:cardCornerRadius="@dimen/dp_8">
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/getImg"
|
||||||
|
android:layout_marginLeft="@dimen/dp_11"
|
||||||
|
android:layout_marginTop="@dimen/dp_13"
|
||||||
|
android:layout_marginBottom="@dimen/dp_13"
|
||||||
|
android:layout_width="@dimen/dp_90"
|
||||||
|
android:layout_height="@dimen/dp_90"
|
||||||
|
android:background="#EEEEEE">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/res_img"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/img_icon"
|
||||||
|
android:layout_width="@dimen/dp_23"
|
||||||
|
android:layout_height="@dimen/dp_23"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:src="@mipmap/up_img"/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/img_delete"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_width="@dimen/dp_25"
|
||||||
|
android:layout_height="@dimen/dp_25"
|
||||||
|
android:src="@mipmap/icon_delete"
|
||||||
|
android:padding="@dimen/dp_3"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
</RelativeLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_marginTop="@dimen/dp_13"
|
||||||
|
android:layout_marginLeft="@dimen/dp_8"
|
||||||
|
android:layout_marginRight="@dimen/dp_10"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<TextView
|
||||||
|
android:layout_marginTop="@dimen/dp_7"
|
||||||
|
android:id="@+id/name_body"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="卸货照片"
|
||||||
|
android:textColor="#ff000000"
|
||||||
|
android:textSize="@dimen/sp_13"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:layout_marginTop="@dimen/dp_13"
|
||||||
|
android:id="@+id/address"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="#ff999999"
|
||||||
|
android:text=""
|
||||||
|
android:textSize="@dimen/sp_13" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_marginTop="@dimen/dp_10"
|
||||||
|
android:layout_marginLeft="@dimen/dp_38"
|
||||||
|
android:layout_marginRight="@dimen/dp_38"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tips_x"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="*"
|
||||||
|
android:textColor="#E61829"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tips"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="卸货照片包含车牌号、三分之二车身或者卸货场景"
|
||||||
|
android:textColor="#E61829"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
</LinearLayout>
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_marginTop="@dimen/dp_33"
|
||||||
|
android:layout_marginLeft="@dimen/dp_38"
|
||||||
|
android:layout_marginRight="@dimen/dp_38"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_42"
|
||||||
|
app:cardCornerRadius="@dimen/dp_21"
|
||||||
|
app:cardBackgroundColor="@color/red">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/submit"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:text="提交"
|
||||||
|
android:textColor="#fff"
|
||||||
|
android:textSize="@dimen/sp_15"
|
||||||
|
android:gravity="center"
|
||||||
|
/>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
@@ -99,6 +99,8 @@
|
|||||||
android:textSize="@dimen/sp_17"
|
android:textSize="@dimen/sp_17"
|
||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:layout_marginBottom="@dimen/dp_3"/>
|
android:layout_marginBottom="@dimen/dp_3"/>
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_marginTop="@dimen/dp_8"
|
android:layout_marginTop="@dimen/dp_8"
|
||||||
@@ -122,6 +124,7 @@
|
|||||||
android:progressDrawable="@drawable/par_bg"
|
android:progressDrawable="@drawable/par_bg"
|
||||||
/>
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tvContent"
|
||||||
android:layout_marginTop="@dimen/dp_6"
|
android:layout_marginTop="@dimen/dp_6"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -131,6 +134,20 @@
|
|||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_marginLeft="@dimen/dp_18"
|
||||||
|
android:layout_marginRight="@dimen/dp_18"
|
||||||
|
android:id="@+id/tvOk"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="立即安装"
|
||||||
|
android:textColor="@color/theme_color"
|
||||||
|
android:textSize="@dimen/sp_17"
|
||||||
|
android:background="@null"
|
||||||
|
android:layout_marginBottom="@dimen/dp_13"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/force_box"
|
android:id="@+id/force_box"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">大河好运司机</string>
|
<!-- <string name="appName">大河好运司机</string>-->
|
||||||
<!--设置界面-->
|
<!--设置界面-->
|
||||||
<string name="alivc_recorder_setting_min_record_duration">最小时长</string>
|
<string name="alivc_recorder_setting_min_record_duration">最小时长</string>
|
||||||
<string name="alivc_recorder_setting_max_record_duration">最大时长</string>
|
<string name="alivc_recorder_setting_max_record_duration">最大时长</string>
|
||||||
|
|||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
apply from: "compile.gradle"
|
apply from: "compile.gradle"
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = "1.5.0"
|
// ext.kotlin_version = "1.5.0"
|
||||||
// ext.kotlin_version = "1.6.10"
|
ext.kotlin_version = "1.6.10"
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter() // 这个
|
jcenter() // 这个
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ dependencies {
|
|||||||
api rootProject.ext.dependencies["Xpopup"]
|
api rootProject.ext.dependencies["Xpopup"]
|
||||||
api rootProject.ext.dependencies["Countdownview"]
|
api rootProject.ext.dependencies["Countdownview"]
|
||||||
// api rootProject.ext.dependencies["CheckVersionLib"]
|
// api rootProject.ext.dependencies["CheckVersionLib"]
|
||||||
// api rootProject.ext.dependencies["Bugly"]
|
api rootProject.ext.dependencies["Bugly"]
|
||||||
// api rootProject.ext.dependencies["Zxing"]
|
// api rootProject.ext.dependencies["Zxing"]
|
||||||
api rootProject.ext.dependencies["Multidex"]
|
api rootProject.ext.dependencies["Multidex"]
|
||||||
// api rootProject.ext.dependencies["FlycoTabLayout"]
|
// api rootProject.ext.dependencies["FlycoTabLayout"]
|
||||||
|
|||||||
@@ -176,9 +176,10 @@ public final class TimeUtil {
|
|||||||
* 注意:SimpleDateFormat不是线程安全的,线程安全需用{@code ThreadLocal<SimpleDateFormat>}
|
* 注意:SimpleDateFormat不是线程安全的,线程安全需用{@code ThreadLocal<SimpleDateFormat>}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private static final DateFormat DEFAULT_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
|
public static final DateFormat DEFAULT_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
|
||||||
private static final DateFormat DEFAULT_FORMAT2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZSS:SS", Locale.getDefault());
|
private static final DateFormat DEFAULT_FORMAT2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZSS:SS", Locale.getDefault());
|
||||||
private static final DateFormat DEFAULT_FORMAT3 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault());
|
private static final DateFormat DEFAULT_FORMAT3 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault());
|
||||||
|
public static final DateFormat DEFAULT_FORMAT4 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.getDefault());
|
||||||
|
|
||||||
private TimeUtil() {
|
private TimeUtil() {
|
||||||
throw new UnsupportedOperationException("u can't instantiate me...");
|
throw new UnsupportedOperationException("u can't instantiate me...");
|
||||||
@@ -215,7 +216,7 @@ public final class TimeUtil {
|
|||||||
* @return 毫秒时间戳
|
* @return 毫秒时间戳
|
||||||
*/
|
*/
|
||||||
public static long string2Millis(final String time) {
|
public static long string2Millis(final String time) {
|
||||||
if (TextUtils.isEmpty(time)){
|
if (TextUtils.isEmpty(time)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return string2Millis(time, DEFAULT_FORMAT);
|
return string2Millis(time, DEFAULT_FORMAT);
|
||||||
@@ -242,10 +243,10 @@ public final class TimeUtil {
|
|||||||
* 将时间字符串转为时间戳
|
* 将时间字符串转为时间戳
|
||||||
* <p>time格式为format</p>
|
* <p>time格式为format</p>
|
||||||
*
|
*
|
||||||
* @param time 时间字符串
|
* @param time 时间字符串
|
||||||
* @return 毫秒时间戳
|
* @return 毫秒时间戳
|
||||||
*/
|
*/
|
||||||
public static String string2String(final String time,final SimpleDateFormat format) {
|
public static String string2String(final String time, final SimpleDateFormat format) {
|
||||||
try {
|
try {
|
||||||
return date2String(format.parse(time));
|
return date2String(format.parse(time));
|
||||||
// return DEFAULT_FORMAT.format(DEFAULT_FORMAT2.parse(time).getTime());
|
// return DEFAULT_FORMAT.format(DEFAULT_FORMAT2.parse(time).getTime());
|
||||||
@@ -421,7 +422,7 @@ public final class TimeUtil {
|
|||||||
* @return 合适型两个时间差
|
* @return 合适型两个时间差
|
||||||
*/
|
*/
|
||||||
public static String getFitTimeSpan(final String time0, final String time1, final int precision) {
|
public static String getFitTimeSpan(final String time0, final String time1, final int precision) {
|
||||||
if (TextUtils.isEmpty(time0)||TextUtils.isEmpty(time1)){
|
if (TextUtils.isEmpty(time0) || TextUtils.isEmpty(time1)) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
return millis2FitTimeSpan(Math.abs(string2Millis(time0, DEFAULT_FORMAT) - string2Millis(time1, DEFAULT_FORMAT)), precision);
|
return millis2FitTimeSpan(Math.abs(string2Millis(time0, DEFAULT_FORMAT) - string2Millis(time1, DEFAULT_FORMAT)), precision);
|
||||||
@@ -1685,7 +1686,7 @@ public final class TimeUtil {
|
|||||||
* @param compareDate
|
* @param compareDate
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static boolean compareDate(String nowDate, String compareDate,DateFormat format) {
|
public static boolean compareDate(String nowDate, String compareDate, DateFormat format) {
|
||||||
DateFormat df = format;
|
DateFormat df = format;
|
||||||
try {
|
try {
|
||||||
Date now = df.parse(nowDate);
|
Date now = df.parse(nowDate);
|
||||||
@@ -1700,4 +1701,22 @@ public final class TimeUtil {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 得到二个日期间的间隔天数
|
||||||
|
*
|
||||||
|
* @return 间格的天数(null表示时间格式不正确)
|
||||||
|
*/
|
||||||
|
public static int compareNowDate(long comTime) {
|
||||||
|
int min;
|
||||||
|
try {
|
||||||
|
min = (int) ((getNowMills() - comTime) / (60 * 1000));
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return min;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user