// 设置单元格的值
 @Override
 public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
   TShopCharge tShopCharge = tShopChargeList.get(rowIndex);
   if (tShopCharge != null && aValue != null) {
     switch (columnIndex) {
       case 0:
         break;
       case 1:
         tShopCharge.setSelect(!tShopCharge.isSelect());
         return;
       case 2:
         if (aValue != null
             && !aValue.toString().equals("")
             && MatcherFormatUtil.MatcherPriceScheme(aValue.toString())
             && aValue.toString().length() < 10) {
           tShopCharge.setAMount(Double.parseDouble(aValue.toString()));
         }
         break;
       case 3:
         if (aValue != null
             && !aValue.toString().equals("")
             && MatcherFormatUtil.MatcherPriceScheme(aValue.toString())
             && aValue.toString().length() < 10) {
           tShopCharge.setGiftAmount(Double.parseDouble(aValue.toString()));
         }
         break;
       case 4:
         tShopCharge.setType(aValue.toString());
         break;
       case 5:
         return;
       case 6:
         tShopCharge.setStartTimeStr(aValue.toString());
         try {
           tShopCharge.setStartTime(DateUtil.getDate(aValue.toString(), DateUtil.TYPE_DATE));
         } catch (ParseException e) {
           e.printStackTrace();
         }
         break;
       case 7:
         tShopCharge.setEndTimeStr(aValue.toString());
         try {
           tShopCharge.setEndTime(DateUtil.getDate(aValue.toString(), DateUtil.TYPE_DATE));
         } catch (ParseException e) {
           e.printStackTrace();
         }
         break;
       case 9:
         tShopCharge.setIsValid(!tShopCharge.isIsValid());
         break;
     }
     tShopCharge.setSelect(true);
     fireTableCellUpdated(rowIndex, 1);
   }
 }
Пример #2
0
 // 条件查询
 protected void termQuery(final int currentPage) {
   final TShopCharge tshopcharge = new TShopCharge();
   // tshopcharge.setChargeID(cardNumTF.getText().getText().trim());
   tshopcharge.setStartTime(startTimeTF.getDate());
   tshopcharge.setEndTime(timeTF.getDate());
   new Thread() {
     public void run() {
       tableJsp.getViewport().remove(table);
       tableJsp.getViewport().add(waitComponent);
       try {
         pageView.setCurrentPage(currentPage);
         PageModel<TShopCharge> pageModel =
             tShopChargeService.getScrollService(
                 pageView.getFirstResult(), pageView.getMaxResult(), tshopcharge);
         pageView.setPageModel(pageModel);
         pageView.setPageIndex(
             PageIndex.getPageIndex(
                 pageView.getPageCode(), pageView.getCurrentPage(), pageView.getTotalPage()));
         if (pageModel != null) {
           Util.clearTableRowSorter(table);
           memberQueryShopChargeModel.setRowData(pageModel.getResultList());
           SwingUtilities.invokeLater(
               new Runnable() {
                 @Override
                 public void run() {
                   tableJsp.getViewport().remove(waitComponent);
                   tableJsp.getViewport().add(table);
                   //									Util.setJTabelAutoClumnWidth(table);
                   pagingComponent.show();
                 }
               });
         } else {
           // 没有优惠卷信息
           tableJsp.getViewport().remove(waitComponent);
           tableJsp.getViewport().add(table);
           memberQueryShopChargeModel.clear();
         }
       } catch (Exception e) {
         e.printStackTrace();
       }
     }
   }.start();
 }