From 07c13064382007999e87abe81efe76c98a47dce8 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 05 六月 2019 11:33:56 +0800
Subject: [PATCH] 修改部分bug

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v1/GoodsClassController.java |   37 ++++++++++++++++++-------------------
 1 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/GoodsClassController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/GoodsClassController.java
index 89e981f..c3c4910 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/GoodsClassController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/GoodsClassController.java
@@ -106,12 +106,11 @@
 
 	@Resource
 	private MonitorService monitorService;
-	
+
 	@Resource
 	private HomeNavbarService homeNavbarService;
 	@Resource
 	private SwiperPictureService swiperPictureService;
-
 
 	@Resource(name = "taskExecutor")
 	private TaskExecutor executor;
@@ -172,32 +171,32 @@
 			if (picList == null) {
 				picList = new ArrayList<SwiperPicture>();
 			}
-			
+
 			List<GoodsSubClass> goodsSubClassList = goodsSubClassService.getSubClassCache(gcid, 1);
 			if (goodsSubClassList == null) {
 				goodsSubClassList = new ArrayList<GoodsSubClass>();
 			}
-			
+
 			boolean changePicture = false;
 			String version = acceptData.getVersion();
 			int tversion = Integer.parseInt(version);
 			String platform = acceptData.getPlatform();
 			if ("android".equalsIgnoreCase(platform) && tversion > 38) {
 				changePicture = true;
-			} else if (tversion > 47){
+			} else if (tversion > 47) {
 				changePicture = true;
 			}
-			
+
 			// 1.5.3鏂扮増鍥剧墖鏇挎崲
 			if (changePicture) {
-				for (GoodsSubClass goodsSubClass: goodsSubClassList) {
+				for (GoodsSubClass goodsSubClass : goodsSubClassList) {
 					String pictureSecond = goodsSubClass.getPictureSecond();
 					if (pictureSecond != null && pictureSecond.trim().length() > 0) {
 						goodsSubClass.setPicture(pictureSecond);
 					}
 				}
 			}
-			
+
 			JSONObject data = new JSONObject();
 			data.put("picList", JsonUtil.getApiCommonGson().toJson(picList));
 			data.put("count", goodsSubClassList.size());
@@ -223,7 +222,7 @@
 							goodsClass.setIosClick(1L);
 						}
 					}
-					
+
 					GoodsClass gc = new GoodsClass();
 					gc.setId(goodsClass.getId());
 					gc.setIosClick(goodsClass.getIosClick());
@@ -242,7 +241,6 @@
 		}
 
 	}
-
 
 	@RequestMapping(value = "getCouponGoods", method = RequestMethod.POST)
 	public void getCouponGoods(AcceptData acceptData, int page, long gcid, PrintWriter out) {
@@ -293,7 +291,8 @@
 	@RequestMapping(value = "getgoods", method = RequestMethod.POST)
 	public void getGoods(AcceptData acceptData, int page, long scid, String filter, String order, String startprice,
 			String endprice, String fastFilter, PrintWriter out) {
-		BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
+		BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
+				acceptData.getPackages());
 		if (system == null) {
 			out.print(JsonUtil.loadFalseResult("绯荤粺涓嶅瓨鍦�"));
 			return;
@@ -401,7 +400,8 @@
 	@RequestMapping(value = "getsecondclassgoods", method = RequestMethod.POST)
 	public void getSecondClassGoods(AcceptData acceptData, int page, long scid, String filter, String order,
 			String startprice, String endprice, String fastFilter, Integer totalSales, PrintWriter out) {
-		BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
+		BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
+				acceptData.getPackages());
 		if (system == null) {
 			out.print(JsonUtil.loadFalseResult("绯荤粺涓嶅瓨鍦�"));
 			return;
@@ -575,7 +575,8 @@
 	@RequestMapping("choiceGoods")
 	public void choiceGoods(AcceptData acceptData, long gcid, int page, PrintWriter out) {
 
-		BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
+		BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
+				acceptData.getPackages());
 		if (system == null) {
 			out.print(JsonUtil.loadFalseResult("绯荤粺涓嶅瓨鍦�"));
 			return;
@@ -666,7 +667,6 @@
 		data.put("result", array);
 		out.print(JsonUtil.loadTrueResult(data));
 
-
 	}
 
 	@RequestMapping("getCouponList")
@@ -749,7 +749,7 @@
 			result = TaoKeApiUtil.searchCouple(goodsClassService.getKeysById(id), null, page, 20);
 
 		List<TaoBaoSearchNav> navList = TaoBaoUtil.getBaseNav();
-		if (result.getNavList() != null)
+		if (result != null && result.getNavList() != null)
 			navList.addAll(result.getNavList());
 
 		if (navList == null)
@@ -800,18 +800,17 @@
 	@RequestMapping(value = { "getcategory" }, method = { org.springframework.web.bind.annotation.RequestMethod.POST })
 	public void getcategory(AcceptData acceptData, PrintWriter out) {
 		try {
-			
+
 			boolean changePicture = false;
 			String version = acceptData.getVersion();
 			int tversion = Integer.parseInt(version);
 			String platform = acceptData.getPlatform();
 			if ("android".equalsIgnoreCase(platform) && tversion > 38) {
 				changePicture = true;
-			} else if (tversion > 47){
+			} else if (tversion > 47) {
 				changePicture = true;
 			}
-			
-			
+
 			List<Map<String, Object>> listCache = goodsClassService.getClassListAllCache(changePicture);
 			if (listCache == null) {
 				listCache = new ArrayList<Map<String, Object>>();

--
Gitblit v1.8.0