yujian
2019-06-20 bf5d1b405c759de3faa42af37b1f10f42823b105
fanli/src/main/java/com/yeshi/fanli/controller/admin/BrandShopAdminController.java
@@ -44,7 +44,6 @@
   @Resource
   private BrandClassShopService brandClassShopService;
   
   /**
    * 保存信息
    * 
@@ -64,8 +63,6 @@
         e.printStackTrace();
      }
   }
   
   /**
    * 修改排序
@@ -87,19 +84,19 @@
      }
   }
   
   /**
    * 查询
    *
    * @param callback
    * @param pageIndex
    * @param pageSize
    * @param key  模糊查询:说明、标识
    * @param key
    *            模糊查询:说明、标识
    * @param out
    */
   @RequestMapping(value = "query")
   public void query(String callback, Integer pageIndex, Integer pageSize, String key,
         Integer state, PrintWriter out) {
   public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer state,
         PrintWriter out) {
      if (pageIndex == null || pageIndex < 1) {
         pageIndex = 1;
@@ -138,9 +135,9 @@
      }
   }
   /**
    * 删除
    *
    * @param callback
    * @param idArray
    * @param out
@@ -154,7 +151,8 @@
            return;
         }
         Gson gson = new Gson();
         List<Long> list = gson.fromJson(idArray, new TypeToken<ArrayList<Long>>() {}.getType());
         List<Long> list = gson.fromJson(idArray, new TypeToken<ArrayList<Long>>() {
         }.getType());
         if (list == null || list.size() == 0) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("未检测到删除的数据"));
@@ -170,6 +168,7 @@
   
   /**
    * 筛选列表
    *
    * @param callback
    * @param out
    */
@@ -201,14 +200,14 @@
      }
   }
   /**
    * 查询
    *
    * @param callback
    * @param pageIndex
    * @param pageSize
    * @param key  模糊查询:说明、标识
    * @param key
    *            模糊查询:说明、标识
    * @param out
    */
   @RequestMapping(value = "queryTaoBaoShop")
@@ -269,7 +268,6 @@
      }
   }
   
   /**
    * 添加店铺入库
    * 
@@ -285,7 +283,8 @@
            return;
         }
         Gson gson = new Gson();
         List<Long> list = gson.fromJson(idArray, new TypeToken<ArrayList<Long>>() {}.getType());
         List<Long> list = gson.fromJson(idArray, new TypeToken<ArrayList<Long>>() {
         }.getType());
         String shopIds = brandClassShopService.saveShopInfo(cid,list);
         if (StringUtil.isNullOrEmpty(shopIds)) {
@@ -301,19 +300,19 @@
      }
   }
   
   /**
    * 查询
    *
    * @param callback
    * @param pageIndex
    * @param pageSize
    * @param key  模糊查询:说明、标识
    * @param key
    *            模糊查询:说明、标识
    * @param out
    */
   @RequestMapping(value = "queryClassShop")
   public void queryClassShop(String callback, Integer pageIndex, Integer pageSize, String key,
         Long cid , Integer state, PrintWriter out) {
   public void queryClassShop(String callback, Integer pageIndex, Integer pageSize, String key, Long cid,
         Integer state, PrintWriter out) {
      if (pageIndex == null || pageIndex < 1) {
         pageIndex = 1;
@@ -324,7 +323,8 @@
      }
      try {
         List<BrandClassShop> list = brandClassShopService.listQuery((pageIndex - 1) * pageSize, pageSize, key, cid, state);
         List<BrandClassShop> list = brandClassShopService.listQuery((pageIndex - 1) * pageSize, pageSize, key, cid,
               state);
         if (list == null || list.size() == 0) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
@@ -352,7 +352,6 @@
      }
   }
   /**
    * 保存信息
    * 
@@ -362,13 +361,13 @@
    */
   @RequestMapping(value = "saveClassShop")
   public void saveClassShop(String callback, Long id, Long cid, String shopName, Integer state, Integer top,
         HttpServletRequest request, PrintWriter out) {
         String key, HttpServletRequest request, PrintWriter out) {
      try {
         if (request instanceof MultipartHttpServletRequest) {
              MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
              brandClassShopService.changeShopInfo(fileRequest.getFile("file"), id, cid, shopName, state, top);
            brandClassShopService.changeShopInfo(fileRequest.getFile("file"), id, cid, shopName, state, top, key);
           }else{
              brandClassShopService.changeShopInfo(null, id, cid, shopName, state, top);
            brandClassShopService.changeShopInfo(null, id, cid, shopName, state, top, key);
           }
         JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
      } catch (BrandClassShopException e) {
@@ -378,7 +377,6 @@
         e.printStackTrace();
      }
   }
   
   /**
    * 修改排序
@@ -400,9 +398,9 @@
      }
   }
   
   /**
    * 删除
    *
    * @param callback
    * @param idArray
    * @param out
@@ -415,7 +413,8 @@
            return;
         }
         Gson gson = new Gson();
         List<Long> list = gson.fromJson(idArray, new TypeToken<ArrayList<Long>>() {}.getType());
         List<Long> list = gson.fromJson(idArray, new TypeToken<ArrayList<Long>>() {
         }.getType());
         if (list == null || list.size() == 0) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("未检测到删除的数据"));