Эх сурвалжийг харах

Merge branch 'master' into wzbs

Frankensteinly 6 сар өмнө
parent
commit
949751d341

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

@@ -975,6 +975,7 @@ object BusinessManager {
      * @param vo 工作票详情
      */
     private fun generateTicketSendJson(isLock: Boolean, vo: TicketDetailRespVO, lockList: MutableList<String?>?): String {
+        LogUtil.i("generateTicketSendJson : $lockList")
         // 用ticketStatus的"待上锁"进行判断
 //        var isLock = true
 //        vo.ticketStatus?.let {
@@ -995,6 +996,9 @@ object BusinessManager {
         val taskList = ArrayList<WorkTicketSendBO.DataBO.DataListBO>()
         vo.ticketPointsVOList?.let { itList ->
             itList.forEach { pointVO ->
+                if (vo.noUnlockTicketPointsVOSet?.any { it.pointId == pointVO.pointId } == true) {
+                    return@forEach
+                }
                 val task = WorkTicketSendBO.DataBO.DataListBO(
                     dataId = pointVO.pointId?.toInt(),
                     equipRfidNo = pointVO.pointNfc,

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

@@ -94,7 +94,7 @@ class DeviceStatusFragment : BaseMvpFragment<IDeviceStatusView, DeviceStatusPres
         }
 
         override fun isForViewType(item: DockStatusBO?, position: Int): Boolean {
-            return item?.dockList?.any { it.type == DOCK_TYPE_KEY } == true
+            return item?.dockList?.all { it.type == DOCK_TYPE_KEY } == true
         }
     }
 
@@ -114,7 +114,7 @@ class DeviceStatusFragment : BaseMvpFragment<IDeviceStatusView, DeviceStatusPres
         }
 
         override fun isForViewType(item: DockStatusBO?, position: Int): Boolean {
-            return item?.dockList?.any { it.type == DOCK_TYPE_LOCK } == true
+            return item?.dockList?.all { it.type == DOCK_TYPE_LOCK } == true
         }
     }
 

+ 6 - 1
app/src/main/java/com/grkj/iscs/view/presenter/JobProgressPresenter.kt

@@ -99,6 +99,7 @@ class JobProgressPresenter : BasePresenter<IJobProgressView>() {
                 LogUtil.i("getTicketDetail lock: $ticketDetail")
                 val role = ticketDetail?.ticketUserVOList?.find { it.userId == SPUtils.getLoginUser(mContext!!)?.userId && it.userType == USER_TYPE_LOCKER }
                 if (role == null) {
+                    LogUtil.w("User is not locker")
                     ToastUtils.tip(R.string.you_are_not_locker_tip)
                     BusinessManager.sendLoadingEventMsg(null, false)
                     return@getTicketDetail
@@ -108,7 +109,11 @@ class JobProgressPresenter : BasePresenter<IJobProgressView>() {
                 if (role.jobStatus == JOB_STATUS_NOT_STARTED || role.jobStatus == JOB_STATUS_ACQUIRE_LOCK || role.jobStatus == JOB_STATUS_ACQUIRE_KEY) {
                     LogUtil.i("EquipDetail : $ticketDetail")
                     // 取锁具、取钥匙
-                    val needLockCount = ticketDetail.ticketLockVOList?.count { it.lockId == null } ?: 0
+                    val needLockCount = ticketDetail.ticketLockVOList?.count { it.lockId == null }?.let { lockPointSize ->
+                        ticketDetail.noUnlockTicketPointsVOSet?.filter { conflictData -> ticketDetail.ticketLockVOList.any { conflictData.lockId == it.lockId } }?.size?.let { conflictSize ->
+                            lockPointSize - conflictSize
+                        } ?: lockPointSize
+                    } ?: 0
                     val readyLockCount = BusinessManager.mDeviceTakeList.count { it.deviceType == DEVICE_TYPE_LOCK && it.ticketId == ticketId }
                     val realCount = (needLockCount - readyLockCount).coerceAtLeast(0)
                     if (readyLockCount > 0) {

+ 4 - 0
app/src/main/java/com/grkj/iscs/view/presenter/SystemSettingPresenter.kt

@@ -86,6 +86,10 @@ class SystemSettingPresenter : BasePresenter<ISystemSettingView>() {
                     ToastUtils.tip(R.string.row_and_column_conflict)
                     return
                 }
+                if (dockList.any { it.row == row && it.type != type }) {
+                    ToastUtils.tip(R.string.row_conflict)
+                    return
+                }
             } else if (type == DOCK_TYPE_LOCK) {
                 if (dockList.any { it.row == row }) {
                     ToastUtils.tip(R.string.row_conflict)