Exemplo 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);
 }
Exemplo n.º 2
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, "请先选择需要保存的数据!");
   }
 }