package weaver.interfaces.htsc.workflow;

import weaver.conn.RecordSet;
import weaver.general.Util;
import weaver.interfaces.workflow.action.Action;
import weaver.soa.workflow.request.RequestInfo;

/**
 * Created by K1810006 on 2020/9/17.
 */
public class RequestLevelMappingAction implements Action{


    @Override
    public String execute(RequestInfo requestInfo) {

        RecordSet rs = new RecordSet();

        String requestid = requestInfo.getRequestid();
        String tablename = requestInfo.getRequestManager().getBillTableName();

        String jjcd = "0";
        String sql = "select jjcd from "+tablename+" where requestid = '"+requestid+"'";
        rs.execute(sql);
        if (rs.next()) {
            jjcd = Util.null2String(rs.getString("jjcd"),"0");
        }

        rs.execute(" update workflow_requestbase set requestlevel = '"+jjcd+"' where requestid ="+requestid);
        return Action.SUCCESS;
    }


}
