|
|
@@ -126,39 +126,39 @@ class JobProgressFragment(val goBack: () -> Unit) :
|
|
|
}
|
|
|
|
|
|
fun getCardNo(cardNo: String) {
|
|
|
- getStepDetail(mPageChangeBO?.ticketId!!)
|
|
|
-
|
|
|
- presenter?.getCardInfoByNfc(cardNo) {
|
|
|
- if (it == null) {
|
|
|
- return@getCardInfoByNfc
|
|
|
- }
|
|
|
- if (mTipDialog == null) {
|
|
|
- mTipDialog = TipDialog(requireContext())
|
|
|
- }
|
|
|
- val jobStatus = mUserList.find { itUser -> itUser.userId == it.userId }?.jobStatus
|
|
|
- if (jobStatus == null || jobStatus >= 5) {
|
|
|
- return@getCardInfoByNfc
|
|
|
- }
|
|
|
-
|
|
|
- if (mStep == 6) {
|
|
|
- if (jobStatus < 4) {
|
|
|
- mTipDialog?.setTip(getString(R.string.confirm_to_colock, cardNo))
|
|
|
- } else {
|
|
|
- mTipDialog?.setTip(getString(R.string.confirm_to_uncolock, cardNo))
|
|
|
+ getStepDetail(mPageChangeBO?.ticketId!!) {
|
|
|
+ presenter?.getCardInfoByNfc(cardNo) {
|
|
|
+ if (it == null) {
|
|
|
+ return@getCardInfoByNfc
|
|
|
}
|
|
|
- mTipDialog?.setConfirmListener {
|
|
|
- presenter?.updateColockerStatus(mPageChangeBO?.ticketId!!, cardNo, if (jobStatus < 4) "4" else "5") {
|
|
|
- refreshPage(mPageChangeBO!!)
|
|
|
+ if (mTipDialog == null) {
|
|
|
+ mTipDialog = TipDialog(requireContext())
|
|
|
+ }
|
|
|
+ val jobStatus = mUserList.find { itUser -> itUser.userId == it.userId }?.jobStatus
|
|
|
+ if (jobStatus == null || jobStatus >= 5) {
|
|
|
+ return@getCardInfoByNfc
|
|
|
+ }
|
|
|
+
|
|
|
+ if (mStep == 6) {
|
|
|
+ if (jobStatus < 4) {
|
|
|
+ mTipDialog?.setTip(getString(R.string.confirm_to_colock, cardNo))
|
|
|
+ } else {
|
|
|
+ mTipDialog?.setTip(getString(R.string.confirm_to_uncolock, cardNo))
|
|
|
}
|
|
|
+ mTipDialog?.setConfirmListener {
|
|
|
+ presenter?.updateColockerStatus(mPageChangeBO?.ticketId!!, cardNo, if (jobStatus < 4) "4" else "5") {
|
|
|
+ refreshPage(mPageChangeBO!!)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ mTipDialog?.showCancelCountdown(10)
|
|
|
+ } else {
|
|
|
+ ToastUtils.tip(R.string.can_not_do_colock_action)
|
|
|
}
|
|
|
- mTipDialog?.showCancelCountdown(10)
|
|
|
- } else {
|
|
|
- ToastUtils.tip(R.string.can_not_do_colock_action)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private fun getStepDetail(ticketId: Long) {
|
|
|
+ private fun getStepDetail(ticketId: Long, callback: (() -> Unit)? = null) {
|
|
|
presenter?.getStepDetail(ticketId) {
|
|
|
mBinding?.tvWorker?.text = "${it?.get(2)?.userNum}/${it?.get(4)?.userNum}/${it?.get(7)?.userNum}"
|
|
|
mBinding?.tvLock?.text = "${it?.get(2)?.lockNum}/${it?.get(4)?.lockNum}/${it?.get(7)?.lockNum}"
|
|
|
@@ -167,6 +167,7 @@ class JobProgressFragment(val goBack: () -> Unit) :
|
|
|
mStep = it
|
|
|
}
|
|
|
handleActionBtnVisibility()
|
|
|
+ callback?.invoke()
|
|
|
}
|
|
|
}
|
|
|
|