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

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

import java.math.BigDecimal;
import java.util.Date;


@Data
@ApiModel(value = "用户每日考勤")
public class PersonInfoDayWSADTO {
    @ApiModelProperty(value = "用户信息")
    private PersonInfo personInfo;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-ddEEEE", timezone = "GMT+8")
    @ApiModelProperty(value = "日期")
    private Date attendanceDate;
    @ApiModelProperty(value = "班次")
    private String shiftIds;
    @ApiModelProperty(value = "班次编号")
    private String shiftNumbers;
    @ApiModelProperty(value = "上班打卡情况")
    private String onWorkResult;
    public String getOnWorkResultN(){
        String text = "";

        if("0".equals(onWorkResult)){
            text = "缺卡";
        }
        else if("1".equals(onWorkResult)){
            text = "";
        }
        else if("2".equals(onWorkResult)){
            text = "迟到";
        }
        else if("3".equals(onWorkResult)){
            text = "早退";
        }
        else if("9".equals(onWorkResult)){
            text = "出差";
        }
        else if("10".equals(onWorkResult)){
            text = "休息";
        }
        else if("11".equals(onWorkResult)){
            text = "补卡";
        }
        else if("12".equals(onWorkResult)){
            text = "加班";
        }
        else if("13".equals(onWorkResult)){
            text = "请假";
        }
        else if("14".equals(onWorkResult)){
            text = "年假";
        }
        else if("50".equals(onWorkResult)){
            text = "未打卡";
        }
        return text;
    }
    @ApiModelProperty(value = "上班工作状态")
    private String onWorkStatus;
    @ApiModelProperty(value = "上班工作状态")
    private String onWorkStatusN;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ApiModelProperty(value = "上班打卡时间")
    private Date onWorkRecordTime;
    @ApiModelProperty(value = "上班迟到,早退时长(分钟)")
    private BigDecimal onLateLeaveMinute;
    @ApiModelProperty(value = "上班迟到,早退时长(分钟) 转时分")
    private String onLateLeaveMinuteN;

    @ApiModelProperty(value = "下班打卡情况")
    private String offWorkResult;
    public String getOffWorkResultN(){
        String text = "";

        if("0".equals(offWorkResult)){
            text = "缺卡";
        }
        else if("1".equals(offWorkResult)){
            text = "";
        }
        else if("2".equals(offWorkResult)){
            text = "迟到";
        }
        else if("3".equals(offWorkResult)){
            text = "早退";
        }
        else if("9".equals(offWorkResult)){
            text = "出差";
        }
        else if("10".equals(offWorkResult)){
            text = "休息";
        }
        else if("11".equals(offWorkResult)){
            text = "补卡";
        }
        else if("12".equals(offWorkResult)){
            text = "加班";
        }
        else if("13".equals(offWorkResult)){
            text = "请假";
        }
        else if("14".equals(offWorkResult)){
            text = "年假";
        }
        else if("50".equals(offWorkResult)){
            text = "未打卡";
        }
        return text;
    }
    @ApiModelProperty(value = "下班工作状态")
    private String offWorkStatus;
    @ApiModelProperty(value = "下班工作状态")
    private String offWorkStatusN;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ApiModelProperty(value = "下班打卡时间")
    private Date offWorkRecordTime;
    @ApiModelProperty(value = "下班迟到,早退时长(分钟)")
    private BigDecimal offLateLeaveMinute;
    @ApiModelProperty(value = "下班迟到,早退时长(分钟) 转时分")
    private String offLateLeaveMinuteN;
    /**************************************1*******************************/
    @ApiModelProperty(value = "上班打卡情况")
    private String onWorkResult1;
    public String getOnWorkResult1N(){
        String text = "";

        if("0".equals(onWorkResult1)){
            text = "缺卡";
        }
        else if("1".equals(onWorkResult1)){
            text = "";
        }
        else if("2".equals(onWorkResult1)){
            text = "迟到";
        }
        else if("3".equals(onWorkResult1)){
            text = "早退";
        }
        else if("9".equals(onWorkResult1)){
            text = "出差";
        }
        else if("10".equals(onWorkResult1)){
            text = "休息";
        }
        else if("11".equals(onWorkResult1)){
            if(StringUtils.isNotEmpty(onSupplementWork1)) {
                text = "补卡," + onSupplementWork1;
            }else{
                text = "补卡";
            }
        }
        else if("12".equals(onWorkResult1)){
            text = "加班";
        }
        else if("13".equals(onWorkResult1)){
            text = "请假";
        }
        else if("14".equals(onWorkResult1)){
            text = "年假";
        }
        else if("50".equals(onWorkResult1)){
            text = "未打卡";
        }
        return text;
    }
    @ApiModelProperty(value = "上班工作状态")
    private String onWorkStatus1;
    @ApiModelProperty(value = "上班工作状态")
    private String onWorkStatus1N;
    @DateTimeFormat(pattern = "HH:mm")
    @JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
    @ApiModelProperty(value = "上班打卡时间")
    private Date onWorkRecordTime1;
    @ApiModelProperty(value = "上班迟到,早退时长(分钟)")
    private BigDecimal onLateLeaveMinute1;
    @ApiModelProperty(value = "上班迟到,早退时长(分钟) 转时分")
    private String onLateLeaveMinute1N;

    @ApiModelProperty(value = "下班打卡情况")
    private String offWorkResult1;
    public String getOffWorkResult1N(){
        String text = "";

        if("0".equals(offWorkResult1)){
            text = "缺卡";
        }
        else if("1".equals(offWorkResult1)){
            text = "";
        }
        else if("2".equals(offWorkResult1)){
            text = "迟到";
        }
        else if("3".equals(offWorkResult1)){
            text = "早退";
        }
        else if("9".equals(offWorkResult1)){
            text = "出差";
        }
        else if("10".equals(offWorkResult1)){
            text = "休息";
        }
        else if("11".equals(offWorkResult1)){
            if(StringUtils.isNotEmpty(offSupplementWork1)) {
                text = "补卡," + offSupplementWork1;
            }else{
                text = "补卡";
            }
        }
        else if("12".equals(offWorkResult1)){
            text = "加班";
        }
        else if("13".equals(offWorkResult1)){
            text = "请假";
        }
        else if("14".equals(offWorkResult1)){
            text = "年假";
        }
        else if("50".equals(offWorkResult1)){
            text = "未打卡";
        }
        return text;
    }
    @ApiModelProperty(value = "下班工作状态")
    private String offWorkStatus1;
    @ApiModelProperty(value = "下班工作状态")
    private String offWorkStatus1N;
    @DateTimeFormat(pattern = "HH:mm")
    @JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
    @ApiModelProperty(value = "下班打卡时间")
    private Date offWorkRecordTime1;
    @ApiModelProperty(value = "下班迟到,早退时长(分钟)")
    private BigDecimal offLateLeaveMinute1;
    @ApiModelProperty(value = "下班迟到,早退时长(分钟) 转时分")
    private String offLateLeaveMinute1N;

    @ApiModelProperty(value = "上班补卡原因1")
    private String onSupplementWork1;
    @ApiModelProperty(value = "下班补卡原因1")
    private String offSupplementWork1;

    /********************************************2********************/
    @ApiModelProperty(value = "上班打卡情况")
    private String onWorkResult2;
    public String getOnWorkResult2N(){
        String text = "";

        if("0".equals(onWorkResult2)){
            text = "缺卡";
        }
        else if("1".equals(onWorkResult2)){
            text = "";
        }
        else if("2".equals(onWorkResult2)){
            text = "迟到";
        }
        else if("3".equals(onWorkResult2)){
            text = "早退";
        }
        else if("9".equals(onWorkResult2)){
            text = "出差";
        }
        else if("10".equals(onWorkResult2)){
            text = "休息";
        }
        else if("11".equals(onWorkResult2)){
            if(StringUtils.isNotEmpty(onSupplementWork2)) {
                text = "补卡," + onSupplementWork2;
            }else{
                text = "补卡";
            }
        }
        else if("12".equals(onWorkResult2)){
            text = "加班";
        }
        else if("13".equals(onWorkResult2)){
            text = "请假";
        }
        else if("14".equals(onWorkResult2)){
            text = "年假";
        }
        else if("50".equals(onWorkResult2)){
            text = "未打卡";
        }
        return text;
    }
    @ApiModelProperty(value = "上班工作状态")
    private String onWorkStatus2;
    @ApiModelProperty(value = "上班工作状态")
    private String onWorkStatus2N;
    @DateTimeFormat(pattern = "HH:mm")
    @JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
    @ApiModelProperty(value = "上班打卡时间")
    private Date onWorkRecordTime2;
    @ApiModelProperty(value = "上班迟到,早退时长(分钟)")
    private BigDecimal onLateLeaveMinute2;
    @ApiModelProperty(value = "上班迟到,早退时长(分钟) 转时分")
    private String onLateLeaveMinute2N;

    @ApiModelProperty(value = "下班打卡情况")
    private String offWorkResult2;
    public String getOffWorkResult2N(){
        String text = "";

        if("0".equals(offWorkResult2)){
            text = "缺卡";
        }
        else if("1".equals(offWorkResult2)){
            text = "";
        }
        else if("2".equals(offWorkResult2)){
            text = "迟到";
        }
        else if("3".equals(offWorkResult2)){
            text = "早退";
        }
        else if("9".equals(offWorkResult2)){
            text = "出差";
        }
        else if("10".equals(offWorkResult2)){
            text = "休息";
        }
        else if("11".equals(offWorkResult2)){
            if(StringUtils.isNotEmpty(offSupplementWork2)) {
                text = "补卡," + offSupplementWork2;
            }else{
                text = "补卡";
            }
        }
        else if("12".equals(offWorkResult2)){
            text = "加班";
        }
        else if("13".equals(offWorkResult2)){
            text = "请假";
        }
        else if("14".equals(offWorkResult2)){
            text = "年假";
        }
        else if("50".equals(offWorkResult2)){
            text = "未打卡";
        }
        return text;
    }
    @ApiModelProperty(value = "下班工作状态")
    private String offWorkStatus2;
    @ApiModelProperty(value = "下班工作状态")
    private String offWorkStatus2N;
    @DateTimeFormat(pattern = "HH:mm")
    @JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
    @ApiModelProperty(value = "下班打卡时间")
    private Date offWorkRecordTime2;
    @ApiModelProperty(value = "下班迟到,早退时长(分钟)")
    private BigDecimal offLateLeaveMinute2;
    @ApiModelProperty(value = "下班迟到,早退时长(分钟) 转时分")
    private String offLateLeaveMinute2N;
    @ApiModelProperty(value = "上班补卡原因2")
    private String onSupplementWork2;
    @ApiModelProperty(value = "下班补卡原因2")
    private String offSupplementWork2;

    /*********************************************3**********************/
    @ApiModelProperty(value = "上班打卡情况")
    private String onWorkResult3;
    public String getOnWorkResult3N(){
        String text = "";

        if("0".equals(onWorkResult3)){
            text = "缺卡";
        }
        else if("1".equals(onWorkResult3)){
            text = "";
        }
        else if("2".equals(onWorkResult3)){
            text = "迟到";
        }
        else if("3".equals(onWorkResult3)){
            text = "早退";
        }
        else if("9".equals(onWorkResult3)){
            text = "出差";
        }
        else if("10".equals(onWorkResult3)){
            text = "休息";
        }
        else if("11".equals(onWorkResult3)){
            if(StringUtils.isNotEmpty(onSupplementWork3)) {
                text = "补卡," + onSupplementWork3;
            }else{
                text = "补卡";
            }
        }
        else if("12".equals(onWorkResult3)){
            text = "加班";
        }
        else if("13".equals(onWorkResult3)){
            text = "请假";
        }
        else if("14".equals(onWorkResult3)){
            text = "年假";
        }
        else if("50".equals(onWorkResult3)){
            text = "未打卡";
        }
        return text;
    }
    @ApiModelProperty(value = "上班工作状态")
    private String onWorkStatus3;
    @ApiModelProperty(value = "上班工作状态")
    private String onWorkStatus3N;
    @DateTimeFormat(pattern = "HH:mm")
    @JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
    @ApiModelProperty(value = "上班打卡时间")
    private Date onWorkRecordTime3;
    @ApiModelProperty(value = "上班迟到,早退时长(分钟)")
    private BigDecimal onLateLeaveMinute3;
    @ApiModelProperty(value = "上班迟到,早退时长(分钟) 转时分")
    private String onLateLeaveMinute3N;

    @ApiModelProperty(value = "下班打卡情况")
    private String offWorkResult3;
    public String getOffWorkResult3N(){
        String text = "";

        if("0".equals(offWorkResult3)){
            text = "缺卡";
        }
        else if("1".equals(offWorkResult3)){
            text = "";
        }
        else if("2".equals(offWorkResult3)){
            text = "迟到";
        }
        else if("3".equals(offWorkResult3)){
            text = "早退";
        }
        else if("9".equals(offWorkResult3)){
            text = "出差";
        }
        else if("10".equals(offWorkResult3)){
            text = "休息";
        }
        else if("11".equals(offWorkResult3)){
            if(StringUtils.isNotEmpty(offSupplementWork3)) {
                text = "补卡," + offSupplementWork3;
            }else{
                text = "补卡";
            }
        }
        else if("12".equals(offWorkResult3)){
            text = "加班";
        }
        else if("13".equals(offWorkResult3)){
            text = "请假";
        }
        else if("14".equals(offWorkResult3)){
            text = "年假";
        }
        else if("50".equals(offWorkResult3)){
            text = "未打卡";
        }
        return text;
    }
    @ApiModelProperty(value = "下班工作状态")
    private String offWorkStatus3;
    @ApiModelProperty(value = "下班工作状态")
    private String offWorkStatus3N;
    @DateTimeFormat(pattern = "HH:mm")
    @JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
    @ApiModelProperty(value = "下班打卡时间")
    private Date offWorkRecordTime3;
    @ApiModelProperty(value = "下班迟到,早退时长(分钟)")
    private BigDecimal offLateLeaveMinute3;
    @ApiModelProperty(value = "下班迟到,早退时长(分钟) 转时分")
    private String offLateLeaveMinute3N;
    @ApiModelProperty(value = "上班补卡原因3")
    private String onSupplementWork3;
    @ApiModelProperty(value = "下班补卡原因3")
    private String offSupplementWork3;

    @ApiModelProperty(value = "旷工天数")
    private BigDecimal absenteeismDays ;
    @ApiModelProperty(value = "未刷次数")
    private Integer notSwipingNum;

    @ApiModelProperty(value = "工作时长")
    private String workTimes;
}