|
|
@@ -99,6 +99,7 @@ class JobProgressPresenter : BasePresenter<IJobProgressView>() {
|
|
|
LogUtil.i("getTicketDetail lock: $ticketDetail")
|
|
|
val role = ticketDetail?.ticketUserVOList?.find { it.userId == SPUtils.getLoginUser(mContext!!)?.userId && it.userType == USER_TYPE_LOCKER }
|
|
|
if (role == null) {
|
|
|
+ LogUtil.w("User is not locker")
|
|
|
ToastUtils.tip(R.string.you_are_not_locker_tip)
|
|
|
BusinessManager.sendLoadingEventMsg(null, false)
|
|
|
return@getTicketDetail
|
|
|
@@ -108,7 +109,11 @@ class JobProgressPresenter : BasePresenter<IJobProgressView>() {
|
|
|
if (role.jobStatus == JOB_STATUS_NOT_STARTED || role.jobStatus == JOB_STATUS_ACQUIRE_LOCK || role.jobStatus == JOB_STATUS_ACQUIRE_KEY) {
|
|
|
LogUtil.i("EquipDetail : $ticketDetail")
|
|
|
// 取锁具、取钥匙
|
|
|
- val needLockCount = ticketDetail.ticketLockVOList?.count { it.lockId == null } ?: 0
|
|
|
+ val needLockCount = ticketDetail.ticketLockVOList?.count { it.lockId == null }?.let { lockPointSize ->
|
|
|
+ ticketDetail.noUnlockTicketPointsVOSet?.filter { conflictData -> ticketDetail.ticketLockVOList.any { conflictData.lockId == it.lockId } }?.size?.let { conflictSize ->
|
|
|
+ lockPointSize - conflictSize
|
|
|
+ } ?: lockPointSize
|
|
|
+ } ?: 0
|
|
|
val readyLockCount = BusinessManager.mDeviceTakeList.count { it.deviceType == DEVICE_TYPE_LOCK && it.ticketId == ticketId }
|
|
|
val realCount = (needLockCount - readyLockCount).coerceAtLeast(0)
|
|
|
if (readyLockCount > 0) {
|