加密和url替换

This commit is contained in:
wds 2021-08-06 09:53:57 +08:00
parent e22a52e002
commit 834fce7065
24 changed files with 897 additions and 653 deletions

View File

@ -19,16 +19,12 @@ import java.util.List;
public class PoiTaskAdapter extends RecyclerView.Adapter<PoiTaskAdapter.ViewHolder> { public class PoiTaskAdapter extends RecyclerView.Adapter<PoiTaskAdapter.ViewHolder> {
private Context context; private Context context;
private List<HasSubmitBean.BodyBean.ListBean> listBeans = new ArrayList<>(); private List<HasSubmitBean.BodyBean.ListBean> listBeans ;
public PoiTaskAdapter(Context context) {
public PoiTaskAdapter(Context context, List<HasSubmitBean.BodyBean.ListBean> listBeans) {
this.context = context; this.context = context;
} this.listBeans = listBeans;
public void setListBeans(List<HasSubmitBean.BodyBean.ListBean> listBeans) {
this.listBeans.addAll(listBeans);
notifyDataSetChanged();
} }
@NonNull @NonNull

View File

@ -79,11 +79,11 @@ public class UserApplication extends Application {
//builder.cookieJar(new CookieJarImpl(new MemoryCookieStore())); //builder.cookieJar(new CookieJarImpl(new MemoryCookieStore()));
//超时时间设置默认60秒 //超时时间设置默认60秒
//全局的读取超时时间 //全局的读取超时时间
builder.readTimeout(5000, TimeUnit.MILLISECONDS); builder.readTimeout(50000, TimeUnit.MILLISECONDS);
//全局的写入超时时间 //全局的写入超时时间
builder.writeTimeout(5000, TimeUnit.MILLISECONDS); builder.writeTimeout(50000, TimeUnit.MILLISECONDS);
//全局的连接超时时间 //全局的连接超时时间
builder.connectTimeout(5000, TimeUnit.MILLISECONDS); builder.connectTimeout(50000, TimeUnit.MILLISECONDS);
OkGo.getInstance().init(this) OkGo.getInstance().init(this)
.setOkHttpClient(builder.build()) .setOkHttpClient(builder.build())
//全局统一缓存模式默认不使用缓存可以不传 //全局统一缓存模式默认不使用缓存可以不传

View File

@ -32,6 +32,7 @@ public abstract class BaseFragment extends Fragment implements FragmentBackHandl
private AlertDialog alertDialog; private AlertDialog alertDialog;
public View mView; public View mView;
protected FragmentManager supportFragmentManager;
@Nullable @Nullable

View File

@ -9,6 +9,7 @@ import android.widget.Toast;
import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import com.lzy.okgo.model.HttpParams;
import com.navinfo.outdoor.R; import com.navinfo.outdoor.R;
import com.navinfo.outdoor.adapter.CapacityItemAdapter; import com.navinfo.outdoor.adapter.CapacityItemAdapter;
import com.navinfo.outdoor.api.Constant; import com.navinfo.outdoor.api.Constant;
@ -90,6 +91,7 @@ public class CapacityEvaluationFragment2 extends BaseFragment implements View.On
.Builder(getActivity()) .Builder(getActivity())
.url(HttpInterface.MSG_LISt) .url(HttpInterface.MSG_LISt)
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.params(new HttpParams())
.cls(TaskPrefectureBean.class) .cls(TaskPrefectureBean.class)
.getRequest(new Callback<TaskPrefectureBean>() { .getRequest(new Callback<TaskPrefectureBean>() {
@Override @Override

View File

@ -608,6 +608,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
.url(HttpInterface.GET_PHONES) .url(HttpInterface.GET_PHONES)
.params(new HttpParams("geo", encode)) .params(new HttpParams("geo", encode))
.cls(GetPhoneBean.class) .cls(GetPhoneBean.class)
.params(new HttpParams())
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.getRequest(new Callback<GetPhoneBean>() { .getRequest(new Callback<GetPhoneBean>() {
@Override @Override
@ -823,9 +824,12 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
} }
try { try {
HttpParams httpParams=new HttpParams();
httpParams.put("auditId",chargingPileEntity.getBodyId());
Response execute = OkGoBuilder.getInstance().url(HttpInterface.CS_TASK_UP_LOAD_PIC) Response execute = OkGoBuilder.getInstance().url(HttpInterface.CS_TASK_UP_LOAD_PIC)
.params(httpParams)
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.fileList(chargingPileFileList).postFileSynchronization((int) chargingPileEntity.getBodyId()); .fileList(chargingPileFileList).postFileSynchronization();
String pileUpLoadResultStr = execute.body().string(); String pileUpLoadResultStr = execute.body().string();
PoiUploadBean uploadBeanResult = new Gson().fromJson(pileUpLoadResultStr, PoiUploadBean.class); PoiUploadBean uploadBeanResult = new Gson().fromJson(pileUpLoadResultStr, PoiUploadBean.class);
if (uploadBeanResult != null) { if (uploadBeanResult != null) {
@ -1011,14 +1015,16 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
getActivity().runOnUiThread(new Runnable() { getActivity().runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
HttpParams httpParams=new HttpParams();
httpParams.put("auditId",poiEntity.getBodyId());
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())
.url(HttpInterface.C_TASK_UP_LOAD_PIC) .url(HttpInterface.C_TASK_UP_LOAD_PIC)
.fileList(chargingStationList) .fileList(chargingStationList)
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.params(httpParams)
.cls(PoiUploadBean.class) .cls(PoiUploadBean.class)
.postFileAsynchronous(poiEntity.getBodyId(), new Callback<PoiUploadBean>() { .postFileAsynchronous( new Callback<PoiUploadBean>() {
@Override @Override
public void onSuccess(PoiUploadBean response, int id) { public void onSuccess(PoiUploadBean response, int id) {
dismissLoadingDialog(); dismissLoadingDialog();

View File

@ -68,7 +68,7 @@ public class EventPrefectureFragment extends BaseFragment implements View.OnClic
httpParams.put("pageSize", "10"); httpParams.put("pageSize", "10");
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())
.url(HttpInterface.listEvent) .url(HttpInterface.MSG_LISt)
.cls(TaskPrefectureBean.class) .cls(TaskPrefectureBean.class)
.params(httpParams) .params(httpParams)
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)

View File

@ -32,13 +32,15 @@ import com.vividsolutions.jts.geom.Geometry;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
import org.jetbrains.annotations.NotNull;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
* 筛选的Fragment * 筛选的Fragment
* */ */
public class FilterFragment extends BaseDrawerFragment implements View.OnClickListener { public class FilterFragment extends BaseDrawerFragment implements View.OnClickListener {
private Button btnFilter; private Button btnFilter;
private XRecyclerView recyclerFilter; private XRecyclerView recyclerFilter;
@ -144,7 +146,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
@Override @Override
protected void initView() { protected void initView() {
super.initView(); super.initView();
poiEntities = new ArrayList<>();
/* JobSearchBean jobSearchBean = (JobSearchBean) getArguments().getSerializable("body");//服务数据 /* JobSearchBean jobSearchBean = (JobSearchBean) getArguments().getSerializable("body");//服务数据
ArrayList<PoiEntity> showAllPoi = (ArrayList<PoiEntity>) getArguments().getSerializable("showAllPoi");//本地数据 ArrayList<PoiEntity> showAllPoi = (ArrayList<PoiEntity>) getArguments().getSerializable("showAllPoi");//本地数据
if (jobSearchBean != null) { if (jobSearchBean != null) {
@ -178,11 +180,12 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
} }
@Subscribe @Subscribe
public void onEvent(Message data) { public void onEvent(@NotNull Message data) {
poiEntities = new ArrayList<>();
poiEntities.clear();
if (data.what == Constant.JOB_SEARCH_POI_WORD) { if (data.what == Constant.JOB_SEARCH_POI_WORD) {
allPoi = (List<PoiEntity>) data.obj; allPoi = (List<PoiEntity>) data.obj;
} else if (data.what == Constant.JOB_SEARCH_WORD) { } else if (data.what == Constant.JOB_SEARCH_WORD) {
poiEntities.clear();
JobSearchBean jobSearchBean = (JobSearchBean) data.obj; JobSearchBean jobSearchBean = (JobSearchBean) data.obj;
if (jobSearchBean != null) { if (jobSearchBean != null) {
List<JobSearchBean.BodyBean.ListBean> list = jobSearchBean.getBody().getList(); List<JobSearchBean.BodyBean.ListBean> list = jobSearchBean.getBody().getList();
@ -217,7 +220,6 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
poiEntities.addAll(allPoi); poiEntities.addAll(allPoi);
} }
filterAdapter.setAllPoi(poiEntities); filterAdapter.setAllPoi(poiEntities);
} }
} }

View File

@ -302,6 +302,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
.url(url + "/" + taskId) .url(url + "/" + taskId)
.cls(ReceivedBean.class) .cls(ReceivedBean.class)
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.params(new HttpParams())
.getRequest(new Callback<ReceivedBean>() { .getRequest(new Callback<ReceivedBean>() {
@Override @Override
public void onSuccess(ReceivedBean response, int id) { public void onSuccess(ReceivedBean response, int id) {
@ -417,6 +418,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
.url(url + "/" + taskId) .url(url + "/" + taskId)
.cls(PolygonTaskBean.class) .cls(PolygonTaskBean.class)
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.params(new HttpParams())
.getRequest(new Callback<PolygonTaskBean>() { .getRequest(new Callback<PolygonTaskBean>() {
@Override @Override
public void onSuccess(PolygonTaskBean response, int id) { public void onSuccess(PolygonTaskBean response, int id) {
@ -494,6 +496,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
.url(url + "/" + taskId) .url(url + "/" + taskId)
.cls(UnPolygonTaskBean.class) .cls(UnPolygonTaskBean.class)
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.params(new HttpParams())
.getRequest(new Callback<UnPolygonTaskBean>() { .getRequest(new Callback<UnPolygonTaskBean>() {
@Override @Override
public void onSuccess(UnPolygonTaskBean response, int id) { public void onSuccess(UnPolygonTaskBean response, int id) {
@ -544,6 +547,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
.url(url + "/" + taskId) .url(url + "/" + taskId)
.cls(UnPolygonTaskBean.class) .cls(UnPolygonTaskBean.class)
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.params(new HttpParams())
.getRequest(new Callback<UnPolygonTaskBean>() { .getRequest(new Callback<UnPolygonTaskBean>() {
@Override @Override
public void onSuccess(UnPolygonTaskBean response, int id) { public void onSuccess(UnPolygonTaskBean response, int id) {
@ -640,6 +644,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
.Builder(getActivity()) .Builder(getActivity())
.url(url + "/" + taskId) .url(url + "/" + taskId)
.cls(ReceivedPoiBean.class) .cls(ReceivedPoiBean.class)
.params(new HttpParams())
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.getRequest(new Callback<ReceivedPoiBean>() { .getRequest(new Callback<ReceivedPoiBean>() {
@Override @Override
@ -749,6 +754,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
.Builder(getActivity()) .Builder(getActivity())
.url(url + "/" + taskId) .url(url + "/" + taskId)
.cls(TaskByNetBean.class) .cls(TaskByNetBean.class)
.params(new HttpParams())
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.getRequest(new Callback<TaskByNetBean>() { .getRequest(new Callback<TaskByNetBean>() {
@Override @Override

View File

@ -64,7 +64,7 @@ public class IssueFragment extends BaseFragment implements View.OnClickListener
httpParams.put("pageSize", "10"); httpParams.put("pageSize", "10");
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())
.url(HttpInterface.listTaskExplain) .url(HttpInterface.MSG_LISt)
.cls(TaskPrefectureBean.class) .cls(TaskPrefectureBean.class)
.params(httpParams) .params(httpParams)
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)

View File

@ -92,7 +92,7 @@ public class MessageFragment extends BaseFragment implements View.OnClickListene
httpParams.put("pageSize", "10"); httpParams.put("pageSize", "10");
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())
.url(HttpInterface.listTask) .url(HttpInterface.MSG_LISt)
.cls(TaskPrefectureBean.class) .cls(TaskPrefectureBean.class)
.params(httpParams) .params(httpParams)
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)

View File

@ -14,6 +14,7 @@ import android.widget.Toast;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CircleCrop; import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.bumptech.glide.request.RequestOptions; import com.bumptech.glide.request.RequestOptions;
import com.lzy.okgo.model.HttpParams;
import com.navinfo.outdoor.R; import com.navinfo.outdoor.R;
import com.navinfo.outdoor.activity.FragmentManagement; import com.navinfo.outdoor.activity.FragmentManagement;
import com.navinfo.outdoor.activity.UserActivity; import com.navinfo.outdoor.activity.UserActivity;
@ -106,14 +107,19 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
.Builder(getActivity()) .Builder(getActivity())
.url(HttpInterface.GET_PRICE) .url(HttpInterface.GET_PRICE)
.cls(GetPriceBean.class) .cls(GetPriceBean.class)
.params(new HttpParams())
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.getRequest(new Callback<GetPriceBean>() { .getRequest(new Callback<GetPriceBean>() {
@Override @Override
public void onSuccess(GetPriceBean response, int id) { public void onSuccess(GetPriceBean response, int id) {
dismissLoadingDialog(); dismissLoadingDialog();
// Toast.makeText(getContext(), "获取成功", Toast.LENGTH_SHORT).show(); // Toast.makeText(getContext(), "获取成功", Toast.LENGTH_SHORT).show();
Double userPrice = response.getBody().getUserPrice(); GetPriceBean.BodyBean body = response.getBody();
if (body!=null){
Double userPrice =body.getUserPrice();
tvMoney.setText(userPrice + ""); tvMoney.setText(userPrice + "");
}
Log.d("TAG", "onSuccess: " + response.toString() + "tttttttt"); Log.d("TAG", "onSuccess: " + response.toString() + "tttttttt");
} }

View File

@ -469,13 +469,16 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
return; return;
} }
showLoadingDialog(); showLoadingDialog();
HttpParams httpParams=new HttpParams();
httpParams.put("auditId",body);
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())
.url(HttpInterface.OTHER_TASK_UPLOAD_PIC) .url(HttpInterface.OTHER_TASK_UPLOAD_PIC)
.fileList(otherUploadList) .fileList(otherUploadList)
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.params(httpParams)
.cls(PoiUploadBean.class) .cls(PoiUploadBean.class)
.postFileAsynchronous(body, new Callback<PoiUploadBean>() { .postFileAsynchronous( new Callback<PoiUploadBean>() {
@Override @Override
public void onSuccess(PoiUploadBean response, int id) { public void onSuccess(PoiUploadBean response, int id) {
dismissLoadingDialog(); dismissLoadingDialog();

View File

@ -450,6 +450,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
.url(HttpInterface.GET_PHONES) .url(HttpInterface.GET_PHONES)
.params(new HttpParams("geo", encode)) .params(new HttpParams("geo", encode))
.cls(GetPhoneBean.class) .cls(GetPhoneBean.class)
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.getRequest(new Callback<GetPhoneBean>() { .getRequest(new Callback<GetPhoneBean>() {
@Override @Override
@ -740,12 +741,15 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
return; return;
} }
showLoadingDialog(); showLoadingDialog();
HttpParams httpParams=new HttpParams();
httpParams.put("auditId",body);
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.url(HttpInterface.POI_TASK_UPLOAD_PIC) .url(HttpInterface.POI_TASK_UPLOAD_PIC)
.cls(OtherUploadPicBean.class) .cls(OtherUploadPicBean.class)
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.fileList(poiPicList) .fileList(poiPicList)
.postFileAsynchronous(body, new Callback<OtherUploadPicBean>() { .params(httpParams)
.postFileAsynchronous(new Callback<OtherUploadPicBean>() {
@Override @Override
public void onSuccess(OtherUploadPicBean response, int id) { public void onSuccess(OtherUploadPicBean response, int id) {
dismissLoadingDialog(); dismissLoadingDialog();

View File

@ -26,6 +26,7 @@ import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder; import com.navinfo.outdoor.http.OkGoBuilder;
import com.umeng.commonsdk.debug.D; import com.umeng.commonsdk.debug.D;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -37,6 +38,8 @@ public class PoiTaskFragment extends BaseFragment implements View.OnClickListene
private int type; private int type;
private PoiTaskAdapter poiTaskAdapter; private PoiTaskAdapter poiTaskAdapter;
private TextView tvTaskTitle; private TextView tvTaskTitle;
private int page=1;
private List<HasSubmitBean.BodyBean.ListBean> listBeans;
public static PoiTaskFragment newInstance(Bundle bundle) { public static PoiTaskFragment newInstance(Bundle bundle) {
PoiTaskFragment fragment = new PoiTaskFragment(); PoiTaskFragment fragment = new PoiTaskFragment();
@ -73,43 +76,40 @@ public class PoiTaskFragment extends BaseFragment implements View.OnClickListene
ivPoiTaskFinish = (ImageView) findViewById(R.id.iv_poiTask_finish); ivPoiTaskFinish = (ImageView) findViewById(R.id.iv_poiTask_finish);
ivPoiTaskFinish.setOnClickListener(this::onClick); ivPoiTaskFinish.setOnClickListener(this::onClick);
poiTaskXrv = (XRecyclerView) findViewById(R.id.poiTask_xrv); poiTaskXrv = (XRecyclerView) findViewById(R.id.poiTask_xrv);
poiTaskXrv.setLayoutManager(new LinearLayoutManager(getContext())); poiTaskXrv.setLayoutManager(new LinearLayoutManager(getActivity()));
poiTaskXrv.addItemDecoration(new DividerItemDecoration(getContext(),DividerItemDecoration.VERTICAL));
poiTaskXrv.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader); poiTaskXrv.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
poiTaskXrv.setLoadingMoreProgressStyle(ProgressStyle.BallRotate); poiTaskXrv.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
//取消上拉加载刷新功能
poiTaskXrv.setPullRefreshEnabled(false);
poiTaskXrv.setLoadingMoreEnabled(false);
poiTaskAdapter = new PoiTaskAdapter(getContext());
poiTaskXrv.setAdapter(poiTaskAdapter);
poiTaskXrv.getDefaultFootView().setNoMoreHint("加载完毕");
poiTaskXrv.setLoadingListener(new XRecyclerView.LoadingListener() { poiTaskXrv.setLoadingListener(new XRecyclerView.LoadingListener() {
@Override @Override
public void onRefresh() { public void onRefresh() {
page = 1;
initWork(type,true);
} }
@Override @Override
public void onLoadMore() { public void onLoadMore() {
initWork(type,false);
} }
}); });
poiTaskAdapter = new PoiTaskAdapter(getContext(), listBeans);
poiTaskXrv.setAdapter(poiTaskAdapter);
poiTaskXrv.getDefaultFootView().setNoMoreHint("已全部加载完毕");
} }
@Override @Override
protected void initData() { protected void initData() {
super.initData(); super.initData();
type = getArguments().getInt("type", 0); type = getArguments().getInt("type", 0);
initWork(type); listBeans = new ArrayList<>();
initWork(type,true);
} }
private void initWork(int type) { private void initWork(int type, boolean aBoolean) {
showLoadingDialog(); showLoadingDialog();
HttpParams httpParams = new HttpParams(); HttpParams httpParams = new HttpParams();
httpParams.put("type", type); httpParams.put("type", type);
httpParams.put("pageSize", "10"); httpParams.put("pageSize", "10");
httpParams.put("pageNum", "2"); httpParams.put("pageNum", page);
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())
.url(HttpInterface.GET_COMMIT_LIST) .url(HttpInterface.GET_COMMIT_LIST)
@ -120,11 +120,9 @@ public class PoiTaskFragment extends BaseFragment implements View.OnClickListene
@Override @Override
public void onSuccess(HasSubmitBean hasSubmitBean, int id) { public void onSuccess(HasSubmitBean hasSubmitBean, int id) {
dismissLoadingDialog(); dismissLoadingDialog();
List<HasSubmitBean.BodyBean.ListBean> list = hasSubmitBean.getBody().getList(); if (hasSubmitBean.getBody()!=null){
if (list!=null){ initHasSubmitBean(hasSubmitBean,aBoolean);
poiTaskAdapter.setListBeans(list);
} }
} }
@Override @Override
@ -137,6 +135,41 @@ public class PoiTaskFragment extends BaseFragment implements View.OnClickListene
dismissDialog(); dismissDialog();
} }
private void initHasSubmitBean(HasSubmitBean hasSubmitBean, boolean aBoolean) {
if (hasSubmitBean.getCode() == 200) {
if (aBoolean) {
if (listBeans.size() > 0) {
listBeans.clear();
}
if (hasSubmitBean.getBody().getList()== null) {
Toast.makeText(getActivity(), "没有相关数据", Toast.LENGTH_SHORT).show();
} else {
listBeans.addAll(hasSubmitBean.getBody().getList());
page++;
}
poiTaskAdapter.notifyDataSetChanged();
poiTaskXrv.refreshComplete();
} else {
if (hasSubmitBean.getBody().getList() == null) {
poiTaskXrv.setNoMore(true);
} else {
listBeans.addAll(hasSubmitBean.getBody().getList());
poiTaskAdapter.notifyDataSetChanged();
poiTaskXrv.loadMoreComplete();
page++;
}
}
} else {
Toast.makeText(getActivity(), hasSubmitBean.getMessage(), Toast.LENGTH_SHORT).show();
Log.d("TAG", "" + hasSubmitBean.getMessage());
}
}
@Override @Override
public void onClick(View v) { public void onClick(View v) {
switch (v.getId()) { switch (v.getId()) {

View File

@ -443,6 +443,8 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
} }
HttpParams httpParams = new HttpParams(); HttpParams httpParams = new HttpParams();
httpParams.put("auditId", poiVideoBody); httpParams.put("auditId", poiVideoBody);
long time=System.currentTimeMillis();
httpParams.put("datetime",time);
httpParams.put("file", fileZip); httpParams.put("file", fileZip);
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())

View File

@ -423,6 +423,8 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
} }
HttpParams httpParams = new HttpParams(); HttpParams httpParams = new HttpParams();
httpParams.put("auditId", body); httpParams.put("auditId", body);
long time=System.currentTimeMillis();
httpParams.put("datetime",time);
httpParams.put("file", fileZip); httpParams.put("file", fileZip);
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())

View File

@ -103,7 +103,7 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
httpParams.put("pageSize", "10"); httpParams.put("pageSize", "10");
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())
.url(HttpInterface.listTaskExplain) .url(HttpInterface.MSG_LISt)
.cls(TaskPrefectureBean.class) .cls(TaskPrefectureBean.class)
.params(httpParams) .params(httpParams)
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)

View File

@ -10,6 +10,7 @@ import android.widget.Toast;
import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import com.lzy.okgo.model.HttpParams;
import com.navinfo.outdoor.R; import com.navinfo.outdoor.R;
import com.navinfo.outdoor.activity.WebActivity; import com.navinfo.outdoor.activity.WebActivity;
@ -97,8 +98,9 @@ public class TaskExplainFragment2 extends BaseFragment implements View.OnClickLi
showLoadingDialog(); showLoadingDialog();
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())
.url(HttpInterface.listTaskExplain) .url(HttpInterface.MSG_LISt)
.cls(TaskExplainInfo.class) .cls(TaskExplainInfo.class)
.params(new HttpParams())
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.getRequest(new Callback<TaskExplainInfo>() { .getRequest(new Callback<TaskExplainInfo>() {
@Override @Override

View File

@ -104,7 +104,7 @@ public class TaskPrefectureFragment extends BaseFragment implements View.OnClick
httpParams.put("pageSize", "2"); httpParams.put("pageSize", "2");
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())
.url(HttpInterface.listTask) .url(HttpInterface.MSG_LISt)
.cls(TaskPrefectureBean.class) .cls(TaskPrefectureBean.class)
.params(httpParams) .params(httpParams)
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)

View File

@ -25,7 +25,6 @@ import android.widget.Toast;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction; import androidx.fragment.app.FragmentTransaction;
import com.github.lazylibrary.util.DensityUtil; import com.github.lazylibrary.util.DensityUtil;
@ -105,6 +104,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
private ImageView ivSubmit; private ImageView ivSubmit;
private ImageView ivRefish; private ImageView ivRefish;
private SlidingUpPanelLayout sliding_layout; private SlidingUpPanelLayout sliding_layout;
private FragmentTransaction fragmentTransaction;
private Marker markerPoi; private Marker markerPoi;
private CheckBox cbFootType; private CheckBox cbFootType;
private ImageView ivFilter; private ImageView ivFilter;
@ -118,6 +118,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
private String userEncode; private String userEncode;
private String centerEncode; private String centerEncode;
private List<Removable> removables; private List<Removable> removables;
private List<Removable> removablesMarker;
private List<Removable> removablesLocality; private List<Removable> removablesLocality;
/** /**
* bitmapDescriptor1 * bitmapDescriptor1
@ -126,15 +127,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
private BitmapDescriptor bitmapDescriptor1, bitmapDescriptor2, bitmapDescriptor3, bitmapDescriptor4, bitmapDescriptor5; private BitmapDescriptor bitmapDescriptor1, bitmapDescriptor2, bitmapDescriptor3, bitmapDescriptor4, bitmapDescriptor5;
private Marker bigMarker; private Marker bigMarker;
private Marker markerPile; private Marker markerPile;
private PoiFragment poiFragment;
private PoiVideoFragment poiVideoFragment;
private RoadFragment roadFragment;
private ChargingStationFragment chargingStationFragment;
private OtherFragment otherFragment;
private FilterFragment filterFragment;
private ChargingPileFragment chargingPileFragment;
private FragmentManager supportFragmentManager;
private FragmentTransaction fragmentTransaction;
public static TreasureFragment newInstance(Bundle bundle) { public static TreasureFragment newInstance(Bundle bundle) {
TreasureFragment fragment = new TreasureFragment(); TreasureFragment fragment = new TreasureFragment();
@ -175,14 +167,12 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
ivMessage.setOnClickListener(this::onClick); ivMessage.setOnClickListener(this::onClick);
treasureMap = (MapView) findViewById(R.id.treasure_map); treasureMap = (MapView) findViewById(R.id.treasure_map);
tencentMap = treasureMap.getMap(); tencentMap = treasureMap.getMap();
// if (getClass().getCanonicalName().equals("PioFragment")){ // if (getClass().getCanonicalName().equals("PioFragment")){
// ivMessage.setVisibility(View.VISIBLE); // ivMessage.setVisibility(View.VISIBLE);
// }else { // }else {
// ivMessage.setVisibility(View.GONE); // ivMessage.setVisibility(View.GONE);
// } // }
cbMapType = (CheckBox) findViewById(R.id.cb_map_type); cbMapType = (CheckBox) findViewById(R.id.cb_map_type);
// sliding_layout.setScrollableViewHelper(new NestedScrollableViewHelper()); // sliding_layout.setScrollableViewHelper(new NestedScrollableViewHelper());
//地图转换 //地图转换
cbMapType.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { cbMapType.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@ -214,6 +204,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
uiSettings.setLogoScale(0.7f); uiSettings.setLogoScale(0.7f);
uiSettings.setRotateGesturesEnabled(false);//禁止地图旋转手势. uiSettings.setRotateGesturesEnabled(false);//禁止地图旋转手势.
uiSettings.setTiltGesturesEnabled(false);//禁止倾斜手势. uiSettings.setTiltGesturesEnabled(false);//禁止倾斜手势.
showLoadingDialog();
//开启定位权限 //开启定位权限
checkNetWork(); checkNetWork();
//检查是否有没有填完的页面 //检查是否有没有填完的页面
@ -222,6 +213,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
initThread(); initThread();
removables = new ArrayList<>();//存储网络数据的marker removables = new ArrayList<>();//存储网络数据的marker
removablesLocality = new ArrayList<>(); //存储本地数据的marker removablesLocality = new ArrayList<>(); //存储本地数据的marker
removablesMarker = new ArrayList<>();//存储网络数据的marker
tencentMap.addOnMapLoadedCallback(new TencentMap.OnMapLoadedCallback() { tencentMap.addOnMapLoadedCallback(new TencentMap.OnMapLoadedCallback() {
@Override @Override
public void onMapLoaded() { public void onMapLoaded() {
@ -236,38 +228,60 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
tencentMap.animateCamera(cameraSigma, new TencentMap.CancelableCallback() { tencentMap.animateCamera(cameraSigma, new TencentMap.CancelableCallback() {
@Override @Override
public void onFinish() { public void onFinish() {
dismissLoadingDialog();
// 移动到当前位置后开始请求地图数据 // 移动到当前位置后开始请求地图数据
initList(Constant.currentLocation); initList(Constant.currentLocation);
} }
@Override @Override
public void onCancel() { public void onCancel() {}
}
}); });
}else {
dismissLoadingDialog();
} }
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() != null && !marker.getTitle().equals("")) {//是本地数据直接跳转到采集页面 if (marker.getTitle() != null && !marker.getTitle().equals("")) {//是本地数据直接跳转到采集页面
frameLayout.setVisibility(View.GONE);
if (gatherGetFragment != null) {
fragmentTransaction.remove(gatherGetFragment);
}
if (markerPoi != null) {
markerPoi.remove();
}
if (markerPile != null) {
markerPile.remove();
}
if (bigMarker != null) {
bigMarker.setVisible(false);
}
for (int i = 0; i < removablesMarker.size(); i++) {
removablesMarker.get(i).remove();
}
removablesMarker.clear();
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);
switch (poiEntity.getType()) { switch (poiEntity.getType()) {
case 1: case 1:
showSlidingFragment(1, bundle); PoiFragment poiFragment = PoiFragment.newInstance(bundle);
showSlidingFragment(poiFragment);
break; break;
case 2: case 2:
showSlidingFragment(4, bundle); ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(bundle);
showSlidingFragment(chargingStationFragment);
break; break;
case 3: case 3:
showSlidingFragment(2, bundle); PoiVideoFragment poiVideoFragment = PoiVideoFragment.newInstance(bundle);
showSlidingFragment(poiVideoFragment);
break; break;
case 4: case 4:
showSlidingFragment(3, bundle); RoadFragment roadFragment = RoadFragment.newInstance(bundle);
showSlidingFragment(roadFragment);
break; break;
case 5: case 5:
showSlidingFragment(5, bundle); OtherFragment otherFragment = OtherFragment.newInstance(bundle);
showSlidingFragment(otherFragment);
break; break;
case 6: case 6:
initMarker(poiEntity); initMarker(poiEntity);
@ -304,6 +318,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
poiListEntity.setY(latPolygon.get(0).latitude + ""); poiListEntity.setY(latPolygon.get(0).latitude + "");
} }
initMarker(poiListEntity); initMarker(poiListEntity);
}else {
Toast.makeText(getActivity(), "数据为空", Toast.LENGTH_SHORT).show();
} }
} }
@ -320,7 +336,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
} }
private void initList(TencentLocation tencentLocation) { private void initList(TencentLocation tencentLocation) {
int task_type = Constant.TASK_TYPE; int task_type = Constant.TASK_TYPE;
int limit_type = Constant.LIMIT_TTPE; int limit_type = Constant.LIMIT_TTPE;
int taskStatus = Constant.TASK_STASTUS; int taskStatus = Constant.TASK_STASTUS;
@ -359,6 +374,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
@Override @Override
public void onSuccess(JobSearchBean response, int id) { public void onSuccess(JobSearchBean response, int id) {
dismissLoadingDialog(); dismissLoadingDialog();
JobSearchBean.BodyBean body = response.getBody();
if (body != null) {
Log.d("TAG", "onSuccess: " + response.getBody().toString() + "sssssssssssss"); Log.d("TAG", "onSuccess: " + response.getBody().toString() + "sssssssssssss");
for (int i = 0; i < removables.size(); i++) { for (int i = 0; i < removables.size(); i++) {
removables.get(i).remove(); removables.get(i).remove();
@ -408,9 +425,17 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
strokeWidth(5)); strokeWidth(5));
polygon.setZIndex(1); polygon.setZIndex(1);
removables.add(polygon); removables.add(polygon);
if (latPolygon != null && latPolygon.size() > 0) { com.vividsolutions.jts.geom.Point centroid = geometry.getCentroid();
latLng = latPolygon.get(0); double x = centroid.getX();
double y = centroid.getY();
if (centroid != null) {
latLng = new LatLng();
latLng.setLatitude(y);
latLng.setLongitude(x);
} }
/* if (latPolygon != null && latPolygon.size() > 0) {
latLng = latPolygon.get(0);
}*/
} }
switch (Integer.valueOf(list.get(i).getType())) { switch (Integer.valueOf(list.get(i).getType())) {
case 1://poi case 1://poi
@ -476,45 +501,29 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
break; break;
} }
} }
}
Message obtain = Message.obtain(); Message obtain = Message.obtain();
obtain.what = Constant.JOB_SEARCH_WORD; obtain.what = Constant.JOB_SEARCH_WORD;
obtain.obj = response; obtain.obj = response;
EventBus.getDefault().post(obtain); EventBus.getDefault().post(obtain);
} }
@Override @Override
public void onError(Throwable e, int id) { public void onError(Throwable e, int id) {
dismissLoadingDialog(); dismissLoadingDialog();
Log.d("TAG", "onError: " + e.getMessage() + ""); Log.d("TAG", "onError: " + e.getMessage() + "");
} }
}); });
dismissDialog();
/*
OkGo.<JobSearchBean>get(HttpInterface.TASK_LIST)
.tag(this)
// 请求的 tag, 主要用于取消对应的请求
.params("userGeo", userEncode)
.params("centerGeo", centerEncode)
.params("date", date)
.params("pageSize", Constant.NUMBER)
.params("pageNum", "1")
.params("type", task_type)
.params("isExclusive", limit_type)
// .client(new OkHttpClient())
.execute(new DialogCallback<JobSearchBean>(JobSearchBean.class) {
@Override
public void onSuccess(Response<JobSearchBean> response) {
dismissLoadingDialog();
Log.d("TAG", "onSuccess: " + response.body().toString() + "sssssssssssss");
for (int i = 0; i < removables.size(); i++) {
removables.get(i).remove();
} }
removables.clear();
JobSearchBean body = response.body(); public void initMarker(PoiEntity poiEntity) {
List<JobSearchBean.BodyBean.ListBean> list = response.body().getBody().getList(); sliding_layout.setPanelHeight(0);
for (int i = 0; i < list.size(); i++) { sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
JobSearchBean.BodyBean.ListBean listBean = list.get(i); for (int i = 0; i < removablesMarker.size(); i++) {
String geo = list.get(i).getGeo(); removablesMarker.get(i).remove();
}
removablesMarker.clear();
String geo = poiEntity.getGeoWkt();
Log.d("TAG", "onSuccess: " + geo); Log.d("TAG", "onSuccess: " + geo);
Geometry geometry = GeometryTools.createGeometry(geo); Geometry geometry = GeometryTools.createGeometry(geo);
LatLng latLng = null; LatLng latLng = null;
@ -530,7 +539,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
// 折线的颜色为绿色 // 折线的颜色为绿色
.color(0xff00ff00) .color(0xff00ff00)
// 折线宽度为5像素 // 折线宽度为5像素
.width(5) .width(25)
// 还可以添加描边颜色 // 还可以添加描边颜色
.borderColor(0xffff0000) .borderColor(0xffff0000)
// 描边颜色的宽度线宽还是 25 像素不过填充的部分宽度为 `width` - 2 * `borderWidth` // 描边颜色的宽度线宽还是 25 像素不过填充的部分宽度为 `width` - 2 * `borderWidth`
@ -538,7 +547,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
// 绘制折线 // 绘制折线
Polyline polyline = tencentMap.addPolyline(polylineOptions); Polyline polyline = tencentMap.addPolyline(polylineOptions);
polyline.setZIndex(3); polyline.setZIndex(3);
removables.add(polyline); removablesMarker.add(polyline);
if (latLineString != null && latLineString.size() > 0) { if (latLineString != null && latLineString.size() > 0) {
latLng = latLineString.get(0); latLng = latLineString.get(0);
} }
@ -552,106 +561,42 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
//边线颜色为黑色 //边线颜色为黑色
strokeColor(0xff000000). strokeColor(0xff000000).
//边线宽度15像素 //边线宽度15像素
strokeWidth(5)); strokeWidth(25));
polygon.setZIndex(1); polygon.setZIndex(1);
removables.add(polygon); removablesMarker.add(polygon);
if (latPolygon != null && latPolygon.size() > 0) { com.vividsolutions.jts.geom.Point centroid = geometry.getCentroid();
double x = centroid.getX();
double y = centroid.getY();
if (centroid != null) {
latLng = new LatLng();
latLng.setLatitude(y);
latLng.setLongitude(x);
}
/* if (latPolygon != null && latPolygon.size() > 0) {
latLng = latPolygon.get(0); latLng = latPolygon.get(0);
}*/
} }
BitmapDescriptor descriptor = null;
if (poiEntity.getType()==1){
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bags);
}else if (poiEntity.getType()==2){
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bags);
}else if (poiEntity.getType()==3){
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_bag);
}else if (poiEntity.getType()==4){
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_bag);
}else if (poiEntity.getType()==5){
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bag);
}else if (poiEntity.getType()==6){
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bag);
} }
switch (Integer.valueOf(list.get(i).getType())) {
case 1://poi
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bg1);
Marker poiMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiDescriptor).alpha(0.9f)
.flat(true)
.clockwise(false));
poiMarker.setZIndex(2);
poiMarker.setTag(listBean);
removables.add(poiMarker);
poiMarker.setClickable(true);
break;
case 2://充电站
BitmapDescriptor chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bg1);
Marker stationMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(chargeDescriptor).alpha(0.9f)
.flat(true)
.clockwise(false));
stationMarker.setTag(listBean);
removables.add(stationMarker);
stationMarker.setClickable(true);
stationMarker.setZIndex(2);
break;
case 3://poi录像
BitmapDescriptor poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video_bg1);
Marker poiVideoMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiVideoDescriptor).alpha(0.9f)
.flat(true)
.clockwise(false));
poiVideoMarker.setTag(listBean);
removables.add(poiVideoMarker);
poiVideoMarker.setClickable(true);
poiVideoMarker.setZIndex(2);
break;
case 4://道路录像
BitmapDescriptor roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_bg);
Marker roadMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(roadDescriptor).alpha(0.9f)
.flat(true)
.clockwise(false));
roadMarker.setTag(listBean);
removables.add(roadMarker);
roadMarker.setClickable(true);
roadMarker.setZIndex(2);
break;
case 5://其他
BitmapDescriptor otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bg1);
Marker otherMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(otherDescriptor).alpha(0.9f)
.flat(true)
.clockwise(false));
otherMarker.setTag(listBean);
removables.add(otherMarker);
otherMarker.setClickable(true);
otherMarker.setZIndex(2);
break;
case 6://面状任务
BitmapDescriptor Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_bg);
Marker planarMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Descriptor).alpha(0.9f)
.flat(true)
.clockwise(false));
Log.d("面状任务", "onSuccess: " + planarMarker);
planarMarker.setTag(listBean);
removables.add(planarMarker);
planarMarker.setClickable(true);
planarMarker.setZIndex(2);
break;
}
}
Message obtain = Message.obtain();
obtain.what = Constant.JOB_SEARCH_WORD;
obtain.obj = body;
EventBus.getDefault().post(obtain);
}
@Override
public void onError(Response<JobSearchBean> response) {
super.onError(response);
dismissLoadingDialog();
Log.d("TAG", "onError: " + response.message() + "");
}
});*/
dismissDialog();
}
public void initMarker(PoiEntity poiEntity) {
sliding_layout.setPanelHeight(0);
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
LatLng latLng = new LatLng();
latLng.setLongitude(Double.parseDouble(poiEntity.getX()));
latLng.setLatitude(Double.parseDouble(poiEntity.getY()));
if (bigMarker == null) { if (bigMarker == null) {
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_bag); bigMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(descriptor).alpha(0.9f)
bigMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiDescriptor).alpha(0.9f)
.flat(true) .flat(true)
.clockwise(false)); .clockwise(false));
} else { } else {
bigMarker.setPosition(latLng); bigMarker.setPosition(latLng);
bigMarker.setIcon(descriptor);
} }
bigMarker.setVisible(true); bigMarker.setVisible(true);
bigMarker.setClickable(false); bigMarker.setClickable(false);
@ -671,13 +616,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
int taskStatus = Constant.TASK_STASTUS; int taskStatus = Constant.TASK_STASTUS;
int type = Constant.TASK_TYPE; int type = Constant.TASK_TYPE;
int limit = Constant.LIMIT_TTPE; int limit = Constant.LIMIT_TTPE;
if (taskStatus == 0) {
Message obtain = Message.obtain();
obtain.what = Constant.JOB_SEARCH_POI_WORD;
obtain.obj = null;
EventBus.getDefault().post(obtain);
return;
}
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -733,9 +671,17 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
strokeWidth(5)); strokeWidth(5));
polygon.setZIndex(1); polygon.setZIndex(1);
removablesLocality.add(polygon); removablesLocality.add(polygon);
if (latPolygon != null && latPolygon.size() > 0) { com.vividsolutions.jts.geom.Point centroid = geometry.getCentroid();
latLng = latPolygon.get(0); double x = centroid.getX();
double y = centroid.getY();
if (centroid != null) {
latLng = new LatLng();
latLng.setLatitude(y);
latLng.setLongitude(x);
} }
/* if (latPolygon != null && latPolygon.size() > 0) {
latLng = latPolygon.get(0);
}*/
} }
} else { } else {
if (allTaskStatus.get(i).getX() != null && allTaskStatus.get(i).getY() != null) { if (allTaskStatus.get(i).getX() != null && allTaskStatus.get(i).getY() != null) {
@ -744,8 +690,12 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
} }
switch (Integer.valueOf(poiEntity.getType())) { switch (Integer.valueOf(poiEntity.getType())) {
case 1://poi case 1://poi
BitmapDescriptor poiDescriptor=null;
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.graypoi); if (poiEntity.getTaskStatus()==1){
poiDescriptor= BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bg1);
}else {
poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.graypoi);
}
Marker poiMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiDescriptor).alpha(0.9f) Marker poiMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiDescriptor).alpha(0.9f)
.flat(true) .flat(true)
.clockwise(false)); .clockwise(false));
@ -758,7 +708,12 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
break; break;
case 2://充电站 case 2://充电站
BitmapDescriptor chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.graycharge); BitmapDescriptor chargeDescriptor = null;
if (poiEntity.getTaskStatus()==1){
chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bg1);
}else {
chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.graycharge);
}
Marker stationMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(chargeDescriptor).alpha(0.9f) Marker stationMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(chargeDescriptor).alpha(0.9f)
.flat(true) .flat(true)
.clockwise(false)); .clockwise(false));
@ -769,7 +724,12 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
removablesLocality.add(stationMarker); removablesLocality.add(stationMarker);
break; break;
case 3://poi录像 case 3://poi录像
BitmapDescriptor poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_have_bg); BitmapDescriptor poiVideoDescriptor = null;
if (poiEntity.getTaskStatus()==1){
poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video_bg1);
}else {
poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_have_bg);
}
Marker poiVideoMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiVideoDescriptor).alpha(0.9f) Marker poiVideoMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiVideoDescriptor).alpha(0.9f)
.flat(true) .flat(true)
.clockwise(false)); .clockwise(false));
@ -780,7 +740,12 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
removablesLocality.add(poiVideoMarker); removablesLocality.add(poiVideoMarker);
break; break;
case 4://道路录像 case 4://道路录像
BitmapDescriptor roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.grayroad); BitmapDescriptor roadDescriptor =null;
if (poiEntity.getTaskStatus()==1){
roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_bg);
}else {
roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.grayroad);
}
Marker roadMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(roadDescriptor).alpha(0.9f) Marker roadMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(roadDescriptor).alpha(0.9f)
.flat(true) .flat(true)
.clockwise(false)); .clockwise(false));
@ -791,7 +756,12 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
removablesLocality.add(roadMarker); removablesLocality.add(roadMarker);
break; break;
case 5://其他 case 5://其他
BitmapDescriptor otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.grayother); BitmapDescriptor otherDescriptor = null;
if (poiEntity.getTaskStatus()==1){
otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bg1);
}else {
otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.grayother);
}
Marker otherMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(otherDescriptor).alpha(0.9f) Marker otherMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(otherDescriptor).alpha(0.9f)
.flat(true) .flat(true)
.clockwise(false)); .clockwise(false));
@ -802,7 +772,12 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
removablesLocality.add(otherMarker); removablesLocality.add(otherMarker);
break; break;
case 6://面状任务 case 6://面状任务
BitmapDescriptor Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_have_bag); BitmapDescriptor Descriptor =null;
if (poiEntity.getTaskStatus()==1){
Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_bg);
}else {
Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_have_bag);
}
Marker planarMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Descriptor).alpha(0.9f) Marker planarMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Descriptor).alpha(0.9f)
.clockwise(false) .clockwise(false)
.flat(true)); .flat(true));
@ -839,7 +814,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putSerializable("poiEntity", poiEntity); bundle.putSerializable("poiEntity", poiEntity);
showSlidingFragment(1, bundle); PoiFragment poiFragment = PoiFragment.newInstance(bundle);
LatLng newPoiLatLng = new LatLng(Double.valueOf(poiEntity.getY()),Double.valueOf(poiEntity.getX()));
showPoiMarkerByType(1, newPoiLatLng);
showSlidingFragment(poiFragment);
initRemovePoiSharePre(); initRemovePoiSharePre();
return false; return false;
} }
@ -852,7 +830,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putSerializable("poiEntity", poiEntity); bundle.putSerializable("poiEntity", poiEntity);
showSlidingFragment(4, bundle); ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(bundle);
LatLng newPoiLatLng = new LatLng(Double.valueOf(poiEntity.getY()),Double.valueOf(poiEntity.getX()));
showPoiMarkerByType(4, newPoiLatLng);
showSlidingFragment(chargingStationFragment);
initRemovePoiSharePre(); initRemovePoiSharePre();
return false; return false;
} }
@ -865,7 +846,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putSerializable("poiEntity", poiEntity); bundle.putSerializable("poiEntity", poiEntity);
showSlidingFragment(2, bundle); PoiVideoFragment poiVideoFragment = PoiVideoFragment.newInstance(bundle);
LatLng newPoiLatLng = new LatLng(Double.valueOf(poiEntity.getY()),Double.valueOf(poiEntity.getX()));
showPoiMarkerByType(2, newPoiLatLng);
showSlidingFragment(poiVideoFragment);
initRemovePoiSharePre(); initRemovePoiSharePre();
return false; return false;
} }
@ -878,7 +862,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putSerializable("poiEntity", poiEntity); bundle.putSerializable("poiEntity", poiEntity);
showSlidingFragment(3, bundle); RoadFragment roadFragment = RoadFragment.newInstance(bundle);
LatLng newPoiLatLng = new LatLng(Double.valueOf(poiEntity.getY()),Double.valueOf(poiEntity.getX()));
showPoiMarkerByType(3, newPoiLatLng);
showSlidingFragment(roadFragment);
initRemovePoiSharePre(); initRemovePoiSharePre();
return false; return false;
} }
@ -892,7 +879,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putSerializable("poiEntity", poiEntity); bundle.putSerializable("poiEntity", poiEntity);
showSlidingFragment(5, bundle); OtherFragment otherFragment = OtherFragment.newInstance(bundle);
LatLng newPoiLatLng = new LatLng(Double.valueOf(poiEntity.getY()),Double.valueOf(poiEntity.getX()));
showPoiMarkerByType(5, newPoiLatLng);
showSlidingFragment(otherFragment);
initRemovePoiSharePre(); initRemovePoiSharePre();
return false; return false;
} }
@ -943,7 +933,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
FilterFragment filterFragment = (FilterFragment) supportFragmentManager.findFragmentByTag(FilterFragment.class.getName()); FilterFragment filterFragment = (FilterFragment) supportFragmentManager.findFragmentByTag(FilterFragment.class.getName());
if (filterFragment != null) { if (filterFragment != null) {
fragmentTransaction.remove(filterFragment); fragmentTransaction.remove(filterFragment);
} }
} else if (data.what == Constant.GATHER_GET) { //筛选item 点击开始采集 } else if (data.what == Constant.GATHER_GET) { //筛选item 点击开始采集
PoiEntity poiEntity = (PoiEntity) data.obj; PoiEntity poiEntity = (PoiEntity) data.obj;
@ -952,21 +941,30 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
bundle.putSerializable("poiEntity", poiEntity); bundle.putSerializable("poiEntity", poiEntity);
switch (poiEntity.getType()) { switch (poiEntity.getType()) {
case 1: case 1:
showSlidingFragment(1, bundle); PoiFragment poiFragment = PoiFragment.newInstance(bundle);
showSlidingFragment(poiFragment);
break; break;
case 2: case 2:
showSlidingFragment(4, bundle); ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(bundle);
showSlidingFragment(chargingStationFragment);
break; break;
case 3: case 3:
showSlidingFragment(2, bundle); PoiVideoFragment poiVideoFragment = PoiVideoFragment.newInstance(bundle);
showSlidingFragment(poiVideoFragment);
break; break;
case 4: case 4:
showSlidingFragment(3, bundle); RoadFragment roadFragment = RoadFragment.newInstance(bundle);
showSlidingFragment(roadFragment);
break; break;
case 5: case 5:
showSlidingFragment(5, bundle); OtherFragment otherFragment = OtherFragment.newInstance(bundle);
showSlidingFragment(otherFragment);
break; break;
} }
frameLayout.setVisibility(View.GONE);
if (gatherGetFragment != null) {
fragmentTransaction.remove(gatherGetFragment);
}
} else if (data.what == Constant.GATHER_GET_MAP) { //地图界面点击采集 点击开始采集 } else if (data.what == Constant.GATHER_GET_MAP) { //地图界面点击采集 点击开始采集
PoiEntity poiEntity = (PoiEntity) data.obj; PoiEntity poiEntity = (PoiEntity) data.obj;
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
@ -974,28 +972,30 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
bundle.putBoolean("isSliding", true); // 通知抽屉不收回 bundle.putBoolean("isSliding", true); // 通知抽屉不收回
switch (poiEntity.getType()) { switch (poiEntity.getType()) {
case 1: case 1:
showSlidingFragment(1, bundle); PoiFragment poiFragment = PoiFragment.newInstance(bundle);
showSlidingFragment(poiFragment);
break; break;
case 2: case 2:
showSlidingFragment(4, bundle); ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(bundle);
showSlidingFragment(chargingStationFragment);
break; break;
case 3: case 3:
showSlidingFragment(2, bundle); PoiVideoFragment poiVideoFragment = PoiVideoFragment.newInstance(bundle);
showSlidingFragment(poiVideoFragment);
break; break;
case 4: case 4:
showSlidingFragment(3, bundle); RoadFragment roadFragment = RoadFragment.newInstance(bundle);
showSlidingFragment(roadFragment);
break; break;
case 5: case 5:
showSlidingFragment(5, bundle); OtherFragment otherFragment = OtherFragment.newInstance(bundle);
showSlidingFragment(otherFragment);
break; break;
} }
frameLayout.setVisibility(View.GONE); frameLayout.setVisibility(View.GONE);
if (gatherGetFragment != null) { if (gatherGetFragment != null) {
fragmentTransaction.remove(gatherGetFragment); fragmentTransaction.remove(gatherGetFragment);
} }
} else if (data.what == Constant.FILTER_LIST) { // 筛选列表所有数据地图显示
List<PoiEntity> poiEntities = (List<PoiEntity>) data.obj;
initFilterMarker(poiEntities);
} else if (data.what == Constant.TREASURE_WORD) { // POI采集-移动位置 } else if (data.what == Constant.TREASURE_WORD) { // POI采集-移动位置
initPoiMarker((LatLng) data.obj); initPoiMarker((LatLng) data.obj);
} else if (data.what == Constant.TREASURE_CHECKED_WORD) {//poi采集 -确定位置 } else if (data.what == Constant.TREASURE_CHECKED_WORD) {//poi采集 -确定位置
@ -1032,9 +1032,14 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
if (markerPile != null) { if (markerPile != null) {
markerPile.remove(); markerPile.remove();
} }
if (bigMarker != null) { if (bigMarker != null) {
bigMarker.setVisible(false); bigMarker.setVisible(false);
} }
for (int i = 0; i < removablesMarker.size(); i++) {
removablesMarker.get(i).remove();
}
removablesMarker.clear();
} else if (data.what == Constant.MAIN_BUTTON_VISIABLE) {//控制主界面各个按钮显隐状态的what值 } else if (data.what == Constant.MAIN_BUTTON_VISIABLE) {//控制主界面各个按钮显隐状态的what值
setMainButtonVisiable((Integer) data.obj); setMainButtonVisiable((Integer) data.obj);
} else if (data.what == Constant.MAIN_HEADER) {// 控制主界面各个header } else if (data.what == Constant.MAIN_HEADER) {// 控制主界面各个header
@ -1054,11 +1059,16 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED); sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
} else { } else {
frameLayout.setVisibility(View.GONE); frameLayout.setVisibility(View.GONE);
setMainButtonVisiable(View.VISIBLE);
fragmentTransaction.remove(gatherGetFragment); fragmentTransaction.remove(gatherGetFragment);
} }
if (bigMarker != null) { if (bigMarker != null) {
bigMarker.setVisible(false); bigMarker.setVisible(false);
} }
for (int i = 0; i < removablesMarker.size(); i++) {
removablesMarker.get(i).remove();
}
removablesMarker.clear();
} else if (data.what == Constant.CHARGING_STATION) {//充电站的充电桩-新增 } else if (data.what == Constant.CHARGING_STATION) {//充电站的充电桩-新增
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putBoolean("isSliding", false); // 通知抽屉不收回 bundle.putBoolean("isSliding", false); // 通知抽屉不收回
@ -1069,14 +1079,16 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen); BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
LatLng mapCenterPoint = getMapCenterPoint(); LatLng mapCenterPoint = getMapCenterPoint();
markerPile = tencentMap.addMarker(new MarkerOptions(mapCenterPoint).icon(pileDescriptor)); markerPile = tencentMap.addMarker(new MarkerOptions(mapCenterPoint).icon(pileDescriptor));
showSlidingFragment(7, bundle); ChargingPileFragment chargingPileFragment = ChargingPileFragment.newInstance(bundle);
showSlidingFragment(chargingPileFragment);
} else if (data.what == Constant.CHARGING_STATION_PILE) {//充电站的充电桩 } else if (data.what == Constant.CHARGING_STATION_PILE) {//充电站的充电桩
chargingPileEntity = (ChargingPileEntity) data.obj; chargingPileEntity = (ChargingPileEntity) data.obj;
} else if (data.what == Constant.CHARGING_STATION_ITEM) {//充电站的item 跳转到充电桩 } else if (data.what == Constant.CHARGING_STATION_ITEM) {//充电站的item 跳转到充电桩
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putBoolean("isSliding", false); // 通知抽屉不收回 bundle.putBoolean("isSliding", false); // 通知抽屉不收回
bundle.putSerializable("chargingPileEntity", (ChargingPileEntity) data.obj); bundle.putSerializable("chargingPileEntity", (ChargingPileEntity) data.obj);
showSlidingFragment(7, bundle); ChargingPileFragment chargingPileFragment = ChargingPileFragment.newInstance(bundle);
showSlidingFragment(chargingPileFragment);
} else if (data.what == Constant.HOME_TREASURE) {//寻宝的刷新 } else if (data.what == Constant.HOME_TREASURE) {//寻宝的刷新
if ((boolean) data.obj) { if ((boolean) data.obj) {
initList(Constant.currentLocation); initList(Constant.currentLocation);
@ -1104,40 +1116,55 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putBoolean("isSliding", true); // 通知抽屉不收回 bundle.putBoolean("isSliding", true); // 通知抽屉不收回
bundle.putSerializable("poiEntity", poiEntity); bundle.putSerializable("poiEntity", poiEntity);
switch (poiEntity.getType()) {//1 "POI"2 "充电站"3 "POI录像"4 "道路录像"5 "其他"6 "面状任务" switch (poiEntity.getType()) {
case 1: case 1:
showSlidingFragment(1, bundle); PoiFragment poiFragment = PoiFragment.newInstance(bundle);
showSlidingFragment(poiFragment);
break; break;
case 2: case 2:
showSlidingFragment(4, bundle); ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(bundle);
showSlidingFragment(chargingStationFragment);
break; break;
case 3: case 3:
showSlidingFragment(2, bundle); PoiVideoFragment poiVideoFragment = PoiVideoFragment.newInstance(bundle);
showSlidingFragment(poiVideoFragment);
break; break;
case 4: case 4:
showSlidingFragment(3, bundle); RoadFragment roadFragment = RoadFragment.newInstance(bundle);
showSlidingFragment(roadFragment);
break; break;
case 5: case 5:
showSlidingFragment(5, bundle); OtherFragment otherFragment = OtherFragment.newInstance(bundle);
showSlidingFragment(otherFragment);
break; break;
} }
frameLayout.setVisibility(View.GONE); frameLayout.setVisibility(View.GONE);
if (gatherGetFragment != null) { if (gatherGetFragment != null) {
fragmentTransaction.remove(gatherGetFragment); fragmentTransaction.remove(gatherGetFragment);
} }
} else if (data.what == Constant.EVENT_WORK_UNPOLYGON) {//面妆任务点击立即采集或者结束采集需要回到寻宝界面
if ((boolean) data.obj) {
setMainButtonVisiable(View.VISIBLE);
frameLayout.setVisibility(View.GONE);
fragmentTransaction.remove(gatherGetFragment);
if (bigMarker != null) {
bigMarker.setVisible(false);
} }
Toast.makeText(getActivity(), "不在作业范围", Toast.LENGTH_SHORT).show();
} else {
frameLayout.setVisibility(View.VISIBLE);
} }
private void initRemoveFragment() {
PoiFragment poiFragments = (PoiFragment) supportFragmentManager.findFragmentByTag(PoiFragment.class.getName());
if (poiFragments != null) {
fragmentTransaction.remove(poiFragments);
}
ChargingStationFragment chargingStationFragment = (ChargingStationFragment) supportFragmentManager.findFragmentByTag(ChargingStationFragment.class.getName());
if (chargingStationFragment != null) {
fragmentTransaction.remove(chargingStationFragment);
}
PoiVideoFragment poiVideoFragment = (PoiVideoFragment) supportFragmentManager.findFragmentByTag(PoiVideoFragment.class.getName());
if (poiVideoFragment != null) {
fragmentTransaction.remove(poiVideoFragment);
}
RoadFragment roadFragment = (RoadFragment) supportFragmentManager.findFragmentByTag(RoadFragment.class.getName());
if (roadFragment != null) {
fragmentTransaction.remove(roadFragment);
}
OtherFragment otherFragment = (OtherFragment) supportFragmentManager.findFragmentByTag(OtherFragment.class.getName());
if (otherFragment != null) {
fragmentTransaction.remove(otherFragment);
} }
} }
@ -1156,16 +1183,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
ivMessage.setVisibility(visiable); ivMessage.setVisibility(visiable);
} }
private void initFilterMarker(List<PoiEntity> poiEntities) {
sliding_layout.setPanelHeight(1000);
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
for (int i = 0; i < poiEntities.size(); i++) {
LatLng position = new LatLng(Double.valueOf(poiEntities.get(i).getY()), Double.valueOf(poiEntities.get(i).getX()));
tencentMap.addMarker(new MarkerOptions(position).zIndex(2));
}
}
private void initPoiMarker(LatLng latLng) { private void initPoiMarker(LatLng latLng) {
LatLng mapCenterPoint = getMapCenterPoint(); LatLng mapCenterPoint = getMapCenterPoint();
CameraUpdate cameraSigma = CameraUpdateFactory.newCameraPosition(new CameraPosition( CameraUpdate cameraSigma = CameraUpdateFactory.newCameraPosition(new CameraPosition(
@ -1182,15 +1199,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
if (markerPoi != null) { if (markerPoi != null) {
markerPoi.setFixingPoint(screenPosition.x, screenPosition.y); markerPoi.setFixingPoint(screenPosition.x, screenPosition.y);
} }
} }
@Override @Override
public void onCancel() { public void onCancel() {}
}
}); });
} }
private void initPileMarker(LatLng latLng) { private void initPileMarker(LatLng latLng) {
@ -1209,15 +1221,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
if (markerPile != null) { if (markerPile != null) {
markerPile.setFixingPoint(screenPosition.x, screenPosition.y); markerPile.setFixingPoint(screenPosition.x, screenPosition.y);
} }
} }
@Override @Override
public void onCancel() { public void onCancel() {}
}
}); });
} }
private void initCheckedPileMarker(int poiWord) { private void initCheckedPileMarker(int poiWord) {
@ -1335,6 +1342,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
if (bigMarker != null) { if (bigMarker != null) {
bigMarker.remove(); bigMarker.remove();
} }
for (int i = 0; i < removablesMarker.size(); i++) {
removablesMarker.get(i).remove();
}
removablesMarker.clear();
EventBus.getDefault().unregister(this); EventBus.getDefault().unregister(this);
} }
@ -1370,6 +1381,11 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
case R.id.iv_submit://弹窗 case R.id.iv_submit://弹窗
//分享 //分享
CharSequence title = "请选择上报类型"; CharSequence title = "请选择上报类型";
// 如果当前fragment是筛选则移除该fragment
FilterFragment filterFragments = (FilterFragment) supportFragmentManager.findFragmentByTag(FilterFragment.class.getName());
if (filterFragments != null) {
fragmentTransaction.remove(filterFragments);
}
DialogSettings.style = DialogSettings.STYLE.STYLE_MIUI; DialogSettings.style = DialogSettings.STYLE.STYLE_MIUI;
List<ShareDialog.Item> itemList = new ArrayList<>(); List<ShareDialog.Item> itemList = new ArrayList<>();
itemList.add(new ShareDialog.Item(getContext(), R.drawable.push_poi, "POI")); itemList.add(new ShareDialog.Item(getContext(), R.drawable.push_poi, "POI"));
@ -1396,23 +1412,28 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
switch (index) { switch (index) {
case 0: // POI case 0: // POI
showPoiMarkerByType(1, newPoiLatLng); showPoiMarkerByType(1, newPoiLatLng);
showSlidingFragment(1, bundle); PoiFragment poiFragment = PoiFragment.newInstance(bundle);
showSlidingFragment(poiFragment);
break; break;
case 1: // POI录像 case 1: // POI录像
showPoiMarkerByType(2, newPoiLatLng); showPoiMarkerByType(2, newPoiLatLng);
showSlidingFragment(2, bundle); PoiVideoFragment poiVideoFragment = PoiVideoFragment.newInstance(bundle);
showSlidingFragment(poiVideoFragment);
break; break;
case 2://道路录像 case 2://道路录像
showPoiMarkerByType(3, newPoiLatLng); showPoiMarkerByType(3, newPoiLatLng);
showSlidingFragment(3, bundle); RoadFragment roadFragment = RoadFragment.newInstance(bundle);
showSlidingFragment(roadFragment);
break; break;
case 3://充电站 case 3://充电站
showPoiMarkerByType(4, newPoiLatLng); showPoiMarkerByType(4, newPoiLatLng);
showSlidingFragment(4, bundle); ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(bundle);
showSlidingFragment(chargingStationFragment);
break; break;
case 4://其他 case 4://其他
showPoiMarkerByType(5, newPoiLatLng); showPoiMarkerByType(5, newPoiLatLng);
showSlidingFragment(5, bundle); OtherFragment otherFragment = OtherFragment.newInstance(bundle);
showSlidingFragment(otherFragment);
break; break;
} }
return false; return false;
@ -1422,7 +1443,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
case R.id.iv_filter: case R.id.iv_filter:
initThread(); initThread();
initList(Constant.currentLocation); initList(Constant.currentLocation);
showSlidingFragment(6, new Bundle()); FilterFragment filterFragment = FilterFragment.newInstance(new Bundle());
showSlidingFragment(filterFragment);
break; break;
case R.id.iv_message: case R.id.iv_message:
Intent messageIntent = new Intent(getContext(), FragmentManagement.class); Intent messageIntent = new Intent(getContext(), FragmentManagement.class);
@ -1444,7 +1466,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
} else if (type == 5) { } else if (type == 5) {
markerPoi = tencentMap.addMarker(new MarkerOptions(latLng).icon(bitmapDescriptor5).zIndex(2)); markerPoi = tencentMap.addMarker(new MarkerOptions(latLng).icon(bitmapDescriptor5).zIndex(2));
} }
} }
/** /**
@ -1460,91 +1481,45 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
/** /**
* 将fragment显示到抽屉内 * 将fragment显示到抽屉内
*/ */
private void showSlidingFragment(int type, Bundle bundle) { private void showSlidingFragment(BaseDrawerFragment fragment) {
FragmentTransaction fragmentTransaction = supportFragmentManager.beginTransaction(); fragmentTransaction = supportFragmentManager.beginTransaction();
int[] deviceInfo = DensityUtil.getDeviceInfo(getActivity()); int[] deviceInfo = DensityUtil.getDeviceInfo(getActivity());
sliding_layout.setPanelHeight(deviceInfo[1] / 2); sliding_layout.setPanelHeight(deviceInfo[1] / 2);
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED); sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
hideAllFragment(fragmentTransaction); fragmentTransaction.add(R.id.scroll_view, fragment, fragment.getClass().getName());
switch (type) { if (!(fragment instanceof FilterFragment)) {
case 1://poi: FilterFragment filterFragment = (FilterFragment) supportFragmentManager.findFragmentByTag(FilterFragment.class.getName());
if (poiFragment == null) { if (filterFragment != null) {
poiFragment = PoiFragment.newInstance(bundle); fragmentTransaction.hide(filterFragment);
fragmentTransaction.add(R.id.scroll_view, poiFragment);
} else {
fragmentTransaction.show(poiFragment);
} }
break;
case 2://poi录像
if (poiVideoFragment == null) {
poiVideoFragment = PoiVideoFragment.newInstance(bundle);
fragmentTransaction.add(R.id.scroll_view, poiVideoFragment);
} else {
fragmentTransaction.show(poiVideoFragment);
} }
break; if (!(fragment instanceof ChargingStationFragment)) {
case 3://道路 ChargingStationFragment chargingStationFragment = (ChargingStationFragment) supportFragmentManager.findFragmentByTag(ChargingStationFragment.class.getName());
if (roadFragment == null) { if (chargingStationFragment != null) {
roadFragment = RoadFragment.newInstance(bundle); fragmentTransaction.hide(chargingStationFragment);
fragmentTransaction.add(R.id.scroll_view, roadFragment);
} else {
fragmentTransaction.show(roadFragment);
} }
break;
case 4://充电站
if (chargingStationFragment == null) {
chargingStationFragment = ChargingStationFragment.newInstance(bundle);
fragmentTransaction.add(R.id.scroll_view, chargingStationFragment);
} else {
fragmentTransaction.show(chargingStationFragment);
} }
break; if (!(fragment instanceof PoiFragment)) {
case 5://其他 PoiFragment poiFragment = (PoiFragment) supportFragmentManager.findFragmentByTag(PoiFragment.class.getName());
if (otherFragment == null) {
otherFragment = OtherFragment.newInstance(bundle);
fragmentTransaction.add(R.id.scroll_view, otherFragment);
} else {
fragmentTransaction.show(otherFragment);
}
break;
case 6://删选
if (filterFragment == null) {
filterFragment = FilterFragment.newInstance(bundle);
fragmentTransaction.add(R.id.scroll_view, filterFragment);
} else {
fragmentTransaction.show(filterFragment);
}
break;
case 7:
if (chargingPileFragment == null) {
chargingPileFragment = ChargingPileFragment.newInstance(bundle);
fragmentTransaction.add(R.id.scroll_view, chargingPileFragment);
} else {
fragmentTransaction.show(chargingPileFragment);
}
break;
}
fragmentTransaction.commit();
}
private void hideAllFragment(FragmentTransaction fragmentTransaction) {
if (poiFragment != null) { if (poiFragment != null) {
fragmentTransaction.hide(poiFragment); fragmentTransaction.hide(poiFragment);
} else if (poiVideoFragment != null) {
fragmentTransaction.hide(poiVideoFragment);
} else if (chargingStationFragment != null) {
fragmentTransaction.hide(chargingStationFragment);
} else if (roadFragment != null) {
fragmentTransaction.hide(roadFragment);
} else if (otherFragment != null) {
fragmentTransaction.hide(otherFragment);
} else if (filterFragment != null) {
fragmentTransaction.hide(filterFragment);
} else if (chargingPileFragment != null) {
fragmentTransaction.hide(chargingPileFragment);
} }
}
if (!(fragment instanceof RoadFragment)) {
RoadFragment roadFragment = (RoadFragment) supportFragmentManager.findFragmentByTag(RoadFragment.class.getName());
if (roadFragment != null) {
fragmentTransaction.hide(roadFragment);
}
}
if (!(fragment instanceof PoiVideoFragment)) {
PoiVideoFragment poiVideoFragment = (PoiVideoFragment) supportFragmentManager.findFragmentByTag(PoiVideoFragment.class.getName());
if (poiVideoFragment != null) {
fragmentTransaction.hide(poiVideoFragment);
}
}
fragmentTransaction.show(fragment);
fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();
} }
/** /**

View File

@ -92,6 +92,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
.url(HttpInterface.GET_PRICE) .url(HttpInterface.GET_PRICE)
.cls(GetPriceBean.class) .cls(GetPriceBean.class)
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.params(new HttpParams())
.getRequest(new Callback<GetPriceBean>() { .getRequest(new Callback<GetPriceBean>() {
@Override @Override
public void onSuccess(GetPriceBean response, int id) { public void onSuccess(GetPriceBean response, int id) {

View File

@ -1,50 +1,119 @@
package com.navinfo.outdoor.http; package com.navinfo.outdoor.http;
public class HttpInterface { import com.navinfo.outdoor.api.Constant;
public class HttpInterface {
public static final String IP="http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口
public static final String USER_PATH="/user/";//我的
public static final String MSG_LIST_PATH="/msgList/";//发现
public static final String USER_LOGIN_PATH="/userlogin/";//登录
public static final String PRICE_PATH="/price/";//提现
public static final String TASK_PATH="/task/";//任务
public static final String USERID= Constant.USERID;
/**
* 我的
* Path=/m4/user/*
*/
public static final String MSG_CONTENT = IP +USER_PATH+ "user/m4"+USERID+"/msg_content";//发现 -富文本详情页请求
//172.23.139.4:8001/m4/user/update
public static final String USER_UPDATE =IP +USER_PATH+ "user/m4/user/update";//用户资料
//172.23.139.4:8001/m4/userBankcard/update
public static final String USER_BANKCARD_UP_DATA =IP +USER_PATH+ "user/m4/userBankcard/update"; //绑定银行卡
//172.23.139.4:8001/m4/userAuth/add
public static final String USER_AUTH_ADD = IP+USER_PATH+ "userAuth/add"; //实名认证
/**
* 发现
* Path=/m4/msgList/**
*/
// public static final String IP1 = "http://dtxbmaps.navinfo.com/dtxb/msg/";
public static final String listTask = IP +MSG_LIST_PATH+ "m4/findAndMessage/"+USERID+"/msg_list";//任务专区
public static final String listEvent = IP +MSG_LIST_PATH+ "m4/findAndMessage/"+USERID+"/msg_list";//活动专区
public static final String listTaskExplain = IP +MSG_LIST_PATH+"m4/findAndMessage/"+USERID+"/msg_list";//任务说明
//http://172.23.139.4:8002/m4/findAndMessage/1/msg_list?fid=1&pageNum=1&pageSize=2
public static final String MSG_LISt = IP +MSG_LIST_PATH+ "m4/findAndMessage/"+USERID+"/msg_list";//发现查询接口
//http://172.23.139.4:8002/m4/findAndMessage/1/exam_content?id=11
public static final String EXAM_CONTENT = IP +MSG_LIST_PATH+ "m4/findAndMessage/"+USERID+"/exam_content";//发现 -能力测评获取试题接口
//http://172.23.139.4:8002/m4/findAndMessage/1/submitExam
public static final String EXAM_SUBMIT = IP +MSG_LIST_PATH+ "m4/findAndMessage/"+USERID+"/submitExam";//发现 -能力测评提交试卷 post
/**
* 登录
* Path=/m4/userlogin/**
*/
//http://172.23.139.4:9999/m4/userlogin/oauth/token
public static final String USER_LOGIN_OAUTH_TOKEN = IP +USER_LOGIN_PATH+ "oauth/token"; //登录接口
/**
* 提现 金额
* Path=/m4/price/**
*/
//http://172.23.139.4:8004/userPrice/1/getPrice
public static final String GET_PRICE = IP +PRICE_PATH+ "userPrice/"+USERID+"/getPrice";//我的-总资产
//http://172.23.139.4:8004/userPrice/1/userPriceExchange?exchangeMoney=10&payType=1
public static final String USER_PRICE_EXCHANGE =IP +PRICE_PATH+ "userPrice/"+USERID+"/userPriceExchange";//我的-财务信息-提现
/**
* 任务
*Path=/m4/task/**
*/
//172.23.139.4:8003/m4/task/1/getList
public static final String TASK_LIST = IP+TASK_PATH + "m4/task/"+USERID+"/getList"; //任务搜索
//172.23.139.4:8003/othertask/1/receivedOthertask
public static final String RECEIVED_OTHER_TASK = IP+TASK_PATH + "othertask/"+USERID+"/receivedOthertask";//其他-领取任务
//172.23.139.4:8003/poitask/1/receivedPoitask/1
public static final String RECEIVED_POI_TASK = IP+TASK_PATH + "poitask/"+USERID+"/receivedPoitask";//poi-领取任务
//172.23.139.4:8003/poitask/1/submitPoitask?taskId=5001&name=测试修改名称&address=测试修改地址&existence=1&geo=1rn7exd5uhxy&memo=测试备注...33.
public static final String SUBMIT_POI_TASK = IP+TASK_PATH + "poitask/"+USERID+"/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 = IP+TASK_PATH + "othertask/"+USERID+"/submitOthertask";//其他-保存本地
//172.23.139.4:8003/othertask/1/uploadpic
public static final String OTHER_TASK_UPLOAD_PIC = IP+TASK_PATH + "othertask/"+USERID+"/uploadpic";//其他-上传
//172.23.139.4:8003/ctask/1/receivedCtask/8608
public static final String RECEIVED_CTASK = IP+TASK_PATH + "ctask/"+USERID+"/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 = IP+TASK_PATH + "ctask/"+USERID+"/submitCtask";//充电站-保存本地
//172.23.139.4:8003/cstask/1/submitCstask?taskId=0&name=充电站&geo=1rn7exd5uhxy&memo=测试备注&sptype=1&ffid=104&existence=1&detail={"cp_openType":"1,2","cp_floor":1,"cp_availableState":0,"sign_exist":0}
public static final String SUBMIT_CSTASK = IP+TASK_PATH + "cstask/"+USERID+"/submitCstask";//充电桩保存
//172.23.139.4:8003/poitask/1/uploadpic
public static final String POI_TASK_UPLOAD_PIC = IP+TASK_PATH + "poitask/"+USERID+"/uploadpic";//poi-上传
//172.23.139.4:8003/roadtask/1/receivedRoadtask/8569
public static final String RECEIVED_ROAD_TASK = IP+TASK_PATH + "roadtask/"+USERID+"/receivedRoadtask";//道路任务获取
//172.23.139.4:8003/poivideotask/1/receivedPoivideotask/8569
public static final String RECEIVED_POI_VIDEO_TASK = IP+TASK_PATH + "poivideotask/"+USERID+"/receivedPoivideotask";//poi录像任务获取
// 172.23.139.4:8003/poivideotask/1/submitPoivideotask
public static final String INSIDE_API_LIST = IP+TASK_PATH + "poivideotask/"+USERID+"/submitPoivideotask";//poi录像 保存
//172.23.139.4:8003/poivideotask/1/uploadpic
public static final String POI_VIDEO_UPLOAD_PIC = IP+TASK_PATH + "poivideotask/"+USERID+"/uploadpic";//poi录像-上传
//172.23.139.4:8003/roadtask/1/submitRoadtask?taskId=0&name=段哥&address=二娃&memo=1rn7exd5uhxy&workType=2
public static final String ROAD_TASK_SUBMIT = IP+TASK_PATH +"roadtask/"+USERID+"/submitRoadtask";//道路录像-保存本地
//172.23.139.4:8003/roadtask/1/uploadpic
public static final String ROAD_TASK_UPLOAD_PIC= IP+TASK_PATH +"roadtask/"+USERID+"/uploadpic";//道路录像上传
//http://172.23.139.4:8003/m4/task/1/getPhone?geo=1rn7exd5uhxy
public static final String GET_PHONES = IP+TASK_PATH + "m4/task/"+USERID+"/getPhone";//电话区号和电话位数
//172.23.139.4:8003/cstask/1/uploadpic
public static final String CS_TASK_UP_LOAD_PIC = IP+TASK_PATH + "cstask/"+USERID+"/uploadpic";//充电桩-上传
//172.23.139.4:8003/ctask/1/uploadpic
public static final String C_TASK_UP_LOAD_PIC= IP+TASK_PATH +"ctask/"+USERID+"/uploadpic";//充电站-上传
//172.23.139.4:8003/m4/task/1/taskName?geo=1rn7exd5uhxy&name=四维
public static final String TASK_NAME = IP+TASK_PATH +"m4/task/"+USERID+"/taskName";//poi-查重
//172.23.139.4:8003/m4/task/1/getCommitList?type=2&pageSize=10&pageNum=1
public static final String GET_COMMIT_LIST = IP+TASK_PATH +"m4/task/"+USERID+"/getCommitList";
public static final String RECEIVED_POLYGON_TASK = IP+TASK_PATH + "polygonTask/"+USERID+"/receivedPolygontask"; //面状任务任务领取
//172.23.139.4:8003/m4/task/1/unReceivedTask?taskIds=&auditIds=214,278 取消领取的接口
public static final String UNRECEIVED_POLYGON_TASK = IP+TASK_PATH + "m4/task/"+USERID+"/unReceivedTask";//面状任务结束领取
public static final String COMPLETE = IP+TASK_PATH + "polygonTask/"+USERID+"/complete";//面状任务任务采集
public static final String SUBMIT_POLYGON_TASK = IP+TASK_PATH + "polygonTask/"+USERID+"/submitPolygontask";//面状任务结束采集
/**
*
//http://172.21.91.160:8000/api/user/list //http://172.21.91.160:8000/api/user/list
//发现接口 //发现接口
//http://172.23.139.4:8002/m4/findAndMessage/1/msg_list?fid=1&pageNum=1&pageSize=2 //http://172.23.139.4:8002/m4/findAndMessage/1/msg_list?fid=1&pageNum=1&pageSize=2
//能力测评接口 //能力测评接口
//http://172.23.139.4:8002/m4/findAndMessage/1/exam_content?id=11 //http://172.23.139.4:8002/m4/findAndMessage/1/exam_content?id=11
//http://172.23.139.4:8002/m4/findAndMessage/1/submitExam //http://172.23.139.4:8002/m4/findAndMessage/1/submitExam
/**
* - Path=/m4/user/**
* - Path=/m4/msgList/**
* - Path=/m4/userlogin/**
* - Path=/m4/price/**
* - Path=/m4/task/**
*/
public static final String IP="http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口
/**
* 用户
*
*/
//发现测试接口
/**
* 我的
* Path=/m4/user/*
*/
/**
* 发现
* Path=/m4/msgList/**
*/
/**
* 登录
* Path=/m4/userlogin/**
*/
/**
* 提现 金额
* Path=/m4/userlogin/**
*/
/**
* 任务 -
*Path=/m4/task/**
*/
public static final String IP1 = "http://dtxbmaps.navinfo.com/dtxb/msg/m4/findAndMessage/1/"; public static final String IP1 = "http://dtxbmaps.navinfo.com/dtxb/msg/m4/findAndMessage/1/";
//发现测试接口
public static final String listTask = IP1 + "msg_list";//任务专区 public static final String listTask = IP1 + "msg_list";//任务专区
public static final String listEvent = IP1 + "msg_list";//活动专区 public static final String listEvent = IP1 + "msg_list";//活动专区
public static final String listTaskExplain = IP1 + "msg_list";//任务说明 public static final String listTaskExplain = IP1 + "msg_list";//任务说明
@ -52,8 +121,12 @@ public class HttpInterface {
public static final String EXAM_CONTENT = IP1 + "exam_content";//发现 -能力测评获取试题接口 public static final String EXAM_CONTENT = IP1 + "exam_content";//发现 -能力测评获取试题接口
public static final String EXAM_SUBMIT = IP1 + "submitExam";//发现 -能力测评提交试卷 post public static final String EXAM_SUBMIT = IP1 + "submitExam";//发现 -能力测评提交试卷 post
public static final String IPm4 = "http://dtxbmaps.navinfo.com/dtxb/user/m4"; public static final String IPm4 = "http://dtxbmaps.navinfo.com/dtxb/user/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/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
@ -61,20 +134,19 @@ public class HttpInterface {
public static final String IPm5 = "http://dtxbmaps.navinfo.com/dtxb/price/"; public static final String IPm5 = "http://dtxbmaps.navinfo.com/dtxb/price/";
//http://172.23.139.4:8004/userPrice/1/getPrice //http://172.23.139.4:8004/userPrice/1/getPrice
// dtxbmaps.navinfo.com/dtxb/m4/price/userPrice/1/getPrice
public static final String GET_PRICE = IPm5 + "userPrice/1/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 + "userPrice/1/userPriceExchange";//我的-财务信息-提现 public static final String USER_PRICE_EXCHANGE = IPm5 + "userPrice/1/userPriceExchange";//我的-财务信息-提现
public static final String IPm6 = "http://dtxbmaps.navinfo.com/dtxb/task/"; public static final String IPm6 = "http://dtxbmaps.navinfo.com/dtxb/task/";
//172.23.139.4:8003/m4/task/1/getList //172.23.139.4:8003/m4/task/1/getList
// dtxbmaps.navinfo.com/dtxb/m4/task/m4/task/1/getList
public static final String TASK_LIST = IPm6 + "m4/task/1/getList"; //任务搜索 public static final String TASK_LIST = IPm6 + "m4/task/1/getList"; //任务搜索
//172.23.139.4:8003/othertask/1/receivedOthertask //172.23.139.4:8003/othertask/1/receivedOthertask
public static final String RECEIVED_OTHER_TASK = IPm6 + "othertask/1/receivedOthertask";//其他-领取任务 public static final String RECEIVED_OTHER_TASK = IPm6 + "othertask/1/receivedOthertask";//其他-领取任务
//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 = IPm6 + "poitask/1/receivedPoitask";//poi-领取任务 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=测试备注...33. //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 = IPm6 + "poitask/1/submitPoitask";//poi-保存本地
//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 = IPm6 + "othertask/1/submitOthertask";//其他-保存本地
@ -94,12 +166,18 @@ public class HttpInterface {
public static final String RECEIVED_POI_VIDEO_TASK = IPm6 + "poivideotask/1/receivedPoivideotask";//poi录像任务获取 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 = IPm6 + "poivideotask/1/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 = IPm6 + "poivideotask/1/uploadpic";//poi录像-上传 public static final String POI_VIDEO_UPLOAD_PIC = IPm6 + "poivideotask/1/uploadpic";//poi录像-上传
//172.23.139.4:8003/roadtask/1/submitRoadtask?taskId=0&name=段哥&address=二娃&memo=1rn7exd5uhxy&workType=2 //172.23.139.4:8003/roadtask/1/submitRoadtask?taskId=0&name=段哥&address=二娃&memo=1rn7exd5uhxy&workType=2
public static final String ROAD_TASK_SUBMIT = IPm6+"roadtask/1/submitRoadtask";//道路录像-保存本地 public static final String ROAD_TASK_SUBMIT = IPm6+"roadtask/1/submitRoadtask";//道路录像-保存本地
//172.23.139.4:8003/roadtask/1/uploadpic //172.23.139.4:8003/roadtask/1/uploadpic
public static final String ROAD_TASK_UPLOAD_PIC=IPm6+"roadtask/1/uploadpic";//道路录像上传 public static final String ROAD_TASK_UPLOAD_PIC=IPm6+"roadtask/1/uploadpic";//道路录像上传
//http://172.23.139.4:8003/m4/task/1/getPhone?geo=1rn7exd5uhxy
public static final String GET_PHONE = IPm6 + "m4/task/1/getPhone"; //任务搜索
//http://172.23.139.4:8003/m4/task/1/getPhone?geo=1rn7exd5uhxy //http://172.23.139.4:8003/m4/task/1/getPhone?geo=1rn7exd5uhxy
public static final String GET_PHONES = IPm6 + "m4/task/1/getPhone";//电话区号和电话位数 public static final String GET_PHONES = IPm6 + "m4/task/1/getPhone";//电话区号和电话位数
//172.23.139.4:8003/cstask/1/uploadpic //172.23.139.4:8003/cstask/1/uploadpic
@ -108,19 +186,122 @@ public class HttpInterface {
public static final String C_TASK_UP_LOAD_PIC= IPm6+"ctask/1/uploadpic";//充电站-上传 public static final String C_TASK_UP_LOAD_PIC= IPm6+"ctask/1/uploadpic";//充电站-上传
//172.23.139.4:8003/m4/task/1/taskName?geo=1rn7exd5uhxy&name=四维 //172.23.139.4:8003/m4/task/1/taskName?geo=1rn7exd5uhxy&name=四维
public static final String TASK_NAME = IPm6+"m4/task/1/taskName";//poi-查重 public static final String TASK_NAME = IPm6+"m4/task/1/taskName";//poi-查重
//172.23.139.4:8003/m4/task/1/getCommitList?type=2&pageSize=10&pageNum=1 //172.23.139.4:8003/m4/task/1/getCommitList?type=2&pageSize=10&pageNum=1
public static final String GET_COMMIT_LIST = IPm6+"m4/task/1/getCommitList"; public static final String GET_COMMIT_LIST = IPm6+"m4/task/1/getCommitList";
public static final String IPm7 = "http://dtxbmaps.navinfo.com/dtxb/user"; public static final String IPm7 = "http://dtxbmaps.navinfo.com/dtxb/user";
//172.23.139.4:8001/m4/userAuth/add //172.23.139.4:8001/m4/userAuth/add
public static final String USER_AUTH_ADD = IPm7 + "/userAuth/add"; //实名认证 public static final String USER_AUTH_ADD = IPm7 + "/userAuth/add"; //实名认证
public static final String IPm8 = "http://172.23.139.4:9999/m4/"; public static final String IPm8 = "http://172.23.139.4:9999/m4/";
//http://172.23.139.4:9999/m4/userlogin/oauth/token //http://172.23.139.4:9999/m4/userlogin/oauth/token
public static final String USER_LOGIN_OAUTH_TOKEN = IPm8 + "userlogin/oauth/token"; //登录接口 public static final String USER_LOGIN_OAUTH_TOKEN = IPm8 + "userlogin/oauth/token"; //登录
/*** 面状任务*/
//http://172.21.91.160:8000/api/user/list
//发现接口
//http://172.23.139.4:8002/m4/findAndMessage/1/msg_list?fid=1&pageNum=1&pageSize=2
//能力测评接口
//http://172.23.139.4:8002/m4/findAndMessage/1/exam_content?id=11
//http://172.23.139.4:8002/m4/findAndMessage/1/submitExam
public static final String IP1 = "http://dtxbmaps.navinfo.com/dtxb/msg/m4/findAndMessage/1/";
//发现测试接口
public static final String listTask = IP1 + "msg_list";//任务专区
public static final String listEvent = IP1 + "msg_list";//活动专区
public static final String listTaskExplain = IP1 + "msg_list";//任务说明
public static final String MSG_LISt = IP1 + "msg_list";//发现查询接口
public static final String EXAM_CONTENT = IP1 + "exam_content";//发现 -能力测评获取试题接口
public static final String EXAM_SUBMIT = IP1 + "submitExam";//发现 -能力测评提交试卷 post
public static final String IPm4 = "http://dtxbmaps.navinfo.com/dtxb/user/m4";
public static final String MSG_CONTENT = IPm4 + "/1/msg_content";//发现 -富文本详情页请求
//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 IPm5 = "http://dtxbmaps.navinfo.com/dtxb/price/";
//http://172.23.139.4:8004/userPrice/1/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 + "userPrice/1/userPriceExchange";//我的-财务信息-提现
public static final String IPm6 = "http://dtxbmaps.navinfo.com/dtxb/task/";
//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 = 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 = 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 = IPm6 + "othertask/1/submitOthertask";//其他-保存本地
//172.23.139.4:8003/othertask/1/uploadpic
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 = 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 = IPm6 + "ctask/1/submitCtask";//充电站-保存本地
//172.23.139.4:8003/cstask/1/submitCstask?taskId=0&name=充电站&geo=1rn7exd5uhxy&memo=测试备注&sptype=1&ffid=104&existence=1&detail={"cp_openType":"1,2","cp_floor":1,"cp_availableState":0,"sign_exist":0}
public static final String SUBMIT_CSTASK = IPm6 + "cstask/1/submitCstask";//充电桩保存
//172.23.139.4:8003/poitask/1/uploadpic
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 = IPm6 + "poivideotask/1/uploadpic";//poi录像-上传
//172.23.139.4:8003/roadtask/1/submitRoadtask?taskId=0&name=段哥&address=二娃&memo=1rn7exd5uhxy&workType=2
public static final String ROAD_TASK_SUBMIT = IPm6+"roadtask/1/submitRoadtask";//道路录像-保存本地
//172.23.139.4:8003/roadtask/1/uploadpic
public static final String ROAD_TASK_UPLOAD_PIC=IPm6+"roadtask/1/uploadpic";//道路录像上传
//http://172.23.139.4:8003/m4/task/1/getPhone?geo=1rn7exd5uhxy
public static final String GET_PHONE = IPm6 + "m4/task/1/getPhone"; //任务搜索
//http://172.23.139.4:8003/m4/task/1/getPhone?geo=1rn7exd5uhxy
public static final String GET_PHONES = IPm6 + "m4/task/1/getPhone";//电话区号和电话位数
//172.23.139.4:8003/cstask/1/uploadpic
public static final String CS_TASK_UP_LOAD_PIC = IPm6 + "cstask/1/uploadpic";//充电桩-上传
//172.23.139.4:8003/ctask/1/uploadpic
public static final String C_TASK_UP_LOAD_PIC= IPm6+"ctask/1/uploadpic";//充电站-上传
//172.23.139.4:8003/m4/task/1/taskName?geo=1rn7exd5uhxy&name=四维
public static final String TASK_NAME = IPm6+"m4/task/1/taskName";//poi-查重
//172.23.139.4:8003/m4/task/1/getCommitList?type=2&pageSize=10&pageNum=1
public static final String GET_COMMIT_LIST = IPm6+"m4/task/1/getCommitList";
public static final String IPm7 = "http://dtxbmaps.navinfo.com/dtxb/user";
//172.23.139.4:8001/m4/userAuth/add
public static final String USER_AUTH_ADD = IPm7 + "/userAuth/add"; //实名认证
public static final String IPm8 = "http://172.23.139.4:9999/m4/";
//http://172.23.139.4:9999/m4/userlogin/oauth/token
public static final String USER_LOGIN_OAUTH_TOKEN = IPm8 + "userlogin/oauth/token"; //登录
*面状任务
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";//结束采集
public static final String RECEIVED_POLYGON_TASK = IPm6 + "polygonTask/1/receivedPolygontask"; //任务领取 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 UNRECEIVED_POLYGON_TASK = IPm6 + "polygonTask/1/unReceivedPolygontask";//结束领取
public static final String COMPLETE = IPm6 + "polygonTask/1/complete";//任务采集 public static final String COMPLETE = IPm6 + "polygonTask/1/complete";//任务采集
public static final String SUBMIT_POLYGON_TASK = IPm6 + "polygonTask/1/submitPolygontask";//结束采集 public static final String SUBMIT_POLYGON_TASK = IPm6 + "polygonTask/1/submitPolygontask";//结束采集
* */
} }

View File

@ -124,11 +124,12 @@ public class OkGoBuilder<T> {
// 请求方式和请求url // 请求方式和请求url
.<T>post(url) .<T>post(url)
.isMultipart(true) .isMultipart(true)
.headers(getHeader())
.params(params) .params(params)
// .upJson(json) // .upJson(json)
// 请求的 tag, 主要用于取消对应的请求 // 请求的 tag, 主要用于取消对应的请求
.tag(this) .tag(this)
.headers(getHeader())
// 设置当前请求的缓存key,建议每个不同功能的请求设置一个 // 设置当前请求的缓存key,建议每个不同功能的请求设置一个
// .cacheKey("cacheKey") // .cacheKey("cacheKey")
// 缓存模式详细请看缓存介绍 // 缓存模式详细请看缓存介绍
@ -187,18 +188,21 @@ public class OkGoBuilder<T> {
/** /**
* post 文件 同步请求 * post 文件 同步请求
* *
* @param id * @param
* @return * @return
*/ */
public okhttp3.Response postFileSynchronization(int id) { public okhttp3.Response postFileSynchronization() {
long time = System.currentTimeMillis();
params.put("datetime", time);
try { try {
okhttp3.Response execute = OkGo okhttp3.Response execute = OkGo
// 请求方式和请求url // 请求方式和请求url
.<PoiUploadBean>post(HttpInterface.CS_TASK_UP_LOAD_PIC) .<PoiUploadBean>post(url)
// 请求的 tag, 主要用于取消对应的请求
.params("auditId", id)
.addFileParams("file", files)
.headers(getHeader()) .headers(getHeader())
// 请求的 tag, 主要用于取消对应的请求
.params(params)
.addFileParams("file", files)
.tag(this) .tag(this)
.execute(); .execute();
return execute; return execute;
@ -212,18 +216,19 @@ public class OkGoBuilder<T> {
/** /**
* post 文件 异步请求 * post 文件 异步请求
* *
* @param id * @param
* @param callback * @param callback
* @return * @return
*/ */
public void postFileAsynchronous(int id, Callback callback) { public void postFileAsynchronous(Callback callback) {
long time = System.currentTimeMillis();
params.put("datetime", time);
OkGo OkGo
// 请求方式和请求url // 请求方式和请求url
.<T>post(url) .<T>post(url)
.params("auditId", id)
.addFileParams("file", files)
.headers(getHeader()) .headers(getHeader())
.params(params)
.addFileParams("file", files)
// .upJson(json) // .upJson(json)
// 请求的 tag, 主要用于取消对应的请求 // 请求的 tag, 主要用于取消对应的请求
.tag(this) .tag(this)
@ -259,11 +264,13 @@ public class OkGoBuilder<T> {
* get异步请求 * get异步请求
*/ */
public void getRequest(Callback<T> callback) { public void getRequest(Callback<T> callback) {
long time = System.currentTimeMillis();
params.put("datetime", time);
OkGo OkGo
// 请求方式和请求url // 请求方式和请求url
.<T>get(url) .<T>get(url)
.params(params)
.headers(getHeader()) .headers(getHeader())
.params(params)
// 请求的 tag, 主要用于取消对应的请求 // 请求的 tag, 主要用于取消对应的请求
.tag(this) .tag(this)
// 设置当前请求的缓存key,建议每个不同功能的请求设置一个 // 设置当前请求的缓存key,建议每个不同功能的请求设置一个
@ -295,10 +302,12 @@ public class OkGoBuilder<T> {
* @return * @return
*/ */
public okhttp3.Response getSynchronization() { public okhttp3.Response getSynchronization() {
long time = System.currentTimeMillis();
params.put("datetime", time);
try { try {
okhttp3.Response execute = OkGo.<String>get(HttpInterface.SUBMIT_CSTASK) okhttp3.Response execute = OkGo.<String>get(url)
.params(params)
.headers(getHeader()) .headers(getHeader())
.params(params)
.tag(this) .tag(this)
.execute(); .execute();
return execute; return execute;

View File

@ -175,6 +175,7 @@ public class PoiSaveUtils {
} }
try { try {
Response execute = OkGoBuilder.getInstance().url(url) Response execute = OkGoBuilder.getInstance().url(url)
.Builder(mContext)
.token(Constant.ACCESS_TOKEN).params(httpParams).getSynchronization(); .token(Constant.ACCESS_TOKEN).params(httpParams).getSynchronization();
if (execute.code() != 200) { if (execute.code() != 200) {
return execute.code(); return execute.code();
@ -266,9 +267,14 @@ public class PoiSaveUtils {
url = HttpInterface.OTHER_TASK_UPLOAD_PIC; url = HttpInterface.OTHER_TASK_UPLOAD_PIC;
} }
try { try {
Response execute = OkGoBuilder.getInstance().url(url) HttpParams httpParams=new HttpParams();
httpParams.put("auditId",bodyId);
Response execute = OkGoBuilder.getInstance()
.Builder(mContext)
.url(url)
.params(httpParams)
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.fileList(photoFile).postFileSynchronization(bodyId); .fileList(photoFile).postFileSynchronization();
if (execute.code() != 200) { if (execute.code() != 200) {
return; return;
} }
@ -356,7 +362,9 @@ public class PoiSaveUtils {
hashMap.put("sign_exist", chargingPileEntity.getSign_exist()); hashMap.put("sign_exist", chargingPileEntity.getSign_exist());
httpParams.put("detail", String.valueOf(hashMap)); httpParams.put("detail", String.valueOf(hashMap));
try { try {
Response execute = OkGoBuilder.getInstance().url(HttpInterface.SUBMIT_CSTASK) Response execute = OkGoBuilder.getInstance()
.Builder(mContext)
.url(HttpInterface.SUBMIT_CSTASK)
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.params(httpParams).getSynchronization(); .params(httpParams).getSynchronization();
if (execute.code() != 200) { if (execute.code() != 200) {
@ -424,9 +432,14 @@ public class PoiSaveUtils {
} }
try { try {
Response execute = OkGoBuilder.getInstance().url(HttpInterface.CS_TASK_UP_LOAD_PIC) HttpParams httpParams=new HttpParams();
httpParams.put("auditId",chargingPileEntity.getBodyId());
Response execute = OkGoBuilder.getInstance()
.Builder(mContext)
.url(HttpInterface.CS_TASK_UP_LOAD_PIC)
.token(Constant.ACCESS_TOKEN) .token(Constant.ACCESS_TOKEN)
.fileList(chargingPileFileList).postFileSynchronization((int) chargingPileEntity.getBodyId()); .params(httpParams)
.fileList(chargingPileFileList).postFileSynchronization();
if (execute.code() != 200) { if (execute.code() != 200) {
return execute.code(); return execute.code();
} }