CreateTicketPresenter.kt 1011 B

12345678910111213141516171819202122232425262728293031323334
  1. package com.grkj.iscs.presenter
  2. import com.grkj.iscs.base.BasePresenter
  3. import com.grkj.iscs.iview.ICreateTicketView
  4. import com.grkj.iscs.model.UrlConsts
  5. import com.grkj.iscs.model.vo.SopPageVO
  6. import com.grkj.iscs.model.vo.TicketTypeVO
  7. import com.grkj.iscs.util.NetApi
  8. class CreateTicketPresenter : BasePresenter<ICreateTicketView>() {
  9. var mSopList = mutableListOf<SopPageVO.Record>()
  10. var mTicketTypeList = mutableListOf<TicketTypeVO>()
  11. fun initData() {
  12. NetApi.getTicketType {
  13. mTicketTypeList = it as MutableList<TicketTypeVO>
  14. }
  15. NetApi.getAutoCode(UrlConsts.AUTOCODE_TICKET_NUMBER) {
  16. println("getAutoCode : $it")
  17. }
  18. }
  19. fun getSopList() {
  20. NetApi.getSopPage(0, 10) {
  21. mSopList = it?.records as MutableList<SopPageVO.Record>
  22. mvpView?.showSopList(mSopList)
  23. }
  24. }
  25. fun getTicketTypeName(type: String): String? {
  26. return mTicketTypeList.find { it.dictValue == type }?.dictLabel
  27. }
  28. }