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.Prot11DownConflictInfo;
import cn.net.cpzslibs.prot.SocketCreate;

public class Handset28 {

	/**
	 * <br/>2015-7-14上午11:27:07
	 * @param args
	 */
	public static void main(String[] args) {
//		SocketCreate create = new SocketCreate("192.168.0.46", 8899,
//				"2000000000001");
		SocketCreate create = new SocketCreate("218.245.0.109", 8899,
				"358000477L");
		try {
			create.createLoginCpzsHandset(358000477L);
			System.out.println(create.getiCompanyId()+"---"+create.getiWorkStyle());
			if (create.isResult()) {
				Prot11DownConflictInfo conflictInfo = new Prot11DownConflictInfo();
				conflictInfo.dealDownConflictInfo(create, 1);
				System.out.println(conflictInfo.getJsonData());
			}else{
				System.out.println("登录失败"+create.getErrMsg());
			}
			
//			Prot17GetProducts getProducts = new Prot17GetProducts();
			
//			getProducts.dealWineProduct(create, 1, new WineCallBack() {
//				@Override
//				public void updateData(boolean bool, List<Map<String, String>> maps,
//						String errRet, int iErrCode) {
//					
//				}
//			});
//			getProducts.dealRedWineProduct(create);
//			String jsonData = getProducts.getJsonData();
//			System.out.println(jsonData);
			
//			Prot26GoodsId goodsId = new Prot26GoodsId();
//			goodsId.dealGoodsId(create);
//			System.out.println(goodsId.getJsonData());
		} 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);
		}

	}

}
