辖区人口

This commit is contained in:
itgaojian 2023-06-09 18:01:55 +08:00
parent c9b32e9779
commit dba16c6e3c
15 changed files with 662 additions and 56 deletions

View File

@ -10,8 +10,8 @@
{
"type": "SINGLE",
"filters": [],
"versionCode": 3,
"versionName": "1.0.2",
"versionCode": 5,
"versionName": "1.0.4",
"outputFile": "app-release.apk"
}
]

View File

@ -13,6 +13,7 @@ import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Rect;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
@ -157,7 +158,7 @@ public abstract class BaseActivity extends AppCompatActivity {
int navigationBarIsMin = 0;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
navigationBarIsMin = Settings.System.getInt(ctx.getContentResolver(),
deviceInfo, 0);
deviceInfo, 0);
} else {
if (Build.BRAND.equalsIgnoreCase("VIVO") || Build.BRAND.equalsIgnoreCase("OPPO")) {
navigationBarIsMin = Settings.Secure.getInt(ctx.getContentResolver(), deviceInfo, 0);
@ -210,6 +211,7 @@ public abstract class BaseActivity extends AppCompatActivity {
protected void setLocalBroad(LocalBroad localBroad) {
this.mLocalBroad = localBroad;
}
/**
* 弹出强制退出提示
*/
@ -233,7 +235,7 @@ public abstract class BaseActivity extends AppCompatActivity {
} else if (Build.VERSION.SDK_INT >= 19) {
View decorView = activity.getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View
.SYSTEM_UI_FLAG_FULLSCREEN;
.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
}
}
@ -385,7 +387,7 @@ public abstract class BaseActivity extends AppCompatActivity {
public void setEditTextInhibitInputSpeChat(EditText editText) {
InputFilter inputFilter = new InputFilter() {
Pattern emoji = Pattern.compile("[\ud83c\udc00-\ud83c\udfff]|[\ud83d\udc00-\ud83d\udfff]|[\u2600-\u27ff]",
Pattern.UNICODE_CASE | Pattern.CASE_INSENSITIVE);
Pattern.UNICODE_CASE | Pattern.CASE_INSENSITIVE);
@Override
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
@ -523,8 +525,8 @@ public abstract class BaseActivity extends AppCompatActivity {
private void openActivity(String path) {
ARouter.getInstance()
.build(path)
.navigation();
.build(path)
.navigation();
}
private String getRunningTopActivity() {
@ -621,8 +623,6 @@ public abstract class BaseActivity extends AppCompatActivity {
// res.updateConfiguration(config, res.getDisplayMetrics());
// return res;
// }
@Override
public void onBackPressed() {
finish();
@ -648,9 +648,9 @@ public abstract class BaseActivity extends AppCompatActivity {
*/
protected void startImageActivity(ArrayList imageUrls) {
ARouter.getInstance()
.build(PathConfig.PATH_MODULE_CMUTILS_PHOTO_SHOW)
.withStringArrayList("imgUrls", imageUrls)
.navigation();
.build(PathConfig.PATH_MODULE_CMUTILS_PHOTO_SHOW)
.withStringArrayList("imgUrls", imageUrls)
.navigation();
}
/**
@ -666,20 +666,20 @@ public abstract class BaseActivity extends AppCompatActivity {
*/
protected void startCameraActivity(boolean isMovie, int requestCode) {
ARouter.getInstance()
.build(PathConfig.PATH_MODULEMEDIA_CAMERA)
.withBoolean("isMovie", isMovie)
.navigation(this, requestCode);
.build(PathConfig.PATH_MODULEMEDIA_CAMERA)
.withBoolean("isMovie", isMovie)
.navigation(this, requestCode);
}
protected void checkIsLogin(String path) {
if (TextUtils.isEmpty(UserLgUtils.getToken())) {
ARouter.getInstance()
.build(PathConfig.PATH_MODULE_MAIN_LOGIN)
.navigation(mActivity, 2333);
.build(PathConfig.PATH_MODULE_MAIN_LOGIN)
.navigation(mActivity, 2333);
} else {
ARouter.getInstance()
.build(path)
.navigation();
.build(path)
.navigation();
}
}
@ -728,6 +728,16 @@ public abstract class BaseActivity extends AppCompatActivity {
});
}
/**
* 打开手机详情
*/
protected void showAppSettingPage() {
Intent intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.setData(Uri.parse("package:" + mActivity.getPackageName()));
mActivity.startActivity(intent);
}
/**
* 缩起
*/

View File

@ -74,6 +74,10 @@ public class CenterChooseAreaDialogView extends Dialog {
private String mSelArea4;
private String mSelArea5;
private AreaBean mSelAreaBean3;
private AreaBean mSelAreaBean4;
private AreaBean mSelAreaBean5;
private CenterChooseAreaDialogView(Context context, boolean isCancelable, boolean isBackCancelable, int gravity, boolean isShow, boolean isShowOther, boolean isDefault) {
super(context, R.style.dialog_center_alpha);
this.context = context;
@ -106,7 +110,6 @@ public class CenterChooseAreaDialogView extends Dialog {
mTvArea2.setText(PathConfig.DEFAULT_AREA_2_Name);
mSelArea1 = PathConfig.DEFAULT_AREA_1;
mSelArea2 = PathConfig.DEFAULT_AREA_2;
} else {
mTvArea1.setOnClickListener(v -> onShowArea1());
mTvArea2.setOnClickListener(v -> onShowArea2());
@ -135,16 +138,19 @@ public class CenterChooseAreaDialogView extends Dialog {
String area5 = mTvArea5.getText().toString().trim();
String selArea = areq1 + "-" + area2 + "-" + area3;
String mSelIds = mSelArea1 + "&" + mSelArea2 + "&" + mSelArea3;
String mSelCode = mSelAreaBean3.getAreaCode();
if (!TextUtils.isEmpty(area4)) {
selArea += "-" + area4;
mSelIds += ("&" + mSelArea4);
mSelCode = mSelAreaBean4.getAreaCode();
}
if (!TextUtils.isEmpty(area5)) {
selArea += "-" + area5;
mSelIds += ("&" + mSelArea5);
mSelCode = mSelAreaBean5.getAreaCode();
}
mListener.doConfirm(selArea, mSelIds);
mListener.doConfirm(selArea, mSelIds, mSelCode);
}
}
@ -263,7 +269,7 @@ public class CenterChooseAreaDialogView extends Dialog {
AreaBean bean = mArea3List.get(options1);
mTvArea3.setText(bean.getAreaName());
mSelArea3 = bean.getAreaId();
mSelAreaBean3 = bean;
mSelArea4 = "";
mTvArea4.setText("");
mArea4List = null;
@ -298,6 +304,7 @@ public class CenterChooseAreaDialogView extends Dialog {
AreaBean bean = mArea4List.get(options1);
mTvArea4.setText(bean.getAreaName());
mSelArea4 = bean.getAreaId();
mSelAreaBean4 = bean;
mSelArea5 = "";
mTvArea5.setText("");
mArea5List = null;
@ -328,6 +335,7 @@ public class CenterChooseAreaDialogView extends Dialog {
AreaBean bean = mArea5List.get(options1);
mTvArea5.setText(bean.getAreaName());
mSelArea5 = bean.getAreaId();
mSelAreaBean5 = bean;
})
.setTitleText("请选择区域")
.isDialog(true)
@ -411,7 +419,7 @@ public class CenterChooseAreaDialogView extends Dialog {
}
public interface OnChoseListener {
void doConfirm(String list, String ids);
void doConfirm(String list, String ids, String code);
}
public static class DialogBuilder {

View File

@ -55,8 +55,8 @@ ext {
gCompileSdkVersion = 30
gMinSdkVersion = 21
gTargetSdkVersion = 30
gVersionCode = 3
gVersionName = '1.0.2'
gVersionCode = 5
gVersionName = '1.0.4'
gBuildToolsVersion = "29.0.2"
// gVersionCode=26
// gVersionName='1.3.0'

View File

@ -25,6 +25,9 @@
<application
android:maxAspectRatio="2.4"
android:resizeableActivity="true">
<activity
android:name=".activitys.statistics.IncidentStatisticsActivity"
android:exported="false" />
<activity
android:name=".activitys.incident.IncidentAnewListActivity"
android:launchMode="singleTop"
@ -35,13 +38,11 @@
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateHidden" />
<activity
android:name=".activitys.incident.IncidentAlterDetailActivity"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateHidden" />
<activity
android:name=".activitys.incident.DeptSelActivity"
android:launchMode="singleTop"

View File

@ -749,7 +749,7 @@
android:button="@drawable/sel_radio_cir_hook"
android:checked="true"
android:gravity="center"
android:text="社区专管"
android:text="专管"
android:textSize="14sp"
android:visibility="visible" />

View File

@ -412,7 +412,7 @@
android:button="@drawable/sel_radio_cir_hook"
android:checked="true"
android:gravity="center"
android:text="社区专管"
android:text="专管"
android:textSize="14sp"
android:visibility="visible" />

View File

@ -1,9 +1,45 @@
package com.tengshisoft.commonmodule.activitys.logs;
import android.app.ProgressDialog;
import android.graphics.Color;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.bigkoo.pickerview.builder.TimePickerBuilder;
import com.bigkoo.pickerview.view.TimePickerView;
import com.github.mikephil.charting.charts.BarChart;
import com.github.mikephil.charting.components.XAxis;
import com.github.mikephil.charting.components.YAxis;
import com.github.mikephil.charting.data.BarData;
import com.github.mikephil.charting.data.BarDataSet;
import com.github.mikephil.charting.data.BarEntry;
import com.github.mikephil.charting.formatter.LargeValueFormatter;
import com.gyf.immersionbar.ImmersionBar;
import com.hjq.toast.ToastUtils;
import com.tengshisoft.commonmodule.R;
import com.tengshisoft.commonmodule.R2;
import com.tengshisoft.commonmodule.beans.GridStatistCountBean;
import com.tengshisoft.commonmodule.nets.GridApis;
import com.tenlionsoft.baselib.constant.PathConfig;
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
import com.tenlionsoft.baselib.core.retrofit_net.conver.RxTransformer;
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
import com.tenlionsoft.baselib.utils.LogUtils;
import com.tenlionsoft.baselib.utils.TimeUtils;
import com.tenlionsoft.baselib.utils.UIUtil;
import com.tenlionsoft.baselib.utils.UserLgUtils;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import io.reactivex.rxjava3.annotations.NonNull;
import io.reactivex.rxjava3.core.Observer;
import io.reactivex.rxjava3.disposables.Disposable;
/**
* 作者: Adam
@ -13,6 +49,20 @@ import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
*/
@Route(path = PathConfig.PATH_MODULE_COMMON_ACTIVITY_COMMAND_STATISTICS)
public class StatisticsCommandActivity extends BaseActivity {
@BindView(R2.id.bc_task)
BarChart mBcTask;
@BindView(R2.id.tv_start_date)
TextView mTvStartDate;
@BindView(R2.id.tv_end_date)
TextView mTvEndDate;
@BindView(R2.id.bc_case)
BarChart mBcCase;
@BindView(R2.id.iv_back)
ImageView mIvBack;
private Unbinder mBind;
private String mStartDate;
private String mEndDate;
private ProgressDialog mProgressDialog;
@Override
protected int setLayoutId() {
@ -21,6 +71,252 @@ public class StatisticsCommandActivity extends BaseActivity {
@Override
public void initData() {
mBind = ButterKnife.bind(this);
ImmersionBar.with(mActivity)
.statusBarDarkFont(true)
.init();
mRlTitleBar.setVisibility(View.GONE);
initViews();
getStatistCount(1);
}
private void initViews() {
mIvBack.setOnClickListener(v -> finish());
mStartDate = TimeUtils.getCurrentMonth() + "-01";
mEndDate = TimeUtils.getCurrentMonth() + "-" + TimeUtils.getMonthEnd();
mTvStartDate.setOnClickListener(v -> onShowDate(1));
mTvEndDate.setOnClickListener(v -> onShowDate(2));
mTvStartDate.setText(mStartDate);
mTvEndDate.setText(mEndDate);
buildCaseCount(new ArrayList<>());
refreshView(STATE_LOAD_SUCCESS);
}
private void onShowDate(int i) {
hideSoftKeyboard();
TimePickerView mTimePickerView = new TimePickerBuilder(mActivity, (date, v) -> {
switch (i) {
case 1:
String start = TimeUtils.dateToString(date);
int s = TimeUtils.compareDate(start, mEndDate);
if (s <= 0) {
mStartDate = TimeUtils.dateToString(date);
mTvStartDate.setText(mStartDate);
getStatistCount(2);
} else {
ToastUtils.show("结束日期小于开始日期");
}
break;
case 2:
String time = TimeUtils.dateToString(date);
int i1 = TimeUtils.compareDate(mStartDate, time);
if (i1 <= 0) {
mEndDate = TimeUtils.dateToString(date);
mTvEndDate.setText(mEndDate);
getStatistCount(2);
} else {
ToastUtils.show("结束日期小于开始日期");
}
break;
}
})
.setTitleText("请选日期")
.setCancelColor(Color.parseColor("#1189FF"))
.setSubmitColor(Color.parseColor("#1189FF"))
.setType(new boolean[]{true, true, true, false, false, false})
.setTitleColor(Color.parseColor("#1189FF"))
.build();
mTimePickerView.show();
}
private void getStatistCountByDept() {
RetrofitManager.getInstance()
.create(GridApis.class)
.getTaskStatistCountByDept(UserLgUtils.getUserDeptId(), UserLgUtils.getToken())
.compose(RxTransformer.getTransformer())
.subscribe(new Observer<List<GridStatistCountBean>>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull List<GridStatistCountBean> gridStatistCountBeans) {
}
@Override
public void onError(@NonNull Throwable e) {
}
@Override
public void onComplete() {
}
});
}
/**
* 统计任务数量
*/
private void getStatistCount(int type) {
if (type == 2) {
mProgressDialog = UIUtil.initDialog(mActivity, "加载中...");
mProgressDialog.show();
}
RetrofitManager.getInstance()
.create(GridApis.class)
.getTaskStatistCount(mStartDate, mEndDate, UserLgUtils.getToken())
.compose(RxTransformer.getTransformer())
.subscribe(new Observer<List<GridStatistCountBean>>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull List<GridStatistCountBean> gridStatistCountBeans) {
if (type == 2) {
mProgressDialog.dismiss();
}
for (int i = 0; i < gridStatistCountBeans.size(); i++) {
gridStatistCountBeans.get(i).setCount((20 * (i + 1)) + "");
}
for (int i = 0; i < 20; i++) {
GridStatistCountBean b = new GridStatistCountBean();
b.setCount(10 + "");
b.setDataType("测试" + i);
gridStatistCountBeans.add(b);
}
buildTaskCount(gridStatistCountBeans);
}
@Override
public void onError(@NonNull Throwable e) {
if (type == 2) {
mProgressDialog.dismiss();
}
}
@Override
public void onComplete() {
}
});
}
/**
* 构建任务数
*/
private void buildTaskCount(List<GridStatistCountBean> list) {
List<BarEntry> datas = new ArrayList<>();
List<String> xValues = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
datas.add(new BarEntry(i, Float.parseFloat(list.get(i).getCount())));
xValues.add(list.get(i).getDataType());
}
BarDataSet barDataSet = new BarDataSet(datas, "任务");
barDataSet.setBarBorderColor(Color.CYAN);
barDataSet.setValueFormatter(new LargeValueFormatter() {
@Override
public String getFormattedValue(float value) {
return (int) value + "";
}
});
BarData barData = new BarData(barDataSet);
barData.setBarWidth(0.3f);
mBcTask.setData(barData);
YAxis axisLeft = mBcTask.getAxisLeft();
// axisLeft.setAxisMaximum(1); Y轴最大值
axisLeft.setAxisMinimum(0);
axisLeft.setValueFormatter(new LargeValueFormatter() {
@Override
public String getFormattedValue(float value) {
return (int) value + "";
}
});
XAxis xAxis = mBcTask.getXAxis();
xAxis.setDrawGridLines(false);
xAxis.setAxisLineWidth(1f);
xAxis.setAxisLineColor(Color.BLACK);
xAxis.setLabelRotationAngle(-60);
xAxis.setLabelCount(list.size(), false);
xAxis.setAxisMinimum(1.0f);
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
xAxis.setValueFormatter(new LargeValueFormatter() {
@Override
public String getFormattedValue(float value) {
return xValues.get((int) value);
}
});
mBcTask.setNoDataText("暂无数据");
mBcTask.getAxisRight().setEnabled(false);
mBcTask.getDescription().setEnabled(false);
mBcTask.notifyDataSetChanged();
mBcTask.setScaleXEnabled(true);
mBcTask.setScaleYEnabled(false);
mBcTask.invalidate();
}
/**
* 构建事件统计
*/
private void buildCaseCount(List<GridStatistCountBean> list) {
List<BarEntry> datas = new ArrayList<>();
List<String> xValues = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
datas.add(new BarEntry(i, Float.parseFloat(list.get(i).getCount())));
xValues.add(list.get(i).getDataType());
}
BarDataSet barDataSet = new BarDataSet(datas, "事件");
barDataSet.setBarBorderColor(Color.CYAN);
barDataSet.setValueFormatter(new LargeValueFormatter() {
@Override
public String getFormattedValue(float value) {
return (int) value + "";
}
});
BarData barData = new BarData(barDataSet);
barData.setBarWidth(0.3f);
mBcCase.setData(barData);
YAxis axisLeft = mBcCase.getAxisLeft();
axisLeft.setAxisMaximum(30);
axisLeft.setAxisMinimum(0);
axisLeft.setValueFormatter(new LargeValueFormatter() {
@Override
public String getFormattedValue(float value) {
return (int) value + "";
}
});
XAxis xAxis = mBcCase.getXAxis();
xAxis.setDrawGridLines(false);
xAxis.setAxisLineWidth(1f);
xAxis.setAxisLineColor(Color.BLACK);
xAxis.setLabelRotationAngle(30);
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
xAxis.setValueFormatter(new LargeValueFormatter() {
@Override
public String getFormattedValue(float value) {
return xValues.get((int) value);
}
});
mBcCase.setNoDataText("暂无数据");
mBcCase.getAxisRight().setEnabled(false);
mBcCase.getDescription().setEnabled(false);
mBcCase.notifyDataSetChanged();
mBcCase.invalidate();
}
@Override
protected void clearSearch() {
}
@ -28,9 +324,4 @@ public class StatisticsCommandActivity extends BaseActivity {
protected void doSearchByTitle() {
}
@Override
protected void clearSearch() {
}
}

View File

@ -232,10 +232,10 @@ public class CensusBaseDetailActivity extends BaseActivity {
mTvType.setText("户籍人口");
break;
case "2":
mTvType.setText("常住人口");
mTvType.setText("户籍人口(外出)");
break;
case "3":
mTvType.setText("外来人口");
mTvType.setText("非户籍人口");
break;
}
}

View File

@ -1,6 +1,7 @@
package com.tengshisoft.commonmodule.nets;
import com.tengshisoft.commonmodule.adapters.CommunityUserListBean;
import com.tengshisoft.commonmodule.beans.AreaGridListBean;
import com.tengshisoft.commonmodule.beans.DeferDetailBean;
import com.tengshisoft.commonmodule.beans.DepartmentListBean;
import com.tengshisoft.commonmodule.beans.DisposeDetailBean;
@ -171,8 +172,8 @@ public interface CenterApis {
* 根据区域树社区专管员列表
*/
@Headers({"base_url_name:case", "Content-Type: application/json", "Accept: application/json"})
@GET("app/caseadmin/area/caseadmin/{areacode}")
Observable<List<CommunityUserListBean>> getCommunityUserByCode(@Path("areacode") String deptId, @Header("token") String token);
@GET("app/caseadmin/area/special/{areaCode}")
Observable<List<CommunityUserListBean>> getCommunityUserByCode(@Path("areaCode") String deptId, @Header("token") String token);
/**
* 获取最新的处理结果
@ -230,6 +231,7 @@ public interface CenterApis {
@Headers({"base_url_name:case", "Content-Type: application/json", "Accept: application/json"})
@POST("app/taskcompetebase/save-area-allocate-update/{taskId}")
Observable<SuccessBean> doSaveAlter(@Path("taskId") String id, @Body RequestBody body, @Header("token") String token);
/**
* 获取事件改派详情
*/
@ -411,4 +413,14 @@ public interface CenterApis {
Observable<JournalListBean> getGridLogListArea(@Query("keywords") String key,
@Query("page") String page,
@Header("token") String token);
/**
* 根据区域code获取网格
*/
@Headers({"Content-Type: application/json", "Accept: application/json"})
@GET("app/grid/listpage/area-code/{areaCode}")
Observable<AreaGridListBean> getGridListByAreaCode(@Path("areaCode") String areaCode,
@Query("page") String page,
@Header("token") String token);
}

View File

@ -31,10 +31,11 @@
android:textColor="@color/black"
android:textSize="@dimen/text_16"
android:textStyle="bold" />
<View
android:layout_width="1dp"
android:background="@color/gray_line"
android:layout_height="match_parent"/>
android:layout_height="match_parent"
android:background="@color/gray_line" />
<TextView
android:id="@+id/tv_grid"
@ -72,8 +73,7 @@
android:clickable="true"
android:focusable="true"
android:gravity="center"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:padding="5dp"
android:textColor="@color/black"
android:textSize="12dp"
android:textStyle="bold"
@ -90,8 +90,7 @@
android:focusable="true"
android:gravity="center"
android:maxLines="1"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:padding="5dp"
android:text="旗县区"
android:textColor="@color/black"
android:textSize="12dp"
@ -108,8 +107,7 @@
android:focusable="true"
android:gravity="center"
android:maxLines="1"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:padding="5dp"
android:text="乡镇、街道"
android:textColor="@color/black"
android:textSize="12dp"
@ -125,8 +123,7 @@
android:focusable="true"
android:gravity="center"
android:maxLines="1"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:padding="5dp"
android:text="社区、村"
android:textColor="@color/black"
android:textSize="12dp"

View File

@ -1,9 +1,225 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activitys.logs.StatisticsCommandActivity">
android:background="@color/gray_fa"
android:clipChildren="true">
</androidx.constraintlayout.widget.ConstraintLayout>
<ImageView
android:id="@+id/iv_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:src="@drawable/ic_statis_title_bg" />
<RelativeLayout
android:id="@+id/rl_title"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginTop="30dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp"
android:src="@drawable/ic_back_white" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="统计分析"
android:textColor="@color/white"
android:textSize="15sp" />
</RelativeLayout>
<LinearLayout
android:id="@+id/ll_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/iv_title"
android:layout_marginLeft="15dp"
android:layout_marginTop="-80dp"
android:layout_marginRight="15dp"
android:background="@drawable/shape_rectangle_white_10"
android:gravity="center_vertical"
android:orientation="vertical"
android:padding="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<View
android:layout_width="2dp"
android:layout_height="15dp"
android:background="@color/main_theme" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="选择查询事件段"
android:textColor="@color/text_20"
android:textSize="13sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="开始时间"
android:textColor="@color/black"
android:textSize="14sp" />
<View
style="@style/vertical_line"
android:layout_marginLeft="5dp" />
<TextView
android:id="@+id/tv_start_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:drawableRight="@drawable/ic_arrow_cir"
android:focusable="true"
android:gravity="right"
android:hint="请选择开始时间"
android:textColor="@color/text_20"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="结束时间"
android:textColor="@color/black"
android:textSize="14sp" />
<View
style="@style/vertical_line"
android:layout_marginLeft="5dp" />
<TextView
android:id="@+id/tv_end_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:drawableRight="@drawable/ic_arrow_cir"
android:focusable="true"
android:gravity="right"
android:hint="请选择结束时间"
android:textColor="@color/text_20"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/ll_time"
android:orientation="vertical"
android:overScrollMode="never">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="20dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_rectangle_white_10"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="10dp">
<View
android:layout_width="2dp"
android:layout_height="15dp"
android:background="@color/main_theme" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:padding="5dp"
android:text="事件统计"
android:textColor="@color/text_20"
android:textSize="15sp" />
</LinearLayout>
<com.github.mikephil.charting.charts.BarChart
android:id="@+id/bc_case"
android:layout_width="match_parent"
android:layout_height="300dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="@drawable/shape_rectangle_white_10"
android:orientation="vertical"
android:paddingLeft="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<View
android:layout_width="2dp"
android:layout_height="15dp"
android:background="@color/main_theme" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:padding="5dp"
android:text="任务统计"
android:textColor="@color/text_20"
android:textSize="15sp" />
</LinearLayout>
<com.github.mikephil.charting.charts.BarChart
android:id="@+id/bc_task"
android:layout_width="match_parent"
android:layout_height="300dp" />
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>

View File

@ -64,7 +64,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="选择查询事件段"
android:text="选择查询时间段"
android:textColor="@color/text_20"
android:textSize="13sp" />
</LinearLayout>

View File

@ -149,6 +149,8 @@ public class MainTabActivity extends BaseActivity implements LoginView, LocalBro
mFragments = new ArrayList<>();
initContentView();
getAppConfig();
//不能拨打
getUserExpand();
startLocation();
checkAppVersion();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
@ -257,6 +259,65 @@ public class MainTabActivity extends BaseActivity implements LoginView, LocalBro
cloudLinkDialog.show();
}
private void getUserExpand() {
RetrofitManager.getInstance()
.create(BaseApiService.class)
.getUserExpandInfo(UserLgUtils.getUserId(), UserLgUtils.getToken())
.compose(RxTransformer.getTransformer())
.subscribe(new Observer<UserExpandInfoBean>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull UserExpandInfoBean userExpandInfoBean) {
UserLgUtils.setUserAreaCode("");
UserLgUtils.setUserAreaLevel(-1);
UserLgUtils.setUserFullAreaName("");
if (!TextUtils.isEmpty(userExpandInfoBean.getAreaCode())) {
String cityCode = userExpandInfoBean.getAreaCode().substring(0, 4);
String areaCode = userExpandInfoBean.getAreaCode().substring(0, 6);
String streetCode = userExpandInfoBean.getAreaCode().substring(0, 9);
String villageCode = userExpandInfoBean.getAreaCode();
UserLgUtils.setUserAreaCode(userExpandInfoBean.getAreaCode());
UserLgUtils.setUserAreaLevel(userExpandInfoBean.getUserLevel());
if (!TextUtils.isEmpty(userExpandInfoBean.getAreaName())) {
String areaName = userExpandInfoBean.getAreaName();
areaName = areaName.substring(areaName.lastIndexOf("/") + 1);
UserLgUtils.setUserAreaName(areaName);
UserLgUtils.setUserFullAreaName(userExpandInfoBean.getAreaName());
}
GlobalProvider.save(mActivity, "cityCode", cityCode);
GlobalProvider.save(mActivity, "areaCode", areaCode);
GlobalProvider.save(mActivity, "streetCode", streetCode);
GlobalProvider.save(mActivity, "villageCode", villageCode);
GlobalProvider.save(mActivity, "fullAreaCode", userExpandInfoBean.getAreaCode());
}
String ids = "";
List<UserExpandInfoBean.DepartmentsBean> departments = userExpandInfoBean.getDepartments();
for (int i = 0; i < departments.size(); i++) {
ids += departments.get(i).getDepartmentId() + ",";
}
if (ids.endsWith(",")) {
ids = ids.substring(0, ids.length() - 1);
}
UserLgUtils.setUserDeptId(ids);
}
@Override
public void onError(@NonNull Throwable e) {
}
@Override
public void onComplete() {
}
});
}
/**
* 获取用户拓展信息
*/
@ -282,6 +343,7 @@ public class MainTabActivity extends BaseActivity implements LoginView, LocalBro
String streetCode = userExpandInfoBean.getAreaCode().substring(0, 9);
String villageCode = userExpandInfoBean.getAreaCode();
UserLgUtils.setUserAreaCode(userExpandInfoBean.getAreaCode());
UserLgUtils.setUserAreaLevel(userExpandInfoBean.getUserLevel());
if (!TextUtils.isEmpty(userExpandInfoBean.getAreaName())) {
String areaName = userExpandInfoBean.getAreaName();
areaName = areaName.substring(areaName.lastIndexOf("/") + 1);
@ -293,7 +355,7 @@ public class MainTabActivity extends BaseActivity implements LoginView, LocalBro
GlobalProvider.save(mActivity, "streetCode", streetCode);
GlobalProvider.save(mActivity, "villageCode", villageCode);
GlobalProvider.save(mActivity, "fullAreaCode", userExpandInfoBean.getAreaCode());
UserLgUtils.setUserAreaLevel(userExpandInfoBean.getUserLevel());
}
LogUtils.e("融合通信号码==" + userExpandInfoBean.getSmcNumber() + "==" + userExpandInfoBean.getSmcPassword());
if (!TextUtils.isEmpty(userExpandInfoBean.getSmcNumber())) {

View File

@ -1,7 +1,10 @@
package com.tengshisoft.mainmodule.fragments;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.net.Uri;
import android.provider.Settings;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
@ -101,7 +104,7 @@ public class LeaderMainFragment extends BaseFragment {
"事件处理",
"通讯录",
"事件追踪",
"辖区人口",
"辖区人口"
};
private int[] mBtnIds = new int[]{
R.drawable.ic_incident_accept_icon,
@ -525,6 +528,12 @@ public class LeaderMainFragment extends BaseFragment {
.build(PathConfig.PATH_MODULE_COMMON_ACTIVITY_AREA_POPULACE_LIST)
.navigation();
break;
case "统计分析":
// ARouter.getInstance()
// .build(PathConfig.PATH_MODULE_COMMON_ACTIVITY_COMMAND_STATISTICS)
// .navigation();
break;
default:
break;
}