增加了上传成功删除本地数据、并修改空指针的bug
This commit is contained in:
parent
c0b0222f7d
commit
c86f94cc94
@ -87,6 +87,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
private ViewGroup layerChange; // 切换地图和相机的父控件
|
||||
private CheckBox capturePicture,cbMapType;//拍照
|
||||
private boolean isMapSlide = false;
|
||||
private boolean isOration= false;
|
||||
private SimpleDateFormat formatter;
|
||||
private File paperFile;
|
||||
private int poi_video_type;
|
||||
@ -114,7 +115,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
private Timer timer;
|
||||
private TimerTask timerTask;
|
||||
private int videoIndex = -1;
|
||||
private int oration;
|
||||
private int oration=0;
|
||||
private ImageView ivPicImage;
|
||||
private SystemTTS systemTTS;
|
||||
|
||||
@ -175,10 +176,12 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
if (isChecked) {
|
||||
isOration=true;
|
||||
if (poi_video_type != 2) {
|
||||
capturePicture.setText("暂停采集"); }
|
||||
startTimer();
|
||||
} else {
|
||||
isOration=false;
|
||||
if (poi_video_type != 2) {
|
||||
capturePicture.setText("开始采集"); }
|
||||
stopTimer();
|
||||
@ -219,6 +222,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
super.onPictureTaken(result);
|
||||
if (oration == 0) { // oblation为0时,拍摄视频必须为横屏
|
||||
// 如果当前手机是竖向,则不
|
||||
if (isOration){
|
||||
if (Objects.requireNonNull(camera.getPictureSize()).getWidth() < camera.getPictureSize().getHeight()) {
|
||||
Toast.makeText(PicturesActivity.this, "不允许竖向拍摄...", Toast.LENGTH_SHORT).show();
|
||||
stopTimer();
|
||||
@ -228,8 +232,12 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
capturePicture.setChecked(false);
|
||||
}
|
||||
return;
|
||||
}else {
|
||||
isOration=false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
File file = new File(finalVideoPath);
|
||||
initMarkerPaper();
|
||||
result.toFile(file, new FileCallback() {
|
||||
|
@ -186,7 +186,7 @@ public class Constant {
|
||||
public static boolean IS_FILTER_LIST_ITEM = true;//poi页面的查重
|
||||
public static TencentMap.OnMarkerClickListener markerClickListener=null;
|
||||
|
||||
public static final String NAVIN_FO="9.24";//版本
|
||||
public static final String NAVIN_FO="9.26";//版本
|
||||
|
||||
/**
|
||||
* 联系我们的QQ群名称和QQ群号
|
||||
|
@ -62,11 +62,14 @@ public abstract class BaseDrawerFragment extends BaseFragment {
|
||||
|
||||
}
|
||||
public void moveLatlng(LatLng latLng, TencentMap.CancelableCallback cancelableCallback) {
|
||||
if (tencentMap.getCameraPosition()!=null){
|
||||
|
||||
}
|
||||
CameraUpdate cameraSigma = CameraUpdateFactory.newCameraPosition(new CameraPosition(
|
||||
latLng, //中心点坐标,地图目标经纬度
|
||||
tencentMap.getCameraPosition().zoom, //目标缩放级别
|
||||
tencentMap.getCameraPosition().tilt, //目标倾斜角[0.0 ~ 45.0] (垂直地图时为0)
|
||||
tencentMap.getCameraPosition().bearing)); //目标旋转角 0~360° (正北方为0)
|
||||
tencentMap.getCameraPosition()==null?0:tencentMap.getCameraPosition().zoom, //目标缩放级别
|
||||
tencentMap.getCameraPosition()==null?0:tencentMap.getCameraPosition().tilt, //目标倾斜角[0.0 ~ 45.0] (垂直地图时为0)
|
||||
tencentMap.getCameraPosition()==null?0:tencentMap.getCameraPosition().bearing)); //目标旋转角 0~360° (正北方为0)
|
||||
tencentMap.animateCamera(cameraSigma, cancelableCallback);
|
||||
}
|
||||
|
||||
|
@ -964,6 +964,9 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
if (uploadBeanResult != null) {
|
||||
if (uploadBeanResult.getCode() == 200) {
|
||||
PoiDatabase.getInstance(getActivity()).getChargingPileDao().deleteChargingPileEntity(chargingPileEntity);
|
||||
for (int i = 0; i < chargingPileFileList.size(); i++) {
|
||||
chargingPileFileList.get(i).delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1079,7 +1082,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
.token(Constant.ACCESS_TOKEN)
|
||||
.params(httpParams)
|
||||
.cls(PoiUploadBean.class)
|
||||
.postFileAsynchronous(UploadUtils.getInstance().getChargingUploadCallback(getActivity(), showPoiEntity));
|
||||
.postFileAsynchronous(UploadUtils.getInstance().getChargingUploadCallback(getActivity(), showPoiEntity,chargingStationList));
|
||||
Objects.requireNonNull(getActivity()).onBackPressed();//回退
|
||||
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
|
||||
WaitDialog.dismiss(3000);
|
||||
|
@ -97,8 +97,9 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
|
||||
if (Constant.LEVEL != 0) {
|
||||
mainGrade.setText("LV."+Constant.LEVEL);
|
||||
}
|
||||
if (Constant.USHERED!=null){
|
||||
initNetWork();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
@ -551,7 +551,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
.token(Constant.ACCESS_TOKEN)
|
||||
.params(httpParams)
|
||||
.cls(PoiUploadBean.class)
|
||||
.postFileAsynchronous(UploadUtils.getInstance().getOtherUploadCallback(getActivity(),showPoiEntity));
|
||||
.postFileAsynchronous(UploadUtils.getInstance().getOtherUploadCallback(getActivity(),showPoiEntity,otherUploadList));
|
||||
Objects.requireNonNull(getActivity()).onBackPressed();//回退
|
||||
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
|
||||
WaitDialog.dismiss(3000);
|
||||
|
@ -42,6 +42,7 @@ import com.navinfo.outdoor.activity.FragmentManagement;
|
||||
import com.navinfo.outdoor.activity.PhotographActivity;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||
import com.navinfo.outdoor.util.AWMp4ParserHelper;
|
||||
import com.navinfo.outdoor.util.UploadUtils;
|
||||
import com.navinfo.outdoor.bean.GetPhoneBean;
|
||||
import com.navinfo.outdoor.bean.Info;
|
||||
@ -332,6 +333,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
rlCard.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
@ -803,7 +805,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
.token(Constant.ACCESS_TOKEN)
|
||||
.fileList(poiPicList)
|
||||
.params(httpParams)
|
||||
.postFileAsynchronous(UploadUtils.getInstance().getPoiUploadCallback(getActivity(),showPoiEntity));
|
||||
.postFileAsynchronous(UploadUtils.getInstance().getPoiUploadCallback(getActivity(),showPoiEntity,poiPicList));
|
||||
Objects.requireNonNull(getActivity()).onBackPressed();//回退
|
||||
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
|
||||
WaitDialog.dismiss(3000);
|
||||
|
@ -103,8 +103,10 @@ public class PoiTaskFragment extends BaseFragment implements View.OnClickListene
|
||||
assert getArguments() != null;
|
||||
type = getArguments().getInt("type", 0);
|
||||
listBeans = new ArrayList<>();
|
||||
if (Constant.USHERED!=null){
|
||||
initWork(type,true);
|
||||
}
|
||||
}
|
||||
|
||||
private void initWork(int type, boolean aBoolean) {
|
||||
showLoadingDialog();
|
||||
|
@ -339,8 +339,10 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
@Override
|
||||
public void run() {
|
||||
ZipUtil.zipFiles(videoFileList, fileZip, null);
|
||||
if (showPoiEntity.getId()==null){
|
||||
if (showPoiEntity == null || showPoiEntity.getTaskStatus() == 1 || showPoiEntity.getTaskStatus() == 2 || showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 5) {
|
||||
if (showPoiEntity == null) {
|
||||
showPoiEntity = new PoiEntity();
|
||||
}
|
||||
if (showPoiEntity.getTaskStatus() == 1 || showPoiEntity.getTaskStatus() == 2 || showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 5) {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -356,27 +358,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
}
|
||||
});
|
||||
}
|
||||
}else {
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
if (poiDaoPoiEntity == null || poiDaoPoiEntity.getTaskStatus() == 1 || poiDaoPoiEntity.getTaskStatus() == 2 || poiDaoPoiEntity.getTaskStatus() == 0 || poiDaoPoiEntity.getTaskStatus() == 5) {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
initPoiSaveLocal(true);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
poiVideoUpload(poiDaoPoiEntity.getBodyId(), fileZip);
|
||||
Constant.isPresent=false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}).start();
|
||||
} else {
|
||||
@ -456,7 +437,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
.cls(OtherUploadPicBean.class)
|
||||
.params(httpParams)
|
||||
.token(Constant.ACCESS_TOKEN)
|
||||
.postRequest(UploadUtils.getInstance().getPoiVideoUploadCallback(getActivity(),showPoiEntity));
|
||||
.postRequest(UploadUtils.getInstance().getPoiVideoUploadCallback(getActivity(),showPoiEntity,fileZip));
|
||||
Objects.requireNonNull(getActivity()).onBackPressed();//回退
|
||||
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
|
||||
WaitDialog.dismiss(3000);
|
||||
@ -577,7 +558,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
if (showPoiEntity != null) {
|
||||
if (showPoiEntity.getTaskStatus() == 5) {
|
||||
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);//结束领取
|
||||
|
||||
} else {
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||
|
@ -194,7 +194,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
etRoadName.setText(name);
|
||||
}
|
||||
String geoWkt = showPoiEntity.getGeoWkt();
|
||||
if (geoWkt!=null){
|
||||
if (geoWkt != null) {
|
||||
String geo = Geohash.getInstance().decode(geoWkt);
|
||||
Geometry geometry = GeometryTools.createGeometry(geo);
|
||||
switch (geometry.getGeometryType()) {
|
||||
@ -212,7 +212,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
markerRoad = tencentMap.addMarker(new MarkerOptions(latLng).icon(roadDescriptor).anchor(0.5f, 1.0f));
|
||||
markerRoad.setZIndex(4);
|
||||
moveLatlng(latLng, null);
|
||||
}else {
|
||||
} else {
|
||||
String x = showPoiEntity.getX();
|
||||
String y = showPoiEntity.getY();
|
||||
if (x != null && y != null) {
|
||||
@ -343,8 +343,10 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
@Override
|
||||
public void run() {
|
||||
ZipUtil.zipFiles(videoFileList, fileZip, null);//压缩
|
||||
if (showPoiEntity.getId()==null){
|
||||
if (showPoiEntity == null || showPoiEntity.getTaskStatus() == 1 || showPoiEntity.getTaskStatus() == 2 || showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 5) {
|
||||
if (showPoiEntity == null) {
|
||||
showPoiEntity = new PoiEntity();
|
||||
}
|
||||
if (showPoiEntity.getTaskStatus() == 1 || showPoiEntity.getTaskStatus() == 2 || showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 5) {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -360,28 +362,6 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
}
|
||||
});
|
||||
}
|
||||
}else {
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
if (poiDaoPoiEntity == null || poiDaoPoiEntity.getTaskStatus() == 1 || poiDaoPoiEntity.getTaskStatus() == 2 || poiDaoPoiEntity.getTaskStatus() == 0 || poiDaoPoiEntity.getTaskStatus() == 5) {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
initPoiSaveLocal(true);
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
poiVideoUpload(poiDaoPoiEntity.getBodyId(), fileZip);
|
||||
Constant.isPresent = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}).start();
|
||||
} else {
|
||||
@ -462,7 +442,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
.params(httpParams)
|
||||
.token(Constant.ACCESS_TOKEN)
|
||||
.cls(OtherUploadPicBean.class)
|
||||
.postRequest(UploadUtils.getInstance().getRoadUploadCallback(getActivity(), showPoiEntity));
|
||||
.postRequest(UploadUtils.getInstance().getRoadUploadCallback(getActivity(), showPoiEntity, fileZip));
|
||||
Objects.requireNonNull(getActivity()).onBackPressed();//回退
|
||||
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
|
||||
WaitDialog.dismiss(3000);
|
||||
|
@ -203,17 +203,18 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
}
|
||||
break;
|
||||
case R.id.btn_stay_submit://提交
|
||||
if (Constant.isPresent) {
|
||||
if (poiEntities == null) {
|
||||
poiEntities = new ArrayList<>();
|
||||
}
|
||||
} else {
|
||||
poiEntities.clear();
|
||||
}
|
||||
List<PoiEntity> allRoad = staySubmitAdapter.getAllRoad();
|
||||
for (int i = 0; i < allRoad.size(); i++) {
|
||||
if (allRoad.get(i).isChecked()) {
|
||||
poiEntities.add(allRoad.get(i));
|
||||
}
|
||||
}
|
||||
if (Constant.isPresent) {
|
||||
if (poiEntities.size() > 0) {
|
||||
PoiSaveUtils.getInstance(getActivity()).uploadPoiEntityBatch(poiEntities);
|
||||
Constant.isPresent = false;
|
||||
@ -279,6 +280,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
|
@ -210,7 +210,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
EventBus.getDefault().post(msg);
|
||||
dismissLoadingDialog();
|
||||
removableHashMap.clear();
|
||||
if (Constant.USHERED!=null){
|
||||
initThread(); // 刷新筛选的本地数据
|
||||
}
|
||||
if (Constant.currentLocation != null) {
|
||||
initList(Constant.currentLocation); // 刷新筛选的网络数据
|
||||
} else {
|
||||
@ -563,11 +565,14 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
.arrowTexture(bitmapLine);
|
||||
// 绘制折线
|
||||
Polyline polyline = tencentMap.addPolyline(polylineOptions);
|
||||
if (polyline!=null){
|
||||
polyline.setZIndex(MARKER_LINE);
|
||||
removables.add(polyline);
|
||||
if (latLineString != null && latLineString.size() > 0) {
|
||||
latLng = latLineString.get(0);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case "Point": //点
|
||||
latLng = GeometryTools.createLatLng(geo);
|
||||
@ -583,6 +588,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
strokeColor(0xff000000).
|
||||
//边线宽度15像素
|
||||
strokeWidth(5));
|
||||
if (polygon!=null){
|
||||
polygon.setZIndex(MARKER_FACE);
|
||||
removables.add(polygon);
|
||||
com.vividsolutions.jts.geom.Point centroid = geometry.getCentroid();
|
||||
@ -591,6 +597,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
latLng = new LatLng();
|
||||
latLng.setLatitude(y);
|
||||
latLng.setLongitude(x);
|
||||
}
|
||||
break;
|
||||
}
|
||||
switch (list.get(i).getType()) {
|
||||
@ -762,11 +769,14 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
.arrowTexture(bitmapLine);
|
||||
// 绘制折线
|
||||
Polyline polyline = tencentMap.addPolyline(polylineOptions);
|
||||
if (polyline!=null){
|
||||
polyline.setZIndex(MARKER_LINE);
|
||||
removableScreenMarker.add(polyline);
|
||||
if (latLineString != null && latLineString.size() > 0) {
|
||||
latLng = latLineString.get(0);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case "Polygon": //面
|
||||
List<LatLng> latPolygon = GeometryTools.getLatLags(geo);
|
||||
@ -779,7 +789,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
strokeColor(0xff000000).
|
||||
//边线宽度15像素
|
||||
strokeWidth(25));
|
||||
|
||||
if (polygon!=null){
|
||||
polygon.setZIndex(MARKER_FACE);
|
||||
removableScreenMarker.add(polygon);
|
||||
com.vividsolutions.jts.geom.Point centroid = geometry.getCentroid();
|
||||
@ -788,6 +798,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
latLng = new LatLng();
|
||||
latLng.setLatitude(y);
|
||||
latLng.setLongitude(x);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
BitmapDescriptor descriptor = null;
|
||||
@ -893,11 +905,14 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
.arrowTexture(bitmapLine);
|
||||
// 绘制折线
|
||||
Polyline polyline = tencentMap.addPolyline(polylineOptions);
|
||||
if (polyline!=null){
|
||||
polyline.setZIndex(MARKER_LINE);
|
||||
removablesLocality.add(polyline);
|
||||
if (latLineString != null && latLineString.size() > 0) {
|
||||
latLng = latLineString.get(0);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case "Polygon": //面
|
||||
List<LatLng> latPolygon = GeometryTools.getLatLags(geo);
|
||||
@ -906,6 +921,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
fillColor(Color.parseColor("#97E0E7EC")).//边线颜色为黑色
|
||||
strokeColor(0xff00ff00).//边线宽度15像素
|
||||
strokeWidth(5));
|
||||
if (polygon!=null){
|
||||
polygon.setZIndex(MARKER_FACE);
|
||||
removablesLocality.add(polygon);
|
||||
Point centroid = geometry.getCentroid();
|
||||
@ -914,6 +930,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
latLng = new LatLng();
|
||||
latLng.setLatitude(y);
|
||||
latLng.setLongitude(x);
|
||||
}
|
||||
|
||||
/*if (latPolygon != null && latPolygon.size() > 0) {
|
||||
latLng = latPolygon.get(0);
|
||||
}*/
|
||||
@ -1122,7 +1140,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
});
|
||||
break;
|
||||
case 5:
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "你其他页面还有未提交完的数据", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
@ -1133,7 +1150,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
initRemovePoiSharePre();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}).setStyle(DialogSettings.STYLE.STYLE_KONGZUE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ package com.navinfo.outdoor.http;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
|
||||
public class HttpInterface {
|
||||
public static final String IP_TEXT = "http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口
|
||||
public static final String IP_TEX = "http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口
|
||||
public static final String IP = "http://dtxbmaps.navinfo.com/dtxb_test/m4";//测试接口
|
||||
|
||||
public static final String USER_PATH ="/user/";//我的
|
||||
|
@ -91,12 +91,14 @@ public class PoiSaveUtils {
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.EVENT_STAY_REFRESH;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
if (anInt+bInt>0){
|
||||
Message obtain1 = Message.obtain();
|
||||
obtain1.what = Constant.NEST_WORD_SUBMIT;
|
||||
obtain1.obj = "批量提交 成功:" + anInt + ", 失败:" + bInt;
|
||||
EventBus.getDefault().post(obtain1);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
@ -307,6 +309,9 @@ public class PoiSaveUtils {
|
||||
OtherUploadPicBean otherUploadPicBean = gson.fromJson(bodyStr, OtherUploadPicBean.class);
|
||||
if (otherUploadPicBean.getCode() == 200) {
|
||||
PoiDatabase.getInstance(mContext).getPoiDao().deletePoiEntity(poiEntity);
|
||||
for (int i = 0; i < photoFile.size(); i++) {
|
||||
photoFile.get(i).delete();
|
||||
}
|
||||
Log.d("TAGss", "uploadPoiNet: 成功" + anInt);
|
||||
anInt++;
|
||||
return;
|
||||
@ -386,7 +391,6 @@ public class PoiSaveUtils {
|
||||
hashMap.put("sign_exist", chargingPileEntity.getSign_exist());
|
||||
httpParams.put("detail", String.valueOf(hashMap));
|
||||
try {
|
||||
|
||||
Response execute = OkGoBuilder.getInstance()
|
||||
.Builder(mContext)
|
||||
.url(HttpInterface.SUBMIT_CSTASK)
|
||||
@ -454,7 +458,6 @@ public class PoiSaveUtils {
|
||||
Toast.makeText(mContext, "没有保存本地", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -490,6 +493,9 @@ public class PoiSaveUtils {
|
||||
if (uploadBeanResult.getCode() == 200) {
|
||||
Log.d("TAGss", "chargingPileUploadNetWork" + 200);
|
||||
PoiDatabase.getInstance(mContext).getChargingPileDao().deleteChargingPileEntity(chargingPileEntity);
|
||||
for (int i = 0; i < chargingPileFileList.size(); i++) {
|
||||
chargingPileFileList.get(i).delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
|
@ -14,6 +14,9 @@ import com.navinfo.outdoor.room.PoiEntity;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class UploadUtils {
|
||||
@ -30,9 +33,10 @@ public class UploadUtils {
|
||||
* 道路
|
||||
* @param mContext
|
||||
* @param showPoiEntity
|
||||
* @param fileZip
|
||||
* @return
|
||||
*/
|
||||
public Callback getRoadUploadCallback(Activity mContext, PoiEntity showPoiEntity) {
|
||||
public Callback getRoadUploadCallback(Activity mContext, PoiEntity showPoiEntity, File fileZip) {
|
||||
PoiDao poiDao = PoiDatabase.getInstance(mContext).getPoiDao();
|
||||
return new Callback<OtherUploadPicBean>() {
|
||||
@Override
|
||||
@ -47,6 +51,11 @@ public class UploadUtils {
|
||||
public void run() {
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
poiDao.deletePoiEntity(poiDaoPoiEntity);
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
||||
fileListByUUID.get(i).delete();
|
||||
}
|
||||
fileZip.delete();
|
||||
Objects.requireNonNull(mContext).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -80,9 +89,10 @@ public class UploadUtils {
|
||||
* poi
|
||||
* @param mContext
|
||||
* @param showPoiEntity
|
||||
* @param poiPicList
|
||||
* @return
|
||||
*/
|
||||
public Callback getPoiUploadCallback(Activity mContext, PoiEntity showPoiEntity) {
|
||||
public Callback getPoiUploadCallback(Activity mContext, PoiEntity showPoiEntity, ArrayList<File> poiPicList) {
|
||||
PoiDao poiDao = PoiDatabase.getInstance(mContext).getPoiDao();
|
||||
return new Callback<OtherUploadPicBean>() {
|
||||
@Override
|
||||
@ -97,6 +107,9 @@ public class UploadUtils {
|
||||
public void run() {
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
poiDao.deletePoiEntity(poiDaoPoiEntity);
|
||||
for (int i = 0; i < poiPicList.size(); i++) {
|
||||
poiPicList.get(i).delete();
|
||||
}
|
||||
Objects.requireNonNull(mContext).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -131,9 +144,10 @@ public class UploadUtils {
|
||||
* poiVideo
|
||||
* @param mContext
|
||||
* @param showPoiEntity
|
||||
* @param fileZip
|
||||
* @return
|
||||
*/
|
||||
public Callback getPoiVideoUploadCallback(Activity mContext, PoiEntity showPoiEntity) {
|
||||
public Callback getPoiVideoUploadCallback(Activity mContext, PoiEntity showPoiEntity, File fileZip) {
|
||||
PoiDao poiDao = PoiDatabase.getInstance(mContext).getPoiDao();
|
||||
return new Callback<OtherUploadPicBean>() {
|
||||
@Override
|
||||
@ -148,6 +162,11 @@ public class UploadUtils {
|
||||
public void run() {
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
poiDao.deletePoiEntity(poiDaoPoiEntity);
|
||||
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
|
||||
for (int i = 0; i < fileListByUUID.size(); i++) {
|
||||
fileListByUUID.get(i).delete();
|
||||
}
|
||||
fileZip.delete();
|
||||
Objects.requireNonNull(mContext).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -182,9 +201,10 @@ public class UploadUtils {
|
||||
* other
|
||||
* @param mContext
|
||||
* @param showPoiEntity
|
||||
* @param otherUploadList
|
||||
* @return
|
||||
*/
|
||||
public Callback getOtherUploadCallback(Activity mContext, PoiEntity showPoiEntity) {
|
||||
public Callback getOtherUploadCallback(Activity mContext, PoiEntity showPoiEntity, List<File> otherUploadList) {
|
||||
PoiDao poiDao = PoiDatabase.getInstance(mContext).getPoiDao();
|
||||
return new Callback<PoiUploadBean>() {
|
||||
@Override
|
||||
@ -199,6 +219,9 @@ public class UploadUtils {
|
||||
public void run() {
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
poiDao.deletePoiEntity(poiDaoPoiEntity);
|
||||
for (int i = 0; i < otherUploadList.size(); i++) {
|
||||
otherUploadList.get(i).delete();
|
||||
}
|
||||
Objects.requireNonNull(mContext).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -234,9 +257,10 @@ public class UploadUtils {
|
||||
* charging
|
||||
* @param mContext
|
||||
* @param showPoiEntity
|
||||
* @param chargingStationList
|
||||
* @return
|
||||
*/
|
||||
public Callback getChargingUploadCallback(Activity mContext, PoiEntity showPoiEntity) {
|
||||
public Callback getChargingUploadCallback(Activity mContext, PoiEntity showPoiEntity, ArrayList<File> chargingStationList) {
|
||||
PoiDao poiDao = PoiDatabase.getInstance(mContext).getPoiDao();
|
||||
return new Callback<PoiUploadBean>() {
|
||||
@Override
|
||||
@ -249,7 +273,11 @@ public class UploadUtils {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
poiDao.deletePoiEntity(showPoiEntity);
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
poiDao.deletePoiEntity(poiDaoPoiEntity);
|
||||
for (int i = 0; i < chargingStationList.size(); i++) {
|
||||
chargingStationList.get(i).delete();
|
||||
}
|
||||
mContext.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
@ -114,13 +114,9 @@
|
||||
/>
|
||||
<ImageView
|
||||
android:id="@+id/iv_road_picture"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:maxWidth="200dp"
|
||||
android:maxHeight="100dp"
|
||||
android:minWidth="140dp"
|
||||
android:minHeight="70dp"
|
||||
android:scaleType="fitXY" />
|
||||
</FrameLayout>
|
||||
|
||||
|
@ -127,13 +127,9 @@
|
||||
android:layout_marginStart="10dp"/>
|
||||
<ImageView
|
||||
android:id="@+id/iv_poi_video_picture"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:maxWidth="200dp"
|
||||
android:maxHeight="100dp"
|
||||
android:minWidth="140dp"
|
||||
android:minHeight="70dp"
|
||||
android:scaleType="fitXY" />
|
||||
</FrameLayout>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user