|
@@ -14,6 +14,7 @@ import com.grkj.iscs.model.eventmsg.MsgEventConstants.MSG_EVENT_UPDATE_TICKET_PR
|
|
|
import com.grkj.iscs.model.eventmsg.UpdateTicketProgressMsg
|
|
import com.grkj.iscs.model.eventmsg.UpdateTicketProgressMsg
|
|
|
import com.grkj.iscs.model.vo.ticket.TicketDetailMonitorRespVO
|
|
import com.grkj.iscs.model.vo.ticket.TicketDetailMonitorRespVO
|
|
|
import com.grkj.iscs.model.vo.ticket.TicketDetailRespVO
|
|
import com.grkj.iscs.model.vo.ticket.TicketDetailRespVO
|
|
|
|
|
+import com.grkj.iscs.util.SPUtils
|
|
|
import com.grkj.iscs.util.ToastUtils
|
|
import com.grkj.iscs.util.ToastUtils
|
|
|
import com.grkj.iscs.util.log.LogUtil
|
|
import com.grkj.iscs.util.log.LogUtil
|
|
|
import com.grkj.iscs.view.base.BaseMvpFragment
|
|
import com.grkj.iscs.view.base.BaseMvpFragment
|
|
@@ -90,7 +91,10 @@ class JobProgressFragment(val goBack: () -> Unit) :
|
|
|
position: Int
|
|
position: Int
|
|
|
) {
|
|
) {
|
|
|
holder.setText(R.id.tv_name, user.userName)
|
|
holder.setText(R.id.tv_name, user.userName)
|
|
|
- holder.setVisible(R.id.iv_ready_to_lock, mStep >= 6)
|
|
|
|
|
|
|
+ holder.setVisible(
|
|
|
|
|
+ R.id.iv_ready_to_lock,
|
|
|
|
|
+ presenter?.needShowReadyToLock(requireContext(), mPointList, mStep) == true
|
|
|
|
|
+ )
|
|
|
holder.setVisible(R.id.iv_locked, user.jobStatus!! >= 4)
|
|
holder.setVisible(R.id.iv_locked, user.jobStatus!! >= 4)
|
|
|
holder.setVisible(R.id.iv_unlocked, user.jobStatus >= 5)
|
|
holder.setVisible(R.id.iv_unlocked, user.jobStatus >= 5)
|
|
|
}
|
|
}
|
|
@@ -98,11 +102,44 @@ class JobProgressFragment(val goBack: () -> Unit) :
|
|
|
|
|
|
|
|
mBinding?.cbAction?.debounce(2000) {
|
|
mBinding?.cbAction?.debounce(2000) {
|
|
|
if (mStep == 4) {
|
|
if (mStep == 4) {
|
|
|
- BusinessManager.sendLoadingEventMsg(getString(R.string.system_is_processing))
|
|
|
|
|
- presenter?.handleLockProcess(mPageChangeBO?.ticketId!!)
|
|
|
|
|
|
|
+ if (SPUtils.isKeyTake(mPageChangeBO?.ticketId!!)) {
|
|
|
|
|
+ if (mTipDialog == null) {
|
|
|
|
|
+ mTipDialog = TipDialog(requireContext())
|
|
|
|
|
+ }
|
|
|
|
|
+ mTipDialog?.setTip(getString(R.string.take_one_more_key_hint))
|
|
|
|
|
+ mTipDialog?.setType(TipDialog.TYPE_HINT)
|
|
|
|
|
+ mTipDialog?.setConfirmListener {
|
|
|
|
|
+ BusinessManager.sendLoadingEventMsg(getString(R.string.system_is_processing))
|
|
|
|
|
+ presenter?.handleLockProcess(mPageChangeBO?.ticketId!!)
|
|
|
|
|
+ }
|
|
|
|
|
+ mTipDialog?.showCancelCountdown(10)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ BusinessManager.sendLoadingEventMsg(getString(R.string.system_is_processing))
|
|
|
|
|
+ presenter?.handleLockProcess(mPageChangeBO?.ticketId!!)
|
|
|
|
|
+ SPUtils.takeKey(mPageChangeBO?.ticketId!!)
|
|
|
|
|
+ }
|
|
|
} else if (mStep == 7) {
|
|
} else if (mStep == 7) {
|
|
|
- BusinessManager.sendLoadingEventMsg(getString(R.string.system_is_processing))
|
|
|
|
|
- presenter?.handleUnlockProcess(mPageChangeBO?.ticketId!!)
|
|
|
|
|
|
|
+ val checkResult = presenter?.checkUnlock(requireContext(), mUserList)
|
|
|
|
|
+ if (checkResult?.isEmpty() == true) {
|
|
|
|
|
+ if (SPUtils.isKeyTake(mPageChangeBO?.ticketId!!)) {
|
|
|
|
|
+ if (mTipDialog == null) {
|
|
|
|
|
+ mTipDialog = TipDialog(requireContext())
|
|
|
|
|
+ }
|
|
|
|
|
+ mTipDialog?.setTip(getString(R.string.take_one_more_key_hint))
|
|
|
|
|
+ mTipDialog?.setType(TipDialog.TYPE_HINT)
|
|
|
|
|
+ mTipDialog?.setConfirmListener {
|
|
|
|
|
+ BusinessManager.sendLoadingEventMsg(getString(R.string.system_is_processing))
|
|
|
|
|
+ presenter?.handleUnlockProcess(mPageChangeBO?.ticketId!!)
|
|
|
|
|
+ }
|
|
|
|
|
+ mTipDialog?.showCancelCountdown(10)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ BusinessManager.sendLoadingEventMsg(getString(R.string.system_is_processing))
|
|
|
|
|
+ presenter?.handleUnlockProcess(mPageChangeBO?.ticketId!!)
|
|
|
|
|
+ SPUtils.takeKey(mPageChangeBO?.ticketId!!)
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ToastUtils.tip(checkResult)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -176,21 +213,65 @@ class JobProgressFragment(val goBack: () -> Unit) :
|
|
|
}
|
|
}
|
|
|
val jobStatus = mUserList.find { itUser -> itUser.userId == it.userId }?.jobStatus
|
|
val jobStatus = mUserList.find { itUser -> itUser.userId == it.userId }?.jobStatus
|
|
|
if (jobStatus == null || jobStatus >= 5) {
|
|
if (jobStatus == null || jobStatus >= 5) {
|
|
|
|
|
+ val errorStr = if (jobStatus == null) {
|
|
|
|
|
+ getString(R.string.user_not_found)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ getString(R.string.user_already_unlock)
|
|
|
|
|
+ }
|
|
|
|
|
+ ToastUtils.tip(errorStr)
|
|
|
return@getCardInfoByNfc
|
|
return@getCardInfoByNfc
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//刷卡处理共锁的位置调整步骤主要在这块
|
|
//刷卡处理共锁的位置调整步骤主要在这块
|
|
|
- if (mStep == 6) {
|
|
|
|
|
- if (jobStatus < 4) {
|
|
|
|
|
|
|
+ if (presenter?.canHandleColockerLock(
|
|
|
|
|
+ requireContext(),
|
|
|
|
|
+ mStep
|
|
|
|
|
+ ) == true
|
|
|
|
|
+ ) {
|
|
|
|
|
+ if (presenter?.canHandleColockerUnlock(
|
|
|
|
|
+ requireContext(),
|
|
|
|
|
+ mStep
|
|
|
|
|
+ ) == true && jobStatus == 4
|
|
|
|
|
+ ) {
|
|
|
|
|
+ mTipDialog?.setTip(getString(R.string.confirm_to_uncolock, it.nickName))
|
|
|
|
|
+ mTipDialog?.setConfirmListener {
|
|
|
|
|
+ presenter?.updateColockerStatus(
|
|
|
|
|
+ mPageChangeBO?.ticketId!!,
|
|
|
|
|
+ cardNo,
|
|
|
|
|
+ "5"
|
|
|
|
|
+ ) {
|
|
|
|
|
+ refreshPage(mPageChangeBO!!)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ mTipDialog?.showCancelCountdown(10)
|
|
|
|
|
+ } else if (jobStatus < 4) {
|
|
|
mTipDialog?.setTip(getString(R.string.confirm_to_colock, it.nickName))
|
|
mTipDialog?.setTip(getString(R.string.confirm_to_colock, it.nickName))
|
|
|
|
|
+ mTipDialog?.setConfirmListener {
|
|
|
|
|
+ presenter?.updateColockerStatus(
|
|
|
|
|
+ mPageChangeBO?.ticketId!!,
|
|
|
|
|
+ cardNo,
|
|
|
|
|
+ "4"
|
|
|
|
|
+ ) {
|
|
|
|
|
+ refreshPage(mPageChangeBO!!)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ mTipDialog?.showCancelCountdown(10)
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ ToastUtils.tip(getString(R.string.current_colocker_already_locked))
|
|
|
|
|
+ return@getCardInfoByNfc
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (presenter?.canHandleColockerUnlock(requireContext(), mStep) == true) {
|
|
|
|
|
+ if (jobStatus == 4) {
|
|
|
mTipDialog?.setTip(getString(R.string.confirm_to_uncolock, it.nickName))
|
|
mTipDialog?.setTip(getString(R.string.confirm_to_uncolock, it.nickName))
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ToastUtils.tip(getString(R.string.current_colocker_already_unlocked))
|
|
|
|
|
+ return@getCardInfoByNfc
|
|
|
}
|
|
}
|
|
|
mTipDialog?.setConfirmListener {
|
|
mTipDialog?.setConfirmListener {
|
|
|
presenter?.updateColockerStatus(
|
|
presenter?.updateColockerStatus(
|
|
|
mPageChangeBO?.ticketId!!,
|
|
mPageChangeBO?.ticketId!!,
|
|
|
cardNo,
|
|
cardNo,
|
|
|
- if (jobStatus < 4) "4" else "5"
|
|
|
|
|
|
|
+ "5"
|
|
|
) {
|
|
) {
|
|
|
refreshPage(mPageChangeBO!!)
|
|
refreshPage(mPageChangeBO!!)
|
|
|
}
|
|
}
|
|
@@ -231,7 +312,7 @@ class JobProgressFragment(val goBack: () -> Unit) :
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
7 -> {
|
|
7 -> {
|
|
|
- if (presenter?.showGoToUnlock(requireContext(),mPointList,mUserList) == true) {
|
|
|
|
|
|
|
+ if (presenter?.showGoToUnlock(requireContext(), mPointList, mUserList) == true) {
|
|
|
mBinding?.cbAction?.visibility = View.VISIBLE
|
|
mBinding?.cbAction?.visibility = View.VISIBLE
|
|
|
mBinding?.cbAction?.setIcon(R.mipmap.ticket_unlocked)
|
|
mBinding?.cbAction?.setIcon(R.mipmap.ticket_unlocked)
|
|
|
mBinding?.cbAction?.setText(getString(R.string.go_unlocking))
|
|
mBinding?.cbAction?.setText(getString(R.string.go_unlocking))
|