@RequestMapping("workcal-rule-save")
public String save(@ModelAttribute WorkcalRule workcalRule,
@RequestParam("workcalTypeId") Long workcalTypeId,
RedirectAttributes redirectAttributes) {
Long id = workcalRule.getId();
WorkcalRule dest = null;
if (id != null) {
dest = workcalRuleManager.get(id);
beanMapper.copy(workcalRule, dest);
} else {
dest = workcalRule;
}
dest.setWorkcalType(workcalTypeManager.get(workcalTypeId));
workcalRuleManager.save(dest);
messageHelper.addFlashMessage(redirectAttributes, "core.success.save",
"保存成功");
return "redirect:/workcal/workcal-rule-list.do";