接单前人车绑定关系查询
This commit is contained in:
parent
d4fd83c8f2
commit
d8e5cbeb90
@ -55,15 +55,15 @@ class MessagePop(context: Context) : CenterPopupView(context), View.OnClickListe
|
||||
}
|
||||
R.id.tvOk,R.id.tvPhone -> {
|
||||
dismiss()
|
||||
if (XPermission.create(context).isGranted(Manifest.permission.CALL_PHONE)){
|
||||
// if (XPermission.create(context).isGranted(Manifest.permission.CALL_PHONE)){
|
||||
val toString = tvPhone.text.toString()
|
||||
val intent = Intent(Intent.ACTION_DIAL)
|
||||
val data = Uri.parse("tel:$toString")
|
||||
intent.data = data
|
||||
context.startActivity(intent)
|
||||
}else{
|
||||
ToastUtils.showToast(context,"请开启电话权限")
|
||||
}
|
||||
// }else{
|
||||
// ToastUtils.showToast(context,"请开启电话权限")
|
||||
// }
|
||||
|
||||
// BaseUtils.callPhone(content as Activity, tvPhone.text.toString())
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.arpa.hndahesudintocctmsdriver.report;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alct.mdp.MDPLocationCollectionManager;
|
||||
@ -156,11 +157,15 @@ public class ALProcess {
|
||||
}
|
||||
|
||||
|
||||
public static void verification(Context con,Handler hd){
|
||||
public static void verification(Context con,String carNum,Handler hd){
|
||||
DriverAuthDataBean auth= AuthParts.getAuth(con);
|
||||
if (auth==null){
|
||||
return;
|
||||
}
|
||||
if (TextUtils.isEmpty(carNum)){
|
||||
ToastUtils.showToast(con,"请选择车辆");
|
||||
return;
|
||||
}
|
||||
// Identity idy=new Identity();
|
||||
// //企业代码
|
||||
// idy.setEnterpriseCode(BuildConfig.isTest?ENTERPRISE_CODE_TEXT:ENTERPRISE_CODE);
|
||||
@ -187,7 +192,8 @@ public class ALProcess {
|
||||
// }
|
||||
// });
|
||||
|
||||
NewLJUtils.getInstance().searchDriver(con, auth.getData().getIdcard(), new OnGDDownloadResultListener(){
|
||||
|
||||
NewLJUtils.getInstance().trucks(con, auth.getData().getIdcard(),carNum, new OnGDDownloadResultListener(){
|
||||
@Override
|
||||
public void onSuccess(String var1) {
|
||||
MsgUtil.addHdMsgWatBody(hd, 1111,"认证成功");
|
||||
@ -199,6 +205,18 @@ public class ALProcess {
|
||||
}
|
||||
});
|
||||
|
||||
// NewLJUtils.getInstance().searchDriver(con, auth.getData().getIdcard(), new OnGDDownloadResultListener(){
|
||||
// @Override
|
||||
// public void onSuccess(String var1) {
|
||||
// MsgUtil.addHdMsgWatBody(hd, 1111,"认证成功");
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(String var1, String var2) {
|
||||
// MsgUtil.addHdMsgWatBody(hd, 2222,var2);
|
||||
// }
|
||||
// });
|
||||
|
||||
// NewLJUtils.getInstance().getToken(con, new OnGDResultListener() {
|
||||
// @Override
|
||||
// public void onSuccess() {
|
||||
|
@ -152,5 +152,14 @@ public interface Api {
|
||||
|
||||
@GET(BASE_URL+"/openapi/drivers")
|
||||
Observable<CommonResponseBean> searchDriver(@Query("identityNo") String identityNo);
|
||||
|
||||
|
||||
/**
|
||||
* 司机车辆绑定关系
|
||||
* @param identityNo
|
||||
* @return
|
||||
*/
|
||||
@GET(BASE_URL+"openapi/drivers/{identityNo}/trucks")
|
||||
Observable<CommonResponseBean> trucks(@Path("identityNo") String identityNo);
|
||||
}
|
||||
|
||||
|
@ -94,6 +94,7 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
private BasePopupView xp;
|
||||
private TextView car;
|
||||
private String cid;
|
||||
private String selectCarNum = "";
|
||||
|
||||
@Override
|
||||
public void msgMethod(Message m) {
|
||||
@ -189,6 +190,7 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
int index = Integer.valueOf((String) m.obj);
|
||||
Log.e("--选择车辆--", clb.getData().get(index).getCarNumber());
|
||||
car.setText("选择车辆:" + clb.getData().get(index).getCarNumber());
|
||||
selectCarNum = clb.getData().get(index).getCarNumber();
|
||||
cid = clb.getData().get(index).getCarId();
|
||||
break;
|
||||
|
||||
@ -319,9 +321,11 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
if (hyd!=null&&hyd.getData()!=null&& !TextUtils.isEmpty(hyd.getData().getCarNumber())){
|
||||
cid = hyd.getData().getCarId();
|
||||
car.setText("选择车辆:" + hyd.getData().getCarNumber());
|
||||
selectCarNum = hyd.getData().getCarNumber();
|
||||
}else if (clb != null && clb.getData().size() == 1) {
|
||||
cid = clb.getData().get(0).getCarId();
|
||||
car.setText("选择车辆:" + clb.getData().get(0).getCarNumber());
|
||||
selectCarNum = clb.getData().get(0).getCarNumber();
|
||||
}
|
||||
xuanze.setOnClickListener(v1 -> {
|
||||
if (clb.getData().size() > 0) {
|
||||
@ -502,7 +506,7 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
customDialog = new CustomDialog(con, "正在接单...");
|
||||
customDialog.show();
|
||||
//验证安联用户是否通过
|
||||
ALProcess.verification(con, hd);
|
||||
ALProcess.verification(con,selectCarNum, hd);
|
||||
} else {
|
||||
boolean accessCoarseLocation = deniedList.contains("android.permission.ACCESS_FINE_LOCATION");
|
||||
boolean contains = deniedList.contains("android.permission.WRITE_EXTERNAL_STORAGE");
|
||||
@ -522,14 +526,14 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
customDialog = new CustomDialog(con, "正在接单...");
|
||||
customDialog.show();
|
||||
//验证安联用户是否通过
|
||||
ALProcess.verification(con, hd);
|
||||
ALProcess.verification(con,selectCarNum, hd);
|
||||
}
|
||||
|
||||
} else {
|
||||
customDialog = new CustomDialog(con, "正在接单...");
|
||||
customDialog.show();
|
||||
//验证安联用户是否通过
|
||||
ALProcess.verification(con, hd);
|
||||
ALProcess.verification(con,selectCarNum, hd);
|
||||
}
|
||||
|
||||
|
||||
|
@ -42,6 +42,8 @@ import com.express.mdp.Callback;
|
||||
import com.google.gson.Gson;
|
||||
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
|
||||
@ -761,4 +763,48 @@ public class NewLJUtils {
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 人车绑定关系
|
||||
* @param ctx
|
||||
* @param idCard
|
||||
* @param listener
|
||||
*/
|
||||
public void trucks(Context ctx, String idCard,String carNum, OnGDDownloadResultListener listener){
|
||||
DataManager.getInstance().trucks(idCard)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||
@Override
|
||||
public void onSuccess(CommonResponseBean<CommonResponseBean> t) {
|
||||
super.onSuccess(t);
|
||||
String[] licensePlateNos = t.getLicensePlateNos();
|
||||
if (listener!=null){
|
||||
if (licensePlateNos.length==0){
|
||||
listener.onFailure(t.getCode(), "该司机暂未绑定任何车辆");
|
||||
}else{
|
||||
boolean isHasCar = false;
|
||||
for (int i = 0; i < licensePlateNos.length; i++) {
|
||||
if (licensePlateNos[i].equals(carNum)){
|
||||
isHasCar = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isHasCar){
|
||||
listener.onSuccess("人车绑定正常");
|
||||
}else{
|
||||
listener.onFailure(t.getCode(), "司机车辆绑定异常");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||
super.onCodeError(mContext, t);
|
||||
if (listener != null)
|
||||
listener.onFailure(t.getCode(), TextUtils.isEmpty(t.getMessage()) ? "司机异常" : t.getMessage());
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -21,6 +21,16 @@ public class CommonResponseBean<T> implements Serializable {
|
||||
private String statusCode;
|
||||
private boolean success;
|
||||
|
||||
private String[] LicensePlateNos;
|
||||
|
||||
public String[] getLicensePlateNos() {
|
||||
return LicensePlateNos;
|
||||
}
|
||||
|
||||
public void setLicensePlateNos(String[] licensePlateNos) {
|
||||
LicensePlateNos = licensePlateNos;
|
||||
}
|
||||
|
||||
private DriverBean driver;
|
||||
|
||||
public DriverBean getDriver() {
|
||||
|
Loading…
Reference in New Issue
Block a user