From fe646416d8d46de7b896ddbf65a3ad0cd30b729b Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 15 七月 2020 16:05:56 +0800
Subject: [PATCH] 大淘客与好单库与主包剥离

---
 fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/HomeNavbarAdminController.java |   42 ++++++++++++++++++++++++++----------------
 1 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/HomeNavbarAdminController.java b/fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/HomeNavbarAdminController.java
index 6efcb76..e4815cc 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/HomeNavbarAdminController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/HomeNavbarAdminController.java
@@ -7,6 +7,7 @@
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 
+import com.yeshi.fanli.entity.accept.AdminAcceptData;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.multipart.MultipartHttpServletRequest;
@@ -36,11 +37,10 @@
 	 * 淇濆瓨淇℃伅
 	 * 
 	 * @param callback
-	 * @param special
 	 * @param out
 	 */
 	@RequestMapping(value = "save")
-	public void save(String callback, HomeNavbar homeNavbar, HttpServletRequest request, PrintWriter out) {
+	public void save(AdminAcceptData acceptData,String callback, HomeNavbar homeNavbar, HttpServletRequest request, PrintWriter out) {
 		try {
 			// 1. 鍏堝垽鏂環ttpRequest 鏄惁鍚湁鏂囦欢绫诲瀷 
 			if (request instanceof MultipartHttpServletRequest) {
@@ -65,11 +65,10 @@
 	 * 淇敼鎺掑簭
 	 * 
 	 * @param callback
-	 * @param goodsClass
 	 * @param out
 	 */
 	@RequestMapping(value = "updateOrder")
-	public void updateOrder(String callback, Long id, Integer moveType, Integer sex, PrintWriter out) {
+	public void updateOrder(AdminAcceptData acceptData,String callback, Long id, Integer moveType, Integer sex, PrintWriter out) {
 		try {
 			homeNavbarService.updateOrder(id, moveType, sex);
 			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("鎿嶄綔鎴愬姛"));
@@ -92,8 +91,7 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "query")
-	public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer sex, PrintWriter out) {
-
+	public void query(AdminAcceptData acceptData, String callback, Integer pageIndex, Integer pageSize, String key, Integer sex, PrintWriter out) {
 		if (pageIndex == null || pageIndex < 1) {
 			pageIndex = 1;
 		}
@@ -103,15 +101,13 @@
 		}
 
 		try {
-			List<HomeNavbar> list = homeNavbarService.listQuery((pageIndex - 1) * pageSize, pageSize, key, sex);
-
+			List<HomeNavbar> list = homeNavbarService.listQuery((pageIndex - 1) * pageSize, pageSize, key, sex,acceptData.getSystem());
 			if (list == null || list.size() == 0) {
 				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏆傛棤鏁版嵁"));
 				return;
 			}
 			
-			long count = homeNavbarService.countlistQuery(key, sex);
-			
+			long count = homeNavbarService.countlistQuery(key, sex,acceptData.getSystem());
 			int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
 			PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
 
@@ -124,12 +120,10 @@
 			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();
 		}
-
 	}
 
 
@@ -140,8 +134,7 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "delete")
-	public void delete(String callback, String idArray, PrintWriter out) {
-
+	public void delete(AdminAcceptData acceptData,String callback, String idArray, PrintWriter out) {
 		try {
 			if (StringUtil.isNullOrEmpty(idArray)) {
 				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("璇烽�夋嫨鎿嶄綔鐨勬暟鎹�"));
@@ -157,12 +150,29 @@
 			}
 			
 			int count = homeNavbarService.deleteBatchByPrimaryKey(list);
-			
 			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("鎴愬姛鍒犻櫎["+ count +"]鏉℃暟鎹�"));
-
 		} catch (Exception e) {
 			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鍒犻櫎澶辫触"));
 			e.printStackTrace();
 		}
 	}
+	
+	/**
+	 * 淇敼鐘舵��
+	 * @param callback
+	 * @param id
+	 * @param out
+	 */
+	@RequestMapping(value = "switchState")
+	public void switchState(AdminAcceptData acceptData,String callback, Long id, PrintWriter out) {
+		try {
+			homeNavbarService.switchState(id);
+			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("鎿嶄綔鎴愬姛"));
+		} catch (HomeNavbarException e) {
+			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
+		} catch (Exception e) {
+			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔澶辫触"));
+			e.printStackTrace();
+		}
+	}
 }

--
Gitblit v1.8.0