3.2.3司机认证优化
This commit is contained in:
parent
c686fb4e8f
commit
9345621309
@ -3,6 +3,7 @@ plugins {
|
||||
id 'kotlin-android'
|
||||
id 'kotlin-kapt'
|
||||
id 'com.huawei.agconnect'
|
||||
id 'kotlin-android-extensions'
|
||||
}
|
||||
|
||||
android {
|
||||
@ -34,8 +35,8 @@ android {
|
||||
applicationId "com.arpa.hndahesudintocctmsdriver"
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 30
|
||||
versionCode 53
|
||||
versionName "3.2.2"
|
||||
versionCode 54
|
||||
versionName "3.2.3"
|
||||
flavorDimensions "CHANNEL_VALUE"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
javaCompileOptions {
|
||||
|
@ -2,6 +2,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.arpa.hndahesudintocctmsdriver">
|
||||
<uses-permission android:name="android.permission.CALL_PHONE" />
|
||||
<!-- 白名单 -->
|
||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
||||
<!-- 基础权限 -->
|
||||
|
@ -40,7 +40,6 @@ public class App extends Application {
|
||||
public static int APP_STATUS = APP_STATUS_KILLED; // 记录App的启动状态
|
||||
private Context con;
|
||||
public static App mApplication = null;
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
|
@ -0,0 +1,69 @@
|
||||
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.*
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName MessagePop
|
||||
* @Author 用户
|
||||
* @Date 2023/8/14 18:01
|
||||
* @Description TODO
|
||||
*/
|
||||
class MessagePop(context: Context) : CenterPopupView(context), View.OnClickListener {
|
||||
|
||||
lateinit var content :String
|
||||
|
||||
constructor(context: Context,message : String) :this(context) {
|
||||
content = message
|
||||
}
|
||||
|
||||
override fun getImplLayoutId() = R.layout.pop_message_center
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
tvCancel.setOnClickListener(this)
|
||||
tvOk.setOnClickListener(this)
|
||||
tvPhone.setOnClickListener(this)
|
||||
tvContent.text = "$content"
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
when(v?.id){
|
||||
R.id.tvCancel -> {
|
||||
dismiss()
|
||||
}
|
||||
R.id.tvOk,R.id.tvPhone -> {
|
||||
dismiss()
|
||||
val toString = tvPhone.text.toString()
|
||||
val intent = Intent(Intent.ACTION_CALL)
|
||||
val data = Uri.parse("tel:$toString")
|
||||
intent.data = data
|
||||
context.startActivity(intent)
|
||||
dismiss()
|
||||
// BaseUtils.callPhone(content as Activity, tvPhone.text.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private var listener: OnMyItemClickListener? = null
|
||||
fun setOnMyItemClickListener(listener: OnMyItemClickListener?): MessagePop {
|
||||
this.listener = listener
|
||||
return this
|
||||
}
|
||||
|
||||
interface OnMyItemClickListener {
|
||||
fun onItemClick(startTime: String, endTime: String)
|
||||
}
|
||||
|
||||
}
|
@ -8,7 +8,10 @@ import com.alct.mdp.MDPLocationCollectionManager;
|
||||
import com.alct.mdp.callback.OnDownloadResultListener;
|
||||
import com.alct.mdp.callback.OnResultListener;
|
||||
import com.alct.mdp.model.Identity;
|
||||
import com.arpa.hndahesudintocctmsdriver.App;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.AuthParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.msg.MsgUtil;
|
||||
import com.google.gson.Gson;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.DriverAuthDataBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.FqBean;
|
||||
@ -50,6 +53,7 @@ public class ALProcess {
|
||||
@Override
|
||||
public void onFailure(java.lang.String s, java.lang.String s1) {
|
||||
Log.e("--error--",s+s1+"");
|
||||
new MessageUtils().showCenMessage(con,s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -113,4 +117,33 @@ public class ALProcess {
|
||||
}
|
||||
|
||||
|
||||
public static void verification(Context con,Handler hd){
|
||||
DriverAuthDataBean auth= AuthParts.getAuth(con);
|
||||
Identity idy=new Identity();
|
||||
//企业代码
|
||||
idy.setEnterpriseCode(ENTERPRISE_CODE);
|
||||
//企业app的身份码
|
||||
idy.setAppIdentity(APP_IDENTITY);
|
||||
//企业app验证码
|
||||
idy.setAppKey(APP_KEY);
|
||||
//司机身份证
|
||||
idy.setDriverIdentity(auth.getData().getIdcard());
|
||||
//idy.setDriverIdentity("410725198311042012");
|
||||
MDPLocationCollectionManager.register(con, idy, new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
MsgUtil.addHdMsgWatBody(hd, 1111,"认证成功");
|
||||
Log.e("--success--","验证成功");
|
||||
getFq(con);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(java.lang.String s, java.lang.String s1) {
|
||||
Log.e("--error--",s+s1+"");
|
||||
MsgUtil.addHdMsgWatBody(hd, 2222,s1);
|
||||
new MessageUtils().showCenMessage(con,s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -123,6 +123,7 @@ public class HomeFragment extends BaseFragment {
|
||||
private ImageConfig ic;
|
||||
private DriverExpireBean deb;
|
||||
|
||||
|
||||
@Override
|
||||
public void msgMethod(Message m) {
|
||||
super.msgMethod(m);
|
||||
|
@ -21,8 +21,10 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.JTT;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.ALProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.PersonalAuthActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.img.ImageGetUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||
@ -32,6 +34,7 @@ import com.esign.esignsdk.data.AuthEvent;
|
||||
import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.core.BasePopupView;
|
||||
import com.lxj.xpopup.interfaces.OnCancelListener;
|
||||
import com.lxj.xpopup.interfaces.OnConfirmListener;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
||||
@ -120,6 +123,21 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
car.setText("选择车辆:" + clb.getData().get(index).getCarNumber());
|
||||
cid = clb.getData().get(index).getCarId();
|
||||
break;
|
||||
case 1111://安联用户验证通过,接单
|
||||
new XPopup.Builder(con)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||
.asConfirm("请确认接单", "是否确定承运此运单?",
|
||||
"取消", "确认",
|
||||
() -> {
|
||||
Log.e("--id--", "cid:" + cid + "---wid:" + id);
|
||||
hyr.confirm(cid, id);
|
||||
}, () -> customDialog.dismiss(), false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局
|
||||
.show();
|
||||
break;
|
||||
case 2222://安联用户验证不通过
|
||||
customDialog.dismiss();
|
||||
new MessageUtils().showCenMessage(con, (String) m.obj);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -236,20 +254,7 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
if (cid != null) {
|
||||
// if (fpKey){
|
||||
if (key) {
|
||||
new XPopup.Builder(con)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||
.asConfirm("请确认接单", "是否确定承运此运单?",
|
||||
"取消", "确认",
|
||||
new OnConfirmListener() {
|
||||
@Override
|
||||
public void onConfirm() {
|
||||
Log.e("--id--", "cid:" + cid + "---wid:" + id);
|
||||
customDialog = new CustomDialog(con, "正在接单...");
|
||||
customDialog.show();
|
||||
hyr.confirm(cid, id);
|
||||
}
|
||||
}, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局
|
||||
.show();
|
||||
reOrder();
|
||||
} else {
|
||||
Toast.makeText(con, "请先同意并签署运输合同", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@ -350,4 +355,15 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 接单
|
||||
* 先判断安联用户信息验证,随后接单
|
||||
*/
|
||||
private void reOrder() {
|
||||
customDialog = new CustomDialog(con, "正在接单...");
|
||||
customDialog.show();
|
||||
//验证安联用户是否通过
|
||||
ALProcess.verification(con, hd);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -19,8 +19,10 @@ 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.report.ALProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.BitmapUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.img.GetCarImageAlert;
|
||||
@ -57,89 +59,89 @@ import java.util.List;
|
||||
|
||||
public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
|
||||
private TextView submit,name_top,name_body,address,tips,tips_x;
|
||||
private TextView submit, name_top, name_body, address, tips, tips_x;
|
||||
private RelativeLayout getImg;
|
||||
private ImageView res_img,img_icon,img_delete;
|
||||
private String[] names={"装货","卸货","回单"};
|
||||
public static String[] TYPE_NAME={"zhuanghuo","xiehuo","huidan"};
|
||||
private int index=0;
|
||||
private ImageView res_img, img_icon, img_delete;
|
||||
private String[] names = {"装货", "卸货", "回单"};
|
||||
public static String[] TYPE_NAME = {"zhuanghuo", "xiehuo", "huidan"};
|
||||
private int index = 0;
|
||||
//
|
||||
private Gson gson=new Gson();
|
||||
private Gson gson = new Gson();
|
||||
//
|
||||
private LUInputBean lub=new LUInputBean();
|
||||
private UploadReceiptInputBean urib=new UploadReceiptInputBean();
|
||||
private LUInputBean lub = new LUInputBean();
|
||||
private UploadReceiptInputBean urib = new UploadReceiptInputBean();
|
||||
private LocationGDUtil lgdu;
|
||||
public LocationUtil lu;
|
||||
private List<Integer> imgIds=new ArrayList<>();
|
||||
public LocationUtil lu;
|
||||
private List<Integer> imgIds = new ArrayList<>();
|
||||
private UploadBean ub;
|
||||
private HuoYuanRequset hyr;
|
||||
//
|
||||
private GetCarImageAlert gia=new GetCarImageAlert();
|
||||
private GetCarImageAlert gia = new GetCarImageAlert();
|
||||
private CustomDialog customDialog;
|
||||
private int id=0;
|
||||
private boolean key=true;
|
||||
private boolean keys=false;
|
||||
private boolean locationKey=false;
|
||||
private int id = 0;
|
||||
private boolean key = true;
|
||||
private boolean keys = false;
|
||||
private boolean locationKey = false;
|
||||
private TextView tv_loaction;
|
||||
|
||||
@Override
|
||||
public void msgMethod(Message m) {
|
||||
super.msgMethod(m);
|
||||
switch (m.what){
|
||||
switch (m.what) {
|
||||
case RequsetCodeConstants.SUCCESS:
|
||||
if (CacheGroup.cacheList.get("upload")!=null) {
|
||||
Log.e("upload",CacheGroup.cacheList.get("upload"));
|
||||
ub=gson.fromJson(CacheGroup.cacheList.remove("upload"),UploadBean.class);
|
||||
if(ub.getCode()==200){
|
||||
if (CacheGroup.cacheList.get("upload") != null) {
|
||||
Log.e("upload", CacheGroup.cacheList.get("upload"));
|
||||
ub = gson.fromJson(CacheGroup.cacheList.remove("upload"), UploadBean.class);
|
||||
if (ub.getCode() == 200) {
|
||||
imgIds.add(ub.getData().getId());
|
||||
Glide.with(con).load(ub.getData().getUrl()).into(res_img);
|
||||
res_img.setVisibility(View.VISIBLE);
|
||||
img_delete.setVisibility(View.VISIBLE);
|
||||
img_icon.setVisibility(View.GONE);
|
||||
key=false;
|
||||
}else{
|
||||
Toast.makeText(con,ub.getMsg(),Toast.LENGTH_SHORT).show();
|
||||
key = false;
|
||||
} else {
|
||||
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove("upload");
|
||||
}
|
||||
for(int i=0;i<TYPE_NAME.length;i++){
|
||||
if (CacheGroup.cacheList.get(TYPE_NAME[i])!=null) {
|
||||
BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]),BaseBean.class);
|
||||
if(bb.getCode()==200){
|
||||
if(!keys){
|
||||
Toast.makeText(con,"上传成功",Toast.LENGTH_SHORT).show();
|
||||
for (int i = 0; i < TYPE_NAME.length; i++) {
|
||||
if (CacheGroup.cacheList.get(TYPE_NAME[i]) != null) {
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
if (!keys) {
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}else{
|
||||
Toast.makeText(con,"上传成功",Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
}else{
|
||||
Toast.makeText(con,bb.getMsg(),Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove(TYPE_NAME[i]);
|
||||
}
|
||||
}
|
||||
if(CacheGroup.cacheList.get("carName")!=null){
|
||||
BaseBean bb=gson.fromJson(CacheGroup.cacheList.get("carName"),BaseBean.class);
|
||||
if(bb.getCode()==200){
|
||||
if (CacheGroup.cacheList.get("carName") != null) {
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("carName"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
|
||||
}
|
||||
CacheGroup.cacheList.remove("carName");
|
||||
}
|
||||
break;
|
||||
case 14://定位成功
|
||||
locationKey=true;
|
||||
locationKey = true;
|
||||
customDialog.dismiss();
|
||||
tv_loaction.setText("定位成功");
|
||||
tv_loaction.setTextColor(getResources().getColor(R.color.theme_color,null));
|
||||
tv_loaction.setTextColor(getResources().getColor(R.color.theme_color, null));
|
||||
initLocation();
|
||||
break;
|
||||
case 16://定位失败
|
||||
locationKey=false;
|
||||
locationKey = false;
|
||||
customDialog.dismiss();
|
||||
tv_loaction.setText("定位失败,点击重试");
|
||||
tv_loaction.setTextColor(getResources().getColor(R.color.loaction_no_color,null));
|
||||
Toast.makeText(con,"定位失败,请确认开启定位后重试!",Toast.LENGTH_LONG).show();
|
||||
tv_loaction.setTextColor(getResources().getColor(R.color.loaction_no_color, null));
|
||||
Toast.makeText(con, "定位失败,请确认开启定位后重试!", Toast.LENGTH_LONG).show();
|
||||
//定位结果接收
|
||||
//finish();
|
||||
break;
|
||||
@ -147,67 +149,68 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
break;
|
||||
|
||||
case ImageFileCompressUtil.COMPRESS_SUCCESS:
|
||||
path= (String) m.obj;
|
||||
Log.e("res:","选定图片结果");
|
||||
Log.e("res:",path);
|
||||
path = (String) m.obj;
|
||||
Log.e("res:", "选定图片结果");
|
||||
Log.e("res:", path);
|
||||
//选定图片结果
|
||||
// if(index==1 || index==2){
|
||||
// new OCRRequest().OCRPlateLicense(con,hd,new File(path));
|
||||
// }
|
||||
hyr.uploadFile(new File(path));
|
||||
break;
|
||||
default:break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private String wid;
|
||||
private int h_type;
|
||||
String sobStr="";
|
||||
String sobStr = "";
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
StateStyleUtil.stateTextColor(this);
|
||||
setContentView(R.layout.activity_shangchuan);
|
||||
con=this;
|
||||
submit=findViewById(R.id.submit);
|
||||
name_top=findViewById(R.id.name_top);
|
||||
name_body=findViewById(R.id.name_body);
|
||||
address=findViewById(R.id.address);
|
||||
getImg=findViewById(R.id.getImg);
|
||||
res_img=findViewById(R.id.res_img);
|
||||
img_icon=findViewById(R.id.img_icon);
|
||||
img_delete=findViewById(R.id.img_delete);
|
||||
tv_loaction=findViewById(R.id.tv_loaction);
|
||||
tips=findViewById(R.id.tips);
|
||||
tips_x=findViewById(R.id.tips_x);
|
||||
Bundle ins=getIntent().getExtras();
|
||||
index=ins.getInt("type");
|
||||
wid=ins.getString("wid");
|
||||
h_type=ins.getInt("h_type");
|
||||
keys=ins.getBoolean("keys");
|
||||
sobStr=getIntent().getExtras().getString("sob");
|
||||
con = this;
|
||||
submit = findViewById(R.id.submit);
|
||||
name_top = findViewById(R.id.name_top);
|
||||
name_body = findViewById(R.id.name_body);
|
||||
address = findViewById(R.id.address);
|
||||
getImg = findViewById(R.id.getImg);
|
||||
res_img = findViewById(R.id.res_img);
|
||||
img_icon = findViewById(R.id.img_icon);
|
||||
img_delete = findViewById(R.id.img_delete);
|
||||
tv_loaction = findViewById(R.id.tv_loaction);
|
||||
tips = findViewById(R.id.tips);
|
||||
tips_x = findViewById(R.id.tips_x);
|
||||
Bundle ins = getIntent().getExtras();
|
||||
index = ins.getInt("type");
|
||||
wid = ins.getString("wid");
|
||||
h_type = ins.getInt("h_type");
|
||||
keys = ins.getBoolean("keys");
|
||||
sobStr = getIntent().getExtras().getString("sob");
|
||||
//Log.e("---sdwStr--",sdwStr);
|
||||
sob=new Gson().fromJson(sobStr, StartOrderBean.class);
|
||||
sob = new Gson().fromJson(sobStr, StartOrderBean.class);
|
||||
initView(null);
|
||||
customDialog=new CustomDialog(con, "正在定位当前位置...");
|
||||
customDialog = new CustomDialog(con, "正在定位当前位置...");
|
||||
customDialog.show();
|
||||
lgdu=new LocationGDUtil(con,hd);
|
||||
lgdu = new LocationGDUtil(con, hd);
|
||||
//启动定位
|
||||
lgdu.onCreate();
|
||||
lu=new LocationUtil(con,hd);
|
||||
lu = new LocationUtil(con, hd);
|
||||
lu.onCreate();
|
||||
if (keys){
|
||||
lu=new LocationUtil(con,hd);
|
||||
if (keys) {
|
||||
lu = new LocationUtil(con, hd);
|
||||
lu.onCreate();
|
||||
}
|
||||
tv_loaction.setOnClickListener(v -> {
|
||||
if (!locationKey){
|
||||
if (!locationKey) {
|
||||
customDialog.show();
|
||||
lgdu.onCreate();
|
||||
}
|
||||
});
|
||||
hyr=new HuoYuanRequset(con,hd);
|
||||
hyr = new HuoYuanRequset(con, hd);
|
||||
// if (!NfcUtils.hasNfc(con)) {
|
||||
// Toast.makeText(con,"请先开启nfc",Toast.LENGTH_LONG).show();
|
||||
// }else{
|
||||
@ -223,42 +226,42 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
@Override
|
||||
public void initView(Object obj) {
|
||||
super.initView(obj);
|
||||
name_top.setText("上传"+names[index]+"照片");
|
||||
name_body.setText(names[index]+"照片");
|
||||
if(index==1){
|
||||
name_top.setText("上传" + names[index] + "照片");
|
||||
name_body.setText(names[index] + "照片");
|
||||
if (index == 1) {
|
||||
tips.setVisibility(View.VISIBLE);
|
||||
tips_x.setVisibility(View.VISIBLE);
|
||||
}
|
||||
submit.setOnClickListener(v -> {
|
||||
if(imgIds.size()!=0){
|
||||
if (imgIds.size() != 0) {
|
||||
typeRequest();
|
||||
}else{
|
||||
Toast.makeText(con,"请先上传一张图片",Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(con, "请先上传一张图片", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
getImg.setOnClickListener(v -> {
|
||||
if(key){
|
||||
Log.e("--imgIds.size()--",imgIds.size()+"");
|
||||
gia.showPopueWindow(this,index==2);
|
||||
}else{
|
||||
if (key) {
|
||||
Log.e("--imgIds.size()--", imgIds.size() + "");
|
||||
gia.showPopueWindow(this, index == 2);
|
||||
} else {
|
||||
new XPopup.Builder(con)
|
||||
.asImageViewer(res_img, ub.getData().getUrl(), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||
.show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(res_img, ub.getData().getUrl(), true, -1, -1, 50, false,new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
Toast.makeText(con,"查看了照片", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(con, "查看了照片", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
img_delete.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
imgIds=new ArrayList<>();
|
||||
ub=new UploadBean();
|
||||
imgIds = new ArrayList<>();
|
||||
ub = new UploadBean();
|
||||
res_img.setVisibility(View.GONE);
|
||||
img_delete.setVisibility(View.GONE);
|
||||
img_icon.setVisibility(View.VISIBLE);
|
||||
key=true;
|
||||
key = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -268,15 +271,15 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == 12 && resultCode == RESULT_OK) {
|
||||
if (null==gia.getFile()){
|
||||
new ToastUtil(con, Gravity.CENTER,"图片选择失败").show(Toast.LENGTH_SHORT);
|
||||
return;
|
||||
}
|
||||
path=gia.getFile().getPath();
|
||||
Log.e("图片地址:",path);
|
||||
if (requestCode == 12 && resultCode == RESULT_OK) {
|
||||
if (null == gia.getFile()) {
|
||||
new ToastUtil(con, Gravity.CENTER, "图片选择失败").show(Toast.LENGTH_SHORT);
|
||||
return;
|
||||
}
|
||||
path = gia.getFile().getPath();
|
||||
Log.e("图片地址:", path);
|
||||
gia.dis();
|
||||
ImageFileCompressUtil.imageFileCompress(con,new File(path),hd);
|
||||
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||
} else if (requestCode == PictureConfig.CHOOSE_REQUEST && resultCode == RESULT_OK) {
|
||||
List<LocalMedia> imgs = PictureSelector.obtainMultipleResult(data);
|
||||
if (imgs != null && imgs.size() > 0) {
|
||||
@ -286,49 +289,50 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
if (TextUtils.isEmpty(paths)) {
|
||||
paths = image.getPath();
|
||||
}
|
||||
path=paths;
|
||||
Log.e("图片地址:",path);
|
||||
path = paths;
|
||||
Log.e("图片地址:", path);
|
||||
gia.dis();
|
||||
ImageFileCompressUtil.imageFileCompress(con,new File(path),hd);
|
||||
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void initLocation(){
|
||||
public void initLocation() {
|
||||
address.setText(lgdu.getAddress());
|
||||
}
|
||||
|
||||
public void typeRequest(){
|
||||
public void typeRequest() {
|
||||
// for(int i=0;i<imgIds.size();i++){
|
||||
// Log.e("--imgIds--",imgIds.get(i)+"");
|
||||
// }
|
||||
switch (index){
|
||||
switch (index) {
|
||||
case 0:
|
||||
//装货
|
||||
if(imgIds!=null && imgIds.size()>0) {
|
||||
if (imgIds != null && imgIds.size() > 0) {
|
||||
lub.setLatitude(lgdu.getLatitude() + "");
|
||||
lub.setLongitude(lgdu.getLongitude() + "");
|
||||
lub.setLocationAddress(lgdu.getAddress());
|
||||
lub.setImageId(imgIds);
|
||||
lub.setWaybillId(wid);
|
||||
Log.e("--装货信息", gson.toJson(lub));
|
||||
if(locationKey){
|
||||
hyr.loading(lub);
|
||||
if(keys){
|
||||
if (locationKey) {
|
||||
|
||||
if (keys) {
|
||||
nfc();
|
||||
up_traffic_start();
|
||||
up_image_z();
|
||||
loadInfo();
|
||||
// up_traffic_start();
|
||||
// up_image_z();
|
||||
}
|
||||
}else{
|
||||
Toast.makeText(con,"定位异常,请重新定位",Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}else{
|
||||
Toast.makeText(con,"图片上传异常,请重新上传",Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if(imgIds!=null && imgIds.size()>0) {
|
||||
if (imgIds != null && imgIds.size() > 0) {
|
||||
//卸货
|
||||
lub.setLatitude(lgdu.getLatitude() + "");
|
||||
lub.setLongitude(lgdu.getLongitude() + "");
|
||||
@ -336,64 +340,65 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
lub.setImageId(imgIds);
|
||||
lub.setWaybillId(wid);
|
||||
Log.e("--卸货信息", gson.toJson(lub));
|
||||
if(locationKey){
|
||||
if(keys){
|
||||
if (locationKey) {
|
||||
if (keys) {
|
||||
nfc();
|
||||
up_traffic_end();
|
||||
up_image();
|
||||
uploadInfo();
|
||||
|
||||
}
|
||||
hyr.dischargeCargo(lub);
|
||||
}else{
|
||||
Toast.makeText(con,"定位异常,请重新定位",Toast.LENGTH_SHORT).show();
|
||||
|
||||
} else {
|
||||
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}else{
|
||||
Toast.makeText(con,"图片上传异常,请重新上传",Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(imgIds!=null && imgIds.size()>0){//卸货回单
|
||||
if (imgIds != null && imgIds.size() > 0) {//卸货回单
|
||||
//上传回单
|
||||
urib.setLatitude(lgdu.getLatitude()+"");
|
||||
urib.setLongitude(lgdu.getLongitude()+"");
|
||||
urib.setLatitude(lgdu.getLatitude() + "");
|
||||
urib.setLongitude(lgdu.getLongitude() + "");
|
||||
urib.setLocationAddress(lgdu.getAddress());
|
||||
//装卸货类型
|
||||
urib.setType(h_type+1);
|
||||
urib.setType(h_type + 1);
|
||||
//回单id 数组
|
||||
urib.setReceiptId(imgIds);
|
||||
//子运运单ID
|
||||
urib.setWaybillId(wid);
|
||||
Log.e("--回单信息",gson.toJson(urib));
|
||||
if(locationKey) {
|
||||
Log.e("--回单信息", gson.toJson(urib));
|
||||
if (locationKey) {
|
||||
if (index == 2 && keys) {
|
||||
up_trafficSign();
|
||||
up_trafficReceipt();
|
||||
receipt_image();
|
||||
}
|
||||
hyr.receipt(urib);
|
||||
}else{
|
||||
Toast.makeText(con,"定位异常,请重新定位",Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}else{
|
||||
Toast.makeText(con,"图片上传异常,请重新上传",Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
default:break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private StartOrderBean sob;
|
||||
|
||||
//上传安联和交通厅-装货
|
||||
public void up_traffic_start(){
|
||||
//安联
|
||||
if(sob.getData().getReportAlct()==1) {
|
||||
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() {
|
||||
MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "装货上传成功");
|
||||
@ -402,77 +407,78 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
@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,"");
|
||||
if (sob.getData().getReport() == 1) {
|
||||
JTTProcess.start(con, sob, "");
|
||||
}
|
||||
}
|
||||
|
||||
public void nfc(){
|
||||
public void nfc() {
|
||||
// if(sob.getData().getNfcId().equals(nfcStr)){
|
||||
// Toast.makeText(con,"nfcId匹配失败",Toast.LENGTH_LONG).show();
|
||||
// }
|
||||
if("".equals(sob.getData().getNfcId()) || sob.getData().getNfcId()==null){
|
||||
if ("".equals(sob.getData().getNfcId()) || sob.getData().getNfcId() == null) {
|
||||
return;
|
||||
}
|
||||
MDPLocationCollectionManager.checkNfc(con, sob.getData().getShippingNoteNumber(),
|
||||
sob.getData().getNfcId(), new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Toast.makeText(con,"nfcId匹配成功",Toast.LENGTH_LONG).show();
|
||||
}
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Toast.makeText(con, "nfcId匹配成功", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("不匹配",""+s+s1);
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("不匹配", "" + s + s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//上传安联和交通厅-卸货
|
||||
public void up_traffic_end(){
|
||||
public void up_traffic_end() {
|
||||
//安联
|
||||
if(sob.getData().getReportAlct()==1){
|
||||
Location l=new Location();
|
||||
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));
|
||||
Log.e("-安联卸货信息-", gson.toJson(l));
|
||||
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new com.alct.mdp.callback.OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联","卸货上传成功");
|
||||
Log.e("上报安联", "卸货上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(卸货):",s+s1);
|
||||
Log.e("上报安联失败(卸货):", s + s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
//交通厅
|
||||
if(sob.getData().getReport()==1){
|
||||
JTTProcess.stop(con,sob,"");
|
||||
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.setBaiduLatitude(lu.getLatitude());
|
||||
l.setLocation(lu.getAddress());
|
||||
l.setTime(Timer.getTimerT());
|
||||
List<Goods> gs=new ArrayList<>();
|
||||
List<Goods> gs = new ArrayList<>();
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||
if(wid.equals(wayChild.getId()+"")){
|
||||
if (wid.equals(wayChild.getId() + "")) {
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO.GoodsDTO good : wayChild.getGoods()) {
|
||||
Goods g=new Goods();
|
||||
Goods g = new Goods();
|
||||
g.setGoodsName(good.getGoodName());
|
||||
g.setUnit(good.getGoodUnit());
|
||||
g.setItemNo(good.getId());
|
||||
@ -487,23 +493,23 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
}
|
||||
}
|
||||
MDPLocationCollectionManager.sign(con, sob.getData().getShippingNoteNumber(), l,gs, new com.alct.mdp.callback.OnResultListener() {
|
||||
MDPLocationCollectionManager.sign(con, sob.getData().getShippingNoteNumber(), l, gs, new com.alct.mdp.callback.OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联","签收成功");
|
||||
Log.e("上报安联", "签收成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(签收):",s+s1);
|
||||
Log.e("上报安联失败(签收):", s + s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//上传安联-回单
|
||||
public void up_trafficReceipt(){
|
||||
public void up_trafficReceipt() {
|
||||
//安联
|
||||
Location l=new Location();
|
||||
Location l = new Location();
|
||||
l.setBaiduLongitude(lu.getLongitude());
|
||||
l.setBaiduLatitude(lu.getLatitude());
|
||||
l.setLocation(lu.getAddress());
|
||||
@ -512,23 +518,23 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联","回单上传成功");
|
||||
Log.e("上报安联", "回单上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(回单):",s+s1);
|
||||
Log.e("上报安联失败(回单):", s + s1);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public void up_image_z(){
|
||||
public void up_image_z() {
|
||||
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||
File file=new File(path);
|
||||
Image image=new Image();
|
||||
String base= BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/"+ FileUtil.lastName(file) +";base64,"+base);
|
||||
File file = new File(path);
|
||||
Image image = new Image();
|
||||
String base = BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||
image.setFileExt(FileUtil.lastName(file));
|
||||
image.setFileName(FileUtil.fileName(file));
|
||||
image.setImageTakenDate(Timer.getTimerT());
|
||||
@ -539,12 +545,12 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联","装货照片上传成功");
|
||||
Log.e("上报安联", "装货照片上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(装货照片):",s+s1);
|
||||
Log.e("上报安联失败(装货照片):", s + s1);
|
||||
// SPUtil.insSP(con,"make","装货",sob.getData().getShippingNoteNumber());
|
||||
// SPUtil.insSP(con,"make","装货-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||
// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||
@ -554,11 +560,11 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
});
|
||||
}
|
||||
|
||||
public void up_image(){
|
||||
File file=new File(path);
|
||||
Image image=new Image();
|
||||
String base= BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/"+ FileUtil.lastName(file) +";base64,"+base);
|
||||
public void up_image() {
|
||||
File file = new File(path);
|
||||
Image image = new Image();
|
||||
String base = BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||
image.setFileExt(FileUtil.lastName(file));
|
||||
image.setFileName(FileUtil.fileName(file));
|
||||
image.setImageTakenDate(Timer.getTimerT());
|
||||
@ -569,12 +575,12 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联","卸货照片上传成功");
|
||||
Log.e("上报安联", "卸货照片上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(卸货照片):",s+s1);
|
||||
Log.e("上报安联失败(卸货照片):", s + s1);
|
||||
// SPUtil.insSP(con,"make","卸货",sob.getData().getShippingNoteNumber());
|
||||
// SPUtil.insSP(con,"make","卸货-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||
// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||
@ -584,12 +590,12 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
});
|
||||
}
|
||||
|
||||
public void receipt_image(){
|
||||
public void receipt_image() {
|
||||
///storage/emulated/0/Android/data/com.oneclouds.wangluohuoyun/files/Pictures/163124593063154.jpg
|
||||
File file=new File(path);
|
||||
Image image=new Image();
|
||||
String base= BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/"+ FileUtil.lastName(file) +";base64,"+base);
|
||||
File file = new File(path);
|
||||
Image image = new Image();
|
||||
String base = BitmapUtil.imageToBase64(path);
|
||||
image.setFileData("data:image/" + FileUtil.lastName(file) + ";base64," + base);
|
||||
image.setFileExt(FileUtil.lastName(file));
|
||||
image.setFileName(FileUtil.fileName(file));
|
||||
image.setImageTakenDate(Timer.getTimerT());
|
||||
@ -600,12 +606,12 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联","回单照片上传成功");
|
||||
Log.e("上报安联", "回单照片上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(回单照片):",s+s1);
|
||||
Log.e("上报安联失败(回单照片):", s + s1);
|
||||
// SPUtil.insSP(con,"make","回单",sob.getData().getShippingNoteNumber());
|
||||
//// SPUtil.insSP(con,"make","回单-"+sob.getData().getShippingNoteNumber(),gson.toJson(image));
|
||||
//// Intent serviceIn=new Intent(con, MakeUpAlService.class);
|
||||
@ -629,7 +635,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
//NfcUtils.mNfcAdapter.disableForegroundDispatch(this);
|
||||
}
|
||||
|
||||
String nfcStr="";
|
||||
String nfcStr = "";
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
@ -641,8 +647,80 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Log.e("nfc",nfcStr);
|
||||
Log.e("nfc", nfcStr);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传安联和交通厅,平台-装货
|
||||
*/
|
||||
private void loadInfo() {
|
||||
//安联
|
||||
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("上报安联", "装货上传成功");
|
||||
//交通厅
|
||||
if (sob.getData().getReport() == 1) {
|
||||
JTTProcess.start(con, sob, "");
|
||||
}
|
||||
//装货照片
|
||||
up_image_z();
|
||||
//装货状态
|
||||
hyr.loading(lub);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(装货):", s + s1);
|
||||
new MessageUtils().showCenMessage(con, s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传安联和交通厅,平台-卸货
|
||||
*/
|
||||
private void uploadInfo() {
|
||||
|
||||
//安联
|
||||
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("上报安联", "卸货上传成功");
|
||||
//交通厅
|
||||
if (sob.getData().getReport() == 1) {
|
||||
JTTProcess.stop(con, sob, "");
|
||||
}
|
||||
//卸货照片-安联
|
||||
up_image();
|
||||
//卸货状态-平台
|
||||
hyr.dischargeCargo(lub);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(卸货):", s + s1);
|
||||
new MessageUtils().showCenMessage(con, s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,35 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.util
|
||||
|
||||
import android.content.Context
|
||||
import com.arpa.hndahesudintocctmsdriver.cuspop.MessagePop
|
||||
import com.ct.auth.communication.request.Content
|
||||
import com.lxj.xpopup.XPopup
|
||||
|
||||
/**
|
||||
* @ClassName MessageUtils
|
||||
* @Author 用户
|
||||
* @Date 2023/8/15 09:51
|
||||
* @Description TODO
|
||||
*/
|
||||
class MessageUtils {
|
||||
|
||||
companion object {
|
||||
fun getInstance() = InstanceHelper.sSingle
|
||||
}
|
||||
|
||||
object InstanceHelper {
|
||||
val sSingle = MessageUtils()
|
||||
}
|
||||
|
||||
fun showCenMessage(ctx: Context, message: String) {
|
||||
XPopup.Builder(ctx) //
|
||||
.hasNavigationBar(false)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗对象,推荐设置这个
|
||||
.asCustom(MessagePop(ctx, message).setOnMyItemClickListener(object : MessagePop.OnMyItemClickListener{
|
||||
override fun onItemClick(startTime: String, endTime: String) {
|
||||
}
|
||||
}))
|
||||
.show()
|
||||
}
|
||||
|
||||
}
|
@ -12,12 +12,12 @@ import android.os.Message;
|
||||
public class MsgUtil {
|
||||
|
||||
public static void addHdMsgWat(Handler hd,int what){
|
||||
Message msg=new Message();
|
||||
Message msg=Message.obtain();
|
||||
msg.what=what;
|
||||
hd.sendMessage(msg);
|
||||
}
|
||||
public static void addHdMsgWatBody(Handler hd,int what,String body){
|
||||
Message msg=new Message();
|
||||
Message msg=Message.obtain();
|
||||
msg.what=what;
|
||||
msg.obj=body;
|
||||
hd.sendMessage(msg);
|
||||
|
99
app/src/main/res/layout/pop_message_center.xml
Normal file
99
app/src/main/res/layout/pop_message_center.xml
Normal file
@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_16"
|
||||
android:background="@color/white"
|
||||
android:elevation="@dimen/dp_5"
|
||||
|
||||
app:cardCornerRadius="@dimen/dp_10">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="提示"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/red"
|
||||
android:textSize="@dimen/sp_20"></TextView>
|
||||
|
||||
<TextView
|
||||
android:lineSpacingExtra="@dimen/dp_6"
|
||||
android:gravity="center"
|
||||
android:id="@+id/tvContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:textColor="#D86B6B"
|
||||
android:textSize="@dimen/sp_14"
|
||||
tools:text="提示"></TextView>
|
||||
<TextView
|
||||
android:lineSpacingExtra="@dimen/dp_6"
|
||||
android:gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:textColor="@color/color_9"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:text="请重新登录或联系管理员"></TextView>
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="联系电话:"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_14"></TextView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPhone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="13783631930"
|
||||
android:textColor="#009688"
|
||||
android:textSize="@dimen/sp_16"></TextView>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="@dimen/dp_10"
|
||||
android:paddingBottom="@dimen/dp_10">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="取消"
|
||||
android:textSize="@dimen/sp_16"></TextView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvOk"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="确认拨打"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:textSize="@dimen/sp_16"></TextView>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
Loading…
Reference in New Issue
Block a user