From 399b9f0c8b69766fd4af107a636e847ed80ac3ec Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 23 一月 2019 15:49:05 +0800 Subject: [PATCH] 消息相关Bug修改 --- fanli/src/main/java/com/yeshi/fanli/controller/client/UserInfoController.java | 102 +++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 74 insertions(+), 28 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 d65b2e5..11c56db 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 @@ -209,13 +209,12 @@ @Resource private UserShareGoodsRecordService userShareGoodsRecordService; - + @Resource private UserCustomSettingsService userCustomSettingsService; - + @Resource private UserInfoExtraService userInfoExtraService; - private static final String PASSWORD_MAX_ERROR = "password_max_error"; private static final String EXTRACT_MIN_MONEY = "extract_min_money"; @@ -513,7 +512,7 @@ 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()))) @@ -531,16 +530,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); } @@ -556,9 +555,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() { @@ -568,6 +567,13 @@ uuser.setLastLoginTime(java.lang.System.currentTimeMillis()); userInfoService.updateLoginInfo(uuser); wxDownService.save(device); + // 鏇存柊鐢ㄦ埛闄勫姞淇℃伅锛岃�佺敤鎴蜂笉瀛樺湪鐨勯渶瑕佹坊鍔� + try { + userInfoExtraService.updateUserRankByUid(uuser.getId()); + } catch (UserInfoExtraException e) { + e.printStackTrace(); + } + } }); } @@ -1983,10 +1989,10 @@ e.printStackTrace(); } } - - + /** - * 璁剧疆鐣岄潰寮�鍏崇姸鎬� + * 璁剧疆鐣岄潰寮�鍏崇姸鎬� + * * @param acceptData * @param uid * @param params @@ -1999,22 +2005,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) { @@ -2023,9 +2029,9 @@ } } - /** - * 鑾峰彇绛夌骇淇℃伅 + * 鑾峰彇绛夌骇淇℃伅 + * * @param acceptData * @param uid * @param out @@ -2037,20 +2043,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) { @@ -2059,4 +2063,46 @@ } } + /** + * 鑾峰彇绛夌骇淇℃伅 + * + * @param acceptData + * @param uid + * @param out + */ + @RequestMapping(value = "getUserConfig", method = RequestMethod.POST) + public void getUserConfig(AcceptData acceptData, Long uid, PrintWriter out) { + + if (uid == null) { + out.print(JsonUtil.loadFalseResult("鐢ㄦ埛鏈櫥褰�")); + return; + } + + try { + + String inviteCode = userInfoExtraService.getUserInviteCode(uid); + + JSONObject inviteData = new JSONObject(); + if (inviteCode == null || inviteCode.trim().length() == 0) { + // 鏃犻個璇风爜 + inviteData.put("content", "閭�璇锋縺娲�"); + inviteData.put("link", configService.get("invite_activation_url")); + } else { + // 宸叉湁閭�璇风爜 + 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) { + out.print(JsonUtil.loadFalseResult("鑾峰彇澶辫触")); + e.printStackTrace(); + } + } } -- Gitblit v1.8.0