package com.ghy.order.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ghy.common.annotation.Excel;
import com.ghy.common.core.domain.BaseEntity;
import com.ghy.goods.domain.GoodsStandard;
import lombok.Data;

import java.util.Date;

/**
 * @author clunt
 * 订单关联商品，即所有商品清单
 */
@Data
public class OrderGoods extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @Excel(name = "订单商品id")
    private Long orderGoodsId;

    @Excel(name = "订单id, 主单", cellType = Excel.ColumnType.NUMERIC)
    private Long orderId;

    @Excel(name = "子订单id, 细单", cellType = Excel.ColumnType.NUMERIC)
    private Long orderDetailId;

    @Excel(name = "商品规格id", cellType = Excel.ColumnType.NUMERIC)
    private Long goodsStandardId;

    @Excel(name = "商品名称", cellType = Excel.ColumnType.STRING)
    private String goodsName;

    @Excel(name = "商品数量", cellType = Excel.ColumnType.NUMERIC)
    private Integer goodsNum;

    @Excel(name = "已服务数量", cellType = Excel.ColumnType.NUMERIC)
    private Integer serverGoodsNum;

    @Excel(name = "完成时间", cellType = Excel.ColumnType.NUMERIC)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date finishTime;

    private GoodsStandard goodsStandard;

    private String goodsLogoUrl;

    public OrderGoods() {
    }

    public OrderGoods(Long orderId, Long goodsStandardId, String goodsName, Integer goodsNum, Integer serverGoodsNum) {
        this.orderId = orderId;
        this.goodsStandardId = goodsStandardId;
        this.goodsName = goodsName;
        this.goodsNum = goodsNum;
        this.serverGoodsNum = serverGoodsNum;
    }
}
