Esempio n. 1
0
 private void search(long pageNumber, long pageSize) {
   SearchBean searchBean = new SearchBean();
   searchBean.setId(
       StringUtils.isEmpty(field.getText()) ? null : Integer.parseInt(field.getText()));
   searchBean.setType(
       type.getSelectedItemValue() == null ? null : type.getSelectedItemValue().toString());
   searchBean.setPageNumber(pageNumber);
   searchBean.setPageSize(pageSize);
   getDatas(searchBean);
 }
Esempio n. 2
0
  private void init() {
    // 初始化表头
    for (String column : columnNames) {
      columns.add(column);
    }

    // 初始化静态数据
    Map<String, Object> black = new HashMap<String, Object>();
    black.put("label", "");
    black.put("value", null);
    str.add(black);

    Map<String, Object> item3 = new HashMap<String, Object>();
    item3.put("label", "区域");
    item3.put("value", 0);
    str.add(item3);

    Map<String, Object> item = new HashMap<String, Object>();
    item.put("label", "收入");
    item.put("value", 1);
    str.add(item);

    Map<String, Object> item1 = new HashMap<String, Object>();
    item1.put("label", "支出");
    item1.put("value", 2);
    str.add(item1);

    Map<String, Object> item2 = new HashMap<String, Object>();
    item2.put("label", "余额");
    item2.put("value", 3);
    str.add(item2);

    parent.add(black);

    SearchBean searchBean = new SearchBean();
    searchBean.setPageNumber(new Long(1));
    searchBean.setPageSize(new Long(15));
    getDatas(searchBean);
  }
Esempio n. 3
0
 private void saveUpdateData() {
   List<Map<String, Object>> datas = table.getSelectRowValue();
   if (CollectionUtils.isNotEmpty(datas)) {
     for (Map<String, Object> data : datas) {
       try {
         if (StringUtils.isEmpty(
             (Object) data.get(CodeDictColumnEnum.getCodeDictColumnValueByKey("id").getValue()))) {
           codeDictMapper.insertCodeDict(data);
         } else {
           codeDictMapper.updateCodeDict(data);
         }
       } catch (Exception e1) {
         e1.printStackTrace();
       }
     }
     SearchBean searchBean = new SearchBean();
     searchBean.setPageNumber(new Long(1));
     searchBean.setPageSize(new Long(15));
     getDatas(searchBean);
   } else {
     JOptionPane.showMessageDialog(null, "请先选择需要保存的数据!");
   }
 }