新路交部分接口2
This commit is contained in:
parent
ca76fd4cc3
commit
1b40375c3c
@ -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,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;
|
||||
}
|
||||
}
|
@ -4,14 +4,17 @@ 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.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 io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.PUT;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
/**
|
||||
@ -94,5 +97,23 @@ public interface Api {
|
||||
*/
|
||||
@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 bean
|
||||
* @return
|
||||
*/
|
||||
@POST(BASE_URL+"/openapi/getShipmentStatus")
|
||||
Observable<CommonResponseBean> getShipmentStatus(@Body ShipmentStatusBean bean);
|
||||
}
|
||||
|
||||
|
@ -6,8 +6,11 @@ import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.constant.NewLJConstant;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.InvoiceBean;
|
||||
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;
|
||||
@ -61,6 +64,7 @@ public class NewLJUtils {
|
||||
|
||||
/**
|
||||
* 运单提货
|
||||
*
|
||||
* @param ctx
|
||||
* @param shipmentCode
|
||||
* @param location
|
||||
@ -93,4 +97,257 @@ public class NewLJUtils {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 运单卸货
|
||||
*
|
||||
* @param ctx
|
||||
* @param shipmentCode
|
||||
* @param location
|
||||
*/
|
||||
public void unload(Context ctx, String shipmentCode, PickupBean.LocationDTO location) {
|
||||
if (TextUtils.isEmpty(shipmentCode)) {
|
||||
ToastUtils.showToast(ctx, "运单号不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Double.isNaN(location.getBaiduLatitude()) || Double.isNaN(location.getBaiduLongitude())) {
|
||||
ToastUtils.showToast(ctx, "经纬度不能为空");
|
||||
return;
|
||||
}
|
||||
location.setTime(TimeUtil.getNowString(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.getDefault())));
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 运单签收
|
||||
* @param ctx
|
||||
* @param shipmentCode
|
||||
* @param location
|
||||
*/
|
||||
public void sign(Context ctx, String shipmentCode, PickupBean.LocationDTO location) {
|
||||
if (TextUtils.isEmpty(shipmentCode)) {
|
||||
ToastUtils.showToast(ctx, "运单号不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Double.isNaN(location.getBaiduLatitude()) || Double.isNaN(location.getBaiduLongitude())) {
|
||||
ToastUtils.showToast(ctx, "经纬度不能为空");
|
||||
return;
|
||||
}
|
||||
location.setTime(TimeUtil.getNowString(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.getDefault())));
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 运单回单
|
||||
* @param ctx
|
||||
* @param shipmentCode
|
||||
* @param location
|
||||
*/
|
||||
public void pod(Context ctx, String shipmentCode, PickupBean.LocationDTO location) {
|
||||
if (TextUtils.isEmpty(shipmentCode)) {
|
||||
ToastUtils.showToast(ctx, "运单号不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Double.isNaN(location.getBaiduLatitude()) || Double.isNaN(location.getBaiduLongitude())) {
|
||||
ToastUtils.showToast(ctx, "经纬度不能为空");
|
||||
return;
|
||||
}
|
||||
location.setTime(TimeUtil.getNowString(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.getDefault())));
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 运单提货照片上传
|
||||
* @param ctx
|
||||
* @param shipmentCode
|
||||
* @param imageDTO
|
||||
*/
|
||||
public void uploadPickupImage(Context ctx, String shipmentCode, UpimgBean.ImageDTO imageDTO) {
|
||||
if (TextUtils.isEmpty(shipmentCode)) {
|
||||
ToastUtils.showToast(ctx, "运单号不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if (TextUtils.isEmpty(imageDTO.getFileName())) {
|
||||
ToastUtils.showToast(ctx, "照片不能为空");
|
||||
return;
|
||||
}
|
||||
imageDTO.setTime(TimeUtil.getNowString(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.getDefault())));
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 运单卸货照片上传
|
||||
* @param ctx
|
||||
* @param shipmentCode
|
||||
* @param imageDTO
|
||||
*/
|
||||
public void uploadUnloadImage(Context ctx, String shipmentCode, UpimgBean.ImageDTO imageDTO) {
|
||||
if (TextUtils.isEmpty(shipmentCode)) {
|
||||
ToastUtils.showToast(ctx, "运单号不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if (TextUtils.isEmpty(imageDTO.getFileName())) {
|
||||
ToastUtils.showToast(ctx, "照片不能为空");
|
||||
return;
|
||||
}
|
||||
imageDTO.setTime(TimeUtil.getNowString(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.getDefault())));
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 运单回单照片上传
|
||||
* @param ctx
|
||||
* @param shipmentCode
|
||||
* @param imageDTO
|
||||
*/
|
||||
public void uploadPODImage(Context ctx, String shipmentCode, UpimgBean.ImageDTO imageDTO) {
|
||||
if (TextUtils.isEmpty(shipmentCode)) {
|
||||
ToastUtils.showToast(ctx, "运单号不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if (TextUtils.isEmpty(imageDTO.getFileName())) {
|
||||
ToastUtils.showToast(ctx, "照片不能为空");
|
||||
return;
|
||||
}
|
||||
imageDTO.setTime(TimeUtil.getNowString(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.getDefault())));
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 同意发票申请
|
||||
* @param ctx
|
||||
* @param shipmentCode
|
||||
* @param invoiceBean
|
||||
*/
|
||||
public void confirmInvoice(Context ctx, String shipmentCode, InvoiceBean invoiceBean) {
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 运单状态查询
|
||||
* @param ctx
|
||||
* @param shipmentCode
|
||||
* @param shipmentStatusBean
|
||||
*/
|
||||
public void getShipmentStatus(Context ctx, String shipmentCode, ShipmentStatusBean shipmentStatusBean) {
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user