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

import java.util.Date;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.payment.task.domain.MerTaskEnroll;
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 java.io.Serial;
import java.io.Serializable;
import java.util.Date;



/**
 * 任务的报名视图对象 mer_task_enroll
 *
 * @author LionLi
 * @date 2024-04-08
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = MerTaskEnroll.class)
public class MerTaskEnrollVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

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

    private Long cost;


    /**
     * 项目子编号
     */
    @ExcelProperty(value = "项目子编号")
    private String no;

    /**
     * 项目编号
     */
    @ExcelProperty(value = "项目编号")
    private String taskNo;


    private String name;

    private String phone;

    private String cardId;

    private Integer isHide;

    public String getPhone() {

        if(isHide != null){
            return StringUtils.phoneHide(phone);
        }
        return phone;

    }

    public String getCardId() {
        if(isHide != null){
            return StringUtils.idcardHide(cardId);
        }
        return cardId;
    }

    /**
     * 任务id
     */
    @ExcelProperty(value = "任务id")
    private Long taskId;

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

    /**
     * 自雇者微信openid
     */
    @ExcelProperty(value = "自雇者微信openid")
    private String workOpenid;

    /**
     * 竞标状态（1:竞标中 2:竞标失败 3:竞标成功）
     */
    @ExcelProperty(value = "竞标状态", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "1=:竞标中,2=:竞标失败,3=:竞标成功")
    private Long verifyStatus;

    /**
     * 选定审核人
     */
    @ExcelProperty(value = "选定审核人")
    private String verifyBy;

    /**
     * 选定审核时间
     */
    @ExcelProperty(value = "选定审核时间")
    private Date verifyTime;

    /**
     * 完工状态（0:未完成 1:已完成 2:验收驳回 3:验收通过 ）
     */
    @ExcelProperty(value = "完工状态", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "0=:未完成,1=:已完成,2=:验收驳回,3=:验收通过")
    private Integer taskStatus;

    /**
     * 验收备注
     */
    @ExcelProperty(value = "验收备注")
    private String taskRemark;

    /**
     * 结算状态（0:待结算 1:已结算）
     */
    @ExcelProperty(value = "结算状态", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "0=:待结算,1=:已结算")
    private Integer settlementStatus;

    /**
     * 任务确认书文件地址
     */
    @ExcelProperty(value = "任务确认书文件地址")
    private String taskConfirmFile;

    /**
     * 交付内容
     */
    @ExcelProperty(value = "交付内容")
    private String taskDesc;

    /**
     * 交付图片
     */
    @ExcelProperty(value = "交付图片")
    private String taskPic;

    /**
     * 报名时间
     */
    @ExcelProperty(value = "报名时间")
    private Date addTime;


    private String workerName;

    @ExcelIgnore
    private Integer payStatus;
}
