Compare commits

..

7 Commits
master ... yybc

Author SHA1 Message Date
a878a9238a 装卸货添加定位上传 2024-12-18 08:24:10 +08:00
bd2ae6fc46 Merge branch 'master' into yybc 2024-12-17 15:56:53 +08:00
3a23d2e26c 运营端打包 2024-12-13 09:48:41 +08:00
5d08b77cc5 查看照片 2024-12-13 09:31:30 +08:00
61f052b828 注释交通厅代码 2024-12-11 17:03:58 +08:00
8194a07984 Merge branch 'master' into yybc 2024-12-11 15:16:53 +08:00
bad0a7fdef 运营端初始化 2024-12-11 09:47:36 +08:00
11 changed files with 160 additions and 198 deletions

View File

@ -38,8 +38,8 @@ android {
applicationId "com.arpa.hndahesudintocctmsdriver" applicationId "com.arpa.hndahesudintocctmsdriver"
minSdkVersion 24 minSdkVersion 24
targetSdkVersion 30 targetSdkVersion 30
versionCode 76 versionCode 75
versionName "3.4.6" versionName "3.4.5"
flavorDimensions "CHANNEL_VALUE" flavorDimensions "CHANNEL_VALUE"
flavorDimensions "app_icon" flavorDimensions "app_icon"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@ -127,6 +127,21 @@ android {
//APP名称androidMainfest中引用 //APP名称androidMainfest中引用
resValue "string", "appName", "大河好运司机" 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 -> // productFlavors.all { flavor ->

View File

@ -51,11 +51,11 @@
android:required="true" /> android:required="true" />
<uses-permission android:name="android.permission.NFC" /> <uses-permission android:name="android.permission.NFC" />
<application <application
android:name="com.arpa.hndahesudintocctmsdriver.App" android:name=".App"
android:allowBackup="true" android:allowBackup="true"
android:excludeFromRecents="true" android:excludeFromRecents="true"
android:icon="@mipmap/diver_logo" android:icon="@mipmap/diver_logo"
android:label="@string/appName" android:label="运营端"
android:largeHeap="true" android:largeHeap="true"
android:requestLegacyExternalStorage="true" android:requestLegacyExternalStorage="true"
android:supportsRtl="true" android:supportsRtl="true"
@ -100,7 +100,7 @@
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.VehicleAuthActivity" android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.VehicleAuthActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity <activity
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity" android:name=".ui.home.shangchuan.ShangChuangImgActivity"
android:screenOrientation="portrait"> android:screenOrientation="portrait">
<intent-filter> <intent-filter>
@ -114,7 +114,7 @@
</activity> </activity>
<activity <activity
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivityBC" android:name=".ui.home.shangchuan.ShangChuangImgActivityBC"
android:screenOrientation="portrait"> android:screenOrientation="portrait">
<intent-filter> <intent-filter>
@ -129,7 +129,7 @@
<activity <activity
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity2" android:name=".ui.home.shangchuan.ShangChuangImgActivity2"
android:screenOrientation="portrait"> android:screenOrientation="portrait">
<intent-filter> <intent-filter>
@ -142,7 +142,7 @@
</activity> </activity>
<activity <activity
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.GetShangChuanActivity" android:name=".ui.home.shangchuan.GetShangChuanActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity <activity
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.AuthQualificationActivity" android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.AuthQualificationActivity"

View File

@ -232,10 +232,6 @@ public class H5Activity extends AppCompatActivity {
} else { } else {
String url = intent.getStringExtra("url"); String url = intent.getStringExtra("url");
if (TextUtils.isEmpty(url)) {
ActivityUtils.finishToActivity(MainActivity.class, false);
return;
}
viewFile = intent.getBooleanExtra("view_file", false); viewFile = intent.getBooleanExtra("view_file", false);
if (url.startsWith("alipay")) { if (url.startsWith("alipay")) {
try { try {

View File

@ -119,9 +119,6 @@ public class JTTProcess {
//参数 ShippingNoteInfo start 接口中的参数 ShippingNoteInfo //参数 ShippingNoteInfo start 接口中的参数 ShippingNoteInfo
//这里 shippingNoteInfo 信息只需传入运单号和分单号即可 //这里 shippingNoteInfo 信息只需传入运单号和分单号即可
public static void send(Context con,StartOrderBean sob,String remark){ public static void send(Context con,StartOrderBean sob,String remark){
if (sob.getData()==null){
return;
}
ShippingNoteInfo[] snis=new ShippingNoteInfo[1]; ShippingNoteInfo[] snis=new ShippingNoteInfo[1];
ShippingNoteInfo sni=new ShippingNoteInfo(); ShippingNoteInfo sni=new ShippingNoteInfo();
sni.setShippingNoteNumber(sob.getData().getShippingNoteNumber()); sni.setShippingNoteNumber(sob.getData().getShippingNoteNumber());

View File

@ -69,18 +69,18 @@ public class TrackService extends Service {
con = this; con = this;
hyr = new HuoYuanRequset(con, hd); hyr = new HuoYuanRequset(con, hd);
Log.e("开始循环上传等待100ms", "-----"); Log.e("开始循环上传等待100ms", "-----");
new Timer().schedule(new TimerTask() { // new Timer().schedule(new TimerTask() {
@Override // @Override
public void run() { // public void run() {
snn = SPUtil.getSP(con, "order", "ShippingNoteNumber"); // snn = SPUtil.getSP(con, "order", "ShippingNoteNumber");
if (!snn.equals("")) { // if (!snn.equals("")) {
l = new LocationGDUtil(con, hd); // l = new LocationGDUtil(con, hd);
l.onCreate(); // l.onCreate();
} else { // } else {
onDestroy(); // onDestroy();
} // }
} // }
}, 100, timeSum); // }, 100, timeSum);
} }
//开始 //开始
@ -97,18 +97,18 @@ public class TrackService extends Service {
} }
public void genzong() { public void genzong() {
if (l == null || l.getLatitude() == 0d) { // if (l == null || l.getLatitude() == 0d) {
return; // return;
} // }
//经度 // //经度
tib.setLatitude(l.getLatitude() + ""); // tib.setLatitude(l.getLatitude() + "");
//纬度 // //纬度
tib.setLongitude(l.getLongitude() + ""); // tib.setLongitude(l.getLongitude() + "");
Log.e("经度", l.getLatitude() + ""); // Log.e("经度", l.getLatitude() + "");
Log.e("维度", l.getLongitude() + ""); // Log.e("维度", l.getLongitude() + "");
//单号 // //单号
tib.setShippingNoteNumber(snn); // tib.setShippingNoteNumber(snn);
hyr.trackTracking(tib); // hyr.trackTracking(tib);
} }
} }

View File

@ -54,6 +54,7 @@ import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
import com.arpa.hndahesudintocctmsdriver.request.WalletRequest; import com.arpa.hndahesudintocctmsdriver.request.WalletRequest;
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity; import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity; 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.news.NewActivity;
import com.arpa.hndahesudintocctmsdriver.ui.wallet.UpBankActivity; import com.arpa.hndahesudintocctmsdriver.ui.wallet.UpBankActivity;
import com.arpa.hndahesudintocctmsdriver.ui.web.WebOnlyOneActivity; import com.arpa.hndahesudintocctmsdriver.ui.web.WebOnlyOneActivity;
@ -726,14 +727,14 @@ public class HomeFragment extends BaseFragment {
int zStatus = zData.getStatus(); int zStatus = zData.getStatus();
int xStatus = xData.getStatus(); int xStatus = xData.getStatus();
if (zStatus == 0) {//未装货 if (zStatus == 0) {//未装货
Intent in = new Intent(con, ShangChuangImgActivity.class); Intent in = new Intent(con, ShangChuangImgActivityBC.class);
in.putExtra("type", 0); in.putExtra("type", 0);
in.putExtra("wid", zData.getId() + ""); in.putExtra("wid", zData.getId() + "");
in.putExtra("sob", gson.toJson(sob)); in.putExtra("sob", gson.toJson(sob));
in.putExtra("keys", true); in.putExtra("keys", true);
startActivity(in); startActivity(in);
} else if (zStatus == 1 && xStatus == 4) {//已装货未上传回单 } 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("type", 2);
in.putExtra("wid", zData.getId() + ""); in.putExtra("wid", zData.getId() + "");
in.putExtra("h_type", 0); in.putExtra("h_type", 0);
@ -742,7 +743,7 @@ public class HomeFragment extends BaseFragment {
} else if (zStatus == 3 && xStatus == 4) {//已上传装货回单未卸货 } else if (zStatus == 3 && xStatus == 4) {//已上传装货回单未卸货
int dis = TimeUtil.compareNowDate(TimeUtil.string2Millis(zData.getImageTakenDate(), TimeUtil.DEFAULT_FORMAT4)); int dis = TimeUtil.compareNowDate(TimeUtil.string2Millis(zData.getImageTakenDate(), TimeUtil.DEFAULT_FORMAT4));
if (dis > 5) {//大于五分钟可以接单 if (dis > 5) {//大于五分钟可以接单
Intent in = new Intent(con, ShangChuangImgActivity.class); Intent in = new Intent(con, ShangChuangImgActivityBC.class);
in.putExtra("type", 1); in.putExtra("type", 1);
in.putExtra("wid", xData.getId() + ""); in.putExtra("wid", xData.getId() + "");
in.putExtra("sob", gson.toJson(sob)); in.putExtra("sob", gson.toJson(sob));
@ -753,7 +754,7 @@ public class HomeFragment extends BaseFragment {
} }
} else if (zStatus == 3 && xStatus == 2) {//已卸货未上传卸货回单 } 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("type", 2);
in.putExtra("wid", xData.getId() + ""); in.putExtra("wid", xData.getId() + "");
in.putExtra("h_type", 1); in.putExtra("h_type", 1);
@ -869,8 +870,8 @@ public class HomeFragment extends BaseFragment {
orderNum.setText("运单号:" + sob.getData().getShippingNoteNumber()); orderNum.setText("运单号:" + sob.getData().getShippingNoteNumber());
order_state.setText("" + sob.getData().getWaybillStatus()); order_state.setText("" + sob.getData().getWaybillStatus());
try { try {
Intent serviceIn = new Intent(con, TrackService.class); // Intent serviceIn = new Intent(con, TrackService.class);
getActivity().startService(serviceIn); // getActivity().startService(serviceIn);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -231,8 +231,8 @@ public class HuoYuanFragmengt extends BaseFragment {
if(sob!=null && sob.getData()!=null && sob.getData().getWayChildren().size()>0){ if(sob!=null && sob.getData()!=null && sob.getData().getWayChildren().size()>0){
SPUtil.insSP(con,"order","ShippingNoteNumber",sob.getData().getShippingNoteNumber()); SPUtil.insSP(con,"order","ShippingNoteNumber",sob.getData().getShippingNoteNumber());
Log.e("开始轨迹上传服务","-----"); Log.e("开始轨迹上传服务","-----");
Intent serviceIn=new Intent(con,TrackService.class); // Intent serviceIn=new Intent(con,TrackService.class);
getActivity().startService(serviceIn); // getActivity().startService(serviceIn);
list.add(new ManyBean(sob.getData(),R.layout.huoyuan_yundan)); list.add(new ManyBean(sob.getData(),R.layout.huoyuan_yundan));
}else{ }else{
SPUtil.insSP(con,"order","ShippingNoteNumber",""); SPUtil.insSP(con,"order","ShippingNoteNumber","");

View File

@ -41,6 +41,7 @@ import com.amap.api.services.route.DriveStep;
import com.amap.api.services.route.RideRouteResult; import com.amap.api.services.route.RideRouteResult;
import com.amap.api.services.route.RouteSearch; import com.amap.api.services.route.RouteSearch;
import com.amap.api.services.route.WalkRouteResult; 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.CustomDialog;
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil; import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
@ -385,7 +386,7 @@ public class StartYunDanActivity extends BaseActivity {
String wid = sdw.getId() + ""; String wid = sdw.getId() + "";
if (sdw.getStatus() == 0) { if (sdw.getStatus() == 0) {
if (type == 0) { if (type == 0) {
Intent in = new Intent(con, ShangChuangImgActivity.class); Intent in = new Intent(con, ShangChuangImgActivityBC.class);
in.putExtra("type", type); in.putExtra("type", type);
in.putExtra("wid", wid); in.putExtra("wid", wid);
in.putExtra("sob", gson.toJson(sob)); in.putExtra("sob", gson.toJson(sob));
@ -395,14 +396,14 @@ public class StartYunDanActivity extends BaseActivity {
Toast.makeText(con, "您还没有装货", Toast.LENGTH_SHORT).show(); Toast.makeText(con, "您还没有装货", Toast.LENGTH_SHORT).show();
} }
} else if (sdw.getStatus() == 1) {//装货回单 } 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("type", 2);
in.putExtra("wid", wid); in.putExtra("wid", wid);
in.putExtra("h_type", type); in.putExtra("h_type", type);
in.putExtra("sob", gson.toJson(sob)); in.putExtra("sob", gson.toJson(sob));
startActivity(in); startActivity(in);
} else if (sdw.getStatus() == 2) {//上传收货单(卸货回单) } 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("type", 2);
in.putExtra("wid", wid); in.putExtra("wid", wid);
in.putExtra("h_type", type); in.putExtra("h_type", type);
@ -421,7 +422,7 @@ public class StartYunDanActivity extends BaseActivity {
if (zInfo.getReceiptUrl() != null && zInfo.getReceiptUrl().size() > 0) { if (zInfo.getReceiptUrl() != null && zInfo.getReceiptUrl().size() > 0) {
int dis = TimeUtil.compareNowDate(TimeUtil.string2Millis(zInfo.getImageTakenDate(), TimeUtil.DEFAULT_FORMAT4)); int dis = TimeUtil.compareNowDate(TimeUtil.string2Millis(zInfo.getImageTakenDate(), TimeUtil.DEFAULT_FORMAT4));
if (dis > 5) {//大于五分钟可以接单 if (dis > 5) {//大于五分钟可以接单
Intent in = new Intent(con, ShangChuangImgActivity.class); Intent in = new Intent(con, ShangChuangImgActivityBC.class);
in.putExtra("type", type); in.putExtra("type", type);
in.putExtra("wid", wid); in.putExtra("wid", wid);
in.putExtra("sob", gson.toJson(sob)); in.putExtra("sob", gson.toJson(sob));

View File

@ -18,6 +18,7 @@ import android.widget.Toast;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.alct.mdp.MDPLocationCollectionManager; import com.alct.mdp.MDPLocationCollectionManager;
import com.alct.mdp.callback.OnDownloadResultListener;
import com.alct.mdp.callback.OnResultListener; import com.alct.mdp.callback.OnResultListener;
import com.alct.mdp.model.Goods; import com.alct.mdp.model.Goods;
import com.alct.mdp.model.Image; import com.alct.mdp.model.Image;
@ -42,6 +43,7 @@ import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset; import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
import com.arpa.hndahesudintocctmsdriver.request.OCRRequest; import com.arpa.hndahesudintocctmsdriver.request.OCRRequest;
import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean; 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.request.bean.UploadReceiptInputBean;
import com.arpa.hndahesudintocctmsdriver.util.BitmapUtil; import com.arpa.hndahesudintocctmsdriver.util.BitmapUtil;
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils; import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
@ -259,6 +261,15 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
break; break;
} }
} }
if (CacheGroup.cacheList.get("genzong") != null) {
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("genzong"), BaseBean.class);
if (bb.getCode() == 200) {
Log.e("--轨迹上传--", "成功");
} else {
Log.e("--轨迹上传失败:--", bb.getMsg());
}
CacheGroup.cacheList.remove("genzong");
}
if (CacheGroup.cacheList.get("carName") != null) { if (CacheGroup.cacheList.get("carName") != null) {
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("carName"), BaseBean.class); BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("carName"), BaseBean.class);
if (bb.getCode() == 200) { if (bb.getCode() == 200) {
@ -376,14 +387,14 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
initView(null); initView(null);
customDialog = new CustomDialog(con, "正在定位当前位置..."); customDialog = new CustomDialog(con, "正在定位当前位置...");
customDialog.show(); customDialog.show();
lgdu = new LocationGDUtil(con, hd); // lgdu = new LocationGDUtil(con, hd);
//启动定位 // //启动定位
lgdu.onCreate(); // lgdu.onCreate();
tv_loaction.setOnClickListener(v -> { tv_loaction.setOnClickListener(v -> {
if (!locationKey) { // if (!locationKey) {
customDialog.show(); // customDialog.show();
lgdu.onCreate(); // lgdu.onCreate();
} // }
}); });
btnOk.setOnClickListener(v -> { btnOk.setOnClickListener(v -> {
@ -504,7 +515,7 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
} }
} }
} }
private boolean isFinish = false;
public void initLocation() { public void initLocation() {
address.setText(lgdu.getAddress()); address.setText(lgdu.getAddress());
} }
@ -523,16 +534,37 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
lub.setImageId(imgIds); lub.setImageId(imgIds);
lub.setWaybillId(wid); lub.setWaybillId(wid);
Log.e("--装货信息", gson.toJson(lub)); Log.e("--装货信息", gson.toJson(lub));
if (locationKey) {//高德定位 // if (locationKey) {//高德定位
if (keys) { if (keys) {
nfc(); MDPLocationCollectionManager.getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnDownloadResultListener() {
loadInfo(); @Override
// up_traffic_start(); public void onSuccess(Object o) {
// up_image_z();
String string = o.toString();
if (string.equals("PICKUPED")) {//安联装货单平台未装货
isFinish = true;
//平台确认装货
hyr.loading(lub);
} else {
nfc();
loadInfo();
}
upLocation(tempLoca.getLatitude()+"",tempLoca.getLongitude()+"",sob.getData().getShippingNoteNumber());
}
@Override
public void onFailure(String s, String s1) {
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
customDialog.dismiss();
}
ToastUtils.showToast(con, s1);
}
});
} }
} else { // } else {
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show(); // Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
} // }
} else { } else {
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show(); Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
@ -548,10 +580,36 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
lub.setWaybillId(wid); lub.setWaybillId(wid);
lub.setRealLoadTime(tempLoca.getTime()); lub.setRealLoadTime(tempLoca.getTime());
Log.e("--卸货信息", gson.toJson(lub)); Log.e("--卸货信息", gson.toJson(lub));
if (locationKey&&!TextUtils.isEmpty(tempLoca.address)) { // if (locationKey&&!TextUtils.isEmpty(tempLoca.address)) {
if (!TextUtils.isEmpty(tempLoca.address)) {
if (keys) { if (keys) {
nfc(); MDPLocationCollectionManager.getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnDownloadResultListener() {
uploadInfo(); @Override
public void onSuccess(Object o) {
if (o.toString().equals("UNLOADED")) {//安联装货单平台未装货
//卸货状态-平台
isFinish = true;
hyr.dischargeCargo(lub);
} else {
nfc();
uploadInfo();
}
upLocation(tempLoca.getLatitude()+"",tempLoca.getLongitude()+"",sob.getData().getShippingNoteNumber());
}
@Override
public void onFailure(String s, String s1) {
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
customDialog.dismiss();
}
ToastUtils.showToast(con, s1);
}
});
// nfc();
// uploadInfo();
} }
@ -566,9 +624,9 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
case 2: case 2:
if (imgIds != null && imgIds.size() > 0) {//卸货回单 if (imgIds != null && imgIds.size() > 0) {//卸货回单
//上传回单 //上传回单
urib.setLatitude(lgdu.getLatitude() + ""); urib.setLatitude(tempLoca.getLatitude() + "");
urib.setLongitude(lgdu.getLongitude() + ""); urib.setLongitude(tempLoca.getLongitude() + "");
urib.setLocationAddress(lgdu.getAddress()); urib.setLocationAddress(tempLoca.getAddress());
//装卸货类型 //装卸货类型
urib.setType(h_type + 1); urib.setType(h_type + 1);
//回单id 数组 //回单id 数组
@ -576,16 +634,16 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
//子运运单ID //子运运单ID
urib.setWaybillId(wid); urib.setWaybillId(wid);
Log.e("--回单信息", gson.toJson(urib)); Log.e("--回单信息", gson.toJson(urib));
if (locationKey) { // if (locationKey) {
if (index == 2 && keys && !TextUtils.isEmpty(tempLoca.address)) { if (index == 2 && keys && !TextUtils.isEmpty(tempLoca.address)) {
up_trafficSign(); up_trafficSign();
up_trafficReceipt(); up_trafficReceipt();
receipt_image(); receipt_image();
} }
hyr.receipt(urib); hyr.receipt(urib);
} else { // } else {
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show(); // Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
} // }
} else { } else {
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show(); Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
} }
@ -827,9 +885,9 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
public void onSuccess() { public void onSuccess() {
Log.e("上报安联", "装货上传成功"); Log.e("上报安联", "装货上传成功");
//交通厅 //交通厅
if (sob.getData().getReport() == 1) { // if (sob.getData().getReport() == 1) {
JTTProcess.start(con, sob, ""); // JTTProcess.start(con, sob, "");
} // }
//装货状态 //装货状态
hyr.loading(lub); hyr.loading(lub);
//装货照片 //装货照片
@ -864,9 +922,9 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
public void onSuccess() { public void onSuccess() {
Log.e("上报安联", "卸货上传成功"); Log.e("上报安联", "卸货上传成功");
//交通厅 //交通厅
if (sob.getData().getReport() == 1) { // if (sob.getData().getReport() == 1) {
JTTProcess.stop(con, sob, ""); // JTTProcess.stop(con, sob, "");
} // }
//卸货状态-平台 //卸货状态-平台
hyr.dischargeCargo4(lub); hyr.dischargeCargo4(lub);
//卸货照片-安联 //卸货照片-安联
@ -885,5 +943,11 @@ public class ShangChuangImgActivityBC extends BaseAppCompatActivity implements I
} }
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);
}
} }

View File

@ -102,8 +102,8 @@ public class BillLocationUtils {
//order_start.setVisibility(View.VISIBLE); //order_start.setVisibility(View.VISIBLE);
SPUtil.insSP(con, "order", "ShippingNoteNumber", sob.getData().getShippingNoteNumber()); SPUtil.insSP(con, "order", "ShippingNoteNumber", sob.getData().getShippingNoteNumber());
Log.e("开始轨迹上传服务", "-----"); Log.e("开始轨迹上传服务", "-----");
Intent serviceIn = new Intent(con, TrackService.class); // Intent serviceIn = new Intent(con, TrackService.class);
con.startService(serviceIn); // con.startService(serviceIn);
} else { } else {
SPUtil.insSP(con, "order", "ShippingNoteNumber", ""); SPUtil.insSP(con, "order", "ShippingNoteNumber", "");
} }

View File

@ -1,112 +0,0 @@
package com.dahe.mylibrary.utils;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.provider.Settings;
/**
* @ClassName PermissionUtils
* @Author john
* @Date 2024/12/19 14:59
* @Description TODO
*/
public class PermissionUtils {
// 私有静态实例防止被外部实例化
private static PermissionUtils instance;
// 私有构造方法防止通过 new 关键字创建实例
private PermissionUtils() {
}
// 获取单例实例
public static PermissionUtils getInstance() {
if (instance == null) {
synchronized (PermissionUtils.class) {
if (instance == null) {
instance = new PermissionUtils();
}
}
}
return instance;
}
/**
* 根据不同手机机型跳转到权限设置页面
*
* @param context 上下文
*/
public void goToAppPermissionSettings(Context context) {
Intent intent = new Intent();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (Build.FINGERPRINT.startsWith("Huawei") || Build.BRAND.startsWith("Huawei")) {
// 华为手机
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", context.getPackageName(), null);
intent.setData(uri);
} else if (Build.FINGERPRINT.startsWith("Xiaomi") || Build.BRAND.startsWith("Xiaomi")) {
// 小米手机
intent.setAction(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION);
Uri uri = Uri.parse("package:" + context.getPackageName());
intent.setData(uri);
} else if (Build.BRAND.equals("Meizu")) {
// 魅族手机
intent.setAction("com.meizu.safe.security.SHOW_APPSEC");
intent.addCategory(Intent.CATEGORY_DEFAULT);
intent.putExtra("packageName", context.getPackageName());
} else if (Build.FINGERPRINT.startsWith("OPPO") || Build.BRAND.startsWith("OPPO")) {
// OPPO手机
try {
String pkgName = context.getPackageName();
String className = "com.coloros.safecenter.permission.PermissionManagerActivity";
intent.setClassName("com.coloros.safecenter", className);
intent.putExtra("packageName", pkgName);
intent.putExtra("appName", context.getResources().getString(context.getApplicationInfo().labelRes));
intent.putExtra("opType", "4"); // 4 表示权限管理页面
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
} catch (Exception e) {
// 如果找不到OPPO的特定页面则使用通用页面
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", context.getPackageName(), null);
intent.setData(uri);
}
} else if (Build.FINGERPRINT.startsWith("vivo") || Build.BRAND.startsWith("vivo")) {
// vivo手机
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", context.getPackageName(), null);
intent.setData(uri);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName());
} else if (Build.BRAND.equals("samsung")) {
// 三星手机
try {
String pkgName = context.getPackageName();
Intent intent2 = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS");
intent2.addCategory(Intent.CATEGORY_DEFAULT);
intent2.setData(Uri.parse("package:" + pkgName));
intent2.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent2.putExtra("com.android.providers.media.EXTRA_APP_PACKAGE", pkgName);
context.startActivity(intent2);
return; // 使用三星特定的页面不需要继续执行通用代码
} catch (Exception e) {
// 如果三星特定页面失败则使用通用页面
}
} else {
// 其他手机使用通用页面
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", context.getPackageName(), null);
intent.setData(uri);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName());
}
} else {
// 低于Android 6.0M的版本使用通用页面
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", context.getPackageName(), null);
intent.setData(uri);
}
context.startActivity(intent);
}
}