Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d5d21b154f |
+2
-4
@@ -38,8 +38,8 @@ android {
|
|||||||
applicationId "com.arpa.hndahesudintocctmsdriver"
|
applicationId "com.arpa.hndahesudintocctmsdriver"
|
||||||
minSdkVersion 24
|
minSdkVersion 24
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 78
|
versionCode 73
|
||||||
versionName "3.4.8"
|
versionName "3.4.3"
|
||||||
flavorDimensions "CHANNEL_VALUE"
|
flavorDimensions "CHANNEL_VALUE"
|
||||||
flavorDimensions "app_icon"
|
flavorDimensions "app_icon"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
@@ -231,6 +231,4 @@ dependencies {
|
|||||||
|
|
||||||
implementation project(path: ':mylibrary')
|
implementation project(path: ':mylibrary')
|
||||||
|
|
||||||
implementation files('libs/mdp-release.aar')
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Binary file not shown.
@@ -254,15 +254,6 @@
|
|||||||
android:name="com.alct.mdp.MDPLocationService"
|
android:name="com.alct.mdp.MDPLocationService"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:process=":mdpLocation_v1" />
|
android:process=":mdpLocation_v1" />
|
||||||
|
|
||||||
<!--后台访问 gps-->
|
|
||||||
<service
|
|
||||||
android:name="com.express.mdp.GpsService"
|
|
||||||
android:foregroundServiceType="location"
|
|
||||||
android:label="GPS服务"
|
|
||||||
android:priority="1000" />
|
|
||||||
|
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name="com.baidu.location.f"
|
android:name="com.baidu.location.f"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
|
|||||||
@@ -63,8 +63,8 @@ public class App extends Application {
|
|||||||
}
|
}
|
||||||
//在使用SDK各组件之前初始化context信息,传入ApplicationContext
|
//在使用SDK各组件之前初始化context信息,传入ApplicationContext
|
||||||
// 路由初始化
|
// 路由初始化
|
||||||
// JVerificationInterface.setDebugMode(true);
|
JVerificationInterface.setDebugMode(true);
|
||||||
// JVerificationInterface.init(this, 5000, (code, msg) -> Log.d("tag", "code = " + code + " msg = " + msg));
|
JVerificationInterface.init(this, 5000, (code, msg) -> Log.d("tag", "code = " + code + " msg = " + msg));
|
||||||
//友盟
|
//友盟
|
||||||
//设置非debug版本开启
|
//设置非debug版本开启
|
||||||
if (!isDebugVersion(con)) {
|
if (!isDebugVersion(con)) {
|
||||||
|
|||||||
@@ -232,10 +232,6 @@ public class H5Activity extends AppCompatActivity {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
String url = intent.getStringExtra("url");
|
String url = intent.getStringExtra("url");
|
||||||
if (TextUtils.isEmpty(url)) {
|
|
||||||
ActivityUtils.finishToActivity(MainActivity.class, false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
viewFile = intent.getBooleanExtra("view_file", false);
|
viewFile = intent.getBooleanExtra("view_file", false);
|
||||||
if (url.startsWith("alipay")) {
|
if (url.startsWith("alipay")) {
|
||||||
try {
|
try {
|
||||||
@@ -246,7 +242,7 @@ public class H5Activity extends AppCompatActivity {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
// }else if (url.startsWith("https://agreement.dahehuoyun.com/#/1ba5c216/912f4c9587/5eb5184653/6ef9")) {
|
// }else if (url.startsWith("https://agreement.dahehuoyun.com/#/1ba5c216/912f4c9587/5eb5184653/6ef9")) {
|
||||||
} else if (url.startsWith("https://agreement.dahehuoyun.com")) {
|
} else if (url.startsWith("https://agreement.dahehuoyun.com/goApp")) {
|
||||||
Intent in = new Intent(ctx, FaceSuccActivity.class);
|
Intent in = new Intent(ctx, FaceSuccActivity.class);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
if (isGoCar) {
|
if (isGoCar) {
|
||||||
@@ -275,7 +271,7 @@ public class H5Activity extends AppCompatActivity {
|
|||||||
Log.e("test", "要加载的地址:" + uri.getScheme() + " " + url + " ");
|
Log.e("test", "要加载的地址:" + uri.getScheme() + " " + url + " ");
|
||||||
if (uri.getScheme().equals("http") || uri.getScheme().equals("https")) {
|
if (uri.getScheme().equals("http") || uri.getScheme().equals("https")) {
|
||||||
// if (url.startsWith("https://agreement.dahehuoyun.com/#/1ba5c216/912f4c9587/5eb5184653/6ef9")) {
|
// if (url.startsWith("https://agreement.dahehuoyun.com/#/1ba5c216/912f4c9587/5eb5184653/6ef9")) {
|
||||||
if (url.startsWith("https://agreement.dahehuoyun.com")) {
|
if (url.startsWith("https://agreement.dahehuoyun.com/goApp")) {
|
||||||
Intent in = new Intent(ctx, FaceSuccActivity.class);
|
Intent in = new Intent(ctx, FaceSuccActivity.class);
|
||||||
in.putExtra("isGoCar", isGoCar);
|
in.putExtra("isGoCar", isGoCar);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
@@ -358,11 +354,11 @@ public class H5Activity extends AppCompatActivity {
|
|||||||
if (status) {
|
if (status) {
|
||||||
//认证成功返回
|
//认证成功返回
|
||||||
//认证成功返回
|
//认证成功返回
|
||||||
// new Handler().postDelayed(() -> {
|
new Handler().postDelayed(() -> {
|
||||||
// FaceEvent he = new FaceEvent("刷脸成功");
|
FaceEvent he = new FaceEvent("刷脸成功");
|
||||||
// EventBus.getDefault().post(he);
|
EventBus.getDefault().post(he);
|
||||||
// finish();
|
finish();
|
||||||
// }, 800);
|
}, 800);
|
||||||
Toast.makeText(H5Activity.this, "认证成功", Toast.LENGTH_LONG).show();
|
Toast.makeText(H5Activity.this, "认证成功", Toast.LENGTH_LONG).show();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,18 +68,9 @@ public class CarListBean {
|
|||||||
private Object carImage;
|
private Object carImage;
|
||||||
private String owner;
|
private String owner;
|
||||||
private String vehicleNumber;
|
private String vehicleNumber;
|
||||||
private String outInvoice;
|
|
||||||
private int auditStatus;
|
private int auditStatus;
|
||||||
private String drivingLicenseValidity;
|
private String drivingLicenseValidity;
|
||||||
|
|
||||||
public String getOutInvoice() {
|
|
||||||
return outInvoice;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOutInvoice(String outInvoice) {
|
|
||||||
this.outInvoice = outInvoice;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCarNumber() {
|
public String getCarNumber() {
|
||||||
return carNumber == null ? "" : carNumber;
|
return carNumber == null ? "" : carNumber;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,53 +0,0 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.bean;
|
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName GDImage
|
|
||||||
* @Author john
|
|
||||||
* @Date 2024/11/27 14:04
|
|
||||||
* @Description TODO
|
|
||||||
*/
|
|
||||||
public class GDImage extends GDLocation{
|
|
||||||
|
|
||||||
|
|
||||||
private String fileName;
|
|
||||||
|
|
||||||
private String fileData;
|
|
||||||
|
|
||||||
private String fileExt;
|
|
||||||
|
|
||||||
private String imageTakenDate;
|
|
||||||
|
|
||||||
public String getFileName() {
|
|
||||||
return fileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFileName(String fileName) {
|
|
||||||
this.fileName = fileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFileData() {
|
|
||||||
return fileData;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFileData(String fileData) {
|
|
||||||
this.fileData = fileData;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFileExt() {
|
|
||||||
return fileExt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFileExt(String fileExt) {
|
|
||||||
this.fileExt = fileExt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getImageTakenDate() {
|
|
||||||
return imageTakenDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setImageTakenDate(String imageTakenDate) {
|
|
||||||
this.imageTakenDate = imageTakenDate;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.bean;
|
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName GDLocation
|
|
||||||
* @Author john
|
|
||||||
* @Date 2024/11/27 13:59
|
|
||||||
* @Description TODO
|
|
||||||
*/
|
|
||||||
public class GDLocation implements Serializable {
|
|
||||||
|
|
||||||
private double baiduLongitude;
|
|
||||||
private double baiduLatitude;
|
|
||||||
private String location;
|
|
||||||
private String time;
|
|
||||||
private double altitude;
|
|
||||||
private float speed;
|
|
||||||
private float direction;
|
|
||||||
private int interval;
|
|
||||||
|
|
||||||
public double getBaiduLongitude() {
|
|
||||||
return baiduLongitude;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBaiduLongitude(double baiduLongitude) {
|
|
||||||
this.baiduLongitude = baiduLongitude;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getBaiduLatitude() {
|
|
||||||
return baiduLatitude;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBaiduLatitude(double baiduLatitude) {
|
|
||||||
this.baiduLatitude = baiduLatitude;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLocation() {
|
|
||||||
return location;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLocation(String location) {
|
|
||||||
this.location = location;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTime() {
|
|
||||||
return time;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTime(String time) {
|
|
||||||
this.time = time;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getAltitude() {
|
|
||||||
return altitude;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAltitude(double altitude) {
|
|
||||||
this.altitude = altitude;
|
|
||||||
}
|
|
||||||
|
|
||||||
public float getSpeed() {
|
|
||||||
return speed;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSpeed(float speed) {
|
|
||||||
this.speed = speed;
|
|
||||||
}
|
|
||||||
|
|
||||||
public float getDirection() {
|
|
||||||
return direction;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDirection(float direction) {
|
|
||||||
this.direction = direction;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getInterval() {
|
|
||||||
return interval;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInterval(int interval) {
|
|
||||||
this.interval = interval;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -83,8 +83,6 @@ public class HuoYuanDelBean {
|
|||||||
private String vehicleTypeName;
|
private String vehicleTypeName;
|
||||||
private int vehicleLength;
|
private int vehicleLength;
|
||||||
private String vehicleLengthName;
|
private String vehicleLengthName;
|
||||||
private String carNumber;
|
|
||||||
private String carId;
|
|
||||||
private String namedDrivers;
|
private String namedDrivers;
|
||||||
private String requirement;
|
private String requirement;
|
||||||
private String totalFreight;
|
private String totalFreight;
|
||||||
@@ -99,23 +97,6 @@ public class HuoYuanDelBean {
|
|||||||
private Object contactName;
|
private Object contactName;
|
||||||
private Object contactPhone;
|
private Object contactPhone;
|
||||||
|
|
||||||
|
|
||||||
public String getCarNumber() {
|
|
||||||
return carNumber == null ? "" : carNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCarNumber(String carNumber) {
|
|
||||||
this.carNumber = carNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCarId() {
|
|
||||||
return carId == null ? "" : carId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCarId(String carId) {
|
|
||||||
this.carId = carId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.constant;
|
|
||||||
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author hlh
|
|
||||||
* @version 1.0.0
|
|
||||||
* @date 2022/1/10 11:34
|
|
||||||
* @description:交通厅参数
|
|
||||||
*/
|
|
||||||
public class NewLJConstant {
|
|
||||||
|
|
||||||
public final static String ENTER_PRISE_CODE ="E0019169";
|
|
||||||
|
|
||||||
public final static String ENTER_PRISE_IDENTITY = BuildConfig.isTest?"95033cc3492e420d83d7f09eea1400ac":"9179388b0e0847e1862d6400f9cbc778";
|
|
||||||
|
|
||||||
public final static String ENTER_PRISE_KEY =BuildConfig.isTest?"e9844a9b0bba417e89cb8623489abd2f":"156d724e9701420198fcbd52cb1ca529";
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -55,15 +55,15 @@ class MessagePop(context: Context) : CenterPopupView(context), View.OnClickListe
|
|||||||
}
|
}
|
||||||
R.id.tvOk,R.id.tvPhone -> {
|
R.id.tvOk,R.id.tvPhone -> {
|
||||||
dismiss()
|
dismiss()
|
||||||
// if (XPermission.create(context).isGranted(Manifest.permission.CALL_PHONE)){
|
if (XPermission.create(context).isGranted(Manifest.permission.CALL_PHONE)){
|
||||||
val toString = tvPhone.text.toString()
|
val toString = tvPhone.text.toString()
|
||||||
val intent = Intent(Intent.ACTION_DIAL)
|
val intent = Intent(Intent.ACTION_DIAL)
|
||||||
val data = Uri.parse("tel:$toString")
|
val data = Uri.parse("tel:$toString")
|
||||||
intent.data = data
|
intent.data = data
|
||||||
context.startActivity(intent)
|
context.startActivity(intent)
|
||||||
// }else{
|
}else{
|
||||||
// ToastUtils.showToast(context,"请开启电话权限")
|
ToastUtils.showToast(context,"请开启电话权限")
|
||||||
// }
|
}
|
||||||
|
|
||||||
// BaseUtils.callPhone(content as Activity, tvPhone.text.toString())
|
// BaseUtils.callPhone(content as Activity, tvPhone.text.toString())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.arpa.hndahesudintocctmsdriver.report;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.alct.mdp.MDPLocationCollectionManager;
|
import com.alct.mdp.MDPLocationCollectionManager;
|
||||||
@@ -13,10 +12,7 @@ import com.arpa.hndahesudintocctmsdriver.App;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||||
import com.arpa.hndahesudintocctmsdriver.parts.AuthParts;
|
import com.arpa.hndahesudintocctmsdriver.parts.AuthParts;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.NewLJUtils;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.msg.MsgUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.msg.MsgUtil;
|
||||||
import com.dahe.mylibrary.callback.OnGDDownloadResultListener;
|
|
||||||
import com.dahe.mylibrary.callback.OnGDResultListener;
|
|
||||||
import com.dahe.mylibrary.utils.ToastUtils;
|
import com.dahe.mylibrary.utils.ToastUtils;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.DriverAuthDataBean;
|
import com.arpa.hndahesudintocctmsdriver.bean.DriverAuthDataBean;
|
||||||
@@ -51,49 +47,27 @@ public class ALProcess {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Identity idy=new Identity();
|
Identity idy=new Identity();
|
||||||
// //企业代码
|
//企业代码
|
||||||
// idy.setEnterpriseCode(BuildConfig.isTest?ENTERPRISE_CODE_TEXT:ENTERPRISE_CODE);
|
idy.setEnterpriseCode(BuildConfig.isTest?ENTERPRISE_CODE_TEXT:ENTERPRISE_CODE);
|
||||||
// //企业app的身份码
|
//企业app的身份码
|
||||||
// idy.setAppIdentity(BuildConfig.isTest?APP_IDENTITY_TEXT:APP_IDENTITY);
|
idy.setAppIdentity(BuildConfig.isTest?APP_IDENTITY_TEXT:APP_IDENTITY);
|
||||||
// //企业app验证码
|
//企业app验证码
|
||||||
// idy.setAppKey(BuildConfig.isTest?APP_KEY_TEXT:APP_KEY);
|
idy.setAppKey(BuildConfig.isTest?APP_KEY_TEXT:APP_KEY);
|
||||||
// //司机身份证
|
//司机身份证
|
||||||
// idy.setDriverIdentity(auth.getData().getIdcard());
|
idy.setDriverIdentity(auth.getData().getIdcard());
|
||||||
// //idy.setDriverIdentity("410725198311042012");
|
//idy.setDriverIdentity("410725198311042012");
|
||||||
// MDPLocationCollectionManager.register(con, idy, new OnResultListener() {
|
MDPLocationCollectionManager.register(con, idy, new OnResultListener() {
|
||||||
// @Override
|
|
||||||
// public void onSuccess() {
|
|
||||||
// Log.e("--success--","验证成功");
|
|
||||||
// getFq(con);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onFailure(java.lang.String s, java.lang.String s1) {
|
|
||||||
// Log.e("--error--",s+s1+"");
|
|
||||||
// new MessageUtils().showCenMessage(con,s1);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
NewLJUtils.getInstance().getToken(con, new OnGDResultListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
NewLJUtils.getInstance().confirmInvoice(con, new OnGDResultListener() {
|
Log.e("--success--","验证成功");
|
||||||
@Override
|
getFq(con);
|
||||||
public void onSuccess() {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(String var1, String var2) {
|
public void onFailure(java.lang.String s, java.lang.String s1) {
|
||||||
|
Log.e("--error--",s+s1+"");
|
||||||
}
|
new MessageUtils().showCenMessage(con,s1);
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(String var1, String var2) {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -157,88 +131,33 @@ public class ALProcess {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void verification(Context con,String carNum,Handler hd){
|
public static void verification(Context con,Handler hd){
|
||||||
DriverAuthDataBean auth= AuthParts.getAuth(con);
|
DriverAuthDataBean auth= AuthParts.getAuth(con);
|
||||||
if (auth==null){
|
Identity idy=new Identity();
|
||||||
return;
|
//企业代码
|
||||||
}
|
idy.setEnterpriseCode(BuildConfig.isTest?ENTERPRISE_CODE_TEXT:ENTERPRISE_CODE);
|
||||||
if (TextUtils.isEmpty(carNum)){
|
//企业app的身份码
|
||||||
ToastUtils.showToast(con,"请选择车辆");
|
idy.setAppIdentity(BuildConfig.isTest?APP_IDENTITY_TEXT:APP_IDENTITY);
|
||||||
return;
|
//企业app验证码
|
||||||
}
|
idy.setAppKey(BuildConfig.isTest?APP_KEY_TEXT:APP_KEY);
|
||||||
// Identity idy=new Identity();
|
//司机身份证
|
||||||
// //企业代码
|
idy.setDriverIdentity(auth.getData().getIdcard());
|
||||||
// idy.setEnterpriseCode(BuildConfig.isTest?ENTERPRISE_CODE_TEXT:ENTERPRISE_CODE);
|
//idy.setDriverIdentity("410725198311042012");
|
||||||
// //企业app的身份码
|
MDPLocationCollectionManager.register(con, idy, new OnResultListener() {
|
||||||
// idy.setAppIdentity(BuildConfig.isTest?APP_IDENTITY_TEXT:APP_IDENTITY);
|
|
||||||
// //企业app验证码
|
|
||||||
// idy.setAppKey(BuildConfig.isTest?APP_KEY_TEXT:APP_KEY);
|
|
||||||
// //司机身份证
|
|
||||||
// idy.setDriverIdentity(auth.getData().getIdcard());
|
|
||||||
// //idy.setDriverIdentity("410725198311042012");
|
|
||||||
// MDPLocationCollectionManager.register(con, idy, new OnResultListener() {
|
|
||||||
// @Override
|
|
||||||
// public void onSuccess() {
|
|
||||||
// MsgUtil.addHdMsgWatBody(hd, 1111,"认证成功");
|
|
||||||
// Log.e("--success--","验证成功");
|
|
||||||
// getFq(con);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onFailure(java.lang.String s, java.lang.String s1) {
|
|
||||||
// Log.e("--error--",s+s1+"");
|
|
||||||
// MsgUtil.addHdMsgWatBody(hd, 2222,s1);
|
|
||||||
//// new MessageUtils().showCenMessage(con,s1);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
NewLJUtils.getInstance().trucks(con, auth.getData().getIdcard(),carNum, new OnGDDownloadResultListener(){
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(String var1) {
|
public void onSuccess() {
|
||||||
MsgUtil.addHdMsgWatBody(hd, 1111,"认证成功");
|
MsgUtil.addHdMsgWatBody(hd, 1111,"认证成功");
|
||||||
|
Log.e("--success--","验证成功");
|
||||||
|
getFq(con);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(String var1, String var2) {
|
public void onFailure(java.lang.String s, java.lang.String s1) {
|
||||||
MsgUtil.addHdMsgWatBody(hd, 2222,var2);
|
Log.e("--error--",s+s1+"");
|
||||||
|
MsgUtil.addHdMsgWatBody(hd, 2222,s1);
|
||||||
|
// new MessageUtils().showCenMessage(con,s1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// NewLJUtils.getInstance().searchDriver(con, auth.getData().getIdcard(), new OnGDDownloadResultListener(){
|
|
||||||
// @Override
|
|
||||||
// public void onSuccess(String var1) {
|
|
||||||
// MsgUtil.addHdMsgWatBody(hd, 1111,"认证成功");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onFailure(String var1, String var2) {
|
|
||||||
// MsgUtil.addHdMsgWatBody(hd, 2222,var2);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
// NewLJUtils.getInstance().getToken(con, new OnGDResultListener() {
|
|
||||||
// @Override
|
|
||||||
// public void onSuccess() {
|
|
||||||
// NewLJUtils.getInstance().confirmInvoice(con, new OnGDResultListener() {
|
|
||||||
// @Override
|
|
||||||
// public void onSuccess() {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onFailure(String var1, String var2) {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onFailure(String var1, String var2) {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,9 +119,6 @@ public class JTTProcess {
|
|||||||
//参数 ShippingNoteInfo 和 start 接口中的参数 ShippingNoteInfo 相
|
//参数 ShippingNoteInfo 和 start 接口中的参数 ShippingNoteInfo 相
|
||||||
//同,这里 shippingNoteInfo 信息只需传入运单号和分单号即可
|
//同,这里 shippingNoteInfo 信息只需传入运单号和分单号即可
|
||||||
public static void send(Context con,StartOrderBean sob,String remark){
|
public static void send(Context con,StartOrderBean sob,String remark){
|
||||||
if (sob.getData()==null){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
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());
|
||||||
|
|||||||
@@ -80,12 +80,6 @@ public class UserRequset {
|
|||||||
RequestUtil.start(1, "userdata", re, con, hd);
|
RequestUtil.start(1, "userdata", re, con, hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
//账户信息
|
|
||||||
public void User2() {
|
|
||||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getUserUrl(), ""), getToken(con), con);
|
|
||||||
RequestUtil.start(1, "userdata2", re, con, hd);
|
|
||||||
}
|
|
||||||
|
|
||||||
//司机认证信息
|
//司机认证信息
|
||||||
public void driverAuthData() {
|
public void driverAuthData() {
|
||||||
String mt = "{}";
|
String mt = "{}";
|
||||||
|
|||||||
-40
@@ -1,40 +0,0 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.request.bean.newlj;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName InvoiceBean
|
|
||||||
* @Author john
|
|
||||||
* @Date 2024/11/25 17:06
|
|
||||||
* @Description TODO
|
|
||||||
*/
|
|
||||||
public class InvoiceBean implements Serializable {
|
|
||||||
private String driverIdentification;
|
|
||||||
private String driverInvoiceCode;
|
|
||||||
private String enterpriseCode;
|
|
||||||
|
|
||||||
|
|
||||||
public String getDriverIdentification() {
|
|
||||||
return driverIdentification;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDriverIdentification(String driverIdentification) {
|
|
||||||
this.driverIdentification = driverIdentification;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDriverInvoiceCode() {
|
|
||||||
return driverInvoiceCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDriverInvoiceCode(String driverInvoiceCode) {
|
|
||||||
this.driverInvoiceCode = driverInvoiceCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEnterpriseCode() {
|
|
||||||
return enterpriseCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEnterpriseCode(String enterpriseCode) {
|
|
||||||
this.enterpriseCode = enterpriseCode;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-135
@@ -1,135 +0,0 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.request.bean.newlj;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName InvoicesBean
|
|
||||||
* @Author john
|
|
||||||
* @Date 2024/11/29 13:08
|
|
||||||
* @Description TODO
|
|
||||||
*/
|
|
||||||
public class InvoicesBean implements Serializable {
|
|
||||||
private String totalPage;
|
|
||||||
private String totalCount;
|
|
||||||
private String pageSize;
|
|
||||||
private String currentPage;
|
|
||||||
private String sortField;
|
|
||||||
private String sortDirection;
|
|
||||||
private List<DataDTO> driverInvoices;
|
|
||||||
|
|
||||||
public String getTotalPage() {
|
|
||||||
return totalPage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTotalPage(String totalPage) {
|
|
||||||
this.totalPage = totalPage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTotalCount() {
|
|
||||||
return totalCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTotalCount(String totalCount) {
|
|
||||||
this.totalCount = totalCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPageSize() {
|
|
||||||
return pageSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPageSize(String pageSize) {
|
|
||||||
this.pageSize = pageSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCurrentPage() {
|
|
||||||
return currentPage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCurrentPage(String currentPage) {
|
|
||||||
this.currentPage = currentPage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSortField() {
|
|
||||||
return sortField;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSortField(String sortField) {
|
|
||||||
this.sortField = sortField;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSortDirection() {
|
|
||||||
return sortDirection;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSortDirection(String sortDirection) {
|
|
||||||
this.sortDirection = sortDirection;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<DataDTO> getDriverInvoices() {
|
|
||||||
return driverInvoices;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDriverInvoices(List<DataDTO> driverInvoices) {
|
|
||||||
this.driverInvoices = driverInvoices;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class DataDTO{
|
|
||||||
|
|
||||||
private String taxAmount;
|
|
||||||
private String totalAmount;
|
|
||||||
private String invoiceReceiverName;
|
|
||||||
private String totalAmountIncludeTax;
|
|
||||||
private String driverInvoiceCode;
|
|
||||||
private String taxRate;
|
|
||||||
|
|
||||||
|
|
||||||
public String getTaxAmount() {
|
|
||||||
return taxAmount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTaxAmount(String taxAmount) {
|
|
||||||
this.taxAmount = taxAmount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTotalAmount() {
|
|
||||||
return totalAmount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTotalAmount(String totalAmount) {
|
|
||||||
this.totalAmount = totalAmount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getInvoiceReceiverName() {
|
|
||||||
return invoiceReceiverName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInvoiceReceiverName(String invoiceReceiverName) {
|
|
||||||
this.invoiceReceiverName = invoiceReceiverName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTotalAmountIncludeTax() {
|
|
||||||
return totalAmountIncludeTax;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTotalAmountIncludeTax(String totalAmountIncludeTax) {
|
|
||||||
this.totalAmountIncludeTax = totalAmountIncludeTax;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDriverInvoiceCode() {
|
|
||||||
return driverInvoiceCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDriverInvoiceCode(String driverInvoiceCode) {
|
|
||||||
this.driverInvoiceCode = driverInvoiceCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTaxRate() {
|
|
||||||
return taxRate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTaxRate(String taxRate) {
|
|
||||||
this.taxRate = taxRate;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-41
@@ -1,41 +0,0 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.request.bean.newlj;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName LjTokenBean
|
|
||||||
* @Author john
|
|
||||||
* @Date 2024/11/25 10:05
|
|
||||||
* @Description TODO
|
|
||||||
*/
|
|
||||||
public class LjTokenBean implements Serializable {
|
|
||||||
|
|
||||||
|
|
||||||
private String enterpriseCode;
|
|
||||||
private String enterpriseIdentity;
|
|
||||||
private String enterpriseKey;
|
|
||||||
|
|
||||||
public String getEnterpriseCode() {
|
|
||||||
return enterpriseCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEnterpriseCode(String enterpriseCode) {
|
|
||||||
this.enterpriseCode = enterpriseCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEnterpriseIdentity() {
|
|
||||||
return enterpriseIdentity;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEnterpriseIdentity(String enterpriseIdentity) {
|
|
||||||
this.enterpriseIdentity = enterpriseIdentity;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEnterpriseKey() {
|
|
||||||
return enterpriseKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEnterpriseKey(String enterpriseKey) {
|
|
||||||
this.enterpriseKey = enterpriseKey;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-109
@@ -1,109 +0,0 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.request.bean.newlj;
|
|
||||||
|
|
||||||
import com.alct.mdp.model.Location;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.GDLocation;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName PickupBean
|
|
||||||
* @Author john
|
|
||||||
* @Date 2024/11/25 10:19
|
|
||||||
* @Description TODO
|
|
||||||
*/
|
|
||||||
public class PickupBean implements Serializable {
|
|
||||||
|
|
||||||
private String shipmentCode;
|
|
||||||
private String enterpriseCode;
|
|
||||||
private GDLocation location;
|
|
||||||
|
|
||||||
public String getShipmentCode() {
|
|
||||||
return shipmentCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setShipmentCode(String shipmentCode) {
|
|
||||||
this.shipmentCode = shipmentCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEnterpriseCode() {
|
|
||||||
return enterpriseCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEnterpriseCode(String enterpriseCode) {
|
|
||||||
this.enterpriseCode = enterpriseCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GDLocation getLocation() {
|
|
||||||
return location;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLocation(GDLocation location) {
|
|
||||||
this.location = location;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class LocationDTO {
|
|
||||||
private String time;
|
|
||||||
private double baiduLatitude;
|
|
||||||
private double baiduLongitude;
|
|
||||||
private double altitude;
|
|
||||||
private double speed;
|
|
||||||
private double bearing;
|
|
||||||
private String location;
|
|
||||||
|
|
||||||
public String getTime() {
|
|
||||||
return time;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTime(String time) {
|
|
||||||
this.time = time;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getBaiduLatitude() {
|
|
||||||
return baiduLatitude;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBaiduLatitude(double baiduLatitude) {
|
|
||||||
this.baiduLatitude = baiduLatitude;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getBaiduLongitude() {
|
|
||||||
return baiduLongitude;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBaiduLongitude(double baiduLongitude) {
|
|
||||||
this.baiduLongitude = baiduLongitude;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getAltitude() {
|
|
||||||
return altitude;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAltitude(double altitude) {
|
|
||||||
this.altitude = altitude;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getSpeed() {
|
|
||||||
return speed;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSpeed(double speed) {
|
|
||||||
this.speed = speed;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getBearing() {
|
|
||||||
return bearing;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBearing(double bearing) {
|
|
||||||
this.bearing = bearing;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLocation() {
|
|
||||||
return location;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLocation(String location) {
|
|
||||||
this.location = location;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-31
@@ -1,31 +0,0 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.request.bean.newlj;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName ShipmentStatusBean
|
|
||||||
* @Author john
|
|
||||||
* @Date 2024/11/25 17:16
|
|
||||||
* @Description TODO
|
|
||||||
*/
|
|
||||||
public class ShipmentStatusBean implements Serializable {
|
|
||||||
private String shipmentCode;
|
|
||||||
private String enterpriseCode;
|
|
||||||
|
|
||||||
|
|
||||||
public String getShipmentCode() {
|
|
||||||
return shipmentCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setShipmentCode(String shipmentCode) {
|
|
||||||
this.shipmentCode = shipmentCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEnterpriseCode() {
|
|
||||||
return enterpriseCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEnterpriseCode(String enterpriseCode) {
|
|
||||||
this.enterpriseCode = enterpriseCode;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-118
@@ -1,118 +0,0 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.request.bean.newlj;
|
|
||||||
|
|
||||||
import com.alct.mdp.model.Image;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.GDImage;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName UpimgBean
|
|
||||||
* @Author john
|
|
||||||
* @Date 2024/11/25 14:36
|
|
||||||
* @Description TODO
|
|
||||||
*/
|
|
||||||
public class UpimgBean implements Serializable {
|
|
||||||
|
|
||||||
private String shipmentCode;
|
|
||||||
private String enterpriseCode;
|
|
||||||
private GDImage image;
|
|
||||||
|
|
||||||
public String getShipmentCode() {
|
|
||||||
return shipmentCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setShipmentCode(String shipmentCode) {
|
|
||||||
this.shipmentCode = shipmentCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEnterpriseCode() {
|
|
||||||
return enterpriseCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEnterpriseCode(String enterpriseCode) {
|
|
||||||
this.enterpriseCode = enterpriseCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GDImage getImage() {
|
|
||||||
return image;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setImage(GDImage image) {
|
|
||||||
this.image = image;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class ImageDTO {
|
|
||||||
private String fileName;
|
|
||||||
private String fileExt;
|
|
||||||
private double baiduLongitude;
|
|
||||||
private double baiduLatitude;
|
|
||||||
private String location;
|
|
||||||
private String imageTakenDate;
|
|
||||||
private String time;
|
|
||||||
private String fileData;
|
|
||||||
|
|
||||||
public String getFileName() {
|
|
||||||
return fileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFileName(String fileName) {
|
|
||||||
this.fileName = fileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFileExt() {
|
|
||||||
return fileExt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFileExt(String fileExt) {
|
|
||||||
this.fileExt = fileExt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getBaiduLongitude() {
|
|
||||||
return baiduLongitude;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBaiduLongitude(double baiduLongitude) {
|
|
||||||
this.baiduLongitude = baiduLongitude;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getBaiduLatitude() {
|
|
||||||
return baiduLatitude;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBaiduLatitude(double baiduLatitude) {
|
|
||||||
this.baiduLatitude = baiduLatitude;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLocation() {
|
|
||||||
return location;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLocation(String location) {
|
|
||||||
this.location = location;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getImageTakenDate() {
|
|
||||||
return imageTakenDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setImageTakenDate(String imageTakenDate) {
|
|
||||||
this.imageTakenDate = imageTakenDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTime() {
|
|
||||||
return time;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTime(String time) {
|
|
||||||
this.time = time;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFileData() {
|
|
||||||
return fileData;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFileData(String fileData) {
|
|
||||||
this.fileData = fileData;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,23 +4,11 @@ package com.arpa.hndahesudintocctmsdriver.request.net;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.UserBean;
|
import com.arpa.hndahesudintocctmsdriver.bean.UserBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.LoginRegInputBean;
|
import com.arpa.hndahesudintocctmsdriver.request.bean.LoginRegInputBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.InvoiceBean;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.InvoicesBean;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.LjTokenBean;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.PickupBean;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.ShipmentStatusBean;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.UpimgBean;
|
|
||||||
import com.dahe.mylibrary.net.CommonResponseBean;
|
import com.dahe.mylibrary.net.CommonResponseBean;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
import io.reactivex.rxjava3.core.Observable;
|
import io.reactivex.rxjava3.core.Observable;
|
||||||
import retrofit2.Call;
|
|
||||||
import retrofit2.http.Body;
|
import retrofit2.http.Body;
|
||||||
import retrofit2.http.GET;
|
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
import retrofit2.http.PUT;
|
|
||||||
import retrofit2.http.Path;
|
|
||||||
import retrofit2.http.Query;
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -29,7 +17,7 @@ import retrofit2.http.Query;
|
|||||||
|
|
||||||
public interface Api {
|
public interface Api {
|
||||||
|
|
||||||
String BASE_URL = BuildConfig.isTest? "http://api.kehui56.cn/api/v1/":"https://api.kehui56.com/api/v1/";
|
String BASE_URL = BuildConfig.BASE_URL;
|
||||||
|
|
||||||
|
|
||||||
//获取版本
|
//获取版本
|
||||||
@@ -38,128 +26,5 @@ public interface Api {
|
|||||||
// @POST(BASE_URL+"/common/register")
|
// @POST(BASE_URL+"/common/register")
|
||||||
// Observable<CommonResponseBean> log(@Body LoginRegInputBean bean);
|
// Observable<CommonResponseBean> log(@Body LoginRegInputBean bean);
|
||||||
|
|
||||||
@POST(BASE_URL+"openapi/enterprises/login")
|
|
||||||
Observable<CommonResponseBean> getToken(@Body LjTokenBean bean);
|
|
||||||
|
|
||||||
@POST(BASE_URL+"openapi/enterprises/login")
|
|
||||||
Call<HashMap<String, String>> getRefreshToken(@Body LjTokenBean bean);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 刷新token
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@POST(BASE_URL+"openapi/enterprises/refresh-token/{refreshToken}")
|
|
||||||
Observable<CommonResponseBean> refreshToken(@Path("refreshToken") String refreshToken);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运单提货
|
|
||||||
* @param bean
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@POST(BASE_URL+"openapi/shipments/pickup")
|
|
||||||
Observable<CommonResponseBean> pickup(@Body PickupBean bean);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运单卸货
|
|
||||||
* @param bean
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@POST(BASE_URL+"openapi/shipments/unload")
|
|
||||||
Observable<CommonResponseBean> unload(@Body PickupBean bean);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运单签收
|
|
||||||
* @param bean
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@POST(BASE_URL+"openapi/shipments/sign")
|
|
||||||
Observable<CommonResponseBean> sign(@Body PickupBean bean);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运单回单
|
|
||||||
* @param bean
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@POST(BASE_URL+"openapi/shipments/pod")
|
|
||||||
Observable<CommonResponseBean> pod(@Body PickupBean bean);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运单提货照片上传
|
|
||||||
* @param bean
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@POST(BASE_URL+"openapi/shipments/uploadPickupImage")
|
|
||||||
Observable<CommonResponseBean> uploadPickupImage(@Body UpimgBean bean);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运单卸货照片上传
|
|
||||||
* @param bean
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@POST(BASE_URL+"openapi/shipments/uploadUnloadImage")
|
|
||||||
Observable<CommonResponseBean> uploadUnloadImage(@Body UpimgBean bean);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运单回单照片上传
|
|
||||||
* @param bean
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@POST(BASE_URL+"openapi/shipments/uploadPODImage")
|
|
||||||
Observable<CommonResponseBean> uploadPODImage(@Body UpimgBean bean);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 同意发票申请
|
|
||||||
* @param bean
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@PUT(BASE_URL+"openapi/confirmInvoice")
|
|
||||||
Observable<CommonResponseBean> confirmInvoice(@Body InvoiceBean bean);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 待同意发票列表获取
|
|
||||||
* @param enterpriseCodeParam
|
|
||||||
* @param driverIdentification
|
|
||||||
* @param currentPage
|
|
||||||
* @param pageSize
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GET(BASE_URL+"openapi/getInvoices")
|
|
||||||
Observable<CommonResponseBean<InvoicesBean>> getInvoices(@Query("enterpriseCodeParam") String enterpriseCodeParam,
|
|
||||||
@Query("driverIdentification") String driverIdentification,
|
|
||||||
@Query("currentPage") int currentPage,
|
|
||||||
@Query("pageSize") int pageSize);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取运单状态
|
|
||||||
* @param bean
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@POST(BASE_URL+"/openapi/getShipmentStatus")
|
|
||||||
Observable<CommonResponseBean> getShipmentStatus(@Body ShipmentStatusBean bean);
|
|
||||||
|
|
||||||
@POST(BASE_URL+"/openapi/shipments/getPODImageNames")
|
|
||||||
Observable<CommonResponseBean> getPODImageNames(@Body ShipmentStatusBean bean);
|
|
||||||
|
|
||||||
|
|
||||||
@GET(BASE_URL+"/openapi/drivers")
|
|
||||||
Observable<CommonResponseBean> searchDriver(@Query("identityNo") String identityNo);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 司机车辆绑定关系
|
|
||||||
* @param identityNo
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GET(BASE_URL+"openapi/drivers/{identityNo}/trucks")
|
|
||||||
Observable<CommonResponseBean> trucks(@Path("identityNo") String identityNo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,114 +0,0 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.request.net
|
|
||||||
|
|
||||||
import okhttp3.Interceptor
|
|
||||||
import okhttp3.Request
|
|
||||||
import okio.IOException
|
|
||||||
import retrofit2.Response
|
|
||||||
import java.util.concurrent.atomic.AtomicBoolean
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName ApiInterceptor
|
|
||||||
* @Author john
|
|
||||||
* @Date 2024/11/29 17:05
|
|
||||||
* @Description TODO
|
|
||||||
*/
|
|
||||||
class ApiInterceptor : Interceptor {
|
|
||||||
|
|
||||||
// 需要验证token的接口的路径集合
|
|
||||||
// private val checkTokenInterface = arrayListOf(
|
|
||||||
// "/example/user/info,
|
|
||||||
// "/example/user/info/edit"
|
|
||||||
// )
|
|
||||||
|
|
||||||
// 是否正在刷新token
|
|
||||||
// 使用AtomicBoolean,确保多线程中获取的值一致
|
|
||||||
// private var refreshingToken = AtomicBoolean(false)
|
|
||||||
//
|
|
||||||
// private val authHeaderKey = "token-key"
|
|
||||||
//
|
|
||||||
// // 当前token
|
|
||||||
// private var currentToken = "tokenValue"
|
|
||||||
|
|
||||||
// override fun intercept(chain: Interceptor.Chain): Response {
|
|
||||||
// 根据接口路径判断是否需要验证token
|
|
||||||
// val checkToken = checkTokenInterface.contains(chain.request().url.encodedPath)
|
|
||||||
// // 需要验证token则添加请求头,不需要则保持原样
|
|
||||||
// var request = if (checkToken) {
|
|
||||||
// chain.request().newBuilder()
|
|
||||||
// .addHeader(authHeaderKey, currentToken)
|
|
||||||
// .build()
|
|
||||||
// } else {
|
|
||||||
// chain.request()
|
|
||||||
// }
|
|
||||||
// // 获取响应
|
|
||||||
// var response = chain.proceed(request)
|
|
||||||
// if (checkToken) {
|
|
||||||
// // 需要验证token,处理响应,判断token是否过期
|
|
||||||
// response.body?.let { responseBody ->
|
|
||||||
// try {
|
|
||||||
// if (判断token过期的条件) {
|
|
||||||
// runBlocking {
|
|
||||||
// // 请求头中的token与currentToken仍然一样则需要刷新token
|
|
||||||
// // 确保多线程中不会重复刷新
|
|
||||||
// if (request.header(authHeaderKey) == currentToken){
|
|
||||||
// // 标记为正在刷新token
|
|
||||||
// if (refreshingToken.compareAndSet(false, true)) {
|
|
||||||
// refreshToken(chain).takeIf { it.isNotEmpty() && it.isNotBlank() }?.let { newToken ->
|
|
||||||
// // 保存newToken
|
|
||||||
// currentToken = newToken
|
|
||||||
// }
|
|
||||||
// // 标记为刷新token已结束
|
|
||||||
// refreshingToken.set(false)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// // async{}.await()会等待方法块内的代码执行完毕。
|
|
||||||
// // 等到refreshingToken为false时才会执行后续代码。
|
|
||||||
// if (async { stopRefreshingToken() }.await()) {
|
|
||||||
// // 携带newToken执行原请求获取响应
|
|
||||||
// response = chain.proceed(chain.request().newBuilder()
|
|
||||||
// .addHeader(authHeaderKey, currentToken)
|
|
||||||
// .build())
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// } catch (e: Exception) {
|
|
||||||
// e.printStackTrace()
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// // 返回最终的响应结果。
|
|
||||||
// // 刷新token也可能失败,此时返回原响应,可以让用户重新登录。
|
|
||||||
// return response
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// private fun refreshToken(chain: Interceptor.Chain): String {
|
|
||||||
// // 创建刷新token的请求
|
|
||||||
// val refreshTokenRequest = Request.Builder()
|
|
||||||
// .url("refresh token url")
|
|
||||||
// .addHeader(authHeaderKey, currentToken)
|
|
||||||
// .get()
|
|
||||||
// .build()
|
|
||||||
// return try {
|
|
||||||
// // 获取响应并解析获得新token
|
|
||||||
// val refreshTokenResponse = chain.proceed(refreshTokenRequest)
|
|
||||||
// refreshTokenResponse.token
|
|
||||||
// } catch (e: IOException) {
|
|
||||||
// // 失败时返回空字符串
|
|
||||||
// ""
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// private suspend fun stopRefreshingToken(): Boolean {
|
|
||||||
// return if (refreshingToken.get()) {
|
|
||||||
// // 仍在刷新token中,延迟1秒后再次执行此方法
|
|
||||||
// delay(1000)
|
|
||||||
// stopRefreshingToken()
|
|
||||||
// } else {
|
|
||||||
// true
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
override fun intercept(chain: Interceptor.Chain): okhttp3.Response {
|
|
||||||
TODO("Not yet implemented")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ public class BaseObserver<T> implements Observer<CommonResponseBean<T>> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(CommonResponseBean<T> tCommonResponseBean) {
|
public void onNext(CommonResponseBean<T> tCommonResponseBean) {
|
||||||
if ("0".equals(tCommonResponseBean.getCode())) {
|
if (200==tCommonResponseBean.getCode()) {
|
||||||
mRxHttpCallBack.onSuccess(tCommonResponseBean);
|
mRxHttpCallBack.onSuccess(tCommonResponseBean);
|
||||||
} else {
|
} else {
|
||||||
mRxHttpCallBack.onCodeError(mContext, tCommonResponseBean);
|
mRxHttpCallBack.onCodeError(mContext, tCommonResponseBean);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.arpa.hndahesudintocctmsdriver.request.net;
|
|||||||
|
|
||||||
|
|
||||||
import com.dahe.mylibrary.CommonBaseLibrary;
|
import com.dahe.mylibrary.CommonBaseLibrary;
|
||||||
|
import com.dahe.mylibrary.net.JsonInterceptor;
|
||||||
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
|||||||
@@ -1,119 +0,0 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.request.net;
|
|
||||||
|
|
||||||
import static com.dahe.mylibrary.utils.BaseSPUtils.NEW_LJ_TOKEN;
|
|
||||||
|
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.util.Log;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.App;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.constant.NewLJConstant;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.LjTokenBean;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.NewLJUtils;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
|
||||||
import com.dahe.mylibrary.CommonBaseLibrary;
|
|
||||||
import com.dahe.mylibrary.net.CommonResponseBean;
|
|
||||||
import com.dahe.mylibrary.net.ResultException;
|
|
||||||
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.nio.charset.Charset;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
|
||||||
|
|
||||||
import io.reactivex.rxjava3.core.Observable;
|
|
||||||
import kotlin.jvm.Synchronized;
|
|
||||||
import okhttp3.Interceptor;
|
|
||||||
import okhttp3.MediaType;
|
|
||||||
import okhttp3.OkHttpClient;
|
|
||||||
import okhttp3.Request;
|
|
||||||
import okhttp3.Response;
|
|
||||||
import okhttp3.ResponseBody;
|
|
||||||
import okio.Buffer;
|
|
||||||
import okio.BufferedSource;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* json的Interceptor
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class JsonInterceptor implements Interceptor {
|
|
||||||
private static final String TAG = "JsonInterceptor";
|
|
||||||
|
|
||||||
public JsonInterceptor() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// 使用AtomicBoolean,确保多线程中获取的值一致
|
|
||||||
private AtomicBoolean refreshingToken = new AtomicBoolean(false);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Response intercept(Chain chain) throws IOException {
|
|
||||||
Request request = chain.request();
|
|
||||||
Response response = chain.proceed(request);
|
|
||||||
ResponseBody responseBody = response.body();
|
|
||||||
//为了不消耗buffer,我们这里使用source先获得buffer对象,然后clone()后使用
|
|
||||||
BufferedSource source = responseBody.source();
|
|
||||||
source.request(Long.MAX_VALUE); // Buffer the entire body.
|
|
||||||
//获得返回的数据
|
|
||||||
Buffer buffer = source.buffer();
|
|
||||||
//使用前clone()下,避免直接消耗
|
|
||||||
String responseBodyStr = buffer.clone().readString(Charset.forName("UTF-8"));
|
|
||||||
Log.i(TAG, "result-body= " + responseBodyStr);
|
|
||||||
try {
|
|
||||||
|
|
||||||
JSONObject jsonObject = new JSONObject(responseBodyStr);
|
|
||||||
String str = jsonObject.optString("data");
|
|
||||||
int code = jsonObject.optInt("code");
|
|
||||||
if (401 == code) {
|
|
||||||
refreshToken();
|
|
||||||
// if (execute.body() != null) {
|
|
||||||
// String refreshToken = execute.body().get("token");
|
|
||||||
// SPUtils.put(App.getApp(), NEW_LJ_TOKEN, refreshToken);
|
|
||||||
// }
|
|
||||||
response.close();
|
|
||||||
try {
|
|
||||||
return chain.proceed(request);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (-1 == code) {
|
|
||||||
jsonObject.put("data", new JSONObject());
|
|
||||||
throw new ResultException();
|
|
||||||
} else {
|
|
||||||
if (TextUtils.isEmpty(str)) {
|
|
||||||
jsonObject.put("data", new JSONObject());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String data = jsonObject.toString();
|
|
||||||
responseBody = ResponseBody.create(MediaType.parse("application/json; charset=utf-8"), data);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
response = response.newBuilder().body(responseBody).build();
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Synchronized
|
|
||||||
private void refreshToken() throws IOException {
|
|
||||||
Api api = CommonBaseLibrary.getRetrofit().newBuilder()
|
|
||||||
.client(new OkHttpClient.Builder()
|
|
||||||
.connectTimeout(30, TimeUnit.SECONDS)
|
|
||||||
.readTimeout(30, TimeUnit.SECONDS)
|
|
||||||
.writeTimeout(30, TimeUnit.SECONDS)
|
|
||||||
.build())
|
|
||||||
// .addNetworkInterceptor(new TokenInterceptor())
|
|
||||||
.build().create(Api.class);
|
|
||||||
LjTokenBean ljTokenBean = new LjTokenBean();
|
|
||||||
ljTokenBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
|
||||||
ljTokenBean.setEnterpriseIdentity(NewLJConstant.ENTER_PRISE_IDENTITY);
|
|
||||||
ljTokenBean.setEnterpriseKey(NewLJConstant.ENTER_PRISE_KEY);
|
|
||||||
retrofit2.Response<HashMap<String, String>> execute = api.getRefreshToken(ljTokenBean).execute();
|
|
||||||
if (execute.body() != null) {
|
|
||||||
String refreshToken = execute.body().get("token");
|
|
||||||
SPUtils.put(App.getApp(), NEW_LJ_TOKEN, refreshToken);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+2
-5
@@ -1,7 +1,5 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.request.net;
|
package com.arpa.hndahesudintocctmsdriver.request.net;
|
||||||
|
|
||||||
import static com.dahe.mylibrary.utils.BaseSPUtils.NEW_LJ_TOKEN;
|
|
||||||
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
@@ -29,10 +27,9 @@ public class RequestHeadInterceptor implements Interceptor {
|
|||||||
@Override
|
@Override
|
||||||
public Response intercept(Chain chain) throws IOException {
|
public Response intercept(Chain chain) throws IOException {
|
||||||
Request.Builder builder = chain.request().newBuilder();
|
Request.Builder builder = chain.request().newBuilder();
|
||||||
String token = SPUtils.get(App.getApp(), NEW_LJ_TOKEN, "").toString();
|
if (!TextUtils.isEmpty(SPUtil.getSP(App.getApp(), LoginActivity.USER,LoginActivity.USER_TOKEN))) {
|
||||||
if (!TextUtils.isEmpty(token)) {
|
|
||||||
// builder.addHeader("Authorization", SPUtils.getUserInfo(App.getApp()).getToken());
|
// builder.addHeader("Authorization", SPUtils.getUserInfo(App.getApp()).getToken());
|
||||||
builder.addHeader("token", token);
|
builder.addHeader("Authorization", SPUtil.getSP(App.getApp(), LoginActivity.USER,LoginActivity.USER_TOKEN));
|
||||||
}
|
}
|
||||||
Request request = builder
|
Request request = builder
|
||||||
.addHeader("versionCode", AppUtils.getAppVersionCode() + "")
|
.addHeader("versionCode", AppUtils.getAppVersionCode() + "")
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import android.view.Window;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.UiAuxiliary;
|
import com.arpa.hndahesudintocctmsdriver.ui.UiAuxiliary;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.NewLJUtils;
|
|
||||||
import com.dahe.mylibrary.net.CommonResponseBean;
|
import com.dahe.mylibrary.net.CommonResponseBean;
|
||||||
import com.dahe.mylibrary.net.ResultException;
|
import com.dahe.mylibrary.net.ResultException;
|
||||||
import com.dahe.mylibrary.utils.ToastUtils;
|
import com.dahe.mylibrary.utils.ToastUtils;
|
||||||
@@ -87,15 +86,14 @@ public abstract class RxHttpCallBack<T> {
|
|||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
|
|
||||||
}
|
}
|
||||||
if ("401".equals(t.getCode())) {
|
if (t.getCode() == 401) {
|
||||||
// NewLJUtils.getInstance().refreshToken(mContext);
|
UiAuxiliary.delLogin(mContext);
|
||||||
// UiAuxiliary.delLogin(mContext);
|
Intent intent = new Intent(mContext, MainActivity.class);
|
||||||
// Intent intent = new Intent(mContext, MainActivity.class);
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||||
// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
mContext.startActivity(intent);
|
||||||
// mContext.startActivity(intent);
|
ToastUtils.showToast(mContext,"您的账号再异地登录,请重新登录");
|
||||||
// ToastUtils.showToast(mContext,"您的账号再异地登录,请重新登录");
|
|
||||||
}else{
|
}else{
|
||||||
// ToastUtils.showToast(mContext,t.getMessage());
|
ToastUtils.showToast(mContext,t.getMsg());
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (t.getMessage().getMsg_code() == 100 && SPUtils.hasUserInfo(mContext)) {
|
// if (t.getMessage().getMsg_code() == 100 && SPUtils.hasUserInfo(mContext)) {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class UiAuxiliary {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void delLogin(Context con){
|
public static void delLogin(Context con){
|
||||||
// JPushInterface.deleteAlias(con,0);
|
JPushInterface.deleteAlias(con,0);
|
||||||
SPUtils.remove(con,"curWaybillId");
|
SPUtils.remove(con,"curWaybillId");
|
||||||
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_TOKEN,"");
|
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_TOKEN,"");
|
||||||
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_UNAME,"");
|
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_UNAME,"");
|
||||||
|
|||||||
+1
-16
@@ -1220,29 +1220,14 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
|||||||
iib.setDriverLicense(str1);
|
iib.setDriverLicense(str1);
|
||||||
iib.setDriverLicenseBackPhoto(backId);
|
iib.setDriverLicenseBackPhoto(backId);
|
||||||
iib.setDriverLicensePhoto(fontId);
|
iib.setDriverLicensePhoto(fontId);
|
||||||
|
iib.setEndTime("长期".equals(odl.getData().getEndDate()) ? "2999-12-31" : odl.getData().getEndDate());
|
||||||
if ("长期".equals(odl.getData().getEndDate())){
|
|
||||||
iib.setEndTime("2999-12-31");
|
|
||||||
}else if (TimeUtil.isValidDate(odl.getData().getEndDate())){//非yyyy-MM-dd格式的日期传""
|
|
||||||
iib.setEndTime(odl.getData().getEndDate());
|
|
||||||
}else{
|
|
||||||
iib.setEndTime("");
|
|
||||||
}
|
|
||||||
// iib.setEndTime("长期".equals(odl.getData().getEndDate()) ? "2999-12-31" : odl.getData().getEndDate());
|
|
||||||
iib.setFirstTime(odl.getData().getFirstGetDocDate());
|
iib.setFirstTime(odl.getData().getFirstGetDocDate());
|
||||||
|
|
||||||
|
|
||||||
// iib.setName(odl.getData().getName());
|
// iib.setName(odl.getData().getName());
|
||||||
iib.setOrganizationName(odl.getData().getIssuingAuthority());
|
iib.setOrganizationName(odl.getData().getIssuingAuthority());
|
||||||
iib.setAddress(odl.getData().getAddress());
|
iib.setAddress(odl.getData().getAddress());
|
||||||
|
|
||||||
if (TimeUtil.isValidDate(odl.getData().getBeginDate())){//非yyyy-MM-dd格式的日期传""
|
|
||||||
iib.setStartTime(odl.getData().getBeginDate());
|
iib.setStartTime(odl.getData().getBeginDate());
|
||||||
}else{
|
|
||||||
iib.setStartTime("");
|
|
||||||
}
|
|
||||||
|
|
||||||
// iib.setStartTime(odl.getData().getBeginDate());
|
|
||||||
|
|
||||||
iib.setSex(odl.getData().getSex());
|
iib.setSex(odl.getData().getSex());
|
||||||
iib.setBirthday(odl.getData().getBirthday());
|
iib.setBirthday(odl.getData().getBirthday());
|
||||||
|
|||||||
@@ -8,14 +8,11 @@ import android.widget.Button;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.R;
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.PersonEvent;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
||||||
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.dahe.mylibrary.utils.ActivityUtils;
|
import com.dahe.mylibrary.utils.ActivityUtils;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName FaceSuccActivity
|
* @ClassName FaceSuccActivity
|
||||||
* @Author john
|
* @Author john
|
||||||
@@ -34,17 +31,15 @@ public class FaceSuccActivity extends BaseAppCompatActivity {
|
|||||||
Button btnHome = findViewById(R.id.btnHome);
|
Button btnHome = findViewById(R.id.btnHome);
|
||||||
Button btnAddCar = findViewById(R.id.btnAddCar);
|
Button btnAddCar = findViewById(R.id.btnAddCar);
|
||||||
boolean isGoCar = getIntent().getBooleanExtra("isGoCar", false);
|
boolean isGoCar = getIntent().getBooleanExtra("isGoCar", false);
|
||||||
if (isGoCar) {
|
if (isGoCar){
|
||||||
btnHome.setText("返回首页");
|
btnHome.setText("返回首页");
|
||||||
btnAddCar.setVisibility(View.VISIBLE);
|
btnAddCar.setVisibility(View.VISIBLE);
|
||||||
} else {
|
}else{
|
||||||
btnHome.setText("返回");
|
btnHome.setText("返回");
|
||||||
btnAddCar.setVisibility(View.GONE);
|
btnAddCar.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
btnHome.setOnClickListener(v -> {
|
btnHome.setOnClickListener(v -> finish());
|
||||||
finish();
|
|
||||||
});
|
|
||||||
btnAddCar.setOnClickListener(v -> {
|
btnAddCar.setOnClickListener(v -> {
|
||||||
Intent in = new Intent(con, CertificatesActivity.class);
|
Intent in = new Intent(con, CertificatesActivity.class);
|
||||||
in.putExtra("index", 2);
|
in.putExtra("index", 2);
|
||||||
@@ -53,10 +48,4 @@ public class FaceSuccActivity extends BaseAppCompatActivity {
|
|||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onPause() {
|
|
||||||
super.onPause();
|
|
||||||
EventBus.getDefault().post(new PersonEvent("刷脸成功"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-28
@@ -1,7 +1,5 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.ui.auth;
|
package com.arpa.hndahesudintocctmsdriver.ui.auth;
|
||||||
|
|
||||||
import static com.sdk.base.framework.utils.app.AppUtils.getPackageName;
|
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
@@ -77,15 +75,15 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
|||||||
super.msgMethod(m);
|
super.msgMethod(m);
|
||||||
switch (m.what) {
|
switch (m.what) {
|
||||||
case RequsetCodeConstants.SUCCESS:
|
case RequsetCodeConstants.SUCCESS:
|
||||||
if (CacheGroup.cacheList.get("userdata2") != null) {
|
if (CacheGroup.cacheList.get("userdata") != null) {
|
||||||
ub = gson.fromJson(CacheGroup.cacheList.get("userdata2"), UserBean.class);
|
ub = gson.fromJson(CacheGroup.cacheList.get("userdata"), UserBean.class);
|
||||||
if (ub.getCode() == 200) {
|
if (ub.getCode() == 200) {
|
||||||
initView(ub);
|
initView(ub);
|
||||||
SPUtil.insSP(con, "data", "userdata", CacheGroup.cacheList.get("userdata2"));
|
SPUtil.insSP(con, "data", "userdata", CacheGroup.cacheList.get("userdata"));
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove("userdata2");
|
CacheGroup.cacheList.remove("userdata");
|
||||||
}
|
}
|
||||||
if (CacheGroup.cacheList.get("upload") != null) {
|
if (CacheGroup.cacheList.get("upload") != null) {
|
||||||
upb = gson.fromJson(CacheGroup.cacheList.get("upload"), UploadBean.class);
|
upb = gson.fromJson(CacheGroup.cacheList.get("upload"), UploadBean.class);
|
||||||
@@ -210,22 +208,7 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
|||||||
});
|
});
|
||||||
//头像
|
//头像
|
||||||
up_img.setOnClickListener(v -> {
|
up_img.setOnClickListener(v -> {
|
||||||
PermissionUtils.Companion.getInstance().showPermissionMessage(this, "拍摄,媒体查询权限使用说明", "用于拍照或者选择图片用于上传头像功能",
|
|
||||||
new String[]{Manifest.permission.READ_EXTERNAL_STORAGE,Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.CAMERA},
|
|
||||||
(allGranted, grantedList, deniedList) -> {
|
|
||||||
if (allGranted) {
|
|
||||||
gia.showPopueWindow(this);
|
gia.showPopueWindow(this);
|
||||||
} else {
|
|
||||||
new MessageUtils().showSimCenPop(con, "缺少拍摄,媒体查询权限,将无法为您提供服务,去开启!", "取消", "确认", () -> {
|
|
||||||
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
|
||||||
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
|
||||||
intent.setData(uri);
|
|
||||||
startActivity(intent);
|
|
||||||
});
|
|
||||||
// Toast.makeText(act.getBaseContext(), "请先开启定位权限", Toast.LENGTH_LONG).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
up_head.setOnClickListener(v -> {
|
up_head.setOnClickListener(v -> {
|
||||||
if (ub.getData().getHeadportraitUrl() != null && !ub.getData().getHeadportraitUrl().equals("")) {
|
if (ub.getData().getHeadportraitUrl() != null && !ub.getData().getHeadportraitUrl().equals("")) {
|
||||||
@@ -239,15 +222,10 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
|||||||
});
|
});
|
||||||
hyr = new HuoYuanRequset(con, hd);
|
hyr = new HuoYuanRequset(con, hd);
|
||||||
ur = new UserRequset(con, hd);
|
ur = new UserRequset(con, hd);
|
||||||
|
ur.User();
|
||||||
EventBus.getDefault().register(this);
|
EventBus.getDefault().register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onStart() {
|
|
||||||
super.onStart();
|
|
||||||
ur.User2();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
@@ -271,7 +249,7 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
|||||||
public void personResult(PersonEvent home) {
|
public void personResult(PersonEvent home) {
|
||||||
Log.e("-res-", home.getMessage());
|
Log.e("-res-", home.getMessage());
|
||||||
if (ur != null) {
|
if (ur != null) {
|
||||||
ur.User2();
|
ur.User();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -460,7 +460,6 @@ public class HomeFragment extends BaseFragment {
|
|||||||
});
|
});
|
||||||
btn_update.setOnClickListener(v -> {
|
btn_update.setOnClickListener(v -> {
|
||||||
getRequest();
|
getRequest();
|
||||||
refreshWaybills();
|
|
||||||
});
|
});
|
||||||
home_top.setOnClickListener(v -> {
|
home_top.setOnClickListener(v -> {
|
||||||
if (!UiAuxiliary.isLogin(con)) {
|
if (!UiAuxiliary.isLogin(con)) {
|
||||||
@@ -521,7 +520,6 @@ public class HomeFragment extends BaseFragment {
|
|||||||
Log.e("下拉刷新", "pps");
|
Log.e("下拉刷新", "pps");
|
||||||
keys = true;
|
keys = true;
|
||||||
getRequest();
|
getRequest();
|
||||||
refreshWaybills();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -730,7 +728,6 @@ public class HomeFragment extends BaseFragment {
|
|||||||
if (zStatus == 0) {//未装货
|
if (zStatus == 0) {//未装货
|
||||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||||
in.putExtra("type", 0);
|
in.putExtra("type", 0);
|
||||||
in.putExtra("reportAlct", data.getReportAlct());
|
|
||||||
in.putExtra("wid", zData.getId() + "");
|
in.putExtra("wid", zData.getId() + "");
|
||||||
in.putExtra("sob", gson.toJson(sob));
|
in.putExtra("sob", gson.toJson(sob));
|
||||||
in.putExtra("keys", true);
|
in.putExtra("keys", true);
|
||||||
@@ -738,7 +735,6 @@ public class HomeFragment extends BaseFragment {
|
|||||||
} else if (zStatus == 1 && xStatus == 4) {//已装货未上传回单
|
} else if (zStatus == 1 && xStatus == 4) {//已装货未上传回单
|
||||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||||
in.putExtra("type", 2);
|
in.putExtra("type", 2);
|
||||||
in.putExtra("reportAlct", data.getReportAlct());
|
|
||||||
in.putExtra("wid", zData.getId() + "");
|
in.putExtra("wid", zData.getId() + "");
|
||||||
in.putExtra("h_type", 0);
|
in.putExtra("h_type", 0);
|
||||||
in.putExtra("sob", gson.toJson(sob));
|
in.putExtra("sob", gson.toJson(sob));
|
||||||
@@ -748,7 +744,6 @@ public class HomeFragment extends BaseFragment {
|
|||||||
if (dis > 5) {//大于五分钟可以接单
|
if (dis > 5) {//大于五分钟可以接单
|
||||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||||
in.putExtra("type", 1);
|
in.putExtra("type", 1);
|
||||||
in.putExtra("reportAlct", data.getReportAlct());
|
|
||||||
in.putExtra("wid", xData.getId() + "");
|
in.putExtra("wid", xData.getId() + "");
|
||||||
in.putExtra("sob", gson.toJson(sob));
|
in.putExtra("sob", gson.toJson(sob));
|
||||||
in.putExtra("keys", true);
|
in.putExtra("keys", true);
|
||||||
@@ -760,7 +755,6 @@ public class HomeFragment extends BaseFragment {
|
|||||||
} else if (zStatus == 3 && xStatus == 2) {//已卸货,未上传卸货回单
|
} else if (zStatus == 3 && xStatus == 2) {//已卸货,未上传卸货回单
|
||||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||||
in.putExtra("type", 2);
|
in.putExtra("type", 2);
|
||||||
in.putExtra("reportAlct", data.getReportAlct());
|
|
||||||
in.putExtra("wid", xData.getId() + "");
|
in.putExtra("wid", xData.getId() + "");
|
||||||
in.putExtra("h_type", 1);
|
in.putExtra("h_type", 1);
|
||||||
in.putExtra("sob", gson.toJson(sob));
|
in.putExtra("sob", gson.toJson(sob));
|
||||||
@@ -790,7 +784,6 @@ public class HomeFragment extends BaseFragment {
|
|||||||
*/
|
*/
|
||||||
public void initMap() {
|
public void initMap() {
|
||||||
getRequest();
|
getRequest();
|
||||||
refreshWaybills();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private CustomDialog customDialog;
|
private CustomDialog customDialog;
|
||||||
@@ -803,18 +796,18 @@ public class HomeFragment extends BaseFragment {
|
|||||||
// customDialog=new CustomDialog(con,"加载中...");
|
// customDialog=new CustomDialog(con,"加载中...");
|
||||||
// customDialog.show();
|
// customDialog.show();
|
||||||
ur.upApp();
|
ur.upApp();
|
||||||
// hyr.getHuoYuan(1, 100);
|
hyr.getHuoYuan(1, 100);
|
||||||
ur.getImage(1);
|
ur.getImage(1);
|
||||||
WalletRequest qr = new WalletRequest(con, hd);
|
WalletRequest qr = new WalletRequest(con, hd);
|
||||||
|
|
||||||
if (UiAuxiliary.isLogin(con)) {
|
if (UiAuxiliary.isLogin(con)) {
|
||||||
// int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
||||||
ur.User();
|
ur.User();
|
||||||
// if (!OneDayShowUtils.getInstance().todayIsShow(con)) {
|
// if (!OneDayShowUtils.getInstance().todayIsShow(con)) {
|
||||||
// qr.getBankCardList();
|
// qr.getBankCardList();
|
||||||
// }
|
// }
|
||||||
ur.getDriverExpire();
|
ur.getDriverExpire();
|
||||||
// hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
||||||
// hyr.startOrder(0);
|
// hyr.startOrder(0);
|
||||||
//获取权限 应用市场审核不通过
|
//获取权限 应用市场审核不通过
|
||||||
ur.driverAuthData();
|
ur.driverAuthData();
|
||||||
@@ -1184,7 +1177,6 @@ public class HomeFragment extends BaseFragment {
|
|||||||
.permissions(Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
.permissions(Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||||
Manifest.permission.ACCESS_FINE_LOCATION,
|
Manifest.permission.ACCESS_FINE_LOCATION,
|
||||||
Manifest.permission.ACCESS_BACKGROUND_LOCATION,
|
|
||||||
Manifest.permission.CAMERA,
|
Manifest.permission.CAMERA,
|
||||||
Manifest.permission.ACCESS_COARSE_LOCATION)
|
Manifest.permission.ACCESS_COARSE_LOCATION)
|
||||||
.request((allGranted, grantedList, deniedList) -> {
|
.request((allGranted, grantedList, deniedList) -> {
|
||||||
@@ -1308,29 +1300,26 @@ public class HomeFragment extends BaseFragment {
|
|||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
// ToastUtils.showToast(con,"onstart");
|
|
||||||
// refreshLayout.autoRefresh();
|
|
||||||
refreshWaybills();
|
refreshWaybills();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void refreshWaybills() {
|
private void refreshWaybills() {
|
||||||
hyr.getHuoYuan(1, 100);
|
// if (UiAuxiliary.isLogin(con)) {
|
||||||
if (UiAuxiliary.isLogin(con)) {
|
// int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
||||||
int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
// hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
||||||
hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
// }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void processResult(HomeWaybillEvent home) {
|
public void processResult(HomeWaybillEvent home) {
|
||||||
// if (home.getMessage() == 1) {
|
if (home.getMessage() == 1) {
|
||||||
// int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
||||||
// hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
||||||
// hyr.getHuoYuan(1, 100);
|
hyr.getHuoYuan(1, 100);
|
||||||
// } else {
|
} else {
|
||||||
// int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
||||||
// hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-153
@@ -8,7 +8,6 @@ import android.content.Intent;
|
|||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.CountDownTimer;
|
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
@@ -18,7 +17,6 @@ import android.text.TextUtils;
|
|||||||
import android.text.method.HideReturnsTransformationMethod;
|
import android.text.method.HideReturnsTransformationMethod;
|
||||||
import android.text.method.PasswordTransformationMethod;
|
import android.text.method.PasswordTransformationMethod;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
|
||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
@@ -46,15 +44,11 @@ import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.PersonalAuthActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.auth.PersonalAuthActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.img.ImageGetUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.img.ImageGetUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickHelper;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickListener;
|
|
||||||
import com.dahe.mylibrary.utils.ActivityUtils;
|
import com.dahe.mylibrary.utils.ActivityUtils;
|
||||||
import com.dahe.mylibrary.utils.ToastUtils;
|
|
||||||
import com.esign.esignsdk.EsignSdk;
|
import com.esign.esignsdk.EsignSdk;
|
||||||
import com.esign.esignsdk.data.AuthEvent;
|
import com.esign.esignsdk.data.AuthEvent;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
@@ -80,7 +74,6 @@ import com.arpa.hndahesudintocctmsdriver.util.time.Timer;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||||
import com.lxj.xpopup.interfaces.XPopupCallback;
|
|
||||||
import com.permissionx.guolindev.PermissionX;
|
import com.permissionx.guolindev.PermissionX;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
@@ -88,7 +81,6 @@ import org.greenrobot.eventbus.Subscribe;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.TreeMap;
|
|
||||||
|
|
||||||
public class HuoYunDelActivity extends BaseAppCompatActivity {
|
public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||||
|
|
||||||
@@ -102,10 +94,6 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
|||||||
private BasePopupView xp;
|
private BasePopupView xp;
|
||||||
private TextView car;
|
private TextView car;
|
||||||
private String cid;
|
private String cid;
|
||||||
private String selectCarNum = "";
|
|
||||||
|
|
||||||
private String currOutInvoice = "0";
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void msgMethod(Message m) {
|
public void msgMethod(Message m) {
|
||||||
@@ -170,17 +158,13 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
|||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
}
|
}
|
||||||
isRegOk = true;
|
|
||||||
|
|
||||||
Log.e("orderStatus", CacheGroup.cacheList.get("orderStatus"));
|
Log.e("orderStatus", CacheGroup.cacheList.get("orderStatus"));
|
||||||
WaybillStatusBean status = gson.fromJson(CacheGroup.cacheList.get("orderStatus"), WaybillStatusBean.class);
|
WaybillStatusBean status = gson.fromJson(CacheGroup.cacheList.get("orderStatus"), WaybillStatusBean.class);
|
||||||
if (status.getCode() == 200) {
|
if (status.getCode() == 200) {
|
||||||
if (regOkPop != null && regOkPop.isShow()) {
|
|
||||||
regOkPop.dismiss();
|
|
||||||
}
|
|
||||||
if (status.getData() != null) {
|
if (status.getData() != null) {
|
||||||
//执行运单下一步操作
|
//执行运单下一步操作
|
||||||
new XPopup.Builder(con)
|
new XPopup.Builder(con)
|
||||||
|
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||||
.asConfirm("请确认接单", "是否确定承运此运单?",
|
.asConfirm("请确认接单", "是否确定承运此运单?",
|
||||||
"取消", "确认",
|
"取消", "确认",
|
||||||
() -> {
|
() -> {
|
||||||
@@ -201,17 +185,10 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
|||||||
CacheGroup.cacheList.remove("orderStatus");
|
CacheGroup.cacheList.remove("orderStatus");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RequsetCodeConstants.ERROR:
|
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
|
||||||
customDialog.dismiss();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 13:
|
case 13:
|
||||||
int index = Integer.valueOf((String) m.obj);
|
int index = Integer.valueOf((String) m.obj);
|
||||||
Log.e("--选择车辆--", clb.getData().get(index).getCarNumber());
|
Log.e("--选择车辆--", clb.getData().get(index).getCarNumber());
|
||||||
car.setText("选择车辆:" + clb.getData().get(index).getCarNumber());
|
car.setText("选择车辆:" + clb.getData().get(index).getCarNumber());
|
||||||
selectCarNum = clb.getData().get(index).getCarNumber();
|
|
||||||
currOutInvoice = clb.getData().get(index).getOutInvoice();
|
|
||||||
cid = clb.getData().get(index).getCarId();
|
cid = clb.getData().get(index).getCarId();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -338,26 +315,9 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
|||||||
});
|
});
|
||||||
//
|
//
|
||||||
ImageButton xuanze = v.findViewById(R.id.xuanze);
|
ImageButton xuanze = v.findViewById(R.id.xuanze);
|
||||||
|
if (clb != null && clb.getData().size() == 1) {
|
||||||
if (hyd != null && hyd.getData() != null && !TextUtils.isEmpty(hyd.getData().getCarNumber())) {
|
|
||||||
String carNumber = hyd.getData().getCarNumber();
|
|
||||||
if (clb != null && !clb.getData().isEmpty()) {//判断车辆是否需要上传安联
|
|
||||||
for (CarListBean.DataDTO datum : clb.getData()) {
|
|
||||||
if (carNumber.equals(datum.getCarNumber())) {
|
|
||||||
cid = hyd.getData().getCarId();
|
|
||||||
car.setText("选择车辆:" + hyd.getData().getCarNumber());
|
|
||||||
currOutInvoice = datum.getOutInvoice();
|
|
||||||
selectCarNum = hyd.getData().getCarNumber();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (clb != null && clb.getData().size() == 1) {
|
|
||||||
cid = clb.getData().get(0).getCarId();
|
cid = clb.getData().get(0).getCarId();
|
||||||
car.setText("选择车辆:" + clb.getData().get(0).getCarNumber());
|
car.setText("选择车辆:" + clb.getData().get(0).getCarNumber());
|
||||||
currOutInvoice = clb.getData().get(0).getOutInvoice();
|
|
||||||
selectCarNum = clb.getData().get(0).getCarNumber();
|
|
||||||
}
|
}
|
||||||
xuanze.setOnClickListener(v1 -> {
|
xuanze.setOnClickListener(v1 -> {
|
||||||
if (clb.getData().size() > 0) {
|
if (clb.getData().size() > 0) {
|
||||||
@@ -370,7 +330,7 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
|||||||
});
|
});
|
||||||
//
|
//
|
||||||
Button confirm_btn = v.findViewById(R.id.confirm_btn);
|
Button confirm_btn = v.findViewById(R.id.confirm_btn);
|
||||||
confirm_btn.setOnClickListener(new OnLimitClickHelper(view -> {
|
confirm_btn.setOnClickListener(v13 -> {
|
||||||
if ("1".equals(UserParts.getUser(con).getData().getRealAuthentication())) {
|
if ("1".equals(UserParts.getUser(con).getData().getRealAuthentication())) {
|
||||||
if (cid != null) {
|
if (cid != null) {
|
||||||
// if (fpKey){
|
// if (fpKey){
|
||||||
@@ -391,7 +351,7 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
|||||||
Intent in = new Intent(con, PersonalAuthActivity.class);
|
Intent in = new Intent(con, PersonalAuthActivity.class);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
}
|
}
|
||||||
}));
|
});
|
||||||
BaseRecyclerView zhuang_data = v.findViewById(R.id.zhuang_rv1);
|
BaseRecyclerView zhuang_data = v.findViewById(R.id.zhuang_rv1);
|
||||||
BaseRecyclerView xie_data = v.findViewById(R.id.zhuang_rv2);
|
BaseRecyclerView xie_data = v.findViewById(R.id.zhuang_rv2);
|
||||||
List<Object> listz = new ArrayList<>();
|
List<Object> listz = new ArrayList<>();
|
||||||
@@ -448,7 +408,6 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
|||||||
|
|
||||||
UiAuxiliary.homeRequest("接单");
|
UiAuxiliary.homeRequest("接单");
|
||||||
Intent in = new Intent(con, StartYunDanActivity.class);
|
Intent in = new Intent(con, StartYunDanActivity.class);
|
||||||
in.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
|
||||||
in.putExtra("id", "0");
|
in.putExtra("id", "0");
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
finish();
|
finish();
|
||||||
@@ -526,8 +485,6 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
|||||||
* 先判断安联用户信息验证,随后接单
|
* 先判断安联用户信息验证,随后接单
|
||||||
*/
|
*/
|
||||||
private void reOrder() {
|
private void reOrder() {
|
||||||
//开始倒计时
|
|
||||||
startCountDown();
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
try {
|
try {
|
||||||
PermissionX.init(this)
|
PermissionX.init(this)
|
||||||
@@ -539,13 +496,8 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
|||||||
if (allGranted) {
|
if (allGranted) {
|
||||||
customDialog = new CustomDialog(con, "正在接单...");
|
customDialog = new CustomDialog(con, "正在接单...");
|
||||||
customDialog.show();
|
customDialog.show();
|
||||||
if ("0".equals(currOutInvoice)) {
|
|
||||||
//验证安联用户是否通过
|
//验证安联用户是否通过
|
||||||
ALProcess.verification(con, selectCarNum, hd);
|
ALProcess.verification(con, hd);
|
||||||
} else {
|
|
||||||
hyr.getOrderStatus(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
boolean accessCoarseLocation = deniedList.contains("android.permission.ACCESS_FINE_LOCATION");
|
boolean accessCoarseLocation = deniedList.contains("android.permission.ACCESS_FINE_LOCATION");
|
||||||
boolean contains = deniedList.contains("android.permission.WRITE_EXTERNAL_STORAGE");
|
boolean contains = deniedList.contains("android.permission.WRITE_EXTERNAL_STORAGE");
|
||||||
@@ -565,14 +517,14 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
|||||||
customDialog = new CustomDialog(con, "正在接单...");
|
customDialog = new CustomDialog(con, "正在接单...");
|
||||||
customDialog.show();
|
customDialog.show();
|
||||||
//验证安联用户是否通过
|
//验证安联用户是否通过
|
||||||
ALProcess.verification(con, selectCarNum, hd);
|
ALProcess.verification(con, hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
customDialog = new CustomDialog(con, "正在接单...");
|
customDialog = new CustomDialog(con, "正在接单...");
|
||||||
customDialog.show();
|
customDialog.show();
|
||||||
//验证安联用户是否通过
|
//验证安联用户是否通过
|
||||||
ALProcess.verification(con, selectCarNum, hd);
|
ALProcess.verification(con, hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -582,102 +534,4 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
|||||||
// ALProcess.verification(con, hd);
|
// ALProcess.verification(con, hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
EventBus.getDefault().unregister(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onStop() {
|
|
||||||
super.onStop();
|
|
||||||
// 取消倒计时,防止内存泄漏
|
|
||||||
if (countDownTimer != null) {
|
|
||||||
countDownTimer.cancel();
|
|
||||||
}
|
|
||||||
if (regOkPop != null && regOkPop.isShow()) {
|
|
||||||
regOkPop.dismiss();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private CountDownTimer countDownTimer;
|
|
||||||
private boolean isRegOk = false;
|
|
||||||
private BasePopupView regOkPop;
|
|
||||||
private void startCountDown() {
|
|
||||||
countDownTimer = new CountDownTimer(30000, 1000) {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTick(long millisUntilFinished) {
|
|
||||||
// 更新TextView显示剩余时间
|
|
||||||
System.out.println("asdf");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFinish() {
|
|
||||||
if (!isRegOk) {
|
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
|
||||||
customDialog.dismiss();
|
|
||||||
}
|
|
||||||
//执行运单下一步操作
|
|
||||||
regOkPop = new XPopup.Builder(con)
|
|
||||||
.setPopupCallback(new XPopupCallback() {
|
|
||||||
@Override
|
|
||||||
public void onCreated(BasePopupView popupView) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void beforeShow(BasePopupView popupView) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onShow(BasePopupView popupView) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDismiss(BasePopupView popupView) {
|
|
||||||
isRegOk = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void beforeDismiss(BasePopupView popupView) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onBackPressed(BasePopupView popupView) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onKeyBoardStateChanged(BasePopupView popupView, int height) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDrag(BasePopupView popupView, int value, float percent, boolean upOrLeft) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClickOutside(BasePopupView popupView) {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.asConfirm("提示", "接单失败,请返回重新接单!",
|
|
||||||
"取消", "确认",
|
|
||||||
() -> {
|
|
||||||
isRegOk = false;
|
|
||||||
finish();
|
|
||||||
}, () -> {
|
|
||||||
}, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局
|
|
||||||
.show();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.start(); // 别忘了调用start()方法来启动倒计时
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-7
@@ -101,7 +101,6 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
private boolean key = false;
|
private boolean key = false;
|
||||||
private int id = 0;
|
private int id = 0;
|
||||||
LocationGDUtil ld;
|
LocationGDUtil ld;
|
||||||
private TextView pl_submit;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void msgMethod(Message m) {
|
public void msgMethod(Message m) {
|
||||||
@@ -135,7 +134,6 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
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) {
|
||||||
pl_submit.setVisibility(View.GONE);
|
|
||||||
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);
|
||||||
@@ -261,7 +259,7 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
sv2.initView();
|
sv2.initView();
|
||||||
sv1.setScore(5);
|
sv1.setScore(5);
|
||||||
//设置是否可以修改评分,默认为true
|
//设置是否可以修改评分,默认为true
|
||||||
pl_submit = v.findViewById(R.id.pl_submit);
|
TextView pl_submit = v.findViewById(R.id.pl_submit);
|
||||||
TextView m_pl_value = v.findViewById(R.id.m_pl_value);
|
TextView 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) {
|
||||||
@@ -389,7 +387,6 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
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("reportAlct", sob.getData().getReportAlct());
|
|
||||||
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);
|
||||||
@@ -400,7 +397,6 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
} else if (sdw.getStatus() == 1) {//装货回单
|
} else if (sdw.getStatus() == 1) {//装货回单
|
||||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||||
in.putExtra("type", 2);
|
in.putExtra("type", 2);
|
||||||
in.putExtra("reportAlct", sob.getData().getReportAlct());
|
|
||||||
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));
|
||||||
@@ -408,7 +404,6 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
} else if (sdw.getStatus() == 2) {//上传收货单(卸货回单)
|
} else if (sdw.getStatus() == 2) {//上传收货单(卸货回单)
|
||||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||||
in.putExtra("type", 2);
|
in.putExtra("type", 2);
|
||||||
in.putExtra("reportAlct", sob.getData().getReportAlct());
|
|
||||||
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));
|
||||||
@@ -428,7 +423,6 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
if (dis > 5) {//大于五分钟可以接单
|
if (dis > 5) {//大于五分钟可以接单
|
||||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||||
in.putExtra("type", type);
|
in.putExtra("type", type);
|
||||||
in.putExtra("reportAlct", sob.getData().getReportAlct());
|
|
||||||
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);
|
||||||
|
|||||||
+63
-284
@@ -27,8 +27,6 @@ import com.alct.mdp.model.Location;
|
|||||||
import com.alct.mdp.model.ShipmentStatusEnum;
|
import com.alct.mdp.model.ShipmentStatusEnum;
|
||||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
|
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.GDImage;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.GDLocation;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.WaybillStatusBean;
|
import com.arpa.hndahesudintocctmsdriver.bean.WaybillStatusBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.HomeWaybillEvent;
|
import com.arpa.hndahesudintocctmsdriver.event.HomeWaybillEvent;
|
||||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||||
@@ -37,7 +35,6 @@ import com.arpa.hndahesudintocctmsdriver.request.bean.TrackInputBean;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.BitmapUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.BitmapUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.NewLJUtils;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||||
@@ -46,8 +43,6 @@ import com.arpa.hndahesudintocctmsdriver.util.location.LocationUtil;
|
|||||||
import com.baidu.mapapi.model.LatLng;
|
import com.baidu.mapapi.model.LatLng;
|
||||||
import com.baidu.mapapi.utils.CoordinateConverter;
|
import com.baidu.mapapi.utils.CoordinateConverter;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.dahe.mylibrary.callback.OnGDDownloadResultListener;
|
|
||||||
import com.dahe.mylibrary.callback.OnGDResultListener;
|
|
||||||
import com.dahe.mylibrary.utils.ActivityUtils;
|
import com.dahe.mylibrary.utils.ActivityUtils;
|
||||||
import com.dahe.mylibrary.utils.ImageLoader;
|
import com.dahe.mylibrary.utils.ImageLoader;
|
||||||
import com.dahe.mylibrary.utils.ToastUtils;
|
import com.dahe.mylibrary.utils.ToastUtils;
|
||||||
@@ -89,7 +84,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
private String[] names = {"装货", "卸货", "回单"};
|
private String[] names = {"装货", "卸货", "回单"};
|
||||||
public static String[] TYPE_NAME = {"zhuanghuo", "xiehuo", "huidan"};
|
public static String[] TYPE_NAME = {"zhuanghuo", "xiehuo", "huidan"};
|
||||||
private int index = 0;
|
private int index = 0;
|
||||||
private int reportAlct = 1;//是否上报(安联城通) 0否 1是'
|
|
||||||
//
|
//
|
||||||
private Gson gson = new Gson();
|
private Gson gson = new Gson();
|
||||||
//
|
//
|
||||||
@@ -140,7 +134,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove("upload");
|
CacheGroup.cacheList.remove("upload");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CacheGroup.cacheList.get("genzong") != null) {
|
if (CacheGroup.cacheList.get("genzong") != null) {
|
||||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("genzong"), BaseBean.class);
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("genzong"), BaseBean.class);
|
||||||
if (bb.getCode() == 200) {
|
if (bb.getCode() == 200) {
|
||||||
@@ -150,7 +143,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove("genzong");
|
CacheGroup.cacheList.remove("genzong");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CacheGroup.cacheList.get("waybillStatus") != null) {
|
if (CacheGroup.cacheList.get("waybillStatus") != null) {
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
@@ -185,13 +177,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
EventBus.getDefault().post(new HomeWaybillEvent());
|
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
finish();
|
finish();
|
||||||
}else if (reportAlct==0){
|
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
|
||||||
customDialog.dismiss();
|
|
||||||
}
|
|
||||||
EventBus.getDefault().post(new HomeWaybillEvent());
|
|
||||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
|
||||||
finish();
|
|
||||||
}
|
}
|
||||||
} else if ((0 == index || 1 == index) && isFinish) {
|
} else if ((0 == index || 1 == index) && isFinish) {
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
@@ -337,7 +322,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
tips_x = findViewById(R.id.tips_x);
|
tips_x = findViewById(R.id.tips_x);
|
||||||
Bundle ins = getIntent().getExtras();
|
Bundle ins = getIntent().getExtras();
|
||||||
index = ins.getInt("type");
|
index = ins.getInt("type");
|
||||||
reportAlct = ins.getInt("reportAlct");
|
|
||||||
wid = ins.getString("wid");
|
wid = ins.getString("wid");
|
||||||
h_type = ins.getInt("h_type");
|
h_type = ins.getInt("h_type");
|
||||||
keys = ins.getBoolean("keys");
|
keys = ins.getBoolean("keys");
|
||||||
@@ -490,60 +474,30 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
Log.e("--装货信息", gson.toJson(lub));
|
Log.e("--装货信息", gson.toJson(lub));
|
||||||
if (locationKey) {//高德定位
|
if (locationKey) {//高德定位
|
||||||
if (keys) {
|
if (keys) {
|
||||||
if (1==reportAlct){
|
MDPLocationCollectionManager.getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnDownloadResultListener() {
|
||||||
NewLJUtils.getInstance().getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnGDDownloadResultListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(String var1) {
|
public void onSuccess(Object o) {
|
||||||
String string = var1;
|
|
||||||
if (string.equals("30")) {//安联装货,单平台未装货
|
String string = o.toString();
|
||||||
|
if (string.equals("PICKUPED")) {//安联装货,单平台未装货
|
||||||
isFinish = true;
|
isFinish = true;
|
||||||
//平台确认装货
|
//平台确认装货
|
||||||
hyr.loading(lub);
|
hyr.loading(lub);
|
||||||
} else {
|
} else {
|
||||||
// nfc();
|
nfc();
|
||||||
loadInfo();
|
loadInfo();
|
||||||
}
|
}
|
||||||
upLocation(lgdu.getLatitude() + "", lgdu.getLongitude() + "",sob.getData().getShippingNoteNumber());
|
upLocation(lgdu.getLatitude()+"",lgdu.getLongitude()+"",sob.getData().getShippingNoteNumber());
|
||||||
// NewLJUtils.getInstance().startLocationService(ShangChuangImgActivity.this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(String var1, String var2) {
|
public void onFailure(String s, String s1) {
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
}
|
}
|
||||||
ToastUtils.showToast(con, var2);
|
ToastUtils.showToast(con, s1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else{
|
|
||||||
isFinish = true;
|
|
||||||
//平台确认装货
|
|
||||||
hyr.loading(lub);
|
|
||||||
}
|
|
||||||
|
|
||||||
// MDPLocationCollectionManager.getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnDownloadResultListener() {
|
|
||||||
// @Override
|
|
||||||
// public void onSuccess(Object o) {
|
|
||||||
//
|
|
||||||
// String string = o.toString();
|
|
||||||
// if (string.equals("PICKUPED")) {//安联装货,单平台未装货
|
|
||||||
// isFinish = true;
|
|
||||||
// //平台确认装货
|
|
||||||
// hyr.loading(lub);
|
|
||||||
// } else {
|
|
||||||
// nfc();
|
|
||||||
// loadInfo();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onFailure(String s, String s1) {
|
|
||||||
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
|
||||||
// customDialog.dismiss();
|
|
||||||
// }
|
|
||||||
// ToastUtils.showToast(con, s1);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
// nfc();
|
// nfc();
|
||||||
@@ -576,11 +530,10 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
Log.e("--卸货信息", gson.toJson(lub));
|
Log.e("--卸货信息", gson.toJson(lub));
|
||||||
if (locationKey) {
|
if (locationKey) {
|
||||||
if (keys) {
|
if (keys) {
|
||||||
if (1==reportAlct){
|
MDPLocationCollectionManager.getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnDownloadResultListener() {
|
||||||
NewLJUtils.getInstance().getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnGDDownloadResultListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(String var1) {
|
public void onSuccess(Object o) {
|
||||||
if (var1.equals("40")) {//安联装货,单平台未装货
|
if (o.toString().equals("UNLOADED")) {//安联装货,单平台未装货
|
||||||
//卸货状态-平台
|
//卸货状态-平台
|
||||||
isFinish = true;
|
isFinish = true;
|
||||||
hyr.dischargeCargo(lub);
|
hyr.dischargeCargo(lub);
|
||||||
@@ -588,47 +541,18 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
nfc();
|
nfc();
|
||||||
uploadInfo();
|
uploadInfo();
|
||||||
}
|
}
|
||||||
upLocation(lgdu.getLatitude() + "", lgdu.getLongitude() + "",sob.getData().getShippingNoteNumber());
|
upLocation(lgdu.getLatitude()+"",lgdu.getLongitude()+"",sob.getData().getShippingNoteNumber());
|
||||||
// NewLJUtils.getInstance().stopLocationService();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(String var1, String var2) {
|
public void onFailure(String s, String s1) {
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
}
|
}
|
||||||
ToastUtils.showToast(con, var2);
|
ToastUtils.showToast(con, s1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}else {
|
|
||||||
//卸货状态-平台
|
|
||||||
isFinish = true;
|
|
||||||
hyr.dischargeCargo(lub);
|
|
||||||
}
|
|
||||||
|
|
||||||
// MDPLocationCollectionManager.getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnDownloadResultListener() {
|
|
||||||
// @Override
|
|
||||||
// public void onSuccess(Object o) {
|
|
||||||
// if (o.toString().equals("UNLOADED")) {//安联装货,单平台未装货
|
|
||||||
// //卸货状态-平台
|
|
||||||
// isFinish = true;
|
|
||||||
// hyr.dischargeCargo(lub);
|
|
||||||
// } else {
|
|
||||||
// nfc();
|
|
||||||
// uploadInfo();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onFailure(String s, String s1) {
|
|
||||||
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
|
||||||
// customDialog.dismiss();
|
|
||||||
// }
|
|
||||||
// ToastUtils.showToast(con, s1);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
// nfc();
|
// nfc();
|
||||||
// uploadInfo();
|
// uploadInfo();
|
||||||
@@ -664,11 +588,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
Log.e("--回单信息", gson.toJson(urib));
|
Log.e("--回单信息", gson.toJson(urib));
|
||||||
if (locationKey) {
|
if (locationKey) {
|
||||||
if (index == 2 && keys) {
|
if (index == 2 && keys) {
|
||||||
if (1==reportAlct){
|
|
||||||
up_trafficSign();
|
up_trafficSign();
|
||||||
}
|
up_trafficReceipt();
|
||||||
// up_trafficReceipt();
|
receipt_image();
|
||||||
// receipt_image();
|
|
||||||
}
|
}
|
||||||
hyr.receipt(urib);
|
hyr.receipt(urib);
|
||||||
} else {
|
} else {
|
||||||
@@ -715,7 +637,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
//上传安联-签收
|
//上传安联-签收
|
||||||
public void up_trafficSign() {
|
public void up_trafficSign() {
|
||||||
//安联
|
//安联
|
||||||
GDLocation l = new GDLocation();
|
Location l = new Location();
|
||||||
l.setBaiduLongitude(latLng.longitude);
|
l.setBaiduLongitude(latLng.longitude);
|
||||||
l.setBaiduLatitude(latLng.latitude);
|
l.setBaiduLatitude(latLng.latitude);
|
||||||
l.setLocation(lgdu.getAddress());
|
l.setLocation(lgdu.getAddress());
|
||||||
@@ -739,86 +661,56 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
MDPLocationCollectionManager.sign(con, sob.getData().getShippingNoteNumber(), l, gs, new com.alct.mdp.callback.OnResultListener() {
|
||||||
NewLJUtils.getInstance().sign(con, sob.getData().getShippingNoteNumber(), l, new OnGDResultListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
NewLJUtils.getInstance().stopLocationService();
|
|
||||||
up_trafficReceipt();
|
|
||||||
receipt_image();
|
|
||||||
Log.e("上报安联", "签收成功");
|
Log.e("上报安联", "签收成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(String var1, String var2) {
|
public void onFailure(String s, String s1) {
|
||||||
Log.e("上报安联失败(签收):", var1 + var2);
|
Log.e("上报安联失败(签收):", s + s1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// MDPLocationCollectionManager.sign(con, sob.getData().getShippingNoteNumber(), l, gs, new com.alct.mdp.callback.OnResultListener() {
|
|
||||||
// @Override
|
|
||||||
// public void onSuccess() {
|
|
||||||
// Log.e("上报安联", "签收成功");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onFailure(String s, String s1) {
|
|
||||||
// Log.e("上报安联失败(签收):", s + s1);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//上传安联-回单
|
//上传安联-回单
|
||||||
public void up_trafficReceipt() {
|
public void up_trafficReceipt() {
|
||||||
//安联
|
//安联
|
||||||
GDLocation l = new GDLocation();
|
Location l = new Location();
|
||||||
l.setBaiduLongitude(latLng.longitude);
|
l.setBaiduLongitude(latLng.longitude);
|
||||||
l.setBaiduLatitude(latLng.latitude);
|
l.setBaiduLatitude(latLng.latitude);
|
||||||
l.setLocation(lgdu.getAddress());
|
l.setLocation(lgdu.getAddress());
|
||||||
l.setTime(Timer.getTimerT());
|
l.setTime(Timer.getTimerT());
|
||||||
|
MDPLocationCollectionManager.pod(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||||
|
|
||||||
NewLJUtils.getInstance().pod(con, sob.getData().getShippingNoteNumber(), l, new OnGDResultListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
Log.e("上报安联", "回单上传成功");
|
Log.e("上报安联", "回单上传成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(String var1, String var2) {
|
public void onFailure(String s, String s1) {
|
||||||
Log.e("上报安联失败(回单):", var1 + var2);
|
Log.e("上报安联失败(回单):", s + s1);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
// MDPLocationCollectionManager.pod(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onSuccess() {
|
|
||||||
// Log.e("上报安联", "回单上传成功");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onFailure(String s, String s1) {
|
|
||||||
// Log.e("上报安联失败(回单):", s + s1);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void up_image_z() {
|
public void up_image_z() {
|
||||||
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||||
File file = new File(path);
|
File file = new File(path);
|
||||||
GDImage image = new GDImage();
|
Image image = new Image();
|
||||||
String base = BitmapUtil.imageToBase64(path);
|
String base = BitmapUtil.imageToBase64(path);
|
||||||
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||||
image.setFileExt(FileUtil.lastName(file));
|
image.setFileExt(FileUtil.lastName(file));
|
||||||
image.setFileName(FileUtil.fileName(file));
|
image.setFileName(FileUtil.fileName(file));
|
||||||
image.setImageTakenDate(Timer.getTimerT());
|
image.setImageTakenDate(Timer.getTimerT());
|
||||||
image.setTime(Timer.getTimerT());
|
|
||||||
image.setBaiduLongitude(latLng.longitude);
|
image.setBaiduLongitude(latLng.longitude);
|
||||||
image.setBaiduLatitude(latLng.latitude);
|
image.setBaiduLatitude(latLng.latitude);
|
||||||
image.setLocation(lgdu.getAddress());
|
image.setLocation(lgdu.getAddress());
|
||||||
|
MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
||||||
|
|
||||||
String json = new Gson().toJson(image);
|
|
||||||
|
|
||||||
NewLJUtils.getInstance().uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new OnGDResultListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
@@ -831,50 +723,30 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(String var1, String var2) {
|
public void onFailure(String s, String s1) {
|
||||||
Log.e("上报安联失败(装货照片):", var1 + var2);
|
Log.e("上报安联失败(装货照片):", s + s1);
|
||||||
|
// SPUtil.insSP(con,"make","装货",sob.getData().getShippingNoteNumber());
|
||||||
|
// SPUtil.insSP(con,"make","装货-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||||
|
// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||||
|
// startService(serviceIn);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
// MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
});
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onSuccess() {
|
|
||||||
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
|
||||||
// customDialog.dismiss();
|
|
||||||
// }
|
|
||||||
// EventBus.getDefault().post(new HomeWaybillEvent());
|
|
||||||
// Log.e("上报安联", "装货照片上传成功");
|
|
||||||
// Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
|
||||||
// finish();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onFailure(String s, String s1) {
|
|
||||||
// Log.e("上报安联失败(装货照片):", s + s1);
|
|
||||||
//// SPUtil.insSP(con,"make","装货",sob.getData().getShippingNoteNumber());
|
|
||||||
//// SPUtil.insSP(con,"make","装货-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
|
||||||
//// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
|
||||||
//// startService(serviceIn);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void up_image() {
|
public void up_image() {
|
||||||
File file = new File(path);
|
File file = new File(path);
|
||||||
GDImage image = new GDImage();
|
Image image = new Image();
|
||||||
String base = BitmapUtil.imageToBase64(path);
|
String base = BitmapUtil.imageToBase64(path);
|
||||||
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||||
image.setFileExt(FileUtil.lastName(file));
|
image.setFileExt(FileUtil.lastName(file));
|
||||||
image.setFileName(FileUtil.fileName(file));
|
image.setFileName(FileUtil.fileName(file));
|
||||||
image.setImageTakenDate(Timer.getTimerT());
|
image.setImageTakenDate(Timer.getTimerT());
|
||||||
image.setTime(Timer.getTimerT());
|
|
||||||
image.setBaiduLongitude(latLng.longitude);
|
image.setBaiduLongitude(latLng.longitude);
|
||||||
image.setBaiduLatitude(latLng.latitude);
|
image.setBaiduLatitude(latLng.latitude);
|
||||||
image.setLocation(lgdu.getAddress());
|
image.setLocation(lgdu.getAddress());
|
||||||
|
MDPLocationCollectionManager.uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
||||||
|
|
||||||
NewLJUtils.getInstance().uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new OnGDResultListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
@@ -887,56 +759,34 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(String var1, String var2) {
|
public void onFailure(String s, String s1) {
|
||||||
Log.e("上报安联失败(卸货照片):", var1 + var2);
|
Log.e("上报安联失败(卸货照片):", s + s1);
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
}
|
}
|
||||||
|
// SPUtil.insSP(con,"make","卸货",sob.getData().getShippingNoteNumber());
|
||||||
|
// SPUtil.insSP(con,"make","卸货-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||||
|
// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||||
|
// startService(serviceIn);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
// MDPLocationCollectionManager.uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onSuccess() {
|
|
||||||
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
|
||||||
// customDialog.dismiss();
|
|
||||||
// }
|
|
||||||
// EventBus.getDefault().post(new HomeWaybillEvent());
|
|
||||||
// Log.e("上报安联", "卸货照片上传成功");
|
|
||||||
// Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
|
||||||
// finish();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onFailure(String s, String s1) {
|
|
||||||
// Log.e("上报安联失败(卸货照片):", s + s1);
|
|
||||||
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
|
||||||
// customDialog.dismiss();
|
|
||||||
// }
|
|
||||||
//// SPUtil.insSP(con,"make","卸货",sob.getData().getShippingNoteNumber());
|
|
||||||
//// SPUtil.insSP(con,"make","卸货-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
|
||||||
//// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
|
||||||
//// startService(serviceIn);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void receipt_image() {
|
public void receipt_image() {
|
||||||
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||||
File file = new File(path);
|
File file = new File(path);
|
||||||
GDImage image = new GDImage();
|
Image image = new Image();
|
||||||
String base = BitmapUtil.imageToBase64(path);
|
String base = BitmapUtil.imageToBase64(path);
|
||||||
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||||
image.setFileExt(FileUtil.lastName(file));
|
image.setFileExt(FileUtil.lastName(file));
|
||||||
image.setFileName(FileUtil.fileName(file));
|
image.setFileName(FileUtil.fileName(file));
|
||||||
image.setImageTakenDate(Timer.getTimerT());
|
image.setImageTakenDate(Timer.getTimerT());
|
||||||
image.setTime(Timer.getTimerT());
|
|
||||||
image.setBaiduLongitude(latLng.longitude);
|
image.setBaiduLongitude(latLng.longitude);
|
||||||
image.setBaiduLatitude(latLng.latitude);
|
image.setBaiduLatitude(latLng.latitude);
|
||||||
image.setLocation(lgdu.getAddress());
|
image.setLocation(lgdu.getAddress());
|
||||||
|
MDPLocationCollectionManager.uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
||||||
|
|
||||||
NewLJUtils.getInstance().uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new OnGDResultListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
@@ -950,34 +800,15 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(String var1, String var2) {
|
public void onFailure(String s, String s1) {
|
||||||
Log.e("上报安联失败(回单照片):", var1 + var2);
|
Log.e("上报安联失败(回单照片):", s + s1);
|
||||||
|
// SPUtil.insSP(con,"make","回单",sob.getData().getShippingNoteNumber());
|
||||||
|
//// SPUtil.insSP(con,"make","回单-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||||
|
//// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||||
|
//// startService(serviceIn);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
// MDPLocationCollectionManager.uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onSuccess() {
|
|
||||||
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
|
||||||
// customDialog.dismiss();
|
|
||||||
// }
|
|
||||||
// SPUtils.remove(con, "curWaybillId");
|
|
||||||
// EventBus.getDefault().post(new HomeWaybillEvent());
|
|
||||||
// Log.e("上报安联", "回单照片上传成功");
|
|
||||||
// Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
|
||||||
// finish();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onFailure(String s, String s1) {
|
|
||||||
// Log.e("上报安联失败(回单照片):", s + s1);
|
|
||||||
//// SPUtil.insSP(con,"make","回单",sob.getData().getShippingNoteNumber());
|
|
||||||
////// SPUtil.insSP(con,"make","回单-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
|
||||||
////// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
|
||||||
////// startService(serviceIn);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1016,13 +847,12 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
private void loadInfo() {
|
private void loadInfo() {
|
||||||
//安联
|
//安联
|
||||||
if (sob.getData().getReportAlct() == 1) {
|
if (sob.getData().getReportAlct() == 1) {
|
||||||
GDLocation l = new GDLocation();
|
Location l = new Location();
|
||||||
l.setBaiduLongitude(latLng.longitude);
|
l.setBaiduLongitude(latLng.longitude);
|
||||||
l.setBaiduLatitude(latLng.latitude);
|
l.setBaiduLatitude(latLng.latitude);
|
||||||
l.setLocation(lgdu.getAddress());
|
l.setLocation(lgdu.getAddress());
|
||||||
l.setTime(Timer.getTimerT());
|
l.setTime(Timer.getTimerT());
|
||||||
|
MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||||
NewLJUtils.getInstance().pickUp(con, sob.getData().getShippingNoteNumber(), l, new OnGDResultListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
Log.e("上报安联", "装货上传成功");
|
Log.e("上报安联", "装货上传成功");
|
||||||
@@ -1030,7 +860,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
if (sob.getData().getReport() == 1) {
|
if (sob.getData().getReport() == 1) {
|
||||||
JTTProcess.start(con, sob, "");
|
JTTProcess.start(con, sob, "");
|
||||||
}
|
}
|
||||||
NewLJUtils.getInstance().startLocationService(ShangChuangImgActivity.this);
|
|
||||||
//装货状态
|
//装货状态
|
||||||
hyr.loading(lub);
|
hyr.loading(lub);
|
||||||
//装货照片
|
//装货照片
|
||||||
@@ -1038,39 +867,14 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(String var1, String var2) {
|
public void onFailure(String s, String s1) {
|
||||||
Log.e("上报安联失败(装货):", var1 + var2);
|
Log.e("上报安联失败(装货):", s + s1);
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
}
|
}
|
||||||
new MessageUtils().showCenMessage(con, var2);
|
new MessageUtils().showCenMessage(con, s1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
|
||||||
// @Override
|
|
||||||
// public void onSuccess() {
|
|
||||||
// Log.e("上报安联", "装货上传成功");
|
|
||||||
// //交通厅
|
|
||||||
// if (sob.getData().getReport() == 1) {
|
|
||||||
// JTTProcess.start(con, sob, "");
|
|
||||||
// }
|
|
||||||
// //装货状态
|
|
||||||
// hyr.loading(lub);
|
|
||||||
// //装货照片
|
|
||||||
// up_image_z();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onFailure(String s, String s1) {
|
|
||||||
// Log.e("上报安联失败(装货):", s + s1);
|
|
||||||
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
|
||||||
// customDialog.dismiss();
|
|
||||||
// }
|
|
||||||
// new MessageUtils().showCenMessage(con, s1);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1082,14 +886,13 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
|
|
||||||
//安联
|
//安联
|
||||||
if (sob.getData().getReportAlct() == 1) {
|
if (sob.getData().getReportAlct() == 1) {
|
||||||
GDLocation l = new GDLocation();
|
Location l = new Location();
|
||||||
l.setBaiduLongitude(latLng.longitude);
|
l.setBaiduLongitude(latLng.longitude);
|
||||||
l.setBaiduLatitude(latLng.latitude);
|
l.setBaiduLatitude(latLng.latitude);
|
||||||
l.setLocation(lgdu.getAddress());
|
l.setLocation(lgdu.getAddress());
|
||||||
l.setTime(Timer.getTimerT());
|
l.setTime(Timer.getTimerT());
|
||||||
Log.e("-安联卸货信息-", gson.toJson(l));
|
Log.e("-安联卸货信息-", gson.toJson(l));
|
||||||
|
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||||
NewLJUtils.getInstance().unload(con, sob.getData().getShippingNoteNumber(), l, new OnGDResultListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
Log.e("上报安联", "卸货上传成功");
|
Log.e("上报安联", "卸货上传成功");
|
||||||
@@ -1097,7 +900,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
if (sob.getData().getReport() == 1) {
|
if (sob.getData().getReport() == 1) {
|
||||||
JTTProcess.stop(con, sob, "");
|
JTTProcess.stop(con, sob, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
//卸货状态-平台
|
//卸货状态-平台
|
||||||
hyr.dischargeCargo(lub);
|
hyr.dischargeCargo(lub);
|
||||||
//卸货照片-安联
|
//卸货照片-安联
|
||||||
@@ -1105,37 +907,14 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(String var1, String var2) {
|
public void onFailure(String s, String s1) {
|
||||||
Log.e("上报安联失败(卸货):", var1 + var2);
|
Log.e("上报安联失败(卸货):", s + s1);
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
}
|
}
|
||||||
new MessageUtils().showCenMessage(con, var2);
|
new MessageUtils().showCenMessage(con, s1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
|
||||||
// @Override
|
|
||||||
// public void onSuccess() {
|
|
||||||
// Log.e("上报安联", "卸货上传成功");
|
|
||||||
// //交通厅
|
|
||||||
// if (sob.getData().getReport() == 1) {
|
|
||||||
// JTTProcess.stop(con, sob, "");
|
|
||||||
// }
|
|
||||||
// //卸货状态-平台
|
|
||||||
// hyr.dischargeCargo(lub);
|
|
||||||
// //卸货照片-安联
|
|
||||||
// up_image();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onFailure(String s, String s1) {
|
|
||||||
// Log.e("上报安联失败(卸货):", s + s1);
|
|
||||||
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
|
||||||
// customDialog.dismiss();
|
|
||||||
// }
|
|
||||||
// new MessageUtils().showCenMessage(con, s1);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -58,7 +58,7 @@ public class WebPDFActivity extends BaseActivity {
|
|||||||
protected void onPostExecute(Void aVoid) {
|
protected void onPostExecute(Void aVoid) {
|
||||||
super.onPostExecute(aVoid);
|
super.onPostExecute(aVoid);
|
||||||
pdf_view.fromStream(input[0])
|
pdf_view.fromStream(input[0])
|
||||||
// .pages(0,1,2,3,4,5,6,7) // all pages are displayed by default
|
.pages(0,1) // all pages are displayed by default
|
||||||
.enableAnnotationRendering(true)
|
.enableAnnotationRendering(true)
|
||||||
.load();
|
.load();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import android.telecom.TelecomManager;
|
|||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
import android.text.SpannableStringBuilder;
|
import android.text.SpannableStringBuilder;
|
||||||
import android.text.TextPaint;
|
import android.text.TextPaint;
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.text.method.LinkMovementMethod;
|
import android.text.method.LinkMovementMethod;
|
||||||
import android.text.style.ClickableSpan;
|
import android.text.style.ClickableSpan;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -33,7 +32,6 @@ import com.arpa.hndahesudintocctmsdriver.request.net.BaseObserver;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.request.net.DataManager;
|
import com.arpa.hndahesudintocctmsdriver.request.net.DataManager;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.net.RxHttpCallBack;
|
import com.arpa.hndahesudintocctmsdriver.request.net.RxHttpCallBack;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.web.WebOnlyOneActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.web.WebOnlyOneActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.NewLJUtils;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||||
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickHelper;
|
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickHelper;
|
||||||
import com.dahe.mylibrary.net.CommonResponseBean;
|
import com.dahe.mylibrary.net.CommonResponseBean;
|
||||||
@@ -69,7 +67,6 @@ public class LoginActivity extends BaseActivity {
|
|||||||
public static final String USER = "user";
|
public static final String USER = "user";
|
||||||
public static final String USER_TOKEN = "token";
|
public static final String USER_TOKEN = "token";
|
||||||
public static final String USER_UNAME = "uname";
|
public static final String USER_UNAME = "uname";
|
||||||
public static final String USER_PHONE = "USER_PHONE";
|
|
||||||
public static final String USER_RNAME = "rname";
|
public static final String USER_RNAME = "rname";
|
||||||
public static final String USER_ID = "id";
|
public static final String USER_ID = "id";
|
||||||
|
|
||||||
@@ -111,14 +108,11 @@ public class LoginActivity extends BaseActivity {
|
|||||||
Log.e("--登录信息--", new Gson().toJson(loginBean));
|
Log.e("--登录信息--", new Gson().toJson(loginBean));
|
||||||
AppInfoBean appInfoBean = new AppInfoBean();
|
AppInfoBean appInfoBean = new AppInfoBean();
|
||||||
if (loginBean.getCode() == 200) {
|
if (loginBean.getCode() == 200) {
|
||||||
//获取新路交token
|
|
||||||
NewLJUtils.getInstance().getToken(con);
|
|
||||||
SPUtil.insSP(con, USER, USER_TOKEN, loginBean.getData().getToken());
|
SPUtil.insSP(con, USER, USER_TOKEN, loginBean.getData().getToken());
|
||||||
SPUtil.insSP(con, USER, USER_UNAME, loginBean.getData().getUname());
|
SPUtil.insSP(con, USER, USER_UNAME, loginBean.getData().getUname());
|
||||||
SPUtil.insSP(con, USER, USER_PHONE, loginBean.getData().getRegisterPhone());
|
|
||||||
SPUtil.insSP(con, USER, USER_RNAME, loginBean.getData().getRname());
|
SPUtil.insSP(con, USER, USER_RNAME, loginBean.getData().getRname());
|
||||||
SPUtil.insSP(con, USER, USER_ID, loginBean.getData().getId() + "");
|
SPUtil.insSP(con, USER, USER_ID, loginBean.getData().getId() + "");
|
||||||
// JPushInterface.setAlias(con, 0, loginBean.getData().getUname());
|
JPushInterface.setAlias(con, 0, loginBean.getData().getUname());
|
||||||
appInfoBean.setStatus("0");
|
appInfoBean.setStatus("0");
|
||||||
appInfoBean.setUserPhone(String.valueOf(input_phone.getText()));
|
appInfoBean.setUserPhone(String.valueOf(input_phone.getText()));
|
||||||
ur.postAppInfo(appInfoBean, "post");
|
ur.postAppInfo(appInfoBean, "post");
|
||||||
@@ -158,10 +152,6 @@ public class LoginActivity extends BaseActivity {
|
|||||||
getCode = findViewById(R.id.getCode);
|
getCode = findViewById(R.id.getCode);
|
||||||
cb = findViewById(R.id.cb);
|
cb = findViewById(R.id.cb);
|
||||||
ur = new UserRequset(con, hd);
|
ur = new UserRequset(con, hd);
|
||||||
String phone = SPUtil.getSP(con, LoginActivity.USER, LoginActivity.USER_PHONE);
|
|
||||||
if (!TextUtils.isEmpty(phone)){
|
|
||||||
input_phone.setText(phone);
|
|
||||||
}
|
|
||||||
initView(null);
|
initView(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -346,8 +346,8 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
//在使用SDK各组件之前初始化context信息,传入ApplicationContext
|
//在使用SDK各组件之前初始化context信息,传入ApplicationContext
|
||||||
// 路由初始化
|
// 路由初始化
|
||||||
// JVerificationInterface.setDebugMode(true);
|
JVerificationInterface.setDebugMode(true);
|
||||||
// JVerificationInterface.init(con, 5000, (code, msg) -> Log.d("tag", "code = " + code + " msg = " + msg));
|
JVerificationInterface.init(con, 5000, (code, msg) -> Log.d("tag", "code = " + code + " msg = " + msg));
|
||||||
//友盟
|
//友盟
|
||||||
//设置非debug版本开启
|
//设置非debug版本开启
|
||||||
if (!isDebugVersion(con)) {
|
if (!isDebugVersion(con)) {
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import com.arpa.hndahesudintocctmsdriver.ui.business.BusinessActivity;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.util.PicturlUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.PicturlUtil;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.dahe.mylibrary.utils.ImageLoader;
|
import com.dahe.mylibrary.utils.ImageLoader;
|
||||||
import com.dahe.mylibrary.utils.ToastUtils;
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.lxj.xpopup.XPopup;
|
import com.lxj.xpopup.XPopup;
|
||||||
|
|
||||||
@@ -52,7 +51,6 @@ import com.permissionx.guolindev.PermissionX;
|
|||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
import org.greenrobot.eventbus.ThreadMode;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -346,19 +344,11 @@ public class MyFragment extends BaseFragment {
|
|||||||
ur.vehicleList("1");
|
ur.vehicleList("1");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe
|
||||||
public void personResult(PersonEvent home) {
|
public void personResult(PersonEvent home) {
|
||||||
Log.e("-res-", home.getMessage());
|
Log.e("-res-", home.getMessage());
|
||||||
if (ur != null) {
|
if (ur != null) {
|
||||||
ur.User();
|
ur.User();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onStart() {
|
|
||||||
super.onStart();
|
|
||||||
if (ur != null) {
|
|
||||||
ur.User();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,9 +74,9 @@ public class SetupActivity extends BaseActivity {
|
|||||||
ConfigBean cb= ConfigParts.getConfigParts(con);
|
ConfigBean cb= ConfigParts.getConfigParts(con);
|
||||||
if(cb!=null){
|
if(cb!=null){
|
||||||
// url1=cb.getData().getUserUrl();
|
// url1=cb.getData().getUserUrl();
|
||||||
url1="https://agreement.dahehuoyun.com/rule/serviceAgreement/dist/index.html#/";
|
url1="http://agreement.dahehuoyun.com/rule/serviceAgreement/dist/index.html#/";
|
||||||
// url2=cb.getData().getPrivateUrl();
|
// url2=cb.getData().getPrivateUrl();
|
||||||
url2="https://agreement.dahehuoyun.com/currency/#/";
|
url2="http://agreement.dahehuoyun.com/currency/#/";
|
||||||
kefu=cb.getData().getServiceMobile();
|
kefu=cb.getData().getServiceMobile();
|
||||||
url3=cb.getData().getSecurityUrl();
|
url3=cb.getData().getSecurityUrl();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -232,14 +232,14 @@ public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClic
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void submit() {
|
public void submit() {
|
||||||
|
customDialog = new CustomDialog(con, "上传中,请稍后...");
|
||||||
|
customDialog.show();
|
||||||
String bankName = bank_name.getText().toString().trim();
|
String bankName = bank_name.getText().toString().trim();
|
||||||
String bankNumber = bank_number.getText().toString().trim();
|
String bankNumber = bank_number.getText().toString().trim();
|
||||||
if ("".equals(bankName) || "".equals(bankNumber)) {
|
if ("".equals(bankName) || "".equals(bankNumber)) {
|
||||||
Toast.makeText(con, "请先补充完整的银行卡信息", Toast.LENGTH_LONG).show();
|
Toast.makeText(con, "请先补充完整的银行卡信息", Toast.LENGTH_LONG).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
customDialog = new CustomDialog(con, "上传中,请稍后...");
|
|
||||||
customDialog.show();
|
|
||||||
InsBankInputBean ibib = new InsBankInputBean();
|
InsBankInputBean ibib = new InsBankInputBean();
|
||||||
ibib.setCardNo(bankNumber);
|
ibib.setCardNo(bankNumber);
|
||||||
// ibib.setCardType(Integer.parseInt(ib.getData().getType()));
|
// ibib.setCardType(Integer.parseInt(ib.getData().getType()));
|
||||||
|
|||||||
@@ -1,810 +0,0 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.util;
|
|
||||||
|
|
||||||
import static com.dahe.mylibrary.utils.BaseSPUtils.NEW_LJ_TOKEN;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.App;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.DriverAuthDataBean;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.GDImage;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.GDLocation;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.IsAuthCardBean;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.constant.NewLJConstant;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.parts.AuthParts;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.AuthRequest;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.InvoiceBean;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.InvoicesBean;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.LjTokenBean;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.PickupBean;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.ShipmentStatusBean;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.UpimgBean;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.net.BaseObserver;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.net.DataManager;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.net.RxHttpCallBack;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.http.RequestUtil;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
|
||||||
import com.dahe.mylibrary.bean.DriverBean;
|
|
||||||
import com.dahe.mylibrary.callback.OnGDDownloadResultListener;
|
|
||||||
import com.dahe.mylibrary.callback.OnGDResultListener;
|
|
||||||
import com.dahe.mylibrary.net.CommonResponseBean;
|
|
||||||
import com.dahe.mylibrary.utils.ToastUtils;
|
|
||||||
import com.express.mdp.Api;
|
|
||||||
import com.express.mdp.Callback;
|
|
||||||
import com.google.gson.Gson;
|
|
||||||
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
|
||||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName NewLJUtils
|
|
||||||
* @Author john
|
|
||||||
* @Date 2024/11/25 09:53
|
|
||||||
* @Description TODO
|
|
||||||
*/
|
|
||||||
public class NewLJUtils {
|
|
||||||
|
|
||||||
|
|
||||||
private static class SingletonHolder {
|
|
||||||
private static final NewLJUtils INSTANCE = new NewLJUtils();
|
|
||||||
}
|
|
||||||
|
|
||||||
private NewLJUtils() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public static final NewLJUtils getInstance() {
|
|
||||||
return SingletonHolder.INSTANCE;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void getToken(Context ctx) {
|
|
||||||
LjTokenBean ljTokenBean = new LjTokenBean();
|
|
||||||
ljTokenBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
|
||||||
ljTokenBean.setEnterpriseIdentity(NewLJConstant.ENTER_PRISE_IDENTITY);
|
|
||||||
ljTokenBean.setEnterpriseKey(NewLJConstant.ENTER_PRISE_KEY);
|
|
||||||
|
|
||||||
DataManager.getInstance().getToken(ljTokenBean)
|
|
||||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(CommonResponseBean t) {
|
|
||||||
super.onSuccess(t);
|
|
||||||
SPUtils.put(ctx, NEW_LJ_TOKEN, t.getToken());
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 刷新token
|
|
||||||
*
|
|
||||||
* @param ctx
|
|
||||||
*/
|
|
||||||
public void refreshToken(Context ctx) {
|
|
||||||
String token = SPUtils.get(ctx, NEW_LJ_TOKEN, "").toString();
|
|
||||||
DataManager.getInstance().refreshToken(token)
|
|
||||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(CommonResponseBean<CommonResponseBean> t) {
|
|
||||||
super.onSuccess(t);
|
|
||||||
SPUtils.put(ctx, NEW_LJ_TOKEN, t.getToken());
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void getToken(Context ctx, OnGDResultListener listener) {
|
|
||||||
LjTokenBean ljTokenBean = new LjTokenBean();
|
|
||||||
ljTokenBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
|
||||||
ljTokenBean.setEnterpriseIdentity(NewLJConstant.ENTER_PRISE_IDENTITY);
|
|
||||||
ljTokenBean.setEnterpriseKey(NewLJConstant.ENTER_PRISE_KEY);
|
|
||||||
|
|
||||||
DataManager.getInstance().getToken(ljTokenBean)
|
|
||||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(CommonResponseBean t) {
|
|
||||||
super.onSuccess(t);
|
|
||||||
SPUtils.put(ctx, NEW_LJ_TOKEN, t.getToken());
|
|
||||||
if (listener != null)
|
|
||||||
listener.onSuccess();
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运单提货
|
|
||||||
*
|
|
||||||
* @param ctx
|
|
||||||
* @param shipmentCode
|
|
||||||
* @param location
|
|
||||||
*/
|
|
||||||
public void pickUp(Context ctx, String shipmentCode, GDLocation location, OnGDResultListener listener) {
|
|
||||||
if (TextUtils.isEmpty(shipmentCode)) {
|
|
||||||
ToastUtils.showToast(ctx, "运单号不能为空");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Double.isNaN(location.getBaiduLatitude()) || Double.isNaN(location.getBaiduLongitude())) {
|
|
||||||
ToastUtils.showToast(ctx, "经纬度不能为空");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
PickupBean pickupBean = new PickupBean();
|
|
||||||
pickupBean.setShipmentCode(shipmentCode);
|
|
||||||
pickupBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
|
||||||
pickupBean.setLocation(location);
|
|
||||||
DataManager.getInstance().pickup(pickupBean)
|
|
||||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(CommonResponseBean t) {
|
|
||||||
super.onSuccess(t);
|
|
||||||
if (listener != null) {
|
|
||||||
listener.onSuccess();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
|
||||||
super.onCodeError(mContext, t);
|
|
||||||
if (listener != null) {
|
|
||||||
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage()) ? "运单提货操作异常" : t.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运单卸货
|
|
||||||
*
|
|
||||||
* @param ctx
|
|
||||||
* @param shipmentCode
|
|
||||||
* @param location
|
|
||||||
*/
|
|
||||||
public void unload(Context ctx, String shipmentCode, GDLocation location, OnGDResultListener listener) {
|
|
||||||
if (TextUtils.isEmpty(shipmentCode)) {
|
|
||||||
ToastUtils.showToast(ctx, "运单号不能为空");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Double.isNaN(location.getBaiduLatitude()) || Double.isNaN(location.getBaiduLongitude())) {
|
|
||||||
ToastUtils.showToast(ctx, "经纬度不能为空");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
PickupBean pickupBean = new PickupBean();
|
|
||||||
pickupBean.setShipmentCode(shipmentCode);
|
|
||||||
pickupBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
|
||||||
pickupBean.setLocation(location);
|
|
||||||
DataManager.getInstance().unload(pickupBean)
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(CommonResponseBean t) {
|
|
||||||
super.onSuccess(t);
|
|
||||||
if (listener != null) {
|
|
||||||
listener.onSuccess();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
|
||||||
super.onCodeError(mContext, t);
|
|
||||||
if (listener != null) {
|
|
||||||
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage()) ? "运单卸货操作异常" : t.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运单签收
|
|
||||||
*
|
|
||||||
* @param ctx
|
|
||||||
* @param shipmentCode
|
|
||||||
* @param location
|
|
||||||
*/
|
|
||||||
public void sign(Context ctx, String shipmentCode, GDLocation location, OnGDResultListener listener) {
|
|
||||||
if (TextUtils.isEmpty(shipmentCode)) {
|
|
||||||
ToastUtils.showToast(ctx, "运单号不能为空");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Double.isNaN(location.getBaiduLatitude()) || Double.isNaN(location.getBaiduLongitude())) {
|
|
||||||
ToastUtils.showToast(ctx, "经纬度不能为空");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
PickupBean pickupBean = new PickupBean();
|
|
||||||
pickupBean.setShipmentCode(shipmentCode);
|
|
||||||
pickupBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
|
||||||
pickupBean.setLocation(location);
|
|
||||||
DataManager.getInstance().sign(pickupBean)
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(CommonResponseBean t) {
|
|
||||||
super.onSuccess(t);
|
|
||||||
if (listener != null) {
|
|
||||||
listener.onSuccess();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
|
||||||
super.onCodeError(mContext, t);
|
|
||||||
if (listener != null) {
|
|
||||||
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage()) ? "运单签收操作异常" : t.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运单回单
|
|
||||||
*
|
|
||||||
* @param ctx
|
|
||||||
* @param shipmentCode
|
|
||||||
* @param location
|
|
||||||
*/
|
|
||||||
public void pod(Context ctx, String shipmentCode, GDLocation location, OnGDResultListener listener) {
|
|
||||||
if (TextUtils.isEmpty(shipmentCode)) {
|
|
||||||
ToastUtils.showToast(ctx, "运单号不能为空");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Double.isNaN(location.getBaiduLatitude()) || Double.isNaN(location.getBaiduLongitude())) {
|
|
||||||
ToastUtils.showToast(ctx, "经纬度不能为空");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
PickupBean pickupBean = new PickupBean();
|
|
||||||
pickupBean.setShipmentCode(shipmentCode);
|
|
||||||
pickupBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
|
||||||
pickupBean.setLocation(location);
|
|
||||||
DataManager.getInstance().pod(pickupBean)
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(CommonResponseBean t) {
|
|
||||||
super.onSuccess(t);
|
|
||||||
if (listener != null) {
|
|
||||||
listener.onSuccess();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
|
||||||
super.onCodeError(mContext, t);
|
|
||||||
if (listener != null) {
|
|
||||||
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage()) ? "运单回单操作异常" : t.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运单提货照片上传
|
|
||||||
*
|
|
||||||
* @param ctx
|
|
||||||
* @param shipmentCode
|
|
||||||
* @param imageDTO
|
|
||||||
*/
|
|
||||||
public void uploadPickupImage(Context ctx, String shipmentCode, GDImage imageDTO, OnGDResultListener listener) {
|
|
||||||
if (TextUtils.isEmpty(shipmentCode)) {
|
|
||||||
ToastUtils.showToast(ctx, "运单号不能为空");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TextUtils.isEmpty(imageDTO.getFileName())) {
|
|
||||||
ToastUtils.showToast(ctx, "照片不能为空");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
UpimgBean pickupBean = new UpimgBean();
|
|
||||||
pickupBean.setShipmentCode(shipmentCode);
|
|
||||||
pickupBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
|
||||||
pickupBean.setImage(imageDTO);
|
|
||||||
DataManager.getInstance().uploadPickupImage(pickupBean)
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(CommonResponseBean t) {
|
|
||||||
super.onSuccess(t);
|
|
||||||
if (listener != null) {
|
|
||||||
listener.onSuccess();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
|
||||||
super.onCodeError(mContext, t);
|
|
||||||
if (listener != null) {
|
|
||||||
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage()) ? "运单提货照片操作异常" : t.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运单卸货照片上传
|
|
||||||
*
|
|
||||||
* @param ctx
|
|
||||||
* @param shipmentCode
|
|
||||||
* @param imageDTO
|
|
||||||
*/
|
|
||||||
public void uploadUnloadImage(Context ctx, String shipmentCode, GDImage imageDTO, OnGDResultListener listener) {
|
|
||||||
if (TextUtils.isEmpty(shipmentCode)) {
|
|
||||||
ToastUtils.showToast(ctx, "运单号不能为空");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TextUtils.isEmpty(imageDTO.getFileName())) {
|
|
||||||
ToastUtils.showToast(ctx, "照片不能为空");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
UpimgBean pickupBean = new UpimgBean();
|
|
||||||
pickupBean.setShipmentCode(shipmentCode);
|
|
||||||
pickupBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
|
||||||
pickupBean.setImage(imageDTO);
|
|
||||||
DataManager.getInstance().uploadUnloadImage(pickupBean)
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(CommonResponseBean t) {
|
|
||||||
super.onSuccess(t);
|
|
||||||
if (listener != null) {
|
|
||||||
listener.onSuccess();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
|
||||||
super.onCodeError(mContext, t);
|
|
||||||
if (listener != null) {
|
|
||||||
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage()) ? "运单卸货照片操作异常" : t.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运单回单照片上传
|
|
||||||
*
|
|
||||||
* @param ctx
|
|
||||||
* @param shipmentCode
|
|
||||||
* @param imageDTO
|
|
||||||
*/
|
|
||||||
public void uploadPODImage(Context ctx, String shipmentCode, GDImage imageDTO, OnGDResultListener listener) {
|
|
||||||
if (TextUtils.isEmpty(shipmentCode)) {
|
|
||||||
ToastUtils.showToast(ctx, "运单号不能为空");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TextUtils.isEmpty(imageDTO.getFileName())) {
|
|
||||||
ToastUtils.showToast(ctx, "照片不能为空");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
UpimgBean pickupBean = new UpimgBean();
|
|
||||||
pickupBean.setShipmentCode(shipmentCode);
|
|
||||||
pickupBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
|
||||||
pickupBean.setImage(imageDTO);
|
|
||||||
DataManager.getInstance().uploadPODImage(pickupBean)
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(CommonResponseBean t) {
|
|
||||||
super.onSuccess(t);
|
|
||||||
if (listener != null) {
|
|
||||||
listener.onSuccess();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
|
||||||
super.onCodeError(mContext, t);
|
|
||||||
if (listener != null) {
|
|
||||||
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage()) ? "运单回单照片操作异常" : t.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取发票列表
|
|
||||||
*
|
|
||||||
* @param ctx
|
|
||||||
* @param listener
|
|
||||||
*/
|
|
||||||
public void getInvoices(Context ctx, OnGDResultListener listener) {
|
|
||||||
DriverAuthDataBean auth = AuthParts.getAuth(ctx);
|
|
||||||
if (auth == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
DataManager.getInstance().getInvoices(NewLJConstant.ENTER_PRISE_CODE, auth.getData().getIdcard(), 1, 100)
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean<InvoicesBean>>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(CommonResponseBean<CommonResponseBean<InvoicesBean>> t) {
|
|
||||||
super.onSuccess(t);
|
|
||||||
if (t.getData().getData().getDriverInvoices().size() > 0) {
|
|
||||||
confirmInvoice(ctx, new OnGDResultListener() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(String var1, String var2) {
|
|
||||||
Log.e("NewLJUtils", var1 + var2);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean<InvoicesBean>> t) {
|
|
||||||
super.onCodeError(mContext, t);
|
|
||||||
// Log.e("NewLJUtils", t.getMsg().toString());
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 同意发票申请
|
|
||||||
*
|
|
||||||
* @param ctx
|
|
||||||
*/
|
|
||||||
public void confirmInvoice(Context ctx, OnGDResultListener listener) {
|
|
||||||
DriverAuthDataBean auth = AuthParts.getAuth(ctx);
|
|
||||||
if (auth == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
searchDriver(ctx, auth.getData().getIdcard(), new OnGDDownloadResultListener() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(String var1) {
|
|
||||||
InvoiceBean invoiceBean = new InvoiceBean();
|
|
||||||
invoiceBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
|
||||||
invoiceBean.setDriverInvoiceCode(var1);
|
|
||||||
invoiceBean.setDriverIdentification(auth.getData().getIdcard());
|
|
||||||
DataManager.getInstance().confirmInvoice(invoiceBean)
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(CommonResponseBean t) {
|
|
||||||
super.onSuccess(t);
|
|
||||||
if (listener != null) {
|
|
||||||
listener.onSuccess();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
|
||||||
super.onCodeError(mContext, t);
|
|
||||||
if (listener != null) {
|
|
||||||
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage()) ? "同意发票异常" : t.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(String var1, String var2) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
//查询身份证信息
|
|
||||||
// new AuthRequest().getCard(ctx, new Handler(msg -> {
|
|
||||||
// switch (msg.what) {
|
|
||||||
// case RequsetCodeConstants.ERROR:
|
|
||||||
// Toast.makeText(ctx, RequsetCodeConstants.FEEDBACK_TEXT, Toast.LENGTH_SHORT).show();
|
|
||||||
// break;
|
|
||||||
// case RequsetCodeConstants.UNKONWN:
|
|
||||||
// Toast.makeText(ctx, RequsetCodeConstants.UNKONWN_TEXT, Toast.LENGTH_SHORT).show();
|
|
||||||
// break;
|
|
||||||
// case RequsetCodeConstants.SERVER_ERROR:
|
|
||||||
// Toast.makeText(ctx, RequsetCodeConstants.SERVER_ERROR_TEXT, Toast.LENGTH_SHORT).show();
|
|
||||||
// break;
|
|
||||||
// case RequsetCodeConstants.GATEWAY_ERROR:
|
|
||||||
// Toast.makeText(ctx, RequsetCodeConstants.GATEWAY_ERROR_TEXT, Toast.LENGTH_SHORT).show();
|
|
||||||
// break;
|
|
||||||
// case RequsetCodeConstants.SUCCESS:
|
|
||||||
// IsAuthCardBean iacb = new Gson().fromJson(CacheGroup.cacheList.get(CertificatesActivity.ISAUTH), IsAuthCardBean.class);
|
|
||||||
// if (iacb != null || iacb.getData() != null || !TextUtils.isEmpty(iacb.getData().getIdcard())) {
|
|
||||||
// //根据身份证号查询路交司机信息
|
|
||||||
// searchDriver(ctx, iacb.getData().getIdcard(), new OnGDDownloadResultListener() {
|
|
||||||
// @Override
|
|
||||||
// public void onSuccess(String var1) {
|
|
||||||
// InvoiceBean invoiceBean = new InvoiceBean();
|
|
||||||
// invoiceBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
|
||||||
// invoiceBean.setDriverInvoiceCode(var1);
|
|
||||||
// invoiceBean.setDriverIdentification(iacb.getData().getIdcard());
|
|
||||||
// DataManager.getInstance().confirmInvoice(invoiceBean)
|
|
||||||
// .subscribeOn(Schedulers.io())
|
|
||||||
// .observeOn(AndroidSchedulers.mainThread())
|
|
||||||
// .subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
|
||||||
// @Override
|
|
||||||
// public void onSuccess(CommonResponseBean t) {
|
|
||||||
// super.onSuccess(t);
|
|
||||||
// if (listener != null) {
|
|
||||||
// listener.onSuccess();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
|
||||||
// super.onCodeError(mContext, t);
|
|
||||||
// if (listener != null) {
|
|
||||||
// listener.onFailure(t.getCode() + "", t.getMessage());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onFailure(String var1, String var2) {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// } else {
|
|
||||||
// Toast.makeText(ctx, "缺少身份证信息", Toast.LENGTH_SHORT).show();
|
|
||||||
// }
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// return false;
|
|
||||||
// }));
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运单状态查询
|
|
||||||
*
|
|
||||||
* @param ctx
|
|
||||||
* @param shipmentCode
|
|
||||||
*/
|
|
||||||
public void getShipmentStatus(Context ctx, String shipmentCode, OnGDDownloadResultListener listener) {
|
|
||||||
ShipmentStatusBean shipmentStatusBean = new ShipmentStatusBean();
|
|
||||||
shipmentStatusBean.setShipmentCode(shipmentCode);
|
|
||||||
shipmentStatusBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
|
||||||
DataManager.getInstance().getShipmentStatus(shipmentStatusBean)
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(CommonResponseBean t) {
|
|
||||||
super.onSuccess(t);
|
|
||||||
if (listener != null) {
|
|
||||||
listener.onSuccess(t.getStatusCode());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
|
||||||
super.onCodeError(mContext, t);
|
|
||||||
if (listener != null) {
|
|
||||||
listener.onFailure(t.getCode() + "", TextUtils.isEmpty(t.getMessage()) ? "运单状态查询异常" : t.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void getPODImageNames(Context ctx, String shipmentCode) {
|
|
||||||
ShipmentStatusBean shipmentStatusBean = new ShipmentStatusBean();
|
|
||||||
shipmentStatusBean.setShipmentCode(shipmentCode);
|
|
||||||
shipmentStatusBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
|
||||||
DataManager.getInstance().getPODImageNames(shipmentStatusBean)
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(CommonResponseBean t) {
|
|
||||||
super.onSuccess(t);
|
|
||||||
System.out.println("sadf");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
|
||||||
super.onCodeError(mContext, t);
|
|
||||||
System.out.println("sadf");
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开启位置上传
|
|
||||||
*
|
|
||||||
* @param act
|
|
||||||
*/
|
|
||||||
public void startLocationService(AppCompatActivity act) {
|
|
||||||
DriverAuthDataBean auth = AuthParts.getAuth(act);
|
|
||||||
if (auth == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
searchDriver(act, auth.getData().getIdcard(), new OnGDDownloadResultListener() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(String var1) {
|
|
||||||
try {
|
|
||||||
//开启定位服务
|
|
||||||
if (BuildConfig.isTest) {
|
|
||||||
Api.setBaseUrl("https://kehui56.cn/api", "https://api.kehui56.cn/api");
|
|
||||||
}
|
|
||||||
String result = Api.startLocationService(act, var1, s -> {
|
|
||||||
Log.e("位置上报", s);
|
|
||||||
});
|
|
||||||
System.out.println(result);
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(String var1, String var2) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
//查询身份证信息
|
|
||||||
// new AuthRequest().getCard(act, new Handler(msg -> {
|
|
||||||
// switch (msg.what) {
|
|
||||||
// case RequsetCodeConstants.ERROR:
|
|
||||||
// Toast.makeText(act, RequsetCodeConstants.FEEDBACK_TEXT, Toast.LENGTH_SHORT).show();
|
|
||||||
// break;
|
|
||||||
// case RequsetCodeConstants.UNKONWN:
|
|
||||||
// Toast.makeText(act, RequsetCodeConstants.UNKONWN_TEXT, Toast.LENGTH_SHORT).show();
|
|
||||||
// break;
|
|
||||||
// case RequsetCodeConstants.SERVER_ERROR:
|
|
||||||
// Toast.makeText(act, RequsetCodeConstants.SERVER_ERROR_TEXT, Toast.LENGTH_SHORT).show();
|
|
||||||
// break;
|
|
||||||
// case RequsetCodeConstants.GATEWAY_ERROR:
|
|
||||||
// Toast.makeText(act, RequsetCodeConstants.GATEWAY_ERROR_TEXT, Toast.LENGTH_SHORT).show();
|
|
||||||
// break;
|
|
||||||
// case RequsetCodeConstants.SUCCESS:
|
|
||||||
// IsAuthCardBean iacb = new Gson().fromJson(CacheGroup.cacheList.get(CertificatesActivity.ISAUTH), IsAuthCardBean.class);
|
|
||||||
// if (iacb != null || iacb.getData() != null || !TextUtils.isEmpty(iacb.getData().getIdcard())) {
|
|
||||||
// //根据身份证号查询路交司机信息
|
|
||||||
// searchDriver(act,iacb.getData().getIdcard(), new OnGDDownloadResultListener() {
|
|
||||||
// @Override
|
|
||||||
// public void onSuccess(String var1) {
|
|
||||||
// try {
|
|
||||||
// //开启定位服务
|
|
||||||
// Api.setBaseUrl("https://kehui56.cn/api", "https://api.kehui56.cn/api");
|
|
||||||
// String result = Api.startLocationService(act, var1, s -> {
|
|
||||||
// Log.e("位置上报", s);
|
|
||||||
// });
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// throw new RuntimeException(e);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onFailure(String var1, String var2) {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// } else {
|
|
||||||
// Toast.makeText(act, "缺少身份证信息", Toast.LENGTH_SHORT).show();
|
|
||||||
// }
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// return false;
|
|
||||||
// }));
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关闭定位服务
|
|
||||||
*/
|
|
||||||
public void stopLocationService() {
|
|
||||||
Api.stopLocationService();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询司机
|
|
||||||
*/
|
|
||||||
public void searchDriver(Context ctx, String idCard, OnGDDownloadResultListener listener) {
|
|
||||||
DataManager.getInstance().searchDriver(idCard)
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(CommonResponseBean<CommonResponseBean> t) {
|
|
||||||
super.onSuccess(t);
|
|
||||||
DriverBean driver = t.getDriver();
|
|
||||||
if (driver != null && !TextUtils.isEmpty(driver.getDriverCode())) {
|
|
||||||
if (listener != null)
|
|
||||||
listener.onSuccess(driver.getDriverCode());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
|
||||||
super.onCodeError(mContext, t);
|
|
||||||
if (listener != null)
|
|
||||||
listener.onFailure(t.getCode(), TextUtils.isEmpty(t.getMessage()) ? "司机异常请联系管理员" : t.getMessage());
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 人车绑定关系
|
|
||||||
* @param ctx
|
|
||||||
* @param idCard
|
|
||||||
* @param listener
|
|
||||||
*/
|
|
||||||
public void trucks(Context ctx, String idCard,String carNum, OnGDDownloadResultListener listener){
|
|
||||||
DataManager.getInstance().trucks(idCard)
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(CommonResponseBean<CommonResponseBean> t) {
|
|
||||||
super.onSuccess(t);
|
|
||||||
String[] licensePlateNos = t.getLicensePlateNos();
|
|
||||||
if (listener!=null){
|
|
||||||
if (licensePlateNos.length==0){
|
|
||||||
listener.onFailure(t.getCode(), "该司机暂未绑定任何车辆");
|
|
||||||
}else{
|
|
||||||
boolean isHasCar = false;
|
|
||||||
for (int i = 0; i < licensePlateNos.length; i++) {
|
|
||||||
if (licensePlateNos[i].equals(carNum)){
|
|
||||||
isHasCar = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (isHasCar){
|
|
||||||
listener.onSuccess("人车绑定正常");
|
|
||||||
}else{
|
|
||||||
listener.onFailure(t.getCode(), "司机车辆绑定异常");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
|
||||||
super.onCodeError(mContext, t);
|
|
||||||
if (listener != null)
|
|
||||||
listener.onFailure(t.getCode(), TextUtils.isEmpty(t.getMessage()) ? "司机异常" : t.getMessage());
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -16,7 +16,6 @@ import com.arpa.hndahesudintocctmsdriver.util.time.Timer;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
import okhttp3.Call;
|
import okhttp3.Call;
|
||||||
import okhttp3.Callback;
|
import okhttp3.Callback;
|
||||||
@@ -49,7 +48,7 @@ public class RequestUtil {
|
|||||||
|
|
||||||
public static void a1(final String name, Request re, Context con, final Handler hd){
|
public static void a1(final String name, Request re, Context con, final Handler hd){
|
||||||
Log.e("请求开始","........");
|
Log.e("请求开始","........");
|
||||||
OkHttpClient client = new OkHttpClient().newBuilder().connectTimeout(30, TimeUnit.SECONDS)
|
OkHttpClient client = new OkHttpClient().newBuilder()
|
||||||
.build();
|
.build();
|
||||||
client.newCall(re).enqueue( new Callback() {
|
client.newCall(re).enqueue( new Callback() {
|
||||||
@Override
|
@Override
|
||||||
@@ -97,7 +96,7 @@ public class RequestUtil {
|
|||||||
}
|
}
|
||||||
public static void a1s(final String name, Request re, Context con, final Handler hd){
|
public static void a1s(final String name, Request re, Context con, final Handler hd){
|
||||||
Log.e("请求开始","........");
|
Log.e("请求开始","........");
|
||||||
OkHttpClient client = new OkHttpClient().newBuilder().connectTimeout(30, TimeUnit.SECONDS)
|
OkHttpClient client = new OkHttpClient().newBuilder()
|
||||||
.build();
|
.build();
|
||||||
client.newCall(re).enqueue( new Callback() {
|
client.newCall(re).enqueue( new Callback() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
package com.dahe.mylibrary.bean;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName DriverBean
|
|
||||||
* @Author john
|
|
||||||
* @Date 2024/11/28 12:24
|
|
||||||
* @Description TODO
|
|
||||||
*/
|
|
||||||
public class DriverBean implements Serializable {
|
|
||||||
|
|
||||||
private String driverCode;
|
|
||||||
private String isTaxRegistered;
|
|
||||||
private String taxRegisterStatus;
|
|
||||||
private String taxRegisterStatusDescription;
|
|
||||||
|
|
||||||
public String getDriverCode() {
|
|
||||||
return driverCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDriverCode(String driverCode) {
|
|
||||||
this.driverCode = driverCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getIsTaxRegistered() {
|
|
||||||
return isTaxRegistered;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsTaxRegistered(String isTaxRegistered) {
|
|
||||||
this.isTaxRegistered = isTaxRegistered;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTaxRegisterStatus() {
|
|
||||||
return taxRegisterStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTaxRegisterStatus(String taxRegisterStatus) {
|
|
||||||
this.taxRegisterStatus = taxRegisterStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTaxRegisterStatusDescription() {
|
|
||||||
return taxRegisterStatusDescription;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTaxRegisterStatusDescription(String taxRegisterStatusDescription) {
|
|
||||||
this.taxRegisterStatusDescription = taxRegisterStatusDescription;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package com.dahe.mylibrary.callback;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName OnGDDownloadResultListener
|
|
||||||
* @Author john
|
|
||||||
* @Date 2024/11/25 18:22
|
|
||||||
* @Description TODO
|
|
||||||
*/
|
|
||||||
public interface OnGDDownloadResultListener {
|
|
||||||
void onSuccess(String var1);
|
|
||||||
|
|
||||||
void onFailure(String var1, String var2);
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
package com.dahe.mylibrary.callback;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName OnGDResultListener
|
|
||||||
* @Author john
|
|
||||||
* @Date 2024/11/25 17:48
|
|
||||||
* @Description TODO
|
|
||||||
*/
|
|
||||||
public interface OnGDResultListener {
|
|
||||||
|
|
||||||
void onSuccess();
|
|
||||||
|
|
||||||
void onFailure(String var1, String var2);
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
package com.dahe.mylibrary.net;
|
package com.dahe.mylibrary.net;
|
||||||
|
|
||||||
import com.dahe.mylibrary.bean.DriverBean;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -10,69 +8,13 @@ import java.io.Serializable;
|
|||||||
|
|
||||||
public class CommonResponseBean<T> implements Serializable {
|
public class CommonResponseBean<T> implements Serializable {
|
||||||
private T data;
|
private T data;
|
||||||
private String code;
|
private int code;
|
||||||
private String info;
|
private String info;
|
||||||
private String msg;
|
private String msg;
|
||||||
private String message;
|
|
||||||
private String url;
|
private String url;
|
||||||
private String fileName;
|
private String fileName;
|
||||||
private String token;
|
|
||||||
private String expiryIn;
|
|
||||||
private String statusCode;
|
|
||||||
private boolean success;
|
private boolean success;
|
||||||
|
|
||||||
private String[] LicensePlateNos;
|
|
||||||
|
|
||||||
public String[] getLicensePlateNos() {
|
|
||||||
return LicensePlateNos;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLicensePlateNos(String[] licensePlateNos) {
|
|
||||||
LicensePlateNos = licensePlateNos;
|
|
||||||
}
|
|
||||||
|
|
||||||
private DriverBean driver;
|
|
||||||
|
|
||||||
public DriverBean getDriver() {
|
|
||||||
return driver;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDriver(DriverBean driver) {
|
|
||||||
this.driver = driver;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStatusCode() {
|
|
||||||
return statusCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatusCode(String statusCode) {
|
|
||||||
this.statusCode = statusCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMessage() {
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMessage(String message) {
|
|
||||||
this.message = message;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getToken() {
|
|
||||||
return token;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setToken(String token) {
|
|
||||||
this.token = token;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getExpiryIn() {
|
|
||||||
return expiryIn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setExpiryIn(String expiryIn) {
|
|
||||||
this.expiryIn = expiryIn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public T getData() {
|
public T getData() {
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -81,11 +23,11 @@ public class CommonResponseBean<T> implements Serializable {
|
|||||||
this.data = data;
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCode() {
|
public int getCode() {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCode(String code) {
|
public void setCode(int code) {
|
||||||
this.code = code;
|
this.code = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ public class BaseSPUtils {
|
|||||||
public static final String USER_INFO_KEY = "user_info_key";
|
public static final String USER_INFO_KEY = "user_info_key";
|
||||||
public static final String NET_SERVICE_TEST = "net_service_test";
|
public static final String NET_SERVICE_TEST = "net_service_test";
|
||||||
public static final String SEARRH_CACHE = "search_cache";
|
public static final String SEARRH_CACHE = "search_cache";
|
||||||
public static final String NEW_LJ_TOKEN = "NEW_LJ_TOKEN";
|
|
||||||
public static final String NAVI_PH_EDIT_CACHE = "navi_ph_edit_cache";
|
public static final String NAVI_PH_EDIT_CACHE = "navi_ph_edit_cache";
|
||||||
public static final String FIRST_OPEN = "first_open";
|
public static final String FIRST_OPEN = "first_open";
|
||||||
public static final String KEY_PRIVACY_AGREEMENT = "privacy_agreement";
|
public static final String KEY_PRIVACY_AGREEMENT = "privacy_agreement";
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
package com.dahe.mylibrary.utils;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName Gps
|
|
||||||
* @Author john
|
|
||||||
* @Date 2024/12/13 17:25
|
|
||||||
* @Description TODO
|
|
||||||
*/
|
|
||||||
public class Gps {
|
|
||||||
private double wgLon;
|
|
||||||
private double wgLat;
|
|
||||||
|
|
||||||
public Gps(double wgLat,double wgLon) {
|
|
||||||
this.wgLat = wgLat;
|
|
||||||
this.wgLon = wgLon;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getWgLon() {
|
|
||||||
return wgLon;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setWgLon(double wgLon) {
|
|
||||||
this.wgLon = wgLon;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getWgLat() {
|
|
||||||
return wgLat;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setWgLat(double wgLat) {
|
|
||||||
this.wgLat = wgLat;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,112 +0,0 @@
|
|||||||
package com.dahe.mylibrary.utils;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.provider.Settings;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName PermissionUtils
|
|
||||||
* @Author john
|
|
||||||
* @Date 2024/12/19 14:59
|
|
||||||
* @Description TODO
|
|
||||||
*/
|
|
||||||
public class PermissionUtils {
|
|
||||||
|
|
||||||
// 私有静态实例,防止被外部实例化
|
|
||||||
private static PermissionUtils instance;
|
|
||||||
|
|
||||||
// 私有构造方法,防止通过 new 关键字创建实例
|
|
||||||
private PermissionUtils() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取单例实例
|
|
||||||
public static PermissionUtils getInstance() {
|
|
||||||
if (instance == null) {
|
|
||||||
synchronized (PermissionUtils.class) {
|
|
||||||
if (instance == null) {
|
|
||||||
instance = new PermissionUtils();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据不同手机机型跳转到权限设置页面
|
|
||||||
*
|
|
||||||
* @param context 上下文
|
|
||||||
*/
|
|
||||||
public void goToAppPermissionSettings(Context context) {
|
|
||||||
Intent intent = new Intent();
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
|
||||||
if (Build.FINGERPRINT.startsWith("Huawei") || Build.BRAND.startsWith("Huawei")) {
|
|
||||||
// 华为手机
|
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
|
||||||
Uri uri = Uri.fromParts("package", context.getPackageName(), null);
|
|
||||||
intent.setData(uri);
|
|
||||||
} else if (Build.FINGERPRINT.startsWith("Xiaomi") || Build.BRAND.startsWith("Xiaomi")) {
|
|
||||||
// 小米手机
|
|
||||||
intent.setAction(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION);
|
|
||||||
Uri uri = Uri.parse("package:" + context.getPackageName());
|
|
||||||
intent.setData(uri);
|
|
||||||
} else if (Build.BRAND.equals("Meizu")) {
|
|
||||||
// 魅族手机
|
|
||||||
intent.setAction("com.meizu.safe.security.SHOW_APPSEC");
|
|
||||||
intent.addCategory(Intent.CATEGORY_DEFAULT);
|
|
||||||
intent.putExtra("packageName", context.getPackageName());
|
|
||||||
} else if (Build.FINGERPRINT.startsWith("OPPO") || Build.BRAND.startsWith("OPPO")) {
|
|
||||||
// OPPO手机
|
|
||||||
try {
|
|
||||||
String pkgName = context.getPackageName();
|
|
||||||
String className = "com.coloros.safecenter.permission.PermissionManagerActivity";
|
|
||||||
intent.setClassName("com.coloros.safecenter", className);
|
|
||||||
intent.putExtra("packageName", pkgName);
|
|
||||||
intent.putExtra("appName", context.getResources().getString(context.getApplicationInfo().labelRes));
|
|
||||||
intent.putExtra("opType", "4"); // 4 表示权限管理页面
|
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
} catch (Exception e) {
|
|
||||||
// 如果找不到OPPO的特定页面,则使用通用页面
|
|
||||||
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
|
||||||
Uri uri = Uri.fromParts("package", context.getPackageName(), null);
|
|
||||||
intent.setData(uri);
|
|
||||||
}
|
|
||||||
} else if (Build.FINGERPRINT.startsWith("vivo") || Build.BRAND.startsWith("vivo")) {
|
|
||||||
// vivo手机
|
|
||||||
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
|
||||||
Uri uri = Uri.fromParts("package", context.getPackageName(), null);
|
|
||||||
intent.setData(uri);
|
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
intent.putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName());
|
|
||||||
} else if (Build.BRAND.equals("samsung")) {
|
|
||||||
// 三星手机
|
|
||||||
try {
|
|
||||||
String pkgName = context.getPackageName();
|
|
||||||
Intent intent2 = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS");
|
|
||||||
intent2.addCategory(Intent.CATEGORY_DEFAULT);
|
|
||||||
intent2.setData(Uri.parse("package:" + pkgName));
|
|
||||||
intent2.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
intent2.putExtra("com.android.providers.media.EXTRA_APP_PACKAGE", pkgName);
|
|
||||||
context.startActivity(intent2);
|
|
||||||
return; // 使用三星特定的页面,不需要继续执行通用代码
|
|
||||||
} catch (Exception e) {
|
|
||||||
// 如果三星特定页面失败,则使用通用页面
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 其他手机使用通用页面
|
|
||||||
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
|
||||||
Uri uri = Uri.fromParts("package", context.getPackageName(), null);
|
|
||||||
intent.setData(uri);
|
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
intent.putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 低于Android 6.0(M)的版本,使用通用页面
|
|
||||||
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
|
||||||
Uri uri = Uri.fromParts("package", context.getPackageName(), null);
|
|
||||||
intent.setData(uri);
|
|
||||||
}
|
|
||||||
context.startActivity(intent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,539 +0,0 @@
|
|||||||
package com.dahe.mylibrary.utils;
|
|
||||||
|
|
||||||
|
|
||||||
import android.Manifest;
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.location.Address;
|
|
||||||
import android.location.Criteria;
|
|
||||||
import android.location.Geocoder;
|
|
||||||
import android.location.Location;
|
|
||||||
import android.location.LocationListener;
|
|
||||||
import android.location.LocationManager;
|
|
||||||
import android.location.LocationProvider;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.provider.Settings;
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import androidx.core.app.ActivityCompat;
|
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.text.DecimalFormat;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Locale;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author ondear
|
|
||||||
* time : 16/11/13
|
|
||||||
* desc : 定位相关工具类
|
|
||||||
*/
|
|
||||||
public class RxLocationUtils {
|
|
||||||
|
|
||||||
public static double pi = 3.1415926535897932384626;
|
|
||||||
public static double a = 6378245.0;
|
|
||||||
public static double ee = 0.00669342162296594323;
|
|
||||||
private static OnLocationChangeListener mListener;
|
|
||||||
private static MyLocationListener myLocationListener;
|
|
||||||
private static LocationManager mLocationManager;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 判断Gps是否可用
|
|
||||||
*
|
|
||||||
* @return {@code true}: 是<br>{@code false}: 否
|
|
||||||
*/
|
|
||||||
public static boolean isGpsEnabled(Context context) {
|
|
||||||
LocationManager lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
|
|
||||||
return lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 判断定位是否可用
|
|
||||||
*
|
|
||||||
* @return {@code true}: 是<br>{@code false}: 否
|
|
||||||
*/
|
|
||||||
public static boolean isLocationEnabled(Context context) {
|
|
||||||
LocationManager lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
|
|
||||||
return lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER) || lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 打开Gps设置界面
|
|
||||||
*/
|
|
||||||
public static void openGpsSettings(Context context) {
|
|
||||||
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
|
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
context.startActivity(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 注册
|
|
||||||
* <p>使用完记得调用{@link #unregister()}</p>
|
|
||||||
* <p>需添加权限 {@code <uses-permission android:name="android.permission.INTERNET"/>}</p>
|
|
||||||
* <p>需添加权限 {@code <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>}</p>
|
|
||||||
* <p>需添加权限 {@code <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>}</p>
|
|
||||||
* <p>如果{@code minDistance}为0,则通过{@code minTime}来定时更新;</p>
|
|
||||||
* <p>{@code minDistance}不为0,则以{@code minDistance}为准;</p>
|
|
||||||
* <p>两者都为0,则随时刷新。</p>
|
|
||||||
*
|
|
||||||
* @param minTime 位置信息更新周期(单位:毫秒)
|
|
||||||
* @param minDistance 位置变化最小距离:当位置距离变化超过此值时,将更新位置信息(单位:米)
|
|
||||||
* @param listener 位置刷新的回调接口
|
|
||||||
* @return {@code true}: 初始化成功<br>{@code false}: 初始化失败
|
|
||||||
*/
|
|
||||||
public static boolean register(Context context, long minTime, long minDistance, OnLocationChangeListener listener) {
|
|
||||||
if (listener == null) return false;
|
|
||||||
if (ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
|
||||||
ActivityCompat.requestPermissions((Activity) context, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 1);
|
|
||||||
ActivityCompat.requestPermissions((Activity) context, new String[]{Manifest.permission.ACCESS_COARSE_LOCATION}, 1);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
mLocationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
|
|
||||||
mListener = listener;
|
|
||||||
if (!isLocationEnabled(context)) {
|
|
||||||
ToastUtils.showToast(context, "无法定位,请打开定位服务");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
String provider = mLocationManager.getBestProvider(getCriteria(), true);
|
|
||||||
|
|
||||||
Location location = mLocationManager.getLastKnownLocation(provider);
|
|
||||||
if (location != null) listener.getLastKnownLocation(location);
|
|
||||||
if (myLocationListener == null) myLocationListener = new MyLocationListener();
|
|
||||||
mLocationManager.requestLocationUpdates(provider, minTime, minDistance, myLocationListener);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 注销
|
|
||||||
*/
|
|
||||||
public static void unregister() {
|
|
||||||
if (mLocationManager != null) {
|
|
||||||
if (myLocationListener != null) {
|
|
||||||
mLocationManager.removeUpdates(myLocationListener);
|
|
||||||
myLocationListener = null;
|
|
||||||
}
|
|
||||||
mLocationManager = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置定位参数
|
|
||||||
*
|
|
||||||
* @return {@link Criteria}
|
|
||||||
*/
|
|
||||||
private static Criteria getCriteria() {
|
|
||||||
Criteria criteria = new Criteria();
|
|
||||||
//设置定位精确度 Criteria.ACCURACY_COARSE比较粗略,Criteria.ACCURACY_FINE则比较精细
|
|
||||||
criteria.setAccuracy(Criteria.ACCURACY_FINE);
|
|
||||||
//设置是否要求速度
|
|
||||||
criteria.setSpeedRequired(false);
|
|
||||||
// 设置是否允许运营商收费
|
|
||||||
criteria.setCostAllowed(false);
|
|
||||||
//设置是否需要方位信息
|
|
||||||
criteria.setBearingRequired(false);
|
|
||||||
//设置是否需要海拔信息
|
|
||||||
criteria.setAltitudeRequired(false);
|
|
||||||
// 设置对电源的需求
|
|
||||||
criteria.setPowerRequirement(Criteria.POWER_LOW);
|
|
||||||
return criteria;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据经纬度获取地理位置
|
|
||||||
*
|
|
||||||
* @param context 上下文
|
|
||||||
* @param latitude 纬度
|
|
||||||
* @param longitude 经度
|
|
||||||
* @return {@link Address}
|
|
||||||
*/
|
|
||||||
public static Address getAddress(Context context, double latitude, double longitude) {
|
|
||||||
Geocoder geocoder = new Geocoder(context, Locale.getDefault());
|
|
||||||
try {
|
|
||||||
List<Address> addresses = geocoder.getFromLocation(latitude, longitude, 1);
|
|
||||||
if (addresses.size() > 0) return addresses.get(0);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据经纬度获取所在国家
|
|
||||||
*
|
|
||||||
* @param context 上下文
|
|
||||||
* @param latitude 纬度
|
|
||||||
* @param longitude 经度
|
|
||||||
* @return 所在国家
|
|
||||||
*/
|
|
||||||
public static String getCountryName(Context context, double latitude, double longitude) {
|
|
||||||
Address address = getAddress(context, latitude, longitude);
|
|
||||||
return address == null ? "unknown" : address.getCountryName();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据经纬度获取所在地
|
|
||||||
*
|
|
||||||
* @param context 上下文
|
|
||||||
* @param latitude 纬度
|
|
||||||
* @param longitude 经度
|
|
||||||
* @return 所在地
|
|
||||||
*/
|
|
||||||
public static String getLocality(Context context, double latitude, double longitude) {
|
|
||||||
Address address = getAddress(context, latitude, longitude);
|
|
||||||
return address == null ? "unknown" : address.getLocality();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据经纬度获取所在街道
|
|
||||||
*
|
|
||||||
* @param context 上下文
|
|
||||||
* @param latitude 纬度
|
|
||||||
* @param longitude 经度
|
|
||||||
* @return 所在街道
|
|
||||||
*/
|
|
||||||
public static String getStreet(Context context, double latitude, double longitude) {
|
|
||||||
Address address = getAddress(context, latitude, longitude);
|
|
||||||
return address == null ? "unknown" : address.getAddressLine(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据经纬度获取详细地址
|
|
||||||
*
|
|
||||||
* @param context 上下文
|
|
||||||
* @param latitude 纬度
|
|
||||||
* @param longitude 经度
|
|
||||||
* @return 所在街道
|
|
||||||
*/
|
|
||||||
public static String getFeature(Context context, double latitude, double longitude) {
|
|
||||||
Address address = getAddress(context, latitude, longitude);
|
|
||||||
return address == null ? "未知地点" : address.getFeatureName();
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------------------坐标转换工具start--------------------------------------
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GPS坐标 转换成 角度
|
|
||||||
* 例如 113.202222 转换成 113°12′8″
|
|
||||||
*
|
|
||||||
* @param location
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static String gpsToDegree(double location) {
|
|
||||||
double degree = Math.floor(location);
|
|
||||||
double minute_temp = (location - degree) * 60;
|
|
||||||
double minute = Math.floor(minute_temp);
|
|
||||||
// double second = Math.floor((minute_temp - minute)*60);
|
|
||||||
String second = new DecimalFormat("#.##").format((minute_temp - minute) * 60);
|
|
||||||
return (int) degree + "°" + (int) minute + "′" + second + "″";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 国际 GPS84 坐标系
|
|
||||||
* 转换成
|
|
||||||
* [国测局坐标系] 火星坐标系 (GCJ-02)
|
|
||||||
* <p>
|
|
||||||
* World Geodetic System ==> Mars Geodetic System
|
|
||||||
*
|
|
||||||
* @param lon 经度
|
|
||||||
* @param lat 纬度
|
|
||||||
* @return GPS实体类
|
|
||||||
*/
|
|
||||||
public static Gps GPS84ToGCJ02(double lat, double lon) {
|
|
||||||
if (outOfChina(lat, lon)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
double dLat = transformLat(lon - 105.0, lat - 35.0);
|
|
||||||
double dLon = transformLon(lon - 105.0, lat - 35.0);
|
|
||||||
double radLat = lat / 180.0 * pi;
|
|
||||||
double magic = Math.sin(radLat);
|
|
||||||
magic = 1 - ee * magic * magic;
|
|
||||||
double sqrtMagic = Math.sqrt(magic);
|
|
||||||
dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi);
|
|
||||||
dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi);
|
|
||||||
double mgLat = lat + dLat;
|
|
||||||
double mgLon = lon + dLon;
|
|
||||||
return new Gps(mgLat, mgLon);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* [国测局坐标系] 火星坐标系 (GCJ-02)
|
|
||||||
* 转换成
|
|
||||||
* 国际 GPS84 坐标系
|
|
||||||
*
|
|
||||||
* @param lon 火星经度
|
|
||||||
* @param lat 火星纬度
|
|
||||||
*/
|
|
||||||
public static Gps GCJ02ToGPS84(double lat, double lon) {
|
|
||||||
Gps gps = transform(lat, lon);
|
|
||||||
double lontitude = lon * 2 - gps.getWgLon();
|
|
||||||
double latitude = lat * 2 - gps.getWgLat();
|
|
||||||
return new Gps(latitude, lontitude);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 火星坐标系 (GCJ-02)
|
|
||||||
* 转换成
|
|
||||||
* 百度坐标系 (BD-09)
|
|
||||||
*
|
|
||||||
* @param gg_lon 经度
|
|
||||||
* @param gg_lat 纬度
|
|
||||||
*/
|
|
||||||
public static Gps GCJ02ToBD09(double gg_lat, double gg_lon) {
|
|
||||||
double x = gg_lon, y = gg_lat;
|
|
||||||
double z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * pi);
|
|
||||||
double theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * pi);
|
|
||||||
double bd_lon = z * Math.cos(theta) + 0.0065;
|
|
||||||
double bd_lat = z * Math.sin(theta) + 0.006;
|
|
||||||
return new Gps(bd_lat, bd_lon);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 国际 GPS84 坐标系
|
|
||||||
* 转换成
|
|
||||||
* 百度坐标系 (BD-09)
|
|
||||||
*
|
|
||||||
* @param lon 经度
|
|
||||||
* @param lat 纬度
|
|
||||||
*/
|
|
||||||
public static Gps GPS84ToBD09(double lat, double lon) {
|
|
||||||
Gps gps = GPS84ToGCJ02(lat,lon);
|
|
||||||
if (gps == null) {
|
|
||||||
return new Gps(lat,lon);
|
|
||||||
}
|
|
||||||
//GCJ-02 转 BD-09
|
|
||||||
return GCJ02ToBD09(gps.getWgLat(), gps.getWgLon());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百度坐标系 (BD-09)
|
|
||||||
* 转换成
|
|
||||||
* 火星坐标系 (GCJ-02)
|
|
||||||
*
|
|
||||||
* @param bd_lon 百度*经度
|
|
||||||
* @param bd_lat 百度*纬度
|
|
||||||
* @return GPS实体类
|
|
||||||
*/
|
|
||||||
public static Gps BD09ToGCJ02(double bd_lat, double bd_lon) {
|
|
||||||
double x = bd_lon - 0.0065, y = bd_lat - 0.006;
|
|
||||||
double z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * pi);
|
|
||||||
double theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * pi);
|
|
||||||
double gg_lon = z * Math.cos(theta);
|
|
||||||
double gg_lat = z * Math.sin(theta);
|
|
||||||
return new Gps(gg_lat, gg_lon);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百度坐标系 (BD-09)
|
|
||||||
* 转换成
|
|
||||||
* 国际 GPS84 坐标系
|
|
||||||
*
|
|
||||||
* @param bd_lon 百度*经度
|
|
||||||
* @param bd_lat 百度*纬度
|
|
||||||
* @return GPS实体类
|
|
||||||
*/
|
|
||||||
public static Gps BD09ToGPS84(double bd_lat, double bd_lon) {
|
|
||||||
Gps gcj02 = BD09ToGCJ02(bd_lat, bd_lon);
|
|
||||||
Gps map84 = GCJ02ToGPS84(gcj02.getWgLat(),
|
|
||||||
gcj02.getWgLon());
|
|
||||||
return map84;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 不在中国范围内
|
|
||||||
*
|
|
||||||
* @param lon 经度
|
|
||||||
* @param lat 纬度
|
|
||||||
* @return boolean值
|
|
||||||
*/
|
|
||||||
public static boolean outOfChina(double lat, double lon) {
|
|
||||||
if (lon < 72.004 || lon > 137.8347)
|
|
||||||
return true;
|
|
||||||
return lat < 0.8293 || lat > 55.8271;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 转化算法
|
|
||||||
*
|
|
||||||
* @param lon
|
|
||||||
* @param lat
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static Gps transform(double lat, double lon) {
|
|
||||||
if (outOfChina(lat, lon)) {
|
|
||||||
return new Gps(lat, lon);
|
|
||||||
}
|
|
||||||
double dLat = transformLat(lon - 105.0, lat - 35.0);
|
|
||||||
double dLon = transformLon(lon - 105.0, lat - 35.0);
|
|
||||||
double radLat = lat / 180.0 * pi;
|
|
||||||
double magic = Math.sin(radLat);
|
|
||||||
magic = 1 - ee * magic * magic;
|
|
||||||
double sqrtMagic = Math.sqrt(magic);
|
|
||||||
dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi);
|
|
||||||
dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi);
|
|
||||||
double mgLat = lat + dLat;
|
|
||||||
double mgLon = lon + dLon;
|
|
||||||
return new Gps(mgLat, mgLon);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 纬度转化算法
|
|
||||||
*
|
|
||||||
* @param x
|
|
||||||
* @param y
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static double transformLat(double x, double y) {
|
|
||||||
double ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y
|
|
||||||
+ 0.2 * Math.sqrt(Math.abs(x));
|
|
||||||
ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0;
|
|
||||||
ret += (20.0 * Math.sin(y * pi) + 40.0 * Math.sin(y / 3.0 * pi)) * 2.0 / 3.0;
|
|
||||||
ret += (160.0 * Math.sin(y / 12.0 * pi) + 320 * Math.sin(y * pi / 30.0)) * 2.0 / 3.0;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 经度转化算法
|
|
||||||
*
|
|
||||||
* @param x
|
|
||||||
* @param y
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static double transformLon(double x, double y) {
|
|
||||||
double ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1
|
|
||||||
* Math.sqrt(Math.abs(x));
|
|
||||||
ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0;
|
|
||||||
ret += (20.0 * Math.sin(x * pi) + 40.0 * Math.sin(x / 3.0 * pi)) * 2.0 / 3.0;
|
|
||||||
ret += (150.0 * Math.sin(x / 12.0 * pi) + 300.0 * Math.sin(x / 30.0
|
|
||||||
* pi)) * 2.0 / 3.0;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
public interface OnLocationChangeListener {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取最后一次保留的坐标
|
|
||||||
*
|
|
||||||
* @param location 坐标
|
|
||||||
*/
|
|
||||||
void getLastKnownLocation(Location location);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 当坐标改变时触发此函数,如果Provider传进相同的坐标,它就不会被触发
|
|
||||||
*
|
|
||||||
* @param location 坐标
|
|
||||||
*/
|
|
||||||
void onLocationChanged(Location location);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* provider的在可用、暂时不可用和无服务三个状态直接切换时触发此函数
|
|
||||||
*
|
|
||||||
* @param provider 提供者
|
|
||||||
* @param status 状态
|
|
||||||
* @param extras provider可选包
|
|
||||||
*/
|
|
||||||
void onStatusChanged(String provider, int status, Bundle extras);//位置状态发生改变
|
|
||||||
|
|
||||||
void onProviderEnabled(String provider);
|
|
||||||
|
|
||||||
void onProviderDisabled(String provider);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static class MyLocationListener
|
|
||||||
implements LocationListener {
|
|
||||||
/**
|
|
||||||
* 当坐标改变时触发此函数,如果Provider传进相同的坐标,它就不会被触发
|
|
||||||
*
|
|
||||||
* @param location 坐标
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void onLocationChanged(Location location) {
|
|
||||||
if (mListener != null) {
|
|
||||||
mListener.onLocationChanged(location);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* provider的在可用、暂时不可用和无服务三个状态直接切换时触发此函数
|
|
||||||
*
|
|
||||||
* @param provider 提供者
|
|
||||||
* @param status 状态
|
|
||||||
* @param extras provider可选包
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void onStatusChanged(String provider, int status, Bundle extras) {
|
|
||||||
if (mListener != null) {
|
|
||||||
mListener.onStatusChanged(provider, status, extras);
|
|
||||||
}
|
|
||||||
switch (status) {
|
|
||||||
case LocationProvider.AVAILABLE:
|
|
||||||
Log.d("onStatusChanged", "当前GPS状态为可见状态");
|
|
||||||
break;
|
|
||||||
case LocationProvider.OUT_OF_SERVICE:
|
|
||||||
Log.d("onStatusChanged", "当前GPS状态为服务区外状态");
|
|
||||||
break;
|
|
||||||
case LocationProvider.TEMPORARILY_UNAVAILABLE:
|
|
||||||
Log.d("onStatusChanged", "当前GPS状态为暂停服务状态");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* provider被enable时触发此函数,比如GPS被打开
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void onProviderEnabled(String provider) {
|
|
||||||
if (mListener != null) {
|
|
||||||
mListener.onProviderEnabled(provider);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* provider被disable时触发此函数,比如GPS被关闭
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void onProviderDisabled(String provider) {
|
|
||||||
if (mListener != null) {
|
|
||||||
mListener.onProviderDisabled(provider);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//===========================================坐标转换工具end====================================
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static final double EARTH_RADIUS = 6378137.0; //地球半径
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 计算两个经纬度之间的距离
|
|
||||||
*
|
|
||||||
* @param longitude
|
|
||||||
* @param latitude
|
|
||||||
* @param longitude2
|
|
||||||
* @param latitude2
|
|
||||||
* @return 单位米
|
|
||||||
*/
|
|
||||||
public static double getDistance(double longitude, double latitude, double longitude2, double latitude2) {
|
|
||||||
double lat1 = rad(latitude);
|
|
||||||
double lat2 = rad(latitude2);
|
|
||||||
double a = lat1 - lat2;
|
|
||||||
double b = rad(longitude) - rad(longitude2);
|
|
||||||
double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(lat1) * Math.cos(lat2) * Math.pow(Math.sin(b / 2), 2)));
|
|
||||||
s = s * EARTH_RADIUS;
|
|
||||||
s = Math.round(s * 10000) / 10000; //四舍五入
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 弧度换为角度
|
|
||||||
* @param d
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private static double rad(double d) {
|
|
||||||
return d * Math.PI / 180.0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -307,27 +307,6 @@ public final class TimeUtil {
|
|||||||
return format.format(date);
|
return format.format(date);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 验证时间字符串是否是yyyy-MM-dd格式
|
|
||||||
*
|
|
||||||
* @param dateStr 需要验证的时间字符串
|
|
||||||
* @return 如果是yyyy-MM-dd格式,返回true;否则返回false
|
|
||||||
*/
|
|
||||||
public static boolean isValidDate(String dateStr) {
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault());
|
|
||||||
sdf.setLenient(false); // 设置不宽容,严格解析
|
|
||||||
try {
|
|
||||||
Date date = sdf.parse(dateStr);
|
|
||||||
// 可以进一步验证解析后的日期是否合法(例如:检查月份天数、闰年等)
|
|
||||||
// 但对于简单的格式验证,这一步通常不是必需的
|
|
||||||
return true;
|
|
||||||
} catch (ParseException e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将Date类型转为时间戳
|
* 将Date类型转为时间戳
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user