去除案件检查相片必填
This commit is contained in:
parent
7a783cecc9
commit
23849d2903
@ -39,4 +39,12 @@
|
|||||||
|
|
||||||
1.境外人员 字段变更
|
1.境外人员 字段变更
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## 2023-3-12
|
||||||
|
```
|
||||||
|
> 1.4.6
|
||||||
|
|
||||||
|
1.去除案件检查时相片必填选项
|
||||||
|
|
||||||
```
|
```
|
@ -8,7 +8,6 @@ import android.graphics.drawable.AnimationDrawable;
|
|||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.print.PrintManager;
|
|
||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
import android.support.v4.content.FileProvider;
|
import android.support.v4.content.FileProvider;
|
||||||
import android.support.v7.widget.GridLayoutManager;
|
import android.support.v7.widget.GridLayoutManager;
|
||||||
@ -199,31 +198,31 @@ public class IssueDetailActivity extends BaseActivity {
|
|||||||
private void getDetail(IssueSubBean.RowsBean rowsBean) {
|
private void getDetail(IssueSubBean.RowsBean rowsBean) {
|
||||||
if (rowsBean != null) {
|
if (rowsBean != null) {
|
||||||
RetrofitManager.getInstance()
|
RetrofitManager.getInstance()
|
||||||
.create(LocationApiService.class)
|
.create(LocationApiService.class)
|
||||||
.getIssueDetail(rowsBean.getReportCaseId(), UserLgUtils.getToken())
|
.getIssueDetail(rowsBean.getReportCaseId(), UserLgUtils.getToken())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new Observer<Object>() {
|
.subscribe(new Observer<Object>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(Disposable d) {
|
public void onSubscribe(Disposable d) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(Object o) {
|
public void onNext(Object o) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Throwable e) {
|
public void onError(Throwable e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onComplete() {
|
public void onComplete() {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -328,39 +327,39 @@ public class IssueDetailActivity extends BaseActivity {
|
|||||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "上报中...");
|
ProgressDialog dialog = UIUtil.initDialog(mActivity, "上报中...");
|
||||||
dialog.show();
|
dialog.show();
|
||||||
RetrofitManager.getInstance()
|
RetrofitManager.getInstance()
|
||||||
.create(LocationApiService.class)
|
.create(LocationApiService.class)
|
||||||
.returnIssueDis(mRowsBean.getReportCaseId(), UserLgUtils.getToken())
|
.returnIssueDis(mRowsBean.getReportCaseId(), UserLgUtils.getToken())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new Observer<SuccessBean>() {
|
.subscribe(new Observer<SuccessBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(Disposable d) {
|
public void onSubscribe(Disposable d) {
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNext(SuccessBean successBean) {
|
|
||||||
if (dialog != null && dialog.isShowing()) {
|
|
||||||
dialog.dismiss();
|
|
||||||
}
|
}
|
||||||
ToastUtils.showShort("回退成功");
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Throwable e) {
|
public void onNext(SuccessBean successBean) {
|
||||||
e.printStackTrace();
|
if (dialog != null && dialog.isShowing()) {
|
||||||
if (dialog != null && dialog.isShowing()) {
|
dialog.dismiss();
|
||||||
dialog.dismiss();
|
}
|
||||||
|
ToastUtils.showShort("回退成功");
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
ToastUtils.showShort("回退失败,请稍后重试");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onComplete() {
|
public void onError(Throwable e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
if (dialog != null && dialog.isShowing()) {
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
ToastUtils.showShort("回退失败,请稍后重试");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
@Override
|
||||||
});
|
public void onComplete() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doDisportIssue() {
|
private void doDisportIssue() {
|
||||||
@ -385,39 +384,39 @@ public class IssueDetailActivity extends BaseActivity {
|
|||||||
String obj = gson.toJson(issueDisBean);
|
String obj = gson.toJson(issueDisBean);
|
||||||
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
||||||
RetrofitManager.getInstance()
|
RetrofitManager.getInstance()
|
||||||
.create(LocationApiService.class)
|
.create(LocationApiService.class)
|
||||||
.saveIssueInspect(mRowsBean.getReportCaseId(), body, UserLgUtils.getToken())
|
.saveIssueInspect(mRowsBean.getReportCaseId(), body, UserLgUtils.getToken())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new Observer<SuccessBean>() {
|
.subscribe(new Observer<SuccessBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(Disposable d) {
|
public void onSubscribe(Disposable d) {
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNext(SuccessBean successBean) {
|
|
||||||
if (dialog != null && dialog.isShowing()) {
|
|
||||||
dialog.dismiss();
|
|
||||||
}
|
}
|
||||||
ToastUtils.showShort("处理成功");
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Throwable e) {
|
public void onNext(SuccessBean successBean) {
|
||||||
e.printStackTrace();
|
if (dialog != null && dialog.isShowing()) {
|
||||||
if (dialog != null && dialog.isShowing()) {
|
dialog.dismiss();
|
||||||
dialog.dismiss();
|
}
|
||||||
|
ToastUtils.showShort("处理成功");
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
ToastUtils.showShort("处理失败,请稍后重试");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onComplete() {
|
public void onError(Throwable e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
if (dialog != null && dialog.isShowing()) {
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
ToastUtils.showShort("处理失败,请稍后重试");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
@Override
|
||||||
});
|
public void onComplete() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -427,9 +426,11 @@ public class IssueDetailActivity extends BaseActivity {
|
|||||||
String desc = mEtIssueDisDesc.getText().toString().trim();
|
String desc = mEtIssueDisDesc.getText().toString().trim();
|
||||||
//处理
|
//处理
|
||||||
String ids = "";
|
String ids = "";
|
||||||
for (int i = 0; i < mPhotoAdapter.getData().size(); i++) {
|
if (mPhotoAdapter.getData() != null && mPhotoAdapter.getData().size() >= 2) {
|
||||||
if (!TextUtils.isEmpty(mPhotoAdapter.getData().get(i).getId())) {
|
for (int i = 0; i < mPhotoAdapter.getData().size(); i++) {
|
||||||
ids += mPhotoAdapter.getData().get(i).getId() + ",";
|
if (!TextUtils.isEmpty(mPhotoAdapter.getData().get(i).getId())) {
|
||||||
|
ids += mPhotoAdapter.getData().get(i).getId() + ",";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bean.setInspectPhotos(ids);
|
bean.setInspectPhotos(ids);
|
||||||
@ -449,10 +450,10 @@ public class IssueDetailActivity extends BaseActivity {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private boolean checkInspectParams() {
|
private boolean checkInspectParams() {
|
||||||
if (mPhotoAdapter.getData() == null || mPhotoAdapter.getData().size() <= 1) {
|
// if (mPhotoAdapter.getData() == null || mPhotoAdapter.getData().size() <= 1) {
|
||||||
ToastUtils.showShort("请上传现场照片.");
|
// ToastUtils.showShort("请上传现场照片.");
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
String desc = mEtIssueDisDesc.getText().toString().trim();
|
String desc = mEtIssueDisDesc.getText().toString().trim();
|
||||||
if (TextUtils.isEmpty(desc)) {
|
if (TextUtils.isEmpty(desc)) {
|
||||||
ToastUtils.showShort("请输入检查描述内容.");
|
ToastUtils.showShort("请输入检查描述内容.");
|
||||||
@ -472,21 +473,28 @@ public class IssueDetailActivity extends BaseActivity {
|
|||||||
String obj = gson.toJson(issueDisBean);
|
String obj = gson.toJson(issueDisBean);
|
||||||
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
||||||
RetrofitManager.getInstance()
|
RetrofitManager.getInstance()
|
||||||
.create(LocationApiService.class)
|
.create(LocationApiService.class)
|
||||||
.saveIssueDis(mRowsBean.getReportCaseId(), body, UserLgUtils.getToken())
|
.saveIssueDis(mRowsBean.getReportCaseId(), body, UserLgUtils.getToken())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new Observer<SuccessBean>() {
|
.subscribe(new Observer<SuccessBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(Disposable d) {
|
public void onSubscribe(Disposable d) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(SuccessBean successBean) {
|
public void onNext(SuccessBean successBean) {
|
||||||
if (isSelf) {
|
if (isSelf) {
|
||||||
if (isAccept) {
|
if (isAccept) {
|
||||||
doCheckSelf(dialog);
|
doCheckSelf(dialog);
|
||||||
|
} else {
|
||||||
|
if (dialog != null && dialog.isShowing()) {
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
ToastUtils.showShort("处理成功");
|
||||||
|
finish();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (dialog != null && dialog.isShowing()) {
|
if (dialog != null && dialog.isShowing()) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
@ -494,30 +502,23 @@ public class IssueDetailActivity extends BaseActivity {
|
|||||||
ToastUtils.showShort("处理成功");
|
ToastUtils.showShort("处理成功");
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
e.printStackTrace();
|
||||||
if (dialog != null && dialog.isShowing()) {
|
if (dialog != null && dialog.isShowing()) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
ToastUtils.showShort("处理成功");
|
ToastUtils.showShort("处理失败,请稍后重试.");
|
||||||
finish();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(Throwable e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
if (dialog != null && dialog.isShowing()) {
|
|
||||||
dialog.dismiss();
|
|
||||||
}
|
}
|
||||||
ToastUtils.showShort("处理失败,请稍后重试.");
|
});
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onComplete() {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private IssueDisBean buildParasm() {
|
private IssueDisBean buildParasm() {
|
||||||
@ -590,39 +591,39 @@ public class IssueDetailActivity extends BaseActivity {
|
|||||||
String obj = gson.toJson(issueDisBean);
|
String obj = gson.toJson(issueDisBean);
|
||||||
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
||||||
RetrofitManager.getInstance()
|
RetrofitManager.getInstance()
|
||||||
.create(LocationApiService.class)
|
.create(LocationApiService.class)
|
||||||
.saveIssueInspect(mRowsBean.getReportCaseId(), body, UserLgUtils.getToken())
|
.saveIssueInspect(mRowsBean.getReportCaseId(), body, UserLgUtils.getToken())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new Observer<SuccessBean>() {
|
.subscribe(new Observer<SuccessBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(Disposable d) {
|
public void onSubscribe(Disposable d) {
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNext(SuccessBean successBean) {
|
|
||||||
if (dialog != null && dialog.isShowing()) {
|
|
||||||
dialog.dismiss();
|
|
||||||
}
|
}
|
||||||
ToastUtils.showShort("处理成功");
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Throwable e) {
|
public void onNext(SuccessBean successBean) {
|
||||||
e.printStackTrace();
|
if (dialog != null && dialog.isShowing()) {
|
||||||
if (dialog != null && dialog.isShowing()) {
|
dialog.dismiss();
|
||||||
dialog.dismiss();
|
}
|
||||||
|
ToastUtils.showShort("处理成功");
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
ToastUtils.showShort("处理失败,请稍后重试");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onComplete() {
|
public void onError(Throwable e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
if (dialog != null && dialog.isShowing()) {
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
ToastUtils.showShort("处理失败,请稍后重试");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
@Override
|
||||||
});
|
public void onComplete() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setDetailDataToView() {
|
private void setDetailDataToView() {
|
||||||
@ -738,10 +739,10 @@ public class IssueDetailActivity extends BaseActivity {
|
|||||||
MapStatus ms = new MapStatus.Builder().zoom(14).target(new LatLng(a, l)).build();
|
MapStatus ms = new MapStatus.Builder().zoom(14).target(new LatLng(a, l)).build();
|
||||||
map.animateMapStatus(MapStatusUpdateFactory.newMapStatus(ms));
|
map.animateMapStatus(MapStatusUpdateFactory.newMapStatus(ms));
|
||||||
MarkerOptions markerOptions = new MarkerOptions()
|
MarkerOptions markerOptions = new MarkerOptions()
|
||||||
.position(new LatLng(a, l))//mark出现的位置
|
.position(new LatLng(a, l))//mark出现的位置
|
||||||
.icon(mapIcon) //mark图标
|
.icon(mapIcon) //mark图标
|
||||||
.draggable(false)//mark可拖拽
|
.draggable(false)//mark可拖拽
|
||||||
.animateType(MarkerOptions.MarkerAnimateType.none);
|
.animateType(MarkerOptions.MarkerAnimateType.none);
|
||||||
map.addOverlay(markerOptions);
|
map.addOverlay(markerOptions);
|
||||||
mBtnReload.setOnClickListener(v -> map.animateMapStatus(MapStatusUpdateFactory.newMapStatus(ms)));
|
mBtnReload.setOnClickListener(v -> map.animateMapStatus(MapStatusUpdateFactory.newMapStatus(ms)));
|
||||||
}
|
}
|
||||||
@ -815,11 +816,11 @@ public class IssueDetailActivity extends BaseActivity {
|
|||||||
AnimationDrawable animationDrawable = (AnimationDrawable) mTvVoiceAnim.getBackground();
|
AnimationDrawable animationDrawable = (AnimationDrawable) mTvVoiceAnim.getBackground();
|
||||||
animationDrawable.start();
|
animationDrawable.start();
|
||||||
MediaManager.playSound(BaseUrlApi.BASE_IMG_URL + caseAudio,
|
MediaManager.playSound(BaseUrlApi.BASE_IMG_URL + caseAudio,
|
||||||
mp -> {
|
mp -> {
|
||||||
animationDrawable.selectDrawable(0);//显示动画第一帧
|
animationDrawable.selectDrawable(0);//显示动画第一帧
|
||||||
animationDrawable.stop();
|
animationDrawable.stop();
|
||||||
MediaManager.destroy();
|
MediaManager.destroy();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -829,11 +830,11 @@ public class IssueDetailActivity extends BaseActivity {
|
|||||||
*/
|
*/
|
||||||
private void showSelectPhoto(AddPhotoBean bean) {
|
private void showSelectPhoto(AddPhotoBean bean) {
|
||||||
ButtomDialogView buttomDialogView = new ButtomDialogView.DialogBuilder(mActivity)
|
ButtomDialogView buttomDialogView = new ButtomDialogView.DialogBuilder(mActivity)
|
||||||
.setIsBackCancelable(true)
|
.setIsBackCancelable(true)
|
||||||
.setIscancelable(true)
|
.setIscancelable(true)
|
||||||
.setShowLocation(Gravity.BOTTOM)
|
.setShowLocation(Gravity.BOTTOM)
|
||||||
.setIsShowFile(false)
|
.setIsShowFile(false)
|
||||||
.build();
|
.build();
|
||||||
buttomDialogView.addOnChoseListener(new ButtomDialogView.OnChoseListener() {
|
buttomDialogView.addOnChoseListener(new ButtomDialogView.OnChoseListener() {
|
||||||
@Override
|
@Override
|
||||||
public void choseFile() {
|
public void choseFile() {
|
||||||
@ -844,7 +845,7 @@ public class IssueDetailActivity extends BaseActivity {
|
|||||||
mCurrentBean = bean;
|
mCurrentBean = bean;
|
||||||
Intent intent = new Intent(Intent.ACTION_PICK, null);
|
Intent intent = new Intent(Intent.ACTION_PICK, null);
|
||||||
intent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
|
intent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
|
||||||
"image/*");
|
"image/*");
|
||||||
startActivityForResult(intent, BaseUrlApi.PHOTO_REQUEST);
|
startActivityForResult(intent, BaseUrlApi.PHOTO_REQUEST);
|
||||||
buttomDialogView.dismiss();
|
buttomDialogView.dismiss();
|
||||||
}
|
}
|
||||||
@ -924,74 +925,74 @@ public class IssueDetailActivity extends BaseActivity {
|
|||||||
progressDialog.show();
|
progressDialog.show();
|
||||||
String pathStr = getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath() + PathConfig.CATCH_PATH;
|
String pathStr = getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath() + PathConfig.CATCH_PATH;
|
||||||
Luban.with(mActivity)
|
Luban.with(mActivity)
|
||||||
.load(picPath)
|
.load(picPath)
|
||||||
.ignoreBy(100)
|
.ignoreBy(100)
|
||||||
.setTargetDir(pathStr)
|
.setTargetDir(pathStr)
|
||||||
.filter(path -> !(TextUtils.isEmpty(path) || path.toLowerCase().endsWith(".gif")))
|
.filter(path -> !(TextUtils.isEmpty(path) || path.toLowerCase().endsWith(".gif")))
|
||||||
.setCompressListener(new OnCompressListener() {
|
.setCompressListener(new OnCompressListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
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("上传成功");
|
|
||||||
mPhotoIds += (baseUserBean.getData() + ",");
|
|
||||||
mCurrentBean.setId(baseUserBean.getData());
|
|
||||||
mCurrentBean.setPath(picPath);
|
|
||||||
if (mPhotos.size() < 4) {
|
|
||||||
mPhotos.add(new AddPhotoBean());
|
|
||||||
}
|
|
||||||
mPhotoAdapter.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("图片上传失败,请稍后重试");
|
|
||||||
}
|
@Override
|
||||||
})
|
public void onSuccess(File file) {
|
||||||
.launch();
|
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("上传成功");
|
||||||
|
mPhotoIds += (baseUserBean.getData() + ",");
|
||||||
|
mCurrentBean.setId(baseUserBean.getData());
|
||||||
|
mCurrentBean.setPath(picPath);
|
||||||
|
if (mPhotos.size() < 4) {
|
||||||
|
mPhotos.add(new AddPhotoBean());
|
||||||
|
}
|
||||||
|
mPhotoAdapter.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();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -9,8 +9,8 @@ import com.sucstepsoft.cm_utils.constant.PathConfig;
|
|||||||
*/
|
*/
|
||||||
public class BaseUrlApi {
|
public class BaseUrlApi {
|
||||||
|
|
||||||
// public static final String IP = "http://219.147.99.164:8082/usercenter/"; /*正式统一用户*/
|
public static final String IP = "http://219.147.99.164:8082/usercenter/"; /*正式统一用户*/
|
||||||
public static final String IP = "http://192.168.31.14:7001/usercenter/"; /*测试统一用户*/
|
// public static final String IP = "http://192.168.31.14:7001/usercenter/"; /*测试统一用户*/
|
||||||
// public static final String IP = "http://175.24.42.217:7000/usercenter/"; /*测试统一用户*/
|
// public static final String IP = "http://175.24.42.217:7000/usercenter/"; /*测试统一用户*/
|
||||||
public static final String BASE_URL = IP;
|
public static final String BASE_URL = IP;
|
||||||
public static final String APP_VERSION = BASE_URL + "appCmVersionManagement/getAppVersion";
|
public static final String APP_VERSION = BASE_URL + "appCmVersionManagement/getAppVersion";
|
||||||
@ -18,9 +18,9 @@ public class BaseUrlApi {
|
|||||||
public static final String FIELD_SAFETY = BASE_URL + "appFieldSafety/goFloorPlan";
|
public static final String FIELD_SAFETY = BASE_URL + "appFieldSafety/goFloorPlan";
|
||||||
public static final int PHOTO_REQUEST = 233;
|
public static final int PHOTO_REQUEST = 233;
|
||||||
public static final int CAMERA_REQUEST = 123;
|
public static final int CAMERA_REQUEST = 123;
|
||||||
// public static final String BASE_IP_P = "http://219.147.99.164:8082/"; /*正式IP*/
|
public static final String BASE_IP_P = "http://219.147.99.164:8082/"; /*正式IP*/
|
||||||
// public static final String BASE_IP_P = "http://175.24.42.217"; /*演示IP*/
|
// public static final String BASE_IP_P = "http://175.24.42.217"; /*演示IP*/
|
||||||
public static final String BASE_IP_P = "http://192.168.31.14:8083/"; /*测试IP*/
|
// public static final String BASE_IP_P = "http://192.168.31.14:8083/"; /*测试IP*/
|
||||||
public static final String BASE_IP = BASE_IP_P + "servicecity/";/*网格系统*/
|
public static final String BASE_IP = BASE_IP_P + "servicecity/";/*网格系统*/
|
||||||
// public static final String BASE_IP = "http://192.168.0.109:8083/servicecity/";/*测试网格系统*/
|
// public static final String BASE_IP = "http://192.168.0.109:8083/servicecity/";/*测试网格系统*/
|
||||||
public static final String BASE_POPULATION_IP = BASE_IP_P + "population/";/*人口系统*/
|
public static final String BASE_POPULATION_IP = BASE_IP_P + "population/";/*人口系统*/
|
||||||
|
Loading…
Reference in New Issue
Block a user