Пример #1
0
 /**
  * 初始化列信息
  *
  * @param isAdd 是否时添加
  * @param isInit 是否从新初始化
  * @throws java.lang.Exception 异常
  */
 private final void initRowInfo(boolean isMaster, boolean isAdd, boolean isInit)
     throws java.lang.Exception {
   // 是否是主表
   if (isMaster) {
     if (isInit && m_RowInfo.size() > 0) m_RowInfo.clear(); // 清除旧数据
     if (!isAdd) m_RowInfo.put(getMaterTable()); // 不是新增时,推入主表当前行
   } else {
     EngineDataSet dsDetail = dsDetailTable;
     if (d_RowInfos == null) d_RowInfos = new ArrayList(dsDetail.getRowCount());
     else if (isInit) d_RowInfos.clear();
     dsDetail.first();
     for (int i = 0; i < dsDetail.getRowCount(); i++) {
       RowMap row = new RowMap(dsDetail);
       d_RowInfos.add(row);
       dsDetail.next();
     }
   }
 }
Пример #2
0
 /**
  * 初始化列信息
  *
  * @param isAdd 是否时添加
  * @param isInit 是否从新初始化
  * @throws java.lang.Exception 异常
  */
 private final void initRowInfo(boolean isInit) throws java.lang.Exception {
   /** 本月销售* */
   double zxsje = 0;
   double zjje = 0;
   if (d_XsInfos == null) d_XsInfos = new ArrayList(dsXsTable.getRowCount());
   if (isInit) d_XsInfos.clear();
   else {
     dsXsTable.first();
     for (int i = 0; i < dsXsTable.getRowCount(); i++) {
       RowMap row = new RowMap(dsXsTable);
       String xsje = dsXsTable.getValue("xsje");
       zxsje = zxsje + Double.parseDouble(xsje.equals("") ? "0" : xsje);
       String jje = dsXsTable.getValue("jje");
       zjje = zjje + Double.parseDouble(jje.equals("") ? "0" : jje);
       d_XsInfos.add(row);
       dsXsTable.next();
     }
   }
   /** 本月收款* */
   double zjsje = 0;
   if (d_JsInfos == null) d_JsInfos = new ArrayList(dsJsTable.getRowCount());
   if (isInit) d_JsInfos.clear();
   else {
     dsJsTable.first();
     for (int i = 0; i < dsJsTable.getRowCount(); i++) {
       RowMap row = new RowMap(dsJsTable);
       String je = dsJsTable.getValue("je");
       zjsje = zjsje + Double.parseDouble(je.equals("") ? "0" : je);
       d_JsInfos.add(row);
       dsJsTable.next();
     }
   }
   /** 本月退货* */
   double zthje = 0;
   if (d_ThInfos == null) d_ThInfos = new ArrayList(dsThTable.getRowCount());
   if (isInit) d_ThInfos.clear();
   else {
     dsXsTable.first();
     for (int i = 0; i < dsThTable.getRowCount(); i++) {
       RowMap row = new RowMap(dsThTable);
       String tjje = dsThTable.getValue("tjje");
       zthje = zthje + Double.parseDouble(tjje.equals("") ? "0" : tjje);
       d_ThInfos.add(row);
       dsThTable.next();
     }
   }
   /** 其他应收款* */
   double zfy = 0;
   if (d_QtInfos == null) d_QtInfos = new ArrayList(dsQtTable.getRowCount());
   if (isInit) d_QtInfos.clear();
   else {
     dsQtTable.first();
     for (int i = 0; i < dsQtTable.getRowCount(); i++) {
       RowMap row = new RowMap(dsQtTable);
       String fy = dsQtTable.getValue("fy");
       zfy = zfy + Double.parseDouble(fy.equals("") ? "0" : fy);
       d_QtInfos.add(row);
       dsQtTable.next();
     }
   }
   masterRow.put("zxsje", String.valueOf(zxsje));
   masterRow.put("zjje", String.valueOf(zjje));
   masterRow.put("zjsje", String.valueOf(zjsje));
   masterRow.put("zthje", String.valueOf(zthje));
   masterRow.put("zfy", String.valueOf(zfy));
   // masterRow.put("zsk",String.valueOf(zjsje+zfy));
 }