From 3a1b3cc04d2926d830f2a623d656d369ebfb5cb2 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期四, 11 六月 2020 11:59:26 +0800 Subject: [PATCH] 获取导师微信接口,云发单回调修改 --- fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java | 90 ++++++++++++++++++++++++++------------------- 1 files changed, 52 insertions(+), 38 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java index a1c0c49..156ac72 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java @@ -207,20 +207,19 @@ @Resource private UserInviteService userInviteService; - + @Resource private UserInviteValidNumService userInviteValidNumService; - + @Resource private CommonOrderService commonOrderService; - + @Resource private TearcherService tearcherService; - + @Resource private UserVIPPreInfoService userVIPPreInfoService; - - + /** * 鏂扮増鐧诲綍 V1.5.3 * @@ -475,15 +474,15 @@ BigDecimal payMoney = new BigDecimal(userVipConfigService.getValueByKey("require_order_pay")); vo.setFinishGoldCoin(Long.parseLong(integralDetailService.getCumulativeMoney(uid).setScale(0).toString())); - -// vo.setFinishTeam(hongBaoV2CountService.countValidOrderTeamUserByUid(uid, -// , payMoney)); - + + // vo.setFinishTeam(hongBaoV2CountService.countValidOrderTeamUserByUid(uid, + // , payMoney)); + int finishTeam = 0; long vipBegin = TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME); List<ThreeSale> listThreeSale = threeSaleSerivce.getValidWorkerIdsByTime(uid, vipBegin); if (listThreeSale != null && listThreeSale.size() > 0) { - for (ThreeSale three: listThreeSale) { + for (ThreeSale three : listThreeSale) { UserInfo worker = three.getWorker(); if (worker == null || worker.getId() == null) { continue; @@ -491,7 +490,7 @@ // 1銆侀個璇峰叧绯绘垚鍔熷悗锛�2銆佸崟锛堝垎浜� + 鑷喘锛夊疄浠樻澶т簬1鍏� long countValid = commonOrderService.countOrderByUidAndSettled(worker.getId(), payMoney); if (countValid > 0) { - finishTeam ++; + finishTeam++; } } } @@ -554,7 +553,7 @@ JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "鐢ㄦ埛鏈櫥褰�")); return; } - + try { userVIPInfoService.applyVIP(uid); } catch (UserVIPInfoException e) { @@ -573,8 +572,6 @@ } } - - /** * 鑾峰彇vip淇℃伅 * @@ -597,12 +594,12 @@ } // 鑾峰彇绛夌骇 UserInviteLevelEnum level = userInviteService.getUserInviteLevelNew(uid); - + // 杈句汉 long limitOrder = 0; long limitFirst = 0; long limitSecond = 0; - if (level == UserInviteLevelEnum.actived || level == UserInviteLevelEnum.noActive) { + if (level == UserInviteLevelEnum.actived || level == UserInviteLevelEnum.noActive) { String orderCount = userVipConfigService.getValueByKey("vip_pre_7_order_count"); if (!StringUtil.isNullOrEmpty(orderCount)) { limitOrder = Long.parseLong(orderCount); @@ -630,11 +627,11 @@ } } else if (level == UserInviteLevelEnum.vip || level == UserInviteLevelEnum.tearcherApply) { // TODO 姣斾緥 - + } else if (level == UserInviteLevelEnum.tearcher) { // TODO } - + // 鑷喘璁㈠崟 long doneOrder = hongBaoV2CountService.countMyDirectOrderByCashArrival(uid, Constant.VIP_ORDER_PAY); // 鏈夋晥绮変笣 @@ -645,7 +642,7 @@ doneFirst = userInviteValidNum.getNumFirst() == null ? 0 : userInviteValidNum.getNumFirst(); doneSecond = userInviteValidNum.getNumSecond() == null ? 0 : userInviteValidNum.getNumSecond(); } - + Date now = new Date(); Date start = new Date(0); // 鐪侀挶锛� ---杩斿埄璁㈠崟銆佸鍔卞埜鎻愭垚 @@ -653,7 +650,7 @@ typeFanli.add(UserMoneyDetailTypeEnum.fanli); typeFanli.add(UserMoneyDetailTypeEnum.orderReward); BigDecimal saveMoney = userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeFanli, start, now).abs(); - + // 璧氶挶锛� 閭�璇疯鍗曘�佸垎浜鍗曘�佽ˉ璐� List<UserMoneyDetailTypeEnum> typeList = new ArrayList<>(); typeList.add(UserMoneyDetailTypeEnum.share); @@ -667,7 +664,7 @@ saveMoney = MoneyBigDecimalUtil.mul2(saveMoney, rate); earnMoney = MoneyBigDecimalUtil.mul2(earnMoney, rate); } - + String shareRate = "鍙韩浣i噾鐨�<label style=\"color:#E5005C;\">%s</label>"; String teamRate = "鏈�楂樹剑閲戠殑<label style=\"color:#E5005C;\">%s</label>"; // 杈句汉鐗� @@ -675,20 +672,19 @@ jsonrRed1.put("enjoyRate", String.format(shareRate, "145%")); jsonrRed1.put("teamRate", String.format(teamRate, "25%")); jsonrRed1.put("teamIncome", "楂樼骇浼氬憳浠ヤ笂涓撳睘"); - + // 楂樼骇浼氬憳 JSONObject jsonrRed2 = new JSONObject(); jsonrRed2.put("enjoyRate", String.format(shareRate, "195%")); jsonrRed2.put("teamRate", String.format(teamRate, "50%")); jsonrRed2.put("teamIncome", "浜珮绾у洟闃熸敹鐩�"); - + // 瓒呯骇浼氬憳 JSONObject jsonrRed3 = new JSONObject(); jsonrRed3.put("enjoyRate", String.format(shareRate, "210%")); jsonrRed3.put("teamRate", String.format(teamRate, "110%")); jsonrRed3.put("teamIncome", "浜秴绾у洟闃熸敹鐩�"); - - + JSONObject json = new JSONObject(); json.put("level", level.name()); json.put("nickName", userInfo.getNickName()); @@ -696,7 +692,7 @@ json.put("ruleLink", userVipConfigService.getValueByKey("help_link_vip_h5")); json.put("saveMoney", saveMoney); json.put("earnMoney", earnMoney); - + String tearcherWX = ""; TearcherInfo tearcherInfo = tearcherService.selectByUid(uid); if (tearcherInfo != null && !StringUtil.isNullOrEmpty(tearcherInfo.getWxID())) { @@ -705,28 +701,29 @@ json.put("tearcherWX", tearcherWX); json.put("tearcherTip", "鎴戞槸浣犵殑瀵煎笀锛屼负浣犲湪鐪佽禋杩囩▼涓В闅剧瓟鐤戯紝瀵逛綘涓�瀵逛竴杈呭锛屽�惧惉浣犵殑闇�姹傛�荤粨骞跺弽棣堢粰鏉挎牀蹇渷瀹樻柟杩愯惀鍥㈤槦锛屽揩鏉ユ坊鍔犳垜鍚с��"); json.put("newerGongLue", configService.get(ConfigKeyEnum.newerGonglue.getKey())); - + // 宸插畬鎴� json.put("doneOrder", doneOrder); json.put("doneFirst", doneFirst); json.put("doneSecond", doneSecond); - + // 鏍囧噯 json.put("limitOrder", limitOrder); json.put("limitFirst", limitFirst); json.put("limitSecond", limitSecond); - + // 宸插畬鎴� json.put("daRen", jsonrRed1); json.put("highVIP", jsonrRed2); json.put("superVIP", jsonrRed3); - + // 浜哄伐瀹㈡湇閾炬帴 json.put("csdLink", configService.get(ConfigKeyEnum.customerServiceLink.getKey())); - + UserVIPInfo userVIPInfo = userVIPInfoService.selectByUid(uid); String leftTime = ""; - if (userVIPInfo != null && userVIPInfo.getState() == UserVIPInfo.STATE_VERIFING && userVIPInfo.getApplyTime() != null) { + if (userVIPInfo != null && userVIPInfo.getState() == UserVIPInfo.STATE_VERIFING + && userVIPInfo.getApplyTime() != null) { long s = 48 * 60 * 60 - ((System.currentTimeMillis() - userVIPInfo.getApplyTime().getTime()) / 1000); if (s > 3600) { leftTime = s / 3600 + "灏忔椂"; @@ -749,7 +746,6 @@ } } - /** * 鑾峰彇vip淇℃伅 * @@ -769,18 +765,36 @@ JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "杩樻湭鍗囩骇鎴愪负浼氬憳")); return; } - + UserLevelEnum level = UserLevelUtil.getByLevel(vipInfo.getProcess()); if (level == null) { level = UserLevelEnum.daRen; } UserLevelEnum showLevel = UserLevelUtil.getShowLevel(level); - - String desc = "浣犱簬"+ TimeUtil.formatDateDot(vipInfo.getCreateTime()) +"鍗囩骇涓�" + showLevel.getName(); - + + String desc = "浣犱簬" + TimeUtil.formatDateDot(vipInfo.getCreateTime()) + "鍗囩骇涓�" + showLevel.getName(); + JSONObject json = new JSONObject(); json.put("desc", desc); JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(json)); } + @RequestMapping(value = "getTearcherWX") + public void getTearcherWX(String callback, AcceptData acceptData, Long uid, PrintWriter out) { + if (uid == null || uid <= 0) { + JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "鐢ㄦ埛鏈櫥褰�")); + return; + } + TearcherInfo tearcher = tearcherService.selectByUid(uid); + if (tearcher == null) { + JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏃犲甯�")); + return; + } else { + JSONObject data = new JSONObject(); + data.put("wx", tearcher.getWxID()); + JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); + return; + } + } + } -- Gitblit v1.8.0