|
|
@@ -167,6 +167,7 @@ object BusinessManager {
|
|
|
sendLoadingEventMsg(CommonUtils.getStr(R.string.take_out_key_tip))
|
|
|
val dock =
|
|
|
ModBusController.getDockByKeyMac(it.data.bleBean.bleDevice.mac)
|
|
|
+ keyBean.isReady = false
|
|
|
ModBusController.controlKeyBuckle(
|
|
|
true,
|
|
|
keyBean.isLeft,
|
|
|
@@ -349,28 +350,28 @@ object BusinessManager {
|
|
|
DOCK_TYPE_KEY -> {
|
|
|
dockBean.getKeyList().forEach { keyBean ->
|
|
|
if (keyBean.isExist) {
|
|
|
- // 放回钥匙,上锁
|
|
|
- ModBusController.controlKeyBuckle(
|
|
|
- false,
|
|
|
- keyBean.isLeft,
|
|
|
- dockBean.addr
|
|
|
- ) {
|
|
|
- // 放回钥匙,读取rfid
|
|
|
- ModBusController.readKeyRfid(
|
|
|
+ // 放回钥匙,读取rfid
|
|
|
+ ModBusController.readKeyRfid(
|
|
|
+ dockBean.addr,
|
|
|
+ if (keyBean.isLeft) 0 else 1
|
|
|
+ ) { isLeft, res ->
|
|
|
+ if (res.size < 11) {
|
|
|
+ LogUtil.e("Key rfid error")
|
|
|
+ return@readKeyRfid
|
|
|
+ }
|
|
|
+ val rfid = res.copyOfRange(3, 11).toHexStrings(false)
|
|
|
+ .removeLeadingZeros()
|
|
|
+ ModBusController.updateKeyRfid(
|
|
|
dockBean.addr,
|
|
|
- if (keyBean.isLeft) 0 else 1
|
|
|
- ) { isLeft, res ->
|
|
|
- if (res.size < 11) {
|
|
|
- LogUtil.e("Key rfid error")
|
|
|
- return@readKeyRfid
|
|
|
- }
|
|
|
- val rfid = res.copyOfRange(3, 11).toHexStrings(false)
|
|
|
- .removeLeadingZeros()
|
|
|
- ModBusController.updateKeyRfid(
|
|
|
- dockBean.addr,
|
|
|
- keyBean.isLeft,
|
|
|
- rfid
|
|
|
- )
|
|
|
+ keyBean.isLeft,
|
|
|
+ rfid
|
|
|
+ )
|
|
|
+ // 放回钥匙,上锁
|
|
|
+ ModBusController.controlKeyBuckle(
|
|
|
+ false,
|
|
|
+ keyBean.isLeft,
|
|
|
+ dockBean.addr
|
|
|
+ ) {
|
|
|
NetApi.getKeyInfo(rfid) {
|
|
|
if (it != null && !it.macAddress.isNullOrEmpty()) {
|
|
|
ModBusController.updateKeyMac(
|
|
|
@@ -950,11 +951,6 @@ object BusinessManager {
|
|
|
isLock: Boolean, vo: TicketDetailRespVO, lockList: MutableList<String?>?
|
|
|
): String {
|
|
|
LogUtil.i("generateTicketSendJson : $lockList")
|
|
|
- // 用ticketStatus的"待上锁"进行判断
|
|
|
-// var isLock = true
|
|
|
-// vo.ticketStatus?.let {
|
|
|
-// isLock = it.toInt() < Constants.TICKET_STATUS_READY_TO_UNLOCK.toInt()
|
|
|
-// }
|
|
|
val bo = WorkTicketSendBO(
|
|
|
cardNo = SPUtils.getLoginUser(MyApplication.instance!!.applicationContext)?.userCardList?.get(
|
|
|
0
|
|
|
@@ -1615,7 +1611,7 @@ object BusinessManager {
|
|
|
/**
|
|
|
* 根据当前模式进行处理
|
|
|
*/
|
|
|
- private fun handleCurrentMode(currentModeMsg: CurrentModeMsg) {
|
|
|
+ private fun handleCurrentMode(currentModeMsg: CurrentModeMsg) {
|
|
|
when (currentModeMsg.mode) {
|
|
|
// 工作模式
|
|
|
0x01.toByte() -> {
|