隐患上报页面修改
This commit is contained in:
parent
e3154983cd
commit
3687d50a8b
@ -47,6 +47,7 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
tools:ignore="GoogleAppIndexingWarning">
|
||||
<activity android:name=".activitys.base.CatalogActivity"></activity>
|
||||
<activity
|
||||
android:name=".activitys.issue.NewCheckOptionsActivity"
|
||||
android:screenOrientation="portrait"
|
||||
|
@ -0,0 +1,902 @@
|
||||
package com.sucstepsoft.txrealtimelocation.activitys.base;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.provider.MediaStore;
|
||||
import android.support.v4.content.FileProvider;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.widget.AppCompatSpinner;
|
||||
import android.support.v7.widget.GridLayoutManager;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.baidu.location.BDAbstractLocationListener;
|
||||
import com.baidu.location.BDLocation;
|
||||
import com.baidu.location.LocationClient;
|
||||
import com.baidu.location.LocationClientOption;
|
||||
import com.google.gson.Gson;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.core.beans.AddPhotoBean;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.BaseUrlApi;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.AddPhotoAdapter;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter;
|
||||
import com.sucstepsoft.cm_utils.core.widget.views.ButtomDialogView;
|
||||
import com.sucstepsoft.cm_utils.utils.ConvertUtils;
|
||||
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;
|
||||
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
|
||||
import com.sucstepsoft.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.common.PhotoActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.issue.NewCheckOptionsActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.issue.demo.NewOptions;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.issue.demo.NewOptionsAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.LeftCatalogAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.BaseUserBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CatalogBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CheckOptionsbean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.OptionsSubmitBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.SuccessBean;
|
||||
import com.sucstepsoft.txrealtimelocation.net.LocationApiService;
|
||||
import com.sucstepsoft.txrealtimelocation.widget.EmStateCheck;
|
||||
|
||||
import java.io.File;
|
||||
import java.time.chrono.HijrahEra;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.security.auth.login.LoginException;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.RequestBody;
|
||||
import top.zibin.luban.Luban;
|
||||
import top.zibin.luban.OnCompressListener;
|
||||
|
||||
public class CatalogActivity extends BaseActivity {
|
||||
|
||||
@BindView(R.id.rlv_catalog)
|
||||
RecyclerView mRlvCatalog;
|
||||
@BindView(R.id.rlv_child)
|
||||
RecyclerView mRlvChild;
|
||||
@BindView(R.id.tv_empty_hint)
|
||||
TextView mTvEmptyHint;
|
||||
@BindView(R.id.ll_content)
|
||||
LinearLayout mLlContent;
|
||||
|
||||
private Unbinder mBind;
|
||||
|
||||
private List<CatalogBean> mDatas = new ArrayList<>();
|
||||
private List<NewOptions> mCurrentOptions = new ArrayList<>();
|
||||
private LeftCatalogAdapter mLeftAdapter;
|
||||
private NewOptionsAdapter mRightAdapter;
|
||||
|
||||
private String[] mNowStrings;
|
||||
private String[] mTermStrings;
|
||||
private AddPhotoBean mCurrentBean;
|
||||
private String mPicPath;
|
||||
private AddPhotoAdapter mAddPhotoAdapter;
|
||||
private List<AddPhotoBean> mPhotos;
|
||||
private NewOptions mCurrentOptionsBean;
|
||||
private String mPhotoIds = "";
|
||||
private ArrayAdapter mTermAdapter;
|
||||
private ArrayAdapter mNowAdapter;
|
||||
private int mType = 1;//整改方式
|
||||
private String mSelType = "";//整改期限
|
||||
private double mCurrentLatitude = 0.0d;
|
||||
private double mCurrentLongitude = 0.0d;
|
||||
private int mSelPhotosType = 2;
|
||||
private int mSelTypeDialog = 0;//用来判断是否对整改信息进行了选择,0未选择 1已选择
|
||||
private List<NewOptions> mOptions;
|
||||
private String mCompanyId;
|
||||
private ProgressDialog mMProgressDialog;
|
||||
private LocationClient mLocationClient;
|
||||
private boolean isExist = false;//是否存在选择的错误项,用来弹出整改选项 dialog
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_catalog;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
super.initData();
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("企业检查");
|
||||
String nId = getIntent().getStringExtra("nId");
|
||||
String id = getIntent().getStringExtra("id");
|
||||
String mCompanyId = getIntent().getStringExtra("cId");
|
||||
String name = getIntent().getStringExtra("name");
|
||||
String peo = getIntent().getStringExtra("peo");
|
||||
mTvPublish.setVisibility(View.VISIBLE);
|
||||
mTvPublish.setText("上报");
|
||||
mTvPublish.setOnClickListener(v -> {
|
||||
// showRectifyDialog();
|
||||
Gson gson = new Gson();
|
||||
List<CatalogBean> data = mLeftAdapter.getData();
|
||||
String s = gson.toJson(data);
|
||||
LogUtils.e(s);
|
||||
});
|
||||
initListView();
|
||||
startListenerLocation();
|
||||
if (TextUtils.isEmpty(nId)) {
|
||||
ToastUtils.showLong("该企业未关联检查项,请联系管理员进行关联");
|
||||
mRlvCatalog.setVisibility(View.GONE);
|
||||
} else {
|
||||
mRlvCatalog.setVisibility(View.VISIBLE);
|
||||
getCheckOptions(id, nId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化检查项页面
|
||||
*/
|
||||
private void initListView() {
|
||||
LinearLayoutManager manager = new LinearLayoutManager(mActivity, LinearLayoutManager.VERTICAL, false) {
|
||||
@Override
|
||||
public boolean canScrollVertically() {
|
||||
return super.canScrollVertically();
|
||||
}
|
||||
};
|
||||
LinearLayoutManager rightManager = new LinearLayoutManager(mActivity, LinearLayoutManager.VERTICAL, false) {
|
||||
@Override
|
||||
public boolean canScrollVertically() {
|
||||
return super.canScrollVertically();
|
||||
}
|
||||
};
|
||||
mLeftAdapter = new LeftCatalogAdapter(mActivity, mDatas);
|
||||
mRightAdapter = new NewOptionsAdapter(this, mCurrentOptions);
|
||||
|
||||
|
||||
mRlvChild.setLayoutManager(rightManager);
|
||||
mRlvChild.setAdapter(mRightAdapter);
|
||||
|
||||
mRightAdapter.setStateChangeListener(isCheck -> {
|
||||
if (isCheck) {
|
||||
//存在检查不合格项
|
||||
isExist = true;
|
||||
} else {
|
||||
//不存在
|
||||
isExist = false;
|
||||
}
|
||||
});
|
||||
mRightAdapter.addSelectPhotoListener((bean, options, i, type, stat) -> {
|
||||
mCurrentOptionsBean = 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 = mRightAdapter.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) {
|
||||
mRightAdapter.getData().get(i).getPhotos().add(new AddPhotoBean());
|
||||
}
|
||||
}
|
||||
photos.remove(bean);
|
||||
mRightAdapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
|
||||
mRlvCatalog.setLayoutManager(manager);
|
||||
mRlvCatalog.setAdapter(mLeftAdapter);
|
||||
|
||||
mLeftAdapter.addNotifyChildChangeListener(child -> {
|
||||
if (child != null && child.size() > 0) {
|
||||
mRlvChild.setVisibility(View.VISIBLE);
|
||||
mTvEmptyHint.setVisibility(View.GONE);
|
||||
mCurrentOptions = child;
|
||||
mRightAdapter.setData(mCurrentOptions);
|
||||
} else {
|
||||
mRlvChild.setVisibility(View.GONE);
|
||||
mTvEmptyHint.setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void showRectifyDialog() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(mActivity);
|
||||
View contentView = LayoutInflater.from(mActivity).inflate(R.layout.dialog_rectify, null);
|
||||
mNowStrings = mActivity.getResources().getStringArray(R.array.limit);
|
||||
mTermStrings = mActivity.getResources().getStringArray(R.array.timeLimit);
|
||||
mTermAdapter = new ArrayAdapter<>(mActivity, R.layout.item_pop_text, mTermStrings);
|
||||
mNowAdapter = new ArrayAdapter<>(mActivity, R.layout.item_pop_text, mNowStrings);
|
||||
RadioGroup mRgTerm = contentView.findViewById(R.id.rg_term);
|
||||
AppCompatSpinner mSpTerm = contentView.findViewById(R.id.sp_term);
|
||||
RecyclerView mRlvPhotos = contentView.findViewById(R.id.rlv_photos);
|
||||
mSpTerm.setAdapter(mNowAdapter);
|
||||
mSpTerm.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
|
||||
mSelType = mNowStrings[i];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> adapterView) {
|
||||
|
||||
}
|
||||
});
|
||||
mRgTerm.setOnCheckedChangeListener((radioGroup, i) -> {
|
||||
switch (i) {
|
||||
case R.id.rb_now:
|
||||
//立即整改
|
||||
mSpTerm.setVisibility(View.VISIBLE);
|
||||
mSpTerm.setAdapter(mNowAdapter);
|
||||
mSpTerm.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
|
||||
mSelType = mNowStrings[i];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> adapterView) {
|
||||
|
||||
}
|
||||
});
|
||||
mType = 1;
|
||||
break;
|
||||
case R.id.rb_coor:
|
||||
//不配合
|
||||
mSpTerm.setVisibility(View.GONE);
|
||||
mType = 3;
|
||||
break;
|
||||
case R.id.rb_term:
|
||||
//限期整改
|
||||
mType = 2;
|
||||
mSpTerm.setVisibility(View.VISIBLE);
|
||||
mSpTerm.setAdapter(mTermAdapter);
|
||||
mSpTerm.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
|
||||
mSelType = mTermStrings[i];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> adapterView) {
|
||||
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
});
|
||||
mPhotos = new ArrayList<>();
|
||||
mPhotos.add(new AddPhotoBean());
|
||||
mAddPhotoAdapter = new AddPhotoAdapter(this, mPhotos);
|
||||
mRlvPhotos.setLayoutManager(new GridLayoutManager(mActivity, 4));
|
||||
mRlvPhotos.setAdapter(mAddPhotoAdapter);
|
||||
//删除上传的相片
|
||||
mAddPhotoAdapter.addOnDeleteListener(((bean, i) -> {
|
||||
mAddPhotoAdapter.removeItem(bean);
|
||||
mPhotoIds = mPhotoIds.replace(bean.getId() + ",", "");
|
||||
}));
|
||||
mAddPhotoAdapter.addOnItemClickListener(bean -> {
|
||||
mSelPhotosType = 2;
|
||||
if (TextUtils.isEmpty(bean.getPath())) {
|
||||
//空数据
|
||||
showSelectPhoto(bean);
|
||||
} else {
|
||||
//预览
|
||||
ArrayList<String> list = new ArrayList<>();
|
||||
list.add(bean.getPath());
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra(PhotoActivity.TAG_IMGURL, list);
|
||||
intent.setClass(mActivity, PhotoActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
builder.setView(contentView);
|
||||
builder.setPositiveButton("取消", (dialog, which) -> {
|
||||
|
||||
}).setNegativeButton("确定", (dialog, which) -> {
|
||||
|
||||
}).setCancelable(false)
|
||||
.setTitle("整改选项")
|
||||
.setIcon(R.drawable.ic_hint_dialog);
|
||||
AlertDialog alertDialog = builder.create();
|
||||
alertDialog.setCanceledOnTouchOutside(false);
|
||||
alertDialog.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化整改项视图
|
||||
*/
|
||||
private void initOptionsView() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业不配合
|
||||
*/
|
||||
private void doUnclaim() {
|
||||
ProgressDialog dialog = new ProgressDialog(mActivity);
|
||||
dialog.setMessage("上报中...");
|
||||
dialog.setCancelable(false);
|
||||
dialog.setCanceledOnTouchOutside(false);
|
||||
dialog.show();
|
||||
OptionsSubmitBean submitBean = new OptionsSubmitBean();
|
||||
submitBean.setEnterpriseId(mCompanyId);
|
||||
submitBean.setIsCoordination(0);
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(submitBean);
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.doSaveOptions(body, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showShort("检查成功");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showShort("提交失败,请稍后重试.");
|
||||
dialog.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示选择图片
|
||||
*
|
||||
* @param bean
|
||||
*/
|
||||
private void showSelectPhoto(AddPhotoBean bean) {
|
||||
hideSoftKeyboard();
|
||||
ButtomDialogView buttomDialogView = new ButtomDialogView.DialogBuilder(mActivity)
|
||||
.setIsBackCancelable(true)
|
||||
.setIscancelable(true)
|
||||
.setShowLocation(Gravity.BOTTOM)
|
||||
.setIsShowFile(false)
|
||||
.build();
|
||||
buttomDialogView.addOnChoseListener(new ButtomDialogView.OnChoseListener() {
|
||||
@Override
|
||||
public void choseFile() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void choseAlbum() {
|
||||
mCurrentBean = bean;
|
||||
Intent intent = new Intent(Intent.ACTION_PICK, null);
|
||||
intent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
|
||||
"image/*");
|
||||
startActivityForResult(intent, BaseUrlApi.PHOTO_REQUEST);
|
||||
buttomDialogView.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void choseShoot() {
|
||||
mCurrentBean = bean;
|
||||
mPicPath = PathConfig.CATCH_PATH + System.currentTimeMillis() + ".jpg";
|
||||
File file = new File(mPicPath);
|
||||
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||
// 下面这句指定调用相机拍照后的照片存储的路径
|
||||
Uri uri;
|
||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.M) {
|
||||
uri = Uri.fromFile(file);
|
||||
} else {
|
||||
uri = FileProvider.getUriForFile(mActivity, ProiderUtil.getFileProviderName(mActivity), file);
|
||||
}
|
||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
|
||||
startActivityForResult(intent, BaseUrlApi.CAMERA_REQUEST);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loginOut() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changePwd() {
|
||||
|
||||
}
|
||||
});
|
||||
buttomDialogView.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取检查项
|
||||
*
|
||||
* @param id
|
||||
* @param nId
|
||||
*/
|
||||
private void getCheckOptions(String id, String nId) {
|
||||
refreshView(STATE_LOAD_LOADING);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getCheckOptionsList(id, nId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<CheckOptionsbean>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<CheckOptionsbean> checkOptionsbeans) {
|
||||
if (checkOptionsbeans != null && checkOptionsbeans.size() > 0) {
|
||||
buildCheckOptions(checkOptionsbeans);
|
||||
} else {
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void buildCheckOptions(List<CheckOptionsbean> checkOptionsbeans) {
|
||||
for (int i = 0; i < checkOptionsbeans.size(); i++) {
|
||||
CheckOptionsbean checkOptionsbean = checkOptionsbeans.get(i);
|
||||
if (checkOptionsbean.getCheckItemParentId().equals("0")) {
|
||||
//目录
|
||||
CatalogBean bean = new CatalogBean();
|
||||
bean.setTitle(checkOptionsbean.getNameJoinByCheckItemId());
|
||||
bean.setItemId(checkOptionsbean.getCheckItemId());
|
||||
bean.setpId(checkOptionsbean.getCheckItemParentId());
|
||||
bean.setTypeByCheckItemId(checkOptionsbean.getTypeJoinByCheckItemId());
|
||||
mDatas.add(bean);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < mDatas.size(); i++) {
|
||||
List<NewOptions> options = new ArrayList<>();
|
||||
CatalogBean bean = mDatas.get(i);
|
||||
for (int k = 0; k < checkOptionsbeans.size(); k++) {
|
||||
if (bean.getItemId().equals(checkOptionsbeans.get(k).getCheckItemParentId())) {
|
||||
List<AddPhotoBean> mPhotos = new ArrayList<>();
|
||||
mPhotos.add(new AddPhotoBean());
|
||||
NewOptions o = new NewOptions();
|
||||
List<NewOptions.ChildBean> beans = new ArrayList<>();
|
||||
o.setType(checkOptionsbeans.get(k).getType());
|
||||
o.setChild(beans);
|
||||
o.setId(checkOptionsbeans.get(k).getCheckItemId());
|
||||
o.setTitle(checkOptionsbeans.get(k).getNameJoinByCheckItemId());
|
||||
o.setPhotos(mPhotos);
|
||||
o.setIsMust(checkOptionsbeans.get(k).getType());
|
||||
//构建选项
|
||||
for (int j = 0; j < checkOptionsbeans.get(k).getCheckItemOptions().size(); j++) {
|
||||
NewOptions.ChildBean oBean = new NewOptions.ChildBean();
|
||||
CheckOptionsbean.CheckItemOptionsBean optionsBean = checkOptionsbeans.get(k).getCheckItemOptions().get(j);
|
||||
oBean.setId(j);
|
||||
oBean.setpId(optionsBean.getCheckItemId());
|
||||
oBean.setItemId(optionsBean.getCheckItemOptionId());
|
||||
oBean.setTitle(optionsBean.getName());
|
||||
oBean.setType(optionsBean.getType());
|
||||
if (checkOptionsbeans.get(k).getCheckItemOptions().get(j).getIsWrong() == 0) {
|
||||
oBean.setWrong(false);
|
||||
} else {
|
||||
oBean.setWrong(true);
|
||||
}
|
||||
oBean.setCheck(false);
|
||||
beans.add(oBean);
|
||||
}
|
||||
options.add(o);
|
||||
} else if (bean.getpId().equals("0") && bean.getTypeByCheckItemId().equals("2") && bean.getItemId().equals(checkOptionsbeans.get(k).getCheckItemId())) {
|
||||
//一级目录
|
||||
List<AddPhotoBean> mPhotos = new ArrayList<>();
|
||||
mPhotos.add(new AddPhotoBean());
|
||||
NewOptions o = new NewOptions();
|
||||
List<NewOptions.ChildBean> beans = new ArrayList<>();
|
||||
o.setType(checkOptionsbeans.get(k).getType());
|
||||
o.setChild(beans);
|
||||
o.setId(checkOptionsbeans.get(k).getCheckItemId());
|
||||
o.setTitle(checkOptionsbeans.get(k).getNameJoinByCheckItemId());
|
||||
o.setPhotos(mPhotos);
|
||||
o.setIsMust(checkOptionsbeans.get(k).getType());
|
||||
//构建选项
|
||||
for (int j = 0; j < checkOptionsbeans.get(k).getCheckItemOptions().size(); j++) {
|
||||
NewOptions.ChildBean oBean = new NewOptions.ChildBean();
|
||||
CheckOptionsbean.CheckItemOptionsBean optionsBean = checkOptionsbeans.get(k).getCheckItemOptions().get(j);
|
||||
oBean.setId(j);
|
||||
oBean.setpId(optionsBean.getCheckItemId());
|
||||
oBean.setItemId(optionsBean.getCheckItemOptionId());
|
||||
oBean.setTitle(optionsBean.getName());
|
||||
oBean.setType(optionsBean.getType());
|
||||
if (checkOptionsbeans.get(k).getCheckItemOptions().get(j).getIsWrong() == 0) {
|
||||
oBean.setWrong(false);
|
||||
} else {
|
||||
oBean.setWrong(true);
|
||||
}
|
||||
oBean.setCheck(false);
|
||||
beans.add(oBean);
|
||||
}
|
||||
options.add(o);
|
||||
}
|
||||
bean.setOptions(options);
|
||||
}
|
||||
}
|
||||
mLeftAdapter.setData(mDatas);
|
||||
mCurrentOptions = mDatas.get(0).getOptions();
|
||||
if (mCurrentOptions != null && mCurrentOptions.size() > 0) {
|
||||
mRlvChild.setVisibility(View.VISIBLE);
|
||||
mTvEmptyHint.setVisibility(View.GONE);
|
||||
mRightAdapter.setData(mCurrentOptions);
|
||||
} else {
|
||||
mRlvChild.setVisibility(View.GONE);
|
||||
mTvEmptyHint.setVisibility(View.VISIBLE);
|
||||
}
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (resultCode == RESULT_OK) {
|
||||
switch (requestCode) {
|
||||
case BaseUrlApi.CAMERA_REQUEST://相机
|
||||
uploadImg(mPicPath, 1);
|
||||
break;
|
||||
case BaseUrlApi.PHOTO_REQUEST://相册
|
||||
try {
|
||||
if (data == null) return;
|
||||
Uri uri = data.getData();
|
||||
String[] proj = {MediaStore.Images.Media.DATA};
|
||||
Cursor cursor = managedQuery(uri, proj, null, null, null);
|
||||
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
|
||||
cursor.moveToFirst();
|
||||
String srcPath = cursor.getString(column_index);
|
||||
uploadImg(srcPath, 2);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建提交数据
|
||||
* TODO 提交需要parentId
|
||||
*
|
||||
* @param data
|
||||
*/
|
||||
private void buildConfirmData(List<NewOptions> data) {
|
||||
mMProgressDialog = new ProgressDialog(mActivity);
|
||||
mMProgressDialog.setMessage("上报中...");
|
||||
mMProgressDialog.setCancelable(false);
|
||||
mMProgressDialog.setCanceledOnTouchOutside(false);
|
||||
mMProgressDialog.show();
|
||||
|
||||
if (checkConfirmParams(data)) {
|
||||
OptionsSubmitBean submitBean = new OptionsSubmitBean();
|
||||
submitBean.setEnterpriseId(mCompanyId);
|
||||
submitBean.setCheckType(1);
|
||||
submitBean.setIsCoordination(1);
|
||||
List<OptionsSubmitBean.HiddenDangerReportsBean> items = new ArrayList<>();
|
||||
for (int i = 0; i < data.size(); 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();
|
||||
for (int j = 0; j < child.size(); j++) {
|
||||
if (child.get(j).getType() == 1) {
|
||||
//选择
|
||||
if (child.get(j).isCheck()) {
|
||||
OptionsSubmitBean.HiddenDangerReportsBean bean = new OptionsSubmitBean.HiddenDangerReportsBean();
|
||||
bean.setCheckItemId(o.getId());
|
||||
bean.setCheckItemOptionId(child.get(j).getItemId());
|
||||
bean.setCheckResult(child.get(j).getItemId());
|
||||
bean.setType(child.get(j).getType());
|
||||
if (phIds.length() > 10) {
|
||||
bean.setScenePhotos(phIds);
|
||||
}
|
||||
items.add(bean);
|
||||
}
|
||||
} else {
|
||||
//输入
|
||||
OptionsSubmitBean.HiddenDangerReportsBean bean = new OptionsSubmitBean.HiddenDangerReportsBean();
|
||||
bean.setCheckItemId(o.getId());
|
||||
bean.setCheckItemOptionId(child.get(j).getItemId());
|
||||
bean.setType(child.get(j).getType());
|
||||
if (TextUtils.isEmpty(child.get(j).getInputText())) {
|
||||
bean.setCheckResult("");
|
||||
} else {
|
||||
bean.setCheckResult(child.get(j).getInputText());
|
||||
}
|
||||
if (phIds.length() > 10) {
|
||||
bean.setScenePhotos(phIds);
|
||||
}
|
||||
items.add(bean);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (mType == 1) {
|
||||
submitBean.setRectificationType(1);
|
||||
//立即整改
|
||||
if (mSelType.equals("当场整改")) {
|
||||
submitBean.setImmediatelyChangeType(1);
|
||||
} else {
|
||||
submitBean.setImmediatelyChangeType(2);
|
||||
}
|
||||
} else {
|
||||
submitBean.setRectificationType(2);
|
||||
String strDay = mSelType.substring(0, mSelType.lastIndexOf("天"));
|
||||
submitBean.setRectificationDays(Integer.parseInt(strDay));
|
||||
}
|
||||
if (!TextUtils.isEmpty(mPhotoIds)) {
|
||||
submitBean.setScenePhotos(mPhotoIds);
|
||||
}
|
||||
submitBean.setHiddenDangerReports(items);
|
||||
submitBean.setCheckLat(mCurrentLatitude + "");
|
||||
submitBean.setCheckLng(mCurrentLongitude + "");
|
||||
doSubmit(submitBean);
|
||||
} else {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showShort("检查项中存在未检查的项目");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交检查结果
|
||||
*
|
||||
* @param submitBean
|
||||
*/
|
||||
private void doSubmit(OptionsSubmitBean submitBean) {
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(submitBean);
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.doSaveOptions(body, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showShort("检查成功");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showShort("提交失败,请稍后重试.");
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验参数是否合法
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean checkConfirmParams(List<NewOptions> data) {
|
||||
boolean isComplete = true;
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
if (data.get(i).getState() == EmStateCheck.NORMAL) {
|
||||
isComplete = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return isComplete;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*
|
||||
* @param picPath
|
||||
*/
|
||||
private void uploadImg(String picPath, int src) {
|
||||
File file = new File(picPath);
|
||||
if (!file.exists()) {
|
||||
showToast("图片路径错误.");
|
||||
return;
|
||||
}
|
||||
ProgressDialog progressDialog = UIUtil.initDialog(mActivity, "正在上传...");
|
||||
progressDialog.show();
|
||||
Luban.with(mActivity)
|
||||
.load(picPath)
|
||||
.ignoreBy(100)
|
||||
.setTargetDir(PathConfig.CATCH_PATH)
|
||||
.filter(path -> !(TextUtils.isEmpty(path) || path.toLowerCase().endsWith(".gif")))
|
||||
.setCompressListener(new OnCompressListener() {
|
||||
@Override
|
||||
public void onStart() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(File file) {
|
||||
RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||
MultipartBody.Part body = MultipartBody.Part.createFormData("image", file.getName(), requestFile);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.uploadImage(body, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseUserBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseUserBean baseUserBean) {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showShort("上传成功");
|
||||
if (mSelPhotosType == 1) {
|
||||
mCurrentBean.setId(baseUserBean.getData());
|
||||
mCurrentBean.setPath(picPath);
|
||||
if (mCurrentOptionsBean.getPhotos().size() < 4) {
|
||||
mCurrentOptionsBean.getPhotos().add(new AddPhotoBean());
|
||||
}
|
||||
mRightAdapter.notifyDataSetChanged();
|
||||
mCurrentBean = null;
|
||||
} else {
|
||||
mCurrentBean.setId(baseUserBean.getData());
|
||||
mPhotoIds += baseUserBean.getData() + ",";
|
||||
mCurrentBean.setPath(picPath);
|
||||
if (mPhotos.size() < 9) {
|
||||
mPhotos.add(new AddPhotoBean());
|
||||
}
|
||||
mAddPhotoAdapter.notifyDataSetChanged();
|
||||
mCurrentBean = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showShort("上传失败,请稍后重试.");
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showShort("图片上传失败,请稍后重试");
|
||||
}
|
||||
})
|
||||
.launch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化定位参数配置
|
||||
*/
|
||||
|
||||
private void startListenerLocation() {
|
||||
mLocationClient = new LocationClient(getApplicationContext());
|
||||
LocationClientOption locationOption = new LocationClientOption();
|
||||
MyLocationListener myLocationListener = new MyLocationListener();
|
||||
mLocationClient.registerLocationListener(myLocationListener);
|
||||
locationOption.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
|
||||
locationOption.setCoorType("bd09ll");
|
||||
locationOption.setScanSpan(1000);
|
||||
locationOption.setIsNeedAddress(true);
|
||||
locationOption.setIsNeedLocationDescribe(true);
|
||||
locationOption.setNeedDeviceDirect(false);
|
||||
locationOption.setLocationNotify(true);
|
||||
locationOption.setIgnoreKillProcess(true);
|
||||
locationOption.setIsNeedLocationDescribe(true);
|
||||
locationOption.setIsNeedLocationPoiList(true);
|
||||
locationOption.SetIgnoreCacheException(false);
|
||||
locationOption.setOpenGps(true);
|
||||
locationOption.setIsNeedAltitude(false);
|
||||
locationOption.setOpenAutoNotifyMode();
|
||||
locationOption.setLocationPurpose(LocationClientOption.BDLocationPurpose.SignIn);
|
||||
locationOption.setOpenAutoNotifyMode(3000, 1, LocationClientOption.LOC_SENSITIVITY_HIGHT);
|
||||
mLocationClient.setLocOption(locationOption);
|
||||
mLocationClient.start();
|
||||
}
|
||||
|
||||
/**
|
||||
* 实现定位回调
|
||||
*/
|
||||
public class MyLocationListener extends BDAbstractLocationListener {
|
||||
@Override
|
||||
public void onReceiveLocation(BDLocation location) {
|
||||
double latitude = location.getLatitude();
|
||||
double longitude = location.getLongitude();
|
||||
float radius = location.getRadius();
|
||||
if (latitude != Double.MIN_VALUE && longitude != Double.MIN_VALUE && radius <= 300) {
|
||||
mCurrentLatitude = latitude;
|
||||
mCurrentLongitude = longitude;
|
||||
mLocationClient.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -5,7 +5,6 @@ import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.MediaStore;
|
||||
import android.support.v4.content.FileProvider;
|
||||
import android.support.v7.widget.AppCompatSpinner;
|
||||
@ -14,7 +13,6 @@ import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Gravity;
|
||||
import android.view.TextureView;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
@ -35,20 +33,15 @@ import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.AddPhotoAdapter;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.core.widget.views.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;
|
||||
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
|
||||
import com.sucstepsoft.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.common.PhotoActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.issue.NewCheckOptionsActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.issue.demo.NewOptions;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.issue.demo.NewOptionsAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.issue.demo.Options;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.CounterCheckOptionsAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.BaseUserBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CheckOptionsbean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CounterCheckOptionsBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.OptionsSubmitBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.SuccessBean;
|
||||
|
@ -102,12 +102,13 @@ public class NewCheckOptionsActivity extends BaseActivity {
|
||||
private LocationClient mLocationClient;
|
||||
private String[] mNowStrings;
|
||||
private String[] mTermStrings;
|
||||
private ArrayAdapter mTermAdapter;
|
||||
private ArrayAdapter mNowAdapter;
|
||||
|
||||
private AddPhotoAdapter mAddPhotoAdapter;
|
||||
private List<AddPhotoBean> mPhotos;
|
||||
private NewOptions mCurrentOptions;
|
||||
private String mPhotoIds = "";
|
||||
private ArrayAdapter mTermAdapter;
|
||||
private ArrayAdapter mNowAdapter;
|
||||
private int mType = 1;//整改方式
|
||||
private String mSelType = "";//整改期限
|
||||
private double mCurrentLatitude = 0.0d;
|
||||
|
@ -120,6 +120,15 @@ public class NewOptions {
|
||||
private int type;
|
||||
private String inputNumber;
|
||||
private String inputText;
|
||||
private String pId;
|
||||
|
||||
public String getpId() {
|
||||
return pId;
|
||||
}
|
||||
|
||||
public void setpId(String pId) {
|
||||
this.pId = pId;
|
||||
}
|
||||
|
||||
public String getInputNumber() {
|
||||
return inputNumber;
|
||||
|
@ -19,6 +19,7 @@ import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
|
||||
import com.sucstepsoft.cm_utils.core.beans.AddPhotoBean;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.AddLittlePhotoAdapter;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.AddPhotoAdapter;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter;
|
||||
import com.sucstepsoft.cm_utils.utils.ConvertUtils;
|
||||
@ -190,11 +191,13 @@ public class NewOptionsAdapter extends BaseRecyclerAdapter<NewOptions, NewOption
|
||||
}
|
||||
|
||||
private void setPhotoView(NewOptionsHolder oHolder, int index) {
|
||||
AddPhotoAdapter photoAdapter = new AddPhotoAdapter(mContext, mData.get(index).getPhotos());
|
||||
AddLittlePhotoAdapter photoAdapter = new AddLittlePhotoAdapter(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);
|
||||
if (mSelectPhotoListener != null) {
|
||||
mSelectPhotoListener.onSelectPhoto(bean, mData.get(index), index, 3, 1);
|
||||
}
|
||||
});
|
||||
photoAdapter.addOnItemClickListener(bean -> {
|
||||
if (mSelectPhotoListener != null) {
|
||||
@ -219,7 +222,9 @@ public class NewOptionsAdapter extends BaseRecyclerAdapter<NewOptions, NewOption
|
||||
}
|
||||
}
|
||||
}
|
||||
mChangeListener.onStateChange(isUnCheck);
|
||||
if (mChangeListener != null) {
|
||||
mChangeListener.onStateChange(isUnCheck);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -28,6 +28,7 @@ import com.sucstepsoft.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.issue.CheckOptionsActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.CompanyCheckAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.CounterCheckListAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.BaseUserBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CompanyListDataBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CounterCheckListBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.DictBean;
|
||||
@ -48,8 +49,6 @@ public class MineMissionActivity extends BaseActivity {
|
||||
|
||||
@BindView(R.id.et_company_name)
|
||||
EditText mEtCompanyName;
|
||||
@BindView(R.id.tv_com_type)
|
||||
TextView mTvComType;
|
||||
@BindView(R.id.btn_search)
|
||||
Button mBtnSearch;
|
||||
@BindView(R.id.pb_loading)
|
||||
@ -151,10 +150,10 @@ public class MineMissionActivity extends BaseActivity {
|
||||
mSearchCompanyName = "";
|
||||
mCompanyType = "";
|
||||
mEtCompanyName.setText("");
|
||||
mTvComType.setText("");
|
||||
// mTvComType.setText("");
|
||||
getCompanyLibList(mCurrentPage, true);
|
||||
});
|
||||
mTvComType.setOnClickListener(v -> onShowTypePicker());
|
||||
// mTvComType.setOnClickListener(v -> onShowTypePicker());
|
||||
}
|
||||
|
||||
private void showDetail(CounterCheckListBean.RowsBean rowsBean) {
|
||||
@ -198,7 +197,7 @@ public class MineMissionActivity extends BaseActivity {
|
||||
mTypePicker = new OptionsPickerBuilder(mActivity, (options1, options2, options3, v) -> {
|
||||
DictBean bean = mTypeList.get(options1);
|
||||
mCompanyType = bean.getDictionaryId();
|
||||
mTvComType.setText(bean.getDictionaryName());
|
||||
// mTvComType.setText(bean.getDictionaryName());
|
||||
}).setTitleText("请选择企业类型")
|
||||
.setCancelColor(Color.parseColor("#1189FF"))
|
||||
.setSubmitColor(Color.parseColor("#1189FF"))
|
||||
@ -500,57 +499,23 @@ public class MineMissionActivity extends BaseActivity {
|
||||
hideSoftKeyboard();
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getMineCheckList(currentPage + "", UserLgUtils.getToken())
|
||||
.getCheckListOfMine(currentPage + "", UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<CounterCheckListBean>() {
|
||||
.subscribe(new Observer<BaseUserBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mDis1 = d;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CounterCheckListBean companyListDataBean) {
|
||||
if (isShow) {
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
if (companyListDataBean != null && companyListDataBean.getRows() != null && companyListDataBean.getRows().size() > 0) {
|
||||
++mCurrentPage;
|
||||
if (currentPage == 1) {
|
||||
mDatas.clear();
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
} else {
|
||||
mDatas.addAll(companyListDataBean.getRows());
|
||||
}
|
||||
reStateView(STATE_LOAD_SUCCESS);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mXlvComLib.refreshComplete();
|
||||
if (mDatas.size() >= companyListDataBean.getTotal()) {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(true);
|
||||
} else {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(false);
|
||||
}
|
||||
} else {
|
||||
if (currentPage > 1) {
|
||||
mXlvComLib.loadMoreComplete();
|
||||
mXlvComLib.setNoMore(true);
|
||||
reStateView(STATE_LOAD_SUCCESS);
|
||||
} else {
|
||||
//无数据
|
||||
reStateView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
public void onNext(BaseUserBean baseUserBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (isShow) {
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
reStateView(STATE_LOAD_ERROR);
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -558,6 +523,66 @@ public class MineMissionActivity extends BaseActivity {
|
||||
|
||||
}
|
||||
});
|
||||
// RetrofitManager.getInstance()
|
||||
// .create(LocationApiService.class)
|
||||
// .getMineCheckList(currentPage + "", UserLgUtils.getToken())
|
||||
// .subscribeOn(Schedulers.io())
|
||||
// .observeOn(AndroidSchedulers.mainThread())
|
||||
// .subscribe(new Observer<CounterCheckListBean>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
// mDis1 = d;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(CounterCheckListBean companyListDataBean) {
|
||||
// if (isShow) {
|
||||
// mMProgressDialog.dismiss();
|
||||
// }
|
||||
// if (companyListDataBean != null && companyListDataBean.getRows() != null && companyListDataBean.getRows().size() > 0) {
|
||||
// ++mCurrentPage;
|
||||
// if (currentPage == 1) {
|
||||
// mDatas.clear();
|
||||
// mDatas.addAll(companyListDataBean.getRows());
|
||||
// } else {
|
||||
// mDatas.addAll(companyListDataBean.getRows());
|
||||
// }
|
||||
// reStateView(STATE_LOAD_SUCCESS);
|
||||
// mAdapter.notifyDataSetChanged();
|
||||
// mXlvComLib.refreshComplete();
|
||||
// if (mDatas.size() >= companyListDataBean.getTotal()) {
|
||||
// mXlvComLib.loadMoreComplete();
|
||||
// mXlvComLib.setNoMore(true);
|
||||
// } else {
|
||||
// mXlvComLib.loadMoreComplete();
|
||||
// mXlvComLib.setNoMore(false);
|
||||
// }
|
||||
// } else {
|
||||
// if (currentPage > 1) {
|
||||
// mXlvComLib.loadMoreComplete();
|
||||
// mXlvComLib.setNoMore(true);
|
||||
// reStateView(STATE_LOAD_SUCCESS);
|
||||
// } else {
|
||||
// //无数据
|
||||
// reStateView(STATE_LOAD_EMPTY);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Throwable e) {
|
||||
// if (isShow) {
|
||||
// mMProgressDialog.dismiss();
|
||||
// }
|
||||
// reStateView(STATE_LOAD_ERROR);
|
||||
// ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
private void reStateView(int state) {
|
||||
|
@ -25,6 +25,7 @@ import com.sucstepsoft.cm_utils.utils.ToastUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.UIUtil;
|
||||
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
|
||||
import com.sucstepsoft.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.base.CatalogActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.issue.CheckOptionsActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.issue.NewCheckOptionsActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.CompanyCheckAdapter;
|
||||
@ -120,7 +121,7 @@ public class SelCompanyActivity extends BaseActivity {
|
||||
mAdapter = new CompanyCheckAdapter(mActivity, mDatas);
|
||||
mXlvComLib.setAdapter(mAdapter);
|
||||
mAdapter.addOnItemClickListener(bean -> {
|
||||
Intent intent = new Intent(mActivity, NewCheckOptionsActivity.class);
|
||||
Intent intent = new Intent(mActivity, CatalogActivity.class);
|
||||
intent.putExtra("nId", bean.getNatureJoinByEnterpriseId());
|
||||
intent.putExtra("id", bean.getIndustryJoinByEnterpriseId());
|
||||
intent.putExtra("cId", bean.getEnterpriseId());
|
||||
|
@ -7,11 +7,8 @@ import android.text.InputType;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.TextureView;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RadioButton;
|
||||
@ -19,14 +16,8 @@ import android.widget.RadioButton;
|
||||
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.activitys.issue.demo.NewOptions;
|
||||
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.OptionsAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.issue.demo.OptionsHolder;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.holders.CounterCheckOptionHolder;
|
||||
import com.sucstepsoft.txrealtimelocation.widget.EmStateCheck;
|
||||
|
||||
|
@ -0,0 +1,76 @@
|
||||
package com.sucstepsoft.txrealtimelocation.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.GlideRoundTransform;
|
||||
import com.sucstepsoft.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.issue.demo.NewOptions;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.holders.LeftCatalogHolder;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CatalogBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/4/19 - 12:02 PM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class LeftCatalogAdapter extends BaseRecyclerAdapter<CatalogBean, LeftCatalogHolder> {
|
||||
private int mSelectIndex;
|
||||
private final RequestOptions mIconOptions;
|
||||
|
||||
public LeftCatalogAdapter(Context ctx, List<CatalogBean> list) {
|
||||
super(ctx, list);
|
||||
mIconOptions = new RequestOptions()
|
||||
.transform(new GlideRoundTransform(mContext, 5)).error(R.drawable.temp_sel_options).placeholder(R.drawable.temp_sel_options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LeftCatalogHolder createHolder(ViewGroup parent, int viewType) {
|
||||
View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_catalog_left, parent, false);
|
||||
return new LeftCatalogHolder(itemView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindHolder(LeftCatalogHolder leftCatalogHolder, int i) {
|
||||
leftCatalogHolder.mTvTitle.setText(mData.get(i).getTitle());
|
||||
leftCatalogHolder.itemView.setOnClickListener(v -> {
|
||||
mSelectIndex = i;
|
||||
notifyDataSetChanged();
|
||||
if (mChildChangeListener != null) {
|
||||
mChildChangeListener.onChangeChild(mData.get(i).getOptions());
|
||||
}
|
||||
});
|
||||
|
||||
if (mSelectIndex == i) {
|
||||
leftCatalogHolder.mTvTitle.setSelected(true);
|
||||
Glide.with(mContext)
|
||||
.load(R.drawable.temp_unsel_options)
|
||||
.apply(mIconOptions)
|
||||
.into(leftCatalogHolder.mIvIcon);
|
||||
} else {
|
||||
leftCatalogHolder.mTvTitle.setSelected(false);
|
||||
Glide.with(mContext)
|
||||
.load(R.drawable.temp_sel_options)
|
||||
.apply(mIconOptions)
|
||||
.into(leftCatalogHolder.mIvIcon);
|
||||
}
|
||||
}
|
||||
|
||||
private NotifyChildChangeListener mChildChangeListener;
|
||||
|
||||
public void addNotifyChildChangeListener(NotifyChildChangeListener listener) {
|
||||
this.mChildChangeListener = listener;
|
||||
}
|
||||
|
||||
public interface NotifyChildChangeListener {
|
||||
void onChangeChild(List<NewOptions> child);
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.sucstepsoft.txrealtimelocation.adapters.holders;
|
||||
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.sucstepsoft.txrealtimelocation.R;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/4/19 - 12:00 PM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class LeftCatalogHolder extends RecyclerView.ViewHolder {
|
||||
public TextView mTvTitle;
|
||||
public ImageView mIvIcon;
|
||||
|
||||
public LeftCatalogHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
mTvTitle = itemView.findViewById(R.id.tv_title);
|
||||
mIvIcon = itemView.findViewById(R.id.iv_icon);
|
||||
}
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package com.sucstepsoft.txrealtimelocation.beans;
|
||||
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.issue.demo.NewOptions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2020/4/19 - 1:55 PM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class CatalogBean {
|
||||
private String title;
|
||||
private String pId;
|
||||
private String itemId;
|
||||
private String icon;
|
||||
private String selIcon;
|
||||
private String typeByCheckItemId;
|
||||
|
||||
public String getTypeByCheckItemId() {
|
||||
return typeByCheckItemId;
|
||||
}
|
||||
|
||||
public void setTypeByCheckItemId(String typeByCheckItemId) {
|
||||
this.typeByCheckItemId = typeByCheckItemId;
|
||||
}
|
||||
|
||||
private List<NewOptions> mOptions = new ArrayList<>();
|
||||
|
||||
public List<NewOptions> getOptions() {
|
||||
return mOptions;
|
||||
}
|
||||
|
||||
public void setOptions(List<NewOptions> options) {
|
||||
mOptions = options;
|
||||
}
|
||||
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(String icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public String getSelIcon() {
|
||||
return selIcon;
|
||||
}
|
||||
|
||||
public void setSelIcon(String selIcon) {
|
||||
this.selIcon = selIcon;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getpId() {
|
||||
return pId;
|
||||
}
|
||||
|
||||
public void setpId(String pId) {
|
||||
this.pId = pId;
|
||||
}
|
||||
|
||||
public String getItemId() {
|
||||
return itemId;
|
||||
}
|
||||
|
||||
public void setItemId(String itemId) {
|
||||
this.itemId = itemId;
|
||||
}
|
||||
}
|
@ -12,24 +12,40 @@ public class CheckOptionsbean {
|
||||
|
||||
|
||||
/**
|
||||
* industryCheckItemId : a6027f46-8ff0-466a-996b-9198dbfc52c5
|
||||
* industryCheckItemId : 47320f89-c211-412b-b6f0-7577b3053dca
|
||||
* natureId : 165aa316-2972-4ed9-9a4b-7f8b9d489986
|
||||
* natureIdDictionaryName : 商店超市
|
||||
* checkItemParentId : 1dd8f43e-5b03-436a-b12e-b32f3aa7a223
|
||||
* checkItemId : d37491ee-146e-430e-b155-2256fc0c4957
|
||||
* nameJoinByCheckItemId : 营业执照
|
||||
* summaryJoinByCheckItemId : 营业执照
|
||||
* typeJoinByCheckItemId :
|
||||
* typeJoinByCheckItemId : 2
|
||||
* iconJoinByCheckItemId :
|
||||
* iconPressJoinByCheckItemId :
|
||||
* parentNameJoinByCheckItemId : 营业执照
|
||||
* parentSummaryJoinByCheckItemId : 营业执照
|
||||
* parentTypeJoinByCheckItemId : 1
|
||||
* parentIconJoinByCheckItemId : 5796f999-be0c-46e1-87e3-94f57aa6991d
|
||||
* parentIconPressJoinByCheckItemId : d1d8b21f-815e-4da8-9a59-0153411dbdeb
|
||||
* type : 1
|
||||
* checkItemOptions : [{"checkItemOptionId":"6ba68e00-4c67-4974-9d8b-5f7e3f2e7027","checkItemId":"","type":1,"name":"有","unit":"","isWrong":0},{"checkItemOptionId":"675a2ead-c22c-4415-94bb-4c8543a4337a","checkItemId":"","type":1,"name":"无","unit":"","isWrong":1}]
|
||||
* checkItemOptions : [{"checkItemOptionId":"6ba68e00-4c67-4974-9d8b-5f7e3f2e7027","checkItemId":"d37491ee-146e-430e-b155-2256fc0c4957","type":1,"name":"有","unit":"","isWrong":0},{"checkItemOptionId":"675a2ead-c22c-4415-94bb-4c8543a4337a","checkItemId":"d37491ee-146e-430e-b155-2256fc0c4957","type":1,"name":"无","unit":"","isWrong":1}]
|
||||
*/
|
||||
|
||||
private String industryCheckItemId;
|
||||
private String natureId;
|
||||
private String natureIdDictionaryName;
|
||||
private String checkItemParentId;
|
||||
private String checkItemId;
|
||||
private String nameJoinByCheckItemId;
|
||||
private String summaryJoinByCheckItemId;
|
||||
private String typeJoinByCheckItemId;
|
||||
private String iconJoinByCheckItemId;
|
||||
private String iconPressJoinByCheckItemId;
|
||||
private String parentNameJoinByCheckItemId;
|
||||
private String parentSummaryJoinByCheckItemId;
|
||||
private String parentTypeJoinByCheckItemId;
|
||||
private String parentIconJoinByCheckItemId;
|
||||
private String parentIconPressJoinByCheckItemId;
|
||||
private int type;
|
||||
private List<CheckItemOptionsBean> checkItemOptions;
|
||||
|
||||
@ -57,6 +73,14 @@ public class CheckOptionsbean {
|
||||
this.natureIdDictionaryName = natureIdDictionaryName;
|
||||
}
|
||||
|
||||
public String getCheckItemParentId() {
|
||||
return checkItemParentId;
|
||||
}
|
||||
|
||||
public void setCheckItemParentId(String checkItemParentId) {
|
||||
this.checkItemParentId = checkItemParentId;
|
||||
}
|
||||
|
||||
public String getCheckItemId() {
|
||||
return checkItemId;
|
||||
}
|
||||
@ -89,6 +113,62 @@ public class CheckOptionsbean {
|
||||
this.typeJoinByCheckItemId = typeJoinByCheckItemId;
|
||||
}
|
||||
|
||||
public String getIconJoinByCheckItemId() {
|
||||
return iconJoinByCheckItemId;
|
||||
}
|
||||
|
||||
public void setIconJoinByCheckItemId(String iconJoinByCheckItemId) {
|
||||
this.iconJoinByCheckItemId = iconJoinByCheckItemId;
|
||||
}
|
||||
|
||||
public String getIconPressJoinByCheckItemId() {
|
||||
return iconPressJoinByCheckItemId;
|
||||
}
|
||||
|
||||
public void setIconPressJoinByCheckItemId(String iconPressJoinByCheckItemId) {
|
||||
this.iconPressJoinByCheckItemId = iconPressJoinByCheckItemId;
|
||||
}
|
||||
|
||||
public String getParentNameJoinByCheckItemId() {
|
||||
return parentNameJoinByCheckItemId;
|
||||
}
|
||||
|
||||
public void setParentNameJoinByCheckItemId(String parentNameJoinByCheckItemId) {
|
||||
this.parentNameJoinByCheckItemId = parentNameJoinByCheckItemId;
|
||||
}
|
||||
|
||||
public String getParentSummaryJoinByCheckItemId() {
|
||||
return parentSummaryJoinByCheckItemId;
|
||||
}
|
||||
|
||||
public void setParentSummaryJoinByCheckItemId(String parentSummaryJoinByCheckItemId) {
|
||||
this.parentSummaryJoinByCheckItemId = parentSummaryJoinByCheckItemId;
|
||||
}
|
||||
|
||||
public String getParentTypeJoinByCheckItemId() {
|
||||
return parentTypeJoinByCheckItemId;
|
||||
}
|
||||
|
||||
public void setParentTypeJoinByCheckItemId(String parentTypeJoinByCheckItemId) {
|
||||
this.parentTypeJoinByCheckItemId = parentTypeJoinByCheckItemId;
|
||||
}
|
||||
|
||||
public String getParentIconJoinByCheckItemId() {
|
||||
return parentIconJoinByCheckItemId;
|
||||
}
|
||||
|
||||
public void setParentIconJoinByCheckItemId(String parentIconJoinByCheckItemId) {
|
||||
this.parentIconJoinByCheckItemId = parentIconJoinByCheckItemId;
|
||||
}
|
||||
|
||||
public String getParentIconPressJoinByCheckItemId() {
|
||||
return parentIconPressJoinByCheckItemId;
|
||||
}
|
||||
|
||||
public void setParentIconPressJoinByCheckItemId(String parentIconPressJoinByCheckItemId) {
|
||||
this.parentIconPressJoinByCheckItemId = parentIconPressJoinByCheckItemId;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
@ -108,7 +188,7 @@ public class CheckOptionsbean {
|
||||
public static class CheckItemOptionsBean {
|
||||
/**
|
||||
* checkItemOptionId : 6ba68e00-4c67-4974-9d8b-5f7e3f2e7027
|
||||
* checkItemId :
|
||||
* checkItemId : d37491ee-146e-430e-b155-2256fc0c4957
|
||||
* type : 1
|
||||
* name : 有
|
||||
* unit :
|
||||
|
@ -755,4 +755,10 @@ public interface LocationApiService {
|
||||
@Headers({"base_url_name:dict", "Content-Type: application/json", "Accept: application/json"})
|
||||
@GET("enterpriseofgridoperator/countenterpriseofgridoperatorofmine")
|
||||
Observable<BaseUserBean> getMineEnterpriseCount(@Header("token") String token);
|
||||
|
||||
//我的任务
|
||||
//GET /app/taskcheck/listpagetaskcheckofmine
|
||||
@Headers({"base_url_name:dict", "Content-Type: application/json", "Accept: application/json"})
|
||||
@GET("taskcheck/listpagetaskcheckofmine")
|
||||
Observable<BaseUserBean> getCheckListOfMine(@Query("page") String page, @Header("token") String token);
|
||||
}
|
||||
|
5
app/src/main/res/color/col_catalog.xml
Normal file
5
app/src/main/res/color/col_catalog.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="@color/white" android:state_selected="true" />
|
||||
<item android:color="@color/black" android:state_selected="false" />
|
||||
</selector>
|
BIN
app/src/main/res/drawable-xhdpi/ic_hint_dialog.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_hint_dialog.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 981 B |
BIN
app/src/main/res/drawable-xhdpi/temp_sel_options.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/temp_sel_options.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
BIN
app/src/main/res/drawable-xhdpi/temp_unsel_options.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/temp_unsel_options.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
191
app/src/main/res/layout/activity_catalog.xml
Normal file
191
app/src/main/res/layout/activity_catalog.xml
Normal file
@ -0,0 +1,191 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
tools:context=".activitys.base.CatalogActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_company_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:background="@drawable/sp_company_item_box"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/company_name_title"
|
||||
android:drawableLeft="@drawable/ic_item_user"
|
||||
android:text="企业名称" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
style="@style/company_content"
|
||||
tools:text="企业名称企业名称企业名称企业名称企业名称" />
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_unclaim"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="27dp"
|
||||
android:background="@drawable/sp_blue_sel"
|
||||
android:text="企业不配合"
|
||||
android:textColor="@color/titleBar" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
style="@style/company_name_title"
|
||||
android:drawableLeft="@drawable/ic_item_idcard"
|
||||
android:text="负责人" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_peo"
|
||||
style="@style/company_content"
|
||||
android:text="企业名称企业名称企业名称企业名称企业名称" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/rlv_catalog"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_empty_hint"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:gravity="center"
|
||||
android:text="未录入数据"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/rlv_child"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:id="@+id/ll_state_dis"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_alignParentBottom="true"-->
|
||||
<!-- android:layout_margin="5dp"-->
|
||||
<!-- android:background="@drawable/sp_company_item_box"-->
|
||||
<!-- android:orientation="vertical">-->
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginTop="2dp"-->
|
||||
<!-- android:gravity="center_vertical"-->
|
||||
<!-- android:orientation="horizontal">-->
|
||||
|
||||
<!-- <RadioGroup-->
|
||||
<!-- android:id="@+id/rg_term"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:orientation="vertical">-->
|
||||
|
||||
<!-- <RadioButton-->
|
||||
<!-- android:id="@+id/rb_now"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginTop="8dp"-->
|
||||
<!-- android:button="@null"-->
|
||||
<!-- android:checked="true"-->
|
||||
<!-- android:drawableLeft="@drawable/sel_rb"-->
|
||||
<!-- android:text="立即整改"-->
|
||||
<!-- android:textSize="16sp" />-->
|
||||
|
||||
<!-- <RadioButton-->
|
||||
<!-- android:id="@+id/rb_term"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginTop="8dp"-->
|
||||
<!-- android:button="@null"-->
|
||||
<!-- android:drawableLeft="@drawable/sel_rb"-->
|
||||
<!-- android:text="限期整改"-->
|
||||
<!-- android:textSize="16sp" />-->
|
||||
|
||||
<!-- <RadioButton-->
|
||||
<!-- android:id="@+id/rb_coor"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginTop="8dp"-->
|
||||
<!-- android:button="@null"-->
|
||||
<!-- android:drawableLeft="@drawable/sel_rb"-->
|
||||
<!-- android:text="不配合"-->
|
||||
<!-- android:textSize="16sp"-->
|
||||
<!-- android:visibility="gone" />-->
|
||||
<!-- </RadioGroup>-->
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:id="@+id/ll_sp"-->
|
||||
<!-- android:layout_width="200dp"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:orientation="vertical"-->
|
||||
<!-- android:padding="2dp">-->
|
||||
|
||||
|
||||
<!-- <android.support.v7.widget.AppCompatSpinner-->
|
||||
<!-- android:id="@+id/sp_term"-->
|
||||
<!-- style="@style/common_spinner"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:popupTheme="@style/common_spinner"-->
|
||||
<!-- android:spinnerMode="dropdown"-->
|
||||
<!-- app:theme="@style/common_spinner" />-->
|
||||
|
||||
<!-- </LinearLayout>-->
|
||||
<!-- </LinearLayout>-->
|
||||
|
||||
<!-- <View-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="1dp"-->
|
||||
<!-- android:layout_margin="3dp"-->
|
||||
<!-- android:background="@color/gray_bg" />-->
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:padding="5dp">-->
|
||||
|
||||
<!-- <android.support.v7.widget.RecyclerView-->
|
||||
<!-- android:id="@+id/rlv_photos"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content" />-->
|
||||
<!-- </LinearLayout>-->
|
||||
<!-- </LinearLayout>-->
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -21,31 +21,6 @@
|
||||
android:background="@drawable/shape_search_box"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_com_type"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1.5"
|
||||
android:clickable="true"
|
||||
android:drawableRight="@drawable/ic_arrow_gray_down"
|
||||
android:ellipsize="end"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="企业类型"
|
||||
android:padding="5dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/black"
|
||||
android:textFontWeight="1"
|
||||
android:textSize="15sp"
|
||||
tools:text="企业类型" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="3dp"
|
||||
android:background="@color/gray_bg" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
|
123
app/src/main/res/layout/dialog_rectify.xml
Normal file
123
app/src/main/res/layout/dialog_rectify.xml
Normal file
@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_state_dis"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:background="@drawable/sp_company_item_box"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/rg_term"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_now"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:button="@null"
|
||||
android:checked="true"
|
||||
android:drawableLeft="@drawable/sel_rb"
|
||||
android:text="立即整改"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_term"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:button="@null"
|
||||
android:drawableLeft="@drawable/sel_rb"
|
||||
android:text="限期整改"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_coor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:button="@null"
|
||||
android:drawableLeft="@drawable/sel_rb"
|
||||
android:text="不配合"
|
||||
android:textSize="16sp"
|
||||
android:visibility="gone" />
|
||||
</RadioGroup>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_sp"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="2dp">
|
||||
|
||||
|
||||
<android.support.v7.widget.AppCompatSpinner
|
||||
android:id="@+id/sp_term"
|
||||
style="@style/common_spinner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:popupTheme="@style/common_spinner"
|
||||
android:spinnerMode="dropdown"
|
||||
app:theme="@style/common_spinner" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_margin="3dp"
|
||||
android:background="@color/gray_bg" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="5dp">
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/rlv_photos"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:orientation="horizontal">-->
|
||||
|
||||
<!-- <Button-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:background="@drawable/sel_btn_submit_no_size"-->
|
||||
<!-- android:text="确定"-->
|
||||
<!-- android:textColor="@color/white" />-->
|
||||
|
||||
<!-- <Button-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:background="@drawable/sel_btn_submit_red"-->
|
||||
<!-- android:text="取消"-->
|
||||
<!-- android:textColor="@color/white" />-->
|
||||
<!-- </LinearLayout>-->
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
29
app/src/main/res/layout/item_catalog_left.xml
Normal file
29
app/src/main/res/layout/item_catalog_left.xml
Normal file
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:background="@color/blue"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:padding="15dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:src="@drawable/ic_call_icon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="2"
|
||||
android:minLines="2"
|
||||
android:textColor="@color/col_catalog"
|
||||
android:textSize="15sp"
|
||||
tools:text="标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题" />
|
||||
</LinearLayout>
|
@ -0,0 +1,67 @@
|
||||
package com.sucstepsoft.cm_utils.core.widget.base;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.sucstepsoft.cm_utils.R;
|
||||
import com.sucstepsoft.cm_utils.core.beans.AddPhotoBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者 : Adam on 2018/11/10.
|
||||
* 邮箱 : itgaojian@163.com
|
||||
* 描述 : 添加图片的适配器
|
||||
*/
|
||||
public class AddLittlePhotoAdapter extends BaseRecyclerAdapter<AddPhotoBean, AddPhotoHolder> {
|
||||
public AddLittlePhotoAdapter(Context ctx, List<AddPhotoBean> list) {
|
||||
super(ctx, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AddPhotoHolder createHolder(ViewGroup parent, int viewType) {
|
||||
View itemView = LayoutInflater.from(mContext)
|
||||
.inflate(R.layout.item_apply_service_photo_little, parent, false);
|
||||
return new AddPhotoHolder(itemView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindHolder(AddPhotoHolder applyServicePhotoHolder, int i) {
|
||||
if (TextUtils.isEmpty(mData.get(i).getPath())) {
|
||||
applyServicePhotoHolder.mIvDelete.setVisibility(View.GONE);
|
||||
Glide.with(mContext)
|
||||
.load(R.drawable.ic_add_photo)
|
||||
.into(applyServicePhotoHolder.mIvPhoto);
|
||||
} else {
|
||||
if (mDeleteListener != null) {
|
||||
applyServicePhotoHolder.mIvDelete.setVisibility(View.VISIBLE);
|
||||
applyServicePhotoHolder.mIvDelete.setOnClickListener(v -> mDeleteListener.onDelete(mData.get(i), i));
|
||||
} else {
|
||||
applyServicePhotoHolder.mIvDelete.setVisibility(View.GONE);
|
||||
}
|
||||
RequestOptions options = new RequestOptions()
|
||||
.transform(new GlideRoundTransform(mContext, 5))
|
||||
.error(R.drawable.ic_img_default)
|
||||
.placeholder(R.drawable.ic_img_default);
|
||||
Glide.with(mContext)
|
||||
.load(mData.get(i).getPath())
|
||||
.apply(options)
|
||||
.into(applyServicePhotoHolder.mIvPhoto);
|
||||
}
|
||||
}
|
||||
|
||||
private OnDeleteListener mDeleteListener;
|
||||
|
||||
public void addOnDeleteListener(OnDeleteListener listener) {
|
||||
this.mDeleteListener = listener;
|
||||
}
|
||||
|
||||
public interface OnDeleteListener {
|
||||
void onDelete(AddPhotoBean bean, int i);
|
||||
}
|
||||
}
|
28
cm_utils/src/main/res/layout/item_apply_service_photo_little.xml
Executable file
28
cm_utils/src/main/res/layout/item_apply_service_photo_little.xml
Executable file
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:padding="2dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_photo"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:scaleType="fitXY"
|
||||
tools:background="@drawable/bg_splash" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_delete"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_delete" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
Loading…
Reference in New Issue
Block a user