@SecurityMapping(title = "直通车商品加载", value = "/seller/ztc_goods.htm*", rtype = "seller", rname = "竞价直通车", rcode = "ztc_seller", rgroup = "促销管理")
 @RequestMapping({ "/seller/ztc_goods.htm" })
 public void ztc_goods(HttpServletRequest request, HttpServletResponse response, String goods_name) {
     Map params = new HashMap();
     params.put("goods_name", "%" + goods_name.trim() + "%");
     params.put("goods_status", Integer.valueOf(0));
     params.put("user_id", SecurityUserHolder.getCurrentUser().getId());
     params.put("ztc_status", Integer.valueOf(0));
     List<Goods> goods_list = this.goodsService
             .query("select obj from Goods obj where obj.goods_name like :goods_name and obj.goods_store.user.id=:user_id and obj.ztc_status=:ztc_status and obj.goods_status=:goods_status  order by obj.addTime desc",
                     params, -1, -1);
     List maps = new ArrayList();
     for (Goods goods : goods_list) {
         Map map = new HashMap();
         map.put("goods_name", goods.getGoods_name());
         map.put("goods_id", goods.getId());
         maps.add(map);
     }
     response.setContentType("text/plain");
     response.setHeader("Cache-Control", "no-cache");
     response.setCharacterEncoding("UTF-8");
     try {
         PrintWriter writer = response.getWriter();
         writer.print(Json.toJson(maps, JsonFormat.compact()));
     } catch (IOException e) {
         e.printStackTrace();
     }
 }
 @RequestMapping("/add_goods_favorite.htm")
 @Transactional
 public void add_goods_favorite(HttpServletResponse response, String id) {
   Map params = new HashMap();
   params.put("user_id", SecurityUserHolder.getCurrentUser().getId());
   params.put("goods_id", CommUtil.null2Long(id));
   List<Favorite> list =
       this.favoriteService.query(
           "select obj from Favorite obj where obj.user.id=:user_id and obj.goods.id=:goods_id",
           params,
           -1,
           -1);
   int ret = 0;
   if (list.size() == 0) {
     Goods goods = this.goodsService.getObjById(CommUtil.null2Long(id));
     Favorite obj = new Favorite();
     obj.setAddTime(new Date());
     obj.setType(0);
     obj.setUser(SecurityUserHolder.getCurrentUser());
     obj.setGoods(goods);
     this.favoriteService.save(obj);
     goods.setGoods_collect(goods.getGoods_collect() + 1);
     this.goodsService.update(goods);
     // 更新lucene索引
     elasticsearchUtil.indexUpdate(
         IndexName.GOODS,
         IndexType.GOODS,
         goods.getId().toString(),
         IndexVoTools.goodsToIndexVo(goods));
     //			String goods_lucene_path = ConfigContants.LUCENE_DIRECTORY
     //					+ File.separator
     //					+ "luence" + File.separator + "goods";
     //			File file = new File(goods_lucene_path);
     //			if (!file.exists()) {
     //				CommUtil.createFolder(goods_lucene_path);
     //			}
     //			LuceneUtil lucene = LuceneUtil.instance();
     //			lucene.setIndex_path(goods_lucene_path);
     //			lucene.update(CommUtil.null2String(goods.getId()),
     //					luceneVoTools.updateGoodsIndex(goods));
   } else {
     ret = 1;
   }
   response.setContentType("text/plain");
   response.setHeader("Cache-Control", "no-cache");
   response.setCharacterEncoding("UTF-8");
   PrintWriter writer;
   try {
     writer = response.getWriter();
     writer.print(ret);
   } catch (IOException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
   }
 }
 @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;
 }
    @SecurityMapping(title = "直通车申请查看", value = "/seller/ztc_apply_view.htm*", rtype = "seller", rname = "竞价直通车", rcode = "ztc_seller", rgroup = "促销管理")
    @RequestMapping({ "/seller/ztc_apply_view.htm" })
    public ModelAndView ztc_apply_view(HttpServletRequest request, HttpServletResponse response, String id) {
        ModelAndView mv = new JModelAndView("user/default/usercenter/ztc_apply_view.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 {
            Goods obj = this.goodsService.getObjById(CommUtil.null2Long(id));

            if (obj.getGoods_store().getUser().getId().equals(SecurityUserHolder.getCurrentUser().getId())) {
                mv.addObject("obj", obj);
            } 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_list.htm");
            }
        }
        return mv;
    }