package com.ruoyi.project.system.domain;

import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;
import com.ruoyi.project.system.enums.CalculateEnum;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 商品材质
 *
 * @author zhu
 * @date 2023-10-24
 */
@Data
@Accessors(chain = true)
public class ProductMaterial extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    private Long id;

    /**
     * 材质名称
     */
    @Excel(name = "材质名称")
    private String title;

    /**
     * 是否使用自己的计算
     */
    @Excel(name = "是否使用自己的计算")
    private Boolean isUseSelf;

    /**
     * 计算
     */
    @Excel(name = "计算")
    private String compute;

    /**
     * 商品id
     */
    @Excel(name = "商品id")
    private Long productId;

    /**
     * 公式计算
     */
    @Excel(name = "公式计算")
    private String computeStr;


    /**
     * 计算方式
     */
    @Excel(name = "计算方式", readConverterExp = "0=阶梯,1=公式")
    private CalculateEnum calculateEnum;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    private String delFlag = "0";

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("title", getTitle())
                .append("isUseSelf", getIsUseSelf())
                .append("compute", getCompute())
                .append("productId", getProductId())
                .append("delFlag", getDelFlag())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
