package com.bonus.material.purchase.domain.dto;

import com.bonus.common.core.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author : 阮世耀
 * @version : 1.0
 * @PackagePath: com.bonus.material.purchase.dto
 * @CreateTime: 2024-10-23  16:47
 * @Description: 新购查询DTO，封装查询条件
 */
@Data
public class PurchaseQueryDto {

    private Long id;

    @ApiModelProperty(value = "任务id")
    private Long taskId;

    @ApiModelProperty(value = "任务单号")
    private String code;

    @ApiModelProperty(value = "开始时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date startTime;

    @ApiModelProperty(value = "结束时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date endTime;

    @ApiModelProperty(value = "外层任务状态")
    private Integer taskStatus;

    @ApiModelProperty(value = "关键字")
    private String keyWord;

    @ApiModelProperty(value = "规格ID")
    private Long typeId;

    @ApiModelProperty(value = "物资厂家ID")
    private Long supplierId;

    @ApiModelProperty(value = "出场日期")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date productionTime;

    /** 采购日期 */
    @ApiModelProperty(value = "采购日期")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date purchaseTime;

    /** 到货日期 */
    @ApiModelProperty(value = "到货日期")
    @NotNull(message = "到货日期不能为空")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Excel(name = "到货日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date arrivalTime;

    /** 采购员 */
    @Excel(name = "采购员")
    @ApiModelProperty(value = "采购员")
    private Long purchaser;

    /**
     * 税率
     */
    @ApiModelProperty(value = "税率 0~100")
    @Size(max = 100, message = "税率长度必须介于 0 和 100 之间")
    private BigDecimal taxRate;

    /**
     * 子任务状态列表, 比如待验收：2,12  待绑定：3,13  待入库：4,14, 参考 PurchaseTaskStatusEnum.java
     */
    @ApiModelProperty(value = "子任务状态列表")
    private List<Integer> statusList;
}
