package com.engine.kq.cmd.upgrade;

import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.entity.BizLogContext;
import com.engine.core.interceptor.CommandContext;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import weaver.general.Util;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
import weaver.systeminfo.SystemEnv;

/**
 * 获取左侧Tab信息
 * @author pzy
 *
 */
public class GetTreeTabsCmd extends AbstractCommonCommand<Map<String, Object>>{

	public GetTreeTabsCmd(Map<String, Object> params, User user) {
		this.user = user;
		this.params = params;
	}

	@Override
	public BizLogContext getLogContext() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Map<String, Object> execute(CommandContext commandContext) {
		Map<String,Object> retmap = new HashMap<String,Object>();
		try {

			List<Map<String,Object>> tabs = new ArrayList<Map<String,Object>>();
			Map<String,Object> tab = null;

			tab = new HashMap<String, Object>();
			tab.put("key", KQUpgradeTabEnum.Upgrade1.getTabtype());
			tab.put("title", SystemEnv.getHtmlLabelName(KQUpgradeTabEnum.Upgrade1.getTablabel(),user.getLanguage()));
			tabs.add(tab);
			
			tab = new HashMap<String, Object>();
			tab.put("key", KQUpgradeTabEnum.Upgrade2.getTabtype());
			tab.put("title", SystemEnv.getHtmlLabelName(KQUpgradeTabEnum.Upgrade2.getTablabel(),user.getLanguage()));
			tabs.add(tab);

      tab = new HashMap<String, Object>();
      tab.put("key", KQUpgradeTabEnum.Upgrade3.getTabtype());
      tab.put("title", SystemEnv.getHtmlLabelName(KQUpgradeTabEnum.Upgrade3.getTablabel(),user.getLanguage()));
      tabs.add(tab);

      tab = new HashMap<String, Object>();
      tab.put("key", KQUpgradeTabEnum.Upgrade4.getTabtype());
      tab.put("title", SystemEnv.getHtmlLabelName(KQUpgradeTabEnum.Upgrade4.getTablabel(),user.getLanguage()));
      tabs.add(tab);

      tab = new HashMap<String, Object>();
      tab.put("key", KQUpgradeTabEnum.Upgrade5.getTabtype());
      tab.put("title", SystemEnv.getHtmlLabelName(KQUpgradeTabEnum.Upgrade5.getTablabel(),user.getLanguage()));
      tabs.add(tab);

      tab = new HashMap<String, Object>();
      tab.put("key", KQUpgradeTabEnum.Upgrade6.getTabtype());
      tab.put("title", SystemEnv.getHtmlLabelName(KQUpgradeTabEnum.Upgrade6.getTablabel(),user.getLanguage()));
      tabs.add(tab);

      tab = new HashMap<String, Object>();
      tab.put("key", KQUpgradeTabEnum.Upgrade7.getTabtype());
      tab.put("title", SystemEnv.getHtmlLabelName(KQUpgradeTabEnum.Upgrade7.getTablabel(),user.getLanguage()));
      tabs.add(tab);

      tab = new HashMap<String, Object>();
      tab.put("key", KQUpgradeTabEnum.Upgrade8.getTabtype());
      tab.put("title", SystemEnv.getHtmlLabelName(KQUpgradeTabEnum.Upgrade8.getTablabel(),user.getLanguage()));
      tabs.add(tab);

//      tab = new HashMap<String, Object>();
//      tab.put("key", KQUpgradeTabEnum.Upgrade9.getTabtype());
//      tab.put("title", SystemEnv.getHtmlLabelName(KQUpgradeTabEnum.Upgrade9.getTablabel(),user.getLanguage()));
//      tabs.add(tab);

      tab = new HashMap<String, Object>();
      tab.put("key", KQUpgradeTabEnum.Upgrade10.getTabtype());
      tab.put("title", SystemEnv.getHtmlLabelName(KQUpgradeTabEnum.Upgrade10.getTablabel(),user.getLanguage()));
      tabs.add(tab);

//      tab = new HashMap<String, Object>();
//      tab.put("key", KQUpgradeTabEnum.Upgrade11.getTabtype());
//      tab.put("title", SystemEnv.getHtmlLabelName(KQUpgradeTabEnum.Upgrade11.getTablabel(),user.getLanguage()));
//      tabs.add(tab);

      tab = new HashMap<String, Object>();
      tab.put("key", KQUpgradeTabEnum.Upgrade12.getTabtype());
      tab.put("title", SystemEnv.getHtmlLabelName(KQUpgradeTabEnum.Upgrade12.getTablabel(),user.getLanguage()));
      tabs.add(tab);
		
			retmap.put("status", "1");
			retmap.put("tabs", tabs);
		} catch (Exception e) {
			writeLog(e);
      retmap.put("status", "-1");
      retmap.put("message",  SystemEnv.getHtmlLabelName(382661,user.getLanguage()));
		}
		return retmap;
	}

}
