From b59fef5c00b15fdfdfa9d4be26e5bf6b41c75458 Mon Sep 17 00:00:00 2001
From: admin <2780501319@qq.com>
Date: 星期日, 23 二月 2020 00:16:52 +0800
Subject: [PATCH] 2.0.7相关服务端功能添加

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java |   99 +++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 86 insertions(+), 13 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 02decb8..87cbb54 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
@@ -18,6 +18,8 @@
 import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
 import com.yeshi.fanli.entity.bus.msg.MsgDeviceReadState;
 import com.yeshi.fanli.entity.bus.user.UserActiveLog;
+import com.yeshi.fanli.entity.bus.user.UserInfo;
+import com.yeshi.fanli.entity.common.JumpDetailV2;
 import com.yeshi.fanli.entity.config.AppHomeFloatImg;
 import com.yeshi.fanli.entity.system.ConfigKeyEnum;
 import com.yeshi.fanli.entity.taobao.ClientTBPid;
@@ -31,10 +33,14 @@
 import com.yeshi.fanli.service.inter.user.TBPidService;
 import com.yeshi.fanli.service.inter.user.UserActiveLogService;
 import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
+import com.yeshi.fanli.service.inter.user.UserInfoService;
+import com.yeshi.fanli.service.inter.user.notify.UserActivedRecordService;
 import com.yeshi.fanli.util.Constant;
 import com.yeshi.fanli.util.StringUtil;
 import com.yeshi.fanli.util.ThreadUtil;
 import com.yeshi.fanli.util.VersionUtil;
+import com.yeshi.fanli.vo.user.UserDialogBtnVO;
+import com.yeshi.fanli.vo.user.UserDialogVO;
 
 import net.sf.json.JSONObject;
 
@@ -74,10 +80,15 @@
 
 	@Resource
 	private UserActiveLogService userActiveLogService;
-	
+
 	@Resource
 	private SwiperPictureService swiperPictureService;
 
+	@Resource
+	private UserActivedRecordService userActivedRecordService;
+
+	@Resource
+	private UserInfoService userInfoService;
 
 	/**
 	 * s 棣栭〉閰嶇疆淇℃伅
@@ -104,7 +115,6 @@
 		if (!StringUtil.isNullOrEmpty(notifyImg)) {
 			data.put("floatNotifyImg", notifyImg);
 		}
-
 
 		// 鏃犳柊浜哄脊妗� 鍒欐煡璇㈤粯璁�
 		FloatAD floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX, 0);
@@ -138,8 +148,8 @@
 		} else {// 鑰佷汉
 			data.put("userTimeType", 1);
 		}
-		data.put("hotFuctionLink",
-				configService.getByVersion(ConfigKeyEnum.hotFunctionUrl.getKey(), platform, Integer.parseInt(acceptData.getVersion())));//
+		data.put("hotFuctionLink", configService.getByVersion(ConfigKeyEnum.hotFunctionUrl.getKey(), platform,
+				Integer.parseInt(acceptData.getVersion())));//
 		out.print(JsonUtil.loadTrueResult(data));
 	}
 
@@ -163,7 +173,8 @@
 		}
 
 		// 鏄惁闇�瑕佽喘鐗╁煄杞摼
-		boolean convert = "0".equalsIgnoreCase(configService.get(ConfigKeyEnum.showTaobaoCartConvert.getKey())) ? false : true;
+		boolean convert = "0".equalsIgnoreCase(configService.get(ConfigKeyEnum.showTaobaoCartConvert.getKey())) ? false
+				: true;
 
 		if (!"cart".equalsIgnoreCase(position) && !convert) {
 			out.print(JsonUtil.loadFalseResult(""));
@@ -238,8 +249,37 @@
 		out.print(JsonUtil.loadTrueResult(data));
 	}
 
+	/**
+	 * 鍏抽棴鎻愰啋
+	 * 
+	 * @param acceptData
+	 * @param uid
+	 * @param id
+	 * @param type
+	 *            0-鍏抽棴 1-鐐瑰嚮鍙宠竟鎸夐挳 2-鐐瑰嚮宸﹁竟鎸夐挳
+	 * @param out
+	 */
+	@RequestMapping(value = "closeDialogNotify", method = RequestMethod.POST)
+	public void closeDialogNotify(AcceptData acceptData, Long uid, String id, int type, PrintWriter out) {
+
+		if (uid == null) {
+			out.print(JsonUtil.loadFalseResult("鐢ㄦ埛鏈櫥褰�"));
+			return;
+		}
+		if (StringUtil.isNullOrEmpty(id)) {
+			out.print(JsonUtil.loadFalseResult("id涓虹┖"));
+			return;
+		}
+		if (id.equalsIgnoreCase("tearcherNotify")) {
+			userActivedRecordService.setTearcherNotified(uid);
+			out.print(JsonUtil.loadTrueResult(""));
+		} else {
+			out.print(JsonUtil.loadFalseResult("id涓嶅瓨鍦�"));
+		}
+	}
+
 	@RequestMapping(value = "getUserConfig", method = RequestMethod.POST)
-	public void getUserConfig(AcceptData acceptData, PrintWriter out) {
+	public void getUserConfig(AcceptData acceptData, Long uid, PrintWriter out) {
 		try {
 			// 鐢ㄦ埛鍗忚閾炬帴
 			String serviceProtocol = configService.get(ConfigKeyEnum.serviceProtocolLink.getKey());
@@ -249,22 +289,54 @@
 			data.put("serviceProtocolLink", serviceProtocol);
 			data.put("privacyProtocolLink", privacyProtocol);
 			// 璐墿杞﹁烦杞柟寮�(鍖呭惈jumpDetail涓巔arams)
-			JSONObject source = JSONObject.fromObject(configService.getByVersion(ConfigKeyEnum.taobaoCartJumpDetail.getKey(),
-					acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion())));
+			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()));
+				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));
-			} 
-			
+			}
+
 			if (VersionUtil.greaterThan_2_0_7(acceptData.getPlatform(), acceptData.getVersion())) {
 				// 杞摼鐨勭綉椤甸摼鎺�
 				String convertLinkUrl = configService.get(ConfigKeyEnum.convertDocWebLink.getKey());
 				data.put("convertLinkUrl", convertLinkUrl);
+				if (uid != null) {
+
+					String tearcherLink = configService.getByVersion(ConfigKeyEnum.tearcherLink.getKey(),
+							acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
+					if (userActivedRecordService.canNotifyAddTearcher(uid)) {
+						UserInfo userInfo = userInfoService.selectAvailableByPrimaryKey(uid);
+						if (userInfo != null) {
+							JumpDetailV2 jumpDetail = jumpDetailV2Service.getByTypeCache("web",
+									Constant.getPlatformCode(acceptData.getPlatform()),
+									Integer.parseInt(acceptData.getVersion()));
+
+							JSONObject negativeParams = new JSONObject();
+							negativeParams.put("url", configService.getByVersion(ConfigKeyEnum.newerGonglue.getKey(),
+									acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion())));
+
+							JSONObject positiveParams = new JSONObject();
+							positiveParams.put("url", tearcherLink);
+
+							UserDialogVO dialog = new UserDialogVO("tearcherNotify", true,
+									"HI," + userInfo.getNickName(),
+									"鎴戞槸浣犵殑瀵煎笀锛屼负浣犲湪鐪佽禋杩囩▼涓В闅剧瓟鐤戯紝瀵逛綘涓�瀵逛竴杈呭锛屽�惧惉浣犵殑闇�姹傛�荤粨骞跺弽棣堢粰鏉挎牀蹇渷瀹樻柟杩愯惀鍥㈤槦锛屽揩鏉ユ坊鍔犳垜鍚с��",
+									new UserDialogBtnVO("澶嶅埗瀵煎笀寰俊", jumpDetail, positiveParams),
+									new UserDialogBtnVO("鍘绘柊鎵嬫敾鐣�", jumpDetail, negativeParams));
+							data.put("dialog", dialog);
+						}
+					}
+
+					data.put("tearcherLink", tearcherLink);
+				}
+
 			}
 			out.print(JsonUtil.loadTrueResult(data));
 		} catch (Exception e) {
@@ -312,7 +384,8 @@
 	public void getOrderConfig(AcceptData acceptData, PrintWriter out) {
 		JSONObject data = new JSONObject();
 		// 娴嬭瘯
-		data.put("showTaoBaoOrder", "0".equalsIgnoreCase(configService.get(ConfigKeyEnum.showTaobaoOrder.getKey()).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));
 	}

--
Gitblit v1.8.0