3.2.9上传照片去除百度定位

This commit is contained in:
lijia 2023-09-21 15:12:30 +08:00
parent 360f492b8a
commit 50cc329a4d
2 changed files with 37 additions and 97 deletions

View File

@ -37,8 +37,8 @@ android {
applicationId "com.arpa.hndahesudintocctmsdriver" applicationId "com.arpa.hndahesudintocctmsdriver"
minSdkVersion 23 minSdkVersion 23
targetSdkVersion 30 targetSdkVersion 30
versionCode 58 versionCode 59
versionName "3.2.8" versionName "3.2.9"
flavorDimensions "CHANNEL_VALUE" flavorDimensions "CHANNEL_VALUE"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
javaCompileOptions { javaCompileOptions {

View File

@ -29,12 +29,9 @@ import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil; import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
import com.arpa.hndahesudintocctmsdriver.util.img.GetCarImageAlert; import com.arpa.hndahesudintocctmsdriver.util.img.GetCarImageAlert;
import com.arpa.hndahesudintocctmsdriver.util.location.LocationUtil; import com.arpa.hndahesudintocctmsdriver.util.location.LocationUtil;
import com.baidu.mapapi.CoordType;
import com.baidu.mapapi.SDKInitializer;
import com.baidu.mapapi.model.LatLng; import com.baidu.mapapi.model.LatLng;
import com.baidu.mapapi.utils.CoordinateConverter; import com.baidu.mapapi.utils.CoordinateConverter;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.dahe.mylibrary.utils.ToastUtils;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.luck.picture.lib.PictureSelector; import com.luck.picture.lib.PictureSelector;
import com.luck.picture.lib.config.PictureConfig; import com.luck.picture.lib.config.PictureConfig;
@ -47,7 +44,6 @@ import com.arpa.hndahesudintocctmsdriver.bean.UploadBean;
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset; import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean; import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean;
import com.arpa.hndahesudintocctmsdriver.request.bean.UploadReceiptInputBean; import com.arpa.hndahesudintocctmsdriver.request.bean.UploadReceiptInputBean;
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
import com.arpa.hndahesudintocctmsdriver.util.location.LocationGDUtil; import com.arpa.hndahesudintocctmsdriver.util.location.LocationGDUtil;
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog; import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup; import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
@ -167,6 +163,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
customDialog.dismiss(); customDialog.dismiss();
tv_loaction.setText("定位成功"); tv_loaction.setText("定位成功");
tv_loaction.setTextColor(getResources().getColor(R.color.theme_color, null)); tv_loaction.setTextColor(getResources().getColor(R.color.theme_color, null));
latLng = convertGPSToBaidu(new LatLng(lgdu.getLatitude(), lgdu.getLongitude()));
initLocation(); initLocation();
break; break;
case 16://定位失败 case 16://定位失败
@ -199,6 +196,14 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
break; break;
} }
} }
private LatLng latLng;
public LatLng convertGPSToBaidu(LatLng srLatLng) {
CoordinateConverter converter = new CoordinateConverter();
converter.from(CoordinateConverter.CoordType.COMMON);
converter.coord(srLatLng);
return converter.convert();
}
private String wid; private String wid;
private int h_type; private int h_type;
@ -245,8 +250,8 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
if (!locationKey) { if (!locationKey) {
customDialog.show(); customDialog.show();
lgdu.onCreate(); lgdu.onCreate();
lu = new LocationUtil(con, hd); // lu = new LocationUtil(con, hd);
lu.onCreate(); // lu.onCreate();
} }
}); });
hyr = new HuoYuanRequset(con, hd); hyr = new HuoYuanRequset(con, hd);
@ -356,10 +361,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
Log.e("--装货信息", gson.toJson(lub)); Log.e("--装货信息", gson.toJson(lub));
if (locationKey) {//高德定位 if (locationKey) {//高德定位
if (keys) { if (keys) {
if (lu!=null&&lu.getErrorCode()!=161){
ToastUtils.showToast(this,"百度地图定位失败,请确认开启定位后重试!");
return;
}
nfc(); nfc();
loadInfo(); loadInfo();
// up_traffic_start(); // up_traffic_start();
@ -384,10 +385,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
Log.e("--卸货信息", gson.toJson(lub)); Log.e("--卸货信息", gson.toJson(lub));
if (locationKey) { if (locationKey) {
if (keys) { if (keys) {
if (lu!=null&&lu.getErrorCode()!=161){
ToastUtils.showToast(this,"百度地图定位失败,请确认开启定位后重试!");
return;
}
nfc(); nfc();
uploadInfo(); uploadInfo();
@ -416,10 +413,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
Log.e("--回单信息", gson.toJson(urib)); Log.e("--回单信息", gson.toJson(urib));
if (locationKey) { if (locationKey) {
if (index == 2 && keys) { if (index == 2 && keys) {
if (lu!=null&&lu.getErrorCode()!=161){
ToastUtils.showToast(this,"百度地图定位失败,请确认开启定位后重试!");
return;
}
up_trafficSign(); up_trafficSign();
up_trafficReceipt(); up_trafficReceipt();
receipt_image(); receipt_image();
@ -439,34 +432,6 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
private StartOrderBean sob; private StartOrderBean sob;
//上传安联和交通厅-装货
public void up_traffic_start() {
//安联
if (sob.getData().getReportAlct() == 1) {
Location l = new Location();
l.setBaiduLongitude(lu.getLongitude());
l.setBaiduLatitude(lu.getLatitude());
l.setLocation(lu.getAddress());
l.setTime(Timer.getTimerT());
MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
@Override
public void onSuccess() {
Log.e("上报安联", "装货上传成功");
}
@Override
public void onFailure(String s, String s1) {
Log.e("上报安联失败(装货):", s + s1);
new MessageUtils().showCenMessage(con, s1);
}
});
}
//交通厅
if (sob.getData().getReport() == 1) {
JTTProcess.start(con, sob, "");
}
}
public void nfc() { public void nfc() {
// if(sob.getData().getNfcId().equals(nfcStr)){ // if(sob.getData().getNfcId().equals(nfcStr)){
// Toast.makeText(con,"nfcId匹配失败",Toast.LENGTH_LONG).show(); // Toast.makeText(con,"nfcId匹配失败",Toast.LENGTH_LONG).show();
@ -488,41 +453,13 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
}); });
} }
//上传安联和交通厅-卸货
public void up_traffic_end() {
//安联
if (sob.getData().getReportAlct() == 1) {
Location l = new Location();
l.setBaiduLongitude(lu.getLongitude());
l.setBaiduLatitude(lu.getLatitude());
l.setLocation(lu.getAddress());
l.setTime(Timer.getTimerT());
Log.e("-安联卸货信息-", gson.toJson(l));
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
@Override
public void onSuccess() {
Log.e("上报安联", "卸货上传成功");
}
@Override
public void onFailure(String s, String s1) {
Log.e("上报安联失败(卸货):", s + s1);
}
});
}
//交通厅
if (sob.getData().getReport() == 1) {
JTTProcess.stop(con, sob, "");
}
}
//上传安联-签收 //上传安联-签收
public void up_trafficSign() { public void up_trafficSign() {
//安联 //安联
Location l = new Location(); Location l = new Location();
l.setBaiduLongitude(lu.getLongitude()); l.setBaiduLongitude(latLng.longitude);
l.setBaiduLatitude(lu.getLatitude()); l.setBaiduLatitude(latLng.latitude);
l.setLocation(lu.getAddress()); l.setLocation(lgdu.getAddress());
l.setTime(Timer.getTimerT()); l.setTime(Timer.getTimerT());
List<Goods> gs = new ArrayList<>(); List<Goods> gs = new ArrayList<>();
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) { for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
@ -560,9 +497,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
public void up_trafficReceipt() { public void up_trafficReceipt() {
//安联 //安联
Location l = new Location(); Location l = new Location();
l.setBaiduLongitude(lu.getLongitude()); l.setBaiduLongitude(latLng.longitude);
l.setBaiduLatitude(lu.getLatitude()); l.setBaiduLatitude(latLng.latitude);
l.setLocation(lu.getAddress()); l.setLocation(lgdu.getAddress());
l.setTime(Timer.getTimerT()); l.setTime(Timer.getTimerT());
MDPLocationCollectionManager.pod(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() { MDPLocationCollectionManager.pod(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
@ -588,9 +525,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
image.setFileExt(FileUtil.lastName(file)); image.setFileExt(FileUtil.lastName(file));
image.setFileName(FileUtil.fileName(file)); image.setFileName(FileUtil.fileName(file));
image.setImageTakenDate(Timer.getTimerT()); image.setImageTakenDate(Timer.getTimerT());
image.setBaiduLongitude(lu.getLongitude()); image.setBaiduLongitude(latLng.longitude);
image.setBaiduLatitude(lu.getLatitude()); image.setBaiduLatitude(latLng.latitude);
image.setLocation(lu.getAddress()); image.setLocation(lgdu.getAddress());
MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() { MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
@Override @Override
@ -620,9 +557,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
image.setFileExt(FileUtil.lastName(file)); image.setFileExt(FileUtil.lastName(file));
image.setFileName(FileUtil.fileName(file)); image.setFileName(FileUtil.fileName(file));
image.setImageTakenDate(Timer.getTimerT()); image.setImageTakenDate(Timer.getTimerT());
image.setBaiduLongitude(lu.getLongitude()); image.setBaiduLongitude(latLng.longitude);
image.setBaiduLatitude(lu.getLatitude()); image.setBaiduLatitude(latLng.latitude);
image.setLocation(lu.getAddress()); image.setLocation(lgdu.getAddress());
MDPLocationCollectionManager.uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() { MDPLocationCollectionManager.uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
@Override @Override
@ -653,9 +590,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
image.setFileExt(FileUtil.lastName(file)); image.setFileExt(FileUtil.lastName(file));
image.setFileName(FileUtil.fileName(file)); image.setFileName(FileUtil.fileName(file));
image.setImageTakenDate(Timer.getTimerT()); image.setImageTakenDate(Timer.getTimerT());
image.setBaiduLongitude(lu.getLongitude()); image.setBaiduLongitude(latLng.longitude);
image.setBaiduLatitude(lu.getLatitude()); image.setBaiduLatitude(latLng.latitude);
image.setLocation(lu.getAddress()); image.setLocation(lgdu.getAddress());
MDPLocationCollectionManager.uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() { MDPLocationCollectionManager.uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new com.alct.mdp.callback.OnResultListener() {
@Override @Override
@ -706,6 +643,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
Log.e("nfc", nfcStr); Log.e("nfc", nfcStr);
} }
/** /**
* 上传安联和交通厅,平台-装货 * 上传安联和交通厅,平台-装货
*/ */
@ -713,9 +653,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
//安联 //安联
if (sob.getData().getReportAlct() == 1) { if (sob.getData().getReportAlct() == 1) {
Location l = new Location(); Location l = new Location();
l.setBaiduLongitude(lu.getLongitude()); l.setBaiduLongitude(latLng.longitude);
l.setBaiduLatitude(lu.getLatitude()); l.setBaiduLatitude(latLng.latitude);
l.setLocation(lu.getAddress()); l.setLocation(lgdu.getAddress());
l.setTime(Timer.getTimerT()); l.setTime(Timer.getTimerT());
MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() { MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
@Override @Override
@ -749,9 +689,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
//安联 //安联
if (sob.getData().getReportAlct() == 1) { if (sob.getData().getReportAlct() == 1) {
Location l = new Location(); Location l = new Location();
l.setBaiduLongitude(lu.getLongitude()); l.setBaiduLongitude(latLng.longitude);
l.setBaiduLatitude(lu.getLatitude()); l.setBaiduLatitude(latLng.latitude);
l.setLocation(lu.getAddress()); l.setLocation(lgdu.getAddress());
l.setTime(Timer.getTimerT()); l.setTime(Timer.getTimerT());
Log.e("-安联卸货信息-", gson.toJson(l)); Log.e("-安联卸货信息-", gson.toJson(l));
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() { MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {