From 98b1a0affd69bbe63223c21fdd2c404e8bedfccb Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 20 五月 2020 17:25:08 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/div' into 2.1.2

---
 fanli/src/main/java/com/yeshi/fanli/controller/admin/BrandShopAdminController.java |   43 ++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 38 insertions(+), 5 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/admin/BrandShopAdminController.java b/fanli/src/main/java/com/yeshi/fanli/controller/admin/BrandShopAdminController.java
index 177b57d..a57f8cc 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/admin/BrandShopAdminController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/admin/BrandShopAdminController.java
@@ -103,7 +103,6 @@
 	@RequestMapping(value = "query")
 	public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer state,
 			PrintWriter out) {
-
 		if (pageIndex == null || pageIndex < 1) {
 			pageIndex = 1;
 		}
@@ -114,7 +113,6 @@
 
 		try {
 			List<BrandClass> list = brandClassService.listQuery((pageIndex - 1) * pageSize, pageSize, key, state);
-
 			if (list == null || list.size() == 0) {
 				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏆傛棤鏁版嵁"));
 				return;
@@ -132,11 +130,28 @@
 			JSONObject data = new JSONObject();
 			data.put("pe", pe);
 			data.put("result_list", gson.toJson(list));
-
 			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
-
 		} catch (Exception e) {
 			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔寮傚父"));
+			e.printStackTrace();
+		}
+	}
+	
+	/**
+	 * 淇敼鐘舵��
+	 * @param callback
+	 * @param id
+	 * @param out
+	 */
+	@RequestMapping(value = "switchStateClass")
+	public void switchStateClass(String callback, Long id, PrintWriter out) {
+		try {
+			brandClassService.switchState(id);
+			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("鎿嶄綔鎴愬姛"));
+		} catch (BrandClassException e) {
+			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
+		} catch (Exception e) {
+			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔澶辫触"));
 			e.printStackTrace();
 		}
 	}
@@ -150,7 +165,6 @@
 	 */
 	@RequestMapping(value = "delete")
 	public void delete(String callback, String idArray, PrintWriter out) {
-
 		try {
 			if (StringUtil.isNullOrEmpty(idArray)) {
 				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("璇烽�夋嫨鎿嶄綔鐨勬暟鎹�"));
@@ -465,6 +479,25 @@
 	
 	
 	/**
+	 * 淇敼鐘舵��
+	 * @param callback
+	 * @param id
+	 * @param out
+	 */
+	@RequestMapping(value = "switchStateBrand")
+	public void switchStateBrand(String callback, Long id, PrintWriter out) {
+		try {
+			brandInfoService.switchState(id);
+			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("鎿嶄綔鎴愬姛"));
+		} catch (BrandInfoException e) {
+			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
+		} catch (Exception e) {
+			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔澶辫触"));
+			e.printStackTrace();
+		}
+	}
+	
+	/**
 	 * 鍒犻櫎
 	 * 
 	 * @param callback

--
Gitblit v1.8.0