使用本地数据库保存数据
@@ -20,6 +20,12 @@ android {
|
||||
// 选择实际需要的cpu架构
|
||||
abiFilters 'armeabi-v7a', 'arm64-v8a'//,'armeabi'//, 'x86', 'x86_64'
|
||||
}
|
||||
// Kotlin项目配置
|
||||
kapt {
|
||||
arguments {
|
||||
arg("room.schemaLocation", "$projectDir/schemas")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
signingConfigs{
|
||||
@@ -86,25 +92,16 @@ dependencies {
|
||||
api rootProject.ext.commonLibs
|
||||
|
||||
|
||||
api project(':tuichat')
|
||||
api project(':tuicontact')
|
||||
api project(':tuiconversation')
|
||||
api project(':tuicallkit')
|
||||
// api project(':tuichat')
|
||||
// api project(':tuicontact')
|
||||
// api project(':tuiconversation')
|
||||
// api project(':tuicallkit')
|
||||
// annotationProcessor 'com.google.auto.service:auto-service:1.1.1'
|
||||
|
||||
implementation 'com.contrarywind:Android-PickerView:4.1.9'
|
||||
|
||||
// ViewModel
|
||||
// implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.0"
|
||||
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.6.1"
|
||||
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1"
|
||||
|
||||
// Retrofit
|
||||
// implementation "com.squareup.retrofit2:retrofit:2.9.0"
|
||||
// implementation "com.squareup.retrofit2:converter-gson:2.9.0"
|
||||
|
||||
// OkHttp
|
||||
// implementation "com.squareup.okhttp3:okhttp:4.11.0"
|
||||
// implementation "com.squareup.okhttp3:logging-interceptor:4.11.0"
|
||||
|
||||
// Coroutines
|
||||
// implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1"
|
||||
}
|
||||
@@ -37,7 +37,8 @@
|
||||
<activity android:name=".ui.tunneling.activity.AddWorkingPointActivity"
|
||||
android:windowSoftInputMode="adjustPan"/>
|
||||
<activity android:name=".ui.tunneling.activity.TunnelingActivity" />
|
||||
<activity android:name=".ui.tunneling.activity.WorkFaceActivity" />
|
||||
<activity android:name=".ui.tunneling.activity.WorkFaceActivity"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -3,7 +3,7 @@ package com.zmkg.coaloperation
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.tencent.qcloud.tuikit.tuiconversation.classicui.page.TUIConversationFragmentContainer
|
||||
//import com.tencent.qcloud.tuikit.tuiconversation.classicui.page.TUIConversationFragmentContainer
|
||||
import com.zmkg.coaloperation.base.BaseVMBActivity
|
||||
import com.zmkg.coaloperation.base.viewmodel.TestViewModel
|
||||
import com.zmkg.coaloperation.bottomtab.HomeBottomTabLayout
|
||||
@@ -59,9 +59,9 @@ class MainActivity : BaseVMBActivity<TestViewModel, ActivityMainBinding>(R.layou
|
||||
return ReportFragment()
|
||||
}
|
||||
|
||||
TAG_MESSAGE -> {
|
||||
return TUIConversationFragmentContainer()
|
||||
}
|
||||
// TAG_MESSAGE -> {
|
||||
// return TUIConversationFragmentContainer()
|
||||
// }
|
||||
|
||||
TAG_MY -> {
|
||||
return UserFragment()
|
||||
|
||||
@@ -12,8 +12,8 @@ import androidx.lifecycle.ViewModelStoreOwner
|
||||
import androidx.multidex.MultiDex
|
||||
import com.orhanobut.logger.AndroidLogAdapter
|
||||
import com.orhanobut.logger.Logger
|
||||
import com.tencent.qcloud.tuicore.TUILogin
|
||||
import com.tencent.qcloud.tuicore.interfaces.TUILoginListener
|
||||
//import com.tencent.qcloud.tuicore.TUILogin
|
||||
//import com.tencent.qcloud.tuicore.interfaces.TUILoginListener
|
||||
import com.zmkg.coaloperation.local.DataStoreManager
|
||||
import com.zmkg.coaloperation.retorfit.UrlConfig
|
||||
import com.zmkg.coaloperation.superfuntion.loginIm
|
||||
@@ -63,24 +63,24 @@ class MyApplication : Application(), ViewModelStoreOwner {
|
||||
}
|
||||
|
||||
fun initLoginStatusListener() {
|
||||
TUILogin.addLoginListener(loginStatusListener)
|
||||
// TUILogin.addLoginListener(loginStatusListener)
|
||||
}
|
||||
|
||||
private val loginStatusListener: TUILoginListener = object : TUILoginListener() {
|
||||
override fun onKickedOffline() {
|
||||
if (UrlConfig.isOpenIm){
|
||||
startLoginActivity(CustomActivityManager.getInstance().currentActivity())
|
||||
}
|
||||
}
|
||||
|
||||
override fun onUserSigExpired() {
|
||||
if (TextUtils.isEmpty(DataStoreManager.getUserName())) {
|
||||
startLoginActivity(appContext)
|
||||
} else {
|
||||
loginIm(DataStoreManager.getUserName()){ }
|
||||
}
|
||||
}
|
||||
}
|
||||
// private val loginStatusListener: TUILoginListener = object : TUILoginListener() {
|
||||
// override fun onKickedOffline() {
|
||||
// if (UrlConfig.isOpenIm){
|
||||
// startLoginActivity(CustomActivityManager.getInstance().currentActivity())
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// override fun onUserSigExpired() {
|
||||
// if (TextUtils.isEmpty(DataStoreManager.getUserName())) {
|
||||
// startLoginActivity(appContext)
|
||||
// } else {
|
||||
// loginIm(DataStoreManager.getUserName()){ }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
/** 获取一个全局的ViewModel */
|
||||
@@ -201,9 +201,11 @@ class MyApplication : Application(), ViewModelStoreOwner {
|
||||
// }
|
||||
// }
|
||||
|
||||
override val viewModelStore: ViewModelStore
|
||||
get() = mAppViewModelStore!!
|
||||
|
||||
override fun getViewModelStore(): ViewModelStore {
|
||||
return mAppViewModelStore!!
|
||||
}
|
||||
// override fun getViewModelStore(): ViewModelStore {
|
||||
// return mAppViewModelStore!!
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.zmkg.coaloperation.adapter
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.widget.addTextChangedListener
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
||||
import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.databinding.ListItemRockBinding
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelRoofLithologyEntity
|
||||
|
||||
class TunnelRoofLithologyAdapter(var list: MutableList<TunnelRoofLithologyEntity>) :
|
||||
BaseQuickAdapter<TunnelRoofLithologyEntity, TunnelRoofLithologyAdapter.VH>(
|
||||
R.layout.list_item_rock, list
|
||||
) {
|
||||
|
||||
inner class VH(var binding: ListItemRockBinding) : BaseViewHolder(binding.root)
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): VH {
|
||||
val binding = ListItemRockBinding.inflate(
|
||||
LayoutInflater.from(context),
|
||||
parent,
|
||||
false
|
||||
)
|
||||
return VH(binding).also {
|
||||
bindViewClickListener(it, viewType)
|
||||
}
|
||||
}
|
||||
|
||||
override fun convert(holder: VH, item: TunnelRoofLithologyEntity) {
|
||||
holder.binding.let {
|
||||
it.root.tag = item.lithologyId
|
||||
it.tvRockStartLen.run {
|
||||
addTextChangedListener(onTextChanged = { text, start, before, count ->
|
||||
item.positionStart = text.toString().trim()
|
||||
})
|
||||
setText(item.positionStart)
|
||||
}
|
||||
it.tvRockEndLen.run {
|
||||
addTextChangedListener(onTextChanged = { text, start, before, count ->
|
||||
item.positionEnd = text.toString().trim()
|
||||
})
|
||||
setText(item.positionEnd)
|
||||
}
|
||||
it.tvRockType.run {
|
||||
addTextChangedListener(onTextChanged = { text, start, before, count ->
|
||||
item.lithologyType = text.toString().trim()
|
||||
})
|
||||
setText(item.lithologyType)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.zmkg.coaloperation.adapter
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.view.updateLayoutParams
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
||||
import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.databinding.ListItemTunnelWorkingFaceBinding
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelWorkingFaceEntity
|
||||
import com.zmkg.coaloperation.ui.tunneling.activity.TunnelingActivity
|
||||
import com.zmkg.coaloperation.ui.tunneling.activity.WorkingPointActivity
|
||||
import com.zmkg.coaloperation.utils.ScreenUtil
|
||||
|
||||
class TunnelWorkingFaceAdapter(var list: MutableList<TunnelWorkingFaceEntity>) :
|
||||
BaseQuickAdapter<TunnelWorkingFaceEntity, TunnelWorkingFaceAdapter.VH>(
|
||||
R.layout.list_item_tunnel_working_face, list
|
||||
) {
|
||||
|
||||
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): VH {
|
||||
val inflater = LayoutInflater.from(context)
|
||||
val binding = ListItemTunnelWorkingFaceBinding.inflate(inflater, parent, false)
|
||||
return VH(binding).also {
|
||||
bindViewClickListener(it, viewType)
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
override fun convert(
|
||||
holder: VH,
|
||||
item: TunnelWorkingFaceEntity
|
||||
) {
|
||||
holder.binding.let { binding ->
|
||||
binding.includeHeader.root.isEnabled = false
|
||||
binding.tvWorkingFaceName.text = item.surfaceName
|
||||
binding.llFaceRecord.visibility = if (item.isExpandRecord) View.VISIBLE else View.GONE
|
||||
binding.ivExpandRecord.setImageResource(
|
||||
if (item.isExpandRecord) R.drawable.ic_arrow_down_white else R.drawable.ic_arrow_right_gray
|
||||
)
|
||||
binding.ivExpandRecord.tag = item.isExpandRecord.toString()
|
||||
binding.rvFaceRecord.let { rv ->
|
||||
rv.layoutManager = LinearLayoutManager(context)
|
||||
if (item.recordList == null) {
|
||||
item.recordList = mutableListOf()
|
||||
}
|
||||
val size = item.recordList!!.size
|
||||
rv.updateLayoutParams {
|
||||
height = if (size >= 3)
|
||||
ScreenUtil.dp2px(150F)
|
||||
else
|
||||
RecyclerView.LayoutParams.WRAP_CONTENT
|
||||
}
|
||||
rv.isVerticalScrollBarEnabled = size >= 3
|
||||
rv.isVerticalFadingEdgeEnabled = size < 3
|
||||
rv.overScrollMode = if (size >= 3) View.OVER_SCROLL_IF_CONTENT_SCROLLS else View.OVER_SCROLL_NEVER
|
||||
rv.adapter = TunnelWorkingFaceRecordAdapter(item.recordList!!).apply {
|
||||
setOnItemClickListener { adapter, view, recordPosition ->
|
||||
// if (recordPosition == 0) {
|
||||
// //0为头部表示,不需要点击操作
|
||||
// return@setOnItemClickListener
|
||||
// }
|
||||
context.let { ctx ->
|
||||
if (ctx is TunnelingActivity) {
|
||||
ctx.toActivity(WorkingPointActivity::class.java, Bundle().apply {
|
||||
putString(WorkingPointActivity.FACE_NAME, item.surfaceName)
|
||||
putParcelable(
|
||||
WorkingPointActivity.FACE_RECORD,
|
||||
item.recordList!![recordPosition]
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inner class VH(var binding: ListItemTunnelWorkingFaceBinding) : BaseViewHolder(binding.root)
|
||||
|
||||
init {
|
||||
addChildClickViewIds(R.id.start_record, R.id.ivExpandRecord)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.zmkg.coaloperation.adapter
|
||||
|
||||
import android.graphics.Color
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
||||
import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelWorkingFaceRecordEntity
|
||||
import androidx.core.graphics.toColorInt
|
||||
import com.zmkg.coaloperation.databinding.ListItemTunnelWorkingFaceRecordBinding
|
||||
|
||||
class TunnelWorkingFaceRecordAdapter(var list: MutableList<TunnelWorkingFaceRecordEntity>) :
|
||||
BaseQuickAdapter<TunnelWorkingFaceRecordEntity, TunnelWorkingFaceRecordAdapter.VH>(
|
||||
R.layout.list_item_tunnel_working_face_record, list
|
||||
) {
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): VH {
|
||||
val inflater = LayoutInflater.from(context)
|
||||
val binding = ListItemTunnelWorkingFaceRecordBinding.inflate(inflater, parent, false)
|
||||
return VH(binding).also {
|
||||
bindViewClickListener(it, viewType)
|
||||
}
|
||||
}
|
||||
|
||||
override fun convert(
|
||||
holder: VH,
|
||||
item: TunnelWorkingFaceRecordEntity
|
||||
) {
|
||||
val position = holder.layoutPosition
|
||||
holder.binding.let {
|
||||
// if (position == 0) {
|
||||
// it.time.setTextColor(Color.WHITE)
|
||||
// it.time.textSize = 14f
|
||||
// it.record.setTextColor(Color.WHITE)
|
||||
// it.record.textSize = 14f
|
||||
// it.operation.setTextColor(Color.WHITE)
|
||||
// it.operation.textSize = 14f
|
||||
// } else {
|
||||
it.time.setTextColor("#FF6A6F87".toColorInt())
|
||||
it.time.textSize = 12f
|
||||
it.record.setTextColor("#FF6A6F87".toColorInt())
|
||||
it.record.textSize = 12f
|
||||
it.operation.setTextColor("#FFA3FEA6".toColorInt())
|
||||
it.operation.textSize = 12f
|
||||
// }
|
||||
it.time.text = item.workingDate
|
||||
it.record.text = item.recordPerson
|
||||
it.operation.text = if (item.operationType == "1") "查看" else "操作"
|
||||
it.divider.visibility =
|
||||
if (position == list.size - 1) View.GONE else View.VISIBLE
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inner class VH(var binding: ListItemTunnelWorkingFaceRecordBinding) :
|
||||
BaseViewHolder(binding.root)
|
||||
|
||||
}
|
||||
@@ -27,7 +27,9 @@ class WorkingItemAdapter(data: MutableList<WorkingFaceItem>) :
|
||||
parent,
|
||||
false
|
||||
)
|
||||
return VH(binding)
|
||||
return VH(binding).also {
|
||||
bindViewClickListener(it, viewType)
|
||||
}
|
||||
}
|
||||
|
||||
override fun convert(
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.zmkg.coaloperation.bean
|
||||
|
||||
data class WorkingFaceItem(
|
||||
var name: String = "",
|
||||
var value: String = "",
|
||||
var name: String? = "",
|
||||
var value: String? = "",
|
||||
var items: MutableList<RockItem>? = null,
|
||||
var pageType:Int = 0
|
||||
)
|
||||
@@ -12,3 +12,8 @@ data class RockItem(
|
||||
var endLen: Int = 0,
|
||||
val rockType: String = ""
|
||||
)
|
||||
|
||||
data class WorkTeam(
|
||||
var teamId:String,
|
||||
var teamName: String
|
||||
)
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.zmkg.coaloperation.db
|
||||
|
||||
import android.content.Context
|
||||
import androidx.room.Database
|
||||
import androidx.room.Room
|
||||
import androidx.room.RoomDatabase
|
||||
import androidx.room.migration.Migration
|
||||
import androidx.sqlite.db.SupportSQLiteDatabase
|
||||
import com.zmkg.coaloperation.db.dao.TunnelRoofLithologyDao
|
||||
import com.zmkg.coaloperation.db.dao.TunnelWorkingFaceDao
|
||||
import com.zmkg.coaloperation.db.dao.TunnelWorkingFaceRecordDao
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelRoofLithologyEntity
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelWorkingFaceEntity
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelWorkingFaceRecordEntity
|
||||
|
||||
@Database(
|
||||
entities = [
|
||||
TunnelWorkingFaceEntity::class,
|
||||
TunnelWorkingFaceRecordEntity::class,
|
||||
TunnelRoofLithologyEntity::class,
|
||||
],
|
||||
version = 3,
|
||||
exportSchema = true
|
||||
)
|
||||
abstract class AppDatabase : RoomDatabase() {
|
||||
abstract fun tunnelWorkingFaceDao(): TunnelWorkingFaceDao
|
||||
abstract fun tunnelWorkingFaceRecordDao(): TunnelWorkingFaceRecordDao
|
||||
abstract fun tunnelRoofLithologyDao(): TunnelRoofLithologyDao
|
||||
|
||||
companion object {
|
||||
@Volatile
|
||||
private var INSTANCE: AppDatabase? = null
|
||||
|
||||
fun getDatabase(context: Context): AppDatabase {
|
||||
return INSTANCE ?: synchronized(this) {
|
||||
val instance = Room.databaseBuilder(
|
||||
context.applicationContext,
|
||||
AppDatabase::class.java,
|
||||
"digitalCoalMiningPlatform.db"
|
||||
)
|
||||
.addCallback(object : Callback() {
|
||||
override fun onCreate(db: SupportSQLiteDatabase) {
|
||||
// 数据库首次创建时初始化数据
|
||||
}
|
||||
})
|
||||
// .addMigrations(MIGRATION_1_2)
|
||||
.addMigrations(MIGRATION_2_3)
|
||||
.build()
|
||||
INSTANCE = instance
|
||||
instance
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val MIGRATION_1_2 = MigrationImpl(1, 2) { db ->
|
||||
db.execSQL("""
|
||||
CREATE TABLE IF NOT EXISTS `tunnel_roof_lithology` (
|
||||
`lithologyId` INTEGER PRIMARY KEY NOT NULL,
|
||||
`surfaceId` INTEGER NOT NULL,
|
||||
`recordId` INTEGER NOT NULL,
|
||||
`positionStart` INTEGER NOT NULL,
|
||||
`positionEnd` INTEGER NOT NULL,
|
||||
`lithologyType` TEXT NOT NULL,
|
||||
`createTime` TEXT NOT NULL
|
||||
)
|
||||
""".trimIndent())
|
||||
}
|
||||
val MIGRATION_2_3 = MigrationImpl(2, 3) { db ->
|
||||
db.execSQL("ALTER TABLE tunnel_roof_lithology RENAME TO tunnel_roof_lithology2")
|
||||
db.execSQL("""
|
||||
CREATE TABLE IF NOT EXISTS `tunnel_roof_lithology` (
|
||||
`lithologyId` INTEGER PRIMARY KEY NOT NULL,
|
||||
`surfaceId` INTEGER NOT NULL,
|
||||
`recordId` INTEGER NOT NULL,
|
||||
`positionStart` TEXT NOT NULL,
|
||||
`positionEnd` TEXT NOT NULL,
|
||||
`lithologyType` TEXT NOT NULL,
|
||||
`createTime` TEXT NOT NULL
|
||||
)
|
||||
""".trimIndent())
|
||||
db.execSQL("""
|
||||
INSERT INTO tunnel_roof_lithology
|
||||
SELECT lithologyId,surfaceId,recordId,CAST(positionStart AS TEXT),CAST(positionEnd AS TEXT),lithologyType,createTime
|
||||
FROM tunnel_roof_lithology2
|
||||
""".trimIndent())
|
||||
db.execSQL("DROP TABLE tunnel_roof_lithology2");
|
||||
}
|
||||
|
||||
class MigrationImpl(
|
||||
startVersion: Int,
|
||||
endVersion: Int,
|
||||
private val block: (db: SupportSQLiteDatabase) -> Unit
|
||||
) : Migration(startVersion, endVersion) {
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
block(database)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.zmkg.coaloperation.db.dao
|
||||
|
||||
import androidx.room.Dao
|
||||
import androidx.room.Insert
|
||||
import androidx.room.Query
|
||||
import androidx.room.Update
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelRoofLithologyEntity
|
||||
|
||||
@Dao
|
||||
interface TunnelRoofLithologyDao {
|
||||
@Insert
|
||||
fun insert(entity: TunnelRoofLithologyEntity): Long
|
||||
|
||||
@Update
|
||||
fun update(entity: TunnelRoofLithologyEntity)
|
||||
|
||||
@Query("SELECT * FROM tunnel_roof_lithology ORDER BY createTime ASC")
|
||||
fun getEntityList(): MutableList<TunnelRoofLithologyEntity>?
|
||||
|
||||
@Query("SELECT * FROM tunnel_roof_lithology WHERE surfaceId = :surfaceId ORDER BY createTime ASC")
|
||||
fun getEntityListByFaceId(surfaceId: Long): MutableList<TunnelRoofLithologyEntity>?
|
||||
|
||||
@Query("SELECT * FROM tunnel_roof_lithology WHERE surfaceId = :surfaceId AND recordId = :recordId ORDER BY createTime ASC")
|
||||
fun getEntityListByRecordId(surfaceId: Long, recordId: Long): MutableList<TunnelRoofLithologyEntity>?
|
||||
|
||||
@Query("SELECT * FROM tunnel_roof_lithology WHERE lithologyId = :lithologyId")
|
||||
fun getEntityById(lithologyId: Long): TunnelRoofLithologyEntity?
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.zmkg.coaloperation.db.dao
|
||||
|
||||
import androidx.room.Dao
|
||||
import androidx.room.Insert
|
||||
import androidx.room.Query
|
||||
import androidx.room.Update
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelWorkingFaceEntity
|
||||
|
||||
//import kotlinx.coroutines.flow.Flow
|
||||
|
||||
@Dao
|
||||
interface TunnelWorkingFaceDao {
|
||||
@Insert
|
||||
fun insert(entity: TunnelWorkingFaceEntity): Long
|
||||
|
||||
@Update
|
||||
fun update(entity: TunnelWorkingFaceEntity)
|
||||
|
||||
@Query("SELECT * FROM tunnel_working_face ORDER BY createTime ASC")
|
||||
fun getEntityList(): MutableList<TunnelWorkingFaceEntity>?
|
||||
|
||||
@Query("SELECT * FROM tunnel_working_face WHERE surfaceId = :surfaceId")
|
||||
fun getEntityById(surfaceId: Long): TunnelWorkingFaceEntity?
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.zmkg.coaloperation.db.dao
|
||||
|
||||
import androidx.room.Dao
|
||||
import androidx.room.Insert
|
||||
import androidx.room.Query
|
||||
import androidx.room.Update
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelWorkingFaceRecordEntity
|
||||
|
||||
//import kotlinx.coroutines.flow.Flow
|
||||
|
||||
@Dao
|
||||
interface TunnelWorkingFaceRecordDao {
|
||||
@Insert
|
||||
fun insert(entity: TunnelWorkingFaceRecordEntity): Long
|
||||
|
||||
@Update
|
||||
fun update(entity: TunnelWorkingFaceRecordEntity)
|
||||
|
||||
@Query("SELECT * FROM tunnel_working_face_record WHERE surfaceId = :surfaceId ORDER BY createTime ASC")
|
||||
fun getEntityList(surfaceId: Long): MutableList<TunnelWorkingFaceRecordEntity>?
|
||||
|
||||
@Query("SELECT * FROM tunnel_working_face_record WHERE surfaceId = :recordId")
|
||||
fun getEntityById(recordId: Long): TunnelWorkingFaceRecordEntity
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.zmkg.coaloperation.db.entiry
|
||||
|
||||
class OtherEntity {
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.zmkg.coaloperation.db.entiry.tunnel
|
||||
|
||||
import android.os.Parcelable
|
||||
import androidx.room.Entity
|
||||
import androidx.room.PrimaryKey
|
||||
import com.zmkg.coaloperation.utils.DateTimeUtil
|
||||
import kotlinx.parcelize.Parcelize
|
||||
import java.time.LocalDateTime
|
||||
|
||||
/**
|
||||
* 掘进工作面-顶板岩性数据表
|
||||
*/
|
||||
@Parcelize
|
||||
@Entity(tableName = "tunnel_roof_lithology")
|
||||
class TunnelRoofLithologyEntity : Parcelable {
|
||||
|
||||
/**
|
||||
* 岩性Id
|
||||
*/
|
||||
@PrimaryKey
|
||||
var lithologyId: Long = 0
|
||||
|
||||
/**
|
||||
* 岩性类型名称
|
||||
*/
|
||||
var lithologyType: String = ""
|
||||
|
||||
/**
|
||||
* 岩性值结束
|
||||
*/
|
||||
var positionEnd: String = ""
|
||||
|
||||
/**
|
||||
* 岩性值起始
|
||||
*/
|
||||
var positionStart: String = ""
|
||||
|
||||
/**
|
||||
* 工作面id
|
||||
*/
|
||||
var surfaceId: Long = 0
|
||||
|
||||
/**
|
||||
* 记录id
|
||||
*/
|
||||
var recordId: Long = 0
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
var createTime: String = DateTimeUtil.formatDateTime(LocalDateTime.now())
|
||||
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
package com.zmkg.coaloperation.db.entiry.tunnel
|
||||
|
||||
//import androidx.room.ColumnInfo
|
||||
import android.os.Parcelable
|
||||
import androidx.room.Entity
|
||||
import androidx.room.Ignore
|
||||
import androidx.room.PrimaryKey
|
||||
import com.zmkg.coaloperation.utils.DateTimeUtil
|
||||
import kotlinx.parcelize.Parcelize
|
||||
import java.time.LocalDateTime
|
||||
|
||||
/**
|
||||
* 掘进工作面表对应字段
|
||||
*/
|
||||
@Parcelize
|
||||
@Entity(tableName = "tunnel_working_face")
|
||||
data class TunnelWorkingFaceEntity(
|
||||
// @PrimaryKey(name = "faceId") val id: Int = 0
|
||||
/**
|
||||
* 工作面id,本地新增数据使用时间戳保证唯一性
|
||||
*/
|
||||
@PrimaryKey
|
||||
var surfaceId: Long = 0,
|
||||
|
||||
/**
|
||||
* 工作面名称
|
||||
*/
|
||||
var surfaceName: String? = "",
|
||||
|
||||
/**
|
||||
* 总进尺
|
||||
*/
|
||||
var totalFootage: String? = "",
|
||||
/**
|
||||
* 累计进尺
|
||||
*/
|
||||
var accumulativeFootage: String? = "",
|
||||
/**
|
||||
* 剩余进尺
|
||||
*/
|
||||
var remainingFootage: String? = "",
|
||||
|
||||
/**
|
||||
* 所属煤层编号
|
||||
*/
|
||||
var seamId: Int? = 0,
|
||||
|
||||
/**
|
||||
* 所属煤层名称
|
||||
*/
|
||||
var seamName: String? = "",
|
||||
|
||||
/**
|
||||
* 所属采区域编号
|
||||
*/
|
||||
var areaId: Int? = 0,
|
||||
|
||||
/**
|
||||
* 所属采区域
|
||||
*/
|
||||
var areaName: String? = "",
|
||||
|
||||
/**
|
||||
* 工作面方位角
|
||||
*/
|
||||
var surfaceAzimuth: String? = "",
|
||||
|
||||
/**
|
||||
* 工作面巷高
|
||||
*/
|
||||
var surfaceHeight: String? = "",
|
||||
|
||||
/**
|
||||
* 工作面巷宽
|
||||
*/
|
||||
var surfaceWidth: String? = "",
|
||||
|
||||
/**
|
||||
* 巷道性质
|
||||
*/
|
||||
var tunnelNature: String? = "",
|
||||
|
||||
/**
|
||||
* 计划工期开始日期
|
||||
*/
|
||||
var planStartDate: String? = "",
|
||||
|
||||
/**
|
||||
* 计划工期结束日期
|
||||
*/
|
||||
var planEndDate: String? = "",
|
||||
|
||||
/**
|
||||
* 地质类型
|
||||
*/
|
||||
var geologicalType: String? = "",
|
||||
|
||||
/**
|
||||
* 水文地质类型
|
||||
*/
|
||||
var hydrogeologicalType: String? = "",
|
||||
|
||||
/**
|
||||
* 煤层发火性
|
||||
*/
|
||||
var seamIgnition: String? = "",
|
||||
|
||||
/**
|
||||
* 瓦斯含量
|
||||
*/
|
||||
var seamGas: String? = "",
|
||||
|
||||
/**
|
||||
* 冲击地压危险性
|
||||
*/
|
||||
var seamBumpPressure: String? = "",
|
||||
|
||||
/**
|
||||
* 支护形式
|
||||
*/
|
||||
var surfaceSupportForm: String? = "",
|
||||
|
||||
var createTime: String = DateTimeUtil.formatDateTime(LocalDateTime.now()),
|
||||
|
||||
@Ignore
|
||||
var recordList: MutableList<TunnelWorkingFaceRecordEntity>? = null,
|
||||
|
||||
@Ignore
|
||||
var isExpandRecord: Boolean = false
|
||||
) : Parcelable {
|
||||
// @Ignore
|
||||
// constructor() : this(surfaceId = 0, recordList = null, isExpandRecord = false)
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.zmkg.coaloperation.db.entiry.tunnel
|
||||
|
||||
import android.os.Parcelable
|
||||
import androidx.room.Entity
|
||||
import androidx.room.Ignore
|
||||
import androidx.room.PrimaryKey
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelWorkingFaceEntity
|
||||
import com.zmkg.coaloperation.utils.DateTimeUtil
|
||||
import kotlinx.parcelize.Parcelize
|
||||
import java.time.LocalDateTime
|
||||
|
||||
@Parcelize
|
||||
@Entity(tableName = "tunnel_working_face_record")
|
||||
data class TunnelWorkingFaceRecordEntity(
|
||||
|
||||
/**
|
||||
* 记录id
|
||||
*/
|
||||
@PrimaryKey
|
||||
var recordId: Long = 0,
|
||||
/**
|
||||
* 工作面id
|
||||
*/
|
||||
var surfaceId: Long = 0,
|
||||
/**
|
||||
* 施工日期
|
||||
*/
|
||||
var workingDate: String? = null,
|
||||
/**
|
||||
* 记录人
|
||||
*/
|
||||
var recordPerson: String? = null,
|
||||
/**
|
||||
* 施工班次
|
||||
*/
|
||||
var teamShift: String? = null,
|
||||
/**
|
||||
* 施工队伍id
|
||||
*/
|
||||
var teamId: String? = null,
|
||||
/**
|
||||
* 施工队伍名称
|
||||
*/
|
||||
var teamName: String? = null,
|
||||
/**
|
||||
* 带队班长
|
||||
*/
|
||||
var teamLeader: String? = null,
|
||||
/**
|
||||
* 本班进尺
|
||||
*/
|
||||
var workingFootage: String? = null,
|
||||
/**
|
||||
* 煤层倾角
|
||||
*/
|
||||
var seamDip: String? = null,
|
||||
/**
|
||||
* 煤层高度
|
||||
*/
|
||||
var seamHeight: String? = null,
|
||||
|
||||
var createTime: String = DateTimeUtil.formatDateTime(LocalDateTime.now()),
|
||||
|
||||
@Ignore
|
||||
var operationType: String = "1"
|
||||
) : Parcelable {
|
||||
// @Ignore
|
||||
// constructor() : this(recordId = 0)
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.zmkg.coaloperation.db.repository
|
||||
|
||||
import com.zmkg.coaloperation.db.dao.TunnelRoofLithologyDao
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelRoofLithologyEntity
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
class TunnelRoofLithologyRepository(private val dao: TunnelRoofLithologyDao) {
|
||||
suspend fun getEntityList() = withContext(Dispatchers.IO) {
|
||||
dao.getEntityList()
|
||||
}
|
||||
|
||||
suspend fun insert(entity: TunnelRoofLithologyEntity) = withContext(Dispatchers.IO) {
|
||||
dao.insert(entity)
|
||||
}
|
||||
|
||||
suspend fun update(entity: TunnelRoofLithologyEntity) = withContext(Dispatchers.IO) {
|
||||
dao.update(entity)
|
||||
}
|
||||
|
||||
suspend fun getEntityListByFaceId(surfaceId: Long) = withContext(Dispatchers.IO) {
|
||||
dao.getEntityListByFaceId(surfaceId)
|
||||
}
|
||||
|
||||
suspend fun getEntityListByRecordId(surfaceId: Long, recordId: Long) = withContext(Dispatchers.IO) {
|
||||
dao.getEntityListByRecordId(surfaceId, recordId)
|
||||
}
|
||||
|
||||
suspend fun getEntityById(lithologyId: Long) = withContext(Dispatchers.IO) {
|
||||
dao.getEntityById(lithologyId)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.zmkg.coaloperation.db.repository
|
||||
|
||||
import com.zmkg.coaloperation.db.dao.TunnelWorkingFaceRecordDao
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelWorkingFaceRecordEntity
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
class TunnelWorkingFaceRecordRepository(private val dao: TunnelWorkingFaceRecordDao) {
|
||||
suspend fun getEntityList(surfaceId: Long) = withContext(Dispatchers.IO) {
|
||||
dao.getEntityList(surfaceId)
|
||||
}
|
||||
|
||||
suspend fun insert(entity: TunnelWorkingFaceRecordEntity) = withContext(Dispatchers.IO) {
|
||||
dao.insert(entity)
|
||||
}
|
||||
|
||||
suspend fun update(entity: TunnelWorkingFaceRecordEntity) = withContext(Dispatchers.IO) {
|
||||
dao.update(entity)
|
||||
}
|
||||
|
||||
suspend fun getEntityById(faceId: Long) = withContext(Dispatchers.IO) {
|
||||
dao.getEntityById(faceId)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.zmkg.coaloperation.db.repository
|
||||
|
||||
import com.zmkg.coaloperation.db.dao.TunnelWorkingFaceDao
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelWorkingFaceEntity
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
class TunnelWorkingFaceRepository(private val dao: TunnelWorkingFaceDao) {
|
||||
suspend fun getEntityList() = withContext(Dispatchers.IO) {
|
||||
dao.getEntityList()
|
||||
}
|
||||
|
||||
suspend fun insert(entity: TunnelWorkingFaceEntity) = withContext(Dispatchers.IO) {
|
||||
dao.insert(entity)
|
||||
}
|
||||
|
||||
suspend fun update(entity: TunnelWorkingFaceEntity) = withContext(Dispatchers.IO) {
|
||||
dao.update(entity)
|
||||
}
|
||||
|
||||
suspend fun getEntityById(faceId: Long) = withContext(Dispatchers.IO) {
|
||||
dao.getEntityById(faceId)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.zmkg.coaloperation.db.viewmodel
|
||||
|
||||
import android.app.Application
|
||||
import androidx.lifecycle.AndroidViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.zmkg.coaloperation.db.AppDatabase
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelRoofLithologyEntity
|
||||
import com.zmkg.coaloperation.db.repository.TunnelRoofLithologyRepository
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
class TunnelRoofLithologyViewModel(application: Application) : AndroidViewModel(application) {
|
||||
private val repository: TunnelRoofLithologyRepository
|
||||
|
||||
init {
|
||||
val dao = AppDatabase.getDatabase(application).tunnelRoofLithologyDao()
|
||||
repository = TunnelRoofLithologyRepository(dao)
|
||||
}
|
||||
|
||||
fun getEntityList(action: (MutableList<TunnelRoofLithologyEntity>?) -> Unit) =
|
||||
viewModelScope.launch {
|
||||
val list: MutableList<TunnelRoofLithologyEntity>? = repository.getEntityList()
|
||||
action(list)
|
||||
}
|
||||
|
||||
fun getEntityList2(
|
||||
surfaceId: Long,
|
||||
action: (MutableList<TunnelRoofLithologyEntity>?) -> Unit
|
||||
) = viewModelScope.launch {
|
||||
val list: MutableList<TunnelRoofLithologyEntity>? =
|
||||
repository.getEntityListByFaceId(surfaceId)
|
||||
action(list)
|
||||
}
|
||||
|
||||
fun getEntityList3(
|
||||
surfaceId: Long,
|
||||
recordId: Long,
|
||||
action: (MutableList<TunnelRoofLithologyEntity>?) -> Unit
|
||||
) = viewModelScope.launch {
|
||||
val list: MutableList<TunnelRoofLithologyEntity>? =
|
||||
repository.getEntityListByRecordId(surfaceId, recordId)
|
||||
action(list)
|
||||
}
|
||||
|
||||
fun insert(entity: TunnelRoofLithologyEntity, action: () -> Unit) = viewModelScope.launch {
|
||||
repository.insert(entity)
|
||||
action()
|
||||
}
|
||||
|
||||
fun update(entity: TunnelRoofLithologyEntity, action: () -> Unit) = viewModelScope.launch {
|
||||
repository.update(entity)
|
||||
action()
|
||||
}
|
||||
|
||||
fun getEntityById(faceId: Long, action: (TunnelRoofLithologyEntity) -> Unit) =
|
||||
viewModelScope.launch {
|
||||
val entity = repository.getEntityById(faceId)
|
||||
entity?.let { action(it) }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.zmkg.coaloperation.db.viewmodel
|
||||
|
||||
import android.app.Application
|
||||
import androidx.lifecycle.AndroidViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.zmkg.coaloperation.db.AppDatabase
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelWorkingFaceRecordEntity
|
||||
import com.zmkg.coaloperation.db.repository.TunnelWorkingFaceRecordRepository
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
class TunnelWorkingFaceRecordViewModel(application: Application) : AndroidViewModel(application) {
|
||||
private val repository: TunnelWorkingFaceRecordRepository
|
||||
|
||||
init {
|
||||
val dao = AppDatabase.getDatabase(application).tunnelWorkingFaceRecordDao()
|
||||
repository = TunnelWorkingFaceRecordRepository(dao)
|
||||
}
|
||||
|
||||
fun getEntityList(surfaceId: Long, action: (MutableList<TunnelWorkingFaceRecordEntity>?) -> Unit) =
|
||||
viewModelScope.launch {
|
||||
val list: MutableList<TunnelWorkingFaceRecordEntity>? = repository.getEntityList(surfaceId)
|
||||
action(list)
|
||||
}
|
||||
|
||||
fun insert(entity: TunnelWorkingFaceRecordEntity, action: () -> Unit) = viewModelScope.launch {
|
||||
repository.insert(entity)
|
||||
action()
|
||||
}
|
||||
|
||||
fun update(entity: TunnelWorkingFaceRecordEntity, action: () -> Unit) = viewModelScope.launch {
|
||||
repository.update(entity)
|
||||
action()
|
||||
}
|
||||
|
||||
fun getEntityById(recordId: Long) = viewModelScope.launch {
|
||||
repository.getEntityById(recordId)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.zmkg.coaloperation.db.viewmodel
|
||||
|
||||
import android.app.Application
|
||||
import androidx.lifecycle.AndroidViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.zmkg.coaloperation.db.AppDatabase
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelWorkingFaceEntity
|
||||
import com.zmkg.coaloperation.db.repository.TunnelWorkingFaceRepository
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
class TunnelWorkingFaceViewModel(application: Application) : AndroidViewModel(application) {
|
||||
private val repository: TunnelWorkingFaceRepository
|
||||
|
||||
init {
|
||||
val dao = AppDatabase.getDatabase(application).tunnelWorkingFaceDao()
|
||||
repository = TunnelWorkingFaceRepository(dao)
|
||||
}
|
||||
|
||||
fun getEntityList(action: (MutableList<TunnelWorkingFaceEntity>?) -> Unit) =
|
||||
viewModelScope.launch {
|
||||
val list: MutableList<TunnelWorkingFaceEntity>? = repository.getEntityList()
|
||||
action(list)
|
||||
}
|
||||
|
||||
fun insert(entity: TunnelWorkingFaceEntity, action: () -> Unit) = viewModelScope.launch {
|
||||
repository.insert(entity)
|
||||
action()
|
||||
}
|
||||
|
||||
fun update(entity: TunnelWorkingFaceEntity, action:()-> Unit) = viewModelScope.launch {
|
||||
repository.update(entity)
|
||||
action()
|
||||
}
|
||||
|
||||
fun getEntityById(faceId: Long, action:(TunnelWorkingFaceEntity)-> Unit) = viewModelScope.launch {
|
||||
val entity = repository.getEntityById(faceId)
|
||||
entity?.let { action(it) }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -2,10 +2,10 @@ package com.zmkg.coaloperation.superfuntion
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.tencent.imsdk.BaseConstants
|
||||
import com.tencent.qcloud.tuicore.TUILogin
|
||||
import com.tencent.qcloud.tuicore.interfaces.TUICallback
|
||||
import com.tencent.qcloud.tuicore.interfaces.TUILoginConfig
|
||||
//import com.tencent.imsdk.BaseConstants
|
||||
//import com.tencent.qcloud.tuicore.TUILogin
|
||||
//import com.tencent.qcloud.tuicore.interfaces.TUICallback
|
||||
//import com.tencent.qcloud.tuicore.interfaces.TUILoginConfig
|
||||
import com.zmkg.coaloperation.MyApplication
|
||||
import com.zmkg.coaloperation.im.signature.GenerateTestUserSig
|
||||
import com.zmkg.coaloperation.local.DataStoreManager
|
||||
@@ -25,54 +25,54 @@ fun Context.loginIm(userId: String,successCall: () -> Unit = {}) {
|
||||
// successCall.invoke()
|
||||
return
|
||||
}
|
||||
if (TUILogin.isUserLogined() && userId == TUILogin.getUserId()) {
|
||||
// successCall.invoke()
|
||||
return
|
||||
}
|
||||
// if (TUILogin.isUserLogined() && userId == TUILogin.getUserId()) {
|
||||
//// successCall.invoke()
|
||||
// return
|
||||
// }
|
||||
|
||||
TUILogin.login(
|
||||
this,
|
||||
GenerateTestUserSig.SDKAPPID,
|
||||
userId,
|
||||
userSig,
|
||||
TUILoginConfig(),
|
||||
object : TUICallback() {
|
||||
override fun onError(code: Int, desc: String) {
|
||||
// successCall.invoke()
|
||||
when (code) {
|
||||
BaseConstants.ERR_SVR_ACCOUNT_USERSIG_EXPIRED,
|
||||
BaseConstants.ERR_USER_SIG_EXPIRED -> {//UserSig过期
|
||||
// CustomToast.makeText(this@loginIm,"im登录失败", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
Log.i(MyApplication.TAG, "imLogin errorCode = $code, errorInfo = $desc")
|
||||
}
|
||||
|
||||
override fun onSuccess() {
|
||||
// successCall.invoke()
|
||||
Log.i(MyApplication.TAG, "imLogin onSuccess ")
|
||||
}
|
||||
})
|
||||
// TUILogin.login(
|
||||
// this,
|
||||
// GenerateTestUserSig.SDKAPPID,
|
||||
// userId,
|
||||
// userSig,
|
||||
// TUILoginConfig(),
|
||||
// object : TUICallback() {
|
||||
// override fun onError(code: Int, desc: String) {
|
||||
//// successCall.invoke()
|
||||
// when (code) {
|
||||
// BaseConstants.ERR_SVR_ACCOUNT_USERSIG_EXPIRED,
|
||||
// BaseConstants.ERR_USER_SIG_EXPIRED -> {//UserSig过期
|
||||
//// CustomToast.makeText(this@loginIm,"im登录失败", Toast.LENGTH_SHORT).show()
|
||||
// }
|
||||
// }
|
||||
// Log.i(MyApplication.TAG, "imLogin errorCode = $code, errorInfo = $desc")
|
||||
// }
|
||||
//
|
||||
// override fun onSuccess() {
|
||||
//// successCall.invoke()
|
||||
// Log.i(MyApplication.TAG, "imLogin onSuccess ")
|
||||
// }
|
||||
// })
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
fun logout(successCall: () -> Unit = {}){
|
||||
if (!TUILogin.isUserLogined()){
|
||||
return
|
||||
}
|
||||
CoroutineScope(Dispatchers.Main).launch{
|
||||
DataStoreManager.setUserName("")
|
||||
}
|
||||
TUILogin.logout(object : TUICallback(){
|
||||
override fun onSuccess() {
|
||||
successCall.invoke()
|
||||
}
|
||||
|
||||
override fun onError(errorCode: Int, errorMessage: String?) {
|
||||
Log.i("","IM logout errorCode = $errorCode, errorInfo = $errorMessage")
|
||||
}
|
||||
})
|
||||
// if (!TUILogin.isUserLogined()){
|
||||
// return
|
||||
// }
|
||||
// CoroutineScope(Dispatchers.Main).launch{
|
||||
// DataStoreManager.setUserName("")
|
||||
// }
|
||||
// TUILogin.logout(object : TUICallback(){
|
||||
// override fun onSuccess() {
|
||||
// successCall.invoke()
|
||||
// }
|
||||
//
|
||||
// override fun onError(errorCode: Int, errorMessage: String?) {
|
||||
// Log.i("","IM logout errorCode = $errorCode, errorInfo = $errorMessage")
|
||||
// }
|
||||
// })
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,28 @@
|
||||
package com.zmkg.coaloperation.ui.tunneling.activity
|
||||
|
||||
//import com.tencent.qcloud.tuikit.timcommon.util.SoftKeyBoardUtil
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import com.tencent.qcloud.tuikit.timcommon.util.SoftKeyBoardUtil
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.adapter.TunnelRoofLithologyAdapter
|
||||
import com.zmkg.coaloperation.base.BaseVMBActivity
|
||||
import com.zmkg.coaloperation.base.viewmodel.TestViewModel
|
||||
import com.zmkg.coaloperation.bean.WorkTeam
|
||||
import com.zmkg.coaloperation.databinding.ActivityAddWorkingPointBinding
|
||||
import com.zmkg.coaloperation.databinding.ListItemRockBinding
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelRoofLithologyEntity
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelWorkingFaceRecordEntity
|
||||
import com.zmkg.coaloperation.db.viewmodel.TunnelRoofLithologyViewModel
|
||||
import com.zmkg.coaloperation.db.viewmodel.TunnelWorkingFaceRecordViewModel
|
||||
import com.zmkg.coaloperation.superfuntion.toJson
|
||||
import com.zmkg.coaloperation.utils.KeyboardUtil
|
||||
import com.zmkg.coaloperation.utils.PickerUtil
|
||||
import com.zmkg.coaloperation.utils.clickWithDebounce
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
|
||||
/**
|
||||
* 开始记录
|
||||
@@ -19,66 +31,124 @@ class AddWorkingPointActivity :
|
||||
BaseVMBActivity<TestViewModel, ActivityAddWorkingPointBinding>(R.layout.activity_add_working_point) {
|
||||
|
||||
companion object {
|
||||
const val TAG = "AddWorkingPointActivity"
|
||||
const val SHOW_TYPE = "showType"
|
||||
const val FACE_NAME = "faceName"
|
||||
const val FACE_ID = "faceId"
|
||||
const val FACE_RECORD = "faceRecord"
|
||||
}
|
||||
|
||||
private var showType = 0
|
||||
private var surfaceId: Long = 0
|
||||
|
||||
private var faceName: String? = null
|
||||
private var faceRecord: TunnelWorkingFaceRecordEntity? = null
|
||||
|
||||
private val workingFaceRecordViewModel: TunnelWorkingFaceRecordViewModel by lazy {
|
||||
ViewModelProvider(this)[TunnelWorkingFaceRecordViewModel::class.java]
|
||||
}
|
||||
|
||||
private val roofLithologyViewModel: TunnelRoofLithologyViewModel by lazy {
|
||||
ViewModelProvider(this)[TunnelRoofLithologyViewModel::class.java]
|
||||
}
|
||||
|
||||
private val roofLithologyList: MutableList<TunnelRoofLithologyEntity> = mutableListOf()
|
||||
|
||||
private val roofLithologyAdapter: TunnelRoofLithologyAdapter by lazy {
|
||||
TunnelRoofLithologyAdapter(roofLithologyList)
|
||||
}
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
mBinding.toolbarLay.vLine.visibility = View.GONE
|
||||
showType = intent.extras?.getInt(SHOW_TYPE) ?: 0
|
||||
mBinding.toolbarLay.rightText =
|
||||
if (showType == 0) "开始记录" else "修改记录"
|
||||
mBinding.toolbarLay.title= if (showType == 0) "开始记录" else "修改记录"
|
||||
mBinding.btnSave.text = if (showType == 0) "保存" else "修改"
|
||||
// mBinding.toolbarLay.rightText = ""
|
||||
|
||||
mBinding.root.setOnClickListener {
|
||||
mBinding.root.setOnClickListener { v ->
|
||||
window?.let {
|
||||
SoftKeyBoardUtil.hideKeyBoard(window)
|
||||
// SoftKeyBoardUtil.hideKeyBoard(window)
|
||||
KeyboardUtil.hideKeyboard(v)
|
||||
}
|
||||
}
|
||||
mBinding.tvWorkDate.clickWithDebounce {
|
||||
PickerUtil.showTimePicker(this) {date->
|
||||
mBinding.tvWorkDate.text = date
|
||||
mBinding.tvWorkingDate.let {
|
||||
it.setOnClickListener { v ->
|
||||
PickerUtil.showTimePicker(this, it.text.toString().trim()) { date ->
|
||||
it.text = date
|
||||
}
|
||||
}
|
||||
}
|
||||
mBinding.tvFaceName.text = intent.getStringExtra(FACE_NAME)
|
||||
mBinding.toolbarLay.title = intent.getStringExtra(FACE_NAME)
|
||||
faceName = intent.getStringExtra(FACE_NAME)
|
||||
if (showType == 0) {
|
||||
surfaceId = intent.getLongExtra(FACE_ID, 0L)
|
||||
} else if (showType == 1) {
|
||||
faceRecord = intent.getParcelableExtra(FACE_RECORD)
|
||||
if (faceRecord == null) {
|
||||
showToast("未查询到当前记录")
|
||||
return
|
||||
}
|
||||
surfaceId = faceRecord!!.surfaceId
|
||||
loadFaceRecord()
|
||||
}
|
||||
mBinding.tvFaceName.text = faceName
|
||||
|
||||
val teamList = mutableListOf<String>()
|
||||
teamList.add("A地区第1施工队")
|
||||
teamList.add("A地区第2施工队")
|
||||
teamList.add("B地区第1施工队")
|
||||
teamList.add("B地区第2施工队")
|
||||
teamList.add("C地区第1施工队")
|
||||
teamList.add("C地区第2施工队")
|
||||
teamList.add("D地区第1施工队")
|
||||
teamList.add("D地区第2施工队")
|
||||
mBinding.tvWorkTeam.clickWithDebounce {
|
||||
PickerUtil.showOptionsPicker(this, teamList) {team->
|
||||
mBinding.tvWorkTeam.text = team
|
||||
val teamList = mutableListOf<WorkTeam>()
|
||||
teamList.add(WorkTeam(teamId = "1", teamName = "A地区第1施工队"))
|
||||
teamList.add(WorkTeam(teamId = "2", teamName = "A地区第2施工队"))
|
||||
teamList.add(WorkTeam(teamId = "3", teamName = "B地区第1施工队"))
|
||||
teamList.add(WorkTeam(teamId = "4", teamName = "B地区第2施工队"))
|
||||
teamList.add(WorkTeam(teamId = "5", teamName = "C地区第1施工队"))
|
||||
teamList.add(WorkTeam(teamId = "6", teamName = "C地区第2施工队"))
|
||||
teamList.add(WorkTeam(teamId = "7", teamName = "D地区第1施工队"))
|
||||
teamList.add(WorkTeam(teamId = "8", teamName = "D地区第2施工队"))
|
||||
mBinding.tvWorkTeam.setOnClickListener { v ->
|
||||
PickerUtil.showTeamsPicker(this, teamList) { team ->
|
||||
mBinding.tvWorkTeam.text = team.teamName
|
||||
mBinding.tvWorkTeam.tag = team.teamId
|
||||
}
|
||||
}
|
||||
val workTypeList = mutableListOf<String>()
|
||||
workTypeList.add("早班")
|
||||
workTypeList.add("中班")
|
||||
workTypeList.add("晚班")
|
||||
mBinding.tvWorkType.clickWithDebounce {
|
||||
PickerUtil.showOptionsPicker(this, workTypeList) {team->
|
||||
mBinding.tvWorkType.text = team
|
||||
mBinding.tvTeamShift.setOnClickListener { v ->
|
||||
PickerUtil.showOptionsPicker(this, "请选择施工班次", workTypeList) { team ->
|
||||
mBinding.tvTeamShift.text = team
|
||||
}
|
||||
}
|
||||
mBinding.btnAddPoint.clickWithDebounce {
|
||||
addRockPoint()
|
||||
}
|
||||
|
||||
mBinding.btnSave.clickWithDebounce {
|
||||
if (showType == 0) {
|
||||
saveFaceRecord()
|
||||
return@clickWithDebounce
|
||||
}
|
||||
updateFaceRecord()
|
||||
}
|
||||
mBinding.btnExport.clickWithDebounce {
|
||||
showToast("开发中……")
|
||||
}
|
||||
|
||||
mBinding.rvLithology.let {
|
||||
it.layoutManager = LinearLayoutManager(this)
|
||||
it.adapter = roofLithologyAdapter
|
||||
}
|
||||
|
||||
addRockPoint()
|
||||
}
|
||||
|
||||
private fun addRockPoint() {
|
||||
val itemBinding = ListItemRockBinding.inflate(
|
||||
LayoutInflater.from(this),
|
||||
mBinding.llRockPoint,
|
||||
false
|
||||
)
|
||||
mBinding.llRockPoint.addView(itemBinding.root)
|
||||
roofLithologyList.add(TunnelRoofLithologyEntity().also {
|
||||
it.lithologyId = System.currentTimeMillis()
|
||||
it.surfaceId = surfaceId
|
||||
it.recordId = if (showType == 1) faceRecord!!.recordId else System.currentTimeMillis()
|
||||
})
|
||||
// roofLithologyAdapter.notifyDataSetChanged()
|
||||
val pos = roofLithologyList.size
|
||||
roofLithologyAdapter.notifyItemInserted(pos)
|
||||
roofLithologyAdapter.notifyItemRangeChanged(pos, pos + 1)
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
@@ -90,4 +160,111 @@ class AddWorkingPointActivity :
|
||||
override fun processClick(v: View?) {
|
||||
}
|
||||
|
||||
private fun saveFaceRecord() {
|
||||
if (mBinding.tvWorkingDate.text.isBlank()) {
|
||||
showToast("请选择施工日期")
|
||||
return
|
||||
}
|
||||
if (mBinding.tvTeamShift.text.isBlank()) {
|
||||
showToast("请选择施工班次")
|
||||
return
|
||||
}
|
||||
if (mBinding.tvWorkTeam.text.isBlank()) {
|
||||
showToast("请选择施工队伍")
|
||||
return
|
||||
}
|
||||
if (mBinding.etTeamLeader.text.isBlank()) {
|
||||
showToast("请输入带班队长")
|
||||
return
|
||||
}
|
||||
if (mBinding.etWorkingFootage.text.isBlank()) {
|
||||
showToast("请输入本班进尺")
|
||||
return
|
||||
}
|
||||
if (mBinding.etSeamDip.text.isBlank()) {
|
||||
showToast("请输入煤层倾角")
|
||||
return
|
||||
}
|
||||
if (mBinding.etSeamHeight.text.isBlank()) {
|
||||
showToast("请输入煤层高")
|
||||
return
|
||||
}
|
||||
if (mBinding.etRecordPerson.text.isBlank()) {
|
||||
showToast("请输入填写人")
|
||||
return
|
||||
}
|
||||
val emptyDataList = roofLithologyList.filter {
|
||||
it.positionStart.isBlank() || it.positionEnd.isBlank() || it.lithologyType.isBlank()
|
||||
}
|
||||
if (emptyDataList.isNotEmpty()) {
|
||||
showToast("顶板岩性中存在部分编录点数据为空")
|
||||
return
|
||||
}
|
||||
|
||||
val faceRecord = TunnelWorkingFaceRecordEntity().also {
|
||||
it.recordId = System.currentTimeMillis()
|
||||
it.surfaceId = surfaceId
|
||||
it.workingDate = mBinding.tvWorkingDate.text.toString()
|
||||
it.teamShift = mBinding.tvTeamShift.text.toString()
|
||||
it.teamName = mBinding.tvWorkTeam.text.toString()
|
||||
it.teamId = mBinding.tvWorkTeam.tag.toString()
|
||||
|
||||
it.teamLeader = mBinding.etTeamLeader.text.toString().trim()
|
||||
it.workingFootage = mBinding.etWorkingFootage.text.toString().trim()
|
||||
it.seamDip = mBinding.etSeamDip.text.toString().trim()
|
||||
it.seamHeight = mBinding.etSeamHeight.text.toString().trim()
|
||||
it.recordPerson = mBinding.etRecordPerson.text.toString().trim()
|
||||
}
|
||||
|
||||
Log.d(TAG, "saveFaceRecord: ${roofLithologyList.toJson()}")
|
||||
|
||||
workingFaceRecordViewModel.insert(faceRecord) {
|
||||
roofLithologyList.forEach {
|
||||
roofLithologyViewModel.insert(it) {}
|
||||
}
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadFaceRecord() {
|
||||
faceRecord?.let {
|
||||
mBinding.tvWorkingDate.text = it.workingDate
|
||||
mBinding.tvTeamShift.text = it.teamShift
|
||||
mBinding.tvWorkTeam.text = it.teamName
|
||||
mBinding.tvWorkTeam.tag = it.teamId
|
||||
|
||||
mBinding.etTeamLeader.setText(it.teamLeader)
|
||||
mBinding.etWorkingFootage.setText(it.workingFootage)
|
||||
mBinding.etSeamDip.setText(it.seamDip)
|
||||
mBinding.etSeamHeight.setText(it.seamHeight)
|
||||
mBinding.etRecordPerson.setText(it.recordPerson)
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateFaceRecord() {
|
||||
val faceRecord = TunnelWorkingFaceRecordEntity().also {
|
||||
it.recordId = faceRecord!!.recordId
|
||||
it.surfaceId = surfaceId
|
||||
it.workingDate = mBinding.tvWorkingDate.text.toString()
|
||||
it.teamShift = mBinding.tvTeamShift.text.toString()
|
||||
it.teamName = mBinding.tvWorkTeam.text.toString()
|
||||
it.teamId = mBinding.tvWorkTeam.tag.toString()
|
||||
|
||||
it.teamLeader = mBinding.etTeamLeader.text.toString().trim()
|
||||
it.workingFootage = mBinding.etWorkingFootage.text.toString().trim()
|
||||
it.seamDip = mBinding.etSeamDip.text.toString().trim()
|
||||
it.seamHeight = mBinding.etSeamHeight.text.toString().trim()
|
||||
it.recordPerson = mBinding.etRecordPerson.text.toString().trim()
|
||||
}
|
||||
workingFaceRecordViewModel.update(faceRecord) {
|
||||
EventBus.getDefault().post(faceRecord)
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onFaceRecordEvent(event: TunnelWorkingFaceRecordEntity) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,19 +1,22 @@
|
||||
package com.zmkg.coaloperation.ui.tunneling.activity
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.lifecycle.repeatOnLifecycle
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.adapter.TunnelWorkingFaceAdapter
|
||||
import com.zmkg.coaloperation.adapter.TunnelWorkingFaceRecordAdapter
|
||||
import com.zmkg.coaloperation.base.BaseVMBActivity
|
||||
import com.zmkg.coaloperation.databinding.ActivityTunnelingBinding
|
||||
import com.zmkg.coaloperation.event.TunnelingWorkFaceRefreshEvent
|
||||
import com.zmkg.coaloperation.ui.tunneling.adapter.TunnelingHomeAdapter
|
||||
import com.zmkg.coaloperation.ui.tunneling.bean.TunnelingHomeBean
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelWorkingFaceEntity
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelWorkingFaceRecordEntity
|
||||
import com.zmkg.coaloperation.db.viewmodel.TunnelWorkingFaceRecordViewModel
|
||||
import com.zmkg.coaloperation.db.viewmodel.TunnelWorkingFaceViewModel
|
||||
import com.zmkg.coaloperation.ui.tunneling.viewmodel.TunnelingViewModel
|
||||
import kotlinx.coroutines.flow.collectLatest
|
||||
import kotlinx.coroutines.launch
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
|
||||
/**
|
||||
* 掘进首页列表
|
||||
@@ -21,131 +24,91 @@ import kotlinx.coroutines.launch
|
||||
class TunnelingActivity :
|
||||
BaseVMBActivity<TunnelingViewModel, ActivityTunnelingBinding>(R.layout.activity_tunneling) {
|
||||
|
||||
private val tunnelingHomeAdapter: TunnelingHomeAdapter by lazy {
|
||||
TunnelingHomeAdapter {index,surfaceId->
|
||||
mViewModel.getTunnelingHomeItemData(index,surfaceId)
|
||||
companion object {
|
||||
val FACE_RECORD_HEADER = TunnelWorkingFaceRecordEntity(
|
||||
recordId = -1,
|
||||
surfaceId = -1,
|
||||
workingDate = "时间",
|
||||
recordPerson = "记录人",
|
||||
operationType = "0"
|
||||
)
|
||||
}
|
||||
|
||||
private val workingFaceViewModel: TunnelWorkingFaceViewModel by lazy {
|
||||
ViewModelProvider(this)[TunnelWorkingFaceViewModel::class.java]
|
||||
}
|
||||
private val workingFaceRecordViewModel: TunnelWorkingFaceRecordViewModel by lazy {
|
||||
ViewModelProvider(this)[TunnelWorkingFaceRecordViewModel::class.java]
|
||||
}
|
||||
|
||||
|
||||
private val workingFaceList = mutableListOf<TunnelWorkingFaceEntity>()
|
||||
|
||||
private val workingFaceAdapter: TunnelWorkingFaceAdapter by lazy {
|
||||
TunnelWorkingFaceAdapter(workingFaceList).apply {
|
||||
setOnItemClickListener { _, _, position ->
|
||||
toActivity(WorkingFaceDetailActivity::class.java, Bundle().apply {
|
||||
putParcelable(WorkingFaceDetailActivity.FACE_DETAIL, workingFaceList[position])
|
||||
})
|
||||
}
|
||||
setOnItemChildClickListener { _, view, position ->
|
||||
if (view.id == R.id.ivExpandRecord) {
|
||||
val expandState = view.tag.toString().toBooleanStrictOrNull() ?: false
|
||||
workingFaceList[position].isExpandRecord = expandState.not()
|
||||
if (workingFaceList[position].isExpandRecord) {
|
||||
getFaceRecord(position)
|
||||
} else {
|
||||
notifyItemChanged(position)
|
||||
}
|
||||
return@setOnItemChildClickListener
|
||||
}
|
||||
if (view.id == R.id.start_record) {
|
||||
toActivity(AddWorkingPointActivity::class.java, Bundle().apply {
|
||||
putLong(
|
||||
AddWorkingPointActivity.FACE_ID,
|
||||
workingFaceList[position].surfaceId
|
||||
)
|
||||
putString(
|
||||
AddWorkingPointActivity.FACE_NAME,
|
||||
workingFaceList[position].surfaceName
|
||||
)
|
||||
putInt(AddWorkingPointActivity.SHOW_TYPE, 0)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
|
||||
mBinding.toolbarLay.rightText = "新增工作面"
|
||||
mBinding.rvList.adapter = tunnelingHomeAdapter
|
||||
|
||||
mBinding.rvList.let {
|
||||
it.layoutManager = LinearLayoutManager(this)
|
||||
it.adapter = workingFaceAdapter
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
override fun initData() {
|
||||
mViewModel.getTunnelingHomeData()
|
||||
workingFaceViewModel.getEntityList { it ->
|
||||
if (it.isNullOrEmpty()) {
|
||||
return@getEntityList
|
||||
}
|
||||
workingFaceList.clear()
|
||||
workingFaceList.addAll(it)
|
||||
workingFaceAdapter.notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// HttpUtil.get(UrlConst.FACE_LIST, doSuccess = {
|
||||
// val type = object : TypeToken<MutableList<TunnelingHomeBean>>() {}
|
||||
// val list: MutableList<TunnelingHomeBean>? = it.toJsonString().toType(typeToken = type)
|
||||
// if (list.isNullOrEmpty()) {
|
||||
// ToastTool.toastShort(this@TunnelingActivity, "未查询到数据")
|
||||
// return@get
|
||||
// }
|
||||
// tunnelingHomeAdapter.setNewInstance(list)
|
||||
// getRecordList(0) {}
|
||||
// }, doFailure = { code, msg ->
|
||||
// if (msg.isNullOrEmpty()) {
|
||||
// return@get
|
||||
// }
|
||||
// ToastTool.toastShort(this@TunnelingActivity, msg)
|
||||
// })
|
||||
//
|
||||
//// val gson = Gson()
|
||||
//// val type: Type = object : TypeToken<MutableList<TunnelingHomeBean>>() {}.type
|
||||
//// val mutableListOf = gson.fromJson<MutableList<TunnelingHomeBean>>(jsonString, type)
|
||||
////
|
||||
//// tunnelingHomeAdapter.setNewInstance(mutableListOf)
|
||||
//
|
||||
// }
|
||||
//
|
||||
// fun getRecordList(index:Int, action:()-> Unit) {
|
||||
// val faceId: Long? = tunnelingHomeAdapter.data[index].surfaceId
|
||||
// HttpUtil.get("${UrlConst.RECORD_LIST + faceId}", doSuccess = {
|
||||
// val type = object : TypeToken<MutableList<TunnelingHomeItemBean>>() {}
|
||||
// val list: MutableList<TunnelingHomeItemBean>? = it.toJsonString().toType(typeToken = type)
|
||||
// if (list.isNullOrEmpty()) {
|
||||
// ToastTool.toastShort(this@TunnelingActivity, "未查询到数据")
|
||||
// return@get
|
||||
// }
|
||||
// tunnelingHomeAdapter.data[0].contentList = list
|
||||
// val holder = mBinding.rvList.findViewHolderForLayoutPosition(0)
|
||||
// val rvContent = holder?.itemView?.findViewById<RecyclerView>(R.id.rv_content)
|
||||
// rvContent?.adapter.let { adapter ->
|
||||
// if (adapter is TunnelingHomeListAdapter) {
|
||||
// adapter.data.clear()
|
||||
// adapter.data.addAll(list)
|
||||
// adapter.notifyDataSetChanged()
|
||||
// }
|
||||
// }
|
||||
// action()
|
||||
// }, doFailure = { code, msg ->
|
||||
// if (msg.isNullOrEmpty()) {
|
||||
// return@get
|
||||
// }
|
||||
// ToastTool.toastShort(this@TunnelingActivity, msg)
|
||||
// })
|
||||
// }
|
||||
|
||||
override fun createObserve() {
|
||||
super.createObserve()
|
||||
lifecycleScope.launch {
|
||||
repeatOnLifecycle(Lifecycle.State.CREATED) {
|
||||
mViewModel.tunnelingHomeList.collectLatest { list ->
|
||||
list?.reverse()
|
||||
tunnelingHomeAdapter.setNewInstance(list)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
lifecycleScope.launch {
|
||||
repeatOnLifecycle(Lifecycle.State.CREATED) {
|
||||
mViewModel.tunnelingHomeItemList.collectLatest { list ->
|
||||
if (list.isNullOrEmpty()) {
|
||||
showToast("未查询到数据")
|
||||
return@collectLatest
|
||||
}
|
||||
|
||||
tunnelingHomeAdapter.data[mViewModel.itemIndex.value].contentList = list
|
||||
tunnelingHomeAdapter.notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun bindEvent() {
|
||||
tunnelingHomeAdapter.setOnItemClickListener { adapter, view, position ->
|
||||
val tunnelingHomeBean = adapter.data.get(position) as TunnelingHomeBean
|
||||
// 跳转到工作面详情
|
||||
|
||||
toActivity(WorkingFaceDetailActivity::class.java, Bundle().apply {
|
||||
putString("surfaceId", tunnelingHomeBean.surfaceId)
|
||||
})
|
||||
}
|
||||
|
||||
tunnelingHomeAdapter.setOnItemChildClickListener { adapter, view, position ->
|
||||
val tunnelingHomeBean = adapter.data.get(position) as TunnelingHomeBean
|
||||
// 跳转到开始记录页面
|
||||
|
||||
if (view.id == R.id.start_record) {
|
||||
toActivity(AddWorkingPointActivity::class.java, Bundle().apply {
|
||||
putString(AddWorkingPointActivity.FACE_NAME, tunnelingHomeBean.surfaceName)
|
||||
putInt(AddWorkingPointActivity.SHOW_TYPE, 0)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
mBinding.toolbarLay.titleTvRight.setOnClickListener {
|
||||
|
||||
toActivity(WorkFaceActivity::class.java,Bundle().apply {
|
||||
putString("WorkFaceType", WorkFaceActivity.WorkFaceType.ADD.name)
|
||||
toActivity(WorkFaceActivity::class.java, Bundle().apply {
|
||||
putString(WorkFaceActivity.WORK_FACE_TYPE, WorkFaceActivity.WorkFaceType.ADD.name)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -155,8 +118,45 @@ class TunnelingActivity :
|
||||
}
|
||||
|
||||
override fun onMessageEvent(event: Any?) {
|
||||
if (event is TunnelingWorkFaceRefreshEvent) {
|
||||
mViewModel.getTunnelingHomeData()
|
||||
// if (event is TunnelingWorkFaceRefreshEvent) {
|
||||
// mViewModel.getTunnelingHomeData()
|
||||
// }
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
private fun getFaceRecord(position: Int) {
|
||||
val surfaceId = workingFaceList[position].surfaceId
|
||||
workingFaceRecordViewModel.getEntityList(surfaceId) { recordEntities ->
|
||||
if (recordEntities.isNullOrEmpty()) {
|
||||
workingFaceAdapter.notifyItemChanged(position)
|
||||
return@getEntityList
|
||||
}
|
||||
val viewHolder =
|
||||
mBinding.rvList.findViewHolderForLayoutPosition(position) as TunnelWorkingFaceAdapter.VH
|
||||
val recordAdapter =
|
||||
viewHolder.binding.rvFaceRecord.adapter as TunnelWorkingFaceRecordAdapter
|
||||
recordAdapter.apply {
|
||||
list.clear()
|
||||
// list.add(FACE_RECORD_HEADER)
|
||||
list.addAll(recordEntities)
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
workingFaceAdapter.notifyItemChanged(position)
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onWorkingFaceEvent(event: TunnelWorkingFaceEntity) {
|
||||
val index = workingFaceList.indexOfFirst { it.surfaceId == event.surfaceId }
|
||||
workingFaceViewModel.getEntityById(event.surfaceId) { entity ->
|
||||
workingFaceList[index] = entity
|
||||
workingFaceAdapter.notifyItemChanged(index)
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onFaceRecordEvent(event:TunnelWorkingFaceRecordEntity) {
|
||||
//TODO 折叠子列表
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,22 +1,31 @@
|
||||
package com.zmkg.coaloperation.ui.tunneling.activity
|
||||
|
||||
import android.app.Activity
|
||||
import android.os.Bundle
|
||||
import android.text.TextUtils
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.lifecycle.repeatOnLifecycle
|
||||
import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.base.BaseVMBActivity
|
||||
import com.zmkg.coaloperation.databinding.ActivityWorkFaceBinding
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelWorkingFaceEntity
|
||||
import com.zmkg.coaloperation.db.viewmodel.TunnelWorkingFaceViewModel
|
||||
import com.zmkg.coaloperation.event.TunnelingWorkFaceRefreshEvent
|
||||
import com.zmkg.coaloperation.ui.tunneling.bean.FaceWorkDetailBean
|
||||
import com.zmkg.coaloperation.ui.tunneling.bean.TunnelingFaceAddBean
|
||||
import com.zmkg.coaloperation.ui.tunneling.viewmodel.TunnelingViewModel
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.flow.collectLatest
|
||||
import kotlinx.coroutines.launch
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import androidx.core.view.isGone
|
||||
import com.zmkg.coaloperation.utils.PickerUtil
|
||||
import com.zmkg.coaloperation.utils.gone
|
||||
import com.zmkg.coaloperation.utils.visible
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
|
||||
/**
|
||||
* 工作面
|
||||
@@ -24,12 +33,11 @@ import org.greenrobot.eventbus.EventBus
|
||||
class WorkFaceActivity :
|
||||
BaseVMBActivity<TunnelingViewModel, ActivityWorkFaceBinding>(R.layout.activity_work_face) {
|
||||
|
||||
companion object {
|
||||
const val WORK_FACE_TYPE = "WorkFaceType"
|
||||
const val FACE_WORK_DETAIL_DATA = "faceWorkDetailData"
|
||||
}
|
||||
|
||||
var currentFaceType = WorkFaceType.ADD
|
||||
companion object {
|
||||
private const val TAG = "WorkFaceActivity"
|
||||
const val WORK_FACE_TYPE = "WorkFaceType"
|
||||
const val FACE_WORK_DETAIL_DATA = "faceWorkDetailData"
|
||||
}
|
||||
|
||||
enum class WorkFaceType {
|
||||
ADD,//新增
|
||||
@@ -39,29 +47,124 @@ class WorkFaceActivity :
|
||||
SEE//查看
|
||||
}
|
||||
|
||||
|
||||
|
||||
private var currentFaceType = WorkFaceType.ADD
|
||||
private val workingFaceViewModel: TunnelWorkingFaceViewModel by lazy {
|
||||
ViewModelProvider(this)[TunnelWorkingFaceViewModel::class.java]
|
||||
}
|
||||
private var faceDetail: TunnelWorkingFaceEntity? = null
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
val stringExtra = intent.getStringExtra(WORK_FACE_TYPE)
|
||||
if (TextUtils.isEmpty(stringExtra)) {
|
||||
finish()
|
||||
} else if (stringExtra == WorkFaceType.ADD.name) {
|
||||
currentFaceType = WorkFaceType.ADD
|
||||
mBinding.toolbarLay.titleTvName.text = "新增工作面"
|
||||
mBinding.confirm.text = "确认新增"
|
||||
} else if (stringExtra == WorkFaceType.EDIT.name) {
|
||||
currentFaceType = WorkFaceType.EDIT
|
||||
mBinding.toolbarLay.titleTvName.text = "修改工作面"
|
||||
mBinding.confirm.text = "确认修改"
|
||||
val detail = intent.getSerializableExtra(WorkingFaceDetail2Activity.FACE_WORK_DETAIL_DATA) as FaceWorkDetailBean?
|
||||
detail?.let {
|
||||
loadDetail(it)
|
||||
stringExtra == WorkFaceType.ADD.name
|
||||
}
|
||||
when (stringExtra) {
|
||||
WorkFaceType.ADD.name -> {
|
||||
currentFaceType = WorkFaceType.ADD
|
||||
mBinding.confirm.text = "确认新增"
|
||||
// mBinding.toolbarLay.titleTvName.text = "新增工作面"
|
||||
mBinding.toolbarLay.title = "新增工作面"
|
||||
mBinding.expandLayout.gone()
|
||||
mBinding.imgExpand.visible()
|
||||
}
|
||||
|
||||
WorkFaceType.EDIT.name -> {
|
||||
currentFaceType = WorkFaceType.EDIT
|
||||
mBinding.confirm.text = "确认修改"
|
||||
// mBinding.toolbarLay.titleTvName.text = "修改工作面"
|
||||
mBinding.toolbarLay.title = "修改工作面"
|
||||
mBinding.expandLayout.visible()
|
||||
mBinding.imgExpand.gone()
|
||||
faceDetail =
|
||||
intent.getParcelableExtra(WorkingFaceDetail2Activity.FACE_WORK_DETAIL_DATA) as TunnelWorkingFaceEntity?
|
||||
if (faceDetail == null) {
|
||||
showToast("未查询到工作面数据")
|
||||
return
|
||||
}
|
||||
faceDetail?.let {
|
||||
loadDetail(it)
|
||||
}
|
||||
}
|
||||
|
||||
WorkFaceType.SEE.name -> {
|
||||
currentFaceType = WorkFaceType.SEE
|
||||
}
|
||||
} else if (stringExtra == WorkFaceType.SEE.name) {
|
||||
currentFaceType = WorkFaceType.SEE
|
||||
}
|
||||
|
||||
mBinding.etPlanStartDate.let {
|
||||
it.setOnClickListener { _ ->
|
||||
showDatePicker(it)
|
||||
}
|
||||
}
|
||||
mBinding.etPlannEndDate.let {
|
||||
it.setOnClickListener { _ ->
|
||||
showDatePicker(it)
|
||||
}
|
||||
}
|
||||
val seamNameList = mutableListOf<String>()
|
||||
seamNameList.add("煤层---A---")
|
||||
seamNameList.add("煤层---B---")
|
||||
seamNameList.add("煤层---C---")
|
||||
seamNameList.add("煤层---D---")
|
||||
seamNameList.add("煤层---E---")
|
||||
mBinding.tvSeamName.setOnClickListener { v ->
|
||||
PickerUtil.showOptionsPicker(this, "请选择所属煤层", seamNameList) { option ->
|
||||
mBinding.tvSeamName.text = option
|
||||
mBinding.tvSeamName.tag = seamNameList.indexOf(option).toString()
|
||||
}
|
||||
}
|
||||
val areaNameList = mutableListOf<String>()
|
||||
areaNameList.add("采区---A---")
|
||||
areaNameList.add("采区---B---")
|
||||
areaNameList.add("采区---C---")
|
||||
areaNameList.add("采区---D---")
|
||||
areaNameList.add("采区---E---")
|
||||
mBinding.tvAreaName.setOnClickListener { v ->
|
||||
PickerUtil.showOptionsPicker(this, "请选择所属采区域", areaNameList) { option ->
|
||||
mBinding.tvAreaName.text = option
|
||||
mBinding.tvAreaName.tag = areaNameList.indexOf(option).toString()
|
||||
}
|
||||
}
|
||||
val tunnelNatureList = mutableListOf<String>()
|
||||
tunnelNatureList.add("A0001")
|
||||
tunnelNatureList.add("A0002")
|
||||
tunnelNatureList.add("B0001")
|
||||
tunnelNatureList.add("B0002")
|
||||
tunnelNatureList.add("C0001")
|
||||
tunnelNatureList.add("C0002")
|
||||
tunnelNatureList.add("D0001")
|
||||
tunnelNatureList.add("D0002")
|
||||
tunnelNatureList.add("E0001")
|
||||
tunnelNatureList.add("E0002")
|
||||
mBinding.tvTunnelNature.setOnClickListener { v ->
|
||||
PickerUtil.showOptionsPicker(this, "请选择巷道性质", areaNameList) { option ->
|
||||
mBinding.tvTunnelNature.text = option
|
||||
mBinding.tvTunnelNature.tag = areaNameList.indexOf(option).toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun showDatePicker(tv: TextView) {
|
||||
tv.setOnClickListener {
|
||||
PickerUtil.showTimePicker(this, tv.text.toString().trim()) { date ->
|
||||
tv.text = date
|
||||
}
|
||||
}
|
||||
// val cal = Calendar.getInstance()
|
||||
// DatePickerDialog(
|
||||
// this,
|
||||
// { view, year, month, day ->
|
||||
// textView.text = "$year-${numToString(month + 1)}-${numToString(day)}"
|
||||
// },
|
||||
// cal.get(Calendar.YEAR),
|
||||
// cal.get(Calendar.MONTH),
|
||||
// cal.get(Calendar.DAY_OF_MONTH)
|
||||
// )
|
||||
// .show()
|
||||
}
|
||||
|
||||
private fun numToString(num: Int): String {
|
||||
return if (num < 10) "0${num}" else num.toString()
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
@@ -90,14 +193,13 @@ class WorkFaceActivity :
|
||||
|
||||
override fun processClick(v: View?) {
|
||||
when (v?.id) {
|
||||
R.id.img_expand -> {
|
||||
if (mBinding.expandLayout.visibility == View.GONE) {
|
||||
mBinding.expandLayout.visibility = View.VISIBLE
|
||||
mBinding.imgView.background = getDrawable(R.mipmap.arrow_up_white)
|
||||
R.id.imgExpand -> {
|
||||
if (mBinding.expandLayout.isGone) {
|
||||
mBinding.expandLayout.visible()
|
||||
mBinding.imgExpand.setImageResource(R.drawable.ic_arrow_up_white2)
|
||||
} else {
|
||||
mBinding.expandLayout.visibility = View.GONE
|
||||
mBinding.imgView.background = getDrawable(R.mipmap.arrow_down_white)
|
||||
|
||||
mBinding.expandLayout.gone()
|
||||
mBinding.imgExpand.setImageResource(R.drawable.ic_arrow_down_white2)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,18 +217,20 @@ class WorkFaceActivity :
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadDetail(it: FaceWorkDetailBean) {
|
||||
private fun loadDetail(it: TunnelWorkingFaceEntity) {
|
||||
mBinding.etWorkfaceName.setText(it.surfaceName)
|
||||
mBinding.etTotalFootage.setText("${it.totalFootage}")
|
||||
mBinding.etCoalSeam.text = it.seamName
|
||||
mBinding.etCoalArea.text = it.areaName
|
||||
mBinding.etFaceAngle.setText(it.surfaceAzimuth)
|
||||
mBinding.etFaceHeight.setText(it.surfaceHeight)
|
||||
mBinding.etFaceWidth.setText(it.surfaceWidth)
|
||||
mBinding.tvCoalType.text = it.tunnelNature
|
||||
mBinding.tvSeamName.tag = it.seamId
|
||||
mBinding.tvSeamName.text = it.seamName
|
||||
mBinding.tvAreaName.tag = it.areaId
|
||||
mBinding.tvAreaName.text = it.areaName
|
||||
mBinding.etSurfaceAzimuth.setText(it.surfaceAzimuth)
|
||||
mBinding.etSurfaceHeight.setText(it.surfaceHeight)
|
||||
mBinding.etSurfaceWidth.setText(it.surfaceWidth)
|
||||
mBinding.tvTunnelNature.text = it.tunnelNature
|
||||
|
||||
mBinding.plannedDate1.setText(it.planStartDate)
|
||||
mBinding.plannedDate2.setText(it.planEndDate)
|
||||
mBinding.etPlanStartDate.text = it.planStartDate
|
||||
mBinding.etPlannEndDate.text = it.planEndDate
|
||||
|
||||
mBinding.etGeologicalType.setText(it.geologicalType)
|
||||
mBinding.etHydrogeologicalType.setText(it.hydrogeologicalType)
|
||||
@@ -137,24 +241,121 @@ class WorkFaceActivity :
|
||||
}
|
||||
|
||||
private fun addNewFace() {
|
||||
if (TextUtils.isEmpty(mBinding.etWorkfaceName.text.toString())) {
|
||||
val workingFaceName = mBinding.etWorkfaceName.text.toString().trim()
|
||||
if (TextUtils.isEmpty(workingFaceName)) {
|
||||
showToast("请输入工作面名称")
|
||||
return
|
||||
}
|
||||
if (TextUtils.isEmpty(mBinding.etTotalFootage.text.toString())) {
|
||||
val totalFootageStr = mBinding.etTotalFootage.text.toString().trim()
|
||||
if (TextUtils.isEmpty(totalFootageStr)) {
|
||||
showToast("请输入总进尺")
|
||||
return
|
||||
}
|
||||
mViewModel.postTunnellingSurfaceAdd(
|
||||
TunnelingFaceAddBean(
|
||||
surfaceName = mBinding.etWorkfaceName.text.toString(),
|
||||
totalFootage = mBinding.etTotalFootage.text.toString()
|
||||
)
|
||||
)
|
||||
try {
|
||||
totalFootageStr.toDouble()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
showToast("总进尺数据非数字格式,请确认")
|
||||
return
|
||||
}
|
||||
// mViewModel.postTunnellingSurfaceAdd(
|
||||
// TunnelingFaceAddBean(
|
||||
// surfaceName = mBinding.etWorkfaceName.text.toString(),
|
||||
// totalFootage = mBinding.etTotalFootage.text.toString()
|
||||
// )
|
||||
// )
|
||||
val workingFaceEntity = TunnelWorkingFaceEntity().also {
|
||||
it.surfaceId = System.currentTimeMillis()
|
||||
it.surfaceName = workingFaceName
|
||||
it.totalFootage = totalFootageStr
|
||||
|
||||
it.seamName = mBinding.tvSeamName.text.toString().trim()
|
||||
if (it.seamName!!.isNotBlank()) {
|
||||
it.seamId = mBinding.tvSeamName.tag.toString().toInt()
|
||||
}
|
||||
it.areaName = mBinding.tvAreaName.text.toString().trim()
|
||||
if (it.areaName!!.isNotBlank()) {
|
||||
it.areaId = mBinding.tvAreaName.tag.toString().toInt()
|
||||
}
|
||||
|
||||
it.surfaceAzimuth = mBinding.etSurfaceAzimuth.text.toString().trim()
|
||||
it.surfaceHeight = mBinding.etSurfaceHeight.text.toString().trim()
|
||||
it.surfaceWidth = mBinding.etSurfaceWidth.text.toString().trim()
|
||||
it.tunnelNature = mBinding.tvTunnelNature.text.toString().trim()
|
||||
it.planStartDate = mBinding.etPlanStartDate.text.toString().trim()
|
||||
it.planEndDate = mBinding.etPlannEndDate.text.toString().trim()
|
||||
it.geologicalType = mBinding.etGeologicalType.text.toString().trim()
|
||||
it.hydrogeologicalType = mBinding.etHydrogeologicalType.text.toString().trim()
|
||||
it.seamIgnition = mBinding.etSeamIgnition.text.toString().trim()
|
||||
it.seamGas = mBinding.etSeamGas.text.toString().trim()
|
||||
it.seamBumpPressure = mBinding.etSeamBumpPressure.text.toString().trim()
|
||||
it.surfaceSupportForm = mBinding.etSurfaceSupportForm.text.toString().trim()
|
||||
}
|
||||
workingFaceViewModel.insert(workingFaceEntity) {
|
||||
showToast("工作面新增完成")
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
private fun editFace() {
|
||||
val workingFaceName = mBinding.etWorkfaceName.text.toString().trim()
|
||||
if (TextUtils.isEmpty(workingFaceName)) {
|
||||
showToast("请输入工作面名称")
|
||||
return
|
||||
}
|
||||
val totalFootageStr = mBinding.etTotalFootage.text.toString().trim()
|
||||
if (TextUtils.isEmpty(totalFootageStr)) {
|
||||
showToast("请输入总进尺")
|
||||
return
|
||||
}
|
||||
try {
|
||||
totalFootageStr.toDouble()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
showToast("总进尺数据非数字格式,请确认")
|
||||
return
|
||||
}
|
||||
val workingFaceEntity = TunnelWorkingFaceEntity().also {
|
||||
it.surfaceId = faceDetail!!.surfaceId
|
||||
it.surfaceName = workingFaceName
|
||||
it.totalFootage = totalFootageStr
|
||||
|
||||
it.seamName = mBinding.tvSeamName.text.toString().trim()
|
||||
if (it.seamName!!.isNotBlank()) {
|
||||
it.seamId = string2num(mBinding.tvSeamName.tag.toString())
|
||||
}
|
||||
it.areaName = mBinding.tvAreaName.text.toString().trim()
|
||||
if (it.areaName!!.isNotBlank()) {
|
||||
it.areaId = string2num(mBinding.tvAreaName.tag.toString())
|
||||
}
|
||||
|
||||
it.surfaceAzimuth = mBinding.etSurfaceAzimuth.text.toString().trim()
|
||||
it.surfaceHeight = mBinding.etSurfaceHeight.text.toString().trim()
|
||||
it.surfaceWidth = mBinding.etSurfaceWidth.text.toString().trim()
|
||||
it.tunnelNature = mBinding.tvTunnelNature.text.toString().trim()
|
||||
it.planStartDate = mBinding.etPlanStartDate.text.toString().trim()
|
||||
it.planEndDate = mBinding.etPlannEndDate.text.toString().trim()
|
||||
it.geologicalType = mBinding.etGeologicalType.text.toString().trim()
|
||||
it.hydrogeologicalType = mBinding.etHydrogeologicalType.text.toString().trim()
|
||||
it.seamIgnition = mBinding.etSeamIgnition.text.toString().trim()
|
||||
it.seamGas = mBinding.etSeamGas.text.toString().trim()
|
||||
it.seamBumpPressure = mBinding.etSeamBumpPressure.text.toString().trim()
|
||||
it.surfaceSupportForm = mBinding.etSurfaceSupportForm.text.toString().trim()
|
||||
}
|
||||
workingFaceViewModel.update(workingFaceEntity) {
|
||||
showToast("工作面修改完成")
|
||||
EventBus.getDefault().post(workingFaceEntity)
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onWorkingFaceEvent(event: TunnelWorkingFaceEntity) {
|
||||
|
||||
}
|
||||
|
||||
private fun string2num(text: String?): Int {
|
||||
return if (text.isNullOrBlank()) 0 else text.toInt()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,28 +10,30 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.zmkg.coaloperation.adapter.WorkingItemAdapter
|
||||
import com.zmkg.coaloperation.bean.WorkingFaceItem
|
||||
import com.zmkg.coaloperation.databinding.ActivityWorkingFaceDetail2Binding
|
||||
import com.zmkg.coaloperation.ui.tunneling.bean.FaceWorkDetailBean
|
||||
import java.io.Serializable
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelWorkingFaceEntity
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
|
||||
/**
|
||||
* 工作面详情2
|
||||
*/
|
||||
class WorkingFaceDetail2Activity :
|
||||
BaseVMBActivity<TestViewModel, ActivityWorkingFaceDetail2Binding>(R.layout.activity_working_face_detail2) {
|
||||
companion object {
|
||||
const val FACE_WORK_DETAIL_DATA = "faceWorkDetailData"
|
||||
}
|
||||
companion object {
|
||||
const val FACE_WORK_DETAIL_DATA = "faceWorkDetailData"
|
||||
}
|
||||
|
||||
private val list: MutableList<WorkingFaceItem> = mutableListOf()
|
||||
|
||||
private var detail:FaceWorkDetailBean?=null
|
||||
// private var detail:FaceWorkDetailBean?=null
|
||||
private var detail: TunnelWorkingFaceEntity? = null
|
||||
private val adapter by lazy {
|
||||
WorkingItemAdapter(list)
|
||||
}
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
mBinding.toolbarLay.vLine.visibility = View.GONE
|
||||
mBinding.toolbarLay.rightText="修改"
|
||||
mBinding.toolbarLay.rightText = "修改"
|
||||
|
||||
mBinding.rvFaceList.let {
|
||||
it.layoutManager = LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
|
||||
@@ -39,43 +41,19 @@ class WorkingFaceDetail2Activity :
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
override fun initData() {
|
||||
val serializableExtra = intent.getSerializableExtra(FACE_WORK_DETAIL_DATA)
|
||||
if (serializableExtra==null) {
|
||||
finish()
|
||||
} else {
|
||||
detail = serializableExtra as FaceWorkDetailBean
|
||||
detail?.let {
|
||||
mBinding.toolbarLay.title = it.surfaceName
|
||||
|
||||
list.add(WorkingFaceItem(pageType = 0, name = "工作面名称", value = it.surfaceName))
|
||||
list.add(WorkingFaceItem(pageType = 0, name = "所属煤层", value = it.seamName))
|
||||
list.add(WorkingFaceItem(pageType = 0, name = "所属采区域", value = it.areaName))
|
||||
list.add(WorkingFaceItem(pageType = 0, name = "工作面方位角", value = it.surfaceAzimuth))
|
||||
list.add(WorkingFaceItem(pageType = 0, name = "工作面巷高", value = it.surfaceHeight))
|
||||
list.add(WorkingFaceItem(pageType = 0, name = "工作面巷宽", value = it.surfaceWidth))
|
||||
list.add(WorkingFaceItem(pageType = 0, name = "巷道性质", value = it.tunnelNature))
|
||||
list.add(WorkingFaceItem(pageType = 0, name = "计划工期", value = "${it.planStartDate} ~ ${it.planEndDate}"))
|
||||
list.add(WorkingFaceItem(pageType = 0, name = "地质类型", value = it.geologicalType))
|
||||
list.add(WorkingFaceItem(pageType = 0, name = "水文地质类型", value = it.hydrogeologicalType))
|
||||
list.add(WorkingFaceItem(pageType = 0, name = "煤层发火性", value = it.seamIgnition))
|
||||
list.add(WorkingFaceItem(pageType = 0, name = "瓦斯含量", value = it.seamGas))
|
||||
list.add(WorkingFaceItem(pageType = 0, name = "冲击地压危险性", value = it.seamBumpPressure))
|
||||
list.add(WorkingFaceItem(pageType = 0, name = "支护形式", value = it.surfaceSupportForm))
|
||||
}
|
||||
|
||||
adapter.notifyDataSetChanged()
|
||||
|
||||
detail = intent.getParcelableExtra(FACE_WORK_DETAIL_DATA)
|
||||
detail?.let {
|
||||
loadFaceDetail(it)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun bindEvent() {
|
||||
mBinding.toolbarLay.titleTvRight.setOnClickListener {
|
||||
toActivity(WorkFaceActivity::class.java, Bundle().apply {
|
||||
putString(WorkFaceActivity.WORK_FACE_TYPE, WorkFaceActivity.WorkFaceType.EDIT.name)
|
||||
putSerializable(WorkFaceActivity.FACE_WORK_DETAIL_DATA, detail)
|
||||
// putSerializable(WorkFaceActivity.FACE_WORK_DETAIL_DATA, detail)
|
||||
putParcelable(WorkFaceActivity.FACE_WORK_DETAIL_DATA, detail)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -84,4 +62,51 @@ class WorkingFaceDetail2Activity :
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
private fun loadFaceDetail(it: TunnelWorkingFaceEntity) {
|
||||
mBinding.toolbarLay.title = it.surfaceName
|
||||
list.clear()
|
||||
list.add(WorkingFaceItem(pageType = 0, name = "工作面名称", value = it.surfaceName))
|
||||
list.add(WorkingFaceItem(pageType = 0, name = "所属煤层", value = it.seamName))
|
||||
list.add(WorkingFaceItem(pageType = 0, name = "所属采区域", value = it.areaName))
|
||||
list.add(WorkingFaceItem(pageType = 0, name = "工作面方位角", value = it.surfaceAzimuth))
|
||||
list.add(WorkingFaceItem(pageType = 0, name = "工作面巷高", value = it.surfaceHeight))
|
||||
list.add(WorkingFaceItem(pageType = 0, name = "工作面巷宽", value = it.surfaceWidth))
|
||||
list.add(WorkingFaceItem(pageType = 0, name = "巷道性质", value = it.tunnelNature))
|
||||
list.add(
|
||||
WorkingFaceItem(
|
||||
pageType = 0,
|
||||
name = "计划工期",
|
||||
value = "${it.planStartDate} ~ ${it.planEndDate}"
|
||||
)
|
||||
)
|
||||
list.add(WorkingFaceItem(pageType = 0, name = "地质类型", value = it.geologicalType))
|
||||
list.add(
|
||||
WorkingFaceItem(
|
||||
pageType = 0,
|
||||
name = "水文地质类型",
|
||||
value = it.hydrogeologicalType
|
||||
)
|
||||
)
|
||||
list.add(WorkingFaceItem(pageType = 0, name = "煤层发火性", value = it.seamIgnition))
|
||||
list.add(WorkingFaceItem(pageType = 0, name = "瓦斯含量", value = it.seamGas))
|
||||
list.add(
|
||||
WorkingFaceItem(
|
||||
pageType = 0,
|
||||
name = "冲击地压危险性",
|
||||
value = it.seamBumpPressure
|
||||
)
|
||||
)
|
||||
list.add(WorkingFaceItem(pageType = 0, name = "支护形式", value = it.surfaceSupportForm))
|
||||
|
||||
adapter.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onWorkingFaceEvent(event: TunnelWorkingFaceEntity) {
|
||||
detail = event
|
||||
detail?.let {
|
||||
loadFaceDetail(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,19 @@
|
||||
package com.zmkg.coaloperation.ui.tunneling.activity
|
||||
|
||||
import android.os.Bundle
|
||||
import android.text.TextUtils
|
||||
import android.view.View
|
||||
import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.base.BaseVMBActivity
|
||||
import androidx.core.graphics.toColorInt
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.lifecycle.repeatOnLifecycle
|
||||
import com.zmkg.coaloperation.databinding.ActivityWorkingFaceDetailBinding
|
||||
import com.zmkg.coaloperation.superfuntion.orEmptyDefaultInt
|
||||
import com.zmkg.coaloperation.ui.tunneling.adapter.TunnelingHomeListAdapter
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelWorkingFaceEntity
|
||||
import com.zmkg.coaloperation.ui.tunneling.adapter.TunnelingRockNatureAdapter
|
||||
import com.zmkg.coaloperation.ui.tunneling.bean.FaceWorkDetailBean
|
||||
import com.zmkg.coaloperation.ui.tunneling.viewmodel.TunnelingViewModel
|
||||
import com.zmkg.coaloperation.utils.ScreenUtil
|
||||
import kotlinx.coroutines.flow.collectLatest
|
||||
import kotlinx.coroutines.launch
|
||||
import java.io.Serializable
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
import kotlin.apply
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
/**
|
||||
@@ -27,8 +22,13 @@ import kotlin.math.roundToInt
|
||||
class WorkingFaceDetailActivity :
|
||||
BaseVMBActivity<TunnelingViewModel, ActivityWorkingFaceDetailBinding>(R.layout.activity_working_face_detail) {
|
||||
|
||||
val tunnelingRockNatureAdapter: TunnelingRockNatureAdapter by lazy { TunnelingRockNatureAdapter()}
|
||||
companion object {
|
||||
const val FACE_DETAIL = "faceDetail"
|
||||
}
|
||||
|
||||
val tunnelingRockNatureAdapter: TunnelingRockNatureAdapter by lazy { TunnelingRockNatureAdapter() }
|
||||
|
||||
private var faceDetail: TunnelWorkingFaceEntity? = null
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
mBinding.toolbarLay.rightText = "查看详情"
|
||||
@@ -48,7 +48,7 @@ class WorkingFaceDetailActivity :
|
||||
it.startAngle = -90f
|
||||
it.strokeWidth = 10f
|
||||
it.sweepAngle = 0f
|
||||
it.radius = ScreenUtil.dp2px(100f-10f)/2f
|
||||
it.radius = ScreenUtil.dp2px(100f - 10f) / 2f
|
||||
}
|
||||
|
||||
mBinding.arcViewBlue.let {
|
||||
@@ -56,29 +56,33 @@ class WorkingFaceDetailActivity :
|
||||
it.startAngle = -90f
|
||||
it.strokeWidth = 10f
|
||||
it.sweepAngle = 0f
|
||||
it.radius = ScreenUtil.dp2px(100f-10f)/2f
|
||||
it.radius = ScreenUtil.dp2px(100f - 10f) / 2f
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
val surfaceId = intent.getStringExtra("surfaceId")
|
||||
if (TextUtils.isEmpty(surfaceId)) {
|
||||
finish()
|
||||
} else {
|
||||
mViewModel.getTunnelingSurfaceDetail(surfaceId)
|
||||
}
|
||||
// val surfaceId = intent.getStringExtra("surfaceId")
|
||||
// if (TextUtils.isEmpty(surfaceId)) {
|
||||
// finish()
|
||||
// } else {
|
||||
// mViewModel.getTunnelingSurfaceDetail(surfaceId)
|
||||
// }
|
||||
faceDetail = intent.getParcelableExtra(FACE_DETAIL)
|
||||
|
||||
faceDetail?.let {
|
||||
loadFaceDetail()
|
||||
}
|
||||
}
|
||||
|
||||
override fun bindEvent() {
|
||||
mBinding.toolbarLay.titleTvRight.setOnClickListener {
|
||||
toActivity(WorkingFaceDetail2Activity::class.java, Bundle().apply {
|
||||
putSerializable(
|
||||
WorkingFaceDetail2Activity.FACE_WORK_DETAIL_DATA,
|
||||
mViewModel.faceWorkDetailData.value as Serializable
|
||||
)
|
||||
|
||||
// putSerializable(
|
||||
// WorkingFaceDetail2Activity.FACE_WORK_DETAIL_DATA,
|
||||
// mViewModel.faceWorkDetailData.value as Serializable
|
||||
// )
|
||||
putParcelable(WorkingFaceDetail2Activity.FACE_WORK_DETAIL_DATA, faceDetail)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -88,26 +92,38 @@ class WorkingFaceDetailActivity :
|
||||
|
||||
override fun createObserve() {
|
||||
super.createObserve()
|
||||
lifecycleScope.launch {
|
||||
repeatOnLifecycle(Lifecycle.State.CREATED) {
|
||||
mViewModel.faceWorkDetailData.collectLatest {
|
||||
if (it != null) {
|
||||
setDataView(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// lifecycleScope.launch {
|
||||
// repeatOnLifecycle(Lifecycle.State.CREATED) {
|
||||
// mViewModel.faceWorkDetailData.collectLatest {
|
||||
// if (it != null) {
|
||||
// setDataView(it)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
private fun setDataView(bean: FaceWorkDetailBean?) {
|
||||
bean ?: return
|
||||
}
|
||||
|
||||
private fun stringToDouble(numText:String?): Double {
|
||||
if (numText.isNullOrEmpty() || numText.isBlank()) return 0.toDouble()
|
||||
return numText.toDouble()
|
||||
}
|
||||
|
||||
private fun loadFaceDetail() {
|
||||
val bean = faceDetail!!
|
||||
mBinding.apply {
|
||||
toolbarLay.title = bean.surfaceName
|
||||
|
||||
tvLenTotal.text = "总进尺:${bean.totalFootage}m"
|
||||
tvLenAccumulate.text = "累计进尺:${bean.accumulativeFootage.orEmptyDefaultInt("0")}m"
|
||||
tvLenRemain.text = "剩余进尺:${bean.remainingFootage.orEmptyDefaultInt("0")}m"
|
||||
val total = stringToDouble(bean.totalFootage)
|
||||
val accumulative = stringToDouble(bean.accumulativeFootage)
|
||||
val remaining =stringToDouble( bean.remainingFootage)
|
||||
|
||||
tvLenTotal.text = "总进尺:${total}m"
|
||||
tvLenAccumulate.text = "累计进尺:${accumulative}m"
|
||||
tvLenRemain.text = "剩余进尺:${remaining}m"
|
||||
|
||||
//累计进尺占比
|
||||
var radio = 0
|
||||
@@ -115,44 +131,48 @@ class WorkingFaceDetailActivity :
|
||||
//累计进尺圆圈占比
|
||||
var arcViewRadio: Float
|
||||
|
||||
if (bean.accumulativeFootage > bean.totalFootage) {
|
||||
if (accumulative >= total) {
|
||||
radio = 100
|
||||
arcViewRadio = 360F
|
||||
} else if (bean.accumulativeFootage <= 0) {
|
||||
} else if (accumulative <= 0) {
|
||||
radio = 0
|
||||
arcViewRadio = 0F
|
||||
} else {
|
||||
radio = (bean.accumulativeFootage * 100F / bean.accumulativeFootage).roundToInt()
|
||||
arcViewRadio = bean.accumulativeFootage * 360F / bean.accumulativeFootage
|
||||
arcViewRadio = (accumulative * 100F / total).toFloat()
|
||||
radio = arcViewRadio.roundToInt()
|
||||
}
|
||||
|
||||
arcViewRed.let {
|
||||
it.sweepAngle = arcViewRadio
|
||||
}
|
||||
|
||||
|
||||
arcViewBlue.let {
|
||||
it.sweepAngle = (360F-arcViewRadio) * -1F
|
||||
it.sweepAngle = (360F - arcViewRadio) * -1F
|
||||
}
|
||||
|
||||
|
||||
mBinding.tvCompleteRate.text = "$radio%"
|
||||
|
||||
tvYesterdayLen.text = "${bean?.yesterdayFootage}m"
|
||||
tvWorkingFaceAngle.text = "${bean?.latestRecord?.seamDip.orEmptyDefaultInt()}"
|
||||
tvMonthAccumulateLen.text = "${bean?.monthFootage}m"
|
||||
tvWorkingFaceWater.text = "${bean?.latestRecord?.waterYield.orEmptyDefaultInt()}m"
|
||||
// tvYesterdayLen.text = "${bean?.yesterdayFootage}m"
|
||||
// tvWorkingFaceAngle.text = "${bean?.latestRecord?.seamDip.orEmptyDefaultInt()}"
|
||||
// tvMonthAccumulateLen.text = "${bean?.monthFootage}m"
|
||||
// tvWorkingFaceWater.text = "${bean?.latestRecord?.waterYield.orEmptyDefaultInt()}m"
|
||||
|
||||
val list = bean?.latestRecord?.mineWorkingLithologyList
|
||||
if (list.isNullOrEmpty()) {
|
||||
tvYesterdayRockType.visibility = View.GONE
|
||||
} else {
|
||||
tvYesterdayRockType.visibility = View.VISIBLE
|
||||
tunnelingRockNatureAdapter.setNewInstance(list)
|
||||
}
|
||||
// val list = bean?.latestRecord?.mineWorkingLithologyList
|
||||
// if (list.isNullOrEmpty()) {
|
||||
// tvYesterdayRockType.visibility = View.GONE
|
||||
// } else {
|
||||
// tvYesterdayRockType.visibility = View.VISIBLE
|
||||
// tunnelingRockNatureAdapter.setNewInstance(list)
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onWorkingFaceEvent(event: TunnelWorkingFaceEntity) {
|
||||
faceDetail = event
|
||||
loadFaceDetail()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,6 +11,9 @@ import com.zmkg.coaloperation.base.viewmodel.TestViewModel
|
||||
import com.zmkg.coaloperation.bean.RockItem
|
||||
import com.zmkg.coaloperation.bean.WorkingFaceItem
|
||||
import com.zmkg.coaloperation.databinding.ActivityWorkingPointBinding
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelWorkingFaceRecordEntity
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
|
||||
/**
|
||||
* 查看(棋盘井)
|
||||
@@ -18,6 +21,13 @@ import com.zmkg.coaloperation.databinding.ActivityWorkingPointBinding
|
||||
class WorkingPointActivity :
|
||||
BaseVMBActivity<TestViewModel, ActivityWorkingPointBinding>(R.layout.activity_working_point) {
|
||||
|
||||
companion object {
|
||||
const val FACE_NAME = "faceName"
|
||||
const val FACE_RECORD = "faceRecord"
|
||||
}
|
||||
|
||||
private var faceName: String? = null
|
||||
private var faceRecord: TunnelWorkingFaceRecordEntity? = null
|
||||
private val list: MutableList<WorkingFaceItem> = mutableListOf()
|
||||
private val adapter by lazy {
|
||||
WorkingItemAdapter(list)
|
||||
@@ -25,30 +35,46 @@ class WorkingPointActivity :
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
mBinding.toolbarLay.vLine.visibility = View.GONE
|
||||
mBinding.toolbarLay.rightText = "查看详情"
|
||||
|
||||
mBinding.toolbarLay.title = "查看详情"
|
||||
mBinding.toolbarLay.rightText = "修改"
|
||||
mBinding.toolbarLay.titleTvRight.setOnClickListener {
|
||||
toActivity(AddWorkingPointActivity::class.java, Bundle().apply {
|
||||
putInt(AddWorkingPointActivity.SHOW_TYPE, 1)
|
||||
putString(AddWorkingPointActivity.FACE_NAME, faceName)
|
||||
putParcelable(AddWorkingPointActivity.FACE_RECORD, faceRecord)
|
||||
})
|
||||
}
|
||||
mBinding.rvPointList.let {
|
||||
it.layoutManager = LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
|
||||
it.adapter = adapter
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
override fun initData() {
|
||||
list.add(WorkingFaceItem(pageType = 1, name = "工作面名称", value = "5-20304回风工作面"))
|
||||
list.add(WorkingFaceItem(pageType = 1, name = "施工日期", value = "2025-08-15"))
|
||||
list.add(WorkingFaceItem(pageType = 1, name = "施工班次", value = "早班"))
|
||||
list.add(WorkingFaceItem(pageType = 1, name = "施工队伍", value = "掘进队"))
|
||||
list.add(WorkingFaceItem(pageType = 1, name = "带班队长", value = "刘某杰"))
|
||||
list.add(WorkingFaceItem(pageType = 1, name = "班进尺", value = "200m"))
|
||||
faceName = intent.getStringExtra(FACE_NAME)
|
||||
faceRecord = intent.getParcelableExtra(FACE_RECORD)
|
||||
faceRecord?.let {
|
||||
loadFaceRecord(it)
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
private fun loadFaceRecord(it: TunnelWorkingFaceRecordEntity) {
|
||||
list.clear()
|
||||
list.add(WorkingFaceItem(pageType = 1, name = "工作面名称", value = faceName))
|
||||
list.add(WorkingFaceItem(pageType = 1, name = "施工日期", value = it.workingDate))
|
||||
list.add(WorkingFaceItem(pageType = 1, name = "施工班次", value = it.teamShift))
|
||||
list.add(WorkingFaceItem(pageType = 1, name = "施工队伍", value = it.teamName))
|
||||
list.add(WorkingFaceItem(pageType = 1, name = "带班队长", value = it.teamLeader))
|
||||
list.add(WorkingFaceItem(pageType = 1, name = "本班进尺", value = it.workingFootage))
|
||||
|
||||
val rockList = mutableListOf<RockItem>()
|
||||
rockList.add(RockItem(startLen = 0, endLen = 1, rockType = "泥"))
|
||||
rockList.add(RockItem(startLen = 0, endLen = 1, rockType = "砂"))
|
||||
list.add(WorkingFaceItem(pageType = 1, name = "顶板岩性", value = "", items = rockList))
|
||||
list.add(WorkingFaceItem(pageType = 1, name = "煤层倾角", value = "60°"))
|
||||
list.add(WorkingFaceItem(pageType = 1, name = "煤层高", value = "20m"))
|
||||
list.add(WorkingFaceItem(pageType = 1, name = "记录人", value = "刘某杰"))
|
||||
list.add(WorkingFaceItem(pageType = 1, name = "煤层倾角", value = it.seamDip))
|
||||
list.add(WorkingFaceItem(pageType = 1, name = "煤层高", value = it.seamHeight))
|
||||
list.add(WorkingFaceItem(pageType = 1, name = "记录人", value = it.recordPerson))
|
||||
|
||||
adapter.notifyDataSetChanged()
|
||||
}
|
||||
@@ -59,4 +85,11 @@ class WorkingPointActivity :
|
||||
override fun processClick(v: View?) {
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onFaceRecordEvent(event:TunnelWorkingFaceRecordEntity) {
|
||||
faceRecord = event
|
||||
faceRecord?.let {
|
||||
loadFaceRecord(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,64 +1,64 @@
|
||||
package com.zmkg.coaloperation.ui.tunneling.adapter
|
||||
|
||||
import android.content.Intent
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
||||
import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.ui.tunneling.bean.TunnelingHomeBean
|
||||
import com.zmkg.coaloperation.ui.tunneling.activity.WorkingPointActivity
|
||||
|
||||
|
||||
/**
|
||||
* 掘进首页列表
|
||||
*/
|
||||
|
||||
class TunnelingHomeAdapter(var listener: (Int,String?)->Unit) : BaseQuickAdapter<TunnelingHomeBean, BaseViewHolder>(
|
||||
R.layout.item_geological_list
|
||||
) {
|
||||
|
||||
override fun convert(holder: BaseViewHolder, item: TunnelingHomeBean) {
|
||||
val tunnelingHomeListAdapter: TunnelingHomeListAdapter by lazy { TunnelingHomeListAdapter().apply {
|
||||
setOnItemClickListener { adapter, view, position ->
|
||||
context.startActivity(Intent(context, WorkingPointActivity::class.java))
|
||||
}
|
||||
} }
|
||||
|
||||
val rvList = holder.getView<RecyclerView>(R.id.rv_content)
|
||||
val expand = holder.getView<ImageView>(R.id.expand)
|
||||
val recordLayout = holder.getView<LinearLayout>(R.id.record_layout)
|
||||
|
||||
holder.apply {
|
||||
setText(R.id.title, item.surfaceName)
|
||||
rvList.adapter = tunnelingHomeListAdapter
|
||||
tunnelingHomeListAdapter.setNewInstance(item.contentList?:mutableListOf())
|
||||
}
|
||||
expand.setOnClickListener {
|
||||
val imageView = it as ImageView
|
||||
if (imageView.tag.equals("0")) {//收起状态
|
||||
imageView.setImageResource(R.mipmap.ic_arrow_down_white)
|
||||
recordLayout.visibility = View.VISIBLE
|
||||
imageView.tag = "1"
|
||||
|
||||
if (data[holder.absoluteAdapterPosition].contentList.isNullOrEmpty()) {
|
||||
// if (context is TunnelingActivity) {
|
||||
// (context as TunnelingActivity).getRecordList(holder.layoutPosition) {
|
||||
// tunnelingHomeListAdapter.notifyDataSetChanged()
|
||||
// }
|
||||
// }
|
||||
listener.invoke(holder.absoluteAdapterPosition,data[holder.absoluteAdapterPosition].surfaceId)
|
||||
}
|
||||
} else {//展开状态
|
||||
imageView.setImageResource(R.mipmap.ic_arrow_right)
|
||||
recordLayout.visibility = View.GONE
|
||||
imageView.tag = "0"
|
||||
}
|
||||
}
|
||||
}
|
||||
init {
|
||||
addChildClickViewIds(R.id.start_record)
|
||||
}
|
||||
}
|
||||
//package com.zmkg.coaloperation.ui.tunneling.adapter
|
||||
//
|
||||
//import android.content.Intent
|
||||
//import android.view.View
|
||||
//import android.widget.ImageView
|
||||
//import android.widget.LinearLayout
|
||||
//import androidx.recyclerview.widget.RecyclerView
|
||||
//import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
//import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
||||
//import com.zmkg.coaloperation.R
|
||||
//import com.zmkg.coaloperation.ui.tunneling.bean.TunnelingHomeBean
|
||||
//import com.zmkg.coaloperation.ui.tunneling.activity.WorkingPointActivity
|
||||
//
|
||||
//
|
||||
///**
|
||||
// * 掘进首页列表
|
||||
// */
|
||||
//
|
||||
//class TunnelingHomeAdapter(var listener: (Int,String?)->Unit) : BaseQuickAdapter<TunnelingHomeBean, BaseViewHolder>(
|
||||
// R.layout.item_geological_list
|
||||
//) {
|
||||
//
|
||||
// override fun convert(holder: BaseViewHolder, item: TunnelingHomeBean) {
|
||||
// val tunnelingHomeListAdapter: TunnelingHomeListAdapter by lazy { TunnelingHomeListAdapter().apply {
|
||||
// setOnItemClickListener { adapter, view, position ->
|
||||
// context.startActivity(Intent(context, WorkingPointActivity::class.java))
|
||||
// }
|
||||
// } }
|
||||
//
|
||||
// val rvList = holder.getView<RecyclerView>(R.id.rv_content)
|
||||
// val expand = holder.getView<ImageView>(R.id.expand)
|
||||
// val recordLayout = holder.getView<LinearLayout>(R.id.record_layout)
|
||||
//
|
||||
// holder.apply {
|
||||
// setText(R.id.title, item.surfaceName)
|
||||
// rvList.adapter = tunnelingHomeListAdapter
|
||||
// tunnelingHomeListAdapter.setNewInstance(item.contentList?:mutableListOf())
|
||||
// }
|
||||
// expand.setOnClickListener {
|
||||
// val imageView = it as ImageView
|
||||
// if (imageView.tag.equals("0")) {//收起状态
|
||||
// imageView.setImageResource(R.drawable.ic_arrow_down_white)
|
||||
// recordLayout.visibility = View.VISIBLE
|
||||
// imageView.tag = "1"
|
||||
//
|
||||
// if (data[holder.absoluteAdapterPosition].contentList.isNullOrEmpty()) {
|
||||
//// if (context is TunnelingActivity) {
|
||||
//// (context as TunnelingActivity).getRecordList(holder.layoutPosition) {
|
||||
//// tunnelingHomeListAdapter.notifyDataSetChanged()
|
||||
//// }
|
||||
//// }
|
||||
// listener.invoke(holder.absoluteAdapterPosition,data[holder.absoluteAdapterPosition].surfaceId)
|
||||
// }
|
||||
// } else {//展开状态
|
||||
// imageView.setImageResource(R.drawable.ic_arrow_right_gray)
|
||||
// recordLayout.visibility = View.GONE
|
||||
// imageView.tag = "0"
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// init {
|
||||
// addChildClickViewIds(R.id.start_record)
|
||||
// }
|
||||
//}
|
||||
@@ -1,27 +1,27 @@
|
||||
package com.zmkg.coaloperation.ui.tunneling.adapter
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
||||
import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.ui.tunneling.bean.TunnelingHomeItemBean
|
||||
|
||||
|
||||
/**
|
||||
* 掘进首页点击出现的列表
|
||||
*/
|
||||
|
||||
class TunnelingHomeListAdapter :
|
||||
BaseQuickAdapter<TunnelingHomeItemBean, BaseViewHolder>(R.layout.item_geological_list_content) {
|
||||
|
||||
|
||||
override fun convert(holder: BaseViewHolder, item: TunnelingHomeItemBean) {
|
||||
if (holder.absoluteAdapterPosition != 0) {
|
||||
holder.setGone(R.id.head, true)
|
||||
}
|
||||
holder.setText(R.id.time, item.workingDate)
|
||||
.setText(R.id.record, item.recordPerson)
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
//package com.zmkg.coaloperation.ui.tunneling.adapter
|
||||
//
|
||||
//import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
//import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
||||
//import com.zmkg.coaloperation.R
|
||||
//import com.zmkg.coaloperation.ui.tunneling.bean.TunnelingHomeItemBean
|
||||
//
|
||||
//
|
||||
///**
|
||||
// * 掘进首页点击出现的列表
|
||||
// */
|
||||
//
|
||||
//class TunnelingHomeListAdapter :
|
||||
// BaseQuickAdapter<TunnelingHomeItemBean, BaseViewHolder>(R.layout.item_geological_list_content) {
|
||||
//
|
||||
//
|
||||
// override fun convert(holder: BaseViewHolder, item: TunnelingHomeItemBean) {
|
||||
// if (holder.absoluteAdapterPosition != 0) {
|
||||
// holder.setGone(R.id.head, true)
|
||||
// }
|
||||
// holder.setText(R.id.time, item.workingDate)
|
||||
// .setText(R.id.record, item.recordPerson)
|
||||
//
|
||||
//
|
||||
// }
|
||||
//
|
||||
//}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.zmkg.coaloperation.utils
|
||||
|
||||
import java.time.LocalDateTime
|
||||
import java.time.ZoneId
|
||||
import java.time.format.DateTimeFormatter
|
||||
import java.util.Date
|
||||
|
||||
|
||||
object DateTimeUtil {
|
||||
|
||||
const val YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss"
|
||||
|
||||
fun formatDateTime(dateTime: LocalDateTime, pattern: String = YYYY_MM_DD_HH_MM_SS): String {
|
||||
val formatter = DateTimeFormatter.ofPattern(pattern)
|
||||
return dateTime.format(formatter)
|
||||
}
|
||||
|
||||
fun convert(dateStr: String, pattern: String = YYYY_MM_DD_HH_MM_SS): Date {
|
||||
val formatter = DateTimeFormatter.ofPattern(pattern)
|
||||
val ldt = LocalDateTime.parse(dateStr, formatter)
|
||||
val zdt = ldt.atZone(ZoneId.systemDefault())
|
||||
return Date.from(zdt.toInstant())
|
||||
}
|
||||
|
||||
fun main() {
|
||||
val now = LocalDateTime.now()
|
||||
println("默认格式: ${formatDateTime(now)}")
|
||||
println("自定义格式: ${formatDateTime(now, "yyyy年MM月dd日 HH时mm分ss秒")}")
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -16,4 +16,16 @@ fun View.clickWithDebounce(delay: Long = 300, action: () -> Unit) {
|
||||
action()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun View.visible() {
|
||||
visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
fun View.invisible() {
|
||||
visibility = View.INVISIBLE
|
||||
}
|
||||
|
||||
fun View.gone() {
|
||||
visibility = View.GONE
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.zmkg.coaloperation.utils
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
|
||||
|
||||
object KeyboardUtil {
|
||||
|
||||
fun hideKeyboard(view: View) {
|
||||
val imm = view.context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
imm.hideSoftInputFromWindow(view.windowToken, 0)
|
||||
view.clearFocus() // 清除焦点避免键盘再次弹出
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import com.bigkoo.pickerview.builder.OptionsPickerBuilder
|
||||
import com.bigkoo.pickerview.builder.TimePickerBuilder
|
||||
import com.bigkoo.pickerview.listener.OnOptionsSelectListener
|
||||
import com.bigkoo.pickerview.listener.OnTimeSelectListener
|
||||
import com.zmkg.coaloperation.bean.WorkTeam
|
||||
import okio.Options
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Calendar
|
||||
@@ -17,38 +18,58 @@ import java.util.Locale
|
||||
object PickerUtil {
|
||||
|
||||
// 时间选择器示例
|
||||
fun showTimePicker(context: Context, action: (String) -> Unit) {
|
||||
fun showTimePicker(context: Context, dateString:String, action: (String) -> Unit) {
|
||||
val sdf = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault())
|
||||
TimePickerBuilder(context) { date, _ ->
|
||||
val sdf = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault())
|
||||
action(sdf.format(date))
|
||||
}.apply {
|
||||
setType(booleanArrayOf(true, true, true, false, false, false)) // 年月日
|
||||
setLabel("年", "月", "日", "", "", "")
|
||||
setDividerColor(Color.GRAY)
|
||||
setContentTextSize(20)
|
||||
setDate(Calendar.getInstance())
|
||||
val calendar = Calendar.getInstance()
|
||||
try {
|
||||
sdf.parse(dateString)?.let { date ->
|
||||
calendar.time = date
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
setDate(calendar)
|
||||
// 设置日期范围(2023-01-01至2025-12-31)
|
||||
val startDate = Calendar.getInstance().apply { set(2020, 0, 1) }
|
||||
val endDate = Calendar.getInstance().apply { set(2050, 11, 31) }
|
||||
setRangDate(startDate, endDate)
|
||||
setOutSideCancelable(true)
|
||||
}
|
||||
.build()
|
||||
.show()
|
||||
}
|
||||
|
||||
// 三级联动选择器示例
|
||||
fun showOptionsPicker(context: Context, options: List<String>, action: (String) -> Unit) {
|
||||
fun showTeamsPicker(context: Context, options: List<WorkTeam>, action: (WorkTeam) -> Unit) {
|
||||
OptionsPickerBuilder(context) { opt1, _, _, _ ->
|
||||
action(options[opt1])
|
||||
}.apply {
|
||||
setTitleText("请选择地区")
|
||||
setTitleText("选择施工队伍")
|
||||
setContentTextSize(18)
|
||||
setOutSideCancelable(false)
|
||||
setOutSideCancelable(true)
|
||||
}.build<String>().apply {
|
||||
setPicker(options, null, null)
|
||||
setPicker( options.map { it.teamName } , null, null)
|
||||
show()
|
||||
}
|
||||
}
|
||||
fun showOptionsPicker(context: Context, title:String, options: List<String>, action: (String) -> Unit) {
|
||||
OptionsPickerBuilder(context) { opt1, _, _, _ ->
|
||||
action(options[opt1])
|
||||
}.apply {
|
||||
setTitleText(title)
|
||||
setContentTextSize(18)
|
||||
setOutSideCancelable(true)
|
||||
}.build<String>().apply {
|
||||
setPicker( options , null, null)
|
||||
show()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
//package com.zmkg.coaloperation.view
|
||||
//
|
||||
//import android.annotation.SuppressLint
|
||||
//import android.content.Context
|
||||
//import android.util.AttributeSet
|
||||
//import android.view.MotionEvent
|
||||
//import androidx.recyclerview.widget.RecyclerView
|
||||
//
|
||||
//class CRecyclerView @JvmOverloads constructor(
|
||||
// context: Context,
|
||||
// attrs: AttributeSet? = null,
|
||||
// defStyleAttr: Int = 0
|
||||
//): RecyclerView(context, attrs, defStyleAttr) {
|
||||
//
|
||||
// override fun onInterceptTouchEvent(e: MotionEvent?): Boolean {
|
||||
// parent.requestDisallowInterceptTouchEvent(true)
|
||||
// return super.onInterceptTouchEvent(e)
|
||||
// }
|
||||
// var x1 = 0f
|
||||
// var y1 = 0f
|
||||
// @SuppressLint("ClickableViewAccessibility")
|
||||
// override fun onTouchEvent(e: MotionEvent): Boolean {
|
||||
// when (e.action) {
|
||||
// MotionEvent.ACTION_DOWN -> {
|
||||
// parent.requestDisallowInterceptTouchEvent(true)
|
||||
// x1 = e.x
|
||||
// y1 = e.y
|
||||
// }
|
||||
// MotionEvent.ACTION_MOVE -> {
|
||||
// val dy = e.y - y1
|
||||
// if (!canScrollVertically(-1) && dy > 0) { // 到达顶部继续下滑
|
||||
// parent.requestDisallowInterceptTouchEvent(false)
|
||||
// } else if (!canScrollVertically(1) && dy < 0) { // 到达底部继续上滑
|
||||
// parent.requestDisallowInterceptTouchEvent(false)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return super.onTouchEvent(e)
|
||||
// }
|
||||
//
|
||||
//
|
||||
//}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.zmkg.coaloperation.view
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.MotionEvent
|
||||
import android.view.ViewConfiguration
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import kotlin.math.abs
|
||||
|
||||
|
||||
class NestedRecyclerView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : RecyclerView(context, attrs, defStyleAttr) {
|
||||
|
||||
private var lastY = 0f
|
||||
private var isDragging = false
|
||||
|
||||
private var touchSlop = ViewConfiguration.get(context).scaledTouchSlop
|
||||
|
||||
override fun onInterceptTouchEvent(e: MotionEvent): Boolean {
|
||||
when (e.action) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
lastY = e.y
|
||||
parent.requestDisallowInterceptTouchEvent(true)
|
||||
}
|
||||
MotionEvent.ACTION_MOVE -> {
|
||||
val dy = e.y - lastY
|
||||
if (!canScrollVertically(-1) && dy > 0) {
|
||||
parent.requestDisallowInterceptTouchEvent(false)
|
||||
return false
|
||||
} else if (!canScrollVertically(1) && dy < 0) {
|
||||
parent.requestDisallowInterceptTouchEvent(false)
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onInterceptTouchEvent(e)
|
||||
}
|
||||
|
||||
override fun onTouchEvent(e: MotionEvent): Boolean {
|
||||
when (e.action) {
|
||||
MotionEvent.ACTION_MOVE -> {
|
||||
if (!isDragging && abs(e.y - lastY) > touchSlop) {
|
||||
isDragging = true
|
||||
}
|
||||
}
|
||||
MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> {
|
||||
isDragging = false
|
||||
}
|
||||
}
|
||||
return super.onTouchEvent(e)
|
||||
}
|
||||
|
||||
override fun dispatchTouchEvent(ev: MotionEvent): Boolean {
|
||||
when (ev.action) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
stopNestedScroll(ViewCompat.SCROLL_AXIS_VERTICAL)
|
||||
}
|
||||
}
|
||||
return super.dispatchTouchEvent(ev)
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 369 B |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 354 B |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
@@ -3,8 +3,8 @@
|
||||
android:shape="rectangle">
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#ff282c38" />
|
||||
<solid android:color="#ff17181c" />
|
||||
android:color="#282C38" />
|
||||
<solid android:color="#17181c" />
|
||||
<corners
|
||||
android:radius="10dp" />
|
||||
</shape>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:right="3dp" android:top="1dp" android:bottom="10dp">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="2dp" />
|
||||
<solid android:color="@color/scrollbar" />
|
||||
<size
|
||||
android:width="2dp"
|
||||
android:height="20dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -31,6 +31,7 @@
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:background="@drawable/bg_stroke_gray"
|
||||
android:orientation="vertical">
|
||||
|
||||
@@ -79,7 +80,7 @@
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvWorkDate"
|
||||
android:id="@+id/tvWorkingDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
@@ -111,7 +112,7 @@
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvWorkType"
|
||||
android:id="@+id/tvTeamShift"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
@@ -169,7 +170,7 @@
|
||||
android:textSize="16sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etInputLeader"
|
||||
android:id="@+id/etTeamLeader"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
@@ -201,12 +202,12 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:text="本日进尺"
|
||||
android:text="本班进尺"
|
||||
android:textColor="#6A6F87"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etInputTodayLength"
|
||||
android:id="@+id/etWorkingFootage"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
@@ -253,17 +254,31 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llRockPoint"
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:id="@+id/llRockPoint"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginStart="8dp"-->
|
||||
<!-- android:layout_marginEnd="15dp"-->
|
||||
<!-- android:orientation="vertical"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toEndOf="@id/tvRockName"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"-->
|
||||
<!-- tools:minHeight="60dp" />-->
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvLithology"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/tvRockName"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:minHeight="60dp" />
|
||||
tools:itemCount="3"
|
||||
android:overScrollMode="never"
|
||||
tools:listitem="@layout/list_item_rock"
|
||||
tools:minHeight="60dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btnAddPoint"
|
||||
@@ -278,9 +293,9 @@
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
app:drawableStartCompat="@drawable/ic_add_point"
|
||||
app:layout_constraintEnd_toEndOf="@id/llRockPoint"
|
||||
app:layout_constraintStart_toStartOf="@id/llRockPoint"
|
||||
app:layout_constraintTop_toBottomOf="@id/llRockPoint" />
|
||||
app:layout_constraintEnd_toEndOf="@id/rvLithology"
|
||||
app:layout_constraintStart_toStartOf="@id/rvLithology"
|
||||
app:layout_constraintTop_toBottomOf="@id/rvLithology" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<LinearLayout
|
||||
@@ -301,7 +316,7 @@
|
||||
android:textSize="16sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etInputCoalAngle"
|
||||
android:id="@+id/etSeamDip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
@@ -348,7 +363,7 @@
|
||||
android:textSize="16sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etInputCoalHeight"
|
||||
android:id="@+id/etSeamHeight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
@@ -392,7 +407,7 @@
|
||||
android:textSize="16sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etInputRecorder"
|
||||
android:id="@+id/etRecordPerson"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
android:descendantFocusability="blocksDescendants"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
@@ -22,8 +23,9 @@
|
||||
android:id="@+id/rv_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/item_geological_list" />
|
||||
tools:listitem="@layout/list_item_tunnel_working_face" />
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
@@ -1,13 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:ignore="HardcodedText">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
@@ -15,27 +16,20 @@
|
||||
|
||||
<include
|
||||
android:id="@+id/toolbar_lay"
|
||||
layout="@layout/lay_title_right_bar"
|
||||
app:title="@{@string/title_work_face}" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@+id/toolbar_lay"
|
||||
android:layout_marginTop="10dp">
|
||||
layout="@layout/lay_title_right_bar" />
|
||||
<!-- app:title="@{@string/title_work_face}"-->
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="80dp">
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginHorizontal="20dp">
|
||||
|
||||
<com.allen.library.shape.ShapeLinearLayout
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:orientation="vertical"
|
||||
app:shapeCornersRadius="8dp"
|
||||
app:shapeSolidColor="#282C38">
|
||||
android:background="@drawable/bg_stroke_gray">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -116,7 +110,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
android:visibility="visible">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -132,12 +126,13 @@
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/etCoalSeam"
|
||||
android:id="@+id/tv_seam_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:textColor="@color/white"
|
||||
@@ -167,12 +162,13 @@
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/etCoalArea"
|
||||
android:id="@+id/tv_area_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:textColor="@color/white"
|
||||
@@ -202,7 +198,7 @@
|
||||
android:textSize="16sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etFaceAngle"
|
||||
android:id="@+id/et_surface_azimuth"
|
||||
android:layout_width="140dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_alignParentRight="true"
|
||||
@@ -239,7 +235,7 @@
|
||||
android:textSize="16sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etFaceHeight"
|
||||
android:id="@+id/et_surface_height"
|
||||
android:layout_width="140dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_alignParentRight="true"
|
||||
@@ -276,7 +272,7 @@
|
||||
android:textSize="16sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etFaceWidth"
|
||||
android:id="@+id/et_surface_width"
|
||||
android:layout_width="140dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_alignParentRight="true"
|
||||
@@ -313,12 +309,13 @@
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCoalType"
|
||||
android:id="@+id/tv_tunnel_nature"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:textColor="@color/white"
|
||||
@@ -347,16 +344,16 @@
|
||||
android:textColor="#6A6F87"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/planned_date1"
|
||||
android:layout_width="80dp"
|
||||
<TextView
|
||||
android:id="@+id/et_plan_start_date"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_toLeftOf="@+id/line1"
|
||||
android:background="@drawable/rectangle_stroke_grey_corner8"
|
||||
android:hint="请输入"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="5dp"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHint="#757B8C"
|
||||
@@ -368,22 +365,24 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toLeftOf="@+id/planned_date2"
|
||||
android:text="---"
|
||||
android:layout_toLeftOf="@+id/et_plann_end_date"
|
||||
android:text="~"
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/planned_date2"
|
||||
android:layout_width="80dp"
|
||||
<TextView
|
||||
android:id="@+id/et_plann_end_date"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:background="@drawable/rectangle_stroke_grey_corner8"
|
||||
android:hint="请输入"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="5dp"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHint="#757B8C"
|
||||
@@ -615,40 +614,35 @@
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/img_expand"
|
||||
<ImageView
|
||||
android:id="@+id/imgExpand"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center_horizontal">
|
||||
android:paddingStart="15dp"
|
||||
android:paddingEnd="15dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:src="@drawable/ic_arrow_down_white2"
|
||||
android:scaleType="fitCenter"
|
||||
tools:ignore="ContentDescription"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_view"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="12dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:background="@mipmap/arrow_down_white"
|
||||
android:scaleType="center" />
|
||||
</RelativeLayout>
|
||||
|
||||
</com.allen.library.shape.ShapeLinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<com.allen.library.shape.ShapeTextView
|
||||
android:id="@+id/confirm"
|
||||
android:layout_width="247dp"
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:gravity="center"
|
||||
android:text="确认新增"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
app:shapeCornersRadius="30dp"
|
||||
app:shapeSolidColor="#21A69A" />
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
@@ -12,7 +12,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<com.allen.library.shape.ShapeRelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="74dp"
|
||||
@@ -29,8 +28,7 @@
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="13dp"
|
||||
android:background="@mipmap/ic_geological"
|
||||
android:scaleType="fitXY" />
|
||||
android:background="@drawable/ic_geological" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
@@ -46,10 +44,11 @@
|
||||
android:id="@+id/expand"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:padding="6dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="13dp"
|
||||
android:src="@mipmap/ic_arrow_right"
|
||||
android:src="@drawable/ic_arrow_right_gray"
|
||||
android:tag="0" />
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:ignore="ContentDescription">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:descendantFocusability="blocksDescendants"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.allen.library.shape.ShapeLinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="74dp"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical"
|
||||
app:shapeCornersRadius="10dp"
|
||||
app:shapeSolidColor="#1C21A69A"
|
||||
app:shapeStrokeColor="#FF26FFEB"
|
||||
app:shapeStrokeWidth="0.5dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:background="@drawable/ic_geological" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvWorkingFaceName"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
tools:text="5-20304回风工作面" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivExpandRecord"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:padding="13dp"
|
||||
android:src="@drawable/ic_arrow_right_gray"
|
||||
android:tag="false" />
|
||||
|
||||
</com.allen.library.shape.ShapeLinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llFaceRecord"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="30dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llRvParent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/bg_stroke_gray">
|
||||
|
||||
<include
|
||||
android:id="@+id/includeHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
layout="@layout/list_item_tunnel_working_face_record" />
|
||||
|
||||
<com.zmkg.coaloperation.view.NestedRecyclerView
|
||||
android:id="@+id/rvFaceRecord"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:overScrollMode="ifContentScrolls"
|
||||
android:fadeScrollbars="false"
|
||||
android:scrollbars="vertical"
|
||||
android:scrollbarThumbVertical="@drawable/scrollbar_thumb"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:itemCount="3"
|
||||
tools:listitem="@layout/list_item_tunnel_working_face_record" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.allen.library.shape.ShapeTextView
|
||||
android:id="@+id/start_record"
|
||||
android:layout_width="154dp"
|
||||
android:layout_height="44dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:focusable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:gravity="center"
|
||||
android:text="开始记录"
|
||||
android:textColor="@color/white"
|
||||
app:shapeCornersRadius="30dp"
|
||||
app:shapeSolidColor="#21A69A" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
@@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:ignore="HardcodedText">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
tools:background="#17181C"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:descendantFocusability="blocksDescendants">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/time"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.56"
|
||||
android:gravity="center"
|
||||
android:text="时间"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.google.android.material.divider.MaterialDivider
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
app:dividerColor="#282C38"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/record"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.11"
|
||||
android:gravity="center"
|
||||
android:text="记录人"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<com.google.android.material.divider.MaterialDivider
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
app:dividerColor="#282C38"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/operation"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="操作"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.divider.MaterialDivider
|
||||
android:id="@+id/divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:dividerColor="#282C38"
|
||||
android:visibility="visible"/>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
@@ -12,7 +12,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
tools:background="@color/text_gray1">
|
||||
tools:background="@color/text_green">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvItemName"
|
||||
|
||||
|
Before Width: | Height: | Size: 253 B |
|
Before Width: | Height: | Size: 249 B |
|
Before Width: | Height: | Size: 224 B |
|
Before Width: | Height: | Size: 247 B |
|
Before Width: | Height: | Size: 880 B |
@@ -30,4 +30,5 @@
|
||||
<color name="black_bg">#0C0D0E</color>
|
||||
<color name="black_bg2">#17181C</color>
|
||||
<color name="shape_green">#A3FEA6</color>
|
||||
<color name="scrollbar">#FF21A69A</color>
|
||||
</resources>
|
||||
@@ -5,7 +5,8 @@ buildscript {
|
||||
plugins {
|
||||
id 'com.android.application' version '7.2.2' apply false
|
||||
id 'com.android.library' version '7.2.2' apply false
|
||||
id 'org.jetbrains.kotlin.android' version '1.9.0' apply false
|
||||
// id 'org.jetbrains.kotlin.android' version '1.9.0' apply false
|
||||
id 'org.jetbrains.kotlin.android' version '2.0.21' apply false
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.8.20' apply false
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
ext {
|
||||
minSdkVersion = 26
|
||||
targetSdkVersion = 32
|
||||
compileSdkVersion = 33
|
||||
targetSdkVersion = 34
|
||||
compileSdkVersion = 34
|
||||
versionCode = 100
|
||||
versionName = "1.0.0"
|
||||
//Dependencies
|
||||
junitVersion = "4.12"
|
||||
lifecycleVersion = "2.6.0-alpha01"
|
||||
kotlinVersion = "1.7.10"
|
||||
// kotlinVersion = "1.7.10"
|
||||
kotlinVersion = "2.0.21"
|
||||
glideVersion = "4.13.0"
|
||||
recycleViewVersion = "1.2.1"
|
||||
appcompatVersion = "1.5.0"
|
||||
|
||||
@@ -16,59 +16,57 @@ dependencyResolutionManagement {
|
||||
google()
|
||||
mavenCentral()
|
||||
maven { url "https://mirrors.tencent.com/nexus/repository/maven-public/" }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
rootProject.name = "digitalCoalMiningPlatform"
|
||||
include ':app'
|
||||
|
||||
// 引入内部组件通信模块 (必要模块)
|
||||
include ':tuicore'
|
||||
project(':tuicore').projectDir = new File(settingsDir, '../CoalMiningKit/TUICore/tuicore')
|
||||
|
||||
// 引入 IM 组件公共模块(必要模块)
|
||||
include ':timcommon'
|
||||
project(':timcommon').projectDir = new File(settingsDir, '../CoalMiningKit/TIMCommon/timcommon')
|
||||
|
||||
// 引入聊天功能模块 (基础功能模块)
|
||||
include ':tuichat'
|
||||
project(':tuichat').projectDir = new File(settingsDir, '../CoalMiningKit/TUIChat/tuichat')
|
||||
|
||||
// 引入关系链功能模块 (基础功能模块)
|
||||
include ':tuicontact'
|
||||
project(':tuicontact').projectDir = new File(settingsDir, '../CoalMiningKit/TUIContact/tuicontact')
|
||||
|
||||
// 引入会话功能模块 (基础功能模块)
|
||||
include ':tuiconversation'
|
||||
project(':tuiconversation').projectDir = new File(settingsDir, '../CoalMiningKit/TUIConversation/tuiconversation')
|
||||
|
||||
//// 引入搜索功能模块(需要购买旗舰版或企业版套餐)
|
||||
//include ':tuisearch'
|
||||
//project(':tuisearch').projectDir = new File(settingsDir, '../CoalMiningKit/TUISearch/tuisearch')
|
||||
//// 引入内部组件通信模块 (必要模块)
|
||||
//include ':tuicore'
|
||||
//project(':tuicore').projectDir = new File(settingsDir, '../CoalMiningKit/TUICore/tuicore')
|
||||
//
|
||||
//// 引入社群话题功能模块(需要购买旗舰版或企业版套餐)
|
||||
//include ':tuicommunity'
|
||||
//project(':tuicommunity').projectDir = new File(settingsDir, '../CoalMiningKit/TUICommunity/tuicommunity')
|
||||
|
||||
// 引入音视频通话功能模块
|
||||
include ':tuicallkit'
|
||||
project(':tuicallkit').projectDir = new File(settingsDir, '../CoalMiningKit/TUICallKit/tuicallkit-kt')
|
||||
|
||||
//// 引入视频会议模块
|
||||
//include ':tuiroomkit'
|
||||
//project(':tuiroomkit').projectDir = new File(settingsDir, '../CoalMiningKit/TUIRoomKit/tuiroomkit')
|
||||
//// 引入 IM 组件公共模块(必要模块)
|
||||
//include ':timcommon'
|
||||
//project(':timcommon').projectDir = new File(settingsDir, '../CoalMiningKit/TIMCommon/timcommon')
|
||||
//
|
||||
//// 引入语音转文字插件,从 7.5 版本开始支持
|
||||
//include ':tuivoicetotextplugin'
|
||||
//project(':tuivoicetotextplugin').projectDir = new File(settingsDir, '../CoalMiningKit/TUIVoiceToTextPlugin/tuivoicetotextplugin')
|
||||
//// 引入聊天功能模块 (基础功能模块)
|
||||
//include ':tuichat'
|
||||
//project(':tuichat').projectDir = new File(settingsDir, '../CoalMiningKit/TUIChat/tuichat')
|
||||
//
|
||||
//// 引入聊天消息翻译插件,从 7.2 版本开始支持(需单独购买翻译插件)
|
||||
//include ':tuitranslationplugin'
|
||||
//project(':tuitranslationplugin').projectDir = new File(settingsDir, '../CoalMiningKit/TUITranslationPlugin/tuitranslationplugin')
|
||||
//// 引入关系链功能模块 (基础功能模块)
|
||||
//include ':tuicontact'
|
||||
//project(':tuicontact').projectDir = new File(settingsDir, '../CoalMiningKit/TUIContact/tuicontact')
|
||||
//
|
||||
//// 引入表情回应插件,从 7.8 版本开始支持(需要购买旗舰版或企业版套餐)
|
||||
//include ':tuiemojiplugin'
|
||||
//project(':tuiemojiplugin').projectDir = new File(settingsDir, '../CoalMiningKit/TUIEmojiPlugin/tuiemojiplugin')
|
||||
//// 引入会话功能模块 (基础功能模块)
|
||||
//include ':tuiconversation'
|
||||
//project(':tuiconversation').projectDir = new File(settingsDir, '../CoalMiningKit/TUIConversation/tuiconversation')
|
||||
//
|
||||
////// 引入搜索功能模块(需要购买旗舰版或企业版套餐)
|
||||
////include ':tuisearch'
|
||||
////project(':tuisearch').projectDir = new File(settingsDir, '../CoalMiningKit/TUISearch/tuisearch')
|
||||
////
|
||||
////// 引入社群话题功能模块(需要购买旗舰版或企业版套餐)
|
||||
////include ':tuicommunity'
|
||||
////project(':tuicommunity').projectDir = new File(settingsDir, '../CoalMiningKit/TUICommunity/tuicommunity')
|
||||
//
|
||||
//// 引入音视频通话功能模块
|
||||
//include ':tuicallkit'
|
||||
//project(':tuicallkit').projectDir = new File(settingsDir, '../CoalMiningKit/TUICallKit/tuicallkit-kt')
|
||||
//
|
||||
////// 引入视频会议模块
|
||||
////include ':tuiroomkit'
|
||||
////project(':tuiroomkit').projectDir = new File(settingsDir, '../CoalMiningKit/TUIRoomKit/tuiroomkit')
|
||||
////
|
||||
////// 引入语音转文字插件,从 7.5 版本开始支持
|
||||
////include ':tuivoicetotextplugin'
|
||||
////project(':tuivoicetotextplugin').projectDir = new File(settingsDir, '../CoalMiningKit/TUIVoiceToTextPlugin/tuivoicetotextplugin')
|
||||
////
|
||||
////// 引入聊天消息翻译插件,从 7.2 版本开始支持(需单独购买翻译插件)
|
||||
////include ':tuitranslationplugin'
|
||||
////project(':tuitranslationplugin').projectDir = new File(settingsDir, '../CoalMiningKit/TUITranslationPlugin/tuitranslationplugin')
|
||||
////
|
||||
////// 引入表情回应插件,从 7.8 版本开始支持(需要购买旗舰版或企业版套餐)
|
||||
////include ':tuiemojiplugin'
|
||||
////project(':tuiemojiplugin').projectDir = new File(settingsDir, '../CoalMiningKit/TUIEmojiPlugin/tuiemojiplugin')
|
||||
|
||||
|
||||
|
||||