package com.storlead.sales.pojo.entity.customer;

import java.math.BigDecimal;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.storlead.framework.annotate.AnnotateEnumType;
import com.storlead.framework.annotate.OrgAutoMateAnnotate;
import com.storlead.framework.mybatis.entity.SysBaseField;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 订单表
 * </p>
 *
 * @author YPZ
 * @since 2024-05-10
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("order_form")
@ApiModel(value="OrderFormEntity对象", description="订单表")
public class OrderFormEntity extends SysBaseField {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "订单表主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "编码")
    @TableField(value = "data_code")
    private String dataCode;

    @ApiModelProperty(value = "订单标题")
    @TableField("title")
    private String title;

    @ApiModelProperty(value = "关联客户id")
    @TableField("customer_id")
    private Long customerId;

    @ApiModelProperty(value = "关联商机id")
    @TableField("business_id")
    private Long businessId;

    @ApiModelProperty(value = "关联报价id")
    @TableField("quotation_id")
    private Long quotationId;

    @ApiModelProperty(value = "订单总金额")
    @TableField("total_order_amt")
    private BigDecimal totalOrderAmt;

    @ApiModelProperty(value = "关联币种id")
    @TableField("currency_id")
    private Long currencyId;

    @ApiModelProperty(value = "订单类型value（对应字典订单类型value）")
    @TableField("order_type_dict_value")
    private String orderTypeDictValue;

    @ApiModelProperty(value = "签单日期")
    @TableField("signing_date")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JSONField(format ="yyyy-MM-dd")
    private Date signingDate;

    @ApiModelProperty(value = "预计生成日期")
    @TableField("expected_production_date")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JSONField(format ="yyyy-MM-dd")
    private Date expectedProductionDate;

    @ApiModelProperty(value = "预计发货日期")
    @TableField("expected_delivery_date")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JSONField(format ="yyyy-MM-dd")
    private Date expectedDeliveryDate;

    @ApiModelProperty(value = "客户签约人")
    @TableField("customer_signatory")
    private String customerSignatory;

    @ApiModelProperty(value = "我方签约人")
    @TableField("our_signatory")
    private String ourSignatory;

    @ApiModelProperty(value = "备注信息")
    @TableField("remark")
    private String remark;

//    @ApiModelProperty(value = "提醒用户id，逗号隔开")
    @TableField("remind_user_ids")
    private String remindUserIds;

    @ApiModelProperty(value = "协作人员id,逗号分割")
    @TableField("collaborator")
    private String collaborator;

    @ApiModelProperty(value = "前归属人")
    @OrgAutoMateAnnotate(valueField = "formerOwnerByName",annotateType = AnnotateEnumType.USER)
    private Long formerOwnerBy;
}
