From 790515f0b126354b82fad95b5b73d7729cd9919d Mon Sep 17 00:00:00 2001
From: yujian <yujian>
Date: 星期日, 05 五月 2019 12:16:33 +0800
Subject: [PATCH] 品牌+奖励券推送提交

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/BrandController.java |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/BrandController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/BrandController.java
index 2ff7f31..e24c7ce 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/BrandController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/BrandController.java
@@ -138,6 +138,15 @@
 	@RequestMapping(value = "getHistory", method = RequestMethod.POST)
 	public void getHistory(AcceptData acceptData, Integer page, Long uid, Integer type, PrintWriter out) {
 		try {
+			if (type == null) {
+				out.print(JsonUtil.loadFalseResult("绫诲瀷涓嶆纭�"));
+				return;
+			}
+
+			if (page == null || page < 1) {
+				page = 1;
+			}
+			
 			int pageSize;
 			if (type == 1) {
 				pageSize = 4;
@@ -187,7 +196,7 @@
 			}
 
 			JSONObject data = new JSONObject();
-			data.put("count", list.size());
+			data.put("count", count);
 			data.put("list", JsonUtil.getApiCommonGson().toJson(list));
 
 			out.print(JsonUtil.loadTrueResult(data));
@@ -226,11 +235,17 @@
 	@RequestMapping(value = "getShopInfo", method = RequestMethod.POST)
 	public void getShopInfo(AcceptData acceptData, Integer page, Long sid, Long uid, PrintWriter out) {
 		try {
+			if (sid == null) {
+				out.print(JsonUtil.loadFalseResult("缂哄け搴楅摵id"));
+				return;
+			}
+			
 			JSONObject data = new JSONObject();
 			if (page == 1) {
 				TaoBaoShop taoBaoShop = taoBaoShopService.selectByPrimaryKey(sid);
 				if (taoBaoShop == null) {
 					out.print(JsonUtil.loadFalseResult("搴楅摵淇℃伅鑾峰彇澶辫触"));
+					return;
 				}
 				String shopLink = taoBaoShop.getShopLink();
 				if (StringUtil.isNullOrEmpty(shopLink)) {
@@ -246,7 +261,7 @@
 				if (!StringUtil.isNullOrEmpty(shopIconCustom)) {
 					taoBaoShop.setShopIcon(shopIconCustom);
 				}
-				data.put("shop", taoBaoShop);
+				data.put("shop", JsonUtil.getApiCommonGson().toJson(taoBaoShop));
 				
 				
 				ThreadUtil.run(new Runnable() {

--
Gitblit v1.8.0