Merge branch 'master' into ocrcamera

This commit is contained in:
lijia 2023-09-11 15:32:25 +08:00
commit 68d411e544
10 changed files with 316 additions and 242 deletions

View File

@ -16,19 +16,21 @@ android {
keyPassword '123456' keyPassword '123456'
storeFile file('key.jks') storeFile file('key.jks')
storePassword '123456' storePassword '123456'
v1SigningEnabled true
v2SigningEnabled true
} }
debug { // debug {
keyAlias 'key0' // keyAlias 'key0'
keyPassword '123456' // keyPassword '123456'
storeFile file('key.jks') // storeFile file('key.jks')
storePassword '123456' // storePassword '123456'
} // }
release { // release {
keyAlias 'key0' // keyAlias 'key0'
keyPassword '123456' // keyPassword '123456'
storeFile file('key.jks') // storeFile file('key.jks')
storePassword '123456' // storePassword '123456'
} // }
} }
defaultConfig { defaultConfig {
@ -86,9 +88,10 @@ android {
release { release {
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
} }
debug { debug {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.config
} }
} }
compileOptions { compileOptions {
@ -116,12 +119,16 @@ android {
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi-staging.alct56.com\"") buildConfigField("String", "OPEN_AL_URL", "\"https://oapi-staging.alct56.com\"")
buildConfigField("String", "BASE_URL", "\"http://app.test.dahehuoyun.com/api/\"") buildConfigField("String", "BASE_URL", "\"http://app.test.dahehuoyun.com/api/\"")
buildConfigField "boolean", "isTest", "true" buildConfigField "boolean", "isTest", "true"
//APP名称androidMainfest中引用
resValue "string", "appName", "司机测试"
} }
product { product {
manifestPlaceholders = [CHANNEL_VALUE: "大河好运司机"] manifestPlaceholders = [CHANNEL_VALUE: "大河好运司机"]
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi.alct56.com\"") buildConfigField("String", "OPEN_AL_URL", "\"https://oapi.alct56.com\"")
buildConfigField("String", "BASE_URL", "\"http://app.dahehuoyun.com/api/\"") buildConfigField("String", "BASE_URL", "\"http://app.dahehuoyun.com/api/\"")
buildConfigField "boolean", "isTest", "false" buildConfigField "boolean", "isTest", "false"
//APP名称androidMainfest中引用
resValue "string", "appName", "大河好运司机"
} }
} }
@ -133,9 +140,14 @@ android {
android.applicationVariants.all { variant -> android.applicationVariants.all { variant ->
variant.outputs.all { variant.outputs.all {
def date = new Date().format("MMdd_HH-mm" , TimeZone.getTimeZone("GMT+08")) def date = new Date().format("MMdd_HH-mm" , TimeZone.getTimeZone("GMT+08"))
if(variant.buildType.name.equals('release')){ def isText = variant.productFlavors[0].properties.get("buildConfigFields").getAt("isTest").properties.get("value")
outputFileName = "dhhy-driver-"+date+"-${versionName}.apk" def appName = null
if (isText=="true") {
appName = '大河好运司机测试_'
}else{
appName = '大河好运司机_'
} }
outputFileName =appName+"${variant.buildType.name}_${defaultConfig.versionName}_${date}.apk"
} }
} }
lintOptions { lintOptions {

View File

@ -54,13 +54,13 @@
android:allowBackup="true" android:allowBackup="true"
android:excludeFromRecents="true" android:excludeFromRecents="true"
android:icon="@drawable/diver_logo" android:icon="@drawable/diver_logo"
android:label="@string/app_name" android:label="@string/appName"
android:largeHeap="true" android:largeHeap="true"
android:requestLegacyExternalStorage="true" android:requestLegacyExternalStorage="true"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme" android:theme="@style/AppTheme"
android:usesCleartextTraffic="true" android:usesCleartextTraffic="true"
tools:replace="android:icon"> tools:replace="android:label,android:allowBackup">
<uses-library <uses-library
android:name="com/alct/mdp" android:name="com/alct/mdp"

View File

@ -312,16 +312,19 @@ public class H5Activity extends AppCompatActivity {
} else { } else {
String tsignCode = uri.getQueryParameter("tsignCode"); String tsignCode = uri.getQueryParameter("tsignCode");
if ("0".equals(tsignCode)) { if ("0".equals(tsignCode)) {
//延时1.5秒跳转运单详情页面
new Handler().postDelayed(() -> {
FaceEvent he = new FaceEvent("刷脸成功"); FaceEvent he = new FaceEvent("刷脸成功");
EventBus.getDefault().post(he); EventBus.getDefault().post(he);
finish(); finish();
}, 800);
tsignCode = "签署成功"; tsignCode = "签署成功";
} else { } else {
tsignCode = "签署失败"; tsignCode = "签署失败";
} }
Toast.makeText(H5Activity.this, "签署结果: " + tsignCode, Toast.LENGTH_LONG).show(); Toast.makeText(H5Activity.this, "签署结果: " + tsignCode, Toast.LENGTH_LONG).show();
} }
finish(); // finish();
return true; return true;
} else if (uri.getScheme().equals("alipays")) { } else if (uri.getScheme().equals("alipays")) {
// 跳转到支付宝刷脸 // 跳转到支付宝刷脸

View File

@ -1,13 +1,10 @@
package com.arpa.hndahesudintocctmsdriver.cuspop package com.arpa.hndahesudintocctmsdriver.cuspop
import android.app.Activity
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.net.Uri import android.net.Uri
import android.view.View import android.view.View
import com.arpa.hndahesudintocctmsdriver.R import com.arpa.hndahesudintocctmsdriver.R
import com.dahe.mylibrary.utils.BaseUtils
import com.dahe.mylibrary.utils.ToastUtils
import com.lxj.xpopup.core.CenterPopupView import com.lxj.xpopup.core.CenterPopupView
import kotlinx.android.synthetic.main.load.view.* import kotlinx.android.synthetic.main.load.view.*
import kotlinx.android.synthetic.main.pop_message_center.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 -> { R.id.tvOk,R.id.tvPhone -> {
dismiss() dismiss()
val toString = tvPhone.text.toString() val toString = tvPhone.text.toString()
val intent = Intent(Intent.ACTION_CALL) val intent = Intent(Intent.ACTION_DIAL)
val data = Uri.parse("tel:$toString") val data = Uri.parse("tel:$toString")
intent.data = data intent.data = data
context.startActivity(intent) context.startActivity(intent)
dismiss()
// BaseUtils.callPhone(content as Activity, tvPhone.text.toString()) // BaseUtils.callPhone(content as Activity, tvPhone.text.toString())
} }
} }

View File

@ -141,6 +141,7 @@ public class ALProcess {
MDPLocationCollectionManager.register(con, idy, new OnResultListener() { MDPLocationCollectionManager.register(con, idy, new OnResultListener() {
@Override @Override
public void onSuccess() { public void onSuccess() {
MsgUtil.addHdMsgWatBody(hd, 1111,"认证成功");
Log.e("--success--","验证成功"); Log.e("--success--","验证成功");
getFq(con); getFq(con);
} }

View File

@ -40,7 +40,10 @@ 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.util.alert.ToastUtil;
import com.bumptech.glide.Glide; 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.android.material.bottomsheet.BottomSheetBehavior;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.arpa.hndahesudintocctmsdriver.R; import com.arpa.hndahesudintocctmsdriver.R;
@ -73,11 +76,11 @@ import java.util.List;
public class StartYunDanActivity extends BaseActivity { public class StartYunDanActivity extends BaseActivity {
public static final String GET_EVALUTE="getEvalute"; public static final String GET_EVALUTE = "getEvalute";
public static final String KEEP_EVALUTE="keepEvalte"; public static final String KEEP_EVALUTE = "keepEvalte";
public static final String GET_COMPLAINT="getComplaint"; public static final String GET_COMPLAINT = "getComplaint";
private String TAG="StartYunDanActivity"; private String TAG = "StartYunDanActivity";
private NestedScrollView bottomSheet; private NestedScrollView bottomSheet;
private MapView map; private MapView map;
private BaseRecyclerView brv; private BaseRecyclerView brv;
@ -85,57 +88,58 @@ public class StartYunDanActivity extends BaseActivity {
private LinearLayout protect; private LinearLayout protect;
//private RelativeLayout title_rl; //private RelativeLayout title_rl;
private TextView title; private TextView title;
private ScoreView sv1,sv2; private ScoreView sv1, sv2;
private Gson gson=new Gson(); private Gson gson = new Gson();
private StartOrderBean sob; private StartOrderBean sob;
private WNewsBean wnb; private WNewsBean wnb;
private HuoYuanRequset hyr; private HuoYuanRequset hyr;
//是否处于展开状态 //是否处于展开状态
private boolean key=false; private boolean key = false;
private int id=0; private int id = 0;
LocationGDUtil ld; LocationGDUtil ld;
@Override @Override
public void msgMethod(Message m) { public void msgMethod(Message m) {
super.msgMethod(m); super.msgMethod(m);
switch (m.what){ switch (m.what) {
case RequsetCodeConstants.SUCCESS: case RequsetCodeConstants.SUCCESS:
//获取页面数据 //获取页面数据
if (CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER)!=null && CacheGroup.cacheList.get(GET_EVALUTE)!=null) { if (CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER) != null && CacheGroup.cacheList.get(GET_EVALUTE) != null) {
Log.e("-评论-",CacheGroup.cacheList.get(GET_EVALUTE)); Log.e("-评论-", CacheGroup.cacheList.get(GET_EVALUTE));
Log.e("-运单-",CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER)); Log.e("-运单-", CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER));
sob=gson.fromJson(CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER), StartOrderBean.class); sob = gson.fromJson(CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER), StartOrderBean.class);
wnb=gson.fromJson(CacheGroup.cacheList.get(GET_EVALUTE), WNewsBean.class); wnb = gson.fromJson(CacheGroup.cacheList.get(GET_EVALUTE), WNewsBean.class);
if(sob.getCode()==200 && sob.getData()!=null){ if (sob.getCode() == 200 && sob.getData() != null) {
id = sob.getData().getWaybillId(); id = sob.getData().getWaybillId();
initView(null); initView(null);
}else if(sob.getData()==null){ } else if (sob.getData() == null) {
// Toast.makeText(con,"运单执行结束",Toast.LENGTH_SHORT).show(); // Toast.makeText(con,"运单执行结束",Toast.LENGTH_SHORT).show();
SPUtil.insSP(con,"order","ShippingNoteNumber",""); SPUtil.insSP(con, "order", "ShippingNoteNumber", "");
UiAuxiliary.homeRequest("运单结束"); UiAuxiliary.homeRequest("运单结束");
// finish(); // finish();
}else{ } else {
Toast.makeText(con,sob.getMsg(),Toast.LENGTH_SHORT).show(); Toast.makeText(con, sob.getMsg(), Toast.LENGTH_SHORT).show();
} }
CacheGroup.cacheList.remove(HuoYuanFragmengt.START_ORDER); CacheGroup.cacheList.remove(HuoYuanFragmengt.START_ORDER);
CacheGroup.cacheList.remove(GET_EVALUTE); CacheGroup.cacheList.remove(GET_EVALUTE);
} }
//保存评价 //保存评价
if(CacheGroup.cacheList.get(KEEP_EVALUTE)!=null){ if (CacheGroup.cacheList.get(KEEP_EVALUTE) != null) {
BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(KEEP_EVALUTE),BaseBean.class); BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(KEEP_EVALUTE), BaseBean.class);
if(bb.getCode()==200){ if (bb.getCode() == 200) {
Toast.makeText(con,"评价保存成功",Toast.LENGTH_SHORT).show(); Toast.makeText(con, "评价保存成功", Toast.LENGTH_SHORT).show();
hyr.startOrder(id); hyr.startOrder(id);
hyr.getEvaluate(id); hyr.getEvaluate(id);
}else{ } else {
Toast.makeText(con,bb.getMsg(),Toast.LENGTH_SHORT).show(); Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
} }
CacheGroup.cacheList.remove(KEEP_EVALUTE); CacheGroup.cacheList.remove(KEEP_EVALUTE);
} }
break; break;
case 15: case 15:
break; break;
default:break; default:
break;
} }
} }
@ -147,28 +151,28 @@ public class StartYunDanActivity extends BaseActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
StateStyleUtil.stateTextColor(this); StateStyleUtil.stateTextColor(this);
setContentView(R.layout.activity_yundan_start); setContentView(R.layout.activity_yundan_start);
con=this; con = this;
id=getIntent().getExtras().getInt("id"); id = getIntent().getExtras().getInt("id");
brv=findViewById(R.id.brv); brv = findViewById(R.id.brv);
protect=findViewById(R.id.protect); protect = findViewById(R.id.protect);
title=findViewById(R.id.title); title = findViewById(R.id.title);
bottomSheet =findViewById(R.id.bottom_sheet); bottomSheet = findViewById(R.id.bottom_sheet);
BottomSheetBehavior mBottomSheetBehavior = BottomSheetBehavior.from(bottomSheet); BottomSheetBehavior mBottomSheetBehavior = BottomSheetBehavior.from(bottomSheet);
mBottomSheetBehavior.setHideable(false); mBottomSheetBehavior.setHideable(false);
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED); mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
//mBottomSheetBehavior.set //mBottomSheetBehavior.set
map=findViewById(R.id.map); map = findViewById(R.id.map);
map.onCreate(savedInstanceState); map.onCreate(savedInstanceState);
if (aMap == null) { if (aMap == null) {
aMap = map.getMap(); aMap = map.getMap();
initLoaction(); initLoaction();
} }
Log.e("--id--",""+id); Log.e("--id--", "" + id);
String userdata= SPUtil.getSP(con,"data","userdata"); String userdata = SPUtil.getSP(con, "data", "userdata");
if(!userdata.equals("")){ if (!userdata.equals("")) {
ub=gson.fromJson(userdata,UserBean.class); ub = gson.fromJson(userdata, UserBean.class);
} }
hyr=new HuoYuanRequset(con,hd); hyr = new HuoYuanRequset(con, hd);
// hyr.startOrder(id); // hyr.startOrder(id);
// hyr.getEvaluate(id); // hyr.getEvaluate(id);
} }
@ -184,59 +188,60 @@ public class StartYunDanActivity extends BaseActivity {
//控件隐藏的动画 //控件隐藏的动画
mHiddenAmin = new AlphaAnimation(1.0f, 0.0f); mHiddenAmin = new AlphaAnimation(1.0f, 0.0f);
mHiddenAmin.setDuration(1000); mHiddenAmin.setDuration(1000);
List<ManyBean> list=new ArrayList<>(); List<ManyBean> list = new ArrayList<>();
//list.add(new ManyBean(new model(),R.layout.yundan_start_top)); //list.add(new ManyBean(new model(),R.layout.yundan_start_top));
list.add(new ManyBean(sob.getData(),R.layout.item_yundan_yunxing)); list.add(new ManyBean(sob.getData(), R.layout.item_yundan_yunxing));
list.add(new ManyBean(sob.getData(),R.layout.yundan_start_bottom)); list.add(new ManyBean(sob.getData(), R.layout.yundan_start_bottom));
brv.creates(con,list).setOnItemViewListener((position, o, v, layout) -> { brv.creates(con, list).setOnItemViewListener((position, o, v, layout) -> {
switch (layout){ switch (layout) {
case R.layout.yundan_start_top: case R.layout.yundan_start_top:
ImageButton return_btn=v.findViewById(R.id.return_btn); ImageButton return_btn = v.findViewById(R.id.return_btn);
return_btn.setOnClickListener(v1 -> finish()); return_btn.setOnClickListener(v1 -> finish());
break; break;
case R.layout.yundan_start_bottom: case R.layout.yundan_start_bottom:
initStartBody(v); initStartBody(v);
break; break;
case R.layout.item_yundan_yunxing: case R.layout.item_yundan_yunxing:
ImageView head_img=v.findViewById(R.id.head_img); ImageView head_img = v.findViewById(R.id.head_img);
if(ub!=null && ub.getData()!=null && !ub.getData().getHeadportraitUrl().equals("")){ if (ub != null && ub.getData() != null && !ub.getData().getHeadportraitUrl().equals("")) {
Glide.with(con).load(ub.getData().getHeadportraitUrl()).into(head_img); Glide.with(con).load(ub.getData().getHeadportraitUrl()).into(head_img);
} }
break; break;
default: break; default:
break;
} }
}); });
} }
private boolean iskey=false; private boolean iskey = false;
private void initStartBody(View v){ private void initStartBody(View v) {
LinearLayout jiesuan=v.findViewById(R.id.jiesuan); LinearLayout jiesuan = v.findViewById(R.id.jiesuan);
// if(id==0){ // if(id==0){
// jiesuan.setVisibility(View.GONE); // jiesuan.setVisibility(View.GONE);
// }else{ // }else{
// jiesuan.setVisibility(View.VISIBLE); // jiesuan.setVisibility(View.VISIBLE);
// } // }
sv1=v.findViewById(R.id.score1); sv1 = v.findViewById(R.id.score1);
sv2=v.findViewById(R.id.score2); sv2 = v.findViewById(R.id.score2);
sv1.initView(); sv1.initView();
sv2.initView(); sv2.initView();
sv1.setScore(5); sv1.setScore(5);
//设置是否可以修改评分默认为true //设置是否可以修改评分默认为true
TextView pl_submit=v.findViewById(R.id.pl_submit); TextView pl_submit = v.findViewById(R.id.pl_submit);
TextView m_pl_value=v.findViewById(R.id.m_pl_value); TextView m_pl_value = v.findViewById(R.id.m_pl_value);
TextView pl_value=v.findViewById(R.id.pl_value); TextView pl_value = v.findViewById(R.id.pl_value);
if(wnb.getData()!=null){ if (wnb.getData() != null) {
for (WNewsBean.DataDTO datum : wnb.getData()) { for (WNewsBean.DataDTO datum : wnb.getData()) {
if(datum.getType()==0){ if (datum.getType() == 0) {
sv1.setScore(datum.getAttitudeScore()); sv1.setScore(datum.getAttitudeScore());
m_pl_value.setText(datum.getContent()); m_pl_value.setText(datum.getContent());
pl_submit.setVisibility(View.GONE); pl_submit.setVisibility(View.GONE);
sv1.setUpKey(false); sv1.setUpKey(false);
m_pl_value.setEnabled(false); m_pl_value.setEnabled(false);
} }
if(datum.getType()==1){ if (datum.getType() == 1) {
Log.e("分数",datum.getAttitudeScore()+"_"); Log.e("分数", datum.getAttitudeScore() + "_");
sv2.setScore(datum.getAttitudeScore()); sv2.setScore(datum.getAttitudeScore());
pl_value.setText(datum.getContent()); pl_value.setText(datum.getContent());
} }
@ -244,45 +249,45 @@ public class StartYunDanActivity extends BaseActivity {
} }
sv2.setUpKey(false); sv2.setUpKey(false);
pl_submit.setOnClickListener(v12 -> { pl_submit.setOnClickListener(v12 -> {
String evaluate=m_pl_value.getText()+""; String evaluate = m_pl_value.getText() + "";
if(id!=0){ if (id != 0) {
if(evaluate.length()>=5){ if (evaluate.length() >= 5) {
Log.e("星星",""+sv1.getScore()); Log.e("星星", "" + sv1.getScore());
hyr.keepEvaluate(sv1.getScore(),m_pl_value.getText()+"",id); hyr.keepEvaluate(sv1.getScore(), m_pl_value.getText() + "", id);
}else{ } else {
Toast.makeText(con,"写够5个字才是好司机~",Toast.LENGTH_SHORT).show(); Toast.makeText(con, "写够5个字才是好司机~", Toast.LENGTH_SHORT).show();
} }
}else{ } else {
Toast.makeText(con,"运单尚未结束",Toast.LENGTH_SHORT).show(); Toast.makeText(con, "运单尚未结束", Toast.LENGTH_SHORT).show();
} }
}); });
Button complaint=v.findViewById(R.id.complaint); Button complaint = v.findViewById(R.id.complaint);
complaint.setOnClickListener(v1 -> { complaint.setOnClickListener(v1 -> {
Intent in=new Intent(con, OrderComplaintActivity.class); Intent in = new Intent(con, OrderComplaintActivity.class);
in.putExtra("id",id); in.putExtra("id", id);
startActivity(in); startActivity(in);
}); });
BaseRecyclerView bv_zhuang=v.findViewById(R.id.bv_zhuang); BaseRecyclerView bv_zhuang = v.findViewById(R.id.bv_zhuang);
BaseRecyclerView bv_xie=v.findViewById(R.id.bv_xie); BaseRecyclerView bv_xie = v.findViewById(R.id.bv_xie);
//bv_zhuang.set //bv_zhuang.set
List<Object> list_zhuang=new ArrayList<>(); List<Object> list_zhuang = new ArrayList<>();
List<Object> list_xie=new ArrayList<>(); List<Object> list_xie = new ArrayList<>();
for(int i=0;i<sob.getData().getWayChildren().size();i++){ for (int i = 0; i < sob.getData().getWayChildren().size(); i++) {
StartOrderBean.DataDTO.WayChildrenDTO sdw=sob.getData().getWayChildren().get(i); StartOrderBean.DataDTO.WayChildrenDTO sdw = sob.getData().getWayChildren().get(i);
if(sdw.getType()==1){ if (sdw.getType() == 1) {
sdw.setUpdateTime(StringUtil.isNull((String) sdw.getUpdateTime(),"未装货")); sdw.setUpdateTime(StringUtil.isNull((String) sdw.getUpdateTime(), "未装货"));
list_zhuang.add(sdw); list_zhuang.add(sdw);
}else{ } else {
sdw.setUpdateTime(StringUtil.isNull((String) sdw.getUpdateTime(),"未卸货")); sdw.setUpdateTime(StringUtil.isNull((String) sdw.getUpdateTime(), "未卸货"));
list_xie.add(sdw); list_xie.add(sdw);
} }
} }
TextView get_contract=v.findViewById(R.id.get_contract); TextView get_contract = v.findViewById(R.id.get_contract);
get_contract.setOnClickListener(v13 -> { get_contract.setOnClickListener(v13 -> {
Intent in=new Intent(con, WebPDFActivity.class); Intent in = new Intent(con, WebPDFActivity.class);
in.putExtra("title","电子合同"); in.putExtra("title", "电子合同");
Log.e("--地址--",sob.getData().getContractUrl()); Log.e("--地址--", sob.getData().getContractUrl());
in.putExtra("url",sob.getData().getContractUrl()); in.putExtra("url", sob.getData().getContractUrl());
startActivity(in); startActivity(in);
}); });
// v.findViewById(R.id.upload_receipt).setOnClickListener(new View.OnClickListener() { // v.findViewById(R.id.upload_receipt).setOnClickListener(new View.OnClickListener() {
@ -294,134 +299,149 @@ public class StartYunDanActivity extends BaseActivity {
// startActivity(in); // startActivity(in);
// } // }
// }); // });
bv_zhuang.createV(con,list_zhuang,R.layout.item_huoyuan_start_zx).setOnItemViewListener((position, o, v14) -> { bv_zhuang.createV(con, list_zhuang, R.layout.item_huoyuan_start_zx).setOnItemViewListener((position, o, v14) -> {
// //
boolean upkey=false; boolean upkey = false;
if(position==0){ if (position == 0) {
upkey=true; upkey = true;
} }
initZX(upkey, v14,position,o,0); initZX(upkey, v14, position, o, 0);
}); });
bv_xie.createV(con,list_xie,R.layout.item_huoyuan_start_zx).setOnItemViewListener((position, o, v15) -> { bv_xie.createV(con, list_xie, R.layout.item_huoyuan_start_zx).setOnItemViewListener((position, o, v15) -> {
// //
boolean upkey=false; boolean upkey = false;
if(position==(list_xie.size()-1)){ if (position == (list_xie.size() - 1)) {
upkey=true; upkey = true;
} }
initZX(upkey, v15, position, o, 1); initZX(upkey, v15, position, o, 1);
}); });
search(); search();
} }
public void initZX(boolean key,View v,int position,Object o,int type){ public void initZX(boolean key, View v, int position, Object o, int type) {
StartOrderBean.DataDTO.WayChildrenDTO sdw= (StartOrderBean.DataDTO.WayChildrenDTO) o; StartOrderBean.DataDTO.WayChildrenDTO sdw = (StartOrderBean.DataDTO.WayChildrenDTO) o;
TextView index=v.findViewById(R.id.index); TextView index = v.findViewById(R.id.index);
TextView s_zx=v.findViewById(R.id.s_zx); TextView s_zx = v.findViewById(R.id.s_zx);
TextView j_zx=v.findViewById(R.id.j_zx); TextView j_zx = v.findViewById(R.id.j_zx);
if(type==1){ if (type == 1) {
s_zx.setText("实际卸货时间:"); s_zx.setText("实际卸货时间:");
j_zx.setText("计划卸货时间:"); j_zx.setText("计划卸货时间:");
} }
if(position==0){ if (position == 0) {
if(type==0){ if (type == 0) {
index.setText("装货地"); index.setText("装货地");
}else{ } else {
index.setText("卸货地"); index.setText("卸货地");
} }
}else{ } else {
if(type==0) { if (type == 0) {
index.setText("" + (position + 1) + "装货地"); index.setText("" + (position + 1) + "装货地");
}else{ } else {
index.setText("" + (position + 1) + "卸货地"); index.setText("" + (position + 1) + "卸货地");
} }
} }
TextView goodName=v.findViewById(R.id.goodName); TextView goodName = v.findViewById(R.id.goodName);
TextView goodNum=v.findViewById(R.id.goodNum); TextView goodNum = v.findViewById(R.id.goodNum);
TextView goodUnit=v.findViewById(R.id.goodUnit); TextView goodUnit = v.findViewById(R.id.goodUnit);
goodName.setText(sdw.getGoods().get(0).getGoodName()); goodName.setText(sdw.getGoods().get(0).getGoodName());
goodNum.setText(sdw.getGoods().get(0).getGoodNum()); goodNum.setText(sdw.getGoods().get(0).getGoodNum());
goodUnit.setText(sdw.getGoods().get(0).getGoodUnit()); goodUnit.setText(sdw.getGoods().get(0).getGoodUnit());
TextView huoyuan_state=v.findViewById(R.id.huoyuan_state); TextView huoyuan_state = v.findViewById(R.id.huoyuan_state);
huoyuan_state.setText(stateText(sdw.getStatus(),type)); huoyuan_state.setText(stateText(sdw.getStatus(), type));
huoyuan_state.setOnClickListener(new View.OnClickListener() { huoyuan_state.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
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, ShangChuangImgActivity.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));
in.putExtra("keys",key); in.putExtra("keys", key);
startActivity(in); startActivity(in);
}else{ } else {
Toast.makeText(con,"您还没有装货",Toast.LENGTH_SHORT).show(); Toast.makeText(con, "您还没有装货", Toast.LENGTH_SHORT).show();
} }
}else if(sdw.getStatus()==1){//装货回单 } else if (sdw.getStatus() == 1) {//装货回单
if(type==0){ Intent in = new Intent(con, ShangChuangImgActivity.class);
Intent in=new Intent(con, ShangChuangImgActivity.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{ } else if (sdw.getStatus() == 2) {//上传收货单(卸货回单)
Toast.makeText(con,"您还没有上传回单信息",Toast.LENGTH_SHORT).show(); 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));
in.putExtra("keys", key);
startActivity(in);
} else if (sdw.getStatus() == 3) {
Intent in = new Intent(con, GetShangChuanActivity.class);
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 if(sdw.getStatus()==2){//上传收货单(卸货回单) } else {//大于五分钟可以接单
Intent in=new Intent(con, ShangChuangImgActivity.class); ToastUtils.showToast(StartYunDanActivity.this, "装卸货时间间隔过短,请稍后重试!");
in.putExtra("type",2); }
in.putExtra("wid",wid); break;
in.putExtra("h_type",type); }
in.putExtra("sob",gson.toJson(sob)); }
in.putExtra("keys",key);
startActivity(in);
}else if(sdw.getStatus()==3){
Intent in=new Intent(con, GetShangChuanActivity.class);
in.putExtra("sdwStr",gson.toJson(sdw));
startActivity(in);
}else{//卸货照片
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);
} }
} }
}); });
} }
public String stateText(int state,int type){ public String stateText(int state, int type) {
String str=""; String str = "";
//0待装货1已装货 2已卸货 3已上传回单 4待卸货 //0待装货1已装货 2已卸货 3已上传回单 4待卸货
switch (state){ switch (state) {
case 0://str="待装货"; case 0://str="待装货";
if(type==0){ if (type == 0) {
str="立即装货"; str = "立即装货";
// str="确认装货"; // str="确认装货";
}else{ } else {
str="请先装货"; str = "请先装货";
} }
break; break;
case 1://str="已装货"; case 1://str="已装货";
str="上传出货单"; str = "上传出货单";
// str="确认回单"; // str="确认回单";
break; break;
case 2://str="已卸货"; case 2://str="已卸货";
str="上传收货单"; str = "上传收货单";
// str="确认回单"; // str="确认回单";
break; break;
case 3: case 3:
//str="已上传回单"; //str="已上传回单";
str="查看凭证"; str = "查看凭证";
break; break;
case 4: case 4:
//str="待卸货"; //str="待卸货";
str="确认卸货"; str = "确认卸货";
break;
default:
break; break;
default:break;
} }
return str; return str;
} }
@ -429,7 +449,7 @@ public class StartYunDanActivity extends BaseActivity {
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
if(map!=null){ if (map != null) {
map.onResume(); map.onResume();
} }
hyr.startOrder(id); hyr.startOrder(id);
@ -439,7 +459,7 @@ public class StartYunDanActivity extends BaseActivity {
@Override @Override
protected void onPause() { protected void onPause() {
super.onPause(); super.onPause();
if(map!=null){ if (map != null) {
map.onPause(); map.onPause();
} }
} }
@ -447,7 +467,7 @@ public class StartYunDanActivity extends BaseActivity {
@Override @Override
protected void onDestroy() { protected void onDestroy() {
super.onDestroy(); super.onDestroy();
if(map!=null){ if (map != null) {
map.onDestroy(); map.onDestroy();
} }
} }
@ -457,11 +477,12 @@ public class StartYunDanActivity extends BaseActivity {
super.onSaveInstanceState(outState); super.onSaveInstanceState(outState);
map.onSaveInstanceState(outState); map.onSaveInstanceState(outState);
} }
LocationSource.OnLocationChangedListener mListener; LocationSource.OnLocationChangedListener mListener;
AMapLocationClient mlocationClient; AMapLocationClient mlocationClient;
AMapLocationClientOption mLocationOption; AMapLocationClientOption mLocationOption;
public void initLoaction(){ public void initLoaction() {
// 设置定位监听 // 设置定位监听
aMap.setLocationSource(new LocationSource() { aMap.setLocationSource(new LocationSource() {
@Override @Override
@ -480,13 +501,13 @@ public class StartYunDanActivity extends BaseActivity {
mlocationClient.setLocationListener(new AMapLocationListener() { mlocationClient.setLocationListener(new AMapLocationListener() {
@Override @Override
public void onLocationChanged(AMapLocation aMapLocation) { public void onLocationChanged(AMapLocation aMapLocation) {
if (mListener != null&&aMapLocation != null) { if (mListener != null && aMapLocation != null) {
if (aMapLocation != null if (aMapLocation != null
&&aMapLocation.getErrorCode() == 0) { && aMapLocation.getErrorCode() == 0) {
mListener.onLocationChanged(aMapLocation);// 显示系统小蓝点 mListener.onLocationChanged(aMapLocation);// 显示系统小蓝点
} else { } else {
String errText = "定位失败," + aMapLocation.getErrorCode()+ ": " + aMapLocation.getErrorInfo(); String errText = "定位失败," + aMapLocation.getErrorCode() + ": " + aMapLocation.getErrorInfo();
Log.e("AmapErr",errText); Log.e("AmapErr", errText);
} }
} }
} }
@ -538,10 +559,10 @@ public class StartYunDanActivity extends BaseActivity {
private RouteSearch mRouteSearch;//路线查询器 private RouteSearch mRouteSearch;//路线查询器
private List<LatLonPoint> lists=new ArrayList<>(); private List<LatLonPoint> lists = new ArrayList<>();
public void search(){ public void search() {
// try { // try {
// AMapLocationClient.updatePrivacyShow(con,true,true); // AMapLocationClient.updatePrivacyShow(con,true,true);
// AMapLocationClient.updatePrivacyAgree(con,true); // AMapLocationClient.updatePrivacyAgree(con,true);
@ -552,31 +573,30 @@ public class StartYunDanActivity extends BaseActivity {
//设置数据回调监听器 //设置数据回调监听器
mRouteSearch.setRouteSearchListener(new OnRouteSearchListener()); mRouteSearch.setRouteSearchListener(new OnRouteSearchListener());
//设置开始位置坐标点(注意经纬度不能写反,会报错1800(只能规划到中国区域里的地图路线)) //设置开始位置坐标点(注意经纬度不能写反,会报错1800(只能规划到中国区域里的地图路线))
LatLonPoint startPoint=new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()), LatLonPoint startPoint = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
Double.parseDouble(sob.getData().getWayChildren().get((0)).getLongitude())); Double.parseDouble(sob.getData().getWayChildren().get((0)).getLongitude()));
//设置目的地坐标点 //设置目的地坐标点
LatLonPoint endPoint = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size()-1)).getLatitude()), LatLonPoint endPoint = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLatitude()),
Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size()-1)).getLongitude())); Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLongitude()));
//查询信息对象 //查询信息对象
for (int i=0;i<sob.getData().getWayChildren().size();i++){ for (int i = 0; i < sob.getData().getWayChildren().size(); i++) {
if(i!=0 && i!=(sob.getData().getWayChildren().size()-1)){ if (i != 0 && i != (sob.getData().getWayChildren().size() - 1)) {
LatLonPoint sp=new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get(i).getLatitude()), LatLonPoint sp = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get(i).getLatitude()),
Double.parseDouble(sob.getData().getWayChildren().get((i)).getLongitude())); Double.parseDouble(sob.getData().getWayChildren().get((i)).getLongitude()));
lists.add(sp); lists.add(sp);
} }
} }
RouteSearch.FromAndTo fromAndTo = new RouteSearch.FromAndTo(startPoint,endPoint); RouteSearch.FromAndTo fromAndTo = new RouteSearch.FromAndTo(startPoint, endPoint);
//设置搜索参数 1.fromAndTo 路径的起点终点 2.路径规划的策略(这里是驾车模式,具体看高德API) 3. //设置搜索参数 1.fromAndTo 路径的起点终点 2.路径规划的策略(这里是驾车模式,具体看高德API) 3.
//经点可选 4.避让区域可选 5.避让道路 ,可选 //经点可选 4.避让区域可选 5.避让道路 ,可选
RouteSearch.DriveRouteQuery query = new RouteSearch.DriveRouteQuery query = new
RouteSearch.DriveRouteQuery(fromAndTo,RouteSearch.DRIVING_SINGLE_DEFAULT,lists,null,""); RouteSearch.DriveRouteQuery(fromAndTo, RouteSearch.DRIVING_SINGLE_DEFAULT, lists, null, "");
//开始异步查询 //开始异步查询
mRouteSearch.calculateDriveRouteAsyn(query); mRouteSearch.calculateDriveRouteAsyn(query);
} }
class OnRouteSearchListener implements RouteSearch.OnRouteSearchListener {
class OnRouteSearchListener implements RouteSearch.OnRouteSearchListener{
@Override @Override
public void onBusRouteSearched(BusRouteResult busRouteResult, int i) { public void onBusRouteSearched(BusRouteResult busRouteResult, int i) {
@ -585,7 +605,7 @@ public class StartYunDanActivity extends BaseActivity {
@Override @Override
public void onDriveRouteSearched(DriveRouteResult driveRouteResult, int rCode) { public void onDriveRouteSearched(DriveRouteResult driveRouteResult, int rCode) {
if (rCode == 1000){//获取规划路线成功,获取到的是了,路线坐标点的集合 if (rCode == 1000) {//获取规划路线成功,获取到的是了,路线坐标点的集合
List<DrivePath> paths = driveRouteResult.getPaths(); List<DrivePath> paths = driveRouteResult.getPaths();
//创建存储坐标点的集合 //创建存储坐标点的集合
List<LatLng> latLngs = new ArrayList<>(); List<LatLng> latLngs = new ArrayList<>();
@ -594,7 +614,7 @@ public class StartYunDanActivity extends BaseActivity {
for (DriveStep mDriveStep : mDrivePath.getSteps()) { for (DriveStep mDriveStep : mDrivePath.getSteps()) {
for (LatLonPoint mLatLonPoint : mDriveStep.getPolyline()) { for (LatLonPoint mLatLonPoint : mDriveStep.getPolyline()) {
latLngs.add(new latLngs.add(new
LatLng(mLatLonPoint.getLatitude(),mLatLonPoint.getLongitude())); LatLng(mLatLonPoint.getLatitude(), mLatLonPoint.getLongitude()));
} }
} }
} }
@ -605,24 +625,24 @@ public class StartYunDanActivity extends BaseActivity {
.icon(BitmapDescriptorFactory.fromResource(R.mipmap.qi)) .icon(BitmapDescriptorFactory.fromResource(R.mipmap.qi))
.position(new LatLng(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()), .position(new LatLng(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
Double.parseDouble(sob.getData().getWayChildren().get(0).getLongitude())))); Double.parseDouble(sob.getData().getWayChildren().get(0).getLongitude()))));
for(int i=0;i<sob.getData().getWayChildren().size();i++){ for (int i = 0; i < sob.getData().getWayChildren().size(); i++) {
if(i!=0 && i!=(sob.getData().getWayChildren().size()-1)){ if (i != 0 && i != (sob.getData().getWayChildren().size() - 1)) {
StartOrderBean.DataDTO.WayChildrenDTO sdw=sob.getData().getWayChildren().get(i); StartOrderBean.DataDTO.WayChildrenDTO sdw = sob.getData().getWayChildren().get(i);
int icon=0; int icon = 0;
if(sdw.getType()==1){ if (sdw.getType() == 1) {
icon=R.mipmap.z_loc; icon = R.mipmap.z_loc;
}else{ } else {
icon=R.mipmap.x_loc; icon = R.mipmap.x_loc;
} }
aMap.addMarker(new MarkerOptions() aMap.addMarker(new MarkerOptions()
.icon(BitmapDescriptorFactory.fromResource(icon)) .icon(BitmapDescriptorFactory.fromResource(icon))
.position(new LatLng(Double.parseDouble(sdw.getLatitude()),Double.parseDouble(sdw.getLongitude())))); .position(new LatLng(Double.parseDouble(sdw.getLatitude()), Double.parseDouble(sdw.getLongitude()))));
} }
} }
aMap.addMarker(new MarkerOptions() aMap.addMarker(new MarkerOptions()
.icon(BitmapDescriptorFactory.fromResource(R.mipmap.zhong)) .icon(BitmapDescriptorFactory.fromResource(R.mipmap.zhong))
.position(new LatLng(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size()-1)).getLatitude()), .position(new LatLng(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLatitude()),
Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size()-1)).getLongitude())))); Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLongitude()))));
//绘制规划路径路线 //绘制规划路径路线
aMap.addPolyline(new PolylineOptions() aMap.addPolyline(new PolylineOptions()
//路线坐标点的集合 //路线坐标点的集合
@ -633,15 +653,15 @@ public class StartYunDanActivity extends BaseActivity {
//设置画线的颜色 //设置画线的颜色
//显示完整包含所有marker地图路线 //显示完整包含所有marker地图路线
LatLngBounds.Builder builder =LatLngBounds.builder(); LatLngBounds.Builder builder = LatLngBounds.builder();
for (int i = 0; i < latLngs.size(); i++) { for (int i = 0; i < latLngs.size(); i++) {
builder.include(latLngs.get(i)); builder.include(latLngs.get(i));
} }
//显示全部marker,第二个参数是四周留空宽度 //显示全部marker,第二个参数是四周留空宽度
aMap.moveCamera(CameraUpdateFactory.newLatLngBounds(builder.build(),200)); aMap.moveCamera(CameraUpdateFactory.newLatLngBounds(builder.build(), 200));
LatLng latLng = new LatLng(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()), LatLng latLng = new LatLng(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()),
Double.parseDouble(sob.getData().getWayChildren().get((0)).getLongitude()));//构造一个位置 Double.parseDouble(sob.getData().getWayChildren().get((0)).getLongitude()));//构造一个位置
aMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng,6)); aMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 6));
} }
} }
@ -657,7 +677,7 @@ public class StartYunDanActivity extends BaseActivity {
} }
public void up_traffic(){ public void up_traffic() {
// 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

@ -19,7 +19,6 @@ 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;
import com.alct.mdp.model.Location; import com.alct.mdp.model.Location;
import com.arpa.hndahesudintocctmsdriver.H5Activity;
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean; import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
import com.arpa.hndahesudintocctmsdriver.report.ALProcess; import com.arpa.hndahesudintocctmsdriver.report.ALProcess;
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess; 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.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.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;
@ -233,14 +237,16 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
lgdu.onCreate(); lgdu.onCreate();
lu = new LocationUtil(con, hd); lu = new LocationUtil(con, hd);
lu.onCreate(); lu.onCreate();
if (keys) { // if (keys) {
lu = new LocationUtil(con, hd); // lu = new LocationUtil(con, hd);
lu.onCreate(); // lu.onCreate();
} // }
tv_loaction.setOnClickListener(v -> { tv_loaction.setOnClickListener(v -> {
if (!locationKey) { if (!locationKey) {
customDialog.show(); customDialog.show();
lgdu.onCreate(); lgdu.onCreate();
lu = new LocationUtil(con, hd);
lu.onCreate();
} }
}); });
hyr = new HuoYuanRequset(con, hd); hyr = new HuoYuanRequset(con, hd);
@ -348,9 +354,12 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
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) {
if (lu!=null&&lu.getErrorCode()!=161){
ToastUtils.showToast(this,"百度地图定位失败,请确认开启定位后重试!");
return;
}
nfc(); nfc();
loadInfo(); loadInfo();
// up_traffic_start(); // up_traffic_start();
@ -375,6 +384,10 @@ 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();
@ -403,6 +416,10 @@ 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();

View File

@ -20,6 +20,7 @@ public class LocationUtil{
private double latitude; private double latitude;
private double longitude; private double longitude;
private int errorCode;
private String address; private String address;
private Context con; private Context con;
private Handler hd; private Handler hd;
@ -39,6 +40,10 @@ public class LocationUtil{
return longitude; return longitude;
} }
public double getErrorCode() {
return errorCode;
}
public String getAddress() { public String getAddress() {
return address; return address;
} }
@ -62,7 +67,7 @@ public class LocationUtil{
//LocationMode.Hight_Accuracy高精度 //LocationMode.Hight_Accuracy高精度
//LocationMode. Battery_Saving低功耗 //LocationMode. Battery_Saving低功耗
//LocationMode. Device_Sensors仅使用设备 //LocationMode. Device_Sensors仅使用设备
option.setCoorType("GCJ02"); option.setCoorType("BD09ll");
//可选设置返回经纬度坐标类型默认GCJ02 //可选设置返回经纬度坐标类型默认GCJ02
//GCJ02国测局坐标 //GCJ02国测局坐标
//BD09ll百度经纬度坐标 //BD09ll百度经纬度坐标
@ -112,7 +117,8 @@ public class LocationUtil{
float radius = location.getRadius(); //获取定位精度默认值为0.0f float radius = location.getRadius(); //获取定位精度默认值为0.0f
String coorType = location.getCoorType(); String coorType = location.getCoorType();
//获取经纬度坐标类型以LocationClientOption中设置过的坐标类型为准 //获取经纬度坐标类型以LocationClientOption中设置过的坐标类型为准
int errorCode = location.getLocType(); errorCode = location.getLocType();
String locTypeDescription = location.getLocTypeDescription();
//获取定位类型定位错误返回码具体信息可参照类参考中BDLocation类中的说明 //获取定位类型定位错误返回码具体信息可参照类参考中BDLocation类中的说明
Log.e("定位位置address",address+""); Log.e("定位位置address",address+"");
Log.e("定位坐标latitude",latitude+""); Log.e("定位坐标latitude",latitude+"");

View File

@ -1,5 +1,5 @@
<resources> <resources>
<string name="app_name">大河好运司机</string> <!-- <string name="appName">大河好运司机</string>-->
<!--设置界面--> <!--设置界面-->
<string name="alivc_recorder_setting_min_record_duration">最小时长</string> <string name="alivc_recorder_setting_min_record_duration">最小时长</string>
<string name="alivc_recorder_setting_max_record_duration">最大时长</string> <string name="alivc_recorder_setting_max_record_duration">最大时长</string>

View File

@ -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_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_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()); 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() { private TimeUtil() {
throw new UnsupportedOperationException("u can't instantiate me..."); throw new UnsupportedOperationException("u can't instantiate me...");
@ -215,7 +216,7 @@ public final class TimeUtil {
* @return 毫秒时间戳 * @return 毫秒时间戳
*/ */
public static long string2Millis(final String time) { public static long string2Millis(final String time) {
if (TextUtils.isEmpty(time)){ if (TextUtils.isEmpty(time)) {
return -1; return -1;
} }
return string2Millis(time, DEFAULT_FORMAT); return string2Millis(time, DEFAULT_FORMAT);
@ -245,7 +246,7 @@ public final class TimeUtil {
* @param time 时间字符串 * @param time 时间字符串
* @return 毫秒时间戳 * @return 毫秒时间戳
*/ */
public static String string2String(final String time,final SimpleDateFormat format) { public static String string2String(final String time, final SimpleDateFormat format) {
try { try {
return date2String(format.parse(time)); return date2String(format.parse(time));
// return DEFAULT_FORMAT.format(DEFAULT_FORMAT2.parse(time).getTime()); // return DEFAULT_FORMAT.format(DEFAULT_FORMAT2.parse(time).getTime());
@ -421,7 +422,7 @@ public final class TimeUtil {
* @return 合适型两个时间差 * @return 合适型两个时间差
*/ */
public static String getFitTimeSpan(final String time0, final String time1, final int precision) { public static String getFitTimeSpan(final String time0, final String time1, final int precision) {
if (TextUtils.isEmpty(time0)||TextUtils.isEmpty(time1)){ if (TextUtils.isEmpty(time0) || TextUtils.isEmpty(time1)) {
return ""; return "";
} }
return millis2FitTimeSpan(Math.abs(string2Millis(time0, DEFAULT_FORMAT) - string2Millis(time1, DEFAULT_FORMAT)), precision); return millis2FitTimeSpan(Math.abs(string2Millis(time0, DEFAULT_FORMAT) - string2Millis(time1, DEFAULT_FORMAT)), precision);
@ -1685,7 +1686,7 @@ public final class TimeUtil {
* @param compareDate * @param compareDate
* @return * @return
*/ */
public static boolean compareDate(String nowDate, String compareDate,DateFormat format) { public static boolean compareDate(String nowDate, String compareDate, DateFormat format) {
DateFormat df = format; DateFormat df = format;
try { try {
Date now = df.parse(nowDate); Date now = df.parse(nowDate);
@ -1700,4 +1701,22 @@ public final class TimeUtil {
return false; 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;
}
} }