示例#1
0
  private int doConfirm(
      SessionContext ctx,
      DatabaseConnection conn,
      FormInstance instance,
      ErrorMessages msgs,
      boolean isPass) {

    try {

      MyDB.getInstance().addDBConn(conn);

      XfactpaydetlDao paydetldao = XfactpaydetlDaoFactory.create(conn.getConnection());
      Xfactpaydetl xfactpaydetl = paydetldao.findByPrimaryKey(journalno);

      if (xfactpaydetl == null) {
        return -1;
      }

      UserManager um = (UserManager) ctx.getAttribute(SystemAttributeNames.USER_INFO_NAME);
      xfactpaydetl.setCheckerid(um.getUserName());
      xfactpaydetl.setCheckdate(new java.util.Date()); // TODO DB TIME

      XfactpaydetlPk paydetlpk = new XfactpaydetlPk();
      paydetlpk.setJournalno(journalno);

      XfcontractDao contractdao = XfcontractDaoFactory.create(conn.getConnection());
      XfcontractPk contractpk = new XfcontractPk(xfactpaydetl.getContractno());
      Xfcontract xfcontract = contractdao.findByPrimaryKey(xfactpaydetl.getContractno());
      if (xfcontract == null) {
        msgs.add("此笔放款记录对应的合同信息未找到,请查询。");
        return -1;
      }

      // TODO:增加XFCONTRACT表字段:贷款发放经办复核人员时间信息
      // xfcontract.(um.getUserName());
      // xfcontract.setCheckdate(new java.util.Date());

      if (isPass) {
        xfactpaydetl.setPaystatus("3"); // 设置状态为“审核通过”  TODO:CONSTANT
      } else {
        xfactpaydetl.setPaystatus("2"); // 设置状态为“驳回”  TODO:CONSTANT
      }
      paydetldao.update(paydetlpk, xfactpaydetl);

      /*
      合同状态处理
       */

      if (isPass) {
        xfcontract.setCstatus(XFContractStatus.FANGKUAN_TONGGUO); // 设置状态为“放款通过”
      } else {
        xfcontract.setCstatus(XFContractStatus.FANGKUAN_BOHUI); // 设置状态为“放款驳回”
      }
      contractdao.update(contractpk, xfcontract);

      return 0;
    } catch (Exception e) {
      msgs.add("系统发生异常:" + e.getMessage());
      Debug.debug(e);
      return -1;
    } finally {
      MyDB.getInstance().releaseDBConn();
    }
  }
示例#2
0
  public int buttonEvent(
      SessionContext ctx,
      DatabaseConnection conn,
      FormInstance instance,
      String button,
      ErrorMessages msgs,
      EventManager manager) {

    /*
            ctx.setAttribute("SUPERFORMID", instance.getFormid());
            ctx.setAttribute("BUTTONNAME", button);

            if (button != null && button.equals(SessionAttributes.REQUEST_EDIT_BUTTON_VALUE)) {
                ctx.setAttribute("BUTTONNAME", ctx.getParameter(SessionAttributes.CLICK_COLUMN_NAME));
                trigger(manager, "FDCUTPAYDETLPAGE", null);
            }
    */

    // check
    if (button != null && (button.equals("CHECKBUTTON"))) {

      try {

        String sql =
            "select gthtb_htbh,gthtb_dwbh,xdkhzd_khmc,gthtb_qsrq,gthtb_dqrq,gthtb_htje,gthtb_tyckzh,gthtb_htnm "
                + "from gthtb@haier_shengchan a,xdkhzd@haier_shengchan b "
                + " where a.gthtb_dwbh=b.xdkhzd_khbh "
                + " and (a.gthtb_htbh like 'GC%' or  a.gthtb_htbh like 'GQ%' or  a.gthtb_htbh like 'GSQ%' or  a.gthtb_htbh like 'GT%' ) "
                + " and (a.gthtb_htbh != 'GQ20090405' and a.gthtb_htbh != 'GQ20090728') "
                + " and a.gthtb_tyckzh='801000026101041001' ";

        logger.info("SQL=" + sql);
        RecordSet rs = conn.executeQuery(sql);

        int count = 0;
        msgs.add("<br>帐号检查结果如下:");
        while (rs.next()) {
          String dwbh = rs.getString("gthtb_dwbh");
          String actno = rs.getString("gthtb_tyckzh");
          String htbh = rs.getString("gthtb_htbh");
          String khmc = rs.getString("xdkhzd_khmc");

          String promptStr = dwbh + " " + khmc + " " + htbh + " " + actno;

          count++;
          msgs.add("<br>" + count + ":" + promptStr);

          /*
          if (dwbh.startsWith("GC")) {
              if (!"801000026701041001".equals(actno)) {
                  count++;
                  msgs.add("<br>" + count + ":" + promptStr);
              }
          } else if (dwbh.startsWith("GQ")) {
              if (!"801000026701041001".equals(actno)) {
                  count++;
                  msgs.add("<br>" + count + ":" + promptStr);
              }
          } else if (dwbh.startsWith("GSQ")) {
              if (!"801000026701041001".equals(actno)) {
                  count++;
                  msgs.add("<br>" + count + ":" + promptStr);
              }
          } else if (dwbh.startsWith("GT")) {
              if ("GT001".equals(dwbh)) {
                  if (!"801000026701041001".equals(actno)) {
                      count++;
                      msgs.add("<br>" + count + ":" + promptStr);
                  }
              } else {
                  if (!"801000026101041001".equals(actno)) {
                      count++;
                      msgs.add("<br>" + count + ":" + promptStr);
                  }
              }
          }
          */
        }
        if (count == 0) {
          msgs.add("<br>未发现帐号错误!");
        }
        msgs.add("<br>检查完成。");
      } catch (Exception e) {
        Debug.debug(e);
        msgs.add("帐号检查时出现问题,请通知系统管理人员!");
        return 0;
      } finally {
        ctx.setRequestAtrribute("msg", msgs.getAllMessages());
        ctx.setRequestAtrribute("flag", "1");
        ctx.setRequestAtrribute("isback", "0");
        ctx.setTarget("/showinfo.jsp");
        instance.setReadonly(true);
      }
    }
    // 设定帐号
    if (button != null && (button.equals("PROCESSBUTTON"))) {
      // rigger(manager, "FDSYSWHLIST", null);
      try {
        String sql =
            "update  gthtb@haier_shengchan a "
                + " set a.gthtb_tyckzh = '801000026701041001' "
                + " where (a.gthtb_dwbh like 'GC%' or  a.gthtb_dwbh like 'GQ%' or  a.gthtb_dwbh like 'GSQ%' or  a.gthtb_dwbh like 'GT%' ) "
                + " and (a.gthtb_htbh != 'GQ20090405' and a.gthtb_htbh != 'GQ20090728') "
                + " and a.gthtb_tyckzh='801000026101041001' ";
        conn.setAuto(false);
        conn.begin();
        int rtn = conn.executeUpdate(sql);
        msgs.add("已成功更新 " + rtn + " 笔同业存款帐号。");
        conn.commit();
      } catch (Exception e) {
        conn.rollback();
        logger.error(e);
        msgs.add("同业帐号更新时出现问题,请通知系统管理人员!");
        return 0;
      } finally {
        ctx.setRequestAtrribute("msg", msgs.getAllMessages());
        ctx.setRequestAtrribute("flag", "1");
        ctx.setRequestAtrribute("isback", "0");
        ctx.setTarget("/showinfo.jsp");
        instance.setReadonly(true);
      }
    }

    return 0;
  }