From 4aadf484e193995c23ee1d5bb1971a497d2f9a0d Mon Sep 17 00:00:00 2001 From: yujian <yujian> Date: 星期四, 14 三月 2019 15:02:18 +0800 Subject: [PATCH] System 对象更名为 BusinessSystem --- fanli/src/main/java/com/yeshi/fanli/controller/client/InviteGetMoneyController.java | 43 ++++++++++++++++++++++++++++++++++++------- 1 files changed, 36 insertions(+), 7 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/InviteGetMoneyController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/InviteGetMoneyController.java index ab3f298..2596338 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/InviteGetMoneyController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/InviteGetMoneyController.java @@ -20,7 +20,7 @@ import com.yeshi.fanli.entity.bus.user.ThreeSale; import com.yeshi.fanli.entity.bus.user.UserInfo; import com.yeshi.fanli.entity.bus.user.UserInfoExtra; -import com.yeshi.fanli.entity.system.System; +import com.yeshi.fanli.entity.system.BusinessSystem; import com.yeshi.fanli.entity.system.SystemClientParams; import com.yeshi.fanli.exception.NotExistObjectException; import com.yeshi.fanli.exception.banner.SwiperPictureException; @@ -36,6 +36,7 @@ import com.yeshi.fanli.service.inter.user.UserRankingsService; import com.yeshi.fanli.tag.PageEntity; import com.yeshi.fanli.util.Constant; +import com.yeshi.fanli.util.RedisManager; import com.yeshi.fanli.util.account.UserUtil; import net.sf.json.JSONArray; @@ -80,10 +81,13 @@ @Resource private ThreeSaleSerivce threeSaleSerivce; + @Resource + private RedisManager redisManager; + @RequestMapping(value = "/inviteGetMoney", method = RequestMethod.POST) public void everyDayTaskList(AcceptData acceptData, int pageIndex, PrintWriter out, String uid) - throws NotExistObjectException { + throws NotExistObjectException,UserInfoExtraException { // 鏌ヨ鍟嗗搧鎬绘暟 Integer totalCount = 0; int totalPage = totalCount % Constant.PAGE_SIZE == 0 ? totalCount / Constant.PAGE_SIZE @@ -140,7 +144,7 @@ // 娲诲姩瑙勫垯 String key = "activityRules"; // key鍊� - com.yeshi.fanli.entity.system.System system = new System(); + BusinessSystem system = new BusinessSystem(); system.setCreatetime(java.lang.System.currentTimeMillis()); system.setPlatform(1); system.setId(4L); @@ -168,6 +172,23 @@ } data.put("desc", configService.get("invite_desc")); + + boolean hasCode = false; + if (uid != null && uid.trim().length() > 0) { + String inviteCode = userInfoExtraService.getUserInviteCode(Long.parseLong(uid)); + if (inviteCode != null && inviteCode.trim().length() > 0) { + hasCode = true; // 宸叉湁閭�璇风爜 + } + } + + // 閭�璇锋縺娲婚摼鎺� + if (!hasCode) { + data.put("activationlink", configService.get("invite_activation_url")); + } + + data.put("hasCode", hasCode); + + com.alibaba.fastjson.JSONObject root = new com.alibaba.fastjson.JSONObject(); root.put("code", 0); @@ -197,7 +218,7 @@ // 閭�璇疯鍒� String key = "inviteRules"; // key鍊� - com.yeshi.fanli.entity.system.System system = new System(); + com.yeshi.fanli.entity.system.BusinessSystem system = new BusinessSystem(); system.setCreatetime(java.lang.System.currentTimeMillis()); system.setPlatform(1); system.setId(4L); @@ -257,6 +278,7 @@ JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("婵�娲诲け璐�")); return; } + JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("婵�娲绘垚鍔�")); } catch (UserInfoExtraException e) { @@ -317,7 +339,15 @@ return; } + String inviteShortLink = redisManager.getInviteShortLink(uid); + if (inviteShortLink != null && inviteShortLink.trim().length() > 0) { + JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("璇�1鍒嗛挓鍚庡啀璇�")); + return; + } + String shortLink = UserUtil.getInviteShortLink(uid); + // 缂撳瓨1鍒嗛挓 + redisManager.setInviteShortLink(uid, shortLink); JSONObject data = new JSONObject(); data.put("shortLink", shortLink); @@ -344,7 +374,7 @@ } UserInfo userInfo = userInfoService.selectByPKey(uid); - if (userInfo == null || userInfo.getPhone() == null) { + if (userInfo == null || userInfo.getPhone() == null || userInfo.getPhone().trim().length() == 0) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏆傛湭缁戝畾鐢佃瘽鍙风爜")); return; } @@ -374,10 +404,9 @@ try { ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid); if (threeSale == null) { - JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏃犱笂绾ч個璇蜂汉")); + JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(2, "鏃犱笂绾ч個璇蜂汉")); return; } - UserInfo boss = threeSale.getBoss(); if (boss == null) { -- Gitblit v1.8.0