Exemplo n.º 1
0
  /**
   * grouppricerange保存管理
   *
   * @param id
   * @return
   */
  @SecurityMapping(
      title = "团购价格区间保存",
      value = "/admin/group_price_save.htm*",
      rtype = "admin",
      rname = "团购管理",
      rcode = "group_admin",
      rgroup = "运营")
  @RequestMapping("/admin/group_price_save.htm")
  public ModelAndView save(
      HttpServletRequest request,
      HttpServletResponse response,
      String id,
      String currentPage,
      String cmd) {
    WebForm wf = new WebForm();
    GroupPriceRange grouppricerange = null;
    if (id.equals("")) {
      grouppricerange = wf.toPo(request, GroupPriceRange.class);
      grouppricerange.setAddTime(new Date());
    } else {
      GroupPriceRange obj = this.grouppricerangeService.getObjById(Long.parseLong(id));
      grouppricerange = (GroupPriceRange) wf.toPo(request, obj);
    }

    if (id.equals("")) {
      this.grouppricerangeService.save(grouppricerange);
    } else this.grouppricerangeService.update(grouppricerange);
    ModelAndView mv =
        new JModelAndView(
            "admin/blue/success.html",
            configService.getSysConfig(),
            this.userConfigService.getUserConfig(),
            0,
            request,
            response);
    mv.addObject("list_url", CommUtil.getURL(request) + "/admin/group_price_list.htm");
    mv.addObject("op_title", "保存价格区间成功");
    mv.addObject(
        "add_url",
        CommUtil.getURL(request) + "/admin/group_price_add.htm" + "?currentPage=" + currentPage);
    return mv;
  }
Exemplo n.º 2
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;
 }
Exemplo n.º 3
0
 /**
  * watermark保存管理
  *
  * @param id
  * @return
  */
 @SecurityMapping(
     title = "图片水印保存",
     value = "/seller/watermark_save.htm*",
     rtype = "seller",
     rname = "图片管理",
     rcode = "album_seller",
     rgroup = "其他设置")
 @RequestMapping("/seller/watermark_save.htm")
 public ModelAndView watermark_save(
     HttpServletRequest request,
     HttpServletResponse response,
     String id,
     String currentPage,
     String cmd) {
   ModelAndView mv = null;
   if (SecurityUserHolder.getCurrentUser().getStore() != null) {
     WebForm wf = new WebForm();
     WaterMark watermark = null;
     if (id.equals("")) {
       watermark = wf.toPo(request, WaterMark.class);
       watermark.setAddTime(new Date());
     } else {
       WaterMark obj = this.watermarkService.getObjById(Long.parseLong(id));
       watermark = (WaterMark) wf.toPo(request, obj);
     }
     watermark.setStore(SecurityUserHolder.getCurrentUser().getStore());
     String path = request.getSession().getServletContext().getRealPath("/") + "upload/wm";
     try {
       Map map = CommUtil.saveFileToServer(request, "wm_img", path, null, null);
       if (!map.get("fileName").equals("")) {
         Accessory wm_image = new Accessory();
         wm_image.setAddTime(new Date());
         wm_image.setHeight(CommUtil.null2Int(map.get("height")));
         wm_image.setName(CommUtil.null2String(map.get("fileName")));
         wm_image.setPath("upload/wm");
         wm_image.setSize(CommUtil.null2Float(map.get("fileSize")));
         wm_image.setUser(SecurityUserHolder.getCurrentUser());
         wm_image.setWidth(CommUtil.null2Int("width"));
         this.accessoryService.save(wm_image);
         watermark.setWm_image(wm_image);
       }
     } catch (IOException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
     }
     if (id.equals("")) {
       this.watermarkService.save(watermark);
     } else this.watermarkService.update(watermark);
     mv =
         new JModelAndView(
             "success.html",
             configService.getSysConfig(),
             this.userConfigService.getUserConfig(),
             1,
             request,
             response);
     mv.addObject("op_title", "水印设置成功");
   } else {
     mv =
         new JModelAndView(
             "error.html",
             configService.getSysConfig(),
             this.userConfigService.getUserConfig(),
             1,
             request,
             response);
     mv.addObject("op_title", "您尚未开店");
   }
   mv.addObject("url", CommUtil.getURL(request) + "/seller/watermark.htm");
   return mv;
 }