package com.jwipc.order.dto;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.jwipc.order.constants.ShortagePlanStatus;
import com.jwipc.util.ExcelColumnHidden;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;

/**
 * <p> </p>
 *
 * @author ZhangJie
 * @version 1.0
 * @since JDK 1.8
 */
@Data
public class ShortageQuotaExportReplyDTO {
    @ExcelProperty(value = "detailId", index = 0)
    @ExcelColumnHidden
    private String detailId;
    @ExcelProperty(value = "物料编码", index = 1)
    private String productCode;
    @ExcelProperty(value = "物料名称", index = 2)
    private String productName;
    @ExcelProperty(value = "工厂编码", index = 3)
    private String factoryCode;
    @ExcelProperty(value = "供应商编码", index = 4)
    private String supplierCode;
    @ExcelProperty(value = "供应商名称", index = 5)
    private String supplierName;
    @ExcelProperty(value = "状态", index = 6)
    private String statusStr;
    @ExcelIgnore
    private Integer status;
    @ExcelProperty(value = "周期", index = 7)
    private String dateTime;
    @ExcelProperty(value = "需求数量", index = 8)
    private BigDecimal distributeNum;
    @ExcelProperty(value = "回复数量", index = 9)
    private BigDecimal adjustNum;
    @ExcelProperty(value = "回复日期", index = 10)
    private LocalDate adjustDate;

    public String getStatusStr() {
        if (this.status == ShortagePlanStatus.PENDING_REPLY.getCode()) {
            return ShortagePlanStatus.PENDING_REPLY.getName();
        } else {
            return "待回复";
        }
    }
}
