|
|
@@ -33,8 +33,7 @@ import com.grkj.iscs.model.DeviceConst.DOCK_TYPE_ELEC_LOCK_BOARD
|
|
|
import com.grkj.iscs.model.DeviceConst.DOCK_TYPE_KEY
|
|
|
import com.grkj.iscs.model.DeviceConst.DOCK_TYPE_LOCK
|
|
|
import com.grkj.iscs.model.DeviceConst.DOCK_TYPE_PORTABLE
|
|
|
-import com.grkj.iscs.model.DictConstants
|
|
|
-import com.grkj.iscs.model.ISCSDomainData
|
|
|
+import com.grkj.iscs.model.DictAndSystemConstants
|
|
|
import com.grkj.iscs.model.bo.DeviceTakeUpdateBO
|
|
|
import com.grkj.iscs.model.bo.UpdateKeyReturnBO
|
|
|
import com.grkj.iscs.model.bo.WorkTicketGetBO
|
|
|
@@ -79,7 +78,6 @@ import kotlinx.coroutines.Dispatchers
|
|
|
import kotlinx.coroutines.async
|
|
|
import kotlinx.coroutines.suspendCancellableCoroutine
|
|
|
import kotlinx.coroutines.withContext
|
|
|
-import org.slf4j.LoggerFactory
|
|
|
import kotlin.coroutines.resume
|
|
|
|
|
|
/**
|
|
|
@@ -214,7 +212,7 @@ object BusinessManager {
|
|
|
|
|
|
MSG_EVENT_SWITCH_COLLECTION_UPDATE -> {
|
|
|
ThreadUtils.runOnIO {
|
|
|
- val switchStatus = NetApi.getDictData(DictConstants.KEY_SWITCH_STATUS)
|
|
|
+ val switchStatus = NetApi.getDictData(DictAndSystemConstants.KEY_SWITCH_STATUS)
|
|
|
val switchListReqVOS = ModBusController.getSwitchData().map {
|
|
|
SwitchListReqVO(
|
|
|
it.idx.toString(),
|
|
|
@@ -241,9 +239,9 @@ object BusinessManager {
|
|
|
|
|
|
// —— 并行加载字典(或按需串行也行) ——
|
|
|
val slotStatus =
|
|
|
- async { fetchDict<CommonDictRespVO>(DictConstants.KEY_SLOT_STATUS) }
|
|
|
- val keyStatus = async { fetchDict<CommonDictRespVO>(DictConstants.KEY_KEY_STATUS) }
|
|
|
- val slotType = async { fetchDict<CommonDictRespVO>(DictConstants.KEY_SLOT_TYPE) }
|
|
|
+ async { fetchDict<CommonDictRespVO>(DictAndSystemConstants.KEY_SLOT_STATUS) }
|
|
|
+ val keyStatus = async { fetchDict<CommonDictRespVO>(DictAndSystemConstants.KEY_KEY_STATUS) }
|
|
|
+ val slotType = async { fetchDict<CommonDictRespVO>(DictAndSystemConstants.KEY_SLOT_TYPE) }
|
|
|
|
|
|
// 等待字典加载完成
|
|
|
val slotStatusList = slotStatus.await()
|
|
|
@@ -366,13 +364,13 @@ object BusinessManager {
|
|
|
.removeLeadingZeros()
|
|
|
ThreadUtils.runOnIO {
|
|
|
val slotStatus =
|
|
|
- async { fetchDict<CommonDictRespVO>(DictConstants.KEY_SLOT_STATUS) }
|
|
|
+ async { fetchDict<CommonDictRespVO>(DictAndSystemConstants.KEY_SLOT_STATUS) }
|
|
|
val slotType =
|
|
|
- async { fetchDict<CommonDictRespVO>(DictConstants.KEY_SLOT_TYPE) }
|
|
|
+ async { fetchDict<CommonDictRespVO>(DictAndSystemConstants.KEY_SLOT_TYPE) }
|
|
|
val slotsPageReq =
|
|
|
async { getSlotsPage() }
|
|
|
val keyStatusReq =
|
|
|
- async { fetchDict<CommonDictRespVO>(DictConstants.KEY_KEY_STATUS) }
|
|
|
+ async { fetchDict<CommonDictRespVO>(DictAndSystemConstants.KEY_KEY_STATUS) }
|
|
|
val keyPageReq =
|
|
|
async { getKeyPage() }
|
|
|
var keyStatus = keyStatusReq.await()
|
|
|
@@ -467,11 +465,11 @@ object BusinessManager {
|
|
|
)
|
|
|
ThreadUtils.runOnIO {
|
|
|
val lockStatusReq =
|
|
|
- async { fetchDict<CommonDictRespVO>(DictConstants.KEY_PAD_LOCK_STATUS) }
|
|
|
+ async { fetchDict<CommonDictRespVO>(DictAndSystemConstants.KEY_PAD_LOCK_STATUS) }
|
|
|
val slotStatus =
|
|
|
- async { fetchDict<CommonDictRespVO>(DictConstants.KEY_SLOT_STATUS) }
|
|
|
+ async { fetchDict<CommonDictRespVO>(DictAndSystemConstants.KEY_SLOT_STATUS) }
|
|
|
val slotType =
|
|
|
- async { fetchDict<CommonDictRespVO>(DictConstants.KEY_SLOT_TYPE) }
|
|
|
+ async { fetchDict<CommonDictRespVO>(DictAndSystemConstants.KEY_SLOT_TYPE) }
|
|
|
val slotsPageReq =
|
|
|
async { getSlotsPage() }
|
|
|
var lockStatus = lockStatusReq.await()
|
|
|
@@ -593,7 +591,7 @@ object BusinessManager {
|
|
|
)
|
|
|
ThreadUtils.runOnIO {
|
|
|
val lockStatusReq =
|
|
|
- async { fetchDict<CommonDictRespVO>(DictConstants.KEY_PAD_LOCK_STATUS) }
|
|
|
+ async { fetchDict<CommonDictRespVO>(DictAndSystemConstants.KEY_PAD_LOCK_STATUS) }
|
|
|
var lockStatus = lockStatusReq.await()
|
|
|
NetApi.getIsLockPage { lockData ->
|
|
|
//锁rfid未异常正常请求锁数据,关锁
|
|
|
@@ -789,11 +787,11 @@ object BusinessManager {
|
|
|
|
|
|
// —— 并行加载字典(或按需串行也行) ——
|
|
|
val lockStatus =
|
|
|
- async { fetchDict<CommonDictRespVO>(DictConstants.KEY_PAD_LOCK_STATUS) }
|
|
|
+ async { fetchDict<CommonDictRespVO>(DictAndSystemConstants.KEY_PAD_LOCK_STATUS) }
|
|
|
val slotStatus =
|
|
|
- async { fetchDict<CommonDictRespVO>(DictConstants.KEY_SLOT_STATUS) }
|
|
|
- val slotType = async { fetchDict<CommonDictRespVO>(DictConstants.KEY_SLOT_TYPE) }
|
|
|
- val keyStatus = async { fetchDict<CommonDictRespVO>(DictConstants.KEY_KEY_STATUS) }
|
|
|
+ async { fetchDict<CommonDictRespVO>(DictAndSystemConstants.KEY_SLOT_STATUS) }
|
|
|
+ val slotType = async { fetchDict<CommonDictRespVO>(DictAndSystemConstants.KEY_SLOT_TYPE) }
|
|
|
+ val keyStatus = async { fetchDict<CommonDictRespVO>(DictAndSystemConstants.KEY_KEY_STATUS) }
|
|
|
|
|
|
// 等待字典加载完成
|
|
|
val lockStatusList = lockStatus.await()
|
|
|
@@ -1379,15 +1377,17 @@ object BusinessManager {
|
|
|
}
|
|
|
} else {
|
|
|
// 当前策略:作业票未完成禁止归还钥匙
|
|
|
- showKeyReturnDialog {
|
|
|
- sendLoadingEventMsg(null, false)
|
|
|
- ToastUtils.tip(R.string.continue_the_ticket)
|
|
|
- BleManager.getInstance().disconnect(bleDevice)
|
|
|
- // 打开卡扣,防止初始化的时候选择不处理钥匙导致无法使用
|
|
|
- val dock = ModBusController.getDockByKeyMac(bleDevice.mac)
|
|
|
- val keyBean = dock?.getKeyList()?.find { it.mac == bleDevice.mac }
|
|
|
- keyBean?.let {
|
|
|
- ModBusController.controlKeyBuckle(true, keyBean.isLeft, dock.addr)
|
|
|
+ withContext(Dispatchers.Main) {
|
|
|
+ showKeyReturnDialog {
|
|
|
+ sendLoadingEventMsg(null, false)
|
|
|
+ ToastUtils.tip(R.string.continue_the_ticket)
|
|
|
+ BleManager.getInstance().disconnect(bleDevice)
|
|
|
+ // 打开卡扣,防止初始化的时候选择不处理钥匙导致无法使用
|
|
|
+ val dock = ModBusController.getDockByKeyMac(bleDevice.mac)
|
|
|
+ val keyBean = dock?.getKeyList()?.find { it.mac == bleDevice.mac }
|
|
|
+ keyBean?.let {
|
|
|
+ ModBusController.controlKeyBuckle(true, keyBean.isLeft, dock.addr)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|