diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index a9ba253..cd3dc50 100755
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -48,6 +48,22 @@
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true"
tools:ignore="GoogleAppIndexingWarning">
+
+
+
+
mDatas;
- private NoticeAdapter mAdapter;
+ private NewNoticeAdapter mAdapter;
@Override
protected int setLayoutId() {
@@ -224,7 +227,7 @@ public class MainActivity extends BaseActivity {
}
}).request();
initBaseView();
-// getUserPenList();
+
registerGpsSignal();
registerGpsState();
getNoticeList();
@@ -516,6 +519,7 @@ public class MainActivity extends BaseActivity {
private void initBaseView() {
mGson = new Gson();
String loginInfo = UserLgUtils.getLoginInfo();
+ LogUtils.e("登录信息:" + loginInfo);
if (!TextUtils.isEmpty(loginInfo)) {
AppTokenUser appTokenUser = mGson.fromJson(loginInfo, AppTokenUser.class);
if (appTokenUser.getRoles() != null && appTokenUser.getRoles().size() > 0) {
@@ -546,7 +550,7 @@ public class MainActivity extends BaseActivity {
.placeholder(R.drawable.ic_user_default))
.into(mIvUserIcon);
mDatas = new ArrayList<>();
- mAdapter = new NoticeAdapter(mActivity, mDatas);
+ mAdapter = new NewNoticeAdapter(mActivity, mDatas);
mRlvNotice.setLayoutManager(new LinearLayoutManager(mActivity));
mRlvNotice.setAdapter(mAdapter);
mCsvNotice.setOnClickListener(v -> {
@@ -1299,6 +1303,7 @@ public class MainActivity extends BaseActivity {
R.id.ll_user_center,
R.id.ll_day_aviso,
R.id.ll_address_list,
+ R.id.rl_notice,
R.id.ll_case_record})
public void onViewClicked(View view) {
switch (view.getId()) {
@@ -1317,6 +1322,9 @@ public class MainActivity extends BaseActivity {
intent.putExtra("type", "type");
startActivity(intent);
break;
+ case R.id.rl_notice:
+ startActivity(new Intent(MainActivity.this, NoticeActivity.class));
+ break;
case R.id.ll_user_center://个人中心
startActivity(new Intent(MainActivity.this, UserActivity.class));
break;
@@ -1389,7 +1397,6 @@ public class MainActivity extends BaseActivity {
protected void onStart() {
super.onStart();
isForeground = true;
- checkAmSign();
if (mSignTimeBean != null) {
Intent intent = new Intent();
intent.setAction(PathConfig.ACTION_PUNCH_TIME_MESSAGE);
diff --git a/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/census/normal/CensusRegisterDetailActivity.java b/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/census/normal/CensusRegisterDetailActivity.java
index 51003c3..8fd4d88 100644
--- a/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/census/normal/CensusRegisterDetailActivity.java
+++ b/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/census/normal/CensusRegisterDetailActivity.java
@@ -13,6 +13,7 @@ import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
import com.sucstepsoft.realtimelocation.R;
import com.sucstepsoft.realtimelocation.activitys.census.special.CensusCorrctListActivity;
+import com.sucstepsoft.realtimelocation.activitys.census.special.CensusDisputeListActivity;
import com.sucstepsoft.realtimelocation.activitys.census.special.CensusDrugListActivity;
import com.sucstepsoft.realtimelocation.activitys.census.special.CensusHeresyListActivity;
import com.sucstepsoft.realtimelocation.activitys.census.special.CensusPetitionListActivity;
@@ -254,6 +255,8 @@ public class CensusRegisterDetailActivity extends BaseActivity {
startActivity(intent);
break;
case "3"://矛盾纠纷
+ intent.setClass(mActivity, CensusDisputeListActivity.class);
+ startActivity(intent);
break;
case "4"://社会治安
intent.setClass(mActivity, CensusSecurityListActivity.class);
diff --git a/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/census/special/CensusDisputeAddActivity.java b/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/census/special/CensusDisputeAddActivity.java
new file mode 100644
index 0000000..2993aec
--- /dev/null
+++ b/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/census/special/CensusDisputeAddActivity.java
@@ -0,0 +1,1156 @@
+package com.sucstepsoft.realtimelocation.activitys.census.special;
+
+import android.app.ProgressDialog;
+import android.content.Intent;
+import android.database.Cursor;
+import android.graphics.Color;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Environment;
+import android.provider.MediaStore;
+import android.support.annotation.Nullable;
+import android.support.v4.content.FileProvider;
+import android.support.v7.widget.GridLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
+import android.view.Gravity;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.Switch;
+import android.widget.TextView;
+import android.widget.ZoomControls;
+
+import com.baidu.mapapi.map.BaiduMap;
+import com.baidu.mapapi.map.BitmapDescriptor;
+import com.baidu.mapapi.map.BitmapDescriptorFactory;
+import com.baidu.mapapi.map.MapStatus;
+import com.baidu.mapapi.map.MapStatusUpdate;
+import com.baidu.mapapi.map.MapStatusUpdateFactory;
+import com.baidu.mapapi.map.MarkerOptions;
+import com.baidu.mapapi.map.OverlayOptions;
+import com.baidu.mapapi.map.TextureMapView;
+import com.baidu.mapapi.model.LatLng;
+import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
+import com.bigkoo.pickerview.builder.TimePickerBuilder;
+import com.bigkoo.pickerview.view.OptionsPickerView;
+import com.bigkoo.pickerview.view.TimePickerView;
+import com.google.gson.Gson;
+import com.sucstepsoft.cm_utils.constant.PathConfig;
+import com.sucstepsoft.cm_utils.core.beans.AddPhotoBean;
+import com.sucstepsoft.cm_utils.core.retrofit_net.BaseUrlApi;
+import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
+import com.sucstepsoft.cm_utils.core.widget.base.AddPhotoAdapter;
+import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
+import com.sucstepsoft.cm_utils.core.widget.views.AreaChooseDialog;
+import com.sucstepsoft.cm_utils.core.widget.views.ButtomDialogView;
+import com.sucstepsoft.cm_utils.utils.ProiderUtil;
+import com.sucstepsoft.cm_utils.utils.ToastUtils;
+import com.sucstepsoft.cm_utils.utils.UIUtil;
+import com.sucstepsoft.cm_utils.utils.UserLgUtils;
+import com.sucstepsoft.realtimelocation.R;
+import com.sucstepsoft.realtimelocation.activitys.common.PhotoActivity;
+import com.sucstepsoft.realtimelocation.activitys.issue.TakePointActivity;
+import com.sucstepsoft.realtimelocation.beans.BaseUserBean;
+import com.sucstepsoft.realtimelocation.beans.DicBean;
+import com.sucstepsoft.realtimelocation.beans.SuccessBean;
+import com.sucstepsoft.realtimelocation.beans.person.BaseRegisterDetailBean;
+import com.sucstepsoft.realtimelocation.beans.person.DisputeDetailBean;
+import com.sucstepsoft.realtimelocation.beans.person.SaveDisputeBean;
+import com.sucstepsoft.realtimelocation.net.LocationApiService;
+import com.sucstepsoft.realtimelocation.utils.ExceptionHandler;
+
+import java.io.File;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.Unbinder;
+import io.reactivex.Observer;
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.annotations.NonNull;
+import io.reactivex.disposables.Disposable;
+import io.reactivex.schedulers.Schedulers;
+import okhttp3.MediaType;
+import okhttp3.MultipartBody;
+import okhttp3.RequestBody;
+import top.zibin.luban.Luban;
+import top.zibin.luban.OnCompressListener;
+
+/**
+ * 矛盾纠纷
+ */
+public class CensusDisputeAddActivity extends BaseActivity {
+
+
+ @BindView(R.id.et_search_id_card)
+ EditText mEtSearchIdCard;
+ @BindView(R.id.iv_clear)
+ ImageView mIvClear;
+ @BindView(R.id.btn_search)
+ Button mBtnSearch;
+ @BindView(R.id.ll_search_content)
+ LinearLayout mLlSearchContent;
+ @BindView(R.id.tv_base_name)
+ TextView mTvBaseName;
+ @BindView(R.id.tv_base_gender)
+ TextView mTvBaseGender;
+ @BindView(R.id.tv_base_phone)
+ TextView mTvBasePhone;
+ @BindView(R.id.tv_base_native)
+ TextView mTvBaseNative;
+ @BindView(R.id.tv_base_cur_loc)
+ TextView mTvBaseCurLoc;
+ @BindView(R.id.cv_base_info)
+ LinearLayout mCvBaseInfo;
+ @BindView(R.id.et_case_name)
+ EditText mEtCaseName;
+ @BindView(R.id.et_case_title)
+ EditText mEtCaseTitle;
+ @BindView(R.id.tv_case_date)
+ TextView mTvCaseDate;
+ @BindView(R.id.tv_case_address)
+ TextView mTvCaseAddress;
+ @BindView(R.id.et_detail_address)
+ EditText mEtDetailAddress;
+ @BindView(R.id.tv_loc_lng)
+ TextView mTvLocLng;
+ @BindView(R.id.mp_view)
+ TextureMapView mMpView;
+ @BindView(R.id.tv_point)
+ TextView mTvPoint;
+ @BindView(R.id.tv_case_scale)
+ TextView mTvCaseScale;
+ @BindView(R.id.tv_case_type)
+ TextView mTvCaseType;
+ @BindView(R.id.tv_case_assess)
+ TextView mTvCaseAssess;
+ @BindView(R.id.tv_case_degree)
+ TextView mTvCaseDegree;
+ @BindView(R.id.tv_case_level)
+ TextView mTvCaseLevel;
+ @BindView(R.id.tv_dispute_type)
+ TextView mTvDisputeType;
+ @BindView(R.id.tv_dispute_level)
+ TextView mTvDisputeLevel;
+ @BindView(R.id.tv_risk_type)
+ TextView mTvRiskType;
+ @BindView(R.id.tv_risk_level)
+ TextView mTvRiskLevel;
+ @BindView(R.id.et_money)
+ EditText mEtMoney;
+ @BindView(R.id.et_person_num)
+ EditText mEtPersonNum;
+ @BindView(R.id.et_dept)
+ EditText mEtDept;
+ @BindView(R.id.tv_compose_date)
+ TextView mTvComposeDate;
+ @BindView(R.id.et_reason_other)
+ EditText mEtReasonOther;
+ @BindView(R.id.rlv_photo)
+ RecyclerView mRlvPhoto;
+ @BindView(R.id.tv_party_card_type)
+ TextView mTvPartyCardType;
+ @BindView(R.id.et_party_card_num)
+ EditText mEtPartyCardNum;
+ @BindView(R.id.et_party_name)
+ EditText mEtPartyName;
+ @BindView(R.id.et_party_phone)
+ EditText mEtPartyPhone;
+ @BindView(R.id.tv_party_sex)
+ TextView mTvPartySex;
+ @BindView(R.id.tv_party_nation)
+ TextView mTvPartyNation;
+ @BindView(R.id.tv_party_edu)
+ TextView mTvPartyEdu;
+ @BindView(R.id.tv_party_person_type)
+ TextView mTvPartyPersonType;
+ @BindView(R.id.tv_party_person_address)
+ TextView mTvPartyPersonAddress;
+ @BindView(R.id.tv_resolve_date)
+ TextView mTvResolveDate;
+ @BindView(R.id.tv_resolve_way)
+ TextView mTvResolveWay;
+ @BindView(R.id.et_resolve_dept)
+ EditText mEtResolveDept;
+ @BindView(R.id.et_resolve_name)
+ EditText mEtResolveName;
+ @BindView(R.id.et_resolve_id_card)
+ EditText mEtResolveIdCard;
+ @BindView(R.id.et_resolve_phone)
+ EditText mEtResolvePhone;
+ @BindView(R.id.sw_is_resolve)
+ Switch mSwIsResolve;
+ @BindView(R.id.et_resolve_result)
+ EditText mEtResolveResult;
+ @BindView(R.id.et_eva_advice)
+ EditText mEtEvaAdvice;
+ @BindView(R.id.tv_eva_date)
+ TextView mTvEvaDate;
+ @BindView(R.id.et_measure)
+ EditText mEtMeasure;
+ @BindView(R.id.et_work_record)
+ EditText mEtWorkRecord;
+ @BindView(R.id.et_party_b_name)
+ EditText mEtPartyBName;
+ @BindView(R.id.et_party_b_phone)
+ EditText mEtPartyBPhone;
+ @BindView(R.id.et_party_b_num)
+ EditText mEtPartyBNum;
+ @BindView(R.id.btn_confirm)
+ Button mBtnConfirm;
+ @BindView(R.id.ll_content)
+ LinearLayout mLlContent;
+ private Unbinder mBind;
+ private String mId;
+ private SimpleDateFormat mDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+ private OptionsPickerView mDicPicker;
+ private List mDicBeanList;
+
+ private DicBean mSelTalk;
+ private DicBean mSelCoordinate;
+
+ private String mSelAreaName = "";
+ private String mSelAreaCode = "";
+ private String mSelPartyAreaCode = "";
+ private String mSelPartyAreaName = "";
+ private String mSelLa;
+ private String mSelLo;
+ private BaiduMap mBaiduMap;
+ private LatLng mDefaultPoint;
+ private BitmapDescriptor mBitmapDescriptor;
+ private String mIdCard;
+ private BaseRegisterDetailBean mBaseInfoBean;
+ private List mPhotos = new ArrayList<>();
+ private AddPhotoBean mCurrentBean;
+ private String mPicPath;
+ private String mPhotoIds = "";//相片Id
+ private AddPhotoAdapter mPhotoAdapter;
+ private DicBean mSelResolveeWay;
+ private DicBean mSelRiskType;
+ private DicBean mSelRiskLevel;
+ private DicBean mSelDisputeLevel;
+ private DicBean mSelDisputeType;
+ private DicBean mSelCaseLevel;
+ private DicBean mSelCaseDegree;
+ private DicBean mSelCaseAssess;
+ private DicBean mSelCaseType;
+ private DicBean mSelCaseScale;
+
+ @Override
+ protected int setLayoutId() {
+ return R.layout.activity_census_dispute_add;
+ }
+
+ @Override
+ public void initData() {
+ mBind = ButterKnife.bind(this);
+ //主键
+ mId = getIntent().getStringExtra("id");
+ mIdCard = getIntent().getStringExtra("idCard");
+ String title = getIntent().getStringExtra("title");
+ if (!TextUtils.isEmpty(mId)) {
+ //编辑
+ refreshView(STATE_LOAD_LOADING);
+ getDetailById(mId);
+ } else {
+ //新增
+ refreshView(STATE_LOAD_SUCCESS);
+ }
+ mTvBaseTitle.setText(title);
+ initContentView();
+ getPersonDetail();
+ }
+
+ /**
+ * 获取人员详情
+ */
+ private void getPersonDetail() {
+ RetrofitManager.getInstance()
+ .create(LocationApiService.class)
+ .getBaseRegisterDetail(mIdCard, UserLgUtils.getToken())
+ .observeOn(AndroidSchedulers.mainThread())
+ .subscribeOn(Schedulers.io())
+ .subscribe(new Observer() {
+ @Override
+ public void onSubscribe(Disposable d) {
+
+ }
+
+ @Override
+ public void onNext(BaseRegisterDetailBean baseRegisterDetailBean) {
+ //设置基础信息
+ setBaseInfo(baseRegisterDetailBean);
+ refreshView(STATE_LOAD_SUCCESS);
+ }
+
+ @Override
+ public void onError(Throwable e) {
+ refreshView(STATE_LOAD_ERROR);
+ ExceptionHandler.handleException(e);
+ }
+
+ @Override
+ public void onComplete() {
+
+ }
+ });
+ }
+
+ /**
+ * 初始化
+ */
+ private void initContentView() {
+ mDefaultPoint = new LatLng(PathConfig.LA, PathConfig.LO);
+ mBaiduMap = mMpView.getMap();
+ MapStatus ms = new MapStatus.Builder().zoom(14).target(mDefaultPoint).build();
+ MapStatusUpdate u = MapStatusUpdateFactory.newMapStatus(ms);
+ View child = mMpView.getChildAt(1);
+ if (child != null && (child instanceof ImageView || child instanceof ZoomControls)) {
+ child.setVisibility(View.GONE);
+ }
+ mMpView.showZoomControls(false);
+ mBaiduMap.animateMapStatus(u);
+ mTvCaseDate.setOnClickListener(v -> onShowDate(mTvCaseDate));//发生日期
+ mTvCaseAddress.setOnClickListener(v -> onShowArea(1));//发生地点
+ mTvLocLng.setOnClickListener(v -> {
+ Intent intent = new Intent(mActivity, TakePointActivity.class);
+ startActivityForResult(intent, 1234);
+ });
+ mTvCaseScale.setOnClickListener(v -> onShowDicPicker(PathConfig.DIC_CASE_SCALE, 2, 1));//事件规模
+ mTvCaseType.setOnClickListener(v -> onShowDicPicker(PathConfig.DIC_CASE_CATE, 2, 2));//事件类别
+ mTvCaseAssess.setOnClickListener(v -> onShowDicPicker(PathConfig.DIC_CASE_ASSESS, 2, 3));//事件评估
+ mTvCaseDegree.setOnClickListener(v -> onShowDicPicker(PathConfig.DIC_CASE_DEGREE, 2, 4));//激烈程度
+ mTvCaseLevel.setOnClickListener(v -> onShowDicPicker(PathConfig.DIC_CASE_LEVEL, 2, 5));//预警等级
+ mTvDisputeType.setOnClickListener(v -> onShowDicPicker(PathConfig.DIC_DISPUTE_TYPE, 2, 6));//纠纷类型
+ mTvDisputeLevel.setOnClickListener(v -> onShowDicPicker(PathConfig.DIC_DISPUTE_LEVEL, 2, 7));//纠纷等级
+ mTvRiskType.setOnClickListener(v -> onShowDicPicker(PathConfig.DIC_RISK_TYPE, 2, 8));//风险类型
+ mTvRiskLevel.setOnClickListener(v -> onShowDicPicker(PathConfig.DIC_RISK_LEVEL, 2, 9));//风险类型
+ mTvComposeDate.setOnClickListener(v -> onShowDate(mTvComposeDate));//最后调解日期
+ mTvPartySex.setOnClickListener(v -> onShowDicPicker(PathConfig.DIC_GENDER, 2, 10));//当事人性别
+ mTvPartyNation.setOnClickListener(v -> onShowDicPicker(PathConfig.DIC_NATION, 2, 11));//当事人民族
+ mTvPartyEdu.setOnClickListener(v -> onShowDicPicker(PathConfig.DIC_EDU, 2, 12));//当事人文化程度
+ mTvPartyPersonType.setOnClickListener(v -> onShowDicPicker(PathConfig.DIC_PERSON_TYPE, 2, 13));//当事人类别
+ mTvPartyPersonAddress.setOnClickListener(v -> onShowArea(2));
+ mTvResolveDate.setOnClickListener(v -> onShowDate(mTvResolveDate));//化解日期
+ mTvResolveWay.setOnClickListener(v -> onShowDicPicker(PathConfig.DIC_RESOLVE_WAY, 2, 14));//化解方式
+ mTvEvaDate.setOnClickListener(v -> onShowDate(mTvEvaDate));//考评日期
+
+ mPhotos.add(new AddPhotoBean());
+ mPhotoAdapter = new AddPhotoAdapter(CensusDisputeAddActivity.this, mPhotos);
+ mRlvPhoto.setLayoutManager(new GridLayoutManager(mActivity, 4));
+ mRlvPhoto.setAdapter(mPhotoAdapter);
+ //删除上传的相片
+ mPhotoAdapter.addOnDeleteListener(((bean, i) -> {
+ mPhotoAdapter.removeItem(bean);
+ mPhotoIds = mPhotoIds.replace(bean.getId() + ",", "");
+ }));
+ mPhotoAdapter.addOnItemClickListener(bean -> {
+ if (TextUtils.isEmpty(bean.getPath())) {
+ //空数据
+ showSelectPhoto(bean);
+ } else {
+ //预览
+ ArrayList list = new ArrayList<>();
+ list.add(bean.getPath());
+ Intent intent = new Intent();
+ intent.putExtra(PhotoActivity.TAG_IMGURL, list);
+ intent.setClass(CensusDisputeAddActivity.this, PhotoActivity.class);
+ startActivity(intent);
+ }
+ });
+
+
+ mBtnConfirm.setOnClickListener(v -> doSubmit());
+ }
+
+ /**
+ * 显示选择图片
+ *
+ * @param bean
+ */
+ private void showSelectPhoto(AddPhotoBean bean) {
+ hideSoftKeyboard();
+ ButtomDialogView buttomDialogView = new ButtomDialogView.DialogBuilder(mActivity)
+ .setIsBackCancelable(true)
+ .setIscancelable(true)
+ .setShowLocation(Gravity.BOTTOM)
+ .setIsShowFile(false)
+ .build();
+ buttomDialogView.addOnChoseListener(new ButtomDialogView.OnChoseListener() {
+ @Override
+ public void choseFile() {
+ }
+
+ @Override
+ public void choseAlbum() {
+ mCurrentBean = bean;
+ Intent intent = new Intent(Intent.ACTION_PICK, null);
+ intent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
+ "image/*");
+ startActivityForResult(intent, BaseUrlApi.PHOTO_REQUEST);
+ buttomDialogView.dismiss();
+ }
+
+ @Override
+ public void choseShoot() {
+ mCurrentBean = bean;
+ String pathStr = getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath() + PathConfig.CATCH_PATH;
+ mPicPath = pathStr + System.currentTimeMillis() + ".jpg";
+ File file = new File(mPicPath);
+ Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
+ // 下面这句指定调用相机拍照后的照片存储的路径
+ Uri uri;
+ if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.M) {
+ uri = Uri.fromFile(file);
+ } else {
+ uri = FileProvider.getUriForFile(mActivity, ProiderUtil.getFileProviderName(mActivity), file);
+ }
+ intent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
+ startActivityForResult(intent, BaseUrlApi.CAMERA_REQUEST);
+ }
+
+ @Override
+ public void loginOut() {
+
+ }
+
+ @Override
+ public void changePwd() {
+
+ }
+ });
+ buttomDialogView.show();
+ }
+
+ @Override
+ protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
+ if (resultCode == RESULT_OK) {
+ switch (requestCode) {
+ case BaseUrlApi.CAMERA_REQUEST://相机
+ uploadImg(mPicPath, 1);
+ break;
+ case BaseUrlApi.PHOTO_REQUEST://相册
+ try {
+ if (data == null) return;
+ Uri uri = data.getData();
+ String[] proj = {MediaStore.Images.Media.DATA};
+ Cursor cursor = managedQuery(uri, proj, null, null, null);
+ int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
+ cursor.moveToFirst();
+ String srcPath = cursor.getString(column_index);
+ uploadImg(srcPath, 2);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ break;
+ case 1234:
+ String lo = data.getStringExtra("lo");
+ String la = data.getStringExtra("la");
+ String address = data.getStringExtra("address");
+ mSelLa = la;
+ mSelLo = lo;
+ mTvPoint.setText("经纬度:" + mSelLa + "-" + mSelLo);
+ Double laD = Double.parseDouble(la);
+ Double loD = Double.parseDouble(lo);
+ addMarker(new LatLng(laD, loD));
+ mEtDetailAddress.setText(address);
+ break;
+ }
+ }
+ super.onActivityResult(requestCode, resultCode, data);
+ }
+
+
+ /**
+ * 上传文件
+ *
+ * @param picPath
+ */
+ private void uploadImg(String picPath, int src) {
+ File file = new File(picPath);
+ if (!file.exists()) {
+ showToast("图片路径错误.");
+ return;
+ }
+ ProgressDialog progressDialog = UIUtil.initDialog(mActivity, "正在上传...");
+ progressDialog.show();
+ String pathStr = getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath() + PathConfig.CATCH_PATH;
+ Luban.with(mActivity)
+ .load(picPath)
+ .ignoreBy(100)
+ .setTargetDir(pathStr)
+ .filter(path -> !(TextUtils.isEmpty(path) || path.toLowerCase().endsWith(".gif")))
+ .setCompressListener(new OnCompressListener() {
+ @Override
+ public void onStart() {
+
+ }
+
+ @Override
+ public void onSuccess(File file) {
+ RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), file);
+ MultipartBody.Part body = MultipartBody.Part.createFormData("image", file.getName(), requestFile);
+ RetrofitManager.getInstance()
+ .create(LocationApiService.class)
+ .uploadImage(body, UserLgUtils.getToken())
+ .subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread())
+ .subscribe(new Observer() {
+ @Override
+ public void onSubscribe(Disposable d) {
+
+ }
+
+ @Override
+ public void onNext(BaseUserBean baseUserBean) {
+ if (progressDialog != null && progressDialog.isShowing()) {
+ progressDialog.dismiss();
+ }
+ ToastUtils.showShort("上传成功");
+ mPhotoIds += (baseUserBean.getData() + ",");
+ mCurrentBean.setId(baseUserBean.getData());
+ mCurrentBean.setPath(picPath);
+ if (mPhotos.size() < 4) {
+ mPhotos.add(new AddPhotoBean());
+ }
+ mPhotoAdapter.notifyDataSetChanged();
+ mCurrentBean = null;
+ }
+
+ @Override
+ public void onError(Throwable e) {
+ if (progressDialog != null && progressDialog.isShowing()) {
+ progressDialog.dismiss();
+ }
+ ToastUtils.showShort("上传失败,请稍后重试.");
+ if (file.exists()) {
+ file.delete();
+ }
+ }
+
+ @Override
+ public void onComplete() {
+
+ }
+ });
+ }
+
+ @Override
+ public void onError(Throwable e) {
+ if (progressDialog.isShowing()) {
+ progressDialog.dismiss();
+ }
+ ToastUtils.showShort("图片上传失败,请稍后重试");
+ }
+ })
+ .launch();
+ }
+
+ /**
+ * 添加marker
+ *
+ * @param latLng
+ */
+ private void addMarker(LatLng latLng) {
+ mBaiduMap.clear();
+ mBitmapDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.ic_map_marker);
+ OverlayOptions option = new MarkerOptions()
+ .position(latLng)
+ .icon(mBitmapDescriptor)
+ .animateType(MarkerOptions.MarkerAnimateType.drop);
+ mBaiduMap.addOverlay(option);
+ MapStatus ms = new MapStatus.Builder().zoom(14).target(latLng).build();
+ MapStatusUpdate u = MapStatusUpdateFactory.newMapStatus(ms);
+ mBaiduMap.animateMapStatus(u);
+ }
+
+
+ /**
+ * 地区选择
+ */
+ private void onShowArea(int i) {
+ AreaChooseDialog dialog = new AreaChooseDialog
+ .DialogBuilder(mActivity)
+ .setDefault(true)
+ .build();
+ dialog.addOnChoseListener((names, id, code) -> {
+ if (i == 1) {
+ mSelAreaCode = code;
+ mSelAreaName = names;
+ mTvCaseAddress.setText(names);
+ } else {
+ mSelPartyAreaCode = code;
+ mSelPartyAreaName = names;
+ mTvPartyPersonAddress.setText(names);
+ }
+ dialog.dismiss();
+ });
+ dialog.show();
+ }
+
+ private void onShowDicPicker(String id, int type, int source) {
+ hideSoftKeyboard();
+ if (type == 1) {
+ mDicPicker = new OptionsPickerBuilder(mActivity, (o1, o2, o3, v) -> {
+ DicBean dicBean = mDicBeanList.get(o1);
+ chooseDic(dicBean, source);
+ })
+ .setTitleText("请选择")
+ .setCancelColor(Color.parseColor("#1189FF"))
+ .setSubmitColor(Color.parseColor("#1189FF"))
+ .setTitleColor(Color.parseColor("#1189FF"))
+ .build();
+ mDicPicker.setPicker(mDicBeanList);
+ mDicPicker.show();
+ } else {
+ getDicListByType(id, type, source);
+ }
+ }
+
+ /**
+ * 确认字典
+ *
+ * @param source
+ */
+ private void chooseDic(DicBean dicBean, int source) {
+ switch (source) {
+ case 1://事件规模
+ mSelCaseScale = dicBean;
+ mTvCaseScale.setText(dicBean.getDictionaryName());
+ break;
+ case 2://事件类别
+ mSelCaseType = dicBean;
+ mTvCaseType.setText(dicBean.getDictionaryName());
+ break;
+ case 3://事件评估
+ mSelCaseAssess = dicBean;
+ mTvCaseAssess.setText(dicBean.getDictionaryName());
+ break;
+ case 4://激烈程度
+ mSelCaseDegree = dicBean;
+ mTvCaseDegree.setText(dicBean.getDictionaryName());
+ break;
+ case 5://预警等级
+ mSelCaseLevel = dicBean;
+ mTvCaseLevel.setText(dicBean.getDictionaryName());
+ break;
+ case 6://纠纷类型
+ mSelDisputeType = dicBean;
+ mTvDisputeType.setText(dicBean.getDictionaryName());
+ break;
+ case 7://纠纷等级
+ mSelDisputeLevel = dicBean;
+ mTvDisputeLevel.setText(dicBean.getDictionaryName());
+ break;
+ case 8://风险类型
+ mSelRiskType = dicBean;
+ mTvRiskType.setText(dicBean.getDictionaryName());
+ break;
+ case 9://风险等级
+ mSelRiskLevel = dicBean;
+ mTvRiskLevel.setText(dicBean.getDictionaryName());
+ break;
+ case 10://当事人性别
+ mTvPartySex.setText(dicBean.getDictionaryName());
+ break;
+ case 11://当事人民族
+ mTvPartyNation.setText(dicBean.getDictionaryName());
+ break;
+ case 12://当事人文化程度
+ mTvPartyEdu.setText(dicBean.getDictionaryName());
+ break;
+ case 13://当事人类别
+ mTvPartyPersonType.setText(dicBean.getDictionaryName());
+ break;
+ case 14://化解方式
+ mSelResolveeWay = dicBean;
+ mTvResolveWay.setText(dicBean.getDictionaryName());
+ break;
+ }
+ }
+
+
+ private void getDicListByType(String pId, int i, int source) {
+ ProgressDialog dialog = UIUtil.initDialog(mActivity, "获取中...");
+ dialog.show();
+ RetrofitManager.getInstance()
+ .create(LocationApiService.class)
+ .getDictListAllByPid(pId, UserLgUtils.getToken())
+ .subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread())
+ .subscribe(new Observer>() {
+ @Override
+ public void onSubscribe(@NonNull Disposable d) {
+
+ }
+
+ @Override
+ public void onNext(@NonNull List l) {
+ dialog.dismiss();
+ if (l != null && l.size() > 0) {
+ mDicBeanList = l;
+ onShowDicPicker(pId, 1, source);
+ } else {
+ ToastUtils.showShort("暂无数据");
+ }
+ }
+
+ @Override
+ public void onError(@NonNull Throwable e) {
+ dialog.dismiss();
+ ExceptionHandler.handleException(e);
+ }
+
+ @Override
+ public void onComplete() {
+
+ }
+ });
+
+ }
+
+
+ private void onShowDate(TextView i) {
+ hideSoftKeyboard();
+ TimePickerView mTimePickerView = new TimePickerBuilder(mActivity, (date, v) -> {
+ i.setText(mDateFormat.format(date));
+ })
+ .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 doAdd() {
+ ProgressDialog dialog = UIUtil.initDialog(mActivity, "保存中...");
+ dialog.show();
+ RequestBody body = buildParams();
+ RetrofitManager.getInstance()
+ .create(LocationApiService.class)
+ .doSaveDispute(body, UserLgUtils.getToken())
+ .subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread())
+ .subscribe(new Observer() {
+ @Override
+ public void onSubscribe(@NonNull Disposable d) {
+
+ }
+
+ @Override
+ public void onNext(@NonNull SuccessBean successBean) {
+ dialog.dismiss();
+ ToastUtils.showShort("新增成功");
+ finish();
+ }
+
+ @Override
+ public void onError(@NonNull Throwable e) {
+ dialog.dismiss();
+ ExceptionHandler.handleException(e);
+ }
+
+ @Override
+ public void onComplete() {
+
+ }
+ });
+
+ }
+
+ private void doSubmit() {
+ if (checkParams()) {
+ if (!TextUtils.isEmpty(mId)) {
+ doEdit();
+ } else {
+ doAdd();
+ }
+ }
+ }
+
+ /**
+ * 编辑
+ */
+ private void doEdit() {
+ ProgressDialog dialog = UIUtil.initDialog(mActivity, "修改中...");
+ dialog.show();
+ RequestBody body = buildParams();
+ RetrofitManager.getInstance()
+ .create(LocationApiService.class)
+ .doEditDispute(mId, body, UserLgUtils.getToken())
+ .subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread())
+ .subscribe(new Observer() {
+ @Override
+ public void onSubscribe(@NonNull Disposable d) {
+
+ }
+
+ @Override
+ public void onNext(@NonNull SuccessBean successBean) {
+ dialog.dismiss();
+ ToastUtils.showShort("修改成功");
+ finish();
+ }
+
+ @Override
+ public void onError(@NonNull Throwable e) {
+ dialog.dismiss();
+ ExceptionHandler.handleException(e);
+ }
+
+ @Override
+ public void onComplete() {
+
+ }
+ });
+ }
+
+ private RequestBody buildParams() {
+ SaveDisputeBean bean = new SaveDisputeBean();
+ bean.setPartyPopulationInfoId(mBaseInfoBean.getPopulationInfoId());
+ String caseName = mEtCaseName.getText().toString().trim();
+ bean.setCaseName(caseName);
+ String caseTitle = mEtCaseTitle.getText().toString().trim();
+ bean.setCaseTitle(caseTitle);
+ String caseDate = mTvCaseDate.getText().toString().trim();
+ bean.setCaseTime(caseDate);
+ String caseAddress = mTvCaseAddress.getText().toString().trim();
+ bean.setCaseAddress(caseAddress);
+ bean.setCaseAreaCode(mSelAreaCode);
+ bean.setCaseAreaName(mSelAreaName);
+ String detailAddress = mEtDetailAddress.getText().toString().trim();
+ bean.setCaseMapAddress(detailAddress);
+ bean.setCaseLat(mSelLa);
+ bean.setCaseLng(mSelLo);
+ if (mSelCaseScale != null) {
+ bean.setCaseScale(mSelCaseScale.getDictionaryId());
+ }
+ if (mSelCaseType != null) {
+ bean.setCaseType(mSelCaseType.getDictionaryId());
+ }
+
+ if (mSelCaseAssess != null) {
+ bean.setCaseEstimate(mSelCaseAssess.getDictionaryId());
+ }
+ if (mSelCaseDegree != null) {
+ bean.setCaseDegree(mSelCaseDegree.getDictionaryId());
+ }
+ if (mSelCaseLevel != null) {
+ bean.setCaseLevel(mSelCaseLevel.getDictionaryId());
+ }
+ if (mSelDisputeType != null) {
+ bean.setDisputeType(mSelDisputeType.getDictionaryId());
+ }
+ if (mSelDisputeLevel != null) {
+ bean.setDisputeLevel(mSelDisputeLevel.getDictionaryId());
+ }
+ if (mSelRiskType != null) {
+ bean.setRiskType(mSelRiskType.getDictionaryId());
+ }
+ if (mSelRiskLevel != null) {
+ bean.setRiskLevel(mSelRiskLevel.getDictionaryId());
+ }
+ String money = mEtMoney.getText().toString().trim();
+ bean.setDisputeMoney(money);
+ String num = mEtPersonNum.getText().toString().trim();
+ bean.setDisputeNumber(num);
+ String dept = mEtDept.getText().toString().trim();
+ bean.setDisputeOrganization(dept);
+ String composeDate = mTvComposeDate.getText().toString().trim();
+ bean.setMediateLastTime(composeDate);
+ String reasonOther = mEtReasonOther.getText().toString().trim();
+ bean.setCaseDescription(reasonOther);
+ String ids = "";
+ for (int i = 0; i < mPhotoAdapter.getData().size(); i++) {
+ if (!TextUtils.isEmpty(mPhotoAdapter.getData().get(i).getId())) {
+ ids += mPhotoAdapter.getData().get(i).getId() + ",";
+ }
+ }
+ if (ids.endsWith(",")) {
+ ids = ids.substring(0, ids.length() - 1);
+ }
+ bean.setCaseImages(ids);
+ String cardType = mTvPartyCardType.getText().toString().trim();
+ bean.setPartyIdcardType(cardType);
+ String cardNum = mEtPartyCardNum.getText().toString().trim();
+ bean.setPartyIdcard(cardNum);
+ String partyName = mEtPartyName.getText().toString().trim();
+ bean.setPartyName(partyName);
+ String partyPhone = mEtPartyPhone.getText().toString().trim();
+ bean.setPartyPhone(partyPhone);
+ String partySex = mTvPartySex.getText().toString().trim();
+ bean.setPartySex(partySex);
+ String partyNation = mTvPartyNation.getText().toString().trim();
+ bean.setPartyNation(partyNation);
+ String partyPersonType = mTvPartyPersonType.getText().toString().trim();
+ bean.setPartyType(partyPersonType);
+ String partyPersonAddress = mTvPartyPersonAddress.getText().toString().trim();
+ bean.setPartyAddress(mSelPartyAreaName);
+ bean.setPartyAreaCode(mSelPartyAreaCode);
+ bean.setPartyAreaName(mSelPartyAreaName);
+ String resolveDate = mTvResolveDate.getText().toString().trim();
+ bean.setDefuseTime(resolveDate);
+ if (mSelResolveeWay != null) {
+ bean.setDefuseWay(mSelResolveeWay.getDictionaryId());
+ }
+ String edu = mTvPartyEdu.getText().toString().trim();
+ bean.setPartyEducation(edu);
+ String resolveDept = mEtResolveDept.getText().toString().trim();
+ bean.setDefuseOrganization(resolveDept);
+ String defuseName = mEtResolveName.getText().toString().trim();
+ bean.setDefuseResponsibleName(defuseName);
+ String resolveIdCard = mEtResolveIdCard.getText().toString().trim();
+ bean.setDefuseResponsibleIdcard(resolveIdCard);
+ String resolvePhone = mEtResolvePhone.getText().toString().trim();
+ bean.setDefuseResponsiblePhone(resolvePhone);
+ bean.setDefuseStatus(mSwIsResolve.isChecked() ? "是" : "否");
+ String defuseResult = mEtResolveResult.getText().toString().trim();
+ bean.setDefuseDescription(defuseResult);
+ String evaAdvice = mEtEvaAdvice.getText().toString().trim();
+ bean.setEvaluationOpinion(evaAdvice);
+ String evaDate = mTvEvaDate.getText().toString().trim();
+ bean.setEvaluationTime(evaDate);
+ String measure = mEtMeasure.getText().toString().trim();
+ bean.setMeasureDescription(measure);
+ String workRecord = mEtWorkRecord.getText().toString().trim();
+ bean.setRecordDescription(workRecord);
+ String partyBNum = mEtPartyBNum.getText().toString().trim();
+ bean.setPartybIdcard(partyBNum);
+ String partyBPhone = mEtPartyBPhone.getText().toString().trim();
+ bean.setPartybPhone(partyBPhone);
+ String partyBName = mEtPartyBName.getText().toString().trim();
+ bean.setPartybName(partyBName);
+ Gson gson = new Gson();
+ String obj = gson.toJson(bean);
+ RequestBody requestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
+ return requestBody;
+ }
+
+ /**
+ * 校验参数
+ */
+ private boolean checkParams() {
+ String caseName = mEtCaseName.getText().toString().trim();
+ if (TextUtils.isEmpty(caseName)) {
+ ToastUtils.showShort("请输入事件名称");
+ return false;
+ }
+ String caseTitle = mEtCaseTitle.getText().toString().trim();
+ if (TextUtils.isEmpty(caseTitle)) {
+ ToastUtils.showShort("请输入事件标题");
+ return false;
+ }
+ String caseDate = mTvCaseDate.getText().toString().trim();
+ if (TextUtils.isEmpty(caseDate)) {
+ ToastUtils.showShort("请选择发生日期");
+ return false;
+ }
+ String caseAddress = mTvCaseAddress.getText().toString().trim();
+ if (TextUtils.isEmpty(caseAddress)) {
+ ToastUtils.showShort("请选择发生地点");
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * 获取详情
+ */
+ private void getDetailById(String id) {
+ RetrofitManager.getInstance()
+ .create(LocationApiService.class)
+ .getDisputeDetailById(id, UserLgUtils.getToken())
+ .subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread())
+ .subscribe(new Observer() {
+ @Override
+ public void onSubscribe(@NonNull Disposable d) {
+
+ }
+
+ @Override
+ public void onNext(@NonNull DisputeDetailBean censusCrimeDetailBean) {
+ setDataToView(censusCrimeDetailBean, 0);
+ }
+
+ @Override
+ public void onError(@NonNull Throwable e) {
+ ExceptionHandler.handleException(e);
+ refreshView(STATE_LOAD_ERROR);
+ }
+
+ @Override
+ public void onComplete() {
+
+ }
+ });
+ }
+
+ /**
+ * 回填数据
+ */
+ private void setDataToView(DisputeDetailBean bean, int type) {
+ mId = bean.getDisputeId();
+ mEtCaseName.setText(bean.getCaseName());
+ mEtCaseTitle.setText(bean.getCaseTitle());
+ mTvCaseDate.setText(bean.getCaseTime());
+ mTvCaseAddress.setText(bean.getCaseAddress());
+ mSelAreaCode = bean.getCaseAreaCode();
+ mSelAreaName = bean.getCaseAreaName();
+ mEtDetailAddress.setText(bean.getCaseMapAddress());
+ mSelLa = bean.getCaseLat();
+ mSelLo = bean.getCaseLng();
+ if (!TextUtils.isEmpty(bean.getCaseLat()) && !TextUtils.isEmpty(bean.getCaseLng())) {
+ Double lat = Double.parseDouble(bean.getCaseLat());
+ Double lng = Double.parseDouble(bean.getCaseLng());
+ addMarker(new LatLng(lat, lng));
+ mTvPoint.setText("经纬度:" + mSelLa + "-" + mSelLo);
+ }
+ if (!TextUtils.isEmpty(bean.getCaseScale())) {
+ mSelCaseScale = new DicBean();
+ mSelCaseScale.setDictionaryName(bean.getCaseScaleName());
+ mSelCaseScale.setDictionaryId(bean.getCaseScale());
+ mTvCaseScale.setText(bean.getCaseScaleName());
+ }
+ if (!TextUtils.isEmpty(bean.getCaseType())) {
+ mSelCaseType = new DicBean();
+ mSelCaseType.setDictionaryName(bean.getCaseTypeName());
+ mSelCaseType.setDictionaryId(bean.getCaseType());
+ mTvCaseType.setText(bean.getCaseTypeName());
+ }
+ if (!TextUtils.isEmpty(bean.getCaseEstimate())) {
+ mSelCaseAssess = new DicBean();
+ mSelCaseAssess.setDictionaryId(bean.getCaseEstimate());
+ mSelCaseAssess.setDictionaryName(bean.getCaseEstimateName());
+ mTvCaseAssess.setText(bean.getCaseEstimateName());
+ }
+ if (!TextUtils.isEmpty(bean.getCaseDegree())) {
+ mSelCaseDegree = new DicBean();
+ mSelCaseDegree.setDictionaryId(bean.getCaseDegree());
+ mSelCaseDegree.setDictionaryName(bean.getCaseDegreeName());
+ mTvCaseDegree.setText(bean.getCaseDegreeName());
+ }
+ if (!TextUtils.isEmpty(bean.getCaseLevel())) {
+ mSelCaseLevel = new DicBean();
+ mSelCaseLevel.setDictionaryId(bean.getCaseLevel());
+ mSelCaseLevel.setDictionaryName(bean.getCaseLevelName());
+ mTvCaseLevel.setText(bean.getCaseLevelName());
+ }
+ if (!TextUtils.isEmpty(bean.getDisputeType())) {
+ mSelDisputeType = new DicBean();
+ mSelDisputeType.setDictionaryId(bean.getDisputeType());
+ mSelDisputeType.setDictionaryName(bean.getDisputeTypeName());
+ mTvDisputeType.setText(bean.getDisputeTypeName());
+ }
+ if (!TextUtils.isEmpty(bean.getDisputeLevel())) {
+ mSelDisputeLevel = new DicBean();
+ mSelDisputeLevel.setDictionaryId(bean.getDisputeLevel());
+ mSelDisputeLevel.setDictionaryName(bean.getDisputeLevelName());
+ mTvDisputeLevel.setText(bean.getDisputeLevelName());
+ }
+ if (!TextUtils.isEmpty(bean.getRiskType())) {
+ mSelRiskType = new DicBean();
+ mSelRiskType.setDictionaryName(bean.getRiskTypeName());
+ mSelRiskType.setDictionaryId(bean.getRiskType());
+ mTvRiskType.setText(bean.getRiskTypeName());
+ }
+
+ if (!TextUtils.isEmpty(bean.getRiskLevel())) {
+ mSelRiskLevel = new DicBean();
+ mSelRiskLevel.setDictionaryName(bean.getRiskLevelName());
+ mSelRiskLevel.setDictionaryId(bean.getRiskLevel());
+ mTvRiskLevel.setText(bean.getRiskLevelName());
+ }
+
+ mEtMoney.setText(bean.getDisputeMoney());
+ mEtPersonNum.setText(bean.getDisputeNumber());
+ mEtDept.setText(bean.getDisputeOrganization());
+ mTvComposeDate.setText(bean.getMediateLastTime());
+ mEtReasonOther.setText(bean.getCaseDescription());
+ if (!TextUtils.isEmpty(bean.getCaseImages())) {
+ String[] photos = bean.getCaseImages().split(",");
+ mPhotos.clear();
+ for (int i = 0; i < photos.length; i++) {
+ AddPhotoBean pBean = new AddPhotoBean();
+ pBean.setId(photos[i]);
+ pBean.setPath(BaseUrlApi.BASE_IMG_URL + photos[i]);
+ mPhotos.add(pBean);
+ }
+ mPhotoAdapter.setData(mPhotos);
+ }
+ mTvPartyCardType.setText(bean.getPartyIdcardType());
+ mEtPartyCardNum.setText(bean.getPartyIdcard());
+ mEtPartyName.setText(bean.getPartyName());
+ mEtPartyPhone.setText(bean.getPartyPhone());
+ mTvPartySex.setText(bean.getPartySex());
+ mTvPartyNation.setText(bean.getPartyNation());
+ mTvPartyPersonType.setText(bean.getPartyType());
+ mTvPartyEdu.setText(bean.getPartyEducation());
+ mTvPartyPersonAddress.setText(bean.getPartyAddress());
+ mSelPartyAreaName = bean.getPartyAddress();
+ mSelPartyAreaCode = bean.getPartyAreaCode();
+ mTvResolveDate.setText(bean.getDefuseTime());
+ if (!TextUtils.isEmpty(bean.getDefuseWay())) {
+ mSelResolveeWay = new DicBean();
+ mSelResolveeWay.setDictionaryName(bean.getDefuseWayName());
+ mSelResolveeWay.setDictionaryId(bean.getDefuseWay());
+ mTvResolveWay.setText(bean.getDefuseWayName());
+ }
+ mEtResolveDept.setText(bean.getDefuseOrganization());
+ mEtResolveName.setText(bean.getDefuseResponsibleName());
+ mEtResolveIdCard.setText(bean.getDefuseResponsibleIdcard());
+ mEtResolvePhone.setText(bean.getDefuseResponsiblePhone());
+ mSwIsResolve.setChecked("是".equals(bean.getDefuseStatus()));
+ mEtResolveResult.setText(bean.getDefuseDescription());
+ mEtEvaAdvice.setText(bean.getEvaluationOpinion());
+ mTvEvaDate.setText(bean.getEvaluationTime());
+ mEtMeasure.setText(bean.getMeasureDescription());
+ mEtWorkRecord.setText(bean.getRecordDescription());
+ mEtPartyBNum.setText(bean.getPartybIdcard());
+ mEtPartyBPhone.setText(bean.getPartybPhone());
+ mEtPartyBName.setText(bean.getPartybName());
+ refreshView(STATE_LOAD_SUCCESS);
+ }
+
+ /**
+ * 设置基础信息
+ */
+ private void setBaseInfo(BaseRegisterDetailBean o) {
+ mBaseInfoBean = o;
+ mLlContent.setVisibility(View.VISIBLE);
+ mTvBaseName.setText(o.getName());
+ mTvBaseGender.setText(o.getSex());
+ mTvBasePhone.setText(o.getPhone());
+ mTvBaseNative.setText(o.getOriginAddress());
+ mTvBaseCurLoc.setText(o.getDomicileAreaName() + "/" + o.getDomicileAddress());
+ if (TextUtils.isEmpty(mId)) {
+ mTvPartyCardType.setText(o.getIdcardType());
+ mEtPartyName.setText(o.getName());
+ mEtPartyPhone.setText(o.getPhone());
+ mEtPartyCardNum.setText(o.getIdcard());
+ mTvPartySex.setText(o.getSex());
+ mTvPartyNation.setText(o.getNation());
+ mTvPartyEdu.setText(o.getEducation());
+ }
+ }
+
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ if (mBind != null) {
+ mBind.unbind();
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/census/special/CensusDisputeDetailActivity.java b/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/census/special/CensusDisputeDetailActivity.java
new file mode 100644
index 0000000..d3b35c7
--- /dev/null
+++ b/app/src/main/java/com/sucstepsoft/realtimelocation/activitys/census/special/CensusDisputeDetailActivity.java
@@ -0,0 +1,395 @@
+package com.sucstepsoft.realtimelocation.activitys.census.special;
+
+import android.content.Intent;
+import android.support.v7.widget.GridLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.Switch;
+import android.widget.TextView;
+import android.widget.ZoomControls;
+
+import com.baidu.mapapi.map.BaiduMap;
+import com.baidu.mapapi.map.BitmapDescriptor;
+import com.baidu.mapapi.map.BitmapDescriptorFactory;
+import com.baidu.mapapi.map.MapStatus;
+import com.baidu.mapapi.map.MapStatusUpdate;
+import com.baidu.mapapi.map.MapStatusUpdateFactory;
+import com.baidu.mapapi.map.MarkerOptions;
+import com.baidu.mapapi.map.OverlayOptions;
+import com.baidu.mapapi.map.TextureMapView;
+import com.baidu.mapapi.model.LatLng;
+import com.sucstepsoft.cm_utils.constant.PathConfig;
+import com.sucstepsoft.cm_utils.core.beans.AddPhotoBean;
+import com.sucstepsoft.cm_utils.core.retrofit_net.BaseUrlApi;
+import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
+import com.sucstepsoft.cm_utils.core.widget.base.AddPhotoAdapter;
+import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
+import com.sucstepsoft.cm_utils.utils.UserLgUtils;
+import com.sucstepsoft.realtimelocation.R;
+import com.sucstepsoft.realtimelocation.activitys.common.PhotoActivity;
+import com.sucstepsoft.realtimelocation.beans.person.BaseRegisterDetailBean;
+import com.sucstepsoft.realtimelocation.beans.person.DisputeDetailBean;
+import com.sucstepsoft.realtimelocation.net.LocationApiService;
+import com.sucstepsoft.realtimelocation.utils.ExceptionHandler;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.Unbinder;
+import io.reactivex.Observable;
+import io.reactivex.Observer;
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.annotations.NonNull;
+import io.reactivex.disposables.Disposable;
+import io.reactivex.schedulers.Schedulers;
+
+/**
+ * 矛盾纠纷
+ */
+public class CensusDisputeDetailActivity extends BaseActivity {
+
+
+ @BindView(R.id.et_search_id_card)
+ EditText mEtSearchIdCard;
+ @BindView(R.id.iv_clear)
+ ImageView mIvClear;
+ @BindView(R.id.btn_search)
+ Button mBtnSearch;
+ @BindView(R.id.ll_search_content)
+ LinearLayout mLlSearchContent;
+ @BindView(R.id.tv_base_name)
+ TextView mTvBaseName;
+ @BindView(R.id.tv_base_gender)
+ TextView mTvBaseGender;
+ @BindView(R.id.tv_base_phone)
+ TextView mTvBasePhone;
+ @BindView(R.id.tv_base_native)
+ TextView mTvBaseNative;
+ @BindView(R.id.tv_base_cur_loc)
+ TextView mTvBaseCurLoc;
+ @BindView(R.id.cv_base_info)
+ LinearLayout mCvBaseInfo;
+ @BindView(R.id.tv_case_name)
+ TextView mTvCaseName;
+ @BindView(R.id.tv_case_title)
+ TextView mTvCaseTitle;
+ @BindView(R.id.tv_case_date)
+ TextView mTvCaseDate;
+ @BindView(R.id.tv_case_address)
+ TextView mTvCaseAddress;
+ @BindView(R.id.tv_detail_address)
+ TextView mTvDetailAddress;
+ @BindView(R.id.tv_loc_lng)
+ TextView mTvLocLng;
+ @BindView(R.id.mp_view)
+ TextureMapView mMpView;
+ @BindView(R.id.tv_point)
+ TextView mTvPoint;
+ @BindView(R.id.tv_case_scale)
+ TextView mTvCaseScale;
+ @BindView(R.id.tv_case_type)
+ TextView mTvCaseType;
+ @BindView(R.id.tv_case_assess)
+ TextView mTvCaseAssess;
+ @BindView(R.id.tv_case_degree)
+ TextView mTvCaseDegree;
+ @BindView(R.id.tv_case_level)
+ TextView mTvCaseLevel;
+ @BindView(R.id.tv_dispute_type)
+ TextView mTvDisputeType;
+ @BindView(R.id.tv_dispute_level)
+ TextView mTvDisputeLevel;
+ @BindView(R.id.tv_risk_type)
+ TextView mTvRiskType;
+ @BindView(R.id.tv_risk_level)
+ TextView mTvRiskLevel;
+ @BindView(R.id.tv_money)
+ TextView mTvMoney;
+ @BindView(R.id.tv_person_num)
+ TextView mTvPersonNum;
+ @BindView(R.id.tv_dept)
+ TextView mTvDept;
+ @BindView(R.id.tv_compose_date)
+ TextView mTvComposeDate;
+ @BindView(R.id.tv_reason_other)
+ TextView mTvReasonOther;
+ @BindView(R.id.rlv_photo)
+ RecyclerView mRlvPhoto;
+ @BindView(R.id.tv_party_card_type)
+ TextView mTvPartyCardType;
+ @BindView(R.id.tv_party_card_num)
+ TextView mTvPartyCardNum;
+ @BindView(R.id.tv_party_name)
+ TextView mTvPartyName;
+ @BindView(R.id.tv_party_phone)
+ TextView mTvPartyPhone;
+ @BindView(R.id.tv_party_sex)
+ TextView mTvPartySex;
+ @BindView(R.id.tv_party_nation)
+ TextView mTvPartyNation;
+ @BindView(R.id.tv_party_edu)
+ TextView mTvPartyEdu;
+ @BindView(R.id.tv_party_person_type)
+ TextView mTvPartyPersonType;
+ @BindView(R.id.tv_party_person_address)
+ TextView mTvPartyPersonAddress;
+ @BindView(R.id.tv_resolve_date)
+ TextView mTvResolveDate;
+ @BindView(R.id.tv_resolve_way)
+ TextView mTvResolveWay;
+ @BindView(R.id.tv_resolve_dept)
+ TextView mTvResolveDept;
+ @BindView(R.id.tv_resolve_name)
+ TextView mTvResolveName;
+ @BindView(R.id.tv_resolve_id_card)
+ TextView mTvResolveIdCard;
+ @BindView(R.id.tv_resolve_phone)
+ TextView mTvResolvePhone;
+ @BindView(R.id.sw_is_resolve)
+ Switch mSwIsResolve;
+ @BindView(R.id.tv_resolve_result)
+ TextView mTvResolveResult;
+ @BindView(R.id.tv_eva_advice)
+ TextView mTvEvaAdvice;
+ @BindView(R.id.tv_eva_date)
+ TextView mTvEvaDate;
+ @BindView(R.id.tv_measure)
+ TextView mTvMeasure;
+ @BindView(R.id.tv_work_record)
+ TextView mTvWorkRecord;
+ @BindView(R.id.tv_party_b_num)
+ TextView mTvPartyBNum;
+ @BindView(R.id.tv_party_b_name)
+ TextView mTvPartyBName;
+ @BindView(R.id.tv_party_b_phone)
+ TextView mTvPartyBPhone;
+ @BindView(R.id.ll_content)
+ LinearLayout mLlContent;
+ private Unbinder mBind;
+ private BaseRegisterDetailBean mBaseInfo;
+ private DisputeDetailBean bean;
+ private BaiduMap mBaiduMap;
+ private LatLng mDefaultPoint;
+ private BitmapDescriptor mBitmapDescriptor;
+ private List mPhotos = new ArrayList<>();
+ private AddPhotoBean mCurrentBean;
+ private String mPicPath;
+ private String mPhotoIds = "";//相片Id
+ private AddPhotoAdapter mPhotoAdapter;
+
+ @Override
+ protected int setLayoutId() {
+ return R.layout.activity_census_dispute_detail;
+ }
+
+ @Override
+ public void initData() {
+ mBind = ButterKnife.bind(this);
+ mTvBaseTitle.setText("详情");
+ refreshView(STATE_LOAD_LOADING);
+ String id = getIntent().getStringExtra("id");
+ String idCard = getIntent().getStringExtra("idCard");
+ mPhotoAdapter = new AddPhotoAdapter(CensusDisputeDetailActivity.this, mPhotos);
+ mRlvPhoto.setLayoutManager(new GridLayoutManager(mActivity, 4));
+ mRlvPhoto.setAdapter(mPhotoAdapter);
+ mPhotoAdapter.addOnItemClickListener(bean -> {
+ if (TextUtils.isEmpty(bean.getPath())) {
+ //空数据
+
+ } else {
+ //预览
+ ArrayList list = new ArrayList<>();
+ list.add(bean.getPath());
+ Intent intent = new Intent();
+ intent.putExtra(PhotoActivity.TAG_IMGURL, list);
+ intent.setClass(CensusDisputeDetailActivity.this, PhotoActivity.class);
+ startActivity(intent);
+ }
+ });
+ initBaiduMap();
+ getDetailData(id, idCard);
+ }
+
+ /**
+ * 获取详细信息
+ *
+ * @param id
+ * @param idCard
+ */
+ private void getDetailData(String id, String idCard) {
+ Observable baseRegisterDetail = RetrofitManager.getInstance().create(LocationApiService.class).getBaseRegisterDetail(idCard, UserLgUtils.getToken());
+ Observable securityDetailById = RetrofitManager.getInstance().create(LocationApiService.class).getDisputeDetailById(id, UserLgUtils.getToken());
+ Observable.merge(baseRegisterDetail, securityDetailById)
+ .subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread())
+ .subscribe(new Observer