修改bug,添加保存本地刪除功能

This commit is contained in:
wangdongsheng 2021-09-28 18:47:29 +08:00
parent 327da2a8d0
commit f241b5e877
13 changed files with 322 additions and 276 deletions

View File

@ -194,7 +194,6 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
initGetUserInfo();//获取用户信息 initGetUserInfo();//获取用户信息
} else { } else {
Toast.makeText(LoginActivity.this, response.getMessage(), Toast.LENGTH_SHORT).show(); Toast.makeText(LoginActivity.this, response.getMessage(), Toast.LENGTH_SHORT).show();
dismissLoadingDialog();
} }
} }
@Override @Override

View File

@ -122,7 +122,6 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
private CheckBox cbMapType; private CheckBox cbMapType;
private boolean isMapSlide = false; private boolean isMapSlide = false;
private int pageNum = 0; private int pageNum = 0;
private Handler handler = new Handler(new Handler.Callback() { private Handler handler = new Handler(new Handler.Callback() {
@Override @Override
public boolean handleMessage(@NonNull Message msg) { public boolean handleMessage(@NonNull Message msg) {
@ -147,21 +146,20 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
protected void initView() { protected void initView() {
super.initView(); super.initView();
if (getIntent() != null) { if (getIntent() != null) {
finalVideoPath = getIntent().getStringExtra(Constant.INTENT_VIDEO_PATH); finalVideoPath = getIntent().getStringExtra(Constant.INTENT_VIDEO_PATH);
poiEntity = (PoiEntity) getIntent().getSerializableExtra("poiEntity"); poiEntity = (PoiEntity) getIntent().getSerializableExtra("poiEntity");
oration = getIntent().getIntExtra(Constant.INTENT_VIDEO_OBLATION, -1); oration = getIntent().getIntExtra(Constant.INTENT_VIDEO_OBLATION, -1);
} }
videoChronometer = findViewById(R.id.video_chronometer); videoChronometer = findViewById(R.id.video_chronometer);
// if (finalVideoPath == null) { // if (finalVideoPath == null) {
//// finalVideoPath = Constant.PICTURE_FOLDER+"/final.mp4"; // finalVideoPath = Constant.PICTURE_FOLDER+"/final.mp4";
//// } // }
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
ivZoomAdd = findViewById(R.id.iv_zoom_add); ivZoomAdd = findViewById(R.id.iv_zoom_add);
ivZoomAdd.setOnClickListener(this); ivZoomAdd.setOnClickListener(this);
ivZoomDel = findViewById(R.id.iv_zoom_del); ivZoomDel = findViewById(R.id.iv_zoom_del);
ivZoomDel.setOnClickListener(this); ivZoomDel.setOnClickListener(this);
/* cbMapType = findViewById(R.id.cb_map_type); /* cbMapType = findViewById(R.id.cb_map_type);
cbMapType.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { cbMapType.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
@ -175,8 +173,8 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
ivMap = (TextureMapView) findViewById(R.id.iv_map); ivMap = (TextureMapView) findViewById(R.id.iv_map);
btnSwitch = (Button) findViewById(R.id.btn_switch); btnSwitch = (Button) findViewById(R.id.btn_switch);
btnSwitch.setOnClickListener(this); btnSwitch.setOnClickListener(this);
// capturePicture = (ImageButton) findViewById(R.id.capturePicture); // capturePicture = (ImageButton) findViewById(R.id.capturePicture);
// capturePicture.setOnClickListener(this::onClick); // capturePicture.setOnClickListener(this::onClick);
ivPic = findViewById(R.id.iv_pic); ivPic = findViewById(R.id.iv_pic);
//相机记录器 //相机记录器
CameraLogger.setLogLevel(CameraLogger.LEVEL_VERBOSE); CameraLogger.setLogLevel(CameraLogger.LEVEL_VERBOSE);
@ -196,12 +194,12 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
} }
captureVideo.setText("暂停采集"); captureVideo.setText("暂停采集");
// stopVideo.setEnabled(false);// 开始采集视频后禁用停止采集的按钮必须暂停采集后才可点击停止采集 // stopVideo.setEnabled(false);// 开始采集视频后禁用停止采集的按钮必须暂停采集后才可点击停止采集
startTakenVideo(); // 开始采集视频 startTakenVideo(); // 开始采集视频
} else { } else {
stopTakenVideo(); stopTakenVideo();
captureVideo.setText("开始采集"); captureVideo.setText("开始采集");
// stopVideoAndFinish(); // stopVideoAndFinish();
} }
} }
}); });
@ -226,9 +224,8 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
uiSettings.setRotateGesturesEnabled(false);//禁止地图旋转手势. uiSettings.setRotateGesturesEnabled(false);//禁止地图旋转手势.
uiSettings.setTiltGesturesEnabled(false);//禁止倾斜手势. uiSettings.setTiltGesturesEnabled(false);//禁止倾斜手势.
// uiSettings.setAllGesturesEnabled(false); // uiSettings.setAllGesturesEnabled(false);
setLocMarkerStyle(LOCATION_TYPE_LOCATION_ROTATE); setLocMarkerStyle(LOCATION_TYPE_LOCATION_ROTATE);
initLine(); initLine();
// camera.addFrameProcessor(new FrameProcessor() { // camera.addFrameProcessor(new FrameProcessor() {
// @Override // @Override
@ -258,12 +255,12 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
@Override @Override
public void onCameraOpened(@NonNull @NotNull CameraOptions options) { public void onCameraOpened(@NonNull @NotNull CameraOptions options) {
super.onCameraOpened(options); super.onCameraOpened(options);
// List<Size> sizeList = (List<Size>) options.getSupportedVideoSizes(); // List<Size> sizeList = (List<Size>) options.getSupportedVideoSizes();
// //
// Size size = null; // Size size = null;
// SizeSelector maxWidthSizeSelector = SizeSelectors.maxWidth(size.getWidth()); // SizeSelector maxWidthSizeSelector = SizeSelectors.maxWidth(size.getWidth());
// SizeSelector maxHeightSizeSelector = SizeSelectors.maxHeight(size.getHeight()); // SizeSelector maxHeightSizeSelector = SizeSelectors.maxHeight(size.getHeight());
// camera.setVideoSize(SizeSelectors.and(maxHeightSizeSelector, maxWidthSizeSelector)); // camera.setVideoSize(SizeSelectors.and(maxHeightSizeSelector, maxWidthSizeSelector));
Collection<Size> supportedPictureSizes = options.getSupportedPictureSizes(); Collection<Size> supportedPictureSizes = options.getSupportedPictureSizes();
camera.setVideoBitRate(2000000); camera.setVideoBitRate(2000000);
} }
@ -407,7 +404,6 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.road_arrows); bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.road_arrows);
} }
List<LatLng> latLineString = GeometryTools.getLatLags(geo); List<LatLng> latLineString = GeometryTools.getLatLags(geo);
// 构造 PolylineOnions // 构造 PolylineOnions
PolylineOptions polylineOptions PolylineOptions polylineOptions
= new PolylineOptions().addAll(latLineString) = new PolylineOptions().addAll(latLineString)
@ -462,9 +458,9 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
handler.sendEmptyMessageDelayed(0, 2000); // 利用handler延迟发送更改状态信息 handler.sendEmptyMessageDelayed(0, 2000); // 利用handler延迟发送更改状态信息
benSwitch(); benSwitch();
break; break;
// case R.id.capuletVideo: // case R.id.capuletVideo:
// startTakenVideo(); // 开始拍摄视频 // startTakenVideo(); // 开始拍摄视频
// break; // break;
case R.id.btn_stop_video: case R.id.btn_stop_video:
stopVideoAndFinish(); stopVideoAndFinish();
break; break;
@ -528,7 +524,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
// Calendar calendar = Calendar.getInstance(); // Calendar calendar = Calendar.getInstance();
// calendar.setTimeInMillis(System.currentTimeMillis()); // calendar.setTimeInMillis(System.currentTimeMillis());
// String formatVideoName = formatter.format(calendar.getTime()); // String formatVideoName = formatter.format(calendar.getTime());
//文件 // 文件
// String path = finalVideoPath.substring(finalVideoPath.length()-20); // String path = finalVideoPath.substring(finalVideoPath.length()-20);
if (finalVideoPath != null) { if (finalVideoPath != null) {
File file = new File(finalVideoPath); File file = new File(finalVideoPath);

View File

@ -90,9 +90,9 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
private Polyline polyline; private Polyline polyline;
private String finalVideoPath; // 摄像后最终保存的文件名 private String finalVideoPath; // 摄像后最终保存的文件名
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 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;
@ -120,10 +120,10 @@ 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=0; private int oration = 0;
private ImageView ivPicImage; private ImageView ivPicImage, ivPicVideoImage;
private SystemTTS systemTTS; private SystemTTS systemTTS;
private boolean isBack=false ; private boolean isBack = false;
@Override @Override
protected int getLayout() { protected int getLayout() {
@ -142,7 +142,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
poi_video_type = getIntent().getIntExtra(Constant.INTENT_POI_VIDEO_TYPE, -1); poi_video_type = getIntent().getIntExtra(Constant.INTENT_POI_VIDEO_TYPE, -1);
oration = getIntent().getIntExtra(Constant.INTENT_VIDEO_OBLATION, -1); oration = getIntent().getIntExtra(Constant.INTENT_VIDEO_OBLATION, -1);
finalVideoPath = getIntent().getStringExtra(Constant.INTENT_JPG_PATH); finalVideoPath = getIntent().getStringExtra(Constant.INTENT_JPG_PATH);
if (finalVideoPath!=null){ if (finalVideoPath != null) {
File file = new File(finalVideoPath); File file = new File(finalVideoPath);
paperFile = new File(Objects.requireNonNull(file.getParentFile()).getAbsoluteFile() + "/" + "paper.txt"); paperFile = new File(Objects.requireNonNull(file.getParentFile()).getAbsoluteFile() + "/" + "paper.txt");
} }
@ -153,10 +153,14 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
ivMap = findViewById(R.id.iv_map); ivMap = findViewById(R.id.iv_map);
ivMap.setOnClickListener(this); ivMap.setOnClickListener(this);
ivPicImage = findViewById(R.id.iv_pic); ivPicImage = findViewById(R.id.iv_pic);
ivPicVideoImage = findViewById(R.id.iv_pic_video);
if (poi_video_type == 1 || poi_video_type == 2) { if (poi_video_type == 1 || poi_video_type == 2) {
ivPicImage.setImageResource(R.mipmap.take_poi_video_arrow); ivPicVideoImage.setVisibility(View.VISIBLE);
ivPicImage.setVisibility(View.GONE);
} else if (poi_video_type == 3) { } else if (poi_video_type == 3) {
ivPicImage.setImageResource(R.mipmap.take_pic_arrow); ivPicImage.setVisibility(View.VISIBLE);
ivPicVideoImage.setVisibility(View.GONE);
} }
btnSwitch = findViewById(R.id.btn_switch); btnSwitch = findViewById(R.id.btn_switch);
btnSwitch.setOnClickListener(this); btnSwitch.setOnClickListener(this);
@ -182,14 +186,16 @@ 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; isOration = true;
if (poi_video_type != 2) { if (poi_video_type != 2) {
capturePicture.setText("暂停采集"); } capturePicture.setText("暂停采集");
}
startTimer(); startTimer();
} else { } else {
isOration=false; isOration = false;
if (poi_video_type != 2) { if (poi_video_type != 2) {
capturePicture.setText("开始采集"); } capturePicture.setText("开始采集");
}
stopTimer(); stopTimer();
} }
} }
@ -228,7 +234,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 (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();
@ -238,8 +244,8 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
capturePicture.setChecked(false); capturePicture.setChecked(false);
} }
return; return;
}else { } else {
isOration=false; isOration = false;
} }
} }
@ -321,7 +327,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
public void onClick(View v) { public void onClick(View v) {
switch (v.getId()) { switch (v.getId()) {
case R.id.btn_stop_picture: case R.id.btn_stop_picture:
if (isOration){ if (isOration) {
stopTimer(); stopTimer();
} }
Intent intent = new Intent(); Intent intent = new Intent();
@ -351,11 +357,12 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
if (Constant.currentLocation != null) { if (Constant.currentLocation != null) {
CameraUpdate cameraSigma = CameraUpdateFactory CameraUpdate cameraSigma = CameraUpdateFactory
.newCameraPosition(new CameraPosition(new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude()), //中心点坐标地图目标经纬度 .newCameraPosition(new CameraPosition(new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude()), //中心点坐标地图目标经纬度
tencentMap.getCameraPosition().zoom, //目标缩放级别 tencentMap.getCameraPosition().zoom, //目标缩放级别
0, //目标倾斜角[0.0 ~ 45.0] (垂直地图时为0) 0, //目标倾斜角[0.0 ~ 45.0] (垂直地图时为0)
0)); //目标旋转角 0~360° (正北方为0) 0)); //目标旋转角 0~360° (正北方为0)
tencentMap.animateCamera(cameraSigma); tencentMap.animateCamera(cameraSigma);
} }
break; break;
} }
@ -411,7 +418,13 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
layerChange.addView(camera); layerChange.addView(camera);
layerChange.addView(ivMap); layerChange.addView(ivMap);
initMapBig(); initMapBig();
ivPicImage.setVisibility(View.VISIBLE); if (poi_video_type == 1 || poi_video_type == 2) {
ivPicVideoImage.setVisibility(View.VISIBLE);
ivPicImage.setVisibility(View.GONE);
} else if (poi_video_type == 3) {
ivPicImage.setVisibility(View.VISIBLE);
ivPicVideoImage.setVisibility(View.GONE);
}
} else { } else {
layoutParamsMap.height = heightCamera; layoutParamsMap.height = heightCamera;
layoutParamsMap.width = widthCamera; layoutParamsMap.width = widthCamera;
@ -423,8 +436,10 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
layerChange.addView(camera); layerChange.addView(camera);
initMapShort(); initMapShort();
ivPicImage.setVisibility(View.GONE); ivPicImage.setVisibility(View.GONE);
ivPicVideoImage.setVisibility(View.GONE);
} }
} }
//小图 //小图
private void initMapBig() { private void initMapBig() {
isMapSlide = false; isMapSlide = false;
@ -433,6 +448,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
ivLocation.setVisibility(View.GONE); ivLocation.setVisibility(View.GONE);
setLocMarkerStyle(LOCATION_TYPE_LOCATION_ROTATE); setLocMarkerStyle(LOCATION_TYPE_LOCATION_ROTATE);
} }
//大图 //大图
private void initMapShort() { private void initMapShort() {
isMapSlide = true; isMapSlide = true;
@ -526,7 +542,8 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
} }
sb.append("\r\n"); sb.append("\r\n");
FileUtils.writeFile(paperFile.getAbsolutePath(), sb.toString(), true); FileUtils.writeFile(paperFile.getAbsolutePath(), sb.toString(), true);
float speed = Constant.currentLocation.getSpeed();///
/*float speed = Constant.currentLocation.getSpeed();///
if (speed != 0) { if (speed != 0) {
float a = (speed * 3600 / 1000);//km/h float a = (speed * 3600 / 1000);//km/h
if (poi_video_type == 1) { if (poi_video_type == 1) {
@ -556,23 +573,25 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
} }
} }
oldCurrentLocation = Constant.currentLocation; oldCurrentLocation = Constant.currentLocation;
} }*/
} }
@Override @Override
public void onBackPressed() { public void onBackPressed() {
if (!isBack) { if (!isBack) {
if (isOration){ if (isOration) {
stopTimer(); stopTimer();
} }
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
MessageDialog.show(this, "提示", "当前路段已拍摄的自动保存,可以在选择继续拍摄", "确定").setOnOkButtonClickListener(new OnDialogButtonClickListener() { MessageDialog.show(this, "提示", "当前路段已拍摄的自动保存,可以在选择继续拍摄", "确定").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
@Override @Override
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
isBack=true; isBack = true;
finish(); finish();
return false; return false;
} }
}).setStyle(DialogSettings.STYLE.STYLE_MIUI); });
} else { } else {
this.finish(); this.finish();
} }
@ -584,10 +603,10 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
.fromResource(R.drawable.circle); .fromResource(R.drawable.circle);
Marker marker = tencentMap Marker marker = tencentMap
.addMarker(new MarkerOptions(latLng) .addMarker(new MarkerOptions(latLng)
.icon(pileDescriptor) .icon(pileDescriptor)
.alpha(0.9f) .alpha(0.9f)
.flat(true) .flat(true)
.clockwise(false)); .clockwise(false));
removables.add(marker); removables.add(marker);
} }

View File

@ -19,35 +19,42 @@ import java.io.File;
* 常量 * 常量
*/ */
public class Constant { public class Constant {
/** /*当前网络不可用
* 当前网络不可用
*/ */
public static final CharSequence NETWORK_UNAVAILABLE = "当前网络不可用,请检查网络设置"; public static final CharSequence NETWORK_UNAVAILABLE = "当前网络不可用,请检查网络设置";
/* /*位置权限
* 位置权限
*/ */
public static final String SET_LOCATION_PERMISSION = "请在“设置”中给予“TengXunMap”位置权限,否则当前功能将不可使用"; public static final String SET_LOCATION_PERMISSION = "请在“设置”中给予“TengXunMap”位置权限,否则当前功能将不可使用";
public static final String SET_LOCATION = "请在“设置”中给予权限否则当前功能将不可使用"; public static final String SET_LOCATION = "请在“设置”中给予权限否则当前功能将不可使用";
public static final String GET_ERR_MESSAGE1 = "设备缺少使用腾讯定位服务需要的基本条件"; public static final String GET_ERR_MESSAGE1 = "设备缺少使用腾讯定位服务需要的基本条件";
public static final String GET_ERR_MESSAGE2 = "manifest 中配置的 key 不正确"; public static final String GET_ERR_MESSAGE2 = "manifest 中配置的 key 不正确";
public static final String GET_ERR_MESSAGE3 = "自动加载libtencentloc.so失败"; public static final String GET_ERR_MESSAGE3 = "自动加载libtencentloc.so失败";
public static final String ROOT_FOLDER = SdkFolderCreate.getSDPath() + "/navinfoOutDoor"; public static final String ROOT_FOLDER = SdkFolderCreate.getSDPath() + "/navinfoOutDoor";
public static final String INTENT_POI_ROAD = "poi_road"; public static final String INTENT_POI_ROAD = "poi_road";
public static String BASE_FOLDER = ROOT_FOLDER; public static String BASE_FOLDER = ROOT_FOLDER;
// 保存图片的目录 // 保存图片的目录
public static String PICTURE_FOLDER; public static String PICTURE_FOLDER;
public static String VIDEOS_; public static String VIDEOS_;
public static String POI_DAO; public static String POI_DAO;
public static String SHARED_PREFERENCES = "navInfo"; public static String SHARED_PREFERENCES = "navInfo";
public static String MESSAGE_TYPE="messageType"; public static String MESSAGE_TYPE="messageType";
public static String DATA_FILE = "dataFile"; public static String DATA_FILE = "dataFile";
//下载文件 //下载文件
public static final String NABISCO_APk = ROOT_FOLDER + "/apk/"; public static final String NABISCO_APk = ROOT_FOLDER + "/apk/";
public static int TelLength=0; public static int TelLength=0;
public static void initRootFolder(String userId) { public static void initRootFolder(String userId) {
@ -61,7 +68,6 @@ public class Constant {
if (!baseFolder.exists()) { if (!baseFolder.exists()) {
SdkFolderCreate.mkdirs(baseFolder.getAbsolutePath()); SdkFolderCreate.mkdirs(baseFolder.getAbsolutePath());
} }
File picFolder = new File(PICTURE_FOLDER); // 视频照片文件夹路径 File picFolder = new File(PICTURE_FOLDER); // 视频照片文件夹路径
if (!picFolder.exists()) { if (!picFolder.exists()) {
SdkFolderCreate.mkdirs(picFolder.getAbsolutePath()); SdkFolderCreate.mkdirs(picFolder.getAbsolutePath());
@ -140,11 +146,11 @@ public class Constant {
public static final int PILE_MARKER_SHOW = 33;//刷新充电桩的显示 public static final int PILE_MARKER_SHOW = 33;//刷新充电桩的显示
public static final int JOB_WORD_MONITOR = 34;//寻宝界面和删选的刷新 public static final int JOB_WORD_MONITOR = 34;//寻宝界面和删选的刷新
public static final int EVENT_WHAT_LOCATION_CHANGE = 35; // 定位位置更新的Event的What值 public static final int EVENT_WHAT_LOCATION_CHANGE = 35; // 定位位置更新的Event的What值
// public static final int CHARGING_PILE_BODY = 36;//充电装的body // public static final int CHARGING_PILE_BODY = 36;//充电装的body
// public static final int CHARGING_PILE_PHOTO = 37;//充电桩的照片 // public static final int CHARGING_PILE_PHOTO = 37;//充电桩的照片
public static final int Filter_WhAT_RECYCLER = 39;//刪選適配器的刷新 public static final int Filter_WhAT_RECYCLER = 39;//刪選適配器的刷新
public static final int EVENT_WHAT_CURRENT_MARKER = 41; // 显示当前正在编辑的POI类型数据的Event的What值 public static final int EVENT_WHAT_CURRENT_MARKER = 41; // 显示当前正在编辑的POI类型数据的Event的What值
//CompleteTask // CompleteTask
public static final int EVENT_WHAT_COMPLETE_TASK = 42; // 点击记录跳转开始采集 public static final int EVENT_WHAT_COMPLETE_TASK = 42; // 点击记录跳转开始采集
public static final int EVENT_STAY_REFRESH = 44; // 刷新记录页面 public static final int EVENT_STAY_REFRESH = 44; // 刷新记录页面
public static final int EVENT_WORK_HOME = 45; //切换到寻宝 public static final int EVENT_WORK_HOME = 45; //切换到寻宝
@ -154,7 +160,6 @@ public class Constant {
public static final int PHOTO_FINISH_VIDEO = 49;//拍照列表的返回 public static final int PHOTO_FINISH_VIDEO = 49;//拍照列表的返回
public static final int NEST_WORD_SUBMIT =50;//所有的提交/上传 public static final int NEST_WORD_SUBMIT =50;//所有的提交/上传
public static final String INTENT_POI_VIDEO_TYPE ="poi_video_type"; public static final String INTENT_POI_VIDEO_TYPE ="poi_video_type";
public static int NUMBER = 200; //任务个数 public static int NUMBER = 200; //任务个数
public static int LIMIT_TYPE = -1; //权限类型普通任务-0专属任务-1 public static int LIMIT_TYPE = -1; //权限类型普通任务-0专属任务-1
@ -175,22 +180,28 @@ public class Constant {
public static JobSearchBean jobSearchBean;//数据 public static JobSearchBean jobSearchBean;//数据
public static MapView treasureMap; public static MapView treasureMap;
public static final String INTENT_VIDEO_PATH = "INTENT_VIDEO_PATH"; // 拍照界面指定的视频文件保存位置 public static final String INTENT_VIDEO_PATH = "INTENT_VIDEO_PATH"; // 拍照界面指定的视频文件保存位置
public static final String INTENT_JPG_PATH = "INTENT_JPG_PATH"; // 拍照界面指定的图片保存位置 public static final String INTENT_JPG_PATH = "INTENT_JPG_PATH"; // 拍照界面指定的图片保存位置
public static final String INTENT_PHOTO_PATH = "INTENT_PHOTO_PATH"; // 拍照界面指定的图片保存位置 public static final String INTENT_PHOTO_PATH = "INTENT_PHOTO_PATH"; // 拍照界面指定的图片保存位置
public static final String INTENT_PICTURES_PATH = "INTENT_VIDEO_PATH"; // 拍照界面指定的视频文件保存位置 public static final String INTENT_PICTURES_PATH = "INTENT_VIDEO_PATH"; // 拍照界面指定的视频文件保存位置
public static final String INTENT_VIDEO_OBLATION = "INTENT_VIDEO_OBLATION"; // 视频拍摄时屏幕方向 0-强制横屏 其他-任意 public static final String INTENT_VIDEO_OBLATION = "INTENT_VIDEO_OBLATION"; // 视频拍摄时屏幕方向 0-强制横屏 其他-任意
public static SlidingUpPanelLayout SLIDING_LAYOUT = null;//設置 public static SlidingUpPanelLayout SLIDING_LAYOUT = null;//設置
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.27";//版本 public static final String NAVIN_FO="9.28";//版本
/*联系我们的QQ群名称和QQ群号
/** */
* 联系我们的QQ群名称和QQ群号
* */
public static String REGION_JIG_NAME = "京津冀晋蒙-地图寻宝群"; public static String REGION_JIG_NAME = "京津冀晋蒙-地图寻宝群";
public static String REGION_JIG_PHONE = "9721810"; public static String REGION_JIG_PHONE = "9721810";
public static String REGION_HEI_NAME = "黑吉辽-地图寻宝群"; public static String REGION_HEI_NAME = "黑吉辽-地图寻宝群";

View File

@ -842,14 +842,14 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
chargingStationList.add(new File(tagScutcheon)); chargingStationList.add(new File(tagScutcheon));
} }
} }
if (Constant.isPresent){ if (Constant.isPresent) {
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
if (showPoiEntity==null){ if (showPoiEntity == null) {
showPoiEntity=new PoiEntity(); showPoiEntity = new PoiEntity();
} }
if ( showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1 || showPoiEntity.getTaskStatus() == 2 || showPoiEntity.getTaskStatus() == 5) { if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1 || showPoiEntity.getTaskStatus() == 2 || showPoiEntity.getTaskStatus() == 5) {
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() { Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -871,7 +871,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
} }
}).start(); }).start();
}else { } else {
Toast.makeText(getContext(), "有正在提交的数据,等提交成功后,方可操作", Toast.LENGTH_SHORT).show(); Toast.makeText(getContext(), "有正在提交的数据,等提交成功后,方可操作", Toast.LENGTH_SHORT).show();
} }
@ -1363,38 +1363,34 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
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 if (showPoiEntity.getTaskStatus() == 0 | showPoiEntity.getTaskStatus() == 1) {
initList();
new Thread(new Runnable() {
@Override
public void run() {
List<ChargingPileEntity> chargingPileEntityList = PoiDatabase.getInstance(getActivity()).getChargingPileDao().getChargingPileByStationId(showPoiEntity.getId());
if (chargingPileEntityList != null && !chargingPileEntityList.isEmpty()) {
for (ChargingPileEntity chargingPileEntity : chargingPileEntityList) {
List<File> chargingPileFileList = new ArrayList<>();
if (chargingPileEntity.getPhotos() != null && !chargingPileEntity.getPhotos().isEmpty()) {
for (String photoPath : chargingPileEntity.getPhotos()) {
chargingPileFileList.add(new File(photoPath));
}
}
PoiDatabase.getInstance(getActivity()).getChargingPileDao().deleteChargingPileEntity(chargingPileEntity);
for (int i = 0; i < chargingPileFileList.size(); i++) {
chargingPileFileList.get(i).delete();
}
}
}
}
}).start();
} else { } else {
Message obtain = Message.obtain(); Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR; obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true; obtain.obj = true;
EventBus.getDefault().post(obtain); EventBus.getDefault().post(obtain);
} }
if (showPoiEntity.getId() != null) {
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
if (poiDaoPoiEntity.getTaskStatus() == 5 || poiDaoPoiEntity.getTaskStatus() == 0 || poiDaoPoiEntity.getTaskStatus() == 1) {
initList();
List<ChargingPileEntity> chargingPileEntityList = PoiDatabase.getInstance(getActivity()).getChargingPileDao().getChargingPileByStationId(showPoiEntity.getId());
if (chargingPileEntityList != null && !chargingPileEntityList.isEmpty()) {
for (ChargingPileEntity chargingPileEntity : chargingPileEntityList) {
List<File> chargingPileFileList = new ArrayList<>();
if (chargingPileEntity.getPhotos() != null && !chargingPileEntity.getPhotos().isEmpty()) {
for (String photoPath : chargingPileEntity.getPhotos()) {
chargingPileFileList.add(new File(photoPath));
}
}
new Thread(new Runnable() {
@Override
public void run() {
PoiDatabase.getInstance(getActivity()).getChargingPileDao().deleteChargingPileEntity(chargingPileEntity);
for (int i = 0; i < chargingPileFileList.size(); i++) {
chargingPileFileList.get(i).delete();
}
}
}).start();
}
}
}
}
} }
} }
@ -1463,10 +1459,26 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
List<ChargingPileEntity> chargingPileEntityList = PoiDatabase.getInstance(getActivity()).getChargingPileDao().getChargingPileByStationId(showPoiEntity.getId());
if (chargingPileEntityList != null && !chargingPileEntityList.isEmpty()) {
for (ChargingPileEntity chargingPileEntity : chargingPileEntityList) {
List<File> chargingPileFileList = new ArrayList<>();
if (chargingPileEntity.getPhotos() != null && !chargingPileEntity.getPhotos().isEmpty()) {
for (String photoPath : chargingPileEntity.getPhotos()) {
chargingPileFileList.add(new File(photoPath));
}
}
PoiDatabase.getInstance(getActivity()).getChargingPileDao().deleteChargingPileEntity(chargingPileEntity);
for (int i = 0; i < chargingPileFileList.size(); i++) {
chargingPileFileList.get(i).delete();
}
}
}
poiDao.deletePoiEntity(poiEntity); poiDao.deletePoiEntity(poiEntity);
chargingPileDao.deleteChargingFidPileEntity(poiEntity.getId()); chargingPileDao.deleteChargingFidPileEntity(poiEntity.getId());
} }
}).start(); }).start();
initList();
Message obtain = Message.obtain(); Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR; obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true; obtain.obj = true;

View File

@ -40,6 +40,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.Info; import com.navinfo.outdoor.bean.Info;
import com.navinfo.outdoor.bean.PoiSaveBean; import com.navinfo.outdoor.bean.PoiSaveBean;
@ -690,18 +691,14 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
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 if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1) {
initList();
} else { } else {
Message obtain = Message.obtain(); Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR; obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true; obtain.obj = true;
EventBus.getDefault().post(obtain); EventBus.getDefault().post(obtain);
} }
if (showPoiEntity.getId() != null) {
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
if (poiDaoPoiEntity.getTaskStatus() == 5 || poiDaoPoiEntity.getTaskStatus() == 0 || poiDaoPoiEntity.getTaskStatus() == 1) {
initList();
}
}
} }
} }
@ -757,6 +754,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
poiDao.deletePoiEntity(poiEntity); poiDao.deletePoiEntity(poiEntity);
} }
}).start(); }).start();
initList();
Message obtain = Message.obtain(); Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR; obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true; obtain.obj = true;

View File

@ -189,6 +189,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
checkBoxLife.setTextColor(Color.WHITE); checkBoxLife.setTextColor(Color.WHITE);
checkBoxLife.setChecked(true); checkBoxLife.setChecked(true);
} }
@Override @Override
public void onCancel() { public void onCancel() {
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bags); BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bags);
@ -266,8 +267,10 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
break; break;
} }
} }
@Override @Override
public void onNothingSelected(AdapterView<?> parent) { } public void onNothingSelected(AdapterView<?> parent) {
}
}); });
//数据展示 //数据展示
initShowPoi(); initShowPoi();
@ -277,78 +280,78 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
//拍照长按删除 //拍照长按删除
private void onLongDel() { private void onLongDel() {
rlPanorama.setOnLongClickListener(new View.OnLongClickListener() { rlPanorama.setOnLongClickListener(new View.OnLongClickListener() {
@Override @Override
public boolean onLongClick(View v) { public boolean onLongClick(View v) {
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE; 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) {
ivPanorama.setImageDrawable(null); ivPanorama.setImageDrawable(null);
return false; return false;
} }
}); });
return false; return false;
} }
}); });
rlName.setOnLongClickListener(new View.OnLongClickListener() { rlName.setOnLongClickListener(new View.OnLongClickListener() {
@Override @Override
public boolean onLongClick(View v) { public boolean onLongClick(View v) {
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE; 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) {
ivName.setImageDrawable(null); ivName.setImageDrawable(null);
return false; return false;
} }
}); });
return false; return false;
} }
}); });
rlElse.setOnLongClickListener(new View.OnLongClickListener() { rlElse.setOnLongClickListener(new View.OnLongClickListener() {
@Override @Override
public boolean onLongClick(View v) { public boolean onLongClick(View v) {
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE; 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) {
ivElse.setImageDrawable(null); ivElse.setImageDrawable(null);
return false; return false;
} }
}); });
return false; return false;
} }
}); });
rlInternalPhotos.setOnLongClickListener(new View.OnLongClickListener() { rlInternalPhotos.setOnLongClickListener(new View.OnLongClickListener() {
@Override @Override
public boolean onLongClick(View v) { public boolean onLongClick(View v) {
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE; 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) {
ivInternal.setImageDrawable(null); ivInternal.setImageDrawable(null);
return false; return false;
} }
}); });
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) {
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE; 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) {
ivCard.setImageDrawable(null); ivCard.setImageDrawable(null);
return false; return false;
} }
}); });
return false; return false;
} }
}); });
} }
private void initShowPoi() { private void initShowPoi() {
@ -370,7 +373,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
editSiteContent.setText(address); editSiteContent.setText(address);
} }
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()) {
@ -388,7 +391,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
markerPoi = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiDescriptor).anchor(0.5f, 1.0f)); markerPoi = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiDescriptor).anchor(0.5f, 1.0f));
markerPoi.setZIndex(4); markerPoi.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) {
@ -537,6 +540,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
} }
} }
} }
@Override @Override
public void onError(Throwable e, int id) { public void onError(Throwable e, int id) {
dismissLoadingDialog(); dismissLoadingDialog();
@ -592,7 +596,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
initPoiSaveLocal(false); initPoiSaveLocal(false);
break; break;
case R.id.btn_uploading: case R.id.btn_uploading:
if (poiPicList!=null){ if (poiPicList != null) {
poiPicList.clear(); poiPicList.clear();
} }
String name = editNameContent.getText().toString().trim();//名称 String name = editNameContent.getText().toString().trim();//名称
@ -630,14 +634,14 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
if (tagCard != null) { if (tagCard != null) {
poiPicList.add(new File(tagCard)); poiPicList.add(new File(tagCard));
} }
if (Constant.isPresent){ if (Constant.isPresent) {
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
if (showPoiEntity==null){ if (showPoiEntity == null) {
showPoiEntity=new PoiEntity(); showPoiEntity = new PoiEntity();
} }
if ( showPoiEntity.getTaskStatus() == 1 || showPoiEntity.getTaskStatus() == 2 || showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 5) { 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() {
@ -650,13 +654,13 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
@Override @Override
public void run() { public void run() {
poiUploadByNetWork(poiDaoPoiEntity.getBodyId(), poiPicList); poiUploadByNetWork(poiDaoPoiEntity.getBodyId(), poiPicList);
Constant.isPresent=false; Constant.isPresent = false;
} }
}); });
} }
} }
}).start(); }).start();
}else { } else {
Toast.makeText(getContext(), "有正在提交的数据,等提交成功后,方可操作", Toast.LENGTH_SHORT).show(); Toast.makeText(getContext(), "有正在提交的数据,等提交成功后,方可操作", Toast.LENGTH_SHORT).show();
} }
@ -813,7 +817,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,poiPicList)); .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);
@ -855,7 +859,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
public void run() { public void run() {
if (isLocal) { if (isLocal) {
poiUploadByNetWork(body, poiPicList);//上传 poiUploadByNetWork(body, poiPicList);//上传
Constant.isPresent=false; Constant.isPresent = false;
} else { } else {
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
Message obtain = Message.obtain(); Message obtain = Message.obtain();
@ -910,8 +914,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
@Override @Override
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 (resultCode==0x104){ if (resultCode == 0x104) {
if (requestCode==101){ if (requestCode == 101) {
assert data != null; assert data != null;
String file = data.getStringExtra("file"); String file = data.getStringExtra("file");
assert file != null; assert file != null;
@ -920,7 +924,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivPanorama); String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivPanorama);
tvPanorama.setTag(andGetPath); tvPanorama.setTag(andGetPath);
} }
}else if (requestCode==102){ } else if (requestCode == 102) {
assert data != null; assert data != null;
String file = data.getStringExtra("file"); String file = data.getStringExtra("file");
assert file != null; assert file != null;
@ -929,7 +933,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivName); String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivName);
tvPoiNamePic.setTag(andGetPath); tvPoiNamePic.setTag(andGetPath);
} }
}else if (requestCode==103){ } else if (requestCode == 103) {
assert data != null; assert data != null;
String file = data.getStringExtra("file"); String file = data.getStringExtra("file");
assert file != null; assert file != null;
@ -938,7 +942,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivInternal); String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivInternal);
tvInternal.setTag(andGetPath); tvInternal.setTag(andGetPath);
} }
}else if (requestCode==104){ } else if (requestCode == 104) {
assert data != null; assert data != null;
String file = data.getStringExtra("file"); String file = data.getStringExtra("file");
assert file != null; assert file != null;
@ -947,7 +951,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivCard); String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivCard);
tvCard.setTag(andGetPath); tvCard.setTag(andGetPath);
} }
}else if (requestCode==105){ } else if (requestCode == 105) {
assert data != null; assert data != null;
String file = data.getStringExtra("file"); String file = data.getStringExtra("file");
assert file != null; assert file != null;
@ -972,23 +976,20 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
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 if (showPoiEntity.getTaskStatus() == 0 | showPoiEntity.getTaskStatus() == 1) {
initList();
} else { } else {
Message obtain = Message.obtain(); Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR; obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true; obtain.obj = true;
EventBus.getDefault().post(obtain); EventBus.getDefault().post(obtain);
} }
if (showPoiEntity.getId()!=null){
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
if (poiDaoPoiEntity.getTaskStatus()==5||poiDaoPoiEntity.getTaskStatus()==0||poiDaoPoiEntity.getTaskStatus()==1){
initList();
}
}
} }
} }
private void initList() { private void initList() {
if (poiPicList!=null){ if (poiPicList != null) {
poiPicList.clear(); poiPicList.clear();
} }
String tagPanorama = (String) tvPanorama.getTag(); String tagPanorama = (String) tvPanorama.getTag();
@ -1052,6 +1053,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
poiDao.deletePoiEntity(poiEntity); poiDao.deletePoiEntity(poiEntity);
} }
}).start(); }).start();
initList();
Message obtain = Message.obtain(); Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR; obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true; obtain.obj = true;

View File

@ -37,7 +37,6 @@ import com.navinfo.outdoor.activity.FragmentManagement;
import com.navinfo.outdoor.activity.PicturesActivity; import com.navinfo.outdoor.activity.PicturesActivity;
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.UploadUtils;
import com.navinfo.outdoor.bean.OtherUploadPicBean; import com.navinfo.outdoor.bean.OtherUploadPicBean;
import com.navinfo.outdoor.bean.PoiVideoBean; import com.navinfo.outdoor.bean.PoiVideoBean;
import com.navinfo.outdoor.bean.UnPolygonTaskBean; import com.navinfo.outdoor.bean.UnPolygonTaskBean;
@ -52,6 +51,7 @@ import com.navinfo.outdoor.room.PoiEntity;
import com.navinfo.outdoor.util.AWMp4ParserHelper; import com.navinfo.outdoor.util.AWMp4ParserHelper;
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.UploadUtils;
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor; import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor;
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptorFactory; import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptorFactory;
import com.tencent.tencentmap.mapsdk.maps.model.LatLng; import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
@ -558,21 +558,17 @@ 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 if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1) {
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
for (int i = 0; i < fileListByUUID.size(); i++) {
fileListByUUID.get(i).delete();
}
} else { } else {
Message obtain = Message.obtain(); Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR; obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true; obtain.obj = true;
EventBus.getDefault().post(obtain); EventBus.getDefault().post(obtain);
} }
if (showPoiEntity.getId()!=null){
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
if (poiDaoPoiEntity.getTaskStatus()==5||poiDaoPoiEntity.getTaskStatus()==0||poiDaoPoiEntity.getTaskStatus()==1){
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
for (int i = 0; i < fileListByUUID.size(); i++) {
fileListByUUID.get(i).delete();
}
}
}
} }
} }
@ -611,6 +607,10 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
poiDao.deletePoiEntity(poiEntity); poiDao.deletePoiEntity(poiEntity);
} }
}).start(); }).start();
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
for (int i = 0; i < fileListByUUID.size(); i++) {
fileListByUUID.get(i).delete();
}
Message obtain = Message.obtain(); Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR; obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true; obtain.obj = true;

View File

@ -568,21 +568,17 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
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 if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1) {
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
for (int i = 0; i < fileListByUUID.size(); i++) {
fileListByUUID.get(i).delete();
}
} else { } else {
Message obtain = Message.obtain(); Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR; obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true; obtain.obj = true;
EventBus.getDefault().post(obtain); EventBus.getDefault().post(obtain);
} }
if (showPoiEntity.getId()!=null){
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
if (poiDaoPoiEntity.getTaskStatus()==5||poiDaoPoiEntity.getTaskStatus()==0||poiDaoPoiEntity.getTaskStatus()==1){
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
for (int i = 0; i < fileListByUUID.size(); i++) {
fileListByUUID.get(i).delete();
}
}
}
} }
} }
@ -621,6 +617,10 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
poiDao.deletePoiEntity(poiEntity); poiDao.deletePoiEntity(poiEntity);
} }
}).start(); }).start();
List<File> fileListByUUID = AWMp4ParserHelper.getInstance().getFileListByUUID(showPoiEntity.getId());
for (int i = 0; i < fileListByUUID.size(); i++) {
fileListByUUID.get(i).delete();
}
Message obtain = Message.obtain(); Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR; obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true; obtain.obj = true;

View File

@ -55,6 +55,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
private ArrayList<PoiEntity> newEntities; private ArrayList<PoiEntity> newEntities;
private ArrayList<PoiEntity> poiEntities; private ArrayList<PoiEntity> poiEntities;
private CheckBox cbSelect; private CheckBox cbSelect;
private MessageDialog messageDialog;
public static StaySubmitFragment newInstance(Bundle bundle) { public static StaySubmitFragment newInstance(Bundle bundle) {
@ -126,6 +127,8 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
if (data.what == Constant.EVENT_STAY_REFRESH) { if (data.what == Constant.EVENT_STAY_REFRESH) {
cbSelect.setChecked(false); cbSelect.setChecked(false);
refreshData(); refreshData();
}else if (data.what==Constant.NEST_WORD_SUBMIT){
messageDialog.doDismiss();
} }
} }
@ -218,8 +221,14 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
if (poiEntities.size() > 0) { if (poiEntities.size() > 0) {
PoiSaveUtils.getInstance(getActivity()).uploadPoiEntityBatch(poiEntities); PoiSaveUtils.getInstance(getActivity()).uploadPoiEntityBatch(poiEntities);
Constant.isPresent = false; Constant.isPresent = false;
WaitDialog.show((AppCompatActivity) getActivity(), "任务正在提交中,无需重复提交"); DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
WaitDialog.dismiss(2000); messageDialog = MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "任务正在提交中,无需重复提交", "确定").setOnOkButtonClickListener(new OnDialogButtonClickListener() {
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
baseDialog.doDismiss();
return false;
}
});
} else { } else {
Toast.makeText(getActivity(), "请选择要提交的数据", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), "请选择要提交的数据", Toast.LENGTH_SHORT).show();
} }

View File

@ -149,6 +149,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
private final int MARKER_LINE = 2; private final int MARKER_LINE = 2;
private final int MARKER_FACE = 1; private final int MARKER_FACE = 1;
private final int MARKER_BIG = 4; private final int MARKER_BIG = 4;
private boolean isBack = false;
private HashMap<String, List<Marker>> removableHashMap; private HashMap<String, List<Marker>> removableHashMap;
private ArrayList<LatLng> latList; private ArrayList<LatLng> latList;
private ArrayList<PoiEntity> poiEntityArrayList; private ArrayList<PoiEntity> poiEntityArrayList;
@ -840,6 +841,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
int taskStatus = Constant.TASK_STARTUP; int taskStatus = Constant.TASK_STARTUP;
int type = Constant.TASK_TYPE; int type = Constant.TASK_TYPE;
int limit = Constant.LIMIT_TYPE; int limit = Constant.LIMIT_TYPE;
if (poiDao==null){
return;
}
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -1817,19 +1821,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
} }
} }
/*@Override
public boolean onBackPressed() {
if (!isBack) {
isBack = true;
Toast.makeText(getActivity(), "双击退出程序", Toast.LENGTH_SHORT).show();
handler.sendEmptyMessageDelayed(0x100, 2000);
} else {
Objects.requireNonNull(getActivity()).finish();
}
return true;
}
*/
/** /**
* 获取屏幕中心点位置 * 获取屏幕中心点位置
*/ */

View File

@ -57,53 +57,51 @@ public class PoiSaveUtils {
* 批量上传数据到服务端 * 批量上传数据到服务端
*/ */
public void uploadPoiEntityBatch(List<PoiEntity> poiEntityList) { public void uploadPoiEntityBatch(List<PoiEntity> poiEntityList) {
if (poiEntityList == null) { if (poiEntityList != null) {
return; new Thread(new Runnable() {
} @Override
if (poiEntityList.size()==0){ public void run() {
return; anInt = 0;
} bInt = 0;
anInt = 0; for (int i = 0; i < poiEntityList.size(); i++) {
bInt = 0; PoiEntity poiEntity = poiEntityList.get(i);
new Thread(new Runnable() { if (poiEntity.getType() == 2) { // 如果是充电站数据首先检查子充电桩的状态
@Override if (saveChargingPileByChargingStation(poiEntity)) {
public void run() { if (savePoiNet(poiEntity) == 200) { // 网络保存成功
for (PoiEntity poiEntity : poiEntityList) { // 开始上传流程
if (poiEntity.getType() == 2) { // 如果是充电站数据首先检查子充电桩的状态 if (saveChargingPileUploadChargingStation(poiEntity)) {
if (saveChargingPileByChargingStation(poiEntity)) { uploadPoiNet(poiEntity);
if (savePoiNet(poiEntity) == 200) { // 网络保存成功 }
// 开始上传流程
if (saveChargingPileUploadChargingStation(poiEntity)) {
uploadPoiNet(poiEntity);
} }
} }
} } else {//其他类型
} else {//其他类型 if (savePoiNet(poiEntity) == 200) { // 网络保存成功
if (savePoiNet(poiEntity) == 200) { // 网络保存成功 //走上传流程
//走上传流程 uploadPoiNet(poiEntity);
uploadPoiNet(poiEntity); }
} }
} }
} mContext.runOnUiThread(new Runnable() {
mContext.runOnUiThread(new Runnable() { @Override
@Override public void run() {
public void run() { 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) {
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); } else {
}else { Constant.isPresent = true;
Constant.isPresent=true; }
}
}
});
}
}).start();
}
}
});
}
}).start();
} }
// /** // /**

View File

@ -116,11 +116,22 @@
android:id="@+id/iv_pic" android:id="@+id/iv_pic"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@mipmap/take_pic_arrow"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_pic_video"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/take_poi_video_arrow"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<CheckBox <CheckBox
android:id="@+id/capture_picture" android:id="@+id/capture_picture"
style="@style/user_data_style" style="@style/user_data_style"