package org.dromara.payment.worker.domain.vo;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.payment.worker.domain.UserWorkerAuthorized;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import org.dromara.payment.worker.domain.UserWorkerAuthorized;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;



/**
 * 授权协议视图对象 user_worker_authorized
 *
 * @author LionLi
 * @date 2024-04-29
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = UserWorkerAuthorized.class)
public class UserWorkerAuthorizedVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @ExcelProperty(value = "主键")
    private Long id;

    /**
     * 自雇者id
     */
    @ExcelProperty(value = "自雇者id")
    private Long workId;

    /**
     * 运营商id
     */
    @ExcelProperty(value = "运营商id")
    private Long opId;

    /**
     * 运营商编号
     */
    @ExcelProperty(value = "运营商编号")
    private String opNo;

    /**
     * 签约状态（0:待签约 1:签约中 2:已签约 3:归档失败）
     */
    @ExcelProperty(value = "签约状态", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "0=:待签约,1=:签约中,2=:已签约,3=:归档失败")
    private Integer signStatus;

    private Date createTime;

    public String getSignStatusStr() {
        if(this.signStatus != null){
            switch (this.signStatus){
                case 0:
                   return  "未签约";
                case 1:
                    return  "签约中";
                case 2:
                    return "已签约";
                case 3:
                    return "归档失败";
                default:
                    return "未签约";
            }
        }else{
            return "未签约";
        }
    }

    private String signStatusStr;



    /**
     * 合同编号
     */
    @ExcelProperty(value = "合同编号")
    private String no;

    /**
     * 签约时间
     */
    @ExcelProperty(value = "签约时间")
    private Date signTime;

    /**
     * 签约文件地址
     */
    @ExcelProperty(value = "签约文件地址")
    private String signFileUrl;

    /**
     * 协议签字图片
     */
    @ExcelProperty(value = "协议签字图片")
    private String signPic;

    private String opName;

    private String workName;


    public String getCardId() {
        if(this.cardId != null){
            return StringUtils.idcardHide(this.cardId);
        }else{
            return "--";
        }
    }

    private String cardId;




}
