Browse Source

@fun: Problem

bai 3 years ago
parent
commit
a2ffd37cd6

+ 11 - 38
app/src/main/java/com/ys/bdtp/adm/mvvm/model/db/AdmDatabase.kt

@@ -5,36 +5,14 @@ import androidx.room.Database
 import androidx.room.Room
 import androidx.room.RoomDatabase
 import androidx.room.TypeConverters
-import com.ys.bdtp.adm.mvvm.model.db.dao.InfoDao
-import com.ys.bdtp.adm.mvvm.model.db.dao.ProblemArchDao
 import com.ys.bdtp.adm.mvvm.model.db.entity.dict.ContainerConfigEntity
 import com.framework.mvvm.model.db.entity.task.PipeEntity
 import com.ys.bdtp.adm.mvvm.model.db.converter.GsonConverter
-import com.ys.bdtp.adm.mvvm.model.db.dao.ComponentDao
-import com.ys.bdtp.adm.mvvm.model.db.dao.ConfigDao
-import com.ys.bdtp.adm.mvvm.model.db.dao.ContainerConfigDao
-import com.ys.bdtp.adm.mvvm.model.db.dao.EquipmentDao
-import com.ys.bdtp.adm.mvvm.model.db.dao.FileDao
-import com.ys.bdtp.adm.mvvm.model.db.dao.InfosConfigDao
-import com.ys.bdtp.adm.mvvm.model.db.dao.JobSpaceDao
-import com.ys.bdtp.adm.mvvm.model.db.dao.M2dEquipDao
-import com.ys.bdtp.adm.mvvm.model.db.dao.MajorDao
-import com.ys.bdtp.adm.mvvm.model.db.dao.ObjectDao
-import com.ys.bdtp.adm.mvvm.model.db.dao.PipeConfigDao
-import com.ys.bdtp.adm.mvvm.model.db.dao.PipeDao
-import com.ys.bdtp.adm.mvvm.model.db.dao.ProblemEquipDao
-import com.ys.bdtp.adm.mvvm.model.db.dao.ProjectDao
-import com.ys.bdtp.adm.mvvm.model.db.dao.QrCodeDao
-import com.ys.bdtp.adm.mvvm.model.db.dao.RelConfigDao
-import com.ys.bdtp.adm.mvvm.model.db.dao.RelationDao
-import com.ys.bdtp.adm.mvvm.model.db.dao.RelationDictDao
-import com.ys.bdtp.adm.mvvm.model.db.dao.ServeAreaDao
-import com.ys.bdtp.adm.mvvm.model.db.dao.SystemDao
-import com.ys.bdtp.adm.mvvm.model.db.dao.UserDao
+import com.ys.bdtp.adm.mvvm.model.db.dao.*
 import com.ys.bdtp.adm.mvvm.model.db.entity.ProjectEntity
 import com.ys.bdtp.adm.mvvm.model.db.entity.UserEntity
 import com.ys.bdtp.adm.mvvm.model.db.entity.dict.ComponentEntity
-import com.ys.bdtp.adm.mvvm.model.db.entity.dict.ConfigEntity
+import com.ys.bdtp.adm.mvvm.model.db.entity.dict.BasicConfigEntity
 import com.ys.bdtp.adm.mvvm.model.db.entity.dict.EquipmentEntity
 import com.ys.bdtp.adm.mvvm.model.db.entity.dict.InfoEntity
 import com.ys.bdtp.adm.mvvm.model.db.entity.dict.InfosConfigEntity
@@ -44,14 +22,7 @@ import com.ys.bdtp.adm.mvvm.model.db.entity.dict.PipeConfigEntity
 import com.ys.bdtp.adm.mvvm.model.db.entity.dict.RelConfigEntity
 import com.ys.bdtp.adm.mvvm.model.db.entity.dict.RelationDictEntity
 import com.ys.bdtp.adm.mvvm.model.db.entity.dict.SystemEntity
-import com.ys.bdtp.adm.mvvm.model.db.entity.task.FileEntity
-import com.ys.bdtp.adm.mvvm.model.db.entity.task.JobSpaceEntity
-import com.ys.bdtp.adm.mvvm.model.db.entity.task.ObjectEntity
-import com.ys.bdtp.adm.mvvm.model.db.entity.task.ProblemArchEntity
-import com.ys.bdtp.adm.mvvm.model.db.entity.task.ProblemEquipEntity
-import com.ys.bdtp.adm.mvvm.model.db.entity.task.QrCodeEntity
-import com.ys.bdtp.adm.mvvm.model.db.entity.task.RelationEntity
-import com.ys.bdtp.adm.mvvm.model.db.entity.task.ServeAreaEntity
+import com.ys.bdtp.adm.mvvm.model.db.entity.task.*
 
 
 @Database(
@@ -64,21 +35,22 @@ import com.ys.bdtp.adm.mvvm.model.db.entity.task.ServeAreaEntity
         PipeConfigEntity::class,
         RelConfigEntity::class,
         M2dEquipEntity::class,
-        ConfigEntity::class,
+        BasicConfigEntity::class,
         FileEntity::class,
         JobSpaceEntity::class,
         QrCodeEntity::class,
         ObjectEntity::class,
         ProjectEntity::class,
         RelationEntity::class,
-        ProblemArchEntity::class,
-        ProblemEquipEntity::class,
+        ProblemEntity::class,
         ComponentEntity::class,
         PipeEntity::class,
         ServeAreaEntity::class,
         ContainerConfigEntity::class,
         InfoEntity::class,
-        UserEntity::class
+        UserEntity::class,
+        CustomInfoEntity::class,
+        CadEntity::class
     ], version = 1, exportSchema = true
 )
 @TypeConverters(GsonConverter::class)
@@ -91,8 +63,7 @@ abstract class AdmDatabase : RoomDatabase() {
     abstract fun majorDao(): MajorDao
     abstract fun objectDao(): ObjectDao
     abstract fun pipeConfigDao(): PipeConfigDao
-    abstract fun problemArchDao(): ProblemArchDao
-    abstract fun problemEquipDao(): ProblemEquipDao
+    abstract fun problemDao(): ProblemDao
     abstract fun projectDao(): ProjectDao
     abstract fun qrCodeDao(): QrCodeDao
     abstract fun relationDao(): RelationDao
@@ -106,6 +77,8 @@ abstract class AdmDatabase : RoomDatabase() {
     abstract fun containerConfigDao(): ContainerConfigDao
     abstract fun infoDao(): InfoDao
     abstract fun userDao(): UserDao
+    abstract fun cadDao(): CadDao
+    abstract fun customInfoDao(): CustomInfoDao
 
     companion object {
         @Volatile

+ 26 - 0
app/src/main/java/com/ys/bdtp/adm/mvvm/model/db/dao/CadDao.kt

@@ -0,0 +1,26 @@
+package com.ys.bdtp.adm.mvvm.model.db.dao
+
+import androidx.room.Dao
+import androidx.room.Insert
+import androidx.room.OnConflictStrategy
+import androidx.room.Query
+import com.ys.bdtp.adm.mvvm.model.db.entity.task.CadEntity
+
+/**
+ * cad 表访问接口
+ *
+ * @author bai
+ */
+@Dao
+interface CadDao {
+
+    @Query("select * from cad")
+    fun getCads(): List<CadEntity>
+
+    @Insert(onConflict = OnConflictStrategy.REPLACE)
+    fun insCad(vararg cad: CadEntity)
+
+    @Insert(onConflict = OnConflictStrategy.REPLACE)
+    fun insCads(cads: List<CadEntity>)
+
+}

+ 7 - 2
app/src/main/java/com/ys/bdtp/adm/mvvm/model/db/dao/ComponentDao.kt

@@ -6,8 +6,13 @@ import androidx.room.Insert
 import androidx.room.OnConflictStrategy
 import androidx.room.Query
 import com.ys.bdtp.adm.mvvm.model.db.entity.dict.ComponentEntity
-import com.ys.bdtp.adm.mvvm.model.db.entity.dict.ConfigEntity
+import com.ys.bdtp.adm.mvvm.model.db.entity.dict.BasicConfigEntity
 
+/**
+ * component 表访问接口
+ *
+ * @author bai
+ */
 @Dao
 interface ComponentDao {
     @Query("select * from component")
@@ -26,5 +31,5 @@ interface ComponentDao {
     suspend fun insComponents( comps: List<ComponentEntity>)
 
     @Delete
-    suspend fun delConfig(config: ConfigEntity)
+    suspend fun delConfig(config: BasicConfigEntity)
 }

+ 11 - 9
app/src/main/java/com/ys/bdtp/adm/mvvm/model/db/dao/ConfigDao.kt

@@ -1,25 +1,27 @@
 package com.ys.bdtp.adm.mvvm.model.db.dao
 
 import androidx.room.*
-import com.ys.bdtp.adm.mvvm.model.db.entity.dict.ConfigEntity
+import com.ys.bdtp.adm.mvvm.model.db.entity.dict.BasicConfigEntity
 
 /**
- * 表 config Dao
+ * basic_config 访问接口
+ *
+ * @author bai
  */
 @Dao
 interface ConfigDao {
-    @Query("select * from config")
-    suspend fun getConfigs(): List<ConfigEntity>
+    @Query("select * from basic_config")
+    suspend fun getConfigs(): List<BasicConfigEntity>
 
-    @Query("select * from config where id = :id")
-    suspend fun getConfigById(id: String): ConfigEntity
+    @Query("select * from basic_config where id = :id")
+    suspend fun getConfigById(id: String): BasicConfigEntity
 
     @Insert(onConflict = OnConflictStrategy.REPLACE)
-    suspend fun insConfig(vararg config: ConfigEntity)
+    suspend fun insConfig(vararg config: BasicConfigEntity)
 
     @Insert(onConflict = OnConflictStrategy.REPLACE)
-    suspend fun insConfigs(configs: List<ConfigEntity>)
+    suspend fun insConfigs(configs: List<BasicConfigEntity>)
 
     @Delete
-    suspend fun delConfig(config: ConfigEntity)
+    suspend fun delConfig(config: BasicConfigEntity)
 }

+ 18 - 0
app/src/main/java/com/ys/bdtp/adm/mvvm/model/db/dao/CustomInfoDao.kt

@@ -0,0 +1,18 @@
+package com.ys.bdtp.adm.mvvm.model.db.dao
+
+import androidx.room.Dao
+import androidx.room.Query
+import com.ys.bdtp.adm.mvvm.model.db.entity.task.CustomInfoEntity
+
+/**
+ * custom_info 访问接口
+ *
+ * @author bai
+ *
+ */
+@Dao
+interface CustomInfoDao {
+
+    @Query("select * from custom_info")
+    fun getInfos(): List<CustomInfoEntity>
+}

+ 0 - 41
app/src/main/java/com/ys/bdtp/adm/mvvm/model/db/dao/ProblemArchDao.kt

@@ -1,41 +0,0 @@
-package com.ys.bdtp.adm.mvvm.model.db.dao
-
-import androidx.room.*
-import com.ys.bdtp.adm.mvvm.model.db.entity.task.ProblemArchEntity
-
-/**
- * 表 problem_arch Dao
- */
-@Dao
-interface ProblemArchDao {
-    @Query("select * from problem_arch")
-    suspend fun getProblems(): List<ProblemArchEntity>
-
-    @Query("select * from problem_arch where id = :id")
-    suspend fun getProblemById(id: String): ProblemArchEntity
-
-    @Query("select * from problem_arch where floor_id = :floorId")
-    suspend fun getProblemByFloor(floorId: String): List<ProblemArchEntity>
-
-    @Query("select * from problem_arch where floor_id = :floorId and valid = 1 and problem_state = 1")
-    suspend fun getProblemByAvalible(floorId: String): List<ProblemArchEntity>
-
-    @Query("select * from problem_arch where building_id = :id")
-    suspend fun getProblemByBuildingId(id: String): List<ProblemArchEntity>
-
-    @Insert(onConflict = OnConflictStrategy.REPLACE)
-    suspend fun insProblem(problem: ProblemArchEntity)
-
-    @Insert(onConflict = OnConflictStrategy.REPLACE)
-    suspend fun insProblems(problems: List<ProblemArchEntity>)
-
-    @Update
-    suspend fun updateProblems(problems: List<ProblemArchEntity>)
-
-    @Delete
-    suspend fun delProblem(problem: ProblemArchEntity)
-
-    @Query("select count(*) from problem_arch where project_id = :projectId and (state = 0 or state = 1)")
-    suspend fun countUnDone(projectId: String): Int
-
-}

+ 25 - 0
app/src/main/java/com/ys/bdtp/adm/mvvm/model/db/dao/ProblemDao.kt

@@ -0,0 +1,25 @@
+package com.ys.bdtp.adm.mvvm.model.db.dao
+
+import androidx.room.Dao
+import androidx.room.Insert
+import androidx.room.OnConflictStrategy
+import androidx.room.Query
+import com.ys.bdtp.adm.mvvm.model.db.entity.task.ProblemEntity
+
+/**
+ * problem 表访问接口
+ *
+ * @author bai
+ */
+@Dao
+interface ProblemDao {
+
+    @Query("select * from problem")
+    fun getProblems(): List<ProblemEntity>
+
+    @Insert(onConflict = OnConflictStrategy.REPLACE)
+    suspend fun insProblem(problem: ProblemEntity)
+
+    @Insert(onConflict = OnConflictStrategy.REPLACE)
+    suspend fun insProblems(problems: List<ProblemEntity>)
+}

+ 0 - 42
app/src/main/java/com/ys/bdtp/adm/mvvm/model/db/dao/ProblemEquipDao.kt

@@ -1,42 +0,0 @@
-package com.ys.bdtp.adm.mvvm.model.db.dao
-
-import androidx.room.Dao
-import androidx.room.Delete
-import androidx.room.Insert
-import androidx.room.OnConflictStrategy
-import androidx.room.Query
-import androidx.room.Update
-import com.ys.bdtp.adm.mvvm.model.db.entity.task.ProblemEquipEntity
-
-/**
- * 表 problem_equip Dao
- */
-@Dao
-interface ProblemEquipDao {
-    @Query("select * from problem_equip")
-    suspend fun getProblems(): List<ProblemEquipEntity>
-
-    @Query("select * from problem_equip where id = :id")
-    suspend fun getProblemById(id: String): ProblemEquipEntity
-
-    @Query("select * from problem_equip where building_id = :id")
-    suspend fun getProblemByBuildingId(id: String): List<ProblemEquipEntity>
-
-    @Query("select * from problem_equip where equip_id = :id")
-    suspend fun getProblemByEquipId(id: String): ProblemEquipEntity?
-
-    @Insert(onConflict = OnConflictStrategy.REPLACE)
-    suspend fun insProblem(vararg problem: ProblemEquipEntity)
-
-    @Insert(onConflict = OnConflictStrategy.REPLACE)
-    suspend fun insProblems(problems: List<ProblemEquipEntity>)
-
-    @Update
-    suspend fun updateProblems(problems: List<ProblemEquipEntity>)
-
-    @Delete
-    suspend fun delProblem(config: ProblemEquipEntity)
-
-    @Query("select count(*) from problem_equip where project_id = :projectId and (state = 0 or state = 1)")
-    suspend fun countUnDone(projectId: String): Int
-}

+ 12 - 5
app/src/main/java/com/ys/bdtp/adm/mvvm/model/db/entity/dict/ConfigEntity.kt

@@ -7,12 +7,19 @@ import androidx.room.PrimaryKey
 import com.google.gson.JsonElement
 
 /**
- * 基本配置 表
+ * basic_config 表
+ *
+ * @author bai
+ *
+ * @param code 配置项编码
+ * @param name 配置项名称
+ * @param data 配置项内容
+ *
  */
-@Entity(tableName = "config")
-data class ConfigEntity(
+@Entity(tableName = "basic_config")
+data class BasicConfigEntity(
     @PrimaryKey val id: String,
-    @ColumnInfo(name = "name") val name: String,               // 配置项名称
     @ColumnInfo(name = "code") val code: String,               // 配置项编码
-    @ColumnInfo(name = "data") val data: JsonElement? = null,  // 配置项内容
+    @ColumnInfo(name = "name") val name: String,               // 配置项名称
+    @ColumnInfo(name = "data") val data: JsonElement? = null,  //
 )

+ 11 - 4
app/src/main/java/com/ys/bdtp/adm/mvvm/model/db/entity/dict/ComponentEntity.kt

@@ -6,12 +6,19 @@ import androidx.room.PrimaryKey
 
 /**
  * component 表
+ *  描述对象的形态,(方形,圆形等等)
+ * @author bai
+ *
+ * @param compCode 构件编码
+ * @param compName 构件名称
+ * @param systemCode 系统编码
+ * @param classCode 类型编码
  */
 @Entity(tableName = "component")
 data class ComponentEntity(
     @PrimaryKey val id: String,
-    @ColumnInfo(name = "comp_code") val compCode: String,       // 构件编码
-    @ColumnInfo(name = "comp_name") val compName: String?,      // 构件名称
-    @ColumnInfo(name = "system_code") val systemCode: String,   // 系统编码
-    @ColumnInfo(name = "class_code") val classCode: String      // 类型编码
+    @ColumnInfo(name = "comp_code") val compCode: String,
+    @ColumnInfo(name = "comp_name") val compName: String?,
+    @ColumnInfo(name = "system_code") val systemCode: String,
+    @ColumnInfo(name = "class_code") val classCode: String
 )

+ 38 - 0
app/src/main/java/com/ys/bdtp/adm/mvvm/model/db/entity/relation/ObjectProblemRelEntity.kt

@@ -0,0 +1,38 @@
+package com.ys.bdtp.adm.mvvm.model.db.entity.relation
+
+import androidx.room.ColumnInfo
+import androidx.room.Entity
+import androidx.room.PrimaryKey
+
+/**
+ * 对象类型与问题类型定义表
+ *
+ * @author bai
+ *
+ * @param id
+ * @param objTypeCode 对象类型编码
+ * @param objTypeName 对象类型名称
+ * @param problemTypeCode 问题类型编码
+ * @param problemTypeName 问题类型名称
+ * @param valid 合法标识
+ * @param creator 创建人
+ * @param creationTime 创建时间
+ * @param modifier 最后修改人
+ * @param modifiedTime 最后修改时间
+ * @param ts 时间戳
+ *
+ */
+@Entity(tableName = "obj_problem_rel")
+class ObjectProblemRelEntity(
+    @PrimaryKey @ColumnInfo(name = "id") val id: String,
+    @ColumnInfo(name = "obj_type_code") val objTypeCode: String,
+    @ColumnInfo(name = "obj_type_name") val objTypeName: String,
+    @ColumnInfo(name = "problem_type_code") val problemTypeCode: String,
+    @ColumnInfo(name = "problem_type_name") val problemTypeName: String,
+    @ColumnInfo(name = "valid") val valid: Int,
+    @ColumnInfo(name = "creator") val creator: String,
+    @ColumnInfo(name = "creation_time") val creationTime: String,
+    @ColumnInfo(name = "modifier") val modifier: String,
+    @ColumnInfo(name = "modified_time") val modifiedTime: String,
+    @ColumnInfo(name = "ts") val ts: Long,
+)

+ 46 - 0
app/src/main/java/com/ys/bdtp/adm/mvvm/model/db/entity/task/CadEntity.kt

@@ -0,0 +1,46 @@
+package com.ys.bdtp.adm.mvvm.model.db.entity.task
+
+import androidx.room.ColumnInfo
+import androidx.room.Entity
+import androidx.room.PrimaryKey
+
+/**
+ * cad 表
+ *
+ * @author bai
+ *
+ * @param id
+ * @param fileKey 存储系统的key
+ * @param fileName 文件名称
+ * @param majorCode 专业编码
+ * @param majorName 专业名称
+ * @param checkStatus 核查状态: 0 未完成, 1 已完成
+ * @param floorId 楼层id
+ * @param buildingId 建筑id
+ * @param projectId 项目id
+ * @param valid 合法标识
+ * @param creator 创建人
+ * @param creationTime 创建时间
+ * @param modifier 最后修改人
+ * @param modifiedTime 最后修改时间
+ * @param ts 时间戳
+ *
+ */
+@Entity(tableName = "cad")
+class CadEntity(
+    @PrimaryKey @ColumnInfo(name = "id") val id: String,
+    @ColumnInfo(name = "file_key") val fileKey: String,
+    @ColumnInfo(name = "file_name") val fileName: String,
+    @ColumnInfo(name = "major_code") val majorCode: String,
+    @ColumnInfo(name = "major_name") val majorName: String,
+    @ColumnInfo(name = "check_status") val checkStatus: String,
+    @ColumnInfo(name = "floor_id") val floorId: String,
+    @ColumnInfo(name = "building_id") val buildingId: String,
+    @ColumnInfo(name = "project_id") val projectId: String,
+    @ColumnInfo(name = "valid") val valid: Int,
+    @ColumnInfo(name = "creator") val creator: String,
+    @ColumnInfo(name = "creation_time") val creationTime: String,
+    @ColumnInfo(name = "modifier") val modifier: String,
+    @ColumnInfo(name = "modified_time") val modifiedTime: String,
+    @ColumnInfo(name = "ts") val ts: Long
+)

+ 48 - 0
app/src/main/java/com/ys/bdtp/adm/mvvm/model/db/entity/task/CustomInfoEntity.kt

@@ -0,0 +1,48 @@
+package com.ys.bdtp.adm.mvvm.model.db.entity.task
+
+import androidx.room.ColumnInfo
+import androidx.room.Entity
+import androidx.room.PrimaryKey
+import com.google.gson.JsonElement
+
+/**
+ * custom_info 自定义信息表
+ *  根据 problemTypeCode 自定义信息点
+ *
+ * @author bai
+ *
+ * @param id
+ * @param code 信息点编码
+ * @param name 信息点名称
+ * @param problemTypeCode 问题类型编码
+ * @param unit 单位
+ * @param dataType 数据类型
+ * @param dataSource 数据源
+ * @param isMultiple 0 单选,1 多选
+ * @param remark 备注
+ * @param valid 合法标识
+ * @param creator 创建人
+ * @param creationTime 创建时间
+ * @param modifier 最后修改人
+ * @param modifiedTime 最后修改时间
+ * @param ts 时间戳
+ *
+ */
+@Entity(tableName = "custom_info")
+class CustomInfoEntity(
+    @PrimaryKey @ColumnInfo(name = "id") val id: String,
+    @ColumnInfo(name = "code") val code: String,
+    @ColumnInfo(name = "name") val name: String,
+    @ColumnInfo(name = "problem_type_code") val problemTypeCode: String,
+    @ColumnInfo(name = "unit") val unit: String,
+    @ColumnInfo(name = "data_type") val dataType: String,
+    @ColumnInfo(name = "data_source") val dataSource: JsonElement,
+    @ColumnInfo(name = "is_multiple") val isMultiple: Int,
+    @ColumnInfo(name = "remark") val remark: String,
+    @ColumnInfo(name = "valid") val valid: Int,
+    @ColumnInfo(name = "creator") val creator: String,
+    @ColumnInfo(name = "creation_time") val creationTime: String,
+    @ColumnInfo(name = "modifier") val modifier: String,
+    @ColumnInfo(name = "modified_time") val modifiedTime: String,
+    @ColumnInfo(name = "ts") val ts: Long
+)

+ 0 - 27
app/src/main/java/com/ys/bdtp/adm/mvvm/model/db/entity/task/ProblemArchEntity.kt

@@ -1,27 +0,0 @@
-package com.ys.bdtp.adm.mvvm.model.db.entity.task
-
-import androidx.room.ColumnInfo
-import androidx.room.Entity
-import androidx.room.PrimaryKey
-import com.ys.bdtp.adm.mvvm.model.db.entity.BaseEntity
-import com.google.gson.JsonElement
-
-/**
- * 结构问题  表
- */
-@Entity(tableName = "problem_arch")
-data class ProblemArchEntity(
-    @PrimaryKey @ColumnInfo(name = "id") override val id: String,
-    @ColumnInfo(name = "floor_id") override val floorId: String,
-    @ColumnInfo(name = "project_id") override val projectId: String,
-    @ColumnInfo(name = "building_id") override val buildingId: String,
-    @ColumnInfo(name = "state") override var state: Int = -1,
-    @ColumnInfo(name = "valid") override var valid: Int = 1,
-    @ColumnInfo(name = "ts") override val ts: Long = 0L,
-    @ColumnInfo(name = "geom_type") val geomType: String? = "",        // 问题记录的几何类型(point|line|polygon)
-    @ColumnInfo(name = "work_id") val workId: String? = "",            // 交付工作流程id
-    @ColumnInfo(name = "problem_type") val problemType: String? = "",  // 问题类型
-    @ColumnInfo(name = "problem_state") var problemState: Int? = null, // 建筑结构核查任务状态(0:删除;1:有效;2:已解决)
-    @ColumnInfo(name = "message") val message: String? = "",           // 问题描述
-    @ColumnInfo(name = "geom") val geom: JsonElement? = null,          // 问题记录的几何数据(Json)
-) : BaseEntity

+ 57 - 0
app/src/main/java/com/ys/bdtp/adm/mvvm/model/db/entity/task/ProblemEntity.kt

@@ -0,0 +1,57 @@
+package com.ys.bdtp.adm.mvvm.model.db.entity.task
+
+import androidx.room.ColumnInfo
+import androidx.room.Entity
+import androidx.room.PrimaryKey
+import com.google.gson.JsonElement
+
+/**
+ * 核查问题记录表
+ *
+ * @author bai
+ *
+ * @param id
+ * @param projectId 项目id
+ * @param buildingId 建筑id
+ * @param floorId 楼层id
+ * @param fileId 文件id
+ * @param checkType 核查类型: 1 空间, 2 对象
+ * @param objTypeCode 问题对象类型编码
+ * @param objTypeName 问题对象类型名称
+ * @param objId 问题对象id
+ * @param objName 问题对象名称
+ * @param typeCode 问题类型编码
+ * @param typeName 问题类型编码
+ * @param info 问题描述
+ * @param status 核查状态: 1 有效, 2 已解决
+ * @param valid 合法标识
+ * @param creator 创建人
+ * @param creationTime 创建时间
+ * @param modifier 最后修改人
+ * @param modifiedTime 最后修改时间
+ * @param ts 时间戳
+ *
+ */
+@Entity(tableName = "problem")
+class ProblemEntity(
+    @PrimaryKey @ColumnInfo(name = "id") val id: String,
+    @ColumnInfo(name = "project_id") val projectId: String,
+    @ColumnInfo(name = "building_id") val buildingId: String,
+    @ColumnInfo(name = "floor_id") val floorId: String,
+    @ColumnInfo(name = "file_id") val fileId: String,
+    @ColumnInfo(name = "check_type") val checkType: Int,
+    @ColumnInfo(name = "obj_type_code") val objTypeCode: String,
+    @ColumnInfo(name = "obj_type_name") val objTypeName: String,
+    @ColumnInfo(name = "obj_id") val objId: String,
+    @ColumnInfo(name = "obj_name") val objName: String,
+    @ColumnInfo(name = "type_code") val typeCode: String,
+    @ColumnInfo(name = "type_name") val typeName: String,
+    @ColumnInfo(name = "info") val info: JsonElement,
+    @ColumnInfo(name = "status") val status: Int,
+    @ColumnInfo(name = "valid") val valid: Int,
+    @ColumnInfo(name = "creator") val creator: String,
+    @ColumnInfo(name = "creation_time") val creationTime: String,
+    @ColumnInfo(name = "modifier") val modifier: String,
+    @ColumnInfo(name = "modified_time") val modifiedTime: String,
+    @ColumnInfo(name = "ts") val ts: Long
+)

+ 0 - 25
app/src/main/java/com/ys/bdtp/adm/mvvm/model/db/entity/task/ProblemEquipEntity.kt

@@ -1,25 +0,0 @@
-package com.ys.bdtp.adm.mvvm.model.db.entity.task
-
-import androidx.room.ColumnInfo
-import androidx.room.Entity
-import androidx.room.PrimaryKey
-import com.ys.bdtp.adm.mvvm.model.db.entity.BaseEntity
-
-/**
- * 设备问题 表
- */
-@Entity(tableName = "problem_equip")
-data class ProblemEquipEntity(
-    @PrimaryKey @ColumnInfo(name = "id") override val id: String,
-    @ColumnInfo(name = "floor_id") override val floorId: String,
-    @ColumnInfo(name = "project_id") override val projectId: String,
-    @ColumnInfo(name = "building_id") override val buildingId: String,
-    @ColumnInfo(name = "state") override var state: Int = -1,
-    @ColumnInfo(name = "valid") override var valid: Int = 1,
-    @ColumnInfo(name = "ts") override val ts: Long = 0L,
-    @ColumnInfo(name = "equip_id") val equipId: String,                  // 设备id
-    @ColumnInfo(name = "work_id") val workId: String? = null,            // 交付工作流程id
-    @ColumnInfo(name = "problem_type") val problemType: String? = null,  // 问题类型
-    @ColumnInfo(name = "problem_state") val problemState: Int? = null,   // 建筑结构核查任务状态(0:删除;1:有效;2:已解决)
-    @ColumnInfo(name = "message") val message: String? = null,           // 问题描述
-) : BaseEntity