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

import java.io.Serializable;
import java.util.Date;
import java.text.SimpleDateFormat;
import java.math.BigDecimal;

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

/**
 * 描述:base_business_out的实体类
 */
@Data
@ApiModel(value = "base_business_out的实体类")
public class BusinessOut {
    @ApiModelProperty(value = "")
    private String id;
    @ApiModelProperty(value = "人员id")
    private String personPopedomId;
    @ApiModelProperty(value = "类型（1：外出，3：出差）")
    private String type;
    @ApiModelProperty(value = "目的地")
    private String destination;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ApiModelProperty(value = "开始时间")
    private Date startTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ApiModelProperty(value = "结束时间")
    private Date endTime;
    @ApiModelProperty(value = "预估天数")
    private String estimatedTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ApiModelProperty(value = "预估时间")
    private Date estimatedDate;
    @ApiModelProperty(value = "内容")
    private String content;
    @ApiModelProperty(value = "审批人id")
    private String approvalPersonPopedomId;
    @ApiModelProperty(value = "审批状态: -99：草稿，0：待处理，1：同意，2：退回，3：拒绝")
    private String status;
    @ApiModelProperty(value = "审批编号")
    private String approvalNo;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ApiModelProperty(value = "审核时间")
    private Date approvalTime;
    @ApiModelProperty(value = "审核意见")
    private String approvalContent;
    @ApiModelProperty(value = "审批人id（包含历史记录）")
    private String approvalPersonIdStr;
    @ApiModelProperty(value = "审批状态（包含历史记录）")
    private String approvalStatusStr;
    @ApiModelProperty(value = "审核时间（包含历史记录）")
    private String approvalTimeStr;
    @ApiModelProperty(value = "审核意见（包含历史记录）")
    private String approvalContentStr;
    @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 = "备注")
    private String remark;
    @ApiModelProperty(value = "流程实例编号")
    private String procinstId;
    @ApiModelProperty(value = "工作汇报")
    private String workReport;

    public String getTypeN() {
        String text = "";

        if ("1".equals(type)) {
            text = "外出";
        } else if ("3".equals(type)) {
            text = "出差";
        }

        return text;
    }

    public String getStatusN() {
      //  String text = "";

        String text = TypeNameUtil.getExamineTypeName(status);
       /* if ("0".equals(status)) {
            text = "待审核";
        } else if ("1".equals(status)) {
            text = "同意";
        }else if ("2".equals(status)){
            text = "退回";
        }
        else if ("3".equals(status)) {
            text = "拒绝";
        }*/

        return text;
    }

    @ApiModelProperty(value = "用户ID")
    private Long personId;
    @ApiModelProperty(value = "用户姓名")
    private String personName;
    @ApiModelProperty(value = "用户角色名称")
    private String personRoleName;
    @ApiModelProperty(value = "用户公司ID")
    private String personCompanyId;
    @ApiModelProperty(value = "用户公司")
    private String personCompanyName;
    @ApiModelProperty(value = "工号")
    private String jobNumber;

    @ApiModelProperty(value = "审批人id")
    private Long approvalPersonId;
    @ApiModelProperty(value = "审批人姓名")
    private String approvalPersonName;
    @ApiModelProperty(value = "审批人角色名称")
    private String approvalPersonRoleName;
}