From f4a0f2acc63d7785eab108419a4e16f5f688cb95 Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期六, 18 一月 2020 12:06:27 +0800
Subject: [PATCH] 用户注册信息

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java |  102 +++++++++++++++++++-------------------------------
 1 files changed, 39 insertions(+), 63 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java
index 54a979e..a63d386 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java
@@ -1,6 +1,8 @@
 package com.yeshi.fanli.controller.client.v1;
 
 import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.List;
 
 import javax.annotation.Resource;
 
@@ -12,19 +14,19 @@
 
 import com.yeshi.fanli.entity.accept.AcceptData;
 import com.yeshi.fanli.entity.bus.homemodule.FloatAD;
+import com.yeshi.fanli.entity.bus.homemodule.FloatAD.FloatADTypeEnum;
+import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
 import com.yeshi.fanli.entity.bus.msg.MsgDeviceReadState;
-import com.yeshi.fanli.entity.bus.tlj.DeviceTaoLiJinRecord;
-import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin;
-import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin.TaoLiJinOriginEnum;
 import com.yeshi.fanli.entity.bus.user.UserActiveLog;
 import com.yeshi.fanli.entity.config.AppHomeFloatImg;
+import com.yeshi.fanli.entity.system.ConfigKeyEnum;
 import com.yeshi.fanli.entity.taobao.ClientTBPid;
 import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
 import com.yeshi.fanli.service.inter.config.ConfigService;
 import com.yeshi.fanli.service.inter.homemodule.FloatADService;
+import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
 import com.yeshi.fanli.service.inter.msg.MsgDeviceReadStateService;
 import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
-import com.yeshi.fanli.service.inter.tlj.DeviceTaoLiJinRecordService;
 import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
 import com.yeshi.fanli.service.inter.user.TBPidService;
 import com.yeshi.fanli.service.inter.user.UserActiveLogService;
@@ -71,10 +73,11 @@
 	private UserTaoLiJinOriginService uerTaoLiJinOriginService;
 
 	@Resource
-	private DeviceTaoLiJinRecordService deviceTaoLiJinRecordService;
-
-	@Resource
 	private UserActiveLogService userActiveLogService;
+	
+	@Resource
+	private SwiperPictureService swiperPictureService;
+
 
 	/**
 	 * s 棣栭〉閰嶇疆淇℃伅
@@ -102,29 +105,10 @@
 			data.put("floatNotifyImg", notifyImg);
 		}
 
-		FloatAD floatAD = null;
-
-		if (VersionUtil.greaterThan_1_5_60(acceptData.getPlatform(), acceptData.getVersion())) {
-			if (uid == null) {
-				DeviceTaoLiJinRecord deviceRecord = deviceTaoLiJinRecordService.getByDevice(acceptData.getDevice());
-				if (deviceRecord == null) {
-					floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX, 1);
-				}
-			} else {
-				UserTaoLiJinOrigin userTaoLiJin = uerTaoLiJinOriginService.getByUidAndOrigin(uid,
-						TaoLiJinOriginEnum.newbiesWin.name());
-				if (userTaoLiJin == null) {
-					floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX, 1);
-				}
-			}
-		}
 
 		// 鏃犳柊浜哄脊妗� 鍒欐煡璇㈤粯璁�
-		if (floatAD == null) {
-			floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX, 0);
-		}
-
-		if (floatAD != null) {
+		FloatAD floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX, 0);
+		if (floatAD != null && floatAD.getTypeEnum() != FloatADTypeEnum.newUserRedPack) {
 			JSONObject detail = new JSONObject();
 			detail.put("img", floatAD.getPicture());
 			detail.put("jumpDetail", floatAD.getJumpDetail());
@@ -135,13 +119,13 @@
 		}
 
 		// 棰嗗埜甯姪閾炬帴,1.5.2鍚庣敓鏁�
-		String couponHelp = configService.get("taobao_coupon_help");
+		String couponHelp = configService.get(ConfigKeyEnum.taobaoCouponHelp.getKey());
 		data.put("couponHelpUrl", couponHelp);
 
 		// 搴曢儴缃戦〉閾炬帴
 		String platform = acceptData.getPlatform();
 		if ("android".equalsIgnoreCase(platform)) {
-			data.put("htmlLink", configService.get("index_html_link_android"));
+			data.put("htmlLink", configService.get(ConfigKeyEnum.indexHtmlLinkAndroid.getKey()));
 		}
 
 		// 鍒ゆ柇鏂拌�佺敤鎴�
@@ -154,7 +138,8 @@
 		} else {// 鑰佷汉
 			data.put("userTimeType", 1);
 		}
-		data.put("hotFuctionLink", configService.get("hot_function_url"));
+		data.put("hotFuctionLink",
+				configService.getByVersion(ConfigKeyEnum.hotFunctionUrl.getKey(), platform, Integer.parseInt(acceptData.getVersion())));//
 		out.print(JsonUtil.loadTrueResult(data));
 	}
 
@@ -167,25 +152,7 @@
 	 */
 	@RequestMapping(value = "getMSGConfig", method = RequestMethod.POST)
 	public void getMSGConfig(AcceptData acceptData, Long uid, PrintWriter out) {
-		JSONObject data = new JSONObject();
-		boolean show = false;
-		if (uid != null) {
-			show = uerTaoLiJinOriginService.hasRankHongBao(uid);
-		}
-
-		if (show) {
-			FloatAD floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_MSGCENTER, null);
-			if (floatAD != null) {
-				JSONObject detail = new JSONObject();
-				detail.put("img", floatAD.getPicture());
-				detail.put("jumpDetail", floatAD.getJumpDetail());
-				detail.put("params", floatAD.getParams());
-				detail.put("showTime", floatAD.getShowMode());
-				detail.put("accountLogin", floatAD.isJumpNeedLogin());
-				data.put("floatImgDetail", detail);
-			}
-		}
-		out.print(JsonUtil.loadTrueResult(data));
+		out.print(JsonUtil.loadFalseResult("鎺ㄥ箍绾㈠寘鐩稿叧鍔熻兘宸蹭笅绾匡紒"));
 	}
 
 	@RequestMapping(value = "getTaoBaoCartConfig", method = RequestMethod.POST)
@@ -196,7 +163,7 @@
 		}
 
 		// 鏄惁闇�瑕佽喘鐗╁煄杞摼
-		boolean convert = "0".equalsIgnoreCase(configService.get("show_taobao_cart_convert")) ? false : true;
+		boolean convert = "0".equalsIgnoreCase(configService.get(ConfigKeyEnum.showTaobaoCartConvert.getKey())) ? false : true;
 
 		if (!"cart".equalsIgnoreCase(position) && !convert) {
 			out.print(JsonUtil.loadFalseResult(""));
@@ -210,8 +177,8 @@
 			clientTBPid = tbPidService.getAndroidDefault();
 		}
 
-		String cartJS = configService.get("taobao_cart_js");
-		String cartUrl = configService.get("taobao_cart_link");
+		String cartJS = configService.get(ConfigKeyEnum.taobaoCartJS.getKey());
+		String cartUrl = configService.get(ConfigKeyEnum.taobaoCartLink.getKey());
 		if (!convert)// 涓嶈浆閾�
 		{
 			cartUrl = "http://";
@@ -263,8 +230,8 @@
 
 	@RequestMapping(value = "getBindAccountConfig", method = RequestMethod.POST)
 	public void getBindAccountConfig(AcceptData acceptData, PrintWriter out) {
-		String alipayHelpUrl = configService.get("alipay_help");// 鏀粯瀹濆府鍔�
-		String alipayBindFailUrl = configService.get("alipay_bind_fail_reason");// 鏀粯瀹濈粦瀹氬け璐ュ師鍥�
+		String alipayHelpUrl = configService.get(ConfigKeyEnum.alipayHelp.getKey());// 鏀粯瀹濆府鍔�
+		String alipayBindFailUrl = configService.get(ConfigKeyEnum.alipayBindFailReason.getKey());// 鏀粯瀹濈粦瀹氬け璐ュ師鍥�
 		JSONObject data = new JSONObject();
 		data.put("alipayHelp", alipayHelpUrl);
 		data.put("alipayBindFailReason", alipayBindFailUrl);
@@ -275,15 +242,24 @@
 	public void getUserConfig(AcceptData acceptData, PrintWriter out) {
 		try {
 			// 鐢ㄦ埛鍗忚閾炬帴
-			String serviceProtocol = configService.get("service_protocol_link");
+			String serviceProtocol = configService.get(ConfigKeyEnum.serviceProtocolLink.getKey());
 			// 闅愮鏉℃閾炬帴
-			String privacyProtocol = configService.get("privacy_protocol_link");
+			String privacyProtocol = configService.get(ConfigKeyEnum.privacyProtocolLink.getKey());
 			JSONObject data = new JSONObject();
 			data.put("serviceProtocolLink", serviceProtocol);
 			data.put("privacyProtocolLink", privacyProtocol);
 			// 璐墿杞﹁烦杞柟寮�(鍖呭惈jumpDetail涓巔arams)
-			JSONObject source = JSONObject.fromObject(configService.get("taobao_cart_jump_detail"));
+			JSONObject source = JSONObject.fromObject(configService.getByVersion(ConfigKeyEnum.taobaoCartJumpDetail.getKey(),
+					acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion())));
 			data.put("taoBaoCart", source);
+			
+			if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) {
+				// 鎴戠殑鐣岄潰banner
+				List<SwiperPicture> banner = swiperPictureService.getByBannerCardAndVersion("my_interface_banner",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
+				if (banner == null)
+					banner = new ArrayList<SwiperPicture>();
+				data.put("banner", JsonUtil.getApiCommonGson().toJson(banner));
+			} 
 			out.print(JsonUtil.loadTrueResult(data));
 		} catch (Exception e) {
 			out.print(JsonUtil.loadFalseResult("鑾峰彇澶辫触"));
@@ -301,10 +277,10 @@
 	@RequestMapping(value = "getOrderParseConfig", method = RequestMethod.POST)
 	public void getOrderParseConfig(AcceptData acceptData, PrintWriter out) {
 
-		if ("0".equalsIgnoreCase(configService.get("auto_find_taobao_order")))
+		if ("0".equalsIgnoreCase(configService.get(ConfigKeyEnum.autoFindTaobaoOrder.getKey())))
 			out.print(JsonUtil.loadFalseResult(1, "鏆備笉鏀寔"));
 		else {
-			String orderJS = configService.get("taobao_order_parse_js");
+			String orderJS = configService.get(ConfigKeyEnum.taobaoOrderParseJS.getKey());
 			JSONObject data = new JSONObject();
 			try {
 				data.put("orderJS", DESUtil.encode(orderJS, StringUtil.getBase64String("YeShiFANLI889*+"),
@@ -330,7 +306,7 @@
 	public void getOrderConfig(AcceptData acceptData, PrintWriter out) {
 		JSONObject data = new JSONObject();
 		// 娴嬭瘯
-		data.put("showTaoBaoOrder", "0".equalsIgnoreCase(configService.get("show_taobao_order").trim()) ? false : true);
+		data.put("showTaoBaoOrder", "0".equalsIgnoreCase(configService.get(ConfigKeyEnum.showTaobaoOrder.getKey()).trim()) ? false : true);
 		data.put("taoBaoOrderUrl", "https://main.m.taobao.com/olist/index.html");
 		out.print(JsonUtil.loadTrueResult(data));
 	}
@@ -338,7 +314,7 @@
 	@RequestMapping(value = "getKeFuConfig", method = RequestMethod.POST)
 	public void getKeFuConfig(AcceptData acceptData, PrintWriter out) {
 		JSONObject data = new JSONObject();
-		data.put("meiqia", "1".equalsIgnoreCase(configService.get("kefu_meiqia")) ? true : false);// 鏄惁璺宠浆缇庢唇锛屼笉璺宠浆缇庢唇灏辩敤鍘熸潵鐨�
+		data.put("meiqia", "1".equalsIgnoreCase(configService.get(ConfigKeyEnum.kefuMeiqia.getKey())) ? true : false);// 鏄惁璺宠浆缇庢唇锛屼笉璺宠浆缇庢唇灏辩敤鍘熸潵鐨�
 		out.print(JsonUtil.loadTrueResult(data));
 		// 璁剧疆娑堟伅宸茶
 		ThreadUtil.run(new Runnable() {
@@ -359,7 +335,7 @@
 	@RequestMapping(value = "getInviteCodeInputHelp", method = RequestMethod.POST)
 	public void getInviteCodeInputHelp(AcceptData acceptData, PrintWriter out) {
 		JSONObject data = new JSONObject();
-		data.put("helpUrl", configService.get("invite_code_input_help"));
+		data.put("helpUrl", configService.get(ConfigKeyEnum.inviteCodeInputHelp.getKey()));
 		out.print(JsonUtil.loadTrueResult(data));
 	}
 

--
Gitblit v1.8.0