package com.dev.swms.server.telnet.demo;

import java.util.HashMap;
import java.util.Map;

import com.dev.kangaroo.shell.PageableBaseShell;

public class ASNListShell extends PageableBaseShell {

	
	/**
	 * 列表显示的表头，与查出的HQL列数对应。 
	 * 这里与HQL查出列对应，第一列的序号并非ID,而是选择的顺序号。
	 */
	@Override
	public String[] getTableHeader() {
		return new String[]{
				"序号",
				"单号",
				"货主",
				"单据类型",
				"期待数量"
				};
	}

	@Override
	public String getHql() {
		String hql = "SELECT asn.id,asn.code,asn.company.name,asn.billType.name,asn.expectedQuantity " +
				" FROM ASN asn WHERE 1=1 and asn.status in ('ACTIVE','RECEIVING','PUTAWAY')" +
				" and asn.billType.code not in ('PO_STRAIGHT','PO_TRANSFER')" + 
				" order by asn.id desc";
		return hql;
	}

	@Override
	public String getNextShell() {
		return "asnShell";
	}

	@Override
	public Map<String, Object> getParams() {
		return new HashMap<String, Object>();
	}
}
