package com.jwipc.inquiry.model.query;

import com.jwipc.query.BasePageQuery;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.util.Arrays;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 询价
 * </p>
 *
 * @author shenyang.ou
 * @since 2024-02-04
 */
@Data
public class InquiryQuery extends BasePageQuery {


    /**
     * 询价编号
     */
    private String inquiryCode;

    /**
     * 询价标题
     */
    private String inquiryTitle;

    /**
     * 采购组编码
     */
    private String purchaseGroupCode;

    /**
     * 开始时间
     */
    private String beginTime;

    /**
     * 结束时间
     */
    private String endTime;

    /**
     * 询价状态(多个逗号隔开)
     */
    private Integer status;
    private Integer quotaStatus;
    private String statusLists;
    private List<String> statusList;

    /**
     * 创建人
     */
    private String createUserName;

    /**
     * 物料信息
     */
    private String material;

    /**
     * 采购类别
     */
    private String inquiryType;

    /**
     * 转合同情况
     */
    private String stateTurned;

    /**
     * 询价类别
     */
    private String purchaseType;

    /**
     *价格信息
     */
    private Integer genPriceInfo;
    private Long userId;

    public List<String> getStatusList(){
        if (StringUtils.isNotEmpty(this.statusLists)){
            return  Arrays.asList(StringUtils.split(this.statusLists, ","));
        }
        return null;
    }
}
