道路,poi录像的的保存,

This commit is contained in:
wds 2021-07-13 18:39:13 +08:00
parent fc11ad05f4
commit f0ce59ec01
18 changed files with 676 additions and 351 deletions

View File

@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
android { android {
compileSdkVersion 29 compileSdkVersion 29
buildToolsVersion '29.0.2' buildToolsVersion '29.0.2'
ndkVersion '23.0.7123448' //ndkVersion '23.0.7123448'
defaultConfig { defaultConfig {
applicationId "com.navinfo.outdoor" applicationId "com.navinfo.outdoor"

View File

@ -50,7 +50,11 @@ public class PoiRecycleAdapter extends RecyclerView.Adapter<PoiRecycleAdapter.My
PoiBean poiBean = list.get(position); PoiBean poiBean = list.get(position);
holder.tvPhone.setText(poiBean.getName()); holder.tvPhone.setText(poiBean.getName());
holder.image.setImageResource(poiBean.getImage()); holder.image.setImageResource(poiBean.getImage());
holder.editPhoneNumber.setText(poiBean.getPhone()); if (poiBean.getPhone()==null||poiBean.equals("")){
holder.editPhoneNumber.setText(" ");
}else {
holder.editPhoneNumber.setText(poiBean.getPhone());
}
holder.image.setOnClickListener(new View.OnClickListener() { holder.image.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {

View File

@ -5,15 +5,21 @@ package com.navinfo.outdoor.bean;
*/ */
public class ReceivedPoiBean { public class ReceivedPoiBean {
private Integer code; /**
* code : 200
* message : 成功
* body : {"id":6774,"address":"北京市海淀区","geo":"POINT(116.28759 40.049277)","type":5,"name":"启明星辰大厦(西门)","isExclusive":0}
*/
private int code;
private String message; private String message;
private BodyBean body; private BodyBean body;
public Integer getCode() { public int getCode() {
return code; return code;
} }
public void setCode(Integer code) { public void setCode(int code) {
this.code = code; this.code = code;
} }
@ -34,18 +40,26 @@ public class ReceivedPoiBean {
} }
public static class BodyBean { public static class BodyBean {
private Integer id; /**
* id : 6774
* address : 北京市海淀区
* geo : POINT(116.28759 40.049277)
* type : 5
* name : 启明星辰大厦(西门)
* isExclusive : 0
*/
private int id;
private String address; private String address;
private String telephone;
private String geo; private String geo;
private Integer type; private int type;
private String name; private String name;
private int isExclusive;
public Integer getId() { public int getId() {
return id; return id;
} }
public void setId(Integer id) { public void setId(int id) {
this.id = id; this.id = id;
} }
@ -57,14 +71,6 @@ public class ReceivedPoiBean {
this.address = address; this.address = address;
} }
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getGeo() { public String getGeo() {
return geo; return geo;
} }
@ -73,11 +79,11 @@ public class ReceivedPoiBean {
this.geo = geo; this.geo = geo;
} }
public Integer getType() { public int getType() {
return type; return type;
} }
public void setType(Integer type) { public void setType(int type) {
this.type = type; this.type = type;
} }
@ -88,5 +94,13 @@ public class ReceivedPoiBean {
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
public int getIsExclusive() {
return isExclusive;
}
public void setIsExclusive(int isExclusive) {
this.isExclusive = isExclusive;
}
} }
} }

View File

@ -0,0 +1,106 @@
package com.navinfo.outdoor.bean;
/**
* 普通任务的领取
*/
public class TaskByNetBean {
/**
* code : 200
* message : 成功
* body : {"name":"门头沟区道路录像21","address":"","geo":"LINESTRING(115.990024 39.969285,115.991332 39.970245,115.990608 39.970906,115.993168 39.972121,115.993446 39.973038,115.99403 39.973528,115.993863 39.972142,115.995644 39.971993,115.996451 39.972078,115.998482 39.971439,115.999094 39.970607,115.9994 39.970799)","price":4.860135,"type":4,"isExclusive":0}
*/
private int code;
private String message;
private BodyBean body;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public BodyBean getBody() {
return body;
}
public void setBody(BodyBean body) {
this.body = body;
}
public static class BodyBean {
/**
* name : 门头沟区道路录像21
* address :
* geo : LINESTRING(115.990024 39.969285,115.991332 39.970245,115.990608 39.970906,115.993168 39.972121,115.993446 39.973038,115.99403 39.973528,115.993863 39.972142,115.995644 39.971993,115.996451 39.972078,115.998482 39.971439,115.999094 39.970607,115.9994 39.970799)
* price : 4.860135
* type : 4
* isExclusive : 0
*/
private String name;
private String address;
private String geo;
private double price;
private int type;
private int isExclusive;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getGeo() {
return geo;
}
public void setGeo(String geo) {
this.geo = geo;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public int getIsExclusive() {
return isExclusive;
}
public void setIsExclusive(int isExclusive) {
this.isExclusive = isExclusive;
}
}
}

View File

@ -74,7 +74,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
private int sign_exist = 0; private int sign_exist = 0;
private int cp_availableState = 0; private int cp_availableState = 0;
private CheckBox checkButton1, checkButton2, checkButton3, checkButton4, checkButton5, checkButton6; private CheckBox checkButton1, checkButton2, checkButton3, checkButton4, checkButton5, checkButton6;
private int pid; private long pid;
private String station; private String station;
private LatLng latLng; private LatLng latLng;
private LatLng poiLatLng; private LatLng poiLatLng;
@ -366,7 +366,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
station = getArguments().getString("station"); station = getArguments().getString("station");
if (station!=null){ if (station!=null){
PoiEntity poiEntity = new Gson().fromJson(station, PoiEntity.class); PoiEntity poiEntity = new Gson().fromJson(station, PoiEntity.class);
pid = poiEntity.getTaskId(); pid = poiEntity.getId();
String x = poiEntity.getX(); String x = poiEntity.getX();
String y = poiEntity.getY(); String y = poiEntity.getY();
if (x != null && y != null) { if (x != null && y != null) {
@ -391,7 +391,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
if (memo != null&&!memo.equals("")) { if (memo != null&&!memo.equals("")) {
editDescribe.setText(memo); editDescribe.setText(memo);
} }
int fid = chargingPileEntity.getFid(); long fid = chargingPileEntity.getFid();
if (fid != 0) { if (fid != 0) {
pid = fid; pid = fid;
} }
@ -847,7 +847,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
} }
}); });
} else { } else {
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a"); String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
ivPanorama.setTag(takePhotoPath); ivPanorama.setTag(takePhotoPath);
ivPanorama.setImageBitmap(bitmap);//显示图像 ivPanorama.setImageBitmap(bitmap);//显示图像
} }
@ -867,7 +867,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
} }
}); });
} else { } else {
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "b"); String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "b",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
ivCoding.setTag(takePhotoPath); ivCoding.setTag(takePhotoPath);
ivCoding.setImageBitmap(bitmap);//显示图像 ivCoding.setImageBitmap(bitmap);//显示图像
} }
@ -887,7 +887,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
} }
}); });
} else { } else {
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c"); String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
ivEquipment.setImageBitmap(bitmap);//显示图像 ivEquipment.setImageBitmap(bitmap);//显示图像
ivEquipment.setTag(takePhotoPath); ivEquipment.setTag(takePhotoPath);
} }
@ -907,7 +907,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
} }
}); });
} else { } else {
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c"); String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
ivFacility.setTag(takePhotoPath); ivFacility.setTag(takePhotoPath);
ivFacility.setImageBitmap(bitmap);//显示图像 ivFacility.setImageBitmap(bitmap);//显示图像
} }
@ -927,7 +927,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
} }
}); });
} else { } else {
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c"); String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
ivScutcheon.setTag(takePhotoPath); ivScutcheon.setTag(takePhotoPath);
ivScutcheon.setImageBitmap(bitmap);//显示图像 ivScutcheon.setImageBitmap(bitmap);//显示图像
} }
@ -947,7 +947,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
} }
}); });
} else { } else {
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c"); String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
ivDevice.setTag(takePhotoPath); ivDevice.setTag(takePhotoPath);
ivDevice.setImageBitmap(bitmap);//显示图像 ivDevice.setImageBitmap(bitmap);//显示图像
} }
@ -967,7 +967,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
} }
}); });
} else { } else {
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "d"); String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "d",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
ivUsable.setTag(takePhotoPath); ivUsable.setTag(takePhotoPath);
ivUsable.setImageBitmap(bitmap);//显示图像 ivUsable.setImageBitmap(bitmap);//显示图像
} }
@ -987,7 +987,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
} }
}); });
} else { } else {
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "d"); String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "d",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
ivAvailable.setTag(takePhotoPath); ivAvailable.setTag(takePhotoPath);
ivAvailable.setImageBitmap(bitmap);//显示图像 ivAvailable.setImageBitmap(bitmap);//显示图像
} }
@ -1007,7 +1007,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
} }
}); });
} else { } else {
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "e"); String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "e",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
ivParking.setImageBitmap(bitmap);//显示图像 ivParking.setImageBitmap(bitmap);//显示图像
ivParking.setTag(takePhotoPath); ivParking.setTag(takePhotoPath);
} }
@ -1027,7 +1027,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
} }
}); });
} else { } else {
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "e"); String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "e",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
ivNumber.setImageBitmap(bitmap);//显示图像 ivNumber.setImageBitmap(bitmap);//显示图像
ivNumber.setTag(takePhotoPath); ivNumber.setTag(takePhotoPath);
} }

View File

@ -52,6 +52,7 @@ import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder; import com.navinfo.outdoor.http.OkGoBuilder;
import com.navinfo.outdoor.room.ChargingPileDao; import com.navinfo.outdoor.room.ChargingPileDao;
import com.navinfo.outdoor.room.ChargingPileEntity; import com.navinfo.outdoor.room.ChargingPileEntity;
import com.navinfo.outdoor.room.InsertAndUpdateUtils;
import com.navinfo.outdoor.room.PoiDao; import com.navinfo.outdoor.room.PoiDao;
import com.navinfo.outdoor.room.PoiDatabase; import com.navinfo.outdoor.room.PoiDatabase;
import com.navinfo.outdoor.room.PoiEntity; import com.navinfo.outdoor.room.PoiEntity;
@ -107,6 +108,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
private LatLng latLng; private LatLng latLng;
private RelativeLayout linearExist; private RelativeLayout linearExist;
private Spinner spinnerExist; private Spinner spinnerExist;
private Integer body;
public static ChargingStationFragment newInstance(Bundle bundle) { public static ChargingStationFragment newInstance(Bundle bundle) {
ChargingStationFragment fragment = new ChargingStationFragment(); ChargingStationFragment fragment = new ChargingStationFragment();
@ -369,8 +371,9 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
phoneData.add(showPoiEntity.getTelPhone()); phoneData.add(showPoiEntity.getTelPhone());
poiBeans.add(new PoiBean("电话*", telPhone, R.drawable.icon_add_bg)); poiBeans.add(new PoiBean("电话*", telPhone, R.drawable.icon_add_bg));
} else { } else {
poiBeans.add(new PoiBean("电话*", "", R.drawable.icon_add_bg)); poiBeans.add(new PoiBean("电话*", " ", R.drawable.icon_add_bg));
} }
body=showPoiEntity.getBodyId();
poiRecycleAdapter.setList(poiBeans); poiRecycleAdapter.setList(poiBeans);
linearExist.setVisibility(View.VISIBLE); linearExist.setVisibility(View.VISIBLE);
if (showPoiEntity.getPhotoInfo() != null) { if (showPoiEntity.getPhotoInfo() != null) {
@ -403,7 +406,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
List<ChargingPileEntity> chargingPile = chargingPileDao.getChargingPile(); List<ChargingPileEntity> chargingPile = chargingPileDao.getChargingPile();
for (int i = 0; i < chargingPile.size(); i++) { for (int i = 0; i < chargingPile.size(); i++) {
ChargingPileEntity chargingPileEntity = chargingPile.get(i); ChargingPileEntity chargingPileEntity = chargingPile.get(i);
if (showPoiEntity.getTaskId() == chargingPileEntity.getFid()) { if (showPoiEntity.getId() == chargingPileEntity.getFid()) {
chargingPileEntities.add(chargingPileEntity); chargingPileEntities.add(chargingPileEntity);
} }
} }
@ -416,7 +419,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
} }
}).start(); }).start();
if (showPoiEntity.getTaskId()!=0){ if (showPoiEntity.getId()!=0){
initPile(); initPile();
} }
} }
@ -600,10 +603,16 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
poiDao.insertPoiEntity(poiEntity); InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
chargingStationSaveByWork(poiEntity);
}
});
} }
}).start(); }).start();
chargingStationSaveByWork(poiEntity);
// onBackPressed(); // onBackPressed();
} else { } else {
Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show();
@ -627,7 +636,44 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
obtain.obj = false; obtain.obj = false;
EventBus.getDefault().post(obtain); EventBus.getDefault().post(obtain);
ArrayList<File> chargingStationList = new ArrayList<>(); ArrayList<File> chargingStationList = new ArrayList<>();
String tagPanorama = (String) ivPanorama.getTag();
if (tagPanorama != null) {
chargingStationList.add(new File(tagPanorama));
}
String tagName = (String) ivName.getTag();
if (tagName != null) {
chargingStationList.add(new File(tagName));
}
String tagInternal = (String) ivInternal.getTag();
if (tagInternal != null) {
chargingStationList.add(new File(tagInternal));
}
String tagElse = (String) ivElse.getTag();
if (tagElse != null) {
chargingStationList.add(new File(tagElse));
}
String tagScutcheon = (String) ivScutcheon.getTag();
if (tagScutcheon != null) {
chargingStationList.add(new File(tagScutcheon));
}
if (body != null) {
stationUploadByNetWork(body, chargingStationList);
} else {
new Thread(new Runnable() {
@Override
public void run() {
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
// poiUploadByNetWork(poiDaoPoiEntity.getBodyId(), poiPicList);
}
});
}
}).start();
}
break; break;
case R.id.tv_examine: case R.id.tv_examine:
Toast.makeText(getContext(), editNameContent.getText().toString(), Toast.LENGTH_SHORT).show(); Toast.makeText(getContext(), editNameContent.getText().toString(), Toast.LENGTH_SHORT).show();
@ -662,6 +708,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
} }
} }
private void stationUploadByNetWork(Integer body, ArrayList<File> chargingStationList) {
}
private void chargingStationSaveByWork(PoiEntity poiEntity) { private void chargingStationSaveByWork(PoiEntity poiEntity) {
showLoadingDialog(); showLoadingDialog();
HttpParams httpParams = new HttpParams(); HttpParams httpParams = new HttpParams();
@ -682,9 +733,22 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
@Override @Override
public void onSuccess(ChargingStationBean chargingStationBean, int id) { public void onSuccess(ChargingStationBean chargingStationBean, int id) {
dismissLoadingDialog(); dismissLoadingDialog();
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show(); body = chargingStationBean.getBody();
// body = poiSaveBean.getBody(); poiEntity.setBodyId(body);
Log.d("TAG", " 其他其他其他其他"+chargingStationBean.getBody()); poiEntity.setTaskStatus(3);
new Thread(new Runnable() {
@Override
public void run() {
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
Log.d("TAG", "onSuccess: " + chargingStationBean.getBody());
}
});
}
}).start();
} }
@Override @Override
@ -760,6 +824,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
@Override @Override
public void onSaveInstanceState(@NonNull Bundle outState) { public void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState); super.onSaveInstanceState(outState);
initStationSharePre(); initStationSharePre();
} }
@ -859,11 +924,10 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
} }
}); });
} else { } else {
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a"); String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
ivPanorama.setTag(takePhotoPath); ivPanorama.setTag(takePhotoPath);
ivPanorama.setImageBitmap(bitmap);//显示图像 ivPanorama.setImageBitmap(bitmap);//显示图像
} }
} else if (requestCode == 102 && resultCode == RESULT_OK) { } else if (requestCode == 102 && resultCode == RESULT_OK) {
Bundle extras = data.getExtras();//从Intent中获取附加值 Bundle extras = data.getExtras();//从Intent中获取附加值
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像 Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
@ -880,11 +944,10 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
} }
}); });
} else { } else {
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "b"); String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "b",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
ivName.setTag(takePhotoPath); ivName.setTag(takePhotoPath);
ivName.setImageBitmap(bitmap);//显示图像 ivName.setImageBitmap(bitmap);//显示图像
} }
} else if (requestCode == 103 && resultCode == RESULT_OK) { } else if (requestCode == 103 && resultCode == RESULT_OK) {
Bundle extras = data.getExtras();//从Intent中获取附加值 Bundle extras = data.getExtras();//从Intent中获取附加值
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像 Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
@ -901,7 +964,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
} }
}); });
} else { } else {
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c"); String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
ivInternal.setTag(takePhotoPath); ivInternal.setTag(takePhotoPath);
ivInternal.setImageBitmap(bitmap);//显示图像 ivInternal.setImageBitmap(bitmap);//显示图像
} }
@ -921,7 +984,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
} }
}); });
} else { } else {
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "d"); String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "d",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
ivElse.setTag(takePhotoPath); ivElse.setTag(takePhotoPath);
ivElse.setImageBitmap(bitmap);//显示图像 ivElse.setImageBitmap(bitmap);//显示图像
} }
@ -941,7 +1004,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
} }
}); });
} else { } else {
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "e"); String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "e",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
ivScutcheon.setTag(takePhotoPath); ivScutcheon.setTag(takePhotoPath);
ivScutcheon.setImageBitmap(bitmap);//显示图像 ivScutcheon.setImageBitmap(bitmap);//显示图像
} }

View File

@ -16,6 +16,7 @@ import com.navinfo.outdoor.base.BaseFragment;
import com.navinfo.outdoor.bean.PolygonTaskBean; import com.navinfo.outdoor.bean.PolygonTaskBean;
import com.navinfo.outdoor.bean.ReceivedBean; import com.navinfo.outdoor.bean.ReceivedBean;
import com.navinfo.outdoor.bean.ReceivedPoiBean; import com.navinfo.outdoor.bean.ReceivedPoiBean;
import com.navinfo.outdoor.bean.TaskByNetBean;
import com.navinfo.outdoor.bean.UnPolygonTaskBean; import com.navinfo.outdoor.bean.UnPolygonTaskBean;
import com.navinfo.outdoor.http.Callback; import com.navinfo.outdoor.http.Callback;
import com.navinfo.outdoor.http.HttpInterface; import com.navinfo.outdoor.http.HttpInterface;
@ -131,9 +132,9 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
btnFinishGather.setVisibility(View.GONE); btnFinishGather.setVisibility(View.GONE);
break; break;
case 2://已保存 case 2://已保存
btnCancelGet.setVisibility(View.GONE); btnCancelGet.setVisibility(View.VISIBLE);
btnGetTask.setVisibility(View.GONE); btnGetTask.setVisibility(View.GONE);
btnGather.setVisibility(View.VISIBLE); btnGather.setVisibility(View.GONE);
btnFinishGather.setVisibility(View.VISIBLE); btnFinishGather.setVisibility(View.VISIBLE);
break; break;
case 3://已提交 case 3://已提交
@ -155,11 +156,19 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
if (type == 6) { if (type == 6) {
initUnPolygonTask(HttpInterface.UNRECEIVED_POLYGON_TASK, poiEntity.getTaskId()); initUnPolygonTask(HttpInterface.UNRECEIVED_POLYGON_TASK, poiEntity.getTaskId());
} else { } else {
poiEntity.setTaskStatus(0);
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
poiDao.deletePoiEntity(poiEntity); poiDao.deletePoiEntity(poiEntity);
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
btnGetTask.setVisibility(View.VISIBLE);
btnCancelGet.setVisibility(View.GONE);
btnGather.setVisibility(View.VISIBLE);
btnFinishGather.setVisibility(View.GONE);
}
});
} }
}).start(); }).start();
} }
@ -168,22 +177,20 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
case R.id.btn_get_task://领取任务 case R.id.btn_get_task://领取任务
if (poiEntity != null) { if (poiEntity != null) {
int type = poiEntity.getType(); int type = poiEntity.getType();
if (type == 6) { if (type == 6) {//面状任务的领取类型
initPolygonTask(HttpInterface.RECEIVED_POLYGON_TASK, poiEntity.getTaskId(), false); initPolygonTask(HttpInterface.RECEIVED_POLYGON_TASK, poiEntity.getTaskId(), false);
} else { } else if (type == 1) {//poi的领取类型
btnGetTask.setVisibility(View.GONE); receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK, poiEntity.getTaskId(), false);
btnCancelGet.setVisibility(View.VISIBLE); } else if (type == 2) {//充电站的领取类型
//网络请求 chargingTaskByWork(HttpInterface.RECEIVED_CTASK, poiEntity.getTaskId(), false);
if (poiEntity.getType() == 1) {//poi的领取类型 } else if (type == 3) {//poi录像的领取类型
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK, poiEntity.getTaskId(), false); taskByNet(HttpInterface.RECEIVED_POI_VIDEO_TASK,poiEntity.getTaskId(),false);
} else if (poiEntity.getType() == 2) {//充电站的领取类型 } else if (type == 4) {//道路的领取类型
chargingTaskByWork(HttpInterface.RECEIVED_CTASK, poiEntity.getTaskId(), false); taskByNet(HttpInterface.RECEIVED_ROAD_TASK,poiEntity.getTaskId(),false);
} else if (poiEntity.getType() == 5) {//其他的领取类型 } else if (type == 5) {//其他的领取类型
receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK, poiEntity.getTaskId(), false); receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK, poiEntity.getTaskId(), false);
}
} }
} }
break; break;
case R.id.btn_gather://立即采集 case R.id.btn_gather://立即采集
if (poiEntity != null) { if (poiEntity != null) {
@ -193,19 +200,30 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
if (taskStatus != 1) { if (taskStatus != 1) {
initPolygonTask(HttpInterface.RECEIVED_POLYGON_TASK, poiEntity.getTaskId(), true); initPolygonTask(HttpInterface.RECEIVED_POLYGON_TASK, poiEntity.getTaskId(), true);
} else { } else {
initCompleteTask(HttpInterface.COMPLETE, poiEntity.getTaskId()); new Thread(new Runnable() {
} @Override
public void run() {
PoiEntity taskIdPoiEntity = poiDao.getTaskIdPoiEntity(poiEntity.getTaskId());
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
initCompleteTask(HttpInterface.COMPLETE, poiEntity.getTaskId(), taskIdPoiEntity);
}
});
}
}).start();
} else {
if (poiEntity.getType() == 1) {//poi的领取类型
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK, poiEntity.getTaskId(), true);
} else if (poiEntity.getType() == 2) {//充电站的领取类型
chargingTaskByWork(HttpInterface.RECEIVED_CTASK, poiEntity.getTaskId(), true);
} else if (poiEntity.getType() == 5) {//其他的领取类型
receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK, poiEntity.getTaskId(), true);
} }
btnFinishGather.setVisibility(View.VISIBLE); } else if (type== 1) {//poi的领取类型
btnGather.setVisibility(View.GONE); receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK, poiEntity.getTaskId(), true);
} else if (type== 2) {//充电站的领取类型
chargingTaskByWork(HttpInterface.RECEIVED_CTASK, poiEntity.getTaskId(), true);
} else if (type== 3) {//poi录像的领取类型
taskByNet(HttpInterface.RECEIVED_POI_VIDEO_TASK,poiEntity.getTaskId(),true);
} else if (type == 4) {//道路的领取类型
taskByNet(HttpInterface.RECEIVED_ROAD_TASK,poiEntity.getTaskId(),true);
} else if (type == 5) {//其他的领取类型
receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK, poiEntity.getTaskId(), true);
} }
} }
break; break;
@ -215,13 +233,19 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
if (type == 6) { if (type == 6) {
initSubmitPolygonTask(HttpInterface.SUBMIT_POLYGON_TASK, poiEntity.getTaskId()); initSubmitPolygonTask(HttpInterface.SUBMIT_POLYGON_TASK, poiEntity.getTaskId());
} else { } else {
btnGather.setVisibility(View.VISIBLE);
btnFinishGather.setVisibility(View.GONE);
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
poiDao.deletePoiEntity(poiEntity); poiDao.deletePoiEntity(poiEntity);
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
btnGetTask.setVisibility(View.VISIBLE);
btnCancelGet.setVisibility(View.GONE);
btnGather.setVisibility(View.VISIBLE);
btnFinishGather.setVisibility(View.GONE);
}
});
} }
}).start(); }).start();
} }
@ -286,15 +310,17 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
} }
}).start(); }).start();
} }
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
poiDao.insertPoiEntity(chargingListEntity); InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), chargingListEntity);
getActivity().runOnUiThread(new Runnable() { getActivity().runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
btnGetTask.setVisibility(View.GONE);
btnCancelGet.setVisibility(View.VISIBLE);
btnFinishGather.setVisibility(View.VISIBLE); btnFinishGather.setVisibility(View.VISIBLE);
btnGather.setVisibility(View.GONE);
if (isSaver) { if (isSaver) {
Message obtain = Message.obtain(); Message obtain = Message.obtain();
obtain.what = Constant.GATHER_GET_MAP; obtain.what = Constant.GATHER_GET_MAP;
@ -334,7 +360,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
@Override @Override
public void onSuccess(PolygonTaskBean response, int id) { public void onSuccess(PolygonTaskBean response, int id) {
dismissLoadingDialog(); dismissLoadingDialog();
if (response.getCode() == 200) { if (response.getCode() == 200) {// 0.未领取 1.已领取2.未保存(保存到本地但未提交成功),3.已保存(保存到本地提交成功)4已上传结束采集,
PolygonTaskBean.BodyBean listBean = response.getBody(); PolygonTaskBean.BodyBean listBean = response.getBody();
PoiEntity polygonEntity = new PoiEntity(); PoiEntity polygonEntity = new PoiEntity();
polygonEntity.setTaskId(listBean.getId()); polygonEntity.setTaskId(listBean.getId());
@ -360,15 +386,19 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
poiDao.insertPoiEntity(polygonEntity); InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), polygonEntity);
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
btnGetTask.setVisibility(View.GONE);
btnCancelGet.setVisibility(View.VISIBLE);
if (aBoolean) {
initCompleteTask(HttpInterface.COMPLETE, poiEntity.getTaskId(), polygonEntity);
}
}
});
} }
}).start(); }).start();
btnGetTask.setVisibility(View.GONE);
btnCancelGet.setVisibility(View.VISIBLE);
if (aBoolean) {
initCompleteTask(HttpInterface.COMPLETE, poiEntity.getTaskId());
}
} }
} }
@ -404,10 +434,16 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
@Override @Override
public void run() { public void run() {
poiDao.deleteFormTaskID(taskId); poiDao.deleteFormTaskID(taskId);
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
btnGetTask.setVisibility(View.VISIBLE);
btnCancelGet.setVisibility(View.GONE);
}
});
} }
}).start(); }).start();
btnGetTask.setVisibility(View.VISIBLE);
btnCancelGet.setVisibility(View.GONE);
} }
} }
@ -423,7 +459,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
/** /**
* @param url 面妆任务立即采集 * @param url 面妆任务立即采集
*/ */
private void initCompleteTask(String url, int taskId) { private void initCompleteTask(String url, int taskId, PoiEntity poiEntity) {
if (taskId == 0) { if (taskId == 0) {
Toast.makeText(getContext(), "无此任务", Toast.LENGTH_SHORT).show(); Toast.makeText(getContext(), "无此任务", Toast.LENGTH_SHORT).show();
return; return;
@ -439,8 +475,20 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
public void onSuccess(UnPolygonTaskBean response, int id) { public void onSuccess(UnPolygonTaskBean response, int id) {
dismissLoadingDialog(); dismissLoadingDialog();
if (response.getCode() == 200) { if (response.getCode() == 200) {
btnGather.setVisibility(View.GONE); poiEntity.setTaskStatus(2);
btnFinishGather.setVisibility(View.VISIBLE); new Thread(new Runnable() {
@Override
public void run() {
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
btnGather.setVisibility(View.GONE);
btnFinishGather.setVisibility(View.VISIBLE);
}
});
}
}).start();
} }
} }
@ -477,10 +525,16 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
@Override @Override
public void run() { public void run() {
poiDao.deleteFormTaskID(taskId); poiDao.deleteFormTaskID(taskId);
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
btnGather.setVisibility(View.VISIBLE);
btnFinishGather.setVisibility(View.GONE);
}
});
} }
}).start(); }).start();
btnGather.setVisibility(View.VISIBLE);
btnFinishGather.setVisibility(View.GONE);
} }
} }
@ -495,7 +549,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
/** /**
* @param url 不同任务类型对应的url * @param url poi类型对应的url
*/ */
private void receivedTaskByNet(String url, int taskId, boolean isSaver) { private void receivedTaskByNet(String url, int taskId, boolean isSaver) {
showLoadingDialog(); showLoadingDialog();
@ -508,50 +562,55 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
@Override @Override
public void onSuccess(ReceivedPoiBean response, int id) { public void onSuccess(ReceivedPoiBean response, int id) {
dismissLoadingDialog(); dismissLoadingDialog();
ReceivedPoiBean.BodyBean listBean = response.getBody(); if (response.getCode()==200){
PoiEntity poiListEntity = new PoiEntity(); ReceivedPoiBean.BodyBean listBean = response.getBody();
poiListEntity.setTaskId(listBean.getId()); PoiEntity poiListEntity = new PoiEntity();
poiListEntity.setName(listBean.getName()); poiListEntity.setTaskId(listBean.getId());
poiListEntity.setAddress(listBean.getAddress()); poiListEntity.setName(listBean.getName());
poiListEntity.setTelPhone(listBean.getTelephone() + ""); poiListEntity.setAddress(listBean.getAddress());
poiListEntity.setType(Integer.valueOf(listBean.getType())); poiListEntity.setType(Integer.valueOf(listBean.getType()));
poiListEntity.setTaskStatus(1); poiListEntity.setIsExclusive(listBean.getIsExclusive());
poiListEntity.setIsLocalData(1); poiListEntity.setTaskStatus(1);
String geo = listBean.getGeo(); poiListEntity.setIsLocalData(1);
poiListEntity.setGeoWkt(geo); String geo = listBean.getGeo();
Geometry geometry = GeometryTools.createGeometry(geo); poiListEntity.setGeoWkt(geo);
if (geometry.getGeometryType().equals("Point")) {// Geometry geometry = GeometryTools.createGeometry(geo);
LatLng latLng = GeometryTools.createLatLng(geo); if (geometry.getGeometryType().equals("Point")) {//
poiListEntity.setX(latLng.longitude + ""); LatLng latLng = GeometryTools.createLatLng(geo);
poiListEntity.setY(latLng.latitude + ""); poiListEntity.setX(latLng.longitude + "");
} else if (geometry.getGeometryType().equals("LineString")) {//线 poiListEntity.setY(latLng.latitude + "");
List<LatLng> latLineString = GeometryTools.getLatLngs(geo); } else if (geometry.getGeometryType().equals("LineString")) {//线
poiListEntity.setX(latLineString.get(0).longitude + ""); List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
poiListEntity.setY(latLineString.get(0).latitude + ""); poiListEntity.setX(latLineString.get(0).longitude + "");
} else if (geometry.getGeometryType().equals("Polygon")) {// poiListEntity.setY(latLineString.get(0).latitude + "");
List<LatLng> latPolygon = GeometryTools.getLatLngs(geo); } else if (geometry.getGeometryType().equals("Polygon")) {//
poiListEntity.setX(latPolygon.get(0).longitude + ""); List<LatLng> latPolygon = GeometryTools.getLatLngs(geo);
poiListEntity.setY(latPolygon.get(0).latitude + ""); poiListEntity.setX(latPolygon.get(0).longitude + "");
} poiListEntity.setY(latPolygon.get(0).latitude + "");
new Thread(new Runnable() {
@Override
public void run() {
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
btnFinishGather.setVisibility(View.VISIBLE);
if (isSaver) {
Message obtain = Message.obtain();
obtain.what = Constant.GATHER_GET_MAP;
obtain.obj = poiListEntity;
EventBus.getDefault().post(obtain);
}
}
});
} }
}).start(); new Thread(new Runnable() {
@Override
public void run() {
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
btnGetTask.setVisibility(View.GONE);
btnCancelGet.setVisibility(View.VISIBLE);
btnFinishGather.setVisibility(View.VISIBLE);
btnGather.setVisibility(View.GONE);
if (isSaver) {
Message obtain = Message.obtain();
obtain.what = Constant.GATHER_GET_MAP;
obtain.obj = poiListEntity;
EventBus.getDefault().post(obtain);
}
}
});
}
}).start();
}
} }
@Override @Override
@ -562,7 +621,79 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
} }
}).build(); }).build();
} }
/**
* @param url 不同任务类型对应的url
*/
private void taskByNet(String url, int taskId, boolean isSaver) {
showLoadingDialog();
OkGoBuilder.getInstance()
.Builder(getActivity())
.url(url + "/" + taskId)
.method(OkGoBuilder.GET)
.cls(TaskByNetBean.class)
.callback(new Callback<TaskByNetBean>() {
@Override
public void onSuccess(TaskByNetBean response, int id) {
dismissLoadingDialog();
if (response.getCode()==200){
TaskByNetBean.BodyBean listBean = response.getBody();
PoiEntity poiListEntity = new PoiEntity();
poiListEntity.setTaskId(taskId);
poiListEntity.setName(listBean.getName());
poiListEntity.setAddress(listBean.getAddress());
poiListEntity.setType(Integer.valueOf(listBean.getType()));
poiListEntity.setPrecision(String.valueOf(listBean.getPrice()));
poiListEntity.setIsExclusive(listBean.getIsExclusive());
poiListEntity.setTaskStatus(1);
poiListEntity.setIsLocalData(1);
String geo = listBean.getGeo();
poiListEntity.setGeoWkt(geo);
Geometry geometry = GeometryTools.createGeometry(geo);
if (geometry.getGeometryType().equals("Point")) {//
LatLng latLng = GeometryTools.createLatLng(geo);
poiListEntity.setX(latLng.longitude + "");
poiListEntity.setY(latLng.latitude + "");
} else if (geometry.getGeometryType().equals("LineString")) {//线
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
poiListEntity.setX(latLineString.get(0).longitude + "");
poiListEntity.setY(latLineString.get(0).latitude + "");
} else if (geometry.getGeometryType().equals("Polygon")) {//
List<LatLng> latPolygon = GeometryTools.getLatLngs(geo);
poiListEntity.setX(latPolygon.get(0).longitude + "");
poiListEntity.setY(latPolygon.get(0).latitude + "");
}
new Thread(new Runnable() {
@Override
public void run() {
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
btnGetTask.setVisibility(View.GONE);
btnCancelGet.setVisibility(View.VISIBLE);
btnFinishGather.setVisibility(View.VISIBLE);
btnGather.setVisibility(View.GONE);
if (isSaver) {
Message obtain = Message.obtain();
obtain.what = Constant.GATHER_GET_MAP;
obtain.obj = poiListEntity;
EventBus.getDefault().post(obtain);
}
}
});
}
}).start();
}
}
@Override
public void onError(Throwable e, int id) {
dismissLoadingDialog();
Log.d("TAG", "onError: " + e.getMessage());
Toast.makeText(getContext(), e.getMessage() + "", Toast.LENGTH_SHORT).show();
}
}).build();
}
public static String format5(double value) { public static String format5(double value) {
return String.format("%.2f", value).toString(); return String.format("%.2f", value).toString();
} }

View File

@ -212,7 +212,7 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
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 (requestCode == 400 && resultCode == RESULT_OK) { if (requestCode == 400 && resultCode == RESULT_OK) {
gatheringPath = PhotoPathUtil.getTakePhotoPath(data, "e"); gatheringPath = PhotoPathUtil.getTakePhotoPath(data, "","");
return; return;
} }
} }

View File

@ -83,7 +83,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
private PoiDao poiDao; private PoiDao poiDao;
private PoiEntity showPoiEntity; private PoiEntity showPoiEntity;
private LatLng latLng; private LatLng latLng;
private int station_type = 0; private int station_type = 6;
String[] spinner = new String[]{"存在", "不存在", "无法验证"}; String[] spinner = new String[]{"存在", "不存在", "无法验证"};
private RelativeLayout linearExist; private RelativeLayout linearExist;
private Spinner spinnerExist; private Spinner spinnerExist;
@ -180,18 +180,17 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
checkPot.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { checkPot.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked){ if (isChecked) {
Message obtain = Message.obtain(); Message obtain = Message.obtain();
obtain.what = Constant.MAIN_OTHER; obtain.what = Constant.MAIN_OTHER;
obtain.obj = latLng; obtain.obj = latLng;
EventBus.getDefault().post(obtain); EventBus.getDefault().post(obtain);
}else { } else {
Message obtain = Message.obtain(); Message obtain = Message.obtain();
obtain.what = Constant.MAIN_CHECKED_OTHER; obtain.what = Constant.MAIN_CHECKED_OTHER;
obtain.obj = true; obtain.obj = true;
EventBus.getDefault().post(obtain); EventBus.getDefault().post(obtain);
} }
} }
}); });
editTaskName = findViewById(R.id.et_task_name); editTaskName = findViewById(R.id.et_task_name);
@ -216,10 +215,13 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
switch (position) { switch (position) {
case 0: case 0:
break; break;
case 1: case 1:
break; break;
case 2: case 2:
break; break;
} }
} }
@ -264,9 +266,13 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
if (describe != null && !describe.equals("")) { if (describe != null && !describe.equals("")) {
editOtherDescribe.setText(describe); editOtherDescribe.setText(describe);
} }
linearExist.setVisibility(View.VISIBLE);
if (showPoiEntity.getName() != null) {
linearExist.setVisibility(View.VISIBLE);
}
body = showPoiEntity.getBodyId(); body = showPoiEntity.getBodyId();
int station_type = showPoiEntity.getStation_type(); int station_type = showPoiEntity.getStation_type();
spinnerOther.setSelection(station_type, true); spinnerOther.setSelection(station_type, true);
if (showPoiEntity.getPhotoInfo() != null) { if (showPoiEntity.getPhotoInfo() != null) {
@ -321,7 +327,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
return; return;
} else { } else {
String encode = Geohash.getInstance().encode(latLng.latitude,latLng.longitude); String encode = Geohash.getInstance().encode(latLng.latitude, latLng.longitude);
poiEntity.setGeoWkt(encode); poiEntity.setGeoWkt(encode);
poiEntity.setX(String.valueOf(latLng.longitude)); poiEntity.setX(String.valueOf(latLng.longitude));
poiEntity.setY(String.valueOf(latLng.latitude)); poiEntity.setY(String.valueOf(latLng.latitude));
@ -370,7 +376,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
} }
}).start(); }).start();
// onBackPressed(); // onBackPressed();
} else { } else {
Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show();
} }
@ -397,9 +403,9 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
if (tagPictures != null) { if (tagPictures != null) {
otherUploadList.add(new File(tagPictures)); otherUploadList.add(new File(tagPictures));
} }
if (body!=0){ if (body != 0) {
otherUploadByNet(body, otherUploadList); otherUploadByNet(body, otherUploadList);
}else { } else {
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -418,7 +424,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
} }
private void otherUploadByNet(int body, List<File> otherUploadList) { private void otherUploadByNet(int body, List<File> otherUploadList) {
if (body == 0 ){ if (body == 0) {
Toast.makeText(getActivity(), "没有保存不能上传", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), "没有保存不能上传", Toast.LENGTH_SHORT).show();
return; return;
} }
@ -442,7 +448,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
public void onError(Response<OtherUploadPicBean> response) { public void onError(Response<OtherUploadPicBean> response) {
super.onError(response); super.onError(response);
dismissLoadingDialog(); dismissLoadingDialog();
Toast.makeText(getActivity(), response.code()+"", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), response.code() + "", Toast.LENGTH_SHORT).show();
Log.d("TAG", "onError: " + response.code()); Log.d("TAG", "onError: " + response.code());
} }
}); });
@ -508,7 +514,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
//获取Editor对象 //获取Editor对象
SharedPreferences.Editor edit = poi.edit(); SharedPreferences.Editor edit = poi.edit();
//根据要保存的数据的类型调用对应的put方法, //根据要保存的数据的类型调用对应的put方法,
PoiEntity poiEntity =showPoiEntity; PoiEntity poiEntity = showPoiEntity;
ArrayList<Info> arrayList = new ArrayList<>(); ArrayList<Info> arrayList = new ArrayList<>();
String name = editTaskName.getText().toString().trim();//名称 String name = editTaskName.getText().toString().trim();//名称
if (name != null && !name.equals("")) { if (name != null && !name.equals("")) {
@ -574,7 +580,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
}); });
} else { } else {
//照片路径 //照片路径
takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a"); takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
ivPicture.setTag(takePhotoPath); ivPicture.setTag(takePhotoPath);
ivPicture.setImageBitmap(bitmap);//显示图像 ivPicture.setImageBitmap(bitmap);//显示图像
@ -596,7 +602,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
}); });
} else { } else {
//照片路径 //照片路径
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b"); takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
ivPictures.setTag(takePhotoPath2); ivPictures.setTag(takePhotoPath2);
ivPictures.setImageBitmap(bitmap);//显示图像 ivPictures.setImageBitmap(bitmap);//显示图像
} }

View File

@ -58,10 +58,8 @@ import com.navinfo.outdoor.room.PoiEntity;
import com.navinfo.outdoor.util.Geohash; import com.navinfo.outdoor.util.Geohash;
import com.navinfo.outdoor.util.PhotoPathUtil; import com.navinfo.outdoor.util.PhotoPathUtil;
import com.tencent.tencentmap.mapsdk.maps.model.LatLng; import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
import java.io.File; import java.io.File;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@ -274,62 +272,59 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
private void initShowPoi() { private void initShowPoi() {
// 添加信息 // 添加信息
showPoiEntity = (PoiEntity) getArguments().getSerializable("poiEntity"); showPoiEntity = (PoiEntity) getArguments().getSerializable("poiEntity");
if (showPoiEntity != null) { String name = showPoiEntity.getName();//名称
String name = showPoiEntity.getName();//名称 if (name != null && !name.equals("")) {
if (name != null && !name.equals("")) { editNameContent.setText(name + "");
editNameContent.setText(name + ""); }
} String address = showPoiEntity.getAddress();//地址
String address = showPoiEntity.getAddress();//地址 if (address != null && !address.equals("")) {
if (address != null && !address.equals("")) { editSiteContent.setText(address);
editSiteContent.setText(address); }
} 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) { latLng = new LatLng();
latLng = new LatLng(); latLng.setLatitude(Double.parseDouble(y));
latLng.setLatitude(Double.parseDouble(y)); latLng.setLongitude(Double.parseDouble(x));
latLng.setLongitude(Double.parseDouble(x)); }
} String describe = showPoiEntity.getDescribe();//任务描述
String describe = showPoiEntity.getDescribe();//任务描述 if (describe != null && !describe.equals("")) {
if (describe != null && !describe.equals("")) { editDescribe.setText(describe);
editDescribe.setText(describe); }
} String telPhone = showPoiEntity.getTelPhone();
String telPhone = showPoiEntity.getTelPhone(); if (telPhone != null && !telPhone.equals("")) {
if (telPhone != null && !telPhone.equals("")) { phoneData.add(showPoiEntity.getTelPhone());
phoneData.add(showPoiEntity.getTelPhone()); poiBeans.add(new PoiBean("电话*", telPhone, R.drawable.icon_add_bg));
poiBeans.add(new PoiBean("电话*", telPhone, R.drawable.icon_add_bg));
} else {
poiBeans.add(new PoiBean("电话*", "", R.drawable.icon_add_bg));
}
poiRecycleAdapter.setList(poiBeans);
linearExist.setVisibility(View.VISIBLE);
if (showPoiEntity.getPhotoInfo() != null) {
for (int i = 0; i < showPoiEntity.getPhotoInfo().size(); i++) {
String photo = showPoiEntity.getPhotoInfo().get(i).getPhoto();
String[] split = photo.split("/");
if (split[split.length - 1].startsWith("a")) {
Glide.with(getActivity()).load(photo).into(ivPanorama);
ivPanorama.setTag(photo);
} else if (split[split.length - 1].startsWith("b")) {
Glide.with(getActivity()).load(photo).into(ivName);
ivName.setTag(photo);
} else if (split[split.length - 1].startsWith("c")) {
Glide.with(getActivity()).load(photo).into(ivInternal);
ivInternal.setTag(photo);
} else if (split[split.length - 1].startsWith("d")) {
Glide.with(getActivity()).load(photo).into(ivCard);
ivCard.setTag(photo);
} else if (split[split.length - 1].startsWith("e")) {
Glide.with(getActivity()).load(photo).into(ivElse);
ivElse.setTag(photo);
}
}
}
} else { } else {
poiBeans.add(new PoiBean("电话*", "", R.drawable.icon_add_bg)); poiBeans.add(new PoiBean("电话*", "", R.drawable.icon_add_bg));
poiRecycleAdapter.setList(poiBeans);
} }
body=showPoiEntity.getBodyId();
poiRecycleAdapter.setList(poiBeans);
if (showPoiEntity.getName()!=null){
linearExist.setVisibility(View.VISIBLE);
}
if (showPoiEntity.getPhotoInfo() != null) {
for (int i = 0; i < showPoiEntity.getPhotoInfo().size(); i++) {
String photo = showPoiEntity.getPhotoInfo().get(i).getPhoto();
String[] split = photo.split("/");
if (split[split.length - 1].startsWith("a")) {
Glide.with(getActivity()).load(photo).into(ivPanorama);
ivPanorama.setTag(photo);
} else if (split[split.length - 1].startsWith("b")) {
Glide.with(getActivity()).load(photo).into(ivName);
ivName.setTag(photo);
} else if (split[split.length - 1].startsWith("c")) {
Glide.with(getActivity()).load(photo).into(ivInternal);
ivInternal.setTag(photo);
} else if (split[split.length - 1].startsWith("d")) {
Glide.with(getActivity()).load(photo).into(ivCard);
ivCard.setTag(photo);
} else if (split[split.length - 1].startsWith("e")) {
Glide.with(getActivity()).load(photo).into(ivElse);
ivElse.setTag(photo);
}
}
}
} }
@ -509,9 +504,9 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
poiPicList.add(new File(tagCard)); poiPicList.add(new File(tagCard));
} }
if (body!=null){ if (body != null) {
poiUploadByNetWork(body, poiPicList); poiUploadByNetWork(body, poiPicList);
}else { } else {
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -577,7 +572,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
public void onError(Response<OtherUploadPicBean> response) { public void onError(Response<OtherUploadPicBean> response) {
super.onError(response); super.onError(response);
dismissLoadingDialog(); dismissLoadingDialog();
Toast.makeText(getActivity(), response.code()+ "", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), response.code() + "", Toast.LENGTH_SHORT).show();
Log.d("TAG", "onError: " + response.code() + ""); Log.d("TAG", "onError: " + response.code() + "");
} }
}); });
@ -618,7 +613,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
}); });
} }
}).start(); }).start();
} }
@Override @Override
@ -653,6 +647,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
poiEntity.setAddress(site); poiEntity.setAddress(site);
} }
if (latLng != null) { if (latLng != null) {
String encode = Geohash.getInstance().encode(latLng.latitude, latLng.longitude);
poiEntity.setGeoWkt(encode);
poiEntity.setX(String.valueOf(latLng.longitude)); poiEntity.setX(String.valueOf(latLng.longitude));
poiEntity.setY(String.valueOf(latLng.latitude)); poiEntity.setY(String.valueOf(latLng.latitude));
} }
@ -725,7 +721,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
} }
}); });
} else { } else {
takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data,"a"); takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data, "a",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
ivPanorama.setTag(takePhotoPath1); ivPanorama.setTag(takePhotoPath1);
ivPanorama.setImageBitmap(bitmap);//显示图像 ivPanorama.setImageBitmap(bitmap);//显示图像
} }
@ -745,7 +741,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
} }
}); });
} else { } else {
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b"); takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
ivName.setTag(takePhotoPath2); ivName.setTag(takePhotoPath2);
ivName.setImageBitmap(bitmap);//显示图像 ivName.setImageBitmap(bitmap);//显示图像
} }
@ -765,7 +761,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
} }
}); });
} else { } else {
takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "c"); takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
ivInternal.setTag(takePhotoPath3); ivInternal.setTag(takePhotoPath3);
ivInternal.setImageBitmap(bitmap);//显示图像 ivInternal.setImageBitmap(bitmap);//显示图像
} }
@ -785,7 +781,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
} }
}); });
} else { } else {
takePhotoPath4 = PhotoPathUtil.getTakePhotoPath(data, "d"); takePhotoPath4 = PhotoPathUtil.getTakePhotoPath(data, "d",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
ivCard.setTag(takePhotoPath4); ivCard.setTag(takePhotoPath4);
ivCard.setImageBitmap(bitmap);//显示图像 ivCard.setImageBitmap(bitmap);//显示图像
} }
@ -805,7 +801,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
} }
}); });
} else { } else {
takePhotoPath5 = PhotoPathUtil.getTakePhotoPath(data, "e"); takePhotoPath5 = PhotoPathUtil.getTakePhotoPath(data, "e",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
ivElse.setTag(takePhotoPath5); ivElse.setTag(takePhotoPath5);
ivElse.setImageBitmap(bitmap);//显示图像 ivElse.setImageBitmap(bitmap);//显示图像
} }
@ -817,7 +813,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
public void onSaveInstanceState(@NonNull Bundle outState) { public void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState); super.onSaveInstanceState(outState);
initPoiSharePre(); initPoiSharePre();
Log.d("TAG", "onSaveInstanceState: ");
} }
@Override @Override

View File

@ -237,7 +237,9 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
int type = roadExtend.getType(); int type = roadExtend.getType();
showPictureType(type); showPictureType(type);
} }
linearExist.setVisibility(View.VISIBLE); if (showPoiEntity.getName()!=null){
linearExist.setVisibility(View.VISIBLE);
}
String describe = showPoiEntity.getDescribe();//任务描述 String describe = showPoiEntity.getDescribe();//任务描述
if (describe != null && !describe.equals("")) { if (describe != null && !describe.equals("")) {
etDesc.setText(describe); etDesc.setText(describe);
@ -301,7 +303,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
@Override @Override
public void onGranted(List<String> permissions, boolean all) { public void onGranted(List<String> permissions, boolean all) {
if (all) { if (all) {
PoiEntity poiEntity = new PoiEntity(); PoiEntity poiEntity = showPoiEntity;
String roadName = etRoadName.getText().toString().trim(); String roadName = etRoadName.getText().toString().trim();
if (roadName == null || roadName.equals("")) { if (roadName == null || roadName.equals("")) {
Toast.makeText(getContext(), "请输入poi录像 名称", Toast.LENGTH_SHORT).show(); Toast.makeText(getContext(), "请输入poi录像 名称", Toast.LENGTH_SHORT).show();

View File

@ -205,7 +205,9 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
int type= roadExtend.getType(); int type= roadExtend.getType();
showPictureType(type); showPictureType(type);
} }
linearExist.setVisibility(View.VISIBLE); if (showPoiEntity.getName()!=null){
linearExist.setVisibility(View.VISIBLE);
}
String describe = showPoiEntity.getDescribe();//任务描述 String describe = showPoiEntity.getDescribe();//任务描述
if (describe != null && !describe.equals("")) { if (describe != null && !describe.equals("")) {
etDesc.setText(describe); etDesc.setText(describe);
@ -270,7 +272,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
@Override @Override
public void onGranted(List<String> permissions, boolean all) { public void onGranted(List<String> permissions, boolean all) {
if (all) { if (all) {
PoiEntity poiEntity = new PoiEntity(); PoiEntity poiEntity = showPoiEntity;
String roadName = etRoadName.getText().toString().trim(); String roadName = etRoadName.getText().toString().trim();
if (roadName == null || roadName.equals("")) { if (roadName == null || roadName.equals("")) {
Toast.makeText(getContext(), "请输入道路 名称", Toast.LENGTH_SHORT).show(); Toast.makeText(getContext(), "请输入道路 名称", Toast.LENGTH_SHORT).show();

View File

@ -26,6 +26,7 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.core.widget.NestedScrollView; import androidx.core.widget.NestedScrollView;
import androidx.fragment.app.FragmentTransaction; import androidx.fragment.app.FragmentTransaction;
import com.github.lazylibrary.util.FileUtils;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.hjq.permissions.OnPermissionCallback; import com.hjq.permissions.OnPermissionCallback;
import com.hjq.permissions.Permission; import com.hjq.permissions.Permission;
@ -179,7 +180,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
tencentMap.setMapStyle(2); tencentMap.setMapStyle(2);
//启用3d视图 //启用3d视图
tencentMap.setBuilding3dEffectEnable(true); tencentMap.setBuilding3dEffectEnable(true);
//获取地图UI 设置对象 //获取地图UI 设置对象
UiSettings uiSettings = tencentMap.getUiSettings(); UiSettings uiSettings = tencentMap.getUiSettings();
//设置logo的大小 //设置logo的大小
@ -204,7 +204,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
tencentMap.setOnMarkerClickListener(new TencentMap.OnMarkerClickListener() { tencentMap.setOnMarkerClickListener(new TencentMap.OnMarkerClickListener() {
@Override @Override
public boolean onMarkerClick(Marker marker) { public boolean onMarkerClick(Marker marker) {
if (marker.getTitle().equals("本地")) {//是本地数据直接跳转到采集页面 if (marker.getTitle() != null && !marker.getTitle().equals("")) {//是本地数据直接跳转到采集页面
PoiEntity poiEntity = (PoiEntity) marker.getTag(); PoiEntity poiEntity = (PoiEntity) marker.getTag();
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putSerializable("poiEntity", poiEntity); bundle.putSerializable("poiEntity", poiEntity);
@ -229,28 +229,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
OtherFragment otherFragment = OtherFragment.newInstance(bundle); OtherFragment otherFragment = OtherFragment.newInstance(bundle);
showSlidingFragment(otherFragment); showSlidingFragment(otherFragment);
break; break;
case 6:
initMarker(poiEntity);
break;
} }
} else if (marker.getTitle().equals("面妆任务")) {//面妆任务
JobSearchBean.BodyBean.ListBean listBean = (JobSearchBean.BodyBean.ListBean) marker.getTag();
PoiEntity poiListEntity = new PoiEntity();
poiListEntity.setTaskId(listBean.getId());
poiListEntity.setGeoWkt(listBean.getGeo());
poiListEntity.setName(listBean.getName());
poiListEntity.setAddress(listBean.getAddress());
poiListEntity.setTelPhone(listBean.getTelephone() + "");
poiListEntity.setPrecision(listBean.getPrice());
poiListEntity.setDist(listBean.getDist());
poiListEntity.setType(Integer.valueOf(listBean.getType()));
String geo = listBean.getGeo();
Geometry geometry = GeometryTools.createGeometry(geo);
if (geometry.getGeometryType().equals("Point")) {//
LatLng latLng = GeometryTools.createLatLng(geo);
poiListEntity.setX(latLng.longitude + "");
poiListEntity.setY(latLng.latitude + "");
} else if (geometry.getGeometryType().equals("LineString")) {//线
} else if (geometry.getGeometryType().equals("Polygon")) {//
}
initMarker(poiListEntity, 2);
} else { } else {
JobSearchBean.BodyBean.ListBean listBean = (JobSearchBean.BodyBean.ListBean) marker.getTag(); JobSearchBean.BodyBean.ListBean listBean = (JobSearchBean.BodyBean.ListBean) marker.getTag();
PoiEntity poiListEntity = new PoiEntity(); PoiEntity poiListEntity = new PoiEntity();
@ -263,15 +245,22 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
poiListEntity.setDist(listBean.getDist()); poiListEntity.setDist(listBean.getDist());
poiListEntity.setType(Integer.valueOf(listBean.getType())); poiListEntity.setType(Integer.valueOf(listBean.getType()));
String geo = listBean.getGeo(); String geo = listBean.getGeo();
poiListEntity.setGeoWkt(geo);
Geometry geometry = GeometryTools.createGeometry(geo); Geometry geometry = GeometryTools.createGeometry(geo);
if (geometry.getGeometryType().equals("Point")) {// if (geometry.getGeometryType().equals("Point")) {//
LatLng latLng = GeometryTools.createLatLng(geo); LatLng latLng = GeometryTools.createLatLng(geo);
poiListEntity.setX(latLng.longitude + ""); poiListEntity.setX(latLng.longitude + "");
poiListEntity.setY(latLng.latitude + ""); poiListEntity.setY(latLng.latitude + "");
} else if (geometry.getGeometryType().equals("LineString")) {//线 } else if (geometry.getGeometryType().equals("LineString")) {//线
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
poiListEntity.setX(latLineString.get(0).longitude + "");
poiListEntity.setY(latLineString.get(0).latitude + "");
} else if (geometry.getGeometryType().equals("Polygon")) {// } else if (geometry.getGeometryType().equals("Polygon")) {//
List<LatLng> latPolygon = GeometryTools.getLatLngs(geo);
poiListEntity.setX(latPolygon.get(0).longitude + "");
poiListEntity.setY(latPolygon.get(0).latitude + "");
} }
initMarker(poiListEntity, 1); initMarker(poiListEntity);
} }
return false; return false;
} }
@ -420,7 +409,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
Log.d("面妆任务", "onSuccess: " + planarMarker); Log.d("面妆任务", "onSuccess: " + planarMarker);
planarMarker.setTag(listBean); planarMarker.setTag(listBean);
removables.add(planarMarker); removables.add(planarMarker);
planarMarker.setTitle("面妆任务");//1面妆任务
planarMarker.setClickable(true); planarMarker.setClickable(true);
break; break;
} }
@ -440,7 +428,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
} }
public void initMarker(PoiEntity poiEntity, int aInt) { public void initMarker(PoiEntity poiEntity) {
sliding_layout.setPanelHeight(0); sliding_layout.setPanelHeight(0);
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN); sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
frameLayout.setVisibility(View.VISIBLE); frameLayout.setVisibility(View.VISIBLE);
@ -448,8 +436,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
fragmentTransaction = supportFragmentManager.beginTransaction(); fragmentTransaction = supportFragmentManager.beginTransaction();
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putSerializable("poiEntity", poiEntity); bundle.putSerializable("poiEntity", poiEntity);
bundle.putBoolean("boolean", false);
bundle.putInt("aSave", aInt);
gatherGetFragment = GatherGetFragment.newInstance(bundle); gatherGetFragment = GatherGetFragment.newInstance(bundle);
fragmentTransaction.replace(R.id.frame_layout, gatherGetFragment); fragmentTransaction.replace(R.id.frame_layout, gatherGetFragment);
fragmentTransaction.commit(); fragmentTransaction.commit();
@ -476,7 +462,54 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
showAllPoi.addAll(allTaskStatus); showAllPoi.addAll(allTaskStatus);
for (int i = 0; i < allTaskStatus.size(); i++) { for (int i = 0; i < allTaskStatus.size(); i++) {
PoiEntity poiEntity = allTaskStatus.get(i); PoiEntity poiEntity = allTaskStatus.get(i);
LatLng latLng = new LatLng(Double.valueOf(allTaskStatus.get(i).getY()), Double.valueOf(allTaskStatus.get(i).getX())); String geo = allTaskStatus.get(i).getGeoWkt();
LatLng latLng = null;
Log.d("TAG", "onSuccess: " + geo);
Geometry geometry = GeometryTools.createGeometry(geo);
if (geometry != null) {
if (geometry.getGeometryType().equals("Point")) {//
latLng = GeometryTools.createLatLng(geo);
} else if (geometry.getGeometryType().equals("LineString")) {//线
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
// 构造 PolylineOpitons
PolylineOptions polylineOptions = new PolylineOptions()
.addAll(latLineString)
// 折线设置圆形线头
.lineCap(true)
.color(0xffff0000)
// 折线宽度为5像素
.width(5)
// 还可以添加描边颜色
.borderColor(0xffff0000)
// 描边颜色的宽度线宽还是 25 像素不过填充的部分宽度为 `width` - 2 * `borderWidth`
.borderWidth(1);
// 绘制折线
Polyline polyline = tencentMap.addPolyline(polylineOptions);
removables.add(polyline);
if (latLineString != null && latLineString.size() > 0) {
latLng = latLineString.get(0);
}
} else if (geometry.getGeometryType().equals("Polygon")) {//
List<LatLng> latPolygon = GeometryTools.getLatLngs(geo);
Polygon polygon = tencentMap.addPolygon(new PolygonOptions().
//连接封闭图形的点
addAll(latPolygon).
//填充颜色为红色
fillColor(Color.parseColor("#97E0E74C")).
//边线颜色为黑色
strokeColor(0xff00ff00).
//边线宽度15像素
strokeWidth(5));
removables.add(polygon);
if (latPolygon != null && latPolygon.size() > 0) {
latLng = latPolygon.get(0);
}
}
} else {
if (allTaskStatus.get(i).getX() != null && allTaskStatus.get(i).getY() != null) {
latLng = new LatLng(Double.valueOf(allTaskStatus.get(i).getY()), Double.valueOf(allTaskStatus.get(i).getX()));
}
}
switch (Integer.valueOf(poiEntity.getType())) { switch (Integer.valueOf(poiEntity.getType())) {
case 1://poi case 1://poi
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_have_bg); BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_have_bg);
@ -484,7 +517,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
.flat(true) .flat(true)
.clockwise(false)); .clockwise(false));
poiMarker.setClickable(true); poiMarker.setClickable(true);
poiMarker.setTitle("本地");//1本地 poiMarker.setTitle(poiEntity.getName() + "");
poiMarker.setTag(poiEntity); poiMarker.setTag(poiEntity);
removablesLocality.add(poiMarker); removablesLocality.add(poiMarker);
break; break;
@ -494,7 +527,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
.flat(true) .flat(true)
.clockwise(false)); .clockwise(false));
stationMarker.setClickable(true); stationMarker.setClickable(true);
stationMarker.setTitle("本地");//1本地 stationMarker.setTitle(poiEntity.getName() + "");
stationMarker.setTag(poiEntity); stationMarker.setTag(poiEntity);
removablesLocality.add(stationMarker); removablesLocality.add(stationMarker);
break; break;
@ -504,7 +537,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
.flat(true) .flat(true)
.clockwise(false)); .clockwise(false));
poiVideoMarker.setClickable(true); poiVideoMarker.setClickable(true);
poiVideoMarker.setTitle("本地");//1本地 poiVideoMarker.setTitle(poiEntity.getName() + "");
poiVideoMarker.setTag(poiEntity); poiVideoMarker.setTag(poiEntity);
removablesLocality.add(poiVideoMarker); removablesLocality.add(poiVideoMarker);
break; break;
@ -514,7 +547,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
.flat(true) .flat(true)
.clockwise(false)); .clockwise(false));
roadMarker.setClickable(true); roadMarker.setClickable(true);
roadMarker.setTitle("本地");//1本地 roadMarker.setTitle(poiEntity.getName() + "");
roadMarker.setTag(poiEntity); roadMarker.setTag(poiEntity);
removablesLocality.add(roadMarker); removablesLocality.add(roadMarker);
break; break;
@ -524,7 +557,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
.flat(true) .flat(true)
.clockwise(false)); .clockwise(false));
otherMarker.setClickable(true); otherMarker.setClickable(true);
otherMarker.setTitle("本地");//1本地 otherMarker.setTitle(poiEntity.getName() + "");
otherMarker.setTag(poiEntity); otherMarker.setTag(poiEntity);
removablesLocality.add(otherMarker); removablesLocality.add(otherMarker);
break; break;
@ -534,7 +567,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
.clockwise(false) .clockwise(false)
.flat(true)); .flat(true));
planarMarker.setClickable(true); planarMarker.setClickable(true);
planarMarker.setTitle("本地");//1本地 planarMarker.setTitle(poiEntity.getName() + "");
planarMarker.setTag(poiEntity); planarMarker.setTag(poiEntity);
removablesLocality.add(planarMarker); removablesLocality.add(planarMarker);
break; break;
@ -655,7 +688,11 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
PoiEntity poiEntity = (PoiEntity) data.obj; PoiEntity poiEntity = (PoiEntity) data.obj;
if (poiEntity.getX() != null && poiEntity.getY() != null) { if (poiEntity.getX() != null && poiEntity.getY() != null) {
LatLng position = new LatLng(Double.valueOf(poiEntity.getY()), Double.valueOf(poiEntity.getX())); LatLng position = new LatLng(Double.valueOf(poiEntity.getY()), Double.valueOf(poiEntity.getX()));
tencentMap.addMarker(new MarkerOptions(position)); CameraUpdateFactory.newCameraPosition(new CameraPosition(
position, //中心点坐标地图目标经纬度
tencentMap.getCameraPosition().zoom, //目标缩放级别
tencentMap.getCameraPosition().tilt, //目标倾斜角[0.0 ~ 45.0] (垂直地图时为0)
tencentMap.getCameraPosition().bearing));//目标旋转角 0~360° (正北方为0)
} }
sliding_layout.setPanelHeight(0); sliding_layout.setPanelHeight(0);
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN); sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);

View File

@ -206,19 +206,19 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
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 (requestCode == 100 && resultCode == RESULT_OK) { if (requestCode == 100 && resultCode == RESULT_OK) {
takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data, "a"); takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data, "a","");
Bundle extras = data.getExtras();//从Intent中获取附加值 Bundle extras = data.getExtras();//从Intent中获取附加值
//从附加值中获取返回的图像 //从附加值中获取返回的图像
Bitmap bitmap = (Bitmap) extras.get("data"); Bitmap bitmap = (Bitmap) extras.get("data");
ivAttestation1.setImageBitmap(bitmap);//显示图像 ivAttestation1.setImageBitmap(bitmap);//显示图像
} else if (requestCode == 200 && resultCode == RESULT_OK) { } else if (requestCode == 200 && resultCode == RESULT_OK) {
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b"); takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b","");
Bundle extras = data.getExtras();//从Intent中获取附加值 Bundle extras = data.getExtras();//从Intent中获取附加值
//从附加值中获取返回的图像 //从附加值中获取返回的图像
Bitmap bitmap = (Bitmap) extras.get("data"); Bitmap bitmap = (Bitmap) extras.get("data");
ivAttestation2.setImageBitmap(bitmap);//显示图像 ivAttestation2.setImageBitmap(bitmap);//显示图像
}else if (requestCode == 300 && resultCode == RESULT_OK) { }else if (requestCode == 300 && resultCode == RESULT_OK) {
takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "c"); takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "c","");
Bundle extras = data.getExtras();//从Intent中获取附加值 Bundle extras = data.getExtras();//从Intent中获取附加值
//从附加值中获取返回的图像 //从附加值中获取返回的图像
Bitmap bitmap = (Bitmap) extras.get("data"); Bitmap bitmap = (Bitmap) extras.get("data");

View File

@ -23,94 +23,58 @@ public class HttpInterface {
public static final String IPm4 = "http://172.23.139.4:8001/m4"; public static final String IPm4 = "http://172.23.139.4:8001/m4";
public static final String MSG_CONTENT = IPm4 + "/1/msg_content";//发现 -富文本详情页请求 public static final String MSG_CONTENT = IPm4 + "/1/msg_content";//发现 -富文本详情页请求
//172.23.139.4:8001/m4/userAuth/add //172.23.139.4:8001/m4/userAuth/add
public static final String USER_AUTH_ADD = IPm4 + "/userAuth/add"; //实名认证 public static final String USER_AUTH_ADD = IPm4 + "/userAuth/add"; //实名认证
//172.23.139.4:8001/m4/user/update //172.23.139.4:8001/m4/user/update
public static final String USER_UPDATE = IPm4 + "/user/update";//用户资料 public static final String USER_UPDATE = IPm4 + "/user/update";//用户资料
//172.23.139.4:8001/m4/userBankcard/update //172.23.139.4:8001/m4/userBankcard/update
public static final String USER_BANKCARD_UP_DATA = IPm4 + "/userBankcard/update"; //绑定银行卡 public static final String USER_BANKCARD_UP_DATA = IPm4 + "/userBankcard/update"; //绑定银行卡
public static final String IPm5 = "http://172.23.139.4:8004/";
public static final String IPM3 = "http://172.23.139.4:8003/m4";
//172.23.139.4:8003/m4/task/1/getList
public static final String TASK_LIST = IPM3 + "/task/1/getList"; //任务搜索
public static final String IPm5 = "http://172.23.139.4:8004/userPrice/1/";
//http://172.23.139.4:8004/userPrice/1/getPrice //http://172.23.139.4:8004/userPrice/1/getPrice
public static final String GET_PRICE = IPm5 + "getPrice";//我的-总资产 public static final String GET_PRICE = IPm5 + "userPrice/1/getPrice";//我的-总资产
//http://172.23.139.4:8004/userPrice/1/userPriceExchange?exchangeMoney=10&payType=1 //http://172.23.139.4:8004/userPrice/1/userPriceExchange?exchangeMoney=10&payType=1
public static final String USER_PRICE_EXCHANGE = IPm5 + "userPriceExchange";//我的-财务信息-提现 public static final String USER_PRICE_EXCHANGE = IPm5 + "userPriceExchange";//我的-财务信息-提现
public static final String IPm6 = "http://172.23.139.4:8003/othertask/1/"; public static final String IPm6 = "http://172.23.139.4:8003/";
//172.23.139.4:8003/m4/task/1/getList
//172.23.139.4:8003/othertask/1/receivedOthertask/5001 public static final String TASK_LIST = IPm6 + "m4/task/1/getList"; //任务搜索
public static final String RECEIVED_OTHER_TASK = IPm6 + "receivedOthertask";//其他-领取任务 //172.23.139.4:8003/othertask/1/receivedOthertask
public static final String RECEIVED_OTHER_TASK = IPm6 + "othertask/1/receivedOthertask";//其他-领取任务
public static final String IPm7 = "http://172.23.139.4:8003/poitask/1/";
//172.23.139.4:8003/poitask/1/receivedPoitask/1 //172.23.139.4:8003/poitask/1/receivedPoitask/1
public static final String RECEIVED_POI_TASK = IPm7 + "receivedPoitask";//poi-领取任务 public static final String RECEIVED_POI_TASK = IPm6 + "poitask/1/receivedPoitask";//poi-领取任务
public static final String IPm8 = "http://172.23.139.4:8003/poitask/1/";
//172.23.139.4:8003/poitask/1/submitPoitask?taskId=5001&name=测试修改名称&address=测试修改地址&existence=1&geo=1rn7exd5uhxy&memo=测试备注 //172.23.139.4:8003/poitask/1/submitPoitask?taskId=5001&name=测试修改名称&address=测试修改地址&existence=1&geo=1rn7exd5uhxy&memo=测试备注
public static final String SUBMIT_POI_TASK = IPm6 + "poitask/1/submitPoitask";//poi-保存本地
public static final String SUBMIT_POI_TASK = IPm8 + "submitPoitask";//poi-保存本地
public static final String IPm9 = "http://172.23.139.4:8003/othertask/1/";
//172.23.139.4:8003/othertask/1/submitOhtertask?taskId=5001&name=测试修改名称&address=测试修改地址&existence=1&geo=1rn7exd5uhxy&memo=测试备注 //172.23.139.4:8003/othertask/1/submitOhtertask?taskId=5001&name=测试修改名称&address=测试修改地址&existence=1&geo=1rn7exd5uhxy&memo=测试备注
public static final String SUBMIT_OTHER_TASK = IPm6 + "othertask/1/submitOthertask";//其他-保存本地
public static final String SUBMIT_OTHER_TASK = IPm9 + "submitOthertask";//其他-保存本地
/*172.23.139.4:8003/polygonTask/1/receivedPolygontask/8602
172.23.139.4:8003/polygonTask/1/unReceivedPolygontask/8602
172.23.139.4:8003/polygonTask/1/complete/8602
172.23.139.4:8003/polygonTask/1/submitPolygontask?id=8602*/
public static final String IPm10="http://172.23.139.4:8003/polygonTask/1/";
public static final String RECEIVED_POLYGON_TASK=IPm10+"receivedPolygontask"; //任务领取
public static final String UNRECEIVED_POLYGON_TASK=IPm10+"unReceivedPolygontask";//结束领取
public static final String COMPLETE=IPm10+"complete";//任务采集
public static final String SUBMIT_POLYGON_TASK=IPm10+"submitPolygontask";//结束采集
public static final String IPm11= "http://172.23.139.4:8003/othertask/1/";
//172.23.139.4:8003/othertask/1/uploadpic //172.23.139.4:8003/othertask/1/uploadpic
public static final String OTHER_TASK_UPLOAD_PIC=IPm11+"uploadpic";//其他-上传 public static final String OTHER_TASK_UPLOAD_PIC=IPm6+"othertask/1/uploadpic";//其他-上传
public static final String IPm12= "http://172.23.139.4:8003/ctask/1/";
//172.23.139.4:8003/ctask/1/receivedCtask/8608 //172.23.139.4:8003/ctask/1/receivedCtask/8608
public static final String RECEIVED_CTASK=IPm12+"receivedCtask/8608";//充电站-领取任务 public static final String RECEIVED_CTASK=IPm6+"ctask/1/receivedCtask";//充电站-领取任务
//172.23.139.4:8003/ctask/1/submitCtask?id=8608&name=充电站&address=地址&telephone=18812345678|14712345678&geo=1rn7exd5uhxy&memo=测试备注&sptype=1 //172.23.139.4:8003/ctask/1/submitCtask?id=8608&name=充电站&address=地址&telephone=18812345678|14712345678&geo=1rn7exd5uhxy&memo=测试备注&sptype=1
public static final String SUBMIT_CTASK=IPm12+"submitCtask";//充电站-保存本地 public static final String SUBMIT_CTASK=IPm6+"ctask/1/submitCtask";//充电站-保存本地
public static final String IPm13= "http://172.23.139.4:8003/poitask/1/";
//172.23.139.4:8003/poitask/1/uploadpic //172.23.139.4:8003/poitask/1/uploadpic
public static final String POI_TASK_UPLOAD_PIC=IPm13+"uploadpic";//poi-上传 public static final String POI_TASK_UPLOAD_PIC=IPm6+"poitask/1/uploadpic";//poi-上传
//172.23.139.4:8003/roadtask/1/receivedRoadtask/8569
public static final String RECEIVED_ROAD_TASK = IPm6+"roadtask/1/receivedRoadtask";//道路任务获取
public static final String IPm14 = "http://172.23.139.4:8003/poivideotask/1/"; //172.23.139.4:8003/poivideotask/1/receivedPoivideotask/8569
public static final String RECEIVED_POI_VIDEO_TASK = IPm6+"poivideotask/1/receivedPoivideotask";//poi录像任务获取
// 172.23.139.4:8003/poivideotask/1/submitPoivideotask // 172.23.139.4:8003/poivideotask/1/submitPoivideotask
public static final String INSIDE_API_LIST = IPm14+"submitPoivideotask";//poi录像 保存 public static final String INSIDE_API_LIST = IPm6+"poivideotask/1/submitPoivideotask";//poi录像 保存
//172.23.139.4:8003/poivideotask/1/uploadpic //172.23.139.4:8003/poivideotask/1/uploadpic
public static final String POI_VIDEO_UPLOAD_PIC = IPm14+"uploadpic";//poi录像-上传 public static final String POI_VIDEO_UPLOAD_PIC = IPm6+"poivideotask/1/uploadpic";//poi录像-上传
/**
* 面状任务
*/
public static final String RECEIVED_POLYGON_TASK=IPm6+"polygonTask/1/receivedPolygontask"; //任务领取
public static final String UNRECEIVED_POLYGON_TASK=IPm6+"polygonTask/1/unReceivedPolygontask";//结束领取
public static final String COMPLETE=IPm6+"polygonTask/1/complete";//任务采集
public static final String SUBMIT_POLYGON_TASK=IPm6+"polygonTask/1/submitPolygontask";//结束采集

View File

@ -32,7 +32,7 @@ public class ChargingPileEntity implements Serializable {
private String memo;//备注 默认为空 private String memo;//备注 默认为空
@TypeConverters(StringTypeConverter.class) @TypeConverters(StringTypeConverter.class)
private List<String> photos;//照片组 private List<String> photos;//照片组
private int fid;//对应充电站id private long fid;//对应充电站id
public int getPileId() { public int getPileId() {
return pileId; return pileId;
@ -106,11 +106,11 @@ public class ChargingPileEntity implements Serializable {
this.photos = photos; this.photos = photos;
} }
public int getFid() { public long getFid() {
return fid; return fid;
} }
public void setFid(int fid) { public void setFid(long fid) {
this.fid = fid; this.fid = fid;
} }
} }

View File

@ -31,10 +31,24 @@ public class PoiEntity implements Serializable {
private String extend;//添加字段 private String extend;//添加字段
private boolean checked; private boolean checked;
private String geoWkt; // 数据的wkt private String geoWkt; // 数据的wkt
//ROOM不支持直接存储集合
@TypeConverters(PhotoInfoConverter.class)
private List<Info> photoInfo;//照片信息
private int existence;//是否存在
private String x;//经度
private String y;//纬度
private String detail;//深度信息
private String dist;//距离用户位置
private int taskStatus;//任务状态 0.未领取 1.已领取2.未保存(保存到本地但未提交成功),3.已保存(保存到本地提交成功)4已上传结束采集,
private int type;//1 "POI"2 "充电站"3 "POI录像"4 "道路录像"5 "其他"6 "面状任务"
private int station_type;//1."全部"2 "POI"3 "充电站"4 "POI录像"5 "道路录像", "门牌:6 公交:7 情报:8
private int isLocalData;//是否是本地数据 0,服务 1,本地
private int isExclusive;//任务类型 0.普通任务1.专属任务
private int bodyId;//保存本地的bodyId
public String getGeoWkt() { public String getGeoWkt() {
return geoWkt; return geoWkt;
} }
public void setGeoWkt(String geoWkt) { public void setGeoWkt(String geoWkt) {
this.geoWkt = geoWkt; this.geoWkt = geoWkt;
} }
@ -55,21 +69,6 @@ public class PoiEntity implements Serializable {
this.extend = extend; this.extend = extend;
} }
//ROOM不支持直接存储集合
@TypeConverters(PhotoInfoConverter.class)
private List<Info> photoInfo;//照片信息
private int existence;//是否存在
private String x;//经度
private String y;//纬度
private String detail;//深度信息
private String dist;//距离用户位置
private int taskStatus;//任务状态 0.未领取 1.已领取2.未保存(保存到本地但未提交成功),3.已保存(保存到本地提交成功)4已上传结束采集,
private int type;//1 "POI"2 "充电站"3 "POI录像"4 "道路录像"5 "其他"6 "面状任务"
private int station_type;//1."全部"2 "POI"3 "充电站"4 "POI录像"5 "道路录像", "门牌:6 公交:7 情报:8
private int isLocalData;//是否是本地数据 0,服务 1,本地
private int isExclusive;//任务类型 0.普通任务1.专属任务
private int bodyId;//保存本地的bodyId
public int getBodyId() { public int getBodyId() {
return bodyId; return bodyId;
} }

View File

@ -5,6 +5,7 @@ import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment;
import com.navinfo.outdoor.api.Constant; import com.navinfo.outdoor.api.Constant;
@ -13,13 +14,14 @@ import java.io.FileOutputStream;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date;
/** /**
* 获取图片的真实路径 * 获取图片的真实路径
*/ */
public class PhotoPathUtil { public class PhotoPathUtil {
public static String getTakePhotoPath(Intent data, String d) { public static String getTakePhotoPath(Intent data,String d,String coord) {
Bitmap photo = null; Bitmap photo = null;
Uri uri = data.getData(); Uri uri = data.getData();
if (uri != null) { if (uri != null) {
@ -41,7 +43,7 @@ public class PhotoPathUtil {
calendar.setTimeInMillis(System.currentTimeMillis()); calendar.setTimeInMillis(System.currentTimeMillis());
String format = formatter.format(calendar.getTime()); String format = formatter.format(calendar.getTime());
//文件 //文件
File file = new File(Constant.PICTURE_FOLDER, d + format + ".jpg");//D(类型代号)+pid+拍摄时间+_p加密坐标_ax(x=0/90/180/270).jpg File file = new File(Constant.PICTURE_FOLDER, d+format+coord+ ".jpg");
/***打开文件输出流*/ /***打开文件输出流*/
fileOutputStream = new FileOutputStream(file); fileOutputStream = new FileOutputStream(file);
// 生成图片文件 // 生成图片文件