新路交替换
This commit is contained in:
parent
80a257273b
commit
ac6906a1a5
@ -38,8 +38,8 @@ android {
|
||||
applicationId "com.arpa.hndahesudintocctmsdriver"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 30
|
||||
versionCode 75
|
||||
versionName "3.4.5"
|
||||
versionCode 76
|
||||
versionName "3.4.6"
|
||||
flavorDimensions "CHANNEL_VALUE"
|
||||
flavorDimensions "app_icon"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
@ -231,4 +231,6 @@ dependencies {
|
||||
|
||||
implementation project(path: ':mylibrary')
|
||||
|
||||
implementation files('libs/mdp-release.aar')
|
||||
|
||||
}
|
BIN
app/libs/mdp-release.aar
Normal file
BIN
app/libs/mdp-release.aar
Normal file
Binary file not shown.
@ -254,6 +254,15 @@
|
||||
android:name="com.alct.mdp.MDPLocationService"
|
||||
android:exported="true"
|
||||
android:process=":mdpLocation_v1" />
|
||||
|
||||
<!--后台访问 gps-->
|
||||
<service
|
||||
android:name="com.express.mdp.GpsService"
|
||||
android:foregroundServiceType="location"
|
||||
android:label="GPS服务"
|
||||
android:priority="1000" />
|
||||
|
||||
|
||||
<service
|
||||
android:name="com.baidu.location.f"
|
||||
android:enabled="true"
|
||||
|
@ -0,0 +1,53 @@
|
||||
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;
|
||||
}
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
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;
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
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";
|
||||
|
||||
}
|
@ -12,7 +12,10 @@ import com.arpa.hndahesudintocctmsdriver.App;
|
||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.AuthParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.NewLJUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.msg.MsgUtil;
|
||||
import com.dahe.mylibrary.callback.OnGDDownloadResultListener;
|
||||
import com.dahe.mylibrary.callback.OnGDResultListener;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.DriverAuthDataBean;
|
||||
@ -47,27 +50,49 @@ public class ALProcess {
|
||||
return;
|
||||
}
|
||||
|
||||
Identity idy=new Identity();
|
||||
//企业代码
|
||||
idy.setEnterpriseCode(BuildConfig.isTest?ENTERPRISE_CODE_TEXT:ENTERPRISE_CODE);
|
||||
//企业app的身份码
|
||||
idy.setAppIdentity(BuildConfig.isTest?APP_IDENTITY_TEXT:APP_IDENTITY);
|
||||
//企业app验证码
|
||||
idy.setAppKey(BuildConfig.isTest?APP_KEY_TEXT:APP_KEY);
|
||||
//司机身份证
|
||||
idy.setDriverIdentity(auth.getData().getIdcard());
|
||||
//idy.setDriverIdentity("410725198311042012");
|
||||
MDPLocationCollectionManager.register(con, idy, new OnResultListener() {
|
||||
// Identity idy=new Identity();
|
||||
// //企业代码
|
||||
// idy.setEnterpriseCode(BuildConfig.isTest?ENTERPRISE_CODE_TEXT:ENTERPRISE_CODE);
|
||||
// //企业app的身份码
|
||||
// idy.setAppIdentity(BuildConfig.isTest?APP_IDENTITY_TEXT:APP_IDENTITY);
|
||||
// //企业app验证码
|
||||
// idy.setAppKey(BuildConfig.isTest?APP_KEY_TEXT:APP_KEY);
|
||||
// //司机身份证
|
||||
// idy.setDriverIdentity(auth.getData().getIdcard());
|
||||
// //idy.setDriverIdentity("410725198311042012");
|
||||
// MDPLocationCollectionManager.register(con, idy, new OnResultListener() {
|
||||
// @Override
|
||||
// public void onSuccess() {
|
||||
// Log.e("--success--","验证成功");
|
||||
// getFq(con);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(java.lang.String s, java.lang.String s1) {
|
||||
// Log.e("--error--",s+s1+"");
|
||||
// new MessageUtils().showCenMessage(con,s1);
|
||||
// }
|
||||
// });
|
||||
|
||||
NewLJUtils.getInstance().getToken(con, new OnGDResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("--success--","验证成功");
|
||||
getFq(con);
|
||||
NewLJUtils.getInstance().confirmInvoice(con, new OnGDResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(java.lang.String s, java.lang.String s1) {
|
||||
Log.e("--error--",s+s1+"");
|
||||
new MessageUtils().showCenMessage(con,s1);
|
||||
public void onFailure(String var1, String var2) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -133,31 +158,69 @@ public class ALProcess {
|
||||
|
||||
public static void verification(Context con,Handler hd){
|
||||
DriverAuthDataBean auth= AuthParts.getAuth(con);
|
||||
Identity idy=new Identity();
|
||||
//企业代码
|
||||
idy.setEnterpriseCode(BuildConfig.isTest?ENTERPRISE_CODE_TEXT:ENTERPRISE_CODE);
|
||||
//企业app的身份码
|
||||
idy.setAppIdentity(BuildConfig.isTest?APP_IDENTITY_TEXT:APP_IDENTITY);
|
||||
//企业app验证码
|
||||
idy.setAppKey(BuildConfig.isTest?APP_KEY_TEXT:APP_KEY);
|
||||
//司机身份证
|
||||
idy.setDriverIdentity(auth.getData().getIdcard());
|
||||
//idy.setDriverIdentity("410725198311042012");
|
||||
MDPLocationCollectionManager.register(con, idy, new OnResultListener() {
|
||||
if (auth==null){
|
||||
return;
|
||||
}
|
||||
// Identity idy=new Identity();
|
||||
// //企业代码
|
||||
// idy.setEnterpriseCode(BuildConfig.isTest?ENTERPRISE_CODE_TEXT:ENTERPRISE_CODE);
|
||||
// //企业app的身份码
|
||||
// idy.setAppIdentity(BuildConfig.isTest?APP_IDENTITY_TEXT:APP_IDENTITY);
|
||||
// //企业app验证码
|
||||
// idy.setAppKey(BuildConfig.isTest?APP_KEY_TEXT:APP_KEY);
|
||||
// //司机身份证
|
||||
// idy.setDriverIdentity(auth.getData().getIdcard());
|
||||
// //idy.setDriverIdentity("410725198311042012");
|
||||
// MDPLocationCollectionManager.register(con, idy, new OnResultListener() {
|
||||
// @Override
|
||||
// public void onSuccess() {
|
||||
// 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().searchDriver(con, auth.getData().getIdcard(), new OnGDDownloadResultListener(){
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
public void onSuccess(String var1) {
|
||||
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);
|
||||
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) {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,40 @@
|
||||
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;
|
||||
}
|
||||
}
|
@ -0,0 +1,135 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
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;
|
||||
}
|
||||
}
|
@ -0,0 +1,109 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
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;
|
||||
}
|
||||
}
|
@ -0,0 +1,118 @@
|
||||
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,11 +4,23 @@ package com.arpa.hndahesudintocctmsdriver.request.net;
|
||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.UserBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.LoginRegInputBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.InvoiceBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.InvoicesBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.LjTokenBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.PickupBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.ShipmentStatusBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.UpimgBean;
|
||||
import com.dahe.mylibrary.net.CommonResponseBean;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.PUT;
|
||||
import retrofit2.http.Path;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
/**
|
||||
@ -17,7 +29,7 @@ import retrofit2.http.Query;
|
||||
|
||||
public interface Api {
|
||||
|
||||
String BASE_URL = BuildConfig.BASE_URL;
|
||||
String BASE_URL = BuildConfig.isTest? "http://api.kehui56.cn/api/v1/":"https://api.kehui56.com/api/v1/";
|
||||
|
||||
|
||||
//获取版本
|
||||
@ -26,5 +38,119 @@ public interface Api {
|
||||
// @POST(BASE_URL+"/common/register")
|
||||
// Observable<CommonResponseBean> log(@Body LoginRegInputBean bean);
|
||||
|
||||
@POST(BASE_URL+"openapi/enterprises/login")
|
||||
Observable<CommonResponseBean> getToken(@Body LjTokenBean bean);
|
||||
|
||||
@POST(BASE_URL+"openapi/enterprises/login")
|
||||
Call<HashMap<String, String>> getRefreshToken(@Body LjTokenBean bean);
|
||||
|
||||
|
||||
/**
|
||||
* 刷新token
|
||||
* @return
|
||||
*/
|
||||
@POST(BASE_URL+"openapi/enterprises/refresh-token/{refreshToken}")
|
||||
Observable<CommonResponseBean> refreshToken(@Path("refreshToken") String refreshToken);
|
||||
|
||||
/**
|
||||
* 运单提货
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@POST(BASE_URL+"openapi/shipments/pickup")
|
||||
Observable<CommonResponseBean> pickup(@Body PickupBean bean);
|
||||
|
||||
|
||||
/**
|
||||
* 运单卸货
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@POST(BASE_URL+"openapi/shipments/unload")
|
||||
Observable<CommonResponseBean> unload(@Body PickupBean bean);
|
||||
|
||||
|
||||
/**
|
||||
* 运单签收
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@POST(BASE_URL+"openapi/shipments/sign")
|
||||
Observable<CommonResponseBean> sign(@Body PickupBean bean);
|
||||
|
||||
|
||||
/**
|
||||
* 运单回单
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@POST(BASE_URL+"openapi/shipments/pod")
|
||||
Observable<CommonResponseBean> pod(@Body PickupBean bean);
|
||||
|
||||
|
||||
/**
|
||||
* 运单提货照片上传
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@POST(BASE_URL+"openapi/shipments/uploadPickupImage")
|
||||
Observable<CommonResponseBean> uploadPickupImage(@Body UpimgBean bean);
|
||||
|
||||
|
||||
/**
|
||||
* 运单卸货照片上传
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@POST(BASE_URL+"openapi/shipments/uploadUnloadImage")
|
||||
Observable<CommonResponseBean> uploadUnloadImage(@Body UpimgBean bean);
|
||||
|
||||
|
||||
/**
|
||||
* 运单回单照片上传
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@POST(BASE_URL+"openapi/shipments/uploadPODImage")
|
||||
Observable<CommonResponseBean> uploadPODImage(@Body UpimgBean bean);
|
||||
|
||||
|
||||
/**
|
||||
* 同意发票申请
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@PUT(BASE_URL+"openapi/confirmInvoice")
|
||||
Observable<CommonResponseBean> confirmInvoice(@Body InvoiceBean bean);
|
||||
|
||||
/**
|
||||
* 待同意发票列表获取
|
||||
* @param enterpriseCodeParam
|
||||
* @param driverIdentification
|
||||
* @param currentPage
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@GET(BASE_URL+"openapi/getInvoices")
|
||||
Observable<CommonResponseBean<InvoicesBean>> getInvoices(@Query("enterpriseCodeParam") String enterpriseCodeParam,
|
||||
@Query("driverIdentification") String driverIdentification,
|
||||
@Query("currentPage") int currentPage,
|
||||
@Query("pageSize") int pageSize);
|
||||
|
||||
|
||||
/**
|
||||
* 获取运单状态
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@POST(BASE_URL+"/openapi/getShipmentStatus")
|
||||
Observable<CommonResponseBean> getShipmentStatus(@Body ShipmentStatusBean bean);
|
||||
|
||||
@POST(BASE_URL+"/openapi/shipments/getPODImageNames")
|
||||
Observable<CommonResponseBean> getPODImageNames(@Body ShipmentStatusBean bean);
|
||||
|
||||
|
||||
@GET(BASE_URL+"/openapi/drivers")
|
||||
Observable<CommonResponseBean> searchDriver(@Query("identityNo") String identityNo);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,114 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.request.net
|
||||
|
||||
import okhttp3.Interceptor
|
||||
import okhttp3.Request
|
||||
import okio.IOException
|
||||
import retrofit2.Response
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
|
||||
/**
|
||||
* @ClassName ApiInterceptor
|
||||
* @Author john
|
||||
* @Date 2024/11/29 17:05
|
||||
* @Description TODO
|
||||
*/
|
||||
class ApiInterceptor : Interceptor {
|
||||
|
||||
// 需要验证token的接口的路径集合
|
||||
// private val checkTokenInterface = arrayListOf(
|
||||
// "/example/user/info,
|
||||
// "/example/user/info/edit"
|
||||
// )
|
||||
|
||||
// 是否正在刷新token
|
||||
// 使用AtomicBoolean,确保多线程中获取的值一致
|
||||
// private var refreshingToken = AtomicBoolean(false)
|
||||
//
|
||||
// private val authHeaderKey = "token-key"
|
||||
//
|
||||
// // 当前token
|
||||
// private var currentToken = "tokenValue"
|
||||
|
||||
// override fun intercept(chain: Interceptor.Chain): Response {
|
||||
// 根据接口路径判断是否需要验证token
|
||||
// val checkToken = checkTokenInterface.contains(chain.request().url.encodedPath)
|
||||
// // 需要验证token则添加请求头,不需要则保持原样
|
||||
// var request = if (checkToken) {
|
||||
// chain.request().newBuilder()
|
||||
// .addHeader(authHeaderKey, currentToken)
|
||||
// .build()
|
||||
// } else {
|
||||
// chain.request()
|
||||
// }
|
||||
// // 获取响应
|
||||
// var response = chain.proceed(request)
|
||||
// if (checkToken) {
|
||||
// // 需要验证token,处理响应,判断token是否过期
|
||||
// response.body?.let { responseBody ->
|
||||
// try {
|
||||
// if (判断token过期的条件) {
|
||||
// runBlocking {
|
||||
// // 请求头中的token与currentToken仍然一样则需要刷新token
|
||||
// // 确保多线程中不会重复刷新
|
||||
// if (request.header(authHeaderKey) == currentToken){
|
||||
// // 标记为正在刷新token
|
||||
// if (refreshingToken.compareAndSet(false, true)) {
|
||||
// refreshToken(chain).takeIf { it.isNotEmpty() && it.isNotBlank() }?.let { newToken ->
|
||||
// // 保存newToken
|
||||
// currentToken = newToken
|
||||
// }
|
||||
// // 标记为刷新token已结束
|
||||
// refreshingToken.set(false)
|
||||
// }
|
||||
// }
|
||||
// // async{}.await()会等待方法块内的代码执行完毕。
|
||||
// // 等到refreshingToken为false时才会执行后续代码。
|
||||
// if (async { stopRefreshingToken() }.await()) {
|
||||
// // 携带newToken执行原请求获取响应
|
||||
// response = chain.proceed(chain.request().newBuilder()
|
||||
// .addHeader(authHeaderKey, currentToken)
|
||||
// .build())
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// } catch (e: Exception) {
|
||||
// e.printStackTrace()
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// // 返回最终的响应结果。
|
||||
// // 刷新token也可能失败,此时返回原响应,可以让用户重新登录。
|
||||
// return response
|
||||
// }
|
||||
//
|
||||
// private fun refreshToken(chain: Interceptor.Chain): String {
|
||||
// // 创建刷新token的请求
|
||||
// val refreshTokenRequest = Request.Builder()
|
||||
// .url("refresh token url")
|
||||
// .addHeader(authHeaderKey, currentToken)
|
||||
// .get()
|
||||
// .build()
|
||||
// return try {
|
||||
// // 获取响应并解析获得新token
|
||||
// val refreshTokenResponse = chain.proceed(refreshTokenRequest)
|
||||
// refreshTokenResponse.token
|
||||
// } catch (e: IOException) {
|
||||
// // 失败时返回空字符串
|
||||
// ""
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private suspend fun stopRefreshingToken(): Boolean {
|
||||
// return if (refreshingToken.get()) {
|
||||
// // 仍在刷新token中,延迟1秒后再次执行此方法
|
||||
// delay(1000)
|
||||
// stopRefreshingToken()
|
||||
// } else {
|
||||
// true
|
||||
// }
|
||||
// }
|
||||
override fun intercept(chain: Interceptor.Chain): okhttp3.Response {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ public class BaseObserver<T> implements Observer<CommonResponseBean<T>> {
|
||||
|
||||
@Override
|
||||
public void onNext(CommonResponseBean<T> tCommonResponseBean) {
|
||||
if (200==tCommonResponseBean.getCode()) {
|
||||
if ("0".equals(tCommonResponseBean.getCode())) {
|
||||
mRxHttpCallBack.onSuccess(tCommonResponseBean);
|
||||
} else {
|
||||
mRxHttpCallBack.onCodeError(mContext, tCommonResponseBean);
|
||||
|
@ -2,7 +2,6 @@ package com.arpa.hndahesudintocctmsdriver.request.net;
|
||||
|
||||
|
||||
import com.dahe.mylibrary.CommonBaseLibrary;
|
||||
import com.dahe.mylibrary.net.JsonInterceptor;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
@ -0,0 +1,119 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.request.net;
|
||||
|
||||
import static com.dahe.mylibrary.utils.BaseSPUtils.NEW_LJ_TOKEN;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
@ -27,9 +29,10 @@ public class RequestHeadInterceptor implements Interceptor {
|
||||
@Override
|
||||
public Response intercept(Chain chain) throws IOException {
|
||||
Request.Builder builder = chain.request().newBuilder();
|
||||
if (!TextUtils.isEmpty(SPUtil.getSP(App.getApp(), LoginActivity.USER,LoginActivity.USER_TOKEN))) {
|
||||
String token = SPUtils.get(App.getApp(), NEW_LJ_TOKEN, "").toString();
|
||||
if (!TextUtils.isEmpty(token)) {
|
||||
// builder.addHeader("Authorization", SPUtils.getUserInfo(App.getApp()).getToken());
|
||||
builder.addHeader("Authorization", SPUtil.getSP(App.getApp(), LoginActivity.USER,LoginActivity.USER_TOKEN));
|
||||
builder.addHeader("token", token);
|
||||
}
|
||||
Request request = builder
|
||||
.addHeader("versionCode", AppUtils.getAppVersionCode() + "")
|
||||
|
@ -11,6 +11,7 @@ import android.view.Window;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.UiAuxiliary;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.NewLJUtils;
|
||||
import com.dahe.mylibrary.net.CommonResponseBean;
|
||||
import com.dahe.mylibrary.net.ResultException;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
@ -86,14 +87,15 @@ public abstract class RxHttpCallBack<T> {
|
||||
dialog.dismiss();
|
||||
|
||||
}
|
||||
if (t.getCode() == 401) {
|
||||
UiAuxiliary.delLogin(mContext);
|
||||
Intent intent = new Intent(mContext, MainActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
mContext.startActivity(intent);
|
||||
ToastUtils.showToast(mContext,"您的账号再异地登录,请重新登录");
|
||||
if ("401".equals(t.getCode())) {
|
||||
// NewLJUtils.getInstance().refreshToken(mContext);
|
||||
// UiAuxiliary.delLogin(mContext);
|
||||
// Intent intent = new Intent(mContext, MainActivity.class);
|
||||
// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
// mContext.startActivity(intent);
|
||||
// ToastUtils.showToast(mContext,"您的账号再异地登录,请重新登录");
|
||||
}else{
|
||||
ToastUtils.showToast(mContext,t.getMsg());
|
||||
// ToastUtils.showToast(mContext,t.getMessage());
|
||||
}
|
||||
|
||||
// if (t.getMessage().getMsg_code() == 100 && SPUtils.hasUserInfo(mContext)) {
|
||||
|
@ -460,6 +460,7 @@ public class HomeFragment extends BaseFragment {
|
||||
});
|
||||
btn_update.setOnClickListener(v -> {
|
||||
getRequest();
|
||||
refreshWaybills();
|
||||
});
|
||||
home_top.setOnClickListener(v -> {
|
||||
if (!UiAuxiliary.isLogin(con)) {
|
||||
@ -520,6 +521,7 @@ public class HomeFragment extends BaseFragment {
|
||||
Log.e("下拉刷新", "pps");
|
||||
keys = true;
|
||||
getRequest();
|
||||
refreshWaybills();
|
||||
});
|
||||
}
|
||||
|
||||
@ -784,6 +786,7 @@ public class HomeFragment extends BaseFragment {
|
||||
*/
|
||||
public void initMap() {
|
||||
getRequest();
|
||||
refreshWaybills();
|
||||
}
|
||||
|
||||
private CustomDialog customDialog;
|
||||
@ -796,18 +799,18 @@ public class HomeFragment extends BaseFragment {
|
||||
// customDialog=new CustomDialog(con,"加载中...");
|
||||
// customDialog.show();
|
||||
ur.upApp();
|
||||
hyr.getHuoYuan(1, 100);
|
||||
// hyr.getHuoYuan(1, 100);
|
||||
ur.getImage(1);
|
||||
WalletRequest qr = new WalletRequest(con, hd);
|
||||
|
||||
if (UiAuxiliary.isLogin(con)) {
|
||||
int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
||||
// int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
||||
ur.User();
|
||||
// if (!OneDayShowUtils.getInstance().todayIsShow(con)) {
|
||||
// qr.getBankCardList();
|
||||
// }
|
||||
ur.getDriverExpire();
|
||||
hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
||||
// hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
||||
// hyr.startOrder(0);
|
||||
//获取权限 应用市场审核不通过
|
||||
ur.driverAuthData();
|
||||
@ -1177,6 +1180,7 @@ public class HomeFragment extends BaseFragment {
|
||||
.permissions(Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.ACCESS_FINE_LOCATION,
|
||||
Manifest.permission.ACCESS_BACKGROUND_LOCATION,
|
||||
Manifest.permission.CAMERA,
|
||||
Manifest.permission.ACCESS_COARSE_LOCATION)
|
||||
.request((allGranted, grantedList, deniedList) -> {
|
||||
@ -1300,26 +1304,29 @@ public class HomeFragment extends BaseFragment {
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
// ToastUtils.showToast(con,"onstart");
|
||||
// refreshLayout.autoRefresh();
|
||||
refreshWaybills();
|
||||
}
|
||||
|
||||
private void refreshWaybills() {
|
||||
// if (UiAuxiliary.isLogin(con)) {
|
||||
// int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
||||
// hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
||||
// }
|
||||
hyr.getHuoYuan(1, 100);
|
||||
if (UiAuxiliary.isLogin(con)) {
|
||||
int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
||||
hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void processResult(HomeWaybillEvent home) {
|
||||
if (home.getMessage() == 1) {
|
||||
int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
||||
hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
||||
hyr.getHuoYuan(1, 100);
|
||||
} else {
|
||||
int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
||||
hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
||||
}
|
||||
// if (home.getMessage() == 1) {
|
||||
// int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
||||
// hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
||||
// hyr.getHuoYuan(1, 100);
|
||||
// } else {
|
||||
// int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
||||
// hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
@ -27,6 +27,8 @@ import com.alct.mdp.model.Location;
|
||||
import com.alct.mdp.model.ShipmentStatusEnum;
|
||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.GDImage;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.GDLocation;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.WaybillStatusBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeWaybillEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
@ -35,6 +37,7 @@ import com.arpa.hndahesudintocctmsdriver.request.bean.TrackInputBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.BitmapUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.NewLJUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||
@ -43,6 +46,8 @@ import com.arpa.hndahesudintocctmsdriver.util.location.LocationUtil;
|
||||
import com.baidu.mapapi.model.LatLng;
|
||||
import com.baidu.mapapi.utils.CoordinateConverter;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.dahe.mylibrary.callback.OnGDDownloadResultListener;
|
||||
import com.dahe.mylibrary.callback.OnGDResultListener;
|
||||
import com.dahe.mylibrary.utils.ActivityUtils;
|
||||
import com.dahe.mylibrary.utils.ImageLoader;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
@ -134,6 +139,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
CacheGroup.cacheList.remove("upload");
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("genzong") != null) {
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("genzong"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
@ -143,6 +149,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
CacheGroup.cacheList.remove("genzong");
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("waybillStatus") != null) {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
@ -474,30 +481,54 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
Log.e("--装货信息", gson.toJson(lub));
|
||||
if (locationKey) {//高德定位
|
||||
if (keys) {
|
||||
MDPLocationCollectionManager.getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnDownloadResultListener() {
|
||||
@Override
|
||||
public void onSuccess(Object o) {
|
||||
|
||||
String string = o.toString();
|
||||
if (string.equals("PICKUPED")) {//安联装货,单平台未装货
|
||||
NewLJUtils.getInstance().getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnGDDownloadResultListener() {
|
||||
@Override
|
||||
public void onSuccess(String var1) {
|
||||
String string = var1;
|
||||
if (string.equals("30")) {//安联装货,单平台未装货
|
||||
isFinish = true;
|
||||
//平台确认装货
|
||||
hyr.loading(lub);
|
||||
} else {
|
||||
nfc();
|
||||
// nfc();
|
||||
loadInfo();
|
||||
}
|
||||
upLocation(lgdu.getLatitude()+"",lgdu.getLongitude()+"",sob.getData().getShippingNoteNumber());
|
||||
upLocation(lgdu.getLatitude() + "", lgdu.getLongitude() + "",sob.getData().getShippingNoteNumber());
|
||||
// NewLJUtils.getInstance().startLocationService(ShangChuangImgActivity.this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
public void onFailure(String var1, String var2) {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showToast(con, s1);
|
||||
ToastUtils.showToast(con, var2);
|
||||
}
|
||||
});
|
||||
// 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();
|
||||
@ -530,10 +561,11 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
Log.e("--卸货信息", gson.toJson(lub));
|
||||
if (locationKey) {
|
||||
if (keys) {
|
||||
MDPLocationCollectionManager.getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnDownloadResultListener() {
|
||||
|
||||
NewLJUtils.getInstance().getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnGDDownloadResultListener() {
|
||||
@Override
|
||||
public void onSuccess(Object o) {
|
||||
if (o.toString().equals("UNLOADED")) {//安联装货,单平台未装货
|
||||
public void onSuccess(String var1) {
|
||||
if (var1.equals("40")) {//安联装货,单平台未装货
|
||||
//卸货状态-平台
|
||||
isFinish = true;
|
||||
hyr.dischargeCargo(lub);
|
||||
@ -541,18 +573,41 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
nfc();
|
||||
uploadInfo();
|
||||
}
|
||||
upLocation(lgdu.getLatitude()+"",lgdu.getLongitude()+"",sob.getData().getShippingNoteNumber());
|
||||
upLocation(lgdu.getLatitude() + "", lgdu.getLongitude() + "",sob.getData().getShippingNoteNumber());
|
||||
// NewLJUtils.getInstance().stopLocationService();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
public void onFailure(String var1, String var2) {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showToast(con, s1);
|
||||
ToastUtils.showToast(con, var2);
|
||||
}
|
||||
});
|
||||
|
||||
// MDPLocationCollectionManager.getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnDownloadResultListener() {
|
||||
// @Override
|
||||
// public void onSuccess(Object o) {
|
||||
// if (o.toString().equals("UNLOADED")) {//安联装货,单平台未装货
|
||||
// //卸货状态-平台
|
||||
// isFinish = true;
|
||||
// hyr.dischargeCargo(lub);
|
||||
// } else {
|
||||
// nfc();
|
||||
// uploadInfo();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(String s, String s1) {
|
||||
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
// customDialog.dismiss();
|
||||
// }
|
||||
// ToastUtils.showToast(con, s1);
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
// nfc();
|
||||
// uploadInfo();
|
||||
@ -589,8 +644,8 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
if (locationKey) {
|
||||
if (index == 2 && keys) {
|
||||
up_trafficSign();
|
||||
up_trafficReceipt();
|
||||
receipt_image();
|
||||
// up_trafficReceipt();
|
||||
// receipt_image();
|
||||
}
|
||||
hyr.receipt(urib);
|
||||
} else {
|
||||
@ -637,7 +692,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
//上传安联-签收
|
||||
public void up_trafficSign() {
|
||||
//安联
|
||||
Location l = new Location();
|
||||
GDLocation l = new GDLocation();
|
||||
l.setBaiduLongitude(latLng.longitude);
|
||||
l.setBaiduLatitude(latLng.latitude);
|
||||
l.setLocation(lgdu.getAddress());
|
||||
@ -661,56 +716,86 @@ 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
|
||||
public void onSuccess() {
|
||||
NewLJUtils.getInstance().stopLocationService();
|
||||
up_trafficReceipt();
|
||||
receipt_image();
|
||||
Log.e("上报安联", "签收成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(签收):", s + s1);
|
||||
public void onFailure(String var1, String var2) {
|
||||
Log.e("上报安联失败(签收):", var1 + var2);
|
||||
}
|
||||
});
|
||||
// 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() {
|
||||
//安联
|
||||
Location l = new Location();
|
||||
GDLocation l = new GDLocation();
|
||||
l.setBaiduLongitude(latLng.longitude);
|
||||
l.setBaiduLatitude(latLng.latitude);
|
||||
l.setLocation(lgdu.getAddress());
|
||||
l.setTime(Timer.getTimerT());
|
||||
MDPLocationCollectionManager.pod(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||
|
||||
NewLJUtils.getInstance().pod(con, sob.getData().getShippingNoteNumber(), l, new OnGDResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "回单上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(回单):", s + s1);
|
||||
public void onFailure(String var1, String var2) {
|
||||
Log.e("上报安联失败(回单):", var1 + var2);
|
||||
}
|
||||
|
||||
});
|
||||
// MDPLocationCollectionManager.pod(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||
//
|
||||
// @Override
|
||||
// public void onSuccess() {
|
||||
// Log.e("上报安联", "回单上传成功");
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(String s, String s1) {
|
||||
// Log.e("上报安联失败(回单):", s + s1);
|
||||
// }
|
||||
//
|
||||
// });
|
||||
}
|
||||
|
||||
public void up_image_z() {
|
||||
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||
File file = new File(path);
|
||||
Image image = new Image();
|
||||
GDImage image = new GDImage();
|
||||
String base = BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||
image.setFileExt(FileUtil.lastName(file));
|
||||
image.setFileName(FileUtil.fileName(file));
|
||||
image.setImageTakenDate(Timer.getTimerT());
|
||||
image.setTime(Timer.getTimerT());
|
||||
image.setBaiduLongitude(latLng.longitude);
|
||||
image.setBaiduLatitude(latLng.latitude);
|
||||
image.setLocation(lgdu.getAddress());
|
||||
MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
||||
|
||||
String json = new Gson().toJson(image);
|
||||
|
||||
NewLJUtils.getInstance().uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new OnGDResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
@ -723,30 +808,50 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
|
||||
@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 onFailure(String var1, String var2) {
|
||||
Log.e("上报安联失败(装货照片):", var1 + var2);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
||||
//
|
||||
// @Override
|
||||
// public void onSuccess() {
|
||||
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
// customDialog.dismiss();
|
||||
// }
|
||||
// EventBus.getDefault().post(new HomeWaybillEvent());
|
||||
// Log.e("上报安联", "装货照片上传成功");
|
||||
// Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
// finish();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(String s, String s1) {
|
||||
// Log.e("上报安联失败(装货照片):", s + s1);
|
||||
//// SPUtil.insSP(con,"make","装货",sob.getData().getShippingNoteNumber());
|
||||
//// SPUtil.insSP(con,"make","装货-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||
//// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||
//// startService(serviceIn);
|
||||
// }
|
||||
//
|
||||
// });
|
||||
}
|
||||
|
||||
public void up_image() {
|
||||
File file = new File(path);
|
||||
Image image = new Image();
|
||||
GDImage image = new GDImage();
|
||||
String base = BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||
image.setFileExt(FileUtil.lastName(file));
|
||||
image.setFileName(FileUtil.fileName(file));
|
||||
image.setImageTakenDate(Timer.getTimerT());
|
||||
image.setTime(Timer.getTimerT());
|
||||
image.setBaiduLongitude(latLng.longitude);
|
||||
image.setBaiduLatitude(latLng.latitude);
|
||||
image.setLocation(lgdu.getAddress());
|
||||
MDPLocationCollectionManager.uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
||||
|
||||
NewLJUtils.getInstance().uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new OnGDResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
@ -759,34 +864,56 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(卸货照片):", s + s1);
|
||||
public void onFailure(String var1, String var2) {
|
||||
Log.e("上报安联失败(卸货照片):", var1 + var2);
|
||||
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);
|
||||
}
|
||||
|
||||
});
|
||||
// MDPLocationCollectionManager.uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
||||
//
|
||||
// @Override
|
||||
// public void onSuccess() {
|
||||
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
// customDialog.dismiss();
|
||||
// }
|
||||
// EventBus.getDefault().post(new HomeWaybillEvent());
|
||||
// Log.e("上报安联", "卸货照片上传成功");
|
||||
// Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
// finish();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(String s, String s1) {
|
||||
// Log.e("上报安联失败(卸货照片):", s + s1);
|
||||
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
// customDialog.dismiss();
|
||||
// }
|
||||
//// SPUtil.insSP(con,"make","卸货",sob.getData().getShippingNoteNumber());
|
||||
//// SPUtil.insSP(con,"make","卸货-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||
//// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||
//// startService(serviceIn);
|
||||
// }
|
||||
//
|
||||
// });
|
||||
}
|
||||
|
||||
public void receipt_image() {
|
||||
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||
File file = new File(path);
|
||||
Image image = new Image();
|
||||
GDImage image = new GDImage();
|
||||
String base = BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||
image.setFileExt(FileUtil.lastName(file));
|
||||
image.setFileName(FileUtil.fileName(file));
|
||||
image.setImageTakenDate(Timer.getTimerT());
|
||||
image.setTime(Timer.getTimerT());
|
||||
image.setBaiduLongitude(latLng.longitude);
|
||||
image.setBaiduLatitude(latLng.latitude);
|
||||
image.setLocation(lgdu.getAddress());
|
||||
MDPLocationCollectionManager.uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
|
||||
|
||||
NewLJUtils.getInstance().uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new OnGDResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
@ -800,15 +927,34 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
|
||||
@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 onFailure(String var1, String var2) {
|
||||
Log.e("上报安联失败(回单照片):", var1 + var2);
|
||||
}
|
||||
|
||||
});
|
||||
// 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
|
||||
@ -847,12 +993,13 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
private void loadInfo() {
|
||||
//安联
|
||||
if (sob.getData().getReportAlct() == 1) {
|
||||
Location l = new Location();
|
||||
GDLocation l = new GDLocation();
|
||||
l.setBaiduLongitude(latLng.longitude);
|
||||
l.setBaiduLatitude(latLng.latitude);
|
||||
l.setLocation(lgdu.getAddress());
|
||||
l.setTime(Timer.getTimerT());
|
||||
MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||
|
||||
NewLJUtils.getInstance().pickUp(con, sob.getData().getShippingNoteNumber(), l, new OnGDResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "装货上传成功");
|
||||
@ -860,6 +1007,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
if (sob.getData().getReport() == 1) {
|
||||
JTTProcess.start(con, sob, "");
|
||||
}
|
||||
NewLJUtils.getInstance().startLocationService(ShangChuangImgActivity.this);
|
||||
//装货状态
|
||||
hyr.loading(lub);
|
||||
//装货照片
|
||||
@ -867,14 +1015,39 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(装货):", s + s1);
|
||||
public void onFailure(String var1, String var2) {
|
||||
Log.e("上报安联失败(装货):", var1 + var2);
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
new MessageUtils().showCenMessage(con, s1);
|
||||
new MessageUtils().showCenMessage(con, var2);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// 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);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
}
|
||||
@ -886,13 +1059,14 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
|
||||
//安联
|
||||
if (sob.getData().getReportAlct() == 1) {
|
||||
Location l = new Location();
|
||||
GDLocation l = new GDLocation();
|
||||
l.setBaiduLongitude(latLng.longitude);
|
||||
l.setBaiduLatitude(latLng.latitude);
|
||||
l.setLocation(lgdu.getAddress());
|
||||
l.setTime(Timer.getTimerT());
|
||||
Log.e("-安联卸货信息-", gson.toJson(l));
|
||||
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||
|
||||
NewLJUtils.getInstance().unload(con, sob.getData().getShippingNoteNumber(), l, new OnGDResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "卸货上传成功");
|
||||
@ -900,6 +1074,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
if (sob.getData().getReport() == 1) {
|
||||
JTTProcess.stop(con, sob, "");
|
||||
}
|
||||
|
||||
//卸货状态-平台
|
||||
hyr.dischargeCargo(lub);
|
||||
//卸货照片-安联
|
||||
@ -907,14 +1082,37 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(卸货):", s + s1);
|
||||
public void onFailure(String var1, String var2) {
|
||||
Log.e("上报安联失败(卸货):", var1 + var2);
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
new MessageUtils().showCenMessage(con, s1);
|
||||
new MessageUtils().showCenMessage(con, var2);
|
||||
}
|
||||
});
|
||||
// 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);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
|
@ -32,6 +32,7 @@ import com.arpa.hndahesudintocctmsdriver.request.net.BaseObserver;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.net.DataManager;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.net.RxHttpCallBack;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.web.WebOnlyOneActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.NewLJUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickHelper;
|
||||
import com.dahe.mylibrary.net.CommonResponseBean;
|
||||
@ -108,6 +109,8 @@ public class LoginActivity extends BaseActivity {
|
||||
Log.e("--登录信息--", new Gson().toJson(loginBean));
|
||||
AppInfoBean appInfoBean = new AppInfoBean();
|
||||
if (loginBean.getCode() == 200) {
|
||||
//获取新路交token
|
||||
NewLJUtils.getInstance().getToken(con);
|
||||
SPUtil.insSP(con, USER, USER_TOKEN, loginBean.getData().getToken());
|
||||
SPUtil.insSP(con, USER, USER_UNAME, loginBean.getData().getUname());
|
||||
SPUtil.insSP(con, USER, USER_RNAME, loginBean.getData().getRname());
|
||||
|
@ -0,0 +1,764 @@
|
||||
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 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());
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
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;
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
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);
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
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,5 +1,7 @@
|
||||
package com.dahe.mylibrary.net;
|
||||
|
||||
import com.dahe.mylibrary.bean.DriverBean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
@ -8,13 +10,59 @@ import java.io.Serializable;
|
||||
|
||||
public class CommonResponseBean<T> implements Serializable {
|
||||
private T data;
|
||||
private int code;
|
||||
private String code;
|
||||
private String info;
|
||||
private String msg;
|
||||
private String message;
|
||||
private String url;
|
||||
private String fileName;
|
||||
private String token;
|
||||
private String expiryIn;
|
||||
private String statusCode;
|
||||
private boolean success;
|
||||
|
||||
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() {
|
||||
return data;
|
||||
}
|
||||
@ -23,11 +71,11 @@ public class CommonResponseBean<T> implements Serializable {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@ public class BaseSPUtils {
|
||||
public static final String USER_INFO_KEY = "user_info_key";
|
||||
public static final String NET_SERVICE_TEST = "net_service_test";
|
||||
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 FIRST_OPEN = "first_open";
|
||||
public static final String KEY_PRIVACY_AGREEMENT = "privacy_agreement";
|
||||
|
Loading…
Reference in New Issue
Block a user