|
@@ -147,55 +147,55 @@ class JobProgressPresenter : BasePresenter<IJobProgressView>() {
|
|
|
&& BusinessManager.mDeviceTakeList.none { it.deviceType == DEVICE_TYPE_KEY && it.ticketId == ticketId }
|
|
&& BusinessManager.mDeviceTakeList.none { it.deviceType == DEVICE_TYPE_KEY && it.ticketId == ticketId }
|
|
|
LogUtil.i("needLockCount = $needLockCount , readyLockCount = $readyLockCount, realCount = $realCount, isNeedKey = $isNeedKey")
|
|
LogUtil.i("needLockCount = $needLockCount , readyLockCount = $readyLockCount, realCount = $realCount, isNeedKey = $isNeedKey")
|
|
|
BusinessManager.checkEquipCount(realCount, isNeedKey) { keyPair, lockMap ->
|
|
BusinessManager.checkEquipCount(realCount, isNeedKey) { keyPair, lockMap ->
|
|
|
- if (lockMap.isEmpty()) {
|
|
|
|
|
- Executor.runOnMain {
|
|
|
|
|
- val dialog = TipDialog(mContext!!)
|
|
|
|
|
- dialog.setTip(mContext!!.getString(R.string.lock_is_not_enough_stop_issue_ticket))
|
|
|
|
|
- var state = 0
|
|
|
|
|
- dialog.setConfirmListener {
|
|
|
|
|
- state = 1
|
|
|
|
|
- BusinessManager.sendLoadingEventMsg(null, false)
|
|
|
|
|
- }
|
|
|
|
|
- dialog.setOnCancelListener {
|
|
|
|
|
- state = 2
|
|
|
|
|
- BusinessManager.sendLoadingEventMsg(null, false)
|
|
|
|
|
- }
|
|
|
|
|
- dialog.setOnDismissListener {
|
|
|
|
|
- if (state == 0) {
|
|
|
|
|
|
|
+ if (needLockCount == 0) {
|
|
|
|
|
+ ToastUtils.tip(R.string.all_point_already_locked)
|
|
|
|
|
+ (keyPair?.second?.rfid ?: "VIRTUALKEY").let { keyNfc ->
|
|
|
|
|
+ BusinessManager.handleVirtualKeyGive(ticketId, keyNfc) {
|
|
|
|
|
+ BusinessManager.handleVirtualKeyReturn(ticketId, keyNfc) {
|
|
|
BusinessManager.sendLoadingEventMsg(null, false)
|
|
BusinessManager.sendLoadingEventMsg(null, false)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- dialog.show()
|
|
|
|
|
}
|
|
}
|
|
|
- } else if (keyPair == null) {
|
|
|
|
|
- Executor.runOnMain {
|
|
|
|
|
- val dialog = TipDialog(mContext!!)
|
|
|
|
|
- dialog.setTip(mContext!!.getString(R.string.no_key_available_dialog_tip))
|
|
|
|
|
- var state = 0
|
|
|
|
|
- dialog.setConfirmListener {
|
|
|
|
|
- state = 1
|
|
|
|
|
- handleGiveKey(ticketDetail, null, lockMap)
|
|
|
|
|
- }
|
|
|
|
|
- dialog.setOnCancelListener {
|
|
|
|
|
- state = 2
|
|
|
|
|
- BusinessManager.sendLoadingEventMsg(null, false)
|
|
|
|
|
- }
|
|
|
|
|
- dialog.setOnDismissListener {
|
|
|
|
|
- if (state == 0) {
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (lockMap.isEmpty()) {
|
|
|
|
|
+ Executor.runOnMain {
|
|
|
|
|
+ val dialog = TipDialog(mContext!!)
|
|
|
|
|
+ dialog.setTip(mContext!!.getString(R.string.lock_is_not_enough_stop_issue_ticket))
|
|
|
|
|
+ var state = 0
|
|
|
|
|
+ dialog.setConfirmListener {
|
|
|
|
|
+ state = 1
|
|
|
|
|
+ BusinessManager.sendLoadingEventMsg(null, false)
|
|
|
|
|
+ }
|
|
|
|
|
+ dialog.setOnCancelListener {
|
|
|
|
|
+ state = 2
|
|
|
BusinessManager.sendLoadingEventMsg(null, false)
|
|
BusinessManager.sendLoadingEventMsg(null, false)
|
|
|
}
|
|
}
|
|
|
|
|
+ dialog.setOnDismissListener {
|
|
|
|
|
+ if (state == 0) {
|
|
|
|
|
+ BusinessManager.sendLoadingEventMsg(null, false)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ dialog.show()
|
|
|
}
|
|
}
|
|
|
- dialog.show()
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- if (needLockCount == 0) {
|
|
|
|
|
- ToastUtils.tip(R.string.all_point_already_locked)
|
|
|
|
|
- keyPair.second?.rfid?.let { keyNfc ->
|
|
|
|
|
- BusinessManager.handleVirtualKeyGive(ticketId, keyNfc) {
|
|
|
|
|
- BusinessManager.handleVirtualKeyReturn(ticketId, keyNfc) {
|
|
|
|
|
|
|
+ } else if (keyPair == null) {
|
|
|
|
|
+ Executor.runOnMain {
|
|
|
|
|
+ val dialog = TipDialog(mContext!!)
|
|
|
|
|
+ dialog.setTip(mContext!!.getString(R.string.no_key_available_dialog_tip))
|
|
|
|
|
+ var state = 0
|
|
|
|
|
+ dialog.setConfirmListener {
|
|
|
|
|
+ state = 1
|
|
|
|
|
+ handleGiveKey(ticketDetail, null, lockMap)
|
|
|
|
|
+ }
|
|
|
|
|
+ dialog.setOnCancelListener {
|
|
|
|
|
+ state = 2
|
|
|
|
|
+ BusinessManager.sendLoadingEventMsg(null, false)
|
|
|
|
|
+ }
|
|
|
|
|
+ dialog.setOnDismissListener {
|
|
|
|
|
+ if (state == 0) {
|
|
|
BusinessManager.sendLoadingEventMsg(null, false)
|
|
BusinessManager.sendLoadingEventMsg(null, false)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ dialog.show()
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
handleGiveKey(ticketDetail, keyPair, lockMap)
|
|
handleGiveKey(ticketDetail, keyPair, lockMap)
|