コード例 #1
0
  @RequestMapping("tZjDingdan-info-remove")
  public String remove(
      @RequestParam("selectedItem") List<Long> selectedItem,
      RedirectAttributes redirectAttributes) {
    List<TZjDingdan> tZjDingdans = tZjDingdanManager.findByIds(selectedItem);

    tZjDingdanManager.removeAll(tZjDingdans);

    messageHelper.addFlashMessage(redirectAttributes, "core.success.delete", "删除成功");

    return "redirect:/sckf/tZjDingdan-info-list.do";
  }
コード例 #2
0
  @RequestMapping("tZjDingdan-info-input")
  public String input(@RequestParam(value = "id", required = false) Long id, Model model) {
    if (id != null) {
      TZjDingdan tZjDingdan = tZjDingdanManager.get(id);
      model.addAttribute("model", tZjDingdan);
    }

    return "sckf/tZjDingdan-info-input";
  }
コード例 #3
0
  @RequestMapping("tZjDingdan-info-list")
  public String list(
      @ModelAttribute Page page, @RequestParam Map<String, Object> parameterMap, Model model) {
    List<PropertyFilter> propertyFilters = PropertyFilter.buildFromMap(parameterMap);
    page = tZjDingdanManager.pagedQuery(page, propertyFilters);

    model.addAttribute("page", page);

    return "sckf/tZjDingdan-info-list";
  }
コード例 #4
0
  @RequestMapping("tZjDingdan-info-save")
  public String save(
      @ModelAttribute TZjDingdan tZjDingdan,
      @RequestParam Map<String, Object> parameterMap,
      RedirectAttributes redirectAttributes) {
    TZjDingdan dest = null;

    Long id = tZjDingdan.getId();

    if (id != null) {
      dest = tZjDingdanManager.get(id);
      beanMapper.copy(tZjDingdan, dest);
    } else {
      dest = tZjDingdan;
    }

    tZjDingdanManager.save(dest);

    messageHelper.addFlashMessage(redirectAttributes, "core.success.save", "保存成功");
    return "redirect:/sckf/tZjDingdan-info-list.do";
  }
コード例 #5
0
  @RequestMapping("tZjDingdan-info-export")
  public void export(
      @ModelAttribute Page page,
      @RequestParam Map<String, Object> parameterMap,
      HttpServletResponse response)
      throws Exception {
    List<PropertyFilter> propertyFilters = PropertyFilter.buildFromMap(parameterMap);
    page = tZjDingdanManager.pagedQuery(page, propertyFilters);

    List<TZjDingdan> tZjDingdans = (List<TZjDingdan>) page.getResult();

    TableModel tableModel = new TableModel();
    // tableModel.setName("tZjDingdan info");
    // tableModel.addHeaders("id", "name");
    tableModel.setData(tZjDingdans);
    exportor.export(response, tableModel);
  }