浏览代码

添加有户无表界面

ychk 5 月之前
父节点
当前提交
9cee72d3f6

+ 1 - 0
app/build.gradle

@@ -107,6 +107,7 @@ dependencies {
     implementation 'cn.jzvd:jiaozivideoplayer:7.7.0'
     implementation 'tv.danmaku.ijk.media:ijkplayer-java:0.8.8'
     implementation 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.8'
+    implementation 'com.kyleduo.switchbutton:library:1.4.1'
 
     //内存泄露
     //   debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'

+ 25 - 11
app/src/main/java/com/tofly/yxpc/entity/SbdjEntity.java

@@ -10,6 +10,7 @@ import org.greenrobot.greendao.annotation.Id;
 import java.util.List;
 
 import org.greenrobot.greendao.annotation.Generated;
+import org.greenrobot.greendao.annotation.Transient;
 
 @Entity
 public class SbdjEntity {
@@ -38,6 +39,9 @@ public class SbdjEntity {
     private String batch;
     private String userNum;
     private String userName;
+    /**
+     * 水表表身号
+     */
     private String waterMeterNum;
     private String waterMeterCaliber;
     private String useWaterProperties;
@@ -97,20 +101,22 @@ public class SbdjEntity {
      */
     @JSONField(serialize = false)
     private boolean isOnline;
+    @Transient
+    private String inspectUserName;
 
     @Generated(hash = 1077158174)
     public SbdjEntity(Long id, String type, String describe, String position,
-            String longitude, String latitude, String batch, String userNum,
-            String userName, String waterMeterNum, String waterMeterCaliber,
-            String useWaterProperties, String qbNum, String userAddr,
-            String createTime, String waterType, String createUser,
-            String internetIdCard, String installPosition, String brand,
-            String installTime, String recentMark, String checkUser,
-            String inspectTime, String inspect_user, String checkId,
-            List<FileBean> fileList, List<FileBean> bpFileList,
-            String addressDetails, String waterMeterXh, String meterNum,
-            String waterMeterRange, String regionName, String regionCode,
-            String houseNumber, boolean isOnline) {
+                      String longitude, String latitude, String batch, String userNum,
+                      String userName, String waterMeterNum, String waterMeterCaliber,
+                      String useWaterProperties, String qbNum, String userAddr,
+                      String createTime, String waterType, String createUser,
+                      String internetIdCard, String installPosition, String brand,
+                      String installTime, String recentMark, String checkUser,
+                      String inspectTime, String inspect_user, String checkId,
+                      List<FileBean> fileList, List<FileBean> bpFileList,
+                      String addressDetails, String waterMeterXh, String meterNum,
+                      String waterMeterRange, String regionName, String regionCode,
+                      String houseNumber, boolean isOnline) {
         this.id = id;
         this.type = type;
         this.describe = describe;
@@ -448,4 +454,12 @@ public class SbdjEntity {
     public void setInspectTime(String inspectTime) {
         this.inspectTime = inspectTime;
     }
+
+    public String getInspectUserName() {
+        return inspectUserName;
+    }
+
+    public void setInspectUserName(String inspectUserName) {
+        this.inspectUserName = inspectUserName;
+    }
 }

+ 43 - 0
app/src/main/java/com/tofly/yxpc/ui/adapter/DataUnregisterSubmitAdapter.java

@@ -0,0 +1,43 @@
+package com.tofly.yxpc.ui.adapter;
+
+import androidx.annotation.Nullable;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.tofly.yxpc.R;
+import com.tofly.yxpc.entity.DictEntity;
+import com.tofly.yxpc.entity.SbdjEntity;
+import com.tofly.yxpc.greenDao.DictEntityDao;
+import com.tofly.yxpc.utils.db.DaoUtilsStore;
+
+import java.util.List;
+
+public class DataUnregisterSubmitAdapter extends BaseQuickAdapter<SbdjEntity, BaseViewHolder> {
+
+    public DataUnregisterSubmitAdapter(@Nullable List<SbdjEntity> data) {
+        super(R.layout.item_data_unregister_submit, data);
+    }
+
+    @Override
+    protected void convert(BaseViewHolder helper, SbdjEntity item) {
+        helper.setBackgroundRes(R.id.img_type, R.mipmap.icon_data_unregister);
+        List<DictEntity> dictEntities = DaoUtilsStore.getInstance().getDictEntityDbUtils().queryByQueryBuilder(DictEntityDao.Properties.DictCode.eq("noregistered_type"));
+        for (DictEntity dictEntity : dictEntities) {
+            if (dictEntity.getId().equals(item.getType())) {
+                helper.setText(R.id.tv_title, dictEntity.getItemText() == null ? "" : dictEntity.getItemText());
+                break;
+            }
+        }
+        helper.setText(R.id.tv_people, item.getInspectUserName() == null ? "" : item.getInspectUserName());
+        helper.setText(R.id.tv_time, item.getInspectTime() == null ? "" : item.getInspectTime().subSequence(5, item.getInspectTime().length() - 3));
+        helper.setBackgroundRes(R.id.img_state, R.mipmap.icon_submit);
+
+        helper.setGone(R.id.ll, false);
+        helper.setText(R.id.tv, "地址:");
+        helper.setText(R.id.tv_table_number, item.getUserAddr() == null ? "" : item.getUserAddr());
+
+        helper.setText(R.id.tv_tvname2, "说明:");
+        helper.setText(R.id.tv_object_type, item.getWaterMeterNum() == null ? "" : ("【" + item.getWaterMeterNum() + "】") + (item.getDescribe() == null ? "" : item.getDescribe()));
+
+    }
+}

+ 1 - 0
app/src/main/java/com/tofly/yxpc/ui/fragment/DataUnregisterFragment.java

@@ -18,6 +18,7 @@ import com.tofly.yxpc.entity.SbdjEntity;
 import com.tofly.yxpc.greenDao.BaseUpdataEntityDao;
 import com.tofly.yxpc.ui.activity.UnRegisterActivity;
 import com.tofly.yxpc.ui.adapter.DataCheckAdapter;
+import com.tofly.yxpc.ui.adapter.DataUnregisterSubmitAdapter;
 import com.tofly.yxpc.ui.impl.DataUnregisterImpl;
 import com.tofly.yxpc.utils.DateUtils;
 import com.tofly.yxpc.utils.DialogDateUtils;

+ 0 - 33
app/src/main/java/com/tofly/yxpc/ui/fragment/DataUnregisterSubmitAdapter.java

@@ -1,33 +0,0 @@
-package com.tofly.yxpc.ui.fragment;
-
-import androidx.annotation.Nullable;
-
-import com.chad.library.adapter.base.BaseQuickAdapter;
-import com.chad.library.adapter.base.BaseViewHolder;
-import com.tofly.yxpc.R;
-import com.tofly.yxpc.entity.SbdjEntity;
-
-import java.util.List;
-
-public class DataUnregisterSubmitAdapter extends BaseQuickAdapter<SbdjEntity, BaseViewHolder> {
-
-    public DataUnregisterSubmitAdapter(@Nullable List<SbdjEntity> data) {
-        super(R.layout.item_data_check, data);
-    }
-
-    @Override
-    protected void convert(BaseViewHolder helper, SbdjEntity item) {
-        helper.setBackgroundRes(R.id.img_type, R.mipmap.icon_data_unregister);
-        helper.setText(R.id.tv, "描述:");
-        helper.setText(R.id.tv_tvname2, "地址:");
-        helper.setText(R.id.tv_table_number, item.getDescribe() == null ? "" : item.getDescribe());
-        helper.setText(R.id.tv_electronic_identity, item.getDescribe() == null ? "" : item.getDescribe());
-        helper.setGone(R.id.ll, false);
-
-        helper.setText(R.id.tv_title, item.getUserName() == null ? "" : item.getUserName());
-        helper.setText(R.id.tv_object_type, item.getUserAddr() == null ? "" : item.getUserAddr());
-        helper.setText(R.id.tv_time, item.getInspectTime() == null ? "" : item.getInspectTime().subSequence(5, item.getInspectTime().length() - 3));
-        helper.setBackgroundRes(R.id.img_state, R.mipmap.icon_submit);
-
-    }
-}

+ 1 - 0
app/src/main/java/com/tofly/yxpc/ui/fragment/UnCalibrateFragment.java

@@ -519,6 +519,7 @@ public class UnCalibrateFragment extends PhotoFragment {
             waterMeterEntity.setLatitude(String.valueOf(locationUtilXuNew.Latitude));
         }
         waterMeterEntity.setRegionName(binding.tvXzq.getText().toString());
+        waterMeterEntity.setInstallPosition(binding.tvXzq.getText().toString());
         waterMeterEntity.setRegionCode(areaCode);
         waterMeterEntity.setUserAddr(binding.etUserAddr.getText().toString());
         waterMeterEntity.setHouseNumber(binding.edMph.getText().toString());

+ 9 - 0
app/src/main/java/com/tofly/yxpc/ui/fragment/WaterCheckFragment.java

@@ -409,6 +409,14 @@ public class WaterCheckFragment extends PhotoFragment {
         binding.tvCopyWater.setOnClickListener(v -> {
             loadHistory();
         });
+
+        binding.switchException.setOnCheckedChangeListener((buttonView, isChecked) -> {
+            if (isChecked) {
+
+            } else {
+
+            }
+        });
     }
 
     private void loadHistory() {
@@ -844,6 +852,7 @@ public class WaterCheckFragment extends PhotoFragment {
             waterMeterEntity.setLatitude(String.valueOf(locationUtilXuNew.Latitude));
         }
         waterMeterEntity.setRegionName(binding.tvXzq.getText().toString());
+        waterMeterEntity.setInstallPosition(binding.tvXzq.getText().toString());
         waterMeterEntity.setRegionCode(areaCode);
         waterMeterEntity.setUserAddr(binding.etUserAddr.getText().toString());
         waterMeterEntity.setHouseNumber(binding.edMph.getText().toString());

+ 6 - 0
app/src/main/res/drawable/check_red_gray.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:color="@color/line_gray" android:state_checked="false" />
+    <item android:color="@color/red1" android:state_checked="true" />
+</selector>

+ 54 - 1
app/src/main/res/layout/fragment_water_check.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout 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="match_parent">
@@ -307,6 +308,43 @@
 
             </LinearLayout>
 
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/dp_10"
+                android:layout_marginTop="@dimen/dp_14"
+                android:layout_marginEnd="@dimen/dp_10"
+                android:layout_marginBottom="@dimen/dp_13"
+                android:orientation="horizontal">
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="有户无表"
+                    android:textColor="@color/color_333"
+                    android:textSize="@dimen/sp_16" />
+
+                <View
+                    android:layout_width="0dp"
+                    android:layout_height="@dimen/dp_1"
+                    android:layout_weight="1" />
+
+                <com.kyleduo.switchbutton.SwitchButton
+                    android:id="@+id/switch_exception"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginEnd="@dimen/dp_10"
+                    app:kswBackColor="@drawable/check_red_gray"
+                    app:kswThumbColor="@color/white" />
+            </LinearLayout>
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/dp_1"
+                android:layout_marginStart="@dimen/dp_10"
+                android:layout_marginEnd="@dimen/dp_10"
+                android:background="@color/line_gray" />
+
             <CheckBox
                 android:id="@+id/cb_detail"
                 android:layout_width="match_parent"
@@ -568,9 +606,23 @@
                         android:textColor="@color/color_333"
                         android:textSize="@dimen/sp_16" />
 
+                    <View
+                        android:layout_width="0dp"
+                        android:layout_height="@dimen/dp_1"
+                        android:layout_weight="1" />
+
+                    <TextView
+                        android:id="@+id/tv_old_recent_mark"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginStart="@dimen/dp_10"
+                        android:textColor="@color/color_333"
+                        android:textSize="@dimen/sp_16"
+                        tools:text="0" />
+
                     <EditText
                         android:id="@+id/ed_recent_mark"
-                        android:layout_width="match_parent"
+                        android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_marginStart="@dimen/dp_10"
                         android:background="@null"
@@ -578,6 +630,7 @@
                         android:drawablePadding="@dimen/dp_10"
                         android:gravity="end"
                         android:inputType="number"
+                        android:minWidth="@dimen/dp_100"
                         android:text="0"
                         android:textColor="@color/color_333"
                         android:textColorHint="@color/color_333"

+ 145 - 0
app/src/main/res/layout/item_data_unregister_submit.xml

@@ -0,0 +1,145 @@
+<?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="match_parent"
+    android:layout_height="wrap_content"
+    android:layout_marginBottom="@dimen/dp_10"
+    android:background="@drawable/bg_white6">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="vertical">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:gravity="center_vertical"
+            android:minHeight="@dimen/dp_50"
+            android:orientation="horizontal">
+
+            <ImageView
+                android:id="@+id/img_type"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginEnd="@dimen/dp_10"
+                android:background="@mipmap/icon_data_normal" />
+
+            <TextView
+                android:id="@+id/tv_title"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:textColor="@color/black"
+                android:textSize="@dimen/sp_20"
+                tools:text="物业管理公司" />
+
+            <TextView
+                android:id="@+id/tv_people"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/dp_5"
+                android:textColor="@color/color_888"
+                android:textSize="@dimen/sp_16"
+                tools:text="张三" />
+
+            <TextView
+                android:id="@+id/tv_time"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/dp_5"
+                android:layout_marginEnd="@dimen/dp_10"
+                android:textColor="@color/color_888"
+                android:textSize="@dimen/sp_16"
+                tools:text="06-27 11:12:40" />
+        </LinearLayout>
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/dp_1"
+            android:background="@color/line_gray" />
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/dp_12"
+            android:layout_marginBottom="@dimen/dp_10"
+            android:orientation="horizontal"
+            android:paddingHorizontal="@dimen/dp_10">
+
+            <TextView
+                android:id="@+id/tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="水表编号:"
+                android:textColor="@color/color_999"
+                android:textSize="@dimen/sp_18" />
+
+            <TextView
+                android:id="@+id/tv_table_number"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:textColor="@color/color_333"
+                android:textSize="@dimen/sp_18"
+                tools:text="CH093231500" />
+        </LinearLayout>
+
+        <LinearLayout
+            android:id="@+id/ll"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal"
+            android:paddingHorizontal="@dimen/dp_10">
+
+            <TextView
+                android:id="@+id/tv_tvname1"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="电子身份:"
+                android:textColor="@color/color_999"
+                android:textSize="@dimen/sp_18" />
+
+            <TextView
+                android:id="@+id/tv_electronic_identity"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:textColor="@color/color_333"
+                android:textSize="@dimen/sp_18"
+                tools:text="F6D5200D" />
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginVertical="@dimen/dp_10"
+            android:orientation="horizontal"
+            android:paddingHorizontal="@dimen/dp_10">
+
+            <TextView
+                android:id="@+id/tv_tvname2"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="对象类型:"
+                android:textColor="@color/color_999"
+                android:textSize="@dimen/sp_18" />
+
+            <TextView
+                android:id="@+id/tv_object_type"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:textColor="@color/color_333"
+                android:textSize="@dimen/sp_18"
+                tools:text="水表" />
+        </LinearLayout>
+    </LinearLayout>
+
+    <ImageView
+        android:id="@+id/img_state"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentEnd="true"
+        android:layout_marginTop="@dimen/dp_60"
+        android:layout_marginEnd="@dimen/dp_10"
+        android:background="@mipmap/icon_draft" />
+
+</RelativeLayout>