新路交部分接口
This commit is contained in:
parent
88144de31c
commit
ca76fd4cc3
@ -10,8 +10,8 @@ public class NewLJConstant {
|
|||||||
|
|
||||||
public final static String ENTER_PRISE_CODE ="E0019169";
|
public final static String ENTER_PRISE_CODE ="E0019169";
|
||||||
|
|
||||||
public final static String JTT_DATA_JTTORDER_KEY="JTT_order_key";
|
public final static String ENTER_PRISE_IDENTITY ="95033cc3492e420d83d7f09eea1400ac";
|
||||||
|
|
||||||
public final static String JTT_DATA_ORDER_KEY="order_key";
|
public final static String ENTER_PRISE_KEY ="e9844a9b0bba417e89cb8623489abd2f";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,115 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.request.bean.newlj;
|
||||||
|
|
||||||
|
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 ImageDTO 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 ImageDTO getImage() {
|
||||||
|
return image;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImage(ImageDTO 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -6,6 +6,7 @@ import com.arpa.hndahesudintocctmsdriver.bean.UserBean;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.LoginRegInputBean;
|
import com.arpa.hndahesudintocctmsdriver.request.bean.LoginRegInputBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.LjTokenBean;
|
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.LjTokenBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.PickupBean;
|
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.PickupBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.UpimgBean;
|
||||||
import com.dahe.mylibrary.net.CommonResponseBean;
|
import com.dahe.mylibrary.net.CommonResponseBean;
|
||||||
|
|
||||||
import io.reactivex.rxjava3.core.Observable;
|
import io.reactivex.rxjava3.core.Observable;
|
||||||
@ -40,5 +41,58 @@ public interface Api {
|
|||||||
@POST(BASE_URL+"openapi/shipments/pickup")
|
@POST(BASE_URL+"openapi/shipments/pickup")
|
||||||
Observable<CommonResponseBean> pickup(@Body PickupBean bean);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ package com.arpa.hndahesudintocctmsdriver.util;
|
|||||||
import static com.dahe.mylibrary.utils.BaseSPUtils.NEW_LJ_TOKEN;
|
import static com.dahe.mylibrary.utils.BaseSPUtils.NEW_LJ_TOKEN;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.constant.NewLJConstant;
|
import com.arpa.hndahesudintocctmsdriver.constant.NewLJConstant;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.LjTokenBean;
|
import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.LjTokenBean;
|
||||||
@ -11,6 +12,11 @@ import com.arpa.hndahesudintocctmsdriver.request.net.BaseObserver;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.request.net.DataManager;
|
import com.arpa.hndahesudintocctmsdriver.request.net.DataManager;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.net.RxHttpCallBack;
|
import com.arpa.hndahesudintocctmsdriver.request.net.RxHttpCallBack;
|
||||||
import com.dahe.mylibrary.net.CommonResponseBean;
|
import com.dahe.mylibrary.net.CommonResponseBean;
|
||||||
|
import com.dahe.mylibrary.utils.TimeUtil;
|
||||||
|
import com.dahe.mylibrary.utils.ToastUtils;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||||
@ -38,8 +44,8 @@ public class NewLJUtils {
|
|||||||
public void getToken(Context ctx) {
|
public void getToken(Context ctx) {
|
||||||
LjTokenBean ljTokenBean = new LjTokenBean();
|
LjTokenBean ljTokenBean = new LjTokenBean();
|
||||||
ljTokenBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
ljTokenBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||||
ljTokenBean.setEnterpriseIdentity("95033cc3492e420d83d7f09eea1400ac");
|
ljTokenBean.setEnterpriseIdentity(NewLJConstant.ENTER_PRISE_IDENTITY);
|
||||||
ljTokenBean.setEnterpriseKey("e9844a9b0bba417e89cb8623489abd2f");
|
ljTokenBean.setEnterpriseKey(NewLJConstant.ENTER_PRISE_KEY);
|
||||||
|
|
||||||
DataManager.getInstance().getToken(ljTokenBean)
|
DataManager.getInstance().getToken(ljTokenBean)
|
||||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||||
@ -52,10 +58,29 @@ public class NewLJUtils {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void pickUp(Context ctx,String shipmentCode){
|
|
||||||
|
/**
|
||||||
|
* 运单提货
|
||||||
|
* @param ctx
|
||||||
|
* @param shipmentCode
|
||||||
|
* @param location
|
||||||
|
*/
|
||||||
|
public void pickUp(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 pickupBean = new PickupBean();
|
||||||
pickupBean.setShipmentCode(shipmentCode);
|
pickupBean.setShipmentCode(shipmentCode);
|
||||||
pickupBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
pickupBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||||
|
pickupBean.setLocation(location);
|
||||||
DataManager.getInstance().pickup(pickupBean)
|
DataManager.getInstance().pickup(pickupBean)
|
||||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||||
|
Loading…
Reference in New Issue
Block a user