package com.jpsoft.shinestar.modules.business.entity;

import java.util.Date;

import com.jpsoft.shinestar.modules.common.utils.TypeNameUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 描述:business_request_for_leave_info的实体类
 */
@Data
@ApiModel(value = "business_request_for_leave_info的实体类")
public class RequestForLeaveInfo {

    @ApiModelProperty(value = "编号")
    private String id;

    @ApiModelProperty(value = "请假类型（1：事假，2：病假，3：其它，4：调休，5:婚假，6：丧假）")
    private String leaveType;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ApiModelProperty(value = "开始时间")
    private Date startTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ApiModelProperty(value = "结束时间")
    private Date endTime;

    @ApiModelProperty(value = "上传照片")
    private String imageUrl;

    @ApiModelProperty(value = "请假理由")
    private String reason;

    @ApiModelProperty(value = "请假人ID")
    private Long personId;

    @ApiModelProperty(value = "申请人的角色id")
    private String personPopedomId;

    @ApiModelProperty(value = "审批人ID")
    private Long approvedId;

    @ApiModelProperty(value = "审批人身份id")
    private String approvedPersonPopedomId;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "创建人")
    private String createBy;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "更新人")
    private String updateBy;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    @ApiModelProperty(value = "是否删除")
    private Boolean delFlag = false;

    @ApiModelProperty(value = "状态 -99-草稿，0-未处理，1-已批准，2-已退回，3-已拒绝，6-撤销")
    private Integer status;

    @ApiModelProperty(value = "审批意见")
    private String approvalOpinions;

    @ApiModelProperty(value = "意见说明")
    private String approvalExplain;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ApiModelProperty(value = "审批时间")
    private Date approvedTime;

    @ApiModelProperty(value = "请假人头像")
    private String faceImageUrl;

    @ApiModelProperty(value = "姓名")
    private String studentName;

    @ApiModelProperty(value = "身份证号")
    private String idCard;

    @ApiModelProperty(value = "请假类型(名称)")
    private String leaveTypeN;

    @ApiModelProperty(value = "班级编号")
    private String classId;

    @ApiModelProperty(value = "班级名称")
    private String className;

    @ApiModelProperty(value = "姓名")
    private String approvedName;

    @ApiModelProperty(value = "开始时间段（0：上午，1：下午）")
    private String startTimeQuantum;

    @ApiModelProperty(value = "结束时间段（0：上午，1：下午）")
    private String endTimeQuantum;

    @ApiModelProperty(value = "请假天数")
    private String days;

    @ApiModelProperty(value = "流程实例编号")
    private String procinstId;

    @ApiModelProperty(value = "审批人id（包含历史记录）")
    private String approvalPersonIdStr;
    @ApiModelProperty(value = "审批状态（包含历史记录）")
    private String approvalStatusStr;
    @ApiModelProperty(value = "审核时间（包含历史记录）")
    private String approvalTimeStr;
    @ApiModelProperty(value = "审核意见（包含历史记录）")
    private String approvalContentStr;

    @ApiModelProperty(value = "销假状态0：审核中，1：同意，2：退回，3：拒绝，4：无需审核,5：待提交")
    private String cancelStatus = "5";

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ApiModelProperty(value = "销假时间")
    private Date cancelTime;

    @ApiModelProperty(value = "销假凭证")
    private String cancelImages;

    @ApiModelProperty(value = "能否销假")
    private Boolean enableCancel = false;

    public String getStatusN() {
        String text = TypeNameUtil.getExamineTypeName(String.valueOf(status));
        return text;
        /*if (Integer.valueOf(0).equals(status)) {
            return "未处理";
        } else if (Integer.valueOf(1).equals(status)) {
            return "已批准";
        } else if (Integer.valueOf(2).equals(status)) {
            return "已拒绝";
        } else {
            return "";
        }*/
    }
}