package com.lz.modules.app.enums;

import com.google.common.collect.Lists;

import java.util.List;

/**
 * @Author: djc
 * @Desc:
 * @Date: 2020/9/14 9:38
 */
public enum  ResultRecordStatusEnum {
    CREATE(0,"新建"),
    AUDIT(1,"提交审批中"),
    REFUSE(2,"拒绝"),
    WAIT_COMMIT(3,"侍提交"),
    AGREE(4,"审批通过"),
    REJECT(5,"驳回"),
    APPEAL(6,"申述"),
    SUSPEND(7,"流程中止"),

    //组合状态
    PROCESS(108,"审核中"),
    FINISH(109,"已完成");

    private int status;
    private String desc;

    ResultRecordStatusEnum(int status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    public static List<Integer> getGroupStatus(Integer status){
        if(status ==null){
            return null;
        }
        if(status == PROCESS.getStatus()){
            return Lists.newArrayList(AUDIT.getStatus(),WAIT_COMMIT.getStatus(),REJECT.getStatus(),APPEAL.getStatus());
        }
        if(status == FINISH.getStatus()){
            return Lists.newArrayList(REFUSE.getStatus(),AGREE.getStatus(),SUSPEND.getStatus());
        }
        return Lists.newArrayList(status);

    }



    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
