예제 #1
0
 @SecurityMapping(title = "直通车申请保存", value = "/seller/ztc_apply_save.htm*", rtype = "seller", rname = "竞价直通车", rcode = "ztc_seller", rgroup = "促销管理")
 @RequestMapping({ "/seller/ztc_apply_save.htm" })
 public ModelAndView ztc_apply_save(HttpServletRequest request, HttpServletResponse response, String goods_id,
         String ztc_price, String ztc_begin_time, String ztc_gold, String ztc_session) {
     ModelAndView mv = new JModelAndView("user/default/usercenter/success.html", this.configService.getSysConfig(),
             this.userConfigService.getUserConfig(), 0, request, response);
     if (!(this.configService.getSysConfig().isZtc_status())) {
         mv = new JModelAndView("error.html", this.configService.getSysConfig(),
                 this.userConfigService.getUserConfig(), 1, request, response);
         mv.addObject("op_title", "系统未开启直通车");
         mv.addObject("url", CommUtil.getURL(request) + "/seller/index.htm");
     } else {
         String ztc_session1 = CommUtil.null2String(request.getSession(false).getAttribute("ztc_session"));
         if ((!(ztc_session1.equals(""))) && (ztc_session1.equals(CommUtil.null2String(ztc_session)))) {
             request.getSession(false).removeAttribute("ztc_session");
             Goods goods = this.goodsService.getObjById(CommUtil.null2Long(goods_id));
             goods.setZtc_status(1);
             goods.setZtc_pay_status(1);
             goods.setZtc_begin_time(CommUtil.formatDate(ztc_begin_time));
             goods.setZtc_gold(CommUtil.null2Int(ztc_gold));
             goods.setZtc_price(CommUtil.null2Int(ztc_price));
             goods.setZtc_apply_time(new Date());
             this.goodsService.update(goods);
             mv.addObject("op_title", "直通车申请成功,等待审核");
             mv.addObject("url", CommUtil.getURL(request) + "/seller/ztc_list.htm");
         } else {
             mv = new JModelAndView("error.html", this.configService.getSysConfig(),
                     this.userConfigService.getUserConfig(), 1, request, response);
             mv.addObject("op_title", "不允许重复提交申请");
             mv.addObject("url", CommUtil.getURL(request) + "/seller/ztc_apply.htm");
         }
     }
     return mv;
 }
 public int query_bargain_audit(Object bargain_time) {
     Map params = new HashMap();
     params.put("bg_time", CommUtil.formatDate(CommUtil.null2String(bargain_time), "yyyy-MM-dd"));
     params.put("bg_status", Integer.valueOf(1));
     List bargainGoods = this.bargainGoodsService.query(
             "select obj from BargainGoods obj where obj.bg_time =:bg_time and obj.bg_status=:bg_status", params,
             -1, -1);
     return bargainGoods.size();
 }
 public int query_bargain_maximum(Object bargain_time) {
     Map params = new HashMap();
     params.put("bt", CommUtil.formatDate(CommUtil.null2String(bargain_time), "yyyy-MM-dd"));
     List bargain = this.bargainServicve.query("select obj from Bargain obj where obj.bargain_time =:bt", params, 0,
             1);
     int bd = 0;
     if (bargain.size() > 0)
         bd = ((Bargain) bargain.get(0)).getMaximum();
     else {
         bd = this.configService.getSysConfig().getBargain_maximum();
     }
     return bd;
 }