Ejemplo n.º 1
0
 @SecurityMapping(
     title = "支付方式编辑",
     value = "/seller/payment_edit.htm*",
     rtype = "seller",
     rname = "支付方式",
     rcode = "payment_seller",
     rgroup = "交易管理")
 @RequestMapping("/seller/payment_edit.htm")
 public ModelAndView payment_edit(
     HttpServletRequest request, HttpServletResponse response, String mark) {
   ModelAndView mv =
       mv =
           new JModelAndView(
               "user/default/usercenter/payment/" + mark + ".html",
               configService.getSysConfig(),
               this.userConfigService.getUserConfig(),
               0,
               request,
               response);
   Map params = new HashMap();
   User user = this.userService.getObjById(SecurityUserHolder.getCurrentUser().getId());
   params.put("mark", mark);
   params.put("store_id", user.getStore().getId());
   List<Payment> objs =
       this.paymentService.query(
           "select obj from Payment obj where obj.mark=:mark and obj.store.id=:store_id",
           params,
           -1,
           -1);
   if (objs.size() > 0) mv.addObject("obj", objs.get(0));
   mv.addObject("bankBeanList", ConstantUtils._getBankIDList());
   return mv;
 }
Ejemplo n.º 2
0
 @SecurityMapping(
     title = "支付方式卸载",
     value = "/seller/payment_uninstall.htm*",
     rtype = "seller",
     rname = "支付方式",
     rcode = "payment_seller",
     rgroup = "交易管理")
 @RequestMapping("/seller/payment_uninstall.htm")
 public ModelAndView payment_uninstall(
     HttpServletRequest request, HttpServletResponse response, String mark) {
   ModelAndView mv =
       mv =
           new JModelAndView(
               "user/default/usercenter/success.html",
               configService.getSysConfig(),
               this.userConfigService.getUserConfig(),
               0,
               request,
               response);
   Map params = new HashMap();
   User user = this.userService.getObjById(SecurityUserHolder.getCurrentUser().getId());
   params.put("mark", mark);
   params.put("store_id", user.getStore().getId());
   List<Payment> objs =
       this.paymentService.query(
           "select obj from Payment obj where obj.mark=:mark and obj.store.id=:store_id",
           params,
           -1,
           -1);
   if (objs.size() > 0) {
     for (OrderForm of : objs.get(0).getOfs()) {
       of.setPayment(null);
       this.orderFormService.update(of);
     }
     this.paymentService.delete(objs.get(0).getId());
   }
   mv.addObject("op_title", "支付方式卸载成功");
   mv.addObject("url", CommUtil.getURL(request) + "/seller/payment.htm");
   return mv;
 }
Ejemplo n.º 3
0
 @SecurityMapping(
     title = "支付方式保存",
     value = "/seller/payment_save.htm*",
     rtype = "seller",
     rname = "支付方式",
     rcode = "payment_seller",
     rgroup = "交易管理")
 @RequestMapping("/seller/payment_save.htm")
 public ModelAndView payment_save(
     HttpServletRequest request, HttpServletResponse response, String id) {
   ModelAndView mv =
       new JModelAndView(
           "user/default/usercenter/success.html",
           configService.getSysConfig(),
           this.userConfigService.getUserConfig(),
           0,
           request,
           response);
   WebForm wf = new WebForm();
   if (!id.equals("")) {
     Payment obj = this.paymentService.getObjById(CommUtil.null2Long(id));
     Payment payment = (Payment) wf.toPo(request, obj);
     String province = request.getParameter("province").split("_")[1];
     payment.setProvince(province);
     this.paymentService.update(payment);
   } else {
     Payment payment = wf.toPo(request, Payment.class);
     payment.setAddTime(new Date());
     payment.setType("user");
     User user = this.userService.getObjById(SecurityUserHolder.getCurrentUser().getId());
     payment.setStore(user.getStore());
     String province = request.getParameter("province").split("_")[1];
     payment.setProvince(province);
     this.paymentService.save(payment);
   }
   mv.addObject("op_title", "支付方式保存成功");
   mv.addObject("url", CommUtil.getURL(request) + "/seller/payment.htm");
   return mv;
 }