增加数据推送、工作面列表、记录列表改为倒序,新数据展示在最上面、增加待提交数据标识、其它问题优化
This commit is contained in:
@@ -26,6 +26,8 @@ android {
|
||||
arg("room.schemaLocation", "$projectDir/schemas")
|
||||
}
|
||||
}
|
||||
// 设置输出APK文件名格式
|
||||
setProperty("archivesBaseName", "煤矿数采终端v${versionName}")
|
||||
}
|
||||
|
||||
signingConfigs{
|
||||
@@ -105,4 +107,7 @@ dependencies {
|
||||
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1"
|
||||
implementation 'com.google.code.gson:gson:2.10.1'
|
||||
|
||||
implementation("org.apache.poi:poi:5.2.3")
|
||||
implementation("org.apache.poi:poi-ooxml:5.2.3")
|
||||
|
||||
}
|
||||
@@ -3,7 +3,11 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.zmkg.coaloperation">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET " />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
|
||||
tools:ignore="ScopedStorage"/>
|
||||
|
||||
<application
|
||||
android:name=".MyApplication"
|
||||
@@ -15,6 +19,17 @@
|
||||
android:usesCleartextTraffic="true"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
tools:replace="android:allowBackup">
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/file_paths"/>
|
||||
</provider>
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="false" />
|
||||
|
||||
+3
@@ -49,6 +49,9 @@ class TunnelWorkingFaceAdapter(var list: MutableList<TunnelWorkingFaceEntity>) :
|
||||
binding.llFaceRecord.let {
|
||||
if (item.isExpandRecord) it.visible() else it.gone()
|
||||
}
|
||||
binding.ivFlagEdit.let {
|
||||
if (item.dataState == "1") it.visible() else it.gone()
|
||||
}
|
||||
binding.ivExpandRecord.setImageResource(
|
||||
if (item.isExpandRecord) R.drawable.ic_arrow_down_white else R.drawable.ic_arrow_right_gray
|
||||
)
|
||||
|
||||
+7
@@ -10,6 +10,8 @@ import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelWorkingFaceRecordEntity
|
||||
import androidx.core.graphics.toColorInt
|
||||
import com.zmkg.coaloperation.databinding.ListItemTunnelWorkingFaceRecordBinding
|
||||
import com.zmkg.coaloperation.utils.gone
|
||||
import com.zmkg.coaloperation.utils.visible
|
||||
|
||||
class TunnelWorkingFaceRecordAdapter(var list: MutableList<TunnelWorkingFaceRecordEntity>) :
|
||||
BaseQuickAdapter<TunnelWorkingFaceRecordEntity, TunnelWorkingFaceRecordAdapter.VH>(
|
||||
@@ -50,6 +52,11 @@ class TunnelWorkingFaceRecordAdapter(var list: MutableList<TunnelWorkingFaceReco
|
||||
it.operation.text = if (item.operationType == "1") "查看" else "操作"
|
||||
it.divider.visibility =
|
||||
if (position == list.size - 1) View.GONE else View.VISIBLE
|
||||
|
||||
|
||||
it.ivFlagEdit.let {
|
||||
if (item.dataState == "1") it.visible() else it.gone()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.zmkg.coaloperation.bean
|
||||
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelRoofLithologyEntity
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelWorkingFaceEntity
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelWorkingFaceRecordEntity
|
||||
|
||||
data class TunnelWorkingItem(
|
||||
var name: String? = "",
|
||||
@@ -19,3 +21,9 @@ data class WorkOption(
|
||||
var id:String,
|
||||
var name: String
|
||||
)
|
||||
|
||||
data class TunnelSubmitData(
|
||||
var faceList: MutableList<TunnelWorkingFaceEntity>?=null,
|
||||
var recordList: MutableList<TunnelWorkingFaceRecordEntity>?=null,
|
||||
var lithologyList: MutableList<TunnelRoofLithologyEntity>?=null
|
||||
)
|
||||
|
||||
@@ -33,60 +33,60 @@ import java.io.Serializable
|
||||
// val seamBumpPressure: String?,
|
||||
// val surfaceSupportForm: String?
|
||||
//)
|
||||
|
||||
class TunnelingHomeItemBean {
|
||||
var createBy: String? = null
|
||||
var createTime: String? = null
|
||||
var updateBy: String? = null
|
||||
var updateTime: String? = null
|
||||
var remark: String? = null
|
||||
var recordId: String? = null
|
||||
var surfaceId: String? = null
|
||||
var workingDate: String? = null
|
||||
var teamShift: String? = null
|
||||
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 waterYield: String? = null
|
||||
var recordPerson: String? = null
|
||||
var mineWorkingLith: String? = null
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增工作面 给接口的数据
|
||||
*/
|
||||
data class TunnelingFaceAddBean(
|
||||
|
||||
val surfaceName: String? = null,
|
||||
val totalFootage: String? = null,
|
||||
|
||||
val areaId: Int? = null,
|
||||
val areaName: String? = null,
|
||||
val createBy: String? = null,
|
||||
val createTime: String? = null,
|
||||
val geologicalType: String? = null,
|
||||
val hydrogeologicalType: String? = null,
|
||||
val params: Params? = null,
|
||||
val planEndDate: String? = null,
|
||||
val planStartDate: String? = null,
|
||||
val remark: String? = null,
|
||||
val seamBumpPressure: String? = null,
|
||||
val seamGas: String? = null,
|
||||
val seamId: Int? = null,
|
||||
val seamIgnition: String? = null,
|
||||
val seamName: String? = null,
|
||||
val surfaceAzimuth: String? = null,
|
||||
val surfaceHeight: String? = null,
|
||||
val surfaceId: Int? = null,
|
||||
val surfaceSupportForm: String? = null,
|
||||
val surfaceWidth: String? = null,
|
||||
val tunnelNature: String? = null,
|
||||
val updateBy: String? = null,
|
||||
val updateTime: String? = null
|
||||
)
|
||||
//
|
||||
//class TunnelingHomeItemBean {
|
||||
// var createBy: String? = null
|
||||
// var createTime: String? = null
|
||||
// var updateBy: String? = null
|
||||
// var updateTime: String? = null
|
||||
// var remark: String? = null
|
||||
// var recordId: String? = null
|
||||
// var surfaceId: String? = null
|
||||
// var workingDate: String? = null
|
||||
// var teamShift: String? = null
|
||||
// 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 waterYield: String? = null
|
||||
// var recordPerson: String? = null
|
||||
// var mineWorkingLith: String? = null
|
||||
//}
|
||||
//
|
||||
///**
|
||||
// * 新增工作面 给接口的数据
|
||||
// */
|
||||
//data class TunnelingFaceAddBean(
|
||||
//
|
||||
// val surfaceName: String? = null,
|
||||
// val totalFootage: String? = null,
|
||||
//
|
||||
// val areaId: Int? = null,
|
||||
// val areaName: String? = null,
|
||||
// val createBy: String? = null,
|
||||
// val createTime: String? = null,
|
||||
// val geologicalType: String? = null,
|
||||
// val hydrogeologicalType: String? = null,
|
||||
// val params: Params? = null,
|
||||
// val planEndDate: String? = null,
|
||||
// val planStartDate: String? = null,
|
||||
// val remark: String? = null,
|
||||
// val seamBumpPressure: String? = null,
|
||||
// val seamGas: String? = null,
|
||||
// val seamId: Int? = null,
|
||||
// val seamIgnition: String? = null,
|
||||
// val seamName: String? = null,
|
||||
// val surfaceAzimuth: String? = null,
|
||||
// val surfaceHeight: String? = null,
|
||||
// val surfaceId: Int? = null,
|
||||
// val surfaceSupportForm: String? = null,
|
||||
// val surfaceWidth: String? = null,
|
||||
// val tunnelNature: String? = null,
|
||||
// val updateBy: String? = null,
|
||||
// val updateTime: String? = null
|
||||
//)
|
||||
|
||||
data class Params(
|
||||
val additionalProp1: String? = null,
|
||||
@@ -98,73 +98,73 @@ data class Params(
|
||||
/**
|
||||
* 工作面详情
|
||||
*/
|
||||
data class FaceWorkDetailBean(
|
||||
val accumulativeFootage: Int,
|
||||
val areaId: Int,
|
||||
val areaName: String,
|
||||
val createBy: String,
|
||||
val createTime: String,
|
||||
val geologicalType: String,
|
||||
val hydrogeologicalType: String,
|
||||
val latestRecord: LatestRecord,
|
||||
val params: Params,
|
||||
val planEndDate: String,
|
||||
val planStartDate: String,
|
||||
val remainingFootage: Int,
|
||||
val remark: String,
|
||||
val seamBumpPressure: String,
|
||||
val seamGas: String,
|
||||
val seamId: Int,
|
||||
val seamIgnition: String,
|
||||
val seamName: String,
|
||||
val surfaceAzimuth: String,
|
||||
val surfaceHeight: String,
|
||||
val surfaceId: Int,
|
||||
val surfaceName: String,
|
||||
val surfaceSupportForm: String,
|
||||
val surfaceWidth: String,
|
||||
val totalFootage: Int,
|
||||
val tunnelNature: String,
|
||||
val updateBy: String,
|
||||
val updateTime: String,
|
||||
val yesterdayFootage: String,
|
||||
val monthFootage: String
|
||||
): Serializable
|
||||
//data class FaceWorkDetailBean(
|
||||
// val accumulativeFootage: Int,
|
||||
// val areaId: Int,
|
||||
// val areaName: String,
|
||||
// val createBy: String,
|
||||
// val createTime: String,
|
||||
// val geologicalType: String,
|
||||
// val hydrogeologicalType: String,
|
||||
// val latestRecord: LatestRecord,
|
||||
// val params: Params,
|
||||
// val planEndDate: String,
|
||||
// val planStartDate: String,
|
||||
// val remainingFootage: Int,
|
||||
// val remark: String,
|
||||
// val seamBumpPressure: String,
|
||||
// val seamGas: String,
|
||||
// val seamId: Int,
|
||||
// val seamIgnition: String,
|
||||
// val seamName: String,
|
||||
// val surfaceAzimuth: String,
|
||||
// val surfaceHeight: String,
|
||||
// val surfaceId: Int,
|
||||
// val surfaceName: String,
|
||||
// val surfaceSupportForm: String,
|
||||
// val surfaceWidth: String,
|
||||
// val totalFootage: Int,
|
||||
// val tunnelNature: String,
|
||||
// val updateBy: String,
|
||||
// val updateTime: String,
|
||||
// val yesterdayFootage: String,
|
||||
// val monthFootage: String
|
||||
//): Serializable
|
||||
|
||||
data class LatestRecord(
|
||||
val createBy: String,
|
||||
val createTime: String,
|
||||
val mineWorkingLithologyList: MutableList<MineWorkingLithology>,
|
||||
val params: Params,
|
||||
val recordId: Int,
|
||||
val recordPerson: String,
|
||||
val remark: String,
|
||||
val seamDip: Int,
|
||||
val seamHeight: Int,
|
||||
val surfaceId: Int,
|
||||
val surfaceName: String,
|
||||
val teamId: Int,
|
||||
val teamLeader: String,
|
||||
val teamName: String,
|
||||
val teamShift: Int,
|
||||
val updateBy: String,
|
||||
val updateTime: String,
|
||||
val waterYield: Int,
|
||||
val workingDate: String,
|
||||
val workingFootage: Int
|
||||
):Serializable
|
||||
//data class LatestRecord(
|
||||
// val createBy: String,
|
||||
// val createTime: String,
|
||||
// val mineWorkingLithologyList: MutableList<MineWorkingLithology>,
|
||||
// val params: Params,
|
||||
// val recordId: Int,
|
||||
// val recordPerson: String,
|
||||
// val remark: String,
|
||||
// val seamDip: Int,
|
||||
// val seamHeight: Int,
|
||||
// val surfaceId: Int,
|
||||
// val surfaceName: String,
|
||||
// val teamId: Int,
|
||||
// val teamLeader: String,
|
||||
// val teamName: String,
|
||||
// val teamShift: Int,
|
||||
// val updateBy: String,
|
||||
// val updateTime: String,
|
||||
// val waterYield: Int,
|
||||
// val workingDate: String,
|
||||
// val workingFootage: Int
|
||||
//):Serializable
|
||||
|
||||
|
||||
data class MineWorkingLithology(
|
||||
val createBy: String,
|
||||
val createTime: String,
|
||||
val lithologyId: Int,
|
||||
val lithologyType: String,
|
||||
val params: Params,
|
||||
val positionEnd: Int,
|
||||
val positionStart: Int,
|
||||
val recordId: Int,
|
||||
val remark: String,
|
||||
val updateBy: String,
|
||||
val updateTime: String
|
||||
):Serializable
|
||||
//
|
||||
//data class MineWorkingLithology(
|
||||
// val createBy: String,
|
||||
// val createTime: String,
|
||||
// val lithologyId: Int,
|
||||
// val lithologyType: String,
|
||||
// val params: Params,
|
||||
// val positionEnd: Int,
|
||||
// val positionStart: Int,
|
||||
// val recordId: Int,
|
||||
// val remark: String,
|
||||
// val updateBy: String,
|
||||
// val updateTime: String
|
||||
//):Serializable
|
||||
@@ -3,7 +3,6 @@ package com.zmkg.coaloperation.data.api
|
||||
import com.zmkg.coaloperation.data.bean.ApiResponse
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelWorkingFaceEntity
|
||||
import com.zmkg.coaloperation.retorfit.UrlConfig
|
||||
import com.zmkg.coaloperation.bean.FaceWorkDetailBean
|
||||
import com.zmkg.coaloperation.ui.home.bean.WaterLedgerBean
|
||||
import okhttp3.RequestBody
|
||||
import retrofit2.http.Body
|
||||
@@ -35,17 +34,17 @@ interface HomeApi {
|
||||
// @GET("/api/mine/tunnelling/surface/record/{recordId}")
|
||||
// suspend fun getTunnelingHomeItemData(@Path("recordId") recordId: String?): ApiResponse<MutableList<TunnelingHomeItemBean>>
|
||||
|
||||
/**
|
||||
* 掘进-工作面详情
|
||||
*/
|
||||
@GET("/api/mine/tunnelling/surface/detail/{surfaceId}")
|
||||
suspend fun getTunnelingSurfaceDetail(@Path("surfaceId") surfaceId: String?): ApiResponse<FaceWorkDetailBean>
|
||||
// /**
|
||||
// * 掘进-工作面详情
|
||||
// */
|
||||
// @GET("/api/mine/tunnelling/surface/detail/{surfaceId}")
|
||||
// suspend fun getTunnelingSurfaceDetail(@Path("surfaceId") surfaceId: String?): ApiResponse<FaceWorkDetailBean>
|
||||
|
||||
/**
|
||||
* 掘进-新增工作面
|
||||
*/
|
||||
@POST("/api/mine/tunnelling/surface/add")
|
||||
suspend fun postTunnellingSurfaceAdd(@Body requestBody: RequestBody): ApiResponse<String>
|
||||
// @POST("/api/mine/tunnelling/surface/add")
|
||||
// suspend fun postTunnellingSurfaceAdd(@Body requestBody: RequestBody): ApiResponse<String>
|
||||
|
||||
@GET("/api/mine/tunnelling/surface/detailList")
|
||||
suspend fun getTunnelHomeList(): ApiResponse<MutableList<TunnelWorkingFaceEntity>?>
|
||||
|
||||
+2
-2
@@ -20,10 +20,10 @@ interface TunnelWorkingFaceDao {
|
||||
@Update
|
||||
fun update(entity: TunnelWorkingFaceEntity)
|
||||
|
||||
@Query("SELECT * FROM tunnel_working_face ORDER BY createTime ASC")
|
||||
@Query("SELECT * FROM tunnel_working_face ORDER BY createTime DESC")
|
||||
fun getEntityList(): MutableList<TunnelWorkingFaceEntity>?
|
||||
|
||||
@Query("SELECT * FROM tunnel_working_face WHERE dataState = :dataState ORDER BY createTime ASC")
|
||||
@Query("SELECT * FROM tunnel_working_face WHERE dataState = :dataState ORDER BY createTime DESC")
|
||||
fun getEntityListByState(dataState: String): MutableList<TunnelWorkingFaceEntity>?
|
||||
|
||||
@Query("SELECT * FROM tunnel_working_face WHERE surfaceId = :surfaceId")
|
||||
|
||||
+3
-3
@@ -21,16 +21,16 @@ interface TunnelWorkingFaceRecordDao {
|
||||
@Update
|
||||
fun update(entity: TunnelWorkingFaceRecordEntity)
|
||||
|
||||
@Query("SELECT * FROM tunnel_working_face_record WHERE surfaceId = :surfaceId ORDER BY createTime ASC")
|
||||
@Query("SELECT * FROM tunnel_working_face_record WHERE surfaceId = :surfaceId ORDER BY createTime DESC")
|
||||
fun getEntityList(surfaceId: Long): MutableList<TunnelWorkingFaceRecordEntity>?
|
||||
|
||||
@Query("SELECT * FROM tunnel_working_face_record WHERE dataState = :dataState ORDER BY createTime ASC")
|
||||
@Query("SELECT * FROM tunnel_working_face_record WHERE dataState = :dataState ORDER BY createTime DESC")
|
||||
fun getEntityListByState(dataState: String): MutableList<TunnelWorkingFaceRecordEntity>?
|
||||
|
||||
@Query("SELECT * FROM tunnel_working_face_record WHERE surfaceId = :recordId")
|
||||
fun getEntityById(recordId: Long): TunnelWorkingFaceRecordEntity
|
||||
|
||||
@Query("SELECT * FROM tunnel_working_face_record WHERE surfaceId = :surfaceId AND latestRecordState = '1' ORDER BY createTime ASC LIMIT 1")
|
||||
@Query("SELECT * FROM tunnel_working_face_record WHERE surfaceId = :surfaceId AND latestRecordState = '1' ORDER BY createTime DESC LIMIT 1")
|
||||
fun getLastEntity(surfaceId: Long): TunnelWorkingFaceRecordEntity?
|
||||
|
||||
@Query("DELETE FROM tunnel_working_face_record")
|
||||
|
||||
+106
-49
@@ -10,17 +10,23 @@ 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.TunnelWorkingItem
|
||||
import com.zmkg.coaloperation.databinding.ActivityAddWorkingFaceRecordBinding
|
||||
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.hideLoading
|
||||
import com.zmkg.coaloperation.superfuntion.showLoading
|
||||
import com.zmkg.coaloperation.superfuntion.toJson
|
||||
import com.zmkg.coaloperation.utils.DateTimeUtil
|
||||
import com.zmkg.coaloperation.utils.DictUtils
|
||||
import com.zmkg.coaloperation.utils.ExcelExportUtils
|
||||
import com.zmkg.coaloperation.utils.FileUtils
|
||||
import com.zmkg.coaloperation.utils.KeyboardUtil
|
||||
import com.zmkg.coaloperation.utils.PickerUtil
|
||||
import com.zmkg.coaloperation.utils.clickWithDebounce
|
||||
import com.zmkg.coaloperation.utils.formatDecimalString
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
@@ -115,13 +121,19 @@ class AddWorkingFaceRecordActivity :
|
||||
|
||||
mBinding.btnSave.clickWithDebounce {
|
||||
if (showType == 0) {
|
||||
judgeInputParam {
|
||||
saveFaceRecord()
|
||||
}
|
||||
return@clickWithDebounce
|
||||
}
|
||||
judgeInputParam {
|
||||
updateFaceRecord()
|
||||
}
|
||||
}
|
||||
mBinding.btnExport.clickWithDebounce {
|
||||
showToast("开发中……")
|
||||
judgeInputParam {
|
||||
exportExcelFile()
|
||||
}
|
||||
}
|
||||
|
||||
mBinding.rvLithology.let {
|
||||
@@ -169,46 +181,6 @@ class AddWorkingFaceRecordActivity :
|
||||
}
|
||||
|
||||
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 = recordId
|
||||
it.surfaceId = surfaceId
|
||||
@@ -218,9 +190,9 @@ class AddWorkingFaceRecordActivity :
|
||||
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.workingFootage = mBinding.etWorkingFootage.text.toString().trim().formatDecimalString()
|
||||
it.seamDip = mBinding.etSeamDip.text.toString().trim().formatDecimalString()
|
||||
it.seamHeight = mBinding.etSeamHeight.text.toString().trim().formatDecimalString()
|
||||
it.recordPerson = mBinding.etRecordPerson.text.toString().trim()
|
||||
|
||||
it.createTime = DateTimeUtil.formatDateTime(LocalDateTime.now())
|
||||
@@ -230,8 +202,8 @@ class AddWorkingFaceRecordActivity :
|
||||
Log.d(TAG, "saveFaceRecord: ${roofLithologyList.toJson()}")
|
||||
|
||||
workingFaceRecordViewModel.insert(faceRecord) {
|
||||
EventBus.getDefault().post(faceRecord)
|
||||
roofLithologyViewModel.insertList(roofLithologyList) {
|
||||
EventBus.getDefault().post(faceRecord)
|
||||
finish()
|
||||
}
|
||||
}
|
||||
@@ -263,18 +235,18 @@ class AddWorkingFaceRecordActivity :
|
||||
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.workingFootage = mBinding.etWorkingFootage.text.toString().trim().formatDecimalString()
|
||||
it.seamDip = mBinding.etSeamDip.text.toString().trim().formatDecimalString()
|
||||
it.seamHeight = mBinding.etSeamHeight.text.toString().trim().formatDecimalString()
|
||||
it.recordPerson = mBinding.etRecordPerson.text.toString().trim()
|
||||
|
||||
it.createTime = DateTimeUtil.formatDateTime(LocalDateTime.now())
|
||||
it.dataState = "1"
|
||||
}
|
||||
workingFaceRecordViewModel.update(faceRecord) {
|
||||
EventBus.getDefault().post(faceRecord)
|
||||
roofLithologyViewModel.deleteList(recordId) {
|
||||
roofLithologyViewModel.insertList(roofLithologyList) {
|
||||
EventBus.getDefault().post(faceRecord)
|
||||
finish()
|
||||
}
|
||||
}
|
||||
@@ -286,4 +258,89 @@ class AddWorkingFaceRecordActivity :
|
||||
|
||||
}
|
||||
|
||||
private fun judgeInputParam(acton:()-> Unit) {
|
||||
list.clear()
|
||||
list.add(TunnelWorkingItem(name = "工作面名称", value = faceName))
|
||||
|
||||
val workingDate = mBinding.tvWorkingDate.text.toString().trim()
|
||||
if (workingDate.isBlank()) {
|
||||
showToast("请选择施工日期")
|
||||
return
|
||||
}
|
||||
list.add(TunnelWorkingItem(name = "施工日期", value = workingDate))
|
||||
|
||||
val teamShift = mBinding.tvTeamShift.text.toString().trim()
|
||||
if (teamShift.isBlank()) {
|
||||
showToast("请选择施工班次")
|
||||
return
|
||||
}
|
||||
list.add(TunnelWorkingItem(name = "施工班次", value = teamShift))
|
||||
|
||||
val workTeam = mBinding.tvWorkTeam.text.toString().trim()
|
||||
if (workTeam.isBlank()) {
|
||||
showToast("请选择施工队伍")
|
||||
return
|
||||
}
|
||||
list.add(TunnelWorkingItem(name = "施工队伍", value = workTeam))
|
||||
|
||||
val teamLeader = mBinding.etTeamLeader.text.toString().trim()
|
||||
if (teamLeader.isBlank()) {
|
||||
showToast("请输入带班队长")
|
||||
return
|
||||
}
|
||||
list.add(TunnelWorkingItem(name = "带班队长", value = teamLeader))
|
||||
|
||||
val workingFootage = mBinding.etWorkingFootage.text.toString().trim().formatDecimalString()
|
||||
if (workingFootage.isBlank()) {
|
||||
showToast("请输入本班进尺")
|
||||
return
|
||||
}
|
||||
list.add(TunnelWorkingItem(name = "本班进尺", value = workingFootage))
|
||||
|
||||
val seamDip = mBinding.etSeamDip.text.toString().trim().formatDecimalString()
|
||||
if (seamDip.isBlank()) {
|
||||
showToast("请输入煤层倾角")
|
||||
return
|
||||
}
|
||||
list.add(TunnelWorkingItem(name = "煤层倾角", value = seamDip))
|
||||
|
||||
val seamHeight = mBinding.etSeamHeight.text.toString().trim().formatDecimalString()
|
||||
if (seamHeight.isBlank()) {
|
||||
showToast("请输入煤层高")
|
||||
return
|
||||
}
|
||||
list.add(TunnelWorkingItem(name = "煤层高", value = seamHeight))
|
||||
|
||||
val recordPerson = mBinding.etRecordPerson.text.toString().trim()
|
||||
if (recordPerson.isBlank()) {
|
||||
showToast("请输入填写人")
|
||||
return
|
||||
}
|
||||
list.add(TunnelWorkingItem(name = "记录人", value = recordPerson))
|
||||
|
||||
val emptyDataList = roofLithologyList.filter {
|
||||
it.positionStart.isBlank() || it.positionEnd.isBlank() || it.lithologyType.isBlank()
|
||||
}
|
||||
if (emptyDataList.isNotEmpty()) {
|
||||
showToast("顶板岩性中存在部分编录点数据为空")
|
||||
return
|
||||
}
|
||||
list.add(TunnelWorkingItem(name = "顶板岩性", value = "", items = roofLithologyList))
|
||||
|
||||
acton()
|
||||
}
|
||||
|
||||
private val list: MutableList<TunnelWorkingItem> = mutableListOf()
|
||||
private fun exportExcelFile() {
|
||||
showLoading()
|
||||
val fileName = "${faceName}_${mBinding.tvWorkingDate.text}_${System.currentTimeMillis()}.xlsx"
|
||||
val filePath = FileUtils.getFilePath(fileName)
|
||||
ExcelExportUtils.exportToExcel(list, filePath) {
|
||||
window.decorView.postDelayed({
|
||||
hideLoading()
|
||||
showToast("Excel导出完成")
|
||||
}, 1500)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+6
-3
@@ -143,8 +143,8 @@ class TunnelingActivity :
|
||||
val index = workingFaceList.indexOfFirst { it.surfaceId == event.surfaceId }
|
||||
if (index == -1) {
|
||||
//新增工作面
|
||||
val insertIndex = workingFaceList.size
|
||||
workingFaceList.add(event)
|
||||
val insertIndex = 0
|
||||
workingFaceList.add(0,event)
|
||||
workingFaceAdapter.notifyItemInserted(insertIndex)
|
||||
workingFaceAdapter.notifyItemRangeChanged(insertIndex, insertIndex+1)
|
||||
return
|
||||
@@ -166,15 +166,18 @@ class TunnelingActivity :
|
||||
faceEntity.records?.let { records ->
|
||||
val index = records.indexOfFirst { it.recordId == event.recordId }
|
||||
if (index == -1) {
|
||||
records.add(event)
|
||||
records.add(0,event)
|
||||
} else {
|
||||
records[index] = event
|
||||
}
|
||||
}
|
||||
val recordAdapter = getRecordAdapter(position)
|
||||
recordAdapter.notifyDataSetChanged()
|
||||
|
||||
workingFaceAdapter.notifyItemChanged(position)
|
||||
}
|
||||
|
||||
@SuppressLint("SuspiciousIndentation")
|
||||
private fun getRecordAdapter(position:Int):TunnelWorkingFaceRecordAdapter {
|
||||
val viewHolder =
|
||||
mBinding.rvList.findViewHolderForLayoutPosition(position) as TunnelWorkingFaceAdapter.VH
|
||||
|
||||
+10
-7
@@ -15,6 +15,7 @@ import com.zmkg.coaloperation.databinding.ActivityWorkingFaceRecordBinding
|
||||
import com.zmkg.coaloperation.db.entiry.tunnel.TunnelWorkingFaceRecordEntity
|
||||
import com.zmkg.coaloperation.db.viewmodel.TunnelRoofLithologyViewModel
|
||||
import com.zmkg.coaloperation.utils.DictUtils
|
||||
import com.zmkg.coaloperation.utils.formatDecimalString
|
||||
import com.zmkg.coaloperation.utils.toJsonString
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
@@ -65,10 +66,6 @@ class WorkingFaceRecordActivity :
|
||||
Log.d(TAG, "loadFaceRecord: ${faceRecord.toJsonString()}")
|
||||
faceRecord?.let {
|
||||
loadFaceRecord(it)
|
||||
roofLithologyViewModel.getEntityList(it.recordId) { lithologyEntities ->
|
||||
list[6].items = lithologyEntities
|
||||
adapter.notifyItemChanged(6)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,17 +83,23 @@ class WorkingFaceRecordActivity :
|
||||
)
|
||||
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))
|
||||
list.add(TunnelWorkingItem(pageType = 1, name = "本班进尺", value = "${it.workingFootage?.formatDecimalString()}m"))
|
||||
|
||||
// val rockList = mutableListOf<TunnelRoofLithologyEntity>()
|
||||
// rockList.add(RockItem(startLen = 0, endLen = 1, rockType = "泥"))
|
||||
// rockList.add(RockItem(startLen = 0, endLen = 1, rockType = "砂"))
|
||||
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.seamDip?.formatDecimalString()}°"))
|
||||
list.add(TunnelWorkingItem(pageType = 1, name = "煤层高", value = "${it.seamHeight?.formatDecimalString()}m"))
|
||||
list.add(TunnelWorkingItem(pageType = 1, name = "记录人", value = it.recordPerson))
|
||||
|
||||
adapter.notifyDataSetChanged()
|
||||
|
||||
|
||||
roofLithologyViewModel.getEntityList(it.recordId) { lithologyEntities ->
|
||||
list[6].items = lithologyEntities
|
||||
adapter.notifyItemChanged(6)
|
||||
}
|
||||
}
|
||||
|
||||
override fun bindEvent() {
|
||||
|
||||
+4
-5
@@ -12,7 +12,6 @@ import com.zmkg.coaloperation.db.viewmodel.TunnelRoofLithologyViewModel
|
||||
import com.zmkg.coaloperation.db.viewmodel.TunnelWorkingFaceRecordViewModel
|
||||
import com.zmkg.coaloperation.adapter.TunnelingRockNatureAdapter
|
||||
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
|
||||
@@ -91,7 +90,7 @@ class WorkingFaceStatisticsActivity :
|
||||
workingFaceRecordViewModel.getLastEntity(detail.surfaceId) { record ->
|
||||
record?.let {
|
||||
mBinding.tvYesterdayLen.text = "${it.workingFootage?.formatDecimalString()}m"
|
||||
mBinding.tvWorkingFaceAngle.text = "${it.seamDip?.formatDecimalString()}"
|
||||
mBinding.tvWorkingFaceAngle.text = "${it.seamDip?.formatDecimalString()}°"
|
||||
// mBinding.tvMonthAccumulateLen.text = "${it.monthFootage}m"
|
||||
mBinding.tvWorkingFaceWater.text = "${it.waterYield?.formatDecimalString()}"
|
||||
|
||||
@@ -134,9 +133,9 @@ class WorkingFaceStatisticsActivity :
|
||||
// }
|
||||
}
|
||||
|
||||
private fun setDataView(bean: FaceWorkDetailBean?) {
|
||||
bean ?: return
|
||||
}
|
||||
// private fun setDataView(bean: FaceWorkDetailBean?) {
|
||||
// bean ?: return
|
||||
// }
|
||||
|
||||
private fun stringToDouble(numText: String?): Double {
|
||||
if (numText.isNullOrEmpty() || numText.isBlank()) return 0.toDouble()
|
||||
|
||||
+62
-9
@@ -9,6 +9,7 @@ import androidx.lifecycle.lifecycleScope
|
||||
import androidx.lifecycle.repeatOnLifecycle
|
||||
import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.base.BaseVMBFragment
|
||||
import com.zmkg.coaloperation.bean.TunnelSubmitData
|
||||
import com.zmkg.coaloperation.databinding.FragmentUserBinding
|
||||
import com.zmkg.coaloperation.db.viewmodel.TunnelRoofLithologyViewModel
|
||||
import com.zmkg.coaloperation.db.viewmodel.TunnelWorkingFaceRecordViewModel
|
||||
@@ -64,12 +65,37 @@ class UserFragment :
|
||||
|
||||
override fun initView(root: View?, savedInstanceState: Bundle?) {
|
||||
mBinding.apply {
|
||||
networkConfig.setOrderStateInfo("网络配置", R.mipmap.network)
|
||||
dataPull.setOrderStateInfo("数据拉取", R.drawable.ic_data_pull)
|
||||
cacheManage.setOrderStateInfo("缓存管理", R.mipmap.buffer)
|
||||
checkUpdate.setOrderStateInfo("检查更新", R.mipmap.checkupdate)
|
||||
systemExit.setOrderStateInfo("系统退出", R.mipmap.systemexit)
|
||||
aboutUs.setOrderStateInfo("关于我们", R.mipmap.about_us)
|
||||
networkConfig.setOrderStateInfo(
|
||||
"网络配置",
|
||||
R.mipmap.network,
|
||||
R.drawable.bg_icon_network_config
|
||||
)
|
||||
dataPull.setOrderStateInfo(
|
||||
"数据拉取",
|
||||
R.drawable.ic_data_pull,
|
||||
R.drawable.bg_icon_data_pull
|
||||
)
|
||||
dataPush.setOrderStateInfo(
|
||||
"数据推送",
|
||||
R.drawable.ic_data_push,
|
||||
R.drawable.bg_icon_data_push
|
||||
)
|
||||
cacheManage.setOrderStateInfo(
|
||||
"缓存管理",
|
||||
R.mipmap.buffer,
|
||||
R.drawable.bg_icon_cache_manage
|
||||
)
|
||||
checkUpdate.setOrderStateInfo(
|
||||
"检查更新",
|
||||
R.mipmap.checkupdate,
|
||||
R.drawable.bg_icon_check_update
|
||||
)
|
||||
systemExit.setOrderStateInfo(
|
||||
"系统退出",
|
||||
R.mipmap.systemexit,
|
||||
R.drawable.bg_icon_system_exit
|
||||
)
|
||||
aboutUs.setOrderStateInfo("关于我们", R.mipmap.about_us, R.drawable.bg_icon_about_us)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,6 +104,7 @@ class UserFragment :
|
||||
addClickViews(
|
||||
networkConfig,
|
||||
dataPull,
|
||||
dataPush,
|
||||
cacheManage,
|
||||
checkUpdate,
|
||||
systemExit,
|
||||
@@ -94,13 +121,12 @@ class UserFragment :
|
||||
}
|
||||
|
||||
R.id.data_pull -> {
|
||||
showLoading("加载中")
|
||||
checkDataState { state ->
|
||||
if (state) {
|
||||
showToast("本地存在待提交的数据")
|
||||
return@checkDataState
|
||||
}
|
||||
|
||||
showLoading("加载中")
|
||||
workingFaceViewModel.deleteAll {
|
||||
workingFaceRecordViewModel.deleteAll {
|
||||
roofLithologyViewModel.deleteAll {
|
||||
@@ -115,6 +141,10 @@ class UserFragment :
|
||||
}
|
||||
}
|
||||
|
||||
R.id.data_push -> {
|
||||
dataPush()
|
||||
}
|
||||
|
||||
R.id.cache_manage -> {
|
||||
toActivity(CacheManageActivity::class.java)
|
||||
}
|
||||
@@ -156,7 +186,7 @@ class UserFragment :
|
||||
list.forEach { faceEntity ->
|
||||
faceEntity.records?.let { recordList ->
|
||||
val lastRecordId = faceEntity.latestRecord?.recordId
|
||||
val record = recordList.firstOrNull {it.recordId == lastRecordId}
|
||||
val record = recordList.firstOrNull { it.recordId == lastRecordId }
|
||||
record?.latestRecordState = "1"
|
||||
|
||||
//保存工作面记录数据
|
||||
@@ -207,4 +237,27 @@ class UserFragment :
|
||||
}
|
||||
}
|
||||
|
||||
private fun dataPush() {
|
||||
showLoading()
|
||||
val submitData = TunnelSubmitData()
|
||||
workingFaceViewModel.getEntityListByState("1") { faceList ->
|
||||
submitData.faceList = faceList
|
||||
workingFaceRecordViewModel.getEntityListByState("1") { recordList ->
|
||||
submitData.recordList = recordList
|
||||
roofLithologyViewModel.getEntityListByState("1") { lithologyList ->
|
||||
hideLoading()
|
||||
submitData.lithologyList = lithologyList
|
||||
if (submitData.faceList.isNullOrEmpty() ||
|
||||
submitData.recordList.isNullOrEmpty() ||
|
||||
submitData.lithologyList.isNullOrEmpty()
|
||||
) {
|
||||
showToast("暂无推送数据")
|
||||
return@getEntityListByState
|
||||
}
|
||||
Log.d(TAG, "dataPush: ${submitData.toJsonString()}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import java.util.Date
|
||||
object DateTimeUtil {
|
||||
|
||||
const val YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss"
|
||||
const val YYYY_MM_DD = "yyyy-MM-dd"
|
||||
|
||||
fun formatDateTime(dateTime: LocalDateTime, pattern: String = YYYY_MM_DD_HH_MM_SS): String {
|
||||
val formatter = DateTimeFormatter.ofPattern(pattern)
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.zmkg.coaloperation.utils
|
||||
|
||||
import android.util.Log
|
||||
import com.zmkg.coaloperation.bean.TunnelWorkingItem
|
||||
import org.apache.poi.ss.util.CellRangeAddress
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook
|
||||
import java.io.FileOutputStream
|
||||
|
||||
object ExcelExportUtils {
|
||||
fun exportToExcel(list: List<TunnelWorkingItem>, filePath: String, block:()-> Unit) {
|
||||
val workbook = XSSFWorkbook() // 创建XLSX格式工作簿
|
||||
val sheet = workbook.createSheet("Sheet1")
|
||||
|
||||
// 创建表头
|
||||
val mainHeader = sheet.createRow(0)
|
||||
|
||||
list.forEachIndexed { index, item ->
|
||||
mainHeader.createCell(index).setCellValue(item.name)
|
||||
}
|
||||
|
||||
val subHeader = sheet.createRow(1)
|
||||
for (i in 0 until list.size - 1) {
|
||||
subHeader.createCell(i).setCellValue("")
|
||||
}
|
||||
val subTitleList = mutableListOf("起始值", "结束值", "岩性")
|
||||
subTitleList.forEachIndexed { index, subTitle ->
|
||||
subHeader.createCell(list.size - 1 + index).setCellValue(subTitle)
|
||||
}
|
||||
sheet.addMergedRegion(CellRangeAddress(0, 0, 9, 11))
|
||||
for (i in 0 until list.size - 1) {
|
||||
sheet.addMergedRegion(CellRangeAddress(0, 1, i, i))
|
||||
}
|
||||
var rowNum = 2
|
||||
var row = sheet.createRow(rowNum)
|
||||
for (i in 0 until list.size - 1) {
|
||||
row.createCell(i).setCellValue(list[i].value)
|
||||
}
|
||||
|
||||
list[list.size - 1].items?.let {
|
||||
for (i in 0 until it.size) {
|
||||
if (i > 0) {
|
||||
rowNum++
|
||||
row = sheet.createRow(rowNum)
|
||||
}
|
||||
row.createCell(0 + list.size - 1).setCellValue(it[i].positionStart)
|
||||
row.createCell(1 + list.size - 1).setCellValue(it[i].positionEnd)
|
||||
row.createCell(2 + list.size - 1).setCellValue(it[i].lithologyType)
|
||||
}
|
||||
}
|
||||
|
||||
// 填充数据
|
||||
// data.forEachIndexed { index, item ->
|
||||
// val row = sheet.createRow(index + 1)
|
||||
// row.createCell(0).setCellValue(item.id)
|
||||
// row.createCell(1).setCellValue(item.name)
|
||||
// }
|
||||
|
||||
// 自动调整列宽
|
||||
// for (i in 0 until 9) {
|
||||
// sheet.autoSizeColumn(i)
|
||||
// }
|
||||
|
||||
// 写入文件
|
||||
FileOutputStream(filePath).use { workbook.write(it) }
|
||||
workbook.close()
|
||||
Log.d("ExcelExportUtils", "exportToExcel: $filePath")
|
||||
block()
|
||||
}
|
||||
}
|
||||
|
||||
data class DataBean(val id: Int, val name: String)
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.zmkg.coaloperation.utils
|
||||
|
||||
import android.os.Environment
|
||||
import java.io.File
|
||||
import java.io.FileOutputStream
|
||||
import java.io.IOException
|
||||
|
||||
object FileUtils {
|
||||
|
||||
fun getFilePath(fileName:String): String {
|
||||
val parentPath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS)
|
||||
val path = File(parentPath, "煤矿数采终端")
|
||||
if (!path.exists()) path.mkdirs()
|
||||
val file = File(path, fileName)
|
||||
if (!file.exists()) file.createNewFile()
|
||||
return file.absolutePath
|
||||
}
|
||||
|
||||
fun saveToPublicDirectory(fileName: String, content: String) {
|
||||
val dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS)
|
||||
val appDir = File(dir, "dcmp")
|
||||
if (!appDir.exists()) appDir.mkdirs()
|
||||
|
||||
val file = File(appDir, fileName)
|
||||
try {
|
||||
FileOutputStream(file).use { it.write(content.toByteArray()) }
|
||||
} catch (e: IOException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
// private fun requestStoragePermission() {
|
||||
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
// if (!Environment.isExternalStorageManager()) {
|
||||
// val intent = Intent(Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION)
|
||||
// startActivity(intent)
|
||||
// }
|
||||
// } else {
|
||||
// ActivityCompat.requestPermissions(
|
||||
// this,
|
||||
// arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE),
|
||||
// REQUEST_CODE
|
||||
// )
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
@@ -8,6 +8,8 @@ import android.widget.RelativeLayout
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import com.zmkg.coaloperation.R
|
||||
import com.zmkg.coaloperation.databinding.CustomMyInfoViewBinding
|
||||
import com.zmkg.coaloperation.utils.gone
|
||||
import com.zmkg.coaloperation.utils.visible
|
||||
|
||||
/**
|
||||
* 文本和跳转
|
||||
@@ -21,15 +23,14 @@ class CustomInfoView(context: Context?, attrs: AttributeSet?) : RelativeLayout(c
|
||||
R.layout.custom_my_info_view, this,true)
|
||||
|
||||
|
||||
fun setOrderStateInfo(name:String, id:Int){
|
||||
fun setOrderStateInfo(name:String, imgResId:Int, bgResId: Int){
|
||||
mBinding.apply {
|
||||
if (id==0) {
|
||||
customInfoMenuIcon.visibility=View.GONE
|
||||
}else{
|
||||
customInfoMenuIcon.visibility=View.VISIBLE
|
||||
customInfoMenuIcon.run {
|
||||
if (imgResId == 0) gone() else visible()
|
||||
setImageResource(imgResId)
|
||||
setBackgroundResource(bgResId)
|
||||
}
|
||||
customInfoMenuIcon.setImageResource(id)
|
||||
customInfoMenuName.setText(name)
|
||||
customInfoMenuName.text = name
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 9.4 KiB |
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:endColor="#FF72AFD3"
|
||||
android:startColor="#FF37ECBA"
|
||||
android:type="linear"
|
||||
android:useLevel="true" />
|
||||
<corners
|
||||
android:radius="12dp" />
|
||||
</shape>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:startColor="#ff95fe99"
|
||||
android:endColor="#fff5feb9"
|
||||
android:type="linear"
|
||||
android:useLevel="true" />
|
||||
<corners
|
||||
android:radius="12dp" />
|
||||
</shape>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:endColor="#FFF89273"
|
||||
android:startColor="#FFB223F6"
|
||||
android:type="linear"
|
||||
android:useLevel="true" />
|
||||
<corners
|
||||
android:radius="12dp" />
|
||||
</shape>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:endColor="#ff7657f8"
|
||||
android:startColor="#fff538f6"
|
||||
android:type="linear"
|
||||
android:useLevel="true" />
|
||||
<corners
|
||||
android:radius="12dp" />
|
||||
</shape>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:endColor="#ff1657f8"
|
||||
android:startColor="#fff51856"
|
||||
android:type="linear"
|
||||
android:useLevel="true" />
|
||||
<corners
|
||||
android:radius="12dp" />
|
||||
</shape>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:endColor="#ff73a3f8"
|
||||
android:startColor="#ff0a28f4"
|
||||
android:type="linear"
|
||||
android:useLevel="true" />
|
||||
<corners
|
||||
android:radius="12dp" />
|
||||
</shape>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:endColor="#FF96E6A1"
|
||||
android:startColor="#FFD4FC79"
|
||||
android:type="linear"
|
||||
android:useLevel="true" />
|
||||
<corners
|
||||
android:radius="12dp" />
|
||||
</shape>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="#FB2B85"/>
|
||||
|
||||
<size android:height="5dp" android:width="5dp"/>
|
||||
</shape>
|
||||
@@ -7,49 +7,44 @@
|
||||
|
||||
</data>
|
||||
|
||||
<com.allen.library.shape.ShapeRelativeLayout
|
||||
|
||||
<com.allen.library.shape.ShapeLinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="68dp"
|
||||
android:layout_marginHorizontal="30dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:background="#20222B"
|
||||
app:shapeSolidColor="#20222B"
|
||||
app:shapeCornersRadius="16dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#20222B">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="44dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
android:paddingHorizontal="15dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/custom_info_menu_icon"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:scaleType="fitCenter"/>
|
||||
android:layout_width="44dp"
|
||||
android:layout_height="44dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:padding="11dp"
|
||||
tools:src="@mipmap/network"
|
||||
tools:background="@drawable/bg_icon_network_config"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/custom_info_menu_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
tools:text="菜单"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
android:textSize="16sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/custom_info_iv_right"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="15dp"
|
||||
android:src="@mipmap/arrow_right" />
|
||||
|
||||
</com.allen.library.shape.ShapeRelativeLayout>
|
||||
</com.allen.library.shape.ShapeLinearLayout>
|
||||
</layout>
|
||||
@@ -59,6 +59,10 @@
|
||||
android:layout_below="@+id/title_sec"
|
||||
android:layout_marginHorizontal="5dp"
|
||||
android:layout_marginTop="8dp"
|
||||
tools:itemCount="6"
|
||||
app:spanCount="2"
|
||||
android:overScrollMode="never"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
tools:listitem="@layout/item_home_menu_left_right" />
|
||||
|
||||
<LinearLayout
|
||||
|
||||
@@ -33,54 +33,55 @@
|
||||
android:textSize="24sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvUserPhone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="账号昵称"
|
||||
android:text="158****5678"
|
||||
android:textColor="#6A6F87"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<com.zmkg.coaloperation.view.CustomInfoView
|
||||
android:id="@+id/network_config"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="68dp"
|
||||
android:layout_marginHorizontal="30dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp" />
|
||||
|
||||
<com.zmkg.coaloperation.view.CustomInfoView
|
||||
android:id="@+id/data_pull"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="68dp"
|
||||
android:layout_marginHorizontal="30dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp" />
|
||||
|
||||
<com.zmkg.coaloperation.view.CustomInfoView
|
||||
android:id="@+id/data_push"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp" />
|
||||
|
||||
<com.zmkg.coaloperation.view.CustomInfoView
|
||||
android:id="@+id/cache_manage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="68dp"
|
||||
android:layout_marginHorizontal="30dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp" />
|
||||
|
||||
<com.zmkg.coaloperation.view.CustomInfoView
|
||||
android:id="@+id/check_update"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="68dp"
|
||||
android:layout_marginHorizontal="30dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp" />
|
||||
|
||||
<com.zmkg.coaloperation.view.CustomInfoView
|
||||
android:id="@+id/system_exit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="68dp"
|
||||
android:layout_marginHorizontal="30dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp" />
|
||||
|
||||
<com.zmkg.coaloperation.view.CustomInfoView
|
||||
android:id="@+id/about_us"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="68dp"
|
||||
android:layout_marginHorizontal="30dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp" />
|
||||
|
||||
</com.allen.library.shape.ShapeLinearLayout>
|
||||
@@ -92,7 +93,8 @@
|
||||
android:layout_height="68dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="60dp"
|
||||
android:background="#e3e3e3" />
|
||||
app:srcCompat="@drawable/ic_avatar"/>
|
||||
<!-- android:background="#e3e3e3"-->
|
||||
|
||||
</RelativeLayout>
|
||||
</layout>
|
||||
@@ -7,34 +7,36 @@
|
||||
|
||||
</data>
|
||||
|
||||
<com.allen.library.shape.ShapeRelativeLayout
|
||||
<com.allen.library.shape.ShapeLinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginHorizontal="4dp"
|
||||
android:layout_marginVertical="5dp"
|
||||
android:paddingHorizontal="10dp"
|
||||
app:shapeCornersRadius="6dp"
|
||||
app:shapeStrokeColor="#10514C"
|
||||
app:shapeStrokeWidth="0.5dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
tools:text="防灭火检查" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="13dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:scaleType="fitXY" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
tools:text="防灭火检查" />
|
||||
|
||||
|
||||
</com.allen.library.shape.ShapeRelativeLayout>
|
||||
</com.allen.library.shape.ShapeLinearLayout>
|
||||
</layout>
|
||||
@@ -7,9 +7,11 @@
|
||||
|
||||
</data>
|
||||
|
||||
<com.allen.library.shape.ShapeRelativeLayout
|
||||
<com.allen.library.shape.ShapeLinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_height="85dp"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:layout_marginHorizontal="2dp"
|
||||
android:layout_marginVertical="2dp"
|
||||
app:shapeCornersRadius="6dp"
|
||||
@@ -20,20 +22,19 @@
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="28dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginRight="13dp"
|
||||
android:scaleType="fitXY" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/img"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:textColor="@color/white"
|
||||
android:layout_marginTop="6dp"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:textSize="12sp"
|
||||
tools:text="防灭火检查" />
|
||||
|
||||
|
||||
</com.allen.library.shape.ShapeRelativeLayout>
|
||||
</com.allen.library.shape.ShapeLinearLayout>
|
||||
</layout>
|
||||
@@ -24,7 +24,7 @@
|
||||
android:maxLines="1"
|
||||
android:textCursorDrawable="@drawable/cursor_white"
|
||||
android:minWidth="30dp"
|
||||
android:maxWidth="35dp"
|
||||
android:maxWidth="55dp"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:textColor="@color/white"
|
||||
@@ -47,7 +47,7 @@
|
||||
android:maxLines="1"
|
||||
android:textCursorDrawable="@drawable/cursor_white"
|
||||
android:minWidth="30dp"
|
||||
android:maxWidth="35dp"
|
||||
android:maxWidth="55dp"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:textColor="@color/white"
|
||||
@@ -72,7 +72,7 @@
|
||||
android:maxLines="1"
|
||||
android:textCursorDrawable="@drawable/cursor_white"
|
||||
android:minWidth="30dp"
|
||||
android:maxWidth="35dp"
|
||||
android:maxWidth="55dp"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:textColor="@color/white"
|
||||
|
||||
@@ -26,10 +26,22 @@
|
||||
app:shapeStrokeColor="#FF26FFEB"
|
||||
app:shapeStrokeWidth="0.5dp">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="wrap_content">
|
||||
<ImageView
|
||||
android:id="@+id/ivFlagEdit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_flag_edit"
|
||||
android:visibility="gone"/>
|
||||
</FrameLayout>
|
||||
|
||||
<!-- android:layout_marginStart="20dp"-->
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:background="@drawable/ic_geological" />
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
@@ -68,7 +68,21 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
app:dividerColor="#282C38"
|
||||
android:layout_gravity="bottom"
|
||||
android:visibility="visible"/>
|
||||
|
||||
</LinearLayout>
|
||||
<FrameLayout
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start">
|
||||
<ImageView
|
||||
android:id="@+id/ivFlagEdit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_flag_edit"
|
||||
android:visibility="gone"/>
|
||||
</FrameLayout>
|
||||
|
||||
</FrameLayout>
|
||||
</layout>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<paths xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<external-path name="external_files" path="."/>
|
||||
</paths>
|
||||
Reference in New Issue
Block a user