Quellcode durchsuchen

refactor(更新) :
- 开关地图异常处理,增加快速滑动返回居中
- 作业票找不到判定为作业结束显示弹窗

周文健 vor 5 Monaten
Ursprung
Commit
3b2e39e7ad

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

@@ -44,6 +44,7 @@ import com.grkj.iscs.model.eventmsg.DeviceExceptionMsg
 import com.grkj.iscs.model.eventmsg.DeviceTakeUpdateMsg
 import com.grkj.iscs.model.eventmsg.LoadingMsg
 import com.grkj.iscs.model.eventmsg.MsgEvent
+import com.grkj.iscs.model.eventmsg.MsgEventConstants
 import com.grkj.iscs.model.eventmsg.MsgEventConstants.MSG_EVENT_CURRENT_MODE
 import com.grkj.iscs.model.eventmsg.MsgEventConstants.MSG_EVENT_DEVICE_EXCEPTION
 import com.grkj.iscs.model.eventmsg.MsgEventConstants.MSG_EVENT_DEVICE_TAKE_UPDATE
@@ -491,7 +492,7 @@ object BusinessManager {
                                                     it.slotType == slotTypeList.find { d -> d.dictLabel == "锁" }?.dictValue &&
                                                             it.status == slotStatusList.find { d -> d.dictLabel == "异常" }?.dictValue
                                                 }
-                                                ?.find { it.row?.toInt() == dockBean.row &&(lockBean.idx+1) == it.col?.toInt() } != null
+                                                ?.find { it.row?.toInt() == dockBean.row && (lockBean.idx + 1) == it.col?.toInt() } != null
                                         ) {
                                             ToastUtils.tip(
                                                 MyApplication.instance?.applicationContext!!.getString(
@@ -1433,6 +1434,17 @@ object BusinessManager {
                             MyApplication.instance!!,
                             UpdateKeyReturnBO(data.taskCode?.toLong()!!, keyNfc!!)
                         )
+                        if (msg == MyApplication.instance?.applicationContext!!.getString(
+                                R.string.ticket_lost
+                            )
+                        ) {
+                            sendEventMsg(
+                                MsgEvent(
+                                    MsgEventConstants.MSG_EVENT_TICKET_FINISHED,
+                                    null
+                                )
+                            )
+                        }
                     }
                 }
             } else {

+ 1 - 0
app/src/main/java/com/grkj/iscs/model/eventmsg/MsgEventConstants.kt

@@ -11,6 +11,7 @@ object MsgEventConstants {
     // ------------------------------ 作业票 1-003-000 ------------------------------
     const val MSG_EVENT_GET_TICKET_STATUS = 1_003_000   // 获取设备工作票完成情况
     const val MSG_EVENT_UPDATE_TICKET_PROGRESS = 1_003_001  // 更新作业票进度(页面刷新)
+    const val MSG_EVENT_TICKET_FINISHED = 1_003_002 //作业票已结束
 
     // ------------------------------ 蓝牙 1-004-000 ------------------------------
     const val MSG_EVENT_CURRENT_MODE = 1_004_000        // 当前模式

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

@@ -15,6 +15,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.vo.ticket.TicketDetailMonitorRespVO
 import com.grkj.iscs.model.vo.ticket.TicketDetailRespVO
+import com.grkj.iscs.util.CommonUtils
 import com.grkj.iscs.util.SPUtils
 import com.grkj.iscs.util.ToastUtils
 import com.grkj.iscs.util.log.LogUtil
@@ -194,6 +195,15 @@ class JobProgressFragment(val goBack: () -> Unit) :
                         }
                     }
                 }
+
+                MsgEventConstants.MSG_EVENT_TICKET_FINISHED -> {
+                    if (mTipDialog == null) {
+                        mTipDialog = TipDialog(requireContext())
+                    }
+                    mTipDialog?.setType(TipDialog.TYPE_HINT)
+                    mTipDialog?.setTip(CommonUtils.getStr(R.string.job_already_finished).toString())
+                    mTipDialog?.show()
+                }
             }
         }
 

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

@@ -187,6 +187,16 @@ class StepFragment(val goBack: () -> Unit, val changePage: (PageChangeBO) -> Uni
                 mBinding?.mapview?.currentRotateDegrees = 0f
                 return super.onDoubleTap(e)
             }
+
+            override fun onFling(
+                e1: MotionEvent?,
+                e2: MotionEvent,
+                velocityX: Float,
+                velocityY: Float
+            ): Boolean {
+                mBinding?.mapview?.currentRotateDegrees = 0f
+                return super.onFling(e1, e2, velocityX, velocityY)
+            }
         })
         mBinding?.mapview?.isScaleAndRotateTogether = false
         mBinding?.mapview?.setOnTouchListener { _, event ->

+ 10 - 0
app/src/main/java/com/grkj/iscs/view/fragment/SwitchStatusFragment.kt

@@ -39,6 +39,16 @@ class SwitchStatusFragment :
                 mBinding?.mapview?.currentRotateDegrees = 0f
                 return super.onDoubleTap(e)
             }
+
+            override fun onFling(
+                e1: MotionEvent?,
+                e2: MotionEvent,
+                velocityX: Float,
+                velocityY: Float
+            ): Boolean {
+                mBinding?.mapview?.currentRotateDegrees = 0f
+                return super.onFling(e1, e2, velocityX, velocityY)
+            }
         })
         initMap()
     }

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

@@ -358,4 +358,5 @@
     <string name="key_exception_tag">Key is tag for exception</string>
     <string name="slot_exception_tag">Slot is tag for exception</string>
     <string name="lock_exception_tag">Lock is tag for exception</string>
+    <string name="job_already_finished">job already finished</string>
 </resources>

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

@@ -358,4 +358,5 @@
     <string name="key_exception_tag">该钥匙已被标记异常</string>
     <string name="slot_exception_tag">该锁仓已被标记异常</string>
     <string name="lock_exception_tag">该挂锁已被标记异常</string>
+    <string name="job_already_finished">该作业已被结束</string>
 </resources>

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

@@ -358,4 +358,5 @@
     <string name="key_exception_tag">该钥匙已被标记异常</string>
     <string name="slot_exception_tag">该锁仓已被标记异常</string>
     <string name="lock_exception_tag">该挂锁已被标记异常</string>
+    <string name="job_already_finished">该作业已被结束</string>
 </resources>