package weaver.interfaces.htsc.smsd;

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

public class UpdateDQJD extends BaseBean implements Action {

    /**
     * @Describe 纸质发票查询界面中，扫码枪打开流程，提交后，该界面对应的数据中，当前节点应该变为其他节点状态
     * @tableName uf_PaperInvSubQuery
     */
    @Override
    public String execute(RequestInfo requestInfo) {
        writeLog("=======================进入扫码收单，提交或退回后更新建模表当前字段的值==================");
        String back = "";
        RecordSet rs = new RecordSet();
        String sql = "";
        String requestid = requestInfo.getRequestid();
        sql = "update uf_PaperInvSubQuery set dqjd = '0' where REQUESTIDS = '" + requestid + "'";
        boolean b = rs.executeUpdate(sql);
        if (b) {
            back = SUCCESS;
        } else {
            back = FAILURE_AND_CONTINUE;
            requestInfo.getRequestManager().setMessageid("104");
            requestInfo.getRequestManager().setMessagecontent("流程流转异常：更新流程当前节点发生错误，请联系管理员");
            writeLog("=======更新流程当前节点发生错误，更新的sql语句为：" + sql);
        }
        return back;
    }
}
