package weaver.interfaces.htxc.jzxcsqs;

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 EndIngUpdateDt1 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();
            PropBean pb = new PropBean();
            String tycgrwdTableName = pb.getPropName("tycgrwd_tablename");
            RecordSetTrans rst = new RecordSetTrans();
            String mainSql = "select * from " + tablename+" where requestid = "+requestid;
            rs.execute(mainSql);
            if(rs.next()){
                String xmid = rs.getString("jmid");
                String sql = "update uf_cgxq_dt1 set lczt = 1 where mainid = "+xmid + " and lcmc = "+ requestid;
                rst.execute(sql);
            }
        }catch (Exception e){
            return Action.FAILURE_AND_CONTINUE;
        }
        return Action.SUCCESS;
    }
}
