Ejemplo n.º 1
0
 /**
  * GroupPriceRange列表页
  *
  * @param currentPage
  * @param orderBy
  * @param orderType
  * @param request
  * @return
  */
 @SecurityMapping(
     title = "团购价格区间列表",
     value = "/admin/group_price_list.htm*",
     rtype = "admin",
     rname = "团购管理",
     rcode = "group_admin",
     rgroup = "运营")
 @RequestMapping("/admin/group_price_list.htm")
 public ModelAndView list(
     HttpServletRequest request,
     HttpServletResponse response,
     String currentPage,
     String orderBy,
     String orderType) {
   ModelAndView mv =
       new JModelAndView(
           "admin/blue/group_price_list.html",
           configService.getSysConfig(),
           this.userConfigService.getUserConfig(),
           0,
           request,
           response);
   String url = this.configService.getSysConfig().getAddress();
   if (url == null || url.equals("")) {
     url = CommUtil.getURL(request);
   }
   String params = "";
   GroupPriceRangeQueryObject qo =
       new GroupPriceRangeQueryObject(currentPage, mv, orderBy, orderType);
   // WebForm wf = new WebForm();
   // wf.toQueryPo(request, qo,GroupPriceRange.class,mv);
   IPageList pList = this.grouppricerangeService.list(qo);
   CommUtil.saveIPageList2ModelAndView(url + "/admin/group_range_list.htm", "", params, pList, mv);
   return mv;
 }
Ejemplo n.º 2
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;
  }
Ejemplo n.º 3
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.º 4
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;
 }
Ejemplo n.º 5
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;
 }