添加不上传安联逻辑
This commit is contained in:
parent
205a6ee7f5
commit
d9a9b9b634
@ -68,9 +68,18 @@ public class CarListBean {
|
||||
private Object carImage;
|
||||
private String owner;
|
||||
private String vehicleNumber;
|
||||
private String outInvoice;
|
||||
private int auditStatus;
|
||||
private String drivingLicenseValidity;
|
||||
|
||||
public String getOutInvoice() {
|
||||
return outInvoice;
|
||||
}
|
||||
|
||||
public void setOutInvoice(String outInvoice) {
|
||||
this.outInvoice = outInvoice;
|
||||
}
|
||||
|
||||
public String getCarNumber() {
|
||||
return carNumber == null ? "" : carNumber;
|
||||
}
|
||||
|
@ -730,6 +730,7 @@ public class HomeFragment extends BaseFragment {
|
||||
if (zStatus == 0) {//未装货
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
in.putExtra("type", 0);
|
||||
in.putExtra("reportAlct", data.getReportAlct());
|
||||
in.putExtra("wid", zData.getId() + "");
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
in.putExtra("keys", true);
|
||||
@ -737,6 +738,7 @@ public class HomeFragment extends BaseFragment {
|
||||
} else if (zStatus == 1 && xStatus == 4) {//已装货未上传回单
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
in.putExtra("type", 2);
|
||||
in.putExtra("reportAlct", data.getReportAlct());
|
||||
in.putExtra("wid", zData.getId() + "");
|
||||
in.putExtra("h_type", 0);
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
@ -746,6 +748,7 @@ public class HomeFragment extends BaseFragment {
|
||||
if (dis > 5) {//大于五分钟可以接单
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
in.putExtra("type", 1);
|
||||
in.putExtra("reportAlct", data.getReportAlct());
|
||||
in.putExtra("wid", xData.getId() + "");
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
in.putExtra("keys", true);
|
||||
@ -757,6 +760,7 @@ public class HomeFragment extends BaseFragment {
|
||||
} else if (zStatus == 3 && xStatus == 2) {//已卸货,未上传卸货回单
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
in.putExtra("type", 2);
|
||||
in.putExtra("reportAlct", data.getReportAlct());
|
||||
in.putExtra("wid", xData.getId() + "");
|
||||
in.putExtra("h_type", 1);
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
|
@ -96,6 +96,8 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
private String cid;
|
||||
private String selectCarNum = "";
|
||||
|
||||
private String currOutInvoice = "0";
|
||||
|
||||
@Override
|
||||
public void msgMethod(Message m) {
|
||||
super.msgMethod(m);
|
||||
@ -191,6 +193,7 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
Log.e("--选择车辆--", clb.getData().get(index).getCarNumber());
|
||||
car.setText("选择车辆:" + clb.getData().get(index).getCarNumber());
|
||||
selectCarNum = clb.getData().get(index).getCarNumber();
|
||||
currOutInvoice = clb.getData().get(index).getOutInvoice();
|
||||
cid = clb.getData().get(index).getCarId();
|
||||
break;
|
||||
|
||||
@ -318,13 +321,24 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
//
|
||||
ImageButton xuanze = v.findViewById(R.id.xuanze);
|
||||
|
||||
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) {
|
||||
if (hyd != null && hyd.getData() != null && !TextUtils.isEmpty(hyd.getData().getCarNumber())) {
|
||||
String carNumber = hyd.getData().getCarNumber();
|
||||
if (clb != null && !clb.getData().isEmpty()) {//判断车辆是否需要上传安联
|
||||
for (CarListBean.DataDTO datum : clb.getData()) {
|
||||
if (carNumber.equals(datum.getCarNumber())) {
|
||||
cid = hyd.getData().getCarId();
|
||||
car.setText("选择车辆:" + hyd.getData().getCarNumber());
|
||||
currOutInvoice = datum.getOutInvoice();
|
||||
selectCarNum = hyd.getData().getCarNumber();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else if (clb != null && clb.getData().size() == 1) {
|
||||
cid = clb.getData().get(0).getCarId();
|
||||
car.setText("选择车辆:" + clb.getData().get(0).getCarNumber());
|
||||
currOutInvoice = clb.getData().get(0).getOutInvoice();
|
||||
selectCarNum = clb.getData().get(0).getCarNumber();
|
||||
}
|
||||
xuanze.setOnClickListener(v1 -> {
|
||||
@ -416,7 +430,7 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
|
||||
UiAuxiliary.homeRequest("接单");
|
||||
Intent in = new Intent(con, StartYunDanActivity.class);
|
||||
in.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
in.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
in.putExtra("id", "0");
|
||||
startActivity(in);
|
||||
finish();
|
||||
@ -505,8 +519,13 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
if (allGranted) {
|
||||
customDialog = new CustomDialog(con, "正在接单...");
|
||||
customDialog.show();
|
||||
//验证安联用户是否通过
|
||||
ALProcess.verification(con,selectCarNum, hd);
|
||||
if ("0".equals(currOutInvoice)){
|
||||
//验证安联用户是否通过
|
||||
ALProcess.verification(con, selectCarNum, hd);
|
||||
}else{
|
||||
hyr.getOrderStatus(id);
|
||||
}
|
||||
|
||||
} else {
|
||||
boolean accessCoarseLocation = deniedList.contains("android.permission.ACCESS_FINE_LOCATION");
|
||||
boolean contains = deniedList.contains("android.permission.WRITE_EXTERNAL_STORAGE");
|
||||
@ -526,14 +545,14 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
customDialog = new CustomDialog(con, "正在接单...");
|
||||
customDialog.show();
|
||||
//验证安联用户是否通过
|
||||
ALProcess.verification(con,selectCarNum, hd);
|
||||
ALProcess.verification(con, selectCarNum, hd);
|
||||
}
|
||||
|
||||
} else {
|
||||
customDialog = new CustomDialog(con, "正在接单...");
|
||||
customDialog.show();
|
||||
//验证安联用户是否通过
|
||||
ALProcess.verification(con,selectCarNum, hd);
|
||||
ALProcess.verification(con, selectCarNum, hd);
|
||||
}
|
||||
|
||||
|
||||
|
@ -387,6 +387,7 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
if (type == 0) {
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
in.putExtra("type", type);
|
||||
in.putExtra("reportAlct", sob.getData().getReportAlct());
|
||||
in.putExtra("wid", wid);
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
in.putExtra("keys", key);
|
||||
@ -397,6 +398,7 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
} else if (sdw.getStatus() == 1) {//装货回单
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
in.putExtra("type", 2);
|
||||
in.putExtra("reportAlct", sob.getData().getReportAlct());
|
||||
in.putExtra("wid", wid);
|
||||
in.putExtra("h_type", type);
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
@ -404,6 +406,7 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
} else if (sdw.getStatus() == 2) {//上传收货单(卸货回单)
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
in.putExtra("type", 2);
|
||||
in.putExtra("reportAlct", sob.getData().getReportAlct());
|
||||
in.putExtra("wid", wid);
|
||||
in.putExtra("h_type", type);
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
@ -423,6 +426,7 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
if (dis > 5) {//大于五分钟可以接单
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
in.putExtra("type", type);
|
||||
in.putExtra("reportAlct", sob.getData().getReportAlct());
|
||||
in.putExtra("wid", wid);
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
in.putExtra("keys", key);
|
||||
|
@ -89,6 +89,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
private String[] names = {"装货", "卸货", "回单"};
|
||||
public static String[] TYPE_NAME = {"zhuanghuo", "xiehuo", "huidan"};
|
||||
private int index = 0;
|
||||
private int reportAlct = 1;//是否上报(安联城通) 0否 1是'
|
||||
//
|
||||
private Gson gson = new Gson();
|
||||
//
|
||||
@ -184,6 +185,13 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}else if (reportAlct==0){
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
} else if ((0 == index || 1 == index) && isFinish) {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
@ -329,6 +337,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
tips_x = findViewById(R.id.tips_x);
|
||||
Bundle ins = getIntent().getExtras();
|
||||
index = ins.getInt("type");
|
||||
reportAlct = ins.getInt("reportAlct");
|
||||
wid = ins.getString("wid");
|
||||
h_type = ins.getInt("h_type");
|
||||
keys = ins.getBoolean("keys");
|
||||
@ -481,31 +490,37 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
Log.e("--装货信息", gson.toJson(lub));
|
||||
if (locationKey) {//高德定位
|
||||
if (keys) {
|
||||
|
||||
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 {
|
||||
if (1==reportAlct){
|
||||
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();
|
||||
loadInfo();
|
||||
}
|
||||
upLocation(lgdu.getLatitude() + "", lgdu.getLongitude() + "",sob.getData().getShippingNoteNumber());
|
||||
loadInfo();
|
||||
}
|
||||
upLocation(lgdu.getLatitude() + "", lgdu.getLongitude() + "",sob.getData().getShippingNoteNumber());
|
||||
// NewLJUtils.getInstance().startLocationService(ShangChuangImgActivity.this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showToast(con, var2);
|
||||
}
|
||||
});
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showToast(con, var2);
|
||||
}
|
||||
});
|
||||
}else{
|
||||
isFinish = true;
|
||||
//平台确认装货
|
||||
hyr.loading(lub);
|
||||
}
|
||||
|
||||
// MDPLocationCollectionManager.getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnDownloadResultListener() {
|
||||
// @Override
|
||||
// public void onSuccess(Object o) {
|
||||
@ -561,30 +576,36 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
Log.e("--卸货信息", gson.toJson(lub));
|
||||
if (locationKey) {
|
||||
if (keys) {
|
||||
|
||||
NewLJUtils.getInstance().getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnGDDownloadResultListener() {
|
||||
@Override
|
||||
public void onSuccess(String var1) {
|
||||
if (var1.equals("40")) {//安联装货,单平台未装货
|
||||
//卸货状态-平台
|
||||
isFinish = true;
|
||||
hyr.dischargeCargo(lub);
|
||||
} else {
|
||||
nfc();
|
||||
uploadInfo();
|
||||
}
|
||||
upLocation(lgdu.getLatitude() + "", lgdu.getLongitude() + "",sob.getData().getShippingNoteNumber());
|
||||
if (1==reportAlct){
|
||||
NewLJUtils.getInstance().getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnGDDownloadResultListener() {
|
||||
@Override
|
||||
public void onSuccess(String var1) {
|
||||
if (var1.equals("40")) {//安联装货,单平台未装货
|
||||
//卸货状态-平台
|
||||
isFinish = true;
|
||||
hyr.dischargeCargo(lub);
|
||||
} else {
|
||||
nfc();
|
||||
uploadInfo();
|
||||
}
|
||||
upLocation(lgdu.getLatitude() + "", lgdu.getLongitude() + "",sob.getData().getShippingNoteNumber());
|
||||
// NewLJUtils.getInstance().stopLocationService();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showToast(con, var2);
|
||||
}
|
||||
});
|
||||
|
||||
@Override
|
||||
public void onFailure(String var1, String var2) {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showToast(con, var2);
|
||||
}
|
||||
});
|
||||
|
||||
}else {
|
||||
//卸货状态-平台
|
||||
isFinish = true;
|
||||
hyr.dischargeCargo(lub);
|
||||
}
|
||||
|
||||
// MDPLocationCollectionManager.getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnDownloadResultListener() {
|
||||
// @Override
|
||||
@ -643,7 +664,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
Log.e("--回单信息", gson.toJson(urib));
|
||||
if (locationKey) {
|
||||
if (index == 2 && keys) {
|
||||
up_trafficSign();
|
||||
if (1==reportAlct){
|
||||
up_trafficSign();
|
||||
}
|
||||
// up_trafficReceipt();
|
||||
// receipt_image();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user