左晓为主开发手持机充值管理机
zuoxiao
6 天以前 9a2399d1a0003d1f2935720474b325639454178d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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 CleanCard : CardOperationType(6, "清零卡")
    object CheckCard : CardOperationType(7, "检查卡")
 
    companion object {
        fun fromCode(code: Int): CardOperationType? {
            return when (code) {
                1 -> OpenCard
                2 -> Recharge
                3 -> CancelCard
                4 -> ReplaceCard
                5 -> DeductCard
                else -> null
            }
        }
    }