解决代码冲突
This commit is contained in:
parent
1be2b00bf2
commit
eea7cb6fdf
@ -77,7 +77,7 @@ class TaskUploadScope(
|
||||
taskBean.operationTime = DateTimeUtil.getNowDate().time
|
||||
uploadData.postValue(taskBean)
|
||||
//同步中不进行状态记录,只做界面变更显示
|
||||
if(status!=FileUploadStatus.UPLOADING){
|
||||
if (status != FileUploadStatus.UPLOADING) {
|
||||
launch {
|
||||
val realm = Realm.getDefaultInstance()
|
||||
realm.executeTransaction {
|
||||
@ -118,7 +118,7 @@ class TaskUploadScope(
|
||||
|
||||
val bodyList: MutableList<EvaluationInfo> = ArrayList()
|
||||
|
||||
if (taskBean.syncStatus == FileUploadStatus.WAITING){
|
||||
if (taskBean.syncStatus == FileUploadStatus.WAITING) {
|
||||
change(FileUploadStatus.UPLOADING)
|
||||
}
|
||||
|
||||
@ -126,7 +126,7 @@ class TaskUploadScope(
|
||||
|
||||
val linkStatus = 1
|
||||
//存在原因标记未测评
|
||||
if(hadLinkDvoBean.reason.isNotEmpty()){
|
||||
if (hadLinkDvoBean.reason.isNotEmpty()) {
|
||||
//未测评
|
||||
val linkStatus = 0
|
||||
|
||||
@ -156,23 +156,24 @@ class TaskUploadScope(
|
||||
|
||||
bodyList.add(evaluationInfo)
|
||||
|
||||
}else{
|
||||
} else {
|
||||
|
||||
val linkStatus = hadLinkDvoBean.linkStatus
|
||||
|
||||
var s: String = "%.3f".format(hadLinkDvoBean.linkLength)//保留一位小数(且支持四舍五入)
|
||||
var s: String = "%.3f".format(hadLinkDvoBean.length)//保留一位小数(且支持四舍五入)
|
||||
|
||||
val objects = realm.where(QsRecordBean::class.java).equalTo("linkId", /*"84207223282277331"*/hadLinkDvoBean.linkPid).findAll()
|
||||
val objects = realm.where(QsRecordBean::class.java)
|
||||
.equalTo("linkId", /*"84207223282277331"*/hadLinkDvoBean.linkPid).findAll()
|
||||
|
||||
if (objects != null&&objects.size>0) {
|
||||
if (objects != null && objects.size > 0) {
|
||||
val copyList = realm.copyFromRealm(objects)
|
||||
copyList.forEach {
|
||||
var problemType = 0
|
||||
if(it.problemType=="错误"){
|
||||
if (it.problemType == "错误") {
|
||||
problemType = 0
|
||||
}else if(it.problemType=="多余"){
|
||||
} else if (it.problemType == "多余") {
|
||||
problemType = 1
|
||||
}else if(it.problemType=="遗漏"){
|
||||
} else if (it.problemType == "遗漏") {
|
||||
problemType = 2
|
||||
}
|
||||
var evaluationWay = 2
|
||||
@ -207,16 +208,16 @@ class TaskUploadScope(
|
||||
|
||||
}
|
||||
|
||||
if(bodyList.size>0){
|
||||
if (bodyList.size > 0) {
|
||||
val result = uploadManager.netApi.postRequest(bodyList)// .enqueue(object :
|
||||
// Callback<ResponseBody> {
|
||||
if (result.isSuccessful) {
|
||||
if (result.code() == 200&&result.body()!=null) {
|
||||
if (result.code() == 200 && result.body() != null) {
|
||||
val defaultUserResponse = result.body() as DefaultResponse<*>
|
||||
if(defaultUserResponse.success){
|
||||
change(FileUploadStatus.DONE,"上传成功")
|
||||
}else{
|
||||
change(FileUploadStatus.ERROR,"${defaultUserResponse.msg}")
|
||||
if (defaultUserResponse.success) {
|
||||
change(FileUploadStatus.DONE, "上传成功")
|
||||
} else {
|
||||
change(FileUploadStatus.ERROR, "${defaultUserResponse.msg}")
|
||||
}
|
||||
} else {
|
||||
// handle the failure
|
||||
@ -225,7 +226,7 @@ class TaskUploadScope(
|
||||
} else {
|
||||
change(FileUploadStatus.ERROR)
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
change(FileUploadStatus.NONE)
|
||||
}
|
||||
} catch (e: Throwable) {
|
||||
|
@ -364,41 +364,39 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
*/
|
||||
|
||||
fun initData(id: String) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
|
||||
Realm.getDefaultInstance().use { realm ->
|
||||
realm.executeTransactionAsync { bgRealm ->
|
||||
// find the item
|
||||
val objects =
|
||||
bgRealm.where(QsRecordBean::class.java).equalTo("id", id).findFirst()
|
||||
if (objects != null) {
|
||||
oldBean = bgRealm.copyFromRealm(objects)
|
||||
oldBean?.let {
|
||||
liveDataQsRecordBean.postValue(it.copy())
|
||||
val p = GeometryTools.createGeoPoint(it.geometry)
|
||||
mapController.markerHandle.addMarker(
|
||||
GeoPoint(
|
||||
p.latitude,
|
||||
p.longitude
|
||||
), markerTitle
|
||||
)
|
||||
Realm.getDefaultInstance().use { realm ->
|
||||
realm.executeTransactionAsync { bgRealm ->
|
||||
// find the item
|
||||
val objects =
|
||||
bgRealm.where(QsRecordBean::class.java).equalTo("id", id).findFirst()
|
||||
if (objects != null) {
|
||||
oldBean = bgRealm.copyFromRealm(objects)
|
||||
oldBean?.let {
|
||||
liveDataQsRecordBean.postValue(it.copy())
|
||||
val p = GeometryTools.createGeoPoint(it.geometry)
|
||||
mapController.markerHandle.addMarker(
|
||||
GeoPoint(
|
||||
p.latitude,
|
||||
p.longitude
|
||||
), markerTitle
|
||||
)
|
||||
|
||||
//获取linkid
|
||||
if (it.linkId.isNotEmpty()) {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
val link = realmOperateHelper.queryLink(it.linkId)
|
||||
link?.let { l ->
|
||||
mapController.lineHandler.showLine(l.geometry)
|
||||
}
|
||||
//获取linkid
|
||||
if (it.linkId.isNotEmpty()) {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
val link = realmOperateHelper.queryLink(it.linkId)
|
||||
link?.let { l ->
|
||||
mapController.lineHandler.showLine(l.geometry)
|
||||
}
|
||||
}
|
||||
liveDataQsRecordBean.value?.attachmentBeanList =
|
||||
it.attachmentBeanList
|
||||
// 显示语音数据到界面
|
||||
getChatMsgEntityList()
|
||||
}
|
||||
liveDataQsRecordBean.value?.attachmentBeanList =
|
||||
it.attachmentBeanList
|
||||
// 显示语音数据到界面
|
||||
getChatMsgEntityList()
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -409,7 +407,6 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
/**
|
||||
* 查询问题类型列表
|
||||
*/
|
||||
@RequiresApi(Build.VERSION_CODES.N)
|
||||
fun getChatMsgEntityList() {
|
||||
val chatMsgEntityList: MutableList<ChatMsgEntity> = ArrayList()
|
||||
liveDataQsRecordBean.value?.attachmentBeanList?.forEach {
|
||||
|
@ -32,5 +32,9 @@ open class HadLinkDvoBean @JvmOverloads constructor(
|
||||
/**
|
||||
* 详细属性
|
||||
*/
|
||||
var linkInfo: LinkInfoBean? = null
|
||||
var linkInfo: LinkInfoBean? = null,
|
||||
/**
|
||||
* 长度(米)
|
||||
*/
|
||||
var length: Double = 0.000,
|
||||
) : RealmObject()
|
@ -18,10 +18,7 @@ open class LinkInfoBean @JvmOverloads constructor(
|
||||
* 数据的等级
|
||||
*/
|
||||
var dataLevel: Int = 0,
|
||||
/**
|
||||
* 长度(米)
|
||||
*/
|
||||
var length: Double = 0.000,
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user