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.HashMap;
import java.util.Map;
import weaver.conn.RecordSet;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.systeminfo.SystemEnv;

/**
 * 根据基本信息页面的选择的下拉框同步，带出不同的模板文件
 * @author pzy
 *
 */
public class GetProcSetTempletCmd extends AbstractCommonCommand<Map<String, Object>>{

	public GetProcSetTempletCmd(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 {
			RecordSet RS = new RecordSet();
      int field006 = Util.getIntValue(Util.null2String(params.get("field006")));

      String custompage = "";
      String custompage4Emoble = "";
      String templetroute = "";
      switch (field006){
        case 0 :
          custompage = KqTempletEnum.LEAVE.getTempletfile();
          custompage4Emoble = KqTempletEnum.LEAVE.getTempletmobilefile();
          templetroute = KqTempletEnum.LEAVE.getTempletroute();
          break;
        case 1 :
          custompage = KqTempletEnum.EVECTION.getTempletfile();
          custompage4Emoble = KqTempletEnum.EVECTION.getTempletmobilefile();
          templetroute = KqTempletEnum.EVECTION.getTempletroute();
          break;
        case 2 :
          custompage = KqTempletEnum.OUT.getTempletfile();
          custompage4Emoble = KqTempletEnum.OUT.getTempletmobilefile();
          templetroute = KqTempletEnum.OUT.getTempletroute();
          break;
        case 3 :
          custompage = KqTempletEnum.OVERTIME.getTempletfile();
          custompage4Emoble = KqTempletEnum.OVERTIME.getTempletmobilefile();
          templetroute = KqTempletEnum.OVERTIME.getTempletroute();
          break;
        case 4 :
          custompage = KqTempletEnum.OTHER.getTempletfile();
          custompage4Emoble = KqTempletEnum.OTHER.getTempletmobilefile();
          templetroute = KqTempletEnum.OTHER.getTempletroute();
          break;
        case 5 :
          custompage = KqTempletEnum.SHIFT.getTempletfile();
          custompage4Emoble = KqTempletEnum.SHIFT.getTempletmobilefile();
          templetroute = KqTempletEnum.SHIFT.getTempletroute();
          break;
        case 6 :
          custompage = KqTempletEnum.LEAVEBACK.getTempletfile();
          custompage4Emoble = KqTempletEnum.LEAVEBACK.getTempletmobilefile();
          templetroute = KqTempletEnum.LEAVEBACK.getTempletroute();
          break;
        case 7 :
          custompage = KqTempletEnum.Card.getTempletfile();
          custompage4Emoble = KqTempletEnum.Card.getTempletmobilefile();
          templetroute = KqTempletEnum.Card.getTempletroute();
          break;
        case 8 :
          custompage = KqTempletEnum.PROCESSCHANGE.getTempletfile();
          custompage4Emoble = KqTempletEnum.PROCESSCHANGE.getTempletmobilefile();
          templetroute = KqTempletEnum.PROCESSCHANGE.getTempletroute();
          break;
        default:
          break;
      }

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