package com.jwipc.inquiry.model.query;

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

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;

/**
 * @author shenyang.ou
 * @date 2024/2/29 13:29
 * @desc
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class PurchaseApplyBillDetailQuery extends BaseSortQuery {

    private Long id;
    private String ids;
    private List<String> idList;

    /**
     * 采购申请号
     */
    private String billCode;

    /**
     * 转单状态
     */
    private Integer transferStatus;

    /**
     * 数据状态
     */
    private String dataStates;
    private List<String> dataStateList;

    /**
     * 转询价状态
     */
    private Integer inquiryFlag;

    /**
     * 物料编码
     */
    private String materialCode;

    /**
     * 物料名称
     */
    private String materialName;

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

    /**
     * 规格
     */
    private String materialSpec;

    /**
     * 品牌
     */
    private String brand;
    /**
     * 需求数量
     */
    private BigDecimal requireNum;
    /**
     * 物料组编码
     */
    private String materialGroupCode;
    private String materialGroupName;
    private String purchaseMethod;
    private String purchaseOrderNumber;

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

    /**
     * 采购申请类型
     */
    private String purchaseApplyTypeCode;

    /**
     * 工厂
     */
    private String factoryCode;

    private String applyBillType;

    private String contractType;

    private String companyCode;

    private String supplierCode;

    /**
     * 申请时间(起)
     */
    private String startCreateDate;

    /**
     * 至
     */
    private String endCreateDate;

    /**
     * 申请人
     */
    private String requireName;
    private Integer searchFlag;
    /**
     * 商城页面使用标识
     */
    private Integer shangCFlag;


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

    /**
     * 采购业务类型
     */
    private String purchasingBusinessType;



    private String modelType;

    /**
     * 模具编号
     */
    private String modelNumber;

    public List<String> getIdList(){
        if (StringUtils.isNotEmpty(this.ids)){
            return  Arrays.asList(StringUtils.split(this.ids, ","));
        }
        return null;
    }
    public List<String> getDataStatesList(){
        if (StringUtils.isNotEmpty(this.dataStates)){
            return  Arrays.asList(StringUtils.split(this.dataStates, ","));
        }
        return null;
    }
}
