package com.engine.htsc.itxqlc.cmd;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.entity.BizLogContext;
import com.engine.core.interceptor.CommandContext;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import weaver.conn.RecordSet;
import weaver.general.BaseBean;
import weaver.general.GCONST;
import weaver.general.Util;
import weaver.interfaces.htsc.comInfo.PropBean;
import weaver.interfaces.htsc.cus.HTUtil;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

public class ItxqlcXxjsbCmd extends AbstractCommonCommand<Map<String, Object>> {

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

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

    @Override
    public Map<String, Object> execute(CommandContext commandContext) {

        RecordSet rs = new RecordSet();
        BaseBean bb = new BaseBean();
        bb.writeLog( "in=================ItxqlcLdspCmd" );
        Map<String, Object> apimap = new HashMap<String, Object>();

        String requestid = Util.null2String(params.get("requestid"));
        int isldsp = 0;
        try{

            String sql = " select * from workflow_requestlog where requestid=" + requestid +
                         " and nodeid in(select id from workflow_nodebase where unnumber in('itxqsq_xxjsbfzr','itxqsq_xxjsr'))";
            rs.execute(sql);
            if(rs.next()){
                isldsp++;
            }

        }catch (Exception e){
            bb.writeLog("e:"+e);
        }
        apimap.put("isldsp",isldsp+"");
        return apimap;
    }

    public static void main(String[] args) {


    }

}
