@RequestMapping("workcal-part-save")
public String save(@ModelAttribute WorkcalPart workcalPart,
@RequestParam("workcalRuleId") Long workcalRuleId,
RedirectAttributes redirectAttributes) {
Long id = workcalPart.getId();
WorkcalPart dest = null;
if (id != null) {
dest = workcalPartManager.get(id);
beanMapper.copy(workcalPart, dest);
} else {
dest = workcalPart;
}
dest.setWorkcalRule(workcalRuleManager.get(workcalRuleId));
workcalPartManager.save(dest);
messageHelper.addFlashMessage(redirectAttributes, "core.success.save",
"保存成功");