From 744594ef1a2f530fc3e86ea9dc48b62247f79420 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 19 五月 2020 17:13:23 +0800
Subject: [PATCH] 饿了么绘图,添加口碑

---
 fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/RecommendController.java |   64 +++++++++++++++++---------------
 1 files changed, 34 insertions(+), 30 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/RecommendController.java b/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/RecommendController.java
index a6a2245..7c382de 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/RecommendController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/RecommendController.java
@@ -19,10 +19,9 @@
 import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
 import com.yeshi.fanli.dto.pdd.PDDGoodsResult;
 import com.yeshi.fanli.entity.accept.AcceptData;
-import com.yeshi.fanli.entity.bus.homemodule.Special;
-import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
 import com.yeshi.fanli.entity.common.JumpDetailV2;
 import com.yeshi.fanli.entity.jd.JDGoods;
+import com.yeshi.fanli.entity.system.ConfigKeyEnum;
 import com.yeshi.fanli.log.LogHelper;
 import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
 import com.yeshi.fanli.service.inter.config.ConfigService;
@@ -36,6 +35,7 @@
 import com.yeshi.fanli.service.inter.lable.QualityFlashSaleService;
 import com.yeshi.fanli.service.inter.lable.QualityGoodsService;
 import com.yeshi.fanli.service.inter.monitor.MonitorService;
+import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
 import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
 import com.yeshi.fanli.service.inter.pdd.PDDGoodsService;
 import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
@@ -48,6 +48,8 @@
 import com.yeshi.fanli.util.StringUtil;
 import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
 import com.yeshi.fanli.vo.goods.GoodsDetailVO;
+import com.yeshi.fanli.vo.homemodule.BannerVO;
+import com.yeshi.fanli.vo.homemodule.SpecialVO;
 
 import net.sf.json.JSONArray;
 import net.sf.json.JSONObject;
@@ -58,6 +60,9 @@
 
 	@Resource
 	private HongBaoManageService hongBaoManageService;
+	
+	@Resource
+	private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
 
 	@Resource
 	private QualityGoodsService qualityGoodsService;
@@ -124,54 +129,50 @@
 			int version = Integer.parseInt(acceptData.getVersion());
 
 			// 杞挱鍥�
-			List<SwiperPicture> picList = swiperPictureService.getByBannerCardAndVersion("index_top", platform,
+			List<BannerVO> picList = swiperPictureService.getByBannerCardAndVersion("index_top", platform,
 					version);
 			if (picList == null) {
 				picList = new ArrayList<>();
 			}
 
-			for (SwiperPicture swiper : picList) {
-				JSONObject params = null;
-				if (StringUtil.isNullOrEmpty(swiper.getParams())) {
-					params = JSONObject.fromObject(swiper.getParams());
-				}
+			for (BannerVO swiper : picList) {
+//				JSONObject params = null;
+//				if (StringUtil.isNullOrEmpty(swiper.getParams())) {
+//					params = JSONObject.fromObject(swiper.getParams());
+//				}
 				swiper.setJumpDetail(JumpDetailUtil.getWXMPJumDetail(swiper.getJumpDetail()));
-				swiper.setParams(null);
 			}
 
 			// 鍦嗗舰涓撻
-			List<Special> specials = specialService.listByVersion(0, 10, "index_arc_1.6.5", platform, version);
+			List<SpecialVO> specials = specialService.listByVersion(0, 10, "index_arc_1.6.5", platform, version);
 			if (specials == null)
 				specials = new ArrayList<>();
 
-			for (Special special : specials) {
+			for (SpecialVO special : specials) {
 				JumpDetailV2 jumpDetail = special.getJumpDetail();
 				if (special.isJumpLogin() && jumpDetail != null) {
 					jumpDetail.setNeedLogin(true);
 				}
 				
-				JSONObject params = null;
-				if (StringUtil.isNullOrEmpty(special.getParams())) {
-					params = JSONObject.fromObject(special.getParams());
-				}
-				
+//				JSONObject params = null;
+//				if (StringUtil.isNullOrEmpty(special.getParams())) {
+//					params = JSONObject.fromObject(special.getParams());
+//				}
 				special.setJumpDetail(JumpDetailUtil.getWXMPJumDetail(jumpDetail));
-				special.setParams(null);
 			}
 
 			// 娲诲姩
-			List<SwiperPicture> activitys = swiperPictureService.getByBannerCardAndVersion("index_invite", platform,
+			List<BannerVO> activitys = swiperPictureService.getByBannerCardAndVersion("index_invite", platform,
 					version);
 			if (activitys == null)
 				activitys = new ArrayList<>();
 
-			for (SwiperPicture swiper : activitys) {
-				JSONObject params = null;
-				if (StringUtil.isNullOrEmpty(swiper.getParams())) {
-					params = JSONObject.fromObject(swiper.getParams());
-				}
+			for (BannerVO swiper : activitys) {
+//				JSONObject params = null;
+//				if (StringUtil.isNullOrEmpty(swiper.getParams())) {
+//					params = JSONObject.fromObject(swiper.getParams());
+//				}
 				swiper.setJumpDetail(JumpDetailUtil.getWXMPJumDetail(swiper.getJumpDetail()));
-				swiper.setParams(null);
 			}
 
 			JSONObject data = new JSONObject();
@@ -220,6 +221,7 @@
 			JSONObject data = new JSONObject();
 			data.put("list", new JSONArray());
 			data.put("count", 0);
+			data.put("page", page);
 			out.print(JsonUtil.loadTrueResult(data));
 		}
 	}
@@ -245,7 +247,7 @@
 
 			List<JDGoods> goodsList = result.getGoodsList();
 			if (goodsList != null && goodsList.size() > 0) {
-				ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
+				ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
 						acceptData.getVersion());
 
 				Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
@@ -259,6 +261,7 @@
 
 		data.put("list", array);
 		data.put("count", count);
+		data.put("page", page);
 		out.print(JsonUtil.loadTrueResult(data));
 	}
 
@@ -278,7 +281,7 @@
 			Gson gson = JsonUtil.getApiCommonGson();
 			List<PDDGoodsDetail> goodsList = result.getGoodsList();
 			if (goodsList != null && goodsList.size() > 0) {
-				ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
+				ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
 						acceptData.getVersion());
 
 				for (PDDGoodsDetail goods : goodsList) {
@@ -291,6 +294,7 @@
 		JSONObject data = new JSONObject();
 		data.put("list", array);
 		data.put("count", count);
+		data.put("page", page);
 		out.print(JsonUtil.loadTrueResult(data));
 	}
 
@@ -307,7 +311,7 @@
 	public void getGuide(AcceptData acceptData, Long uid, PrintWriter out) {
 		String tips = null;
 		if (uid == null || uid <= 0) {
-			tips = configService.get("tip_guide_new_user");
+			tips = configService.get(ConfigKeyEnum.tipGuideNewUser.getKey());
 		} else {
 			long rebateOrder = hongBaoV2CountService.countRebateOrder(uid);
 			long shareOrInviteOrder = hongBaoV2CountService.countShareOrInviteOrder(uid);
@@ -315,13 +319,13 @@
 				// 鐔熷鐗�
 			} else if (rebateOrder <= 0 && shareOrInviteOrder <= 0) {
 				// 鏂颁汉鐗�
-				tips = configService.get("tip_guide_new_user");
+				tips = configService.get(ConfigKeyEnum.tipGuideNewUser.getKey());
 			} else if (rebateOrder > 0 && shareOrInviteOrder <= 0) {
 				// 鐪侀挶鐗�
-				tips = configService.get("tip_guide_save_money");
+				tips = configService.get(ConfigKeyEnum.tipGuideSaveMoney.getKey());
 			} else {
 				// 璧氶挶鐗�
-				tips = configService.get("tip_guide_share_invite");
+				tips = configService.get(ConfigKeyEnum.tipGuideShareInvite.getKey());
 			}
 		}
 

--
Gitblit v1.8.0