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 com.engine.kq.bean.RightMenu;
import com.engine.kq.bean.RightMenuType;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import weaver.general.Util;
import weaver.hrm.User;

/**
 * 获取班次管理右键菜单
 * @author pzy
 *
 */
public class GetRightMenuCmd extends AbstractCommonCommand<Map<String, Object>>{

	public GetRightMenuCmd(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"));
    int id = Util.getIntValue((String)params.get("id"));
    String pageid = Util.null2String(params.get("pageid"));//页面标识
    List<Object>  rightMenu = new ArrayList<Object>();
    try {
      //编辑\人性化班次设置\删除
      rightMenu.add(new RightMenu(user.getLanguage(), RightMenuType.BTN_EDIT, "doEdit"));
      rightMenu.add(new RightMenu(user.getLanguage(), RightMenuType.BTN_Delete, "doPersonalized"));
      rightMenu.add(new RightMenu(user.getLanguage(), RightMenuType.BTN_Delete, "doDelete"));
    } catch (Exception e) {
      writeLog(e);
    }
    retmap.put("status", "1");
    retmap.put("rightMenu", rightMenu);
    retmap.put("hasDpIcon", true);
		return retmap;
	}

}
