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 | 311 +++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 246 insertions(+), 65 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 05f36b2..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 @@ -1,6 +1,9 @@ package com.yeshi.fanli.controller.client.v1; import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; import javax.annotation.Resource; @@ -12,27 +15,45 @@ import com.yeshi.fanli.entity.accept.AcceptData; import com.yeshi.fanli.entity.bus.homemodule.FloatAD; +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.tlj.DeviceTaoLiJinRecord; -import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin; -import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin.TaoLiJinOriginEnum; +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; import com.yeshi.fanli.entity.taobao.ClientTBPid; import com.yeshi.fanli.service.inter.common.JumpDetailV2Service; import com.yeshi.fanli.service.inter.config.ConfigService; import com.yeshi.fanli.service.inter.homemodule.FloatADService; +import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService; import com.yeshi.fanli.service.inter.msg.MsgDeviceReadStateService; import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService; -import com.yeshi.fanli.service.inter.tlj.DeviceTaoLiJinRecordService; import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService; 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.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; @@ -71,19 +92,45 @@ private UserTaoLiJinOriginService uerTaoLiJinOriginService; @Resource - private DeviceTaoLiJinRecordService deviceTaoLiJinRecordService; - - @Resource private UserActiveLogService userActiveLogService; + @Resource + private SwiperPictureService swiperPictureService; + + @Resource + private UserActivedRecordService userActivedRecordService; + + @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 棣栭〉閰嶇疆淇℃伅 * * @param acceptData * @param out */ @RequestMapping(value = "getHomeConfig", method = RequestMethod.POST) public void getHomeConfig(AcceptData acceptData, Long uid, PrintWriter out) { + if (uid != null && uid == 0L) + uid = null; + AppHomeFloatImg appHomeFloatImg = configService.getAppHomeFloatImg(); if ("ios".equalsIgnoreCase(acceptData.getPlatform()) && !Constant.IS_TEST) { appHomeFloatImg = null; @@ -99,29 +146,9 @@ data.put("floatNotifyImg", notifyImg); } - FloatAD floatAD = null; - - if (VersionUtil.greaterThan_1_5_60(acceptData.getPlatform(), acceptData.getVersion())) { - if (uid == null) { - DeviceTaoLiJinRecord deviceRecord = deviceTaoLiJinRecordService.getByDevice(acceptData.getDevice()); - if (deviceRecord == null) { - floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX, 1); - } - } else { - UserTaoLiJinOrigin userTaoLiJin = uerTaoLiJinOriginService.getByUidAndOrigin(uid, - TaoLiJinOriginEnum.newbiesWin.name()); - if (userTaoLiJin == null) { - floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX, 1); - } - } - } - // 鏃犳柊浜哄脊妗� 鍒欐煡璇㈤粯璁� - if (floatAD == null) { - floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX, 0); - } - - if (floatAD != null) { + FloatAD floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX, 0); + if (floatAD != null && floatAD.getTypeEnum() != FloatADTypeEnum.newUserRedPack) { JSONObject detail = new JSONObject(); detail.put("img", floatAD.getPicture()); detail.put("jumpDetail", floatAD.getJumpDetail()); @@ -132,13 +159,13 @@ } // 棰嗗埜甯姪閾炬帴,1.5.2鍚庣敓鏁� - String couponHelp = configService.get("taobao_coupon_help"); + String couponHelp = configService.get(ConfigKeyEnum.taobaoCouponHelp.getKey()); data.put("couponHelpUrl", couponHelp); // 搴曢儴缃戦〉閾炬帴 String platform = acceptData.getPlatform(); if ("android".equalsIgnoreCase(platform)) { - data.put("htmlLink", configService.get("index_html_link_android")); + data.put("htmlLink", configService.get(ConfigKeyEnum.indexHtmlLinkAndroid.getKey())); } // 鍒ゆ柇鏂拌�佺敤鎴� @@ -151,7 +178,8 @@ } else {// 鑰佷汉 data.put("userTimeType", 1); } - data.put("hotFuctionLink", configService.get("hot_function_url")); + data.put("hotFuctionLink", configService.getByVersion(ConfigKeyEnum.hotFunctionUrl.getKey(), platform, + Integer.parseInt(acceptData.getVersion())));// out.print(JsonUtil.loadTrueResult(data)); } @@ -164,25 +192,7 @@ */ @RequestMapping(value = "getMSGConfig", method = RequestMethod.POST) public void getMSGConfig(AcceptData acceptData, Long uid, PrintWriter out) { - JSONObject data = new JSONObject(); - boolean show = false; - if (uid != null) { - show = uerTaoLiJinOriginService.hasRankHongBao(uid); - } - - if (show) { - FloatAD floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_MSGCENTER, null); - if (floatAD != null) { - JSONObject detail = new JSONObject(); - detail.put("img", floatAD.getPicture()); - detail.put("jumpDetail", floatAD.getJumpDetail()); - detail.put("params", floatAD.getParams()); - detail.put("showTime", floatAD.getShowMode()); - detail.put("accountLogin", floatAD.isJumpNeedLogin()); - data.put("floatImgDetail", detail); - } - } - out.print(JsonUtil.loadTrueResult(data)); + out.print(JsonUtil.loadFalseResult("鎺ㄥ箍绾㈠寘鐩稿叧鍔熻兘宸蹭笅绾匡紒")); } @RequestMapping(value = "getTaoBaoCartConfig", method = RequestMethod.POST) @@ -193,7 +203,8 @@ } // 鏄惁闇�瑕佽喘鐗╁煄杞摼 - boolean convert = "0".equalsIgnoreCase(configService.get("show_taobao_cart_convert")) ? false : true; + boolean convert = "0".equalsIgnoreCase(configService.get(ConfigKeyEnum.showTaobaoCartConvert.getKey())) ? false + : true; if (!"cart".equalsIgnoreCase(position) && !convert) { out.print(JsonUtil.loadFalseResult("")); @@ -207,8 +218,8 @@ clientTBPid = tbPidService.getAndroidDefault(); } - String cartJS = configService.get("taobao_cart_js"); - String cartUrl = configService.get("taobao_cart_link"); + String cartJS = configService.get(ConfigKeyEnum.taobaoCartJS.getKey()); + String cartUrl = configService.get(ConfigKeyEnum.taobaoCartLink.getKey()); if (!convert)// 涓嶈浆閾� { cartUrl = "http://"; @@ -260,33 +271,190 @@ @RequestMapping(value = "getBindAccountConfig", method = RequestMethod.POST) public void getBindAccountConfig(AcceptData acceptData, PrintWriter out) { - String alipayHelpUrl = configService.get("alipay_help");// 鏀粯瀹濆府鍔� - String alipayBindFailUrl = configService.get("alipay_bind_fail_reason");// 鏀粯瀹濈粦瀹氬け璐ュ師鍥� + String alipayHelpUrl = configService.get(ConfigKeyEnum.alipayHelp.getKey());// 鏀粯瀹濆府鍔� + String alipayBindFailUrl = configService.get(ConfigKeyEnum.alipayBindFailReason.getKey());// 鏀粯瀹濈粦瀹氬け璐ュ師鍥� JSONObject data = new JSONObject(); data.put("alipayHelp", alipayHelpUrl); data.put("alipayBindFailReason", alipayBindFailUrl); 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, String sourceId, 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 if (id.equalsIgnoreCase("vipUpgradedNotify")) { + userLevelUpgradedNotifyService.setNotified(sourceId); + 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("service_protocol_link"); + String serviceProtocol = configService.get(ConfigKeyEnum.serviceProtocolLink.getKey()); // 闅愮鏉℃閾炬帴 - String privacyProtocol = configService.get("privacy_protocol_link"); + String privacyProtocol = configService.get(ConfigKeyEnum.privacyProtocolLink.getKey()); JSONObject data = new JSONObject(); data.put("serviceProtocolLink", serviceProtocol); data.put("privacyProtocolLink", privacyProtocol); // 璐墿杞﹁烦杞柟寮�(鍖呭惈jumpDetail涓巔arams) - JSONObject source = JSONObject.fromObject(configService.get("taobao_cart_jump_detail")); + 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())); + 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) && !StringUtil.isNullOrEmpty(tearcherLink)) { + 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); + } + } + + + 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; } /** @@ -298,10 +466,10 @@ @RequestMapping(value = "getOrderParseConfig", method = RequestMethod.POST) public void getOrderParseConfig(AcceptData acceptData, PrintWriter out) { - if ("0".equalsIgnoreCase(configService.get("auto_find_taobao_order"))) + if ("0".equalsIgnoreCase(configService.get(ConfigKeyEnum.autoFindTaobaoOrder.getKey()))) out.print(JsonUtil.loadFalseResult(1, "鏆備笉鏀寔")); else { - String orderJS = configService.get("taobao_order_parse_js"); + String orderJS = configService.get(ConfigKeyEnum.taobaoOrderParseJS.getKey()); JSONObject data = new JSONObject(); try { data.put("orderJS", DESUtil.encode(orderJS, StringUtil.getBase64String("YeShiFANLI889*+"), @@ -327,7 +495,8 @@ public void getOrderConfig(AcceptData acceptData, PrintWriter out) { JSONObject data = new JSONObject(); // 娴嬭瘯 - data.put("showTaoBaoOrder", "0".equalsIgnoreCase(configService.get("show_taobao_order").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)); } @@ -335,7 +504,7 @@ @RequestMapping(value = "getKeFuConfig", method = RequestMethod.POST) public void getKeFuConfig(AcceptData acceptData, PrintWriter out) { JSONObject data = new JSONObject(); - data.put("meiqia", "1".equalsIgnoreCase(configService.get("kefu_meiqia")) ? true : false);// 鏄惁璺宠浆缇庢唇锛屼笉璺宠浆缇庢唇灏辩敤鍘熸潵鐨� + data.put("meiqia", "1".equalsIgnoreCase(configService.get(ConfigKeyEnum.kefuMeiqia.getKey())) ? true : false);// 鏄惁璺宠浆缇庢唇锛屼笉璺宠浆缇庢唇灏辩敤鍘熸潵鐨� out.print(JsonUtil.loadTrueResult(data)); // 璁剧疆娑堟伅宸茶 ThreadUtil.run(new Runnable() { @@ -345,7 +514,19 @@ "android".equalsIgnoreCase(acceptData.getPlatform()) ? 1 : 2); } }); + } + /** + * 鑾峰彇閭�璇风爜甯姪閾炬帴 + * + * @param acceptData + * @param out + */ + @RequestMapping(value = "getInviteCodeInputHelp", method = RequestMethod.POST) + public void getInviteCodeInputHelp(AcceptData acceptData, PrintWriter out) { + JSONObject data = new JSONObject(); + data.put("helpUrl", configService.get(ConfigKeyEnum.inviteCodeInputHelp.getKey())); + out.print(JsonUtil.loadTrueResult(data)); } } -- Gitblit v1.8.0