Ejemplo n.º 1
0
  @Override
  public AggregatedValueObject queryDataByProcId(String billTypeOrProc, String procMsg)
      throws BusinessException {
    if (CommonUtil.isNull(billTypeOrProc) || CommonUtil.isNull(procMsg)) {
      return null;
    }
    String[] splits = procMsg.split(StorageVO.Procmsg_flag);
    if (splits == null || splits.length == 0) {
      return null;
    }
    String pk = splits[0];
    HYPubBO bo = new HYPubBO();
    String[] vonames =
        new String[] {
          HYBillVO.class.getName(), ReturnVO.class.getName(), ReturnBVO.class.getName()
        };
    AggregatedValueObject vo = bo.queryBillVOByPrimaryKey(vonames, pk);

    if (vo == null
        || vo.getParentVO() == null
        || vo.getChildrenVO() == null
        || vo.getChildrenVO().length == 0) {
      return vo;
    }

    ResetRefValues.setReturnBodyValues(vo);

    return vo;
  }
Ejemplo n.º 2
0
 /* (non-Javadoc)
  * @see nc.ui.fbm.pub.AbstractUIChecker#check()
  */
 @Override
 public String check() {
   String cctype =
       (String) getUI().getBillCardPanel().getHeadItem(RegisterVO.CCTYPE).getValueObject();
   String pk_loanbank =
       (String) getUI().getBillCardPanel().getHeadItem(RegisterVO.PK_LOANBANK).getValueObject();
   if (!cctype.equals(FbmBusConstant.CCTYPE_NONE)) {
     if (CommonUtil.isNull(pk_loanbank)) {
       return nc.ui.ml.NCLangRes.getInstance()
           .getStrByID("36201505", "UPP36201505-000002") /* @res" 使用授信额度,贷款银行不能为空"*/;
     }
   }
   return null;
 }
Ejemplo n.º 3
0
  public StorageDataSet getDataSetBySuperVos(SuperVO[] vos, int digit, Class cls)
      throws BusinessException {
    int iRowCount = (vos == null) ? 0 : vos.length;
    SuperVO vo = null;
    if (iRowCount == 0) { // 查询数据为空,必须构造column
      // System.out.println("DatasetUtil.getDatasetByCAVOs:行数为0");
      try {
        vo = (SuperVO) cls.newInstance();
      } catch (Exception e) {
        throw new BusinessException(e);
      }
    } else {
      vo = vos[0];
      cls = vo.getClass();
    }

    // 反射获得类属性信息
    QEDataSet sds = new QEDataSet();
    try {
      String names[] = vo.getAttributeNames();
      String realnames[] = null;
      if (vo instanceof IVarNameDefine) {
        realnames = ((IVarNameDefine) vo).getVaribleNames();
      }

      // 获得列数
      int iColCount = (names == null) ? 0 : names.length;

      Vector vecName = new Vector();
      Vector vecCol = new Vector();
      for (int i = 0; i < iColCount; i++) {
        try {
          // 创建列
          Column col = new Column();
          if (!CommonUtil.isNull(realnames) && !CommonUtil.isNull(realnames[i])) {
            col.setCaption(realnames[i]);

            col.setColumnName(names[i]);
            // 记录
            vecName.addElement(names[i]);
            vecCol.addElement(col);
            // 获得列类型
            Field fld = null;
            try {
              fld = cls.getField(names[i]);
            } catch (NoSuchFieldException e) {
              throw new BusinessException(e);
            }
            int iType = class2VariantType(fld.getType());
            /*
             * int iType = Variant.STRING; Object obj =
             * vos[0].getAttributeValue(names[i]); if (obj != null &&
             * obj.getClass().getSuperclass() == Number.class) iType =
             * Variant.DOUBLE;
             */
            col.setDataType(iType);
          }

        } catch (Exception e) {
          throw new BusinessException(e);
        }
      }
      // 获得有效列数
      iColCount = vecName.size();
      if (iColCount == 0) {
        // System.out.println("DatasetUtil.getDatasetByCAVOs:列数为0");
        return null;
      }
      // 重构列名数组和列数组
      names = new String[iColCount];
      vecName.copyInto(names);
      Column[] cols = new Column[iColCount];
      vecCol.copyInto(cols);

      // 转换
      sds = new QEDataSet();
      sds.setColumns(cols);
      sds.open();
      for (int i = 0; i < iRowCount; i++) {
        // 构造数据行
        DataRow row = new DataRow(sds);
        for (int j = 0; j < iColCount; j++) {
          Object obj = vos[i].getAttributeValue(names[j]);
          String str = (obj == null) ? null : obj.toString();
          int iColType = cols[j].getDataType();
          // 填充数据行
          DatasetUtil.makeDataRow(row, str, j, iColType);
          row = row;
        }
        // 加行
        sds.addRow(row);
      }
      sds.first();
    } catch (Exception e) {
      throw new BusinessException(e);
    }
    return sds;
  }
Ejemplo n.º 4
0
  protected String makeQueryConditionSql(ReportParam reportParam) {
    StringBuffer sb = new StringBuffer();

    sb.append(" 1=1 ");
    if (!CommonUtil.isNull(reportParam.getFbmbillno())) {
      sb.append(" and fbmbillno='" + reportParam.getFbmbillno() + "'");
    }
    if (!CommonUtil.isNull(reportParam.getPk_baseinfo())) {
      sb.append(" and fbm_baseinfo.pk_baseinfo='" + reportParam.getPk_baseinfo() + "'");
    }
    if (!CommonUtil.isNull(reportParam.getReceiveunit())) {
      sb.append(" and receiveunit='" + reportParam.getReceiveunit() + "'");
    }
    if (!CommonUtil.isNull(reportParam.getPayunit())) {
      sb.append(" and payunit='" + reportParam.getPayunit() + "'");
    }
    if (!CommonUtil.isNull(reportParam.getInvoicedate_begin())) {
      sb.append(" and invoicedate>='" + reportParam.getInvoicedate_begin() + "'");
    }
    if (!CommonUtil.isNull(reportParam.getInvoicedate_end())) {
      sb.append(" and invoicedate <='" + reportParam.getInvoicedate_end() + "'");
    }
    if (!CommonUtil.isNull(reportParam.getEnddate_begin())) {
      sb.append(" and enddate>='" + reportParam.getEnddate_begin() + "'");
    }
    if (!CommonUtil.isNull(reportParam.getEnddate_end())) {
      sb.append(" and enddate<='" + reportParam.getEnddate_end() + "'");
    }
    if (!CommonUtil.isNull(reportParam.getPk_curr())) {
      sb.append(" and pk_curr='" + reportParam.getPk_curr() + "'");
    }
    if (!CommonUtil.isNull(reportParam.getMoney_begin())) {
      sb.append(" and fbm_baseinfo.moneyy>=" + reportParam.getMoney_begin() + "");
    }
    if (!CommonUtil.isNull(reportParam.getMoney_end())) {
      sb.append(" and fbm_baseinfo.moneyy <=" + reportParam.getMoney_end() + "");
    }
    if (!CommonUtil.isNull(reportParam.getFbmbilltype())) {
      sb.append(" and fbmbilltype = '" + reportParam.getFbmbilltype() + "'");
    }
    if (!CommonUtil.isNull(reportParam.getOrientation())) {
      sb.append(" and orientation = '" + reportParam.getOrientation() + "'");
    }
    if (!CommonUtil.isNull(reportParam.getFbmbillstatus())) {
      String fbmbillstatus = reportParam.getFbmbillstatus();

      Map<String, String> chinamap = getStatusChinaKeyMap();
      sb.append(" and fbm_action.endstatus = " + chinamap.get("'" + fbmbillstatus + "'"));
    }

    return sb.toString();
  }