package com.bohuikeji.delivery.backstage.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bohuikeji.frame.module.admin.annotation.TableKeyField;
import com.bohuikeji.frame.module.admin.annotation.TableNewField;
import com.bohuikeji.frame.module.admin.annotation.TableQueryField;
import com.bohuikeji.frame.module.admin.annotation.TableShowField;
import com.bohuikeji.frame.module.admin.base.EntityBase;
import com.bohuikeji.frame.module.admin.constant.RegEx;
import com.bohuikeji.frame.module.admin.entity.TFranchiseeInformation;
import com.bohuikeji.frame.module.admin.entity.web.block.DateBlock;
import com.bohuikeji.frame.module.admin.entity.web.block.FileBlock;
import com.bohuikeji.frame.module.admin.entity.web.block.SelectBlock;
import com.bohuikeji.frame.module.admin.entity.web.block.TextBlock;
import com.bohuikeji.frame.module.admin.enums.ColumnTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * <p>
 * 派送员信息表
 * </p>
 *
 * @author 10552
 * @since 2019-08-22
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="TCourierTypeExamine对象", description="派送员信息表")
@TableName("t_courier_type_examine")
public class TCourierTypeExamine extends EntityBase<TCourierTypeExamine> {

    @ApiModelProperty(value="申请id")
    @TableId(value = "examine_id", type = IdType.AUTO)
    @TableShowField(value = "ID",id = true)
    @TableNewField(show = false)
    private Integer examineId;

    @ApiModelProperty(value = "员工编号")
    @TableField("courier_number")
    @TableQueryField(show = false)
    @TableShowField(value = "员工编号")
    @TableNewField(edit = false)
    private String courierNumber;

    @ApiModelProperty(value = "配送员姓名")
    @TableField("courier_name")
    @TableQueryField(show = false)
    @TableShowField(value = "配送员姓名",show = false)
    @TableNewField(edit = false)
    private String courierName;

    @ApiModelProperty(value = "配送员姓名")
    @TableField("courier_id")
    @TableKeyField(table = "t_courier",keyShowFields = {"courier_name"},keyLikeFields = {"courier_name"},where = "courier_auth='认证成功'  and fran_id in(##FRAN_IDS##)",key = TCourier.class)
    @TableShowField(value = "配送员姓名")
    @TableQueryField(like = false)
    @TableNewField(edit = false,block = SelectBlock.class,add = false,required = false)
    private Integer courierId;


    @ApiModelProperty(value = "配送员手机号")
    @TableField("courier_phone")
    @TableShowField(value = "配送员手机号")
    @TableNewField(limit = RegEx.INTEGER,edit = false)
    @TableQueryField(show = false)
    private String courierPhone;

    @ApiModelProperty(value = "性别")
    @TableField("courier_gender")
    @TableShowField("性别")
    @TableNewField(options = {"男","女"},edit = false)
    @TableQueryField(like = false)
    private String courierGender;

    @ApiModelProperty(value = "身份证号")
    @TableField("courier_card")
    @TableShowField(value = "身份证号",show = false)
    @TableNewField(edit = false,show = false)
    private String courierCard;

    @ApiModelProperty(value = "身份证照片")
    @TableField("courier_card_url")
    @TableShowField(value = "身份证照片",type = ColumnTypeEnum.IMAGE)
    @TableNewField(block = FileBlock.class,edit = false)
    private String courierCardUrl;

    @ApiModelProperty(value = "合同协议")
    @TableField("courier_cont_url")
    @TableShowField(value = "合同协议",type = ColumnTypeEnum.IMAGE)
    @TableNewField(block = FileBlock.class,required = false)
    private String courierContUrl;

    @ApiModelProperty(value = "保险证明")
    @TableField("courier_ins_url")
    @TableShowField(value = "保险证明",type = ColumnTypeEnum.IMAGE)
    @TableNewField(block = FileBlock.class,required = false)
    private String courierInsUrl;

    @ApiModelProperty(value = "申请类型(全职、兼职、营销)")
    @TableField("apply_type")
    @TableQueryField
    @TableShowField(value = "申请类型")
    @TableNewField(options = {"全职","兼职","营销"},edit = false)
    private String applyType;

    @ApiModelProperty(value = "原有类型(全职、兼职、营销)")
    @TableField("courier_type")
    @TableQueryField
    @TableShowField(value = "原有类型")
    @TableNewField(options = {"全职","兼职","营销"},edit = false)
    private String courierType;

    @ApiModelProperty(value = "申请状态")
    @TableField("examine_status")
    @TableQueryField
    @TableShowField(value = "申请状态")
    @TableNewField(edit = false)
    private String examineStatus="审核中";


    @ApiModelProperty(value = "申请创建时间")
    @TableField("examine_create_time")
    @TableShowField("注册时间")
    @TableNewField(show = false,edit = false)
    @TableQueryField(like = false,sort = 0)
    private LocalDateTime courierCreateTime=LocalDateTime.now();

    @ApiModelProperty(value = "申请更新时间")
    @TableField("examine_update_time")
    @TableShowField(value = "更新时间",show = false)
    @TableNewField(block = DateBlock.class,edit = false)
    private LocalDateTime courierUpdateTime;

    @ApiModelProperty(value = "加盟商id")
    @TableField("fran_id")
    @TableShowField(value = "所属加盟商")
    @TableNewField(block = SelectBlock.class,edit = false)
    @TableQueryField
    @TableKeyField(table = "t_franchisee_information",keyShowFields = "fran_name", where = "fran_id in(##FRAN_IDS##)",key = TFranchiseeInformation.class)
    private Integer franId;

    @ApiModelProperty(value = "加盟商审核（待审核，已审核）")
    @TableField("fran_exam")
    @TableQueryField(show = false)
    @TableShowField(value = "加盟商审核")
    @TableNewField
    private String franExam="待审核";

    @ApiModelProperty(value = "加盟商审核人")
    @TableField("fran_audit_user")
    @TableQueryField(show = false)
    @TableShowField(value = "加盟商审核人")
    @TableNewField(edit = false)
    private String franAuditUser;


    @ApiModelProperty(value = "平台审核（待审核，已审核）")
    @TableField("platform_exam")
    @TableQueryField(show = false)
    @TableShowField(value = "平台审核")
    @TableNewField(edit = false)
    private String platformExam="待审核";

    @ApiModelProperty(value = "平台审核人")
    @TableField("platform_audit_user")
    @TableQueryField(show = false)
    @TableShowField(value = "平台审核人")
    @TableNewField(edit = false)
    private String platformAuditUser;

    @ApiModelProperty(value = "驳回说明")
    @TableField("examine_desc")
    @TableQueryField(show = false)
    @TableShowField(value = "驳回说明")
    @TableNewField(block = TextBlock.class,required = false)
    private String examineDesc;

}
