package com.engine.kq.cmd.attendanceButton;

import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.entity.BizLogContext;
import com.engine.core.interceptor.CommandContext;
import com.engine.kq.log.KQLog;
import java.util.HashMap;
import java.util.Map;
import weaver.conn.RecordSet;
import weaver.hrm.User;
import weaver.systeminfo.SystemEnv;

/**
 * 获取用户最后一次选择的地图
 */
public class GetUserLastMapCmd extends AbstractCommonCommand<Map<String, Object>> {
  public KQLog kqLog = new KQLog();

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

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

		  String userid = user.getUID()+"";

      String user_last_map = GetButtonBaseInfoCmd.get_user_last_map(userid);
      if(user_last_map.length() > 0){
        retmap.put("user_last_map", user_last_map);
      }

			retmap.put("status", "1");
		}catch (Exception e) {
			retmap.put("status", "-1");
			retmap.put("message",  SystemEnv.getHtmlLabelName(382661,user.getLanguage()));
			writeLog(e);
		}
    kqLog.info(user.getLastname()+":GetUserLastMapCmd:retmap:"+retmap);
		return retmap;
	}

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

}
