package com.dayu.general.tool
|
|
/**
|
* 卡片操作类型
|
* 用于区分不同的卡片操作
|
*/
|
sealed class CardOperationType(val code: Int, val description: String) {
|
object OpenCard : CardOperationType(1, "开卡")
|
object Recharge : CardOperationType(2, "充值")
|
object CancelCard : CardOperationType(3, "销卡")
|
object ReplaceCard : CardOperationType(4, "补卡")
|
object DeductCard : CardOperationType(5, "补扣")
|
object SUPPLEMENT : CardOperationType(6, "返还")
|
object MANAGEMENT_CARD_WRITE : CardOperationType(7, "管理类型卡写卡")
|
|
// 管理卡制作操作类型(使用100+的代码)
|
object RegionCardMake : CardOperationType(100, "制作区域表号卡")
|
object CheckCardMake : CardOperationType(101, "制作检查卡")
|
object DebugCardMake : CardOperationType(102, "制作调试卡")
|
object CleanCardMake : CardOperationType(103, "制作清零卡")
|
object IpCardMake : CardOperationType(104, "制作IP设置卡")
|
object AreaCardMake : CardOperationType(105, "制作域名设置卡")
|
object GpsCardMake : CardOperationType(106, "制作GPS卡")
|
object ValveTimeCardMake : CardOperationType(107, "制作时间配置卡")
|
object ElectricPriceCardMake : CardOperationType(108, "制作取数卡")
|
|
companion object {
|
fun fromCode(code: Int): CardOperationType? {
|
return when (code) {
|
1 -> OpenCard
|
2 -> Recharge
|
3 -> CancelCard
|
4 -> ReplaceCard
|
5 -> DeductCard
|
6 -> SUPPLEMENT
|
7 -> MANAGEMENT_CARD_WRITE
|
// 管理卡制作操作类型
|
100 -> RegionCardMake
|
101 -> CheckCardMake
|
102 -> DebugCardMake
|
103 -> CleanCardMake
|
104 -> IpCardMake
|
105 -> AreaCardMake
|
106 -> GpsCardMake
|
107 -> ValveTimeCardMake
|
108 -> ElectricPriceCardMake
|
else -> null
|
}
|
}
|
}
|
}
|