package com.engine.kq.cmd.hrmAttProcSet;

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.hrm.HrmUserVarify;
import weaver.hrm.User;
import weaver.systeminfo.SystemEnv;

/**
 * 获取自定义考勤流程tab页签
 * @author pzy
 *
 */
public class GetCustomKQFlowTabCmd extends AbstractCommonCommand<Map<String, Object>>{

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

	@Override
	public BizLogContext getLogContext() {
		return null;
	}


	@Override
	public Map<String, Object> execute(CommandContext commandContext) {
		Map<String,Object> retmap = new HashMap<String,Object>();
		 
		try {
      if(!HrmUserVarify.checkUserRight("HrmAttendanceProcess:setting", user)){
        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(500272,user.getLanguage()));
      tabs.add(tab);

      tab = new HashMap<String, Object>();
      tab.put("key", "2");
      tab.put("title", SystemEnv.getHtmlLabelName(10000813,weaver.general.Util.getIntValue(user.getLanguage())));
      tabs.add(tab);

      retmap.put("status", "1");
      retmap.put("tabs", tabs);
    } catch (Exception e) {
			retmap.put("status", "-1");
			retmap.put("message",  SystemEnv.getHtmlLabelName(382661,user.getLanguage()));
			writeLog(e);
		}
			
		return retmap;
	}
	
}
