package com.xinelu.manage.domain.goodsOrderDetails;

import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseDomain;
import com.xinelu.common.custominterface.Insert;
import com.xinelu.common.custominterface.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 商品订单明细对象 goods_order_details
 *
 * @author xinyilu
 * @date 2022-10-18
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "商品订单明细对象", description = "goods_order_details")
public class GoodsOrderDetails extends BaseDomain implements Serializable {
    private static final long serialVersionUID = -2047412676286670313L;
    /**
     * 主键id
     */
    private Long id;

    /**
     * 商品订单表id
     */
    @ApiModelProperty(value = "商品订单表id")
    @Excel(name = "商品订单表id")
    @NotNull(message = "商品订单表id为空", groups = {Insert.class, Update.class})
    private Long goodsOrderId;

    /**
     * 商品属性id
     */
    @ApiModelProperty(value = "商品属性id")
    @Excel(name = "商品属性id")
    @NotNull(message = "商品属性id不能为空", groups = {Insert.class, Update.class})
    private Long goodsAttributeId;

    /**
     * 商品属性明细id
     */
    @ApiModelProperty(value = "商品属性明细id")
    @Excel(name = "商品属性明细id")
    @NotNull(message = "商品属性明细id不能为空", groups = {Insert.class, Update.class})
    private Long goodsAttributeDetailsId;

    /**
     * 订单编号
     */
    @ApiModelProperty(value = "订单编号")
    @Excel(name = "订单编号")
    private String orderNo;

    /**
     * 商品名称
     */
    @ApiModelProperty(value = "商品名称")
    @Excel(name = "商品名称")
    @NotBlank(message = "商品名称不能为空", groups = {Insert.class, Update.class})
    @Length(max = 50, message = "商品名称不能超过50位", groups = {Insert.class, Update.class})
    private String goodsName;

    /**
     * 商品数量
     */
    @ApiModelProperty(value = "商品数量")
    @Excel(name = "商品数量")
    @NotNull(message = "商品数量不能为空", groups = {Insert.class, Update.class})
    @Length(max = 10, message = "商品数量不能超过10位", groups = {Insert.class, Update.class})
    private Integer goodsCount;

    /**
     * 商品属性名称
     */
    @ApiModelProperty(value = "商品属性名称")
    @Excel(name = "商品属性名称")
    private String goodsAttributeName;

    /**
     * 商品属性内容
     */
    @ApiModelProperty(value = "商品属性内容")
    @Excel(name = "商品属性内容")
    private String goodsAttributeContent;

    /**
     * 商品单价（元）
     */
    @ApiModelProperty(value = "商品单价")
    @Excel(name = "商品单价", readConverterExp = "元=")
    @NotNull(message = "商品单价不能为空", groups = {Insert.class, Update.class})
    @Length(max = 10, message = "商品单价不能超过10位", groups = {Insert.class, Update.class})
    private BigDecimal goodsPrice;

    /**
     * 应付总金额（元）
     */
    @ApiModelProperty(value = "应付总金额")
    @Excel(name = "应付总金额", readConverterExp = "元=")
    private BigDecimal totalPrice;

    /**
     * 优惠金额（元）
     */
    @ApiModelProperty(value = "优惠金额")
    @Excel(name = "优惠金额", readConverterExp = "元=")
    private BigDecimal discountPrice;

    /**
     * 运费金额（元）
     */
    @ApiModelProperty(value = "运费金额")
    @Excel(name = "运费金额", readConverterExp = "元=")
    private BigDecimal transportPrice;

    /**
     * 赠送积分
     */
    @ApiModelProperty(value = "赠送积分")
    @Excel(name = "赠送积分")
    private Integer giveIntegral;

    /**
     * 0：否，1：是
     */
    private Integer delFlag;

    /**
     * 优惠券id
     */
    private Long couponId;

    /**
     * 积分抵扣数量
     */
    private Integer integralDeductionCount;

    /**
     * 积分抵扣金额
     */
    private BigDecimal integralDeductionPrice;

    /**
     * 优惠券名称
     */
    private String couponTitle;

    /**
     * 积分兑换商品使用积分数值
     */
    private Integer integralExchangeSill;

    /**
     * 积分兑换商品数量
     */
    private Integer integralExchangeCount;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("goodsOrderId", getGoodsOrderId())
                .append("orderNo", getOrderNo())
                .append("goodsName", getGoodsName())
                .append("goodsCount", getGoodsCount())
                .append("goodsAttributeName", getGoodsAttributeName())
                .append("goodsAttributeContent", getGoodsAttributeContent())
                .append("goodsPrice", getGoodsPrice())
                .append("totalPrice", getTotalPrice())
                .append("discountPrice", getDiscountPrice())
                .append("transportPrice", getTransportPrice())
                .append("giveIntegral", getGiveIntegral())
                .append("delFlag", getDelFlag())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
