From 979d9cff22806f213b420452ab4a68fcbaf021b6 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期一, 31 五月 2021 17:43:49 +0800
Subject: [PATCH] 1. 修复多项可能引起空指针崩溃的bug; 2. 新建子任务时默认执行人员从全体人员改为当前用户; 3. 新建子任务时默认执行时间强制固定为总任务对应的时段内,确保子任务执行时间不会超出总任务范围。
---
app/src/main/java/cn/flightfeather/thirdapp/module/inspection/MenuEvidenceActivity.kt | 19 ++++++++++++-------
1 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/module/inspection/MenuEvidenceActivity.kt b/app/src/main/java/cn/flightfeather/thirdapp/module/inspection/MenuEvidenceActivity.kt
index 147f1b7..b128573 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/module/inspection/MenuEvidenceActivity.kt
+++ b/app/src/main/java/cn/flightfeather/thirdapp/module/inspection/MenuEvidenceActivity.kt
@@ -12,7 +12,7 @@
import cn.flightfeather.thirdapp.R
import cn.flightfeather.thirdapp.adapter.DomainItemListAdapter
import cn.flightfeather.thirdapp.adapter.ProblemTypeListAdapter
-import cn.flightfeather.thirdapp.bean.*
+import cn.flightfeather.thirdapp.bean.entity.*
import cn.flightfeather.thirdapp.model.event.ProblemEvent
import cn.flightfeather.thirdapp.module.base.BaseTakePicActivity
import cn.flightfeather.thirdapp.util.DateFormatter
@@ -135,8 +135,13 @@
viewModel.suggestionList.observe(this, Observer {
it.let {
sp_take_evidence_select_suggestion.adapter = ArrayAdapter(this, R.layout.item_spinner_drop_down, it)
+ onSuggestionLoaded()
}
})
+ }
+
+ open fun onSuggestionLoaded() {
+
}
protected fun updateUIByProblemType(visible: Int) {
@@ -153,7 +158,7 @@
toast("褰撳墠宸℃煡鐘舵�侀敊璇紝鏃犳硶涓婁紶闂锛岃灏濊瘯閲嶆柊鍚姩")
}
- val problemType = sp_take_evidence_select_problem_type.selectedItem.toString()
+ val problemType = sp_take_evidence_select_problem_type.selectedItem?.toString()
val pro = Problemlist().apply {
guid = UUIDGenerator.generate16ShortUUID()
@@ -166,26 +171,26 @@
val p = sp_take_evidence_select_problem.selectedItem
if (p is Problemtype) {
ptguid = p.guid
- var problemDes = et_take_evidence_problem_des.text.toString()
+ var problemDes = et_take_evidence_problem_des?.text.toString()
if (problemDes.isNotEmpty()) {
problemDes = "($problemDes)"
}
problemname = p.name + problemDes
}
- var adviceDes = et_take_evidence_suggestion.text.toString()
+ var adviceDes = et_take_evidence_suggestion?.text.toString()
if (adviceDes.isNotEmpty()) {
adviceDes = "($adviceDes)"
}
- advise = sp_take_evidence_select_suggestion.selectedItem.toString() + adviceDes
+ advise = sp_take_evidence_select_suggestion.selectedItem?.toString() + adviceDes
latitude = lat
longitude = lng
val l = sp_take_evidence_select_location.selectedItem
if (l is Domainitem) {
if (problemType != "鎬佸害") {
- var locationRemark = et_take_evidence_location.text.toString()
- if (locationRemark.isNotEmpty()) {
+ var locationRemark = et_take_evidence_location.text?.toString()
+ if (locationRemark?.isNotEmpty() == true) {
locationRemark = "($locationRemark)"
}
locationid = l.index.toByte()
--
Gitblit v1.9.3