OASystem.kt 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. package com.pan_american.android
  2. import android.annotation.SuppressLint
  3. import android.app.Application
  4. import android.content.Context
  5. import com.amap.api.location.AMapLocationClient
  6. import com.amap.api.maps.MapsInitializer
  7. import com.amap.api.services.core.ServiceSettings
  8. import com.pan_american.android.data.model.common.entity.Selector
  9. import com.pan_american.android.data.model.common.entity.SiftListItem
  10. import com.pan_american.android.data.model.customer_resource.market_sales_revenue.entity.YearQuarterlyData
  11. import com.pan_american.android.data.model.group_hotel.hotel_predetermine.entity.UpdateHotelPredetermine
  12. import com.pan_american.android.data.model.group_management.entry_and_exit_fee_detail.network.EntryAndExitDetailResponse
  13. import com.pan_american.android.data.model.group_management.group_info.entity.GroupCustomerInfo
  14. import com.pan_american.android.data.model.group_management.group_info.network.GroupOperationRequest
  15. import com.pan_american.android.data.model.login.entity.Authority
  16. import com.pan_american.android.data.model.login.entity.UserInfo
  17. import com.pan_american.android.data.model.personnel_module.materials_operate.entity.MaterialTypeData
  18. class OASystem : Application() {
  19. companion object {
  20. @SuppressLint("StaticFieldLeak")
  21. // 上下文
  22. lateinit var context: Context
  23. //user Token
  24. var token = ""
  25. // 用户信息
  26. lateinit var userInfo: UserInfo
  27. // 权限列表
  28. lateinit var authData: ArrayList<Authority>
  29. //未读消息数
  30. var unReadCount = 0
  31. //公告未读条数
  32. var announcementUnReadCount = 0
  33. //日付申请,名称筛选列表
  34. lateinit var dailyPaymentUserName: ArrayList<Selector>
  35. //日付申请,类型筛选列表
  36. lateinit var paymentType: ArrayList<Selector>
  37. //日付申请,子类型筛选列表
  38. lateinit var paymentSubType: ArrayList<Selector>
  39. //市场客户资源,客户级别
  40. lateinit var customerLevel: ArrayList<Selector>
  41. //市场客户资源,客户类别
  42. lateinit var customerClass: ArrayList<Selector>
  43. //市场客户资源,负责人列表
  44. lateinit var customerManager: ArrayList<SiftListItem>
  45. //市场客户资源,业务归属
  46. lateinit var serviceClass: ArrayList<SiftListItem>
  47. //市场客户资源,省域
  48. lateinit var province: ArrayList<SiftListItem>
  49. //接团信息,团组类型
  50. var groupInfoGroupType = ArrayList<Selector>()
  51. //接团信息,客户级别
  52. var groupInfoCustomerLevel = ArrayList<Selector>()
  53. //接团信息,成单人
  54. var groupInfoTradeDirector = ArrayList<Selector>()
  55. //接团信息,接团客户名单
  56. var groupInfoGroupCustomerList = ArrayList<GroupCustomerInfo>()
  57. //接团信息,OP提成等级
  58. var groupInfoOpPercentageLevel = ArrayList<Selector>()
  59. //接团信息,舱位类型
  60. var groupInfoBerthType = ArrayList<Selector>()
  61. //接团信息,团组操作(增改)request
  62. lateinit var groupOperationRequest: GroupOperationRequest
  63. //地接费用录入,单位list
  64. var groundConveyUnitList = ArrayList<Selector>()
  65. //酒店费用录入,客户类型
  66. var hotelPredetermineCustomerType = ArrayList<Selector>()
  67. //酒店费用录入,支付方式
  68. var hotelPredeterminePaymentWay = ArrayList<Selector>()
  69. //酒店费用录入,团组汇率
  70. var hotelPredeterminePaymentCurrency = ArrayList<Selector>()
  71. //酒店费用录入,银行卡
  72. var hotelPredetermineBankCard = ArrayList<Selector>()
  73. //酒店费用录入,预订网站
  74. var hotelPredetermineHotelWebSite = ArrayList<Selector>()
  75. //酒店费用录入,入住类型
  76. var hotelPredetermineCheckInType = ArrayList<Selector>()
  77. //酒店费用录入,客人名单
  78. var hotelPredetermineCustomerList = ArrayList<Selector>()
  79. //酒店费用录入,国家 / 城市
  80. var hotelPredetermineCountries = ArrayList<Selector>()
  81. //酒店费用录入,费用操作(增改)request
  82. lateinit var hotelPredetermineRequest: UpdateHotelPredetermine
  83. var marketSalesRevenueCompanyList = ArrayList<Selector>()
  84. var marketSalesRevenueUserList = ArrayList<Selector>()
  85. var marketSalesRevenueDateList = ArrayList<YearQuarterlyData>()
  86. //物资进销存,基础数据源
  87. var materialBaseData = ArrayList<MaterialTypeData>()
  88. //导游地接资料,导游地接类型
  89. val guideResourceGuideType = listOf(Selector().apply {
  90. id = 0
  91. name = "公司"
  92. }, Selector().apply {
  93. id = 1
  94. name = "个人"
  95. })
  96. // 评分选择
  97. val score = listOf("5", "4", "3", "2", "1", "0")
  98. // 星级选择
  99. val level = listOf("★★★★★", "★★★★", "★★★", "★★", "★", "无")
  100. // 权重选择
  101. val weight = listOf(Selector().apply {
  102. id = 393
  103. name = "A"
  104. }, Selector().apply {
  105. id = 392
  106. name = "B"
  107. }, Selector().apply {
  108. id = 391
  109. name = "C"
  110. })
  111. //商邀费用 费用标识
  112. val paymentMark = listOf(Selector().apply {
  113. id = 0
  114. name = "公转"
  115. }, Selector().apply {
  116. id = 1
  117. name = "私转"
  118. })
  119. //团组对应币种单位
  120. var currency = ArrayList<Selector>()
  121. //接团信息,团组状态
  122. val groupStatus = listOf(Selector().apply {
  123. id = -1
  124. name = "全部"
  125. }, Selector().apply {
  126. id = 0
  127. name = "未完成"
  128. }, Selector().apply {
  129. id = 1
  130. name = "已完成"
  131. })
  132. //收款账单,增加方式
  133. val addMode = listOf(Selector().apply {
  134. id = 0
  135. name = "账单模块"
  136. }, Selector().apply {
  137. id = 1
  138. name = "成本预算模块"
  139. }, Selector().apply {
  140. id = 2
  141. name = "实际报价"
  142. }, Selector().apply {
  143. id = 3
  144. name = "超支费用"
  145. })
  146. //查看权限
  147. const val VIEW = 1
  148. // 删除权限
  149. const val DELETE = 2
  150. // 编辑权限
  151. const val EDIT = 3
  152. //下载权限
  153. const val DOWNLOAD = 4
  154. // 添加权限
  155. const val ADD = 11
  156. //审核权限
  157. const val PROCESS = 12
  158. // 通讯录模块
  159. const val ADDRESS_BOOK = 16
  160. // 日程安排模块
  161. const val ITINERARY = 17
  162. // 酒店信息
  163. const val HOTEL_RESOURCE = 23
  164. // 导游地接信息
  165. const val GUIDE_RESOURCE = 24
  166. // 邀请资料
  167. const val INVITE_DATA = 25
  168. // 接团信息
  169. // const val GROUP_INFORMATION = 26
  170. //团组操作
  171. const val GROUP_INFORMATION = 27
  172. //酒店预定
  173. const val HOTEL_PREDETERMINE = 28
  174. //邀请公务费用
  175. const val INVITE_OFFICIAL_PAYMENT = 29
  176. //地接费用录入
  177. const val GROUND_CONVEY_PAYMENT_INSERT = 30
  178. //签证费用录入
  179. const val VISA_PAYMENT_INSERT = 31
  180. //保险费用录入
  181. const val INSURANCE_PAYMENT_INSERT = 32
  182. // 日付申请模块
  183. const val DAILY_PAYMENT = 42
  184. // 团组费用审批模块
  185. const val EXPENSE_APPROVAL = 47
  186. //应收报表
  187. const val ACCOUNT_RECEIVABLE_REPORT = 53
  188. //收款退还
  189. const val PAYMENT_REFUND = 69
  190. // 市场客户资源
  191. const val MARKET_CUSTOMER = 89
  192. //团组经理主管,接团客户名单
  193. const val GROUP_CLIENT_LIST = 104
  194. //团组经理主管,倒推表
  195. const val REVERSE_TABLE = 106
  196. // 车辆公司信息
  197. const val CAR_RESOURCE = 111
  198. //团组经理主管,出入境费用明细
  199. const val ENTRY_AND_EXIT_FEE_DETAIL = 118
  200. // 机场三字码
  201. const val THREE_CODE_RESOURCE = 120
  202. //OP行程单
  203. const val OP_TRAVEL_ITINERARY = 122
  204. //机票费用录入
  205. const val AIRPLANE_PAYMENT_INSERT = 161
  206. //公务出访
  207. const val OFFICIAL_VISITS = 166
  208. //收款账单
  209. const val COLLECTION_BILL = 171
  210. //市场部营业额
  211. const val MARKET_SALES_REVENUE = 180
  212. //查看关联邀请方
  213. const val RELATED_INVITEE = 184
  214. //票据管理
  215. const val BILL_MANAGEMENT = 185
  216. //提成确认
  217. const val COMMISSION_CONFIRM = 188
  218. //物资进销存(物资领用)
  219. const val MATERIAL_APPLICATION = 191
  220. //CTableId
  221. //酒店预定
  222. const val C_TABLE_HOTEL_PREDETERMINE = 76
  223. //地接费用
  224. const val C_TABLE_GROUND_CONVEY = 79
  225. //签证费用
  226. const val C_TABLE_VISA = 80
  227. //商邀费用
  228. const val C_TABLE_INVITE_OFFICIAL = 81
  229. //保险费用
  230. const val C_TABLE_INSURANCE = 82
  231. //机票费用
  232. const val C_TABLE_AIRPLANE_TICKET = 85
  233. //收款退还
  234. const val C_TABLE_PAYMENT_REFUND = 98
  235. //文档下载
  236. const val C_TABLE_DOCUMENT_DOWNLOAD = 1081
  237. //支付方式-保险 ID
  238. const val PAYMENT_WAY_INSURANCE_ID = 1057
  239. // 权限判别
  240. fun authorization(pageId: Int, operation: Int): Boolean {
  241. authData.forEach {
  242. if (it.pageId == pageId) {
  243. if (it.opList.contains(operation)) {
  244. return true
  245. }
  246. }
  247. }
  248. return false
  249. }
  250. //判断userInfo是否被初始化
  251. fun isUserInfoInit(): Boolean {
  252. return this::userInfo.isInitialized
  253. }
  254. //拍照权限code
  255. const val CAMERA_REQUEST_CODE = 1001
  256. //相册权限code
  257. const val GALLERY_REQUEST_CODE = 1002
  258. //刷新主页消息和公告
  259. const val REFRESH_NAVIGATION = 2001
  260. //通知条数
  261. var notificationCount = 0
  262. //activity / fragment是否需要刷新
  263. var needRefresh = false
  264. //三公费用 返回体
  265. var entryAndExitDetailResponse = EntryAndExitDetailResponse()
  266. //三公费用 是否可编辑
  267. var entryAndExitDetailCanBeEdit = false
  268. }
  269. override fun onCreate() {
  270. super.onCreate()
  271. context = applicationContext
  272. //定位隐私政策同意
  273. AMapLocationClient.updatePrivacyShow(context,true,true)
  274. AMapLocationClient.updatePrivacyAgree(context,true)
  275. //地图隐私政策同意
  276. MapsInitializer.updatePrivacyShow(context,true,true)
  277. MapsInitializer.updatePrivacyAgree(context,true)
  278. //搜索隐私政策同意
  279. ServiceSettings.updatePrivacyShow(context,true,true)
  280. ServiceSettings.updatePrivacyAgree(context,true)
  281. }
  282. }