This commit is contained in:
zxj
2025-07-08 15:40:39 +08:00
parent d2698ed60f
commit 4501b6d5fc
132 changed files with 8998 additions and 0 deletions
@@ -0,0 +1,51 @@
package com.sw.inbound
import android.net.Uri
import com.sw.inbound.model.response.DictType
import com.sw.inbound.model.response.User
object GlobalData {
/**
* 登录后的用户信息
*/
var user: User? = null
/**
* 采集图片uri
*/
var imageUri: Uri? = null
var storageTypeList: List<DictType> = arrayListOf()
var goodsTypeList: List<DictType> = arrayListOf()
var warehouseTypeList: List<DictType> = arrayListOf()
var supplierTypeList: List<DictType> = arrayListOf()
var unitTypeList: List<DictType> = arrayListOf()
fun getStorageType(id: Int): String {
return storageTypeList.find { it.id == id }?.value ?: "默认"
}
fun getGoodsType(id: Int): String {
return goodsTypeList.find { it.id == id }?.value ?: "-"
}
fun getWarehouseType(id: Int): String {
return warehouseTypeList.find { it.id == id }?.value ?: "-"
}
fun getSupplierType(id: Int): String {
return supplierTypeList.find { it.id == id }?.value ?: "-"
}
fun getUnitType(id: Int): String {
return unitTypeList.find { it.id == id }?.value ?: "-"
}
}
/**
*
*/
object GlobalKey {
const val KEY_TOKEN = "tokenKey"
const val KEY_USER_INFO = "userInfoKey"
}