增加人脸采集功能;
识别人脸成功后打开有餐盘的第一个柜子; 扫码打开已绑定的柜子,无则打开第一个空柜子并放入餐盘; 设置页面问题优化;
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
package com.sw.platecabinet.utils
|
||||
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import com.sw.plate.utils.ToastUtils
|
||||
import com.sw.plate.utils.comn.SerialApi
|
||||
import com.sw.plate.utils.comn.SerialPortManager
|
||||
import com.sw.platecabinet.activity.BaseActivity
|
||||
import com.sw.platecabinet.activity.MainActivity
|
||||
import com.sw.platecabinet.activity.PageType
|
||||
import timber.log.Timber
|
||||
|
||||
object PlateUtils {
|
||||
|
||||
fun open(fragmentActivity: FragmentActivity, code: String?) {
|
||||
val activity = fragmentActivity as BaseActivity<*>
|
||||
Timber.d("itemClick llOpen equipmentBoxCode = ${code}")
|
||||
val equipmentBoxCode: Int = code?.toInt() ?: -1
|
||||
if (equipmentBoxCode < 0) {
|
||||
ToastUtils.showToast("餐盘柜编号错误")
|
||||
return
|
||||
}
|
||||
activity.showWaitingDialog("请稍等")
|
||||
SerialApi.openPlate(equipmentBoxCode, object : SerialPortManager.SendCallback {
|
||||
override fun onSuccess() {
|
||||
activity.hideWaitingDialog()
|
||||
MainActivity.start(
|
||||
activity,
|
||||
pageType = PageType.PLATE_TIP,
|
||||
isAdmin = true
|
||||
)
|
||||
}
|
||||
|
||||
override fun onFail(e: Exception?) {
|
||||
activity.hideWaitingDialog()
|
||||
ToastUtils.showToast("柜门打开失败")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user