package com.ygtx.emcs.util;

import com.ygtx.emcs.activity.StockInActivity;
import com.ygtx.emcs.activity.StockInNewActivity;
import com.ygtx.emcs.activity.StockItemActivity;
import com.ygtx.emcs.activity.StockOutActivity;
import com.ygtx.emcs.activity.StockOutNewActivity;
import com.ygtx.emcs.activity.StockPackageActivity;
import com.ygtx.emcs.activity.model.MainModel;

import java.util.ArrayList;

public class DataUtil {

    public static ArrayList<MainModel> getMenus(String key){
        ArrayList<MainModel> shops = new ArrayList<MainModel>();
        addMenu(shops,getMenu(StockInNewActivity.class,"b8","入库单","",0),key);
        addMenu(shops,getMenu(StockOutNewActivity.class,"b4","出库单","",0),key);
        addMenu(shops,getMenu(StockPackageActivity.class,"b7","打包区","",0),key);
        addMenu(shops,getMenu(StockItemActivity.class,"b10","库位信息","",0),key);
//        addMenu(shops,getMenu(BoxCheckActivity.class,"b10","料框检验","",0),key);
        return shops;
    }

    private static void addMenu(ArrayList<MainModel> shops,MainModel menu,String author){
        shops.add(menu);
    }

    private static MainModel getMenu(Class clz,String logo,String title,String key,int header){
        MainModel shop = new MainModel();
        shop.setActionClass(clz);
        shop.setLogo(logo);
        shop.setTitle(title);
        shop.setKey(key);
        shop.setHeaderId(header);
        if(header == 0){
            shop.setGroupName("业务流程");
        }
        if(header == 1){
            shop.setGroupName("基础信息");
        }
        if(header == 2){
            shop.setGroupName("机器人");
        }
        return shop;
    }

    public static void main(String args[]) {
//        String v = DataUtil.getConData("A12");
//        System.out.println(v);
//        byte[] writeDataBytes = Tools.HexString2Bytes("02BB2021060001");
//        System.out.println(writeDataBytes.length);
//        System.out.println(Tools.Bytes2HexString(writeDataBytes,writeDataBytes.length));
//        System.out.println(new String(v));
    }
}
