package com.cf.imes.module.executor.controller.admin.plan.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

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

import static com.cf.imes.framework.common.util.date.DateUtils.*;

/**
 * @author there
 * 排单页面订单VO
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class OrderRespVOCopy {
    @Schema(description = "订单id")
    private Long orderId;

    @Schema(description = "父订单号")
    private Long parentId;

    @Schema(description = "订单状态")
    private Integer status;

    @Schema(description = "订单类型")
    private Integer orderType;

    @Schema(description = "自定义单号")
    private String defineId;

    @Schema(description = "客户")
    private String customer;

    @Schema(description = "地址")
    private String address;

    @Schema(description = "订单日期")
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY, timezone = TIME_ZONE_DEFAULT)
    private LocalDateTime orderDate;

    @Schema(description = "交付日期")
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
    private LocalDateTime deliveryDate;

    @Schema(description = "客户电话")
    private String phoneNumber;

    @Schema(description = "经销商")
    private String dealer;

    @Schema(description = "业务员")
    private String salesman;

    @Schema(description = "拆单员")
    private String splitter;

    @Schema(description = "备注")
    private String remark;

    @Schema(description = "更新时间")
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
    private Date updateTime;

    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
    private Date createTime;

    @Schema(description = "片数")
    private int num;

    @Schema(description = "平方")
    private BigDecimal area = new BigDecimal("0");

    @Schema(description = "商品id")
    private String goodsId;

    @Schema(description = "订单对应的板件的信息")
    private List<PlatePage> platePages;

    @Schema(description = "子单列表")
    private List<OrderRespVOCopy> child;
}