diff --git a/app/release/output.json b/app/release/output.json index 1caf134..f72fe2b 100755 --- a/app/release/output.json +++ b/app/release/output.json @@ -1 +1 @@ -[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":3,"versionName":"1.0.2","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] \ No newline at end of file +[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":4,"versionName":"1.0.3","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] \ No newline at end of file diff --git a/app/release/yj-zs-1.apk b/app/release/yj-zs-1.apk new file mode 100644 index 0000000..3cde9c0 Binary files /dev/null and b/app/release/yj-zs-1.apk differ diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 674158f..a231109 100755 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -47,12 +47,32 @@ android:supportsRtl="true" android:theme="@style/AppTheme" tools:ignore="GoogleAppIndexingWarning"> - - - - - - + + + + + + + + @@ -196,7 +216,10 @@ - + diff --git a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/base/MainActivity.java b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/base/MainActivity.java index 170f3bc..6e8da64 100755 --- a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/base/MainActivity.java +++ b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/base/MainActivity.java @@ -30,7 +30,9 @@ 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.HistoryDetialActivity; import com.sucstepsoft.txrealtimelocation.activitys.issue.HistoryListActivity; +import com.sucstepsoft.txrealtimelocation.activitys.issue.PublicAreaActivity; import com.sucstepsoft.txrealtimelocation.activitys.lawlib.LawLibActivity; import com.sucstepsoft.txrealtimelocation.activitys.companylib.CompanyLibActivity; import com.sucstepsoft.txrealtimelocation.activitys.issue.CheckOptionsActivity; @@ -91,6 +93,8 @@ public class MainActivity extends BaseActivity { TextView mTvRule; @BindView(R.id.tv_online) TextView mTvOnline; + @BindView(R.id.ll_history) + LinearLayout mllHistory; private String[] permissions = new String[]{ PermissionConstants.STORAGE, PermissionConstants.PHONE, @@ -98,11 +102,12 @@ public class MainActivity extends BaseActivity { }; private Unbinder mBind; private List mFuncs = new ArrayList<>(); - 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_law}; + private String[] mBtnStrs = new String[]{"企业信息", "隐患上报", "隐患复查", "我的任务", "公共区域", "法律法规"}; + // private String[] mBtnStrs = new String[]{"企业信息", "隐患上报", "隐患复查", "我的任务", "历史任务", "法律法规"}; + private int[] mBtnIds = new int[]{R.drawable.ic_main_c_info, R.drawable.ic_main_report, R.drawable.ic_main_risk, + R.drawable.ic_main_mine, + R.drawable.ic_main_history, + R.drawable.ic_main_law}; private Gson mGson = null; private AlertDialog mGpsWeakDialog; @@ -175,6 +180,9 @@ public class MainActivity extends BaseActivity { case "历史任务": intent = new Intent(this, HistoryListActivity.class); break; + case "公共区域": + intent = new Intent(this, PublicAreaActivity.class); + break; } startActivity(intent); } @@ -294,6 +302,7 @@ public class MainActivity extends BaseActivity { */ @OnClick({ R.id.ll_mine_issue, + R.id.ll_history, R.id.tv_sign, R.id.tv_rule, R.id.ll_user_center, @@ -318,6 +327,9 @@ public class MainActivity extends BaseActivity { break; case R.id.tv_rule://签到规则 break; + case R.id.ll_history://历史任务 + startActivity(new Intent(MainActivity.this, HistoryListActivity.class)); + break; } } diff --git a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/companylib/CompanyDetailActivity.java b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/companylib/CompanyDetailActivity.java index 3e0b54a..cc8a3b4 100644 --- a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/companylib/CompanyDetailActivity.java +++ b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/companylib/CompanyDetailActivity.java @@ -6,6 +6,7 @@ import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.RecyclerView; import android.text.TextUtils; import android.view.View; +import android.widget.LinearLayout; import android.widget.TextView; import com.sucstepsoft.cm_utils.core.retrofit_net.BaseUrlApi; @@ -65,6 +66,16 @@ public class CompanyDetailActivity extends BaseActivity { RecyclerView mRlvDoor; @BindView(R.id.rlv_place) RecyclerView mRlvPlace; + @BindView(R.id.tv_com_p) + TextView mTvComP; + @BindView(R.id.tv_scope) + TextView mTvScope; + @BindView(R.id.tv_code) + TextView mTvCode; + @BindView(R.id.tv_trade_1) + TextView mTvTrade1; + @BindView(R.id.ll_company_info) + LinearLayout mLlCompanyInfo; private Unbinder mBind; private CompanyDetailBean mDetailBean; private String mId; @@ -88,7 +99,6 @@ public class CompanyDetailActivity extends BaseActivity { startActivity(intent); }); mId = getIntent().getStringExtra("id"); - getCompanyDetailById(mId); } @Override @@ -137,9 +147,14 @@ public class CompanyDetailActivity extends BaseActivity { mTvArea3.setText(mDetailBean.getArea3DictionaryName()); mTvArea4.setText(mDetailBean.getArea4DictionaryName()); mTvArea5.setText(mDetailBean.getArea5DictionaryName()); + mTvType.setText(mDetailBean.getTypeDictionaryName()); mTvName.setText(mDetailBean.getName()); mTvPeo.setText(mDetailBean.getMaster()); mTvPhone.setText(mDetailBean.getPhone()); + mTvComP.setText(mDetailBean.getLegalPerson()); + mTvScope.setText(mDetailBean.getSummary()); + mTvCode.setText(mDetailBean.getBussinessRegNum()); + mTvTrade1.setText(mDetailBean.getIndustryTypeDictionaryName()); mTvDetAddress.setText(mDetailBean.getAddress()); mTvPeoCount.setText(mDetailBean.getEngagedCount() + "人"); mTvRisk.setText(mDetailBean.getRiskOperationDictionaryName()); @@ -199,4 +214,5 @@ public class CompanyDetailActivity extends BaseActivity { mBind.unbind(); mDetailDis.dispose(); } + } diff --git a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/companylib/CompanyInfoEditActivity.java b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/companylib/CompanyInfoEditActivity.java index 303177c..782b421 100644 --- a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/companylib/CompanyInfoEditActivity.java +++ b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/companylib/CompanyInfoEditActivity.java @@ -6,14 +6,14 @@ import android.database.Cursor; import android.graphics.Color; import android.net.Uri; import android.os.Build; -import android.provider.CallLog; +import android.os.Bundle; import android.provider.MediaStore; import android.support.v4.content.FileProvider; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.RecyclerView; import android.text.TextUtils; import android.view.Gravity; -import android.widget.Button; +import android.view.View; import android.widget.EditText; import android.widget.TextView; @@ -22,7 +22,6 @@ import com.bigkoo.pickerview.view.OptionsPickerView; 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.beans.DictionaryBean; import com.sucstepsoft.cm_utils.core.retrofit_net.BaseUrlApi; import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager; import com.sucstepsoft.cm_utils.core.widget.base.AddPhotoAdapter; @@ -41,7 +40,6 @@ import com.sucstepsoft.txrealtimelocation.beans.CompanyDetailBean; import com.sucstepsoft.txrealtimelocation.beans.CompanyEnterBean; import com.sucstepsoft.txrealtimelocation.beans.DictBean; import com.sucstepsoft.txrealtimelocation.beans.SuccessBean; -import com.sucstepsoft.txrealtimelocation.beans.TypeListBean; import com.sucstepsoft.txrealtimelocation.net.LocationApiService; import java.io.File; @@ -66,6 +64,12 @@ import top.zibin.luban.OnCompressListener; */ public class CompanyInfoEditActivity extends BaseActivity { + @BindView(R.id.et_company_p) + EditText mEtCompanyP; + @BindView(R.id.et_company_code) + EditText mEtCompanyCode; + @BindView(R.id.et_company_scope) + EditText mEtCompanyScope; private Unbinder mBind; private String mId; private CompanyDetailBean mDetailBean; @@ -94,8 +98,6 @@ public class CompanyInfoEditActivity extends BaseActivity { RecyclerView mRlvDoor; @BindView(R.id.rlv_place) RecyclerView mRlvPlace; - @BindView(R.id.btn_submit) - Button mBtnSubmit; @BindView(R.id.tv_qixian) TextView mTvArea3; @BindView(R.id.tv_street) @@ -106,6 +108,8 @@ public class CompanyInfoEditActivity extends BaseActivity { TextView mTvArea1; @BindView(R.id.tv_shi) TextView mTvArea2; + @BindView(R.id.tv_trade_1) + TextView mTvTrade1; private List mDoorPhotos; private List mPlacePhotos; @@ -113,8 +117,9 @@ public class CompanyInfoEditActivity extends BaseActivity { private String mPicPath; private String mDoorPhotoIds = ""; private String mPlacePhotoIds = ""; - private OptionsPickerView mTypePicker;//单位类型 + private OptionsPickerView mTradePicker;//管理行业 + private OptionsPickerView mTradePicker1;//管理行业 private OptionsPickerView mMArea1Picker; private OptionsPickerView mMArea2Picker; private OptionsPickerView mMArea3Picker; @@ -123,8 +128,10 @@ public class CompanyInfoEditActivity extends BaseActivity { private OptionsPickerView mCountyPicker;//旗县 private OptionsPickerView mStreetPicker;//街道 private OptionsPickerView mTraitPicker;//风险特点 + private OptionsPickerView mTypePicker;//单位类型 private List mTypeList = null;//单位类型 private List mTradeList = null;//管理行业 + private List mTradeList1 = null;//管理行业1 private List mArea1List = null;//省 private List mArea2List = null;//市 private List mArea3List = null;//旗县 @@ -133,6 +140,10 @@ public class CompanyInfoEditActivity extends BaseActivity { private List mTraitList = null;//风险特点 private String mSelTypeId = "";//单位类型ID private String mSelTradeId = "";//管理行业ID + private String code = "";//组织机构代码证 + private String companP = "";//企业法人 + private String scope = "";//营业范围 + private String mSelTrade1 = "";//行业 private String mSelArea1Id = "";//省 private String mSelArea2Id = "";//市 @@ -142,7 +153,6 @@ public class CompanyInfoEditActivity extends BaseActivity { private String mTraitId = "";//风险特点ID private String companyName = "";//企业名称 - private String regisAddress = "";//注册地址 private String detailAddress = "";//详细地址 private String praceNum = "";//从业人员数量 private String people = "";//主要负责人 @@ -151,6 +161,7 @@ public class CompanyInfoEditActivity extends BaseActivity { private AddPhotoAdapter mMPlacePhotoAdapter; private AddPhotoAdapter mMDoorPhotoAdapter; + @Override protected int setLayoutId() { return R.layout.activity_company_info_edit; @@ -164,7 +175,9 @@ public class CompanyInfoEditActivity extends BaseActivity { mId = getIntent().getStringExtra("id"); getCompanyDetail(mId); initPhotoView(); - mBtnSubmit.setOnClickListener(v -> doSubmit()); + mTvPublish.setVisibility(View.VISIBLE); + mTvPublish.setText("保存"); + mTvPublish.setOnClickListener(v -> doSubmit()); } private void initPhotoView() { @@ -227,6 +240,30 @@ public class CompanyInfoEditActivity extends BaseActivity { mTvArea5.setOnClickListener(v -> onShowArea5Picker()); mTvRisk.setOnClickListener(v -> onShowRiskPicker()); mTvTrade.setOnClickListener(v -> onShowTradePicker()); + mTvTrade1.setOnClickListener(v -> onShowTrade1Picker()); + } + + private void onShowTrade1Picker() { + hideSoftKeyboard(); + if (mTradeList1 != null && mTradeList1.size() > 0) { + mTradePicker1 = new OptionsPickerBuilder(mActivity, (options1, options2, options3, v) -> { + DictBean bean = mTradeList1.get(options1); + mSelTrade1 = bean.getDictionaryId(); + mTvTrade1.setText(bean.getDictionaryName()); + }).setTitleText("请选择") + .setCancelColor(Color.parseColor("#1189FF")) + .setSubmitColor(Color.parseColor("#1189FF")) + .setTitleColor(Color.parseColor("#1189FF")) + .build(); + mTradePicker1.setPicker(mTradeList1); + mTradePicker1.show(); + } else { + if (mTradeList1 == null) { + getDicList(PathConfig.DIC_TRADE_ID, 9); + } else { + ToastUtils.showShort("暂无数据"); + } + } } private void getCompanyDetail(String id) { @@ -321,25 +358,29 @@ public class CompanyInfoEditActivity extends BaseActivity { private void onShowTradePicker() { hideSoftKeyboard(); - if (mTradeList != null && mTradeList.size() > 0) { - mTradePicker = new OptionsPickerBuilder(mActivity, (options1, options2, options3, v) -> { - DictBean bean = mTradeList.get(options1); - mSelTradeId = bean.getDictionaryId(); - mTvTrade.setText(bean.getDictionaryName()); - }).setTitleText("请选择") - .setCancelColor(Color.parseColor("#1189FF")) - .setSubmitColor(Color.parseColor("#1189FF")) - .setTitleColor(Color.parseColor("#1189FF")) - .build(); - mTradePicker.setPicker(mTradeList); - mTradePicker.show(); + if (TextUtils.isEmpty(mSelTrade1)) { + ToastUtils.showShort("请先选择行业类型"); } else { - if (mTradeList == null) { - getDicList(PathConfig.DIC_TRADE_ID, 7); + if (mTradeList != null && mTradeList.size() > 0) { + mTradePicker = new OptionsPickerBuilder(mActivity, (options1, options2, options3, v) -> { + DictBean bean = mTradeList.get(options1); + mSelTradeId = bean.getDictionaryId(); + mTvTrade.setText(bean.getDictionaryName()); + }).setTitleText("请选择") + .setCancelColor(Color.parseColor("#1189FF")) + .setSubmitColor(Color.parseColor("#1189FF")) + .setTitleColor(Color.parseColor("#1189FF")) + .build(); + mTradePicker.setPicker(mTradeList); + mTradePicker.show(); } else { - ToastUtils.showShort("暂无数据"); - } + if (mTradeList == null) { + getDicList(mSelTrade1, 7); + } else { + ToastUtils.showShort("暂无数据"); + } + } } } @@ -448,12 +489,23 @@ public class CompanyInfoEditActivity extends BaseActivity { submitBean.setEngagedCount(Integer.parseInt(praceNum));//从业人数 submitBean.setPhone(phone);//电话 submitBean.setRiskOperation(mTraitId);//风险 - submitBean.setIndustry(mSelTradeId);//行业 + submitBean.setFactoryGate(mDoorPhotoIds); submitBean.setWorkplace(mPlacePhotoIds); submitBean.setArea1(mSelArea1Id); submitBean.setArea2(mSelArea2Id); submitBean.setArea3(mSelArea3Id); + + + submitBean.setIndustryType(mSelTrade1); + submitBean.setBussinessRegNum(code); + submitBean.setLegalPerson(companP); + submitBean.setSummary(scope); + + if (!TextUtils.isEmpty(mSelTradeId)) { + submitBean.setIndustry(mSelTradeId);//行业 + } + if (!TextUtils.isEmpty(mSelArea4Id)) { submitBean.setArea4(mSelArea4Id); } @@ -501,6 +553,21 @@ public class CompanyInfoEditActivity extends BaseActivity { ToastUtils.showShort("请输入企业名称"); return false; } + code = mEtCompanyCode.getText().toString().trim(); + if (TextUtils.isEmpty(code)) { + ToastUtils.showShort("请输入组织机构代码"); + return false; + } + scope = mEtCompanyScope.getText().toString().trim(); + if (TextUtils.isEmpty(scope)) { + ToastUtils.showShort("请输入营业范围"); + return false; + } + companP = mEtCompanyP.getText().toString().trim(); + if (TextUtils.isEmpty(companP)) { + ToastUtils.showShort("请输入企业法人"); + return false; + } detailAddress = mEtDetailAddress.getText().toString().trim(); if (TextUtils.isEmpty(detailAddress)) { ToastUtils.showShort("请输入企业详细地址"); @@ -525,7 +592,7 @@ public class CompanyInfoEditActivity extends BaseActivity { ToastUtils.showShort("请选择企业类型"); return false; } - if (TextUtils.isEmpty(mSelTradeId)) { + if (TextUtils.isEmpty(mSelTrade1)) { ToastUtils.showShort("请选择企业所属行业"); return false; } @@ -609,6 +676,10 @@ public class CompanyInfoEditActivity extends BaseActivity { mTraitList = dictBeans; onShowRiskPicker(); break; + case 9://管理行业一级 + mTradeList1 = dictBeans; + onShowTrade1Picker(); + break; } } @@ -925,6 +996,19 @@ public class CompanyInfoEditActivity extends BaseActivity { mSelTradeId = mDetailBean.getIndustry(); mTvTrade.setText(mDetailBean.getIndustryDictionaryName()); + scope = mDetailBean.getSummary(); + mEtCompanyScope.setText(scope); + + code = mDetailBean.getBussinessRegNum(); + mEtCompanyCode.setText(code); + + companP = mDetailBean.getLegalPerson(); + mEtCompanyP.setText(companP); + + + mTvTrade1.setText(mDetailBean.getIndustryTypeDictionaryName()); + mSelTrade1 = mDetailBean.getIndustryType(); + mDoorPhotos = new ArrayList<>(); mPlacePhotos = new ArrayList<>(); mDoorPhotos.add(new AddPhotoBean()); @@ -970,4 +1054,5 @@ public class CompanyInfoEditActivity extends BaseActivity { super.onDestroy(); mBind.unbind(); } + } diff --git a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/companylib/CompanyLibActivity.java b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/companylib/CompanyLibActivity.java index 524ff82..4abedc2 100644 --- a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/companylib/CompanyLibActivity.java +++ b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/companylib/CompanyLibActivity.java @@ -69,8 +69,8 @@ public class CompanyLibActivity extends BaseActivity { TextView mTvErrorHint; @BindView(R.id.btn_search) Button mBtnSearch; - @BindView(R.id.btn_clear) - Button mBtnClear; + @BindView(R.id.iv_clear) + ImageView mIvClear; private Unbinder mBind; @BindView(R.id.xlv_com_lib) XRecyclerView mRlvComList; @@ -144,7 +144,7 @@ public class CompanyLibActivity extends BaseActivity { getCompanyLibList(mCurrentPage, false); stateView(STATE_LOAD_LOADING); mBtnSearch.setOnClickListener(v -> searchCompany()); - mBtnClear.setOnClickListener(v -> { + mIvClear.setOnClickListener(v -> { mCurrentPage = 1; mCurrentType = 1; mSearchCompanyName = ""; diff --git a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/companylib/EnterCompanyInfoActivity.java b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/companylib/EnterCompanyInfoActivity.java index ab0d444..28d35ae 100644 --- a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/companylib/EnterCompanyInfoActivity.java +++ b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/companylib/EnterCompanyInfoActivity.java @@ -13,6 +13,7 @@ import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.RecyclerView; import android.text.TextUtils; import android.view.Gravity; +import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; @@ -22,7 +23,6 @@ import com.bigkoo.pickerview.view.OptionsPickerView; 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.beans.DictionaryBean; import com.sucstepsoft.cm_utils.core.retrofit_net.BaseUrlApi; import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager; import com.sucstepsoft.cm_utils.core.widget.base.AddPhotoAdapter; @@ -39,7 +39,6 @@ import com.sucstepsoft.txrealtimelocation.beans.BaseUserBean; import com.sucstepsoft.txrealtimelocation.beans.CompanyEnterBean; import com.sucstepsoft.txrealtimelocation.beans.DictBean; import com.sucstepsoft.txrealtimelocation.beans.SuccessBean; -import com.sucstepsoft.txrealtimelocation.beans.TypeListBean; import com.sucstepsoft.txrealtimelocation.net.LocationApiService; import java.io.File; @@ -52,7 +51,6 @@ import butterknife.Unbinder; import io.reactivex.Observer; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.Disposable; -import io.reactivex.observers.TestObserver; import io.reactivex.schedulers.Schedulers; import okhttp3.MediaType; import okhttp3.MultipartBody; @@ -89,8 +87,6 @@ public class EnterCompanyInfoActivity extends BaseActivity { RecyclerView mRlvDoor; @BindView(R.id.rlv_place) RecyclerView mRlvPlace; - @BindView(R.id.btn_submit) - Button mBtnSubmit; @BindView(R.id.tv_qixian) TextView mTvArea3; @BindView(R.id.tv_street) @@ -101,6 +97,14 @@ public class EnterCompanyInfoActivity extends BaseActivity { TextView mTvArea1; @BindView(R.id.tv_shi) TextView mTvArea2; + @BindView(R.id.et_company_p) + EditText mEtCompanyP; + @BindView(R.id.et_company_code) + EditText mEtCompanyCode; + @BindView(R.id.et_company_scope) + EditText mEtCompanyScope; + @BindView(R.id.tv_trade_1) + TextView mTvTrade1; private Unbinder mBind; private List mDoorPhotos; @@ -111,6 +115,7 @@ public class EnterCompanyInfoActivity extends BaseActivity { private String mPlacePhotoIds = ""; private OptionsPickerView mTradePicker;//管理行业 + private OptionsPickerView mTradePicker1;//管理行业 private OptionsPickerView mMArea1Picker; private OptionsPickerView mMArea2Picker; private OptionsPickerView mMArea3Picker; @@ -122,6 +127,7 @@ public class EnterCompanyInfoActivity extends BaseActivity { private OptionsPickerView mTypePicker;//单位类型 private List mTypeList = null;//单位类型 private List mTradeList = null;//管理行业 + private List mTradeList1 = null;//管理行业1 private List mArea1List = null;//省 private List mArea2List = null;//市 private List mArea3List = null;//旗县 @@ -130,6 +136,10 @@ public class EnterCompanyInfoActivity extends BaseActivity { private List mTraitList = null;//风险特点 private String mSelTypeId = "";//单位类型ID private String mSelTradeId = "";//管理行业ID + private String code = "";//组织机构代码证 + private String companP = "";//企业法人 + private String scope = "";//营业范围 + private String mSelTrade1 = "";//行业 private String mSelArea1Id = "";//省 private String mSelArea2Id = "";//市 @@ -138,9 +148,7 @@ public class EnterCompanyInfoActivity extends BaseActivity { private String mSelArea5Id = "";//村 社区 private String mTraitId = "";//风险特点ID - private String mTraitPId = "";//风险特点父ID private String companyName = "";//企业名称 - private String regisAddress = "";//注册地址 private String detailAddress = "";//详细地址 private String praceNum = "";//从业人员数量 private String people = "";//主要负责人 @@ -160,8 +168,10 @@ public class EnterCompanyInfoActivity extends BaseActivity { mTvBaseTitle.setText("企业信息录入"); refreshView(STATE_LOAD_SUCCESS); mBind = ButterKnife.bind(this); + mTvPublish.setVisibility(View.VISIBLE); + mTvPublish.setText("保存"); + mTvPublish.setOnClickListener(v -> doSubmit()); initPhotoView(); - mBtnSubmit.setOnClickListener(v -> doSubmit()); } private void initPhotoView() { @@ -224,6 +234,30 @@ public class EnterCompanyInfoActivity extends BaseActivity { mTvArea5.setOnClickListener(v -> onShowArea5Picker()); mTvRisk.setOnClickListener(v -> onShowRiskPicker()); mTvTrade.setOnClickListener(v -> onShowTradePicker()); + mTvTrade1.setOnClickListener(v -> onShowTrade1Picker()); + } + + private void onShowTrade1Picker() { + hideSoftKeyboard(); + if (mTradeList1 != null && mTradeList1.size() > 0) { + mTradePicker1 = new OptionsPickerBuilder(EnterCompanyInfoActivity.this, (options1, options2, options3, v) -> { + DictBean bean = mTradeList1.get(options1); + mSelTrade1 = bean.getDictionaryId(); + mTvTrade1.setText(bean.getDictionaryName()); + }).setTitleText("请选择") + .setCancelColor(Color.parseColor("#1189FF")) + .setSubmitColor(Color.parseColor("#1189FF")) + .setTitleColor(Color.parseColor("#1189FF")) + .build(); + mTradePicker1.setPicker(mTradeList1); + mTradePicker1.show(); + } else { + if (mTradeList1 == null) { + getDicList(PathConfig.DIC_TRADE_ID, 9); + } else { + ToastUtils.showShort("暂无数据"); + } + } } /** @@ -286,25 +320,29 @@ public class EnterCompanyInfoActivity extends BaseActivity { private void onShowTradePicker() { hideSoftKeyboard(); - if (mTradeList != null && mTradeList.size() > 0) { - mTradePicker = new OptionsPickerBuilder(EnterCompanyInfoActivity.this, (options1, options2, options3, v) -> { - DictBean bean = mTradeList.get(options1); - mSelTradeId = bean.getDictionaryId(); - mTvTrade.setText(bean.getDictionaryName()); - }).setTitleText("请选择") - .setCancelColor(Color.parseColor("#1189FF")) - .setSubmitColor(Color.parseColor("#1189FF")) - .setTitleColor(Color.parseColor("#1189FF")) - .build(); - mTradePicker.setPicker(mTradeList); - mTradePicker.show(); + if (TextUtils.isEmpty(mSelTrade1)) { + ToastUtils.showShort("请先选择行业类型"); } else { - if (mTradeList == null) { - getDicList(PathConfig.DIC_TRADE_ID, 7); + if (mTradeList != null && mTradeList.size() > 0) { + mTradePicker = new OptionsPickerBuilder(EnterCompanyInfoActivity.this, (options1, options2, options3, v) -> { + DictBean bean = mTradeList.get(options1); + mSelTradeId = bean.getDictionaryId(); + mTvTrade.setText(bean.getDictionaryName()); + }).setTitleText("请选择") + .setCancelColor(Color.parseColor("#1189FF")) + .setSubmitColor(Color.parseColor("#1189FF")) + .setTitleColor(Color.parseColor("#1189FF")) + .build(); + mTradePicker.setPicker(mTradeList); + mTradePicker.show(); } else { - ToastUtils.showShort("暂无数据"); - } + if (mTradeList == null) { + getDicList(mSelTrade1, 7); + } else { + ToastUtils.showShort("暂无数据"); + } + } } } @@ -413,12 +451,23 @@ public class EnterCompanyInfoActivity extends BaseActivity { submitBean.setEngagedCount(Integer.parseInt(praceNum));//从业人数 submitBean.setPhone(phone);//电话 submitBean.setRiskOperation(mTraitId);//风险 - submitBean.setIndustry(mSelTradeId);//行业 + submitBean.setFactoryGate(mDoorPhotoIds); submitBean.setWorkplace(mPlacePhotoIds); submitBean.setArea1(mSelArea1Id); submitBean.setArea2(mSelArea2Id); submitBean.setArea3(mSelArea3Id); + + + submitBean.setIndustryType(mSelTrade1); + submitBean.setBussinessRegNum(code); + submitBean.setLegalPerson(companP); + submitBean.setSummary(scope); + + if (!TextUtils.isEmpty(mSelTradeId)) { + submitBean.setIndustry(mSelTradeId);//行业 + } + if (!TextUtils.isEmpty(mSelArea4Id)) { submitBean.setArea4(mSelArea4Id); } @@ -466,6 +515,21 @@ public class EnterCompanyInfoActivity extends BaseActivity { ToastUtils.showShort("请输入企业名称"); return false; } + code = mEtCompanyCode.getText().toString().trim(); + if (TextUtils.isEmpty(code)) { + ToastUtils.showShort("请输入组织机构代码"); + return false; + } + scope = mEtCompanyScope.getText().toString().trim(); + if (TextUtils.isEmpty(scope)) { + ToastUtils.showShort("请输入营业范围"); + return false; + } + companP = mEtCompanyP.getText().toString().trim(); + if (TextUtils.isEmpty(companP)) { + ToastUtils.showShort("请输入企业法人"); + return false; + } detailAddress = mEtDetailAddress.getText().toString().trim(); if (TextUtils.isEmpty(detailAddress)) { ToastUtils.showShort("请输入企业详细地址"); @@ -490,7 +554,7 @@ public class EnterCompanyInfoActivity extends BaseActivity { ToastUtils.showShort("请选择企业类型"); return false; } - if (TextUtils.isEmpty(mSelTradeId)) { + if (TextUtils.isEmpty(mSelTrade1)) { ToastUtils.showShort("请选择企业所属行业"); return false; } @@ -574,6 +638,10 @@ public class EnterCompanyInfoActivity extends BaseActivity { mTraitList = dictBeans; onShowRiskPicker(); break; + case 9://管理行业一级 + mTradeList1 = dictBeans; + onShowTrade1Picker(); + break; } } diff --git a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/companylib/MineCompanyLibActivity.java b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/companylib/MineCompanyLibActivity.java index 585d58b..c6f08b8 100644 --- a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/companylib/MineCompanyLibActivity.java +++ b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/companylib/MineCompanyLibActivity.java @@ -62,8 +62,8 @@ public class MineCompanyLibActivity extends BaseActivity { TextView mTvErrorHint; @BindView(R.id.btn_search) Button mBtnSearch; - @BindView(R.id.btn_clear) - Button mBtnClear; + @BindView(R.id.iv_clear) + ImageView mBtnClear; private Unbinder mBind; @BindView(R.id.xlv_com_lib) XRecyclerView mRlvComList; diff --git a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/countercheck/CounterCheckMainActivity.java b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/countercheck/CounterCheckMainActivity.java index c8c8487..3a3165f 100644 --- a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/countercheck/CounterCheckMainActivity.java +++ b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/countercheck/CounterCheckMainActivity.java @@ -57,8 +57,8 @@ public class CounterCheckMainActivity extends BaseActivity { EditText mEtCompanyName; @BindView(R.id.tv_com_type) TextView mTvComType; - @BindView(R.id.btn_clear) - Button mBtnClear; + @BindView(R.id.iv_clear) + ImageView mBtnClear; @BindView(R.id.btn_search) Button mBtnSearch; @BindView(R.id.pb_loading) diff --git a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/countercheck/CounterCheckOptionsActivity.java b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/countercheck/CounterCheckOptionsActivity.java index ddcca45..274ea16 100644 --- a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/countercheck/CounterCheckOptionsActivity.java +++ b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/countercheck/CounterCheckOptionsActivity.java @@ -94,7 +94,7 @@ public class CounterCheckOptionsActivity extends BaseActivity { mTvName.setText(name); mTvPeo.setText(peo); mTvPublish.setVisibility(View.VISIBLE); - mTvPublish.setText("保存"); + mTvPublish.setText("上报"); mTvPublish.setOnClickListener(v -> buildConfirmData(mAdapter.getData())); mOptions = new ArrayList<>(); mAdapter = new CounterCheckOptionsAdapter(mActivity, mOptions); @@ -106,7 +106,7 @@ public class CounterCheckOptionsActivity extends BaseActivity { //选择图片 mCurrentIndex = i; showSelectPhoto(bean); - } else { + } else if (type == 2) { //预览 ArrayList list = new ArrayList<>(); list.add(bean.getPath()); @@ -114,6 +114,22 @@ public class CounterCheckOptionsActivity extends BaseActivity { intent.putExtra(PhotoActivity.TAG_IMGURL, list); intent.setClass(mActivity, PhotoActivity.class); startActivity(intent); + } else { + List photos = mAdapter.getData().get(i).getPhotos(); + if (photos.size() == 4) { + boolean isExist = false; + for (int j = 0; j < photos.size(); j++) { + AddPhotoBean photoBean = photos.get(j); + if (TextUtils.isEmpty(photoBean.getId())) { + isExist = true; + } + } + if (!isExist) { + mAdapter.getData().get(i).getPhotos().add(new AddPhotoBean()); + } + } + photos.remove(bean); + mAdapter.notifyDataSetChanged(); } }); getCounterCheckOptions(mCheckId); @@ -148,6 +164,7 @@ public class CounterCheckOptionsActivity extends BaseActivity { public void onNext(SuccessBean successBean) { dialog.dismiss(); ToastUtils.showShort("上报成功"); + setResult(223); finish(); } @@ -234,11 +251,7 @@ public class CounterCheckOptionsActivity extends BaseActivity { photoIds += o.getPhotos().get(j).getId() + ","; } } - if (photoIds.length() < 10) { - mMProgressDialog.dismiss(); - ToastUtils.showShort("检查项中存在未上传图片的项目"); - return; - } else { + if (photoIds.length() > 10) { bean.setScenePhotos(photoIds); } } else { @@ -264,11 +277,7 @@ public class CounterCheckOptionsActivity extends BaseActivity { photoIds += o.getPhotos().get(j).getId() + ","; } } - if (photoIds.length() < 10) { - mMProgressDialog.dismiss(); - ToastUtils.showShort("检查项中存在未上传图片的项目"); - return; - } else { + if (photoIds.length() > 10) { bean.setScenePhotos(photoIds); } } diff --git a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/CheckOptionsActivity.java b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/CheckOptionsActivity.java index 8e2ca05..fc6fecc 100644 --- a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/CheckOptionsActivity.java +++ b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/CheckOptionsActivity.java @@ -7,6 +7,7 @@ import android.database.Cursor; import android.net.Uri; import android.os.Build; import android.os.Bundle; +import android.provider.FontsContract; import android.provider.MediaStore; import android.support.v4.content.FileProvider; import android.support.v7.widget.LinearLayoutManager; @@ -24,6 +25,7 @@ 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.LogUtils; import com.sucstepsoft.cm_utils.utils.ProiderUtil; import com.sucstepsoft.cm_utils.utils.ToastUtils; import com.sucstepsoft.cm_utils.utils.UIUtil; @@ -87,7 +89,12 @@ public class CheckOptionsActivity extends BaseActivity { mTvBaseTitle.setText("企业检查"); mTvPublish.setVisibility(View.VISIBLE); mTvPublish.setText("确定"); - mTvPublish.setOnClickListener(v -> buildConfirmData(mAdapter.getData())); + mTvPublish.setOnClickListener(v -> { +// Gson gson = new Gson(); +// String s = gson.toJson(mAdapter.getData()); +// LogUtils.e(s); + buildConfirmData(mAdapter.getData()); + }); String id = getIntent().getStringExtra("id"); mCompanyId = getIntent().getStringExtra("cId"); String name = getIntent().getStringExtra("name"); @@ -110,7 +117,7 @@ public class CheckOptionsActivity extends BaseActivity { //选择图片 mCurrentIndex = i; showSelectPhoto(bean); - } else { + } else if (type == 2) { //预览 ArrayList list = new ArrayList<>(); list.add(bean.getPath()); @@ -118,6 +125,23 @@ public class CheckOptionsActivity extends BaseActivity { intent.putExtra(PhotoActivity.TAG_IMGURL, list); intent.setClass(CheckOptionsActivity.this, PhotoActivity.class); startActivity(intent); + } else { + //删除 + List photos = mAdapter.getData().get(i).getPhotos(); + if (photos.size() == 4) { + boolean isExist = false; + for (int j = 0; j < photos.size(); j++) { + AddPhotoBean photoBean = photos.get(j); + if (TextUtils.isEmpty(photoBean.getId())) { + isExist = true; + } + } + if (!isExist) { + mAdapter.getData().get(i).getPhotos().add(new AddPhotoBean()); + } + } + photos.remove(bean); + mAdapter.notifyDataSetChanged(); } }); getCheckOptions(id); @@ -151,6 +175,7 @@ public class CheckOptionsActivity extends BaseActivity { public void onNext(SuccessBean successBean) { dialog.dismiss(); ToastUtils.showShort("检查成功"); + setResult(223); finish(); } @@ -204,11 +229,7 @@ public class CheckOptionsActivity extends BaseActivity { photoIds += o.getPhotos().get(j).getId() + ","; } } - if (photoIds.length() < 10) { - mMProgressDialog.dismiss(); - ToastUtils.showShort("检查项中存在未上传图片的项目"); - return; - } else { + if (photoIds.length() > 10) { bean.setScenePhotos(photoIds); } } else { @@ -234,12 +255,11 @@ public class CheckOptionsActivity extends BaseActivity { photoIds += o.getPhotos().get(j).getId() + ","; } } - if (photoIds.length() < 10) { - mMProgressDialog.dismiss(); - ToastUtils.showShort("检查项中存在未上传图片的项目"); - return; - } else { + if (photoIds.length() > 10) { bean.setScenePhotos(photoIds); +// mMProgressDialog.dismiss(); +// ToastUtils.showShort("检查项中存在未上传图片的项目"); +// return; } } items.add(bean); @@ -330,7 +350,7 @@ public class CheckOptionsActivity extends BaseActivity { mPhotos.add(new AddPhotoBean()); Options o = new Options(); o.setId(checkOptionsbeans.get(i).getCheckItemId()); - o.setTitle(checkOptionsbeans.get(i).getSummaryJoinByCheckItemId()); + o.setTitle(checkOptionsbeans.get(i).getNameJoinByCheckItemId()); o.setPhotos(mPhotos); o.setIsMust(checkOptionsbeans.get(i).getType()); mOptions.add(o); diff --git a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/HistoryDetialActivity.java b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/HistoryDetialActivity.java index b193c56..401cbc4 100644 --- a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/HistoryDetialActivity.java +++ b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/HistoryDetialActivity.java @@ -1,7 +1,5 @@ package com.sucstepsoft.txrealtimelocation.activitys.issue; -import android.support.v7.app.AppCompatActivity; -import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; @@ -36,7 +34,6 @@ public class HistoryDetialActivity extends BaseActivity { @Override protected int setLayoutId() { return R.layout.activity_history_detial; - } @Override diff --git a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/HistoryListActivity.java b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/HistoryListActivity.java index 15a9057..3f06254 100644 --- a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/HistoryListActivity.java +++ b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/HistoryListActivity.java @@ -56,8 +56,8 @@ public class HistoryListActivity extends BaseActivity { TextView mTvErrorHint; @BindView(R.id.xlv_com_lib) XRecyclerView mXlvComLib; - @BindView(R.id.btn_clear) - Button mBtnClear; + @BindView(R.id.iv_clear) + ImageView mBtnClear; private Unbinder mBind; private List mDatas = new ArrayList<>(); private HistoryMissionAdapter mAdapter; @@ -565,7 +565,7 @@ public class HistoryListActivity extends BaseActivity { break; case STATE_LOAD_EMPTY: mTvErrorHint.setVisibility(View.VISIBLE); - mTvErrorHint.setText("未找到相关内容"); + mTvErrorHint.setText("暂无数据"); mIvEmpty.setVisibility(View.VISIBLE); mXlvComLib.setVisibility(View.GONE); mPbLoading.setVisibility(View.GONE); diff --git a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/PublicAreaActivity.java b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/PublicAreaActivity.java new file mode 100644 index 0000000..54daca6 --- /dev/null +++ b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/PublicAreaActivity.java @@ -0,0 +1,116 @@ +package com.sucstepsoft.txrealtimelocation.activitys.issue; + +import android.content.Intent; +import android.os.Bundle; +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.jcodecraeer.xrecyclerview.XRecyclerView; +import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity; +import com.sucstepsoft.txrealtimelocation.R; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.Unbinder; + +public class PublicAreaActivity extends BaseActivity { + + + @BindView(R.id.et_company_name) + EditText mEtCompanyName; + @BindView(R.id.iv_clear) + ImageView mIvClear; + @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_public_list) + XRecyclerView mXlvPublicList; + private Unbinder mBind; + private int mCurrentPage = 1; + + @Override + protected int setLayoutId() { + return R.layout.activity_public_area; + } + + @Override + public void initData() { + mBind = ButterKnife.bind(this); + mTvBaseTitle.setText("公共区域"); + refreshView(STATE_LOAD_SUCCESS); + mTvPublish.setText("上报"); + mTvPublish.setOnClickListener(v -> startActivity(new Intent(mActivity, PublicReportActivity.class))); + stateView(STATE_LOAD_LOADING); + getPublicList(mCurrentPage); + mBtnSearch.setOnClickListener(v -> doSearchList()); + mIvClear.setOnClickListener(v -> { + mEtCompanyName.setText(""); + mCurrentPage = 1; + getPublicList(mCurrentPage); + }); + } + + /** + * 获取列表 + */ + private void getPublicList(int currentPage) { + + } + + private void doSearchList() { + String name = mEtCompanyName.getText().toString().trim(); + if (!TextUtils.isEmpty(name)) { + + } + } + + + private void stateView(int state) { + switch (state) { + case STATE_LOAD_SUCCESS: + mTvErrorHint.setVisibility(View.GONE); + mXlvPublicList.setVisibility(View.VISIBLE); + mPbLoading.setVisibility(View.GONE); + mIvEmpty.setVisibility(View.GONE); + break; + case STATE_LOAD_EMPTY: + mTvErrorHint.setVisibility(View.VISIBLE); + mTvErrorHint.setText("暂无数据"); + mXlvPublicList.setVisibility(View.GONE); + mPbLoading.setVisibility(View.GONE); + mIvEmpty.setVisibility(View.VISIBLE); + break;//空数据 + case STATE_LOAD_ERROR: + mTvErrorHint.setVisibility(View.VISIBLE); + mTvErrorHint.setText("数据加载失败,请稍后重试."); + mXlvPublicList.setVisibility(View.GONE); + mPbLoading.setVisibility(View.GONE); + mIvEmpty.setVisibility(View.VISIBLE); + break;//加载错误 + case STATE_LOAD_LOADING: + default: + mTvErrorHint.setVisibility(View.VISIBLE); + mTvErrorHint.setText("数据加载中..."); + mXlvPublicList.setVisibility(View.GONE); + mPbLoading.setVisibility(View.VISIBLE); + mIvEmpty.setVisibility(View.GONE); + break; + } + } + + @Override + protected void onDestroy() { + super.onDestroy(); + mBind.unbind(); + } +} diff --git a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/PublicReportActivity.java b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/PublicReportActivity.java new file mode 100644 index 0000000..5180ded --- /dev/null +++ b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/PublicReportActivity.java @@ -0,0 +1,44 @@ +package com.sucstepsoft.txrealtimelocation.activitys.issue; + +import android.view.View; + +import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity; +import com.sucstepsoft.txrealtimelocation.R; + +import butterknife.ButterKnife; +import butterknife.Unbinder; + +public class PublicReportActivity extends BaseActivity { + /** + * 公共区域隐患上报 + * + * + * + */ + + private Unbinder mBind; + + @Override + protected int setLayoutId() { + return R.layout.activity_public_report; + } + + @Override + public void initData() { + mBind = ButterKnife.bind(this); + mTvBaseTitle.setText("公共隐患上报"); + mTvPublish.setVisibility(View.VISIBLE); + mTvPublish.setText("保存"); + mTvPublish.setOnClickListener(v -> doSubmit()); + } + + private void doSubmit() { + + } + + @Override + protected void onDestroy() { + super.onDestroy(); + mBind.unbind(); + } +} diff --git a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/demo/Options.java b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/demo/Options.java index 32ac324..84ce31b 100644 --- a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/demo/Options.java +++ b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/demo/Options.java @@ -15,7 +15,7 @@ public class Options { private String id; private List photos; private String title; - private EmStateCheck state = EmStateCheck.NORMAL;//检查状态 normal 未检查 check合格 uncheck不合格 + private EmStateCheck state = EmStateCheck.NORMAL;//检查状态 normal未检查 check合格 uncheck不合格 private int rectify = 4;//立即整改-4,限期整改-5 不配合-6 private int isMust = 1;//1 必查 2选查 //整改期限 diff --git a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/demo/OptionsAdapter.java b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/demo/OptionsAdapter.java index 322b56a..8580b56 100644 --- a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/demo/OptionsAdapter.java +++ b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/demo/OptionsAdapter.java @@ -14,9 +14,11 @@ import android.widget.RadioGroup; 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.cm_utils.utils.LogUtils; import com.sucstepsoft.txrealtimelocation.R; import com.sucstepsoft.txrealtimelocation.widget.EmStateCheck; +import java.util.ArrayList; import java.util.List; /** @@ -26,8 +28,16 @@ import java.util.List; * 描述: */ public class OptionsAdapter extends BaseRecyclerAdapter { + + private ArrayAdapter mDefaultApater; + private ArrayAdapter mAdapter; + private String[] mNowStrings; + private String[] mTermStrings; + public OptionsAdapter(Context ctx, List list) { super(ctx, list); + mNowStrings = mContext.getResources().getStringArray(R.array.limit); + mTermStrings = mContext.getResources().getStringArray(R.array.timeLimit); } @Override @@ -39,164 +49,239 @@ public class OptionsAdapter extends BaseRecyclerAdapter @Override public void bindHolder(OptionsHolder oHolder, int i) { + //设置是否必须星号 if (mData.get(i).getIsMust() == 1) { oHolder.mIvIsMust.setVisibility(View.VISIBLE); } else { oHolder.mIvIsMust.setVisibility(View.GONE); } - 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); + //设置检查项名称 + oHolder.mTvTitle.setText(mData.get(i).getTitle()); + oHolder.mRgState.setOnCheckedChangeListener(null); + if (mData.get(i).getState() == EmStateCheck.UNCHECK) { + //不合格 + oHolder.mLlContent.setVisibility(View.VISIBLE); + oHolder.mRlvPhotos.setVisibility(View.VISIBLE); + setDisData(oHolder, mData.get(i), i); + } else if (mData.get(i).getState() == EmStateCheck.CHECK) { + //合格 + oHolder.mLlContent.setVisibility(View.GONE); + oHolder.mRlvPhotos.setVisibility(View.VISIBLE); + setCheckData(oHolder, mData.get(i), i); + } else { + //未检查 + oHolder.mLlContent.setVisibility(View.GONE); + oHolder.mRlvPhotos.setVisibility(View.GONE); + setNomarlData(oHolder, mData.get(i), i); + } + oHolder.mRgState.setOnCheckedChangeListener((radioGroup, i1) -> { + LogUtils.e("调用了==" + i1); + switch (i1) { + case R.id.rb_state_uncheck: mData.get(i).setState(EmStateCheck.NORMAL); oHolder.mLlContent.setVisibility(View.GONE); oHolder.mRlvPhotos.setVisibility(View.GONE); + setNomarlData(oHolder, mData.get(i), i); + break; + case R.id.rb_state_check: + mData.get(i).setState(EmStateCheck.CHECK); + oHolder.mLlContent.setVisibility(View.GONE); + oHolder.mRlvPhotos.setVisibility(View.VISIBLE); + setCheckData(oHolder, mData.get(i), i); + break; + case R.id.rb_state_dis: + mData.get(i).setState(EmStateCheck.UNCHECK); + oHolder.mLlContent.setVisibility(View.VISIBLE); + oHolder.mRlvPhotos.setVisibility(View.VISIBLE); + setDisData(oHolder, mData.get(i), i); 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()); + setPhotoView(mData.get(i), oHolder, i); } - private void initContentView(OptionsHolder 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); + /** + * 设置不合格数据 + * + * @param oHolder + * @param op + * @param index + */ + private void setDisData(OptionsHolder oHolder, Options op, int index) { + oHolder.mRgState.check(R.id.rb_state_dis); + mData.get(index).setState(EmStateCheck.UNCHECK); + //TODO 不合格 回显 + int rectify = mData.get(index).getRectify(); + if (rectify == 4) {//立即整改 + oHolder.mRg.check(R.id.rb_now); oHolder.mLlSp.setVisibility(View.VISIBLE); - String[] defaultArray = mContext.getResources().getStringArray(R.array.limit); - ArrayAdapter 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 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; - } - } + String timeLimit = mData.get(index).getTimeLimit(); + mDefaultApater = new ArrayAdapter<>(mContext, R.layout.item_pop_text, mNowStrings); + oHolder.mSpinner.setAdapter(mDefaultApater); + if (!TextUtils.isEmpty(timeLimit)) { + //之前选择过 + if (timeLimit.equals("立即整改")) { + oHolder.mSpinner.setSelection(0); } else { - oHolder.mRg.check(R.id.rb_coor); + oHolder.mSpinner.setSelection(1); } + } else { + //未选择过 + oHolder.mSpinner.setSelection(0); } - 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); - } + oHolder.mSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { + @Override + public void onItemSelected(AdapterView adapterView, View view, int i, long l) { + String s = mNowStrings[i]; + mData.get(index).setTimeLimit(s); + } - @Override - public void onNothingSelected(AdapterView adapterView) { + @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 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); } }); + } else if (rectify == 5) {//限期整改 + oHolder.mRg.check(R.id.rb_term); + oHolder.mLlSp.setVisibility(View.VISIBLE); + String timeLimit = mData.get(index).getTimeLimit(); + mAdapter = new ArrayAdapter<>(mContext, R.layout.item_pop_text, mTermStrings); + oHolder.mSpinner.setAdapter(mAdapter); + if (!TextUtils.isEmpty(timeLimit)) { + //之前选择过 + switch (timeLimit) { + 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.mSpinner.setSelection(0); + } + oHolder.mSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { + @Override + public void onItemSelected(AdapterView adapterView, View view, int i, long l) { + String s = mTermStrings[i]; + mData.get(index).setTimeLimit(s); + } + + @Override + public void onNothingSelected(AdapterView adapterView) { + + } + }); + } else {//不配合 + oHolder.mRg.check(R.id.rb_coor); + oHolder.mLlSp.setVisibility(View.GONE); } - AddPhotoAdapter photoAdapter = new AddPhotoAdapter(mContext, op.getPhotos()); + oHolder.mRg.setOnCheckedChangeListener((radioGroup, id) -> { + if (id == R.id.rb_now) { //立即整改 + oHolder.mLlSp.setVisibility(View.VISIBLE); + mDefaultApater = new ArrayAdapter<>(mContext, R.layout.item_pop_text, mNowStrings); + oHolder.mSpinner.setAdapter(mDefaultApater); + oHolder.mSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { + @Override + public void onItemSelected(AdapterView adapterView, View view, int i, long l) { + String s = mNowStrings[i]; + mData.get(index).setTimeLimit(s); + } + + @Override + public void onNothingSelected(AdapterView adapterView) { + + } + }); + mData.get(index).setRectify(4); + mData.get(index).setTimeLimit("立即整改"); + } else if (id == R.id.rb_term) { //限期整改 + oHolder.mLlSp.setVisibility(View.VISIBLE); + mAdapter = new ArrayAdapter<>(mContext, R.layout.item_pop_text, mTermStrings); + oHolder.mSpinner.setAdapter(mAdapter); + oHolder.mSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { + @Override + public void onItemSelected(AdapterView adapterView, View view, int i, long l) { + String s = mTermStrings[i]; + mData.get(index).setTimeLimit(s); + } + + @Override + public void onNothingSelected(AdapterView adapterView) { + + } + }); + mData.get(index).setRectify(5); + mData.get(index).setTimeLimit("1天"); + } else { //不配合 + oHolder.mLlSp.setVisibility(View.GONE); + mData.get(index).setRectify(6); + } + }); + } + + /** + * 设置合格数据 + * + * @param oHolder + * @param op + * @param index + */ + private void setCheckData(OptionsHolder oHolder, Options op, int index) { + oHolder.mRgState.check(R.id.rb_state_check); + setPhotoView(op, oHolder, index); + mData.get(index).setState(EmStateCheck.CHECK); + mData.get(index).setRectify(4); + mData.get(index).setTimeLimit(""); + } + + /** + * 设置未检查数据 + * + * @param oHolder + * @param op + * @param index + */ + private void setNomarlData(OptionsHolder oHolder, Options op, int index) { + oHolder.mRgState.check(R.id.rb_state_uncheck); + mData.get(index).setState(EmStateCheck.NORMAL); + setPhotoView(op, oHolder, index); + mData.get(index).setRectify(4); + mData.get(index).setTimeLimit(""); + } + + + private void setPhotoView(Options op, OptionsHolder oHolder, int index) { + AddPhotoAdapter photoAdapter = new AddPhotoAdapter(mContext, mData.get(index).getPhotos()); oHolder.mRlvPhotos.setAdapter(photoAdapter); oHolder.mRlvPhotos.setLayoutManager(new GridLayoutManager(mContext, 4)); + photoAdapter.addOnDeleteListener((bean, i) -> { + mSelectPhotoListener.onSelectPhoto(bean, mData.get(index), index, 3); + }); photoAdapter.addOnItemClickListener(bean -> { if (mSelectPhotoListener != null) { if (TextUtils.isEmpty(bean.getPath())) { //空数据,选择图片 - mSelectPhotoListener.onSelectPhoto(bean, op, index, 1); + mSelectPhotoListener.onSelectPhoto(bean, mData.get(index), index, 1); } else { - mSelectPhotoListener.onSelectPhoto(bean, op, index, 2); + mSelectPhotoListener.onSelectPhoto(bean, mData.get(index), index, 2); } } }); @@ -211,4 +296,5 @@ public class OptionsAdapter extends BaseRecyclerAdapter public interface SelectPhoto { void onSelectPhoto(AddPhotoBean bean, Options options, int i, int type); } + } diff --git a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/demo/OptionsHolder.java b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/demo/OptionsHolder.java index 1eceaf1..4c7dc39 100644 --- a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/demo/OptionsHolder.java +++ b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/issue/demo/OptionsHolder.java @@ -21,7 +21,7 @@ import com.sucstepsoft.txrealtimelocation.widget.StateCheckView; */ public class OptionsHolder extends RecyclerView.ViewHolder { public TextView mTvTitle; - public StateCheckView mScvOptions; + // public StateCheckView mScvOptions; public RecyclerView mRlvPhotos; public LinearLayout mLlContent; public AppCompatSpinner mSpinner; @@ -29,11 +29,13 @@ public class OptionsHolder extends RecyclerView.ViewHolder { public LinearLayout mLlSp; public RadioButton mRbNow; public ImageView mIvIsMust; + public RadioGroup mRgState; public OptionsHolder(@NonNull View itemView) { super(itemView); mTvTitle = itemView.findViewById(R.id.tv_title); - mScvOptions = itemView.findViewById(R.id.scv_options); +// mScvOptions = itemView.findViewById(R.id.scv_options); + mRgState = itemView.findViewById(R.id.rg_state); mRlvPhotos = itemView.findViewById(R.id.rlv_photos); mLlContent = itemView.findViewById(R.id.ll_content); mSpinner = itemView.findViewById(R.id.sp_term); diff --git a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/lawlib/LawLibActivity.java b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/lawlib/LawLibActivity.java index ac8865b..a927eb7 100644 --- a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/lawlib/LawLibActivity.java +++ b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/lawlib/LawLibActivity.java @@ -146,7 +146,6 @@ public class LawLibActivity extends BaseActivity { mXlvComLib.loadMoreComplete(); } refreshView(STATE_LOAD_ERROR); -// ToastUtils.showShort("数据加载失败,请稍后重试"); } @Override diff --git a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/mine/MineMissionActivity.java b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/mine/MineMissionActivity.java index cea896b..69148bf 100644 --- a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/mine/MineMissionActivity.java +++ b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/mine/MineMissionActivity.java @@ -60,8 +60,8 @@ public class MineMissionActivity extends BaseActivity { TextView mTvErrorHint; @BindView(R.id.xlv_com_lib) XRecyclerView mXlvComLib; - @BindView(R.id.btn_clear) - Button mBtnClear; + @BindView(R.id.iv_clear) + ImageView mBtnClear; private Unbinder mBind; private List mDatas = new ArrayList<>(); private CounterCheckListAdapter mAdapter; @@ -101,7 +101,7 @@ public class MineMissionActivity extends BaseActivity { // } // } // }); - refreshView(STATE_LOAD_SUCCESS); + refreshView(STATE_LOAD_EMPTY); reStateView(STATE_LOAD_LOADING); initView(); } @@ -584,7 +584,7 @@ public class MineMissionActivity extends BaseActivity { break; case STATE_LOAD_EMPTY: mTvErrorHint.setVisibility(View.VISIBLE); - mTvErrorHint.setText("未找到相关内容"); + mTvErrorHint.setText("暂无数据"); mIvEmpty.setVisibility(View.VISIBLE); mXlvComLib.setVisibility(View.GONE); mPbLoading.setVisibility(View.GONE); diff --git a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/trouble/SelCompanyActivity.java b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/trouble/SelCompanyActivity.java index 4afd8ee..d9fc354 100644 --- a/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/trouble/SelCompanyActivity.java +++ b/app/src/main/java/com/sucstepsoft/txrealtimelocation/activitys/trouble/SelCompanyActivity.java @@ -20,6 +20,7 @@ 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.core.widget.base.BaseRecyclerAdapter; import com.sucstepsoft.cm_utils.utils.ToastUtils; import com.sucstepsoft.cm_utils.utils.UIUtil; import com.sucstepsoft.cm_utils.utils.UserLgUtils; @@ -63,8 +64,8 @@ public class SelCompanyActivity extends BaseActivity { TextView mTvErrorHint; @BindView(R.id.xlv_com_lib) XRecyclerView mXlvComLib; - @BindView(R.id.btn_clear) - Button mBtnClear; + @BindView(R.id.iv_clear) + ImageView mBtnClear; private Unbinder mBind; private List mDatas = new ArrayList<>(); private CompanyCheckAdapter mAdapter; @@ -88,27 +89,27 @@ public class SelCompanyActivity extends BaseActivity { public void 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)) { - Intent intent = new Intent(mActivity, CheckOptionsActivity.class); - intent.putExtra("id", mDatas.get(i).getIndustryJoinByEnterpriseId()); - intent.putExtra("cId", mDatas.get(i).getEnterpriseId()); - intent.putExtra("name", mDatas.get(i).getNameJoinByEnterpriseId()); - intent.putExtra("peo", mDatas.get(i).getMasterJoinByEnterpriseId()); - intent.putExtra("phone", mDatas.get(i).getPhoneJoinByEnterpriseId()); - startActivity(intent); - break; - } - } - } - }); +// mTvPublish.setVisibility(View.GONE); +// 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)) { +// Intent intent = new Intent(mActivity, CheckOptionsActivity.class); +// intent.putExtra("id", mDatas.get(i).getIndustryJoinByEnterpriseId()); +// intent.putExtra("cId", mDatas.get(i).getEnterpriseId()); +// intent.putExtra("name", mDatas.get(i).getNameJoinByEnterpriseId()); +// intent.putExtra("peo", mDatas.get(i).getMasterJoinByEnterpriseId()); +// intent.putExtra("phone", mDatas.get(i).getPhoneJoinByEnterpriseId()); +// startActivity(intent); +// break; +// } +// } +// } +// }); refreshView(STATE_LOAD_SUCCESS); reStateView(STATE_LO); initView(); @@ -117,6 +118,15 @@ public class SelCompanyActivity extends BaseActivity { private void initView() { mAdapter = new CompanyCheckAdapter(mActivity, mDatas); mXlvComLib.setAdapter(mAdapter); + mAdapter.addOnItemClickListener(bean -> { + Intent intent = new Intent(mActivity, CheckOptionsActivity.class); + intent.putExtra("id", bean.getIndustryJoinByEnterpriseId()); + intent.putExtra("cId",bean.getEnterpriseId()); + intent.putExtra("name", bean.getNameJoinByEnterpriseId()); + intent.putExtra("peo", bean.getMasterJoinByEnterpriseId()); + intent.putExtra("phone",bean.getPhoneJoinByEnterpriseId()); + startActivity(intent); + }); LinearLayoutManager layoutManager = new LinearLayoutManager(mActivity); layoutManager.setOrientation(LinearLayoutManager.VERTICAL); mXlvComLib.setLayoutManager(layoutManager); @@ -578,7 +588,7 @@ public class SelCompanyActivity extends BaseActivity { break; case STATE_EM: mTvErrorHint.setVisibility(View.VISIBLE); - mTvErrorHint.setText("未找到相关内容"); + mTvErrorHint.setText("暂无数据"); mIvEmpty.setVisibility(View.VISIBLE); mXlvComLib.setVisibility(View.GONE); mPbLoading.setVisibility(View.GONE); diff --git a/app/src/main/java/com/sucstepsoft/txrealtimelocation/adapters/CompanyLibAdapter.java b/app/src/main/java/com/sucstepsoft/txrealtimelocation/adapters/CompanyLibAdapter.java index d916fad..51875d2 100644 --- a/app/src/main/java/com/sucstepsoft/txrealtimelocation/adapters/CompanyLibAdapter.java +++ b/app/src/main/java/com/sucstepsoft/txrealtimelocation/adapters/CompanyLibAdapter.java @@ -36,7 +36,6 @@ public class CompanyLibAdapter extends BaseRecyclerAdapter { public CounterCheckListAdapter(Context ctx, List list) { @@ -33,6 +33,6 @@ public class CounterCheckListAdapter extends BaseRecyclerAdapter { + private ArrayAdapter mDefaultApater; + private ArrayAdapter mAdapter; + private String[] mNowStrings; + private String[] mTermStrings; public CounterCheckOptionsAdapter(Context ctx, List list) { super(ctx, list); + mNowStrings = mContext.getResources().getStringArray(R.array.limit); + mTermStrings = mContext.getResources().getStringArray(R.array.timeLimit); } @Override @@ -40,165 +48,236 @@ public class CounterCheckOptionsAdapter extends BaseRecyclerAdapter { - 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); + //设置检查项名称 + oHolder.mTvTitle.setText(mData.get(i).getTitle()); + oHolder.mRgState.setOnCheckedChangeListener(null); + if (mData.get(i).getState() == EmStateCheck.UNCHECK) { + //不合格 + oHolder.mLlContent.setVisibility(View.VISIBLE); + oHolder.mRlvPhotos.setVisibility(View.VISIBLE); + setDisData(oHolder, mData.get(i), i); + } else if (mData.get(i).getState() == EmStateCheck.CHECK) { + //合格 + oHolder.mLlContent.setVisibility(View.GONE); + oHolder.mRlvPhotos.setVisibility(View.VISIBLE); + setCheckData(oHolder, mData.get(i), i); + } else { + //未检查 + oHolder.mLlContent.setVisibility(View.GONE); + oHolder.mRlvPhotos.setVisibility(View.GONE); + setNomarlData(oHolder, mData.get(i), i); + } + oHolder.mRgState.setOnCheckedChangeListener((radioGroup, i1) -> { + LogUtils.e("调用了==" + i1); + switch (i1) { + case R.id.rb_state_uncheck: mData.get(i).setState(EmStateCheck.NORMAL); oHolder.mLlContent.setVisibility(View.GONE); oHolder.mRlvPhotos.setVisibility(View.GONE); + setNomarlData(oHolder, mData.get(i), i); + break; + case R.id.rb_state_check: + mData.get(i).setState(EmStateCheck.CHECK); + oHolder.mLlContent.setVisibility(View.GONE); + oHolder.mRlvPhotos.setVisibility(View.VISIBLE); + setCheckData(oHolder, mData.get(i), i); + break; + case R.id.rb_state_dis: + mData.get(i).setState(EmStateCheck.UNCHECK); + oHolder.mLlContent.setVisibility(View.VISIBLE); + oHolder.mRlvPhotos.setVisibility(View.VISIBLE); + setDisData(oHolder, mData.get(i), i); 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()); + setPhotoView(mData.get(i), oHolder, i); } - 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); + /** + * 设置不合格数据 + * + * @param oHolder + * @param op + * @param index + */ + private void setDisData(CounterCheckOptionHolder oHolder, Options op, int index) { + oHolder.mRgState.check(R.id.rb_state_dis); + mData.get(index).setState(EmStateCheck.UNCHECK); + //TODO 不合格 回显 + int rectify = mData.get(index).getRectify(); + if (rectify == 4) {//立即整改 + oHolder.mRg.check(R.id.rb_now); oHolder.mLlSp.setVisibility(View.VISIBLE); - String[] defaultArray = mContext.getResources().getStringArray(R.array.limit); - ArrayAdapter 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 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; - } - } + String timeLimit = mData.get(index).getTimeLimit(); + mDefaultApater = new ArrayAdapter<>(mContext, R.layout.item_pop_text, mNowStrings); + oHolder.mSpinner.setAdapter(mDefaultApater); + if (!TextUtils.isEmpty(timeLimit)) { + //之前选择过 + if (timeLimit.equals("立即整改")) { + oHolder.mSpinner.setSelection(0); } else { - oHolder.mRg.check(R.id.rb_coor); + oHolder.mSpinner.setSelection(1); } + } else { + //未选择过 + oHolder.mSpinner.setSelection(0); } + oHolder.mSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { + @Override + public void onItemSelected(AdapterView adapterView, View view, int i, long l) { + String s = mNowStrings[i]; + mData.get(index).setTimeLimit(s); + } - 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) { - @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 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); } }); + } else if (rectify == 5) {//限期整改 + oHolder.mRg.check(R.id.rb_term); + oHolder.mLlSp.setVisibility(View.VISIBLE); + String timeLimit = mData.get(index).getTimeLimit(); + mAdapter = new ArrayAdapter<>(mContext, R.layout.item_pop_text, mTermStrings); + oHolder.mSpinner.setAdapter(mAdapter); + if (!TextUtils.isEmpty(timeLimit)) { + //之前选择过 + switch (timeLimit) { + 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.mSpinner.setSelection(0); + } + oHolder.mSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { + @Override + public void onItemSelected(AdapterView adapterView, View view, int i, long l) { + String s = mTermStrings[i]; + mData.get(index).setTimeLimit(s); + } + @Override + public void onNothingSelected(AdapterView adapterView) { + + } + }); + } else {//不配合 + oHolder.mRg.check(R.id.rb_coor); + oHolder.mLlSp.setVisibility(View.GONE); } - AddPhotoAdapter photoAdapter = new AddPhotoAdapter(mContext, op.getPhotos()); + oHolder.mRg.setOnCheckedChangeListener((radioGroup, id) -> { + if (id == R.id.rb_now) { //立即整改 + oHolder.mLlSp.setVisibility(View.VISIBLE); + mDefaultApater = new ArrayAdapter<>(mContext, R.layout.item_pop_text, mNowStrings); + oHolder.mSpinner.setAdapter(mDefaultApater); + oHolder.mSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { + @Override + public void onItemSelected(AdapterView adapterView, View view, int i, long l) { + String s = mNowStrings[i]; + mData.get(index).setTimeLimit(s); + } + + @Override + public void onNothingSelected(AdapterView adapterView) { + + } + }); + mData.get(index).setRectify(4); + mData.get(index).setTimeLimit("立即整改"); + } else if (id == R.id.rb_term) { //限期整改 + oHolder.mLlSp.setVisibility(View.VISIBLE); + mAdapter = new ArrayAdapter<>(mContext, R.layout.item_pop_text, mTermStrings); + oHolder.mSpinner.setAdapter(mAdapter); + oHolder.mSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { + @Override + public void onItemSelected(AdapterView adapterView, View view, int i, long l) { + String s = mTermStrings[i]; + mData.get(index).setTimeLimit(s); + } + + @Override + public void onNothingSelected(AdapterView adapterView) { + + } + }); + mData.get(index).setRectify(5); + mData.get(index).setTimeLimit("1天"); + } else { //不配合 + oHolder.mLlSp.setVisibility(View.GONE); + mData.get(index).setRectify(6); + } + }); + } + + /** + * 设置合格数据 + * + * @param oHolder + * @param op + * @param index + */ + private void setCheckData(CounterCheckOptionHolder oHolder, Options op, int index) { + oHolder.mRgState.check(R.id.rb_state_check); + setPhotoView(op, oHolder, index); + mData.get(index).setState(EmStateCheck.CHECK); + mData.get(index).setRectify(4); + mData.get(index).setTimeLimit(""); + } + + /** + * 设置未检查数据 + * + * @param oHolder + * @param op + * @param index + */ + private void setNomarlData(CounterCheckOptionHolder oHolder, Options op, int index) { + oHolder.mRgState.check(R.id.rb_state_uncheck); + mData.get(index).setState(EmStateCheck.NORMAL); + setPhotoView(op, oHolder, index); + mData.get(index).setRectify(4); + mData.get(index).setTimeLimit(""); + } + + + private void setPhotoView(Options op, CounterCheckOptionHolder oHolder, int index) { + AddPhotoAdapter photoAdapter = new AddPhotoAdapter(mContext, mData.get(index).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); + mSelectPhotoListener.onSelectPhoto(bean, mData.get(index), index, 1); } else { - mSelectPhotoListener.onSelectPhoto(bean, op, index, 2); + mSelectPhotoListener.onSelectPhoto(bean, mData.get(index), index, 2); } } }); diff --git a/app/src/main/java/com/sucstepsoft/txrealtimelocation/adapters/MissionDetailAdapter.java b/app/src/main/java/com/sucstepsoft/txrealtimelocation/adapters/MissionDetailAdapter.java index 1bf9611..f443721 100644 --- a/app/src/main/java/com/sucstepsoft/txrealtimelocation/adapters/MissionDetailAdapter.java +++ b/app/src/main/java/com/sucstepsoft/txrealtimelocation/adapters/MissionDetailAdapter.java @@ -2,6 +2,7 @@ package com.sucstepsoft.txrealtimelocation.adapters; import android.content.Context; import android.content.Intent; +import android.graphics.Color; import android.support.v7.widget.GridLayoutManager; import android.text.TextUtils; import android.view.LayoutInflater; @@ -43,23 +44,28 @@ public class MissionDetailAdapter extends BaseRecyclerAdapter> getCheckOptionsList(@Query("id") String id, @Header("token") String token); + Observable> getCheckOptionsList(@Query("industryId") String id, @Header("token") String token); //保存检查结果 @Headers({"base_url_name:dict", "Content-Type: application/json", "Accept: application/json"}) diff --git a/app/src/main/res/drawable-xhdpi/ic_item_idcard.png b/app/src/main/res/drawable-xhdpi/ic_item_idcard.png new file mode 100644 index 0000000..54f0926 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_item_idcard.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_item_user.png b/app/src/main/res/drawable-xhdpi/ic_item_user.png new file mode 100644 index 0000000..37d227a Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_item_user.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_main_c_info.png b/app/src/main/res/drawable-xhdpi/ic_main_c_info.png new file mode 100644 index 0000000..eaa8f5f Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_main_c_info.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_main_history.png b/app/src/main/res/drawable-xhdpi/ic_main_history.png new file mode 100644 index 0000000..70f4184 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_main_history.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_main_law.png b/app/src/main/res/drawable-xhdpi/ic_main_law.png new file mode 100644 index 0000000..4bd1bc6 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_main_law.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_main_mine.png b/app/src/main/res/drawable-xhdpi/ic_main_mine.png new file mode 100644 index 0000000..0c79175 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_main_mine.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_main_report.png b/app/src/main/res/drawable-xhdpi/ic_main_report.png new file mode 100644 index 0000000..b5a4ce4 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_main_report.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_main_risk.png b/app/src/main/res/drawable-xhdpi/ic_main_risk.png new file mode 100644 index 0000000..9fd1c68 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_main_risk.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_rb_check.png b/app/src/main/res/drawable-xhdpi/ic_rb_check.png new file mode 100644 index 0000000..289ab3d Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_rb_check.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_rb_uncheck.png b/app/src/main/res/drawable-xhdpi/ic_rb_uncheck.png new file mode 100644 index 0000000..b9054a2 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_rb_uncheck.png differ diff --git a/app/src/main/res/drawable/sel_btn_submit_no_size.xml b/app/src/main/res/drawable/sel_btn_submit_no_size.xml new file mode 100755 index 0000000..550d277 --- /dev/null +++ b/app/src/main/res/drawable/sel_btn_submit_no_size.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/sel_rb.xml b/app/src/main/res/drawable/sel_rb.xml new file mode 100644 index 0000000..2f2ef78 --- /dev/null +++ b/app/src/main/res/drawable/sel_rb.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_btn_green_sel_no_size.xml b/app/src/main/res/drawable/shape_btn_green_sel_no_size.xml new file mode 100755 index 0000000..f785f98 --- /dev/null +++ b/app/src/main/res/drawable/shape_btn_green_sel_no_size.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_btn_nomal_gray_no_size.xml b/app/src/main/res/drawable/shape_btn_nomal_gray_no_size.xml new file mode 100755 index 0000000..5fd3485 --- /dev/null +++ b/app/src/main/res/drawable/shape_btn_nomal_gray_no_size.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_search_box.xml b/app/src/main/res/drawable/shape_search_box.xml new file mode 100755 index 0000000..0ee9878 --- /dev/null +++ b/app/src/main/res/drawable/shape_search_box.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/app/src/main/res/drawable/sp_blue_sel.xml b/app/src/main/res/drawable/sp_blue_sel.xml new file mode 100644 index 0000000..6ba7226 --- /dev/null +++ b/app/src/main/res/drawable/sp_blue_sel.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/sp_company_item_box.xml b/app/src/main/res/drawable/sp_company_item_box.xml new file mode 100644 index 0000000..9e399bf --- /dev/null +++ b/app/src/main/res/drawable/sp_company_item_box.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/sp_red_sel.xml b/app/src/main/res/drawable/sp_red_sel.xml new file mode 100644 index 0000000..ef65c66 --- /dev/null +++ b/app/src/main/res/drawable/sp_red_sel.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/sp_square_btn_blue_rim.xml b/app/src/main/res/drawable/sp_square_btn_blue_rim.xml index f487cbc..1efbd9d 100755 --- a/app/src/main/res/drawable/sp_square_btn_blue_rim.xml +++ b/app/src/main/res/drawable/sp_square_btn_blue_rim.xml @@ -2,7 +2,6 @@ - diff --git a/app/src/main/res/drawable/sp_square_btn_blue_sel.xml b/app/src/main/res/drawable/sp_square_btn_blue_sel.xml index a02928f..bf751de 100755 --- a/app/src/main/res/drawable/sp_square_btn_blue_sel.xml +++ b/app/src/main/res/drawable/sp_square_btn_blue_sel.xml @@ -2,5 +2,5 @@ - + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_check_options_ce.xml b/app/src/main/res/layout/activity_check_options_ce.xml index 8085c4b..9d9ace5 100644 --- a/app/src/main/res/layout/activity_check_options_ce.xml +++ b/app/src/main/res/layout/activity_check_options_ce.xml @@ -18,53 +18,58 @@ android:layout_height="wrap_content" android:orientation="vertical"> - + android:layout_margin="5dp" + android:background="@drawable/sp_company_item_box" + android:orientation="vertical" + android:padding="5dp"> + android:orientation="horizontal"> - + - + - - - - + +