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.Prot10018activate;
import cn.net.cpzslibs.prot.handset.bean.Prot10018SendBean;
import cn.net.cpzslibs.prot.handset.bean.Prot10018SendBeanPlan;

/**
 * @author 作者 李扬:
 * @date 创建时间：2017-5-11 上午9:33:36
 * @version 1.0
 * @parameter
 * @since
 * @return
 */
public class NewJnmyText {

	public static void main(String[] args) {
		String ip = "218.245.0.108";// 218.245.0.109 192.168.0.46
		int port = 8898;
		SocketCreate create = new SocketCreate(ip, port, "");
		try {
			create.createLoginCpzsHandset(458000280L);
			/*Prot10086CheckType  p86 = new Prot10086CheckType();
			p86.dealCheckType(create, new Prot10086SendBeanCheck("100000000194"));
			//1 种2 养 3 种养 4 种子
			System.out.println(p86.getCheckResult());*/
			
			Prot10018activate p18 = new Prot10018activate();
			Prot10018SendBeanPlan plan = new Prot10018SendBeanPlan(
					1, "", "");
			Prot10018SendBean bean = new Prot10018SendBean("458000280",
					"10038", "", "", "",
					"", "1000710027811324", "1000010020820619", plan);
			p18.dealLabelList(create, bean);
			
			System.out.println(p18.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);
		}
	}

}
