package weaver.interfaces.htxc.zbqs;

import weaver.conn.RecordSet;
import weaver.conn.RecordSetTrans;
import weaver.general.BaseBean;
import weaver.interfaces.htsc.comInfo.PropBean;
import weaver.interfaces.workflow.action.Action;
import weaver.soa.workflow.request.RequestInfo;

public class InsertCgsqnmDt1 extends BaseBean implements Action {
    public String p1; //自定义参数1
    public String p2; //自定义参数2
    @Override
    public String execute(RequestInfo requestinfo) {
        try{
            String requestid = requestinfo.getRequestid();//请求ID
            String requestname = requestinfo.getRequestManager().getRequestname();//请求标题
            String tablename = requestinfo.getRequestManager().getBillTableName();//表单名称
            RecordSet rs = new RecordSet();
            RecordSetTrans rst = new RecordSetTrans();
            String mainSql = "select * from " + tablename+" where requestid = "+requestid;
            rs.execute(mainSql);
            if(rs.next()){
                String xmid = rs.getString("jmid");
                String dt1Sql = "insert into uf_cgxq_dt1 (mainid,lcmc,lclx,lczt)values('"+xmid+"','"+requestname+"','"+0+"','"+0+"')";
                rst.execute(dt1Sql);

            }
        }catch (Exception e){
            return Action.FAILURE_AND_CONTINUE;
        }
        return Action.SUCCESS;
    }
}

