修改上传接口和充电桩接口
This commit is contained in:
@@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
|
|||||||
android {
|
android {
|
||||||
compileSdkVersion 29
|
compileSdkVersion 29
|
||||||
buildToolsVersion '29.0.2'
|
buildToolsVersion '29.0.2'
|
||||||
//ndkVersion '23.0.7123448'
|
ndkVersion '23.0.7123448'
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.navinfo.outdoor"
|
applicationId "com.navinfo.outdoor"
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.navinfo.outdoor.bean;
|
||||||
|
|
||||||
|
public class ChargingPileSaveBean {
|
||||||
|
|
||||||
|
private Integer code;
|
||||||
|
private String message;
|
||||||
|
private Integer body;
|
||||||
|
|
||||||
|
public Integer getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(Integer code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMessage(String message) {
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getBody() {
|
||||||
|
return body;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBody(Integer body) {
|
||||||
|
this.body = body;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.navinfo.outdoor.bean;
|
||||||
|
|
||||||
|
public class PoiUploadBean {
|
||||||
|
|
||||||
|
private Integer code;
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
public Integer getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(Integer code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMessage(String message) {
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -33,16 +33,23 @@ import com.kongzue.dialog.interfaces.OnDialogButtonClickListener;
|
|||||||
import com.kongzue.dialog.util.BaseDialog;
|
import com.kongzue.dialog.util.BaseDialog;
|
||||||
import com.kongzue.dialog.util.DialogSettings;
|
import com.kongzue.dialog.util.DialogSettings;
|
||||||
import com.kongzue.dialog.v3.MessageDialog;
|
import com.kongzue.dialog.v3.MessageDialog;
|
||||||
|
import com.lzy.okgo.model.HttpParams;
|
||||||
import com.navinfo.outdoor.R;
|
import com.navinfo.outdoor.R;
|
||||||
import com.navinfo.outdoor.api.Constant;
|
import com.navinfo.outdoor.api.Constant;
|
||||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||||
|
import com.navinfo.outdoor.bean.PoiSaveBean;
|
||||||
|
import com.navinfo.outdoor.http.Callback;
|
||||||
|
import com.navinfo.outdoor.http.HttpInterface;
|
||||||
|
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||||
import com.navinfo.outdoor.room.ChargingPileDao;
|
import com.navinfo.outdoor.room.ChargingPileDao;
|
||||||
import com.navinfo.outdoor.room.ChargingPileEntity;
|
import com.navinfo.outdoor.room.ChargingPileEntity;
|
||||||
|
import com.navinfo.outdoor.room.InsertAndUpdateUtils;
|
||||||
import com.navinfo.outdoor.room.PoiDatabase;
|
import com.navinfo.outdoor.room.PoiDatabase;
|
||||||
import com.navinfo.outdoor.room.PoiEntity;
|
import com.navinfo.outdoor.room.PoiEntity;
|
||||||
import com.navinfo.outdoor.util.Geohash;
|
import com.navinfo.outdoor.util.Geohash;
|
||||||
import com.navinfo.outdoor.util.GeometryTools;
|
import com.navinfo.outdoor.util.GeometryTools;
|
||||||
import com.navinfo.outdoor.util.PhotoPathUtil;
|
import com.navinfo.outdoor.util.PhotoPathUtil;
|
||||||
|
import com.navinfo.outdoor.util.PictureUtil;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
@@ -78,6 +85,16 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
private String station;
|
private String station;
|
||||||
private LatLng latLng;
|
private LatLng latLng;
|
||||||
private LatLng poiLatLng;
|
private LatLng poiLatLng;
|
||||||
|
private String takePhotoPath1;
|
||||||
|
private String takePhotoPath2;
|
||||||
|
private String takePhotoPath3;
|
||||||
|
private String takePhotoPath4;
|
||||||
|
private String takePhotoPath5;
|
||||||
|
private String takePhotoPath6;
|
||||||
|
private String takePhotoPath7;
|
||||||
|
private String takePhotoPath8;
|
||||||
|
private String takePhotoPath9;
|
||||||
|
private String takePhotoPath10;
|
||||||
|
|
||||||
public static ChargingPileFragment newInstance(Bundle bundle) {
|
public static ChargingPileFragment newInstance(Bundle bundle) {
|
||||||
ChargingPileFragment fragment = new ChargingPileFragment();
|
ChargingPileFragment fragment = new ChargingPileFragment();
|
||||||
@@ -674,7 +691,8 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
obtain.what = Constant.CHARGING_PILE_STATION;
|
obtain.what = Constant.CHARGING_PILE_STATION;
|
||||||
obtain.obj = chargingPileEntity;
|
obtain.obj = chargingPileEntity;
|
||||||
EventBus.getDefault().post(obtain);
|
EventBus.getDefault().post(obtain);
|
||||||
onBackPressed();
|
chargingPileByWork(chargingPileEntity);
|
||||||
|
//onBackPressed();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
@@ -737,6 +755,52 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void chargingPileByWork(ChargingPileEntity chargingPileEntity) {
|
||||||
|
showLoadingDialog();
|
||||||
|
// HttpParams httpParams = new HttpParams();
|
||||||
|
// httpParams.put("taskId", chargingPileEntity.getTaskId());
|
||||||
|
// httpParams.put("name", chargingPileEntity.getName());
|
||||||
|
// httpParams.put("address", chargingPileEntity.getAddress());
|
||||||
|
// httpParams.put("existence", chargingPileEntity.getExistence());
|
||||||
|
// httpParams.put("geo", chargingPileEntity.getGeoWkt());
|
||||||
|
// httpParams.put("memo", chargingPileEntity.getMemo());
|
||||||
|
// OkGoBuilder.getInstance()
|
||||||
|
// .Builder(getActivity())
|
||||||
|
// .url(HttpInterface.SUBMIT_POI_TASK)
|
||||||
|
// .method(OkGoBuilder.GET)
|
||||||
|
// .cls(PoiSaveBean.class)
|
||||||
|
// .params(httpParams)
|
||||||
|
// .callback(new Callback<PoiSaveBean>() {
|
||||||
|
// @Override
|
||||||
|
// public void onSuccess(PoiSaveBean poiSaveBean, int id) {
|
||||||
|
// dismissLoadingDialog();
|
||||||
|
// body = poiSaveBean.getBody();
|
||||||
|
// poiEntity.setBodyId(body);
|
||||||
|
// poiEntity.setTaskStatus(3);
|
||||||
|
// new Thread(new Runnable() {
|
||||||
|
// @Override
|
||||||
|
// public void run() {
|
||||||
|
// InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
|
||||||
|
// getActivity().runOnUiThread(new Runnable() {
|
||||||
|
// @Override
|
||||||
|
// public void run() {
|
||||||
|
// Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
|
||||||
|
// Log.d("TAG", "onSuccess: " + poiSaveBean.getBody());
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// }).start();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onError(Throwable e, int id) {
|
||||||
|
// dismissLoadingDialog();
|
||||||
|
// Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
|
// Log.d("TAG", "onError: " + e.getMessage());
|
||||||
|
// }
|
||||||
|
// }).build();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSaveInstanceState(@NonNull Bundle outState) {
|
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
@@ -847,8 +911,9 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
int angle1 = PictureUtil.readPictureDegree(takePhotoPath1);
|
||||||
ivPanorama.setTag(takePhotoPath);
|
takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data, "a",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||||
|
ivPanorama.setTag(takePhotoPath1);
|
||||||
ivPanorama.setImageBitmap(bitmap);//显示图像
|
ivPanorama.setImageBitmap(bitmap);//显示图像
|
||||||
}
|
}
|
||||||
} else if (requestCode == 102 && resultCode == RESULT_OK) {
|
} else if (requestCode == 102 && resultCode == RESULT_OK) {
|
||||||
@@ -867,8 +932,9 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "b",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
int angle2 = PictureUtil.readPictureDegree(takePhotoPath2);
|
||||||
ivCoding.setTag(takePhotoPath);
|
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||||
|
ivCoding.setTag(takePhotoPath2);
|
||||||
ivCoding.setImageBitmap(bitmap);//显示图像
|
ivCoding.setImageBitmap(bitmap);//显示图像
|
||||||
}
|
}
|
||||||
} else if (requestCode == 103 && resultCode == RESULT_OK) {
|
} else if (requestCode == 103 && resultCode == RESULT_OK) {
|
||||||
@@ -887,9 +953,10 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
int angle3 = PictureUtil.readPictureDegree(takePhotoPath3);
|
||||||
|
takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||||
ivEquipment.setImageBitmap(bitmap);//显示图像
|
ivEquipment.setImageBitmap(bitmap);//显示图像
|
||||||
ivEquipment.setTag(takePhotoPath);
|
ivEquipment.setTag(takePhotoPath3);
|
||||||
}
|
}
|
||||||
} else if (requestCode == 104 && resultCode == RESULT_OK) {
|
} else if (requestCode == 104 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||||
@@ -907,8 +974,9 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
int angle4 = PictureUtil.readPictureDegree(takePhotoPath4);
|
||||||
ivFacility.setTag(takePhotoPath);
|
takePhotoPath4 = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||||
|
ivFacility.setTag(takePhotoPath4);
|
||||||
ivFacility.setImageBitmap(bitmap);//显示图像
|
ivFacility.setImageBitmap(bitmap);//显示图像
|
||||||
}
|
}
|
||||||
} else if (requestCode == 105 && resultCode == RESULT_OK) {
|
} else if (requestCode == 105 && resultCode == RESULT_OK) {
|
||||||
@@ -927,8 +995,9 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
int angle5 = PictureUtil.readPictureDegree(takePhotoPath5);
|
||||||
ivScutcheon.setTag(takePhotoPath);
|
takePhotoPath5 = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||||
|
ivScutcheon.setTag(takePhotoPath5);
|
||||||
ivScutcheon.setImageBitmap(bitmap);//显示图像
|
ivScutcheon.setImageBitmap(bitmap);//显示图像
|
||||||
}
|
}
|
||||||
} else if (requestCode == 106 && resultCode == RESULT_OK) {
|
} else if (requestCode == 106 && resultCode == RESULT_OK) {
|
||||||
@@ -947,8 +1016,9 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
int angle6 = PictureUtil.readPictureDegree(takePhotoPath6);
|
||||||
ivDevice.setTag(takePhotoPath);
|
takePhotoPath6 = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||||
|
ivDevice.setTag(takePhotoPath6);
|
||||||
ivDevice.setImageBitmap(bitmap);//显示图像
|
ivDevice.setImageBitmap(bitmap);//显示图像
|
||||||
}
|
}
|
||||||
} else if (requestCode == 107 && resultCode == RESULT_OK) {
|
} else if (requestCode == 107 && resultCode == RESULT_OK) {
|
||||||
@@ -967,8 +1037,9 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "d",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
int angle7 = PictureUtil.readPictureDegree(takePhotoPath7);
|
||||||
ivUsable.setTag(takePhotoPath);
|
takePhotoPath7 = PhotoPathUtil.getTakePhotoPath(data, "d",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||||
|
ivUsable.setTag(takePhotoPath7);
|
||||||
ivUsable.setImageBitmap(bitmap);//显示图像
|
ivUsable.setImageBitmap(bitmap);//显示图像
|
||||||
}
|
}
|
||||||
} else if (requestCode == 108 && resultCode == RESULT_OK) {
|
} else if (requestCode == 108 && resultCode == RESULT_OK) {
|
||||||
@@ -987,8 +1058,9 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "d",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
int angle8 = PictureUtil.readPictureDegree(takePhotoPath8);
|
||||||
ivAvailable.setTag(takePhotoPath);
|
takePhotoPath8 = PhotoPathUtil.getTakePhotoPath(data, "d",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||||
|
ivAvailable.setTag(takePhotoPath8);
|
||||||
ivAvailable.setImageBitmap(bitmap);//显示图像
|
ivAvailable.setImageBitmap(bitmap);//显示图像
|
||||||
}
|
}
|
||||||
} else if (requestCode == 109 && resultCode == RESULT_OK) {
|
} else if (requestCode == 109 && resultCode == RESULT_OK) {
|
||||||
@@ -1007,9 +1079,10 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "e",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
int angle9 = PictureUtil.readPictureDegree(takePhotoPath9);
|
||||||
|
takePhotoPath9 = PhotoPathUtil.getTakePhotoPath(data, "e",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||||
ivParking.setImageBitmap(bitmap);//显示图像
|
ivParking.setImageBitmap(bitmap);//显示图像
|
||||||
ivParking.setTag(takePhotoPath);
|
ivParking.setTag(takePhotoPath9);
|
||||||
}
|
}
|
||||||
} else if (requestCode == 110 && resultCode == RESULT_OK) {
|
} else if (requestCode == 110 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||||
@@ -1027,9 +1100,10 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "e",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
int angle10 = PictureUtil.readPictureDegree(takePhotoPath10);
|
||||||
|
takePhotoPath10 = PhotoPathUtil.getTakePhotoPath(data, "e",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||||
ivNumber.setImageBitmap(bitmap);//显示图像
|
ivNumber.setImageBitmap(bitmap);//显示图像
|
||||||
ivNumber.setTag(takePhotoPath);
|
ivNumber.setTag(takePhotoPath10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,13 +102,17 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
private RecyclerView recyclerStation;
|
private RecyclerView recyclerStation;
|
||||||
private ChargingPileAdapter chargingPileAdapter;
|
private ChargingPileAdapter chargingPileAdapter;
|
||||||
private int station_type = 0;
|
private int station_type = 0;
|
||||||
private boolean aBoolean = false;
|
|
||||||
private PoiEntity showPoiEntity;
|
private PoiEntity showPoiEntity;
|
||||||
private ChargingPileDao chargingPileDao;
|
private ChargingPileDao chargingPileDao;
|
||||||
private LatLng latLng;
|
private LatLng latLng;
|
||||||
private RelativeLayout linearExist;
|
private RelativeLayout linearExist;
|
||||||
private Spinner spinnerExist;
|
private Spinner spinnerExist;
|
||||||
private Integer body;
|
private Integer body;
|
||||||
|
private String takePhotoPath1;
|
||||||
|
private String takePhotoPath2;
|
||||||
|
private String takePhotoPath3;
|
||||||
|
private String takePhotoPath4;
|
||||||
|
private String takePhotoPath5;
|
||||||
|
|
||||||
public static ChargingStationFragment newInstance(Bundle bundle) {
|
public static ChargingStationFragment newInstance(Bundle bundle) {
|
||||||
ChargingStationFragment fragment = new ChargingStationFragment();
|
ChargingStationFragment fragment = new ChargingStationFragment();
|
||||||
@@ -493,7 +497,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
ArrayList<ChargingPileEntity> chargingPileEntities = new ArrayList<>();
|
ArrayList<ChargingPileEntity> chargingPileEntities = new ArrayList<>();
|
||||||
chargingPileEntities.add(chargingPileEntity);
|
chargingPileEntities.add(chargingPileEntity);
|
||||||
chargingPileAdapter.setChargingPileEntities(chargingPileEntities);
|
chargingPileAdapter.setChargingPileEntities(chargingPileEntities);
|
||||||
aBoolean = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -541,7 +545,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
} else {
|
} else {
|
||||||
poiEntity.setDescribe(describe);
|
poiEntity.setDescribe(describe);
|
||||||
}
|
}
|
||||||
if (phoneData.size() <= 0) {
|
if (phoneData.size()<= 0) {
|
||||||
Toast.makeText(getActivity(), "请输入手机号", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "请输入手机号", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
@@ -586,12 +590,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
|
|
||||||
poiEntity.setPhotoInfo(infoPhoto);
|
poiEntity.setPhotoInfo(infoPhoto);
|
||||||
poiEntity.setStation_type(station_type);
|
poiEntity.setStation_type(station_type);
|
||||||
if (!aBoolean) {
|
|
||||||
Toast.makeText(getActivity(), "请添加桩", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
aBoolean = false;
|
|
||||||
}
|
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||||
@@ -607,6 +605,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
getActivity().runOnUiThread(new Runnable() {
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
phoneByWork(poiEntity);
|
||||||
chargingStationSaveByWork(poiEntity);
|
chargingStationSaveByWork(poiEntity);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -708,6 +707,46 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void phoneByWork(PoiEntity poiEntity) {
|
||||||
|
showLoadingDialog();
|
||||||
|
HttpParams httpParams = new HttpParams();
|
||||||
|
httpParams.put("geo",poiEntity.getGeoWkt());
|
||||||
|
OkGoBuilder.getInstance()
|
||||||
|
.Builder(getActivity())
|
||||||
|
.url(HttpInterface.GET_PHONE)
|
||||||
|
.method(OkGoBuilder.GET)
|
||||||
|
.cls(GetPhoneBean.class)
|
||||||
|
.params(httpParams)
|
||||||
|
.callback(new Callback<GetPhoneBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(GetPhoneBean getPhoneBean, int id) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
String code = getPhoneBean.getBody().getCode();
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
|
||||||
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
|
||||||
|
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
|
||||||
|
Log.d("TAG", "onSuccess: " + getPhoneBean.getBody());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e, int id) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
|
Log.d("TAG", "onError: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}).build();
|
||||||
|
}
|
||||||
|
|
||||||
private void stationUploadByNetWork(Integer body, ArrayList<File> chargingStationList) {
|
private void stationUploadByNetWork(Integer body, ArrayList<File> chargingStationList) {
|
||||||
|
|
||||||
|
|
||||||
@@ -924,8 +963,9 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
//int angle1 = PictureUtil.readPictureDegree(takePhotoPath1);
|
||||||
ivPanorama.setTag(takePhotoPath);
|
takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data, "a",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||||
|
ivPanorama.setTag(takePhotoPath1);
|
||||||
ivPanorama.setImageBitmap(bitmap);//显示图像
|
ivPanorama.setImageBitmap(bitmap);//显示图像
|
||||||
}
|
}
|
||||||
} else if (requestCode == 102 && resultCode == RESULT_OK) {
|
} else if (requestCode == 102 && resultCode == RESULT_OK) {
|
||||||
@@ -944,8 +984,9 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "b",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
// int angle2 = PictureUtil.readPictureDegree(takePhotoPath2);
|
||||||
ivName.setTag(takePhotoPath);
|
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||||
|
ivName.setTag(takePhotoPath2);
|
||||||
ivName.setImageBitmap(bitmap);//显示图像
|
ivName.setImageBitmap(bitmap);//显示图像
|
||||||
}
|
}
|
||||||
} else if (requestCode == 103 && resultCode == RESULT_OK) {
|
} else if (requestCode == 103 && resultCode == RESULT_OK) {
|
||||||
@@ -964,8 +1005,9 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
// int angle3 = PictureUtil.readPictureDegree(takePhotoPath3);
|
||||||
ivInternal.setTag(takePhotoPath);
|
takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||||
|
ivInternal.setTag(takePhotoPath3);
|
||||||
ivInternal.setImageBitmap(bitmap);//显示图像
|
ivInternal.setImageBitmap(bitmap);//显示图像
|
||||||
}
|
}
|
||||||
} else if (requestCode == 104 && resultCode == RESULT_OK) {
|
} else if (requestCode == 104 && resultCode == RESULT_OK) {
|
||||||
@@ -984,8 +1026,9 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "d",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
// int angle4 = PictureUtil.readPictureDegree(takePhotoPath4);
|
||||||
ivElse.setTag(takePhotoPath);
|
takePhotoPath4 = PhotoPathUtil.getTakePhotoPath(data, "d",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||||
|
ivElse.setTag(takePhotoPath4);
|
||||||
ivElse.setImageBitmap(bitmap);//显示图像
|
ivElse.setImageBitmap(bitmap);//显示图像
|
||||||
}
|
}
|
||||||
} else if (requestCode == 105 && resultCode == RESULT_OK) {
|
} else if (requestCode == 105 && resultCode == RESULT_OK) {
|
||||||
@@ -1004,8 +1047,9 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "e",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
// int angle5 = PictureUtil.readPictureDegree(takePhotoPath5);
|
||||||
ivScutcheon.setTag(takePhotoPath);
|
takePhotoPath5 = PhotoPathUtil.getTakePhotoPath(data, "e",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||||
|
ivScutcheon.setTag(takePhotoPath5);
|
||||||
ivScutcheon.setImageBitmap(bitmap);//显示图像
|
ivScutcheon.setImageBitmap(bitmap);//显示图像
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.navinfo.outdoor.fragment;
|
|||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
@@ -23,6 +24,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.kongzue.dialog.interfaces.OnDialogButtonClickListener;
|
import com.kongzue.dialog.interfaces.OnDialogButtonClickListener;
|
||||||
import com.kongzue.dialog.util.BaseDialog;
|
import com.kongzue.dialog.util.BaseDialog;
|
||||||
|
import com.kongzue.dialog.util.DialogSettings;
|
||||||
import com.kongzue.dialog.v3.MessageDialog;
|
import com.kongzue.dialog.v3.MessageDialog;
|
||||||
import com.lzy.okgo.OkGo;
|
import com.lzy.okgo.OkGo;
|
||||||
import com.lzy.okgo.model.Response;
|
import com.lzy.okgo.model.Response;
|
||||||
@@ -85,7 +87,7 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
|||||||
btnBank = findViewById(R.id.btn_bank);
|
btnBank = findViewById(R.id.btn_bank);
|
||||||
btnBank.setOnClickListener(this::onClick);
|
btnBank.setOnClickListener(this::onClick);
|
||||||
tvName = (TextView) findViewById(R.id.tv_name);
|
tvName = (TextView) findViewById(R.id.tv_name);
|
||||||
if (Constant.USER_ATTESTATION_NAME!=null){
|
if (Constant.USER_ATTESTATION_NAME != null) {
|
||||||
tvName.setText(Constant.USER_ATTESTATION_NAME);
|
tvName.setText(Constant.USER_ATTESTATION_NAME);
|
||||||
}
|
}
|
||||||
etBankNum = (EditText) findViewById(R.id.et_bank_num);
|
etBankNum = (EditText) findViewById(R.id.et_bank_num);
|
||||||
@@ -212,8 +214,24 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
|||||||
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
if (requestCode == 400 && resultCode == RESULT_OK) {
|
if (requestCode == 400 && resultCode == RESULT_OK) {
|
||||||
gatheringPath = PhotoPathUtil.getTakePhotoPath(data, "","");
|
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||||
return;
|
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||||
|
int height = bitmap.getHeight();
|
||||||
|
int width = bitmap.getWidth();
|
||||||
|
if (height > width) {
|
||||||
|
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||||
|
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
|
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
startActivityForResult(intentPanorama, 400);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
gatheringPath = PhotoPathUtil.getTakePhotoPath(data, "", "");
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package com.navinfo.outdoor.fragment;
|
||||||
|
|
||||||
|
public class GetPhoneBean {
|
||||||
|
|
||||||
|
private Integer code;
|
||||||
|
private String message;
|
||||||
|
private BodyBean body;
|
||||||
|
|
||||||
|
public Integer getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(Integer code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMessage(String message) {
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BodyBean getBody() {
|
||||||
|
return body;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBody(BodyBean body) {
|
||||||
|
this.body = body;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class BodyBean {
|
||||||
|
private String code;
|
||||||
|
private Integer telLength;
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getTelLength() {
|
||||||
|
return telLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTelLength(Integer telLength) {
|
||||||
|
this.telLength = telLength;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -40,6 +40,7 @@ import com.navinfo.outdoor.base.BaseDrawerFragment;
|
|||||||
import com.navinfo.outdoor.bean.Info;
|
import com.navinfo.outdoor.bean.Info;
|
||||||
import com.navinfo.outdoor.bean.OtherUploadPicBean;
|
import com.navinfo.outdoor.bean.OtherUploadPicBean;
|
||||||
import com.navinfo.outdoor.bean.PoiSaveBean;
|
import com.navinfo.outdoor.bean.PoiSaveBean;
|
||||||
|
import com.navinfo.outdoor.bean.PoiUploadBean;
|
||||||
import com.navinfo.outdoor.http.Callback;
|
import com.navinfo.outdoor.http.Callback;
|
||||||
import com.navinfo.outdoor.http.DialogCallback;
|
import com.navinfo.outdoor.http.DialogCallback;
|
||||||
import com.navinfo.outdoor.http.HttpInterface;
|
import com.navinfo.outdoor.http.HttpInterface;
|
||||||
@@ -91,7 +92,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
|
|
||||||
private String takePhotoPath;
|
private String takePhotoPath;
|
||||||
private String takePhotoPath2;
|
private String takePhotoPath2;
|
||||||
private int body;
|
private Integer body;
|
||||||
|
|
||||||
public static OtherFragment newInstance(Bundle bundle) {
|
public static OtherFragment newInstance(Bundle bundle) {
|
||||||
OtherFragment fragment = new OtherFragment();
|
OtherFragment fragment = new OtherFragment();
|
||||||
@@ -428,31 +429,57 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
Toast.makeText(getActivity(), "没有保存不能上传", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "没有保存不能上传", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
showLoadingDialog();
|
// OkGo
|
||||||
|
// // 请求方式和请求url
|
||||||
|
// .<OtherUploadPicBean>post(HttpInterface.OTHER_TASK_UPLOAD_PIC)
|
||||||
|
// // 请求的 tag, 主要用于取消对应的请求
|
||||||
|
// .params("auditId", body)
|
||||||
|
// .addFileParams("file", otherUploadList)
|
||||||
|
// .tag(this)
|
||||||
|
// .execute(new DialogCallback<OtherUploadPicBean>(OtherUploadPicBean.class) {
|
||||||
|
// @Override
|
||||||
|
// public void onSuccess(Response<OtherUploadPicBean> otherUploadPicBeanResponse) {
|
||||||
|
// dismissLoadingDialog();
|
||||||
|
// Toast.makeText(getActivity(), "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
// Log.d("TAG", "onSuccess: " + otherUploadPicBeanResponse.toString() + "sssssssssssss");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onError(Response<OtherUploadPicBean> response) {
|
||||||
|
// super.onError(response);
|
||||||
|
// dismissLoadingDialog();
|
||||||
|
// Toast.makeText(getActivity(), response.message() + "", Toast.LENGTH_SHORT).show();
|
||||||
|
// Log.d("TAG", "onError: " + response.message());
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
if (body == 0) {
|
||||||
|
Toast.makeText(getActivity(), "没有保存本地", Toast.LENGTH_SHORT).show();
|
||||||
|
Log.e("TAG", "poiUploadByNetWork: " + body + otherUploadList);
|
||||||
|
return;
|
||||||
|
}
|
||||||
OkGo
|
OkGo
|
||||||
// 请求方式和请求url
|
// 请求方式和请求url
|
||||||
.<OtherUploadPicBean>post(HttpInterface.OTHER_TASK_UPLOAD_PIC)
|
.<PoiUploadBean>post(HttpInterface.OTHER_TASK_UPLOAD_PIC)
|
||||||
// 请求的 tag, 主要用于取消对应的请求
|
// 请求的 tag, 主要用于取消对应的请求
|
||||||
.params("auditId", body)
|
.params("auditId", body)
|
||||||
.addFileParams("file", otherUploadList)
|
.addFileParams("file", otherUploadList)
|
||||||
.tag(this)
|
.tag(this)
|
||||||
.execute(new DialogCallback<OtherUploadPicBean>(OtherUploadPicBean.class) {
|
.execute(new DialogCallback<PoiUploadBean>(PoiUploadBean.class) {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Response<OtherUploadPicBean> response) {
|
public void onSuccess(Response<PoiUploadBean> poiUploadBeanResponse) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
Toast.makeText(getActivity(), "上传成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
Log.d("TAG", "onSuccess: " + response.toString() + "sssssssssssss");
|
Log.d("TAG", "onSuccess: " + poiUploadBeanResponse.toString() + "sssssssssssss");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Response<OtherUploadPicBean> response) {
|
public void onError(Response<PoiUploadBean> poiUploadBeanResponse) {
|
||||||
super.onError(response);
|
super.onError(poiUploadBeanResponse);
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
Toast.makeText(getActivity(), response.code() + "", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), poiUploadBeanResponse.code() + "", Toast.LENGTH_SHORT).show();
|
||||||
Log.d("TAG", "onError: " + response.code());
|
Log.d("TAG", "onError: " + poiUploadBeanResponse.code() + "");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void otherSaveByNetWork(PoiEntity poiEntity) {
|
private void otherSaveByNetWork(PoiEntity poiEntity) {
|
||||||
@@ -579,6 +606,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// int angle1 = PictureUtil.readPictureDegree(takePhotoPath);
|
||||||
//照片路径
|
//照片路径
|
||||||
takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||||
ivPicture.setTag(takePhotoPath);
|
ivPicture.setTag(takePhotoPath);
|
||||||
@@ -601,6 +629,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// int angle2 = PictureUtil.readPictureDegree(takePhotoPath2);
|
||||||
//照片路径
|
//照片路径
|
||||||
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||||
ivPictures.setTag(takePhotoPath2);
|
ivPictures.setTag(takePhotoPath2);
|
||||||
|
|||||||
@@ -572,8 +572,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
public void onError(Response<OtherUploadPicBean> response) {
|
public void onError(Response<OtherUploadPicBean> response) {
|
||||||
super.onError(response);
|
super.onError(response);
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
Toast.makeText(getActivity(), response.code() + "", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), response.message() + "", Toast.LENGTH_SHORT).show();
|
||||||
Log.d("TAG", "onError: " + response.code() + "");
|
Log.d("TAG", "onError: " + response.message() + "");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -741,6 +741,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// int angle2 = PictureUtil.readPictureDegree(takePhotoPath2);
|
||||||
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||||
ivName.setTag(takePhotoPath2);
|
ivName.setTag(takePhotoPath2);
|
||||||
ivName.setImageBitmap(bitmap);//显示图像
|
ivName.setImageBitmap(bitmap);//显示图像
|
||||||
@@ -761,6 +762,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// int angle3 = PictureUtil.readPictureDegree(takePhotoPath3);
|
||||||
takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||||
ivInternal.setTag(takePhotoPath3);
|
ivInternal.setTag(takePhotoPath3);
|
||||||
ivInternal.setImageBitmap(bitmap);//显示图像
|
ivInternal.setImageBitmap(bitmap);//显示图像
|
||||||
@@ -781,6 +783,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// int angle4 = PictureUtil.readPictureDegree(takePhotoPath4);
|
||||||
takePhotoPath4 = PhotoPathUtil.getTakePhotoPath(data, "d",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
takePhotoPath4 = PhotoPathUtil.getTakePhotoPath(data, "d",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||||
ivCard.setTag(takePhotoPath4);
|
ivCard.setTag(takePhotoPath4);
|
||||||
ivCard.setImageBitmap(bitmap);//显示图像
|
ivCard.setImageBitmap(bitmap);//显示图像
|
||||||
@@ -801,6 +804,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// int angle5 = PictureUtil.readPictureDegree(takePhotoPath5);
|
||||||
takePhotoPath5 = PhotoPathUtil.getTakePhotoPath(data, "e",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
takePhotoPath5 = PhotoPathUtil.getTakePhotoPath(data, "e",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||||
ivElse.setTag(takePhotoPath5);
|
ivElse.setTag(takePhotoPath5);
|
||||||
ivElse.setImageBitmap(bitmap);//显示图像
|
ivElse.setImageBitmap(bitmap);//显示图像
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
poiDao = poiDatabase.getPoiDao();
|
poiDao = poiDatabase.getPoiDao();
|
||||||
tvPictures = (TextView) findViewById(R.id.tv_pictures);
|
tvPictures = (TextView) findViewById(R.id.tv_pictures);
|
||||||
tvPictures.setOnClickListener(this::onClick);
|
tvPictures.setOnClickListener(this::onClick);
|
||||||
etRoadName = (EditText) findViewById(R.id.et_road_name);
|
etRoadName = (EditText) findViewById(R.id.et_poi_video_name);
|
||||||
ivPoiVideoPicture = (ImageView) findViewById(R.id.iv_road_picture);
|
ivPoiVideoPicture = (ImageView) findViewById(R.id.iv_road_picture);
|
||||||
rbCar = (RadioButton) findViewById(R.id.rb_car);
|
rbCar = (RadioButton) findViewById(R.id.rb_car);
|
||||||
rbBicycle = (RadioButton) findViewById(R.id.rb_bicycle);
|
rbBicycle = (RadioButton) findViewById(R.id.rb_bicycle);
|
||||||
@@ -309,7 +309,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
Toast.makeText(getContext(), "请输入poi录像 名称", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "请输入poi录像 名称", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
poiEntity.setName(roadName);
|
poiEntity.setName(roadName+"");
|
||||||
}
|
}
|
||||||
RoadExtend roadExtend = new RoadExtend();
|
RoadExtend roadExtend = new RoadExtend();
|
||||||
int type = getPictureType();
|
int type = getPictureType();
|
||||||
@@ -345,6 +345,10 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
latLng.setLongitude(Double.valueOf(split[3]));
|
latLng.setLongitude(Double.valueOf(split[3]));
|
||||||
latLngs.add(latLng);
|
latLngs.add(latLng);
|
||||||
}
|
}
|
||||||
|
if (strings.size()==1){
|
||||||
|
LatLng latLng = latLngs.get(0);
|
||||||
|
latLngs.add(latLng);
|
||||||
|
}
|
||||||
String lineString = GeometryTools.getLineString(latLngs);
|
String lineString = GeometryTools.getLineString(latLngs);
|
||||||
Log.d("TAG", "onGranted: "+lineString);
|
Log.d("TAG", "onGranted: "+lineString);
|
||||||
poiEntity.setGeoWkt(lineString);
|
poiEntity.setGeoWkt(lineString);
|
||||||
|
|||||||
@@ -315,6 +315,10 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
latLng.setLongitude(Double.valueOf(split[3]));
|
latLng.setLongitude(Double.valueOf(split[3]));
|
||||||
latLngs.add(latLng);
|
latLngs.add(latLng);
|
||||||
}
|
}
|
||||||
|
if (strings.size()==1){
|
||||||
|
LatLng latLng = latLngs.get(0);
|
||||||
|
latLngs.add(latLng);
|
||||||
|
}
|
||||||
String lineString = GeometryTools.getLineString(latLngs);
|
String lineString = GeometryTools.getLineString(latLngs);
|
||||||
Log.d("TAG", "onGranted: "+lineString);
|
Log.d("TAG", "onGranted: "+lineString);
|
||||||
poiEntity.setGeoWkt(lineString);
|
poiEntity.setGeoWkt(lineString);
|
||||||
|
|||||||
@@ -1078,13 +1078,13 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
case 1:
|
case 1:
|
||||||
BitmapDescriptor poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_have_bg);
|
BitmapDescriptor poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_have_bg);
|
||||||
markerPoi = tencentMap.addMarker(new MarkerOptions(mapCenterPoint).icon(poiVideoDescriptor));
|
markerPoi = tencentMap.addMarker(new MarkerOptions(mapCenterPoint).icon(poiVideoDescriptor));
|
||||||
PoiVideoFragment poiVideoFragment = PoiVideoFragment.newInstance(new Bundle());
|
PoiVideoFragment poiVideoFragment = PoiVideoFragment.newInstance(bundle);
|
||||||
showSlidingFragment(poiVideoFragment);
|
showSlidingFragment(poiVideoFragment);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
BitmapDescriptor roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_have_bg);
|
BitmapDescriptor roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_have_bg);
|
||||||
markerPoi = tencentMap.addMarker(new MarkerOptions(mapCenterPoint).icon(roadDescriptor));
|
markerPoi = tencentMap.addMarker(new MarkerOptions(mapCenterPoint).icon(roadDescriptor));
|
||||||
RoadFragment roadFragment = RoadFragment.newInstance(new Bundle());
|
RoadFragment roadFragment = RoadFragment.newInstance(bundle);
|
||||||
showSlidingFragment(roadFragment);
|
showSlidingFragment(roadFragment);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import android.view.View;
|
|||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
@@ -15,6 +16,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||||||
|
|
||||||
import com.kongzue.dialog.interfaces.OnDialogButtonClickListener;
|
import com.kongzue.dialog.interfaces.OnDialogButtonClickListener;
|
||||||
import com.kongzue.dialog.util.BaseDialog;
|
import com.kongzue.dialog.util.BaseDialog;
|
||||||
|
import com.kongzue.dialog.util.DialogSettings;
|
||||||
import com.kongzue.dialog.v3.MessageDialog;
|
import com.kongzue.dialog.v3.MessageDialog;
|
||||||
import com.lzy.okgo.OkGo;
|
import com.lzy.okgo.OkGo;
|
||||||
import com.lzy.okgo.model.Response;
|
import com.lzy.okgo.model.Response;
|
||||||
@@ -51,6 +53,12 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
|||||||
private String takePhotoPath3;
|
private String takePhotoPath3;
|
||||||
private ArrayList<File> takePhoneList;
|
private ArrayList<File> takePhoneList;
|
||||||
private String attestationName;
|
private String attestationName;
|
||||||
|
private ImageView ivHera1;
|
||||||
|
private TextView tvCard1;
|
||||||
|
private ImageView ivHera2;
|
||||||
|
private TextView tvCard2;
|
||||||
|
private ImageView ivHera3;
|
||||||
|
private TextView tvCard3;
|
||||||
|
|
||||||
|
|
||||||
public static UserAttestationFragment newInstance(Bundle bundle) {
|
public static UserAttestationFragment newInstance(Bundle bundle) {
|
||||||
@@ -65,7 +73,6 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initData() {
|
protected void initData() {
|
||||||
super.initData();
|
super.initData();
|
||||||
@@ -89,6 +96,12 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
|||||||
btnAttestation.setOnClickListener(this::onClick);
|
btnAttestation.setOnClickListener(this::onClick);
|
||||||
etAttestationName = (EditText) findViewById(R.id.et_attestationName);
|
etAttestationName = (EditText) findViewById(R.id.et_attestationName);
|
||||||
etNamePhone = (EditText) findViewById(R.id.et_namePhone);
|
etNamePhone = (EditText) findViewById(R.id.et_namePhone);
|
||||||
|
ivHera1 = (ImageView) findViewById(R.id.iv_hera1);
|
||||||
|
tvCard1 = (TextView) findViewById(R.id.tv_card1);
|
||||||
|
ivHera2 = (ImageView) findViewById(R.id.iv_hera2);
|
||||||
|
tvCard2 = (TextView) findViewById(R.id.tv_card2);
|
||||||
|
ivHera3 = (ImageView) findViewById(R.id.iv_hera3);
|
||||||
|
tvCard3 = (TextView) findViewById(R.id.tv_card3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -110,7 +123,6 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
|||||||
startActivityForResult(ivAttestation3, 300);
|
startActivityForResult(ivAttestation3, 300);
|
||||||
break;
|
break;
|
||||||
case R.id.btn_attestation:
|
case R.id.btn_attestation:
|
||||||
|
|
||||||
if (etAttestationName.getText().toString() == null || etAttestationName.getText().toString().equals("")) {
|
if (etAttestationName.getText().toString() == null || etAttestationName.getText().toString().equals("")) {
|
||||||
Toast.makeText(getContext(), "姓名不能为空,请输入姓名", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "姓名不能为空,请输入姓名", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
@@ -120,10 +132,12 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
|||||||
Toast.makeText(getContext(), "身份证错误,请重新输入", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "身份证错误,请重新输入", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nameAuthentication();
|
nameAuthentication();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean checkNum(String text) {
|
public boolean checkNum(String text) {
|
||||||
Pattern patternSfzhm1 = Pattern
|
Pattern patternSfzhm1 = Pattern
|
||||||
.compile("^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$");
|
.compile("^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$");
|
||||||
@@ -131,19 +145,19 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
|||||||
.compile("^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}([0-9]|X)$");
|
.compile("^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}([0-9]|X)$");
|
||||||
Matcher matcherSfzhm1 = patternSfzhm1.matcher(text);
|
Matcher matcherSfzhm1 = patternSfzhm1.matcher(text);
|
||||||
Matcher matcherSfzhm2 = patternSfzhm2.matcher(text);
|
Matcher matcherSfzhm2 = patternSfzhm2.matcher(text);
|
||||||
if(!matcherSfzhm1.find() && !matcherSfzhm2.find())
|
if (!matcherSfzhm1.find() && !matcherSfzhm2.find())
|
||||||
return false;
|
return false;
|
||||||
else return true;
|
else return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void nameAuthentication() {
|
private void nameAuthentication() {
|
||||||
showLoadingDialog();
|
showLoadingDialog();
|
||||||
takePhoneList = new ArrayList<>();
|
takePhoneList = new ArrayList<>();
|
||||||
|
|
||||||
File takePhotoFile1 = new File(takePhotoPath1);
|
File takePhotoFile1 = new File(takePhotoPath1);
|
||||||
File takePhotoFile2 = new File(takePhotoPath2);
|
File takePhotoFile2 = new File(takePhotoPath2);
|
||||||
File takePhotoFile3 = new File(takePhotoPath3);
|
File takePhotoFile3 = new File(takePhotoPath3);
|
||||||
if (!takePhotoFile1.exists() || !takePhotoFile2.exists() ||!takePhotoFile3.exists()){
|
if (!takePhotoFile1.exists() || !takePhotoFile2.exists() || !takePhotoFile3.exists()) {
|
||||||
Toast.makeText(getContext(), "身份证照片不能为空", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "身份证照片不能为空", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -169,7 +183,6 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Log.d("TAG", "onSuccess: " + response.toString() + "sssssssssssss");
|
Log.d("TAG", "onSuccess: " + response.toString() + "sssssssssssss");
|
||||||
if (response.body().equals("0")) {
|
if (response.body().equals("0")) {
|
||||||
MessageDialog.show((AppCompatActivity) getActivity(), "提示", "不通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
MessageDialog.show((AppCompatActivity) getActivity(), "提示", "不通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||||
@@ -177,7 +190,7 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
|||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
// Toast.makeText(getContext(), "点击了确定", Toast.LENGTH_SHORT).show();
|
// Toast.makeText(getContext(), "点击了确定", Toast.LENGTH_SHORT).show();
|
||||||
//传值给持卡人
|
//传值给持卡人
|
||||||
Constant.USER_ATTESTATION_NAME=attestationName;
|
Constant.USER_ATTESTATION_NAME = attestationName;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -185,7 +198,7 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
|||||||
MessageDialog.show((AppCompatActivity) getActivity(), "提示", "通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
MessageDialog.show((AppCompatActivity) getActivity(), "提示", "通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
Constant.USER_ATTESTATION_NAME=attestationName;
|
Constant.USER_ATTESTATION_NAME = attestationName;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -206,23 +219,75 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
|||||||
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
if (requestCode == 100 && resultCode == RESULT_OK) {
|
if (requestCode == 100 && resultCode == RESULT_OK) {
|
||||||
takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data, "a","");
|
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||||
//从附加值中获取返回的图像
|
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");
|
int height = bitmap.getHeight();
|
||||||
ivAttestation1.setImageBitmap(bitmap);//显示图像
|
int width = bitmap.getWidth();
|
||||||
} else if (requestCode == 200 && resultCode == RESULT_OK) {
|
if (height > width) {
|
||||||
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b","");
|
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||||
|
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
|
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
startActivityForResult(intentPanorama, 100);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
|
||||||
|
takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data, "a", "");
|
||||||
|
ivAttestation1.setTag(takePhotoPath1);
|
||||||
|
ivAttestation1.setImageBitmap(bitmap);//显示图像
|
||||||
|
ivHera1.setVisibility(View.GONE);
|
||||||
|
tvCard1.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (requestCode == 200 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||||
//从附加值中获取返回的图像
|
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");
|
int height = bitmap.getHeight();
|
||||||
ivAttestation2.setImageBitmap(bitmap);//显示图像
|
int width = bitmap.getWidth();
|
||||||
}else if (requestCode == 300 && resultCode == RESULT_OK) {
|
if (height > width) {
|
||||||
takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "c","");
|
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||||
|
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
|
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
startActivityForResult(intentPanorama, 200);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "a", "");
|
||||||
|
ivAttestation2.setTag(takePhotoPath2);
|
||||||
|
ivAttestation2.setImageBitmap(bitmap);//显示图像
|
||||||
|
ivHera1.setVisibility(View.GONE);
|
||||||
|
tvCard1.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (requestCode == 300 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||||
//从附加值中获取返回的图像
|
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");
|
int height = bitmap.getHeight();
|
||||||
ivAttestation3.setImageBitmap(bitmap);//显示图像
|
int width = bitmap.getWidth();
|
||||||
|
if (height > width) {
|
||||||
|
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||||
|
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
|
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
startActivityForResult(intentPanorama, 300);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
|
||||||
|
takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "a", "");
|
||||||
|
ivAttestation3.setTag(takePhotoPath3);
|
||||||
|
ivAttestation3.setImageBitmap(bitmap);//显示图像
|
||||||
|
ivHera1.setVisibility(View.GONE);
|
||||||
|
tvCard1.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,11 @@ public class HttpInterface {
|
|||||||
public static final String INSIDE_API_LIST = IPm6+"poivideotask/1/submitPoivideotask";//poi录像 保存
|
public static final String INSIDE_API_LIST = IPm6+"poivideotask/1/submitPoivideotask";//poi录像 保存
|
||||||
//172.23.139.4:8003/poivideotask/1/uploadpic
|
//172.23.139.4:8003/poivideotask/1/uploadpic
|
||||||
public static final String POI_VIDEO_UPLOAD_PIC = IPm6+"poivideotask/1/uploadpic";//poi录像-上传
|
public static final String POI_VIDEO_UPLOAD_PIC = IPm6+"poivideotask/1/uploadpic";//poi录像-上传
|
||||||
|
//http://172.23.139.4:8003/m4/task/1/getPhone?geo=1rn7exd5uhxy
|
||||||
|
public static final String GET_PHONE = IPm6 + "m4/task/1/getPhone"; //任务搜索
|
||||||
|
//172.23.139.4:8003/cstask/1/submitCstask?taskId=0&name=充电站&geo=1rn7exd5uhxy&memo=测试备注&sptype=1&ffid=104&existence=1&detail={"cp_openType":"1,2","cp_floor":1,"cp_availableState":0,"sign_exist":0}
|
||||||
|
public static final String SUBMIT_CSTASK =IPm6+"cstask/1/submitCstask";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 面状任务
|
* 面状任务
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import android.graphics.Bitmap;
|
|||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Environment;
|
|
||||||
|
|
||||||
import com.navinfo.outdoor.api.Constant;
|
import com.navinfo.outdoor.api.Constant;
|
||||||
|
|
||||||
@@ -20,12 +19,20 @@ import java.util.Date;
|
|||||||
* 获取图片的真实路径
|
* 获取图片的真实路径
|
||||||
*/
|
*/
|
||||||
public class PhotoPathUtil {
|
public class PhotoPathUtil {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param data
|
||||||
|
* @param d 类型
|
||||||
|
* @param coord 经纬度加密
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public static String getTakePhotoPath(Intent data,String d,String coord) {
|
public static String getTakePhotoPath(Intent data,String d,String coord) {
|
||||||
Bitmap photo = null;
|
Bitmap photo = null;
|
||||||
|
int angle=0;
|
||||||
Uri uri = data.getData();
|
Uri uri = data.getData();
|
||||||
if (uri != null) {
|
if (uri != null) {
|
||||||
photo = BitmapFactory.decodeFile(uri.getPath());
|
photo = BitmapFactory.decodeFile(uri.getPath());
|
||||||
|
angle = PictureUtil.readPictureDegree(uri.getPath());
|
||||||
}
|
}
|
||||||
if (photo == null) {
|
if (photo == null) {
|
||||||
Bundle bundle = data.getExtras();
|
Bundle bundle = data.getExtras();
|
||||||
@@ -38,12 +45,16 @@ public class PhotoPathUtil {
|
|||||||
|
|
||||||
FileOutputStream fileOutputStream = null;
|
FileOutputStream fileOutputStream = null;
|
||||||
try {
|
try {
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
|
DateFormat formatter = new SimpleDateFormat("yyyy-MM-ddHHmmss");
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||||
String format = formatter.format(calendar.getTime());
|
String format = formatter.format(calendar.getTime());
|
||||||
|
long time=System.currentTimeMillis();
|
||||||
//文件
|
//文件
|
||||||
File file = new File(Constant.PICTURE_FOLDER, d+format+coord+ ".jpg");
|
if (angle==0){
|
||||||
|
angle=90;
|
||||||
|
}
|
||||||
|
File file = new File(Constant.PICTURE_FOLDER, d+time+"_p"+coord+"_a"+angle+".jpg");
|
||||||
/***打开文件输出流*/
|
/***打开文件输出流*/
|
||||||
fileOutputStream = new FileOutputStream(file);
|
fileOutputStream = new FileOutputStream(file);
|
||||||
// 生成图片文件
|
// 生成图片文件
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.navinfo.outdoor.util;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
|
import android.media.ExifInterface;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
@@ -39,4 +40,33 @@ public class PictureUtil {
|
|||||||
// Uri.parse("file://" + "/sdcard/namecard/")));
|
// Uri.parse("file://" + "/sdcard/namecard/")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 读取图片属性:旋转的角度
|
||||||
|
*
|
||||||
|
* @param path 拍摄图片的完整路径
|
||||||
|
* @return degree旋转的角度
|
||||||
|
*/
|
||||||
|
public static int readPictureDegree(String path) {
|
||||||
|
int degree = 0;
|
||||||
|
try {
|
||||||
|
ExifInterface exifInterface = new ExifInterface(path);
|
||||||
|
int orientation = exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
|
||||||
|
switch (orientation) {
|
||||||
|
case ExifInterface.ORIENTATION_ROTATE_90:
|
||||||
|
degree = 90;
|
||||||
|
break;
|
||||||
|
case ExifInterface.ORIENTATION_ROTATE_180:
|
||||||
|
degree = 180;
|
||||||
|
break;
|
||||||
|
case ExifInterface.ORIENTATION_ROTATE_270:
|
||||||
|
degree = 270;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return degree;
|
||||||
|
}
|
||||||
|
return degree;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.navinfo.outdoor.util;
|
||||||
|
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class TimestampUtil {
|
||||||
|
/*
|
||||||
|
* 将时间转换为时间戳
|
||||||
|
*/
|
||||||
|
public static String dateToStamp(String s) throws ParseException {
|
||||||
|
String res;
|
||||||
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
Date date = simpleDateFormat.parse(s);
|
||||||
|
long ts = date.getTime();
|
||||||
|
res = String.valueOf(ts);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 将时间戳转换为时间
|
||||||
|
*/
|
||||||
|
public static String stampToDate(String s){
|
||||||
|
String res;
|
||||||
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
long lt = new Long(s);
|
||||||
|
Date date = new Date(lt);
|
||||||
|
res = simpleDateFormat.format(date);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
android:textSize="15sp" />
|
android:textSize="15sp" />
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/et_road_name"
|
android:id="@+id/et_poi_video_name"
|
||||||
android:layout_width="200dp"
|
android:layout_width="200dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
|
|||||||
@@ -137,12 +137,14 @@
|
|||||||
app:layout_constraintTop_toTopOf="@id/iv_attestation1">
|
app:layout_constraintTop_toTopOf="@id/iv_attestation1">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:id="@+id/iv_hera1"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:src="@drawable/card_zhengmian" />
|
android:src="@drawable/card_zhengmian" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_card1"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
@@ -179,12 +181,14 @@
|
|||||||
app:layout_constraintTop_toTopOf="@id/iv_attestation2">
|
app:layout_constraintTop_toTopOf="@id/iv_attestation2">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:id="@+id/iv_hera2"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:src="@drawable/card_fanmian" />
|
android:src="@drawable/card_fanmian" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_card2"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
@@ -220,11 +224,13 @@
|
|||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:id="@+id/iv_hera3"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:src="@drawable/card_shouchi" />
|
android:src="@drawable/card_shouchi" />
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_card3"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="*手持身份证"
|
android:text="*手持身份证"
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.anko_version = '0.10.1'//扩展库版本
|
ext.anko_version = '0.10.1'//扩展库版本
|
||||||
// ext.kotlin_coroutines = '1.4.1'//协程版本需要findById()...
|
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
|
|||||||
Reference in New Issue
Block a user