Пример #1
0
 /**
  * 逆向退款----更新跳转
  *
  * @param model
  * @param refund
  * @return
  */
 @RequestMapping(value = "updateForward")
 public String updateForward(Model model, Refund refund) {
   try {
     Refund refundResult = refundService.getRefundById(refund.getId());
     model.addAttribute("refund", refundResult);
   } catch (Exception e) {
     LOG.error("refund updateForward has error.", e);
   }
   return viewPrefix + "/update";
 }
Пример #2
0
 /**
  * 逆向退款----删除
  *
  * @param refund
  * @return
  */
 @RequestMapping(value = "delete")
 @ResponseBody
 public Wrapper<?> delete(Refund refund) {
   try {
     refund.setUpdateUser(getLoginUserCnName());
     if (refundService.delete(refund)) {
       return WrapMapper.wrap(Wrapper.SUCCESS_CODE, "删除成功!");
     } else {
       return WrapMapper.wrap(Wrapper.ERROR_CODE, "删除失败!");
     }
   } catch (Exception e) {
     LOG.error("refund delete has error.", e);
     return WrapMapper.error();
   }
 }
Пример #3
0
 /**
  * 逆向退款----添加
  *
  * @param refund
  * @return
  */
 @RequestMapping(value = "add")
 @ResponseBody
 public Wrapper<?> add(Refund refund) {
   try {
     refund.setCreateUser(getLoginUserCnName());
     if (refundService.insert(refund)) {
       return WrapMapper.wrap(Wrapper.SUCCESS_CODE, "添加成功!");
     } else {
       return WrapMapper.wrap(Wrapper.ERROR_CODE, "添加失败!");
     }
   } catch (ExistedException e) {
     LOG.warn("refund add fail, exist refund.");
     return WrapMapper.wrap(Wrapper.ERROR_CODE, "添加失败,已经存在");
   } catch (Exception e) {
     LOG.error("refund add has error.", e);
     return WrapMapper.wrap(Wrapper.ERROR_CODE, "添加失败!");
   }
 }