/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.shopping.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 商品寄售表实体类
 *
 * @author BladeX
 * @since 2022-02-13
 */
@Data
@TableName("t_consign")
@ApiModel(value = "Consign对象", description = "商品寄售表")
public class Consign implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 主键ID
	 */
	@JsonSerialize(using = ToStringSerializer.class)
	@TableId(value = "id", type = IdType.ASSIGN_ID)
	@ApiModelProperty(value = "主键ID")
	private Long id;

	/**
	 * 订单ID
	 */
	@ApiModelProperty(value = "订单ID")
	private Long orderId;

	/**
	 * 商品ID
	 */
	@ApiModelProperty(value = "商品ID")
	private Long goodsId;

	/**
	 * 批次ID
	 */
	@ApiModelProperty(value = "批次ID")
	private Long consignConfigId;

	/**
	 * 标题
	 */
	@ApiModelProperty(value = "标题")
	private String title;

	/**
	 * 商品名称
	 */
	@ApiModelProperty(value = "商品名称")
	private String goodsName;

	/**
	 * 数量
	 */
	@ApiModelProperty(value = "数量")
	private Integer totalNum;

	/**
	 * 数量
	 */
	@ApiModelProperty(value = "当前库存")
	private Integer nowStock;

	/**
	 * 寄售天数
	 */
	@ApiModelProperty(value = "寄售天数")
	private Integer consignDays;

	/**
	 * 寄售天数
	 */
	@ApiModelProperty(value = "在售天数")
	private Integer saleDays;

	/**
	 * 寄售用户ID
	 */
	@ApiModelProperty(value = "寄售用户ID")
	private Long consignUserId;

	@TableField(exist = false)
	@ApiModelProperty(value = "寄售用户名称")
	private String consignUserName;

	@TableField(exist = false)
	@ApiModelProperty(value = "寄售用户手机号")
	private String consignUserPhone;

	/**
	 * 寄售类型
	 */
	@ApiModelProperty(value = "寄售类型:0无，1提货，2寄售")
	private Integer consignType;

	/**
	 * 寄售状态
	 */
	@ApiModelProperty(value = "寄售状态")
	private Integer consignState;

	/**
	 * 取得价
	 */
	@ApiModelProperty(value = "取得价")
	private Double obtainPrice;

	/**
	 * 取得价
	 */
	@ApiModelProperty(value = "交割价")
	private Double deliveryPrice;

	/**
	 * 抢购价
	 */
	@ApiModelProperty(value = "抢购价")
	private Double consignPrice;

	/**
	 * 溢售价 - 抢购人取得的价格
	 */
	@ApiModelProperty(value = "溢售价")
	private Double premiumPrice;

	/**
	 * 是否交割
	 */
	@ApiModelProperty(value = "是否交割")
	private Integer isDelivery;

	/**
	 * 是否上架
	 */
	@ApiModelProperty(value = "是否上架")
	private Integer isSale;

	/**
	 * 开始时间
	 */
	@ApiModelProperty(value = "开始时间")
	private Date startTime;
	/**
	 * 结束时间
	 */
	@ApiModelProperty(value = "结束时间")
	private Date endTime;

	/**
	 * 创建时间
	 */
	@ApiModelProperty(value = "创建时间")
	private Date createTime;

	/**
	 * 寄售来源
	 */
	@ApiModelProperty(value = "寄售来源")
	private Integer consignFor;


	@JsonIgnore
	@TableLogic
	@ApiModelProperty(value = "删除标识")
	private Integer isDeleted;
}
