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

import com.fasterxml.jackson.annotation.JsonFormat;
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 java.util.Date;

/**
  描述:business_fill_attendance的实体类
 */
@Data
@ApiModel(value = "business_fill_attendance的实体类")
public class FillAttendance {
	/**
	 * 编号
	 */
	@ApiModelProperty(value = "编号")
	private String id;
	/**
	 *申请人ID
	 */
	@ApiModelProperty(value = "申请人ID")
	private Long personId;
	/**
	 *申请人姓名
	 */
	@ApiModelProperty(value = "申请人姓名")
	private String personName;

	@ApiModelProperty(value = "申请人照片")
	private String faceImageUrl;
	/**
	 *申请人ID
	 */
	@ApiModelProperty(value = "编号")
	private String companyName;
	/**
	 *申请类型:外勤打卡:1、补卡:2
	 */
	@ApiModelProperty(value = "申请类型:外勤打卡:1、补卡:2")
	private String type;
	/**
	 *申请类型翻译
	 */
	@ApiModelProperty(value = "申请类型翻译")
	private String typeN;
	/**
	 *补卡日
	 */
	@ApiModelProperty(value = "补卡日")
	private String fillDay;
	/**
	 *补卡时间
	 */
	@ApiModelProperty(value = "补卡时间")
	private String fillAttendanceTime;
	/**
	 *内容
	 */
	@ApiModelProperty(value = "内容")
	private String content;
	/**
	 *审核人ID
	 */
	@ApiModelProperty(value = "审核人ID")
	private Long approvalPersonId;
	/**
	 *审核人姓名
	 */
	@ApiModelProperty(value = "审核人姓名")
	private String approvalPersonName;
	/**
	 *状态0：审核中，1：同意，2：拒绝
	 */
	@ApiModelProperty(value = "状态")
	private String status;

	@ApiModelProperty(value = "状态翻译")
	private String statusN;

	/**
	 *创建人
	 */
	@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;

	/**
	 * 考勤表对应id
	 */
	@ApiModelProperty(value = "考勤表对应id")
	private String businessWorkAttendanceId;

	/**
	 * 审核编号
	 */
	@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;

	/**
	 * 审核意见
	 */
	private String approvalContent;

	/**
	 * 经度
	 */
	@ApiModelProperty(value = "经度")
	private String longitude;

	/**
	 * 纬度
	 */
	@ApiModelProperty(value = "纬度")
	private String latitude;

	@ApiModelProperty(value = "地址")
	private String address;

	@ApiModelProperty(value = "工作状态")
	private String workStatus;

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


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

	private String approvalPersonPopedomId;


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


}