1、问题记录增加要素编码存储2.回传问题增加未测评判断业务

This commit is contained in:
qiji4215 2023-06-29 17:16:36 +08:00
parent b9d85640aa
commit 827e6b31b8
5 changed files with 36 additions and 17 deletions

View File

@ -30,8 +30,8 @@ interface ScProblemTypeDao {
/**
* 获取问题分类并去重
*/
@Query("select DISTINCT CLASS_TYPE from ScProblemType order by CLASS_TYPE")
suspend fun findClassTypeList(): List<String>?
@Query("select * from ScProblemType group by CLASS_TYPE")
suspend fun findClassTypeList(): List<ScProblemTypeBean>?
@Query("select DISTINCT CLASS_TYPE from ScProblemType where ELEMENT_CODE=:code")
suspend fun findClassTypeByCode(code: Int): String?

View File

@ -146,7 +146,7 @@ class TaskUploadScope(
markId = hadLinkDvoBean.mesh,//"20065597"
trackPhotoNumber = "",
markGeometry = it.geometry,
featureName = it.classType,
featureName = it.classCode,
problemType = problemType,
problemPhenomenon = it.phenomenon,
problemDesc = it.description,
@ -166,10 +166,17 @@ class TaskUploadScope(
bodyList.add(evaluationInfo)
}
}else{
val linkStatus = 1
//存在原因标记未测评
if(hadLinkDvoBean.reason.isNotEmpty()){
val linkStatus = 0
}else{
val linkStatus = 1
}
val evaluationInfo = EvaluationInfo(
evaluationTaskId = taskBean.id.toString(),
linkPid = hadLinkDvoBean.linkPid,//"84207223282277331"
linkStatus = 0,
linkStatus = linkStatus,
markId = hadLinkDvoBean.mesh,//"20065597"
trackPhotoNumber = "",
markGeometry = "",
@ -184,7 +191,7 @@ class TaskUploadScope(
evaluationWay = 2,
roadClassfcation = "",
roadFunctionGrade = "",
noEvaluationreason = "",
noEvaluationreason = hadLinkDvoBean.reason,
linkLength = 0.0,
dataLevel = "",
linstringLength = 0.0,

View File

@ -26,6 +26,7 @@ import com.navinfo.collect.library.utils.GeometryTools
import com.navinfo.omqs.Constant
import com.navinfo.omqs.R
import com.navinfo.omqs.bean.ChatMsgEntity
import com.navinfo.omqs.bean.ScProblemTypeBean
import com.navinfo.omqs.bean.SignBean
import com.navinfo.omqs.db.RealmOperateHelper
import com.navinfo.omqs.db.RoomAppDatabase
@ -65,7 +66,7 @@ class EvaluationResultViewModel @Inject constructor(
/**
* 问题分类 liveData[LeftAdapter]展示的数据
*/
val liveDataLeftTypeList = MutableLiveData<List<String>>()
val liveDataLeftTypeList = MutableLiveData<List<ScProblemTypeBean>>()
/**
* 问题类型 liveData [MiddleAdapter]展示的数据
@ -95,6 +96,8 @@ class EvaluationResultViewModel @Inject constructor(
var classTypeTemp: String = ""
var classCodeTemp: String = ""
init {
liveDataQsRecordBean.value = QsRecordBean(id = UUID.randomUUID().toString())
viewModelScope.launch {
@ -194,22 +197,24 @@ class EvaluationResultViewModel @Inject constructor(
list?.let {
if (list.isNotEmpty()) {
//通知页面更新
var classType = list[0]
var classType = list[0].classType
var classCode = list[0].elementCode
liveDataLeftTypeList.postValue(it)
if (bean != null) {
val classType2 = roomAppDatabase.getScProblemTypeDao()
.findClassTypeByCode(bean.renderEntity.code)
val classType2 = roomAppDatabase.getScProblemTypeDao().findClassTypeByCode(bean.renderEntity.code)
if (classType2 != null) {
classType = classType2
}
}
//如果右侧栏没数据,给个默认值
if (liveDataQsRecordBean.value!!.classType.isEmpty()) {
liveDataQsRecordBean.value!!.classType = classType
liveDataQsRecordBean.value!!.classCode = classCode
classTypeTemp = classType
classCodeTemp = classCode
} else {
classType = liveDataQsRecordBean.value!!.classType
classCode = liveDataQsRecordBean.value!!.classCode
}
getProblemList(classType)
}
@ -298,6 +303,7 @@ class EvaluationResultViewModel @Inject constructor(
*/
fun setPhenomenonMiddleBean(adapterBean: RightBean) {
liveDataQsRecordBean.value!!.classType = classTypeTemp
liveDataQsRecordBean.value!!.classCode = classCodeTemp
liveDataQsRecordBean.value!!.phenomenon = adapterBean.text
liveDataQsRecordBean.value!!.problemType = adapterBean.title
liveDataQsRecordBean.postValue(liveDataQsRecordBean.value)

View File

@ -5,12 +5,13 @@ import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.annotation.RequiresApi
import com.navinfo.omqs.R
import com.navinfo.omqs.bean.ScProblemTypeBean
import com.navinfo.omqs.databinding.TextItemSelectBinding
import com.navinfo.omqs.ui.other.BaseRecyclerViewAdapter
import com.navinfo.omqs.ui.other.BaseViewHolder
class LeftAdapter(private var itemListener: ((Int, String) -> Unit?)? = null) :
BaseRecyclerViewAdapter<String>() {
BaseRecyclerViewAdapter<ScProblemTypeBean>() {
private var selectTitle = ""
@ -24,18 +25,18 @@ class LeftAdapter(private var itemListener: ((Int, String) -> Unit?)? = null) :
override fun onBindViewHolder(holder: BaseViewHolder, position: Int) {
val bd = holder.viewBinding as TextItemSelectBinding
val title = data[position]
bd.itemId.text = title
holder.viewBinding.root.isSelected = selectTitle == title
bd.itemId.text = title.classType
holder.viewBinding.root.isSelected = selectTitle == title.classType
bd.root.setOnClickListener {
if (selectTitle != title) {
selectTitle = title
if (selectTitle != title.classType) {
selectTitle = title.classType
notifyDataSetChanged()
}
itemListener?.invoke(position, title)
itemListener?.invoke(position, title.classType)
}
}
override fun refreshData(newData: List<String>) {
override fun refreshData(newData: List<ScProblemTypeBean>) {
data = newData
notifyDataSetChanged()
}

View File

@ -33,6 +33,10 @@ open class QsRecordBean @JvmOverloads constructor(
*问题分类
*/
var classType: String = "",
/**
*要素代码
*/
var classCode: String = "",
/**
* 问题类型
*/
@ -97,6 +101,7 @@ open class QsRecordBean @JvmOverloads constructor(
elementId = elementId,
linkId = linkId,
classType = classType,
classCode = classCode,
problemType = problemType,
phenomenon = phenomenon,
description = description,