工作面与记录数字格式显示优化
This commit is contained in:
+14
-13
@@ -9,20 +9,21 @@ import androidx.core.view.updateLayoutParams
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
||||
import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.bean.TunnelWorkingRecordItem
|
||||
import com.zmkg.coaloperation.bean.TunnelWorkingItem
|
||||
import com.zmkg.coaloperation.databinding.ListItemRockBinding
|
||||
import com.zmkg.coaloperation.databinding.ListItemTunnelWorkingRecordItemBinding
|
||||
import com.zmkg.coaloperation.databinding.ListItemTunnelWorkingItemBinding
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelRoofLithologyEntity
|
||||
import com.zmkg.coaloperation.utils.ScreenUtil
|
||||
import com.zmkg.coaloperation.utils.formatDecimalString
|
||||
|
||||
class TunnelWorkingRecordItemAdapter(data: MutableList<TunnelWorkingRecordItem>) :
|
||||
BaseQuickAdapter<TunnelWorkingRecordItem, TunnelWorkingRecordItemAdapter.VH>(
|
||||
R.layout.list_item_tunnel_working_record_item,
|
||||
class TunnelWorkingItemAdapter(data: MutableList<TunnelWorkingItem>) :
|
||||
BaseQuickAdapter<TunnelWorkingItem, TunnelWorkingItemAdapter.VH>(
|
||||
R.layout.list_item_tunnel_working_item,
|
||||
data
|
||||
) {
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): VH {
|
||||
val binding = ListItemTunnelWorkingRecordItemBinding.inflate(
|
||||
val binding = ListItemTunnelWorkingItemBinding.inflate(
|
||||
LayoutInflater.from(parent.context),
|
||||
parent,
|
||||
false
|
||||
@@ -34,12 +35,12 @@ class TunnelWorkingRecordItemAdapter(data: MutableList<TunnelWorkingRecordItem>)
|
||||
|
||||
override fun convert(
|
||||
holder: VH,
|
||||
item: TunnelWorkingRecordItem
|
||||
item: TunnelWorkingItem
|
||||
) {
|
||||
if (item.pageType == 0) {
|
||||
loadFaceData(holder.binding, item)
|
||||
} else if (item.pageType == 1) {
|
||||
loadPointData(holder.binding, item)
|
||||
loadRecordData(holder.binding, item)
|
||||
}
|
||||
val position = holder.layoutPosition
|
||||
holder.binding.divider.let {
|
||||
@@ -51,7 +52,7 @@ class TunnelWorkingRecordItemAdapter(data: MutableList<TunnelWorkingRecordItem>)
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadPointData(binding: ListItemTunnelWorkingRecordItemBinding, item: TunnelWorkingRecordItem) {
|
||||
private fun loadRecordData(binding: ListItemTunnelWorkingItemBinding, item: TunnelWorkingItem) {
|
||||
binding.run {
|
||||
tvItemName.text = item.name
|
||||
if (item.items.isNullOrEmpty()) {
|
||||
@@ -72,7 +73,7 @@ class TunnelWorkingRecordItemAdapter(data: MutableList<TunnelWorkingRecordItem>)
|
||||
}
|
||||
}
|
||||
}
|
||||
private fun loadFaceData(binding: ListItemTunnelWorkingRecordItemBinding, item: TunnelWorkingRecordItem) {
|
||||
private fun loadFaceData(binding: ListItemTunnelWorkingItemBinding, item: TunnelWorkingItem) {
|
||||
binding.tvItemName.let {
|
||||
it.updateLayoutParams { height = ScreenUtil.dp2px(50f) }
|
||||
it.text = item.name
|
||||
@@ -95,12 +96,12 @@ class TunnelWorkingRecordItemAdapter(data: MutableList<TunnelWorkingRecordItem>)
|
||||
tvRockStartLen.let {
|
||||
it.focusable = EditText.NOT_FOCUSABLE
|
||||
it.setOnKeyListener(null)
|
||||
it.setText(item.positionStart)
|
||||
it.setText(item.positionStart.formatDecimalString())
|
||||
}
|
||||
tvRockEndLen.let {
|
||||
it.focusable = EditText.NOT_FOCUSABLE
|
||||
it.setOnKeyListener(null)
|
||||
it.setText(item.positionEnd)
|
||||
it.setText(item.positionEnd.formatDecimalString())
|
||||
}
|
||||
tvRockType.let {
|
||||
it.focusable = EditText.NOT_FOCUSABLE
|
||||
@@ -113,5 +114,5 @@ class TunnelWorkingRecordItemAdapter(data: MutableList<TunnelWorkingRecordItem>)
|
||||
}
|
||||
|
||||
|
||||
inner class VH(var binding: ListItemTunnelWorkingRecordItemBinding) : BaseViewHolder(binding.root)
|
||||
inner class VH(var binding: ListItemTunnelWorkingItemBinding) : BaseViewHolder(binding.root)
|
||||
}
|
||||
+1
-1
@@ -2,7 +2,7 @@ package com.zmkg.coaloperation.bean
|
||||
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelRoofLithologyEntity
|
||||
|
||||
data class TunnelWorkingRecordItem(
|
||||
data class TunnelWorkingItem(
|
||||
var name: String? = "",
|
||||
var value: String? = "",
|
||||
var items: MutableList<TunnelRoofLithologyEntity>? = null,
|
||||
+18
-18
@@ -7,8 +7,8 @@ import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.base.BaseVMBActivity
|
||||
import com.zmkg.coaloperation.base.viewmodel.TestViewModel
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.zmkg.coaloperation.adapter.TunnelWorkingRecordItemAdapter
|
||||
import com.zmkg.coaloperation.bean.TunnelWorkingRecordItem
|
||||
import com.zmkg.coaloperation.adapter.TunnelWorkingItemAdapter
|
||||
import com.zmkg.coaloperation.bean.TunnelWorkingItem
|
||||
import com.zmkg.coaloperation.databinding.ActivityWorkingFaceDetailBinding
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelWorkingFaceEntity
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
@@ -23,12 +23,12 @@ class WorkingFaceDetailActivity :
|
||||
const val FACE_WORK_DETAIL_DATA = "faceWorkDetailData"
|
||||
}
|
||||
|
||||
private val list: MutableList<TunnelWorkingRecordItem> = mutableListOf()
|
||||
private val list: MutableList<TunnelWorkingItem> = mutableListOf()
|
||||
|
||||
// private var detail:FaceWorkDetailBean?=null
|
||||
private var detail: TunnelWorkingFaceEntity? = null
|
||||
private val adapter by lazy {
|
||||
TunnelWorkingRecordItemAdapter(list)
|
||||
TunnelWorkingItemAdapter(list)
|
||||
}
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
@@ -66,38 +66,38 @@ class WorkingFaceDetailActivity :
|
||||
private fun loadFaceDetail(it: TunnelWorkingFaceEntity) {
|
||||
mBinding.toolbarLay.title = it.surfaceName
|
||||
list.clear()
|
||||
list.add(TunnelWorkingRecordItem(pageType = 0, name = "工作面名称", value = it.surfaceName))
|
||||
list.add(TunnelWorkingRecordItem(pageType = 0, name = "所属煤层", value = it.seamName))
|
||||
list.add(TunnelWorkingRecordItem(pageType = 0, name = "所属采区域", value = it.areaName))
|
||||
list.add(TunnelWorkingRecordItem(pageType = 0, name = "工作面方位角", value = it.surfaceAzimuth))
|
||||
list.add(TunnelWorkingRecordItem(pageType = 0, name = "工作面巷高", value = it.surfaceHeight))
|
||||
list.add(TunnelWorkingRecordItem(pageType = 0, name = "工作面巷宽", value = it.surfaceWidth))
|
||||
list.add(TunnelWorkingRecordItem(pageType = 0, name = "巷道性质", value = it.tunnelNature))
|
||||
list.add(TunnelWorkingItem(pageType = 0, name = "工作面名称", value = it.surfaceName))
|
||||
list.add(TunnelWorkingItem(pageType = 0, name = "所属煤层", value = it.seamName))
|
||||
list.add(TunnelWorkingItem(pageType = 0, name = "所属采区域", value = it.areaName))
|
||||
list.add(TunnelWorkingItem(pageType = 0, name = "工作面方位角", value = it.surfaceAzimuth))
|
||||
list.add(TunnelWorkingItem(pageType = 0, name = "工作面巷高", value = it.surfaceHeight))
|
||||
list.add(TunnelWorkingItem(pageType = 0, name = "工作面巷宽", value = it.surfaceWidth))
|
||||
list.add(TunnelWorkingItem(pageType = 0, name = "巷道性质", value = it.tunnelNature))
|
||||
list.add(
|
||||
TunnelWorkingRecordItem(
|
||||
TunnelWorkingItem(
|
||||
pageType = 0,
|
||||
name = "计划工期",
|
||||
value = "${it.planStartDate} ~ ${it.planEndDate}"
|
||||
)
|
||||
)
|
||||
list.add(TunnelWorkingRecordItem(pageType = 0, name = "地质类型", value = it.geologicalType))
|
||||
list.add(TunnelWorkingItem(pageType = 0, name = "地质类型", value = it.geologicalType))
|
||||
list.add(
|
||||
TunnelWorkingRecordItem(
|
||||
TunnelWorkingItem(
|
||||
pageType = 0,
|
||||
name = "水文地质类型",
|
||||
value = it.hydrogeologicalType
|
||||
)
|
||||
)
|
||||
list.add(TunnelWorkingRecordItem(pageType = 0, name = "煤层发火性", value = it.seamIgnition))
|
||||
list.add(TunnelWorkingRecordItem(pageType = 0, name = "瓦斯含量", value = it.seamGas))
|
||||
list.add(TunnelWorkingItem(pageType = 0, name = "煤层发火性", value = it.seamIgnition))
|
||||
list.add(TunnelWorkingItem(pageType = 0, name = "瓦斯含量", value = it.seamGas))
|
||||
list.add(
|
||||
TunnelWorkingRecordItem(
|
||||
TunnelWorkingItem(
|
||||
pageType = 0,
|
||||
name = "冲击地压危险性",
|
||||
value = it.seamBumpPressure
|
||||
)
|
||||
)
|
||||
list.add(TunnelWorkingRecordItem(pageType = 0, name = "支护形式", value = it.surfaceSupportForm))
|
||||
list.add(TunnelWorkingItem(pageType = 0, name = "支护形式", value = it.surfaceSupportForm))
|
||||
|
||||
adapter.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
+14
-14
@@ -7,10 +7,10 @@ import android.view.View
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.adapter.TunnelWorkingRecordItemAdapter
|
||||
import com.zmkg.coaloperation.adapter.TunnelWorkingItemAdapter
|
||||
import com.zmkg.coaloperation.base.BaseVMBActivity
|
||||
import com.zmkg.coaloperation.base.viewmodel.TestViewModel
|
||||
import com.zmkg.coaloperation.bean.TunnelWorkingRecordItem
|
||||
import com.zmkg.coaloperation.bean.TunnelWorkingItem
|
||||
import com.zmkg.coaloperation.databinding.ActivityWorkingFaceRecordBinding
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelWorkingFaceRecordEntity
|
||||
import com.zmkg.coaloperation.db.viewmodel.TunnelRoofLithologyViewModel
|
||||
@@ -33,13 +33,13 @@ class WorkingFaceRecordActivity :
|
||||
|
||||
private var faceName: String? = null
|
||||
private var faceRecord: TunnelWorkingFaceRecordEntity? = null
|
||||
private val list: MutableList<TunnelWorkingRecordItem> = mutableListOf()
|
||||
private val list: MutableList<TunnelWorkingItem> = mutableListOf()
|
||||
|
||||
private val roofLithologyViewModel: TunnelRoofLithologyViewModel by lazy {
|
||||
ViewModelProvider(this)[TunnelRoofLithologyViewModel::class.java]
|
||||
}
|
||||
private val adapter by lazy {
|
||||
TunnelWorkingRecordItemAdapter(list)
|
||||
TunnelWorkingItemAdapter(list)
|
||||
}
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
@@ -75,26 +75,26 @@ class WorkingFaceRecordActivity :
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
private fun loadFaceRecord(it: TunnelWorkingFaceRecordEntity) {
|
||||
list.clear()
|
||||
list.add(TunnelWorkingRecordItem(pageType = 1, name = "工作面名称", value = faceName))
|
||||
list.add(TunnelWorkingRecordItem(pageType = 1, name = "施工日期", value = it.workingDate))
|
||||
list.add(TunnelWorkingItem(pageType = 1, name = "工作面名称", value = faceName))
|
||||
list.add(TunnelWorkingItem(pageType = 1, name = "施工日期", value = it.workingDate))
|
||||
list.add(
|
||||
TunnelWorkingRecordItem(
|
||||
TunnelWorkingItem(
|
||||
pageType = 1,
|
||||
name = "施工班次",
|
||||
value = DictUtils.getTeamShift(it.teamShift)
|
||||
)
|
||||
)
|
||||
list.add(TunnelWorkingRecordItem(pageType = 1, name = "施工队伍", value = it.teamName))
|
||||
list.add(TunnelWorkingRecordItem(pageType = 1, name = "带班队长", value = it.teamLeader))
|
||||
list.add(TunnelWorkingRecordItem(pageType = 1, name = "本班进尺", value = it.workingFootage))
|
||||
list.add(TunnelWorkingItem(pageType = 1, name = "施工队伍", value = it.teamName))
|
||||
list.add(TunnelWorkingItem(pageType = 1, name = "带班队长", value = it.teamLeader))
|
||||
list.add(TunnelWorkingItem(pageType = 1, name = "本班进尺", value = it.workingFootage))
|
||||
|
||||
// val rockList = mutableListOf<TunnelRoofLithologyEntity>()
|
||||
// rockList.add(RockItem(startLen = 0, endLen = 1, rockType = "泥"))
|
||||
// rockList.add(RockItem(startLen = 0, endLen = 1, rockType = "砂"))
|
||||
list.add(TunnelWorkingRecordItem(pageType = 1, name = "顶板岩性", value = "", items = null))
|
||||
list.add(TunnelWorkingRecordItem(pageType = 1, name = "煤层倾角", value = it.seamDip))
|
||||
list.add(TunnelWorkingRecordItem(pageType = 1, name = "煤层高", value = it.seamHeight))
|
||||
list.add(TunnelWorkingRecordItem(pageType = 1, name = "记录人", value = it.recordPerson))
|
||||
list.add(TunnelWorkingItem(pageType = 1, name = "顶板岩性", value = "", items = null))
|
||||
list.add(TunnelWorkingItem(pageType = 1, name = "煤层倾角", value = it.seamDip))
|
||||
list.add(TunnelWorkingItem(pageType = 1, name = "煤层高", value = it.seamHeight))
|
||||
list.add(TunnelWorkingItem(pageType = 1, name = "记录人", value = it.recordPerson))
|
||||
|
||||
adapter.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
+7
-6
@@ -15,6 +15,7 @@ import com.zmkg.coaloperation.databinding.ActivityWorkingFaceStatisticsBinding
|
||||
import com.zmkg.coaloperation.bean.FaceWorkDetailBean
|
||||
import com.zmkg.coaloperation.ui.tunneling.viewmodel.TunnelingViewModel
|
||||
import com.zmkg.coaloperation.utils.ScreenUtil
|
||||
import com.zmkg.coaloperation.utils.formatDecimalString
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
import kotlin.apply
|
||||
@@ -89,10 +90,10 @@ class WorkingFaceStatisticsActivity :
|
||||
loadFaceDetail()
|
||||
workingFaceRecordViewModel.getLastEntity(detail.surfaceId) { record ->
|
||||
record?.let {
|
||||
mBinding.tvYesterdayLen.text = "${it.workingFootage}m"
|
||||
mBinding.tvWorkingFaceAngle.text = "${it.seamDip}"
|
||||
mBinding.tvYesterdayLen.text = "${it.workingFootage?.formatDecimalString()}m"
|
||||
mBinding.tvWorkingFaceAngle.text = "${it.seamDip?.formatDecimalString()}"
|
||||
// mBinding.tvMonthAccumulateLen.text = "${it.monthFootage}m"
|
||||
mBinding.tvWorkingFaceWater.text = "${it.waterYield}"
|
||||
mBinding.tvWorkingFaceWater.text = "${it.waterYield?.formatDecimalString()}"
|
||||
|
||||
roofLithologyViewModel.getEntityList(it.recordId) { list ->
|
||||
list?.let {
|
||||
@@ -151,9 +152,9 @@ class WorkingFaceStatisticsActivity :
|
||||
val accumulative = stringToDouble(bean.accumulativeFootage)
|
||||
val remaining = stringToDouble(bean.remainingFootage)
|
||||
|
||||
tvLenTotal.text = "总进尺:${total}m"
|
||||
tvLenAccumulate.text = "累计进尺:${accumulative}m"
|
||||
tvLenRemain.text = "剩余进尺:${remaining}m"
|
||||
tvLenTotal.text = "总进尺:${bean.totalFootage?.formatDecimalString()}m"
|
||||
tvLenAccumulate.text = "累计进尺:${bean.accumulativeFootage?.formatDecimalString()}m"
|
||||
tvLenRemain.text = "剩余进尺:${bean.remainingFootage?.formatDecimalString()}m"
|
||||
|
||||
//累计进尺占比
|
||||
var radio = 0
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
android:layout_marginBottom="10dp"
|
||||
tools:itemCount="20"
|
||||
android:overScrollMode="never"
|
||||
tools:listitem="@layout/list_item_tunnel_working_record_item"
|
||||
tools:listitem="@layout/list_item_tunnel_working_item"
|
||||
android:background="@drawable/bg_stroke_gray"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
android:layout_marginBottom="10dp"
|
||||
tools:itemCount="10"
|
||||
android:overScrollMode="never"
|
||||
tools:listitem="@layout/list_item_tunnel_working_record_item"
|
||||
tools:listitem="@layout/list_item_tunnel_working_item"
|
||||
android:background="@drawable/bg_stroke_gray"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
Reference in New Issue
Block a user