コード例 #1
0
  public int load(
      SessionContext ctx,
      DatabaseConnection conn,
      FormInstance instance,
      ErrorMessages msgs,
      EventManager manager,
      String parameter) {

    String superformid = (String) ctx.getAttribute("SUPERFORMID");

    instance.getFormBean().getElement("CONFIRMBUTTON").setComponetTp(6); // 设置复核按钮为隐藏
    instance.getFormBean().getElement("DISMISSALBUTTON").setComponetTp(6); // 设置放款计划按钮为隐藏

    if (superformid.indexOf("FH") > 0) {
      isFHStatus = true;
      // 20090805  封住流水审核流程
      /*
      instance.getFormBean().getElement("CONFIRMBUTTON").setComponetTp(15);
      instance.getFormBean().getElement("DISMISSALBUTTON").setComponetTp(15);
      */
    } else {
      isFHStatus = false;
      instance.getFormBean().getElement("CONFIRMBUTTON").setComponetTp(6); // 设置复核按钮为隐藏
      instance.getFormBean().getElement("DISMISSALBUTTON").setComponetTp(6); // 设置放款计划按钮为隐藏
    }

    journalno = ctx.getParameter("JOURNALNO");

    if (journalno != null) {
      instance.setValue("JOURNALNO", journalno);
      trigger(manager, instance, EventType.EDIT_VIEW_EVENT_TYPE, Event.BRANCH_CONTINUE_TYPE);
    }
    return 0;
  }
コード例 #2
0
 public int load(
     SessionContext ctx,
     DatabaseConnection conn,
     FormInstance instance,
     ErrorMessages msgs,
     EventManager manager,
     String parameter) {
   strFlag = String.valueOf(ctx.getRequestAttribute("flag"));
   // strClientNO=ctx.getParameter("CLIENTNO");
   strClientNO = String.valueOf(ctx.getRequestAttribute("CLIENTNO"));
   return 0;
 }
コード例 #3
0
  public int buttonEvent(
      SessionContext ctx,
      DatabaseConnection conn,
      FormInstance instance,
      String button,
      ErrorMessages msgs,
      EventManager manager) {

    if (button != null && button.equals("CONFIRMBUTTON")) {
      if (doConfirm(ctx, conn, instance, msgs, true) == 0) {
        ctx.setRequestAtrribute("msg", "此笔放款记录已审核通过!");
        ctx.setRequestAtrribute("flag", "1");
        ctx.setRequestAtrribute("isback", "0");
        ctx.setTarget("/showinfo.jsp");
        instance.setReadonly(true);

      } else {
        return -1;
      }
    } else if (button != null && button.equals("DISMISSALBUTTON")) {
      if (doConfirm(ctx, conn, instance, msgs, false) == 0) {
        ctx.setRequestAtrribute("msg", "此笔放款记录已驳回!");
        ctx.setRequestAtrribute("flag", "1");
        ctx.setRequestAtrribute("isback", "0");
        ctx.setTarget("/showinfo.jsp");
        instance.setReadonly(true);

      } else {
        return -1;
      }
    }

    return 0;
  }
コード例 #4
0
ファイル: CMIndvClient.java プロジェクト: fordream/zhan-cms
 public int preReference(
     SessionContext ctx,
     DatabaseConnection conn,
     FormInstance instance,
     ErrorMessages msgs,
     EventManager manager,
     String reffldnm,
     SqlWhereUtil sqlWhereUtil) {
   UserManager um = (UserManager) ctx.getAttribute(SystemAttributeNames.USER_INFO_NAME);
   //    if (reffldnm.equals("APPBRHID") || reffldnm.equals("CLIENTMGR") ||
   // reffldnm.equals("UNIONNO")) {
   if (reffldnm.equals("APPBRHID") || reffldnm.equals("CLIENTMGR")) {
     // BRHID(用户网点)
     String BRHID = SCUser.getBrhId(um.getUserName());
     if (BRHID == null || BRHID.length() < 1) {
       msgs.add("用户网点不存在!");
       return -1;
     }
     // SUBBRHIDs(用户网点下的所有实网点,包括自己)
     String SUBBRHIDs = SCBranch.getSubBranchAll(BRHID);
     if (SUBBRHIDs == null || SUBBRHIDs.length() < 1) {
       msgs.add("下属网点不存在!");
       return -1;
     } else {
       SUBBRHIDs = "'" + SUBBRHIDs.replaceAll(",", "','") + "'";
     }
     // sqlWhereUtil
     if (reffldnm.equals("APPBRHID")) {
       sqlWhereUtil.addWhereField(
           "SCBRANCH",
           "BRHID",
           SUBBRHIDs,
           SqlWhereUtil.DataType_Sql,
           sqlWhereUtil.OperatorType_In);
     }
     if (reffldnm.equals("CLIENTMGR")) {
       sqlWhereUtil.addWhereField(
           "SCUSER",
           "BRHID",
           SUBBRHIDs,
           SqlWhereUtil.DataType_Sql,
           sqlWhereUtil.OperatorType_In,
           sqlWhereUtil.RelationOperator_And);
       sqlWhereUtil.addWhereField(
           "SCUSER",
           "USERTYPE",
           "3",
           //                                   SqlWhereUtil.DataType_Number,
           SqlWhereUtil.DataType_Character,
           sqlWhereUtil.OperatorType_Not_Equals);
     }
     //      if (reffldnm.equals("UNIONNO")) {
     //        sqlWhereUtil.addWhereField("CMFAMILYUNION", "BRHID", SUBBRHIDs,
     //                                   SqlWhereUtil.DataType_Sql,
     //                                   sqlWhereUtil.OperatorType_In);
     //      }
   }
   return 0;
 }
コード例 #5
0
  public int buttonEvent(
      SessionContext ctx,
      DatabaseConnection conn,
      FormInstance instance,
      String button,
      ErrorMessages msgs,
      EventManager manager) {
    ctx.setRequestAtrribute("CLIENTNO", strClientNO);
    ctx.setRequestAtrribute("flag", strFlag);

    if (button != null && button.equals(SessionAttributes.REQUEST_BUTTON_ADD_NAME)) {
      trigger(manager, "CMCAP2", null);
    }
    if (button != null && button.equals(SessionAttributes.REQUEST_EDIT_BUTTON_VALUE)) {
      trigger(manager, "CMCAP2", null);
    }
    return 0;
  }
コード例 #6
0
  public int load(
      SessionContext ctx,
      DatabaseConnection conn,
      FormInstance instance,
      ErrorMessages msgs,
      EventManager manager,
      String parameter) {
    RightChecker.checkReadonly(ctx, conn, instance);

    Param param = (Param) ctx.getRequestAttribute("PARAM");
    this.bmno = ((Param) ctx.getRequestAttribute("BMPARAM")).getBmNo();
    if (ctx.getRequestAttribute("couldNotChange") != null) {
      instance.setValue("SEQNO", ctx.getParameter("SEQNO"));
      trigger(manager, instance, EventType.EDIT_VIEW_EVENT_TYPE, Event.BRANCH_CONTINUE_TYPE);
      instance.setReadonly(true);
    } else {

      trigger(manager, instance, EventType.INSERT_VIEW_EVENT_TYPE, Event.BRANCH_CONTINUE_TYPE);
    }

    return 0;
  }
コード例 #7
0
ファイル: CMIndvClient.java プロジェクト: fordream/zhan-cms
  public int buttonEvent(
      SessionContext ctx,
      DatabaseConnection conn,
      FormInstance instance,
      String button,
      ErrorMessages msgs,
      EventManager manager) {
    // String CLIENTNO = instance.getStringValue("CLIENTNO");
    String CLIENTNO = strClientNo;
    // String CLIENTNO = ctx.getParameter("CLIENTNO");
    if (CLIENTNO == null || CLIENTNO.length() < 1 || CLIENTNO.equals("自动生成")) {
      System.out.println(CLIENTNO);
      msgs.add("请确定个人客户资料信息已经存在!");
      return -1;
    }
    // setRequestAtrribute
    ctx.setRequestAtrribute("flag", flag);
    ctx.setRequestAtrribute("CLIENTNO", CLIENTNO);

    if (button.equals("CMINDVRELA")) {
      trigger(manager, "100012", null);
    } else if (button.equals("BMRQL")) {
      trigger(manager, "BMRQL1", null);
    } else if (button.equals("BMCREDITLMAINTPAGE")) {
      trigger(manager, "BMCREDITLMAINTPAGE", null);
    } else if (button.equals("PHOTO")) {
      // ctx.setRequestAtrribute("PHOTONO",ctx.getParameter("PHOTONO"));
      ctx.setRequestAtrribute("TABLENAME", "CMINDVCLIENT");
      ctx.setRequestAtrribute("WHERECONDITION", "clientno='" + CLIENTNO + "'");
      ctx.setRequestAtrribute("title", "个人客户图片");
      ctx.setRequestAtrribute("flag", this.flag);
      ctx.setTarget("/photo/photo.jsp");
    } else if (button.equals("CREDIT")) {
      RecordSet rs =
          conn.executeQuery("select id from CMINDVCLIENT where clientno='" + CLIENTNO + "'");
      if (!rs.next()) {
        msgs.add("取得id失败!");
        return -1;
      }
      String id = rs.getString("ID");
      ctx.setRequestAtrribute("ID", id);
      trigger(manager, "GUARANTORCREDITLIST", null);
      return 0;
    }

    /**
     * else if (button.equals("CMINDVASSET")) { trigger(manager, "100013", null); } else if
     * (button.equals("CMINDVDEBT")) { trigger(manager, "100014", null); } else if
     * (button.equals("CMINDVDEBTPAYMENT")) { trigger(manager, "100015", null); }
     */
    return 0;
  }
コード例 #8
0
  /**
   * Description of the Method
   *
   * @param ctx Description of the Parameter
   * @param conn Description of the Parameter
   * @param instance Description of the Parameter
   * @param msgs Description of the Parameter
   * @param manager Description of the Parameter
   * @param assistor Description of the Parameter
   * @return Description of the Return Value
   */
  public int preInsert(
      SessionContext ctx,
      DatabaseConnection conn,
      FormInstance instance,
      ErrorMessages msgs,
      EventManager manager,
      SqlAssistor assistor) {
    int seqNo = (int) SerialNumber.getNextSN("BMLOANADMCHANGE", "SEQNO");
    // System.out.println("Seqno:"+seqNo);

    instance.setValue("SEQNO", seqNo);
    assistor.setSqlFieldValue(assistor.getDefaultTbl(), "SEQNO", seqNo + "");
    MyDB.getInstance().addDBConn(conn);
    return InactLoanMan.loanAdmByChange(this.bmno, ctx.getParameter("NEWADM"));
  }
コード例 #9
0
ファイル: CMIndvClient.java プロジェクト: fordream/zhan-cms
  /** 扩展基类的preDelete方法,对实际业务做删除前的检验 */
  public int preDelete(
      SessionContext ctx,
      DatabaseConnection conn,
      FormInstance instance,
      ErrorMessages msgs,
      EventManager manager,
      SqlAssistor assistor) {

    String cltNo = ctx.getParameter("CLIENTNO");

    String bmStr = "select * from bmtable where clientno='" + cltNo + "'";
    RecordSet bmRs = conn.executeQuery(bmStr);
    if (bmRs.next()) {
      msgs.add("还有业务没有删除");
      return -1;
    }

    RecordSet rs = conn.executeQuery("select id from CMINDVCLIENT where clientno='" + cltNo + "'");

    if (!rs.next()) {
      msgs.add("取得id失败!");
      return -1;
    } else {
      String id = rs.getString("ID");
      String tempStr = "select * from bmguarantor where id='" + id + "'";
      // System.out.println(tempStr);
      RecordSet tempRs = conn.executeQuery(tempStr);
      if (tempRs.next()) {
        msgs.add("还有担保的贷款,不能删除!");
        return -1;
      }
    }

    String sql1[] = new String[4];
    sql1[0] = "delete from CMINDVRELA where clientno='" + cltNo + "'";
    sql1[1] = "delete from CMINDVASSET where clientno='" + cltNo + "'"; //
    sql1[2] = "delete from CMINDVDEBT where clientno='" + cltNo + "'"; //
    sql1[3] = "delete from CMINDVDEBTPAYMENT where clientno='" + cltNo + "'"; //
    String sql2 = "";
    for (int i = 0; i < sql1.length; i++) {
      sql2 += sql1[i] + ";";
    }
    sql2 = sql2.substring(0, sql2.length() - 1);
    // System.out.println(sql2);
    int ret = conn.executeUpdate(sql2);
    return ret;
  }
コード例 #10
0
  /**
   * Description of the Method
   *
   * @param ctx Description of the Parameter
   * @param conn Description of the Parameter
   * @param instance Description of the Parameter
   * @param msgs Description of the Parameter
   * @param manager Description of the Parameter
   * @return Description of the Return Value
   */
  public int beforeInsert(
      SessionContext ctx,
      DatabaseConnection conn,
      FormInstance instance,
      ErrorMessages msgs,
      EventManager manager) {
    instance.setValue("OLDADM", ctx.getParameter("ADMINEDBY"));
    instance.setValue("CREATEDATE", SystemDate.getSystemDate5(""));
    instance.setFieldReadonly("OLDADM", true);
    instance.setFieldReadonly("CREATEDATE", true);
    instance.setValue("BMNO", this.bmno);
    instance.setFieldReadonly("BMNO", true);
    instance.setValue("OPERATOR", SessionInfo.getLoginUserName(ctx));
    instance.setValue("OLDADM", InactLoanMan.getInactLoan(this.bmno).adminedBy);

    return 0;
  }
コード例 #11
0
ファイル: BMRLPage.java プロジェクト: fordream/zhan-cms
 public int load(
     SessionContext ctx,
     DatabaseConnection conn,
     FormInstance instance,
     ErrorMessages msgs,
     EventManager manager,
     String parameter) {
   seqno = (String) ctx.getParameter("SEQNO");
   // 主键不为空则进入编辑状态
   if (seqno != null) {
     // 设置instance主键的值
     instance.setValue("SEQNO", seqno);
     // 流程转移到编辑状态
     trigger(manager, instance, EventType.EDIT_VIEW_EVENT_TYPE, Event.BRANCH_CONTINUE_TYPE);
   }
   return 0;
 }
コード例 #12
0
ファイル: CMIndvClient.java プロジェクト: fordream/zhan-cms
 public int postFindOk(
     SessionContext ctx,
     DatabaseConnection conn,
     FormInstance instance,
     ErrorMessages msgs,
     EventManager manager,
     RecordSet result) {
   // BRHID(用户网点)
   UserManager um = (UserManager) ctx.getAttribute(SystemAttributeNames.USER_INFO_NAME);
   String BRHID = SCUser.getBrhId(um.getUserName());
   if (BRHID == null || BRHID.length() < 1) {
     msgs.add("登录用户信息错误!");
     return -1;
   }
   // APPBRHID(登记网点)
   String APPBRHID = result.getString("APPBRHID").trim();
   if (!(SCBranch.checkSub(APPBRHID, BRHID) || BRHID.equals(APPBRHID))) {
     msgs.add("对不起,该客户的资料不在您的维护网点范围内!");
     return -1;
   }
   return 0;
 }
コード例 #13
0
  public int preFind(
      SessionContext ctx,
      DatabaseConnection conn,
      FormInstance instance,
      ErrorMessages msgs,
      EventManager manager,
      PreparedStatement ps,
      PreparedStatement countps) {

    String value = ClientSum.getClientSum(strClientNO, "CMCORPCAPITAL", "CONTRACTAMT", conn);
    String value2 = ClientSum.getClientSum(strClientNO, "CMCORPCAPITAL", "ACTUALAMT", conn);
    ctx.setAfterBody("CONTRACTAMT=" + value + ";ACTUALAMT=" + value2 + "");

    try {
      ps.setString(1, strClientNO);
      countps.setString(1, strClientNO);
      if (strFlag.equals("write")) instance.setReadonly(false);
      else instance.setReadonly(true);
      return 0;
    } catch (SQLException se) {
      return -1;
    }
  }
コード例 #14
0
ファイル: CMIndvClient.java プロジェクト: fordream/zhan-cms
  /** 扩展基类的preInsert方法,对实际业务做insert前的处理 */
  public int preInsert(
      SessionContext ctx,
      DatabaseConnection conn,
      FormInstance instance,
      ErrorMessages msgs,
      EventManager manager,
      SqlAssistor assistor) {
    String CLIENTNO = zt.cms.pub.code.ClientNo.getNextSN() + "";
    currClientNo = CLIENTNO;
    String ID = ctx.getParameter("ID").trim();
    String CLIENTMGR = ctx.getParameter("CLIENTMGR").trim();
    //    String UNIONNO = ctx.getParameter("UNIONNO").trim();
    //    String RGNCODE = ctx.getParameter("RGNCODE").trim();
    String MNTBRHID = ctx.getParameter("MNTBRHID").trim();
    String APPBRHID = ctx.getParameter("APPBRHID").trim();

    // ID唯一检测
    String ID2 = "";
    if (ID.length() == 18) {
      ID2 = ID.substring(0, 6) + ID.substring(8, 17);
    } else if (ID.length() == 15) {
      ID2 = ID.substring(0, 6) + "19" + ID.substring(6, 15);
    } else {
      msgs.add("个人证件号码长度不正确,请仔细检查您输入的号码!");
      return -1;
    }
    String tmp = "";
    if (ID.length() == 18) {
      tmp = ID2;
      ID2 = ID;
      ID = tmp;
    }
    if (DBUtil.getCellValue(conn, "CMINDVCLIENT", "CLIENTNO", "ID='" + ID + "'") != null
        || DBUtil.getCellValue(conn, "CMINDVCLIENT", "CLIENTNO", "ID LIKE '" + ID2 + "%'")
            != null) {
      msgs.add("个人证件号码已经存在,请仔细检查您输入的号码!");
      return -1;
    }
    // CLIENTMGR存在检测
    if (DBUtil.getCellValue(
            conn, "SCUSER", "LOGINNAME", "LOGINNAME='" + CLIENTMGR + "' and USERTYPE<>'3'")
        == null) {
      msgs.add("客户经理不存在,请仔细检查后再提交!");
      return -1;
    }
    // UNIONNO存在检测
    //    if (DBUtil.getCellValue(conn, "CMFAMILYUNION", "UNIONNO", "UNIONNO=" + UNIONNO) == null) {
    //      msgs.add("联户联保小组代码不存在,请仔细检查后再提交!");
    //      return -1;
    //   }
    // UNIONNO在开户网点内
    // RGNCODE存在检测
    //    if (RGNCODE.length() > 0 &&
    //        DBUtil.getCellValue(conn, "CMREGION", "RGNCODE", "RGNCODE='" + RGNCODE + "'") == null)
    // {
    //      msgs.add("行政机构代码不存在,请仔细检查后再提交!");
    //      return -1;
    //    }
    // 网点检测
    //    if (! (SCBranch.checkSub(APPBRHID, MNTBRHID) || MNTBRHID.equals(APPBRHID))) {
    //      msgs.add("业务网点不在维护网点范围内!");
    //      return -1;
    //    }
    if (SCBranch.getBrhtype(APPBRHID).equals("9")) {
      msgs.add("业务网点不能是虚网点!");
      return -1;
    }
    assistor.setSqlFieldValue(assistor.getDefaultTbl(), "CLIENTNO", CLIENTNO);
    return 0;
  }
コード例 #15
0
ファイル: FDSysWHList.java プロジェクト: fordream/zhan-cms
  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;
  }
コード例 #16
0
ファイル: CMIndvClient.java プロジェクト: fordream/zhan-cms
  public void postField(
      SessionContext ctx,
      FormInstance instance,
      String fieldname,
      ErrorMessages msgs,
      EventManager manager) {

    String id = (String) ctx.getRequestAttribute("ID");
    if (id == null || id.trim().length() <= 0) {
      instance.setHTMLShowMessage("错误", "必须输入身份证号码!");
      return;
    }

    id = id.trim();
    if (id.length() != 15 && id.length() != 18) {
      instance.setHTMLShowMessage("错误", "身份证号码长度必须为15或18位!");
      instance.setHTMLFieldValue("ID", "");
      return;
    }

    if (id.length() == 15) {
      if (util.isDate("19" + id.substring(6, 12)) == false) {
        instance.setHTMLShowMessage("警告", "证件号码日期格式非法!");
        return;
      }
    } else {
      if (id.charAt(17) == 'x') {
        instance.setHTMLShowMessage("错误", "证件号码的校验位不能是小写x!");
        instance.setHTMLFieldValue("ID", "");
        return;
      }

      if (util.isDate(id.substring(6, 14)) == false) {
        instance.setHTMLShowMessage("警告", "证件号码日期格式非法!");
        return;
      }

      int iS = 0, iY;
      int iW[] = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2};
      String szVerCode = "10X98765432";

      int i;
      for (i = 0; i < 17; i++) {
        iS += (int) (id.charAt(i) - '0') * iW[i];
      }
      iY = iS % 11;
      if (szVerCode.charAt(iY) != id.charAt(i)) {
        instance.setHTMLShowMessage("警告", "身份证号码校验码错误!");
        return;
      }
    }

    //    String year = null;
    //    if(id.length() == 15)
    //      year = "19" + id.substring(6,8);
    //    else
    //      year = id.substring(6,10);
    //    int iYear;
    //
    //    try
    //    {
    //      iYear = Integer.parseInt(year);
    //    }
    //    catch(Exception e)
    //    {
    //      instance.setHTMLShowMessage("警告","身份证号码生日格式错误!");
    //      return;
    //    }
    //
    //    if(iYear <= 1900)
    //    {
    //      instance.setHTMLShowMessage("警告","身份证号码生日早于1900年!");
    //      return;
    //    }

    return;
  }
コード例 #17
0
ファイル: CMIndvClient.java プロジェクト: fordream/zhan-cms
  public int load(
      SessionContext ctx,
      DatabaseConnection conn,
      FormInstance instance,
      ErrorMessages msgs,
      EventManager manager,
      String parameter) {

    int userNo = SessionInfo.getLoginUserNo(ctx);
    String roleStr = "select * from scuserrole where userno=" + userNo + " and roleno=1";
    RecordSet roleRs = conn.executeQuery(roleStr);
    if (roleRs.next()) {
      instance.useCloneFormBean();
      instance.getFormBean().setUseDelete(true);
    }

    // flag
    flag = (String) ctx.getRequestAttribute("flag");
    if (flag == null) {
      flag = "read";
    }
    flag = flag.toLowerCase();
    if (flag.equals("write")) {
      instance.setReadonly(false);
    } else {
      instance.setReadonly(true);
    }
    // CLIENTNO
    String CLIENTNO = ctx.getParameter("CLIENTNO");
    if (CLIENTNO == null) {
      CLIENTNO = (String) ctx.getRequestAttribute("CLIENTNO");
    }
    initClientNo = (String) ctx.getRequestAttribute("INITCLIENTNO");
    guarantorID = (String) ctx.getRequestAttribute("GID");
    String sql = "select * from cmindvclient where ";
    if (CLIENTNO != null && CLIENTNO.length() > 0) {
      strClientNo = CLIENTNO;
      sql += "clientno='" + CLIENTNO + "'";
    } else if (guarantorID != null && guarantorID.trim().length() > 0) {
      sql += "id='" + guarantorID + "'";
    }
    if (sql.endsWith("where ")) {
      return 0;
    }

    RecordSet rs = conn.executeQuery(sql);
    if (rs.next()) {
      // lj del in 20090316
      //      UserManager um = (UserManager) ctx.getAttribute(SystemAttributeNames.USER_INFO_NAME);
      //      String BRHID = SCUser.getBrhId(um.getUserName()); //登录用户所在网点
      //      String APPBRHID = rs.getString("APPBRHID").trim(); //客户资料的登记网点
      //      if ( strClientNo!=null && ! (SCBranch.checkSub(APPBRHID, BRHID) ||
      // APPBRHID.equals(BRHID))) {
      //        flag = "read";
      //        msgs.add("该客户不在本网点维护范围内!");
      //        instance.setReadonly(true);
      //      }
      //      else
      if (guarantorID != null && guarantorID.trim().length() > 0) {
        flag = "read";
        msgs.add("客户信息已经存在,不需要再做转移,请删除原来的保证人信息即可!");
        instance.setReadonly(true);
        strClientNo = rs.getString("clientno");
      }
      // trigger
      instance.setValue("CLIENTNO", strClientNo);
      trigger(manager, instance, EventType.EDIT_VIEW_EVENT_TYPE, Event.BRANCH_CONTINUE_TYPE);
    }
    return 0;
  }
コード例 #18
0
ファイル: CMIndvClient.java プロジェクト: fordream/zhan-cms
  public int preEdit(
      SessionContext ctx,
      DatabaseConnection conn,
      FormInstance instance,
      ErrorMessages msgs,
      EventManager manager,
      SqlAssistor assistor) {
    String CLIENTNO = ctx.getParameter("CLIENTNO").trim();
    String ID = ctx.getParameter("ID").trim();
    String CLIENTMGR = ctx.getParameter("CLIENTMGR").trim();
    //    String UNIONNO = ctx.getParameter("UNIONNO").trim();
    //    String RGNCODE = ctx.getParameter("RGNCODE").trim();
    String MNTBRHID = ctx.getParameter("MNTBRHID").trim();
    String APPBRHID = ctx.getParameter("APPBRHID").trim();
    String LASTMODIFIED = SystemDate.getSystemDate2();
    UserManager um = (UserManager) ctx.getAttribute(SystemAttributeNames.USER_INFO_NAME);
    String BrhId = SCUser.getBrhId(um.getUserName());
    String OPERATOR = null;
    try {
      OPERATOR = um.getUserName();
    } catch (Exception ex) {
      return -1;
    }
    // ID唯一检测
    String ID2 = "";
    if (ID.length() == 18) {
      ID2 = ID.substring(0, 6) + ID.substring(8, 17);
    } else if (ID.length() == 15) {
      ID2 = ID.substring(0, 6) + "19" + ID.substring(6, 15);
    } else {
      msgs.add("个人证件号码长度不正确,请仔细检查您输入的号码!");
      return -1;
    }
    String tmp = "";
    if (ID.length() == 18) {
      tmp = ID2;
      ID2 = ID;
      ID = tmp;
    }
    String str1 =
        "select * from CMINDVCLIENT where ID='"
            + ID
            + "' and clientno<>'"
            + ctx.getParameter("CLIENTNO")
            + "'";
    String str2 =
        "select * from CMINDVCLIENT where ID like '"
            + ID2
            + "%' and clientno<>'"
            + ctx.getParameter("CLIENTNO")
            + "'";
    RecordSet rs1 = conn.executeQuery(str1);
    RecordSet rs2 = conn.executeQuery(str2);
    if (rs1.next() || rs2.next()) {
      msgs.add("个人证件号码已经存在,请仔细检查您输入的号码!");
      return -1;
    }

    // CLIENTMGR存在检测
    if (DBUtil.getCellValue(
            conn, "SCUSER", "LOGINNAME", "LOGINNAME='" + CLIENTMGR + "' and USERTYPE<>'3'")
        == null) {
      msgs.add("客户经理不存在,请仔细检查后再提交!");
      return -1;
    }
    // UNIONNO存在检测
    //    if (DBUtil.getCellValue(conn, "CMFAMILYUNION", "UNIONNO", "UNIONNO=" + UNIONNO) == null) {
    //      msgs.add("联户联保小组代码不存在,请仔细检查后再提交!");
    //      return -1;
    //    }
    // UNIONNO在开户网点内
    // RGNCODE存在检测
    //    if (RGNCODE.length() > 0 &&
    //        DBUtil.getCellValue(conn, "CMREGION", "RGNCODE", "RGNCODE='" + RGNCODE + "'") == null)
    // {
    //      msgs.add("行政机构代码不存在,请仔细检查后再提交!");
    //      return -1;
    //    }
    // 网点检测
    //    if (! (SCBranch.checkSub(APPBRHID, MNTBRHID) || MNTBRHID.equals(APPBRHID))) {
    //      msgs.add("登记网点不在维护网点范围内!");
    //      return -1;
    //    }
    assistor.setSqlFieldValue(assistor.getDefaultTbl(), "MNTBRHID", BrhId);
    assistor.setSqlFieldValue(assistor.getDefaultTbl(), "LASTMODIFIED", LASTMODIFIED);
    assistor.setSqlFieldValue(assistor.getDefaultTbl(), "OPERATOR", OPERATOR);
    return 0;
  }
コード例 #19
0
ファイル: CMIndvClient.java プロジェクト: fordream/zhan-cms
  public int postInsertOk(
      SessionContext ctx,
      DatabaseConnection conn,
      FormInstance instance,
      ErrorMessages msgs,
      EventManager manager) {
    if (this.isG) {
      return conn.executeUpdate(
          "delete from cmguarantor where id='" + ctx.getParameter("ID") + "'");
    }

    if (this.initClientNo == null) {
      return 0;
    }

    MyDB.getInstance().addDBConn(conn);
    int ret = 0;
    try {
      UserManager um = (UserManager) ctx.getAttribute(SystemAttributeNames.USER_INFO_NAME);
      String OPERATOR = null;
      OPERATOR = um.getUserName();

      String clientno = null;

      if (this.initClientNo != null) {
        if (currClientNo == null) {
          msgs.add("客户号码未发现,请重做交易!");
          return -1;
        } else {
          ret = ClientMigration.clientMrig(initClientNo, currClientNo, OPERATOR);
          if (ret >= 0) {
            /** I comment following line temporarily to speed up perfomance JGO on 20040905 */
            // ret = CMClientMan.updateClientCatAndType(currClientNo, OPERATOR);
            ret = 0;
          }
          if (ret < 0) {
            String msg = PropertyManager.getProperty("" + ret);
            if (msg == null) {
              msg = "" + ret;
            }
            ctx.setRequestAtrribute("title", "客户信息移行");
            ctx.setRequestAtrribute("msg", "处理失败:" + msg);
            ctx.setRequestAtrribute("flag", "0");
            ctx.setTarget("/showinfo.jsp");
          } else {
            ctx.setRequestAtrribute("title", "客户信息移行");
            ctx.setRequestAtrribute("msg", "处理成功完成!");
            ctx.setRequestAtrribute("flag", "1");
            ctx.setTarget("/showinfo.jsp");
          }
        }
      }
    } catch (Exception e) {
      if (Debug.isDebugMode) {
        e.printStackTrace();
      }
      ret = -1;
    } finally {
      MyDB.getInstance().releaseDBConn();
      return ret;
    }
  }
コード例 #20
0
ファイル: CMIndvClient.java プロジェクト: fordream/zhan-cms
  /** 扩展基类的beforeInsert方法,点击“添加”按钮后响应的事件 */
  public int beforeInsert(
      SessionContext ctx,
      DatabaseConnection conn,
      FormInstance instance,
      ErrorMessages msgs,
      EventManager manager) {

    String GID = (String) ctx.getRequestAttribute("GID");
    String GIDTYPE = (String) ctx.getRequestAttribute("GIDTYPE");
    String GNAME = (String) ctx.getRequestAttribute("GNAME");
    String GCREDITCLASS = (String) ctx.getRequestAttribute("GCREDITCLASS");
    if (GID != null) {
      instance.setReadonly(false);
      instance.setValue("NAME", GNAME);
      instance.setValue("IDTYPE", GIDTYPE);
      instance.setValue("ID", GID);
      instance.setValue("CREDITCLASS", GCREDITCLASS);
      instance.setFieldReadonly("NAME", true);
      instance.setFieldReadonly("IDTYPE", true);
      instance.setFieldReadonly("ID", true);
      instance.setFieldReadonly("CREDITCLASS", true);
      this.isG = true;
    }

    UserManager um = (UserManager) ctx.getAttribute(SystemAttributeNames.USER_INFO_NAME);
    String BrhId = SCUser.getBrhId(um.getUserName());
    String APPDATE = SystemDate.getSystemDate5("");
    String OPERATOR = null;
    try {
      OPERATOR = um.getUserName();
    } catch (Exception ex) {
      return -1;
    }
    if (BrhId != null) {
      instance.setValue("MNTBRHID", BrhId);
      if (!SCBranch.getBrhtype(BrhId).trim().equals("9")) {
        instance.setValue("APPBRHID", BrhId);
      }
      instance.setValue("OPERATOR", OPERATOR);
      instance.setValue("APPDATE", APPDATE);
      instance.setValue("INVESTDATE", APPDATE);
      instance.setValue("LASTMODIFIED", APPDATE);
    }

    if (this.initClientNo != null) {
      MyDB.getInstance().addDBConn(conn);
      InitClientData initdata = InitClientMan.getInitClient(initClientNo);
      MyDB.getInstance().releaseDBConn();

      if (initdata == null) {
        msgs.add("移行客户信息不存在,请检查数据!");
        return -1;
      } else {
        if (initdata.appBrhID != null) {
          instance.setValue("APPBRHID", initdata.appBrhID);
        }
        if (initdata.appDate != null) {
          instance.setValue("APPDATE", util.calToString(initdata.appDate, null));
        }
        if (initdata.clientType != null) {
          instance.setValue("CLIENTTYPE", initdata.clientType.intValue());
        }
        if (initdata.ecomDeptType != null) {
          instance.setValue("ECOMDEPTTYPE", initdata.ecomDeptType.intValue());
        }
        if (initdata.ecomType != null) {
          instance.setValue("ECOMTYPE", initdata.ecomType.intValue());
        }
        if (initdata.etpScopType != null) {
          instance.setValue("ETPSCOPTYPE", initdata.etpScopType.intValue());
        }
        if (initdata.gender != null) {
          instance.setValue("GENDER", initdata.gender.intValue());
        }
        if (initdata.ID != null) {
          instance.setValue("ID", initdata.ID);
        }
        if (initdata.IDType != null) {
          // instance.setValue("IDTYPE", initdata.IDType.intValue());
        }
        if (initdata.name != null) {
          instance.setValue("NAME", initdata.name);
        }
        if (initdata.sectorCat1 != null) {
          instance.setValue("SECTORCAT1", initdata.sectorCat1.intValue());
        }
      }
    }
    return 0;
  }
コード例 #21
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();
    }
  }
コード例 #22
0
  public String format(SessionContext ctx, ElementBean eb1, FormInstance fi, RecordSet values) {
    String name = eb1.getName();
    FormBean fb = FormBeanManager.getForm(fi.getFormid());
    String[] names = fb.getElementKeys();
    String value =
        SessionAttributes.REQUEST_INSATNCE_ID_NAME
            + "="
            + fi.getInstanceid()
            + "&"
            + SessionAttributes.REQUEST_EVENT_ID_NAME
            + "="
            + EventType.BUTTON_EVENT_TYPE
            + "&"
            + SessionAttributes.REQUEST_BUTTON_EVENT_NAME
            + "="
            + SessionAttributes.REQUEST_EDIT_BUTTON_VALUE
            + "&";
    int length = value.length();
    if (names != null) {
      for (int i = 0; i < names.length; i++) {
        ElementBean eb = fb.getElement(names[i]);
        if (eb.isIsPrimaryKey()) {
          if (value.length() != 0 && !value.endsWith("&")) {
            value += " &";
          }
          String fldvalue = values.getString(eb.getName());
          if (fldvalue != null) {
            fldvalue = fldvalue.trim();
          }
          value += eb.getName() + "=" + fldvalue;
        }
      }
    }

    if (value.length() == length) {
      return "使用修改功能,请定义主键";
    }
    String actionurl = "";

    try {
      String targetFormId = eb1.getDefaultValue();

      if (targetFormId != null) {
        FormBean fb1 = FormBeanManager.getForm(targetFormId);
        if (fb1 != null) {
          if (fb1.getUrl() != null) {
            actionurl = fb1.getUrl();
          }
        }
      }
    } catch (Exception e) {

    }
    if (actionurl.trim().length() > 0) {
      actionurl = actionurl.trim();
    } else {
      actionurl = PageGenerator.DEFAULT_URL_LOCATE;
    }
    //        if ( fi.isReadonly() ) {
    //            String body = "<a class='list_edit_href' href='#' >" + eb1.getCaption() +
    //                "</a>";
    //
    //            return body;
    //        } else {
    String body =
        "<a class=\"list_edit_href\" href=\"#\" onclick=\"window.open('"
            + ctx.getUrl(actionurl)
            + "?"
            + value
            + "','FI"
            + fi.getInstanceid()
            + "','height=600,width=800,toolbar=no,scrollbars=yes,resizable=yes');\">"
            + "修改"
            + "</a>";

    return body;
    //        }
  }