复查
This commit is contained in:
parent
8f3e44ffec
commit
37041c7ce7
@ -47,7 +47,10 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
tools:ignore="GoogleAppIndexingWarning">
|
||||
<activity android:name=".activitys.issue.HistoryListActivity"></activity>
|
||||
<activity android:name=".activitys.issue.HistoryDetialActivity"></activity>
|
||||
<activity android:name=".activitys.countercheck.CounterCheckOptionsActivity" />
|
||||
<activity android:name=".activitys.countercheck.CounterCheckMainActivity" />
|
||||
<activity android:name=".activitys.issue.HistoryListActivity" />
|
||||
<activity android:name=".activitys.mine.MineMissionActivity" />
|
||||
<activity android:name=".activitys.companylib.MineCompanyLibActivity" />
|
||||
<activity
|
||||
|
@ -29,6 +29,7 @@ import com.sucstepsoft.cm_utils.utils.ToastUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
|
||||
import com.sucstepsoft.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.companylib.MineCompanyLibActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.countercheck.CounterCheckMainActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.issue.HistoryListActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.lawlib.LawLibActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.companylib.CompanyLibActivity;
|
||||
@ -98,12 +99,10 @@ public class MainActivity extends BaseActivity {
|
||||
};
|
||||
private Unbinder mBind;
|
||||
private List<FuncBean> mFuncs = new ArrayList<>();
|
||||
private String[] mBtnStrs = new String[]{"企业信息", "我的任务", "历史任务", "隐患上报", "隐患复查", "法律法规"};
|
||||
private int[] mBtnIds = new int[]{R.drawable.ic_company,
|
||||
private String[] mBtnStrs = new String[]{"企业信息", "隐患上报", "隐患复查", "我的任务", "历史任务", "法律法规"};
|
||||
private int[] mBtnIds = new int[]{R.drawable.ic_company, R.drawable.ic_trouble,R.drawable.ic_fucha,
|
||||
R.drawable.ic_law,
|
||||
R.drawable.ic_trouble,
|
||||
R.drawable.ic_trouble,
|
||||
R.drawable.ic_fucha,
|
||||
R.drawable.ic_law};
|
||||
private Gson mGson = null;
|
||||
private AlertDialog mGpsWeakDialog;
|
||||
@ -166,7 +165,7 @@ public class MainActivity extends BaseActivity {
|
||||
intent = new Intent(this, SelCompanyActivity.class);
|
||||
break;
|
||||
case "隐患复查":
|
||||
intent = new Intent(this, CheckOptionsActivity.class);
|
||||
intent = new Intent(this, CounterCheckMainActivity.class);
|
||||
break;
|
||||
case "法律法规":
|
||||
intent = new Intent(this, LawLibActivity.class);
|
||||
|
@ -68,6 +68,7 @@ public class CompanyDetailActivity extends BaseActivity {
|
||||
private Unbinder mBind;
|
||||
private CompanyDetailBean mDetailBean;
|
||||
private String mId;
|
||||
private Disposable mDetailDis;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
@ -106,7 +107,7 @@ public class CompanyDetailActivity extends BaseActivity {
|
||||
.subscribe(new Observer<CompanyDetailBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
mDetailDis = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -196,5 +197,6 @@ public class CompanyDetailActivity extends BaseActivity {
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
mBind.unbind();
|
||||
mDetailDis.dispose();
|
||||
}
|
||||
}
|
||||
|
@ -76,16 +76,16 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
XRecyclerView mRlvComList;
|
||||
private int mCurrentPage = 1;
|
||||
private List<CompanyListDataBean.RowsBean> mDatas = new ArrayList<>();
|
||||
private static final int STATE_LOADING = 333;
|
||||
private static final int STATE_EMPTY = 433;
|
||||
private static final int STATE_ERROR = 533;
|
||||
private static final int STATE_SUCCESS = 633;
|
||||
private CompanyLibAdapter mAdapter;
|
||||
private String mCompanyType = "";//企业类型
|
||||
private String mSearchCompanyName = "";//企业名称
|
||||
private int mCurrentType = 1;//1 加载全部 2 根据名称搜索 3 类型搜索 4 类型和名称搜索
|
||||
private OptionsPickerView mTypePicker;//单位类型
|
||||
private List<DictBean> mTypeList = null;//单位类型
|
||||
private Disposable mTypeDis;
|
||||
private Disposable mDisName;
|
||||
private Disposable mAllDis;
|
||||
private Disposable mListDis;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
@ -142,7 +142,7 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
}
|
||||
});
|
||||
getCompanyLibList(mCurrentPage, false);
|
||||
stateView(STATE_LOADING);
|
||||
stateView(STATE_LOAD_LOADING);
|
||||
mBtnSearch.setOnClickListener(v -> searchCompany());
|
||||
mBtnClear.setOnClickListener(v -> {
|
||||
mCurrentPage = 1;
|
||||
@ -269,7 +269,7 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
.subscribe(new Observer<CompanyListDataBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
mTypeDis = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -283,7 +283,7 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
} else {
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
}
|
||||
stateView(STATE_SUCCESS);
|
||||
stateView(STATE_LOAD_SUCCESS);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mRlvComList.refreshComplete();
|
||||
if (mDatas.size() >= companyListDataBean.getTotal()) {
|
||||
@ -297,10 +297,10 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
if (currentPage > 1) {
|
||||
mRlvComList.loadMoreComplete();
|
||||
mRlvComList.setNoMore(true);
|
||||
stateView(STATE_SUCCESS);
|
||||
stateView(STATE_LOAD_SUCCESS);
|
||||
} else {
|
||||
//无数据
|
||||
stateView(STATE_EMPTY);
|
||||
stateView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -336,7 +336,7 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
.subscribe(new Observer<CompanyListDataBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
mDisName = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -350,7 +350,7 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
} else {
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
}
|
||||
stateView(STATE_SUCCESS);
|
||||
stateView(STATE_LOAD_SUCCESS);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mRlvComList.refreshComplete();
|
||||
if (mDatas.size() >= companyListDataBean.getTotal()) {
|
||||
@ -364,10 +364,10 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
if (currentPage > 1) {
|
||||
mRlvComList.loadMoreComplete();
|
||||
mRlvComList.setNoMore(true);
|
||||
stateView(STATE_SUCCESS);
|
||||
stateView(STATE_LOAD_SUCCESS);
|
||||
} else {
|
||||
//无数据
|
||||
stateView(STATE_EMPTY);
|
||||
stateView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -403,7 +403,7 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
.subscribe(new Observer<CompanyListDataBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
mAllDis = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -417,7 +417,7 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
} else {
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
}
|
||||
stateView(STATE_SUCCESS);
|
||||
stateView(STATE_LOAD_SUCCESS);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mRlvComList.refreshComplete();
|
||||
if (mDatas.size() >= companyListDataBean.getTotal()) {
|
||||
@ -431,10 +431,10 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
if (currentPage > 1) {
|
||||
mRlvComList.loadMoreComplete();
|
||||
mRlvComList.setNoMore(true);
|
||||
stateView(STATE_SUCCESS);
|
||||
stateView(STATE_LOAD_SUCCESS);
|
||||
} else {
|
||||
//无数据
|
||||
stateView(STATE_EMPTY);
|
||||
stateView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -548,27 +548,27 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
|
||||
private void stateView(int state) {
|
||||
switch (state) {
|
||||
case STATE_SUCCESS:
|
||||
case STATE_LOAD_SUCCESS:
|
||||
mTvErrorHint.setVisibility(View.GONE);
|
||||
mRlvComList.setVisibility(View.VISIBLE);
|
||||
mPbLoading.setVisibility(View.GONE);
|
||||
mIvEmpty.setVisibility(View.GONE);
|
||||
break;
|
||||
case STATE_EMPTY:
|
||||
case STATE_LOAD_EMPTY:
|
||||
mTvErrorHint.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setText("暂无数据");
|
||||
mRlvComList.setVisibility(View.GONE);
|
||||
mPbLoading.setVisibility(View.GONE);
|
||||
mIvEmpty.setVisibility(View.VISIBLE);
|
||||
break;//空数据
|
||||
case STATE_ERROR:
|
||||
case STATE_LOAD_ERROR:
|
||||
mTvErrorHint.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setText("数据加载失败,请稍后重试.");
|
||||
mRlvComList.setVisibility(View.GONE);
|
||||
mPbLoading.setVisibility(View.GONE);
|
||||
mIvEmpty.setVisibility(View.VISIBLE);
|
||||
break;//加载错误
|
||||
case STATE_LOADING:
|
||||
case STATE_LOAD_LOADING:
|
||||
default:
|
||||
mTvErrorHint.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setText("数据加载中...");
|
||||
@ -611,7 +611,7 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
.subscribe(new Observer<CompanyListDataBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
mListDis = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -627,7 +627,7 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
} else {
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
}
|
||||
stateView(STATE_SUCCESS);
|
||||
stateView(STATE_LOAD_SUCCESS);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mRlvComList.refreshComplete();
|
||||
if (mDatas.size() >= companyListDataBean.getTotal()) {
|
||||
@ -641,10 +641,10 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
if (currentPage > 1) {
|
||||
mRlvComList.loadMoreComplete();
|
||||
mRlvComList.setNoMore(true);
|
||||
stateView(STATE_SUCCESS);
|
||||
stateView(STATE_LOAD_SUCCESS);
|
||||
} else {
|
||||
//无数据
|
||||
stateView(STATE_EMPTY);
|
||||
stateView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -654,7 +654,7 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
if (isShow) {
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
stateView(STATE_ERROR);
|
||||
stateView(STATE_LOAD_ERROR);
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@ -691,6 +691,18 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
mBind.unbind();
|
||||
if (mTypeDis != null && !mTypeDis.isDisposed()) {
|
||||
mTypeDis.dispose();
|
||||
}
|
||||
if (mDisName != null && !mDisName.isDisposed()) {
|
||||
mDisName.dispose();
|
||||
}
|
||||
if (mAllDis != null && !mAllDis.isDisposed()) {
|
||||
mAllDis.dispose();
|
||||
}
|
||||
if (mListDis != null && !mListDis.isDisposed()) {
|
||||
mListDis.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -79,6 +79,10 @@ public class MineCompanyLibActivity extends BaseActivity {
|
||||
private int mCurrentType = 1;//1 加载全部 2 根据名称搜索 3 类型搜索 4 类型和名称搜索
|
||||
private OptionsPickerView mTypePicker;//单位类型
|
||||
private List<DictBean> mTypeList = null;//单位类型
|
||||
private Disposable mDis1;
|
||||
private Disposable mDis2;
|
||||
private Disposable mDis3;
|
||||
private Disposable mDis4;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
@ -90,9 +94,9 @@ public class MineCompanyLibActivity extends BaseActivity {
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
mTvBaseTitle.setText("我的企业");
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvPublish.setVisibility(View.VISIBLE);
|
||||
mTvPublish.setText("录入");
|
||||
mTvPublish.setOnClickListener(v -> startActivity(new Intent(this, EnterCompanyInfoActivity.class)));
|
||||
// mTvPublish.setVisibility(View.VISIBLE);
|
||||
// mTvPublish.setText("录入");
|
||||
// mTvPublish.setOnClickListener(v -> startActivity(new Intent(this, EnterCompanyInfoActivity.class)));
|
||||
mAdapter = new CompanyLibAdapter(mActivity, mDatas);
|
||||
mAdapter.addOnBindListener((type, bean, index) -> {
|
||||
if (type == 1) {
|
||||
@ -262,7 +266,7 @@ public class MineCompanyLibActivity extends BaseActivity {
|
||||
.subscribe(new Observer<CompanyListDataBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
mDis1 = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -329,7 +333,7 @@ public class MineCompanyLibActivity extends BaseActivity {
|
||||
.subscribe(new Observer<CompanyListDataBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
mDis2 = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -396,7 +400,7 @@ public class MineCompanyLibActivity extends BaseActivity {
|
||||
.subscribe(new Observer<CompanyListDataBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
mDis3 = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -604,7 +608,7 @@ public class MineCompanyLibActivity extends BaseActivity {
|
||||
.subscribe(new Observer<CompanyListDataBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
mDis4 = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -683,6 +687,18 @@ public class MineCompanyLibActivity extends BaseActivity {
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mDis1 != null && !mDis1.isDisposed()) {
|
||||
mDis1.dispose();
|
||||
}
|
||||
if (mDis2 != null && !mDis2.isDisposed()) {
|
||||
mDis2.dispose();
|
||||
}
|
||||
if (mDis3 != null && !mDis3.isDisposed()) {
|
||||
mDis3.dispose();
|
||||
}
|
||||
if (mDis4 != null && !mDis4.isDisposed()) {
|
||||
mDis4.dispose();
|
||||
}
|
||||
mBind.unbind();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,615 @@
|
||||
package com.sucstepsoft.txrealtimelocation.activitys.countercheck;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
||||
import com.bigkoo.pickerview.view.OptionsPickerView;
|
||||
import com.google.gson.Gson;
|
||||
import com.jcodecraeer.xrecyclerview.ProgressStyle;
|
||||
import com.jcodecraeer.xrecyclerview.XRecyclerView;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.utils.LogUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.ToastUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.UIUtil;
|
||||
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
|
||||
import com.sucstepsoft.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.companylib.CompanyDetailActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.CompanyLibAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.CounterCheckListAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.BindCompanyBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CompanyListDataBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CounterCheckListBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.DictBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.SuccessBean;
|
||||
import com.sucstepsoft.txrealtimelocation.net.LocationApiService;
|
||||
|
||||
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.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
public class CounterCheckMainActivity extends BaseActivity {
|
||||
|
||||
|
||||
@BindView(R.id.et_company_name)
|
||||
EditText mEtCompanyName;
|
||||
@BindView(R.id.tv_com_type)
|
||||
TextView mTvComType;
|
||||
@BindView(R.id.btn_clear)
|
||||
Button mBtnClear;
|
||||
@BindView(R.id.btn_search)
|
||||
Button mBtnSearch;
|
||||
@BindView(R.id.pb_loading)
|
||||
ProgressBar mPbLoading;
|
||||
@BindView(R.id.iv_empty)
|
||||
ImageView mIvEmpty;
|
||||
@BindView(R.id.tv_error_hint)
|
||||
TextView mTvErrorHint;
|
||||
@BindView(R.id.xlv_list)
|
||||
XRecyclerView mXlvList;
|
||||
private Unbinder mBind;
|
||||
|
||||
|
||||
private int mCurrentPage = 1;
|
||||
private List<CounterCheckListBean.RowsBean> mDatas = new ArrayList<>();
|
||||
private CounterCheckListAdapter mAdapter;
|
||||
private String mCompanyType = "";//企业类型
|
||||
private String mSearchCompanyName = "";//企业名称
|
||||
private int mCurrentType = 1;//1 加载全部 2 根据名称搜索 3 类型搜索 4 类型和名称搜索
|
||||
private OptionsPickerView mTypePicker;//单位类型
|
||||
private List<DictBean> mTypeList = null;//单位类型
|
||||
private Disposable mDis1;
|
||||
private Disposable mDis2;
|
||||
private Disposable mDis3;
|
||||
private Disposable mDis4;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_counter_check_main;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
super.initData();
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("隐患复查");
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
mAdapter = new CounterCheckListAdapter(mActivity, mDatas);
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(mActivity);
|
||||
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
|
||||
mXlvList.setLayoutManager(layoutManager);
|
||||
mXlvList.setAdapter(mAdapter);
|
||||
mAdapter.addOnItemClickListener(this::showDetail);
|
||||
mXlvList.setRefreshProgressStyle(ProgressStyle.BallGridBeat);
|
||||
mXlvList.setLoadingMoreProgressStyle(ProgressStyle.Pacman);
|
||||
mXlvList.setPullRefreshEnabled(true);
|
||||
mXlvList.setLoadingMoreEnabled(true);
|
||||
mXlvList.setLoadingListener(new XRecyclerView.LoadingListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
refreshData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMore() {
|
||||
switch (mCurrentType) {
|
||||
case 1:
|
||||
getCompanyLibList(mCurrentPage, false);
|
||||
break;
|
||||
case 2:
|
||||
getCompanyListByName(mCurrentPage);
|
||||
break;
|
||||
case 3:
|
||||
getCompanyListByType(mCurrentPage);
|
||||
break;
|
||||
case 4:
|
||||
getCompanyListByAll(mCurrentPage);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
getCompanyLibList(mCurrentPage, false);
|
||||
stateView(STATE_LOAD_LOADING);
|
||||
mBtnSearch.setOnClickListener(v -> searchCompany());
|
||||
mBtnClear.setOnClickListener(v -> {
|
||||
mCurrentPage = 1;
|
||||
mCurrentType = 1;
|
||||
mSearchCompanyName = "";
|
||||
mCompanyType = "";
|
||||
mEtCompanyName.setText("");
|
||||
mTvComType.setText("");
|
||||
getCompanyLibList(mCurrentPage, true);
|
||||
});
|
||||
mTvComType.setOnClickListener(v -> onShowTypePicker());
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示单位类型
|
||||
*/
|
||||
private void onShowTypePicker() {
|
||||
hideSoftKeyboard();
|
||||
if (mTypeList != null && mTypeList.size() > 0) {
|
||||
if (mTypePicker == null) {
|
||||
mTypePicker = new OptionsPickerBuilder(mActivity, (options1, options2, options3, v) -> {
|
||||
DictBean bean = mTypeList.get(options1);
|
||||
mCompanyType = bean.getDictionaryId();
|
||||
mTvComType.setText(bean.getDictionaryName());
|
||||
}).setTitleText("请选择企业类型")
|
||||
.setCancelColor(Color.parseColor("#1189FF"))
|
||||
.setSubmitColor(Color.parseColor("#1189FF"))
|
||||
.setTitleColor(Color.parseColor("#1189FF"))
|
||||
.build();
|
||||
mTypePicker.setPicker(mTypeList);
|
||||
}
|
||||
mTypePicker.show();
|
||||
} else {
|
||||
if (mTypeList == null) {
|
||||
getDicList(PathConfig.DIC_COMPANY_TYPE_ID, 1);
|
||||
} else {
|
||||
ToastUtils.showShort("暂无数据");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示管理行业选项
|
||||
*/
|
||||
private void getDicList(String id, int type) {
|
||||
ProgressDialog progressDialog = UIUtil.initDialog(mActivity, "获取数据中...");
|
||||
progressDialog.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getDicrList(id, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<DictBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<DictBean> dictBeans) {
|
||||
progressDialog.dismiss();
|
||||
switch (type) {
|
||||
case 1://企业类型
|
||||
mTypeList = dictBeans;
|
||||
onShowTypePicker();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showShort("获取数据失败,请稍后重试");
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索企业
|
||||
*/
|
||||
private void searchCompany() {
|
||||
mSearchCompanyName = mEtCompanyName.getText().toString().trim();
|
||||
//判断搜索那个有值
|
||||
if (TextUtils.isEmpty(mSearchCompanyName) && TextUtils.isEmpty(mCompanyType)) {
|
||||
ToastUtils.showShort("请输入企业名称或选择企业类型");
|
||||
} else {
|
||||
mCurrentPage = 1;
|
||||
if (!TextUtils.isEmpty(mSearchCompanyName) && !TextUtils.isEmpty(mCompanyType)) {
|
||||
mCurrentType = 4;
|
||||
getCompanyListByAll(1);
|
||||
} else {
|
||||
if (!TextUtils.isEmpty(mSearchCompanyName)) {
|
||||
mCurrentType = 2;
|
||||
getCompanyListByName(1);
|
||||
}
|
||||
if (!TextUtils.isEmpty(mCompanyType)) {
|
||||
mCurrentType = 3;
|
||||
getCompanyListByType(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据类型搜索
|
||||
*/
|
||||
private void getCompanyListByType(int currentPage) {
|
||||
hideSoftKeyboard();
|
||||
ProgressDialog mMProgressDialog = new ProgressDialog(mActivity);
|
||||
mMProgressDialog.setMessage("搜索中...");
|
||||
mMProgressDialog.setCancelable(false);
|
||||
mMProgressDialog.setCanceledOnTouchOutside(false);
|
||||
mMProgressDialog.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getCounterCheckListByType(currentPage + "", mCompanyType, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<CounterCheckListBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mDis4 = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CounterCheckListBean companyListDataBean) {
|
||||
mMProgressDialog.dismiss();
|
||||
if (companyListDataBean != null && companyListDataBean.getRows() != null && companyListDataBean.getRows().size() > 0) {
|
||||
++mCurrentPage;
|
||||
if (currentPage == 1) {
|
||||
mDatas.clear();
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
} else {
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
}
|
||||
stateView(STATE_LOAD_SUCCESS);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mXlvList.refreshComplete();
|
||||
if (mDatas.size() >= companyListDataBean.getTotal()) {
|
||||
mXlvList.loadMoreComplete();
|
||||
mXlvList.setNoMore(true);
|
||||
} else {
|
||||
mXlvList.loadMoreComplete();
|
||||
mXlvList.setNoMore(false);
|
||||
}
|
||||
} else {
|
||||
if (currentPage > 1) {
|
||||
mXlvList.loadMoreComplete();
|
||||
mXlvList.setNoMore(true);
|
||||
stateView(STATE_LOAD_SUCCESS);
|
||||
} else {
|
||||
//无数据
|
||||
stateView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据名称搜索
|
||||
*/
|
||||
private void getCompanyListByName(int currentPage) {
|
||||
hideSoftKeyboard();
|
||||
ProgressDialog mMProgressDialog = new ProgressDialog(mActivity);
|
||||
mMProgressDialog.setMessage("搜索中...");
|
||||
mMProgressDialog.setCancelable(false);
|
||||
mMProgressDialog.setCanceledOnTouchOutside(false);
|
||||
mMProgressDialog.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getCounterCheckListByName(currentPage + "", mSearchCompanyName, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<CounterCheckListBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mDis3 = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CounterCheckListBean companyListDataBean) {
|
||||
mMProgressDialog.dismiss();
|
||||
if (companyListDataBean != null && companyListDataBean.getRows() != null && companyListDataBean.getRows().size() > 0) {
|
||||
++mCurrentPage;
|
||||
if (currentPage == 1) {
|
||||
mDatas.clear();
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
} else {
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
}
|
||||
stateView(STATE_LOAD_SUCCESS);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mXlvList.refreshComplete();
|
||||
if (mDatas.size() >= companyListDataBean.getTotal()) {
|
||||
mXlvList.loadMoreComplete();
|
||||
mXlvList.setNoMore(true);
|
||||
} else {
|
||||
mXlvList.loadMoreComplete();
|
||||
mXlvList.setNoMore(false);
|
||||
}
|
||||
} else {
|
||||
if (currentPage > 1) {
|
||||
mXlvList.loadMoreComplete();
|
||||
mXlvList.setNoMore(true);
|
||||
stateView(STATE_LOAD_SUCCESS);
|
||||
} else {
|
||||
//无数据
|
||||
stateView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据名称和类型搜索
|
||||
*/
|
||||
private void getCompanyListByAll(int currentPage) {
|
||||
hideSoftKeyboard();
|
||||
ProgressDialog mMProgressDialog = new ProgressDialog(mActivity);
|
||||
mMProgressDialog.setMessage("搜索中...");
|
||||
mMProgressDialog.setCancelable(false);
|
||||
mMProgressDialog.setCanceledOnTouchOutside(false);
|
||||
mMProgressDialog.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getCounterCheckListByAll(currentPage + "", mSearchCompanyName, mCompanyType, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<CounterCheckListBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mDis2 = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CounterCheckListBean companyListDataBean) {
|
||||
mMProgressDialog.dismiss();
|
||||
if (companyListDataBean != null && companyListDataBean.getRows() != null && companyListDataBean.getRows().size() > 0) {
|
||||
++mCurrentPage;
|
||||
if (currentPage == 1) {
|
||||
mDatas.clear();
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
} else {
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
}
|
||||
stateView(STATE_LOAD_SUCCESS);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mXlvList.refreshComplete();
|
||||
if (mDatas.size() >= companyListDataBean.getTotal()) {
|
||||
mXlvList.loadMoreComplete();
|
||||
mXlvList.setNoMore(true);
|
||||
} else {
|
||||
mXlvList.loadMoreComplete();
|
||||
mXlvList.setNoMore(false);
|
||||
}
|
||||
} else {
|
||||
if (currentPage > 1) {
|
||||
mXlvList.loadMoreComplete();
|
||||
mXlvList.setNoMore(true);
|
||||
stateView(STATE_LOAD_SUCCESS);
|
||||
} else {
|
||||
//无数据
|
||||
stateView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void stateView(int state) {
|
||||
switch (state) {
|
||||
case STATE_LOAD_SUCCESS:
|
||||
mTvErrorHint.setVisibility(View.GONE);
|
||||
mXlvList.setVisibility(View.VISIBLE);
|
||||
mPbLoading.setVisibility(View.GONE);
|
||||
mIvEmpty.setVisibility(View.GONE);
|
||||
break;
|
||||
case STATE_LOAD_EMPTY:
|
||||
mTvErrorHint.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setText("暂无数据");
|
||||
mXlvList.setVisibility(View.GONE);
|
||||
mPbLoading.setVisibility(View.GONE);
|
||||
mIvEmpty.setVisibility(View.VISIBLE);
|
||||
break;//空数据
|
||||
case STATE_LOAD_ERROR:
|
||||
mTvErrorHint.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setText("数据加载失败,请稍后重试.");
|
||||
mXlvList.setVisibility(View.GONE);
|
||||
mPbLoading.setVisibility(View.GONE);
|
||||
mIvEmpty.setVisibility(View.VISIBLE);
|
||||
break;//加载错误
|
||||
case STATE_LOAD_LOADING:
|
||||
default:
|
||||
mTvErrorHint.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setText("数据加载中...");
|
||||
mXlvList.setVisibility(View.GONE);
|
||||
mPbLoading.setVisibility(View.VISIBLE);
|
||||
mIvEmpty.setVisibility(View.GONE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示详情
|
||||
*/
|
||||
private void showDetail(CounterCheckListBean.RowsBean bean) {
|
||||
Intent intent = new Intent(mActivity, CounterCheckOptionsActivity.class);
|
||||
intent.putExtra("checkId", bean.getCheckId());
|
||||
intent.putExtra("name", bean.getNameJoinByEnterpriseId());
|
||||
intent.putExtra("peo", bean.getMasterJoinByEnterpriseId());
|
||||
intent.putExtra("enId", bean.getEnterpriseId());
|
||||
startActivityForResult(intent, 123);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == 123) {
|
||||
if (resultCode == 223) {
|
||||
getCompanyLibList(1, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
*
|
||||
* @param currentPage
|
||||
*/
|
||||
private void getCompanyLibList(int currentPage, boolean isShow) {
|
||||
final ProgressDialog mMProgressDialog = new ProgressDialog(mActivity);
|
||||
if (isShow) {
|
||||
mMProgressDialog.setMessage("加载中...");
|
||||
mMProgressDialog.setCancelable(false);
|
||||
mMProgressDialog.setCanceledOnTouchOutside(false);
|
||||
mMProgressDialog.show();
|
||||
}
|
||||
hideSoftKeyboard();
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getCounterCheckList(currentPage + "", UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<CounterCheckListBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mDis1 = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CounterCheckListBean companyListDataBean) {
|
||||
if (isShow) {
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
if (companyListDataBean != null && companyListDataBean.getRows() != null && companyListDataBean.getRows().size() > 0) {
|
||||
++mCurrentPage;
|
||||
if (currentPage == 1) {
|
||||
mDatas.clear();
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
} else {
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
}
|
||||
stateView(STATE_LOAD_SUCCESS);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mXlvList.refreshComplete();
|
||||
if (mDatas.size() >= companyListDataBean.getTotal()) {
|
||||
mXlvList.loadMoreComplete();
|
||||
mXlvList.setNoMore(true);
|
||||
} else {
|
||||
mXlvList.loadMoreComplete();
|
||||
mXlvList.setNoMore(false);
|
||||
}
|
||||
} else {
|
||||
if (currentPage > 1) {
|
||||
mXlvList.loadMoreComplete();
|
||||
mXlvList.setNoMore(true);
|
||||
stateView(STATE_LOAD_SUCCESS);
|
||||
} else {
|
||||
//无数据
|
||||
stateView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (isShow) {
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
stateView(STATE_LOAD_ERROR);
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新列表
|
||||
*/
|
||||
private void refreshData() {
|
||||
mCurrentPage = 1;
|
||||
switch (mCurrentType) {
|
||||
case 1:
|
||||
getCompanyLibList(mCurrentPage, false);
|
||||
break;
|
||||
case 2:
|
||||
getCompanyListByName(mCurrentPage);
|
||||
break;
|
||||
case 3:
|
||||
getCompanyListByType(mCurrentPage);
|
||||
break;
|
||||
case 4:
|
||||
getCompanyListByAll(mCurrentPage);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mDis1 != null && !mDis1.isDisposed()) {
|
||||
mDis1.dispose();
|
||||
}
|
||||
if (mDis2 != null && !mDis2.isDisposed()) {
|
||||
mDis2.dispose();
|
||||
}
|
||||
if (mDis3 != null && !mDis3.isDisposed()) {
|
||||
mDis3.dispose();
|
||||
}
|
||||
if (mDis4 != null && !mDis4.isDisposed()) {
|
||||
mDis4.dispose();
|
||||
}
|
||||
mBind.unbind();
|
||||
}
|
||||
}
|
@ -0,0 +1,496 @@
|
||||
package com.sucstepsoft.txrealtimelocation.activitys.countercheck;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.MediaStore;
|
||||
import android.support.v4.content.FileProvider;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
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.TextView;
|
||||
|
||||
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.BaseActivity;
|
||||
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.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.common.PhotoActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.issue.demo.Options;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.CounterCheckOptionsAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.BaseUserBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CounterCheckOptionsBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.OptionsSubmitBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.SuccessBean;
|
||||
import com.sucstepsoft.txrealtimelocation.net.LocationApiService;
|
||||
import com.sucstepsoft.txrealtimelocation.widget.EmStateCheck;
|
||||
|
||||
import java.io.File;
|
||||
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.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 CounterCheckOptionsActivity extends BaseActivity {
|
||||
|
||||
@BindView(R.id.tv_name)
|
||||
TextView mTvName;
|
||||
@BindView(R.id.tv_peo)
|
||||
TextView mTvPeo;
|
||||
private Unbinder mBind;
|
||||
private List<Options> mOptions;
|
||||
@BindView(R.id.rlv_options)
|
||||
RecyclerView mRlvOptions;
|
||||
@BindView(R.id.btn_unclaim)
|
||||
Button mBtnUnclaim;
|
||||
private AddPhotoBean mCurrentBean;
|
||||
private String mPicPath;
|
||||
private CounterCheckOptionsAdapter mAdapter;
|
||||
private String mCompanyId;
|
||||
private ProgressDialog mMProgressDialog;
|
||||
private Options mCurrentOptions;
|
||||
private int mCurrentIndex = 0;
|
||||
private String mCheckId;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_counter_check_options;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("企业复查项");
|
||||
refreshView(STATE_LOAD_LOADING);
|
||||
mCheckId = getIntent().getStringExtra("checkId");
|
||||
mCompanyId = getIntent().getStringExtra("enId");
|
||||
String name = getIntent().getStringExtra("name");
|
||||
String peo = getIntent().getStringExtra("peo");
|
||||
mTvName.setText(name);
|
||||
mTvPeo.setText(peo);
|
||||
mTvPublish.setVisibility(View.VISIBLE);
|
||||
mTvPublish.setText("保存");
|
||||
mTvPublish.setOnClickListener(v -> buildConfirmData(mAdapter.getData()));
|
||||
mOptions = new ArrayList<>();
|
||||
mAdapter = new CounterCheckOptionsAdapter(mActivity, mOptions);
|
||||
mRlvOptions.setAdapter(mAdapter);
|
||||
mRlvOptions.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
|
||||
mAdapter.addSelectPhotoListener((bean, options, i, type) -> {
|
||||
mCurrentOptions = options;
|
||||
if (type == 1) {
|
||||
//选择图片
|
||||
mCurrentIndex = i;
|
||||
showSelectPhoto(bean);
|
||||
} else {
|
||||
//预览
|
||||
ArrayList<String> list = new ArrayList<>();
|
||||
list.add(bean.getPath());
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra(PhotoActivity.TAG_IMGURL, list);
|
||||
intent.setClass(mActivity, PhotoActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
getCounterCheckOptions(mCheckId);
|
||||
mBtnUnclaim.setOnClickListener(v -> doUnclaim());
|
||||
}
|
||||
|
||||
private void doUnclaim() {
|
||||
ProgressDialog dialog = new ProgressDialog(mActivity);
|
||||
dialog.setMessage("上报中...");
|
||||
dialog.setCancelable(false);
|
||||
dialog.setCanceledOnTouchOutside(false);
|
||||
dialog.show();
|
||||
OptionsSubmitBean submitBean = new OptionsSubmitBean();
|
||||
submitBean.setEnterpriseId(mCompanyId);
|
||||
submitBean.setCheckType(2);
|
||||
submitBean.setIsCoordination(0);
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(submitBean);
|
||||
RequestBody body = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.doSaveOptions(body, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showShort("上报成功");
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showShort("提交失败,请稍后重试.");
|
||||
dialog.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void getCounterCheckOptions(String checkId) {
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getCounterCheckOptions(checkId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<CounterCheckOptionsBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<CounterCheckOptionsBean> checkOptionsbeans) {
|
||||
if (checkOptionsbeans != null && checkOptionsbeans.size() > 0) {
|
||||
buildCheckOptions(checkOptionsbeans);
|
||||
} else {
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建提交数据
|
||||
*
|
||||
* @param data
|
||||
*/
|
||||
private void buildConfirmData(List<Options> data) {
|
||||
mMProgressDialog = new ProgressDialog(mActivity);
|
||||
mMProgressDialog.setMessage("加载中...");
|
||||
mMProgressDialog.setCancelable(false);
|
||||
mMProgressDialog.setCanceledOnTouchOutside(false);
|
||||
mMProgressDialog.show();
|
||||
OptionsSubmitBean submitBean = new OptionsSubmitBean();
|
||||
submitBean.setEnterpriseId(mCompanyId);
|
||||
submitBean.setCheckType(2);
|
||||
submitBean.setIsCoordination(1);
|
||||
List<OptionsSubmitBean.HiddenDangerReportsBean> items = new ArrayList<>();
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
Options o = data.get(i);
|
||||
OptionsSubmitBean.HiddenDangerReportsBean bean = new OptionsSubmitBean.HiddenDangerReportsBean();
|
||||
bean.setCheckItemId(o.getId());
|
||||
String photoIds = "";
|
||||
if (o.getState() == EmStateCheck.NORMAL) {
|
||||
bean.setCheckResult(0);
|
||||
} else if (o.getState() == EmStateCheck.CHECK) {
|
||||
bean.setCheckResult(1);
|
||||
for (int j = 0; j < o.getPhotos().size(); j++) {
|
||||
if (!TextUtils.isEmpty(o.getPhotos().get(j).getId())) {
|
||||
photoIds += o.getPhotos().get(j).getId() + ",";
|
||||
}
|
||||
}
|
||||
if (photoIds.length() < 10) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showShort("检查项中存在未上传图片的项目");
|
||||
return;
|
||||
} else {
|
||||
bean.setScenePhotos(photoIds);
|
||||
}
|
||||
} else {
|
||||
if (o.getRectify() == 4) {
|
||||
//立即整改
|
||||
bean.setCheckResult(2);
|
||||
if (o.getTimeLimit().equals("立即整改")) {
|
||||
bean.setImmediatelyChangeType(1);
|
||||
} else {
|
||||
bean.setImmediatelyChangeType(2);
|
||||
}
|
||||
} else if (o.getRectify() == 5) {
|
||||
//限期整改
|
||||
bean.setCheckResult(3);
|
||||
String strDay = o.getTimeLimit().substring(0, o.getTimeLimit().lastIndexOf("天"));
|
||||
bean.setRectificationDays(Integer.parseInt(strDay));
|
||||
} else {
|
||||
//不配合
|
||||
bean.setCheckResult(4);
|
||||
}
|
||||
for (int j = 0; j < o.getPhotos().size(); j++) {
|
||||
if (!TextUtils.isEmpty(o.getPhotos().get(j).getId())) {
|
||||
photoIds += o.getPhotos().get(j).getId() + ",";
|
||||
}
|
||||
}
|
||||
if (photoIds.length() < 10) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showShort("检查项中存在未上传图片的项目");
|
||||
return;
|
||||
} else {
|
||||
bean.setScenePhotos(photoIds);
|
||||
}
|
||||
}
|
||||
items.add(bean);
|
||||
}
|
||||
submitBean.setHiddenDangerReports(items);
|
||||
doSubmit(submitBean);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交检查结果
|
||||
*
|
||||
* @param submitBean
|
||||
*/
|
||||
private void doSubmit(OptionsSubmitBean submitBean) {
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(submitBean);
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.doSaveCounterCheckOptions(body, mCheckId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showShort("复查成功");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showShort("复查失败,请稍后重试");
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示选择图片
|
||||
*
|
||||
* @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;
|
||||
mPicPath = PathConfig.CATCH_PATH + 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, 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;
|
||||
}
|
||||
}
|
||||
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();
|
||||
Luban.with(mActivity)
|
||||
.load(picPath)
|
||||
.ignoreBy(100)
|
||||
.setTargetDir(PathConfig.CATCH_PATH)
|
||||
.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<BaseUserBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseUserBean baseUserBean) {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showShort("上传成功");
|
||||
mCurrentBean.setId(baseUserBean.getData());
|
||||
mCurrentBean.setPath(picPath);
|
||||
if (mCurrentOptions.getPhotos().size() < 4) {
|
||||
mCurrentOptions.getPhotos().add(new AddPhotoBean());
|
||||
}
|
||||
mAdapter.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();
|
||||
}
|
||||
|
||||
private void buildCheckOptions(List<CounterCheckOptionsBean> checkOptionsbeans) {
|
||||
for (int i = 0; i < checkOptionsbeans.size(); i++) {
|
||||
List<AddPhotoBean> mPhotos = new ArrayList<>();
|
||||
mPhotos.add(new AddPhotoBean());
|
||||
Options o = new Options();
|
||||
o.setId(checkOptionsbeans.get(i).getCheckItemId());
|
||||
o.setTitle(checkOptionsbeans.get(i).getName());
|
||||
o.setPhotos(mPhotos);
|
||||
mOptions.add(o);
|
||||
}
|
||||
mAdapter.setData(mOptions);
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
}
|
||||
|
||||
}
|
@ -14,6 +14,7 @@ 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.TextView;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
@ -63,6 +64,8 @@ public class CheckOptionsActivity extends BaseActivity {
|
||||
TextView mTvName;
|
||||
@BindView(R.id.tv_peo)
|
||||
TextView mTvPeo;
|
||||
@BindView(R.id.btn_unclaim)
|
||||
Button mBtnUnclaim;
|
||||
private AddPhotoBean mCurrentBean;
|
||||
private String mPicPath;
|
||||
private int mCurrentIndex = 0;
|
||||
@ -112,6 +115,50 @@ public class CheckOptionsActivity extends BaseActivity {
|
||||
}
|
||||
});
|
||||
getCheckOptions(id);
|
||||
mBtnUnclaim.setOnClickListener(v -> doUnclaim());
|
||||
}
|
||||
|
||||
private void doUnclaim() {
|
||||
ProgressDialog dialog = new ProgressDialog(mActivity);
|
||||
dialog.setMessage("上报中...");
|
||||
dialog.setCancelable(false);
|
||||
dialog.setCanceledOnTouchOutside(false);
|
||||
dialog.show();
|
||||
OptionsSubmitBean submitBean = new OptionsSubmitBean();
|
||||
submitBean.setEnterpriseId(mCompanyId);
|
||||
submitBean.setIsCoordination(0);
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(submitBean);
|
||||
RequestBody body = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.doSaveOptions(body, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showShort("检查成功");
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showShort("提交失败,请稍后重试.");
|
||||
dialog.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -121,7 +168,7 @@ public class CheckOptionsActivity extends BaseActivity {
|
||||
*/
|
||||
private void buildConfirmData(List<Options> data) {
|
||||
mMProgressDialog = new ProgressDialog(CheckOptionsActivity.this);
|
||||
mMProgressDialog.setMessage("加载中...");
|
||||
mMProgressDialog.setMessage("上报中...");
|
||||
mMProgressDialog.setCancelable(false);
|
||||
mMProgressDialog.setCanceledOnTouchOutside(false);
|
||||
mMProgressDialog.show();
|
||||
@ -212,11 +259,13 @@ public class CheckOptionsActivity extends BaseActivity {
|
||||
public void onNext(SuccessBean successBean) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showShort("检查成功");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showShort("提交失败,请稍后重试.");
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,82 @@
|
||||
package com.sucstepsoft.txrealtimelocation.activitys.issue;
|
||||
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
|
||||
import com.sucstepsoft.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.MissionDetailAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.HistoryMissionBean;
|
||||
import com.sucstepsoft.txrealtimelocation.net.LocationApiService;
|
||||
|
||||
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.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
public class HistoryDetialActivity extends BaseActivity {
|
||||
@BindView(R.id.rlv_detail)
|
||||
RecyclerView mRlvDetail;
|
||||
|
||||
private Unbinder mBind;
|
||||
private List<HistoryMissionBean> mDatas = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_history_detial;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("详情");
|
||||
String cId = getIntent().getStringExtra("cId");
|
||||
getDetail(cId);
|
||||
MissionDetailAdapter adapter = new MissionDetailAdapter(mActivity, mDatas);
|
||||
}
|
||||
|
||||
private void getDetail(String cid) {
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getHistoryDetail(cid, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<HistoryMissionBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(HistoryMissionBean historyMissionBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
mBind.unbind();
|
||||
}
|
||||
}
|
@ -1,18 +1,76 @@
|
||||
package com.sucstepsoft.txrealtimelocation.activitys.issue;
|
||||
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
||||
import com.bigkoo.pickerview.view.OptionsPickerView;
|
||||
import com.jcodecraeer.xrecyclerview.ProgressStyle;
|
||||
import com.jcodecraeer.xrecyclerview.XRecyclerView;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.utils.ToastUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.UIUtil;
|
||||
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
|
||||
import com.sucstepsoft.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.CounterCheckListAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.HistoryMissionAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CounterCheckListBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.DictBean;
|
||||
import com.sucstepsoft.txrealtimelocation.net.LocationApiService;
|
||||
|
||||
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.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
public class HistoryListActivity extends BaseActivity {
|
||||
|
||||
|
||||
@BindView(R.id.et_company_name)
|
||||
EditText mEtCompanyName;
|
||||
@BindView(R.id.tv_com_type)
|
||||
TextView mTvComType;
|
||||
@BindView(R.id.btn_search)
|
||||
Button mBtnSearch;
|
||||
@BindView(R.id.pb_loading)
|
||||
ProgressBar mPbLoading;
|
||||
@BindView(R.id.iv_empty)
|
||||
ImageView mIvEmpty;
|
||||
@BindView(R.id.tv_error_hint)
|
||||
TextView mTvErrorHint;
|
||||
@BindView(R.id.xlv_com_lib)
|
||||
XRecyclerView mXlvComLib;
|
||||
@BindView(R.id.btn_clear)
|
||||
Button mBtnClear;
|
||||
private Unbinder mBind;
|
||||
private List<CounterCheckListBean.RowsBean> mDatas = new ArrayList<>();
|
||||
private HistoryMissionAdapter mAdapter;
|
||||
private int mCurrentPage = 1;
|
||||
private int mCurrentType = 1;//1 加载全部 2 根据名称搜索 3 类型搜索 4 类型和名称搜索
|
||||
private String mCompanyType = "";//企业类型
|
||||
private String mSearchCompanyName = "";//企业名称
|
||||
private OptionsPickerView mTypePicker;//单位类型
|
||||
private List<DictBean> mTypeList = null;//单位类型
|
||||
private Disposable mDis1;
|
||||
private Disposable mDis2;
|
||||
private Disposable mDis3;
|
||||
private Disposable mDis4;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
@ -24,5 +82,512 @@ public class HistoryListActivity extends BaseActivity {
|
||||
super.initData();
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("历史任务");
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
reStateView(STATE_LOAD_LOADING);
|
||||
initView();
|
||||
}
|
||||
|
||||
|
||||
private void initView() {
|
||||
mAdapter = new HistoryMissionAdapter(mActivity, mDatas);
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(mActivity);
|
||||
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
|
||||
mXlvComLib.setLayoutManager(layoutManager);
|
||||
mXlvComLib.setAdapter(mAdapter);
|
||||
mAdapter.addOnItemClickListener(this::showDetail);
|
||||
mXlvComLib.setRefreshProgressStyle(ProgressStyle.BallGridBeat);
|
||||
mXlvComLib.setLoadingMoreProgressStyle(ProgressStyle.Pacman);
|
||||
mXlvComLib.setPullRefreshEnabled(true);
|
||||
mXlvComLib.setLoadingMoreEnabled(true);
|
||||
mXlvComLib.setLoadingListener(new XRecyclerView.LoadingListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
refreshData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMore() {
|
||||
switch (mCurrentType) {
|
||||
case 1:
|
||||
getCompanyLibList(mCurrentPage, false);
|
||||
break;
|
||||
case 2:
|
||||
getCompanyListByName(mCurrentPage);
|
||||
break;
|
||||
case 3:
|
||||
getCompanyListByType(mCurrentPage);
|
||||
break;
|
||||
case 4:
|
||||
getCompanyListByAll(mCurrentPage);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
getCompanyLibList(mCurrentPage, false);
|
||||
reStateView(STATE_LOAD_LOADING);
|
||||
mBtnSearch.setOnClickListener(v -> searchCompany());
|
||||
mBtnClear.setOnClickListener(v -> {
|
||||
mCurrentPage = 1;
|
||||
mCurrentType = 1;
|
||||
mSearchCompanyName = "";
|
||||
mCompanyType = "";
|
||||
mEtCompanyName.setText("");
|
||||
mTvComType.setText("");
|
||||
getCompanyLibList(mCurrentPage, true);
|
||||
});
|
||||
mTvComType.setOnClickListener(v -> onShowTypePicker());
|
||||
}
|
||||
|
||||
private void showDetail(CounterCheckListBean.RowsBean rowsBean) {
|
||||
Intent intent = new Intent(mActivity, HistoryDetialActivity.class);
|
||||
intent.putExtra("id", rowsBean.getIndustryJoinByEnterpriseId());
|
||||
intent.putExtra("cId", rowsBean.getCheckId());
|
||||
intent.putExtra("name", rowsBean.getNameJoinByEnterpriseId());
|
||||
intent.putExtra("peo", rowsBean.getMasterJoinByEnterpriseId());
|
||||
intent.putExtra("phone", rowsBean.getPhoneJoinByEnterpriseId());
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新列表
|
||||
*/
|
||||
private void refreshData() {
|
||||
mCurrentPage = 1;
|
||||
switch (mCurrentType) {
|
||||
case 1:
|
||||
getCompanyLibList(mCurrentPage, false);
|
||||
break;
|
||||
case 2:
|
||||
getCompanyListByName(mCurrentPage);
|
||||
break;
|
||||
case 3:
|
||||
getCompanyListByType(mCurrentPage);
|
||||
break;
|
||||
case 4:
|
||||
getCompanyListByAll(mCurrentPage);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示单位类型
|
||||
*/
|
||||
private void onShowTypePicker() {
|
||||
hideSoftKeyboard();
|
||||
if (mTypeList != null && mTypeList.size() > 0) {
|
||||
if (mTypePicker == null) {
|
||||
mTypePicker = new OptionsPickerBuilder(mActivity, (options1, options2, options3, v) -> {
|
||||
DictBean bean = mTypeList.get(options1);
|
||||
mCompanyType = bean.getDictionaryId();
|
||||
mTvComType.setText(bean.getDictionaryName());
|
||||
}).setTitleText("请选择企业类型")
|
||||
.setCancelColor(Color.parseColor("#1189FF"))
|
||||
.setSubmitColor(Color.parseColor("#1189FF"))
|
||||
.setTitleColor(Color.parseColor("#1189FF"))
|
||||
.build();
|
||||
mTypePicker.setPicker(mTypeList);
|
||||
}
|
||||
mTypePicker.show();
|
||||
} else {
|
||||
if (mTypeList == null) {
|
||||
getDicList(PathConfig.DIC_COMPANY_TYPE_ID, 1);
|
||||
} else {
|
||||
ToastUtils.showShort("暂无数据");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示管理行业选项
|
||||
*/
|
||||
private void getDicList(String id, int type) {
|
||||
ProgressDialog progressDialog = UIUtil.initDialog(mActivity, "获取数据中...");
|
||||
progressDialog.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getDicrList(id, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<DictBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<DictBean> dictBeans) {
|
||||
progressDialog.dismiss();
|
||||
switch (type) {
|
||||
case 1://企业类型
|
||||
mTypeList = dictBeans;
|
||||
onShowTypePicker();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showShort("获取数据失败,请稍后重试");
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索企业
|
||||
*/
|
||||
private void searchCompany() {
|
||||
mSearchCompanyName = mEtCompanyName.getText().toString().trim();
|
||||
//判断搜索那个有值
|
||||
if (TextUtils.isEmpty(mSearchCompanyName) && TextUtils.isEmpty(mCompanyType)) {
|
||||
ToastUtils.showShort("请输入企业名称或选择企业类型");
|
||||
} else {
|
||||
mCurrentPage = 1;
|
||||
if (!TextUtils.isEmpty(mSearchCompanyName) && !TextUtils.isEmpty(mCompanyType)) {
|
||||
mCurrentType = 4;
|
||||
getCompanyListByAll(1);
|
||||
} else {
|
||||
if (!TextUtils.isEmpty(mSearchCompanyName)) {
|
||||
mCurrentType = 2;
|
||||
getCompanyListByName(1);
|
||||
}
|
||||
if (!TextUtils.isEmpty(mCompanyType)) {
|
||||
mCurrentType = 3;
|
||||
getCompanyListByType(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据类型搜索
|
||||
*/
|
||||
private void getCompanyListByType(int currentPage) {
|
||||
hideSoftKeyboard();
|
||||
ProgressDialog mMProgressDialog = new ProgressDialog(mActivity);
|
||||
mMProgressDialog.setMessage("搜索中...");
|
||||
mMProgressDialog.setCancelable(false);
|
||||
mMProgressDialog.setCanceledOnTouchOutside(false);
|
||||
mMProgressDialog.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getMineCheckListByType(currentPage + "", mCompanyType, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<CounterCheckListBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mDis4 = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CounterCheckListBean companyListDataBean) {
|
||||
mMProgressDialog.dismiss();
|
||||
if (companyListDataBean != null && companyListDataBean.getRows() != null && companyListDataBean.getRows().size() > 0) {
|
||||
++mCurrentPage;
|
||||
if (currentPage == 1) {
|
||||
mDatas.clear();
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
} else {
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
}
|
||||
reStateView(STATE_LOAD_SUCCESS);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mXlvComLib.refreshComplete();
|
||||
if (mDatas.size() >= companyListDataBean.getTotal()) {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(true);
|
||||
} else {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(false);
|
||||
}
|
||||
} else {
|
||||
if (currentPage > 1) {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(true);
|
||||
reStateView(STATE_LOAD_SUCCESS);
|
||||
} else {
|
||||
//无数据
|
||||
reStateView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据名称搜索
|
||||
*/
|
||||
private void getCompanyListByName(int currentPage) {
|
||||
hideSoftKeyboard();
|
||||
ProgressDialog mMProgressDialog = new ProgressDialog(mActivity);
|
||||
mMProgressDialog.setMessage("搜索中...");
|
||||
mMProgressDialog.setCancelable(false);
|
||||
mMProgressDialog.setCanceledOnTouchOutside(false);
|
||||
mMProgressDialog.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getMineCheckListByName(currentPage + "", mSearchCompanyName, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<CounterCheckListBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mDis3 = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CounterCheckListBean companyListDataBean) {
|
||||
mMProgressDialog.dismiss();
|
||||
if (companyListDataBean != null && companyListDataBean.getRows() != null && companyListDataBean.getRows().size() > 0) {
|
||||
++mCurrentPage;
|
||||
if (currentPage == 1) {
|
||||
mDatas.clear();
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
} else {
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
}
|
||||
reStateView(STATE_LOAD_SUCCESS);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mXlvComLib.refreshComplete();
|
||||
if (mDatas.size() >= companyListDataBean.getTotal()) {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(true);
|
||||
} else {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(false);
|
||||
}
|
||||
} else {
|
||||
if (currentPage > 1) {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(true);
|
||||
reStateView(STATE_LOAD_SUCCESS);
|
||||
} else {
|
||||
//无数据
|
||||
reStateView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据名称和类型搜索
|
||||
*/
|
||||
private void getCompanyListByAll(int currentPage) {
|
||||
hideSoftKeyboard();
|
||||
ProgressDialog mMProgressDialog = new ProgressDialog(mActivity);
|
||||
mMProgressDialog.setMessage("搜索中...");
|
||||
mMProgressDialog.setCancelable(false);
|
||||
mMProgressDialog.setCanceledOnTouchOutside(false);
|
||||
mMProgressDialog.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getMineCheckListByAll(currentPage + "", mSearchCompanyName, mCompanyType, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<CounterCheckListBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mDis2 = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CounterCheckListBean companyListDataBean) {
|
||||
mMProgressDialog.dismiss();
|
||||
if (companyListDataBean != null && companyListDataBean.getRows() != null && companyListDataBean.getRows().size() > 0) {
|
||||
++mCurrentPage;
|
||||
if (currentPage == 1) {
|
||||
mDatas.clear();
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
} else {
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
}
|
||||
reStateView(STATE_LOAD_SUCCESS);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mXlvComLib.refreshComplete();
|
||||
if (mDatas.size() >= companyListDataBean.getTotal()) {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(true);
|
||||
} else {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(false);
|
||||
}
|
||||
} else {
|
||||
if (currentPage > 1) {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(true);
|
||||
reStateView(STATE_LOAD_SUCCESS);
|
||||
} else {
|
||||
//无数据
|
||||
reStateView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
*
|
||||
* @param currentPage
|
||||
*/
|
||||
private void getCompanyLibList(int currentPage, boolean isShow) {
|
||||
final ProgressDialog mMProgressDialog = new ProgressDialog(mActivity);
|
||||
if (isShow) {
|
||||
mMProgressDialog.setMessage("加载中...");
|
||||
mMProgressDialog.setCancelable(false);
|
||||
mMProgressDialog.setCanceledOnTouchOutside(false);
|
||||
mMProgressDialog.show();
|
||||
}
|
||||
hideSoftKeyboard();
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getMineCheckList(currentPage + "", UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<CounterCheckListBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mDis1 = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CounterCheckListBean companyListDataBean) {
|
||||
if (isShow) {
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
if (companyListDataBean != null && companyListDataBean.getRows() != null && companyListDataBean.getRows().size() > 0) {
|
||||
++mCurrentPage;
|
||||
if (currentPage == 1) {
|
||||
mDatas.clear();
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
} else {
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
}
|
||||
reStateView(STATE_LOAD_SUCCESS);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mXlvComLib.refreshComplete();
|
||||
if (mDatas.size() >= companyListDataBean.getTotal()) {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(true);
|
||||
} else {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(false);
|
||||
}
|
||||
} else {
|
||||
if (currentPage > 1) {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(true);
|
||||
reStateView(STATE_LOAD_SUCCESS);
|
||||
} else {
|
||||
//无数据
|
||||
reStateView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (isShow) {
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
reStateView(STATE_LOAD_ERROR);
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void reStateView(int state) {
|
||||
switch (state) {
|
||||
case STATE_LOAD_LOADING:
|
||||
mTvErrorHint.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setText("数据加载中...");
|
||||
mIvEmpty.setVisibility(View.GONE);
|
||||
mXlvComLib.setVisibility(View.GONE);
|
||||
mPbLoading.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
case STATE_LOAD_SUCCESS:
|
||||
mTvErrorHint.setVisibility(View.GONE);
|
||||
mIvEmpty.setVisibility(View.GONE);
|
||||
mXlvComLib.setVisibility(View.VISIBLE);
|
||||
mPbLoading.setVisibility(View.GONE);
|
||||
break;
|
||||
case STATE_LOAD_ERROR:
|
||||
mTvErrorHint.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setText("数据加载失败,请稍后重试");
|
||||
mIvEmpty.setVisibility(View.VISIBLE);
|
||||
mXlvComLib.setVisibility(View.GONE);
|
||||
mPbLoading.setVisibility(View.GONE);
|
||||
break;
|
||||
case STATE_LOAD_EMPTY:
|
||||
mTvErrorHint.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setText("未找到相关内容");
|
||||
mIvEmpty.setVisibility(View.VISIBLE);
|
||||
mXlvComLib.setVisibility(View.GONE);
|
||||
mPbLoading.setVisibility(View.GONE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mDis1 != null && !mDis1.isDisposed()) {
|
||||
mDis1.dispose();
|
||||
}
|
||||
if (mDis2 != null && !mDis2.isDisposed()) {
|
||||
mDis2.dispose();
|
||||
}
|
||||
if (mDis3 != null && !mDis3.isDisposed()) {
|
||||
mDis3.dispose();
|
||||
}
|
||||
if (mDis4 != null && !mDis4.isDisposed()) {
|
||||
mDis4.dispose();
|
||||
}
|
||||
mBind.unbind();
|
||||
}
|
||||
}
|
||||
|
@ -75,6 +75,7 @@ public class OptionsAdapter extends BaseRecyclerAdapter<Options, OptionsHolder>
|
||||
//2.存在隐患
|
||||
// 立即整改 当天 立即 rg 图片
|
||||
// 限期增改 1 5 10 15 20 25 30天 选择spinner 图片
|
||||
|
||||
oHolder.mRlvPhotos.setVisibility(View.VISIBLE);
|
||||
EmStateCheck state = mData.get(index).getState();
|
||||
//合格
|
||||
@ -86,8 +87,55 @@ public class OptionsAdapter extends BaseRecyclerAdapter<Options, OptionsHolder>
|
||||
String[] defaultArray = mContext.getResources().getStringArray(R.array.limit);
|
||||
ArrayAdapter<String> defaultApater = new ArrayAdapter<>(mContext, R.layout.item_pop_text, defaultArray);
|
||||
oHolder.mSpinner.setAdapter(defaultApater);
|
||||
mData.get(index).setTimeLimit("立即整改");
|
||||
oHolder.mRbNow.setChecked(true);
|
||||
if (op.getRectify() == 0) {
|
||||
mData.get(index).setTimeLimit("立即整改");
|
||||
oHolder.mRbNow.setChecked(true);
|
||||
} else {
|
||||
if (op.getRectify() == 4) {
|
||||
oHolder.mSpinner.setAdapter(defaultApater);
|
||||
oHolder.mRg.check(R.id.rb_now);
|
||||
if (!TextUtils.isEmpty(op.getTimeLimit())) {
|
||||
if (op.getTimeLimit().equals("立即整改")) {
|
||||
oHolder.mSpinner.setSelection(0);
|
||||
} else {
|
||||
oHolder.mSpinner.setSelection(1);
|
||||
}
|
||||
}
|
||||
} else if (op.getRectify() == 5) {
|
||||
String[] strArray = mContext.getResources().getStringArray(R.array.timeLimit);
|
||||
ArrayAdapter<String> adapter = new ArrayAdapter<>(mContext, R.layout.item_pop_text, strArray);
|
||||
oHolder.mSpinner.setAdapter(adapter);
|
||||
oHolder.mRg.check(R.id.rb_term);
|
||||
if (!TextUtils.isEmpty(op.getTimeLimit())) {
|
||||
switch (op.getTimeLimit()) {
|
||||
case "5天":
|
||||
oHolder.mSpinner.setSelection(1);
|
||||
break;
|
||||
case "10天":
|
||||
oHolder.mSpinner.setSelection(2);
|
||||
break;
|
||||
case "15天":
|
||||
oHolder.mSpinner.setSelection(3);
|
||||
break;
|
||||
case "20天":
|
||||
oHolder.mSpinner.setSelection(4);
|
||||
break;
|
||||
case "25天":
|
||||
oHolder.mSpinner.setSelection(5);
|
||||
break;
|
||||
case "30天":
|
||||
oHolder.mSpinner.setSelection(6);
|
||||
break;
|
||||
case "1天":
|
||||
default:
|
||||
oHolder.mSpinner.setSelection(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
oHolder.mRg.check(R.id.rb_coor);
|
||||
}
|
||||
}
|
||||
oHolder.mRg.setOnCheckedChangeListener((radioGroup, id) -> {
|
||||
if (id == R.id.rb_now) {
|
||||
oHolder.mLlSp.setVisibility(View.VISIBLE);
|
||||
@ -133,7 +181,6 @@ public class OptionsAdapter extends BaseRecyclerAdapter<Options, OptionsHolder>
|
||||
mData.get(index).setRectify(6);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
AddPhotoAdapter photoAdapter = new AddPhotoAdapter(mContext, op.getPhotos());
|
||||
oHolder.mRlvPhotos.setAdapter(photoAdapter);
|
||||
|
@ -16,10 +16,7 @@ import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
|
||||
public class LawLibActivity extends BaseActivity {
|
||||
private static final int STATE_LO = 833;
|
||||
private static final int STATE_SU = 933;
|
||||
private static final int STATE_ER = 1033;
|
||||
private static final int STATE_EM = 1133;
|
||||
|
||||
@BindView(R.id.et_law_name)
|
||||
EditText mEtLawName;
|
||||
@BindView(R.id.btn_search)
|
||||
@ -33,6 +30,7 @@ public class LawLibActivity extends BaseActivity {
|
||||
@BindView(R.id.xlv_com_lib)
|
||||
XRecyclerView mXlvComLib;
|
||||
private Unbinder mBind;
|
||||
private int mCurrentPage = 1;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
@ -44,32 +42,41 @@ public class LawLibActivity extends BaseActivity {
|
||||
mBind = ButterKnife.bind(this);
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
mTvBaseTitle.setText("法律法规");
|
||||
reStateView(STATE_LO);
|
||||
reStateView(STATE_LOAD_LOADING);
|
||||
getLawList(mCurrentPage);
|
||||
}
|
||||
|
||||
private void getLawList(int currentPage) {
|
||||
|
||||
}
|
||||
|
||||
private void getLawListByName(int currentPage) {
|
||||
|
||||
}
|
||||
|
||||
private void reStateView(int state) {
|
||||
switch (state) {
|
||||
case STATE_LO:
|
||||
case STATE_LOAD_LOADING:
|
||||
mTvErrorHint.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setText("数据加载中...");
|
||||
mIvEmpty.setVisibility(View.GONE);
|
||||
mXlvComLib.setVisibility(View.GONE);
|
||||
mPbLoading.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
case STATE_SU:
|
||||
case STATE_LOAD_SUCCESS:
|
||||
mTvErrorHint.setVisibility(View.GONE);
|
||||
mIvEmpty.setVisibility(View.GONE);
|
||||
mXlvComLib.setVisibility(View.VISIBLE);
|
||||
mPbLoading.setVisibility(View.GONE);
|
||||
break;
|
||||
case STATE_ER:
|
||||
case STATE_LOAD_ERROR:
|
||||
mTvErrorHint.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setText("数据加载失败,请稍后重试");
|
||||
mIvEmpty.setVisibility(View.VISIBLE);
|
||||
mXlvComLib.setVisibility(View.GONE);
|
||||
mPbLoading.setVisibility(View.GONE);
|
||||
break;
|
||||
case STATE_EM:
|
||||
case STATE_LOAD_EMPTY:
|
||||
mTvErrorHint.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setText("未找到相关内容");
|
||||
mIvEmpty.setVisibility(View.VISIBLE);
|
||||
|
@ -1,18 +1,80 @@
|
||||
package com.sucstepsoft.txrealtimelocation.activitys.mine;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
||||
import com.bigkoo.pickerview.view.OptionsPickerView;
|
||||
import com.jcodecraeer.xrecyclerview.ProgressStyle;
|
||||
import com.jcodecraeer.xrecyclerview.XRecyclerView;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.utils.ToastUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.UIUtil;
|
||||
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
|
||||
import com.sucstepsoft.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.issue.CheckOptionsActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.CompanyCheckAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.CounterCheckListAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CompanyListDataBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CounterCheckListBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.DictBean;
|
||||
import com.sucstepsoft.txrealtimelocation.net.LocationApiService;
|
||||
|
||||
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.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
public class MineMissionActivity extends BaseActivity {
|
||||
|
||||
|
||||
@BindView(R.id.et_company_name)
|
||||
EditText mEtCompanyName;
|
||||
@BindView(R.id.tv_com_type)
|
||||
TextView mTvComType;
|
||||
@BindView(R.id.btn_search)
|
||||
Button mBtnSearch;
|
||||
@BindView(R.id.pb_loading)
|
||||
ProgressBar mPbLoading;
|
||||
@BindView(R.id.iv_empty)
|
||||
ImageView mIvEmpty;
|
||||
@BindView(R.id.tv_error_hint)
|
||||
TextView mTvErrorHint;
|
||||
@BindView(R.id.xlv_com_lib)
|
||||
XRecyclerView mXlvComLib;
|
||||
@BindView(R.id.btn_clear)
|
||||
Button mBtnClear;
|
||||
private Unbinder mBind;
|
||||
private List<CounterCheckListBean.RowsBean> mDatas = new ArrayList<>();
|
||||
private CounterCheckListAdapter mAdapter;
|
||||
private int mCurrentPage = 1;
|
||||
private int mCurrentType = 1;//1 加载全部 2 根据名称搜索 3 类型搜索 4 类型和名称搜索
|
||||
private String mCompanyType = "";//企业类型
|
||||
private String mSearchCompanyName = "";//企业名称
|
||||
private OptionsPickerView mTypePicker;//单位类型
|
||||
private List<DictBean> mTypeList = null;//单位类型
|
||||
private Disposable mDis1;
|
||||
private Disposable mDis2;
|
||||
private Disposable mDis3;
|
||||
private Disposable mDis4;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
@ -24,6 +86,527 @@ public class MineMissionActivity extends BaseActivity {
|
||||
super.initData();
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("我的任务");
|
||||
// mTvPublish.setVisibility(View.VISIBLE);
|
||||
// mTvPublish.setText("检查");
|
||||
// mTvPublish.setOnClickListener(v -> {
|
||||
// String selDataId = mAdapter.getSelDataId();
|
||||
// if (TextUtils.isEmpty(selDataId)) {
|
||||
// ToastUtils.showShort("请选择企业");
|
||||
// } else {
|
||||
// for (int i = 0; i < mDatas.size(); i++) {
|
||||
// if (mDatas.get(i).getEnterpriseId().equals(selDataId)) {
|
||||
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
reStateView(STATE_LOAD_LOADING);
|
||||
initView();
|
||||
}
|
||||
|
||||
|
||||
private void initView() {
|
||||
mAdapter = new CounterCheckListAdapter(mActivity, mDatas);
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(mActivity);
|
||||
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
|
||||
mXlvComLib.setLayoutManager(layoutManager);
|
||||
mXlvComLib.setAdapter(mAdapter);
|
||||
mAdapter.addOnItemClickListener(this::showDetail);
|
||||
mXlvComLib.setRefreshProgressStyle(ProgressStyle.BallGridBeat);
|
||||
mXlvComLib.setLoadingMoreProgressStyle(ProgressStyle.Pacman);
|
||||
mXlvComLib.setPullRefreshEnabled(true);
|
||||
mXlvComLib.setLoadingMoreEnabled(true);
|
||||
mXlvComLib.setLoadingListener(new XRecyclerView.LoadingListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
refreshData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMore() {
|
||||
switch (mCurrentType) {
|
||||
case 1:
|
||||
getCompanyLibList(mCurrentPage, false);
|
||||
break;
|
||||
case 2:
|
||||
getCompanyListByName(mCurrentPage);
|
||||
break;
|
||||
case 3:
|
||||
getCompanyListByType(mCurrentPage);
|
||||
break;
|
||||
case 4:
|
||||
getCompanyListByAll(mCurrentPage);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
getCompanyLibList(mCurrentPage, false);
|
||||
reStateView(STATE_LOAD_LOADING);
|
||||
mBtnSearch.setOnClickListener(v -> searchCompany());
|
||||
mBtnClear.setOnClickListener(v -> {
|
||||
mCurrentPage = 1;
|
||||
mCurrentType = 1;
|
||||
mSearchCompanyName = "";
|
||||
mCompanyType = "";
|
||||
mEtCompanyName.setText("");
|
||||
mTvComType.setText("");
|
||||
getCompanyLibList(mCurrentPage, true);
|
||||
});
|
||||
mTvComType.setOnClickListener(v -> onShowTypePicker());
|
||||
}
|
||||
|
||||
private void showDetail(CounterCheckListBean.RowsBean rowsBean) {
|
||||
Intent intent = new Intent(mActivity, CheckOptionsActivity.class);
|
||||
intent.putExtra("id", rowsBean.getIndustryJoinByEnterpriseId());
|
||||
intent.putExtra("cId", rowsBean.getEnterpriseId());
|
||||
intent.putExtra("name", rowsBean.getNameJoinByEnterpriseId());
|
||||
intent.putExtra("peo", rowsBean.getMasterJoinByEnterpriseId());
|
||||
intent.putExtra("phone", rowsBean.getPhoneJoinByEnterpriseId());
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新列表
|
||||
*/
|
||||
private void refreshData() {
|
||||
mCurrentPage = 1;
|
||||
switch (mCurrentType) {
|
||||
case 1:
|
||||
getCompanyLibList(mCurrentPage, false);
|
||||
break;
|
||||
case 2:
|
||||
getCompanyListByName(mCurrentPage);
|
||||
break;
|
||||
case 3:
|
||||
getCompanyListByType(mCurrentPage);
|
||||
break;
|
||||
case 4:
|
||||
getCompanyListByAll(mCurrentPage);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示单位类型
|
||||
*/
|
||||
private void onShowTypePicker() {
|
||||
hideSoftKeyboard();
|
||||
if (mTypeList != null && mTypeList.size() > 0) {
|
||||
if (mTypePicker == null) {
|
||||
mTypePicker = new OptionsPickerBuilder(mActivity, (options1, options2, options3, v) -> {
|
||||
DictBean bean = mTypeList.get(options1);
|
||||
mCompanyType = bean.getDictionaryId();
|
||||
mTvComType.setText(bean.getDictionaryName());
|
||||
}).setTitleText("请选择企业类型")
|
||||
.setCancelColor(Color.parseColor("#1189FF"))
|
||||
.setSubmitColor(Color.parseColor("#1189FF"))
|
||||
.setTitleColor(Color.parseColor("#1189FF"))
|
||||
.build();
|
||||
mTypePicker.setPicker(mTypeList);
|
||||
}
|
||||
mTypePicker.show();
|
||||
} else {
|
||||
if (mTypeList == null) {
|
||||
getDicList(PathConfig.DIC_COMPANY_TYPE_ID, 1);
|
||||
} else {
|
||||
ToastUtils.showShort("暂无数据");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示管理行业选项
|
||||
*/
|
||||
private void getDicList(String id, int type) {
|
||||
ProgressDialog progressDialog = UIUtil.initDialog(mActivity, "获取数据中...");
|
||||
progressDialog.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getDicrList(id, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<DictBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<DictBean> dictBeans) {
|
||||
progressDialog.dismiss();
|
||||
switch (type) {
|
||||
case 1://企业类型
|
||||
mTypeList = dictBeans;
|
||||
onShowTypePicker();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showShort("获取数据失败,请稍后重试");
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索企业
|
||||
*/
|
||||
private void searchCompany() {
|
||||
mSearchCompanyName = mEtCompanyName.getText().toString().trim();
|
||||
//判断搜索那个有值
|
||||
if (TextUtils.isEmpty(mSearchCompanyName) && TextUtils.isEmpty(mCompanyType)) {
|
||||
ToastUtils.showShort("请输入企业名称或选择企业类型");
|
||||
} else {
|
||||
mCurrentPage = 1;
|
||||
if (!TextUtils.isEmpty(mSearchCompanyName) && !TextUtils.isEmpty(mCompanyType)) {
|
||||
mCurrentType = 4;
|
||||
getCompanyListByAll(1);
|
||||
} else {
|
||||
if (!TextUtils.isEmpty(mSearchCompanyName)) {
|
||||
mCurrentType = 2;
|
||||
getCompanyListByName(1);
|
||||
}
|
||||
if (!TextUtils.isEmpty(mCompanyType)) {
|
||||
mCurrentType = 3;
|
||||
getCompanyListByType(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据类型搜索
|
||||
*/
|
||||
private void getCompanyListByType(int currentPage) {
|
||||
hideSoftKeyboard();
|
||||
ProgressDialog mMProgressDialog = new ProgressDialog(mActivity);
|
||||
mMProgressDialog.setMessage("搜索中...");
|
||||
mMProgressDialog.setCancelable(false);
|
||||
mMProgressDialog.setCanceledOnTouchOutside(false);
|
||||
mMProgressDialog.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getMineCheckListByType(currentPage + "", mCompanyType, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<CounterCheckListBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mDis4 = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CounterCheckListBean companyListDataBean) {
|
||||
mMProgressDialog.dismiss();
|
||||
if (companyListDataBean != null && companyListDataBean.getRows() != null && companyListDataBean.getRows().size() > 0) {
|
||||
++mCurrentPage;
|
||||
if (currentPage == 1) {
|
||||
mDatas.clear();
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
} else {
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
}
|
||||
reStateView(STATE_LOAD_SUCCESS);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mXlvComLib.refreshComplete();
|
||||
if (mDatas.size() >= companyListDataBean.getTotal()) {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(true);
|
||||
} else {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(false);
|
||||
}
|
||||
} else {
|
||||
if (currentPage > 1) {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(true);
|
||||
reStateView(STATE_LOAD_SUCCESS);
|
||||
} else {
|
||||
//无数据
|
||||
reStateView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据名称搜索
|
||||
*/
|
||||
private void getCompanyListByName(int currentPage) {
|
||||
hideSoftKeyboard();
|
||||
ProgressDialog mMProgressDialog = new ProgressDialog(mActivity);
|
||||
mMProgressDialog.setMessage("搜索中...");
|
||||
mMProgressDialog.setCancelable(false);
|
||||
mMProgressDialog.setCanceledOnTouchOutside(false);
|
||||
mMProgressDialog.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getMineCheckListByName(currentPage + "", mSearchCompanyName, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<CounterCheckListBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mDis3 = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CounterCheckListBean companyListDataBean) {
|
||||
mMProgressDialog.dismiss();
|
||||
if (companyListDataBean != null && companyListDataBean.getRows() != null && companyListDataBean.getRows().size() > 0) {
|
||||
++mCurrentPage;
|
||||
if (currentPage == 1) {
|
||||
mDatas.clear();
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
} else {
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
}
|
||||
reStateView(STATE_LOAD_SUCCESS);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mXlvComLib.refreshComplete();
|
||||
if (mDatas.size() >= companyListDataBean.getTotal()) {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(true);
|
||||
} else {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(false);
|
||||
}
|
||||
} else {
|
||||
if (currentPage > 1) {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(true);
|
||||
reStateView(STATE_LOAD_SUCCESS);
|
||||
} else {
|
||||
//无数据
|
||||
reStateView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据名称和类型搜索
|
||||
*/
|
||||
private void getCompanyListByAll(int currentPage) {
|
||||
hideSoftKeyboard();
|
||||
ProgressDialog mMProgressDialog = new ProgressDialog(mActivity);
|
||||
mMProgressDialog.setMessage("搜索中...");
|
||||
mMProgressDialog.setCancelable(false);
|
||||
mMProgressDialog.setCanceledOnTouchOutside(false);
|
||||
mMProgressDialog.show();
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getMineCheckListByAll(currentPage + "", mSearchCompanyName, mCompanyType, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<CounterCheckListBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mDis2 = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CounterCheckListBean companyListDataBean) {
|
||||
mMProgressDialog.dismiss();
|
||||
if (companyListDataBean != null && companyListDataBean.getRows() != null && companyListDataBean.getRows().size() > 0) {
|
||||
++mCurrentPage;
|
||||
if (currentPage == 1) {
|
||||
mDatas.clear();
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
} else {
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
}
|
||||
reStateView(STATE_LOAD_SUCCESS);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mXlvComLib.refreshComplete();
|
||||
if (mDatas.size() >= companyListDataBean.getTotal()) {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(true);
|
||||
} else {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(false);
|
||||
}
|
||||
} else {
|
||||
if (currentPage > 1) {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(true);
|
||||
reStateView(STATE_LOAD_SUCCESS);
|
||||
} else {
|
||||
//无数据
|
||||
reStateView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
*
|
||||
* @param currentPage
|
||||
*/
|
||||
private void getCompanyLibList(int currentPage, boolean isShow) {
|
||||
final ProgressDialog mMProgressDialog = new ProgressDialog(mActivity);
|
||||
if (isShow) {
|
||||
mMProgressDialog.setMessage("加载中...");
|
||||
mMProgressDialog.setCancelable(false);
|
||||
mMProgressDialog.setCanceledOnTouchOutside(false);
|
||||
mMProgressDialog.show();
|
||||
}
|
||||
hideSoftKeyboard();
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getMineCheckList(currentPage + "", UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<CounterCheckListBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mDis1 = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CounterCheckListBean companyListDataBean) {
|
||||
if (isShow) {
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
if (companyListDataBean != null && companyListDataBean.getRows() != null && companyListDataBean.getRows().size() > 0) {
|
||||
++mCurrentPage;
|
||||
if (currentPage == 1) {
|
||||
mDatas.clear();
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
} else {
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
}
|
||||
reStateView(STATE_LOAD_SUCCESS);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mXlvComLib.refreshComplete();
|
||||
if (mDatas.size() >= companyListDataBean.getTotal()) {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(true);
|
||||
} else {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(false);
|
||||
}
|
||||
} else {
|
||||
if (currentPage > 1) {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(true);
|
||||
reStateView(STATE_LOAD_SUCCESS);
|
||||
} else {
|
||||
//无数据
|
||||
reStateView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (isShow) {
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
reStateView(STATE_LOAD_ERROR);
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void reStateView(int state) {
|
||||
switch (state) {
|
||||
case STATE_LOAD_LOADING:
|
||||
mTvErrorHint.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setText("数据加载中...");
|
||||
mIvEmpty.setVisibility(View.GONE);
|
||||
mXlvComLib.setVisibility(View.GONE);
|
||||
mPbLoading.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
case STATE_LOAD_SUCCESS:
|
||||
mTvErrorHint.setVisibility(View.GONE);
|
||||
mIvEmpty.setVisibility(View.GONE);
|
||||
mXlvComLib.setVisibility(View.VISIBLE);
|
||||
mPbLoading.setVisibility(View.GONE);
|
||||
break;
|
||||
case STATE_LOAD_ERROR:
|
||||
mTvErrorHint.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setText("数据加载失败,请稍后重试");
|
||||
mIvEmpty.setVisibility(View.VISIBLE);
|
||||
mXlvComLib.setVisibility(View.GONE);
|
||||
mPbLoading.setVisibility(View.GONE);
|
||||
break;
|
||||
case STATE_LOAD_EMPTY:
|
||||
mTvErrorHint.setVisibility(View.VISIBLE);
|
||||
mTvErrorHint.setText("未找到相关内容");
|
||||
mIvEmpty.setVisibility(View.VISIBLE);
|
||||
mXlvComLib.setVisibility(View.GONE);
|
||||
mPbLoading.setVisibility(View.GONE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mDis1 != null && !mDis1.isDisposed()) {
|
||||
mDis1.dispose();
|
||||
}
|
||||
if (mDis2 != null && !mDis2.isDisposed()) {
|
||||
mDis2.dispose();
|
||||
}
|
||||
if (mDis3 != null && !mDis3.isDisposed()) {
|
||||
mDis3.dispose();
|
||||
}
|
||||
if (mDis4 != null && !mDis4.isDisposed()) {
|
||||
mDis4.dispose();
|
||||
}
|
||||
mBind.unbind();
|
||||
}
|
||||
}
|
||||
|
@ -74,6 +74,10 @@ public class SelCompanyActivity extends BaseActivity {
|
||||
private String mSearchCompanyName = "";//企业名称
|
||||
private OptionsPickerView mTypePicker;//单位类型
|
||||
private List<DictBean> mTypeList = null;//单位类型
|
||||
private Disposable mDis1;
|
||||
private Disposable mDis2;
|
||||
private Disposable mDis3;
|
||||
private Disposable mDis4;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
@ -83,7 +87,7 @@ public class SelCompanyActivity extends BaseActivity {
|
||||
@Override
|
||||
public void initData() {
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("选择企业");
|
||||
mTvBaseTitle.setText("隐患上报");
|
||||
mTvPublish.setVisibility(View.VISIBLE);
|
||||
mTvPublish.setText("检查");
|
||||
mTvPublish.setOnClickListener(v -> {
|
||||
@ -291,7 +295,7 @@ public class SelCompanyActivity extends BaseActivity {
|
||||
.subscribe(new Observer<CompanyListDataBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
mDis4 = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -358,7 +362,7 @@ public class SelCompanyActivity extends BaseActivity {
|
||||
.subscribe(new Observer<CompanyListDataBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
mDis3 = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -425,7 +429,7 @@ public class SelCompanyActivity extends BaseActivity {
|
||||
.subscribe(new Observer<CompanyListDataBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
mDis2 = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -496,7 +500,7 @@ public class SelCompanyActivity extends BaseActivity {
|
||||
.subscribe(new Observer<CompanyListDataBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
mDis1 = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -585,6 +589,18 @@ public class SelCompanyActivity extends BaseActivity {
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mDis1 != null && !mDis1.isDisposed()) {
|
||||
mDis1.dispose();
|
||||
}
|
||||
if (mDis2 != null && !mDis2.isDisposed()) {
|
||||
mDis2.dispose();
|
||||
}
|
||||
if (mDis3 != null && !mDis3.isDisposed()) {
|
||||
mDis3.dispose();
|
||||
}
|
||||
if (mDis4 != null && !mDis4.isDisposed()) {
|
||||
mDis4.dispose();
|
||||
}
|
||||
mBind.unbind();
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ public class CompanyCheckAdapter extends BaseRecyclerAdapter<CompanyListDataBean
|
||||
holder.mCbCheck.setChecked(false);
|
||||
}
|
||||
holder.mTvName.setText(mData.get(i).getNameJoinByEnterpriseId());
|
||||
holder.mTvAddress.setText("地址:" + mData.get(i).getArea2DictionaryName() + mData.get(i).getArea3DictionaryName() + mData.get(i).getArea4DictionaryName() + mData.get(i).getArea5DictionaryName());
|
||||
holder.mTvAddress.setText("地址:" + mData.get(i).getArea2DictionaryName() + mData.get(i).getArea3DictionaryName() + mData.get(i).getArea4DictionaryName() + mData.get(i).getArea5DictionaryName() + mData.get(i).getAddressJoinByEnterpriseId());
|
||||
holder.mTvPeo.setText("负责人:" + mData.get(i).getMasterJoinByEnterpriseId());
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,38 @@
|
||||
package com.sucstepsoft.txrealtimelocation.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.holders.CounterCheckListHolder;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CounterCheckListBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/4/2 - 10:02 AM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class CounterCheckListAdapter extends BaseRecyclerAdapter<CounterCheckListBean.RowsBean, CounterCheckListHolder> {
|
||||
public CounterCheckListAdapter(Context ctx, List<CounterCheckListBean.RowsBean> list) {
|
||||
super(ctx, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CounterCheckListHolder createHolder(ViewGroup parent, int viewType) {
|
||||
View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_counter_check, parent, false);
|
||||
return new CounterCheckListHolder(itemView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindHolder(CounterCheckListHolder holder, int i) {
|
||||
holder.mTvAddress.setText("地址:" + mData.get(i).getAddressJoinByEnterpriseId());
|
||||
holder.mTvName.setText(mData.get(i).getNameJoinByEnterpriseId());
|
||||
holder.mTvPeo.setText("负责人:" + mData.get(i).getMasterJoinByEnterpriseId());
|
||||
}
|
||||
}
|
@ -0,0 +1,211 @@
|
||||
package com.sucstepsoft.txrealtimelocation.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.v7.widget.GridLayoutManager;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
|
||||
import com.sucstepsoft.cm_utils.core.beans.AddPhotoBean;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.AddPhotoAdapter;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.issue.demo.Options;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.issue.demo.OptionsAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.holders.CounterCheckOptionHolder;
|
||||
import com.sucstepsoft.txrealtimelocation.widget.EmStateCheck;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/4/2 - 10:47 AM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class CounterCheckOptionsAdapter extends BaseRecyclerAdapter<Options, CounterCheckOptionHolder> {
|
||||
|
||||
public CounterCheckOptionsAdapter(Context ctx, List list) {
|
||||
super(ctx, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CounterCheckOptionHolder createHolder(ViewGroup parent, int viewType) {
|
||||
View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_counter_check_options, parent, false);
|
||||
return new CounterCheckOptionHolder(itemView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindHolder(CounterCheckOptionHolder oHolder, int i) {
|
||||
oHolder.mScvOptions.setCheckState(mData.get(i).getState());
|
||||
oHolder.mScvOptions.setOnClickListener(v -> {
|
||||
EmStateCheck state = oHolder.mScvOptions.getViewState();
|
||||
switch (state) {
|
||||
case NORMAL://未检查
|
||||
oHolder.mScvOptions.setCheckState(EmStateCheck.CHECK);
|
||||
mData.get(i).setState(EmStateCheck.CHECK);
|
||||
initContentView(oHolder, mData.get(i), i);
|
||||
break;
|
||||
case CHECK://合格
|
||||
oHolder.mScvOptions.setCheckState(EmStateCheck.UNCHECK);
|
||||
mData.get(i).setState(EmStateCheck.UNCHECK);
|
||||
initContentView(oHolder, mData.get(i), i);
|
||||
break;
|
||||
case UNCHECK://有隐患
|
||||
oHolder.mScvOptions.setCheckState(EmStateCheck.NORMAL);
|
||||
mData.get(i).setState(EmStateCheck.NORMAL);
|
||||
oHolder.mLlContent.setVisibility(View.GONE);
|
||||
oHolder.mRlvPhotos.setVisibility(View.GONE);
|
||||
break;
|
||||
}
|
||||
});
|
||||
if (mData.get(i).getState() == EmStateCheck.UNCHECK || mData.get(i).getState() == EmStateCheck.CHECK) {
|
||||
initContentView(oHolder, mData.get(i), i);
|
||||
} else {
|
||||
oHolder.mLlContent.setVisibility(View.GONE);
|
||||
oHolder.mRlvPhotos.setVisibility(View.GONE);
|
||||
}
|
||||
oHolder.mTvTitle.setText(mData.get(i).getTitle());
|
||||
}
|
||||
|
||||
private void initContentView(CounterCheckOptionHolder oHolder, Options op, int index) {
|
||||
//1.合格只要相片
|
||||
//2.存在隐患
|
||||
// 立即整改 当天 立即 rg 图片
|
||||
// 限期增改 1 5 10 15 20 25 30天 选择spinner 图片
|
||||
oHolder.mRlvPhotos.setVisibility(View.VISIBLE);
|
||||
EmStateCheck state = mData.get(index).getState();
|
||||
//合格
|
||||
if (state == EmStateCheck.CHECK) {
|
||||
oHolder.mLlContent.setVisibility(View.GONE);
|
||||
} else {
|
||||
oHolder.mLlContent.setVisibility(View.VISIBLE);
|
||||
oHolder.mLlSp.setVisibility(View.VISIBLE);
|
||||
String[] defaultArray = mContext.getResources().getStringArray(R.array.limit);
|
||||
ArrayAdapter<String> defaultApater = new ArrayAdapter<>(mContext, R.layout.item_pop_text, defaultArray);
|
||||
oHolder.mSpinner.setAdapter(defaultApater);
|
||||
if (op.getRectify() == 0) {
|
||||
mData.get(index).setTimeLimit("立即整改");
|
||||
oHolder.mRbNow.setChecked(true);
|
||||
} else {
|
||||
if (op.getRectify() == 4) {
|
||||
oHolder.mSpinner.setAdapter(defaultApater);
|
||||
oHolder.mRg.check(R.id.rb_now);
|
||||
if (!TextUtils.isEmpty(op.getTimeLimit())) {
|
||||
if (op.getTimeLimit().equals("立即整改")) {
|
||||
oHolder.mSpinner.setSelection(0);
|
||||
} else {
|
||||
oHolder.mSpinner.setSelection(1);
|
||||
}
|
||||
}
|
||||
} else if (op.getRectify() == 5) {
|
||||
String[] strArray = mContext.getResources().getStringArray(R.array.timeLimit);
|
||||
ArrayAdapter<String> adapter = new ArrayAdapter<>(mContext, R.layout.item_pop_text, strArray);
|
||||
oHolder.mSpinner.setAdapter(adapter);
|
||||
oHolder.mRg.check(R.id.rb_term);
|
||||
if (!TextUtils.isEmpty(op.getTimeLimit())) {
|
||||
switch (op.getTimeLimit()) {
|
||||
case "5天":
|
||||
oHolder.mSpinner.setSelection(1);
|
||||
break;
|
||||
case "10天":
|
||||
oHolder.mSpinner.setSelection(2);
|
||||
break;
|
||||
case "15天":
|
||||
oHolder.mSpinner.setSelection(3);
|
||||
break;
|
||||
case "20天":
|
||||
oHolder.mSpinner.setSelection(4);
|
||||
break;
|
||||
case "25天":
|
||||
oHolder.mSpinner.setSelection(5);
|
||||
break;
|
||||
case "30天":
|
||||
oHolder.mSpinner.setSelection(6);
|
||||
break;
|
||||
case "1天":
|
||||
default:
|
||||
oHolder.mSpinner.setSelection(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
oHolder.mRg.check(R.id.rb_coor);
|
||||
}
|
||||
}
|
||||
|
||||
oHolder.mRg.setOnCheckedChangeListener((radioGroup, id) -> {
|
||||
if (id == R.id.rb_now) {
|
||||
oHolder.mLlSp.setVisibility(View.VISIBLE);
|
||||
//立即整改
|
||||
oHolder.mSpinner.setAdapter(defaultApater);
|
||||
mData.get(index).setRectify(4);
|
||||
mData.get(index).setTimeLimit("立即整改");
|
||||
oHolder.mSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
|
||||
String s = defaultArray[i];
|
||||
mData.get(index).setTimeLimit(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> adapterView) {
|
||||
|
||||
}
|
||||
});
|
||||
} else if (id == R.id.rb_term) {
|
||||
//限期整改
|
||||
oHolder.mLlSp.setVisibility(View.VISIBLE);
|
||||
mData.get(index).setRectify(5);
|
||||
mData.get(index).setTimeLimit("1天");
|
||||
String[] strArray = mContext.getResources().getStringArray(R.array.timeLimit);
|
||||
ArrayAdapter<String> adapter = new ArrayAdapter<>(mContext, R.layout.item_pop_text, strArray);
|
||||
oHolder.mSpinner.setAdapter(adapter);
|
||||
oHolder.mSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
|
||||
String s = strArray[i];
|
||||
mData.get(index).setTimeLimit(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> adapterView) {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
//不配合
|
||||
oHolder.mLlSp.setVisibility(View.GONE);
|
||||
mData.get(index).setRectify(6);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
AddPhotoAdapter photoAdapter = new AddPhotoAdapter(mContext, op.getPhotos());
|
||||
oHolder.mRlvPhotos.setAdapter(photoAdapter);
|
||||
oHolder.mRlvPhotos.setLayoutManager(new GridLayoutManager(mContext, 4));
|
||||
photoAdapter.addOnItemClickListener(bean -> {
|
||||
if (mSelectPhotoListener != null) {
|
||||
if (TextUtils.isEmpty(bean.getPath())) {
|
||||
//空数据,选择图片
|
||||
mSelectPhotoListener.onSelectPhoto(bean, op, index, 1);
|
||||
} else {
|
||||
mSelectPhotoListener.onSelectPhoto(bean, op, index, 2);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private OptionsAdapter.SelectPhoto mSelectPhotoListener;
|
||||
|
||||
public void addSelectPhotoListener(OptionsAdapter.SelectPhoto selectPhotoListener) {
|
||||
this.mSelectPhotoListener = selectPhotoListener;
|
||||
}
|
||||
|
||||
public interface SelectPhoto {
|
||||
void onSelectPhoto(AddPhotoBean bean, Options options, int i, int type);
|
||||
}
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.sucstepsoft.txrealtimelocation.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.holders.HistroyHolder;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CounterCheckListBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.HistoryMissionBean;
|
||||
|
||||
import java.lang.invoke.LambdaConversionException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/4/2 - 9:15 AM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 历史任务
|
||||
*/
|
||||
public class HistoryMissionAdapter extends BaseRecyclerAdapter<CounterCheckListBean.RowsBean, HistroyHolder> {
|
||||
public HistoryMissionAdapter(Context ctx, List<CounterCheckListBean.RowsBean> list) {
|
||||
super(ctx, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HistroyHolder createHolder(ViewGroup parent, int viewType) {
|
||||
View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_history, parent, false);
|
||||
return new HistroyHolder(itemView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindHolder(HistroyHolder holder, int i) {
|
||||
CounterCheckListBean.RowsBean bean = mData.get(i);
|
||||
holder.mTvName.setText(bean.getNameJoinByEnterpriseId());
|
||||
holder.mTvAddress.setText(bean.getAddressJoinByEnterpriseId());
|
||||
holder.mTvPeo.setText(bean.getMasterJoinByEnterpriseId());
|
||||
if (bean.getCheckType() == 1) {
|
||||
holder.mTvType.setText("检查");
|
||||
} else {
|
||||
holder.mTvType.setText("复查");
|
||||
}
|
||||
if (bean.getIsComplete() == 0) {
|
||||
holder.mTvState.setText("未完成");
|
||||
} else {
|
||||
holder.mTvState.setText("完成");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.sucstepsoft.txrealtimelocation.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.holders.HistroyHolder;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.HistoryMissionBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/4/2 - 6:08 PM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class MissionDetailAdapter extends BaseRecyclerAdapter<HistoryMissionBean, HistroyHolder> {
|
||||
|
||||
public MissionDetailAdapter(Context ctx, List<HistoryMissionBean> list) {
|
||||
super(ctx, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HistroyHolder createHolder(ViewGroup parent, int viewType) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindHolder(HistroyHolder holder, int i) {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.sucstepsoft.txrealtimelocation.adapters.holders;
|
||||
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.sucstepsoft.txrealtimelocation.R;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/4/2 - 10:01 AM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class CounterCheckListHolder extends RecyclerView.ViewHolder {
|
||||
public TextView mTvName;
|
||||
public TextView mTvPeo;
|
||||
public TextView mTvAddress;
|
||||
|
||||
public CounterCheckListHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
mTvName = itemView.findViewById(R.id.tv_name);
|
||||
mTvPeo = itemView.findViewById(R.id.tv_peo);
|
||||
mTvAddress = itemView.findViewById(R.id.tv_address);
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.sucstepsoft.txrealtimelocation.adapters.holders;
|
||||
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v7.widget.AppCompatSpinner;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.sucstepsoft.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.widget.StateCheckView;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/4/2 - 10:47 AM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 复查选项
|
||||
*/
|
||||
public class CounterCheckOptionHolder extends RecyclerView.ViewHolder {
|
||||
public TextView mTvTitle;
|
||||
public StateCheckView mScvOptions;
|
||||
public RecyclerView mRlvPhotos;
|
||||
public LinearLayout mLlContent;
|
||||
public AppCompatSpinner mSpinner;
|
||||
public RadioGroup mRg;
|
||||
public LinearLayout mLlSp;
|
||||
public RadioButton mRbNow;
|
||||
public CounterCheckOptionHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
mTvTitle = itemView.findViewById(R.id.tv_title);
|
||||
mScvOptions = itemView.findViewById(R.id.scv_options);
|
||||
mRlvPhotos = itemView.findViewById(R.id.rlv_photos);
|
||||
mLlContent = itemView.findViewById(R.id.ll_content);
|
||||
mSpinner = itemView.findViewById(R.id.sp_term);
|
||||
mRg = itemView.findViewById(R.id.rg_term);
|
||||
mRbNow = itemView.findViewById(R.id.rb_now);
|
||||
mLlSp = itemView.findViewById(R.id.ll_sp);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.sucstepsoft.txrealtimelocation.adapters.holders;
|
||||
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.sucstepsoft.txrealtimelocation.R;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/4/2 - 9:14 AM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class HistroyHolder extends RecyclerView.ViewHolder {
|
||||
public TextView mTvName;
|
||||
public TextView mTvPeo;
|
||||
public TextView mTvAddress;
|
||||
public TextView mTvState;
|
||||
public TextView mTvType;
|
||||
|
||||
public HistroyHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
mTvName = itemView.findViewById(R.id.tv_name);
|
||||
mTvPeo = itemView.findViewById(R.id.tv_peo);
|
||||
mTvAddress = itemView.findViewById(R.id.tv_address);
|
||||
mTvState = itemView.findViewById(R.id.tv_state);
|
||||
mTvType = itemView.findViewById(R.id.tv_type);
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.sucstepsoft.txrealtimelocation.adapters.holders;
|
||||
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/4/2 - 6:07 PM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class MissionDetailHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
public MissionDetailHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
}
|
||||
}
|
@ -39,7 +39,7 @@ public class BaseApplication extends MultiDexApplication {
|
||||
super.onCreate();
|
||||
// initLeak();
|
||||
initJPush();
|
||||
CrashReport.initCrashReport(getApplicationContext(), "ff95776367", false);
|
||||
// CrashReport.initCrashReport(getApplicationContext(), "ff95776367", false);
|
||||
sInitialized = true;
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ public class CompanyListDataBean {
|
||||
* industryDictionaryName : string
|
||||
* industryJoinByEnterpriseId : string
|
||||
* masterJoinByEnterpriseId : string
|
||||
* nameJoinByEnterpriseId : string
|
||||
* nameJoinByEnterpriseId : stringa
|
||||
* phoneJoinByEnterpriseId : string
|
||||
* riskOperationDictionaryName : string
|
||||
* riskOperationJoinByEnterpriseId : string
|
||||
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,54 @@
|
||||
package com.sucstepsoft.txrealtimelocation.beans;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/4/2 - 11:28 AM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class CounterCheckOptionsBean {
|
||||
|
||||
/**
|
||||
* checkItemId : a1c27ea5-40dd-4cc8-974c-d387f8ba428c
|
||||
* name : 照明
|
||||
* summary : 照明
|
||||
* type : 1
|
||||
*/
|
||||
|
||||
private String checkItemId;
|
||||
private String name;
|
||||
private String summary;
|
||||
private int type;
|
||||
|
||||
public String getCheckItemId() {
|
||||
return checkItemId;
|
||||
}
|
||||
|
||||
public void setCheckItemId(String checkItemId) {
|
||||
this.checkItemId = checkItemId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getSummary() {
|
||||
return summary;
|
||||
}
|
||||
|
||||
public void setSummary(String summary) {
|
||||
this.summary = summary;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
@ -0,0 +1,134 @@
|
||||
package com.sucstepsoft.txrealtimelocation.beans;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/4/2 - 9:14 AM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class HistoryMissionBean {
|
||||
|
||||
/**
|
||||
* hiddenDangerReportId : 8ac0122b-67b5-4942-8741-4c57cbc2ef0e
|
||||
* checkId : ce71202b-d4a5-4d94-8140-e30c37aec336
|
||||
* checkItemId : 374f2d89-03f6-4373-a728-35d58d076f87
|
||||
* nameJoinByCheckItemId : 煤气
|
||||
* summaryJoinByCheckItemId : 煤气
|
||||
* typeJoinByCheckItemId : 1
|
||||
* checkResult : 1
|
||||
* rectificationType : 0
|
||||
* immediatelyChangeType : 1
|
||||
* rectificationDays : 1
|
||||
* summary :
|
||||
* scenePhotos :
|
||||
*/
|
||||
|
||||
private String hiddenDangerReportId;
|
||||
private String checkId;
|
||||
private String checkItemId;
|
||||
private String nameJoinByCheckItemId;
|
||||
private String summaryJoinByCheckItemId;
|
||||
private String typeJoinByCheckItemId;
|
||||
private int checkResult;
|
||||
private int rectificationType;
|
||||
private int immediatelyChangeType;
|
||||
private int rectificationDays;
|
||||
private String summary;
|
||||
private String scenePhotos;
|
||||
|
||||
public String getHiddenDangerReportId() {
|
||||
return hiddenDangerReportId;
|
||||
}
|
||||
|
||||
public void setHiddenDangerReportId(String hiddenDangerReportId) {
|
||||
this.hiddenDangerReportId = hiddenDangerReportId;
|
||||
}
|
||||
|
||||
public String getCheckId() {
|
||||
return checkId;
|
||||
}
|
||||
|
||||
public void setCheckId(String checkId) {
|
||||
this.checkId = checkId;
|
||||
}
|
||||
|
||||
public String getCheckItemId() {
|
||||
return checkItemId;
|
||||
}
|
||||
|
||||
public void setCheckItemId(String checkItemId) {
|
||||
this.checkItemId = checkItemId;
|
||||
}
|
||||
|
||||
public String getNameJoinByCheckItemId() {
|
||||
return nameJoinByCheckItemId;
|
||||
}
|
||||
|
||||
public void setNameJoinByCheckItemId(String nameJoinByCheckItemId) {
|
||||
this.nameJoinByCheckItemId = nameJoinByCheckItemId;
|
||||
}
|
||||
|
||||
public String getSummaryJoinByCheckItemId() {
|
||||
return summaryJoinByCheckItemId;
|
||||
}
|
||||
|
||||
public void setSummaryJoinByCheckItemId(String summaryJoinByCheckItemId) {
|
||||
this.summaryJoinByCheckItemId = summaryJoinByCheckItemId;
|
||||
}
|
||||
|
||||
public String getTypeJoinByCheckItemId() {
|
||||
return typeJoinByCheckItemId;
|
||||
}
|
||||
|
||||
public void setTypeJoinByCheckItemId(String typeJoinByCheckItemId) {
|
||||
this.typeJoinByCheckItemId = typeJoinByCheckItemId;
|
||||
}
|
||||
|
||||
public int getCheckResult() {
|
||||
return checkResult;
|
||||
}
|
||||
|
||||
public void setCheckResult(int checkResult) {
|
||||
this.checkResult = checkResult;
|
||||
}
|
||||
|
||||
public int getRectificationType() {
|
||||
return rectificationType;
|
||||
}
|
||||
|
||||
public void setRectificationType(int rectificationType) {
|
||||
this.rectificationType = rectificationType;
|
||||
}
|
||||
|
||||
public int getImmediatelyChangeType() {
|
||||
return immediatelyChangeType;
|
||||
}
|
||||
|
||||
public void setImmediatelyChangeType(int immediatelyChangeType) {
|
||||
this.immediatelyChangeType = immediatelyChangeType;
|
||||
}
|
||||
|
||||
public int getRectificationDays() {
|
||||
return rectificationDays;
|
||||
}
|
||||
|
||||
public void setRectificationDays(int rectificationDays) {
|
||||
this.rectificationDays = rectificationDays;
|
||||
}
|
||||
|
||||
public String getSummary() {
|
||||
return summary;
|
||||
}
|
||||
|
||||
public void setSummary(String summary) {
|
||||
this.summary = summary;
|
||||
}
|
||||
|
||||
public String getScenePhotos() {
|
||||
return scenePhotos;
|
||||
}
|
||||
|
||||
public void setScenePhotos(String scenePhotos) {
|
||||
this.scenePhotos = scenePhotos;
|
||||
}
|
||||
}
|
@ -11,8 +11,11 @@ import com.sucstepsoft.txrealtimelocation.beans.CheckSignOffBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CommunityBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CompanyDetailBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CompanyListDataBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CounterCheckListBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CounterCheckOptionsBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.DepartmentBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.DictBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.HistoryMissionBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.IssueSubBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.LeaveDetailBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.LeaveListBean;
|
||||
@ -643,4 +646,64 @@ public interface LocationApiService {
|
||||
@DELETE("enterpriseofgridoperator/deleteenterpriseofgridoperator/{ids}")
|
||||
Observable<SuccessBean> doUnBindCompany(@Path("ids") String id, @Header("token") String token);
|
||||
|
||||
|
||||
//复查列表
|
||||
@Headers({"base_url_name:dict", "Content-Type: application/json", "Accept: application/json"})
|
||||
@GET("check/listpagerecheckofmine")
|
||||
Observable<CounterCheckListBean> getCounterCheckList(@Query("page") String page, @Header("token") String token);
|
||||
|
||||
//复查列表-name
|
||||
@Headers({"base_url_name:dict", "Content-Type: application/json", "Accept: application/json"})
|
||||
@GET("check/listpagerecheckofmine")
|
||||
Observable<CounterCheckListBean> getCounterCheckListByName(@Query("page") String page, @Query("keywords") String name, @Header("token") String token);
|
||||
|
||||
//复查列表-type
|
||||
@Headers({"base_url_name:dict", "Content-Type: application/json", "Accept: application/json"})
|
||||
@GET("check/listpagerecheckofmine")
|
||||
Observable<CounterCheckListBean> getCounterCheckListByType(@Query("page") String page, @Query("type") String type, @Header("token") String token);
|
||||
|
||||
//复查列表-all
|
||||
@Headers({"base_url_name:dict", "Content-Type: application/json", "Accept: application/json"})
|
||||
@GET("check/listpagerecheckofmine")
|
||||
Observable<CounterCheckListBean> getCounterCheckListByAll(@Query("page") String page, @Query("keywords") String name, @Query("type") String type, @Header("token") String token);
|
||||
|
||||
//获取复查项列表
|
||||
//GET /app/check/listcheckitemunpassbycheckid/{checkId}
|
||||
@Headers({"base_url_name:dict", "Content-Type: application/json", "Accept: application/json"})
|
||||
@GET("check/listcheckitemunpassbycheckid/{checkId}")
|
||||
Observable<List<CounterCheckOptionsBean>> getCounterCheckOptions(@Path("checkId") String checkId, @Header("token") String token);
|
||||
|
||||
//保存复查结果
|
||||
@Headers({"base_url_name:dict", "Content-Type: application/json", "Accept: application/json"})
|
||||
@POST("check/saverecheck/{checkId}")
|
||||
Observable<SuccessBean> doSaveCounterCheckOptions(@Body RequestBody leaveBody, @Path("checkId") String checkId, @Header("token") String token);
|
||||
|
||||
|
||||
//我的历史任务列表
|
||||
//check/listpagecheckofmine
|
||||
@Headers({"base_url_name:dict", "Content-Type: application/json", "Accept: application/json"})
|
||||
@GET("check/listpagecheckofmine")
|
||||
Observable<CounterCheckListBean> getMineCheckList(@Query("page") String page, @Header("token") String token);
|
||||
|
||||
//历史任务-name
|
||||
@Headers({"base_url_name:dict", "Content-Type: application/json", "Accept: application/json"})
|
||||
@GET("check/listpagecheckofmine")
|
||||
Observable<CounterCheckListBean> getMineCheckListByName(@Query("page") String page, @Query("keywords") String name, @Header("token") String token);
|
||||
|
||||
//历史任务-type
|
||||
@Headers({"base_url_name:dict", "Content-Type: application/json", "Accept: application/json"})
|
||||
@GET("check/listpagecheckofmine")
|
||||
Observable<CounterCheckListBean> getMineCheckListByType(@Query("page") String page, @Query("type") String type, @Header("token") String token);
|
||||
|
||||
//历史任务-all
|
||||
@Headers({"base_url_name:dict", "Content-Type: application/json", "Accept: application/json"})
|
||||
@GET("check/listpagecheckofmine")
|
||||
Observable<CounterCheckListBean> getMineCheckListByAll(@Query("page") String page, @Query("keywords") String name, @Query("type") String type, @Header("token") String token);
|
||||
|
||||
//历史任务详情
|
||||
//check/getcheckbyid/{checkId}
|
||||
@Headers({"base_url_name:dict", "Content-Type: application/json", "Accept: application/json"})
|
||||
@GET("check/listcheckitembycheckid/{checkId}")
|
||||
Observable<HistoryMissionBean> getHistoryDetail(@Path("checkId") String checkId, @Header("token") String token);
|
||||
|
||||
}
|
||||
|
@ -43,7 +43,16 @@
|
||||
style="@style/company_content"
|
||||
android:text="企业名称企业名称企业名称企业名称企业名称" />
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_unclaim"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/sel_btn_submit"
|
||||
android:text="企业不配合"
|
||||
android:textColor="@color/white" />
|
||||
</LinearLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
|
@ -44,7 +44,7 @@
|
||||
android:clickable="true"
|
||||
android:drawableRight="@drawable/ic_arrow_gray_down"
|
||||
android:focusable="true"
|
||||
android:hint="请选择单位类型"
|
||||
android:hint="请选择企业类型"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/black"
|
||||
tools:text="单位类型" />
|
||||
|
132
app/src/main/res/layout/activity_counter_check_main.xml
Normal file
132
app/src/main/res/layout/activity_counter_check_main.xml
Normal file
@ -0,0 +1,132 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
tools:context=".activitys.countercheck.CounterCheckMainActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_company_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/shp_rectangle_gray"
|
||||
android:gravity="left"
|
||||
android:hint="@string/hit_company_name"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="15sp"
|
||||
tools:text="" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_com_type"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/shp_rectangle_gray"
|
||||
android:clickable="true"
|
||||
android:drawableRight="@drawable/ic_arrow_gray_down"
|
||||
android:focusable="true"
|
||||
android:hint="请选择企业类型"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/black"
|
||||
tools:text="单位类型" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_clear"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="30dp"
|
||||
android:background="@drawable/sel_btn_submit_red"
|
||||
android:padding="0dp"
|
||||
android:text="清空"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_search"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:background="@drawable/sel_btn_submit"
|
||||
android:padding="0dp"
|
||||
android:text="搜索"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@color/gray_bg" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/pb_loading"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminateBehavior="repeat"
|
||||
android:indeterminateDrawable="@drawable/anim_loading" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_empty"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:background="@drawable/ic_empty_data" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_error_hint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:clickable="true"
|
||||
android:textColor="@color/black"
|
||||
tools:text="加载数据失败" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.jcodecraeer.xrecyclerview.XRecyclerView
|
||||
android:id="@+id/xlv_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp" />
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
66
app/src/main/res/layout/activity_counter_check_options.xml
Normal file
66
app/src/main/res/layout/activity_counter_check_options.xml
Normal file
@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
tools:context=".activitys.countercheck.CounterCheckOptionsActivity">
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardPreventCornerOverlap="true"
|
||||
app:cardUseCompatPadding="false">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_company_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
<TextView
|
||||
style="@style/company_name_title"
|
||||
android:text="企业名称" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
style="@style/company_content"
|
||||
tools:text="企业名称企业名称企业名称企业名称企业名称" />
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/company_name_title"
|
||||
android:text="主要负责人" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_peo"
|
||||
style="@style/company_content"
|
||||
android:text="企业名称企业名称企业名称企业名称企业名称" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_unclaim"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/sel_btn_submit"
|
||||
android:text="企业不配合"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
</LinearLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/rlv_options"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:layoutManager="LinearLayoutManager"
|
||||
tools:listitem="@layout/item_options" />
|
||||
</LinearLayout>
|
16
app/src/main/res/layout/activity_history_detial.xml
Normal file
16
app/src/main/res/layout/activity_history_detial.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/gray"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp"
|
||||
tools:context=".activitys.issue.HistoryDetialActivity">
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/rlv_detail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
@ -1,9 +1,133 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".activitys.issue.HistoryListActivity">
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
tools:context=".activitys.companylib.CompanyLibActivity">
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_company_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/shp_rectangle_gray"
|
||||
android:gravity="left"
|
||||
android:hint="@string/hit_company_name"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="15sp"
|
||||
tools:text="" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_com_type"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/shp_rectangle_gray"
|
||||
android:clickable="true"
|
||||
android:drawableRight="@drawable/ic_arrow_gray_down"
|
||||
android:focusable="true"
|
||||
android:hint="请选择企业类型"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/black"
|
||||
tools:text="单位类型" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_clear"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="30dp"
|
||||
android:background="@drawable/sel_btn_submit_red"
|
||||
android:padding="0dp"
|
||||
android:text="清空"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_search"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:background="@drawable/sel_btn_submit"
|
||||
android:padding="0dp"
|
||||
android:text="搜索"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@color/gray_bg" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/pb_loading"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminateBehavior="repeat"
|
||||
android:indeterminateDrawable="@drawable/anim_loading" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_empty"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:background="@drawable/ic_empty_data" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_error_hint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:clickable="true"
|
||||
android:textColor="@color/black"
|
||||
tools:text="加载数据失败" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.jcodecraeer.xrecyclerview.XRecyclerView
|
||||
android:id="@+id/xlv_com_lib"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -44,7 +44,7 @@
|
||||
android:clickable="true"
|
||||
android:drawableRight="@drawable/ic_arrow_gray_down"
|
||||
android:focusable="true"
|
||||
android:hint="请选择单位类型"
|
||||
android:hint="请选择企业类型"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/black"
|
||||
tools:text="单位类型" />
|
||||
|
@ -1,9 +1,133 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".activitys.mine.MineMissionActivity">
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
tools:context=".activitys.companylib.CompanyLibActivity">
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_company_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/shp_rectangle_gray"
|
||||
android:gravity="left"
|
||||
android:hint="@string/hit_company_name"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="15sp"
|
||||
tools:text="" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_com_type"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/shp_rectangle_gray"
|
||||
android:clickable="true"
|
||||
android:drawableRight="@drawable/ic_arrow_gray_down"
|
||||
android:focusable="true"
|
||||
android:hint="请选择企业类型"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/black"
|
||||
tools:text="单位类型" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_clear"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="30dp"
|
||||
android:background="@drawable/sel_btn_submit_red"
|
||||
android:padding="0dp"
|
||||
android:text="清空"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_search"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:background="@drawable/sel_btn_submit"
|
||||
android:padding="0dp"
|
||||
android:text="搜索"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@color/gray_bg" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/pb_loading"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminateBehavior="repeat"
|
||||
android:indeterminateDrawable="@drawable/anim_loading" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_empty"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:background="@drawable/ic_empty_data" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_error_hint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:clickable="true"
|
||||
android:textColor="@color/black"
|
||||
tools:text="加载数据失败" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.jcodecraeer.xrecyclerview.XRecyclerView
|
||||
android:id="@+id/xlv_com_lib"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -44,7 +44,7 @@
|
||||
android:clickable="true"
|
||||
android:drawableRight="@drawable/ic_arrow_gray_down"
|
||||
android:focusable="true"
|
||||
android:hint="请选择单位类型"
|
||||
android:hint="请选择企业类型"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/black"
|
||||
tools:text="单位类型" />
|
||||
|
34
app/src/main/res/layout/item_counter_check.xml
Normal file
34
app/src/main/res/layout/item_counter_check.xml
Normal file
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp"
|
||||
tools:text="名称" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_peo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="负责人" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_address"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="地址" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:background="@color/divider_line_color" />
|
||||
</LinearLayout>
|
105
app/src/main/res/layout/item_counter_check_options.xml
Normal file
105
app/src/main/res/layout/item_counter_check_options.xml
Normal file
@ -0,0 +1,105 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:background="@drawable/shape_rectangle_white"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="5dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="6"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="15sp"
|
||||
tools:text="测试数据" />
|
||||
|
||||
<com.sucstepsoft.txrealtimelocation.widget.StateCheckView
|
||||
android:id="@+id/scv_options"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:background="@color/gray_bg" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/rg_term"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_now"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:checked="true"
|
||||
android:text="立即整改" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_term"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="限期整改" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_coor"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="不配合" />
|
||||
</RadioGroup>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_sp"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/sp_square_btn_blue_rim"
|
||||
android:padding="2dp">
|
||||
|
||||
<android.support.v7.widget.AppCompatSpinner
|
||||
android:id="@+id/sp_term"
|
||||
style="@style/common_spinner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:popupTheme="@style/common_spinner"
|
||||
android:spinnerMode="dropdown"
|
||||
app:theme="@style/common_spinner" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/rlv_photos"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
62
app/src/main/res/layout/item_history.xml
Normal file
62
app/src/main/res/layout/item_history.xml
Normal file
@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp"
|
||||
tools:text="名称" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_peo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="负责人" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_address"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="地址" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_state"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:background="@drawable/shape_btn_green_sel"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingRight="10dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp"
|
||||
tools:text="当前状态" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_type"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/text_blue1"
|
||||
android:textSize="12sp"
|
||||
tools:text="复查" />
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:background="@color/divider_line_color" />
|
||||
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user