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 com.ruoyi.project.system.enums.ProductEnum;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.List;

/**
 * 商品
 *
 * @author zhu
 * @date 2023-10-24
 */

@Data
@Accessors(chain = true)
public class Product extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    private Long id;

    /**
     * 商品名称
     */
    @Excel(name = "商品名称")
    private String title;

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

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

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

    /**
     * 是否展示
     */
    @Excel(name = "是否展示", readConverterExp = "0=否,1=是")
    private Boolean isShow = false;

    /**
     * 是否多规格
     */
    @Excel(name = "是否多规格", readConverterExp = "0=否,1=是")
    private Boolean isMore = false;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @Excel(name = "删除标志", readConverterExp = "0=代表存在,2=代表删除")
    private String delFlag = "0";

    /**
     * 计算方式
     */
    @Excel(name = "计算方式")
    private ProductEnum modes;

    /**
     * 基础
     */
    @Excel(name = "基础")
    private String basics;

    /**
     * 款式计算
     */
    @Excel(name = "款式计算")
    private String styleCompute;

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

    /**
     * 照片
     */
    @Excel(name = "照片")
    private List<String> images;

    /**
     * 图片备注
     */
    @Excel(name = "图片备注")
    private String imageText;

    /**
     * 是否开启比价
     */
    @Excel(name = "是否开启比价")
    private Boolean isParity;
    /**
     * 倍率
     */
    @Excel(name = "倍率")
    private String power;

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