1、修改问题描述2、修改定位适配较低系统

This commit is contained in:
qiji4215 2023-06-28 11:13:03 +08:00
parent 2c9c20e913
commit f6b4c7543a
5 changed files with 53 additions and 47 deletions

View File

@ -38,8 +38,8 @@ data class EvaluationInfo(
@SerializedName("problemLink")
val problemLink: String = "",//问题环节
@SerializedName("problemReason")
val problemReason: String = "",//问题原因
@SerializedName("preliminaryAnalysis")
val preliminaryAnalysis: String = "",//初步分析
@SerializedName("evaluatorName")
val evaluatorName: String = "",//测评人名称

View File

@ -151,7 +151,7 @@ class TaskUploadScope(
problemPhenomenon = it.phenomenon,
problemDesc = it.description,
problemLink = it.problemLink,
problemReason = it.cause,
preliminaryAnalysis = it.cause,
evaluatorName = it.checkUserId,
evaluationDate = it.checkTime,
evaluationWay = evaluationWay,
@ -178,7 +178,7 @@ class TaskUploadScope(
problemPhenomenon = "",
problemDesc = "",
problemLink = "",
problemReason = "",
preliminaryAnalysis = "",
evaluatorName = "",
evaluationDate = "",
evaluationWay = 2,

View File

@ -4,6 +4,7 @@ import android.content.Context
import android.graphics.Color
import android.os.Build
import android.widget.Toast
import androidx.annotation.RequiresApi
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
@ -95,18 +96,21 @@ class TaskViewModel @Inject constructor(
}
}
}
is NetResult.Error<*> -> {
withContext(Dispatchers.Main) {
Toast.makeText(context, "${result.exception.message}", Toast.LENGTH_SHORT)
.show()
}
}
is NetResult.Failure<*> -> {
withContext(Dispatchers.Main) {
Toast.makeText(context, "${result.code}:${result.msg}", Toast.LENGTH_SHORT)
.show()
}
}
is NetResult.Loading -> {}
}
val realm = Realm.getDefaultInstance()
@ -139,41 +143,42 @@ class TaskViewModel @Inject constructor(
/**
* 设置当前选择的任务并高亮当前任务的所有link
*/
@RequiresApi(Build.VERSION_CODES.M)
fun setSelectTaskBean(taskBean: TaskBean) {
currentSelectTaskBean = taskBean
liveDataTaskLinks.value = taskBean.hadLinkDvoList
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
mapController.lineHandler.omdbTaskLinkLayer.removeAll()
if(taskBean.hadLinkDvoList.isNotEmpty()){
mapController.lineHandler.omdbTaskLinkLayer.addLineList(taskBean.hadLinkDvoList)
var maxX = 0.0
var maxY = 0.0
var minX = 0.0
var minY = 0.0
for (item in taskBean.hadLinkDvoList) {
val geometry = GeometryTools.createGeometry(item.geometry)
if(geometry!=null){
val envelope = geometry.envelopeInternal
if (envelope.maxX > maxX) {
maxX = envelope.maxX
}
if (envelope.maxY > maxY) {
maxY = envelope.maxY
}
if (envelope.minX < minX || minX == 0.0) {
minX = envelope.minX
}
if (envelope.minY < minY || minY == 0.0) {
minY = envelope.minY
}
mapController.lineHandler.omdbTaskLinkLayer.removeAll()
if (taskBean.hadLinkDvoList.isNotEmpty()) {
mapController.lineHandler.omdbTaskLinkLayer.addLineList(taskBean.hadLinkDvoList)
var maxX = 0.0
var maxY = 0.0
var minX = 0.0
var minY = 0.0
for (item in taskBean.hadLinkDvoList) {
val geometry = GeometryTools.createGeometry(item.geometry)
if (geometry != null) {
val envelope = geometry.envelopeInternal
if (envelope.maxX > maxX) {
maxX = envelope.maxX
}
if (envelope.maxY > maxY) {
maxY = envelope.maxY
}
if (envelope.minX < minX || minX == 0.0) {
minX = envelope.minX
}
if (envelope.minY < minY || minY == 0.0) {
minY = envelope.minY
}
}
//增加异常数据判断
if(maxX!=0.0&&maxY!=0.0&&minX!=0.0&&minY!=0.0){
mapController.animationHandler.animateToBox(
maxX = maxX, maxY = maxY, minX = minX, minY = minY
)
}
}
//增加异常数据判断
if (maxX != 0.0 && maxY != 0.0 && minX != 0.0 && minY != 0.0) {
mapController.animationHandler.animateToBox(
maxX = maxX, maxY = maxY, minX = minX, minY = minY
)
}
}
}
@ -181,20 +186,20 @@ class TaskViewModel @Inject constructor(
/**
* 高亮当前选中的link
*/
@RequiresApi(Build.VERSION_CODES.M)
fun showCurrentLink(link: HadLinkDvoBean) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
mapController.lineHandler.omdbTaskLinkLayer.showSelectLine(link)
val geometry = GeometryTools.createGeometry(link.geometry)
if(geometry!=null){
val envelope = geometry.envelopeInternal
mapController.animationHandler.animateToBox(
maxX = envelope.maxX,
maxY = envelope.maxY,
minX = envelope.minX,
minY = envelope.minY
)
}
mapController.lineHandler.omdbTaskLinkLayer.showSelectLine(link)
val geometry = GeometryTools.createGeometry(link.geometry)
if (geometry != null) {
val envelope = geometry.envelopeInternal
mapController.animationHandler.animateToBox(
maxX = envelope.maxX,
maxY = envelope.maxY,
minX = envelope.minX,
minY = envelope.minY
)
}
}
override fun onCleared() {

View File

@ -167,7 +167,7 @@
<TextView
style="@style/evaluation_fragment_title_text_style"
android:text="问题原因" />
android:text="初步分析" />
<TextView
android:id="@+id/evaluation_cause"

View File

@ -50,6 +50,7 @@ open class QsRecordBean @JvmOverloads constructor(
* 问题环节
*/
var problemLink: String = "",
/**
* 问题原因
* 根本原因RCA