|
|
@@ -20,8 +20,10 @@ import java.io.IOException
|
|
|
|
|
|
/**
|
|
|
* 车间岗位页
|
|
|
+ *
|
|
|
+ * @param changePage: page页、workstationId、ticketId
|
|
|
*/
|
|
|
-class WorkshopFragment :
|
|
|
+class WorkshopFragment(val changePage: (Int, Long, Long?) -> Unit) :
|
|
|
BaseMvpFragment<IWorkshopView, WorkshopPresenter, FragmentWorkshopBinding>() {
|
|
|
|
|
|
private lateinit var jobStatisticList: MutableList<JobStatistics>
|
|
|
@@ -40,8 +42,7 @@ class WorkshopFragment :
|
|
|
JobStatistics(Constants.SOP_PRE_MAINTENANCE, 0),
|
|
|
JobStatistics(Constants.SOP_CHANGE_SHIFTS, 0),
|
|
|
JobStatistics(Constants.SOP_CLEAN, 0),
|
|
|
- JobStatistics(Constants.SOP_SWITCH_PRODUCT, 0)
|
|
|
- )
|
|
|
+ JobStatistics(Constants.SOP_SWITCH_PRODUCT, 0))
|
|
|
|
|
|
mBinding?.rvStatistics?.adapter = object : CommonAdapter<JobStatistics>(requireActivity(), R.layout.item_rv_job_management, jobStatisticList) {
|
|
|
override fun convert(holder: ViewHolder, statistic: JobStatistics, position: Int) {
|
|
|
@@ -65,7 +66,7 @@ class WorkshopFragment :
|
|
|
itJob.count = it.count { it.ticketType == itJob.sopType.type.toString() }
|
|
|
}
|
|
|
mPointList.forEach { itPoint ->
|
|
|
- itPoint.ticketList = it.filter { it.workstationId?.toInt() == itPoint.workstationId }.toMutableList()
|
|
|
+ itPoint.ticketList = it.filter { it.workstationId == itPoint.workstationId }.toMutableList()
|
|
|
}
|
|
|
mBinding?.rvStatistics?.adapter?.notifyDataSetChanged()
|
|
|
initMap()
|
|
|
@@ -87,9 +88,13 @@ class WorkshopFragment :
|
|
|
markLayer = CustomMarkLayer(mBinding?.mapview, mPointList)
|
|
|
markLayer?.setMarkIsClickListener(object : CustomMarkLayer.MarkIsClickListener {
|
|
|
override fun markIsClick(index: Int, btnIndex: Int) {
|
|
|
- ToastUtils.tip(mPointList[index].name + " is selected, btnIndex is " + btnIndex)
|
|
|
+// ToastUtils.tip(mPointList[index].name + " is selected, btnIndex is " + btnIndex)
|
|
|
+ if (btnIndex == -1) {
|
|
|
+ changePage(1, mPointList[index].workstationId, null)
|
|
|
+ } else {
|
|
|
+ changePage(2, mPointList[index].workstationId, mPointList[index].ticketList[btnIndex].ticketId)
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
})
|
|
|
mBinding?.mapview?.addLayer(markLayer)
|
|
|
mBinding?.mapview?.refresh()
|
|
|
@@ -107,5 +112,5 @@ class WorkshopFragment :
|
|
|
|
|
|
data class JobStatistics(var sopType: Constants.SopType, var count: Int)
|
|
|
|
|
|
- data class CustomPoint(val pos: PointF, val name: String, val workstationId: Int, var ticketList: MutableList<WorkstationTicketListRespVO>)
|
|
|
+ data class CustomPoint(val pos: PointF, val name: String, val workstationId: Long, var ticketList: MutableList<WorkstationTicketListRespVO>)
|
|
|
}
|