fix: 修改了拍摄时txt文件经纬度的记录

This commit is contained in:
xiaoyan 2022-01-12 13:37:06 +08:00
parent 6cb40f1bcc
commit 8231733922
5 changed files with 42 additions and 5 deletions

View File

@ -9,8 +9,8 @@ android {
applicationId "com.navinfo.outdoor"
minSdkVersion 22
targetSdkVersion 30
versionCode 11
versionName "8.1210"
versionCode 12
versionName "8.1211"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions {

View File

@ -812,10 +812,10 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
sb.append(initCount);
sb.append(",");
if (gpsLocation != null) {
double[] doubles = Gps.toGCJ02Point(gpsLocation.getLatitude(), gpsLocation.getLongitude());
sb.append(doubles[0]);
// double[] doubles = Gps.toGCJ02Point(gpsLocation.getLatitude(), gpsLocation.getLongitude());
sb.append(gpsLocation.getLatitude());
sb.append(",");
sb.append(doubles[1]);
sb.append(gpsLocation.getLongitude());
} else {
sb.append(0);
sb.append(",");

View File

@ -55,6 +55,7 @@ import com.navinfo.outdoor.util.AWMp4ParserHelper;
import com.navinfo.outdoor.util.FlushTokenUtil;
import com.navinfo.outdoor.util.Geohash;
import com.navinfo.outdoor.util.GeometryTools;
import com.navinfo.outdoor.util.PoiSaveUtils;
import com.navinfo.outdoor.util.PreserveUtils;
import com.navinfo.outdoor.util.TimestampUtil;
import com.navinfo.outdoor.util.ToastUtils;
@ -497,6 +498,11 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
if (Constant.isPresent) {
if (fmPoiVideoPic.getTag() != null) {
List<File> videoFileList = (List<File>) fmPoiVideoPic.getTag();
boolean existsPic = PoiSaveUtils.getInstance(getActivity()).checkPicExists(videoFileList);
if (!existsPic) {
ToastUtils.Message(getActivity(), "本地不存在照片文件,无法上传数据,请确认!");
return;
}
fileZip = new File(Constant.PICTURE_FOLDER, "files" + ".zip");
new Thread(new Runnable() {
@Override

View File

@ -41,6 +41,7 @@ import com.navinfo.outdoor.activity.PicturesActivity;
import com.navinfo.outdoor.api.Constant;
import com.navinfo.outdoor.base.BaseDrawerFragment;
import com.navinfo.outdoor.util.FlushTokenUtil;
import com.navinfo.outdoor.util.PoiSaveUtils;
import com.navinfo.outdoor.util.PreserveUtils;
import com.navinfo.outdoor.util.TimestampUtil;
import com.navinfo.outdoor.util.ToastUtils;
@ -484,6 +485,11 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
if (Constant.isPresent) {
if (fmRoadPic.getTag() != null) {
List<File> videoFileList = (List<File>) fmRoadPic.getTag();
boolean existsPic = PoiSaveUtils.getInstance(getActivity()).checkPicExists(videoFileList);
if (!existsPic) {
ToastUtils.Message(getActivity(), "本地不存在照片文件,无法上传数据,请确认!");
return;
}
fileZip = new File(Constant.PICTURE_FOLDER, "files" + ".zip");
new Thread(new Runnable() {
@Override

View File

@ -65,8 +65,10 @@ public class PoiSaveUtils {
public void run() {
anInt = 0;
bInt = 0;
Log.d("PoiSaveUtils", "开始上传");
for (int i = 0; i < poiEntityList.size(); i++) {
PoiEntity poiEntity = poiEntityList.get(i);
Log.d("PoiSaveUtils", "poiEntity.getType():"+poiEntity.getType());
if (poiEntity.getType() == 2) { // 如果是充电站数据首先检查子充电桩的状态
if (saveChargingPileByChargingStation(poiEntity)) {
if (savePoiNet(poiEntity) == 200) { // 网络保存成功
@ -243,6 +245,11 @@ public class PoiSaveUtils {
} else if (poiEntity.getType() == 3) {
List<File> videoFileList = AWMp4ParserHelper.getInstance().getFileListByUUID(poiEntity.getId());
if (videoFileList != null && !videoFileList.isEmpty()) {
boolean existsPic = PoiSaveUtils.getInstance(mContext).checkPicExists(videoFileList);
if (!existsPic) {
bInt++;
return;
}
File fileZip = new File(Constant.PICTURE_FOLDER, "files" + ".zip");
ZipUtil.zipFiles(videoFileList, fileZip, null);
photoFile.add(fileZip);
@ -264,6 +271,11 @@ public class PoiSaveUtils {
} else if (poiEntity.getType() == 4) {
List<File> videoFileList = AWMp4ParserHelper.getInstance().getFileListByUUID(poiEntity.getId());
if (videoFileList != null && !videoFileList.isEmpty()) {
boolean existsPic = PoiSaveUtils.getInstance(mContext).checkPicExists(videoFileList);
if (!existsPic) {
bInt++;
return;
}
File fileZip = new File(Constant.PICTURE_FOLDER, "files" + ".zip");
ZipUtil.zipFiles(videoFileList, fileZip, null);
photoFile.add(fileZip);
@ -518,4 +530,17 @@ public class PoiSaveUtils {
return 200;
}
/**
* 检查传入的文件列表是否都存在
* */
public boolean checkPicExists(List<File> fileList) {
boolean isExistsPic = false; // 是否记录的照片全部不存在
for (File picFile: fileList) {
if (picFile!=null&&picFile.exists()) {
isExistsPic = true;
break;
}
}
return isExistsPic;
}
}