@RequestMapping("bpm-task-def-notice-removeNotice")
  public String removeNotice(@RequestParam("id") Long id) {
    BpmTaskDefNotice bpmTaskDefNotice = bpmTaskDefNoticeManager.get(id);
    Long bpmProcessId = bpmTaskDefNotice.getBpmProcess().getId();
    bpmTaskDefNoticeManager.remove(bpmTaskDefNotice);

    return "redirect:/bpm/bpm-task-def-notice-list.do?bpmProcessId=" + bpmProcessId;
  }
  @RequestMapping("bpm-task-def-notice-remove")
  public String remove(
      @RequestParam("selectedItem") List<Long> selectedItem,
      @RequestParam("bpmProcessId") Long bpmProcessId,
      RedirectAttributes redirectAttributes) {
    List<BpmTaskDefNotice> bpmCategories = bpmTaskDefNoticeManager.findByIds(selectedItem);
    bpmTaskDefNoticeManager.removeAll(bpmCategories);
    messageHelper.addFlashMessage(redirectAttributes, "core.success.delete", "删除成功");

    return "redirect:/bpm/bpm-task-def-notice-list.do?bpmProcessId=" + bpmProcessId;
  }
  @RequestMapping("bpm-task-def-notice-list")
  public String list(
      @ModelAttribute Page page, @RequestParam Map<String, Object> parameterMap, Model model) {
    List<PropertyFilter> propertyFilters = PropertyFilter.buildFromMap(parameterMap);
    page = bpmTaskDefNoticeManager.pagedQuery(page, propertyFilters);
    model.addAttribute("page", page);

    return "bpm/bpm-task-def-notice-list";
  }
  @RequestMapping("bpm-task-def-notice-input")
  public String input(@RequestParam(value = "id", required = false) Long id, Model model) {
    if (id != null) {
      BpmTaskDefNotice bpmTaskDefNotice = bpmTaskDefNoticeManager.get(id);
      model.addAttribute("model", bpmTaskDefNotice);
    }

    List<BpmMailTemplate> bpmMailTemplates = bpmMailTemplateManager.getAll();
    model.addAttribute("bpmMailTemplates", bpmMailTemplates);

    return "bpm/bpm-task-def-notice-input";
  }
  @RequestMapping("bpm-task-def-notice-save")
  public String save(
      @ModelAttribute BpmTaskDefNotice bpmTaskDefNotice,
      @RequestParam("bpmProcessId") Long bpmProcessId,
      @RequestParam("bpmMailTemplateId") Long bpmMailTemplateId,
      RedirectAttributes redirectAttributes) {
    BpmTaskDefNotice dest = null;
    Long id = bpmTaskDefNotice.getId();

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

    dest.setBpmProcess(bpmProcessManager.get(bpmProcessId));
    dest.setBpmMailTemplate(bpmMailTemplateManager.get(bpmMailTemplateId));
    bpmTaskDefNoticeManager.save(dest);

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

    return "redirect:/bpm/bpm-task-def-notice-list.do?bpmProcessId=" + bpmProcessId;
  }
  @RequestMapping("bpm-task-def-notice-export")
  public void export(
      @ModelAttribute Page page,
      @RequestParam Map<String, Object> parameterMap,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    List<PropertyFilter> propertyFilters = PropertyFilter.buildFromMap(parameterMap);
    page = bpmTaskDefNoticeManager.pagedQuery(page, propertyFilters);

    List<BpmTaskDefNotice> bpmCategories = (List<BpmTaskDefNotice>) page.getResult();
    TableModel tableModel = new TableModel();
    tableModel.setName("bpm-process");
    tableModel.addHeaders("id", "name");
    tableModel.setData(bpmCategories);
    exportor.export(request, response, tableModel);
  }