fix: 修改bug

This commit is contained in:
xiaoyan 2023-07-28 17:34:00 +08:00
parent d6b917fb72
commit dc41a9bba8
8 changed files with 79 additions and 69 deletions

View File

@ -37,8 +37,8 @@ android {
applicationId "com.navinfo.outdoor"
minSdkVersion 24
targetSdkVersion 30
versionCode 111
versionName "8.230721-正式版-OCR-BUGFIX"
versionCode 112
versionName "8.230728-正式版-OCR"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk {

View File

@ -750,14 +750,14 @@ public class AutoTakePicture4PoiActivity extends BaseActivity implements View.On
@Override
public void onNext(PoiEntity poiEntity) {
logger.d("领取任务成功:", poiEntity.getId());
logger.d(null, "领取任务成功:", poiEntity.getId());
}
@Override
public void onError(Throwable e) {
systemTTS.playText("注意,领取任务失败!");
if (AutoTakePicture4PoiActivity.this!=null) {
logger.d("领取任务失败:", e.getMessage()+",网络状态-:"+ NetWorkUtils.getNetworkTypeName(AutoTakePicture4PoiActivity.this));
logger.d(null, "领取任务失败:", e.getMessage()+",网络状态-:"+ NetWorkUtils.getNetworkTypeName(AutoTakePicture4PoiActivity.this));
}
}
@ -773,7 +773,7 @@ public class AutoTakePicture4PoiActivity extends BaseActivity implements View.On
private double minDistance = MATCH_START_BUFFER_DISTANCE; // 最小距离需要在匹配过程点时判断哪个任务是距离最小的
private void startMatchRoadLink(Point currentPoint) {
if (roadLinkEntityList == null/*没有需要匹配的道路数据*/ || currentPoint == null/*没有位置信息*/) {
logger.d("开始匹配:", "roadLinkEntityList == null:"+(roadLinkEntityList == null)+",currentPoint == null"+(currentPoint == null));
logger.d(null, "开始匹配:", "roadLinkEntityList == null:"+(roadLinkEntityList == null)+",currentPoint == null"+(currentPoint == null));
return;
}
double[] speedAndBearing = getSpeedAndBearing(currentPoint);
@ -785,7 +785,7 @@ public class AutoTakePicture4PoiActivity extends BaseActivity implements View.On
matchMiddleDistance = MATCH_BUFFER_DISTANCE*1.5;
}
// 此处开始匹配起点
logger.d("开始匹配起点位置:", "currentLocation:"+currentPoint.toString()+",可匹配数据个数:"+roadLinkEntityList.size());
logger.d(null, "开始匹配起点位置:", "currentLocation:"+currentPoint.toString()+",可匹配数据个数:"+roadLinkEntityList.size());
List<RoadMatchEntity> matchStartList = roadLinkEntityList.stream()
// 筛选当前任务与起点距离
.filter(it-> {
@ -803,7 +803,7 @@ public class AutoTakePicture4PoiActivity extends BaseActivity implements View.On
return true;
} else {
// 根据方向判定无法匹配
logger.d("方向不匹配:", "currentBearing:"+currentBearing+",数据角度:"+dataBearing+",数据id:"+it.getDataDetail().getId());
logger.d(null, "方向不匹配:", "currentBearing:"+currentBearing+",数据角度:"+dataBearing+",数据id:"+it.getDataDetail().getId());
return false;
}
} else {
@ -844,7 +844,7 @@ public class AutoTakePicture4PoiActivity extends BaseActivity implements View.On
// 将匹配到的数据加入到已匹配列表中
roadMatchEntityList.addAll(matchStartList);
} else {
logger.d("匹配起点数据为空:", "当前位置为:"+currentPoint.toString()+"当前角度:"+currentBearing);
logger.d(null, "匹配起点数据为空:", "当前位置为:"+currentPoint.toString()+"当前角度:"+currentBearing);
}
// 尝试用当前位置点匹配已经匹配到的roadLink如果能匹配到需要将该点记录如果无法匹配则需要评估已匹配的link是否需要被剔除
@ -1200,7 +1200,7 @@ public class AutoTakePicture4PoiActivity extends BaseActivity implements View.On
* 初始化领取任务的管理栈
* */
private Observable<PoiEntity> receiverRoadTask(RoadMatchEntity entity) {
logger.d("开始领取任务:", entity.getId()+"");
logger.d(null, "开始领取任务:", entity.getId()+"");
return Observable.just(entity).subscribeOn(Schedulers.io()).observeOn(Schedulers.computation())
.filter(roadMatchEntity -> roadMatchEntity!=null)
.map(new Function<RoadMatchEntity, PoiEntity>() {
@ -1249,7 +1249,7 @@ public class AutoTakePicture4PoiActivity extends BaseActivity implements View.On
}
} else if (taskByNetBean.getCode() == 230) { // Token过期
systemTTS.playText("注意Token过期请重新登陆");
logger.d("领取任务失败:", "Token过期"+taskByNetBean.getMessage());
logger.d(null, "领取任务失败:", "Token过期"+taskByNetBean.getMessage());
FlushTokenUtil.flushToken(AutoTakePicture4PoiActivity.this);
Message msg = handler.obtainMessage(0x103);
msg.obj = entity;
@ -1257,7 +1257,7 @@ public class AutoTakePicture4PoiActivity extends BaseActivity implements View.On
} else {
systemTTS.playText("注意,领取任务失败!");
ToastUtils.Message(AutoTakePicture4PoiActivity.this,taskByNetBean.getMessage());
logger.d("领取任务失败:", "领取失败:"+taskByNetBean.getMessage());
logger.d(null, "领取任务失败:", "领取失败:"+taskByNetBean.getMessage());
Message msg = handler.obtainMessage(0x103);
msg.obj = entity;
handler.sendMessageDelayed(msg, 10*1000); // 10秒后重试
@ -1955,7 +1955,7 @@ public class AutoTakePicture4PoiActivity extends BaseActivity implements View.On
public void onEventMessageMainThread(Message msg) {
if (msg.what == Constant.EVENT_WHAT_LOCATION_CHANGE) { // 用户位置更新
if (!locationEnable) {
logger.d("onEventMessageMainThread", "关闭了获取GPS定位开关");
logger.d(null, "onEventMessageMainThread", "关闭了获取GPS定位开关");
return;
}
TencentLocation tencentLocation = (TencentLocation) msg.obj;
@ -1970,7 +1970,7 @@ public class AutoTakePicture4PoiActivity extends BaseActivity implements View.On
// 判断当前点位和上一个点位的距离如果距离过近忽略该点
Point currentPoint = (Point) GeometryTools.createGeometry(new LatLng(tencentLocation.getLatitude(), tencentLocation.getLongitude()));
if (lastPositionPoint!=null&&lastPositionPoint.distance(currentPoint)<5e-7) { // 如果当前点小于最小距离阈值过滤该数据
logger.d("onEventMessageMainThread", "距离上一点位距离过近currentPoint-"+currentPoint.toString()+"lastPositionPoint:"+lastPositionPoint.toString());
logger.d(null, "onEventMessageMainThread", "距离上一点位距离过近currentPoint-"+currentPoint.toString()+"lastPositionPoint:"+lastPositionPoint.toString());
return;
}
lastPositionPoint = currentPoint;

View File

@ -802,14 +802,14 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
@Override
public void onNext(PoiEntity poiEntity) {
logger.d("领取任务成功:", poiEntity.getId());
logger.d(null, "领取任务成功:", poiEntity.getId());
}
@Override
public void onError(Throwable e) {
systemTTS.playText("注意,领取任务失败!");
if (AutoTakePictureActivity.this!=null) {
logger.d("领取任务失败:", e.getMessage()+",网络状态-:"+ NetWorkUtils.getNetworkTypeName(AutoTakePictureActivity.this));
logger.d(null, "领取任务失败:", e.getMessage()+",网络状态-:"+ NetWorkUtils.getNetworkTypeName(AutoTakePictureActivity.this));
}
}
@ -825,7 +825,7 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
private double minDistance = MATCH_START_BUFFER_DISTANCE; // 最小距离需要在匹配过程点时判断哪个任务是距离最小的
private void startMatchRoadLink(Point currentPoint) {
if (roadLinkEntityList == null/*没有需要匹配的道路数据*/ || currentPoint == null/*没有位置信息*/) {
logger.d("开始匹配:", "roadLinkEntityList == null:"+(roadLinkEntityList == null)+",currentPoint == null"+(currentPoint == null));
logger.d(null, "开始匹配:", "roadLinkEntityList == null:"+(roadLinkEntityList == null)+",currentPoint == null"+(currentPoint == null));
return;
}
double[] speedAndBearing = getSpeedAndBearing(currentPoint);
@ -837,7 +837,7 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
matchMiddleDistance = MATCH_BUFFER_DISTANCE*1.5;
}
// 此处开始匹配起点
logger.d("开始匹配起点位置:", "currentLocation:"+currentPoint.toString()+",可匹配数据个数:"+roadLinkEntityList.size());
logger.d(null, "开始匹配起点位置:", "currentLocation:"+currentPoint.toString()+",可匹配数据个数:"+roadLinkEntityList.size());
List<RoadMatchEntity> matchStartList = roadLinkEntityList.stream()
// 筛选当前任务与起点距离
.filter(it-> {
@ -855,7 +855,7 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
return true;
} else {
// 根据方向判定无法匹配
logger.d("方向不匹配:", "currentBearing:"+currentBearing+",数据角度:"+dataBearing+",数据id:"+it.getDataDetail().getId());
logger.d(null, "方向不匹配:", "currentBearing:"+currentBearing+",数据角度:"+dataBearing+",数据id:"+it.getDataDetail().getId());
return false;
}
} else {
@ -896,7 +896,7 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
// 将匹配到的数据加入到已匹配列表中
roadMatchEntityList.addAll(matchStartList);
} else {
logger.d("匹配起点数据为空:", "当前位置为:"+currentPoint.toString()+"当前角度:"+currentBearing);
logger.d(null, "匹配起点数据为空:", "当前位置为:"+currentPoint.toString()+"当前角度:"+currentBearing);
}
// 尝试用当前位置点匹配已经匹配到的roadLink如果能匹配到需要将该点记录如果无法匹配则需要评估已匹配的link是否需要被剔除
@ -1252,7 +1252,7 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
* 初始化领取任务的管理栈
* */
private Observable<PoiEntity> receiverRoadTask(RoadMatchEntity entity) {
logger.d("开始领取任务:", entity.getId()+"");
logger.d(null, "开始领取任务:", entity.getId()+"");
return Observable.just(entity).subscribeOn(Schedulers.io()).observeOn(Schedulers.computation())
.filter(roadMatchEntity -> roadMatchEntity!=null)
.map(new Function<RoadMatchEntity, PoiEntity>() {
@ -1301,7 +1301,7 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
}
} else if (taskByNetBean.getCode() == 230) { // Token过期
systemTTS.playText("注意Token过期请重新登陆");
logger.d("领取任务失败:", "Token过期"+taskByNetBean.getMessage());
logger.d(null, "领取任务失败:", "Token过期"+taskByNetBean.getMessage());
FlushTokenUtil.flushToken(AutoTakePictureActivity.this);
Message msg = handler.obtainMessage(0x103);
msg.obj = entity;
@ -1309,7 +1309,7 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
} else {
systemTTS.playText("注意,领取任务失败!");
ToastUtils.Message(AutoTakePictureActivity.this,taskByNetBean.getMessage());
logger.d("领取任务失败:", "领取失败:"+taskByNetBean.getMessage());
logger.d(null, "领取任务失败:", "领取失败:"+taskByNetBean.getMessage());
Message msg = handler.obtainMessage(0x103);
msg.obj = entity;
handler.sendMessageDelayed(msg, 10*1000); // 10秒后重试
@ -2006,7 +2006,7 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
public void onEventMessageMainThread(Message msg) {
if (msg.what == Constant.EVENT_WHAT_LOCATION_CHANGE) { // 用户位置更新
if (!locationEnable) {
logger.d("onEventMessageMainThread", "关闭了获取GPS定位开关");
logger.d(null, "onEventMessageMainThread", "关闭了获取GPS定位开关");
return;
}
TencentLocation tencentLocation = (TencentLocation) msg.obj;
@ -2021,7 +2021,7 @@ public class AutoTakePictureActivity extends BaseActivity implements View.OnClic
// 判断当前点位和上一个点位的距离如果距离过近忽略该点
Point currentPoint = (Point) GeometryTools.createGeometry(new LatLng(tencentLocation.getLatitude(), tencentLocation.getLongitude()));
if (lastPositionPoint!=null&&lastPositionPoint.distance(currentPoint)<5e-7) { // 如果当前点小于最小距离阈值过滤该数据
logger.d("onEventMessageMainThread", "距离上一点位距离过近currentPoint-"+currentPoint.toString()+"lastPositionPoint:"+lastPositionPoint.toString());
logger.d(null, "onEventMessageMainThread", "距离上一点位距离过近currentPoint-"+currentPoint.toString()+"lastPositionPoint:"+lastPositionPoint.toString());
return;
}
lastPositionPoint = currentPoint;

View File

@ -457,15 +457,17 @@ public class AreaHubFragment extends BaseDrawerFragment implements View.OnClickL
LatLng startLatLng = new LatLng(latitude, longitude);// 用户当前位置
double geometry = GeometryTools.distanceToDouble(startLatLng, latLng);// 起點 于用戶的距離
double rearGeometry = GeometryTools.distanceToDouble(startLatLng, rearLatLng);// 終點于用戶的距離
if (geometry > rearGeometry) {//用戶在终点开始作业
if (rearGeometry > 5000) {
ToastUtils.Message(getActivity(), "用户距离作业终点五公里以内才能拍摄");
return;
}
} else {//用户在起点开始作业
if (geometry > 5000) {
ToastUtils.Message(getActivity(), "用户距离作业终点五公里以内才能拍摄");
return;
if (matchTrack == 0) {
if (geometry > rearGeometry) {//用戶在终点开始作业
if (rearGeometry > 5000) {
ToastUtils.Message(getActivity(), "用户距离作业终点五公里以内才能拍摄");
return;
}
} else {//用户在起点开始作业
if (geometry > 5000) {
ToastUtils.Message(getActivity(), "用户距离作业终点五公里以内才能拍摄");
return;
}
}
}
Intent intents = new Intent(getActivity(), PicturesActivity.class);

View File

@ -523,15 +523,17 @@ public class BuildingInFragment extends BaseDrawerFragment implements View.OnCli
LatLng startLatLng = new LatLng(latitude, longitude);// 用户当前位置
double geometry = GeometryTools.distanceToDouble(startLatLng, latLng);// 起點 于用戶的距離
double rearGeometry = GeometryTools.distanceToDouble(startLatLng, rearLatLng);// 終點于用戶的距離
if (geometry > rearGeometry) {//用戶在终点开始作业
if (rearGeometry > 5000) {
ToastUtils.Message(getActivity(), "用户距离作业终点五公里以内才能拍摄");
return;
}
} else {//用户在起点开始作业
if (geometry > 5000) {
ToastUtils.Message(getActivity(), "用户距离作业终点五公里以内才能拍摄");
return;
if (matchTrack == 0) {
if (geometry > rearGeometry) {//用戶在终点开始作业
if (rearGeometry > 5000) {
ToastUtils.Message(getActivity(), "用户距离作业终点五公里以内才能拍摄");
return;
}
} else {//用户在起点开始作业
if (geometry > 5000) {
ToastUtils.Message(getActivity(), "用户距离作业终点五公里以内才能拍摄");
return;
}
}
}
Intent intents = new Intent(getActivity(), PicturesActivity.class);

View File

@ -450,15 +450,17 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
LatLng startLatLng = new LatLng(latitude, longitude);// 用户当前位置
double geometry = GeometryTools.distanceToDouble(startLatLng, latLng);// 起點 于用戶的距離
double rearGeometry = GeometryTools.distanceToDouble(startLatLng, rearLatLng);// 終點于用戶的距離
if (geometry > rearGeometry) {//用戶在终点开始作业
if (rearGeometry > 5000) {
ToastUtils.Message(getActivity(), "用户距离作业终点五公里以内才能拍摄");
return;
}
} else {//用户在起点开始作业
if (geometry > 5000) {
ToastUtils.Message(getActivity(), "用户距离作业终点五公里以内才能拍摄");
return;
if (matchTrack == 0) {
if (geometry > rearGeometry) {//用戶在终点开始作业
if (rearGeometry > 5000) {
ToastUtils.Message(getActivity(), "用户距离作业终点五公里以内才能拍摄");
return;
}
} else {//用户在起点开始作业
if (geometry > 5000) {
ToastUtils.Message(getActivity(), "用户距离作业终点五公里以内才能拍摄");
return;
}
}
}
Intent intents = new Intent(getActivity(), PicturesActivity.class);

View File

@ -521,15 +521,17 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
LatLng startLatLng = new LatLng(latitude, longitude);//用户当前位置
double geometry = GeometryTools.distanceToDouble(startLatLng, latLng);
double rearGeometry = GeometryTools.distanceToDouble(startLatLng, rearLatLng);
if (geometry > rearGeometry) {//用戶在终点开始作业
if (rearGeometry > 5000) {
ToastUtils.Message(getActivity(), "用户距离作业终点五公里以内才能拍摄");
return;
}
} else {//用户在起点开始作业
if (geometry > 5000) {
ToastUtils.Message(getActivity(), "用户距离作业终点五公里以内才能拍摄");
return;
if (matchTrack == 0) { // 普通拍照模式
if (geometry > rearGeometry) {//用戶在终点开始作业
if (rearGeometry > 5000) {
ToastUtils.Message(getActivity(), "用户距离作业终点五公里以内才能拍摄");
return;
}
} else {//用户在起点开始作业
if (geometry > 5000) {
ToastUtils.Message(getActivity(), "用户距离作业终点五公里以内才能拍摄");
return;
}
}
}

View File

@ -457,15 +457,17 @@ public class TrafficHubFragment extends BaseDrawerFragment implements View.OnCli
LatLng startLatLng = new LatLng(latitude, longitude);// 用户当前位置
double geometry = GeometryTools.distanceToDouble(startLatLng, latLng);// 起點 于用戶的距離
double rearGeometry = GeometryTools.distanceToDouble(startLatLng, rearLatLng);// 終點于用戶的距離
if (geometry > rearGeometry) {//用戶在终点开始作业
if (rearGeometry > 5000) {
ToastUtils.Message(getActivity(), "用户距离作业终点五公里以内才能拍摄");
return;
}
} else {//用户在起点开始作业
if (geometry > 5000) {
ToastUtils.Message(getActivity(), "用户距离作业终点五公里以内才能拍摄");
return;
if (matchTrack == 0) {
if (geometry > rearGeometry) {//用戶在终点开始作业
if (rearGeometry > 5000) {
ToastUtils.Message(getActivity(), "用户距离作业终点五公里以内才能拍摄");
return;
}
} else {//用户在起点开始作业
if (geometry > 5000) {
ToastUtils.Message(getActivity(), "用户距离作业终点五公里以内才能拍摄");
return;
}
}
}
Intent intents = new Intent(getActivity(), PicturesActivity.class);