浏览代码

补充打印;删除冗余代码

Frankensteinly 8 月之前
父节点
当前提交
5e015edabf

+ 4 - 2
app/src/main/java/com/grkj/iscs/BusinessManager.kt

@@ -94,7 +94,7 @@ object BusinessManager {
         }
 
     // 设备归还列表(需要报给后台的列表,等实际取完再上报)
-    val mDeviceTakeList = mutableListOf<DeviceTakeUpdateBO>()
+    private val mDeviceTakeList = mutableListOf<DeviceTakeUpdateBO>()
 
     /**
      * 初始化消息总线
@@ -746,7 +746,7 @@ object BusinessManager {
         if (isNeedLoading) mEventBus.postValue(MsgEvent(MSG_EVENT_LOADING, LoadingMsg(true, "开始下发工作票...", null)))
         BleCmdManager.sendWorkTicket(jsonStr, bleDevice = bleDevice, callback = object : CustomBleWriteCallback() {
             override fun onWriteSuccess(current: Int, total: Int, justWrite: ByteArray?) {
-                println("sendTicket success")
+                LogUtil.i("sendTicket success")
                 if (isNeedLoading) mEventBus.postValue(MsgEvent(MSG_EVENT_LOADING, LoadingMsg(true, "工作票下发中...", null)))
             }
 
@@ -981,11 +981,13 @@ object BusinessManager {
      * 添加待更新取出状态的设备
      */
     fun addDeviceTake(deviceType: Int, ticketId: Long, nfc: String?) {
+        LogUtil.i("$deviceType - $ticketId - $nfc")
         mDeviceTakeList.removeIf { it.deviceType == deviceType && it.nfc == nfc }
         mDeviceTakeList.add(DeviceTakeUpdateBO(deviceType, ticketId, nfc))
     }
 
     private fun handleDeviceTake(deviceTakeUpdateBO: DeviceTakeUpdateMsg) {
+        LogUtil.i("$deviceTakeUpdateBO")
         when (deviceTakeUpdateBO.deviceType) {
             // 钥匙
             0 -> {

+ 2 - 3
app/src/main/java/com/grkj/iscs/model/eventmsg/MsgEventConstants.kt

@@ -4,8 +4,7 @@ object MsgEventConstants {
 
     // ------------------------------ 通用 1-001-000 ------------------------------
     const val MSG_EVENT_LOADING = 1_001_000             // loading消息
-
-
+    
     // ------------------------------ 设备 1-002-000 ------------------------------
-    const val MSG_EVENT_DEVICE_TAKE_UPDATE = 1_002_000
+    const val MSG_EVENT_DEVICE_TAKE_UPDATE = 1_002_000  // 设备取出
 }

+ 4 - 6
app/src/main/java/com/grkj/iscs/view/presenter/JobProgressPresenter.kt

@@ -91,13 +91,11 @@ class JobProgressPresenter : BasePresenter<IJobProgressView>() {
                     val isNeedKey = equipDetail?.ticketKeyVOList?.filter { it.keyId == null }?.size != 1
                     BusinessManager.checkEquipCount(needLockCount, isNeedKey) { keyPair, lockMap ->
                         val lockList = mutableListOf<LockTakeUpdateReqVO>()
-                        lockMap.forEach { (_, list) ->
-                            lockList.addAll(list.map { LockTakeUpdateReqVO(ticketDetail.ticketId, it.rfid, mContext!!.serialNo()) })
-                        }
-                        lockMap.forEach { (addr, lockList) ->
+                        lockMap.forEach { (addr, mLockList) ->
+                            lockList.addAll(mLockList.map { LockTakeUpdateReqVO(ticketDetail.ticketId, it.rfid, mContext!!.serialNo()) })
                             // 开锁卡扣
-                            ModBusController.controlLockBuckle(true, addr, lockList.map { it.idx }.toMutableList())
-                            lockList.forEach { itLock ->
+                            ModBusController.controlLockBuckle(true, addr, mLockList.map { it.idx }.toMutableList())
+                            mLockList.forEach { itLock ->
                                 BusinessManager.addDeviceTake(1, ticketId, itLock.rfid)
                             }
                         }