package com.jwipc.sys.model.query;

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

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

/**
 * <p>
 *
 * </p>
 *
 * @author Chen Tianshi
 * @since 2025/9/11 14:21
 */
@Data
public class BusinessAttachmentQuery extends BasePageQuery {
    /**
     * 业务id
     */
    private Long businessId;
    private String businessIds;
    private String purchaseCodeAndDeliveryCodes;
    private List<String> purchaseCodeAndDeliveryCodeList;
    private List<String> businessIdList;
    private String types;
    /**
     * 仅资产合同付款申请用到
     */
    private String billCode;
    private List<String> typeList;
    /**
     * 业务单据集合
     */
    private String businessCodes;
    private List<String> businessCodeList;
    /**
     * 业务类型集合
     */
    private String businessTypeCodes;
    private List<String> businessTypeCodeList;

    public List<String> getBusinessCodeList(){
        if (StringUtils.isNotEmpty(this.businessCodes)){
            return  Arrays.asList(StringUtils.split(this.businessCodes, ","));
        }
        return null;
    }
    public List<String> getPurchaseCodeAndDeliveryCodeList(){
        if (StringUtils.isNotEmpty(this.purchaseCodeAndDeliveryCodes)){
            return  Arrays.asList(StringUtils.split(this.purchaseCodeAndDeliveryCodes, "*"));
        }
        return null;
    }

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

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

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