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.Port10047GetProducts;
import cn.net.cpzslibs.prot.handset.Prot10063SeedsJiHuo;
import cn.net.cpzslibs.prot.handset.bean.Port10047SendBean;

/** 
 * @author  作者 李扬: 
 * @date 创建时间：2017-5-11 下午2:02:20 
 * @version 1.0 
 * @parameter 
 * @since  
 * @return  
 */
public class NewSeedsText {
	public static void main(String[] args) {
		String ip = "218.245.0.109";// 218.245.0.109 192.168.0.46
		int port = 8898;
		SocketCreate create = new SocketCreate(ip, port, "");
		try {
			create.createLoginCpzsHandset(658000092L);
			Port10047GetProducts p47 = new Port10047GetProducts();
			Prot10063SeedsJiHuo p63 = new Prot10063SeedsJiHuo();
			
			p47.dealPlantBreed(create, new Port10047SendBean(5, "", ""));
			p47.dealPlantMach(create, new Port10047SendBean(6, "", ""));
			//p63.dealActiveSeeds(create, new Prot10063SeedSendBean(product_id, produce_date, batch_number, origin, certificate_id, land_id, sales_area, start_label_id, end_label_id, tel, fibre_plan_id, fibre_product_plan_id));
			System.out.println(p47.getPlantBreedResult());
			System.out.println(p47.getPlantMachResult());
			
		} 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);
		}
	}

}
