增加了上传成功删除本地数据、并修改空指针的bug

This commit is contained in:
wangdongsheng 2021-09-26 18:29:05 +08:00
parent c0b0222f7d
commit c86f94cc94
17 changed files with 196 additions and 172 deletions

View File

@ -87,6 +87,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
private ViewGroup layerChange; // 切换地图和相机的父控件 private ViewGroup layerChange; // 切换地图和相机的父控件
private CheckBox capturePicture,cbMapType;//拍照 private CheckBox capturePicture,cbMapType;//拍照
private boolean isMapSlide = false; private boolean isMapSlide = false;
private boolean isOration= false;
private SimpleDateFormat formatter; private SimpleDateFormat formatter;
private File paperFile; private File paperFile;
private int poi_video_type; private int poi_video_type;
@ -114,7 +115,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
private Timer timer; private Timer timer;
private TimerTask timerTask; private TimerTask timerTask;
private int videoIndex = -1; private int videoIndex = -1;
private int oration; private int oration=0;
private ImageView ivPicImage; private ImageView ivPicImage;
private SystemTTS systemTTS; private SystemTTS systemTTS;
@ -175,10 +176,12 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
@Override @Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) { if (isChecked) {
isOration=true;
if (poi_video_type != 2) { if (poi_video_type != 2) {
capturePicture.setText("暂停采集"); } capturePicture.setText("暂停采集"); }
startTimer(); startTimer();
} else { } else {
isOration=false;
if (poi_video_type != 2) { if (poi_video_type != 2) {
capturePicture.setText("开始采集"); } capturePicture.setText("开始采集"); }
stopTimer(); stopTimer();
@ -219,6 +222,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
super.onPictureTaken(result); super.onPictureTaken(result);
if (oration == 0) { // oblation为0时拍摄视频必须为横屏 if (oration == 0) { // oblation为0时拍摄视频必须为横屏
// 如果当前手机是竖向则不 // 如果当前手机是竖向则不
if (isOration){
if (Objects.requireNonNull(camera.getPictureSize()).getWidth() < camera.getPictureSize().getHeight()) { if (Objects.requireNonNull(camera.getPictureSize()).getWidth() < camera.getPictureSize().getHeight()) {
Toast.makeText(PicturesActivity.this, "不允许竖向拍摄...", Toast.LENGTH_SHORT).show(); Toast.makeText(PicturesActivity.this, "不允许竖向拍摄...", Toast.LENGTH_SHORT).show();
stopTimer(); stopTimer();
@ -228,8 +232,12 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
capturePicture.setChecked(false); capturePicture.setChecked(false);
} }
return; return;
}else {
isOration=false;
} }
} }
}
File file = new File(finalVideoPath); File file = new File(finalVideoPath);
initMarkerPaper(); initMarkerPaper();
result.toFile(file, new FileCallback() { result.toFile(file, new FileCallback() {

View File

@ -186,7 +186,7 @@ public class Constant {
public static boolean IS_FILTER_LIST_ITEM = true;//poi页面的查重 public static boolean IS_FILTER_LIST_ITEM = true;//poi页面的查重
public static TencentMap.OnMarkerClickListener markerClickListener=null; public static TencentMap.OnMarkerClickListener markerClickListener=null;
public static final String NAVIN_FO="9.24";//版本 public static final String NAVIN_FO="9.26";//版本
/** /**
* 联系我们的QQ群名称和QQ群号 * 联系我们的QQ群名称和QQ群号

View File

@ -62,11 +62,14 @@ public abstract class BaseDrawerFragment extends BaseFragment {
} }
public void moveLatlng(LatLng latLng, TencentMap.CancelableCallback cancelableCallback) { public void moveLatlng(LatLng latLng, TencentMap.CancelableCallback cancelableCallback) {
if (tencentMap.getCameraPosition()!=null){
}
CameraUpdate cameraSigma = CameraUpdateFactory.newCameraPosition(new CameraPosition( CameraUpdate cameraSigma = CameraUpdateFactory.newCameraPosition(new CameraPosition(
latLng, //中心点坐标地图目标经纬度 latLng, //中心点坐标地图目标经纬度
tencentMap.getCameraPosition().zoom, //目标缩放级别 tencentMap.getCameraPosition()==null?0:tencentMap.getCameraPosition().zoom, //目标缩放级别
tencentMap.getCameraPosition().tilt, //目标倾斜角[0.0 ~ 45.0] (垂直地图时为0) tencentMap.getCameraPosition()==null?0:tencentMap.getCameraPosition().tilt, //目标倾斜角[0.0 ~ 45.0] (垂直地图时为0)
tencentMap.getCameraPosition().bearing)); //目标旋转角 0~360° (正北方为0) tencentMap.getCameraPosition()==null?0:tencentMap.getCameraPosition().bearing)); //目标旋转角 0~360° (正北方为0)
tencentMap.animateCamera(cameraSigma, cancelableCallback); tencentMap.animateCamera(cameraSigma, cancelableCallback);
} }

View File

@ -964,6 +964,9 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
if (uploadBeanResult != null) { if (uploadBeanResult != null) {
if (uploadBeanResult.getCode() == 200) { if (uploadBeanResult.getCode() == 200) {
PoiDatabase.getInstance(getActivity()).getChargingPileDao().deleteChargingPileEntity(chargingPileEntity); 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) .token(Constant.ACCESS_TOKEN)
.params(httpParams) .params(httpParams)
.cls(PoiUploadBean.class) .cls(PoiUploadBean.class)
.postFileAsynchronous(UploadUtils.getInstance().getChargingUploadCallback(getActivity(), showPoiEntity)); .postFileAsynchronous(UploadUtils.getInstance().getChargingUploadCallback(getActivity(), showPoiEntity,chargingStationList));
Objects.requireNonNull(getActivity()).onBackPressed();//回退 Objects.requireNonNull(getActivity()).onBackPressed();//回退
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候..."); WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
WaitDialog.dismiss(3000); WaitDialog.dismiss(3000);

View File

@ -97,8 +97,9 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
if (Constant.LEVEL != 0) { if (Constant.LEVEL != 0) {
mainGrade.setText("LV."+Constant.LEVEL); mainGrade.setText("LV."+Constant.LEVEL);
} }
if (Constant.USHERED!=null){
initNetWork(); initNetWork();
}
} }
@Subscribe @Subscribe

View File

@ -551,7 +551,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.params(httpParams) .params(httpParams)
.cls(PoiUploadBean.class) .cls(PoiUploadBean.class)
.postFileAsynchronous(UploadUtils.getInstance().getOtherUploadCallback(getActivity(),showPoiEntity)); .postFileAsynchronous(UploadUtils.getInstance().getOtherUploadCallback(getActivity(),showPoiEntity,otherUploadList));
Objects.requireNonNull(getActivity()).onBackPressed();//回退 Objects.requireNonNull(getActivity()).onBackPressed();//回退
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候..."); WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
WaitDialog.dismiss(3000); WaitDialog.dismiss(3000);

View File

@ -42,6 +42,7 @@ import com.navinfo.outdoor.activity.FragmentManagement;
import com.navinfo.outdoor.activity.PhotographActivity; import com.navinfo.outdoor.activity.PhotographActivity;
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.util.AWMp4ParserHelper;
import com.navinfo.outdoor.util.UploadUtils; import com.navinfo.outdoor.util.UploadUtils;
import com.navinfo.outdoor.bean.GetPhoneBean; import com.navinfo.outdoor.bean.GetPhoneBean;
import com.navinfo.outdoor.bean.Info; import com.navinfo.outdoor.bean.Info;
@ -332,6 +333,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
return false; return false;
} }
}); });
rlCard.setOnLongClickListener(new View.OnLongClickListener() { rlCard.setOnLongClickListener(new View.OnLongClickListener() {
@Override @Override
public boolean onLongClick(View v) { public boolean onLongClick(View v) {
@ -803,7 +805,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.fileList(poiPicList) .fileList(poiPicList)
.params(httpParams) .params(httpParams)
.postFileAsynchronous(UploadUtils.getInstance().getPoiUploadCallback(getActivity(),showPoiEntity)); .postFileAsynchronous(UploadUtils.getInstance().getPoiUploadCallback(getActivity(),showPoiEntity,poiPicList));
Objects.requireNonNull(getActivity()).onBackPressed();//回退 Objects.requireNonNull(getActivity()).onBackPressed();//回退
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候..."); WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
WaitDialog.dismiss(3000); WaitDialog.dismiss(3000);

View File

@ -103,8 +103,10 @@ public class PoiTaskFragment extends BaseFragment implements View.OnClickListene
assert getArguments() != null; assert getArguments() != null;
type = getArguments().getInt("type", 0); type = getArguments().getInt("type", 0);
listBeans = new ArrayList<>(); listBeans = new ArrayList<>();
if (Constant.USHERED!=null){
initWork(type,true); initWork(type,true);
} }
}
private void initWork(int type, boolean aBoolean) { private void initWork(int type, boolean aBoolean) {
showLoadingDialog(); showLoadingDialog();

View File

@ -339,8 +339,10 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
@Override @Override
public void run() { public void run() {
ZipUtil.zipFiles(videoFileList, fileZip, null); ZipUtil.zipFiles(videoFileList, fileZip, null);
if (showPoiEntity.getId()==null){ if (showPoiEntity == null) {
if (showPoiEntity == null || showPoiEntity.getTaskStatus() == 1 || showPoiEntity.getTaskStatus() == 2 || showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 5) { showPoiEntity = new PoiEntity();
}
if (showPoiEntity.getTaskStatus() == 1 || showPoiEntity.getTaskStatus() == 2 || showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 5) {
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() { Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
@Override @Override
public void run() { 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(); }).start();
} else { } else {
@ -456,7 +437,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
.cls(OtherUploadPicBean.class) .cls(OtherUploadPicBean.class)
.params(httpParams) .params(httpParams)
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.postRequest(UploadUtils.getInstance().getPoiVideoUploadCallback(getActivity(),showPoiEntity)); .postRequest(UploadUtils.getInstance().getPoiVideoUploadCallback(getActivity(),showPoiEntity,fileZip));
Objects.requireNonNull(getActivity()).onBackPressed();//回退 Objects.requireNonNull(getActivity()).onBackPressed();//回退
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候..."); WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
WaitDialog.dismiss(3000); WaitDialog.dismiss(3000);
@ -577,7 +558,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
if (showPoiEntity != null) { if (showPoiEntity != null) {
if (showPoiEntity.getTaskStatus() == 5) { if (showPoiEntity.getTaskStatus() == 5) {
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);//结束领取 initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, showPoiEntity);//结束领取
} else { } else {
Message obtain = Message.obtain(); Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR; obtain.what = Constant.JOB_WORD_MONITOR;

View File

@ -194,7 +194,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
etRoadName.setText(name); etRoadName.setText(name);
} }
String geoWkt = showPoiEntity.getGeoWkt(); String geoWkt = showPoiEntity.getGeoWkt();
if (geoWkt!=null){ if (geoWkt != null) {
String geo = Geohash.getInstance().decode(geoWkt); String geo = Geohash.getInstance().decode(geoWkt);
Geometry geometry = GeometryTools.createGeometry(geo); Geometry geometry = GeometryTools.createGeometry(geo);
switch (geometry.getGeometryType()) { 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 = tencentMap.addMarker(new MarkerOptions(latLng).icon(roadDescriptor).anchor(0.5f, 1.0f));
markerRoad.setZIndex(4); markerRoad.setZIndex(4);
moveLatlng(latLng, null); moveLatlng(latLng, null);
}else { } else {
String x = showPoiEntity.getX(); String x = showPoiEntity.getX();
String y = showPoiEntity.getY(); String y = showPoiEntity.getY();
if (x != null && y != null) { if (x != null && y != null) {
@ -343,8 +343,10 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
@Override @Override
public void run() { public void run() {
ZipUtil.zipFiles(videoFileList, fileZip, null);//压缩 ZipUtil.zipFiles(videoFileList, fileZip, null);//压缩
if (showPoiEntity.getId()==null){ if (showPoiEntity == null) {
if (showPoiEntity == null || showPoiEntity.getTaskStatus() == 1 || showPoiEntity.getTaskStatus() == 2 || showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 5) { showPoiEntity = new PoiEntity();
}
if (showPoiEntity.getTaskStatus() == 1 || showPoiEntity.getTaskStatus() == 2 || showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 5) {
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() { Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
@Override @Override
public void run() { 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(); }).start();
} else { } else {
@ -462,7 +442,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
.params(httpParams) .params(httpParams)
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.cls(OtherUploadPicBean.class) .cls(OtherUploadPicBean.class)
.postRequest(UploadUtils.getInstance().getRoadUploadCallback(getActivity(), showPoiEntity)); .postRequest(UploadUtils.getInstance().getRoadUploadCallback(getActivity(), showPoiEntity, fileZip));
Objects.requireNonNull(getActivity()).onBackPressed();//回退 Objects.requireNonNull(getActivity()).onBackPressed();//回退
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候..."); WaitDialog.show((AppCompatActivity) getActivity(), "任务正在后台上传中,请稍候...");
WaitDialog.dismiss(3000); WaitDialog.dismiss(3000);

View File

@ -203,17 +203,18 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
} }
break; break;
case R.id.btn_stay_submit://提交 case R.id.btn_stay_submit://提交
if (Constant.isPresent) {
if (poiEntities == null) { if (poiEntities == null) {
poiEntities = new ArrayList<>(); poiEntities = new ArrayList<>();
} } else {
poiEntities.clear(); poiEntities.clear();
}
List<PoiEntity> allRoad = staySubmitAdapter.getAllRoad(); List<PoiEntity> allRoad = staySubmitAdapter.getAllRoad();
for (int i = 0; i < allRoad.size(); i++) { for (int i = 0; i < allRoad.size(); i++) {
if (allRoad.get(i).isChecked()) { if (allRoad.get(i).isChecked()) {
poiEntities.add(allRoad.get(i)); poiEntities.add(allRoad.get(i));
} }
} }
if (Constant.isPresent) {
if (poiEntities.size() > 0) { if (poiEntities.size() > 0) {
PoiSaveUtils.getInstance(getActivity()).uploadPoiEntityBatch(poiEntities); PoiSaveUtils.getInstance(getActivity()).uploadPoiEntityBatch(poiEntities);
Constant.isPresent = false; Constant.isPresent = false;
@ -279,6 +280,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
} }
} }
@Override @Override
public void onError(Throwable e, int id) { public void onError(Throwable e, int id) {
dismissLoadingDialog(); dismissLoadingDialog();

View File

@ -210,7 +210,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
EventBus.getDefault().post(msg); EventBus.getDefault().post(msg);
dismissLoadingDialog(); dismissLoadingDialog();
removableHashMap.clear(); removableHashMap.clear();
if (Constant.USHERED!=null){
initThread(); // 刷新筛选的本地数据 initThread(); // 刷新筛选的本地数据
}
if (Constant.currentLocation != null) { if (Constant.currentLocation != null) {
initList(Constant.currentLocation); // 刷新筛选的网络数据 initList(Constant.currentLocation); // 刷新筛选的网络数据
} else { } else {
@ -563,11 +565,14 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
.arrowTexture(bitmapLine); .arrowTexture(bitmapLine);
// 绘制折线 // 绘制折线
Polyline polyline = tencentMap.addPolyline(polylineOptions); Polyline polyline = tencentMap.addPolyline(polylineOptions);
if (polyline!=null){
polyline.setZIndex(MARKER_LINE); polyline.setZIndex(MARKER_LINE);
removables.add(polyline); removables.add(polyline);
if (latLineString != null && latLineString.size() > 0) { if (latLineString != null && latLineString.size() > 0) {
latLng = latLineString.get(0); latLng = latLineString.get(0);
} }
}
break; break;
case "Point": // case "Point": //
latLng = GeometryTools.createLatLng(geo); latLng = GeometryTools.createLatLng(geo);
@ -583,6 +588,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
strokeColor(0xff000000). strokeColor(0xff000000).
//边线宽度15像素 //边线宽度15像素
strokeWidth(5)); strokeWidth(5));
if (polygon!=null){
polygon.setZIndex(MARKER_FACE); polygon.setZIndex(MARKER_FACE);
removables.add(polygon); removables.add(polygon);
com.vividsolutions.jts.geom.Point centroid = geometry.getCentroid(); com.vividsolutions.jts.geom.Point centroid = geometry.getCentroid();
@ -591,6 +597,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
latLng = new LatLng(); latLng = new LatLng();
latLng.setLatitude(y); latLng.setLatitude(y);
latLng.setLongitude(x); latLng.setLongitude(x);
}
break; break;
} }
switch (list.get(i).getType()) { switch (list.get(i).getType()) {
@ -762,11 +769,14 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
.arrowTexture(bitmapLine); .arrowTexture(bitmapLine);
// 绘制折线 // 绘制折线
Polyline polyline = tencentMap.addPolyline(polylineOptions); Polyline polyline = tencentMap.addPolyline(polylineOptions);
if (polyline!=null){
polyline.setZIndex(MARKER_LINE); polyline.setZIndex(MARKER_LINE);
removableScreenMarker.add(polyline); removableScreenMarker.add(polyline);
if (latLineString != null && latLineString.size() > 0) { if (latLineString != null && latLineString.size() > 0) {
latLng = latLineString.get(0); latLng = latLineString.get(0);
} }
}
break; break;
case "Polygon": // case "Polygon": //
List<LatLng> latPolygon = GeometryTools.getLatLags(geo); List<LatLng> latPolygon = GeometryTools.getLatLags(geo);
@ -779,7 +789,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
strokeColor(0xff000000). strokeColor(0xff000000).
//边线宽度15像素 //边线宽度15像素
strokeWidth(25)); strokeWidth(25));
if (polygon!=null){
polygon.setZIndex(MARKER_FACE); polygon.setZIndex(MARKER_FACE);
removableScreenMarker.add(polygon); removableScreenMarker.add(polygon);
com.vividsolutions.jts.geom.Point centroid = geometry.getCentroid(); com.vividsolutions.jts.geom.Point centroid = geometry.getCentroid();
@ -788,6 +798,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
latLng = new LatLng(); latLng = new LatLng();
latLng.setLatitude(y); latLng.setLatitude(y);
latLng.setLongitude(x); latLng.setLongitude(x);
}
break; break;
} }
BitmapDescriptor descriptor = null; BitmapDescriptor descriptor = null;
@ -893,11 +905,14 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
.arrowTexture(bitmapLine); .arrowTexture(bitmapLine);
// 绘制折线 // 绘制折线
Polyline polyline = tencentMap.addPolyline(polylineOptions); Polyline polyline = tencentMap.addPolyline(polylineOptions);
if (polyline!=null){
polyline.setZIndex(MARKER_LINE); polyline.setZIndex(MARKER_LINE);
removablesLocality.add(polyline); removablesLocality.add(polyline);
if (latLineString != null && latLineString.size() > 0) { if (latLineString != null && latLineString.size() > 0) {
latLng = latLineString.get(0); latLng = latLineString.get(0);
} }
}
break; break;
case "Polygon": // case "Polygon": //
List<LatLng> latPolygon = GeometryTools.getLatLags(geo); List<LatLng> latPolygon = GeometryTools.getLatLags(geo);
@ -906,6 +921,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
fillColor(Color.parseColor("#97E0E7EC")).//边线颜色为黑色 fillColor(Color.parseColor("#97E0E7EC")).//边线颜色为黑色
strokeColor(0xff00ff00).//边线宽度15像素 strokeColor(0xff00ff00).//边线宽度15像素
strokeWidth(5)); strokeWidth(5));
if (polygon!=null){
polygon.setZIndex(MARKER_FACE); polygon.setZIndex(MARKER_FACE);
removablesLocality.add(polygon); removablesLocality.add(polygon);
Point centroid = geometry.getCentroid(); Point centroid = geometry.getCentroid();
@ -914,6 +930,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
latLng = new LatLng(); latLng = new LatLng();
latLng.setLatitude(y); latLng.setLatitude(y);
latLng.setLongitude(x); latLng.setLongitude(x);
}
/*if (latPolygon != null && latPolygon.size() > 0) { /*if (latPolygon != null && latPolygon.size() > 0) {
latLng = latPolygon.get(0); latLng = latPolygon.get(0);
}*/ }*/
@ -1122,7 +1140,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
}); });
break; break;
case 5: case 5:
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "你其他页面还有未提交完的数据", "确定").setOkButton(new OnDialogButtonClickListener() { MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "你其他页面还有未提交完的数据", "确定").setOkButton(new OnDialogButtonClickListener() {
@Override @Override
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
@ -1133,7 +1150,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
initRemovePoiSharePre(); initRemovePoiSharePre();
return false; return false;
} }
}); }).setStyle(DialogSettings.STYLE.STYLE_KONGZUE);
break; break;
} }
} }

View File

@ -3,7 +3,7 @@ package com.navinfo.outdoor.http;
import com.navinfo.outdoor.api.Constant; import com.navinfo.outdoor.api.Constant;
public class HttpInterface { 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 IP = "http://dtxbmaps.navinfo.com/dtxb_test/m4";//测试接口
public static final String USER_PATH ="/user/";//我的 public static final String USER_PATH ="/user/";//我的

View File

@ -91,12 +91,14 @@ public class PoiSaveUtils {
Message obtain = Message.obtain(); Message obtain = Message.obtain();
obtain.what = Constant.EVENT_STAY_REFRESH; obtain.what = Constant.EVENT_STAY_REFRESH;
EventBus.getDefault().post(obtain); EventBus.getDefault().post(obtain);
if (anInt+bInt>0){
Message obtain1 = Message.obtain(); Message obtain1 = Message.obtain();
obtain1.what = Constant.NEST_WORD_SUBMIT; obtain1.what = Constant.NEST_WORD_SUBMIT;
obtain1.obj = "批量提交 成功:" + anInt + ", 失败:" + bInt; obtain1.obj = "批量提交 成功:" + anInt + ", 失败:" + bInt;
EventBus.getDefault().post(obtain1); EventBus.getDefault().post(obtain1);
} }
}
}); });
} }
@ -307,6 +309,9 @@ public class PoiSaveUtils {
OtherUploadPicBean otherUploadPicBean = gson.fromJson(bodyStr, OtherUploadPicBean.class); OtherUploadPicBean otherUploadPicBean = gson.fromJson(bodyStr, OtherUploadPicBean.class);
if (otherUploadPicBean.getCode() == 200) { if (otherUploadPicBean.getCode() == 200) {
PoiDatabase.getInstance(mContext).getPoiDao().deletePoiEntity(poiEntity); PoiDatabase.getInstance(mContext).getPoiDao().deletePoiEntity(poiEntity);
for (int i = 0; i < photoFile.size(); i++) {
photoFile.get(i).delete();
}
Log.d("TAGss", "uploadPoiNet: 成功" + anInt); Log.d("TAGss", "uploadPoiNet: 成功" + anInt);
anInt++; anInt++;
return; return;
@ -386,7 +391,6 @@ public class PoiSaveUtils {
hashMap.put("sign_exist", chargingPileEntity.getSign_exist()); hashMap.put("sign_exist", chargingPileEntity.getSign_exist());
httpParams.put("detail", String.valueOf(hashMap)); httpParams.put("detail", String.valueOf(hashMap));
try { try {
Response execute = OkGoBuilder.getInstance() Response execute = OkGoBuilder.getInstance()
.Builder(mContext) .Builder(mContext)
.url(HttpInterface.SUBMIT_CSTASK) .url(HttpInterface.SUBMIT_CSTASK)
@ -454,7 +458,6 @@ public class PoiSaveUtils {
Toast.makeText(mContext, "没有保存本地", Toast.LENGTH_SHORT).show(); Toast.makeText(mContext, "没有保存本地", Toast.LENGTH_SHORT).show();
} }
}); });
return -1; return -1;
} }
@ -490,6 +493,9 @@ public class PoiSaveUtils {
if (uploadBeanResult.getCode() == 200) { if (uploadBeanResult.getCode() == 200) {
Log.d("TAGss", "chargingPileUploadNetWork" + 200); Log.d("TAGss", "chargingPileUploadNetWork" + 200);
PoiDatabase.getInstance(mContext).getChargingPileDao().deleteChargingPileEntity(chargingPileEntity); PoiDatabase.getInstance(mContext).getChargingPileDao().deleteChargingPileEntity(chargingPileEntity);
for (int i = 0; i < chargingPileFileList.size(); i++) {
chargingPileFileList.get(i).delete();
}
} }
} }
} catch (IOException e) { } catch (IOException e) {

View File

@ -14,6 +14,9 @@ import com.navinfo.outdoor.room.PoiEntity;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects; import java.util.Objects;
public class UploadUtils { public class UploadUtils {
@ -30,9 +33,10 @@ public class UploadUtils {
* 道路 * 道路
* @param mContext * @param mContext
* @param showPoiEntity * @param showPoiEntity
* @param fileZip
* @return * @return
*/ */
public Callback getRoadUploadCallback(Activity mContext, PoiEntity showPoiEntity) { public Callback getRoadUploadCallback(Activity mContext, PoiEntity showPoiEntity, File fileZip) {
PoiDao poiDao = PoiDatabase.getInstance(mContext).getPoiDao(); PoiDao poiDao = PoiDatabase.getInstance(mContext).getPoiDao();
return new Callback<OtherUploadPicBean>() { return new Callback<OtherUploadPicBean>() {
@Override @Override
@ -47,6 +51,11 @@ public class UploadUtils {
public void run() { public void run() {
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId()); PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
poiDao.deletePoiEntity(poiDaoPoiEntity); 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() { Objects.requireNonNull(mContext).runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -80,9 +89,10 @@ public class UploadUtils {
* poi * poi
* @param mContext * @param mContext
* @param showPoiEntity * @param showPoiEntity
* @param poiPicList
* @return * @return
*/ */
public Callback getPoiUploadCallback(Activity mContext, PoiEntity showPoiEntity) { public Callback getPoiUploadCallback(Activity mContext, PoiEntity showPoiEntity, ArrayList<File> poiPicList) {
PoiDao poiDao = PoiDatabase.getInstance(mContext).getPoiDao(); PoiDao poiDao = PoiDatabase.getInstance(mContext).getPoiDao();
return new Callback<OtherUploadPicBean>() { return new Callback<OtherUploadPicBean>() {
@Override @Override
@ -97,6 +107,9 @@ public class UploadUtils {
public void run() { public void run() {
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId()); PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
poiDao.deletePoiEntity(poiDaoPoiEntity); poiDao.deletePoiEntity(poiDaoPoiEntity);
for (int i = 0; i < poiPicList.size(); i++) {
poiPicList.get(i).delete();
}
Objects.requireNonNull(mContext).runOnUiThread(new Runnable() { Objects.requireNonNull(mContext).runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -131,9 +144,10 @@ public class UploadUtils {
* poiVideo * poiVideo
* @param mContext * @param mContext
* @param showPoiEntity * @param showPoiEntity
* @param fileZip
* @return * @return
*/ */
public Callback getPoiVideoUploadCallback(Activity mContext, PoiEntity showPoiEntity) { public Callback getPoiVideoUploadCallback(Activity mContext, PoiEntity showPoiEntity, File fileZip) {
PoiDao poiDao = PoiDatabase.getInstance(mContext).getPoiDao(); PoiDao poiDao = PoiDatabase.getInstance(mContext).getPoiDao();
return new Callback<OtherUploadPicBean>() { return new Callback<OtherUploadPicBean>() {
@Override @Override
@ -148,6 +162,11 @@ public class UploadUtils {
public void run() { public void run() {
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId()); PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
poiDao.deletePoiEntity(poiDaoPoiEntity); 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() { Objects.requireNonNull(mContext).runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -182,9 +201,10 @@ public class UploadUtils {
* other * other
* @param mContext * @param mContext
* @param showPoiEntity * @param showPoiEntity
* @param otherUploadList
* @return * @return
*/ */
public Callback getOtherUploadCallback(Activity mContext, PoiEntity showPoiEntity) { public Callback getOtherUploadCallback(Activity mContext, PoiEntity showPoiEntity, List<File> otherUploadList) {
PoiDao poiDao = PoiDatabase.getInstance(mContext).getPoiDao(); PoiDao poiDao = PoiDatabase.getInstance(mContext).getPoiDao();
return new Callback<PoiUploadBean>() { return new Callback<PoiUploadBean>() {
@Override @Override
@ -199,6 +219,9 @@ public class UploadUtils {
public void run() { public void run() {
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId()); PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
poiDao.deletePoiEntity(poiDaoPoiEntity); poiDao.deletePoiEntity(poiDaoPoiEntity);
for (int i = 0; i < otherUploadList.size(); i++) {
otherUploadList.get(i).delete();
}
Objects.requireNonNull(mContext).runOnUiThread(new Runnable() { Objects.requireNonNull(mContext).runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -234,9 +257,10 @@ public class UploadUtils {
* charging * charging
* @param mContext * @param mContext
* @param showPoiEntity * @param showPoiEntity
* @param chargingStationList
* @return * @return
*/ */
public Callback getChargingUploadCallback(Activity mContext, PoiEntity showPoiEntity) { public Callback getChargingUploadCallback(Activity mContext, PoiEntity showPoiEntity, ArrayList<File> chargingStationList) {
PoiDao poiDao = PoiDatabase.getInstance(mContext).getPoiDao(); PoiDao poiDao = PoiDatabase.getInstance(mContext).getPoiDao();
return new Callback<PoiUploadBean>() { return new Callback<PoiUploadBean>() {
@Override @Override
@ -249,7 +273,11 @@ public class UploadUtils {
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { 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() { mContext.runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {

View File

@ -114,13 +114,9 @@
/> />
<ImageView <ImageView
android:id="@+id/iv_road_picture" android:id="@+id/iv_road_picture"
android:layout_width="wrap_content" android:layout_width="200dp"
android:layout_height="wrap_content" android:layout_height="100dp"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:maxWidth="200dp"
android:maxHeight="100dp"
android:minWidth="140dp"
android:minHeight="70dp"
android:scaleType="fitXY" /> android:scaleType="fitXY" />
</FrameLayout> </FrameLayout>

View File

@ -127,13 +127,9 @@
android:layout_marginStart="10dp"/> android:layout_marginStart="10dp"/>
<ImageView <ImageView
android:id="@+id/iv_poi_video_picture" android:id="@+id/iv_poi_video_picture"
android:layout_width="wrap_content" android:layout_width="200dp"
android:layout_height="wrap_content" android:layout_height="100dp"
android:layout_marginTop="25dp" android:layout_marginTop="25dp"
android:maxWidth="200dp"
android:maxHeight="100dp"
android:minWidth="140dp"
android:minHeight="70dp"
android:scaleType="fitXY" /> android:scaleType="fitXY" />
</FrameLayout> </FrameLayout>