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

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.storlead.framework.annotate.AnnotateEnumType;
import com.storlead.framework.annotate.Dict;
import com.storlead.framework.annotate.OrgAutoMateAnnotate;
import com.storlead.framework.mybatis.entity.SysBaseField;
import com.storlead.sales.pojo.entity.customer.SysResourceEntity;
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;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "OrderFormDetailVO", description = "客户详情VO")
public class OrderFormDetailVO extends SysBaseField {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "订单表主键")
    private Long id;

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

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

    @ApiModelProperty(value = "关联客户名称")
    private String customerName;

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

    @ApiModelProperty(value = "关联商机名称")
    private String businessName;

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

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

    @ApiModelProperty(value = "汇率")
    private BigDecimal rate;

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

    @ApiModelProperty(value = "关联币种名称")
    private String currencyName;

    @ApiModelProperty(value = "订单类型value（对应字典订单类型value）")
    @Dict(dictCode = "order_type",valueField = "orderTypeName")
    private String orderTypeDictValue;

    @ApiModelProperty(value = "订单类型Name")
    private String orderTypeName;

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

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

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

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

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

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

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

    @ApiModelProperty(value = "归属人员姓名")
    private String ownerByName;

    @ApiModelProperty(value = "下一个id")
    private Long nextId;

    @ApiModelProperty(value = "上一个id")
    private Long previousId;

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

    @ApiModelProperty(value = "协作人员姓名")
    private String collaboratorName;

    @ApiModelProperty(value = "协作人员idList")
    private List<Long> collaboratorList;

    @ApiModelProperty(value = "最后跟进时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JSONField(format ="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastFollowUpTime;

    @ApiModelProperty(value = "下次跟进时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JSONField(format ="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime nextFollowUpTime;

    @ApiModelProperty(value = "创建人姓名")
    private String createByName;

    @ApiModelProperty(value = "部门ID")
    private Long deptId;

    @ApiModelProperty(value = "部门所属")
    private String deptName;

    @ApiModelProperty(value = "相关附件")
    private List<SysResourceEntity> resourceList;

    @OrgAutoMateAnnotate(valueField = "formerOwnerByName",annotateType = AnnotateEnumType.USER)
    private Long formerOwnerBy;

    @ApiModelProperty(value = "前归属人姓名")
    private String formerOwnerByName;


    @ApiModelProperty(value = "前归属部门")
    private String formerDeptName;
}
