package cn.net.test;


import java.io.IOException;
import java.net.BindException;
import java.net.ConnectException;
import java.net.SocketTimeoutException;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.List;

import cn.net.cpzslibs.prot.Prot02Logout;
import cn.net.cpzslibs.prot.SocketCreate;
import cn.net.cpzslibs.prot.handset.bean.req.Prot20018ReqBean;
import cn.net.cpzslibs.prot.handset.bean.req.Prot20019ReqBean;
import cn.net.cpzslibs.prot.handset.newProt.Prot20018LabelOption;
import cn.net.cpzslibs.prot.handset.newProt.Prot20019ChaXun;

/** 
 * @author  作者 李扬: 
 * @date 创建时间：2017-5-2 下午1:19:12 
 * @version 1.0 
 * @parameter 
 * @since  
 * @return  
 */
public class NewChinatexText {
	public static void main(String[] args) {
		String ip = "218.245.0.109";// 218.245.0.109 192.168.0.46
		int port = 8890;
		SocketCreate create = new SocketCreate(ip, port, "");
		try {
			create.createLoginCpzsHandset(2000000000100L);
			int type = 20018;
			
			switch (type) {
			
			case 20018://1 出库 2 返库
				
				Prot20018LabelOption p218 = new Prot20018LabelOption();
				List<String>  label = new ArrayList<String>();		
				label.add("1000010026782731");
				//NewWine.getArray(label, 1);			
				System.out.println(label.size());				
				p218.reqLabelOption(create, new Prot20018ReqBean(label, "2017-05-02", 1, 2, 11, 1,"测试"));			
				System.out.println(p218.getResBean());
				
				break;
			case 20019:
				
				Prot20019ChaXun p219 = new Prot20019ChaXun();
				p219.dealQuery(create, new Prot20019ReqBean("355128005922687", "1000010026782731"));
				System.out.println(p219.getResBean());
				break;

			default:
				break;
			}
			
		
		
		} catch (BindException e) {
			e.printStackTrace();
		} catch (ConnectException e) {
			e.printStackTrace();
		} catch (SocketTimeoutException e) {
			e.printStackTrace();
		} catch (UnknownHostException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}finally {
			new Prot02Logout().dealLogout(create);
		}
	}
}
