加密和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> {
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;
}
public void setListBeans(List<HasSubmitBean.BodyBean.ListBean> listBeans) {
this.listBeans.addAll(listBeans);
notifyDataSetChanged();
this.listBeans = listBeans;
}
@NonNull

View File

@ -79,11 +79,11 @@ public class UserApplication extends Application {
//builder.cookieJar(new CookieJarImpl(new MemoryCookieStore()));
//超时时间设置默认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)
.setOkHttpClient(builder.build())
//全局统一缓存模式默认不使用缓存可以不传

View File

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

View File

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

View File

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

View File

@ -68,7 +68,7 @@ public class EventPrefectureFragment extends BaseFragment implements View.OnClic
httpParams.put("pageSize", "10");
OkGoBuilder.getInstance()
.Builder(getActivity())
.url(HttpInterface.listEvent)
.url(HttpInterface.MSG_LISt)
.cls(TaskPrefectureBean.class)
.params(httpParams)
.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.Subscribe;
import org.jetbrains.annotations.NotNull;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* 筛选的Fragment
* */
*/
public class FilterFragment extends BaseDrawerFragment implements View.OnClickListener {
private Button btnFilter;
private XRecyclerView recyclerFilter;
@ -144,7 +146,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
@Override
protected void initView() {
super.initView();
poiEntities = new ArrayList<>();
/* JobSearchBean jobSearchBean = (JobSearchBean) getArguments().getSerializable("body");//服务数据
ArrayList<PoiEntity> showAllPoi = (ArrayList<PoiEntity>) getArguments().getSerializable("showAllPoi");//本地数据
if (jobSearchBean != null) {
@ -178,11 +180,12 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
}
@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) {
allPoi = (List<PoiEntity>) data.obj;
} else if (data.what == Constant.JOB_SEARCH_WORD) {
poiEntities.clear();
JobSearchBean jobSearchBean = (JobSearchBean) data.obj;
if (jobSearchBean != null) {
List<JobSearchBean.BodyBean.ListBean> list = jobSearchBean.getBody().getList();
@ -217,7 +220,6 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
poiEntities.addAll(allPoi);
}
filterAdapter.setAllPoi(poiEntities);
}
}
@ -264,7 +266,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
tvType = findViewById(R.id.tv_type);
if (Constant.TASK_STASTUS == -1) {//"未领取", "已领取", "未保存", "已保存"
tvType.setText("全部");
}else if(Constant.TASK_STASTUS==0){
} else if (Constant.TASK_STASTUS == 0) {
tvType.setText("未领取");
} else if (Constant.TASK_STASTUS == 1) {
tvType.setText("已领取");

View File

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

View File

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

View File

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

View File

@ -14,6 +14,7 @@ import android.widget.Toast;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.bumptech.glide.request.RequestOptions;
import com.lzy.okgo.model.HttpParams;
import com.navinfo.outdoor.R;
import com.navinfo.outdoor.activity.FragmentManagement;
import com.navinfo.outdoor.activity.UserActivity;
@ -106,14 +107,19 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
.Builder(getActivity())
.url(HttpInterface.GET_PRICE)
.cls(GetPriceBean.class)
.params(new HttpParams())
.token(Constant.ACCESS_TOKEN)
.getRequest(new Callback<GetPriceBean>() {
@Override
public void onSuccess(GetPriceBean response, int id) {
dismissLoadingDialog();
// 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 + "");
}
Log.d("TAG", "onSuccess: " + response.toString() + "tttttttt");
}

View File

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

View File

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

View File

@ -26,6 +26,7 @@ import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
import com.umeng.commonsdk.debug.D;
import java.util.ArrayList;
import java.util.List;
/**
@ -37,6 +38,8 @@ public class PoiTaskFragment extends BaseFragment implements View.OnClickListene
private int type;
private PoiTaskAdapter poiTaskAdapter;
private TextView tvTaskTitle;
private int page=1;
private List<HasSubmitBean.BodyBean.ListBean> listBeans;
public static PoiTaskFragment newInstance(Bundle bundle) {
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.setOnClickListener(this::onClick);
poiTaskXrv = (XRecyclerView) findViewById(R.id.poiTask_xrv);
poiTaskXrv.setLayoutManager(new LinearLayoutManager(getContext()));
poiTaskXrv.addItemDecoration(new DividerItemDecoration(getContext(),DividerItemDecoration.VERTICAL));
poiTaskXrv.setLayoutManager(new LinearLayoutManager(getActivity()));
poiTaskXrv.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
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() {
@Override
public void onRefresh() {
page = 1;
initWork(type,true);
}
@Override
public void onLoadMore() {
initWork(type,false);
}
});
poiTaskAdapter = new PoiTaskAdapter(getContext(), listBeans);
poiTaskXrv.setAdapter(poiTaskAdapter);
poiTaskXrv.getDefaultFootView().setNoMoreHint("已全部加载完毕");
}
@Override
protected void initData() {
super.initData();
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();
HttpParams httpParams = new HttpParams();
httpParams.put("type", type);
httpParams.put("pageSize", "10");
httpParams.put("pageNum", "2");
httpParams.put("pageNum", page);
OkGoBuilder.getInstance()
.Builder(getActivity())
.url(HttpInterface.GET_COMMIT_LIST)
@ -120,11 +120,9 @@ public class PoiTaskFragment extends BaseFragment implements View.OnClickListene
@Override
public void onSuccess(HasSubmitBean hasSubmitBean, int id) {
dismissLoadingDialog();
List<HasSubmitBean.BodyBean.ListBean> list = hasSubmitBean.getBody().getList();
if (list!=null){
poiTaskAdapter.setListBeans(list);
if (hasSubmitBean.getBody()!=null){
initHasSubmitBean(hasSubmitBean,aBoolean);
}
}
@Override
@ -137,6 +135,41 @@ public class PoiTaskFragment extends BaseFragment implements View.OnClickListene
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
public void onClick(View v) {
switch (v.getId()) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,50 +1,119 @@
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.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
/**
* - 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 listTask = IP1 + "msg_list";//任务专区
public static final String listEvent = 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_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
@ -61,20 +134,19 @@ public class HttpInterface {
public static final String IPm5 = "http://dtxbmaps.navinfo.com/dtxb/price/";
//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";//我的-总资产
//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
// dtxbmaps.navinfo.com/dtxb/m4/task/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=测试备注...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-保存本地
//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";//其他-保存本地
@ -94,12 +166,18 @@ public class HttpInterface {
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
@ -108,19 +186,122 @@ public class HttpInterface {
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 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 UNRECEIVED_POLYGON_TASK = IPm6 + "polygonTask/1/unReceivedPolygontask";//结束领取
public static final String COMPLETE = IPm6 + "polygonTask/1/complete";//任务采集
public static final String SUBMIT_POLYGON_TASK = IPm6 + "polygonTask/1/submitPolygontask";//结束采集
* */
}

View File

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

View File

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