From 29c6cb0031e3d1aac2e326b3a83fa78bcd380890 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期一, 21 十二月 2020 10:57:07 +0800
Subject: [PATCH] 1. 修改巡查界面刚进入快速点击巡查功能按钮导致崩溃问题; 2. 修复技防措施的地址记录信息有加号的问题

---
 app/src/main/java/cn/flightfeather/thirdapp/module/inspection/InspectionDetailViewModel.kt |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/app/src/main/java/cn/flightfeather/thirdapp/module/inspection/InspectionDetailViewModel.kt b/app/src/main/java/cn/flightfeather/thirdapp/module/inspection/InspectionDetailViewModel.kt
index 4db8edd..fc26e00 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/module/inspection/InspectionDetailViewModel.kt
+++ b/app/src/main/java/cn/flightfeather/thirdapp/module/inspection/InspectionDetailViewModel.kt
@@ -117,21 +117,24 @@
             }
         }
 
-        updateSubTask()
-        updateInspection(inspection.value)
-
-        //鏇存柊鐣岄潰
-        subTask.value = subTask.value
+        updateSubTask {
+            //鏇存柊鐣岄潰
+            subTask.value = subTask.value
+        }
     }
 
     /**
      * 鏇存柊瀛愪换鍔�
      */
-    fun updateSubTask() {
+    fun updateSubTask(s: () -> Unit) {
         subTask.value?.let {
             inspectionRepository.updateSubTask(it, object : ResultCallBack<String> {
                 override fun onSuccess(result: String?) {
-
+                    result?.let {
+                        updateInspection(inspection.value){
+                            s()
+                        }
+                    }
                 }
 
                 override fun onFailure() {
@@ -145,11 +148,11 @@
     /**
      * 鏇存柊宸℃煡淇℃伅
      */
-    fun updateInspection(inspection: Inspection?) {
+    fun updateInspection(inspection: Inspection?, s: () -> Unit = {}) {
         inspection?.let {
             inspectionRepository.updateInspection(it, object : ResultCallBack<ResponseBody> {
                 override fun onSuccess(result: ResponseBody?) {
-
+                    result?.let { s() }
                 }
 
                 override fun onFailure() {

--
Gitblit v1.9.3