Browse Source

no message

ychk 1 week ago
parent
commit
69f23d9c53

+ 24 - 6
app/src/main/java/com/tofly/yxpc/ui/activity/AddMeterBoxActivity.java

@@ -161,13 +161,23 @@ public class AddMeterBoxActivity extends LatteActivity {
     }
 
     private void getWater() {
-        Map<String, Object> map = new HashMap<>();
-        if (type == 0) {
-            map.put("userNum", binding.etSearch.getText().toString());
+        if (!TextUtils.isEmpty(binding.etSearch.getText())) {
+            Map<String, Object> map = new HashMap<>();
+            if (type == 0) {
+                map.put("userNum", binding.etSearch.getText().toString());
+            } else {
+                map.put("waterMeterNum", binding.etSearch.getText().toString());
+            }
+            mPresenter.getResultOne(this, map);
         } else {
-            map.put("waterMeterNum", binding.etSearch.getText().toString());
+            if (scanType == 0) {
+                onMessage("请输入用户编号");
+            } else {
+                onMessage("请输入表身号");
+            }
+            binding.etSearch.requestFocus();
+            binding.llInfo.setVisibility(GONE);
         }
-        mPresenter.getResultOne(this, map);
     }
 
     public void setQc(String qc) {
@@ -180,13 +190,13 @@ public class AddMeterBoxActivity extends LatteActivity {
                             .replace("’", "")
                             .replace("}", "");
                     binding.etSearch.setText(sbbh);
-                    getWater();
                 } else {
                     onMessage("无效二维码");
                 }
             } else {
                 onMessage("未识别到用户编号");
             }
+            getWater();
         } else {
             if (!TextUtils.isEmpty(qc)) {
                 String[] arr = qc.split("node_id");
@@ -231,8 +241,16 @@ public class AddMeterBoxActivity extends LatteActivity {
             binding.tvMph.setText(waterMeter.getHouseNumber() == null ? "" : waterMeter.getHouseNumber());
             binding.etSbxh.setText(waterMeter.getWaterMeterXh() == null ? "" : waterMeter.getWaterMeterXh());
             binding.tvBwbh.setText(waterMeter.getMeterNum() == null ? "" : waterMeter.getMeterNum());
+            if (waterMeter.getYxswWaterTaskDetails() != null && !waterMeter.getYxswWaterTaskDetails().isEmpty() && waterMeter.getYxswWaterTaskDetails().get(0) != null) {
+                binding.tvJcr.setText(waterMeter.getYxswWaterTaskDetails().get(0).getInspectUserName() == null ? "" : waterMeter.getYxswWaterTaskDetails().get(0).getInspectUserName());
+                binding.tvJcsj.setText(waterMeter.getYxswWaterTaskDetails().get(0).getInspectTime() == null ? "" : waterMeter.getYxswWaterTaskDetails().get(0).getInspectTime());
+            } else {
+                binding.tvJcr.setText("");
+                binding.tvJcsj.setText("");
+            }
         } else {
             binding.llInfo.setVisibility(INVISIBLE);
+            onMessage("未找到数据");
         }
     }
 

+ 77 - 2
app/src/main/res/layout/activity_add_meter_box.xml

@@ -76,13 +76,14 @@
         android:layout_margin="@dimen/dp_10"
         android:background="@drawable/bg_white_6"
         android:orientation="vertical"
-        android:visibility="invisible">
+        android:visibility="gone">
 
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_marginHorizontal="@dimen/dp_10"
             android:layout_marginTop="@dimen/dp_10"
+            android:gravity="center_vertical"
             android:orientation="horizontal">
 
             <TextView
@@ -125,6 +126,7 @@
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_marginTop="@dimen/dp_10"
+            android:gravity="center_vertical"
             android:orientation="horizontal"
             android:paddingHorizontal="@dimen/dp_20">
 
@@ -155,6 +157,7 @@
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
+            android:gravity="center_vertical"
             android:orientation="horizontal"
             android:paddingHorizontal="@dimen/dp_20">
 
@@ -194,6 +197,7 @@
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
+            android:gravity="center_vertical"
             android:orientation="horizontal"
             android:paddingHorizontal="@dimen/dp_20"
             android:paddingVertical="@dimen/dp_10">
@@ -216,7 +220,7 @@
                 android:inputType="number"
                 android:maxLength="15"
                 android:textColor="@color/red"
-                android:textSize="@dimen/sp_15"
+                android:textSize="@dimen/sp_18"
                 tools:text="1254" />
 
             <ImageView
@@ -237,6 +241,7 @@
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
+            android:gravity="center_vertical"
             android:orientation="horizontal"
             android:paddingHorizontal="@dimen/dp_20">
 
@@ -258,6 +263,76 @@
                 tools:text="4-4" />
         </LinearLayout>
 
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/dp_1"
+            android:layout_margin="@dimen/dp_10"
+            android:background="@color/line_gray" />
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:gravity="center_vertical"
+            android:orientation="horizontal"
+            android:paddingHorizontal="@dimen/dp_20">
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="员"
+                android:textColor="@color/color_555"
+                android:textSize="@dimen/sp_15"
+                android:visibility="invisible" />
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="稽查人"
+                android:textColor="@color/color_555"
+                android:textSize="@dimen/sp_15" />
+
+            <TextView
+                android:id="@+id/tv_jcr"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/dp_10"
+                android:gravity="end"
+                android:textColor="@color/color_333"
+                android:textSize="@dimen/sp_15"
+                tools:text="张三" />
+        </LinearLayout>
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/dp_1"
+            android:layout_margin="@dimen/dp_10"
+            android:background="@color/line_gray" />
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:gravity="center_vertical"
+            android:orientation="horizontal"
+            android:paddingHorizontal="@dimen/dp_20">
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="稽查时间"
+                android:textColor="@color/color_555"
+                android:textSize="@dimen/sp_15" />
+
+            <TextView
+                android:id="@+id/tv_jcsj"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/dp_10"
+                android:gravity="end"
+                android:textColor="@color/color_333"
+                android:textSize="@dimen/sp_15"
+                tools:text="2025-04-01" />
+        </LinearLayout>
+
         <View
             android:layout_width="match_parent"
             android:layout_height="@dimen/dp_1"