@RequiresPermissions("biz:direct:edit") @RequestMapping(value = "delete") public String delete(Long id, RedirectAttributes redirectAttributes) { directBalanceHisService.delete(id); addMessage(redirectAttributes, "删除直通余额成功"); return "redirect:" + Global.getAdminPath() + "/biz/directBalanceHis/?repage"; }
@RequiresPermissions("biz:direct:edit") @RequestMapping(value = "save") public String save( DirectBalanceHis directBalanceHis, Model model, RedirectAttributes redirectAttributes) { if (!beanValidator(model, directBalanceHis)) { return form(directBalanceHis, model); } if (directBalanceHis.getDirect() != null && directBalanceHis.getDirect().getId() != null) { Direct direct = directService.get(directBalanceHis.getDirect().getId()); directBalanceHis.setDirect(direct); directBalanceHis.setBegin(direct.getBalance()); direct.setBalance(direct.getBalance() + directBalanceHis.getAmount()); directBalanceHis.setEnd(direct.getBalance()); } directBalanceHis.setStatus("0"); directBalanceHisService.save(directBalanceHis); addMessage(redirectAttributes, "保存余额成功"); return "redirect:" + Global.getAdminPath() + "/biz/directBalanceHis/list?direct.id=" + directBalanceHis.getDirect().getId(); }