Преглед на файлове

完成作业执行页右上角进度显示

Frankensteinly преди 9 месеца
родител
ревизия
0f52d8fca9

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

@@ -40,6 +40,11 @@ class JobProgressFragment : BaseMvpFragment<IJobProgressVIew, JobProgressPresent
         presenter?.getTicketDetail(pageChangeBO.ticketId) {
             mBinding?.tvTitle?.text = it?.ticketName
         }
+
+        presenter?.getStepDetail(pageChangeBO.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}"
+        }
     }
 
     override fun initPresenter(): JobProgressPresenter {

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

@@ -94,8 +94,7 @@ class StepFragment(val goBack: () -> Unit, val changePage: (PageChangeBO) -> Uni
         }
 
         mBinding?.llDetail?.setOnClickListener {
-            // TODO 待修改
-            changePage(PageChangeBO(2))
+            changePage(mChangePage!!)
         }
     }
 
@@ -108,6 +107,8 @@ class StepFragment(val goBack: () -> Unit, val changePage: (PageChangeBO) -> Uni
         }
 
         presenter?.getStepDetail(pageChangeBO.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}"
             mStepList.forEach { step ->
                 step.stepDetail = it?.find { it.stepIndex == step.index }
             }

+ 5 - 0
app/src/main/java/com/grkj/iscs/view/fragment/WorkerFragment.kt

@@ -191,6 +191,11 @@ class WorkerFragment(val goBack: () -> Unit, val changePage: (PageChangeBO) -> U
             mBinding?.rvColockerInside?.adapter?.notifyDataSetChanged()
             mBinding?.rvColockerOutside?.adapter?.notifyDataSetChanged()
         }
+
+        presenter?.getStepDetail(pageChangeBO.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}"
+        }
     }
 
     override fun initPresenter(): WorkerPresenter {

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

@@ -1,6 +1,7 @@
 package com.grkj.iscs.view.presenter
 
 import com.grkj.iscs.R
+import com.grkj.iscs.model.vo.ticket.StepDetailRespVO
 import com.grkj.iscs.model.vo.ticket.TicketDetailRespVO
 import com.grkj.iscs.util.Executor
 import com.grkj.iscs.util.NetApi
@@ -23,4 +24,12 @@ class JobProgressPresenter : BasePresenter<IJobProgressVIew>() {
             }
         }
     }
+
+    fun getStepDetail(ticketId: Long, callBack: (MutableList<StepDetailRespVO>?) -> Unit) {
+        NetApi.getStepDetail(ticketId) {
+            Executor.runOnMain {
+                callBack(it)
+            }
+        }
+    }
 }

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

@@ -2,6 +2,7 @@ package com.grkj.iscs.view.presenter
 
 import com.grkj.iscs.R
 import com.grkj.iscs.model.Constants.USER_ROLE_LOCKER
+import com.grkj.iscs.model.vo.ticket.StepDetailRespVO
 import com.grkj.iscs.model.vo.ticket.TicketDetailRespVO
 import com.grkj.iscs.model.vo.ticket.TicketUserReqVO
 import com.grkj.iscs.model.vo.user.UserListRespVO
@@ -59,4 +60,12 @@ class WorkerPresenter : BasePresenter<IWorkerView>() {
             }
         }
     }
+
+    fun getStepDetail(ticketId: Long, callBack: (MutableList<StepDetailRespVO>?) -> Unit) {
+        NetApi.getStepDetail(ticketId) {
+            Executor.runOnMain {
+                callBack(it)
+            }
+        }
+    }
 }

+ 6 - 2
app/src/main/res/layout/fragment_job_progress.xml

@@ -44,6 +44,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_alignParentRight="true"
+            android:gravity="center_vertical"
             android:orientation="horizontal">
 
             <ImageView
@@ -54,17 +55,20 @@
 
             <TextView
                 android:id="@+id/tv_worker"
-                style="@style/CommonTextView" />
+                style="@style/CommonTextView"
+                android:layout_marginLeft="@dimen/common_spacing_small" />
 
             <ImageView
                 android:id="@+id/iv_lock"
                 android:layout_width="@dimen/common_icon_size_small"
                 android:layout_height="@dimen/common_icon_size_small"
+                android:layout_marginLeft="@dimen/common_spacing"
                 android:src="@mipmap/ticket_lock" />
 
             <TextView
                 android:id="@+id/tv_lock"
-                style="@style/CommonTextView" />
+                style="@style/CommonTextView"
+                android:layout_marginLeft="@dimen/common_spacing_small" />
         </LinearLayout>
 
         <LinearLayout

+ 6 - 2
app/src/main/res/layout/fragment_step.xml

@@ -45,6 +45,7 @@
             android:id="@+id/ll_detail"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
+            android:gravity="center_vertical"
             android:orientation="horizontal"
             app:layout_constraintBottom_toBottomOf="@id/tv_title"
             app:layout_constraintRight_toRightOf="parent"
@@ -58,17 +59,20 @@
 
             <TextView
                 android:id="@+id/tv_worker"
-                style="@style/CommonTextView" />
+                style="@style/CommonTextView"
+                android:layout_marginLeft="@dimen/common_spacing_small" />
 
             <ImageView
                 android:id="@+id/iv_lock"
                 android:layout_width="@dimen/common_icon_size_small"
                 android:layout_height="@dimen/common_icon_size_small"
+                android:layout_marginLeft="@dimen/common_spacing"
                 android:src="@mipmap/ticket_lock" />
 
             <TextView
                 android:id="@+id/tv_lock"
-                style="@style/CommonTextView" />
+                style="@style/CommonTextView"
+                android:layout_marginLeft="@dimen/common_spacing_small" />
         </LinearLayout>
 
         <LinearLayout

+ 6 - 2
app/src/main/res/layout/fragment_worker.xml

@@ -46,6 +46,7 @@
             android:id="@+id/ll_detail"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
+            android:gravity="center_vertical"
             android:orientation="horizontal"
             app:layout_constraintBottom_toBottomOf="@id/tv_title"
             app:layout_constraintRight_toRightOf="parent"
@@ -59,17 +60,20 @@
 
             <TextView
                 android:id="@+id/tv_worker"
-                style="@style/CommonTextView" />
+                style="@style/CommonTextView"
+                android:layout_marginLeft="@dimen/common_spacing_small" />
 
             <ImageView
                 android:id="@+id/iv_lock"
                 android:layout_width="@dimen/common_icon_size_small"
                 android:layout_height="@dimen/common_icon_size_small"
+                android:layout_marginLeft="@dimen/common_spacing"
                 android:src="@mipmap/ticket_lock" />
 
             <TextView
                 android:id="@+id/tv_lock"
-                style="@style/CommonTextView" />
+                style="@style/CommonTextView"
+                android:layout_marginLeft="@dimen/common_spacing_small" />
         </LinearLayout>
 
         <LinearLayout