瀏覽代碼

事件列表、水鹤列表以及地图、上报事件、上传文件、查看大图、播放视频

zhanghongrui 2 周之前
父節點
當前提交
f00e364e96
共有 89 個文件被更改,包括 6691 次插入42 次删除
  1. 41 7
      app/src/main/AndroidManifest.xml
  2. 259 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/activity/MonitoringCenterActivity.java
  3. 186 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/activity/MyVideoPlayerActivity.java
  4. 765 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/activity/NewEventActivity.java
  5. 124 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/activity/PermissionListActivity.java
  6. 6 6
      app/src/main/java/com/sjkj/appthreefloor_tsgz/activity/SplashActivity.java
  7. 181 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/activity/WaterCraneResourcesActivity.java
  8. 62 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/activity/viewModel/EventCenterViewModel.java
  9. 193 24
      app/src/main/java/com/sjkj/appthreefloor_tsgz/activity/viewModel/MainViewModel.java
  10. 19 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/activity/viewModel/ResourceVisualizationViewModel.java
  11. 9 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/activity/viewModel/VideoViewModel.java
  12. 33 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/adapter/CameraAdapter.java
  13. 66 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/adapter/CommonDataListAdapter.java
  14. 81 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/adapter/ImageAdapter.java
  15. 9 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/adapter/OnDeleteClick.java
  16. 80 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/adapter/PermissionListAdapter.java
  17. 72 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/adapter/VideoDelAdapter.java
  18. 464 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/address/AddressSelector.java
  19. 57 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/address/CityBean.java
  20. 12 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/address/CityInterface.java
  21. 8 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/address/OnFinishClickListener.java
  22. 15 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/address/OnItemClickListener.java
  23. 39 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/bean/AppEventBean.java
  24. 65 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/bean/AppEventThreeBean.java
  25. 46 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/bean/DailyBean.java
  26. 58 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/bean/DataBean.java
  27. 47 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/bean/FileBean.java
  28. 54 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/bean/ImageBean.java
  29. 32 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/bean/ImageEventBean.java
  30. 63 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/bean/MapBean.java
  31. 31 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/bean/PermissionBean.java
  32. 123 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/bean/ResourceVisualizationBean.java
  33. 112 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/fragment/CommonDataListFragment.java
  34. 345 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/fragment/CommonMapFragment.java
  35. 10 1
      app/src/main/java/com/sjkj/appthreefloor_tsgz/fragment/EventFragment.java
  36. 55 1
      app/src/main/java/com/sjkj/appthreefloor_tsgz/fragment/MainFragment.java
  37. 246 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/fragment/viewModel/MapViewModel.java
  38. 63 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/map/MapMarkBean.java
  39. 52 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/net/AppEventThreeRequest.java
  40. 52 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/net/AppEventTypeRequest.java
  41. 53 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/net/CameraAllListRequest.java
  42. 51 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/net/DepartmentRequest.java
  43. 50 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/net/EventNewRequest.java
  44. 54 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/net/NewDataCenterRequest.java
  45. 38 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/net/RetrofitService.java
  46. 70 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/net/UploadFileRequest.java
  47. 54 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/net/WaterCraneRequest.java
  48. 123 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/utils/DoubleUtils.java
  49. 281 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/utils/EventDepartmentTools.java
  50. 8 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/utils/ItemSlideCallBack.java
  51. 117 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/utils/PopWindowUtil.java
  52. 70 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/utils/SlideItemTouchHelper.java
  53. 70 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/utils/SoftKeyboardUtils.java
  54. 二進制
      app/src/main/res/drawable-xxhdpi/company_location_img.png
  55. 二進制
      app/src/main/res/drawable-xxhdpi/company_location_img_1.png
  56. 二進制
      app/src/main/res/drawable-xxhdpi/ic_san.png
  57. 二進制
      app/src/main/res/drawable-xxhdpi/ic_tongyong.png
  58. 二進制
      app/src/main/res/drawable-xxhdpi/icon_address_arrow_selected.png
  59. 二進制
      app/src/main/res/drawable-xxhdpi/icon_agriculture_cooperatives.png
  60. 二進制
      app/src/main/res/drawable-xxhdpi/icon_camera.png
  61. 二進制
      app/src/main/res/drawable-xxhdpi/icon_close.png
  62. 二進制
      app/src/main/res/drawable-xxhdpi/icon_location_small.png
  63. 二進制
      app/src/main/res/drawable-xxhdpi/user_location_img.png
  64. 7 0
      app/src/main/res/drawable/bg_blue_text.xml
  65. 7 0
      app/src/main/res/drawable/bg_green_text.xml
  66. 9 0
      app/src/main/res/drawable/ic_back.xml
  67. 5 0
      app/src/main/res/drawable/ic_baseline_local_fire_department_24.xml
  68. 6 0
      app/src/main/res/drawable/shape_bg_content_input.xml
  69. 21 0
      app/src/main/res/drawable/shape_border.xml
  70. 139 0
      app/src/main/res/layout/activity_camera_list.xml
  71. 43 0
      app/src/main/res/layout/activity_my_video_player.xml
  72. 511 0
      app/src/main/res/layout/activity_new_event.xml
  73. 55 0
      app/src/main/res/layout/activity_permission_list.xml
  74. 55 0
      app/src/main/res/layout/activity_photo_view.xml
  75. 79 0
      app/src/main/res/layout/activity_resource_water_crane.xml
  76. 36 0
      app/src/main/res/layout/custom_marker.xml
  77. 34 0
      app/src/main/res/layout/fragment_data_list.xml
  78. 28 2
      app/src/main/res/layout/fragment_event.xml
  79. 5 0
      app/src/main/res/layout/fragment_main.xml
  80. 21 0
      app/src/main/res/layout/fragment_map.xml
  81. 25 0
      app/src/main/res/layout/item_address.xml
  82. 51 0
      app/src/main/res/layout/item_camera_list_layout.xml
  83. 79 0
      app/src/main/res/layout/item_common_data_list.xml
  84. 38 0
      app/src/main/res/layout/item_image_list.xml
  85. 58 0
      app/src/main/res/layout/item_permission_list.xml
  86. 50 0
      app/src/main/res/layout/item_video_del_list.xml
  87. 12 0
      app/src/main/res/layout/map_location.xml
  88. 42 0
      app/src/main/res/layout/pop_address.xml
  89. 1 1
      base-lib/src/main/AndroidManifest.xml

+ 41 - 7
app/src/main/AndroidManifest.xml

@@ -55,6 +55,8 @@
         android:supportsRtl="true"
         android:theme="@style/AppTheme"
         tools:replace="allowBackup">
+
+
         <activity
             android:name="com.sjkj.appthreefloor_tsgz.activity.SplashActivity"
             android:noHistory="true"
@@ -72,11 +74,6 @@
                 <category android:name="android.intent.category.BROWSABLE" />
             </intent-filter>
         </activity>
-        <activity
-            android:name="com.sjkj.appthreefloor_tsgz.login.LoginActivity"
-            android:exported="false"
-            android:label="@string/title_activity_login"
-            android:theme="@style/AppTheme.NoActionBar" />
 
         <meta-data
             android:name="com.sjkj.appthreefloor_tsgz.base.glide.OkHttpGlideModule"
@@ -84,6 +81,26 @@
         <meta-data
             android:name="ScopedStorage"
             android:value="true" />
+        <!--        高德key-->
+        <!--        <meta-data-->
+        <!--            android:name="com.amap.api.v2.apikey"-->
+        <!--            android:value="412ff25e16b45ca1be42eb44d972fbca"/>-->
+        <meta-data
+            android:name="com.amap.api.v2.apikey"
+            android:value="412ff25e16b45ca1be42eb44d972fbca">
+
+        </meta-data>
+        <!--声明定位service-->
+        <service
+            android:name="com.amap.api.location.APSService"
+            android:foregroundServiceType="location" />
+
+        <activity
+            android:name="com.sjkj.appthreefloor_tsgz.login.LoginActivity"
+            android:exported="false"
+            android:label="@string/title_activity_login"
+            android:theme="@style/AppTheme.NoActionBar" />
+
 
         <activity
             android:name="com.sjkj.appthreefloor_tsgz.activity.MainActivity"
@@ -94,7 +111,24 @@
         <activity
             android:name="com.sjkj.appthreefloor_tsgz.login.ConfigActivity"
             android:screenOrientation="portrait" />
-
-
+        <activity
+            android:name="com.sjkj.appthreefloor_tsgz.activity.MonitoringCenterActivity"
+            android:screenOrientation="portrait" />
+        <activity
+            android:name="com.sjkj.appthreefloor_tsgz.activity.WaterCraneResourcesActivity"
+            android:screenOrientation="portrait" />
+        <activity
+            android:name="com.sjkj.appthreefloor_tsgz.activity.PermissionListActivity"
+            android:screenOrientation="portrait" />
+        <activity
+            android:name="com.sjkj.appthreefloor_tsgz.activity.NewEventActivity"
+            android:screenOrientation="portrait" />
+        <activity
+            android:name="com.sjkj.appthreefloor_tsgz.weight.photoview.PhotoViewActivity"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppNoTitleTheme" />
+        <activity
+            android:name="com.sjkj.appthreefloor_tsgz.activity.MyVideoPlayerActivity"
+            android:screenOrientation="portrait" />
     </application>
 </manifest>

+ 259 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/activity/MonitoringCenterActivity.java

@@ -0,0 +1,259 @@
+package com.sjkj.appthreefloor_tsgz.activity;
+
+import android.content.Intent;
+import android.view.View;
+
+import androidx.lifecycle.ViewModelProvider;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.scwang.smartrefresh.layout.api.RefreshLayout;
+import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener;
+import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
+import com.sjkj.appthreefloor_tsgz.R;
+import com.sjkj.appthreefloor_tsgz.adapter.CameraAdapter;
+import com.sjkj.appthreefloor_tsgz.app.App;
+import com.sjkj.appthreefloor_tsgz.databinding.ActivityCameraListBinding;
+import com.sjkj.appthreefloor_tsgz.net.CameraAllListRequest;
+import com.sjkj.base_lib.adapter.BaseRecAdapter;
+import com.sjkj.base_lib.camera.dh.bean.CameraBean;
+import com.sjkj.base_lib.camera.dh.view.DHCameraDetailsActivity;
+import com.sjkj.base_lib.camera.dh.vm.CameraViewModel;
+import com.sjkj.base_lib.divider.DividerItem;
+import com.sjkj.base_lib.entity.Params;
+import com.sjkj.base_lib.net.domain.interactor.ProcessErrorSubscriber;
+import com.sjkj.base_lib.utils.AppTools;
+import com.sjkj.base_lib.view.BaseActivity;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 监控中心
+ */
+public class MonitoringCenterActivity extends BaseActivity {
+
+    public static final String TAG = MonitoringCenterActivity.class.getSimpleName();
+    private CameraAdapter adapter;
+    //    private RegionAdapter regionAdapter;
+//    private TypeAdapter typeAdapter;
+//    private List<TypeModel> typeList = new ArrayList<>();
+//    private List<RegionModel> regionList = new ArrayList<>();
+    private List<CameraBean> list = new ArrayList<>();
+    private int currentPage = 1;
+    private ActivityCameraListBinding binding;
+    private CameraViewModel viewModel;
+    private CameraAllListRequest cameraListRequest = new CameraAllListRequest(App.getInstance());
+    private String titleName;
+
+    @Override
+    public int initLayout() {
+        return R.layout.activity_camera_list;
+    }
+
+    @Override
+    public void initBinding() {
+        binding = (ActivityCameraListBinding) getViewDataBinding();
+        viewModel = new ViewModelProvider(MonitoringCenterActivity.this, new ViewModelProvider.NewInstanceFactory()).get(CameraViewModel.class);
+        binding.setViewModel(viewModel);
+        binding.setLifecycleOwner(this);
+    }
+
+    @Override
+    public void initView() {
+        titleName = getIntent().getStringExtra("titleName");
+//        if (TextUtils.isEmpty(titleName)) {
+//            getTitleView().setText(getString(R.string.monitor_center));
+//        } else {
+        getTitleView().setText(titleName);
+        // }
+//        Drawable drawable = getDrawable(R.drawable.event_search_img);
+//        drawable.setBounds(0, 30, 60, 90);
+//        getRightView().setCompoundDrawables(null, drawable, null, null);
+//        getRightView().setOnClickListener(new View.OnClickListener() {
+//            @Override
+//            public void onClick(View view) {
+//                if (binding.drawerLayout.isDrawerVisible(binding.rightLayout)) {
+//                    binding.drawerLayout.closeDrawers();
+//                } else {
+//                    binding.drawerLayout.openDrawer(binding.rightLayout);
+//                }
+//            }
+//        });
+//        getRightView().setVisibility(View.GONE);
+        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
+        linearLayoutManager.setOrientation(RecyclerView.VERTICAL);
+        binding.mainRecyclerView.setLayoutManager(linearLayoutManager);
+        binding.mainRecyclerView.addItemDecoration(new DividerItem(this));
+
+        adapter = new CameraAdapter(this);
+        binding.mainRecyclerView.setAdapter(adapter);
+
+        binding.smartRefreshLayout.setEnableRefresh(true);
+        binding.smartRefreshLayout.setEnableLoadMore(true);
+
+//        FlexboxLayoutManager manager = new FlexboxLayoutManager();
+//        //设置主轴排列方式
+//        manager.setFlexDirection(FlexDirection.ROW);
+//        //设置是否换行
+//        manager.setFlexWrap(FlexWrap.WRAP);
+//        manager.setAlignItems(AlignItems.BASELINE);
+//        binding.recyclerView.setLayoutManager(manager);
+//
+//        FlexboxLayoutManager manager1 = new FlexboxLayoutManager();
+//        //设置主轴排列方式
+//        manager1.setFlexDirection(FlexDirection.ROW);
+//        //设置是否换行
+//        manager1.setFlexWrap(FlexWrap.WRAP);
+//        manager1.setAlignItems(AlignItems.BASELINE);
+//        binding.typeRecyclerView.setLayoutManager(manager1);
+//
+//        regionAdapter = new RegionAdapter(this);
+//        binding.recyclerView.setAdapter(regionAdapter);
+//
+//        typeAdapter = new TypeAdapter(this);
+//        binding.typeRecyclerView.setAdapter(typeAdapter);
+    }
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+    }
+
+    @Override
+    public void initListener() {
+        binding.searchTv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                requestListRefresh();
+            }
+        });
+        binding.smartRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
+            @Override
+            public void onRefresh(RefreshLayout refreshLayout) {
+                requestListRefresh();
+            }
+        });
+        binding.smartRefreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() {
+            @Override
+            public void onLoadMore(RefreshLayout refreshLayout) {
+                requestListLoadMore();
+            }
+        });
+//        regionAdapter.setListener(item -> {
+////            deptId = item;
+//        });
+//
+//        typeAdapter.setListener(item -> {
+////            typeModel = item;
+//        });
+        adapter.setItemClick(new BaseRecAdapter.OnItemClick<CameraBean>() {
+            @Override
+            public void onItemClick(CameraBean bean, int position) {
+                if (AppTools.getCameraType() == AppTools.CAMERA_TYPE_NONE) {
+
+                } else if (AppTools.getCameraType() == AppTools.CAMERA_TYPE_DH) {
+                    Intent intent = new Intent(MonitoringCenterActivity.this, DHCameraDetailsActivity.class);
+                    intent.putExtra("cameraId", bean.getId());
+                    startActivity(intent);
+                } else if (AppTools.getCameraType() == AppTools.CAMERA_TYPE_HK) {
+//                    Intent intent = new Intent(MonitoringCenterActivity.this, HKH5CameraActivity.class);
+//                    intent.putExtra("cameraId", bean.getId());
+//                    startActivity(intent);
+                }
+//                intent.putExtra("deviceName", bean.getCameraId());
+//                intent.putExtra("deviceIp", bean.getCameraId());
+//                intent.putExtra("deviceUserName", bean.getCameraId());
+//                intent.putExtra("devicePassword", bean.getCameraId());
+//                intent.putExtra("devicePort", bean.getCameraId());
+            }
+        });
+    }
+
+    @Override
+    public void loadData() {
+        requestListRefresh();
+//        LocationUtils.getInstance().startLocation(true, new LocationUtils.OnLocationListener() {
+//            @Override
+//            public void onLocationChanged(double lat,double lng,String address,int code) {
+////                ToastUtils.show(aMapLocation.getAddress());
+//                viewModel.latitude.set(aMapLocation.getLatitude());
+//                viewModel.longitude.set(aMapLocation.getLongitude());
+//                cameraList();
+//            }
+//        });
+
+//        typeList.add(new TypeModel("camera_type_2", "森林防火", false));
+//        typeList.add(new TypeModel("camera_type_4", "病虫害", false));
+//        typeList.add(new TypeModel("camera_type_1", "秸秆禁烧", false));
+//        typeList.add(new TypeModel("camera_type_3", "粪污处理", false));
+//        typeList.add(new TypeModel("camera_type_5", "水利监控", false));
+//        typeList.add(new TypeModel("camera_type_6", "违法建筑", false));
+//        typeList.add(new TypeModel("camera_type_7", "火情防控", false));
+//        typeAdapter.setList(typeList);
+    }
+
+    private void requestListRefresh() {
+        currentPage = 1;
+        Params params = new Params();
+        params.put("cameraName", viewModel.keyword.get());
+        params.put("pageNum", currentPage);
+        params.put("deptId", AppTools.getDeptId());
+        if (titleName.equals("数字公安")) {
+            params.put("type", "11");
+        } else {
+            params.put("type", "1,2,3,4,5,6,7,8,9,10,11,12");
+        }
+        params.put("pageSize", 20);
+        cameraListRequest.setParams(params);
+        cameraListRequest.execute(new ProcessErrorSubscriber<List<CameraBean>>() {
+            @Override
+            public void onError(Throwable e) {
+                super.onError(e);
+                finishRefreshOrLoadMore(binding.smartRefreshLayout);
+            }
+
+            @Override
+            public void onNext(List<CameraBean> beanList) {
+                super.onNext(beanList);
+                list.clear();
+                if (beanList != null && beanList.size() > 0) {
+                    list.addAll(beanList);
+                }
+                adapter.refreshList(list);
+                finishRefreshOrLoadMore(binding.smartRefreshLayout);
+            }
+        });
+    }
+
+    private void requestListLoadMore() {
+        Params params = new Params();
+        params.put("cameraName", viewModel.keyword.get());
+        params.put("pageSize", 20);
+        params.put("deptId", AppTools.getDeptId());
+        if (titleName.equals("数字公安")) {
+            params.put("type", "11");
+        } else {
+            params.put("type", "1,2,3,4,5,6,7,8,9,10,11,12");
+        }
+        params.put("pageNum", currentPage + 1);
+        cameraListRequest.setParams(params);
+        cameraListRequest.execute(new ProcessErrorSubscriber<List<CameraBean>>() {
+            @Override
+            public void onError(Throwable e) {
+                super.onError(e);
+                finishRefreshOrLoadMore(binding.smartRefreshLayout);
+            }
+
+            @Override
+            public void onNext(List<CameraBean> beanList) {
+                super.onNext(beanList);
+                if (beanList != null && beanList.size() > 0) {
+                    currentPage = currentPage + 1;
+                    list.addAll(beanList);
+                    adapter.refreshList(list);
+                }
+                finishRefreshOrLoadMore(binding.smartRefreshLayout);
+            }
+        });
+    }
+}

+ 186 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/activity/MyVideoPlayerActivity.java

@@ -0,0 +1,186 @@
+package com.sjkj.appthreefloor_tsgz.activity;
+
+import android.content.pm.ActivityInfo;
+import android.content.res.Configuration;
+import android.media.MediaPlayer;
+import android.net.Uri;
+import android.text.TextUtils;
+import android.util.DisplayMetrics;
+import android.view.View;
+import android.view.WindowManager;
+import android.widget.MediaController;
+
+import androidx.annotation.NonNull;
+import androidx.lifecycle.ViewModelProvider;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.request.RequestOptions;
+import com.sjkj.appthreefloor_tsgz.R;
+import com.sjkj.appthreefloor_tsgz.activity.viewModel.VideoViewModel;
+import com.sjkj.appthreefloor_tsgz.databinding.ActivityMyVideoPlayerBinding;
+import com.sjkj.base_lib.utils.ToastUtils;
+import com.sjkj.base_lib.view.BaseActivity;
+
+import java.io.File;
+
+;
+
+/**
+ * 视频播放页
+ */
+public class MyVideoPlayerActivity extends BaseActivity {
+
+    private ActivityMyVideoPlayerBinding binding;
+    private VideoViewModel viewModel;
+    //    private String videoUrl = "http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4";
+    private boolean isFull = false;
+
+    @Override
+    protected int initLayout() {
+        return R.layout.activity_my_video_player;
+    }
+
+    @Override
+    public void initBinding() {
+        super.initBinding();
+        binding = (ActivityMyVideoPlayerBinding) getViewDataBinding();
+        viewModel = new ViewModelProvider(this, new ViewModelProvider.NewInstanceFactory()).get(VideoViewModel.class);
+        binding.setViewModel(viewModel);
+        binding.setLifecycleOwner(this);
+    }
+
+    @Override
+    public void initView() {
+        super.initView();
+        getTitleView().setText("视频播放");
+        getSupportActionBar().show();
+        viewModel.videoUrl.set(getIntent().getStringExtra("videoUrl"));
+        if (TextUtils.isEmpty(viewModel.videoUrl.get())){
+            ToastUtils.show("视频资源有误");
+            return;
+        }
+        if (viewModel.videoUrl.get().startsWith("http")){
+            binding.videoView.setVideoURI(Uri.parse(viewModel.videoUrl.get()));
+        }else {
+            if (new File(viewModel.videoUrl.get()).exists()){
+                binding.videoView.setVideoPath(viewModel.videoUrl.get());
+            }else {
+                ToastUtils.show("视频资源不存在");
+            }
+        }
+
+        Glide.with(this)
+                .setDefaultRequestOptions(
+                        new RequestOptions()
+                                .frame(1000)
+                                .centerCrop()
+                )
+                .load(viewModel.videoUrl.get())
+                .into(binding.iv);
+        binding.videoView.setMediaController(new MediaController(this));
+        binding.videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
+            @Override
+            public void onCompletion(MediaPlayer mp) {
+                binding.progressView.setVisibility(View.GONE);
+                
+                binding.iv.setVisibility(View.GONE);
+            }
+        });
+        binding.videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
+            @Override
+            public void onPrepared(MediaPlayer mp) {
+                binding.progressView.setVisibility(View.GONE);
+                binding.iv.setVisibility(View.GONE);
+            }
+        });
+        binding.videoView.setOnInfoListener(new MediaPlayer.OnInfoListener() {
+            @Override
+            public boolean onInfo(MediaPlayer mp, int what, int extra) {
+                if (what == MediaPlayer.MEDIA_INFO_BUFFERING_START) {
+                    binding.progressView.setVisibility(View.GONE);
+                    binding.iv.setVisibility(View.GONE);
+                } else if (what == MediaPlayer.MEDIA_INFO_BUFFERING_END) {
+                    binding.progressView.setVisibility(View.GONE);
+                    binding.iv.setVisibility(View.GONE);
+                }
+                return true;
+            }
+        });
+        binding.videoView.seekTo(1);
+        binding.videoView.requestFocus();
+        binding.progressView.setVisibility(View.VISIBLE);
+        binding.iv.setVisibility(View.VISIBLE);
+        binding.videoView.start();
+    }
+
+    @Override
+    protected void onStart() {
+        super.onStart();
+        if (!binding.videoView.isPlaying()) {
+            binding.videoView.start();
+        }
+
+    }
+
+    @Override
+    protected void onPause() {
+        super.onPause();
+        if (binding.videoView.isPlaying()) {
+            binding.videoView.pause();
+        }
+    }
+
+    @Override
+    public void onConfigurationChanged(@NonNull Configuration newConfig) {
+        super.onConfigurationChanged(newConfig);
+        if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
+            //继承自AppCompatActivity时使用
+            getSupportActionBar().hide();
+            DisplayMetrics metrics = new DisplayMetrics();
+            getWindowManager().getDefaultDisplay().getMetrics(metrics);
+            android.widget.LinearLayout.LayoutParams params = (android.widget.LinearLayout.LayoutParams) binding.videoFrame.getLayoutParams();
+            params.width = metrics.widthPixels;
+            params.height = metrics.heightPixels;
+            params.leftMargin = 0;
+            binding.videoFrame.setLayoutParams(params);
+            isFull = true;
+        } else if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
+            getSupportActionBar().show();
+            DisplayMetrics metrics = new DisplayMetrics();
+            getWindowManager().getDefaultDisplay().getMetrics(metrics);
+            android.widget.LinearLayout.LayoutParams params = (android.widget.LinearLayout.LayoutParams) binding.videoFrame.getLayoutParams();
+            params.width = metrics.widthPixels;
+            params.height = /*(int) (300*metrics.density);*/metrics.heightPixels;
+            params.leftMargin = 0;
+            binding.videoFrame.setLayoutParams(params);
+            isFull = false;
+        }
+    }
+
+    /**
+     * 切换横竖屏
+     */
+    public void switchScreen() {
+        if (isFull) {
+            isFull = false;
+            setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
+            getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
+            getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
+        } else {
+            isFull = true;
+            setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
+            getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
+            getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
+        }
+    }
+
+
+    @Override
+    public void onBackPressed() {
+        if (isFull) {
+            switchScreen();
+        } else {
+            this.finish();
+        }
+    }
+}

+ 765 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/activity/NewEventActivity.java

@@ -0,0 +1,765 @@
+package com.sjkj.appthreefloor_tsgz.activity;
+
+import android.content.Context;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.os.Environment;
+import android.provider.MediaStore;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.View;
+
+import androidx.annotation.Nullable;
+import androidx.core.content.FileProvider;
+import androidx.lifecycle.ViewModelProvider;
+import androidx.recyclerview.widget.ItemTouchHelper;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.amap.api.maps.model.LatLng;
+import com.hjq.permissions.OnPermissionCallback;
+import com.hjq.permissions.Permission;
+import com.hjq.permissions.XXPermissions;
+import com.sjkj.appthreefloor_tsgz.R;
+import com.sjkj.appthreefloor_tsgz.activity.viewModel.EventCenterViewModel;
+import com.sjkj.appthreefloor_tsgz.adapter.ImageAdapter;
+import com.sjkj.appthreefloor_tsgz.adapter.VideoDelAdapter;
+import com.sjkj.appthreefloor_tsgz.address.OnFinishClickListener;
+import com.sjkj.appthreefloor_tsgz.app.App;
+import com.sjkj.appthreefloor_tsgz.bean.DailyBean;
+import com.sjkj.appthreefloor_tsgz.bean.FileBean;
+import com.sjkj.appthreefloor_tsgz.bean.ImageBean;
+import com.sjkj.appthreefloor_tsgz.bean.ImageEventBean;
+import com.sjkj.appthreefloor_tsgz.databinding.ActivityNewEventBinding;
+import com.sjkj.appthreefloor_tsgz.net.DepartmentRequest;
+import com.sjkj.appthreefloor_tsgz.net.EventNewRequest;
+import com.sjkj.appthreefloor_tsgz.net.UploadFileRequest;
+import com.sjkj.appthreefloor_tsgz.utils.EventDepartmentTools;
+import com.sjkj.appthreefloor_tsgz.utils.SlideItemTouchHelper;
+import com.sjkj.appthreefloor_tsgz.weight.photoview.PhotoViewActivity;
+import com.sjkj.base_lib.adapter.BaseRecAdapter;
+import com.sjkj.base_lib.app.AppManager;
+import com.sjkj.base_lib.entity.Params;
+import com.sjkj.base_lib.map.ChooseMapActivity;
+import com.sjkj.base_lib.net.domain.interactor.ProcessErrorSubscriber;
+import com.sjkj.base_lib.net.utils.RealPathFromUriUtils;
+import com.sjkj.base_lib.utils.AppTools;
+import com.sjkj.base_lib.utils.CommonUtils;
+import com.sjkj.base_lib.utils.Constants;
+import com.sjkj.base_lib.utils.DialogUtils;
+import com.sjkj.base_lib.utils.LocationUtils;
+import com.sjkj.base_lib.utils.ToastUtils;
+import com.sjkj.base_lib.view.BaseActivity;
+import com.sjkj.base_lib.weight.LoadingDialog;
+import com.sjkj.base_lib.weight.silicompressor.SiliCompressor;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import top.zibin.luban.CompressionPredicate;
+import top.zibin.luban.Luban;
+import top.zibin.luban.OnCompressListener;
+import top.zibin.luban.OnRenameListener;
+
+/**
+ * 新增事件
+ */
+public class NewEventActivity extends BaseActivity {
+    private static final int TYPE_IMAGE = 1;
+    private static final int TYPE_VIDEO = 2;
+    static String mCurrentPhotoPath;
+    static Uri capturedUri = null;
+
+
+    private ActivityNewEventBinding binding;
+    private EventCenterViewModel viewModel;
+    private ImageAdapter adapter;
+    private VideoDelAdapter video_adapter;
+    private List<ImageBean> imageBeans = new ArrayList<>();
+    private List<ImageBean> imageBeans_image = new ArrayList<>();
+    private List<ImageBean> imageBeans_video = new ArrayList<>();
+    //    private String[] eventTypeNames = new String[]{"森林防火", "秸秆燃烧"};
+//    private String[] eventTypeValues = new String[]{"sys_camera_event_type_1", "sys_camera_event_type_2"};
+    //    private String[] deptNames = new String[]{"首佳科技", "首家分公司"};
+//    private String[] deptIds = new String[]{"1", "2"};
+    private String[] windTypes = new String[]{"风向001", "风向002", "风向003", "风向004", "风向005"};
+    private UploadFileRequest uploadFileRequest = new UploadFileRequest(App.getInstance());
+    private EventNewRequest eventNewRequest = new EventNewRequest(App.getInstance());
+    private DepartmentRequest departmentRequest = new DepartmentRequest(App.getInstance());
+    private List<CharSequence> deptNames = new ArrayList<>();
+    private List<CharSequence> deptIds = new ArrayList<>();
+    ImageEventBean imageEventBean;
+    private List<ImageEventBean> imageEventBeanList = new ArrayList<>();
+
+    @Override
+    protected int initLayout() {
+        return R.layout.activity_new_event;
+    }
+
+    @Override
+    public void initBinding() {
+        binding = (ActivityNewEventBinding) getViewDataBinding();
+        viewModel = new ViewModelProvider(this, new ViewModelProvider.NewInstanceFactory()).get(EventCenterViewModel.class);
+        binding.setViewModel(viewModel);
+        binding.setLifecycleOwner(this);
+    }
+
+    @Override
+    public void initListener() {
+        super.initListener();
+        binding.locationIv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                startLocationMap();
+            }
+        });
+    }
+
+    @Override
+    public void initView() {
+        super.initView();
+        getTitleView().setText(getString(R.string.report_event));
+        XXPermissions.with(this)
+                .permission(Permission.RECORD_AUDIO)
+//                .permission(Permission.READ_EXTERNAL_STORAGE)
+//                .permission(Permission.WRITE_EXTERNAL_STORAGE)
+                .request(new OnPermissionCallback() {
+                    @Override
+                    public void onGranted(List<String> permissions, boolean all) {
+                        if (all) {
+
+                        } else {
+                            ToastUtils.show("获取部分权限成功,但部分权限未正常授予");
+                        }
+                    }
+
+                    @Override
+                    public void onDenied(List<String> permissions, boolean never) {
+                        if (never) {
+                            ToastUtils.show("被永久拒绝授权,请手动授予权限");
+                            // 如果是被永久拒绝就跳转到应用权限系统设置页面
+                            XXPermissions.startPermissionActivity(AppManager.getAppManager().currentActivity(), permissions);
+                        } else {
+                            ToastUtils.show("获取权限失败");
+                        }
+                    }
+                });
+
+        viewModel.deptId.set(AppTools.getDeptId());
+        viewModel.deptName.set(AppTools.getDeptName());
+        imageBeans.clear();
+        imageBeans_video.clear();
+        imageBeans_image.clear();
+        binding.inputBg.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                binding.contentEt.setFocusableInTouchMode(true);
+                binding.contentEt.requestFocus();
+            }
+        });
+//        binding.titleEt.addTextChangedListener(new TextWatcher() {
+//            @Override
+//            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+//
+//            }
+//
+//            @Override
+//            public void onTextChanged(CharSequence s, int start, int before, int count) {
+//
+//            }
+//
+//            @Override
+//            public void afterTextChanged(Editable s) {
+//                viewModel.title.set(s.toString().trim());
+//            }
+//        });
+//        binding.contentEt.addTextChangedListener(new TextWatcher() {
+//            @Override
+//            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+//
+//            }
+//
+//            @Override
+//            public void onTextChanged(CharSequence s, int start, int before, int count) {
+//
+//            }
+//
+//            @Override
+//            public void afterTextChanged(Editable s) {
+//                viewModel.content.set(s.toString().trim());
+//            }
+//        });
+        binding.imageAddIv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                AppTools.chooseImage();
+
+            }
+        });
+        binding.videoAdd.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                chooseVideo();
+            }
+        });
+        LinearLayoutManager manager = new LinearLayoutManager(NewEventActivity.this);
+        manager.setOrientation(RecyclerView.HORIZONTAL);
+        LinearLayoutManager manager1 = new LinearLayoutManager(NewEventActivity.this);
+        manager1.setOrientation(RecyclerView.HORIZONTAL);
+        binding.imageRecyclerView.setLayoutManager(manager);
+        binding.videoRecyclerView.setLayoutManager(manager1);
+        adapter = new ImageAdapter(NewEventActivity.this);
+        video_adapter = new VideoDelAdapter(NewEventActivity.this);
+        adapter.setItemClick(new BaseRecAdapter.OnItemClick<ImageBean>() {
+            @Override
+            public void onItemClick(ImageBean bean, int position) {
+                if (adapter.getList() != null && adapter.getList().size() > 0) {
+                    ArrayList<String> imageList = new ArrayList<>();
+                    for (int i = 0; i < adapter.getList().size(); i++) {
+                        imageList.add(adapter.getList().get(i).getRealUrl());
+                    }
+
+                    Intent intent = new Intent(NewEventActivity.this, PhotoViewActivity.class);
+                    intent.putStringArrayListExtra("positionDataList", imageList);
+                    intent.putExtra("position", position);
+                    startActivity(intent);
+                }
+            }
+        });
+        video_adapter.setItemClick(new BaseRecAdapter.OnItemClick<ImageBean>() {
+            @Override
+            public void onItemClick(ImageBean bean, int position) {
+
+                // startActivity(OpenFileUtil.openFile(NewEventActivity.this, mCurrentPhotoPath));
+                Intent intent = new Intent(NewEventActivity.this, MyVideoPlayerActivity.class);
+                intent.putExtra("videoUrl", mCurrentPhotoPath);
+                startActivity(intent);
+            }
+        });
+
+        //添加拖拽事件                                                                 longClickPosition:初始索引值            ActionUpPosition:结束索引值
+        ItemTouchHelper.Callback callback = new SlideItemTouchHelper(NewEventActivity.this, adapter);
+        ItemTouchHelper itemTouchHelper = new ItemTouchHelper(callback);
+        itemTouchHelper.attachToRecyclerView(binding.imageRecyclerView);
+        binding.imageRecyclerView.setAdapter(adapter);
+        binding.videoRecyclerView.setAdapter(video_adapter);
+//        adapter.setOnDeleteClick(new OnDeleteClick() {
+//            @Override
+//            public void delete(ImageBean bean, int positio) {
+//
+//                if (imageBeans_image != null && imageBeans_image.size() > 0) {
+//                    imageBeans_image.remove(positio);
+//                    adapter.notifyDataSetChanged();
+//                }
+//                if (imageBeans != null && imageBeans.size() > 0) {
+//                    for (int i = 0; i < imageBeans.size(); i++) {
+//                        if (bean.getFileNname().equals(imageBeans.get(i).getFileNname())) {
+//                            imageBeans.remove(i);
+//
+//                        }
+//                    }
+//                }
+//            }
+//        });
+        binding.submitEventTv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (TextUtils.isEmpty(viewModel.title.get())) {
+                    ToastUtils.show("请输入事件标题");
+                    return;
+                }
+                if (TextUtils.isEmpty(viewModel.eventType.get())) {
+                    ToastUtils.show("请选择事件类型");
+                    return;
+                }
+//                if (TextUtils.isEmpty(viewModel.deptId.get()) || TextUtils.isEmpty(viewModel.deptName.get())) {
+//                    ToastUtils.show("请选择部门");
+//                    return;
+//                }
+                if (viewModel.longitude.get() <= 0 || viewModel.latitude.get() <= 0) {
+                    ToastUtils.show("当前位置坐标有误,请重试");
+                    return;
+                }
+                if (TextUtils.isEmpty(viewModel.position.get())) {
+                    ToastUtils.show("请输入地址");
+                    return;
+                }
+                if (TextUtils.isEmpty(viewModel.content.get())) {
+                    ToastUtils.show("请输入事件内容");
+                    return;
+                }
+//                if (TextUtils.isEmpty(viewModel.windDirection.get())) {
+//                    ToastUtils.show("请选择风向");
+//                    return;
+//                }
+                imageEventBeanList.clear();
+
+                if (adapter.getList() != null && adapter.getList().size() > 0) {
+                    for (int i = 0; i < adapter.getList().size(); i++) {
+                        if (!TextUtils.isEmpty(adapter.getList().get(i).getUrl())) {
+
+                            //viewModel.fileList.add(imageBeans.get(i).getUrl());
+                            imageEventBean = new ImageEventBean();
+                            imageEventBean.setFileName(adapter.getList().get(i).getFileNname());
+                            imageEventBean.setAttachPath(adapter.getList().get(i).getUrl());
+                            imageEventBeanList.add(imageEventBean);
+
+                        }
+                    }
+                }
+                if (video_adapter.getList() != null && video_adapter.getList().size() > 0) {
+                    for (int i = 0; i < video_adapter.getList().size(); i++) {
+                        if (!TextUtils.isEmpty(video_adapter.getList().get(i).getUrl())) {
+
+                            //viewModel.fileList.add(imageBeans.get(i).getUrl());
+                            imageEventBean = new ImageEventBean();
+                            imageEventBean.setFileName(video_adapter.getList().get(i).getFileNname());
+                            imageEventBean.setAttachPath(video_adapter.getList().get(i).getUrl());
+                            imageEventBeanList.add(imageEventBean);
+
+                        }
+                    }
+                }
+                showLoadingDialog();
+                Params params = new Params();
+                params.put("eventType", viewModel.eventTypeValue1.get());
+                params.put("eventTypeXl", viewModel.eventTypeValue2.get());
+                params.put("eventTypeXlName", viewModel.eventTypeName2.get());
+                params.put("eventName", viewModel.title.get());
+                params.put("eventDescription", viewModel.content.get());
+                params.put("longitude", viewModel.longitude.get());
+                params.put("latitude", viewModel.latitude.get());
+                /*params.put("reportById", viewModel.userId.get());
+                params.put("reportBy", viewModel.userName.get());*/
+                params.put("deptId", viewModel.deptId.get());
+                params.put("deptName", viewModel.deptName.get());
+//                params.put("hgjDeptId", viewModel.eventTypeValue3.get());
+//                params.put("hgjDeptName", viewModel.eventTypeValuEName.get());
+//                params.put("windDirection", viewModel.windDirection.get());
+                params.put("attach", imageEventBeanList);
+                params.put("reportSource", "reporting_source_3");
+                params.put("address", viewModel.position.get());
+                if (TextUtils.isEmpty(binding.tvHuo.getText().toString())) {
+                    params.put("fireRadius", "0");
+                } else {
+                    params.put("fireRadius", binding.tvHuo.getText().toString());
+                }
+                eventNewRequest.setParams(params);
+                eventNewRequest.execute(new ProcessErrorSubscriber<Object>() {
+                    @Override
+                    public void onError(Throwable e) {
+                        super.onError(e);
+                        hideLoadingDialog(LoadingDialog.LOADING_FAILED);
+                        ToastUtils.show(e.getMessage());
+                    }
+
+                    @Override
+                    public void onNext(Object o) {
+                        super.onNext(o);
+                        hideLoadingDialog(LoadingDialog.LOADING_SUCCESS);
+                        ToastUtils.show("上报成功");
+                        setResult(1000);
+                        finish();
+                    }
+                });
+            }
+        });
+        binding.typeTv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+              /*  DialogUtils.showBottomMenu("请选择事件类型", eventTypeNames, new DialogUtils.BottomMenuCallBack() {
+                    @Override
+                    public void itemListener(String text, int index) {
+                        viewModel.eventType.set(text);
+                        viewModel.eventTypeValue.set(eventTypeValues[index]);
+                    }
+                });*/
+                if (CommonUtils.isFastClick()) return;
+                EventDepartmentTools.GetEventFL(NewEventActivity.this);
+                EventDepartmentTools.setOnFinishClickListener(new OnFinishClickListener() {
+                    @Override
+                    public void FinishClick(String ONEstr, String ONEID, String TWOstr, String TWOID, String THREEstr, String THREEID, String FOURstr, String FOURID) {
+                        if (ONEstr.equals("火情事件")) {
+                            binding.llHuo.setVisibility(View.VISIBLE);
+                            binding.viewHuo.setVisibility(View.VISIBLE);
+                        } else {
+                            binding.llHuo.setVisibility(View.GONE);
+                            binding.viewHuo.setVisibility(View.GONE);
+                        }
+                        viewModel.eventType.set(ONEstr + "/" + TWOstr /*+ "/" + THREEstr*/);
+                        viewModel.eventTypeValue1.set(ONEID);
+                        viewModel.eventTypeValue2.set(TWOID);
+//                        viewModel.eventTypeValue3.set(THREEID);
+//                        viewModel.eventTypeValuEName.set(TWOstr);
+                        viewModel.eventTypeName2.set(TWOstr);
+                    }
+                });
+            }
+        });
+//        binding.deptTv.setOnClickListener(new View.OnClickListener() {
+//            @Override
+//            public void onClick(View v) {
+//                DialogUtils.showBottomMenu("请选择部门", deptNames, new DialogUtils.BottomMenuCallBack() {
+//                    @Override
+//                    public void itemListener(String text, int index) {
+//                        viewModel.deptName.set(text);
+//                        viewModel.deptId.set(deptIds.get(index) + "");
+//                        viewModel.deptName.set(deptNames.get(index) + "");
+//                    }
+//                });
+//            }
+//        });
+        binding.windDirectionTv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                DialogUtils.showBottomMenu("请选择风向", windTypes, new DialogUtils.BottomMenuCallBack() {
+                    @Override
+                    public void itemListener(String text, int index) {
+                        viewModel.windDirection.set(text);
+                    }
+                });
+            }
+        });
+        binding.positionTv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+//                DialogUtils.showBottomInput("提示", "请输入地址", new DialogUtils.DialogInputCallBack() {
+//                    @Override
+//                    public void itemListener(String text) {
+//                        viewModel.position.set(text);
+//                    }
+//                });
+                location();
+            }
+        });
+//        binding.tvAgain.setOnClickListener(new View.OnClickListener() {
+//            @Override
+//            public void onClick(View v) {
+//                startLocationMap();
+//            }
+//        });
+    }
+
+
+    @Override
+    public void loadData() {
+        super.loadData();
+        viewModel.userId.set(AppTools.getUserId());
+        viewModel.userName.set(AppTools.getUserName());
+      /*  adapter.refreshList(imageBeans_image);
+        video_adapter.refreshList(imageBeans_video);*/
+        //getDepartments();
+        startLocationMap();
+    }
+
+    private void startLocationMap() {
+        LocationUtils.getInstance().startLocation(true, new LocationUtils.OnLocationListener() {
+            @Override
+            public void onLocationChanged(double lat, double lng, String address, int code) {
+//                if (aMapLocation != null) {
+                if (!TextUtils.isEmpty(address)) {
+                    viewModel.position.set(address);
+                } else {
+                    viewModel.position.set("定位失败,点击重试");
+                }
+                viewModel.longitude.set(lng);
+                viewModel.latitude.set(lat);
+//                }
+            }
+        });
+    }
+
+    @Override
+    protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (requestCode == Constants.SYSTEM_100 && resultCode == RESULT_OK) {
+            try {
+                List<Uri> list = AppTools.chooseImageResult(data);
+                Uri uri = list.get(0);
+                String path = RealPathFromUriUtils.getRealPathFromUri(this, uri);
+                File file = new File(path);
+                if (file.exists()) {
+                    showLoadingDialog();
+                    Luban.with(this).load(file).ignoreBy(100).setFocusAlpha(false).filter(new CompressionPredicate() {
+                        @Override
+                        public boolean apply(String path) {
+                            return !(TextUtils.isEmpty(path));
+                        }
+                    }).setRenameListener(new OnRenameListener() {
+                        @Override
+                        public String rename(String filePath) {
+                            String result = System.currentTimeMillis() + ".jpg";
+                            return result;
+                        }
+                    }).setCompressListener(new OnCompressListener() {
+                        @Override
+                        public void onStart() {
+                        }
+
+                        @Override
+                        public void onSuccess(File file) {
+                            //TODO 压缩成功后调用,返回压缩后的图片文件
+                            uploadFileRequest.setFile(file);
+                            uploadFileRequest.execute(new ProcessErrorSubscriber<FileBean>() {
+                                @Override
+                                public void onError(Throwable e) {
+                                    super.onError(e);
+                                    ToastUtils.show(e.getMessage());
+                                    hideLoadingDialog(LoadingDialog.LOADING_FAILED);
+                                }
+
+                                @Override
+                                public void onNext(FileBean bean) {
+                                    super.onNext(bean);
+                                    hideLoadingDialog(LoadingDialog.LOADING_SUCCESS);
+                                    ImageBean imageBean = new ImageBean();
+                                    imageBean.setUrl(bean.getUrl());
+                                    imageBean.setRealUrl(bean.getWebUrl());
+                                    imageBean.setFileNname(bean.getWebName());
+                                    imageBeans.add(imageBean);
+                                    imageBeans_image.add(imageBean);
+                                    adapter.refreshList(imageBeans_image);
+                                }
+                            });
+                        }
+
+                        @Override
+                        public void onError(Throwable e) {
+                            //TODO 当压缩过去出现问题时调用
+                            ToastUtils.show(e.getMessage() + "");
+                            hideLoadingDialog(LoadingDialog.LOADING_FAILED);
+                        }
+                    }).launch();
+                } else {
+                    ToastUtils.show("图片不存在");
+                }
+
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+
+
+        } else if (requestCode == Constants.CODE_SUCCESS && resultCode == RESULT_OK) {
+            if (data.getData() != null) {
+                showLoadingDialog();
+                try {
+
+                    File f = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MOVIES) + "/IntegratedPlatform/videos");
+
+                    if (f.mkdirs() || f.isDirectory()) {
+                        new VideoCompressAsyncTask(this).execute(mCurrentPhotoPath, f.getPath());
+
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        } else if (requestCode == Constants.SYSTEM_100 && resultCode == Constants.SYSTEM_100) {
+
+            if (data != null) {
+                LatLng latLng = data.getParcelableExtra("LatLng");
+                String address = data.getStringExtra("address");
+                if (latLng != null) {
+                    viewModel.latitude.set(latLng.latitude);
+                    viewModel.longitude.set(latLng.longitude);
+                    if (!TextUtils.isEmpty(address)) {
+                        viewModel.position.set(address);
+                    } else {
+                        viewModel.position.set("定位失败,点击重试");
+                    }
+                }
+            }
+
+        }
+
+    }
+
+    class VideoCompressAsyncTask extends AsyncTask<String, String, String> {
+
+        Context mContext;
+
+        public VideoCompressAsyncTask(Context context) {
+            mContext = context;
+        }
+
+        @Override
+        protected void onPreExecute() {
+            super.onPreExecute();
+        }
+
+        @Override
+        protected String doInBackground(String... paths) {
+            String filePath = null;
+            try {
+
+                filePath = SiliCompressor.with(mContext).compressVideo(paths[0], paths[1], 1080, 720, 4000000);
+
+            } catch (URISyntaxException e) {
+                e.printStackTrace();
+            }
+            return filePath;
+
+        }
+
+
+        @Override
+        protected void onPostExecute(String compressedFilePath) {
+            super.onPostExecute(compressedFilePath);
+
+            File imageFile = new File(compressedFilePath);
+
+            uploadFileRequest.setFile(imageFile);
+            uploadFileRequest.execute(new ProcessErrorSubscriber<FileBean>() {
+                @Override
+                public void onError(Throwable e) {
+                    super.onError(e);
+                    ToastUtils.show("上传失败" + e.getMessage());
+                    hideLoadingDialog(LoadingDialog.LOADING_FAILED);
+                }
+
+                @Override
+                public void onNext(FileBean bean) {
+                    super.onNext(bean);
+                    //ToastUtils.show("上传成功" + bean.getWebUrl() + "-=-=");
+                    hideLoadingDialog(LoadingDialog.LOADING_SUCCESS);
+                    ImageBean imageBean = new ImageBean();
+                    imageBean.setUrl(bean.getUrl());
+                    imageBean.setRealUrl(bean.getWebUrl());
+                    imageBean.setFileNname(bean.getWebName());
+                    imageBeans.add(imageBean);
+                    imageBeans_video.add(imageBean);
+                    video_adapter.refreshList(imageBeans_video);
+
+
+                }
+            });
+
+        }
+    }
+
+    //获取部门列表
+    public void getDepartments() {
+        showLoadingDialog();
+        Params params = new Params();
+        params.put("userName", AppTools.getUserName());
+        departmentRequest.setParams(params);
+        departmentRequest.execute(new ProcessErrorSubscriber<DailyBean>() {
+            @Override
+            public void onError(Throwable e) {
+                super.onError(e);
+                hideLoadingDialog(LoadingDialog.LOADING_FAILED);
+            }
+
+            @Override
+            public void onNext(DailyBean data) {
+                super.onNext(data);
+                hideLoadingDialog(LoadingDialog.LOADING_SUCCESS);
+                if (data != null) {
+                    deptIds.clear();
+                    deptNames.clear();
+                    for (int i = 0; i < data.getDepts().size(); i++) {
+                        deptIds.add(data.getDepts().get(i).getDeptId());
+                        deptNames.add(data.getDepts().get(i).getDeptName());
+                    }
+                }
+            }
+        });
+
+    }
+
+
+    public void chooseVideo() {
+        XXPermissions.with(AppManager.getAppManager().currentActivity())
+                // .permission(Permission.WRITE_EXTERNAL_STORAGE)
+                .permission(Permission.MANAGE_EXTERNAL_STORAGE)
+                .permission(Permission.CAMERA)
+                .request(new OnPermissionCallback() {
+                    @Override
+                    public void onGranted(List<String> permissions, boolean all) {
+                        if (all) {
+                            dispatchTakeVideoIntent();
+                        } else {
+                            ToastUtils.show("获取部分权限成功,但部分权限未正常授予");
+                        }
+                    }
+
+                    @Override
+                    public void onDenied(List<String> permissions, boolean never) {
+                        if (never) {
+                            ToastUtils.show("被永久拒绝授权,请手动授予权限");
+                            // 如果是被永久拒绝就跳转到应用权限系统设置页面
+                            XXPermissions.startPermissionActivity(AppManager.getAppManager().currentActivity(), permissions);
+                        } else {
+                            ToastUtils.show("获取权限失败");
+                        }
+                    }
+                });
+    }
+
+    private void dispatchTakeVideoIntent() {
+        Intent takeVideoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
+        takeVideoIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
+        if (takeVideoIntent.resolveActivity(getPackageManager()) != null) {
+            try {
+
+                takeVideoIntent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, 10);
+                takeVideoIntent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
+                capturedUri = FileProvider.getUriForFile(this, AppTools.getPackageNameProvider(),
+                        createMediaFile(TYPE_VIDEO));
+
+                takeVideoIntent.putExtra(MediaStore.EXTRA_OUTPUT, capturedUri);
+                Log.d("zhrrr", "VideoUri: " + capturedUri.toString());
+                startActivityForResult(takeVideoIntent, 200);
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+
+        }
+
+
+    }
+
+    private File createMediaFile(int type) throws IOException {
+
+        // Create an image file name
+        String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
+        String fileName = (type == TYPE_IMAGE) ? "JPEG_" + timeStamp + "_" : "VID_" + timeStamp + "_";
+        File storageDir = Environment.getExternalStoragePublicDirectory(
+                type == TYPE_IMAGE ? Environment.DIRECTORY_PICTURES : Environment.DIRECTORY_MOVIES);
+        if (!storageDir.exists()) {
+            storageDir.mkdir();
+        }
+
+        File file = File.createTempFile(
+                fileName,  /* prefix */
+                type == TYPE_IMAGE ? ".jpg" : ".mp4",         /* suffix */
+                storageDir      /* directory */
+        );
+
+        // Get the path of the file created
+        mCurrentPhotoPath = file.getAbsolutePath();
+        Log.d("zhr1111", "mCurrentPhotoPath: " + mCurrentPhotoPath);
+        return file;
+    }
+
+    private void location() {
+        showLoadingDialog();
+        LocationUtils.getInstance().startLocation(true, new LocationUtils.OnLocationListener() {
+            @Override
+            public void onLocationChanged(double lat, double lng, String address, int code) {
+//                viewModel.lat.set(aMapLocation.getLatitude());
+//                viewModel.lng.set(aMapLocation.getLongitude());
+//                if (aMapLocation != null) {
+                hideLoadingDialog(LoadingDialog.LOADING_SUCCESS);
+                startActivityForResult(new Intent(NewEventActivity.this, ChooseMapActivity.class), Constants.SYSTEM_100);
+//                }
+            }
+        });
+    }
+}

+ 124 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/activity/PermissionListActivity.java

@@ -0,0 +1,124 @@
+package com.sjkj.appthreefloor_tsgz.activity;
+
+import android.content.Intent;
+import android.os.Build;
+import android.view.View;
+
+import androidx.lifecycle.ViewModelProvider;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.hjq.permissions.Permission;
+import com.hjq.permissions.XXPermissions;
+import com.sjkj.appthreefloor_tsgz.R;
+import com.sjkj.appthreefloor_tsgz.activity.viewModel.MainViewModel;
+import com.sjkj.appthreefloor_tsgz.adapter.PermissionListAdapter;
+import com.sjkj.appthreefloor_tsgz.bean.PermissionBean;
+import com.sjkj.appthreefloor_tsgz.databinding.ActivityPermissionListBinding;
+import com.sjkj.appthreefloor_tsgz.login.LoginActivity;
+import com.sjkj.base_lib.utils.ToastUtils;
+import com.sjkj.base_lib.view.BaseActivity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class PermissionListActivity extends BaseActivity {
+    private MainViewModel viewModel;
+    private ActivityPermissionListBinding binding;
+    private PermissionListAdapter adapter;
+    private List<PermissionBean> list = new ArrayList<>();
+
+    @Override
+    protected int initLayout() {
+        return R.layout.activity_permission_list;
+    }
+
+    @Override
+    public void initBinding() {
+        super.initBinding();
+        binding = (ActivityPermissionListBinding) getViewDataBinding();
+        viewModel = new ViewModelProvider(this, new ViewModelProvider.NewInstanceFactory()).get(MainViewModel.class);
+        binding.setViewModel(viewModel);
+        binding.setLifecycleOwner(this);
+    }
+
+    @Override
+    public void initView() {
+        super.initView();
+        getBackView().setVisibility(View.GONE);
+        getTitleView().setText("权限列表");
+        LinearLayoutManager manager = new LinearLayoutManager(this);
+        manager.setOrientation(RecyclerView.VERTICAL);
+        binding.recyclerView.setLayoutManager(manager);
+        adapter = new PermissionListAdapter(this);
+        binding.recyclerView.setAdapter(adapter);
+        binding.settingTv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                XXPermissions.startPermissionActivity(PermissionListActivity.this);
+            }
+        });
+        binding.settingFinishTv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                if (adapter.getList() != null && adapter.getList().size() > 0) {
+                    for (int i = 0; i < adapter.getList().size(); i++) {
+                        if (!adapter.getList().get(i).isGranted()) {
+                            ToastUtils.show("请授予全部权限");
+                            return;
+                        }
+                    }
+                }
+                Intent intent = new Intent(PermissionListActivity.this, LoginActivity.class);
+                startActivity(intent);
+                finish();
+            }
+        });
+    }
+
+    @Override
+    protected void onStart() {
+        super.onStart();
+
+        list.clear();
+        PermissionBean bean = new PermissionBean();
+        bean.setName("摄像头权限");
+        bean.setKey(Permission.CAMERA);
+        list.add(bean);
+        PermissionBean bean1 = new PermissionBean();
+        bean1.setName("拨打电话权限");
+        bean1.setKey(Permission.CALL_PHONE);
+        list.add(bean1);
+        PermissionBean bean5 = new PermissionBean();
+        bean5.setName("位置信息权限");
+        bean5.setKey(Permission.ACCESS_FINE_LOCATION);
+        list.add(bean5);
+        PermissionBean bean2 = new PermissionBean();
+        bean2.setName("麦克风权限");
+        bean2.setKey(Permission.RECORD_AUDIO);
+        list.add(bean2);
+        PermissionBean bean22 = new PermissionBean();
+        bean22.setName("通知权限");
+        bean22.setKey(Permission.NOTIFICATION_SERVICE);
+        list.add(bean22);
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
+            PermissionBean bean3 = new PermissionBean();
+            bean3.setName("存储权限");
+            bean3.setKey(Permission.MANAGE_EXTERNAL_STORAGE);
+            list.add(bean3);
+        } else {
+            PermissionBean bean3 = new PermissionBean();
+            bean3.setName("存储权限");
+            bean3.setKey(Permission.WRITE_EXTERNAL_STORAGE);
+            list.add(bean3);
+            PermissionBean bean33 = new PermissionBean();
+            bean33.setName("存储权限");
+            bean33.setKey(Permission.READ_EXTERNAL_STORAGE);
+            list.add(bean33);
+        }
+
+        adapter.refreshList(list);
+
+    }
+
+}

+ 6 - 6
app/src/main/java/com/sjkj/appthreefloor_tsgz/activity/SplashActivity.java

@@ -62,12 +62,12 @@ public class SplashActivity extends AppCompatActivity {
     };
 
     private void jumpPermissionPage() {
-//        if (isFirst) {
-//            Intent intent = new Intent(SplashActivity.this, PermissionListActivity.class);
-//            startActivity(intent);
-//            isFirst = false;
-//            finish();
-//        }
+        if (isFirst) {
+            Intent intent = new Intent(SplashActivity.this, PermissionListActivity.class);
+            startActivity(intent);
+            isFirst = false;
+            finish();
+        }
     }
 
     @Override

+ 181 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/activity/WaterCraneResourcesActivity.java

@@ -0,0 +1,181 @@
+package com.sjkj.appthreefloor_tsgz.activity;
+
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.View;
+
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentTransaction;
+import androidx.lifecycle.ViewModelProvider;
+
+import com.google.android.material.tabs.TabLayout;
+import com.sjkj.appthreefloor_tsgz.R;
+import com.sjkj.appthreefloor_tsgz.activity.viewModel.ResourceVisualizationViewModel;
+import com.sjkj.appthreefloor_tsgz.adapter.ViewPagerAdapter;
+import com.sjkj.appthreefloor_tsgz.app.App;
+import com.sjkj.appthreefloor_tsgz.bean.ResourceVisualizationBean;
+import com.sjkj.appthreefloor_tsgz.databinding.ActivityResourceWaterCraneBinding;
+import com.sjkj.appthreefloor_tsgz.fragment.CommonDataListFragment;
+import com.sjkj.appthreefloor_tsgz.fragment.CommonMapFragment;
+import com.sjkj.appthreefloor_tsgz.map.MapMarkBean;
+import com.sjkj.appthreefloor_tsgz.net.NewDataCenterRequest;
+import com.sjkj.appthreefloor_tsgz.net.WaterCraneRequest;
+import com.sjkj.base_lib.entity.Params;
+import com.sjkj.base_lib.net.domain.interactor.ProcessErrorSubscriber;
+import com.sjkj.base_lib.utils.AppTools;
+import com.sjkj.base_lib.utils.ToastUtils;
+import com.sjkj.base_lib.view.BaseActivity;
+import com.sjkj.base_lib.weight.LoadingDialog;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class WaterCraneResourcesActivity extends BaseActivity {
+    private ResourceVisualizationViewModel viewModel;
+    private ActivityResourceWaterCraneBinding binding;
+    private ViewPagerAdapter pagerAdapter;
+    private NewDataCenterRequest newDataCenterRequest = new NewDataCenterRequest(App.getInstance());
+    private List<ResourceVisualizationBean> mList = new ArrayList<>();
+    private List<MapMarkBean> mapList = new ArrayList<>();
+    private String eventTypeName = "肉牛";
+    CommonDataListFragment dataListFragment;
+    CommonMapFragment mapFragment;
+    private FragmentTransaction ft;
+    private FragmentManager fm;
+
+    @Override
+    protected int initLayout() {
+        return R.layout.activity_resource_water_crane;
+    }
+
+    @Override
+    public void initBinding() {
+        binding = (ActivityResourceWaterCraneBinding) getViewDataBinding();
+        viewModel = new ViewModelProvider(this, new ViewModelProvider.NewInstanceFactory()).get(ResourceVisualizationViewModel.class);
+        binding.setViewModel(viewModel);
+        binding.setLifecycleOwner(this);
+    }
+
+    @Override
+    public void initView() {
+        super.initView();
+        //eventTypeName = getIntent().getStringExtra("name");
+        getTitleView().setText(getIntent().getStringExtra("title"));
+        binding.tabLayout.addTab(binding.tabLayout.newTab().setText("数据"));
+        binding.tabLayout.addTab(binding.tabLayout.newTab().setText("地图"));
+        binding.tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
+            @Override
+            public void onTabSelected(TabLayout.Tab tab) {
+                if (TextUtils.equals(tab.getText(), "数据")) {
+                    getSupportFragmentManager().beginTransaction()
+                            .show(dataListFragment)
+                            .hide(mapFragment)
+                            .commit();
+                } else {
+                    getSupportFragmentManager().beginTransaction()
+                            .hide(dataListFragment)
+                            .show(mapFragment)
+                            .commit();
+                }
+            }
+
+            @Override
+            public void onTabUnselected(TabLayout.Tab tab) {
+
+            }
+
+            @Override
+            public void onTabReselected(TabLayout.Tab tab) {
+
+            }
+        });
+
+        dataListFragment = new CommonDataListFragment(eventTypeName);
+        mapFragment = new CommonMapFragment(eventTypeName);
+        getSupportFragmentManager().beginTransaction()
+                .add(R.id.fragment_layout, dataListFragment)
+                .add(R.id.fragment_layout, mapFragment)
+                .show(dataListFragment)
+                .hide(mapFragment)
+                .commit();
+    }
+
+
+    @Override
+    public void initListener() {
+        super.initListener();
+
+        binding.searchTv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                ToastUtils.show("搜索");
+            }
+        });
+    }
+
+
+    private void requestListRefresh() {
+        mList.clear();
+        Params params = new Params();
+
+        params.put("longitude", getIntent().getDoubleExtra("Longitude", 0.0));
+        params.put("latitude", getIntent().getDoubleExtra("Latitude", 0.0));
+        params.put("type", "centerdata_t_farm_filings_livestock");
+        params.put("assort", "app");
+//        if (!TextUtils.isEmpty(getIntent().getStringExtra("radius"))) {
+//            params.put("radius", getIntent().getStringExtra("radius"));
+//        }
+//        if (getIntent().getStringExtra("assort").equals("leader")) {
+//            params.put("deptId", AppTools.getDeptId());
+//        }
+
+        newDataCenterRequest.setParams(params);
+        newDataCenterRequest.execute(new ProcessErrorSubscriber<List<ResourceVisualizationBean>>() {
+            @Override
+            public void onError(Throwable e) {
+                super.onError(e);
+                hideLoadingDialog(LoadingDialog.LOADING_FAILED);
+                ToastUtils.show(e.getMessage());
+            }
+
+            @Override
+            public void onNext(List<ResourceVisualizationBean> list) {
+                super.onNext(list);
+                hideLoadingDialog(LoadingDialog.LOADING_SUCCESS);
+                //列表页填充数据
+                mList.addAll(list);
+                dataListFragment.updataUI(mList, eventTypeName);
+                //地图页填充数据
+                MapMarkBean bean;
+                if (mList != null && mList.size() > 0) {
+                    for (int i = 0; i < mList.size(); i++) {
+                        bean = new MapMarkBean();
+                        bean.setLatitude(Double.parseDouble(mList.get(i).getLatitude()));
+                        bean.setLongitude(Double.parseDouble(mList.get(i).getLongitude()));
+                        bean.setName(mList.get(i).getName());
+                        bean.setId(mList.get(i).getId());
+                        mapList.add(bean);
+                    }
+                    mapFragment.refreshData(mList);
+                } else {
+//                    bean = new MapMarkBean();
+//                    bean.setLatitude(getIntent().getDoubleExtra("Latitude", Constants.DEFAULT_LOCATION_LAT));
+//                    bean.setLongitude(getIntent().getDoubleExtra("Longitude", Constants.DEFAULT_LOCATION_LNG));
+//                    bean.setId("0");
+//                    bean.setName("附近暂无资源");
+//                    mapList.add(bean);
+//                    mapFragment.refreshData(mapList, mList, eventTypeName, 1);
+                }
+                //finishRefreshOrLoadMore(binding.smartRefreshLayout);
+            }
+        });
+    }
+
+    @Override
+    public void loadData() {
+        super.loadData();
+        showLoadingDialog();
+        Log.d("ZHR11111",getIntent().getDoubleExtra("Longitude",0.0)+"");
+        requestListRefresh();
+    }
+}

+ 62 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/activity/viewModel/EventCenterViewModel.java

@@ -0,0 +1,62 @@
+package com.sjkj.appthreefloor_tsgz.activity.viewModel;
+
+import androidx.databinding.ObservableArrayList;
+import androidx.databinding.ObservableField;
+import androidx.databinding.ObservableInt;
+
+import com.sjkj.appthreefloor_tsgz.bean.EventBean;
+import com.sjkj.appthreefloor_tsgz.map.MapMarkBean;
+import com.sjkj.base_lib.view.SingleLiveData;
+import com.sjkj.base_lib.vm.BaseViewModel;
+
+import java.util.List;
+
+public class EventCenterViewModel extends BaseViewModel {
+    public ObservableField<String> NameValues = new ObservableField<>();
+    public ObservableInt version = new ObservableInt();
+    public ObservableField<List<String>> EventPhones = new ObservableField<>();
+    public ObservableField<List<MapMarkBean>> markListBean = new ObservableField<>();
+    public ObservableField<String> title = new ObservableField<>("");
+    public ObservableField<String> address = new ObservableField<>("");
+    public ObservableField<String> eventCode = new ObservableField<>("");
+    public ObservableField<String> eventId = new ObservableField<>("");
+    public ObservableField<String> keyword = new ObservableField<>("");
+    public ObservableField<String> state = new ObservableField<>("");
+    public ObservableField<String> eventType = new ObservableField<>("");
+    public ObservableField<String> eventTypeValue1 = new ObservableField<>("");
+    public ObservableField<String> eventTypeValue2 = new ObservableField<>("");
+    public ObservableField<String> eventTypeValue3 = new ObservableField<>("");
+    public ObservableField<String> eventTypeValuEName = new ObservableField<>("");
+    public ObservableField<String> eventTypeName2 = new ObservableField<>("");
+    public ObservableField<String> deptId = new ObservableField<>("");
+    public ObservableField<String> deptName = new ObservableField<>("");
+    public ObservableField<String> ChildDeptId = new ObservableField<>("");
+    public ObservableField<String> ChildDeptName = new ObservableField<>("");
+    public ObservableField<String> eventStatus = new ObservableField<>("");
+    public ObservableField<String> eventStatusValue = new ObservableField<>("");
+    public ObservableField<String> eventTypeValue = new ObservableField<>("");
+    public ObservableField<String> satrtTime = new ObservableField<>("");
+    public ObservableField<String> endTime = new ObservableField<>("");
+    public ObservableField<String> time = new ObservableField<>("");
+    public ObservableField<String> position = new ObservableField<>("定位中...");
+    public ObservableField<Double> longitude = new ObservableField<>(0.00);
+    public ObservableField<Double> latitude = new ObservableField<>(0.00);
+    public ObservableField<String> escalation = new ObservableField<>("");
+    public ObservableField<String> webUrl = new ObservableField<>("");
+    public ObservableField<String> userName = new ObservableField<>("");
+    public ObservableField<String> userId = new ObservableField<>("");
+    public ObservableField<String> from = new ObservableField<>("");
+    public ObservableField<String> fromName = new ObservableField<>("");
+    public ObservableField<String> content = new ObservableField<>("");
+    public ObservableField<String> windDirection = new ObservableField<>("");
+    public ObservableArrayList<String> fileList = new ObservableArrayList<>();
+    public ObservableField<String> fromAddress = new ObservableField<>("");
+    public ObservableField<String> toAddress = new ObservableField<>("");
+    //public ObservableField<String> eventTypeValue = new ObservableField<>("");
+
+    public SingleLiveData<EventBean> singleLiveData = new SingleLiveData<>();
+
+    public void getData() {
+        singleLiveData.setValue(null);
+    }
+}

+ 193 - 24
app/src/main/java/com/sjkj/appthreefloor_tsgz/activity/viewModel/MainViewModel.java

@@ -2,35 +2,204 @@ package com.sjkj.appthreefloor_tsgz.activity.viewModel;
 
 import androidx.databinding.ObservableField;
 
+import com.sjkj.base_lib.camera.dh.bean.CameraBean;
 import com.sjkj.base_lib.vm.BaseViewModel;
 
+import java.util.List;
+
 public class MainViewModel extends BaseViewModel {
 
     public ObservableField<String> username = new ObservableField<>("linzhiyu");
     public ObservableField<String> password = new ObservableField<>("123456");
-//    private LoginRequest loginRequest = new LoginRequest(App.getInstance());
-
-//    public void login(){
-//        showLoadingDialog();
-//        Params params = new Params();
-//        params.put("loginType", "mobile");
-//        params.put("username", username.get());
-//        params.put("password", password.get());
-//        params.put("deviceId", AppTools.getRegistrationId());
-//        loginRequest.setParams(params);
-//        loginRequest.execute(new ProcessErrorSubscriber<LoginBean>() {
-//            @Override
-//            public void onError(Throwable e) {
-//                super.onError(e);
-//                hideLoadingDialog(LoadingDialog.LOADING_FAILED);
-//            }
-//
-//            @Override
-//            public void onNext(LoginBean data) {
-//                super.onNext(data);
-//                hideLoadingDialog(LoadingDialog.LOADING_SUCCESS);
-//            }
-//        });
-//    }
+    //图片路径
+    public ObservableField<String> fileList = new ObservableField<>("");
+    /**
+     * 风向
+     */
+    public ObservableField<CharSequence> windDirection = new ObservableField<>("");
+    /**
+     * 风速
+     */
+    public ObservableField<String> windSpeed = new ObservableField<>("");
+    /**
+     * 温度
+     */
+    public ObservableField<String> temperature = new ObservableField<>("");
+    /**
+     * 湿度
+     */
+    public ObservableField<String> humidity = new ObservableField<>("");
+    /**
+     * 持续时间
+     */
+    public ObservableField<String> time = new ObservableField<>("");
+    /**
+     * 植被类型
+     */
+    public ObservableField<String> type = new ObservableField<>("");
+    /**
+     * 大气压
+     */
+    public ObservableField<String> pressure = new ObservableField<>("");
+
+    /**
+     * 名称
+     */
+    public ObservableField<String> name = new ObservableField<>("");
+    public ObservableField<String> area = new ObservableField<>("");
+    public ObservableField<String> address = new ObservableField<>("");
+    public ObservableField<String> number = new ObservableField<>("");
+    public ObservableField<String> detailsId = new ObservableField<>("");
+    public ObservableField<Double> lat = new ObservableField<>(0.0);
+    public ObservableField<Double> log = new ObservableField<>(0.0);
+    public ObservableField<String> contact = new ObservableField<>("");
+    public ObservableField<String> cycle = new ObservableField<>("");
+    public ObservableField<String> phone = new ObservableField<>("");
+    /**
+     * 绑定设备 数据装载0
+     */
+    public ObservableField<List<CameraBean>> deviceList = new ObservableField<>();
+    public ObservableField<List<String>> deviceStrList = new ObservableField<>();
+    public ObservableField<String> deviceStr = new ObservableField<>("");
+
+    public ObservableField<List<String>> villageIdList = new ObservableField<>();
+    public ObservableField<List<String>> villageNameList = new ObservableField<>();
+    public ObservableField<String> villageNameStr = new ObservableField<>("");
+
+    public ObservableField<String> deptName = new ObservableField<>("");
+    public ObservableField<String> deptId = new ObservableField<>("");
+    public ObservableField<String> remark = new ObservableField<>("");
+    /*消火栓*/
+    public ObservableField<String> HydrantTypeId = new ObservableField<>("");
+    public ObservableField<String> HydrantTypeValue = new ObservableField<>("");
+    /*防火队*/
+
+    /**
+     * 字典选址
+     */
+    public ObservableField<String> ZoningId = new ObservableField<>("");//森林火险区划
+    public ObservableField<String> ZoningValue = new ObservableField<>("");
+    public ObservableField<String> typeId = new ObservableField<>("");//森林火险类别
+    public ObservableField<String> typeValue = new ObservableField<>("");
+    public ObservableField<String> DbId = new ObservableField<>("");//达标情况
+    public ObservableField<String> DbValue = new ObservableField<>("");
+
+    /*物资信息*/
+    public ObservableField<String> MaterialsTypeId = new ObservableField<>("");//物资类别
+    public ObservableField<String> MaterialsTypeValue = new ObservableField<>("");
+    public ObservableField<String> FormHouseId = new ObservableField<>("");//归属仓库
+    public ObservableField<String> FormHouseValue = new ObservableField<>("");
+    public ObservableField<String> Meals = new ObservableField<>("");
+
+    /*应急队伍信息*/
+    public ObservableField<String> TeamTypeId = new ObservableField<>("");//物资类别
+    public ObservableField<String> TeamTypeValue = new ObservableField<>("");
+    public ObservableField<String> ZSnumber = new ObservableField<>("");
+    public ObservableField<String> HTnumber = new ObservableField<>("");
+    public ObservableField<String> ZBnumber = new ObservableField<>("");
+    public ObservableField<String> Scly = new ObservableField<>("");
+    /*警示牌*/
+    public ObservableField<String> useTo = new ObservableField<>("");
+    /*重要交通枢纽管理*/
+    public ObservableField<String> intersectionName = new ObservableField<>("");
+    public ObservableField<String> highwayName = new ObservableField<>("");
+    public ObservableField<String> CongestionPoint = new ObservableField<>("");
+    /*桥梁资源*/
+    public ObservableField<String> ManagementUnitName = new ObservableField<>("");
+    public ObservableField<String> ManagementUnitPhone = new ObservableField<>("");
+    public ObservableField<String> MaintenanceUnitName = new ObservableField<>("");
+    public ObservableField<String> MaintenanceUnitPhone = new ObservableField<>("");
+    /*河流资源*/
+    public ObservableField<String> DrainageArea = new ObservableField<>("");
+    public ObservableField<String> CountyArea = new ObservableField<>("");
+    public ObservableField<String> RiverTotal = new ObservableField<>("");
+    public ObservableField<String> CountyRivers = new ObservableField<>("");
+    public ObservableField<String> Heyuan = new ObservableField<>("");
+    public ObservableField<String> HeKou = new ObservableField<>("");
+    /*闸门资源*/
+    public ObservableField<String> SluiceGate = new ObservableField<>("");
+    public ObservableField<String> WaterGate = new ObservableField<>("");
+
+    /*违建信息*/
+    public ObservableField<String> NoBuildingTypeValue = new ObservableField<>("");
+    public ObservableField<String> NoBuildingTypeId = new ObservableField<>("");
+    public ObservableField<String> contact2 = new ObservableField<>("");
+    public ObservableField<String> phone2 = new ObservableField<>("");
+    public ObservableField<String> contact3 = new ObservableField<>("");
+    public ObservableField<String> phone3 = new ObservableField<>("");
+    public ObservableField<String> contact4 = new ObservableField<>("");
+    public ObservableField<String> phone4 = new ObservableField<>("");
+    public ObservableField<String> contact5 = new ObservableField<>("");
+    public ObservableField<String> phone5 = new ObservableField<>("");
+    /*地质灾害隐患点*/
+    public ObservableField<String> ZHTypeValue = new ObservableField<>("");
+    public ObservableField<String> ZHTypeId = new ObservableField<>("");
+    /*矿产资源*/
+    public ObservableField<String> KkTypeValue = new ObservableField<>("");
+    public ObservableField<String> KkTypeId = new ObservableField<>("");
+    public ObservableField<String> KWType = new ObservableField<>("");
+    public ObservableField<String> KCArea = new ObservableField<>("");
+    public ObservableField<String> CKgm = new ObservableField<>("");
+    public ObservableField<String> EndTime = new ObservableField<>("");
+    /*植树造林计划管理*/
+    public ObservableField<String> CompletionStatusValue = new ObservableField<>("");
+    public ObservableField<String> CompletionStatusId = new ObservableField<>("");
+    public ObservableField<String> ZZTypeValue = new ObservableField<>("");
+    public ObservableField<String> ZZTypeId = new ObservableField<>("");
+    public ObservableField<String> PlanAttributeValue = new ObservableField<>("");
+    public ObservableField<String> PlanAttributeId = new ObservableField<>("");
+    public ObservableField<String> PlanStatusValue = new ObservableField<>("");
+    public ObservableField<String> PlanStatusId = new ObservableField<>("");
+    public ObservableField<String> ForestFarmValue = new ObservableField<>("");
+    public ObservableField<String> ForestFarmId = new ObservableField<>("");
+    public ObservableField<String> Person = new ObservableField<>("");
+    /*林业资源*/
+    public ObservableField<String> SLTypeValue = new ObservableField<>("");
+    public ObservableField<String> SLTypeId = new ObservableField<>("");
+    public ObservableField<String> SpeciesValue = new ObservableField<>("");
+    public ObservableField<String> SpeciesId = new ObservableField<>("");
+    public ObservableField<String> OwnershipValue = new ObservableField<>("");
+    public ObservableField<String> OwnershipId = new ObservableField<>("");
+    /*水源渠道*/
+    public ObservableField<String> ForestFarm = new ObservableField<>("");
+    public ObservableField<String> NO = new ObservableField<>("");
+    public ObservableField<String> amount = new ObservableField<>("");
+    public ObservableField<String> WaterDepth = new ObservableField<>("");
+    public ObservableField<String> RetainWater = new ObservableField<>("");
+    public ObservableField<String> road = new ObservableField<>("");
+    public ObservableField<String> channel = new ObservableField<>("");
+    /*林长牌*/
+    public ObservableField<String> Jurisdiction = new ObservableField<>("");
+    public ObservableField<String> ResponsibleValue = new ObservableField<>("");
+    public ObservableField<String> ResponsibleId = new ObservableField<>("");
+    /*消防力量分布*/
+    public ObservableField<String> Township = new ObservableField<>("");
+    public ObservableField<String> TotalWater = new ObservableField<>("");
 
+    /*压力传感器*/
+    public ObservableField<String> SetParameters = new ObservableField<>("");
+    /*基本联动力量*/
+    public ObservableField<String> ForkliftsNum = new ObservableField<>("");
+    public ObservableField<String> FireTrucksNum = new ObservableField<>("");
+    public ObservableField<String> FireTrucksTonnage = new ObservableField<>("");
+    public ObservableField<String> Organization = new ObservableField<>("");
+    public ObservableField<String> OrganizationId = new ObservableField<>("");
+    /*其他联动力量*/
+    public ObservableField<String> DwPhone = new ObservableField<>("");
+    /*泡沫液*/
+    public ObservableField<String> Foam = new ObservableField<>("");
+    /*珍惜古树*/
+    public ObservableField<String> TreeSeep = new ObservableField<>("");
+    public ObservableField<String> TreeAge = new ObservableField<>("");
+    /*重点防火地块*/
+    public ObservableField<String> Block = new ObservableField<>("");
+    public ObservableField<String> SmallClass = new ObservableField<>("");
+    public ObservableField<String> ForestCategoryValue = new ObservableField<>("");
+    public ObservableField<String> ForestCategoryId = new ObservableField<>("");
+    /*危化企业名单*/
+    public ObservableField<String> EnterpriseCategoryValue = new ObservableField<>("");
+    public ObservableField<String> EnterpriseCategoryId = new ObservableField<>("");
+    /*野生动物监测*/
+    public ObservableField<String> AnimalTypeValue = new ObservableField<>("");
+    public ObservableField<String> AnimalTypeId = new ObservableField<>("");
 }

+ 19 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/activity/viewModel/ResourceVisualizationViewModel.java

@@ -0,0 +1,19 @@
+package com.sjkj.appthreefloor_tsgz.activity.viewModel;
+
+import androidx.databinding.ObservableField;
+
+import com.sjkj.base_lib.vm.BaseViewModel;
+
+public class ResourceVisualizationViewModel extends BaseViewModel {
+    public ObservableField<String> title = new ObservableField<>("");
+    public ObservableField<String> state = new ObservableField<>("");
+    public ObservableField<String> type = new ObservableField<>("");
+    public ObservableField<String> time = new ObservableField<>("");
+    public ObservableField<String> position = new ObservableField<>("");
+    public ObservableField<String> userName = new ObservableField<>("");
+    public ObservableField<String> from = new ObservableField<>("");
+    public ObservableField<String> content = new ObservableField<>("");
+    public ObservableField<String> windDirection = new ObservableField<>("");
+
+
+}

+ 9 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/activity/viewModel/VideoViewModel.java

@@ -0,0 +1,9 @@
+package com.sjkj.appthreefloor_tsgz.activity.viewModel;
+
+import androidx.databinding.ObservableField;
+
+import com.sjkj.base_lib.vm.BaseViewModel;
+
+public class VideoViewModel extends BaseViewModel {
+    public ObservableField<String> videoUrl = new ObservableField<>("");
+}

+ 33 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/adapter/CameraAdapter.java

@@ -0,0 +1,33 @@
+package com.sjkj.appthreefloor_tsgz.adapter;
+
+
+import android.content.Context;
+
+import com.sjkj.appthreefloor_tsgz.R;
+import com.sjkj.appthreefloor_tsgz.databinding.ItemCameraListLayoutBinding;
+import com.sjkj.base_lib.adapter.BaseRecAdapter;
+import com.sjkj.base_lib.camera.dh.bean.CameraBean;
+
+import java.util.List;
+
+public class CameraAdapter extends BaseRecAdapter<CameraBean, ItemCameraListLayoutBinding> {
+
+    public CameraAdapter(Context context) {
+        super(context);
+    }
+
+    public CameraAdapter(Context context, List<CameraBean> list) {
+        super(context, list);
+    }
+
+    @Override
+    protected int getLayoutResId(int viewType) {
+        return R.layout.item_camera_list_layout;
+    }
+
+    @Override
+    protected void onBindItem(ItemCameraListLayoutBinding binding, CameraBean listBean, int position) {
+        binding.setBean(listBean);
+        binding.executePendingBindings();
+    }
+}

+ 66 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/adapter/CommonDataListAdapter.java

@@ -0,0 +1,66 @@
+package com.sjkj.appthreefloor_tsgz.adapter;
+
+import android.content.Context;
+import android.text.TextUtils;
+
+import com.sjkj.appthreefloor_tsgz.R;
+import com.sjkj.appthreefloor_tsgz.bean.ResourceVisualizationBean;
+import com.sjkj.appthreefloor_tsgz.databinding.ItemCommonDataListBinding;
+import com.sjkj.appthreefloor_tsgz.utils.DoubleUtils;
+import com.sjkj.base_lib.adapter.BaseRecAdapter;
+
+import java.util.List;
+
+public class CommonDataListAdapter extends BaseRecAdapter<ResourceVisualizationBean, ItemCommonDataListBinding> {
+
+    public String Type_Name = "";
+
+    public CommonDataListAdapter(Context context) {
+        super(context);
+    }
+
+    public CommonDataListAdapter(Context context, List<ResourceVisualizationBean> list) {
+        super(context, list);
+    }
+
+    public void setTypeName(String Type_Name) {
+        this.Type_Name = Type_Name;
+
+    }
+
+    @Override
+    protected int getLayoutResId(int viewType) {
+        return R.layout.item_common_data_list;
+    }
+
+    @Override
+    protected void onBindItem(ItemCommonDataListBinding binding, ResourceVisualizationBean bean, int position) {
+        binding.setModel(bean);
+        binding.executePendingBindings();
+//        binding.titleTv TODO
+
+        if (!TextUtils.isEmpty(bean.getDistance())) {
+            if (Double.parseDouble(bean.getDistance()) > 1000) {
+                binding.contentTv.setText(DoubleUtils.div(Double.parseDouble(bean.getDistance()), 1000, 2) + "km");
+            } else {
+                binding.contentTv.setText(bean.getDistance() + "m");
+            }
+        } else {
+            binding.contentTv.setText("该资源暂无点位");
+        }
+
+        switch (this.Type_Name) {
+            case "centerdata_t_farm_agricultural_cooperatives":
+                //农民合作社
+                binding.ivType.setBackground(context.getResources().getDrawable(R.drawable.ic_tongyong));
+                break;
+
+            default:
+                binding.ivType.setBackground(context.getResources().getDrawable(R.drawable.ic_tongyong));
+                break;
+
+        }
+    }
+
+
+}

+ 81 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/adapter/ImageAdapter.java

@@ -0,0 +1,81 @@
+package com.sjkj.appthreefloor_tsgz.adapter;
+
+import android.content.Context;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.RelativeLayout;
+
+import com.sjkj.appthreefloor_tsgz.R;
+import com.sjkj.appthreefloor_tsgz.bean.ImageBean;
+import com.sjkj.appthreefloor_tsgz.databinding.ItemImageListBinding;
+import com.sjkj.appthreefloor_tsgz.utils.AppSystemUtils;
+import com.sjkj.appthreefloor_tsgz.utils.ItemSlideCallBack;
+import com.sjkj.base_lib.adapter.BaseRecAdapter;
+
+import java.util.Collections;
+import java.util.List;
+
+public class ImageAdapter extends BaseRecAdapter<ImageBean, ItemImageListBinding> implements ItemSlideCallBack {
+    private OnDeleteClick onDeleteClick;
+
+    public ImageAdapter(Context context) {
+        super(context);
+    }
+
+    public ImageAdapter(Context context, List<ImageBean> list) {
+        super(context, list);
+    }
+
+    @Override
+    protected int getLayoutResId(int viewType) {
+        return R.layout.item_image_list;
+    }
+
+    /**
+     * 设置列表的点击事件回调接口
+     */
+    public void setOnDeleteClick(OnDeleteClick onDeleteClick) {
+        this.onDeleteClick = onDeleteClick;
+    }
+
+    @Override
+    protected void onBindItem(ItemImageListBinding binding, ImageBean bean, int position) {
+        binding.setModel(bean);
+        binding.executePendingBindings();
+        if (AppSystemUtils.isGhb()) {
+            binding.rlImage.setLayoutParams(new RelativeLayout.LayoutParams(300, 300));
+            ViewGroup.LayoutParams params = binding.ivIcon.getLayoutParams();
+            params.height = 280;
+            params.width = 280;
+            binding.ivIcon.setLayoutParams(params);
+            ViewGroup.LayoutParams params_del = binding.deleteIv.getLayoutParams();
+            params_del.height = 75;
+            params_del.width = 75;
+            binding.deleteIv.setLayoutParams(params_del);
+        }
+//        binding.titleTv TODO
+        binding.deleteIv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (list != null && list.size() > 0) {
+                    list.remove(position);
+                    notifyDataSetChanged();
+                }
+
+                if (onDeleteClick != null) {
+                    onDeleteClick.delete(bean, position);
+                }
+            }
+        });
+    }
+
+
+    @Override
+    public void onMove(int fromPosition, int toPosition) {
+        Collections.swap(list, fromPosition, toPosition);//交换数据
+        notifyItemMoved(fromPosition, toPosition);
+        notifyItemChanged(fromPosition);
+        notifyItemChanged(toPosition);
+
+    }
+}

+ 9 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/adapter/OnDeleteClick.java

@@ -0,0 +1,9 @@
+package com.sjkj.appthreefloor_tsgz.adapter;
+
+
+import com.sjkj.appthreefloor_tsgz.bean.ImageBean;
+
+public interface OnDeleteClick {
+
+    void delete(ImageBean bean, int position);
+}

+ 80 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/adapter/PermissionListAdapter.java

@@ -0,0 +1,80 @@
+package com.sjkj.appthreefloor_tsgz.adapter;
+
+import android.content.Context;
+import android.os.Build;
+
+import androidx.annotation.RequiresApi;
+
+import com.hjq.permissions.XXPermissions;
+import com.sjkj.appthreefloor_tsgz.R;
+import com.sjkj.appthreefloor_tsgz.bean.PermissionBean;
+import com.sjkj.appthreefloor_tsgz.databinding.ItemPermissionListBinding;
+import com.sjkj.base_lib.adapter.BaseRecAdapter;
+
+import java.util.List;
+
+public class PermissionListAdapter extends BaseRecAdapter<PermissionBean, ItemPermissionListBinding> {
+
+    public PermissionListAdapter(Context context) {
+        super(context);
+    }
+
+    public PermissionListAdapter(Context context, List<PermissionBean> list) {
+        super(context, list);
+    }
+
+    @Override
+    protected int getLayoutResId(int viewType) {
+        return R.layout.item_permission_list;
+    }
+
+    @RequiresApi(api = Build.VERSION_CODES.R)
+    @Override
+    protected void onBindItem(ItemPermissionListBinding binding, PermissionBean bean, int position) {
+        binding.setModel(bean);
+        binding.executePendingBindings();
+
+        if (XXPermissions.isGranted(context, bean.getKey())) {
+            binding.statusTv.setText("已授权");
+            binding.statusTv.setTextColor(context.getResources().getColor(R.color.green_color));
+            bean.setGranted(true);
+        } else {
+            binding.statusTv.setText("未授权");
+            binding.statusTv.setTextColor(context.getResources().getColor(R.color.red_color));
+            bean.setGranted(false);
+        }
+//        if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.HONEYCOMB_MR2){
+//
+//
+//            if ("文件管理权限".equals(bean.getName())){
+//                if (Environment.isExternalStorageManager()){
+//                    binding.statusTv.setText("已授权");
+//                    binding.statusTv.setTextColor(context.getResources().getColor(R.color.green_color));
+//
+//                }else {
+//                    binding.statusTv.setText("未授权");
+//                    binding.statusTv.setTextColor(context.getResources().getColor(R.color.red_color));
+//
+//                }
+//            }else {
+//                if (ContextCompat.checkSelfPermission(context, bean.getKey()) == PackageManager.PERMISSION_GRANTED) {
+//                    binding.statusTv.setText("已授权");
+//                    binding.statusTv.setTextColor(context.getResources().getColor(R.color.green_color));
+//                } else {
+//                    binding.statusTv.setText("未授权");
+//                    binding.statusTv.setTextColor(context.getResources().getColor(R.color.red_color));
+//                }
+//            }
+//        }else{
+//            if (ContextCompat.checkSelfPermission(context, bean.getKey()) == PackageManager.PERMISSION_GRANTED) {
+//                binding.statusTv.setText("已授权");
+//                binding.statusTv.setTextColor(context.getResources().getColor(R.color.green_color));
+//            } else {
+//                binding.statusTv.setText("未授权");
+//                binding.statusTv.setTextColor(context.getResources().getColor(R.color.red_color));
+//            }
+//        }
+    }
+
+
+}

+ 72 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/adapter/VideoDelAdapter.java

@@ -0,0 +1,72 @@
+package com.sjkj.appthreefloor_tsgz.adapter;
+
+import android.content.Context;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.RelativeLayout;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.request.RequestOptions;
+import com.sjkj.appthreefloor_tsgz.R;
+import com.sjkj.appthreefloor_tsgz.bean.ImageBean;
+import com.sjkj.appthreefloor_tsgz.databinding.ItemVideoDelListBinding;
+import com.sjkj.appthreefloor_tsgz.utils.AppSystemUtils;
+import com.sjkj.base_lib.adapter.BaseRecAdapter;
+
+import java.util.List;
+
+public class VideoDelAdapter extends BaseRecAdapter<ImageBean, ItemVideoDelListBinding> {
+
+    public VideoDelAdapter(Context context) {
+        super(context);
+    }
+
+    public VideoDelAdapter(Context context, List<ImageBean> list) {
+        super(context, list);
+    }
+
+    @Override
+    protected int getLayoutResId(int viewType) {
+        return R.layout.item_video_del_list;
+    }
+
+    @Override
+    protected void onBindItem(ItemVideoDelListBinding binding, ImageBean bean, int position) {
+        binding.setModel(bean);
+        binding.executePendingBindings();
+       //binding.ivVideo.setImageBitmap(VideoUtil.createVideoThumbnail(bean.getRealUrl()));
+        if (AppSystemUtils.isGhb()) {
+            binding.rlVideo.setLayoutParams(new RelativeLayout.LayoutParams(300, 300));
+            ViewGroup.LayoutParams params = binding.ivVideo.getLayoutParams();
+            params.height = 280;
+            params.width = 280;
+            binding.ivVideo.setLayoutParams(params);
+            ViewGroup.LayoutParams params_del = binding.ivIcon.getLayoutParams();
+            params_del.height = 75;
+            params_del.width = 75;
+            binding.ivIcon.setLayoutParams(params_del);
+        }
+        Glide.with(context)
+                .setDefaultRequestOptions(
+                        new RequestOptions()
+                                .frame(1000)
+                                .centerCrop()
+                )
+                .load(bean.getRealUrl())
+                .into(binding.ivVideo);
+
+
+        binding.deleteIv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+
+                if (list != null && list.size() > 0) {
+                    list.remove(position);
+                    notifyDataSetChanged();
+                }
+            }
+        });
+    }
+
+
+}

+ 464 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/address/AddressSelector.java

@@ -0,0 +1,464 @@
+package com.sjkj.appthreefloor_tsgz.address;
+
+import android.animation.ObjectAnimator;
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.graphics.Color;
+import android.text.TextUtils;
+import android.util.AttributeSet;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.sjkj.appthreefloor_tsgz.R;
+
+import java.util.ArrayList;
+
+/**
+ * Author: Blincheng.
+ * Date: 2017/5/9.
+ * Description:收货地址选择器
+ */
+
+public class AddressSelector extends LinearLayout implements View.OnClickListener{
+    private int TextSelectedColor = Color.parseColor("#6D88E9");
+    private int TextEmptyColor = Color.parseColor("#333333");
+    //顶部的tab集合
+    private ArrayList<Tab> tabs;
+    //列表的适配器
+    private AddressAdapter addressAdapter;
+    private ArrayList<CityInterface> cities;
+    private Boolean isHave=false;
+    private OnItemClickListener onItemClickListener;
+    private OnTabSelectedListener onTabSelectedListener;
+    private RecyclerView list;
+    //tabs的外层layout
+    private LinearLayout tabs_layout;
+    //会移动的横线布局
+    private Line line;
+    private Context mContext;
+    //总共tab的数量
+    private int tabAmount = 3;
+    //当前tab的位置
+    private int tabIndex = 0;
+    //分隔线
+    private View grayLine;
+    //列表文字大小
+    private int listTextSize = -1;
+    //tab文字大小
+    private int tabTextSize = -1;
+    //列表文字颜色
+    private int listTextNormalColor = Color.parseColor("#333333");
+    //列表文字选中的颜色
+    private int listTextSelectedColor = Color.parseColor("#6D88E9");
+    //列表icon资源
+    private int listItemIcon = -1;
+
+    public AddressSelector(Context context) {
+        super(context);
+        init(context);
+    }
+
+    public AddressSelector(Context context, AttributeSet attrs) {
+        super(context, attrs);
+        init(context);
+    }
+
+    public AddressSelector(Context context, AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+        init(context);
+    }
+    private void init(Context context){
+        removeAllViews();
+        this.mContext = context;
+        setOrientation(VERTICAL);
+        tabs_layout = new LinearLayout(mContext);
+        tabs_layout.setWeightSum(tabAmount);
+        tabs_layout.setLayoutParams(new LayoutParams(
+                LayoutParams.MATCH_PARENT,
+                LayoutParams.WRAP_CONTENT));
+        tabs_layout.setOrientation(HORIZONTAL);
+        addView(tabs_layout);
+        tabs = new ArrayList<>();
+        Tab tab = newTab("请选择",true);
+        tabs_layout.addView(tab);
+        tabs.add(tab);
+        for(int i = 1;i<tabAmount;i++){
+            Tab _tab = newTab("",false);
+            _tab.setIndex(i);
+            tabs_layout.addView(_tab);
+            tabs.add(_tab);
+        }
+        line = new Line(mContext);
+        line.setLayoutParams(new LayoutParams(
+                LayoutParams.MATCH_PARENT,6));
+        line.setSum(tabAmount);
+        addView(line);
+        grayLine = new View(mContext);
+        grayLine.setLayoutParams(new LayoutParams(
+                LayoutParams.MATCH_PARENT,2));
+        grayLine.setBackgroundColor(mContext.getResources().getColor(R.color.line_DDDDDD));
+        addView(grayLine);
+        list = new RecyclerView(mContext);
+        list.setLayoutParams(new ViewGroup.LayoutParams(
+                LayoutParams.MATCH_PARENT,
+                LayoutParams.MATCH_PARENT));
+        list.setLayoutManager(new LinearLayoutManager(mContext));
+        //list.addItemDecoration(new DividerItem(this));
+        addView(list);
+    }
+
+    /**
+     * 得到一个新的tab对象
+     */
+    private Tab newTab(CharSequence text, boolean isSelected) {
+        Tab tab = new Tab(mContext);
+        tab.setLayoutParams(new LayoutParams(0, LayoutParams.WRAP_CONTENT, 1));
+        tab.setGravity(Gravity.CENTER);
+        tab.setPadding(40, 40, 0, 40);
+        tab.setSelected(isSelected);
+        tab.setText(text);
+        if (tabTextSize != -1) {
+            tab.setTextSize(tabTextSize);
+            tab.getPaint().setFakeBoldText(true);
+        }
+        tab.setTextEmptyColor(TextEmptyColor);
+        tab.setTextSelectedColor(TextSelectedColor);
+        tab.setOnClickListener(this);
+        return tab;
+    }
+    /**
+     * 设置tab的数量,默认3个,不小于2个
+     * @param tabAmount tab的数量
+     * */
+    public void setTabAmount(int tabAmount) {
+        if(tabAmount >= 2){
+            this.tabAmount = tabAmount;
+            init(mContext);
+        }
+        else
+            throw new RuntimeException("AddressSelector tabAmount can not less-than 2 !");
+    }
+    /**
+     * 设置列表的点击事件回调接口
+     * */
+    public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
+        this.onItemClickListener = onItemClickListener;
+    }
+    /**
+     * 列表是否有数据
+     * */
+    public void setBooleData(boolean isHave) {
+        this.isHave = isHave;
+    }
+    /**
+     * 设置列表的数据源,设置后立即生效
+     * */
+    public void setCities(ArrayList cities) {
+//        if(cities == null||cities.size() <= 0)
+//            return;
+//        if(cities.get(0) instanceof CityInterface){
+            this.cities = cities;
+            if(addressAdapter == null){
+                addressAdapter = new AddressAdapter();
+                list.setAdapter(addressAdapter);
+            }
+            addressAdapter.notifyDataSetChanged();
+//        }else{
+//            throw new RuntimeException("AddressSelector cities must implements CityInterface");
+//        }
+    }
+    /**
+     * 设置顶部tab的点击事件回调
+     * */
+    public void setOnTabSelectedListener(OnTabSelectedListener onTabSelectedListener) {
+        this.onTabSelectedListener = onTabSelectedListener;
+    }
+
+    @Override
+    public void onClick(View v) {
+        Tab tab = (Tab) v;
+        //如果点击的tab大于index则直接跳出
+        if(tab.index > tabIndex)
+            return;
+        tabIndex = tab.index;
+        if(onTabSelectedListener != null){
+            if(tab.isSelected)
+                onTabSelectedListener.onTabReselected(AddressSelector.this,tab);
+            else
+                onTabSelectedListener.onTabSelected(AddressSelector.this,tab);
+        }
+        resetAllTabs(tabIndex);
+        line.setIndex(tabIndex);
+        tab.setSelected(true);
+    }
+
+    private void resetAllTabs(int tabIndex){
+        if(tabs != null)
+        for(int i =0;i<tabs.size();i++){
+            tabs.get(i).resetState();
+            if(i > tabIndex){
+                tabs.get(i).setText("");
+            }
+        }
+    }
+    /**
+     * 设置Tab文字选中的颜色
+     * */
+    public void setTextSelectedColor(int textSelectedColor) {
+        TextSelectedColor = textSelectedColor;
+    }
+    /**
+     * 设置Tab文字默认颜色
+     * */
+    public void setTextEmptyColor(int textEmptyColor) {
+        TextEmptyColor = textEmptyColor;
+    }
+    /**
+     * 设置Tab横线的颜色
+     * */
+    public void setLineColor(int lineColor) {
+        line.setSelectedColor(lineColor);
+    }
+    /**
+     * 设置tab下方分隔线的颜色
+     * */
+    public void setGrayLineColor(int grayLineColor) {
+        grayLine.setBackgroundColor(grayLineColor);
+    }
+
+    /**
+     * 设置列表文字大小
+     */
+    public void setListTextSize(int listTextSize) {
+        this.listTextSize = listTextSize;
+    }
+
+    /**
+     * 设置tab文字大小
+     */
+    public void setTabTextSize(int tabTextSize) {
+        this.tabTextSize = tabTextSize;
+    }
+
+    /**
+     * 设置列表文字颜色
+     */
+    public void setListTextNormalColor(int listTextNormalColor) {
+        this.listTextNormalColor = listTextNormalColor;
+    }
+
+    /**
+     * 设置列表选中文字颜色
+     */
+    public void setListTextSelectedColor(int listTextSelectedColor) {
+        this.listTextSelectedColor = listTextSelectedColor;
+    }
+    /**
+     * 设置列表icon资源
+     * */
+    public void setListItemIcon(int listItemIcon) {
+        this.listItemIcon = listItemIcon;
+    }
+
+    /**
+     * 标签控件
+     * */
+    @SuppressLint("AppCompatCustomView")
+    public class Tab extends TextView{
+        private int index = 0;
+        private int TextSelectedColor = Color.parseColor("#6D88E9");
+        private int TextEmptyColor = Color.parseColor("#333333");
+        /**
+         * 是否选中状态
+         * */
+        private boolean isSelected = false;
+        public Tab(Context context) {
+            super(context);
+            init();
+        }
+
+        public Tab(Context context, AttributeSet attrs) {
+            super(context, attrs);
+            init();
+        }
+
+        public Tab(Context context, AttributeSet attrs, int defStyleAttr) {
+            super(context, attrs, defStyleAttr);
+            init();
+        }
+        private void init(){
+            setTextSize(15);
+        }
+        @Override
+        public void setText(CharSequence text, BufferType type) {
+            if(isSelected)
+                setTextColor(TextSelectedColor);
+            else
+                setTextColor(TextEmptyColor);
+            super.setText(text, type);
+        }
+
+        @Override
+        public void setSelected(boolean selected) {
+            isSelected = selected;
+            setText(getText());
+        }
+
+        public int getIndex() {
+            return index;
+        }
+
+        public void setIndex(int index) {
+            this.index = index;
+        }
+        public void resetState(){
+            isSelected = false;
+            setText(getText());
+        }
+
+        public void setTextSelectedColor(int textSelectedColor) {
+            TextSelectedColor = textSelectedColor;
+        }
+
+        public void setTextEmptyColor(int textEmptyColor) {
+            TextEmptyColor = textEmptyColor;
+        }
+    }
+    /**
+     * 横线控件
+     * */
+    private class Line extends LinearLayout{
+        private int sum = 3;
+        private int oldIndex = 0;
+        private int nowIndex = 0;
+        private View indicator;
+        private int SelectedColor = Color.parseColor("#6D88E9");
+        public Line(Context context) {
+            super(context);
+            init(context);
+        }
+
+        public Line(Context context, AttributeSet attrs) {
+            super(context, attrs);
+            init(context);
+        }
+
+        public Line(Context context, AttributeSet attrs, int defStyleAttr) {
+            super(context, attrs, defStyleAttr);
+            init(context);
+        }
+        private void init(Context context){
+            setOrientation(HORIZONTAL);
+            setLayoutParams(new LayoutParams(
+                    LayoutParams.MATCH_PARENT,6));
+            setWeightSum(tabAmount);
+
+          /*  LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
+                    80, LayoutParams.MATCH_PARENT);
+            lp.leftMargin=100;*/
+           /* LayoutInflater inflater = LayoutInflater.from(mContext);
+             indicator = inflater.inflate(R.layout.custom_indicator, null);*/
+
+            indicator= new View(context);
+            LayoutParams lp = new LayoutParams(
+                    80, LayoutParams.MATCH_PARENT);
+            lp.leftMargin=270;
+            indicator.setLayoutParams(lp);
+
+            indicator.setBackgroundColor(SelectedColor);
+            addView(indicator);
+        }
+        public void setIndex(int index){
+            int onceWidth = getWidth()/sum;
+            this.nowIndex = index;
+            ObjectAnimator animator = ObjectAnimator.ofFloat(indicator, "translationX", indicator.getTranslationX(), (nowIndex-oldIndex)*onceWidth);
+            animator.setDuration(300);
+            animator.start();
+        }
+
+        public void setSum(int sum) {
+            this.sum = sum;
+        }
+
+        public void setSelectedColor(int selectedColor) {
+            SelectedColor = selectedColor;
+        }
+    }
+    private class AddressAdapter extends RecyclerView.Adapter<AddressAdapter.MyViewHolder>{
+        @Override
+        public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+            MyViewHolder viewHolder =
+                    new MyViewHolder(LayoutInflater.from(mContext).inflate(
+                           R.layout.item_address,parent,false));
+            return viewHolder;
+        }
+
+        @Override
+        public void onBindViewHolder(MyViewHolder holder, @SuppressLint("RecyclerView") final int position) {
+            if (listItemIcon != -1)
+                holder.img.setImageResource(listItemIcon);
+            if (listTextSize != -1) {
+                holder.tv.setTextSize(listTextSize);
+                holder.tv.getPaint().setFakeBoldText(true);
+            }
+
+            if (TextUtils.equals(tabs.get(tabIndex).getText(), cities.get(position).getCityName())) {
+                holder.img.setVisibility(View.VISIBLE);
+                holder.tv.setTextColor(listTextSelectedColor);
+            } else {
+                holder.img.setVisibility(View.INVISIBLE);
+                holder.tv.setTextColor(listTextNormalColor);
+            }
+            holder.tv.setText(cities.get(position).getCityName());
+            holder.itemView.setTag(cities.get(position));
+            holder.itemView.setOnClickListener(new OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    if(onItemClickListener != null&&isHave){
+                        onItemClickListener.itemClick(AddressSelector.this,(CityInterface) v.getTag(),tabIndex,position);
+                        tabs.get(tabIndex).setText(((CityInterface) v.getTag()).getCityName());
+                        tabs.get(tabIndex).setTag(v.getTag());
+                        if(tabIndex+1 < tabs.size()){
+                            tabIndex ++;
+                            resetAllTabs(tabIndex);
+                            line.setIndex(tabIndex);
+                            tabs.get(tabIndex).setText("请选择");
+                            tabs.get(tabIndex).setSelected(true);
+                        }
+                    }else {
+                        Toast.makeText(mContext,"暂无数据,请重新选择",Toast.LENGTH_LONG).show();
+                    }
+                }
+            });
+        }
+
+        @Override
+        public int getItemCount() {
+            return cities.size();
+        }
+        class MyViewHolder extends RecyclerView.ViewHolder{
+            public TextView tv;
+            public ImageView img;
+            public View itemView;
+            public MyViewHolder(View itemView) {
+                super(itemView);
+                this.itemView = itemView;
+                tv = (TextView) itemView.findViewById(R.id.item_address_tv);
+                img = (ImageView) itemView.findViewById(R.id.item_address_img);
+            }
+        }
+    }
+    public interface OnTabSelectedListener {
+        void onTabSelected(AddressSelector addressSelector,Tab tab);
+        void onTabReselected(AddressSelector addressSelector,Tab tab);
+    }
+}

+ 57 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/address/CityBean.java

@@ -0,0 +1,57 @@
+package com.sjkj.appthreefloor_tsgz.address;
+
+/**
+ * Author: Blincheng.
+ * Date: 2017/5/9.
+ * Description:
+ */
+
+public class CityBean implements CityInterface{
+    private String Name;
+    private String id;
+    private String Grade;
+    private String IsMunicipality;
+
+    public String getIsMunicipality() {
+        return IsMunicipality;
+    }
+
+    public void setIsMunicipality(String isMunicipality) {
+        IsMunicipality = isMunicipality;
+    }
+
+    public String getName() {
+        return Name;
+    }
+
+    public void setName(String name) {
+        Name = name;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getGrade() {
+        return Grade;
+    }
+
+    public void setGrade(String grade) {
+        Grade = grade;
+    }
+
+    @Override
+    public String getCityName() {
+        return Name;
+    }
+
+    @Override
+    public String getCityId() {
+        return id;
+    }
+
+}

+ 12 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/address/CityInterface.java

@@ -0,0 +1,12 @@
+package com.sjkj.appthreefloor_tsgz.address;
+
+/**
+ * Author: Blincheng.
+ * Date: 2017/5/9.
+ * Description:
+ */
+
+public interface CityInterface {
+    String getCityName();
+    String getCityId();
+}

+ 8 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/address/OnFinishClickListener.java

@@ -0,0 +1,8 @@
+package com.sjkj.appthreefloor_tsgz.address;
+
+
+
+public interface OnFinishClickListener {
+
+    void FinishClick(String XQstr,String XQID,String LDstr,String LDID,String DYstr,String DYID,String FJstr,String FJID);
+}

+ 15 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/address/OnItemClickListener.java

@@ -0,0 +1,15 @@
+package com.sjkj.appthreefloor_tsgz.address;
+
+/**
+ * Author: Blincheng.
+ * Date: 2017/5/9.
+ * Description:
+ */
+
+public interface OnItemClickListener {
+    /**
+     * @param city 返回地址列表对应点击的对象
+     * @param tabPosition 对应tab的位置
+     * */
+    void itemClick(AddressSelector addressSelector, CityInterface city, int tabPosition, int position);
+}

+ 39 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/bean/AppEventBean.java

@@ -0,0 +1,39 @@
+package com.sjkj.appthreefloor_tsgz.bean;
+
+public class AppEventBean {
+    private String id;
+
+    public String getEventTypeName() {
+        return eventTypeName;
+    }
+
+    public void setEventTypeName(String eventTypeName) {
+        this.eventTypeName = eventTypeName;
+    }
+
+    private String eventTypeName;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+
+
+
+
+    public String getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(String createTime) {
+        this.createTime = createTime;
+    }
+
+
+
+    private String createTime;
+}

+ 65 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/bean/AppEventThreeBean.java

@@ -0,0 +1,65 @@
+package com.sjkj.appthreefloor_tsgz.bean;
+
+public class AppEventThreeBean {
+   /*   "createTime": "2022-08-30 13:23:48",
+            "deptId": 244,
+            "deptName": "汽开区督查室",
+            "eventType": "森林防火",
+            "eventTypeValue": "3",
+            "id": "1",*/
+    private String createTime;
+    private String deptId;
+    private String deptName;
+    private String eventType;
+
+    public String getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(String createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(String deptId) {
+        this.deptId = deptId;
+    }
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public String getEventType() {
+        return eventType;
+    }
+
+    public void setEventType(String eventType) {
+        this.eventType = eventType;
+    }
+
+    public String getEventTypeValue() {
+        return eventTypeValue;
+    }
+
+    public void setEventTypeValue(String eventTypeValue) {
+        this.eventTypeValue = eventTypeValue;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    private String eventTypeValue;
+    private String id;
+}

+ 46 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/bean/DailyBean.java

@@ -0,0 +1,46 @@
+package com.sjkj.appthreefloor_tsgz.bean;
+
+import com.contrarywind.interfaces.IPickerViewData;
+
+import java.util.List;
+
+public class DailyBean {
+
+
+    public List<Dept> getDepts() {
+        return depts;
+    }
+
+    public void setDepts(List<Dept> depts) {
+        this.depts = depts;
+    }
+
+    private List<Dept> depts;
+
+    public static class Dept  implements IPickerViewData {
+
+        private String deptId;
+        private String deptName;
+
+        public String getDeptName() {
+            return deptName;
+        }
+
+        public void setDeptName(String deptName) {
+            this.deptName = deptName;
+        }
+
+        public String getDeptId() {
+            return deptId;
+        }
+
+        public void setDeptId(String deptId) {
+            this.deptId = deptId;
+        }
+
+        @Override
+        public String getPickerViewText() {
+            return this.deptName;
+        }
+    }
+}

+ 58 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/bean/DataBean.java

@@ -0,0 +1,58 @@
+package com.sjkj.appthreefloor_tsgz.bean;
+
+public class DataBean {
+    private String id;
+    private String type;
+    private String img;
+    private String title;
+    private String content;
+    private String time;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getImg() {
+        return img;
+    }
+
+    public void setImg(String img) {
+        this.img = img;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public String getTime() {
+        return time;
+    }
+
+    public void setTime(String time) {
+        this.time = time;
+    }
+}

+ 47 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/bean/FileBean.java

@@ -0,0 +1,47 @@
+package com.sjkj.appthreefloor_tsgz.bean;
+
+public class FileBean {
+    private String name;
+    private String webName;
+
+    public String getWebName() {
+        return webName;
+    }
+
+    public void setWebName(String webName) {
+        this.webName = webName;
+    }
+
+    /**
+     * 真实路径
+     */
+    private String webUrl;
+    /**
+     * 后台所需url
+     */
+    private String url;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getWebUrl() {
+        return webUrl;
+    }
+
+    public void setWebUrl(String webUrl) {
+        this.webUrl = webUrl;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+}

+ 54 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/bean/ImageBean.java

@@ -0,0 +1,54 @@
+package com.sjkj.appthreefloor_tsgz.bean;
+
+import android.net.Uri;
+
+import java.io.Serializable;
+
+public class ImageBean implements Serializable {
+    private String url;
+    private String realUrl;
+    private Uri uri;
+
+    public String getFileNname() {
+        return fileNname;
+    }
+
+    public void setFileNname(String fileNname) {
+        this.fileNname = fileNname;
+    }
+
+    private String path;
+    private String fileNname;
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public Uri getUri() {
+        return uri;
+    }
+
+    public void setUri(Uri uri) {
+        this.uri = uri;
+    }
+
+    public String getPath() {
+        return path;
+    }
+
+    public void setPath(String path) {
+        this.path = path;
+    }
+
+    public String getRealUrl() {
+        return realUrl;
+    }
+
+    public void setRealUrl(String realUrl) {
+        this.realUrl = realUrl;
+    }
+}

+ 32 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/bean/ImageEventBean.java

@@ -0,0 +1,32 @@
+package com.sjkj.appthreefloor_tsgz.bean;
+
+public class ImageEventBean {
+    private String  fileName;
+    private String busSource;
+
+    public String getBusSource() {
+        return busSource;
+    }
+
+    public void setBusSource(String busSource) {
+        this.busSource = busSource;
+    }
+
+    public String getFileName() {
+        return fileName;
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+    private String attachPath;
+
+    public String getAttachPath() {
+        return attachPath;
+    }
+
+    public void setAttachPath(String attachPath) {
+        this.attachPath = attachPath;
+    }
+}

+ 63 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/bean/MapBean.java

@@ -0,0 +1,63 @@
+package com.sjkj.appthreefloor_tsgz.bean;
+
+/**
+ * CREATE BY LiYang
+ * ON 2022/2/7
+ * SUPPLY : Thanks for watching
+ */
+public class MapBean {
+    private String latitude;
+    private String longitude;
+    private String enterpriseName;
+    private String enterpriseAddress;
+    private String patrolpointName;
+    private String pkId;
+
+    public String getLatitude() {
+        return latitude;
+    }
+
+    public void setLatitude(String latitude) {
+        this.latitude = latitude;
+    }
+
+    public String getLongitude() {
+        return longitude;
+    }
+
+    public void setLongitude(String longitude) {
+        this.longitude = longitude;
+    }
+
+    public String getEnterpriseName() {
+        return enterpriseName;
+    }
+
+    public void setEnterpriseName(String enterpriseName) {
+        this.enterpriseName = enterpriseName;
+    }
+
+    public String getEnterpriseAddress() {
+        return enterpriseAddress;
+    }
+
+    public void setEnterpriseAddress(String enterpriseAddress) {
+        this.enterpriseAddress = enterpriseAddress;
+    }
+
+    public String getPkId() {
+        return pkId;
+    }
+
+    public void setPkId(String pkId) {
+        this.pkId = pkId;
+    }
+
+    public String getPatrolpointName() {
+        return patrolpointName;
+    }
+
+    public void setPatrolpointName(String patrolpointName) {
+        this.patrolpointName = patrolpointName;
+    }
+}

+ 31 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/bean/PermissionBean.java

@@ -0,0 +1,31 @@
+package com.sjkj.appthreefloor_tsgz.bean;
+
+public class PermissionBean {
+    private String name;
+    private String key;
+    private boolean isGranted = false;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public void setKey(String key) {
+        this.key = key;
+    }
+
+    public boolean isGranted() {
+        return isGranted;
+    }
+
+    public void setGranted(boolean granted) {
+        isGranted = granted;
+    }
+}

+ 123 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/bean/ResourceVisualizationBean.java

@@ -0,0 +1,123 @@
+package com.sjkj.appthreefloor_tsgz.bean;
+
+import com.sjkj.base_lib.camera.dh.bean.CameraBean;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 资源可视化 实体
+ */
+public class ResourceVisualizationBean implements Serializable {
+
+    private String address;
+    private String contacts;
+    private String distance;
+    private String latitude;
+    private String longitude;
+    private String name;
+    private String phone;
+    private String type;
+    private String indexName;
+    private String id;
+
+    private List<CameraBean> cameraList;
+
+    private List<String> deviceList;
+
+    public List<String> getDeviceList() {
+        return deviceList;
+    }
+
+    public void setDeviceList(List<String> deviceList) {
+        this.deviceList = deviceList;
+    }
+
+    public String getIndexName() {
+        return indexName;
+    }
+
+    public void setIndexName(String indexName) {
+        this.indexName = indexName;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public List<CameraBean> getCameraList() {
+        return cameraList;
+    }
+
+    public void setCameraList(List<CameraBean> cameraList) {
+        this.cameraList = cameraList;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getContacts() {
+        return contacts;
+    }
+
+    public void setContacts(String contacts) {
+        this.contacts = contacts;
+    }
+
+    public String getDistance() {
+        return distance;
+    }
+
+    public void setDistance(String distance) {
+        this.distance = distance;
+    }
+
+    public String getLatitude() {
+        return latitude;
+    }
+
+    public void setLatitude(String latitude) {
+        this.latitude = latitude;
+    }
+
+    public String getLongitude() {
+        return longitude;
+    }
+
+    public void setLongitude(String longitude) {
+        this.longitude = longitude;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+}

+ 112 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/fragment/CommonDataListFragment.java

@@ -0,0 +1,112 @@
+package com.sjkj.appthreefloor_tsgz.fragment;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.lifecycle.ViewModelProvider;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.sjkj.appthreefloor_tsgz.R;
+import com.sjkj.appthreefloor_tsgz.activity.viewModel.ResourceVisualizationViewModel;
+import com.sjkj.appthreefloor_tsgz.adapter.CommonDataListAdapter;
+import com.sjkj.appthreefloor_tsgz.bean.DataBean;
+import com.sjkj.appthreefloor_tsgz.bean.ResourceVisualizationBean;
+import com.sjkj.appthreefloor_tsgz.databinding.FragmentDataListBinding;
+import com.sjkj.base_lib.adapter.BaseRecAdapter;
+import com.sjkj.base_lib.divider.DividerItem;
+import com.sjkj.base_lib.view.BaseFragment;
+
+import java.util.List;
+
+public class CommonDataListFragment extends BaseFragment {
+
+    private FragmentDataListBinding binding;
+    private ResourceVisualizationViewModel viewModel;
+    private List<DataBean> list;
+    private int currentPage = 1;
+    private CommonDataListAdapter adapter;
+    private Double Latitude = 0.0, Longitude = 0.0;
+    private String type = "";
+
+    public CommonDataListFragment(String type) {
+        this.type = type;
+    }
+
+    @Override
+    protected int initLayout() {
+        return R.layout.fragment_data_list;
+    }
+
+    @Override
+    public View initBinding(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
+        binding = (FragmentDataListBinding) getViewDataBing(inflater, container);
+        viewModel = new ViewModelProvider(getActivity(), new ViewModelProvider.NewInstanceFactory()).get(ResourceVisualizationViewModel.class);
+        binding.setViewModel(viewModel);
+        binding.setLifecycleOwner(this);
+        return binding.getRoot();
+    }
+
+    @Override
+    public void initView() {
+
+
+        LinearLayoutManager manager = new LinearLayoutManager(getActivity());
+        manager.setOrientation(RecyclerView.VERTICAL);
+        binding.recyclerView.setLayoutManager(manager);
+        adapter = new CommonDataListAdapter(getActivity());
+        adapter.setItemClick(new BaseRecAdapter.OnItemClick<ResourceVisualizationBean>() {
+            @Override
+            public void onItemClick(ResourceVisualizationBean bean, int position) {
+//                Intent intent = new Intent(getActivity(), ResourcePointDetailsActivity.class);
+//                intent.putExtra("type", type);
+//                intent.putExtra("id", bean.getId());
+//                intent.putExtra("lat",bean.getLatitude());
+//                intent.putExtra("lng",bean.getLongitude());
+//                startActivity(intent);
+            }
+        });
+        binding.recyclerView.setAdapter(adapter);
+       /* binding.smartRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
+            @Override
+            public void onRefresh(RefreshLayout refreshLayout) {
+                currentPage = 1;
+                requestListRefresh();
+            }
+        });*/
+//        binding.smartRefreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() {
+//            @Override
+//            public void onLoadMore(RefreshLayout refreshLayout) {
+//                //requestListLoadMore();
+//            }
+//        });
+        binding.recyclerView.addItemDecoration(new DividerItem(getActivity()));
+//        viewModel.singleLiveData.observe(this, new Observer<DataBean>() {
+//            @Override
+//            public void onChanged(DataBean bean) {
+//                ToastUtils.show(bean == null ? "null" : "not null");
+//            }
+//        });
+    }
+
+    @Override
+    public void initListener() {
+
+    }
+
+
+    public void updataUI(List<ResourceVisualizationBean> list, String Type_Name) {
+        adapter.setTypeName(Type_Name);
+        adapter.refreshList(list);
+    }
+
+    @Override
+    public void loadData() {
+
+
+    }
+
+
+}

+ 345 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/fragment/CommonMapFragment.java

@@ -0,0 +1,345 @@
+package com.sjkj.appthreefloor_tsgz.fragment;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.Handler;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.lifecycle.LifecycleOwner;
+import androidx.lifecycle.ViewModelProvider;
+import androidx.lifecycle.ViewModelStoreOwner;
+
+import com.amap.api.maps.AMap;
+import com.amap.api.maps.CameraUpdate;
+import com.amap.api.maps.CameraUpdateFactory;
+import com.amap.api.maps.model.BitmapDescriptorFactory;
+import com.amap.api.maps.model.CameraPosition;
+import com.amap.api.maps.model.LatLng;
+import com.amap.api.maps.model.MarkerOptions;
+import com.amap.api.maps.model.MultiPointItem;
+import com.amap.api.maps.model.MultiPointOverlay;
+import com.amap.api.maps.model.MultiPointOverlayOptions;
+import com.hjq.permissions.OnPermissionCallback;
+import com.hjq.permissions.Permission;
+import com.hjq.permissions.XXPermissions;
+import com.sjkj.appthreefloor_tsgz.R;
+import com.sjkj.appthreefloor_tsgz.bean.ResourceVisualizationBean;
+import com.sjkj.appthreefloor_tsgz.databinding.FragmentMapBinding;
+import com.sjkj.appthreefloor_tsgz.fragment.viewModel.MapViewModel;
+import com.sjkj.appthreefloor_tsgz.map.MapMarkBean;
+import com.sjkj.base_lib.app.AppManager;
+import com.sjkj.base_lib.utils.CommonUtils;
+import com.sjkj.base_lib.utils.Constants;
+import com.sjkj.base_lib.utils.MapUtils;
+import com.sjkj.base_lib.utils.ToastUtils;
+import com.sjkj.base_lib.view.BaseMapFragment;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class CommonMapFragment extends BaseMapFragment {
+    private FragmentMapBinding binding;
+    private MapViewModel viewModel;
+    //显示地图需要的变量
+    private AMap aMap;//地图对象
+    //标识,用于判断是否只显示一次定位信息和用户重新定位
+    //定位需要的声明
+    private List<MapMarkBean> markBeans;
+    private List<ResourceVisualizationBean> resourceVisualizationBeanList = new ArrayList<>();
+    private int zoomValue = 12;//(3-19)
+    /**
+     * 优先级 :1/0
+     * 1:地图移动到标点位置
+     * 0:地图移动到定位位置
+     */
+    private int priority = 0;
+    private MultiPointOverlay multiPointOverlay;
+    private MultiPointOverlayOptions overlayOptions;
+    private Handler handler = new Handler();
+
+    public CommonMapFragment() {
+
+    }
+
+    private String type = "";
+
+
+    public CommonMapFragment(String type) {
+        this.type = type;
+    }
+
+    public CommonMapFragment(List<MapMarkBean> markBeans, int priority) {
+        this.markBeans = markBeans;
+        this.priority = priority;
+
+    }
+
+//    private void clear() {
+//        overlayOptions = null;
+//        if (multiPointOverlay != null) {
+//            multiPointOverlay.remove();
+//            multiPointOverlay.destroy();
+//        }
+//    }
+
+//    public void refreshData(List<MapMarkBean> markBeans, List<ResourceVisualizationBean> list, String type, int priority) {
+//        clear();//先清除图层
+//        this.markBeans = markBeans;
+//        this.priority = priority;
+//        this.resourceVisualizationBeanList = list;
+////        changeCamera(CameraUpdateFactory.newCameraPosition(new CameraPosition(new LatLng(Constants.DEFAULT_LOCATION_LAT, Constants.DEFAULT_LOCATION_LNG, true), 12, 30, 30)));
+//        changeCamera(CameraUpdateFactory.newCameraPosition(new CameraPosition(new LatLng(markBeans.get(markBeans.size() - 1).getLatitude(), markBeans.get(markBeans.size() - 1).getLongitude(), true), 10, 30, 30)));
+//        binding.mapView.getMap().clear();
+//        overlayOptions = new MultiPointOverlayOptions();
+//        setLocationIcon(type);
+//        overlayOptions.anchor(0.5f, 0.5f); //设置锚点
+//        multiPointOverlay = binding.mapView.getMap().addMultiPointOverlay(overlayOptions);
+////        for (int i = 0; i < markBeans.size(); i++) {
+////            binding.mapView.getMap().addMarker(new MarkerOptions().position(new LatLng(markBeans.get(i).getLatitude(), markBeans.get(i).getLongitude()))
+////                    .visible(true)
+////                    .snippet(markBeans.get(i).getId())
+////                    .title(markBeans.get(i).getName())
+////                    .icon(BitmapDescriptorFactory
+////                            .defaultMarker(BitmapDescriptorFactory.HUE_BLUE)));
+////        }
+//
+//
+//        new Handler().post(new Runnable() {
+//            @Override
+//            public void run() {
+//                List<MultiPointItem> list = new ArrayList<MultiPointItem>();
+//                for (MapMarkBean newList : markBeans) {
+//
+//                    MultiPointItem multiPointItem = new MultiPointItem(new LatLng(newList.getLatitude(), newList.getLongitude()));
+//                    multiPointItem.setTitle(newList.getName());
+//
+//                    multiPointItem.setCustomerId(newList.getId());
+//
+//                    list.add(multiPointItem);
+//
+//
+//                }
+//                multiPointOverlay.setItems(list);
+//            }
+//        });
+//
+//    }
+
+    public void refreshData(List<ResourceVisualizationBean> list) {
+        clear();//先清除图层
+        new Thread(new Runnable() {
+            @Override
+            public void run() {
+                handler.post(new Runnable() {
+                    @Override
+                    public void run() {
+                        try {
+                            for (ResourceVisualizationBean visualizationBean : list) {
+                                if (CommonUtils.checkLongitudeLatitude(visualizationBean.getLongitude(), visualizationBean.getLatitude())) {
+                                    MapUtils.GPS gps = MapUtils.gps84_To_Gcj02(Double.parseDouble(visualizationBean.getLatitude()), Double.parseDouble(visualizationBean.getLongitude()));
+                                    if (gps != null) {
+                                        setLocationIcon(gps, visualizationBean.getId(), visualizationBean.getIndexName() + "", visualizationBean);
+                                    }
+                                }
+                            }
+                        } catch (NumberFormatException e) {
+                            e.printStackTrace();
+                        }
+                        try {
+                            changeCamera(CameraUpdateFactory.newCameraPosition(new CameraPosition(new LatLng(Double.parseDouble(list.get(list.size() - 1).getLatitude()), Double.parseDouble(list.get(list.size() - 1).getLongitude()), true), 10, 30, 30)));
+                        } catch (NumberFormatException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                });
+            }
+        }).start();
+
+    }
+
+    private void clear() {
+        if (binding.mapView.getMap() != null)
+            binding.mapView.getMap().clear();
+    }
+
+    private void setLocationIcon(MapUtils.GPS gps, String id, String type, ResourceVisualizationBean bean) {
+        Log.e("ICON", type);
+        MarkerOptions options = new MarkerOptions();
+        options.position(new LatLng(gps.getLat(), gps.getLon()));
+        options.visible(true);
+        options.snippet(id);
+        options.infoWindowEnable(false);
+//        options.title(dataBean.getName());
+        switch (type) {
+            //农业
+            case "centerdata_t_farm_agricultural_cooperatives"://农民合作社
+                options.icon(BitmapDescriptorFactory.fromResource(R.drawable.icon_agriculture_cooperatives));//设置图标
+                break;
+
+            default:
+                options.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_BLUE));//设置图标
+                break;
+
+        }
+        binding.mapView.getMap().addMarker(options);
+
+
+    }
+
+    @Override
+    protected int initLayout() {
+        return R.layout.fragment_map;
+    }
+
+    @Override
+    public View initBinding(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
+        binding = (FragmentMapBinding) getViewDataBing(inflater, container);
+        viewModel = new ViewModelProvider((ViewModelStoreOwner) AppManager.getAppManager().currentActivity(), new ViewModelProvider.NewInstanceFactory()).get(MapViewModel.class);
+        binding.setViewModel(viewModel);
+        binding.setLifecycleOwner((LifecycleOwner) this);
+        binding.mapView.onCreate(bundle);
+        binding.mapView.getMap().getUiSettings().setLogoBottomMargin(-50);
+        binding.mapView.getMap().getUiSettings().setZoomControlsEnabled(true);
+        binding.mapView.getMap().getUiSettings().setMyLocationButtonEnabled(false);
+        //binding.mapView.getMap().moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(43.911535, 125.324667), zoomValue));
+        changeCamera(CameraUpdateFactory.newCameraPosition(new CameraPosition(new LatLng(Constants.DEFAULT_LOCATION_LAT,Constants.DEFAULT_LOCATION_LNG, true), 10, 30, 30)));
+
+        return binding.getRoot();
+    }
+
+    @Override
+    public void initView() {
+
+        requestPermissionsLocation();
+    }
+
+    /**
+     * 根据动画按钮状态,调用函数animateCamera或moveCamera来改变可视区域
+     */
+    private void changeCamera(CameraUpdate update) {
+
+        binding.mapView.getMap().moveCamera(update);
+
+    }
+
+    private void requestPermissionsLocation() {
+        XXPermissions.with(AppManager.getAppManager().currentActivity())
+                .permission(Permission.ACCESS_COARSE_LOCATION)
+                .permission(Permission.ACCESS_FINE_LOCATION)
+//                .permission(Permission.ACCESS_BACKGROUND_LOCATION)
+                .request(new OnPermissionCallback() {
+                    @Override
+                    public void onGranted(List<String> permissions, boolean all) {
+                        if (all) {
+                            //开始定位
+                            initLocation();
+                        } else {
+                            ToastUtils.show("获取部分权限成功,但部分权限未正常授予");
+                        }
+                    }
+
+                    @Override
+                    public void onDenied(List<String> permissions, boolean never) {
+                        if (never) {
+                            ToastUtils.show("被永久拒绝授权,请手动授予权限");
+                            // 如果是被永久拒绝就跳转到应用权限系统设置页面
+                            XXPermissions.startPermissionActivity(AppManager.getAppManager().currentActivity(), permissions);
+                        } else {
+                            ToastUtils.show("获取权限失败");
+                        }
+                    }
+                });
+    }
+
+    private void initLocation() {
+
+
+    }
+
+    @Override
+    public void initListener() {
+        binding.mapView.getMap().setOnMultiPointClickListener(new AMap.OnMultiPointClickListener() {
+            @Override
+            public boolean onPointClick(MultiPointItem multiPointItem) {
+                if (resourceVisualizationBeanList != null && resourceVisualizationBeanList.size() > 0) {
+                    for (ResourceVisualizationBean bean : resourceVisualizationBeanList) {
+                        if (multiPointItem.getCustomerId().equals(bean.getId())) {
+//                            Intent intent = new Intent(getActivity(), ResourcePointDetailsActivity.class);
+//                            intent.putExtra("type", type);
+//                            intent.putExtra("id", bean.getId());
+//                            intent.putExtra("lat",bean.getLatitude());
+//                            intent.putExtra("lng",bean.getLongitude());
+//                            startActivity(intent);
+                        }
+                    }
+                }
+                return false;
+            }
+        });
+    }
+
+    @Override
+    public void loadData() {
+
+    }
+
+    //自定义一个图钉,并且设置图标,当我们点击图钉时,显示设置的信息
+
+    /**
+     * @param lat 纬度
+     * @param log 经度
+     * @return
+     */
+    private MarkerOptions getMarkerOptions(double lat, double log, String address) {
+        //设置图钉选项
+        MarkerOptions options = new MarkerOptions();
+        //图标
+        options.icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_baseline_local_fire_department_24));
+        //位置
+        options.position(new LatLng(lat, log));
+        //标题
+        options.title(address);
+        options.visible(true);
+        //子标题
+        //options.snippet("这里好火");
+        //设置多少帧刷新一次图片资源
+        options.period(60);
+        return options;
+    }
+
+    @Override
+    public void onResume() {
+        super.onResume();
+        binding.mapView.onResume();
+    }
+
+    @Override
+    public void onPause() {
+        super.onPause();
+        binding.mapView.onPause();
+    }
+
+    @Override
+    public void onSaveInstanceState(@NonNull Bundle outState) {
+        super.onSaveInstanceState(outState);
+        binding.mapView.onSaveInstanceState(outState);
+    }
+
+    @Override
+    public void onDestroy() {
+        super.onDestroy();
+
+    }
+
+    @Override
+    public void onDestroyView() {
+        super.onDestroyView();
+        binding.mapView.onDestroy();
+    }
+
+
+}

+ 10 - 1
app/src/main/java/com/sjkj/appthreefloor_tsgz/fragment/EventFragment.java

@@ -5,6 +5,7 @@ import android.os.Bundle;
 import android.text.Editable;
 import android.text.TextUtils;
 import android.text.TextWatcher;
+import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -18,6 +19,7 @@ import com.scwang.smartrefresh.layout.api.RefreshLayout;
 import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener;
 import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
 import com.sjkj.appthreefloor_tsgz.R;
+import com.sjkj.appthreefloor_tsgz.activity.NewEventActivity;
 import com.sjkj.appthreefloor_tsgz.adapter.EventCenterAdapter;
 import com.sjkj.appthreefloor_tsgz.app.App;
 import com.sjkj.appthreefloor_tsgz.bean.EventBean;
@@ -30,7 +32,6 @@ import com.sjkj.base_lib.divider.DividerItem;
 import com.sjkj.base_lib.entity.Params;
 import com.sjkj.base_lib.net.domain.interactor.ProcessErrorSubscriber;
 import com.sjkj.base_lib.utils.Constants;
-import com.sjkj.base_lib.view.BaseActivity;
 import com.sjkj.base_lib.view.BaseFragment;
 import com.sjkj.base_lib.weight.LoadingDialog;
 
@@ -59,6 +60,7 @@ public class EventFragment extends BaseFragment /*implements View.OnClickListene
         return binding.getRoot();
     }
 
+
     @Override
     public void initView() {
         initTab();
@@ -217,6 +219,13 @@ public class EventFragment extends BaseFragment /*implements View.OnClickListene
 
     @Override
     public void initListener() {
+        binding.report.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                Log.d("ZHR21111", "上报");
+                startActivityForResult(new Intent(getActivity(), NewEventActivity.class), 1000);
+            }
+        });
         binding.llChongzhi.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View view) {

+ 55 - 1
app/src/main/java/com/sjkj/appthreefloor_tsgz/fragment/MainFragment.java

@@ -1,7 +1,9 @@
 package com.sjkj.appthreefloor_tsgz.fragment;
 
+import android.content.Intent;
 import android.os.Bundle;
 import android.text.TextUtils;
+import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -12,16 +14,20 @@ import com.bumptech.glide.Glide;
 import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
 import com.bumptech.glide.request.RequestOptions;
 import com.sjkj.appthreefloor_tsgz.R;
+import com.sjkj.appthreefloor_tsgz.activity.MonitoringCenterActivity;
+import com.sjkj.appthreefloor_tsgz.activity.WaterCraneResourcesActivity;
 import com.sjkj.appthreefloor_tsgz.app.App;
 import com.sjkj.appthreefloor_tsgz.bean.BannerDataBean;
 import com.sjkj.appthreefloor_tsgz.databinding.FragmentMainBinding;
 import com.sjkj.appthreefloor_tsgz.net.BannerRequest;
 import com.sjkj.base_lib.entity.Params;
 import com.sjkj.base_lib.net.domain.interactor.ProcessErrorSubscriber;
+import com.sjkj.base_lib.utils.CommonUtils;
+import com.sjkj.base_lib.utils.LocationUtils;
+import com.sjkj.base_lib.utils.ToastUtils;
 import com.sjkj.base_lib.view.BaseFragment;
 import com.youth.banner.adapter.BannerImageAdapter;
 import com.youth.banner.holder.BannerImageHolder;
-import com.youth.banner.indicator.CircleIndicator;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -53,7 +59,55 @@ public class MainFragment extends BaseFragment {
 
     @Override
     public void initListener() {
+        binding.llCamera.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                startActivity(new Intent(getActivity(), MonitoringCenterActivity.class).putExtra("titleName", getString(R.string.monitor_center)));
+            }
+        });
+        //传感器
+        binding.llSensor.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+
+            }
+        });
+        //水鹤
+        binding.llWaterCrane.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+
+                LocationUtils.getInstance().startLocation(true, new LocationUtils.OnLocationListener() {
+                    @Override
+                    public void onLocationChanged(double lat, double lng, String address, int code) {
+
+
+                        if (CommonUtils.checkLongitudeLatitude(lng + "", lat + "")) {
+                            // hideLoadingDialog(LoadingDialog.LOADING_SUCCESS);
+                            Log.d("zhr1111", lat + "===" + lng);
+                            startActivity(new Intent(getActivity(), WaterCraneResourcesActivity.class).putExtra("Longitude", lng).putExtra("Latitude", lat));
+                        } else {
+                            ToastUtils.show("定位失败,请检查定位权限或者稍后重试");
+                        }
 
+                    }
+                });
+            }
+        });
+        //取水口
+        binding.llWaterIntake.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+
+            }
+        });
+        //水源
+        binding.llWaterSource.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+
+            }
+        });
     }
 
     @Override

+ 246 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/fragment/viewModel/MapViewModel.java

@@ -0,0 +1,246 @@
+package com.sjkj.appthreefloor_tsgz.fragment.viewModel;
+
+import android.app.Activity;
+import android.content.Context;
+import android.graphics.Color;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.TextView;
+
+import androidx.databinding.ObservableField;
+
+import com.amap.api.maps.AMap;
+import com.amap.api.maps.CameraUpdateFactory;
+import com.amap.api.maps.model.BitmapDescriptorFactory;
+import com.amap.api.maps.model.LatLng;
+import com.amap.api.maps.model.Marker;
+import com.amap.api.maps.model.MarkerOptions;
+import com.amap.api.maps.model.MyLocationStyle;
+import com.sjkj.appthreefloor_tsgz.R;
+import com.sjkj.appthreefloor_tsgz.bean.MapBean;
+import com.sjkj.appthreefloor_tsgz.map.MapMarkBean;
+import com.sjkj.base_lib.utils.LocationUtils;
+import com.sjkj.base_lib.vm.BaseViewModel;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class MapViewModel extends BaseViewModel {
+    public ObservableField<List<MapMarkBean>> markListBean = new ObservableField<>();
+
+    /**
+     * 地图参数
+     */
+    private AMap aMap;
+    private String popTab = "company";
+    //    public String address = "";
+    public ObservableField<Double> userLat = new ObservableField<>(0.00);
+    public ObservableField<Double> userLog = new ObservableField<>(0.00);
+    private List<MapBean> enterpriseList = new ArrayList<>();//公司点标记
+    private List<MapBean> patrolList = new ArrayList<>();//巡更点标记
+    private Context mapContext;
+//    private ScanningSuccessPopup successPopup;
+//    private ScanningFailurePopup failurePopup;
+
+    /**
+     * 设置搜索切换按钮
+     *
+     * @param tab
+     */
+    public void setPopTab(String tab) {
+        popTab = tab;
+        changeMapMarker();
+    }
+
+    /**
+     * ViewModel初始化aMap
+     *
+     * @param aMap
+     */
+    public void setAMap(AMap aMap, Context context) {
+        this.aMap = aMap;
+        this.mapContext = context;
+    }
+
+    /**
+     * 切换图片层集合
+     */
+    public void changeMapMarker() {
+        if (TextUtils.equals(popTab, "company"))
+            isMapMarker("enterprise", enterpriseList);
+        else
+            isMapMarker("name", patrolList);
+    }
+
+//    /**
+//     * 展示搜索pop
+//     *
+//     * @param activity
+//     * @param view
+//     */
+//    public void searchPopup(Activity activity, View view) {
+//        if (null == popup) {
+//            popup = new SearchCompanyPopup(activity, null);
+//            popup.setListener(bean -> {
+//                if (bean == null) return;
+//                Intent intent = new Intent(activity, EmergencyInspectionDetailsActivity.class);
+//                intent.putExtra("id", bean.getPkId());
+//                intent.putExtra("name", bean.getEnterpriseName());
+//                intent.putExtra("address", bean.getEnterpriseAddress());
+//                intent.putExtra("longitude", bean.getLongitude());
+//                intent.putExtra("latitude", bean.getLatitude());
+//                intent.putExtra("time", bean.getTime());
+//                activity.startActivity(intent);
+//            });
+//        }
+//        popup.showAtLocation(view, Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL, 0, 250);
+//    }
+
+    /**
+     * 对Map进行插点展示
+     *
+     * @param name
+     * @param list
+     */
+    protected void isMapMarker(String name, List<MapBean> list) {
+        aMap.clear(true);
+        for (int i = 0; i < list.size(); i++) {
+            if (TextUtils.isEmpty(list.get(i).getLatitude()) || TextUtils.isEmpty(list.get(i).getLongitude())
+                    || TextUtils.equals("null", list.get(i).getLatitude()) || TextUtils.equals("null", list.get(i).getLongitude())) {
+                continue;
+            }
+            LatLng latLng = new LatLng(Double.valueOf(list.get(i).getLatitude()), Double.valueOf(list.get(i).getLongitude()));
+            MarkerOptions options = new MarkerOptions();
+            options.icon(TextUtils.equals("enterprise", name) ? BitmapDescriptorFactory.fromResource(R.drawable.company_location_img) : BitmapDescriptorFactory.fromResource(R.drawable.company_location_img_1));
+            options.position(latLng);
+            options.title(TextUtils.equals("enterprise", name) ? list.get(i).getPkId() + "," + list.get(i).getEnterpriseName() + "," + list.get(i).getEnterpriseAddress() : list.get(i).getPkId() + "," + list.get(i).getPatrolpointName() + "," + list.get(i).getEnterpriseAddress());
+            aMap.addMarker(options);
+        }
+
+        aMap.setOnMarkerClickListener(marker -> {
+            singleMapMarker(marker, name);
+            return true;
+        });
+    }
+
+    /**
+     * 点击对应marker点展示,带有详情框
+     */
+    public void singleMapMarker(Marker marker, String name) {
+        if (TextUtils.equals("enterprise", name))
+            marker.setIcon(BitmapDescriptorFactory.fromResource(R.drawable.company_location_img));
+        else
+            marker.setIcon(BitmapDescriptorFactory.fromResource(R.drawable.company_location_img_1));
+        String[] array = marker.getTitle().split(",");
+        aMap.setInfoWindowAdapter(new AMap.InfoWindowAdapter() {
+            View infoWindow = null;//自定义marker布局
+
+            @Override
+            public View getInfoWindow(Marker marker) {
+                if (infoWindow == null) {
+                    infoWindow = LayoutInflater.from(mapContext).inflate(R.layout.custom_marker, null);
+                    infoWindow.findViewById(R.id.parentLayout).setOnClickListener(v -> {
+                        if (TextUtils.equals("enterprise", name)) {
+//                            ARouter.getInstance().build(Constant.ACTIVITY_URL_DETAILS)
+//                                    .withString("title", array[1])
+//                                    .withString("id", array[0])
+//                                    .navigation();
+                        }
+                    });
+                }
+                render(marker, infoWindow);
+                return infoWindow;
+            }
+
+            @Override
+            public View getInfoContents(Marker marker) {
+                return null;
+            }
+        });
+        marker.showInfoWindow();
+    }
+
+    /**
+     * 自定义infoWindow窗口
+     */
+    private void render(Marker marker, View view) {
+        String[] array = marker.getTitle().split(",");
+        TextView markerName = view.findViewById(R.id.markerName);
+        TextView markerDistance = view.findViewById(R.id.markerDistance);
+        markerName.setText(array[1]);
+        markerDistance.setText(array[2]);
+    }
+
+    /**
+     * 定位用户当前坐标
+     *
+     * @param activity
+     */
+    public void startLocation(Activity activity) {
+        LocationUtils.getInstance().startLocation(true, new LocationUtils.OnLocationListener() {
+            @Override
+            public void onLocationChanged(double lat, double lng, String address, int code) {
+                address = address;
+//                if (TextUtils.isEmpty(aMapLocation.getAddress())) {
+//                    DigitalEmergencyMainActivity.address = "定位失败";
+//                } else {
+//                    DigitalEmergencyMainActivity.address = aMapLocation.getAddress();
+//                }
+                Log.e("startLocation", "address" + address + "_log:" + lng + "_lat:" + lat);
+                MyLocationStyle myLocationStyle;
+                myLocationStyle = new MyLocationStyle();//初始化定位蓝点样式类myLocationStyle.myLocationType(MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE);//连续定位、且将视角移动到地图中心点,定位点依照设备方向旋转,并且会跟随设备移动。(1秒1次定位)如果不设置myLocationType,默认也会执行此种模式。
+                myLocationStyle.interval(5000); //设置连续定位模式下的定位间隔,只在连续定位模式下生效,单次定位模式下不会生效。单位为毫秒。
+                myLocationStyle.myLocationType(MyLocationStyle.LOCATION_TYPE_SHOW);//定位一次,且将视角移动到地图中心点
+                myLocationStyle.strokeColor(Color.argb(0, 0, 0, 0));
+                myLocationStyle.radiusFillColor(Color.argb(0, 0, 0, 0));
+                myLocationStyle.strokeWidth(0);
+                myLocationStyle.myLocationIcon(BitmapDescriptorFactory.fromView(activity.getLayoutInflater().inflate(R.layout.map_location, null)));
+                aMap.setMyLocationStyle(myLocationStyle);//设置定位蓝点的Style
+                aMap.getUiSettings().setMyLocationButtonEnabled(true);//设置默认定位按钮是否显示,非必需设置。
+                aMap.setMyLocationEnabled(true);// 设置为true表示启动显示定位蓝点,false表示隐藏定位蓝点并不进行定位,默认是false。
+                aMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(lat, lng), 16));
+
+                requestMapData(activity);
+            }
+        });
+    }
+
+    public void requestMapData(Activity activity) {
+//        ProgressHelper.show(activity);
+//        HashMap<String, Object> params = new HashMap<>();
+//        params.put("userId", AppTools.getUserId());
+//        params.put("latitude", userLat);
+//        params.put("longitude", userLog);
+//
+//
+//        HttpTools.post(mapContext, URLConfig.getInstance().getPOINT_POSITION(), params, new JsonResponseListener() {
+//            @Override
+//            public void onSuccess(JSONObject response) {
+//                ProgressHelper.hide();
+//                if (null != response.optJSONObject("data")) {
+//                    if (response.optJSONObject("data").optJSONArray("qiye").length() > 0) {
+//                        enterpriseList.addAll(new Gson().fromJson(response.optJSONObject("data").optString("qiye"),
+//                                new TypeToken<List<MapBean>>() {
+//                                }.getType()));
+//                    }
+//
+//                    if (response.optJSONObject("data").optJSONArray("xungengdian").length() > 0) {
+//                        patrolList.addAll(new Gson().fromJson(response.optJSONObject("data").optString("xungengdian"),
+//                                new TypeToken<List<MapBean>>() {
+//                                }.getType()));
+//                    }
+//                    changeMapMarker();
+//                }
+//            }
+//
+//            @Override
+//            public void onFailure(String result) {
+//                ProgressHelper.hide();
+//                ToastUtils.showToast(result);
+//            }
+//
+//        });
+    }
+}

+ 63 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/map/MapMarkBean.java

@@ -0,0 +1,63 @@
+package com.sjkj.appthreefloor_tsgz.map;
+
+import com.sjkj.base_lib.camera.dh.bean.CameraBean;
+
+import java.io.Serializable;
+import java.util.List;
+
+public class MapMarkBean implements Serializable {
+    private double latitude;
+    private double longitude;
+    private String name;
+    private String id;
+    private List<CameraBean> cameraList;
+
+    public List<CameraBean> getCameraList() {
+        return cameraList;
+    }
+
+    public void setCameraList(List<CameraBean> cameraList) {
+        this.cameraList = cameraList;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public MapMarkBean() {
+    }
+
+    public MapMarkBean(double latitude, double longitude, String name) {
+        this.latitude = latitude;
+        this.longitude = longitude;
+        this.name = name;
+    }
+
+    public double getLatitude() {
+        return latitude;
+    }
+
+    public void setLatitude(double latitude) {
+        this.latitude = latitude;
+    }
+
+    public double getLongitude() {
+        return longitude;
+    }
+
+    public void setLongitude(double longitude) {
+        this.longitude = longitude;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 52 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/net/AppEventThreeRequest.java

@@ -0,0 +1,52 @@
+package com.sjkj.appthreefloor_tsgz.net;
+
+import android.content.Context;
+
+import com.sjkj.appthreefloor_tsgz.bean.AppEventThreeBean;
+import com.sjkj.base_lib.entity.Params;
+import com.sjkj.base_lib.entity.ResponseBean;
+import com.sjkj.base_lib.net.RetrofitFactory;
+import com.sjkj.base_lib.net.data.exception.BusinessException;
+import com.sjkj.base_lib.net.domain.interactor.UseCase;
+import com.sjkj.base_lib.utils.AppTools;
+
+import java.util.List;
+
+import rx.Observable;
+import rx.functions.Func1;
+
+/**
+ */
+public class AppEventThreeRequest extends UseCase {
+    private Context context;
+    private RetrofitService service;
+
+    private Params params;
+
+    public Params getParams() {
+        return params;
+    }
+
+    public void setParams(Params params) {
+        this.params = params;
+    }
+
+    public AppEventThreeRequest(Context context) {
+        this.context = context;
+        service = RetrofitFactory.getRetrofit(AppTools.getBaseUrl()).create(RetrofitService.class);
+    }
+
+    @Override
+    protected Observable buildUseCaseObservable() {
+        return service.QueryAppEventThree(params).flatMap(new Func1<ResponseBean<List<AppEventThreeBean>>, Observable<List<AppEventThreeBean>>>() {
+            @Override
+            public Observable<List<AppEventThreeBean>> call(ResponseBean<List<AppEventThreeBean>> responseBean) {
+                if (!ResponseBean.CODE_SUCCESS.
+                        equals(responseBean.getCode())) {
+                    return Observable.error(new BusinessException(responseBean.getMsg()));
+                }
+                return Observable.just(responseBean.getData());
+            }
+        });
+    }
+}

+ 52 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/net/AppEventTypeRequest.java

@@ -0,0 +1,52 @@
+package com.sjkj.appthreefloor_tsgz.net;
+
+import android.content.Context;
+
+import com.sjkj.appthreefloor_tsgz.bean.AppEventBean;
+import com.sjkj.base_lib.entity.Params;
+import com.sjkj.base_lib.entity.ResponseBean;
+import com.sjkj.base_lib.net.RetrofitFactory;
+import com.sjkj.base_lib.net.data.exception.BusinessException;
+import com.sjkj.base_lib.net.domain.interactor.UseCase;
+import com.sjkj.base_lib.utils.AppTools;
+
+import java.util.List;
+
+import rx.Observable;
+import rx.functions.Func1;
+
+/**
+ */
+public class AppEventTypeRequest extends UseCase {
+    private Context context;
+    private RetrofitService service;
+
+    private Params params;
+
+    public Params getParams() {
+        return params;
+    }
+
+    public void setParams(Params params) {
+        this.params = params;
+    }
+
+    public AppEventTypeRequest(Context context) {
+        this.context = context;
+        service = RetrofitFactory.getRetrofit(AppTools.getBaseUrl()).create(RetrofitService.class);
+    }
+
+    @Override
+    protected Observable buildUseCaseObservable() {
+        return service.QueryAppEvent(params).flatMap(new Func1<ResponseBean<List<AppEventBean>>, Observable<List<AppEventBean>>>() {
+            @Override
+            public Observable<List<AppEventBean>> call(ResponseBean<List<AppEventBean>> responseBean) {
+                if (!ResponseBean.CODE_SUCCESS.
+                        equals(responseBean.getCode())) {
+                    return Observable.error(new BusinessException(responseBean.getMsg()));
+                }
+                return Observable.just(responseBean.getData());
+            }
+        });
+    }
+}

+ 53 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/net/CameraAllListRequest.java

@@ -0,0 +1,53 @@
+package com.sjkj.appthreefloor_tsgz.net;
+
+import android.content.Context;
+
+import com.sjkj.base_lib.camera.dh.bean.CameraBean;
+import com.sjkj.base_lib.entity.Params;
+import com.sjkj.base_lib.entity.ResponseBean;
+import com.sjkj.base_lib.net.RetrofitFactory;
+import com.sjkj.base_lib.net.data.exception.BusinessException;
+import com.sjkj.base_lib.net.domain.interactor.UseCase;
+import com.sjkj.base_lib.utils.AppTools;
+
+import java.util.List;
+
+import rx.Observable;
+import rx.functions.Func1;
+
+/**
+ *
+ */
+public class CameraAllListRequest extends UseCase {
+    private Context context;
+    private RetrofitService service;
+
+    private Params params;
+
+    public Params getParams() {
+        return params;
+    }
+
+    public void setParams(Params params) {
+        this.params = params;
+    }
+
+    public CameraAllListRequest(Context context) {
+        this.context = context;
+        service = RetrofitFactory.getRetrofit(AppTools.getBaseUrl()).create(RetrofitService.class);
+    }
+
+    @Override
+    protected Observable buildUseCaseObservable() {
+        return service.cameraAllList(params).flatMap(new Func1<ResponseBean<List<CameraBean>>, Observable<List<CameraBean>>>() {
+            @Override
+            public Observable<List<CameraBean>> call(ResponseBean<List<CameraBean>> responseBean) {
+                if (!ResponseBean.CODE_SUCCESS.
+                        equals(responseBean.getCode())) {
+                    return Observable.error(new BusinessException(responseBean.getMsg()));
+                }
+                return Observable.just(responseBean.getData());
+            }
+        });
+    }
+}

+ 51 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/net/DepartmentRequest.java

@@ -0,0 +1,51 @@
+package com.sjkj.appthreefloor_tsgz.net;
+
+import android.content.Context;
+
+import com.sjkj.appthreefloor_tsgz.bean.DailyBean;
+import com.sjkj.base_lib.entity.Params;
+import com.sjkj.base_lib.entity.ResponseBean;
+import com.sjkj.base_lib.net.RetrofitFactory;
+import com.sjkj.base_lib.net.data.exception.BusinessException;
+import com.sjkj.base_lib.net.domain.interactor.UseCase;
+import com.sjkj.base_lib.utils.AppTools;
+
+import rx.Observable;
+import rx.functions.Func1;
+
+/**
+ * 获取部门
+ */
+public class DepartmentRequest extends UseCase {
+    private Context context;
+    private RetrofitService service;
+
+    private Params params;
+
+    public Params getParams() {
+        return params;
+    }
+
+    public void setParams(Params params) {
+        this.params = params;
+    }
+
+    public DepartmentRequest(Context context) {
+        this.context = context;
+        service = RetrofitFactory.getRetrofit(AppTools.getBaseUrl()).create(RetrofitService.class);
+    }
+
+    @Override
+    protected Observable buildUseCaseObservable() {
+        return service.GetDepartment(params).flatMap(new Func1<ResponseBean<DailyBean>, Observable<DailyBean>>() {
+            @Override
+            public Observable<DailyBean> call(ResponseBean<DailyBean> responseBean) {
+                if (!ResponseBean.CODE_SUCCESS.
+                        equals(responseBean.getCode())) {
+                    return Observable.error(new BusinessException(responseBean.getMsg()));
+                }
+                return Observable.just(responseBean.getData());
+            }
+        });
+    }
+}

+ 50 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/net/EventNewRequest.java

@@ -0,0 +1,50 @@
+package com.sjkj.appthreefloor_tsgz.net;
+
+import android.content.Context;
+
+import com.sjkj.base_lib.entity.Params;
+import com.sjkj.base_lib.entity.ResponseBean;
+import com.sjkj.base_lib.net.RetrofitFactory;
+import com.sjkj.base_lib.net.data.exception.BusinessException;
+import com.sjkj.base_lib.net.domain.interactor.UseCase;
+import com.sjkj.base_lib.utils.AppTools;
+
+import rx.Observable;
+import rx.functions.Func1;
+
+/**
+ * 上报/新增事件
+ */
+public class EventNewRequest extends UseCase {
+    private Context context;
+    private RetrofitService service;
+
+    private Params params;
+
+    public Params getParams() {
+        return params;
+    }
+
+    public void setParams(Params params) {
+        this.params = params;
+    }
+
+    public EventNewRequest(Context context) {
+        this.context = context;
+        service = RetrofitFactory.getRetrofit(AppTools.getBaseUrl()).create(RetrofitService.class);
+    }
+
+    @Override
+    protected Observable buildUseCaseObservable() {
+        return service.eventNew(params).flatMap(new Func1<ResponseBean<Object>, Observable<Object>>() {
+            @Override
+            public Observable<Object> call(ResponseBean<Object> responseBean) {
+                if (!ResponseBean.CODE_SUCCESS.
+                        equals(responseBean.getCode())) {
+                    return Observable.error(new BusinessException(responseBean.getMsg()));
+                }
+                return Observable.just(responseBean.getData());
+            }
+        });
+    }
+}

+ 54 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/net/NewDataCenterRequest.java

@@ -0,0 +1,54 @@
+package com.sjkj.appthreefloor_tsgz.net;
+
+import android.content.Context;
+
+import com.sjkj.appthreefloor_tsgz.bean.ResourceVisualizationBean;
+import com.sjkj.base_lib.entity.Params;
+import com.sjkj.base_lib.entity.ResponseBean;
+import com.sjkj.base_lib.net.RetrofitFactory;
+import com.sjkj.base_lib.net.data.exception.BusinessException;
+import com.sjkj.base_lib.net.domain.interactor.UseCase;
+import com.sjkj.base_lib.utils.AppTools;
+
+import java.util.List;
+
+import rx.Observable;
+import rx.functions.Func1;
+
+/**
+ * 获取数据中心列表
+ * 2版统一用一个接口
+ */
+public class NewDataCenterRequest extends UseCase {
+    private Context context;
+    private RetrofitService service;
+
+    private Params params;
+
+    public Params getParams() {
+        return params;
+    }
+
+    public void setParams(Params params) {
+        this.params = params;
+    }
+
+    public NewDataCenterRequest(Context context) {
+        this.context = context;
+        service = RetrofitFactory.getRetrofit(AppTools.getBaseUrl()).create(RetrofitService.class);
+    }
+
+    @Override
+    protected Observable buildUseCaseObservable() {
+        return service.GetNEWDATA(params).flatMap(new Func1<ResponseBean<List<ResourceVisualizationBean>>, Observable<List<ResourceVisualizationBean>>>() {
+            @Override
+            public Observable<List<ResourceVisualizationBean>> call(ResponseBean<List<ResourceVisualizationBean>> responseBean) {
+                if (!ResponseBean.CODE_SUCCESS.
+                        equals(responseBean.getCode())) {
+                    return Observable.error(new BusinessException(responseBean.getMsg()));
+                }
+                return Observable.just(responseBean.getData());
+            }
+        });
+    }
+}

+ 38 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/net/RetrofitService.java

@@ -1,17 +1,27 @@
 package com.sjkj.appthreefloor_tsgz.net;
 
+import com.sjkj.appthreefloor_tsgz.bean.AppEventBean;
+import com.sjkj.appthreefloor_tsgz.bean.AppEventThreeBean;
 import com.sjkj.appthreefloor_tsgz.bean.BannerDataBean;
+import com.sjkj.appthreefloor_tsgz.bean.DailyBean;
 import com.sjkj.appthreefloor_tsgz.bean.EventCenterListBean;
+import com.sjkj.appthreefloor_tsgz.bean.FileBean;
 import com.sjkj.appthreefloor_tsgz.bean.LogInRsaBean;
 import com.sjkj.appthreefloor_tsgz.bean.LoginBean;
+import com.sjkj.appthreefloor_tsgz.bean.ResourceVisualizationBean;
+import com.sjkj.base_lib.camera.dh.bean.CameraBean;
 import com.sjkj.base_lib.entity.Params;
 import com.sjkj.base_lib.entity.ResponseBean;
 
 import java.util.List;
+import java.util.Map;
 
+import okhttp3.MultipartBody;
 import retrofit2.http.Body;
 import retrofit2.http.GET;
+import retrofit2.http.Multipart;
 import retrofit2.http.POST;
+import retrofit2.http.Part;
 import retrofit2.http.QueryMap;
 import rx.Observable;
 
@@ -30,4 +40,32 @@ public interface RetrofitService {
     @GET("AppEventController/eventFindAll")
     Observable<ResponseBean<List<EventCenterListBean>>> eventCenterList(@QueryMap Params params);
 
+    //监控中心摄像头列表
+    @GET("AppCameraController/listCamera")
+    Observable<ResponseBean<List<CameraBean>>> cameraAllList(@QueryMap Params params);
+
+    //获取数据中心资源落点列表(新)
+    @POST("AppBigDataCountController/getResourcePoint")
+    Observable<ResponseBean<List<ResourceVisualizationBean>>> GetNEWDATA(@Body Map<String, Object> params);
+
+    //获取部门
+    @GET("AppLoginController/deptselector")
+    Observable<ResponseBean<DailyBean>> GetDepartment(@QueryMap Map<String, Object> params);
+
+    //上报/新增事件
+    @POST("AppEventController/addEventFen")
+    Observable<ResponseBean<Object>> eventNew(@Body Params params);
+
+    //事件子类列表
+    @GET("AppEventController/listSJfl")
+    Observable<ResponseBean<List<AppEventBean>>> QueryAppEvent(@QueryMap Map<String, Object> params);
+
+    //上报事件-事件分类
+    @GET("AppEventController/listHgjXl")
+    Observable<ResponseBean<List<AppEventThreeBean>>> QueryAppEventThree(@QueryMap Map<String, Object> params);
+
+    //上传文件
+    @Multipart
+    @POST("AppFileController/appUpload")
+    Observable<ResponseBean<FileBean>> upload(@Part MultipartBody.Part file);
 }

+ 70 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/net/UploadFileRequest.java

@@ -0,0 +1,70 @@
+package com.sjkj.appthreefloor_tsgz.net;
+
+import android.content.Context;
+import android.util.Log;
+
+import com.sjkj.appthreefloor_tsgz.bean.FileBean;
+import com.sjkj.base_lib.entity.ResponseBean;
+import com.sjkj.base_lib.net.RetrofitFactory;
+import com.sjkj.base_lib.net.data.exception.BusinessException;
+import com.sjkj.base_lib.net.domain.interactor.UseCase;
+import com.sjkj.base_lib.net.utils.FileSizeUtil;
+import com.sjkj.base_lib.net.utils.LogInterceptor;
+import com.sjkj.base_lib.utils.AppTools;
+import com.sjkj.base_lib.utils.ToastUtils;
+
+import java.io.File;
+
+import okhttp3.MediaType;
+import okhttp3.MultipartBody;
+import okhttp3.RequestBody;
+import rx.Observable;
+import rx.functions.Func1;
+import rx.schedulers.Schedulers;
+
+/**
+ * 上传文件
+ */
+public class UploadFileRequest extends UseCase {
+    private Context context;
+    private RetrofitService service;
+
+    private File file;
+    private MultipartBody.Part part;
+
+    public void setFile(File file) {
+        this.file = file;
+        if (this.file.exists()) {
+            double filesSize = FileSizeUtil.getFileOrFilesSize(file.getPath(), 3);
+            Log.e("UploadFileRequest", filesSize+"MB");
+            RequestBody requestBody = RequestBody.create(file, MediaType.parse("file/*"));
+            part = MultipartBody.Part.createFormData("file", file.getName(), requestBody);
+        } else {
+            ToastUtils.show("文件不存在");
+        }
+    }
+
+    public UploadFileRequest(Context context) {
+        this.context = context;
+        service = RetrofitFactory.getRetrofit(AppTools.getBaseUrl(), true).create(RetrofitService.class);
+    }
+
+    @Override
+    protected Observable buildUseCaseObservable() {
+        LogInterceptor.isShowRequestBody = false;
+        return service.upload(part)
+                .subscribeOn(Schedulers.io())
+                .flatMap(new Func1<ResponseBean<FileBean>, Observable<FileBean>>() {
+                    @Override
+                    public Observable<FileBean> call(ResponseBean<FileBean> responseBean) {
+                        LogInterceptor.isShowRequestBody = true;
+                        if (!ResponseBean.CODE_SUCCESS.
+                                equals(responseBean.getCode())) {
+                            return Observable.error(new BusinessException(responseBean.getMsg()));
+                        }
+                        return Observable.just(responseBean.getData());
+                    }
+                });
+    }
+
+}

+ 54 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/net/WaterCraneRequest.java

@@ -0,0 +1,54 @@
+package com.sjkj.appthreefloor_tsgz.net;
+
+import android.content.Context;
+
+import com.sjkj.appthreefloor_tsgz.bean.ResourceVisualizationBean;
+import com.sjkj.base_lib.entity.Params;
+import com.sjkj.base_lib.entity.ResponseBean;
+import com.sjkj.base_lib.net.RetrofitFactory;
+import com.sjkj.base_lib.net.data.exception.BusinessException;
+import com.sjkj.base_lib.net.domain.interactor.UseCase;
+import com.sjkj.base_lib.utils.AppTools;
+
+import java.util.List;
+
+import rx.Observable;
+import rx.functions.Func1;
+
+/**
+ * 获取数据中心列表
+ * 2版统一用一个接口
+ */
+public class WaterCraneRequest extends UseCase {
+    private Context context;
+    private RetrofitService service;
+
+    private Params params;
+
+    public Params getParams() {
+        return params;
+    }
+
+    public void setParams(Params params) {
+        this.params = params;
+    }
+
+    public WaterCraneRequest(Context context) {
+        this.context = context;
+        service = RetrofitFactory.getRetrofit(AppTools.getBaseUrl()).create(RetrofitService.class);
+    }
+
+    @Override
+    protected Observable buildUseCaseObservable() {
+        return service.GetNEWDATA(params).flatMap(new Func1<ResponseBean<List<ResourceVisualizationBean>>, Observable<List<ResourceVisualizationBean>>>() {
+            @Override
+            public Observable<List<ResourceVisualizationBean>> call(ResponseBean<List<ResourceVisualizationBean>> responseBean) {
+                if (!ResponseBean.CODE_SUCCESS.
+                        equals(responseBean.getCode())) {
+                    return Observable.error(new BusinessException(responseBean.getMsg()));
+                }
+                return Observable.just(responseBean.getData());
+            }
+        });
+    }
+}

+ 123 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/utils/DoubleUtils.java

@@ -0,0 +1,123 @@
+package com.sjkj.appthreefloor_tsgz.utils;
+
+import java.math.BigDecimal;
+import java.text.DecimalFormat;
+
+public class DoubleUtils {
+
+
+    /**
+     * 由于Java的简单类型不能够精确的对浮点数进行运算,这个工具类提供精
+     * 确的浮点数运算,包括加减乘除和四舍五入。
+     */
+//默认除法运算精度
+    private static final int DEF_DIV_SCALE = 10;
+    /**
+     * 提供精确的加法运算。
+     *
+     * @param v1 被加数
+     * @param v2 加数
+     * @return 两个参数的和
+     */
+    public static double add(double v1, double v2) {
+        BigDecimal b1 = new BigDecimal(Double.toString(v1));
+        BigDecimal b2 = new BigDecimal(Double.toString(v2));
+        return b1.add(b2).doubleValue();
+    }
+
+    /**
+     * 提供精确的减法运算。
+     *
+     * @param v1 被减数
+     * @param v2 减数
+     * @return 两个参数的差
+     */
+    public static double sub(double v1, double v2) {
+        BigDecimal b1 = new BigDecimal(Double.toString(v1));
+        BigDecimal b2 = new BigDecimal(Double.toString(v2));
+        return b1.subtract(b2).doubleValue();
+    }
+
+    /**
+     * 提供精确的乘法运算。
+     *
+     * @param v1 被乘数
+     * @param v2 乘数
+     * @return 两个参数的积
+     */
+    public static double mul(double v1, double v2) {
+        BigDecimal b1 = new BigDecimal(Double.toString(v1));
+        BigDecimal b2 = new BigDecimal(Double.toString(v2));
+        return b1.multiply(b2).doubleValue();
+    }
+
+    /**
+     * 提供(相对)精确的除法运算,当发生除不尽的情况时,精确到
+     * 小数点以后10位,以后的数字四舍五入。
+     *
+     * @param v1 被除数
+     * @param v2 除数
+     * @return 两个参数的商
+     */
+    public static double div(double v1, double v2) {
+        return div(v1, v2, DEF_DIV_SCALE);
+    }
+
+    /**
+     * 提供(相对)精确的除法运算。当发生除不尽的情况时,由scale参数指
+     * 定精度,以后的数字四舍五入。
+     *
+     * @param v1    被除数
+     * @param v2    除数
+     * @param scale 表示表示需要精确到小数点以后几位。
+     * @return 两个参数的商
+     */
+    public static double div(double v1, double v2, int scale) {
+        if (scale < 0) {
+            throw new IllegalArgumentException(
+                    "The scale must be a positive integer or zero");
+        }
+        BigDecimal b1 = new BigDecimal(Double.toString(v1));
+        BigDecimal b2 = new BigDecimal(Double.toString(v2));
+        return b1.divide(b2, scale, BigDecimal.ROUND_HALF_UP).doubleValue();
+    }
+
+    /**
+     * 提供精确的小数位四舍五入处理。
+     *
+     * @param v     需要四舍五入的数字
+     * @param scale 小数点后保留几位
+     * @return 四舍五入后的结果
+     */
+    public static double round(double v, int scale) {
+        if (scale < 0) {
+            throw new IllegalArgumentException(
+                    "The scale must be a positive integer or zero");
+        }
+        BigDecimal b = new BigDecimal(Double.toString(v));
+        BigDecimal one = new BigDecimal("1");
+        return b.divide(one, scale, BigDecimal.ROUND_HALF_UP).doubleValue();
+    }
+
+    /**
+     * 保留小数点后2位
+     *
+     * @param d
+     * @return
+     */
+    public static String DF(double d) {
+        DecimalFormat df = new DecimalFormat("0.00");
+        return df.format(d);
+    }
+
+    /**
+     * 千位分隔符
+     *
+     * @param d
+     * @return
+     */
+    public static String DFF(String d) {
+        DecimalFormat df = new DecimalFormat("#,###,###,###.00");
+        return df.format(Double.parseDouble(d));
+    }
+}

+ 281 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/utils/EventDepartmentTools.java

@@ -0,0 +1,281 @@
+package com.sjkj.appthreefloor_tsgz.utils;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.WindowManager;
+import android.widget.ImageView;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import com.sjkj.appthreefloor_tsgz.R;
+import com.sjkj.appthreefloor_tsgz.address.AddressSelector;
+import com.sjkj.appthreefloor_tsgz.address.CityBean;
+import com.sjkj.appthreefloor_tsgz.address.CityInterface;
+import com.sjkj.appthreefloor_tsgz.address.OnFinishClickListener;
+import com.sjkj.appthreefloor_tsgz.address.OnItemClickListener;
+import com.sjkj.appthreefloor_tsgz.app.App;
+import com.sjkj.appthreefloor_tsgz.bean.AppEventBean;
+import com.sjkj.appthreefloor_tsgz.bean.AppEventThreeBean;
+import com.sjkj.appthreefloor_tsgz.net.AppEventThreeRequest;
+import com.sjkj.appthreefloor_tsgz.net.AppEventTypeRequest;
+import com.sjkj.base_lib.app.AppManager;
+import com.sjkj.base_lib.entity.Params;
+import com.sjkj.base_lib.net.domain.interactor.ProcessErrorSubscriber;
+import com.sjkj.base_lib.utils.CommonUtils;
+import com.sjkj.base_lib.utils.ToastUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class EventDepartmentTools {
+    private static ArrayList<CityBean> cities1 = new ArrayList<>();
+    private static ArrayList<CityBean> cities2 = new ArrayList<>();
+    private static ArrayList<CityBean> cities3 = new ArrayList<>();
+    private static AppEventTypeRequest appEventTypeRequest = new AppEventTypeRequest(App.getInstance());
+    private static AppEventThreeRequest appEventThreeRequest = new AppEventThreeRequest(App.getInstance());
+    private static String strONE = "";
+    private static String strTWO = "";
+    private static String strThree = "";
+
+    private static String oneID = "";
+    private static String threeID = "";
+    private static String twoID = "";
+    public static OnFinishClickListener onFinishClickListener;
+
+    /**
+     * 设置列表的点击事件回调接口
+     */
+    public static void setOnFinishClickListener(OnFinishClickListener onFinishClickListener) {
+        EventDepartmentTools.onFinishClickListener = onFinishClickListener;
+    }
+
+    public static void GetEventFL(Context context) {
+        if (SoftKeyboardUtils.getKeyBoardIsShow(context)) {
+            SoftKeyboardUtils.hideSoftKeyboard(AppManager.getAppManager().currentActivity());
+        }
+        cities1.clear();
+        Params params = new Params();
+        params.put("parentId", "0");
+        appEventTypeRequest.setParams(params);
+        appEventTypeRequest.execute(new ProcessErrorSubscriber<List<AppEventBean>>() {
+            @Override
+            public void onError(Throwable e) {
+                super.onError(e);
+            }
+
+            @Override
+            public void onNext(List<AppEventBean> list) {
+                super.onNext(list);
+
+                CityBean bean = null;
+                for (int i = 0; i < list.size(); i++) {
+                    bean = new CityBean();
+                    bean.setId(list.get(i).getId());
+                    bean.setName(list.get(i).getEventTypeName());
+                    cities1.add(bean);
+
+                }
+                showPop(context, cities1);
+            }
+        });
+
+
+    }
+
+    private static void showPop(Context context, ArrayList<CityBean> cities1) {
+
+        //加载弹出框的布局
+        View contentView = LayoutInflater.from(context).inflate(R.layout.pop_address, null);
+        WindowManager manager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
+
+        ImageView imageView = contentView.findViewById(R.id.iv_back);
+        TextView tv_title = contentView.findViewById(R.id.tv_title);
+
+
+        PopWindowUtil.getInstance().makePopupWindow(context, contentView).showLocationWithAnimation(context, contentView);
+        AddressSelector addressSelector = (AddressSelector) contentView.findViewById(R.id.address);
+        if (AppSystemUtils.isGhb()) {
+            addressSelector.setListTextSize(18);
+            addressSelector.setTabTextSize(20);
+            tv_title.setTextSize(20);
+            tv_title.getPaint().setFakeBoldText(true);
+            RelativeLayout.LayoutParams params= (RelativeLayout.LayoutParams) imageView.getLayoutParams();
+            params.width= CommonUtils.dp2px(40);
+            params.height= CommonUtils.dp2px(40);
+            params.topMargin=CommonUtils.dp2px(10);
+            imageView.setLayoutParams(params);
+
+        }
+        addressSelector.setTabAmount(2);
+        addressSelector.setCities(cities1);
+        // addressSelector.setGrayLineColor(context.getResources().getColor(R.color.color_main));
+        addressSelector.setListTextSelectedColor(context.getResources().getColor(R.color.color_blue));
+        if (cities1.size() > 0) {
+            addressSelector.setBooleData(true);
+        } else {
+            addressSelector.setBooleData(false);
+        }
+
+        tv_title.setText("请选择事件类型");
+
+
+        imageView.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+
+                PopWindowUtil.mPopupWindow.dismiss();
+            }
+        });
+        addressSelector.setOnTabSelectedListener(new AddressSelector.OnTabSelectedListener() {
+            @Override
+            public void onTabSelected(AddressSelector addressSelector, AddressSelector.Tab tab) {
+                switch (tab.getIndex()) {
+
+                    case 0:
+                        if (cities1.size() > 0) {
+                            addressSelector.setBooleData(true);
+                        }
+                        addressSelector.setCities(cities1);
+                        break;
+                    case 1:
+                        if (cities2.size() > 0) {
+                            addressSelector.setBooleData(true);
+                        }
+                        addressSelector.setCities(cities2);
+
+                        break;
+//                    case 2:
+//                        if (cities3.size() > 0) {
+//                            addressSelector.setBooleData(true);
+//                        }
+//                        addressSelector.setCities(cities3);
+//
+//                        break;
+
+
+                }
+            }
+
+            @Override
+            public void onTabReselected(AddressSelector addressSelector, AddressSelector.Tab tab) {
+
+            }
+        });
+
+
+        addressSelector.setOnItemClickListener(new OnItemClickListener() {
+            @Override
+            public void itemClick(AddressSelector addressSelector, CityInterface city, int tabPosition, int position) {
+
+
+                switch (tabPosition) {
+
+                    case 0:
+                        //0代表小区已经选择完毕,调用接口  显示楼栋数据
+                        cities2.clear();
+                        GetTwo(addressSelector, city, position);
+                        strONE = cities1.get(position).getCityName();
+                        oneID = cities1.get(position).getCityId();
+                        break;
+                    case 1:
+
+                        cities3.clear();
+//                        GetThree(addressSelector, city, position);
+                        if (cities2.size() > 0) {
+                            strTWO = cities2.get(position).getCityName();
+                            twoID = cities2.get(position).getCityId();
+                        }
+                        if (onFinishClickListener != null) {
+                            onFinishClickListener.FinishClick(strONE, oneID, strTWO, twoID, "", "", "", "");
+                            PopWindowUtil.mPopupWindow.dismiss();
+                        }
+                        break;
+//                    case 2:
+//                        if (cities3.size()>0) {
+//                            strThree = cities3.get(position).getCityName();
+//                            threeID = cities3.get(position).getCityId();
+//                        }
+//
+//                           if (onFinishClickListener != null) {
+//                                onFinishClickListener.FinishClick(strONE, oneID, strTWO, twoID, strThree, threeID, "", "");
+//                              PopWindowUtil.mPopupWindow.dismiss();
+//                            }
+//                        break;
+
+                }
+            }
+        });
+    }
+
+
+    private static void GetThree(AddressSelector addressSelector, CityInterface city, int position) {
+        Params params = new Params();
+        params.put("eventTypeValue", city.getCityId());
+        appEventThreeRequest.setParams(params);
+        appEventThreeRequest.execute(new ProcessErrorSubscriber<List<AppEventThreeBean>>() {
+            @Override
+            public void onError(Throwable e) {
+                super.onError(e);
+            }
+
+            @Override
+            public void onNext(List<AppEventThreeBean> list) {
+                super.onNext(list);
+                if (list.size() > 0) {
+                    CityBean bean = null;
+                    for (int i = 0; i < list.size(); i++) {
+                        bean = new CityBean();
+                        bean.setId(list.get(i).getId());
+                        bean.setName(list.get(i).getDeptName());
+                        cities3.add(bean);
+                        addressSelector.setCities(cities3);
+                    }
+                    addressSelector.setBooleData(true);
+                } else {
+                    ToastUtils.show("暂无分类信息");
+                    addressSelector.setCities(cities3);
+                    addressSelector.setBooleData(false);
+                }
+            }
+        });
+
+    }
+
+    private static void GetTwo(AddressSelector addressSelector, CityInterface city, int position) {
+
+        Params params = new Params();
+        params.put("parentId", city.getCityId());
+        appEventTypeRequest.setParams(params);
+        appEventTypeRequest.execute(new ProcessErrorSubscriber<List<AppEventBean>>() {
+            @Override
+            public void onError(Throwable e) {
+                super.onError(e);
+            }
+
+            @Override
+            public void onNext(List<AppEventBean> list) {
+                super.onNext(list);
+                if (list.size() > 0) {
+                    CityBean bean = null;
+                    for (int i = 0; i < list.size(); i++) {
+                        bean = new CityBean();
+                        bean.setId(list.get(i).getId());
+                        bean.setName(list.get(i).getEventTypeName());
+                        cities2.add(bean);
+                        addressSelector.setCities(cities2);
+                    }
+                    addressSelector.setBooleData(true);
+                } else {
+                    ToastUtils.show("暂无分类信息");
+                    addressSelector.setCities(cities2);
+                    addressSelector.setBooleData(false);
+                }
+            }
+        });
+
+
+    }
+
+
+}

+ 8 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/utils/ItemSlideCallBack.java

@@ -0,0 +1,8 @@
+package com.sjkj.appthreefloor_tsgz.utils;
+
+
+public interface ItemSlideCallBack {
+
+    void onMove(int fromPosition, int toPosition);
+
+}

+ 117 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/utils/PopWindowUtil.java

@@ -0,0 +1,117 @@
+package com.sjkj.appthreefloor_tsgz.utils;
+
+import android.app.Activity;
+import android.content.Context;
+import android.graphics.drawable.ColorDrawable;
+import android.util.DisplayMetrics;
+import android.view.Gravity;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.WindowManager;
+import android.widget.PopupWindow;
+
+import com.sjkj.appthreefloor_tsgz.R;
+
+public class PopWindowUtil {
+
+    private static PopWindowUtil instance;
+
+    public static   PopupWindow mPopupWindow;
+
+    // 私有化构造方法,变成单例模式
+    private PopWindowUtil() {
+
+    }
+
+    // 对外提供一个该类的实例,考虑多线程问题,进行同步操作
+    public static PopWindowUtil getInstance() {
+        if (instance == null) {
+            synchronized (PopWindowUtil.class) {
+                if (instance == null) {
+                    instance = new PopWindowUtil();
+                }
+            }
+        }
+        return instance;
+    }
+
+    /**
+     * @param cx
+     *            activity
+     *            传入需要显示在什么控件下
+     * @param view1
+     *            传入内容的view
+     * @return
+     */
+    public PopWindowUtil makePopupWindow(Context cx, View view1) {
+        DisplayMetrics dm = new DisplayMetrics();
+        WindowManager manager = (WindowManager) cx.getSystemService(Context.WINDOW_SERVICE);
+
+        mPopupWindow = new PopupWindow(cx);
+
+        mPopupWindow.setBackgroundDrawable(new ColorDrawable());
+       /* view1.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
+                ViewGroup.LayoutParams.WRAP_CONTENT));*/
+        // 设置PopupWindow的大小(宽度和高度)
+        mPopupWindow.setHeight(ViewGroup.LayoutParams.MATCH_PARENT);
+        mPopupWindow.setWidth(ViewGroup.LayoutParams.MATCH_PARENT);
+        int height = manager.getDefaultDisplay().getHeight();
+        mPopupWindow.setHeight(height / 2);
+        // 设置PopupWindow的内容view
+        mPopupWindow.setContentView(view1);
+        mPopupWindow.setFocusable(true); // 设置PopupWindow可获得焦点
+        mPopupWindow.setTouchable(true); // 设置PopupWindow可触摸
+        mPopupWindow.setOutsideTouchable(true); // 设置非PopupWindow区域可触摸
+
+        return instance;
+    }
+
+    /**
+     *
+     * @param cx 此处必须为Activity的实例
+     * @return
+     */
+    public PopupWindow showLocationWithAnimation(final Context cx,View V) {
+        // 弹出动画
+        mPopupWindow.setAnimationStyle(R.style.mypopwindow_anim_style);
+
+        // 弹出PopupWindow时让后面的界面变暗
+        WindowManager.LayoutParams parms = ((Activity) cx).getWindow().getAttributes();
+        parms.alpha =0.5f;
+        ((Activity) cx).getWindow().setAttributes(parms);
+
+
+
+        mPopupWindow.showAtLocation(V, Gravity.BOTTOM, 0, 0);
+        mPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
+            @Override
+            public void onDismiss() {
+                // PopupWindow消失后让后面的界面变亮
+                WindowManager.LayoutParams parms = ((Activity) cx).getWindow().getAttributes();
+                parms.alpha =1.0f;
+                ((Activity) cx).getWindow().setAttributes(parms);
+
+                if (mListener != null) {
+                    mListener.dissmiss();
+                }
+            }
+        });
+
+        return mPopupWindow;
+    }
+
+    public interface OnDissmissListener{
+
+        void dissmiss();
+
+    }
+
+    private OnDissmissListener mListener;
+
+    public void setOnDissmissListener(OnDissmissListener listener) {
+        mListener = listener;
+    }
+
+
+}
+

+ 70 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/utils/SlideItemTouchHelper.java

@@ -0,0 +1,70 @@
+package com.sjkj.appthreefloor_tsgz.utils;
+
+
+import android.content.Context;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.recyclerview.widget.ItemTouchHelper;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.sjkj.appthreefloor_tsgz.R;
+
+
+public class SlideItemTouchHelper extends ItemTouchHelper.Callback {
+
+    private ItemSlideCallBack itemSlideCallBack;
+    Context context;
+
+    public SlideItemTouchHelper(Context context, ItemSlideCallBack mItemSlideCallBack) {
+        itemSlideCallBack = mItemSlideCallBack;
+        this.context = context;
+    }
+
+    /**
+     * 设置滑动类型标记
+     */
+
+    @Override
+    public int getMovementFlags(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder) {
+        return makeMovementFlags(ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT, 0);
+    }
+
+    /**
+     * 拖拽交换Item的回调
+     */
+
+    @Override
+    public boolean onMove(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, @NonNull RecyclerView.ViewHolder viewHolder1) {
+        if (null != itemSlideCallBack) {
+            itemSlideCallBack.onMove(viewHolder.getAdapterPosition(), viewHolder1.getAdapterPosition());
+        }
+        return true;
+    }
+
+    /**
+     * 滑动Item
+     */
+
+    @Override
+    public void onSwiped(@NonNull RecyclerView.ViewHolder viewHolder, int i) {
+
+    }
+
+    @Override
+    public void onSelectedChanged(@Nullable RecyclerView.ViewHolder viewHolder, int actionState) {
+        super.onSelectedChanged(viewHolder, actionState);
+        if (null != viewHolder) {
+            viewHolder.itemView.setBackground(context.getResources().getDrawable(R.drawable.shape_border));
+        }
+
+    }
+
+    @Override
+    public void clearView(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder) {
+        super.clearView(recyclerView, viewHolder);
+        if (null != viewHolder) {
+            viewHolder.itemView.setBackground(null);
+        }
+    }
+}

+ 70 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/utils/SoftKeyboardUtils.java

@@ -0,0 +1,70 @@
+package com.sjkj.appthreefloor_tsgz.utils;
+
+import android.app.Activity;
+import android.content.Context;
+import android.util.Log;
+import android.view.View;
+import android.view.inputmethod.InputMethodManager;
+
+import java.lang.reflect.Method;
+
+/**
+ * Created by ChenboCui on 2018/6/1.
+ */
+public class SoftKeyboardUtils {
+
+    /**
+     * 隐藏或显示软键盘
+     * 如果现在是显示调用后则隐藏 反之则显示
+     *
+     * @param activity
+     */
+    public static void showORhideSoftKeyboard(Activity activity) {
+        InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
+        imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
+    }
+
+    /**
+     * 强制显示软键盘
+     *
+     * @param activity
+     */
+    public static void showSoftKeyboard(Activity activity) {
+        InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
+        imm.showSoftInput(activity.getWindow().getDecorView(), InputMethodManager.SHOW_FORCED);
+    }
+
+    /**
+     * 强制隐藏软键盘
+     *
+     * @param activity
+     */
+    public static void hideSoftKeyboard(Activity activity) {
+
+        View view = activity.getCurrentFocus();
+
+        if (view != null) {
+
+            InputMethodManager inputMethodManager = (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE);
+
+            inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
+
+        }
+
+    }
+
+    public static boolean getKeyBoardIsShow(Context context){
+        try {
+            InputMethodManager im = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
+            Method method = im.getClass().getDeclaredMethod("getInputMethodWindowVisibleHeight");
+            method.setAccessible(true);
+            int height = Integer.parseInt(method.invoke(im).toString());
+            if(height > 0){
+                return true;
+            }
+        }catch (Throwable e){
+            Log.d("zhr",Log.getStackTraceString(e));
+        }
+        return false;
+    }
+}

二進制
app/src/main/res/drawable-xxhdpi/company_location_img.png


二進制
app/src/main/res/drawable-xxhdpi/company_location_img_1.png


二進制
app/src/main/res/drawable-xxhdpi/ic_san.png


二進制
app/src/main/res/drawable-xxhdpi/ic_tongyong.png


二進制
app/src/main/res/drawable-xxhdpi/icon_address_arrow_selected.png


二進制
app/src/main/res/drawable-xxhdpi/icon_agriculture_cooperatives.png


二進制
app/src/main/res/drawable-xxhdpi/icon_camera.png


二進制
app/src/main/res/drawable-xxhdpi/icon_close.png


二進制
app/src/main/res/drawable-xxhdpi/icon_location_small.png


二進制
app/src/main/res/drawable-xxhdpi/user_location_img.png


+ 7 - 0
app/src/main/res/drawable/bg_blue_text.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <corners android:radius="19dp"/>
+    <solid android:color="@color/white"/>
+    <stroke android:color="@color/main_blue_color" android:width="1dp"/>
+</shape>

+ 7 - 0
app/src/main/res/drawable/bg_green_text.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <corners android:radius="19dp"/>
+    <solid android:color="@color/white"/>
+    <stroke android:color="@color/green_color" android:width="1dp"/>
+</shape>

+ 9 - 0
app/src/main/res/drawable/ic_back.xml

@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="26dp"
+    android:height="26dp"
+    android:viewportWidth="1024"
+    android:viewportHeight="1024">
+  <path
+      android:pathData="M608,736c-6.4,0 -19.2,0 -25.6,-6.4l-192,-192C384,524.8 384,499.2 390.4,486.4l192,-192c12.8,-12.8 32,-12.8 44.8,0s12.8,32 0,44.8L460.8,512l166.4,166.4c12.8,12.8 12.8,32 0,44.8C627.2,736 614.4,736 608,736z"
+      android:fillColor="#ffffff"/>
+</vector>

文件差異過大導致無法顯示
+ 5 - 0
app/src/main/res/drawable/ic_baseline_local_fire_department_24.xml


+ 6 - 0
app/src/main/res/drawable/shape_bg_content_input.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="@color/color_white" />
+    <corners android:radius="0dp" />
+    <stroke android:color="@color/main_blue_color" android:width="1dp"/>
+</shape>

+ 21 - 0
app/src/main/res/drawable/shape_border.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+    <item>
+        <shape>
+            <solid android:color="@color/color_transparent00" />
+            <corners
+                android:bottomLeftRadius="5dp"
+                android:bottomRightRadius="5dp"
+                android:topLeftRadius="5dp"
+                android:topRightRadius="5dp" />
+            <stroke
+                android:width="2dp"
+                android:color="@color/main_blue_color" />
+            <padding
+                android:bottom="5dp"
+                android:left="5dp"
+                android:right="5dp"
+                android:top="5dp" />
+        </shape>
+    </item>
+</layer-list>

+ 139 - 0
app/src/main/res/layout/activity_camera_list.xml

@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
+
+    <data>
+
+        <variable
+            name="viewModel"
+            type="com.sjkj.base_lib.camera.dh.vm.CameraViewModel" />
+    </data>
+
+    <LinearLayout
+        android:focusable="true"
+        android:focusableInTouchMode="true"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical">
+
+        <!--        <androidx.drawerlayout.widget.DrawerLayout-->
+        <!--            android:id="@+id/drawerLayout"-->
+        <!--            android:layout_width="match_parent"-->
+        <!--            android:layout_height="match_parent">-->
+        <LinearLayout
+            android:visibility="visible"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:gravity="center_vertical"
+            android:orientation="horizontal"
+            android:padding="12dp">
+
+            <EditText
+                android:id="@+id/input_et"
+                android:layout_width="match_parent"
+                android:layout_height="30dp"
+                android:layout_weight="1"
+                android:background="@drawable/shape_bg_gray_input"
+                android:drawableLeft="@drawable/icon_search"
+                android:drawablePadding="5dp"
+                android:ellipsize="end"
+                android:hint="@string/input_content"
+                android:lines="1"
+                android:paddingLeft="10dp"
+                android:paddingRight="10dp"
+                android:singleLine="true"
+                android:text="@={viewModel.keyword}"
+                android:textColor="@color/color_black_text"
+                android:textColorHint="@color/color_gray_light_text"
+                android:textSize="12dp" />
+
+            <TextView
+                android:id="@+id/search_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="10dp"
+                android:text="@string/search"
+                android:textColor="@color/main_blue_color"
+                android:textSize="14dp" />
+        </LinearLayout>
+
+        <com.scwang.smartrefresh.layout.SmartRefreshLayout
+            android:id="@+id/smartRefreshLayout"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent">
+
+            <androidx.recyclerview.widget.RecyclerView
+                android:id="@+id/mainRecyclerView"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:overScrollMode="never" />
+        </com.scwang.smartrefresh.layout.SmartRefreshLayout>
+
+        <!--            &lt;!&ndash; 右边菜单 &ndash;&gt;-->
+        <!--            <ScrollView android:overScrollMode="never"-->
+        <!--                android:id="@+id/rightLayout"-->
+        <!--                android:layout_width="match_parent"-->
+        <!--                android:layout_height="match_parent"-->
+        <!--                android:layout_gravity="end"-->
+        <!--                android:background="@color/color_white"-->
+        <!--                android:orientation="vertical">-->
+
+        <!--                <LinearLayout-->
+        <!--                    android:layout_width="match_parent"-->
+        <!--                    android:layout_height="match_parent"-->
+        <!--                    android:orientation="vertical">-->
+
+        <!--                    <EditText-->
+        <!--                        android:id="@+id/searchName"-->
+        <!--                        android:layout_width="match_parent"-->
+        <!--                        android:layout_height="40dp"-->
+        <!--                        android:layout_margin="20dp"-->
+        <!--                        android:background="@drawable/shape_edit_text_white" />-->
+
+        <!--                    <TextView-->
+        <!--                        android:layout_width="wrap_content"-->
+        <!--                        android:layout_height="wrap_content"-->
+        <!--                        android:layout_marginLeft="10dp"-->
+        <!--                        android:layout_marginTop="10dp"-->
+        <!--                        android:text="探头类别"-->
+        <!--                        android:textColor="@color/light_gray_10" />-->
+
+
+        <!--                    <androidx.recyclerview.widget.RecyclerView android:overScrollMode="never"-->
+        <!--                        android:id="@+id/typeRecyclerView"-->
+        <!--                        android:layout_width="match_parent"-->
+        <!--                        android:layout_height="match_parent"-->
+        <!--                        android:layout_marginLeft="10dp"-->
+        <!--                        android:layout_marginTop="10dp" />-->
+
+        <!--                    <TextView-->
+        <!--                        android:layout_width="wrap_content"-->
+        <!--                        android:layout_height="wrap_content"-->
+        <!--                        android:layout_marginLeft="10dp"-->
+        <!--                        android:layout_marginTop="10dp"-->
+        <!--                        android:text="地址区域"-->
+        <!--                        android:textColor="@color/light_gray_10" />-->
+
+        <!--                    <androidx.recyclerview.widget.RecyclerView android:overScrollMode="never"-->
+        <!--                        android:id="@+id/recyclerView"-->
+        <!--                        android:layout_width="match_parent"-->
+        <!--                        android:layout_height="match_parent"-->
+        <!--                        android:layout_marginLeft="10dp"-->
+        <!--                        android:layout_marginTop="10dp" />-->
+
+        <!--                    <Button-->
+        <!--                        android:id="@+id/searchBtn"-->
+        <!--                        android:layout_width="200dp"-->
+        <!--                        android:layout_height="45dp"-->
+        <!--                        android:layout_gravity="center"-->
+        <!--                        android:layout_marginTop="5dp"-->
+        <!--                        android:layout_marginBottom="5dp"-->
+        <!--                        android:background="@drawable/shape_emergency_solid_blue_5"-->
+        <!--                        android:text="搜索"-->
+        <!--                        android:textColor="@color/color_white" />-->
+
+        <!--                </LinearLayout>-->
+        <!--            </ScrollView>-->
+        <!--        </androidx.drawerlayout.widget.DrawerLayout>-->
+    </LinearLayout>
+</layout>

+ 43 - 0
app/src/main/res/layout/activity_my_video_player.xml

@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <data>
+
+        <variable
+            name="viewModel"
+            type="com.sjkj.appthreefloor_tsgz.activity.viewModel.VideoViewModel" />
+    </data>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@color/black"
+        android:orientation="vertical">
+
+
+        <RelativeLayout
+            android:id="@+id/video_frame"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:background="@color/black">
+
+            <VideoView
+                android:id="@+id/video_view"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_centerHorizontal="true" />
+
+            <ImageView
+                android:id="@+id/iv"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent" />
+
+            <ProgressBar
+                android:id="@+id/progress_view"
+                android:layout_width="25dp"
+                android:layout_height="25dp"
+                android:layout_centerInParent="true"
+                android:visibility="gone" />
+        </RelativeLayout>
+    </LinearLayout>
+</layout>

+ 511 - 0
app/src/main/res/layout/activity_new_event.xml

@@ -0,0 +1,511 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:bind="http://schemas.android.com/apk/res-auto">
+
+    <data>
+
+        <variable
+            name="viewModel"
+            type="com.sjkj.appthreefloor_tsgz.activity.viewModel.EventCenterViewModel" />
+    </data>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical">
+
+        <androidx.core.widget.NestedScrollView
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            android:layout_weight="1"
+            android:orientation="vertical">
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="vertical">
+
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal"
+                    android:padding="10dp">
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:text="@string/report_event_title"
+                        android:textColor="@color/color_black_text"
+                        android:textSize="14dp" />
+
+                    <EditText
+                        android:id="@+id/title_et"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:layout_marginLeft="10dp"
+                        android:background="@null"
+                        android:ellipsize="end"
+                        android:gravity="right"
+                        android:hint="请输入事件标题"
+                        android:lines="1"
+                        android:maxLength="100"
+                        android:text="@={viewModel.title}"
+                        android:textColor="@color/color_black_text"
+                        android:textSize="14dp" />
+                </LinearLayout>
+
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="1dp"
+                    android:background="@color/divider" />
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal"
+                    android:padding="10dp">
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:text="@string/report_type"
+                        android:textColor="@color/color_black_text"
+                        android:textSize="14dp" />
+
+                    <TextView
+                        android:id="@+id/type_tv"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:layout_marginLeft="10dp"
+                        android:layout_weight="1"
+                        android:ellipsize="end"
+                        android:gravity="right"
+                        android:hint="@string/please_select"
+                        android:lines="1"
+                        android:text="@{viewModel.eventType}"
+                        android:textColor="@color/color_black_text"
+                        android:textSize="14dp" />
+
+                    <ImageView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:layout_marginLeft="10dp"
+                        android:src="@drawable/icon_arrow_right" />
+                </LinearLayout>
+
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="1dp"
+                    android:background="@color/divider" />
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal"
+                    android:padding="10dp">
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:text="所属部门:"
+                        android:textColor="@color/color_black_text"
+                        android:textSize="14dp" />
+
+                    <TextView
+                        android:id="@+id/dept_tv"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:layout_marginLeft="10dp"
+                        android:layout_weight="1"
+                        android:ellipsize="end"
+                        android:gravity="right"
+                        android:lines="1"
+                        android:text="@{viewModel.deptName}"
+                        android:textColor="@color/color_black_text"
+                        android:textSize="14dp" />
+
+                    <ImageView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:layout_marginLeft="10dp"
+                        android:src="@drawable/icon_arrow_right" />
+                </LinearLayout>
+
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="1dp"
+                    android:background="@color/divider"
+                    android:visibility="gone" />
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal"
+                    android:padding="10dp"
+                    android:visibility="gone">
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:text="@string/report_user"
+                        android:textColor="@color/color_black_text"
+                        android:textSize="14dp" />
+
+                    <TextView
+                        android:id="@+id/user_tv"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:layout_marginLeft="10dp"
+                        android:ellipsize="end"
+                        android:lines="1"
+                        android:text="@{viewModel.userName}"
+                        android:textColor="@color/color_black_text"
+                        android:textSize="14dp" />
+                </LinearLayout>
+
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal"
+                    android:padding="10dp"
+                    android:visibility="gone">
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:text="@string/find_time"
+                        android:textColor="@color/color_black_text"
+                        android:textSize="14dp" />
+
+                    <TextView
+                        android:id="@+id/time_tv"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:layout_marginLeft="10dp"
+                        android:ellipsize="end"
+                        android:lines="1"
+                        android:text="@{viewModel.time}"
+                        android:textColor="@color/color_black_text"
+                        android:textSize="14dp" />
+                </LinearLayout>
+
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="1dp"
+                    android:background="@color/divider" />
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal"
+                    android:padding="10dp">
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:text="@string/find_position"
+                        android:textColor="@color/color_black_text"
+                        android:textSize="14dp" />
+
+                    <TextView
+                        android:id="@+id/position_tv"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:layout_marginLeft="10dp"
+                        android:layout_marginRight="10dp"
+                        android:layout_weight="1"
+                        android:drawablePadding="10dp"
+                        android:ellipsize="end"
+                        android:gravity="right|center_vertical"
+                        android:hint="请输入当前地址"
+                        android:maxLines="2"
+                        android:text="@{viewModel.position}"
+                        android:maxLength="255"
+                        android:textColor="@color/color_black_text"
+                        android:textSize="12dp" />
+
+                    <ImageView
+                        android:id="@+id/location_iv"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:padding="3dp"
+                        android:src="@drawable/icon_location_small" />
+
+                </LinearLayout>
+
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="1dp"
+                    android:background="@color/divider"
+                    android:visibility="visible" />
+
+                <LinearLayout
+                    android:id="@+id/ll_huo"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal"
+                    android:padding="10dp"
+                    android:visibility="gone">
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:text="火情半径"
+                        android:textColor="@color/color_black_text"
+                        android:textSize="14dp" />
+
+                    <EditText
+                        android:id="@+id/tv_huo"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:layout_marginLeft="10dp"
+                        android:layout_weight="1"
+                        android:background="@drawable/shape_bg_gray_input"
+                        android:drawablePadding="10dp"
+                        android:ellipsize="end"
+
+                        android:gravity="right|center_vertical"
+                        android:hint="请输入当前火情半径"
+                        android:inputType="number"
+                        android:maxLines="1"
+                        android:maxLength="10"
+                        android:textColor="@color/color_black_text"
+                        android:textSize="12dp" />
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:layout_marginLeft="10dp"
+                        android:text="米"
+                        android:textColor="@color/black"
+                        android:textSize="14dp">
+
+                    </TextView>
+                </LinearLayout>
+
+                <View
+
+                    android:id="@+id/view_huo"
+                    android:layout_width="match_parent"
+                    android:layout_height="1dp"
+                    android:background="@color/divider"
+                    android:visibility="gone" />
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal"
+                    android:padding="10dp"
+                    android:visibility="gone">
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:text="@string/wind_direction"
+                        android:textColor="@color/color_black_text"
+                        android:textSize="14dp" />
+
+                    <TextView
+                        android:id="@+id/wind_direction_tv"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:layout_marginLeft="10dp"
+                        android:layout_weight="1"
+                        android:ellipsize="end"
+                        android:gravity="right"
+                        android:hint="@string/please_select"
+                        android:lines="1"
+                        android:text="@{viewModel.windDirection}"
+                        android:textColor="@color/color_black_text"
+                        android:textSize="14dp" />
+
+                    <ImageView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:layout_marginLeft="10dp"
+                        android:src="@drawable/icon_arrow_right" />
+                </LinearLayout>
+
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="1dp"
+                    android:background="@color/divider"
+                    android:visibility="gone" />
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="vertical"
+                    android:padding="10dp">
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:text="@string/details_content"
+                        android:textColor="@color/color_black_text"
+                        android:textSize="14dp" />
+
+                    <FrameLayout
+                        android:id="@+id/input_bg"
+                        android:layout_width="match_parent"
+                        android:layout_height="150dp"
+                        android:layout_marginTop="10dp"
+                        android:background="@drawable/shape_bg_content_input">
+
+                        <EditText
+                            android:id="@+id/content_et"
+                            android:layout_width="match_parent"
+                            android:layout_height="match_parent"
+                            android:background="@null"
+                            android:ellipsize="end"
+                            android:maxLength="512"
+                            android:gravity="start"
+                            android:padding="5dp"
+                            android:text="@={viewModel.content}"
+                            android:textColor="@color/color_black_text"
+                            android:textSize="14dp" />
+                    </FrameLayout>
+
+                </LinearLayout>
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="vertical"
+                    android:padding="10dp">
+
+                    <LinearLayout
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:orientation="horizontal"
+                        android:paddingTop="10dp"
+                        android:paddingBottom="10dp">
+
+                        <TextView
+                            android:layout_width="0dp"
+                            android:layout_height="wrap_content"
+                            android:layout_gravity="center_vertical"
+                            android:layout_weight="1"
+                            android:text="@string/add_image"
+                            android:textColor="@color/color_black_text"
+                            android:textSize="14dp" />
+
+                        <ImageView
+                            android:id="@+id/image_add_iv"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:src="@drawable/icon_select_image" />
+                    </LinearLayout>
+
+
+                    <androidx.recyclerview.widget.RecyclerView
+                        android:id="@+id/image_recyclerView"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:overScrollMode="never"
+                        android:padding="3dp" />
+                </LinearLayout>
+
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="vertical"
+                    android:padding="10dp">
+
+                    <LinearLayout
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:orientation="horizontal"
+                        android:paddingTop="10dp"
+                        android:paddingBottom="10dp">
+
+                        <TextView
+                            android:layout_width="0dp"
+                            android:layout_height="wrap_content"
+                            android:layout_gravity="center_vertical"
+                            android:layout_weight="1"
+                            android:text="添加视频"
+                            android:textColor="@color/color_black_text"
+                            android:textSize="14dp" />
+
+                        <ImageView
+                            android:id="@+id/video_add"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:src="@drawable/icon_select_image" />
+                    </LinearLayout>
+
+
+                    <androidx.recyclerview.widget.RecyclerView
+                        android:id="@+id/video_recyclerView"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:overScrollMode="never"
+                        android:padding="3dp" />
+                </LinearLayout>
+
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1" />
+
+                <!--            <TextView-->
+                <!--                android:id="@+id/tv_again"-->
+                <!--                android:layout_width="match_parent"-->
+                <!--                android:layout_height="wrap_content"-->
+                <!--                android:layout_marginLeft="22dp"-->
+                <!--                android:layout_marginRight="22dp"-->
+                <!--                android:layout_marginBottom="22dp"-->
+                <!--                android:background="@drawable/shape_bg_again"-->
+                <!--                android:gravity="center"-->
+                <!--                android:paddingTop="10dp"-->
+                <!--                android:paddingBottom="10dp"-->
+                <!--                android:text="重新获取"-->
+                <!--                android:textColor="@color/color_white"-->
+                <!--                android:textSize="14dp" />-->
+
+            </LinearLayout>
+        </androidx.core.widget.NestedScrollView>
+
+        <TextView
+            android:id="@+id/submit_event_tv"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="22dp"
+            android:layout_marginTop="16dp"
+            android:layout_marginRight="22dp"
+            android:layout_marginBottom="16dp"
+            android:background="@drawable/shape_bg_blue"
+            android:gravity="center"
+            android:paddingTop="10dp"
+            android:paddingBottom="10dp"
+            android:text="@string/submit_event"
+            android:textColor="@color/color_white"
+            android:textSize="14dp" />
+    </LinearLayout>
+
+</layout>

+ 55 - 0
app/src/main/res/layout/activity_permission_list.xml

@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <data>
+
+        <variable
+            name="viewModel"
+            type="com.sjkj.appthreefloor_tsgz.activity.viewModel.MainViewModel" />
+    </data>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical">
+
+        <androidx.recyclerview.widget.RecyclerView
+            android:id="@+id/recyclerView"
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            android:layout_weight="1"
+            android:overScrollMode="never" />
+
+        <TextView
+            android:id="@+id/setting_tv"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginRight="30dp"
+            android:layout_marginLeft="30dp"
+            android:paddingTop="5dp"
+            android:paddingBottom="5dp"
+            android:layout_gravity="center_horizontal"
+            android:layout_marginBottom="15dp"
+            android:background="@drawable/bg_blue_text"
+            android:gravity="center"
+            android:text="去设置"
+            android:textColor="@color/main_blue_color"
+            android:textSize="18dp" />
+
+        <TextView
+            android:id="@+id/setting_finish_tv"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginRight="30dp"
+            android:layout_marginLeft="30dp"
+            android:paddingTop="5dp"
+            android:paddingBottom="5dp"
+            android:gravity="center"
+            android:layout_gravity="center_horizontal"
+            android:layout_marginBottom="35dp"
+            android:background="@drawable/bg_green_text"
+            android:text="设置完成"
+            android:textColor="@color/green_color"
+            android:textSize="18dp" />
+    </LinearLayout>
+</layout>

+ 55 - 0
app/src/main/res/layout/activity_photo_view.xml

@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools">
+
+    <data>
+
+        <variable
+            name="viewModel"
+            type="com.sjkj.appthreefloor_tsgz.weight.photoview.PhotoViewModel" />
+    </data>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@color/black"
+        android:orientation="vertical">
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="45dp" >
+
+            <ImageView
+                android:id="@+id/back"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:layout_centerVertical="true"
+                android:paddingLeft="10dp"
+                android:paddingRight="10dp"
+                android:scaleType="center"
+                android:src="@drawable/ic_back" />
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:gravity="center"
+                android:layout_centerInParent="true"
+                android:text="@{viewModel.title}"
+                android:textColor="@color/color_white" />
+        </RelativeLayout>
+
+
+        <com.sjkj.appthreefloor_tsgz.weight.photoview.PhotoViewPager
+            android:id="@+id/view_pager"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent" />
+
+        <!--        <com.bm.library.PhotoView-->
+        <!--            android:id="@+id/photoView"-->
+        <!--            android:layout_width="match_parent"-->
+        <!--            android:layout_height="match_parent"-->
+        <!--            android:error="@{@drawable/camera}"-->
+        <!--            android:imgUrl="@{viewModel.imageList}"/>-->
+
+    </LinearLayout>
+</layout>

+ 79 - 0
app/src/main/res/layout/activity_resource_water_crane.xml

@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
+
+    <data>
+
+        <variable
+            name="viewModel"
+            type="com.sjkj.appthreefloor_tsgz.activity.viewModel.ResourceVisualizationViewModel" />
+    </data>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_gravity="start"
+        android:background="@color/color_white"
+        android:orientation="vertical">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:gravity="center_vertical"
+            android:orientation="horizontal"
+            android:padding="12dp"
+            android:visibility="gone">
+
+            <EditText
+                android:id="@+id/input_et"
+                android:layout_width="match_parent"
+                android:layout_height="30dp"
+                android:layout_weight="1"
+                android:background="@drawable/shape_bg_gray_input"
+                android:drawableLeft="@drawable/icon_search"
+                android:drawablePadding="5dp"
+                android:hint="@string/input_content"
+                android:lines="1"
+                android:paddingLeft="10dp"
+                android:paddingRight="10dp"
+                android:textColor="@color/color_black_text"
+                android:textColorHint="@color/color_gray_light_text"
+                android:textSize="12dp" />
+
+            <TextView
+                android:id="@+id/search_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="10dp"
+                android:text="@string/search"
+                android:textColor="@color/main_blue_color" />
+        </LinearLayout>
+
+        <com.google.android.material.tabs.TabLayout
+            android:id="@+id/tabLayout"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            app:tabIndicatorColor="@color/main_blue_color"
+            app:tabIndicatorFullWidth="false"
+            app:tabIndicatorHeight="2dp"
+            app:tabMode="auto"
+            app:tabRippleColor="@android:color/transparent"
+            app:tabSelectedTextColor="@color/main_blue_color"
+            app:tabTextAppearance="@style/TabLayoutStyle"
+            app:tabTextColor="@color/color_gray_text" />
+
+        <FrameLayout
+            android:id="@+id/fragment_layout"
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            android:layout_weight="1" />
+        <!--        <androidx.viewpager2.widget.ViewPager2-->
+        <!--            android:id="@+id/view_pager"-->
+        <!--            android:layout_width="match_parent"-->
+        <!--            android:layout_height="0dp"-->
+        <!--            android:layout_weight="1" />-->
+
+    </LinearLayout>
+
+
+</layout>

+ 36 - 0
app/src/main/res/layout/custom_marker.xml

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/parentLayout"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:background="@drawable/shape_background_white_5"
+    android:orientation="horizontal"
+    android:padding="10dp">
+
+    <ImageView
+        android:id="@+id/markerImage"
+        android:layout_width="40dp"
+        android:layout_height="40dp"
+        android:src="@drawable/ic_launcher_logo_siping_tsgz"
+        android:visibility="gone" />
+
+    <TextView
+        android:id="@+id/markerName"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_toEndOf="@+id/markerImage"
+        android:textColor="@color/black"
+        android:textSize="15dp" />
+
+    <TextView
+        android:id="@+id/markerDistance"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignBottom="@+id/markerImage"
+        android:layout_marginStart="10dp"
+        android:layout_toEndOf="@+id/markerImage"
+        android:textColor="#999999"
+        android:textSize="12dp"
+        android:visibility="gone" />
+
+</RelativeLayout>

+ 34 - 0
app/src/main/res/layout/fragment_data_list.xml

@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
+
+    <data>
+
+        <variable
+            name="viewModel"
+            type="com.sjkj.appthreefloor_tsgz.activity.viewModel.ResourceVisualizationViewModel" />
+    </data>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical">
+
+       <!-- <com.scwang.smartrefresh.layout.SmartRefreshLayout
+            android:id="@+id/smartRefreshLayout"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent" >-->
+
+            <androidx.recyclerview.widget.RecyclerView android:overScrollMode="never"
+                android:id="@+id/recyclerView"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent" />
+
+        <TextView
+            android:id="@+id/textView"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:text="appthreefloor_tsgz" />
+        <!-- </com.scwang.smartrefresh.layout.SmartRefreshLayout>-->
+    </LinearLayout>
+</layout>

+ 28 - 2
app/src/main/res/layout/fragment_event.xml

@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <layout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    xmlns:tools="http://schemas.android.com/tools">
+    xmlns:app="http://schemas.android.com/apk/res-auto">
 
     <data>
 
@@ -17,6 +16,33 @@
         android:background="@color/color_white"
         android:orientation="vertical">
 
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="40dp"
+            android:background="@color/colorPrimary">
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:gravity="center_horizontal|center_vertical"
+                android:text="事件"
+                android:textColor="@color/white"
+                android:textSize="18dp" />
+
+            <TextView
+                android:layout_width="60dp"
+                android:layout_height="match_parent"
+                android:layout_alignParentRight="true"
+                android:layout_marginRight="15dp"
+                android:gravity="center_vertical|right"
+                android:text="上报"
+                android:id="@+id/report"
+                android:textColor="@color/white"
+                android:textSize="16dp">
+
+            </TextView>
+        </RelativeLayout>
+
         <LinearLayout
             android:focusable="true"
             android:focusableInTouchMode="true"

+ 5 - 0
app/src/main/res/layout/fragment_main.xml

@@ -54,6 +54,7 @@
                         android:padding="12dp">
 
                         <LinearLayout
+                            android:id="@+id/ll_camera"
                             android:layout_width="0dp"
                             android:layout_height="match_parent"
                             android:layout_gravity="center_horizontal"
@@ -82,6 +83,7 @@
                         </LinearLayout>
 
                         <LinearLayout
+                            android:id="@+id/ll_sensor"
                             android:layout_width="0dp"
                             android:layout_height="match_parent"
                             android:layout_gravity="center_horizontal"
@@ -110,6 +112,7 @@
                         </LinearLayout>
 
                         <LinearLayout
+                            android:id="@+id/ll_water_intake"
                             android:layout_width="0dp"
                             android:layout_height="match_parent"
                             android:layout_gravity="center_horizontal"
@@ -138,6 +141,7 @@
                         </LinearLayout>
 
                         <LinearLayout
+                            android:id="@+id/ll_water_crane"
                             android:layout_width="0dp"
                             android:layout_height="match_parent"
                             android:layout_gravity="center_horizontal"
@@ -176,6 +180,7 @@
                         android:padding="12dp">
 
                         <LinearLayout
+                            android:id="@+id/ll_water_source"
                             android:layout_width="0dp"
                             android:layout_height="match_parent"
                             android:layout_gravity="center_horizontal"

+ 21 - 0
app/src/main/res/layout/fragment_map.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <data>
+
+        <variable
+            name="viewModel"
+            type="com.sjkj.appthreefloor_tsgz.fragment.viewModel.MapViewModel" />
+    </data>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical">
+
+        <com.amap.api.maps.TextureMapView
+            android:id="@+id/map_view"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent" />
+    </LinearLayout>
+</layout>

+ 25 - 0
app/src/main/res/layout/item_address.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_height="wrap_content"
+    android:orientation="horizontal"
+    android:gravity="center_vertical"
+    android:layout_width="match_parent">
+    <ImageView
+        android:id="@+id/item_address_img"
+        android:paddingLeft="5dp"
+        android:src="@drawable/icon_address_arrow_selected"
+        android:layout_width="wrap_content"
+        android:visibility="invisible"
+        android:layout_height="wrap_content" />
+    <TextView
+        android:id="@+id/item_address_tv"
+        android:layout_height="wrap_content"
+        android:textSize="15.3sp"
+        android:textColor="@color/color_black_3"
+        android:text="上海"
+        android:paddingLeft="4dp"
+        android:paddingTop="13.3dp"
+        android:paddingBottom="13.3dp"
+        android:layout_width="match_parent"/>
+</LinearLayout>
+

+ 51 - 0
app/src/main/res/layout/item_camera_list_layout.xml

@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <data>
+
+        <variable
+            name="bean"
+            type="com.sjkj.base_lib.camera.dh.bean.CameraBean" />
+    </data>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:gravity="center_vertical"
+        android:padding="10dp">
+
+        <ImageView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:src="@drawable/icon_camera" />
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:gravity="center_vertical"
+            android:layout_marginLeft="10dp"
+            android:orientation="vertical">
+
+            <TextView
+                android:layout_gravity="center_vertical"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:gravity="center_vertical"
+                android:text="@{bean.cameraName}"
+                android:textColor="@color/color_black_3"
+                android:textSize="16dp" />
+
+<!--            <TextView-->
+<!--                android:layout_width="match_parent"-->
+<!--                android:layout_height="wrap_content"-->
+<!--                android:layout_marginTop="6dp"-->
+<!--                android:gravity="center_vertical"-->
+<!--                android:text='@{bean.distance+"km"}'-->
+<!--                android:textColor="@color/color_black_3"-->
+<!--                android:textSize="14dp" />-->
+        </LinearLayout>
+
+
+    </LinearLayout>
+</layout>

+ 79 - 0
app/src/main/res/layout/item_common_data_list.xml

@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
+
+    <data>
+
+        <variable
+            name="model"
+            type="com.sjkj.appthreefloor_tsgz.bean.ResourceVisualizationBean" />
+    </data>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center_vertical"
+        android:orientation="horizontal"
+        android:paddingLeft="12dp"
+        android:paddingTop="10dp"
+        android:paddingRight="12dp"
+        android:paddingBottom="10dp">
+
+        <ImageView
+            android:layout_width="40dp"
+            android:id="@+id/ivType"
+            android:layout_height="40dp"
+            android:layout_gravity="center_vertical"
+            android:layout_marginRight="10dp" />
+          <!--  android:error="@{@drawable/icon_camera}"
+            android:placeholder="@{@drawable/icon_camera}"-->
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical">
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="horizontal">
+
+                <TextView
+                    android:id="@+id/title_tv"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_vertical"
+                    android:layout_marginRight="10dp"
+                    android:ellipsize="end"
+                    android:lines="1"
+                    android:text="@{model.name}"
+                    android:textColor="@color/color_black_text"
+                    android:textSize="15dp" />
+
+                <TextView
+                    android:id="@+id/type_tv"
+                    android:layout_width="77dp"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_vertical"
+                    android:ellipsize="end"
+                    android:gravity="right"
+                    android:lines="1"
+                    android:textColor="@color/main_blue_color"
+                    android:textSize="12dp" />
+            </LinearLayout>
+
+
+            <TextView
+                android:id="@+id/content_tv"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center_vertical"
+                android:layout_marginTop="4dp"
+                android:ellipsize="end"
+                android:maxLines="3"
+                android:textColor="@color/color_gray_text"
+                android:textSize="12dp" />
+        </LinearLayout>
+
+    </LinearLayout>
+</layout>

+ 38 - 0
app/src/main/res/layout/item_image_list.xml

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
+
+    <data>
+
+        <variable
+            name="model"
+            type="com.sjkj.appthreefloor_tsgz.bean.ImageBean" />
+    </data>
+
+    <RelativeLayout
+        android:id="@+id/rl_image"
+        android:layout_width="65dp"
+        android:layout_height="65dp" >
+
+        <ImageView
+            android:id="@+id/iv_icon"
+            android:layout_width="50dp"
+            android:layout_height="50dp"
+            android:layout_centerInParent="true"
+            android:layout_marginStart="5dp"
+            android:layout_marginTop="5dp"
+            android:layout_marginEnd="5dp"
+            android:layout_marginBottom="5dp"
+            android:error="@{@drawable/icon_default_image}"
+            android:imgUrl="@{model.realUrl}"
+            android:scaleType="fitCenter" />
+
+        <ImageView
+            android:id="@+id/delete_iv"
+            android:layout_width="16dp"
+            android:layout_height="16dp"
+            android:layout_alignParentRight="true"
+            android:src="@drawable/icon_image_delete" />
+
+    </RelativeLayout>
+</layout>

+ 58 - 0
app/src/main/res/layout/item_permission_list.xml

@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <data>
+
+        <variable
+            name="model"
+            type="com.sjkj.appthreefloor_tsgz.bean.PermissionBean" />
+    </data>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:padding="15dp">
+
+        <!--        <LinearLayout-->
+        <!--            android:layout_width="match_parent"-->
+        <!--            android:layout_height="wrap_content" -->
+        <!--            android:background="@drawable/rounded_rectangle_white_tsgz"-->
+        <!--            android:gravity="center_vertical"-->
+        <!--            android:orientation="vertical"-->
+        <!--            android:paddingLeft="16dp"-->
+        <!--            android:paddingTop="8dp"-->
+        <!--            android:paddingRight="16dp"-->
+        <!--            android:paddingBottom="8dp">-->
+        <!-- -->
+        <TextView
+            android:id="@+id/title_tv"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_vertical"
+            android:layout_weight="1"
+            android:ellipsize="end"
+            android:gravity="center_vertical"
+            android:lines="1"
+            android:singleLine="true"
+            android:text="@{model.name}"
+            android:textColor="@color/black"
+            android:textSize="18dp" />
+
+        <TextView
+            android:id="@+id/status_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_vertical"
+            android:ellipsize="end"
+            android:gravity="center_vertical"
+            android:lines="1"
+            android:singleLine="true"
+            android:textColor="@color/color_gray_text"
+            android:textSize="18dp" />
+
+
+        <!--        </LinearLayout>-->
+
+    </LinearLayout>
+</layout>

+ 50 - 0
app/src/main/res/layout/item_video_del_list.xml

@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <data>
+
+        <variable
+            name="model"
+            type="com.sjkj.appthreefloor_tsgz.bean.ImageBean" />
+    </data>
+
+    <RelativeLayout
+        android:id="@+id/rl_video"
+        android:layout_width="65dp"
+        android:layout_height="65dp">
+
+        <ImageView
+            android:id="@+id/iv_video"
+            android:layout_width="50dp"
+            android:layout_height="50dp"
+            android:layout_centerInParent="true"
+            android:layout_marginStart="5dp"
+            android:layout_marginTop="5dp"
+            android:layout_marginEnd="5dp"
+            android:layout_marginBottom="5dp"
+            android:background="@color/black" />
+
+        <ImageView
+            android:id="@+id/delete_iv"
+            android:layout_width="16dp"
+            android:layout_height="16dp"
+            android:layout_alignParentRight="true"
+            android:src="@drawable/icon_image_delete" />
+
+        <FrameLayout
+
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerInParent="true"
+            android:layout_marginLeft="5dp"
+            android:layout_marginRight="5dp">
+
+            <ImageView
+                android:id="@+id/iv_icon"
+                android:layout_width="20dp"
+                android:layout_height="20dp"
+                android:layout_gravity="center_vertical|center_horizontal"
+                android:background="@drawable/ic_san" />
+        </FrameLayout>
+    </RelativeLayout>
+</layout>

+ 12 - 0
app/src/main/res/layout/map_location.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:background="@null">
+
+    <ImageView
+        android:layout_width="30dp"
+        android:layout_height="30dp"
+        android:src="@drawable/user_location_img" />
+
+</LinearLayout>

+ 42 - 0
app/src/main/res/layout/pop_address.xml

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@drawable/shape_picker_bg"
+    android:orientation="vertical">
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+
+        android:layout_height="44dp">
+
+        <TextView
+            android:id="@+id/tv_title"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:layout_centerVertical="true"
+            android:layout_marginLeft="15dp"
+            android:gravity="center_vertical"
+            android:text="请选择所在小区/楼栋/单元/房间"
+            android:textColor="@color/color_black_3">
+
+        </TextView>
+
+        <ImageView
+            android:id="@+id/iv_back"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentRight="true"
+            android:layout_centerVertical="true"
+            android:layout_marginRight="15dp"
+            android:background="@drawable/icon_close">
+
+        </ImageView>
+    </RelativeLayout>
+
+    <com.sjkj.appthreefloor_tsgz.address.AddressSelector
+        android:id="@+id/address"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"></com.sjkj.appthreefloor_tsgz.address.AddressSelector>
+</LinearLayout>

+ 1 - 1
base-lib/src/main/AndroidManifest.xml

@@ -91,7 +91,7 @@
         <!--        高德key-->
         <meta-data
             android:name="com.amap.api.v2.apikey"
-            android:value="22f325118c8d9102eae1471c7887b33d" />
+            android:value="412ff25e16b45ca1be42eb44d972fbca" />
         <!--声明定位service-->
         <service
             android:name="com.amap.api.location.APSService"