Пример #1
0
 @OperationLog("获取在线店铺")
 @RequestMapping("/np/findOnlineShop")
 @ResponseBody
 public JsonResult findOnlineShop() {
   List<Shop> shopList = shopService.findOnlineShop();
   return new JsonResult(true).addList(shopList);
 }
Пример #2
0
  /**
   * 店铺一览
   *
   * @param shop
   */
  @OperationLog("根据条件查询店铺")
  @RequestMapping("/shop/list")
  @ResponseBody
  public JsonResult listShop(Shop shop, HttpServletRequest request)
      throws IOException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
    if (log.isInfoEnabled()) {
      log.info("店铺:查询店铺一览," + shop);
    }
    Page page = PageFactory.getPage(request);
    // 查询店铺一览
    shopService.findShop(page, shop);

    Shop dbShop = null;
    ShopVo shopVo = null;
    List<ShopVo> shopVoList = new ArrayList<ShopVo>();
    for (Object object : page.getResult()) {
      dbShop = (Shop) object;
      shopVo = convertShopAndAuth2ShopVo(dbShop);
      if (shopVo != null) {
        shopVoList.add(shopVo);
      }
    }

    page.setResult(shopVoList);

    return new JsonResult(true).addObject(page);
  }
Пример #3
0
 /**
  * 根据条件查询店铺信息、店铺授权信息
  *
  * @param shopBean
  * @return
  */
 @Transactional(readOnly = true)
 public List<ShopBean> findShopBean(ShopBean shopBean) {
   Shop shopQuery = new Shop();
   shopQuery.setPlatformType(shopBean.getPlatformType());
   shopQuery.setId(shopBean.getShopId());
   // 查询所有店铺及授权信息
   List<Shop> shopList = shopService.getShopAndAuth(shopQuery);
   return convertShopList2ShopBeanList(shopList);
 }
Пример #4
0
 /**
  * 动态获取评分
  *
  * @param id
  */
 @OperationLog("动态获取评分")
 @RequestMapping("/shop/dynamicGetScore")
 @ResponseBody
 public JsonResult dynamicGetScore(Integer id) throws Exception {
   if (log.isInfoEnabled()) {
     log.info("店铺:动态获取评分,id = " + id);
   }
   // 动态获取评分
   ShopVo shopVo = shopService.dynamicGetScore(id);
   return new JsonResult(true).addObject(shopVo);
 }
Пример #5
0
 /**
  * 店铺删除
  *
  * @param id
  * @param response
  */
 @OperationLog("店铺逻辑删除")
 @RequestMapping("/shop/delete")
 @ResponseBody
 public JsonResult deleteShop(Integer id, HttpServletResponse response) throws IOException {
   if (log.isInfoEnabled()) {
     log.info("店铺:删除店铺,id = " + id);
   }
   // 删除店铺
   shopService.deleteShopForLogic(id);
   BusinessLogUtil.bindBusinessLog("店铺ID:%d", id);
   return new JsonResult(true, "删除成功!");
 }
Пример #6
0
 /**
  * 店铺明细
  *
  * @param id
  */
 @OperationLog("根据店铺id查询店铺明细")
 @RequestMapping("/shop/detail")
 @ResponseBody
 public JsonResult detailShop(Integer id, HttpServletRequest request)
     throws IOException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
   if (log.isInfoEnabled()) {
     log.info("店铺:查询店铺明细,id = " + id);
   }
   // 查询店铺明细
   ShopVo shopVo = shopService.getShopVo(id);
   return new JsonResult(true).addObject(shopVo);
 }
Пример #7
0
 /**
  * 店铺更新
  *
  * @param shop
  * @param sessionKey
  */
 @OperationLog("店铺更新")
 @RequestMapping("/shop/update")
 @ResponseBody
 public JsonResult updateShop(@ModelAttribute("id") Shop shop, String sessionKey)
     throws Exception {
   if (log.isInfoEnabled()) {
     log.info("店铺:更新店铺," + shop);
   }
   // 更新店铺
   shopService.updateShop(shop, sessionKey);
   BusinessLogUtil.bindBusinessLog(
       "店铺详情:名称[%s],描述[%s],卖家昵称[%s],session Key[%s]",
       shop.getTitle(), shop.getDescription(), shop.getNick(), sessionKey);
   return new JsonResult(true, "更新成功!");
 }
Пример #8
0
 /**
  * 查询店铺信息、店铺授权信息
  *
  * @return
  */
 @Transactional(readOnly = true)
 public List<ShopBean> findOnlineShopBean() {
   // 查询所有店铺及授权信息
   List<Shop> shopList = shopService.getOnlineShopAndAuth(null);
   return convertShopList2ShopBeanList(shopList);
 }