package com.ycgis.macall.personalcenter.m.adapterbean;

import com.rs.macall.androidx.basemodel.utils.StringUtil;
import com.ycgis.macall.personalcenter.R;

/**
 * created by:   Macall
 * create time:  2023/6/2 11:07
 * copyright:    @ruansee.com
 * Describe:    应用申请
 */
public class ApplyBean extends BaseBean {
    private String id;
    private String name;
    private String code;
    private String userId;
    private String sysName;
    private String sysId;
    private String roleName;
    private int type;
    private String time;
    private String phone;
    private String applyReason;

    private String reviewComments;

    private String node;

    private boolean isSel = false;
    //多选
    private boolean isMore = false;

    /**
     * 状态码
     * 10   默认普通新增未审核   11  单位审核通过  12  单位审核不通过
     * 20   市局直属新增未审核   21  市局审核通过  22  市局审核不通过
     * 30   省厅直属新增未审核   31  省厅审核通过  32  省厅审核不通过
     * 1    完成
     * 0    删除
     */
    private int state;
    private String deptCode;
    private String deptName;
    private String idCordNum;

    public String getSysId() {
        return sysId;
    }

    public void setSysId(String sysId) {
        this.sysId = sysId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getApplyReason() {
        return StringUtil.get(applyReason,"暂无");
    }

    public String getApplyReasonStr() {
        return "申请原因：" +getApplyReason();
    }

    public void setApplyReason(String applyReason) {
        this.applyReason = applyReason;
    }

    public String getReviewComments() {
        return reviewComments;
    }

    public void setReviewComments(String reviewComments) {
        this.reviewComments = reviewComments;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getNameStr() {
        return String.format(" 申 请 人：%s(%s)", name, code);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getSysName() {
        return sysName;
    }

    public String getSysNameStr() {
        return "系统名称：" + sysName;
    }

    public void setSysName(String sysName) {
        this.sysName = sysName;
    }

    public String getRoleNameStr() {
        return "权限名称：" + StringUtil.get(roleName,"暂无");
    }

    public String getRoleName() {
        return roleName;
    }

    public String getAuthorityStr() {
        StringBuilder builder = new StringBuilder();
        builder.append("<font color=\"#323232\">权限名称:</font>");
        if (roleName == null){
            builder.append("<font color=\"#323232\">暂无</font>");
        }else if (roleName.contains("普通")){
            builder.append("<font color=\"#323232\">");
            builder.append(roleName);
            builder.append("</font>");
        }else {
            builder.append("<font color=\"#fb8c00\">");
            builder.append(roleName);
            builder.append("</font>");
        }
        return builder.toString();
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public String getTypeStr() {
        String s = type == 1 ? "申请" : "撤销";
        return "操作类型：" + s;
    }
    public int getType() {
        return type;
    }

    public String getTypeStr2() {
        return type == 1 ? "申请" : "撤销";
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getTimeStr() {
        return "申请时间：" + time;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public boolean isSel() {
        return isSel;
    }

    public void setSel(boolean sel) {
        isSel = sel;
    }

    public boolean isMore() {
        return isMore;
    }

    public void setMore(boolean more) {
        isMore = more;
    }

    /**
     * 状态码
     * 10   默认普通新增未审核   11  单位审核通过  12  单位审核不通过
     * 20   市局直属新增未审核   21  市局审核通过  22  市局审核不通过
     * 30   省厅直属新增未审核   31  省厅审核通过  32  省厅审核不通过
     * 1    完成
     * 0    删除
     */
    public int stateBG() {
        switch (state) {
            case 1:
                return R.drawable.bk_ls;
            case 10:
            case 20:
            case 30:
            case 11:
            case 21:
            case 31:
            default:
                return R.drawable.bk_hs;
            case 22:
            case 32:
            case 12:
            case 0:
                return R.drawable.bk_read;
        }
    }

    /**
     * 状态码
     * 10   默认普通新增未审核   11  单位审核通过  12  单位审核不通过
     * 20   市局直属新增未审核   21  市局审核通过  22  市局审核不通过
     * 30   省厅直属新增未审核   31  省厅审核通过  32  省厅审核不通过
     * 1    完成
     * 0    删除
     */
    public int stateColor() {
        switch (state) {
            case 1:
                return R.color.colorGreen7;
            case 10:
            case 20:
            case 30:
            case 11:
            case 21:
            case 31:
            default:
                return R.color.colorYellow7;
            case 22:
            case 32:
            case 12:
            case 0:
                return R.color.colorRed7;
        }
    }

    /**
     * 状态码
     * 10   默认普通新增未审核   11  单位审核通过  12  单位审核不通过
     * 20   市局直属新增未审核   21  市局审核通过  22  市局审核不通过
     * 30   省厅直属新增未审核   31  省厅审核通过  32  省厅审核不通过
     * 1    完成
     * 0    删除
     */
    public String getStateStr() {
        switch (state) {
            case 0:
                return "删除";
            case 1:
                return "完成";
            case 10:
            case 20:
            case 30:
            case 11:
            case 21:
            case 31:
            default:
                return "待审核";
            case 22:
            case 32:
            case 12:
                return "不通过";
        }
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getDeptCode() {
        return deptCode;
    }

    public void setDeptCode(String deptCode) {
        this.deptCode = deptCode;
    }

    public String getDeptNameStr() {
        return "所属单位：" + deptName;
    }

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public String getIdCordNumStr() {
        return "身份证号：" + idCordNum;
    }

    public String getIdCordNum() {
        return idCordNum;
    }

    public void setIdCordNum(String idCordNum) {
        this.idCordNum = idCordNum;
    }

    public String getNodeStr() {
        return "当前节点：" + node;
    }

    public String getNode() {
        return node;
    }

    public void setNode(String node) {
        this.node = node;
    }
}
