1、问题记录增加要素编码存储2.回传问题增加未测评判断业务
This commit is contained in:
parent
b9d85640aa
commit
827e6b31b8
@ -30,8 +30,8 @@ interface ScProblemTypeDao {
|
|||||||
/**
|
/**
|
||||||
* 获取问题分类,并去重
|
* 获取问题分类,并去重
|
||||||
*/
|
*/
|
||||||
@Query("select DISTINCT CLASS_TYPE from ScProblemType order by CLASS_TYPE")
|
@Query("select * from ScProblemType group by CLASS_TYPE")
|
||||||
suspend fun findClassTypeList(): List<String>?
|
suspend fun findClassTypeList(): List<ScProblemTypeBean>?
|
||||||
|
|
||||||
@Query("select DISTINCT CLASS_TYPE from ScProblemType where ELEMENT_CODE=:code")
|
@Query("select DISTINCT CLASS_TYPE from ScProblemType where ELEMENT_CODE=:code")
|
||||||
suspend fun findClassTypeByCode(code: Int): String?
|
suspend fun findClassTypeByCode(code: Int): String?
|
||||||
|
@ -146,7 +146,7 @@ class TaskUploadScope(
|
|||||||
markId = hadLinkDvoBean.mesh,//"20065597"
|
markId = hadLinkDvoBean.mesh,//"20065597"
|
||||||
trackPhotoNumber = "",
|
trackPhotoNumber = "",
|
||||||
markGeometry = it.geometry,
|
markGeometry = it.geometry,
|
||||||
featureName = it.classType,
|
featureName = it.classCode,
|
||||||
problemType = problemType,
|
problemType = problemType,
|
||||||
problemPhenomenon = it.phenomenon,
|
problemPhenomenon = it.phenomenon,
|
||||||
problemDesc = it.description,
|
problemDesc = it.description,
|
||||||
@ -166,10 +166,17 @@ class TaskUploadScope(
|
|||||||
bodyList.add(evaluationInfo)
|
bodyList.add(evaluationInfo)
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
val linkStatus = 1
|
||||||
|
//存在原因标记未测评
|
||||||
|
if(hadLinkDvoBean.reason.isNotEmpty()){
|
||||||
|
val linkStatus = 0
|
||||||
|
}else{
|
||||||
|
val linkStatus = 1
|
||||||
|
}
|
||||||
val evaluationInfo = EvaluationInfo(
|
val evaluationInfo = EvaluationInfo(
|
||||||
evaluationTaskId = taskBean.id.toString(),
|
evaluationTaskId = taskBean.id.toString(),
|
||||||
linkPid = hadLinkDvoBean.linkPid,//"84207223282277331"
|
linkPid = hadLinkDvoBean.linkPid,//"84207223282277331"
|
||||||
linkStatus = 0,
|
linkStatus = linkStatus,
|
||||||
markId = hadLinkDvoBean.mesh,//"20065597"
|
markId = hadLinkDvoBean.mesh,//"20065597"
|
||||||
trackPhotoNumber = "",
|
trackPhotoNumber = "",
|
||||||
markGeometry = "",
|
markGeometry = "",
|
||||||
@ -184,7 +191,7 @@ class TaskUploadScope(
|
|||||||
evaluationWay = 2,
|
evaluationWay = 2,
|
||||||
roadClassfcation = "",
|
roadClassfcation = "",
|
||||||
roadFunctionGrade = "",
|
roadFunctionGrade = "",
|
||||||
noEvaluationreason = "",
|
noEvaluationreason = hadLinkDvoBean.reason,
|
||||||
linkLength = 0.0,
|
linkLength = 0.0,
|
||||||
dataLevel = "",
|
dataLevel = "",
|
||||||
linstringLength = 0.0,
|
linstringLength = 0.0,
|
||||||
|
@ -26,6 +26,7 @@ import com.navinfo.collect.library.utils.GeometryTools
|
|||||||
import com.navinfo.omqs.Constant
|
import com.navinfo.omqs.Constant
|
||||||
import com.navinfo.omqs.R
|
import com.navinfo.omqs.R
|
||||||
import com.navinfo.omqs.bean.ChatMsgEntity
|
import com.navinfo.omqs.bean.ChatMsgEntity
|
||||||
|
import com.navinfo.omqs.bean.ScProblemTypeBean
|
||||||
import com.navinfo.omqs.bean.SignBean
|
import com.navinfo.omqs.bean.SignBean
|
||||||
import com.navinfo.omqs.db.RealmOperateHelper
|
import com.navinfo.omqs.db.RealmOperateHelper
|
||||||
import com.navinfo.omqs.db.RoomAppDatabase
|
import com.navinfo.omqs.db.RoomAppDatabase
|
||||||
@ -65,7 +66,7 @@ class EvaluationResultViewModel @Inject constructor(
|
|||||||
/**
|
/**
|
||||||
* 问题分类 liveData,给[LeftAdapter]展示的数据
|
* 问题分类 liveData,给[LeftAdapter]展示的数据
|
||||||
*/
|
*/
|
||||||
val liveDataLeftTypeList = MutableLiveData<List<String>>()
|
val liveDataLeftTypeList = MutableLiveData<List<ScProblemTypeBean>>()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 问题类型 liveData 给[MiddleAdapter]展示的数据
|
* 问题类型 liveData 给[MiddleAdapter]展示的数据
|
||||||
@ -95,6 +96,8 @@ class EvaluationResultViewModel @Inject constructor(
|
|||||||
|
|
||||||
var classTypeTemp: String = ""
|
var classTypeTemp: String = ""
|
||||||
|
|
||||||
|
var classCodeTemp: String = ""
|
||||||
|
|
||||||
init {
|
init {
|
||||||
liveDataQsRecordBean.value = QsRecordBean(id = UUID.randomUUID().toString())
|
liveDataQsRecordBean.value = QsRecordBean(id = UUID.randomUUID().toString())
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
@ -194,22 +197,24 @@ class EvaluationResultViewModel @Inject constructor(
|
|||||||
list?.let {
|
list?.let {
|
||||||
if (list.isNotEmpty()) {
|
if (list.isNotEmpty()) {
|
||||||
//通知页面更新
|
//通知页面更新
|
||||||
var classType = list[0]
|
var classType = list[0].classType
|
||||||
|
var classCode = list[0].elementCode
|
||||||
liveDataLeftTypeList.postValue(it)
|
liveDataLeftTypeList.postValue(it)
|
||||||
if (bean != null) {
|
if (bean != null) {
|
||||||
val classType2 = roomAppDatabase.getScProblemTypeDao()
|
val classType2 = roomAppDatabase.getScProblemTypeDao().findClassTypeByCode(bean.renderEntity.code)
|
||||||
.findClassTypeByCode(bean.renderEntity.code)
|
|
||||||
if (classType2 != null) {
|
if (classType2 != null) {
|
||||||
classType = classType2
|
classType = classType2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//如果右侧栏没数据,给个默认值
|
//如果右侧栏没数据,给个默认值
|
||||||
if (liveDataQsRecordBean.value!!.classType.isEmpty()) {
|
if (liveDataQsRecordBean.value!!.classType.isEmpty()) {
|
||||||
|
|
||||||
liveDataQsRecordBean.value!!.classType = classType
|
liveDataQsRecordBean.value!!.classType = classType
|
||||||
|
liveDataQsRecordBean.value!!.classCode = classCode
|
||||||
classTypeTemp = classType
|
classTypeTemp = classType
|
||||||
|
classCodeTemp = classCode
|
||||||
} else {
|
} else {
|
||||||
classType = liveDataQsRecordBean.value!!.classType
|
classType = liveDataQsRecordBean.value!!.classType
|
||||||
|
classCode = liveDataQsRecordBean.value!!.classCode
|
||||||
}
|
}
|
||||||
getProblemList(classType)
|
getProblemList(classType)
|
||||||
}
|
}
|
||||||
@ -298,6 +303,7 @@ class EvaluationResultViewModel @Inject constructor(
|
|||||||
*/
|
*/
|
||||||
fun setPhenomenonMiddleBean(adapterBean: RightBean) {
|
fun setPhenomenonMiddleBean(adapterBean: RightBean) {
|
||||||
liveDataQsRecordBean.value!!.classType = classTypeTemp
|
liveDataQsRecordBean.value!!.classType = classTypeTemp
|
||||||
|
liveDataQsRecordBean.value!!.classCode = classCodeTemp
|
||||||
liveDataQsRecordBean.value!!.phenomenon = adapterBean.text
|
liveDataQsRecordBean.value!!.phenomenon = adapterBean.text
|
||||||
liveDataQsRecordBean.value!!.problemType = adapterBean.title
|
liveDataQsRecordBean.value!!.problemType = adapterBean.title
|
||||||
liveDataQsRecordBean.postValue(liveDataQsRecordBean.value)
|
liveDataQsRecordBean.postValue(liveDataQsRecordBean.value)
|
||||||
|
@ -5,12 +5,13 @@ import android.view.LayoutInflater
|
|||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.annotation.RequiresApi
|
import androidx.annotation.RequiresApi
|
||||||
import com.navinfo.omqs.R
|
import com.navinfo.omqs.R
|
||||||
|
import com.navinfo.omqs.bean.ScProblemTypeBean
|
||||||
import com.navinfo.omqs.databinding.TextItemSelectBinding
|
import com.navinfo.omqs.databinding.TextItemSelectBinding
|
||||||
import com.navinfo.omqs.ui.other.BaseRecyclerViewAdapter
|
import com.navinfo.omqs.ui.other.BaseRecyclerViewAdapter
|
||||||
import com.navinfo.omqs.ui.other.BaseViewHolder
|
import com.navinfo.omqs.ui.other.BaseViewHolder
|
||||||
|
|
||||||
class LeftAdapter(private var itemListener: ((Int, String) -> Unit?)? = null) :
|
class LeftAdapter(private var itemListener: ((Int, String) -> Unit?)? = null) :
|
||||||
BaseRecyclerViewAdapter<String>() {
|
BaseRecyclerViewAdapter<ScProblemTypeBean>() {
|
||||||
private var selectTitle = ""
|
private var selectTitle = ""
|
||||||
|
|
||||||
|
|
||||||
@ -24,18 +25,18 @@ class LeftAdapter(private var itemListener: ((Int, String) -> Unit?)? = null) :
|
|||||||
override fun onBindViewHolder(holder: BaseViewHolder, position: Int) {
|
override fun onBindViewHolder(holder: BaseViewHolder, position: Int) {
|
||||||
val bd = holder.viewBinding as TextItemSelectBinding
|
val bd = holder.viewBinding as TextItemSelectBinding
|
||||||
val title = data[position]
|
val title = data[position]
|
||||||
bd.itemId.text = title
|
bd.itemId.text = title.classType
|
||||||
holder.viewBinding.root.isSelected = selectTitle == title
|
holder.viewBinding.root.isSelected = selectTitle == title.classType
|
||||||
bd.root.setOnClickListener {
|
bd.root.setOnClickListener {
|
||||||
if (selectTitle != title) {
|
if (selectTitle != title.classType) {
|
||||||
selectTitle = title
|
selectTitle = title.classType
|
||||||
notifyDataSetChanged()
|
notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
itemListener?.invoke(position, title)
|
itemListener?.invoke(position, title.classType)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun refreshData(newData: List<String>) {
|
override fun refreshData(newData: List<ScProblemTypeBean>) {
|
||||||
data = newData
|
data = newData
|
||||||
notifyDataSetChanged()
|
notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,10 @@ open class QsRecordBean @JvmOverloads constructor(
|
|||||||
*问题分类
|
*问题分类
|
||||||
*/
|
*/
|
||||||
var classType: String = "",
|
var classType: String = "",
|
||||||
|
/**
|
||||||
|
*要素代码
|
||||||
|
*/
|
||||||
|
var classCode: String = "",
|
||||||
/**
|
/**
|
||||||
* 问题类型
|
* 问题类型
|
||||||
*/
|
*/
|
||||||
@ -97,6 +101,7 @@ open class QsRecordBean @JvmOverloads constructor(
|
|||||||
elementId = elementId,
|
elementId = elementId,
|
||||||
linkId = linkId,
|
linkId = linkId,
|
||||||
classType = classType,
|
classType = classType,
|
||||||
|
classCode = classCode,
|
||||||
problemType = problemType,
|
problemType = problemType,
|
||||||
phenomenon = phenomenon,
|
phenomenon = phenomenon,
|
||||||
description = description,
|
description = description,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user