检查项添加图片

This commit is contained in:
itgaojian163 2020-04-18 18:42:47 +08:00
parent 1c8423f28c
commit e3154983cd
26 changed files with 678 additions and 114 deletions

View File

@ -47,7 +47,10 @@
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme" android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning"> tools:ignore="GoogleAppIndexingWarning">
<activity android:name=".activitys.issue.NewCheckOptionsActivity"></activity> <activity
android:name=".activitys.issue.NewCheckOptionsActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateHidden" />
<activity <activity
android:name=".activitys.issue.PublicReportActivity" android:name=".activitys.issue.PublicReportActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"

View File

@ -2,10 +2,12 @@ package com.sucstepsoft.txrealtimelocation.activitys.base;
import android.content.Intent; import android.content.Intent;
import android.graphics.Color; import android.graphics.Color;
import android.location.Location;
import android.provider.Settings; import android.provider.Settings;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
@ -44,6 +46,7 @@ import com.sucstepsoft.txrealtimelocation.activitys.notice.NoticeActivity;
import com.sucstepsoft.txrealtimelocation.activitys.trouble.SelCompanyActivity; import com.sucstepsoft.txrealtimelocation.activitys.trouble.SelCompanyActivity;
import com.sucstepsoft.txrealtimelocation.adapters.FunctionAdapter; import com.sucstepsoft.txrealtimelocation.adapters.FunctionAdapter;
import com.sucstepsoft.txrealtimelocation.beans.AppTokenUser; import com.sucstepsoft.txrealtimelocation.beans.AppTokenUser;
import com.sucstepsoft.txrealtimelocation.beans.BaseUserBean;
import com.sucstepsoft.txrealtimelocation.beans.VersionBean; import com.sucstepsoft.txrealtimelocation.beans.VersionBean;
import com.sucstepsoft.txrealtimelocation.net.LocationApiService; import com.sucstepsoft.txrealtimelocation.net.LocationApiService;
import com.sucstepsoft.txrealtimelocation.utils.GpsUtils; import com.sucstepsoft.txrealtimelocation.utils.GpsUtils;
@ -97,6 +100,8 @@ public class MainActivity extends BaseActivity {
TextView mTvOnline; TextView mTvOnline;
@BindView(R.id.ll_history) @BindView(R.id.ll_history)
LinearLayout mllHistory; LinearLayout mllHistory;
@BindView(R.id.tv_history_num)
TextView mTvHistoryNum;
private String[] permissions = new String[]{ private String[] permissions = new String[]{
PermissionConstants.STORAGE, PermissionConstants.STORAGE,
PermissionConstants.PHONE, PermissionConstants.PHONE,
@ -143,6 +148,13 @@ public class MainActivity extends BaseActivity {
if (!oPen) { if (!oPen) {
openGpsSetting(); openGpsSetting();
} }
//tv_history_num
//tv_aviso_num
// tv_mine_issue_num
} }
@ -220,6 +232,123 @@ public class MainActivity extends BaseActivity {
mTvState.setText("正常"); mTvState.setText("正常");
mTvState.setTextColor(Color.WHITE); mTvState.setTextColor(Color.WHITE);
checkPermission(); checkPermission();
// getNumberByMine();
// getNumberEnter();
// getNumberHistory();
}
/**
* 获取通知公告我的企业历史任务
*/
private void getNumberByMine() {
RetrofitManager.getInstance()
.create(LocationApiService.class)
.getArticleCount(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 (!TextUtils.isEmpty(baseUserBean.getData())) {
int i = Integer.parseInt(baseUserBean.getData());
if (i >= 100) {
mTvAvisoNum.setText("99+");
} else {
mTvAvisoNum.setText(baseUserBean.getData() + "");
}
}
}
@Override
public void onError(Throwable e) {
}
@Override
public void onComplete() {
}
});
}
private void getNumberEnter() {
RetrofitManager.getInstance()
.create(LocationApiService.class)
.getMineEnterpriseCount(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 (!TextUtils.isEmpty(baseUserBean.getData())) {
int i = Integer.parseInt(baseUserBean.getData());
if (i >= 100) {
mTvMineIssueNum.setText("99+");
} else {
mTvMineIssueNum.setText(baseUserBean.getData() + "");
}
}
}
@Override
public void onError(Throwable e) {
}
@Override
public void onComplete() {
}
});
}
private void getNumberHistory() {
RetrofitManager.getInstance()
.create(LocationApiService.class)
.getHistoryCount(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 (!TextUtils.isEmpty(baseUserBean.getData())) {
int i = Integer.parseInt(baseUserBean.getData());
if (i >= 100) {
mTvHistoryNum.setText("99+");
} else {
mTvHistoryNum.setText(baseUserBean.getData() + "");
}
}
}
@Override
public void onError(Throwable e) {
}
@Override
public void onComplete() {
}
});
} }
private AlertDialog mGpsSettingDialog; private AlertDialog mGpsSettingDialog;
@ -385,6 +514,9 @@ public class MainActivity extends BaseActivity {
@Override @Override
protected void onStart() { protected void onStart() {
super.onStart(); super.onStart();
getNumberByMine();
getNumberEnter();
getNumberHistory();
} }

View File

@ -76,6 +76,8 @@ public class CompanyDetailActivity extends BaseActivity {
TextView mTvTrade1; TextView mTvTrade1;
@BindView(R.id.ll_company_info) @BindView(R.id.ll_company_info)
LinearLayout mLlCompanyInfo; LinearLayout mLlCompanyInfo;
@BindView(R.id.tv_logoff)
TextView mTvLogOff;
private Unbinder mBind; private Unbinder mBind;
private CompanyDetailBean mDetailBean; private CompanyDetailBean mDetailBean;
private String mId; private String mId;
@ -142,6 +144,11 @@ public class CompanyDetailActivity extends BaseActivity {
private void setDataToView() { private void setDataToView() {
refreshView(STATE_LOAD_SUCCESS); refreshView(STATE_LOAD_SUCCESS);
if (mDetailBean.getIsLogOff() == 1) {
mTvLogOff.setText("已注销");
} else {
mTvLogOff.setText("未注销");
}
mTvArea1.setText(mDetailBean.getArea1DictionaryName()); mTvArea1.setText(mDetailBean.getArea1DictionaryName());
mTvArea2.setText(mDetailBean.getArea2DictionaryName()); mTvArea2.setText(mDetailBean.getArea2DictionaryName());
mTvArea3.setText(mDetailBean.getArea3DictionaryName()); mTvArea3.setText(mDetailBean.getArea3DictionaryName());

View File

@ -110,6 +110,8 @@ public class CompanyInfoEditActivity extends BaseActivity {
TextView mTvArea2; TextView mTvArea2;
@BindView(R.id.tv_trade_1) @BindView(R.id.tv_trade_1)
TextView mTvTrade1; TextView mTvTrade1;
@BindView(R.id.tv_logoff)
TextView mTvLogOff;//是否注销
private List<AddPhotoBean> mDoorPhotos; private List<AddPhotoBean> mDoorPhotos;
private List<AddPhotoBean> mPlacePhotos; private List<AddPhotoBean> mPlacePhotos;
@ -120,6 +122,7 @@ public class CompanyInfoEditActivity extends BaseActivity {
private OptionsPickerView mTradePicker;//管理行业 private OptionsPickerView mTradePicker;//管理行业
private OptionsPickerView mTradePicker1;//管理行业 private OptionsPickerView mTradePicker1;//管理行业
private OptionsPickerView mLogOffPicker;//是否注销
private OptionsPickerView mMArea1Picker; private OptionsPickerView mMArea1Picker;
private OptionsPickerView mMArea2Picker; private OptionsPickerView mMArea2Picker;
private OptionsPickerView mMArea3Picker; private OptionsPickerView mMArea3Picker;
@ -138,6 +141,7 @@ public class CompanyInfoEditActivity extends BaseActivity {
private List<DictBean> mArea4List = null;//街道 private List<DictBean> mArea4List = null;//街道
private List<DictBean> mArea5List = null;//社区 嘎查 private List<DictBean> mArea5List = null;//社区 嘎查
private List<DictBean> mTraitList = null;//风险特点 private List<DictBean> mTraitList = null;//风险特点
private List<String> mLogOffList = null;//管理行业1
private String mSelTypeId = "";//单位类型ID private String mSelTypeId = "";//单位类型ID
private String mSelTradeId = "";//管理行业ID private String mSelTradeId = "";//管理行业ID
private String code = "";//组织机构代码证 private String code = "";//组织机构代码证
@ -161,6 +165,7 @@ public class CompanyInfoEditActivity extends BaseActivity {
private AddPhotoAdapter mMPlacePhotoAdapter; private AddPhotoAdapter mMPlacePhotoAdapter;
private AddPhotoAdapter mMDoorPhotoAdapter; private AddPhotoAdapter mMDoorPhotoAdapter;
private int mSelLogOff = 0;
@Override @Override
protected int setLayoutId() { protected int setLayoutId() {
@ -241,6 +246,26 @@ public class CompanyInfoEditActivity extends BaseActivity {
mTvRisk.setOnClickListener(v -> onShowRiskPicker()); mTvRisk.setOnClickListener(v -> onShowRiskPicker());
mTvTrade.setOnClickListener(v -> onShowTradePicker()); mTvTrade.setOnClickListener(v -> onShowTradePicker());
mTvTrade1.setOnClickListener(v -> onShowTrade1Picker()); mTvTrade1.setOnClickListener(v -> onShowTrade1Picker());
mTvLogOff.setOnClickListener(v -> onShowLogOffPicker());
}
private void onShowLogOffPicker() {
hideSoftKeyboard();
mLogOffPicker = new OptionsPickerBuilder(mActivity, (options1, options2, options3, v) -> {
String s = mLogOffList.get(options1);
if (s.equals("未注销")) {
mSelLogOff = 0;
} else {
mSelLogOff = 1;//已注销
}
mTvLogOff.setText(s);
}).setTitleText("请选择")
.setCancelColor(Color.parseColor("#1189FF"))
.setSubmitColor(Color.parseColor("#1189FF"))
.setTitleColor(Color.parseColor("#1189FF"))
.build();
mLogOffPicker.setPicker(mLogOffList);
mLogOffPicker.show();
} }
private void onShowTrade1Picker() { private void onShowTrade1Picker() {
@ -501,6 +526,7 @@ public class CompanyInfoEditActivity extends BaseActivity {
submitBean.setBussinessRegNum(code); submitBean.setBussinessRegNum(code);
submitBean.setLegalPerson(companP); submitBean.setLegalPerson(companP);
submitBean.setSummary(scope); submitBean.setSummary(scope);
submitBean.setIsLogOff(mSelLogOff);
if (!TextUtils.isEmpty(mSelTradeId)) { if (!TextUtils.isEmpty(mSelTradeId)) {
submitBean.setIndustry(mSelTradeId);//行业 submitBean.setIndustry(mSelTradeId);//行业
@ -962,7 +988,12 @@ public class CompanyInfoEditActivity extends BaseActivity {
refreshView(STATE_LOAD_SUCCESS); refreshView(STATE_LOAD_SUCCESS);
companyName = mDetailBean.getName(); companyName = mDetailBean.getName();
mEtCompanyName.setText(companyName); mEtCompanyName.setText(companyName);
mSelLogOff = mDetailBean.getIsLogOff();
if (mSelLogOff == 1) {
mTvLogOff.setText("已注销");
} else {
mTvLogOff.setText("未注销");
}
people = mDetailBean.getMaster(); people = mDetailBean.getMaster();
mEtPre.setText(people); mEtPre.setText(people);

View File

@ -105,7 +105,8 @@ public class EnterCompanyInfoActivity extends BaseActivity {
EditText mEtCompanyScope; EditText mEtCompanyScope;
@BindView(R.id.tv_trade_1) @BindView(R.id.tv_trade_1)
TextView mTvTrade1; TextView mTvTrade1;
@BindView(R.id.tv_logoff)
TextView mTvLogOff;//是否注销
private Unbinder mBind; private Unbinder mBind;
private List<AddPhotoBean> mDoorPhotos; private List<AddPhotoBean> mDoorPhotos;
private List<AddPhotoBean> mPlacePhotos; private List<AddPhotoBean> mPlacePhotos;
@ -116,6 +117,7 @@ public class EnterCompanyInfoActivity extends BaseActivity {
private OptionsPickerView mTradePicker;//管理行业 private OptionsPickerView mTradePicker;//管理行业
private OptionsPickerView mTradePicker1;//管理行业 private OptionsPickerView mTradePicker1;//管理行业
private OptionsPickerView mLogOffPicker;//是否注销
private OptionsPickerView mMArea1Picker; private OptionsPickerView mMArea1Picker;
private OptionsPickerView mMArea2Picker; private OptionsPickerView mMArea2Picker;
private OptionsPickerView mMArea3Picker; private OptionsPickerView mMArea3Picker;
@ -128,6 +130,7 @@ public class EnterCompanyInfoActivity extends BaseActivity {
private List<DictBean> mTypeList = null;//单位类型 private List<DictBean> mTypeList = null;//单位类型
private List<DictBean> mTradeList = null;//管理行业 private List<DictBean> mTradeList = null;//管理行业
private List<DictBean> mTradeList1 = null;//管理行业1 private List<DictBean> mTradeList1 = null;//管理行业1
private List<String> mLogOffList = null;//管理行业1
private List<DictBean> mArea1List = null;// private List<DictBean> mArea1List = null;//
private List<DictBean> mArea2List = null;// private List<DictBean> mArea2List = null;//
private List<DictBean> mArea3List = null;//旗县 private List<DictBean> mArea3List = null;//旗县
@ -156,7 +159,7 @@ public class EnterCompanyInfoActivity extends BaseActivity {
private int mCurrentPhotoType = 1;//当前上传的图片所属 1大门, 2主要场所 private int mCurrentPhotoType = 1;//当前上传的图片所属 1大门, 2主要场所
private AddPhotoAdapter mMPlacePhotoAdapter; private AddPhotoAdapter mMPlacePhotoAdapter;
private AddPhotoAdapter mMDoorPhotoAdapter; private AddPhotoAdapter mMDoorPhotoAdapter;
private int mSelLogOff = 0;
@Override @Override
protected int setLayoutId() { protected int setLayoutId() {
@ -175,6 +178,10 @@ public class EnterCompanyInfoActivity extends BaseActivity {
} }
private void initPhotoView() { private void initPhotoView() {
mLogOffList = new ArrayList<>();
mLogOffList.add("未注销");
mLogOffList.add("已注销");
mDoorPhotos = new ArrayList<>(); mDoorPhotos = new ArrayList<>();
mPlacePhotos = new ArrayList<>(); mPlacePhotos = new ArrayList<>();
mDoorPhotos.add(new AddPhotoBean()); mDoorPhotos.add(new AddPhotoBean());
@ -235,9 +242,31 @@ public class EnterCompanyInfoActivity extends BaseActivity {
mTvRisk.setOnClickListener(v -> onShowRiskPicker()); mTvRisk.setOnClickListener(v -> onShowRiskPicker());
mTvTrade.setOnClickListener(v -> onShowTradePicker()); mTvTrade.setOnClickListener(v -> onShowTradePicker());
mTvTrade1.setOnClickListener(v -> onShowTrade1Picker()); mTvTrade1.setOnClickListener(v -> onShowTrade1Picker());
mTvLogOff.setOnClickListener(v -> onShowLogOffPicker());
mTvLogOff.setText("未注销");
getDefaultArea1(); getDefaultArea1();
} }
private void onShowLogOffPicker() {
hideSoftKeyboard();
mLogOffPicker = new OptionsPickerBuilder(EnterCompanyInfoActivity.this, (options1, options2, options3, v) -> {
String s = mLogOffList.get(options1);
if (s.equals("未注销")) {
mSelLogOff = 0;
} else {
mSelLogOff = 1;//已注销
}
mTvLogOff.setText(s);
}).setTitleText("请选择")
.setCancelColor(Color.parseColor("#1189FF"))
.setSubmitColor(Color.parseColor("#1189FF"))
.setTitleColor(Color.parseColor("#1189FF"))
.build();
mLogOffPicker.setPicker(mLogOffList);
mLogOffPicker.show();
}
/** /**
* 获取默认省份 * 获取默认省份
@ -547,8 +576,7 @@ public class EnterCompanyInfoActivity extends BaseActivity {
submitBean.setArea1(mSelArea1Id); submitBean.setArea1(mSelArea1Id);
submitBean.setArea2(mSelArea2Id); submitBean.setArea2(mSelArea2Id);
submitBean.setArea3(mSelArea3Id); submitBean.setArea3(mSelArea3Id);
submitBean.setIsLogOff(mSelLogOff);
submitBean.setIndustryType(mSelTrade1); submitBean.setIndustryType(mSelTrade1);
code = mEtCompanyCode.getText().toString().trim(); code = mEtCompanyCode.getText().toString().trim();
if (!TextUtils.isEmpty(code)) { if (!TextUtils.isEmpty(code)) {

View File

@ -14,6 +14,7 @@ import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.Gravity; import android.view.Gravity;
import android.view.TextureView;
import android.view.View; import android.view.View;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
@ -113,6 +114,8 @@ public class CounterCheckOptionsActivity extends BaseActivity {
private String mSelType = "";//整改期限 private String mSelType = "";//整改期限
private double mCurrentLatitude = 0.0d; private double mCurrentLatitude = 0.0d;
private double mCurrentLongitude = 0.0d; private double mCurrentLongitude = 0.0d;
private NewOptions mCurrentOptions;
private int mSelPhotosType = 1;
@Override @Override
protected int setLayoutId() { protected int setLayoutId() {
@ -148,6 +151,40 @@ public class CounterCheckOptionsActivity extends BaseActivity {
mLlStateDis.setVisibility(View.GONE); mLlStateDis.setVisibility(View.GONE);
} }
}); });
mAdapter.addSelectPhotoListener((bean, options, i, type, stat) -> {
mCurrentOptions = options;
mSelPhotosType = stat;
if (type == 1) {
//选择图片
showSelectPhoto(bean);
} else if (type == 2) {
//预览
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);
} else {
//删除
List<AddPhotoBean> 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();
}
});
startListenerLocation(); startListenerLocation();
getCounterCheckOptions(mCheckId); getCounterCheckOptions(mCheckId);
@ -222,6 +259,7 @@ public class CounterCheckOptionsActivity extends BaseActivity {
mPhotoIds = mPhotoIds.replace(bean.getId() + ",", ""); mPhotoIds = mPhotoIds.replace(bean.getId() + ",", "");
})); }));
mAddPhotoAdapter.addOnItemClickListener(bean -> { mAddPhotoAdapter.addOnItemClickListener(bean -> {
mSelPhotosType = 2;
if (TextUtils.isEmpty(bean.getPath())) { if (TextUtils.isEmpty(bean.getPath())) {
//空数据 //空数据
showSelectPhoto(bean); showSelectPhoto(bean);
@ -335,6 +373,12 @@ public class CounterCheckOptionsActivity extends BaseActivity {
List<OptionsSubmitBean.HiddenDangerReportsBean> items = new ArrayList<>(); List<OptionsSubmitBean.HiddenDangerReportsBean> items = new ArrayList<>();
for (int i = 0; i < data.size(); i++) { for (int i = 0; i < data.size(); i++) {
NewOptions o = data.get(i); NewOptions o = data.get(i);
String phIds = "";
for (int j = 0; j < o.getPhotos().size(); j++) {
if (!TextUtils.isEmpty(o.getPhotos().get(j).getId())) {
phIds += o.getPhotos().get(j).getId() + ",";
}
}
List<NewOptions.ChildBean> child = data.get(i).getChild(); List<NewOptions.ChildBean> child = data.get(i).getChild();
for (int j = 0; j < child.size(); j++) { for (int j = 0; j < child.size(); j++) {
if (child.get(j).getType() == 1) { if (child.get(j).getType() == 1) {
@ -345,6 +389,9 @@ public class CounterCheckOptionsActivity extends BaseActivity {
bean.setCheckItemOptionId(child.get(j).getItemId()); bean.setCheckItemOptionId(child.get(j).getItemId());
bean.setCheckResult(child.get(j).getItemId()); bean.setCheckResult(child.get(j).getItemId());
bean.setType(child.get(j).getType()); bean.setType(child.get(j).getType());
if(phIds.length()>10){
bean.setScenePhotos(phIds);
}
items.add(bean); items.add(bean);
} }
} else { } else {
@ -358,6 +405,9 @@ public class CounterCheckOptionsActivity extends BaseActivity {
} else { } else {
bean.setCheckResult(child.get(j).getInputText()); bean.setCheckResult(child.get(j).getInputText());
} }
if(phIds.length()>10){
bean.setScenePhotos(phIds);
}
items.add(bean); items.add(bean);
} }
} }
@ -576,6 +626,15 @@ public class CounterCheckOptionsActivity extends BaseActivity {
progressDialog.dismiss(); progressDialog.dismiss();
} }
ToastUtils.showShort("上传成功"); ToastUtils.showShort("上传成功");
if (mSelPhotosType == 1) {
mCurrentBean.setId(baseUserBean.getData());
mCurrentBean.setPath(picPath);
if (mCurrentOptions.getPhotos().size() < 4) {
mCurrentOptions.getPhotos().add(new AddPhotoBean());
}
mAdapter.notifyDataSetChanged();
mCurrentBean = null;
} else {
mCurrentBean.setId(baseUserBean.getData()); mCurrentBean.setId(baseUserBean.getData());
mPhotoIds += baseUserBean.getData() + ","; mPhotoIds += baseUserBean.getData() + ",";
mCurrentBean.setPath(picPath); mCurrentBean.setPath(picPath);
@ -585,6 +644,15 @@ public class CounterCheckOptionsActivity extends BaseActivity {
mAddPhotoAdapter.notifyDataSetChanged(); mAddPhotoAdapter.notifyDataSetChanged();
mCurrentBean = null; mCurrentBean = null;
} }
// mCurrentBean.setId(baseUserBean.getData());
// mPhotoIds += baseUserBean.getData() + ",";
// mCurrentBean.setPath(picPath);
// if (mPhotos.size() < 9) {
// mPhotos.add(new AddPhotoBean());
// }
// mAddPhotoAdapter.notifyDataSetChanged();
// mCurrentBean = null;
}
@Override @Override
public void onError(Throwable e) { public void onError(Throwable e) {

View File

@ -71,7 +71,6 @@ public class HistoryDetialActivity extends BaseActivity {
}; };
mRlvDetail.setLayoutManager(linearLayoutManager); mRlvDetail.setLayoutManager(linearLayoutManager);
mRlvDetail.setAdapter(mAdapter); mRlvDetail.setAdapter(mAdapter);
} }
private void getDetail(String cid) { private void getDetail(String cid) {
@ -93,7 +92,7 @@ public class HistoryDetialActivity extends BaseActivity {
mTvName.setText(beans.getNameJoinByEnterpriseId()); mTvName.setText(beans.getNameJoinByEnterpriseId());
mTvPeo.setText(beans.getMasterJoinByEnterpriseId()); mTvPeo.setText(beans.getMasterJoinByEnterpriseId());
if (beans.getIsComplete() == 0) { if (beans.getIsComplete() == 0) {
if (beans.getRectificationType() == 0) { if (beans.getRectificationType() == 1) {
mLlType.setVisibility(View.VISIBLE); mLlType.setVisibility(View.VISIBLE);
if (beans.getImmediatelyChangeType() == 1) { if (beans.getImmediatelyChangeType() == 1) {
mTvType.setText("当场整改"); mTvType.setText("当场整改");

View File

@ -106,11 +106,13 @@ public class NewCheckOptionsActivity extends BaseActivity {
private ArrayAdapter mNowAdapter; private ArrayAdapter mNowAdapter;
private AddPhotoAdapter mAddPhotoAdapter; private AddPhotoAdapter mAddPhotoAdapter;
private List<AddPhotoBean> mPhotos; private List<AddPhotoBean> mPhotos;
private NewOptions mCurrentOptions;
private String mPhotoIds = ""; private String mPhotoIds = "";
private int mType = 1;//整改方式 private int mType = 1;//整改方式
private String mSelType = "";//整改期限 private String mSelType = "";//整改期限
private double mCurrentLatitude = 0.0d; private double mCurrentLatitude = 0.0d;
private double mCurrentLongitude = 0.0d; private double mCurrentLongitude = 0.0d;
private int mSelPhotosType = 2;
@Override @Override
protected int setLayoutId() { protected int setLayoutId() {
@ -125,6 +127,9 @@ public class NewCheckOptionsActivity extends BaseActivity {
mTvPublish.setVisibility(View.VISIBLE); mTvPublish.setVisibility(View.VISIBLE);
mTvPublish.setText("确定"); mTvPublish.setText("确定");
mTvPublish.setOnClickListener(v -> { mTvPublish.setOnClickListener(v -> {
// Gson gson= new Gson();
// String s = gson.toJson(mAdapter.getData());
// LogUtils.e(s);
buildConfirmData(mAdapter.getData()); buildConfirmData(mAdapter.getData());
}); });
startListenerLocation(); startListenerLocation();
@ -155,9 +160,46 @@ public class NewCheckOptionsActivity extends BaseActivity {
mLlStateDis.setVisibility(View.GONE); mLlStateDis.setVisibility(View.GONE);
} }
}); });
if (TextUtils.isEmpty(nId)) {
ToastUtils.showLong("该企业未关联检查项,请联系管理员进行关联");
mRlvOptions.setVisibility(View.GONE);
} else {
mRlvOptions.setVisibility(View.VISIBLE);
getCheckOptions(id, nId); getCheckOptions(id, nId);
}
mAdapter.addSelectPhotoListener((bean, options, i, type, stat) -> {
mCurrentOptions = options;
mSelPhotosType = stat;
if (type == 1) {
//选择图片
showSelectPhoto(bean);
} else if (type == 2) {
//预览
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);
} else {
//删除
List<AddPhotoBean> 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();
}
});
mNowStrings = mActivity.getResources().getStringArray(R.array.limit); mNowStrings = mActivity.getResources().getStringArray(R.array.limit);
mTermStrings = mActivity.getResources().getStringArray(R.array.timeLimit); mTermStrings = mActivity.getResources().getStringArray(R.array.timeLimit);
mBtnUnclaim.setOnClickListener(v -> doUnclaim()); mBtnUnclaim.setOnClickListener(v -> doUnclaim());
@ -229,6 +271,7 @@ public class NewCheckOptionsActivity extends BaseActivity {
mPhotoIds = mPhotoIds.replace(bean.getId() + ",", ""); mPhotoIds = mPhotoIds.replace(bean.getId() + ",", "");
})); }));
mAddPhotoAdapter.addOnItemClickListener(bean -> { mAddPhotoAdapter.addOnItemClickListener(bean -> {
mSelPhotosType = 2;
if (TextUtils.isEmpty(bean.getPath())) { if (TextUtils.isEmpty(bean.getPath())) {
//空数据 //空数据
showSelectPhoto(bean); showSelectPhoto(bean);
@ -308,6 +351,12 @@ public class NewCheckOptionsActivity extends BaseActivity {
List<OptionsSubmitBean.HiddenDangerReportsBean> items = new ArrayList<>(); List<OptionsSubmitBean.HiddenDangerReportsBean> items = new ArrayList<>();
for (int i = 0; i < data.size(); i++) { for (int i = 0; i < data.size(); i++) {
NewOptions o = data.get(i); NewOptions o = data.get(i);
String phIds = "";
for (int j = 0; j < o.getPhotos().size(); j++) {
if (!TextUtils.isEmpty(o.getPhotos().get(j).getId())) {
phIds += o.getPhotos().get(j).getId() + ",";
}
}
List<NewOptions.ChildBean> child = data.get(i).getChild(); List<NewOptions.ChildBean> child = data.get(i).getChild();
for (int j = 0; j < child.size(); j++) { for (int j = 0; j < child.size(); j++) {
if (child.get(j).getType() == 1) { if (child.get(j).getType() == 1) {
@ -318,6 +367,9 @@ public class NewCheckOptionsActivity extends BaseActivity {
bean.setCheckItemOptionId(child.get(j).getItemId()); bean.setCheckItemOptionId(child.get(j).getItemId());
bean.setCheckResult(child.get(j).getItemId()); bean.setCheckResult(child.get(j).getItemId());
bean.setType(child.get(j).getType()); bean.setType(child.get(j).getType());
if (phIds.length() > 10) {
bean.setScenePhotos(phIds);
}
items.add(bean); items.add(bean);
} }
} else { } else {
@ -331,6 +383,9 @@ public class NewCheckOptionsActivity extends BaseActivity {
} else { } else {
bean.setCheckResult(child.get(j).getInputText()); bean.setCheckResult(child.get(j).getInputText());
} }
if (phIds.length() > 10) {
bean.setScenePhotos(phIds);
}
items.add(bean); items.add(bean);
} }
} }
@ -617,6 +672,15 @@ public class NewCheckOptionsActivity extends BaseActivity {
progressDialog.dismiss(); progressDialog.dismiss();
} }
ToastUtils.showShort("上传成功"); ToastUtils.showShort("上传成功");
if (mSelPhotosType == 1) {
mCurrentBean.setId(baseUserBean.getData());
mCurrentBean.setPath(picPath);
if (mCurrentOptions.getPhotos().size() < 4) {
mCurrentOptions.getPhotos().add(new AddPhotoBean());
}
mAdapter.notifyDataSetChanged();
mCurrentBean = null;
} else {
mCurrentBean.setId(baseUserBean.getData()); mCurrentBean.setId(baseUserBean.getData());
mPhotoIds += baseUserBean.getData() + ","; mPhotoIds += baseUserBean.getData() + ",";
mCurrentBean.setPath(picPath); mCurrentBean.setPath(picPath);
@ -626,6 +690,7 @@ public class NewCheckOptionsActivity extends BaseActivity {
mAddPhotoAdapter.notifyDataSetChanged(); mAddPhotoAdapter.notifyDataSetChanged();
mCurrentBean = null; mCurrentBean = null;
} }
}
@Override @Override
public void onError(Throwable e) { public void onError(Throwable e) {

View File

@ -1,6 +1,7 @@
package com.sucstepsoft.txrealtimelocation.activitys.issue.demo; package com.sucstepsoft.txrealtimelocation.activitys.issue.demo;
import android.content.Context; import android.content.Context;
import android.support.design.widget.AppBarLayout;
import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.GridLayoutManager;
import android.text.Editable; import android.text.Editable;
import android.text.InputType; import android.text.InputType;
@ -58,27 +59,28 @@ public class NewOptionsAdapter extends BaseRecyclerAdapter<NewOptions, NewOption
public void bindHolder(NewOptionsHolder oHolder, int i) { public void bindHolder(NewOptionsHolder oHolder, int i) {
//设置是否必须星号 //设置是否必须星号
if (mData.get(i).getIsMust() == 1) { if (mData.get(i).getIsMust() == 1) {
oHolder.mIvIsMust.setVisibility(View.INVISIBLE); oHolder.mIvIsMust.setVisibility(View.VISIBLE);
} else { } else {
oHolder.mIvIsMust.setVisibility(View.INVISIBLE); oHolder.mIvIsMust.setVisibility(View.INVISIBLE);
} }
oHolder.mTvTitle.setText(mData.get(i).getTitle()); oHolder.mTvTitle.setText(mData.get(i).getTitle());
oHolder.mRgState.setOnCheckedChangeListener(null); oHolder.mRgState.setOnCheckedChangeListener(null);
oHolder.mEtContent.setVisibility(View.GONE); oHolder.mRgState.removeAllViews();
oHolder.mLlCheck.removeAllViews();
boolean isInput = false; boolean isInput = false;
for (int j = 0; j < mData.get(i).getChild().size(); j++) { for (int j = 0; j < mData.get(i).getChild().size(); j++) {
if (mData.get(i).getChild().get(j).getType() == 1) { if (mData.get(i).getChild().get(j).getType() == 1) {
NewOptions.ChildBean bean = mData.get(i).getChild().get(j); NewOptions.ChildBean bean = mData.get(i).getChild().get(j);
RadioButton button = new RadioButton(mContext); RadioButton button = new RadioButton(mContext);
button.setId(bean.getId()); button.setId(bean.getId());
button.setChecked(bean.isCheck());
button.setText(bean.getTitle()); button.setText(bean.getTitle());
button.setPadding(dp2px, dp2px, dp2px, dp2px); button.setPadding(dp2px, dp2px, dp2px, dp2px);
button.setTextSize(sp2px); button.setTextSize(sp2px);
button.setButtonDrawable(R.drawable.sel_rb); button.setButtonDrawable(R.drawable.sel_rb);
oHolder.mRgState.addView(button); oHolder.mRgState.addView(button);
isInput = true; isInput = true;
} else { } else if (mData.get(i).getChild().get(j).getType() == 2 || mData.get(i).getChild().get(j).getType() == 3) {
EditText editText = new EditText(mContext); EditText editText = new EditText(mContext);
editText.setHint("请输入" + mData.get(i).getTitle() + mData.get(i).getChild().get(j).getTitle()); editText.setHint("请输入" + mData.get(i).getTitle() + mData.get(i).getChild().get(j).getTitle());
editText.setBackgroundResource(R.drawable.sp_square_btn_gray_sel); editText.setBackgroundResource(R.drawable.sp_square_btn_gray_sel);
@ -90,6 +92,11 @@ public class NewOptionsAdapter extends BaseRecyclerAdapter<NewOptions, NewOption
lp.rightMargin = dp2px10; lp.rightMargin = dp2px10;
lp.topMargin = dp2px10; lp.topMargin = dp2px10;
editText.setLayoutParams(lp); editText.setLayoutParams(lp);
if (!TextUtils.isEmpty(mData.get(i).getChild().get(j).getInputText())) {
editText.setText(mData.get(i).getChild().get(j).getInputText());
} else {
editText.setText("");
}
if (mData.get(i).getChild().get(j).getType() == 2) { if (mData.get(i).getChild().get(j).getType() == 2) {
editText.setInputType(InputType.TYPE_CLASS_NUMBER); editText.setInputType(InputType.TYPE_CLASS_NUMBER);
} else { } else {
@ -138,13 +145,15 @@ public class NewOptionsAdapter extends BaseRecyclerAdapter<NewOptions, NewOption
} }
}); });
oHolder.mLlCheck.addView(editText); oHolder.mLlCheck.addView(editText);
} else {
//图片
} }
} }
oHolder.mRgState.setOnCheckedChangeListener((radioGroup, i1) -> { oHolder.mRgState.setOnCheckedChangeListener((radioGroup, i1) -> {
for (int j = 0; j < mData.get(i).getChild().size(); j++) { for (int j = 0; j < mData.get(i).getChild().size(); j++) {
if (mData.get(i).getChild().get(j).getId() == i1) { if (mData.get(i).getChild().get(j).getId() == i1) {
mData.get(i).getChild().get(j).setCheck(true); mData.get(i).getChild().get(j).setCheck(true);
//纯选择 // //纯选择
if (mData.get(i).getChild().get(j).getType() == 1) { if (mData.get(i).getChild().get(j).getType() == 1) {
if (mData.get(i).getChild().get(j).isWrong()) { if (mData.get(i).getChild().get(j).isWrong()) {
mData.get(i).setState(EmStateCheck.UNCHECK); mData.get(i).setState(EmStateCheck.UNCHECK);
@ -160,12 +169,44 @@ public class NewOptionsAdapter extends BaseRecyclerAdapter<NewOptions, NewOption
}); });
if (isInput) { if (isInput) {
//存在选择 //存在选择
boolean isSel = false;
for (int j = 0; j < mData.get(i).getChild().size(); j++) {
NewOptions.ChildBean bean = mData.get(i).getChild().get(j);
if (bean.getType() == 1) {
if (bean.isCheck()) {
isSel = true;
break;
}
}
}
if (!isSel) {
mData.get(i).setState(EmStateCheck.NORMAL); mData.get(i).setState(EmStateCheck.NORMAL);
}
} else { } else {
//纯输入
mData.get(i).setState(EmStateCheck.CHECK); mData.get(i).setState(EmStateCheck.CHECK);
} }
setPhotoView(oHolder, i);
} }
private void setPhotoView(NewOptionsHolder 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, 1);
});
photoAdapter.addOnItemClickListener(bean -> {
if (mSelectPhotoListener != null) {
if (TextUtils.isEmpty(bean.getPath())) {
//空数据,选择图片
mSelectPhotoListener.onSelectPhoto(bean, mData.get(index), index, 1, 1);
} else {
mSelectPhotoListener.onSelectPhoto(bean, mData.get(index), index, 2, 1);
}
}
});
}
private void notifyDataChange() { private void notifyDataChange() {
boolean isUnCheck = false; boolean isUnCheck = false;
@ -189,7 +230,7 @@ public class NewOptionsAdapter extends BaseRecyclerAdapter<NewOptions, NewOption
} }
public interface SelectPhoto { public interface SelectPhoto {
void onSelectPhoto(AddPhotoBean bean, Options options, int i, int type); void onSelectPhoto(AddPhotoBean bean, NewOptions options, int i, int type, int s);
} }
private StateChangeListener mChangeListener; private StateChangeListener mChangeListener;

View File

@ -24,14 +24,13 @@ public class NewOptionsHolder extends RecyclerView.ViewHolder {
public ImageView mIvIsMust; public ImageView mIvIsMust;
public RadioGroup mRgState; public RadioGroup mRgState;
public LinearLayout mLlCheck; public LinearLayout mLlCheck;
public EditText mEtContent; public RecyclerView mRlvPhotos;
public NewOptionsHolder(@NonNull View itemView) { public NewOptionsHolder(@NonNull View itemView) {
super(itemView); super(itemView);
mTvTitle = itemView.findViewById(R.id.tv_title); mTvTitle = itemView.findViewById(R.id.tv_title);
mRgState = itemView.findViewById(R.id.rg_state); mRgState = itemView.findViewById(R.id.rg_state);
mIvIsMust = itemView.findViewById(R.id.iv_must); mIvIsMust = itemView.findViewById(R.id.iv_must);
mLlCheck = itemView.findViewById(R.id.ll_check); mLlCheck = itemView.findViewById(R.id.ll_check);
mEtContent = itemView.findViewById(R.id.et_content); mRlvPhotos= itemView.findViewById(R.id.rlv_photos);
} }
} }

View File

@ -7,6 +7,7 @@ import android.text.InputType;
import android.text.TextUtils; import android.text.TextUtils;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.TextureView;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.AdapterView; import android.widget.AdapterView;
@ -22,6 +23,7 @@ import com.sucstepsoft.cm_utils.utils.LogUtils;
import com.sucstepsoft.txrealtimelocation.R; import com.sucstepsoft.txrealtimelocation.R;
import com.sucstepsoft.txrealtimelocation.activitys.issue.demo.NewOptions; import com.sucstepsoft.txrealtimelocation.activitys.issue.demo.NewOptions;
import com.sucstepsoft.txrealtimelocation.activitys.issue.demo.NewOptionsAdapter; import com.sucstepsoft.txrealtimelocation.activitys.issue.demo.NewOptionsAdapter;
import com.sucstepsoft.txrealtimelocation.activitys.issue.demo.NewOptionsHolder;
import com.sucstepsoft.txrealtimelocation.activitys.issue.demo.Options; import com.sucstepsoft.txrealtimelocation.activitys.issue.demo.Options;
import com.sucstepsoft.txrealtimelocation.activitys.issue.demo.OptionsAdapter; import com.sucstepsoft.txrealtimelocation.activitys.issue.demo.OptionsAdapter;
import com.sucstepsoft.txrealtimelocation.activitys.issue.demo.OptionsHolder; import com.sucstepsoft.txrealtimelocation.activitys.issue.demo.OptionsHolder;
@ -57,16 +59,18 @@ public class CounterCheckOptionsAdapter extends BaseRecyclerAdapter<NewOptions,
oHolder.mIvIsMust.setVisibility(View.INVISIBLE); oHolder.mIvIsMust.setVisibility(View.INVISIBLE);
} }
oHolder.mTvTitle.setText(mData.get(i).getTitle()); oHolder.mTvTitle.setText(mData.get(i).getTitle());
oHolder.mRgState.setOnCheckedChangeListener(null); oHolder.mRgState.removeAllViews();
oHolder.mEtContent.setVisibility(View.GONE); oHolder.mLlCheck.removeAllViews();
boolean isInput = false;
oHolder.mRgState.setOnCheckedChangeListener(null);
boolean isInput = false;
for (int j = 0; j < mData.get(i).getChild().size(); j++) { for (int j = 0; j < mData.get(i).getChild().size(); j++) {
if (mData.get(i).getChild().get(j).getType() == 1) { if (mData.get(i).getChild().get(j).getType() == 1) {
NewOptions.ChildBean bean = mData.get(i).getChild().get(j); NewOptions.ChildBean bean = mData.get(i).getChild().get(j);
RadioButton button = new RadioButton(mContext); RadioButton button = new RadioButton(mContext);
button.setId(bean.getId()); button.setId(bean.getId());
button.setText(bean.getTitle()); button.setText(bean.getTitle());
button.setChecked(bean.isCheck());
button.setPadding(10, 10, 10, 10); button.setPadding(10, 10, 10, 10);
button.setTextSize(15); button.setTextSize(15);
button.setButtonDrawable(R.drawable.sel_rb); button.setButtonDrawable(R.drawable.sel_rb);
@ -83,6 +87,9 @@ public class CounterCheckOptionsAdapter extends BaseRecyclerAdapter<NewOptions,
lp.leftMargin = 15; lp.leftMargin = 15;
lp.rightMargin = 15; lp.rightMargin = 15;
editText.setLayoutParams(lp); editText.setLayoutParams(lp);
if (!TextUtils.isEmpty(mData.get(i).getChild().get(j).getInputText())) {
editText.setText(mData.get(i).getChild().get(j).getInputText());
}
if (mData.get(i).getChild().get(j).getType() == 2) { if (mData.get(i).getChild().get(j).getType() == 2) {
editText.setInputType(InputType.TYPE_CLASS_NUMBER); editText.setInputType(InputType.TYPE_CLASS_NUMBER);
} else { } else {
@ -128,10 +135,42 @@ public class CounterCheckOptionsAdapter extends BaseRecyclerAdapter<NewOptions,
}); });
if (isInput) { if (isInput) {
//存在选择 //存在选择
boolean isSel = false;
for (int j = 0; j < mData.get(i).getChild().size(); j++) {
NewOptions.ChildBean bean = mData.get(i).getChild().get(j);
if (bean.getType() == 1) {
if (bean.isCheck()) {
isSel = true;
break;
}
}
}
if (!isSel) {
mData.get(i).setState(EmStateCheck.NORMAL); mData.get(i).setState(EmStateCheck.NORMAL);
}
} else { } else {
mData.get(i).setState(EmStateCheck.CHECK); mData.get(i).setState(EmStateCheck.CHECK);
} }
setPhotoView(oHolder, i);
}
private void setPhotoView(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.addOnDeleteListener((bean, i) -> {
mSelectPhotoListener.onSelectPhoto(bean, mData.get(index), index, 3, 1);
});
photoAdapter.addOnItemClickListener(bean -> {
if (mSelectPhotoListener != null) {
if (TextUtils.isEmpty(bean.getPath())) {
//空数据,选择图片
mSelectPhotoListener.onSelectPhoto(bean, mData.get(index), index, 1, 1);
} else {
mSelectPhotoListener.onSelectPhoto(bean, mData.get(index), index, 2, 1);
}
}
});
} }
private void notifyDataChange() { private void notifyDataChange() {
@ -147,6 +186,7 @@ public class CounterCheckOptionsAdapter extends BaseRecyclerAdapter<NewOptions,
} }
mChangeListener.onStateChange(isUnCheck); mChangeListener.onStateChange(isUnCheck);
} }
private StateChangeListener mChangeListener; private StateChangeListener mChangeListener;
public void setStateChangeListener(StateChangeListener listener) { public void setStateChangeListener(StateChangeListener listener) {
@ -157,13 +197,13 @@ public class CounterCheckOptionsAdapter extends BaseRecyclerAdapter<NewOptions,
void onStateChange(boolean isCheck); void onStateChange(boolean isCheck);
} }
private OptionsAdapter.SelectPhoto mSelectPhotoListener; private SelectPhoto mSelectPhotoListener;
public void addSelectPhotoListener(OptionsAdapter.SelectPhoto selectPhotoListener) { public void addSelectPhotoListener(SelectPhoto selectPhotoListener) {
this.mSelectPhotoListener = selectPhotoListener; this.mSelectPhotoListener = selectPhotoListener;
} }
public interface SelectPhoto { public interface SelectPhoto {
void onSelectPhoto(AddPhotoBean bean, Options options, int i, int type); void onSelectPhoto(AddPhotoBean bean, NewOptions options, int i, int type, int state);
} }
} }

View File

@ -53,7 +53,11 @@ public class MissionDetailAdapter extends BaseRecyclerAdapter<HistoryDetialBean.
break; break;
case 2: case 2:
case 3: case 3:
String tx = mData.get(i).getHiddenDangerReports().get(j).getNameJoinByCheckItemId() + ":" + mData.get(i).getHiddenDangerReports().get(j).getCheckResult() + mData.get(i).getHiddenDangerReports().get(j).getUnitJoinByCheckItemId(); String temp = "未填写";
if (!TextUtils.isEmpty(mData.get(i).getHiddenDangerReports().get(j).getCheckResult())) {
temp = mData.get(i).getHiddenDangerReports().get(j).getCheckResult() + mData.get(i).getHiddenDangerReports().get(j).getUnitJoinByCheckItemId();
}
String tx = mData.get(i).getHiddenDangerReports().get(j).getNameJoinByCheckItemId() + ":" + temp;
tv.setText(tx); tv.setText(tx);
break; break;
} }
@ -62,5 +66,31 @@ public class MissionDetailAdapter extends BaseRecyclerAdapter<HistoryDetialBean.
} else { } else {
holder.mLlContent.setVisibility(View.GONE); holder.mLlContent.setVisibility(View.GONE);
} }
if (TextUtils.isEmpty(mData.get(i).getPhotos())) {
holder.mRlvPhotos.setVisibility(View.GONE);
} else {
holder.mRlvPhotos.setVisibility(View.VISIBLE);
List<String> photos = new ArrayList<>();
String[] split = mData.get(i).getPhotos().split(",");
for (int j = 0; j < split.length; j++) {
if (!TextUtils.isEmpty(split[j])) {
photos.add(BaseUrlApi.BASE_IMG_URL + split[j]);
}
}
BaseShowPhotoAdapter adapter = new BaseShowPhotoAdapter(mContext, photos);
GridLayoutManager manager = new GridLayoutManager(mContext, 4) {
@Override
public boolean canScrollVertically() {
return false;
}
};
holder.mRlvPhotos.setLayoutManager(manager);
holder.mRlvPhotos.setAdapter(adapter);
adapter.addOnItemClickListener(url -> {
Intent intent = new Intent(mContext, PhotoActivity.class);
intent.putExtra("imgUrls", new ArrayList<>(adapter.getData()));
mContext.startActivity(intent);
});
}
} }
} }

View File

@ -25,16 +25,14 @@ public class CounterCheckOptionHolder extends RecyclerView.ViewHolder {
public TextView mTvTitle; public TextView mTvTitle;
public ImageView mIvIsMust; public ImageView mIvIsMust;
public LinearLayout mLlCheck; public LinearLayout mLlCheck;
public EditText mEtContent; public RecyclerView mRlvPhotos;
public CounterCheckOptionHolder(@NonNull View itemView) { public CounterCheckOptionHolder(@NonNull View itemView) {
super(itemView); super(itemView);
mTvTitle = itemView.findViewById(R.id.tv_title); mTvTitle = itemView.findViewById(R.id.tv_title);
mRgState = itemView.findViewById(R.id.rg_state); mRgState = itemView.findViewById(R.id.rg_state);
mIvIsMust = itemView.findViewById(R.id.iv_must); mIvIsMust = itemView.findViewById(R.id.iv_must);
mLlCheck = itemView.findViewById(R.id.ll_check); mLlCheck = itemView.findViewById(R.id.ll_check);
mEtContent = itemView.findViewById(R.id.et_content); mRlvPhotos= itemView.findViewById(R.id.rlv_photos);
} }
} }

View File

@ -17,10 +17,12 @@ import com.sucstepsoft.txrealtimelocation.R;
public class MissionDetailHolder extends RecyclerView.ViewHolder { public class MissionDetailHolder extends RecyclerView.ViewHolder {
public TextView mTvName; public TextView mTvName;
public LinearLayout mLlContent; public LinearLayout mLlContent;
public RecyclerView mRlvPhotos;
public MissionDetailHolder(@NonNull View itemView) { public MissionDetailHolder(@NonNull View itemView) {
super(itemView); super(itemView);
mTvName = itemView.findViewById(R.id.tv_options_name); mTvName = itemView.findViewById(R.id.tv_options_name);
mLlContent = itemView.findViewById(R.id.ll_content); mLlContent = itemView.findViewById(R.id.ll_content);
mRlvPhotos = itemView.findViewById(R.id.rlv_photos);
} }
} }

View File

@ -69,6 +69,15 @@ public class CompanyDetailBean {
private String bussinessRegNum; private String bussinessRegNum;
private String legalPerson; private String legalPerson;
private String summary; private String summary;
private int isLogOff;
public int getIsLogOff() {
return isLogOff;
}
public void setIsLogOff(int isLogOff) {
this.isLogOff = isLogOff;
}
public String getEnterpriseId() { public String getEnterpriseId() {
return enterpriseId; return enterpriseId;

View File

@ -46,6 +46,15 @@ public class CompanyEnterBean {
private String legalPerson;//企业法人 private String legalPerson;//企业法人
private String bussinessRegNum;//组织机构代码 private String bussinessRegNum;//组织机构代码
private String industryType;//行业类型 private String industryType;//行业类型
private int isLogOff;
public int getIsLogOff() {
return isLogOff;
}
public void setIsLogOff(int isLogOff) {
this.isLogOff = isLogOff;
}
public String getRiskOperationPid() { public String getRiskOperationPid() {
return riskOperationPid; return riskOperationPid;

View File

@ -333,8 +333,17 @@ public class HistoryDetialBean {
private int type; private int type;
private String checkItemParentId; private String checkItemParentId;
private List<?> checkItemOptions; private List<?> checkItemOptions;
private String scenePhotos;
private List<HiddenDangerReportsBean> hiddenDangerReports; private List<HiddenDangerReportsBean> hiddenDangerReports;
public String getPhotos() {
return scenePhotos;
}
public void setPhotos(String photos) {
this.scenePhotos = photos;
}
public String getCheckItemId() { public String getCheckItemId() {
return checkItemId; return checkItemId;
} }

View File

@ -156,6 +156,15 @@ public class OptionsSubmitBean {
private String checkItemOptionId; private String checkItemOptionId;
private String checkResult; private String checkResult;
private int type; private int type;
private String scenePhotos;
public String getScenePhotos() {
return scenePhotos;
}
public void setScenePhotos(String scenePhotos) {
this.scenePhotos = scenePhotos;
}
public String getCheckId() { public String getCheckId() {
return checkId; return checkId;

View File

@ -1,6 +1,7 @@
package com.sucstepsoft.txrealtimelocation.net; package com.sucstepsoft.txrealtimelocation.net;
import com.sucstepsoft.cm_utils.core.retrofit_net.BaseUrlApi;
import com.sucstepsoft.txrealtimelocation.beans.AddressListBean; import com.sucstepsoft.txrealtimelocation.beans.AddressListBean;
import com.sucstepsoft.txrealtimelocation.beans.AreaListBean; import com.sucstepsoft.txrealtimelocation.beans.AreaListBean;
import com.sucstepsoft.txrealtimelocation.beans.BaseUserBean; import com.sucstepsoft.txrealtimelocation.beans.BaseUserBean;
@ -735,4 +736,23 @@ public interface LocationApiService {
@Headers({"base_url_name:dict", "Content-Type: application/json", "Accept: application/json"}) @Headers({"base_url_name:dict", "Content-Type: application/json", "Accept: application/json"})
@GET("articlecontent/getarticlecontentbyid/{articleContentId}") @GET("articlecontent/getarticlecontentbyid/{articleContentId}")
Observable<NoticeDetailBean> getNoticeDetailById(@Path("articleContentId") String id, @Header("token") String token); Observable<NoticeDetailBean> getNoticeDetailById(@Path("articleContentId") String id, @Header("token") String token);
//获取通知公告数量
//getNumberByMine
@Headers({"base_url_name:dict", "Content-Type: application/json", "Accept: application/json"})
@GET("articlecontent/countarticlecount")
Observable<BaseUserBean> getArticleCount(@Header("token") String token);
//获取历史任务数量
//GET /app/check/countcheckofmine
@Headers({"base_url_name:dict", "Content-Type: application/json", "Accept: application/json"})
@GET("check/countcheckofmine")
Observable<BaseUserBean> getHistoryCount(@Header("token") String token);
//我的企业数量
//GET /app/enterpriseofgridoperator/countenterpriseofgridoperatorofmine
@Headers({"base_url_name:dict", "Content-Type: application/json", "Accept: application/json"})
@GET("enterpriseofgridoperator/countenterpriseofgridoperatorofmine")
Observable<BaseUserBean> getMineEnterpriseCount(@Header("token") String token);
} }

View File

@ -286,6 +286,22 @@
android:layout_marginTop="3dp" android:layout_marginTop="3dp"
android:background="@color/divider_line_color" /> android:background="@color/divider_line_color" />
<TextView
style="@style/company_name_title"
android:text="企业是否注销" />
<TextView
android:id="@+id/tv_logoff"
style="@style/company_content"
tools:text="未注销" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="3dp"
android:background="@color/divider_line_color" />
<TextView <TextView
style="@style/company_name_title" style="@style/company_name_title"
android:text="生产单位经营外貌" /> android:text="生产单位经营外貌" />

View File

@ -156,10 +156,10 @@
android:id="@+id/tv_com_type" android:id="@+id/tv_com_type"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:background="@drawable/shp_rectangle_gray" android:background="@drawable/shp_rectangle_gray"
android:clickable="true"
android:drawableRight="@drawable/ic_arrow_gray_down" android:drawableRight="@drawable/ic_arrow_gray_down"
android:focusable="true"
android:hint="请选择企业类型" android:hint="请选择企业类型"
android:padding="10dp" android:padding="10dp"
android:textColor="@color/black" /> android:textColor="@color/black" />
@ -181,8 +181,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/shp_rectangle_gray" android:background="@drawable/shp_rectangle_gray"
android:drawableRight="@drawable/ic_arrow_gray_down"
android:clickable="true" android:clickable="true"
android:drawableRight="@drawable/ic_arrow_gray_down"
android:focusable="true" android:focusable="true"
android:hint="企业所属省、自治区" android:hint="企业所属省、自治区"
android:padding="10dp" android:padding="10dp"
@ -205,8 +205,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/shp_rectangle_gray" android:background="@drawable/shp_rectangle_gray"
android:drawableRight="@drawable/ic_arrow_gray_down"
android:clickable="true" android:clickable="true"
android:drawableRight="@drawable/ic_arrow_gray_down"
android:focusable="true" android:focusable="true"
android:hint="企业所属市" android:hint="企业所属市"
android:padding="10dp" android:padding="10dp"
@ -229,10 +229,10 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/shp_rectangle_gray" android:background="@drawable/shp_rectangle_gray"
android:drawableRight="@drawable/ic_arrow_gray_down"
android:hint="企业所属旗县区"
android:clickable="true" android:clickable="true"
android:drawableRight="@drawable/ic_arrow_gray_down"
android:focusable="true" android:focusable="true"
android:hint="企业所属旗县区"
android:padding="10dp" android:padding="10dp"
android:textColor="@color/black" /> android:textColor="@color/black" />
</LinearLayout> </LinearLayout>
@ -252,11 +252,11 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/shp_rectangle_gray" android:background="@drawable/shp_rectangle_gray"
android:clickable="true"
android:drawableRight="@drawable/ic_arrow_gray_down" android:drawableRight="@drawable/ic_arrow_gray_down"
android:focusable="true"
android:hint="请选择所属街道" android:hint="请选择所属街道"
android:padding="10dp" android:padding="10dp"
android:clickable="true"
android:focusable="true"
android:textColor="@color/black" /> android:textColor="@color/black" />
</LinearLayout> </LinearLayout>
@ -275,11 +275,11 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/shp_rectangle_gray" android:background="@drawable/shp_rectangle_gray"
android:clickable="true"
android:drawableRight="@drawable/ic_arrow_gray_down" android:drawableRight="@drawable/ic_arrow_gray_down"
android:focusable="true"
android:hint="请选择社区、村、嘎查" android:hint="请选择社区、村、嘎查"
android:padding="10dp" android:padding="10dp"
android:clickable="true"
android:focusable="true"
android:textColor="@color/black" /> android:textColor="@color/black" />
</LinearLayout> </LinearLayout>
@ -356,12 +356,12 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/shp_rectangle_gray" android:background="@drawable/shp_rectangle_gray"
android:clickable="true"
android:drawableRight="@drawable/ic_arrow_gray_down" android:drawableRight="@drawable/ic_arrow_gray_down"
android:focusable="true"
android:gravity="left" android:gravity="left"
android:hint="请选择管理行业" android:hint="请选择管理行业"
android:padding="10dp" android:padding="10dp"
android:clickable="true"
android:focusable="true"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="15sp" /> android:textSize="15sp" />
@ -411,8 +411,8 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/shp_rectangle_gray" android:background="@drawable/shp_rectangle_gray"
android:drawableRight="@drawable/ic_arrow_gray_down"
android:clickable="true" android:clickable="true"
android:drawableRight="@drawable/ic_arrow_gray_down"
android:focusable="true" android:focusable="true"
android:gravity="left" android:gravity="left"
android:hint="请选择风险作业" android:hint="请选择风险作业"
@ -470,6 +470,34 @@
tools:text="" /> tools:text="" />
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="10dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ic_start_hint" />
<TextView
android:id="@+id/tv_logoff"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:background="@drawable/shp_rectangle_gray"
android:clickable="true"
android:drawableRight="@drawable/ic_arrow_gray_down"
android:focusable="true"
android:gravity="left"
android:hint="企业是否注销"
android:padding="10dp"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</android.support.v7.widget.CardView> </android.support.v7.widget.CardView>

View File

@ -98,8 +98,8 @@
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="invisible" android:background="@drawable/ic_start_hint"
android:background="@drawable/ic_start_hint" /> android:visibility="invisible" />
<EditText <EditText
android:id="@+id/et_company_code" android:id="@+id/et_company_code"
@ -472,6 +472,34 @@
tools:text="" /> tools:text="" />
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="10dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ic_start_hint" />
<TextView
android:id="@+id/tv_logoff"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:background="@drawable/shp_rectangle_gray"
android:clickable="true"
android:drawableRight="@drawable/ic_arrow_gray_down"
android:focusable="true"
android:gravity="left"
android:hint="企业是否注销"
android:padding="10dp"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</android.support.v7.widget.CardView> </android.support.v7.widget.CardView>

View File

@ -57,8 +57,7 @@
android:layout_height="27dp" android:layout_height="27dp"
android:background="@drawable/sp_blue_sel" android:background="@drawable/sp_blue_sel"
android:text="企业不配合" android:text="企业不配合"
android:textColor="@color/titleBar" android:textColor="@color/titleBar" />
/>
</LinearLayout> </LinearLayout>
<TextView <TextView
@ -75,7 +74,13 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:orientation="vertical">
<!-- <ExpandableListView-->
<!-- android:id="@+id/elv_options"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content" />-->
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/rlv_options" android:id="@+id/rlv_options"

View File

@ -28,47 +28,39 @@
<TextView <TextView
android:id="@+id/tv_title" android:id="@+id/tv_title"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="1"
android:padding="5dp" android:padding="5dp"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="16sp" android:textSize="16sp"
tools:text="测试数据测试数据测试数据测试数据测试数据测试数据测试数据测试数据" /> tools:text="测试数据测试数据测试数据测试数据测试数据测试数据测试数据测试数据" />
</LinearLayout>
<RadioGroup <RadioGroup
android:id="@+id/rg_state" android:id="@+id/rg_state"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="vertical" android:orientation="horizontal">
android:padding="8dp">
</RadioGroup> </RadioGroup>
</LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/ll_check" android:id="@+id/ll_check"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:padding="8dp"> android:padding="5dp">
</LinearLayout> </LinearLayout>
<EditText <android.support.v7.widget.RecyclerView
android:id="@+id/et_content" android:id="@+id/rlv_photos"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="8dp" android:padding="5dp" />
android:layout_marginRight="8dp"
android:layout_marginBottom="3dp"
android:background="@drawable/sp_square_btn_gray_sel"
android:hint="请输入"
android:padding="3dp"
android:textSize="13sp"
android:visibility="gone" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View File

@ -25,5 +25,9 @@
</LinearLayout> </LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/rlv_photos"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout> </LinearLayout>

View File

@ -28,26 +28,25 @@
<TextView <TextView
android:id="@+id/tv_title" android:id="@+id/tv_title"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="1"
android:padding="5dp" android:padding="5dp"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="16sp" android:textSize="16sp"
tools:text="测试数据测试数据测试数据测试数据测试数据测试数据测试数据测试数据" /> tools:text="测试数据测试数据测试数据测试数据测试数据测试数据测试数据测试数据" />
</LinearLayout>
<RadioGroup <RadioGroup
android:id="@+id/rg_state" android:id="@+id/rg_state"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="vertical" android:orientation="horizontal">
android:padding="8dp">
</RadioGroup> </RadioGroup>
</LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/ll_check" android:id="@+id/ll_check"
@ -58,17 +57,10 @@
</LinearLayout> </LinearLayout>
<EditText <android.support.v7.widget.RecyclerView
android:id="@+id/et_content" android:id="@+id/rlv_photos"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="8dp" android:padding="5dp" />
android:layout_marginRight="8dp"
android:layout_marginBottom="3dp"
android:background="@drawable/sp_square_btn_gray_sel"
android:hint="请输入"
android:padding="3dp"
android:textSize="13sp"
android:visibility="gone" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>