Sfoglia il codice sorgente

补充底部状态栏提示

Frankensteinly 7 mesi fa
parent
commit
6eb163a8c8

+ 1 - 0
app/src/main/java/com/grkj/iscs/BusinessManager.kt

@@ -1186,6 +1186,7 @@ object BusinessManager {
                     NetApi.updateKeyTake(info.ticketId, info.nfc, MyApplication.instance?.serialNo()!!) { isSuccess ->
                         if (isSuccess) {
                             mDeviceTakeList.removeIf { it.deviceType == DEVICE_TYPE_KEY && it.nfc == info.nfc }
+                            mEventBus.postValue(MsgEvent(MSG_EVENT_UPDATE_TICKET_PROGRESS, UpdateTicketProgressMsg(info.ticketId)))
                         }
                     }
                 }

+ 46 - 0
app/src/main/java/com/grkj/iscs/view/fragment/JobProgressFragment.kt

@@ -122,6 +122,7 @@ class JobProgressFragment(val goBack: () -> Unit) :
             mBinding?.rvPoint?.adapter?.notifyDataSetChanged()
             mBinding?.rvColocker?.adapter?.notifyDataSetChanged()
             handleActionBtnVisibility()
+            handleBottomTip(pageChangeBO.ticketId)
         }
         presenter?.getTicketDetail(pageChangeBO.ticketId) {
             mBinding?.tvTitle?.text = it?.ticketName
@@ -198,6 +199,51 @@ class JobProgressFragment(val goBack: () -> Unit) :
         mBinding?.cbAction?.isEnabled = mBinding?.cbAction?.visibility == View.VISIBLE
     }
 
+    private fun handleBottomTip(ticketId: Long) {
+        presenter?.getEquipDetail(ticketId) { equipDetail ->
+            when (mStep) {
+                4 -> {
+                    val keyCount = equipDetail?.ticketKeyVOList?.count { it.keyId != null }
+                    if (keyCount == null || keyCount < 1) {
+                        mBinding?.llTip?.visibility = View.VISIBLE
+                        mBinding?.tvTip?.text = getString(R.string.please_go_locking)
+                    } else if (keyCount == 1) {
+                        if (equipDetail.ticketKeyVOList[0].keyStatus == "1") {
+                            mBinding?.llTip?.visibility = View.VISIBLE
+                            mBinding?.tvTip?.text = getString(R.string.please_return_key_after_locking)
+                        } else {
+                            mBinding?.llTip?.visibility = View.GONE
+                            mBinding?.tvTip?.text = ""
+                        }
+                    }
+                }
+                6 -> {
+                    mBinding?.llTip?.visibility = View.VISIBLE
+                    mBinding?.tvTip?.text = getString(R.string.please_do_colock)
+                }
+                7 -> {
+                    val keyCount = equipDetail?.ticketKeyVOList?.count { it.keyId != null }
+                    if (keyCount == 1) {
+                        mBinding?.llTip?.visibility = View.VISIBLE
+                        mBinding?.tvTip?.text = getString(R.string.please_go_unlocking)
+                    } else if (keyCount == 2) {
+                        if (equipDetail.ticketKeyVOList[1].keyStatus == "1") {
+                            mBinding?.llTip?.visibility = View.VISIBLE
+                            mBinding?.tvTip?.text = getString(R.string.please_return_key_after_unlocking)
+                        } else {
+                            mBinding?.llTip?.visibility = View.GONE
+                            mBinding?.tvTip?.text = ""
+                        }
+                    }
+                }
+                else -> {
+                    mBinding?.llTip?.visibility = View.GONE
+                    mBinding?.tvTip?.text = ""
+                }
+            }
+        }
+    }
+
     override fun onPause() {
         super.onPause()
         mStep = 0

+ 31 - 0
app/src/main/java/com/grkj/iscs/view/fragment/StepFragment.kt

@@ -173,6 +173,7 @@ class StepFragment(val goBack: () -> Unit, val changePage: (PageChangeBO) -> Uni
             } else {
                 mBinding?.cbAction?.visibility = View.GONE
             }
+            handleBottomTip()
         }
 
         presenter?.getMachineryDetail(pageChangeBO.machineryId!!,
@@ -276,6 +277,36 @@ class StepFragment(val goBack: () -> Unit, val changePage: (PageChangeBO) -> Uni
         mTipDialog.show()
     }
 
+    private fun handleBottomTip() {
+        mBinding?.llTip?.visibility = if (mStep >= 2) View.VISIBLE else View.GONE
+        when (mStep) {
+            2 -> {
+                mBinding?.tvTip?.text = getString(R.string.waiting_for_allocating_worker)
+            }
+            3 -> {
+                mBinding?.tvTip?.text = getString(R.string.waiting_for_shutting_down)
+            }
+            4 -> {
+                mBinding?.tvTip?.text = getString(R.string.waiting_for_hanging_a_sign)
+            }
+            5 -> {
+                mBinding?.tvTip?.text = getString(R.string.waiting_for_power_isolation)
+            }
+            6 -> {
+                mBinding?.tvTip?.text = getString(R.string.waiting_for_checking_before_unlocking)
+            }
+            7 -> {
+                mBinding?.tvTip?.text = getString(R.string.waiting_for_restoring_switch_before_unlocking)
+            }
+            8 -> {
+                mBinding?.tvTip?.text = getString(R.string.waiting_for_finishing)
+            }
+            else -> {
+                mBinding?.tvTip?.text = ""
+            }
+        }
+    }
+
     override fun onPause() {
         super.onPause()
         mStep = 0

+ 9 - 0
app/src/main/java/com/grkj/iscs/view/presenter/JobProgressPresenter.kt

@@ -15,6 +15,7 @@ import com.grkj.iscs.model.vo.lock.LockTakeUpdateReqVO
 import com.grkj.iscs.model.vo.ticket.StepDetailRespVO
 import com.grkj.iscs.model.vo.ticket.TicketDetailMonitorRespVO
 import com.grkj.iscs.model.vo.ticket.TicketDetailRespVO
+import com.grkj.iscs.model.vo.ticket.TicketEquipDetailRespVO
 import com.grkj.iscs.util.Executor
 import com.grkj.iscs.util.NetApi
 import com.grkj.iscs.util.SPUtils
@@ -71,6 +72,14 @@ class JobProgressPresenter : BasePresenter<IJobProgressView>() {
         }
     }
 
+    fun getEquipDetail(ticketId: Long, callBack: (TicketEquipDetailRespVO?) -> Unit) {
+        NetApi.getTicketEquipDetail(ticketId) {
+            Executor.runOnMain {
+                callBack(it)
+            }
+        }
+    }
+
     /**
      * 检查是否可以继续执行后续操作(例:点击后不拿设备或者无法拿设备,又再次点击按钮)
      *

+ 18 - 5
app/src/main/res/layout/dialog_face_capture.xml

@@ -97,11 +97,24 @@
                 android:orientation="vertical"
                 android:padding="@dimen/common_spacing_small">
 
-                <TextView
-                    style="@style/CommonTextView"
-                    android:text="@string/capture_tip_title"
-                    android:textColor="@color/black"
-                    android:textSize="@dimen/common_text_size_small" />
+                <LinearLayout
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:gravity="center_vertical"
+                    android:orientation="horizontal">
+
+                    <ImageView
+                        android:layout_width="@dimen/common_icon_size"
+                        android:layout_height="@dimen/common_icon_size"
+                        android:background="@mipmap/tip" />
+
+                    <TextView
+                        style="@style/CommonTextView"
+                        android:layout_marginLeft="@dimen/common_spacing_small"
+                        android:text="@string/capture_tip_title"
+                        android:textColor="@color/black"
+                        android:textSize="@dimen/common_text_size_small" />
+                </LinearLayout>
 
                 <TextView
                     style="@style/CommonTextView"

+ 52 - 21
app/src/main/res/layout/fragment_job_progress.xml

@@ -6,32 +6,63 @@
     android:layout_height="match_parent"
     tools:context=".view.fragment.JobProgressFragment">
 
-    <com.grkj.iscs.view.widget.CommonBtn
-        android:id="@+id/cb_back"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentRight="true"
-        android:layout_alignParentBottom="true"
-        app:btn_bg="@drawable/common_btn_blue_bg"
-        app:btn_icon="@mipmap/go_back"
-        app:btn_name="@string/back" />
-
-    <com.grkj.iscs.view.widget.CommonBtn
-        android:id="@+id/cb_action"
-        android:layout_width="wrap_content"
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:id="@+id/rl_action"
+        android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_alignParentBottom="true"
-        android:layout_marginRight="@dimen/common_spacing"
-        android:layout_toLeftOf="@id/cb_back"
-        android:visibility="gone"
-        app:btn_bg="@drawable/common_btn_red_bg"
-        app:btn_icon="@mipmap/ticket_lock"
-        app:btn_name="@string/go_locking" />
+        android:layout_alignParentBottom="true">
+
+        <LinearLayout
+            android:id="@+id/ll_tip"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerVertical="true"
+            android:gravity="center_vertical"
+            android:orientation="horizontal"
+            android:visibility="gone"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintTop_toTopOf="parent">
+
+            <ImageView
+                android:layout_width="@dimen/common_icon_size"
+                android:layout_height="@dimen/common_icon_size"
+                android:background="@mipmap/tip" />
+
+            <TextView
+                android:id="@+id/tv_tip"
+                style="@style/CommonTextView"
+                android:layout_marginLeft="@dimen/common_spacing"
+                android:text="@string/allocating_worker_tip" />
+        </LinearLayout>
+
+        <com.grkj.iscs.view.widget.CommonBtn
+            android:id="@+id/cb_back"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            app:btn_bg="@drawable/common_btn_blue_bg"
+            app:btn_icon="@mipmap/go_back"
+            app:btn_name="@string/back"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintRight_toRightOf="parent" />
+
+        <com.grkj.iscs.view.widget.CommonBtn
+            android:id="@+id/cb_action"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginRight="@dimen/common_spacing"
+            android:visibility="gone"
+            app:btn_bg="@drawable/common_btn_red_bg"
+            app:btn_icon="@mipmap/ticket_lock"
+            app:btn_name="@string/go_locking"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintRight_toLeftOf="@id/cb_back" />
+    </androidx.constraintlayout.widget.ConstraintLayout>
 
     <RelativeLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:layout_above="@id/cb_back"
+        android:layout_above="@id/rl_action"
         android:layout_marginBottom="@dimen/common_spacing"
         android:background="@drawable/item_rv_technology_sop_bg_normal"
         android:padding="@dimen/common_spacing">

+ 53 - 23
app/src/main/res/layout/fragment_step.xml

@@ -6,32 +6,62 @@
     android:layout_height="match_parent"
     tools:context=".view.fragment.StepFragment">
 
-    <com.grkj.iscs.view.widget.CommonBtn
-        android:id="@+id/cb_back"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentRight="true"
-        android:layout_alignParentBottom="true"
-        app:btn_bg="@drawable/common_btn_blue_bg"
-        app:btn_icon="@mipmap/go_back"
-        app:btn_name="@string/back" />
-
-    <com.grkj.iscs.view.widget.CommonBtn
-        android:id="@+id/cb_action"
-        android:layout_width="wrap_content"
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:id="@+id/rl_action"
+        android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_alignParentBottom="true"
-        android:layout_marginRight="@dimen/common_spacing"
-        android:layout_toLeftOf="@id/cb_back"
-        android:visibility="invisible"
-        app:btn_bg="@drawable/common_btn_red_bg"
-        app:btn_icon="@mipmap/stop"
-        app:btn_name="@string/cancel_the_job" />
+        android:layout_alignParentBottom="true">
+
+        <LinearLayout
+            android:id="@+id/ll_tip"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerVertical="true"
+            android:orientation="horizontal"
+            android:gravity="center_vertical"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            android:visibility="gone">
+
+            <ImageView
+                android:layout_width="@dimen/common_icon_size"
+                android:layout_height="@dimen/common_icon_size"
+                android:background="@mipmap/tip" />
+
+            <TextView
+                android:id="@+id/tv_tip"
+                style="@style/CommonTextView"
+                android:layout_marginLeft="@dimen/common_spacing" />
+        </LinearLayout>
+
+        <com.grkj.iscs.view.widget.CommonBtn
+            android:id="@+id/cb_back"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            app:btn_bg="@drawable/common_btn_blue_bg"
+            app:btn_icon="@mipmap/go_back"
+            app:btn_name="@string/back"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintRight_toRightOf="parent" />
+
+        <com.grkj.iscs.view.widget.CommonBtn
+            android:id="@+id/cb_action"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginRight="@dimen/common_spacing"
+            android:visibility="invisible"
+            app:btn_bg="@drawable/common_btn_red_bg"
+            app:btn_icon="@mipmap/stop"
+            app:btn_name="@string/cancel_the_job"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintRight_toLeftOf="@id/cb_back" />
+    </androidx.constraintlayout.widget.ConstraintLayout>
 
     <androidx.constraintlayout.widget.ConstraintLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:layout_above="@id/cb_back"
+        android:layout_above="@id/rl_action"
         android:layout_marginBottom="@dimen/common_spacing"
         android:background="@drawable/item_rv_technology_sop_bg_normal"
         android:padding="5dp">
@@ -131,8 +161,8 @@
                     android:id="@+id/mapview"
                     android:layout_width="match_parent"
                     android:layout_height="match_parent"
-                    android:layout_marginTop="@dimen/common_spacing_small"
-                    android:layout_above="@id/rv_statistics" />
+                    android:layout_above="@id/rv_statistics"
+                    android:layout_marginTop="@dimen/common_spacing_small" />
             </LinearLayout>
         </LinearLayout>
 

+ 50 - 20
app/src/main/res/layout/fragment_worker.xml

@@ -6,31 +6,61 @@
     android:layout_height="match_parent"
     tools:context=".view.fragment.WorkerFragment">
 
-    <com.grkj.iscs.view.widget.CommonBtn
-        android:id="@+id/cb_cancel"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentRight="true"
-        android:layout_alignParentBottom="true"
-        app:btn_bg="@drawable/common_btn_red_bg"
-        app:btn_icon="@mipmap/cancel"
-        app:btn_name="@string/cancel" />
-
-    <com.grkj.iscs.view.widget.CommonBtn
-        android:id="@+id/cb_confirm"
-        android:layout_width="wrap_content"
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:id="@+id/rl_action"
+        android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_alignParentBottom="true"
-        android:layout_marginRight="@dimen/common_spacing"
-        android:layout_toLeftOf="@id/cb_cancel"
-        app:btn_bg="@drawable/common_btn_blue_bg"
-        app:btn_icon="@mipmap/confirm"
-        app:btn_name="@string/confirm" />
+        android:layout_alignParentBottom="true">
+
+        <LinearLayout
+            android:id="@+id/ll_tip"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerVertical="true"
+            android:gravity="center_vertical"
+            android:orientation="horizontal"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintTop_toTopOf="parent">
+
+            <ImageView
+                android:layout_width="@dimen/common_icon_size"
+                android:layout_height="@dimen/common_icon_size"
+                android:background="@mipmap/tip" />
+
+            <TextView
+                style="@style/CommonTextView"
+                android:layout_marginLeft="@dimen/common_spacing"
+                android:text="@string/allocating_worker_tip" />
+        </LinearLayout>
+
+        <com.grkj.iscs.view.widget.CommonBtn
+            android:id="@+id/cb_cancel"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            app:btn_bg="@drawable/common_btn_red_bg"
+            app:btn_icon="@mipmap/cancel"
+            app:btn_name="@string/cancel"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintRight_toRightOf="parent" />
+
+        <com.grkj.iscs.view.widget.CommonBtn
+            android:id="@+id/cb_confirm"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginRight="@dimen/common_spacing"
+            android:layout_toLeftOf="@id/cb_cancel"
+            app:btn_bg="@drawable/common_btn_blue_bg"
+            app:btn_icon="@mipmap/confirm"
+            app:btn_name="@string/confirm"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintRight_toLeftOf="@id/cb_cancel" />
+    </androidx.constraintlayout.widget.ConstraintLayout>
 
     <androidx.constraintlayout.widget.ConstraintLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:layout_above="@id/cb_cancel"
+        android:layout_above="@id/rl_action"
         android:layout_marginBottom="@dimen/common_spacing"
         android:background="@drawable/item_rv_technology_sop_bg_normal"
         android:orientation="horizontal"

BIN
app/src/main/res/mipmap/tip.png


+ 13 - 0
app/src/main/res/values/strings.xml

@@ -252,4 +252,17 @@
     <string name="take_out_lock_tip">请从打开的锁仓取出锁,还有%d把待取出</string>
     <string name="take_out_key_tip">请从打开的钥匙仓取出钥匙</string>
     <string name="data_is_uploading">数据上传······</string>
+    <string name="waiting_for_allocating_worker">等待分配作业人员</string>
+    <string name="waiting_for_shutting_down">等待执行操作停机</string>
+    <string name="waiting_for_hanging_a_sign">等待执行上锁挂牌</string>
+    <string name="waiting_for_power_isolation">等待执行能量隔离证实</string>
+    <string name="waiting_for_checking_before_unlocking">等待执行取锁前检查</string>
+    <string name="waiting_for_restoring_switch_before_unlocking">等待执行拆锁前恢复开关</string>
+    <string name="waiting_for_finishing">等待结束本次作业</string>
+    <string name="allocating_worker_tip">请设置上锁人和共锁人</string>
+    <string name="please_go_locking">请上锁员执行去上锁操作</string>
+    <string name="please_return_key_after_locking">请上锁员完成上锁后,归还钥匙</string>
+    <string name="please_do_colock">请共锁人进行共锁,并在工作完成后解除共锁</string>
+    <string name="please_go_unlocking">请上锁员执行去解锁操作</string>
+    <string name="please_return_key_after_unlocking">请上锁员完成解锁后,归还钥匙</string>
 </resources>