package cn.net.test;

import com.google.gson.Gson;
import com.jymf.common.LableUtil;

import java.io.File;
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.label.JinLabelUtil;
import cn.net.cpzslibs.prot.Prot02Logout;
import cn.net.cpzslibs.prot.SocketCreate;
import cn.net.cpzslibs.prot.handset.bean.req.SingleLabelIdBean;
import cn.net.cpzslibs.prot.handset.bean.req.jinLiquor.Jin20007ReqBean;
import cn.net.cpzslibs.prot.handset.bean.req.jinLiquor.Jin20008ReqBean;
import cn.net.cpzslibs.prot.handset.bean.req.jinLiquor.Jin20010ReqBean;
import cn.net.cpzslibs.prot.handset.bean.req.jinLiquor.Jin20013ReqBean;
import cn.net.cpzslibs.prot.handset.bean.req.jinLiquor.Jin20014ReqBean;
import cn.net.cpzslibs.prot.handset.bean.req.jinLiquor.Jin20021ReqBean;
import cn.net.cpzslibs.prot.handset.bean.req.jinLiquor.Jin20022ReqBean;
import cn.net.cpzslibs.prot.handset.bean.req.jinLiquor.Jin20023ReqBean;
import cn.net.cpzslibs.prot.handset.bean.req.jinLiquor.Jin20024ReqBean;
import cn.net.cpzslibs.prot.handset.bean.req.jinLiquor.Jin20025ReqBean;
import cn.net.cpzslibs.prot.handset.bean.req.jinLiquor.Jin20026ReqBean;
import cn.net.cpzslibs.prot.handset.bean.req.jinLiquor.Jin20031ReqBean;
import cn.net.cpzslibs.prot.handset.bean.req.jinLiquor.Jin20033ReqBean;
import cn.net.cpzslibs.prot.handset.bean.req.jinLiquor.Jin20035ReqBean;
import cn.net.cpzslibs.prot.handset.bean.req.jinLiquor.Jin20037ReqBean;
import cn.net.cpzslibs.prot.handset.bean.req.jinLiquor.JinBottleBean;
import cn.net.cpzslibs.prot.handset.bean.req.jinLiquor.JinOrderProductBean;
import cn.net.cpzslibs.prot.handset.bean.res.jinLiquor.SingleOrderNoBean;
import cn.net.cpzslibs.prot.handset.jinLiquor.Jin20031SetTraceCode;
import cn.net.test.bean.DealerInvoiceFromOrderBeanT;
import cn.net.test.tools.DealerOrderInvoiceTools;

public class ANewJinLiquorHandsetProtTest {

	public static void main(String[] args) {
		ReqType type = ReqType.TEST_PROT;
		String ip = getIp(type);// zs-wms.jingpai.com(仓库)   zs-pda.jingpai.com(经销商)
		int port = getProt(type);// 8090  35251(经销商)   35252(仓库)
		SocketCreate create = new SocketCreate(ip, port, "");
		try {
			create.createJustCreateSocket();
			// -----------------登录------------------劲酒-------20005--------------------------------------------------
//			Jin20005Login l = new Jin20005Login();
//			l.login(create, new Jin20005ReqBean("301001", "e10adc3949ba59abbe56e057f20f883e"),"123456");
//			System.err.println("" + l.getResBean().toString());
//			l.login(create, new Jin20005ReqBean("1", "1"));
			// -----------------获取产品列表------------------劲酒-------20004--------------------------------------------------
//			Jin20004Product l = new Jin20004Product();
//			l.reqProduct(create);
			// -----------------更新班组信息------------------劲酒-------20004--------------------------------------------------
//			Jin20006Group l = new Jin20006Group();
//			l.reqGroup(create, new Jin20006ReqBean("101000"));
//			System.err.println("resBean: " + l.getResBean().toString());
			// -----------------瓶盒校验------------------劲酒-------20001--------------------------------------------------
//			Jin20001CheckBottleBox l = new Jin20001CheckBottleBox();
//			l.checkBottleBox(create, new Jin20001ReqBean("4150606001007008580200"));
//			System.err.println("resBean: " + l.getResBean().toString());
			
			// -----------------盒箱校验------------------劲酒-------20002--------------------------------------------------
//			Jin20002CheckGiftBox l = new Jin20002CheckGiftBox();
////			l.checkGiftBox(create, new Jin20002ReqBean("4150606001007008580200", "101000", 1));//盒标
//			l.checkGiftBox(create, new Jin20002ReqBean("286785104400", 2));//箱标
//			System.err.println("resBean: " + l.getResBean().toString());
			// -----------------箱托校验------------------劲酒-------20003--------------------------------------------------
//			Jin20003CheckTray l = new Jin20003CheckTray();
//			l.checkTray(create, new Jin20003ReqBean("286785104400", "286785104400", "101000"));	
//			System.err.println("resBean: " + l.getResBean().toString());
			// -----------------瓶盒关联------------------劲酒-------20007--------------------------------------------------
//			Jin20007PackBottle packBottle = new Jin20007PackBottle();
//			packBottle.packBottle(create, getJin20007ReqBean());
			// -----------------盒箱关联------------------劲酒-------20008--------------------------------------------------
//			Jin20008PackGiftBox packGift = new Jin20008PackGiftBox();
//			packGift.packGiftBox(create, getJin20008ReqBean());
			// -----------------获取经销商信息------------------劲酒-------20009--------------------------------------------------
//			Jin20009ReqDealerInfo reqDealerInfo = new Jin20009ReqDealerInfo();
//			reqDealerInfo.reqDealerInfo(create,new Jin20009ReqBean("02701002"));
//			System.err.println("resBean:" + reqDealerInfo.getResBean().toString());
			// -----------------获取箱标所在的托盘规格------------------劲酒-------20011--------------------------------------------------
//			Jin20011ReqPalletSpec p_Spec = new Jin20011ReqPalletSpec();
//			p_Spec.reqPalletSpec(create,new SingleLabelIdBean("286785104400"));
//			System.err.println("resBean:" + p_Spec.getResBean().toString());
			// -----------------获取箱标所在的托盘信息------------------劲酒-------20012--------------------------------------------------
//			Jin20012ReqPalletLackCount p_Spec = new Jin20012ReqPalletLackCount();
//			p_Spec.reqPalletSpec(create,new SingleLabelIdBean("273423082805"));
//			System.err.println("resBean:" + p_Spec.getResBean().toString());	
			// -----------------出库------------------劲酒-------20010--------------------------------------------------
//			Jin20010SubmitWarehouse jinProt = new Jin20010SubmitWarehouse();
//			jinProt.submitWarehouse(create, getWarehouseBean());
//			System.err.println("resBean:" + p_Spec.getResBean().toString());	
			// -----------------补托------------------劲酒-------20013--------------------------------------------------
//			Jin20013AddPallet jinProt = new Jin20013AddPallet();
//			jinProt.addPallet(create, getJin20013ReqBean());
//			System.err.println("ressBean:" + jinProt.getResBean().toString());	
			// -----------------组托------------------劲酒-------20014--------------------------------------------------
//			Jin20014ReorganizationPallet jinProt = new Jin20014ReorganizationPallet();
//			jinProt.reorganizationPallet(create, getJin20014ReqBean());
//			System.err.println("resBean:" + jinProt.getResBean().toString());	
			// -----------------更新产线信息------------------劲酒-------20017--------------------------------------------------
//			Jin20017ReqLineInfo l = new Jin20017ReqLineInfo();
//			l.reqLine(create);
//			System.err.println("resBean: " + l.getResBean().toString());
			// -----------------拆托------------------劲酒-------20016--------------------------------------------------
//			Jin20016SubmitRemovePallet l = new Jin20016SubmitRemovePallet();
//			l.removePallet(create,new SingleLabelIdBean("286785104411"));
//			System.err.println("resBean: " + l.getResBean().toString());
			
			// -----------------获取仓库列表------------------劲酒-------20018--------------------------------------------------
//			Jin20018ReqWarehouseInfo l = new Jin20018ReqWarehouseInfo();
//			l.reqWarehouseBean(create);
//			System.err.println("resBean:" + l.getResBean().toString());
			// -----------------获取发运单列表------------------劲酒-------20019--------------------------------------------------
//			Jin20019ReqWarehouseOrder l = new Jin20019ReqWarehouseOrder();
//			l.reqWarehouseOrder(create, new Jin20019ReqBean("JP61",3));
//			System.err.println("resBean:" + l.getResBean().toString());
			// -----------------提交出库信息------------------劲酒-------20021--------------------------------------------------
//			Jin20021SubmitWarehouseOrder l = new Jin20021SubmitWarehouseOrder();
//			l.submitWarehouse(create, get20021ReqBean(),"");
//			System.err.println("resBean:" + l.getResBean().toString());
			// -----------------设置发货完成状态------------------劲酒-------20020--------------------------------------------------
//			Jin20020SetShipmentComplete l = new Jin20020SetShipmentComplete();
//			l.setShipmentStatus(create, new Jin20020ReqBean("335525"));
//			System.err.println("resBean:" + l.getResBean().toString());
			// -----------------提交经销商出库信息------------------劲酒-------20022--------------------------------------------------
//			Jin20022SubmitDealerOrder l = new Jin20022SubmitDealerOrder();
//			l.submitWarehouse(create, getJin20022ReqBean());
//			System.err.println("resBean:" + l.getResBean().toString());
			// -----------------提交经销商出库信息-提交离线出库为在线-----------------劲酒-------20022--------------------------------------------------
//			List<Jin20022ReqBean> l22 = getDealerOfflineData();
//			for (Jin20022ReqBean jin20022ReqBean : l22) {
//				Jin20022SubmitDealerOrder l = new Jin20022SubmitDealerOrder();
//				l.submitWarehouse(create, jin20022ReqBean);
//				Jin20021ResBean resBean = l.getResBean();
//				if (resBean.getResult() == 0) {
//					System.out.println("上传成功");
//				} else {
//					System.err.println("上传失败：\n" + jin20022ReqBean.toString() +  "\n" + resBean.toString());
//				}
//			}
			// -----------------提交经销商离线出库信息------------------劲酒-------20023--------------------------------------------------
//			Jin20023SubmitOfflineDealerOrder l = new Jin20023SubmitOfflineDealerOrder();
////			l.submitWarehouse(create, getJin20023ReqBean());
//			l.submitWarehouse(create, getDealerSingleOfflineData());
//			System.err.println("resBean:" + l.getResBean().toString());
			// -----------------提交DB出库信息------------------劲酒-------20024--------------------------------------------------
//			Jin20024SubmitDBWarehouseOrder l = new Jin20024SubmitDBWarehouseOrder();
//			l.submitWarehouse(create, get20024ReqBean(),"52742312");
//			System.err.println("resBean:" + l.getResBean().toString());
			// -----------------提交ACCOUNT出库信息------------------劲酒-------20025--------------------------------------------------
//			Jin20025SubmitAccountWarehouseOrder l = new Jin20025SubmitAccountWarehouseOrder();
//			l.submitWarehouse(create, get20025ReqBean());
//			System.err.println("resBean:" + l.getResBean().toString());
			// -----------------提交经销商信息------------------劲酒-------20026--------------------------------------------------
//			Jin20026SubmitDealerInfo l = new Jin20026SubmitDealerInfo();
//			l.submitDealerInfo(create, get20026ReqBean());
//			System.err.println("resBean:" + l.getResBean().toString());
			// -----------------根据订单编号，获取发货信息------------------劲酒-------20027--------------------------------------------------
//			Jin20027ReqDealerOrderInfo l = new Jin20027ReqDealerOrderInfo();
//			l.reqDealerOrderInfo(create,new Jin20027ReqBean("1117112103010006"));//1117112103010006
//			System.err.println("resBean:" + l.getResBean().toString());
			// -----------------提交经销商退货信息------------------劲酒-------20028--------------------------------------------------
//			Jin20028SubmitReturnedGoods l = new Jin20028SubmitReturnedGoods();
//			l.submitReturnedGoods(create, new Jin20028ReqBean("37101004", "273423085603"));
//			System.err.println("resBean:" + l.getResBean().toString());
			// -----------------根据订单编号，设置当前订单的状态------------------劲酒-------20029--------------------------------------------------
//			Jin20029RecoverWarehouseOrder l = new Jin20029RecoverWarehouseOrder();
//			l.setOrderStatus(create, new Jin20029ReqBean("JP63","M1711005247", 3));// 1代表删除 2 代表恢复 3代表已经发货完成
//			System.err.println("resBean:" + l.getResBean().toString());
			// -----------------根据订单编号，合并订单------------------劲酒-------20030--------------------------------------------------
//			Jin20030CombineWarehouseOrder l = new Jin20030CombineWarehouseOrder();
//			l.combineOrder(create, new Jin20030ReqBean("M1711003215", "JP63"));
//			System.err.println("resBean:" + l.getResBean().toString());
			// -----------------根据订单编号，设置防窜码------------------劲酒-------20031--------------------------------------------------
			Jin20031SetTraceCode l = new Jin20031SetTraceCode();
			l.setTraceCode(create, getJin20031ReqBean());
			System.err.println("resBean:" + l.getResBean().toString());
			// -----------------组托时，生成托盘码------------------劲酒-------20032--------------------------------------------------
//			Jin20032CreatePalletCode l = new Jin20032CreatePalletCode();
//			l.createPalletCode(create, new Jin20032ReqBean("273423082804"));
//			System.err.println("resBean:" + l.getResBean().toString());
			// -----------------组托时，生成托盘码------------------劲酒-------20033--------------------------------------------------
//			Jin20033ReorganizationPallet l = new Jin20033ReorganizationPallet();
//			l.reorganizationPallet(create, getJin20033ReqBean());
//			System.err.println("resBean:" + l.getResBean().toString());
			// -----------------根据订单编号，获取可合并的订单号------------------劲酒-------20034--------------------------------------------------
//			Jin20034ReqCanMergeOrder l = new Jin20034ReqCanMergeOrder();
//			l.reqMergeOrder(create, new Jin20034ReqBean("53328845", "JP84"));
//			l.reqMergeOrder(create, new Jin20034ReqBean("M1711003218", "JP65"));
			// -----------------合并不通订单号的订单------------------劲酒-------20035--------------------------------------------------
//			Jin20035MergeOrder l = new Jin20035MergeOrder();
//			l.mergeOrder(create, getJin20035ReqBean());
			// -----------------检查订单的合法性------------------劲酒-------20036--------------------------------------------------
//			Jin20036CheckOrderValid l = new Jin20036CheckOrderValid();
//			l.checkOrderValid(create, new Jin20036ReqBean("52743210", "JP63"));
//			l.checkOrderValid(create, new Jin20036ReqBean("52747991", "JP64"));
//			l.checkOrderValid(create, new Jin20036ReqBean("52747991", "JP63"));
			// -----------------调货------------------劲酒-------20037--------------------------------------------------
//			Jin20037ExchangeCargo l = new Jin20037ExchangeCargo();
//			l.exchangeCargo(create, getJin20037ReqBean());
//			System.err.println(l.getResBean().toString());


			
		} 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);
		}
	}

	

	private static Jin20037ReqBean getJin20037ReqBean() {
		Jin20037ReqBean reqBean = new Jin20037ReqBean();
		reqBean.setOldorder_no("M1711003221");
		reqBean.setItem_code("zb000084");
		reqBean.setNeworder_no("M1711005248");
//		reqBean.setOldorder_no("M1711005248");
//		reqBean.setItem_code("zb000084");
//		reqBean.setNeworder_no("M1711003215");
//		reqBean.setNeworder_no("M1711003221");
		
		
		reqBean.setHouse_code("JP63");
		return reqBean;
	}



	enum ReqType{
		TEST_PROT,
		WAREHOUSE_PROT,
		DEALER_PROT,
		WAREHOUSE_TEST_PROT
	}
	//  1:正式仓库  2：正式经销商
	private static String getIp(ReqType type) {
		String ip = "218.245.0.109";
		switch (type) {
		case WAREHOUSE_TEST_PROT:
		case WAREHOUSE_PROT:
			ip = "zs-wms.jingpai.com";
			break;
		case DEALER_PROT:
			ip = "zs-pda.jingpai.com";
			break;
		default:
			ip = "218.245.0.109";
			break;
		}
		return ip;
	}
	
	private static int getProt(ReqType type) {
		int prot = 8090;
		switch (type) {
		case WAREHOUSE_TEST_PROT:
			prot = 35253;
			break;
		case WAREHOUSE_PROT:
			prot = 35252;
			break;
		case DEALER_PROT:
			prot = 35251;
			break;
		default:
			prot = 8090;
			break;
		}
		return prot;
	}

	private static Jin20035ReqBean getJin20035ReqBean() {
		Jin20035ReqBean reqBean = new Jin20035ReqBean();
		reqBean.setOrder_number("M1711004938");
		reqBean.setHouse_code("JP63");
		reqBean.setList(getMergeOrderList());
		System.out.println("提交的数据：" + reqBean.toString());
		return reqBean;
	}

	private static List<SingleOrderNoBean> getMergeOrderList() {
		List<SingleOrderNoBean> l = new ArrayList<>();
		l.add(new SingleOrderNoBean("M1711004958"));
		l.add(new SingleOrderNoBean("M1711004962"));
		return l;
	}

	private static Jin20033ReqBean getJin20033ReqBean() {
		Jin20033ReqBean reqBean = new Jin20033ReqBean();
		reqBean.setPackage_label_id("273423134104");
		reqBean.setProduct_id("zb000084");
		reqBean.setTray_id("27342314501001");
		return reqBean;
	}
	private static List<Jin20022ReqBean> getDealerOfflineData() {
		List<Jin20022ReqBean> l22 = new ArrayList<>();
		Gson gson = new Gson();
		String logPath = "D:\\echo\\JinTestData\\service_log.txt";	
		FileOperation operation = new FileOperation();
		try {
			String logStr = operation.readTxtFile(new File(logPath));
			Jin20023ReqBean reqOffBean = gson.fromJson(logStr, Jin20023ReqBean.class);
			System.out.println("reqBean:" + reqOffBean.toString());
			List<String> l = reqOffBean.getPallet_box_list();
			for (int i = 0; i < l.size(); i++) {
				Jin20022ReqBean reqBean = new Jin20022ReqBean();
				reqBean.setPackage_label_id(l.get(i));
				reqBean.setOrder_number(reqOffBean.getOrder_number());
				reqBean.setDealer_id(reqOffBean.getDealer_id());
				reqBean.setSecond_dealer_id(reqOffBean.getSecond_dealer_id());
				reqBean.setSecond_dealer_name(reqOffBean.getSecond_dealer_name());
				reqBean.setOpt(2);//1代表单箱 2 代表整托， 3代表剔箱， 4代表剔托
				l22.add(reqBean);
			}
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return l22;
		
	}
	private static Jin20031ReqBean getJin20031ReqBean() {
		Jin20031ReqBean reqBean = new Jin20031ReqBean();
		reqBean.setHouse_code("JP63");
		reqBean.setOrderNo("M17110032151");
		reqBean.setTrace_id("23456789");
		return reqBean;
	}

	private static Jin20026ReqBean get20026ReqBean() {
		DealerOrderInvoiceTools cInvoiceTools = new DealerOrderInvoiceTools();
//		String t="02703002||1117112103010006||老刘串串||(zzgj2503,1000)|(zzgj2602,2000)|(za000025,5000)";
		String t="02703002||111711270701_test||鑫宏达||(zkqj0218,200)|(zkqj0206,100)|(zkqj0223,100)";
		DealerInvoiceFromOrderBeanT b = cInvoiceTools.parseDealerOrder(t);
		System.out.println("" + b);
		Jin20026ReqBean reqBean = new Jin20026ReqBean();
		reqBean.setDealer_id("02703002");
//		reqBean.setSecond_dealer_id("02703003");
//		reqBean.setSecond_dealer_name("老刘串串");
		reqBean.setSecond_dealer_id(b.getDealer_id());
		reqBean.setSecond_dealer_name(b.getDealer_name());
		reqBean.setOrder_number(b.getOrder_id());
		List<JinOrderProductBean> l = new ArrayList<>();
		for (int i = 0; i < b.getProducts().size(); i++) {
			JinOrderProductBean pB = new JinOrderProductBean();
			pB.setItemCode(b.getProducts().get(i).getProduct_nid());
			pB.setOrder_amount(b.getProducts().get(i).getOrderAmount());
			l.add(pB);
		}
		reqBean.setList(l);
		return reqBean;
	}

	private static Jin20025ReqBean get20025ReqBean() {
		Jin20025ReqBean reqBean = new Jin20025ReqBean();
//		reqBean.setLabel_id(JinLabelUtil.getLabelId22("110050700100700288"));
//		reqBean.setLabel_id("28802335347320");//瓶码
//		reqBean.setLabel_id("288023140347");//箱码
//		reqBean.setLabel_id("28802335347120");
//		reqBean.setLabel_id(JinLabelUtil.getLabelId22("519070100100700285"));
//		reqBean.setLabel_id("273423082804");
		//正式上传失败的数据
//		reqBean.setLabel_id("7100709001227200961278");
		
//		reqBean.setLabel_id("288823075306");
//		reqBean.setLabel_id("288823095376");
//		reqBean.setOrder_number("201711JDSQ010071JP0_JP61_0");
//		reqBean.setHouse_code("JP61");
//		reqBean.setFlag(3);//“flag”:1 1表示瓶码 2表示盒码 3表示箱码 4代表托盘
//		reqBean.setOpt(2);//“opt”:1 1代表正常出库 2代表T操作
		
		
//		reqBean.setLabel_id("305923082781");
//		reqBean.setLabel_id("30592317292631");
//		reqBean.setLabel_id("305923141818");
//		reqBean.setLabel_id(JinLabelUtil.getLabelId22("115020400143829564"));
//		reqBean.setLabel_id("30592319113793");
//		reqBean.setLabel_id("305923162017");
//		reqBean.setOrder_number("201710JDSQ010095JP0_JP61_0");
//		reqBean.setOrder_number("201712JDSQ010114JP0_JP61_0");//77348
//		reqBean.setHouse_code("JP61");
//		reqBean.setFlag(4);//“flag”:1 1表示瓶码 2表示盒码 3表示箱码 4代表托盘
//		reqBean.setOpt(2);//“opt”:1 1代表正常出库 2代表T操作
		
//		reqBean.setLabel_id("1130709001007039765050");//113070900100703755
		reqBean.setLabel_id("256432110440");//110000000100712206
		reqBean.setOrder_number("SO18072500054");
//		reqBean.setOrder_number("SO18071900246");
		reqBean.setHouse_code("JP62");
		reqBean.setFlag(3);//“flag”:1 1表示瓶码 2表示盒码 3表示箱码 4代表托盘
		reqBean.setOpt(2);//“opt”:1 1代表正常出库 2代表T操作
		
		return reqBean;
	}


	private static Jin20024ReqBean get20024ReqBean() {
		Jin20024ReqBean reqBean = new Jin20024ReqBean();//7755116,7754954,7755154,7755213
		//-------------------------------1-----------------------------------
//		reqBean.setOld_house_code("JP63");
//		reqBean.setNew_house_code("JP84");
//		reqBean.setOrder_no("52743489");
//		//整托
//		reqBean.setPackage_label_id("273423082804");//
//		reqBean.setOpt(2);//1代表单箱 2 代表整托， 3代表剔箱， 4代表剔托
		//-------------------------------2-----------------------------------
		reqBean.setOld_house_code("JP63");
		reqBean.setNew_house_code("JP61");
		reqBean.setOrder_no("53242016");
		//整托
		reqBean.setPackage_label_id("273423085601");//
		reqBean.setOpt(2);
		//-------------------------------3-----------------------------------
//		reqBean.setOld_house_code("JP61");
//		reqBean.setNew_house_code("JP69");
//		reqBean.setOrder_no("52743779");
//		//整托
//		reqBean.setPackage_label_id("273423082804");//
//		reqBean.setOpt(2);
		//-------------------------------3-----------------------------------
//		reqBean.setOld_house_code("JP61");
//		reqBean.setNew_house_code("JP69");
//		reqBean.setOrder_no("52744440");
//		// 整托
//		reqBean.setPackage_label_id("273423082804");//
//		reqBean.setOpt(2);
		
		return reqBean;
	}

	private static Jin20023ReqBean getDealerSingleOfflineData() {
		Gson gson = new Gson();
		String logPath = "D:\\echo\\JinTestData\\service_log.txt";	
		FileOperation operation = new FileOperation();
		try {
			String logStr = operation.readTxtFile(new File(logPath));
			Jin20023ReqBean reqOffBean = gson.fromJson(logStr, Jin20023ReqBean.class);
			System.out.println("reqBean:" + reqOffBean.toString());
			return reqOffBean;
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
		}
	private static Jin20023ReqBean getJin20023ReqBean() {
		Jin20023ReqBean reqBean = new Jin20023ReqBean();
		reqBean.setOrder_number("JX1234567");
		reqBean.setDealer_id("714040011");
		reqBean.setSecond_dealer_id("71404001_2");
		reqBean.setPallet_box_list(getPalletBoxList());
		reqBean.setSingle_box_list(getSingleBoxList());
		return reqBean;
	}


	private static List<String> getPalletBoxList() {
		List<String> l = new ArrayList<>();
		for (int i = 0; i < 10; i++) {
			l.add(JinLabelUtil.getBoxCode(23));
		}
		
		return l;
	}
	private static List<String> getSingleBoxList() {
		List<String> l = new ArrayList<>();
		for (int i = 20; i < 40; i++) {
			l.add(JinLabelUtil.getBoxCode(23));
		}
		
		return l;
	}

	private static Jin20022ReqBean getJin20022ReqBean() {
		Jin20022ReqBean reqBean = new Jin20022ReqBean();
		reqBean.setPackage_label_id("273623092566");//273423082804    276923080403
		reqBean.setOrder_number("echo_test_2018");
		reqBean.setDealer_id("02701002");
		reqBean.setSecond_dealer_id("02701002_4564745241520813628");
		reqBean.setSecond_dealer_name("武汉市青山区鑫兴隆副食经营部（29街光明社区）");
		reqBean.setOpt(4);// 1代表单箱 2 代表整托， 3代表剔箱， 4代表剔托
		
		return reqBean;
	}


	/*private static Jin20021ReqBean get20021ReqBean() {
		Jin20021ReqBean reqBean = new Jin20021ReqBean();
//		reqBean.setPackage_label_id("273423085601");

		reqBean.setPackage_label_id("305923070511");
		
		reqBean.setOrder_no("M1711003215");
		reqBean.setHouse_code("JP64");
		reqBean.setDealer_id("02004001");
//		reqBean.setOrder_no("M1711004839");
//		reqBean.setHouse_code("JP84");
//		reqBean.setDealer_id("71204004");
		reqBean.setOpt(4);//1代表单箱 2 代表整托， 3代表剔箱， 4代表剔托
		return reqBean;
	}*/
	
	private static Jin20021ReqBean get20021ReqBean() {
		Jin20021ReqBean reqBean = new Jin20021ReqBean();
//		reqBean.setPackage_label_id("256250053546");//305923070512
		reqBean.setPackage_label_id("318923172907");//109的测试数据
		reqBean.setOrder_no("M18100004246");
		reqBean.setHouse_code("JP61");
		reqBean.setDealer_id("11000015352");
//		reqBean.setOrder_no("M1711003221");
//		reqBean.setHouse_code("JP63");
//		reqBean.setDealer_id("75501003");
		reqBean.setOpt(4);//1代表单箱 2 代表整托， 3代表剔箱， 4代表剔托
		return reqBean;
	}


	private static Jin20014ReqBean getJin20014ReqBean() {
		Jin20014ReqBean reqBean = new Jin20014ReqBean();
		List<SingleLabelIdBean> l = new ArrayList<>();
		l.add(new SingleLabelIdBean("286785104400"));
		l.add(new SingleLabelIdBean("286785104410"));
		
		reqBean.setList(l);
		return reqBean;
	}


	private static Jin20013ReqBean getJin20013ReqBean() {
		Jin20013ReqBean reqBean = new Jin20013ReqBean();
		reqBean.setTray_id("2880851401003");
//		System.err.println(" " + getPackageList());
		reqBean.setList(getPackageList());
		return reqBean;
	}


	private static Jin20010ReqBean getWarehouseBean() {
		Jin20010ReqBean reqBean = new Jin20010ReqBean();
		reqBean.setOrder_number("12345677");
		reqBean.setDealer_id(1);
		reqBean.setDealer_flag(1);
		reqBean.setDevice_id("201001");//201001:仓库身份     301001：经销商身份
		reqBean.setTray_list(getTrayList());//按托出库
//		reqBean.setPackage_list(getPackageList());//按箱出库
		return reqBean;
	}


	private static List<SingleLabelIdBean> getTrayList() {
		List<SingleLabelIdBean>  l = new ArrayList<>();
//		l.add(new SingleLabelIdBean(""));
//		for (int i = 0; i < 10; i++) {
//			l.add(new SingleLabelIdBean(JinLabelUtil.getBoxCode(line_code)));
//		}
		
		l.add(new SingleLabelIdBean("286985161000"));
		return l;
	}


	private static List<SingleLabelIdBean> getPackageList() {
//		、、{"count":4}
		List<SingleLabelIdBean>  l = new ArrayList<>();
		l.add(new SingleLabelIdBean("286785104405"));
//		l.add(new SingleLabelIdBean("286785104402"));
//		l.add(new SingleLabelIdBean("286785104403"));
//		l.add(new SingleLabelIdBean("286785104419"));
//		l.add(new SingleLabelIdBean("286785104666"));
		
//		for (int i = 0; i < 10; i++) {
//			l.add(new SingleLabelIdBean(JinLabelUtil.getBoxCode(line_code)));
//		}
		return l;
	}


	private static Jin20008ReqBean getJin20008ReqBean() {
		Jin20008ReqBean reqBean = new Jin20008ReqBean();
//		reqBean.setDevice_id("101000");
//		reqBean.setProduct_id("100000");
//		reqBean.setProduce_date("2017-11-02");
//		reqBean.setBatch_number("1234565");
//		reqBean.setGroup_number("668");
		reqBean.setLine_id(301);
		reqBean.setPackage_label_id("287323104404");
		reqBean.setList(getGiftBoxList());
		return reqBean;
	}




	private static List<SingleLabelIdBean> getGiftBoxList() {
		List<SingleLabelIdBean> l = new ArrayList<>();
		l.add(new SingleLabelIdBean("3110001001007008590097"));
		l.add(new SingleLabelIdBean("4160600001007001541603"));
		l.add(new SingleLabelIdBean("1120306001007006541519"));
		return l;
	}


	private static Jin20007ReqBean getJin20007ReqBean() {
		Jin20007ReqBean reqBean = new Jin20007ReqBean();
//		reqBean.setDevice_id("101000");
//		reqBean.setProduct_id("100000");
//		reqBean.setProduce_date("2017-11-01");
//		reqBean.setBatch_number("1234565");
//		reqBean.setGroup_number("668");
		reqBean.setLine_id(301);
		reqBean.setList(getBottleList());
		return reqBean;
	}



	private static List<JinBottleBean> getBottleList() {
		List<JinBottleBean>  l = new ArrayList<>();
//		l.add(new JinBottleBean("4150606001007008580200", "28678500101927"));
//		l.add(new JinBottleBean("4100204001007000550414", "28678500101892"));
//		l.add(new JinBottleBean("6150502001007006550732", "28678500101643"));//
//		l.add(new JinBottleBean("8110106001007005500521", "28678500101756"));
		long orginZs = 123456789123L;
		for (int i = 0; i < 10; i++) {
			orginZs++;
			String boxStr = JinLabelUtil.getJinLabelId(orginZs);
			String bottleStr = JinLabelUtil.getBottleId(23);
			l.add(new JinBottleBean(boxStr, bottleStr));
		}
		
//		l.add(new JinBottleBean("8130808001007002584020", JinLabelUtil.getBottleId(23)));
		System.out.println("getBottleList: " + l.toString());
		
		return l;
	}






	private static String getLabelId(String id) {
		String labelId = LableUtil.getCheckNum(id);
		return labelId;
	}

}
