新路交运营端代码
This commit is contained in:
parent
ebaa442309
commit
f7a3b4303d
@ -128,6 +128,22 @@ android {
|
||||
resValue "string", "appName", "大河好运司机"
|
||||
}
|
||||
|
||||
productbc {
|
||||
applicationId "com.arpa.hndahesudintocctmsdriver.bc"
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "大河好运司机",
|
||||
app_icon : "@drawable/diver_logo",
|
||||
GAODEKEY : "f960bc6d14788238918bd014fa08a870",
|
||||
JPUSH_PKGNAME: applicationId,
|
||||
JPUSH_APPKEY : "fba6f55621c670d8c1fe9191", //JPush 上注册的包名对应的 Appkey.
|
||||
JPUSH_CHANNEL: "developer-default"//暂时填写默认值即可.
|
||||
]
|
||||
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi.alct56.com\"")
|
||||
buildConfigField("String", "BASE_URL", "\"http://app.dahehuoyun.com/api/\"")
|
||||
buildConfigField "boolean", "isTest", "false"
|
||||
//APP名称,可以在androidMainfest中引用
|
||||
resValue "string", "appName", "大河好运司机"
|
||||
}
|
||||
|
||||
}
|
||||
// productFlavors.all { flavor ->
|
||||
// flavor.manifestPlaceholders = [CHANNEL_VALUE: name]
|
||||
|
@ -54,6 +54,7 @@ import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.WalletRequest;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivityBC;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.news.NewActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.wallet.UpBankActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.web.WebOnlyOneActivity;
|
||||
@ -728,14 +729,14 @@ public class HomeFragment extends BaseFragment {
|
||||
int zStatus = zData.getStatus();
|
||||
int xStatus = xData.getStatus();
|
||||
if (zStatus == 0) {//未装货
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
Intent in = new Intent(con, ShangChuangImgActivityBC.class);
|
||||
in.putExtra("type", 0);
|
||||
in.putExtra("wid", zData.getId() + "");
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
in.putExtra("keys", true);
|
||||
startActivity(in);
|
||||
} else if (zStatus == 1 && xStatus == 4) {//已装货未上传回单
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
Intent in = new Intent(con, ShangChuangImgActivityBC.class);
|
||||
in.putExtra("type", 2);
|
||||
in.putExtra("wid", zData.getId() + "");
|
||||
in.putExtra("h_type", 0);
|
||||
@ -744,7 +745,7 @@ public class HomeFragment extends BaseFragment {
|
||||
} else if (zStatus == 3 && xStatus == 4) {//已上传装货回单,未卸货
|
||||
int dis = TimeUtil.compareNowDate(TimeUtil.string2Millis(zData.getImageTakenDate(), TimeUtil.DEFAULT_FORMAT4));
|
||||
if (dis > 5) {//大于五分钟可以接单
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
Intent in = new Intent(con, ShangChuangImgActivityBC.class);
|
||||
in.putExtra("type", 1);
|
||||
in.putExtra("wid", xData.getId() + "");
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
@ -755,7 +756,7 @@ public class HomeFragment extends BaseFragment {
|
||||
}
|
||||
|
||||
} else if (zStatus == 3 && xStatus == 2) {//已卸货,未上传卸货回单
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
Intent in = new Intent(con, ShangChuangImgActivityBC.class);
|
||||
in.putExtra("type", 2);
|
||||
in.putExtra("wid", xData.getId() + "");
|
||||
in.putExtra("h_type", 1);
|
||||
|
@ -41,6 +41,7 @@ import com.amap.api.services.route.DriveStep;
|
||||
import com.amap.api.services.route.RideRouteResult;
|
||||
import com.amap.api.services.route.RouteSearch;
|
||||
import com.amap.api.services.route.WalkRouteResult;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivityBC;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||
import com.bumptech.glide.Glide;
|
||||
@ -385,7 +386,7 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
String wid = sdw.getId() + "";
|
||||
if (sdw.getStatus() == 0) {
|
||||
if (type == 0) {
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
Intent in = new Intent(con, ShangChuangImgActivityBC.class);
|
||||
in.putExtra("type", type);
|
||||
in.putExtra("wid", wid);
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
@ -395,14 +396,14 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
Toast.makeText(con, "您还没有装货", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else if (sdw.getStatus() == 1) {//装货回单
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
Intent in = new Intent(con, ShangChuangImgActivityBC.class);
|
||||
in.putExtra("type", 2);
|
||||
in.putExtra("wid", wid);
|
||||
in.putExtra("h_type", type);
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
startActivity(in);
|
||||
} else if (sdw.getStatus() == 2) {//上传收货单(卸货回单)
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
Intent in = new Intent(con, ShangChuangImgActivityBC.class);
|
||||
in.putExtra("type", 2);
|
||||
in.putExtra("wid", wid);
|
||||
in.putExtra("h_type", type);
|
||||
@ -421,7 +422,7 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
if (zInfo.getReceiptUrl() != null && zInfo.getReceiptUrl().size() > 0) {
|
||||
int dis = TimeUtil.compareNowDate(TimeUtil.string2Millis(zInfo.getImageTakenDate(), TimeUtil.DEFAULT_FORMAT4));
|
||||
if (dis > 5) {//大于五分钟可以接单
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
Intent in = new Intent(con, ShangChuangImgActivityBC.class);
|
||||
in.putExtra("type", type);
|
||||
in.putExtra("wid", wid);
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
|
@ -36,16 +36,22 @@ import com.amap.api.services.help.Tip;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.GDImage;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.GDLocation;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.StartOrderBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.UploadBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeWaybillEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.OCRRequest;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.TrackInputBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.UploadReceiptInputBean;
|
||||
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.CustomDialog;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||
@ -61,6 +67,8 @@ import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
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.ToastUtils;
|
||||
import com.github.gzuliyujiang.wheelpicker.DatePicker;
|
||||
import com.github.gzuliyujiang.wheelpicker.DatimePicker;
|
||||
@ -78,6 +86,8 @@ import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.interfaces.OnSelectListener;
|
||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
@ -119,6 +129,7 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
|
||||
private TempLoca tempLoca = new TempLoca();
|
||||
private TempLoca tempLocaBd = new TempLoca();
|
||||
private boolean isFinish = false;
|
||||
|
||||
|
||||
@Override
|
||||
@ -247,12 +258,28 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
if (index == 2) {
|
||||
if (!keys){//装货回单
|
||||
if (!keys) {//装货回单
|
||||
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()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
} else {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||
finish();
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove(TYPE_NAME[i]);
|
||||
@ -374,17 +401,17 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
//Log.e("---sdwStr--",sdwStr);
|
||||
sob = new Gson().fromJson(sobStr, StartOrderBean.class);
|
||||
initView(null);
|
||||
customDialog = new CustomDialog(con, "正在定位当前位置...");
|
||||
customDialog.show();
|
||||
lgdu = new LocationGDUtil(con, hd);
|
||||
//启动定位
|
||||
lgdu.onCreate();
|
||||
tv_loaction.setOnClickListener(v -> {
|
||||
if (!locationKey) {
|
||||
customDialog.show();
|
||||
lgdu.onCreate();
|
||||
}
|
||||
});
|
||||
// customDialog = new CustomDialog(con, "正在定位当前位置...");
|
||||
// customDialog.show();
|
||||
// lgdu = new LocationGDUtil(con, hd);
|
||||
// //启动定位
|
||||
// lgdu.onCreate();
|
||||
// tv_loaction.setOnClickListener(v -> {
|
||||
// if (!locationKey) {
|
||||
// customDialog.show();
|
||||
// lgdu.onCreate();
|
||||
// }
|
||||
// });
|
||||
|
||||
btnOk.setOnClickListener(v -> {
|
||||
String s = etAddress.getText().toString();
|
||||
@ -513,6 +540,10 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
// for(int i=0;i<imgIds.size();i++){
|
||||
// Log.e("--imgIds--",imgIds.get(i)+"");
|
||||
// }
|
||||
if (customDialog != null && !customDialog.isShowing()) {
|
||||
customDialog = new CustomDialog(con, "网络请求中...");
|
||||
customDialog.show();
|
||||
}
|
||||
switch (index) {
|
||||
case 0:
|
||||
//装货
|
||||
@ -523,18 +554,45 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
lub.setImageId(imgIds);
|
||||
lub.setWaybillId(wid);
|
||||
Log.e("--装货信息", gson.toJson(lub));
|
||||
if (locationKey) {//高德定位
|
||||
// if (locationKey) {//高德定位
|
||||
if (keys) {
|
||||
nfc();
|
||||
loadInfo();
|
||||
// up_traffic_start();
|
||||
// up_image_z();
|
||||
|
||||
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(tempLoca.getLatitude() + "", tempLoca.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);
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
// } else {
|
||||
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
// customDialog.dismiss();
|
||||
// }
|
||||
// Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||
// }
|
||||
|
||||
} else {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
@ -546,29 +604,56 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
lub.setLocationAddress(tempLoca.getAddress());
|
||||
lub.setImageId(imgIds);
|
||||
lub.setWaybillId(wid);
|
||||
lub.setRealLoadTime(tempLoca.getTime());
|
||||
Log.e("--卸货信息", gson.toJson(lub));
|
||||
if (locationKey&&!TextUtils.isEmpty(tempLoca.address)) {
|
||||
// if (locationKey) {
|
||||
if (keys) {
|
||||
nfc();
|
||||
uploadInfo();
|
||||
|
||||
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(tempLoca.getLatitude() + "", tempLoca.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);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
// } else {
|
||||
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
// customDialog.dismiss();
|
||||
// }
|
||||
// Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||
// }
|
||||
|
||||
} else {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (imgIds != null && imgIds.size() > 0) {//卸货回单
|
||||
//上传回单
|
||||
urib.setLatitude(lgdu.getLatitude() + "");
|
||||
urib.setLongitude(lgdu.getLongitude() + "");
|
||||
urib.setLocationAddress(lgdu.getAddress());
|
||||
urib.setLatitude(tempLoca.getLatitude() + "");
|
||||
urib.setLongitude(tempLoca.getLongitude() + "");
|
||||
urib.setLocationAddress(tempLoca.getAddress());
|
||||
//装卸货类型
|
||||
urib.setType(h_type + 1);
|
||||
//回单id 数组
|
||||
@ -576,17 +661,23 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
//子运运单ID
|
||||
urib.setWaybillId(wid);
|
||||
Log.e("--回单信息", gson.toJson(urib));
|
||||
if (locationKey) {
|
||||
if (index == 2 && keys && !TextUtils.isEmpty(tempLoca.address)) {
|
||||
// if (locationKey) {
|
||||
if (index == 2 && keys) {
|
||||
up_trafficSign();
|
||||
up_trafficReceipt();
|
||||
receipt_image();
|
||||
// up_trafficReceipt();
|
||||
// receipt_image();
|
||||
}
|
||||
hyr.receipt(urib);
|
||||
} else {
|
||||
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
// } else {
|
||||
// if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
// customDialog.dismiss();
|
||||
// }
|
||||
// Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||
// }
|
||||
} else {
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
@ -621,7 +712,7 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
//上传安联-签收
|
||||
public void up_trafficSign() {
|
||||
//安联
|
||||
Location l = new Location();
|
||||
GDLocation l = new GDLocation();
|
||||
l.setBaiduLongitude(tempLocaBd.longitude);
|
||||
l.setBaiduLatitude(tempLocaBd.latitude);
|
||||
l.setLocation(tempLocaBd.getAddress());
|
||||
@ -645,15 +736,18 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
}
|
||||
}
|
||||
}
|
||||
MDPLocationCollectionManager.sign(con, sob.getData().getShippingNoteNumber(), l, gs, new 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -661,30 +755,28 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
//上传安联-回单
|
||||
public void up_trafficReceipt() {
|
||||
//安联
|
||||
Location l = new Location();
|
||||
GDLocation l = new GDLocation();
|
||||
l.setBaiduLongitude(tempLocaBd.longitude);
|
||||
l.setBaiduLatitude(tempLocaBd.latitude);
|
||||
l.setLocation(tempLocaBd.getAddress());
|
||||
l.setTime(tempLocaBd.getTime());
|
||||
MDPLocationCollectionManager.pod(con, sob.getData().getShippingNoteNumber(), l, new 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);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
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));
|
||||
@ -693,30 +785,51 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
image.setBaiduLongitude(tempLocaBd.longitude);
|
||||
image.setBaiduLatitude(tempLocaBd.latitude);
|
||||
image.setLocation(tempLocaBd.getAddress());
|
||||
MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||
|
||||
NewLJUtils.getInstance().uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new OnGDResultListener() {
|
||||
@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 onFailure(String var1, String var2) {
|
||||
Log.e("上报安联失败(装货照片):", var1 + var2);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
// MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||
//
|
||||
// @Override
|
||||
// public void onSuccess() {
|
||||
// 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));
|
||||
@ -725,31 +838,53 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
image.setBaiduLongitude(tempLocaBd.longitude);
|
||||
image.setBaiduLatitude(tempLocaBd.latitude);
|
||||
image.setLocation(tempLocaBd.getAddress());
|
||||
MDPLocationCollectionManager.uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||
|
||||
NewLJUtils.getInstance().uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new OnGDResultListener() {
|
||||
@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 onFailure(String var1, String var2) {
|
||||
Log.e("上报安联失败(卸货照片):", var1 + var2);
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// MDPLocationCollectionManager.uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||
//
|
||||
// @Override
|
||||
// public void onSuccess() {
|
||||
// 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 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));
|
||||
@ -758,24 +893,23 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
image.setBaiduLongitude(tempLocaBd.longitude);
|
||||
image.setBaiduLatitude(tempLocaBd.latitude);
|
||||
image.setLocation(tempLocaBd.getAddress());
|
||||
MDPLocationCollectionManager.uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||
|
||||
NewLJUtils.getInstance().uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new OnGDResultListener() {
|
||||
@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);
|
||||
public void onFailure(String var1, String var2) {
|
||||
Log.e("上报安联失败(回单照片):", var1 + var2);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@ -817,19 +951,20 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
private void loadInfo() {
|
||||
//安联
|
||||
if (sob.getData().getReportAlct() == 1) {
|
||||
Location l = new Location();
|
||||
GDLocation l = new GDLocation();
|
||||
l.setBaiduLongitude(tempLocaBd.longitude);
|
||||
l.setBaiduLatitude(tempLocaBd.latitude);
|
||||
l.setLocation(tempLocaBd.getAddress());
|
||||
l.setTime(tempLocaBd.getTime());
|
||||
MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||
NewLJUtils.getInstance().pickUp(con, sob.getData().getShippingNoteNumber(), l, new OnGDResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "装货上传成功");
|
||||
//交通厅
|
||||
if (sob.getData().getReport() == 1) {
|
||||
JTTProcess.start(con, sob, "");
|
||||
}
|
||||
// if (sob.getData().getReport() == 1) {
|
||||
// JTTProcess.start(con, sob, "");
|
||||
// }
|
||||
// NewLJUtils.getInstance().startLocationService(ShangChuangImgActivityBC.this);
|
||||
//装货状态
|
||||
hyr.loading(lub);
|
||||
//装货照片
|
||||
@ -837,11 +972,39 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(装货):", s + s1);
|
||||
new MessageUtils().showCenMessage(con, s1);
|
||||
public void onFailure(String var1, String var2) {
|
||||
Log.e("上报安联失败(装货):", var1 + var2);
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
new MessageUtils().showCenMessage(con, var2);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new 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);
|
||||
// new MessageUtils().showCenMessage(con, s1);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
}
|
||||
@ -853,37 +1016,72 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
|
||||
|
||||
//安联
|
||||
if (sob.getData().getReportAlct() == 1) {
|
||||
Location l = new Location();
|
||||
GDLocation l = new GDLocation();
|
||||
l.setBaiduLongitude(tempLocaBd.longitude);
|
||||
l.setBaiduLatitude(tempLocaBd.latitude);
|
||||
l.setLocation(tempLocaBd.getAddress());
|
||||
l.setTime(tempLocaBd.getTime());
|
||||
Log.e("-安联卸货信息-", gson.toJson(l));
|
||||
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||
|
||||
NewLJUtils.getInstance().unload(con, sob.getData().getShippingNoteNumber(), l, new OnGDResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "卸货上传成功");
|
||||
//交通厅
|
||||
if (sob.getData().getReport() == 1) {
|
||||
JTTProcess.stop(con, sob, "");
|
||||
}
|
||||
// if (sob.getData().getReport() == 1) {
|
||||
// JTTProcess.stop(con, sob, "");
|
||||
// }
|
||||
|
||||
//卸货状态-平台
|
||||
hyr.dischargeCargo4(lub);
|
||||
hyr.dischargeCargo(lub);
|
||||
//卸货照片-安联
|
||||
up_image();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(卸货):", s + s1);
|
||||
// new MessageUtils().showCenMessage(con, s1);
|
||||
//运单状态不一致,平台更新状态
|
||||
hyr.dischargeCargo4(lub);
|
||||
public void onFailure(String var1, String var2) {
|
||||
Log.e("上报安联失败(卸货):", var1 + var2);
|
||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||
customDialog.dismiss();
|
||||
}
|
||||
new MessageUtils().showCenMessage(con, var2);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||
// @Override
|
||||
// public void onSuccess() {
|
||||
// Log.e("上报安联", "卸货上传成功");
|
||||
// //交通厅
|
||||
// if (sob.getData().getReport() == 1) {
|
||||
// JTTProcess.stop(con, sob, "");
|
||||
// }
|
||||
// //卸货状态-平台
|
||||
// hyr.dischargeCargo4(lub);
|
||||
// //卸货照片-安联
|
||||
// up_image();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(String s, String s1) {
|
||||
// Log.e("上报安联失败(卸货):", s + s1);
|
||||
//// new MessageUtils().showCenMessage(con, s1);
|
||||
// //运单状态不一致,平台更新状态
|
||||
// hyr.dischargeCargo4(lub);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void upLocation(String lat,String lon,String shippingNoteNumber){
|
||||
TrackInputBean tib = new TrackInputBean();
|
||||
tib.setLatitude(lat);
|
||||
tib.setLongitude(lon);
|
||||
tib.setShippingNoteNumber(shippingNoteNumber);
|
||||
hyr.trackTracking(tib);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user