拍照点击区域优化
This commit is contained in:
parent
10a379ed8f
commit
45d8b3351d
@ -37,8 +37,8 @@ android {
|
||||
applicationId "com.arpa.hndahesudintocctmsdriver"
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 30
|
||||
versionCode 58
|
||||
versionName "3.2.8"
|
||||
versionCode 59
|
||||
versionName "3.2.9"
|
||||
flavorDimensions "CHANNEL_VALUE"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
javaCompileOptions {
|
||||
|
@ -111,6 +111,21 @@
|
||||
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivityBC"
|
||||
android:screenOrientation="portrait">
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.nfc.action.TAG_DISCOVERED" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
|
||||
<data android:mimeType="*/*" />
|
||||
</intent-filter>
|
||||
|
||||
</activity>
|
||||
|
||||
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity2"
|
||||
android:screenOrientation="portrait">
|
||||
|
@ -229,6 +229,11 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
gia.showPopueWindow(this);
|
||||
}
|
||||
});
|
||||
up_img.setOnClickListener(v -> {
|
||||
if (!isAuth) {
|
||||
gia.showPopueWindow(this);
|
||||
}
|
||||
});
|
||||
img.setOnClickListener(v -> {
|
||||
if (!"".equals(url)) {
|
||||
new XPopup.Builder(con).asImageViewer(img, url, new SmartGlideImageLoader(R.mipmap.ic_launcher_round)).show();
|
||||
@ -250,7 +255,7 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
String id = value1.getText() + "";
|
||||
String date = value2.getText() + "";
|
||||
if ("0".equals(type)) {
|
||||
if (!"".equals(id) && !"".equals(date) && !"".equals(url)) {
|
||||
if (!"".equals(date) && !"".equals(url)) {
|
||||
new AuthRequest().driverAuthQualification(con, hd, id, ub.getData().getId(), date);
|
||||
} else {
|
||||
Toast.makeText(con, "请补充证件信息", Toast.LENGTH_SHORT).show();
|
||||
|
@ -315,6 +315,10 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
* 展示大图片
|
||||
*/
|
||||
private void showBigImg() {
|
||||
if (TextUtils.isEmpty(cdb.getData().getRoadLicensePhoto())){
|
||||
choicePhoto();
|
||||
return;
|
||||
}
|
||||
switch (type) {
|
||||
case 0:
|
||||
if (cdb.getData().getRoadLicensePhoto() != null && !cdb.getData().getCarImage().equals("")) {
|
||||
|
@ -240,8 +240,8 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
lgdu = new LocationGDUtil(con, hd);
|
||||
//启动定位
|
||||
lgdu.onCreate();
|
||||
lu = new LocationUtil(con, hd);
|
||||
lu.onCreate();
|
||||
// lu = new LocationUtil(con, hd);
|
||||
// lu.onCreate();
|
||||
// if (keys) {
|
||||
// lu = new LocationUtil(con, hd);
|
||||
// lu.onCreate();
|
||||
|
@ -0,0 +1,760 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alct.mdp.MDPLocationCollectionManager;
|
||||
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.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.StartOrderBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.UploadBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.OCRRequest;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.bean.UploadReceiptInputBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.BitmapUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.file.FileUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.file.ImageFileCompressUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.img.GetCarImageAlert;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.location.LocationGDUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.location.LocationUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.time.Timer;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
import com.baidu.mapapi.model.LatLng;
|
||||
import com.baidu.mapapi.utils.CoordinateConverter;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.google.gson.Gson;
|
||||
import com.luck.picture.lib.PictureSelector;
|
||||
import com.luck.picture.lib.config.PictureConfig;
|
||||
import com.luck.picture.lib.entity.LocalMedia;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ShangChuangImgActivityBC extends BaseAppCompatActivity {
|
||||
|
||||
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 Gson gson = new Gson();
|
||||
//
|
||||
private LUInputBean lub = new LUInputBean();
|
||||
private UploadReceiptInputBean urib = new UploadReceiptInputBean();
|
||||
private LocationGDUtil lgdu;
|
||||
public LocationUtil lu;
|
||||
private List<Integer> imgIds = new ArrayList<>();
|
||||
private UploadBean ub;
|
||||
private HuoYuanRequset hyr;
|
||||
//
|
||||
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 TextView tv_loaction;
|
||||
|
||||
private TempLoca tempLoca = new TempLoca(36.11944878,120.10315118,"中国山东省青岛市黄岛区铁峰山路","2023-09-23 11:19");
|
||||
|
||||
class TempLoca{
|
||||
private double latitude;
|
||||
private double longitude;
|
||||
private String address;
|
||||
private String time;
|
||||
|
||||
public TempLoca() {
|
||||
|
||||
}
|
||||
|
||||
public TempLoca(double latitude, double longitude, String address, String time) {
|
||||
this.latitude = latitude;
|
||||
this.longitude = longitude;
|
||||
this.address = address;
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public double getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
public void setLatitude(double latitude) {
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
public double getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public void setLongitude(double longitude) {
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(String time) {
|
||||
this.time = time;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void msgMethod(Message m) {
|
||||
super.msgMethod(m);
|
||||
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) {
|
||||
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();
|
||||
}
|
||||
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 (index == 2) {
|
||||
if (!keys){//装货回单
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove(TYPE_NAME[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (CacheGroup.cacheList.get("carName") != null) {
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("carName"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
|
||||
}
|
||||
CacheGroup.cacheList.remove("carName");
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("carNum") != null) {
|
||||
Log.e("upload", CacheGroup.cacheList.get("carNum"));
|
||||
CarInfoBean ub = gson.fromJson(CacheGroup.cacheList.remove("carNum"), CarInfoBean.class);
|
||||
if (ub.getCode() == 200 && ub.getData().getData().getPrism_keyValueInfo().size() > 0) {
|
||||
String value = ub.getData().getData().getPrism_keyValueInfo().get(0).getValue();
|
||||
String forceMatching = ub.getData().getForceMatching();
|
||||
if ("1".equals(forceMatching)) {//是否强校验车牌号 1:强校验
|
||||
if (sob.getData().getCarNumber().equals(value)) {
|
||||
hyr.uploadFile(new File(path));
|
||||
} else {
|
||||
new MessageUtils().showCenMessage(ShangChuangImgActivityBC.this, "车牌号不匹配!", "请重新拍照或联系管理员");
|
||||
}
|
||||
} else {
|
||||
hyr.uploadFile(new File(path));
|
||||
}
|
||||
} else {//识别失败后返回code500
|
||||
if (index == 0) {//装卸货车辆需要识别车牌号){
|
||||
Toast.makeText(con, "装货照片包含车牌号、三分之二车身或者装卸货场景。", Toast.LENGTH_SHORT).show();
|
||||
} else if (index == 1) {
|
||||
Toast.makeText(con, "卸货照片包含车牌号、三分之二车身或者装卸货场景。", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}
|
||||
CacheGroup.cacheList.remove("carNum");
|
||||
}
|
||||
break;
|
||||
case 14://定位成功
|
||||
locationKey = true;
|
||||
customDialog.dismiss();
|
||||
tv_loaction.setText("定位成功");
|
||||
tv_loaction.setTextColor(getResources().getColor(R.color.theme_color, null));
|
||||
latLng = convertGPSToBaidu(new LatLng(lgdu.getLatitude(), lgdu.getLongitude()));
|
||||
initLocation();
|
||||
break;
|
||||
case 16://定位失败
|
||||
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();
|
||||
//定位结果接收
|
||||
//finish();
|
||||
break;
|
||||
case 15:
|
||||
break;
|
||||
|
||||
case ImageFileCompressUtil.COMPRESS_SUCCESS:
|
||||
path = (String) m.obj;
|
||||
Log.e("res:", "选定图片结果");
|
||||
Log.e("res:", path);
|
||||
//选定图片结果
|
||||
// if(index==1 || index==2){
|
||||
// new OCRRequest().OCRPlateLicense(con,hd,new File(path));
|
||||
// }
|
||||
if (index == 0 || index == 1) {//装卸货车辆需要识别车牌号
|
||||
new OCRRequest().OCRCarPlateLicense(con, hd, new File(path));
|
||||
} else {
|
||||
hyr.uploadFile(new File(path));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
private LatLng latLng;
|
||||
|
||||
public LatLng convertGPSToBaidu(LatLng srLatLng) {
|
||||
CoordinateConverter converter = new CoordinateConverter();
|
||||
converter.from(CoordinateConverter.CoordType.COMMON);
|
||||
converter.coord(srLatLng);
|
||||
return converter.convert();
|
||||
}
|
||||
|
||||
private String wid;
|
||||
private int h_type;
|
||||
String sobStr = "";
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
StateStyleUtil.stateTextColor(this);
|
||||
setContentView(R.layout.activity_shangchuan_bc);
|
||||
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);
|
||||
initView(null);
|
||||
customDialog = new CustomDialog(con, "正在定位当前位置...");
|
||||
customDialog.show();
|
||||
lgdu = new LocationGDUtil(con, hd);
|
||||
//启动定位
|
||||
lgdu.onCreate();
|
||||
tv_loaction.setOnClickListener(v -> {
|
||||
if (!locationKey) {
|
||||
customDialog.show();
|
||||
lgdu.onCreate();
|
||||
}
|
||||
});
|
||||
hyr = new HuoYuanRequset(con, hd);
|
||||
}
|
||||
|
||||
public void initData() {
|
||||
//nfc初始化设置
|
||||
NfcUtils nfcUtils = new NfcUtils(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView(Object obj) {
|
||||
super.initView(obj);
|
||||
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) {
|
||||
typeRequest();
|
||||
} else {
|
||||
Toast.makeText(con, "请先上传一张图片", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
getImg.setOnClickListener(v -> {
|
||||
if (key) {
|
||||
Log.e("--imgIds.size()--", imgIds.size() + "");
|
||||
gia.showPopueWindow(this, true);
|
||||
} 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();
|
||||
}
|
||||
});
|
||||
img_delete.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
imgIds = new ArrayList<>();
|
||||
ub = new UploadBean();
|
||||
res_img.setVisibility(View.GONE);
|
||||
img_delete.setVisibility(View.GONE);
|
||||
img_icon.setVisibility(View.VISIBLE);
|
||||
key = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
String path;
|
||||
|
||||
@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);
|
||||
gia.dis();
|
||||
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) {
|
||||
LocalMedia image = imgs.get(0);
|
||||
|
||||
String paths = image.getAndroidQToPath();
|
||||
if (TextUtils.isEmpty(paths)) {
|
||||
paths = image.getPath();
|
||||
}
|
||||
path = paths;
|
||||
Log.e("图片地址:", path);
|
||||
gia.dis();
|
||||
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void initLocation() {
|
||||
address.setText(lgdu.getAddress());
|
||||
}
|
||||
|
||||
public void typeRequest() {
|
||||
// for(int i=0;i<imgIds.size();i++){
|
||||
// Log.e("--imgIds--",imgIds.get(i)+"");
|
||||
// }
|
||||
switch (index) {
|
||||
case 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) {//高德定位
|
||||
if (keys) {
|
||||
nfc();
|
||||
loadInfo();
|
||||
// up_traffic_start();
|
||||
// up_image_z();
|
||||
}
|
||||
} 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) {
|
||||
//卸货
|
||||
lub.setLatitude(tempLoca.getLatitude() + "");
|
||||
lub.setLongitude(tempLoca.getLongitude() + "");
|
||||
lub.setLocationAddress(tempLoca.getAddress());
|
||||
lub.setImageId(imgIds);
|
||||
lub.setWaybillId(wid);
|
||||
Log.e("--卸货信息", gson.toJson(lub));
|
||||
if (locationKey) {
|
||||
if (keys) {
|
||||
nfc();
|
||||
uploadInfo();
|
||||
|
||||
}
|
||||
|
||||
} 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) {//卸货回单
|
||||
//上传回单
|
||||
urib.setLatitude(lgdu.getLatitude() + "");
|
||||
urib.setLongitude(lgdu.getLongitude() + "");
|
||||
urib.setLocationAddress(lgdu.getAddress());
|
||||
//装卸货类型
|
||||
urib.setType(h_type + 1);
|
||||
//回单id 数组
|
||||
urib.setReceiptId(imgIds);
|
||||
//子运运单ID
|
||||
urib.setWaybillId(wid);
|
||||
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();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private StartOrderBean sob;
|
||||
|
||||
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) {
|
||||
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 onFailure(String s, String s1) {
|
||||
Log.e("不匹配", "" + s + s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//上传安联-签收
|
||||
public void up_trafficSign() {
|
||||
//安联
|
||||
Location l = new Location();
|
||||
l.setBaiduLongitude(tempLoca.longitude);
|
||||
l.setBaiduLatitude(tempLoca.latitude);
|
||||
l.setLocation(tempLoca.getAddress());
|
||||
l.setTime(tempLoca.getTime());
|
||||
List<Goods> gs = new ArrayList<>();
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO wayChild : sob.getData().getWayChildren()) {
|
||||
if (wid.equals(wayChild.getId() + "")) {
|
||||
for (StartOrderBean.DataDTO.WayChildrenDTO.GoodsDTO good : wayChild.getGoods()) {
|
||||
Goods g = new Goods();
|
||||
g.setGoodsName(good.getGoodName());
|
||||
g.setUnit(good.getGoodUnit());
|
||||
g.setItemNo(good.getId());
|
||||
//实收
|
||||
g.setQuantity(1);
|
||||
//应收
|
||||
g.setReceivedQuantity(1);
|
||||
//破损
|
||||
g.setDamageQuantity(1);
|
||||
//丢失
|
||||
g.setQuantity(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
MDPLocationCollectionManager.sign(con, sob.getData().getShippingNoteNumber(), l, gs, new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "签收成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(签收):", s + s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//上传安联-回单
|
||||
public void up_trafficReceipt() {
|
||||
//安联
|
||||
Location l = new Location();
|
||||
l.setBaiduLongitude(tempLoca.longitude);
|
||||
l.setBaiduLatitude(tempLoca.latitude);
|
||||
l.setLocation(tempLoca.getAddress());
|
||||
l.setTime(tempLoca.getTime());
|
||||
MDPLocationCollectionManager.pod(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "回单上传成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(回单):", s + s1);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
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);
|
||||
image.setFileExt(FileUtil.lastName(file));
|
||||
image.setFileName(FileUtil.fileName(file));
|
||||
image.setImageTakenDate(Timer.getTimerT());
|
||||
image.setBaiduLongitude(latLng.longitude);
|
||||
image.setBaiduLatitude(latLng.latitude);
|
||||
image.setLocation(lgdu.getAddress());
|
||||
MDPLocationCollectionManager.uploadPickupImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "装货照片上传成功");
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String 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);
|
||||
// startService(serviceIn);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
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(tempLoca.getTime());
|
||||
image.setBaiduLongitude(tempLoca.longitude);
|
||||
image.setBaiduLatitude(tempLoca.latitude);
|
||||
image.setLocation(tempLoca.getAddress());
|
||||
MDPLocationCollectionManager.uploadUnloadImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "卸货照片上传成功");
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String 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);
|
||||
// startService(serviceIn);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
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);
|
||||
image.setFileExt(FileUtil.lastName(file));
|
||||
image.setFileName(FileUtil.fileName(file));
|
||||
image.setImageTakenDate(tempLoca.getTime());
|
||||
image.setBaiduLongitude(tempLoca.longitude);
|
||||
image.setBaiduLatitude(tempLoca.latitude);
|
||||
image.setLocation(tempLoca.getAddress());
|
||||
MDPLocationCollectionManager.uploadPODImage(con, sob.getData().getShippingNoteNumber(), image, new OnResultListener() {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "回单照片上传成功");
|
||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String 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);
|
||||
//// startService(serviceIn);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
//开启前台调度系统
|
||||
//NfcUtils.mNfcAdapter.enableForegroundDispatch(this, NfcUtils.mPendingIntent, NfcUtils.mIntentFilter, NfcUtils.mTechList);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
//关闭前台调度系统
|
||||
//NfcUtils.mNfcAdapter.disableForegroundDispatch(this);
|
||||
}
|
||||
|
||||
String nfcStr = "";
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
//当该Activity接收到NFC标签时,运行该方法
|
||||
//调用工具方法,读取NFC数据
|
||||
try {
|
||||
nfcStr = NfcUtils.readNFCId(intent);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Log.e("nfc", nfcStr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 上传安联和交通厅,平台-装货
|
||||
*/
|
||||
private void loadInfo() {
|
||||
//安联
|
||||
if (sob.getData().getReportAlct() == 1) {
|
||||
Location l = new Location();
|
||||
l.setBaiduLongitude(latLng.longitude);
|
||||
l.setBaiduLatitude(latLng.latitude);
|
||||
l.setLocation(lgdu.getAddress());
|
||||
l.setTime(Timer.getTimerT());
|
||||
MDPLocationCollectionManager.pickup(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "装货上传成功");
|
||||
//交通厅
|
||||
if (sob.getData().getReport() == 1) {
|
||||
JTTProcess.start(con, sob, "");
|
||||
}
|
||||
//装货状态
|
||||
hyr.loading(lub);
|
||||
//装货照片
|
||||
up_image_z();
|
||||
}
|
||||
|
||||
@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(tempLoca.longitude);
|
||||
l.setBaiduLatitude(tempLoca.latitude);
|
||||
l.setLocation(tempLoca.getAddress());
|
||||
l.setTime(tempLoca.getTime());
|
||||
Log.e("-安联卸货信息-", gson.toJson(l));
|
||||
MDPLocationCollectionManager.unload(con, sob.getData().getShippingNoteNumber(), l, new OnResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("上报安联", "卸货上传成功");
|
||||
//交通厅
|
||||
if (sob.getData().getReport() == 1) {
|
||||
JTTProcess.stop(con, sob, "");
|
||||
}
|
||||
//卸货状态-平台
|
||||
hyr.dischargeCargo(lub);
|
||||
//卸货照片-安联
|
||||
up_image();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
Log.e("上报安联失败(卸货):", s + s1);
|
||||
new MessageUtils().showCenMessage(con, s1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -55,13 +55,13 @@
|
||||
android:layout_width="@dimen/dp_90"
|
||||
android:layout_height="@dimen/dp_90"
|
||||
android:background="#EEEEEE">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_23"
|
||||
android:layout_height="@dimen/dp_23"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerInParent="true"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@mipmap/up_img"/>
|
||||
android:src="@mipmap/up_img" />
|
||||
</RelativeLayout>
|
||||
<RelativeLayout
|
||||
android:layout_marginLeft="@dimen/dp_8"
|
||||
@ -118,6 +118,7 @@
|
||||
android:background="@drawable/bg_bai"
|
||||
android:elevation="@dimen/dp_1">
|
||||
<RelativeLayout
|
||||
android:visibility="gone"
|
||||
android:id="@+id/cow1"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:layout_width="match_parent"
|
||||
@ -130,28 +131,28 @@
|
||||
android:textColor="#ffc4c4ce"
|
||||
android:textSize="@dimen/sp_13"
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/value1"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#ff999999"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:maxLines="1"
|
||||
android:hint="点击进行手动输入"
|
||||
android:ellipsize="end"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginLeft="@dimen/dp_30"
|
||||
android:gravity="right"
|
||||
android:background="@null"
|
||||
/>
|
||||
android:ellipsize="end"
|
||||
android:gravity="right"
|
||||
android:hint="点击进行手动输入"
|
||||
android:maxLines="1"
|
||||
android:textColor="#ff999999"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
</RelativeLayout>
|
||||
<View
|
||||
android:visibility="gone"
|
||||
android:id="@+id/vs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_1"
|
||||
android:background="@drawable/bottom_xu"/>
|
||||
<RelativeLayout
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
|
175
app/src/main/res/layout/activity_shangchuan_bc.xml
Normal file
175
app/src/main/res/layout/activity_shangchuan_bc.xml
Normal file
@ -0,0 +1,175 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@drawable/bg_theme"
|
||||
android:id="@+id/activity_shangchuan">
|
||||
<ImageView
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:layout_width="@dimen/dp_300"
|
||||
android:layout_height="@dimen/dp_207"
|
||||
android:src="@mipmap/top_creativity"
|
||||
android:layout_centerHorizontal="true"/>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<RelativeLayout
|
||||
android:layout_marginTop="@dimen/dp_58"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/return_btn"
|
||||
android:layout_marginLeft="@dimen/dp_30"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_31"
|
||||
android:src="@mipmap/return_lefts"
|
||||
android:padding="@dimen/dp_10"
|
||||
android:scaleType="fitXY"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_loaction"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:text="定位成功"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="@dimen/dp_30"
|
||||
android:layout_centerVertical="true"
|
||||
android:padding="@dimen/dp_5"
|
||||
android:textColor="@color/theme_color"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_marginLeft="@dimen/dp_38"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="补传"
|
||||
android:textColor="#ff000000"
|
||||
android:textSize="@dimen/sp_23"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name_top"
|
||||
android:layout_marginLeft="@dimen/dp_38"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="上传卸货照片"
|
||||
android:textColor="#ff000000"
|
||||
android:textSize="@dimen/sp_23"
|
||||
/>
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/getImg1"
|
||||
android:layout_marginTop="@dimen/dp_33"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_38"
|
||||
android:layout_marginRight="@dimen/dp_38"
|
||||
app:cardCornerRadius="@dimen/dp_8">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<RelativeLayout
|
||||
android:id="@+id/getImg"
|
||||
android:layout_marginLeft="@dimen/dp_11"
|
||||
android:layout_marginTop="@dimen/dp_13"
|
||||
android:layout_marginBottom="@dimen/dp_13"
|
||||
android:layout_width="@dimen/dp_90"
|
||||
android:layout_height="@dimen/dp_90"
|
||||
android:background="#EEEEEE">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/res_img"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
<ImageView
|
||||
android:id="@+id/img_icon"
|
||||
android:layout_width="@dimen/dp_23"
|
||||
android:layout_height="@dimen/dp_23"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:src="@mipmap/up_img"/>
|
||||
<ImageView
|
||||
android:id="@+id/img_delete"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_width="@dimen/dp_25"
|
||||
android:layout_height="@dimen/dp_25"
|
||||
android:src="@mipmap/icon_delete"
|
||||
android:padding="@dimen/dp_3"
|
||||
android:visibility="gone"/>
|
||||
</RelativeLayout>
|
||||
<LinearLayout
|
||||
android:layout_marginTop="@dimen/dp_13"
|
||||
android:layout_marginLeft="@dimen/dp_8"
|
||||
android:layout_marginRight="@dimen/dp_10"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp_7"
|
||||
android:id="@+id/name_body"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="卸货照片"
|
||||
android:textColor="#ff000000"
|
||||
android:textSize="@dimen/sp_13"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp_13"
|
||||
android:id="@+id/address"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#ff999999"
|
||||
android:text=""
|
||||
android:textSize="@dimen/sp_13" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
<LinearLayout
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginLeft="@dimen/dp_38"
|
||||
android:layout_marginRight="@dimen/dp_38"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/tips_x"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="*"
|
||||
android:textColor="#E61829"
|
||||
android:visibility="gone"/>
|
||||
<TextView
|
||||
android:id="@+id/tips"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="卸货照片包含车牌号、三分之二车身或者卸货场景"
|
||||
android:textColor="#E61829"
|
||||
android:visibility="gone"/>
|
||||
</LinearLayout>
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_marginTop="@dimen/dp_33"
|
||||
android:layout_marginLeft="@dimen/dp_38"
|
||||
android:layout_marginRight="@dimen/dp_38"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_42"
|
||||
app:cardCornerRadius="@dimen/dp_21"
|
||||
app:cardBackgroundColor="@color/red">
|
||||
<TextView
|
||||
android:id="@+id/submit"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="提交"
|
||||
android:textColor="#fff"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:gravity="center"
|
||||
/>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
Loading…
Reference in New Issue
Block a user