package com.ruoyi.web.work.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.validate.Regexp;
import com.ruoyi.web.work.domain.base.BaseData;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author lsw
 * @date 2024-04-16
 */
@Data
@TableName(value = "tb_company")
@Accessors(chain = true)
public class Company extends BaseData {
    private static final long serialVersionUID = 1L;

    private Long id;

    @NotBlank(message = "企业名称不能为空")
    @ApiModelProperty(value = "企业名称")
    @Excel(name = "企业名称", width = 35)
    private String companyName;

    @NotBlank(message = "企业方负责人不能为空")
    @ApiModelProperty(value = "企业方负责人")
    @Excel(name = "企业方负责人")
    private String director;

    @ApiModelProperty(value = "邮箱")
    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式不对")
    @Excel(name = "邮箱", width = 27)
    private String email;

    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = Regexp.PHONE, message = "手机号不合法")
    @ApiModelProperty(value = "手机号")
    @Excel(name = "手机号")
    private String phone;

    @NotBlank(message = "开户行不能为空")
    @ApiModelProperty(value = "开户行")
    @Excel(name = "开户行",width = 42)
    private String bankName;

    @NotBlank(message = "对公账号不能为空")
    @ApiModelProperty(value = "对公账号")
    @Excel(name = "对公账号",width = 26)
    private String bankAccount;

    @ApiModelProperty(value = "余额")
    @Excel(name = "账户余额")
    private BigDecimal money;

    @NotBlank(message = "请上传开户许可证照片")
    @ApiModelProperty(value = "开户许可证照片")
    private String b1;

    @NotBlank(message = "请上传营业执照")
    @ApiModelProperty(value = "营业执照")
    private String business;

    @ApiModelProperty(value = "账户状态:0=正常,1=停用")
    @Excel(name = "账户状态", readConverterExp = "0=正常,1=停用")
    private Integer state;

    @NotBlank(message = "联系地址不能为空")
    @ApiModelProperty(value = "联系地址")
    @Excel(name = "联系地址",width = 50)
    private String address;

    @TableField(fill = FieldFill.INSERT)
    private String createBy;

    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "创建时间", dateFormat = "yyyy-MM-dd HH:mm:ss", width = 26)
    private Date createTime;

    @TableField(fill = FieldFill.UPDATE)
    private String updateBy;

    @TableField(fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @TableField(exist = false)
    private String userName;

    @TableField(exist = false)
    private String password;

    @TableField(exist = false)
    private Integer peoples;
}
