From 1b1f8fb628c08fc757139a34e2293db8d2529092 Mon Sep 17 00:00:00 2001
From: yujian <yujian>
Date: 星期四, 24 一月 2019 10:13:40 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/UserInfoController.java |   87 ++++++++++++++++++++++---------------------
 1 files changed, 45 insertions(+), 42 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/UserInfoController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/UserInfoController.java
index 4c658b8..b5f3d47 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/UserInfoController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/UserInfoController.java
@@ -211,16 +211,15 @@
 
 	@Resource
 	private UserShareGoodsRecordService userShareGoodsRecordService;
-	
+
 	@Resource
 	private UserCustomSettingsService userCustomSettingsService;
-	
+
 	@Resource
 	private UserInfoExtraService userInfoExtraService;
-	
+
 	@Resource
 	private AppVersionService appVersionService;
-	
 
 	private static final String PASSWORD_MAX_ERROR = "password_max_error";
 	private static final String EXTRACT_MIN_MONEY = "extract_min_money";
@@ -510,9 +509,8 @@
 		BigDecimal fanliHB = user.getTotalHongBao();
 		user.setTotalHongBao(fanliHB);
 
-		
 		UserInfo filterForClientUser = UserUtil.filterForClientUser(user);
-		
+
 		// 1.5.0 鐗堟湰涔嬪悗杩斿洖鏂扮殑绛夌骇
 		String version = acceptData.getVersion();
 		if (version != null && version.trim().length() > 0) {
@@ -533,16 +531,16 @@
 				}
 			}
 		}
-		
+
 		GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
 
 		JSONObject data = new JSONObject();
-		data.put("user", JsonUtil.getConvertBigDecimalToStringBuilder(gsonBuilder).create()
-				.toJson(filterForClientUser));
+		data.put("user",
+				JsonUtil.getConvertBigDecimalToStringBuilder(gsonBuilder).create().toJson(filterForClientUser));
 		data.put("first", 0);
 		int spreadImgCount = spreadUserImgService.countUserSpreadImg(user.getId());
 		long shareCount = userShareGoodsRecordService.countShareRecordByUid(user.getId());
-		
+
 		int showTiCheng = 1; // 涓嶆樉绀�
 		if ("ios".equalsIgnoreCase(acceptData.getPlatform())
 				&& configService.iosOnLining(Integer.parseInt(acceptData.getVersion())))
@@ -560,16 +558,16 @@
 					Constant.systemCommonConfig.getProjectHost(), Constant.systemCommonConfig.getProjectName()));
 		else
 			data.put("inviteList", configService.get("team_list"));
-	
+
 		// 鐣岄潰鐘舵��
-		UserSettingsVO mySettings = null; 
+		UserSettingsVO mySettings = null;
 		try {
 			mySettings = userCustomSettingsService.getMySettings(user.getId());
 		} catch (UserCustomSettingsException e) {
 			mySettings = new UserSettingsVO();
 			e.printStackTrace();
 		}
-		
+
 		if (mySettings.getCancelNotice() == null) {
 			mySettings.setCancelNotice(0);
 		}
@@ -585,9 +583,9 @@
 		if (mySettings.getNoInvitationBonus() == null) {
 			mySettings.setNoInvitationBonus(0);
 		}
-		
+
 		data.put("moduleState", mySettings);
-		
+
 		out.print(JsonUtil.loadTrueResult(data));
 		final UserInfo uuser = user;
 		ThreadUtil.run(new Runnable() {
@@ -597,6 +595,13 @@
 				uuser.setLastLoginTime(java.lang.System.currentTimeMillis());
 				userInfoService.updateLoginInfo(uuser);
 				wxDownService.save(device);
+				// 鏇存柊鐢ㄦ埛闄勫姞淇℃伅锛岃�佺敤鎴蜂笉瀛樺湪鐨勯渶瑕佹坊鍔�
+				try {
+					userInfoExtraService.updateUserRankByUid(uuser.getId());
+				} catch (UserInfoExtraException e) {
+					e.printStackTrace();
+				}
+
 			}
 		});
 	}
@@ -2012,10 +2017,10 @@
 			e.printStackTrace();
 		}
 	}
-	
-	
+
 	/**
-	 *  璁剧疆鐣岄潰寮�鍏崇姸鎬�
+	 * 璁剧疆鐣岄潰寮�鍏崇姸鎬�
+	 * 
 	 * @param acceptData
 	 * @param uid
 	 * @param params
@@ -2028,22 +2033,22 @@
 			out.print(JsonUtil.loadFalseResult("鐢ㄦ埛鏈櫥褰�"));
 			return;
 		}
-		
+
 		try {
 			if (params == null || params.trim().length() == 0) {
 				out.print(JsonUtil.loadFalseResult("浼犻�掑弬鏁颁负绌�"));
 				return;
 			}
-			
+
 			JSONObject json = JSONObject.fromObject(params);
-	        Iterator<String> iterator = json.keys();
-			while(iterator.hasNext()){
-		         String type = (String) iterator.next();
-		         int state = json.getInt(type);
-		         userCustomSettingsService.saveModuleState(uid, type, state);
+			Iterator<String> iterator = json.keys();
+			while (iterator.hasNext()) {
+				String type = (String) iterator.next();
+				int state = json.getInt(type);
+				userCustomSettingsService.saveModuleState(uid, type, state);
 			}
 			out.print(JsonUtil.loadTrueResult("璁剧疆鎴愬姛"));
-			
+
 		} catch (UserCustomSettingsException e) {
 			out.print(JsonUtil.loadFalseResult(e.getMsg()));
 		} catch (Exception e) {
@@ -2052,9 +2057,9 @@
 		}
 	}
 
-	
 	/**
-	 *  鑾峰彇绛夌骇淇℃伅
+	 * 鑾峰彇绛夌骇淇℃伅
+	 * 
 	 * @param acceptData
 	 * @param uid
 	 * @param out
@@ -2066,20 +2071,18 @@
 			out.print(JsonUtil.loadFalseResult("鐢ㄦ埛鏈櫥褰�"));
 			return;
 		}
-		
+
 		try {
-			
 			UserInfoExtraVO rankInfo = userInfoExtraService.getRankInfo(uid);
-			
 			GsonBuilder gsonBuilder = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder());
 			gsonBuilder.excludeFieldsWithoutExposeAnnotation();
 			Gson gson = gsonBuilder.setDateFormat("yyyy.MM.dd").create();
-			
+
 			JSONObject resultData = new JSONObject();
 			resultData.put("rankInfo", gson.toJson(rankInfo));
-			
+
 			out.print(JsonUtil.loadTrueResult(resultData));
-			
+
 		} catch (UserInfoExtraException e) {
 			out.print(JsonUtil.loadFalseResult(e.getMsg()));
 		} catch (Exception e) {
@@ -2088,9 +2091,9 @@
 		}
 	}
 
-	
 	/**
-	 *  鑾峰彇绛夌骇淇℃伅
+	 * 鑾峰彇绛夌骇淇℃伅
+	 * 
 	 * @param acceptData
 	 * @param uid
 	 * @param out
@@ -2102,11 +2105,11 @@
 			out.print(JsonUtil.loadFalseResult("鐢ㄦ埛鏈櫥褰�"));
 			return;
 		}
-		
+
 		try {
-			
+
 			String inviteCode = userInfoExtraService.getUserInviteCode(uid);
-			
+
 			JSONObject inviteData = new JSONObject();
 			if (inviteCode == null || inviteCode.trim().length() == 0) {
 				// 鏃犻個璇风爜
@@ -2117,12 +2120,12 @@
 				inviteData.put("content", "閭�璇风爜");
 				inviteData.put("link", configService.get("invite_activation_success_url"));
 			}
-			
+
 			JSONObject data = new JSONObject();
 			data.put("invite", inviteData);
-			
+
 			out.print(JsonUtil.loadTrueResult(data));
-			
+
 		} catch (UserInfoExtraException e) {
 			out.print(JsonUtil.loadFalseResult(e.getMsg()));
 		} catch (Exception e) {

--
Gitblit v1.8.0