From f32cc15f60bf3b5c47267ee256a0deb3bdd01eec Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期四, 23 四月 2020 14:09:50 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/div' into div --- fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java | 138 ++++++--------------------------------------- 1 files changed, 20 insertions(+), 118 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java index f93cd6f..adb31bd 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java @@ -13,7 +13,6 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; -import org.yeshi.utils.DateUtil; import org.yeshi.utils.JsonUtil; import com.yeshi.fanli.dto.vip.UserVIPLevel; @@ -25,7 +24,6 @@ import com.yeshi.fanli.entity.bus.user.ThreeSaleExtraInfo; import com.yeshi.fanli.entity.bus.user.UserInfo; import com.yeshi.fanli.entity.bus.user.UserInfoExtra; -import com.yeshi.fanli.entity.bus.user.UserInviteSeparate; import com.yeshi.fanli.entity.bus.user.UserInviteValidNum; import com.yeshi.fanli.entity.bus.user.UserInviteValidRecord; import com.yeshi.fanli.entity.bus.user.WeiXinUser; @@ -44,7 +42,6 @@ import com.yeshi.fanli.service.inter.user.SpreadUserImgService; import com.yeshi.fanli.service.inter.user.UserInfoExtraService; import com.yeshi.fanli.service.inter.user.UserInfoService; -import com.yeshi.fanli.service.inter.user.UserInviteSeparateService; import com.yeshi.fanli.service.inter.user.invite.ThreeSaleExtraInfoSerivce; import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce; import com.yeshi.fanli.service.inter.user.invite.UserInviteService; @@ -55,7 +52,6 @@ import com.yeshi.fanli.util.RedisKeyEnum; import com.yeshi.fanli.util.RedisManager; import com.yeshi.fanli.util.StringUtil; -import com.yeshi.fanli.util.TimeUtil; import com.yeshi.fanli.util.VersionUtil; import com.yeshi.fanli.util.annotation.RequestSerializableByKey; import com.yeshi.fanli.util.user.UserLevelUtil; @@ -94,9 +90,6 @@ @Resource private UserVIPInfoService userVIPInfoService; - - @Resource - private UserInviteSeparateService userInviteSeparateService; @Resource private SpreadImgService spreadImgService; @@ -227,11 +220,11 @@ long count = 0; List<ThreeSale> listTeam = null; if (type == 1) { - listTeam = threeSaleSerivce.listFirstTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid, 1); - count = threeSaleSerivce.countFirstTeam(uid, 1); + listTeam = threeSaleSerivce.listFirstTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid); + count = threeSaleSerivce.countFirstTeam(uid); } else if (type == 2) { - listTeam = threeSaleSerivce.listSecondTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid, 1); - count = threeSaleSerivce.countSecondTeam(uid, 1); + listTeam = threeSaleSerivce.listSecondTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid); + count = threeSaleSerivce.countSecondTeam(uid); } boolean needVIPInfo = false; @@ -299,32 +292,6 @@ // 娣诲姞鏄惁涓篤IP if (vipMap != null && vipMap.get(worker.getId()) != null) { object.put("vip", vipMap.get(worker.getId())); - if (vipMap.get(worker.getId())) { - UserInviteSeparate separate = userInviteSeparateService.selectByWorkerIdAndBossId(worker.getId(), uid); - if (separate != null && separate.getEndTime() != null) { - try { - JSONObject contentJson1 = new JSONObject(); - contentJson1.put("color", "#888888"); - contentJson1.put("content", "灏嗕簬"); - - JSONObject contentJson2 = new JSONObject(); - contentJson2.put("color", "#F14242"); - contentJson2.put("content", DateUtil.dateDiff4(new Date(), separate.getEndTime())); - - JSONObject contentJson3 = new JSONObject(); - contentJson3.put("color", "#888888"); - contentJson3.put("content", "鍚庤劚绂婚個璇峰叧绯�"); - - JSONArray array = new JSONArray(); - array.add(contentJson1); - array.add(contentJson2); - array.add(contentJson3); - object.put("vipBreakTime",array); - } catch (Exception e) { - e.printStackTrace(); - } - } - } } String fontColor1 = "#888888"; JSONArray array = new JSONArray(); @@ -392,13 +359,13 @@ long count = 0; List<ThreeSale> listTeam = null; if (type == 1) { - listTeam = threeSaleSerivce.listFirstTeamByUndeleted((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid); - count = threeSaleSerivce.countFirstTeamByUndeleted(uid); + listTeam = threeSaleSerivce.listFirstTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid); + count = threeSaleSerivce.countFirstTeam(uid); } else if (type == 2) { - listTeam = threeSaleSerivce.listSecondTeamByUndeleted((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid); - count = threeSaleSerivce.countSecondTeamByUndeleted(uid); + listTeam = threeSaleSerivce.listSecondTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid); + count = threeSaleSerivce.countSecondTeam(uid); } - + JSONObject result = new JSONObject(); result.put("count", count); result.put("list", organizeTeamNew(count, listTeam, uid, type, true)); @@ -447,22 +414,13 @@ if (type == 1) { validType = UserInviteValidRecord.TYPE_ONE; } + List<Long> listVid = userInviteValidRecordService.getValidWorkerIdsByUid(uid, listWid, validType); for (ThreeSale threeSale : list) { UserInfo worker = threeSale.getWorker(); Long workerId = worker.getId(); - // 閭�璇风姸鎬� - Boolean state = threeSale.getState(); - if (type == 2) { - if (state && threeSale.getStateSuper()) { - state = true; - } else { - state = false; - } - } - // 閭�璇锋垚鍔熸椂闂� Long succeedTime = threeSale.getSucceedTime(); if (succeedTime == null) { @@ -471,7 +429,7 @@ // 鏈夋晥绮変笣 boolean validFans = false; - if (state && listVid != null && listVid.size() > 0 && listVid.contains(workerId)) { + if (listVid != null && listVid.size() > 0 && listVid.contains(workerId)) { validFans = true; } @@ -509,54 +467,11 @@ object.put("portrait", worker.getPortrait()); object.put("inviteId", threeSale.getId()); object.put("inviteTime", format.format(new Date(succeedTime)) + " 鍔犲叆"); - object.put("state", state? 1 : 2); + object.put("state", 1); object.put("recentMsg", array); object.put("level", level.name()); object.put("validFans", validFans); - - // 鍒ゆ柇鏄惁瀛樺湪鑴辩鍏崇郴闃熷憳 - if (vipLevel != null && state) { - Long bossId = threeSale.getBoss().getId(); - UserInviteSeparate separate = userInviteSeparateService.selectByWorkerIdAndBossId(workerId, bossId); - if (separate != null && separate.getEndTime() != null) { - try { - JSONObject contentJson1 = new JSONObject(); - contentJson1.put("color", "#888888"); - contentJson1.put("content", "灏嗕簬"); - - String dateDiff = DateUtil.dateDiff4(new Date(), separate.getEndTime()); - JSONObject contentJson2 = new JSONObject(); - contentJson2.put("color", "#F14242"); - contentJson2.put("content", dateDiff); - - JSONObject contentJson3 = new JSONObject(); - contentJson3.put("color", "#888888"); - contentJson3.put("content", "鍚庤劚绂婚個璇峰叧绯�"); - - JSONArray vipBreak = new JSONArray(); - vipBreak.add(contentJson1); - vipBreak.add(contentJson2); - vipBreak.add(contentJson3); - object.put("vipBreakTime",vipBreak); - - List<String> tips = new ArrayList<String>(); - tips.add("浜�"+ TimeUtil.formatDateDot(vipLevel.getSuccessTime()) + "鍗囩骇涓�" + level.getName()); - if (type == 1) { - tips.add("浣犻渶瑕佸湪"+ dateDiff +"鍐呭崌绾т负浼氬憳锛屽惁鍒欐寜鐓ч個璇疯鍒橳A灏嗕笌浣犺劚绂婚個璇峰叧绯汇��"); - tips.add("璧跺揩鍔犳补鍗囩骇涓轰細鍛樺惂锛�"); - } else { - tips.add("浣犻渶瑕佽緟鍔㏕A鐨勯個璇蜂汉"+ threeSale.getBoss().getNickName()+ "鍦�"+dateDiff+"鍐呭崌绾т负浼氬憳锛屽惁鍒欒繖浣嶉棿鎺ョ矇涓�" +worker.getNickName()+"灏嗕笌浣犺劚绂婚個璇峰叧绯汇��"); - tips.add("璧跺揩甯姪TA鍗囩骇涓轰細鍛樺惂锛�"); - } - object.put("vipBreakTip",tips); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - - if (wxtip && type == 1 && threeSale.getState() != null && threeSale.getState()) { // 涓�绾ч槦鍛� 鏌ヨ鏄电О澶囨敞 String memoName = null; @@ -583,7 +498,6 @@ } } } - resultArray.add(object); } return resultArray; @@ -605,8 +519,8 @@ return; } - List<ThreeSale> listTeam = threeSaleSerivce.listFirstTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, tid, 1); - long count = threeSaleSerivce.countFirstTeam(tid, 1); + List<ThreeSale> listTeam = threeSaleSerivce.listFirstTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, tid); + long count = threeSaleSerivce.countFirstTeam(tid); JSONObject result = new JSONObject(); result.put("count", count); @@ -627,13 +541,14 @@ JSONObject bossData = getBossInfo(uid, threeSaleSerivce.getMyBoss(uid)); JSONObject resultData = new JSONObject(); - long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1); + long firstTeam = threeSaleSerivce.countFirstTeam(uid); + long countSecond = threeSaleSerivce.countSecondTeam(uid); resultData.put("boss", bossData); - resultData.put("helpLink", configService.get(ConfigKeyEnum.teamHelpUrl.getKey())); resultData.put("firstTeam", firstTeam); - resultData.put("firstTeamTotal", threeSaleSerivce.countFirstTeam(uid, null)); - resultData.put("secondTeam", threeSaleSerivce.countSecondTeam(uid, 1)); - resultData.put("secondTeamTotal", threeSaleSerivce.countSecondTeam(uid, null)); + resultData.put("firstTeamTotal", firstTeam); + resultData.put("secondTeam", countSecond); + resultData.put("secondTeamTotal", countSecond); + resultData.put("helpLink", configService.get(ConfigKeyEnum.teamHelpUrl.getKey())); boolean hasTeam = true; if (firstTeam <= 0) { @@ -906,19 +821,6 @@ data.put("num", doneFirst); data.put("limit", Constant.INVITE_CODRE_TAILOR_LIMIT); JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); - } - - - - @RequestMapping(value = "remvoeBreak") - public void remvoeBreak(String callback, AcceptData acceptData,Long inviteId, Long uid, Long tid, PrintWriter out) { - if (uid == null || inviteId == null || tid == null) { - JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("浼犺緭鍙傛暟涓嶅畬鏁�")); - return; - } - threeSaleSerivce.remvoeBreak(inviteId, uid, tid); - - JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("鎿嶄綔鎴愬姛")); } } -- Gitblit v1.8.0