增加任务列表和下载功能

This commit is contained in:
squallzhjch
2023-04-23 16:35:45 +08:00
parent ccfd30228e
commit a1170db7a9
35 changed files with 1083 additions and 137 deletions

View File

@@ -0,0 +1,21 @@
package com.navinfo.omqs.bean
import io.realm.RealmObject
import io.realm.annotations.RealmClass
@RealmClass
open class HadLinkDvoBean @JvmOverloads constructor(
/**
* 图幅号
*/
var mesh: String = "",
/**
* linkPid
*/
var linkPid: String = "",
/**
* (几何)加偏后
*/
var geometry: String = ""
) : RealmObject()

View File

@@ -3,6 +3,7 @@ package com.navinfo.omqs.bean
import android.os.Parcelable
import androidx.room.Entity
import androidx.room.PrimaryKey
import com.navinfo.omqs.tools.FileManager
import kotlinx.parcelize.Parcelize
@@ -17,19 +18,9 @@ data class OfflineMapCityBean @JvmOverloads constructor(
var version: Long = 0L,
var fileSize: Long = 0L,
var currentSize: Long = 0L,
var status: Int = NONE
var status: Int = FileManager.Companion.FileDownloadStatus.NONE
) : Parcelable {
companion object Status {
const val NONE = 0 //无状态
const val WAITING = 1 //等待中
const val LOADING = 2 //下载中
const val PAUSE = 3 //暂停
const val ERROR = 4 //错误
const val DONE = 5 //完成
const val UPDATE = 6 //有新版本要更新
}
// // status的转换对象
// var statusEnum: StatusEnum
// get() {

View File

@@ -0,0 +1,64 @@
package com.navinfo.omqs.bean
import com.google.gson.annotations.SerializedName
import com.navinfo.omqs.Constant
import com.navinfo.omqs.system.SystemConstant
import com.navinfo.omqs.tools.FileManager.Companion.FileDownloadStatus
import io.realm.RealmList
import io.realm.RealmObject
import io.realm.annotations.PrimaryKey
import io.realm.annotations.RealmClass
@RealmClass
open class TaskBean @JvmOverloads constructor(
/**
* 测评任务id
*/
@PrimaryKey
var id: Int = 0,
/**
* 测评任务名称
*/
var evaluationTaskName: String = "",
/**
* 市编码
*/
var cityCode: String = "",
/**
*市名称
*/
var cityName: String = "",
/**
* omdb标准版
*/
var dataVersion: String = "",
/**
* 测评人名称
*/
var evaluatorName: String = "",
/**
* 项目标签
*/
var project: String = "",
/**
* 图幅号
*/
@SerializedName("hadLinkDvo")
var hadLinkDvoList: RealmList<HadLinkDvoBean> = RealmList<HadLinkDvoBean>(),
/**
* 文件大小
*/
var fileSize: Long = 0L,
/**
* 当前下载进度
*/
var currentSize: Long = 0L,
/**
* 当前下载状态
*/
var status: Int = FileDownloadStatus.NONE
) : RealmObject(){
fun getDownLoadUrl():String{
return "${Constant.SERVER_ADDRESS}devcp/download?fileStr=26"
}
}