Przeglądaj źródła

完成首页点位显示

Frankensteinly 8 miesięcy temu
rodzic
commit
e105e88626

+ 0 - 1
app/src/main/java/com/grkj/iscs/view/dialog/LoginDialog.kt

@@ -68,7 +68,6 @@ class LoginDialog(val presenter: LoginPresenter?, val ctx: Context, private var
                 FingerprintUtil.start()
                 FingerprintUtil.setScanListener(object : FingerprintUtil.OnScanListener {
                     override fun onScan(bitmap: Bitmap) {
-
                         presenter?.fingerprintLogin(bitmap) { isSuccess, cardInfoRespVO, userInfoRespVO ->
                             if (isSuccess) {
                                 dismiss()

+ 20 - 13
app/src/main/java/com/grkj/iscs/view/fragment/WorkshopFragment.kt

@@ -63,22 +63,29 @@ class WorkshopFragment(val changePage: (PageChangeBO) -> Unit) :
                     LogUtil.e("Map pic is null")
                     return@loadBitmapFromUrl
                 }
-
                 mBinding?.mapview?.loadMap(it)
-                presenter?.getWorkstationTicketList {
-                    if (it == null) {
-                        return@getWorkstationTicketList
-                    }
-                    jobStatisticList.forEach { itJob ->
-                        itJob.count = it.count { it.ticketType == itJob.sopType.type.toString() }
+
+                presenter?.getMapPointPage {
+                    mPointList.clear()
+                    it?.records?.forEach { itPoint ->
+                        mPointList.add(CustomPoint(PointF(itPoint.x!!.toFloat() + 100, itPoint.y!!.toFloat()), itPoint.entityName!!, itPoint.entityId!!, mutableListOf()))
                     }
-                    mPointList.forEach { itPoint ->
-                        itPoint.ticketList = it.filter { it.workstationId == itPoint.workstationId }.toMutableList()
+                    presenter?.getWorkstationTicketList {
+                        if (it == null) {
+                            return@getWorkstationTicketList
+                        }
+                        jobStatisticList.forEach { itJob ->
+                            itJob.count = it.count { it.ticketType == itJob.sopType.type.toString() }
+                        }
+                        mPointList.forEach { itPoint ->
+                            itPoint.ticketList = it.filter { it.workstationId == itPoint.workstationId }.toMutableList()
+                        }
+                        mBinding?.rvStatistics?.adapter?.notifyDataSetChanged()
+                        // 重新load之后,会自动复位
+//                        mBinding?.mapview?.currentRotateDegrees = 0f
+//                        mBinding?.mapview?.currentZoom = 1f
+                        mBinding?.mapview?.refresh()
                     }
-                    mBinding?.rvStatistics?.adapter?.notifyDataSetChanged()
-                    mBinding?.mapview?.currentRotateDegrees = 0f
-                    mBinding?.mapview?.currentZoom = 1f
-                    mBinding?.mapview?.refresh()
                 }
             }
         }

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

@@ -7,6 +7,7 @@ import com.bumptech.glide.load.engine.GlideException
 import com.bumptech.glide.request.RequestListener
 import com.bumptech.glide.request.target.Target
 import com.grkj.iscs.model.vo.map.MapInfoRespVO
+import com.grkj.iscs.model.vo.map.MapPointPageRespVO
 import com.grkj.iscs.model.vo.ticket.WorkstationTicketListRespVO
 import com.grkj.iscs.util.Executor
 import com.grkj.iscs.util.NetApi
@@ -31,6 +32,14 @@ class WorkshopPresenter : BasePresenter<IWorkshopView>() {
         }
     }
 
+    fun getMapPointPage(callBack: (MapPointPageRespVO?) -> Unit) {
+        NetApi.getMapPointPage(1, -1, 1) {
+            Executor.runOnMain {
+                callBack(it)
+            }
+        }
+    }
+
     fun loadBitmapFromUrl(url: String, callback: (Bitmap?) -> Unit) {
         try {
             Glide.with(mContext!!)