package com.engine.htsc.errorremind.cmd;

import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.entity.BizLogContext;
import com.engine.core.interceptor.CommandContext;
import weaver.general.BaseBean;
import weaver.general.Util;
import weaver.hrm.User;
import java.util.HashMap;
import java.util.Map;

public class RequestErrorRemindCmd extends AbstractCommonCommand<Map<String, Object>> {
    @Override
    public BizLogContext getLogContext() {
        return null;
    }

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

    @Override
    public Map<String, Object> execute(CommandContext commandContext) {
        Map<String, Object> appdate = new HashMap<String, Object>();
        BaseBean bb = new BaseBean();
        try{
            String lcid = Util.null2String(params.get("lcid"));
            String titlesuffix =  Util.null2String(params.get("titlesuffix"));
            //下一节点无法预知
            bb.writeLog("RequestErrorRemindCmd---start");
            RequestErrorRemindThread requestErrorRemindThread = new RequestErrorRemindThread(lcid,user,titlesuffix);
            new Thread(requestErrorRemindThread).start();
            bb.writeLog("RequestErrorRemindCmd----end");
            appdate.put("code","200");

        }catch (Exception e){
            bb.writeLog("e:"+e);
            appdate.put("code","500");
        }
        return appdate;
    }

}
