package cn.net.caoyao.cpzshandset.service.presenter.tools;

import android.content.Context;
import android.content.Intent;
import cn.net.caoyao.cpzshandset.common.config.HandsetVersionConstant;
import cn.net.caoyao.cpzshandset.db.dal.common.CommonUploadStatusDal;
import cn.net.caoyao.cpzshandset.db.dal.commonEgg.CommonEggUploadStatusDal;
import cn.net.caoyao.cpzshandset.db.dal.commonfarmers.CommonFarmersUploadStatusDal;
import cn.net.caoyao.cpzshandset.db.dal.counter.CounterUploadStatusDal;
import cn.net.caoyao.cpzshandset.db.dal.kia.KIAUploadStatusDal;
import cn.net.caoyao.cpzshandset.db.dal.liqueur.LiqueurUploadStatusDal;
import cn.net.caoyao.cpzshandset.db.dal.liqueurSFY.LiqueurSFYUploadStatusDal;
import cn.net.caoyao.cpzshandset.db.dal.ythPunit.YthPunitShipmentUploadStatusDal;
import cn.net.caoyao.cpzshandset.db.dal.ythScaner.YthScannerShipmentUploadStatusDal;
import cn.net.caoyao.cpzshandset.db.dal.yunCar.YunCarUploadStatusDal;
import cn.net.caoyao.cpzshandset.db.presenter.ShipmentUploadStatusDal;
import cn.net.caoyao.cpzshandset.db.presenter.UploadStatusDal;
import cn.net.caoyao.cpzshandset.service.presenter.UploadStatusConstact;
import cn.net.caoyao.cpzshandset.service.presenter.impl.upload.common.CommonUploadStatusPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.upload.commonEgg.CommonEggUploadStatusPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.upload.commonfarmers.CommonFarmersUploadStatusPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.upload.counter.CounterUploadStatusPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.upload.jinLiquor.JinLiquorUploadStatus;
import cn.net.caoyao.cpzshandset.service.presenter.impl.upload.kia.KIAUploadStatusPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.upload.liqueur.LiqueurUploadStatusPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.upload.liqueurSFY.LiqueurSFYUploadStatusPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.upload.ythPunit.YthPunitUploadStatusPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.upload.ythScanner.YthScannerUploadStatusPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.upload.yuncar.YunCarUploadStatusPresenter;


public class UploadStatusCreateTools {
	/**
	 * 获取激活列表的presenter
	 * @param cacheG
	 * @param context
	 * @param hisView
	 * @param intent
	 * @return
	 */
	public UploadStatusConstact.Presenter createUploadStatusPresenter(int handsetVersionMode, Context context,
			UploadStatusConstact.View uView, Intent intent) {
		UploadStatusConstact.Presenter presenter = null;

		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE:
			// 通用版
			presenter = new CommonUploadStatusPresenter(uView, context);
			break;
		case HandsetVersionConstant.HANDSET_YTH_SCANNER_SHIPMENT_VERSION_MODE:
			//云天化  扫码版发货
			presenter = new YthScannerUploadStatusPresenter(uView, context);
			break;
		case HandsetVersionConstant.HANDSET_LIQUEUR_VERSION_MODE:
			//白酒
			presenter = new LiqueurUploadStatusPresenter(uView, context);
			break;
		case HandsetVersionConstant.HANDSET_COUNTER_VERSION_MODE:
			//专柜
			presenter = new CounterUploadStatusPresenter(uView, context);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_EGG_VERSION_MODE:
			// 通用鸡蛋版
			presenter = new CommonEggUploadStatusPresenter(uView, context);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE_FARMERS:
			// 通用版养殖户
			presenter = new CommonFarmersUploadStatusPresenter(uView, context);
			break;	
		case HandsetVersionConstant.HANDSET_YTH_SCANNER_SHIPMENT_PUNIT_VERSION_MODE:
			presenter = new YthPunitUploadStatusPresenter(uView, context);
			break;
		case HandsetVersionConstant.HANDSET_LIQUEUR_SFY_VERSION_MODE:
			presenter = new LiqueurSFYUploadStatusPresenter(uView, context,intent);
			break;
		case HandsetVersionConstant.HANDSET_YUN_CAR_VERSION_MODE:
			presenter = new YunCarUploadStatusPresenter(uView, context);
			break;
		case HandsetVersionConstant.HANDSET_JIN_LIQUOR_VERSION_MODE:
			//劲酒
			presenter = new JinLiquorUploadStatus(uView, context);
			break;
		case HandsetVersionConstant.HANDSET_KIA_PRODUCT_LINE_VERSION_MODE:
			//起亚
			presenter = new KIAUploadStatusPresenter(uView, context);
			break;	
	
			
		}
		return presenter;
	}
	
	
	
	/**
	 * 获取激活相关的数据库dal
	 * @param handsetVersionMode
	 * @param context
	 * @return
	 */
	public UploadStatusDal createUploadStatusDal(int handsetVersionMode, Context context){
		UploadStatusDal dal = null;
		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE:
			// 通用版
			dal = new CommonUploadStatusDal(context);
			break;
		case HandsetVersionConstant.HANDSET_RICE_VERSION_MODE:
			// 大米
			break;
		case HandsetVersionConstant.HANDSET_HOLOTHURIAN_VERSION_MODE:
			// 海参
			break;
		case HandsetVersionConstant.HANDSET_WINE_TERMINAL_VERSION_MODE:
			// 酒终端
			break;
		case HandsetVersionConstant.HANDSET_WINE_DEALER_VERSION_MODE:
			// 酒经销商
			break;
		case HandsetVersionConstant.HANDSET_FIRE_EXTINGUISHER_VERSION_MODE:
			// 灭火器
			break;
		case HandsetVersionConstant.HANDSET_AGRICULTURAL_PRODUCTS_VERSION_MODE:
			// 农产品
			break;
		case HandsetVersionConstant.HANDSET_SEED_VERSION_MODE:
			// 种子
			break;
		case HandsetVersionConstant.HANDSET_YTH_VERSION_MODE:
			// 云天化
			break;
		case HandsetVersionConstant.HANDSET_LIQUEUR_VERSION_MODE:
			//白酒
			dal = new LiqueurUploadStatusDal(context);
			break;
		case HandsetVersionConstant.HANDSET_COUNTER_VERSION_MODE:
			//专柜销售
			dal = new CounterUploadStatusDal(context);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_EGG_VERSION_MODE:
			// 通用鸡蛋版
			dal = new CommonEggUploadStatusDal(context);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE_FARMERS:
			// 通用版
			dal = new CommonFarmersUploadStatusDal(context);
			break;
		case HandsetVersionConstant.HANDSET_LIQUEUR_SFY_VERSION_MODE:
			//武汉世方御养生酒业有限公司
			dal = new LiqueurSFYUploadStatusDal(context);
			break;
			
		case HandsetVersionConstant.HANDSET_YUN_CAR_VERSION_MODE:
			// 云南汽配
			dal = new YunCarUploadStatusDal(context);
			break;	
		case HandsetVersionConstant.HANDSET_KIA_PRODUCT_LINE_VERSION_MODE:
			// 起亚
			dal = new KIAUploadStatusDal(context);
			break;	
		}
		return dal;
	}
	
	/**
	 * 获取激活相关的数据库dal
	 * @param handsetVersionMode
	 * @param context
	 * @return
	 */
	public ShipmentUploadStatusDal createShipmentUploadStatusDal(int handsetVersionMode, Context context){
		ShipmentUploadStatusDal dal = null;
		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_YTH_SCANNER_SHIPMENT_VERSION_MODE:
			// 通用版
			dal = new YthScannerShipmentUploadStatusDal(context);
			break;
		case HandsetVersionConstant.HANDSET_YTH_SCANNER_SHIPMENT_PUNIT_VERSION_MODE:
			// 通用版
			dal = new YthPunitShipmentUploadStatusDal(context);
			break;
		}
		return dal;
	}
}
