道路,poi录像的的保存,
This commit is contained in:
parent
fc11ad05f4
commit
f0ce59ec01
@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion '29.0.2'
|
||||
ndkVersion '23.0.7123448'
|
||||
//ndkVersion '23.0.7123448'
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.navinfo.outdoor"
|
||||
|
@ -50,7 +50,11 @@ public class PoiRecycleAdapter extends RecyclerView.Adapter<PoiRecycleAdapter.My
|
||||
PoiBean poiBean = list.get(position);
|
||||
holder.tvPhone.setText(poiBean.getName());
|
||||
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() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -5,15 +5,21 @@ package com.navinfo.outdoor.bean;
|
||||
*/
|
||||
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 BodyBean body;
|
||||
|
||||
public Integer getCode() {
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(Integer code) {
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
@ -34,18 +40,26 @@ public class ReceivedPoiBean {
|
||||
}
|
||||
|
||||
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 telephone;
|
||||
private String geo;
|
||||
private Integer type;
|
||||
private int type;
|
||||
private String name;
|
||||
private int isExclusive;
|
||||
|
||||
public Integer getId() {
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@ -57,14 +71,6 @@ public class ReceivedPoiBean {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getTelephone() {
|
||||
return telephone;
|
||||
}
|
||||
|
||||
public void setTelephone(String telephone) {
|
||||
this.telephone = telephone;
|
||||
}
|
||||
|
||||
public String getGeo() {
|
||||
return geo;
|
||||
}
|
||||
@ -73,11 +79,11 @@ public class ReceivedPoiBean {
|
||||
this.geo = geo;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Integer type) {
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@ -88,5 +94,13 @@ public class ReceivedPoiBean {
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getIsExclusive() {
|
||||
return isExclusive;
|
||||
}
|
||||
|
||||
public void setIsExclusive(int isExclusive) {
|
||||
this.isExclusive = isExclusive;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
106
app/src/main/java/com/navinfo/outdoor/bean/TaskByNetBean.java
Normal file
106
app/src/main/java/com/navinfo/outdoor/bean/TaskByNetBean.java
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
@ -74,7 +74,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
private int sign_exist = 0;
|
||||
private int cp_availableState = 0;
|
||||
private CheckBox checkButton1, checkButton2, checkButton3, checkButton4, checkButton5, checkButton6;
|
||||
private int pid;
|
||||
private long pid;
|
||||
private String station;
|
||||
private LatLng latLng;
|
||||
private LatLng poiLatLng;
|
||||
@ -366,7 +366,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
station = getArguments().getString("station");
|
||||
if (station!=null){
|
||||
PoiEntity poiEntity = new Gson().fromJson(station, PoiEntity.class);
|
||||
pid = poiEntity.getTaskId();
|
||||
pid = poiEntity.getId();
|
||||
String x = poiEntity.getX();
|
||||
String y = poiEntity.getY();
|
||||
if (x != null && y != null) {
|
||||
@ -391,7 +391,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
if (memo != null&&!memo.equals("")) {
|
||||
editDescribe.setText(memo);
|
||||
}
|
||||
int fid = chargingPileEntity.getFid();
|
||||
long fid = chargingPileEntity.getFid();
|
||||
if (fid != 0) {
|
||||
pid = fid;
|
||||
}
|
||||
@ -847,7 +847,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a");
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivPanorama.setTag(takePhotoPath);
|
||||
ivPanorama.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
@ -867,7 +867,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "b");
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "b",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivCoding.setTag(takePhotoPath);
|
||||
ivCoding.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
@ -887,7 +887,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c");
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivEquipment.setImageBitmap(bitmap);//显示图像
|
||||
ivEquipment.setTag(takePhotoPath);
|
||||
}
|
||||
@ -907,7 +907,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c");
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivFacility.setTag(takePhotoPath);
|
||||
ivFacility.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
@ -927,7 +927,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c");
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivScutcheon.setTag(takePhotoPath);
|
||||
ivScutcheon.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
@ -947,7 +947,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c");
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivDevice.setTag(takePhotoPath);
|
||||
ivDevice.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
@ -967,7 +967,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "d");
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "d",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivUsable.setTag(takePhotoPath);
|
||||
ivUsable.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
@ -987,7 +987,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "d");
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "d",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivAvailable.setTag(takePhotoPath);
|
||||
ivAvailable.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
@ -1007,7 +1007,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "e");
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "e",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivParking.setImageBitmap(bitmap);//显示图像
|
||||
ivParking.setTag(takePhotoPath);
|
||||
}
|
||||
@ -1027,7 +1027,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "e");
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "e",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivNumber.setImageBitmap(bitmap);//显示图像
|
||||
ivNumber.setTag(takePhotoPath);
|
||||
}
|
||||
|
@ -52,6 +52,7 @@ import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||
import com.navinfo.outdoor.room.ChargingPileDao;
|
||||
import com.navinfo.outdoor.room.ChargingPileEntity;
|
||||
import com.navinfo.outdoor.room.InsertAndUpdateUtils;
|
||||
import com.navinfo.outdoor.room.PoiDao;
|
||||
import com.navinfo.outdoor.room.PoiDatabase;
|
||||
import com.navinfo.outdoor.room.PoiEntity;
|
||||
@ -107,6 +108,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
private LatLng latLng;
|
||||
private RelativeLayout linearExist;
|
||||
private Spinner spinnerExist;
|
||||
private Integer body;
|
||||
|
||||
public static ChargingStationFragment newInstance(Bundle bundle) {
|
||||
ChargingStationFragment fragment = new ChargingStationFragment();
|
||||
@ -369,8 +371,9 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
phoneData.add(showPoiEntity.getTelPhone());
|
||||
poiBeans.add(new PoiBean("电话*", telPhone, R.drawable.icon_add_bg));
|
||||
} 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);
|
||||
linearExist.setVisibility(View.VISIBLE);
|
||||
if (showPoiEntity.getPhotoInfo() != null) {
|
||||
@ -403,7 +406,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
List<ChargingPileEntity> chargingPile = chargingPileDao.getChargingPile();
|
||||
for (int i = 0; i < chargingPile.size(); i++) {
|
||||
ChargingPileEntity chargingPileEntity = chargingPile.get(i);
|
||||
if (showPoiEntity.getTaskId() == chargingPileEntity.getFid()) {
|
||||
if (showPoiEntity.getId() == chargingPileEntity.getFid()) {
|
||||
chargingPileEntities.add(chargingPileEntity);
|
||||
}
|
||||
}
|
||||
@ -416,7 +419,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
|
||||
}
|
||||
}).start();
|
||||
if (showPoiEntity.getTaskId()!=0){
|
||||
if (showPoiEntity.getId()!=0){
|
||||
initPile();
|
||||
}
|
||||
}
|
||||
@ -600,10 +603,16 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
poiDao.insertPoiEntity(poiEntity);
|
||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
chargingStationSaveByWork(poiEntity);
|
||||
}
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
chargingStationSaveByWork(poiEntity);
|
||||
|
||||
// onBackPressed();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show();
|
||||
@ -627,7 +636,44 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
obtain.obj = false;
|
||||
EventBus.getDefault().post(obtain);
|
||||
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;
|
||||
case R.id.tv_examine:
|
||||
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) {
|
||||
showLoadingDialog();
|
||||
HttpParams httpParams = new HttpParams();
|
||||
@ -682,9 +733,22 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
@Override
|
||||
public void onSuccess(ChargingStationBean chargingStationBean, int id) {
|
||||
dismissLoadingDialog();
|
||||
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
|
||||
// body = poiSaveBean.getBody();
|
||||
Log.d("TAG", " 其他其他其他其他"+chargingStationBean.getBody());
|
||||
body = chargingStationBean.getBody();
|
||||
poiEntity.setBodyId(body);
|
||||
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
|
||||
@ -760,6 +824,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
@Override
|
||||
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
|
||||
initStationSharePre();
|
||||
}
|
||||
|
||||
@ -859,11 +924,10 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a");
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivPanorama.setTag(takePhotoPath);
|
||||
ivPanorama.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
|
||||
} else if (requestCode == 102 && resultCode == RESULT_OK) {
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||
@ -880,11 +944,10 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "b");
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "b",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivName.setTag(takePhotoPath);
|
||||
ivName.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
|
||||
} else if (requestCode == 103 && resultCode == RESULT_OK) {
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||
@ -901,7 +964,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c");
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivInternal.setTag(takePhotoPath);
|
||||
ivInternal.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
@ -921,7 +984,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "d");
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "d",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivElse.setTag(takePhotoPath);
|
||||
ivElse.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
@ -941,7 +1004,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "e");
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "e",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivScutcheon.setTag(takePhotoPath);
|
||||
ivScutcheon.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ import com.navinfo.outdoor.base.BaseFragment;
|
||||
import com.navinfo.outdoor.bean.PolygonTaskBean;
|
||||
import com.navinfo.outdoor.bean.ReceivedBean;
|
||||
import com.navinfo.outdoor.bean.ReceivedPoiBean;
|
||||
import com.navinfo.outdoor.bean.TaskByNetBean;
|
||||
import com.navinfo.outdoor.bean.UnPolygonTaskBean;
|
||||
import com.navinfo.outdoor.http.Callback;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
@ -131,9 +132,9 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
btnFinishGather.setVisibility(View.GONE);
|
||||
break;
|
||||
case 2://已保存
|
||||
btnCancelGet.setVisibility(View.GONE);
|
||||
btnCancelGet.setVisibility(View.VISIBLE);
|
||||
btnGetTask.setVisibility(View.GONE);
|
||||
btnGather.setVisibility(View.VISIBLE);
|
||||
btnGather.setVisibility(View.GONE);
|
||||
btnFinishGather.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
case 3://已提交
|
||||
@ -155,11 +156,19 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
if (type == 6) {
|
||||
initUnPolygonTask(HttpInterface.UNRECEIVED_POLYGON_TASK, poiEntity.getTaskId());
|
||||
} else {
|
||||
poiEntity.setTaskStatus(0);
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
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();
|
||||
}
|
||||
@ -168,22 +177,20 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
case R.id.btn_get_task://领取任务
|
||||
if (poiEntity != null) {
|
||||
int type = poiEntity.getType();
|
||||
if (type == 6) {
|
||||
if (type == 6) {//面状任务的领取类型
|
||||
initPolygonTask(HttpInterface.RECEIVED_POLYGON_TASK, poiEntity.getTaskId(), false);
|
||||
} else {
|
||||
btnGetTask.setVisibility(View.GONE);
|
||||
btnCancelGet.setVisibility(View.VISIBLE);
|
||||
//网络请求:
|
||||
if (poiEntity.getType() == 1) {//poi的领取类型
|
||||
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK, poiEntity.getTaskId(), false);
|
||||
} else if (poiEntity.getType() == 2) {//充电站的领取类型
|
||||
chargingTaskByWork(HttpInterface.RECEIVED_CTASK, poiEntity.getTaskId(), false);
|
||||
} else if (poiEntity.getType() == 5) {//其他的领取类型
|
||||
receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK, poiEntity.getTaskId(), false);
|
||||
}
|
||||
} else if (type == 1) {//poi的领取类型
|
||||
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK, poiEntity.getTaskId(), false);
|
||||
} else if (type == 2) {//充电站的领取类型
|
||||
chargingTaskByWork(HttpInterface.RECEIVED_CTASK, poiEntity.getTaskId(), false);
|
||||
} else if (type == 3) {//poi录像的领取类型
|
||||
taskByNet(HttpInterface.RECEIVED_POI_VIDEO_TASK,poiEntity.getTaskId(),false);
|
||||
} else if (type == 4) {//道路的领取类型
|
||||
taskByNet(HttpInterface.RECEIVED_ROAD_TASK,poiEntity.getTaskId(),false);
|
||||
} else if (type == 5) {//其他的领取类型
|
||||
receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK, poiEntity.getTaskId(), false);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case R.id.btn_gather://立即采集
|
||||
if (poiEntity != null) {
|
||||
@ -193,19 +200,30 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
if (taskStatus != 1) {
|
||||
initPolygonTask(HttpInterface.RECEIVED_POLYGON_TASK, poiEntity.getTaskId(), true);
|
||||
} 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);
|
||||
btnGather.setVisibility(View.GONE);
|
||||
} else if (type== 1) {//poi的领取类型
|
||||
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;
|
||||
@ -215,13 +233,19 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
if (type == 6) {
|
||||
initSubmitPolygonTask(HttpInterface.SUBMIT_POLYGON_TASK, poiEntity.getTaskId());
|
||||
} else {
|
||||
btnGather.setVisibility(View.VISIBLE);
|
||||
btnFinishGather.setVisibility(View.GONE);
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
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();
|
||||
}
|
||||
@ -286,15 +310,17 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
poiDao.insertPoiEntity(chargingListEntity);
|
||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), chargingListEntity);
|
||||
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;
|
||||
@ -334,7 +360,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
@Override
|
||||
public void onSuccess(PolygonTaskBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
if (response.getCode() == 200) {
|
||||
if (response.getCode() == 200) {// 0.未领取 1.已领取,2.未保存(保存到本地但未提交成功),3.已保存(保存到本地提交成功),4已上传(结束采集),
|
||||
PolygonTaskBean.BodyBean listBean = response.getBody();
|
||||
PoiEntity polygonEntity = new PoiEntity();
|
||||
polygonEntity.setTaskId(listBean.getId());
|
||||
@ -360,15 +386,19 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
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();
|
||||
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
|
||||
public void run() {
|
||||
poiDao.deleteFormTaskID(taskId);
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
btnGetTask.setVisibility(View.VISIBLE);
|
||||
btnCancelGet.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
btnGetTask.setVisibility(View.VISIBLE);
|
||||
btnCancelGet.setVisibility(View.GONE);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -423,7 +459,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
/**
|
||||
* @param url 面妆任务立即采集
|
||||
*/
|
||||
private void initCompleteTask(String url, int taskId) {
|
||||
private void initCompleteTask(String url, int taskId, PoiEntity poiEntity) {
|
||||
if (taskId == 0) {
|
||||
Toast.makeText(getContext(), "无此任务", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
@ -439,8 +475,20 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
public void onSuccess(UnPolygonTaskBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
if (response.getCode() == 200) {
|
||||
btnGather.setVisibility(View.GONE);
|
||||
btnFinishGather.setVisibility(View.VISIBLE);
|
||||
poiEntity.setTaskStatus(2);
|
||||
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
|
||||
public void run() {
|
||||
poiDao.deleteFormTaskID(taskId);
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
btnGather.setVisibility(View.VISIBLE);
|
||||
btnFinishGather.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
}
|
||||
}).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) {
|
||||
showLoadingDialog();
|
||||
@ -508,50 +562,55 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
@Override
|
||||
public void onSuccess(ReceivedPoiBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
ReceivedPoiBean.BodyBean listBean = response.getBody();
|
||||
PoiEntity poiListEntity = new PoiEntity();
|
||||
poiListEntity.setTaskId(listBean.getId());
|
||||
poiListEntity.setName(listBean.getName());
|
||||
poiListEntity.setAddress(listBean.getAddress());
|
||||
poiListEntity.setTelPhone(listBean.getTelephone() + "");
|
||||
poiListEntity.setType(Integer.valueOf(listBean.getType()));
|
||||
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() {
|
||||
btnFinishGather.setVisibility(View.VISIBLE);
|
||||
if (isSaver) {
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.GATHER_GET_MAP;
|
||||
obtain.obj = poiListEntity;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
}
|
||||
});
|
||||
if (response.getCode()==200){
|
||||
ReceivedPoiBean.BodyBean listBean = response.getBody();
|
||||
PoiEntity poiListEntity = new PoiEntity();
|
||||
poiListEntity.setTaskId(listBean.getId());
|
||||
poiListEntity.setName(listBean.getName());
|
||||
poiListEntity.setAddress(listBean.getAddress());
|
||||
poiListEntity.setType(Integer.valueOf(listBean.getType()));
|
||||
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 + "");
|
||||
}
|
||||
}).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
|
||||
@ -562,7 +621,79 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
}
|
||||
}).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) {
|
||||
return String.format("%.2f", value).toString();
|
||||
}
|
||||
|
@ -212,7 +212,7 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == 400 && resultCode == RESULT_OK) {
|
||||
gatheringPath = PhotoPathUtil.getTakePhotoPath(data, "e");
|
||||
gatheringPath = PhotoPathUtil.getTakePhotoPath(data, "","");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
private PoiDao poiDao;
|
||||
private PoiEntity showPoiEntity;
|
||||
private LatLng latLng;
|
||||
private int station_type = 0;
|
||||
private int station_type = 6;
|
||||
String[] spinner = new String[]{"存在", "不存在", "无法验证"};
|
||||
private RelativeLayout linearExist;
|
||||
private Spinner spinnerExist;
|
||||
@ -180,18 +180,17 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
checkPot.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
if (isChecked){
|
||||
if (isChecked) {
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.MAIN_OTHER;
|
||||
obtain.obj = latLng;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}else {
|
||||
} else {
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.MAIN_CHECKED_OTHER;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
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) {
|
||||
switch (position) {
|
||||
case 0:
|
||||
|
||||
break;
|
||||
case 1:
|
||||
|
||||
break;
|
||||
case 2:
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -264,9 +266,13 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
if (describe != null && !describe.equals("")) {
|
||||
editOtherDescribe.setText(describe);
|
||||
}
|
||||
linearExist.setVisibility(View.VISIBLE);
|
||||
|
||||
if (showPoiEntity.getName() != null) {
|
||||
linearExist.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
body = showPoiEntity.getBodyId();
|
||||
|
||||
int station_type = showPoiEntity.getStation_type();
|
||||
spinnerOther.setSelection(station_type, true);
|
||||
if (showPoiEntity.getPhotoInfo() != null) {
|
||||
@ -321,7 +327,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
} else {
|
||||
String encode = Geohash.getInstance().encode(latLng.latitude,latLng.longitude);
|
||||
String encode = Geohash.getInstance().encode(latLng.latitude, latLng.longitude);
|
||||
poiEntity.setGeoWkt(encode);
|
||||
poiEntity.setX(String.valueOf(latLng.longitude));
|
||||
poiEntity.setY(String.valueOf(latLng.latitude));
|
||||
@ -370,7 +376,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
|
||||
}
|
||||
}).start();
|
||||
// onBackPressed();
|
||||
// onBackPressed();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@ -397,9 +403,9 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
if (tagPictures != null) {
|
||||
otherUploadList.add(new File(tagPictures));
|
||||
}
|
||||
if (body!=0){
|
||||
if (body != 0) {
|
||||
otherUploadByNet(body, otherUploadList);
|
||||
}else {
|
||||
} else {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -418,7 +424,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
}
|
||||
|
||||
private void otherUploadByNet(int body, List<File> otherUploadList) {
|
||||
if (body == 0 ){
|
||||
if (body == 0) {
|
||||
Toast.makeText(getActivity(), "没有保存不能上传", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
@ -442,7 +448,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
public void onError(Response<OtherUploadPicBean> response) {
|
||||
super.onError(response);
|
||||
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());
|
||||
}
|
||||
});
|
||||
@ -508,7 +514,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
//获取Editor对象
|
||||
SharedPreferences.Editor edit = poi.edit();
|
||||
//根据要保存的数据的类型,调用对应的put方法,
|
||||
PoiEntity poiEntity =showPoiEntity;
|
||||
PoiEntity poiEntity = showPoiEntity;
|
||||
ArrayList<Info> arrayList = new ArrayList<>();
|
||||
String name = editTaskName.getText().toString().trim();//名称
|
||||
if (name != null && !name.equals("")) {
|
||||
@ -574,7 +580,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
});
|
||||
} else {
|
||||
//照片路径
|
||||
takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a");
|
||||
takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivPicture.setTag(takePhotoPath);
|
||||
ivPicture.setImageBitmap(bitmap);//显示图像
|
||||
|
||||
@ -596,7 +602,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
});
|
||||
} else {
|
||||
//照片路径
|
||||
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b");
|
||||
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivPictures.setTag(takePhotoPath2);
|
||||
ivPictures.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
|
@ -58,10 +58,8 @@ import com.navinfo.outdoor.room.PoiEntity;
|
||||
import com.navinfo.outdoor.util.Geohash;
|
||||
import com.navinfo.outdoor.util.PhotoPathUtil;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
@ -274,62 +272,59 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
private void initShowPoi() {
|
||||
// 添加信息:
|
||||
showPoiEntity = (PoiEntity) getArguments().getSerializable("poiEntity");
|
||||
if (showPoiEntity != null) {
|
||||
String name = showPoiEntity.getName();//名称
|
||||
if (name != null && !name.equals("")) {
|
||||
editNameContent.setText(name + "");
|
||||
}
|
||||
String address = showPoiEntity.getAddress();//地址
|
||||
if (address != null && !address.equals("")) {
|
||||
editSiteContent.setText(address);
|
||||
}
|
||||
String x = showPoiEntity.getX();
|
||||
String y = showPoiEntity.getY();
|
||||
if (x != null && y != null) {
|
||||
latLng = new LatLng();
|
||||
latLng.setLatitude(Double.parseDouble(y));
|
||||
latLng.setLongitude(Double.parseDouble(x));
|
||||
}
|
||||
String describe = showPoiEntity.getDescribe();//任务描述
|
||||
if (describe != null && !describe.equals("")) {
|
||||
editDescribe.setText(describe);
|
||||
}
|
||||
String telPhone = showPoiEntity.getTelPhone();
|
||||
if (telPhone != null && !telPhone.equals("")) {
|
||||
phoneData.add(showPoiEntity.getTelPhone());
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
String name = showPoiEntity.getName();//名称
|
||||
if (name != null && !name.equals("")) {
|
||||
editNameContent.setText(name + "");
|
||||
}
|
||||
String address = showPoiEntity.getAddress();//地址
|
||||
if (address != null && !address.equals("")) {
|
||||
editSiteContent.setText(address);
|
||||
}
|
||||
String x = showPoiEntity.getX();
|
||||
String y = showPoiEntity.getY();
|
||||
if (x != null && y != null) {
|
||||
latLng = new LatLng();
|
||||
latLng.setLatitude(Double.parseDouble(y));
|
||||
latLng.setLongitude(Double.parseDouble(x));
|
||||
}
|
||||
String describe = showPoiEntity.getDescribe();//任务描述
|
||||
if (describe != null && !describe.equals("")) {
|
||||
editDescribe.setText(describe);
|
||||
}
|
||||
String telPhone = showPoiEntity.getTelPhone();
|
||||
if (telPhone != null && !telPhone.equals("")) {
|
||||
phoneData.add(showPoiEntity.getTelPhone());
|
||||
poiBeans.add(new PoiBean("电话*", telPhone, R.drawable.icon_add_bg));
|
||||
} else {
|
||||
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));
|
||||
}
|
||||
|
||||
if (body!=null){
|
||||
if (body != null) {
|
||||
poiUploadByNetWork(body, poiPicList);
|
||||
}else {
|
||||
} else {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -577,7 +572,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
public void onError(Response<OtherUploadPicBean> response) {
|
||||
super.onError(response);
|
||||
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() + "");
|
||||
}
|
||||
});
|
||||
@ -618,7 +613,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -653,6 +647,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
poiEntity.setAddress(site);
|
||||
}
|
||||
if (latLng != null) {
|
||||
String encode = Geohash.getInstance().encode(latLng.latitude, latLng.longitude);
|
||||
poiEntity.setGeoWkt(encode);
|
||||
poiEntity.setX(String.valueOf(latLng.longitude));
|
||||
poiEntity.setY(String.valueOf(latLng.latitude));
|
||||
}
|
||||
@ -725,7 +721,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
} else {
|
||||
takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data,"a");
|
||||
takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data, "a",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivPanorama.setTag(takePhotoPath1);
|
||||
ivPanorama.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
@ -745,7 +741,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
} else {
|
||||
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b");
|
||||
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivName.setTag(takePhotoPath2);
|
||||
ivName.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
@ -765,7 +761,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
} else {
|
||||
takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "c");
|
||||
takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivInternal.setTag(takePhotoPath3);
|
||||
ivInternal.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
@ -785,7 +781,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
} else {
|
||||
takePhotoPath4 = PhotoPathUtil.getTakePhotoPath(data, "d");
|
||||
takePhotoPath4 = PhotoPathUtil.getTakePhotoPath(data, "d",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivCard.setTag(takePhotoPath4);
|
||||
ivCard.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
@ -805,7 +801,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
} else {
|
||||
takePhotoPath5 = PhotoPathUtil.getTakePhotoPath(data, "e");
|
||||
takePhotoPath5 = PhotoPathUtil.getTakePhotoPath(data, "e",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
||||
ivElse.setTag(takePhotoPath5);
|
||||
ivElse.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
@ -817,7 +813,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
initPoiSharePre();
|
||||
Log.d("TAG", "onSaveInstanceState: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -237,7 +237,9 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
int type = roadExtend.getType();
|
||||
showPictureType(type);
|
||||
}
|
||||
linearExist.setVisibility(View.VISIBLE);
|
||||
if (showPoiEntity.getName()!=null){
|
||||
linearExist.setVisibility(View.VISIBLE);
|
||||
}
|
||||
String describe = showPoiEntity.getDescribe();//任务描述
|
||||
if (describe != null && !describe.equals("")) {
|
||||
etDesc.setText(describe);
|
||||
@ -301,7 +303,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
@Override
|
||||
public void onGranted(List<String> permissions, boolean all) {
|
||||
if (all) {
|
||||
PoiEntity poiEntity = new PoiEntity();
|
||||
PoiEntity poiEntity = showPoiEntity;
|
||||
String roadName = etRoadName.getText().toString().trim();
|
||||
if (roadName == null || roadName.equals("")) {
|
||||
Toast.makeText(getContext(), "请输入poi录像 名称", Toast.LENGTH_SHORT).show();
|
||||
|
@ -205,7 +205,9 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
int type= roadExtend.getType();
|
||||
showPictureType(type);
|
||||
}
|
||||
linearExist.setVisibility(View.VISIBLE);
|
||||
if (showPoiEntity.getName()!=null){
|
||||
linearExist.setVisibility(View.VISIBLE);
|
||||
}
|
||||
String describe = showPoiEntity.getDescribe();//任务描述
|
||||
if (describe != null && !describe.equals("")) {
|
||||
etDesc.setText(describe);
|
||||
@ -270,7 +272,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
@Override
|
||||
public void onGranted(List<String> permissions, boolean all) {
|
||||
if (all) {
|
||||
PoiEntity poiEntity = new PoiEntity();
|
||||
PoiEntity poiEntity = showPoiEntity;
|
||||
String roadName = etRoadName.getText().toString().trim();
|
||||
if (roadName == null || roadName.equals("")) {
|
||||
Toast.makeText(getContext(), "请输入道路 名称", Toast.LENGTH_SHORT).show();
|
||||
|
@ -26,6 +26,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.github.lazylibrary.util.FileUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.hjq.permissions.OnPermissionCallback;
|
||||
import com.hjq.permissions.Permission;
|
||||
@ -179,7 +180,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
tencentMap.setMapStyle(2);
|
||||
//启用3d视图
|
||||
tencentMap.setBuilding3dEffectEnable(true);
|
||||
|
||||
//获取地图UI 设置对象
|
||||
UiSettings uiSettings = tencentMap.getUiSettings();
|
||||
//设置logo的大小
|
||||
@ -204,7 +204,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
tencentMap.setOnMarkerClickListener(new TencentMap.OnMarkerClickListener() {
|
||||
@Override
|
||||
public boolean onMarkerClick(Marker marker) {
|
||||
if (marker.getTitle().equals("本地")) {//是本地数据直接跳转到采集页面
|
||||
if (marker.getTitle() != null && !marker.getTitle().equals("")) {//是本地数据直接跳转到采集页面
|
||||
PoiEntity poiEntity = (PoiEntity) marker.getTag();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
@ -229,28 +229,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
OtherFragment otherFragment = OtherFragment.newInstance(bundle);
|
||||
showSlidingFragment(otherFragment);
|
||||
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 {
|
||||
JobSearchBean.BodyBean.ListBean listBean = (JobSearchBean.BodyBean.ListBean) marker.getTag();
|
||||
PoiEntity poiListEntity = new PoiEntity();
|
||||
@ -263,15 +245,22 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
poiListEntity.setDist(listBean.getDist());
|
||||
poiListEntity.setType(Integer.valueOf(listBean.getType()));
|
||||
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 + "");
|
||||
}
|
||||
initMarker(poiListEntity, 1);
|
||||
initMarker(poiListEntity);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -420,7 +409,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
Log.d("面妆任务", "onSuccess: " + planarMarker);
|
||||
planarMarker.setTag(listBean);
|
||||
removables.add(planarMarker);
|
||||
planarMarker.setTitle("面妆任务");//1:面妆任务
|
||||
planarMarker.setClickable(true);
|
||||
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.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
|
||||
frameLayout.setVisibility(View.VISIBLE);
|
||||
@ -448,8 +436,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
fragmentTransaction = supportFragmentManager.beginTransaction();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
bundle.putBoolean("boolean", false);
|
||||
bundle.putInt("aSave", aInt);
|
||||
gatherGetFragment = GatherGetFragment.newInstance(bundle);
|
||||
fragmentTransaction.replace(R.id.frame_layout, gatherGetFragment);
|
||||
fragmentTransaction.commit();
|
||||
@ -476,7 +462,54 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
showAllPoi.addAll(allTaskStatus);
|
||||
for (int i = 0; i < allTaskStatus.size(); 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())) {
|
||||
case 1://poi
|
||||
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_have_bg);
|
||||
@ -484,7 +517,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
.flat(true)
|
||||
.clockwise(false));
|
||||
poiMarker.setClickable(true);
|
||||
poiMarker.setTitle("本地");//1:本地
|
||||
poiMarker.setTitle(poiEntity.getName() + "");
|
||||
poiMarker.setTag(poiEntity);
|
||||
removablesLocality.add(poiMarker);
|
||||
break;
|
||||
@ -494,7 +527,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
.flat(true)
|
||||
.clockwise(false));
|
||||
stationMarker.setClickable(true);
|
||||
stationMarker.setTitle("本地");//1:本地
|
||||
stationMarker.setTitle(poiEntity.getName() + "");
|
||||
stationMarker.setTag(poiEntity);
|
||||
removablesLocality.add(stationMarker);
|
||||
break;
|
||||
@ -504,7 +537,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
.flat(true)
|
||||
.clockwise(false));
|
||||
poiVideoMarker.setClickable(true);
|
||||
poiVideoMarker.setTitle("本地");//1:本地
|
||||
poiVideoMarker.setTitle(poiEntity.getName() + "");
|
||||
poiVideoMarker.setTag(poiEntity);
|
||||
removablesLocality.add(poiVideoMarker);
|
||||
break;
|
||||
@ -514,7 +547,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
.flat(true)
|
||||
.clockwise(false));
|
||||
roadMarker.setClickable(true);
|
||||
roadMarker.setTitle("本地");//1:本地
|
||||
roadMarker.setTitle(poiEntity.getName() + "");
|
||||
roadMarker.setTag(poiEntity);
|
||||
removablesLocality.add(roadMarker);
|
||||
break;
|
||||
@ -524,7 +557,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
.flat(true)
|
||||
.clockwise(false));
|
||||
otherMarker.setClickable(true);
|
||||
otherMarker.setTitle("本地");//1:本地
|
||||
otherMarker.setTitle(poiEntity.getName() + "");
|
||||
otherMarker.setTag(poiEntity);
|
||||
removablesLocality.add(otherMarker);
|
||||
break;
|
||||
@ -534,7 +567,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
.clockwise(false)
|
||||
.flat(true));
|
||||
planarMarker.setClickable(true);
|
||||
planarMarker.setTitle("本地");//1:本地
|
||||
planarMarker.setTitle(poiEntity.getName() + "");
|
||||
planarMarker.setTag(poiEntity);
|
||||
removablesLocality.add(planarMarker);
|
||||
break;
|
||||
@ -655,7 +688,11 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
PoiEntity poiEntity = (PoiEntity) data.obj;
|
||||
if (poiEntity.getX() != null && poiEntity.getY() != null) {
|
||||
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.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
|
||||
|
@ -206,19 +206,19 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
||||
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == 100 && resultCode == RESULT_OK) {
|
||||
takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data, "a");
|
||||
takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data, "a","");
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
//从附加值中获取返回的图像
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");
|
||||
ivAttestation1.setImageBitmap(bitmap);//显示图像
|
||||
} else if (requestCode == 200 && resultCode == RESULT_OK) {
|
||||
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b");
|
||||
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b","");
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
//从附加值中获取返回的图像
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");
|
||||
ivAttestation2.setImageBitmap(bitmap);//显示图像
|
||||
}else if (requestCode == 300 && resultCode == RESULT_OK) {
|
||||
takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "c");
|
||||
takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "c","");
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
//从附加值中获取返回的图像
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");
|
||||
|
@ -23,94 +23,58 @@ public class HttpInterface {
|
||||
public static final String IPm4 = "http://172.23.139.4:8001/m4";
|
||||
|
||||
public static final String MSG_CONTENT = IPm4 + "/1/msg_content";//发现 -富文本详情页请求
|
||||
|
||||
//172.23.139.4:8001/m4/userAuth/add
|
||||
public static final String USER_AUTH_ADD = IPm4 + "/userAuth/add"; //实名认证
|
||||
|
||||
//172.23.139.4:8001/m4/user/update
|
||||
public static final String USER_UPDATE = IPm4 + "/user/update";//用户资料
|
||||
|
||||
//172.23.139.4:8001/m4/userBankcard/update
|
||||
public static final String USER_BANKCARD_UP_DATA = IPm4 + "/userBankcard/update"; //绑定银行卡
|
||||
|
||||
|
||||
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/";
|
||||
|
||||
public static final String IPm5 = "http://172.23.139.4:8004/";
|
||||
//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
|
||||
public static final String USER_PRICE_EXCHANGE = IPm5 + "userPriceExchange";//我的-财务信息-提现
|
||||
|
||||
|
||||
public static final String IPm6 = "http://172.23.139.4:8003/othertask/1/";
|
||||
|
||||
//172.23.139.4:8003/othertask/1/receivedOthertask/5001
|
||||
public static final String RECEIVED_OTHER_TASK = IPm6 + "receivedOthertask";//其他-领取任务
|
||||
|
||||
|
||||
public static final String IPm7 = "http://172.23.139.4:8003/poitask/1/";
|
||||
|
||||
public static final String IPm6 = "http://172.23.139.4:8003/";
|
||||
//172.23.139.4:8003/m4/task/1/getList
|
||||
public static final String TASK_LIST = IPm6 + "m4/task/1/getList"; //任务搜索
|
||||
//172.23.139.4:8003/othertask/1/receivedOthertask
|
||||
public static final String RECEIVED_OTHER_TASK = IPm6 + "othertask/1/receivedOthertask";//其他-领取任务
|
||||
//172.23.139.4:8003/poitask/1/receivedPoitask/1
|
||||
public static final String RECEIVED_POI_TASK = IPm7 + "receivedPoitask";//poi-领取任务
|
||||
|
||||
|
||||
public static final String IPm8 = "http://172.23.139.4:8003/poitask/1/";
|
||||
public static final String RECEIVED_POI_TASK = IPm6 + "poitask/1/receivedPoitask";//poi-领取任务
|
||||
//172.23.139.4:8003/poitask/1/submitPoitask?taskId=5001&name=测试修改名称&address=测试修改地址&existence=1&geo=1rn7exd5uhxy&memo=测试备注
|
||||
|
||||
public static final String SUBMIT_POI_TASK = IPm8 + "submitPoitask";//poi-保存本地
|
||||
|
||||
public static final String IPm9 = "http://172.23.139.4:8003/othertask/1/";
|
||||
public static final String SUBMIT_POI_TASK = IPm6 + "poitask/1/submitPoitask";//poi-保存本地
|
||||
//172.23.139.4:8003/othertask/1/submitOhtertask?taskId=5001&name=测试修改名称&address=测试修改地址&existence=1&geo=1rn7exd5uhxy&memo=测试备注
|
||||
|
||||
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/";
|
||||
|
||||
public static final String SUBMIT_OTHER_TASK = IPm6 + "othertask/1/submitOthertask";//其他-保存本地
|
||||
//172.23.139.4:8003/othertask/1/uploadpic
|
||||
public static final String OTHER_TASK_UPLOAD_PIC=IPm11+"uploadpic";//其他-上传
|
||||
|
||||
|
||||
public static final String IPm12= "http://172.23.139.4:8003/ctask/1/";
|
||||
|
||||
public static final String OTHER_TASK_UPLOAD_PIC=IPm6+"othertask/1/uploadpic";//其他-上传
|
||||
//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
|
||||
public static final String SUBMIT_CTASK=IPm12+"submitCtask";//充电站-保存本地
|
||||
|
||||
public static final String IPm13= "http://172.23.139.4:8003/poitask/1/";
|
||||
|
||||
public static final String SUBMIT_CTASK=IPm6+"ctask/1/submitCtask";//充电站-保存本地
|
||||
//172.23.139.4:8003/poitask/1/uploadpic
|
||||
public static final String POI_TASK_UPLOAD_PIC=IPm13+"uploadpic";//poi-上传
|
||||
|
||||
|
||||
public static final String IPm14 = "http://172.23.139.4:8003/poivideotask/1/";
|
||||
|
||||
// 172.23.139.4:8003/poivideotask/1/submitPoivideotask
|
||||
public static final String INSIDE_API_LIST = IPm14+"submitPoivideotask";//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";//道路任务获取
|
||||
//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
|
||||
public static final String INSIDE_API_LIST = IPm6+"poivideotask/1/submitPoivideotask";//poi录像 保存
|
||||
//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";//结束采集
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -32,7 +32,7 @@ public class ChargingPileEntity implements Serializable {
|
||||
private String memo;//备注 默认为空
|
||||
@TypeConverters(StringTypeConverter.class)
|
||||
private List<String> photos;//照片组
|
||||
private int fid;//对应充电站id
|
||||
private long fid;//对应充电站id
|
||||
|
||||
public int getPileId() {
|
||||
return pileId;
|
||||
@ -106,11 +106,11 @@ public class ChargingPileEntity implements Serializable {
|
||||
this.photos = photos;
|
||||
}
|
||||
|
||||
public int getFid() {
|
||||
public long getFid() {
|
||||
return fid;
|
||||
}
|
||||
|
||||
public void setFid(int fid) {
|
||||
public void setFid(long fid) {
|
||||
this.fid = fid;
|
||||
}
|
||||
}
|
||||
|
@ -31,10 +31,24 @@ public class PoiEntity implements Serializable {
|
||||
private String extend;//添加字段
|
||||
private boolean checked;
|
||||
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() {
|
||||
return geoWkt;
|
||||
}
|
||||
|
||||
public void setGeoWkt(String geoWkt) {
|
||||
this.geoWkt = geoWkt;
|
||||
}
|
||||
@ -55,21 +69,6 @@ public class PoiEntity implements Serializable {
|
||||
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() {
|
||||
return bodyId;
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
|
||||
@ -13,13 +14,14 @@ import java.io.FileOutputStream;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 获取图片的真实路径
|
||||
*/
|
||||
public class PhotoPathUtil {
|
||||
|
||||
public static String getTakePhotoPath(Intent data, String d) {
|
||||
public static String getTakePhotoPath(Intent data,String d,String coord) {
|
||||
Bitmap photo = null;
|
||||
Uri uri = data.getData();
|
||||
if (uri != null) {
|
||||
@ -41,7 +43,7 @@ public class PhotoPathUtil {
|
||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
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);
|
||||
// 生成图片文件
|
||||
|
Loading…
x
Reference in New Issue
Block a user