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 cn.net.cpzslibs.prot.Prot02Logout;
import cn.net.cpzslibs.prot.SocketCreate;
import cn.net.cpzslibs.prot.handset.bean.req.Prot20032ReqBean;
import cn.net.cpzslibs.prot.handset.newProt.Prot20046ReqYthOrder;

public class NewYthSaoMa {
	private static long deviceId = 1000022L;
	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 {
			// -----------------------------------标签操作--------------------20049-------------------------------------
			create.createLoginCpzsHandset(deviceId);
			
			if (create.isResult()) {
			Prot20046ReqYthOrder ythOrder = new Prot20046ReqYthOrder();
			ythOrder.reqOrderInfoByOrderId(create, new Prot20032ReqBean("1"));
				System.err.println("请求结果：" + ythOrder.getResBean());
			}
			
			
			} 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);
			}
	}
}
