From 73a3d86a47d8da711b609cd224c63526f7d00f9b Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 22 七月 2020 12:49:06 +0800
Subject: [PATCH] 比价相关的bug修复

---
 fanli/src/main/java/com/yeshi/fanli/controller/admin/BrandShopAdminController.java |   62 +++++++++++++++----------------
 1 files changed, 30 insertions(+), 32 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 a57f8cc..3389e7e 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
@@ -9,6 +9,8 @@
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 
+import com.yeshi.fanli.entity.SystemEnum;
+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;
@@ -17,19 +19,19 @@
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
 import com.google.gson.reflect.TypeToken;
-import com.yeshi.fanli.dto.taobao.TaoBaoShopInfoDTO;
+import com.yeshi.goods.facade.dto.taobao.TaoBaoShopInfoDTO;
 import com.yeshi.fanli.entity.brand.BrandClass;
 import com.yeshi.fanli.entity.brand.BrandClassShop;
 import com.yeshi.fanli.entity.brand.BrandInfo;
-import com.yeshi.fanli.entity.taobao.TaoBaoShop;
-import com.yeshi.fanli.entity.taobao.TaoBaoShopInfo;
+import com.yeshi.common.entity.taobao.TaoBaoShop;
+import com.yeshi.common.entity.taobao.TaoBaoShopInfo;
 import com.yeshi.fanli.exception.brand.BrandClassException;
 import com.yeshi.fanli.exception.brand.BrandClassShopException;
 import com.yeshi.fanli.exception.brand.BrandInfoException;
 import com.yeshi.fanli.service.inter.brand.BrandClassService;
 import com.yeshi.fanli.service.inter.brand.BrandClassShopService;
 import com.yeshi.fanli.service.inter.brand.BrandInfoService;
-import com.yeshi.fanli.tag.PageEntity;
+import com.yeshi.common.entity.PageEntity;
 import com.yeshi.fanli.util.Constant;
 import com.yeshi.fanli.util.StringUtil;
 import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
@@ -54,13 +56,14 @@
 	 * 淇濆瓨淇℃伅
 	 * 
 	 * @param callback
-	 * @param special
 	 * @param out
 	 */
 	@RequestMapping(value = "save")
-	public void save(String callback, BrandClass brandClass, PrintWriter out) {
+	public void save(AdminAcceptData acceptData, String callback, BrandClass brandClass, PrintWriter out) {
 		try {
-			brandClassService.saveObject(brandClass);
+			List<SystemEnum> systemList=new ArrayList<>();
+			systemList.add(acceptData.getSystem());
+			brandClassService.saveObject(brandClass,systemList);
 			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("淇濆瓨鎴愬姛"));
 		} catch (BrandClassException e) {
 			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
@@ -74,13 +77,12 @@
 	 * 淇敼鎺掑簭
 	 * 
 	 * @param callback
-	 * @param goodsClass
 	 * @param out
 	 */
 	@RequestMapping(value = "updateOrder")
-	public void updateOrder(String callback, Long id, Integer moveType, PrintWriter out) {
+	public void updateOrder(AdminAcceptData acceptData,String callback, Long id, Integer moveType, PrintWriter out) {
 		try {
-			brandClassService.updateOrder(id, moveType);
+			brandClassService.updateOrder(id, moveType,acceptData.getSystem());
 			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("鎿嶄綔鎴愬姛"));
 		} catch (BrandClassException e) {
 			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
@@ -101,7 +103,7 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "query")
-	public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer state,
+	public void query(AdminAcceptData acceptData, String callback, Integer pageIndex, Integer pageSize, String key, Integer state,
 			PrintWriter out) {
 		if (pageIndex == null || pageIndex < 1) {
 			pageIndex = 1;
@@ -112,13 +114,13 @@
 		}
 
 		try {
-			List<BrandClass> list = brandClassService.listQuery((pageIndex - 1) * pageSize, pageSize, key, state);
+			List<BrandClass> list = brandClassService.listQuery((pageIndex - 1) * pageSize, pageSize, key, state,acceptData.getSystem());
 			if (list == null || list.size() == 0) {
 				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏆傛棤鏁版嵁"));
 				return;
 			}
 
-			long count = brandClassService.countQuery(key, state);
+			long count = brandClassService.countQuery(key, state,acceptData.getSystem());
 
 			int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
 			PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
@@ -144,7 +146,7 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "switchStateClass")
-	public void switchStateClass(String callback, Long id, PrintWriter out) {
+	public void switchStateClass(AdminAcceptData acceptData,String callback, Long id, PrintWriter out) {
 		try {
 			brandClassService.switchState(id);
 			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("鎿嶄綔鎴愬姛"));
@@ -164,7 +166,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("璇烽�夋嫨鎿嶄綔鐨勬暟鎹�"));
@@ -193,9 +195,9 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "getOptions")
-	public void getOptions(String callback, PrintWriter out) {
+	public void getOptions(AdminAcceptData acceptData, String callback, PrintWriter out) {
 		try {
-			List<BrandClass> list = brandClassService.listEffective();
+			List<BrandClass> list = brandClassService.listEffective(acceptData.getSystem());
 			if (list == null || list.size() == 0) {
 				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏆傛棤鏁版嵁"));
 				return;
@@ -231,7 +233,7 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "queryTaoBaoShop")
-	public void queryTaoBaoShop(String callback, Integer pageIndex, Integer pageSize, String key, PrintWriter out) {
+	public void queryTaoBaoShop(AdminAcceptData acceptData,String callback, Integer pageIndex, Integer pageSize, String key, PrintWriter out) {
 
 		if (pageIndex == null || pageIndex < 1) {
 			pageIndex = 1;
@@ -292,11 +294,10 @@
 	 * 娣诲姞搴楅摵鍏ュ簱
 	 * 
 	 * @param callback
-	 * @param special
 	 * @param out
 	 */
 	@RequestMapping(value = "saveShopInfo")
-	public void saveShopInfo(String callback, Long cid, String idArray, PrintWriter out) {
+	public void saveShopInfo(AdminAcceptData acceptData,String callback, Long cid, String idArray, PrintWriter out) {
 		try {
 			if (StringUtil.isNullOrEmpty(idArray)) {
 				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("璇烽�夋嫨鎿嶄綔鐨勬暟鎹�"));
@@ -331,7 +332,7 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "queryClassShop")
-	public void queryClassShop(String callback, Integer pageIndex, Integer pageSize, String key, Long cid,
+	public void queryClassShop(AdminAcceptData acceptData,String callback, Integer pageIndex, Integer pageSize, String key, Long cid,
 			Integer state, PrintWriter out) {
 
 		if (pageIndex == null || pageIndex < 1) {
@@ -376,11 +377,10 @@
 	 * 淇濆瓨淇℃伅
 	 * 
 	 * @param callback
-	 * @param special
 	 * @param out
 	 */
 	@RequestMapping(value = "saveClassShop")
-	public void saveClassShop(String callback, Long id, Long cid, String shopName, Integer state, Integer top,
+	public void saveClassShop(AdminAcceptData acceptData,String callback, Long id, Long cid, String shopName, Integer state, Integer top,
 			String key, HttpServletRequest request, PrintWriter out) {
 		try {
 			if (request instanceof MultipartHttpServletRequest) {
@@ -402,11 +402,10 @@
 	 * 淇敼鎺掑簭
 	 * 
 	 * @param callback
-	 * @param goodsClass
 	 * @param out
 	 */
 	@RequestMapping(value = "updateOrderClassShop")
-	public void updateOrderClassShop(String callback, Long id, Integer moveType, PrintWriter out) {
+	public void updateOrderClassShop(AdminAcceptData acceptData,String callback, Long id, Integer moveType, PrintWriter out) {
 		try {
 			brandClassShopService.updateOrder(id, moveType);
 			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("鎿嶄綔鎴愬姛"));
@@ -426,7 +425,7 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "deleteClassShop")
-	public void deleteClassShop(String callback, String idArray, PrintWriter out) {
+	public void deleteClassShop(AdminAcceptData acceptData,String callback, String idArray, PrintWriter out) {
 		try {
 			if (StringUtil.isNullOrEmpty(idArray)) {
 				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("璇烽�夋嫨鎿嶄綔鐨勬暟鎹�"));
@@ -459,7 +458,7 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "saveBrand")
-	public void saveBrand(String callback, BrandInfo brandInfo, HttpServletRequest request, PrintWriter out) {
+	public void saveBrand(AdminAcceptData acceptData,String callback, BrandInfo brandInfo, HttpServletRequest request, PrintWriter out) {
 		try {
 			// 1. 鍏堝垽鏂環ttpRequest 鏄惁鍚湁鏂囦欢绫诲瀷 
 			if (request instanceof MultipartHttpServletRequest) {
@@ -485,7 +484,7 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "switchStateBrand")
-	public void switchStateBrand(String callback, Long id, PrintWriter out) {
+	public void switchStateBrand(AdminAcceptData acceptData,String callback, Long id, PrintWriter out) {
 		try {
 			brandInfoService.switchState(id);
 			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("鎿嶄綔鎴愬姛"));
@@ -505,7 +504,7 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "deleteBrand")
-	public void deleteBrand(String callback, String idArray, PrintWriter out) {
+	public void deleteBrand(AdminAcceptData acceptData,String callback, String idArray, PrintWriter out) {
 		try {
 			if (StringUtil.isNullOrEmpty(idArray)) {
 				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("璇烽�夋嫨鎿嶄綔鐨勬暟鎹�"));
@@ -531,11 +530,10 @@
 	 * 淇敼鎺掑簭
 	 * 
 	 * @param callback
-	 * @param goodsClass
 	 * @param out
 	 */
 	@RequestMapping(value = "updateOrderBrand")
-	public void updateOrderBrand(String callback, Long id, Integer moveType, PrintWriter out) {
+	public void updateOrderBrand(AdminAcceptData acceptData,String callback, Long id, Integer moveType, PrintWriter out) {
 		try {
 			brandInfoService.updateOrder(id, moveType);
 			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("鎿嶄綔鎴愬姛"));
@@ -558,7 +556,7 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "queryBrand")
-	public void queryBrand(String callback, Integer pageIndex, Integer pageSize, String key, Long cid, Integer state,
+	public void queryBrand(AdminAcceptData acceptData,String callback, Integer pageIndex, Integer pageSize, String key, Long cid, Integer state,
 			Integer showState, PrintWriter out) {
 
 		if (pageIndex == null || pageIndex < 1) {

--
Gitblit v1.8.0