From 0b57cfd62e842b309d03467b96a331c673ecad7c Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 21 四月 2020 14:08:18 +0800 Subject: [PATCH] 删除普通会员等级 --- fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 113 insertions(+), 2 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 87cbb54..6411059 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 @@ -2,6 +2,7 @@ import java.io.PrintWriter; import java.util.ArrayList; +import java.util.Date; import java.util.List; import javax.annotation.Resource; @@ -17,8 +18,13 @@ 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.user.ThreeSale; import com.yeshi.fanli.entity.bus.user.UserActiveLog; import com.yeshi.fanli.entity.bus.user.UserInfo; +import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum; +import com.yeshi.fanli.entity.bus.user.vip.UserLevelUpgradedNotify; +import com.yeshi.fanli.entity.bus.user.vip.UserVIPInfo; +import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo; import com.yeshi.fanli.entity.common.JumpDetailV2; import com.yeshi.fanli.entity.config.AppHomeFloatImg; import com.yeshi.fanli.entity.system.ConfigKeyEnum; @@ -34,13 +40,20 @@ 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.invite.ThreeSaleSerivce; import com.yeshi.fanli.service.inter.user.notify.UserActivedRecordService; +import com.yeshi.fanli.service.inter.user.vip.UserLevelUpgradedNotifyService; +import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService; +import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService; +import com.yeshi.fanli.service.inter.user.vip.UserVipConfigService; import com.yeshi.fanli.util.Constant; import com.yeshi.fanli.util.StringUtil; import com.yeshi.fanli.util.ThreadUtil; +import com.yeshi.fanli.util.TimeUtil; import com.yeshi.fanli.util.VersionUtil; import com.yeshi.fanli.vo.user.UserDialogBtnVO; import com.yeshi.fanli.vo.user.UserDialogVO; +import com.yeshi.fanli.vo.user.VIPUpgradedNotifyVO; import net.sf.json.JSONObject; @@ -89,6 +102,23 @@ @Resource private UserInfoService userInfoService; + + + @Resource + private UserVIPInfoService userVIPInfoService; + + @Resource + private UserVIPPreInfoService userVIPPreInfoService; + + @Resource + private UserLevelUpgradedNotifyService userLevelUpgradedNotifyService; + + @Resource + private ThreeSaleSerivce threeSaleSerivce; + + @Resource + private UserVipConfigService userVipConfigService; + /** * s 棣栭〉閰嶇疆淇℃伅 @@ -260,7 +290,8 @@ * @param out */ @RequestMapping(value = "closeDialogNotify", method = RequestMethod.POST) - public void closeDialogNotify(AcceptData acceptData, Long uid, String id, int type, PrintWriter out) { + public void closeDialogNotify(AcceptData acceptData, Long uid, String id, String sourceId, int type, + PrintWriter out) { if (uid == null) { out.print(JsonUtil.loadFalseResult("鐢ㄦ埛鏈櫥褰�")); @@ -272,6 +303,9 @@ } if (id.equalsIgnoreCase("tearcherNotify")) { userActivedRecordService.setTearcherNotified(uid); + out.print(JsonUtil.loadTrueResult("")); + } else if (id.equalsIgnoreCase("vipUpgradedNotify")) { + userLevelUpgradedNotifyService.setNotified(sourceId); out.print(JsonUtil.loadTrueResult("")); } else { out.print(JsonUtil.loadFalseResult("id涓嶅瓨鍦�")); @@ -311,7 +345,7 @@ String tearcherLink = configService.getByVersion(ConfigKeyEnum.tearcherLink.getKey(), acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion())); - if (userActivedRecordService.canNotifyAddTearcher(uid)) { + if (userActivedRecordService.canNotifyAddTearcher(uid) && !StringUtil.isNullOrEmpty(tearcherLink)) { UserInfo userInfo = userInfoService.selectAvailableByPrimaryKey(uid); if (userInfo != null) { JumpDetailV2 jumpDetail = jumpDetailV2Service.getByTypeCache("web", @@ -336,14 +370,91 @@ data.put("tearcherLink", tearcherLink); } + } + + + if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) { + // TODO 楠岃瘉鏄惁鏄甯� + + JSONObject inner = new JSONObject(); + inner.put("link", userVipConfigService.getValueByKey("vip_link")); + inner.put("ion", "http://img.flqapp.com/resource/vip/icon_vip.png"); + inner.put("title", "鍏嶈垂鍗囩骇 浜細鍛樻潈鐩�"); + inner.put("btnName", "鍗囩骇浼氬憳"); + if (uid != null) { + // 鏄惁瀵煎笀 TODO + if (userVIPInfoService.isVIP(uid)) { + inner.put("link", userVipConfigService.getValueByKey("vip_link")); + inner.put("ion", "http://img.flqapp.com/resource/vip/icon_tearcher.png"); + inner.put("title", "鎷夸簲闄╀笌娲ヨ创 浜甯堟潈鐩�"); + inner.put("btnName", "鍗囩骇浼氬憳"); + } else { + UserVIPPreInfo userVIPPreInfo = userVIPPreInfoService.getLatestProcessInfo(uid); + if (userVIPPreInfo != null) { + if (userVIPPreInfo.getProcess() == UserVIPPreInfo.PROCESS_1) { + inner.put("btnName", "鍗囩骇楂樼骇浼氬憳"); + } else if (userVIPPreInfo.getProcess() == UserVIPPreInfo.PROCESS_2) { + inner.put("btnName", "鍗囩骇瓒呯骇浼氬憳"); + } + } + } + } + data.put("vip", inner); + } + if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion()) && uid != null) { + UserLevelUpgradedNotify notify = userLevelUpgradedNotifyService.getNeedNotifyByUid(uid); + if (notify != null) { + Date endTime = getUpgradedTime(uid, notify.getToLevel()); + Date startTime = getUpgradedTime(uid, notify.getFromLevel()); + if (endTime != null && startTime != null) { + VIPUpgradedNotifyVO notifyVO = new VIPUpgradedNotifyVO(); + notifyVO.setDay(TimeUtil.getDayDifferenceCount(startTime, endTime)); + notifyVO.setDetailLink(notify.getToLevel().getDetailLink()); + notifyVO.setFromLevelName(notify.getFromLevel().getName()); + notifyVO.setId("vipUpgradedNotify"); + notifyVO.setSourceId(notify.getId()); + notifyVO.setToLevel(notify.getToLevel().getTag()); + notifyVO.setToLevelName(notify.getToLevel().getName()); + data.put("vipUpgradedNotify", notifyVO); + } + } } out.print(JsonUtil.loadTrueResult(data)); } catch (Exception e) { out.print(JsonUtil.loadFalseResult("鑾峰彇澶辫触")); e.printStackTrace(); } + } + + + + // 鑾峰彇鍗囩骇鏃堕棿 + private Date getUpgradedTime(Long uid, UserLevelEnum level) { + Date time = null; + if (level == UserLevelEnum.superVIP) { + UserVIPInfo vipInfo = userVIPInfoService.selectByUid(uid); + if (vipInfo != null && vipInfo.getState() == UserVIPInfo.STATE_SUCCESS) + time = vipInfo.getSuccessTime(); + + } else if (level == UserLevelEnum.highVIP) { + UserVIPPreInfo info = userVIPPreInfoService.selectByUidAndProcess(uid, level.getLevel()); + if (info != null) + time = info.getCreateTime(); + } else if (level == UserLevelEnum.daRen) { + + // 鎴愪负杈句汉鐨勬椂闂�,鐢ㄦ埛婵�娲绘椂闂� + ThreeSale threeSale = threeSaleSerivce.getByWorkerId(uid); + if (threeSale != null && threeSale.getState() == true && threeSale.getSucceedTime() != null) { + time = new Date(threeSale.getSucceedTime()); + } else {// 鍙栫敤鎴锋敞鍐屾椂闂� + UserInfo user = userInfoService.selectAvailableByPrimaryKey(uid); + time = new Date(user.getCreatetime()); + } + } + + return time; } /** -- Gitblit v1.8.0