[6.6.0]数据闭环
@@ -0,0 +1,154 @@
|
||||
package com.mogo.eagle.core.function.takeover
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Looper
|
||||
import com.mogo.eagle.core.data.deva.report.TakeOverRecordInfo
|
||||
import com.mogo.eagle.core.function.takeover.db.RecordDb
|
||||
import com.mogo.eagle.core.function.takeover.db.RecordInfo
|
||||
import com.mogo.eagle.core.utilcode.kotlin.lifeCycleScope
|
||||
import com.mogo.eagle.core.utilcode.util.Utils
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
/**
|
||||
* 接管记录数据库操作管理
|
||||
*/
|
||||
object RecordManager {
|
||||
|
||||
private val scope by lazy {
|
||||
Utils.getApp().lifeCycleScope
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入接管记录数据
|
||||
* @param context 上下文
|
||||
* @param takeOverRecordInfo 接管数据实体
|
||||
*/
|
||||
fun insertRecord(context: Context,takeOverRecordInfo: TakeOverRecordInfo){
|
||||
takeOverRecordInfo.let {
|
||||
val recordInfo = RecordInfo(null,it.address,it.faultStartTime,it.level1Id,
|
||||
it.level2Id,it.level3Id,it.lineName,it.reportNote,it.reportStatus)
|
||||
if (Thread.currentThread() == Looper.getMainLooper().thread){
|
||||
scope.launch{
|
||||
withContext(Dispatchers.IO){
|
||||
realInsertRecord(context,recordInfo)
|
||||
}
|
||||
}
|
||||
}else{
|
||||
realInsertRecord(context,recordInfo)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入接管记录数据
|
||||
* @param context 上下文
|
||||
* @param recordInfo 接管数据实体
|
||||
*/
|
||||
private fun realInsertRecord(context: Context,recordInfo: RecordInfo){
|
||||
RecordDb.getDb(context)
|
||||
.recordDao()
|
||||
.insertRecord(recordInfo)
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改接管记录数据
|
||||
* @param context 上下文
|
||||
* @param takeOverRecordInfo 接管数据实体
|
||||
*/
|
||||
fun updateRecord(context: Context,takeOverRecordInfo: TakeOverRecordInfo){
|
||||
takeOverRecordInfo.let{
|
||||
val recordInfo = RecordInfo(null,it.address,it.faultStartTime,it.level1Id,
|
||||
it.level2Id,it.level3Id,it.lineName,it.reportNote,it.reportStatus)
|
||||
if (Thread.currentThread() == Looper.getMainLooper().thread){
|
||||
scope.launch{
|
||||
withContext(Dispatchers.IO){
|
||||
realUpdateRecord(context,recordInfo)
|
||||
}
|
||||
}
|
||||
}else{
|
||||
realUpdateRecord(context,recordInfo)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改接管记录数据
|
||||
* @param context 上下文
|
||||
* @param recordInfo 接管数据实体
|
||||
*/
|
||||
private fun realUpdateRecord(context: Context,recordInfo: RecordInfo){
|
||||
RecordDb.getDb(context)
|
||||
.recordDao()
|
||||
.updateRecord(recordInfo)
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除接管记录
|
||||
* @param context 上下文
|
||||
* @param recordInfo 接管数据实体
|
||||
*/
|
||||
fun deleteRecord(context: Context, takeOverRecordInfo: TakeOverRecordInfo) {
|
||||
takeOverRecordInfo.let{
|
||||
val recordInfo = RecordInfo(null,it.address,it.faultStartTime,it.level1Id,
|
||||
it.level2Id,it.level3Id,it.lineName,it.reportNote,it.reportStatus)
|
||||
if (Thread.currentThread() == Looper.getMainLooper().thread){
|
||||
scope.launch {
|
||||
withContext(Dispatchers.IO) {
|
||||
realDeleteRecord(context, recordInfo)
|
||||
}
|
||||
}
|
||||
}else{
|
||||
realDeleteRecord(context, recordInfo)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除接管记录
|
||||
* @param context 上下文
|
||||
* @param recordInfo 接管数据实体
|
||||
*/
|
||||
private fun realDeleteRecord(context: Context, recordInfo: RecordInfo){
|
||||
RecordDb.getDb(context)
|
||||
.recordDao()
|
||||
.deleteRecord(recordInfo)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取接管记录列表
|
||||
*/
|
||||
suspend fun getAllRecord(context: Context): List<RecordInfo>{
|
||||
return RecordDb.getDb(context)
|
||||
.recordDao()
|
||||
.getAllRecord()
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除所有接管数据
|
||||
* @param context 上下文
|
||||
*/
|
||||
fun deleteAllRecord(context: Context){
|
||||
if (Thread.currentThread() == Looper.getMainLooper().thread){
|
||||
scope.launch {
|
||||
withContext(Dispatchers.IO) {
|
||||
realDeleteAllRecord(context)
|
||||
}
|
||||
}
|
||||
}else{
|
||||
realDeleteAllRecord(context)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除所有接管数据
|
||||
* @param context 上下文
|
||||
*/
|
||||
private fun realDeleteAllRecord(context: Context){
|
||||
RecordDb.getDb(context)
|
||||
.recordDao()
|
||||
.deleteAllRecord()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.mogo.eagle.core.function.takeover
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.deva.report.TakeOverRecordInfo
|
||||
import com.mogo.eagle.core.function.api.datacenter.takeover.ITakeOverProvider
|
||||
|
||||
@Route(path = MogoServicePaths.PATH_TAKE_OVER_PROVIDER)
|
||||
class TakeOverRecordProvider: ITakeOverProvider {
|
||||
|
||||
override val functionName: String
|
||||
get() = "TakeOverRecordProvider"
|
||||
|
||||
override fun init(context: Context?) {
|
||||
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
|
||||
}
|
||||
|
||||
override fun insertRecord(context: Context, takeOverRecordInfo: TakeOverRecordInfo) {
|
||||
RecordManager.insertRecord(context,takeOverRecordInfo)
|
||||
}
|
||||
|
||||
override fun updateRecord(context: Context, takeOverRecordInfo: TakeOverRecordInfo) {
|
||||
RecordManager.updateRecord(context,takeOverRecordInfo)
|
||||
}
|
||||
|
||||
override fun deleteRecord(context: Context, takeOverRecordInfo: TakeOverRecordInfo) {
|
||||
RecordManager.deleteRecord(context,takeOverRecordInfo)
|
||||
}
|
||||
|
||||
override fun deleteAllRecord(context: Context) {
|
||||
RecordManager.deleteAllRecord(context)
|
||||
}
|
||||
|
||||
override suspend fun getAllRecord(context: Context): List<TakeOverRecordInfo> {
|
||||
val list = RecordManager.getAllRecord(context)
|
||||
return if(list.isEmpty()){
|
||||
emptyList()
|
||||
}else{
|
||||
val recordInfoList = mutableListOf<TakeOverRecordInfo>()
|
||||
list.forEach {
|
||||
recordInfoList.add(
|
||||
TakeOverRecordInfo(it.faultStartTime,it.address,it.level1Id,
|
||||
it.level2Id,it.level3Id,it.lineName,it.reportNote,it.reportStatus)
|
||||
)
|
||||
}
|
||||
recordInfoList
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.mogo.eagle.core.function.takeover.db
|
||||
|
||||
import androidx.room.Dao
|
||||
import androidx.room.Delete
|
||||
import androidx.room.Insert
|
||||
import androidx.room.Query
|
||||
import androidx.room.Update
|
||||
|
||||
/**
|
||||
* 接管记录实体类数据库操作
|
||||
*/
|
||||
@Dao
|
||||
interface RecordDao {
|
||||
//插入数据
|
||||
@Insert
|
||||
fun insertRecord(info: RecordInfo)
|
||||
//修改数据
|
||||
@Update
|
||||
fun updateRecord(info: RecordInfo)
|
||||
//删除数据
|
||||
@Delete
|
||||
fun deleteRecord(info: RecordInfo)
|
||||
//查询数据
|
||||
@Query("SELECT * FROM take_over_record")
|
||||
suspend fun getAllRecord(): List<RecordInfo>
|
||||
//清空数据
|
||||
@Query("DELETE FROM take_over_record")
|
||||
fun deleteAllRecord()
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.mogo.eagle.core.function.takeover.db
|
||||
|
||||
import android.content.Context
|
||||
import androidx.room.Database
|
||||
import androidx.room.Room
|
||||
import androidx.room.RoomDatabase
|
||||
|
||||
/**
|
||||
* 接管记录数据库
|
||||
*/
|
||||
@Database(entities = [RecordInfo::class], version = 1, exportSchema = false)
|
||||
abstract class RecordDb: RoomDatabase() {
|
||||
|
||||
abstract fun recordDao(): RecordDao
|
||||
|
||||
companion object {
|
||||
private const val RECORD_DB_NAME = "take_over.db"
|
||||
|
||||
private var db: RecordDb? = null
|
||||
|
||||
@JvmStatic
|
||||
fun getDb(context: Context): RecordDb {
|
||||
if (db == null) {
|
||||
db = Room.databaseBuilder(context.applicationContext, RecordDb::class.java, RECORD_DB_NAME)
|
||||
.fallbackToDestructiveMigration()
|
||||
.build()
|
||||
}
|
||||
return db!!
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.mogo.eagle.core.function.takeover.db
|
||||
|
||||
import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import androidx.room.PrimaryKey
|
||||
|
||||
/**
|
||||
* 接管记录实体类
|
||||
*/
|
||||
@Entity(tableName = "take_over_record")
|
||||
data class RecordInfo(
|
||||
//自增主键
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
var id: Int ?= null,
|
||||
//故障地点
|
||||
@ColumnInfo
|
||||
val address: String,
|
||||
//故障开始时间 yyyy-MM-dd HH:mm:ss
|
||||
@ColumnInfo
|
||||
val faultStartTime: String,
|
||||
//一级分类ID
|
||||
@ColumnInfo
|
||||
var level1Id: Int,
|
||||
//二级分类ID
|
||||
@ColumnInfo
|
||||
var level2Id: Int,
|
||||
//三级分类ID
|
||||
@ColumnInfo
|
||||
var level3Id: Int,
|
||||
//行驶路线
|
||||
@ColumnInfo
|
||||
val lineName: String,
|
||||
//上报描述
|
||||
@ColumnInfo
|
||||
var reportNote: String,
|
||||
//上传状态 false:未上传,可编辑 true:已上传,不可编辑
|
||||
@ColumnInfo
|
||||
var reportStatus: Boolean
|
||||
)
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.zhjt.mogo_core_function_devatools.workorder
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Activity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.record.RecordManager
|
||||
|
||||
/**
|
||||
* 上报类型选择,包括一键上报及上报类型选择:故障类、接管类
|
||||
* 一键上报和类型选择互斥,当点击弹出上报类型选择时,一键上报隐藏
|
||||
*/
|
||||
class ReportTypeWindow constructor(activity: Activity) {
|
||||
|
||||
companion object{
|
||||
const val TAG = "ReportTypeWindow"
|
||||
}
|
||||
|
||||
private var mActivity: Activity = activity
|
||||
private var mWindowParams: WindowManager.LayoutParams? = null
|
||||
private var mWindowManager: WindowManager? = null
|
||||
private lateinit var mFloatLayout: View
|
||||
|
||||
init {
|
||||
initFloatWindow()
|
||||
}
|
||||
|
||||
@SuppressLint("InflateParams")
|
||||
private fun initFloatWindow(){
|
||||
mFloatLayout = LayoutInflater.from(mActivity).inflate(R.layout.view_report_type, null) as View
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,348 @@
|
||||
package com.zhjt.mogo_core_function_devatools.workorder
|
||||
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Activity
|
||||
import android.graphics.PixelFormat
|
||||
import android.os.Bundle
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.util.DisplayMetrics
|
||||
import android.util.Log
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.view.View.OnFocusChangeListener
|
||||
import android.view.WindowManager
|
||||
import android.view.animation.Animation
|
||||
import android.view.animation.ScaleAnimation
|
||||
import android.widget.EditText
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.appcompat.widget.AppCompatEditText
|
||||
import androidx.constraintlayout.widget.Group
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.iflytek.cloud.ErrorCode
|
||||
import com.iflytek.cloud.InitListener
|
||||
import com.iflytek.cloud.RecognizerListener
|
||||
import com.iflytek.cloud.RecognizerResult
|
||||
import com.iflytek.cloud.SpeechError
|
||||
import com.iflytek.cloud.SpeechRecognizer
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||
import com.mogo.eagle.core.utilcode.util.JsonParser
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils.millis2String
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.tts.base.SpeechUtils
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import kotlinx.coroutines.DelicateCoroutinesApi
|
||||
import kotlin.math.absoluteValue
|
||||
|
||||
/**
|
||||
* 接管原因编辑窗口
|
||||
*/
|
||||
class TakeOverReasonWindow constructor(activity: Activity) : View.OnTouchListener{
|
||||
|
||||
companion object{
|
||||
const val TAG = "TakeOverReasonWindow"
|
||||
}
|
||||
|
||||
private var mActivity: Activity = activity
|
||||
private var mWindowParams: WindowManager.LayoutParams? = null
|
||||
private var mWindowManager: WindowManager? = null
|
||||
private lateinit var mFloatLayout: View
|
||||
|
||||
private var mInViewX = 0f
|
||||
private var mInViewY = 0f
|
||||
private var mInScreenX = 0f
|
||||
private var mInScreenY = 0f
|
||||
|
||||
// 语音听写对象
|
||||
private var mIat: SpeechRecognizer? = null
|
||||
// 用HashMap存储听写结果
|
||||
private val mIatResults: HashMap<String, String> = LinkedHashMap()
|
||||
|
||||
var ret = 0 // 函数调用返回值
|
||||
private var audioStatus = false
|
||||
|
||||
private var workOrderOccurrenceTime = System.currentTimeMillis() //故障发生时间
|
||||
|
||||
private var clickListener: ClickListener? = null
|
||||
|
||||
private lateinit var tvTakeOverTitle: TextView
|
||||
private lateinit var tvTakeOverTime: TextView
|
||||
private lateinit var tvFaultType: TextView
|
||||
private lateinit var ivFaultTypeSelect: ImageView
|
||||
private lateinit var tvFaultReason: TextView
|
||||
private lateinit var ivFaultReasonSelect: ImageView
|
||||
private lateinit var ivTimeReduce: ImageView
|
||||
private lateinit var tvOccurrenceTime: TextView
|
||||
private lateinit var ivTimeAdd: ImageView
|
||||
private lateinit var etNoteInput: AppCompatEditText
|
||||
private lateinit var ivNoteAudio: ImageView
|
||||
private lateinit var tvTakeOverReport: TextView
|
||||
private lateinit var tvTakeOverCancel: TextView
|
||||
private lateinit var rvFaultList: RecyclerView
|
||||
private lateinit var tvUploadSuccess: TextView
|
||||
private lateinit var takeOverReasonGroup: Group
|
||||
|
||||
init {
|
||||
initFloatWindow()
|
||||
}
|
||||
|
||||
@SuppressLint("InflateParams")
|
||||
private fun initFloatWindow(){
|
||||
mFloatLayout = LayoutInflater.from(mActivity).inflate(R.layout.view_take_over_reason, null) as View
|
||||
mFloatLayout.setOnTouchListener(this)
|
||||
|
||||
// 初始化识别无UI识别对象
|
||||
// 使用SpeechRecognizer对象,可根据回调消息自定义界面;
|
||||
mIat = SpeechRecognizer.createRecognizer(mActivity, mInitListener)
|
||||
initView()
|
||||
initEvent()
|
||||
mWindowParams = WindowManager.LayoutParams()
|
||||
mWindowManager = mActivity.windowManager
|
||||
mWindowParams?.let {
|
||||
it.format = PixelFormat.RGBA_8888
|
||||
it.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
|
||||
it.gravity = Gravity.START or Gravity.TOP
|
||||
it.width = 844
|
||||
it.height = 991
|
||||
it.alpha = 1.0f
|
||||
}
|
||||
}
|
||||
|
||||
private fun initView(){
|
||||
tvTakeOverTitle = mFloatLayout.findViewById(R.id.tvTakeOverTitle)
|
||||
tvTakeOverTime = mFloatLayout.findViewById(R.id.tvTakeOverTime)
|
||||
tvFaultType = mFloatLayout.findViewById(R.id.tvFaultType)
|
||||
ivFaultTypeSelect = mFloatLayout.findViewById(R.id.ivFaultTypeSelect)
|
||||
tvFaultReason = mFloatLayout.findViewById(R.id.tvFaultReason)
|
||||
ivFaultReasonSelect = mFloatLayout.findViewById(R.id.ivFaultReasonSelect)
|
||||
ivTimeReduce = mFloatLayout.findViewById(R.id.ivTimeReduce)
|
||||
tvOccurrenceTime = mFloatLayout.findViewById(R.id.tvOccurrenceTime)
|
||||
ivTimeAdd = mFloatLayout.findViewById(R.id.ivTimeAdd)
|
||||
etNoteInput = mFloatLayout.findViewById(R.id.etNoteInput)
|
||||
ivNoteAudio = mFloatLayout.findViewById(R.id.ivNoteAudio)
|
||||
tvTakeOverReport = mFloatLayout.findViewById(R.id.tvTakeOverReport)
|
||||
tvTakeOverCancel = mFloatLayout.findViewById(R.id.tvTakeOverCancel)
|
||||
rvFaultList = mFloatLayout.findViewById(R.id.rvFaultList)
|
||||
tvUploadSuccess = mFloatLayout.findViewById(R.id.tvUploadSuccess)
|
||||
takeOverReasonGroup = mFloatLayout.findViewById(R.id.takeOverReasonGroup)
|
||||
}
|
||||
|
||||
@OptIn(DelicateCoroutinesApi::class)
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun initEvent(){
|
||||
//弹窗展示时间
|
||||
tvTakeOverTime.text = mActivity.resources.getString(R.string.take_over_time) +
|
||||
millis2String(System.currentTimeMillis(), TimeUtils.getHourMinSecondFormat())
|
||||
//发生时间
|
||||
tvOccurrenceTime.text = millis2String(workOrderOccurrenceTime, TimeUtils.getHourMinFormat())
|
||||
ivTimeReduce.setOnClickListener {
|
||||
workOrderOccurrenceTime -= 60000
|
||||
tvOccurrenceTime.text = millis2String(workOrderOccurrenceTime, TimeUtils.getHourMinFormat())
|
||||
}
|
||||
ivTimeAdd.setOnClickListener {
|
||||
if(workOrderOccurrenceTime + 60000 > System.currentTimeMillis()){
|
||||
ToastUtils.showShort("发生时间应在当前时间之前")
|
||||
return@setOnClickListener
|
||||
}
|
||||
workOrderOccurrenceTime += 60000
|
||||
tvOccurrenceTime.text = millis2String(workOrderOccurrenceTime, TimeUtils.getHourMinFormat())
|
||||
}
|
||||
//补充描述
|
||||
etNoteInput.onFocusChangeListener = OnFocusChangeListener { v, hasFocus ->
|
||||
val edit = v as EditText
|
||||
if(hasFocus){
|
||||
edit.hint = ""
|
||||
}else{
|
||||
edit.hint = "手动输入"
|
||||
}
|
||||
}
|
||||
etNoteInput.addTextChangedListener(object: TextWatcher{
|
||||
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun afterTextChanged(s: Editable?) {
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
//问题描述录音
|
||||
ivNoteAudio.setOnClickListener {
|
||||
audioStatus = !audioStatus
|
||||
setAudio(audioStatus)
|
||||
}
|
||||
//上报
|
||||
tvTakeOverReport.setOnClickListener{
|
||||
//TODO
|
||||
}
|
||||
//取消
|
||||
tvTakeOverCancel.setOnClickListener {
|
||||
clickListener?.closeWindow()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun setAudio(status: Boolean){
|
||||
if(status){
|
||||
//开始录音
|
||||
mIat?.let {
|
||||
//清空之前的内容
|
||||
mIatResults.clear()
|
||||
SpeechUtils.setParam(it)
|
||||
// 不显示听写对话框
|
||||
ret = it.startListening(mRecognizerListener)
|
||||
if (ret != ErrorCode.SUCCESS) {
|
||||
ToastUtils.showShort("听写失败,错误码:$ret,请点击网址https://www.xfyun.cn/document/error-code查询解决方案")
|
||||
}
|
||||
}
|
||||
//开始录音,展示放大缩小动效
|
||||
val scaleAnimation = ScaleAnimation(
|
||||
1.0f, 0.8f, 1.0f, 0.8f,
|
||||
Animation.RELATIVE_TO_SELF, 0.8f, Animation.RELATIVE_TO_SELF, 0.8f
|
||||
)
|
||||
scaleAnimation.duration = 1000
|
||||
scaleAnimation.repeatCount = -1
|
||||
ivNoteAudio.startAnimation(scaleAnimation)
|
||||
}else{
|
||||
//停止语音听写
|
||||
mIat?.stopListening()
|
||||
//结束动画
|
||||
ivNoteAudio.clearAnimation()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化监听器。
|
||||
*/
|
||||
private val mInitListener = InitListener { code ->
|
||||
if (code != ErrorCode.SUCCESS) {
|
||||
ToastUtils.showShort("讯飞语音听写初始化失败,错误码:$code")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 听写监听器。
|
||||
*/
|
||||
private val mRecognizerListener: RecognizerListener = object : RecognizerListener{
|
||||
override fun onVolumeChanged(p0: Int, p1: ByteArray?) {
|
||||
//showTip("当前正在说话,音量大小 = " + volume + " 返回音频数据 = " + data.length);
|
||||
}
|
||||
|
||||
override fun onBeginOfSpeech() {
|
||||
// 此回调表示:sdk内部录音机已经准备好了,用户可以开始语音输入
|
||||
}
|
||||
|
||||
override fun onEndOfSpeech() {
|
||||
// 此回调表示:检测到了语音的尾端点,已经进入识别过程,不再接受语音输入
|
||||
}
|
||||
|
||||
override fun onResult(results: RecognizerResult?, isLast: Boolean) {
|
||||
results?.let {
|
||||
printResult(it)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError(p0: SpeechError?) {
|
||||
// Tips:
|
||||
// 错误码:10118(您没有说话),可能是录音机权限被禁,需要提示用户打开应用的录音权限。
|
||||
}
|
||||
|
||||
override fun onEvent(p0: Int, p1: Int, p2: Int, p3: Bundle?) {
|
||||
// 以下代码用于获取与云端的会话id,当业务出错时将会话id提供给技术支持人员,可用于查询会话日志,定位出错原因
|
||||
// 若使用本地能力,会话id为null
|
||||
// if (SpeechEvent.EVENT_SESSION_ID == eventType) {
|
||||
// String sid = obj.getString(SpeechEvent.KEY_EVENT_SESSION_ID);
|
||||
// Log.d(TAG, "session id =" + sid);
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示结果
|
||||
*/
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun printResult(results: RecognizerResult) {
|
||||
val text: String = JsonParser.parseIatResult(results.resultString)
|
||||
Log.i(TAG, "语音内容=$text")
|
||||
if(text.isNotEmpty()){
|
||||
if(etNoteInput.text.toString().isEmpty()){
|
||||
etNoteInput.setText(text)
|
||||
etNoteInput.setSelection(text.length)
|
||||
}else{
|
||||
val startStr = etNoteInput.text.toString().substring(0,etNoteInput.selectionStart)
|
||||
val endStr = etNoteInput.text.toString().substring(etNoteInput.selectionEnd,etNoteInput.text.toString().length)
|
||||
etNoteInput.setText(startStr+text+endStr)
|
||||
etNoteInput.setSelection(startStr.length+text.length)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
override fun onTouch(v: View?, motionEvent: MotionEvent?): Boolean {
|
||||
when (motionEvent?.action) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
// 获取相对View的坐标,即以此View左上角为原点
|
||||
mInViewX = motionEvent.x
|
||||
mInViewY = motionEvent.y
|
||||
// 获取相对屏幕的坐标,即以屏幕左上角为原点
|
||||
mInScreenX = motionEvent.rawX
|
||||
mInScreenY = motionEvent.rawY
|
||||
}
|
||||
MotionEvent.ACTION_MOVE -> {
|
||||
// 更新浮动窗口位置参数
|
||||
mInScreenX = motionEvent.rawX
|
||||
mInScreenY = motionEvent.rawY
|
||||
if(((mInScreenX - mInViewX)-mWindowParams!!.x).absoluteValue>150 || ((mInScreenY - mInViewY)-mWindowParams!!.y).absoluteValue>150){
|
||||
return true
|
||||
}
|
||||
mWindowParams!!.x = (mInScreenX - mInViewX).toInt()
|
||||
mWindowParams!!.y = (mInScreenY - mInViewY).toInt()
|
||||
// 手指移动的时候更新小悬浮窗的位置
|
||||
mWindowManager!!.updateViewLayout(mFloatLayout, mWindowParams)
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
fun showFloatWindow() {
|
||||
if (mFloatLayout.parent == null) {
|
||||
val metrics = DisplayMetrics()
|
||||
// 默认固定位置,靠屏幕右边缘的中间
|
||||
mWindowManager!!.defaultDisplay.getMetrics(metrics)
|
||||
mWindowParams!!.x = metrics.widthPixels-890
|
||||
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight()-1140
|
||||
mWindowManager!!.addView(mFloatLayout, mWindowParams)
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun hideFloatWindow() {
|
||||
if (mFloatLayout.parent != null){
|
||||
mWindowManager!!.removeView(mFloatLayout)
|
||||
}
|
||||
CallerDevaToolsListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
fun setClickListener(clickListener: ClickListener) {
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
interface ClickListener {
|
||||
fun closeWindow()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.zhjt.mogo_core_function_devatools.workorder
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.mogo.eagle.core.function.call.takeover.CallerTakeOverManager
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import com.zhjt.mogo_core_function_devatools.workorder.adapter.TakeOverListAdapter
|
||||
import kotlinx.android.synthetic.main.view_take_over_record.view.ivTakeOverRecordClose
|
||||
import kotlinx.android.synthetic.main.view_take_over_record.view.rvTakeOverList
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
/**
|
||||
* 接管信息管理页面
|
||||
*/
|
||||
class TakeOverRecordView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr) {
|
||||
|
||||
companion object {
|
||||
const val TAG = "TakeOverRecordView"
|
||||
}
|
||||
|
||||
private var takeOverListAdapter: TakeOverListAdapter ?= null
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_take_over_record, this, true)
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView(){
|
||||
//关闭窗口
|
||||
ivTakeOverRecordClose.setOnClickListener {
|
||||
|
||||
}
|
||||
takeOverListAdapter = TakeOverListAdapter()
|
||||
val linearLayoutManager = LinearLayoutManager(context)
|
||||
rvTakeOverList.layoutManager = linearLayoutManager
|
||||
rvTakeOverList.adapter = takeOverListAdapter
|
||||
|
||||
GlobalScope.launch(Dispatchers.IO){
|
||||
CallerTakeOverManager.getAllRecord(context)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.zhjt.mogo_core_function_devatools.workorder.adapter
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.CheckBox
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.deva.report.TakeOverRecordInfo
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
|
||||
/**
|
||||
* 接管记录适配器
|
||||
*/
|
||||
class TakeOverListAdapter: RecyclerView.Adapter<TakeOverListAdapter.TakeOverRecordHolder>() {
|
||||
|
||||
private var data:List<TakeOverRecordInfo> ?= null
|
||||
|
||||
fun setData(data: List<TakeOverRecordInfo>){
|
||||
this.data = data
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TakeOverRecordHolder {
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_take_over_record, parent, false)
|
||||
return TakeOverRecordHolder(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: TakeOverRecordHolder, position: Int) {
|
||||
data?.let {
|
||||
val recordEntity = it[position]
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount() = data?.size ?: 0
|
||||
|
||||
class TakeOverRecordHolder(itemView: View) : RecyclerView.ViewHolder(itemView){
|
||||
val cbRecordSelect: CheckBox = itemView.findViewById(R.id.cbRecordSelect)
|
||||
val tvFaultStartTime: TextView = itemView.findViewById(R.id.tvFaultStartTime)
|
||||
val ivRecordStatusLabel: ImageView = itemView.findViewById(R.id.ivRecordStatusLabel)
|
||||
val tvLineName: TextView = itemView.findViewById(R.id.tvLineName)
|
||||
val tvTakeOverReason: TextView = itemView.findViewById(R.id.tvTakeOverReason)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle"
|
||||
android:useLevel="false"
|
||||
>
|
||||
|
||||
<!--内部填充-->
|
||||
<solid android:color="#1AA7B6F0" />
|
||||
|
||||
<stroke
|
||||
android:width="@dimen/dp_1"
|
||||
android:color="#A7B6F0"
|
||||
/>
|
||||
|
||||
<corners android:radius="@dimen/dp_8"/>
|
||||
|
||||
</shape>
|
||||
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 122 KiB |
|
After Width: | Height: | Size: 348 B |
|
After Width: | Height: | Size: 349 B |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:state_checked="false"
|
||||
android:drawable="@drawable/shape_size_check_false" />
|
||||
<item
|
||||
android:state_checked="true"
|
||||
android:drawable="@drawable/shape_size_check_true" />
|
||||
</selector>
|
||||
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="@dimen/dp_801"
|
||||
android:layout_height="@dimen/dp_224"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbRecordSelect"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:button="@drawable/record_radio_button_style"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvFaultStartTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/cbRecordSelect"
|
||||
app:layout_constraintBottom_toBottomOf="@id/cbRecordSelect"
|
||||
app:layout_constraintLeft_toRightOf="@id/cbRecordSelect"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:textSize="@dimen/sp_38"
|
||||
android:textColor="#8E9DD4"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivRecordStatusLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/cbRecordSelect"
|
||||
app:layout_constraintBottom_toBottomOf="@id/cbRecordSelect"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:src="@drawable/icon_record_edit"
|
||||
android:contentDescription="@string/take_over_record_status_label"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLineName"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvFaultStartTime"
|
||||
app:layout_constraintRight_toLeftOf="@id/ivRecordStatusLabel"
|
||||
app:layout_constraintTop_toTopOf="@id/cbRecordSelect"
|
||||
app:layout_constraintBottom_toBottomOf="@id/cbRecordSelect"
|
||||
android:textSize="@dimen/sp_38"
|
||||
android:textColor="#8E9DD4"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTakeOverReason"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvFaultStartTime"
|
||||
app:layout_constraintRight_toRightOf="@id/ivRecordStatusLabel"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvFaultStartTime"
|
||||
android:layout_marginTop="@dimen/dp_27"
|
||||
android:textSize="@dimen/sp_30"
|
||||
android:textColor="#D4D4D4"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="@dimen/dp_457"
|
||||
android:layout_height="@dimen/dp_333"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@drawable/bg_report_type">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvOneClickReportTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:textColor="@color/white"
|
||||
android:layout_marginTop="@dimen/dp_67"
|
||||
android:text="@string/identified_vehicle_malfunction"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivOneClickReport"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:src="@drawable/icon_one_click_report"
|
||||
android:layout_marginTop="@dimen/dp_157"
|
||||
android:contentDescription="@string/one_click_report"
|
||||
/>
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/oneClickGroup"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="tvOneClickReportTitle,ivOneClickReport"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportTypeTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:text="@string/report_type"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tvReportTypeFault"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:text="@string/report_type_fault"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_26"
|
||||
app:drawableTopCompat="@drawable/icon_type_fault"
|
||||
android:drawablePadding="@dimen/dp_12"
|
||||
android:layout_marginLeft="@dimen/dp_81"
|
||||
android:layout_marginTop="@dimen/dp_107"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tvReportTypeTakeOver"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:text="@string/report_type_take_over"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_26"
|
||||
app:drawableTopCompat="@drawable/icon_type_take_over"
|
||||
android:drawablePadding="@dimen/dp_12"
|
||||
android:layout_marginTop="@dimen/dp_107"
|
||||
android:layout_marginRight="@dimen/dp_81"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/viewDivider"
|
||||
android:layout_width="@dimen/dp_1"
|
||||
android:layout_height="@dimen/dp_0"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/tvReportTypeFault"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvReportTypeFault"
|
||||
android:background="@color/white"
|
||||
/>
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/reportTypeGroup"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:constraint_referenced_ids="tvReportTypeTitle,tvReportTypeFault,tvReportTypeTakeOver,viewDivider"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tvReportSuccess"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:text="@string/report_success"
|
||||
android:textSize="@dimen/sp_26"
|
||||
android:textColor="@color/white"
|
||||
app:drawableTopCompat="@drawable/icon_report_success"
|
||||
android:layout_marginTop="@dimen/dp_59"
|
||||
android:drawablePadding="@dimen/dp_22"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,363 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="@dimen/dp_844"
|
||||
android:layout_height="@dimen/dp_991"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@drawable/bg_take_over_reason">
|
||||
|
||||
<View
|
||||
android:id="@+id/viewTitleBg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_102"
|
||||
android:background="@drawable/icon_work_order_title"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTakeOverTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/take_over_reason"
|
||||
android:textSize="@dimen/sp_34"
|
||||
android:textColor="@color/white"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintTop_toTopOf="@id/viewTitleBg"
|
||||
app:layout_constraintBottom_toBottomOf="@id/viewTitleBg"
|
||||
app:layout_constraintStart_toStartOf="@id/viewTitleBg"
|
||||
android:layout_marginStart="@dimen/dp_32"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTakeOverTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/take_over_time"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_30"
|
||||
app:layout_constraintTop_toTopOf="@id/viewTitleBg"
|
||||
app:layout_constraintBottom_toBottomOf="@id/viewTitleBg"
|
||||
app:layout_constraintEnd_toEndOf="@id/viewTitleBg"
|
||||
android:layout_marginEnd="@dimen/dp_30"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/viewFaultTypeLabel"
|
||||
android:layout_width="@dimen/dp_6"
|
||||
android:layout_height="@dimen/dp_29"
|
||||
android:background="#FF0176FF"
|
||||
app:layout_constraintTop_toBottomOf="@id/viewTitleBg"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_32"
|
||||
android:layout_marginTop="@dimen/dp_48"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTypeTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/fault_type"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:textColor="@color/white"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintTop_toTopOf="@id/viewFaultTypeLabel"
|
||||
app:layout_constraintBottom_toBottomOf="@id/viewFaultTypeLabel"
|
||||
app:layout_constraintLeft_toRightOf="@id/viewFaultTypeLabel"
|
||||
android:layout_marginStart="@dimen/dp_14"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/viewFaultType"
|
||||
android:layout_width="@dimen/dp_781"
|
||||
android:layout_height="@dimen/dp_70"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_203"
|
||||
android:background="@drawable/bg_fault_type"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvFaultType"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/viewFaultType"
|
||||
app:layout_constraintBottom_toBottomOf="@id/viewFaultType"
|
||||
app:layout_constraintLeft_toLeftOf="@id/viewFaultType"
|
||||
android:layout_marginLeft="@dimen/dp_21"
|
||||
android:textSize="@dimen/sp_30"
|
||||
android:textColor="@color/white"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivFaultTypeSelect"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/viewFaultType"
|
||||
app:layout_constraintBottom_toBottomOf="@id/viewFaultType"
|
||||
app:layout_constraintRight_toRightOf="@id/viewFaultType"
|
||||
android:src="@drawable/icon_fault_expand"
|
||||
android:layout_marginRight="@dimen/dp_21"
|
||||
android:contentDescription="@string/fault_type_select"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/viewFaultReasonLabel"
|
||||
android:layout_width="@dimen/dp_6"
|
||||
android:layout_height="@dimen/dp_29"
|
||||
android:background="#FF0176FF"
|
||||
app:layout_constraintTop_toBottomOf="@id/viewFaultType"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_32"
|
||||
android:layout_marginTop="@dimen/dp_48"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvFaultReasonTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/fault_reason"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:textColor="@color/white"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintTop_toTopOf="@id/viewFaultReasonLabel"
|
||||
app:layout_constraintBottom_toBottomOf="@id/viewFaultReasonLabel"
|
||||
app:layout_constraintLeft_toRightOf="@id/viewFaultReasonLabel"
|
||||
android:layout_marginStart="@dimen/dp_14"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/viewFaultReason"
|
||||
android:layout_width="@dimen/dp_781"
|
||||
android:layout_height="@dimen/dp_70"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_374"
|
||||
android:background="@drawable/bg_fault_type"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvFaultReason"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/viewFaultReason"
|
||||
app:layout_constraintBottom_toBottomOf="@id/viewFaultReason"
|
||||
app:layout_constraintLeft_toLeftOf="@id/viewFaultReason"
|
||||
android:layout_marginLeft="@dimen/dp_21"
|
||||
android:textSize="@dimen/sp_30"
|
||||
android:textColor="@color/white"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivFaultReasonSelect"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/viewFaultReason"
|
||||
app:layout_constraintBottom_toBottomOf="@id/viewFaultReason"
|
||||
app:layout_constraintRight_toRightOf="@id/viewFaultReason"
|
||||
android:src="@drawable/icon_fault_expand"
|
||||
android:layout_marginRight="@dimen/dp_21"
|
||||
android:contentDescription="@string/fault_type_select"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/viewFaultTimeLabel"
|
||||
android:layout_width="@dimen/dp_6"
|
||||
android:layout_height="@dimen/dp_29"
|
||||
android:background="#FF0176FF"
|
||||
app:layout_constraintTop_toBottomOf="@id/viewFaultReason"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_32"
|
||||
android:layout_marginTop="@dimen/dp_48"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvFaultTimeTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/fault_time"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:textColor="@color/white"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintTop_toTopOf="@id/viewFaultTimeLabel"
|
||||
app:layout_constraintBottom_toBottomOf="@id/viewFaultTimeLabel"
|
||||
app:layout_constraintLeft_toRightOf="@id/viewFaultTimeLabel"
|
||||
android:layout_marginStart="@dimen/dp_14"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivTimeReduce"
|
||||
android:layout_width="@dimen/dp_72"
|
||||
android:layout_height="@dimen/dp_72"
|
||||
android:src="@drawable/icon_work_order_reduce"
|
||||
app:layout_constraintLeft_toLeftOf="@id/viewFaultTimeLabel"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvFaultTimeTitle"
|
||||
android:layout_marginTop="@dimen/dp_17"
|
||||
android:contentDescription="@string/fault_time_reduce"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvOccurrenceTime"
|
||||
android:layout_width="@dimen/dp_150"
|
||||
android:layout_height="@dimen/dp_72"
|
||||
android:textSize="@dimen/sp_30"
|
||||
android:textColor="@color/white"
|
||||
android:gravity="center"
|
||||
android:background="#1AA7B6F0"
|
||||
app:layout_constraintTop_toTopOf="@id/ivTimeReduce"
|
||||
app:layout_constraintBottom_toBottomOf="@id/ivTimeReduce"
|
||||
app:layout_constraintStart_toEndOf="@id/ivTimeReduce"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivTimeAdd"
|
||||
android:layout_width="@dimen/dp_72"
|
||||
android:layout_height="@dimen/dp_72"
|
||||
android:src="@drawable/icon_work_order_add"
|
||||
app:layout_constraintTop_toTopOf="@id/tvOccurrenceTime"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvOccurrenceTime"
|
||||
app:layout_constraintStart_toEndOf="@id/tvOccurrenceTime"
|
||||
android:contentDescription="@string/fault_time_add"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/viewFaultNoteLabel"
|
||||
android:layout_width="@dimen/dp_6"
|
||||
android:layout_height="@dimen/dp_29"
|
||||
android:background="#FF0176FF"
|
||||
app:layout_constraintTop_toBottomOf="@id/ivTimeReduce"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_32"
|
||||
android:layout_marginTop="@dimen/dp_47"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvFaultNoteTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/fault_note"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:textColor="@color/white"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintTop_toTopOf="@id/viewFaultNoteLabel"
|
||||
app:layout_constraintBottom_toBottomOf="@id/viewFaultNoteLabel"
|
||||
app:layout_constraintLeft_toRightOf="@id/viewFaultNoteLabel"
|
||||
android:layout_marginStart="@dimen/dp_14"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvFaultNoteSupplement"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/tvFaultNoteTitle"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvFaultNoteTitle"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvFaultNoteTitle"
|
||||
android:text="@string/fault_note_supplement"
|
||||
android:textSize="@dimen/sp_30"
|
||||
android:textColor="#A3ABC0"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatEditText
|
||||
android:id="@+id/etNoteInput"
|
||||
android:layout_width="@dimen/dp_779"
|
||||
android:layout_height="@dimen/dp_115"
|
||||
app:layout_constraintTop_toBottomOf="@id/viewFaultNoteLabel"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:hint="@string/take_over_note_input"
|
||||
android:textColorHint="#A3ABC0"
|
||||
android:textCursorDrawable="@drawable/work_order_input_cursor"
|
||||
android:textSize="@dimen/sp_30"
|
||||
android:textColor="@color/white"
|
||||
android:gravity="top|start"
|
||||
android:paddingStart="@dimen/dp_28"
|
||||
android:paddingTop="@dimen/dp_21"
|
||||
android:paddingEnd="@dimen/dp_80"
|
||||
android:layout_marginTop="@dimen/dp_25"
|
||||
android:background="@drawable/bg_work_order_des_input"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivNoteAudio"
|
||||
android:layout_width="@dimen/dp_45"
|
||||
android:layout_height="@dimen/dp_59"
|
||||
android:src="@drawable/icon_work_order_audio"
|
||||
app:layout_constraintTop_toTopOf="@id/etNoteInput"
|
||||
app:layout_constraintBottom_toBottomOf="@id/etNoteInput"
|
||||
app:layout_constraintEnd_toEndOf="@id/etNoteInput"
|
||||
android:layout_marginEnd="@dimen/dp_30"
|
||||
android:contentDescription="@string/take_over_note_audio"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTakeOverReport"
|
||||
android:layout_width="@dimen/dp_380"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:background="@drawable/report_button_bg"
|
||||
android:text="@string/take_over_report"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/sp_27"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center"
|
||||
android:layout_marginBottom="@dimen/dp_40"
|
||||
android:layout_marginLeft="@dimen/dp_33"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTakeOverCancel"
|
||||
android:layout_width="@dimen/dp_380"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:text="@string/take_over_cancel"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/sp_27"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/icon_cancel_bg"
|
||||
android:layout_marginBottom="@dimen/dp_40"
|
||||
android:layout_marginRight="@dimen/dp_33"
|
||||
/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvFaultList"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="@dimen/dp_0"
|
||||
app:layout_constraintLeft_toLeftOf="@id/viewFaultType"
|
||||
app:layout_constraintRight_toRightOf="@id/viewFaultType"
|
||||
app:layout_constraintTop_toBottomOf="@id/viewFaultType"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="@dimen/dp_39"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tvUploadSuccess"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_406"
|
||||
app:drawableTopCompat="@drawable/icon_take_over_upload_success"
|
||||
android:text="@string/report_success"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:drawablePadding="@dimen/dp_40"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/takeOverReasonGroup"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:constraint_referenced_ids="viewFaultTypeLabel,tvTypeTitle,viewFaultType,tvFaultType,
|
||||
ivFaultTypeSelect,viewFaultReasonLabel,tvFaultReasonTitle,viewFaultReason,tvFaultReason,
|
||||
ivFaultReasonSelect,viewFaultTimeLabel,tvFaultTimeTitle,ivTimeReduce,tvOccurrenceTime,
|
||||
ivTimeAdd,viewFaultNoteLabel,tvFaultNoteTitle,tvFaultNoteSupplement,etNoteInput,
|
||||
ivNoteAudio,tvTakeOverReport,tvTakeOverCancel,rvFaultList"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="@dimen/dp_960"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="#F0151D41">
|
||||
|
||||
<View
|
||||
android:id="@+id/viewTakeOverRecordLine"
|
||||
android:layout_width="@dimen/dp_14"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:layout_marginStart="@dimen/dp_80"
|
||||
android:layout_marginTop="@dimen/dp_92"
|
||||
android:background="#2966EC"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTakeOverRecordTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/take_over_record"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/sp_42"
|
||||
app:layout_constraintTop_toTopOf="@id/viewTakeOverRecordLine"
|
||||
app:layout_constraintBottom_toBottomOf="@id/viewTakeOverRecordLine"
|
||||
app:layout_constraintLeft_toLeftOf="@id/viewTakeOverRecordLine"
|
||||
android:layout_marginStart="50dp"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivTakeOverRecordClose"
|
||||
android:layout_width="@dimen/dp_107"
|
||||
android:layout_height="@dimen/dp_107"
|
||||
android:layout_marginEnd="@dimen/dp_40"
|
||||
android:src="@drawable/icon_close_nor"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/viewTakeOverRecordLine"
|
||||
app:layout_constraintBottom_toBottomOf="@id/viewTakeOverRecordLine"
|
||||
android:contentDescription="@string/take_over_record_close"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTakeOverRecordDate"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_61"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_223"
|
||||
android:background="#203076"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:textColor="@color/white"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvTakeOverList"
|
||||
android:layout_width="@dimen/dp_801"
|
||||
android:layout_height="@dimen/dp_0"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvTakeOverRecordDate"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvUpload"
|
||||
android:layout_width="@dimen/dp_330"
|
||||
android:layout_height="@dimen/dp_120"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="@dimen/dp_74"
|
||||
android:layout_marginLeft="@dimen/dp_85"
|
||||
android:background="@drawable/upload_cloud_button_bg"
|
||||
android:text="@string/take_over_record_upload"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/sp_42"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDeleteSelect"
|
||||
android:layout_width="@dimen/dp_330"
|
||||
android:layout_height="@dimen/dp_120"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="@dimen/dp_74"
|
||||
android:layout_marginRight="@dimen/dp_85"
|
||||
android:background="@drawable/delete_button_bg"
|
||||
android:text="@string/take_over_record_delete"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/sp_42"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.mogo.eagle.core.data.deva.report
|
||||
|
||||
/**
|
||||
* 接管记录实体类
|
||||
* @param faultStartTime 故障开始时间 yyyy-MM-dd HH:mm:ss
|
||||
* @param address 故障地点
|
||||
* @param level1Id 一级分类ID
|
||||
* @param level2Id 二级分类ID
|
||||
* @param level3Id 三级分类ID
|
||||
* @param lineName 行驶路线
|
||||
* @param reportNote 上报描述
|
||||
* @param reportStatus 上传状态 false:未上传,可编辑 true:已上传,不可编辑
|
||||
*/
|
||||
data class TakeOverRecordInfo(var faultStartTime: String, var address:String,
|
||||
var level1Id: Int, var level2Id: Int, var level3Id: Int,
|
||||
var lineName: String, var reportNote: String, var reportStatus: Boolean)
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.mogo.eagle.core.function.api.datacenter.takeover
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.eagle.core.data.deva.report.TakeOverRecordInfo
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider
|
||||
|
||||
/**
|
||||
* 接管记录数据中心
|
||||
*/
|
||||
interface ITakeOverProvider: IMoGoFunctionServerProvider {
|
||||
|
||||
/**
|
||||
* 插入接管记录数据
|
||||
*/
|
||||
fun insertRecord(context: Context, takeOverRecordInfo: TakeOverRecordInfo)
|
||||
|
||||
/**
|
||||
* 修改接管记录数据
|
||||
*/
|
||||
fun updateRecord(context: Context,takeOverRecordInfo: TakeOverRecordInfo)
|
||||
|
||||
/**
|
||||
* 删除接管记录
|
||||
*/
|
||||
fun deleteRecord(context: Context, takeOverRecordInfo: TakeOverRecordInfo)
|
||||
|
||||
/**
|
||||
* 删除所有接管数据
|
||||
*/
|
||||
fun deleteAllRecord(context: Context)
|
||||
|
||||
/**
|
||||
* 获取接管记录列表
|
||||
*/
|
||||
suspend fun getAllRecord(context: Context): List<TakeOverRecordInfo>
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.mogo.eagle.core.function.call.takeover
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.deva.report.TakeOverRecordInfo
|
||||
import com.mogo.eagle.core.function.api.datacenter.takeover.ITakeOverProvider
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
|
||||
/**
|
||||
* 接管记录管理
|
||||
*/
|
||||
object CallerTakeOverManager {
|
||||
|
||||
private val providerApi: ITakeOverProvider
|
||||
get() = CallerBase.getApiInstance(
|
||||
ITakeOverProvider::class.java,
|
||||
MogoServicePaths.PATH_TAKE_OVER_PROVIDER
|
||||
)
|
||||
|
||||
/**
|
||||
* 插入接管记录数据
|
||||
*/
|
||||
fun insertRecord(context: Context, takeOverRecordInfo: TakeOverRecordInfo){
|
||||
providerApi.insertRecord(context, takeOverRecordInfo)
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改接管记录数据
|
||||
*/
|
||||
fun updateRecord(context: Context,takeOverRecordInfo: TakeOverRecordInfo){
|
||||
providerApi.updateRecord(context, takeOverRecordInfo)
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除接管记录
|
||||
*/
|
||||
fun deleteRecord(context: Context, takeOverRecordInfo: TakeOverRecordInfo){
|
||||
providerApi.deleteRecord(context, takeOverRecordInfo)
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除所有接管数据
|
||||
*/
|
||||
fun deleteAllRecord(context: Context){
|
||||
providerApi.deleteAllRecord(context)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取接管记录列表
|
||||
*/
|
||||
suspend fun getAllRecord(context: Context): List<TakeOverRecordInfo>{
|
||||
return providerApi.getAllRecord(context)
|
||||
}
|
||||
|
||||
}
|
||||