package weaver.interfaces.htsc.itxqlc.action;

import com.alibaba.fastjson.JSONObject;
import com.weaver.general.BaseBean;
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.conn.RecordSetDataSource;
import weaver.general.Util;
import weaver.interfaces.htsc.util.HT_WorkflowInfo;
import weaver.interfaces.workflow.action.Action;
import weaver.soa.workflow.request.RequestInfo;

import java.io.IOException;
import java.util.Map;

/**
 * @Title: ecology-9-demo
 * @Company: 泛微软件
 * @author: weaver.Dusongsong
 * @version: 1.0
 * @CreateDate: 2020-09-24
 * @Description: 申请节点提交后删除明细表数据
 * @ModifyLog:
 *
 * 总部重要事项 拟稿节点提交执行
 **/

public class ItxqlcUpdateJiraAction extends BaseBean implements Action {

    @Override
    public String execute(RequestInfo requestInfo) {
        RecordSetDataSource rsd = new RecordSetDataSource("ALM");
        BaseBean bb = new BaseBean();
        String requestid = requestInfo.getRequestid();
        System.out.println( "----ItxqlcCreateJiraAction-------" + requestid );
        try {
            String sql = " update t_itapplyrequirement_data set STATUS='已办结' where WORKFLOWNUM='"+requestid+"' AND STATUS='未办结' ";
            bb.writeLog(sql);
            rsd.execute(sql);
        } catch (Exception e) {
            e.printStackTrace();
            writeLog( "异常参考:" + e );
            requestInfo.getRequestManager().setMessageid( "111111" );
            requestInfo.getRequestManager().setMessagecontent( "流程提交失败" );
            return Action.FAILURE_AND_CONTINUE;
        }
        return Action.SUCCESS;
    }

}
