package weaver.interfaces.htsc.upPaydetal;

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

/*
 * 内部资金调拨、资金业务调拨流程，出纳付款节点，更新资金出纳付款表uf_paydetal中的payflag字段
 * */
public class UpPaydetail extends BaseBean implements Action {
    @Override
    public String execute(RequestInfo requestInfo) {
        writeLog("===================进入UpPaydetail，根据requestid更新uf_paydetal===================");
        String back;
        try{
            RecordSet rs = new RecordSet();
            String requestid = requestInfo.getRequestid();
            writeLog("===============================获取的requestid是：" + requestid);
            String sql = "update uf_paydetal set payflag = 9 where REQID = '" + requestid + "'";
            writeLog("即将执行的sql语句是：" + sql);
            boolean exeResult = rs.executeQuery(sql);
            back = exeResult ? SUCCESS : FAILURE_AND_CONTINUE;
            writeLog("==========即将返回的值是："+back);
        }catch (Exception e){
            back = FAILURE_AND_CONTINUE;
            requestInfo.getRequestManager().setMessagecontent("流程流转异常：更新资金出纳付款表失败," + e.getMessage());
            e.getMessage();
            writeLog("================find error :"+e.getMessage());
        }
        return back;
    }
}
