package com.engine.kq.cmd.shiftmanagement;

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 GetTabsCmd extends AbstractCommonCommand<Map<String, Object>>{
	
	public GetTabsCmd(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>();
		String type = Util.null2String((String)params.get("type"));
		String pageid = Util.null2String(params.get("pageid"));//页面标识
		List<Object>  rightMenu = new ArrayList<Object>();
		try {
			if(!HrmUserVarify.checkUserRight("KQClass:Management",user)) {
				retmap.put("status", "-1");
				retmap.put("message", SystemEnv.getHtmlLabelName(2012, user.getLanguage()));
				return retmap;
			}

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

			tab = new HashMap<String, Object>();
			tab.put("key", "1");
			tab.put("title", SystemEnv.getHtmlLabelName(1361,user.getLanguage()));
			tabs.add(tab);
			
			tab = new HashMap<String, Object>();
			tab.put("key", "2");
			tab.put("title", SystemEnv.getHtmlLabelName(388528,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;
	}

}
