|
@@ -0,0 +1,1018 @@
|
|
|
+package com.xwkj.rhzf.mvp.ui.activity;
|
|
|
+
|
|
|
+import android.content.Intent;
|
|
|
+import android.content.SharedPreferences;
|
|
|
+import android.os.Bundle;
|
|
|
+import android.text.TextUtils;
|
|
|
+import android.view.View;
|
|
|
+import android.widget.AdapterView;
|
|
|
+import android.widget.Button;
|
|
|
+import android.widget.EditText;
|
|
|
+import android.widget.RelativeLayout;
|
|
|
+import android.widget.Spinner;
|
|
|
+import android.widget.TextView;
|
|
|
+
|
|
|
+import androidx.annotation.NonNull;
|
|
|
+import androidx.annotation.Nullable;
|
|
|
+import androidx.recyclerview.widget.GridLayoutManager;
|
|
|
+import androidx.recyclerview.widget.LinearLayoutManager;
|
|
|
+import androidx.recyclerview.widget.RecyclerView;
|
|
|
+
|
|
|
+import com.google.gson.Gson;
|
|
|
+import com.google.gson.JsonObject;
|
|
|
+import com.google.gson.JsonParser;
|
|
|
+import com.hjq.toast.ToastUtils;
|
|
|
+import com.jess.arms.base.BaseActivity;
|
|
|
+import com.jess.arms.base.DefaultAdapter;
|
|
|
+import com.jess.arms.di.component.AppComponent;
|
|
|
+import com.jess.arms.utils.ArmsUtils;
|
|
|
+
|
|
|
+import com.lzy.imagepicker.ImagePicker;
|
|
|
+import com.lzy.imagepicker.bean.ImageItem;
|
|
|
+import com.lzy.imagepicker.ui.ImageGridActivity;
|
|
|
+import com.lzy.imagepicker.ui.ImagePreviewDelActivity;
|
|
|
+import com.lzy.imagepicker.view.CropImageView;
|
|
|
+import com.xwkj.rhzf.app.utils.DateTimePicker;
|
|
|
+import com.xwkj.rhzf.app.utils.GlideImageLoader;
|
|
|
+import com.xwkj.rhzf.di.component.DaggerAddJfComponent;
|
|
|
+import com.xwkj.rhzf.mvp.contract.AddJfContract;
|
|
|
+import com.xwkj.rhzf.mvp.model.entity.AddJfEntity;
|
|
|
+import com.xwkj.rhzf.mvp.model.entity.CommonEntity;
|
|
|
+import com.xwkj.rhzf.mvp.model.entity.JcLxEntity;
|
|
|
+import com.xwkj.rhzf.mvp.model.entity.JwsJgEntity;
|
|
|
+import com.xwkj.rhzf.mvp.model.entity.MdjfEntity;
|
|
|
+import com.xwkj.rhzf.mvp.model.entity.MdjfXqEntity;
|
|
|
+import com.xwkj.rhzf.mvp.model.entity.PersonEntity;
|
|
|
+import com.xwkj.rhzf.mvp.model.entity.RwEntity;
|
|
|
+import com.xwkj.rhzf.mvp.presenter.AddJfPresenter;
|
|
|
+
|
|
|
+import com.xwkj.rhzf.R;
|
|
|
+import com.xwkj.rhzf.mvp.ui.adapter.ImagePickerAdapter;
|
|
|
+import com.xwkj.rhzf.mvp.ui.adapter.JfdjAdapter;
|
|
|
+import com.xwkj.rhzf.mvp.ui.adapter.JflxAdapter;
|
|
|
+import com.xwkj.rhzf.mvp.ui.adapter.JgAdapter;
|
|
|
+import com.xwkj.rhzf.mvp.ui.adapter.JwcjAdapter;
|
|
|
+import com.xwkj.rhzf.mvp.ui.adapter.PersonAdapter;
|
|
|
+import com.zkjc.common.base.ZkjcBaseActivity;
|
|
|
+import com.zkjc.common.utils.AssetsUtil;
|
|
|
+import com.zkjc.common.utils.DevicesUtils;
|
|
|
+import com.zkjc.common.utils.IdCardUtil;
|
|
|
+import com.zkjc.common.utils.JsonMapUtil;
|
|
|
+import com.zkjc.common.utils.UUIDUtils;
|
|
|
+import com.zkjc.common.utils.Utils;
|
|
|
+import com.zkjc.common.view.CommonTitleBarV3;
|
|
|
+
|
|
|
+
|
|
|
+import java.io.File;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+import butterknife.BindView;
|
|
|
+import okhttp3.MediaType;
|
|
|
+import okhttp3.MultipartBody;
|
|
|
+import okhttp3.RequestBody;
|
|
|
+
|
|
|
+import static com.jess.arms.utils.Preconditions.checkNotNull;
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * ================================================
|
|
|
+ * Description:
|
|
|
+ * <p>
|
|
|
+ * Created by MVPArmsTemplate on 10/22/2024 16:36
|
|
|
+ * <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
|
|
|
+ * <a href="https://github.com/JessYanCoding">Follow me</a>
|
|
|
+ * <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
|
|
|
+ * <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
|
|
|
+ * <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
|
|
|
+ * ================================================
|
|
|
+ */
|
|
|
+public class AddJfActivity extends ZkjcBaseActivity<AddJfPresenter> implements AddJfContract.View, ImagePickerAdapter.OnRecyclerViewItemClickListener {
|
|
|
+
|
|
|
+ private static final String SELECT = "请选择";
|
|
|
+ private static final int KRequestAdd = 100;
|
|
|
+ private static final int KRequestModify = 101;
|
|
|
+
|
|
|
+ @BindView(R.id.title_bar)
|
|
|
+ CommonTitleBarV3 titleBar;
|
|
|
+ @BindView(R.id.et_jfmc)
|
|
|
+ EditText etJfmc;
|
|
|
+ @BindView(R.id.sp_jflx)
|
|
|
+ Spinner spJflx;
|
|
|
+ @BindView(R.id.sp_jflx_one)
|
|
|
+ Spinner spJflxOne;
|
|
|
+ @BindView(R.id.et_jfyy)
|
|
|
+ EditText etJfyy;
|
|
|
+ @BindView(R.id.fssj)
|
|
|
+ TextView fssj;
|
|
|
+ @BindView(R.id.rl_fssj)
|
|
|
+ RelativeLayout rlFssj;
|
|
|
+ @BindView(R.id.fsdd)
|
|
|
+ TextView fsdd;
|
|
|
+ @BindView(R.id.rl_fsdd)
|
|
|
+ RelativeLayout rlFsdd;
|
|
|
+ @BindView(R.id.et_jyaq)
|
|
|
+ EditText etJyaq;
|
|
|
+ @BindView(R.id.recylerView)
|
|
|
+ RecyclerView recylerView;
|
|
|
+ @BindView(R.id.tv_number)
|
|
|
+ TextView tvNumber;
|
|
|
+ @BindView(R.id.rl)
|
|
|
+ RelativeLayout rl;
|
|
|
+ @BindView(R.id.tvadd)
|
|
|
+ TextView tvadd;
|
|
|
+ @BindView(R.id.rl_add)
|
|
|
+ RelativeLayout rlAdd;
|
|
|
+ @BindView(R.id.bt_add)
|
|
|
+ Button bt_add;
|
|
|
+ @BindView(R.id.sp_jfjb)
|
|
|
+ Spinner spJfjb;
|
|
|
+ @BindView(R.id.sp_jfly)
|
|
|
+ Spinner sp_jfly;
|
|
|
+ @BindView(R.id.recyclerViewFj)
|
|
|
+ RecyclerView recyclerViewFj;
|
|
|
+ @BindView(R.id.et_bz)
|
|
|
+ EditText etBz;
|
|
|
+ @BindView(R.id.et_zzdw)
|
|
|
+ EditText etZzdw;
|
|
|
+ @BindView(R.id.sp_sssq)
|
|
|
+ Spinner spSssq;
|
|
|
+ @BindView(R.id.sp_jfdj)
|
|
|
+ Spinner spJfdj;
|
|
|
+ @BindView(R.id.layout_bjrdh)
|
|
|
+ View layoutBjrdh;
|
|
|
+ @BindView(R.id.et_bjrdh)
|
|
|
+ EditText etBjrdh;
|
|
|
+ @BindView(R.id.layout_sq)
|
|
|
+ View layoutSq;
|
|
|
+ @BindView(R.id.layout_qqyy)
|
|
|
+ View layoutQqyy;
|
|
|
+ @BindView(R.id.et_qqyy)
|
|
|
+ EditText etQqyy;
|
|
|
+ private PersonAdapter adapter;
|
|
|
+ private String rylb;
|
|
|
+ private List<PersonEntity> list = new ArrayList<>();
|
|
|
+ private ArrayList<ImageItem> fjList; //当前选择的所有图片
|
|
|
+ private int maxFj = 3;
|
|
|
+ private String value2;
|
|
|
+ public static final int REQUEST_CODE_SELECT = 105;
|
|
|
+ public static final int REQUEST_CODE_PREVIEW = 106;
|
|
|
+ private List<String> fjPath;
|
|
|
+ private ImagePickerAdapter mAdapter;
|
|
|
+ public static final int IMAGE_ITEM_ADD = -1;
|
|
|
+ private String jfjb;
|
|
|
+ private Map<String, Object> map;
|
|
|
+ private Map<String, Object> map1;
|
|
|
+ private String jfly;
|
|
|
+ private String sqId;
|
|
|
+ private AddJfEntity.Jfdj mSelectJfdj;
|
|
|
+ private MdjfEntity.DataBean.RecordsBean mItem;
|
|
|
+ private String deptName;
|
|
|
+ private List<CommonEntity.DataBean> listLy;
|
|
|
+ private RwEntity.DataBean.RecordsBean mRwxfBean;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void setupActivityComponent(@NonNull AppComponent appComponent) {
|
|
|
+ DaggerAddJfComponent //如找不到该类,请编译一下项目
|
|
|
+ .builder()
|
|
|
+ .appComponent(appComponent)
|
|
|
+ .view(this)
|
|
|
+ .build()
|
|
|
+ .inject(this);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int initView(@Nullable Bundle savedInstanceState) {
|
|
|
+ return R.layout.activity_add_jf; //如果你不需要框架帮你设置 setContentView(id) 需要自行设置,请返回 0
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void initData(@Nullable Bundle savedInstanceState) {
|
|
|
+ mItem = (MdjfEntity.DataBean.RecordsBean) getIntent().getSerializableExtra("item");
|
|
|
+ if (mItem != null) {
|
|
|
+ titleBar.setTitle("修改矛盾纠纷");
|
|
|
+ rlAdd.setVisibility(View.GONE);
|
|
|
+ bt_add.setText("修改矛盾纠纷");
|
|
|
+ setData(mItem);
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ map.put("id", mItem.getId());
|
|
|
+ mPresenter.getJfxq(map);
|
|
|
+
|
|
|
+ spJfdj.setEnabled(false);
|
|
|
+ sp_jfly.setEnabled(false);
|
|
|
+ etBjrdh.setEnabled(false);
|
|
|
+ layoutQqyy.setVisibility(View.VISIBLE);
|
|
|
+ } else {
|
|
|
+ titleBar.setTitle("排查矛盾纠纷");
|
|
|
+ }
|
|
|
+
|
|
|
+ recylerView.setLayoutManager(new LinearLayoutManager(this));
|
|
|
+ adapter = new PersonAdapter(list);
|
|
|
+ adapter.setOnItemClickListener(new DefaultAdapter.OnRecyclerViewItemClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onItemClick(@NonNull View view, int viewType, @NonNull Object data, int position) {
|
|
|
+ Intent intent = new Intent(AddJfActivity.this, AddPersonActivity.class);
|
|
|
+ intent.putExtra("ry_data", list.get(position));
|
|
|
+ intent.putExtra("position", position);
|
|
|
+ intent.putExtra("is_add", mItem == null);
|
|
|
+ startActivityForResult(intent, KRequestModify);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ recylerView.setAdapter(adapter);
|
|
|
+
|
|
|
+ initImagePicker();
|
|
|
+ fjList = new ArrayList<>();
|
|
|
+ //普通照片
|
|
|
+ fjPath = new ArrayList<>();
|
|
|
+ mAdapter = new ImagePickerAdapter(this, fjList, maxFj);
|
|
|
+ mAdapter.setOnItemClickListener(this);
|
|
|
+ recyclerViewFj.setLayoutManager(new GridLayoutManager(this, 3));
|
|
|
+ recyclerViewFj.setHasFixedSize(true);
|
|
|
+ recyclerViewFj.setAdapter(mAdapter);
|
|
|
+ initDatePicker();
|
|
|
+ rlAdd.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+
|
|
|
+ Intent intent = new Intent(AddJfActivity.this, AddPersonActivity.class);
|
|
|
+ intent.putExtra("xz", "xz");
|
|
|
+ startActivityForResult(intent, KRequestAdd);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ rlFsdd.setOnClickListener(view -> {
|
|
|
+ if (!DevicesUtils.isLocServiceEnable(this)) {
|
|
|
+ ToastUtils.show("请开启定位服务");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ startActivityForResult(new Intent(AddJfActivity.this, GdMapActivity.class), 0);
|
|
|
+ });
|
|
|
+ bt_add.setOnClickListener(view -> {
|
|
|
+ map = new HashMap<>();
|
|
|
+ map1 = new HashMap<>();
|
|
|
+
|
|
|
+ String jfmc = etJfmc.getText().toString();
|
|
|
+ if (TextUtils.isEmpty(jfmc)) {
|
|
|
+ ToastUtils.show("纠纷名称不能为空");
|
|
|
+ return;
|
|
|
+ } else
|
|
|
+ map1.put("jfmc", jfmc);
|
|
|
+ if (TextUtils.isEmpty(value2)) {
|
|
|
+ ToastUtils.show("纠纷性质不能为空");
|
|
|
+ return;
|
|
|
+ } else
|
|
|
+ map1.put("jflx", value2);
|
|
|
+ String jfyy = etJfyy.getText().toString();
|
|
|
+ if (TextUtils.isEmpty(jfyy)) {
|
|
|
+ ToastUtils.show("简要案情不能为空");
|
|
|
+ return;
|
|
|
+ } else
|
|
|
+ map1.put("jyaq", jfyy);
|
|
|
+
|
|
|
+ String jffssj = fssj.getText().toString();
|
|
|
+ if (TextUtils.isEmpty(jffssj)) {
|
|
|
+ ToastUtils.show("请选择纠纷发生时间");
|
|
|
+ return;
|
|
|
+ } else
|
|
|
+ map1.put("jffssj", jffssj + ":00");
|
|
|
+ String jffsdd = fsdd.getText().toString();
|
|
|
+ if (TextUtils.isEmpty(jffsdd)) {
|
|
|
+ ToastUtils.show("请选择纠纷发生地点");
|
|
|
+ return;
|
|
|
+ } else
|
|
|
+ map1.put("jffsdd", jffsdd);
|
|
|
+ /* String jyaq = etJyaq.getText().toString();
|
|
|
+ if (TextUtils.isEmpty(jyaq)) {
|
|
|
+ ToastUtils.show("请填写纠纷详情");
|
|
|
+ return;
|
|
|
+ } else
|
|
|
+ map1.put("jyaq", jyaq);*/
|
|
|
+ /*if (TextUtils.isEmpty(jfjb) || jfjb.equals("请选择")) {
|
|
|
+ ToastUtils.show("请选择风险程度");
|
|
|
+ return;
|
|
|
+ } else
|
|
|
+ map1.put("mdjb", jfjb);*/
|
|
|
+ if (TextUtils.isEmpty(jfly) || jfly.equals(SELECT)) {
|
|
|
+ ToastUtils.show("请选择纠纷来源");
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ map1.put("jfly", jfly);
|
|
|
+ }
|
|
|
+ if (mItem == null) {
|
|
|
+ if ("110接处警".equals(jfly)) {
|
|
|
+ if (TextUtils.isEmpty(etBjrdh.getText().toString())) {
|
|
|
+ ToastUtils.show("请填写正确的报警人电话");
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ map1.put("bjrdh", etBjrdh.getText().toString());
|
|
|
+ SharedPreferences sys = getSharedPreferences("sys", MODE_PRIVATE);
|
|
|
+ boolean isXj = sys.getString("role_name", "").contains("巡警");
|
|
|
+ if (isXj) {
|
|
|
+ if (!TextUtils.isEmpty(sqId) && !sqId.equals(SELECT)) {
|
|
|
+ map1.put("jfsssq", sqId);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (TextUtils.isEmpty(sqId) || sqId.equals(SELECT)) {
|
|
|
+ ToastUtils.show("请选择纠纷所属社区");
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ map1.put("jfsssq", sqId);
|
|
|
+ map1.put("sqName", deptName);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String bz = etBz.getText().toString().trim();
|
|
|
+ if (!TextUtils.isEmpty(bz)) {
|
|
|
+ map1.put("bz", bz);
|
|
|
+ }
|
|
|
+ if (mItem == null) {
|
|
|
+ /* if ("110接处警".equals(jfly)) {
|
|
|
+ if (list.size() < 1) {
|
|
|
+ ToastUtils.show("纠纷人员至少需要有一方人员");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (list.size() < 2) {
|
|
|
+ ToastUtils.show("纠纷人员至少需要甲乙双方人员");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+ if (list.size() < 2) {
|
|
|
+ ToastUtils.show("纠纷人员至少需要甲乙双方人员");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ for (PersonEntity person : list) {
|
|
|
+ if (TextUtils.isEmpty(person.getXm())) {
|
|
|
+ ToastUtils.show("请填写纠纷人员姓名");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (TextUtils.isEmpty(person.getLb())) {
|
|
|
+ ToastUtils.show("请填写纠纷人员类别");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (TextUtils.isEmpty(person.getSfzh())) {
|
|
|
+ ToastUtils.show("请填写纠纷人员身份证号");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!IdCardUtil.validate(person.getSfzh())) {
|
|
|
+ ToastUtils.show("请输入" + person.getXm() + "正确的身份证号码");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (TextUtils.isEmpty(person.getLxdh())) {
|
|
|
+ ToastUtils.show("请填写纠纷人员手机号码");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (person.getLxdh().length() != 11) {
|
|
|
+ ToastUtils.show("请输入" + person.getXm() + "正确的手机号码");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (mItem != null && TextUtils.isEmpty(etQqyy.getText().toString())) {
|
|
|
+ ToastUtils.show("请填写请求原因");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ String zzdw = etZzdw.getText().toString();
|
|
|
+ if (!TextUtils.isEmpty(zzdw)) {
|
|
|
+ map1.put("zzdw", zzdw);
|
|
|
+ }
|
|
|
+ if (mSelectJfdj == null || mSelectJfdj.getDictValue().equals(SELECT)) {
|
|
|
+ ToastUtils.show("请选择纠纷等级");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ map1.put("mdjbV", mSelectJfdj.getDictKey());
|
|
|
+ if (mItem != null) {
|
|
|
+ List<PersonEntity> modifyList = new ArrayList<>();
|
|
|
+ for (PersonEntity entity : list) {
|
|
|
+ if (entity.isModify()) {
|
|
|
+ modifyList.add(entity);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ map.put("mdjfRyList", modifyList);
|
|
|
+ } else {
|
|
|
+ map.put("mdjfRyList", list);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (fjList.size() > 0) {
|
|
|
+ for (int i = 0; i < fjList.size(); i++) {
|
|
|
+ String path = fjList.get(i).path;
|
|
|
+ File file = new File(path);
|
|
|
+ Utils.getInstances().showDialog(AddJfActivity.this, "正在上传");
|
|
|
+ MultipartBody.Builder builder = new MultipartBody.Builder()
|
|
|
+ .setType(MultipartBody.FORM);
|
|
|
+ String zh = sys.getString("zh", "");
|
|
|
+ builder.addFormDataPart("file", zh + UUIDUtils.uuid() + file.getName(), RequestBody.create(MediaType.parse("image/*"), file));
|
|
|
+ MultipartBody multipartBody = builder.build();
|
|
|
+ mPresenter.uploadImg(multipartBody, 1);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ Utils.getInstances().showDialog(AddJfActivity.this, "正在上传数据");
|
|
|
+ if (mItem == null) {
|
|
|
+ map.put("mdjfDj", map1);
|
|
|
+ mPresenter.mdkfDj(map);
|
|
|
+ } else {
|
|
|
+ map1.put("id", mItem.getId());
|
|
|
+ map.put("mdjfDj", map1);
|
|
|
+ map.put("qqyy", etQqyy.getText().toString());
|
|
|
+ mPresenter.mdkfXg(map);
|
|
|
+ }
|
|
|
+ System.out.println("JsonMapUtil.map2jsonstr(map) = " + JsonMapUtil.map2jsonstr(map));
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+ initLocal();
|
|
|
+ initZd("1686566442075504641", 0);
|
|
|
+
|
|
|
+ mRwxfBean = (RwEntity.DataBean.RecordsBean) getIntent().getSerializableExtra("rwxf");
|
|
|
+ if (mRwxfBean != null) {
|
|
|
+ setRwxfData(mRwxfBean);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setRwxfData(RwEntity.DataBean.RecordsBean bean) {
|
|
|
+ etJfmc.setText(bean.getRwmc());
|
|
|
+ if (listLy != null) {
|
|
|
+ for (int i = 0; i < listLy.size(); i++) {
|
|
|
+ if (listLy.get(i).getKey().equals("110接处警")) {
|
|
|
+ sp_jfly.setSelection(i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ etBjrdh.setText(bean.getBjrdh());
|
|
|
+ etJfyy.setText(bean.getJfyy());
|
|
|
+// fsdd.setText(bean.getJffsdd());
|
|
|
+ List<MdjfXqEntity.DataBean.MdjfRyListBean> ryList = bean.getMdjfRyList();
|
|
|
+ if (list != null && !ryList.isEmpty()) {
|
|
|
+ for (MdjfXqEntity.DataBean.MdjfRyListBean ryBean : ryList) {
|
|
|
+ if (!TextUtils.isEmpty(ryBean.getLb()) && !TextUtils.isEmpty(ryBean.getLxdh()) && !TextUtils.isEmpty(ryBean.getSfzh()) && !TextUtils.isEmpty(ryBean.getXm())) {
|
|
|
+ PersonEntity entity = new PersonEntity();
|
|
|
+ entity.setLb(ryBean.getLb());
|
|
|
+ entity.setLxdh(ryBean.getLxdh());
|
|
|
+ entity.setSfzh(ryBean.getSfzh());
|
|
|
+ entity.setXm(ryBean.getXm());
|
|
|
+ entity.setId(ryBean.getId());
|
|
|
+ list.add(entity);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ adapter.notifyDataSetChanged();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setData(MdjfEntity.DataBean.RecordsBean item) {
|
|
|
+ etJfmc.setText(item.getJfmc());
|
|
|
+ etZzdw.setText(item.getZzdw());
|
|
|
+ etJfyy.setText(item.getJyaq());
|
|
|
+ String jffssj = item.getJffssj();
|
|
|
+ if (!TextUtils.isEmpty(jffssj)) {
|
|
|
+ jffssj = jffssj.substring(0, jffssj.lastIndexOf(":"));
|
|
|
+ }
|
|
|
+ fssj.setText(jffssj);
|
|
|
+ fsdd.setText(item.getJffsdd());
|
|
|
+ etBz.setText(item.getBz());
|
|
|
+ spJfdj.setEnabled(false);
|
|
|
+ sp_jfly.setEnabled(false);
|
|
|
+ etBjrdh.setEnabled(false);
|
|
|
+ etBjrdh.setText(mItem.getBjrdh());
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<CommonEntity.DataBean> getList(String json) {
|
|
|
+ Gson gson = new Gson();
|
|
|
+ CommonEntity commonEntity = gson.fromJson(json, CommonEntity.class);
|
|
|
+ List<CommonEntity.DataBean> data = commonEntity.getData();
|
|
|
+
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void initLocal() {
|
|
|
+ String jfjbjson = AssetsUtil.getJson(this, "jfjb.json");
|
|
|
+ String jflyjson = AssetsUtil.getJson(this, "jfly.json");
|
|
|
+ List<CommonEntity.DataBean> list = getList(jfjbjson);
|
|
|
+ listLy = getList(jflyjson);
|
|
|
+ spJfjb.setAdapter(new JwcjAdapter(list, this));
|
|
|
+ spJfjb.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
|
|
+ @Override
|
|
|
+ public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
|
|
+ jfjb = list.get(position).getKey();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onNothingSelected(AdapterView<?> parent) {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ sp_jfly.setAdapter(new JwcjAdapter(listLy, this));
|
|
|
+ sp_jfly.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
|
|
+ @Override
|
|
|
+ public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
|
|
+ jfly = listLy.get(position).getKey();
|
|
|
+ if ("110接处警".equals(jfly)) {
|
|
|
+ layoutBjrdh.setVisibility(View.VISIBLE);
|
|
|
+ } else {
|
|
|
+ layoutBjrdh.setVisibility(View.GONE);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onNothingSelected(AdapterView<?> parent) {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (mItem != null) {
|
|
|
+ for (int i = 0; i < listLy.size(); i++) {
|
|
|
+ if (listLy.get(i).getKey().equals(mItem.getJfly())) {
|
|
|
+ sp_jfly.setSelection(i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void initImagePicker() {
|
|
|
+ ImagePicker imagePicker = ImagePicker.getInstance();
|
|
|
+ imagePicker.setImageLoader(new GlideImageLoader()); //设置图片加载器
|
|
|
+ imagePicker.setShowCamera(true); //显示拍照按钮
|
|
|
+ imagePicker.setCrop(true); //允许裁剪(单选才有效)
|
|
|
+ imagePicker.setSaveRectangle(true); //是否按矩形区域保存
|
|
|
+ imagePicker.setSelectLimit(9); //选中数量限制
|
|
|
+ imagePicker.setMultiMode(false); //多选
|
|
|
+ imagePicker.setStyle(CropImageView.Style.RECTANGLE); //裁剪框的形状
|
|
|
+ imagePicker.setFocusWidth(1000); //裁剪框的宽度。单位像素(圆形自动取宽高最小值)
|
|
|
+ imagePicker.setFocusHeight(1600); //裁剪框的高度。单位像素(圆形自动取宽高最小值)
|
|
|
+ imagePicker.setOutPutX(1000); //保存文件的宽度。单位像素
|
|
|
+ imagePicker.setOutPutY(1000); //保存文件的高度。单位像素
|
|
|
+ }
|
|
|
+
|
|
|
+ private void initZd(String parentId, int flag) {
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ map.put("parentId", parentId);
|
|
|
+// mPresenter.getJfZd(map, flag);
|
|
|
+// mPresenter.zd();
|
|
|
+ map.put("code", "mddj");
|
|
|
+ mPresenter.getMdjfdj(map);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void initDatePicker() {
|
|
|
+ DateTimePicker dateTimePicker = new DateTimePicker(this);
|
|
|
+ dateTimePicker.setOnDateSelectListener(new DateTimePicker.OnDateSelectListener() {
|
|
|
+ @Override
|
|
|
+ public void onDateSelect(String start) {
|
|
|
+ fssj.setText(start);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ rlFssj.setFocusable(false);
|
|
|
+ rlFssj.setOnClickListener(v -> dateTimePicker.show());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void showLoading() {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void hideLoading() {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
|
|
+ super.onActivityResult(requestCode, resultCode, data);
|
|
|
+ if (requestCode == KRequestAdd) {
|
|
|
+ if (data != null) {
|
|
|
+ PersonEntity entity = (PersonEntity) data.getSerializableExtra("entity");
|
|
|
+ list.add(entity);
|
|
|
+ adapter.notifyDataSetChanged();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ if (requestCode == KRequestModify && resultCode == RESULT_OK) {
|
|
|
+ if (data != null) {
|
|
|
+ if (data.getBooleanExtra("delete", false)) {
|
|
|
+ list.remove(data.getIntExtra("position", 0));
|
|
|
+ adapter.notifyDataSetChanged();
|
|
|
+ } else {
|
|
|
+ PersonEntity entity = (PersonEntity) data.getSerializableExtra("entity");
|
|
|
+ entity.setModify(true);
|
|
|
+ list.set(data.getIntExtra("position", 0), entity);
|
|
|
+ adapter.notifyDataSetChanged();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (resultCode == 5) {
|
|
|
+ if (data != null && requestCode == 0) {
|
|
|
+ String location = data.getStringExtra("location");
|
|
|
+ String dtjd = data.getStringExtra("dtjd");
|
|
|
+ String dtwd = data.getStringExtra("dtwd");
|
|
|
+ fsdd.setText(location);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (resultCode == ImagePicker.RESULT_CODE_ITEMS) {
|
|
|
+ //添加图片返回
|
|
|
+ if (data != null && requestCode == REQUEST_CODE_SELECT) {
|
|
|
+ ArrayList<ImageItem> images = (ArrayList<ImageItem>) data.getSerializableExtra(ImagePicker.EXTRA_RESULT_ITEMS);
|
|
|
+ if (images != null) {
|
|
|
+ fjList.addAll(images);
|
|
|
+ mAdapter.setImages(fjList);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ } else if (resultCode == ImagePicker.RESULT_CODE_BACK) {
|
|
|
+ //预览图片返回
|
|
|
+ if (data != null && requestCode == REQUEST_CODE_PREVIEW) {
|
|
|
+ ArrayList<ImageItem> images = (ArrayList<ImageItem>) data.getSerializableExtra(ImagePicker.EXTRA_IMAGE_ITEMS);
|
|
|
+ if (images != null) {
|
|
|
+ fjList.clear();
|
|
|
+ fjList.addAll(images);
|
|
|
+ mAdapter.setImages(fjList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onItemClick(View view, int position) {
|
|
|
+ switch (position) {
|
|
|
+ case IMAGE_ITEM_ADD:
|
|
|
+ ImagePicker.getInstance().setSelectLimit(maxFj - fjList.size());
|
|
|
+ Intent intent = new Intent(this, ImageGridActivity.class);
|
|
|
+ //intent.putExtra(ImageGridActivity.EXTRAS_IMAGES,(ArrayList<ImageItem>) adapter.getImages());
|
|
|
+ intent.putExtra(ImageGridActivity.EXTRAS_TAKE_PICKERS, true);
|
|
|
+ startActivityForResult(intent, REQUEST_CODE_SELECT);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ //打开预览
|
|
|
+ Intent intentPreview = new Intent(this, ImagePreviewDelActivity.class);
|
|
|
+ intentPreview.putExtra(ImagePicker.EXTRA_IMAGE_ITEMS, (ArrayList<ImageItem>) mAdapter.getImages());
|
|
|
+ intentPreview.putExtra(ImagePicker.EXTRA_SELECTED_IMAGE_POSITION, position);
|
|
|
+ intentPreview.putExtra(ImagePicker.EXTRA_FROM_ITEMS, true);
|
|
|
+ startActivityForResult(intentPreview, REQUEST_CODE_PREVIEW);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void showMessage(@NonNull String message) {
|
|
|
+ checkNotNull(message);
|
|
|
+ ArmsUtils.snackbarText(message);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void launchActivity(@NonNull Intent intent) {
|
|
|
+ checkNotNull(intent);
|
|
|
+ ArmsUtils.startActivity(intent);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void killMyself() {
|
|
|
+ finish();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onSuccess(String result, int flag) {
|
|
|
+ switch (flag) {
|
|
|
+ case 0:
|
|
|
+ /* list.clear();
|
|
|
+ adapter.notifyDataSetChanged();
|
|
|
+ etJyaq.setText("");
|
|
|
+ etJfyy.setText("");
|
|
|
+ etJfmc.setText("");
|
|
|
+ fsdd.setText("");
|
|
|
+ fssj.setText("");
|
|
|
+ spJflx.setSelection(0, true);*/
|
|
|
+ // finish();
|
|
|
+ ShowTc(result);
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ praseJson(result);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onXgSuccess(String result) {
|
|
|
+ ToastUtils.show("修改申请已提交,请等待分局管理员审批成功后即可修改成功");
|
|
|
+ finish();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onDit(String result) {
|
|
|
+ try {
|
|
|
+ JwsJgEntity entity = new Gson().fromJson(result, JwsJgEntity.class);
|
|
|
+ List<JwsJgEntity.DataBean> data = entity.getData();
|
|
|
+ JwsJgEntity.DataBean dataBean = new JwsJgEntity.DataBean();
|
|
|
+ dataBean.setDeptName(SELECT);
|
|
|
+ dataBean.setId(SELECT);
|
|
|
+ data.add(0, dataBean);
|
|
|
+ spSssq.setAdapter(new JgAdapter(data, this));
|
|
|
+ spSssq.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
|
|
+ JwsJgEntity.DataBean dataBean = data.get(position);
|
|
|
+ sqId = dataBean.getId();
|
|
|
+ deptName = dataBean.getDeptName();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onNothingSelected(AdapterView<?> parent) {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private void ShowTc(String result) {
|
|
|
+ try {
|
|
|
+ JsonObject jsonObject1 = new JsonParser().parse(result).getAsJsonObject();
|
|
|
+ String data = jsonObject1.get("data").getAsString();
|
|
|
+ if (TextUtils.isEmpty(data)) {
|
|
|
+ ToastUtils.show("上传失败,请重试");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ /*AlertDialog.Builder builder = new AlertDialog.Builder(this)
|
|
|
+ .setTitle("温馨提示")
|
|
|
+ .setMessage("矛盾纠纷登记成功,是否继续调解")
|
|
|
+ .setPositiveButton("调解", new DialogInterface.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(DialogInterface dialogInterface, int i) {
|
|
|
+ Intent intent = new Intent(getApplicationContext(), TjJfActivity.class);
|
|
|
+ intent.putExtra("jfid", data);
|
|
|
+ startActivity(intent);
|
|
|
+ finish();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .setNegativeButton("不调解", new DialogInterface.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(DialogInterface dialogInterface, int i) {
|
|
|
+ finish();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ AlertDialog dialog = builder.create();
|
|
|
+ dialog.show();
|
|
|
+
|
|
|
+ WindowManager.LayoutParams params = dialog.getWindow().getAttributes();
|
|
|
+ params.width = ScreenUtils.dip2px(this, 320);
|
|
|
+
|
|
|
+ params.height = ScreenUtils.dip2px(this, 200);
|
|
|
+ dialog.getWindow().setAttributes(params);*/
|
|
|
+ if ("110接处警".equals(jfly)) {
|
|
|
+ ToastUtils.show("矛盾纠纷新增成功,请上公安网平台矛盾纠纷模块关联接警单号");
|
|
|
+ }
|
|
|
+ if (getIntent().hasExtra("rhzf")) {
|
|
|
+ Intent intent = new Intent();
|
|
|
+ intent.putExtra("jfid", data);
|
|
|
+ setResult(RESULT_OK, intent);
|
|
|
+ finish();
|
|
|
+ } else if (getIntent().hasExtra("is_from_rhzf")) {
|
|
|
+ Intent intent = new Intent();
|
|
|
+ intent.putExtra("id", data);
|
|
|
+ setResult(RESULT_OK, intent);
|
|
|
+ finish();
|
|
|
+ } else {
|
|
|
+ setResult(RESULT_OK);
|
|
|
+ finish();
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private void praseJson(String result) {
|
|
|
+ JsonObject jsonObject1 = new JsonParser().parse(result).getAsJsonObject();
|
|
|
+ JsonObject jsonObject = jsonObject1.get("data").getAsJsonObject();
|
|
|
+ if (jsonObject.has("link")) {
|
|
|
+ String url = jsonObject.get("link").getAsString();
|
|
|
+ fjPath.add(url);
|
|
|
+ if (fjList.size() == fjPath.size()) {
|
|
|
+ Utils.getInstances().dismissDialog();
|
|
|
+ StringBuffer sbzp = new StringBuffer();
|
|
|
+ for (int i = 0; i < fjPath.size(); i++) {
|
|
|
+ if (i == fjPath.size() - 1) {
|
|
|
+ sbzp.append(fjPath.get(i));
|
|
|
+ } else {
|
|
|
+ sbzp.append(fjPath.get(i)).append(",");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ map1.put("zp", sbzp.toString());
|
|
|
+ map.put("mdjfDj", map1);
|
|
|
+
|
|
|
+ mPresenter.mdkfDj(map);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onZdSuccess(String result, int flag) {
|
|
|
+
|
|
|
+ if (result.contains("172.16.1.41")) {
|
|
|
+ result = result.replaceAll("172.16.1.41", "111.26.204.4");
|
|
|
+ }
|
|
|
+ System.out.println("result = " + result);
|
|
|
+
|
|
|
+ try {
|
|
|
+ switch (flag) {
|
|
|
+ case 0:
|
|
|
+ JcLxEntity entity = new Gson().fromJson(result, JcLxEntity.class);
|
|
|
+ List<JcLxEntity.DataBean> data = entity.getData();
|
|
|
+ spJflx.setAdapter(new JflxAdapter(data, getApplicationContext()));
|
|
|
+ spJflx.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
|
|
+ @Override
|
|
|
+ public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
|
|
+ value2 = data.get(position).getLabel();
|
|
|
+ // initZd(value, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onNothingSelected(AdapterView<?> parent) {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (mItem != null) {
|
|
|
+ for (int i = 0; i < data.size(); i++) {
|
|
|
+ if (data.get(i).getLabel().equals(mItem.getJflx())) {
|
|
|
+ spJflx.setSelection(i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ JcLxEntity entity1 = new Gson().fromJson(result, JcLxEntity.class);
|
|
|
+ List<JcLxEntity.DataBean> data1 = entity1.getData();
|
|
|
+ spJflxOne.setAdapter(new JflxAdapter(data1, getApplicationContext()));
|
|
|
+ spJflxOne.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
|
|
+ @Override
|
|
|
+ public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
|
|
+ value2 = data1.get(position).getLabel();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onNothingSelected(AdapterView<?> parent) {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onGetMdjfDjSuccess(String result) {
|
|
|
+ try {
|
|
|
+ AddJfEntity entity = new Gson().fromJson(result, AddJfEntity.class);
|
|
|
+ // 纠纷性质
|
|
|
+ List<JcLxEntity.DataBean> data = entity.getData().getJflxvos();
|
|
|
+ spJflx.setAdapter(new JflxAdapter(data, getApplicationContext()));
|
|
|
+ spJflx.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
|
|
+ @Override
|
|
|
+ public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
|
|
+ value2 = data.get(position).getLabel();
|
|
|
+ // initZd(value, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onNothingSelected(AdapterView<?> parent) {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (mItem != null) {
|
|
|
+ for (int i = 0; i < data.size(); i++) {
|
|
|
+ if (data.get(i).getLabel().equals(mItem.getJflx())) {
|
|
|
+ spJflx.setSelection(i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (mRwxfBean != null) {
|
|
|
+ for (int i = 0; i < data.size(); i++) {
|
|
|
+ if (data.get(i).getLabel().equals(mRwxfBean.getJflx())) {
|
|
|
+ spJflx.setSelection(i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 所属社区
|
|
|
+ List<JwsJgEntity.DataBean> sqData = entity.getData().getDeptListVos();
|
|
|
+ JwsJgEntity.DataBean dataBean = new JwsJgEntity.DataBean();
|
|
|
+ dataBean.setDeptName(SELECT);
|
|
|
+ dataBean.setId(SELECT);
|
|
|
+ sqData.add(0, dataBean);
|
|
|
+ spSssq.setAdapter(new JgAdapter(sqData, this));
|
|
|
+ spSssq.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
|
|
+ JwsJgEntity.DataBean dataBean = sqData.get(position);
|
|
|
+ sqId = dataBean.getId();
|
|
|
+ deptName = dataBean.getDeptName();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onNothingSelected(AdapterView<?> parent) {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (mItem != null) {
|
|
|
+ for (int i = 0; i < sqData.size(); i++) {
|
|
|
+ if (sqData.get(i).getId().equals(mItem.getJfsssq())) {
|
|
|
+ spSssq.setSelection(i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (mRwxfBean != null) {
|
|
|
+ for (int i = 0; i < sqData.size(); i++) {
|
|
|
+ if (sqData.get(i).getId().equals(mRwxfBean.getSssq())) {
|
|
|
+ spSssq.setSelection(i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<AddJfEntity.Jfdj> jfdjList = entity.getData().getMddjvos();
|
|
|
+ AddJfEntity.Jfdj jfdj = new AddJfEntity.Jfdj();
|
|
|
+ jfdj.setDictValue(SELECT);
|
|
|
+ jfdj.setDictKey(SELECT);
|
|
|
+ jfdj.setId("1");
|
|
|
+ jfdjList.add(0, jfdj);
|
|
|
+ spJfdj.setAdapter(new JfdjAdapter(jfdjList, getApplicationContext()));
|
|
|
+ spJfdj.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
|
|
+ @Override
|
|
|
+ public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
|
|
+// value2 = data.get(position).getLabel();
|
|
|
+ mSelectJfdj = jfdjList.get(position);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onNothingSelected(AdapterView<?> parent) {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (mItem != null) {
|
|
|
+ for (int i = 0; i < jfdjList.size(); i++) {
|
|
|
+ if (jfdjList.get(i).getDictKey().equals(mItem.getMdjbV())) {
|
|
|
+ spJfdj.setSelection(i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void getJfDataSuccess(MdjfXqEntity.DataBean dataBean) {
|
|
|
+ MdjfXqEntity.DataBean.MdjfDjBean mdjfDj = dataBean.getMdjfDj();
|
|
|
+ etJfmc.setText(mdjfDj.getJfmc());
|
|
|
+ etZzdw.setText(mdjfDj.getZzdw());
|
|
|
+ etJfyy.setText(mdjfDj.getJyaq());
|
|
|
+ String jffssj = mdjfDj.getJffssj();
|
|
|
+ if (!TextUtils.isEmpty(jffssj)) {
|
|
|
+ jffssj = jffssj.substring(0, jffssj.lastIndexOf(":"));
|
|
|
+ }
|
|
|
+ fssj.setText(jffssj);
|
|
|
+ fsdd.setText(mdjfDj.getJffsdd());
|
|
|
+ etBz.setText(mdjfDj.getBz());
|
|
|
+ etBjrdh.setText(mdjfDj.getBjrdh());
|
|
|
+ List<MdjfXqEntity.DataBean.MdjfRyListBean> ryList = dataBean.getMdjfRyList();
|
|
|
+ if (list != null && !ryList.isEmpty()) {
|
|
|
+ for (MdjfXqEntity.DataBean.MdjfRyListBean ryBean : ryList) {
|
|
|
+ PersonEntity entity = new PersonEntity();
|
|
|
+ entity.setLb(ryBean.getLb());
|
|
|
+ entity.setLxdh(ryBean.getLxdh());
|
|
|
+ entity.setSfzh(ryBean.getSfzh());
|
|
|
+ entity.setXm(ryBean.getXm());
|
|
|
+ entity.setId(ryBean.getId());
|
|
|
+ list.add(entity);
|
|
|
+ }
|
|
|
+ adapter.notifyDataSetChanged();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void onDestroy() {
|
|
|
+ super.onDestroy();
|
|
|
+ Utils.getInstances().dismissDialog();
|
|
|
+ }
|
|
|
+}
|