public static TableModel convertSubBiTableData(List<ZcBMerDiscount> biList) {

    BeanTableModel<ZcBMerDiscount> tm =
        new BeanTableModel<ZcBMerDiscount>() {

          private static final long serialVersionUID = 6888363838628062064L;

          @Override
          public boolean isCellEditable(int row, int column) {

            //        String columnId = this.getColumnIdentifier(column);
            //
            //        if ("zcSuName".equals(columnId)) {
            //
            //          return false;
            //
            //        }

            return super.isCellEditable(row, column);
          }

          @Override
          public void setValueAt(Object aValue, int rowIndex, int columnIndex) {

            System.out.println("======================value=" + aValue + "----");
            ZcBMerDiscount bean = dataBeanList.get(rowIndex);

            if ("zcSuName".equals(this.getColumnIdentifier(columnIndex))) {

              if (aValue == null) {

                bean.setZcSuCode(null);

                bean.setZcSuName(null);
              }

              //          fireTableCellUpdated(rowIndex, columnIndex);
              //
              //          putEditedData(dataBeanList.get(rowIndex));

              super.setValueAt(aValue, rowIndex, columnIndex);

            } else if ("zcTreatyLowerLimit".equals(this.getColumnIdentifier(columnIndex))
                || "zcTreatyUpperLimit".equals(this.getColumnIdentifier(columnIndex))) {
              if (aValue == null) {
                super.setValueAt(0, rowIndex, columnIndex);
              } else {
                super.setValueAt(aValue, rowIndex, columnIndex);
              }

            } else {

              super.setValueAt(aValue, rowIndex, columnIndex);
            }
          }
        };

    tm.setOidFieldName("tempId");

    for (ZcBMerDiscount o : biList) {

      o.setTempId(Guid.genID());
    }

    tm.setDataBean(biList, BillDetailInfo);

    return tm;
  }
Esempio n. 2
0
package com.ufgov.zc.server.system.service.impl;