package com.swfarm.biz.chain.dto;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;

import com.swfarm.pub.utils.DateUtils;

public class SearchOosCustomerOrderItemsCriteria implements Serializable {

	private String saleChannel;

	private String accountNumber;

	private String productManagerNo;
	
	private String assistantProductManagerNo;

	private String articleNumber;
	
	private String productArticleNumber;

	private Boolean isClearanceSku;

	private List skuLifeCyclePhases;

	private String customerOrderProcessStep;

	private String[] customerOrderProcessSteps;

	private String exceptionalProcessStep;

	private String buyerCountry;

	private Date startDate;

	private Date endDate;

	public String getSaleChannel() {
		return saleChannel;
	}

	public void setSaleChannel(String saleChannel) {
		this.saleChannel = saleChannel;
	}

	public String getAccountNumber() {
		return accountNumber;
	}

	public void setAccountNumber(String accountNumber) {
		this.accountNumber = accountNumber;
	}

	public String getProductManagerNo() {
		return productManagerNo;
	}

	public void setProductManagerNo(String productManagerNo) {
		this.productManagerNo = productManagerNo;
	}

	public String getArticleNumber() {
		return articleNumber;
	}

	public void setArticleNumber(String articleNumber) {
		this.articleNumber = articleNumber;
	}

	public Boolean getIsClearanceSku() {
		return isClearanceSku;
	}

	public void setIsClearanceSku(Boolean isClearanceSku) {
		this.isClearanceSku = isClearanceSku;
	}

	public List getSkuLifeCyclePhases() {
		if (skuLifeCyclePhases == null) {
			skuLifeCyclePhases = new ArrayList();
		}
		return skuLifeCyclePhases;
	}

	public String getSkuLifeCyclePhaseJsArr() {
		StringBuffer jsBuffer = new StringBuffer();
		jsBuffer.append("[");
		if (CollectionUtils.isNotEmpty(this.getSkuLifeCyclePhases())) {
			for (Iterator iter = this.skuLifeCyclePhases.iterator(); iter
					.hasNext();) {
				jsBuffer.append("'");
				String skuLifeCyclePhase = (String) iter.next();
				jsBuffer.append(skuLifeCyclePhase);
				jsBuffer.append("'");
				if (iter.hasNext()) {
					jsBuffer.append(",");
				}
			}
		}
		jsBuffer.append("]");
		return jsBuffer.toString();
	}

	public void setSkuLifeCyclePhases(List skuLifeCyclePhases) {
		this.skuLifeCyclePhases = skuLifeCyclePhases;
	}

	public String getCustomerOrderProcessStep() {
		return customerOrderProcessStep;
	}

	public void setCustomerOrderProcessStep(String customerOrderProcessStep) {
		this.customerOrderProcessStep = customerOrderProcessStep;
	}

	public String[] getCustomerOrderProcessSteps() {
		return customerOrderProcessSteps;
	}

	public void setCustomerOrderProcessSteps(String[] customerOrderProcessSteps) {
		this.customerOrderProcessSteps = customerOrderProcessSteps;
	}

	public String getExceptionalProcessStep() {
		return exceptionalProcessStep;
	}

	public void setExceptionalProcessStep(String exceptionalProcessStep) {
		this.exceptionalProcessStep = exceptionalProcessStep;
	}

	public String getBuyerCountry() {
		return buyerCountry;
	}

	public void setBuyerCountry(String buyerCountry) {
		this.buyerCountry = buyerCountry;
	}

	public Date getStartDate() {
		return startDate;
	}

	public String getStartDateString() {
		if (startDate != null) {
			return DateUtils.dateToString(startDate, "yyyy/MM/dd");
		} else {
			return StringUtils.EMPTY;
		}
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public String getEndDateString() {
		if (endDate != null) {
			return DateUtils.dateToString(endDate, "yyyy/MM/dd");
		} else {
			return StringUtils.EMPTY;
		}
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public void setProductArticleNumber(String productArticleNumber) {
		this.productArticleNumber = productArticleNumber;
	}

	public String getProductArticleNumber() {
		return productArticleNumber;
	}

	public void setAssistantProductManagerNo(String assistantProductManagerNo) {
		this.assistantProductManagerNo = assistantProductManagerNo;
	}

	public String getAssistantProductManagerNo() {
		return assistantProductManagerNo;
	}

}
