|
@@ -1,21 +1,31 @@
|
|
|
package com.tofly.yxpc.ui.fragment;
|
|
|
|
|
|
+import android.content.Intent;
|
|
|
+import android.os.Build;
|
|
|
import android.os.Bundle;
|
|
|
import android.text.TextUtils;
|
|
|
import android.view.MotionEvent;
|
|
|
import android.view.View;
|
|
|
import android.widget.AdapterView;
|
|
|
+import android.widget.CheckBox;
|
|
|
+import android.widget.LinearLayout;
|
|
|
|
|
|
+import androidx.annotation.NonNull;
|
|
|
import androidx.annotation.Nullable;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.google.zxing.integration.android.IntentIntegrator;
|
|
|
import com.tofly.latte_core.base.LatteContract;
|
|
|
+import com.tofly.yxpc.R;
|
|
|
+import com.tofly.yxpc.base.MyApp;
|
|
|
import com.tofly.yxpc.databinding.FragmentWaterCheckCorrectionBinding;
|
|
|
import com.tofly.yxpc.entity.DataCorrectionBean;
|
|
|
import com.tofly.yxpc.entity.DictEntity;
|
|
|
import com.tofly.yxpc.entity.FileBean;
|
|
|
import com.tofly.yxpc.greenDao.DictEntityDao;
|
|
|
import com.tofly.yxpc.map.LocationUtil_xu;
|
|
|
+import com.tofly.yxpc.ui.activity.CaptureActivity;
|
|
|
+import com.tofly.yxpc.ui.activity.LocationActivity;
|
|
|
import com.tofly.yxpc.ui.adapter.BigPictureAdapter;
|
|
|
import com.tofly.yxpc.ui.impl.DataCorrectionImpl;
|
|
|
import com.tofly.yxpc.utils.DialogUtils;
|
|
@@ -24,6 +34,7 @@ import com.tofly.yxpc.utils.SpinnerUtils;
|
|
|
import com.tofly.yxpc.utils.db.DaoUtilsStore;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -37,16 +48,24 @@ public class WaterCheckCorrectionFragment extends PhotoFragment {
|
|
|
private final List<FileBean> bpzbPhotoList = new ArrayList<>();
|
|
|
private LocationUtil_xu.CoordinateClass locationUtilXuNew = null;
|
|
|
private DataCorrectionBean waterMeterEntity;
|
|
|
- private boolean isFirst = true;
|
|
|
+ private final List<DictEntity> dictEntities = new ArrayList<>();
|
|
|
+ private String idCard = null;
|
|
|
+ private String headName;
|
|
|
+ private String shortName;
|
|
|
+ private String areaCode;
|
|
|
+ public int qcType = 0;
|
|
|
private final List<String> brandIdList = new ArrayList<>();
|
|
|
private final List<String> calibarIdList = new ArrayList<>();
|
|
|
private final List<String> typeIdList = new ArrayList<>();
|
|
|
private final List<String> sblcIdList = new ArrayList<>();
|
|
|
private final List<String> natureIdList = new ArrayList<>();
|
|
|
+ private final List<String> bwbhList = Arrays.asList("-", "-附", "空");
|
|
|
+ private String bwbh;
|
|
|
+ private DictEntity nullDictEntity = null;
|
|
|
+ private List<DictEntity> dictEntityList;
|
|
|
|
|
|
@Override
|
|
|
public void onTakePhotoSuccess(String pathFile) {
|
|
|
-
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -71,6 +90,7 @@ public class WaterCheckCorrectionFragment extends PhotoFragment {
|
|
|
super.onCreate(savedInstanceState);
|
|
|
Bundle bundle = this.getArguments();
|
|
|
if (bundle != null) {
|
|
|
+ idCard = bundle.getString("idCard");
|
|
|
waterMeterEntity = JSON.parseObject(bundle.getString("data"), DataCorrectionBean.class);
|
|
|
}
|
|
|
}
|
|
@@ -78,7 +98,18 @@ public class WaterCheckCorrectionFragment extends PhotoFragment {
|
|
|
@Override
|
|
|
public void initView() {
|
|
|
super.initView();
|
|
|
- initRecyclerView();
|
|
|
+ dictEntityList = DaoUtilsStore.getInstance().getDictEntityDbUtils().queryByQueryBuilder(DictEntityDao.Properties.DictCode.eq("abnormal_info"));
|
|
|
+ for (DictEntity dictEntity : dictEntityList) {
|
|
|
+ if ("9dc19b47-1a29-4558-8512-fdfec5d06dcc".equals(dictEntity.getId())) {
|
|
|
+ nullDictEntity = dictEntity;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (nullDictEntity != null) {
|
|
|
+ dictEntityList.remove(nullDictEntity);
|
|
|
+ binding.switchException.setVisibility(View.VISIBLE);
|
|
|
+ } else {
|
|
|
+ binding.switchException.setVisibility(View.GONE);
|
|
|
+ }
|
|
|
initListener();
|
|
|
loadData();
|
|
|
}
|
|
@@ -105,7 +136,6 @@ public class WaterCheckCorrectionFragment extends PhotoFragment {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
- binding.spinnerBrand.setEnabled(false);
|
|
|
|
|
|
List<String> calibarList = new ArrayList<>();
|
|
|
calibarIdList.clear();
|
|
@@ -128,7 +158,6 @@ public class WaterCheckCorrectionFragment extends PhotoFragment {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
- binding.spinnerWaterCaliber.setEnabled(false);
|
|
|
|
|
|
List<String> typeList = new ArrayList<>();
|
|
|
typeIdList.clear();
|
|
@@ -151,7 +180,6 @@ public class WaterCheckCorrectionFragment extends PhotoFragment {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
- binding.spinnerWaterType.setEnabled(false);
|
|
|
|
|
|
List<String> sblcList = new ArrayList<>();
|
|
|
sblcIdList.clear();
|
|
@@ -174,7 +202,6 @@ public class WaterCheckCorrectionFragment extends PhotoFragment {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
- binding.spinnerSblc.setEnabled(false);
|
|
|
|
|
|
List<String> natureList = new ArrayList<>();
|
|
|
natureIdList.clear();
|
|
@@ -197,7 +224,6 @@ public class WaterCheckCorrectionFragment extends PhotoFragment {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
- binding.spinnerUseWaterProperties.setEnabled(false);
|
|
|
|
|
|
bpPhotoList.clear();
|
|
|
bpPictureAdapter = new BigPictureAdapter(bpPhotoList, false, true, size -> {
|
|
@@ -215,6 +241,19 @@ public class WaterCheckCorrectionFragment extends PhotoFragment {
|
|
|
|
|
|
});
|
|
|
RecyclerViewUtils.initGrid(requireContext(), binding.rvListBpzb, 3, bpzbPictureAdapter);
|
|
|
+
|
|
|
+ SpinnerUtils.initSpinner1(requireContext(), binding.spinnerBwbh, bwbhList);
|
|
|
+ binding.spinnerBwbh.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
|
|
+ @Override
|
|
|
+ public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
|
|
+ bwbh = bwbhList.get(position);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onNothingSelected(AdapterView<?> parent) {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
private void initListener() {
|
|
@@ -224,18 +263,134 @@ public class WaterCheckCorrectionFragment extends PhotoFragment {
|
|
|
binding.cbAbnormal.setOnClickListener(v -> binding.llAbnormal.setVisibility(binding.cbAbnormal.isChecked() ? View.VISIBLE : View.GONE));
|
|
|
|
|
|
binding.tvSubmit.setOnClickListener(v -> {
|
|
|
- if (check() && waterMeterEntity != null) {
|
|
|
- DialogUtils.showDialog(requireContext(), "提示", "是否确定上传数据", false, (dialog, which) -> {
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- if (!TextUtils.isEmpty(binding.etZgsm.getText())) {
|
|
|
- map.put("correctionDescribe", binding.etZgsm.getText().toString());
|
|
|
- }
|
|
|
- map.put("correctionStatus", "已整改");
|
|
|
- map.put("idCus", waterMeterEntity.getIdCus());
|
|
|
- mPresenter.getResultThree(requireContext(), map);
|
|
|
+ if (check()) {
|
|
|
+ DialogUtils.showDialog(requireContext(), "提示", "是否确定上传数据", false, (dialog, which) -> updateWaterMeter());
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ binding.tvSao.setOnClickListener(v -> {
|
|
|
+ qcType = 0;
|
|
|
+ IntentIntegrator integrator = new IntentIntegrator(requireActivity());
|
|
|
+ integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE);
|
|
|
+ integrator.setPrompt("请扫码");
|
|
|
+ integrator.setCameraId(0);
|
|
|
+ integrator.setBeepEnabled(true);
|
|
|
+ integrator.setOrientationLocked(false);
|
|
|
+ integrator.setCaptureActivity(CaptureActivity.class);
|
|
|
+ integrator.initiateScan();
|
|
|
+ });
|
|
|
+ binding.tvSaoSbxh.setOnClickListener(v -> {
|
|
|
+ qcType = 1;
|
|
|
+ IntentIntegrator integrator = new IntentIntegrator(requireActivity());
|
|
|
+ integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE);
|
|
|
+ integrator.setPrompt("请扫码");
|
|
|
+ integrator.setCameraId(0);
|
|
|
+ integrator.setBeepEnabled(true);
|
|
|
+ integrator.setOrientationLocked(false);
|
|
|
+ integrator.setCaptureActivity(CaptureActivity.class);
|
|
|
+ integrator.initiateScan();
|
|
|
+ });
|
|
|
+
|
|
|
+ binding.imgAchieve.setOnClickListener(v -> {
|
|
|
+ if (!TextUtils.isEmpty(headName)) {
|
|
|
+ binding.tvXzq.setText(headName);
|
|
|
+ } else {
|
|
|
+ binding.tvXzq.setText("");
|
|
|
+ onMessage("请选择位置");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ binding.imgAchieveAddress.setOnClickListener(v -> {
|
|
|
+ if (!TextUtils.isEmpty(shortName)) {
|
|
|
+ binding.etUserAddr.setText(shortName);
|
|
|
+ } else {
|
|
|
+ onMessage("请选择位置");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ binding.imgCopy.setOnClickListener(v -> {
|
|
|
+ if (waterMeterEntity != null) {
|
|
|
+ binding.edMph.setText(waterMeterEntity.getUserAddr() == null ? "" : waterMeterEntity.getUserAddr());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ binding.tvXzq.setOnClickListener(v -> {
|
|
|
+ if (MyApp.getInstance().isOverTime()) {
|
|
|
+ DialogUtils.xzqDialog(requireContext(), areaCode, (name, areaCode1) -> {
|
|
|
+ binding.tvXzq.setText(name);
|
|
|
+ this.areaCode = areaCode1;
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ binding.switchException.setOnCheckedChangeListener((buttonView, isChecked) -> setNullTable(isChecked));
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setNullTable(boolean isChecked) {
|
|
|
+ initRecyclerView();
|
|
|
+ binding.cbDetail.setVisibility(isChecked ? View.GONE : View.VISIBLE);
|
|
|
+ binding.cbDetail.setChecked(!isChecked);
|
|
|
+ binding.llDetail.setVisibility(isChecked ? View.GONE : View.VISIBLE);
|
|
|
+ binding.vDetail.setVisibility(isChecked ? View.GONE : View.VISIBLE);
|
|
|
+ binding.cbSbwz.setVisibility(isChecked ? View.GONE : View.VISIBLE);
|
|
|
+ binding.cbSbwz.setChecked(!isChecked);
|
|
|
+ binding.llSbwz.setVisibility(View.VISIBLE);
|
|
|
+ binding.cbAbnormal.setVisibility(isChecked ? View.GONE : View.VISIBLE);
|
|
|
+ binding.cbAbnormal.setChecked(true);
|
|
|
+ binding.llAbnormal.setVisibility(View.VISIBLE);
|
|
|
+ binding.llErrorPhoto.setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
|
|
+ binding.rvListPhoto.setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
|
|
+ binding.llAbnormalView.setVisibility(isChecked ? View.GONE : View.VISIBLE);
|
|
|
+ binding.tvLatTitle.setText(isChecked ? "位置" : "水表位置");
|
|
|
+ dictEntities.clear();
|
|
|
+ if (isChecked) {
|
|
|
+ dictEntities.add(nullDictEntity);
|
|
|
+ } else {
|
|
|
+ binding.edDescribe.setText("");
|
|
|
+ binding.llAbnormalView.removeAllViews();
|
|
|
+ List<String> ides = null;
|
|
|
+ if (!TextUtils.isEmpty(waterMeterEntity.getExceptionType())) {
|
|
|
+ ides = Arrays.asList(waterMeterEntity.getExceptionType().split(","));
|
|
|
+ }
|
|
|
+ for (DictEntity dictEntity : dictEntityList) {
|
|
|
+ CheckBox checkBox = new CheckBox(requireContext());
|
|
|
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
|
|
+ checkBox.setTextColor(requireContext().getColor(R.color.color_333));
|
|
|
+ LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
|
|
|
+
|
|
|
+ layoutParams.setMargins(20, 12, 0, 0);
|
|
|
+
|
|
|
+ checkBox.setLayoutParams(layoutParams);
|
|
|
+ checkBox.setTextSize(16);
|
|
|
+ }
|
|
|
+ checkBox.setText(dictEntity.getItemText());
|
|
|
+ if (ides != null && ides.contains(dictEntity.getId())) {
|
|
|
+ dictEntities.add(dictEntity);
|
|
|
+ checkBox.setChecked(true);
|
|
|
+ }
|
|
|
+ checkBox.setOnCheckedChangeListener((buttonView, isChecked1) -> {
|
|
|
+ if (isChecked1) {
|
|
|
+ dictEntities.add(dictEntity);
|
|
|
+ } else {
|
|
|
+ dictEntities.remove(dictEntity);
|
|
|
+ }
|
|
|
+ if (dictEntities.isEmpty()) {
|
|
|
+ binding.llErrorPhoto.setVisibility(View.GONE);
|
|
|
+ binding.rvListPhoto.setVisibility(View.GONE);
|
|
|
+ photoList.clear();
|
|
|
+ } else {
|
|
|
+ binding.llErrorPhoto.setVisibility(View.VISIBLE);
|
|
|
+ binding.rvListPhoto.setVisibility(View.VISIBLE);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ binding.llAbnormalView.addView(checkBox, dictEntityList.indexOf(dictEntity));
|
|
|
+ }
|
|
|
+ if (dictEntities.isEmpty()) {
|
|
|
+ binding.llErrorPhoto.setVisibility(View.GONE);
|
|
|
+ binding.rvListPhoto.setVisibility(View.GONE);
|
|
|
+ photoList.clear();
|
|
|
+ } else {
|
|
|
+ binding.llErrorPhoto.setVisibility(View.VISIBLE);
|
|
|
+ binding.rvListPhoto.setVisibility(View.VISIBLE);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private void loadData() {
|
|
@@ -245,7 +400,20 @@ public class WaterCheckCorrectionFragment extends PhotoFragment {
|
|
|
binding.tvFhry.setText(waterMeterEntity.getQtUserText() == null ? "" : waterMeterEntity.getQtUserText());
|
|
|
binding.tvFhsj.setText(waterMeterEntity.getQtTime() == null ? "" : waterMeterEntity.getQtTime());
|
|
|
|
|
|
- binding.edInternetIdCard.setText(waterMeterEntity.getInternetIdCard() == null ? "" : waterMeterEntity.getInternetIdCard());
|
|
|
+ if (!TextUtils.isEmpty(waterMeterEntity.getExceptionType())) {
|
|
|
+ boolean isChecked = waterMeterEntity.getExceptionType().contains("9dc19b47-1a29-4558-8512-fdfec5d06dcc");
|
|
|
+ binding.switchException.setChecked(isChecked);
|
|
|
+ setNullTable(isChecked);
|
|
|
+ } else {
|
|
|
+ binding.switchException.setChecked(false);
|
|
|
+ setNullTable(false);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!TextUtils.isEmpty(idCard)) {
|
|
|
+ binding.edInternetIdCard.setText(idCard);
|
|
|
+ } else {
|
|
|
+ binding.edInternetIdCard.setText(waterMeterEntity.getInternetIdCard() == null ? "" : waterMeterEntity.getInternetIdCard());
|
|
|
+ }
|
|
|
|
|
|
binding.tvUserNum.setText(waterMeterEntity.getUserNum() == null ? "" : waterMeterEntity.getUserNum());
|
|
|
binding.tvUserName.setText(waterMeterEntity.getUserName() == null ? "" : waterMeterEntity.getUserName());
|
|
@@ -275,6 +443,7 @@ public class WaterCheckCorrectionFragment extends PhotoFragment {
|
|
|
}
|
|
|
binding.tvOldRecentMark.setText(waterMeterEntity.getRecentMarkOld() == null ? "" : waterMeterEntity.getRecentMarkOld());
|
|
|
binding.edRecentMark.setText(waterMeterEntity.getRecentMark() == null ? "" : waterMeterEntity.getRecentMark());
|
|
|
+ binding.tvLastRecentRemark.setText(waterMeterEntity.getCurrentPeriodMark() == null ? "" : waterMeterEntity.getCurrentPeriodMark() + "(" + (waterMeterEntity.getCbMonth() == null ? "" : waterMeterEntity.getCbMonth()) + ")");
|
|
|
binding.edRemark.setText(waterMeterEntity.getAddressDetails() == null ? "" : waterMeterEntity.getAddressDetails());
|
|
|
if (!TextUtils.isEmpty(waterMeterEntity.getBpFilePath())) {
|
|
|
for (String s : waterMeterEntity.getBpFilePath().split(",")) {
|
|
@@ -299,13 +468,58 @@ public class WaterCheckCorrectionFragment extends PhotoFragment {
|
|
|
binding.tvLat.setText("");
|
|
|
}
|
|
|
binding.tvXzq.setText(waterMeterEntity.getRegionName() == null ? "" : waterMeterEntity.getRegionName());
|
|
|
+ areaCode = waterMeterEntity.getRegionCode();
|
|
|
binding.etUserAddr.setText(waterMeterEntity.getUserAddr() == null ? "" : waterMeterEntity.getUserAddr());
|
|
|
binding.edMph.setText(waterMeterEntity.getHouseNumber() == null ? "" : waterMeterEntity.getHouseNumber());
|
|
|
binding.edSbxh.setText(waterMeterEntity.getWaterMeterXh() == null ? "" : waterMeterEntity.getWaterMeterXh());
|
|
|
- binding.tvBwbh.setText(waterMeterEntity.getMeterNum() == null ? "" : waterMeterEntity.getMeterNum());
|
|
|
+ if (!TextUtils.isEmpty(waterMeterEntity.getMeterNum())) {
|
|
|
+ String[] arr = waterMeterEntity.getMeterNum().split("-");
|
|
|
+ if (arr.length == 0) {
|
|
|
+ binding.edBwbh1.setText("");
|
|
|
+ binding.spinnerBwbh.setSelection(0);
|
|
|
+ binding.edBwbh2.setText("");
|
|
|
+ } else if (arr.length == 1) {
|
|
|
+ binding.spinnerBwbh.setSelection(2);
|
|
|
+ binding.edBwbh1.setText(arr[0]);
|
|
|
+ binding.edBwbh2.setText("");
|
|
|
+ } else if (arr.length == 2) {
|
|
|
+ binding.edBwbh1.setText(arr[0]);
|
|
|
+ if (arr[1].contains("附")) {
|
|
|
+ binding.spinnerBwbh.setSelection(1);
|
|
|
+ binding.edBwbh2.setText(arr[1].replace("附", ""));
|
|
|
+ } else {
|
|
|
+ binding.spinnerBwbh.setSelection(0);
|
|
|
+ binding.edBwbh2.setText(arr[1]);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ StringBuilder bwbh1 = new StringBuilder();
|
|
|
+ for (int i = 0; i < arr.length - 1; i++) {
|
|
|
+ if (i == 0) {
|
|
|
+ bwbh1.append(arr[i]);
|
|
|
+ } else {
|
|
|
+ bwbh1.append("-").append(arr[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ binding.edBwbh1.setText(bwbh1.toString());
|
|
|
+ if (arr[arr.length - 1].contains("附")) {
|
|
|
+ binding.spinnerBwbh.setSelection(1);
|
|
|
+ binding.edBwbh2.setText(arr[arr.length - 1].replace("附", ""));
|
|
|
+ } else {
|
|
|
+ binding.spinnerBwbh.setSelection(0);
|
|
|
+ binding.edBwbh2.setText(arr[arr.length - 1]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ binding.edBwbh1.setText("");
|
|
|
+ binding.spinnerBwbh.setSelection(0);
|
|
|
+ binding.edBwbh2.setText("");
|
|
|
+ }
|
|
|
|
|
|
- binding.tvQklx.setText(waterMeterEntity.getExceptionTypeText() == null ? "" : waterMeterEntity.getExceptionTypeText());
|
|
|
- binding.tvDescribe.setText(waterMeterEntity.getExceptionDescribe() == null ? "" : waterMeterEntity.getExceptionDescribe());
|
|
|
+ if (!TextUtils.isEmpty(waterMeterEntity.getExceptionDescribe())) {
|
|
|
+ binding.edDescribe.setText(waterMeterEntity.getExceptionDescribe());
|
|
|
+ } else {
|
|
|
+ binding.edDescribe.setText("");
|
|
|
+ }
|
|
|
if (!TextUtils.isEmpty(waterMeterEntity.getExpFilePath())) {
|
|
|
for (String s : waterMeterEntity.getExpFilePath().split(",")) {
|
|
|
FileBean fileBean = new FileBean();
|
|
@@ -313,32 +527,203 @@ public class WaterCheckCorrectionFragment extends PhotoFragment {
|
|
|
photoList.add(fileBean);
|
|
|
}
|
|
|
pictureAdapter.setNewData(photoList);
|
|
|
- if (photoList.isEmpty()) {
|
|
|
- binding.rvListPhoto.setVisibility(View.GONE);
|
|
|
- } else {
|
|
|
- binding.rvListPhoto.setVisibility(View.VISIBLE);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void updateWaterMeter() {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("idCus", waterMeterEntity.getIdCus());
|
|
|
+ map.put("correctionStatus", "已整改");
|
|
|
+ if (!TextUtils.isEmpty(binding.etZgsm.getText())) {
|
|
|
+ map.put("correctionDescribe", binding.etZgsm.getText().toString());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!TextUtils.isEmpty(binding.edInternetIdCard.getText())) {
|
|
|
+ map.put("internetIdCard", binding.edInternetIdCard.getText().toString());
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(binding.edQbNum.getText())) {
|
|
|
+ map.put("qbNum", binding.edQbNum.getText().toString());
|
|
|
+ }
|
|
|
+ if (!binding.switchException.isChecked()) {
|
|
|
+ if (!TextUtils.isEmpty(binding.edWaterMeterNum.getText())) {
|
|
|
+ map.put("waterMeterNum", binding.edWaterMeterNum.getText().toString());
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(binding.edRecentMark.getText())) {
|
|
|
+ map.put("recentMark", binding.edRecentMark.getText().toString());
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(binding.edRemark.getText())) {
|
|
|
+ map.put("addressDetails", binding.edRemark.getText().toString());
|
|
|
+ }
|
|
|
+ if (locationUtilXuNew != null) {
|
|
|
+ map.put("longitude", String.valueOf(locationUtilXuNew.Longtitude));
|
|
|
+ map.put("latitude", String.valueOf(locationUtilXuNew.Latitude));
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(binding.tvAddr.getText())) {
|
|
|
+ map.put("mapLocation", binding.tvAddr.getText().toString());
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(binding.tvXzq.getText())) {
|
|
|
+ map.put("regionName", binding.tvXzq.getText().toString());
|
|
|
+ map.put("installPosition", binding.tvXzq.getText().toString());
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(areaCode)) {
|
|
|
+ map.put("regionCode", areaCode);
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(binding.etUserAddr.getText())) {
|
|
|
+ map.put("userAddr", binding.etUserAddr.getText().toString());
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(binding.edMph.getText())) {
|
|
|
+ map.put("houseNumber", binding.edMph.getText().toString());
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(binding.edSbxh.getText())) {
|
|
|
+ map.put("waterMeterXh", binding.edSbxh.getText().toString());
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(binding.edBwbh1.getText()) || !TextUtils.isEmpty(binding.edBwbh2.getText())) {
|
|
|
+ map.put("meterNum", binding.edBwbh1.getText().toString() + bwbh.replace("空", "") + binding.edBwbh2.getText().toString());
|
|
|
+ }
|
|
|
+ if (!dictEntities.isEmpty()) {
|
|
|
+ StringBuilder stringBuilder = new StringBuilder();
|
|
|
+ for (DictEntity entity : dictEntities) {
|
|
|
+ if (dictEntities.indexOf(entity) == 0) {
|
|
|
+ stringBuilder.append(entity.getId());
|
|
|
+ } else {
|
|
|
+ stringBuilder.append(",").append(entity.getId());
|
|
|
+ }
|
|
|
}
|
|
|
+ map.put("exceptionType", stringBuilder.toString());
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(binding.edDescribe.getText())) {
|
|
|
+ map.put("exceptionDescribe", binding.edDescribe.getText().toString());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (locationUtilXuNew != null) {
|
|
|
+ map.put("longitude", String.valueOf(locationUtilXuNew.Longtitude));
|
|
|
+ map.put("latitude", String.valueOf(locationUtilXuNew.Latitude));
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(binding.tvAddr.getText())) {
|
|
|
+ map.put("mapLocation", binding.tvAddr.getText().toString());
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(binding.tvXzq.getText())) {
|
|
|
+ map.put("regionName", binding.tvXzq.getText().toString());
|
|
|
+ map.put("installPosition", binding.tvXzq.getText().toString());
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(areaCode)) {
|
|
|
+ map.put("regionCode", areaCode);
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(binding.etUserAddr.getText())) {
|
|
|
+ map.put("userAddr", binding.etUserAddr.getText().toString());
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(binding.edMph.getText())) {
|
|
|
+ map.put("houseNumber", binding.edMph.getText().toString());
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(binding.edSbxh.getText())) {
|
|
|
+ map.put("waterMeterXh", binding.edSbxh.getText().toString());
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(binding.edBwbh1.getText()) || !TextUtils.isEmpty(binding.edBwbh2.getText())) {
|
|
|
+ map.put("meterNum", binding.edBwbh1.getText().toString() + bwbh.replace("空", "") + binding.edBwbh2.getText().toString());
|
|
|
+ }
|
|
|
+ if (!dictEntities.isEmpty()) {
|
|
|
+ StringBuilder stringBuilder = new StringBuilder();
|
|
|
+ for (DictEntity entity : dictEntities) {
|
|
|
+ if (dictEntities.indexOf(entity) == 0) {
|
|
|
+ stringBuilder.append(entity.getId());
|
|
|
+ } else {
|
|
|
+ stringBuilder.append(",").append(entity.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ map.put("exceptionType", stringBuilder.toString());
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(binding.edDescribe.getText())) {
|
|
|
+ map.put("exceptionDescribe", binding.edDescribe.getText().toString());
|
|
|
}
|
|
|
}
|
|
|
+ mPresenter.getResultThree(requireContext(), map);
|
|
|
}
|
|
|
|
|
|
private boolean check() {
|
|
|
+ if (TextUtils.isEmpty(binding.tvLat.getText())) {
|
|
|
+ onMessage("请选择位置");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (TextUtils.isEmpty(binding.tvXzq.getText())) {
|
|
|
+ onMessage("请选择行政区");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (TextUtils.isEmpty(binding.etUserAddr.getText())) {
|
|
|
+ binding.etUserAddr.requestFocus();
|
|
|
+ onMessage("用户地址不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (!dictEntities.isEmpty()) {
|
|
|
+ for (DictEntity dictEntity : dictEntities) {
|
|
|
+ if ("其他".equals(dictEntity.getItemText()) && TextUtils.isEmpty(binding.edDescribe.getText())) {
|
|
|
+ onMessage("描述内容不能为空");
|
|
|
+ binding.edDescribe.requestFocus();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ public void setQc(@NonNull String qc) {
|
|
|
+ switch (qcType) {
|
|
|
+ case 0:
|
|
|
+ String[] arr = qc.split("client_id");
|
|
|
+ if (arr.length > 1 && !TextUtils.isEmpty(arr[1])) {
|
|
|
+ String sbbh = arr[1].replace(":", "")
|
|
|
+ .replace("’", "")
|
|
|
+ .replace("’", "")
|
|
|
+ .replace("}", "");
|
|
|
+ binding.edInternetIdCard.setText(sbbh);
|
|
|
+ } else {
|
|
|
+ onMessage("无效二维码");
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ String[] arr1 = qc.split("node_id");
|
|
|
+ if (arr1.length > 1 && !TextUtils.isEmpty(arr1[1])) {
|
|
|
+ String sbxh = arr1[1].replace(":", "")
|
|
|
+ .replace("’", "")
|
|
|
+ .replace("’", "")
|
|
|
+ .replace("}", "");
|
|
|
+ binding.edSbxh.setText(sbxh);
|
|
|
+ } else {
|
|
|
+ onMessage("无效二维码");
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void initMapView() {
|
|
|
super.initMapView();
|
|
|
aMap.setOnMapTouchListener(motionEvent -> {
|
|
|
binding.llMap.mapView.requestDisallowInterceptTouchEvent(motionEvent.getAction() != MotionEvent.ACTION_UP);
|
|
|
- isFirst = false;
|
|
|
});
|
|
|
+ aMap.setOnCameraChangeListener(mapCameraChangeListener);
|
|
|
binding.llMap.imDrag.setVisibility(View.VISIBLE);
|
|
|
binding.llMap.imgNavit.setVisibility(View.GONE);
|
|
|
binding.llMap.imgFw.setVisibility(View.GONE);
|
|
|
- binding.llMap.imgAllScreen.setVisibility(View.GONE);
|
|
|
- binding.llMap.imgLocation.setVisibility(View.GONE);
|
|
|
- binding.llMap.imgMap.setVisibility(View.GONE);
|
|
|
+ binding.llMap.imgAllScreen.setOnClickListener(v -> {
|
|
|
+ if (MyApp.getInstance().isOverTime()) {
|
|
|
+ Intent intent = new Intent(requireContext(), LocationActivity.class);
|
|
|
+ intent.putExtra("locationUtilXuNew", locationUtilXuNew);
|
|
|
+ intent.putExtra("isRed", "1");
|
|
|
+ intent.putExtra("isDrag", true);
|
|
|
+ startActivityForResult(intent, 1105);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ binding.llMap.imgLocation.setOnClickListener(v -> {
|
|
|
+ if (MyApp.getInstance().isOverTime() && lo != null) {
|
|
|
+ moveOrigin(lo.Longtitude, lo.Latitude, aMap.getCameraPosition().zoom);
|
|
|
+ if (!TextUtils.isEmpty(lo.addr)) {
|
|
|
+ binding.tvAddr.setText(lo.addr);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
binding.llMap.imgMap.setOnClickListener(v -> checkMap());
|
|
|
if (waterMeterEntity != null && waterMeterEntity.getLatitude() != null && waterMeterEntity.getLongitude() != null) {
|
|
|
locationUtilXuNew = new LocationUtil_xu.CoordinateClass(Double.parseDouble(waterMeterEntity.getLongitude())
|
|
@@ -359,10 +744,31 @@ public class WaterCheckCorrectionFragment extends PhotoFragment {
|
|
|
@Override
|
|
|
public void initMapListener(LocationUtil_xu.CoordinateClass info, String headName, String shortName, String areaCode) {
|
|
|
super.initMapListener(info, headName, shortName, areaCode);
|
|
|
- if (!isFirst) {
|
|
|
- locationUtilXuNew = info;
|
|
|
- binding.tvLat.setText("经度:" + locationUtilXuNew.Longtitude + " 纬度:" + locationUtilXuNew.Latitude);
|
|
|
- binding.tvAddr.setText(locationUtilXuNew.addr == null ? "" : locationUtilXuNew.addr);
|
|
|
+ locationUtilXuNew = info;
|
|
|
+ binding.tvLat.setText("经度:" + locationUtilXuNew.Longtitude + " 纬度:" + locationUtilXuNew.Latitude);
|
|
|
+ binding.tvAddr.setText(locationUtilXuNew.addr == null ? "" : locationUtilXuNew.addr);
|
|
|
+ this.headName = headName;
|
|
|
+ this.shortName = shortName;
|
|
|
+ this.areaCode = areaCode;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
|
|
+ super.onActivityResult(requestCode, resultCode, data);
|
|
|
+ if (requestCode == 1105 && resultCode == 1106) {
|
|
|
+ if (data != null) {
|
|
|
+ locationUtilXuNew = (LocationUtil_xu.CoordinateClass) data.getSerializableExtra("locationUtilXuNew");
|
|
|
+ headName = data.getStringExtra("headName");
|
|
|
+ shortName = data.getStringExtra("shortName");
|
|
|
+ areaCode = data.getStringExtra("areaCode");
|
|
|
+ if (locationUtilXuNew != null) {
|
|
|
+ moveOrigin(locationUtilXuNew.Longtitude, locationUtilXuNew.Latitude, aMap.getCameraPosition().zoom);
|
|
|
+ binding.tvLat.setText("经度:" + locationUtilXuNew.Longtitude + " 纬度:" + locationUtilXuNew.Latitude);
|
|
|
+ if (!TextUtils.isEmpty(locationUtilXuNew.addr)) {
|
|
|
+ binding.tvAddr.setText(locationUtilXuNew.addr);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|