修复百度定位不准确,添加六分钟卸货限制,gradle优化
This commit is contained in:
parent
f4d2048d81
commit
3955131756
@ -16,19 +16,21 @@ android {
|
||||
keyPassword '123456'
|
||||
storeFile file('key.jks')
|
||||
storePassword '123456'
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
debug {
|
||||
keyAlias 'key0'
|
||||
keyPassword '123456'
|
||||
storeFile file('key.jks')
|
||||
storePassword '123456'
|
||||
}
|
||||
release {
|
||||
keyAlias 'key0'
|
||||
keyPassword '123456'
|
||||
storeFile file('key.jks')
|
||||
storePassword '123456'
|
||||
}
|
||||
// debug {
|
||||
// keyAlias 'key0'
|
||||
// keyPassword '123456'
|
||||
// storeFile file('key.jks')
|
||||
// storePassword '123456'
|
||||
// }
|
||||
// release {
|
||||
// keyAlias 'key0'
|
||||
// keyPassword '123456'
|
||||
// storeFile file('key.jks')
|
||||
// storePassword '123456'
|
||||
// }
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
@ -86,9 +88,10 @@ android {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
signingConfig signingConfigs.config
|
||||
}
|
||||
debug {
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
signingConfig signingConfigs.config
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
@ -116,12 +119,16 @@ android {
|
||||
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi-staging.alct56.com\"")
|
||||
buildConfigField("String", "BASE_URL", "\"http://app.test.dahehuoyun.com/api/\"")
|
||||
buildConfigField "boolean", "isTest", "true"
|
||||
//APP名称,可以在androidMainfest中引用
|
||||
resValue "string", "appName", "司机测试"
|
||||
}
|
||||
product {
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "大河好运司机"]
|
||||
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", "大河好运司机"
|
||||
}
|
||||
|
||||
}
|
||||
@ -133,9 +140,14 @@ android {
|
||||
android.applicationVariants.all { variant ->
|
||||
variant.outputs.all {
|
||||
def date = new Date().format("MMdd_HH-mm" , TimeZone.getTimeZone("GMT+08"))
|
||||
if(variant.buildType.name.equals('release')){
|
||||
outputFileName = "dhhy-driver-"+date+"-${versionName}.apk"
|
||||
def isText = variant.productFlavors[0].properties.get("buildConfigFields").getAt("isTest").properties.get("value")
|
||||
def appName = null
|
||||
if (isText=="true") {
|
||||
appName = '大河好运司机测试_'
|
||||
}else{
|
||||
appName = '大河好运司机_'
|
||||
}
|
||||
outputFileName =appName+"${variant.buildType.name}_${defaultConfig.versionName}_${date}.apk"
|
||||
}
|
||||
}
|
||||
lintOptions {
|
||||
|
@ -54,13 +54,13 @@
|
||||
android:allowBackup="true"
|
||||
android:excludeFromRecents="true"
|
||||
android:icon="@drawable/diver_logo"
|
||||
android:label="@string/app_name"
|
||||
android:label="@string/appName"
|
||||
android:largeHeap="true"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:usesCleartextTraffic="true"
|
||||
tools:replace="android:icon">
|
||||
tools:replace="android:label,android:allowBackup">
|
||||
|
||||
<uses-library
|
||||
android:name="com/alct/mdp"
|
||||
|
@ -317,14 +317,14 @@ public class H5Activity extends AppCompatActivity {
|
||||
FaceEvent he = new FaceEvent("刷脸成功");
|
||||
EventBus.getDefault().post(he);
|
||||
finish();
|
||||
}, 1500);
|
||||
}, 800);
|
||||
tsignCode = "签署成功";
|
||||
} else {
|
||||
tsignCode = "签署失败";
|
||||
}
|
||||
Toast.makeText(H5Activity.this, "签署结果: " + tsignCode, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
finish();
|
||||
// finish();
|
||||
return true;
|
||||
} else if (uri.getScheme().equals("alipays")) {
|
||||
// 跳转到支付宝刷脸
|
||||
|
@ -1,13 +1,10 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.cuspop
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.view.View
|
||||
import com.arpa.hndahesudintocctmsdriver.R
|
||||
import com.dahe.mylibrary.utils.BaseUtils
|
||||
import com.dahe.mylibrary.utils.ToastUtils
|
||||
import com.lxj.xpopup.core.CenterPopupView
|
||||
import kotlinx.android.synthetic.main.load.view.*
|
||||
import kotlinx.android.synthetic.main.pop_message_center.view.*
|
||||
@ -52,11 +49,10 @@ class MessagePop(context: Context) : CenterPopupView(context), View.OnClickListe
|
||||
R.id.tvOk,R.id.tvPhone -> {
|
||||
dismiss()
|
||||
val toString = tvPhone.text.toString()
|
||||
val intent = Intent(Intent.ACTION_CALL)
|
||||
val intent = Intent(Intent.ACTION_DIAL)
|
||||
val data = Uri.parse("tel:$toString")
|
||||
intent.data = data
|
||||
context.startActivity(intent)
|
||||
dismiss()
|
||||
// BaseUtils.callPhone(content as Activity, tvPhone.text.toString())
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,10 @@ 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.util.alert.ToastUtil;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.dahe.mylibrary.utils.TimeUtil;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||
import com.google.gson.Gson;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
@ -135,7 +138,8 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
break;
|
||||
case 15:
|
||||
break;
|
||||
default:break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -203,7 +207,8 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
Glide.with(con).load(ub.getData().getHeadportraitUrl()).into(head_img);
|
||||
}
|
||||
break;
|
||||
default: break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -359,16 +364,12 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
Toast.makeText(con, "您还没有装货", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else if (sdw.getStatus() == 1) {//装货回单
|
||||
if(type==0){
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
in.putExtra("type", 2);
|
||||
in.putExtra("wid", wid);
|
||||
in.putExtra("h_type", type);
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
startActivity(in);
|
||||
}else{
|
||||
Toast.makeText(con,"您还没有上传回单信息",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else if (sdw.getStatus() == 2) {//上传收货单(卸货回单)
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
in.putExtra("type", 2);
|
||||
@ -382,12 +383,30 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
in.putExtra("sdwStr", gson.toJson(sdw));
|
||||
startActivity(in);
|
||||
} else {//卸货照片
|
||||
StartOrderBean.DataDTO.WayChildrenDTO zInfo;
|
||||
for (int i = 0; i < sob.getData().getWayChildren().size(); i++) {
|
||||
if (sob.getData().getWayChildren().get(i).getType() == 1) {
|
||||
zInfo = sob.getData().getWayChildren().get(i);
|
||||
int dis = TimeUtil.compareNowDate(TimeUtil.string2Millis(zInfo.getImageTakenDate(), TimeUtil.DEFAULT_FORMAT4));
|
||||
if (dis > 5) {
|
||||
if (zInfo.getReceiptUrl() != null && zInfo.getReceiptUrl().size() > 0) {
|
||||
Intent in = new Intent(con, ShangChuangImgActivity.class);
|
||||
in.putExtra("type", type);
|
||||
in.putExtra("wid", wid);
|
||||
in.putExtra("sob", gson.toJson(sob));
|
||||
in.putExtra("keys", key);
|
||||
startActivity(in);
|
||||
break;
|
||||
} else {
|
||||
ToastUtils.showToast(StartYunDanActivity.this, "请先上传出货单,再进行卸货操作!");
|
||||
}
|
||||
} else {//大于五分钟可以接单
|
||||
ToastUtils.showToast(StartYunDanActivity.this, "装卸货时间间隔过短,请稍后重试!");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -421,7 +440,8 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
//str="待卸货";
|
||||
str = "确认卸货";
|
||||
break;
|
||||
default:break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
@ -457,6 +477,7 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
super.onSaveInstanceState(outState);
|
||||
map.onSaveInstanceState(outState);
|
||||
}
|
||||
|
||||
LocationSource.OnLocationChangedListener mListener;
|
||||
AMapLocationClient mlocationClient;
|
||||
AMapLocationClientOption mLocationOption;
|
||||
@ -575,7 +596,6 @@ public class StartYunDanActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
|
||||
|
||||
class OnRouteSearchListener implements RouteSearch.OnRouteSearchListener {
|
||||
|
||||
@Override
|
||||
|
@ -19,7 +19,6 @@ import com.alct.mdp.callback.OnResultListener;
|
||||
import com.alct.mdp.model.Goods;
|
||||
import com.alct.mdp.model.Image;
|
||||
import com.alct.mdp.model.Location;
|
||||
import com.arpa.hndahesudintocctmsdriver.H5Activity;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.ALProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
@ -30,7 +29,12 @@ import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.img.GetCarImageAlert;
|
||||
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.utils.CoordinateConverter;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.luck.picture.lib.PictureSelector;
|
||||
import com.luck.picture.lib.config.PictureConfig;
|
||||
@ -233,14 +237,16 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
lgdu.onCreate();
|
||||
lu = new LocationUtil(con, hd);
|
||||
lu.onCreate();
|
||||
if (keys) {
|
||||
lu = new LocationUtil(con, hd);
|
||||
lu.onCreate();
|
||||
}
|
||||
// if (keys) {
|
||||
// lu = new LocationUtil(con, hd);
|
||||
// lu.onCreate();
|
||||
// }
|
||||
tv_loaction.setOnClickListener(v -> {
|
||||
if (!locationKey) {
|
||||
customDialog.show();
|
||||
lgdu.onCreate();
|
||||
lu = new LocationUtil(con, hd);
|
||||
lu.onCreate();
|
||||
}
|
||||
});
|
||||
hyr = new HuoYuanRequset(con, hd);
|
||||
@ -348,9 +354,12 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
lub.setImageId(imgIds);
|
||||
lub.setWaybillId(wid);
|
||||
Log.e("--装货信息", gson.toJson(lub));
|
||||
if (locationKey) {
|
||||
|
||||
if (locationKey) {//高德定位
|
||||
if (keys) {
|
||||
if (lu!=null&&lu.getErrorCode()!=161){
|
||||
ToastUtils.showToast(this,"百度地图定位失败,请确认开启定位后重试!");
|
||||
return;
|
||||
}
|
||||
nfc();
|
||||
loadInfo();
|
||||
// up_traffic_start();
|
||||
@ -375,6 +384,10 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
Log.e("--卸货信息", gson.toJson(lub));
|
||||
if (locationKey) {
|
||||
if (keys) {
|
||||
if (lu!=null&&lu.getErrorCode()!=161){
|
||||
ToastUtils.showToast(this,"百度地图定位失败,请确认开启定位后重试!");
|
||||
return;
|
||||
}
|
||||
nfc();
|
||||
uploadInfo();
|
||||
|
||||
@ -403,6 +416,10 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
Log.e("--回单信息", gson.toJson(urib));
|
||||
if (locationKey) {
|
||||
if (index == 2 && keys) {
|
||||
if (lu!=null&&lu.getErrorCode()!=161){
|
||||
ToastUtils.showToast(this,"百度地图定位失败,请确认开启定位后重试!");
|
||||
return;
|
||||
}
|
||||
up_trafficSign();
|
||||
up_trafficReceipt();
|
||||
receipt_image();
|
||||
|
@ -20,6 +20,7 @@ public class LocationUtil{
|
||||
|
||||
private double latitude;
|
||||
private double longitude;
|
||||
private int errorCode;
|
||||
private String address;
|
||||
private Context con;
|
||||
private Handler hd;
|
||||
@ -39,6 +40,10 @@ public class LocationUtil{
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public double getErrorCode() {
|
||||
return errorCode;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
@ -62,7 +67,7 @@ public class LocationUtil{
|
||||
//LocationMode.Hight_Accuracy:高精度;
|
||||
//LocationMode. Battery_Saving:低功耗;
|
||||
//LocationMode. Device_Sensors:仅使用设备;
|
||||
option.setCoorType("GCJ02");
|
||||
option.setCoorType("BD09ll");
|
||||
//可选,设置返回经纬度坐标类型,默认GCJ02
|
||||
//GCJ02:国测局坐标;
|
||||
//BD09ll:百度经纬度坐标;
|
||||
@ -112,7 +117,8 @@ public class LocationUtil{
|
||||
float radius = location.getRadius(); //获取定位精度,默认值为0.0f
|
||||
String coorType = location.getCoorType();
|
||||
//获取经纬度坐标类型,以LocationClientOption中设置过的坐标类型为准
|
||||
int errorCode = location.getLocType();
|
||||
errorCode = location.getLocType();
|
||||
String locTypeDescription = location.getLocTypeDescription();
|
||||
//获取定位类型、定位错误返回码,具体信息可参照类参考中BDLocation类中的说明
|
||||
Log.e("定位位置address",address+"");
|
||||
Log.e("定位坐标latitude",latitude+"");
|
||||
|
@ -1,5 +1,5 @@
|
||||
<resources>
|
||||
<string name="app_name">大河好运司机</string>
|
||||
<!-- <string name="appName">大河好运司机</string>-->
|
||||
<!--设置界面-->
|
||||
<string name="alivc_recorder_setting_min_record_duration">最小时长</string>
|
||||
<string name="alivc_recorder_setting_max_record_duration">最大时长</string>
|
||||
|
@ -179,6 +179,7 @@ public final class TimeUtil {
|
||||
private static final DateFormat DEFAULT_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
|
||||
private static final DateFormat DEFAULT_FORMAT2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZSS:SS", Locale.getDefault());
|
||||
private static final DateFormat DEFAULT_FORMAT3 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault());
|
||||
public static final DateFormat DEFAULT_FORMAT4 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.getDefault());
|
||||
|
||||
private TimeUtil() {
|
||||
throw new UnsupportedOperationException("u can't instantiate me...");
|
||||
@ -1700,4 +1701,22 @@ public final class TimeUtil {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 得到二个日期间的间隔天数
|
||||
*
|
||||
* @return 间格的天数(null表示时间格式不正确)
|
||||
*/
|
||||
public static int compareNowDate(long comTime) {
|
||||
int min;
|
||||
try {
|
||||
min = (int) ((getNowMills() - comTime) / (60 * 1000));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return 0;
|
||||
}
|
||||
|
||||
return min;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user