package com.jpsoft.shinestar.modules.common.utils;

import com.jpsoft.shinestar.modules.sys.entity.DataDictionary;
import com.jpsoft.shinestar.modules.sys.service.DataDictionaryService;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author 墨鱼_mo
 * @date 2021-5-6 10:36
 */
@Data
public class TypeNameUtil {

    public static String getOperationName(String formId){
        String operationName = "";

        //调班
        if ("exchangeWork".equals(formId)){
            operationName = "1";
        }
        //请假
        if ("leaveWork".equals(formId)){
            operationName = "2";
        }
        //出差
        if ("travelWork".equals(formId)){
            operationName = "3";
        }
        //补卡
        if ("applyWork".equals(formId)){
            operationName = "4";
        }
        //批量补卡
        if ("batchApplyWork".equals(formId)){
            operationName = "5";
        }
        //批量加班
        if ("batchExtraWork".equals(formId)){
            operationName = "6";
        }
        //加班
        if ("extraWork".equals(formId)){
            operationName = "7";
        }
        //携物出厂
        if ("commerceWork".equals(formId)){
            operationName = "8";
        }
        //待客进餐
        if ("treatWork".equals(formId)){
            operationName = "9";
        }

        //年假
        if ("yearLeaveWork".equals(formId)){
            operationName = "11";
        }


        return operationName;
    }

    public static String getOperationNameStr(String type){
        String operationNameStr = "";

        //调班
        if ("1".equals(type)){
            operationNameStr = "调班";
        }
        //请假
        if ("2".equals(type)){
            operationNameStr = "请假";
        }
        //出差
        if ("3".equals(type)){
            operationNameStr = "出差";
        }
        //补卡
        if ("4".equals(type)){
            operationNameStr = "补卡";
        }
        //批量补卡
        if ("5".equals(type)){
            operationNameStr = "批量补卡";
        }
        //批量加班
        if ("6".equals(type)){
            operationNameStr = "批量加班";
        }
        //加班
        if ("7".equals(type)){
            operationNameStr = "加班";
        }
        //携物出厂
        if ("8".equals(type)){
            operationNameStr = "携物出厂";
        }
        //待客进餐
        if ("9".equals(type)){
            operationNameStr = "接待进餐";
        }
        //年假
        if ("11".equals(type)){
            operationNameStr = "年假";
        }


        return operationNameStr;
    }


    public static String getExamineTypeName(String status){
        String examineTypeName = "";
        if ("0".equals(status)){
            examineTypeName = "审核中";
        }
        if ("1".equals(status)){
            examineTypeName = "同意";
        }
        if ("2".equals(status)){
            examineTypeName = "退回";
        }
        if ("3".equals(status)){
            examineTypeName = "拒绝";
        }
        if ("4".equals(status)){
            examineTypeName = "无需审核";
        }
        if ("5".equals(status)){
            examineTypeName = "未提交";
        }
        if ("6".equals(status)){
            examineTypeName = "已撤销";
        }
        if ("-99".equals(status)){
            examineTypeName = "草稿";
        }
        return examineTypeName;
    }

    public static String getActionName(String type,String action){
        String actionName = "";
        if ("1".equals(type)){
            if ("0".equals(action)){
                actionName = "待审核";
            }
            if ("1".equals(action)){
                actionName = "同意";
            }
            if ("2".equals(action)){
                actionName = "退回";
            }
            if ("3".equals(action)){
                actionName = "拒绝";
            }
        }
        if ("2".equals(type)){
            if ("0".equals(action)){
                actionName = "未读";
            }
            if ("1".equals(action)){
                actionName = "已读";
            }
        }
        return actionName;

    }

    public static String getTypeName(String type){
        String typeName = "";
        if ("1".equals(type)){
            typeName = "个人申请";
        }
        if ("2".equals(type)){
            typeName = "上级安排";
        }

        return typeName;
    }

    public static String getLeaveTypeName(String leaveType) {

        String leaveTypeName = "请假";
        if ("1".equals(leaveType)){
            leaveTypeName = "事假";
        }
        if ("2".equals(leaveType)){
            leaveTypeName = "病假";
        }
        if ("3".equals(leaveType)){
            leaveTypeName = "其他";
        }
        if ("4".equals(leaveType)){
            leaveTypeName = "调休";
        }
        if ("5".equals(leaveType)){
            leaveTypeName = "婚假";
        }
        if ("6".equals(leaveType)){
            leaveTypeName = "丧假";
        }

        return leaveTypeName;

    }
}
