ソースを参照

refactor(加解锁界面):
- 共锁刷卡逻辑判断

周文健 5 ヶ月 前
コミット
96ef4c4d32

+ 12 - 2
app/src/main/java/com/grkj/iscs/view/fragment/JobProgressFragment.kt

@@ -215,7 +215,11 @@ class JobProgressFragment(val goBack: () -> Unit) :
                 val jobStatus = mUserList.find { itUser -> itUser.userId == it.userId }?.jobStatus
                 if (jobStatus == null || jobStatus >= 5) {
                     val errorStr = if (jobStatus == null) {
-                        getString(R.string.user_not_found)
+                        if (mStep == 4) {
+                            getString(R.string.current_user_does_not_have_the_authority_to_colock)
+                        } else {
+                            getString(R.string.current_user_does_not_have_the_authority_to_unlock_colock)
+                        }
                     } else {
                         getString(R.string.user_already_unlock)
                     }
@@ -313,7 +317,13 @@ class JobProgressFragment(val goBack: () -> Unit) :
             }
 
             7 -> {
-                if (presenter?.showGoToUnlock(requireContext(), mTicketDetail,mPointList, mUserList) == true) {
+                if (presenter?.showGoToUnlock(
+                        requireContext(),
+                        mTicketDetail,
+                        mPointList,
+                        mUserList
+                    ) == true
+                ) {
                     mBinding?.cbAction?.visibility = View.VISIBLE
                     mBinding?.cbAction?.setIcon(R.mipmap.ticket_unlocked)
                     mBinding?.cbAction?.setText(getString(R.string.go_unlocking))

+ 2 - 1
app/src/main/res/values-en/strings.xml

@@ -320,7 +320,6 @@
     <string name="mode_one">mode 1</string>
     <string name="mode_two">mode 2</string>
     <string name="step_mode_change_success">step mode change success</string>
-    <string name="user_not_found">user not found</string>
     <string name="user_already_unlock">user already unlock</string>
     <string name="please_wait_all_colocker_unlocked">please wait all colocker unlocked</string>
     <string name="current_colocker_already_locked">current colocker already locked</string>
@@ -330,4 +329,6 @@
     <string name="keep_at_least_colocker">keep at least %1$d colocker</string>
     <string name="action_hint">action hint</string>
     <string name="take_one_more_key_hint">I have already taken out the key, would you like to take out another one</string>
+    <string name="current_user_does_not_have_the_authority_to_colock">The current user does not have the authority to colock</string>
+    <string name="current_user_does_not_have_the_authority_to_unlock_colock">The current user does not have the authority to unlock colock</string>
 </resources>

+ 2 - 1
app/src/main/res/values-zh/strings.xml

@@ -320,7 +320,6 @@
     <string name="mode_one">模式1</string>
     <string name="mode_two">模式2</string>
     <string name="step_mode_change_success">流程模式切换成功</string>
-    <string name="user_not_found">当前用户不存在</string>
     <string name="user_already_unlock">用户已解锁</string>
     <string name="please_wait_all_colocker_unlocked">请等待所有共锁人完成解锁</string>
     <string name="current_colocker_already_locked">当前共锁人已上锁</string>
@@ -330,4 +329,6 @@
     <string name="keep_at_least_colocker">至少保留%1$d位共锁人</string>
     <string name="action_hint">操作提醒</string>
     <string name="take_one_more_key_hint">已有钥匙取出,是否再取一个</string>
+    <string name="current_user_does_not_have_the_authority_to_colock">当前用户无权共锁</string>
+    <string name="current_user_does_not_have_the_authority_to_unlock_colock">当前用户无权解除共锁</string>
 </resources>

+ 2 - 1
app/src/main/res/values/strings.xml

@@ -320,7 +320,6 @@
     <string name="mode_one">模式1</string>
     <string name="mode_two">模式2</string>
     <string name="step_mode_change_success">流程模式切换成功</string>
-    <string name="user_not_found">当前用户不存在</string>
     <string name="user_already_unlock">用户已解锁</string>
     <string name="please_wait_all_colocker_unlocked">请等待所有共锁人完成解锁</string>
     <string name="current_colocker_already_locked">当前共锁人已上锁</string>
@@ -330,4 +329,6 @@
     <string name="keep_at_least_colocker">至少保留%1$d位共锁人</string>
     <string name="action_hint">操作提醒</string>
     <string name="take_one_more_key_hint">已有钥匙取出,是否再取一个</string>
+    <string name="current_user_does_not_have_the_authority_to_colock">当前用户无权共锁</string>
+    <string name="current_user_does_not_have_the_authority_to_unlock_colock">当前用户无权解除共锁</string>
 </resources>