StdAccountEnum.java 1.74 KB
package pwc.taxtech.atms.constant.enums;

import java.util.HashMap;
import java.util.Map;

public class StdAccountEnum {

    public enum RuleType {
        TWO(2);
        private Integer code;

        RuleType(Integer code) {
            this.code = code;
        }

        public Integer getCode() {
            return code;
        }
    }

    public enum AcctProp {
        Asset("1", "资产"),
        Debt("2", "负债"),
        Joint("3", "共同"),
        Equity("4", "权益"),
        Cost("5", "成本"),
        Loss("6", "损益");
        private String code;
        private String name;
        public static final Map<String, String> MAPPING = new HashMap<>();

        AcctProp(String code, String name) {
            this.code = code;
            this.name = name;
        }

        public String getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        static {
            for (AcctProp acctProp : AcctProp.values()) {
                MAPPING.put(acctProp.getCode(), acctProp.getName());
            }
        }
    }

    public enum Direction {
        Debit(1, "借方"),
        Credit(-1, "贷方");
        private Integer code;
        private String name;
        public static final Map<Integer, String> MAPPING = new HashMap<>();

        Direction(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        static {
            for (Direction direction : Direction.values()) {
                MAPPING.put(direction.getCode(), direction.getName());
            }
        }
    }
}