package com.zbf.system.domain;

import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zbf.common.annotation.Excel;
import com.zbf.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.apache.poi.ss.usermodel.IndexedColors;

import java.lang.reflect.Field;
import java.math.BigDecimal;

/**
 * 供应商管理对象 t_base_provider
 *
 * @author sunits
 * @date 2024-06-16
 */
@TableName(resultMap = "com.zbf.system.mapper.TBaseProviderMapper.TBaseProviderResult")
public class TBaseProvider extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 供应商编号
     */
    @Excel(name = "供应商编号", required = true, headerColor = IndexedColors.RED)
    private String providerId;

    /**
     * 供应商类别编号
     */
    @Excel(name = "供应商类别编号")
    private String proTypeId;

    /**
     * 供应商名称
     */
    @Excel(name = "供应商名称", required = true, headerColor = IndexedColors.RED)
    private String providerName;

    /**
     * 拼音简称
     */
    @Excel(name = "拼音简称")
    private String pyName;

    /**
     * 详细地址
     */
    private String address;

    /**
     * 联系人
     */
    private String contact;

    /**
     * 联系电话
     */
    private String phone;

    /**
     * 联系人手机
     */
    private String mobile;

    /**
     * 联系传真
     */
    private String fax;

    /**
     * 邮箱
     */
    private String email;

    /**
     * 邮编编码
     */
    private String postCode;

    /**
     * 开户银行
     */
    private String bank;

    /**
     * 账号名称
     */
    private String accountName;

    /**
     * 账号
     */
    private String account;

    /**
     * 预计到货天数
     */
    private BigDecimal arrDays;

    /**
     * 供应商等级
     */
    private String providerLevel;

    /**
     * 合格率
     */
    private BigDecimal percent;

    /**
     * 性质
     */
    private String nature;

    /**
     * 网站
     */
    private String website;

    /**
     * 法人代表
     */
    private String legalMan;

    /**
     * 所属地址
     */
    private String areaId;

    /**
     * 注册地址
     */
    private String regAddress;

    /**
     * 发票抬头
     */
    private String invoiceTitle;

    /**
     * 税号
     */
    private String taxNumber;

    /**
     * 付款方式
     */
    private String payTypeId;

    /**
     * 发票邮寄地址
     */
    private String invoiceAddress;

    /**
     * 收件人
     */
    private String recipient;

    /**
     * 收件人电话
     */
    private String recPhone;

    /**
     * 收件人传真
     */
    private String recFax;

    /**
     * 收件人邮箱
     */
    private String recEmail;

    /**
     * 版本号
     */
    private String version;

    /**
     * 选中的数据
     */
    private String[] selectIds;

    public static JSONArray getColumnsJson() {
        JSONArray columns = new JSONArray();
        Field[] fields = TBaseProvider.class.getDeclaredFields();
        int key = 0;
        for (Field field : fields) {
            Excel excelAnnotation = field.getAnnotation(Excel.class);
            if (excelAnnotation != null) {
                JSONObject column = new JSONObject();
                column.put("seq", key++);
                column.put("key", field.getName());
                column.put("label", excelAnnotation.name());
                column.put("visible", true);  // 假设所有列默认都是可见的
                column.put("columnName", field.getName());  // 设置列ID
                columns.put(column);
            }
        }
        return columns;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setProviderId(String providerId) {
        this.providerId = providerId;
    }

    public String getProviderId() {
        return providerId;
    }

    public void setProTypeId(String proTypeId) {
        this.proTypeId = proTypeId;
    }

    public String getProTypeId() {
        return proTypeId;
    }

    public void setProviderName(String providerName) {
        this.providerName = providerName;
    }

    public String getProviderName() {
        return providerName;
    }

    public void setPyName(String pyName) {
        this.pyName = pyName;
    }

    public String getPyName() {
        return pyName;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getAddress() {
        return address;
    }

    public void setContact(String contact) {
        this.contact = contact;
    }

    public String getContact() {
        return contact;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPhone() {
        return phone;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getMobile() {
        return mobile;
    }

    public void setFax(String fax) {
        this.fax = fax;
    }

    public String getFax() {
        return fax;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getEmail() {
        return email;
    }

    public void setPostCode(String postCode) {
        this.postCode = postCode;
    }

    public String getPostCode() {
        return postCode;
    }

    public void setBank(String bank) {
        this.bank = bank;
    }

    public String getBank() {
        return bank;
    }

    public void setAccountName(String accountName) {
        this.accountName = accountName;
    }

    public String getAccountName() {
        return accountName;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getAccount() {
        return account;
    }

    public void setArrDays(BigDecimal arrDays) {
        this.arrDays = arrDays;
    }

    public BigDecimal getArrDays() {
        return arrDays;
    }

    public void setProviderLevel(String providerLevel) {
        this.providerLevel = providerLevel;
    }

    public String getProviderLevel() {
        return providerLevel;
    }

    public void setPercent(BigDecimal percent) {
        this.percent = percent;
    }

    public BigDecimal getPercent() {
        return percent;
    }

    public void setNature(String nature) {
        this.nature = nature;
    }

    public String getNature() {
        return nature;
    }

    public void setWebsite(String website) {
        this.website = website;
    }

    public String getWebsite() {
        return website;
    }

    public void setLegalMan(String legalMan) {
        this.legalMan = legalMan;
    }

    public String getLegalMan() {
        return legalMan;
    }

    public void setAreaId(String areaId) {
        this.areaId = areaId;
    }

    public String getAreaId() {
        return areaId;
    }

    public void setRegAddress(String regAddress) {
        this.regAddress = regAddress;
    }

    public String getRegAddress() {
        return regAddress;
    }

    public void setInvoiceTitle(String invoiceTitle) {
        this.invoiceTitle = invoiceTitle;
    }

    public String getInvoiceTitle() {
        return invoiceTitle;
    }

    public void setTaxNumber(String taxNumber) {
        this.taxNumber = taxNumber;
    }

    public String getTaxNumber() {
        return taxNumber;
    }

    public void setPayTypeId(String payTypeId) {
        this.payTypeId = payTypeId;
    }

    public String getPayTypeId() {
        return payTypeId;
    }

    public void setInvoiceAddress(String invoiceAddress) {
        this.invoiceAddress = invoiceAddress;
    }

    public String getInvoiceAddress() {
        return invoiceAddress;
    }

    public void setRecipient(String recipient) {
        this.recipient = recipient;
    }

    public String getRecipient() {
        return recipient;
    }

    public void setRecPhone(String recPhone) {
        this.recPhone = recPhone;
    }

    public String getRecPhone() {
        return recPhone;
    }

    public void setRecFax(String recFax) {
        this.recFax = recFax;
    }

    public String getRecFax() {
        return recFax;
    }

    public void setRecEmail(String recEmail) {
        this.recEmail = recEmail;
    }

    public String getRecEmail() {
        return recEmail;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getVersion() {
        return version;
    }

    public String[] getSelectIds() {
        return selectIds;
    }

    public void setSelectIds(String[] selectIds) {
        this.selectIds = selectIds;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("providerId", getProviderId())
                .append("proTypeId", getProTypeId())
                .append("providerName", getProviderName())
                .append("pyName", getPyName())
                .append("address", getAddress())
                .append("contact", getContact())
                .append("phone", getPhone())
                .append("mobile", getMobile())
                .append("fax", getFax())
                .append("email", getEmail())
                .append("postCode", getPostCode())
                .append("bank", getBank())
                .append("accountName", getAccountName())
                .append("account", getAccount())
                .append("arrDays", getArrDays())
                .append("providerLevel", getProviderLevel())
                .append("percent", getPercent())
                .append("remark", getRemark())
                .append("nature", getNature())
                .append("website", getWebsite())
                .append("legalMan", getLegalMan())
                .append("areaId", getAreaId())
                .append("regAddress", getRegAddress())
                .append("invoiceTitle", getInvoiceTitle())
                .append("taxNumber", getTaxNumber())
                .append("payTypeId", getPayTypeId())
                .append("invoiceAddress", getInvoiceAddress())
                .append("recipient", getRecipient())
                .append("recPhone", getRecPhone())
                .append("recFax", getRecFax())
                .append("recEmail", getRecEmail())
                .append("version", getVersion())
                .append("createTime", getCreateTime())
                .append("createBy", getCreateBy())
                .append("updateTime", getUpdateTime())
                .append("updateBy", getUpdateBy())
                .toString();
    }
}


















