<?php

namespace app\common\api;

/**
 * 人才申报状态
 *
 * @author sgq
 */
class TalentState {

    public const FST_SAVE = 1; //保存未提交
    public const FST_SUBMIT = 2; //已提交未审核
    public const BASE_VERIFY_PASS = 3; //已审核
    public const BASE_REJECT = 4; //驳回
    public const BASE_REVERIFY_PASS = 5;
    public const BASE_REVERIFY_REJECT = 6;
    public const BASE_REVERIFY_FAIL = 7;
    public const SCND_SAVE = 8; //旧：5，保存补充材料未提交
    public const SCND_SUBMIT = 9; //旧：6，提交补充材料进入初审
    public const FST_VERIFY_PASS = 10; //旧：7，初审通过
    public const FST_VERIFY_REJECT = 11; //旧：8初审驳回
    public const DEPT_VERIFY_PASS = 12; //旧：9部门审核通过
    public const DEPT_VERIFY_REJECT = 13; //旧：10部门审核驳回
    public const REVERIFY_PASS = 14; //旧：11复核通过
    public const REVERIFY_REJECT = 15; //旧：12复核驳回
    public const REVERIFY_FAIL = 16; //旧：13复核失败
    public const ZX_PASS = 21; //征信通过|待公示
    public const ZX_FAIL = 22; //征信失信|审核不通过
    public const ANNOUNCED = 23; //已公示
    public const ANNOUNCED_REVERIFY_PASS = 24; //公示再审核通过|待公布
    public const ANNOUNCED_REVERIFY_FAIL = 25; //公示再审核不通过
    public const PUBLISH_PASS = 26; //公布通过
    public const PUBLISH_FAIL = 27; //公布不通过
    public const CERTIFICATED = 28; //已发放人才码
    public const BASE_VERIFY_FAIL = -1; //条件验证失败
    public const FST_VERIFY_FAIL = -2; //初审失败
    public const FST_VERIFY_CANCEL = -13; //初审不通过撤销
    public const REVERIFY_CANCEL = -14; //复审撤销
    public const RCRD_BASIC_SAVE = -2;
    public const RCRD_BASIC_NOTPASS = -1;
    public const RCRD_BASIC_NEED = 1;
    public const RCRD_BASIC_REJECT = 2;
    public const RCRD_BASIC_PASS = 3;
    public const RCRD_BASIC_UPREJECT = 4;
    public const RCRD_BASEIC_SUBMIT = 8;
    public const RCRD_BASEIC_RESUBMIT = 9;
    public const RCRD_BASEIC_FROZEN = 10;
    public const RCRD_BASEIC_CANCLE = 11;
    public const BASIC_SAVE = -1;
    public const BASIC_NEED = 1;
    public const BASIC_REJECT = 2;
    public const BASIC_PASS = 3;
    public const BASIC_RESUBMIT = 9;

    public static function getStateName($state) {
        switch ($state) {
            case -14:
                return "撤销复核";
            case -2:
                return "初审不通过";
            case 1:
                return "保存未提交";
            case 2:
                return "待基础审核";
            case 3:
                return "基础审核通过";
            case 4:
                return "基础审核驳回";
            case 5:
                return "基础复核通过";
            case 6:
                return "基础复核驳回";
            case 7:
                return "基础复核失败";
            case 8:
                return "保存未提交";
            case 9:
                return "待初审";
            case 10:
                return "初审通过";
            case 11:
                return "初审驳回";
            case 12:
                return "部门并审通过";
            case 13:
                return "部门并审驳回";
            case 14:
                return "复审通过";
            case 15:
                return "复审驳回";
            case 16:
                return "复审不通过";
            case -1:
                return "基础审核不通过";
            case -2:
                return "初审不通过";
            case 21:
                return "待公示";
            case 22:
                return "征信不通过";
            case 23:
                return "已公示";
            case 24:
                return "待公布";
            case 25:
                return "公示审核不通过";
            case 26:
                return "公布通过";
            case 27:
                return "公布不通过";
            case 28:
                return "已发放人才码";
        }
    }

    public static function stateEnum($code) {
        switch ($code) {
            case -2:
                return "<span class='label label-success'>待提交</span>";
                break;
            case -1:
                return "<span class='label label-success'>审核不通过</span>";
                break;
            case 1:
                return "<span class='label label-success'>待审核</span>";
                break;
            case 2:
                return "<span class='label label-danger'>审核驳回</span>";
                break;
            case 3:
                return "<span class='label label-primary'>审核通过</span>";
                break;
            case 4:
                return "<span class='label label-warm'>上级驳回</span>";
                break;
            case 5:
                return "<span class='label label-danger'>初审驳回</span>";
                break;
            case 6:
                return "<span class='label label-primary'>初审通过</span>";
                break;
            case 8:
                return "<span class='label label-primary'>提交审核</span>";
                break;
            case 9:
                return "<span class='label label-primary'>重新提交</span>";
                break;
            case 10:
                return "<span class='label label-default'>冻结</span>";
                break;
            case 11:
                return "<span class='label label-primary'>撤销审核</span>";
                break;
        }
    }

}
