コード例 #1
0
  @RequestMapping("pjYqcheck-info-remove")
  public String remove(
      @RequestParam("selectedItem") List<Long> selectedItem,
      RedirectAttributes redirectAttributes) {
    List<PjYqcheck> pjYqchecks = pjYqcheckManager.findByIds(selectedItem);

    pjYqcheckManager.removeAll(pjYqchecks);

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

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

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

    model.addAttribute("page", page);

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

    Long id = pjYqcheck.getFid();

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

    pjYqcheckManager.save(dest);

    messageHelper.addFlashMessage(redirectAttributes, "core.success.save", "保存成功");

    return "redirect:/gcgl/pjYqcheck-info-list.do";
  }
コード例 #5
0
  @RequestMapping("pjYqcheck-info-export")
  public void export(
      @ModelAttribute Page page,
      @RequestParam Map<String, Object> parameterMap,
      HttpServletResponse response)
      throws Exception {
    List<PropertyFilter> propertyFilters = PropertyFilter.buildFromMap(parameterMap);
    page = pjYqcheckManager.pagedQuery(page, propertyFilters);

    List<PjYqcheck> pjYqchecks = (List<PjYqcheck>) page.getResult();

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